@inkeep/open-knowledge 0.14.0 → 0.14.1-beta.1

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 (34) 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 +5 -5
  4. package/dist/constants-C7m8kE3x.mjs +2 -0
  5. package/dist/index.mjs +1 -1
  6. package/dist/init-DGzF4yPe.mjs +1 -0
  7. package/dist/{init-jcAHeLa_.mjs → init-DzONFFom.mjs} +3 -3
  8. package/dist/{loader-mjTOJVaE.mjs → loader-BMRP9prn.mjs} +2 -2
  9. package/dist/loader-C2W1FT_X.mjs +1 -0
  10. package/dist/preview-9bljwK_U.mjs +1 -0
  11. package/dist/{preview-ChJz7WRr.mjs → preview-BANXpVov.mjs} +2 -2
  12. package/dist/public/assets/{ActivityModeContent-CLgsnxvy.js → ActivityModeContent-D1LV0i9s.js} +1 -1
  13. package/dist/public/assets/{DocumentContext-W66sHYhr.js → DocumentContext-CAteDFxs.js} +1 -1
  14. package/dist/public/assets/{OpenInAgentMenuRequestContext-wXLHH5sG.js → OpenInAgentMenuRequestContext-DGTqGF-d.js} +1 -1
  15. package/dist/public/assets/{SettingsDialogBody-DGaBSj-I.js → SettingsDialogBody-CJW_Sq1u.js} +1 -1
  16. package/dist/public/assets/{SourceEditor-DSWV4EVC.js → SourceEditor-Dz9mWVTl.js} +1 -1
  17. package/dist/public/assets/{config-validation-events-DbjF6isi.js → config-validation-events-C_5rJceh.js} +1 -1
  18. package/dist/public/assets/index-4X6bXAZx.css +1 -0
  19. package/dist/public/assets/index-DzPdElTu.js +2019 -0
  20. package/dist/public/assets/{telemetry-impl-goM_E67-.js → telemetry-impl-DSmdYH7T.js} +1 -1
  21. package/dist/public/index.html +5 -5
  22. package/dist/{repair-launch-json-Czc2yHcG.mjs → repair-launch-json-ZP0QYT4Z.mjs} +2 -2
  23. package/dist/{repair-mcp-configs-Dq7otP72.mjs → repair-mcp-configs-BrxT4PHC.mjs} +2 -2
  24. package/dist/{src-HQchXcCF.mjs → src-BJFJd9Ky.mjs} +2 -2
  25. package/dist/start-D8PLZMQh.mjs +1 -0
  26. package/dist/{start-CuVjBFi9.mjs → start-QeD6GkFH.mjs} +2 -2
  27. package/package.json +1 -1
  28. package/dist/constants-mekl87aw.mjs +0 -2
  29. package/dist/init-BfEIurUw.mjs +0 -1
  30. package/dist/loader-DwQk4S20.mjs +0 -1
  31. package/dist/preview-B8boaO6G.mjs +0 -1
  32. package/dist/public/assets/index-6Mbfxh3T.css +0 -1
  33. package/dist/public/assets/index-uIc17Io3.js +0 -2019
  34. package/dist/start-Bu63EnUP.mjs +0 -1
@@ -1,2 +1,2 @@
1
- import{o as e}from"./chunk-CFjPhJqf.js";import{a as t,o as n,t as r}from"./compiler-runtime-Cs91PcD2.js";import{Dt as i,Et as a,H as o,M as s,N as c,P as l,Sn as u,W as d,Y as ee,Z as f,_n as p,bn as m,fn as h,gn as g,hn as _,mn as v,pn as y,un as b,vn as x,xn as S,yn as C}from"./DocumentContext-W66sHYhr.js";import{U as te}from"./prop-types-BKGsVwoQ.js";import{$t as w,I as T,Mr as ne}from"./dist-BW0ROjDr.js";import{l as re}from"./keyboard-shortcuts-DesPYmCt.js";import{$ as E,Dt as ie,Et as D,Ft as O,J as k,Ot as A,P as j,Q as M,Tt as N,X as P,jt as F,pt as ae,ut as oe,xt as I}from"./dist-oO1mEK6k.js";import{a as se,d as ce,i as le,m as ue,n as de,p as fe,u as pe}from"./OpenInAgentMenuRequestContext-wXLHH5sG.js";var L=e(t(),1),me=r(),R=class e{constructor(e,t){this.yanchor=e,this.yhead=t}toJSON(){return{yanchor:p(this.yanchor),yhead:p(this.yhead)}}static fromJSON(t){return new e(_(t.yanchor),_(t.yhead))}},z=class{constructor(e,t){this.ytext=e,this.awareness=t,this.undoManager=new h(e)}toYPos(e,t=0){return g(this.ytext,e,t)}fromYPos(e){let t=v(_(e),this.ytext.doc);if(t==null||t.type!==this.ytext)throw Error(`[y-codemirror] The position you want to retrieve was created by a different document`);return{pos:t.index,assoc:t.assoc}}toYRange(e){let t=e.assoc;return new R(this.toYPos(e.anchor,t),this.toYPos(e.head,t))}fromYRange(e){let t=this.fromYPos(e.yanchor),n=this.fromYPos(e.yhead);return t.pos===n.pos?D.cursor(n.pos,n.assoc):D.range(t.pos,n.pos)}},B=A.define({combine(e){return e[e.length-1]}}),V=I.define(),H=class{constructor(e){this.view=e,this.conf=e.state.facet(B),this._observer=(t,n)=>{if(n.origin!==this.conf){let n=t.delta,r=[],i=0;for(let e=0;e<n.length;e++){let t=n[e];t.insert==null?t.delete==null?i+=t.retain:(r.push({from:i,to:i+t.delete,insert:``}),i+=t.delete):r.push({from:i,to:i,insert:t.insert})}e.dispatch({changes:r,annotations:[V.of(this.conf)]})}},this._ytext=this.conf.ytext,this._ytext.observe(this._observer)}update(e){if(!e.docChanged||e.transactions.length>0&&e.transactions[0].annotation(V)===this.conf)return;let t=this.conf.ytext;t.doc.transact(()=>{let n=0;e.changes.iterChanges((e,r,i,a,o)=>{let s=o.sliceString(0,o.length,`
1
+ import{o as e}from"./chunk-CFjPhJqf.js";import{a as t,o as n,t as r}from"./compiler-runtime-Cs91PcD2.js";import{Dt as i,Et as a,H as o,M as s,N as c,P as l,Sn as u,W as d,Y as ee,Z as f,_n as p,bn as m,fn as h,gn as g,hn as _,mn as v,pn as y,un as b,vn as x,xn as S,yn as C}from"./DocumentContext-CAteDFxs.js";import{U as te}from"./prop-types-BKGsVwoQ.js";import{$t as w,I as T,Mr as ne}from"./dist-BW0ROjDr.js";import{l as re}from"./keyboard-shortcuts-DesPYmCt.js";import{$ as E,Dt as ie,Et as D,Ft as O,J as k,Ot as A,P as j,Q as M,Tt as N,X as P,jt as F,pt as ae,ut as oe,xt as I}from"./dist-oO1mEK6k.js";import{a as se,d as ce,i as le,m as ue,n as de,p as fe,u as pe}from"./OpenInAgentMenuRequestContext-DGTqGF-d.js";var L=e(t(),1),me=r(),R=class e{constructor(e,t){this.yanchor=e,this.yhead=t}toJSON(){return{yanchor:p(this.yanchor),yhead:p(this.yhead)}}static fromJSON(t){return new e(_(t.yanchor),_(t.yhead))}},z=class{constructor(e,t){this.ytext=e,this.awareness=t,this.undoManager=new h(e)}toYPos(e,t=0){return g(this.ytext,e,t)}fromYPos(e){let t=v(_(e),this.ytext.doc);if(t==null||t.type!==this.ytext)throw Error(`[y-codemirror] The position you want to retrieve was created by a different document`);return{pos:t.index,assoc:t.assoc}}toYRange(e){let t=e.assoc;return new R(this.toYPos(e.anchor,t),this.toYPos(e.head,t))}fromYRange(e){let t=this.fromYPos(e.yanchor),n=this.fromYPos(e.yhead);return t.pos===n.pos?D.cursor(n.pos,n.assoc):D.range(t.pos,n.pos)}},B=A.define({combine(e){return e[e.length-1]}}),V=I.define(),H=class{constructor(e){this.view=e,this.conf=e.state.facet(B),this._observer=(t,n)=>{if(n.origin!==this.conf){let n=t.delta,r=[],i=0;for(let e=0;e<n.length;e++){let t=n[e];t.insert==null?t.delete==null?i+=t.retain:(r.push({from:i,to:i+t.delete,insert:``}),i+=t.delete):r.push({from:i,to:i,insert:t.insert})}e.dispatch({changes:r,annotations:[V.of(this.conf)]})}},this._ytext=this.conf.ytext,this._ytext.observe(this._observer)}update(e){if(!e.docChanged||e.transactions.length>0&&e.transactions[0].annotation(V)===this.conf)return;let t=this.conf.ytext;t.doc.transact(()=>{let n=0;e.changes.iterChanges((e,r,i,a,o)=>{let s=o.sliceString(0,o.length,`
2
2
  `);e!==r&&t.delete(e+n,r-e),s.length>0&&t.insert(e+n,s),n+=s.length-(r-e)})},this.conf)}destroy(){this._ytext.unobserve(this._observer)}},U=M.fromClass(H),W=P.baseTheme({".cm-ySelection":{},".cm-yLineSelection":{padding:0,margin:`0px 2px 0px 4px`},".cm-ySelectionCaret":{position:`relative`,borderLeft:`1px solid black`,borderRight:`1px solid black`,marginLeft:`-1px`,marginRight:`-1px`,boxSizing:`border-box`,display:`inline`},".cm-ySelectionCaretDot":{borderRadius:`50%`,position:`absolute`,width:`.4em`,height:`.4em`,top:`-.2em`,left:`-.2em`,backgroundColor:`inherit`,transition:`transform .3s ease-in-out`,boxSizing:`border-box`},".cm-ySelectionCaret:hover > .cm-ySelectionCaretDot":{transformOrigin:`bottom center`,transform:`scale(0)`},".cm-ySelectionInfo":{position:`absolute`,top:`-1.05em`,left:`-1px`,fontSize:`.75em`,fontFamily:`serif`,fontStyle:`normal`,fontWeight:`normal`,lineHeight:`normal`,userSelect:`none`,color:`white`,paddingLeft:`2px`,paddingRight:`2px`,zIndex:101,transition:`opacity .3s ease-in-out`,backgroundColor:`inherit`,opacity:0,transitionDelay:`0s`,whiteSpace:`nowrap`},".cm-ySelectionCaret:hover > .cm-ySelectionInfo":{opacity:1,transitionDelay:`0s`}}),G=I.define(),K=class extends E{constructor(e,t){super(),this.color=e,this.name=t}toDOM(){return x(`span`,[m(`class`,`cm-ySelectionCaret`),m(`style`,`background-color: ${this.color}; border-color: ${this.color}`)],[C(`⁠`),x(`div`,[m(`class`,`cm-ySelectionCaretDot`)]),C(`⁠`),x(`div`,[m(`class`,`cm-ySelectionInfo`)],[C(this.name)]),C(`⁠`)])}eq(e){return e.color===this.color}compare(e){return e.color===this.color}updateDOM(){return!1}get estimatedHeight(){return-1}ignoreEvent(){return!0}},q=class{constructor(e){this.conf=e.state.facet(B),this._listener=({added:t,updated:n,removed:r},i,a)=>{t.concat(n).concat(r).findIndex(e=>e!==this.conf.awareness.doc.clientID)>=0&&e.dispatch({annotations:[G.of([])]})},this._awareness=this.conf.awareness,this._awareness.on(`change`,this._listener),this.decorations=F.of([])}destroy(){this._awareness.off(`change`,this._listener)}update(e){let t=this.conf.ytext,n=t.doc,r=this.conf.awareness,i=[],a=this.conf.awareness.getLocalState();if(a!=null){let n=e.view.hasFocus&&e.view.dom.ownerDocument.hasFocus(),i=n?e.state.selection.main:null,o=a.cursor==null?null:_(a.cursor.anchor),s=a.cursor==null?null:_(a.cursor.head);if(i!=null){let e=g(t,i.anchor),n=g(t,i.head);(a.cursor==null||!y(o,e)||!y(s,n))&&r.setLocalStateField(`cursor`,{anchor:e,head:n})}else a.cursor!=null&&n&&r.setLocalStateField(`cursor`,null)}r.getStates().forEach((a,o)=>{if(o===r.doc.clientID)return;let s=a.cursor;if(s==null||s.anchor==null||s.head==null)return;let c=v(s.anchor,n),l=v(s.head,n);if(c==null||l==null||c.type!==t||l.type!==t)return;let{color:d=`#30bced`,name:ee=`Anonymous`}=a.user||{},f=a.user&&a.user.colorLight||d+`33`,p=u(c.index,l.index),m=S(c.index,l.index),h=e.view.state.doc.lineAt(p),g=e.view.state.doc.lineAt(m);if(h.number===g.number)i.push({from:p,to:m,value:k.mark({attributes:{style:`background-color: ${f}`},class:`cm-ySelection`})});else{i.push({from:p,to:h.from+h.length,value:k.mark({attributes:{style:`background-color: ${f}`},class:`cm-ySelection`})}),i.push({from:g.from,to:m,value:k.mark({attributes:{style:`background-color: ${f}`},class:`cm-ySelection`})});for(let t=h.number+1;t<g.number;t++){let n=e.view.state.doc.line(t).from;i.push({from:n,to:n,value:k.line({attributes:{style:`background-color: ${f}`,class:`cm-yLineSelection`}})})}}i.push({from:l.index,to:l.index,value:k.widget({side:l.index-c.index>0?-1:1,block:!1,widget:new K(d,ee)})})}),this.decorations=k.set(i,!0)}},J=M.fromClass(q,{decorations:e=>e.decorations}),Y=class{constructor(e){this.undoManager=e}addTrackedOrigin(e){this.undoManager.addTrackedOrigin(e)}removeTrackedOrigin(e){this.undoManager.removeTrackedOrigin(e)}undo(){return this.undoManager.undo()!=null}redo(){return this.undoManager.redo()!=null}},X=A.define({combine(e){return e[e.length-1]}});I.define();var Z=class{constructor(e){this.view=e,this.conf=e.state.facet(X),this._undoManager=this.conf.undoManager,this.syncConf=e.state.facet(B),this._beforeChangeSelection=null,this._mux=b(),this._onStackItemAdded=({stackItem:e,changedParentTypes:t})=>{t.has(this.syncConf.ytext)&&this._beforeChangeSelection&&!e.meta.has(this)&&e.meta.set(this,this._beforeChangeSelection)},this._onStackItemPopped=({stackItem:t})=>{let n=t.meta.get(this);if(n){let t=this.syncConf.fromYRange(n);e.dispatch(e.state.update({selection:t,effects:[P.scrollIntoView(t)]})),this._storeSelection()}},this._storeSelection=()=>{this._beforeChangeSelection=this.syncConf.toYRange(this.view.state.selection.main)},this._undoManager.on(`stack-item-added`,this._onStackItemAdded),this._undoManager.on(`stack-item-popped`,this._onStackItemPopped),this._undoManager.addTrackedOrigin(this.syncConf)}update(e){e.selectionSet&&(e.transactions.length===0||e.transactions[0].annotation(V)!==this.syncConf)&&this._storeSelection()}destroy(){this._undoManager.off(`stack-item-added`,this._onStackItemAdded),this._undoManager.off(`stack-item-popped`,this._onStackItemPopped),this._undoManager.removeTrackedOrigin(this.syncConf)}},Q=M.fromClass(Z),he=({state:e,dispatch:t})=>e.facet(X).undo()||!0,ge=({state:e,dispatch:t})=>e.facet(X).redo()||!0,_e=(e,t,{undoManager:n=new h(e)}={})=>{let r=new z(e,t),i=[B.of(r),U];return t&&i.push(W,J),n!==!1&&i.push(X.of(new Y(n)),Q,P.domEventHandlers({beforeinput(e,t){return e.inputType===`historyUndo`?he(t):e.inputType===`historyRedo`?ge(t):!1}})),i},ve=k.mark({class:`cm-link-ref-broken`}),ye=/^\s{0,3}\[([^\]]+)\]:\s/,be=/\[([^\]]*)\]\[([^\]]*)\]/g,xe=new Set([`FencedCode`,`CodeBlock`,`InlineCode`]);function $(e,t){let n=0,r=t.length-1;for(;n<=r;){let i=n+r>>1,a=t[i];if(e<a.from)r=i-1;else if(e>=a.to)n=i+1;else return!0}return!1}function Se(e){let t=[];return j(e).iterate({enter(e){if(xe.has(e.name))return t.push({from:e.from,to:e.to}),!1}}),t.sort((e,t)=>e.from-t.from),t}function Ce(e){let t=new Set,n=[],r=e.doc,i=Se(e);for(let e=1;e<=r.lines;e++){let n=r.line(e);if($(n.from,i))continue;let a=ye.exec(n.text);a&&t.add(a[1].toLowerCase())}for(let e=1;e<=r.lines;e++){let t=r.line(e);if(!$(t.from,i)&&!ye.test(t.text))for(be.lastIndex=0;;){let e=be.exec(t.text);if(!e)break;let r=t.from+e.index;if($(r,i))continue;let a=e[2]||e[1];n.push({from:r,to:r+e[0].length,label:a.toLowerCase()})}}let a=[];for(let e of n)t.has(e.label)||a.push(ve.range(e.from,e.to));return a.sort((e,t)=>e.from-t.from),k.set(a)}var we=O.define({create(e){return Ce(e)},update(e,t){return t.docChanged?Ce(t.state):e},provide:e=>P.decorations.from(e)}),Te=/^(\s*(?:[-*+]|\d+[.)]) (?:\[[ x]\] )?)/,Ee=k.mark({class:`cm-del`}),De=k.line({class:`cm-table-header`,attributes:{style:`--list-hang: 2ch`}}),Oe=k.line({class:`cm-table-row`,attributes:{style:`--list-hang: 2ch`}});function ke(e){let t=0;for(let n of e)if(n===` `)t++;else if(n===` `)t+=4;else break;return t}function Ae(e){if(e.doc.lines<2)return null;let t=e.doc.line(1);if(!T.test(t.text))return null;for(let n=2;n<=e.doc.lines;n++){let r=e.doc.line(n);if(T.test(r.text))return{from:t.from,to:r.to}}return null}function je(e,t){let n=[],r=j(e),i=Ae(e),a=e=>i!==null&&e>=i.from&&e<=i.to;for(let{from:i,to:o}of t)r.iterate({from:i,to:o,enter(t){if(!a(t.from)){if(t.name===`Strikethrough`){let e=t.from,r=t.to,i=t.node.cursor();if(i.firstChild())do i.name===`StrikethroughMark`&&(i.from===t.from?e=i.to:r=i.from);while(i.nextSibling());return e<r&&n.push(Ee.range(e,r)),!1}if(t.name===`ListItem`){let r=e.doc.lineAt(t.from),i=Te.exec(r.text),a=i?i[1].length:2,o=k.line({class:`cm-list-item`,attributes:{style:`--list-hang: ${a}ch`}});n.push(o.range(r.from));return}if(t.name===`FencedCode`){let r=e.doc.lineAt(t.from),i=e.doc.lineAt(t.to);for(let t=r.number+1;t<i.number;t++){let r=e.doc.line(t),i=ke(r.text),a=k.line({class:`cm-fenced-code-line`,attributes:{style:`--line-indent: ${i}`}});n.push(a.range(r.from))}return!1}if(t.name===`TableHeader`){let r=e.doc.lineAt(t.from);return n.push(De.range(r.from)),!1}if(t.name===`TableRow`){let r=e.doc.lineAt(t.from);return n.push(Oe.range(r.from)),!1}if(t.name===`TableDelimiter`&&t.node.parent?.name===`Table`){let r=e.doc.lineAt(t.from);return n.push(Oe.range(r.from)),!1}}}});return n.sort((e,t)=>e.from-t.from||e.value.startSide-t.value.startSide),k.set(n)}var Me=class{decorations;constructor(e){this.decorations=je(e.state,e.visibleRanges)}update(e){(e.docChanged||e.viewportChanged||j(e.startState)!==j(e.state))&&(this.decorations=je(e.view.state,e.view.visibleRanges))}},Ne=M.fromClass(Me,{decorations:e=>e.decorations});function Pe(){return[Ne,we]}var Fe=n(),Ie=56;function Le(e,t){let n=e.state.doc,r=1;if(n.lines>=1&&T.test(n.line(1).text)){for(let e=2;e<=n.lines;e++)if(T.test(n.line(e).text)){r=e+1;break}}let i=w(),a=0;for(let o=r;o<=n.lines;o++){let r=n.line(o);if(!i(r.text)&&/^#{1,6}\s/.test(r.text)){if(a===t.index){e.dispatch({selection:D.cursor(r.from),effects:P.scrollIntoView(r.from,{y:`start`})}),e.focus();return}a++}}}function Re(e,t){requestAnimationFrame(()=>{let n=e.state.doc,r=Math.min(t.offset,n.length);e.dispatch({selection:D.cursor(r),effects:P.scrollIntoView(r,{y:`center`})}),e.focus()})}function ze(e){let t=e.state.selection.main;return t.empty?``:e.state.sliceDoc(t.from,t.to)}function Be(e){let t=(0,me.c)(39),{docName:n,ytext:r,provider:o,placeholder:u,isSourceModeActive:p}=e,m=(0,L.useRef)(null),h=(0,L.useRef)(null),g;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(g=new N,t[0]=g):g=t[0];let _=(0,L.useRef)(g),v;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(v=new N,t[1]=v):v=t[1];let y=(0,L.useRef)(v),b;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(b=new N,t[2]=b):b=t[2];let x=(0,L.useRef)(b),[S,C]=(0,L.useState)(null);if(S)throw S;let{resolvedTheme:w}=te(),{merged:T}=d(),{openSelection:E}=de(),D=(0,L.useRef)(E),O=(0,L.useRef)(p),k=T?.editor?.wordWrap??!0,A,j;t[3]===E?(A=t[4],j=t[5]):(A=()=>{D.current=E},j=[E],t[3]=E,t[4]=A,t[5]=j),(0,L.useEffect)(A,j);let M,F;t[6]===p?(M=t[7],F=t[8]):(M=()=>{O.current=p},F=[p],t[6]=p,t[7]=M,t[8]=F),(0,L.useEffect)(M,F);let I=(0,L.useRef)(null),R;t[9]!==u||t[10]!==o||t[11]!==w||t[12]!==k||t[13]!==r?(R=()=>{let e=m.current;if(!e)return;let t=o.configuration.name??``,n,c=He;try{n=a({docName:t,container:e,sizeStats:{viewCount:0,bytes:r.length},factory:e=>{let n=null,i=f({ydoc:o.document,ytext:r}),a=new P({state:ie.create({doc:r.toString(),extensions:[pe,oe.of([ee]),_e(r,o.awareness),...s({themeCompartment:_.current,resolvedTheme:w,ydoc:o.document,wordWrapCompartment:x.current,wordWrap:k}),Pe(),i,P.updateListener.of(e=>{!e.selectionSet&&!e.docChanged||(n!==null&&clearTimeout(n),n=setTimeout(()=>{n=null,le(t,`source`,se(e.view))},120))}),P.domEventHandlers({keydown:(e,n)=>!O.current||!ne()||!re(e,`edit-with-ai`)?!1:(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),D.current({docName:t,instruction:``,selectionMarkdown:ze(n)}),!0)}),y.current.of(ae(u??``)),P.theme({"&":{height:`100%`}}),P.scrollMargins.of(Ve)]}),parent:e});le(t,`source`,se(a));let l=a.contentDOM;return l.addEventListener(`keydown`,c),l.addEventListener(`paste`,c),l.addEventListener(`drop`,c),l.addEventListener(`cut`,c),{view:a,ydoc:o.document,ytext:r,provider:o}}}),I.current=n,h.current=n.view}catch(e){let t=e;console.error(`[SourceEditor] mountCmEditor failed`,t),I.current=null,h.current=null,C(t instanceof Error?t:Error(String(t)))}return()=>{let e=I.current;e&&i(e),I.current=null,h.current=null}},t[9]=u,t[10]=o,t[11]=w,t[12]=k,t[13]=r,t[14]=R):R=t[14];let z;t[15]!==o||t[16]!==r?(z=[r,o],t[15]=o,t[16]=r,t[17]=z):z=t[17],(0,L.useEffect)(R,z);let B,V;t[18]===n?(B=t[19],V=t[20]):(B=()=>{},V=[n],t[18]=n,t[19]=B,t[20]=V),(0,L.useEffect)(B,V);let H,U;t[21]===w?(H=t[22],U=t[23]):(H=()=>{h.current&&h.current.dispatch({effects:_.current.reconfigure(w===`dark`?c:l)})},U=[w],t[21]=w,t[22]=H,t[23]=U),(0,L.useEffect)(H,U);let W,G;t[24]===k?(W=t[25],G=t[26]):(W=()=>{h.current&&h.current.dispatch({effects:x.current.reconfigure(k?P.lineWrapping:[])})},G=[k],t[24]=k,t[25]=W,t[26]=G),(0,L.useEffect)(W,G);let K,q;t[27]===u?(K=t[28],q=t[29]):(K=()=>{h.current&&h.current.dispatch({effects:y.current.reconfigure(ae(u??``))})},q=[u],t[27]=u,t[28]=K,t[29]=q),(0,L.useEffect)(K,q);let J,Y;t[30]!==n||t[31]!==p?(J=()=>{let e=function(e){let t=e.detail;if(!t||t.mode!==`source`||!p)return;let r=h.current;r&&(Le(r,t),fe(n))};return window.addEventListener(ce,e),()=>window.removeEventListener(ce,e)},Y=[n,p],t[30]=n,t[31]=p,t[32]=J,t[33]=Y):(J=t[32],Y=t[33]),(0,L.useEffect)(J,Y);let X,Z;t[34]!==n||t[35]!==p?(X=()=>{if(!p)return;let e=h.current;if(!e)return;let t=ue(n);if(t){if(t.kind===`outline`){Le(e,t.detail);return}Re(e,t.detail)}},Z=[n,p],t[34]=n,t[35]=p,t[36]=X,t[37]=Z):(X=t[36],Z=t[37]),(0,L.useEffect)(X,Z);let Q;return t[38]===Symbol.for(`react.memo_cache_sentinel`)?(Q=(0,Fe.jsx)(`div`,{ref:m,className:`source-editor h-full pb-3`}),t[38]=Q):Q=t[38],Q}function Ve(){return{top:Ie}}function He(){return o()}export{Be as SourceEditor};
@@ -1,4 +1,4 @@
1
- import{o as e,r as t}from"./chunk-CFjPhJqf.js";import{a as n,i as r,o as i,r as a,t as o}from"./compiler-runtime-Cs91PcD2.js";import{C as s,D as c,E as l,Fn as u,Kn as d,Nn as f,Pn as p,Rn as m,S as h,T as g,W as _,Xn as v,Yn as y,_ as b,ar as x,br as S,fr as C,gr as w,h as T,jn as E,m as D,n as O,pr as k,qn as A,ur as j,w as M,x as N,zn as P}from"./DocumentContext-W66sHYhr.js";import{D as F,M as I,P as L,R,V as z,_ as B,d as V,h as H,v as U,z as W}from"./prop-types-BKGsVwoQ.js";import{c as ee,d as G,i as K,l as q,n as te,o as ne,s as J,t as Y,u as re}from"./button-CNAPefQE.js";import{i as ie}from"./toggle-group-Df7XaPvr.js";import{_ as ae,a as oe,c as se,g as ce,h as le,i as ue,m as de,n as fe,o as pe,r as me,s as he,t as ge,v as _e}from"./dialog-Y0b8qUlN.js";import{i as ve,n as ye,o as be,r as xe,t as Se}from"./collapsible-CiYR1NR5.js";import{n as Ce,r as we}from"./dist-DV57qOHV.js";import{An as Te,Dt as Ee,L as De,Nn as Oe,R as ke,Rn as Ae,Zn as je,_t as Me,at as Ne,bt as Pe,cn as Fe,fn as Ie,gt as Le,ht as Re,r as ze,ti as Be,vt as Ve}from"./dist-BW0ROjDr.js";import{t as He}from"./trace-api-DPMyR1_m.js";import{a as Ue,d as We,f as Ge,i as Ke,l as qe,n as Je,o as Ye,p as Xe,r as Ze,s as Qe}from"./dist-CUqyztDT.js";import{a as $e,b as et,c as tt,i as nt,l as rt,n as it,o as at,s as ot,t as st,x as ct}from"./tooltip-Bp4cM4E8.js";import{t as lt}from"./checkbox-DcMpayVo.js";import{n as ut,r as dt,t as ft}from"./dist-qcpgtxJO.js";import{t as pt}from"./label-B0eGtw2Z.js";import{n as mt,r as ht,t as gt}from"./textarea-CuOwJaz9.js";var _t=re(`arrow-right-left`,[[`path`,{d:`m16 3 4 4-4 4`,key:`1x1c3m`}],[`path`,{d:`M20 7H4`,key:`zbl0bi`}],[`path`,{d:`m8 21-4-4 4-4`,key:`h9nckh`}],[`path`,{d:`M4 17h16`,key:`g4d7ey`}]]),vt=re(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),yt=re(`braces`,[[`path`,{d:`M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1`,key:`ezmyqa`}],[`path`,{d:`M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1`,key:`e1hn23`}]]),bt=re(`calendar`,[[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`4`,rx:`2`,key:`1hopcy`}],[`path`,{d:`M3 10h18`,key:`8toen8`}]]),xt=re(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),St=re(`cloud-off`,[[`path`,{d:`M10.94 5.274A7 7 0 0 1 15.71 10h1.79a4.5 4.5 0 0 1 4.222 6.057`,key:`1uxyv8`}],[`path`,{d:`M18.796 18.81A4.5 4.5 0 0 1 17.5 19H9A7 7 0 0 1 5.79 5.78`,key:`99tcn7`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Ct=re(`cloud`,[[`path`,{d:`M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z`,key:`p7xjir`}]]),wt=re(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]),Tt=re(`ellipsis-vertical`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`circle`,{cx:`12`,cy:`19`,r:`1`,key:`lyex9k`}]]),Et=re(`file-plus`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M9 15h6`,key:`cctwl0`}],[`path`,{d:`M12 18v-6`,key:`17g6i2`}]]),Dt=re(`git-commit-vertical`,[[`path`,{d:`M12 3v6`,key:`1holv5`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`path`,{d:`M12 15v6`,key:`a9ows0`}]]),Ot=re(`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`}]]),kt=re(`image-plus`,[[`path`,{d:`M16 5h6`,key:`1vod17`}],[`path`,{d:`M19 2v6`,key:`4bpg5p`}],[`path`,{d:`M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5`,key:`1ue2ih`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}]]),At=re(`log-in`,[[`path`,{d:`m10 17 5-5-5-5`,key:`1bsop3`}],[`path`,{d:`M15 12H3`,key:`6jk70r`}],[`path`,{d:`M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4`,key:`u53s6r`}]]),jt=re(`move-up-right`,[[`path`,{d:`M13 5H19V11`,key:`1n1gyv`}],[`path`,{d:`M19 5L5 19`,key:`72u4yj`}]]),Mt=re(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),Nt=re(`smile`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M8 14s1.5 2 4 2 4-2 4-2`,key:`1y1vjs`}],[`line`,{x1:`9`,x2:`9.01`,y1:`9`,y2:`9`,key:`yxxnd0`}],[`line`,{x1:`15`,x2:`15.01`,y1:`9`,y2:`9`,key:`1p4y9e`}]]),Pt=re(`square-check`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),Ft=re(`type`,[[`path`,{d:`M12 4v16`,key:`1654pz`}],[`path`,{d:`M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2`,key:`e0r10z`}],[`path`,{d:`M9 20h6`,key:`s66wpe`}]]),It=re(`user-cog`,[[`path`,{d:`M10 15H6a4 4 0 0 0-4 4v2`,key:`1nfge6`}],[`path`,{d:`m14.305 16.53.923-.382`,key:`1itpsq`}],[`path`,{d:`m15.228 13.852-.923-.383`,key:`eplpkm`}],[`path`,{d:`m16.852 12.228-.383-.923`,key:`13v3q0`}],[`path`,{d:`m16.852 17.772-.383.924`,key:`1i8mnm`}],[`path`,{d:`m19.148 12.228.383-.923`,key:`1q8j1v`}],[`path`,{d:`m19.53 18.696-.382-.924`,key:`vk1qj3`}],[`path`,{d:`m20.772 13.852.924-.383`,key:`n880s0`}],[`path`,{d:`m20.772 16.148.924.383`,key:`1g6xey`}],[`circle`,{cx:`18`,cy:`15`,r:`3`,key:`gjjjvw`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),X=i(),Z=e(n(),1),Lt=e(G()),Q=o();async function Rt(e){try{let t=await e.json(),n=Ne.safeParse(t);if(n.success)return n.data.title}catch{}}async function zt(e,t){return fetch(e,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t??{})})}function Bt(e){let t=e.split(`
1
+ import{o as e,r as t}from"./chunk-CFjPhJqf.js";import{a as n,i as r,o as i,r as a,t as o}from"./compiler-runtime-Cs91PcD2.js";import{C as s,D as c,E as l,Fn as u,Kn as d,Nn as f,Pn as p,Rn as m,S as h,T as g,W as _,Xn as v,Yn as y,_ as b,ar as x,br as S,fr as C,gr as w,h as T,jn as E,m as D,n as O,pr as k,qn as A,ur as j,w as M,x as N,zn as P}from"./DocumentContext-CAteDFxs.js";import{D as F,M as I,P as L,R,V as z,_ as B,d as V,h as H,v as U,z as W}from"./prop-types-BKGsVwoQ.js";import{c as ee,d as G,i as K,l as q,n as te,o as ne,s as J,t as Y,u as re}from"./button-CNAPefQE.js";import{i as ie}from"./toggle-group-Df7XaPvr.js";import{_ as ae,a as oe,c as se,g as ce,h as le,i as ue,m as de,n as fe,o as pe,r as me,s as he,t as ge,v as _e}from"./dialog-Y0b8qUlN.js";import{i as ve,n as ye,o as be,r as xe,t as Se}from"./collapsible-CiYR1NR5.js";import{n as Ce,r as we}from"./dist-DV57qOHV.js";import{An as Te,Dt as Ee,L as De,Nn as Oe,R as ke,Rn as Ae,Zn as je,_t as Me,at as Ne,bt as Pe,cn as Fe,fn as Ie,gt as Le,ht as Re,r as ze,ti as Be,vt as Ve}from"./dist-BW0ROjDr.js";import{t as He}from"./trace-api-DPMyR1_m.js";import{a as Ue,d as We,f as Ge,i as Ke,l as qe,n as Je,o as Ye,p as Xe,r as Ze,s as Qe}from"./dist-CUqyztDT.js";import{a as $e,b as et,c as tt,i as nt,l as rt,n as it,o as at,s as ot,t as st,x as ct}from"./tooltip-Bp4cM4E8.js";import{t as lt}from"./checkbox-DcMpayVo.js";import{n as ut,r as dt,t as ft}from"./dist-qcpgtxJO.js";import{t as pt}from"./label-B0eGtw2Z.js";import{n as mt,r as ht,t as gt}from"./textarea-CuOwJaz9.js";var _t=re(`arrow-right-left`,[[`path`,{d:`m16 3 4 4-4 4`,key:`1x1c3m`}],[`path`,{d:`M20 7H4`,key:`zbl0bi`}],[`path`,{d:`m8 21-4-4 4-4`,key:`h9nckh`}],[`path`,{d:`M4 17h16`,key:`g4d7ey`}]]),vt=re(`arrow-right`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`m12 5 7 7-7 7`,key:`xquz4c`}]]),yt=re(`braces`,[[`path`,{d:`M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1`,key:`ezmyqa`}],[`path`,{d:`M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1`,key:`e1hn23`}]]),bt=re(`calendar`,[[`path`,{d:`M8 2v4`,key:`1cmpym`}],[`path`,{d:`M16 2v4`,key:`4m81vk`}],[`rect`,{width:`18`,height:`18`,x:`3`,y:`4`,rx:`2`,key:`1hopcy`}],[`path`,{d:`M3 10h18`,key:`8toen8`}]]),xt=re(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),St=re(`cloud-off`,[[`path`,{d:`M10.94 5.274A7 7 0 0 1 15.71 10h1.79a4.5 4.5 0 0 1 4.222 6.057`,key:`1uxyv8`}],[`path`,{d:`M18.796 18.81A4.5 4.5 0 0 1 17.5 19H9A7 7 0 0 1 5.79 5.78`,key:`99tcn7`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),Ct=re(`cloud`,[[`path`,{d:`M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z`,key:`p7xjir`}]]),wt=re(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]),Tt=re(`ellipsis-vertical`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`circle`,{cx:`12`,cy:`19`,r:`1`,key:`lyex9k`}]]),Et=re(`file-plus`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}],[`path`,{d:`M9 15h6`,key:`cctwl0`}],[`path`,{d:`M12 18v-6`,key:`17g6i2`}]]),Dt=re(`git-commit-vertical`,[[`path`,{d:`M12 3v6`,key:`1holv5`}],[`circle`,{cx:`12`,cy:`12`,r:`3`,key:`1v7zrd`}],[`path`,{d:`M12 15v6`,key:`a9ows0`}]]),Ot=re(`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`}]]),kt=re(`image-plus`,[[`path`,{d:`M16 5h6`,key:`1vod17`}],[`path`,{d:`M19 2v6`,key:`4bpg5p`}],[`path`,{d:`M21 11.5V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7.5`,key:`1ue2ih`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}]]),At=re(`log-in`,[[`path`,{d:`m10 17 5-5-5-5`,key:`1bsop3`}],[`path`,{d:`M15 12H3`,key:`6jk70r`}],[`path`,{d:`M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4`,key:`u53s6r`}]]),jt=re(`move-up-right`,[[`path`,{d:`M13 5H19V11`,key:`1n1gyv`}],[`path`,{d:`M19 5L5 19`,key:`72u4yj`}]]),Mt=re(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]),Nt=re(`smile`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M8 14s1.5 2 4 2 4-2 4-2`,key:`1y1vjs`}],[`line`,{x1:`9`,x2:`9.01`,y1:`9`,y2:`9`,key:`yxxnd0`}],[`line`,{x1:`15`,x2:`15.01`,y1:`9`,y2:`9`,key:`1p4y9e`}]]),Pt=re(`square-check`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),Ft=re(`type`,[[`path`,{d:`M12 4v16`,key:`1654pz`}],[`path`,{d:`M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2`,key:`e0r10z`}],[`path`,{d:`M9 20h6`,key:`s66wpe`}]]),It=re(`user-cog`,[[`path`,{d:`M10 15H6a4 4 0 0 0-4 4v2`,key:`1nfge6`}],[`path`,{d:`m14.305 16.53.923-.382`,key:`1itpsq`}],[`path`,{d:`m15.228 13.852-.923-.383`,key:`eplpkm`}],[`path`,{d:`m16.852 12.228-.383-.923`,key:`13v3q0`}],[`path`,{d:`m16.852 17.772-.383.924`,key:`1i8mnm`}],[`path`,{d:`m19.148 12.228.383-.923`,key:`1q8j1v`}],[`path`,{d:`m19.53 18.696-.382-.924`,key:`vk1qj3`}],[`path`,{d:`m20.772 13.852.924-.383`,key:`n880s0`}],[`path`,{d:`m20.772 16.148.924.383`,key:`1g6xey`}],[`circle`,{cx:`18`,cy:`15`,r:`3`,key:`gjjjvw`}],[`circle`,{cx:`9`,cy:`7`,r:`4`,key:`nufk8`}]]),X=i(),Z=e(n(),1),Lt=e(G()),Q=o();async function Rt(e){try{let t=await e.json(),n=Ne.safeParse(t);if(n.success)return n.data.title}catch{}}async function zt(e,t){return fetch(e,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t??{})})}function Bt(e){let t=e.split(`
2
2
  `);for(let e=t.length-1;e>=0;e--){let n=t[e]?.trim();if(n)try{let e=JSON.parse(n);if(e&&typeof e==`object`)return e}catch{}}return null}function Vt(){return{async status(e){let t=e?.host??`github.com`,n=await zt(`/api/local-op/auth/status`,e);if(!n.ok)return{authenticated:!1,host:t,error:await Rt(n)};let r=await n.json(),i=typeof r.host==`string`?r.host:t;if(r.authenticated===!0&&typeof r.login==`string`){let e=r.tier===`A`||r.tier===`B`||r.tier===`C`?r.tier:void 0;return{authenticated:!0,host:i,login:r.login,tier:e,name:typeof r.name==`string`?r.name:void 0,email:typeof r.email==`string`?r.email:void 0}}return{authenticated:!1,host:i,error:typeof r.error==`string`?r.error:void 0}},async repos(e){let t=e?.host??`github.com`,n=await zt(`/api/local-op/auth/repos`,e);if(!n.ok)return{ok:!1,error:await Rt(n)??`Failed to fetch repositories`};let r=Bt(await n.text());if(r&&r.type===`error`&&r.problem&&typeof r.problem==`object`){let e=r.problem;return{ok:!1,error:e.detail||e.title||`Failed to fetch repositories`}}if(!r||!Array.isArray(r.repos))return{ok:!1,error:`Failed to fetch repositories`};let i=[];for(let e of r.repos){let t=e;typeof t?.full_name==`string`&&typeof t.clone_url==`string`&&i.push({full_name:t.full_name,clone_url:t.clone_url,private:t.private===!0})}return{ok:!0,host:typeof r.host==`string`?r.host:t,repos:i}},async signout(e){let t=await zt(`/api/local-op/auth/signout`,e);return t.ok?{ok:!0}:{ok:!1,error:await Rt(t)}}}}function Ht(e){return{status:t=>e.localOp.authStatus(t),repos:t=>e.localOp.authRepos(t)}}async function Ut(e,t){let n=e.getReader(),r=new TextDecoder,i=``;for(;;){let{done:e,value:a}=await n.read();if(e)return i+=r.decode(),!!(i.trim()&&t(i)===`terminal`);i+=r.decode(a,{stream:!0});let o=i.split(`
3
3
  `);i=o.pop()??``;for(let e of o)if(e.trim()&&t(e)===`terminal`)return!0}}function Wt(e){let t=[],n=[],r=new AbortController,i=!1,a=()=>{for(let e of n.splice(0))e(null)};return e(e=>{i||(n.length>0?n.shift()?.(e):t.push(e),(e.type===`complete`||e.type===`error`)&&(i=!0,r.abort(),a()))},r.signal),{events:{[Symbol.asyncIterator](){return{async next(){if(t.length>0){let e=t.shift();return e===void 0?{value:void 0,done:!0}:{value:e,done:!1}}return i?{value:void 0,done:!0}:new Promise(e=>{n.push(t=>{e(t===null?{value:void 0,done:!0}:{value:t,done:!1})})})}}}},cancel:()=>{i||(i=!0,r.abort(),a())}}}function Gt(){return{start(){return Wt((e,t)=>{(async()=>{try{let n=await fetch(`/api/local-op/auth/login`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({json:!0}),signal:t});if(!n.ok){let t=`Failed to start sign-in — try again`;try{let e=await n.json(),r=Ne.safeParse(e);r.success&&(t=r.data.title)}catch{}e({type:`error`,message:t});return}if(!n.body){e({type:`error`,message:`Failed to start sign-in — try again`});return}!await Ut(n.body,t=>{let n;try{n=JSON.parse(t)}catch{return console.warn(`[auth-transport] Dropped unparseable NDJSON line:`,t.slice(0,100)),`continue`}if(n&&typeof n==`object`&&n.type===`error`&&`problem`in n){let t=n.problem;return e({type:`error`,message:t?.detail||t?.title||`Unknown error`}),`terminal`}let r=n;return e(r),r.type===`complete`||r.type===`error`?`terminal`:`continue`})&&!t.aborted&&e({type:`error`,message:`Sign-in stream ended without confirmation — please try again`})}catch(t){if(t instanceof Error&&t.name===`AbortError`)return;e({type:`error`,message:`Connection error — try again`})}})()})}}}function Kt(e){return{start(){return e.localOp.auth.start()}}}function qt(e,t){let n=window.okDesktop?.shell?.openExternal;n&&(e.preventDefault(),n(t))}var Jt=[`Enter`,` `],Yt=[`ArrowDown`,`PageUp`,`Home`],Xt=[`ArrowUp`,`PageDown`,`End`],Zt=[...Yt,...Xt],Qt={ltr:[...Jt,`ArrowRight`],rtl:[...Jt,`ArrowLeft`]},$t={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},en=`Menu`,[tn,nn,rn]=ct(en),[an,on]=We(en,[rn,rt,dt]),sn=rt(),cn=dt(),[ln,un]=an(en),[dn,fn]=an(en),pn=e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,s=sn(t),[c,l]=Z.useState(null),u=Z.useRef(!1),d=Ke(a),f=et(i);return Z.useEffect(()=>{let e=()=>{u.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},t=()=>u.current=!1;return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),(0,X.jsx)(tt,{...s,children:(0,X.jsx)(ln,{scope:t,open:n,onOpenChange:d,content:c,onContentChange:l,children:(0,X.jsx)(dn,{scope:t,onClose:Z.useCallback(()=>d(!1),[d]),isUsingKeyboardRef:u,dir:f,modal:o,children:r})})})};pn.displayName=en;var mn=`MenuAnchor`,hn=Z.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=sn(n);return(0,X.jsx)($e,{...i,...r,ref:t})});hn.displayName=mn;var gn=`MenuPortal`,[_n,vn]=an(gn,{forceMount:void 0}),yn=e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,a=un(gn,t);return(0,X.jsx)(_n,{scope:t,forceMount:n,children:(0,X.jsx)(Ye,{present:n||a.open,children:(0,X.jsx)(Je,{asChild:!0,container:i,children:r})})})};yn.displayName=gn;var bn=`MenuContent`,[xn,Sn]=an(bn),Cn=Z.forwardRef((e,t)=>{let n=vn(bn,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=un(bn,e.__scopeMenu),o=fn(bn,e.__scopeMenu);return(0,X.jsx)(tn.Provider,{scope:e.__scopeMenu,children:(0,X.jsx)(Ye,{present:r||a.open,children:(0,X.jsx)(tn.Slot,{scope:e.__scopeMenu,children:o.modal?(0,X.jsx)(wn,{...i,ref:t}):(0,X.jsx)(Tn,{...i,ref:t})})})})}),wn=Z.forwardRef((e,t)=>{let n=un(bn,e.__scopeMenu),r=Z.useRef(null),i=J(t,r);return Z.useEffect(()=>{let e=r.current;if(e)return de(e)},[]),(0,X.jsx)(Dn,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:qe(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),Tn=Z.forwardRef((e,t)=>{let n=un(bn,e.__scopeMenu);return(0,X.jsx)(Dn,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),En=K(`MenuContent.ScrollLock`),Dn=Z.forwardRef((e,t)=>{let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,disableOutsideScroll:m,...h}=e,g=un(bn,n),_=fn(bn,n),v=sn(n),y=cn(n),b=nn(n),[x,S]=Z.useState(null),C=Z.useRef(null),w=J(t,C,g.onContentChange),T=Z.useRef(0),E=Z.useRef(``),D=Z.useRef(0),O=Z.useRef(null),k=Z.useRef(`right`),A=Z.useRef(0),j=m?le:Z.Fragment,M=m?{as:En,allowPinchZoom:!0}:void 0,N=e=>{let t=E.current+e,n=b().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=dr(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;(function e(t){E.current=t,window.clearTimeout(T.current),t!==``&&(T.current=window.setTimeout(()=>e(``),1e3))})(t),o&&setTimeout(()=>o.focus())};Z.useEffect(()=>()=>window.clearTimeout(T.current),[]),ce();let P=Z.useCallback(e=>k.current===O.current?.side&&pr(e,O.current?.area),[]);return(0,X.jsx)(xn,{scope:n,searchRef:E,onItemEnter:Z.useCallback(e=>{P(e)&&e.preventDefault()},[P]),onItemLeave:Z.useCallback(e=>{P(e)||(C.current?.focus(),S(null))},[P]),onTriggerLeave:Z.useCallback(e=>{P(e)&&e.preventDefault()},[P]),pointerGraceTimerRef:D,onPointerGraceIntentChange:Z.useCallback(e=>{O.current=e},[]),children:(0,X.jsx)(j,{...M,children:(0,X.jsx)(ae,{asChild:!0,trapped:i,onMountAutoFocus:qe(a,e=>{e.preventDefault(),C.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,X.jsx)(Ze,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:p,children:(0,X.jsx)(ut,{asChild:!0,...y,dir:_.dir,orientation:`vertical`,loop:r,currentTabStopId:x,onCurrentTabStopIdChange:S,onEntryFocus:qe(c,e=>{_.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,X.jsx)(ot,{role:`menu`,"aria-orientation":`vertical`,"data-state":or(g.open),"data-radix-menu-content":``,dir:_.dir,...v,...h,ref:w,style:{outline:`none`,...h.style},onKeyDown:qe(h.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&N(e.key));let i=C.current;if(e.target!==i||!Zt.includes(e.key))return;e.preventDefault();let a=b().filter(e=>!e.disabled).map(e=>e.ref.current);Xt.includes(e.key)&&a.reverse(),lr(a)}),onBlur:qe(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(T.current),E.current=``)}),onPointerMove:qe(e.onPointerMove,mr(e=>{let t=e.target,n=A.current!==e.clientX;e.currentTarget.contains(t)&&n&&(k.current=e.clientX>A.current?`right`:`left`,A.current=e.clientX)}))})})})})})})});Cn.displayName=bn;var On=`MenuGroup`,kn=Z.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,X.jsx)(Ge.div,{role:`group`,...r,ref:t})});kn.displayName=On;var An=`MenuLabel`,jn=Z.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,X.jsx)(Ge.div,{...r,ref:t})});jn.displayName=An;var Mn=`MenuItem`,Nn=`menu.itemSelect`,Pn=Z.forwardRef((e,t)=>{let{disabled:n=!1,onSelect:r,...i}=e,a=Z.useRef(null),o=fn(Mn,e.__scopeMenu),s=Sn(Mn,e.__scopeMenu),c=J(t,a),l=Z.useRef(!1),u=()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(Nn,{bubbles:!0,cancelable:!0});e.addEventListener(Nn,e=>r?.(e),{once:!0}),Xe(e,t),t.defaultPrevented?l.current=!1:o.onClose()}};return(0,X.jsx)(Fn,{...i,ref:c,disabled:n,onClick:qe(e.onClick,u),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:qe(e.onPointerUp,e=>{l.current||e.currentTarget?.click()}),onKeyDown:qe(e.onKeyDown,e=>{let t=s.searchRef.current!==``;n||t&&e.key===` `||Jt.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});Pn.displayName=Mn;var Fn=Z.forwardRef((e,t)=>{let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=Sn(Mn,n),s=cn(n),c=Z.useRef(null),l=J(t,c),[u,d]=Z.useState(!1),[f,p]=Z.useState(``);return Z.useEffect(()=>{let e=c.current;e&&p((e.textContent??``).trim())},[a.children]),(0,X.jsx)(tn.ItemSlot,{scope:n,disabled:r,textValue:i??f,children:(0,X.jsx)(ft,{asChild:!0,...s,focusable:!r,children:(0,X.jsx)(Ge.div,{role:`menuitem`,"data-highlighted":u?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:l,onPointerMove:qe(e.onPointerMove,mr(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:qe(e.onPointerLeave,mr(e=>o.onItemLeave(e))),onFocus:qe(e.onFocus,()=>d(!0)),onBlur:qe(e.onBlur,()=>d(!1))})})})}),In=`MenuCheckboxItem`,Ln=Z.forwardRef((e,t)=>{let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,X.jsx)(Gn,{scope:e.__scopeMenu,checked:n,children:(0,X.jsx)(Pn,{role:`menuitemcheckbox`,"aria-checked":sr(n)?`mixed`:n,...i,ref:t,"data-state":cr(n),onSelect:qe(i.onSelect,()=>r?.(sr(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Ln.displayName=In;var Rn=`MenuRadioGroup`,[zn,Bn]=an(Rn,{value:void 0,onValueChange:()=>{}}),Vn=Z.forwardRef((e,t)=>{let{value:n,onValueChange:r,...i}=e,a=Ke(r);return(0,X.jsx)(zn,{scope:e.__scopeMenu,value:n,onValueChange:a,children:(0,X.jsx)(kn,{...i,ref:t})})});Vn.displayName=Rn;var Hn=`MenuRadioItem`,Un=Z.forwardRef((e,t)=>{let{value:n,...r}=e,i=Bn(Hn,e.__scopeMenu),a=n===i.value;return(0,X.jsx)(Gn,{scope:e.__scopeMenu,checked:a,children:(0,X.jsx)(Pn,{role:`menuitemradio`,"aria-checked":a,...r,ref:t,"data-state":cr(a),onSelect:qe(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});Un.displayName=Hn;var Wn=`MenuItemIndicator`,[Gn,Kn]=an(Wn,{checked:!1}),qn=Z.forwardRef((e,t)=>{let{__scopeMenu:n,forceMount:r,...i}=e,a=Kn(Wn,n);return(0,X.jsx)(Ye,{present:r||sr(a.checked)||a.checked===!0,children:(0,X.jsx)(Ge.span,{...i,ref:t,"data-state":cr(a.checked)})})});qn.displayName=Wn;var Jn=`MenuSeparator`,Yn=Z.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,X.jsx)(Ge.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})});Yn.displayName=Jn;var Xn=`MenuArrow`,Zn=Z.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=sn(n);return(0,X.jsx)(at,{...i,...r,ref:t})});Zn.displayName=Xn;var Qn=`MenuSub`,[$n,er]=an(Qn),tr=e=>{let{__scopeMenu:t,children:n,open:r=!1,onOpenChange:i}=e,a=un(Qn,t),o=sn(t),[s,c]=Z.useState(null),[l,u]=Z.useState(null),d=Ke(i);return Z.useEffect(()=>(a.open===!1&&d(!1),()=>d(!1)),[a.open,d]),(0,X.jsx)(tt,{...o,children:(0,X.jsx)(ln,{scope:t,open:r,onOpenChange:d,content:l,onContentChange:u,children:(0,X.jsx)($n,{scope:t,contentId:Ue(),triggerId:Ue(),trigger:s,onTriggerChange:c,children:n})})})};tr.displayName=Qn;var nr=`MenuSubTrigger`,rr=Z.forwardRef((e,t)=>{let n=un(nr,e.__scopeMenu),r=fn(nr,e.__scopeMenu),i=er(nr,e.__scopeMenu),a=Sn(nr,e.__scopeMenu),o=Z.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:c}=a,l={__scopeMenu:e.__scopeMenu},u=Z.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);return Z.useEffect(()=>u,[u]),Z.useEffect(()=>{let e=s.current;return()=>{window.clearTimeout(e),c(null)}},[s,c]),(0,X.jsx)(hn,{asChild:!0,...l,children:(0,X.jsx)(Fn,{id:i.triggerId,"aria-haspopup":`menu`,"aria-expanded":n.open,"aria-controls":i.contentId,"data-state":or(n.open),...e,ref:ne(t,i.onTriggerChange),onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:qe(e.onPointerMove,mr(t=>{a.onItemEnter(t),!t.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(a.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:qe(e.onPointerLeave,mr(e=>{u();let t=n.content?.getBoundingClientRect();if(t){let r=n.content?.dataset.side,i=r===`right`,o=i?-5:5,c=t[i?`left`:`right`],l=t[i?`right`:`left`];a.onPointerGraceIntentChange({area:[{x:e.clientX+o,y:e.clientY},{x:c,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:c,y:t.bottom}],side:r}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(e),e.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:qe(e.onKeyDown,t=>{let i=a.searchRef.current!==``;e.disabled||i&&t.key===` `||Qt[r.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})});rr.displayName=nr;var ir=`MenuSubContent`,ar=Z.forwardRef((e,t)=>{let n=vn(bn,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=un(bn,e.__scopeMenu),o=fn(bn,e.__scopeMenu),s=er(ir,e.__scopeMenu),c=Z.useRef(null),l=J(t,c);return(0,X.jsx)(tn.Provider,{scope:e.__scopeMenu,children:(0,X.jsx)(Ye,{present:r||a.open,children:(0,X.jsx)(tn.Slot,{scope:e.__scopeMenu,children:(0,X.jsx)(Dn,{id:s.contentId,"aria-labelledby":s.triggerId,...i,ref:l,align:`start`,side:o.dir===`rtl`?`left`:`right`,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{o.isUsingKeyboardRef.current&&c.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:qe(e.onFocusOutside,e=>{e.target!==s.trigger&&a.onOpenChange(!1)}),onEscapeKeyDown:qe(e.onEscapeKeyDown,e=>{o.onClose(),e.preventDefault()}),onKeyDown:qe(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=$t[o.dir].includes(e.key);t&&n&&(a.onOpenChange(!1),s.trigger?.focus(),e.preventDefault())})})})})})});ar.displayName=ir;function or(e){return e?`open`:`closed`}function sr(e){return e===`indeterminate`}function cr(e){return sr(e)?`indeterminate`:e?`checked`:`unchecked`}function lr(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function ur(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function dr(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=ur(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function fr(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}function pr(e,t){return t?fr({x:e.clientX,y:e.clientY},t):!1}function mr(e){return t=>t.pointerType===`mouse`?e(t):void 0}var hr=pn,gr=hn,_r=yn,vr=Cn,yr=kn,br=jn,xr=Pn,Sr=Ln,Cr=Vn,wr=Un,Tr=qn,Er=Yn,Dr=Zn,Or=tr,kr=rr,Ar=ar,jr=`DropdownMenu`,[Mr,Nr]=We(jr,[on]),Pr=on(),[Fr,Ir]=Mr(jr),Lr=e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:o,modal:s=!0}=e,c=Pr(t),l=Z.useRef(null),[u,d]=Qe({prop:i,defaultProp:a??!1,onChange:o,caller:jr});return(0,X.jsx)(Fr,{scope:t,triggerId:Ue(),triggerRef:l,contentId:Ue(),open:u,onOpenChange:d,onOpenToggle:Z.useCallback(()=>d(e=>!e),[d]),modal:s,children:(0,X.jsx)(hr,{...c,open:u,onOpenChange:d,dir:r,modal:s,children:n})})};Lr.displayName=jr;var Rr=`DropdownMenuTrigger`,zr=Z.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=Ir(Rr,n),o=Pr(n);return(0,X.jsx)(gr,{asChild:!0,...o,children:(0,X.jsx)(Ge.button,{type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:ne(t,a.triggerRef),onPointerDown:qe(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:qe(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})});zr.displayName=Rr;var Br=`DropdownMenuPortal`,Vr=e=>{let{__scopeDropdownMenu:t,...n}=e,r=Pr(t);return(0,X.jsx)(_r,{...r,...n})};Vr.displayName=Br;var Hr=`DropdownMenuContent`,Ur=Z.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Ir(Hr,n),a=Pr(n),o=Z.useRef(!1);return(0,X.jsx)(vr,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:qe(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:qe(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});Ur.displayName=Hr;var Wr=`DropdownMenuGroup`,Gr=Z.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Pr(n);return(0,X.jsx)(yr,{...i,...r,ref:t})});Gr.displayName=Wr;var Kr=`DropdownMenuLabel`,qr=Z.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Pr(n);return(0,X.jsx)(br,{...i,...r,ref:t})});qr.displayName=Kr;var Jr=`DropdownMenuItem`,Yr=Z.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Pr(n);return(0,X.jsx)(xr,{...i,...r,ref:t})});Yr.displayName=Jr;var Xr=`DropdownMenuCheckboxItem`,Zr=Z.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Pr(n);return(0,X.jsx)(Sr,{...i,...r,ref:t})});Zr.displayName=Xr;var Qr=`DropdownMenuRadioGroup`,$r=Z.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Pr(n);return(0,X.jsx)(Cr,{...i,...r,ref:t})});$r.displayName=Qr;var ei=`DropdownMenuRadioItem`,ti=Z.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Pr(n);return(0,X.jsx)(wr,{...i,...r,ref:t})});ti.displayName=ei;var ni=`DropdownMenuItemIndicator`,ri=Z.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Pr(n);return(0,X.jsx)(Tr,{...i,...r,ref:t})});ri.displayName=ni;var ii=`DropdownMenuSeparator`,ai=Z.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Pr(n);return(0,X.jsx)(Er,{...i,...r,ref:t})});ai.displayName=ii;var oi=`DropdownMenuArrow`,si=Z.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Pr(n);return(0,X.jsx)(Dr,{...i,...r,ref:t})});si.displayName=oi;var ci=e=>{let{__scopeDropdownMenu:t,children:n,open:r,onOpenChange:i,defaultOpen:a}=e,o=Pr(t),[s,c]=Qe({prop:r,defaultProp:a??!1,onChange:i,caller:`DropdownMenuSub`});return(0,X.jsx)(Or,{...o,open:s,onOpenChange:c,children:n})},li=`DropdownMenuSubTrigger`,ui=Z.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Pr(n);return(0,X.jsx)(kr,{...i,...r,ref:t})});ui.displayName=li;var di=`DropdownMenuSubContent`,fi=Z.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Pr(n);return(0,X.jsx)(Ar,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});fi.displayName=di;var pi=Lr,mi=zr,hi=Vr,gi=Ur,_i=qr,vi=Yr,yi=Zr,bi=$r,xi=ti,Si=ri,Ci=ai,wi=ci,Ti=ui,Ei=fi,Di=`Separator`,Oi=`horizontal`,ki=[`horizontal`,`vertical`],Ai=Z.forwardRef((e,t)=>{let{decorative:n,orientation:r=Oi,...i}=e,a=ji(r)?r:Oi,o=n?{role:`none`}:{"aria-orientation":a===`vertical`?a:void 0,role:`separator`};return(0,X.jsx)(Ge.div,{"data-orientation":a,...o,...i,ref:t})});Ai.displayName=Di;function ji(e){return ki.includes(e)}var Mi=Ai;async function Ni(e){try{await navigator.clipboard.writeText(e)}catch{}}var Pi=120*1e3;function Fi(e){let t=(0,Q.c)(25),{onSuccess:n,transport:i}=e,{_:o}=r(),[s,c]=(0,Z.useState)(null),[l,u]=(0,Z.useState)(`https://github.com/login/device`),[d,f]=(0,Z.useState)(!1),[p,m]=(0,Z.useState)(null),[h,g]=(0,Z.useState)(Pi),_=(0,Z.useRef)(null),v=(0,Z.useRef)(null),y;t[0]!==o||t[1]!==n||t[2]!==i?(y=async function(){m(null);try{let e=i.start();_.current=e.cancel;let t=e.events[Symbol.asyncIterator](),r=!1,a=await t.next();for(;!a.done;){let e=a.value;if(e.type===`verification`)c(e.user_code),u(e.verification_uri),g(e.expires_in*1e3),Ni(e.user_code).then(()=>{f(!0),setTimeout(()=>f(!1),2e3)});else if(e.type===`complete`){r=!0,n({login:e.login,name:e.name,email:e.email,avatarUrl:e.avatarUrl});break}else if(e.type===`error`){r=!0,m(e.message);break}a=await t.next()}r||m(o({id:`DskIkK`}))}catch(e){let t=e;t instanceof Error&&t.name!==`AbortError`&&m(o({id:`Q5fqMz`}))}},t[0]=o,t[1]=n,t[2]=i,t[3]=y):y=t[3];let b=y,x;t[4]===b?x=t[5]:(x=()=>{let e=!1;return queueMicrotask(()=>{e||b()}),()=>{e=!0,_.current?.(),_.current=null,v.current&&clearInterval(v.current)}},t[4]=b,t[5]=x);let S;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(S=[],t[6]=S):S=t[6],(0,Z.useEffect)(x,S);let C,w;t[7]!==o||t[8]!==s?(C=()=>{if(!s)return;let e=Date.now();return v.current=setInterval(()=>{let t=Pi-(Date.now()-e);t<=0?(g(0),v.current&&clearInterval(v.current),m(o({id:`ve8vEM`}))):g(t)},1e3),()=>{v.current&&clearInterval(v.current)}},w=[s,o],t[7]=o,t[8]=s,t[9]=C,t[10]=w):(C=t[9],w=t[10]),(0,Z.useEffect)(C,w);let T=Math.floor(h/6e4),E=Math.floor(h%6e4/1e3),D;t[11]===E?D=t[12]:(D=E.toString().padStart(2,`0`),t[11]=E,t[12]=D);let O=`${T}:${D}`,A;t[13]!==o||t[14]!==d||t[15]!==p||t[16]!==O||t[17]!==s||t[18]!==l?(A=s?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,X.jsx)(a,{id:`eVPynQ`,values:{verificationUri:l},components:{0:(0,X.jsx)(`a`,{href:l,target:`_blank`,rel:`noopener noreferrer`,onClick:e=>qt(e,l),onAuxClick:e=>qt(e,l),className:`inline-flex items-center gap-0.5 text-foreground hover:text-primary hover:underline`}),1:(0,X.jsx)(`span`,{}),2:(0,X.jsx)(ie,{className:`inline size-3.5`,"aria-hidden":!0})}})}),(0,X.jsxs)(Y,{type:`button`,variant:`outline`,"aria-label":o({id:`nCzR-G`,values:{userCode:s}}),onClick:()=>void Ni(s).then(()=>{f(!0),setTimeout(()=>f(!1),2e3)}),className:`relative h-auto w-full justify-center rounded-md bg-muted px-12 py-3 hover:bg-muted/80`,children:[(0,X.jsx)(`code`,{className:`font-mono text-2xl font-bold tracking-widest`,children:s}),(0,X.jsx)(`span`,{className:`absolute right-3 text-muted-foreground`,"aria-hidden":`true`,children:d?(0,X.jsx)(_e,{className:`size-4`}):(0,X.jsx)(k,{className:`size-4`})})]}),(0,X.jsx)(`span`,{role:`status`,"aria-live":`polite`,className:`sr-only`,children:d?(0,X.jsx)(a,{id:`80c4-P`}):null}),(0,X.jsxs)(`div`,{className:`flex items-center justify-between text-xs text-muted-foreground`,children:[(0,X.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,X.jsx)(`span`,{className:`size-1.5 rounded-full bg-amber-500 animate-pulse`}),(0,X.jsx)(a,{id:`5y_9lO`})]}),(0,X.jsx)(`span`,{children:(0,X.jsx)(a,{id:`gYz2ep`,values:{timeLabel:O}})})]})]}):(0,X.jsx)(`div`,{className:`flex items-center justify-center py-6 text-sm text-muted-foreground`,children:p?null:(0,X.jsx)(a,{id:`aWlJai`})}),t[13]=o,t[14]=d,t[15]=p,t[16]=O,t[17]=s,t[18]=l,t[19]=A):A=t[19];let j;t[20]===p?j=t[21]:(j=p&&(0,X.jsx)(`p`,{className:`text-1sm text-destructive`,children:p}),t[20]=p,t[21]=j);let M;return t[22]!==A||t[23]!==j?(M=(0,X.jsxs)(`div`,{className:`flex flex-col gap-4`,children:[A,j]}),t[22]=A,t[23]=j,t[24]=M):M=t[24],M}function Ii(e){let t=(0,Q.c)(30),{login:n,name:i,onNameChange:o,email:s,onEmailChange:c}=e,{_:l}=r(),u;t[0]===n?u=t[1]:(u=(0,X.jsx)(`p`,{className:`text-sm font-medium`,children:(0,X.jsx)(a,{id:`E_tNGD`,values:{login:n}})}),t[0]=n,t[1]=u);let d;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,X.jsx)(`p`,{className:`text-1sm text-muted-foreground`,children:(0,X.jsx)(a,{id:`gp3I7-`})}),t[2]=d):d=t[2];let f;t[3]===l?f=t[4]:(f=l({id:`6YtxFj`}),t[3]=l,t[4]=f);let p;t[5]!==l||t[6]!==n?(p=l({id:`J2Mv98`,values:{login:n}}),t[5]=l,t[6]=n,t[7]=p):p=t[7];let m;t[8]===o?m=t[9]:(m=e=>o(e.target.value),t[8]=o,t[9]=m);let h;t[10]!==i||t[11]!==f||t[12]!==p||t[13]!==m?(h=(0,X.jsx)(ve,{"aria-label":f,placeholder:p,value:i,onChange:m}),t[10]=i,t[11]=f,t[12]=p,t[13]=m,t[14]=h):h=t[14];let g;t[15]===l?g=t[16]:(g=l({id:`O3oNi5`}),t[15]=l,t[16]=g);let _;t[17]===l?_=t[18]:(_=l({id:`O3oNi5`}),t[17]=l,t[18]=_);let v;t[19]===c?v=t[20]:(v=e=>c(e.target.value),t[19]=c,t[20]=v);let y;t[21]!==s||t[22]!==g||t[23]!==_||t[24]!==v?(y=(0,X.jsx)(ve,{type:`email`,"aria-label":g,placeholder:_,value:s,onChange:v}),t[21]=s,t[22]=g,t[23]=_,t[24]=v,t[25]=y):y=t[25];let b;return t[26]!==u||t[27]!==y||t[28]!==h?(b=(0,X.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[u,d,h,y]}),t[26]=u,t[27]=y,t[28]=h,t[29]=b):b=t[29],b}var Li=1e4;function Ri(e){let t=(0,Q.c)(59),{open:n,onOpenChange:i,onSuccess:o,identityPrompt:s,reauth:c,transport:l,queryTransport:u}=e,{_:d}=r(),f;t[0]===l?f=t[1]:(f=l??Gt(),t[0]=l,t[1]=f);let p=f,m;t[2]===u?m=t[3]:(m=u??Vt(),t[2]=u,t[3]=m);let h=m,[g,_]=(0,Z.useState)(`auth`),[v,y]=(0,Z.useState)(null),[b,x]=(0,Z.useState)(``),[S,C]=(0,Z.useState)(``),w,T;t[4]!==s||t[5]!==n?(w=()=>{n&&(y(null),x(``),C(``),_(s?`checking`:`auth`))},T=[n,s],t[4]=s,t[5]=n,t[6]=w,t[7]=T):(w=t[6],T=t[7]),(0,Z.useLayoutEffect)(w,T);let E;t[8]!==s||t[9]!==n||t[10]!==h?(E=()=>{if(!n||!s)return;let e=!1,t=t=>{e||(e=!0,_(t))},r=setTimeout(()=>t(`auth`),Li);return h.status().then(n=>{e||(n.authenticated?(y({login:n.login,name:n.name,email:n.email}),x(n.name??``),C(n.email??``),t(`identity`)):t(`auth`))}).catch(()=>{t(`auth`)}),()=>{e=!0,clearTimeout(r)}},t[8]=s,t[9]=n,t[10]=h,t[11]=E):E=t[11];let D;t[12]!==s||t[13]!==n?(D=[n,s],t[12]=s,t[13]=n,t[14]=D):D=t[14],(0,Z.useEffect)(E,D);let O;t[15]!==d||t[16]!==s||t[17]!==i||t[18]!==o?(O=function(e){if(y(e),s)x(e.name??``),C(e.email??``),_(`identity`);else{_(`done`),o?.(e),i(!1);let t=e.login;Ce.success(d({id:`E_tNGD`,values:{login:t}}))}},t[15]=d,t[16]=s,t[17]=i,t[18]=o,t[19]=O):O=t[19];let k=O,A;t[20]!==d||t[21]!==v||t[22]!==i||t[23]!==o?(A=function(e,t){fetch(`/api/local-op/auth/set-identity`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({name:e,email:t})}).catch(zi);let n={...v??{login:``},name:e,email:t};_(`done`),o?.(n),i(!1);let r=n.login;Ce.success(d({id:`E_tNGD`,values:{login:r}}))},t[20]=d,t[21]=v,t[22]=i,t[23]=o,t[24]=A):A=t[24];let j=A,M;t[25]!==d||t[26]!==v||t[27]!==i||t[28]!==o?(M=function(){if(!v)return;_(`done`),o?.(v),i(!1);let e=v.login;Ce.success(d({id:`E_tNGD`,values:{login:e}}))},t[25]=d,t[26]=v,t[27]=i,t[28]=o,t[29]=M):M=t[29];let N=M,P;t[30]===i?P=t[31]:(P=function(){i(!1)},t[30]=i,t[31]=P);let F=P,I;t[32]!==s||t[33]!==c||t[34]!==g?(I=(0,X.jsx)(he,{children:(0,X.jsx)(se,{children:c?(0,X.jsx)(a,{id:`X8kjQX`}):s&&g!==`auth`?(0,X.jsx)(a,{id:`29XZXN`}):(0,X.jsx)(a,{id:`3jod3l`})})}),t[32]=s,t[33]=c,t[34]=g,t[35]=I):I=t[35];let L;t[36]===g?L=t[37]:(L=g===`checking`&&(0,X.jsx)(fe,{children:(0,X.jsx)(`div`,{className:`flex items-center justify-center py-6 text-sm text-muted-foreground`,children:(0,X.jsx)(a,{id:`gBbxn_`})})}),t[36]=g,t[37]=L);let R;t[38]!==k||t[39]!==F||t[40]!==p||t[41]!==g?(R=g===`auth`&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(fe,{children:(0,X.jsx)(Fi,{onSuccess:k,transport:p})}),(0,X.jsx)(pe,{children:(0,X.jsx)(Y,{variant:`outline`,className:`font-mono uppercase`,onClick:F,children:(0,X.jsx)(a,{id:`dEgA5A`})})})]}),t[38]=k,t[39]=F,t[40]=p,t[41]=g,t[42]=R):R=t[42];let z;t[43]!==v||t[44]!==j||t[45]!==N||t[46]!==S||t[47]!==b||t[48]!==g?(z=g===`identity`&&v&&(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(fe,{children:(0,X.jsx)(Ii,{login:v.login,name:b,onNameChange:x,email:S,onEmailChange:C})}),(0,X.jsxs)(pe,{children:[(0,X.jsx)(Y,{variant:`ghost`,onClick:N,children:(0,X.jsx)(a,{id:`6Uau97`})}),(0,X.jsx)(Y,{onClick:()=>j(b.trim(),S.trim()),disabled:!b.trim()||!S.trim(),children:(0,X.jsx)(a,{id:`tfDRzk`})})]})]}),t[43]=v,t[44]=j,t[45]=N,t[46]=S,t[47]=b,t[48]=g,t[49]=z):z=t[49];let B;t[50]!==I||t[51]!==L||t[52]!==R||t[53]!==z?(B=(0,X.jsxs)(ue,{className:`sm:max-w-md`,children:[I,L,R,z]}),t[50]=I,t[51]=L,t[52]=R,t[53]=z,t[54]=B):B=t[54];let V;return t[55]!==i||t[56]!==n||t[57]!==B?(V=(0,X.jsx)(ge,{open:n,onOpenChange:i,children:B}),t[55]=i,t[56]=n,t[57]=B,t[58]=V):V=t[58],V}function zi(){}var Bi=null;function Vi(){return Bi}function Hi(e){Bi=e}function Ui(e){let t=(0,Q.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=q(`animate-pulse rounded-md bg-muted`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,X.jsx)(`div`,{"data-slot":`skeleton`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Wi(e){let t=(0,Q.c)(12),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n={status:`idle`},t[0]=n):n=t[0];let[r,i]=(0,Z.useState)(n),[a,o]=(0,Z.useState)(0),s,c;t[1]===e?(s=t[2],c=t[3]):(s=()=>{if(e!==null)return U(()=>{o(Ji)})},c=[e],t[1]=e,t[2]=s,t[3]=c),(0,Z.useEffect)(s,c);let l;t[4]===e?l=t[5]:(l=()=>{if(e===null){i({status:`idle`});return}let t=!1;i({status:`loading`});let n=e?`?path=${encodeURIComponent(e)}`:``;return fetch(`/api/folder-config${n}`).then(Ki).then(e=>{if(!t){if(!e||typeof e!=`object`||!e.folder){i({status:`error`,message:`Server returned an incomplete folder response.`});return}i({status:`ready`,data:{folder:e.folder,frontmatterLocal:e.frontmatter_local??null}})}}).catch(e=>{t||i({status:`error`,message:e instanceof Error?e.message:String(e)})}),()=>{t=!0}},t[4]=e,t[5]=l);let u;t[6]!==e||t[7]!==a?(u=[e,a],t[6]=e,t[7]=a,t[8]=u):u=t[8],(0,Z.useEffect)(l,u);let d;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(d=()=>o(Gi),t[9]=d):d=t[9];let f;return t[10]===r?f=t[11]:(f={state:r,refresh:d},t[10]=r,t[11]=f),f}function Gi(e){return e+1}async function Ki(e){if(!e.ok){let t=await e.json().catch(qi);throw Error(F(t)??`HTTP ${e.status}`)}return e.json()}function qi(){return null}function Ji(e){return e+1}function Yi(e,t){let n=(0,Q.c)(5),r;n[0]===Symbol.for(`react.memo_cache_sentinel`)?(r={status:`idle`},n[0]=r):r=n[0];let[i,a]=(0,Z.useState)(r),o,s;return n[1]!==e||n[2]!==t?(o=()=>{if(!t||e===null){a({status:`idle`});return}let n=!1;a({status:`loading`});let r=`?folder=${encodeURIComponent(e)}&name=${encodeURIComponent(t)}`;return fetch(`/api/template${r}`).then(Xi).then(e=>{if(!n){if(!e||typeof e!=`object`||!e.template){a({status:`error`,message:`Server returned an incomplete template response.`});return}a({status:`ready`,data:e.template})}}).catch(e=>{n||a({status:`error`,message:e instanceof Error?e.message:String(e)})}),()=>{n=!0}},s=[e,t],n[1]=e,n[2]=t,n[3]=o,n[4]=s):(o=n[3],s=n[4]),(0,Z.useEffect)(o,s),i}async function Xi(e){if(!e.ok){let t=await e.json().catch(Zi);throw Error(F(t)??`HTTP ${e.status}`)}return e.json()}function Zi(){return null}function Qi(){let e=(0,Q.c)(6),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t={status:`idle`},e[0]=t):t=e[0];let[n,r]=(0,Z.useState)(t),[i,a]=(0,Z.useState)(0),o,s;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=()=>U(()=>{a(ta)}),s=[],e[1]=o,e[2]=s):(o=e[1],s=e[2]),(0,Z.useEffect)(o,s);let c;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=()=>{let e=!1;return r({status:`loading`}),fetch(`/api/templates`).then($i).then(t=>{if(e)return;let n=Pe.safeParse(t);if(!n.success){console.error(`[ok-templates] /api/templates response failed schema validation:`,n.error.issues),r({status:`error`,message:`Server returned an incomplete templates response.`});return}r({status:`ready`,data:n.data.templates})}).catch(t=>{e||r({status:`error`,message:t instanceof Error?t.message:String(t)})}),()=>{e=!0}},e[3]=c):c=e[3];let l;return e[4]===i?l=e[5]:(l=[i],e[4]=i,e[5]=l),(0,Z.useEffect)(c,l),n}async function $i(e){if(!e.ok){let t=await e.json().catch(ea);throw Error(F(t)??`HTTP ${e.status}`)}return e.json()}function ea(){return null}function ta(e){return e+1}function na(e){let t=(0,Q.c)(12),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:n,orientation:i,decorative:a,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=i===void 0?`horizontal`:i,s=a===void 0?!0:a,c;t[5]===n?c=t[6]:(c=q(`shrink-0 bg-border data-horizontal:h-px data-horizontal:w-full data-vertical:w-px data-vertical:self-stretch`,n),t[5]=n,t[6]=c);let l;return t[7]!==s||t[8]!==o||t[9]!==r||t[10]!==c?(l=(0,X.jsx)(Mi,{"data-slot":`separator`,decorative:s,orientation:o,className:c,...r}),t[7]=s,t[8]=o,t[9]=r,t[10]=c,t[11]=l):l=t[11],l}function ra(e){let t=(0,Q.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=q(`group/field-group @container/field-group flex w-full flex-col gap-6 data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,X.jsx)(`div`,{"data-slot":`field-group`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var ia=ee(`group/field flex w-full gap-2 data-[invalid=true]:text-destructive`,{variants:{orientation:{vertical:`flex-col *:w-full [&>.sr-only]:w-auto`,horizontal:`flex-row items-center has-[>[data-slot=field-content]]:items-start *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`,responsive:`flex-col *:w-full @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:*:data-[slot=field-label]:flex-auto [&>.sr-only]:w-auto @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`}},defaultVariants:{orientation:`vertical`}});function aa(e){let t=(0,Q.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,orientation:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?`vertical`:i,o;t[4]!==n||t[5]!==a?(o=q(ia({orientation:a}),n),t[4]=n,t[5]=a,t[6]=o):o=t[6];let s;return t[7]!==a||t[8]!==r||t[9]!==o?(s=(0,X.jsx)(`div`,{role:`group`,"data-slot":`field`,"data-orientation":a,className:o,...r}),t[7]=a,t[8]=r,t[9]=o,t[10]=s):s=t[10],s}function oa(e){let t=(0,Q.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=q(`group/field-content flex flex-1 flex-col gap-0.5 leading-snug`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,X.jsx)(`div`,{"data-slot":`field-content`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function sa(e){let t=(0,Q.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=q(`group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50 has-data-checked:border-primary/30 has-data-checked:bg-primary/5 has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border *:data-[slot=field]:p-2.5 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10`,`has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,X.jsx)(pt,{"data-slot":`field-label`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function ca(e){let t=(0,Q.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=q(`flex w-fit items-center gap-2 text-sm font-medium group-data-[disabled=true]/field:opacity-50`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,X.jsx)(`div`,{"data-slot":`field-title`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function la(e){let t=(0,Q.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=q(`text-left text-1sm leading-normal font-normal text-muted-foreground group-has-data-horizontal/field:text-balance [[data-variant=legend]+&]:-mt-1.5`,`last:mt-0 nth-last-2:-mt-1`,`[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,X.jsx)(`p`,{"data-slot":`field-description`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function ua(e){let t=(0,Q.c)(15),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,children:n,errors:i,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o;bb0:{if(n){o=n;break bb0}if(!i?.length){o=null;break bb0}let e;t[5]===i?e=t[6]:(e=[...new Map(i.map(fa)).values()],t[5]=i,t[6]=e);let r=e;if(r?.length===1){o=r[0]?.message;break bb0}let a;t[7]===r?a=t[8]:(a=(0,X.jsx)(`ul`,{className:`ml-4 flex list-disc flex-col gap-1`,children:r.map(da)}),t[7]=r,t[8]=a),o=a}let s=o;if(!s)return null;let c;t[9]===r?c=t[10]:(c=q(`text-sm font-normal text-destructive`,r),t[9]=r,t[10]=c);let l;return t[11]!==s||t[12]!==a||t[13]!==c?(l=(0,X.jsx)(`div`,{role:`alert`,"data-slot":`field-error`,className:c,...a,children:s}),t[11]=s,t[12]=a,t[13]=c,t[14]=l):l=t[14],l}function da(e){return e?.message&&(0,X.jsx)(`li`,{children:e.message},e.message)}function fa(e){return[e?.message,e]}async function pa(){try{let e=await fetch(`/api/semantic-status`);return e.ok?await e.json():(console.debug(`[semantic-status] probe returned`,e.status),null)}catch(e){return console.debug(`[semantic-status] probe failed`,e),null}}function ma(e){let t=(0,Q.c)(16),n;t[0]===e?n=t[1]:(n=e===void 0?{}:e,t[0]=e,t[1]=n);let r=n.enabled??!0,[i,a]=(0,Z.useState)(null),o;t[2]===r?o=t[3]:(o=function(){r&&pa().then(e=>{e&&a(e)})},t[2]=r,t[3]=o);let s=o,c;t[4]===s?c=t[5]:(c=()=>{s()},t[4]=s,t[5]=c);let l;t[6]===r?l=t[7]:(l=[r],t[6]=r,t[7]=l),(0,Z.useEffect)(c,l);let u;t[8]!==r||t[9]!==s?(u=()=>{if(r)return B(e=>{e.includes(`files`)&&s()})},t[8]=r,t[9]=s,t[10]=u):u=t[10];let d;t[11]===r?d=t[12]:(d=[r],t[11]=r,t[12]=d),(0,Z.useEffect)(u,d);let f;return t[13]!==s||t[14]!==i?(f={status:i,refresh:s},t[13]=s,t[14]=i,t[15]=f):f=t[15],f}function ha(){let e=(0,Q.c)(3),[t,n]=(0,Z.useState)(va),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(_a);if(!e||!t.ok)return;let i=Ee.safeParse(r);i.success&&n({contentDir:i.data.contentDir,pathSeparator:i.data.pathSeparator})}).catch(ga),()=>{e=!1}},i=[t],e[0]=t,e[1]=r,e[2]=i),(0,Z.useEffect)(r,i),t}function ga(e){console.warn(`[useWorkspace] /api/workspace fetch failed:`,e)}function _a(){return null}function va(){return ya()}function ya(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}async function ba(){try{let e=await fetch(`/api/sync/status`);return e.ok?{status:await e.json()}:{status:null,error:`server`}}catch{return{status:null,error:`network`}}}function xa(){return Sa().status}function Sa(){let e=(0,Q.c)(8),[t,n]=(0,Z.useState)(null),[r,i]=(0,Z.useState)(null),a;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=function(){ba().then(e=>{let{status:t,error:r}=e;i(r??null),t&&n(t)})},e[0]=a):a=e[0];let o=a,s,c;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(s=()=>{o()},c=[],e[1]=s,e[2]=c):(s=e[1],c=e[2]),(0,Z.useEffect)(s,c);let l,u;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(l=()=>B(e=>{e.includes(`sync-status`)&&o()}),u=[],e[3]=l,e[4]=u):(l=e[3],u=e[4]),(0,Z.useEffect)(l,u);let d;return e[5]!==r||e[6]!==t?(d={status:t,fetchError:r},e[5]=r,e[6]=t,e[7]=d):d=e[7],d}var Ca=`open-knowledge-app`;function wa(e){try{He.getTracer(Ca).startSpan(e).end()}catch(e){console.warn(`[terminal-telemetry] span emit failed:`,e instanceof Error?e:String(e))}}function Ta(){wa(`ok.desktop.terminalOpened`)}function Ea(){wa(`ok.desktop.shellConsentGranted`)}function Da(){let e=(0,Q.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,X.jsx)(se,{children:(0,X.jsx)(a,{id:`q_9EcE`})}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,X.jsxs)(X.Fragment,{children:[t,(0,X.jsx)(oe,{children:(0,X.jsx)(a,{id:`n6hXUm`})})]}),e[1]=n):n=e[1],n}function Oa(){let e=(0,Q.c)(10),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,X.jsxs)(`p`,{className:`flex items-center gap-1.5 text-xs font-semibold font-mono uppercase tracking-wider text-primary`,children:[(0,X.jsx)(`span`,{"aria-hidden":`true`,className:`mb-[3px] flex items-center justify-center`,children:`◇`}),(0,X.jsx)(a,{id:`6s7LXO`})]}),e[0]=t):t=e[0];let n;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,X.jsx)(_t,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),e[1]=n):n=e[1];let r;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,X.jsx)(`p`,{className:`font-medium`,children:(0,X.jsx)(a,{id:`cdmk8A`})}),e[2]=r):r=e[2];let i;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,X.jsxs)(`div`,{className:`flex items-start gap-3`,children:[n,(0,X.jsxs)(`div`,{className:`space-y-0.5`,children:[r,(0,X.jsx)(`p`,{className:`text-muted-foreground`,children:(0,X.jsx)(a,{id:`YaeyFh`})})]})]}),e[3]=i):i=e[3];let o;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,X.jsx)(Dt,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),e[4]=o):o=e[4];let s;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,X.jsx)(`p`,{className:`font-medium`,children:(0,X.jsx)(a,{id:`9i21pa`})}),e[5]=s):s=e[5];let c;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,X.jsxs)(`div`,{className:`flex items-start gap-3`,children:[o,(0,X.jsxs)(`div`,{className:`space-y-0.5`,children:[s,(0,X.jsx)(`p`,{className:`text-muted-foreground`,children:(0,X.jsx)(a,{id:`qvcK7S`})})]})]}),e[6]=c):c=e[6];let l;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,X.jsx)(j,{"aria-hidden":`true`,className:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),e[7]=l):l=e[7];let u;e[8]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,X.jsx)(`p`,{className:`font-medium`,children:(0,X.jsx)(a,{id:`8cpeU3`})}),e[8]=u):u=e[8];let d;return e[9]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,X.jsxs)(`div`,{role:`note`,className:`text-sm space-y-5`,children:[t,(0,X.jsxs)(`div`,{className:`space-y-5`,children:[i,c,(0,X.jsxs)(`div`,{className:`flex items-start gap-3`,children:[l,(0,X.jsxs)(`div`,{className:`space-y-0.5`,children:[u,(0,X.jsx)(`p`,{className:`text-muted-foreground`,children:(0,X.jsx)(a,{id:`DELNQk`})})]})]})]})]}),e[9]=d):d=e[9],d}function ka(){let e=(0,Q.c)(2),{projectLocalBinding:t}=_();if(t===null)return null;let n;return e[0]===t?n=e[1]:(n=e=>{let n=t.patch({autoSync:{enabled:e}});return n.ok?{ok:!0}:{ok:!1,error:Be(n.error)}},e[0]=t,e[1]=n),n}function Aa(e){let t=(0,Q.c)(11),{_:n}=r(),[i,a]=(0,Z.useState)(!1),o;t[0]!==n||t[1]!==e?(o=function(t){if(e===null)return Ce.error(n({id:`fiMNLl`})),!1;let r=e(t);if(!r.ok){console.error(`[sync] toggle failed:`,r.error);let e=r.error;return Ce.error(n(t?{id:`04RA0-`,values:{detail:e}}:{id:`qjHMHf`,values:{detail:e}})),!1}return!0},t[0]=n,t[1]=e,t[2]=o):o=t[2];let s=o,c;t[3]===s?c=t[4]:(c=function(e){if(e){a(!0);return}s(!1)},t[3]=s,t[4]=c);let l=c,u;t[5]===s?u=t[6]:(u=function(){s(!0)&&a(!1)},t[5]=s,t[6]=u);let d=u,f;return t[7]!==i||t[8]!==d||t[9]!==l?(f={confirmOpen:i,setConfirmOpen:a,onToggleRequest:l,onConfirm:d},t[7]=i,t[8]=d,t[9]=l,t[10]=f):f=t[10],f}function ja(e){let t=(0,Q.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,X.jsx)(pi,{"data-slot":`dropdown-menu`,...n}),t[2]=n,t[3]=r),r}function Ma(e){let t=(0,Q.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,X.jsx)(mi,{"data-slot":`dropdown-menu-trigger`,...n}),t[2]=n,t[3]=r),r}function Na(e){let t=(0,Q.c)(12),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:n,align:i,sideOffset:a,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=i===void 0?`start`:i,s=a===void 0?4:a,c;t[5]===n?c=t[6]:(c=q(`z-50 max-h-(--radix-dropdown-menu-content-available-height) w-(--radix-dropdown-menu-trigger-width) min-w-32 origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 data-[state=closed]:overflow-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 motion-reduce:data-open:animate-none motion-reduce:data-closed:animate-none motion-reduce:duration-0 subtle-scrollbar`,n),t[5]=n,t[6]=c);let l;return t[7]!==o||t[8]!==r||t[9]!==s||t[10]!==c?(l=(0,X.jsx)(hi,{children:(0,X.jsx)(gi,{"data-slot":`dropdown-menu-content`,sideOffset:s,align:o,className:c,...r})}),t[7]=o,t[8]=r,t[9]=s,t[10]=c,t[11]=l):l=t[11],l}function Pa(e){let t=(0,Q.c)(12),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:n,inset:r,variant:a,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=a===void 0?`default`:a,s;t[5]===n?s=t[6]:(s=q(`group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive`,n),t[5]=n,t[6]=s);let c;return t[7]!==r||t[8]!==i||t[9]!==s||t[10]!==o?(c=(0,X.jsx)(vi,{"data-slot":`dropdown-menu-item`,"data-inset":r,"data-variant":o,className:s,...i}),t[7]=r,t[8]=i,t[9]=s,t[10]=o,t[11]=c):c=t[11],c}function Fa(e){let t=(0,Q.c)(15),n,r,i,a,o;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5]):({className:i,children:r,checked:n,inset:a,...o}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o);let s;t[6]===i?s=t[7]:(s=q(`relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,i),t[6]=i,t[7]=s);let c;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,X.jsx)(`span`,{className:`pointer-events-none absolute right-2 flex items-center justify-center`,"data-slot":`dropdown-menu-checkbox-item-indicator`,children:(0,X.jsx)(Si,{children:(0,X.jsx)(_e,{})})}),t[8]=c):c=t[8];let l;return t[9]!==n||t[10]!==r||t[11]!==a||t[12]!==o||t[13]!==s?(l=(0,X.jsxs)(yi,{"data-slot":`dropdown-menu-checkbox-item`,"data-inset":a,className:s,checked:n,...o,children:[c,r]}),t[9]=n,t[10]=r,t[11]=a,t[12]=o,t[13]=s,t[14]=l):l=t[14],l}function Ia(e){let t=(0,Q.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,X.jsx)(bi,{"data-slot":`dropdown-menu-radio-group`,...n}),t[2]=n,t[3]=r),r}function La(e){let t=(0,Q.c)(13),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,children:n,inset:i,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o;t[5]===r?o=t[6]:(o=q(`relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,r),t[5]=r,t[6]=o);let s;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,X.jsx)(`span`,{className:`pointer-events-none absolute right-2 flex items-center justify-center`,"data-slot":`dropdown-menu-radio-item-indicator`,children:(0,X.jsx)(Si,{children:(0,X.jsx)(_e,{})})}),t[7]=s):s=t[7];let c;return t[8]!==n||t[9]!==i||t[10]!==a||t[11]!==o?(c=(0,X.jsxs)(xi,{"data-slot":`dropdown-menu-radio-item`,"data-inset":i,className:o,...a,children:[s,n]}),t[8]=n,t[9]=i,t[10]=a,t[11]=o,t[12]=c):c=t[12],c}function Ra(e){let t=(0,Q.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,inset:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===n?a=t[5]:(a=q(`px-1.5 py-1 text-xs font-medium text-muted-foreground data-inset:pl-7`,n),t[4]=n,t[5]=a);let o;return t[6]!==r||t[7]!==i||t[8]!==a?(o=(0,X.jsx)(_i,{"data-slot":`dropdown-menu-label`,"data-inset":r,className:a,...i}),t[6]=r,t[7]=i,t[8]=a,t[9]=o):o=t[9],o}function za(e){let t=(0,Q.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=q(`-mx-1 my-1 h-px bg-border`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,X.jsx)(Ci,{"data-slot":`dropdown-menu-separator`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Ba(e){let t=(0,Q.c)(4),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;return t[2]===n?r=t[3]:(r=(0,X.jsx)(wi,{"data-slot":`dropdown-menu-sub`,...n}),t[2]=n,t[3]=r),r}function Va(e){let t=(0,Q.c)(13),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:r,inset:i,children:n,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o;t[5]===r?o=t[6]:(o=q(`flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-open:bg-accent data-open:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,r),t[5]=r,t[6]=o);let s;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,X.jsx)(be,{className:`ml-auto`}),t[7]=s):s=t[7];let c;return t[8]!==n||t[9]!==i||t[10]!==a||t[11]!==o?(c=(0,X.jsxs)(Ti,{"data-slot":`dropdown-menu-sub-trigger`,"data-inset":i,className:o,...a,children:[n,s]}),t[8]=n,t[9]=i,t[10]=a,t[11]=o,t[12]=c):c=t[12],c}function Ha(e){let t=(0,Q.c)(8),n,r;t[0]===e?(n=t[1],r=t[2]):({className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r);let i;t[3]===n?i=t[4]:(i=q(`z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[96px] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-lg ring-1 ring-foreground/10 data-[state=closed]:overflow-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95 motion-reduce:data-open:animate-none motion-reduce:data-closed:animate-none motion-reduce:duration-0 subtle-scrollbar`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,X.jsx)(Ei,{"data-slot":`dropdown-menu-sub-content`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Ua(){var e=[...arguments];return(0,Z.useMemo)(()=>t=>{e.forEach(e=>e(t))},e)}var Wa=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function Ga(e){let t=Object.prototype.toString.call(e);return t===`[object Window]`||t===`[object global]`}function Ka(e){return`nodeType`in e}function qa(e){return e?Ga(e)?e:Ka(e)?e.ownerDocument?.defaultView??window:window:window}function Ja(e){let{Document:t}=qa(e);return e instanceof t}function Ya(e){return Ga(e)?!1:e instanceof qa(e).HTMLElement}function Xa(e){return e instanceof qa(e).SVGElement}function Za(e){return e?Ga(e)?e.document:Ka(e)?Ja(e)?e:Ya(e)||Xa(e)?e.ownerDocument:document:document:document}var Qa=Wa?Z.useLayoutEffect:Z.useEffect;function $a(e){let t=(0,Z.useRef)(e);return Qa(()=>{t.current=e}),(0,Z.useCallback)(function(){var e=[...arguments];return t.current==null?void 0:t.current(...e)},[])}function eo(){let e=(0,Z.useRef)(null);return[(0,Z.useCallback)((t,n)=>{e.current=setInterval(t,n)},[]),(0,Z.useCallback)(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[])]}function to(e,t){t===void 0&&(t=[e]);let n=(0,Z.useRef)(e);return Qa(()=>{n.current!==e&&(n.current=e)},t),n}function no(e,t){let n=(0,Z.useRef)();return(0,Z.useMemo)(()=>{let t=e(n.current);return n.current=t,t},[...t])}function ro(e){let t=$a(e),n=(0,Z.useRef)(null);return[n,(0,Z.useCallback)(e=>{e!==n.current&&t?.(e,n.current),n.current=e},[])]}function io(e){let t=(0,Z.useRef)();return(0,Z.useEffect)(()=>{t.current=e},[e]),t.current}var ao={};function oo(e,t){return(0,Z.useMemo)(()=>{if(t)return t;let n=ao[e]==null?0:ao[e]+1;return ao[e]=n,e+`-`+n},[e,t])}function so(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 co=so(1),lo=so(-1);function uo(e){return`clientX`in e&&`clientY`in e}function fo(e){if(!e)return!1;let{KeyboardEvent:t}=qa(e.target);return t&&e instanceof t}function po(e){if(!e)return!1;let{TouchEvent:t}=qa(e.target);return t&&e instanceof t}function mo(e){if(po(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 uo(e)?{x:e.clientX,y:e.clientY}:null}var ho=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[ho.Translate.toString(e),ho.Scale.toString(e)].join(` `)}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+` `+n+`ms `+r}}}),go=`a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]`;function _o(e){return e.matches(go)?e:e.querySelector(go)}var vo={display:`none`};function yo(e){let{id:t,value:n}=e;return Z.createElement(`div`,{id:t,style:vo},n)}function bo(e){let{id:t,announcement:n,ariaLiveType:r=`assertive`}=e;return Z.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 xo(){let[e,t]=(0,Z.useState)(``);return{announce:(0,Z.useCallback)(e=>{e!=null&&t(e)},[]),announcement:e}}var So=(0,Z.createContext)(null);function Co(e){let t=(0,Z.useContext)(So);(0,Z.useEffect)(()=>{if(!t)throw Error(`useDndMonitor must be used within a children of <DndContext>`);return t(e)},[e,t])}function wo(){let[e]=(0,Z.useState)(()=>new Set),t=(0,Z.useCallback)(t=>(e.add(t),()=>e.delete(t)),[e]);return[(0,Z.useCallback)(t=>{let{type:n,event:r}=t;e.forEach(e=>e[n]?.call(e,r))},[e]),t]}var To={draggable:`
4
4
  To pick up a draggable item, press the space bar.