@inkeep/open-knowledge 0.28.0-beta.3 → 0.28.0-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/skills/discovery/SKILL.md +1 -1
- package/dist/assets/skills/project/SKILL.md +1 -1
- package/dist/cli.mjs +11 -11
- package/dist/constants-B2ajf71_.mjs +2 -0
- package/dist/{dist-Dzsbf2ES.mjs → dist-BdH8ggRE.mjs} +3 -3
- package/dist/{dist-Cj2f9yMz.mjs → dist-DxEvxggY.mjs} +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{init-Bz9uK9cF.mjs → init-B6m-tB3f.mjs} +34 -8
- package/dist/init-D7qlb7U1.mjs +1 -0
- package/dist/{loader-CO7Yklsy.mjs → loader-DOtVZE8i.mjs} +2 -2
- package/dist/loader-Dg0sxGsF.mjs +1 -0
- package/dist/preview-Bggr6Emi.mjs +1 -0
- package/dist/{preview-C8HttBA_.mjs → preview-jezy1ftT.mjs} +2 -2
- package/dist/public/assets/{index-q8lqti-c.js → index-CyKgBKog.js} +87 -87
- package/dist/public/index.html +1 -1
- package/dist/repair-launch-json-DYwawrZz.mjs +2 -0
- package/dist/{repair-mcp-configs-CpUyzXmJ.mjs → repair-mcp-configs-BBGbupnh.mjs} +2 -2
- package/dist/{repair-skills-DDLj2RIs.mjs → repair-skills-C0OeY9uw.mjs} +2 -2
- package/dist/repair-skills-DFJBZ_oh.mjs +1 -0
- package/dist/{src-CmaH8vt2.mjs → src-BXvJBnIt.mjs} +3 -3
- package/dist/{start-BrfXElNM.mjs → start-CGP7nV7H.mjs} +2 -2
- package/dist/start-Do-jLoM-.mjs +1 -0
- package/dist/{write-project-skill-C7UNscN7.mjs → write-project-skill-DeJc1tr6.mjs} +2 -2
- package/package.json +1 -1
- package/dist/constants-iYVnHUHs.mjs +0 -2
- package/dist/init-BNxBabaW.mjs +0 -1
- package/dist/loader-CJosKN2r.mjs +0 -1
- package/dist/preview-6G48ZOAz.mjs +0 -1
- package/dist/repair-launch-json-DDE-03fy.mjs +0 -2
- package/dist/repair-skills-BwkQh3gJ.mjs +0 -1
- package/dist/start-ChGk4q9W.mjs +0 -1
|
@@ -26,7 +26,7 @@ Error generating stack: `+e.message+`
|
|
|
26
26
|
`).trim();return i.length===0||i.length>tw||i.includes(`
|
|
27
27
|
`)?null:i}function ow(e){let t=en(e.state);return{current:t.matches.length===0?0:t.activeIndex+1,total:t.matches.length}}function sw(e,t){return e.current===t.current&&e.total===t.total}function cw(e,t,n){e&&!e.isDestroyed&&(e.commands.clearFindMatches(),e.commands.focus()),t(e=>({...e,open:!1,activeIndex:0})),n(ew)}function lw(e){!e||e.isDestroyed||typeof window>`u`||window.requestAnimationFrame(()=>{if(e.isDestroyed)return;let t=he(e);if(!t)return;let n=t.dom.querySelector(`.ok-find-match-active`);n instanceof HTMLElement&&n.scrollIntoView({block:`center`,inline:`nearest`,behavior:`auto`})})}function uw(e){let t=(0,$.c)(81),{activeDocName:n,isSourceMode:r}=e,i=rw(n),a=(0,Q.useRef)(null),o=(0,Q.useRef)(null),s=(0,Q.useRef)(n),c=(0,Q.useRef)(0),l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(l={open:!1,replaceOpen:!1,query:``,replacement:``,caseSensitive:!1,wholeWord:!1,activeIndex:0},t[0]=l):l=t[0];let[u,d]=(0,Q.useState)(l),[f,p]=(0,Q.useState)(ew),m,h;t[1]===n?(m=t[2],h=t[3]):(m=()=>{s.current!==n&&(s.current=n,d(fw))},h=[n],t[1]=n,t[2]=m,t[3]=h),(0,Q.useEffect)(m,h);let g,_;t[4]===u.activeIndex?(g=t[5],_=t[6]):(g=()=>{c.current=u.activeIndex},_=[u.activeIndex],t[4]=u.activeIndex,t[5]=g,t[6]=_),(0,Q.useEffect)(g,_);let v,y;t[7]===i?(v=t[8],y=t[9]):(v=()=>{let e=o.current;e&&e!==i&&!e.isDestroyed&&e.commands.clearFindMatches(),o.current=i},y=[i],t[7]=i,t[8]=v,t[9]=y),(0,Q.useEffect)(v,y);let b,x;t[10]===u.open?(b=t[11],x=t[12]):(b=()=>{if(!u.open||!a.current)return;let e=requestAnimationFrame(()=>{a.current?.focus(),a.current?.select()});return()=>cancelAnimationFrame(e)},x=[u.open],t[10]=u.open,t[11]=b,t[12]=x),(0,Q.useEffect)(b,x);let S,C;t[13]!==u.open||t[14]!==r?(S=()=>{!u.open||!r||d(dw)},C=[u.open,r],t[13]=u.open,t[14]=r,t[15]=S,t[16]=C):(S=t[15],C=t[16]),(0,Q.useEffect)(S,C);let w,T;t[17]!==i||t[18]!==u.caseSensitive||t[19]!==u.open||t[20]!==u.query||t[21]!==u.wholeWord||t[22]!==r?(w=()=>{if(!i||i.isDestroyed){p(ew);return}if(!u.open||r){i.commands.clearFindMatches(),p(ew);return}let e=window.setTimeout(()=>{if(i.isDestroyed)return;i.commands.setFindQuery(u.query,{options:{caseSensitive:u.caseSensitive,wholeWord:u.wholeWord},activeIndex:c.current});let e=ow(i);p(t=>sw(t,e)?t:e)},nw);return()=>window.clearTimeout(e)},T=[i,u.open,u.query,u.caseSensitive,u.wholeWord,r],t[17]=i,t[18]=u.caseSensitive,t[19]=u.open,t[20]=u.query,t[21]=u.wholeWord,t[22]=r,t[23]=w,t[24]=T):(w=t[23],T=t[24]),(0,Q.useEffect)(w,T);let E,D;t[25]!==i||t[26]!==u.open||t[27]!==r?(E=()=>{if(!i||i.isDestroyed||!u.open||r)return;let e=()=>{let e=en(i.state),t=ow(i);p(e=>sw(e,t)?e:t),d(t=>t.activeIndex===e.activeIndex?t:{...t,activeIndex:e.activeIndex})};return i.on(`transaction`,e),()=>{i.off(`transaction`,e)}},D=[i,u.open,r],t[25]=i,t[26]=u.open,t[27]=r,t[28]=E,t[29]=D):(E=t[28],D=t[29]),(0,Q.useEffect)(E,D);let O,k;t[30]!==n||t[31]!==i||t[32]!==u.open||t[33]!==r?(O=()=>{let e=function(e){let t=aw(i);d(n=>({...n,open:!0,replaceOpen:e,query:t??n.query,activeIndex:0}))},t=function(t){if(!(!n||r||t.defaultPrevented)){if(Pl(t,`find`)){t.preventDefault(),u.open?cw(i,d,p):e(!1);return}if(Pl(t,`replace`)){t.preventDefault(),e(!0);return}if(u.open){let e=Pl(t,`find-next`),n=Pl(t,`find-previous`);if(e||n){t.preventDefault(),(n?i?.commands.selectPreviousFindMatch():i?.commands.selectNextFindMatch())&&lw(i);return}}t.key===`Escape`&&u.open&&(t.preventDefault(),cw(i,d,p))}};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},k=[n,i,u.open,r],t[30]=n,t[31]=i,t[32]=u.open,t[33]=r,t[34]=O,t[35]=k):(O=t[34],k=t[35]),(0,Q.useEffect)(O,k);let A;t[36]!==i||t[37]!==u.caseSensitive||t[38]!==u.query||t[39]!==u.wholeWord?(A=function(){return!i||i.isDestroyed?!1:(i.commands.setFindQuery(u.query,{options:{caseSensitive:u.caseSensitive,wholeWord:u.wholeWord},activeIndex:c.current}),!0)},t[36]=i,t[37]=u.caseSensitive,t[38]=u.query,t[39]=u.wholeWord,t[40]=A):A=t[40];let j=A,M;t[41]===i?M=t[42]:(M=function(){if(!i||i.isDestroyed)return;let e=en(i.state),t=ow(i);p(e=>sw(e,t)?e:t),d(t=>t.activeIndex===e.activeIndex?t:{...t,activeIndex:e.activeIndex})},t[41]=i,t[42]=M);let N=M,P;t[43]===i?P=t[44]:(P=function(){cw(i,d,p)},t[43]=i,t[44]=P);let F=P,I;t[45]!==j||t[46]!==i||t[47]!==N?(I=function(){!i||i.isDestroyed||(j(),i.commands.selectNextFindMatch()&&lw(i),N())},t[45]=j,t[46]=i,t[47]=N,t[48]=I):I=t[48];let L=I,R;t[49]!==j||t[50]!==i||t[51]!==N?(R=function(){!i||i.isDestroyed||(j(),i.commands.selectPreviousFindMatch()&&lw(i),N())},t[49]=j,t[50]=i,t[51]=N,t[52]=R):R=t[52];let z=R,B;t[53]!==j||t[54]!==i||t[55]!==u.replacement||t[56]!==N?(B=function(){!i||i.isDestroyed||(j(),i.commands.replaceCurrentFindMatch(u.replacement)&&lw(i),N())},t[53]=j,t[54]=i,t[55]=u.replacement,t[56]=N,t[57]=B):B=t[57];let V=B,H;t[58]!==j||t[59]!==i||t[60]!==u.replacement||t[61]!==N?(H=function(){!i||i.isDestroyed||(j(),i.commands.replaceAllFindMatches(u.replacement)&&lw(i),N())},t[58]=j,t[59]=i,t[60]=u.replacement,t[61]=N,t[62]=H):H=t[62];let U=H;if(!u.open||!n||r)return null;let W,G,K,ee,te;t[63]===Symbol.for(`react.memo_cache_sentinel`)?(W=e=>d(t=>({...t,query:e,activeIndex:0})),G=e=>d(t=>({...t,replacement:e})),K=e=>d(t=>({...t,replaceOpen:e})),ee=e=>d(t=>({...t,caseSensitive:e})),te=e=>d(t=>({...t,wholeWord:e})),t[63]=W,t[64]=G,t[65]=K,t[66]=ee,t[67]=te):(W=t[63],G=t[64],K=t[65],ee=t[66],te=t[67]);let ne;return t[68]!==F||t[69]!==u.caseSensitive||t[70]!==u.query||t[71]!==u.replaceOpen||t[72]!==u.replacement||t[73]!==u.wholeWord||t[74]!==f.current||t[75]!==f.total||t[76]!==U||t[77]!==V||t[78]!==L||t[79]!==z?(ne=(0,Z.jsx)(`div`,{className:`editor-content-aligned pointer-events-none absolute inset-x-0 top-2 z-30 px-2`,children:(0,Z.jsx)(`div`,{className:`flex justify-end`,children:(0,Z.jsx)($C,{findInputRef:a,query:u.query,replacement:u.replacement,replaceOpen:u.replaceOpen,caseSensitive:u.caseSensitive,wholeWord:u.wholeWord,current:f.current,total:f.total,onQueryChange:W,onReplacementChange:G,onReplaceOpenChange:K,onCaseSensitiveChange:ee,onWholeWordChange:te,onNext:L,onPrevious:z,onReplaceCurrent:V,onReplaceAll:U,onClose:F})})}),t[68]=F,t[69]=u.caseSensitive,t[70]=u.query,t[71]=u.replaceOpen,t[72]=u.replacement,t[73]=u.wholeWord,t[74]=f.current,t[75]=f.total,t[76]=U,t[77]=V,t[78]=L,t[79]=z,t[80]=ne):ne=t[80],ne}function dw(e){return{...e,open:!1,activeIndex:0}}function fw(e){return{...e,activeIndex:0}}var pw=300;function mw(e,t){let n=(0,$.c)(4),[r,i]=(0,Q.useState)(ru),a,o;return n[0]!==t||n[1]!==e?(a=()=>{if(!e||!t){i(ru);return}let n=e.document.getText(`source`),r=!1,a=null,o=function(){r||i(su(n.toString()))};o();let s=function(){a&&clearTimeout(a),a=setTimeout(o,pw)};return n.observe(s),()=>{r=!0,n.unobserve(s),a&&clearTimeout(a)}},o=[e,t],n[0]=t,n[1]=e,n[2]=a,n[3]=o):(a=n[2],o=n[3]),(0,Q.useEffect)(a,o),r}function hw(e){return e&&e.document.getMap(`lifecycle`).get(`status`)===`conflict`?`conflict`:null}function gw(e){let t=(0,$.c)(8),{poolEntries:n}=vt(),r;t[0]!==e||t[1]!==n?(r=e?n.find(t=>t.docName===e)??null:null,t[0]=e,t[1]=n,t[2]=r):r=t[2];let i=r?.provider??null,a;t[3]===i?a=t[4]:(a=()=>hw(i),t[3]=i,t[4]=a);let[o,s]=(0,Q.useState)(a),c,l;return t[5]===i?(c=t[6],l=t[7]):(c=()=>{if(!i){s(null);return}let e=i.document.getMap(`lifecycle`);s(hw(i));let t=()=>s(hw(i));return e.observe(t),()=>{e.unobserve(t)}},l=[i],t[5]=i,t[6]=c,t[7]=l),(0,Q.useEffect)(c,l),o}function _w(e,t){let n=(0,$.c)(3),r;return n[0]!==e||n[1]!==t?(r=()=>du(e,t),n[0]=e,n[1]=t,n[2]=r):r=n[2],(0,Q.useSyncExternalStore)(fu,r)}var vw=`ok-doc-panel-width-v1`;function yw(e){return Number.isFinite(e)?e<300?300:e>600?600:Math.round(e):320}function bw(e){try{let t=(e??localStorage).getItem(vw);if(t==null)return 320;let n=Number.parseInt(t,10);return Number.isFinite(n)?yw(n):320}catch{return 320}}function xw(e,t){try{(t??localStorage).setItem(vw,String(yw(e)))}catch{}}function Sw(){try{return typeof localStorage>`u`?320:bw()}catch{return 320}}var Cw=1024,ww=1280,Tw={left:Cw,right:ww};function Ew(e,t,n){return e==null?t>=Tw[n]?`above`:`below`:`embedded`}function Dw(e){return e===`above`?`open`:`collapsed`}var Ow=`ok-sidebar-pins-v2`;function kw(e){return e===`open`||e===`collapsed`}function Aw(e){return e===`above`||e===`below`||e===`embedded`}function jw(e){if(typeof e!=`object`||!e)return!1;let t=e;for(let e of Object.keys(t))if(!Aw(e)||!kw(t[e]))return!1;return!0}function Mw(e){let t=JSON.parse(e);if(typeof t!=`object`||!t)return{};let n=t,r={};return jw(n.left)&&(r.left=n.left),jw(n.right)&&(r.right=n.right),r}function Nw(e){try{let t=(e??localStorage).getItem(Ow);return t==null?{}:Mw(t)}catch{return{}}}function Pw(e,t){try{t.setItem(Ow,JSON.stringify(e))}catch{}}function Fw(e,t,n){return n[e]?.[t]??Dw(t)}function Iw(e,t,n,r){let i=r??localStorage,a=Nw(i);return a[e]={...a[e],[t]:n},Pw(a,i),a}var Lw=`ok-terminal-width-v1`;function Rw(e){return Number.isFinite(e)?e<320?320:Math.round(e):480}function zw(e){try{let t=(e??localStorage).getItem(Lw);if(t==null)return 480;let n=Number.parseInt(t,10);return Number.isFinite(n)?Rw(n):480}catch{return 480}}function Bw(e,t){try{(t??localStorage).setItem(Lw,String(Rw(e)))}catch{}}function Vw(){try{return typeof localStorage>`u`?480:zw()}catch{return 480}}function Hw(e){let t=(0,$.c)(3),[n,r]=(0,Q.useState)(`connecting`),i,a;return t[0]===e?(i=t[1],a=t[2]):(i=()=>{if(!e){r(`connecting`);return}let t=e.configuration.websocketProvider.status;e.isSynced?r(`synced`):r(t===`connected`?`connected`:t===`disconnected`?`disconnected`:`connecting`);let n=e=>{let{status:t}=e;r(t===`connected`?Uw:t===`disconnected`?`disconnected`:`connecting`)},i=e=>{let{state:t}=e;r(t?`synced`:`connected`)},a=()=>r(`disconnected`);return e.on(`status`,n),e.on(`synced`,i),e.on(`disconnect`,a),()=>{e.off(`status`,n),e.off(`synced`,i),e.off(`disconnect`,a)}},a=[e],t[0]=e,t[1]=i,t[2]=a),(0,Q.useEffect)(i,a),n}function Uw(e){return e===`synced`?`synced`:`connected`}function Ww(e){let t=e.lastIndexOf(`/`);return t>=0?e.slice(t+1):e}function Gw(e){let t=(0,$.c)(21),{path:n,onRemove:r}=e,{_:i}=an(),a,o;t[0]!==i||t[1]!==n?(a=Ww(n),o=i({id:`hnq8fP`,values:{label:a}}),t[0]=i,t[1]=n,t[2]=a,t[3]=o):(a=t[2],o=t[3]);let s=o,c=`composer-context-chip-file-${n}`,l;t[4]===r?l=t[5]:(l=e=>{(e.key===`Backspace`||e.key===`Delete`)&&(e.preventDefault(),r())},t[4]=r,t[5]=l);let u;t[6]===n?u=t[7]:(u=(0,Z.jsx)(`span`,{className:`absolute top-1/2 left-1/2 inline-flex size-3 -translate-x-1/2 -translate-y-1/2 opacity-100 transition-opacity duration-150 ease-out group-hover/chip:opacity-0 group-focus-within/chip:opacity-0 motion-reduce:transition-none`,children:(0,Z.jsx)(oe,{path:n,className:`size-3`,showExtensionBadge:!1})}),t[6]=n,t[7]=u);let d;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Z.jsx)(xs,{className:`absolute top-1/2 left-1/2 size-3 -translate-x-1/2 -translate-y-1/2 opacity-0 transition-opacity duration-150 ease-out group-hover/chip:opacity-100 group-focus-within/chip:opacity-100 motion-reduce:transition-none`,"aria-hidden":!0}),t[8]=d):d=t[8];let f;t[9]!==r||t[10]!==s||t[11]!==l||t[12]!==u?(f=(0,Z.jsxs)(X,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":s,onClick:r,onKeyDown:l,className:`group/remove relative size-3.5 shrink-0 rounded-sm text-muted-foreground/80 hover:text-foreground`,children:[u,d]}),t[9]=r,t[10]=s,t[11]=l,t[12]=u,t[13]=f):f=t[13];let p;t[14]===a?p=t[15]:(p=(0,Z.jsx)(`span`,{className:`min-w-0 truncate`,children:a}),t[14]=a,t[15]=p);let m;return t[16]!==n||t[17]!==c||t[18]!==f||t[19]!==p?(m=(0,Z.jsxs)(`span`,{"data-testid":c,title:n,className:`group/chip inline-flex max-w-[14rem] items-center gap-1 rounded-md border bg-muted/40 py-0.5 pr-1.5 pl-1 text-muted-foreground text-xs`,children:[f,p]}),t[16]=n,t[17]=c,t[18]=f,t[19]=p,t[20]=m):m=t[20],m}function Kw(e){let t=(0,$.c)(11),{files:n,onRemoveFile:r,className:i,children:a}=e;if(n.length===0&&a==null)return null;let o;t[0]===i?o=t[1]:(o=Y(`flex flex-wrap items-center gap-1`,i),t[0]=i,t[1]=o);let s;if(t[2]!==n||t[3]!==r){let e;t[5]===r?e=t[6]:(e=e=>(0,Z.jsx)(Gw,{path:e,onRemove:()=>r(e)},e),t[5]=r,t[6]=e),s=n.map(e),t[2]=n,t[3]=r,t[4]=s}else s=t[4];let c;return t[7]!==a||t[8]!==o||t[9]!==s?(c=(0,Z.jsxs)(`div`,{className:o,"data-testid":`composer-context-chips`,children:[s,a]}),t[7]=a,t[8]=o,t[9]=s,t[10]=c):c=t[10],c}function qw(e){let t=(0,$.c)(35),{primary:n,onPrimary:r,primaryDisabled:i,installedTargets:a,selectedTargetId:o,onSelectTarget:s,terminal:c,terminals:l,menuEmptyState:u,onMenuOpenChange:d,menuAlign:f,triggerAriaLabel:p,testIds:m}=e,h=i===void 0?!1:i,g=f===void 0?`end`:f,{_}=an(),v=a.length>0,y=l&&l.length>0?l:null,b=y!=null||c!=null,x=v||b,S;t[0]===m?S=t[1]:(S=e=>typeof m.terminal==`function`?m.terminal(e):m.terminal,t[0]=m,t[1]=S);let C=S,w;t[2]!==r||t[3]!==n||t[4]!==h||t[5]!==m.primary?(w=(0,Z.jsx)(X,{type:`button`,variant:`outline`,className:`gap-1.5`,disabled:h,onClick:r,"data-testid":m.primary,children:n}),t[2]=r,t[3]=n,t[4]=h,t[5]=m.primary,t[6]=w):w=t[6];let T;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,Z.jsx)(Yi,{"aria-hidden":`true`,className:`size-3.5 text-muted-foreground`}),t[7]=T):T=t[7];let E;t[8]!==m.trigger||t[9]!==p?(E=(0,Z.jsx)(bc,{asChild:!0,children:(0,Z.jsx)(X,{type:`button`,variant:`outline`,size:`icon`,"aria-label":p,"data-testid":m.trigger,children:T})}),t[8]=m.trigger,t[9]=p,t[10]=E):E=t[10];let D;t[11]!==_||t[12]!==y||t[13]!==x||t[14]!==a||t[15]!==u||t[16]!==s||t[17]!==o||t[18]!==v||t[19]!==b||t[20]!==c||t[21]!==C||t[22]!==m?(D=x?(0,Z.jsxs)(Z.Fragment,{children:[b?(0,Z.jsxs)(Cc,{"aria-label":_({id:`ALhMYW`}),children:[(0,Z.jsx)(Nc,{children:(0,Z.jsx)(J,{id:`ALhMYW`})}),y?y.map(e=>(0,Z.jsxs)(Sc,{onSelect:e.onSelect,"data-testid":C(e.cli),"aria-label":e.ariaLabel,children:[(0,Z.jsx)(fa,{id:da(e.cli),className:`size-4`,"aria-hidden":`true`}),(0,Z.jsx)(`span`,{className:`flex-1`,children:e.label}),e.selected?(0,Z.jsx)(Ji,{"aria-hidden":`true`,className:`size-4 text-muted-foreground`}):null]},e.cli)):c?(0,Z.jsxs)(Sc,{onSelect:c.onSelect,"data-testid":C(`claude`),"aria-label":_({id:`AcK_r0`}),children:[(0,Z.jsx)(fa,{id:da(`claude`),className:`size-4`,"aria-hidden":`true`}),(0,Z.jsx)(`span`,{className:`flex-1`,children:(0,Z.jsx)(J,{id:`fcgvCA`})}),c.selected?(0,Z.jsx)(Ji,{"aria-hidden":`true`,className:`size-4 text-muted-foreground`}):null]}):null]}):null,v?(0,Z.jsxs)(Z.Fragment,{children:[b?(0,Z.jsx)(Fc,{}):null,(0,Z.jsxs)(Cc,{"aria-label":_({id:`BBqGS9`}),children:[(0,Z.jsx)(Nc,{children:(0,Z.jsx)(J,{id:`BBqGS9`})}),a.map(e=>(0,Z.jsxs)(Sc,{onSelect:()=>s(e),"data-testid":m.option(e.id),children:[(0,Z.jsx)(fa,{id:e.id,"aria-hidden":`true`,className:`size-4`}),(0,Z.jsx)(`span`,{className:`flex-1`,children:e.displayName}),o===e.id?(0,Z.jsx)(Ji,{"aria-hidden":`true`,className:`size-4 text-muted-foreground`}):null]},e.id))]})]}):null]}):u,t[11]=_,t[12]=y,t[13]=x,t[14]=a,t[15]=u,t[16]=s,t[17]=o,t[18]=v,t[19]=b,t[20]=c,t[21]=C,t[22]=m,t[23]=D):D=t[23];let O;t[24]!==g||t[25]!==D||t[26]!==m.menu?(O=(0,Z.jsx)(wc,{align:g,className:`min-w-[200px]`,"data-testid":m.menu,children:D}),t[24]=g,t[25]=D,t[26]=m.menu,t[27]=O):O=t[27];let k;t[28]!==d||t[29]!==E||t[30]!==O?(k=(0,Z.jsxs)(Ac,{onOpenChange:d,children:[E,O]}),t[28]=d,t[29]=E,t[30]=O,t[31]=k):k=t[31];let A;return t[32]!==w||t[33]!==k?(A=(0,Z.jsxs)(wx,{children:[w,k]}),t[32]=w,t[33]=k,t[34]=A):A=t[34],A}var Jw=`ok-onboarding-card-v1`,Yw={initialized:!1,steps:{file:!1,askedAi:!1},dismissed:!1,completed:!1};function Xw(e){return e===!0}function Zw(e){if(typeof e!=`object`||!e)return Yw;let t=e,n=typeof t.steps==`object`&&t.steps!==null?t.steps:{};return{initialized:Xw(t.initialized),steps:{file:Xw(n.file),askedAi:Xw(n.askedAi)},dismissed:Xw(t.dismissed),completed:Xw(t.completed)}}function Qw(e){try{let t=(e??localStorage).getItem(Jw);return t==null?Yw:Zw(JSON.parse(t))}catch(e){return console.warn(`[onboarding-card-store] readPersistedState failed (corrupt/privacy/SSR)`,e),Yw}}function $w(e,t){try{(t??localStorage).setItem(Jw,JSON.stringify(e))}catch(e){console.warn(`[onboarding-card-store] writePersistedState failed (quota/privacy/SSR)`,e)}}function eT(e){let t=Qw(e),n=new Set,r=!1;function i(){for(let e of n)e()}function a(n){t=n,$w(t,e),i()}return{getSnapshot(){return t},subscribe(e){return n.add(e),()=>{n.delete(e)}},activate(){t.initialized||a({...t,initialized:!0})},markStepComplete(e){t.steps[e]||a({...t,steps:{...t.steps,[e]:!0}})},dismiss(){t.dismissed||a({...t,dismissed:!0})},markCompleted(){t.completed||a({...t,completed:!0})},install(){r||(r=!0,t=Qw(e),i())}}}var tT=eT();function nT(e){let t=e===void 0?tT:e;return(0,Q.useSyncExternalStore)(t.subscribe,t.getSnapshot,t.getSnapshot)}function rT(){tT.install()}function iT(e){return el(e).filter(e=>e.kind===`document`||e.kind===`folder`).length}async function aT(){let e=await fetch(`/api/documents`);if(!e.ok)throw Error(`documents request failed: ${e.status}`);let t=await e.json(),n=Un.safeParse(t);if(!n.success)throw Error(`documents response did not match schema`,{cause:n.error});return iT(n.data.documents)}async function oT(e=tT){let t=e.getSnapshot();if(!(t.steps.file||!t.initialized))try{await aT()>=1&&e.markStepComplete(`file`)}catch(e){console.warn(`[onboarding-signals] file-step count read failed; leaving step incomplete`,e)}}function sT(e=tT){e.getSnapshot().initialized&&e.markStepComplete(`askedAi`)}var cT=5200,lT=500,uT=/\.(md|mdx)$/i;function dT(e,t){return uT.test(e)?e:t?`${e}${t}`:ca(e)}function fT(e){return uT.test(e)?e.replace(uT,``):null}function pT(e){if(!(e instanceof HTMLElement))return!1;let t=e.tagName.toUpperCase();return t===`INPUT`||t===`TEXTAREA`||t===`SELECT`}function mT(){let e=(0,$.c)(2),[t,n]=(0,Q.useState)(hT),r,i;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>{let e=window.matchMedia(`(prefers-reduced-motion: reduce)`);n(e.matches);let t=e=>n(e.matches);return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},i=[],e[0]=r,e[1]=i):(r=e[0],i=e[1]),(0,Q.useEffect)(r,i),t}function hT(){return typeof window<`u`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}function gT(e,t){let n=(0,$.c)(9),[r,i]=(0,Q.useState)(0),[a,o]=(0,Q.useState)(!0),s,c;if(n[0]!==t||n[1]!==a?(s=()=>{if(!t)return;if(a){let e=setTimeout(()=>o(!1),cT);return()=>clearTimeout(e)}let e=setTimeout(()=>{i(_T),o(!0)},lT);return()=>clearTimeout(e)},c=[a,t],n[0]=t,n[1]=a,n[2]=s,n[3]=c):(s=n[2],c=n[3]),(0,Q.useEffect)(s,c),!t){let t=e[0]??``,r;return n[4]===t?r=n[5]:(r={text:t,visible:!0},n[4]=t,n[5]=r),r}let l=e[e.length>0?r%e.length:0]??``,u;return n[6]!==l||n[7]!==a?(u={text:l,visible:a},n[6]=l,n[7]=a,n[8]=u):u=n[8],u}function _T(e){return e+1}function vT(e){let t=(0,$.c)(157),{docName:n,surface:r,folderPath:i,dismissed:a,onDismiss:o,onReopen:s}=e,c=a===void 0?!1:a,{_:l}=an(),u=i!==void 0,d=u?null:n??null,f=r??`wysiwyg`,p=mT(),m=ia(),{pageMeta:h}=ea(),{states:g}=va(),{dispatch:_}=Ea(),v=wa(),[y]=(0,Q.useState)(kT),[b,x]=(0,Q.useState)(null),S=t_(),[C,w]=(0,Q.useState)(!0),[T,E]=(0,Q.useState)(!1),D=(0,Q.useRef)(null),O=(0,Q.useRef)(null),[k]=(0,Q.useState)(OT),A,j;t[0]!==c||t[1]!==n||t[2]!==u||t[3]!==r?(A=()=>{if(u||n==null)return;let e=document.documentElement,t=ET,i=()=>{r===`wysiwyg`&&requestAnimationFrame(()=>{let e=Ce(n),t=O.current;if(!(!e||e.isDestroyed||!t))try{let n=e.view,r=n.coordsAtPos(e.state.selection.head).bottom-(t.getBoundingClientRect().top-28);if(r<=0)return;let i=n.dom.closest(`.editor-doc-scroll`);i instanceof HTMLElement&&(i.scrollTop+=r)}catch{}})},a=O.current;if(c||!a){t(),e.style.removeProperty(`--ask-composer-height`);return}let o=()=>{t(),e.style.setProperty(`--ask-composer-height`,`${a.offsetHeight+56}px`)};o(),i();let s=new ResizeObserver(o);return s.observe(a),()=>{s.disconnect(),t(),e.style.removeProperty(`--ask-composer-height`)}},j=[c,r,n,u],t[0]=c,t[1]=n,t[2]=u,t[3]=r,t[4]=A,t[5]=j):(A=t[4],j=t[5]),(0,Q.useEffect)(A,j);let M=(0,Q.useRef)(c),N=(0,Q.useRef)(s),P;t[6]!==c||t[7]!==s?(P=()=>{M.current=c,N.current=s},t[6]=c,t[7]=s,t[8]=P):P=t[8],(0,Q.useEffect)(P);let F,I;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(F=()=>cu(()=>{M.current?N.current?.():D.current?.focus()}),I=[],t[9]=F,t[10]=I):(F=t[9],I=t[10]),(0,Q.useEffect)(F,I);let L;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(L=[],t[11]=L):L=t[11],(0,Q.useEffect)(wT,L);let R=(0,Q.useRef)(c),z,B;t[12]===c?(z=t[13],B=t[14]):(z=()=>{let e=R.current;R.current=c,e&&!c&&D.current?.focus()},B=[c],t[12]=c,t[13]=z,t[14]=B),(0,Q.useEffect)(z,B);let V;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(V=[],t[15]=V):V=t[15];let[H,U]=(0,Q.useState)(V),[W,G]=(0,Q.useState)(CT),K;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(K=[],t[16]=K):K=t[16];let[ee,te]=(0,Q.useState)(K),ne;t[17]!==n||t[18]!==u||t[19]!==h?(ne=u||n==null?``:dT(n,h.get(n)?.docExt),t[17]=n,t[18]=u,t[19]=h,t[20]=ne):ne=t[20];let re=ne,ie,ae;t[21]!==re||t[22]!==W||t[23]!==u||t[24]!==C?(ie=()=>{u||C||U(e=>{if(W.has(re))return e;let t=fT(re),n=t===null?e:e.filter(e=>e===re||fT(e)!==t);return n.includes(re)?n.length===e.length?e:n:[...n,re]})},ae=[u,C,re,W],t[21]=re,t[22]=W,t[23]=u,t[24]=C,t[25]=ie,t[26]=ae):(ie=t[25],ae=t[26]),(0,Q.useEffect)(ie,ae);let oe;t[27]!==W||t[28]!==u||t[29]!==i||t[30]!==ee||t[31]!==H?(oe=u?i&&!W.has(i)&&!ee.includes(i)?[i]:[]:H.filter(e=>!W.has(e)&&!ee.includes(e)),t[27]=W,t[28]=u,t[29]=i,t[30]=ee,t[31]=H,t[32]=oe):oe=t[32];let se=oe,ce=Wi(d,f),le=Wi(d,`frontmatter`),[q,ue]=(0,Q.useState)(null),[de,fe]=(0,Q.useState)(!1),pe,me;t[33]===ce?(pe=t[34],me=t[35]):(pe=()=>{ce&&ue(ce)},me=[ce],t[33]=ce,t[34]=pe,t[35]=me),(0,Q.useEffect)(pe,me);let he,ge;t[36]===le?(he=t[37],ge=t[38]):(he=()=>{le&&ue(le)},ge=[le],t[36]=le,t[37]=he,t[38]=ge),(0,Q.useEffect)(he,ge);let _e=b??y,ve;t[39]!==_e||t[40]!==v?(ve=v===null?null:u_(_e),t[39]=_e,t[40]=v,t[41]=ve):ve=t[41];let ye=ve,be;t[42]!==_e||t[43]!==S||t[44]!==v?(be=v!==null&&_e===null?h_(null,S):null,t[42]=_e,t[43]=S,t[44]=v,t[45]=be):be=t[45];let xe=ye??be,Se=xe!==null,we;t[46]!==_e||t[47]!==Se||t[48]!==g?(we=Se?null:m_(g,_e),t[46]=_e,t[47]=Se,t[48]=g,t[49]=we):we=t[49];let Te=we,Ee=!T&&(!C||q!==null)&&(Se||Te!==null),De;t[50]===g?De=t[51]:(De=oa.filter(e=>g[e.id]?.installed===!0),t[50]=g,t[51]=De);let Oe=De,ke;t[52]===g?ke=t[53]:(ke=oa.some(e=>g[e.id]?.installed==null),t[52]=g,t[53]=ke);let Ae=ke,je=v===null?void 0:hr.map(e=>{let{displayName:t}=mi[e];return{cli:e,label:t,ariaLabel:l({id:`QYfQdv`,values:{displayName:t}}),selected:xe===e,onSelect:()=>Be(e)}}),Me;t[54]===l?Me=t[55]:(Me=l({id:`KYSocE`}),t[54]=l,t[55]=Me);let Ne;t[56]===l?Ne=t[57]:(Ne=l({id:`7Ongq0`}),t[56]=l,t[57]=Ne);let Pe;t[58]===l?Pe=t[59]:(Pe=l({id:`HPTPGr`}),t[58]=l,t[59]=Pe);let Fe;t[60]===l?Fe=t[61]:(Fe=l({id:`qiRoLb`}),t[60]=l,t[61]=Fe);let Ie;t[62]!==Me||t[63]!==Ne||t[64]!==Pe||t[65]!==Fe?(Ie=[Me,Ne,Pe,Fe],t[62]=Me,t[63]=Ne,t[64]=Pe,t[65]=Fe,t[66]=Ie):Ie=t[66];let Le=gT(Ie,!p&&C&&!c),Re;t[67]===Symbol.for(`react.memo_cache_sentinel`)?(Re=e=>{x(e.id),p_(e.id)},t[67]=Re):Re=t[67];let ze=Re,Be=e=>{let t=l_(e);x(t),p_(t)},Ve;t[68]===Symbol.for(`react.memo_cache_sentinel`)?(Ve=()=>{D.current?.clear(),ue(null),fe(!1),U([]),G(new Set),bx()},t[68]=Ve):Ve=t[68];let He=Ve,Ue;t[69]!==l||t[70]!==_||t[71]!==Te||t[72]!==xe||t[73]!==v?(Ue=e=>{if(e===null){bs.error(l({id:`y8B54M`}));return}if(xe!==null&&v!==null){try{v.launchInTerminal(e,xe)}catch{bs.error(l({id:`jBVUXo`}));return}sT(),He();return}Te!==null&&(E(!0),_(Te.id,e).then(ST).finally(()=>{E(!1),He()}))},t[69]=l,t[70]=_,t[71]=Te,t[72]=xe,t[73]=v,t[74]=Ue):Ue=t[74];let We=Ue,Ge;t[75]!==re||t[76]!==Ee||t[77]!==We||t[78]!==n||t[79]!==se||t[80]!==u||t[81]!==i||t[82]!==h||t[83]!==q||t[84]!==m?(Ge=()=>{if(!Ee)return;let{instruction:e,mentions:t}=D.current?.getContent()??{instruction:``,mentions:[]};if(u){We(ma({docName:null,folderRelativePath:i,workspace:m,instruction:e,mentions:[...new Set([...se,...t])].filter(e=>e!==i)}));return}let r=q?_u(q):void 0,a=q?.docName??null,o=q?a:se.includes(re)?n??null:null,s=o===null?null:dT(o,h.get(o)?.docExt),c=[...new Set([...se,...t])].filter(e=>e!==s);We(ma({docName:o,...s===null?{}:{docRelativePath:s},workspace:m,instruction:e,mentions:c,selection:r}))},t[75]=re,t[76]=Ee,t[77]=We,t[78]=n,t[79]=se,t[80]=u,t[81]=i,t[82]=h,t[83]=q,t[84]=m,t[85]=Ge):Ge=t[85];let Ke=Ge;if(c)return null;let qe=``,Je=``;if(q){let e;t[86]!==h||t[87]!==q?(e=vu(q,dT(q.docName,h.get(q.docName)?.docExt).split(`/`).pop()??``),t[86]=h,t[87]=q,t[88]=e):e=t[88],qe=e;let n;t[89]===q.markdown?n=t[90]:(n=yu(q.markdown),t[89]=q.markdown,t[90]=n),Je=n}let Ye;t[91]===Symbol.for(`react.memo_cache_sentinel`)?(Ye=e=>Sx(e,D),t[91]=Ye):Ye=t[91];let Xe;t[92]!==l||t[93]!==u||t[94]!==o?(Xe=u?null:(0,Z.jsx)(X,{type:`button`,variant:`outline`,"aria-label":l({id:`EWX92Z`}),onClick:()=>o?.(),"data-testid":`ask-ai-collapse`,className:`-top-2.5 -translate-x-1/2 absolute left-1/2 z-10 h-5 w-10 rounded-md p-0 text-muted-foreground opacity-0 shadow-sm transition-opacity hover:text-foreground focus-visible:opacity-100 group-focus-within:opacity-100 group-hover:opacity-100`,children:(0,Z.jsx)(Yi,{className:`size-3.5`,"aria-hidden":!0})}),t[92]=l,t[93]=u,t[94]=o,t[95]=Xe):Xe=t[95];let Ze;t[96]===Symbol.for(`react.memo_cache_sentinel`)?(Ze=e=>G(t=>{let n=new Set(t);return n.add(e),n}),t[96]=Ze):Ze=t[96];let Qe;t[97]!==l||t[98]!==qe||t[99]!==Je||t[100]!==q||t[101]!==de?(Qe=q?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`span`,{"data-testid":`composer-selection-pill`,title:qe,className:`group/chip inline-flex max-w-[16rem] items-center gap-1 rounded-md border bg-muted/40 py-0.5 pr-1.5 pl-1 text-muted-foreground text-xs`,children:[(0,Z.jsxs)(X,{type:`button`,variant:`ghost`,size:`icon`,"aria-label":l({id:`irrm_E`}),onClick:()=>{ue(null),fe(!1)},className:`group/remove relative size-3.5 shrink-0 rounded-sm text-muted-foreground/80 hover:text-foreground`,children:[(0,Z.jsx)(Rf,{className:`absolute top-1/2 left-1/2 size-3 -translate-x-1/2 -translate-y-1/2 opacity-100 transition-opacity duration-150 ease-out group-hover/chip:opacity-0 group-focus-within/chip:opacity-0 motion-reduce:transition-none`,"aria-hidden":!0}),(0,Z.jsx)(xs,{className:`absolute top-1/2 left-1/2 size-3 -translate-x-1/2 -translate-y-1/2 opacity-0 transition-opacity duration-150 ease-out group-hover/chip:opacity-100 group-focus-within/chip:opacity-100 motion-reduce:transition-none`,"aria-hidden":!0})]}),(0,Z.jsx)(X,{type:`button`,variant:`ghost`,"aria-expanded":de,"aria-label":l(de?{id:`UaDyeb`}:{id:`eTL5y9`}),onClick:()=>fe(xT),"data-testid":`composer-selection-peek`,className:`h-auto min-h-0 min-w-0 shrink justify-start px-0 py-0 text-left font-normal text-muted-foreground text-xs hover:bg-transparent hover:text-foreground`,children:(0,Z.jsx)(`span`,{className:`min-w-0 truncate`,children:qe})})]}),de&&Je!==``?(0,Z.jsx)(`p`,{className:`max-h-24 w-full basis-full overflow-y-auto whitespace-pre-wrap text-2xs text-muted-foreground/80 subtle-scrollbar`,"data-testid":`composer-selection-preview`,children:Je}):null]}):null,t[97]=l,t[98]=qe,t[99]=Je,t[100]=q,t[101]=de,t[102]=Qe):Qe=t[102];let $e;t[103]!==se||t[104]!==Qe?($e=(0,Z.jsx)(Kw,{files:se,onRemoveFile:Ze,children:Qe}),t[103]=se,t[104]=Qe,t[105]=$e):$e=t[105];let et;t[106]===l?et=t[107]:(et=l({id:`xWEvuo`}),t[106]=l,t[107]=et);let tt;t[108]!==k||t[109]!==Ke||t[110]!==et?(tt=(0,Z.jsx)(Ux,{ref:D,ariaLabel:et,onEmptyChange:w,onContentChange:yx,onMentionsChange:te,onSubmit:Ke,initialDoc:k,className:`max-h-[200px] overflow-y-auto text-base md:text-sm`}),t[108]=k,t[109]=Ke,t[110]=et,t[111]=tt):tt=t[111];let nt;t[112]!==C||t[113]!==p||t[114]!==Le?(nt=C?(0,Z.jsx)(`div`,{"aria-hidden":!0,className:Y(`pointer-events-none absolute inset-0 truncate px-0 py-1 text-base text-muted-foreground/60 md:text-sm`,!p&&`transition-opacity duration-500 ease-in-out`,Le.visible?`opacity-100`:`opacity-0`),children:Le.text}):null,t[112]=C,t[113]=p,t[114]=Le,t[115]=nt):nt=t[115];let rt;t[116]!==tt||t[117]!==nt?(rt=(0,Z.jsxs)(`div`,{className:`relative flex-1`,children:[tt,nt]}),t[116]=tt,t[117]=nt,t[118]=rt):rt=t[118];let it;t[119]!==Te||t[120]!==xe?(it=xe===null?Te?(0,Z.jsx)(fa,{id:Te.id,className:`size-4`,"aria-hidden":!0}):null:(0,Z.jsx)(fa,{id:da(xe),className:`size-4`,"aria-hidden":!0}),t[119]=Te,t[120]=xe,t[121]=it):it=t[121];let at;t[122]!==Te||t[123]!==xe?(at=(0,Z.jsx)(`span`,{children:xe===null?Te?(0,Z.jsx)(J,{id:`nUNZL4`,values:{0:Te.displayName}}):(0,Z.jsx)(J,{id:`F-vBv0`}):(0,Z.jsx)(J,{id:`ti6aF_`,values:{0:mi[xe].displayName}})}),t[122]=Te,t[123]=xe,t[124]=at):at=t[124];let ot;t[125]===T?ot=t[126]:(ot=T?(0,Z.jsx)(is,{className:`size-3.5 animate-spin`,"aria-hidden":!0}):null,t[125]=T,t[126]=ot);let st;t[127]!==it||t[128]!==at||t[129]!==ot?(st=(0,Z.jsxs)(Z.Fragment,{children:[it,at,ot]}),t[127]=it,t[128]=at,t[129]=ot,t[130]=st):st=t[130];let ct=!Ee,lt=Se?null:Te?.id??null,ut;t[131]===Ae?ut=t[132]:(ut=(0,Z.jsx)(`p`,{className:`px-2 py-1.5 text-sm text-muted-foreground`,"aria-live":`polite`,children:Ae?(0,Z.jsx)(J,{id:`EcR0fl`}):(0,Z.jsx)(J,{id:`l6OXqI`})}),t[131]=Ae,t[132]=ut);let dt;t[133]===l?dt=t[134]:(dt=l({id:`nskygk`}),t[133]=l,t[134]=dt);let ft;t[135]===Symbol.for(`react.memo_cache_sentinel`)?(ft={primary:`ask-ai-send`,trigger:`ask-ai-agent-trigger`,menu:`ask-ai-agent-menu`,option:bT,terminal:yT},t[135]=ft):ft=t[135];let pt;t[136]!==je||t[137]!==ze||t[138]!==Oe||t[139]!==Ke||t[140]!==st||t[141]!==ct||t[142]!==lt||t[143]!==ut||t[144]!==dt?(pt=(0,Z.jsx)(qw,{primary:st,onPrimary:Ke,primaryDisabled:ct,installedTargets:Oe,selectedTargetId:lt,onSelectTarget:ze,terminals:je,menuEmptyState:ut,triggerAriaLabel:dt,testIds:ft}),t[136]=je,t[137]=ze,t[138]=Oe,t[139]=Ke,t[140]=st,t[141]=ct,t[142]=lt,t[143]=ut,t[144]=dt,t[145]=pt):pt=t[145];let mt;t[146]!==rt||t[147]!==pt?(mt=(0,Z.jsxs)(`div`,{className:`flex items-end gap-2`,children:[rt,pt]}),t[146]=rt,t[147]=pt,t[148]=mt):mt=t[148];let ht;t[149]!==Xe||t[150]!==$e||t[151]!==mt?(ht=(0,Z.jsxs)(`div`,{ref:O,onMouseDown:Ye,className:`pointer-events-auto group relative flex cursor-text flex-col gap-1.5 rounded-2xl border border-border/60 bg-card px-3 py-2 shadow-sm transition-colors focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/50`,children:[Xe,$e,mt]}),t[149]=Xe,t[150]=$e,t[151]=mt,t[152]=ht):ht=t[152];let gt=ht;if(u){let e;return t[153]===gt?e=t[154]:(e=(0,Z.jsx)(`div`,{className:`shrink-0 pt-2 pb-3`,"data-testid":`bottom-composer`,children:(0,Z.jsx)(`div`,{className:`mx-auto w-full max-w-4xl px-6`,children:gt})}),t[153]=gt,t[154]=e),e}let _t;return t[155]===gt?_t=t[156]:(_t=(0,Z.jsx)(`div`,{className:`pointer-events-none absolute inset-x-0 bottom-[var(--conflict-footer-height,0px)] z-20 editor-content-aligned bg-gradient-to-t from-background from-65% via-background to-transparent pt-10 pb-2`,"data-testid":`bottom-composer`,children:gt}),t[155]=gt,t[156]=_t),_t}function yT(e){return e===`claude`?`ask-ai-agent-option-terminal`:`ask-ai-agent-option-terminal-${e}`}function bT(e){return`ask-ai-agent-option-${e}`}function xT(e){return!e}function ST(e){e.ok&&sT()}function CT(){return new Set}function wT(){let e=TT;return window.addEventListener(`keydown`,e,{capture:!0}),()=>window.removeEventListener(`keydown`,e,{capture:!0})}function TT(e){Pl(e,`open-ask-ai`)&&(pT(e.target)||(e.preventDefault(),pu()))}function ET(){let e=[...document.querySelectorAll(`.editor-doc-scroll`)].filter(DT);if(e.length===0)return;let t=!1,n=()=>{t=!0};window.addEventListener(`wheel`,n,{passive:!0}),window.addEventListener(`touchstart`,n,{passive:!0});let r=performance.now(),i=()=>{if(t||performance.now()-r>=300){window.removeEventListener(`wheel`,n),window.removeEventListener(`touchstart`,n);return}for(let t of e)t.scrollTop=t.scrollHeight-t.clientHeight;requestAnimationFrame(i)};requestAnimationFrame(i)}function DT(e){let t=e.scrollHeight-e.clientHeight;return t>0&&e.scrollTop>=t-40}function OT(){return vx().doc??void 0}function kT(){return f_()}function AT(e){return!e.terminalVisible&&!e.isEmbedded&&e.activeDocName!==null}function jT(e){return!e.terminalVisible&&!e.isEmbedded}function MT(e,t={}){let n=ke(e.componentName);return n.name===`*`?t.unregisteredSuffix?`${e.componentName} (unregistered)`:e.componentName:n.displayName??n.name}var NT=200,PT=`Outside any block`;function FT(e){let t=(0,$.c)(5),{editor:n}=e,r=Qt(n),i=(0,Q.useRef)(null),a=(0,Q.useRef)(null),o=(0,Q.useRef)(!1),s,c;t[0]!==r||t[1]!==n?(s=()=>{if(a.current!==null&&(window.clearTimeout(a.current),a.current=null),!n||!i.current)return;let e=r!==null&&r.ancestorChain.length>0,t;return t=e?IT(n,r):o.current?PT:``,a.current=window.setTimeout(()=>{i.current&&(i.current.textContent=``,i.current.textContent=t),o.current=e,a.current=null},NT),()=>{a.current!==null&&(window.clearTimeout(a.current),a.current=null)}},c=[n,r],t[0]=r,t[1]=n,t[2]=s,t[3]=c):(s=t[2],c=t[3]),(0,Q.useEffect)(s,c);let l;return t[4]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Z.jsx)(`div`,{ref:i,role:`status`,"aria-live":`polite`,"aria-atomic":`true`,className:`sr-only`}),t[4]=l):l=t[4],l}function IT(e,t){if(!t||t.ancestorChain.length===0)return``;let n=t.ancestorChain,r=n[n.length-1],i=MT(r,{unregisteredSuffix:!0});if(n.length===1)return`Selected: ${i}`;let a=n[n.length-2],o=MT(a);try{let t=e.state.doc.resolve(r.pos),n=t.index(t.depth),a=t.parent.childCount;return`Selected: ${i}, ${n+1} of ${a} in ${o}`}catch{return`Selected: ${i} in ${o}`}}var LT=!1;function RT(e,t,n,r){let i=e[t];if(typeof i!=`function`){console.warn(`[cold-mount-instrumentation] target missing method "${t}"`);return}e[t]=function(...e){let t=performance.now(),a,o=!1;try{return a=i.apply(this,e),o=!0,a}finally{let e=performance.now()-t,i;if(o&&r)try{i=r(this,a,t,e)}catch(e){i={"instrumentation-error":e instanceof Error?e.message:String(e)}}try{_l(n,{durationMs:Math.round(e*1e3)/1e3,threw:!o,...i},{startTime:t,duration:e})}catch{}}}}function zT(e){return e?.doc?typeof e.doc.nodeSize==`number`?e.doc.nodeSize:e.doc.content&&typeof e.doc.content.size==`number`?e.doc.content.size:null:null}var BT=0,VT=0,HT=0,UT=0,WT=null,GT=[`linkResolutionDecoration$`],KT=new WeakSet,qT=new WeakSet;function JT(e){return e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase()}function YT(){return!1}function XT(){return!YT()}function ZT(e,t){if(XT())return t;let n=`ok/cold/nodeview-factory-${JT(e)}`;return function(...r){let i=performance.now();try{return t(...r)}finally{let t=performance.now()-i;_l(n,{nodeType:e,durationMs:Math.round(t*1e3)/1e3},{startTime:i,duration:t})}}}function QT(e){if(XT())return;let t=e.state.plugins;for(let e of t){if(qT.has(e))continue;let t=e.spec?.key?.key;if(!t||!GT.some(e=>t.startsWith(e)))continue;let n=e.props,r=n.decorations;if(typeof r!=`function`){qT.add(e);continue}let i=`ok/cold/decoration-${JT(t.replace(/\$\d*$/,``))}`;n.decorations=function(...e){let n=performance.now();try{return r.apply(this,e)}finally{let e=performance.now()-n;_l(i,{pluginKey:t,durationMs:Math.round(e*1e3)/1e3},{startTime:n,duration:e})}},qT.add(e)}}function $T(e){if(XT())return;let t=e._props?.nodeViews;if(!(!t||typeof t!=`object`))for(let[e,n]of Object.entries(t)){if(typeof n!=`function`||n.__okWrapped===!0)continue;let r=ZT(e,n);r.__okWrapped=!0,t[e]=r}}function eE(e){return XT()?e:e.map(e=>{let t=e.name??`unknown`,n=JT(t);return e.extend({onBeforeCreate(){let e=performance.now();try{this.parent?.()}finally{let r=performance.now()-e;_l(`ok/cold/ext-${n}-on-before-create`,{ext:t,hook:`onBeforeCreate`,durationMs:Math.round(r*1e3)/1e3},{startTime:e,duration:r})}},onCreate(){let e=performance.now();try{this.parent?.()}finally{let r=performance.now()-e;_l(`ok/cold/ext-${n}-on-create`,{ext:t,hook:`onCreate`,durationMs:Math.round(r*1e3)/1e3},{startTime:e,duration:r})}},onUpdate(){let e=performance.now();try{this.parent?.()}finally{let r=performance.now()-e;_l(`ok/cold/ext-${n}-on-update`,{ext:t,hook:`onUpdate`,durationMs:Math.round(r*1e3)/1e3},{startTime:e,duration:r})}},onDestroy(){let e=performance.now();try{this.parent?.()}finally{let r=performance.now()-e;_l(`ok/cold/ext-${n}-on-destroy`,{ext:t,hook:`onDestroy`,durationMs:Math.round(r*1e3)/1e3},{startTime:e,duration:r})}}})})}function tE(){if(!LT){LT=!0,RT(Zn.prototype,`mount`,`ok/cold/editor-mount`,(e,t,n,r)=>{let i=e;return XT()||(WT=performance.now()),{elementDefault:i.options?.element?.nodeName??null,docSize:zT(i.editorState),durationMs:r}}),RT(Zn.prototype,`createView`,`ok/cold/editor-create-view`,e=>{let t=e;return!XT()&&!KT.has(e)&&t.view&&(QT(t.view),$T(t.view),KT.add(e)),{docSize:zT(t.editorState)}}),RT(Zn.prototype,`createNodeViews`,`ok/cold/create-node-views`,(e,t,n,r)=>{UT+=1;let i=e;return!XT()&&i.view&&$T(i.view),{docSize:zT(i.view),seq:UT,durationMs:r}}),RT(jr.prototype,`updateState`,`ok/cold/pm-update-state`,(e,t,n,r)=>(VT+=1,{seq:VT,docSize:zT(e.state),durationMs:r})),RT(jr.prototype,`setProps`,`ok/cold/pm-set-props`,(e,t,n,r)=>(HT+=1,{seq:HT,docSize:zT(e.state),durationMs:r})),RT(L.prototype,`_forceRerender`,`ok/cold/force-rerender`,(e,t,n,r)=>{BT+=1;let i=e,a=(()=>{try{return i.type?.toArray?i.type.toArray().length:null}catch{return null}})();return{seq:BT,topLevelYElements:a,durationMs:r}}),RT(ee.prototype,`init`,`ok/cold/ec-init`,e=>({editorPresent:!!e.props?.editor}));try{typeof PerformanceObserver<`u`&&new PerformanceObserver(e=>{for(let t of e.getEntries()){let e=t.name;if((e===`first-paint`||e===`first-contentful-paint`)&&(_l(e===`first-paint`?`ok/cold/paint-fp`:`ok/cold/paint-fcp`,{entryType:t.entryType,startTime:Math.round(t.startTime*1e3)/1e3},{startTime:t.startTime,duration:0}),!XT()&&e===`first-paint`&&WT!==null)){let e=WT,n=Math.max(0,t.startTime-e);_l(`ok/cold/append-to-paint`,{paintEntryType:t.entryType,durationMs:Math.round(n*1e3)/1e3,paintAt:Math.round(t.startTime*1e3)/1e3},{startTime:e,duration:n}),WT=null}}}).observe({type:`paint`,buffered:!0})}catch{}globalThis.__okColdMountInstrumented=!0}}function nE(){let[e]=(0,Q.useState)(Vn);return e}function rE({principal:e,identity:t}){return e&&e.source===`git-config`?{type:`human`,name:vi(e.display_name),color:Cr(e.id,Qn),coeditor:t.coeditor,tabId:t.tabId,principalId:e.id}:e&&e.source===`synthesized`?{type:`human`,name:t.name,color:Cr(e.id,Qn),coeditor:t.coeditor,tabId:t.tabId}:{type:`human`,name:t.name,color:t.color,coeditor:t.coeditor,tabId:t.tabId}}function iE(e,t){return e>t}function aE(e){if(typeof e!=`object`||!e)return!1;let t=e;return t.isChangeOrigin===!0?!0:`snapshot`in t&&`prevSnapshot`in t&&t.snapshot===null&&t.prevSnapshot===null}var oE=3,sE=6e4;function cE(e,t){let n=0;for(let r of e)t-r<sE&&(n+=1);return n<oE}var lE=new Map;function uE(e,t){for(let n of e.changed.keys()){let e=n;for(;e!=null;){if(e===t)return!0;let n=e._item;e=n==null?null:n.parent}}return!1}function dE(e){let t=be.getState(e);return t?.snapshot!=null||t?.prevSnapshot!=null}function fE(e){let{fragment:t,docName:n,onWedged:r}=e,i=0,a=0,o=!1,s=!1,c=!1,l=null,u=new WeakSet,d=e=>{let t=be.getState(e)?.binding;if(!t)return;if(typeof t._prosemirrorChanged!=`function`){_l.count(`ok/editor/binding-guard-disarmed`,{docName:n,reason:`no-prosemirror-changed`}),console.warn(`[binding-staleness-guard] ySync binding on "${n}" exposes no _prosemirrorChanged — write-back gate disarmed (vendored y-tiptap contract change?)`);return}if(u.has(t))return;u.add(t);let r=t._prosemirrorChanged.bind(t);t._prosemirrorChanged=e=>{iE(i,a)||r(e)}},f=()=>{if(c=!1,!s||o||!iE(i,a)||l!==null&&dE(l.state))return;o=!0;let e=Date.now();for(let[t,n]of lE)n.every(t=>e-t>=sE)&&lE.delete(t);let t=(lE.get(n)??[]).filter(t=>e-t<sE);if(!cE(t,e)){lE.set(n,t),_l.count(`ok/editor/binding-wedge-rate-capped`,{docName:n}),console.warn(`[binding-staleness-guard] wedge on "${n}" rate-capped (externalSeq=${i}, appliedSeq=${a}) — publication gate stays closed, no further recycle`);return}t.push(e),lE.set(n,t),console.warn(`[binding-staleness-guard] wedged binding on "${n}" — Y→PM apply missing (externalSeq=${i}, appliedSeq=${a})`);try{r({externalSeq:i,appliedSeq:a})}catch(e){o=!1,_l.count(`ok/editor/binding-wedge-recovery-error`,{docName:n}),console.error(`[binding-staleness-guard] wedge recovery threw for "${n}":`,e)}},p=e=>{e.origin!==be&&uE(e,t)&&(i+=1,c||(c=!0,queueMicrotask(f)))};return new _i({state:{init:()=>null,apply:e=>(aE(e.getMeta(be))&&(a=i,o&&_l.count(`ok/editor/binding-wedge-recovered`,{docName:n}),o=!1),null)},filterTransaction:(e,t)=>!iE(i,a)||dE(t)?!0:e.getMeta(be)!==void 0,view:e=>{let r=t.doc;return r==null?(_l.count(`ok/editor/binding-guard-disarmed`,{docName:n,reason:`no-ydoc`}),console.error(`[binding-staleness-guard] fragment has no Y.Doc for "${n}" — staleness guard disarmed`),{}):(s=!0,l=e,d(e.state),r.off(`beforeObserverCalls`,p),r.on(`beforeObserverCalls`,p),{destroy:()=>{s=!1,l=null,r.off(`beforeObserverCalls`,p)}})}})}function pE(e,t){let n=Math.min(e.top,t.top),r=Math.max(e.bottom,t.bottom),i=Math.min(e.left,t.left),a=Math.max(e.right,t.right)-i,o=r-n;return new DOMRect(i,n,a,o)}var mE=class{constructor({editor:e,element:t,view:n,pluginKey:r=`bubbleMenu`,updateDelay:i=250,resizeDelay:a=60,shouldShow:o,appendTo:s,getReferencedVirtualElement:c,options:l}){this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.floatingUIOptions={strategy:`absolute`,placement:`top`,offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1,onShow:void 0,onHide:void 0,onUpdate:void 0,onDestroy:void 0},this.shouldShow=({view:e,state:t,from:n,to:r})=>{let{doc:i,selection:a}=t,{empty:o}=a,s=!i.textBetween(n,r).length&&Dr(t.selection),c=this.element.contains(document.activeElement);return!(!(e.hasFocus()||c)||o||s||!this.editor.isEditable)},this.mousedownHandler=()=>{this.preventHide=!0},this.dragstartHandler=()=>{this.hide()},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:e})=>{if(this.editor.isDestroyed){this.destroy();return}if(this.preventHide){this.preventHide=!1;return}e?.relatedTarget&&this.element.parentNode?.contains(e.relatedTarget)||e?.relatedTarget!==this.editor.view.dom&&this.hide()},this.handleDebouncedUpdate=(e,t)=>{let n=!t?.selection.eq(e.state.selection),r=!t?.doc.eq(e.state.doc);!n&&!r||(this.updateDebounceTimer&&clearTimeout(this.updateDebounceTimer),this.updateDebounceTimer=window.setTimeout(()=>{this.updateHandler(e,n,r,t)},this.updateDelay))},this.updateHandler=(e,t,n,r)=>{let{composing:i}=e;if(!(i||!t&&!n)){if(!this.getShouldShow(r)){this.hide();return}this.show(),this.updatePosition()}},this.transactionHandler=({transaction:e})=>{let t=e.getMeta(this.pluginKey);t===`updatePosition`?this.updatePosition():t&&typeof t==`object`&&t.type===`updateOptions`?this.updateOptions(t.options):t===`hide`?this.hide():t===`show`&&(this.updatePosition(),this.show())},this.editor=e,this.element=t,this.view=n,this.pluginKey=r,this.updateDelay=i,this.resizeDelay=a,this.appendTo=s,this.scrollTarget=l?.scrollTarget??window,this.getReferencedVirtualElement=c,this.floatingUIOptions={...this.floatingUIOptions,...l},this.element.tabIndex=0,o&&(this.shouldShow=o),this.element.addEventListener(`mousedown`,this.mousedownHandler,{capture:!0}),this.view.dom.addEventListener(`dragstart`,this.dragstartHandler),this.editor.on(`focus`,this.focusHandler),this.editor.on(`blur`,this.blurHandler),this.editor.on(`transaction`,this.transactionHandler),window.addEventListener(`resize`,this.resizeHandler),this.scrollTarget.addEventListener(`scroll`,this.resizeHandler),this.update(n,n.state),this.getShouldShow()&&(this.show(),this.updatePosition())}get middlewares(){let e=[];return this.floatingUIOptions.flip&&e.push(ec(typeof this.floatingUIOptions.flip==`boolean`?void 0:this.floatingUIOptions.flip)),this.floatingUIOptions.shift&&e.push(Xs(typeof this.floatingUIOptions.shift==`boolean`?void 0:this.floatingUIOptions.shift)),this.floatingUIOptions.offset&&e.push(Qs(typeof this.floatingUIOptions.offset==`boolean`?void 0:this.floatingUIOptions.offset)),this.floatingUIOptions.arrow&&e.push(Zs(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&e.push(Js(typeof this.floatingUIOptions.size==`boolean`?void 0:this.floatingUIOptions.size)),this.floatingUIOptions.autoPlacement&&e.push($s(typeof this.floatingUIOptions.autoPlacement==`boolean`?void 0:this.floatingUIOptions.autoPlacement)),this.floatingUIOptions.hide&&e.push(Ks(typeof this.floatingUIOptions.hide==`boolean`?void 0:this.floatingUIOptions.hide)),this.floatingUIOptions.inline&&e.push(qs(typeof this.floatingUIOptions.inline==`boolean`?void 0:this.floatingUIOptions.inline)),e}get virtualElement(){let{selection:e}=this.editor.state,t=this.getReferencedVirtualElement?.call(this);if(t)return t;if(!this.view?.dom?.parentNode)return;let n=ai(this.view,e.from,e.to),r={getBoundingClientRect:()=>n,getClientRects:()=>[n]};if(e instanceof li){let t=this.view.nodeDOM(e.from),n=t.dataset.nodeViewWrapper?t:t.querySelector(`[data-node-view-wrapper]`);n&&(t=n),t&&(r={getBoundingClientRect:()=>t.getBoundingClientRect(),getClientRects:()=>[t.getBoundingClientRect()]})}if(e instanceof ir){let{$anchorCell:t,$headCell:n}=e,i=t?t.pos:n.pos,a=n?n.pos:t.pos,o=this.view.nodeDOM(i),s=this.view.nodeDOM(a);if(!o||!s)return;let c=o===s?o.getBoundingClientRect():pE(o.getBoundingClientRect(),s.getBoundingClientRect());r={getBoundingClientRect:()=>c,getClientRects:()=>[c]}}return r}updatePosition(){if(!this.isVisible)return;let e=this.virtualElement;e&&Ys(e,this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:e,y:t,strategy:n,middlewareData:r})=>{if(!(!this.isVisible||this.editor.isDestroyed||!this.element.isConnected)){if(r.hide?.referenceHidden||r.hide?.escaped){this.element.style.visibility=`hidden`;return}this.element.style.visibility=`visible`,this.element.style.width=`max-content`,this.element.style.position=n,this.element.style.left=`${e}px`,this.element.style.top=`${t}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()}})}update(e,t){let{state:n}=e,r=n.selection.from!==n.selection.to;if(this.updateDelay>0&&r){this.handleDebouncedUpdate(e,t);return}let i=!t?.selection.eq(e.state.selection),a=!t?.doc.eq(e.state.doc);this.updateHandler(e,i,a,t)}getShouldShow(e){let{state:t}=this.view,{selection:n}=t,{ranges:r}=n,i=Math.min(...r.map(e=>e.$from.pos)),a=Math.max(...r.map(e=>e.$to.pos));return this.shouldShow?.call(this,{editor:this.editor,element:this.element,view:this.view,state:t,oldState:e,from:i,to:a})||!1}show(){var e;this.isVisible||(this.element.style.visibility=`visible`,this.element.style.opacity=`1`,(e=(typeof this.appendTo==`function`?this.appendTo():this.appendTo)??this.view.dom.parentElement)==null||e.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0)}hide(){this.isVisible&&=(this.element.style.visibility=`hidden`,this.element.style.opacity=`0`,this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),!1)}updateOptions(e){if(e.updateDelay!==void 0&&(this.updateDelay=e.updateDelay),e.resizeDelay!==void 0&&(this.resizeDelay=e.resizeDelay),e.appendTo!==void 0&&(this.appendTo=e.appendTo),e.getReferencedVirtualElement!==void 0&&(this.getReferencedVirtualElement=e.getReferencedVirtualElement),e.shouldShow!==void 0&&e.shouldShow&&(this.shouldShow=e.shouldShow),e.options!==void 0){let t=e.options.scrollTarget??window;t!==this.scrollTarget&&(this.scrollTarget.removeEventListener(`scroll`,this.resizeHandler),this.scrollTarget=t,this.scrollTarget.addEventListener(`scroll`,this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...e.options}}}destroy(){this.hide(),this.element.removeEventListener(`mousedown`,this.mousedownHandler,{capture:!0}),this.view.dom.removeEventListener(`dragstart`,this.dragstartHandler),window.removeEventListener(`resize`,this.resizeHandler),this.scrollTarget.removeEventListener(`scroll`,this.resizeHandler),this.editor.off(`focus`,this.focusHandler),this.editor.off(`blur`,this.blurHandler),this.editor.off(`transaction`,this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}},hE=e=>new _i({key:typeof e.pluginKey==`string`?new Tr(e.pluginKey):e.pluginKey,view:t=>new mE({view:t,...e})});_r.create({name:`bubbleMenu`,addOptions(){return{element:null,pluginKey:`bubbleMenu`,updateDelay:void 0,appendTo:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[hE({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,updateDelay:this.options.updateDelay,options:this.options.options,appendTo:this.options.appendTo,getReferencedVirtualElement:this.options.getReferencedVirtualElement,shouldShow:this.options.shouldShow})]:[]}});var gE=class{constructor({editor:e,element:t,view:n,pluginKey:r=`floatingMenu`,updateDelay:i=250,resizeDelay:a=60,options:o,appendTo:s,shouldShow:c}){this.preventHide=!1,this.isVisible=!1,this.scrollTarget=window,this.shouldShow=({view:e,state:t})=>{let{selection:n}=t,{$anchor:r,empty:i}=n,a=r.depth===1,o=r.parent.isTextblock&&!r.parent.type.spec.code&&!r.parent.textContent&&r.parent.childCount===0&&!this.getTextContent(r.parent);return!(!e.hasFocus()||!i||!a||!o||!this.editor.isEditable)},this.floatingUIOptions={strategy:`absolute`,placement:`right`,offset:8,flip:{},shift:{},arrow:!1,size:!1,autoPlacement:!1,hide:!1,inline:!1},this.updateHandler=(e,t,n,r)=>{let{composing:i}=e;if(!(i||!t&&!n)){if(!this.getShouldShow(r)){this.hide();return}this.updatePosition(),this.show()}},this.mousedownHandler=()=>{this.preventHide=!0},this.focusHandler=()=>{setTimeout(()=>this.update(this.editor.view))},this.blurHandler=({event:e})=>{if(this.preventHide){this.preventHide=!1;return}e?.relatedTarget&&this.element.parentNode?.contains(e.relatedTarget)||e?.relatedTarget!==this.editor.view.dom&&this.hide()},this.transactionHandler=({transaction:e})=>{let t=e.getMeta(this.pluginKey);t===`updatePosition`?this.updatePosition():t&&typeof t==`object`&&t.type===`updateOptions`?this.updateOptions(t.options):t===`hide`?this.hide():t===`show`&&(this.updatePosition(),this.show())},this.resizeHandler=()=>{this.resizeDebounceTimer&&clearTimeout(this.resizeDebounceTimer),this.resizeDebounceTimer=window.setTimeout(()=>{this.updatePosition()},this.resizeDelay)},this.editor=e,this.element=t,this.view=n,this.pluginKey=r,this.updateDelay=i,this.resizeDelay=a,this.appendTo=s,this.scrollTarget=o?.scrollTarget??window,this.floatingUIOptions={...this.floatingUIOptions,...o},this.element.tabIndex=0,c&&(this.shouldShow=c),this.element.addEventListener(`mousedown`,this.mousedownHandler,{capture:!0}),this.editor.on(`focus`,this.focusHandler),this.editor.on(`blur`,this.blurHandler),this.editor.on(`transaction`,this.transactionHandler),window.addEventListener(`resize`,this.resizeHandler),this.scrollTarget.addEventListener(`scroll`,this.resizeHandler),this.update(n,n.state),this.getShouldShow()&&(this.show(),this.updatePosition())}getTextContent(e){return ei(e,{textSerializers:Pr(this.editor.schema)})}get middlewares(){let e=[];return this.floatingUIOptions.flip&&e.push(ec(typeof this.floatingUIOptions.flip==`boolean`?void 0:this.floatingUIOptions.flip)),this.floatingUIOptions.shift&&e.push(Xs(typeof this.floatingUIOptions.shift==`boolean`?void 0:this.floatingUIOptions.shift)),this.floatingUIOptions.offset&&e.push(Qs(typeof this.floatingUIOptions.offset==`boolean`?void 0:this.floatingUIOptions.offset)),this.floatingUIOptions.arrow&&e.push(Zs(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&e.push(Js(typeof this.floatingUIOptions.size==`boolean`?void 0:this.floatingUIOptions.size)),this.floatingUIOptions.autoPlacement&&e.push($s(typeof this.floatingUIOptions.autoPlacement==`boolean`?void 0:this.floatingUIOptions.autoPlacement)),this.floatingUIOptions.hide&&e.push(Ks(typeof this.floatingUIOptions.hide==`boolean`?void 0:this.floatingUIOptions.hide)),this.floatingUIOptions.inline&&e.push(qs(typeof this.floatingUIOptions.inline==`boolean`?void 0:this.floatingUIOptions.inline)),e}getShouldShow(e){let{state:t}=this.view,{selection:n}=t,{ranges:r}=n,i=Math.min(...r.map(e=>e.$from.pos)),a=Math.max(...r.map(e=>e.$to.pos));return this.shouldShow?.call(this,{editor:this.editor,view:this.view,state:t,oldState:e,from:i,to:a})}updateOptions(e){if(e.updateDelay!==void 0&&(this.updateDelay=e.updateDelay),e.resizeDelay!==void 0&&(this.resizeDelay=e.resizeDelay),e.appendTo!==void 0&&(this.appendTo=e.appendTo),e.shouldShow!==void 0&&e.shouldShow&&(this.shouldShow=e.shouldShow),e.options!==void 0){let t=e.options.scrollTarget??window;t!==this.scrollTarget&&(this.scrollTarget.removeEventListener(`scroll`,this.resizeHandler),this.scrollTarget=t,this.scrollTarget.addEventListener(`scroll`,this.resizeHandler)),this.floatingUIOptions={...this.floatingUIOptions,...e.options}}}updatePosition(){let{selection:e}=this.editor.state,t=ai(this.view,e.from,e.to);Ys({getBoundingClientRect:()=>t,getClientRects:()=>[t]},this.element,{placement:this.floatingUIOptions.placement,strategy:this.floatingUIOptions.strategy,middleware:this.middlewares}).then(({x:e,y:t,strategy:n,middlewareData:r})=>{if(r.hide?.referenceHidden||r.hide?.escaped){this.element.style.visibility=`hidden`;return}this.element.style.visibility=`visible`,this.element.style.width=`max-content`,this.element.style.position=n,this.element.style.left=`${e}px`,this.element.style.top=`${t}px`,this.isVisible&&this.floatingUIOptions.onUpdate&&this.floatingUIOptions.onUpdate()})}update(e,t){let n=!t?.selection.eq(e.state.selection),r=!t?.doc.eq(e.state.doc);this.updateHandler(e,n,r,t)}show(){var e;this.isVisible||(this.element.style.visibility=`visible`,this.element.style.opacity=`1`,(e=(typeof this.appendTo==`function`?this.appendTo():this.appendTo)??this.view.dom.parentElement)==null||e.appendChild(this.element),this.floatingUIOptions.onShow&&this.floatingUIOptions.onShow(),this.isVisible=!0)}hide(){this.isVisible&&=(this.element.style.visibility=`hidden`,this.element.style.opacity=`0`,this.element.remove(),this.floatingUIOptions.onHide&&this.floatingUIOptions.onHide(),!1)}destroy(){this.hide(),this.element.removeEventListener(`mousedown`,this.mousedownHandler,{capture:!0}),window.removeEventListener(`resize`,this.resizeHandler),this.scrollTarget.removeEventListener(`scroll`,this.resizeHandler),this.editor.off(`focus`,this.focusHandler),this.editor.off(`blur`,this.blurHandler),this.editor.off(`transaction`,this.transactionHandler),this.floatingUIOptions.onDestroy&&this.floatingUIOptions.onDestroy()}},_E=e=>new _i({key:typeof e.pluginKey==`string`?new Tr(e.pluginKey):e.pluginKey,view:t=>new gE({view:t,...e})});_r.create({name:`floatingMenu`,addOptions(){return{element:null,options:{},pluginKey:`floatingMenu`,updateDelay:void 0,resizeDelay:void 0,appendTo:void 0,shouldShow:null}},addCommands(){return{updateFloatingMenuPosition:()=>({tr:e,dispatch:t})=>(t&&e.setMeta(this.options.pluginKey,`updatePosition`),!0)}},addProseMirrorPlugins(){return this.options.element?[_E({pluginKey:this.options.pluginKey,editor:this.editor,element:this.options.element,updateDelay:this.options.updateDelay,resizeDelay:this.options.resizeDelay,options:this.options.options,appendTo:this.options.appendTo,shouldShow:this.options.shouldShow})]:[]}});function vE(e,t){return e??new Tr(t)}var yE=typeof window<`u`?Q.useLayoutEffect:Q.useEffect,bE=new Set([`left`,`opacity`,`position`,`top`,`visibility`,`width`]),xE=new Set(`animationIterationCount.aspectRatio.borderImageOutset.borderImageSlice.borderImageWidth.columnCount.columns.fillOpacity.flex.flexGrow.flexShrink.fontWeight.gridArea.gridColumn.gridColumnEnd.gridColumnStart.gridRow.gridRowEnd.gridRowStart.lineClamp.lineHeight.opacity.order.orphans.scale.stopOpacity.strokeDasharray.strokeDashoffset.strokeMiterlimit.strokeOpacity.strokeWidth.tabSize.widows.zIndex.zoom`.split(`.`)),SE=new Set([`children`,`className`,`style`]),CE=new Set([`tabIndex`]),wE=new Set([`accessKey`,`autoCapitalize`,`contentEditable`,`contextMenu`,`dir`,`draggable`,`enterKeyHint`,`hidden`,`id`,`lang`,`nonce`,`role`,`slot`,`spellCheck`,`tabIndex`,`title`,`translate`]),TE={Blur:`focusout`,DoubleClick:`dblclick`,Focus:`focusin`,MouseEnter:`mouseenter`,MouseLeave:`mouseleave`};function EE(e,t){return/^on[A-Z]/.test(e)&&typeof t==`function`}function DE(e){return e.startsWith(`aria-`)||e.startsWith(`data-`),e}function OE(e){return e.startsWith(`aria-`)||e.startsWith(`data-`)||wE.has(e)}function kE(e){return e.startsWith(`--`)?e:e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}function AE(e){let t=e.endsWith(`Capture`),n=(t?e.slice(0,-7):e).slice(2);return{eventName:TE[n]??n.toLowerCase(),options:t?{capture:!0}:void 0}}function jE(e,t){let n=t.defaultPrevented,r=!1,i=Object.create(t);return Object.defineProperties(i,{nativeEvent:{value:t},currentTarget:{value:e},target:{value:t.target},persist:{value:()=>void 0},isDefaultPrevented:{value:()=>n},isPropagationStopped:{value:()=>r},preventDefault:{value:()=>{n=!0,t.preventDefault()}},stopPropagation:{value:()=>{r=!0,t.stopPropagation()}}}),i}function ME(e){return CE.has(e)}function NE(e,t,n){if(t===`tabIndex`){e.tabIndex=Number(n);return}e[t]=n}function PE(e,t){if(t===`tabIndex`){e.removeAttribute(`tabindex`);return}let n=e[t];if(typeof n==`boolean`){e[t]=!1;return}if(typeof n==`number`){e[t]=0;return}e[t]=``}function FE(e,t){return typeof t!=`number`||t===0||e.startsWith(`--`)||xE.has(e)?String(t):`${t}px`}function IE(e,t){bE.has(t)||e.style.removeProperty(kE(t))}function LE(e,t,n){bE.has(t)||e.style.setProperty(kE(t),FE(t,n))}function RE(e,t,n){new Set([...Object.keys(t),...Object.keys(n)]).forEach(r=>{if(SE.has(r)||!OE(r)||EE(r,t[r])||EE(r,n[r]))return;let i=t[r],a=n[r];if(i===a)return;let o=DE(r);if(a==null||a===!1){ME(r)&&PE(e,r),e.removeAttribute(o);return}if(a===!0){ME(r)&&NE(e,r,!0),e.setAttribute(o,``);return}if(ME(r)){NE(e,r,a);return}e.setAttribute(o,String(a))})}function zE(e,t,n){if(t!==n){if(n){e.className=n;return}e.removeAttribute(`class`)}}function BE(e,t,n){let r=t??{},i=n??{};new Set([...Object.keys(r),...Object.keys(i)]).forEach(t=>{let n=r[t],a=i[t];if(n!==a){if(a==null){IE(e,t);return}LE(e,t,a)}})}function VE(e,t,n){t.forEach(({eventName:t,listener:n,options:r})=>{e.removeEventListener(t,n,r)});let r=[];return Object.entries(n).forEach(([t,n])=>{if(!EE(t,n))return;let{eventName:i,options:a}=AE(t),o=t=>{n(jE(e,t))};e.addEventListener(i,o,a),r.push({eventName:i,listener:o,options:a})}),r}function HE(e,t){let n=(0,Q.useRef)({}),r=(0,Q.useRef)([]);yE(()=>{let i=n.current;return zE(e,i.className,t.className),BE(e,i.style,t.style),RE(e,i,t),r.current=VE(e,r.current,t),n.current=t,()=>{r.current.forEach(({eventName:t,listener:n,options:r})=>{e.removeEventListener(t,n,r)}),r.current=[]}},[e,t])}var UE=Q.forwardRef(({pluginKey:e,editor:t,updateDelay:n,resizeDelay:r,appendTo:i,shouldShow:a=null,getReferencedVirtualElement:o,options:s,children:c,...l},u)=>{let d=(0,Q.useRef)(document.createElement(`div`)),f=(0,Q.useRef)(vE(e,`bubbleMenu`)).current;HE(d.current,l),typeof u==`function`?u(d.current):u&&(u.current=d.current);let{editor:p}=j(),m=t||p,h={updateDelay:n,resizeDelay:r,appendTo:i,pluginKey:f,shouldShow:a,getReferencedVirtualElement:o,options:s},g=(0,Q.useRef)(h);g.current=h;let[_,v]=(0,Q.useState)(!1),y=(0,Q.useRef)(!0);return(0,Q.useEffect)(()=>{if(m?.isDestroyed)return;if(!m){console.warn(`BubbleMenu component is not rendered inside of an editor component or does not have editor prop.`);return}let e=d.current;e.style.visibility=`hidden`,e.style.position=`absolute`;let t=hE({...g.current,editor:m,element:e});m.registerPlugin(t);let n=g.current.pluginKey;return y.current=!0,v(!0),()=>{v(!1),m.unregisterPlugin(n),window.requestAnimationFrame(()=>{e.parentNode&&e.parentNode.removeChild(e)})}},[m]),(0,Q.useEffect)(()=>{if(!(!_||!m||m.isDestroyed)){if(y.current){y.current=!1;return}m.view.dispatch(m.state.tr.setMeta(f,{type:`updateOptions`,options:g.current}))}},[_,m,n,r,a,s,i,o,f]),(0,Sd.createPortal)(c,d.current)});Q.forwardRef(({pluginKey:e,editor:t,updateDelay:n,resizeDelay:r,appendTo:i,shouldShow:a=null,options:o,children:s,...c},l)=>{let u=(0,Q.useRef)(document.createElement(`div`)),d=(0,Q.useRef)(vE(e,`floatingMenu`)).current;HE(u.current,c),typeof l==`function`?l(u.current):l&&(l.current=u.current);let{editor:f}=j(),p=t||f,m={updateDelay:n,resizeDelay:r,appendTo:i,pluginKey:d,shouldShow:a,options:o},h=(0,Q.useRef)(m);h.current=m;let[g,_]=(0,Q.useState)(!1),v=(0,Q.useRef)(!0);return(0,Q.useEffect)(()=>{if(p?.isDestroyed)return;if(!p){console.warn(`FloatingMenu component is not rendered inside of an editor component or does not have editor prop.`);return}let e=u.current;e.style.visibility=`hidden`,e.style.position=`absolute`;let t=_E({...h.current,editor:p,element:e});p.registerPlugin(t);let n=h.current.pluginKey;return v.current=!0,_(!0),()=>{_(!1),p.unregisterPlugin(n),window.requestAnimationFrame(()=>{e.parentNode&&e.parentNode.removeChild(e)})}},[p]),(0,Q.useEffect)(()=>{if(!(!g||!p||p.isDestroyed)){if(v.current){v.current=!1;return}p.view.dispatch(p.state.tr.setMeta(d,{type:`updateOptions`,options:h.current}))}},[g,p,n,r,a,o,i,d]),(0,Sd.createPortal)(s,u.current)});var WE=[{name:`paragraph`,label:`Text`,icon:hf,isActive:e=>e.isActive(`paragraph`)&&!e.isActive(`list`),command:e=>e.chain().focus().setParagraph().run()},{name:`heading1`,label:`Heading 1`,icon:Be,isActive:e=>e.isActive(`heading`,{level:1}),command:e=>e.chain().focus().toggleHeading({level:1}).run()},{name:`heading2`,label:`Heading 2`,icon:s,isActive:e=>e.isActive(`heading`,{level:2}),command:e=>e.chain().focus().toggleHeading({level:2}).run()},{name:`heading3`,label:`Heading 3`,icon:te,isActive:e=>e.isActive(`heading`,{level:3}),command:e=>e.chain().focus().toggleHeading({level:3}).run()},{name:`bulletList`,label:`Bullet List`,icon:I,isActive:e=>e.isActive(`list`,{ordered:!1})&&!e.isActive(`listItem`,{checked:!0})&&!e.isActive(`listItem`,{checked:!1}),command:e=>e.chain().focus().toggleBulletList().run()},{name:`orderedList`,label:`Ordered List`,icon:N,isActive:e=>e.isActive(`list`,{ordered:!0}),command:e=>e.chain().focus().toggleOrderedList().run()},{name:`taskList`,label:`Task List`,icon:kt,isActive:e=>e.isActive(`listItem`,{checked:!0})||e.isActive(`listItem`,{checked:!1}),command:e=>e.chain().focus().toggleTaskList().run()},{name:`blockquote`,label:`Quote`,icon:ue,isActive:e=>e.isActive(`blockquote`),command:e=>e.chain().focus().toggleBlockquote().run()},{name:`codeBlock`,label:`Code Block`,icon:Ef,isActive:e=>e.isActive(`codeBlock`),command:e=>e.chain().focus().toggleCodeBlock({language:`js`}).run()}];function GE(e){let t=(0,$.c)(18),{editor:n}=e,r;t[0]===n?r=t[1]:(r={editor:n,selector:KE},t[0]=n,t[1]=r);let{current:i,activeStates:a}=ie(r),o=i.icon,s;t[2]===o?s=t[3]:(s=(0,Z.jsx)(o,{className:`size-3.5`}),t[2]=o,t[3]=s);let c;t[4]===i.label?c=t[5]:(c=(0,Z.jsx)(`span`,{children:i.label}),t[4]=i.label,t[5]=c);let l;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Z.jsx)(Yi,{className:`size-3 opacity-50`}),t[6]=l):l=t[6];let u;t[7]!==s||t[8]!==c?(u=(0,Z.jsx)(bc,{asChild:!0,children:(0,Z.jsxs)(X,{variant:`ghost`,size:`sm`,className:`gap-1 px-2 text-sm font-medium text-accent-foreground/80`,children:[s,c,l]})}),t[7]=s,t[8]=c,t[9]=u):u=t[9];let d;t[10]!==a||t[11]!==n?(d=WE.map(e=>{let t=e.icon,r=a[e.name];return(0,Z.jsxs)(Sc,{className:r?`bg-accent text-accent-foreground`:``,onSelect:()=>{e.command(n)},children:[(0,Z.jsx)(t,{className:`size-4`}),(0,Z.jsx)(`span`,{children:e.label})]},e.name)}),t[10]=a,t[11]=n,t[12]=d):d=t[12];let f;t[13]===d?f=t[14]:(f=(0,Z.jsx)(wc,{align:`start`,sideOffset:8,className:`w-44 max-h-(--radix-dropdown-menu-content-available-height) overflow-y-auto subtle-scrollbar`,children:d}),t[13]=d,t[14]=f);let p;return t[15]!==u||t[16]!==f?(p=(0,Z.jsxs)(Ac,{children:[u,f]}),t[15]=u,t[16]=f,t[17]=p):p=t[17],p}function KE(e){let t=Object.fromEntries(WE.map(t=>[t.name,t.isActive(e.editor)]));return{current:WE.find(e=>t[e.name])??WE[0],activeStates:t}}function qE(e){let t=e.state.selection.node;if(!t||t.type.name!==`jsxComponent`)return null;let n=t.attrs.componentName;if(n!==`File`&&n!==`WikiEmbedFile`)return null;let r=(t.attrs.props??{}).src;return typeof r!=`string`||r.length===0?null:r}function JE(e){let t=e.state.selection.node;if(!t)return``;let n=t.attrs.props??{},r=typeof n.alias==`string`?n.alias:``;if(r.length>0)return r;let i=typeof n.name==`string`?n.name:``;return i.length>0?i:Wt(typeof n.src==`string`?n.src:``)}function YE(e,t){let n=document.createElement(`a`);n.href=e,n.download=t,n.rel=`noopener noreferrer`,n.style.display=`none`,document.body.appendChild(n),n.click(),n.remove()}function XE(e){let t=(0,$.c)(13),{editor:n}=e,{_:r}=an(),i;if(t[0]===n?i=t[1]:(i={editor:n,selector:ZE},t[0]=n,t[1]=i),ie(i)===null)return null;let a;t[2]===r?a=t[3]:(a=r({id:`WcWS__`}),t[2]=r,t[3]=a);let o;t[4]===n?o=t[5]:(o=e=>{e.preventDefault();let t=qE(n);t&&YE(t,JE(n))},t[4]=n,t[5]=o);let s;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Z.jsx)(xo,{className:`size-3.5`}),t[6]=s):s=t[6];let c;t[7]!==a||t[8]!==o?(c=(0,Z.jsx)(As,{asChild:!0,children:(0,Z.jsx)(X,{variant:`ghost`,size:`icon-xs`,"aria-label":a,className:`text-accent-foreground`,onMouseDown:o,children:s})}),t[7]=a,t[8]=o,t[9]=c):c=t[9];let l;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Z.jsx)(js,{side:`bottom`,sideOffset:8,children:(0,Z.jsx)(J,{id:`WcWS__`})}),t[10]=l):l=t[10];let u;return t[11]===c?u=t[12]:(u=(0,Z.jsx)(`div`,{className:`flex items-center gap-0.5`,children:(0,Z.jsxs)(Ns,{children:[c,l]})}),t[11]=c,t[12]=u),u}function ZE(e){return qE(e.editor)}function QE(e){return qE(e)!==null}var $E=`img, .ok-embed, .ok-video`,eD=220,tD=`cubic-bezier(0.23, 1, 0.32, 1)`,nD=`ok-image-align-flip`,rD=.5;function iD(){return typeof window>`u`||typeof window.matchMedia!=`function`?!1:window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}function aD(){return typeof requestAnimationFrame==`function`}function oD(e){return e?e.querySelector($E):null}function sD(e,t){if(iD()||!aD()){t();return}let n=oD(e);if(!n){t();return}let r=n.getBoundingClientRect().left;t(),requestAnimationFrame(()=>{let t=oD(e);if(!t)return;for(let e of t.getAnimations())e.id===nD&&e.cancel();let n=r-t.getBoundingClientRect().left;if(Math.abs(n)<rD)return;let i=t.animate([{transform:`translateX(${n}px)`},{transform:`translateX(0)`}],{duration:eD,easing:tD,fill:`none`});i.id=nD})}var cD=[{value:`left`,label:`Align left`,icon:Lf},{value:`center`,label:`Align center`,icon:Ff},{value:`right`,label:`Align right`,icon:If}];function lD(e){let t=e.state.selection.node;if(!t||t.type.name!==`jsxComponent`)return null;let n=t.attrs.componentName;if(!Gt.has(String(n)))return null;let r=(t.attrs.props??{}).align;return r===`left`||r===`right`||r===`center`?r:`center`}function uD(e){let t=(0,$.c)(7),{editor:n}=e,r;t[0]===n?r=t[1]:(r={editor:n,selector:dD},t[0]=n,t[1]=r);let i=ie(r);if(i===null)return null;let a;t[2]!==i||t[3]!==n?(a=cD.map(e=>{let{value:t,label:r,icon:a}=e,o=i===t;return(0,Z.jsxs)(Ns,{children:[(0,Z.jsx)(As,{asChild:!0,children:(0,Z.jsx)(X,{variant:`ghost`,size:`icon-xs`,"aria-label":r,"aria-pressed":o,className:o?`bg-accent text-primary`:`text-accent-foreground`,onMouseDown:e=>{e.preventDefault();let r=n.state.selection,i=r.node;if(!i||i.type.name!==`jsxComponent`)return;let a=String(i.attrs.componentName??``);if(!Gt.has(a)||i.attrs.kind!==`element`)return;let o=a===`CommonMarkImage`,s=r.from,c={...i.attrs.props??{},align:t},l=o?{...i.attrs,componentName:`img`,props:c,sourceDirty:!0}:{...i.attrs,props:c,sourceDirty:!0},u=n.state.tr.setNodeMarkup(s,null,l);u.setSelection(li.create(u.doc,s)),sD(n.view.nodeDOM(s),()=>{n.view.dispatch(u)})},children:(0,Z.jsx)(a,{className:`size-3.5`})})}),(0,Z.jsx)(js,{side:`bottom`,sideOffset:8,children:r})]},t)}),t[2]=i,t[3]=n,t[4]=a):a=t[4];let o;return t[5]===a?o=t[6]:(o=(0,Z.jsx)(`div`,{className:`flex items-center gap-0.5`,children:a}),t[5]=a,t[6]=o),o}function dD(e){return lD(e.editor)}function fD(e){return lD(e)!==null}function pD({editor:e}){if(en(e.state).query||e.isActive(`codeBlock`))return!1;if(fD(e)||QE(e))return!0;if(e.state.selection.empty)return!1;let{from:t,to:n}=e.state.selection;return!!e.state.doc.textBetween(t,n,` `).trim()}function mD(e){throw Error(`Unhandled AddLinkShortcutAction variant: ${JSON.stringify(e)}`)}function hD(e){let{selection:t}=e.state;if(t.empty){if(!e.isActive(`link`))return null;let n=Ot(e.state,t.from,`link`);return n===null?null:{kind:`edit-link`,markId:n}}return!pD({editor:e})||fD(e)||QE(e)?null:{kind:`open-popover`}}var gD=`open-knowledge:active-terminal-input`;function _D(e,t=typeof window>`u`?new EventTarget:window){t.dispatchEvent(new CustomEvent(gD,{detail:e}))}function vD(e,t=typeof window>`u`?new EventTarget:window){let n=t=>{let n=t instanceof CustomEvent?t.detail:void 0;typeof n==`string`&&e(n)};return t.addEventListener(gD,n),()=>t.removeEventListener(gD,n)}function yD(e){if(!(e instanceof HTMLElement))return!1;let t=e.tagName.toUpperCase();return t===`INPUT`||t===`TEXTAREA`||t===`SELECT`}function bD(e){let t=(0,$.c)(3),{editor:n,shortcutEnabled:r}=e,i=r===void 0?!1:r;if(ga())return null;let a;return t[0]!==n||t[1]!==i?(a=(0,Z.jsx)(xD,{editor:n,shortcutEnabled:i}),t[0]=n,t[1]=i,t[2]=a):a=t[2],a}function xD(e){let t=(0,$.c)(11),{editor:n,shortcutEnabled:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=ri(),t[0]=i):i=t[0];let a=i,o,s;t[1]===r?(o=t[2],s=t[3]):(o=()=>{if(!a)return;let e=e=>{r&&Pl(e,`edit-with-ai`)&&(yD(e.target)||(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),pu()))};return window.addEventListener(`keydown`,e,{capture:!0}),()=>window.removeEventListener(`keydown`,e,{capture:!0})},s=[r,a],t[1]=r,t[2]=o,t[3]=s),(0,Q.useEffect)(o,s);let c;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Z.jsx)($a,{orientation:`vertical`,className:`mx-0.5 h-5 data-vertical:self-center`}),t[4]=c):c=t[4];let l;t[5]===n?l=t[6]:(l=()=>{let e=Te(n),t=Su(n);requestAnimationFrame(()=>{if(e===null||t.trim()===``){pu();return}_D(ti({relativePath:ca(e),instruction:``,selectionMarkdown:t,target:`claude-code`}))})},t[5]=n,t[6]=l);let u,d;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Z.jsx)(ss,{className:`size-3.5`,"aria-hidden":`true`}),d=(0,Z.jsx)(`span`,{children:(0,Z.jsx)(J,{id:`xWEvuo`})}),t[7]=u,t[8]=d):(u=t[7],d=t[8]);let f;return t[9]===l?f=t[10]:(f=(0,Z.jsxs)(Z.Fragment,{children:[c,(0,Z.jsxs)(X,{type:`button`,variant:`ghost`,size:`sm`,"data-testid":`edit-with-ai-bubble-button`,className:`gap-1 px-2 text-sm font-medium text-accent-foreground/80`,onClick:l,children:[u,d]})]}),t[9]=l,t[10]=f),f}function SD(e){let t=e.schema.nodes;return!!(t.footnoteReference&&t.footnoteDefinition)}function CD(e){let{from:t,to:n}=e.state.selection,r=!1;return e.state.doc.nodesBetween(t,n,e=>e.type.name===`footnoteReference`?(r=!0,!1):!0),r}function wD(e){let{$from:t,$to:n}=e.state.selection;return!t.sameParent(n)}function TD(e){let t=(0,$.c)(21),{editor:n}=e,{_:r}=an(),i;t[0]===n?i=t[1]:(i={editor:n,selector:ED},t[0]=n,t[1]=i);let a=ie(i),o;t[2]!==a||t[3]!==n?(o=()=>{if(a||!SD(n)||n.state.selection.empty||wD(n)||CD(n))return;let{from:e,to:t}=n.state.selection,r=n.state.doc.textBetween(e,t,` `);if(!r.trim())return;let i=ni(br(n.state.doc)),o=wr(n.state.doc)+1-(t-e);n.chain().focus().deleteSelection().insertFootnoteReference(i).insertContentAt(o,{type:`footnoteDefinition`,attrs:{identifier:i,label:i},content:[{type:`paragraph`,content:[{type:`text`,text:r}]}]}).run()},t[2]=a,t[3]=n,t[4]=o):o=t[4];let s=o,c;t[5]===r?c=t[6]:(c=r({id:`sIGbBZ`}),t[5]=r,t[6]=c);let l;t[7]===s?l=t[8]:(l=e=>{e.preventDefault(),s()},t[7]=s,t[8]=l);let u;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Z.jsx)(pe,{className:`size-3.5`,"aria-hidden":`true`}),t[9]=u):u=t[9];let d;t[10]!==a||t[11]!==c||t[12]!==l?(d=(0,Z.jsx)(As,{asChild:!0,children:(0,Z.jsx)(X,{type:`button`,variant:`ghost`,size:`icon-xs`,"data-testid":`footnote-bubble-button`,className:`text-accent-foreground/80`,"aria-label":c,onMouseDown:l,disabled:a,children:u})}),t[10]=a,t[11]=c,t[12]=l,t[13]=d):d=t[13];let f;t[14]===r?f=t[15]:(f=r({id:`sIGbBZ`}),t[14]=r,t[15]=f);let p;t[16]===f?p=t[17]:(p=(0,Z.jsx)(js,{side:`bottom`,sideOffset:8,children:f}),t[16]=f,t[17]=p);let m;return t[18]!==d||t[19]!==p?(m=(0,Z.jsxs)(Ns,{children:[d,p]}),t[18]=d,t[19]=p,t[20]=m):m=t[20],m}function ED(e){let t=e.editor;return!!(!SD(t)||t.state.selection.empty||wD(t)||CD(t))}var DD=[{name:`bold`,icon:bd,command:e=>e.chain().focus().toggleBold().run(),isActive:e=>e.isActive(`strong`),shortcutId:`format-bold`},{name:`italic`,icon:Xd,command:e=>e.chain().focus().toggleItalic().run(),isActive:e=>e.isActive(`emphasis`),shortcutId:`format-italic`},{name:`underline`,icon:Bf,command:e=>e.chain().focus().toggleUnderline().run(),isActive:e=>e.isActive(`underline`),shortcutId:`format-underline`},{name:`strikethrough`,icon:Mf,command:e=>e.chain().focus().toggleStrike().run(),isActive:e=>e.isActive(`strike`),shortcutId:`format-strike`},{name:`code`,icon:Lt,command:e=>e.chain().focus().toggleCode().run(),isActive:e=>e.isActive(`code`),shortcutId:`format-inline-code`},{name:`highlight`,icon:Jd,command:e=>e.chain().focus().toggleHighlight().run(),isActive:e=>e.isActive(`highlight`),shortcutId:`format-highlight`}];function OD(e){let t=(0,$.c)(7),{editor:n}=e,r;t[0]===n?r=t[1]:(r={editor:n,selector:kD},t[0]=n,t[1]=r);let i=ie(r),a;t[2]!==i||t[3]!==n?(a=DD.map(e=>{let t=e.icon,r=i[e.name];return(0,Z.jsxs)(Ns,{children:[(0,Z.jsx)(As,{asChild:!0,children:(0,Z.jsx)(X,{variant:`ghost`,size:`icon-xs`,"aria-label":e.name,className:r?`bg-accent text-primary`:`text-accent-foreground`,onMouseDown:t=>{t.preventDefault(),e.command(n)},children:(0,Z.jsx)(t,{className:`size-3.5`})})}),(0,Z.jsxs)(js,{side:`bottom`,sideOffset:8,children:[(0,Z.jsx)(`span`,{className:`capitalize`,children:e.name}),(0,Z.jsx)(F,{"aria-label":Fl(e.shortcutId),children:Nl(e.shortcutId)})]})]},e.name)}),t[2]=i,t[3]=n,t[4]=a):a=t[4];let o;return t[5]===a?o=t[6]:(o=(0,Z.jsx)(`div`,{className:`flex items-center gap-0.5`,children:a}),t[5]=a,t[6]=o),o}function kD(e){return Object.fromEntries(DD.map(t=>[t.name,t.isActive(e.editor)]))}var AD=`open-knowledge:open-link-edit-popover`;function jD(e=typeof window>`u`?new EventTarget:window){e.dispatchEvent(new CustomEvent(AD))}function MD(e,t=typeof window>`u`?new EventTarget:window){let n=()=>e();return t.addEventListener(AD,n),()=>t.removeEventListener(AD,n)}function ND(e){return e.state.selection.empty&&e.isActive(`link`)?e.getAttributes(`link`).href??``:``}async function PD(e,t){let n;try{n=await navigator.clipboard.readText()}catch(e){e instanceof DOMException||console.warn(`[link-popover] clipboard pre-fill read failed unexpectedly`,e);return}let r=rt(n);r!==null&&(t(e=>e===``?r:e),requestAnimationFrame(()=>{let t=e.current;t&&t.value===r&&t.select()}))}function FD(e,t,n,r){let i=ND(e);n(i),r(!0),i===``&&PD(t,n)}function ID(e){let t=(0,$.c)(72),{editor:n,shortcutEnabled:r}=e,i=r===void 0?!1:r,{_:a}=an(),[o,s]=(0,Q.useState)(!1),[c,l]=(0,Q.useState)(``),u=(0,Q.useRef)(null),{folderPaths:d,loading:f,pages:p}=ea(),m;t[0]===n?m=t[1]:(m=n.state.selection.empty&&n.isActive(`link`),t[0]=n,t[1]=m);let h=m,g;t[2]===n?g=t[3]:(g=n.getAttributes(`link`).href??``,t[2]=n,t[3]=g);let _=g,v,y;t[4]!==n||t[5]!==i?(v=()=>MD(()=>{i&&FD(n,u,l,s)}),y=[i,n],t[4]=n,t[5]=i,t[6]=v,t[7]=y):(v=t[6],y=t[7]),(0,Q.useEffect)(v,y);let b,x;t[8]!==n||t[9]!==i?(b=()=>{let e=e=>{if(!i||!Pl(e,`add-link`)||!n.editorView?.hasFocus())return;let t=hD(n);if(t!==null)switch(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),t.kind){case`open-popover`:jD();return;case`edit-link`:{let{markId:e}=t;_t(e),requestAnimationFrame(()=>{Re(n).setActiveNode(e)});return}default:mD(t)}};return window.addEventListener(`keydown`,e,{capture:!0}),()=>window.removeEventListener(`keydown`,e,{capture:!0})},x=[i,n],t[8]=n,t[9]=i,t[10]=b,t[11]=x):(b=t[10],x=t[11]),(0,Q.useEffect)(b,x);let S,C;t[12]===n?(S=t[13],C=t[14]):(S=()=>{let e=function(){n.state.selection.empty&&s(!1)};return n.on(`selectionUpdate`,e),()=>{n.off(`selectionUpdate`,e)}},C=[n],t[12]=n,t[13]=S,t[14]=C),(0,Q.useEffect)(S,C);let w,T;t[15]===o?(w=t[16],T=t[17]):(w=()=>{if(!o)return;let e=!1,t=0,n=r=>{if(e)return;let i=u.current;i&&(i.focus(),document.activeElement===i)||(r<60?t=requestAnimationFrame(()=>n(r+1)):console.warn(`[link-popover] URL input never became focusable`))};return t=requestAnimationFrame(()=>n(0)),()=>{e=!0,cancelAnimationFrame(t)}},T=[o],t[15]=o,t[16]=w,t[17]=T),(0,Q.useEffect)(w,T);let E;t[18]!==n||t[19]!==h||t[20]!==c?(E=function(){c.trim()?n.chain().focus().setLink({href:c.trim()}).run():h&&n.chain().focus().unsetLink().run(),s(!1)},t[18]=n,t[19]=h,t[20]=c,t[21]=E):E=t[21];let D=E,O;t[22]===n?O=t[23]:(O=function(){n.chain().focus().unsetLink().run(),s(!1)},t[22]=n,t[23]=O);let k=O,A;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(A=function(e){l(re(e.path,null))},t[24]=A):A=t[24];let j=A,M;t[25]!==D||t[26]!==n?(M=function(e){e.key===`Enter`&&(e.preventDefault(),D()),e.key===`Escape`&&(e.preventDefault(),s(!1),n.chain().focus().run())},t[25]=D,t[26]=n,t[27]=M):M=t[27];let N=M;if(o){let e;t[28]===a?e=t[29]:(e=a({id:`ZsGpr_`}),t[28]=a,t[29]=e);let n;t[30]===a?n=t[31]:(n=a({id:`roAe2K`}),t[30]=a,t[31]=n);let r;t[32]!==d||t[33]!==N||t[34]!==f||t[35]!==p||t[36]!==e||t[37]!==n||t[38]!==c?(r=(0,Z.jsx)(st,{ref:u,type:`text`,placeholder:e,value:c,pages:p,folderPaths:d,loading:f,onValueChange:l,onSuggestionSelect:j,onKeyDown:N,"aria-label":n,className:`h-5 w-44 rounded-none border-none bg-transparent px-0 py-0 text-sm placeholder:text-muted-foreground focus-visible:border-transparent focus-visible:ring-0 dark:bg-transparent`}),t[32]=d,t[33]=N,t[34]=f,t[35]=p,t[36]=e,t[37]=n,t[38]=c,t[39]=r):r=t[39];let i;t[40]===a?i=t[41]:(i=a({id:`tP5DDk`}),t[40]=a,t[41]=i);let o;t[42]===D?o=t[43]:(o=()=>{D()},t[42]=D,t[43]=o);let s;t[44]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Z.jsx)(Nd,{className:`size-3.5 shrink-0 text-muted-foreground`}),t[44]=s):s=t[44];let m;t[45]!==i||t[46]!==o?(m=(0,Z.jsx)(X,{variant:`ghost`,size:`icon-xs`,"aria-label":i,onClick:o,children:s}),t[45]=i,t[46]=o,t[47]=m):m=t[47];let g;t[48]!==r||t[49]!==m?(g=(0,Z.jsxs)(`div`,{className:`flex items-center gap-1.5 rounded-md border bg-background px-2 py-1 focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/50`,children:[r,m]}),t[48]=r,t[49]=m,t[50]=g):g=t[50];let v;t[51]!==a||t[52]!==_||t[53]!==h||t[54]!==k?(v=h&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(Ns,{children:[(0,Z.jsx)(As,{asChild:!0,children:(0,Z.jsx)(X,{variant:`ghost`,size:`icon-xs`,"aria-label":a({id:`2vIPtm`}),onMouseDown:e=>{e.preventDefault(),tn(_)},children:(0,Z.jsx)(Li,{className:`size-3.5`})})}),(0,Z.jsx)(js,{side:`bottom`,sideOffset:8,children:(0,Z.jsx)(J,{id:`2vIPtm`})})]}),(0,Z.jsxs)(Ns,{children:[(0,Z.jsx)(As,{asChild:!0,children:(0,Z.jsx)(X,{variant:`ghost`,size:`icon-xs`,"aria-label":a({id:`484LKL`}),onMouseDown:e=>{e.preventDefault(),k()},children:(0,Z.jsx)(Ao,{className:`size-3.5`})})}),(0,Z.jsx)(js,{side:`bottom`,sideOffset:8,children:(0,Z.jsx)(J,{id:`484LKL`})})]})]}),t[51]=a,t[52]=_,t[53]=h,t[54]=k,t[55]=v):v=t[55];let y;return t[56]!==g||t[57]!==v?(y=(0,Z.jsxs)(`div`,{className:`flex items-center gap-0.5`,children:[g,v]}),t[56]=g,t[57]=v,t[58]=y):y=t[58],y}let P;t[59]===a?P=t[60]:(P=a({id:`p0Iq25`}),t[59]=a,t[60]=P);let I=h?`bg-accent text-primary`:`text-accent-foreground`,L;t[61]===n?L=t[62]:(L=e=>{e.preventDefault(),FD(n,u,l,s)},t[61]=n,t[62]=L);let R;t[63]===Symbol.for(`react.memo_cache_sentinel`)?(R=(0,Z.jsx)(Qd,{className:`size-3.5`}),t[63]=R):R=t[63];let z;t[64]!==P||t[65]!==I||t[66]!==L?(z=(0,Z.jsx)(As,{asChild:!0,children:(0,Z.jsx)(X,{variant:`ghost`,size:`icon-xs`,"aria-label":P,className:I,onMouseDown:L,children:R})}),t[64]=P,t[65]=I,t[66]=L,t[67]=z):z=t[67];let B;t[68]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,Z.jsx)(J,{id:`yzF66j`}),t[68]=B):B=t[68];let V;t[69]===Symbol.for(`react.memo_cache_sentinel`)?(V=(0,Z.jsxs)(js,{side:`bottom`,sideOffset:8,children:[B,(0,Z.jsx)(F,{children:Nl(`add-link`)})]}),t[69]=V):V=t[69];let H;return t[70]===z?H=t[71]:(H=(0,Z.jsxs)(Ns,{children:[z,V]}),t[70]=z,t[71]=H),H}function LD(e){let t=(0,$.c)(23),{editor:n,shortcutEnabled:r}=e,i=r===void 0?!0:r,a=(0,Q.useRef)(null),[o,s]=(0,Q.useState)(0),c=(0,Q.useRef)(null),l;t[0]===n?l=t[1]:(l={editor:n,selector:HD},t[0]=n,t[1]=l);let u=ie(l),d;t[2]===n?d=t[3]:(d={editor:n,selector:VD},t[2]=n,t[3]=d);let f=ie(d),p;t[4]!==n.state||t[5]!==n.view?(p=()=>{try{let{from:e,to:t}=n.state.selection;return ai(n.view,e,t)}catch{return new DOMRect}},t[4]=n.state,t[5]=n.view,t[6]=p):p=t[6];let m;if(t[7]!==n.view.dom||t[8]!==p){let e={getBoundingClientRect:p,contextElement:n.view.dom};m=()=>{let t=a.current;t&&(c.current?.(),c.current=Gs(e,t,()=>{Ys(e,t,{placement:`top`,strategy:`fixed`,middleware:[Qs(8),ec(),Xs({padding:8})]}).then(e=>{let{x:n,y:r}=e;t.isConnected&&(t.style.position=`fixed`,t.style.left=`${n}px`,t.style.top=`${r}px`)}).catch(BD)}))},t[7]=n.view.dom,t[8]=p,t[9]=m}else m=t[9];let h=m,g;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(g=()=>{c.current?.(),c.current=null,s(zD)},t[10]=g):g=t[10];let _=g,v;t[11]===h?v=t[12]:(v={onShow:h,onHide:_,strategy:`fixed`},t[11]=h,t[12]=v);let y;t[13]!==n||t[14]!==f||t[15]!==u||t[16]!==i||t[17]!==o?(y=u?(0,Z.jsx)(uD,{editor:n},`${o}-img-align`):f?(0,Z.jsx)(XE,{editor:n},`${o}-file`):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(GE,{editor:n}),(0,Z.jsx)($a,{orientation:`vertical`,className:`mx-0.5 h-5 data-vertical:self-center`}),(0,Z.jsx)(OD,{editor:n},o),(0,Z.jsx)($a,{orientation:`vertical`,className:`mx-0.5 h-5 data-vertical:self-center`}),(0,Z.jsx)(ID,{editor:n,shortcutEnabled:i},`${o}-link`),(0,Z.jsx)(TD,{editor:n},`${o}-footnote`),(0,Z.jsx)(bD,{editor:n,shortcutEnabled:i},`${o}-edit-ai`)]}),t[13]=n,t[14]=f,t[15]=u,t[16]=i,t[17]=o,t[18]=y):y=t[18];let b;return t[19]!==n||t[20]!==v||t[21]!==y?(b=(0,Z.jsx)(UE,{ref:a,editor:n,"data-testid":`bubble-menu-bar`,appendTo:RD,shouldShow:pD,updateDelay:250,options:v,className:`z-50 flex items-center gap-0.5 rounded-lg border bg-background p-1 shadow-md`,children:y}),t[19]=n,t[20]=v,t[21]=y,t[22]=b):b=t[22],b}function RD(){return document.body}function zD(e){return e+1}function BD(){}function VD(e){return QE(e.editor)}function HD(e){return fD(e.editor)}var UD=56,WD=`0 2px 4px rgba(0, 0, 0, 0.08)`,GD=150,KD=globalThis.ScrollTimeline;function qD(e,t,n,r,i){let a=r-i;if(a<=0)return null;let o=e+n-(t+UD);return{startOffset:o,endOffset:o+a,maxShift:a}}var JD=new WeakMap;function YD(e){let t=JD.get(e);if(t){for(let e of t.animations)e.cancel();JD.delete(e)}}function XD(e){for(let t of Array.from(e.cells))YD(t)}var ZD=e=>e.cellIndex===0?`3`:`2`;function QD(e,t){return $D(e,t,e=>({transform:`translateY(${e}px)`}))}function $D(e,t,n){if(!(t>0))return[{offset:0,...n(0)},{offset:1,...n(0)}];let r=t=>Math.max(0,Math.min(t-e.startOffset,e.maxShift));return Array.from(new Set([0,e.startOffset/t,e.endOffset/t,1].map(e=>Math.max(0,Math.min(e,1))))).sort((e,t)=>e-t).map(e=>({offset:e,...n(r(e*t))}))}function eO(e,t,n,r){if(!(t>0))return[{...n,offset:0},{...n,offset:1}];let i=e.startOffset/t;if(i<=0)return[{...r,offset:0},{...r,offset:1}];if(i>=1)return[{...n,offset:0},{...n,offset:1}];let a=Math.min(i+1/t,1);return[{...n,offset:0},{...n,offset:i},{...r,offset:a},{...r,offset:1}]}function tO(e,t,n){return eO(e,t,{zIndex:`auto`,boxShadow:`none`},{zIndex:n,boxShadow:WD})}function nO(e,t){return eO(e,t,{opacity:`0`},{opacity:`1`})}function rO(e,t,n,r){let i=ZD(e),a=`sd|${n.startOffset}|${n.maxShift}|${r}|${i}`,o=JD.get(e);if(o?.key===a)return;if(o)for(let e of o.animations)e.cancel();let s={timeline:t,fill:`both`,easing:`linear`},c=e.animate(QD(n,r),s),l=e.animate(tO(n,r,i),s),u=e.animate(nO(n,r),{...s,pseudoElement:`::before`});JD.set(e,{key:a,animations:[c,l,u]})}function iO(e,t){let n=ZD(e),r=`in|${t}|${n}`,i=JD.get(e);if(i?.key===r)return;if(i)for(let e of i.animations)e.cancel();let a=e.animate([{transform:`translateY(${t}px)`,zIndex:n,boxShadow:WD}],{duration:0,fill:`forwards`}),o=e.animate([{opacity:`1`}],{duration:0,fill:`forwards`,pseudoElement:`::before`});JD.set(e,{key:r,animations:[a,o]})}function aO(e,t,n,r){let i=e.getBoundingClientRect().top,a=e.scrollTop,o=e.scrollHeight-e.clientHeight,s=t.querySelectorAll(`.tableWrapper`);for(let e of s){r?.(e);let t=e.querySelector(`table`);if(!t)continue;let s=t.querySelector(`tbody`)?.rows[0];if(!s||!Array.from(s.cells).some(e=>e.tagName===`TH`))continue;let c=t.getBoundingClientRect(),l=s.getBoundingClientRect(),u=qD(a,i,c.top,c.height,l.height);if(!u){XD(s);continue}if(n){if(o<=0){XD(s);continue}for(let e of Array.from(s.cells))rO(e,n,u,o);continue}let d=Math.max(0,Math.min(a-u.startOffset,u.maxShift));if(d<=0||c.bottom<=i+UD){XD(s);continue}for(let e of Array.from(s.cells))iO(e,d)}}var oO=_r.create({name:`frozenTableHeaders`,addProseMirrorPlugins(){return[new _i({key:new Tr(`frozenTableHeaders`),view(e){let t=null,n=null,r=null,i=null,a=null,o=!1,s=new Set,c=()=>{o||!t||aO(t,e.dom,n,u)},l=()=>{r??=requestAnimationFrame(()=>{r=null,c()})};function u(e){s.has(e)||(s.add(e),e.addEventListener(`contentvisibilityautostatechange`,l))}let d=()=>{if(n){i??l(),i!=null&&clearTimeout(i),i=setTimeout(()=>{i=null,c()},GD);return}l()};return requestAnimationFrame(()=>{if(!o){if(t=e.dom.closest(`[data-testid="editor-scroll-container"]`),t&&KD)try{n=new KD({source:t,axis:`block`})}catch{n=null}t?.addEventListener(`scroll`,d,{passive:!0}),t&&typeof ResizeObserver<`u`&&(a=new ResizeObserver(l),a.observe(t),a.observe(e.dom)),c()}}),{update(e,t){t.doc.eq(e.state.doc)||c()},destroy(){o=!0,t?.removeEventListener(`scroll`,d),a?.disconnect(),r!=null&&cancelAnimationFrame(r),i!=null&&clearTimeout(i);for(let e of s)e.removeEventListener(`contentvisibilityautostatechange`,l);s.clear();for(let t of e.dom.querySelectorAll(`.tableWrapper > table > tbody > tr:first-child`))XD(t)}}}})]}});function sO(e,t){return(n,r)=>{let i=r,a=zu(i.dataTransfer);return a?(i.preventDefault(),t?.(a),!0):e(n,i)}}function cO(e,t){let n=Du(e);t(n.target,{tabBehavior:`append`}),Sl(n.hash)}var lO=5,uO=1;function dO(e){let t=(0,$.c)(14),{editor:n,axis:r,anchor:i,onClickGesture:a}=e,o=(0,Q.useRef)(null),s=(0,Q.useRef)(null),c=(0,Q.useRef)(a),l,u;t[0]===a?(l=t[1],u=t[2]):(l=()=>{c.current=a},u=[a],t[0]=a,t[1]=l,t[2]=u),(0,Q.useEffect)(l,u);let d,f;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(d=()=>()=>{s.current?.abort(),s.current=null,o.current=null,document.body.style.cursor=``,document.body.style.userSelect=``},f=[],t[3]=d,t[4]=f):(d=t[3],f=t[4]),(0,Q.useEffect)(d,f);let[p,m]=(0,Q.useState)(!1),[h,g]=(0,Q.useState)(null),_;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(_=e=>!(e&&o.current!==null),t[5]=_):_=t[5];let v=_,y;t[6]!==i||t[7]!==r||t[8]!==n?(y=e=>{if(e.button!==0)return;s.current?.abort(),o.current={startX:e.clientX,startY:e.clientY,isDragging:!1,lastTarget:null};let t=new AbortController;s.current=t;let{signal:a}=t,l=e=>{let t=o.current;if(!t)return;if(!t.isDragging){let n=e.clientX-t.startX,r=e.clientY-t.startY;if(Math.hypot(n,r)<lO)return;t.isDragging=!0,m(!0),document.body.style.cursor=`grabbing`,document.body.style.userSelect=`none`}let n=fO(i,r,e.clientX,e.clientY);t.lastTarget=n,g(n)},u=()=>{t.abort(),s.current===t&&(s.current=null),document.body.style.cursor=``,document.body.style.userSelect=``;let e=o.current;o.current=null,m(!1),g(null),e&&(e.isDragging&&e.lastTarget?gO(n,i,r,e.lastTarget.index):e.isDragging||c.current())};document.addEventListener(`pointermove`,l,{signal:a}),document.addEventListener(`pointerup`,u,{signal:a}),document.addEventListener(`pointercancel`,u,{signal:a})},t[6]=i,t[7]=r,t[8]=n,t[9]=y):y=t[9];let b=y,x;return t[10]!==h||t[11]!==p||t[12]!==b?(x={onPointerDown:b,shouldAllowOpen:v,isDragging:p,indicator:h},t[10]=h,t[11]=p,t[12]=b,t[13]=x):x=t[13],x}function fO(e,t,n,r){let i=e.closest(`table`);if(!i)return null;let a=i.getBoundingClientRect();if(t===`row`){let e=Array.from(i.rows);if(e.length===0)return null;for(let t=0;t<e.length;t++){let n=e[t].getBoundingClientRect();if(r<n.top)return{index:uO,rect:mO(a,pO(e,0,n.top))};if(r<=n.bottom){let i=r>=n.top+n.height/2,o=i?t+1:t,s=Math.max(uO,o);return{index:s,rect:mO(a,s===o?i?n.bottom:n.top:pO(e,0,n.top))}}}let t=e[e.length-1].getBoundingClientRect();return{index:e.length,rect:mO(a,t.bottom)}}let o=i.rows[0];if(!o)return null;let s=Array.from(o.cells);if(s.length===0)return null;for(let e=0;e<s.length;e++){let t=s[e].getBoundingClientRect();if(n<t.left)return{index:0,rect:hO(a,t.left)};if(n<=t.right){let r=n>=t.left+t.width/2,i=r?t.right:t.left;return{index:r?e+1:e,rect:hO(a,i)}}}let c=s[s.length-1].getBoundingClientRect();return{index:s.length,rect:hO(a,c.right)}}function pO(e,t,n){let r=e[t];return r?r.getBoundingClientRect().bottom:n}function mO(e,t){return{left:e.left,top:t-1,width:e.width,height:2}}function hO(e,t){return{left:t-1,top:e.top,width:2,height:e.height}}function gO(e,t,n,r){let i=n===`row`?_O(t):t.cellIndex;if(i<0||n===`row`&&(i<uO||r<uO)||r===i||r===i+1)return;let{state:a,view:o}=e,s=vO(a.selection.$from);if(s<0){console.warn(`[table-drag-reorder] no table found at selection depth`);return}let c=a.doc.nodeAt(s);if(!c){console.warn(`[table-drag-reorder] nodeAt returned null at tablePos`,s);return}let l=a.tr;xO(l,s,c,n===`row`?yO(c,i,r):bO(c,i,r)),o.dispatch(l)}function _O(e){let t=e.parentElement,n=t?.closest(`table`);return n?Array.prototype.indexOf.call(n.rows,t):-1}function vO(e){for(let t=e.depth;t>0;t--)if(e.node(t).type.spec.tableRole===`table`)return e.before(t);return-1}function yO(e,t,n){let r=[];e.forEach(e=>{r.push(e)});let[i]=r.splice(t,1),a=n>t?n-1:n;return r.splice(a,0,i),e.type.create(e.attrs,r,e.marks)}function bO(e,t,n){let r=n>t?n-1:n,i=[];return e.forEach(e=>{let n=[];e.forEach(e=>{n.push(e)});let[a]=n.splice(t,1);n.splice(r,0,a),i.push(e.type.create(e.attrs,n,e.marks))}),e.type.create(e.attrs,i,e.marks)}function xO(e,t,n,r){e.replaceRangeWith(t,t+n.nodeSize,r)}function SO(e){return[...e?[{label:`Toggle header column`,icon:jd,run:e=>e.chain().focus().toggleHeaderColumn().run()}]:[],{label:`Insert column left`,icon:Qe,run:e=>e.chain().focus().addColumnBefore().run()},{label:`Insert column right`,icon:gt,run:e=>e.chain().focus().addColumnAfter().run()},{label:`Delete column`,icon:Ao,separatorBefore:!0,run:e=>e.chain().focus().deleteColumn().run()},{label:`Delete table`,icon:Gd,run:e=>e.chain().focus().deleteTable().run()}]}function CO(e){return[...e?[{label:`Toggle header row`,icon:Nf,run:e=>e.chain().focus().toggleHeaderRow().run()}]:[],{label:`Insert row above`,icon:Dt,run:e=>e.chain().focus().addRowBefore().run()},{label:`Insert row below`,icon:Je,run:e=>e.chain().focus().addRowAfter().run()},{label:`Delete row`,icon:Ao,separatorBefore:!0,run:e=>e.chain().focus().deleteRow().run()},{label:`Delete table`,icon:Gd,run:e=>e.chain().focus().deleteTable().run()}]}function wO(e){if(!e.isEditable||en(e.state).query)return null;let{state:t,view:n}=e,r=t.selection.$from,i=-1;for(let e=r.depth;e>0;e--){let t=r.node(e).type.spec.tableRole;if(t===`cell`||t===`header_cell`){i=r.before(e);break}}if(i<0)return null;let a=n.nodeDOM(i);if(!(a instanceof HTMLTableCellElement))return null;let o=a.closest(`table`),s=a.closest(`tr`),c=a.closest(`.ProseMirror`);if(!o||!s||!c)return null;let l=Array.prototype.indexOf.call(o.rows,s),u=a.cellIndex,d=o.rows[0]?.cells[u],f=o.rows[l]?.cells[0];return!d||!f?null:{columnAnchor:d,rowAnchor:f,isFirstColumn:u===0,isFirstRow:l===0}}function TO(e){let t=(0,$.c)(37),{editor:n,anchor:r,axis:i,items:a}=e,o=(0,Q.useRef)(null),[s,c]=(0,Q.useState)(!1),l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(l=()=>c(!0),t[0]=l):l=t[0];let u;t[1]!==r||t[2]!==i||t[3]!==n?(u={editor:n,axis:i,anchor:r,onClickGesture:l},t[1]=r,t[2]=i,t[3]=n,t[4]=u):u=t[4];let d=dO(u),f,p;t[5]!==r||t[6]!==i?(f=()=>{let e=o.current;if(!e)return;let t=i===`column`?`top`:`left`,n=i===`column`?-14:-6;return Gs(r,e,()=>{Ys(r,e,{strategy:`absolute`,placement:t,middleware:[Qs(n)]}).then(t=>{let{x:n,y:r}=t;e.style.left=`${n}px`,e.style.top=`${r}px`,e.style.opacity=`1`}).catch(EO)})},p=[r,i],t[5]=r,t[6]=i,t[7]=f,t[8]=p):(f=t[7],p=t[8]),(0,Q.useEffect)(f,p);let m=i===`column`?Fd:co,h;t[9]===d?h=t[10]:(h=e=>{d.shouldAllowOpen(e)&&c(e)},t[9]=d,t[10]=h);let g=i===`column`?`h-3 w-7 rounded-full p-0 text-gray-700 dark:text-muted-foreground bg-gray-200 dark:bg-gray-700 hover:bg-gray-300 hover:text-foreground dark:hover:bg-gray-600 dark:hover:text-gray-100 relative cursor-grab before:absolute before:-inset-[6px] before:content-[""]`:`h-7 w-3 rounded-full p-0 text-gray-700 dark:text-muted-foreground bg-gray-200 dark:bg-gray-700 hover:bg-gray-300 hover:text-foreground dark:hover:bg-gray-600 dark:hover:text-gray-100 relative cursor-grab before:absolute before:-inset-[6px] before:content-[""]`,_=i===`column`?`Column options`:`Row options`,v;t[11]===m?v=t[12]:(v=(0,Z.jsx)(m,{className:`size-3.5`,"aria-hidden":!0}),t[11]=m,t[12]=v);let y;t[13]!==d.onPointerDown||t[14]!==g||t[15]!==_||t[16]!==v?(y=(0,Z.jsx)(bc,{asChild:!0,children:(0,Z.jsx)(X,{variant:`secondary`,onPointerDown:d.onPointerDown,className:g,"aria-label":_,children:v})}),t[13]=d.onPointerDown,t[14]=g,t[15]=_,t[16]=v,t[17]=y):y=t[17];let b=i===`column`?`center`:`start`,x=i===`column`?`bottom`:`right`,S;if(t[18]!==n||t[19]!==a){let e;t[21]===n?e=t[22]:(e=e=>(0,Z.jsxs)(Q.Fragment,{children:[e.separatorBefore&&(0,Z.jsx)(Fc,{}),(0,Z.jsxs)(Sc,{onSelect:()=>e.run(n),children:[(0,Z.jsx)(e.icon,{"aria-hidden":!0}),e.label]})]},e.label),t[21]=n,t[22]=e),S=a.map(e),t[18]=n,t[19]=a,t[20]=S}else S=t[20];let C;t[23]!==b||t[24]!==x||t[25]!==S?(C=(0,Z.jsx)(wc,{align:b,side:x,className:`w-auto min-w-44 whitespace-nowrap`,children:S}),t[23]=b,t[24]=x,t[25]=S,t[26]=C):C=t[26];let w;t[27]!==s||t[28]!==C||t[29]!==h||t[30]!==y?(w=(0,Z.jsx)(`div`,{ref:o,"data-testid":`table-cell-handle`,className:`absolute left-0 top-0 z-10 opacity-0`,children:(0,Z.jsxs)(Ac,{open:s,onOpenChange:h,children:[y,C]})}),t[27]=s,t[28]=C,t[29]=h,t[30]=y,t[31]=w):w=t[31];let T;t[32]===d.indicator?T=t[33]:(T=d.indicator&&(0,Z.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none fixed z-50 bg-primary`,style:{left:d.indicator.rect.left,top:d.indicator.rect.top,width:d.indicator.rect.width,height:d.indicator.rect.height}}),t[32]=d.indicator,t[33]=T);let E;return t[34]!==w||t[35]!==T?(E=(0,Z.jsxs)(Z.Fragment,{children:[w,T]}),t[34]=w,t[35]=T,t[36]=E):E=t[36],E}function EO(){}function DO(e){let t=(0,$.c)(18),{editor:n}=e,[r,i]=(0,Q.useState)(null),a,o;if(t[0]===n?(a=t[1],o=t[2]):(a=()=>{let e=()=>i(e=>{let t=wO(n);return e&&t&&e.columnAnchor===t.columnAnchor&&e.rowAnchor===t.rowAnchor?e:t});return e(),n.on(`selectionUpdate`,e),n.on(`update`,e),()=>{n.off(`selectionUpdate`,e),n.off(`update`,e)}},o=[n],t[0]=n,t[1]=a,t[2]=o),(0,Q.useEffect)(a,o),!r)return null;let s=r.columnAnchor,c;t[3]===r.isFirstColumn?c=t[4]:(c=SO(r.isFirstColumn),t[3]=r.isFirstColumn,t[4]=c);let l;t[5]!==r.columnAnchor||t[6]!==n||t[7]!==c?(l=(0,Z.jsx)(TO,{editor:n,anchor:s,axis:`column`,items:c}),t[5]=r.columnAnchor,t[6]=n,t[7]=c,t[8]=l):l=t[8];let u=r.rowAnchor,d;t[9]===r.isFirstRow?d=t[10]:(d=CO(r.isFirstRow),t[9]=r.isFirstRow,t[10]=d);let f;t[11]!==r.rowAnchor||t[12]!==n||t[13]!==d?(f=(0,Z.jsx)(TO,{editor:n,anchor:u,axis:`row`,items:d}),t[11]=r.rowAnchor,t[12]=n,t[13]=d,t[14]=f):f=t[14];let p;return t[15]!==l||t[16]!==f?(p=(0,Z.jsxs)(`div`,{className:`ok-table-cell-handle-layer`,children:[l,f]}),t[15]=l,t[16]=f,t[17]=p):p=t[17],p}function OO(e){let{fragment:t,docName:n}=e,r=!1,i=!1,a=!1,o=()=>{r=!0},s=e=>{console.warn(`[walk-currency] ${e} at view init — stale pre-warm cannot be invalidated: a remote edit that landed in the construct→mount gap will not render, and the first local transaction may silently erase it from the CRDT for every peer and disk (vendored y-tiptap contract change? re-verify y-tiptap.cjs:263-268)`)},c=()=>{i&&(i=!1,t.unobserveDeep(o))},l=e=>{let t=be.getState(e.state)?.binding;if(!t){_l.count(`ok/editor/walk-currency-disarmed`,{docName:n,reason:`no-binding`}),s(`no ySync binding on "${n}"`);return}if(typeof t._forceRerender!=`function`){_l.count(`ok/editor/walk-currency-disarmed`,{docName:n,reason:`no-force-rerender`}),s(`ySync binding on "${n}" exposes no _forceRerender`);return}_l.count(`ok/editor/pattern-d-stale-prewarm`,{docName:n}),t._forceRerender()};return _r.create({name:`walkCurrency`,onBeforeCreate(){t.observeDeep(o),i=!0},onDestroy(){c()},addProseMirrorPlugins(){return[new _i({view:e=>(a||(a=!0,c(),r&&l(e)),{})})]}})}var kO=new WeakMap;function AO(e){let t=document.createElement(`span`);t.classList.add(`collaboration-cursor__caret`),t.style.borderColor=e.color;let n=document.createElement(`div`);return n.classList.add(`collaboration-cursor__label`),n.style.backgroundColor=e.color,n.style.color=kr(e.color),n.textContent=e.name,t.append(n),t}var jO={state:`idle`,count:0,lastFiredAt:null,position:`append`,lastAgentId:null},MO=100,NO=100,PO=3,FO=250;function IO(e){return`contentComponent`in e&&`isEditorContentInitialized`in e}function LO(e,t){let n=he(e);if(!n||t.contains(n.dom))return!1;if(!IO(e))return console.warn(`[TiptapEditor] TipTap EditorContent binding fields missing; detached editor repair skipped`),!1;let r=e;if(r.contentComponent==null)return!1;try{n.setProps({nodeViews:{}})}catch{}return r.contentComponent=null,r.isEditorContentInitialized=!1,!0}function RO(){let e=new Zr({extensions:Er});return{mdManager:e,text:Ve({mdManager:e}),html:o({mdManager:e}),paste:Pt({mdManager:e}),drop:xt({mdManager:e})}}function zO(e,t){return t?{collaboration:it.configure({document:e.document,ySyncOptions:{mapping:t}}),guard:[OO({fragment:e.document.getXmlFragment(`default`),docName:e.configuration.name??``})]}:{collaboration:it.configure({document:e.document}),guard:[]}}function BO(e){let{provider:t,placeholder:n,prebuiltMapping:r,onWedged:i}=e,{collaboration:a,guard:o}=zO(t,r);return[...Tt.map(e=>e.name===`link`||e.name===`wikiLink`||e.name===`jsxComponent`?e.configure({docName:t.configuration.name??``}):e),Tx.configure({placeholder:n??`Type '/' for commands`,showOnlyCurrent:!0}),a,_r.create({name:`imageUploadDecoration`,addProseMirrorPlugins(){return[$e]}}),_r.create({name:`collaborationCursor`,addProseMirrorPlugins(){let e=t.awareness;if(!e)throw Error(`[TiptapEditor] HocuspocusProvider has no awareness instance — cursor plugin cannot initialize`);return[P(e,{cursorBuilder:AO})]}}),_r.create({name:`bindingStalenessGuard`,addProseMirrorPlugins(){return[fE({fragment:t.document.getXmlFragment(`default`),docName:t.configuration.name??``,onWedged:i??(()=>{})})]}}),...o,oO]}function VO(e){let{provider:t,clipboard:n,ctorStart:r}=e;return{onBeforeCreate:({editor:e})=>{kO.set(e,r)},onCreate:({editor:e})=>{n.html.setView(e.view);let r=kO.get(e);if(kO.delete(e),r==null)return;let i=performance.now();_l(`ok/editor/create-tiptap`,{docName:t.configuration.name??`unknown`,ytextLength:t.document.getText(`source`).length},{startTime:r,duration:Math.max(0,i-r)})},editorProps:{attributes:{class:`pt-4 pb-4 h-full`},clipboardTextParser:(e,t,r,i)=>{let a=n.mdManager.parse(e);return i.state.schema.nodeFromJSON(a).content},clipboardTextSerializer:(e,t)=>n.text(e,t),clipboardSerializer:n.html.serializer,handlePaste:(e,t)=>n.paste(e,t),handleDrop:sO(n.drop,e.onSidebarDrop)},extensions:eE(BO(e))}}function HO(e){let{provider:t,placeholder:n,clipboard:r,ctorStart:i,onWedged:a,onSidebarDrop:o}=e,s=t.document.getXmlFragment(`default`),c=new Map,l=VO({provider:t,placeholder:n,clipboard:r,ctorStart:i,prebuiltMapping:c,onWedged:a,onSidebarDrop:o}),u=l.onBeforeCreate;return{...l,onBeforeCreate:e=>{u?.(e);let{editor:t}=e,{doc:n,mapping:r}=At(s,t.schema);r.forEach((e,t)=>{c.set(t,e)}),t.options.content=n.toJSON()},element:null}}var UO=e=>{let t=(0,$.c)(24),{provider:n,placeholder:r,isSourceMode:i,portalTarget:a}=e,o=(0,Q.useRef)(null),s=(0,Q.useRef)(jO),c=nE(),{principal:l,activeDocName:u,recycleDocument:d,openTarget:f}=vt(),p=n.configuration.name??``,[m]=(0,Q.useState)(RO),h;t[0]!==m||t[1]!==p||t[2]!==f||t[3]!==r||t[4]!==n||t[5]!==d?(h=()=>()=>({editor:new Zn(HO({provider:n,placeholder:r,clipboard:m,ctorStart:performance.now(),onWedged:e=>{let{externalSeq:t,appliedSeq:n}=e;_l(`ok/editor/binding-wedge-recycle`,{docName:p,externalSeq:t,appliedSeq:n}),d(p)},onSidebarDrop:e=>{cO(e,f)}})),ydoc:n.document,ytext:n.document.getText(`source`),provider:n}),t[0]=m,t[1]=p,t[2]=f,t[3]=r,t[4]=n,t[5]=d,t[6]=h):h=t[6];let[g]=(0,Q.useState)(h),_,v;if(t[7]!==g||t[8]!==p||t[9]!==n.document){let e={viewCount:0,bytes:n.document.getText(`source`).length},r=_e(p)??crypto.randomUUID();_=Q.use,v=me({docName:p,mountId:r,construct:g,sizeStats:e}),t[7]=g,t[8]=p,t[9]=n.document,t[10]=_,t[11]=v}else _=t[10],v=t[11];let y=_(v),b=y.editor,x,S;t[12]===y?(x=t[13],S=t[14]):(x=()=>()=>{C(y)},S=[y],t[12]=y,t[13]=x,t[14]=S),(0,Q.useEffect)(x,S);let w;return t[15]!==u||t[16]!==p||t[17]!==b||t[18]!==c||t[19]!==i||t[20]!==a||t[21]!==l||t[22]!==n?(w=(0,Z.jsx)(WO,{provider:n,isSourceMode:i,docName:p,activeDocName:u,identity:c,principal:l,editor:b,wrapperRef:o,flashStateRef:s,portalTarget:a}),t[15]=u,t[16]=p,t[17]=b,t[18]=c,t[19]=i,t[20]=a,t[21]=l,t[22]=n,t[23]=w):w=t[23],w},WO=e=>{let t=(0,$.c)(98),{provider:n,isSourceMode:r,docName:i,activeDocName:a,identity:o,principal:s,editor:c,wrapperRef:l,flashStateRef:u,portalTarget:d}=e,f=(0,Q.useRef)(null),[p,m]=(0,Q.useState)(0),h,g;t[0]===d?(h=t[1],g=t[2]):(h=()=>{let e=f.current;if(e)return e.appendChild(d),()=>{d.parentNode===e&&e.removeChild(d)}},g=[d],t[0]=d,t[1]=h,t[2]=g),(0,Q.useLayoutEffect)(h,g);let _,v;t[3]!==c||t[4]!==d?(_=()=>{LO(c,d)&&m(GO)},v=[c,d],t[3]=c,t[4]=d,t[5]=_,t[6]=v):(_=t[5],v=t[6]),(0,Q.useEffect)(_,v);let y;t[7]!==c||t[8]!==n.configuration.name?(y=()=>(qt(c,n.configuration.name??null),()=>{qt(c,null)}),t[7]=c,t[8]=n.configuration.name,t[9]=y):y=t[9];let b;t[10]!==c||t[11]!==n?(b=[c,n],t[10]=c,t[11]=n,t[12]=b):b=t[12],(0,Q.useEffect)(y,b);let x;t[13]!==c||t[14]!==n.configuration.name?(x=()=>{let e=n.configuration.name;if(e)return ne(e,c),()=>ze(e,c)},t[13]=c,t[14]=n.configuration.name,t[15]=x):x=t[15];let S;t[16]!==c||t[17]!==n?(S=[c,n],t[16]=c,t[17]=n,t[18]=S):S=t[18],(0,Q.useEffect)(x,S);let C;t[19]!==c||t[20]!==n.configuration.name?(C=()=>{let e=n.configuration.name;if(!e)return;let t=null,r=()=>{t=null,ou(e,`wysiwyg`,lu(c)),bu(e,`wysiwyg`,xu(c,e))},i=()=>{t&&clearTimeout(t),t=setTimeout(r,120)};return r(),c.on(`selectionUpdate`,i),c.on(`update`,i),()=>{t&&clearTimeout(t),c.off(`selectionUpdate`,i),c.off(`update`,i),ou(e,`wysiwyg`,null),bu(e,`wysiwyg`,null)}},t[19]=c,t[20]=n.configuration.name,t[21]=C):C=t[21];let w;t[22]!==c||t[23]!==n?(w=[c,n],t[22]=c,t[23]=n,t[24]=w):w=t[24],(0,Q.useEffect)(C,w);let T;t[25]!==c||t[26]!==n.configuration.name?(T=()=>{},t[25]=c,t[26]=n.configuration.name,t[27]=T):T=t[27];let E;t[28]!==c||t[29]!==n?(E=[c,n],t[28]=c,t[29]=n,t[30]=E):E=t[30],(0,Q.useEffect)(T,E);let D,O;t[31]===c?(D=t[32],O=t[33]):(D=()=>{let e=KO,t=null,n=()=>{if(t||c.isDestroyed)return;let n=he(c);n&&(t=n.dom,t.addEventListener(`keydown`,e),t.addEventListener(`paste`,e),t.addEventListener(`drop`,e),t.addEventListener(`cut`,e))},r=()=>{t&&=(t.removeEventListener(`keydown`,e),t.removeEventListener(`paste`,e),t.removeEventListener(`drop`,e),t.removeEventListener(`cut`,e),null)};return he(c)?n():c.on(`create`,n),()=>{c.off(`create`,n),r()}},O=[c],t[31]=c,t[32]=D,t[33]=O),(0,Q.useEffect)(D,O);let k,A;t[34]!==i||t[35]!==c?(k=()=>{let e=!1,t=()=>{if(e||c.isDestroyed||!he(c))return;e=!0;let t=M(i)?.selection??null;if(t)try{let e=c.state.doc.content.size;if(t.type===`text`){let n=Math.max(0,Math.min(t.anchor,e)),r=Math.max(0,Math.min(t.head,e));c.commands.setTextSelection({from:n,to:r})}else{let n=Math.max(0,Math.min(t.from,e));c.commands.setNodeSelection(n)}}catch(e){let t=e,n=t instanceof Error?t.message:String(t);console.warn(JSON.stringify({event:`ok-editor-selection-restore-failed`,docName:i,message:n})),_l(`ok/editor/selection-restore-failed`,{docName:i,message:n})}H(i)};if(he(c)){t();return}return c.on(`create`,t),()=>{c.off(`create`,t)}},A=[c,i],t[34]=i,t[35]=c,t[36]=k,t[37]=A):(k=t[36],A=t[37]),(0,Q.useEffect)(k,A);let j,N;t[38]!==u||t[39]!==n.document||t[40]!==l?(j=()=>{let e=n.document.getMap(`agent-flash`),t=Date.now(),r=0,i=null,a=null,o=null,s=()=>{let t=null;for(let[,n]of e.entries()){let e=n;e.timestamp&&(!t||e.timestamp>t.timestamp)&&(t={agentId:e.agentId??`unknown`,timestamp:e.timestamp,type:e.type??`insert`,description:e.description})}return t},c=e=>{u.current=e;let t=l.current;t&&(t.setAttribute(`data-agent-flash-state`,e.state),t.setAttribute(`data-agent-flash-count`,String(e.count)),t.setAttribute(`data-agent-flash-position`,e.position),t.setAttribute(`data-agent-flash-agent-id`,e.lastAgentId??``))},d=()=>{let e=s(),t=e?.description?.toLowerCase().includes(`prepend`)?`prepend`:`append`,n={state:`editing`,count:(u.current?.count??0)+1,lastFiredAt:Date.now(),position:t,lastAgentId:e?.agentId??null};c(n),document.dispatchEvent(new CustomEvent(`agent-flash`,{detail:n})),a&&clearTimeout(a),o&&clearTimeout(o),a=window.setTimeout(()=>{let e={...n,state:`settled`};c(e),document.dispatchEvent(new CustomEvent(`agent-flash-end`,{detail:e})),o=window.setTimeout(()=>{c({...e,state:`idle`})},300)},Ir)};c(jO);let f=()=>{if(Yr(e),!pr(e,t)||document.visibilityState!==`visible`)return;let n=Date.now();if(t=n,n-r<500){if(!i){let e=500-(n-r);i=window.setTimeout(()=>{i=null,r=Date.now(),d()},e)}return}r=n,d()};e.observe(f);let p=()=>{document.visibilityState===`visible`?pr(e,t)&&(t=Date.now(),r=Date.now(),d()):t=Date.now()};return document.addEventListener(`visibilitychange`,p),()=>{e.unobserve(f),document.removeEventListener(`visibilitychange`,p),i&&clearTimeout(i),a&&clearTimeout(a),o&&clearTimeout(o)}},N=[n.document,u,l],t[38]=u,t[39]=n.document,t[40]=l,t[41]=j,t[42]=N):(j=t[41],N=t[42]),(0,Q.useEffect)(j,N);let P,F;t[43]!==a||t[44]!==i||t[45]!==c||t[46]!==n?(P=()=>{let e=0,t,r=null,o=null,s=null,l=function(){if(e<MO){e+=1,t=window.setTimeout(p,NO);return}r=null,o=null,e=0},u=function(e){let t=he(c);if(!t)return null;let n=CSS.escape(e);return t.dom.querySelector(`#${n}`)??t.dom.querySelector(`[data-mirror-source-id="${n}"]`)},d=function(e){let t=u(e);return t?(t.scrollIntoView({behavior:`smooth`,block:`start`}),!0):!1},f=function(e,n){let r=PO,o=()=>{t=void 0,!(i!==a||window.location.hash!==n)&&(d(e),--r,r>0&&(t=window.setTimeout(o,FO)))};t=window.setTimeout(o,FO)};function p(){if(!r||i!==a)return;let t=r,n=o;if(!n){l();return}d(t)?(s=n,r=null,o=null,e=0,f(t,n)):l()}let m=function(){if(i!==a)return;let n=window.location.hash;if(!r&&s===n)return;let c=Al(n);if(!c){s=n;return}r=c,o=n,e=0,t!==void 0&&(clearTimeout(t),t=void 0),p()},h=function(){if(i===a){if(r){p();return}m()}};return m(),n.on(`synced`,h),c.on(`transaction`,h),window.addEventListener(`hashchange`,m),()=>{t!==void 0&&clearTimeout(t),n.off(`synced`,h),c.off(`transaction`,h),window.removeEventListener(`hashchange`,m)}},F=[n,c,i,a],t[43]=a,t[44]=i,t[45]=c,t[46]=n,t[47]=P,t[48]=F):(P=t[47],F=t[48]),(0,Q.useEffect)(P,F);let I,L;t[49]===c?(I=t[50],L=t[51]):(I=()=>{let e=function(e){let t=e.detail;if(!t||t.mode!==`wysiwyg`||c.isDestroyed)return;let n=he(c);if(!n)return;let r=n.dom.querySelectorAll(`h1, h2, h3, h4, h5, h6`)[t.index];r&&r.scrollIntoView({behavior:`smooth`,block:`start`})};return window.addEventListener(iu,e),()=>window.removeEventListener(iu,e)},L=[c],t[49]=c,t[50]=I,t[51]=L),(0,Q.useEffect)(I,L);let R;t[52]!==a||t[53]!==i||t[54]!==o||t[55]!==r||t[56]!==s||t[57]!==n.awareness?(R=()=>{let e=n.awareness;if(e){if(i!==a){e.setLocalState(null);return}e.setLocalState({user:rE({principal:s,identity:o}),mode:r?`source`:`wysiwyg`})}},t[52]=a,t[53]=i,t[54]=o,t[55]=r,t[56]=s,t[57]=n.awareness,t[58]=R):R=t[58];let z;t[59]!==a||t[60]!==i||t[61]!==o||t[62]!==r||t[63]!==s||t[64]!==n?(z=[n,i,a,o,s,r],t[59]=a,t[60]=i,t[61]=o,t[62]=r,t[63]=s,t[64]=n,t[65]=z):z=t[65],(0,Q.useEffect)(R,z);let B,V;t[66]!==c||t[67]!==r?(B=()=>(at(c,r),()=>{at(c,!1)}),V=[c,r],t[66]=c,t[67]=r,t[68]=B,t[69]=V):(B=t[68],V=t[69]),(0,Q.useEffect)(B,V);let W;t[70]!==a||t[71]!==i||t[72]!==c||t[73]!==r?(W=!r&&(0,Z.jsx)(LD,{editor:c,shortcutEnabled:i===a}),t[70]=a,t[71]=i,t[72]=c,t[73]=r,t[74]=W):W=t[74];let G;t[75]!==c||t[76]!==r?(G=!r&&(0,Z.jsx)(DO,{editor:c}),t[75]=c,t[76]=r,t[77]=G):G=t[77];let K;t[78]===Symbol.for(`react.memo_cache_sentinel`)?(K=(0,Z.jsx)(`div`,{ref:f,style:{display:`contents`}}),t[78]=K):K=t[78];let ee;t[79]!==c||t[80]!==p?(ee=(0,Z.jsx)(U,{editor:c,className:`tiptap-editor-portal-content h-full`},p),t[79]=c,t[80]=p,t[81]=ee):ee=t[81];let te;t[82]!==d||t[83]!==ee?(te=(0,Sd.createPortal)(ee,d),t[82]=d,t[83]=ee,t[84]=te):te=t[84];let re;t[85]===c?re=t[86]:(re=(0,Z.jsx)(FT,{editor:c}),t[85]=c,t[86]=re);let ie;t[87]===c?ie=t[88]:(ie=Re(c),t[87]=c,t[88]=ie);let ae;t[89]===ie.store?ae=t[90]:(ae=(0,Z.jsx)(Ge,{store:ie.store}),t[89]=ie.store,t[90]=ae);let oe;return t[91]!==W||t[92]!==G||t[93]!==te||t[94]!==re||t[95]!==ae||t[96]!==l?(oe=(0,Z.jsxs)(`div`,{ref:l,className:`tiptap-editor h-full`,"data-agent-flash-state":`idle`,"data-agent-flash-count":`0`,"data-agent-flash-position":`append`,"data-agent-flash-agent-id":``,children:[W,G,K,te,re,ae]}),t[91]=W,t[92]=G,t[93]=te,t[94]=re,t[95]=ae,t[96]=l,t[97]=oe):oe=t[97],oe};function GO(e){return e+1}function KO(){return w()}var qO=null;function JO(e){let t=(0,$.c)(3),n=(0,Q.useRef)(null),r,i;return t[0]===e?(r=t[1],i=t[2]):(r=()=>{if(!e)return;let t=n.current;if(!t)return;let r={};qO=r;let i=document.documentElement,a=null,o=()=>{if(qO!==r)return;let e=`${t.offsetHeight}px`;e!==a&&(a=e,i.style.setProperty(`--conflict-footer-height`,e))};o();let s=new ResizeObserver(o);return s.observe(t),()=>{s.disconnect(),qO===r&&(qO=null,i.style.removeProperty(`--conflict-footer-height`))}},i=[e],t[0]=e,t[1]=r,t[2]=i),(0,Q.useEffect)(r,i),n}var YO=class e{constructor(e,t,n,r){this.fromA=e,this.toA=t,this.fromB=n,this.toB=r}offset(t,n=t){return new e(this.fromA+t,this.toA+t,this.fromB+n,this.toB+n)}};function XO(e,t,n,r,i,a){if(e==r)return[];let o=ok(e,t,n,r,i,a),s=sk(e,t+o,n,r,i+o,a);t+=o,n-=s,i+=o,a-=s;let c=n-t,l=a-i;if(!c||!l)return[new YO(t,n,i,a)];if(c>l){let o=e.slice(t,n).indexOf(r.slice(i,a));if(o>-1)return[new YO(t,t+o,i,i),new YO(t+o+l,n,a,a)]}else if(l>c){let o=r.slice(i,a).indexOf(e.slice(t,n));if(o>-1)return[new YO(t,t,i,i+o),new YO(n,n,i+o+c,a)]}if(c==1||l==1)return[new YO(t,n,i,a)];let u=lk(e,t,n,r,i,a);if(u){let[o,s,c]=u;return XO(e,t,o,r,i,s).concat(XO(e,o+c,n,r,s+c,a))}return ek(e,t,n,r,i,a)}var ZO=1e9,QO=0,$O=!1;function ek(e,t,n,r,i,a){let o=n-t,s=a-i;if(ZO<1e9&&Math.min(o,s)>ZO*16||QO>0&&Date.now()>QO)return Math.min(o,s)>ZO*64?[new YO(t,n,i,a)]:uk(e,t,n,r,i,a);let c=Math.ceil((o+s)/2);nk.reset(c),rk.reset(c);let l=(n,a)=>e.charCodeAt(t+n)==r.charCodeAt(i+a),u=(t,i)=>e.charCodeAt(n-t-1)==r.charCodeAt(a-i-1),d=(o-s)%2==0?null:rk,f=d?null:nk;for(let p=0;p<c;p++){if(p>ZO||QO>0&&!(p&63)&&Date.now()>QO)return uk(e,t,n,r,i,a);let m=nk.advance(p,o,s,c,d,!1,l)||rk.advance(p,o,s,c,f,!0,u);if(m)return ik(e,t,n,t+m[0],r,i,a,i+m[1])}return[new YO(t,n,i,a)]}var tk=class{constructor(){this.vec=[]}reset(e){this.len=e<<1;for(let e=0;e<this.len;e++)this.vec[e]=-1;this.vec[e+1]=0,this.start=this.end=0}advance(e,t,n,r,i,a,o){for(let s=-e+this.start;s<=e-this.end;s+=2){let c=r+s,l=s==-e||s!=e&&this.vec[c-1]<this.vec[c+1]?this.vec[c+1]:this.vec[c-1]+1,u=l-s;for(;l<t&&u<n&&o(l,u);)l++,u++;if(this.vec[c]=l,l>t)this.end+=2;else if(u>n)this.start+=2;else if(i){let e=r+(t-n)-s;if(e>=0&&e<this.len&&i.vec[e]!=-1)if(a){let n=i.vec[e];if(n>=t-l)return[n,r+n-e]}else{let n=t-i.vec[e];if(l>=n)return[l,u]}}}return null}},nk=new tk,rk=new tk;function ik(e,t,n,r,i,a,o,s){let c=!1;return!Tk(e,r)&&++r==n&&(c=!0),!Tk(i,s)&&++s==o&&(c=!0),c?[new YO(t,n,a,o)]:XO(e,t,r,i,a,s).concat(XO(e,r,n,i,s,o))}function ak(e,t){let n=1,r=Math.min(e,t);for(;n<r;)n<<=1;return n}function ok(e,t,n,r,i,a){if(t==n||t==a||e.charCodeAt(t)!=r.charCodeAt(i))return 0;let o=ak(n-t,a-i);for(let s=t,c=i;;){let i=s+o,l=c+o;if(i>n||l>a||e.slice(s,i)!=r.slice(c,l)){if(o==1)return s-t-+!Tk(e,s);o>>=1}else if(i==n||l==a)return i-t;else s=i,c=l}}function sk(e,t,n,r,i,a){if(t==n||i==a||e.charCodeAt(n-1)!=r.charCodeAt(a-1))return 0;let o=ak(n-t,a-i);for(let s=n,c=a;;){let a=s-o,l=c-o;if(a<t||l<i||e.slice(a,s)!=r.slice(l,c)){if(o==1)return n-s-+!Tk(e,s);o>>=1}else if(a==t||l==i)return n-a;else s=a,c=l}}function ck(e,t,n,r,i,a,o,s){let c=r.slice(i,a),l=null;for(;;){if(l||o<s)return l;for(let s=t+o;;){Tk(e,s)||s++;let u=s+o;if(Tk(e,u)||(u+=u==s+1?1:-1),u>=n)break;let d=e.slice(s,u),f=-1;for(;(f=c.indexOf(d,f+1))!=-1;){let o=ok(e,u,n,r,i+f+d.length,a),c=sk(e,t,s,r,i,i+f),p=d.length+o+c;(!l||l[2]<p)&&(l=[s-c,i+f-c,p])}s=u}if(s<0)return l;o>>=1}}function lk(e,t,n,r,i,a){let o=n-t,s=a-i;if(o<s){let o=lk(r,i,a,e,t,n);return o&&[o[1],o[0],o[2]]}return o<4||s*2<o?null:ck(e,t,n,r,i,a,Math.floor(o/4),-1)}function uk(e,t,n,r,i,a){$O=!0;let o=n-t,s=a-i,c;if(o<s){let s=ck(r,i,a,e,t,n,Math.floor(o/6),50);c=s&&[s[1],s[0],s[2]]}else c=ck(e,t,n,r,i,a,Math.floor(s/6),50);if(!c)return[new YO(t,n,i,a)];let[l,u,d]=c;return XO(e,t,l,r,i,u).concat(XO(e,l+d,n,r,u+d,a))}function dk(e,t){for(let n=1;n<e.length;n++){let r=e[n-1],i=e[n];r.toA>i.fromA-t&&r.toB>i.fromB-t&&(e[n-1]=new YO(r.fromA,i.toA,r.fromB,i.toB),e.splice(n--,1))}}function fk(e,t,n){for(;;){dk(n,1);let r=!1;for(let i=0;i<n.length;i++){let a=n[i],o,s;(o=ok(e,a.fromA,a.toA,t,a.fromB,a.toB))&&(a=n[i]=new YO(a.fromA+o,a.toA,a.fromB+o,a.toB)),(s=sk(e,a.fromA,a.toA,t,a.fromB,a.toB))&&(a=n[i]=new YO(a.fromA,a.toA-s,a.fromB,a.toB-s));let c=a.toA-a.fromA,l=a.toB-a.fromB;if(c&&l)continue;let u=a.fromA-(i?n[i-1].toA:0),d=(i<n.length-1?n[i+1].fromA:e.length)-a.toA;if(!u||!d)continue;let f=c?e.slice(a.fromA,a.toA):t.slice(a.fromB,a.toB);u<=f.length&&e.slice(a.fromA-u,a.fromA)==f.slice(f.length-u)?(n[i]=new YO(a.fromA-u,a.toA-u,a.fromB-u,a.toB-u),r=!0):d<=f.length&&e.slice(a.toA,a.toA+d)==f.slice(0,d)&&(n[i]=new YO(a.fromA+d,a.toA+d,a.fromB+d,a.toB+d),r=!0)}if(!r)break}return n}function pk(e,t,n){for(let r=0,i=0;i<e.length;i++){let a=e[i],o=a.toA-a.fromA,s=a.toB-a.fromB;if(o&&s||o>3||s>3){let c=i==e.length-1?t.length:e[i+1].fromA,l=a.fromA-r,u=c-a.toA,d=bk(t,a.fromA,l),f=yk(t,a.toA,u),p=a.fromA-d,m=f-a.toA;if((!o||!s)&&p&&m){let l=Math.max(o,s),[u,h,g]=o?[t,a.fromA,a.toA]:[n,a.fromB,a.toB];l>p&&t.slice(d,a.fromA)==u.slice(g-p,g)?(a=e[i]=new YO(d,d+o,a.fromB-p,a.toB-p),d=a.fromA,f=yk(t,a.toA,c-a.toA)):l>m&&t.slice(a.toA,f)==u.slice(h,h+m)&&(a=e[i]=new YO(f-o,f,a.fromB+m,a.toB+m),f=a.toA,d=bk(t,a.fromA,a.fromA-r)),p=a.fromA-d,m=f-a.toA}if(p||m)a=e[i]=new YO(a.fromA-p,a.toA+m,a.fromB-p,a.toB+m);else if(!o){let t=Sk(n,a.fromB,a.toB),r,o=t<0?-1:xk(n,a.toB,a.fromB);t>-1&&(r=t-a.fromB)<=u&&n.slice(a.fromB,t)==n.slice(a.toB,a.toB+r)?a=e[i]=a.offset(r):o>-1&&(r=a.toB-o)<=l&&n.slice(a.fromB-r,a.fromB)==n.slice(o,a.toB)&&(a=e[i]=a.offset(-r))}else if(!s){let n=Sk(t,a.fromA,a.toA),r,o=n<0?-1:xk(t,a.toA,a.fromA);n>-1&&(r=n-a.fromA)<=u&&t.slice(a.fromA,n)==t.slice(a.toA,a.toA+r)?a=e[i]=a.offset(r):o>-1&&(r=a.toA-o)<=l&&t.slice(a.fromA-r,a.fromA)==t.slice(o,a.toA)&&(a=e[i]=a.offset(-r))}}r=a.toA}return dk(e,3),e}var mk;try{mk=RegExp(`[\\p{Alphabetic}\\p{Number}]`,`u`)}catch{}function hk(e){return e>48&&e<58||e>64&&e<91||e>96&&e<123}function gk(e,t){if(t==e.length)return 0;let n=e.charCodeAt(t);return n<192?+!!hk(n):mk?!Ck(n)||t==e.length-1?+!!mk.test(String.fromCharCode(n)):mk.test(e.slice(t,t+2))?2:0:0}function _k(e,t){if(!t)return 0;let n=e.charCodeAt(t-1);return n<192?+!!hk(n):mk?!wk(n)||t==1?+!!mk.test(String.fromCharCode(n)):mk.test(e.slice(t-2,t))?2:0:0}var vk=8;function yk(e,t,n){if(t==e.length||!_k(e,t))return t;for(let r=t,i=t+n,a=0;a<vk;a++){let t=gk(e,r);if(!t||r+t>i)return r;r+=t}return t}function bk(e,t,n){if(!t||!gk(e,t))return t;for(let r=t,i=t-n,a=0;a<vk;a++){let t=_k(e,r);if(!t||r-t<i)return r;r-=t}return t}function xk(e,t,n){for(;t!=n;t--)if(e.charCodeAt(t-1)==10)return t;return-1}function Sk(e,t,n){for(;t!=n;t++)if(e.charCodeAt(t)==10)return t;return-1}var Ck=e=>e>=55296&&e<=56319,wk=e=>e>=56320&&e<=57343;function Tk(e,t){return!t||t==e.length||!Ck(e.charCodeAt(t-1))||!wk(e.charCodeAt(t))}function Ek(e,t,n){let r=n?.override;return r?r(e,t):(ZO=(n?.scanLimit??1e9)>>1,QO=n?.timeout?Date.now()+n.timeout:0,$O=!1,fk(e,t,XO(e,0,e.length,t,0,t.length)))}function Dk(){return!$O}function Ok(e,t,n){return pk(Ek(e,t,n),e,t)}var kk=Gl.define({combine:e=>e[0]}),Ak=Kl.define(),jk=Gl.define(),Mk=Bl.define({create(e){return null},update(e,t){for(let n of t.effects)n.is(Ak)&&(e=n.value);for(let n of t.state.facet(jk))e=n(e,t);return e}});function Nk(e){let t=e.field(Mk,!1);if(!t)return null;let n=e.facet(kk);return{chunks:t,side:n?n.side:null}}var Pk=class e{constructor(e,t,n,r,i,a=!0){this.changes=e,this.fromA=t,this.toA=n,this.fromB=r,this.toB=i,this.precise=a}offset(t,n){return t||n?new e(this.changes,this.fromA+t,this.toA+t,this.fromB+n,this.toB+n,this.precise):this}get endA(){return Math.max(this.fromA,this.toA-1)}get endB(){return Math.max(this.fromB,this.toB-1)}static build(e,t,n){return Lk(Ok(e.toString(),t.toString(),n),e,t,0,0,Dk())}static updateA(e,t,n,r,i){return Vk(Bk(e,r,!0,n.length),e,t,n,i)}static updateB(e,t,n,r,i){return Vk(Bk(e,r,!1,t.length),e,t,n,i)}};function Fk(e,t,n,r){let i=n.lineAt(e),a=r.lineAt(t);return i.to==e&&a.to==t&&e<n.length&&t<r.length?[e+1,t+1]:[i.from,a.from]}function Ik(e,t,n,r){let i=n.lineAt(e),a=r.lineAt(t);return i.from==e&&a.from==t?[e,t]:[i.to+1,a.to+1]}function Lk(e,t,n,r,i,a){let o=[];for(let s=0;s<e.length;s++){let c=e[s],[l,u]=Fk(c.fromA+r,c.fromB+i,t,n),[d,f]=Ik(c.toA+r,c.toB+i,t,n),p=[c.offset(-l+r,-u+i)];for(;s<e.length-1;){let a=e[s+1],[o,c]=Fk(a.fromA+r,a.fromB+i,t,n);if(o>d+1&&c>f+1)break;p.push(a.offset(-l+r,-u+i)),[d,f]=Ik(a.toA+r,a.toB+i,t,n),s++}o.push(new Pk(p,l,Math.max(l,d),u,Math.max(u,f),a))}return o}var Rk=1e3;function zk(e,t,n,r){let i=0,a=e.length;for(;;){if(i==a){let r=0,a=0;i&&({toA:r,toB:a}=e[i-1]);let o=t-(n?r:a);return[r+o,a+o]}let o=i+a>>1,s=e[o],[c,l]=n?[s.fromA,s.toA]:[s.fromB,s.toB];if(c>t)a=o;else if(l<=t)i=o+1;else return r?[s.fromA,s.fromB]:[s.toA,s.toB]}}function Bk(e,t,n,r){let i=[];return t.iterChangedRanges((a,o,s,c)=>{let l=0,u=n?t.length:r,d=0,f=n?r:t.length;a>Rk&&([l,d]=zk(e,a-Rk,n,!0)),o<t.length-Rk&&([u,f]=zk(e,o+Rk,n,!1));let p=c-s-(o-a),m,[h,g]=n?[p,0]:[0,p];i.length&&(m=i[i.length-1]).toA>=l?i[i.length-1]={fromA:m.fromA,fromB:m.fromB,toA:u,toB:f,diffA:m.diffA+h,diffB:m.diffB+g}:i.push({fromA:l,toA:u,fromB:d,toB:f,diffA:h,diffB:g})}),i}function Vk(e,t,n,r,i){if(!e.length)return t;let a=[];for(let o=0,s=0,c=0,l=0;;o++){let u=o==e.length?null:e[o],d=u?u.fromA+s:n.length,f=u?u.fromB+c:r.length;for(;l<t.length;){let e=t[l];if(u&&(e.toA+s>d||e.toB+c>f))break;a.push(e.offset(s,c)),l++}if(!u)break;let p=u.toA+s+u.diffA,m=u.toB+c+u.diffB,h=Ok(n.sliceString(d,p),r.sliceString(f,m),i);for(let e of Lk(h,n,r,d,f,Dk()))a.push(e);for(s+=u.diffA,c+=u.diffB;l<t.length;){let e=t[l];if(e.fromA+s>p&&e.fromB+c>m)break;l++}}return a}var Hk={scanLimit:500},Uk=ql.fromClass(class{constructor(e){({deco:this.deco,gutter:this.gutter}=$k(e))}update(e){(e.docChanged||e.viewportChanged||Gk(e.startState,e.state)||Kk(e.startState,e.state))&&({deco:this.deco,gutter:this.gutter}=$k(e.view))}},{decorations:e=>e.deco}),Wk=Ll.low(Zl({class:`cm-changeGutter`,markers:e=>e.plugin(Uk)?.gutter||$l.empty}));function Gk(e,t){return e.field(Mk,!1)!=t.field(Mk,!1)}function Kk(e,t){return e.facet(kk)!=t.facet(kk)}var qk=Ul.line({class:`cm-changedLine`}),Jk=Ul.mark({class:`cm-changedText`}),Yk=Ul.mark({tagName:`ins`,class:`cm-insertedLine`}),Xk=Ul.mark({tagName:`del`,class:`cm-deletedLine`}),Zk=new class extends Xl{constructor(){super(...arguments),this.elementClass=`cm-changedLineGutter`}};function Qk(e,t,n,r,i,a){let o=n?e.fromA:e.fromB,s=n?e.toA:e.toB,c=0;if(o!=s){i.add(o,o,qk),i.add(o,s,n?Xk:Yk),a&&a.add(o,o,Zk);for(let l=t.iterRange(o,s-1),u=o;!l.next().done;){if(l.lineBreak){u++,i.add(u,u,qk),a&&a.add(u,u,Zk);continue}let t=u+l.value.length;if(r)for(;c<e.changes.length;){let r=e.changes[c],a=o+(n?r.fromA:r.fromB),s=o+(n?r.toA:r.toB),l=Math.max(u,a),d=Math.min(t,s);if(l<d&&i.add(l,d,Jk),s<t)c++;else break}u=t}}}function $k(e){let t=e.state.field(Mk),{side:n,highlightChanges:r,markGutter:i,overrideChunk:a}=e.state.facet(kk),o=n==`a`,s=new Wl,c=i?new Wl:null,{from:l,to:u}=e.viewport;for(let n of t){if((o?n.fromA:n.fromB)>=u)break;(o?n.toA:n.toB)>l&&(!a||!a(e.state,n,s,c))&&Qk(n,e.state.doc,o,r,s,c)}return{deco:s.finish(),gutter:c&&c.finish()}}var eA=class extends Il{constructor(e){super(),this.height=e}eq(e){return this.height==e.height}toDOM(){let e=document.createElement(`div`);return e.className=`cm-mergeSpacer`,e.style.height=this.height+`px`,e}updateDOM(e){return e.style.height=this.height+`px`,!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}},tA=Kl.define({map:(e,t)=>e.map(t)}),nA=Bl.define({create:()=>Ul.none,update:(e,t)=>{for(let e of t.effects)if(e.is(tA))return e.value;return e.map(t.changes)},provide:e=>Yl.decorations.from(e)}),rA=.01;function iA(e,t){if(e.size!=t.size)return!1;let n=e.iter(),r=t.iter();for(;n.value;){if(n.from!=r.from||Math.abs(n.value.spec.widget.height-r.value.spec.widget.height)>1)return!1;n.next(),r.next()}return!0}function aA(e,t,n){let r=new Wl,i=new Wl,a=e.state.field(nA).iter(),o=t.state.field(nA).iter(),s=0,c=0,l=0,u=0,d=e.viewport,f=t.viewport;for(let p=0;;p++){let m=p<n.length?n[p]:null,h=m?m.fromA:e.state.doc.length,g=m?m.fromB:t.state.doc.length;if(s<h){let n=e.lineBlockAt(s).top+l-(t.lineBlockAt(c).top+u);n<-rA?(l-=n,r.add(s,s,Ul.widget({widget:new eA(-n),block:!0,side:-1}))):n>rA&&(u+=n,i.add(c,c,Ul.widget({widget:new eA(n),block:!0,side:-1})))}if(h>s+1e3&&s<d.from&&h>d.from&&c<f.from&&g>f.from){let e=Math.min(d.from-s,f.from-c);s+=e,c+=e,p--}else if(m)s=m.toA,c=m.toB;else break;for(;a.value&&a.from<s;)l-=a.value.spec.widget.height,a.next();for(;o.value&&o.from<c;)u-=o.value.spec.widget.height,o.next()}for(;a.value;)l-=a.value.spec.widget.height,a.next();for(;o.value;)u-=o.value.spec.widget.height,o.next();let p=e.contentHeight+l-(t.contentHeight+u);p<rA?r.add(e.state.doc.length,e.state.doc.length,Ul.widget({widget:new eA(-p),block:!0,side:1})):p>rA&&i.add(t.state.doc.length,t.state.doc.length,Ul.widget({widget:new eA(p),block:!0,side:1}));let m=r.finish(),h=i.finish();iA(m,e.state.field(nA))||e.dispatch({effects:tA.of(m)}),iA(h,t.state.field(nA))||t.dispatch({effects:tA.of(h)})}var oA=Kl.define({map:(e,t)=>t.mapPos(e)}),sA=class extends Il{constructor(e){super(),this.lines=e}eq(e){return this.lines==e.lines}toDOM(e){let t=document.createElement(`div`);return t.className=`cm-collapsedLines`,t.textContent=e.state.phrase(`$ unchanged lines`,this.lines),t.addEventListener(`click`,t=>{let n=e.posAtDOM(t.target);e.dispatch({effects:oA.of(n)});let{side:r,sibling:i}=e.state.facet(kk);i&&i().dispatch({effects:oA.of(cA(n,e.state.field(Mk),r==`a`))})}),t}ignoreEvent(e){return e instanceof MouseEvent}get estimatedHeight(){return 27}get type(){return`collapsed-unchanged-code`}};function cA(e,t,n){let r=0,i=0;for(let a=0;;a++){let o=a<t.length?t[a]:null;if(!o||(n?o.fromA:o.fromB)>=e)return i+(e-r);[r,i]=n?[o.toA,o.toB]:[o.toB,o.toA]}}var lA=Bl.define({create(e){return Ul.none},update(e,t){e=e.map(t.changes);for(let n of t.effects)n.is(oA)&&(e=e.update({filter:e=>e!=n.value}));return e},provide:e=>Yl.decorations.from(e)});function uA({margin:e=3,minSize:t=4}){return lA.init(n=>dA(n,e,t))}function dA(e,t,n){let r=new Wl,i=e.facet(kk).side==`a`,a=e.field(Mk),o=1;for(let s=0;;s++){let c=s<a.length?a[s]:null,l=s?o+t:1,u=c?e.doc.lineAt(i?c.fromA:c.fromB).number-1-t:e.doc.lines,d=u-l+1;if(d>=n&&r.add(e.doc.line(l).from,e.doc.line(u).to,Ul.replace({widget:new sA(d),block:!0})),!c)break;o=e.doc.lineAt(Math.min(e.doc.length,i?c.toA:c.toB)).number}return r.finish()}var fA=Yl.styleModule.of(new Ql({".cm-mergeView":{overflowY:`auto`},".cm-mergeViewEditors":{display:`flex`,alignItems:`stretch`},".cm-mergeViewEditor":{flexGrow:1,flexBasis:0,overflow:`hidden`},".cm-merge-revert":{width:`1.6em`,flexGrow:0,flexShrink:0,position:`relative`},".cm-merge-revert button":{position:`absolute`,display:`block`,width:`100%`,boxSizing:`border-box`,textAlign:`center`,background:`none`,border:`none`,font:`inherit`,cursor:`pointer`}})),pA=Yl.baseTheme({".cm-mergeView & .cm-scroller, .cm-mergeView &":{height:`auto !important`,overflowY:`visible !important`},"&.cm-merge-a .cm-changedLine, .cm-deletedChunk":{backgroundColor:`rgba(160, 128, 100, .08)`},"&.cm-merge-b .cm-changedLine, .cm-inlineChangedLine":{backgroundColor:`rgba(100, 160, 128, .08)`},"&light.cm-merge-a .cm-changedText, &light .cm-deletedChunk .cm-deletedText":{background:`linear-gradient(#ee443366, #ee443366) bottom/100% 2px no-repeat`},"&dark.cm-merge-a .cm-changedText, &dark .cm-deletedChunk .cm-deletedText":{background:`linear-gradient(#ffaa9966, #ffaa9966) bottom/100% 2px no-repeat`},"&light.cm-merge-b .cm-changedText":{background:`linear-gradient(#22bb22aa, #22bb22aa) bottom/100% 2px no-repeat`},"&dark.cm-merge-b .cm-changedText":{background:`linear-gradient(#88ff88aa, #88ff88aa) bottom/100% 2px no-repeat`},"&.cm-merge-b .cm-deletedText":{background:`#ff000033`},".cm-insertedLine, .cm-deletedLine, .cm-deletedLine del":{textDecoration:`none`},".cm-deletedChunk":{paddingLeft:`6px`,"& .cm-chunkButtons":{position:`absolute`,insetInlineEnd:`5px`},"& button":{border:`none`,cursor:`pointer`,color:`white`,margin:`0 2px`,borderRadius:`3px`,"&[name=accept]":{background:`#2a2`},"&[name=reject]":{background:`#d43`}}},".cm-collapsedLines":{padding:`5px 5px 5px 10px`,cursor:`pointer`,"&:before":{content:`"⦚"`,marginInlineEnd:`7px`},"&:after":{content:`"⦚"`,marginInlineStart:`7px`}},"&light .cm-collapsedLines":{color:`#444`,background:`linear-gradient(to bottom, transparent 0, #f3f3f3 30%, #f3f3f3 70%, transparent 100%)`},"&dark .cm-collapsedLines":{color:`#ddd`,background:`linear-gradient(to bottom, transparent 0, #222 30%, #222 70%, transparent 100%)`},".cm-changeGutter":{width:`3px`,paddingLeft:`1px`},"&light.cm-merge-a .cm-changedLineGutter, &light .cm-deletedLineGutter":{background:`#e43`},"&dark.cm-merge-a .cm-changedLineGutter, &dark .cm-deletedLineGutter":{background:`#fa9`},"&light.cm-merge-b .cm-changedLineGutter":{background:`#2b2`},"&dark.cm-merge-b .cm-changedLineGutter":{background:`#8f8`},".cm-inlineChangedLineGutter":{background:`#75d`}}),mA=new Jl,hA=new Jl,gA=class{constructor(e){this.revertDOM=null,this.revertToA=!1,this.revertToLeft=!1,this.measuring=-1,this.diffConf=e.diffConfig||Hk;let t=[Ll.low(Uk),pA,fA,nA,Yl.updateListener.of(e=>{this.measuring<0&&(e.heightChanged||e.viewportChanged)&&!e.transactions.some(e=>e.effects.some(e=>e.is(tA)))&&this.measure()})],n=[kk.of({side:`a`,sibling:()=>this.b,highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1})];e.gutter!==!1&&n.push(Wk);let r=zl.create({doc:e.a.doc,selection:e.a.selection,extensions:[e.a.extensions||[],Yl.editorAttributes.of({class:`cm-merge-a`}),hA.of(n),t]}),i=[kk.of({side:`b`,sibling:()=>this.a,highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1})];e.gutter!==!1&&i.push(Wk);let a=zl.create({doc:e.b.doc,selection:e.b.selection,extensions:[e.b.extensions||[],Yl.editorAttributes.of({class:`cm-merge-b`}),hA.of(i),t]});this.chunks=Pk.build(r.doc,a.doc,this.diffConf);let o=[Mk.init(()=>this.chunks),mA.of(e.collapseUnchanged?uA(e.collapseUnchanged):[])];r=r.update({effects:Kl.appendConfig.of(o)}).state,a=a.update({effects:Kl.appendConfig.of(o)}).state,this.dom=document.createElement(`div`),this.dom.className=`cm-mergeView`,this.editorDOM=this.dom.appendChild(document.createElement(`div`)),this.editorDOM.className=`cm-mergeViewEditors`;let s=e.orientation||`a-b`,c=document.createElement(`div`);c.className=`cm-mergeViewEditor`;let l=document.createElement(`div`);l.className=`cm-mergeViewEditor`,this.editorDOM.appendChild(s==`a-b`?c:l),this.editorDOM.appendChild(s==`a-b`?l:c),this.a=new Yl({state:r,parent:c,root:e.root,dispatchTransactions:e=>this.dispatch(e,this.a)}),this.b=new Yl({state:a,parent:l,root:e.root,dispatchTransactions:e=>this.dispatch(e,this.b)}),this.setupRevertControls(!!e.revertControls,e.revertControls==`b-to-a`,e.renderRevertControl),e.parent&&e.parent.appendChild(this.dom),this.scheduleMeasure()}dispatch(e,t){if(e.some(e=>e.docChanged)){let n=e[e.length-1],r=e.reduce((e,t)=>e.compose(t.changes),Rl.empty(e[0].startState.doc.length));this.chunks=t==this.a?Pk.updateA(this.chunks,n.newDoc,this.b.state.doc,r,this.diffConf):Pk.updateB(this.chunks,this.a.state.doc,n.newDoc,r,this.diffConf),t.update([...e,n.state.update({effects:Ak.of(this.chunks)})]);let i=t==this.a?this.b:this.a;i.update([i.state.update({effects:Ak.of(this.chunks)})]),this.scheduleMeasure()}else t.update(e)}reconfigure(e){if(`diffConfig`in e&&(this.diffConf=e.diffConfig),`orientation`in e){let t=e.orientation!=`b-a`;if(t!=(this.editorDOM.firstChild==this.a.dom.parentNode)){let e=this.a.dom.parentNode,n=this.b.dom.parentNode;e.remove(),n.remove(),this.editorDOM.insertBefore(t?e:n,this.editorDOM.firstChild),this.editorDOM.appendChild(t?n:e),this.revertToLeft=!this.revertToLeft,this.revertDOM&&(this.revertDOM.textContent=``)}}if(`revertControls`in e||`renderRevertControl`in e){let t=!!this.revertDOM,n=this.revertToA,r=this.renderRevert;`revertControls`in e&&(t=!!e.revertControls,n=e.revertControls==`b-to-a`),`renderRevertControl`in e&&(r=e.renderRevertControl),this.setupRevertControls(t,n,r)}let t=`highlightChanges`in e,n=`gutter`in e,r=`collapseUnchanged`in e;if(t||n||r){let i=[],a=[];if(t||n){let r=this.a.state.facet(kk),o=n?e.gutter!==!1:r.markGutter,s=t?e.highlightChanges!==!1:r.highlightChanges;i.push(hA.reconfigure([kk.of({side:`a`,sibling:()=>this.b,highlightChanges:s,markGutter:o}),o?Wk:[]])),a.push(hA.reconfigure([kk.of({side:`b`,sibling:()=>this.a,highlightChanges:s,markGutter:o}),o?Wk:[]]))}if(r){let t=mA.reconfigure(e.collapseUnchanged?uA(e.collapseUnchanged):[]);i.push(t),a.push(t)}this.a.dispatch({effects:i}),this.b.dispatch({effects:a})}this.scheduleMeasure()}setupRevertControls(e,t,n){this.revertToA=t,this.revertToLeft=this.revertToA==(this.editorDOM.firstChild==this.a.dom.parentNode),this.renderRevert=n,!e&&this.revertDOM?(this.revertDOM.remove(),this.revertDOM=null):e&&!this.revertDOM?(this.revertDOM=this.editorDOM.insertBefore(document.createElement(`div`),this.editorDOM.firstChild.nextSibling),this.revertDOM.addEventListener(`mousedown`,e=>this.revertClicked(e)),this.revertDOM.className=`cm-merge-revert`):this.revertDOM&&(this.revertDOM.textContent=``)}scheduleMeasure(){this.measuring<0&&(this.measuring=(this.dom.ownerDocument.defaultView||window).requestAnimationFrame(()=>{this.measuring=-1,this.measure()}))}measure(){aA(this.a,this.b,this.chunks),this.revertDOM&&this.updateRevertButtons()}updateRevertButtons(){let e=this.revertDOM,t=e.firstChild,n=this.a.viewport,r=this.b.viewport;for(let i=0;i<this.chunks.length;i++){let a=this.chunks[i];if(a.fromA>n.to||a.fromB>r.to)break;if(a.fromA<n.from||a.fromB<r.from)continue;let o=this.a.lineBlockAt(a.fromA).top+`px`;for(;t&&+t.dataset.chunk<i;)t=_A(t);t&&t.dataset.chunk==String(i)?(t.style.top!=o&&(t.style.top=o),t=t.nextSibling):e.insertBefore(this.renderRevertButton(o,i),t)}for(;t;)t=_A(t)}renderRevertButton(e,t){let n;if(this.renderRevert)n=this.renderRevert();else{n=document.createElement(`button`);let e=this.a.state.phrase(`Revert this chunk`);n.setAttribute(`aria-label`,e),n.setAttribute(`title`,e),n.textContent=this.revertToLeft?`⇜`:`⇝`}return n.style.top=e,n.setAttribute(`data-chunk`,String(t)),n}revertClicked(e){let t=e.target,n;for(;t&&t.parentNode!=this.revertDOM;)t=t.parentNode;if(t&&(n=this.chunks[t.dataset.chunk])){let[t,r,i,a,o,s]=this.revertToA?[this.b,this.a,n.fromB,n.toB,n.fromA,n.toA]:[this.a,this.b,n.fromA,n.toA,n.fromB,n.toB],c=t.state.sliceDoc(i,Math.max(i,a-1));i!=a&&s<=r.state.doc.length&&(c+=t.state.lineBreak),r.dispatch({changes:{from:o,to:Math.min(r.state.doc.length,s),insert:c},userEvent:`revert`}),e.preventDefault()}}destroy(){this.a.destroy(),this.b.destroy(),this.measuring>-1&&(this.dom.ownerDocument.defaultView||window).cancelAnimationFrame(this.measuring),this.dom.remove()}};function _A(e){let t=e.nextSibling;return e.remove(),t}var vA=new class extends Xl{constructor(){super(...arguments),this.elementClass=`cm-deletedLineGutter`}},yA=Ll.low(Zl({class:`cm-changeGutter`,markers:e=>e.plugin(Uk)?.gutter||$l.empty,widgetMarker:(e,t)=>t instanceof wA?vA:null}));function bA(e){let t=typeof e.original==`string`?Hl.of(e.original.split(/\r?\n/)):e.original,n=e.diffConfig||Hk;return[Ll.low(Uk),kA,pA,Yl.editorAttributes.of({class:`cm-merge-b`}),jk.of((e,t)=>{let r=t.effects.find(e=>e.is(xA));return r&&(e=Pk.updateA(e,r.value.doc,t.startState.doc,r.value.changes,n)),t.docChanged&&(e=Pk.updateB(e,t.state.field(SA),t.newDoc,t.changes,n)),e}),kk.of({highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1,syntaxHighlightDeletions:e.syntaxHighlightDeletions!==!1,syntaxHighlightDeletionsMaxLength:3e3,mergeControls:e.mergeControls??!0,overrideChunk:e.allowInlineDiffs?FA:void 0,side:`b`}),SA.init(()=>t),e.gutter===!1?[]:yA,e.collapseUnchanged?uA(e.collapseUnchanged):[],Mk.init(e=>Pk.build(t,e.doc,n))]}var xA=Kl.define(),SA=Bl.define({create:()=>Hl.empty,update(e,t){for(let n of t.effects)n.is(xA)&&(e=n.value.doc);return e}}),CA=new WeakMap,wA=class extends Il{constructor(e){super(),this.buildDOM=e,this.dom=null}eq(e){return this.dom==e.dom}toDOM(e){return this.dom||=this.buildDOM(e)}};function TA(e,t,n){let r=CA.get(t.changes);if(r)return r;let i=Ul.widget({block:!0,side:-1,widget:new wA(r=>{let{highlightChanges:i,syntaxHighlightDeletions:a,syntaxHighlightDeletionsMaxLength:o,mergeControls:s}=e.facet(kk),c=document.createElement(`div`);if(c.className=`cm-deletedChunk`,s){let t=c.appendChild(document.createElement(`div`));t.className=`cm-chunkButtons`;let n=e=>{e.preventDefault(),EA(r,r.posAtDOM(c))},i=e=>{e.preventDefault(),DA(r,r.posAtDOM(c))};if(typeof s==`function`)t.appendChild(s(`accept`,n)),t.appendChild(s(`reject`,i));else{let r=t.appendChild(document.createElement(`button`));r.name=`accept`,r.textContent=e.phrase(`Accept`),r.onmousedown=n;let a=t.appendChild(document.createElement(`button`));a.name=`reject`,a.textContent=e.phrase(`Reject`),a.onmousedown=i}}if(n||t.fromA>=t.toA)return c;let l=r.state.field(SA).sliceString(t.fromA,t.endA),u=a&&e.facet(eu),d=h(),f=t.changes,p=0,m=!1;function h(){let e=c.appendChild(document.createElement(`div`));return e.className=`cm-deletedLine`,e.appendChild(document.createElement(`del`))}function g(e,t,n){for(let r=e;r<t;){if(l.charAt(r)==`
|
|
28
28
|
`){d.firstChild||d.appendChild(document.createElement(`br`)),d=h(),r++;continue}let e=t,a=n+(m?` cm-deletedText`:``),o=!1,s=l.indexOf(`
|
|
29
|
-
`,r);if(s>-1&&s<t&&(e=s),i&&p<f.length){let t=Math.max(0,m?f[p].toA:f[p].fromA);t<=e&&(e=t,m&&p++,o=!0)}if(e>r){let t=document.createTextNode(l.slice(r,e));if(a){let e=d.appendChild(document.createElement(`span`));e.className=a,e.appendChild(t)}else d.appendChild(t);r=e}o&&(m=!m)}}if(u&&t.toA-t.fromA<=o){let t=u.parser.parse(l),n=0;Vl(t,{style:t=>tu(e,t)},(e,t,r)=>{e>n&&g(n,e,``),g(e,t,r),n=t}),g(n,l.length,``)}else g(0,l.length,``);return d.firstChild||d.appendChild(document.createElement(`br`)),c})});return CA.set(t.changes,i),i}function EA(e,t){let{state:n}=e,r=t??n.selection.main.head,i=e.state.field(Mk).find(e=>e.fromB<=r&&e.endB>=r);if(!i)return!1;let a=e.state.sliceDoc(i.fromB,Math.max(i.fromB,i.toB-1)),o=e.state.field(SA);i.fromB!=i.toB&&i.toA<=o.length&&(a+=e.state.lineBreak);let s=Rl.of({from:i.fromA,to:Math.min(o.length,i.toA),insert:a},o.length);return e.dispatch({effects:xA.of({doc:s.apply(o),changes:s}),userEvent:`accept`}),!0}function DA(e,t){let{state:n}=e,r=t??n.selection.main.head,i=n.field(Mk).find(e=>e.fromB<=r&&e.endB>=r);if(!i)return!1;let a=n.field(SA).sliceString(i.fromA,Math.max(i.fromA,i.toA-1));return i.fromA!=i.toA&&i.toB<=n.doc.length&&(a+=n.lineBreak),e.dispatch({changes:{from:i.fromB,to:Math.min(n.doc.length,i.toB),insert:a},userEvent:`revert`}),!0}function OA(e){let t=new Wl;for(let n of e.field(Mk)){let r=e.facet(kk).overrideChunk&&jA(e,n);t.add(n.fromB,n.fromB,TA(e,n,!!r))}return t.finish()}var kA=Bl.define({create:e=>OA(e),update(e,t){return t.state.field(Mk,!1)==t.startState.field(Mk,!1)?e:OA(t.state)},provide:e=>Yl.decorations.from(e)}),AA=new WeakMap;function jA(e,t){let n=AA.get(t);if(n!==void 0)return n;n=null;let r=e.field(SA),i=e.doc,a=r.lineAt(t.endA).number-r.lineAt(t.fromA).number+1,o=i.lineAt(t.endB).number-i.lineAt(t.fromB).number+1;abort:if(a==o&&a<10){let e=[],i=0,o=t.fromA,s=t.fromB;for(let n of t.changes){if(n.fromA<n.toA){i+=n.toA-n.fromA;let t=r.sliceString(o+n.fromA,o+n.toA);if(/\n/.test(t))break abort;e.push(Ul.widget({widget:new MA(t),side:-1}).range(s+n.fromB))}n.fromB<n.toB&&e.push(Jk.range(s+n.fromB,s+n.toB))}i<t.endA-t.fromA-a*2&&(n=e)}return AA.set(t,n),n}var MA=class extends Il{constructor(e){super(),this.text=e}eq(e){return this.text==e.text}toDOM(e){let t=document.createElement(`del`);return t.className=`cm-deletedText`,t.textContent=this.text,t}},NA=new class extends Xl{constructor(){super(...arguments),this.elementClass=`cm-inlineChangedLineGutter`}},PA=Ul.line({class:`cm-inlineChangedLine`});function FA(e,t,n,r){let i=jA(e,t),a=0;if(!i)return!1;for(let o=e.doc.lineAt(t.fromB);;){for(r&&r.add(o.from,o.from,NA),n.add(o.from,o.from,PA);a<i.length&&i[a].to<=o.to;){let e=i[a++];n.add(e.from,e.to,e.value)}if(o.to>=t.endB)break;o=e.doc.lineAt(o.to+1)}return!0}var IA=q({settings:{background:`var(--background)`,gutterBackground:`var(--muted)`}}),LA=D({settings:{background:`var(--background)`,gutterBackground:`var(--muted)`}}),RA=Yl.theme({".cm-deletedChunk .cm-chunkButtons":{display:`flex`,gap:`0.25rem`},".cm-deletedChunk .cm-chunkButtons button[data-slot='button']":{margin:`0`,border:`1px solid transparent`,borderRadius:`min(var(--radius-md), 10px)`,color:`var(--primary-foreground)`},".cm-deletedChunk .cm-chunkButtons button[data-slot='button'][data-variant='destructive']":{color:`var(--destructive)`}});function zA({addControl:e,nextId:t,removeControl:n,root:r}){return(i,a)=>{let o=document.createElement(`span`);o.className=`inline-flex`;let s=t();return e({id:s,host:o,type:i,action:a}),queueMicrotask(()=>{r.contains(o)||n(s)}),o}}function BA(e){let t=(0,$.c)(33),{oldContent:n,newContent:r,layout:i,conflictMode:a,previewMode:o,oursOverride:s,onResolve:c,onAbort:l}=e,{_:u}=an(),d=s??r,f=(0,Q.useRef)(null),p=(0,Q.useRef)(null),m=(0,Q.useRef)(0),{resolvedTheme:h}=Ln(),g=(0,Q.useRef)(c),_=(0,Q.useRef)(l),[v,y]=(0,Q.useState)(null),b;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(b=[],t[0]=b):b=t[0];let[x,S]=(0,Q.useState)(b),C=JO(a===!0),w;t[1]!==l||t[2]!==c?(w=()=>{g.current=c,_.current=l},t[1]=l,t[2]=c,t[3]=w):w=t[3],(0,Q.useEffect)(w);let T,E;t[4]!==a||t[5]!==d||t[6]!==i||t[7]!==n||t[8]!==o||t[9]!==h?(T=()=>{let e=f.current;if(!e)return;S([]);let t=new Map,r=!1,s=e=>{r||!t.delete(e)||S(t=>t.filter(t=>t.id!==e))},c=new MutationObserver(()=>{for(let[n,r]of t)e.contains(r)||s(n)});c.observe(e,{childList:!0,subtree:!0});let l=h===`dark`?IA:LA,u=[Yl.editable.of(!1),zl.readOnly.of(!0)],g=[mu,nu(),...u,l,Yl.lineWrapping];if(p.current&&=(p.current.destroy(),null),o)p.current=new Yl({doc:d,extensions:g,parent:e}),y(null);else if(a){let i=zA({addControl:e=>{r||(t.set(e.id,e.host),S(t=>[...t,e]))},nextId:()=>(m.current+=1,m.current),removeControl:s,root:e}),a=new Yl({doc:d,extensions:[mu,nu(),Yl.editable.of(!1),l,RA,Yl.lineWrapping,bA({original:n,highlightChanges:!0,gutter:!0,mergeControls:i,collapseUnchanged:{margin:3,minSize:4}}),Yl.updateListener.of(e=>{let t=Nk(e.state);y(t?t.chunks.length:0)})],parent:e});p.current=a;let o=Nk(a.state);y(o?o.chunks.length:0)}else i===`split`?p.current=new gA({a:{doc:n,extensions:g},b:{doc:d,extensions:g},parent:e,highlightChanges:!0,gutter:!0,collapseUnchanged:{margin:3,minSize:4}}):p.current=new Yl({doc:d,extensions:[...g,bA({original:n,highlightChanges:!0,gutter:!0,mergeControls:!1,collapseUnchanged:{margin:3,minSize:4}})],parent:e});return()=>{r=!0,c.disconnect(),p.current&&=(p.current.destroy(),null)}},E=[n,d,i,h,a,o],t[4]=a,t[5]=d,t[6]=i,t[7]=n,t[8]=o,t[9]=h,t[10]=T,t[11]=E):(T=t[10],E=t[11]),(0,Q.useEffect)(T,E);let D;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(D=function(){let e=p.current;!e||!(e instanceof Yl)||g.current?.(e.state.doc.toString())},t[12]=D):D=t[12];let O=D,k;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(k=function(){let e=p.current;!e||!(e instanceof Yl)||xe(e)},t[13]=k):k=t[13];let A=k,j=v===0,M;t[14]!==u||t[15]!==v?(M=v===null?``:v===0?u({id:`lPzyrU`}):Yc._({id:`8FqTCr`,values:{chunksRemaining:v}}),t[14]=u,t[15]=v,t[16]=M):M=t[16];let N=M,P;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,Z.jsx)(`div`,{ref:f,className:`diff-view min-h-0 flex-1 overflow-y-auto subtle-scrollbar`}),t[17]=P):P=t[17];let F;if(t[18]!==u||t[19]!==x){let e;t[21]===u?e=t[22]:(e=e=>(0,Sd.createPortal)((0,Z.jsx)(X,{type:`button`,variant:e.type===`accept`?`default`:`destructive`,size:`xs`,onClick:t=>{e.action(t.nativeEvent)},children:e.type===`accept`?u({id:`g3UF2V`}):u({id:`1t_NnN`})}),e.host,e.id),t[21]=u,t[22]=e),F=x.map(e),t[18]=u,t[19]=x,t[20]=F}else F=t[20];let I;t[23]!==j||t[24]!==C||t[25]!==a||t[26]!==N||t[27]!==l||t[28]!==c?(I=a&&(0,Z.jsxs)(`div`,{ref:C,className:`flex items-center justify-between gap-2 px-3 py-2 border-t shrink-0`,children:[(0,Z.jsx)(`span`,{className:`text-xs ${j?`text-emerald-600 dark:text-emerald-400`:`text-muted-foreground`}`,children:N}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[l&&(0,Z.jsx)(X,{className:`uppercase font-mono`,variant:`ghost`,size:`sm`,onClick:l,children:(0,Z.jsx)(J,{id:`XyOUTJ`})}),(0,Z.jsx)(X,{className:`uppercase font-mono`,variant:`outline`,size:`sm`,onClick:A,children:`Undo`}),c&&(0,Z.jsx)(X,{variant:`default`,size:`sm`,disabled:!j,onClick:O,children:(0,Z.jsx)(J,{id:`Lcehxn`})})]})]}),t[23]=j,t[24]=C,t[25]=a,t[26]=N,t[27]=l,t[28]=c,t[29]=I):I=t[29];let L;return t[30]!==I||t[31]!==F?(L=(0,Z.jsxs)(`div`,{className:`flex flex-col h-full`,children:[P,F,I]}),t[30]=I,t[31]=F,t[32]=L):L=t[32],L}async function VA(e,t,n){try{let r={file:e,strategy:t};n!==void 0&&(r.content=n);let i=await fetch(`/api/sync/resolve-conflict`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(r)});if(i.ok)return{ok:!0};let a;try{let e=await i.json();typeof e.detail==`string`?a=e.detail:typeof e.title==`string`&&(a=e.title)}catch{}return{ok:!1,detail:a}}catch(n){let r=n instanceof Error?n.message:String(n);return console.warn(JSON.stringify({event:`conflict-resolve-dispatch-failed`,file:e,strategy:t,detail:r})),{ok:!1,detail:r}}}async function HA(e,t){return VA(e,`content`,t)}async function UA(e){return VA(e,`mine`)}async function WA(e){return VA(e,`theirs`)}async function GA(e){return VA(e,`delete`)}async function KA(e){try{let t=await fetch(`/api/sync/conflict-content?file=${encodeURIComponent(e)}&source=ytext`);if(!t.ok){let n;try{let e=await t.json();typeof e.detail==`string`?n=e.detail:typeof e.title==`string`&&(n=e.title)}catch{}return console.warn(JSON.stringify({event:`conflict-content-fetch-failed`,file:e,status:t.status,detail:n})),null}let n=await t.json(),r=n.kind===`delete-modify`||n.kind===`modify-delete`||n.kind===`both-modified`?n.kind:`both-modified`;return n.kind!==r&&console.warn(JSON.stringify({event:`conflict-kind-missing-fallback`,file:e,receivedKind:n.kind??null})),{base:n.base??``,ours:n.ours??``,theirs:n.theirs??``,kind:r}}catch(t){return console.warn(JSON.stringify({event:`conflict-content-fetch-failed`,file:e,status:null,detail:t instanceof Error?t.message:String(t)})),null}}function qA(e){let t=(0,$.c)(86),{docName:n}=e,{_:r}=an(),{conflicts:i,loading:a}=Ua(),o;if(t[0]!==i||t[1]!==n){let e;t[3]===n?e=t[4]:(e=e=>bl(e.file)===n,t[3]=n,t[4]=e),o=i.find(e),t[0]=i,t[1]=n,t[2]=o}else o=t[2];let s=o,c=s?.file??`${n}.md`,[l,u]=(0,Q.useState)(null),[d,f]=(0,Q.useState)(!1),[p,m]=(0,Q.useState)(!1),h=JO(l?.kind===`delete-modify`||l?.kind===`modify-delete`),g,_;t[5]===n?(g=t[6],_=t[7]):(g=()=>(console.warn(JSON.stringify({event:`editor-area-swap-to-diffview`,"doc.name":n})),()=>{console.warn(JSON.stringify({event:`editor-area-swap-from-diffview`,"doc.name":n}))}),_=[n],t[5]=n,t[6]=g,t[7]=_),(0,Q.useEffect)(g,_);let v=a||s===void 0,y,b;t[8]!==v||t[9]!==c?(y=()=>{if(v)return;let e=!1;return u(null),f(!1),KA(c).then(t=>{e||(t===null?f(!0):u(t))}),()=>{e=!0}},b=[c,v],t[8]=v,t[9]=c,t[10]=y,t[11]=b):(y=t[10],b=t[11]),(0,Q.useEffect)(y,b);let x;t[12]!==r||t[13]!==c?(x=async function(e){let t=await HA(c,e);t.ok||bs.error(r({id:`K-h9cT`,values:{filePath:c}}),{description:t.detail})},t[12]=r,t[13]=c,t[14]=x):x=t[14];let S=x,C;t[15]!==r||t[16]!==c?(C=async function(e){m(!0);let t=await e(c);t.ok||(m(!1),bs.error(r({id:`jPUPvG`,values:{filePath:c}}),{description:t.detail}))},t[15]=r,t[16]=c,t[17]=C):C=t[17];let w=C;if(d){let e;return t[18]===c?e=t[19]:(e=(0,Z.jsx)(`div`,{className:`flex h-full items-center justify-center p-6 text-sm text-muted-foreground`,children:(0,Z.jsx)(J,{id:`ajz9F8`,values:{filePath:c}})}),t[18]=c,t[19]=e),e}if(l===null){let e;return t[20]===c?e=t[21]:(e=(0,Z.jsx)(`div`,{className:`flex h-full items-center justify-center p-6 text-sm text-muted-foreground`,children:(0,Z.jsx)(J,{id:`DF1MtZ`,values:{filePath:c}})}),t[20]=c,t[21]=e),e}if(l.kind===`delete-modify`){let e;t[22]===l.theirs?e=t[23]:(e=(0,Z.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,Z.jsx)(BA,{oldContent:``,newContent:l.theirs,layout:`unified`,previewMode:!0})}),t[22]=l.theirs,t[23]=e);let n;t[24]===c?n=t[25]:(n={filePath:c},t[24]=c,t[25]=n);let r;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(r={0:(0,Z.jsx)(`span`,{className:`font-medium text-foreground`})},t[26]=r):r=t[26];let i;t[27]===n?i=t[28]:(i=(0,Z.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,Z.jsx)(J,{id:`V48OUT`,values:n,components:r})}),t[27]=n,t[28]=i);let a;t[29]===w?a=t[30]:(a=()=>void w(GA),t[29]=w,t[30]=a);let o;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Z.jsx)(J,{id:`Vlc75q`}),t[31]=o):o=t[31];let s;t[32]!==p||t[33]!==a?(s=(0,Z.jsx)(X,{type:`button`,variant:`destructive`,disabled:p,onClick:a,children:o}),t[32]=p,t[33]=a,t[34]=s):s=t[34];let u;t[35]===w?u=t[36]:(u=()=>void w(WA),t[35]=w,t[36]=u);let d;t[37]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Z.jsx)(J,{id:`3mFsc3`}),t[37]=d):d=t[37];let f;t[38]!==p||t[39]!==u?(f=(0,Z.jsx)(X,{type:`button`,variant:`default`,disabled:p,onClick:u,children:d}),t[38]=p,t[39]=u,t[40]=f):f=t[40];let m;t[41]!==s||t[42]!==f?(m=(0,Z.jsxs)(`div`,{className:`flex shrink-0 gap-3`,children:[s,f]}),t[41]=s,t[42]=f,t[43]=m):m=t[43];let g;t[44]!==h||t[45]!==i||t[46]!==m?(g=(0,Z.jsxs)(`div`,{ref:h,className:`flex flex-shrink-0 flex-wrap items-center justify-between gap-x-6 gap-y-3 border-t px-6 py-4`,children:[i,m]}),t[44]=h,t[45]=i,t[46]=m,t[47]=g):g=t[47];let _;return t[48]!==g||t[49]!==e?(_=(0,Z.jsxs)(`div`,{className:`flex h-full flex-col bg-background`,children:[e,g]}),t[48]=g,t[49]=e,t[50]=_):_=t[50],_}if(l.kind===`modify-delete`){let e;t[51]===l.ours?e=t[52]:(e=(0,Z.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,Z.jsx)(BA,{oldContent:``,newContent:l.ours,layout:`unified`,previewMode:!0})}),t[51]=l.ours,t[52]=e);let n;t[53]===c?n=t[54]:(n={filePath:c},t[53]=c,t[54]=n);let r;t[55]===Symbol.for(`react.memo_cache_sentinel`)?(r={0:(0,Z.jsx)(`span`,{className:`font-medium text-foreground`})},t[55]=r):r=t[55];let i;t[56]===n?i=t[57]:(i=(0,Z.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,Z.jsx)(J,{id:`EhDLBx`,values:n,components:r})}),t[56]=n,t[57]=i);let a;t[58]===w?a=t[59]:(a=()=>void w(UA),t[58]=w,t[59]=a);let o;t[60]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Z.jsx)(J,{id:`0NA4b3`}),t[60]=o):o=t[60];let s;t[61]!==p||t[62]!==a?(s=(0,Z.jsx)(X,{type:`button`,variant:`default`,disabled:p,onClick:a,children:o}),t[61]=p,t[62]=a,t[63]=s):s=t[63];let u;t[64]===w?u=t[65]:(u=()=>void w(GA),t[64]=w,t[65]=u);let d;t[66]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Z.jsx)(J,{id:`qSxaOz`}),t[66]=d):d=t[66];let f;t[67]!==p||t[68]!==u?(f=(0,Z.jsx)(X,{type:`button`,variant:`destructive`,disabled:p,onClick:u,children:d}),t[67]=p,t[68]=u,t[69]=f):f=t[69];let m;t[70]!==s||t[71]!==f?(m=(0,Z.jsxs)(`div`,{className:`flex shrink-0 gap-3`,children:[s,f]}),t[70]=s,t[71]=f,t[72]=m):m=t[72];let g;t[73]!==h||t[74]!==i||t[75]!==m?(g=(0,Z.jsxs)(`div`,{ref:h,className:`flex flex-shrink-0 flex-wrap items-center justify-between gap-x-6 gap-y-3 border-t px-6 py-4`,children:[i,m]}),t[73]=h,t[74]=i,t[75]=m,t[76]=g):g=t[76];let _;return t[77]!==g||t[78]!==e?(_=(0,Z.jsxs)(`div`,{className:`flex h-full flex-col bg-background`,children:[e,g]}),t[77]=g,t[78]=e,t[79]=_):_=t[79],_}let T;t[80]===S?T=t[81]:(T=e=>void S(e),t[80]=S,t[81]=T);let E;return t[82]!==l.ours||t[83]!==l.theirs||t[84]!==T?(E=(0,Z.jsx)(BA,{oldContent:l.theirs,newContent:l.ours,layout:`unified`,conflictMode:!0,onResolve:T}),t[82]=l.ours,t[83]=l.theirs,t[84]=T,t[85]=E):E=t[85],E}function JA(e){let t=(0,$.c)(2),{docName:n,provider:r,children:i}=e;(0,Q.use)(Ht(n,r));let a;return t[0]===i?a=t[1]:(a=(0,Z.jsx)(Z.Fragment,{children:i}),t[0]=i,t[1]=a),a}var YA=`__back-nav__`;function XA(e){return e instanceof Me||e instanceof St||e instanceof Ee||e instanceof et||e instanceof Ft||e instanceof ae?e.docName:null}function ZA(e){return e instanceof Me||e instanceof St}function QA(e){if(e instanceof Me){let t=e.docName;return{title:Yc._({id:`Jejur6`}),summary:Yc._({id:`jSY41h`,values:{docName:t}})}}if(e instanceof St){let t=e.docName;return{title:Yc._({id:`V7QxyT`}),summary:Yc._({id:`xG4tb6`,values:{docName:t}})}}if(e instanceof Ee){let t=e.docName;return{title:Yc._({id:`1di5fu`}),summary:Yc._({id:`PQCdtv`,values:{docName:t}})}}if(e instanceof et){let t=e.docName;return{title:Yc._({id:`wvbc1r`}),summary:Yc._({id:`IX7-sq`,values:{docName:t}})}}if(e instanceof Ft)return{title:Yc._({id:`Gfr4fu`}),summary:Yc._({id:`UW2Fg3`})};if(e instanceof ae){let t=e.docName;return{title:Yc._({id:`vv7kpg`}),summary:Yc._({id:`mdKFEy`,values:{docName:t}})}}let t=e instanceof Error&&e.message?e.message:Yc._({id:`W5A0Ly`});return{title:Yc._({id:`29VNqC`}),summary:t}}function $A(e){let t=(0,$.c)(31),{error:n,resetErrorBoundary:r,activeDocName:i,previousDocName:a,onNavigateBack:o}=e,s;t[0]===n?s=t[1]:(s=QA(n),t[0]=n,t[1]=s);let{title:c,summary:l}=s,u=!!a&&!!o,d=(0,Q.useRef)(null),f=typeof window<`u`?window.okDesktop:void 0,p=f&&ZA(n)?f:null,m,h;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(m=()=>{d.current?.focus()},h=[],t[2]=m,t[3]=h):(m=t[2],h=t[3]),(0,Q.useEffect)(m,h);let g;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,Z.jsx)(CS,{size:80,variant:`sleeping`}),t[4]=g):g=t[4];let _;t[5]===c?_=t[6]:(_=(0,Z.jsx)(`h2`,{id:`document-error-title`,className:`text-2xl font-light tracking-tighter text-balance`,children:c}),t[5]=c,t[6]=_);let v;t[7]===l?v=t[8]:(v=(0,Z.jsx)(`p`,{className:`max-w-sm text-sm text-muted-foreground`,children:l}),t[7]=l,t[8]=v);let y;t[9]!==_||t[10]!==v?(y=(0,Z.jsxs)(`div`,{className:`flex flex-col items-center gap-1`,children:[_,v]}),t[9]=_,t[10]=v,t[11]=y):y=t[11];let b;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,Z.jsx)(J,{id:`KDw4GX`}),t[12]=b):b=t[12];let x;t[13]===r?x=t[14]:(x=(0,Z.jsx)(X,{ref:d,variant:`default`,onClick:r,children:b}),t[13]=r,t[14]=x);let S;t[15]===p?S=t[16]:(S=p?(0,Z.jsx)(X,{variant:`secondary`,onClick:()=>{Fg(p).then(tj).catch(ej)},children:(0,Z.jsx)(J,{id:`uaUc6t`})}):null,t[15]=p,t[16]=S);let C;t[17]!==i||t[18]!==u||t[19]!==n||t[20]!==o||t[21]!==a||t[22]!==r?(C=u?(0,Z.jsx)(X,{variant:`ghost`,className:`font-mono uppercase`,onClick:()=>{!a||!o||(ut(XA(n)??i),o(a),r(YA))},children:(0,Z.jsx)(J,{id:`CKyk7Q`})}):null,t[17]=i,t[18]=u,t[19]=n,t[20]=o,t[21]=a,t[22]=r,t[23]=C):C=t[23];let w;t[24]!==S||t[25]!==C||t[26]!==x?(w=(0,Z.jsxs)(`div`,{className:`mt-1 flex gap-2`,children:[x,S,C]}),t[24]=S,t[25]=C,t[26]=x,t[27]=w):w=t[27];let T;return t[28]!==w||t[29]!==y?(T=(0,Z.jsxs)(`div`,{role:`alert`,"aria-labelledby":`document-error-title`,"data-slot":`document-error-boundary`,className:`flex h-full flex-col items-center justify-center gap-8 p-8 text-center`,children:[g,y,w]}),t[28]=w,t[29]=y,t[30]=T):T=t[30],T}function ej(){}function tj(e){e.ok||bs.error(e.message,{id:`server-restart-error`,duration:1/0})}function nj(e){let t=(0,$.c)(17),{activeDocName:n,previousDocName:r,onNavigateBack:i,onRecycle:a,children:o}=e,s;t[0]!==n||t[1]!==i||t[2]!==r?(s=e=>(0,Z.jsx)($A,{...e,activeDocName:n,previousDocName:r,onNavigateBack:i}),t[0]=n,t[1]=i,t[2]=r,t[3]=s):s=t[3];let c;t[4]===n?c=t[5]:(c=[n],t[4]=n,t[5]=c);let l;t[6]!==n||t[7]!==a?(l=e=>{if(e.reason===`imperative-api`){if(Array.isArray(e.args)&&e.args[0]===YA){console.warn(`[DocumentErrorBoundary] back-nav reset (no recycle)`);return}a(n),console.warn(`[DocumentErrorBoundary] retry recycled ${n}`)}else console.warn(`[DocumentErrorBoundary] reset by key change (${e.prev?.[0]} → ${e.next?.[0]})`)},t[6]=n,t[7]=a,t[8]=l):l=t[8];let u;t[9]===n?u=t[10]:(u=e=>{console.error(`[DocumentErrorBoundary] rendered fallback for ${n}: ${QA(e).title}`,e)},t[9]=n,t[10]=u);let d;return t[11]!==o||t[12]!==s||t[13]!==c||t[14]!==l||t[15]!==u?(d=(0,Z.jsx)(g,{fallbackRender:s,resetKeys:c,onReset:l,onError:u,children:o}),t[11]=o,t[12]=s,t[13]=c,t[14]=l,t[15]=u,t[16]=d):d=t[16],d}function rj(e){let t=e.document.getText(`source`).toString(),{map:n,parseError:r}=Mr(t);return{map:n,keys:Ur(t),parseError:r}}function ij(e){let t=(0,$.c)(21),{provider:n}=e,r;t[0]===n?r=t[1]:(r=()=>rj(n),t[0]=n,t[1]=r);let[i,a]=(0,Q.useState)(r),o,s;t[2]===n?(o=t[3],s=t[4]):(o=()=>{let e=tr(n);a(e.current());let t=e.subscribe(e=>{a(e)});return()=>{t(),e.dispose()}},s=[n],t[2]=n,t[3]=o,t[4]=s),(0,Q.useEffect)(o,s);let c;t[5]===i.map.icon?c=t[6]:(c=Xe(i.map.icon),t[5]=i.map.icon,t[6]=c);let l=c,u;t[7]===i.map.cover?u=t[8]:(u=mt(i.map.cover),t[7]=i.map.cover,t[8]=u);let d=u,f=d.kind===`url`||d.kind===`path`,p=l.kind!==`unsupported`;if(!f&&!p)return null;let m=f?`true`:`false`,h=p?`true`:`false`,g;t[9]!==d||t[10]!==f?(g=f?(0,Z.jsx)(aj,{cover:d}):null,t[9]=d,t[10]=f,t[11]=g):g=t[11];let _;t[12]!==f||t[13]!==p||t[14]!==l?(_=p?(0,Z.jsx)(oj,{icon:l,hasCover:f}):null,t[12]=f,t[13]=p,t[14]=l,t[15]=_):_=t[15];let v;return t[16]!==m||t[17]!==h||t[18]!==g||t[19]!==_?(v=(0,Z.jsxs)(`div`,{className:`page-header editor-content-aligned`,"data-has-cover":m,"data-has-icon":h,"aria-hidden":`true`,"data-testid":`page-header`,children:[g,_]}),t[16]=m,t[17]=h,t[18]=g,t[19]=_,t[20]=v):v=t[20],v}function aj(e){let t=(0,$.c)(2),{cover:n}=e,r;return t[0]===n.value?r=t[1]:(r=(0,Z.jsx)(`div`,{className:`page-header-cover`,"data-testid":`page-header-cover`,children:(0,Z.jsx)(`img`,{src:n.value,alt:``,draggable:!1,loading:`lazy`,referrerPolicy:`no-referrer`,className:`page-header-cover-img`})}),t[0]=n.value,t[1]=r),r}function oj(e){let t=(0,$.c)(9),{icon:n,hasCover:r}=e,i=r?`page-header-icon page-header-icon--with-cover`:`page-header-icon`;if(n.kind===`emoji`){let e;return t[0]!==n.value||t[1]!==i?(e=(0,Z.jsx)(`span`,{className:i,"data-testid":`page-header-icon`,"data-kind":`emoji`,children:n.value}),t[0]=n.value,t[1]=i,t[2]=e):e=t[2],e}let a;t[3]===n.value?a=t[4]:(a=(0,Z.jsx)(`img`,{src:n.value,alt:``,draggable:!1,referrerPolicy:`no-referrer`,className:`page-header-icon-img`}),t[3]=n.value,t[4]=a);let o;return t[5]!==n.kind||t[6]!==i||t[7]!==a?(o=(0,Z.jsx)(`span`,{className:i,"data-testid":`page-header-icon`,"data-kind":n.kind,children:a}),t[5]=n.kind,t[6]=i,t[7]=a,t[8]=o):o=t[8],o}var sj=(0,Q.lazy)(async()=>({default:(await n(async()=>{let{ManagedArtifactProperties:e}=await import(`./ManagedArtifactProperties-70ooWd7O.js`);return{ManagedArtifactProperties:e}},__vite__mapDeps([84,1,41,2,42,43,11,44,45,46,47,48,49,50,51,20,15,13,7,16,10,3,52,53,37,12,6,4,54,17,55,56,19,57,58,59,60,31,32,33,34,35,61,62,63,64,36,65,66,67,73,75,18,85,74,86,87,39,82]),import.meta.url)).ManagedArtifactProperties})),cj=yl(`LARGE_DOC_CHAR_THRESHOLD`,5e5);function lj(e){let t=e.threshold??cj;return e.ytextLength>t?{renderSource:e.isSourceMode||e.visitedSource,renderVisual:!e.isSourceMode||e.visitedVisual,isLarge:!0}:{renderSource:!0,renderVisual:!0,isLarge:!1}}function uj(e){return e.hasEmittedFirstToggle||!e.isLarge?!1:e.renderSource&&e.renderVisual}var dj=yl(`ACTIVITY_MOUNT_LIMIT`,3);function fj(){return n(()=>import(`./SourceEditor-DXcSGXCG.js`),__vite__mapDeps([88,1,41,2,42,43,11,44,45,46,47,48,49,50,51,20,15,13,7,16,10,3,52,53,37,12,6,4,54,17,55,56,19,57,58,59,60,31,32,33,34,35,61,62,63,64,36,65,66,67,89,21,87,83]),import.meta.url)}var pj=(0,Q.lazy)(async()=>({default:(await fj()).SourceEditor}));function mj(e,t,n){if(n<=0)return[];let r=e.filter(e=>!He(e.docName)),i=[...r].sort((e,t)=>t.lastAccessedAt-e.lastAccessedAt).slice(0,n);if(t===null||i.some(e=>e.docName===t))return i;let a=r.find(e=>e.docName===t);return a?[...i.slice(0,n-1),a]:i}function hj(e,t){return t.kind===`idle`?null:t.kind===`failed`&&t.failedDocNames.includes(e)?{kind:`failed`,title:Yc._({id:`MTs6g3`}),summary:t.reason===`clear-data-timeout`?Yc._({id:`Sc1bKE`,values:{docName:e}}):Yc._({id:`ovIGrT`,values:{docName:e}}),actionLabel:Yc._({id:`HpK_8d`})}:t.kind===`recovering`&&t.docNames.includes(e)?{kind:`recovering`,title:Yc._({id:`cF9DyA`}),summary:t.phase===`clearing-local-cache`?Yc._({id:`bmC18N`,values:{docName:e}}):Yc._({id:`pAgkuZ`,values:{docName:e}})}:null}function gj(e){let t=(0,$.c)(2),n;return t[0]===e?n=t[1]:(n=(0,Z.jsx)(vl,{name:`activity-pool`,children:(0,Z.jsx)(_j,{...e})}),t[0]=e,t[1]=n),n}function _j(e){let t=(0,$.c)(15),{activeDocName:n,isSourceMode:r,editorPlaceholder:i,previousDocName:a,onNavigateBack:o,onRecycle:s}=e,{poolEntries:c,serverRestartRecovery:l}=vt(),{pages:u,loading:d}=ea(),f=mj(c,n,dj),p=(0,Q.useRef)(``),m=f.map(vj).join(`,`),h=(0,Q.useRef)(c),g,_;t[0]===c?(g=t[1],_=t[2]):(g=()=>{h.current=c},_=[c],t[0]=c,t[1]=g,t[2]=_),(0,Q.useLayoutEffect)(g,_),(0,Q.useLayoutEffect)(()=>{if(p.current===m)return;let e=p.current?p.current.split(`,`):[],t=m?m.split(`,`):[],r=e.filter(e=>!t.includes(e)),i=t.filter(t=>!e.includes(t));for(let e of r)de(e);for(let e of i){let t=h.current.find(t=>t.docName===e)?.poolEventId;E(e,t&&t.length>0?t:crypto.randomUUID())}_l(`ok/activity/mount-list-change`,{active:n,mounted:t,evicted:r}),p.current=m,B(t)},[m,n]);let v;t[3]!==n||t[4]!==i||t[5]!==r||t[6]!==d||t[7]!==o||t[8]!==s||t[9]!==u||t[10]!==a||t[11]!==l?(v=e=>(0,Z.jsx)(wj,{entry:e,isActive:e.docName===n,isSourceMode:r,editorPlaceholder:i,isNewDoc:!d&&!u.has(e.docName)&&!nr(e.docName),previousDocName:a,onNavigateBack:o,onRecycle:s,serverRestartRecovery:l},e.docName),t[3]=n,t[4]=i,t[5]=r,t[6]=d,t[7]=o,t[8]=s,t[9]=u,t[10]=a,t[11]=l,t[12]=v):v=t[12];let y=f.map(v),b;return t[13]===y?b=t[14]:(b=(0,Z.jsx)(Z.Fragment,{children:y}),t[13]=y,t[14]=b),b}function vj(e){return e.docName}function yj(e){let t=(0,$.c)(8),{isActive:n,initialScrollTop:r,children:i}=e,a=(0,Q.useRef)(null),o=(0,Q.useRef)(r??0),s,c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=()=>{let e=a.current;if(!e)return;let t=()=>{e.scrollTop>0&&(o.current=e.scrollTop)};return e.addEventListener(`scroll`,t,{passive:!0}),()=>e.removeEventListener(`scroll`,t)},c=[],t[0]=s,t[1]=c):(s=t[0],c=t[1]),(0,Q.useEffect)(s,c);let l,u;t[2]===n?(l=t[3],u=t[4]):(l=()=>{if(!n)return;let e=a.current;if(!e)return;let t=o.current;if(t===0)return;let r=performance.now(),i=!1;e.scrollTop=t,e.scrollTop===t&&e.scrollHeight>t&&_l(`ok/scroll-restore/phase1-success`,{target:t,elapsedMs:performance.now()-r});let s=!1,c=0,l=()=>{s||(s=!0,cancelAnimationFrame(c),clearTimeout(f),e.removeEventListener(`wheel`,u),e.removeEventListener(`touchstart`,u))},u=()=>l();e.addEventListener(`wheel`,u,{passive:!0}),e.addEventListener(`touchstart`,u,{passive:!0});let d=()=>{s||(e.scrollTop!==t&&e.scrollHeight>t&&(e.scrollTop=t,e.scrollTop===t&&!i&&(_l(`ok/scroll-restore/phase2-success`,{target:t,elapsedMs:performance.now()-r}),i=!0)),c=requestAnimationFrame(d))};c=requestAnimationFrame(d);let f=setTimeout(()=>{s||(e.scrollTop!==t&&e.scrollHeight>t&&_l(`ok/scroll-restore/abandoned`,{target:t,elapsedMs:performance.now()-r,scrollHeight:e.scrollHeight,finalScrollTop:e.scrollTop}),l())},2e3);return l},u=[n],t[2]=n,t[3]=l,t[4]=u),(0,Q.useLayoutEffect)(l,u);let d;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(d={overflowAnchor:`auto`},t[5]=d):d=t[5];let f;return t[6]===i?f=t[7]:(f=(0,Z.jsx)(`div`,{ref:a,"data-testid":`editor-scroll-container`,className:`editor-doc-scroll subtle-scrollbar h-full overflow-y-auto pt-14 scroll-pt-14`,style:d,children:i}),t[6]=i,t[7]=f),f}function bj(e){let t=(0,$.c)(12),{entry:n,isActive:r,isSourceMode:i,editorPlaceholder:a}=e,o=r&&i,[s,c]=(0,Q.useState)(o),l,u;if(t[0]===o?(l=t[1],u=t[2]):(l=()=>{o&&c(!0)},u=[o],t[0]=o,t[1]=l,t[2]=u),(0,Q.useEffect)(l,u),!s&&!o)return null;let d;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Z.jsx)(ix,{}),t[3]=d):d=t[3];let f=n.docName,p;t[4]===n.provider.document?p=t[5]:(p=n.provider.document.getText(`source`),t[4]=n.provider.document,t[5]=p);let m;return t[6]!==a||t[7]!==n.docName||t[8]!==n.provider||t[9]!==o||t[10]!==p?(m=(0,Z.jsx)(Q.Suspense,{fallback:d,children:(0,Z.jsx)(pj,{docName:f,ytext:p,provider:n.provider,placeholder:a,isSourceModeActive:o})}),t[6]=a,t[7]=n.docName,t[8]=n.provider,t[9]=o,t[10]=p,t[11]=m):m=t[11],m}function xj(e){let t=(0,$.c)(18),{view:n}=e,r=n.kind===`failed`,i=r?`alert`:`status`,a=!r,o;t[0]===r?o=t[1]:(o=(0,Z.jsx)(`div`,{className:`flex size-12 items-center justify-center rounded-full border bg-muted text-muted-foreground`,children:r?(0,Z.jsx)(os,{className:`size-5`,"aria-hidden":`true`}):(0,Z.jsx)(is,{className:`size-5 animate-spin`,"aria-hidden":`true`})}),t[0]=r,t[1]=o);let s;t[2]===n.title?s=t[3]:(s=(0,Z.jsx)(`h2`,{className:`text-lg font-medium`,children:n.title}),t[2]=n.title,t[3]=s);let c;t[4]===n.summary?c=t[5]:(c=(0,Z.jsx)(`p`,{className:`max-w-md text-sm text-muted-foreground`,children:n.summary}),t[4]=n.summary,t[5]=c);let l;t[6]!==s||t[7]!==c?(l=(0,Z.jsxs)(`div`,{className:`flex flex-col items-center gap-1`,children:[s,c]}),t[6]=s,t[7]=c,t[8]=l):l=t[8];let u;t[9]!==r||t[10]!==n.actionLabel?(u=r?(0,Z.jsxs)(X,{type:`button`,onClick:Sj,children:[(0,Z.jsx)(os,{className:`size-4`,"aria-hidden":`true`}),n.actionLabel]}):null,t[9]=r,t[10]=n.actionLabel,t[11]=u):u=t[11];let d;return t[12]!==i||t[13]!==a||t[14]!==o||t[15]!==l||t[16]!==u?(d=(0,Z.jsxs)(`div`,{"data-slot":`server-restart-recovery`,role:i,"aria-busy":a,className:`flex h-full flex-col items-center justify-center gap-6 p-8 text-center`,children:[o,l,u]}),t[12]=i,t[13]=a,t[14]=o,t[15]=l,t[16]=u,t[17]=d):d=t[17],d}function Sj(){return window.location.reload()}function Cj(e){let t=(0,$.c)(2),{html:n}=e,r;return t[0]===n?r=t[1]:(r=(0,Z.jsx)(`div`,{className:`tiptap-editor h-full pointer-events-none`,"aria-hidden":`true`,children:(0,Z.jsx)(`div`,{className:`tiptap ProseMirror tiptap-editor-portal-content`,dangerouslySetInnerHTML:{__html:n}})}),t[0]=n,t[1]=r),r}function wj(e){let t=(0,$.c)(53),{entry:n,isActive:r,isSourceMode:i,editorPlaceholder:a,isNewDoc:o,previousDocName:s,onNavigateBack:c,onRecycle:l,serverRestartRecovery:u}=e,d;t[0]!==n.docName||t[1]!==u?(d=hj(n.docName,u),t[0]=n.docName,t[1]=u,t[2]=d):d=t[2];let f=d,p=gw(n.docName)===`conflict`,m;t[3]===n.docName?m=t[4]:(m=()=>{let e=document.createElement(`div`);return e.setAttribute(`data-ok-editor-portal`,n.docName),e.style.display=`contents`,e},t[3]=n.docName,t[4]=m);let[h]=(0,Q.useState)(m),g=n.provider.document.getText(`source`).length,[_,v]=(0,Q.useState)(i),[y,b]=(0,Q.useState)(!i),x,S;t[5]!==i||t[6]!==_||t[7]!==y?(x=()=>{i&&!_?v(!0):!i&&!y&&b(!0)},S=[i,_,y],t[5]=i,t[6]=_,t[7]=y,t[8]=x,t[9]=S):(x=t[8],S=t[9]),(0,Q.useEffect)(x,S);let C=lj({ytextLength:g,isSourceMode:i,visitedSource:_,visitedVisual:y}),w=(0,Q.useRef)(``),T=`${C.isLarge}-${C.renderSource}-${C.renderVisual}`,E,D;t[10]!==n.docName||t[11]!==C.isLarge||t[12]!==C.renderSource||t[13]!==C.renderVisual||t[14]!==T||t[15]!==i||t[16]!==g?(E=()=>{w.current!==T&&(w.current=T,C.isLarge&&_l(`ok/activity/defer-mount`,{docName:n.docName,ytextLength:g,isSourceMode:i,renderSource:C.renderSource,renderVisual:C.renderVisual}))},D=[T,C.isLarge,C.renderSource,C.renderVisual,n.docName,g,i],t[10]=n.docName,t[11]=C.isLarge,t[12]=C.renderSource,t[13]=C.renderVisual,t[14]=T,t[15]=i,t[16]=g,t[17]=E,t[18]=D):(E=t[17],D=t[18]),(0,Q.useEffect)(E,D);let O;t[19]===n.docName?O=t[20]:(O=()=>M(n.docName),t[19]=n.docName,t[20]=O);let[k]=(0,Q.useState)(O),A=k?.html??null,[j,N]=(0,Q.useState)(!1),P,F;t[21]!==n.docName||t[22]!==C.isLarge||t[23]!==C.renderSource||t[24]!==C.renderVisual||t[25]!==j||t[26]!==i||t[27]!==g?(P=()=>{uj({isLarge:C.isLarge,renderSource:C.renderSource,renderVisual:C.renderVisual,hasEmittedFirstToggle:j})&&(_l(`ok/cold/first-toggle`,{docName:n.docName,mountId:_e(n.docName),ytextLength:g,modeEnteredFirst:i?`source`:`visual`}),N(!0))},F=[j,C.isLarge,C.renderSource,C.renderVisual,n.docName,g,i],t[21]=n.docName,t[22]=C.isLarge,t[23]=C.renderSource,t[24]=C.renderVisual,t[25]=j,t[26]=i,t[27]=g,t[28]=P,t[29]=F):(P=t[28],F=t[29]),(0,Q.useEffect)(P,F);let I=r?`visible`:`hidden`,L=`editor:${n.docName}`,R=k?.scrollTop,z;t[30]!==a||t[31]!==n||t[32]!==C.renderSource||t[33]!==C.renderVisual||t[34]!==r||t[35]!==p||t[36]!==o||t[37]!==i||t[38]!==c||t[39]!==l||t[40]!==h||t[41]!==s||t[42]!==f||t[43]!==A?(z=f?(0,Z.jsx)(xj,{view:f}):(0,Z.jsx)(Z.Fragment,{children:(0,Z.jsx)(nj,{activeDocName:n.docName,previousDocName:s,onNavigateBack:c,onRecycle:l,children:(0,Z.jsx)(Q.Suspense,{fallback:A?(0,Z.jsx)(Cj,{html:A}):(0,Z.jsx)(ix,{}),children:(0,Z.jsx)(JA,{docName:n.docName,provider:n.provider,children:p?(0,Z.jsx)(qA,{docName:n.docName,provider:n.provider}):(0,Z.jsxs)(`div`,{className:`flex h-full flex-col`,children:[!i&&(nr(n.docName)||K(n.docName)?(0,Z.jsx)(Q.Suspense,{fallback:null,children:(0,Z.jsx)(sj,{docName:n.docName,provider:n.provider})}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(ij,{provider:n.provider}),(0,Z.jsx)(Ki,{provider:n.provider})]})),(0,Z.jsxs)(`div`,{className:`relative flex-1`,children:[C.renderSource?(0,Z.jsx)(`div`,{className:i?`h-full`:`ok-mode-hidden h-full`,children:(0,Z.jsx)(bj,{entry:n,isActive:r,isSourceMode:i,editorPlaceholder:a})}):null,C.renderVisual?(0,Z.jsx)(`div`,{className:i?`ok-mode-hidden h-full`:`h-full`,children:(0,Z.jsx)(UO,{provider:n.provider,placeholder:a,isSourceMode:i,portalTarget:h},`${n.docName}-${String(o)}-${n.poolEventId}`)}):null]})]})})})})}),t[30]=a,t[31]=n,t[32]=C.renderSource,t[33]=C.renderVisual,t[34]=r,t[35]=p,t[36]=o,t[37]=i,t[38]=c,t[39]=l,t[40]=h,t[41]=s,t[42]=f,t[43]=A,t[44]=z):z=t[44];let B;t[45]!==r||t[46]!==R||t[47]!==z?(B=(0,Z.jsx)(yj,{isActive:r,initialScrollTop:R,children:z}),t[45]=r,t[46]=R,t[47]=z,t[48]=B):B=t[48];let V;return t[49]!==I||t[50]!==L||t[51]!==B?(V=(0,Z.jsx)(Q.Activity,{mode:I,name:L,children:B}),t[49]=I,t[50]=L,t[51]=B,t[52]=V):V=t[52],V}function Tj(e){let t=e.endsWith(`rem`)?`rem`:`px`;return{value:Number.parseFloat(e),unit:t}}function Ej(e){let{value:t,unit:n}=Tj(e);return n===`rem`?t*16:t}function Dj(e,t){return`${t===`rem`?e.toFixed(1):Math.round(e)}${t}`}var Oj=3600*24*7;function kj(e){let t=(0,$.c)(28),{direction:n,currentWidth:r,onResize:i,onToggle:a,isCollapsed:o,minResizeWidth:s,maxResizeWidth:c,enableToggle:l,enableAutoCollapse:u,autoCollapseThreshold:d,expandThreshold:f,enableDrag:p,setIsDraggingRail:m,widthCookieName:h,widthCookieMaxAge:g,isNested:_}=e,v=n===void 0?`right`:n,y=o===void 0?!1:o,b=s===void 0?`14rem`:s,x=c===void 0?`24rem`:c,S=l===void 0?!0:l,C=u===void 0?!0:u,w=d===void 0?1.5:d,T=f===void 0?.2:f,E=p===void 0?!0:p,D=m===void 0?Aj:m,O=g===void 0?Oj:g,k=_===void 0?!1:_,A=(0,Q.useRef)(null),j=(0,Q.useRef)(0),M=(0,Q.useRef)(0),N=(0,Q.useRef)(!1),P=(0,Q.useRef)(!1),F=(0,Q.useRef)(null),I=(0,Q.useRef)(0),L=(0,Q.useRef)(!1),R=(0,Q.useRef)(0),z=(0,Q.useRef)(0),B=(0,Q.useRef)(null),V=(0,Q.useRef)(r),H=(0,Q.useRef)(y),U,W;t[0]===r?(U=t[1],W=t[2]):(U=()=>{V.current=r},W=[r],t[0]=r,t[1]=U,t[2]=W),(0,Q.useEffect)(U,W);let G,K;t[3]===y?(G=t[4],K=t[5]):(G=()=>{H.current=y},K=[y],t[3]=y,t[4]=G,t[5]=K),(0,Q.useEffect)(G,K);let ee=Ej(b),te;t[6]===x?te=t[7]:(te=Ej(x),t[6]=x,t[7]=te);let ne=te,re;t[8]!==E||t[9]!==k?(re=function(e){E&&(P.current=!0,j.current=H.current?0:Ej(V.current),M.current=e.clientX,I.current=e.clientX,F.current=null,L.current=!1,R.current=0,z.current=0,B.current=k&&A.current?A.current.getBoundingClientRect():null,e.preventDefault())},t[8]=E,t[9]=k,t[10]=re):re=t[10];let ie=re,ae,oe;t[11]!==w||t[12]!==v||t[13]!==C||t[14]!==S||t[15]!==T||t[16]!==k||t[17]!==ne||t[18]!==ee||t[19]!==i||t[20]!==a||t[21]!==D||t[22]!==O||t[23]!==h?(ae=()=>{let e=function(e){h&&(document.cookie=`${h}=${e}; path=/; max-age=${O}`)},t=function(e,t){return v===`left`?e<t:e>t},n=function(e,t,n,r){if(k&&r){let r=e.clientX-t;return v===`left`?n-r:n+r}return v===`left`?window.innerWidth-e.clientX:e.clientX},r=function(r){if(!P.current)return;let o=Math.abs(r.clientX-M.current);if(!N.current&&o>5&&(N.current=!0,D(!0)),N.current){let{unit:o}=Tj(V.current),s=B.current;k&&A.current&&(s=A.current.getBoundingClientRect());let c=t(r.clientX,I.current)?`expand`:`collapse`;F.current!==c&&(F.current=c),z.current=Math.abs(r.clientX-I.current);let l=Date.now();if(L.current&&l-R.current>200&&(L.current=!1),!L.current){if(C&&a&&!H.current){let e=n(r,M.current,j.current,s),t=!1;if(w<=1)t=e<=ee*w;else if(e<=ee){let n=ee*(w-1);t=ee-e>=n}if(c===`collapse`&&t){a(),I.current=r.clientX,L.current=!0,R.current=l;return}}if(a&&H.current&&c===`expand`&&z.current>ee*T){a();let t=n(r,M.current,j.current,s),c=Math.max(ee,Math.min(ne,t)),u=Dj(o===`rem`?c/16:c,o);i(u),e(u),I.current=r.clientX,L.current=!0,R.current=l;return}}if(H.current)return;let u=n(r,M.current,j.current,s),d=Math.max(ee,Math.min(ne,u)),f=Dj(o===`rem`?d/16:d,o);i(f),e(f)}},o=function(){P.current&&(!N.current&&a&&S&&a(),N.current=!1,P.current=!1,F.current=null,I.current=0,L.current=!1,R.current=0,z.current=0,B.current=null,D(!1))};return document.addEventListener(`mousemove`,r),document.addEventListener(`mouseup`,o),()=>{document.removeEventListener(`mousemove`,r),document.removeEventListener(`mouseup`,o)}},oe=[i,a,D,ee,ne,k,C,w,T,S,h,O,v],t[11]=w,t[12]=v,t[13]=C,t[14]=S,t[15]=T,t[16]=k,t[17]=ne,t[18]=ee,t[19]=i,t[20]=a,t[21]=D,t[22]=O,t[23]=h,t[24]=ae,t[25]=oe):(ae=t[24],oe=t[25]),(0,Q.useEffect)(ae,oe);let se;return t[26]===ie?se=t[27]:(se={dragRef:A,isDragging:N,handleMouseDown:ie},t[26]=ie,t[27]=se),se}function Aj(){}var jj=3600*24*7,Mj=`18rem`,Nj=`3rem`,Pj=`app-file-sidebar`,Fj=`14.625rem`,Ij=`32rem`,Lj=`sidebar_width`,Rj=/^\d+(?:\.\d+)?(?:rem|px)$/,zj=Q.createContext(null);function Bj(e){if(typeof document>`u`)return e;let t=document.cookie.split(`; `).find(e=>e.startsWith(`${Lj}=`))?.split(`=`)[1];if(!t)return e;let n;try{n=decodeURIComponent(t)}catch{return e}return Rj.test(n)?n:e}function Vj(){let e=Q.use(zj);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e}function Hj(e){let t=(0,$.c)(58),n,r,i,a,o,s,c;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7]):({open:i,onOpenChange:o,className:r,style:s,children:n,defaultWidth:c,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c);let l=c===void 0?Mj:c,[u]=Q.useState(Wj),d;t[8]===u?d=t[9]:(d=()=>Ew(u,window.innerWidth,`left`),t[8]=u,t[9]=d);let[f,p]=Q.useState(d),m;t[10]===l?m=t[11]:(m=()=>Bj(l),t[10]=l,t[11]=m);let[h,g]=Q.useState(m),[_,v]=Q.useState(!1),[y,b]=Q.useState(!1),x;t[12]===u?x=t[13]:(x=()=>{let e=Nw();return Fw(`left`,Ew(u,window.innerWidth,`left`),e)===`open`},t[12]=u,t[13]=x);let[S,C]=Q.useState(x),w=i??S,T;t[14]!==w||t[15]!==f||t[16]!==o?(T=e=>{let t=typeof e==`function`?e(w):e;o?o(t):C(t),Iw(`left`,f,t?`open`:`collapsed`)},t[14]=w,t[15]=f,t[16]=o,t[17]=T):T=t[17];let E=T,D;t[18]===E?D=t[19]:(D=function(){E(Uj)},t[18]=E,t[19]=D);let O=D,k=Q.useRef(w),A;t[20]===w?A=t[21]:(A=()=>{k.current=w},t[20]=w,t[21]=A),Q.useLayoutEffect(A);let j;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(j=function(){window.innerWidth>=1024||k.current&&(window.matchMedia(`(prefers-reduced-motion: reduce)`).matches||b(!0))},t[22]=j):j=t[22];let M=j,N,P;t[23]===u?(N=t[24],P=t[25]):(P=()=>{let e=window.matchMedia(`(min-width: ${Cw}px)`),t=()=>{let e=Ew(u,window.innerWidth,`left`);p(e),C(Fw(`left`,e,Nw())===`open`)};return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},N=[u],t[23]=u,t[24]=N,t[25]=P),Q.useEffect(P,N);let F,I;t[26]===w?(F=t[27],I=t[28]):(F=()=>{w||document.getElementById(Pj)?.contains(document.activeElement)&&document.querySelector(`[data-sidebar="trigger"]`)?.focus()},I=[w],t[26]=w,t[27]=F,t[28]=I),Q.useLayoutEffect(F,I);let L,R;t[29]!==w||t[30]!==f||t[31]!==E?(L=()=>{if(f===`above`||!w)return;let e=e=>{e.key===`Escape`&&(document.querySelector(`[data-state="open"][role="dialog"], [data-state="open"][role="alertdialog"], [data-state="open"][role="menu"], [data-state="open"][role="listbox"], [data-radix-popper-content-wrapper] [data-state="open"]`)||E(!1))};return window.addEventListener(`keydown`,e,{capture:!0}),()=>window.removeEventListener(`keydown`,e,{capture:!0})},R=[f,w,E],t[29]=w,t[30]=f,t[31]=E,t[32]=L,t[33]=R):(L=t[32],R=t[33]),Q.useEffect(L,R);let z,B;t[34]===O?(z=t[35],B=t[36]):(z=()=>{if(typeof window<`u`&&window.okDesktop!=null)return;let e=e=>{Pl(e,`toggle-files-sidebar`)&&(e.preventDefault(),O())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},B=[O],t[34]=O,t[35]=z,t[36]=B),Q.useEffect(z,B);let V=w?`expanded`:`collapsed`,H;t[37]!==_||t[38]!==w||t[39]!==E||t[40]!==y||t[41]!==V||t[42]!==O||t[43]!==h?(H={state:V,open:w,setOpen:E,toggleSidebar:O,width:h,setWidth:g,isDraggingRail:_,setIsDraggingRail:v,showPushPulse:y,setShowPushPulse:b,notifySidebarFileSelected:M},t[37]=_,t[38]=w,t[39]=E,t[40]=y,t[41]=V,t[42]=O,t[43]=h,t[44]=H):H=t[44];let U;t[45]!==s||t[46]!==h?(U={"--sidebar-width":h,"--sidebar-width-icon":Nj,...s},t[45]=s,t[46]=h,t[47]=U):U=t[47];let W=U,G;t[48]===r?G=t[49]:(G=Y(`group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar`,r),t[48]=r,t[49]=G);let K;t[50]!==n||t[51]!==a||t[52]!==W||t[53]!==G?(K=(0,Z.jsx)(`div`,{"data-slot":`sidebar-wrapper`,style:W,className:G,...a,children:n}),t[50]=n,t[51]=a,t[52]=W,t[53]=G,t[54]=K):K=t[54];let ee;return t[55]!==H||t[56]!==K?(ee=(0,Z.jsx)(zj.Provider,{value:H,children:K}),t[55]=H,t[56]=K,t[57]=ee):ee=t[57],ee}function Uj(e){return!e}function Wj(){return Ar()}function Gj(e){let t=(0,$.c)(39),n,r,i,a,o,s;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6]):({side:a,variant:o,collapsible:s,className:r,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s);let c=a===void 0?`left`:a,l=o===void 0?`sidebar`:o,u=s===void 0?`offcanvas`:s,{_:d}=an(),{state:f,isDraggingRail:p}=Vj();if(u===`none`){let e;t[7]===r?e=t[8]:(e=Y(`flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground`,r),t[7]=r,t[8]=e);let a;return t[9]!==n||t[10]!==i||t[11]!==e||t[12]!==l?(a=(0,Z.jsx)(`div`,{"data-slot":`sidebar`,"data-variant":l,className:e,...i,children:n}),t[9]=n,t[10]=i,t[11]=e,t[12]=l,t[13]=a):a=t[13],a}let m=f===`collapsed`?u:``,h=l===`floating`||l===`inset`?`group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon)`,g;t[14]===h?g=t[15]:(g=Y(`relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear`,`group-data-[collapsible=offcanvas]:w-0`,`group-data-[side=right]:rotate-180`,h,`group-data-[dragging=true]:duration-0! group-data-[dragging=true]_*:!duration-0`),t[14]=h,t[15]=g);let _;t[16]===g?_=t[17]:(_=(0,Z.jsx)(`div`,{"data-slot":`sidebar-gap`,className:g}),t[16]=g,t[17]=_);let v;t[18]===d?v=t[19]:(v=d({id:`07q4Qk`}),t[18]=d,t[19]=v);let y=l===`floating`||l===`inset`?`p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l`,b;t[20]!==r||t[21]!==y?(b=Y(`fixed inset-y-0 z-10 flex h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear motion-reduce:transition-none motion-reduce:duration-0 data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)] data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]`,y,`group-data-[dragging=true]:duration-0! group-data-[dragging=true]_*:!duration-0`,r),t[20]=r,t[21]=y,t[22]=b):b=t[22];let x;t[23]===n?x=t[24]:(x=(0,Z.jsx)(`div`,{"data-sidebar":`sidebar`,"data-slot":`sidebar-inner`,className:`flex size-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 group-data-[variant=floating]:ring-sidebar-border`,children:n}),t[23]=n,t[24]=x);let S;t[25]!==i||t[26]!==c||t[27]!==b||t[28]!==x||t[29]!==v?(S=(0,Z.jsx)(`nav`,{id:Pj,"aria-label":v,"data-slot":`sidebar-container`,"data-side":c,className:b,...i,children:x}),t[25]=i,t[26]=c,t[27]=b,t[28]=x,t[29]=v,t[30]=S):S=t[30];let C;return t[31]!==p||t[32]!==c||t[33]!==f||t[34]!==S||t[35]!==m||t[36]!==_||t[37]!==l?(C=(0,Z.jsxs)(`div`,{className:`group peer text-sidebar-foreground`,"data-state":f,"data-collapsible":m,"data-variant":l,"data-side":c,"data-slot":`sidebar`,"data-dragging":p,children:[_,S]}),t[31]=p,t[32]=c,t[33]=f,t[34]=S,t[35]=m,t[36]=_,t[37]=l,t[38]=C):C=t[38],C}function Kj(e){let t=(0,$.c)(34),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,onClick:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let{_:a}=an(),{toggleSidebar:o,state:s}=Vj(),c,l,u,d,f,p,m,h;if(t[4]!==a||t[5]!==s){let e=Fl(`toggle-files-sidebar`);c=X,l=`trigger`,u=`sidebar-trigger`,d=`ghost`,f=`icon-sm`,p=s===`expanded`,m=Pj,h=a(s===`expanded`?{id:`4PYsOz`,values:{sidebarShortcutLabel:e}}:{id:`jbSG8V`,values:{sidebarShortcutLabel:e}}),t[4]=a,t[5]=s,t[6]=c,t[7]=l,t[8]=u,t[9]=d,t[10]=f,t[11]=p,t[12]=m,t[13]=h}else c=t[6],l=t[7],u=t[8],d=t[9],f=t[10],p=t[11],m=t[12],h=t[13];let g;t[14]===n?g=t[15]:(g=Y(n),t[14]=n,t[15]=g);let _;t[16]!==r||t[17]!==o?(_=e=>{r?.(e),o()},t[16]=r,t[17]=o,t[18]=_):_=t[18];let v;t[19]===s?v=t[20]:(v=s===`expanded`?(0,Z.jsx)(T,{}):(0,Z.jsx)(uf,{}),t[19]=s,t[20]=v);let y;return t[21]!==c||t[22]!==i||t[23]!==l||t[24]!==v||t[25]!==u||t[26]!==d||t[27]!==f||t[28]!==p||t[29]!==m||t[30]!==h||t[31]!==g||t[32]!==_?(y=(0,Z.jsx)(c,{"data-sidebar":l,"data-slot":u,variant:d,size:f,"aria-expanded":p,"aria-controls":m,"aria-label":h,className:g,onClick:_,...i,children:v}),t[21]=c,t[22]=i,t[23]=l,t[24]=v,t[25]=u,t[26]=d,t[27]=f,t[28]=p,t[29]=m,t[30]=h,t[31]=g,t[32]=_,t[33]=y):y=t[33],y}function qj(e){let t=(0,$.c)(32),n,r,i,a,o;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5]):({className:n,enableDrag:a,enableToggle:o,onMouseDown:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o);let s=a===void 0?!0:a,c=o===void 0?!0:o,{_:l}=an(),{toggleSidebar:u,setWidth:d,state:f,width:p,setIsDraggingRail:m}=Vj(),h=f===`collapsed`,g;t[6]!==s||t[7]!==c||t[8]!==m||t[9]!==d||t[10]!==h||t[11]!==u||t[12]!==p?(g={direction:`right`,enableDrag:s,enableToggle:c,onResize:d,onToggle:u,currentWidth:p,isCollapsed:h,minResizeWidth:Fj,maxResizeWidth:Ij,setIsDraggingRail:m,widthCookieName:Lj,widthCookieMaxAge:jj},t[6]=s,t[7]=c,t[8]=m,t[9]=d,t[10]=h,t[11]=u,t[12]=p,t[13]=g):g=t[13];let{dragRef:_,handleMouseDown:v}=kj(g),y;t[14]!==l||t[15]!==f?(y=l(f===`expanded`?{id:`w3vFfL`}:{id:`e8zRrb`}),t[14]=l,t[15]=f,t[16]=y):y=t[16];let b;t[17]!==v||t[18]!==r?(b=e=>{r?.(e),e.defaultPrevented||v(e)},t[17]=v,t[18]=r,t[19]=b):b=t[19];let x;t[20]!==l||t[21]!==f?(x=l(f===`expanded`?{id:`w3vFfL`}:{id:`e8zRrb`}),t[20]=l,t[21]=f,t[22]=x):x=t[22];let S;t[23]===n?S=t[24]:(S=Y(`absolute inset-y-0 z-20 hidden w-4 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:start-1/2 after:w-[2px] hover:after:bg-sidebar-border sm:flex ltr:-translate-x-1/2 rtl:-translate-x-1/2`,`in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize`,`[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize`,`group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full hover:group-data-[collapsible=offcanvas]:bg-sidebar`,`[[data-side=left][data-collapsible=offcanvas]_&]:-right-2`,`[[data-side=right][data-collapsible=offcanvas]_&]:-left-2`,`md:group-data-[variant=inset]:after:inset-y-5`,n),t[23]=n,t[24]=S);let C;return t[25]!==_||t[26]!==i||t[27]!==y||t[28]!==b||t[29]!==x||t[30]!==S?(C=(0,Z.jsx)(`button`,{ref:_,"data-sidebar":`rail`,"data-slot":`sidebar-rail`,"aria-label":y,tabIndex:-1,onMouseDown:b,title:x,className:S,...i}),t[25]=_,t[26]=i,t[27]=y,t[28]=b,t[29]=x,t[30]=S,t[31]=C):C=t[31],C}function Jj(e){let t=(0,$.c)(14),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,onAnimationEnd:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let{showPushPulse:a,setShowPushPulse:o}=Vj(),s;t[4]!==r||t[5]!==o?(s=e=>{r?.(e),e.animationName===`sidebar-push-pulse`&&o(!1)},t[4]=r,t[5]=o,t[6]=s):s=t[6];let c=s,l=a?``:void 0,u;t[7]===n?u=t[8]:(u=Y(`relative flex w-full flex-1 flex-col bg-background peer-data-[variant=inset]:m-2 peer-data-[variant=inset]:ml-0 peer-data-[variant=inset]:rounded-xl peer-data-[variant=inset]:shadow-sm peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2`,n),t[7]=n,t[8]=u);let d;return t[9]!==c||t[10]!==i||t[11]!==l||t[12]!==u?(d=(0,Z.jsx)(`main`,{"data-slot":`sidebar-inset`,"data-push-pulse":l,onAnimationEnd:c,className:u,...i}),t[9]=c,t[10]=i,t[11]=l,t[12]=u,t[13]=d):d=t[13],d}function Yj(e){let t=(0,$.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=Y(`flex flex-col gap-2 p-2`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`div`,{"data-slot":`sidebar-header`,"data-sidebar":`header`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Xj(e){let t=(0,$.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=Y(`flex flex-col gap-2 p-2`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`div`,{"data-slot":`sidebar-footer`,"data-sidebar":`footer`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Zj(e){let t=(0,$.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=Y(`no-scrollbar flex min-h-0 flex-1 flex-col gap-0 overflow-auto group-data-[collapsible=icon]:overflow-hidden`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`div`,{"data-slot":`sidebar-content`,"data-sidebar":`content`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Qj(e){let t=(0,$.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=Y(`relative flex w-full min-w-0 flex-col p-2`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`div`,{"data-slot":`sidebar-group`,"data-sidebar":`group`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function $j(e){let t=(0,$.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,asChild:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i!==void 0&&i?xi:`div`,o;t[4]===n?o=t[5]:(o=Y(`flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 ring-sidebar-ring outline-hidden transition-[margin,opacity] duration-200 ease-linear group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0`,n),t[4]=n,t[5]=o);let s;return t[6]!==a||t[7]!==r||t[8]!==o?(s=(0,Z.jsx)(a,{"data-slot":`sidebar-group-label`,"data-sidebar":`group-label`,className:o,...r}),t[6]=a,t[7]=r,t[8]=o,t[9]=s):s=t[9],s}function eM(e){let t=(0,$.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,asChild:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i!==void 0&&i?xi:`button`,o;t[4]===n?o=t[5]:(o=Y(`absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground ring-sidebar-ring outline-hidden transition-transform group-data-[collapsible=icon]:hidden after:absolute after:-inset-2 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 md:after:hidden [&>svg]:size-4 [&>svg]:shrink-0`,n),t[4]=n,t[5]=o);let s;return t[6]!==a||t[7]!==r||t[8]!==o?(s=(0,Z.jsx)(a,{"data-slot":`sidebar-group-action`,"data-sidebar":`group-action`,className:o,...r}),t[6]=a,t[7]=r,t[8]=o,t[9]=s):s=t[9],s}function tM(e){let t=(0,$.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=Y(`w-full text-sm`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`div`,{"data-slot":`sidebar-group-content`,"data-sidebar":`group-content`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function nM(e){let t=(0,$.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=Y(`flex w-full min-w-0 flex-col gap-0`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`ul`,{"data-slot":`sidebar-menu`,"data-sidebar":`menu`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function rM(e){let t=(0,$.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=Y(`group/menu-item relative`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`li`,{"data-slot":`sidebar-menu-item`,"data-sidebar":`menu-item`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var iM=Si(`peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-hover hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-hover active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-open:hover:bg-sidebar-hover data-open:hover:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:font-medium data-active:text-sidebar-accent-foreground data-active:hover:bg-sidebar-accent [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate`,{variants:{variant:{default:`hover:bg-sidebar-hover hover:text-sidebar-accent-foreground`,outline:`bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-hover hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]`},size:{default:`h-8 text-sm`,sm:`h-7 text-xs`,lg:`h-12 text-sm group-data-[collapsible=icon]:p-0!`}},defaultVariants:{variant:`default`,size:`default`}});function aM(e){let t=(0,$.c)(28),n,r,i,a,o,s,c;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7]):({asChild:i,isActive:a,variant:o,size:s,tooltip:c,className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c);let l=i===void 0?!1:i,u=a===void 0?!1:a,d=o===void 0?`default`:o,f=s===void 0?`default`:s,p=l?xi:`button`,{state:m}=Vj(),h;t[8]!==n||t[9]!==f||t[10]!==d?(h=Y(iM({variant:d,size:f}),n),t[8]=n,t[9]=f,t[10]=d,t[11]=h):h=t[11];let g;t[12]!==p||t[13]!==u||t[14]!==r||t[15]!==f||t[16]!==h?(g=(0,Z.jsx)(p,{"data-slot":`sidebar-menu-button`,"data-sidebar":`menu-button`,"data-size":f,"data-active":u,className:h,...r}),t[12]=p,t[13]=u,t[14]=r,t[15]=f,t[16]=h,t[17]=g):g=t[17];let _=g;if(!c)return _;if(typeof c==`string`){let e;t[18]===c?e=t[19]:(e={children:c},t[18]=c,t[19]=e),c=e}let v;t[20]===_?v=t[21]:(v=(0,Z.jsx)(As,{asChild:!0,children:_}),t[20]=_,t[21]=v);let y=m!==`collapsed`,b;t[22]!==y||t[23]!==c?(b=(0,Z.jsx)(js,{side:`right`,align:`center`,hidden:y,...c}),t[22]=y,t[23]=c,t[24]=b):b=t[24];let x;return t[25]!==v||t[26]!==b?(x=(0,Z.jsxs)(Ns,{children:[v,b]}),t[25]=v,t[26]=b,t[27]=x):x=t[27],x}function oM(e){let t=(0,$.c)(12),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:n,asChild:i,showOnHover:a,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=i===void 0?!1:i,s=a===void 0?!1:a,c=o?xi:`button`,l=s&&`group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 peer-data-active/menu-button:text-sidebar-accent-foreground aria-expanded:opacity-100 md:opacity-0`,u;t[5]!==n||t[6]!==l?(u=Y(`absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground ring-sidebar-ring outline-hidden transition-transform group-data-[collapsible=icon]:hidden peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1 after:absolute after:-inset-2 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 md:after:hidden [&>svg]:size-4 [&>svg]:shrink-0`,l,n),t[5]=n,t[6]=l,t[7]=u):u=t[7];let d;return t[8]!==c||t[9]!==r||t[10]!==u?(d=(0,Z.jsx)(c,{"data-slot":`sidebar-menu-action`,"data-sidebar":`menu-action`,className:u,...r}),t[8]=c,t[9]=r,t[10]=u,t[11]=d):d=t[11],d}function sM(e){let t=(0,$.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=Y(`mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5 group-data-[collapsible=icon]:hidden`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`ul`,{"data-slot":`sidebar-menu-sub`,"data-sidebar":`menu-sub`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function cM(e){let t=(0,$.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=Y(`group/menu-sub-item relative`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`li`,{"data-slot":`sidebar-menu-sub-item`,"data-sidebar":`menu-sub-item`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function lM(e){let t=(0,$.c)(14),n,r,i,a,o;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5]):({asChild:i,size:a,isActive:o,className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o);let s=i===void 0?!1:i,c=a===void 0?`md`:a,l=o===void 0?!1:o,u=s?xi:`a`,d;t[6]===n?d=t[7]:(d=Y(`flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground ring-sidebar-ring outline-hidden group-data-[collapsible=icon]:hidden hover:bg-sidebar-hover hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-hover active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[size=md]:text-sm data-[size=sm]:text-xs data-active:bg-sidebar-accent data-active:text-sidebar-accent-foreground data-active:hover:bg-sidebar-accent [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground`,n),t[6]=n,t[7]=d);let f;return t[8]!==u||t[9]!==l||t[10]!==r||t[11]!==c||t[12]!==d?(f=(0,Z.jsx)(u,{"data-slot":`sidebar-menu-sub-button`,"data-sidebar":`menu-sub-button`,"data-size":c,"data-active":l,className:d,...r}),t[8]=u,t[9]=l,t[10]=r,t[11]=c,t[12]=d,t[13]=f):f=t[13],f}function uM(e){let t=null,n=!1,r=new Set;function i(e){if(e!==t){t=e;for(let e of r)e()}}e.subscribeToEvent(i);async function a(){if(!n){n=!0;try{i(await e.fetchBranch())}catch{}}}return{getSnapshot:()=>t,subscribe(e){return r.add(e),a(),()=>{r.delete(e)}}}}async function dM(){let e=await fetch(`/api/server-info`,{signal:AbortSignal.timeout(5e3)});if(!e.ok)return null;let t=await e.json(),n=Nr.safeParse(t);return n.success?n.data.currentBranch??null:null}var fM=typeof window>`u`?{getSnapshot:()=>null,subscribe:()=>()=>{}}:uM({fetchBranch:dM,subscribeToEvent:dl}),pM=fM.subscribe,mM=fM.getSnapshot;function hM(){return(0,Q.useSyncExternalStore)(pM,mM,mM)}function gM(){let e=(0,$.c)(6),t=hM(),n=ia(),{state:r}=Vj(),i=typeof window<`u`?window.okDesktop:void 0;if(i&&r===`expanded`)return null;let a;e[0]===n?a=e[1]:(a=i?.config.projectName??(n&&za(n.contentDir)||null),e[0]=n,e[1]=a);let o=a,s=i?.config.projectPath??n?.contentDir??null;if(o===null&&t===null)return null;let c;return e[2]!==t||e[3]!==o||e[4]!==s?(c={projectName:o,projectPath:s,branch:t},e[2]=t,e[3]=o,e[4]=s,e[5]=c):c=e[5],c}function _M(e){let t=(0,$.c)(30),{stats:n,selectionStats:r,showStats:i,composerBadge:a,reserveRightGutter:o}=e,s=i===void 0?!0:i,c=o===void 0?!1:o,{_:l}=an(),u=gM();if(!s&&u===null&&a==null)return null;let d=r??n,f=r!=null,{words:p,chars:m,tokens:h}=d,g;t[0]!==l||t[1]!==f||t[2]!==s?(g=l(s?f?{id:`Bv5a9_`}:{id:`L1ZE3M`}:{id:`goO4Ll`}),t[0]=l,t[1]=f,t[2]=s,t[3]=g):g=t[3];let _=c&&`pr-12`,v;t[4]===_?v=t[5]:(v=Y(`relative flex h-6 shrink-0 items-center justify-between gap-3 bg-background px-3 text-2xs text-muted-foreground`,_),t[4]=_,t[5]=v);let y;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Z.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute inset-x-0 bottom-full h-2 bg-linear-to-t from-background to-transparent`}),t[6]=y):y=t[6];let b;t[7]!==l||t[8]!==a?(b=a?(0,Z.jsxs)(X,{type:`button`,variant:`outline`,onClick:a.onReopen,"data-testid":`ask-ai-reopen-badge`,className:`-translate-x-1/2 absolute bottom-0 left-1/2 z-10 h-auto gap-1 rounded-md rounded-b-none bg-card px-2.5 py-0.5 text-2xs font-normal text-muted-foreground shadow-sm hover:text-foreground active:not-aria-[haspopup]:translate-y-0`,children:[(0,Z.jsx)(ss,{className:`size-3`,"aria-hidden":!0}),l({id:`xWEvuo`}),(0,Z.jsx)(Le,{className:`size-3`,"aria-hidden":!0})]}):null,t[7]=l,t[8]=a,t[9]=b):b=t[9];let x;t[10]===u?x=t[11]:(x=u===null?null:(0,Z.jsx)(vM,{identity:u}),t[10]=u,t[11]=x);let S;t[12]===x?S=t[13]:(S=(0,Z.jsx)(`span`,{className:`flex min-w-0 items-center gap-3`,children:x}),t[12]=x,t[13]=S);let C;t[14]!==l||t[15]!==d.chars||t[16]!==d.tokens||t[17]!==d.words||t[18]!==m||t[19]!==f||t[20]!==s||t[21]!==h||t[22]!==p?(C=s?(0,Z.jsxs)(`span`,{className:`flex shrink-0 items-center gap-3`,children:[f?(0,Z.jsx)(`span`,{className:`font-medium text-foreground/70`,"data-testid":`editor-footer-selected-label`,children:l({id:`ylXj1N`})}):null,(0,Z.jsxs)(`span`,{children:[(0,Z.jsx)(`span`,{className:`tabular-nums`,children:d.words.toLocaleString()}),` `,(0,Z.jsx)(J,{id:`gljvbT`,values:{words:p}})]}),(0,Z.jsxs)(`span`,{children:[(0,Z.jsx)(`span`,{className:`tabular-nums`,children:d.chars.toLocaleString()}),` `,(0,Z.jsx)(J,{id:`d5rK4X`,values:{chars:m}})]}),(0,Z.jsxs)(`span`,{children:[d.tokens>0?`~`:``,(0,Z.jsx)(`span`,{className:`tabular-nums`,children:d.tokens.toLocaleString()}),` `,(0,Z.jsx)(J,{id:`uynXup`,values:{tokens:h}})]})]}):null,t[14]=l,t[15]=d.chars,t[16]=d.tokens,t[17]=d.words,t[18]=m,t[19]=f,t[20]=s,t[21]=h,t[22]=p,t[23]=C):C=t[23];let w;return t[24]!==C||t[25]!==g||t[26]!==v||t[27]!==b||t[28]!==S?(w=(0,Z.jsxs)(`section`,{"aria-label":g,className:v,children:[y,b,S,C]}),t[24]=C,t[25]=g,t[26]=v,t[27]=b,t[28]=S,t[29]=w):w=t[29],w}function vM(e){let t=(0,$.c)(8),{identity:n}=e,{projectName:r,projectPath:i,branch:a}=n,o;t[0]!==r||t[1]!==i?(o=r===null?null:i?(0,Z.jsxs)(Ns,{children:[(0,Z.jsx)(As,{asChild:!0,children:(0,Z.jsx)(`span`,{tabIndex:0,className:`truncate`,"data-testid":`editor-footer-project-name`,children:r})}),(0,Z.jsx)(js,{side:`top`,className:`max-w-xs break-all`,children:i})]}):(0,Z.jsx)(`span`,{className:`truncate`,"data-testid":`editor-footer-project-name`,children:r}),t[0]=r,t[1]=i,t[2]=o):o=t[2];let s;t[3]===a?s=t[4]:(s=a===null?null:(0,Z.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1`,"data-testid":`editor-footer-branch`,children:[(0,Z.jsx)(Vo,{"aria-hidden":`true`,className:`size-3 shrink-0`}),(0,Z.jsx)(`span`,{className:`truncate`,children:a})]}),t[3]=a,t[4]=s);let c;return t[5]!==o||t[6]!==s?(c=(0,Z.jsxs)(Z.Fragment,{children:[o,s]}),t[5]=o,t[6]=s,t[7]=c):c=t[7],c}function yM(e){let t=(0,$.c)(11),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}=an(),a;t[3]===i?a=t[4]:(a=i({id:`3__SjS`}),t[3]=i,t[4]=a);let o;t[5]===n?o=t[6]:(o=Y(n),t[5]=n,t[6]=o);let s;return t[7]!==r||t[8]!==a||t[9]!==o?(s=(0,Z.jsx)(`nav`,{"aria-label":a,"data-slot":`breadcrumb`,className:o,...r}),t[7]=r,t[8]=a,t[9]=o,t[10]=s):s=t[10],s}function bM(e){let t=(0,$.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=Y(`flex flex-wrap items-center gap-1.5 text-sm wrap-break-word text-muted-foreground`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`ol`,{"data-slot":`breadcrumb-list`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function xM(e){let t=(0,$.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=Y(`inline-flex items-center gap-1`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`li`,{"data-slot":`breadcrumb-item`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function SM(e){let t=(0,$.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({current:i,className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0||i?`page`:void 0,o;t[4]===n?o=t[5]:(o=Y(`font-normal text-foreground`,n),t[4]=n,t[5]=o);let s;return t[6]!==r||t[7]!==a||t[8]!==o?(s=(0,Z.jsx)(`span`,{"data-slot":`breadcrumb-page`,"aria-current":a,className:o,...r}),t[6]=r,t[7]=a,t[8]=o,t[9]=s):s=t[9],s}function CM(e){let t=(0,$.c)(12),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({children:n,className:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===r?a=t[5]:(a=Y(`[&>svg]:size-3.5`,r),t[4]=r,t[5]=a);let o;t[6]===n?o=t[7]:(o=n??(0,Z.jsx)(Zi,{}),t[6]=n,t[7]=o);let s;return t[8]!==i||t[9]!==a||t[10]!==o?(s=(0,Z.jsx)(`li`,{"data-slot":`breadcrumb-separator`,role:`presentation`,"aria-hidden":`true`,className:a,...i,children:o}),t[8]=i,t[9]=a,t[10]=o,t[11]=s):s=t[11],s}var wM=1,TM=2,EM=4;function DM(e){let t=(0,$.c)(18),{docName:n,className:r}=e;if(!n)return null;let i,a,o,s,c,l;if(t[0]!==r||t[1]!==n){l=Symbol.for(`react.early_return_sentinel`);bb0:{let e=Or(n),u=e?e.kind===`template`?e.folder.split(`/`).filter(Boolean):[]:v(n,``).prefix.replace(/\/$/,``).split(`/`).filter(Boolean);if(u.length===0){l=null;break bb0}let d=(e,t)=>({kind:`segment`,value:e,key:u.slice(0,t+1).join(`/`)}),f=u.length>EM?[...u.slice(0,wM).map((e,t)=>d(e,t)),{kind:`ellipsis`,hidden:u.slice(wM,-TM)},...u.slice(-TM).map((e,t)=>d(e,u.length-TM+t))]:u.map((e,t)=>d(e,t));a=yM,t[8]===r?c=t[9]:(c=Y(`flex min-w-0 items-center`,r),t[8]=r,t[9]=c),i=bM,o=`min-w-0 flex-nowrap gap-1 overflow-hidden text-muted-foreground/70 text-xs`,s=f.map(OM)}t[0]=r,t[1]=n,t[2]=i,t[3]=a,t[4]=o,t[5]=s,t[6]=c,t[7]=l}else i=t[2],a=t[3],o=t[4],s=t[5],c=t[6],l=t[7];if(l!==Symbol.for(`react.early_return_sentinel`))return l;let u;t[10]!==i||t[11]!==o||t[12]!==s?(u=(0,Z.jsx)(i,{className:o,children:s}),t[10]=i,t[11]=o,t[12]=s,t[13]=u):u=t[13];let d;return t[14]!==a||t[15]!==c||t[16]!==u?(d=(0,Z.jsx)(a,{className:c,children:u}),t[14]=a,t[15]=c,t[16]=u,t[17]=d):d=t[17],d}function OM(e,t){let n=e.kind===`segment`?e.key:`ellipsis`;return(0,Z.jsxs)(Q.Fragment,{children:[t>0&&(0,Z.jsx)(CM,{className:`shrink-0 text-muted-foreground/70 [&>svg]:size-3`}),e.kind===`ellipsis`?(0,Z.jsxs)(xM,{className:`shrink-0`,children:[(0,Z.jsx)(`span`,{"aria-hidden":`true`,title:e.hidden.join(` / `),className:`flex size-4 items-center justify-center text-muted-foreground/70`,children:(0,Z.jsx)(Fd,{className:`size-3.5`})}),(0,Z.jsx)(`span`,{className:`sr-only`,children:e.hidden.join(` / `)})]}):(0,Z.jsx)(xM,{className:`min-w-0`,children:(0,Z.jsx)(SM,{current:!1,className:`min-w-0 truncate font-normal text-muted-foreground/70`,title:e.value,children:e.value})})]},n)}var kM={fill:`none`,height:24,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,viewBox:`0 0 24 24`,width:24,xmlns:`http://www.w3.org/2000/svg`},AM=e=>{let t=(0,$.c)(15),n,r,i,a,o,s,c;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7]):({color:a,size:o,strokeWidth:s,absoluteStrokeWidth:n,className:c,children:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c);let l=a===void 0?`currentColor`:a,u=o===void 0?24:o,d=s===void 0?2:s,f=c===void 0?``:c,p=n?Number(d)*24/Number(u):d,m;return t[8]!==r||t[9]!==f||t[10]!==l||t[11]!==i||t[12]!==u||t[13]!==p?(m=(0,Z.jsx)(`svg`,{"aria-hidden":`true`,...kM,className:f,height:u,stroke:l,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:p,width:u,...i,children:r}),t[8]=r,t[9]=f,t[10]=l,t[11]=i,t[12]=u,t[13]=p,t[14]=m):m=t[14],m},jM=e=>{let t=(0,$.c)(4),n,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsx)(`title`,{children:`Markdown`}),r=(0,Z.jsx)(`path`,{d:`M232,48H24A16,16,0,0,0,8,64V192a16,16,0,0,0,16,16H232a16,16,0,0,0,16-16V64A16,16,0,0,0,232,48Zm0,144H24V64H232V192ZM128,104v48a8,8,0,0,1-16,0V123.31L93.66,141.66a8,8,0,0,1-11.32,0L64,123.31V152a8,8,0,0,1-16,0V104a8,8,0,0,1,13.66-5.66L88,124.69l26.34-26.35A8,8,0,0,1,128,104Zm77.66,18.34a8,8,0,0,1,0,11.32l-24,24a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L168,132.69V104a8,8,0,0,1,16,0v28.69l10.34-10.35A8,8,0,0,1,205.66,122.34Z`}),t[0]=n,t[1]=r):(n=t[0],r=t[1]);let i;return t[2]===e?i=t[3]:(i=(0,Z.jsxs)(AM,{...e,viewBox:`0 0 256 256`,fill:`currentColor`,children:[n,r]}),t[2]=e,t[3]=i),i},MM=e=>{let t=(0,$.c)(4),n,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsx)(`title`,{children:`Textbox`}),r=(0,Z.jsx)(`path`,{d:`M112,40a8,8,0,0,0-8,8V64H24A16,16,0,0,0,8,80v96a16,16,0,0,0,16,16h80v16a8,8,0,0,0,16,0V48A8,8,0,0,0,112,40ZM24,176V80h80v96ZM248,80v96a16,16,0,0,1-16,16H144a8,8,0,0,1,0-16h88V80H144a8,8,0,0,1,0-16h88A16,16,0,0,1,248,80ZM88,112a8,8,0,0,1-8,8H72v24a8,8,0,0,1-16,0V120H48a8,8,0,0,1,0-16H80A8,8,0,0,1,88,112Z`}),t[0]=n,t[1]=r):(n=t[0],r=t[1]);let i;return t[2]===e?i=t[3]:(i=(0,Z.jsxs)(AM,{...e,viewBox:`0 0 256 256`,fill:`currentColor`,children:[n,r]}),t[2]=e,t[3]=i),i};function NM(e){let t=(0,$.c)(29),{isSourceMode:n,onModeChange:r,sourceDisabled:i}=e,a=i===void 0?!1:i,{_:o}=an(),s=n?`source`:`wysiwyg`,c;t[0]===r?c=t[1]:(c=e=>{e&&r(e)},t[0]=r,t[1]=c);let l;t[2]===o?l=t[3]:(l=o({id:`n7aopT`}),t[2]=o,t[3]=l);let u;t[4]===o?u=t[5]:(u=o({id:`ur2XSb`}),t[4]=o,t[5]=u);let d;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Z.jsx)(As,{children:(0,Z.jsx)(MM,{className:`size-4`})}),t[6]=d):d=t[6];let f;t[7]===u?f=t[8]:(f=(0,Z.jsx)(Bc,{value:`wysiwyg`,"aria-label":u,className:`size-7 px-0 dark:data-[state=on]:bg-foreground/15`,asChild:!0,children:d}),t[7]=u,t[8]=f);let p;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Z.jsx)(js,{side:`bottom`,children:(0,Z.jsx)(J,{id:`Mb_20S`})}),t[9]=p):p=t[9];let m;t[10]===f?m=t[11]:(m=(0,Z.jsxs)(Ns,{children:[f,p]}),t[10]=f,t[11]=m);let h;t[12]===o?h=t[13]:(h=o({id:`xbdtfY`}),t[12]=o,t[13]=h);let g;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,Z.jsx)(jM,{className:`size-4`}),t[14]=g):g=t[14];let _;t[15]!==a||t[16]!==h?(_=(0,Z.jsx)(As,{asChild:!0,children:(0,Z.jsx)(`div`,{children:(0,Z.jsx)(Bc,{value:`source`,"aria-label":h,disabled:a,className:`size-7 px-0 dark:data-[state=on]:bg-foreground/15`,children:g})})}),t[15]=a,t[16]=h,t[17]=_):_=t[17];let v;t[18]===a?v=t[19]:(v=(0,Z.jsx)(js,{side:`bottom`,children:a?(0,Z.jsx)(J,{id:`G-JBA1`}):(0,Z.jsx)(J,{id:`u6Hp4N`})}),t[18]=a,t[19]=v);let y;t[20]!==_||t[21]!==v?(y=(0,Z.jsxs)(Ns,{children:[_,v]}),t[20]=_,t[21]=v,t[22]=y):y=t[22];let b;return t[23]!==y||t[24]!==s||t[25]!==c||t[26]!==l||t[27]!==m?(b=(0,Z.jsxs)(Hc,{type:`single`,value:s,onValueChange:c,"aria-label":l,variant:`segmented`,size:`sm`,spacing:1,className:`shrink-0 bg-muted p-0.5 data-[size=sm]:rounded-[10px]`,children:[m,y]}),t[23]=y,t[24]=s,t[25]=c,t[26]=l,t[27]=m,t[28]=b):b=t[28],b}var PM=(0,Q.lazy)(async()=>({default:(await n(async()=>{let{SkillEditorActions:e}=await import(`./SkillEditorActions-pVw4b49f.js`);return{SkillEditorActions:e}},__vite__mapDeps([90,1,10,3,11,6,7,13,75,20,15,16,12,17,55,56,18,58,60,34,59,80,76,61,53,64,81,69,37,66]),import.meta.url)).SkillEditorActions}));function FM(e){let t=(0,$.c)(82),{activeDocName:n,isSourceMode:r,sourceDisabled:i,onModeChange:a,showAddPropertyButton:o,onAddProperty:s,isPanelCollapsed:c,onTogglePanel:l,reserveRightGutter:u}=e,d=u===void 0?!1:u,{_:f}=an(),p;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(p=Nl(`toggle-document-panel`),t[0]=p):p=t[0];let m=p,h,g,_,v,y,b,x,S,C,w,T,E,D,O,k;if(t[1]!==f||t[2]!==n||t[3]!==c||t[4]!==r||t[5]!==s||t[6]!==a||t[7]!==l||t[8]!==d||t[9]!==o||t[10]!==i){let e=Fl(`toggle-document-panel`),u;t[26]===n?u=t[27]:(u=n?Or(n):null,t[26]=n,t[27]=u);let p=u,m;t[28]===n?m=t[29]:(m=n?K(n):null,t[28]=n,t[29]=m);let A=m,j;t[30]!==p||t[31]!==A?(j=p?.kind===`skill`?{scope:p.scope,name:p.name}:A?{scope:`project`,name:A}:null,t[30]=p,t[31]=A,t[32]=j):j=t[32];let M=j;b=`editor-toolbar`,x=`pointer-events-none absolute inset-x-0 top-0 z-10`;let N;t[33]!==n||t[34]!==M?(N=M?null:(0,Z.jsx)(DM,{docName:n}),t[33]=n,t[34]=M,t[35]=N):N=t[35];let P;t[36]===N?P=t[37]:(P=(0,Z.jsx)(`div`,{className:`pointer-events-auto flex min-w-0 items-center`,children:N}),t[36]=N,t[37]=P);let F;t[38]!==r||t[39]!==a||t[40]!==i?(F=(0,Z.jsx)(`div`,{className:`pointer-events-auto flex justify-center`,children:(0,Z.jsx)(NM,{isSourceMode:r,onModeChange:a,sourceDisabled:i})}),t[38]=r,t[39]=a,t[40]=i,t[41]=F):F=t[41],t[42]!==P||t[43]!==F?(S=(0,Z.jsx)(`div`,{className:`editor-content-aligned bg-background py-2`,children:(0,Z.jsxs)(`div`,{className:`grid grid-cols-3 items-center`,children:[P,F]})}),t[42]=P,t[43]=F,t[44]=S):S=t[44];let I=d&&`pr-9`;t[45]===I?_=t[46]:(_=Y(`pointer-events-auto absolute top-0 right-0 flex items-center justify-end gap-1 py-2 pr-2`,I),t[45]=I,t[46]=_),t[47]===M?v=t[48]:(v=M?(0,Z.jsx)(Q.Suspense,{fallback:null,children:(0,Z.jsx)(PM,{scope:M.scope,name:M.name})}):null,t[47]=M,t[48]=v),t[49]!==f||t[50]!==s||t[51]!==o?(y=o&&(0,Z.jsxs)(Ns,{children:[(0,Z.jsx)(X,{variant:`ghost`,size:`icon`,"aria-label":f({id:`81H_23`}),onClick:s,"data-testid":`add-properties-button`,asChild:!0,children:(0,Z.jsx)(As,{children:(0,Z.jsx)(ef,{})})}),(0,Z.jsx)(js,{side:`bottom`,children:(0,Z.jsx)(J,{id:`81H_23`})})]}),t[49]=f,t[50]=s,t[51]=o,t[52]=y):y=t[52],g=Ns,h=X,C=``,w=`ghost`,T=`icon`,E=l,D=!c,O=`doc-panel`,k=f(c?{id:`u7H-Wn`,values:{panelShortcutLabel:e}}:{id:`2hpdRq`,values:{panelShortcutLabel:e}}),t[1]=f,t[2]=n,t[3]=c,t[4]=r,t[5]=s,t[6]=a,t[7]=l,t[8]=d,t[9]=o,t[10]=i,t[11]=h,t[12]=g,t[13]=_,t[14]=v,t[15]=y,t[16]=b,t[17]=x,t[18]=S,t[19]=C,t[20]=w,t[21]=T,t[22]=E,t[23]=D,t[24]=O,t[25]=k}else h=t[11],g=t[12],_=t[13],v=t[14],y=t[15],b=t[16],x=t[17],S=t[18],C=t[19],w=t[20],T=t[21],E=t[22],D=t[23],O=t[24],k=t[25];let A;t[53]===c?A=t[54]:(A=(0,Z.jsx)(As,{children:c?(0,Z.jsx)(ff,{}):(0,Z.jsx)(df,{})}),t[53]=c,t[54]=A);let j;t[55]!==h||t[56]!==A||t[57]!==C||t[58]!==w||t[59]!==T||t[60]!==E||t[61]!==D||t[62]!==O||t[63]!==k?(j=(0,Z.jsx)(h,{"data-doc-panel-toggle":C,variant:w,size:T,onClick:E,"aria-expanded":D,"aria-controls":O,"aria-label":k,asChild:!0,children:A}),t[55]=h,t[56]=A,t[57]=C,t[58]=w,t[59]=T,t[60]=E,t[61]=D,t[62]=O,t[63]=k,t[64]=j):j=t[64];let M;t[65]===c?M=t[66]:(M=(0,Z.jsx)(js,{side:`bottom`,children:c?(0,Z.jsx)(J,{id:`KFdXwz`,values:{panelShortcut:m}}):(0,Z.jsx)(J,{id:`MsuXaI`,values:{panelShortcut:m}})}),t[65]=c,t[66]=M);let N;t[67]!==g||t[68]!==j||t[69]!==M?(N=(0,Z.jsxs)(g,{children:[j,M]}),t[67]=g,t[68]=j,t[69]=M,t[70]=N):N=t[70];let P;t[71]!==_||t[72]!==v||t[73]!==y||t[74]!==N?(P=(0,Z.jsxs)(`div`,{className:_,children:[v,y,N]}),t[71]=_,t[72]=v,t[73]=y,t[74]=N,t[75]=P):P=t[75];let F;t[76]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,Z.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none h-2 bg-linear-to-b from-background to-transparent`}),t[76]=F):F=t[76];let I;return t[77]!==b||t[78]!==x||t[79]!==S||t[80]!==P?(I=(0,Z.jsxs)(`div`,{"data-testid":b,className:x,children:[S,P,F]}),t[77]=b,t[78]=x,t[79]=S,t[80]=P,t[81]=I):I=t[81],I}function IM(e){let{activeDocName:t,deferredActiveDocName:n,mountResolved:r,syncResolved:i}=e;return t===null||t===n?!1:!(r&&i)}function LM(e){let{currentLayout:t,containerPx:n,pinnedPx:r,residualId:i}=e;if(n<=0||!(i in t))return t;let a={...t},o=0;for(let[e,i]of Object.entries(r)){if(!(e in t))continue;let r=i/n*100;a[e]=r,o+=r}let s=0;for(let[e,n]of Object.entries(t))e===i||e in r||(s+=n);let c=100-o-s;return c<0?t:(a[i]=c,a)}var RM=`ok-terminal-height-v1`,zM=1/3,BM=.5;function VM(e){return Math.max(120,Math.round((Number.isFinite(e)?e:0)*BM))}function HM(e){let t=Number.isFinite(e)?e:0;return t<=0?240:Math.round(t*zM)}function UM(e,t){let n=VM(t);return Number.isFinite(e)?e<120?120:e>n?n:Math.round(e):Math.min(HM(t),n)}function WM(){return typeof window>`u`?0:window.innerHeight}function GM(e,t){try{let n=e??localStorage,r=t??WM(),i=n.getItem(RM);if(i==null)return UM(HM(r),r);let a=Number.parseInt(i,10);return UM(Number.isFinite(a)?a:HM(r),r)}catch{return 240}}function KM(e,t,n){try{let r=t??localStorage,i=n??WM();r.setItem(RM,String(UM(e,i)))}catch{}}function qM(){try{return typeof localStorage>`u`?240:GM()}catch{return 240}}function JM(e){let t=(0,$.c)(19),{dockPosition:n,onReveal:r,className:i}=e,{_:a}=an(),o=n===`right`,s;t[0]===a?s=t[1]:(s=a({id:`0SBTff`}),t[0]=a,t[1]=s);let c=s,l=o?`rounded-r-none border-r-0`:`rounded-b-none border-b-0`,u;t[2]!==i||t[3]!==l?(u=Y(`absolute z-20 shrink-0 bg-background text-muted-foreground shadow-sm hover:text-foreground`,l,i),t[2]=i,t[3]=l,t[4]=u):u=t[4];let d;t[5]===o?d=t[6]:(d=o?(0,Z.jsx)(Xi,{"aria-hidden":`true`}):(0,Z.jsx)(Le,{"aria-hidden":`true`}),t[5]=o,t[6]=d);let f;t[7]!==n||t[8]!==c||t[9]!==r||t[10]!==u||t[11]!==d?(f=(0,Z.jsx)(As,{asChild:!0,children:(0,Z.jsx)(X,{type:`button`,variant:`outline`,size:`icon-sm`,"aria-label":c,"data-terminal-reveal":n,onClick:r,className:u,children:d})}),t[7]=n,t[8]=c,t[9]=r,t[10]=u,t[11]=d,t[12]=f):f=t[12];let p=o?`left`:`top`,m;t[13]!==c||t[14]!==p?(m=(0,Z.jsx)(js,{side:p,sideOffset:8,children:c}),t[13]=c,t[14]=p,t[15]=m):m=t[15];let h;return t[16]!==f||t[17]!==m?(h=(0,Z.jsxs)(Ns,{children:[f,m]}),t[16]=f,t[17]=m,t[18]=h):h=t[18],h}var YM=`terminal-dock-panel`;function XM(e){let t=(0,$.c)(44),{children:n,visible:r,onVisibleChange:i,dockPosition:a,onBottomContainer:o,onEditorRegion:s,onReveal:c}=e,l=a===void 0?`bottom`:a,{resolvedTheme:u}=Ln(),d=Vb(),[f,p]=(0,Q.useState)(!r),m;t[0]===u?m=t[1]:(m=Eu(u),t[0]=u,t[1]=m);let h=m.background,g=r&&l===`bottom`,_=!r&&l===`bottom`&&c!=null,[v]=(0,Q.useState)(ZM),y=(0,Q.useRef)(v),[b,x]=(0,Q.useState)(!1),S=(0,Q.useRef)(!1),C=(0,Q.useRef)(null),w;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(w=function(e){C.current!=null&&clearTimeout(C.current),C.current=setTimeout(()=>{KM(e),C.current=null},100)},t[2]=w):w=t[2];let T=w,E=(0,Q.useRef)(null),D,O;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(D=()=>()=>{C.current!=null&&clearTimeout(C.current),E.current!=null&&(window.removeEventListener(`pointerup`,E.current),E.current=null)},O=[],t[3]=D,t[4]=O):(D=t[3],O=t[4]),(0,Q.useEffect)(D,O);let k,A;t[5]!==g||t[6]!==d?(k=()=>{let e=d.current;e!=null&&(g?e.resize(`${y.current}px`):e.collapse())},A=[g,d],t[5]=g,t[6]=d,t[7]=k,t[8]=A):(k=t[7],A=t[8]),(0,Q.useEffect)(k,A);let j=b||void 0,M;t[9]!==c||t[10]!==_?(M=_&&c?(0,Z.jsx)(JM,{dockPosition:`bottom`,onReveal:c,className:`right-3 bottom-0`}):null,t[9]=c,t[10]=_,t[11]=M):M=t[11];let N;t[12]!==n||t[13]!==s||t[14]!==M?(N=(0,Z.jsx)(GC,{minSize:`5%`,className:`flex min-h-0 flex-col`,children:(0,Z.jsxs)(`div`,{ref:s,tabIndex:-1,className:`relative flex h-full min-h-0 flex-col outline-none`,children:[n,M]})}),t[12]=n,t[13]=s,t[14]=M,t[15]=N):N=t[15];let P=!g,F;t[16]===g?F=t[17]:(F=()=>{if(!g)return;x(!0),S.current=!0;let e=()=>{x(!1),S.current=!1,window.removeEventListener(`pointerup`,e),E.current=null};E.current=e,window.addEventListener(`pointerup`,e)},t[16]=g,t[17]=F);let I;t[18]!==g||t[19]!==P||t[20]!==F?(I=(0,Z.jsx)(KC,{withHandle:g,disabled:P,onPointerDown:F}),t[18]=g,t[19]=P,t[20]=F,t[21]=I):I=t[21];let L;t[22]===h?L=t[23]:(L={backgroundColor:h},t[22]=h,t[23]=L);let R=g?`${v}px`:0,z;t[24]!==i||t[25]!==r?(z=e=>{let t=e.asPercentage===0;p(t),S.current&&(t&&r?i(!1):!t&&!r&&i(!0),e.inPixels>0&&(y.current=e.inPixels,T(e.inPixels)))},t[24]=i,t[25]=r,t[26]=z):z=t[26];let B=!b&&`transition-[flex-grow] duration-150 ease-out motion-reduce:transition-none motion-reduce:duration-0`,V;t[27]===B?V=t[28]:(V=Y(`flex flex-col`,B),t[27]=B,t[28]=V);let H;t[29]===o?H=t[30]:(H=(0,Z.jsx)(`div`,{ref:o,className:`flex min-h-0 flex-1 flex-col overflow-hidden`}),t[29]=o,t[30]=H);let U;t[31]!==f||t[32]!==d||t[33]!==L||t[34]!==R||t[35]!==z||t[36]!==V||t[37]!==H?(U=(0,Z.jsx)(GC,{id:YM,style:L,panelRef:d,defaultSize:R,minSize:`120px`,maxSize:`95%`,collapsible:!0,collapsedSize:0,onResize:z,inert:f,className:V,children:H}),t[31]=f,t[32]=d,t[33]=L,t[34]=R,t[35]=z,t[36]=V,t[37]=H,t[38]=U):U=t[38];let W;return t[39]!==N||t[40]!==I||t[41]!==U||t[42]!==j?(W=(0,Z.jsxs)(WC,{orientation:`vertical`,className:`min-h-0 flex-1`,"data-dragging":j,children:[N,I,U]}),t[39]=N,t[40]=I,t[41]=U,t[42]=j,t[43]=W):W=t[43],W}function ZM(){return qM()}var QM=(0,Q.lazy)(async()=>({default:(await n(()=>import(`./ActivityModeContent-FXULq3P6.js`),__vite__mapDeps([40,1,2,41,42,43,11,44,45,46,47,48,49,50,51,20,15,13,7,16,10,3,52,53,37,12,6,4,54,17,55,56,19,57,58,59,60,31,32,33,34,35,61,62,63,64,36,65,66,67,68,69]),import.meta.url)).ActivityModeContent})),$M=`300px`,eN=`600px`,tN=new Set([`doc-panel`,`terminal-column`,`agent-panel`]);function nN(e){let t=(0,$.c)(5),n;t[0]===e?n=t[1]:(n=(0,Z.jsx)(iN,{...e}),t[0]=e,t[1]=n);let r;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Z.jsx)(rN,{}),t[2]=r):r=t[2];let i;return t[3]===n?i=t[4]:(i=(0,Z.jsx)(vl,{name:`editor-area`,children:(0,Z.jsxs)(Vi,{children:[n,r]})}),t[3]=n,t[4]=i),i}function rN(){let e=(0,$.c)(5),t=Ha(),n;e[0]===t?n=e[1]:(n=e=>{e||t.close()},e[0]=t,e[1]=n);let r;return e[2]!==t.open||e[3]!==n?(r=(0,Z.jsx)(zC,{open:t.open,onOpenChange:n}),e[2]=t.open,e[3]=n,e[4]=r):r=e[4],r}function iN(e){let t=(0,$.c)(248),{editorMode:n,onModeChange:r,activeTab:i,onActiveTabChange:a,terminalBridge:o,terminalVisible:s,onTerminalVisibleChange:c,terminalDock:l,onTerminalPlacement:u,onRevealTerminal:d}=e,f=s===void 0?!1:s,m=l===void 0?`right`:l,{_:h}=an(),{resolvedTheme:g}=Ln(),_;t[0]===g?_=t[1]:(_=Eu(g),t[0]=g,t[1]=_);let v=_.background,{activeDocName:y,activeProvider:b,activeTarget:x,recycleDocument:S,docPanelMode:C,docPanelAgentId:w,docPanelExpandSignal:T}=vt(),{openDocumentTransition:E}=jt(),{requestAddProperty:D}=Ri(),O=mw(b,y),k=_w(y,n===`source`?`source`:`wysiwyg`),A=Hw(b),j=A===`connected`||A===`synced`,M=gw(y)===`conflict`,[N,P]=(0,Q.useState)(!1),F,I;t[2]!==b||t[3]!==N?(F=()=>{b!=null&&!N&&P(!0)},I=[b,N],t[2]=b,t[3]=N,t[4]=F,t[5]=I):(F=t[4],I=t[5]),(0,Q.useEffect)(F,I);let L=(0,Q.useDeferredValue)(y),R=x?.kind===`missing`,z=!!y&&x?.kind!==`folder`,B;t[6]!==h||t[7]!==R?(B=R?h({id:`K-a33w`}):void 0,t[6]=h,t[7]=R,t[8]=B):B=t[8];let V=B,H=(0,Q.useSyncExternalStore)(Di.subscribe,Di.getSnapshot,Di.getSnapshot),U;t[9]!==x||t[10]!==H?(U=ji(x,H),t[9]=x,t[10]=H,t[11]=U):U=t[11];let W=U,[G]=(0,Q.useState)(lN),K=G!==null,ee;t[12]===G?ee=t[13]:(ee=()=>Ew(G,window.innerWidth,`right`),t[12]=G,t[13]=ee);let[te,ne]=(0,Q.useState)(ee),re=(0,Q.useRef)(te),ie,ae;t[14]===te?(ie=t[15],ae=t[16]):(ae=()=>{re.current=te},ie=[te],t[14]=te,t[15]=ie,t[16]=ae),(0,Q.useEffect)(ae,ie);let oe=Vb(),se=Vb(),ce;t[17]===te?ce=t[18]:(ce=()=>Fw(`right`,te,Nw())===`collapsed`,t[17]=te,t[18]=ce);let[le]=(0,Q.useState)(ce),[q,ue]=(0,Q.useState)(le),de=(0,Q.useRef)(q),[fe,pe]=(0,Q.useState)(null),[me,he]=(0,Q.useState)(null),[ge,_e]=(0,Q.useState)(null),ve=m===`right`,ye=ve?`right`:`bottom`,be=o!=null&&ve&&f,xe=o!=null&&!f&&d!=null,Se=xe&&!ve,Ce=xe&&ve,we=ve&&f&&fe!=null,Te=we?fe:me,Ee=(ve?we:f)&&Te!=null,De,Oe;t[19]!==Te||t[20]!==u||t[21]!==ye||t[22]!==ge||t[23]!==Ee?(De=()=>{u?.({container:Te,isShowing:Ee,dockPosition:ye,editorRegion:ge})},Oe=[u,Te,Ee,ye,ge],t[19]=Te,t[20]=u,t[21]=ye,t[22]=ge,t[23]=Ee,t[24]=De,t[25]=Oe):(De=t[24],Oe=t[25]),(0,Q.useEffect)(De,Oe);let ke,Ae;t[26]===q?(ke=t[27],Ae=t[28]):(ke=()=>{de.current=q},Ae=[q],t[26]=q,t[27]=ke,t[28]=Ae),(0,Q.useEffect)(ke,Ae);let[je,Me]=(0,Q.useState)(!1),Ne=(0,Q.useRef)(!1),[Pe]=(0,Q.useState)(cN),Ie=(0,Q.useRef)(Pe),Le=(0,Q.useRef)(null),Re;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(Re=function(e){Le.current!=null&&clearTimeout(Le.current),Le.current=setTimeout(()=>{xw(e),Le.current=null},100)},t[29]=Re):Re=t[29];let ze=Re,[Be]=(0,Q.useState)(sN),Ve=(0,Q.useRef)(Be),[He,Ue]=(0,Q.useState)(!1),We=(0,Q.useRef)(!1),Ge=(0,Q.useRef)(null),Ke;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(Ke=function(e){Ge.current!=null&&clearTimeout(Ge.current),Ge.current=setTimeout(()=>{Bw(e),Ge.current=null},100)},t[30]=Ke):Ke=t[30];let qe=Ke,Je,Ye;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(Je=()=>()=>{Le.current!=null&&clearTimeout(Le.current),Ge.current!=null&&clearTimeout(Ge.current)},Ye=[],t[31]=Je,t[32]=Ye):(Je=t[31],Ye=t[32]),(0,Q.useEffect)(Je,Ye);let[Xe,Ze]=(0,Q.useState)(null),Qe=(0,Q.useRef)(null),$e=Ib(),et=(0,Q.useRef)(be),tt,nt;t[33]===be?(tt=t[34],nt=t[35]):(tt=()=>{et.current=be},nt=[be],t[33]=be,t[34]=tt,t[35]=nt),(0,Q.useEffect)(tt,nt);let rt;t[36]!==oe||t[37]!==se?(rt=function(){for(let e of[oe,se]){let t=e.current?.getSize();if(t!=null&&t.asPercentage>1&&t.inPixels>0)return t.inPixels/t.asPercentage*100}let e=Qe.current;return e!=null&&e.offsetWidth>0?e.offsetWidth:null},t[36]=oe,t[37]=se,t[38]=rt):rt=t[38];let it=rt,at;t[39]!==$e||t[40]!==it?(at=function(e){if(Ne.current||We.current)return;let t=$e.current;if(t!=null)try{let n=it();if(n==null)return;let r=t.getLayout(),i=Object.keys(r);if(i.length===0)return;let a=i.find(oN);if(a==null)return;let o={};if(`doc-panel`in r&&(o[`doc-panel`]=e?0:Ie.current),`terminal-column`in r&&(o[`terminal-column`]=Ve.current),Object.keys(o).length===0)return;let s=LM({currentLayout:r,containerPx:n,pinnedPx:o,residualId:a});s!==r&&t.setLayout(s)}catch{}},t[39]=$e,t[40]=it,t[41]=at):at=t[41];let ot=at,st=(0,Q.useRef)(ot),ct;t[42]===ot?ct=t[43]:(ct=()=>{st.current=ot},t[42]=ot,t[43]=ct),(0,Q.useEffect)(ct);let lt;t[44]!==ot||t[45]!==oe?(lt=function(){et.current?ot(!1):oe.current?.expand()},t[44]=ot,t[45]=oe,t[46]=lt):lt=t[46];let ut=lt,dt;t[47]!==ot||t[48]!==q||t[49]!==oe?(dt=function(){if(oe.current==null)return;let e=re.current;q?(Iw(`right`,e,`open`),et.current?ot(!1):oe.current?.expand()):(Iw(`right`,e,`collapsed`),et.current?ot(!0):oe.current?.collapse())},t[47]=ot,t[48]=q,t[49]=oe,t[50]=dt):dt=t[50];let ft=dt,pt,mt;t[51]!==ot||t[52]!==G||t[53]!==oe?(pt=()=>{let e=window.matchMedia(`(min-width: ${ww}px)`),t=()=>{let e=Ew(G,window.innerWidth,`right`);ne(e);let t=Fw(`right`,e,Nw())===`collapsed`;ue(t),et.current?ot(t):t?oe.current?.collapse():oe.current?.expand()};return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},mt=[G,oe,ot],t[51]=ot,t[52]=G,t[53]=oe,t[54]=pt,t[55]=mt):(pt=t[54],mt=t[55]),(0,Q.useEffect)(pt,mt);let ht,gt;t[56]!==Xe||t[57]!==K?(ht=()=>{if(Xe==null||K)return;let e=new ResizeObserver(()=>{st.current(de.current)});return e.observe(Xe),()=>e.disconnect()},gt=[Xe,K],t[56]=Xe,t[57]=K,t[58]=ht,t[59]=gt):(ht=t[58],gt=t[59]),(0,Q.useEffect)(ht,gt);let _t,yt;t[60]!==ut||t[61]!==a?(_t=()=>{let e=e=>{a(e),ut()},t=ih();return t&&e(t),oh(t=>{ih(),e(t)})},yt=[a,ut],t[60]=ut,t[61]=a,t[62]=_t,t[63]=yt):(_t=t[62],yt=t[63]),(0,Q.useEffect)(_t,yt);let bt,xt;t[64]!==T||t[65]!==ut?(bt=()=>{T!==0&&ut()},xt=[T,ut],t[64]=T,t[65]=ut,t[66]=bt,t[67]=xt):(bt=t[66],xt=t[67]),(0,Q.useEffect)(bt,xt);let St=(0,Q.useRef)(be),Ct,wt;t[68]!==q||t[69]!==be?(Ct=()=>{if(St.current===be)return;St.current=be;let e=q;queueMicrotask(()=>{st.current(e)})},wt=[be,q],t[68]=q,t[69]=be,t[70]=Ct,t[71]=wt):(Ct=t[70],wt=t[71]),(0,Q.useLayoutEffect)(Ct,wt);let Tt,Et;t[72]===q?(Tt=t[73],Et=t[74]):(Tt=()=>{if(!q||!document.getElementById(`doc-panel`)?.contains(document.activeElement))return;let e=document.querySelector(`[data-doc-panel-toggle]`);if(e){e.focus();return}document.querySelector(`[data-sidebar="trigger"]`)?.focus()},Et=[q],t[72]=q,t[73]=Tt,t[74]=Et),(0,Q.useLayoutEffect)(Tt,Et);let Dt,Ot;t[75]===q?(Dt=t[76],Ot=t[77]):(Dt=()=>{window.okDesktop!=null&&window.okDesktop.editor.notifyViewMenuStateChanged({docPanelVisible:!q})},Ot=[q],t[75]=q,t[76]=Dt,t[77]=Ot),(0,Q.useEffect)(Dt,Ot);let kt,At;t[78]===ft?(kt=t[79],At=t[80]):(kt=()=>{if(window.okDesktop!=null)return window.okDesktop.onMenuAction(e=>{e===`toggle-doc-panel`&&ft()})},At=[ft],t[78]=ft,t[79]=kt,t[80]=At),(0,Q.useEffect)(kt,At);let Mt,Nt;t[81]===ft?(Mt=t[82],Nt=t[83]):(Mt=()=>{if(window.okDesktop!=null)return;let e=e=>{Pl(e,`toggle-document-panel`)&&(e.preventDefault(),ft())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},Nt=[ft],t[81]=ft,t[82]=Mt,t[83]=Nt),(0,Q.useEffect)(Mt,Nt);let Pt=(0,Q.useRef)(null),[Ft,It]=(0,Q.useState)(null),[Lt,Rt]=(0,Q.useState)(!1),zt=x?.kind===`large-file`?x.docName:y,Bt,Vt;t[84]===zt?(Bt=t[85],Vt=t[86]):(Bt=()=>{if(zt&&zt!==Pt.current){let e=Pt.current;Pt.current=zt,It(e)}},Vt=[zt],t[84]=zt,t[85]=Bt,t[86]=Vt),(0,Q.useEffect)(Bt,Vt);let Ht;t[87]===E?Ht=t[88]:(Ht=function(e){let t=kl(e);window.location.hash===t?E(e):window.location.hash=t},t[87]=E,t[88]=Ht);let Ut=Ht,Wt,Gt=null;if(x?.kind===`large-file`){let e;t[89]!==Ut||t[90]!==Ft?(e=Ft?{previousDocName:Ft,onNavigateBack:Ut}:void 0,t[89]=Ut,t[90]=Ft,t[91]=e):e=t[91];let n;t[92]!==x.docName||t[93]!==x.limit||t[94]!==x.size||t[95]!==e?(n=(0,Z.jsx)(xC,{docName:x.docName,size:x.size,limit:x.limit,backNav:e}),t[92]=x.docName,t[93]=x.limit,t[94]=x.size,t[95]=e,t[96]=n):n=t[96],Wt=n}else if(x?.kind===`folder`){let e;t[97]!==K||t[98]!==f?(e=jT({terminalVisible:f,isEmbedded:K}),t[97]=K,t[98]=f,t[99]=e):e=t[99];let n=e,r;t[100]===x.folderPath?r=t[101]:(r=(0,Z.jsx)(_C,{folderPath:x.folderPath}),t[100]=x.folderPath,t[101]=r);let i;t[102]===n?i=t[103]:(i=n?(0,Z.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute inset-x-0 bottom-0 h-2 bg-linear-to-t from-background to-transparent`}):null,t[102]=n,t[103]=i);let a;t[104]!==r||t[105]!==i?(a=(0,Z.jsxs)(`div`,{className:`relative flex min-h-0 flex-1 flex-col`,children:[r,i]}),t[104]=r,t[105]=i,t[106]=a):a=t[106];let o;t[107]!==x.folderPath||t[108]!==n?(o=n?(0,Z.jsx)(vT,{folderPath:x.folderPath}):null,t[107]=x.folderPath,t[108]=n,t[109]=o):o=t[109];let s;if(t[110]!==a||t[111]!==o?(s=(0,Z.jsxs)(`div`,{className:`relative flex h-full min-h-0 flex-col`,children:[a,o]}),t[110]=a,t[111]=o,t[112]=s):s=t[112],Wt=s,C===`agent`&&w!==null){let e;t[113]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(KC,{withHandle:!0}),t[113]=e):e=t[113];let n;t[114]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsxs)(Z.Fragment,{children:[e,(0,Z.jsx)(GC,{id:`agent-panel`,defaultSize:`25%`,minSize:`300px`,maxSize:`40%`,className:`flex flex-col bg-muted/20`,children:(0,Z.jsx)(Q.Suspense,{fallback:(0,Z.jsx)(`div`,{role:`status`,"aria-busy":`true`,className:`flex h-full items-center justify-center text-sm text-muted-foreground`,children:(0,Z.jsx)(J,{id:`ONPvOb`})}),children:(0,Z.jsx)(QM,{showBackButton:!1})})})]}),t[114]=n):n=t[114],Gt=n}}else if(x?.kind===`asset`){let e;t[115]!==x.assetPath||t[116]!==x.mediaKind?(e=(0,Z.jsx)(rx,{assetPath:x.assetPath,mediaKind:x.mediaKind},x.assetPath),t[115]=x.assetPath,t[116]=x.mediaKind,t[117]=e):e=t[117],Wt=e}else if(x?.kind===`skill-file`){let e=`${x.scope}/${x.name}/${x.path}`,n;t[118]!==x.name||t[119]!==x.path||t[120]!==x.scope||t[121]!==e?(n=(0,Z.jsx)(AC,{scope:x.scope,name:x.name,path:x.path},e),t[118]=x.name,t[119]=x.path,t[120]=x.scope,t[121]=e,t[122]=n):n=t[122],Wt=n}else if(W){let e;t[123]===W?e=t[124]:(e=(0,Z.jsx)(wC,{nav:W},W.path),t[123]=W,t[124]=e),Wt=e}else if(!b||!y)if((typeof window<`u`?Ol(window.location.hash):null)!==null)if(o!=null&&N){let e;t[125]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(ix,{}),t[125]=e):e=t[125],Wt=e;let n;t[126]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsx)(KC,{withHandle:!0,disabled:!0}),t[126]=n):n=t[126];let r=le?0:`${Pe}px`,i;t[127]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsx)(`div`,{className:`min-h-0 flex-1`}),t[127]=i):i=t[127];let a;t[128]===r?a=t[129]:(a=(0,Z.jsxs)(Z.Fragment,{children:[n,(0,Z.jsx)(GC,{id:`doc-panel`,defaultSize:r,minSize:$M,maxSize:eN,collapsible:!0,collapsedSize:0,inert:!0,className:`flex flex-col bg-muted/20`,children:i})]}),t[128]=r,t[129]=a),Gt=a}else{let e;return t[130]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(ix,{}),t[130]=e):e=t[130],e}else{let e=f?ye:null,n;t[131]===e?n=t[132]:(n=(0,Z.jsx)(RS,{terminalDock:e}),t[131]=e,t[132]=n),Wt=n}else{let e=n===`source`,o=!j,s=q,c;t[133]!==y||t[134]!==D?(c=function(){y&&D(y)},t[133]=y,t[134]=D,t[135]=c):c=t[135];let l=c,u;t[136]!==y||t[137]!==K||t[138]!==f?(u=AT({terminalVisible:f,isEmbedded:K,activeDocName:y}),t[136]=y,t[137]=K,t[138]=f,t[139]=u):u=t[139];let d=u,m=L??y,h=Ft??void 0,g;t[140]!==V||t[141]!==e||t[142]!==Ut||t[143]!==S||t[144]!==m||t[145]!==h?(g=(0,Z.jsx)(gj,{activeDocName:m,isSourceMode:e,editorPlaceholder:V,previousDocName:h,onNavigateBack:Ut,onRecycle:S}),t[140]=V,t[141]=e,t[142]=Ut,t[143]=S,t[144]=m,t[145]=h,t[146]=g):g=t[146];let _;t[147]!==y||t[148]!==e?(_=(0,Z.jsx)(uw,{activeDocName:y,isSourceMode:e}),t[147]=y,t[148]=e,t[149]=_):_=t[149];let v;t[150]!==y||t[151]!==L?(v=IM({activeDocName:y,deferredActiveDocName:L,mountResolved:y!==null&&p(y),syncResolved:y!==null&&Fe(y)})?(0,Z.jsxs)(`div`,{className:`absolute inset-0 z-10 bg-background`,children:[(0,Z.jsx)(ix,{}),y===null?null:(0,Z.jsx)(SC,{docName:y})]}):null,t[150]=y,t[151]=L,t[152]=v):v=t[152];let b;t[153]!==g||t[154]!==_||t[155]!==v?(b=(0,Z.jsxs)(`div`,{className:`relative h-full`,children:[g,_,v]}),t[153]=g,t[154]=_,t[155]=v,t[156]=b):b=t[156];let x;t[157]!==y||t[158]!==M||t[159]!==s||t[160]!==e||t[161]!==r||t[162]!==l||t[163]!==Ce||t[164]!==o||t[165]!==ft?(x=!M&&(0,Z.jsx)(FM,{activeDocName:y,isSourceMode:e,sourceDisabled:o,onModeChange:r,showAddPropertyButton:!e,onAddProperty:l,isPanelCollapsed:s,onTogglePanel:ft,reserveRightGutter:Ce&&s}),t[157]=y,t[158]=M,t[159]=s,t[160]=e,t[161]=r,t[162]=l,t[163]=Ce,t[164]=o,t[165]=ft,t[166]=x):x=t[166];let w;t[167]!==y||t[168]!==Lt||t[169]!==e||t[170]!==d?(w=d?(0,Z.jsx)(vT,{docName:y,surface:e?`source`:`wysiwyg`,dismissed:Lt,onDismiss:()=>Rt(!0),onReopen:()=>Rt(!1)}):null,t[167]=y,t[168]=Lt,t[169]=e,t[170]=d,t[171]=w):w=t[171];let T;t[172]!==b||t[173]!==x||t[174]!==w?(T=(0,Z.jsxs)(`div`,{className:`relative min-h-0 flex-1`,children:[b,x,w]}),t[172]=b,t[173]=x,t[174]=w,t[175]=T):T=t[175];let E;t[176]!==Lt||t[177]!==d?(E=d&&Lt?{onReopen:()=>Rt(!1)}:null,t[176]=Lt,t[177]=d,t[178]=E):E=t[178];let A;t[179]!==Se||t[180]!==k||t[181]!==z||t[182]!==O||t[183]!==E?(A=(0,Z.jsx)(_M,{stats:O,selectionStats:k,showStats:z,composerBadge:E,reserveRightGutter:Se}),t[179]=Se,t[180]=k,t[181]=z,t[182]=O,t[183]=E,t[184]=A):A=t[184];let N;t[185]!==T||t[186]!==A?(N=(0,Z.jsxs)(`div`,{className:`relative flex h-full flex-col`,children:[T,A]}),t[185]=T,t[186]=A,t[187]=N):N=t[187],Wt=N;let P=be&&q,F=!q,I;t[188]===Symbol.for(`react.memo_cache_sentinel`)?(I=()=>{Me(!0),Ne.current=!0;let e=()=>{Me(!1),Ne.current=!1,window.removeEventListener(`pointerup`,e)};window.addEventListener(`pointerup`,e)},t[188]=I):I=t[188];let R;t[189]!==q||t[190]!==F?(R=(0,Z.jsx)(KC,{withHandle:F,disabled:q,onPointerDown:I}),t[189]=q,t[190]=F,t[191]=R):R=t[191];let B=le?0:`${Pe}px`,H=P?`0px`:$M,U;t[192]===Symbol.for(`react.memo_cache_sentinel`)?(U=e=>{ue(e.asPercentage===0),e.inPixels>0&&Ne.current&&(Ie.current=e.inPixels,ze(e.inPixels))},t[192]=U):U=t[192];let W=!je&&`transition-[flex-grow] duration-200 ease-out motion-reduce:transition-none motion-reduce:duration-0`,G;t[193]===W?G=t[194]:(G=Y(`flex flex-col bg-muted/20`,W),t[193]=W,t[194]=G);let ee;t[195]!==y||t[196]!==i||t[197]!==C||t[198]!==e||t[199]!==a?(ee=(0,Z.jsx)(Kv,{docName:y,isSourceMode:e,activeTab:i,onActiveTabChange:a,mode:C}),t[195]=y,t[196]=i,t[197]=C,t[198]=e,t[199]=a,t[200]=ee):ee=t[200];let te;t[201]!==P||t[202]!==q||t[203]!==oe||t[204]!==B||t[205]!==H||t[206]!==G||t[207]!==ee?(te=(0,Z.jsx)(GC,{id:`doc-panel`,panelRef:oe,disabled:P,defaultSize:B,minSize:H,maxSize:eN,collapsible:!0,collapsedSize:0,onResize:U,inert:q,className:G,children:ee}),t[201]=P,t[202]=q,t[203]=oe,t[204]=B,t[205]=H,t[206]=G,t[207]=ee,t[208]=te):te=t[208];let ne;t[209]!==R||t[210]!==te?(ne=(0,Z.jsxs)(Z.Fragment,{children:[R,te]}),t[209]=R,t[210]=te,t[211]=ne):ne=t[211],Gt=ne}let Kt;t[212]!==d||t[213]!==c||t[214]!==o||t[215]!==ye||t[216]!==f||t[217]!==Wt?(Kt=o==null?Wt:(0,Z.jsx)(XM,{visible:f,onVisibleChange:c??aN,dockPosition:ye,onBottomContainer:he,onEditorRegion:_e,onReveal:d,children:Wt}),t[212]=d,t[213]=c,t[214]=o,t[215]=ye,t[216]=f,t[217]=Wt,t[218]=Kt):Kt=t[218];let qt=Kt,Jt;t[219]!==Be||t[220]!==He||t[221]!==c||t[222]!==se||t[223]!==be||t[224]!==v?(Jt=be?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(KC,{withHandle:!0,onPointerDown:()=>{Ue(!0),We.current=!0;let e=()=>{Ue(!1),We.current=!1,window.removeEventListener(`pointerup`,e),se.current?.isCollapsed()&&c?.(!1)};window.addEventListener(`pointerup`,e)}}),(0,Z.jsx)(GC,{id:`terminal-column`,panelRef:se,style:{backgroundColor:v},defaultSize:`${Be}px`,minSize:`320px`,maxSize:`95%`,collapsible:!0,collapsedSize:0,onResize:e=>{e.inPixels>0&&We.current&&(Ve.current=e.inPixels,qe(e.inPixels))},className:Y(`flex flex-col`,!He&&`transition-[flex-grow] duration-200 ease-out motion-reduce:transition-none motion-reduce:duration-0`),children:(0,Z.jsx)(`div`,{ref:pe,className:`flex min-h-0 flex-1 flex-col overflow-hidden`})})]}):null,t[219]=Be,t[220]=He,t[221]=c,t[222]=se,t[223]=be,t[224]=v,t[225]=Jt):Jt=t[225];let Yt=Jt,Xt=Gt!=null&&!le||be,Zt;t[226]===Symbol.for(`react.memo_cache_sentinel`)?(Zt=e=>{Ze(e),Qe.current=e},t[226]=Zt):Zt=t[226];let Qt=je||He||void 0,$t=be?`5%`:`30%`,en;t[227]===Xt?en=t[228]:(en=Xt?{}:{defaultSize:`100%`},t[227]=Xt,t[228]=en);let tn=!(je||He)&&`transition-[flex-grow] duration-200 ease-out motion-reduce:transition-none motion-reduce:duration-0`,nn;t[229]===tn?nn=t[230]:(nn=Y(tn),t[229]=tn,t[230]=nn);let rn;t[231]!==qt||t[232]!==$t||t[233]!==en||t[234]!==nn?(rn=(0,Z.jsx)(GC,{minSize:$t,...en,className:nn,children:qt}),t[231]=qt,t[232]=$t,t[233]=en,t[234]=nn,t[235]=rn):rn=t[235];let on;t[236]!==$e||t[237]!==Gt||t[238]!==Qt||t[239]!==rn||t[240]!==Yt?(on=(0,Z.jsxs)(WC,{orientation:`horizontal`,groupRef:$e,"data-dragging":Qt,children:[rn,Gt,Yt]}),t[236]=$e,t[237]=Gt,t[238]=Qt,t[239]=rn,t[240]=Yt,t[241]=on):on=t[241];let sn;t[242]!==d||t[243]!==Ce?(sn=Ce?(0,Z.jsx)(JM,{dockPosition:`right`,onReveal:d,className:`top-2.5 right-0`}):null,t[242]=d,t[243]=Ce,t[244]=sn):sn=t[244];let cn;return t[245]!==on||t[246]!==sn?(cn=(0,Z.jsxs)(`div`,{className:`relative flex min-h-0 flex-1`,ref:Zt,children:[on,sn]}),t[245]=on,t[246]=sn,t[247]=cn):cn=t[247],cn}function aN(){}function oN(e){return!tN.has(e)}function sN(){return Vw()}function cN(){return Sw()}function lN(){return Ar()}function uN(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(r.kind!==i.kind)return!1;if(r.kind===`human`&&i.kind===`human`){if(r.clientId!==i.clientId||r.mode!==i.mode||r.tabCount!==i.tabCount)return!1;let e=r.user,t=i.user;if(e.name!==t.name||e.color!==t.color||e.icon!==t.icon)return!1}else if(r.kind===`agent`&&i.kind===`agent`){if(r.agentId!==i.agentId)return!1;let e=r.presence,t=i.presence;if(e.displayName!==t.displayName||e.icon!==t.icon||e.color!==t.color||e.currentDoc!==t.currentDoc||e.mode!==t.mode)return!1}}return!0}function dN(e){let t=new Map;for(let n of e){let e=n.user.principalId;if(typeof e==`string`&&e.length>0){let r=t.get(e);r?r.push(n):t.set(e,[n])}}let n=new Map;for(let[e,r]of t){let t=r.reduce((e,t)=>Math.min(e,t.clientId),1/0);n.set(e,{repClientId:t,count:r.length})}let r=[];for(let t of e){let e=t.user.principalId;if(typeof e==`string`&&e.length>0){let i=n.get(e);i&&i.repClientId===t.clientId&&r.push({...t,tabCount:i.count})}else r.push({...t,tabCount:1})}return r}var fN=1e3,pN=!1;function mN(e){return!!(e.localPrincipalId&&e.entryPrincipalId===e.localPrincipalId||!e.localPrincipalId&&e.entryClientId===e.localClientId)}function hN(e,t,n){let r=(0,$.c)(9),i;r[0]===Symbol.for(`react.memo_cache_sentinel`)?(i={current:[],crossDoc:[]},r[0]=i):i=r[0];let[a,o]=(0,Q.useState)(i),s;r[1]!==n||r[2]!==e?.awareness||r[3]!==t?.awareness?(s=()=>{let r=e?.awareness,i=t?.awareness,a;i==null?a=void 0:ys(i)?a=i:(a=void 0,pN||(pN=!0,console.warn(`[agent-presence] __system__ provider awareness missing getStates() — presence bar will render without agent peers`)));let s=()=>{let e=(r?.getLocalState())?.user?.principalId??null,t=r?.clientID??null,i=[];if(r)for(let[n,a]of r.getStates().entries()){let r=a;if(!r.user||typeof r.user!=`object`)continue;let o=r.user;o.type===`human`&&(mN({entryPrincipalId:o.principalId,entryClientId:n,localPrincipalId:e,localClientId:t})||i.push({kind:`human`,clientId:n,user:o,mode:r.mode??`wysiwyg`,tabCount:1}))}let s=dN(i),{current:c,crossDoc:l}=a?hs(a,n,Date.now()):{current:[],crossDoc:[]},u=gN,d=c.map(u),f=l.map(u),p=[...s,...d],m=f;o(e=>uN(e.current,p)&&uN(e.crossDoc,m)?e:{current:p,crossDoc:m})};s();let c=()=>s(),l=()=>s();r?.on(`change`,c),t?.awareness?.on(`change`,l);let u=setInterval(s,fN);return()=>{r?.off(`change`,c),t?.awareness?.off(`change`,l),clearInterval(u)}},r[1]=n,r[2]=e?.awareness,r[3]=t?.awareness,r[4]=s):s=r[4];let c;return r[5]!==n||r[6]!==e||r[7]!==t?(c=[e,t,n],r[5]=n,r[6]=e,r[7]=t,r[8]=c):c=r[8],(0,Q.useEffect)(s,c),a}function gN(e){let{agentId:t,entry:n}=e;return{kind:`agent`,agentId:t,presence:n}}var _N=!1,vN=new Set,yN=!1;function bN(){for(let e of vN)e()}function xN(e){_N!==e&&(_N=e,bN())}function SN(){return _N}function CN(e){return vN.add(e),()=>{vN.delete(e)}}function wN(e){let t=[e.onUpdateRelaunching(()=>xN(!0)),e.onUpdateRelaunchFailed(()=>xN(!1))];return()=>{for(let e of t)e()}}function TN(){if(yN||typeof window>`u`)return;let e=window.okDesktop;e&&(yN=!0,wN(e))}function EN(){return(0,Q.useSyncExternalStore)(CN,SN,DN)}function DN(){return!1}var ON=`sync-status`;async function kN(e){try{let t=await Fg(e);t.ok||bs.error(t.message,{id:ON,duration:1/0})}catch{}}function AN(e,t){let n=(0,$.c)(6),{_:r}=an(),i=EN(),a=(0,Q.useRef)(!1),o=(0,Q.useRef)(!1),s=(0,Q.useRef)(t),c,l;n[0]!==r||n[1]!==t||n[2]!==i||n[3]!==e?(c=()=>{if(s.current!==t&&(s.current=t,a.current=!1,o.current=!1),t)if(e===`synced`&&(a.current=!0),e===`disconnected`&&a.current){if(i){bs.dismiss(ON);return}o.current=!0;let e=window.okDesktop;bs.warning(r({id:`HGNCsl`}),{id:ON,duration:1/0,...e?{action:{label:r({id:`uaUc6t`}),onClick:()=>{kN(e)}}}:{}})}else o.current&&e===`synced`&&(o.current=!1,bs.success(r({id:`GhjUB_`}),{id:ON,duration:3e3}))},l=[e,t,r,i],n[0]=r,n[1]=t,n[2]=i,n[3]=e,n[4]=c,n[5]=l):(c=n[4],l=n[5]),(0,Q.useEffect)(c,l)}var jN=4,MN=3,NN={Bird:yd,Cat:Ed,Dog:Pd,Fish:Bd,Mouse:vf,Rabbit:_f,Shrimp:wf,Snail:Tf,Squirrel:kf,Turtle:zf};Object.freeze(Object.keys(NN));function PN(e){if(typeof e.principalId==`string`&&e.principalId.length>0)return{kind:`initials`};let t=e.name.split(` `)[1];return t&&Object.hasOwn(NN,t)?{kind:`animal`,animal:t}:{kind:`initials`}}var FN={claude:`Claude`,cursor:`Cursor`,windsurf:`Windsurf`,openai:`Codex`,github:`Copilot`,cline:`Cline`,bot:`Agent`};function IN(e){let t=(0,$.c)(28),{user:n,mode:r,tabCount:i}=e,{_:a}=an(),o=PN(n),s=o.kind===`animal`?NN[o.animal]:void 0,c;t[0]===n.name?c=t[1]:(c=qr(n.name),t[0]=n.name,t[1]=c);let l=c,u;t[2]===n.color?u=t[3]:(u=kr(n.color),t[2]=n.color,t[3]=u);let d=u,f=n.name,p;t[4]!==a||t[5]!==i||t[6]!==f?(p=i>1?a({id:`qAhFeg`,values:{userName:f,tabCount:i}}):f,t[4]=a,t[5]=i,t[6]=f,t[7]=p):p=t[7];let m=p,h;t[8]!==a||t[9]!==i||t[10]!==f?(h=i>1?a({id:`BEkF-P`,values:{userName:f,tabCount:i}}):f,t[8]=a,t[9]=i,t[10]=f,t[11]=h):h=t[11];let g=h,_;t[12]===n.color?_=t[13]:(_={backgroundColor:n.color},t[12]=n.color,t[13]=_);let v;t[14]!==s||t[15]!==d||t[16]!==l?(v=s?(0,Z.jsx)(s,{size:18,color:d,strokeWidth:1.5}):(0,Z.jsx)(`span`,{className:`font-mono text-2xs font-semibold leading-none`,style:{color:d},children:l}),t[14]=s,t[15]=d,t[16]=l,t[17]=v):v=t[17];let y;t[18]!==g||t[19]!==r||t[20]!==_||t[21]!==v?(y=(0,Z.jsx)(As,{asChild:!0,children:(0,Z.jsx)(`div`,{"data-presence-badge":`human`,"data-presence-mode":r,role:`img`,"aria-label":g,className:`inline-flex size-7 shrink-0 cursor-default items-center justify-center rounded-full ring-2 ring-background`,style:_,children:v})}),t[18]=g,t[19]=r,t[20]=_,t[21]=v,t[22]=y):y=t[22];let b;t[23]===m?b=t[24]:(b=(0,Z.jsx)(js,{children:m}),t[23]=m,t[24]=b);let x;return t[25]!==y||t[26]!==b?(x=(0,Z.jsxs)(Ns,{children:[y,b]}),t[25]=y,t[26]=b,t[27]=x):x=t[27],x}function LN(e){let t=FN[e.icon];return e.displayName||t||Yc._({id:`iEQQyu`})}function RN(e){let t=(0,$.c)(3),[n,r]=(0,Q.useState)(e===`writing`),i=(0,Q.useRef)(null),a,o;return t[0]===e?(a=t[1],o=t[2]):(a=()=>{if(e===`writing`){i.current!==null&&(clearTimeout(i.current),i.current=null),r(!0);return}return i.current!==null&&clearTimeout(i.current),i.current=setTimeout(()=>{i.current=null,r(!1)},600),()=>{i.current!==null&&(clearTimeout(i.current),i.current=null)}},o=[e],t[0]=e,t[1]=a,t[2]=o),(0,Q.useEffect)(a,o),n}function zN(e){let t=(0,$.c)(33),{participant:n,crossDoc:r,scoped:i,onClickAgent:a}=e,{_:o}=an(),{activeDocName:s}=vt(),{presence:c,agentId:l}=n,u=LN(c),d=RN(c.mode),f=!r&&d,p=c.currentDoc&&c.currentDoc!==`(connected)`?c.currentDoc:null,m=s!==null||p!==null,h=m?`cursor-pointer`:`cursor-default opacity-50`,g=i?`ring-primary ring-offset-2 ring-offset-background`:`ring-background`,_=f&&!i?`ring-primary/40 animate-pulse`:``,v;t[0]!==h||t[1]!==g||t[2]!==_?(v=[`inline-flex size-7 shrink-0 items-center justify-center rounded-full ring-2`,h,g,_].filter(Boolean),t[0]=h,t[1]=g,t[2]=_,t[3]=v):v=t[3];let y=v.join(` `),b=r?`true`:void 0,x=i?`true`:void 0,S=m?void 0:`true`,C;t[4]!==c.mode||t[5]!==b||t[6]!==x||t[7]!==S?(C={"data-presence-badge":`agent`,"data-presence-mode":c.mode,"data-presence-crossdoc":b,"data-presence-scoped":x,"data-presence-inert":S},t[4]=c.mode,t[5]=b,t[6]=x,t[7]=S,t[8]=C):C=t[8];let w=C,T=o(r&&p?{id:`b4AQFK`,values:{tooltipName:u,realCurrentDoc:p}}:{id:`RfHNf8`,values:{tooltipName:u}}),E;t[9]!==l||t[10]!==T||t[11]!==w||t[12]!==m||t[13]!==a||t[14]!==c.color||t[15]!==c.icon||t[16]!==p||t[17]!==y||t[18]!==u?(E=m?(0,Z.jsx)(`button`,{type:`button`,...w,"aria-label":T,className:y,style:{backgroundColor:c.color},onClick:()=>a(l,p),children:(0,Z.jsx)(_s,{icon:c.icon,width:16,height:16,className:`text-white`,"aria-hidden":!0})}):(0,Z.jsx)(`div`,{...w,role:`img`,"aria-label":u,className:y,style:{backgroundColor:c.color},children:(0,Z.jsx)(_s,{icon:c.icon,width:16,height:16,className:`text-white`,"aria-hidden":!0})}),t[9]=l,t[10]=T,t[11]=w,t[12]=m,t[13]=a,t[14]=c.color,t[15]=c.icon,t[16]=p,t[17]=y,t[18]=u,t[19]=E):E=t[19];let D=E,O;t[20]===D?O=t[21]:(O=(0,Z.jsx)(As,{asChild:!0,children:D}),t[20]=D,t[21]=O);let k;t[22]===u?k=t[23]:(k=(0,Z.jsx)(`span`,{className:`font-medium`,children:u}),t[22]=u,t[23]=k);let A;t[24]!==r||t[25]!==p?(A=r&&p?(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:(0,Z.jsx)(J,{id:`Wh0im4`,values:{realCurrentDoc:p}})}):null,t[24]=r,t[25]=p,t[26]=A):A=t[26];let j;t[27]!==k||t[28]!==A?(j=(0,Z.jsxs)(js,{className:`flex flex-col gap-0.5`,children:[k,A]}),t[27]=k,t[28]=A,t[29]=j):j=t[29];let M;return t[30]!==O||t[31]!==j?(M=(0,Z.jsxs)(Ns,{children:[O,j]}),t[30]=O,t[31]=j,t[32]=M):M=t[32],M}function BN(e){let t=(0,$.c)(21),{count:n,remainder:r,crossDoc:i,scopedAgentId:a,onClickAgent:o}=e,s;t[0]!==n||t[1]!==i?(s=i?Yc._({id:`9euN0m`,values:{count:n}}):Yc._({id:`uhJEA2`,values:{count:n}}),t[0]=n,t[1]=i,t[2]=s):s=t[2];let c=s,l=i?`true`:void 0,u;t[3]!==n||t[4]!==c||t[5]!==l?(u=(0,Z.jsx)(Ie,{asChild:!0,children:(0,Z.jsxs)(`button`,{type:`button`,"data-slot":`presence-overflow`,"data-presence-crossdoc":l,className:`inline-flex size-7 shrink-0 cursor-pointer items-center justify-center rounded-full bg-muted font-medium text-muted-foreground text-xs ring-2 ring-background hover:bg-muted/80`,"aria-label":c,children:[`+`,n]})}),t[3]=n,t[4]=c,t[5]=l,t[6]=u):u=t[6];let d;if(t[7]!==i||t[8]!==o||t[9]!==r||t[10]!==a){let e;t[12]!==i||t[13]!==o||t[14]!==a?(e=e=>e.kind===`human`?(0,Z.jsx)(IN,{user:e.user,mode:e.mode,tabCount:e.tabCount},e.clientId):(0,Z.jsx)(zN,{participant:e,crossDoc:i,scoped:a===e.agentId,onClickAgent:o},e.agentId),t[12]=i,t[13]=o,t[14]=a,t[15]=e):e=t[15],d=r.map(e),t[7]=i,t[8]=o,t[9]=r,t[10]=a,t[11]=d}else d=t[11];let f;t[16]===d?f=t[17]:(f=(0,Z.jsx)(Ut,{align:`end`,className:`w-auto max-w-xs p-2`,children:(0,Z.jsx)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:d})}),t[16]=d,t[17]=f);let p;return t[18]!==u||t[19]!==f?(p=(0,Z.jsxs)(Ne,{children:[u,f]}),t[18]=u,t[19]=f,t[20]=p):p=t[20],p}function VN(e,t,n,r){return e.kind===`human`?(0,Z.jsx)(IN,{user:e.user,mode:e.mode,tabCount:e.tabCount},e.clientId):(0,Z.jsx)(zN,{participant:e,crossDoc:n,scoped:r===e.agentId,onClickAgent:t},e.agentId)}function HN(){let e=(0,$.c)(20),{activeProvider:t,activeDocName:n,systemProvider:r,openActivityPanel:i,docPanelMode:a,docPanelAgentId:o}=vt(),{current:s,crossDoc:c}=hN(t,r,n);if(AN(Hw(t),n),s.length===0&&c.length===0)return null;let l;if(e[0]!==c||e[1]!==s||e[2]!==o||e[3]!==a||e[4]!==i){let t=s.slice(0,jN),n;e[6]===s?n=e[7]:(n=s.slice(jN),e[6]=s,e[7]=n);let r=n,u=c.slice(0,MN),d;e[8]===c?d=e[9]:(d=c.slice(MN),e[8]=c,e[9]=d);let f=d,p=i,m=a===`agent`?o:null,h;e[10]!==p||e[11]!==m?(h=e=>VN(e,p,!1,m),e[10]=p,e[11]=m,e[12]=h):h=e[12];let g=t.map(h),_;e[13]!==r||e[14]!==p||e[15]!==m?(_=r.length>0?(0,Z.jsx)(BN,{count:r.length,remainder:r,crossDoc:!1,scopedAgentId:m,onClickAgent:p}):null,e[13]=r,e[14]=p,e[15]=m,e[16]=_):_=e[16];let v;e[17]!==g||e[18]!==_?(v=(0,Z.jsxs)(`div`,{className:`flex items-center gap-1.5`,"data-presence-section":`current`,children:[g,_]}),e[17]=g,e[18]=_,e[19]=v):v=e[19],l=(0,Z.jsxs)(`div`,{"data-slot":`presence-bar`,className:`flex items-center px-1 py-1.5`,children:[v,c.length>0?(0,Z.jsxs)(`div`,{className:`ml-1.5 flex items-center gap-1.5`,"data-presence-section":`crossdoc`,children:[u.map(e=>VN(e,p,!0,m)),f.length>0?(0,Z.jsx)(BN,{count:f.length,remainder:f,crossDoc:!0,scopedAgentId:m,onClickAgent:p}):null]}):null]}),e[0]=c,e[1]=s,e[2]=o,e[3]=a,e[4]=i,e[5]=l}else l=e[5];return l}function UN(){let e=(0,$.c)(4),[t,n]=(0,Q.useState)(null),r,i;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>{let e=window.okDesktop;if(!e)return;let t=!1;return e.state.query().then(e=>{t||n(e.channel)}).catch(WN),()=>{t=!0}},i=[],e[0]=r,e[1]=i):(r=e[0],i=e[1]),(0,Q.useEffect)(r,i);let a;return e[2]===t?a=e[3]:(a={channel:t},e[2]=t,e[3]=a),a}function WN(e){console.warn(`[use-update-channel] bridge.state.query() failed`,e)}function GN(e){let t=(0,$.c)(6),{className:n}=e,{_:r}=an(),{channel:i}=UN();if(i!==`beta`)return null;let a;t[0]===r?a=t[1]:(a=r({id:`9fhQRL`}),t[0]=r,t[1]=a);let o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Z.jsx)(J,{id:`cSCbv3`}),t[2]=o):o=t[2];let s;return t[3]!==n||t[4]!==a?(s=(0,Z.jsx)(Ae,{variant:`secondary`,"aria-label":a,"data-testid":`beta-badge`,className:n,children:o}),t[3]=n,t[4]=a,t[5]=s):s=t[5],s}function KN(e,t){return t.trim()}function qN(e){return![``,`.`,`..`].includes(e)&&!e.includes(`/`)&&!e.includes(`\\`)&&!e.includes(`\0`)}function JN(e,t){let n=KN(e.kind,t),r=e.path.split(`/`);return r[r.length-1]=n,r.join(`/`)}function YN(e,t,n=[],r=[],i=[]){if(t.length===0&&n.length===0&&r.length===0&&i.length===0)return e;let a=new Map(t.map(e=>[e.fromDocName,e.toDocName])),o=new Map(i.map(e=>[e.toDocName,e.docExt])),s=new Map(r.map(e=>[e.fromPath,e.toPath]));return e.map(e=>{if(ul(e)){let t=s.get(Ku(e.docName,e.docExt));if(t){let n=nl(t);return{kind:`asset`,path:t,assetExt:n,mediaKind:Xn(n),size:e.size,modified:e.modified,referencedBy:[]}}let n=a.get(e.docName)??e.docName;return{...e,docName:n,docExt:o.get(n)??e.docExt}}if(tl(e))return{...e,path:nP(e.path,n)};if(il(e)){let t=s.get(e.path);return t&&Xc(t)?{kind:`document`,docName:Mu(t),docExt:Qc(t),size:e.size,modified:e.modified}:{...e,path:t??nP(e.path,n)}}return e})}function XN(e,t,n,r=[]){if(t.length===0&&!n&&r.length===0)return e;let i=new Set(t),a=new Set(r);return e.filter(e=>ul(e)?!i.has(e.docName)&&!oP(e.docName,n):tl(e)?!oP(e.path,n):il(e)?!a.has(e.path)&&!oP(e.path,n):!0)}function ZN(e,t){if(e.kind!==`asset`||t.some(t=>il(t)&&t.path===e.path))return e;let n=Yu(e.path,t);return n?{...e,path:n,name:n.split(`/`).pop()??n}:e}function QN(e,t,n,r=new Date().toISOString()){let i=!1,a=[...e],o=e=>{a.some(t=>rP(t,e))||(a.push(e),i=!0)};if(n.kind===`file`){let s=e.find(e=>ul(e)&&e.docName===t.path);return o({kind:`document`,docName:n.path,docExt:s?.docExt??t.docExt,size:s?.size??0,modified:r}),i?a:e}let s=e.find(e=>tl(e)&&e.path===t.path);o({kind:`folder`,path:n.path,size:s?.size??0,modified:r});let c=new Set(n.duplicatedDocNames);for(let i of e){if(ul(i)){let e=aP(i.docName,t.path,n.path);e&&c.has(e)&&o({...i,docName:e,modified:r});continue}if(tl(i)){let e=iP(i.path,t.path,n.path);e&&o({...i,path:e,modified:r})}}return i?a:e}function $N(e,t){return e?t.find(t=>t.fromDocName===e)?.toDocName??e:null}function eP(e,t,n){return e.flatMap(e=>t===e.toDocName||!n(e.toDocName)?[e.fromDocName]:[e.fromDocName,e.toDocName])}function tP(e,t){let n=e.kind===`file`?Ku(e.path,e.docExt):e.path;return aa(t.contentDir,n,t.pathSeparator)}function nP(e,t){for(let{fromPath:n,toPath:r}of t){if(e===n)return r;if(e.startsWith(`${n}/`))return`${r}${e.slice(n.length)}`}return e}function rP(e,t){return ul(e)&&ul(t)?e.docName===t.docName:tl(e)&&tl(t)||il(e)&&il(t)?e.path===t.path:!1}function iP(e,t,n){return e===t?n:aP(e,t,n)}function aP(e,t,n){return e.startsWith(`${t}/`)?`${n}${e.slice(t.length)}`:null}function oP(e,t){return!!t&&(e===t||e.startsWith(`${t}/`))}function sP(e){let t=(0,$.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,Z.jsx)(Op,{"data-slot":`context-menu`,...n}),t[2]=n,t[3]=r),r}function cP(e){let t=(0,$.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=Y(`select-none`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(kp,{"data-slot":`context-menu-trigger`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function lP(e){let t=(0,$.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,Z.jsx)(Mp,{"data-slot":`context-menu-group`,...n}),t[2]=n,t[3]=r),r}function uP(e){let t=(0,$.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,Z.jsx)(Rp,{"data-slot":`context-menu-sub`,...n}),t[2]=n,t[3]=r),r}function dP(e){let t=(0,$.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=Y(`z-50 max-h-(--radix-context-menu-content-available-height) min-w-36 origin-(--radix-context-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 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`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(Ap,{children:(0,Z.jsx)(jp,{"data-slot":`context-menu-content`,className:i,...r})}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function fP(e){let t=(0,$.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=Y(`group/context-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 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 focus:*:[svg]:text-accent-foreground 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,Z.jsx)(Pp,{"data-slot":`context-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 pP(e){let t=(0,$.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=Y(`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 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,Z.jsx)(Zi,{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,Z.jsxs)(zp,{"data-slot":`context-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 mP(e){let t=(0,$.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=Y(`z-50 max-h-(--radix-context-menu-content-available-height) min-w-32 origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border bg-popover p-1 text-popover-foreground shadow-lg 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,Z.jsx)(Bp,{"data-slot":`context-menu-sub-content`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function hP(e){let t=(0,$.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=Y(`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 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,Z.jsx)(`span`,{className:`pointer-events-none absolute right-2`,children:(0,Z.jsx)(Ip,{children:(0,Z.jsx)(Ji,{})})}),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,Z.jsxs)(Fp,{"data-slot":`context-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 gP(e){let t=(0,$.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=Y(`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,Z.jsx)(Np,{"data-slot":`context-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 _P(e){let t=(0,$.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=Y(`-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,Z.jsx)(Lp,{"data-slot":`context-menu-separator`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var vP=`mr-1.5 flex size-5 shrink-0 cursor-pointer items-center justify-center rounded-sm text-muted-foreground outline-none transition hover:bg-foreground/10 hover:text-foreground hover:opacity-100 focus-visible:ring-2 focus-visible:ring-ring/50`,yP=`border-border bg-background text-foreground hover:bg-background focus-visible:bg-background`,bP={start:[Zo.Space],cancel:[Zo.Esc],end:[Zo.Space,Zo.Enter]};function xP(e){return Y(vP,e?`opacity-100`:`pointer-events-none opacity-0 group-hover:pointer-events-auto group-hover:opacity-100`)}function SP(e){return e?void 0:-1}function CP({className:e,isDragging:t}){return Y(e,t&&yP)}function wP(e){return e.code===Zo.Enter&&e.target===e.currentTarget}function TP({event:e,hasKeyboardActivation:t,isDragging:n}){return e.defaultPrevented?`ignore`:!n&&t&&wP(e)?`activate-tab`:`delegate-sortable`}function EP({activeWidth:e,isDragging:t,outerStyle:n,transform:r,transition:i}){let a=t&&e?e:void 0;return{...n,transform:ns.Transform.toString(r?{...r,scaleX:1,scaleY:1}:null),transition:i,flexBasis:a??n?.flexBasis,maxWidth:a??n?.maxWidth,minWidth:a??n?.minWidth,opacity:n?.opacity,width:a??n?.width,zIndex:t?20:n?.zIndex}}function DP(e){let t=e?.querySelectorAll(`[data-editor-tab-sortable]`)??[],n=1/0,r=-1/0;for(let e of t){let t=e.getBoundingClientRect();n=Math.min(n,t.left),r=Math.max(r,t.right)}return Number.isFinite(n)&&Number.isFinite(r)?{left:n,right:r}:null}function OP(e){return({activeNodeRect:t,transform:n})=>{let r={...n,y:0};if(!e||!t)return r;let i=e.left-t.left,a=e.right-t.right;return r.x=Math.min(Math.max(r.x,i),a),r}}var kP=e=>{let{droppableContainers:t,droppableRects:n,pointerCoordinates:r}=e;if(r){let e=1/0,i=-1/0,a=null,o=null;for(let r of t){let t=n.get(r.id);t&&(t.left<e&&(e=t.left,a=r),t.right>i&&(i=t.right,o=r))}if(!Number.isFinite(e)||!Number.isFinite(i))return[];let s=r.x<e?a:r.x>i?o:null;if(s)return[{id:s.id,data:{droppableContainer:s,value:0}}]}return Go(e)},AP=[`.md`,`.mdx`],jP=`group relative -mb-px flex h-10 min-w-28 max-w-64 shrink-0 cursor-pointer items-center overflow-hidden border border-transparent font-medium transition-colors`,MP=`z-10 rounded-t-lg rounded-b-none border-border border-b-0 bg-background text-foreground`,NP=Y(MP,`bg-transparent hover:bg-muted focus-visible:bg-muted border-transparent hover:border-border focus-visible:border-border`),PP=`flex h-full min-w-0 flex-1 cursor-pointer items-center overflow-hidden px-3 text-left text-[13px]`;function FP(e){return e.replace(/[^A-Za-z0-9_-]/g,`-`)}function IP(e){let t=kl(e);window.location.hash!==t&&(window.location.hash=t)}function LP(e){Math.abs(e.deltaX)>=Math.abs(e.deltaY)||e.currentTarget.scrollWidth<=e.currentTarget.clientWidth||(e.preventDefault(),e.currentTarget.scrollLeft+=e.deltaY)}function RP(e,t){let n=[t,...AP].filter((e,t,n)=>e&&n.indexOf(e)===t),r=e.toLowerCase(),i=n.find(t=>e.length>t.length&&r.endsWith(t.toLowerCase()));return i?e.slice(0,-i.length):e}function zP(e){return e.metaKey||e.ctrlKey}var BP=1e3;function VP(e,t){return e<0||e>=t?null:e<8?String(e+1):e===t-1?`9`:null}function HP(e,t){return VP(e,t)}function UP(e,t){let n=VP(e,t);if(n)return[`Meta+${n}`,`Control+${n}`].join(` `)}function WP(e,t){if(!zP(e)||e.altKey||e.shiftKey||!/^[1-9]$/.test(e.key))return null;let n=Number(e.key);if(n===9)return t>0?t-1:null;let r=n-1;return r<Math.min(8,t)?r:null}function GP(e){let t=(0,$.c)(3),{value:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=Y(xP(!0),`font-mono tabular-nums hover:bg-transparent animate-in fade-in-0 zoom-in-95 duration-150 motion-reduce:animate-none motion-reduce:duration-0`),t[0]=r):r=t[0];let i=`⌘${n}`,a;return t[1]===i?a=t[2]:(a=(0,Z.jsx)(`span`,{"aria-hidden":`true`,"data-testid":`editor-tab-shortcut-hint`,className:r,children:(0,Z.jsx)(F,{className:`text-[10px]`,children:i})}),t[1]=i,t[2]=a),a}function KP(e){let t=(0,$.c)(37),n,r,i,a,o,s,c,l;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7],l=t[8]):({activateFromKeyboard:n,className:r,tabId:l,disabled:i,onKeyDown:a,ref:o,style:s,...c}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c,t[8]=l);let u;t[9]!==i||t[10]!==l?(u={id:l,disabled:i},t[9]=i,t[10]=l,t[11]=u):u=t[11];let{attributes:d,listeners:f,rect:p,setNodeRef:m,transform:h,transition:g,isDragging:_}=es(u),v=p.current?.width,y;t[12]!==_||t[13]!==s||t[14]!==v||t[15]!==h||t[16]!==g?(y=EP({activeWidth:v,isDragging:_,outerStyle:s,transform:h,transition:g}),t[12]=_,t[13]=s,t[14]=v,t[15]=h,t[16]=g,t[17]=y):y=t[17];let b=y,x;t[18]!==o||t[19]!==m?(x=function(e){m(e),typeof o==`function`?o(e):o&&`current`in o&&(o.current=e)},t[18]=o,t[19]=m,t[20]=x):x=t[20];let S=x,C=f?.onKeyDown,w;t[21]!==n||t[22]!==_||t[23]!==a||t[24]!==C?(w=function(e){a?.(e);let t=TP({event:e,hasKeyboardActivation:!!n,isDragging:_});if(t!==`ignore`){if(t===`activate-tab`&&n){e.preventDefault(),n();return}C?.(e)}},t[21]=n,t[22]=_,t[23]=a,t[24]=C,t[25]=w):w=t[25];let T=w,E;t[26]!==r||t[27]!==_?(E=CP({className:r,isDragging:_}),t[26]=r,t[27]=_,t[28]=E):E=t[28];let D;return t[29]!==d||t[30]!==S||t[31]!==T||t[32]!==f||t[33]!==c||t[34]!==b||t[35]!==E?(D=(0,Z.jsx)(`div`,{ref:S,"data-editor-tab-sortable":``,className:E,style:b,...c,...d,...f,onKeyDown:T}),t[29]=d,t[30]=S,t[31]=T,t[32]=f,t[33]=c,t[34]=b,t[35]=E,t[36]=D):D=t[36],D}function qP(e){let t=(0,$.c)(52),{children:n,closeTab:r,closeTabs:i,canPin:a,disabled:o,openTabs:s,pinTab:c,pinnedTabIds:l,tabId:u,unpinTab:d}=e,f=a===void 0?!0:a;if(o!==void 0&&o)return n;let p;t[0]!==f||t[1]!==l||t[2]!==u?(p=f&&l.includes(u),t[0]=f,t[1]=l,t[2]=u,t[3]=p):p=t[3];let m=p,h;if(t[4]!==s||t[5]!==l||t[6]!==u){let e;t[8]===u?e=t[9]:(e=e=>e!==u,t[8]=u,t[9]=e),h=se(s.filter(e),l),t[4]=s,t[5]=l,t[6]=u,t[7]=h}else h=t[7];let g=h,_;t[10]!==s||t[11]!==l?(_=se(s,l),t[10]=s,t[11]=l,t[12]=_):_=t[12];let v=_,y;t[13]===n?y=t[14]:(y=(0,Z.jsx)(cP,{asChild:!0,children:n}),t[13]=n,t[14]=y);let b;t[15]!==r||t[16]!==u?(b=()=>r(u),t[15]=r,t[16]=u,t[17]=b):b=t[17];let x;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,Z.jsx)(J,{id:`yz7wBu`}),t[18]=x):x=t[18];let S;t[19]!==m||t[20]!==b?(S=(0,Z.jsx)(fP,{disabled:m,onSelect:b,children:x}),t[19]=m,t[20]=b,t[21]=S):S=t[21];let C=g.length===0,w;t[22]!==i||t[23]!==g?(w=()=>{i(g)},t[22]=i,t[23]=g,t[24]=w):w=t[24];let T;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,Z.jsx)(J,{id:`omXJcU`}),t[25]=T):T=t[25];let E;t[26]!==C||t[27]!==w?(E=(0,Z.jsx)(fP,{disabled:C,onSelect:w,children:T}),t[26]=C,t[27]=w,t[28]=E):E=t[28];let D=v.length===0,O;t[29]!==v||t[30]!==i?(O=()=>{i(v)},t[29]=v,t[30]=i,t[31]=O):O=t[31];let k;t[32]===l.length?k=t[33]:(k=l.length?(0,Z.jsx)(J,{id:`U2Kx6T`}):(0,Z.jsx)(J,{id:`WyXG7w`}),t[32]=l.length,t[33]=k);let A;t[34]!==D||t[35]!==O||t[36]!==k?(A=(0,Z.jsx)(fP,{disabled:D,"data-testid":`editor-tab-context-close-all`,onSelect:O,children:k}),t[34]=D,t[35]=O,t[36]=k,t[37]=A):A=t[37];let j;t[38]!==f||t[39]!==m||t[40]!==c||t[41]!==u||t[42]!==d?(j=f&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(_P,{}),(0,Z.jsx)(fP,{"data-testid":`editor-tab-context-pin-toggle`,onSelect:()=>m?d(u):c(u),children:m?(0,Z.jsx)(J,{id:`SYfHmN`}):(0,Z.jsx)(J,{id:`3pU8e-`})})]}),t[38]=f,t[39]=m,t[40]=c,t[41]=u,t[42]=d,t[43]=j):j=t[43];let M;t[44]!==E||t[45]!==A||t[46]!==j||t[47]!==S?(M=(0,Z.jsxs)(dP,{className:`min-w-40`,children:[S,E,A,j]}),t[44]=E,t[45]=A,t[46]=j,t[47]=S,t[48]=M):M=t[48];let N;return t[49]!==M||t[50]!==y?(N=(0,Z.jsxs)(sP,{children:[y,M]}),t[49]=M,t[50]=y,t[51]=N):N=t[51],N}function JP(e){let t=(0,$.c)(28),{accessibleLabel:n,closeTab:r,forceCloseVisible:i,isActive:a,isPinned:o,shortcutHint:s,tabId:c,unpinTab:l}=e,u=i===void 0?!1:i,d=s===void 0?null:s,{_:f}=an();if(d){let e;return t[0]===d?e=t[1]:(e=(0,Z.jsx)(GP,{value:d}),t[0]=d,t[1]=e),e}if(o){let e;t[2]!==f||t[3]!==n?(e=f({id:`t18QYR`,values:{accessibleLabel:n}}),t[2]=f,t[3]=n,t[4]=e):e=t[4];let r;t[5]!==c||t[6]!==l?(r=e=>{e.stopPropagation(),l(c)},t[5]=c,t[6]=l,t[7]=r):r=t[7];let i;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsx)(gf,{"aria-hidden":`true`}),t[8]=i):i=t[8];let a;return t[9]!==e||t[10]!==r?(a=(0,Z.jsx)(X,{variant:`ghost`,size:`icon-xs`,type:`button`,"aria-label":e,"data-testid":`editor-tab-unpin-button`,className:`mr-1.5 text-primary! hover:bg-primary/10!`,onClick:r,children:i}),t[9]=e,t[10]=r,t[11]=a):a=t[11],a}let p;t[12]!==f||t[13]!==n?(p=f({id:`JLzQi_`,values:{accessibleLabel:n}}),t[12]=f,t[13]=n,t[14]=p):p=t[14];let m=u||a,h;t[15]===m?h=t[16]:(h=xP(m),t[15]=m,t[16]=h);let g;t[17]===a?g=t[18]:(g=SP(a),t[17]=a,t[18]=g);let _;t[19]!==r||t[20]!==c?(_=e=>{e.stopPropagation(),r(c)},t[19]=r,t[20]=c,t[21]=_):_=t[21];let v;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,Z.jsx)(xs,{"aria-hidden":`true`}),t[22]=v):v=t[22];let y;return t[23]!==p||t[24]!==h||t[25]!==g||t[26]!==_?(y=(0,Z.jsx)(X,{type:`button`,variant:`ghost`,size:`icon-xs`,"aria-label":p,"data-testid":`editor-tab-close-button`,className:h,tabIndex:g,onClick:_,children:v}),t[23]=p,t[24]=h,t[25]=g,t[26]=_,t[27]=y):y=t[27],y}function YP(e){let t=(0,$.c)(1),{hasConflict:n}=e;if(!n)return null;let r;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Z.jsx)(ds,{"aria-hidden":`true`,"data-testid":`editor-tab-conflict-badge`,className:`mr-1 size-3.5 shrink-0 text-amber-500`}),t[0]=r):r=t[0],r}function XP(e){let t=(0,$.c)(27),{accessibleLabel:n,activateTab:r,baseName:i,docName:a,enterRenameMode:o,extension:s,hideDocExtension:c,tabId:l}=e,{_:u}=an(),d=gw(a)===`conflict`,f;t[0]!==u||t[1]!==n||t[2]!==d?(f=d?u({id:`mVFyH-`,values:{accessibleLabel:n}}):n,t[0]=u,t[1]=n,t[2]=d,t[3]=f):f=t[3];let p=f,m;t[4]!==r||t[5]!==l?(m=()=>{r(l)},t[4]=r,t[5]=l,t[6]=m):m=t[6];let h;t[7]!==a||t[8]!==o||t[9]!==l?(h=e=>{e.preventDefault(),e.stopPropagation(),o(l,a)},t[7]=a,t[8]=o,t[9]=l,t[10]=h):h=t[10];let g;t[11]===d?g=t[12]:(g=(0,Z.jsx)(YP,{hasConflict:d}),t[11]=d,t[12]=g);let _;t[13]===i?_=t[14]:(_=(0,Z.jsx)(`span`,{className:`min-w-0 truncate`,children:i}),t[13]=i,t[14]=_);let v;t[15]!==s||t[16]!==c?(v=!c&&(0,Z.jsx)(`span`,{className:`shrink-0`,children:s}),t[15]=s,t[16]=c,t[17]=v):v=t[17];let y;t[18]!==_||t[19]!==v?(y=(0,Z.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center`,children:[_,v]}),t[18]=_,t[19]=v,t[20]=y):y=t[20];let b;return t[21]!==p||t[22]!==m||t[23]!==h||t[24]!==g||t[25]!==y?(b=(0,Z.jsxs)(`button`,{type:`button`,"aria-label":p,title:p,className:PP,onClick:m,onDoubleClick:h,tabIndex:-1,children:[g,y]}),t[21]=p,t[22]=m,t[23]=h,t[24]=g,t[25]=y,t[26]=b):b=t[26],b}function ZP(){let e=(0,$.c)(94),{activeDocName:t,activeTabId:n,activeNewTabId:r,activeTarget:i,activateTab:a,activateNewTab:o,closeAndClearForRename:s,closeNewTab:c,closeTab:l,closeTabs:u,getPoolActiveDocName:d,poolHas:f,isNewTabActive:p,newTabIds:m,openNewTab:h,openTabs:g,pinTab:_,pinnedTabIds:y,reopenClosedTab:x,remapTabsForRename:S,reorderTabs:C,unpinTab:w,visibleTabIds:T}=vt(),{_:E}=an(),{pageMeta:D}=ea(),O=(0,Q.useRef)(null),[k,A]=(0,Q.useState)(null),[j,M]=(0,Q.useState)(null),[N,P]=(0,Q.useState)(``),[F,I]=(0,Q.useState)(null),[L,R]=(0,Q.useState)(!1),[z,B]=(0,Q.useState)(!1),V=(0,Q.useRef)(null),H=(0,Q.useRef)(!1),U=(0,Q.useRef)(!1),W=(0,Q.useRef)(null),G=(0,Q.useRef)(t),K=(0,Q.useRef)(null),ee=(0,Q.useRef)(!1),te=(0,Q.useRef)(!1),ne;e[0]!==n||e[1]!==t||e[2]!==i?(ne=n??(i?b(i):t?Zt(t):null),e[0]=n,e[1]=t,e[2]=i,e[3]=ne):ne=e[3];let re=ne,ie;e[4]!==r||e[5]!==re||e[6]!==p||e[7]!==m||e[8]!==g?(ie=p?`${r??`__new-tab__`}\u0000${g.join(`\0`)}\u0000${m.join(`\0`)}`:re?`${re}\u0000${g.join(`\0`)}`:``,e[4]=r,e[5]=re,e[6]=p,e[7]=m,e[8]=g,e[9]=ie):ie=e[9];let ae=ie,oe,se;e[10]===t?(oe=e[11],se=e[12]):(oe=()=>{G.current=t},se=[t],e[10]=t,e[11]=oe,e[12]=se),(0,Q.useEffect)(oe,se);let ce,le;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(ce=()=>()=>{K.current!==null&&(window.clearTimeout(K.current),K.current=null)},le=[],e[13]=ce,e[14]=le):(ce=e[13],le=e[14]),(0,Q.useEffect)(ce,le);let q,ue;e[15]===ae?(q=e[16],ue=e[17]):(q=()=>{ae&&(O.current?.querySelector(`[data-active-tab="true"]`))?.scrollIntoView({block:`nearest`,inline:`nearest`})},ue=[ae],e[15]=ae,e[16]=q,e[17]=ue),(0,Q.useEffect)(q,ue);let de,fe;e[18]===j?(de=e[19],fe=e[20]):(de=()=>{j&&(V.current?.focus(),V.current?.select())},fe=[j],e[18]=j,e[19]=de,e[20]=fe),(0,Q.useEffect)(de,fe);let pe,me;e[21]!==g||e[22]!==j?(pe=()=>{!j||g.includes(j.tabId)||(U.current=!0,W.current=null,M(null),P(``),I(null),R(!1))},me=[g,j],e[21]=g,e[22]=j,e[23]=pe,e[24]=me):(pe=e[23],me=e[24]),(0,Q.useEffect)(pe,me);let he;e[25]===Symbol.for(`react.memo_cache_sentinel`)?(he=function(e,t){let n=t.split(`/`);U.current=!1,W.current=null,M({docName:t,tabId:e}),P(n[n.length-1]),I(null)},e[25]=he):he=e[25];let _e=he,ve=function(){U.current=!0,W.current=null,M(null),P(``),I(null),R(!1)},ye=async function(){if(U.current){U.current=!1;return}if(H.current)return;let e=j?.docName;if(!e){ve();return}let t=KN(`file`,RP(N,D.get(e)?.docExt??`.md`)),n=e.split(`/`),r=n[n.length-1];if(t===r){ve();return}if(t===W.current){V.current?.focus();return}if(!qN(t)){I(E({id:`P8yDjG`})),V.current?.focus();return}let i=JN({kind:`file`,path:e,name:r},t);H.current=!0,R(!0),I(null);try{let n=await fetch(`/api/rename-path`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({kind:`file`,fromPath:e,toPath:i})});if(U.current){R(!1),H.current=!1;return}let r=await Ct(n,`Server error (HTTP ${n.status})`);if(!r.ok){I(r.title),R(!1),H.current=!1,W.current=t,V.current?.focus();return}let a=It(Hr,r.body,`rename-path:tab`,{renamed:[],renamedAssets:[]}).renamed,o=G.current,c=$N(o,a);ot(a);let l=!0;try{let e=eP(a,d(),f);await Promise.all(e.map(e=>s(e))),S(a),pl([`files`,`backlinks`,`graph`])}catch(n){let r=n;l=!1,console.warn(`[EditorTabs] post-rename reconciliation failed`,{err:r,docName:e,newDocName:i,normalized:t}),bs.error(E({id:`MUBR8r`}))}U.current=!0,M(null),P(``),I(null),R(!1),H.current=!1,W.current=null,l&&c&&c!==o&&IP(c)}catch(n){console.warn(`[EditorTabs] rename failed`,{err:n,docName:e,newDocName:i,normalized:t}),I(E({id:`HIb0vl`})),R(!1),H.current=!1,W.current=t,V.current?.focus()}},be=typeof window<`u`&&window.okDesktop!=null,xe;e[26]===m?xe=e[27]:(xe=new Set(m),e[26]=m,e[27]=xe);let Se=xe,Ce;e[28]===k?Ce=e[29]:(Ce=OP(k),e[28]=k,e[29]=Ce);let we;e[30]===Ce?we=e[31]:(we=[Ce],e[30]=Ce,e[31]=we);let Te=we,Ee;e[32]!==c||e[33]!==u||e[34]!==Se?(Ee=function(e){let t=[],n=[];for(let r of e)Se.has(r)?n.push(r):t.push(r);t.length>0&&u(t);for(let e of n)c(e)},e[32]=c,e[33]=u,e[34]=Se,e[35]=Ee):Ee=e[35];let De=Ee,Oe,ke;e[36]!==o||e[37]!==a||e[38]!==r||e[39]!==re||e[40]!==p||e[41]!==m||e[42]!==h||e[43]!==x||e[44]!==T?(Oe=()=>{let e=new Set(m),t=function(){K.current!==null&&(window.clearTimeout(K.current),K.current=null)},n=function(e){ee.current!==e&&(ee.current=e)},i=function(e){te.current!==e&&(te.current=e,B(e))},s=function(){n(!0),!(te.current||K.current!==null)&&(K.current=window.setTimeout(()=>{K.current=null,ee.current&&i(!0)},BP))},c=function(){t(),n(!1),i(!1)},l=function(t){e.has(t)?o(t):a(t)},u=function(e){if(T.length===0)return;let t=p?r:re,n=t?T.indexOf(t):-1;l(T[((n>=0?n:0)+e+T.length)%T.length])},d=function(e){if(zP(e)&&s(),Pl(e,`tab-new`)){e.preventDefault(),h();return}if(Pl(e,`tab-reopen-closed`)){e.preventDefault(),x();return}if(Pl(e,`tab-next`)){e.preventDefault(),u(1);return}if(Pl(e,`tab-previous`)){e.preventDefault(),u(-1);return}let t=WP(e,T.length);t!==null&&(e.preventDefault(),l(T[t]))},f=function(e){!e.metaKey&&!e.ctrlKey&&c()};return window.addEventListener(`keydown`,d,{capture:!0}),window.addEventListener(`keyup`,f,{capture:!0}),window.addEventListener(`blur`,c),document.addEventListener(`visibilitychange`,c),()=>{window.removeEventListener(`keydown`,d,{capture:!0}),window.removeEventListener(`keyup`,f,{capture:!0}),window.removeEventListener(`blur`,c),document.removeEventListener(`visibilitychange`,c)}},ke=[r,re,o,a,p,m,h,x,T],e[36]=o,e[37]=a,e[38]=r,e[39]=re,e[40]=p,e[41]=m,e[42]=h,e[43]=x,e[44]=T,e[45]=Oe,e[46]=ke):(Oe=e[45],ke=e[46]),(0,Q.useEffect)(Oe,ke);let Ae;e[47]===Symbol.for(`react.memo_cache_sentinel`)?(Ae={activationConstraint:{distance:8}},e[47]=Ae):Ae=e[47];let je;e[48]===Symbol.for(`react.memo_cache_sentinel`)?(je={coordinateGetter:Jo,keyboardCodes:bP},e[48]=je):je=e[48];let Me=ts(Ho(Ko,Ae),Ho(Yo,je)),Ne=z,Pe;e[49]===Symbol.for(`react.memo_cache_sentinel`)?(Pe=function(){A(DP(O.current))},e[49]=Pe):Pe=e[49];let Fe=Pe,Ie;e[50]===Symbol.for(`react.memo_cache_sentinel`)?(Ie=function(){A(null)},e[50]=Ie):Ie=e[50];let Le=Ie,Re;e[51]!==Le||e[52]!==C||e[53]!==T?(Re=function(e){Le();let t=String(e.active.id),n=e.over?String(e.over.id):null;if(!n||t===n)return;let r=T.indexOf(t),i=T.indexOf(n);r<0||i<0||r===i||C(Qo([...T],r,i),t)},e[51]=Le,e[52]=C,e[53]=T,e[54]=Re):Re=e[54];let ze=Re,Be=be?``:void 0,Ve;e[55]===Symbol.for(`react.memo_cache_sentinel`)?(Ve=Y(`pl-2 flex h-12 min-w-0 touch-manipulation flex-1 items-end overflow-x-auto overflow-y-hidden overscroll-x-contain scroll-fade-mask-x [scrollbar-width:none]`,be&&`[-webkit-app-region:drag]`),e[55]=Ve):Ve=e[55];let He=LP,Ue;e[56]===Symbol.for(`react.memo_cache_sentinel`)?(Ue=Y(`flex items-end gap-1`,be&&`[-webkit-app-region:no-drag]`),e[56]=Ue):Ue=e[56];let We=Wo,Ge=kP,Ke;e[57]===Symbol.for(`react.memo_cache_sentinel`)?(Ke={container:typeof document<`u`?document.body:void 0},e[57]=Ke):Ke=e[57];let qe=Xo,Je;e[58]===T?Je=e[59]:(Je=[...T],e[58]=T,e[59]=Je);let Ye=Uo,Xe=T.map((e,t)=>{let n=z?HP(t,T.length):null,i=UP(t,T.length);if(Se.has(e)){let t=e===r;return(0,Z.jsx)(qP,{tabId:e,canPin:!1,openTabs:T,closeTab:c,closeTabs:De,pinTab:_,pinnedTabIds:y,unpinTab:w,children:(0,Z.jsxs)(KP,{tabId:e,activateFromKeyboard:()=>o(e),"aria-current":t?`page`:void 0,"aria-keyshortcuts":i,"data-active-tab":t?`true`:void 0,className:Y(jP,t?MP:NP),onAuxClick:t=>{t.button===1&&(t.preventDefault(),c(e))},onClick:t=>{t.target===t.currentTarget&&o(e)},children:[(0,Z.jsx)(`button`,{type:`button`,"aria-label":E({id:`zLak8b`}),"data-testid":`editor-new-tab-placeholder-button`,className:PP,onClick:()=>o(e),tabIndex:-1,children:(0,Z.jsx)(`span`,{className:`min-w-0 truncate`,children:(0,Z.jsx)(J,{id:`3YvS-c`})})}),n?(0,Z.jsx)(GP,{value:n}):(0,Z.jsx)(`button`,{type:`button`,"aria-label":E({id:`xCdTnb`}),"data-testid":`editor-new-tab-placeholder-close`,className:xP(Ne||t),tabIndex:SP(t),onClick:t=>{t.stopPropagation(),c(e)},children:(0,Z.jsx)(xs,{"aria-hidden":`true`,className:`size-3.5`})})]})},e)}let s=Yt(e),u=e===re,d=y.includes(e);if(s.kind===`folder`){let{baseName:t,label:r,prefix:o}=v(s.folderPath,`/`),c=`${o}${r}`;return(0,Z.jsx)(qP,{tabId:e,openTabs:T,closeTab:l,closeTabs:De,pinTab:_,pinnedTabIds:y,unpinTab:w,children:(0,Z.jsxs)(KP,{tabId:e,activateFromKeyboard:()=>a(e),"aria-current":u?`page`:void 0,"aria-keyshortcuts":i,"data-active-tab":u?`true`:void 0,className:Y(jP,u?MP:NP),onAuxClick:t=>{t.button===1&&(t.preventDefault(),!d&&l(e))},onClick:t=>{t.target===t.currentTarget&&a(e)},children:[(0,Z.jsxs)(`button`,{type:`button`,"aria-label":c,title:c,className:PP,onClick:()=>{a(e)},tabIndex:-1,children:[o&&(0,Z.jsx)(`span`,{className:Y(`min-w-0 flex-1 truncate`,u&&`text-muted-foreground`),children:o}),(0,Z.jsxs)(`span`,{className:Y(`flex min-w-0 items-center`,o?`max-w-[70%] shrink-0`:`flex-1`),children:[(0,Z.jsx)(`span`,{className:`min-w-0 truncate`,children:t}),(0,Z.jsx)(`span`,{className:`shrink-0`,children:`/`})]})]}),(0,Z.jsx)(JP,{accessibleLabel:c,closeTab:l,forceCloseVisible:Ne,isActive:u,isPinned:d,shortcutHint:n,tabId:e,unpinTab:w})]})},e)}if(s.kind===`asset`||s.kind===`skill-file`){let{baseName:t,label:r,prefix:o}=v(s.kind===`asset`?s.assetPath:s.path,``),c=`${o}${r}`;return(0,Z.jsx)(qP,{tabId:e,openTabs:T,closeTab:l,closeTabs:De,pinTab:_,pinnedTabIds:y,unpinTab:w,children:(0,Z.jsxs)(KP,{tabId:e,activateFromKeyboard:()=>a(e),"aria-current":u?`page`:void 0,"aria-keyshortcuts":i,"data-active-tab":u?`true`:void 0,className:Y(jP,u?MP:NP),onAuxClick:t=>{t.button===1&&(t.preventDefault(),!d&&l(e))},onClick:t=>{t.target===t.currentTarget&&a(e)},children:[(0,Z.jsxs)(`button`,{type:`button`,"aria-label":c,className:PP,onClick:()=>{a(e)},tabIndex:-1,children:[o?(0,Z.jsx)(`span`,{className:Y(`min-w-0 flex-1 truncate text-muted-foreground/60`,u&&`text-muted-foreground`),children:o}):null,(0,Z.jsx)(`span`,{className:Y(`min-w-0 truncate`,o?`max-w-[70%] shrink-0`:`flex-1`),children:t})]}),(0,Z.jsx)(JP,{accessibleLabel:c,closeTab:l,forceCloseVisible:Ne,isActive:u,isPinned:d,shortcutHint:n,tabId:e,unpinTab:w})]})},e)}let f=s.docName,p=D.get(f)?.docExt??`.md`,{baseName:m,extension:h,label:g,prefix:b}=v(f,p),x=`${b}${g}`,S=p===`.md`||p===`.mdx`,C=j?.tabId===e,O=`editor-tab-rename-error-${FP(f)}`;return(0,Z.jsx)(qP,{disabled:C,tabId:e,openTabs:T,closeTab:l,closeTabs:De,pinTab:_,pinnedTabIds:y,unpinTab:w,children:(0,Z.jsx)(KP,{tabId:e,activateFromKeyboard:()=>a(e),disabled:C,"aria-current":u?`page`:void 0,"aria-keyshortcuts":i,"data-active-tab":u?`true`:void 0,className:Y(jP,u?MP:NP,C&&F&&`border-destructive`),onAuxClick:t=>{t.button===1&&(t.preventDefault(),!d&&l(e))},onClick:t=>{t.target===t.currentTarget&&a(e)},children:C?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(qC,{className:`h-full min-w-0 flex-1 rounded-none border-0 bg-transparent dark:bg-transparent`,children:[(0,Z.jsx)(QC,{ref:V,value:N,disabled:L,"aria-label":E({id:`Dw1T_W`,values:{label:g}}),"data-testid":`editor-tab-rename-input`,"aria-invalid":F?!0:void 0,"aria-describedby":F?O:void 0,"aria-busy":L||void 0,title:F??f,className:`h-full min-w-0 px-2 py-0 font-medium text-foreground text-xs selection:bg-primary selection:text-primary-foreground`,onChange:e=>{P(RP(e.target.value,p)),I(null),W.current=null},onKeyDown:e=>{e.key===`Enter`?(e.preventDefault(),ye()):e.key===`Escape`&&(e.preventDefault(),ve())},onBlur:ye}),(0,Z.jsx)(YC,{align:`inline-end`,"aria-hidden":`true`,className:`pr-2 text-xs`,children:(0,Z.jsx)(ZC,{className:`text-muted-foreground/60 text-xs`,children:p})})]}),F?(0,Z.jsx)(`span`,{id:O,role:`alert`,className:`sr-only`,children:F}):null]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(XP,{accessibleLabel:x,activateTab:a,baseName:m,docName:f,enterRenameMode:_e,extension:h,hideDocExtension:S,tabId:e}),(0,Z.jsx)(JP,{accessibleLabel:x,closeTab:l,forceCloseVisible:Ne,isActive:u,isPinned:d,shortcutHint:n,tabId:e,unpinTab:w})]})})},e)}),Ze;e[60]!==qe||e[61]!==Je||e[62]!==Ye||e[63]!==Xe?(Ze=(0,Z.jsx)(qe,{items:Je,strategy:Ye,children:Xe}),e[60]=qe,e[61]=Je,e[62]=Ye,e[63]=Xe,e[64]=Ze):Ze=e[64];let Qe;e[65]!==We||e[66]!==Le||e[67]!==ze||e[68]!==Fe||e[69]!==Me||e[70]!==!1||e[71]!==Ge||e[72]!==Ke||e[73]!==Ze||e[74]!==Te?(Qe=(0,Z.jsx)(We,{sensors:Me,autoScroll:!1,collisionDetection:Ge,modifiers:Te,onDragStart:Fe,onDragEnd:ze,onDragCancel:Le,accessibility:Ke,children:Ze}),e[65]=We,e[66]=Le,e[67]=ze,e[68]=Fe,e[69]=Me,e[70]=!1,e[71]=Ge,e[72]=Ke,e[73]=Ze,e[74]=Te,e[75]=Qe):Qe=e[75];let $e;e[76]===E?$e=e[77]:($e=E({id:`3YvS-c`}),e[76]=E,e[77]=$e);let et;e[78]===Symbol.for(`react.memo_cache_sentinel`)?(et=(0,Z.jsx)(ge,{"aria-hidden":`true`}),e[78]=et):et=e[78];let tt;e[79]!==h||e[80]!==$e?(tt=(0,Z.jsx)(As,{asChild:!0,children:(0,Z.jsx)(X,{type:`button`,size:`icon-xs`,variant:`ghost`,"aria-label":$e,"data-testid":`editor-new-tab-button`,className:`first:mb-3 mb-1.5`,onClick:h,children:et})}),e[79]=h,e[80]=$e,e[81]=tt):tt=e[81];let nt;e[82]===Symbol.for(`react.memo_cache_sentinel`)?(nt=(0,Z.jsx)(js,{children:(0,Z.jsx)(J,{id:`3YvS-c`})}),e[82]=nt):nt=e[82];let rt;e[83]===tt?rt=e[84]:(rt=(0,Z.jsxs)(Ns,{children:[tt,nt]}),e[83]=tt,e[84]=rt);let it;e[85]!==Ue||e[86]!==Qe||e[87]!==rt?(it=(0,Z.jsxs)(`div`,{className:Ue,children:[Qe,rt]}),e[85]=Ue,e[86]=Qe,e[87]=rt,e[88]=it):it=e[88];let at;return e[89]!==Be||e[90]!==Ve||e[91]!==He||e[92]!==it?(at=(0,Z.jsx)(`div`,{ref:O,"data-electron-drag":Be,className:Ve,onWheel:He,children:it}),e[89]=Be,e[90]=Ve,e[91]=He,e[92]=it,e[93]=at):at=e[93],at}var QP=(e,t,n)=>{if(e&&`reportValidity`in e){let r=Ba(n,t);e.setCustomValidity(r&&r.message||``),e.reportValidity()}},$P=(e,t)=>{for(let n in t.fields){let r=t.fields[n];r&&r.ref&&`reportValidity`in r.ref?QP(r.ref,n,e):r&&r.refs&&r.refs.forEach(t=>QP(t,n,e))}},eF=(e,t)=>{t.shouldUseNativeValidation&&$P(e,t);let n={};for(let r in e){let i=Ba(t.fields,r),a=Object.assign(e[r]||{},{ref:i&&i.ref});if(tF(t.names||Object.keys(e),r)){let e=Object.assign({},Ba(n,r));oo(e,`root`,a),oo(n,r,e)}else oo(n,r,a)}return n},tF=(e,t)=>{let n=nF(t).replace(/[.*+?^${}()|\\]/g,`\\$&`);return e.some(e=>nF(e).match(`^${n}\\.\\d+`))};function nF(e){return e.replace(/[\[\]]/g,``)}function rF(){return rF=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},rF.apply(null,arguments)}function iF(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}function aF(e,t){for(var n={};e.length;){var r=e[0],i=r.code,a=r.message,o=r.path.join(`.`);if(!n[o])if(`unionErrors`in r){var s=r.unionErrors[0].errors[0];n[o]={message:s.message,type:s.code}}else n[o]={message:a,type:i};if(`unionErrors`in r&&r.unionErrors.forEach(function(t){return t.errors.forEach(function(t){return e.push(t)})}),t){var c=n[o].types,l=c&&c[r.code];n[o]=Ma(o,t,n,i,l?[].concat(l,r.message):r.message)}e.shift()}return n}function oF(e,t){for(var n={},r=function(){var r=e[0],i=r.code,a=r.message,o=r.path.join(`.`);if(!n[o])if(r.code===`invalid_union`&&r.errors.length>0){var s=r.errors[0][0];n[o]={message:s.message,type:s.code}}else n[o]={message:a,type:i};if(r.code===`invalid_union`&&r.errors.forEach(function(t){return t.forEach(function(t){return e.push(rF({},t,{path:[].concat(r.path,t.path)}))})}),t){var c=n[o].types,l=c&&c[r.code];n[o]=Ma(o,t,n,i,l?[].concat(l,r.message):r.message)}e.shift()};e.length;)r();return n}function sF(e,t,n){if(n===void 0&&(n={}),function(e){return`_def`in e&&typeof e._def==`object`&&`typeName`in e._def}(e))return function(r,i,a){try{return Promise.resolve(iF(function(){return Promise.resolve(e[n.mode===`sync`?`parse`:`parseAsync`](r,t)).then(function(e){return a.shouldUseNativeValidation&&$P({},a),{errors:{},values:n.raw?Object.assign({},r):e}})},function(e){if(function(e){return Array.isArray(e?.issues)}(e))return{values:{},errors:eF(aF(e.errors,!a.shouldUseNativeValidation&&a.criteriaMode===`all`),a)};throw e}))}catch(e){return Promise.reject(e)}};if(function(e){return`_zod`in e&&typeof e._zod==`object`}(e))return function(r,i,a){try{return Promise.resolve(iF(function(){return Promise.resolve((n.mode===`sync`?xr:yr)(e,r,t)).then(function(e){return a.shouldUseNativeValidation&&$P({},a),{errors:{},values:n.raw?Object.assign({},r):e}})},function(e){if(function(e){return e instanceof Sr}(e))return{values:{},errors:eF(oF(e.issues,!a.shouldUseNativeValidation&&a.criteriaMode===`all`),a)};throw e}))}catch(e){return Promise.reject(e)}};throw Error(`Invalid input: not a Zod schema`)}var cF=`https://openknowledge.ai/api/subscribe`;async function lF(e,t){try{let n=await fetch(cF,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({email:e,source:t}),signal:AbortSignal.timeout(15e3)});return n.ok?{ok:!0}:n.status===400?{ok:!1,reason:`invalid`}:n.status===503?{ok:!1,reason:`unavailable`}:(console.warn(`[subscribe] action=submit result=http-error status=${n.status}`),{ok:!1,reason:`error`})}catch(e){return console.warn(`[subscribe] action=submit result=network-error message=${e instanceof Error?e.message:String(e)}`),{ok:!1,reason:`error`}}}function uF(e){let t=(0,$.c)(49),{source:n,title:r,description:i,onSuccess:a,onDismiss:o,autoFocus:s,compactSubmit:c,className:l}=e,{_:u}=an(),[d,f]=(0,Q.useState)(!1),p=(0,Q.useRef)(null),m,h;t[0]===d?(m=t[1],h=t[2]):(m=()=>{d&&p.current?.focus()},h=[d],t[0]=d,t[1]=m,t[2]=h),(0,Q.useEffect)(m,h);let g,_;if(t[3]!==u){let e=Qr({email:Yn({message:u({id:`Wq6Wcm`})})});_=Aa,g=sF(e),t[3]=u,t[4]=g,t[5]=_}else g=t[4],_=t[5];let v;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(v={email:``},t[6]=v):v=t[6];let y;t[7]===g?y=t[8]:(y={resolver:g,defaultValues:v},t[7]=g,t[8]=y);let b=_(y),{isSubmitting:x}=b.formState,S=b.formState.errors.email?.message??b.formState.errors.root?.message,C;t[9]!==u||t[10]!==b||t[11]!==a||t[12]!==n?(C=async function(e){b.clearErrors(`root`);let t=await lF(e.email,n);if(t.ok){f(!0),a?.();return}if(t.reason===`invalid`){b.setError(`email`,{message:u({id:`Wq6Wcm`})});return}if(t.reason===`unavailable`){b.setError(`root`,{message:u({id:`4mLBx9`})});return}b.setError(`root`,{message:u({id:`fWsBTs`})})},t[9]=u,t[10]=b,t[11]=a,t[12]=n,t[13]=C):C=t[13];let w=C,T;t[14]===l?T=t[15]:(T=Y(`flex flex-col gap-3`,l),t[14]=l,t[15]=T);let E=d?-1:void 0,D;t[16]!==d||t[17]!==r?(D=d?(0,Z.jsxs)(`span`,{className:`mb-1.5 inline-flex flex-row items-center gap-2`,children:[(0,Z.jsx)(Ji,{className:`size-4 text-primary`}),(0,Z.jsx)(J,{id:`PIMM5l`})]}):r??(0,Z.jsx)(J,{id:`GzPQ2f`}),t[16]=d,t[17]=r,t[18]=D):D=t[18];let O;t[19]!==D||t[20]!==E?(O=(0,Z.jsx)(`p`,{ref:p,tabIndex:E,className:`text-sm font-medium leading-tight text-foreground focus:outline-none`,children:D}),t[19]=D,t[20]=E,t[21]=O):O=t[21];let k;t[22]!==i||t[23]!==d?(k=d?(0,Z.jsx)(J,{id:`pBROkv`}):i??(0,Z.jsx)(J,{id:`WmPbvm`}),t[22]=i,t[23]=d,t[24]=k):k=t[24];let A;t[25]===k?A=t[26]:(A=(0,Z.jsx)(`p`,{className:`text-1sm text-muted-foreground`,role:`status`,children:k}),t[25]=k,t[26]=A);let j;t[27]!==O||t[28]!==A?(j=(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[O,A]}),t[27]=O,t[28]=A,t[29]=j):j=t[29];let M;t[30]!==u||t[31]!==o?(M=o?(0,Z.jsx)(X,{type:`button`,variant:`ghost`,size:`icon`,onClick:o,"aria-label":u({id:`yz7wBu`}),className:`-mr-1.5 -mt-1 size-7 shrink-0 text-muted-foreground opacity-60`,children:(0,Z.jsx)(xs,{className:`size-4`})}):null,t[30]=u,t[31]=o,t[32]=M):M=t[32];let N;t[33]!==j||t[34]!==M?(N=(0,Z.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[j,M]}),t[33]=j,t[34]=M,t[35]=N):N=t[35];let P;t[36]!==u||t[37]!==s||t[38]!==c||t[39]!==S||t[40]!==b||t[41]!==x||t[42]!==w||t[43]!==d?(P=d?null:(0,Z.jsxs)(`form`,{onSubmit:b.handleSubmit(w),className:`flex flex-col gap-2`,noValidate:!0,children:[(0,Z.jsx)(Wa,{control:b.control,name:`email`,render:e=>{let{field:t,fieldState:n}=e;return(0,Z.jsxs)(qC,{className:`h-10 rounded-xl`,children:[(0,Z.jsx)(YC,{className:`pl-2.5`,children:(0,Z.jsx)(rf,{className:`size-4 text-muted-foreground opacity-60`})}),(0,Z.jsx)(QC,{...t,id:t.name,type:`email`,inputMode:`email`,autoComplete:`email`,spellCheck:!1,autoFocus:s,placeholder:u({id:`2hYmUH`}),"aria-invalid":n.invalid,"aria-label":u({id:`ATGYL1`}),"data-testid":`subscribe-email`,className:`placeholder:text-muted-foreground/60`}),(0,Z.jsx)(X,{type:`submit`,disabled:x,size:c?`icon`:`default`,className:Y(`mr-1 ml-auto text-1sm`,c&&`size-8 shrink-0 rounded-lg`),"data-testid":`subscribe-submit`,children:x?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(is,{className:`size-3.5 animate-spin`,"aria-hidden":!0}),(0,Z.jsx)(`span`,{className:`sr-only`,children:(0,Z.jsx)(J,{id:`lCC_D5`})})]}):c?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(gt,{className:`size-4`,"aria-hidden":!0}),(0,Z.jsx)(`span`,{className:`sr-only`,children:(0,Z.jsx)(J,{id:`EDl9kS`})})]}):(0,Z.jsx)(J,{id:`EDl9kS`})})]})}}),S?(0,Z.jsx)(`p`,{className:`text-sm text-destructive`,role:`alert`,children:S}):null]}),t[36]=u,t[37]=s,t[38]=c,t[39]=S,t[40]=b,t[41]=x,t[42]=w,t[43]=d,t[44]=P):P=t[44];let F;return t[45]!==N||t[46]!==P||t[47]!==T?(F=(0,Z.jsxs)(`div`,{className:T,children:[N,P]}),t[45]=N,t[46]=P,t[47]=T,t[48]=F):F=t[48],F}var dF=`https://github.com/inkeep/open-knowledge`,fF=`https://discord.com/invite/YujKpFN49`,pF=`https://x.com/OpenKnowledge`,mF=`ok-subscribe-card-v1`,hF={subscribed:!1,dismissed:!1,shownVersions:[]};function gF(e,t){return!e.subscribed&&!e.dismissed&&e.shownVersions.length<3&&!e.shownVersions.includes(t)}function _F(e){return e===!0}function vF(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}function yF(e){if(typeof e!=`object`||!e)return hF;let t=e;return{subscribed:_F(t.subscribed),dismissed:_F(t.dismissed),shownVersions:vF(t.shownVersions)}}function bF(e){try{let t=(e??localStorage).getItem(mF);return t==null?hF:yF(JSON.parse(t))}catch(e){return console.warn(`[subscribe-card-store] readPersistedState failed (corrupt/privacy/SSR)`,e),hF}}function xF(e,t){try{(t??localStorage).setItem(mF,JSON.stringify(e))}catch(e){console.warn(`[subscribe-card-store] writePersistedState failed (quota/privacy/SSR)`,e)}}function SF(e){let t=bF(e),n=new Set,r=!1;function i(){for(let e of n)e()}function a(n){t=n,xF(t,e),i()}return{getSnapshot(){return t},subscribe(e){return n.add(e),()=>{n.delete(e)}},markSubscribed(){t.subscribed||a({...t,subscribed:!0})},dismiss(){t.dismissed||a({...t,dismissed:!0})},recordShown(e){t.shownVersions.includes(e)||a({...t,shownVersions:[...t.shownVersions,e]})},install(){r||(r=!0,t=bF(e),i())}}}var CF=SF();function wF(){CF.install()}function TF(e){let t=(0,$.c)(4),n,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsx)(`title`,{children:`Discord`}),r=(0,Z.jsx)(`path`,{d:`M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9554 2.4189-2.1568 2.4189Z`}),t[0]=n,t[1]=r):(n=t[0],r=t[1]);let i;return t[2]===e?i=t[3]:(i=(0,Z.jsxs)(`svg`,{role:`img`,fill:`currentColor`,height:24,width:24,viewBox:`0 0 24 24`,xmlns:`http://www.w3.org/2000/svg`,...e,children:[n,r]}),t[2]=e,t[3]=i),i}function EF(e){let t=(0,$.c)(4),n,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsx)(`title`,{children:`GitHub`}),r=(0,Z.jsx)(`path`,{d:`M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12`}),t[0]=n,t[1]=r):(n=t[0],r=t[1]);let i;return t[2]===e?i=t[3]:(i=(0,Z.jsxs)(`svg`,{role:`img`,fill:`currentColor`,height:24,width:24,viewBox:`0 0 24 24`,xmlns:`http://www.w3.org/2000/svg`,...e,children:[n,r]}),t[2]=e,t[3]=i),i}function DF(e){let t=(0,$.c)(4),n,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsx)(`title`,{children:`X (Twitter)`}),r=(0,Z.jsx)(`path`,{d:`M18.901 1.153h3.68l-8.04 9.19L24 22.846h-7.406l-5.8-7.584-6.638 7.584H.474l8.6-9.83L0 1.154h7.594l5.243 6.932ZM17.61 20.644h2.039L6.486 3.24H4.298Z`}),t[0]=n,t[1]=r):(n=t[0],r=t[1]);let i;return t[2]===e?i=t[3]:(i=(0,Z.jsxs)(`svg`,{role:`img`,fill:`currentColor`,height:24,width:24,viewBox:`0 0 24 24`,xmlns:`http://www.w3.org/2000/svg`,...e,children:[n,r]}),t[2]=e,t[3]=i),i}var OF=[{key:`resources`,heading:{id:`s-MGs7`},links:[{label:{id:`TbjyhA`},href:`https://openknowledge.ai/docs`,icon:We},{label:{id:`PCNIuJ`},href:`${dF}/issues/new`,icon:Od},{label:{id:`On0aF2`},href:`https://openknowledge.ai/`,icon:$i}]},{key:`community`,heading:{id:`chL5IG`},links:[{label:`Discord`,href:fF,icon:TF},{label:`X (Twitter)`,href:pF,icon:DF},{label:`GitHub`,href:dF,icon:EF}]}],kF=`${dF}/releases`,AF=`group flex items-center gap-2.5 rounded-md px-2 py-1.5 text-sm text-muted-foreground transition-colors hover:bg-azure-900/5 dark:hover:bg-white/20 hover:text-primary`;function jF(e){if(e<1e3)return String(e);let t=e/1e3;return`${t>=10?Math.round(t):t.toFixed(1)}k`}var MF=e=>{let t=(0,$.c)(12),{count:n}=e,{_:r}=an(),i,a,o,s;t[0]!==r||t[1]!==n?(i=jF(n),a=`img`,o=`ml-auto flex items-center gap-1 text-xs tabular-nums text-muted-foreground`,s=r({id:`SVLPt5`,values:{formatted:i}}),t[0]=r,t[1]=n,t[2]=i,t[3]=a,t[4]=o,t[5]=s):(i=t[2],a=t[3],o=t[4],s=t[5]);let c;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Z.jsx)(Af,{className:`size-3 fill-current`,"aria-hidden":`true`}),t[6]=c):c=t[6];let l;return t[7]!==i||t[8]!==a||t[9]!==o||t[10]!==s?(l=(0,Z.jsxs)(`span`,{role:a,className:o,"aria-label":s,children:[c,i]}),t[7]=i,t[8]=a,t[9]=o,t[10]=s,t[11]=l):l=t[11],l},NF=e=>{let t=(0,$.c)(15),{link:n,trailing:r}=e,{_:i}=an(),{label:a,href:o,icon:s}=n,c,l;t[0]===o?(c=t[1],l=t[2]):(c=e=>hu(e,o),l=e=>hu(e,o),t[0]=o,t[1]=c,t[2]=l);let u;t[3]===s?u=t[4]:(u=(0,Z.jsx)(s,{"aria-hidden":`true`,className:`size-4 shrink-0`}),t[3]=s,t[4]=u);let d;t[5]!==i||t[6]!==a?(d=typeof a==`string`?a:i(a),t[5]=i,t[6]=a,t[7]=d):d=t[7];let f;return t[8]!==o||t[9]!==c||t[10]!==l||t[11]!==u||t[12]!==d||t[13]!==r?(f=(0,Z.jsx)(`li`,{children:(0,Z.jsxs)(`a`,{href:o,target:`_blank`,rel:`noopener noreferrer`,onClick:c,onAuxClick:l,className:AF,children:[u,d,r]})}),t[8]=o,t[9]=c,t[10]=l,t[11]=u,t[12]=d,t[13]=r,t[14]=f):f=t[14],f},PF=e=>{let t=(0,$.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,Z.jsx)(`p`,{className:`font-mono tracking-wide uppercase text-muted-foreground text-xs mb-1`,children:n}),t[0]=n,t[1]=r),r},FF=()=>{let e=(0,$.c)(28),{_:t}=an(),[n,r]=(0,Q.useState)(!1),[i,a]=(0,Q.useState)(!1),[o,s]=(0,Q.useState)(null),c,l;e[0]!==n||e[1]!==o?(c=()=>{if(!n||o!==null)return;let e=new AbortController;return gi({signal:e.signal}).then(e=>{e!==null&&s(e)}),()=>e.abort()},l=[n,o],e[0]=n,e[1]=o,e[2]=c,e[3]=l):(c=e[2],l=e[3]),(0,Q.useEffect)(c,l);let u;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(u=e=>{r(e),e||a(!1)},e[4]=u):u=e[4];let d;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Z.jsx)(ft,{className:`size-4`}),e[5]=d):d=e[5];let f;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Z.jsx)(As,{asChild:!0,children:(0,Z.jsx)(Ie,{asChild:!0,children:(0,Z.jsxs)(X,{variant:`ghost`,size:`icon`,className:`size-7 hover:bg-accent text-muted-foreground`,children:[d,(0,Z.jsx)(`span`,{className:`sr-only`,children:(0,Z.jsx)(J,{id:`s-MGs7`})})]})})}),e[6]=f):f=e[6];let p;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Z.jsxs)(Ns,{children:[f,(0,Z.jsx)(js,{children:(0,Z.jsx)(J,{id:`s-MGs7`})})]}),e[7]=p):p=e[7];let m;e[8]!==t||e[9]!==o?(m=OF.map((e,n)=>(0,Z.jsxs)(`div`,{className:Y(n>0&&`mt-3`),children:[(0,Z.jsx)(PF,{children:t(e.heading)}),(0,Z.jsx)(`nav`,{"aria-label":t(e.heading),children:(0,Z.jsx)(`ul`,{className:`space-y-0.5`,children:e.links.map(e=>(0,Z.jsx)(NF,{link:e,trailing:e.href===`https://github.com/inkeep/open-knowledge`&&o!==null?(0,Z.jsx)(MF,{count:o}):void 0},e.href))})})]},e.key)),e[8]=t,e[9]=o,e[10]=m):m=e[10];let h;e[11]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,Z.jsx)(PF,{children:(0,Z.jsx)(J,{id:`arUUsK`})}),e[11]=h):h=e[11];let g;e[12]===t?g=e[13]:(g=t({id:`arUUsK`}),e[12]=t,e[13]=g);let _;e[14]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,Z.jsx)(NF,{link:{label:{id:`3ePd3I`},href:kF,icon:af}}),e[14]=_):_=e[14];let v;e[15]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,Z.jsx)(Ie,{asChild:!0,children:(0,Z.jsxs)(X,{variant:`ghost`,className:Y(AF,`h-auto w-full justify-start font-normal`),children:[(0,Z.jsx)(rf,{"aria-hidden":`true`,className:`size-4 shrink-0`}),(0,Z.jsx)(J,{id:`EDl9kS`})]})}),e[15]=v):v=e[15];let y;e[16]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Z.jsx)(Ut,{side:`left`,align:`center`,sideOffset:20,className:`w-80`,children:(0,Z.jsx)(uF,{source:`resources_menu`,autoFocus:!0,onDismiss:()=>a(!1),onSuccess:IF})}),e[16]=y):y=e[16];let b;e[17]===i?b=e[18]:(b=(0,Z.jsxs)(`ul`,{className:`space-y-0.5`,children:[_,(0,Z.jsx)(`li`,{children:(0,Z.jsxs)(Ne,{open:i,onOpenChange:a,children:[v,y]})})]}),e[17]=i,e[18]=b);let x;e[19]!==b||e[20]!==g?(x=(0,Z.jsxs)(`div`,{className:`mt-3`,children:[h,(0,Z.jsx)(`nav`,{"aria-label":g,children:b})]}),e[19]=b,e[20]=g,e[21]=x):x=e[21];let S;e[22]!==x||e[23]!==m?(S=(0,Z.jsxs)(Ut,{align:`end`,className:`w-56 p-3`,children:[m,x]}),e[22]=x,e[23]=m,e[24]=S):S=e[24];let C;return e[25]!==n||e[26]!==S?(C=(0,Z.jsxs)(Ne,{open:n,onOpenChange:u,children:[p,S]}),e[25]=n,e[26]=S,e[27]=C):C=e[27],C};function IF(){return CF.markSubscribed()}var LF=50,RF=()=>{let e=(0,$.c)(8),t=(0,Q.useRef)(null),n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=()=>{t.current===null&&(t.current=setTimeout(()=>{t.current=null,MC.preload()},LF))},e[0]=n):n=e[0];let r=n,i;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=()=>{t.current!==null&&(clearTimeout(t.current),t.current=null)},e[1]=i):i=e[1];let a=i,o,s;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=()=>()=>{t.current!==null&&clearTimeout(t.current)},s=[],e[2]=o,e[3]=s):(o=e[2],s=e[3]),(0,Q.useEffect)(o,s);let c,l;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(c=()=>{a(),window.location.hash!==`#settings`&&(window.location.hash=Ja)},l=(0,Z.jsx)(Sf,{className:`size-4`}),e[4]=c,e[5]=l):(c=e[4],l=e[5]);let u;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Z.jsx)(As,{asChild:!0,children:(0,Z.jsxs)(X,{variant:`ghost`,size:`icon`,className:`size-7 hover:bg-accent text-muted-foreground`,"data-testid":`header-settings-button`,onMouseEnter:r,onMouseLeave:a,onFocus:r,onBlur:a,onClick:c,children:[l,(0,Z.jsx)(`span`,{className:`sr-only`,children:(0,Z.jsx)(J,{id:`Tz0i8g`})})]})}),e[6]=u):u=e[6];let d;return e[7]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Z.jsxs)(Ns,{children:[u,(0,Z.jsx)(js,{children:(0,Z.jsx)(J,{id:`Tz0i8g`})})]}),e[7]=d):d=e[7],d},zF=`https://openknowledge.ai/docs/features/share`;function BF(e){let t=(0,$.c)(50),{input:n,onClickWhenNoRemote:r}=e,{_:i}=an(),{status:a}=Pi(),[o,s]=(0,Q.useState)(!1),[c,l]=(0,Q.useState)(null),u=(0,Q.useRef)(null),d;t[0]===c?.autoCopyFailed?d=t[1]:(d=()=>{!c?.autoCopyFailed||!u.current||(u.current.focus(),u.current.select())},t[0]=c?.autoCopyFailed,t[1]=d);let f;t[2]===c?f=t[3]:(f=[c],t[2]=c,t[3]=f),(0,Q.useEffect)(d,f);let p=a?.hasRemote===!0,m=n===null,h=Ai(c?.freshness,a),g;t[4]!==i||t[5]!==o||t[6]!==p||t[7]!==n||t[8]!==r?(g=async function(){if(!o&&n!==null){s(!0),l(null);try{let e=await Ia({...n,hasRemote:p,onClickWhenNoRemote:r},{clipboardWrite:xa,toastSuccess:JF,toastError:qF,logEvent:KF});e.kind===`copied`?l({url:e.shareUrl,autoCopyFailed:!1,freshness:e.freshness}):e.kind===`clipboard-failed`&&l({url:e.shareUrl,autoCopyFailed:!0,freshness:e.freshness})}catch{bs.error(i({id:`u3YnKw`}))}s(!1)}},t[4]=i,t[5]=o,t[6]=p,t[7]=n,t[8]=r,t[9]=g):g=t[9];let _=g,v=c!==null,y;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(y=e=>{e||l(null)},t[10]=y):y=t[10];let b;t[11]!==i||t[12]!==n?.kind?(b=n?.kind===`folder`?i({id:`WR0y2O`}):i({id:`F4IYWe`}),t[11]=i,t[12]=n?.kind,t[13]=b):b=t[13];let x=o||m,S,C;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,Z.jsx)(Cf,{className:`size-3.5`,"aria-hidden":!0}),C=(0,Z.jsx)(J,{id:`Z8lGw6`}),t[14]=S,t[15]=C):(S=t[14],C=t[15]);let w;t[16]!==_||t[17]!==b||t[18]!==x?(w=(0,Z.jsx)(dt,{asChild:!0,children:(0,Z.jsxs)(X,{variant:`ghost`,size:`sm`,"aria-label":b,onClick:_,disabled:x,className:`gap-1.5 text-muted-foreground px-1.5`,"data-testid":`share-button`,children:[S,C]})}),t[16]=_,t[17]=b,t[18]=x,t[19]=w):w=t[19];let T=h?`w-96`:`w-80`,E;t[20]===T?E=t[21]:(E=Y(`flex flex-col gap-2`,T),t[20]=T,t[21]=E);let D;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,Z.jsx)(`p`,{className:`font-mono tracking-wide uppercase text-muted-foreground text-xs`,children:(0,Z.jsx)(J,{id:`Z8lGw6`})}),t[22]=D):D=t[22];let O;t[23]===c?.autoCopyFailed?O=t[24]:(O=c?.autoCopyFailed?(0,Z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:(0,Z.jsx)(J,{id:`ndeI89`})}):null,t[23]=c?.autoCopyFailed,t[24]=O);let k=c?.url??``,A;t[25]===i?A=t[26]:(A=i({id:`5-FeN2`}),t[25]=i,t[26]=A);let j;t[27]!==k||t[28]!==A?(j=(0,Z.jsx)(qc,{ref:u,readOnly:!0,value:k,onFocus:GF,onClick:WF,onContextMenu:UF,className:`select-all bg-muted font-mono text-xs text-muted-foreground`,"data-testid":`share-button-url`,"aria-label":A}),t[27]=k,t[28]=A,t[29]=j):j=t[29];let M=c?.url??``,N=c?.autoCopyFailed===!1,P;t[30]!==M||t[31]!==N?(P=(0,Z.jsx)(`div`,{className:`absolute inset-y-0 right-1 flex items-center`,children:(0,Z.jsx)(`div`,{className:`rounded-md bg-background/50 backdrop-blur-sm`,children:(0,Z.jsx)(W,{copyContent:M,clipboardWrite:xa,initialCopied:N})})}),t[30]=M,t[31]=N,t[32]=P):P=t[32];let F;t[33]!==j||t[34]!==P?(F=(0,Z.jsxs)(`div`,{className:`relative`,children:[j,P]}),t[33]=j,t[34]=P,t[35]=F):F=t[35];let I=c?.freshness,L=n?.kind??`doc`,R;t[36]!==a||t[37]!==I||t[38]!==L?(R=(0,Z.jsx)(Oi,{freshness:I,status:a,kind:L}),t[36]=a,t[37]=I,t[38]=L,t[39]=R):R=t[39];let z;t[40]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,Z.jsxs)(`a`,{href:zF,target:`_blank`,rel:`noopener noreferrer`,onClick:HF,onAuxClick:VF,className:`mt-2 flex items-center gap-1.5 self-start text-xs text-muted-foreground transition-colors hover:text-primary`,children:[(0,Z.jsx)(ft,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,Z.jsx)(J,{id:`aByJ8j`})]}),t[40]=z):z=t[40];let B;t[41]!==E||t[42]!==O||t[43]!==F||t[44]!==R?(B=(0,Z.jsxs)(Ut,{align:`end`,className:E,"data-testid":`share-button-popover`,children:[D,O,F,R,z]}),t[41]=E,t[42]=O,t[43]=F,t[44]=R,t[45]=B):B=t[45];let V;return t[46]!==w||t[47]!==B||t[48]!==v?(V=(0,Z.jsxs)(Ne,{open:v,onOpenChange:y,children:[w,B]}),t[46]=w,t[47]=B,t[48]=v,t[49]=V):V=t[49],V}function VF(e){return hu(e,zF)}function HF(e){return hu(e,zF)}function UF(e){return e.currentTarget.select()}function WF(e){return e.currentTarget.select()}function GF(e){return e.currentTarget.select()}function KF(e){return console.log(e)}function qF(e){e!==`Link ready but could not copy to clipboard.`&&bs.error(e)}function JF(e){return bs.success(e)}function YF(e){let t=(0,$.c)(35),{onSignIn:n,onSetIdentity:r,onOpenSearch:i}=e,{_:a}=an(),{activeDocName:o,activeTarget:s}=vt(),c=o?Or(o):null,{state:l,isDraggingRail:u}=Vj(),d=pg(),f;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(f=Nl(`toggle-files-sidebar`),t[0]=f):f=t[0];let p=f,m=Nl(`command-palette`),[h,g]=(0,Q.useState)(!1),_;bb0:{if(s?.kind===`folder`){let e;t[1]===s.folderPath?e=t[2]:(e=Na(s.folderPath),t[1]=s.folderPath,t[2]=e),_=e;break bb0}if(o&&!c){let e;t[3]===o?e=t[4]:(e=Va(o),t[3]=o,t[4]=e),_=e;break bb0}if(!s&&!o){let e;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(e=Na(``),t[5]=e):e=t[5],_=e;break bb0}_=null}let v=_,y=typeof window<`u`&&window.okDesktop!=null,b=l===`collapsed`,x=y?``:void 0,S=y&&b&&`pl-[var(--ok-titlebar-reserve-left,1rem)]`,C=y&&!u&&`motion-safe:transition-[padding] motion-safe:duration-200 motion-safe:ease-linear`,w;t[6]!==S||t[7]!==C?(w=Y(`flex h-12 shrink-0 items-center bg-muted/35 shadow-[inset_0_-1px_0_var(--border)]`,y&&`[-webkit-app-region:drag]`,S,C),t[6]=S,t[7]=C,t[8]=w):w=t[8];let T=!d&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(Ns,{children:[(0,Z.jsx)(As,{asChild:!0,children:(0,Z.jsx)(Kj,{className:Y(`-ml-1 shrink-0 text-muted-foreground`,y&&`[-webkit-app-region:no-drag]`)})}),(0,Z.jsx)(js,{children:l===`expanded`?(0,Z.jsx)(J,{id:`ZxXhLY`,values:{sidebarShortcut:p}}):(0,Z.jsx)(J,{id:`Zz25kq`,values:{sidebarShortcut:p}})})]}),b&&i&&(0,Z.jsxs)(Ns,{children:[(0,Z.jsx)(As,{asChild:!0,children:(0,Z.jsx)(X,{variant:`ghost`,size:`icon-sm`,onClick:i,"aria-label":a({id:`IN4UX8`,values:{searchShortcut:m}}),"data-telemetry-event":`ok.editor_header.search.click`,className:Y(`shrink-0 text-muted-foreground`,y&&`[-webkit-app-region:no-drag]`),children:(0,Z.jsx)(O,{"aria-hidden":`true`})})}),(0,Z.jsx)(js,{children:(0,Z.jsx)(J,{id:`IN4UX8`,values:{searchShortcut:m}})})]}),(0,Z.jsx)($a,{orientation:`vertical`,className:`mr-1 h-4 shrink-0 data-vertical:self-center`}),(0,Z.jsx)(ZP,{})]}),E;t[9]===T?E=t[10]:(E=(0,Z.jsx)(`div`,{className:`flex min-w-0 flex-1 items-center gap-1 px-3`,children:T}),t[9]=T,t[10]=E);let D;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(D=Y(`flex shrink-0 items-center justify-end gap-2 px-3`,y&&`[&>*]:[-webkit-app-region:no-drag]`),t[11]=D):D=t[11];let k;t[12]!==h||t[13]!==g||t[14]!==v||t[15]!==d?(k=!d&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(BF,{input:v,onClickWhenNoRemote:()=>g(!0)}),(0,Z.jsx)(Co,{open:h,onOpenChange:g})]}),t[12]=h,t[13]=g,t[14]=v,t[15]=d,t[16]=k):k=t[16];let A;t[17]!==r||t[18]!==n?(A=(0,Z.jsx)(eo,{onSignIn:n,onSetIdentity:r}),t[17]=r,t[18]=n,t[19]=A):A=t[19];let j,M,N;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,Z.jsx)(HN,{}),M=(0,Z.jsx)($a,{orientation:`vertical`,className:`h-4 shrink-0 data-vertical:self-center`}),N=(0,Z.jsx)(GN,{}),t[20]=j,t[21]=M,t[22]=N):(j=t[20],M=t[21],N=t[22]);let P;t[23]===d?P=t[24]:(P=!d&&(0,Z.jsx)(RF,{}),t[23]=d,t[24]=P);let F;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,Z.jsx)(FF,{}),t[25]=F):F=t[25];let I;t[26]!==k||t[27]!==A||t[28]!==P?(I=(0,Z.jsxs)(`div`,{className:D,children:[k,A,j,M,N,P,F]}),t[26]=k,t[27]=A,t[28]=P,t[29]=I):I=t[29];let L;return t[30]!==I||t[31]!==x||t[32]!==w||t[33]!==E?(L=(0,Z.jsxs)(`header`,{"data-electron-drag":x,className:w,children:[E,I]}),t[30]=I,t[31]=x,t[32]=w,t[33]=E,t[34]=L):L=t[34],L}var XF=`open-knowledge:terminal-launch`;function ZF(e,t,n=typeof window>`u`?new EventTarget:window){n.dispatchEvent(new CustomEvent(XF,{detail:{prompt:e,cli:t}}))}function QF(e,t=typeof window>`u`?new EventTarget:window){let n=t=>{let n=t instanceof CustomEvent?t.detail:void 0;n&&typeof n.prompt==`string`&&e(n.prompt,n.cli)};return t.addEventListener(XF,n),()=>t.removeEventListener(XF,n)}function $F(e){let t=(0,$.c)(10),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?`horizontal`:i,o;t[4]===n?o=t[5]:(o=Y(`group/tabs flex gap-2 data-horizontal:flex-col`,n),t[4]=n,t[5]=o);let s;return t[6]!==a||t[7]!==r||t[8]!==o?(s=(0,Z.jsx)(nm,{"data-slot":`tabs`,"data-orientation":a,className:o,...r}),t[6]=a,t[7]=r,t[8]=o,t[9]=s):s=t[9],s}var eI=Si(`group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-horizontal/tabs:h-8 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col data-[variant=line]:rounded-none`,{variants:{variant:{default:`bg-muted`,line:`gap-1 bg-transparent`}},defaultVariants:{variant:`default`}});function tI(e){let t=(0,$.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,variant:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?`default`:i,o;t[4]!==n||t[5]!==a?(o=Y(eI({variant:a}),n),t[4]=n,t[5]=a,t[6]=o):o=t[6];let s;return t[7]!==r||t[8]!==o||t[9]!==a?(s=(0,Z.jsx)(rm,{"data-slot":`tabs-list`,"data-variant":a,className:o,...r}),t[7]=r,t[8]=o,t[9]=a,t[10]=s):s=t[10],s}function nI(e){let t=(0,$.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=Y(`relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1 dark:text-muted-foreground dark:hover:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,`group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent`,`data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground`,`after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(im,{"data-slot":`tabs-trigger`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function rI(e){let t=(0,$.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=Y(`flex-1 text-sm outline-none`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(am,{"data-slot":`tabs-content`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var iI=(0,Q.lazy)(()=>n(()=>import(`./TerminalPanel-Cfp4xEGm.js`).then(e=>({default:e.TerminalPanel})),__vite__mapDeps([91,1,10,3,11,6,7,13,56,16,37,92,65,32,33,93]),import.meta.url));function aI(e){let t=(0,$.c)(14),{bridge:n,onClose:r,onTitleChange:i,launch:a,adoptPtyId:o,onPtyId:s}=e,c=a===void 0?null:a,l=o===void 0?null:o,{enabled:u,synced:d}=So(),f=wo(),{_:p}=an(),m=d&&u===!1,h;t[0]!==p||t[1]!==f?(h=function(){if(f===null){bs.error(p({id:`V_6bJ4`}));return}let e=f(!0);e.ok||bs.error(p({id:`jKd3AP`,values:{0:e.error}}))},t[0]=p,t[1]=f,t[2]=h):h=t[2];let _=h;if(d&&!m){let e;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(`div`,{className:`h-full w-full bg-background`,"aria-hidden":`true`}),t[3]=e):e=t[3];let a;return t[4]!==l||t[5]!==n||t[6]!==c||t[7]!==r||t[8]!==s||t[9]!==i?(a=(0,Z.jsx)(g,{fallbackRender:sI,onError:oI,children:(0,Z.jsx)(Q.Suspense,{fallback:e,children:(0,Z.jsx)(iI,{bridge:n,className:`h-full`,onClose:r,onTitleChange:i,launch:c,adoptPtyId:l,onPtyId:s})})}),t[4]=l,t[5]=n,t[6]=c,t[7]=r,t[8]=s,t[9]=i,t[10]=a):a=t[10],a}let v;return t[11]!==_||t[12]!==m?(v=m?(0,Z.jsx)(uI,{onEnable:_}):(0,Z.jsx)(`div`,{className:`h-full w-full bg-background`,"aria-hidden":`true`}),t[11]=_,t[12]=m,t[13]=v):v=t[13],v}function oI(e,t){console.error(`[TerminalGate] rendered fallback for the terminal panel`,e,t.componentStack)}function sI(e){return(0,Z.jsx)(cI,{...e})}function cI(e){let t=(0,$.c)(15),{error:n}=e,{_:r}=an(),i;t[0]!==r||t[1]!==n?(i=n instanceof Error&&/dynamically imported module|Failed to fetch/i.test(n.message)?r({id:`Y8ViJx`}):r({id:`fbsiBw`}),t[0]=r,t[1]=n,t[2]=i):i=t[2];let a=i,o;t[3]===r?o=t[4]:(o=r({id:`6MnZEC`}),t[3]=r,t[4]=o);let s;t[5]===a?s=t[6]:(s=(0,Z.jsx)(`p`,{className:`max-w-sm text-sm text-foreground`,children:a}),t[5]=a,t[6]=s);let c;t[7]===r?c=t[8]:(c=r({id:`HpK_8d`}),t[7]=r,t[8]=c);let l;t[9]===c?l=t[10]:(l=(0,Z.jsx)(X,{onClick:lI,children:c}),t[9]=c,t[10]=l);let u;return t[11]!==o||t[12]!==s||t[13]!==l?(u=(0,Z.jsxs)(`section`,{"aria-label":o,className:`flex h-full w-full flex-col items-center justify-center gap-3 bg-background p-6 text-center`,role:`alert`,children:[s,l]}),t[11]=o,t[12]=s,t[13]=l,t[14]=u):u=t[14],u}function lI(){return window.location.reload()}function uI(e){let t=(0,$.c)(20),{onEnable:n}=e,{_:r}=an(),i;t[0]===r?i=t[1]:(i=r({id:`_XWY2J`}),t[0]=r,t[1]=i);let a;t[2]===r?a=t[3]:(a=r({id:`oYepHb`}),t[2]=r,t[3]=a);let o;t[4]===a?o=t[5]:(o=(0,Z.jsx)(`p`,{className:`max-w-sm text-sm text-foreground`,children:a}),t[4]=a,t[5]=o);let s;t[6]===r?s=t[7]:(s=r({id:`v2ZW0K`}),t[6]=r,t[7]=s);let c;t[8]!==n||t[9]!==s?(c=(0,Z.jsx)(X,{onClick:n,children:s}),t[8]=n,t[9]=s,t[10]=c):c=t[10];let l;t[11]===r?l=t[12]:(l=r({id:`ICoNYz`}),t[11]=r,t[12]=l);let u;t[13]===l?u=t[14]:(u=(0,Z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:l}),t[13]=l,t[14]=u);let d;return t[15]!==i||t[16]!==o||t[17]!==c||t[18]!==u?(d=(0,Z.jsxs)(`section`,{"aria-label":i,className:`flex h-full w-full flex-col items-center justify-center gap-3 bg-background p-6 text-center`,children:[o,c,u]}),t[15]=i,t[16]=o,t[17]=c,t[18]=u,t[19]=d):d=t[19],d}function dI(e){let t=(0,$.c)(48),{selected:n,onLaunchSelected:r,onPickCli:i,onPickTerminal:a,className:o}=e,{_:s}=an(),c=n===`terminal`,l;t[0]!==s||t[1]!==c||t[2]!==n?(l=s(c?{id:`AB4qw9`}:{id:`nP-KFo`,values:{0:mi[n].displayName}}),t[0]=s,t[1]=c,t[2]=n,t[3]=l):l=t[3];let u=l,d;t[4]===o?d=t[5]:(d=Y(`flex shrink-0 items-center`,o),t[4]=o,t[5]=d);let f;t[6]!==c||t[7]!==n?(f=c?(0,Z.jsx)(Of,{"aria-hidden":`true`,className:`size-3.5`}):(0,Z.jsx)(fa,{id:da(n),className:`size-3.5`,"aria-hidden":`true`}),t[6]=c,t[7]=n,t[8]=f):f=t[8];let p;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Z.jsx)(ge,{"aria-hidden":`true`,className:`size-3`}),t[9]=p):p=t[9];let m;t[10]!==r||t[11]!==u||t[12]!==f?(m=(0,Z.jsx)(As,{asChild:!0,children:(0,Z.jsxs)(X,{type:`button`,variant:`ghost`,size:`xs`,"aria-label":u,"data-testid":`terminal-new-chat`,className:`cursor-pointer gap-0.5 rounded-r-none px-1.5 text-muted-foreground hover:text-foreground`,onClick:r,children:[f,p]})}),t[10]=r,t[11]=u,t[12]=f,t[13]=m):m=t[13];let h;t[14]===u?h=t[15]:(h=(0,Z.jsx)(js,{side:`bottom`,sideOffset:8,children:u}),t[14]=u,t[15]=h);let g;t[16]!==m||t[17]!==h?(g=(0,Z.jsxs)(Ns,{children:[m,h]}),t[16]=m,t[17]=h,t[18]=g):g=t[18];let _;t[19]===s?_=t[20]:(_=s({id:`QJaG-9`}),t[19]=s,t[20]=_);let v;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,Z.jsx)(Yi,{"aria-hidden":`true`,className:`size-3`}),t[21]=v):v=t[21];let y;t[22]===_?y=t[23]:(y=(0,Z.jsx)(bc,{asChild:!0,children:(0,Z.jsx)(X,{type:`button`,variant:`ghost`,size:`icon-xs`,"aria-label":_,"data-testid":`terminal-new-chat-menu`,className:`cursor-pointer rounded-l-none text-muted-foreground hover:text-foreground`,children:v})}),t[22]=_,t[23]=y);let b;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,Z.jsx)(Nc,{children:(0,Z.jsx)(J,{id:`hIQkLb`})}),t[24]=b):b=t[24];let x;t[25]!==s||t[26]!==i||t[27]!==n?(x=Ca.map(e=>{let{displayName:t}=mi[e];return(0,Z.jsxs)(Sc,{onSelect:()=>i(e),"data-testid":`terminal-new-chat-cli-${e}`,"aria-label":s({id:`9mEZeD`,values:{name:t}}),"aria-current":n===e?`true`:void 0,children:[(0,Z.jsx)(fa,{id:da(e),className:`size-4`,"aria-hidden":`true`}),(0,Z.jsx)(`span`,{className:`flex-1`,children:t}),n===e?(0,Z.jsx)(Ji,{"aria-hidden":`true`,className:`size-4 text-muted-foreground`}):null]},e)}),t[25]=s,t[26]=i,t[27]=n,t[28]=x):x=t[28];let S;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,Z.jsx)(Fc,{}),t[29]=S):S=t[29];let C=c?`true`:void 0,w;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,Z.jsx)(Of,{"aria-hidden":`true`,className:`size-4`}),t[30]=w):w=t[30];let T;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,Z.jsx)(`span`,{className:`flex-1`,children:(0,Z.jsx)(J,{id:`ALhMYW`})}),t[31]=T):T=t[31];let E;t[32]===c?E=t[33]:(E=c?(0,Z.jsx)(Ji,{"aria-hidden":`true`,className:`size-4 text-muted-foreground`}):null,t[32]=c,t[33]=E);let D;t[34]!==a||t[35]!==C||t[36]!==E?(D=(0,Z.jsxs)(Sc,{onSelect:a,"data-testid":`terminal-new-chat-terminal`,"aria-current":C,children:[w,T,E]}),t[34]=a,t[35]=C,t[36]=E,t[37]=D):D=t[37];let O;t[38]!==x||t[39]!==D?(O=(0,Z.jsxs)(wc,{align:`start`,className:`min-w-[180px]`,children:[b,x,S,D]}),t[38]=x,t[39]=D,t[40]=O):O=t[40];let k;t[41]!==y||t[42]!==O?(k=(0,Z.jsxs)(Ac,{children:[y,O]}),t[41]=y,t[42]=O,t[43]=k):k=t[43];let A;return t[44]!==d||t[45]!==k||t[46]!==g?(A=(0,Z.jsxs)(`div`,{className:d,children:[g,k]}),t[44]=d,t[45]=k,t[46]=g,t[47]=A):A=t[47],A}function fI(e){let t=(0,$.c)(52),{sessions:n,activeSessionId:r,onSelect:i,onTabActivate:a,newChatSelected:o,onNewChatLaunch:s,onNewChatPickCli:c,onNewChatPickTerminal:l,onClose:u,dockPosition:d,onToggleDock:f,onCollapse:p,children:m,className:h,draggable:g}=e,{_}=an(),v=d===`right`,y;t[0]===h?y=t[1]:(y=Y(`flex min-h-0 min-w-0 flex-1 flex-col`,h),t[0]=h,t[1]=y);let b=g?``:void 0,x=g&&`h-[62px] [-webkit-app-region:drag] pr-[22px] pl-[calc(var(--ok-titlebar-reserve-left,1rem)+0.75rem)]`,S;t[2]===x?S=t[3]:(S=Y(`flex shrink-0 flex-row items-center gap-1 px-1.5 py-1`,x),t[2]=x,t[3]=S);let C;t[4]===_?C=t[5]:(C=_({id:`1MGRQl`}),t[4]=_,t[5]=C);let w;if(t[6]!==_||t[7]!==r||t[8]!==g||t[9]!==u||t[10]!==a||t[11]!==n){let e;t[13]!==_||t[14]!==r||t[15]!==g||t[16]!==u||t[17]!==a?(e=e=>{let t=e.id===r;return(0,Z.jsxs)(`div`,{className:Y(`group flex shrink-0 cursor-default items-center rounded-md pr-0.5 transition-colors`,t?`bg-muted`:`hover:bg-muted/50`),children:[(0,Z.jsxs)(Ns,{children:[(0,Z.jsx)(As,{asChild:!0,children:(0,Z.jsx)(nI,{value:e.id,onClick:()=>a?.(e.id),className:Y(`h-7 flex-none rounded-md px-2 text-xs`,g&&`[-webkit-app-region:no-drag]`),children:(0,Z.jsx)(`span`,{className:`max-w-40 truncate`,children:e.label})})}),(0,Z.jsx)(js,{side:`bottom`,sideOffset:8,children:e.label})]}),(0,Z.jsx)(X,{type:`button`,variant:`ghost`,size:`icon-xs`,"aria-label":_({id:`nzHlj8`,values:{0:e.label}}),tabIndex:t?0:-1,className:Y(`text-muted-foreground opacity-0 transition-opacity hover:text-foreground group-hover:opacity-100 group-focus-within:opacity-100`,t&&`opacity-100`,g&&`[-webkit-app-region:no-drag]`),onClick:t=>{t.stopPropagation(),u(e.id)},children:(0,Z.jsx)(xs,{"aria-hidden":`true`})})]},e.id)},t[13]=_,t[14]=r,t[15]=g,t[16]=u,t[17]=a,t[18]=e):e=t[18],w=n.map(e),t[6]=_,t[7]=r,t[8]=g,t[9]=u,t[10]=a,t[11]=n,t[12]=w}else w=t[12];let T;t[19]!==C||t[20]!==w?(T=(0,Z.jsx)(tI,{variant:`line`,"aria-label":C,className:`flex h-auto min-w-0 items-center justify-start gap-0.5 overflow-x-auto bg-transparent p-0 [scrollbar-width:none] scroll-fade-mask-x`,children:w}),t[19]=C,t[20]=w,t[21]=T):T=t[21];let E=g&&`[-webkit-app-region:no-drag]`,D;t[22]===E?D=t[23]:(D=Y(`shrink-0`,E),t[22]=E,t[23]=D);let O;t[24]!==o||t[25]!==s||t[26]!==c||t[27]!==l||t[28]!==D?(O=(0,Z.jsx)(dI,{selected:o,onLaunchSelected:s,onPickCli:c,onPickTerminal:l,className:D}),t[24]=o,t[25]=s,t[26]=c,t[27]=l,t[28]=D,t[29]=O):O=t[29];let k;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,Z.jsx)(`div`,{className:`flex-1`}),t[30]=k):k=t[30];let A;t[31]!==_||t[32]!==f||t[33]!==v?(A=f==null?null:(0,Z.jsxs)(Ns,{children:[(0,Z.jsx)(As,{asChild:!0,children:(0,Z.jsx)(X,{type:`button`,variant:`ghost`,size:`icon-xs`,"aria-label":_(v?{id:`rf6x3F`}:{id:`QNxpRm`}),className:`shrink-0 cursor-pointer text-muted-foreground hover:text-foreground`,onClick:f,children:v?(0,Z.jsx)(lf,{"aria-hidden":`true`}):(0,Z.jsx)(pf,{"aria-hidden":`true`})})}),(0,Z.jsx)(js,{side:`bottom`,sideOffset:8,children:v?(0,Z.jsx)(J,{id:`rf6x3F`}):(0,Z.jsx)(J,{id:`QNxpRm`})})]}),t[31]=_,t[32]=f,t[33]=v,t[34]=A):A=t[34];let j;t[35]!==_||t[36]!==p||t[37]!==v?(j=p==null?null:(0,Z.jsxs)(Ns,{children:[(0,Z.jsx)(As,{asChild:!0,children:(0,Z.jsx)(X,{type:`button`,variant:`ghost`,size:`icon-xs`,"aria-label":_({id:`VZGGPK`}),className:`shrink-0 cursor-pointer text-muted-foreground hover:text-foreground`,onClick:p,children:v?(0,Z.jsx)(Zi,{"aria-hidden":`true`}):(0,Z.jsx)(Yi,{"aria-hidden":`true`})})}),(0,Z.jsx)(js,{side:`bottom`,sideOffset:8,children:(0,Z.jsx)(J,{id:`VZGGPK`})})]}),t[35]=_,t[36]=p,t[37]=v,t[38]=j):j=t[38];let M;t[39]!==O||t[40]!==A||t[41]!==j||t[42]!==b||t[43]!==S||t[44]!==T?(M=(0,Z.jsxs)(`div`,{"data-electron-drag":b,className:S,children:[T,O,k,A,j]}),t[39]=O,t[40]=A,t[41]=j,t[42]=b,t[43]=S,t[44]=T,t[45]=M):M=t[45];let N;return t[46]!==r||t[47]!==m||t[48]!==i||t[49]!==y||t[50]!==M?(N=(0,Z.jsxs)($F,{value:r,onValueChange:i,className:y,children:[M,m]}),t[46]=r,t[47]=m,t[48]=i,t[49]=y,t[50]=M,t[51]=N):N=t[51],N}function pI(e){return`terminal-session-${e}`}function mI(e){e!==``&&document.querySelector(`[data-terminal-session="${e}"] .xterm-helper-textarea`)?.focus()}function hI(e){let t=(0,$.c)(79),{bridge:n,variant:r,visible:i,onVisibleChange:a,launch:o,installedClis:s,container:c,isShowing:l,onRequestEditorFocus:u,dockPosition:d,onToggleDock:f,onHasSessionsChange:p}=e,m=r===void 0?`dock`:r,h=o===void 0?null:o,{_:g}=an(),[_]=(0,Q.useState)(xI),v,y;t[0]!==c||t[1]!==_?(v=()=>{_==null||c==null||_.parentElement!==c&&c.appendChild(_)},y=[_,c],t[0]=c,t[1]=_,t[2]=v,t[3]=y):(v=t[2],y=t[3]),(0,Q.useLayoutEffect)(v,y);let b=typeof n.terminal?.list==`function`,x;t[4]!==b||t[5]!==h||t[6]!==i?(x=()=>!b&&i?[{id:pI(1),launch:h,title:null,adoptPtyId:null}]:[],t[4]=b,t[5]=h,t[6]=i,t[7]=x):x=t[7];let[S,C]=(0,Q.useState)(x),w;t[8]!==b||t[9]!==i?(w=()=>!b&&i?pI(1):``,t[8]=b,t[9]=i,t[10]=w):w=t[10];let[T,E]=(0,Q.useState)(w),[D,O]=(0,Q.useState)(!b),k=(0,Q.useRef)(!1),A=(0,Q.useRef)(T),j=(0,Q.useRef)(S),M=(0,Q.useRef)(!b&&i?1:0),N=(0,Q.useRef)(i&&h?h.nonce:null),P=(0,Q.useRef)(m===`window`?!1:i),F=(0,Q.useRef)(new Map),I=function(e,t){t===null?F.current.delete(e):F.current.set(e,t)},L=(0,Q.useRef)(0),R;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(R=function(e){M.current+=1;let t=pI(M.current);C(n=>[...n,{id:t,launch:e,title:null,adoptPtyId:null}]),E(t)},t[11]=R):R=t[11];let z=R,[B,V]=(0,Q.useState)(bI),[H,U]=(0,Q.useState)(yI),W;t[12]===s?W=t[13]:(W=s??{},t[12]=s,t[13]=W);let G;t[14]!==B||t[15]!==W?(G=h_(B,W),t[14]=B,t[15]=W,t[16]=G):G=t[16];let K=G,ee=H?`terminal`:K,te;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(te=function(e){L.current+=1,z({prompt:null,cli:e,nonce:L.current})},t[17]=te):te=t[17];let ne=te,re;t[18]!==K||t[19]!==H?(re=function(){H?z(null):ne(K)},t[18]=K,t[19]=H,t[20]=re):re=t[20];let ie=re,ae;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(ae=function(e){U(!1),w_(!1);let t=l_(e);V(t),p_(t),ne(e)},t[21]=ae):ae=t[21];let oe=ae,se;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(se=function(){U(!0),w_(!0),z(null)},t[22]=se):se=t[22];let ce=se,le;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(le=function(e,t){let n=t.trim()===``?null:t.trim();C(t=>t.some(t=>t.id===e&&t.title!==n)?t.map(t=>t.id===e?{...t,title:n}:t):t)},t[23]=le):le=t[23];let q=le,ue=(0,Q.useRef)(z),de;t[24]!==T||t[25]!==u||t[26]!==a?(de=function(e){let t=j.current,n=t.findIndex(t=>t.id===e);if(n===-1)return;let r=t.filter(t=>t.id!==e);if(e===T){let e=(t[n-1]??t[n+1])?.id??``;E(e),e!==``&&queueMicrotask(()=>mI(e))}C(r),r.length===0&&(a(!1),u())},t[24]=T,t[25]=u,t[26]=a,t[27]=de):de=t[27];let fe=de,pe=(0,Q.useRef)(vI),me;t[28]!==T||t[29]!==fe||t[30]!==S?(me=()=>{ue.current=z,A.current=T,j.current=S,pe.current=()=>{T!==``&&fe(T)}},t[28]=T,t[29]=fe,t[30]=S,t[31]=me):me=t[31],(0,Q.useEffect)(me);let he,ge;t[32]!==h||t[33]!==D||t[34]!==S.length||t[35]!==i?(he=()=>{if(!D)return;let e=P.current;if(P.current=i,h!=null&&h.nonce!==N.current){N.current=h.nonce,ue.current(h);return}i&&!e&&S.length===0&&ue.current(null)},ge=[i,h,S.length,D],t[32]=h,t[33]=D,t[34]=S.length,t[35]=i,t[36]=he,t[37]=ge):(he=t[36],ge=t[37]),(0,Q.useEffect)(he,ge);let _e;t[38]===n.terminal?_e=t[39]:(_e=()=>{if(typeof n.terminal?.list!=`function`||k.current)return;k.current=!0;let e=!1;return(async()=>{let t;try{t=await n.terminal.list()??[]}catch(e){console.error(`[terminal] reload session list() failed; cold-starting:`,e),t=[]}if(!e){if(t.length>0){let e=t.map(_I);M.current=e.length,C(e),E(e[0]?.id??``)}O(!0)}})(),()=>{e=!0,k.current=!1}},t[38]=n.terminal,t[39]=_e);let ve;t[40]===n?ve=t[41]:(ve=[n],t[40]=n,t[41]=ve),(0,Q.useEffect)(_e,ve);let ye;t[42]===n?ye=t[43]:(ye=[n],t[42]=n,t[43]=ye),(0,Q.useEffect)(()=>vD(e=>{let t=A.current,r=t===``?void 0:F.current.get(t);r==null?pu():(n.terminal.input(r,e),queueMicrotask(()=>mI(t)))}),ye);let be,xe;t[44]!==n||t[45]!==m?(be=()=>n.onMenuAction(e=>{e===`new-terminal`?ue.current(null):(e===`kill-terminal`||e===`close-active-tab-or-window`&&m===`window`)&&pe.current()}),xe=[n,m],t[44]=n,t[45]=m,t[46]=be,t[47]=xe):(be=t[46],xe=t[47]),(0,Q.useEffect)(be,xe);let Se,Ce;t[48]!==_||t[49]!==m?(Se=()=>{let e=function(e){if(!e.metaKey||e.ctrlKey||e.altKey||e.shiftKey||!/^[1-9]$/.test(e.key)||m!==`window`&&(_==null||!_.contains(document.activeElement)))return;let t=j.current[Number(e.key)-1];t!=null&&(e.preventDefault(),e.stopPropagation(),E(t.id),queueMicrotask(()=>mI(t.id)))};return window.addEventListener(`keydown`,e,{capture:!0}),()=>window.removeEventListener(`keydown`,e,{capture:!0})},Ce=[_,m],t[48]=_,t[49]=m,t[50]=Se,t[51]=Ce):(Se=t[50],Ce=t[51]),(0,Q.useEffect)(Se,Ce);let we;t[52]!==n.editor||t[53]!==S.length?(we=()=>{n.editor.notifyViewMenuStateChanged({terminalLive:S.length>0})},t[52]=n.editor,t[53]=S.length,t[54]=we):we=t[54];let Te;t[55]!==n||t[56]!==S.length?(Te=[n,S.length],t[55]=n,t[56]=S.length,t[57]=Te):Te=t[57],(0,Q.useEffect)(we,Te);let Ee,De;t[58]!==p||t[59]!==S.length?(Ee=()=>{p?.(S.length>0)},De=[p,S.length],t[58]=p,t[59]=S.length,t[60]=Ee,t[61]=De):(Ee=t[60],De=t[61]),(0,Q.useEffect)(Ee,De);let Oe,ke;t[62]!==_||t[63]!==l||t[64]!==u||t[65]!==i?(Oe=()=>{l||i||_==null||!_.contains(document.activeElement)||u()},ke=[l,i,_,u],t[62]=_,t[63]=l,t[64]=u,t[65]=i,t[66]=Oe,t[67]=ke):(Oe=t[66],ke=t[67]),(0,Q.useLayoutEffect)(Oe,ke);let Ae,je;t[68]===l?(Ae=t[69],je=t[70]):(Ae=()=>{l&&mI(A.current)},je=[l],t[68]=l,t[69]=Ae,t[70]=je),(0,Q.useEffect)(Ae,je);let Me;if(t[71]!==g||t[72]!==S){let e;t[74]===g?e=t[75]:(e=(e,t)=>({id:e.id,label:e.title??g({id:`OVjNeX`,values:{0:t+1}})}),t[74]=g,t[75]=e),Me=S.map(e),t[71]=g,t[72]=S,t[73]=Me}else Me=t[73];let Ne=Me,Pe=S.length>0?(0,Z.jsx)(fI,{sessions:Ne,activeSessionId:T,onSelect:E,onTabActivate:gI,newChatSelected:ee,onNewChatLaunch:ie,onNewChatPickCli:oe,onNewChatPickTerminal:ce,onClose:fe,dockPosition:d,onToggleDock:f,onCollapse:m===`window`?void 0:()=>a(!1),draggable:m===`window`,className:`h-full`,children:S.map(e=>(0,Z.jsx)(rI,{value:e.id,forceMount:!0,"data-terminal-session":e.id,className:Y(`m-0 flex min-h-0 flex-1 flex-col overflow-hidden data-[state=inactive]:hidden`,m===`window`&&`px-[22px] pb-[22px]`),children:(0,Z.jsx)(aI,{bridge:n,launch:e.launch,adoptPtyId:e.adoptPtyId,onPtyId:t=>I(e.id,t),onTitleChange:t=>q(e.id,t),onClose:()=>fe(e.id)})},e.id))}):null,Fe;return t[76]!==_||t[77]!==Pe?(Fe=_==null?null:(0,Sd.createPortal)(Pe,_),t[76]=_,t[77]=Pe,t[78]=Fe):Fe=t[78],Fe}function gI(e){return queueMicrotask(()=>mI(e))}function _I(e,t){return{id:pI(t+1),launch:null,title:null,adoptPtyId:e.ptyId}}function vI(){}function yI(){return T_()}function bI(){return f_()}function xI(){if(typeof document>`u`)return null;let e=document.createElement(`div`);return e.className=`flex min-h-0 flex-1 flex-col overflow-hidden`,e}function SI(e){let t=(0,$.c)(74),n;t[0]===e?n=t[1]:(n=e===void 0?{}:e,t[0]=e,t[1]=n);let{onOpenSearch:r}=n,[i,a]=e_(),[o,s]=(0,Q.useState)(i),[c,l]=(0,Q.useState)(!1),[u,d]=(0,Q.useState)(`auth`),[f,p]=(0,Q.useState)(Vv[0].id),[m,h]=(0,Q.useState)(!1),g=typeof window<`u`?window.okDesktop??null:null,_=g!=null&&g.terminal!=null,[v,y]=(0,Q.useState)(!1),b=t_(),[x,S]=(0,Q.useState)(!1),[C,w]=(0,Q.useState)(!1),T=(0,Q.useRef)(!1),[E,D]=(0,Q.useState)(null),[O,k]=(0,Q.useState)(x_),A;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(A=function(e){k(e),b_(e),y(!0)},t[2]=A):A=t[2];let j=A,M;t[3]===O?M=t[4]:(M=function(){j(O===`right`?`bottom`:`right`)},t[3]=O,t[4]=M);let N=M,P;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(P={container:null,isShowing:!1,dockPosition:`bottom`,editorRegion:null},t[5]=P):P=t[5];let[F,I]=(0,Q.useState)(P),L=(0,Q.useRef)(0),R;t[6]===b?R=t[7]:(R=function(e){let t=e??h_(f_(),b);y(!0),L.current+=1,D({prompt:null,cli:t,nonce:L.current})},t[6]=b,t[7]=R);let z=R,B;t[8]!==x||t[9]!==z?(B=function(){y(!0),!x&&!C_()&&z()},t[8]=x,t[9]=z,t[10]=B):B=t[10];let V=B,H=Ni(),{projectConfig:U,projectLocalConfig:W,projectLocalSynced:G,projectSynced:K}=zo(),{activeDocName:ee}=vt(),te=H?.hasRemote,ne=H?.pushPermission?.checkStatus,re;t[11]!==m||t[12]!==U||t[13]!==W||t[14]!==G||t[15]!==K||t[16]!==te||t[17]!==ne?(re=O_({autoSyncOnboardingDismissed:m,hasRemote:te,projectLocalSynced:G,projectSynced:K,projectLocalConfig:W,projectConfig:U,pushPermissionCheckStatus:ne}),t[11]=m,t[12]=U,t[13]=W,t[14]=G,t[15]=K,t[16]=te,t[17]=ne,t[18]=re):re=t[18];let ie=re,ae,oe;t[19]===ee?(ae=t[20],oe=t[21]):(ae=()=>{let e=function(e){let t=e.detail;t&&ee&&au(ee,{kind:`raw-mdx`,detail:t}),s(`source`)};return window.addEventListener(Kg,e),()=>window.removeEventListener(Kg,e)},oe=[ee],t[19]=ee,t[20]=ae,t[21]=oe),(0,Q.useEffect)(ae,oe);let se,ce;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(se=()=>{let e=window.okDesktop;if(e!=null)return e.onMenuAction(e=>{e===`toggle-terminal`?y(TI):e===`new-terminal`&&y(!0)})},ce=[],t[22]=se,t[23]=ce):(se=t[22],ce=t[23]),(0,Q.useEffect)(se,ce);let le,q;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(le=()=>{if(window.okDesktop!=null)return;let e=function(e){Pl(e,`toggle-terminal-panel`)&&(e.preventDefault(),y(wI))};return window.addEventListener(`keydown`,e,{capture:!0}),()=>window.removeEventListener(`keydown`,e,{capture:!0})},q=[],t[24]=le,t[25]=q):(le=t[24],q=t[25]),(0,Q.useEffect)(le,q);let ue,de;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(ue=()=>QF((e,t)=>{y(!0),L.current+=1,D({prompt:e,cli:t,nonce:L.current})}),de=[],t[26]=ue,t[27]=de):(ue=t[26],de=t[27]),(0,Q.useEffect)(ue,de);let fe,pe;t[28]===v?(fe=t[29],pe=t[30]):(fe=()=>{v||D(null)},pe=[v],t[28]=v,t[29]=fe,t[30]=pe),(0,Q.useEffect)(fe,pe);let me,he;t[31]!==C||t[32]!==v?(me=()=>{window.okDesktop!=null&&C&&window.okDesktop.editor.notifyViewMenuStateChanged({terminalVisible:v})},he=[v,C],t[31]=C,t[32]=v,t[33]=me,t[34]=he):(me=t[33],he=t[34]),(0,Q.useEffect)(me,he);let ge,_e;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(ge=()=>{let e=window.okDesktop;if(e==null)return;if(typeof e.terminal?.getDockState!=`function`){w(!0);return}let t=!1;return e.terminal.getDockState().then(e=>{t||!e.visible||(T.current=!0,y(!0))}).catch(CI).finally(()=>{t||w(!0)}),()=>{t=!0}},_e=[],t[35]=ge,t[36]=_e):(ge=t[35],_e=t[36]),(0,Q.useEffect)(ge,_e);let ve,ye;t[37]===v?(ve=t[38],ye=t[39]):(ve=()=>{if(window.okDesktop!=null){if(T.current){T.current=!1;return}v&&Ya()}},ye=[v],t[37]=v,t[38]=ve,t[39]=ye),(0,Q.useEffect)(ve,ye),r_(H?.pausedReason),i_();let be;t[40]===a?be=t[41]:(be=function(e){s(e),a(e)},t[40]=a,t[41]=be);let xe=be,Se,Ce;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(Se=()=>{d(`auth`),l(!0)},Ce=()=>{d(`identity`),l(!0)},t[42]=Se,t[43]=Ce):(Se=t[42],Ce=t[43]);let we;t[44]===r?we=t[45]:(we=(0,Z.jsx)(YF,{onSignIn:Se,onSetIdentity:Ce,onOpenSearch:r}),t[44]=r,t[45]=we);let Te=_?V:void 0,Ee;t[46]!==f||t[47]!==o||t[48]!==xe||t[49]!==Te||t[50]!==O||t[51]!==v?(Ee=(0,Z.jsx)(nN,{editorMode:o,onModeChange:xe,activeTab:f,onActiveTabChange:p,terminalBridge:g,terminalVisible:v,onTerminalVisibleChange:y,terminalDock:O,onTerminalPlacement:I,onRevealTerminal:Te}),t[46]=f,t[47]=o,t[48]=xe,t[49]=Te,t[50]=O,t[51]=v,t[52]=Ee):Ee=t[52];let De;t[53]!==b||t[54]!==O||t[55]!==E||t[56]!==F||t[57]!==v||t[58]!==N?(De=_&&g!=null?(0,Z.jsx)(hI,{bridge:g,visible:v,onVisibleChange:y,launch:E,installedClis:b,container:F.container,isShowing:F.isShowing,onRequestEditorFocus:()=>F.editorRegion?.focus(),dockPosition:O,onToggleDock:N,onHasSessionsChange:S}):null,t[53]=b,t[54]=O,t[55]=E,t[56]=F,t[57]=v,t[58]=N,t[59]=De):De=t[59];let Oe=u===`identity`,ke;t[60]===Symbol.for(`react.memo_cache_sentinel`)?(ke=()=>{l(!1)},t[60]=ke):ke=t[60];let Ae;t[61]!==c||t[62]!==Oe?(Ae=(0,Z.jsx)(qa,{open:c,onOpenChange:l,identityPrompt:Oe,onSuccess:ke}),t[61]=c,t[62]=Oe,t[63]=Ae):Ae=t[63];let je;t[64]===Symbol.for(`react.memo_cache_sentinel`)?(je=()=>h(!0),t[64]=je):je=t[64];let Me;t[65]===ie?Me=t[66]:(Me=(0,Z.jsx)(E_,{open:ie,onResolved:je}),t[65]=ie,t[66]=Me);let Ne;t[67]===Symbol.for(`react.memo_cache_sentinel`)?(Ne=(0,Z.jsx)(Ug,{}),t[67]=Ne):Ne=t[67];let Pe;return t[68]!==we||t[69]!==Ee||t[70]!==De||t[71]!==Ae||t[72]!==Me?(Pe=(0,Z.jsxs)(Z.Fragment,{children:[we,Ee,De,Ae,Me,Ne]}),t[68]=we,t[69]=Ee,t[70]=De,t[71]=Ae,t[72]=Me,t[73]=Pe):Pe=t[73],Pe}function CI(e){console.error(`[terminal] dock-state restore failed; staying hidden:`,e)}function wI(e){return!e}function TI(e){return!e}function EI(e){let t=kl(bl(e));typeof window>`u`||window.location.hash!==t&&(window.location.hash=t)}function DI(){let e=(0,$.c)(11),{conflicts:t,loading:n,error:r}=Ua();if(n)return null;if(r===`server`){let t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Z.jsx)(`section`,{"data-testid":`conflicts-section`,"aria-label":`Conflicted files`,className:`border-b border-amber-200/60 bg-amber-50/40 px-2 py-2 dark:border-amber-900/40 dark:bg-amber-950/20`,children:(0,Z.jsxs)(`p`,{"data-testid":`conflicts-section-error`,className:`px-2 py-1.5 text-[12px] text-amber-700 dark:text-amber-400`,children:[(0,Z.jsx)(ds,{"aria-hidden":`true`,className:`mr-1.5 inline size-3`}),`Couldn't load conflicts — reload to retry.`]})}),e[0]=t):t=e[0],t}if(t.length===0)return null;let i;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsxs)(`span`,{className:`flex items-center gap-1.5 font-mono text-[11px] uppercase tracking-wider text-amber-700 dark:text-amber-400`,children:[(0,Z.jsx)(ds,{"aria-hidden":`true`,className:`size-3`}),`Conflicts`]}),e[1]=i):i=e[1];let a;e[2]===t.length?a=e[3]:(a=(0,Z.jsxs)(`header`,{className:`flex items-center justify-between px-2 pb-1.5`,children:[i,(0,Z.jsx)(`span`,{"data-testid":`conflicts-section-count`,className:`rounded-full bg-amber-500 px-1.5 py-0.5 font-mono text-[10px] font-medium leading-none text-white`,children:t.length})]}),e[2]=t.length,e[3]=a);let o;e[4]===t?o=e[5]:(o=t.map(OI),e[4]=t,e[5]=o);let s;e[6]===o?s=e[7]:(s=(0,Z.jsx)(`ul`,{className:`flex flex-col gap-px`,children:o}),e[6]=o,e[7]=s);let c;return e[8]!==a||e[9]!==s?(c=(0,Z.jsxs)(`section`,{"data-testid":`conflicts-section`,"aria-label":`Conflicted files`,className:`border-b border-amber-200/60 bg-amber-50/40 px-2 py-2 dark:border-amber-900/40 dark:bg-amber-950/20`,children:[a,s]}),e[8]=a,e[9]=s,e[10]=c):c=e[10],c}function OI(e){return(0,Z.jsx)(`li`,{children:(0,Z.jsxs)(X,{variant:`ghost`,size:`sm`,"data-testid":`conflicts-section-row`,"data-file":e.file,title:e.file,className:`h-7 w-full justify-start gap-1.5 px-2 font-normal text-[13px] text-amber-800 hover:bg-amber-100/60 hover:text-amber-900 dark:text-amber-300 dark:hover:bg-amber-900/30 dark:hover:text-amber-200`,onClick:()=>EI(e.file),children:[(0,Z.jsx)(ds,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,Z.jsx)(`span`,{className:`min-w-0 truncate`,children:e.file})]})},e.file)}var kI=`<svg data-icon-sprite aria-hidden="true" width="0" height="0">
|
|
29
|
+
`,r);if(s>-1&&s<t&&(e=s),i&&p<f.length){let t=Math.max(0,m?f[p].toA:f[p].fromA);t<=e&&(e=t,m&&p++,o=!0)}if(e>r){let t=document.createTextNode(l.slice(r,e));if(a){let e=d.appendChild(document.createElement(`span`));e.className=a,e.appendChild(t)}else d.appendChild(t);r=e}o&&(m=!m)}}if(u&&t.toA-t.fromA<=o){let t=u.parser.parse(l),n=0;Vl(t,{style:t=>tu(e,t)},(e,t,r)=>{e>n&&g(n,e,``),g(e,t,r),n=t}),g(n,l.length,``)}else g(0,l.length,``);return d.firstChild||d.appendChild(document.createElement(`br`)),c})});return CA.set(t.changes,i),i}function EA(e,t){let{state:n}=e,r=t??n.selection.main.head,i=e.state.field(Mk).find(e=>e.fromB<=r&&e.endB>=r);if(!i)return!1;let a=e.state.sliceDoc(i.fromB,Math.max(i.fromB,i.toB-1)),o=e.state.field(SA);i.fromB!=i.toB&&i.toA<=o.length&&(a+=e.state.lineBreak);let s=Rl.of({from:i.fromA,to:Math.min(o.length,i.toA),insert:a},o.length);return e.dispatch({effects:xA.of({doc:s.apply(o),changes:s}),userEvent:`accept`}),!0}function DA(e,t){let{state:n}=e,r=t??n.selection.main.head,i=n.field(Mk).find(e=>e.fromB<=r&&e.endB>=r);if(!i)return!1;let a=n.field(SA).sliceString(i.fromA,Math.max(i.fromA,i.toA-1));return i.fromA!=i.toA&&i.toB<=n.doc.length&&(a+=n.lineBreak),e.dispatch({changes:{from:i.fromB,to:Math.min(n.doc.length,i.toB),insert:a},userEvent:`revert`}),!0}function OA(e){let t=new Wl;for(let n of e.field(Mk)){let r=e.facet(kk).overrideChunk&&jA(e,n);t.add(n.fromB,n.fromB,TA(e,n,!!r))}return t.finish()}var kA=Bl.define({create:e=>OA(e),update(e,t){return t.state.field(Mk,!1)==t.startState.field(Mk,!1)?e:OA(t.state)},provide:e=>Yl.decorations.from(e)}),AA=new WeakMap;function jA(e,t){let n=AA.get(t);if(n!==void 0)return n;n=null;let r=e.field(SA),i=e.doc,a=r.lineAt(t.endA).number-r.lineAt(t.fromA).number+1,o=i.lineAt(t.endB).number-i.lineAt(t.fromB).number+1;abort:if(a==o&&a<10){let e=[],i=0,o=t.fromA,s=t.fromB;for(let n of t.changes){if(n.fromA<n.toA){i+=n.toA-n.fromA;let t=r.sliceString(o+n.fromA,o+n.toA);if(/\n/.test(t))break abort;e.push(Ul.widget({widget:new MA(t),side:-1}).range(s+n.fromB))}n.fromB<n.toB&&e.push(Jk.range(s+n.fromB,s+n.toB))}i<t.endA-t.fromA-a*2&&(n=e)}return AA.set(t,n),n}var MA=class extends Il{constructor(e){super(),this.text=e}eq(e){return this.text==e.text}toDOM(e){let t=document.createElement(`del`);return t.className=`cm-deletedText`,t.textContent=this.text,t}},NA=new class extends Xl{constructor(){super(...arguments),this.elementClass=`cm-inlineChangedLineGutter`}},PA=Ul.line({class:`cm-inlineChangedLine`});function FA(e,t,n,r){let i=jA(e,t),a=0;if(!i)return!1;for(let o=e.doc.lineAt(t.fromB);;){for(r&&r.add(o.from,o.from,NA),n.add(o.from,o.from,PA);a<i.length&&i[a].to<=o.to;){let e=i[a++];n.add(e.from,e.to,e.value)}if(o.to>=t.endB)break;o=e.doc.lineAt(o.to+1)}return!0}var IA=q({settings:{background:`var(--background)`,gutterBackground:`var(--muted)`}}),LA=D({settings:{background:`var(--background)`,gutterBackground:`var(--muted)`}}),RA=Yl.theme({".cm-deletedChunk .cm-chunkButtons":{display:`flex`,gap:`0.25rem`},".cm-deletedChunk .cm-chunkButtons button[data-slot='button']":{margin:`0`,border:`1px solid transparent`,borderRadius:`min(var(--radius-md), 10px)`,color:`var(--primary-foreground)`},".cm-deletedChunk .cm-chunkButtons button[data-slot='button'][data-variant='destructive']":{color:`var(--destructive)`}});function zA({addControl:e,nextId:t,removeControl:n,root:r}){return(i,a)=>{let o=document.createElement(`span`);o.className=`inline-flex`;let s=t();return e({id:s,host:o,type:i,action:a}),queueMicrotask(()=>{r.contains(o)||n(s)}),o}}function BA(e){let t=(0,$.c)(33),{oldContent:n,newContent:r,layout:i,conflictMode:a,previewMode:o,oursOverride:s,onResolve:c,onAbort:l}=e,{_:u}=an(),d=s??r,f=(0,Q.useRef)(null),p=(0,Q.useRef)(null),m=(0,Q.useRef)(0),{resolvedTheme:h}=Ln(),g=(0,Q.useRef)(c),_=(0,Q.useRef)(l),[v,y]=(0,Q.useState)(null),b;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(b=[],t[0]=b):b=t[0];let[x,S]=(0,Q.useState)(b),C=JO(a===!0),w;t[1]!==l||t[2]!==c?(w=()=>{g.current=c,_.current=l},t[1]=l,t[2]=c,t[3]=w):w=t[3],(0,Q.useEffect)(w);let T,E;t[4]!==a||t[5]!==d||t[6]!==i||t[7]!==n||t[8]!==o||t[9]!==h?(T=()=>{let e=f.current;if(!e)return;S([]);let t=new Map,r=!1,s=e=>{r||!t.delete(e)||S(t=>t.filter(t=>t.id!==e))},c=new MutationObserver(()=>{for(let[n,r]of t)e.contains(r)||s(n)});c.observe(e,{childList:!0,subtree:!0});let l=h===`dark`?IA:LA,u=[Yl.editable.of(!1),zl.readOnly.of(!0)],g=[mu,nu(),...u,l,Yl.lineWrapping];if(p.current&&=(p.current.destroy(),null),o)p.current=new Yl({doc:d,extensions:g,parent:e}),y(null);else if(a){let i=zA({addControl:e=>{r||(t.set(e.id,e.host),S(t=>[...t,e]))},nextId:()=>(m.current+=1,m.current),removeControl:s,root:e}),a=new Yl({doc:d,extensions:[mu,nu(),Yl.editable.of(!1),l,RA,Yl.lineWrapping,bA({original:n,highlightChanges:!0,gutter:!0,mergeControls:i,collapseUnchanged:{margin:3,minSize:4}}),Yl.updateListener.of(e=>{let t=Nk(e.state);y(t?t.chunks.length:0)})],parent:e});p.current=a;let o=Nk(a.state);y(o?o.chunks.length:0)}else i===`split`?p.current=new gA({a:{doc:n,extensions:g},b:{doc:d,extensions:g},parent:e,highlightChanges:!0,gutter:!0,collapseUnchanged:{margin:3,minSize:4}}):p.current=new Yl({doc:d,extensions:[...g,bA({original:n,highlightChanges:!0,gutter:!0,mergeControls:!1,collapseUnchanged:{margin:3,minSize:4}})],parent:e});return()=>{r=!0,c.disconnect(),p.current&&=(p.current.destroy(),null)}},E=[n,d,i,h,a,o],t[4]=a,t[5]=d,t[6]=i,t[7]=n,t[8]=o,t[9]=h,t[10]=T,t[11]=E):(T=t[10],E=t[11]),(0,Q.useEffect)(T,E);let D;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(D=function(){let e=p.current;!e||!(e instanceof Yl)||g.current?.(e.state.doc.toString())},t[12]=D):D=t[12];let O=D,k;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(k=function(){let e=p.current;!e||!(e instanceof Yl)||xe(e)},t[13]=k):k=t[13];let A=k,j=v===0,M;t[14]!==u||t[15]!==v?(M=v===null?``:v===0?u({id:`lPzyrU`}):Yc._({id:`8FqTCr`,values:{chunksRemaining:v}}),t[14]=u,t[15]=v,t[16]=M):M=t[16];let N=M,P;t[17]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,Z.jsx)(`div`,{ref:f,className:`diff-view min-h-0 flex-1 overflow-y-auto subtle-scrollbar`}),t[17]=P):P=t[17];let F;if(t[18]!==u||t[19]!==x){let e;t[21]===u?e=t[22]:(e=e=>(0,Sd.createPortal)((0,Z.jsx)(X,{type:`button`,variant:e.type===`accept`?`default`:`destructive`,size:`xs`,onClick:t=>{e.action(t.nativeEvent)},children:e.type===`accept`?u({id:`g3UF2V`}):u({id:`1t_NnN`})}),e.host,e.id),t[21]=u,t[22]=e),F=x.map(e),t[18]=u,t[19]=x,t[20]=F}else F=t[20];let I;t[23]!==j||t[24]!==C||t[25]!==a||t[26]!==N||t[27]!==l||t[28]!==c?(I=a&&(0,Z.jsxs)(`div`,{ref:C,className:`flex items-center justify-between gap-2 px-3 py-2 border-t shrink-0`,children:[(0,Z.jsx)(`span`,{className:`text-xs ${j?`text-emerald-600 dark:text-emerald-400`:`text-muted-foreground`}`,children:N}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[l&&(0,Z.jsx)(X,{className:`uppercase font-mono`,variant:`ghost`,size:`sm`,onClick:l,children:(0,Z.jsx)(J,{id:`XyOUTJ`})}),(0,Z.jsx)(X,{className:`uppercase font-mono`,variant:`outline`,size:`sm`,onClick:A,children:`Undo`}),c&&(0,Z.jsx)(X,{variant:`default`,size:`sm`,disabled:!j,onClick:O,children:(0,Z.jsx)(J,{id:`Lcehxn`})})]})]}),t[23]=j,t[24]=C,t[25]=a,t[26]=N,t[27]=l,t[28]=c,t[29]=I):I=t[29];let L;return t[30]!==I||t[31]!==F?(L=(0,Z.jsxs)(`div`,{className:`flex flex-col h-full`,children:[P,F,I]}),t[30]=I,t[31]=F,t[32]=L):L=t[32],L}async function VA(e,t,n){try{let r={file:e,strategy:t};n!==void 0&&(r.content=n);let i=await fetch(`/api/sync/resolve-conflict`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(r)});if(i.ok)return{ok:!0};let a;try{let e=await i.json();typeof e.detail==`string`?a=e.detail:typeof e.title==`string`&&(a=e.title)}catch{}return{ok:!1,detail:a}}catch(n){let r=n instanceof Error?n.message:String(n);return console.warn(JSON.stringify({event:`conflict-resolve-dispatch-failed`,file:e,strategy:t,detail:r})),{ok:!1,detail:r}}}async function HA(e,t){return VA(e,`content`,t)}async function UA(e){return VA(e,`mine`)}async function WA(e){return VA(e,`theirs`)}async function GA(e){return VA(e,`delete`)}async function KA(e){try{let t=await fetch(`/api/sync/conflict-content?file=${encodeURIComponent(e)}&source=ytext`);if(!t.ok){let n;try{let e=await t.json();typeof e.detail==`string`?n=e.detail:typeof e.title==`string`&&(n=e.title)}catch{}return console.warn(JSON.stringify({event:`conflict-content-fetch-failed`,file:e,status:t.status,detail:n})),null}let n=await t.json(),r=n.kind===`delete-modify`||n.kind===`modify-delete`||n.kind===`both-modified`?n.kind:`both-modified`;return n.kind!==r&&console.warn(JSON.stringify({event:`conflict-kind-missing-fallback`,file:e,receivedKind:n.kind??null})),{base:n.base??``,ours:n.ours??``,theirs:n.theirs??``,kind:r}}catch(t){return console.warn(JSON.stringify({event:`conflict-content-fetch-failed`,file:e,status:null,detail:t instanceof Error?t.message:String(t)})),null}}function qA(e){let t=(0,$.c)(86),{docName:n}=e,{_:r}=an(),{conflicts:i,loading:a}=Ua(),o;if(t[0]!==i||t[1]!==n){let e;t[3]===n?e=t[4]:(e=e=>bl(e.file)===n,t[3]=n,t[4]=e),o=i.find(e),t[0]=i,t[1]=n,t[2]=o}else o=t[2];let s=o,c=s?.file??`${n}.md`,[l,u]=(0,Q.useState)(null),[d,f]=(0,Q.useState)(!1),[p,m]=(0,Q.useState)(!1),h=JO(l?.kind===`delete-modify`||l?.kind===`modify-delete`),g,_;t[5]===n?(g=t[6],_=t[7]):(g=()=>(console.warn(JSON.stringify({event:`editor-area-swap-to-diffview`,"doc.name":n})),()=>{console.warn(JSON.stringify({event:`editor-area-swap-from-diffview`,"doc.name":n}))}),_=[n],t[5]=n,t[6]=g,t[7]=_),(0,Q.useEffect)(g,_);let v=a||s===void 0,y,b;t[8]!==v||t[9]!==c?(y=()=>{if(v)return;let e=!1;return u(null),f(!1),KA(c).then(t=>{e||(t===null?f(!0):u(t))}),()=>{e=!0}},b=[c,v],t[8]=v,t[9]=c,t[10]=y,t[11]=b):(y=t[10],b=t[11]),(0,Q.useEffect)(y,b);let x;t[12]!==r||t[13]!==c?(x=async function(e){let t=await HA(c,e);t.ok||bs.error(r({id:`K-h9cT`,values:{filePath:c}}),{description:t.detail})},t[12]=r,t[13]=c,t[14]=x):x=t[14];let S=x,C;t[15]!==r||t[16]!==c?(C=async function(e){m(!0);let t=await e(c);t.ok||(m(!1),bs.error(r({id:`jPUPvG`,values:{filePath:c}}),{description:t.detail}))},t[15]=r,t[16]=c,t[17]=C):C=t[17];let w=C;if(d){let e;return t[18]===c?e=t[19]:(e=(0,Z.jsx)(`div`,{className:`flex h-full items-center justify-center p-6 text-sm text-muted-foreground`,children:(0,Z.jsx)(J,{id:`ajz9F8`,values:{filePath:c}})}),t[18]=c,t[19]=e),e}if(l===null){let e;return t[20]===c?e=t[21]:(e=(0,Z.jsx)(`div`,{className:`flex h-full items-center justify-center p-6 text-sm text-muted-foreground`,children:(0,Z.jsx)(J,{id:`DF1MtZ`,values:{filePath:c}})}),t[20]=c,t[21]=e),e}if(l.kind===`delete-modify`){let e;t[22]===l.theirs?e=t[23]:(e=(0,Z.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,Z.jsx)(BA,{oldContent:``,newContent:l.theirs,layout:`unified`,previewMode:!0})}),t[22]=l.theirs,t[23]=e);let n;t[24]===c?n=t[25]:(n={filePath:c},t[24]=c,t[25]=n);let r;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(r={0:(0,Z.jsx)(`span`,{className:`font-medium text-foreground`})},t[26]=r):r=t[26];let i;t[27]===n?i=t[28]:(i=(0,Z.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,Z.jsx)(J,{id:`V48OUT`,values:n,components:r})}),t[27]=n,t[28]=i);let a;t[29]===w?a=t[30]:(a=()=>void w(GA),t[29]=w,t[30]=a);let o;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Z.jsx)(J,{id:`Vlc75q`}),t[31]=o):o=t[31];let s;t[32]!==p||t[33]!==a?(s=(0,Z.jsx)(X,{type:`button`,variant:`destructive`,disabled:p,onClick:a,children:o}),t[32]=p,t[33]=a,t[34]=s):s=t[34];let u;t[35]===w?u=t[36]:(u=()=>void w(WA),t[35]=w,t[36]=u);let d;t[37]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Z.jsx)(J,{id:`3mFsc3`}),t[37]=d):d=t[37];let f;t[38]!==p||t[39]!==u?(f=(0,Z.jsx)(X,{type:`button`,variant:`default`,disabled:p,onClick:u,children:d}),t[38]=p,t[39]=u,t[40]=f):f=t[40];let m;t[41]!==s||t[42]!==f?(m=(0,Z.jsxs)(`div`,{className:`flex shrink-0 gap-3`,children:[s,f]}),t[41]=s,t[42]=f,t[43]=m):m=t[43];let g;t[44]!==h||t[45]!==i||t[46]!==m?(g=(0,Z.jsxs)(`div`,{ref:h,className:`flex flex-shrink-0 flex-wrap items-center justify-between gap-x-6 gap-y-3 border-t px-6 py-4`,children:[i,m]}),t[44]=h,t[45]=i,t[46]=m,t[47]=g):g=t[47];let _;return t[48]!==g||t[49]!==e?(_=(0,Z.jsxs)(`div`,{className:`flex h-full flex-col bg-background`,children:[e,g]}),t[48]=g,t[49]=e,t[50]=_):_=t[50],_}if(l.kind===`modify-delete`){let e;t[51]===l.ours?e=t[52]:(e=(0,Z.jsx)(`div`,{className:`min-h-0 flex-1`,children:(0,Z.jsx)(BA,{oldContent:``,newContent:l.ours,layout:`unified`,previewMode:!0})}),t[51]=l.ours,t[52]=e);let n;t[53]===c?n=t[54]:(n={filePath:c},t[53]=c,t[54]=n);let r;t[55]===Symbol.for(`react.memo_cache_sentinel`)?(r={0:(0,Z.jsx)(`span`,{className:`font-medium text-foreground`})},t[55]=r):r=t[55];let i;t[56]===n?i=t[57]:(i=(0,Z.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,Z.jsx)(J,{id:`EhDLBx`,values:n,components:r})}),t[56]=n,t[57]=i);let a;t[58]===w?a=t[59]:(a=()=>void w(UA),t[58]=w,t[59]=a);let o;t[60]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Z.jsx)(J,{id:`0NA4b3`}),t[60]=o):o=t[60];let s;t[61]!==p||t[62]!==a?(s=(0,Z.jsx)(X,{type:`button`,variant:`default`,disabled:p,onClick:a,children:o}),t[61]=p,t[62]=a,t[63]=s):s=t[63];let u;t[64]===w?u=t[65]:(u=()=>void w(GA),t[64]=w,t[65]=u);let d;t[66]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Z.jsx)(J,{id:`qSxaOz`}),t[66]=d):d=t[66];let f;t[67]!==p||t[68]!==u?(f=(0,Z.jsx)(X,{type:`button`,variant:`destructive`,disabled:p,onClick:u,children:d}),t[67]=p,t[68]=u,t[69]=f):f=t[69];let m;t[70]!==s||t[71]!==f?(m=(0,Z.jsxs)(`div`,{className:`flex shrink-0 gap-3`,children:[s,f]}),t[70]=s,t[71]=f,t[72]=m):m=t[72];let g;t[73]!==h||t[74]!==i||t[75]!==m?(g=(0,Z.jsxs)(`div`,{ref:h,className:`flex flex-shrink-0 flex-wrap items-center justify-between gap-x-6 gap-y-3 border-t px-6 py-4`,children:[i,m]}),t[73]=h,t[74]=i,t[75]=m,t[76]=g):g=t[76];let _;return t[77]!==g||t[78]!==e?(_=(0,Z.jsxs)(`div`,{className:`flex h-full flex-col bg-background`,children:[e,g]}),t[77]=g,t[78]=e,t[79]=_):_=t[79],_}let T;t[80]===S?T=t[81]:(T=e=>void S(e),t[80]=S,t[81]=T);let E;return t[82]!==l.ours||t[83]!==l.theirs||t[84]!==T?(E=(0,Z.jsx)(BA,{oldContent:l.theirs,newContent:l.ours,layout:`unified`,conflictMode:!0,onResolve:T}),t[82]=l.ours,t[83]=l.theirs,t[84]=T,t[85]=E):E=t[85],E}function JA(e){let t=(0,$.c)(2),{docName:n,provider:r,children:i}=e;(0,Q.use)(Ht(n,r));let a;return t[0]===i?a=t[1]:(a=(0,Z.jsx)(Z.Fragment,{children:i}),t[0]=i,t[1]=a),a}var YA=`__back-nav__`;function XA(e){return e instanceof Me||e instanceof St||e instanceof Ee||e instanceof et||e instanceof Ft||e instanceof ae?e.docName:null}function ZA(e){return e instanceof Me||e instanceof St}function QA(e){if(e instanceof Me){let t=e.docName;return{title:Yc._({id:`Jejur6`}),summary:Yc._({id:`jSY41h`,values:{docName:t}})}}if(e instanceof St){let t=e.docName;return{title:Yc._({id:`V7QxyT`}),summary:Yc._({id:`xG4tb6`,values:{docName:t}})}}if(e instanceof Ee){let t=e.docName;return{title:Yc._({id:`1di5fu`}),summary:Yc._({id:`PQCdtv`,values:{docName:t}})}}if(e instanceof et){let t=e.docName;return{title:Yc._({id:`wvbc1r`}),summary:Yc._({id:`IX7-sq`,values:{docName:t}})}}if(e instanceof Ft)return{title:Yc._({id:`Gfr4fu`}),summary:Yc._({id:`UW2Fg3`})};if(e instanceof ae){let t=e.docName;return{title:Yc._({id:`vv7kpg`}),summary:Yc._({id:`mdKFEy`,values:{docName:t}})}}let t=e instanceof Error&&e.message?e.message:Yc._({id:`W5A0Ly`});return{title:Yc._({id:`29VNqC`}),summary:t}}function $A(e){let t=(0,$.c)(31),{error:n,resetErrorBoundary:r,activeDocName:i,previousDocName:a,onNavigateBack:o}=e,s;t[0]===n?s=t[1]:(s=QA(n),t[0]=n,t[1]=s);let{title:c,summary:l}=s,u=!!a&&!!o,d=(0,Q.useRef)(null),f=typeof window<`u`?window.okDesktop:void 0,p=f&&ZA(n)?f:null,m,h;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(m=()=>{d.current?.focus()},h=[],t[2]=m,t[3]=h):(m=t[2],h=t[3]),(0,Q.useEffect)(m,h);let g;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,Z.jsx)(CS,{size:80,variant:`sleeping`}),t[4]=g):g=t[4];let _;t[5]===c?_=t[6]:(_=(0,Z.jsx)(`h2`,{id:`document-error-title`,className:`text-2xl font-light tracking-tighter text-balance`,children:c}),t[5]=c,t[6]=_);let v;t[7]===l?v=t[8]:(v=(0,Z.jsx)(`p`,{className:`max-w-sm text-sm text-muted-foreground`,children:l}),t[7]=l,t[8]=v);let y;t[9]!==_||t[10]!==v?(y=(0,Z.jsxs)(`div`,{className:`flex flex-col items-center gap-1`,children:[_,v]}),t[9]=_,t[10]=v,t[11]=y):y=t[11];let b;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,Z.jsx)(J,{id:`KDw4GX`}),t[12]=b):b=t[12];let x;t[13]===r?x=t[14]:(x=(0,Z.jsx)(X,{ref:d,variant:`default`,onClick:r,children:b}),t[13]=r,t[14]=x);let S;t[15]===p?S=t[16]:(S=p?(0,Z.jsx)(X,{variant:`secondary`,onClick:()=>{Fg(p).then(tj).catch(ej)},children:(0,Z.jsx)(J,{id:`uaUc6t`})}):null,t[15]=p,t[16]=S);let C;t[17]!==i||t[18]!==u||t[19]!==n||t[20]!==o||t[21]!==a||t[22]!==r?(C=u?(0,Z.jsx)(X,{variant:`ghost`,className:`font-mono uppercase`,onClick:()=>{!a||!o||(ut(XA(n)??i),o(a),r(YA))},children:(0,Z.jsx)(J,{id:`CKyk7Q`})}):null,t[17]=i,t[18]=u,t[19]=n,t[20]=o,t[21]=a,t[22]=r,t[23]=C):C=t[23];let w;t[24]!==S||t[25]!==C||t[26]!==x?(w=(0,Z.jsxs)(`div`,{className:`mt-1 flex gap-2`,children:[x,S,C]}),t[24]=S,t[25]=C,t[26]=x,t[27]=w):w=t[27];let T;return t[28]!==w||t[29]!==y?(T=(0,Z.jsxs)(`div`,{role:`alert`,"aria-labelledby":`document-error-title`,"data-slot":`document-error-boundary`,className:`flex h-full flex-col items-center justify-center gap-8 p-8 text-center`,children:[g,y,w]}),t[28]=w,t[29]=y,t[30]=T):T=t[30],T}function ej(){}function tj(e){e.ok||bs.error(e.message,{id:`server-restart-error`,duration:1/0})}function nj(e){let t=(0,$.c)(17),{activeDocName:n,previousDocName:r,onNavigateBack:i,onRecycle:a,children:o}=e,s;t[0]!==n||t[1]!==i||t[2]!==r?(s=e=>(0,Z.jsx)($A,{...e,activeDocName:n,previousDocName:r,onNavigateBack:i}),t[0]=n,t[1]=i,t[2]=r,t[3]=s):s=t[3];let c;t[4]===n?c=t[5]:(c=[n],t[4]=n,t[5]=c);let l;t[6]!==n||t[7]!==a?(l=e=>{if(e.reason===`imperative-api`){if(Array.isArray(e.args)&&e.args[0]===YA){console.warn(`[DocumentErrorBoundary] back-nav reset (no recycle)`);return}a(n),console.warn(`[DocumentErrorBoundary] retry recycled ${n}`)}else console.warn(`[DocumentErrorBoundary] reset by key change (${e.prev?.[0]} → ${e.next?.[0]})`)},t[6]=n,t[7]=a,t[8]=l):l=t[8];let u;t[9]===n?u=t[10]:(u=e=>{console.error(`[DocumentErrorBoundary] rendered fallback for ${n}: ${QA(e).title}`,e)},t[9]=n,t[10]=u);let d;return t[11]!==o||t[12]!==s||t[13]!==c||t[14]!==l||t[15]!==u?(d=(0,Z.jsx)(g,{fallbackRender:s,resetKeys:c,onReset:l,onError:u,children:o}),t[11]=o,t[12]=s,t[13]=c,t[14]=l,t[15]=u,t[16]=d):d=t[16],d}function rj(e){let t=e.document.getText(`source`).toString(),{map:n,parseError:r}=Mr(t);return{map:n,keys:Ur(t),parseError:r}}function ij(e){let t=(0,$.c)(21),{provider:n}=e,r;t[0]===n?r=t[1]:(r=()=>rj(n),t[0]=n,t[1]=r);let[i,a]=(0,Q.useState)(r),o,s;t[2]===n?(o=t[3],s=t[4]):(o=()=>{let e=tr(n);a(e.current());let t=e.subscribe(e=>{a(e)});return()=>{t(),e.dispose()}},s=[n],t[2]=n,t[3]=o,t[4]=s),(0,Q.useEffect)(o,s);let c;t[5]===i.map.icon?c=t[6]:(c=Xe(i.map.icon),t[5]=i.map.icon,t[6]=c);let l=c,u;t[7]===i.map.cover?u=t[8]:(u=mt(i.map.cover),t[7]=i.map.cover,t[8]=u);let d=u,f=d.kind===`url`||d.kind===`path`,p=l.kind!==`unsupported`;if(!f&&!p)return null;let m=f?`true`:`false`,h=p?`true`:`false`,g;t[9]!==d||t[10]!==f?(g=f?(0,Z.jsx)(aj,{cover:d}):null,t[9]=d,t[10]=f,t[11]=g):g=t[11];let _;t[12]!==f||t[13]!==p||t[14]!==l?(_=p?(0,Z.jsx)(oj,{icon:l,hasCover:f}):null,t[12]=f,t[13]=p,t[14]=l,t[15]=_):_=t[15];let v;return t[16]!==m||t[17]!==h||t[18]!==g||t[19]!==_?(v=(0,Z.jsxs)(`div`,{className:`page-header editor-content-aligned`,"data-has-cover":m,"data-has-icon":h,"aria-hidden":`true`,"data-testid":`page-header`,children:[g,_]}),t[16]=m,t[17]=h,t[18]=g,t[19]=_,t[20]=v):v=t[20],v}function aj(e){let t=(0,$.c)(2),{cover:n}=e,r;return t[0]===n.value?r=t[1]:(r=(0,Z.jsx)(`div`,{className:`page-header-cover`,"data-testid":`page-header-cover`,children:(0,Z.jsx)(`img`,{src:n.value,alt:``,draggable:!1,loading:`lazy`,referrerPolicy:`no-referrer`,className:`page-header-cover-img`})}),t[0]=n.value,t[1]=r),r}function oj(e){let t=(0,$.c)(9),{icon:n,hasCover:r}=e,i=r?`page-header-icon page-header-icon--with-cover`:`page-header-icon`;if(n.kind===`emoji`){let e;return t[0]!==n.value||t[1]!==i?(e=(0,Z.jsx)(`span`,{className:i,"data-testid":`page-header-icon`,"data-kind":`emoji`,children:n.value}),t[0]=n.value,t[1]=i,t[2]=e):e=t[2],e}let a;t[3]===n.value?a=t[4]:(a=(0,Z.jsx)(`img`,{src:n.value,alt:``,draggable:!1,referrerPolicy:`no-referrer`,className:`page-header-icon-img`}),t[3]=n.value,t[4]=a);let o;return t[5]!==n.kind||t[6]!==i||t[7]!==a?(o=(0,Z.jsx)(`span`,{className:i,"data-testid":`page-header-icon`,"data-kind":n.kind,children:a}),t[5]=n.kind,t[6]=i,t[7]=a,t[8]=o):o=t[8],o}var sj=(0,Q.lazy)(async()=>({default:(await n(async()=>{let{ManagedArtifactProperties:e}=await import(`./ManagedArtifactProperties-70ooWd7O.js`);return{ManagedArtifactProperties:e}},__vite__mapDeps([84,1,41,2,42,43,11,44,45,46,47,48,49,50,51,20,15,13,7,16,10,3,52,53,37,12,6,4,54,17,55,56,19,57,58,59,60,31,32,33,34,35,61,62,63,64,36,65,66,67,73,75,18,85,74,86,87,39,82]),import.meta.url)).ManagedArtifactProperties})),cj=yl(`LARGE_DOC_CHAR_THRESHOLD`,5e5);function lj(e){let t=e.threshold??cj;return e.ytextLength>t?{renderSource:e.isSourceMode||e.visitedSource,renderVisual:!e.isSourceMode||e.visitedVisual,isLarge:!0}:{renderSource:!0,renderVisual:!0,isLarge:!1}}function uj(e){return e.hasEmittedFirstToggle||!e.isLarge?!1:e.renderSource&&e.renderVisual}var dj=yl(`ACTIVITY_MOUNT_LIMIT`,3);function fj(){return n(()=>import(`./SourceEditor-DXcSGXCG.js`),__vite__mapDeps([88,1,41,2,42,43,11,44,45,46,47,48,49,50,51,20,15,13,7,16,10,3,52,53,37,12,6,4,54,17,55,56,19,57,58,59,60,31,32,33,34,35,61,62,63,64,36,65,66,67,89,21,87,83]),import.meta.url)}var pj=(0,Q.lazy)(async()=>({default:(await fj()).SourceEditor}));function mj(e,t,n){if(n<=0)return[];let r=e.filter(e=>!He(e.docName)),i=[...r].sort((e,t)=>t.lastAccessedAt-e.lastAccessedAt).slice(0,n);if(t===null||i.some(e=>e.docName===t))return i;let a=r.find(e=>e.docName===t);return a?[...i.slice(0,n-1),a]:i}function hj(e,t){return t.kind===`idle`?null:t.kind===`failed`&&t.failedDocNames.includes(e)?{kind:`failed`,title:Yc._({id:`MTs6g3`}),summary:t.reason===`clear-data-timeout`?Yc._({id:`Sc1bKE`,values:{docName:e}}):Yc._({id:`ovIGrT`,values:{docName:e}}),actionLabel:Yc._({id:`HpK_8d`})}:t.kind===`recovering`&&t.docNames.includes(e)?{kind:`recovering`,title:Yc._({id:`cF9DyA`}),summary:t.phase===`clearing-local-cache`?Yc._({id:`bmC18N`,values:{docName:e}}):Yc._({id:`pAgkuZ`,values:{docName:e}})}:null}function gj(e){let t=(0,$.c)(2),n;return t[0]===e?n=t[1]:(n=(0,Z.jsx)(vl,{name:`activity-pool`,children:(0,Z.jsx)(_j,{...e})}),t[0]=e,t[1]=n),n}function _j(e){let t=(0,$.c)(15),{activeDocName:n,isSourceMode:r,editorPlaceholder:i,previousDocName:a,onNavigateBack:o,onRecycle:s}=e,{poolEntries:c,serverRestartRecovery:l}=vt(),{pages:u,loading:d}=ea(),f=mj(c,n,dj),p=(0,Q.useRef)(``),m=f.map(vj).join(`,`),h=(0,Q.useRef)(c),g,_;t[0]===c?(g=t[1],_=t[2]):(g=()=>{h.current=c},_=[c],t[0]=c,t[1]=g,t[2]=_),(0,Q.useLayoutEffect)(g,_),(0,Q.useLayoutEffect)(()=>{if(p.current===m)return;let e=p.current?p.current.split(`,`):[],t=m?m.split(`,`):[],r=e.filter(e=>!t.includes(e)),i=t.filter(t=>!e.includes(t));for(let e of r)de(e);for(let e of i){let t=h.current.find(t=>t.docName===e)?.poolEventId;E(e,t&&t.length>0?t:crypto.randomUUID())}_l(`ok/activity/mount-list-change`,{active:n,mounted:t,evicted:r}),p.current=m,B(t)},[m,n]);let v;t[3]!==n||t[4]!==i||t[5]!==r||t[6]!==d||t[7]!==o||t[8]!==s||t[9]!==u||t[10]!==a||t[11]!==l?(v=e=>(0,Z.jsx)(wj,{entry:e,isActive:e.docName===n,isSourceMode:r,editorPlaceholder:i,isNewDoc:!d&&!u.has(e.docName)&&!nr(e.docName),previousDocName:a,onNavigateBack:o,onRecycle:s,serverRestartRecovery:l},e.docName),t[3]=n,t[4]=i,t[5]=r,t[6]=d,t[7]=o,t[8]=s,t[9]=u,t[10]=a,t[11]=l,t[12]=v):v=t[12];let y=f.map(v),b;return t[13]===y?b=t[14]:(b=(0,Z.jsx)(Z.Fragment,{children:y}),t[13]=y,t[14]=b),b}function vj(e){return e.docName}function yj(e){let t=(0,$.c)(8),{isActive:n,initialScrollTop:r,children:i}=e,a=(0,Q.useRef)(null),o=(0,Q.useRef)(r??0),s,c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(s=()=>{let e=a.current;if(!e)return;let t=()=>{e.scrollTop>0&&(o.current=e.scrollTop)};return e.addEventListener(`scroll`,t,{passive:!0}),()=>e.removeEventListener(`scroll`,t)},c=[],t[0]=s,t[1]=c):(s=t[0],c=t[1]),(0,Q.useEffect)(s,c);let l,u;t[2]===n?(l=t[3],u=t[4]):(l=()=>{if(!n)return;let e=a.current;if(!e)return;let t=o.current;if(t===0)return;let r=performance.now(),i=!1;e.scrollTop=t,e.scrollTop===t&&e.scrollHeight>t&&_l(`ok/scroll-restore/phase1-success`,{target:t,elapsedMs:performance.now()-r});let s=!1,c=0,l=()=>{s||(s=!0,cancelAnimationFrame(c),clearTimeout(f),e.removeEventListener(`wheel`,u),e.removeEventListener(`touchstart`,u))},u=()=>l();e.addEventListener(`wheel`,u,{passive:!0}),e.addEventListener(`touchstart`,u,{passive:!0});let d=()=>{s||(e.scrollTop!==t&&e.scrollHeight>t&&(e.scrollTop=t,e.scrollTop===t&&!i&&(_l(`ok/scroll-restore/phase2-success`,{target:t,elapsedMs:performance.now()-r}),i=!0)),c=requestAnimationFrame(d))};c=requestAnimationFrame(d);let f=setTimeout(()=>{s||(e.scrollTop!==t&&e.scrollHeight>t&&_l(`ok/scroll-restore/abandoned`,{target:t,elapsedMs:performance.now()-r,scrollHeight:e.scrollHeight,finalScrollTop:e.scrollTop}),l())},2e3);return l},u=[n],t[2]=n,t[3]=l,t[4]=u),(0,Q.useLayoutEffect)(l,u);let d;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(d={overflowAnchor:`auto`},t[5]=d):d=t[5];let f;return t[6]===i?f=t[7]:(f=(0,Z.jsx)(`div`,{ref:a,"data-testid":`editor-scroll-container`,className:`editor-doc-scroll subtle-scrollbar h-full overflow-y-auto pt-14 scroll-pt-14`,style:d,children:i}),t[6]=i,t[7]=f),f}function bj(e){let t=(0,$.c)(12),{entry:n,isActive:r,isSourceMode:i,editorPlaceholder:a}=e,o=r&&i,[s,c]=(0,Q.useState)(o),l,u;if(t[0]===o?(l=t[1],u=t[2]):(l=()=>{o&&c(!0)},u=[o],t[0]=o,t[1]=l,t[2]=u),(0,Q.useEffect)(l,u),!s&&!o)return null;let d;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Z.jsx)(ix,{}),t[3]=d):d=t[3];let f=n.docName,p;t[4]===n.provider.document?p=t[5]:(p=n.provider.document.getText(`source`),t[4]=n.provider.document,t[5]=p);let m;return t[6]!==a||t[7]!==n.docName||t[8]!==n.provider||t[9]!==o||t[10]!==p?(m=(0,Z.jsx)(Q.Suspense,{fallback:d,children:(0,Z.jsx)(pj,{docName:f,ytext:p,provider:n.provider,placeholder:a,isSourceModeActive:o})}),t[6]=a,t[7]=n.docName,t[8]=n.provider,t[9]=o,t[10]=p,t[11]=m):m=t[11],m}function xj(e){let t=(0,$.c)(18),{view:n}=e,r=n.kind===`failed`,i=r?`alert`:`status`,a=!r,o;t[0]===r?o=t[1]:(o=(0,Z.jsx)(`div`,{className:`flex size-12 items-center justify-center rounded-full border bg-muted text-muted-foreground`,children:r?(0,Z.jsx)(os,{className:`size-5`,"aria-hidden":`true`}):(0,Z.jsx)(is,{className:`size-5 animate-spin`,"aria-hidden":`true`})}),t[0]=r,t[1]=o);let s;t[2]===n.title?s=t[3]:(s=(0,Z.jsx)(`h2`,{className:`text-lg font-medium`,children:n.title}),t[2]=n.title,t[3]=s);let c;t[4]===n.summary?c=t[5]:(c=(0,Z.jsx)(`p`,{className:`max-w-md text-sm text-muted-foreground`,children:n.summary}),t[4]=n.summary,t[5]=c);let l;t[6]!==s||t[7]!==c?(l=(0,Z.jsxs)(`div`,{className:`flex flex-col items-center gap-1`,children:[s,c]}),t[6]=s,t[7]=c,t[8]=l):l=t[8];let u;t[9]!==r||t[10]!==n.actionLabel?(u=r?(0,Z.jsxs)(X,{type:`button`,onClick:Sj,children:[(0,Z.jsx)(os,{className:`size-4`,"aria-hidden":`true`}),n.actionLabel]}):null,t[9]=r,t[10]=n.actionLabel,t[11]=u):u=t[11];let d;return t[12]!==i||t[13]!==a||t[14]!==o||t[15]!==l||t[16]!==u?(d=(0,Z.jsxs)(`div`,{"data-slot":`server-restart-recovery`,role:i,"aria-busy":a,className:`flex h-full flex-col items-center justify-center gap-6 p-8 text-center`,children:[o,l,u]}),t[12]=i,t[13]=a,t[14]=o,t[15]=l,t[16]=u,t[17]=d):d=t[17],d}function Sj(){return window.location.reload()}function Cj(e){let t=(0,$.c)(2),{html:n}=e,r;return t[0]===n?r=t[1]:(r=(0,Z.jsx)(`div`,{className:`tiptap-editor h-full pointer-events-none`,"aria-hidden":`true`,children:(0,Z.jsx)(`div`,{className:`tiptap ProseMirror tiptap-editor-portal-content`,dangerouslySetInnerHTML:{__html:n}})}),t[0]=n,t[1]=r),r}function wj(e){let t=(0,$.c)(53),{entry:n,isActive:r,isSourceMode:i,editorPlaceholder:a,isNewDoc:o,previousDocName:s,onNavigateBack:c,onRecycle:l,serverRestartRecovery:u}=e,d;t[0]!==n.docName||t[1]!==u?(d=hj(n.docName,u),t[0]=n.docName,t[1]=u,t[2]=d):d=t[2];let f=d,p=gw(n.docName)===`conflict`,m;t[3]===n.docName?m=t[4]:(m=()=>{let e=document.createElement(`div`);return e.setAttribute(`data-ok-editor-portal`,n.docName),e.style.display=`contents`,e},t[3]=n.docName,t[4]=m);let[h]=(0,Q.useState)(m),g=n.provider.document.getText(`source`).length,[_,v]=(0,Q.useState)(i),[y,b]=(0,Q.useState)(!i),x,S;t[5]!==i||t[6]!==_||t[7]!==y?(x=()=>{i&&!_?v(!0):!i&&!y&&b(!0)},S=[i,_,y],t[5]=i,t[6]=_,t[7]=y,t[8]=x,t[9]=S):(x=t[8],S=t[9]),(0,Q.useEffect)(x,S);let C=lj({ytextLength:g,isSourceMode:i,visitedSource:_,visitedVisual:y}),w=(0,Q.useRef)(``),T=`${C.isLarge}-${C.renderSource}-${C.renderVisual}`,E,D;t[10]!==n.docName||t[11]!==C.isLarge||t[12]!==C.renderSource||t[13]!==C.renderVisual||t[14]!==T||t[15]!==i||t[16]!==g?(E=()=>{w.current!==T&&(w.current=T,C.isLarge&&_l(`ok/activity/defer-mount`,{docName:n.docName,ytextLength:g,isSourceMode:i,renderSource:C.renderSource,renderVisual:C.renderVisual}))},D=[T,C.isLarge,C.renderSource,C.renderVisual,n.docName,g,i],t[10]=n.docName,t[11]=C.isLarge,t[12]=C.renderSource,t[13]=C.renderVisual,t[14]=T,t[15]=i,t[16]=g,t[17]=E,t[18]=D):(E=t[17],D=t[18]),(0,Q.useEffect)(E,D);let O;t[19]===n.docName?O=t[20]:(O=()=>M(n.docName),t[19]=n.docName,t[20]=O);let[k]=(0,Q.useState)(O),A=k?.html??null,[j,N]=(0,Q.useState)(!1),P,F;t[21]!==n.docName||t[22]!==C.isLarge||t[23]!==C.renderSource||t[24]!==C.renderVisual||t[25]!==j||t[26]!==i||t[27]!==g?(P=()=>{uj({isLarge:C.isLarge,renderSource:C.renderSource,renderVisual:C.renderVisual,hasEmittedFirstToggle:j})&&(_l(`ok/cold/first-toggle`,{docName:n.docName,mountId:_e(n.docName),ytextLength:g,modeEnteredFirst:i?`source`:`visual`}),N(!0))},F=[j,C.isLarge,C.renderSource,C.renderVisual,n.docName,g,i],t[21]=n.docName,t[22]=C.isLarge,t[23]=C.renderSource,t[24]=C.renderVisual,t[25]=j,t[26]=i,t[27]=g,t[28]=P,t[29]=F):(P=t[28],F=t[29]),(0,Q.useEffect)(P,F);let I=r?`visible`:`hidden`,L=`editor:${n.docName}`,R=k?.scrollTop,z;t[30]!==a||t[31]!==n||t[32]!==C.renderSource||t[33]!==C.renderVisual||t[34]!==r||t[35]!==p||t[36]!==o||t[37]!==i||t[38]!==c||t[39]!==l||t[40]!==h||t[41]!==s||t[42]!==f||t[43]!==A?(z=f?(0,Z.jsx)(xj,{view:f}):(0,Z.jsx)(Z.Fragment,{children:(0,Z.jsx)(nj,{activeDocName:n.docName,previousDocName:s,onNavigateBack:c,onRecycle:l,children:(0,Z.jsx)(Q.Suspense,{fallback:A?(0,Z.jsx)(Cj,{html:A}):(0,Z.jsx)(ix,{}),children:(0,Z.jsx)(JA,{docName:n.docName,provider:n.provider,children:p?(0,Z.jsx)(qA,{docName:n.docName,provider:n.provider}):(0,Z.jsxs)(`div`,{className:`flex h-full flex-col`,children:[!i&&(nr(n.docName)||K(n.docName)?(0,Z.jsx)(Q.Suspense,{fallback:null,children:(0,Z.jsx)(sj,{docName:n.docName,provider:n.provider})}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(ij,{provider:n.provider}),(0,Z.jsx)(Ki,{provider:n.provider})]})),(0,Z.jsxs)(`div`,{className:`relative flex-1`,children:[C.renderSource?(0,Z.jsx)(`div`,{className:i?`h-full`:`ok-mode-hidden h-full`,children:(0,Z.jsx)(bj,{entry:n,isActive:r,isSourceMode:i,editorPlaceholder:a})}):null,C.renderVisual?(0,Z.jsx)(`div`,{className:i?`ok-mode-hidden h-full`:`h-full`,children:(0,Z.jsx)(UO,{provider:n.provider,placeholder:a,isSourceMode:i,portalTarget:h},`${n.docName}-${String(o)}-${n.poolEventId}`)}):null]})]})})})})}),t[30]=a,t[31]=n,t[32]=C.renderSource,t[33]=C.renderVisual,t[34]=r,t[35]=p,t[36]=o,t[37]=i,t[38]=c,t[39]=l,t[40]=h,t[41]=s,t[42]=f,t[43]=A,t[44]=z):z=t[44];let B;t[45]!==r||t[46]!==R||t[47]!==z?(B=(0,Z.jsx)(yj,{isActive:r,initialScrollTop:R,children:z}),t[45]=r,t[46]=R,t[47]=z,t[48]=B):B=t[48];let V;return t[49]!==I||t[50]!==L||t[51]!==B?(V=(0,Z.jsx)(Q.Activity,{mode:I,name:L,children:B}),t[49]=I,t[50]=L,t[51]=B,t[52]=V):V=t[52],V}function Tj(e){let t=e.endsWith(`rem`)?`rem`:`px`;return{value:Number.parseFloat(e),unit:t}}function Ej(e){let{value:t,unit:n}=Tj(e);return n===`rem`?t*16:t}function Dj(e,t){return`${t===`rem`?e.toFixed(1):Math.round(e)}${t}`}var Oj=3600*24*7;function kj(e){let t=(0,$.c)(28),{direction:n,currentWidth:r,onResize:i,onToggle:a,isCollapsed:o,minResizeWidth:s,maxResizeWidth:c,enableToggle:l,enableAutoCollapse:u,autoCollapseThreshold:d,expandThreshold:f,enableDrag:p,setIsDraggingRail:m,widthCookieName:h,widthCookieMaxAge:g,isNested:_}=e,v=n===void 0?`right`:n,y=o===void 0?!1:o,b=s===void 0?`14rem`:s,x=c===void 0?`24rem`:c,S=l===void 0?!0:l,C=u===void 0?!0:u,w=d===void 0?1.5:d,T=f===void 0?.2:f,E=p===void 0?!0:p,D=m===void 0?Aj:m,O=g===void 0?Oj:g,k=_===void 0?!1:_,A=(0,Q.useRef)(null),j=(0,Q.useRef)(0),M=(0,Q.useRef)(0),N=(0,Q.useRef)(!1),P=(0,Q.useRef)(!1),F=(0,Q.useRef)(null),I=(0,Q.useRef)(0),L=(0,Q.useRef)(!1),R=(0,Q.useRef)(0),z=(0,Q.useRef)(0),B=(0,Q.useRef)(null),V=(0,Q.useRef)(r),H=(0,Q.useRef)(y),U,W;t[0]===r?(U=t[1],W=t[2]):(U=()=>{V.current=r},W=[r],t[0]=r,t[1]=U,t[2]=W),(0,Q.useEffect)(U,W);let G,K;t[3]===y?(G=t[4],K=t[5]):(G=()=>{H.current=y},K=[y],t[3]=y,t[4]=G,t[5]=K),(0,Q.useEffect)(G,K);let ee=Ej(b),te;t[6]===x?te=t[7]:(te=Ej(x),t[6]=x,t[7]=te);let ne=te,re;t[8]!==E||t[9]!==k?(re=function(e){E&&(P.current=!0,j.current=H.current?0:Ej(V.current),M.current=e.clientX,I.current=e.clientX,F.current=null,L.current=!1,R.current=0,z.current=0,B.current=k&&A.current?A.current.getBoundingClientRect():null,e.preventDefault())},t[8]=E,t[9]=k,t[10]=re):re=t[10];let ie=re,ae,oe;t[11]!==w||t[12]!==v||t[13]!==C||t[14]!==S||t[15]!==T||t[16]!==k||t[17]!==ne||t[18]!==ee||t[19]!==i||t[20]!==a||t[21]!==D||t[22]!==O||t[23]!==h?(ae=()=>{let e=function(e){h&&(document.cookie=`${h}=${e}; path=/; max-age=${O}`)},t=function(e,t){return v===`left`?e<t:e>t},n=function(e,t,n,r){if(k&&r){let r=e.clientX-t;return v===`left`?n-r:n+r}return v===`left`?window.innerWidth-e.clientX:e.clientX},r=function(r){if(!P.current)return;let o=Math.abs(r.clientX-M.current);if(!N.current&&o>5&&(N.current=!0,D(!0)),N.current){let{unit:o}=Tj(V.current),s=B.current;k&&A.current&&(s=A.current.getBoundingClientRect());let c=t(r.clientX,I.current)?`expand`:`collapse`;F.current!==c&&(F.current=c),z.current=Math.abs(r.clientX-I.current);let l=Date.now();if(L.current&&l-R.current>200&&(L.current=!1),!L.current){if(C&&a&&!H.current){let e=n(r,M.current,j.current,s),t=!1;if(w<=1)t=e<=ee*w;else if(e<=ee){let n=ee*(w-1);t=ee-e>=n}if(c===`collapse`&&t){a(),I.current=r.clientX,L.current=!0,R.current=l;return}}if(a&&H.current&&c===`expand`&&z.current>ee*T){a();let t=n(r,M.current,j.current,s),c=Math.max(ee,Math.min(ne,t)),u=Dj(o===`rem`?c/16:c,o);i(u),e(u),I.current=r.clientX,L.current=!0,R.current=l;return}}if(H.current)return;let u=n(r,M.current,j.current,s),d=Math.max(ee,Math.min(ne,u)),f=Dj(o===`rem`?d/16:d,o);i(f),e(f)}},o=function(){P.current&&(!N.current&&a&&S&&a(),N.current=!1,P.current=!1,F.current=null,I.current=0,L.current=!1,R.current=0,z.current=0,B.current=null,D(!1))};return document.addEventListener(`mousemove`,r),document.addEventListener(`mouseup`,o),()=>{document.removeEventListener(`mousemove`,r),document.removeEventListener(`mouseup`,o)}},oe=[i,a,D,ee,ne,k,C,w,T,S,h,O,v],t[11]=w,t[12]=v,t[13]=C,t[14]=S,t[15]=T,t[16]=k,t[17]=ne,t[18]=ee,t[19]=i,t[20]=a,t[21]=D,t[22]=O,t[23]=h,t[24]=ae,t[25]=oe):(ae=t[24],oe=t[25]),(0,Q.useEffect)(ae,oe);let se;return t[26]===ie?se=t[27]:(se={dragRef:A,isDragging:N,handleMouseDown:ie},t[26]=ie,t[27]=se),se}function Aj(){}var jj=3600*24*7,Mj=`18rem`,Nj=`3rem`,Pj=`app-file-sidebar`,Fj=`14.625rem`,Ij=`32rem`,Lj=`sidebar_width`,Rj=/^\d+(?:\.\d+)?(?:rem|px)$/,zj=Q.createContext(null);function Bj(e){if(typeof document>`u`)return e;let t=document.cookie.split(`; `).find(e=>e.startsWith(`${Lj}=`))?.split(`=`)[1];if(!t)return e;let n;try{n=decodeURIComponent(t)}catch{return e}return Rj.test(n)?n:e}function Vj(){let e=Q.use(zj);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e}function Hj(e){let t=(0,$.c)(58),n,r,i,a,o,s,c;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7]):({open:i,onOpenChange:o,className:r,style:s,children:n,defaultWidth:c,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c);let l=c===void 0?Mj:c,[u]=Q.useState(Wj),d;t[8]===u?d=t[9]:(d=()=>Ew(u,window.innerWidth,`left`),t[8]=u,t[9]=d);let[f,p]=Q.useState(d),m;t[10]===l?m=t[11]:(m=()=>Bj(l),t[10]=l,t[11]=m);let[h,g]=Q.useState(m),[_,v]=Q.useState(!1),[y,b]=Q.useState(!1),x;t[12]===u?x=t[13]:(x=()=>{let e=Nw();return Fw(`left`,Ew(u,window.innerWidth,`left`),e)===`open`},t[12]=u,t[13]=x);let[S,C]=Q.useState(x),w=i??S,T;t[14]!==w||t[15]!==f||t[16]!==o?(T=e=>{let t=typeof e==`function`?e(w):e;o?o(t):C(t),Iw(`left`,f,t?`open`:`collapsed`)},t[14]=w,t[15]=f,t[16]=o,t[17]=T):T=t[17];let E=T,D;t[18]===E?D=t[19]:(D=function(){E(Uj)},t[18]=E,t[19]=D);let O=D,k=Q.useRef(w),A;t[20]===w?A=t[21]:(A=()=>{k.current=w},t[20]=w,t[21]=A),Q.useLayoutEffect(A);let j;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(j=function(){window.innerWidth>=1024||k.current&&(window.matchMedia(`(prefers-reduced-motion: reduce)`).matches||b(!0))},t[22]=j):j=t[22];let M=j,N,P;t[23]===u?(N=t[24],P=t[25]):(P=()=>{let e=window.matchMedia(`(min-width: ${Cw}px)`),t=()=>{let e=Ew(u,window.innerWidth,`left`);p(e),C(Fw(`left`,e,Nw())===`open`)};return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},N=[u],t[23]=u,t[24]=N,t[25]=P),Q.useEffect(P,N);let F,I;t[26]===w?(F=t[27],I=t[28]):(F=()=>{w||document.getElementById(Pj)?.contains(document.activeElement)&&document.querySelector(`[data-sidebar="trigger"]`)?.focus()},I=[w],t[26]=w,t[27]=F,t[28]=I),Q.useLayoutEffect(F,I);let L,R;t[29]!==w||t[30]!==f||t[31]!==E?(L=()=>{if(f===`above`||!w)return;let e=e=>{e.key===`Escape`&&(document.querySelector(`[data-state="open"][role="dialog"], [data-state="open"][role="alertdialog"], [data-state="open"][role="menu"], [data-state="open"][role="listbox"], [data-radix-popper-content-wrapper] [data-state="open"]`)||E(!1))};return window.addEventListener(`keydown`,e,{capture:!0}),()=>window.removeEventListener(`keydown`,e,{capture:!0})},R=[f,w,E],t[29]=w,t[30]=f,t[31]=E,t[32]=L,t[33]=R):(L=t[32],R=t[33]),Q.useEffect(L,R);let z,B;t[34]===O?(z=t[35],B=t[36]):(z=()=>{if(typeof window<`u`&&window.okDesktop!=null)return;let e=e=>{Pl(e,`toggle-files-sidebar`)&&(e.preventDefault(),O())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},B=[O],t[34]=O,t[35]=z,t[36]=B),Q.useEffect(z,B);let V=w?`expanded`:`collapsed`,H;t[37]!==_||t[38]!==w||t[39]!==E||t[40]!==y||t[41]!==V||t[42]!==O||t[43]!==h?(H={state:V,open:w,setOpen:E,toggleSidebar:O,width:h,setWidth:g,isDraggingRail:_,setIsDraggingRail:v,showPushPulse:y,setShowPushPulse:b,notifySidebarFileSelected:M},t[37]=_,t[38]=w,t[39]=E,t[40]=y,t[41]=V,t[42]=O,t[43]=h,t[44]=H):H=t[44];let U;t[45]!==s||t[46]!==h?(U={"--sidebar-width":h,"--sidebar-width-icon":Nj,...s},t[45]=s,t[46]=h,t[47]=U):U=t[47];let W=U,G;t[48]===r?G=t[49]:(G=Y(`group/sidebar-wrapper flex min-h-svh w-full has-data-[variant=inset]:bg-sidebar`,r),t[48]=r,t[49]=G);let K;t[50]!==n||t[51]!==a||t[52]!==W||t[53]!==G?(K=(0,Z.jsx)(`div`,{"data-slot":`sidebar-wrapper`,style:W,className:G,...a,children:n}),t[50]=n,t[51]=a,t[52]=W,t[53]=G,t[54]=K):K=t[54];let ee;return t[55]!==H||t[56]!==K?(ee=(0,Z.jsx)(zj.Provider,{value:H,children:K}),t[55]=H,t[56]=K,t[57]=ee):ee=t[57],ee}function Uj(e){return!e}function Wj(){return Ar()}function Gj(e){let t=(0,$.c)(39),n,r,i,a,o,s;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6]):({side:a,variant:o,collapsible:s,className:r,children:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s);let c=a===void 0?`left`:a,l=o===void 0?`sidebar`:o,u=s===void 0?`offcanvas`:s,{_:d}=an(),{state:f,isDraggingRail:p}=Vj();if(u===`none`){let e;t[7]===r?e=t[8]:(e=Y(`flex h-full w-(--sidebar-width) flex-col bg-sidebar text-sidebar-foreground`,r),t[7]=r,t[8]=e);let a;return t[9]!==n||t[10]!==i||t[11]!==e||t[12]!==l?(a=(0,Z.jsx)(`div`,{"data-slot":`sidebar`,"data-variant":l,className:e,...i,children:n}),t[9]=n,t[10]=i,t[11]=e,t[12]=l,t[13]=a):a=t[13],a}let m=f===`collapsed`?u:``,h=l===`floating`||l===`inset`?`group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon)`,g;t[14]===h?g=t[15]:(g=Y(`relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear`,`group-data-[collapsible=offcanvas]:w-0`,`group-data-[side=right]:rotate-180`,h,`group-data-[dragging=true]:duration-0! group-data-[dragging=true]_*:!duration-0`),t[14]=h,t[15]=g);let _;t[16]===g?_=t[17]:(_=(0,Z.jsx)(`div`,{"data-slot":`sidebar-gap`,className:g}),t[16]=g,t[17]=_);let v;t[18]===d?v=t[19]:(v=d({id:`07q4Qk`}),t[18]=d,t[19]=v);let y=l===`floating`||l===`inset`?`p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l`,b;t[20]!==r||t[21]!==y?(b=Y(`fixed inset-y-0 z-10 flex h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear motion-reduce:transition-none motion-reduce:duration-0 data-[side=left]:left-0 data-[side=left]:group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)] data-[side=right]:right-0 data-[side=right]:group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]`,y,`group-data-[dragging=true]:duration-0! group-data-[dragging=true]_*:!duration-0`,r),t[20]=r,t[21]=y,t[22]=b):b=t[22];let x;t[23]===n?x=t[24]:(x=(0,Z.jsx)(`div`,{"data-sidebar":`sidebar`,"data-slot":`sidebar-inner`,className:`flex size-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:shadow-sm group-data-[variant=floating]:ring-1 group-data-[variant=floating]:ring-sidebar-border`,children:n}),t[23]=n,t[24]=x);let S;t[25]!==i||t[26]!==c||t[27]!==b||t[28]!==x||t[29]!==v?(S=(0,Z.jsx)(`nav`,{id:Pj,"aria-label":v,"data-slot":`sidebar-container`,"data-side":c,className:b,...i,children:x}),t[25]=i,t[26]=c,t[27]=b,t[28]=x,t[29]=v,t[30]=S):S=t[30];let C;return t[31]!==p||t[32]!==c||t[33]!==f||t[34]!==S||t[35]!==m||t[36]!==_||t[37]!==l?(C=(0,Z.jsxs)(`div`,{className:`group peer text-sidebar-foreground`,"data-state":f,"data-collapsible":m,"data-variant":l,"data-side":c,"data-slot":`sidebar`,"data-dragging":p,children:[_,S]}),t[31]=p,t[32]=c,t[33]=f,t[34]=S,t[35]=m,t[36]=_,t[37]=l,t[38]=C):C=t[38],C}function Kj(e){let t=(0,$.c)(34),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,onClick:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let{_:a}=an(),{toggleSidebar:o,state:s}=Vj(),c,l,u,d,f,p,m,h;if(t[4]!==a||t[5]!==s){let e=Fl(`toggle-files-sidebar`);c=X,l=`trigger`,u=`sidebar-trigger`,d=`ghost`,f=`icon-sm`,p=s===`expanded`,m=Pj,h=a(s===`expanded`?{id:`4PYsOz`,values:{sidebarShortcutLabel:e}}:{id:`jbSG8V`,values:{sidebarShortcutLabel:e}}),t[4]=a,t[5]=s,t[6]=c,t[7]=l,t[8]=u,t[9]=d,t[10]=f,t[11]=p,t[12]=m,t[13]=h}else c=t[6],l=t[7],u=t[8],d=t[9],f=t[10],p=t[11],m=t[12],h=t[13];let g;t[14]===n?g=t[15]:(g=Y(n),t[14]=n,t[15]=g);let _;t[16]!==r||t[17]!==o?(_=e=>{r?.(e),o()},t[16]=r,t[17]=o,t[18]=_):_=t[18];let v;t[19]===s?v=t[20]:(v=s===`expanded`?(0,Z.jsx)(T,{}):(0,Z.jsx)(uf,{}),t[19]=s,t[20]=v);let y;return t[21]!==c||t[22]!==i||t[23]!==l||t[24]!==v||t[25]!==u||t[26]!==d||t[27]!==f||t[28]!==p||t[29]!==m||t[30]!==h||t[31]!==g||t[32]!==_?(y=(0,Z.jsx)(c,{"data-sidebar":l,"data-slot":u,variant:d,size:f,"aria-expanded":p,"aria-controls":m,"aria-label":h,className:g,onClick:_,...i,children:v}),t[21]=c,t[22]=i,t[23]=l,t[24]=v,t[25]=u,t[26]=d,t[27]=f,t[28]=p,t[29]=m,t[30]=h,t[31]=g,t[32]=_,t[33]=y):y=t[33],y}function qj(e){let t=(0,$.c)(32),n,r,i,a,o;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5]):({className:n,enableDrag:a,enableToggle:o,onMouseDown:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o);let s=a===void 0?!0:a,c=o===void 0?!0:o,{_:l}=an(),{toggleSidebar:u,setWidth:d,state:f,width:p,setIsDraggingRail:m}=Vj(),h=f===`collapsed`,g;t[6]!==s||t[7]!==c||t[8]!==m||t[9]!==d||t[10]!==h||t[11]!==u||t[12]!==p?(g={direction:`right`,enableDrag:s,enableToggle:c,onResize:d,onToggle:u,currentWidth:p,isCollapsed:h,minResizeWidth:Fj,maxResizeWidth:Ij,setIsDraggingRail:m,widthCookieName:Lj,widthCookieMaxAge:jj},t[6]=s,t[7]=c,t[8]=m,t[9]=d,t[10]=h,t[11]=u,t[12]=p,t[13]=g):g=t[13];let{dragRef:_,handleMouseDown:v}=kj(g),y;t[14]!==l||t[15]!==f?(y=l(f===`expanded`?{id:`w3vFfL`}:{id:`e8zRrb`}),t[14]=l,t[15]=f,t[16]=y):y=t[16];let b;t[17]!==v||t[18]!==r?(b=e=>{r?.(e),e.defaultPrevented||v(e)},t[17]=v,t[18]=r,t[19]=b):b=t[19];let x;t[20]!==l||t[21]!==f?(x=l(f===`expanded`?{id:`w3vFfL`}:{id:`e8zRrb`}),t[20]=l,t[21]=f,t[22]=x):x=t[22];let S;t[23]===n?S=t[24]:(S=Y(`absolute inset-y-0 z-20 hidden w-4 transition-all ease-linear group-data-[side=left]:-right-4 group-data-[side=right]:left-0 after:absolute after:inset-y-0 after:start-1/2 after:w-[2px] hover:after:bg-sidebar-border sm:flex ltr:-translate-x-1/2 rtl:-translate-x-1/2`,`in-data-[side=left]:cursor-w-resize in-data-[side=right]:cursor-e-resize`,`[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize`,`group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full hover:group-data-[collapsible=offcanvas]:bg-sidebar`,`[[data-side=left][data-collapsible=offcanvas]_&]:-right-2`,`[[data-side=right][data-collapsible=offcanvas]_&]:-left-2`,`md:group-data-[variant=inset]:after:inset-y-5`,n),t[23]=n,t[24]=S);let C;return t[25]!==_||t[26]!==i||t[27]!==y||t[28]!==b||t[29]!==x||t[30]!==S?(C=(0,Z.jsx)(`button`,{ref:_,"data-sidebar":`rail`,"data-slot":`sidebar-rail`,"aria-label":y,tabIndex:-1,onMouseDown:b,title:x,className:S,...i}),t[25]=_,t[26]=i,t[27]=y,t[28]=b,t[29]=x,t[30]=S,t[31]=C):C=t[31],C}function Jj(e){let t=(0,$.c)(14),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,onAnimationEnd:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let{showPushPulse:a,setShowPushPulse:o}=Vj(),s;t[4]!==r||t[5]!==o?(s=e=>{r?.(e),e.animationName===`sidebar-push-pulse`&&o(!1)},t[4]=r,t[5]=o,t[6]=s):s=t[6];let c=s,l=a?``:void 0,u;t[7]===n?u=t[8]:(u=Y(`relative flex w-full flex-1 flex-col bg-background peer-data-[variant=inset]:m-2 peer-data-[variant=inset]:ml-0 peer-data-[variant=inset]:rounded-xl peer-data-[variant=inset]:shadow-sm peer-data-[variant=inset]:peer-data-[state=collapsed]:ml-2`,n),t[7]=n,t[8]=u);let d;return t[9]!==c||t[10]!==i||t[11]!==l||t[12]!==u?(d=(0,Z.jsx)(`main`,{"data-slot":`sidebar-inset`,"data-push-pulse":l,onAnimationEnd:c,className:u,...i}),t[9]=c,t[10]=i,t[11]=l,t[12]=u,t[13]=d):d=t[13],d}function Yj(e){let t=(0,$.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=Y(`flex flex-col gap-2 p-2`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`div`,{"data-slot":`sidebar-header`,"data-sidebar":`header`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Xj(e){let t=(0,$.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=Y(`flex flex-col gap-2 p-2`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`div`,{"data-slot":`sidebar-footer`,"data-sidebar":`footer`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Zj(e){let t=(0,$.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=Y(`no-scrollbar flex min-h-0 flex-1 flex-col gap-0 overflow-auto group-data-[collapsible=icon]:overflow-hidden`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`div`,{"data-slot":`sidebar-content`,"data-sidebar":`content`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function Qj(e){let t=(0,$.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=Y(`relative flex w-full min-w-0 flex-col p-2`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`div`,{"data-slot":`sidebar-group`,"data-sidebar":`group`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function $j(e){let t=(0,$.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,asChild:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i!==void 0&&i?xi:`div`,o;t[4]===n?o=t[5]:(o=Y(`flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 ring-sidebar-ring outline-hidden transition-[margin,opacity] duration-200 ease-linear group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0 focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0`,n),t[4]=n,t[5]=o);let s;return t[6]!==a||t[7]!==r||t[8]!==o?(s=(0,Z.jsx)(a,{"data-slot":`sidebar-group-label`,"data-sidebar":`group-label`,className:o,...r}),t[6]=a,t[7]=r,t[8]=o,t[9]=s):s=t[9],s}function eM(e){let t=(0,$.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,asChild:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i!==void 0&&i?xi:`button`,o;t[4]===n?o=t[5]:(o=Y(`absolute top-3.5 right-3 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground ring-sidebar-ring outline-hidden transition-transform group-data-[collapsible=icon]:hidden after:absolute after:-inset-2 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 md:after:hidden [&>svg]:size-4 [&>svg]:shrink-0`,n),t[4]=n,t[5]=o);let s;return t[6]!==a||t[7]!==r||t[8]!==o?(s=(0,Z.jsx)(a,{"data-slot":`sidebar-group-action`,"data-sidebar":`group-action`,className:o,...r}),t[6]=a,t[7]=r,t[8]=o,t[9]=s):s=t[9],s}function tM(e){let t=(0,$.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=Y(`w-full text-sm`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`div`,{"data-slot":`sidebar-group-content`,"data-sidebar":`group-content`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function nM(e){let t=(0,$.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=Y(`flex w-full min-w-0 flex-col gap-0`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`ul`,{"data-slot":`sidebar-menu`,"data-sidebar":`menu`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function rM(e){let t=(0,$.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=Y(`group/menu-item relative`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`li`,{"data-slot":`sidebar-menu-item`,"data-sidebar":`menu-item`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var iM=Si(`peer/menu-button group/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm ring-sidebar-ring outline-hidden transition-[width,height,padding] group-has-data-[sidebar=menu-action]/menu-item:pr-8 group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! hover:bg-sidebar-hover hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-hover active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-open:hover:bg-sidebar-hover data-open:hover:text-sidebar-accent-foreground data-active:bg-sidebar-accent data-active:font-medium data-active:text-sidebar-accent-foreground data-active:hover:bg-sidebar-accent [&_svg]:size-4 [&_svg]:shrink-0 [&>span:last-child]:truncate`,{variants:{variant:{default:`hover:bg-sidebar-hover hover:text-sidebar-accent-foreground`,outline:`bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-hover hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]`},size:{default:`h-8 text-sm`,sm:`h-7 text-xs`,lg:`h-12 text-sm group-data-[collapsible=icon]:p-0!`}},defaultVariants:{variant:`default`,size:`default`}});function aM(e){let t=(0,$.c)(28),n,r,i,a,o,s,c;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7]):({asChild:i,isActive:a,variant:o,size:s,tooltip:c,className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c);let l=i===void 0?!1:i,u=a===void 0?!1:a,d=o===void 0?`default`:o,f=s===void 0?`default`:s,p=l?xi:`button`,{state:m}=Vj(),h;t[8]!==n||t[9]!==f||t[10]!==d?(h=Y(iM({variant:d,size:f}),n),t[8]=n,t[9]=f,t[10]=d,t[11]=h):h=t[11];let g;t[12]!==p||t[13]!==u||t[14]!==r||t[15]!==f||t[16]!==h?(g=(0,Z.jsx)(p,{"data-slot":`sidebar-menu-button`,"data-sidebar":`menu-button`,"data-size":f,"data-active":u,className:h,...r}),t[12]=p,t[13]=u,t[14]=r,t[15]=f,t[16]=h,t[17]=g):g=t[17];let _=g;if(!c)return _;if(typeof c==`string`){let e;t[18]===c?e=t[19]:(e={children:c},t[18]=c,t[19]=e),c=e}let v;t[20]===_?v=t[21]:(v=(0,Z.jsx)(As,{asChild:!0,children:_}),t[20]=_,t[21]=v);let y=m!==`collapsed`,b;t[22]!==y||t[23]!==c?(b=(0,Z.jsx)(js,{side:`right`,align:`center`,hidden:y,...c}),t[22]=y,t[23]=c,t[24]=b):b=t[24];let x;return t[25]!==v||t[26]!==b?(x=(0,Z.jsxs)(Ns,{children:[v,b]}),t[25]=v,t[26]=b,t[27]=x):x=t[27],x}function oM(e){let t=(0,$.c)(12),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({className:n,asChild:i,showOnHover:a,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o=i===void 0?!1:i,s=a===void 0?!1:a,c=o?xi:`button`,l=s&&`group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 peer-data-active/menu-button:text-sidebar-accent-foreground aria-expanded:opacity-100 md:opacity-0`,u;t[5]!==n||t[6]!==l?(u=Y(`absolute top-1.5 right-1 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground ring-sidebar-ring outline-hidden transition-transform group-data-[collapsible=icon]:hidden peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[size=default]/menu-button:top-1.5 peer-data-[size=lg]/menu-button:top-2.5 peer-data-[size=sm]/menu-button:top-1 after:absolute after:-inset-2 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 md:after:hidden [&>svg]:size-4 [&>svg]:shrink-0`,l,n),t[5]=n,t[6]=l,t[7]=u):u=t[7];let d;return t[8]!==c||t[9]!==r||t[10]!==u?(d=(0,Z.jsx)(c,{"data-slot":`sidebar-menu-action`,"data-sidebar":`menu-action`,className:u,...r}),t[8]=c,t[9]=r,t[10]=u,t[11]=d):d=t[11],d}function sM(e){let t=(0,$.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=Y(`mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5 group-data-[collapsible=icon]:hidden`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`ul`,{"data-slot":`sidebar-menu-sub`,"data-sidebar":`menu-sub`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function cM(e){let t=(0,$.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=Y(`group/menu-sub-item relative`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`li`,{"data-slot":`sidebar-menu-sub-item`,"data-sidebar":`menu-sub-item`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function lM(e){let t=(0,$.c)(14),n,r,i,a,o;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5]):({asChild:i,size:a,isActive:o,className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o);let s=i===void 0?!1:i,c=a===void 0?`md`:a,l=o===void 0?!1:o,u=s?xi:`a`,d;t[6]===n?d=t[7]:(d=Y(`flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground ring-sidebar-ring outline-hidden group-data-[collapsible=icon]:hidden hover:bg-sidebar-hover hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-hover active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[size=md]:text-sm data-[size=sm]:text-xs data-active:bg-sidebar-accent data-active:text-sidebar-accent-foreground data-active:hover:bg-sidebar-accent [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground`,n),t[6]=n,t[7]=d);let f;return t[8]!==u||t[9]!==l||t[10]!==r||t[11]!==c||t[12]!==d?(f=(0,Z.jsx)(u,{"data-slot":`sidebar-menu-sub-button`,"data-sidebar":`menu-sub-button`,"data-size":c,"data-active":l,className:d,...r}),t[8]=u,t[9]=l,t[10]=r,t[11]=c,t[12]=d,t[13]=f):f=t[13],f}function uM(e){let t=null,n=!1,r=new Set;function i(e){if(e!==t){t=e;for(let e of r)e()}}e.subscribeToEvent(i);async function a(){if(!n){n=!0;try{i(await e.fetchBranch())}catch{}}}return{getSnapshot:()=>t,subscribe(e){return r.add(e),a(),()=>{r.delete(e)}}}}async function dM(){let e=await fetch(`/api/server-info`,{signal:AbortSignal.timeout(5e3)});if(!e.ok)return null;let t=await e.json(),n=Nr.safeParse(t);return n.success?n.data.currentBranch??null:null}var fM=typeof window>`u`?{getSnapshot:()=>null,subscribe:()=>()=>{}}:uM({fetchBranch:dM,subscribeToEvent:dl}),pM=fM.subscribe,mM=fM.getSnapshot;function hM(){return(0,Q.useSyncExternalStore)(pM,mM,mM)}function gM(){let e=(0,$.c)(6),t=hM(),n=ia(),{state:r}=Vj(),i=typeof window<`u`?window.okDesktop:void 0;if(i&&r===`expanded`)return null;let a;e[0]===n?a=e[1]:(a=i?.config.projectName??(n&&za(n.contentDir)||null),e[0]=n,e[1]=a);let o=a,s=i?.config.projectPath??n?.contentDir??null;if(o===null&&t===null)return null;let c;return e[2]!==t||e[3]!==o||e[4]!==s?(c={projectName:o,projectPath:s,branch:t},e[2]=t,e[3]=o,e[4]=s,e[5]=c):c=e[5],c}function _M(e){let t=(0,$.c)(30),{stats:n,selectionStats:r,showStats:i,composerBadge:a,reserveRightGutter:o}=e,s=i===void 0?!0:i,c=o===void 0?!1:o,{_:l}=an(),u=gM();if(!s&&u===null&&a==null)return null;let d=r??n,f=r!=null,{words:p,chars:m,tokens:h}=d,g;t[0]!==l||t[1]!==f||t[2]!==s?(g=l(s?f?{id:`Bv5a9_`}:{id:`L1ZE3M`}:{id:`goO4Ll`}),t[0]=l,t[1]=f,t[2]=s,t[3]=g):g=t[3];let _=c&&`pr-12`,v;t[4]===_?v=t[5]:(v=Y(`relative flex h-6 shrink-0 items-center justify-between gap-3 bg-background px-3 text-2xs text-muted-foreground`,_),t[4]=_,t[5]=v);let y;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Z.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute inset-x-0 bottom-full h-2 bg-linear-to-t from-background to-transparent`}),t[6]=y):y=t[6];let b;t[7]!==l||t[8]!==a?(b=a?(0,Z.jsxs)(X,{type:`button`,variant:`outline`,onClick:a.onReopen,"data-testid":`ask-ai-reopen-badge`,className:`-translate-x-1/2 absolute bottom-0 left-1/2 z-10 h-auto gap-1 rounded-md rounded-b-none bg-card px-2.5 py-0.5 text-2xs font-normal text-muted-foreground shadow-sm hover:text-foreground active:not-aria-[haspopup]:translate-y-0`,children:[(0,Z.jsx)(ss,{className:`size-3`,"aria-hidden":!0}),l({id:`xWEvuo`}),(0,Z.jsx)(Le,{className:`size-3`,"aria-hidden":!0})]}):null,t[7]=l,t[8]=a,t[9]=b):b=t[9];let x;t[10]===u?x=t[11]:(x=u===null?null:(0,Z.jsx)(vM,{identity:u}),t[10]=u,t[11]=x);let S;t[12]===x?S=t[13]:(S=(0,Z.jsx)(`span`,{className:`flex min-w-0 items-center gap-3`,children:x}),t[12]=x,t[13]=S);let C;t[14]!==l||t[15]!==d.chars||t[16]!==d.tokens||t[17]!==d.words||t[18]!==m||t[19]!==f||t[20]!==s||t[21]!==h||t[22]!==p?(C=s?(0,Z.jsxs)(`span`,{className:`flex shrink-0 items-center gap-3`,children:[f?(0,Z.jsx)(`span`,{className:`font-medium text-foreground/70`,"data-testid":`editor-footer-selected-label`,children:l({id:`ylXj1N`})}):null,(0,Z.jsxs)(`span`,{children:[(0,Z.jsx)(`span`,{className:`tabular-nums`,children:d.words.toLocaleString()}),` `,(0,Z.jsx)(J,{id:`gljvbT`,values:{words:p}})]}),(0,Z.jsxs)(`span`,{children:[(0,Z.jsx)(`span`,{className:`tabular-nums`,children:d.chars.toLocaleString()}),` `,(0,Z.jsx)(J,{id:`d5rK4X`,values:{chars:m}})]}),(0,Z.jsxs)(`span`,{children:[d.tokens>0?`~`:``,(0,Z.jsx)(`span`,{className:`tabular-nums`,children:d.tokens.toLocaleString()}),` `,(0,Z.jsx)(J,{id:`uynXup`,values:{tokens:h}})]})]}):null,t[14]=l,t[15]=d.chars,t[16]=d.tokens,t[17]=d.words,t[18]=m,t[19]=f,t[20]=s,t[21]=h,t[22]=p,t[23]=C):C=t[23];let w;return t[24]!==C||t[25]!==g||t[26]!==v||t[27]!==b||t[28]!==S?(w=(0,Z.jsxs)(`section`,{"aria-label":g,className:v,children:[y,b,S,C]}),t[24]=C,t[25]=g,t[26]=v,t[27]=b,t[28]=S,t[29]=w):w=t[29],w}function vM(e){let t=(0,$.c)(8),{identity:n}=e,{projectName:r,projectPath:i,branch:a}=n,o;t[0]!==r||t[1]!==i?(o=r===null?null:i?(0,Z.jsxs)(Ns,{children:[(0,Z.jsx)(As,{asChild:!0,children:(0,Z.jsx)(`span`,{tabIndex:0,className:`truncate`,"data-testid":`editor-footer-project-name`,children:r})}),(0,Z.jsx)(js,{side:`top`,className:`max-w-xs break-all`,children:i})]}):(0,Z.jsx)(`span`,{className:`truncate`,"data-testid":`editor-footer-project-name`,children:r}),t[0]=r,t[1]=i,t[2]=o):o=t[2];let s;t[3]===a?s=t[4]:(s=a===null?null:(0,Z.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1`,"data-testid":`editor-footer-branch`,children:[(0,Z.jsx)(Vo,{"aria-hidden":`true`,className:`size-3 shrink-0`}),(0,Z.jsx)(`span`,{className:`truncate`,children:a})]}),t[3]=a,t[4]=s);let c;return t[5]!==o||t[6]!==s?(c=(0,Z.jsxs)(Z.Fragment,{children:[o,s]}),t[5]=o,t[6]=s,t[7]=c):c=t[7],c}function yM(e){let t=(0,$.c)(11),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}=an(),a;t[3]===i?a=t[4]:(a=i({id:`3__SjS`}),t[3]=i,t[4]=a);let o;t[5]===n?o=t[6]:(o=Y(n),t[5]=n,t[6]=o);let s;return t[7]!==r||t[8]!==a||t[9]!==o?(s=(0,Z.jsx)(`nav`,{"aria-label":a,"data-slot":`breadcrumb`,className:o,...r}),t[7]=r,t[8]=a,t[9]=o,t[10]=s):s=t[10],s}function bM(e){let t=(0,$.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=Y(`flex flex-wrap items-center gap-1.5 text-sm wrap-break-word text-muted-foreground`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`ol`,{"data-slot":`breadcrumb-list`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function xM(e){let t=(0,$.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=Y(`inline-flex items-center gap-1`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`li`,{"data-slot":`breadcrumb-item`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function SM(e){let t=(0,$.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({current:i,className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0||i?`page`:void 0,o;t[4]===n?o=t[5]:(o=Y(`font-normal text-foreground`,n),t[4]=n,t[5]=o);let s;return t[6]!==r||t[7]!==a||t[8]!==o?(s=(0,Z.jsx)(`span`,{"data-slot":`breadcrumb-page`,"aria-current":a,className:o,...r}),t[6]=r,t[7]=a,t[8]=o,t[9]=s):s=t[9],s}function CM(e){let t=(0,$.c)(12),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({children:n,className:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===r?a=t[5]:(a=Y(`[&>svg]:size-3.5`,r),t[4]=r,t[5]=a);let o;t[6]===n?o=t[7]:(o=n??(0,Z.jsx)(Zi,{}),t[6]=n,t[7]=o);let s;return t[8]!==i||t[9]!==a||t[10]!==o?(s=(0,Z.jsx)(`li`,{"data-slot":`breadcrumb-separator`,role:`presentation`,"aria-hidden":`true`,className:a,...i,children:o}),t[8]=i,t[9]=a,t[10]=o,t[11]=s):s=t[11],s}var wM=1,TM=2,EM=4;function DM(e){let t=(0,$.c)(18),{docName:n,className:r}=e;if(!n)return null;let i,a,o,s,c,l;if(t[0]!==r||t[1]!==n){l=Symbol.for(`react.early_return_sentinel`);bb0:{let e=Or(n),u=e?e.kind===`template`?e.folder.split(`/`).filter(Boolean):[]:v(n,``).prefix.replace(/\/$/,``).split(`/`).filter(Boolean);if(u.length===0){l=null;break bb0}let d=(e,t)=>({kind:`segment`,value:e,key:u.slice(0,t+1).join(`/`)}),f=u.length>EM?[...u.slice(0,wM).map((e,t)=>d(e,t)),{kind:`ellipsis`,hidden:u.slice(wM,-TM)},...u.slice(-TM).map((e,t)=>d(e,u.length-TM+t))]:u.map((e,t)=>d(e,t));a=yM,t[8]===r?c=t[9]:(c=Y(`flex min-w-0 items-center`,r),t[8]=r,t[9]=c),i=bM,o=`min-w-0 flex-nowrap gap-1 overflow-hidden text-muted-foreground/70 text-xs`,s=f.map(OM)}t[0]=r,t[1]=n,t[2]=i,t[3]=a,t[4]=o,t[5]=s,t[6]=c,t[7]=l}else i=t[2],a=t[3],o=t[4],s=t[5],c=t[6],l=t[7];if(l!==Symbol.for(`react.early_return_sentinel`))return l;let u;t[10]!==i||t[11]!==o||t[12]!==s?(u=(0,Z.jsx)(i,{className:o,children:s}),t[10]=i,t[11]=o,t[12]=s,t[13]=u):u=t[13];let d;return t[14]!==a||t[15]!==c||t[16]!==u?(d=(0,Z.jsx)(a,{className:c,children:u}),t[14]=a,t[15]=c,t[16]=u,t[17]=d):d=t[17],d}function OM(e,t){let n=e.kind===`segment`?e.key:`ellipsis`;return(0,Z.jsxs)(Q.Fragment,{children:[t>0&&(0,Z.jsx)(CM,{className:`shrink-0 text-muted-foreground/70 [&>svg]:size-3`}),e.kind===`ellipsis`?(0,Z.jsxs)(xM,{className:`shrink-0`,children:[(0,Z.jsx)(`span`,{"aria-hidden":`true`,title:e.hidden.join(` / `),className:`flex size-4 items-center justify-center text-muted-foreground/70`,children:(0,Z.jsx)(Fd,{className:`size-3.5`})}),(0,Z.jsx)(`span`,{className:`sr-only`,children:e.hidden.join(` / `)})]}):(0,Z.jsx)(xM,{className:`min-w-0`,children:(0,Z.jsx)(SM,{current:!1,className:`min-w-0 truncate font-normal text-muted-foreground/70`,title:e.value,children:e.value})})]},n)}var kM={fill:`none`,height:24,stroke:`currentColor`,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,viewBox:`0 0 24 24`,width:24,xmlns:`http://www.w3.org/2000/svg`},AM=e=>{let t=(0,$.c)(15),n,r,i,a,o,s,c;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7]):({color:a,size:o,strokeWidth:s,absoluteStrokeWidth:n,className:c,children:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c);let l=a===void 0?`currentColor`:a,u=o===void 0?24:o,d=s===void 0?2:s,f=c===void 0?``:c,p=n?Number(d)*24/Number(u):d,m;return t[8]!==r||t[9]!==f||t[10]!==l||t[11]!==i||t[12]!==u||t[13]!==p?(m=(0,Z.jsx)(`svg`,{"aria-hidden":`true`,...kM,className:f,height:u,stroke:l,strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:p,width:u,...i,children:r}),t[8]=r,t[9]=f,t[10]=l,t[11]=i,t[12]=u,t[13]=p,t[14]=m):m=t[14],m},jM=e=>{let t=(0,$.c)(4),n,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsx)(`title`,{children:`Markdown`}),r=(0,Z.jsx)(`path`,{d:`M232,48H24A16,16,0,0,0,8,64V192a16,16,0,0,0,16,16H232a16,16,0,0,0,16-16V64A16,16,0,0,0,232,48Zm0,144H24V64H232V192ZM128,104v48a8,8,0,0,1-16,0V123.31L93.66,141.66a8,8,0,0,1-11.32,0L64,123.31V152a8,8,0,0,1-16,0V104a8,8,0,0,1,13.66-5.66L88,124.69l26.34-26.35A8,8,0,0,1,128,104Zm77.66,18.34a8,8,0,0,1,0,11.32l-24,24a8,8,0,0,1-11.32,0l-24-24a8,8,0,0,1,11.32-11.32L168,132.69V104a8,8,0,0,1,16,0v28.69l10.34-10.35A8,8,0,0,1,205.66,122.34Z`}),t[0]=n,t[1]=r):(n=t[0],r=t[1]);let i;return t[2]===e?i=t[3]:(i=(0,Z.jsxs)(AM,{...e,viewBox:`0 0 256 256`,fill:`currentColor`,children:[n,r]}),t[2]=e,t[3]=i),i},MM=e=>{let t=(0,$.c)(4),n,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsx)(`title`,{children:`Textbox`}),r=(0,Z.jsx)(`path`,{d:`M112,40a8,8,0,0,0-8,8V64H24A16,16,0,0,0,8,80v96a16,16,0,0,0,16,16h80v16a8,8,0,0,0,16,0V48A8,8,0,0,0,112,40ZM24,176V80h80v96ZM248,80v96a16,16,0,0,1-16,16H144a8,8,0,0,1,0-16h88V80H144a8,8,0,0,1,0-16h88A16,16,0,0,1,248,80ZM88,112a8,8,0,0,1-8,8H72v24a8,8,0,0,1-16,0V120H48a8,8,0,0,1,0-16H80A8,8,0,0,1,88,112Z`}),t[0]=n,t[1]=r):(n=t[0],r=t[1]);let i;return t[2]===e?i=t[3]:(i=(0,Z.jsxs)(AM,{...e,viewBox:`0 0 256 256`,fill:`currentColor`,children:[n,r]}),t[2]=e,t[3]=i),i};function NM(e){let t=(0,$.c)(29),{isSourceMode:n,onModeChange:r,sourceDisabled:i}=e,a=i===void 0?!1:i,{_:o}=an(),s=n?`source`:`wysiwyg`,c;t[0]===r?c=t[1]:(c=e=>{e&&r(e)},t[0]=r,t[1]=c);let l;t[2]===o?l=t[3]:(l=o({id:`n7aopT`}),t[2]=o,t[3]=l);let u;t[4]===o?u=t[5]:(u=o({id:`ur2XSb`}),t[4]=o,t[5]=u);let d;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Z.jsx)(As,{children:(0,Z.jsx)(MM,{className:`size-4`})}),t[6]=d):d=t[6];let f;t[7]===u?f=t[8]:(f=(0,Z.jsx)(Bc,{value:`wysiwyg`,"aria-label":u,className:`size-7 px-0 dark:data-[state=on]:bg-foreground/15`,asChild:!0,children:d}),t[7]=u,t[8]=f);let p;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Z.jsx)(js,{side:`bottom`,children:(0,Z.jsx)(J,{id:`Mb_20S`})}),t[9]=p):p=t[9];let m;t[10]===f?m=t[11]:(m=(0,Z.jsxs)(Ns,{children:[f,p]}),t[10]=f,t[11]=m);let h;t[12]===o?h=t[13]:(h=o({id:`xbdtfY`}),t[12]=o,t[13]=h);let g;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,Z.jsx)(jM,{className:`size-4`}),t[14]=g):g=t[14];let _;t[15]!==a||t[16]!==h?(_=(0,Z.jsx)(As,{asChild:!0,children:(0,Z.jsx)(`div`,{children:(0,Z.jsx)(Bc,{value:`source`,"aria-label":h,disabled:a,className:`size-7 px-0 dark:data-[state=on]:bg-foreground/15`,children:g})})}),t[15]=a,t[16]=h,t[17]=_):_=t[17];let v;t[18]===a?v=t[19]:(v=(0,Z.jsx)(js,{side:`bottom`,children:a?(0,Z.jsx)(J,{id:`G-JBA1`}):(0,Z.jsx)(J,{id:`u6Hp4N`})}),t[18]=a,t[19]=v);let y;t[20]!==_||t[21]!==v?(y=(0,Z.jsxs)(Ns,{children:[_,v]}),t[20]=_,t[21]=v,t[22]=y):y=t[22];let b;return t[23]!==y||t[24]!==s||t[25]!==c||t[26]!==l||t[27]!==m?(b=(0,Z.jsxs)(Hc,{type:`single`,value:s,onValueChange:c,"aria-label":l,variant:`segmented`,size:`sm`,spacing:1,className:`shrink-0 bg-muted p-0.5 data-[size=sm]:rounded-[10px]`,children:[m,y]}),t[23]=y,t[24]=s,t[25]=c,t[26]=l,t[27]=m,t[28]=b):b=t[28],b}var PM=(0,Q.lazy)(async()=>({default:(await n(async()=>{let{SkillEditorActions:e}=await import(`./SkillEditorActions-pVw4b49f.js`);return{SkillEditorActions:e}},__vite__mapDeps([90,1,10,3,11,6,7,13,75,20,15,16,12,17,55,56,18,58,60,34,59,80,76,61,53,64,81,69,37,66]),import.meta.url)).SkillEditorActions}));function FM(e){let t=(0,$.c)(82),{activeDocName:n,isSourceMode:r,sourceDisabled:i,onModeChange:a,showAddPropertyButton:o,onAddProperty:s,isPanelCollapsed:c,onTogglePanel:l,reserveRightGutter:u}=e,d=u===void 0?!1:u,{_:f}=an(),p;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(p=Nl(`toggle-document-panel`),t[0]=p):p=t[0];let m=p,h,g,_,v,y,b,x,S,C,w,T,E,D,O,k;if(t[1]!==f||t[2]!==n||t[3]!==c||t[4]!==r||t[5]!==s||t[6]!==a||t[7]!==l||t[8]!==d||t[9]!==o||t[10]!==i){let e=Fl(`toggle-document-panel`),u;t[26]===n?u=t[27]:(u=n?Or(n):null,t[26]=n,t[27]=u);let p=u,m;t[28]===n?m=t[29]:(m=n?K(n):null,t[28]=n,t[29]=m);let A=m,j;t[30]!==p||t[31]!==A?(j=p?.kind===`skill`?{scope:p.scope,name:p.name}:A?{scope:`project`,name:A}:null,t[30]=p,t[31]=A,t[32]=j):j=t[32];let M=j;b=`editor-toolbar`,x=`pointer-events-none absolute inset-x-0 top-0 z-10`;let N;t[33]!==n||t[34]!==M?(N=M?null:(0,Z.jsx)(DM,{docName:n}),t[33]=n,t[34]=M,t[35]=N):N=t[35];let P;t[36]===N?P=t[37]:(P=(0,Z.jsx)(`div`,{className:`pointer-events-auto flex min-w-0 items-center`,children:N}),t[36]=N,t[37]=P);let F;t[38]!==r||t[39]!==a||t[40]!==i?(F=(0,Z.jsx)(`div`,{className:`pointer-events-auto flex justify-center`,children:(0,Z.jsx)(NM,{isSourceMode:r,onModeChange:a,sourceDisabled:i})}),t[38]=r,t[39]=a,t[40]=i,t[41]=F):F=t[41],t[42]!==P||t[43]!==F?(S=(0,Z.jsx)(`div`,{className:`editor-content-aligned bg-background py-2`,children:(0,Z.jsxs)(`div`,{className:`grid grid-cols-3 items-center`,children:[P,F]})}),t[42]=P,t[43]=F,t[44]=S):S=t[44];let I=d&&`pr-9`;t[45]===I?_=t[46]:(_=Y(`pointer-events-auto absolute top-0 right-0 flex items-center justify-end gap-1 py-2 pr-2`,I),t[45]=I,t[46]=_),t[47]===M?v=t[48]:(v=M?(0,Z.jsx)(Q.Suspense,{fallback:null,children:(0,Z.jsx)(PM,{scope:M.scope,name:M.name})}):null,t[47]=M,t[48]=v),t[49]!==f||t[50]!==s||t[51]!==o?(y=o&&(0,Z.jsxs)(Ns,{children:[(0,Z.jsx)(X,{variant:`ghost`,size:`icon`,"aria-label":f({id:`81H_23`}),onClick:s,"data-testid":`add-properties-button`,asChild:!0,children:(0,Z.jsx)(As,{children:(0,Z.jsx)(ef,{})})}),(0,Z.jsx)(js,{side:`bottom`,children:(0,Z.jsx)(J,{id:`81H_23`})})]}),t[49]=f,t[50]=s,t[51]=o,t[52]=y):y=t[52],g=Ns,h=X,C=``,w=`ghost`,T=`icon`,E=l,D=!c,O=`doc-panel`,k=f(c?{id:`u7H-Wn`,values:{panelShortcutLabel:e}}:{id:`2hpdRq`,values:{panelShortcutLabel:e}}),t[1]=f,t[2]=n,t[3]=c,t[4]=r,t[5]=s,t[6]=a,t[7]=l,t[8]=d,t[9]=o,t[10]=i,t[11]=h,t[12]=g,t[13]=_,t[14]=v,t[15]=y,t[16]=b,t[17]=x,t[18]=S,t[19]=C,t[20]=w,t[21]=T,t[22]=E,t[23]=D,t[24]=O,t[25]=k}else h=t[11],g=t[12],_=t[13],v=t[14],y=t[15],b=t[16],x=t[17],S=t[18],C=t[19],w=t[20],T=t[21],E=t[22],D=t[23],O=t[24],k=t[25];let A;t[53]===c?A=t[54]:(A=(0,Z.jsx)(As,{children:c?(0,Z.jsx)(ff,{}):(0,Z.jsx)(df,{})}),t[53]=c,t[54]=A);let j;t[55]!==h||t[56]!==A||t[57]!==C||t[58]!==w||t[59]!==T||t[60]!==E||t[61]!==D||t[62]!==O||t[63]!==k?(j=(0,Z.jsx)(h,{"data-doc-panel-toggle":C,variant:w,size:T,onClick:E,"aria-expanded":D,"aria-controls":O,"aria-label":k,asChild:!0,children:A}),t[55]=h,t[56]=A,t[57]=C,t[58]=w,t[59]=T,t[60]=E,t[61]=D,t[62]=O,t[63]=k,t[64]=j):j=t[64];let M;t[65]===c?M=t[66]:(M=(0,Z.jsx)(js,{side:`bottom`,children:c?(0,Z.jsx)(J,{id:`KFdXwz`,values:{panelShortcut:m}}):(0,Z.jsx)(J,{id:`MsuXaI`,values:{panelShortcut:m}})}),t[65]=c,t[66]=M);let N;t[67]!==g||t[68]!==j||t[69]!==M?(N=(0,Z.jsxs)(g,{children:[j,M]}),t[67]=g,t[68]=j,t[69]=M,t[70]=N):N=t[70];let P;t[71]!==_||t[72]!==v||t[73]!==y||t[74]!==N?(P=(0,Z.jsxs)(`div`,{className:_,children:[v,y,N]}),t[71]=_,t[72]=v,t[73]=y,t[74]=N,t[75]=P):P=t[75];let F;t[76]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,Z.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none h-2 bg-linear-to-b from-background to-transparent`}),t[76]=F):F=t[76];let I;return t[77]!==b||t[78]!==x||t[79]!==S||t[80]!==P?(I=(0,Z.jsxs)(`div`,{"data-testid":b,className:x,children:[S,P,F]}),t[77]=b,t[78]=x,t[79]=S,t[80]=P,t[81]=I):I=t[81],I}function IM(e){let{activeDocName:t,deferredActiveDocName:n,mountResolved:r,syncResolved:i}=e;return t===null||t===n?!1:!(r&&i)}function LM(e){let{currentLayout:t,containerPx:n,pinnedPx:r,residualId:i}=e;if(n<=0||!(i in t))return t;let a={...t},o=0;for(let[e,i]of Object.entries(r)){if(!(e in t))continue;let r=i/n*100;a[e]=r,o+=r}let s=0;for(let[e,n]of Object.entries(t))e===i||e in r||(s+=n);let c=100-o-s;return c<0?t:(a[i]=c,a)}var RM=`ok-terminal-height-v1`,zM=1/3,BM=.5;function VM(e){return Math.max(120,Math.round((Number.isFinite(e)?e:0)*BM))}function HM(e){let t=Number.isFinite(e)?e:0;return t<=0?240:Math.round(t*zM)}function UM(e,t){let n=VM(t);return Number.isFinite(e)?e<120?120:e>n?n:Math.round(e):Math.min(HM(t),n)}function WM(){return typeof window>`u`?0:window.innerHeight}function GM(e,t){try{let n=e??localStorage,r=t??WM(),i=n.getItem(RM);if(i==null)return UM(HM(r),r);let a=Number.parseInt(i,10);return UM(Number.isFinite(a)?a:HM(r),r)}catch{return 240}}function KM(e,t,n){try{let r=t??localStorage,i=n??WM();r.setItem(RM,String(UM(e,i)))}catch{}}function qM(){try{return typeof localStorage>`u`?240:GM()}catch{return 240}}function JM(e){let t=(0,$.c)(19),{dockPosition:n,onReveal:r,className:i}=e,{_:a}=an(),o=n===`right`,s;t[0]===a?s=t[1]:(s=a({id:`0SBTff`}),t[0]=a,t[1]=s);let c=s,l=o?`rounded-r-none border-r-0`:`rounded-b-none border-b-0`,u;t[2]!==i||t[3]!==l?(u=Y(`absolute z-20 shrink-0 bg-background text-muted-foreground shadow-sm hover:text-foreground`,l,i),t[2]=i,t[3]=l,t[4]=u):u=t[4];let d;t[5]===o?d=t[6]:(d=o?(0,Z.jsx)(Xi,{"aria-hidden":`true`}):(0,Z.jsx)(Le,{"aria-hidden":`true`}),t[5]=o,t[6]=d);let f;t[7]!==n||t[8]!==c||t[9]!==r||t[10]!==u||t[11]!==d?(f=(0,Z.jsx)(As,{asChild:!0,children:(0,Z.jsx)(X,{type:`button`,variant:`outline`,size:`icon-sm`,"aria-label":c,"data-terminal-reveal":n,onClick:r,className:u,children:d})}),t[7]=n,t[8]=c,t[9]=r,t[10]=u,t[11]=d,t[12]=f):f=t[12];let p=o?`left`:`top`,m;t[13]!==c||t[14]!==p?(m=(0,Z.jsx)(js,{side:p,sideOffset:8,children:c}),t[13]=c,t[14]=p,t[15]=m):m=t[15];let h;return t[16]!==f||t[17]!==m?(h=(0,Z.jsxs)(Ns,{children:[f,m]}),t[16]=f,t[17]=m,t[18]=h):h=t[18],h}var YM=`terminal-dock-panel`;function XM(e){let t=(0,$.c)(44),{children:n,visible:r,onVisibleChange:i,dockPosition:a,onBottomContainer:o,onEditorRegion:s,onReveal:c}=e,l=a===void 0?`bottom`:a,{resolvedTheme:u}=Ln(),d=Vb(),[f,p]=(0,Q.useState)(!r),m;t[0]===u?m=t[1]:(m=Eu(u),t[0]=u,t[1]=m);let h=m.background,g=r&&l===`bottom`,_=!r&&l===`bottom`&&c!=null,[v]=(0,Q.useState)(ZM),y=(0,Q.useRef)(v),[b,x]=(0,Q.useState)(!1),S=(0,Q.useRef)(!1),C=(0,Q.useRef)(null),w;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(w=function(e){C.current!=null&&clearTimeout(C.current),C.current=setTimeout(()=>{KM(e),C.current=null},100)},t[2]=w):w=t[2];let T=w,E=(0,Q.useRef)(null),D,O;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(D=()=>()=>{C.current!=null&&clearTimeout(C.current),E.current!=null&&(window.removeEventListener(`pointerup`,E.current),E.current=null)},O=[],t[3]=D,t[4]=O):(D=t[3],O=t[4]),(0,Q.useEffect)(D,O);let k,A;t[5]!==g||t[6]!==d?(k=()=>{let e=d.current;e!=null&&(g?e.resize(`${y.current}px`):e.collapse())},A=[g,d],t[5]=g,t[6]=d,t[7]=k,t[8]=A):(k=t[7],A=t[8]),(0,Q.useEffect)(k,A);let j=b||void 0,M;t[9]!==c||t[10]!==_?(M=_&&c?(0,Z.jsx)(JM,{dockPosition:`bottom`,onReveal:c,className:`right-3 bottom-0`}):null,t[9]=c,t[10]=_,t[11]=M):M=t[11];let N;t[12]!==n||t[13]!==s||t[14]!==M?(N=(0,Z.jsx)(GC,{minSize:`5%`,className:`flex min-h-0 flex-col`,children:(0,Z.jsxs)(`div`,{ref:s,tabIndex:-1,className:`relative flex h-full min-h-0 flex-col outline-none`,children:[n,M]})}),t[12]=n,t[13]=s,t[14]=M,t[15]=N):N=t[15];let P=!g,F;t[16]===g?F=t[17]:(F=()=>{if(!g)return;x(!0),S.current=!0;let e=()=>{x(!1),S.current=!1,window.removeEventListener(`pointerup`,e),E.current=null};E.current=e,window.addEventListener(`pointerup`,e)},t[16]=g,t[17]=F);let I;t[18]!==g||t[19]!==P||t[20]!==F?(I=(0,Z.jsx)(KC,{withHandle:g,disabled:P,onPointerDown:F}),t[18]=g,t[19]=P,t[20]=F,t[21]=I):I=t[21];let L;t[22]===h?L=t[23]:(L={backgroundColor:h},t[22]=h,t[23]=L);let R=g?`${v}px`:0,z;t[24]!==i||t[25]!==r?(z=e=>{let t=e.asPercentage===0;p(t),S.current&&(t&&r?i(!1):!t&&!r&&i(!0),e.inPixels>0&&(y.current=e.inPixels,T(e.inPixels)))},t[24]=i,t[25]=r,t[26]=z):z=t[26];let B=!b&&`transition-[flex-grow] duration-150 ease-out motion-reduce:transition-none motion-reduce:duration-0`,V;t[27]===B?V=t[28]:(V=Y(`flex flex-col`,B),t[27]=B,t[28]=V);let H;t[29]===o?H=t[30]:(H=(0,Z.jsx)(`div`,{ref:o,className:`flex min-h-0 flex-1 flex-col overflow-hidden`}),t[29]=o,t[30]=H);let U;t[31]!==f||t[32]!==d||t[33]!==L||t[34]!==R||t[35]!==z||t[36]!==V||t[37]!==H?(U=(0,Z.jsx)(GC,{id:YM,style:L,panelRef:d,defaultSize:R,minSize:`120px`,maxSize:`95%`,collapsible:!0,collapsedSize:0,onResize:z,inert:f,className:V,children:H}),t[31]=f,t[32]=d,t[33]=L,t[34]=R,t[35]=z,t[36]=V,t[37]=H,t[38]=U):U=t[38];let W;return t[39]!==N||t[40]!==I||t[41]!==U||t[42]!==j?(W=(0,Z.jsxs)(WC,{orientation:`vertical`,className:`min-h-0 flex-1`,"data-dragging":j,children:[N,I,U]}),t[39]=N,t[40]=I,t[41]=U,t[42]=j,t[43]=W):W=t[43],W}function ZM(){return qM()}var QM=(0,Q.lazy)(async()=>({default:(await n(()=>import(`./ActivityModeContent-FXULq3P6.js`),__vite__mapDeps([40,1,2,41,42,43,11,44,45,46,47,48,49,50,51,20,15,13,7,16,10,3,52,53,37,12,6,4,54,17,55,56,19,57,58,59,60,31,32,33,34,35,61,62,63,64,36,65,66,67,68,69]),import.meta.url)).ActivityModeContent})),$M=`300px`,eN=`600px`,tN=new Set([`doc-panel`,`terminal-column`,`agent-panel`]);function nN(e){let t=(0,$.c)(5),n;t[0]===e?n=t[1]:(n=(0,Z.jsx)(iN,{...e}),t[0]=e,t[1]=n);let r;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Z.jsx)(rN,{}),t[2]=r):r=t[2];let i;return t[3]===n?i=t[4]:(i=(0,Z.jsx)(vl,{name:`editor-area`,children:(0,Z.jsxs)(Vi,{children:[n,r]})}),t[3]=n,t[4]=i),i}function rN(){let e=(0,$.c)(5),t=Ha(),n;e[0]===t?n=e[1]:(n=e=>{e||t.close()},e[0]=t,e[1]=n);let r;return e[2]!==t.open||e[3]!==n?(r=(0,Z.jsx)(zC,{open:t.open,onOpenChange:n}),e[2]=t.open,e[3]=n,e[4]=r):r=e[4],r}function iN(e){let t=(0,$.c)(248),{editorMode:n,onModeChange:r,activeTab:i,onActiveTabChange:a,terminalBridge:o,terminalVisible:s,onTerminalVisibleChange:c,terminalDock:l,onTerminalPlacement:u,onRevealTerminal:d}=e,f=s===void 0?!1:s,m=l===void 0?`right`:l,{_:h}=an(),{resolvedTheme:g}=Ln(),_;t[0]===g?_=t[1]:(_=Eu(g),t[0]=g,t[1]=_);let v=_.background,{activeDocName:y,activeProvider:b,activeTarget:x,recycleDocument:S,docPanelMode:C,docPanelAgentId:w,docPanelExpandSignal:T}=vt(),{openDocumentTransition:E}=jt(),{requestAddProperty:D}=Ri(),O=mw(b,y),k=_w(y,n===`source`?`source`:`wysiwyg`),A=Hw(b),j=A===`connected`||A===`synced`,M=gw(y)===`conflict`,[N,P]=(0,Q.useState)(!1),F,I;t[2]!==b||t[3]!==N?(F=()=>{b!=null&&!N&&P(!0)},I=[b,N],t[2]=b,t[3]=N,t[4]=F,t[5]=I):(F=t[4],I=t[5]),(0,Q.useEffect)(F,I);let L=(0,Q.useDeferredValue)(y),R=x?.kind===`missing`,z=!!y&&x?.kind!==`folder`,B;t[6]!==h||t[7]!==R?(B=R?h({id:`K-a33w`}):void 0,t[6]=h,t[7]=R,t[8]=B):B=t[8];let V=B,H=(0,Q.useSyncExternalStore)(Di.subscribe,Di.getSnapshot,Di.getSnapshot),U;t[9]!==x||t[10]!==H?(U=ji(x,H),t[9]=x,t[10]=H,t[11]=U):U=t[11];let W=U,[G]=(0,Q.useState)(lN),K=G!==null,ee;t[12]===G?ee=t[13]:(ee=()=>Ew(G,window.innerWidth,`right`),t[12]=G,t[13]=ee);let[te,ne]=(0,Q.useState)(ee),re=(0,Q.useRef)(te),ie,ae;t[14]===te?(ie=t[15],ae=t[16]):(ae=()=>{re.current=te},ie=[te],t[14]=te,t[15]=ie,t[16]=ae),(0,Q.useEffect)(ae,ie);let oe=Vb(),se=Vb(),ce;t[17]===te?ce=t[18]:(ce=()=>Fw(`right`,te,Nw())===`collapsed`,t[17]=te,t[18]=ce);let[le]=(0,Q.useState)(ce),[q,ue]=(0,Q.useState)(le),de=(0,Q.useRef)(q),[fe,pe]=(0,Q.useState)(null),[me,he]=(0,Q.useState)(null),[ge,_e]=(0,Q.useState)(null),ve=m===`right`,ye=ve?`right`:`bottom`,be=o!=null&&ve&&f,xe=o!=null&&!f&&d!=null,Se=xe&&!ve,Ce=xe&&ve,we=ve&&f&&fe!=null,Te=we?fe:me,Ee=(ve?we:f)&&Te!=null,De,Oe;t[19]!==Te||t[20]!==u||t[21]!==ye||t[22]!==ge||t[23]!==Ee?(De=()=>{u?.({container:Te,isShowing:Ee,dockPosition:ye,editorRegion:ge})},Oe=[u,Te,Ee,ye,ge],t[19]=Te,t[20]=u,t[21]=ye,t[22]=ge,t[23]=Ee,t[24]=De,t[25]=Oe):(De=t[24],Oe=t[25]),(0,Q.useEffect)(De,Oe);let ke,Ae;t[26]===q?(ke=t[27],Ae=t[28]):(ke=()=>{de.current=q},Ae=[q],t[26]=q,t[27]=ke,t[28]=Ae),(0,Q.useEffect)(ke,Ae);let[je,Me]=(0,Q.useState)(!1),Ne=(0,Q.useRef)(!1),[Pe]=(0,Q.useState)(cN),Ie=(0,Q.useRef)(Pe),Le=(0,Q.useRef)(null),Re;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(Re=function(e){Le.current!=null&&clearTimeout(Le.current),Le.current=setTimeout(()=>{xw(e),Le.current=null},100)},t[29]=Re):Re=t[29];let ze=Re,[Be]=(0,Q.useState)(sN),Ve=(0,Q.useRef)(Be),[He,Ue]=(0,Q.useState)(!1),We=(0,Q.useRef)(!1),Ge=(0,Q.useRef)(null),Ke;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(Ke=function(e){Ge.current!=null&&clearTimeout(Ge.current),Ge.current=setTimeout(()=>{Bw(e),Ge.current=null},100)},t[30]=Ke):Ke=t[30];let qe=Ke,Je,Ye;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(Je=()=>()=>{Le.current!=null&&clearTimeout(Le.current),Ge.current!=null&&clearTimeout(Ge.current)},Ye=[],t[31]=Je,t[32]=Ye):(Je=t[31],Ye=t[32]),(0,Q.useEffect)(Je,Ye);let[Xe,Ze]=(0,Q.useState)(null),Qe=(0,Q.useRef)(null),$e=Ib(),et=(0,Q.useRef)(be),tt,nt;t[33]===be?(tt=t[34],nt=t[35]):(tt=()=>{et.current=be},nt=[be],t[33]=be,t[34]=tt,t[35]=nt),(0,Q.useEffect)(tt,nt);let rt;t[36]!==oe||t[37]!==se?(rt=function(){for(let e of[oe,se]){let t=e.current?.getSize();if(t!=null&&t.asPercentage>1&&t.inPixels>0)return t.inPixels/t.asPercentage*100}let e=Qe.current;return e!=null&&e.offsetWidth>0?e.offsetWidth:null},t[36]=oe,t[37]=se,t[38]=rt):rt=t[38];let it=rt,at;t[39]!==$e||t[40]!==it?(at=function(e){if(Ne.current||We.current)return;let t=$e.current;if(t!=null)try{let n=it();if(n==null)return;let r=t.getLayout(),i=Object.keys(r);if(i.length===0)return;let a=i.find(oN);if(a==null)return;let o={};if(`doc-panel`in r&&(o[`doc-panel`]=e?0:Ie.current),`terminal-column`in r&&(o[`terminal-column`]=Ve.current),Object.keys(o).length===0)return;let s=LM({currentLayout:r,containerPx:n,pinnedPx:o,residualId:a});s!==r&&t.setLayout(s)}catch{}},t[39]=$e,t[40]=it,t[41]=at):at=t[41];let ot=at,st=(0,Q.useRef)(ot),ct;t[42]===ot?ct=t[43]:(ct=()=>{st.current=ot},t[42]=ot,t[43]=ct),(0,Q.useEffect)(ct);let lt;t[44]!==ot||t[45]!==oe?(lt=function(){et.current?ot(!1):oe.current?.expand()},t[44]=ot,t[45]=oe,t[46]=lt):lt=t[46];let ut=lt,dt;t[47]!==ot||t[48]!==q||t[49]!==oe?(dt=function(){if(oe.current==null)return;let e=re.current;q?(Iw(`right`,e,`open`),et.current?ot(!1):oe.current?.expand()):(Iw(`right`,e,`collapsed`),et.current?ot(!0):oe.current?.collapse())},t[47]=ot,t[48]=q,t[49]=oe,t[50]=dt):dt=t[50];let ft=dt,pt,mt;t[51]!==ot||t[52]!==G||t[53]!==oe?(pt=()=>{let e=window.matchMedia(`(min-width: ${ww}px)`),t=()=>{let e=Ew(G,window.innerWidth,`right`);ne(e);let t=Fw(`right`,e,Nw())===`collapsed`;ue(t),et.current?ot(t):t?oe.current?.collapse():oe.current?.expand()};return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},mt=[G,oe,ot],t[51]=ot,t[52]=G,t[53]=oe,t[54]=pt,t[55]=mt):(pt=t[54],mt=t[55]),(0,Q.useEffect)(pt,mt);let ht,gt;t[56]!==Xe||t[57]!==K?(ht=()=>{if(Xe==null||K)return;let e=new ResizeObserver(()=>{st.current(de.current)});return e.observe(Xe),()=>e.disconnect()},gt=[Xe,K],t[56]=Xe,t[57]=K,t[58]=ht,t[59]=gt):(ht=t[58],gt=t[59]),(0,Q.useEffect)(ht,gt);let _t,yt;t[60]!==ut||t[61]!==a?(_t=()=>{let e=e=>{a(e),ut()},t=ih();return t&&e(t),oh(t=>{ih(),e(t)})},yt=[a,ut],t[60]=ut,t[61]=a,t[62]=_t,t[63]=yt):(_t=t[62],yt=t[63]),(0,Q.useEffect)(_t,yt);let bt,xt;t[64]!==T||t[65]!==ut?(bt=()=>{T!==0&&ut()},xt=[T,ut],t[64]=T,t[65]=ut,t[66]=bt,t[67]=xt):(bt=t[66],xt=t[67]),(0,Q.useEffect)(bt,xt);let St=(0,Q.useRef)(be),Ct,wt;t[68]!==q||t[69]!==be?(Ct=()=>{if(St.current===be)return;St.current=be;let e=q;queueMicrotask(()=>{st.current(e)})},wt=[be,q],t[68]=q,t[69]=be,t[70]=Ct,t[71]=wt):(Ct=t[70],wt=t[71]),(0,Q.useLayoutEffect)(Ct,wt);let Tt,Et;t[72]===q?(Tt=t[73],Et=t[74]):(Tt=()=>{if(!q||!document.getElementById(`doc-panel`)?.contains(document.activeElement))return;let e=document.querySelector(`[data-doc-panel-toggle]`);if(e){e.focus();return}document.querySelector(`[data-sidebar="trigger"]`)?.focus()},Et=[q],t[72]=q,t[73]=Tt,t[74]=Et),(0,Q.useLayoutEffect)(Tt,Et);let Dt,Ot;t[75]===q?(Dt=t[76],Ot=t[77]):(Dt=()=>{window.okDesktop!=null&&window.okDesktop.editor.notifyViewMenuStateChanged({docPanelVisible:!q})},Ot=[q],t[75]=q,t[76]=Dt,t[77]=Ot),(0,Q.useEffect)(Dt,Ot);let kt,At;t[78]===ft?(kt=t[79],At=t[80]):(kt=()=>{if(window.okDesktop!=null)return window.okDesktop.onMenuAction(e=>{e===`toggle-doc-panel`&&ft()})},At=[ft],t[78]=ft,t[79]=kt,t[80]=At),(0,Q.useEffect)(kt,At);let Mt,Nt;t[81]===ft?(Mt=t[82],Nt=t[83]):(Mt=()=>{if(window.okDesktop!=null)return;let e=e=>{Pl(e,`toggle-document-panel`)&&(e.preventDefault(),ft())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},Nt=[ft],t[81]=ft,t[82]=Mt,t[83]=Nt),(0,Q.useEffect)(Mt,Nt);let Pt=(0,Q.useRef)(null),[Ft,It]=(0,Q.useState)(null),[Lt,Rt]=(0,Q.useState)(!1),zt=x?.kind===`large-file`?x.docName:y,Bt,Vt;t[84]===zt?(Bt=t[85],Vt=t[86]):(Bt=()=>{if(zt&&zt!==Pt.current){let e=Pt.current;Pt.current=zt,It(e)}},Vt=[zt],t[84]=zt,t[85]=Bt,t[86]=Vt),(0,Q.useEffect)(Bt,Vt);let Ht;t[87]===E?Ht=t[88]:(Ht=function(e){let t=kl(e);window.location.hash===t?E(e):window.location.hash=t},t[87]=E,t[88]=Ht);let Ut=Ht,Wt,Gt=null;if(x?.kind===`large-file`){let e;t[89]!==Ut||t[90]!==Ft?(e=Ft?{previousDocName:Ft,onNavigateBack:Ut}:void 0,t[89]=Ut,t[90]=Ft,t[91]=e):e=t[91];let n;t[92]!==x.docName||t[93]!==x.limit||t[94]!==x.size||t[95]!==e?(n=(0,Z.jsx)(xC,{docName:x.docName,size:x.size,limit:x.limit,backNav:e}),t[92]=x.docName,t[93]=x.limit,t[94]=x.size,t[95]=e,t[96]=n):n=t[96],Wt=n}else if(x?.kind===`folder`){let e;t[97]!==K||t[98]!==f?(e=jT({terminalVisible:f,isEmbedded:K}),t[97]=K,t[98]=f,t[99]=e):e=t[99];let n=e,r;t[100]===x.folderPath?r=t[101]:(r=(0,Z.jsx)(_C,{folderPath:x.folderPath}),t[100]=x.folderPath,t[101]=r);let i;t[102]===n?i=t[103]:(i=n?(0,Z.jsx)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute inset-x-0 bottom-0 h-2 bg-linear-to-t from-background to-transparent`}):null,t[102]=n,t[103]=i);let a;t[104]!==r||t[105]!==i?(a=(0,Z.jsxs)(`div`,{className:`relative flex min-h-0 flex-1 flex-col`,children:[r,i]}),t[104]=r,t[105]=i,t[106]=a):a=t[106];let o;t[107]!==x.folderPath||t[108]!==n?(o=n?(0,Z.jsx)(vT,{folderPath:x.folderPath}):null,t[107]=x.folderPath,t[108]=n,t[109]=o):o=t[109];let s;if(t[110]!==a||t[111]!==o?(s=(0,Z.jsxs)(`div`,{className:`relative flex h-full min-h-0 flex-col`,children:[a,o]}),t[110]=a,t[111]=o,t[112]=s):s=t[112],Wt=s,C===`agent`&&w!==null){let e;t[113]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(KC,{withHandle:!0}),t[113]=e):e=t[113];let n;t[114]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsxs)(Z.Fragment,{children:[e,(0,Z.jsx)(GC,{id:`agent-panel`,defaultSize:`25%`,minSize:`300px`,maxSize:`40%`,className:`flex flex-col bg-muted/20`,children:(0,Z.jsx)(Q.Suspense,{fallback:(0,Z.jsx)(`div`,{role:`status`,"aria-busy":`true`,className:`flex h-full items-center justify-center text-sm text-muted-foreground`,children:(0,Z.jsx)(J,{id:`ONPvOb`})}),children:(0,Z.jsx)(QM,{showBackButton:!1})})})]}),t[114]=n):n=t[114],Gt=n}}else if(x?.kind===`asset`){let e;t[115]!==x.assetPath||t[116]!==x.mediaKind?(e=(0,Z.jsx)(rx,{assetPath:x.assetPath,mediaKind:x.mediaKind},x.assetPath),t[115]=x.assetPath,t[116]=x.mediaKind,t[117]=e):e=t[117],Wt=e}else if(x?.kind===`skill-file`){let e=`${x.scope}/${x.name}/${x.path}`,n;t[118]!==x.name||t[119]!==x.path||t[120]!==x.scope||t[121]!==e?(n=(0,Z.jsx)(AC,{scope:x.scope,name:x.name,path:x.path},e),t[118]=x.name,t[119]=x.path,t[120]=x.scope,t[121]=e,t[122]=n):n=t[122],Wt=n}else if(W){let e;t[123]===W?e=t[124]:(e=(0,Z.jsx)(wC,{nav:W},W.path),t[123]=W,t[124]=e),Wt=e}else if(!b||!y)if((typeof window<`u`?Ol(window.location.hash):null)!==null)if(o!=null&&N){let e;t[125]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(ix,{}),t[125]=e):e=t[125],Wt=e;let n;t[126]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsx)(KC,{withHandle:!0,disabled:!0}),t[126]=n):n=t[126];let r=le?0:`${Pe}px`,i;t[127]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsx)(`div`,{className:`min-h-0 flex-1`}),t[127]=i):i=t[127];let a;t[128]===r?a=t[129]:(a=(0,Z.jsxs)(Z.Fragment,{children:[n,(0,Z.jsx)(GC,{id:`doc-panel`,defaultSize:r,minSize:$M,maxSize:eN,collapsible:!0,collapsedSize:0,inert:!0,className:`flex flex-col bg-muted/20`,children:i})]}),t[128]=r,t[129]=a),Gt=a}else{let e;return t[130]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(ix,{}),t[130]=e):e=t[130],e}else{let e=f?ye:null,n;t[131]===e?n=t[132]:(n=(0,Z.jsx)(RS,{terminalDock:e}),t[131]=e,t[132]=n),Wt=n}else{let e=n===`source`,o=!j,s=q,c;t[133]!==y||t[134]!==D?(c=function(){y&&D(y)},t[133]=y,t[134]=D,t[135]=c):c=t[135];let l=c,u;t[136]!==y||t[137]!==K||t[138]!==f?(u=AT({terminalVisible:f,isEmbedded:K,activeDocName:y}),t[136]=y,t[137]=K,t[138]=f,t[139]=u):u=t[139];let d=u,m=L??y,h=Ft??void 0,g;t[140]!==V||t[141]!==e||t[142]!==Ut||t[143]!==S||t[144]!==m||t[145]!==h?(g=(0,Z.jsx)(gj,{activeDocName:m,isSourceMode:e,editorPlaceholder:V,previousDocName:h,onNavigateBack:Ut,onRecycle:S}),t[140]=V,t[141]=e,t[142]=Ut,t[143]=S,t[144]=m,t[145]=h,t[146]=g):g=t[146];let _;t[147]!==y||t[148]!==e?(_=(0,Z.jsx)(uw,{activeDocName:y,isSourceMode:e}),t[147]=y,t[148]=e,t[149]=_):_=t[149];let v;t[150]!==y||t[151]!==L?(v=IM({activeDocName:y,deferredActiveDocName:L,mountResolved:y!==null&&p(y),syncResolved:y!==null&&Fe(y)})?(0,Z.jsxs)(`div`,{className:`absolute inset-0 z-10 bg-background`,children:[(0,Z.jsx)(ix,{}),y===null?null:(0,Z.jsx)(SC,{docName:y})]}):null,t[150]=y,t[151]=L,t[152]=v):v=t[152];let b;t[153]!==g||t[154]!==_||t[155]!==v?(b=(0,Z.jsxs)(`div`,{className:`relative h-full`,children:[g,_,v]}),t[153]=g,t[154]=_,t[155]=v,t[156]=b):b=t[156];let x;t[157]!==y||t[158]!==M||t[159]!==s||t[160]!==e||t[161]!==r||t[162]!==l||t[163]!==Ce||t[164]!==o||t[165]!==ft?(x=!M&&(0,Z.jsx)(FM,{activeDocName:y,isSourceMode:e,sourceDisabled:o,onModeChange:r,showAddPropertyButton:!e,onAddProperty:l,isPanelCollapsed:s,onTogglePanel:ft,reserveRightGutter:Ce&&s}),t[157]=y,t[158]=M,t[159]=s,t[160]=e,t[161]=r,t[162]=l,t[163]=Ce,t[164]=o,t[165]=ft,t[166]=x):x=t[166];let w;t[167]!==y||t[168]!==Lt||t[169]!==e||t[170]!==d?(w=d?(0,Z.jsx)(vT,{docName:y,surface:e?`source`:`wysiwyg`,dismissed:Lt,onDismiss:()=>Rt(!0),onReopen:()=>Rt(!1)}):null,t[167]=y,t[168]=Lt,t[169]=e,t[170]=d,t[171]=w):w=t[171];let T;t[172]!==b||t[173]!==x||t[174]!==w?(T=(0,Z.jsxs)(`div`,{className:`relative min-h-0 flex-1`,children:[b,x,w]}),t[172]=b,t[173]=x,t[174]=w,t[175]=T):T=t[175];let E;t[176]!==Lt||t[177]!==d?(E=d&&Lt?{onReopen:()=>Rt(!1)}:null,t[176]=Lt,t[177]=d,t[178]=E):E=t[178];let A;t[179]!==Se||t[180]!==k||t[181]!==z||t[182]!==O||t[183]!==E?(A=(0,Z.jsx)(_M,{stats:O,selectionStats:k,showStats:z,composerBadge:E,reserveRightGutter:Se}),t[179]=Se,t[180]=k,t[181]=z,t[182]=O,t[183]=E,t[184]=A):A=t[184];let N;t[185]!==T||t[186]!==A?(N=(0,Z.jsxs)(`div`,{className:`relative flex h-full flex-col`,children:[T,A]}),t[185]=T,t[186]=A,t[187]=N):N=t[187],Wt=N;let P=be&&q,F=!q,I;t[188]===Symbol.for(`react.memo_cache_sentinel`)?(I=()=>{Me(!0),Ne.current=!0;let e=()=>{Me(!1),Ne.current=!1,window.removeEventListener(`pointerup`,e)};window.addEventListener(`pointerup`,e)},t[188]=I):I=t[188];let R;t[189]!==q||t[190]!==F?(R=(0,Z.jsx)(KC,{withHandle:F,disabled:q,onPointerDown:I}),t[189]=q,t[190]=F,t[191]=R):R=t[191];let B=le?0:`${Pe}px`,H=P?`0px`:$M,U;t[192]===Symbol.for(`react.memo_cache_sentinel`)?(U=e=>{ue(e.asPercentage===0),e.inPixels>0&&Ne.current&&(Ie.current=e.inPixels,ze(e.inPixels))},t[192]=U):U=t[192];let W=!je&&`transition-[flex-grow] duration-200 ease-out motion-reduce:transition-none motion-reduce:duration-0`,G;t[193]===W?G=t[194]:(G=Y(`flex flex-col bg-muted/20`,W),t[193]=W,t[194]=G);let ee;t[195]!==y||t[196]!==i||t[197]!==C||t[198]!==e||t[199]!==a?(ee=(0,Z.jsx)(Kv,{docName:y,isSourceMode:e,activeTab:i,onActiveTabChange:a,mode:C}),t[195]=y,t[196]=i,t[197]=C,t[198]=e,t[199]=a,t[200]=ee):ee=t[200];let te;t[201]!==P||t[202]!==q||t[203]!==oe||t[204]!==B||t[205]!==H||t[206]!==G||t[207]!==ee?(te=(0,Z.jsx)(GC,{id:`doc-panel`,panelRef:oe,disabled:P,defaultSize:B,minSize:H,maxSize:eN,collapsible:!0,collapsedSize:0,onResize:U,inert:q,className:G,children:ee}),t[201]=P,t[202]=q,t[203]=oe,t[204]=B,t[205]=H,t[206]=G,t[207]=ee,t[208]=te):te=t[208];let ne;t[209]!==R||t[210]!==te?(ne=(0,Z.jsxs)(Z.Fragment,{children:[R,te]}),t[209]=R,t[210]=te,t[211]=ne):ne=t[211],Gt=ne}let Kt;t[212]!==d||t[213]!==c||t[214]!==o||t[215]!==ye||t[216]!==f||t[217]!==Wt?(Kt=o==null?Wt:(0,Z.jsx)(XM,{visible:f,onVisibleChange:c??aN,dockPosition:ye,onBottomContainer:he,onEditorRegion:_e,onReveal:d,children:Wt}),t[212]=d,t[213]=c,t[214]=o,t[215]=ye,t[216]=f,t[217]=Wt,t[218]=Kt):Kt=t[218];let qt=Kt,Jt;t[219]!==Be||t[220]!==He||t[221]!==c||t[222]!==se||t[223]!==be||t[224]!==v?(Jt=be?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(KC,{withHandle:!0,onPointerDown:()=>{Ue(!0),We.current=!0;let e=()=>{Ue(!1),We.current=!1,window.removeEventListener(`pointerup`,e),se.current?.isCollapsed()&&c?.(!1)};window.addEventListener(`pointerup`,e)}}),(0,Z.jsx)(GC,{id:`terminal-column`,panelRef:se,style:{backgroundColor:v},defaultSize:`${Be}px`,minSize:`320px`,maxSize:`95%`,collapsible:!0,collapsedSize:0,onResize:e=>{e.inPixels>0&&We.current&&(Ve.current=e.inPixels,qe(e.inPixels))},className:Y(`flex flex-col`,!He&&`transition-[flex-grow] duration-200 ease-out motion-reduce:transition-none motion-reduce:duration-0`),children:(0,Z.jsx)(`div`,{ref:pe,className:`flex min-h-0 flex-1 flex-col overflow-hidden`})})]}):null,t[219]=Be,t[220]=He,t[221]=c,t[222]=se,t[223]=be,t[224]=v,t[225]=Jt):Jt=t[225];let Yt=Jt,Xt=Gt!=null&&!le||be,Zt;t[226]===Symbol.for(`react.memo_cache_sentinel`)?(Zt=e=>{Ze(e),Qe.current=e},t[226]=Zt):Zt=t[226];let Qt=je||He||void 0,$t=be?`5%`:`30%`,en;t[227]===Xt?en=t[228]:(en=Xt?{}:{defaultSize:`100%`},t[227]=Xt,t[228]=en);let tn=!(je||He)&&`transition-[flex-grow] duration-200 ease-out motion-reduce:transition-none motion-reduce:duration-0`,nn;t[229]===tn?nn=t[230]:(nn=Y(tn),t[229]=tn,t[230]=nn);let rn;t[231]!==qt||t[232]!==$t||t[233]!==en||t[234]!==nn?(rn=(0,Z.jsx)(GC,{minSize:$t,...en,className:nn,children:qt}),t[231]=qt,t[232]=$t,t[233]=en,t[234]=nn,t[235]=rn):rn=t[235];let on;t[236]!==$e||t[237]!==Gt||t[238]!==Qt||t[239]!==rn||t[240]!==Yt?(on=(0,Z.jsxs)(WC,{orientation:`horizontal`,groupRef:$e,"data-dragging":Qt,children:[rn,Gt,Yt]}),t[236]=$e,t[237]=Gt,t[238]=Qt,t[239]=rn,t[240]=Yt,t[241]=on):on=t[241];let sn;t[242]!==d||t[243]!==Ce?(sn=Ce?(0,Z.jsx)(JM,{dockPosition:`right`,onReveal:d,className:`top-2.5 right-0`}):null,t[242]=d,t[243]=Ce,t[244]=sn):sn=t[244];let cn;return t[245]!==on||t[246]!==sn?(cn=(0,Z.jsxs)(`div`,{className:`relative flex min-h-0 flex-1`,ref:Zt,children:[on,sn]}),t[245]=on,t[246]=sn,t[247]=cn):cn=t[247],cn}function aN(){}function oN(e){return!tN.has(e)}function sN(){return Vw()}function cN(){return Sw()}function lN(){return Ar()}function uN(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++){let r=e[n],i=t[n];if(r.kind!==i.kind)return!1;if(r.kind===`human`&&i.kind===`human`){if(r.clientId!==i.clientId||r.mode!==i.mode||r.tabCount!==i.tabCount)return!1;let e=r.user,t=i.user;if(e.name!==t.name||e.color!==t.color||e.icon!==t.icon)return!1}else if(r.kind===`agent`&&i.kind===`agent`){if(r.agentId!==i.agentId)return!1;let e=r.presence,t=i.presence;if(e.displayName!==t.displayName||e.icon!==t.icon||e.color!==t.color||e.currentDoc!==t.currentDoc||e.mode!==t.mode)return!1}}return!0}function dN(e){let t=new Map;for(let n of e){let e=n.user.principalId;if(typeof e==`string`&&e.length>0){let r=t.get(e);r?r.push(n):t.set(e,[n])}}let n=new Map;for(let[e,r]of t){let t=r.reduce((e,t)=>Math.min(e,t.clientId),1/0);n.set(e,{repClientId:t,count:r.length})}let r=[];for(let t of e){let e=t.user.principalId;if(typeof e==`string`&&e.length>0){let i=n.get(e);i&&i.repClientId===t.clientId&&r.push({...t,tabCount:i.count})}else r.push({...t,tabCount:1})}return r}var fN=1e3,pN=!1;function mN(e){return!!(e.localPrincipalId&&e.entryPrincipalId===e.localPrincipalId||!e.localPrincipalId&&e.entryClientId===e.localClientId)}function hN(e,t,n){let r=(0,$.c)(9),i;r[0]===Symbol.for(`react.memo_cache_sentinel`)?(i={current:[],crossDoc:[]},r[0]=i):i=r[0];let[a,o]=(0,Q.useState)(i),s;r[1]!==n||r[2]!==e?.awareness||r[3]!==t?.awareness?(s=()=>{let r=e?.awareness,i=t?.awareness,a;i==null?a=void 0:ys(i)?a=i:(a=void 0,pN||(pN=!0,console.warn(`[agent-presence] __system__ provider awareness missing getStates() — presence bar will render without agent peers`)));let s=()=>{let e=(r?.getLocalState())?.user?.principalId??null,t=r?.clientID??null,i=[];if(r)for(let[n,a]of r.getStates().entries()){let r=a;if(!r.user||typeof r.user!=`object`)continue;let o=r.user;o.type===`human`&&(mN({entryPrincipalId:o.principalId,entryClientId:n,localPrincipalId:e,localClientId:t})||i.push({kind:`human`,clientId:n,user:o,mode:r.mode??`wysiwyg`,tabCount:1}))}let s=dN(i),{current:c,crossDoc:l}=a?hs(a,n,Date.now()):{current:[],crossDoc:[]},u=gN,d=c.map(u),f=l.map(u),p=[...s,...d],m=f;o(e=>uN(e.current,p)&&uN(e.crossDoc,m)?e:{current:p,crossDoc:m})};s();let c=()=>s(),l=()=>s();r?.on(`change`,c),t?.awareness?.on(`change`,l);let u=setInterval(s,fN);return()=>{r?.off(`change`,c),t?.awareness?.off(`change`,l),clearInterval(u)}},r[1]=n,r[2]=e?.awareness,r[3]=t?.awareness,r[4]=s):s=r[4];let c;return r[5]!==n||r[6]!==e||r[7]!==t?(c=[e,t,n],r[5]=n,r[6]=e,r[7]=t,r[8]=c):c=r[8],(0,Q.useEffect)(s,c),a}function gN(e){let{agentId:t,entry:n}=e;return{kind:`agent`,agentId:t,presence:n}}var _N=!1,vN=new Set,yN=!1;function bN(){for(let e of vN)e()}function xN(e){_N!==e&&(_N=e,bN())}function SN(){return _N}function CN(e){return vN.add(e),()=>{vN.delete(e)}}function wN(e){let t=[e.onUpdateRelaunching(()=>xN(!0)),e.onUpdateRelaunchFailed(()=>xN(!1))];return()=>{for(let e of t)e()}}function TN(){if(yN||typeof window>`u`)return;let e=window.okDesktop;e&&(yN=!0,wN(e))}function EN(){return(0,Q.useSyncExternalStore)(CN,SN,DN)}function DN(){return!1}var ON=`sync-status`;async function kN(e){try{let t=await Fg(e);t.ok||bs.error(t.message,{id:ON,duration:1/0})}catch{}}function AN(e,t){let n=(0,$.c)(6),{_:r}=an(),i=EN(),a=(0,Q.useRef)(!1),o=(0,Q.useRef)(!1),s=(0,Q.useRef)(t),c,l;n[0]!==r||n[1]!==t||n[2]!==i||n[3]!==e?(c=()=>{if(s.current!==t&&(s.current=t,a.current=!1,o.current=!1),t)if(e===`synced`&&(a.current=!0),e===`disconnected`&&a.current){if(i){bs.dismiss(ON);return}o.current=!0;let e=window.okDesktop;bs.warning(r({id:`HGNCsl`}),{id:ON,duration:1/0,...e?{action:{label:r({id:`uaUc6t`}),onClick:()=>{kN(e)}}}:{}})}else o.current&&e===`synced`&&(o.current=!1,bs.success(r({id:`GhjUB_`}),{id:ON,duration:3e3}))},l=[e,t,r,i],n[0]=r,n[1]=t,n[2]=i,n[3]=e,n[4]=c,n[5]=l):(c=n[4],l=n[5]),(0,Q.useEffect)(c,l)}var jN=4,MN=3,NN={Bird:yd,Cat:Ed,Dog:Pd,Fish:Bd,Mouse:vf,Rabbit:_f,Shrimp:wf,Snail:Tf,Squirrel:kf,Turtle:zf};Object.freeze(Object.keys(NN));function PN(e){if(typeof e.principalId==`string`&&e.principalId.length>0)return{kind:`initials`};let t=e.name.split(` `)[1];return t&&Object.hasOwn(NN,t)?{kind:`animal`,animal:t}:{kind:`initials`}}var FN={claude:`Claude`,cursor:`Cursor`,windsurf:`Windsurf`,openai:`Codex`,github:`Copilot`,cline:`Cline`,bot:`Agent`};function IN(e){let t=(0,$.c)(28),{user:n,mode:r,tabCount:i}=e,{_:a}=an(),o=PN(n),s=o.kind===`animal`?NN[o.animal]:void 0,c;t[0]===n.name?c=t[1]:(c=qr(n.name),t[0]=n.name,t[1]=c);let l=c,u;t[2]===n.color?u=t[3]:(u=kr(n.color),t[2]=n.color,t[3]=u);let d=u,f=n.name,p;t[4]!==a||t[5]!==i||t[6]!==f?(p=i>1?a({id:`qAhFeg`,values:{userName:f,tabCount:i}}):f,t[4]=a,t[5]=i,t[6]=f,t[7]=p):p=t[7];let m=p,h;t[8]!==a||t[9]!==i||t[10]!==f?(h=i>1?a({id:`BEkF-P`,values:{userName:f,tabCount:i}}):f,t[8]=a,t[9]=i,t[10]=f,t[11]=h):h=t[11];let g=h,_;t[12]===n.color?_=t[13]:(_={backgroundColor:n.color},t[12]=n.color,t[13]=_);let v;t[14]!==s||t[15]!==d||t[16]!==l?(v=s?(0,Z.jsx)(s,{size:18,color:d,strokeWidth:1.5}):(0,Z.jsx)(`span`,{className:`font-mono text-2xs font-semibold leading-none`,style:{color:d},children:l}),t[14]=s,t[15]=d,t[16]=l,t[17]=v):v=t[17];let y;t[18]!==g||t[19]!==r||t[20]!==_||t[21]!==v?(y=(0,Z.jsx)(As,{asChild:!0,children:(0,Z.jsx)(`div`,{"data-presence-badge":`human`,"data-presence-mode":r,role:`img`,"aria-label":g,className:`inline-flex size-7 shrink-0 cursor-default items-center justify-center rounded-full ring-2 ring-background`,style:_,children:v})}),t[18]=g,t[19]=r,t[20]=_,t[21]=v,t[22]=y):y=t[22];let b;t[23]===m?b=t[24]:(b=(0,Z.jsx)(js,{children:m}),t[23]=m,t[24]=b);let x;return t[25]!==y||t[26]!==b?(x=(0,Z.jsxs)(Ns,{children:[y,b]}),t[25]=y,t[26]=b,t[27]=x):x=t[27],x}function LN(e){let t=FN[e.icon];return e.displayName||t||Yc._({id:`iEQQyu`})}function RN(e){let t=(0,$.c)(3),[n,r]=(0,Q.useState)(e===`writing`),i=(0,Q.useRef)(null),a,o;return t[0]===e?(a=t[1],o=t[2]):(a=()=>{if(e===`writing`){i.current!==null&&(clearTimeout(i.current),i.current=null),r(!0);return}return i.current!==null&&clearTimeout(i.current),i.current=setTimeout(()=>{i.current=null,r(!1)},600),()=>{i.current!==null&&(clearTimeout(i.current),i.current=null)}},o=[e],t[0]=e,t[1]=a,t[2]=o),(0,Q.useEffect)(a,o),n}function zN(e){let t=(0,$.c)(33),{participant:n,crossDoc:r,scoped:i,onClickAgent:a}=e,{_:o}=an(),{activeDocName:s}=vt(),{presence:c,agentId:l}=n,u=LN(c),d=RN(c.mode),f=!r&&d,p=c.currentDoc&&c.currentDoc!==`(connected)`?c.currentDoc:null,m=s!==null||p!==null,h=m?`cursor-pointer`:`cursor-default opacity-50`,g=i?`ring-primary ring-offset-2 ring-offset-background`:`ring-background`,_=f&&!i?`ring-primary/40 animate-pulse`:``,v;t[0]!==h||t[1]!==g||t[2]!==_?(v=[`inline-flex size-7 shrink-0 items-center justify-center rounded-full ring-2`,h,g,_].filter(Boolean),t[0]=h,t[1]=g,t[2]=_,t[3]=v):v=t[3];let y=v.join(` `),b=r?`true`:void 0,x=i?`true`:void 0,S=m?void 0:`true`,C;t[4]!==c.mode||t[5]!==b||t[6]!==x||t[7]!==S?(C={"data-presence-badge":`agent`,"data-presence-mode":c.mode,"data-presence-crossdoc":b,"data-presence-scoped":x,"data-presence-inert":S},t[4]=c.mode,t[5]=b,t[6]=x,t[7]=S,t[8]=C):C=t[8];let w=C,T=o(r&&p?{id:`b4AQFK`,values:{tooltipName:u,realCurrentDoc:p}}:{id:`RfHNf8`,values:{tooltipName:u}}),E;t[9]!==l||t[10]!==T||t[11]!==w||t[12]!==m||t[13]!==a||t[14]!==c.color||t[15]!==c.icon||t[16]!==p||t[17]!==y||t[18]!==u?(E=m?(0,Z.jsx)(`button`,{type:`button`,...w,"aria-label":T,className:y,style:{backgroundColor:c.color},onClick:()=>a(l,p),children:(0,Z.jsx)(_s,{icon:c.icon,width:16,height:16,className:`text-white`,"aria-hidden":!0})}):(0,Z.jsx)(`div`,{...w,role:`img`,"aria-label":u,className:y,style:{backgroundColor:c.color},children:(0,Z.jsx)(_s,{icon:c.icon,width:16,height:16,className:`text-white`,"aria-hidden":!0})}),t[9]=l,t[10]=T,t[11]=w,t[12]=m,t[13]=a,t[14]=c.color,t[15]=c.icon,t[16]=p,t[17]=y,t[18]=u,t[19]=E):E=t[19];let D=E,O;t[20]===D?O=t[21]:(O=(0,Z.jsx)(As,{asChild:!0,children:D}),t[20]=D,t[21]=O);let k;t[22]===u?k=t[23]:(k=(0,Z.jsx)(`span`,{className:`font-medium`,children:u}),t[22]=u,t[23]=k);let A;t[24]!==r||t[25]!==p?(A=r&&p?(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:(0,Z.jsx)(J,{id:`Wh0im4`,values:{realCurrentDoc:p}})}):null,t[24]=r,t[25]=p,t[26]=A):A=t[26];let j;t[27]!==k||t[28]!==A?(j=(0,Z.jsxs)(js,{className:`flex flex-col gap-0.5`,children:[k,A]}),t[27]=k,t[28]=A,t[29]=j):j=t[29];let M;return t[30]!==O||t[31]!==j?(M=(0,Z.jsxs)(Ns,{children:[O,j]}),t[30]=O,t[31]=j,t[32]=M):M=t[32],M}function BN(e){let t=(0,$.c)(21),{count:n,remainder:r,crossDoc:i,scopedAgentId:a,onClickAgent:o}=e,s;t[0]!==n||t[1]!==i?(s=i?Yc._({id:`9euN0m`,values:{count:n}}):Yc._({id:`uhJEA2`,values:{count:n}}),t[0]=n,t[1]=i,t[2]=s):s=t[2];let c=s,l=i?`true`:void 0,u;t[3]!==n||t[4]!==c||t[5]!==l?(u=(0,Z.jsx)(Ie,{asChild:!0,children:(0,Z.jsxs)(`button`,{type:`button`,"data-slot":`presence-overflow`,"data-presence-crossdoc":l,className:`inline-flex size-7 shrink-0 cursor-pointer items-center justify-center rounded-full bg-muted font-medium text-muted-foreground text-xs ring-2 ring-background hover:bg-muted/80`,"aria-label":c,children:[`+`,n]})}),t[3]=n,t[4]=c,t[5]=l,t[6]=u):u=t[6];let d;if(t[7]!==i||t[8]!==o||t[9]!==r||t[10]!==a){let e;t[12]!==i||t[13]!==o||t[14]!==a?(e=e=>e.kind===`human`?(0,Z.jsx)(IN,{user:e.user,mode:e.mode,tabCount:e.tabCount},e.clientId):(0,Z.jsx)(zN,{participant:e,crossDoc:i,scoped:a===e.agentId,onClickAgent:o},e.agentId),t[12]=i,t[13]=o,t[14]=a,t[15]=e):e=t[15],d=r.map(e),t[7]=i,t[8]=o,t[9]=r,t[10]=a,t[11]=d}else d=t[11];let f;t[16]===d?f=t[17]:(f=(0,Z.jsx)(Ut,{align:`end`,className:`w-auto max-w-xs p-2`,children:(0,Z.jsx)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:d})}),t[16]=d,t[17]=f);let p;return t[18]!==u||t[19]!==f?(p=(0,Z.jsxs)(Ne,{children:[u,f]}),t[18]=u,t[19]=f,t[20]=p):p=t[20],p}function VN(e,t,n,r){return e.kind===`human`?(0,Z.jsx)(IN,{user:e.user,mode:e.mode,tabCount:e.tabCount},e.clientId):(0,Z.jsx)(zN,{participant:e,crossDoc:n,scoped:r===e.agentId,onClickAgent:t},e.agentId)}function HN(){let e=(0,$.c)(20),{activeProvider:t,activeDocName:n,systemProvider:r,openActivityPanel:i,docPanelMode:a,docPanelAgentId:o}=vt(),{current:s,crossDoc:c}=hN(t,r,n);if(AN(Hw(t),n),s.length===0&&c.length===0)return null;let l;if(e[0]!==c||e[1]!==s||e[2]!==o||e[3]!==a||e[4]!==i){let t=s.slice(0,jN),n;e[6]===s?n=e[7]:(n=s.slice(jN),e[6]=s,e[7]=n);let r=n,u=c.slice(0,MN),d;e[8]===c?d=e[9]:(d=c.slice(MN),e[8]=c,e[9]=d);let f=d,p=i,m=a===`agent`?o:null,h;e[10]!==p||e[11]!==m?(h=e=>VN(e,p,!1,m),e[10]=p,e[11]=m,e[12]=h):h=e[12];let g=t.map(h),_;e[13]!==r||e[14]!==p||e[15]!==m?(_=r.length>0?(0,Z.jsx)(BN,{count:r.length,remainder:r,crossDoc:!1,scopedAgentId:m,onClickAgent:p}):null,e[13]=r,e[14]=p,e[15]=m,e[16]=_):_=e[16];let v;e[17]!==g||e[18]!==_?(v=(0,Z.jsxs)(`div`,{className:`flex items-center gap-1.5`,"data-presence-section":`current`,children:[g,_]}),e[17]=g,e[18]=_,e[19]=v):v=e[19],l=(0,Z.jsxs)(`div`,{"data-slot":`presence-bar`,className:`flex items-center px-1 py-1.5`,children:[v,c.length>0?(0,Z.jsxs)(`div`,{className:`ml-1.5 flex items-center gap-1.5`,"data-presence-section":`crossdoc`,children:[u.map(e=>VN(e,p,!0,m)),f.length>0?(0,Z.jsx)(BN,{count:f.length,remainder:f,crossDoc:!0,scopedAgentId:m,onClickAgent:p}):null]}):null]}),e[0]=c,e[1]=s,e[2]=o,e[3]=a,e[4]=i,e[5]=l}else l=e[5];return l}function UN(){let e=(0,$.c)(4),[t,n]=(0,Q.useState)(null),r,i;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>{let e=window.okDesktop;if(!e)return;let t=!1;return e.state.query().then(e=>{t||n(e.channel)}).catch(WN),()=>{t=!0}},i=[],e[0]=r,e[1]=i):(r=e[0],i=e[1]),(0,Q.useEffect)(r,i);let a;return e[2]===t?a=e[3]:(a={channel:t},e[2]=t,e[3]=a),a}function WN(e){console.warn(`[use-update-channel] bridge.state.query() failed`,e)}function GN(e){let t=(0,$.c)(6),{className:n}=e,{_:r}=an(),{channel:i}=UN();if(i!==`beta`)return null;let a;t[0]===r?a=t[1]:(a=r({id:`9fhQRL`}),t[0]=r,t[1]=a);let o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Z.jsx)(J,{id:`cSCbv3`}),t[2]=o):o=t[2];let s;return t[3]!==n||t[4]!==a?(s=(0,Z.jsx)(Ae,{variant:`secondary`,"aria-label":a,"data-testid":`beta-badge`,className:n,children:o}),t[3]=n,t[4]=a,t[5]=s):s=t[5],s}function KN(e,t){return t.trim()}function qN(e){return![``,`.`,`..`].includes(e)&&!e.includes(`/`)&&!e.includes(`\\`)&&!e.includes(`\0`)}function JN(e,t){let n=KN(e.kind,t),r=e.path.split(`/`);return r[r.length-1]=n,r.join(`/`)}function YN(e,t,n=[],r=[],i=[]){if(t.length===0&&n.length===0&&r.length===0&&i.length===0)return e;let a=new Map(t.map(e=>[e.fromDocName,e.toDocName])),o=new Map(i.map(e=>[e.toDocName,e.docExt])),s=new Map(r.map(e=>[e.fromPath,e.toPath]));return e.map(e=>{if(ul(e)){let t=s.get(Ku(e.docName,e.docExt));if(t){let n=nl(t);return{kind:`asset`,path:t,assetExt:n,mediaKind:Xn(n),size:e.size,modified:e.modified,referencedBy:[]}}let n=a.get(e.docName)??e.docName;return{...e,docName:n,docExt:o.get(n)??e.docExt}}if(tl(e))return{...e,path:nP(e.path,n)};if(il(e)){let t=s.get(e.path);return t&&Xc(t)?{kind:`document`,docName:Mu(t),docExt:Qc(t),size:e.size,modified:e.modified}:{...e,path:t??nP(e.path,n)}}return e})}function XN(e,t,n,r=[]){if(t.length===0&&!n&&r.length===0)return e;let i=new Set(t),a=new Set(r);return e.filter(e=>ul(e)?!i.has(e.docName)&&!oP(e.docName,n):tl(e)?!oP(e.path,n):il(e)?!a.has(e.path)&&!oP(e.path,n):!0)}function ZN(e,t){if(e.kind!==`asset`||t.some(t=>il(t)&&t.path===e.path))return e;let n=Yu(e.path,t);return n?{...e,path:n,name:n.split(`/`).pop()??n}:e}function QN(e,t,n,r=new Date().toISOString()){let i=!1,a=[...e],o=e=>{a.some(t=>rP(t,e))||(a.push(e),i=!0)};if(n.kind===`file`){let s=e.find(e=>ul(e)&&e.docName===t.path);return o({kind:`document`,docName:n.path,docExt:s?.docExt??t.docExt,size:s?.size??0,modified:r}),i?a:e}let s=e.find(e=>tl(e)&&e.path===t.path);o({kind:`folder`,path:n.path,size:s?.size??0,modified:r});let c=new Set(n.duplicatedDocNames);for(let i of e){if(ul(i)){let e=aP(i.docName,t.path,n.path);e&&c.has(e)&&o({...i,docName:e,modified:r});continue}if(tl(i)){let e=iP(i.path,t.path,n.path);e&&o({...i,path:e,modified:r})}}return i?a:e}function $N(e,t){return e?t.find(t=>t.fromDocName===e)?.toDocName??e:null}function eP(e,t,n){return e.flatMap(e=>t===e.toDocName||!n(e.toDocName)?[e.fromDocName]:[e.fromDocName,e.toDocName])}function tP(e,t){let n=e.kind===`file`?Ku(e.path,e.docExt):e.path;return aa(t.contentDir,n,t.pathSeparator)}function nP(e,t){for(let{fromPath:n,toPath:r}of t){if(e===n)return r;if(e.startsWith(`${n}/`))return`${r}${e.slice(n.length)}`}return e}function rP(e,t){return ul(e)&&ul(t)?e.docName===t.docName:tl(e)&&tl(t)||il(e)&&il(t)?e.path===t.path:!1}function iP(e,t,n){return e===t?n:aP(e,t,n)}function aP(e,t,n){return e.startsWith(`${t}/`)?`${n}${e.slice(t.length)}`:null}function oP(e,t){return!!t&&(e===t||e.startsWith(`${t}/`))}function sP(e){let t=(0,$.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,Z.jsx)(Op,{"data-slot":`context-menu`,...n}),t[2]=n,t[3]=r),r}function cP(e){let t=(0,$.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=Y(`select-none`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(kp,{"data-slot":`context-menu-trigger`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function lP(e){let t=(0,$.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,Z.jsx)(Mp,{"data-slot":`context-menu-group`,...n}),t[2]=n,t[3]=r),r}function uP(e){let t=(0,$.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,Z.jsx)(Rp,{"data-slot":`context-menu-sub`,...n}),t[2]=n,t[3]=r),r}function dP(e){let t=(0,$.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=Y(`z-50 max-h-(--radix-context-menu-content-available-height) min-w-36 origin-(--radix-context-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 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`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(Ap,{children:(0,Z.jsx)(jp,{"data-slot":`context-menu-content`,className:i,...r})}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function fP(e){let t=(0,$.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=Y(`group/context-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 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 focus:*:[svg]:text-accent-foreground 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,Z.jsx)(Pp,{"data-slot":`context-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 pP(e){let t=(0,$.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=Y(`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 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,Z.jsx)(Zi,{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,Z.jsxs)(zp,{"data-slot":`context-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 mP(e){let t=(0,$.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=Y(`z-50 max-h-(--radix-context-menu-content-available-height) min-w-32 origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border bg-popover p-1 text-popover-foreground shadow-lg 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,Z.jsx)(Bp,{"data-slot":`context-menu-sub-content`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function hP(e){let t=(0,$.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=Y(`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 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,Z.jsx)(`span`,{className:`pointer-events-none absolute right-2`,children:(0,Z.jsx)(Ip,{children:(0,Z.jsx)(Ji,{})})}),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,Z.jsxs)(Fp,{"data-slot":`context-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 gP(e){let t=(0,$.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=Y(`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,Z.jsx)(Np,{"data-slot":`context-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 _P(e){let t=(0,$.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=Y(`-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,Z.jsx)(Lp,{"data-slot":`context-menu-separator`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var vP=`mr-1.5 flex size-5 shrink-0 cursor-pointer items-center justify-center rounded-sm text-muted-foreground outline-none transition hover:bg-foreground/10 hover:text-foreground hover:opacity-100 focus-visible:ring-2 focus-visible:ring-ring/50`,yP=`border-border bg-background text-foreground hover:bg-background focus-visible:bg-background`,bP={start:[Zo.Space],cancel:[Zo.Esc],end:[Zo.Space,Zo.Enter]};function xP(e){return Y(vP,e?`opacity-100`:`pointer-events-none opacity-0 group-hover:pointer-events-auto group-hover:opacity-100`)}function SP(e){return e?void 0:-1}function CP({className:e,isDragging:t}){return Y(e,t&&yP)}function wP(e){return e.code===Zo.Enter&&e.target===e.currentTarget}function TP({event:e,hasKeyboardActivation:t,isDragging:n}){return e.defaultPrevented?`ignore`:!n&&t&&wP(e)?`activate-tab`:`delegate-sortable`}function EP({activeWidth:e,isDragging:t,outerStyle:n,transform:r,transition:i}){let a=t&&e?e:void 0;return{...n,transform:ns.Transform.toString(r?{...r,scaleX:1,scaleY:1}:null),transition:i,flexBasis:a??n?.flexBasis,maxWidth:a??n?.maxWidth,minWidth:a??n?.minWidth,opacity:n?.opacity,width:a??n?.width,zIndex:t?20:n?.zIndex}}function DP(e,t){let n=e?.querySelectorAll(t)??[],r=1/0,i=-1/0;for(let e of n){let t=e.getBoundingClientRect();r=Math.min(r,t.left),i=Math.max(i,t.right)}return Number.isFinite(r)&&Number.isFinite(i)?{left:r,right:i}:null}function OP(e){return({activeNodeRect:t,transform:n})=>{let r={...n,y:0};if(!e||!t)return r;let i=e.left-t.left,a=e.right-t.right;return r.x=Math.min(Math.max(r.x,i),a),r}}var kP=e=>{let{droppableContainers:t,droppableRects:n,pointerCoordinates:r}=e;if(r){let e=1/0,i=-1/0,a=null,o=null;for(let r of t){let t=n.get(r.id);t&&(t.left<e&&(e=t.left,a=r),t.right>i&&(i=t.right,o=r))}if(!Number.isFinite(e)||!Number.isFinite(i))return[];let s=r.x<e?a:r.x>i?o:null;if(s)return[{id:s.id,data:{droppableContainer:s,value:0}}]}return Go(e)},AP=[`.md`,`.mdx`],jP=`group relative -mb-px flex h-10 min-w-28 max-w-64 shrink-0 cursor-pointer items-center overflow-hidden border border-transparent font-medium transition-colors`,MP=`z-10 rounded-t-lg rounded-b-none border-border border-b-0 bg-background text-foreground`,NP=Y(MP,`bg-transparent hover:bg-muted focus-visible:bg-muted border-transparent hover:border-border focus-visible:border-border`),PP=`flex h-full min-w-0 flex-1 cursor-pointer items-center overflow-hidden px-3 text-left text-[13px]`;function FP(e){return e.replace(/[^A-Za-z0-9_-]/g,`-`)}function IP(e){let t=kl(e);window.location.hash!==t&&(window.location.hash=t)}function LP(e){Math.abs(e.deltaX)>=Math.abs(e.deltaY)||e.currentTarget.scrollWidth<=e.currentTarget.clientWidth||(e.preventDefault(),e.currentTarget.scrollLeft+=e.deltaY)}function RP(e,t){let n=[t,...AP].filter((e,t,n)=>e&&n.indexOf(e)===t),r=e.toLowerCase(),i=n.find(t=>e.length>t.length&&r.endsWith(t.toLowerCase()));return i?e.slice(0,-i.length):e}function zP(e){return e.metaKey||e.ctrlKey}var BP=1e3;function VP(e,t){return e<0||e>=t?null:e<8?String(e+1):e===t-1?`9`:null}function HP(e,t){return VP(e,t)}function UP(e,t){let n=VP(e,t);if(n)return[`Meta+${n}`,`Control+${n}`].join(` `)}function WP(e,t){if(!zP(e)||e.altKey||e.shiftKey||!/^[1-9]$/.test(e.key))return null;let n=Number(e.key);if(n===9)return t>0?t-1:null;let r=n-1;return r<Math.min(8,t)?r:null}function GP(e){let t=(0,$.c)(3),{value:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=Y(xP(!0),`font-mono tabular-nums hover:bg-transparent animate-in fade-in-0 zoom-in-95 duration-150 motion-reduce:animate-none motion-reduce:duration-0`),t[0]=r):r=t[0];let i=`⌘${n}`,a;return t[1]===i?a=t[2]:(a=(0,Z.jsx)(`span`,{"aria-hidden":`true`,"data-testid":`editor-tab-shortcut-hint`,className:r,children:(0,Z.jsx)(F,{className:`text-[10px]`,children:i})}),t[1]=i,t[2]=a),a}function KP(e){let t=(0,$.c)(37),n,r,i,a,o,s,c,l;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4],o=t[5],s=t[6],c=t[7],l=t[8]):({activateFromKeyboard:n,className:r,tabId:l,disabled:i,onKeyDown:a,ref:o,style:s,...c}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a,t[5]=o,t[6]=s,t[7]=c,t[8]=l);let u;t[9]!==i||t[10]!==l?(u={id:l,disabled:i},t[9]=i,t[10]=l,t[11]=u):u=t[11];let{attributes:d,listeners:f,rect:p,setNodeRef:m,transform:h,transition:g,isDragging:_}=es(u),v=p.current?.width,y;t[12]!==_||t[13]!==s||t[14]!==v||t[15]!==h||t[16]!==g?(y=EP({activeWidth:v,isDragging:_,outerStyle:s,transform:h,transition:g}),t[12]=_,t[13]=s,t[14]=v,t[15]=h,t[16]=g,t[17]=y):y=t[17];let b=y,x;t[18]!==o||t[19]!==m?(x=function(e){m(e),typeof o==`function`?o(e):o&&`current`in o&&(o.current=e)},t[18]=o,t[19]=m,t[20]=x):x=t[20];let S=x,C=f?.onKeyDown,w;t[21]!==n||t[22]!==_||t[23]!==a||t[24]!==C?(w=function(e){a?.(e);let t=TP({event:e,hasKeyboardActivation:!!n,isDragging:_});if(t!==`ignore`){if(t===`activate-tab`&&n){e.preventDefault(),n();return}C?.(e)}},t[21]=n,t[22]=_,t[23]=a,t[24]=C,t[25]=w):w=t[25];let T=w,E;t[26]!==r||t[27]!==_?(E=CP({className:r,isDragging:_}),t[26]=r,t[27]=_,t[28]=E):E=t[28];let D;return t[29]!==d||t[30]!==S||t[31]!==T||t[32]!==f||t[33]!==c||t[34]!==b||t[35]!==E?(D=(0,Z.jsx)(`div`,{ref:S,"data-editor-tab-sortable":``,className:E,style:b,...c,...d,...f,onKeyDown:T}),t[29]=d,t[30]=S,t[31]=T,t[32]=f,t[33]=c,t[34]=b,t[35]=E,t[36]=D):D=t[36],D}function qP(e){let t=(0,$.c)(52),{children:n,closeTab:r,closeTabs:i,canPin:a,disabled:o,openTabs:s,pinTab:c,pinnedTabIds:l,tabId:u,unpinTab:d}=e,f=a===void 0?!0:a;if(o!==void 0&&o)return n;let p;t[0]!==f||t[1]!==l||t[2]!==u?(p=f&&l.includes(u),t[0]=f,t[1]=l,t[2]=u,t[3]=p):p=t[3];let m=p,h;if(t[4]!==s||t[5]!==l||t[6]!==u){let e;t[8]===u?e=t[9]:(e=e=>e!==u,t[8]=u,t[9]=e),h=se(s.filter(e),l),t[4]=s,t[5]=l,t[6]=u,t[7]=h}else h=t[7];let g=h,_;t[10]!==s||t[11]!==l?(_=se(s,l),t[10]=s,t[11]=l,t[12]=_):_=t[12];let v=_,y;t[13]===n?y=t[14]:(y=(0,Z.jsx)(cP,{asChild:!0,children:n}),t[13]=n,t[14]=y);let b;t[15]!==r||t[16]!==u?(b=()=>r(u),t[15]=r,t[16]=u,t[17]=b):b=t[17];let x;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,Z.jsx)(J,{id:`yz7wBu`}),t[18]=x):x=t[18];let S;t[19]!==m||t[20]!==b?(S=(0,Z.jsx)(fP,{disabled:m,onSelect:b,children:x}),t[19]=m,t[20]=b,t[21]=S):S=t[21];let C=g.length===0,w;t[22]!==i||t[23]!==g?(w=()=>{i(g)},t[22]=i,t[23]=g,t[24]=w):w=t[24];let T;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,Z.jsx)(J,{id:`omXJcU`}),t[25]=T):T=t[25];let E;t[26]!==C||t[27]!==w?(E=(0,Z.jsx)(fP,{disabled:C,onSelect:w,children:T}),t[26]=C,t[27]=w,t[28]=E):E=t[28];let D=v.length===0,O;t[29]!==v||t[30]!==i?(O=()=>{i(v)},t[29]=v,t[30]=i,t[31]=O):O=t[31];let k;t[32]===l.length?k=t[33]:(k=l.length?(0,Z.jsx)(J,{id:`U2Kx6T`}):(0,Z.jsx)(J,{id:`WyXG7w`}),t[32]=l.length,t[33]=k);let A;t[34]!==D||t[35]!==O||t[36]!==k?(A=(0,Z.jsx)(fP,{disabled:D,"data-testid":`editor-tab-context-close-all`,onSelect:O,children:k}),t[34]=D,t[35]=O,t[36]=k,t[37]=A):A=t[37];let j;t[38]!==f||t[39]!==m||t[40]!==c||t[41]!==u||t[42]!==d?(j=f&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(_P,{}),(0,Z.jsx)(fP,{"data-testid":`editor-tab-context-pin-toggle`,onSelect:()=>m?d(u):c(u),children:m?(0,Z.jsx)(J,{id:`SYfHmN`}):(0,Z.jsx)(J,{id:`3pU8e-`})})]}),t[38]=f,t[39]=m,t[40]=c,t[41]=u,t[42]=d,t[43]=j):j=t[43];let M;t[44]!==E||t[45]!==A||t[46]!==j||t[47]!==S?(M=(0,Z.jsxs)(dP,{className:`min-w-40`,children:[S,E,A,j]}),t[44]=E,t[45]=A,t[46]=j,t[47]=S,t[48]=M):M=t[48];let N;return t[49]!==M||t[50]!==y?(N=(0,Z.jsxs)(sP,{children:[y,M]}),t[49]=M,t[50]=y,t[51]=N):N=t[51],N}function JP(e){let t=(0,$.c)(28),{accessibleLabel:n,closeTab:r,forceCloseVisible:i,isActive:a,isPinned:o,shortcutHint:s,tabId:c,unpinTab:l}=e,u=i===void 0?!1:i,d=s===void 0?null:s,{_:f}=an();if(d){let e;return t[0]===d?e=t[1]:(e=(0,Z.jsx)(GP,{value:d}),t[0]=d,t[1]=e),e}if(o){let e;t[2]!==f||t[3]!==n?(e=f({id:`t18QYR`,values:{accessibleLabel:n}}),t[2]=f,t[3]=n,t[4]=e):e=t[4];let r;t[5]!==c||t[6]!==l?(r=e=>{e.stopPropagation(),l(c)},t[5]=c,t[6]=l,t[7]=r):r=t[7];let i;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsx)(gf,{"aria-hidden":`true`}),t[8]=i):i=t[8];let a;return t[9]!==e||t[10]!==r?(a=(0,Z.jsx)(X,{variant:`ghost`,size:`icon-xs`,type:`button`,"aria-label":e,"data-testid":`editor-tab-unpin-button`,className:`mr-1.5 text-primary! hover:bg-primary/10!`,onClick:r,children:i}),t[9]=e,t[10]=r,t[11]=a):a=t[11],a}let p;t[12]!==f||t[13]!==n?(p=f({id:`JLzQi_`,values:{accessibleLabel:n}}),t[12]=f,t[13]=n,t[14]=p):p=t[14];let m=u||a,h;t[15]===m?h=t[16]:(h=xP(m),t[15]=m,t[16]=h);let g;t[17]===a?g=t[18]:(g=SP(a),t[17]=a,t[18]=g);let _;t[19]!==r||t[20]!==c?(_=e=>{e.stopPropagation(),r(c)},t[19]=r,t[20]=c,t[21]=_):_=t[21];let v;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,Z.jsx)(xs,{"aria-hidden":`true`}),t[22]=v):v=t[22];let y;return t[23]!==p||t[24]!==h||t[25]!==g||t[26]!==_?(y=(0,Z.jsx)(X,{type:`button`,variant:`ghost`,size:`icon-xs`,"aria-label":p,"data-testid":`editor-tab-close-button`,className:h,tabIndex:g,onClick:_,children:v}),t[23]=p,t[24]=h,t[25]=g,t[26]=_,t[27]=y):y=t[27],y}function YP(e){let t=(0,$.c)(1),{hasConflict:n}=e;if(!n)return null;let r;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Z.jsx)(ds,{"aria-hidden":`true`,"data-testid":`editor-tab-conflict-badge`,className:`mr-1 size-3.5 shrink-0 text-amber-500`}),t[0]=r):r=t[0],r}function XP(e){let t=(0,$.c)(27),{accessibleLabel:n,activateTab:r,baseName:i,docName:a,enterRenameMode:o,extension:s,hideDocExtension:c,tabId:l}=e,{_:u}=an(),d=gw(a)===`conflict`,f;t[0]!==u||t[1]!==n||t[2]!==d?(f=d?u({id:`mVFyH-`,values:{accessibleLabel:n}}):n,t[0]=u,t[1]=n,t[2]=d,t[3]=f):f=t[3];let p=f,m;t[4]!==r||t[5]!==l?(m=()=>{r(l)},t[4]=r,t[5]=l,t[6]=m):m=t[6];let h;t[7]!==a||t[8]!==o||t[9]!==l?(h=e=>{e.preventDefault(),e.stopPropagation(),o(l,a)},t[7]=a,t[8]=o,t[9]=l,t[10]=h):h=t[10];let g;t[11]===d?g=t[12]:(g=(0,Z.jsx)(YP,{hasConflict:d}),t[11]=d,t[12]=g);let _;t[13]===i?_=t[14]:(_=(0,Z.jsx)(`span`,{className:`min-w-0 truncate`,children:i}),t[13]=i,t[14]=_);let v;t[15]!==s||t[16]!==c?(v=!c&&(0,Z.jsx)(`span`,{className:`shrink-0`,children:s}),t[15]=s,t[16]=c,t[17]=v):v=t[17];let y;t[18]!==_||t[19]!==v?(y=(0,Z.jsxs)(`span`,{className:`flex min-w-0 flex-1 items-center`,children:[_,v]}),t[18]=_,t[19]=v,t[20]=y):y=t[20];let b;return t[21]!==p||t[22]!==m||t[23]!==h||t[24]!==g||t[25]!==y?(b=(0,Z.jsxs)(`button`,{type:`button`,"aria-label":p,title:p,className:PP,onClick:m,onDoubleClick:h,tabIndex:-1,children:[g,y]}),t[21]=p,t[22]=m,t[23]=h,t[24]=g,t[25]=y,t[26]=b):b=t[26],b}function ZP(){let e=(0,$.c)(94),{activeDocName:t,activeTabId:n,activeNewTabId:r,activeTarget:i,activateTab:a,activateNewTab:o,closeAndClearForRename:s,closeNewTab:c,closeTab:l,closeTabs:u,getPoolActiveDocName:d,poolHas:f,isNewTabActive:p,newTabIds:m,openNewTab:h,openTabs:g,pinTab:_,pinnedTabIds:y,reopenClosedTab:x,remapTabsForRename:S,reorderTabs:C,unpinTab:w,visibleTabIds:T}=vt(),{_:E}=an(),{pageMeta:D}=ea(),O=(0,Q.useRef)(null),[k,A]=(0,Q.useState)(null),[j,M]=(0,Q.useState)(null),[N,P]=(0,Q.useState)(``),[F,I]=(0,Q.useState)(null),[L,R]=(0,Q.useState)(!1),[z,B]=(0,Q.useState)(!1),V=(0,Q.useRef)(null),H=(0,Q.useRef)(!1),U=(0,Q.useRef)(!1),W=(0,Q.useRef)(null),G=(0,Q.useRef)(t),K=(0,Q.useRef)(null),ee=(0,Q.useRef)(!1),te=(0,Q.useRef)(!1),ne;e[0]!==n||e[1]!==t||e[2]!==i?(ne=n??(i?b(i):t?Zt(t):null),e[0]=n,e[1]=t,e[2]=i,e[3]=ne):ne=e[3];let re=ne,ie;e[4]!==r||e[5]!==re||e[6]!==p||e[7]!==m||e[8]!==g?(ie=p?`${r??`__new-tab__`}\u0000${g.join(`\0`)}\u0000${m.join(`\0`)}`:re?`${re}\u0000${g.join(`\0`)}`:``,e[4]=r,e[5]=re,e[6]=p,e[7]=m,e[8]=g,e[9]=ie):ie=e[9];let ae=ie,oe,se;e[10]===t?(oe=e[11],se=e[12]):(oe=()=>{G.current=t},se=[t],e[10]=t,e[11]=oe,e[12]=se),(0,Q.useEffect)(oe,se);let ce,le;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(ce=()=>()=>{K.current!==null&&(window.clearTimeout(K.current),K.current=null)},le=[],e[13]=ce,e[14]=le):(ce=e[13],le=e[14]),(0,Q.useEffect)(ce,le);let q,ue;e[15]===ae?(q=e[16],ue=e[17]):(q=()=>{ae&&(O.current?.querySelector(`[data-active-tab="true"]`))?.scrollIntoView({block:`nearest`,inline:`nearest`})},ue=[ae],e[15]=ae,e[16]=q,e[17]=ue),(0,Q.useEffect)(q,ue);let de,fe;e[18]===j?(de=e[19],fe=e[20]):(de=()=>{j&&(V.current?.focus(),V.current?.select())},fe=[j],e[18]=j,e[19]=de,e[20]=fe),(0,Q.useEffect)(de,fe);let pe,me;e[21]!==g||e[22]!==j?(pe=()=>{!j||g.includes(j.tabId)||(U.current=!0,W.current=null,M(null),P(``),I(null),R(!1))},me=[g,j],e[21]=g,e[22]=j,e[23]=pe,e[24]=me):(pe=e[23],me=e[24]),(0,Q.useEffect)(pe,me);let he;e[25]===Symbol.for(`react.memo_cache_sentinel`)?(he=function(e,t){let n=t.split(`/`);U.current=!1,W.current=null,M({docName:t,tabId:e}),P(n[n.length-1]),I(null)},e[25]=he):he=e[25];let _e=he,ve=function(){U.current=!0,W.current=null,M(null),P(``),I(null),R(!1)},ye=async function(){if(U.current){U.current=!1;return}if(H.current)return;let e=j?.docName;if(!e){ve();return}let t=KN(`file`,RP(N,D.get(e)?.docExt??`.md`)),n=e.split(`/`),r=n[n.length-1];if(t===r){ve();return}if(t===W.current){V.current?.focus();return}if(!qN(t)){I(E({id:`P8yDjG`})),V.current?.focus();return}let i=JN({kind:`file`,path:e,name:r},t);H.current=!0,R(!0),I(null);try{let n=await fetch(`/api/rename-path`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({kind:`file`,fromPath:e,toPath:i})});if(U.current){R(!1),H.current=!1;return}let r=await Ct(n,`Server error (HTTP ${n.status})`);if(!r.ok){I(r.title),R(!1),H.current=!1,W.current=t,V.current?.focus();return}let a=It(Hr,r.body,`rename-path:tab`,{renamed:[],renamedAssets:[]}).renamed,o=G.current,c=$N(o,a);ot(a);let l=!0;try{let e=eP(a,d(),f);await Promise.all(e.map(e=>s(e))),S(a),pl([`files`,`backlinks`,`graph`])}catch(n){let r=n;l=!1,console.warn(`[EditorTabs] post-rename reconciliation failed`,{err:r,docName:e,newDocName:i,normalized:t}),bs.error(E({id:`MUBR8r`}))}U.current=!0,M(null),P(``),I(null),R(!1),H.current=!1,W.current=null,l&&c&&c!==o&&IP(c)}catch(n){console.warn(`[EditorTabs] rename failed`,{err:n,docName:e,newDocName:i,normalized:t}),I(E({id:`HIb0vl`})),R(!1),H.current=!1,W.current=t,V.current?.focus()}},be=typeof window<`u`&&window.okDesktop!=null,xe;e[26]===m?xe=e[27]:(xe=new Set(m),e[26]=m,e[27]=xe);let Se=xe,Ce;e[28]===k?Ce=e[29]:(Ce=OP(k),e[28]=k,e[29]=Ce);let we;e[30]===Ce?we=e[31]:(we=[Ce],e[30]=Ce,e[31]=we);let Te=we,Ee;e[32]!==c||e[33]!==u||e[34]!==Se?(Ee=function(e){let t=[],n=[];for(let r of e)Se.has(r)?n.push(r):t.push(r);t.length>0&&u(t);for(let e of n)c(e)},e[32]=c,e[33]=u,e[34]=Se,e[35]=Ee):Ee=e[35];let De=Ee,Oe,ke;e[36]!==o||e[37]!==a||e[38]!==r||e[39]!==re||e[40]!==p||e[41]!==m||e[42]!==h||e[43]!==x||e[44]!==T?(Oe=()=>{let e=new Set(m),t=function(){K.current!==null&&(window.clearTimeout(K.current),K.current=null)},n=function(e){ee.current!==e&&(ee.current=e)},i=function(e){te.current!==e&&(te.current=e,B(e))},s=function(){n(!0),!(te.current||K.current!==null)&&(K.current=window.setTimeout(()=>{K.current=null,ee.current&&i(!0)},BP))},c=function(){t(),n(!1),i(!1)},l=function(t){e.has(t)?o(t):a(t)},u=function(e){if(T.length===0)return;let t=p?r:re,n=t?T.indexOf(t):-1;l(T[((n>=0?n:0)+e+T.length)%T.length])},d=function(e){if(zP(e)&&s(),Pl(e,`tab-new`)){e.preventDefault(),h();return}if(Pl(e,`tab-reopen-closed`)){e.preventDefault(),x();return}if(Pl(e,`tab-next`)){e.preventDefault(),u(1);return}if(Pl(e,`tab-previous`)){e.preventDefault(),u(-1);return}let t=WP(e,T.length);t!==null&&(e.preventDefault(),l(T[t]))},f=function(e){!e.metaKey&&!e.ctrlKey&&c()};return window.addEventListener(`keydown`,d,{capture:!0}),window.addEventListener(`keyup`,f,{capture:!0}),window.addEventListener(`blur`,c),document.addEventListener(`visibilitychange`,c),()=>{window.removeEventListener(`keydown`,d,{capture:!0}),window.removeEventListener(`keyup`,f,{capture:!0}),window.removeEventListener(`blur`,c),document.removeEventListener(`visibilitychange`,c)}},ke=[r,re,o,a,p,m,h,x,T],e[36]=o,e[37]=a,e[38]=r,e[39]=re,e[40]=p,e[41]=m,e[42]=h,e[43]=x,e[44]=T,e[45]=Oe,e[46]=ke):(Oe=e[45],ke=e[46]),(0,Q.useEffect)(Oe,ke);let Ae;e[47]===Symbol.for(`react.memo_cache_sentinel`)?(Ae={activationConstraint:{distance:8}},e[47]=Ae):Ae=e[47];let je;e[48]===Symbol.for(`react.memo_cache_sentinel`)?(je={coordinateGetter:Jo,keyboardCodes:bP},e[48]=je):je=e[48];let Me=ts(Ho(Ko,Ae),Ho(Yo,je)),Ne=z,Pe;e[49]===Symbol.for(`react.memo_cache_sentinel`)?(Pe=function(){A(DP(O.current,`[data-editor-tab-sortable]`))},e[49]=Pe):Pe=e[49];let Fe=Pe,Ie;e[50]===Symbol.for(`react.memo_cache_sentinel`)?(Ie=function(){A(null)},e[50]=Ie):Ie=e[50];let Le=Ie,Re;e[51]!==Le||e[52]!==C||e[53]!==T?(Re=function(e){Le();let t=String(e.active.id),n=e.over?String(e.over.id):null;if(!n||t===n)return;let r=T.indexOf(t),i=T.indexOf(n);r<0||i<0||r===i||C(Qo([...T],r,i),t)},e[51]=Le,e[52]=C,e[53]=T,e[54]=Re):Re=e[54];let ze=Re,Be=be?``:void 0,Ve;e[55]===Symbol.for(`react.memo_cache_sentinel`)?(Ve=Y(`pl-2 flex h-12 min-w-0 touch-manipulation flex-1 items-end overflow-x-auto overflow-y-hidden overscroll-x-contain scroll-fade-mask-x [scrollbar-width:none]`,be&&`[-webkit-app-region:drag]`),e[55]=Ve):Ve=e[55];let He=LP,Ue;e[56]===Symbol.for(`react.memo_cache_sentinel`)?(Ue=Y(`flex items-end gap-1`,be&&`[-webkit-app-region:no-drag]`),e[56]=Ue):Ue=e[56];let We=Wo,Ge=kP,Ke;e[57]===Symbol.for(`react.memo_cache_sentinel`)?(Ke={container:typeof document<`u`?document.body:void 0},e[57]=Ke):Ke=e[57];let qe=Xo,Je;e[58]===T?Je=e[59]:(Je=[...T],e[58]=T,e[59]=Je);let Ye=Uo,Xe=T.map((e,t)=>{let n=z?HP(t,T.length):null,i=UP(t,T.length);if(Se.has(e)){let t=e===r;return(0,Z.jsx)(qP,{tabId:e,canPin:!1,openTabs:T,closeTab:c,closeTabs:De,pinTab:_,pinnedTabIds:y,unpinTab:w,children:(0,Z.jsxs)(KP,{tabId:e,activateFromKeyboard:()=>o(e),"aria-current":t?`page`:void 0,"aria-keyshortcuts":i,"data-active-tab":t?`true`:void 0,className:Y(jP,t?MP:NP),onAuxClick:t=>{t.button===1&&(t.preventDefault(),c(e))},onClick:t=>{t.target===t.currentTarget&&o(e)},children:[(0,Z.jsx)(`button`,{type:`button`,"aria-label":E({id:`zLak8b`}),"data-testid":`editor-new-tab-placeholder-button`,className:PP,onClick:()=>o(e),tabIndex:-1,children:(0,Z.jsx)(`span`,{className:`min-w-0 truncate`,children:(0,Z.jsx)(J,{id:`3YvS-c`})})}),n?(0,Z.jsx)(GP,{value:n}):(0,Z.jsx)(`button`,{type:`button`,"aria-label":E({id:`xCdTnb`}),"data-testid":`editor-new-tab-placeholder-close`,className:xP(Ne||t),tabIndex:SP(t),onClick:t=>{t.stopPropagation(),c(e)},children:(0,Z.jsx)(xs,{"aria-hidden":`true`,className:`size-3.5`})})]})},e)}let s=Yt(e),u=e===re,d=y.includes(e);if(s.kind===`folder`){let{baseName:t,label:r,prefix:o}=v(s.folderPath,`/`),c=`${o}${r}`;return(0,Z.jsx)(qP,{tabId:e,openTabs:T,closeTab:l,closeTabs:De,pinTab:_,pinnedTabIds:y,unpinTab:w,children:(0,Z.jsxs)(KP,{tabId:e,activateFromKeyboard:()=>a(e),"aria-current":u?`page`:void 0,"aria-keyshortcuts":i,"data-active-tab":u?`true`:void 0,className:Y(jP,u?MP:NP),onAuxClick:t=>{t.button===1&&(t.preventDefault(),!d&&l(e))},onClick:t=>{t.target===t.currentTarget&&a(e)},children:[(0,Z.jsxs)(`button`,{type:`button`,"aria-label":c,title:c,className:PP,onClick:()=>{a(e)},tabIndex:-1,children:[o&&(0,Z.jsx)(`span`,{className:Y(`min-w-0 flex-1 truncate`,u&&`text-muted-foreground`),children:o}),(0,Z.jsxs)(`span`,{className:Y(`flex min-w-0 items-center`,o?`max-w-[70%] shrink-0`:`flex-1`),children:[(0,Z.jsx)(`span`,{className:`min-w-0 truncate`,children:t}),(0,Z.jsx)(`span`,{className:`shrink-0`,children:`/`})]})]}),(0,Z.jsx)(JP,{accessibleLabel:c,closeTab:l,forceCloseVisible:Ne,isActive:u,isPinned:d,shortcutHint:n,tabId:e,unpinTab:w})]})},e)}if(s.kind===`asset`||s.kind===`skill-file`){let{baseName:t,label:r,prefix:o}=v(s.kind===`asset`?s.assetPath:s.path,``),c=`${o}${r}`;return(0,Z.jsx)(qP,{tabId:e,openTabs:T,closeTab:l,closeTabs:De,pinTab:_,pinnedTabIds:y,unpinTab:w,children:(0,Z.jsxs)(KP,{tabId:e,activateFromKeyboard:()=>a(e),"aria-current":u?`page`:void 0,"aria-keyshortcuts":i,"data-active-tab":u?`true`:void 0,className:Y(jP,u?MP:NP),onAuxClick:t=>{t.button===1&&(t.preventDefault(),!d&&l(e))},onClick:t=>{t.target===t.currentTarget&&a(e)},children:[(0,Z.jsxs)(`button`,{type:`button`,"aria-label":c,className:PP,onClick:()=>{a(e)},tabIndex:-1,children:[o?(0,Z.jsx)(`span`,{className:Y(`min-w-0 flex-1 truncate text-muted-foreground/60`,u&&`text-muted-foreground`),children:o}):null,(0,Z.jsx)(`span`,{className:Y(`min-w-0 truncate`,o?`max-w-[70%] shrink-0`:`flex-1`),children:t})]}),(0,Z.jsx)(JP,{accessibleLabel:c,closeTab:l,forceCloseVisible:Ne,isActive:u,isPinned:d,shortcutHint:n,tabId:e,unpinTab:w})]})},e)}let f=s.docName,p=D.get(f)?.docExt??`.md`,{baseName:m,extension:h,label:g,prefix:b}=v(f,p),x=`${b}${g}`,S=p===`.md`||p===`.mdx`,C=j?.tabId===e,O=`editor-tab-rename-error-${FP(f)}`;return(0,Z.jsx)(qP,{disabled:C,tabId:e,openTabs:T,closeTab:l,closeTabs:De,pinTab:_,pinnedTabIds:y,unpinTab:w,children:(0,Z.jsx)(KP,{tabId:e,activateFromKeyboard:()=>a(e),disabled:C,"aria-current":u?`page`:void 0,"aria-keyshortcuts":i,"data-active-tab":u?`true`:void 0,className:Y(jP,u?MP:NP,C&&F&&`border-destructive`),onAuxClick:t=>{t.button===1&&(t.preventDefault(),!d&&l(e))},onClick:t=>{t.target===t.currentTarget&&a(e)},children:C?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(qC,{className:`h-full min-w-0 flex-1 rounded-none border-0 bg-transparent dark:bg-transparent`,children:[(0,Z.jsx)(QC,{ref:V,value:N,disabled:L,"aria-label":E({id:`Dw1T_W`,values:{label:g}}),"data-testid":`editor-tab-rename-input`,"aria-invalid":F?!0:void 0,"aria-describedby":F?O:void 0,"aria-busy":L||void 0,title:F??f,className:`h-full min-w-0 px-2 py-0 font-medium text-foreground text-xs selection:bg-primary selection:text-primary-foreground`,onChange:e=>{P(RP(e.target.value,p)),I(null),W.current=null},onKeyDown:e=>{e.key===`Enter`?(e.preventDefault(),ye()):e.key===`Escape`&&(e.preventDefault(),ve())},onBlur:ye}),(0,Z.jsx)(YC,{align:`inline-end`,"aria-hidden":`true`,className:`pr-2 text-xs`,children:(0,Z.jsx)(ZC,{className:`text-muted-foreground/60 text-xs`,children:p})})]}),F?(0,Z.jsx)(`span`,{id:O,role:`alert`,className:`sr-only`,children:F}):null]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(XP,{accessibleLabel:x,activateTab:a,baseName:m,docName:f,enterRenameMode:_e,extension:h,hideDocExtension:S,tabId:e}),(0,Z.jsx)(JP,{accessibleLabel:x,closeTab:l,forceCloseVisible:Ne,isActive:u,isPinned:d,shortcutHint:n,tabId:e,unpinTab:w})]})})},e)}),Ze;e[60]!==qe||e[61]!==Je||e[62]!==Ye||e[63]!==Xe?(Ze=(0,Z.jsx)(qe,{items:Je,strategy:Ye,children:Xe}),e[60]=qe,e[61]=Je,e[62]=Ye,e[63]=Xe,e[64]=Ze):Ze=e[64];let Qe;e[65]!==We||e[66]!==Le||e[67]!==ze||e[68]!==Fe||e[69]!==Me||e[70]!==!1||e[71]!==Ge||e[72]!==Ke||e[73]!==Ze||e[74]!==Te?(Qe=(0,Z.jsx)(We,{sensors:Me,autoScroll:!1,collisionDetection:Ge,modifiers:Te,onDragStart:Fe,onDragEnd:ze,onDragCancel:Le,accessibility:Ke,children:Ze}),e[65]=We,e[66]=Le,e[67]=ze,e[68]=Fe,e[69]=Me,e[70]=!1,e[71]=Ge,e[72]=Ke,e[73]=Ze,e[74]=Te,e[75]=Qe):Qe=e[75];let $e;e[76]===E?$e=e[77]:($e=E({id:`3YvS-c`}),e[76]=E,e[77]=$e);let et;e[78]===Symbol.for(`react.memo_cache_sentinel`)?(et=(0,Z.jsx)(ge,{"aria-hidden":`true`}),e[78]=et):et=e[78];let tt;e[79]!==h||e[80]!==$e?(tt=(0,Z.jsx)(As,{asChild:!0,children:(0,Z.jsx)(X,{type:`button`,size:`icon-xs`,variant:`ghost`,"aria-label":$e,"data-testid":`editor-new-tab-button`,className:`first:mb-3 mb-1.5`,onClick:h,children:et})}),e[79]=h,e[80]=$e,e[81]=tt):tt=e[81];let nt;e[82]===Symbol.for(`react.memo_cache_sentinel`)?(nt=(0,Z.jsx)(js,{children:(0,Z.jsx)(J,{id:`3YvS-c`})}),e[82]=nt):nt=e[82];let rt;e[83]===tt?rt=e[84]:(rt=(0,Z.jsxs)(Ns,{children:[tt,nt]}),e[83]=tt,e[84]=rt);let it;e[85]!==Ue||e[86]!==Qe||e[87]!==rt?(it=(0,Z.jsxs)(`div`,{className:Ue,children:[Qe,rt]}),e[85]=Ue,e[86]=Qe,e[87]=rt,e[88]=it):it=e[88];let at;return e[89]!==Be||e[90]!==Ve||e[91]!==He||e[92]!==it?(at=(0,Z.jsx)(`div`,{ref:O,"data-electron-drag":Be,className:Ve,onWheel:He,children:it}),e[89]=Be,e[90]=Ve,e[91]=He,e[92]=it,e[93]=at):at=e[93],at}var QP=(e,t,n)=>{if(e&&`reportValidity`in e){let r=Ba(n,t);e.setCustomValidity(r&&r.message||``),e.reportValidity()}},$P=(e,t)=>{for(let n in t.fields){let r=t.fields[n];r&&r.ref&&`reportValidity`in r.ref?QP(r.ref,n,e):r&&r.refs&&r.refs.forEach(t=>QP(t,n,e))}},eF=(e,t)=>{t.shouldUseNativeValidation&&$P(e,t);let n={};for(let r in e){let i=Ba(t.fields,r),a=Object.assign(e[r]||{},{ref:i&&i.ref});if(tF(t.names||Object.keys(e),r)){let e=Object.assign({},Ba(n,r));oo(e,`root`,a),oo(n,r,e)}else oo(n,r,a)}return n},tF=(e,t)=>{let n=nF(t).replace(/[.*+?^${}()|\\]/g,`\\$&`);return e.some(e=>nF(e).match(`^${n}\\.\\d+`))};function nF(e){return e.replace(/[\[\]]/g,``)}function rF(){return rF=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},rF.apply(null,arguments)}function iF(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}function aF(e,t){for(var n={};e.length;){var r=e[0],i=r.code,a=r.message,o=r.path.join(`.`);if(!n[o])if(`unionErrors`in r){var s=r.unionErrors[0].errors[0];n[o]={message:s.message,type:s.code}}else n[o]={message:a,type:i};if(`unionErrors`in r&&r.unionErrors.forEach(function(t){return t.errors.forEach(function(t){return e.push(t)})}),t){var c=n[o].types,l=c&&c[r.code];n[o]=Ma(o,t,n,i,l?[].concat(l,r.message):r.message)}e.shift()}return n}function oF(e,t){for(var n={},r=function(){var r=e[0],i=r.code,a=r.message,o=r.path.join(`.`);if(!n[o])if(r.code===`invalid_union`&&r.errors.length>0){var s=r.errors[0][0];n[o]={message:s.message,type:s.code}}else n[o]={message:a,type:i};if(r.code===`invalid_union`&&r.errors.forEach(function(t){return t.forEach(function(t){return e.push(rF({},t,{path:[].concat(r.path,t.path)}))})}),t){var c=n[o].types,l=c&&c[r.code];n[o]=Ma(o,t,n,i,l?[].concat(l,r.message):r.message)}e.shift()};e.length;)r();return n}function sF(e,t,n){if(n===void 0&&(n={}),function(e){return`_def`in e&&typeof e._def==`object`&&`typeName`in e._def}(e))return function(r,i,a){try{return Promise.resolve(iF(function(){return Promise.resolve(e[n.mode===`sync`?`parse`:`parseAsync`](r,t)).then(function(e){return a.shouldUseNativeValidation&&$P({},a),{errors:{},values:n.raw?Object.assign({},r):e}})},function(e){if(function(e){return Array.isArray(e?.issues)}(e))return{values:{},errors:eF(aF(e.errors,!a.shouldUseNativeValidation&&a.criteriaMode===`all`),a)};throw e}))}catch(e){return Promise.reject(e)}};if(function(e){return`_zod`in e&&typeof e._zod==`object`}(e))return function(r,i,a){try{return Promise.resolve(iF(function(){return Promise.resolve((n.mode===`sync`?xr:yr)(e,r,t)).then(function(e){return a.shouldUseNativeValidation&&$P({},a),{errors:{},values:n.raw?Object.assign({},r):e}})},function(e){if(function(e){return e instanceof Sr}(e))return{values:{},errors:eF(oF(e.issues,!a.shouldUseNativeValidation&&a.criteriaMode===`all`),a)};throw e}))}catch(e){return Promise.reject(e)}};throw Error(`Invalid input: not a Zod schema`)}var cF=`https://openknowledge.ai/api/subscribe`;async function lF(e,t){try{let n=await fetch(cF,{method:`POST`,headers:{"content-type":`application/json`},body:JSON.stringify({email:e,source:t}),signal:AbortSignal.timeout(15e3)});return n.ok?{ok:!0}:n.status===400?{ok:!1,reason:`invalid`}:n.status===503?{ok:!1,reason:`unavailable`}:(console.warn(`[subscribe] action=submit result=http-error status=${n.status}`),{ok:!1,reason:`error`})}catch(e){return console.warn(`[subscribe] action=submit result=network-error message=${e instanceof Error?e.message:String(e)}`),{ok:!1,reason:`error`}}}function uF(e){let t=(0,$.c)(49),{source:n,title:r,description:i,onSuccess:a,onDismiss:o,autoFocus:s,compactSubmit:c,className:l}=e,{_:u}=an(),[d,f]=(0,Q.useState)(!1),p=(0,Q.useRef)(null),m,h;t[0]===d?(m=t[1],h=t[2]):(m=()=>{d&&p.current?.focus()},h=[d],t[0]=d,t[1]=m,t[2]=h),(0,Q.useEffect)(m,h);let g,_;if(t[3]!==u){let e=Qr({email:Yn({message:u({id:`Wq6Wcm`})})});_=Aa,g=sF(e),t[3]=u,t[4]=g,t[5]=_}else g=t[4],_=t[5];let v;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(v={email:``},t[6]=v):v=t[6];let y;t[7]===g?y=t[8]:(y={resolver:g,defaultValues:v},t[7]=g,t[8]=y);let b=_(y),{isSubmitting:x}=b.formState,S=b.formState.errors.email?.message??b.formState.errors.root?.message,C;t[9]!==u||t[10]!==b||t[11]!==a||t[12]!==n?(C=async function(e){b.clearErrors(`root`);let t=await lF(e.email,n);if(t.ok){f(!0),a?.();return}if(t.reason===`invalid`){b.setError(`email`,{message:u({id:`Wq6Wcm`})});return}if(t.reason===`unavailable`){b.setError(`root`,{message:u({id:`4mLBx9`})});return}b.setError(`root`,{message:u({id:`fWsBTs`})})},t[9]=u,t[10]=b,t[11]=a,t[12]=n,t[13]=C):C=t[13];let w=C,T;t[14]===l?T=t[15]:(T=Y(`flex flex-col gap-3`,l),t[14]=l,t[15]=T);let E=d?-1:void 0,D;t[16]!==d||t[17]!==r?(D=d?(0,Z.jsxs)(`span`,{className:`mb-1.5 inline-flex flex-row items-center gap-2`,children:[(0,Z.jsx)(Ji,{className:`size-4 text-primary`}),(0,Z.jsx)(J,{id:`PIMM5l`})]}):r??(0,Z.jsx)(J,{id:`GzPQ2f`}),t[16]=d,t[17]=r,t[18]=D):D=t[18];let O;t[19]!==D||t[20]!==E?(O=(0,Z.jsx)(`p`,{ref:p,tabIndex:E,className:`text-sm font-medium leading-tight text-foreground focus:outline-none`,children:D}),t[19]=D,t[20]=E,t[21]=O):O=t[21];let k;t[22]!==i||t[23]!==d?(k=d?(0,Z.jsx)(J,{id:`pBROkv`}):i??(0,Z.jsx)(J,{id:`WmPbvm`}),t[22]=i,t[23]=d,t[24]=k):k=t[24];let A;t[25]===k?A=t[26]:(A=(0,Z.jsx)(`p`,{className:`text-1sm text-muted-foreground`,role:`status`,children:k}),t[25]=k,t[26]=A);let j;t[27]!==O||t[28]!==A?(j=(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[O,A]}),t[27]=O,t[28]=A,t[29]=j):j=t[29];let M;t[30]!==u||t[31]!==o?(M=o?(0,Z.jsx)(X,{type:`button`,variant:`ghost`,size:`icon`,onClick:o,"aria-label":u({id:`yz7wBu`}),className:`-mr-1.5 -mt-1 size-7 shrink-0 text-muted-foreground opacity-60`,children:(0,Z.jsx)(xs,{className:`size-4`})}):null,t[30]=u,t[31]=o,t[32]=M):M=t[32];let N;t[33]!==j||t[34]!==M?(N=(0,Z.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[j,M]}),t[33]=j,t[34]=M,t[35]=N):N=t[35];let P;t[36]!==u||t[37]!==s||t[38]!==c||t[39]!==S||t[40]!==b||t[41]!==x||t[42]!==w||t[43]!==d?(P=d?null:(0,Z.jsxs)(`form`,{onSubmit:b.handleSubmit(w),className:`flex flex-col gap-2`,noValidate:!0,children:[(0,Z.jsx)(Wa,{control:b.control,name:`email`,render:e=>{let{field:t,fieldState:n}=e;return(0,Z.jsxs)(qC,{className:`h-10 rounded-xl`,children:[(0,Z.jsx)(YC,{className:`pl-2.5`,children:(0,Z.jsx)(rf,{className:`size-4 text-muted-foreground opacity-60`})}),(0,Z.jsx)(QC,{...t,id:t.name,type:`email`,inputMode:`email`,autoComplete:`email`,spellCheck:!1,autoFocus:s,placeholder:u({id:`2hYmUH`}),"aria-invalid":n.invalid,"aria-label":u({id:`ATGYL1`}),"data-testid":`subscribe-email`,className:`placeholder:text-muted-foreground/60`}),(0,Z.jsx)(X,{type:`submit`,disabled:x,size:c?`icon`:`default`,className:Y(`mr-1 ml-auto text-1sm`,c&&`size-8 shrink-0 rounded-lg`),"data-testid":`subscribe-submit`,children:x?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(is,{className:`size-3.5 animate-spin`,"aria-hidden":!0}),(0,Z.jsx)(`span`,{className:`sr-only`,children:(0,Z.jsx)(J,{id:`lCC_D5`})})]}):c?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(gt,{className:`size-4`,"aria-hidden":!0}),(0,Z.jsx)(`span`,{className:`sr-only`,children:(0,Z.jsx)(J,{id:`EDl9kS`})})]}):(0,Z.jsx)(J,{id:`EDl9kS`})})]})}}),S?(0,Z.jsx)(`p`,{className:`text-sm text-destructive`,role:`alert`,children:S}):null]}),t[36]=u,t[37]=s,t[38]=c,t[39]=S,t[40]=b,t[41]=x,t[42]=w,t[43]=d,t[44]=P):P=t[44];let F;return t[45]!==N||t[46]!==P||t[47]!==T?(F=(0,Z.jsxs)(`div`,{className:T,children:[N,P]}),t[45]=N,t[46]=P,t[47]=T,t[48]=F):F=t[48],F}var dF=`https://github.com/inkeep/open-knowledge`,fF=`https://discord.com/invite/YujKpFN49`,pF=`https://x.com/OpenKnowledge`,mF=`ok-subscribe-card-v1`,hF={subscribed:!1,dismissed:!1,shownVersions:[]};function gF(e,t){return!e.subscribed&&!e.dismissed&&e.shownVersions.length<3&&!e.shownVersions.includes(t)}function _F(e){return e===!0}function vF(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}function yF(e){if(typeof e!=`object`||!e)return hF;let t=e;return{subscribed:_F(t.subscribed),dismissed:_F(t.dismissed),shownVersions:vF(t.shownVersions)}}function bF(e){try{let t=(e??localStorage).getItem(mF);return t==null?hF:yF(JSON.parse(t))}catch(e){return console.warn(`[subscribe-card-store] readPersistedState failed (corrupt/privacy/SSR)`,e),hF}}function xF(e,t){try{(t??localStorage).setItem(mF,JSON.stringify(e))}catch(e){console.warn(`[subscribe-card-store] writePersistedState failed (quota/privacy/SSR)`,e)}}function SF(e){let t=bF(e),n=new Set,r=!1;function i(){for(let e of n)e()}function a(n){t=n,xF(t,e),i()}return{getSnapshot(){return t},subscribe(e){return n.add(e),()=>{n.delete(e)}},markSubscribed(){t.subscribed||a({...t,subscribed:!0})},dismiss(){t.dismissed||a({...t,dismissed:!0})},recordShown(e){t.shownVersions.includes(e)||a({...t,shownVersions:[...t.shownVersions,e]})},install(){r||(r=!0,t=bF(e),i())}}}var CF=SF();function wF(){CF.install()}function TF(e){let t=(0,$.c)(4),n,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsx)(`title`,{children:`Discord`}),r=(0,Z.jsx)(`path`,{d:`M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9554 2.4189-2.1568 2.4189Z`}),t[0]=n,t[1]=r):(n=t[0],r=t[1]);let i;return t[2]===e?i=t[3]:(i=(0,Z.jsxs)(`svg`,{role:`img`,fill:`currentColor`,height:24,width:24,viewBox:`0 0 24 24`,xmlns:`http://www.w3.org/2000/svg`,...e,children:[n,r]}),t[2]=e,t[3]=i),i}function EF(e){let t=(0,$.c)(4),n,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsx)(`title`,{children:`GitHub`}),r=(0,Z.jsx)(`path`,{d:`M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12`}),t[0]=n,t[1]=r):(n=t[0],r=t[1]);let i;return t[2]===e?i=t[3]:(i=(0,Z.jsxs)(`svg`,{role:`img`,fill:`currentColor`,height:24,width:24,viewBox:`0 0 24 24`,xmlns:`http://www.w3.org/2000/svg`,...e,children:[n,r]}),t[2]=e,t[3]=i),i}function DF(e){let t=(0,$.c)(4),n,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsx)(`title`,{children:`X (Twitter)`}),r=(0,Z.jsx)(`path`,{d:`M18.901 1.153h3.68l-8.04 9.19L24 22.846h-7.406l-5.8-7.584-6.638 7.584H.474l8.6-9.83L0 1.154h7.594l5.243 6.932ZM17.61 20.644h2.039L6.486 3.24H4.298Z`}),t[0]=n,t[1]=r):(n=t[0],r=t[1]);let i;return t[2]===e?i=t[3]:(i=(0,Z.jsxs)(`svg`,{role:`img`,fill:`currentColor`,height:24,width:24,viewBox:`0 0 24 24`,xmlns:`http://www.w3.org/2000/svg`,...e,children:[n,r]}),t[2]=e,t[3]=i),i}var OF=[{key:`resources`,heading:{id:`s-MGs7`},links:[{label:{id:`TbjyhA`},href:`https://openknowledge.ai/docs`,icon:We},{label:{id:`PCNIuJ`},href:`${dF}/issues/new`,icon:Od},{label:{id:`On0aF2`},href:`https://openknowledge.ai/`,icon:$i}]},{key:`community`,heading:{id:`chL5IG`},links:[{label:`Discord`,href:fF,icon:TF},{label:`X (Twitter)`,href:pF,icon:DF},{label:`GitHub`,href:dF,icon:EF}]}],kF=`${dF}/releases`,AF=`group flex items-center gap-2.5 rounded-md px-2 py-1.5 text-sm text-muted-foreground transition-colors hover:bg-azure-900/5 dark:hover:bg-white/20 hover:text-primary`;function jF(e){if(e<1e3)return String(e);let t=e/1e3;return`${t>=10?Math.round(t):t.toFixed(1)}k`}var MF=e=>{let t=(0,$.c)(12),{count:n}=e,{_:r}=an(),i,a,o,s;t[0]!==r||t[1]!==n?(i=jF(n),a=`img`,o=`ml-auto flex items-center gap-1 text-xs tabular-nums text-muted-foreground`,s=r({id:`SVLPt5`,values:{formatted:i}}),t[0]=r,t[1]=n,t[2]=i,t[3]=a,t[4]=o,t[5]=s):(i=t[2],a=t[3],o=t[4],s=t[5]);let c;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Z.jsx)(Af,{className:`size-3 fill-current`,"aria-hidden":`true`}),t[6]=c):c=t[6];let l;return t[7]!==i||t[8]!==a||t[9]!==o||t[10]!==s?(l=(0,Z.jsxs)(`span`,{role:a,className:o,"aria-label":s,children:[c,i]}),t[7]=i,t[8]=a,t[9]=o,t[10]=s,t[11]=l):l=t[11],l},NF=e=>{let t=(0,$.c)(15),{link:n,trailing:r}=e,{_:i}=an(),{label:a,href:o,icon:s}=n,c,l;t[0]===o?(c=t[1],l=t[2]):(c=e=>hu(e,o),l=e=>hu(e,o),t[0]=o,t[1]=c,t[2]=l);let u;t[3]===s?u=t[4]:(u=(0,Z.jsx)(s,{"aria-hidden":`true`,className:`size-4 shrink-0`}),t[3]=s,t[4]=u);let d;t[5]!==i||t[6]!==a?(d=typeof a==`string`?a:i(a),t[5]=i,t[6]=a,t[7]=d):d=t[7];let f;return t[8]!==o||t[9]!==c||t[10]!==l||t[11]!==u||t[12]!==d||t[13]!==r?(f=(0,Z.jsx)(`li`,{children:(0,Z.jsxs)(`a`,{href:o,target:`_blank`,rel:`noopener noreferrer`,onClick:c,onAuxClick:l,className:AF,children:[u,d,r]})}),t[8]=o,t[9]=c,t[10]=l,t[11]=u,t[12]=d,t[13]=r,t[14]=f):f=t[14],f},PF=e=>{let t=(0,$.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,Z.jsx)(`p`,{className:`font-mono tracking-wide uppercase text-muted-foreground text-xs mb-1`,children:n}),t[0]=n,t[1]=r),r},FF=()=>{let e=(0,$.c)(28),{_:t}=an(),[n,r]=(0,Q.useState)(!1),[i,a]=(0,Q.useState)(!1),[o,s]=(0,Q.useState)(null),c,l;e[0]!==n||e[1]!==o?(c=()=>{if(!n||o!==null)return;let e=new AbortController;return gi({signal:e.signal}).then(e=>{e!==null&&s(e)}),()=>e.abort()},l=[n,o],e[0]=n,e[1]=o,e[2]=c,e[3]=l):(c=e[2],l=e[3]),(0,Q.useEffect)(c,l);let u;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(u=e=>{r(e),e||a(!1)},e[4]=u):u=e[4];let d;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Z.jsx)(ft,{className:`size-4`}),e[5]=d):d=e[5];let f;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Z.jsx)(As,{asChild:!0,children:(0,Z.jsx)(Ie,{asChild:!0,children:(0,Z.jsxs)(X,{variant:`ghost`,size:`icon`,className:`size-7 hover:bg-accent text-muted-foreground`,children:[d,(0,Z.jsx)(`span`,{className:`sr-only`,children:(0,Z.jsx)(J,{id:`s-MGs7`})})]})})}),e[6]=f):f=e[6];let p;e[7]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Z.jsxs)(Ns,{children:[f,(0,Z.jsx)(js,{children:(0,Z.jsx)(J,{id:`s-MGs7`})})]}),e[7]=p):p=e[7];let m;e[8]!==t||e[9]!==o?(m=OF.map((e,n)=>(0,Z.jsxs)(`div`,{className:Y(n>0&&`mt-3`),children:[(0,Z.jsx)(PF,{children:t(e.heading)}),(0,Z.jsx)(`nav`,{"aria-label":t(e.heading),children:(0,Z.jsx)(`ul`,{className:`space-y-0.5`,children:e.links.map(e=>(0,Z.jsx)(NF,{link:e,trailing:e.href===`https://github.com/inkeep/open-knowledge`&&o!==null?(0,Z.jsx)(MF,{count:o}):void 0},e.href))})})]},e.key)),e[8]=t,e[9]=o,e[10]=m):m=e[10];let h;e[11]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,Z.jsx)(PF,{children:(0,Z.jsx)(J,{id:`arUUsK`})}),e[11]=h):h=e[11];let g;e[12]===t?g=e[13]:(g=t({id:`arUUsK`}),e[12]=t,e[13]=g);let _;e[14]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,Z.jsx)(NF,{link:{label:{id:`3ePd3I`},href:kF,icon:af}}),e[14]=_):_=e[14];let v;e[15]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,Z.jsx)(Ie,{asChild:!0,children:(0,Z.jsxs)(X,{variant:`ghost`,className:Y(AF,`h-auto w-full justify-start font-normal`),children:[(0,Z.jsx)(rf,{"aria-hidden":`true`,className:`size-4 shrink-0`}),(0,Z.jsx)(J,{id:`EDl9kS`})]})}),e[15]=v):v=e[15];let y;e[16]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Z.jsx)(Ut,{side:`left`,align:`center`,sideOffset:20,className:`w-80`,children:(0,Z.jsx)(uF,{source:`resources_menu`,autoFocus:!0,onDismiss:()=>a(!1),onSuccess:IF})}),e[16]=y):y=e[16];let b;e[17]===i?b=e[18]:(b=(0,Z.jsxs)(`ul`,{className:`space-y-0.5`,children:[_,(0,Z.jsx)(`li`,{children:(0,Z.jsxs)(Ne,{open:i,onOpenChange:a,children:[v,y]})})]}),e[17]=i,e[18]=b);let x;e[19]!==b||e[20]!==g?(x=(0,Z.jsxs)(`div`,{className:`mt-3`,children:[h,(0,Z.jsx)(`nav`,{"aria-label":g,children:b})]}),e[19]=b,e[20]=g,e[21]=x):x=e[21];let S;e[22]!==x||e[23]!==m?(S=(0,Z.jsxs)(Ut,{align:`end`,className:`w-56 p-3`,children:[m,x]}),e[22]=x,e[23]=m,e[24]=S):S=e[24];let C;return e[25]!==n||e[26]!==S?(C=(0,Z.jsxs)(Ne,{open:n,onOpenChange:u,children:[p,S]}),e[25]=n,e[26]=S,e[27]=C):C=e[27],C};function IF(){return CF.markSubscribed()}var LF=50,RF=()=>{let e=(0,$.c)(8),t=(0,Q.useRef)(null),n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=()=>{t.current===null&&(t.current=setTimeout(()=>{t.current=null,MC.preload()},LF))},e[0]=n):n=e[0];let r=n,i;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=()=>{t.current!==null&&(clearTimeout(t.current),t.current=null)},e[1]=i):i=e[1];let a=i,o,s;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=()=>()=>{t.current!==null&&clearTimeout(t.current)},s=[],e[2]=o,e[3]=s):(o=e[2],s=e[3]),(0,Q.useEffect)(o,s);let c,l;e[4]===Symbol.for(`react.memo_cache_sentinel`)?(c=()=>{a(),window.location.hash!==`#settings`&&(window.location.hash=Ja)},l=(0,Z.jsx)(Sf,{className:`size-4`}),e[4]=c,e[5]=l):(c=e[4],l=e[5]);let u;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Z.jsx)(As,{asChild:!0,children:(0,Z.jsxs)(X,{variant:`ghost`,size:`icon`,className:`size-7 hover:bg-accent text-muted-foreground`,"data-testid":`header-settings-button`,onMouseEnter:r,onMouseLeave:a,onFocus:r,onBlur:a,onClick:c,children:[l,(0,Z.jsx)(`span`,{className:`sr-only`,children:(0,Z.jsx)(J,{id:`Tz0i8g`})})]})}),e[6]=u):u=e[6];let d;return e[7]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Z.jsxs)(Ns,{children:[u,(0,Z.jsx)(js,{children:(0,Z.jsx)(J,{id:`Tz0i8g`})})]}),e[7]=d):d=e[7],d},zF=`https://openknowledge.ai/docs/features/share`;function BF(e){let t=(0,$.c)(50),{input:n,onClickWhenNoRemote:r}=e,{_:i}=an(),{status:a}=Pi(),[o,s]=(0,Q.useState)(!1),[c,l]=(0,Q.useState)(null),u=(0,Q.useRef)(null),d;t[0]===c?.autoCopyFailed?d=t[1]:(d=()=>{!c?.autoCopyFailed||!u.current||(u.current.focus(),u.current.select())},t[0]=c?.autoCopyFailed,t[1]=d);let f;t[2]===c?f=t[3]:(f=[c],t[2]=c,t[3]=f),(0,Q.useEffect)(d,f);let p=a?.hasRemote===!0,m=n===null,h=Ai(c?.freshness,a),g;t[4]!==i||t[5]!==o||t[6]!==p||t[7]!==n||t[8]!==r?(g=async function(){if(!o&&n!==null){s(!0),l(null);try{let e=await Ia({...n,hasRemote:p,onClickWhenNoRemote:r},{clipboardWrite:xa,toastSuccess:JF,toastError:qF,logEvent:KF});e.kind===`copied`?l({url:e.shareUrl,autoCopyFailed:!1,freshness:e.freshness}):e.kind===`clipboard-failed`&&l({url:e.shareUrl,autoCopyFailed:!0,freshness:e.freshness})}catch{bs.error(i({id:`u3YnKw`}))}s(!1)}},t[4]=i,t[5]=o,t[6]=p,t[7]=n,t[8]=r,t[9]=g):g=t[9];let _=g,v=c!==null,y;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(y=e=>{e||l(null)},t[10]=y):y=t[10];let b;t[11]!==i||t[12]!==n?.kind?(b=n?.kind===`folder`?i({id:`WR0y2O`}):i({id:`F4IYWe`}),t[11]=i,t[12]=n?.kind,t[13]=b):b=t[13];let x=o||m,S,C;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,Z.jsx)(Cf,{className:`size-3.5`,"aria-hidden":!0}),C=(0,Z.jsx)(J,{id:`Z8lGw6`}),t[14]=S,t[15]=C):(S=t[14],C=t[15]);let w;t[16]!==_||t[17]!==b||t[18]!==x?(w=(0,Z.jsx)(dt,{asChild:!0,children:(0,Z.jsxs)(X,{variant:`ghost`,size:`sm`,"aria-label":b,onClick:_,disabled:x,className:`gap-1.5 text-muted-foreground px-1.5`,"data-testid":`share-button`,children:[S,C]})}),t[16]=_,t[17]=b,t[18]=x,t[19]=w):w=t[19];let T=h?`w-96`:`w-80`,E;t[20]===T?E=t[21]:(E=Y(`flex flex-col gap-2`,T),t[20]=T,t[21]=E);let D;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,Z.jsx)(`p`,{className:`font-mono tracking-wide uppercase text-muted-foreground text-xs`,children:(0,Z.jsx)(J,{id:`Z8lGw6`})}),t[22]=D):D=t[22];let O;t[23]===c?.autoCopyFailed?O=t[24]:(O=c?.autoCopyFailed?(0,Z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:(0,Z.jsx)(J,{id:`ndeI89`})}):null,t[23]=c?.autoCopyFailed,t[24]=O);let k=c?.url??``,A;t[25]===i?A=t[26]:(A=i({id:`5-FeN2`}),t[25]=i,t[26]=A);let j;t[27]!==k||t[28]!==A?(j=(0,Z.jsx)(qc,{ref:u,readOnly:!0,value:k,onFocus:GF,onClick:WF,onContextMenu:UF,className:`select-all bg-muted font-mono text-xs text-muted-foreground`,"data-testid":`share-button-url`,"aria-label":A}),t[27]=k,t[28]=A,t[29]=j):j=t[29];let M=c?.url??``,N=c?.autoCopyFailed===!1,P;t[30]!==M||t[31]!==N?(P=(0,Z.jsx)(`div`,{className:`absolute inset-y-0 right-1 flex items-center`,children:(0,Z.jsx)(`div`,{className:`rounded-md bg-background/50 backdrop-blur-sm`,children:(0,Z.jsx)(W,{copyContent:M,clipboardWrite:xa,initialCopied:N})})}),t[30]=M,t[31]=N,t[32]=P):P=t[32];let F;t[33]!==j||t[34]!==P?(F=(0,Z.jsxs)(`div`,{className:`relative`,children:[j,P]}),t[33]=j,t[34]=P,t[35]=F):F=t[35];let I=c?.freshness,L=n?.kind??`doc`,R;t[36]!==a||t[37]!==I||t[38]!==L?(R=(0,Z.jsx)(Oi,{freshness:I,status:a,kind:L}),t[36]=a,t[37]=I,t[38]=L,t[39]=R):R=t[39];let z;t[40]===Symbol.for(`react.memo_cache_sentinel`)?(z=(0,Z.jsxs)(`a`,{href:zF,target:`_blank`,rel:`noopener noreferrer`,onClick:HF,onAuxClick:VF,className:`mt-2 flex items-center gap-1.5 self-start text-xs text-muted-foreground transition-colors hover:text-primary`,children:[(0,Z.jsx)(ft,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,Z.jsx)(J,{id:`aByJ8j`})]}),t[40]=z):z=t[40];let B;t[41]!==E||t[42]!==O||t[43]!==F||t[44]!==R?(B=(0,Z.jsxs)(Ut,{align:`end`,className:E,"data-testid":`share-button-popover`,children:[D,O,F,R,z]}),t[41]=E,t[42]=O,t[43]=F,t[44]=R,t[45]=B):B=t[45];let V;return t[46]!==w||t[47]!==B||t[48]!==v?(V=(0,Z.jsxs)(Ne,{open:v,onOpenChange:y,children:[w,B]}),t[46]=w,t[47]=B,t[48]=v,t[49]=V):V=t[49],V}function VF(e){return hu(e,zF)}function HF(e){return hu(e,zF)}function UF(e){return e.currentTarget.select()}function WF(e){return e.currentTarget.select()}function GF(e){return e.currentTarget.select()}function KF(e){return console.log(e)}function qF(e){e!==`Link ready but could not copy to clipboard.`&&bs.error(e)}function JF(e){return bs.success(e)}function YF(e){let t=(0,$.c)(35),{onSignIn:n,onSetIdentity:r,onOpenSearch:i}=e,{_:a}=an(),{activeDocName:o,activeTarget:s}=vt(),c=o?Or(o):null,{state:l,isDraggingRail:u}=Vj(),d=pg(),f;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(f=Nl(`toggle-files-sidebar`),t[0]=f):f=t[0];let p=f,m=Nl(`command-palette`),[h,g]=(0,Q.useState)(!1),_;bb0:{if(s?.kind===`folder`){let e;t[1]===s.folderPath?e=t[2]:(e=Na(s.folderPath),t[1]=s.folderPath,t[2]=e),_=e;break bb0}if(o&&!c){let e;t[3]===o?e=t[4]:(e=Va(o),t[3]=o,t[4]=e),_=e;break bb0}if(!s&&!o){let e;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(e=Na(``),t[5]=e):e=t[5],_=e;break bb0}_=null}let v=_,y=typeof window<`u`&&window.okDesktop!=null,b=l===`collapsed`,x=y?``:void 0,S=y&&b&&`pl-[var(--ok-titlebar-reserve-left,1rem)]`,C=y&&!u&&`motion-safe:transition-[padding] motion-safe:duration-200 motion-safe:ease-linear`,w;t[6]!==S||t[7]!==C?(w=Y(`flex h-12 shrink-0 items-center bg-muted/35 shadow-[inset_0_-1px_0_var(--border)]`,y&&`[-webkit-app-region:drag]`,S,C),t[6]=S,t[7]=C,t[8]=w):w=t[8];let T=!d&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(Ns,{children:[(0,Z.jsx)(As,{asChild:!0,children:(0,Z.jsx)(Kj,{className:Y(`-ml-1 shrink-0 text-muted-foreground`,y&&`[-webkit-app-region:no-drag]`)})}),(0,Z.jsx)(js,{children:l===`expanded`?(0,Z.jsx)(J,{id:`ZxXhLY`,values:{sidebarShortcut:p}}):(0,Z.jsx)(J,{id:`Zz25kq`,values:{sidebarShortcut:p}})})]}),b&&i&&(0,Z.jsxs)(Ns,{children:[(0,Z.jsx)(As,{asChild:!0,children:(0,Z.jsx)(X,{variant:`ghost`,size:`icon-sm`,onClick:i,"aria-label":a({id:`IN4UX8`,values:{searchShortcut:m}}),"data-telemetry-event":`ok.editor_header.search.click`,className:Y(`shrink-0 text-muted-foreground`,y&&`[-webkit-app-region:no-drag]`),children:(0,Z.jsx)(O,{"aria-hidden":`true`})})}),(0,Z.jsx)(js,{children:(0,Z.jsx)(J,{id:`IN4UX8`,values:{searchShortcut:m}})})]}),(0,Z.jsx)($a,{orientation:`vertical`,className:`mr-1 h-4 shrink-0 data-vertical:self-center`}),(0,Z.jsx)(ZP,{})]}),E;t[9]===T?E=t[10]:(E=(0,Z.jsx)(`div`,{className:`flex min-w-0 flex-1 items-center gap-1 px-3`,children:T}),t[9]=T,t[10]=E);let D;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(D=Y(`flex shrink-0 items-center justify-end gap-2 px-3`,y&&`[&>*]:[-webkit-app-region:no-drag]`),t[11]=D):D=t[11];let k;t[12]!==h||t[13]!==g||t[14]!==v||t[15]!==d?(k=!d&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(BF,{input:v,onClickWhenNoRemote:()=>g(!0)}),(0,Z.jsx)(Co,{open:h,onOpenChange:g})]}),t[12]=h,t[13]=g,t[14]=v,t[15]=d,t[16]=k):k=t[16];let A;t[17]!==r||t[18]!==n?(A=(0,Z.jsx)(eo,{onSignIn:n,onSetIdentity:r}),t[17]=r,t[18]=n,t[19]=A):A=t[19];let j,M,N;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,Z.jsx)(HN,{}),M=(0,Z.jsx)($a,{orientation:`vertical`,className:`h-4 shrink-0 data-vertical:self-center`}),N=(0,Z.jsx)(GN,{}),t[20]=j,t[21]=M,t[22]=N):(j=t[20],M=t[21],N=t[22]);let P;t[23]===d?P=t[24]:(P=!d&&(0,Z.jsx)(RF,{}),t[23]=d,t[24]=P);let F;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,Z.jsx)(FF,{}),t[25]=F):F=t[25];let I;t[26]!==k||t[27]!==A||t[28]!==P?(I=(0,Z.jsxs)(`div`,{className:D,children:[k,A,j,M,N,P,F]}),t[26]=k,t[27]=A,t[28]=P,t[29]=I):I=t[29];let L;return t[30]!==I||t[31]!==x||t[32]!==w||t[33]!==E?(L=(0,Z.jsxs)(`header`,{"data-electron-drag":x,className:w,children:[E,I]}),t[30]=I,t[31]=x,t[32]=w,t[33]=E,t[34]=L):L=t[34],L}var XF=`open-knowledge:terminal-launch`;function ZF(e,t,n=typeof window>`u`?new EventTarget:window){n.dispatchEvent(new CustomEvent(XF,{detail:{prompt:e,cli:t}}))}function QF(e,t=typeof window>`u`?new EventTarget:window){let n=t=>{let n=t instanceof CustomEvent?t.detail:void 0;n&&typeof n.prompt==`string`&&e(n.prompt,n.cli)};return t.addEventListener(XF,n),()=>t.removeEventListener(XF,n)}function $F(e){let t=(0,$.c)(10),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?`horizontal`:i,o;t[4]===n?o=t[5]:(o=Y(`group/tabs flex gap-2 data-horizontal:flex-col`,n),t[4]=n,t[5]=o);let s;return t[6]!==a||t[7]!==r||t[8]!==o?(s=(0,Z.jsx)(nm,{"data-slot":`tabs`,"data-orientation":a,className:o,...r}),t[6]=a,t[7]=r,t[8]=o,t[9]=s):s=t[9],s}var eI=Si(`group/tabs-list inline-flex w-fit items-center justify-center rounded-lg p-[3px] text-muted-foreground group-data-horizontal/tabs:h-8 group-data-vertical/tabs:h-fit group-data-vertical/tabs:flex-col data-[variant=line]:rounded-none`,{variants:{variant:{default:`bg-muted`,line:`gap-1 bg-transparent`}},defaultVariants:{variant:`default`}});function tI(e){let t=(0,$.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,variant:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?`default`:i,o;t[4]!==n||t[5]!==a?(o=Y(eI({variant:a}),n),t[4]=n,t[5]=a,t[6]=o):o=t[6];let s;return t[7]!==r||t[8]!==o||t[9]!==a?(s=(0,Z.jsx)(rm,{"data-slot":`tabs-list`,"data-variant":a,className:o,...r}),t[7]=r,t[8]=o,t[9]=a,t[10]=s):s=t[10],s}function nI(e){let t=(0,$.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=Y(`relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-1.5 py-0.5 text-sm font-medium whitespace-nowrap text-foreground/60 transition-all group-data-vertical/tabs:w-full group-data-vertical/tabs:justify-start hover:text-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 focus-visible:outline-1 focus-visible:outline-ring disabled:pointer-events-none disabled:opacity-50 has-data-[icon=inline-end]:pr-1 has-data-[icon=inline-start]:pl-1 dark:text-muted-foreground dark:hover:text-foreground group-data-[variant=default]/tabs-list:data-active:shadow-sm group-data-[variant=line]/tabs-list:data-active:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,`group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-active:bg-transparent dark:group-data-[variant=line]/tabs-list:data-active:border-transparent dark:group-data-[variant=line]/tabs-list:data-active:bg-transparent`,`data-active:bg-background data-active:text-foreground dark:data-active:border-input dark:data-active:bg-input/30 dark:data-active:text-foreground`,`after:absolute after:bg-foreground after:opacity-0 after:transition-opacity group-data-horizontal/tabs:after:inset-x-0 group-data-horizontal/tabs:after:bottom-[-5px] group-data-horizontal/tabs:after:h-0.5 group-data-vertical/tabs:after:inset-y-0 group-data-vertical/tabs:after:-right-1 group-data-vertical/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-active:after:opacity-100`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(im,{"data-slot":`tabs-trigger`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function rI(e){let t=(0,$.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=Y(`flex-1 text-sm outline-none`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(am,{"data-slot":`tabs-content`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var iI=(0,Q.lazy)(()=>n(()=>import(`./TerminalPanel-Cfp4xEGm.js`).then(e=>({default:e.TerminalPanel})),__vite__mapDeps([91,1,10,3,11,6,7,13,56,16,37,92,65,32,33,93]),import.meta.url));function aI(e){let t=(0,$.c)(14),{bridge:n,onClose:r,onTitleChange:i,launch:a,adoptPtyId:o,onPtyId:s}=e,c=a===void 0?null:a,l=o===void 0?null:o,{enabled:u,synced:d}=So(),f=wo(),{_:p}=an(),m=d&&u===!1,h;t[0]!==p||t[1]!==f?(h=function(){if(f===null){bs.error(p({id:`V_6bJ4`}));return}let e=f(!0);e.ok||bs.error(p({id:`jKd3AP`,values:{0:e.error}}))},t[0]=p,t[1]=f,t[2]=h):h=t[2];let _=h;if(d&&!m){let e;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(`div`,{className:`h-full w-full bg-background`,"aria-hidden":`true`}),t[3]=e):e=t[3];let a;return t[4]!==l||t[5]!==n||t[6]!==c||t[7]!==r||t[8]!==s||t[9]!==i?(a=(0,Z.jsx)(g,{fallbackRender:sI,onError:oI,children:(0,Z.jsx)(Q.Suspense,{fallback:e,children:(0,Z.jsx)(iI,{bridge:n,className:`h-full`,onClose:r,onTitleChange:i,launch:c,adoptPtyId:l,onPtyId:s})})}),t[4]=l,t[5]=n,t[6]=c,t[7]=r,t[8]=s,t[9]=i,t[10]=a):a=t[10],a}let v;return t[11]!==_||t[12]!==m?(v=m?(0,Z.jsx)(uI,{onEnable:_}):(0,Z.jsx)(`div`,{className:`h-full w-full bg-background`,"aria-hidden":`true`}),t[11]=_,t[12]=m,t[13]=v):v=t[13],v}function oI(e,t){console.error(`[TerminalGate] rendered fallback for the terminal panel`,e,t.componentStack)}function sI(e){return(0,Z.jsx)(cI,{...e})}function cI(e){let t=(0,$.c)(15),{error:n}=e,{_:r}=an(),i;t[0]!==r||t[1]!==n?(i=n instanceof Error&&/dynamically imported module|Failed to fetch/i.test(n.message)?r({id:`Y8ViJx`}):r({id:`fbsiBw`}),t[0]=r,t[1]=n,t[2]=i):i=t[2];let a=i,o;t[3]===r?o=t[4]:(o=r({id:`6MnZEC`}),t[3]=r,t[4]=o);let s;t[5]===a?s=t[6]:(s=(0,Z.jsx)(`p`,{className:`max-w-sm text-sm text-foreground`,children:a}),t[5]=a,t[6]=s);let c;t[7]===r?c=t[8]:(c=r({id:`HpK_8d`}),t[7]=r,t[8]=c);let l;t[9]===c?l=t[10]:(l=(0,Z.jsx)(X,{onClick:lI,children:c}),t[9]=c,t[10]=l);let u;return t[11]!==o||t[12]!==s||t[13]!==l?(u=(0,Z.jsxs)(`section`,{"aria-label":o,className:`flex h-full w-full flex-col items-center justify-center gap-3 bg-background p-6 text-center`,role:`alert`,children:[s,l]}),t[11]=o,t[12]=s,t[13]=l,t[14]=u):u=t[14],u}function lI(){return window.location.reload()}function uI(e){let t=(0,$.c)(20),{onEnable:n}=e,{_:r}=an(),i;t[0]===r?i=t[1]:(i=r({id:`_XWY2J`}),t[0]=r,t[1]=i);let a;t[2]===r?a=t[3]:(a=r({id:`oYepHb`}),t[2]=r,t[3]=a);let o;t[4]===a?o=t[5]:(o=(0,Z.jsx)(`p`,{className:`max-w-sm text-sm text-foreground`,children:a}),t[4]=a,t[5]=o);let s;t[6]===r?s=t[7]:(s=r({id:`v2ZW0K`}),t[6]=r,t[7]=s);let c;t[8]!==n||t[9]!==s?(c=(0,Z.jsx)(X,{onClick:n,children:s}),t[8]=n,t[9]=s,t[10]=c):c=t[10];let l;t[11]===r?l=t[12]:(l=r({id:`ICoNYz`}),t[11]=r,t[12]=l);let u;t[13]===l?u=t[14]:(u=(0,Z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:l}),t[13]=l,t[14]=u);let d;return t[15]!==i||t[16]!==o||t[17]!==c||t[18]!==u?(d=(0,Z.jsxs)(`section`,{"aria-label":i,className:`flex h-full w-full flex-col items-center justify-center gap-3 bg-background p-6 text-center`,children:[o,c,u]}),t[15]=i,t[16]=o,t[17]=c,t[18]=u,t[19]=d):d=t[19],d}function dI(e){let t=(0,$.c)(48),{selected:n,onLaunchSelected:r,onPickCli:i,onPickTerminal:a,className:o}=e,{_:s}=an(),c=n===`terminal`,l;t[0]!==s||t[1]!==c||t[2]!==n?(l=s(c?{id:`AB4qw9`}:{id:`nP-KFo`,values:{0:mi[n].displayName}}),t[0]=s,t[1]=c,t[2]=n,t[3]=l):l=t[3];let u=l,d;t[4]===o?d=t[5]:(d=Y(`flex shrink-0 items-center`,o),t[4]=o,t[5]=d);let f;t[6]!==c||t[7]!==n?(f=c?(0,Z.jsx)(Of,{"aria-hidden":`true`,className:`size-3.5`}):(0,Z.jsx)(fa,{id:da(n),className:`size-3.5`,"aria-hidden":`true`}),t[6]=c,t[7]=n,t[8]=f):f=t[8];let p;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Z.jsx)(ge,{"aria-hidden":`true`,className:`size-3`}),t[9]=p):p=t[9];let m;t[10]!==r||t[11]!==u||t[12]!==f?(m=(0,Z.jsx)(As,{asChild:!0,children:(0,Z.jsxs)(X,{type:`button`,variant:`ghost`,size:`xs`,"aria-label":u,"data-testid":`terminal-new-chat`,className:`cursor-pointer gap-0.5 rounded-r-none px-1.5 text-muted-foreground hover:text-foreground`,onClick:r,children:[f,p]})}),t[10]=r,t[11]=u,t[12]=f,t[13]=m):m=t[13];let h;t[14]===u?h=t[15]:(h=(0,Z.jsx)(js,{side:`bottom`,sideOffset:8,children:u}),t[14]=u,t[15]=h);let g;t[16]!==m||t[17]!==h?(g=(0,Z.jsxs)(Ns,{children:[m,h]}),t[16]=m,t[17]=h,t[18]=g):g=t[18];let _;t[19]===s?_=t[20]:(_=s({id:`QJaG-9`}),t[19]=s,t[20]=_);let v;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,Z.jsx)(Yi,{"aria-hidden":`true`,className:`size-3`}),t[21]=v):v=t[21];let y;t[22]===_?y=t[23]:(y=(0,Z.jsx)(bc,{asChild:!0,children:(0,Z.jsx)(X,{type:`button`,variant:`ghost`,size:`icon-xs`,"aria-label":_,"data-testid":`terminal-new-chat-menu`,className:`cursor-pointer rounded-l-none text-muted-foreground hover:text-foreground`,children:v})}),t[22]=_,t[23]=y);let b;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(b=(0,Z.jsx)(Nc,{children:(0,Z.jsx)(J,{id:`hIQkLb`})}),t[24]=b):b=t[24];let x;t[25]!==s||t[26]!==i||t[27]!==n?(x=Ca.map(e=>{let{displayName:t}=mi[e];return(0,Z.jsxs)(Sc,{onSelect:()=>i(e),"data-testid":`terminal-new-chat-cli-${e}`,"aria-label":s({id:`9mEZeD`,values:{name:t}}),"aria-current":n===e?`true`:void 0,children:[(0,Z.jsx)(fa,{id:da(e),className:`size-4`,"aria-hidden":`true`}),(0,Z.jsx)(`span`,{className:`flex-1`,children:t}),n===e?(0,Z.jsx)(Ji,{"aria-hidden":`true`,className:`size-4 text-muted-foreground`}):null]},e)}),t[25]=s,t[26]=i,t[27]=n,t[28]=x):x=t[28];let S;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,Z.jsx)(Fc,{}),t[29]=S):S=t[29];let C=c?`true`:void 0,w;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,Z.jsx)(Of,{"aria-hidden":`true`,className:`size-4`}),t[30]=w):w=t[30];let T;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(T=(0,Z.jsx)(`span`,{className:`flex-1`,children:(0,Z.jsx)(J,{id:`ALhMYW`})}),t[31]=T):T=t[31];let E;t[32]===c?E=t[33]:(E=c?(0,Z.jsx)(Ji,{"aria-hidden":`true`,className:`size-4 text-muted-foreground`}):null,t[32]=c,t[33]=E);let D;t[34]!==a||t[35]!==C||t[36]!==E?(D=(0,Z.jsxs)(Sc,{onSelect:a,"data-testid":`terminal-new-chat-terminal`,"aria-current":C,children:[w,T,E]}),t[34]=a,t[35]=C,t[36]=E,t[37]=D):D=t[37];let O;t[38]!==x||t[39]!==D?(O=(0,Z.jsxs)(wc,{align:`start`,className:`min-w-[180px]`,children:[b,x,S,D]}),t[38]=x,t[39]=D,t[40]=O):O=t[40];let k;t[41]!==y||t[42]!==O?(k=(0,Z.jsxs)(Ac,{children:[y,O]}),t[41]=y,t[42]=O,t[43]=k):k=t[43];let A;return t[44]!==d||t[45]!==k||t[46]!==g?(A=(0,Z.jsxs)(`div`,{className:d,children:[g,k]}),t[44]=d,t[45]=k,t[46]=g,t[47]=A):A=t[47],A}var fI=`[data-terminal-tab-sortable]`;function pI(e){let t=(0,$.c)(17),{id:n,disabled:r,isActive:i,children:a}=e,o;t[0]!==r||t[1]!==n?(o={id:n,disabled:r},t[0]=r,t[1]=n,t[2]=o):o=t[2];let{setNodeRef:s,listeners:c,rect:l,transform:u,transition:d,isDragging:f}=es(o),p=l.current?.width,m;t[3]!==f||t[4]!==p||t[5]!==u||t[6]!==d?(m=EP({activeWidth:p,isDragging:f,transform:u,transition:d}),t[3]=f,t[4]=p,t[5]=u,t[6]=d,t[7]=m):m=t[7];let h=m,g=i?`bg-muted`:`hover:bg-muted/50`,_=f&&`z-10`,v;t[8]!==g||t[9]!==_?(v=Y(`group flex shrink-0 cursor-default items-center rounded-md pr-0.5 transition-colors`,g,_),t[8]=g,t[9]=_,t[10]=v):v=t[10];let y;return t[11]!==a||t[12]!==c||t[13]!==s||t[14]!==h||t[15]!==v?(y=(0,Z.jsx)(`div`,{ref:s,"data-terminal-tab-sortable":``,style:h,className:v,...c,children:a}),t[11]=a,t[12]=c,t[13]=s,t[14]=h,t[15]=v,t[16]=y):y=t[16],y}function mI(e){let t=(0,$.c)(84),{sessions:n,activeSessionId:r,onSelect:i,onTabActivate:a,newChatSelected:o,onNewChatLaunch:s,onNewChatPickCli:c,onNewChatPickTerminal:l,onClose:u,onRename:d,onReorder:f,onDragActiveChange:p,dockPosition:m,onToggleDock:h,onCollapse:g,children:_,className:v,draggable:y}=e,{_:b}=an(),x=m===`right`,[S,C]=(0,Q.useState)(null),[w,T]=(0,Q.useState)(``),E=(0,Q.useRef)(null),D=(0,Q.useRef)(!1),O=d!=null,k,A;t[0]===S?(k=t[1],A=t[2]):(k=()=>{S!=null&&(E.current?.focus(),E.current?.select())},A=[S],t[0]=S,t[1]=k,t[2]=A),(0,Q.useEffect)(k,A);let j,M;t[3]!==S||t[4]!==n?(j=()=>{S!=null&&!n.some(e=>e.id===S)&&(D.current=!1,C(null),T(``))},M=[n,S],t[3]=S,t[4]=n,t[5]=j,t[6]=M):(j=t[5],M=t[6]),(0,Q.useEffect)(j,M);let N=function(e){O&&(D.current=!1,C(e.id),T(e.label))},P;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(P=function(e){let t=typeof CSS<`u`&&CSS.escape?CSS.escape(e):e;queueMicrotask(()=>{document.querySelector(`[role="tab"][data-tab-id="${t}"]`)?.focus()})},t[7]=P):P=t[7];let F=P,I=function(e){D.current||d?.(e,w.trim()),D.current=!1,C(null),T(``),F(e)},L=(0,Q.useRef)(null),[R,z]=(0,Q.useState)(null),B;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(B={activationConstraint:{distance:8}},t[8]=B):B=t[8];let V=ts(Ho(Ko,B)),H=f!=null,U;t[9]===R?U=t[10]:(U=OP(R),t[9]=R,t[10]=U);let W;t[11]===U?W=t[12]:(W=[U],t[11]=U,t[12]=W);let G=W,K;t[13]===p?K=t[14]:(K=function(){z(DP(L.current,fI)),p?.(!0)},t[13]=p,t[14]=K);let ee=K,te;t[15]!==p||t[16]!==f||t[17]!==n?(te=function(e){z(null),p?.(!1);let t=String(e.active.id),r=e.over?String(e.over.id):null;if(!r||t===r)return;let i=n.map(gI),a=i.indexOf(t),o=i.indexOf(r);a<0||o<0||a===o||f?.(Qo(i,a,o))},t[15]=p,t[16]=f,t[17]=n,t[18]=te):te=t[18];let ne=te,re;t[19]===p?re=t[20]:(re=function(){z(null),p?.(!1)},t[19]=p,t[20]=re);let ie=re,ae=$F,oe;t[21]===v?oe=t[22]:(oe=Y(`flex min-h-0 min-w-0 flex-1 flex-col`,v),t[21]=v,t[22]=oe);let se=y?``:void 0,ce=y&&`h-[62px] [-webkit-app-region:drag] pr-[22px] pl-[calc(var(--ok-titlebar-reserve-left,1rem)+0.75rem)]`,le;t[23]===ce?le=t[24]:(le=Y(`flex shrink-0 flex-row items-center gap-1 px-1.5 py-1`,ce),t[23]=ce,t[24]=le);let q=tI,ue;t[25]===b?ue=t[26]:(ue=b({id:`1MGRQl`}),t[25]=b,t[26]=ue);let de=y&&`[-webkit-app-region:no-drag]`,fe;t[27]===de?fe=t[28]:(fe=Y(`flex h-auto min-w-0 items-center justify-start gap-0.5 overflow-x-auto bg-transparent p-0 [scrollbar-width:none] scroll-fade-mask-x`,de),t[27]=de,t[28]=fe);let pe=Wo,me=kP,he;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(he={container:typeof document<`u`?document.body:void 0},t[29]=he):he=t[29];let ge=Xo,_e;t[30]===n?_e=t[31]:(_e=n.map(hI),t[30]=n,t[31]=_e);let ve=Uo,ye=n.map(e=>{let t=e.id===r;return(0,Z.jsx)(pI,{id:e.id,disabled:!H||S!=null,isActive:t,children:S===e.id?(0,Z.jsx)(qC,{className:Y(`h-7 w-40 rounded-md border-0 bg-transparent dark:bg-transparent`,y&&`[-webkit-app-region:no-drag]`),children:(0,Z.jsx)(QC,{ref:E,value:w,"aria-label":b({id:`0TnCvC`,values:{0:e.label}}),"data-testid":`terminal-tab-rename-input`,className:`h-7 px-2 text-xs`,onChange:e=>T(e.target.value),onKeyDown:e=>{e.key===`Enter`?(e.preventDefault(),E.current?.blur()):e.key===`Escape`&&(e.preventDefault(),D.current=!0,E.current?.blur())},onBlur:()=>I(e.id)})}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(Ns,{children:[(0,Z.jsx)(As,{asChild:!0,children:(0,Z.jsx)(nI,{value:e.id,"data-tab-id":e.id,onClick:t=>{t.detail>=2||a?.(e.id)},onDoubleClick:()=>N(e),onKeyDown:t=>{t.key===`F2`&&(t.preventDefault(),N(e))},className:Y(`h-7 flex-none rounded-md px-2 text-xs`,y&&`[-webkit-app-region:no-drag]`),children:(0,Z.jsx)(`span`,{className:`max-w-40 truncate`,children:e.label})})}),(0,Z.jsx)(js,{side:`bottom`,sideOffset:8,children:e.label})]}),(0,Z.jsx)(X,{type:`button`,variant:`ghost`,size:`icon-xs`,"aria-label":b({id:`nzHlj8`,values:{0:e.label}}),tabIndex:t?0:-1,className:Y(`text-muted-foreground opacity-0 transition-opacity hover:text-foreground group-hover:opacity-100 group-focus-within:opacity-100`,t&&`opacity-100`,y&&`[-webkit-app-region:no-drag]`),onClick:t=>{t.stopPropagation(),u(e.id)},children:(0,Z.jsx)(xs,{"aria-hidden":`true`})})]})},e.id)}),be;t[32]!==ge||t[33]!==_e||t[34]!==ve||t[35]!==ye?(be=(0,Z.jsx)(ge,{items:_e,strategy:ve,children:ye}),t[32]=ge,t[33]=_e,t[34]=ve,t[35]=ye,t[36]=be):be=t[36];let xe;t[37]!==pe||t[38]!==ie||t[39]!==ne||t[40]!==ee||t[41]!==G||t[42]!==V||t[43]!==!1||t[44]!==me||t[45]!==he||t[46]!==be?(xe=(0,Z.jsx)(pe,{sensors:V,autoScroll:!1,collisionDetection:me,modifiers:G,onDragStart:ee,onDragEnd:ne,onDragCancel:ie,accessibility:he,children:be}),t[37]=pe,t[38]=ie,t[39]=ne,t[40]=ee,t[41]=G,t[42]=V,t[43]=!1,t[44]=me,t[45]=he,t[46]=be,t[47]=xe):xe=t[47];let Se;t[48]!==q||t[49]!==ue||t[50]!==fe||t[51]!==xe?(Se=(0,Z.jsx)(q,{variant:`line`,"aria-label":ue,className:fe,children:xe}),t[48]=q,t[49]=ue,t[50]=fe,t[51]=xe,t[52]=Se):Se=t[52];let Ce=y&&`[-webkit-app-region:no-drag]`,we;t[53]===Ce?we=t[54]:(we=Y(`shrink-0`,Ce),t[53]=Ce,t[54]=we);let Te;t[55]!==o||t[56]!==s||t[57]!==c||t[58]!==l||t[59]!==we?(Te=(0,Z.jsx)(dI,{selected:o,onLaunchSelected:s,onPickCli:c,onPickTerminal:l,className:we}),t[55]=o,t[56]=s,t[57]=c,t[58]=l,t[59]=we,t[60]=Te):Te=t[60];let Ee;t[61]===Symbol.for(`react.memo_cache_sentinel`)?(Ee=(0,Z.jsx)(`div`,{className:`flex-1`}),t[61]=Ee):Ee=t[61];let De;t[62]!==b||t[63]!==h||t[64]!==x?(De=h==null?null:(0,Z.jsxs)(Ns,{children:[(0,Z.jsx)(As,{asChild:!0,children:(0,Z.jsx)(X,{type:`button`,variant:`ghost`,size:`icon-xs`,"aria-label":b(x?{id:`rf6x3F`}:{id:`QNxpRm`}),className:`shrink-0 cursor-pointer text-muted-foreground hover:text-foreground`,onClick:h,children:x?(0,Z.jsx)(lf,{"aria-hidden":`true`}):(0,Z.jsx)(pf,{"aria-hidden":`true`})})}),(0,Z.jsx)(js,{side:`bottom`,sideOffset:8,children:x?(0,Z.jsx)(J,{id:`rf6x3F`}):(0,Z.jsx)(J,{id:`QNxpRm`})})]}),t[62]=b,t[63]=h,t[64]=x,t[65]=De):De=t[65];let Oe;t[66]!==b||t[67]!==g||t[68]!==x?(Oe=g==null?null:(0,Z.jsxs)(Ns,{children:[(0,Z.jsx)(As,{asChild:!0,children:(0,Z.jsx)(X,{type:`button`,variant:`ghost`,size:`icon-xs`,"aria-label":b({id:`VZGGPK`}),className:`shrink-0 cursor-pointer text-muted-foreground hover:text-foreground`,onClick:g,children:x?(0,Z.jsx)(Zi,{"aria-hidden":`true`}):(0,Z.jsx)(Yi,{"aria-hidden":`true`})})}),(0,Z.jsx)(js,{side:`bottom`,sideOffset:8,children:(0,Z.jsx)(J,{id:`VZGGPK`})})]}),t[66]=b,t[67]=g,t[68]=x,t[69]=Oe):Oe=t[69];let ke;t[70]!==se||t[71]!==le||t[72]!==Se||t[73]!==Te||t[74]!==De||t[75]!==Oe?(ke=(0,Z.jsxs)(`div`,{ref:L,"data-electron-drag":se,className:le,children:[Se,Te,Ee,De,Oe]}),t[70]=se,t[71]=le,t[72]=Se,t[73]=Te,t[74]=De,t[75]=Oe,t[76]=ke):ke=t[76];let Ae;return t[77]!==ae||t[78]!==r||t[79]!==_||t[80]!==i||t[81]!==oe||t[82]!==ke?(Ae=(0,Z.jsxs)(ae,{value:r,onValueChange:i,className:oe,children:[ke,_]}),t[77]=ae,t[78]=r,t[79]=_,t[80]=i,t[81]=oe,t[82]=ke,t[83]=Ae):Ae=t[83],Ae}function hI(e){return e.id}function gI(e){return e.id}function _I(e){return`terminal-session-${e}`}function vI(e){e!==``&&document.querySelector(`[data-terminal-session="${e}"] .xterm-helper-textarea`)?.focus()}function yI(e){return e?.contains(document.activeElement)??!1}function bI(e,t){return t===`window`||yI(e)}function xI(e){let t=(0,$.c)(61),{bridge:n,variant:r,visible:i,onVisibleChange:a,launch:o,installedClis:s,container:c,isShowing:l,onRequestEditorFocus:u,dockPosition:d,onToggleDock:f,onHasSessionsChange:p}=e,m=r===void 0?`dock`:r,h=o===void 0?null:o,{_:g}=an(),[_]=(0,Q.useState)(MI),v,y;t[0]!==c||t[1]!==_?(v=()=>{_==null||c==null||_.parentElement!==c&&c.appendChild(_)},y=[_,c],t[0]=c,t[1]=_,t[2]=v,t[3]=y):(v=t[2],y=t[3]),(0,Q.useLayoutEffect)(v,y);let b=typeof n.terminal?.list==`function`,x;t[4]!==b||t[5]!==h||t[6]!==i?(x=()=>!b&&i?[{id:_I(1),launch:h,title:null,customLabel:null,ordinal:1,adoptPtyId:null}]:[],t[4]=b,t[5]=h,t[6]=i,t[7]=x):x=t[7];let[S,C]=(0,Q.useState)(x),w;t[8]!==b||t[9]!==i?(w=()=>!b&&i?_I(1):``,t[8]=b,t[9]=i,t[10]=w):w=t[10];let[T,E]=(0,Q.useState)(w),[D,O]=(0,Q.useState)(!b),k=(0,Q.useRef)(!1),A=(0,Q.useRef)(T),j=(0,Q.useRef)(S),M=(0,Q.useRef)(!b&&i?1:0),N=(0,Q.useRef)(i&&h?h.nonce:null),P=(0,Q.useRef)(m===`window`?!1:i),F=(0,Q.useRef)(new Map),I=function(e,t){if(t===null){F.current.delete(e);return}F.current.set(e,t);let r=j.current.find(t=>t.id===e);r!=null&&n.terminal?.setMeta?.(t,{ordinal:r.ordinal,customLabel:r.customLabel})},L=(0,Q.useRef)(0),R=function(e){M.current+=1;let t=_I(M.current);C(n=>[...n,{id:t,launch:e,title:null,customLabel:null,ordinal:M.current,adoptPtyId:null}]),E(t)},[z,B]=(0,Q.useState)(jI),[V,H]=(0,Q.useState)(AI),U;t[11]===s?U=t[12]:(U=s??{},t[11]=s,t[12]=U);let W=h_(z,U),G=V?`terminal`:W,K=function(e){L.current+=1,R({prompt:null,cli:e,nonce:L.current})},ee=function(){V?R(null):K(W)},te=function(e){H(!1),w_(!1);let t=l_(e);B(t),p_(t),K(e)},ne=function(){H(!0),w_(!0),R(null)},re;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(re=function(e,t){let n=t.trim()===``?null:t.trim();C(t=>t.some(t=>t.id===e&&t.title!==n)?t.map(t=>t.id===e?{...t,title:n}:t):t)},t[13]=re):re=t[13];let ie=re,ae=function(e,t){let r=t.trim()===``?null:t.trim();C(t=>t.some(t=>t.id===e&&t.customLabel!==r)?t.map(t=>t.id===e?{...t,customLabel:r}:t):t);let i=F.current.get(e);i!=null&&n.terminal?.setMeta?.(i,{customLabel:r})},oe;t[14]===g?oe=t[15]:(oe=function(e){return e.customLabel??e.title??g({id:`OVjNeX`,values:{0:e.ordinal}})},t[14]=g,t[15]=oe);let se=oe,ce=(0,Q.useRef)(!1),le=(0,Q.useRef)(null),q=(0,Q.useRef)(null),ue=function(e){C(t=>{if(e.length!==t.length)return t;let n=new Map(t.map(kI)),r=[];for(let i of e){let e=n.get(i);if(e==null)return t;r.push(e)}return r.every((e,n)=>e===t[n])?t:r});let t=e.map(e=>F.current.get(e)).filter(OI);t.length>0&&n.terminal?.setOrder?.(t)},de=function(e){let t=j.current,n=t.findIndex(e=>e.id===A.current);if(n<0)return null;let r=n+e;if(r<0||r>=t.length)return null;let i=t.map(DI),[a]=i.splice(n,1);return i.splice(r,0,a),ue(i),{label:se(t[n]),position:r+1,total:t.length}},fe=(0,Q.useRef)(de),pe=(0,Q.useRef)(R),me=function(e){let t=j.current,n=t.findIndex(t=>t.id===e);if(n===-1)return;let r=t.filter(t=>t.id!==e);if(e===T){let e=(t[n-1]??t[n+1])?.id??``;E(e),e!==``&&queueMicrotask(()=>vI(e))}C(r),r.length===0&&(a(!1),u())},he=(0,Q.useRef)(EI);(0,Q.useEffect)(()=>{pe.current=R,fe.current=de,A.current=T,j.current=S,he.current=()=>{T!==``&&me(T)}});let ge;t[16]!==h||t[17]!==D||t[18]!==S.length||t[19]!==i?(ge=[i,h,S.length,D],t[16]=h,t[17]=D,t[18]=S.length,t[19]=i,t[20]=ge):ge=t[20],(0,Q.useEffect)(()=>{if(!D)return;let e=P.current;if(P.current=i,h!=null&&h.nonce!==N.current){N.current=h.nonce,pe.current(h);return}i&&!e&&S.length===0&&pe.current(null)},ge);let _e;t[21]===n?_e=t[22]:(_e=[n],t[21]=n,t[22]=_e),(0,Q.useEffect)(()=>{if(typeof n.terminal?.list!=`function`||k.current)return;k.current=!0;let e=!1;return(async()=>{let t;try{t=await n.terminal.list()??[]}catch(e){console.error(`[terminal] reload session list() failed; cold-starting:`,e),t=[]}if(!e){if(t.length>0){let e=t.map(TI);M.current=Math.max(e.length,...e.map(wI)),C(e),E(e[0]?.id??``)}O(!0)}})(),()=>{e=!0,k.current=!1}},_e);let ve;t[23]===n?ve=t[24]:(ve=[n],t[23]=n,t[24]=ve),(0,Q.useEffect)(()=>vD(e=>{let t=A.current,r=t===``?void 0:F.current.get(t);r==null?pu():(n.terminal.input(r,e),queueMicrotask(()=>vI(t)))}),ve);let ye;t[25]!==n||t[26]!==m?(ye=[n,m],t[25]=n,t[26]=m,t[27]=ye):ye=t[27],(0,Q.useEffect)(()=>n.onMenuAction(e=>{e===`new-terminal`?pe.current(null):(e===`kill-terminal`||e===`close-active-tab-or-window`&&m===`window`)&&he.current()}),ye);let be;t[28]!==_||t[29]!==m?(be=[_,m],t[28]=_,t[29]=m,t[30]=be):be=t[30],(0,Q.useEffect)(()=>{let e=function(e){if(!e.metaKey||e.ctrlKey||e.altKey||e.shiftKey||!/^[1-9]$/.test(e.key)||!bI(_,m))return;let t=j.current[Number(e.key)-1];t!=null&&(e.preventDefault(),e.stopPropagation(),E(t.id),queueMicrotask(()=>vI(t.id)))};return window.addEventListener(`keydown`,e,{capture:!0}),()=>window.removeEventListener(`keydown`,e,{capture:!0})},be);let xe;t[31]!==g||t[32]!==_||t[33]!==m?(xe=[_,m,g],t[31]=g,t[32]=_,t[33]=m,t[34]=xe):xe=t[34],(0,Q.useEffect)(()=>{let e=function(e){if(!e.metaKey||!e.shiftKey||e.ctrlKey||e.altKey)return;let t=e.key===`ArrowLeft`?-1:+(e.key===`ArrowRight`);if(t===0||!bI(_,m)||ce.current)return;let n=e.target;if(n?.tagName===`INPUT`||n?.isContentEditable)return;let r=fe.current(t);if(r==null)return;e.preventDefault(),e.stopPropagation(),queueMicrotask(()=>vI(A.current));let i=g({id:`CoHvYd`,values:{0:r.label,1:r.position,2:r.total}});q.current!=null&&window.clearTimeout(q.current),q.current=window.setTimeout(()=>{q.current=null,le.current!=null&&(le.current.textContent=i)},60)};return window.addEventListener(`keydown`,e,{capture:!0}),()=>{window.removeEventListener(`keydown`,e,{capture:!0}),q.current!=null&&(window.clearTimeout(q.current),q.current=null)}},xe);let Se;t[35]!==n.editor||t[36]!==S.length?(Se=()=>{n.editor.notifyViewMenuStateChanged({terminalLive:S.length>0})},t[35]=n.editor,t[36]=S.length,t[37]=Se):Se=t[37];let Ce;t[38]!==n||t[39]!==S.length?(Ce=[n,S.length],t[38]=n,t[39]=S.length,t[40]=Ce):Ce=t[40],(0,Q.useEffect)(Se,Ce);let we,Te;t[41]!==p||t[42]!==S.length?(we=()=>{p?.(S.length>0)},Te=[p,S.length],t[41]=p,t[42]=S.length,t[43]=we,t[44]=Te):(we=t[43],Te=t[44]),(0,Q.useEffect)(we,Te);let Ee,De;t[45]!==_||t[46]!==l||t[47]!==u||t[48]!==i?(Ee=()=>{l||i||yI(_)&&u()},De=[l,i,_,u],t[45]=_,t[46]=l,t[47]=u,t[48]=i,t[49]=Ee,t[50]=De):(Ee=t[49],De=t[50]),(0,Q.useLayoutEffect)(Ee,De);let Oe;t[51]===l?Oe=t[52]:(Oe=[l],t[51]=l,t[52]=Oe),(0,Q.useEffect)(()=>{l&&vI(A.current)},Oe);let ke;if(t[53]!==g||t[54]!==S){let e;t[56]===g?e=t[57]:(e=e=>({id:e.id,label:e.customLabel??e.title??g({id:`OVjNeX`,values:{0:e.ordinal}})}),t[56]=g,t[57]=e),ke=S.map(e),t[53]=g,t[54]=S,t[55]=ke}else ke=t[55];let Ae=ke,je=[...S].sort(CI),Me=S.length>0?(0,Z.jsx)(mI,{sessions:Ae,activeSessionId:T,onSelect:E,onTabActivate:SI,newChatSelected:G,onNewChatLaunch:ee,onNewChatPickCli:te,onNewChatPickTerminal:ne,onClose:me,onRename:ae,onReorder:ue,onDragActiveChange:e=>{ce.current=e},dockPosition:d,onToggleDock:f,onCollapse:m===`window`?void 0:()=>a(!1),draggable:m===`window`,className:`h-full`,children:je.map(e=>(0,Z.jsx)(rI,{value:e.id,forceMount:!0,"data-terminal-session":e.id,className:Y(`m-0 flex min-h-0 flex-1 flex-col overflow-hidden data-[state=inactive]:hidden`,m===`window`&&`px-[22px] pb-[22px]`),children:(0,Z.jsx)(aI,{bridge:n,launch:e.launch,adoptPtyId:e.adoptPtyId,onPtyId:t=>I(e.id,t),onTitleChange:t=>ie(e.id,t),onClose:()=>me(e.id)})},e.id))}):null,Ne;return t[58]!==_||t[59]!==Me?(Ne=_==null?null:(0,Sd.createPortal)((0,Z.jsxs)(Z.Fragment,{children:[Me,(0,Z.jsx)(`span`,{ref:le,"aria-live":`polite`,"aria-atomic":`true`,className:`sr-only`,"data-testid":`terminal-reorder-announcer`})]}),_),t[58]=_,t[59]=Me,t[60]=Ne):Ne=t[60],Ne}function SI(e){return queueMicrotask(()=>vI(e))}function CI(e,t){return e.ordinal-t.ordinal}function wI(e){return e.ordinal}function TI(e,t){return{id:_I(t+1),launch:null,title:null,customLabel:e.customLabel??null,ordinal:e.ordinal??t+1,adoptPtyId:e.ptyId}}function EI(){}function DI(e){return e.id}function OI(e){return e!=null}function kI(e){return[e.id,e]}function AI(){return T_()}function jI(){return f_()}function MI(){if(typeof document>`u`)return null;let e=document.createElement(`div`);return e.className=`flex min-h-0 flex-1 flex-col overflow-hidden`,e}function NI(e){let t=(0,$.c)(74),n;t[0]===e?n=t[1]:(n=e===void 0?{}:e,t[0]=e,t[1]=n);let{onOpenSearch:r}=n,[i,a]=e_(),[o,s]=(0,Q.useState)(i),[c,l]=(0,Q.useState)(!1),[u,d]=(0,Q.useState)(`auth`),[f,p]=(0,Q.useState)(Vv[0].id),[m,h]=(0,Q.useState)(!1),g=typeof window<`u`?window.okDesktop??null:null,_=g!=null&&g.terminal!=null,[v,y]=(0,Q.useState)(!1),b=t_(),[x,S]=(0,Q.useState)(!1),[C,w]=(0,Q.useState)(!1),T=(0,Q.useRef)(!1),[E,D]=(0,Q.useState)(null),[O,k]=(0,Q.useState)(x_),A;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(A=function(e){k(e),b_(e),y(!0)},t[2]=A):A=t[2];let j=A,M;t[3]===O?M=t[4]:(M=function(){j(O===`right`?`bottom`:`right`)},t[3]=O,t[4]=M);let N=M,P;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(P={container:null,isShowing:!1,dockPosition:`bottom`,editorRegion:null},t[5]=P):P=t[5];let[F,I]=(0,Q.useState)(P),L=(0,Q.useRef)(0),R;t[6]===b?R=t[7]:(R=function(e){let t=e??h_(f_(),b);y(!0),L.current+=1,D({prompt:null,cli:t,nonce:L.current})},t[6]=b,t[7]=R);let z=R,B;t[8]!==x||t[9]!==z?(B=function(){y(!0),!x&&!C_()&&z()},t[8]=x,t[9]=z,t[10]=B):B=t[10];let V=B,H=Ni(),{projectConfig:U,projectLocalConfig:W,projectLocalSynced:G,projectSynced:K}=zo(),{activeDocName:ee}=vt(),te=H?.hasRemote,ne=H?.pushPermission?.checkStatus,re;t[11]!==m||t[12]!==U||t[13]!==W||t[14]!==G||t[15]!==K||t[16]!==te||t[17]!==ne?(re=O_({autoSyncOnboardingDismissed:m,hasRemote:te,projectLocalSynced:G,projectSynced:K,projectLocalConfig:W,projectConfig:U,pushPermissionCheckStatus:ne}),t[11]=m,t[12]=U,t[13]=W,t[14]=G,t[15]=K,t[16]=te,t[17]=ne,t[18]=re):re=t[18];let ie=re,ae,oe;t[19]===ee?(ae=t[20],oe=t[21]):(ae=()=>{let e=function(e){let t=e.detail;t&&ee&&au(ee,{kind:`raw-mdx`,detail:t}),s(`source`)};return window.addEventListener(Kg,e),()=>window.removeEventListener(Kg,e)},oe=[ee],t[19]=ee,t[20]=ae,t[21]=oe),(0,Q.useEffect)(ae,oe);let se,ce;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(se=()=>{let e=window.okDesktop;if(e!=null)return e.onMenuAction(e=>{e===`toggle-terminal`?y(II):e===`new-terminal`&&y(!0)})},ce=[],t[22]=se,t[23]=ce):(se=t[22],ce=t[23]),(0,Q.useEffect)(se,ce);let le,q;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(le=()=>{if(window.okDesktop!=null)return;let e=function(e){Pl(e,`toggle-terminal-panel`)&&(e.preventDefault(),y(FI))};return window.addEventListener(`keydown`,e,{capture:!0}),()=>window.removeEventListener(`keydown`,e,{capture:!0})},q=[],t[24]=le,t[25]=q):(le=t[24],q=t[25]),(0,Q.useEffect)(le,q);let ue,de;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(ue=()=>QF((e,t)=>{y(!0),L.current+=1,D({prompt:e,cli:t,nonce:L.current})}),de=[],t[26]=ue,t[27]=de):(ue=t[26],de=t[27]),(0,Q.useEffect)(ue,de);let fe,pe;t[28]===v?(fe=t[29],pe=t[30]):(fe=()=>{v||D(null)},pe=[v],t[28]=v,t[29]=fe,t[30]=pe),(0,Q.useEffect)(fe,pe);let me,he;t[31]!==C||t[32]!==v?(me=()=>{window.okDesktop!=null&&C&&window.okDesktop.editor.notifyViewMenuStateChanged({terminalVisible:v})},he=[v,C],t[31]=C,t[32]=v,t[33]=me,t[34]=he):(me=t[33],he=t[34]),(0,Q.useEffect)(me,he);let ge,_e;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(ge=()=>{let e=window.okDesktop;if(e==null)return;if(typeof e.terminal?.getDockState!=`function`){w(!0);return}let t=!1;return e.terminal.getDockState().then(e=>{t||!e.visible||(T.current=!0,y(!0))}).catch(PI).finally(()=>{t||w(!0)}),()=>{t=!0}},_e=[],t[35]=ge,t[36]=_e):(ge=t[35],_e=t[36]),(0,Q.useEffect)(ge,_e);let ve,ye;t[37]===v?(ve=t[38],ye=t[39]):(ve=()=>{if(window.okDesktop!=null){if(T.current){T.current=!1;return}v&&Ya()}},ye=[v],t[37]=v,t[38]=ve,t[39]=ye),(0,Q.useEffect)(ve,ye),r_(H?.pausedReason),i_();let be;t[40]===a?be=t[41]:(be=function(e){s(e),a(e)},t[40]=a,t[41]=be);let xe=be,Se,Ce;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(Se=()=>{d(`auth`),l(!0)},Ce=()=>{d(`identity`),l(!0)},t[42]=Se,t[43]=Ce):(Se=t[42],Ce=t[43]);let we;t[44]===r?we=t[45]:(we=(0,Z.jsx)(YF,{onSignIn:Se,onSetIdentity:Ce,onOpenSearch:r}),t[44]=r,t[45]=we);let Te=_?V:void 0,Ee;t[46]!==f||t[47]!==o||t[48]!==xe||t[49]!==Te||t[50]!==O||t[51]!==v?(Ee=(0,Z.jsx)(nN,{editorMode:o,onModeChange:xe,activeTab:f,onActiveTabChange:p,terminalBridge:g,terminalVisible:v,onTerminalVisibleChange:y,terminalDock:O,onTerminalPlacement:I,onRevealTerminal:Te}),t[46]=f,t[47]=o,t[48]=xe,t[49]=Te,t[50]=O,t[51]=v,t[52]=Ee):Ee=t[52];let De;t[53]!==b||t[54]!==O||t[55]!==E||t[56]!==F||t[57]!==v||t[58]!==N?(De=_&&g!=null?(0,Z.jsx)(xI,{bridge:g,visible:v,onVisibleChange:y,launch:E,installedClis:b,container:F.container,isShowing:F.isShowing,onRequestEditorFocus:()=>F.editorRegion?.focus(),dockPosition:O,onToggleDock:N,onHasSessionsChange:S}):null,t[53]=b,t[54]=O,t[55]=E,t[56]=F,t[57]=v,t[58]=N,t[59]=De):De=t[59];let Oe=u===`identity`,ke;t[60]===Symbol.for(`react.memo_cache_sentinel`)?(ke=()=>{l(!1)},t[60]=ke):ke=t[60];let Ae;t[61]!==c||t[62]!==Oe?(Ae=(0,Z.jsx)(qa,{open:c,onOpenChange:l,identityPrompt:Oe,onSuccess:ke}),t[61]=c,t[62]=Oe,t[63]=Ae):Ae=t[63];let je;t[64]===Symbol.for(`react.memo_cache_sentinel`)?(je=()=>h(!0),t[64]=je):je=t[64];let Me;t[65]===ie?Me=t[66]:(Me=(0,Z.jsx)(E_,{open:ie,onResolved:je}),t[65]=ie,t[66]=Me);let Ne;t[67]===Symbol.for(`react.memo_cache_sentinel`)?(Ne=(0,Z.jsx)(Ug,{}),t[67]=Ne):Ne=t[67];let Pe;return t[68]!==we||t[69]!==Ee||t[70]!==De||t[71]!==Ae||t[72]!==Me?(Pe=(0,Z.jsxs)(Z.Fragment,{children:[we,Ee,De,Ae,Me,Ne]}),t[68]=we,t[69]=Ee,t[70]=De,t[71]=Ae,t[72]=Me,t[73]=Pe):Pe=t[73],Pe}function PI(e){console.error(`[terminal] dock-state restore failed; staying hidden:`,e)}function FI(e){return!e}function II(e){return!e}function LI(e){let t=kl(bl(e));typeof window>`u`||window.location.hash!==t&&(window.location.hash=t)}function RI(){let e=(0,$.c)(11),{conflicts:t,loading:n,error:r}=Ua();if(n)return null;if(r===`server`){let t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Z.jsx)(`section`,{"data-testid":`conflicts-section`,"aria-label":`Conflicted files`,className:`border-b border-amber-200/60 bg-amber-50/40 px-2 py-2 dark:border-amber-900/40 dark:bg-amber-950/20`,children:(0,Z.jsxs)(`p`,{"data-testid":`conflicts-section-error`,className:`px-2 py-1.5 text-[12px] text-amber-700 dark:text-amber-400`,children:[(0,Z.jsx)(ds,{"aria-hidden":`true`,className:`mr-1.5 inline size-3`}),`Couldn't load conflicts — reload to retry.`]})}),e[0]=t):t=e[0],t}if(t.length===0)return null;let i;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsxs)(`span`,{className:`flex items-center gap-1.5 font-mono text-[11px] uppercase tracking-wider text-amber-700 dark:text-amber-400`,children:[(0,Z.jsx)(ds,{"aria-hidden":`true`,className:`size-3`}),`Conflicts`]}),e[1]=i):i=e[1];let a;e[2]===t.length?a=e[3]:(a=(0,Z.jsxs)(`header`,{className:`flex items-center justify-between px-2 pb-1.5`,children:[i,(0,Z.jsx)(`span`,{"data-testid":`conflicts-section-count`,className:`rounded-full bg-amber-500 px-1.5 py-0.5 font-mono text-[10px] font-medium leading-none text-white`,children:t.length})]}),e[2]=t.length,e[3]=a);let o;e[4]===t?o=e[5]:(o=t.map(zI),e[4]=t,e[5]=o);let s;e[6]===o?s=e[7]:(s=(0,Z.jsx)(`ul`,{className:`flex flex-col gap-px`,children:o}),e[6]=o,e[7]=s);let c;return e[8]!==a||e[9]!==s?(c=(0,Z.jsxs)(`section`,{"data-testid":`conflicts-section`,"aria-label":`Conflicted files`,className:`border-b border-amber-200/60 bg-amber-50/40 px-2 py-2 dark:border-amber-900/40 dark:bg-amber-950/20`,children:[a,s]}),e[8]=a,e[9]=s,e[10]=c):c=e[10],c}function zI(e){return(0,Z.jsx)(`li`,{children:(0,Z.jsxs)(X,{variant:`ghost`,size:`sm`,"data-testid":`conflicts-section-row`,"data-file":e.file,title:e.file,className:`h-7 w-full justify-start gap-1.5 px-2 font-normal text-[13px] text-amber-800 hover:bg-amber-100/60 hover:text-amber-900 dark:text-amber-300 dark:hover:bg-amber-900/30 dark:hover:text-amber-200`,onClick:()=>LI(e.file),children:[(0,Z.jsx)(ds,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,Z.jsx)(`span`,{className:`min-w-0 truncate`,children:e.file})]})},e.file)}var BI=`<svg data-icon-sprite aria-hidden="true" width="0" height="0">
|
|
30
30
|
<symbol id="file-tree-icon-chevron" viewBox="0 0 16 16">
|
|
31
31
|
<path d="M12.4697 5.46973C12.7626 5.17684 13.2374 5.17684 13.5303 5.46973C13.8232 5.76262 13.8232 6.23738 13.5303 6.53028L8.53028 11.5303C8.23738 11.8232 7.76262 11.8232 7.46973 11.5303L2.46973 6.53028C2.17684 6.23738 2.17684 5.76262 2.46973 5.46973C2.76262 5.17684 3.23738 5.17684 3.53028 5.46973L8 9.93946L12.4697 5.46973Z" fill="currentcolor"/>
|
|
32
32
|
</symbol>
|
|
@@ -43,72 +43,72 @@ Error generating stack: `+e.message+`
|
|
|
43
43
|
<symbol id="file-tree-icon-ellipsis" viewBox="0 0 16 16">
|
|
44
44
|
<path d="M5 8.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0M9.5 8.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0M14 8.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0" />
|
|
45
45
|
</symbol>
|
|
46
|
-
</svg>`,
|
|
46
|
+
</svg>`,VI=`<symbol id="file-tree-builtin-astro" viewBox="0 0 16 16">
|
|
47
47
|
<path fill="currentColor" d="M6.08 13.92c-.63-.57-.81-1.79-.55-2.67.45.56 1.08.73 1.73.83 1 .15 1.99.1 2.92-.37l.32-.19q.13.38.08.78a2.1 2.1 0 0 1-.9 1.5q-.3.24-.61.43c-.64.44-.81.95-.57 1.69l.02.08a1.7 1.7 0 0 1-.74-.64 2 2 0 0 1-.3-.98q0-.27-.02-.52-.07-.61-.61-.62a.7.7 0 0 0-.75.6z" class="bg" opacity=".6"/>
|
|
48
48
|
<path fill="currentColor" d="M2.5 11.1s1.86-.9 3.72-.9l1.4-4.39c.05-.21.2-.36.38-.36s.33.15.38.36l1.4 4.38c2.2 0 3.72.92 3.72.92l-3.16-8.69q-.13-.4-.45-.42H6.11q-.3.02-.45.42z" class="fg"/>
|
|
49
|
-
</symbol>`,
|
|
49
|
+
</symbol>`,HI=`<symbol id="file-tree-builtin-babel" viewBox="0 0 16 16">
|
|
50
50
|
<path fill="currentColor" fill-rule="evenodd" d="M9.49.5q1.92.05 2.66.54 1.27.6 1.35 1.52v.23a4 4 0 0 1-.53 1.9l-1.38 1.24q-.74.38-.72.63c.77.82 1.33 1.29.85 2.42q-.47 1.1-2.04 2.28c-.5.32-1.88 1.35-2.96 1.86-1.64.77-3.1 1.4-4.65 1.89-.51.16-1.5.16-1.5.16L.5 15A76 76 0 0 0 5.76 3.49q-.1-.08-.1-.2.1 0 .32-.35l-.03-.09q-1.17.39-2.38 1.3l-.13.03q0-.1-.21-.16-.46.31-.82.7l-.13-.19.16-.06-.03-.16-.34.29L2 4.5q.36-.48.72-.54l.04-.1V3.8q.16 0 .15-.06l.13-.06a6 6 0 0 0 1.13-.9v-.03H4.1l-.12.07q0-.1-.1-.1l-.15.07-.04-.1q.93-.52 1.63-1.05Q7.89.65 9.5.5M8.46 7.83l-.32.04c-1.31.54-2.31.82-2.91.88a71 71 0 0 0-2.2 4.54h.07q.58-.04 3.04-1.42.13 0 1.66-1.05L9.18 9.7v.03q.45-.2.81-1.3v-.2q-.5-.46-1.53-.4m.28-5.75c-.5.1-.75.19-.72.38l-1.16 2.6q-.17.1-.34.95-.3.48-.25.77v.1l.22.05A15 15 0 0 1 8.86 6c1.1-.71 2.12-1.38 2.8-2.54q.24-.33.21-.54-.02-.33-.4-.54c-.54 0-1.07-.34-1.63-.28l-.94-.03z" clip-rule="evenodd"/>
|
|
51
|
-
</symbol>`,
|
|
51
|
+
</symbol>`,UI=`<symbol id="file-tree-builtin-bash" viewBox="0 0 16 16">
|
|
52
52
|
<path fill="currentColor" d="M8 1C2.24 1 1 2.24 1 8s1.24 7 7 7 7-1.24 7-7-1.24-7-7-7" class="bg" opacity=".2"/>
|
|
53
53
|
<path fill="currentColor" d="M11.5 11a.5.5 0 0 1 0 1h-3a.5.5 0 0 1 0-1zM7 6.75C7 6.42 6.64 6 6 6s-1 .42-1 .75q-.01.25.22.41.26.21.89.35.74.14 1.28.53c.37.29.61.7.61 1.21 0 .87-.68 1.5-1.5 1.7v.55a.5.5 0 0 1-1 0v-.56c-.82-.18-1.5-.82-1.5-1.69a.5.5 0 0 1 1 0c0 .33.36.75 1 .75s1-.42 1-.75q.01-.25-.22-.41a2 2 0 0 0-.89-.35q-.74-.14-1.28-.53A1.5 1.5 0 0 1 4 6.75c0-.87.68-1.5 1.5-1.7V4.5a.5.5 0 0 1 1 0v.56c.82.18 1.5.82 1.5 1.69a.5.5 0 0 1-1 0" class="fg-stroke"/>
|
|
54
|
-
</symbol>`,
|
|
54
|
+
</symbol>`,WI=`<symbol id="file-tree-builtin-biome" viewBox="0 0 16 16">
|
|
55
55
|
<path fill="currentColor" d="M8 2 4.88 7.35a7 7 0 0 1 3.7-.13l1.04.25-.99 4.16-1.05-.25a2.7 2.7 0 0 0-3.07 1.45l-.98-.47a4 4 0 0 1 1.07-1.31 3.8 3.8 0 0 1 3.23-.71l.5-2.08a6 6 0 0 0-5.07 1.12A5.9 5.9 0 0 0 1 14h14z"/>
|
|
56
|
-
</symbol>`,
|
|
56
|
+
</symbol>`,GI=`<symbol id="file-tree-builtin-bootstrap" viewBox="0 0 16 16">
|
|
57
57
|
<path fill="currentColor" fill-rule="evenodd" d="M11.72 1.5A2.5 2.5 0 0 1 14.2 4q.02 1.08.3 2.09c.22.73.56 1.24 1.08 1.45.22.08.4.27.4.5s-.18.43-.4.51q-.76.34-1.08 1.45c-.2.65-.27 1.32-.3 2a2.5 2.5 0 0 1-2.48 2.5H4.25A2.6 2.6 0 0 1 1.7 12c-.04-.85-.1-1.68-.22-2.04C1.26 9.23.92 8.7.4 8.5.18 8.42 0 8.23 0 8s.18-.42.4-.5q.77-.35 1.09-1.46c.1-.36.17-1.19.2-2.04a2.6 2.6 0 0 1 2.56-2.5z" class="bg" clip-rule="evenodd" opacity=".2"/>
|
|
58
58
|
<path fill="currentColor" fill-rule="evenodd" d="M8.47 4.54c1.23 0 2.04.68 2.04 1.73 0 .73-.55 1.39-1.24 1.5v.04c.94.1 1.58.77 1.58 1.7 0 1.2-.9 1.95-2.37 1.95H5.97a.3.3 0 0 1-.2-.08.3.3 0 0 1-.08-.2V4.82a.3.3 0 0 1 .08-.2.3.3 0 0 1 .2-.08zm-1.7 6.04h1.49q1.47-.01 1.49-1.15Q9.74 8.31 8.2 8.3H6.77zm0-5.16v2.06h1.21c.93 0 1.45-.38 1.45-1.06 0-.65-.44-1-1.22-1z" class="fg" clip-rule="evenodd"/>
|
|
59
|
-
</symbol>`,
|
|
59
|
+
</symbol>`,KI=`<symbol id="file-tree-builtin-browserslist" viewBox="0 0 16 16">
|
|
60
60
|
<path fill="currentColor" d="M8.88 6.96c0 3.82 3.72 4.7 5.7 3.74-.23.9-1.04 1.67-2.35 1.93-.02.4.42 1.28.82 1.63-.9.35-1.94-.12-2.51-.48a5 5 0 0 0-.32 1.87c-.68 0-1.57-1-1.8-1.37-.3.18-.85 1.15-.96 1.72a2.4 2.4 0 0 1-.81-.86 2.4 2.4 0 0 1-.3-1.15c-.38.27-1.48.95-1.99 1.18-.25-.58-.15-1.3 0-2.06-.21.12-1.8.27-2.43.12.32-.36.75-1.19.94-1.57A4.5 4.5 0 0 1 .44 10.6c.48-.22.97-.53 1.49-1.06C1.26 9.17.24 8.64 0 7.7a6 6 0 0 0 1.79-.32C1.28 7.08.44 6.15.6 5.01c.42.21 1.3.37 1.73.3a3.4 3.4 0 0 1-.25-2.75 5 5 0 0 0 1.48 1c-.08-.8.3-2.31.8-2.71.2.46.73 1.21 1.08 1.4.09-.61.87-2.06 1.57-2.25 0 .5.27 1.4.5 1.67.51-.54 2.25-1.44 3.64-1.13-.43.45-.75.61-.86.98 1.05 0 2.78.34 4.27 1.93-2.34-.89-5.69.56-5.69 3.5" class="bg" opacity=".5"/>
|
|
61
61
|
<path fill="currentColor" d="M11.21 3.59a4.1 4.1 0 0 0 2.47 2.89c.24-.22.61-.38.95-.19.76.44.2 1.26-.34 1.66l-.07.06a13 13 0 0 1-4.49 1.61l-.3-.43a10.5 10.5 0 0 0 4.13-1.31 1 1 0 0 0 .23-.25.5.5 0 0 0-.21-.69l-.15-.06a4.5 4.5 0 0 1-1.77-1.31 4.5 4.5 0 0 1-.88-1.77q.2-.12.43-.21"/>
|
|
62
62
|
<path fill="currentColor" d="M10.36 5.18a.4.4 0 0 0-.03.38c.09.2.3.3.46.23s.24-.3.15-.5l-.01-.02q.23.13.34.39a.83.83 0 0 1-.43 1.08.8.8 0 0 1-1.08-.43.83.83 0 0 1 .6-1.13"/>
|
|
63
|
-
</symbol>`,
|
|
63
|
+
</symbol>`,qI=`<symbol id="file-tree-builtin-bun" viewBox="0 0 16 16">
|
|
64
64
|
<path fill="currentColor" d="M8 14c3.87 0 7-2.46 7-5.49 0-1.88-1.2-3.53-3.04-4.52q-1.1-.61-1.84-1.07C9.2 2.35 8.64 2 8 2s-1.36.45-2.31 1.03A29 29 0 0 1 4.04 4C2.2 4.98 1 6.63 1 8.51 1 11.54 4.13 14 8 14M7.18 3.88q.3-.66.3-1.37c0-.08.11-.1.13-.01.38 1.57-.53 2.35-1.2 2.61-.08.03-.12-.07-.06-.12a3 3 0 0 0 .83-1.12m1.2-.05a3 3 0 0 0-.45-1.3V2.5c-.04-.07.05-.15.1-.1 1.15 1.2.77 2.3.33 2.87-.05.05-.13 0-.11-.08q.21-.67.13-1.37m1.04-.32a3 3 0 0 0-.94-1.02v-.01c-.06-.05-.01-.16.07-.12 1.51.61 1.61 1.8 1.43 2.5l-.03.03a.07.07 0 0 1-.1-.06 3 3 0 0 0-.43-1.32m-2.97.32c-.36.3-.74.43-1.2.56q-.11 0-.1-.1a3.5 3.5 0 0 0 1.76-1.57s.09-.07.1.04c0 .18-.2.76-.56 1.07m2.89 6.36q-.13.52-.55.88a1.3 1.3 0 0 1-.75.35 1.3 1.3 0 0 1-.77-.35 1.7 1.7 0 0 1-.54-.88.13.13 0 0 1 .15-.15h2.31a.14.14 0 0 1 .15.15M6.15 8.95a1.1 1.1 0 0 1-1.39-.14A1.1 1.1 0 0 1 5.12 7a1.1 1.1 0 0 1 1.2.25 1.1 1.1 0 0 1-.17 1.69m4.96 0a1.1 1.1 0 0 1-1.4-.14 1.1 1.1 0 0 1 .37-1.8 1.1 1.1 0 0 1 1.2.25 1.1 1.1 0 0 1 .24 1.2 1 1 0 0 1-.41.5"/>
|
|
65
|
-
</symbol>`,
|
|
65
|
+
</symbol>`,JI=`<symbol id="file-tree-builtin-c" viewBox="0 0 16 16">
|
|
66
66
|
<path fill="currentColor" fill-rule="evenodd" d="M8 1q.084 0 .166.021.098.023.186.075c1.055.624 4.22 2.486 5.277 3.11.085.05.15.112.209.192h-.002l.028.037a.5.5 0 0 1 .103.21q.031.102.033.21v6.29a.71.71 0 0 1-.347.616l-5.307 3.144a.68.68 0 0 1-.693 0l-5.307-3.144A.72.72 0 0 1 2 11.145V4.832a.71.71 0 0 1 .346-.612l5.288-3.126A.7.7 0 0 1 7.992 1zm2.901 4.349a3.75 3.75 0 1 0 0 5.302l-1.06-1.06a2.25 2.25 0 1 1 0-3.182z" clip-rule="evenodd"/>
|
|
67
|
-
</symbol>`,
|
|
67
|
+
</symbol>`,YI=`<symbol id="file-tree-builtin-claude" viewBox="0 0 16 16">
|
|
68
68
|
<path fill="currentColor" d="M3.75 10.31 6.5 8.77l.04-.14-.04-.07h-.14l-.46-.03-1.57-.04-1.38-.07-1.33-.07-.34-.07L1 7.86l.03-.21.28-.18.4.03.89.07 1.33.08.97.06 1.43.16h.22l.03-.1-.07-.05-.06-.06-1.39-.92-1.48-.98-.79-.57-.42-.28-.2-.28-.1-.6.39-.41.52.04.12.03.52.4 1.12.86L6.2 6.04l.2.17.09-.06.01-.04-.1-.15-.76-1.46-.85-1.46-.37-.6-.1-.36a1 1 0 0 1-.06-.42l.42-.59.25-.07.6.08.22.2.36.84.58 1.3.9 1.77.29.53.14.47.04.14h.1v-.07l.07-1 .14-1.22.14-1.57.04-.45.23-.53.42-.28.36.15.28.41-.04.25-.16 1.08-.36 1.7-.21 1.14h.12l.14-.15.58-.76.97-1.2.42-.5.5-.51.32-.25h.6l.44.66-.2.68-.61.79-.52.65-.74 1-.45.8.04.05h.1l1.68-.36.9-.16 1.06-.18.5.23.05.22-.2.48-1.15.28-1.34.28-2 .46-.04.01.03.04.9.09.4.03h.94l1.77.14.46.28.27.37-.04.28-.72.37-.95-.23-2.24-.53-.76-.18h-.11v.06l.64.63L12 10.86l1.48 1.35.07.34-.18.28-.2-.03-1.29-.98-.5-.42-1.12-.95h-.07v.1l.25.38 1.37 2.05.07.63-.1.2-.36.14-.38-.08-.8-1.12-.85-1.26-.66-1.15-.07.05-.4 4.23-.19.21-.42.17-.35-.28-.2-.42.2-.87.23-1.12.18-.9.17-1.1.1-.36v-.03h-.1l-.84 1.16-1.27 1.72-1 1.07-.24.1-.42-.22.04-.39.22-.32 1.4-1.8.84-1.1.57-.64-.02-.07h-.04l-3.7 2.4-.66.09-.28-.28.03-.42.14-.14 1.12-.77z"/>
|
|
69
|
-
</symbol>`,
|
|
69
|
+
</symbol>`,XI=`<symbol id="file-tree-builtin-cpp" viewBox="0 0 16 16">
|
|
70
70
|
<path fill="currentColor" fill-rule="evenodd" d="M8 1q.084 0 .166.021.098.023.186.075c1.055.624 4.22 2.486 5.277 3.11.085.05.15.112.209.192h-.002l.028.037a.5.5 0 0 1 .103.21q.031.102.033.21v6.29a.71.71 0 0 1-.347.616l-5.307 3.144a.68.68 0 0 1-.693 0l-5.307-3.144A.72.72 0 0 1 2 11.145V4.832a.71.71 0 0 1 .346-.612l5.288-3.126A.7.7 0 0 1 7.992 1zm2.901 4.349a3.75 3.75 0 1 0 0 5.302l-1.06-1.06a2.25 2.25 0 1 1 0-3.182z" clip-rule="evenodd"/>
|
|
71
|
-
</symbol>`,
|
|
71
|
+
</symbol>`,ZI=`<symbol id="file-tree-builtin-css" viewBox="0 0 16 16">
|
|
72
72
|
<path fill="currentColor" d="M8 15c-5.76 0-7-1.24-7-7V2a1 1 0 0 1 1-1h6c5.77 0 7 1.24 7 7s-1.24 7-7 7" class="vector" opacity=".2"/>
|
|
73
73
|
<path fill="currentColor" d="M10.1 9.19h.73c.03.49.22.6 1 .6.76 0 .93-.12.93-.68 0-.52-.17-.67-.94-.85-1.38-.3-1.68-.56-1.68-1.47 0-1.05.3-1.29 1.67-1.29 1.29 0 1.57.2 1.6 1.13h-.74c-.01-.34-.17-.42-.85-.42-.77 0-.94.1-.94.58 0 .42.17.55.96.73 1.36.3 1.66.58 1.66 1.59 0 1.14-.31 1.39-1.73 1.39-1.39 0-1.69-.24-1.67-1.31m-3.9 0h.74c.03.49.21.6.99.6.76 0 .93-.12.93-.68 0-.52-.17-.67-.93-.85-1.39-.3-1.69-.56-1.69-1.47 0-1.05.3-1.29 1.67-1.29 1.3 0 1.58.2 1.6 1.13h-.73c-.02-.34-.18-.42-.85-.42-.78 0-.95.1-.95.58 0 .42.17.55.96.73 1.37.3 1.67.58 1.67 1.59 0 1.14-.32 1.39-1.74 1.39-1.38 0-1.68-.24-1.66-1.31m-1.22 0h.75c-.09 1.07-.37 1.31-1.56 1.31-1.37 0-1.68-.45-1.68-2.5 0-1.96.36-2.5 1.68-2.5 1.16 0 1.44.25 1.52 1.35h-.76c-.08-.52-.22-.64-.76-.64-.74 0-.9.33-.9 1.78 0 1.47.16 1.8.9 1.8.58 0 .74-.11.8-.6"/>
|
|
74
|
-
</symbol>`,
|
|
74
|
+
</symbol>`,QI=`<symbol id="file-tree-builtin-database" viewBox="0 0 16 16">
|
|
75
75
|
<path fill="currentColor" d="M14.953 9.733a12.4 12.4 0 0 1-.244 1.936c-.207.933-.532 1.58-.996 2.044s-1.11.789-2.044.996C10.73 14.918 9.533 15 8 15s-2.73-.082-3.669-.291c-.933-.207-1.58-.532-2.044-.996s-.789-1.11-.996-2.044c-.122-.547-.2-1.182-.244-1.92q.23.364.532.667c.64.639 1.482 1.031 2.533 1.265 1.046.232 2.33.315 3.884.315 1.555 0 2.838-.083 3.884-.315 1.051-.234 1.893-.626 2.532-1.265a4 4 0 0 0 .541-.683"/>
|
|
76
76
|
<path fill="currentColor" d="M14.93 5.924c-.046.663-.118 1.24-.23 1.743-.207.932-.532 1.579-.995 2.042s-1.11.789-2.042.996c-.938.209-2.135.291-3.667.291-1.531 0-2.729-.082-3.667-.29-.932-.208-1.579-.534-2.042-.997s-.789-1.11-.996-2.042a12 12 0 0 1-.227-1.683l.016-.188a4 4 0 0 0 .5.62c.638.639 1.48 1.031 2.532 1.265 1.046.232 2.33.315 3.884.315 1.555 0 2.838-.083 3.884-.315 1.051-.234 1.893-.626 2.532-1.265.192-.192.357-.404.506-.633z"/>
|
|
77
77
|
<path fill="currentColor" d="M8 1c1.533 0 2.73.082 3.669.291.933.207 1.58.533 2.044.996.403.404.904.944.91 1.695.004.764-.509 1.318-.918 1.727-.463.463-1.11.789-2.042.996-.938.209-2.135.291-3.667.291-1.531 0-2.729-.082-3.667-.29-.932-.208-1.579-.534-2.042-.997-.406-.406-.915-.953-.915-1.71 0-.758.509-1.305.915-1.712.464-.463 1.11-.789 2.044-.996C5.27 1.082 6.467 1 8 1"/>
|
|
78
|
-
</symbol
|
|
78
|
+
</symbol>`,$I=`<symbol id="file-tree-builtin-default" viewBox="0 0 16 16">
|
|
79
79
|
<path fill="currentColor" d="M8 1v3a3 3 0 0 0 3 3h3v5.5a2.5 2.5 0 0 1-2.5 2.5h-7A2.5 2.5 0 0 1 2 12.5v-9A2.5 2.5 0 0 1 4.5 1z" class="bg" opacity=".4"/>
|
|
80
80
|
<path fill="currentColor" d="M9.5 1a.5.5 0 0 1 .354.146l4 4A.5.5 0 0 1 14 5.5V6h-3a2 2 0 0 1-2-2V1z" class="fg"/>
|
|
81
|
-
</symbol>`,
|
|
81
|
+
</symbol>`,eL=`<symbol id="file-tree-builtin-docker" viewBox="0 0 16 16">
|
|
82
82
|
<path fill="currentColor" d="M15.85 6.54c-.05-.04-.45-.36-1.31-.36q-.34 0-.68.06a2.7 2.7 0 0 0-1.14-1.79l-.23-.14-.15.23a3 3 0 0 0-.4 1q-.24 1.01.26 1.84c-.4.24-1.03.3-1.17.3H.5a.5.5 0 0 0-.5.52q-.01 1.46.46 2.83.55 1.5 1.6 2.18c.79.5 2.08.79 3.54.79q.96 0 1.94-.18a8 8 0 0 0 2.55-.97 7 7 0 0 0 1.73-1.5 10 10 0 0 0 1.7-3.06h.15a2.4 2.4 0 0 0 1.8-.7 2 2 0 0 0 .47-.74l.06-.2z"/>
|
|
83
83
|
<path fill="currentColor" d="M1.48 7.36h1.4a.14.14 0 0 0 .14-.13V5.91q-.01-.12-.13-.14H1.48a.13.13 0 0 0-.13.14v1.32q.02.13.13.13m1.94 0h1.41a.14.14 0 0 0 .13-.13V5.91q-.01-.12-.13-.14h-1.4a.13.13 0 0 0-.13.14v1.32q0 .13.12.13m1.98 0h1.4q.13 0 .14-.13V5.91a.13.13 0 0 0-.14-.14H5.4q-.1.01-.12.14v1.32q0 .13.12.13m1.95 0h1.42q.1 0 .12-.13V5.91q0-.12-.12-.14H7.35q-.1.01-.12.14v1.32q.01.13.12.13M3.42 5.5h1.41c.07 0 .13-.08.13-.15V4.03a.13.13 0 0 0-.13-.14h-1.4q-.12 0-.13.14v1.31q0 .13.12.15m1.98 0h1.4c.08 0 .14-.08.14-.15V4.03q0-.13-.14-.14H5.4q-.1 0-.12.14v1.31q0 .13.12.15m1.95 0h1.42c.06 0 .12-.08.12-.15V4.03q-.01-.13-.12-.14H7.35q-.1 0-.12.14v1.31q.01.13.12.15m0-1.9h1.42q.1-.02.12-.14v-1.3Q8.88 2 8.77 2H7.35q-.1 0-.12.14v1.3q.01.13.12.14m1.97 3.78h1.4a.13.13 0 0 0 .14-.13V5.91q-.01-.12-.13-.14H9.32q-.1.01-.12.14v1.32q.01.13.12.13" opacity=".5"/>
|
|
84
|
-
</symbol>`,
|
|
84
|
+
</symbol>`,tL=`<symbol id="file-tree-builtin-eslint" viewBox="0 0 16 16">
|
|
85
85
|
<path fill="currentColor" d="M11.16 6.1 8.12 4.35a.3.3 0 0 0-.24 0L4.84 6.1a.3.3 0 0 0-.12.2v3.5q0 .14.12.22l3.04 1.74q.12.08.24 0l3.04-1.74a.2.2 0 0 0 .13-.22V6.3a.3.3 0 0 0-.13-.2" opacity=".5"/>
|
|
86
86
|
<path fill="currentColor" d="m.1 7.69 3.63-6.3A.8.8 0 0 1 4.37 1h7.26c.26 0 .5.17.64.4l3.63 6.27a.8.8 0 0 1 0 .75l-3.63 6.24a.7.7 0 0 1-.64.34H4.37a.7.7 0 0 1-.64-.34L.1 8.41a.7.7 0 0 1 0-.72m3 3.02q.01.15.14.23l4.63 2.66q.13.06.26 0l4.63-2.66a.3.3 0 0 0 .14-.23V5.4a.3.3 0 0 0-.14-.23L8.13 2.52a.3.3 0 0 0-.26 0L3.24 5.17a.3.3 0 0 0-.14.23z"/>
|
|
87
|
-
</symbol>`,
|
|
87
|
+
</symbol>`,nL=`<symbol id="file-tree-builtin-font" viewBox="0 0 16 16">
|
|
88
88
|
<path fill="currentColor" d="M12.3 13c-1.59 0-2.68-.99-2.68-2.5 0-1.43 1-2.34 2.88-2.35h2.16v-.83c0-1.08-.62-1.68-1.73-1.68-1.05 0-1.66.54-1.73 1.36H9.93c.09-1.43 1.06-2.48 3.05-2.48 1.75 0 3.02.95 3.02 2.68v5.66h-1.29v-1.02h-.04c-.41.66-1.16 1.16-2.37 1.16m.36-1.12c1.14 0 2-.72 2-1.74v-.96H12.6c-1.12 0-1.6.54-1.6 1.28 0 .97.8 1.42 1.66 1.42m-11.24.98H0L3.8 2h1.39l3.8 10.86H7.54l-1.08-3.2H2.5zm3.09-9.25h-.04l-1.6 4.95H6.1z"/>
|
|
89
|
-
</symbol>`,
|
|
89
|
+
</symbol>`,rL=`<symbol id="file-tree-builtin-git" viewBox="0 0 16 16">
|
|
90
90
|
<path fill="currentColor" d="M14.74 7.38 8.62 1.26a.9.9 0 0 0-1.27 0L6.08 2.53l1.61 1.61a1.07 1.07 0 0 1 1.36 1.37l1.55 1.55a1.07 1.07 0 0 1 1.1 1.77 1.07 1.07 0 0 1-1.74-1.16L8.5 6.22v3.8a1.07 1.07 0 1 1-.89-.02V6.15a1.07 1.07 0 0 1-.58-1.4l-1.58-1.6-4.2 4.2a.9.9 0 0 0 0 1.27l6.12 6.12a.9.9 0 0 0 1.27 0l6.09-6.09a.9.9 0 0 0 0-1.27"/>
|
|
91
|
-
</symbol>`,
|
|
91
|
+
</symbol>`,iL=`<symbol id="file-tree-builtin-go" viewBox="0 0 16 16">
|
|
92
92
|
<path fill="currentColor" fill-rule="evenodd" d="M4.41 4.57A3.2 3.2 0 0 1 6.87 5q.74.49 1.08 1.29.08.12-.1.16l-1.55.4c-.14.03-.15.04-.27-.1a1 1 0 0 0-.44-.34 1.6 1.6 0 0 0-1.68.14q-.95.61-.94 1.73c0 .73.52 1.33 1.25 1.43q.95.1 1.58-.6l.25-.34h-1.8c-.19 0-.24-.12-.17-.27.12-.28.34-.76.47-1a.3.3 0 0 1 .24-.14h2.98a4 4 0 0 1 .64-1.19 4 4 0 0 1 2.6-1.52 3.5 3.5 0 0 1 2.64.46q1.13.73 1.31 2.04a3.5 3.5 0 0 1-1.06 3.09q-.93.92-2.23 1.17l-.74.08a3.5 3.5 0 0 1-2.27-.8 3 3 0 0 1-.93-1.42 4 4 0 0 1-.39.61 4 4 0 0 1-2.64 1.56 3.3 3.3 0 0 1-2.5-.6 3 3 0 0 1-1.18-2.03 3.5 3.5 0 0 1 .8-2.67 4 4 0 0 1 2.6-1.58M13.1 7.5a1.53 1.53 0 0 0-1.9-1.21q-1.3.3-1.62 1.59a1.5 1.5 0 0 0 .85 1.72q.77.33 1.52-.05a2 2 0 0 0 1.18-1.74q0-.17-.03-.3" clip-rule="evenodd"/>
|
|
93
|
-
</symbol>`,
|
|
93
|
+
</symbol>`,aL=`<symbol id="file-tree-builtin-graphql" viewBox="0 0 16 16">
|
|
94
94
|
<path fill="currentColor" fill-rule="evenodd" d="M8 1a1.25 1.25 0 0 1 1.18 1.65l2.8 1.61q.33-.25.77-.26a1.25 1.25 0 0 1 .48 2.4v3.2a1.25 1.25 0 1 1-1.25 2.13l-2.8 1.62A1.25 1.25 0 0 1 8 15a1.25 1.25 0 0 1-1.18-1.65l-2.8-1.62q-.33.26-.77.27a1.25 1.25 0 0 1-.48-2.4V6.4a1.25 1.25 0 1 1 1.25-2.14l2.8-1.61A1.25 1.25 0 0 1 8 1M4.44 11.14l-.06.13 2.75 1.58a1.25 1.25 0 0 1 1.74 0l2.74-1.58-.05-.13zm3.89-7.68a1.3 1.3 0 0 1-.66 0L4.03 9.77q.37.3.45.78h7.04q.08-.48.45-.78zM4.38 4.73a1.24 1.24 0 0 1-1.02 1.76v3.02l.13.01 3.67-6.35-.03-.02zm4.46-1.56 3.67 6.35.13-.01V6.49a1.25 1.25 0 0 1-1.03-1.76L8.87 3.15z" clip-rule="evenodd"/>
|
|
95
|
-
</symbol>`,
|
|
95
|
+
</symbol>`,oL=`<symbol id="file-tree-builtin-html" viewBox="0 0 16 16">
|
|
96
96
|
<path fill="currentColor" d="M8 1C2.24 1 1 2.24 1 8s1.24 7 7 7 7-1.24 7-7-1.24-7-7-7" class="bg" opacity=".2"/>
|
|
97
97
|
<path fill="currentColor" d="M10.48 3.76a.5.5 0 0 1 .4.58L10.6 5.8h1.14a.5.5 0 0 1 0 1h-1.32L10 9.2h1.08a.5.5 0 0 1 0 1H9.8l-.3 1.64a.5.5 0 1 1-.98-.18l.27-1.46H6.4l-.3 1.64a.5.5 0 1 1-.98-.18l.27-1.46H4.25a.5.5 0 0 1 0-1h1.32L6 6.8H4.93a.5.5 0 0 1 0-1H6.2l.3-1.64a.5.5 0 1 1 .98.18L7.2 5.8h2.4l.3-1.64a.5.5 0 0 1 .58-.4M6.58 9.2h2.4l.44-2.4h-2.4z" class="fg"/>
|
|
98
|
-
</symbol>`,
|
|
98
|
+
</symbol>`,sL=`<symbol id="file-tree-builtin-image" viewBox="0 0 16 16">
|
|
99
99
|
<path fill="currentColor" d="M12.5 2A2.5 2.5 0 0 1 15 4.5v4.67l-4.05-3.54-4.08 4.08-3-2L1 10.6V4.5A2.5 2.5 0 0 1 3.5 2z" opacity=".3"/>
|
|
100
100
|
<path fill="currentColor" d="M15 10.5v1a2.5 2.5 0 0 1-2.5 2.5h-9a2.5 2.5 0 0 1-2.46-2.04L4 9l3 2 4-4zm-7-5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0"/>
|
|
101
|
-
</symbol>`,
|
|
101
|
+
</symbol>`,cL=`<symbol id="file-tree-builtin-javascript" viewBox="0 0 16 16">
|
|
102
102
|
<path fill="currentColor" d="M8 1C2.24 1 1 2.24 1 8s1.24 7 7 7 7-1.24 7-7-1.24-7-7-7" class="bg" opacity=".2"/>
|
|
103
103
|
<path fill="currentColor" d="M8.1 9.64h.95c.04.62.28.76 1.28.76s1.2-.14 1.2-.85c0-.66-.2-.85-1.2-1.07-1.79-.38-2.18-.7-2.18-1.86C8.15 5.3 8.54 5 10.31 5c1.67 0 2.04.26 2.07 1.42h-.95c-.02-.43-.23-.53-1.1-.53-1 0-1.22.14-1.22.74 0 .52.22.7 1.24.92 1.76.38 2.15.73 2.15 2 0 1.44-.4 1.75-2.24 1.75-1.8 0-2.18-.3-2.15-1.66M3.5 9.5h.98c0 .76.15.92.85.92.77 0 .94-.18.94-1.02V5.1h1v4.34c0 1.54-.35 1.87-1.92 1.87-1.55 0-1.89-.32-1.86-1.8"/>
|
|
104
|
-
</symbol>`,
|
|
104
|
+
</symbol>`,lL=`<symbol id="file-tree-builtin-json" viewBox="0 0 16 16">
|
|
105
105
|
<path fill="currentColor" d="M13.25 11.5V9.75a.5.5 0 0 1 .36-.48l.55-.15a1.16 1.16 0 0 0 0-2.24l-.55-.15a.5.5 0 0 1-.36-.48V4.5a2.5 2.5 0 0 0-2.5-2.5h-.25a.5.5 0 0 0 0 1h.25a1.5 1.5 0 0 1 1.5 1.5v1.75a1.5 1.5 0 0 0 1.09 1.44l.54.15a.16.16 0 0 1 0 .32l-.54.15a1.5 1.5 0 0 0-1.09 1.44v1.75a1.5 1.5 0 0 1-1.5 1.5h-.25a.5.5 0 0 0 0 1h.25a2.5 2.5 0 0 0 2.5-2.5m-10.5 0V9.75a.5.5 0 0 0-.36-.48l-.55-.15a1.16 1.16 0 0 1 0-2.24l.55-.15a.5.5 0 0 0 .36-.48V4.5A2.5 2.5 0 0 1 5.25 2h.25a.5.5 0 0 1 0 1h-.25a1.5 1.5 0 0 0-1.5 1.5v1.75a1.5 1.5 0 0 1-1.09 1.44l-.54.15a.16.16 0 0 0 0 .32l.54.15a1.5 1.5 0 0 1 1.09 1.45v1.74a1.5 1.5 0 0 0 1.5 1.5h.25a.5.5 0 0 1 0 1h-.25a2.5 2.5 0 0 1-2.5-2.5"/>
|
|
106
|
-
</symbol
|
|
106
|
+
</symbol>`,uL=`<symbol id="file-tree-builtin-markdown" viewBox="0 0 16 16">
|
|
107
107
|
<path fill="currentColor" d="M1 12V4h2l2 2.5L7 4h2v8H7V7.5l-2 2-2-2V12zm9-3 3 3.5L16 9h-2V4h-2v5z"/>
|
|
108
|
-
</symbol>`,
|
|
108
|
+
</symbol>`,dL=`<symbol id="file-tree-builtin-mcp" viewBox="0 0 16 16">
|
|
109
109
|
<path fill="currentColor" d="M9.26-.04a3 3 0 0 1 2 .82 2.8 2.8 0 0 1 .8 2.35 2.9 2.9 0 0 1 2.41.8l.03.02a2.74 2.74 0 0 1 0 3.94l-5.8 5.69-.04.06-.02.07q0 .04.02.07.01.04.04.06l1.2 1.17a.55.55 0 0 1 0 .79.6.6 0 0 1-.81 0l-1.2-1.17a1.3 1.3 0 0 1 0-1.84L13.7 7.1a1.65 1.65 0 0 0 .37-1.82 2 2 0 0 0-.37-.54l-.03-.03a1.73 1.73 0 0 0-2.4 0L6.47 9.4l-.07.06a.58.58 0 0 1-.92-.18.6.6 0 0 1 .12-.6l4.85-4.76a1.65 1.65 0 0 0 0-2.36 1.73 1.73 0 0 0-2.4 0l-6.43 6.3a.6.6 0 0 1-.8 0 .55.55 0 0 1 0-.8L7.25.79a3 3 0 0 1 2-.82"/>
|
|
110
110
|
<path fill="currentColor" d="M9.26 2.19a.6.6 0 0 1 .52.34.6.6 0 0 1 0 .43l-.12.18L4.9 7.79a1.65 1.65 0 0 0 0 2.36 1.73 1.73 0 0 0 2.4 0l4.75-4.66a.58.58 0 0 1 .93.18.6.6 0 0 1-.12.61l-4.75 4.66a2.9 2.9 0 0 1-4.01 0 2.75 2.75 0 0 1-.62-3.04A3 3 0 0 1 4.1 7l4.74-4.65a.6.6 0 0 1 .4-.16"/>
|
|
111
|
-
</symbol>`,
|
|
111
|
+
</symbol>`,fL=`<symbol id="file-tree-builtin-nextjs" viewBox="0 0 16 16">
|
|
112
112
|
<defs>
|
|
113
113
|
<linearGradient id="a" x1="4.522" x2="14" y1="3.943" y2="16" gradientUnits="userSpaceOnUse">
|
|
114
114
|
<stop stop-color="currentColor"/>
|
|
@@ -118,82 +118,82 @@ Error generating stack: `+e.message+`
|
|
|
118
118
|
<path fill="currentColor" d="M3 2h1.522v9.09H3z"/>
|
|
119
119
|
<path fill="url(#a)" d="M4.903 2 15 15.075q-.565.5-1.195.925L4.522 3.943z"/>
|
|
120
120
|
<path fill="currentColor" d="M12.172 2h-1.508v9.094h1.508z"/>
|
|
121
|
-
</symbol>`,
|
|
121
|
+
</symbol>`,pL=`<symbol id="file-tree-builtin-npm" viewBox="0 0 16 16">
|
|
122
122
|
<path fill="currentColor" d="M2 1a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1z" class="vector" opacity=".2"/>
|
|
123
123
|
<path fill="currentColor" d="M10.5 13H13V3H3v10h5V5.5h2.5z"/>
|
|
124
|
-
</symbol>`,
|
|
124
|
+
</symbol>`,mL=`<symbol id="file-tree-builtin-oxc" viewBox="0 0 16 16">
|
|
125
125
|
<path fill="currentColor" d="M9.5 1a.5.5 0 0 1 .5.5V3h3.5a.5.5 0 0 1 .38.83L10.5 7.69v1.44q.41.04.95-.16a4 4 0 0 0 .72-.35l.04-.03h.01a.5.5 0 0 1 .67.1l2 2.5a.5.5 0 0 1 0 .62c-.76.96-3.14 2.69-6.89 2.69s-6.13-1.73-6.89-2.69a.5.5 0 0 1 0-.62l2-2.5a.5.5 0 0 1 .67-.1l.05.03.16.09q.22.13.56.26.54.2.95.16V7.69L2.12 3.83A.5.5 0 0 1 2.5 3H6V1.5a.5.5 0 0 1 .5-.5zM7 3.5a.5.5 0 0 1-.5.5H3.6l2.78 3.17a.5.5 0 0 1 .12.33v2a.5.5 0 0 1-.28.45c-.7.35-1.5.15-2.02-.05a5 5 0 0 1-.58-.26l-1.46 1.84c.82.78 2.8 2.02 5.84 2.02s5.02-1.24 5.84-2.02l-1.46-1.83a5 5 0 0 1-.58.26c-.52.2-1.33.39-2.02.04a.5.5 0 0 1-.28-.45v-2a.5.5 0 0 1 .12-.33L12.4 4H9.5a.5.5 0 0 1-.5-.5V2H7z"/>
|
|
126
|
-
</symbol>`,
|
|
126
|
+
</symbol>`,hL=`<symbol id="file-tree-builtin-postcss" viewBox="0 0 16 16">
|
|
127
127
|
<path fill="currentColor" d="M14.5 8a6.5 6.5 0 0 0-5.9-6.47l5.42 8.93A7 7 0 0 0 14.5 8M2.88 12A6.5 6.5 0 0 0 8 14.5c2.08 0 3.93-.98 5.12-2.5zm8.62-1h1.68L11.5 8.24zm-1-.55a4 4 0 0 1-.7.55h.7zM8 5.5a2.5 2.5 0 1 0 0 5 2.5 2.5 0 0 0 0-5M5.5 11h.7a4 4 0 0 1-.7-.55zm-2.68 0H4.5V8.24zm3.76-6.2A4 4 0 0 1 8 4.5q.76 0 1.42.3L8 2.46zM1.5 8q0 1.31.48 2.46L7.4 1.53A6.5 6.5 0 0 0 1.5 8m14 0a7.5 7.5 0 0 1-.99 3.72l-.01.03-.02.03A7.5 7.5 0 0 1 8 15.5a7.5 7.5 0 0 1-6.5-3.75l-.01-.03A7.5 7.5 0 1 1 15.5 8"/>
|
|
128
|
-
</symbol>`,
|
|
128
|
+
</symbol>`,gL=`<symbol id="file-tree-builtin-prettier" viewBox="0 0 16 16">
|
|
129
129
|
<path fill="currentColor" d="M6 12v1H4.93v-1zm1-2v1H2v-1zm6-4v1h-3V6zm-1-4v1H9V2z"/>
|
|
130
130
|
<path fill="currentColor" d="M11.5 10v1H8v-1zM5 6v1H2V6zm5-2v1H9V4z" opacity=".8"/>
|
|
131
131
|
<path fill="currentColor" d="M6 14v1H2v-1zm-.5-6v1H2V8zM13 4v1h-3V4zM4.93 2v1H2V2z" opacity=".6"/>
|
|
132
132
|
<path fill="currentColor" d="M4.93 12v1H2v-1zM13 8v1H9V8zM5.5 4v1H2V4zM9 2v1H4.93V2z" opacity=".4"/>
|
|
133
|
-
</symbol>`,
|
|
133
|
+
</symbol>`,_L=`<symbol id="file-tree-builtin-python" viewBox="0 0 16 16">
|
|
134
134
|
<path fill="currentColor" d="M8.33 8.4H10c1.16 0 1.9-.73 1.9-1.86V5.08q0-.24.25-.24h.74c.75 0 1.33.32 1.66.97q.4.73.41 1.46c.09.9.09 1.78-.24 2.67-.25.73-.75 1.3-1.58 1.46h-4.8c-.08 0-.25 0-.25.08v.4s.17.09.25.09h2.82q.34-.02.33.32v1.06c0 .56-.25.97-.75 1.13-.41.16-.83.33-1.24.4a7 7 0 0 1-2.98-.07 3 3 0 0 1-1.16-.49c-.33-.32-.58-.65-.5-1.14v-2.91c0-1.13.67-1.78 1.82-1.78q.89-.1 1.66-.08m2.32 4.86a.65.65 0 0 0-.66-.65c-.34 0-.67.33-.67.65s.33.57.67.65a.65.65 0 0 0 .66-.65" class="bg" opacity=".8"/>
|
|
135
135
|
<path fill="currentColor" d="M7.67 7.6H6c-1.16 0-1.9.73-1.9 1.86v1.46q0 .24-.25.24h-.74c-.75 0-1.33-.32-1.66-.97a3 3 0 0 1-.41-1.46 6 6 0 0 1 .24-2.67c.25-.73.75-1.3 1.58-1.46h4.8c.08 0 .25 0 .25-.08v-.4s-.17-.09-.25-.09H4.85c-.24 0-.33-.08-.33-.32V2.65c0-.56.25-.97.75-1.13.41-.16.83-.33 1.24-.4a7 7 0 0 1 2.98.07c.41.09.83.25 1.16.49.33.32.58.65.5 1.13v2.92c0 1.14-.67 1.78-1.82 1.78-.58.08-1.16.08-1.66.08M5.35 2.73c0 .33.25.65.66.65.33 0 .66-.32.66-.65 0-.32-.33-.56-.66-.64a.65.65 0 0 0-.66.64" class="fg"/>
|
|
136
|
-
</symbol>`,
|
|
136
|
+
</symbol>`,vL=`<symbol id="file-tree-builtin-react" viewBox="0 0 16 16">
|
|
137
137
|
<path fill="currentColor" d="M8 6.65c.73 0 1.31.6 1.31 1.35S8.73 9.35 8 9.35 6.69 8.75 6.69 8 7.27 6.65 8 6.65"/>
|
|
138
138
|
<path fill="currentColor" fill-rule="evenodd" d="M8 2.55c1.3-.99 2.59-1.34 3.5-.8.92.55 1.27 1.87 1.08 3.53C14.06 5.94 15 6.9 15 8s-.94 2.06-2.42 2.72c.19 1.65-.16 2.98-1.08 3.52-.91.55-2.2.2-3.5-.8-1.3 1-2.58 1.35-3.5.8-.91-.54-1.27-1.87-1.08-3.52C1.94 10.06 1 9.1 1 8s.94-2.06 2.42-2.72c-.19-1.66.17-2.98 1.08-3.52s2.2-.2 3.5.8M4.26 11.2c-.08 1.34.28 2.03.68 2.26s1.15.22 2.25-.52l.11-.09a12 12 0 0 1-1.24-1.39 11 11 0 0 1-1.8-.41zm7.47-.15q-.83.27-1.79.41-.6.8-1.24 1.4l.11.08c1.1.74 1.86.76 2.25.52.4-.23.76-.92.68-2.26zm-3.04.54a14 14 0 0 1-1.38 0q.34.38.69.7.35-.32.7-.7M8 5.29q-.76 0-1.47.1A13 13 0 0 0 5.07 8a14 14 0 0 0 1.46 2.62 13 13 0 0 0 2.94 0A13 13 0 0 0 10.93 8a14 14 0 0 0-1.46-2.62A13 13 0 0 0 8 5.3M4.64 9.18q-.15.5-.25.96.44.16.94.27a15 15 0 0 1-.7-1.23m6.73 0a15 15 0 0 1-.7 1.23q.5-.11.95-.27a10 10 0 0 0-.25-.96M3.44 6.26C2.27 6.86 1.87 7.53 1.87 8s.4 1.14 1.57 1.74l.13.07q.18-.88.55-1.81a12 12 0 0 1-.55-1.8q-.07.02-.13.06m8.99-.07A12 12 0 0 1 11.88 8q.36.94.55 1.8l.13-.06c1.17-.6 1.56-1.27 1.56-1.74s-.39-1.14-1.56-1.74zm-7.1-.6q-.5.11-.94.27.1.46.25.96a15 15 0 0 1 .69-1.23m5.34 0a15 15 0 0 1 .7 1.23q.14-.5.24-.96-.44-.15-.94-.27M7.18 3.06c-1.09-.74-1.85-.76-2.24-.52s-.76.92-.69 2.26l.01.15a11 11 0 0 1 1.8-.41q.6-.8 1.24-1.4zm3.88-.52c-.4-.24-1.15-.22-2.25.52l-.12.08q.65.6 1.25 1.4.96.15 1.8.41v-.14c.08-1.35-.28-2.04-.68-2.27M8 3.7a10 10 0 0 0-.7.7 14 14 0 0 1 1.4 0 10 10 0 0 0-.7-.7" clip-rule="evenodd"/>
|
|
139
|
-
</symbol>`,
|
|
139
|
+
</symbol>`,yL=`<symbol id="file-tree-builtin-ruby" viewBox="0 0 16 16">
|
|
140
140
|
<path fill="currentColor" fill-rule="evenodd" d="M11.04 2c.48 0 .92.23 1.18.6l2.54 3.65c.37.52.3 1.23-.15 1.69l-5.58 5.64a1.47 1.47 0 0 1-2.06 0L1.39 7.94a1.3 1.3 0 0 1-.15-1.7l2.54-3.63q.2-.3.5-.45.33-.16.68-.16zm.84 2.17a.5.5 0 0 0-.7-.05L8 6.84 4.83 4.12a.5.5 0 0 0-.65.76L6.65 7H3.5a.5.5 0 0 0 0 1h9a.5.5 0 0 0 0-1H9.35l2.48-2.12a.5.5 0 0 0 .05-.7" clip-rule="evenodd"/>
|
|
141
|
-
</symbol>`,
|
|
141
|
+
</symbol>`,bL=`<symbol id="file-tree-builtin-rust" viewBox="0 0 16 16">
|
|
142
142
|
<path fill="currentColor" fill-rule="evenodd" d="M8 .8a.2.2 0 0 1 .18.1l.38.6.16.02.5-.53.01-.01a.2.2 0 0 1 .33.08l.25.68.16.05.59-.43h.02a.2.2 0 0 1 .3.14l.12.71.15.08.65-.3a.2.2 0 0 1 .2.02.2.2 0 0 1 .1.18l-.03.72.12.1.71-.16a.2.2 0 0 1 .25.25l-.17.7q.06.06.1.13l.73-.03A.2.2 0 0 1 14 4a.2.2 0 0 1 .02.2l-.3.66.08.14.71.12a.2.2 0 0 1 .14.32l-.43.59.05.16.68.25a.2.2 0 0 1 .07.35l-.53.49.01.16.62.38a.2.2 0 0 1 0 .36l-.62.38-.01.16.53.5a.2.2 0 0 1-.07.34l-.68.25-.05.16.43.59a.2.2 0 0 1-.14.32l-.72.12-.07.15.3.65a.2.2 0 0 1-.02.2.2.2 0 0 1-.18.1l-.72-.03-.1.13.16.7a.2.2 0 0 1-.25.25l-.7-.17-.13.1.03.73a.2.2 0 0 1-.1.18.2.2 0 0 1-.2.02l-.66-.3-.14.08-.12.71a.2.2 0 0 1-.32.14l-.59-.43-.16.05-.25.68a.2.2 0 0 1-.34.07l-.5-.53-.16.01-.38.62a.2.2 0 0 1-.36 0l-.38-.62-.16-.01-.5.53a.2.2 0 0 1-.34-.07l-.25-.68-.16-.05-.59.43a.2.2 0 0 1-.32-.14L5 13.78l-.15-.07-.65.3a.2.2 0 0 1-.2-.02.2.2 0 0 1-.1-.18l.03-.72-.13-.1-.7.16a.2.2 0 0 1-.25-.25l.17-.7-.1-.13-.73.03a.2.2 0 0 1-.2-.3l.3-.66-.08-.14-.71-.12a.2.2 0 0 1-.14-.32l.43-.59-.05-.16-.68-.25A.2.2 0 0 1 1 9.22l.53-.5-.02-.16-.6-.38A.2.2 0 0 1 .8 8a.2.2 0 0 1 .1-.18l.6-.38.02-.16-.53-.5a.2.2 0 0 1 .07-.34l.68-.25.05-.16-.43-.59a.2.2 0 0 1 .14-.32L2.2 5l.08-.15L2 4.2a.2.2 0 0 1 .2-.3l.72.03.1-.13-.16-.7a.2.2 0 0 1 .25-.25l.7.16.13-.1-.03-.72A.2.2 0 0 1 4 2a.2.2 0 0 1 .2-.02l.65.3L5 2.2l.12-.71v-.03a.2.2 0 0 1 .32-.1l.59.41.16-.04.25-.68.01-.02A.2.2 0 0 1 6.8.99l.49.53.16-.02.38-.61.02-.02A.2.2 0 0 1 8 .79M6.8 9.45h1.26l.06.01q.03.01.03.05v1.52q0 .07-.09.06h-4.5A5.4 5.4 0 0 0 8 13.42a5.4 5.4 0 0 0 4.45-2.33h-2.42c-.36 0-.68-.5-.77-.75-.08-.22-.2-.91-.25-1.12-.15-.61-.59-.71-.78-.73H6.8zM8 2.58a5.4 5.4 0 0 0-4.07 1.85h5.74l.17.02c.23.03.6.12.96.35.34.23.83.68.83 1.4 0 .66-.55 1.16-1.08 1.5.42.33.7.53.86 1.44.04.17.34.32.62.29.29-.03.62-.16.62-.75v-.24q0-.1.07-.1h.68A5.43 5.43 0 0 0 8 2.59M2.96 6.03a5.4 5.4 0 0 0-.19 3.37h1.66V6.03zM6.8 7.06h1.66c.35 0 .77-.12.77-.47 0-.42-.55-.53-.65-.53H6.8z" clip-rule="evenodd"/>
|
|
143
|
-
</symbol>`,
|
|
143
|
+
</symbol>`,xL=`<symbol id="file-tree-builtin-sass" viewBox="0 0 16 16">
|
|
144
144
|
<path fill="currentColor" fill-rule="evenodd" d="M8.08 1.44c2.41-.91 4.96-.37 5.35 1.27.39 1.62-.92 3.56-2.6 4.25a5 5 0 0 1-3.26.35c-.58-.2-.92-.62-1-.85-.03-.09-.09-.24 0-.3.05-.03.08-.02.22.15s.7.6 1.75.48c2.78-.34 4.45-2.64 3.92-3.88-.37-.87-2.5-1.26-5.18.16C4.03 4.81 3.85 6.24 3.82 6.8c-.08 1.5 1.73 2.28 2.7 3.4q.04.03.07.08c.3-.12.7-.19 1.35-.2 1.58-.03 2.47 1.08 2.43 2.08-.03.78-.7 1.1-.82 1.13-.1.01-.14.02-.15-.06q-.03-.06.13-.15c.16-.09.42-.3.48-.72.05-.43-.24-1.44-1.76-1.63a3 3 0 0 0-1.33.08c.27.62.32 1.87-.29 2.83-.63 1-1.8 1.61-2.93 1.27-.37-.1-.93-.92-.45-2.05.46-1.07 2.4-2.12 2.66-2.26-.9-.83-3.08-1.95-3.4-3.65-.08-.49.13-1.65 1.46-2.98a12 12 0 0 1 4.11-2.52m-1.88 9.7c-.01.01-.9.47-1.52 1.17-.59.66-.75 1.48-.43 1.69.3.18 1-.04 1.51-.62a3 3 0 0 0 .5-.9q.2-.64.02-1.39z" clip-rule="evenodd"/>
|
|
145
|
-
</symbol>`,
|
|
145
|
+
</symbol>`,SL=`<symbol id="file-tree-builtin-stylelint" viewBox="0 0 16 16">
|
|
146
146
|
<path fill="currentColor" d="M4 3v3.5l1.5-1L7 15 .5 6l1-1.5L0 3l2.5-2h1zm12 0-1.5 1.5 1 1.5L9 15l1.5-9.5 1.5 1V3l.5-2h1zm-8 8.5a.5.5 0 1 1 0 1 .5.5 0 0 1 0-1m0-3a.5.5 0 1 1 0 1 .5.5 0 0 1 0-1m0-3a.5.5 0 1 1 0 1 .5.5 0 0 1 0-1"/>
|
|
147
147
|
<path fill="currentColor" d="M6.5 2.5V4l-2 1.5v-4zm5 3L9.5 4V2.5l2-1zM9 4H7V2.5h2z"/>
|
|
148
|
-
</symbol>`,
|
|
148
|
+
</symbol>`,CL=`<symbol id="file-tree-builtin-svelte" viewBox="0 0 16 16">
|
|
149
149
|
<path fill="currentColor" d="m3.98 3.7 3.36-2.08a4.5 4.5 0 0 1 5.9 1.23 4 4 0 0 1 .7 3.02q-.16.75-.58 1.4c.42.77.56 1.66.4 2.52a3.7 3.7 0 0 1-1.57 2.4l-.17.1-3.36 2.09a4.5 4.5 0 0 1-5.9-1.23 4 4 0 0 1-.66-1.44 4 4 0 0 1-.04-1.58 4 4 0 0 1 .58-1.4 4 4 0 0 1-.4-2.52 3.7 3.7 0 0 1 1.57-2.4zl3.36-2.08zm7.87 0a2.7 2.7 0 0 0-1.26-.95 2.7 2.7 0 0 0-1.6-.07 3 3 0 0 0-.52.2l-.16.09-3.36 2.08a2 2 0 0 0-.69.64 2 2 0 0 0-.36.86 2.3 2.3 0 0 0 .42 1.81A2.7 2.7 0 0 0 7.18 9.4q.28-.06.53-.2l.16-.09 1.28-.79.2-.09a.8.8 0 0 1 .87.31.7.7 0 0 1 .13.55.7.7 0 0 1-.24.4l-.08.05-3.36 2.08-.2.09a1 1 0 0 1-.49-.02 1 1 0 0 1-.38-.3 1 1 0 0 1-.13-.37v-.1l.01-.13-.13-.03a4 4 0 0 1-1.1-.5l-.2-.14-.18-.12-.07.18-.08.3a2.3 2.3 0 0 0 .43 1.82q.45.64 1.19.93.73.28 1.51.14l.16-.04q.27-.07.52-.2l.16-.09 3.36-2.08q.4-.25.69-.64.27-.4.36-.86a2.3 2.3 0 0 0-.42-1.82 2.7 2.7 0 0 0-1.27-.95 2.7 2.7 0 0 0-1.6-.08q-.27.07-.52.2l-.16.1-1.28.79-.2.09a1 1 0 0 1-.49-.03 1 1 0 0 1-.38-.29.7.7 0 0 1-.13-.54.7.7 0 0 1 .24-.4l.08-.06L9.33 4.4l.2-.1a.8.8 0 0 1 .87.32 1 1 0 0 1 .13.38v.22l.11.04q.6.18 1.12.5l.2.14.17.12.06-.19.08-.3a2.3 2.3 0 0 0-.42-1.81z"/>
|
|
150
|
-
</symbol>`,
|
|
150
|
+
</symbol>`,wL=`<symbol id="file-tree-builtin-svg" viewBox="0 0 16 16">
|
|
151
151
|
<path fill="currentColor" d="M5 7a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v6a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2z"/>
|
|
152
152
|
<path fill="currentColor" d="M6 1a5 5 0 0 1 4.58 3H7a3 3 0 0 0-3 3v3.58A5 5 0 0 1 6 1" opacity=".5"/>
|
|
153
|
-
</symbol>`,
|
|
153
|
+
</symbol>`,TL=`<symbol id="file-tree-builtin-svgo" viewBox="0 0 16 16">
|
|
154
154
|
<path fill="currentColor" d="M9.43 4.8A.6.6 0 1 1 9.19 6l-.56.96a1.2 1.2 0 0 1 .32 1.58l.7.53a.89.89 0 1 1-.17.22l-.7-.52a1.2 1.2 0 0 1-1.4.25l-.56.87a.75.75 0 1 1-.57-.2 1 1 0 0 1 .32.05l.56-.87a1.2 1.2 0 0 1-.4-1.24l-1.2-.47a.56.56 0 1 1 .1-.28v.02l1.2.47a1.2 1.2 0 0 1 1.56-.55l.56-.97a.6.6 0 0 1-.15-.64.6.6 0 0 1 .63-.4"/>
|
|
155
155
|
<path fill="currentColor" fill-rule="evenodd" d="M9.17 1q.16.63.27 1.26a6 6 0 0 1 1.61.67q.52-.38 1.08-.71l1.65 1.64q-.32.56-.68 1.05.48.78.72 1.67.6.09 1.18.25v2.32q-.55.15-1.11.24a6 6 0 0 1-.7 1.82q.31.44.59.91l-1.65 1.65-.85-.55a6 6 0 0 1-1.9.83q-.08.47-.2.95H6.84q-.12-.46-.2-.93a6 6 0 0 1-1.96-.81q-.39.27-.8.51l-1.65-1.65q.25-.43.53-.84a6 6 0 0 1-.75-1.9L1 9.16V6.83q.54-.14 1.09-.24a6 6 0 0 1 .77-1.74q-.33-.47-.63-.98l1.65-1.65q.54.32 1.03.68a6 6 0 0 1 1.66-.66q.1-.61.26-1.24zM7.96 3.73a4 4 0 0 0-1.74.36 4.5 4.5 0 0 0-2.3 2.3 4.4 4.4 0 0 0-.1 3.29l.03.06a4.4 4.4 0 0 0 2.4 2.47 4.4 4.4 0 0 0 3.48-.02l.03-.02a4.4 4.4 0 0 0 2.3-2.42l.06-.14a4.4 4.4 0 0 0-.2-3.4 4.4 4.4 0 0 0-2.13-2.07L9.47 4a4 4 0 0 0-1.51-.27" clip-rule="evenodd"/>
|
|
156
|
-
</symbol>`,
|
|
156
|
+
</symbol>`,EL=`<symbol id="file-tree-builtin-swift" viewBox="0 0 16 16">
|
|
157
157
|
<path fill="currentColor" d="M9.63 1c6.15 4.35 4.16 9.15 4.16 9.15s1.75 2.05 1.04 3.85c0 0-.72-1.26-1.93-1.26-1.17 0-1.85 1.26-4.2 1.26C3.47 14 1 9.46 1 9.46c4.71 3.22 7.93.94 7.93.94C6.8 9.12 2.29 3 2.29 3c3.93 3.47 5.63 4.39 5.63 4.39-1.01-.87-3.86-5.13-3.86-5.13C6.34 4.66 10.86 8 10.86 8c1.28-3.7-1.23-7-1.23-7"/>
|
|
158
|
-
</symbol>`,
|
|
158
|
+
</symbol>`,DL=`<symbol id="file-tree-builtin-table" viewBox="0 0 16 16">
|
|
159
159
|
<path fill="currentColor" d="M8 4a3 3 0 0 0 3 3h3v5.5a2.5 2.5 0 0 1-2.5 2.5h-7A2.5 2.5 0 0 1 2 12.5v-9A2.5 2.5 0 0 1 4.5 1H8z" class="bg" opacity=".4"/>
|
|
160
160
|
<path fill="currentColor" d="M11.5 8a.5.5 0 0 1 .5.5v4a.5.5 0 0 1-.5.5h-7a.5.5 0 0 1-.5-.5v-4a.5.5 0 0 1 .5-.5zM5 12h2.5v-1H5zm3.5 0H11v-1H8.5zM5 10h2.5V9H5zm3.5 0H11V9H8.5zm1-9a.5.5 0 0 1 .354.146l4 4A.5.5 0 0 1 14 5.5V6h-3a2 2 0 0 1-2-2V1z" class="fg"/>
|
|
161
|
-
</symbol>`,
|
|
161
|
+
</symbol>`,OL=`<symbol id="file-tree-builtin-tailwind" viewBox="0 0 16 16">
|
|
162
162
|
<path fill="currentColor" fill-rule="evenodd" d="M8 4Q5.2 4 4.5 6.67q1.05-1.34 2.45-1c.53.12.91.5 1.33.9C8.98 7.23 9.77 8 11.5 8q2.8 0 3.5-2.67-1.05 1.34-2.45 1c-.53-.12-.91-.5-1.33-.9C10.52 4.77 9.73 4 8 4M4.5 8Q1.7 8 1 10.67q1.05-1.34 2.45-1c.53.12.91.5 1.33.9C5.48 11.23 6.26 12 8 12q2.8 0 3.5-2.67-1.05 1.34-2.45 1c-.53-.12-.91-.5-1.33-.9C7.02 8.77 6.24 8 4.5 8" clip-rule="evenodd"/>
|
|
163
|
-
</symbol>`,
|
|
163
|
+
</symbol>`,kL=`<symbol id="file-tree-builtin-terraform" viewBox="0 0 16 16">
|
|
164
164
|
<path fill="currentColor" d="M1 0v5.05l4.35 2.53V2.53zm9.18 5.34L5.83 2.82v5.05l4.35 2.53zm.47 5.06V5.34L15 2.82v5.05zm-.48 5.6-4.35-2.53V8.42l4.35 2.53z"/>
|
|
165
|
-
</symbol>`,
|
|
165
|
+
</symbol>`,AL=`<symbol id="file-tree-builtin-text" viewBox="0 0 16 16">
|
|
166
166
|
<path fill="currentColor" fill-rule="evenodd" d="M8 4a3 3 0 0 0 3 3h3v5.5a2.5 2.5 0 0 1-2.5 2.5h-7A2.5 2.5 0 0 1 2 12.5v-9A2.5 2.5 0 0 1 4.5 1H8z" class="bg" clip-rule="evenodd" opacity=".4"/>
|
|
167
167
|
<path fill="currentColor" d="M8.5 11a.5.5 0 0 1 0 1h-3a.5.5 0 0 1 0-1zm2-2a.5.5 0 0 1 0 1h-5a.5.5 0 0 1 0-1zm-1-8a.5.5 0 0 1 .354.146l4 4A.5.5 0 0 1 14 5.5V6h-3a2 2 0 0 1-2-2V1z"/>
|
|
168
|
-
</symbol>`,
|
|
168
|
+
</symbol>`,jL=`<symbol id="file-tree-builtin-typescript" viewBox="0 0 16 16">
|
|
169
169
|
<path fill="currentColor" d="M8 1C2.24 1 1 2.24 1 8s1.24 7 7 7 7-1.24 7-7-1.24-7-7-7" class="bg" opacity=".2"/>
|
|
170
170
|
<path fill="currentColor" d="M8.1 9.64h.95c.04.62.28.76 1.28.76s1.2-.14 1.2-.85c0-.66-.2-.85-1.2-1.07-1.79-.38-2.18-.7-2.18-1.86C8.15 5.3 8.54 5 10.31 5c1.67 0 2.04.26 2.07 1.42h-.95c-.02-.43-.23-.53-1.1-.53-1 0-1.22.14-1.22.74 0 .52.22.7 1.24.92 1.76.38 2.15.73 2.15 2 0 1.44-.4 1.75-2.24 1.75-1.8 0-2.18-.3-2.15-1.66m-3 1.57V5.99H3.5v-.9h4.21v.9H6.1v5.22z"/>
|
|
171
|
-
</symbol>`,
|
|
171
|
+
</symbol>`,ML=`<symbol id="file-tree-builtin-vite" viewBox="0 0 16 16">
|
|
172
172
|
<path fill="currentColor" d="M8.57 14.87c-.18.26-.55.11-.55-.22v-3.18l-.05-.27-.13-.22-.2-.15-.24-.06H4.29c-.26 0-.4-.32-.26-.55L6.08 7c.3-.46 0-1.1-.5-1.1H1.8c-.25 0-.4-.32-.25-.56l2.65-4.2A.3.3 0 0 1 4.46 1h7.9c.26 0 .4.32.26.55l-2.05 3.23c-.29.46 0 1.1.5 1.1h3.12c.26 0 .4.34.24.57z"/>
|
|
173
|
-
</symbol>`,
|
|
173
|
+
</symbol>`,NL=`<symbol id="file-tree-builtin-vscode" viewBox="0 0 16 16">
|
|
174
174
|
<path fill="currentColor" d="m5.11 9.68-2.4 1.84a.6.6 0 0 1-.75-.04l-.77-.7a.6.6 0 0 1 0-.87L3.28 8zm5.52-8.42a.51.51 0 0 1 .87.36V4.8L7.32 8 5.1 6.32z" opacity=".75"/>
|
|
175
175
|
<path fill="currentColor" d="M11.1 14.99h.03zM1.96 4.52a.6.6 0 0 1 .75-.04l8.8 6.71v3.19a.51.51 0 0 1-.88.36L1.19 6.1a.6.6 0 0 1 0-.87z" opacity=".65"/>
|
|
176
176
|
<path fill="currentColor" d="M11.62 14.91a.9.9 0 0 1-1-.17.51.51 0 0 0 .88-.36V1.62a.51.51 0 0 0-.87-.36.9.9 0 0 1 1-.17l2.87 1.39a.9.9 0 0 1 .5.8v9.44a.9.9 0 0 1-.5.8z"/>
|
|
177
|
-
</symbol>`,
|
|
177
|
+
</symbol>`,PL=`<symbol id="file-tree-builtin-vue" viewBox="0 0 16 16">
|
|
178
178
|
<path fill="currentColor" d="M9.62 2.25 8 5.02 6.38 2.25H1l7 12 7-12z" opacity=".5"/>
|
|
179
179
|
<path fill="currentColor" d="M9.54 2.25 8 4.95l-1.54-2.7H4l4 7 4-7z"/>
|
|
180
|
-
</symbol>`,
|
|
180
|
+
</symbol>`,FL=`<symbol id="file-tree-builtin-wasm" viewBox="0 0 16 16">
|
|
181
181
|
<path fill="currentColor" d="M13 1a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h3a2 2 0 1 0 4 0z" class="subtract" opacity=".2"/>
|
|
182
182
|
<path fill="currentColor" d="M4.64 11.4h.02l.8-3.4h.91l.73 3.45L7.88 8h.96l-1.25 5h-.97L5.9 9.6 5.1 13h-1L3 8h.98z"/>
|
|
183
183
|
<path fill="currentColor" fill-rule="evenodd" d="M13 13h-1.02l-.33-1.11H9.9L9.64 13h-.97l1.26-5h1.54zm-2.49-3.77-.42 1.84h1.32l-.49-1.84z" clip-rule="evenodd"/>
|
|
184
|
-
</symbol>`,
|
|
184
|
+
</symbol>`,IL=`<symbol id="file-tree-builtin-webpack" viewBox="0 0 16 16">
|
|
185
185
|
<path fill="currentColor" d="M14.1 11.79 8.26 15v-2.5l3.64-1.94zm.4-.35V4.73l-2.14 1.2v4.3zm-12.6.35L7.74 15v-2.5L4.1 10.56zm-.4-.35V4.73l2.14 1.2v4.3zm.25-7.15 6-3.29v2.42L3.9 5.47l-.03.01zm12.5 0L8.25 1v2.42l3.85 2.05.03.01z" class="bg" opacity=".4"/>
|
|
186
186
|
<path fill="currentColor" d="m7.74 11.93-3.59-1.92v-3.8l3.6 2.02zm.52 0 3.59-1.92v-3.8l-3.6 2.02zM4.4 5.77 8 3.85l3.6 1.93L8 7.8z" class="fg"/>
|
|
187
|
-
</symbol>`,
|
|
187
|
+
</symbol>`,LL=`<symbol id="file-tree-builtin-yml" viewBox="0 0 16 16">
|
|
188
188
|
<path fill="currentColor" d="M7.5 2A1.5 1.5 0 0 1 9 3.5v3A1.5 1.5 0 0 1 7.5 8h-2v2A1.5 1.5 0 0 0 7 11.5v-1A1.5 1.5 0 0 1 8.5 9h5a1.5 1.5 0 0 1 1.5 1.5v3a1.5 1.5 0 0 1-1.5 1.5h-5A1.5 1.5 0 0 1 7 13.5v-1A2.5 2.5 0 0 1 4.5 10V8h-2A1.5 1.5 0 0 1 1 6.5v-3A1.5 1.5 0 0 1 2.5 2zm1 8a.5.5 0 0 0-.5.5v3a.5.5 0 0 0 .5.5h5a.5.5 0 0 0 .5-.5v-3a.5.5 0 0 0-.5-.5zm-6-7a.5.5 0 0 0-.5.5v3a.5.5 0 0 0 .5.5h5a.5.5 0 0 0 .5-.5v-3a.5.5 0 0 0-.5-.5z"/>
|
|
189
|
-
</symbol>`,
|
|
189
|
+
</symbol>`,RL=`<symbol id="file-tree-builtin-zig" viewBox="0 0 16 16">
|
|
190
190
|
<path fill="currentColor" d="m14.73 1.5-7.29 8.82h4.17l-1.73 2.04H5.76L1.27 14.5l7.3-8.91H4.39l1.73-2.05h4.12z"/>
|
|
191
191
|
<path fill="currentColor" d="M5.21 3.54 3.56 5.6h-.55v4.73h.83L2.1 12.36H1V3.54zm9.79 0v8.82h-4.3l1.74-2.04h.55V5.68h-.83l1.74-2.14z"/>
|
|
192
|
-
</symbol>`,
|
|
192
|
+
</symbol>`,zL=[UI,JI,XI,ZI,QI,$I,nL,rL,iL,oL,sL,cL,lL,uL,dL,_L,yL,bL,EL,DL,AL,jL,`<symbol id="file-tree-builtin-zip" viewBox="0 0 16 16">
|
|
193
193
|
<path fill="currentColor" d="M4.585 2a2 2 0 0 1 1.028.285l1.788 1.072a1 1 0 0 0 .514.143H12A2 2 0 0 1 13.935 5H0V4a2 2 0 0 1 2-2z" class="bg" opacity=".5"/>
|
|
194
194
|
<path fill="currentColor" fill-rule="evenodd" d="M14 12a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2v-1.25h1v-1H0V6h14zM9.9 8.25c-.883 0-1.9.5-1.9.5H7v1h1v1s1.017.5 1.9.5c.884 0 1.6-.672 1.6-1.5s-.716-1.5-1.6-1.5M2 9.75v1h1v-1zm2 0v1h1v-1zm2 0v1h1v-1zm-5-1v1h1v-1zm2 0v1h1v-1zm2 0v1h1v-1z" class="fg" clip-rule="evenodd"/>
|
|
195
|
-
</symbol>`],
|
|
196
|
-
`)}\n</svg>`)}var jL=AL(kI,OL),ML={minimal:kI,standard:jL,complete:AL(jL,kL)},NL={".babelrc":`babel`,".babelrc.json":`babel`,".bash_profile":`bash`,".bashrc":`bash`,".browserslistrc":`browserslist`,".dockerignore":`docker`,".eslintignore":`eslint`,".eslintrc":`eslint`,".eslintrc.cjs":`eslint`,".eslintrc.js":`eslint`,".eslintrc.json":`eslint`,".eslintrc.yaml":`eslint`,".eslintrc.yml":`eslint`,".gitattributes":`git`,".gitignore":`git`,".gitkeep":`git`,".gitmodules":`git`,".oxlintrc.json":`oxc`,".postcssrc":`postcss`,".postcssrc.json":`postcss`,".postcssrc.yaml":`postcss`,".postcssrc.yml":`postcss`,".prettierignore":`prettier`,".prettierrc":`prettier`,".prettierrc.cjs":`prettier`,".prettierrc.js":`prettier`,".prettierrc.json":`prettier`,".prettierrc.mjs":`prettier`,".prettierrc.toml":`prettier`,".prettierrc.yaml":`prettier`,".prettierrc.yml":`prettier`,".stylelintignore":`stylelint`,".stylelintrc":`stylelint`,".stylelintrc.cjs":`stylelint`,".stylelintrc.js":`stylelint`,".stylelintrc.json":`stylelint`,".stylelintrc.mjs":`stylelint`,".stylelintrc.yaml":`stylelint`,".stylelintrc.yml":`stylelint`,".terraform.lock.hcl":`terraform`,".zprofile":`bash`,".zshenv":`bash`,".zshrc":`bash`,"babel.config.cjs":`babel`,"babel.config.js":`babel`,"babel.config.json":`babel`,"babel.config.mjs":`babel`,"biome.json":`biome`,"biome.jsonc":`biome`,"bootstrap.bundle.js":`bootstrap`,"bootstrap.bundle.min.js":`bootstrap`,"bootstrap.css":`bootstrap`,"bootstrap.js":`bootstrap`,"bootstrap.min.css":`bootstrap`,"bootstrap.min.js":`bootstrap`,"bun.lock":`bun`,"bun.lockb":`bun`,"bunfig.toml":`bun`,"claude.md":`claude`,"compose.yaml":`docker`,"compose.yml":`docker`,"docker-compose.override.yml":`docker`,"docker-compose.yaml":`docker`,"docker-compose.yml":`docker`,dockerfile:`docker`,"eslint.config.cjs":`eslint`,"eslint.config.js":`eslint`,"eslint.config.mjs":`eslint`,"eslint.config.mts":`eslint`,"eslint.config.ts":`eslint`,gemfile:`ruby`,"next.config.js":`nextjs`,"next.config.mjs":`nextjs`,"next.config.mts":`nextjs`,"next.config.ts":`nextjs`,"postcss.config.cjs":`postcss`,"postcss.config.js":`postcss`,"postcss.config.mjs":`postcss`,"postcss.config.ts":`postcss`,"prettier.config.cjs":`prettier`,"prettier.config.js":`prettier`,"prettier.config.mjs":`prettier`,rakefile:`ruby`,"readme.md":`markdown`,"stylelint.config.cjs":`stylelint`,"stylelint.config.js":`stylelint`,"stylelint.config.mjs":`stylelint`,"svgo.config.cjs":`svgo`,"svgo.config.js":`svgo`,"svgo.config.mjs":`svgo`,"svgo.config.ts":`svgo`,"tailwind.config.cjs":`tailwind`,"tailwind.config.js":`tailwind`,"tailwind.config.mjs":`tailwind`,"tailwind.config.ts":`tailwind`,"vite.config.js":`vite`,"vite.config.mjs":`vite`,"vite.config.mts":`vite`,"vite.config.ts":`vite`,"webpack.config.babel.js":`webpack`,"webpack.config.cjs":`webpack`,"webpack.config.js":`webpack`,"webpack.config.mjs":`webpack`,"webpack.config.ts":`webpack`},PL={"7z":`zip`,astro:`astro`,AUTHORS:`text`,avif:`image`,bash:`bash`,bmp:`image`,bz2:`zip`,c:`c`,cc:`cpp`,cfg:`text`,CHANGELOG:`text`,cjs:`javascript`,"code-workspace":`vscode`,conf:`text`,CONTRIBUTORS:`text`,cpp:`cpp`,csh:`bash`,css:`css`,csv:`table`,cts:`typescript`,cxx:`cpp`,db:`database`,editorconfig:`text`,env:`text`,"env.development":`text`,"env.local":`text`,"env.production":`text`,eot:`font`,erb:`ruby`,fish:`bash`,gemspec:`ruby`,gif:`image`,go:`go`,gql:`graphql`,graphql:`graphql`,gz:`zip`,h:`c`,hh:`cpp`,hpp:`cpp`,htm:`html`,html:`html`,hxx:`cpp`,icns:`image`,ico:`image`,ini:`text`,inl:`cpp`,jar:`zip`,jpeg:`image`,jpg:`image`,js:`javascript`,json:`json`,json5:`json`,jsonc:`json`,jsonl:`json`,jsx:`javascript`,ksh:`bash`,less:`css`,LICENSE:`text`,log:`text`,markdown:`markdown`,mcp:`mcp`,md:`markdown`,mdx:`markdown`,"mdx.tsx":`markdown`,mjs:`javascript`,mm:`cpp`,mts:`typescript`,ods:`table`,otf:`font`,png:`image`,postcss:`css`,py:`python`,pyi:`python`,pyw:`python`,pyx:`python`,rake:`ruby`,rar:`zip`,rb:`ruby`,rs:`rust`,rst:`text`,rtf:`text`,sass:`css`,scss:`css`,sh:`bash`,sql:`database`,sqlite:`database`,sqlite3:`database`,styl:`css`,svelte:`svelte`,svg:`svg`,swift:`swift`,tar:`zip`,tf:`terraform`,tfstate:`terraform`,tfvars:`terraform`,tgz:`zip`,tif:`image`,tiff:`image`,ts:`typescript`,tsv:`table`,tsx:`typescript`,ttf:`font`,txt:`text`,vue:`vue`,war:`zip`,wasm:`wasm`,wast:`wasm`,wat:`wasm`,webp:`image`,woff:`font`,woff2:`font`,xhtml:`html`,xls:`table`,xlsx:`table`,xz:`zip`,yaml:`yml`,yml:`yml`,zig:`zig`,zip:`zip`,zsh:`bash`},FL={jsx:`react`,sass:`sass`,scss:`sass`,tsx:`react`},IL=new Set([`bash`,`c`,`cpp`,`css`,`database`,`default`,`font`,`git`,`go`,`html`,`image`,`javascript`,`json`,`markdown`,`mcp`,`python`,`ruby`,`rust`,`swift`,`table`,`text`,`typescript`,`zip`]),LL=new Set([`complete`]);function RL(e){return ML[e===`none`?`minimal`:e]}function zL(e){return`file-tree-builtin-${e}`}function BL(e){return e!==`none`&&LL.has(e)}function VL(e,t,n){if(e===`minimal`||e===`none`)return;let r=e===`complete`,i=NL[t.toLowerCase()];if(i!=null&&(r||IL.has(i)))return i;for(let e of n){if(r){let t=FL[e];if(t!=null)return t}let t=PL[e];if(t!=null&&(r||IL.has(t)))return t}return`default`}var HL=`file-tree-container`,UL=`data-file-tree-style`,WL=`data-file-tree-unsafe-css`,GL=`data-file-tree-scrollbar-measure`,KL=`data-file-tree-scrollbar-gutter-measured`,qL=`--trees-scrollbar-gutter-measured`,JL=`header`,YL=`context-menu`,XL=`context-menu-trigger`;function ZL(e){return e.spriteSheet!=null||e.remap!=null||e.byFileName!=null||e.byFileExtension!=null||e.byFileNameContains!=null}function QL(e){return e==null?{set:`complete`,colored:!0}:typeof e==`string`?{set:e,colored:!0}:{...e,set:e.set??(ZL(e)?`none`:`complete`),colored:e.colored??!0}}var $L=e=>e.trim().toLowerCase(),eR=e=>e.split(`/`).at(-1)??e,tR=e=>{let t=e.toLowerCase().split(`.`),n=[];for(let e=1;e<t.length;e+=1)n.push(t.slice(e).join(`.`));return n};function nR(e,t){return typeof e==`string`?{name:e,remappedFrom:t}:{...e,remappedFrom:t}}function rR(e){let t=QL(e),n=t.remap,r=new Map;for(let[e,n]of Object.entries(t.byFileName??{}))r.set(e.toLowerCase(),n);let i=new Map;for(let[e,n]of Object.entries(t.byFileExtension??{}))i.set($L(e),n);let a=Object.entries(t.byFileNameContains??{}).map(([e,t])=>[e.toLowerCase(),t]);return{resolveIcon:(e,o)=>{if(e===`file-tree-icon-file`&&o!=null){let n=eR(o),s=n.toLowerCase(),c=r.get(s);if(c!=null)return nR(c,e);for(let[t,n]of a)if(s.includes(t))return nR(n,e);let l=tR(n);for(let t of l){let n=i.get(t);if(n!=null)return nR(n,e)}let u=VL(t.set,n,l);if(u!=null&&t.set!==`none`)return{name:zL(u),remappedFrom:e,token:u}}let s=n?.[e];return s==null?{name:e}:nR(s,e)}}}var iR=/^#(?:[0-9a-f]{3}0|[0-9a-f]{6}00)$/i,aR=/^0(?:\.0+)?%?$/;function oR(e){let t=e.indexOf(`(`);if(t<=0||!e.endsWith(`)`))return;let n=e.slice(0,t).trim();if(!/^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color)$/i.test(n))return;let r=e.slice(t+1,-1).trim();if(r.length===0)return;let i=r.lastIndexOf(`/`);if(i!==-1)return r.slice(i+1).trim();if(/^(?:rgba|hsla)$/i.test(n)){let e=r.split(`,`);if(e.length===4)return e[3]?.trim()}}function sR(e){if(e==null)return!1;let t=e.trim().toLowerCase();if(t===`transparent`||iR.test(t))return!0;let n=oR(t);return n!=null&&aR.test(n)}function cR(e){return sR(e)?void 0:e}function lR(e){let t=e.colors??{},n=t[`sideBar.background`]??t[`editor.background`]??e.bg,r=t[`sideBar.foreground`]??t[`editor.foreground`]??e.fg,i=t[`sideBar.border`],a=t[`list.activeSelectionForeground`]??t[`sideBar.foreground`],o=n?.toLowerCase(),s=t[`list.hoverBackground`],c=s?.toLowerCase()===o?void 0:s,l=t[`list.activeSelectionBackground`],u=l?.toLowerCase()===o?t[`list.focusBackground`]??t[`editor.selectionBackground`]:l??t[`editor.selectionBackground`],d=cR(t[`list.focusOutline`])??cR(t.focusBorder),f=t[`input.background`]??n,p=t[`input.border`],m=t[`scrollbarSlider.background`],h=t[`sideBarSectionHeader.foreground`]??r,g=t[`gitDecoration.addedResourceForeground`]??t[`terminal.ansiGreen`]??t[`editorGutter.addedBackground`],_=t[`gitDecoration.modifiedResourceForeground`]??t[`terminal.ansiBlue`]??t[`editorGutter.modifiedBackground`],v=t[`gitDecoration.deletedResourceForeground`]??t[`terminal.ansiRed`]??t[`editorGutter.deletedBackground`],y=e.type===`dark`,b={colorScheme:y?`dark`:`light`,backgroundColor:n??``,color:r??``,borderColor:`var(--trees-theme-sidebar-border, light-dark(oklch(0% 0 0 / 0.15), oklch(100% 0 0 / 0.15)))`,"--trees-theme-sidebar-bg":n??``,"--trees-theme-sidebar-fg":r??``,"--trees-theme-sidebar-header-fg":h??``,"--trees-theme-list-active-selection-fg":a??r??``,"--trees-theme-list-hover-bg":c??(y?`rgba(255,255,255,0.08)`:`rgba(0,0,0,0.06)`),"--trees-theme-list-active-selection-bg":u??`transparent`,"--trees-theme-focus-ring":d??r??``,"--trees-theme-input-bg":f??``};return i!=null&&i!==``&&(b[`--trees-theme-sidebar-border`]=i),p!=null&&p!==``&&(b[`--trees-theme-input-border`]=p),m!=null&&m!==``&&(b[`--trees-theme-scrollbar-thumb`]=m),g!=null&&g!==``&&(b[`--trees-theme-git-added-fg`]=g),_!=null&&_!==``&&(b[`--trees-theme-git-modified-fg`]=_),v!=null&&v!==``&&(b[`--trees-theme-git-deleted-fg`]=v),b}var uR=5,dR=1<<uR,fR=dR*4;function pR(){return{childIdByNameId:new Map,childIds:[],childPositionById:new Map,childVisibleChunkSums:null,totalChildSubtreeNodeCount:0,totalChildVisibleSubtreeCount:0}}function mR(){return{childIdByNameId:null,childIds:[],childPositionById:null,childVisibleChunkSums:null,totalChildSubtreeNodeCount:0,totalChildVisibleSubtreeCount:0}}function hR(e,t){if(t.childIdByNameId!=null)return t.childIdByNameId;let n=new Map;for(let r of t.childIds){let t=e[r];t!=null&&n.set(t.nameId,r)}return t.childIdByNameId=n,n}function gR(e){if(e.childPositionById!=null)return e.childPositionById;let t=new Map;for(let n=0;n<e.childIds.length;n++){let r=e.childIds[n];r!=null&&t.set(r,n)}return e.childPositionById=t,t}function _R(e,t){e.childPositionById!=null&&e.childPositionById.set(t,e.childIds.length),e.childIds.push(t)}function vR(e,t){if(e.childPositionById!=null)for(let n=t;n<e.childIds.length;n++){let t=e.childIds[n];t!=null&&e.childPositionById.set(t,n)}}function yR(e,t){let n=0,r=0;for(let i of t.childIds){let t=e[i];t!=null&&(n+=t.subtreeNodeCount,r+=t.visibleSubtreeCount)}t.totalChildSubtreeNodeCount=n,t.totalChildVisibleSubtreeCount=r,CR(e,t)}function bR(e,t,n,r){if(e.totalChildSubtreeNodeCount+=n,e.totalChildVisibleSubtreeCount+=r,e.childVisibleChunkSums==null||r===0)return;let i=gR(e).get(t);if(i===void 0)return;let a=i>>uR;e.childVisibleChunkSums[a]+=r}function xR(e,t,n){let r=t.childVisibleChunkSums;if(r!=null){let i=n,a=0;for(let o of r){if(i<o){let r=wR(e,t,a,i);return{...r,childVisibleIndex:n-r.localVisibleIndex}}i-=o,a+=dR}throw Error(`Visible child index ${String(n)} is out of range`)}let i=n;for(let r=0;r<t.childIds.length;r++){let a=t.childIds[r];if(a==null)continue;let o=e[a];if(o!=null){if(i<o.visibleSubtreeCount)return{childIndex:r,childVisibleIndex:n-i,localVisibleIndex:i};i-=o.visibleSubtreeCount}}throw Error(`Visible child index ${String(n)} is out of range`)}function SR(e,t,n){let r=0,i=t.childVisibleChunkSums,a=0;if(i!=null){let e=n>>uR;for(let t=0;t<e;t+=1)r+=i[t]??0;a=e<<uR}for(let i=a;i<n;i+=1){let n=t.childIds[i];if(n==null)continue;let a=e[n];a!=null&&(r+=a.visibleSubtreeCount)}return r}function CR(e,t){if(t.childIds.length<fR){t.childVisibleChunkSums=null;return}let n=Math.ceil(t.childIds.length/dR),r=new Int32Array(n);for(let n=0;n<t.childIds.length;n++){let i=t.childIds[n];if(i==null)continue;let a=e[i];a!=null&&(r[n>>uR]+=a.visibleSubtreeCount)}t.childVisibleChunkSums=r}function wR(e,t,n,r){let i=Math.min(t.childIds.length,n+dR),a=r;for(let r=n;r<i;r++){let n=t.childIds[r];if(n==null)continue;let i=e[n];if(i!=null){if(a<i.visibleSubtreeCount)return{childIndex:r,localVisibleIndex:a};a-=i.visibleSubtreeCount}}throw Error(`Visible child index ${String(r)} is out of range`)}var TR=7,ER=3,DR=1<<ER,OR=4;function kR(e,t,n=0){return e<<OR|n<<ER|t}function AR(e){return e.depthAndFlags>>>OR}function jR(e){return(e.depthAndFlags&DR)>>ER}function MR(e){return(e.depthAndFlags&DR)!==0}function NR(e){return e.depthAndFlags&TR}function PR(e,t){return(NR(e)&t)!==0}function FR(e,t){e.depthAndFlags|=t}function IR(e,t){e.depthAndFlags=kR(t,NR(e),jR(e))}var LR=Symbol(`benchmarkInstrumentation`);function RR(e,t){return t==null||Object.defineProperty(e,LR,{configurable:!0,enumerable:!1,value:t,writable:!1}),e}function zR(e){return e==null?null:e[LR]??null}function BR(e,t,n){return e==null?n():e.measurePhase(t,n)}function VR(e,t,n){!Number.isFinite(n)||e==null||e.setCounter(t,n)}function HR(e){return e>=48&&e<=57}function UR(e){let t=[],n=0,r=0;for(;r<e.length;){for(;r<e.length&&!HR(e.charCodeAt(r));)r+=1;if(r>=e.length)break;r>n&&t.push(e.slice(n,r));let i=0;for(;r<e.length&&HR(e.charCodeAt(r));)i=i*10+(e.charCodeAt(r)-48),r+=1;t.push(i),n=r}return(n<e.length||t.length===0)&&t.push(e.slice(n)),t}function WR(e){let t=e.toLowerCase();return{lowerValue:t,tokens:UR(t)}}function GR(e,t){let n=Math.min(e.length,t.length);for(let r=0;r<n;r++){let n=e[r],i=t[r];if(n===i)continue;if(typeof n==`number`&&typeof i==`number`)return n<i?-1:1;let a=String(n),o=String(i);if(a!==o)return a<o?-1:1}return e.length===t.length?0:e.length<t.length?-1:1}function KR(e,t){if(e.tokens.length===1&&t.tokens.length===1&&typeof e.tokens[0]==`string`&&typeof t.tokens[0]==`string`)return e.lowerValue===t.lowerValue?0:e.lowerValue<t.lowerValue?-1:1;let n=GR(e.tokens,t.tokens);return n===0?e.lowerValue===t.lowerValue?0:e.lowerValue<t.lowerValue?-1:1:n}function qR(e,t,n){let r=KR(n(e),n(t));return r===0?e===t?0:e<t?-1:1:r}function JR(e,t){return qR(e,t,WR)}function YR(e,t){return t===e.segments.length-1?+!!e.isDirectory:1}function XR(e,t){let n=Math.min(e.segments.length,t.segments.length);for(let r=0;r<n;r++){let n=e.segments[r],i=t.segments[r];if(n===i)continue;let a=YR(e,r);return a===YR(t,r)?JR(n,i):a===1?-1:1}return e.segments.length===t.segments.length?e.isDirectory===t.isDirectory?0:e.isDirectory?-1:1:e.segments.length<t.segments.length?-1:1}function ZR(e,t){return XR(e,t)}function QR(e,t,n){let r=e=>{let t=n.get(e);if(t!=null)return t;let r=WR(e);return n.set(e,r),r},i=Math.min(e.segments.length,t.segments.length);for(let n=0;n<i;n++){let i=e.segments[n],a=t.segments[n];if(i===a)continue;let o=YR(e,n);return o===YR(t,n)?qR(i,a,r):o===1?-1:1}return e.segments.length===t.segments.length?e.isDirectory===t.isDirectory?0:e.isDirectory?-1:1:e.segments.length<t.segments.length?-1:1}function $R(e,t){let n=e.sortKeyById[t];if(n!==void 0)return n;let r=e.valueById[t],i=WR(r);return e.sortKeyById[t]=i,i}function ez(e={}){return{flattenEmptyDirectories:e.flattenEmptyDirectories!==!1,sort:e.sort??`default`}}function tz(e){let t=e.length>0&&e.charCodeAt(e.length-1)===47,n=t?e.length-1:e.length,r=[],i=0;for(let t=0;t<n;t++)e.charCodeAt(t)===47&&(r.push(e.slice(i,t)),i=t+1);return r.push(e.slice(i,n)),{hasTrailingSlash:t,segments:r}}function nz(e){let{hasTrailingSlash:t,segments:n}=tz(e);return{basename:n[n.length-1]??``,isDirectory:t,path:e,segments:n}}function rz(e){if(e.length===0)return{requiresDirectory:!1,segments:[]};let{hasTrailingSlash:t,segments:n}=tz(e);return{requiresDirectory:t,segments:n}}var iz=``;function az(){let e=new Map;return e.set(iz,0),{idByValue:e,valueById:[iz],sortKeyById:[WR(iz)]}}function oz(e,t){let n=e.idByValue.get(t);if(n!==void 0)return n;let r=e.valueById.length;return e.idByValue.set(t,r),e.valueById.push(t),r}function sz(e,t){let n=e.valueById[t];if(n===void 0)throw Error(`Unknown segment ID: ${String(t)}`);return n}var cz=Symbol(`pathStorePreparedInputKind`);function lz(e,t){return e[cz]=t,e}function uz(e){return{basename:e.basename,depth:e.segments.length,isDirectory:e.isDirectory,path:e.path,segments:e.segments}}function dz(e,t,n){return n===`default`?ZR(e,t):n(uz(e),uz(t))}function fz(){return{depthAndFlags:kR(0,3,1),nameId:0,parentId:0,subtreeNodeCount:1,visibleSubtreeCount:1}}function pz(e,t){let n=Math.min(e.length,t.length);for(let r=0;r<n;r++)if(e[r]!==t[r])return r;return n}function mz(e){return e.isDirectory?e.segments.length:e.segments.length-1}function hz(e){return Array.isArray(e)&&e.every(e=>typeof e==`object`&&!!e&&typeof e.path==`string`&&Array.isArray(e.segments)&&typeof e.basename==`string`&&typeof e.isDirectory==`boolean`)}function gz(e){return Array.isArray(e)&&e.every(e=>typeof e==`string`)}function _z(e,t={}){return Cz(e,t).map(e=>e.path)}function vz(e,t={}){let n=Cz(e,t);return lz({paths:n.map(e=>e.path),preparedPaths:n},`prepared`)}function yz(e){let t=e.length,n=!1;for(let r=0;r<t;r+=1){let t=e[r];if(t.length>0&&t.charCodeAt(t.length-1)===47){n=!0;break}}return lz({paths:e,presortedPaths:e,presortedPathsContainDirectories:n},`presorted`)}function bz(e){let t=e,n=t.preparedPaths;if(t[cz]===`prepared`&&n!=null)return n;if(!hz(n))throw Error(`preparedInput must come from PathStore.prepareInput()`);return n}function xz(e){let t=e;return t[cz]===`presorted`&&t.presortedPaths!=null||gz(t.presortedPaths)?t.presortedPaths:null}function Sz(e){let t=e;return typeof t.presortedPathsContainDirectories==`boolean`?t.presortedPathsContainDirectories:null}function Cz(e,t={}){let n=ez(t),r=zR(t);VR(r,`workload.inputFiles`,e.length);let i=BR(r,`store.preparePathEntries.parse`,()=>e.map(e=>nz(e)));return BR(r,`store.preparePathEntries.sort`,()=>i.sort((e,t)=>dz(e,t,n.sort))),i}var wz=class{directories=new Map;directoryStack=[0];presortedDirectoryNodeIds=[];initialExpandedPathSet;createdDirectoriesAllExpanded=!1;createdDirectoryCount=0;lastPreparedPath=null;nodes=[fz()];options;instrumentation;segmentSortKeyCache=new Map;segmentTable=az();hasDeferredDirectoryIndexes=!1;constructor(e={}){this.instrumentation=zR(e),this.options=ez(e);let t=e.initialExpandedPaths??null;if(t==null||t.length===0)this.initialExpandedPathSet=null;else{let e=new Set,n=t.length;for(let r=0;r<n;r+=1){let n=t[r],i=n.length;e.add(i>0&&n.charCodeAt(i-1)===47?n.slice(0,i-1):n)}this.initialExpandedPathSet=e,this.createdDirectoriesAllExpanded=!0}this.directories.set(0,pR())}appendPaths(e){return BR(this.instrumentation,`store.builder.appendPaths.parse`,()=>this.appendPreparedPaths(e.map(e=>nz(e))))}appendPreparedPaths(e,t=!0){return this.createdDirectoriesAllExpanded=!1,BR(this.instrumentation,`store.builder.appendPreparedPaths`,()=>{for(let n of e)this.appendPreparedPath(n,t)}),this}appendPresortedPaths(e,t=null){return BR(this.instrumentation,`store.builder.appendPresortedPaths`,()=>{if(t===!1){this.appendPresortedFilePaths(e);return}this.createdDirectoriesAllExpanded=!1;let n=null,r=0,i=this.nodes,a=this.segmentTable,o=a.idByValue,s=a.valueById,c=this.directoryStack,l=0,u=``,d=0;for(let t of e){if(n===t)throw Error(`Duplicate path: "${t}"`);let e=t.length>0&&t.charCodeAt(t.length-1)===47,a=e?t.length-1:t.length,f=0,p=0;if(n!=null)if(u.length>0&&t.length>u.length&&t.startsWith(u))f=d,p=u.length;else{let r=Math.min(a,n.length),i=!0;for(let e=0;e<r;e++){let r=t.charCodeAt(e);if(r!==n.charCodeAt(e)){i=!1;break}r===47&&(f++,p=e+1)}i&&e&&r===a&&n.length>a&&n.charCodeAt(a)===47&&(f++,p=a+1)}l=f,r=f;let m=p,h=t.indexOf(`/`,m);for(;h>=0&&h<a;){let e=c[l];if(e===void 0)throw Error(`Directory stack underflow while building the path store`);r++;let n=t.slice(m,h),a=o.get(n);a===void 0&&(a=s.length,o.set(n,a),s.push(n));let u=i.length;i.push({depthAndFlags:kR(r,0,1),nameId:a,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),this.recordCreatedDirectoryPath(t.slice(0,h)),l++,c[l]=u,m=h+1,h=t.indexOf(`/`,m)}if(e){if(m<a){let e=c[l];if(e===void 0)throw Error(`Unable to resolve directory parent for "${t}"`);r++;let n=t.slice(m,a),u=o.get(n);u===void 0&&(u=s.length,o.set(n,u),s.push(n));let d=i.length;i.push({depthAndFlags:kR(r,0,1),nameId:u,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),l++,c[l]=d}let e=c[l];if(e===void 0)throw Error(`Unable to resolve directory node for "${t}"`);this.promoteDirectoryToExplicit(e,t)}else{let e=c[l];if(e===void 0)throw Error(`Unable to resolve file parent for "${t}"`);let n=t.slice(m),a=o.get(n);a===void 0&&(a=s.length,o.set(n,a),s.push(n)),i.push({depthAndFlags:kR(r+1,0),nameId:a,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1})}m!==u.length&&(u=t.substring(0,m),d=r),n=t}c.length=l+1,n!=null&&(this.lastPreparedPath=nz(n)),this.hasDeferredDirectoryIndexes=!0}),this}appendPresortedFilePaths(e){let t=null,n=0,r=this.nodes,i=this.segmentTable,a=i.idByValue,o=i.valueById,s=this.directoryStack,c=0,l=``,u=0;for(let i of e){if(t===i)throw Error(`Duplicate path: "${i}"`);let e=i.length,d=0,f=0;if(t!=null)if(l.length>0&&i.length>l.length&&i.startsWith(l))d=u,f=l.length;else{let n=Math.min(e,t.length);for(let e=0;e<n;e++){let n=i.charCodeAt(e);if(n!==t.charCodeAt(e))break;n===47&&(d++,f=e+1)}}c=d,n=d;let p=f,m=i.indexOf(`/`,p);for(;m>=0;){let e=s[c];if(e===void 0)throw Error(`Directory stack underflow while building the path store`);n++;let t=i.slice(p,m),l=a.get(t);l===void 0&&(l=o.length,a.set(t,l),o.push(t));let u=r.length;r.push({depthAndFlags:kR(n,0,1),nameId:l,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),this.recordCreatedDirectoryPath(i.slice(0,m)),this.presortedDirectoryNodeIds.push(u),c++,s[c]=u,p=m+1,m=i.indexOf(`/`,p)}let h=s[c];if(h===void 0)throw Error(`Unable to resolve file parent for "${i}"`);let g=i.slice(p),_=a.get(g);_===void 0&&(_=o.length,a.set(g,_),o.push(g)),r.push({depthAndFlags:kR(n+1,0),nameId:_,parentId:h,subtreeNodeCount:1,visibleSubtreeCount:1}),p!==l.length&&(l=i.substring(0,p),u=n),t=i}s.length=c+1,t!=null&&(this.lastPreparedPath=nz(t)),this.hasDeferredDirectoryIndexes=!0}finish(e={}){let t=e.skipSubtreeCountPass===!0;return this.hasDeferredDirectoryIndexes?(BR(this.instrumentation,`store.builder.buildDirectoryIndexes`,()=>this.buildPresortedFinish(t)),this.hasDeferredDirectoryIndexes=!1):t||BR(this.instrumentation,`store.builder.computeSubtreeCounts`,()=>this.computeSubtreeCounts(0)),{directories:this.directories,nodes:this.nodes,options:this.options,rootId:0,segmentTable:this.segmentTable,presortedDirectoryNodeIds:this.presortedDirectoryNodeIds.length>0?this.presortedDirectoryNodeIds:null}}didMatchAllInitialExpandedPaths(){return this.createdDirectoriesAllExpanded&&this.initialExpandedPathSet!=null&&this.createdDirectoryCount===this.initialExpandedPathSet.size}appendPreparedPath(e,t){if(this.hasDeferredDirectoryIndexes&&=(this.buildDirectoryIndexes(),!1),this.lastPreparedPath!=null){if(e.path===this.lastPreparedPath.path)throw Error(`Duplicate path: "${e.path}"`);if(t&&(this.options.sort===`default`?QR(this.lastPreparedPath,e,this.segmentSortKeyCache):dz(this.lastPreparedPath,e,this.options.sort))>0)throw Error(`Builder input must be sorted before appendPaths(): "${e.path}"`)}let n=this.lastPreparedPath,r=mz(e),i=n==null?0:mz(n),a=n==null?0:pz(n.segments,e.segments),o=Math.min(a,r,i);this.directoryStack.length=o+1;for(let n=o;n<r;n++){let r=this.directoryStack[this.directoryStack.length-1];if(r===void 0)throw Error(`Directory stack underflow while building the path store`);let i=t?this.getOrCreateDirectoryChild(r,e.segments[n]):this.createDirectoryChild(r,e.segments[n]);this.directoryStack.push(i)}if(e.isDirectory){let t=this.directoryStack[this.directoryStack.length-1];if(t===void 0)throw Error(`Unable to resolve directory node for "${e.path}"`);this.promoteDirectoryToExplicit(t,e.path),this.lastPreparedPath=e;return}let s=this.directoryStack[this.directoryStack.length-1];if(s===void 0)throw Error(`Unable to resolve file parent for "${e.path}"`);t?this.createFileChild(s,e.basename,e.path):this.createFileChildUnchecked(s,e.basename),this.lastPreparedPath=e}recordCreatedDirectoryPath(e){!this.createdDirectoriesAllExpanded||this.initialExpandedPathSet==null||(this.createdDirectoryCount+=1,this.initialExpandedPathSet.has(e)||(this.createdDirectoriesAllExpanded=!1))}createFileChild(e,t,n){let r=oz(this.segmentTable,t),i=this.getDirectoryIndex(e),a=i.childIdByNameId;if(a!=null&&a.get(r)!==void 0)throw Error(`Path collides with an existing entry: "${n}"`);let o=this.nodes[e];if(o===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let s=this.nodes.length;return this.nodes.push({depthAndFlags:kR(AR(o)+1,0),nameId:r,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),a?.set(r,s),_R(i,s),s}createFileChildUnchecked(e,t){let n=oz(this.segmentTable,t),r=this.getDirectoryIndex(e),i=this.nodes[e];if(i===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let a=this.nodes.length;return this.nodes.push({depthAndFlags:kR(AR(i)+1,0),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),_R(r,a),a}getOrCreateDirectoryChild(e,t){let n=oz(this.segmentTable,t),r=this.getDirectoryIndex(e);if(r.childIdByNameId!=null){let e=r.childIdByNameId.get(n);if(e!==void 0){let n=this.nodes[e];if(n!=null&&!MR(n))throw Error(`Path collides with an existing file while creating directory "${t}"`);return e}}let i=this.nodes[e];if(i===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let a=this.nodes.length;return this.nodes.push({depthAndFlags:kR(AR(i)+1,0,1),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),_R(r,a),this.directories.set(a,pR()),a}createDirectoryChild(e,t){let n=oz(this.segmentTable,t),r=this.getDirectoryIndex(e),i=this.nodes[e];if(i===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let a=this.nodes.length;return this.nodes.push({depthAndFlags:kR(AR(i)+1,0,1),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),_R(r,a),this.directories.set(a,pR()),a}promoteDirectoryToExplicit(e,t){let n=this.nodes[e];if(n===void 0)throw Error(`Unknown directory node ID: ${String(e)}`);if(!MR(n))throw Error(`Path is not a directory: "${t}"`);if(PR(n,1))throw Error(`Duplicate path: "${t}"`);FR(n,1)}getDirectoryIndex(e){let t=this.directories.get(e);if(t!==void 0)return t;throw Error(`Unknown directory child index for node ${String(e)}`)}buildPresortedFinish(e){let t=this.nodes,n=this.directories;n.set(0,mR());let r=-1,i=null;for(let e=1;e<t.length;e++){let a=t[e];if(a==null)continue;if(MR(a)){let t=mR();n.set(e,t),r=e,i=t}let o;a.parentId===r?o=i:(o=n.get(a.parentId),r=a.parentId,i=o??null),o?.childIds.push(e)}if(!e)for(let e=t.length-1;e>=1;e--){let n=t[e];if(n==null)continue;let r=t[n.parentId];r!=null&&(r.subtreeNodeCount+=n.subtreeNodeCount,r.visibleSubtreeCount+=n.visibleSubtreeCount)}}buildDirectoryIndexes(){let e=this.nodes;for(let t=1;t<e.length;t++){let n=e[t];if(n==null)continue;MR(n)&&this.directories.set(t,pR());let r=this.directories.get(n.parentId);r!=null&&(r.childIdByNameId!=null&&r.childIdByNameId.set(n.nameId,t),_R(r,t))}}computeSubtreeCounts(e){let t=this.nodes[e];if(t===void 0)throw Error(`Unknown node ID: ${String(e)}`);if(!MR(t))return t.subtreeNodeCount=1,t.visibleSubtreeCount=1,1;let n=this.getDirectoryIndex(e),r=1;for(let e of n.childIds)r+=this.computeSubtreeCounts(e);return yR(this.nodes,n),t.subtreeNodeCount=r,t.visibleSubtreeCount=r,r}};function Tz(e,t=`closed`,n=null){let r=Dz(t);return{activeNodeCount:e.nodes.length-1,collapsedDirectoryIds:new Set,collapseNewDirectoriesByDefault:!1,defaultExpansion:r,directoriesOpenByDefault:r===`open`,hasCollapsedDirectoryOverrides:!1,directoryLoadInfoById:new Map,expandedDirectoryIds:new Set,instrumentation:n,listeners:new Map,pathCacheByNodeId:new Map([[e.rootId,{path:``,version:0}]]),pathCacheVersion:0,snapshot:e,transactionStack:[]}}function Ez(){return{affectedAncestorIds:new Set,affectedNodeIds:new Set,events:[]}}function Dz(e){if(typeof e!=`number`)return e;if(!Number.isInteger(e)||e<0)throw Error(`initialExpansion must be "open", "closed", or a non-negative integer depth. Received: ${String(e)}`);return e}function Oz(e,t){return PR(t,2)||e.defaultExpansion===`open`?!0:e.defaultExpansion===`closed`?!1:AR(t)<=e.defaultExpansion}function kz(e,t,n=e.snapshot.nodes[t]){return n==null||!MR(n)?!1:e.directoriesOpenByDefault&&!e.hasCollapsedDirectoryOverrides?!0:e.collapsedDirectoryIds.has(t)?!1:e.expandedDirectoryIds.has(t)?!0:Oz(e,n)}function Az(e,t,n,r=e.snapshot.nodes[t]){if(r==null||!MR(r))return;let i=Oz(e,r);if(n){if(i){e.collapsedDirectoryIds.delete(t),e.hasCollapsedDirectoryOverrides=e.collapsedDirectoryIds.size>0;return}e.expandedDirectoryIds.add(t);return}if(i){e.collapsedDirectoryIds.add(t),e.hasCollapsedDirectoryOverrides=!0;return}e.expandedDirectoryIds.delete(t)}function jz(e,t){let n=e.directoryLoadInfoById.get(t);if(n!=null)return n;let r={activeAttemptId:null,errorMessage:null,nextAttemptId:1,state:`loaded`};return e.directoryLoadInfoById.set(t,r),r}function Mz(e,t){return e.directoryLoadInfoById.get(t)?.state??`loaded`}function Nz(e,t){let n=jz(e,t);if(n.state===`loading`&&n.activeAttemptId!=null)return{attemptId:n.activeAttemptId,nodeId:t,reused:!0};let r=n.nextAttemptId;return n.activeAttemptId=r,n.errorMessage=null,n.nextAttemptId+=1,n.state=`loading`,{attemptId:r,nodeId:t,reused:!1}}function Pz(e,t){let n=jz(e,t);n.activeAttemptId=null,n.errorMessage=null,n.state=`unloaded`}function Fz(e,t,n){let r=e.directoryLoadInfoById.get(t);return r==null||r.activeAttemptId!==n?!1:(r.activeAttemptId=null,r.errorMessage=null,r.state=`loaded`,!0)}function Iz(e,t,n){return e.directoryLoadInfoById.get(t)?.activeAttemptId===n}function Lz(e,t,n,r){let i=e.directoryLoadInfoById.get(t);return i==null||i.activeAttemptId!==n?!1:(i.activeAttemptId=null,i.errorMessage=r??null,i.state=`error`,!0)}function Rz(e,t){e.directoryLoadInfoById.delete(t)}function zz(e,t,n){let r=n,i=e.listeners.get(t);return i==null?e.listeners.set(t,new Set([r])):i.add(r),()=>{let n=e.listeners.get(t);n!=null&&(n.delete(r),n.size===0&&e.listeners.delete(t))}}function Bz(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,operation:`add`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function Vz(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,operation:`remove`,path:e.path,projectionChanged:e.projectionChanged,recursive:e.recursive,visibleCountDelta:null}}function Hz(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,from:e.from,operation:`move`,projectionChanged:e.projectionChanged,to:e.to,visibleCountDelta:null}}function Uz(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`expand`,path:e.path,projectionChanged:!0,visibleCountDelta:null}}function Wz(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`collapse`,path:e.path,projectionChanged:!0,visibleCountDelta:null}}function Gz(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`mark-directory-unloaded`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function Kz(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:!1,operation:`begin-child-load`,path:e.path,projectionChanged:e.projectionChanged,reused:e.reused,visibleCountDelta:null}}function qz(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:e.childEvents.some(e=>e.canonicalChanged),childEvents:e.childEvents,operation:`apply-child-patch`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function Jz(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:!1,operation:`complete-child-load`,path:e.path,projectionChanged:e.projectionChanged,stale:e.stale,visibleCountDelta:null}}function Yz(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:!1,errorMessage:e.errorMessage,operation:`fail-child-load`,path:e.path,projectionChanged:e.projectionChanged,stale:e.stale,visibleCountDelta:null}}function Xz(e){return{activeNodeCountAfter:e.activeNodeCountAfter,activeNodeCountBefore:e.activeNodeCountBefore,affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],cachedPathEntryCountAfter:e.cachedPathEntryCountAfter,cachedPathEntryCountBefore:e.cachedPathEntryCountBefore,canonicalChanged:!1,idsPreserved:e.idsPreserved,loadInfoEntryCountAfter:e.loadInfoEntryCountAfter,loadInfoEntryCountBefore:e.loadInfoEntryCountBefore,mode:e.mode,operation:`cleanup`,projectionChanged:e.projectionChanged,reclaimedCachedPathEntryCount:e.reclaimedCachedPathEntryCount,reclaimedLoadInfoEntryCount:e.reclaimedLoadInfoEntryCount,reclaimedNodeSlotCount:e.reclaimedNodeSlotCount,reclaimedSegmentCount:e.reclaimedSegmentCount,segmentCountAfter:e.segmentCountAfter,segmentCountBefore:e.segmentCountBefore,totalNodeSlotCountAfter:e.totalNodeSlotCountAfter,totalNodeSlotCountBefore:e.totalNodeSlotCountBefore,visibleCountDelta:null}}function Zz(e,t,n){return{...n,visibleCountDelta:cB(e)-t}}function Qz(e,t){let n=cB(e),r=Ez();e.transactionStack.push(r);try{t()}catch(t){throw tB(e,r,!1),t}tB(e,r,!0,cB(e)-n)}function $z(e,t){let n=e.instrumentation;if(n==null){eB(e,t);return}BR(n,`store.events.record`,()=>eB(e,t))}function eB(e,t){let n=e.transactionStack[e.transactionStack.length-1]??null;if(n==null){oB(e,t);return}n.events.push(t),aB(n,t)}function tB(e,t,n,r=null){if(e.transactionStack.pop()!==t)throw Error(`Transaction stack underflow`);if(!n)return;let i=e.transactionStack[e.transactionStack.length-1]??null;if(i!=null){let n=e.instrumentation;n==null?iB(i,t):BR(n,`store.events.batch.merge`,()=>iB(i,t));return}let a=nB(t,r),o=e.instrumentation;if(o==null){oB(e,a);return}BR(o,`store.events.batch.commit`,()=>oB(e,a))}function nB(e,t){return{affectedAncestorIds:[...e.affectedAncestorIds],affectedNodeIds:[...e.affectedNodeIds],canonicalChanged:e.events.some(e=>e.canonicalChanged),events:[...e.events],operation:`batch`,projectionChanged:e.events.some(e=>e.projectionChanged),visibleCountDelta:t}}function rB(e,t){for(let n of t.affectedAncestorIds)e.affectedAncestorIds.add(n);for(let n of t.affectedNodeIds)e.affectedNodeIds.add(n)}function iB(e,t){for(let n of t.events)e.events.push(n);rB(e,t)}function aB(e,t){for(let n of t.affectedNodeIds)e.affectedNodeIds.add(n);for(let n of t.affectedAncestorIds)e.affectedAncestorIds.add(n)}function oB(e,t){let n=e.instrumentation;if(n==null){sB(e,t);return}BR(n,`store.events.emit`,()=>sB(e,t))}function sB(e,t){e.listeners.get(t.operation)?.forEach(e=>e(t)),e.listeners.get(`*`)?.forEach(e=>e(t))}function cB(e){return e.snapshot.nodes[e.snapshot.rootId]?.visibleSubtreeCount??0}function lB(e,t){if(e.snapshot.options.flattenEmptyDirectories!==!0)return null;let n=e.snapshot.nodes[t];if(n==null||!MR(n)||PR(n,2))return null;let r=e.snapshot.directories.get(t);if(r==null||r.childIds.length!==1)return null;let i=r.childIds[0];if(i==null)return null;let a=e.snapshot.nodes[i];return a==null||!MR(a)?null:i}function uB(e,t){let n=t;for(;;){let t=lB(e,n);if(t==null)return n;n=t}}function dB(e,t){let n=[t],r=t;for(;;){let t=lB(e,r);if(t==null)return n;n.push(t),r=t}}function fB(e,t){let n=t==null?e.snapshot.rootId:SB(e,t);return n==null?[]:EB(e,n)}function pB(e,t){let n=nz(t),r=n.isDirectory?n.segments:n.segments.slice(0,-1),i=VB(e,BB(e,r)),{createdNodeIds:a,directoryId:o}=DB(e,r),s=new Set(a),c=o;if(n.isDirectory){let n=TB(e,o);if(PR(n,1))throw Error(`Path already exists: "${t}"`);FR(n,1),e.pathCacheByNodeId.set(o,{path:t,version:e.pathCacheVersion}),s.add(o)}else c=kB(e,o,n.basename),s.add(c);yB(e,o);let l=VB(e,o);return Bz({affectedAncestorIds:xB(e,c),affectedNodeIds:[...s],path:t,projectionChanged:HB(i,l)})}function mB(e,t,n){let r=SB(e,t);if(r==null)throw Error(`Path does not exist: "${t}"`);let i=TB(e,r);if(PR(i,2))throw Error(`The root node cannot be removed`);if(MR(i)&&wB(e,r).childIds.length>0&&n.recursive!==!0)throw Error(`Cannot remove a non-empty directory without recursive: "${t}"`);let a=i.parentId,o=VB(e,a),s=RB(e,r);MB(e,a,r,i.nameId),zB(e,a),yB(e,a);let c=VB(e,a);return Vz({affectedAncestorIds:xB(e,a),affectedNodeIds:s,path:t,projectionChanged:HB(o,c),recursive:n.recursive===!0})}function hB(e,t,n,r){let i=SB(e,t);if(i==null)throw Error(`Source path does not exist: "${t}"`);let a=TB(e,i);if(PR(a,2))throw Error(`The root node cannot be moved`);let o=r.collision??`error`,s=IB(e,i,n),c=VB(e,a.parentId),l=VB(e,s.parentId),u=sz(e.snapshot.segmentTable,a.nameId),d=oz(e.snapshot.segmentTable,s.basename);if(s.parentId===a.parentId&&u===s.basename)return null;if(MR(a)&&KB(e,i,s.parentId))throw Error(`Cannot move a directory into one of its descendants`);let f=hR(e.snapshot.nodes,wB(e,s.parentId)).get(d),p=s.existingNodeId??f??null;if(p!=null&&p!==i&&LB(e,p,o,jR(a))===`skip`)return null;let m=a.parentId;MB(e,m,i,a.nameId),a.parentId=s.parentId,a.nameId=d,e.pathCacheByNodeId.delete(i),GB(e,i),jB(e,s.parentId,i),zB(e,m),e.pathCacheVersion++,yB(e,m),s.parentId!==m&&yB(e,s.parentId);let h=VB(e,m),g=VB(e,s.parentId);return Hz({affectedAncestorIds:[...new Set([...xB(e,m),...xB(e,s.parentId)])],affectedNodeIds:[i],from:t,projectionChanged:UB([c,l],[h,g]),to:vB(e,i)})}function gB(e,t){let n=e.pathCacheByNodeId.get(t);return n!=null&&n.version===e.pathCacheVersion?n.path:null}function _B(e,t,n){return e.pathCacheByNodeId.set(t,{path:n,version:e.pathCacheVersion}),n}function vB(e,t){let n=TB(e,t),r=gB(e,t);if(r!=null)return r;if(PR(n,2))return _B(e,t,``);let i=vB(e,n.parentId),a=sz(e.snapshot.segmentTable,n.nameId),o=i.length===0?a:`${i}${a}`;return _B(e,t,MR(n)?`${o}/`:o)}function yB(e,t){let n=e.instrumentation;if(n==null){JB(e,t);return}BR(n,`store.recomputeCountsUpwardFrom`,()=>JB(e,t))}function bB(e,t){let n=[[t,0]],{nodes:r,directories:i}=e.snapshot;for(;n.length>0;){let t=n[n.length-1],a=t[0],o=r[a];if(o==null||!MR(o)){qB(e,a,o,!0),n.pop();continue}let s=i.get(a);if(s==null||t[1]>=s.childIds.length){qB(e,a,o,!0),n.pop();continue}let c=s.childIds[t[1]++];n.push([c,0])}}function xB(e,t){let n=[],r=t;for(;r!=null;){let t=TB(e,r);if(n.push(r),r===e.snapshot.rootId)break;r=t.parentId}return n}function SB(e,t){if(t.length===0)return e.snapshot.rootId;let n=rz(t);return CB(e,n.segments,n.requiresDirectory)}function CB(e,t,n){let r=e.snapshot.rootId;for(let n of t){let t=e.snapshot.segmentTable.idByValue.get(n);if(t===void 0)return null;let i=wB(e,r),a=hR(e.snapshot.nodes,i).get(t);if(a===void 0)return null;r=a}let i=TB(e,r);return n&&!MR(i)?null:r}function wB(e,t){let n=e.snapshot.directories.get(t);if(n===void 0)throw Error(`Unknown directory child index for node ${String(t)}`);return n}function TB(e,t){let n=e.snapshot.nodes[t];if(n===void 0||PR(n,4))throw Error(`Unknown node ID: ${String(t)}`);return n}function EB(e,t){let n=e.snapshot.nodes[t];if(n===void 0||PR(n,4))return[];if(!MR(n))return[vB(e,t)];if(wB(e,t).childIds.length===0)return PR(n,1)&&!PR(n,2)?[vB(e,t)]:[];let r=[],i=[{childIndex:0,nodeId:t}];for(;i.length>0;){let t=i[i.length-1];if(t==null)break;let n=e.snapshot.nodes[t.nodeId];if(n===void 0||PR(n,4)){i.pop();continue}if(!MR(n)){r.push(vB(e,t.nodeId)),i.pop();continue}let a=wB(e,t.nodeId);if(a.childIds.length===0){PR(n,1)&&!PR(n,2)&&r.push(vB(e,t.nodeId)),i.pop();continue}let o=a.childIds[t.childIndex];if(o==null){i.pop();continue}t.childIndex++,i.push({childIndex:0,nodeId:o})}return r}function DB(e,t){let n=[],r=e.snapshot.rootId;for(let i of t){let t=oz(e.snapshot.segmentTable,i),a=wB(e,r),o=hR(e.snapshot.nodes,a).get(t);if(o!==void 0){if(!MR(TB(e,o)))throw Error(`Cannot create a directory that collides with an existing file: "${i}"`);r=o;continue}r=OB(e,r,t),n.push(r)}return{createdNodeIds:n,directoryId:r}}function OB(e,t,n){let r=TB(e,t),i=e.snapshot.nodes.length;return e.snapshot.nodes.push({depthAndFlags:kR(AR(r)+1,0,1),nameId:n,parentId:t,subtreeNodeCount:1,visibleSubtreeCount:1}),e.snapshot.directories.set(i,pR()),jB(e,t,i),e.collapseNewDirectoriesByDefault&&(e.collapsedDirectoryIds.add(i),e.hasCollapsedDirectoryOverrides=!0),e.activeNodeCount++,i}function kB(e,t,n){let r=oz(e.snapshot.segmentTable,n),i=wB(e,t);if(hR(e.snapshot.nodes,i).has(r))throw Error(`Path already exists: "${XB(e,t,n)}"`);let a=TB(e,t),o=e.snapshot.nodes.length;return e.snapshot.nodes.push({depthAndFlags:kR(AR(a)+1,0),nameId:r,parentId:t,subtreeNodeCount:1,visibleSubtreeCount:1}),jB(e,t,o),e.activeNodeCount++,o}function AB(e,t,n){let r=0,i=t.childIds.length;for(;r<i;){let a=r+i>>>1,o=t.childIds[a];if(o==null){i=a;continue}NB(e,n,o)<0?i=a:r=a+1}return r}function jB(e,t,n){let r=wB(e,t),i=TB(e,n);hR(e.snapshot.nodes,r).set(i.nameId,n),bR(r,n,i.subtreeNodeCount,i.visibleSubtreeCount);let a=AB(e,r,n);r.childIds.splice(a,0,n),vR(r,a),CR(e.snapshot.nodes,r)}function MB(e,t,n,r){let i=wB(e,t),a=gR(i),o=a.get(n)??-1;hR(e.snapshot.nodes,i).delete(r),a.delete(n);let s=e.snapshot.nodes[n];s!=null&&bR(i,n,-s.subtreeNodeCount,-s.visibleSubtreeCount),o>=0&&(i.childIds.splice(o,1),vR(i,o),CR(e.snapshot.nodes,i))}function NB(e,t,n){let r=e.snapshot.options.sort;return r===`default`?PB(e,t,n):r(FB(e,t),FB(e,n))}function PB(e,t,n){let r=TB(e,t),i=TB(e,n),a=MR(r);if(a!==MR(i))return a?-1:1;let o=KR($R(e.snapshot.segmentTable,r.nameId),$R(e.snapshot.segmentTable,i.nameId));if(o!==0)return o;let s=sz(e.snapshot.segmentTable,r.nameId),c=sz(e.snapshot.segmentTable,i.nameId);return s===c?t<n?-1:1:s<c?-1:1}function FB(e,t){let n=TB(e,t),r=vB(e,t),i=MR(n),a=i?r.slice(0,-1):r;return{basename:sz(e.snapshot.segmentTable,n.nameId),depth:AR(n),isDirectory:i,path:r,segments:a.length===0?[]:a.split(`/`)}}function IB(e,t,n){let r=TB(e,t),i=SB(e,n);if(i!=null){let t=TB(e,i);if(MR(t))return{basename:sz(e.snapshot.segmentTable,r.nameId),existingNodeId:null,parentId:i};let a=rz(n).segments;return{basename:a[a.length-1]??``,existingNodeId:i,parentId:t.parentId}}let a=rz(n),o=a.segments[a.segments.length-1]??``,s=a.segments.slice(0,-1),c=s.length===0?e.snapshot.rootId:CB(e,s,!0);if(c==null)throw Error(`Destination parent does not exist: "${n}"`);return{basename:o,existingNodeId:null,parentId:c}}function LB(e,t,n,r){if(n===`skip`)return`skip`;if(n===`error`)throw Error(`Destination already exists: "${vB(e,t)}"`);let i=TB(e,t);if(jR(i)!==r)throw Error(`replace collision requires the same source and destination kinds`);if(MR(i)&&wB(e,t).childIds.length>0)throw Error(`replace collision does not support non-empty directories`);let a=i.parentId,o=i.nameId;return RB(e,t),MB(e,a,t,o),zB(e,a),yB(e,a),`handled`}function RB(e,t){let n=[],r=[{nodeId:t,visitedChildren:!1}];for(;r.length>0;){let t=r.pop();if(t==null)break;let i=TB(e,t.nodeId);if(t.visitedChildren||!MR(i)){MR(i)&&e.snapshot.directories.delete(t.nodeId),FR(i,4),e.pathCacheByNodeId.delete(t.nodeId),e.collapsedDirectoryIds.delete(t.nodeId)&&(e.hasCollapsedDirectoryOverrides=e.collapsedDirectoryIds.size>0),e.expandedDirectoryIds.delete(t.nodeId),Rz(e,t.nodeId),e.activeNodeCount--,n.push(t.nodeId);continue}r.push({nodeId:t.nodeId,visitedChildren:!0});let a=wB(e,t.nodeId);for(let e=a.childIds.length-1;e>=0;e--){let t=a.childIds[e];t!=null&&r.push({nodeId:t,visitedChildren:!1})}}return n}function zB(e,t){let n=t;for(;n!=null;){let t=TB(e,n);if(!MR(t)||PR(t,2)||wB(e,n).childIds.length>0)return;FR(t,1),n=t.parentId===n?null:t.parentId}}function BB(e,t){let n=e.snapshot.rootId;for(let r of t){let t=e.snapshot.segmentTable.idByValue.get(r);if(t==null)break;let i=hR(e.snapshot.nodes,wB(e,n)).get(t);if(i==null||!MR(TB(e,i)))break;n=i}return n}function VB(e,t){let n=WB(e,t);if(n==null)return null;let r=uB(e,n),i=TB(e,r),a=n===r?null:dB(e,n).map(t=>vB(e,t));return JSON.stringify({flattenedSegmentPaths:a,hasChildren:wB(e,r).childIds.length>0,path:vB(e,r),terminalKind:jR(i)})}function HB(e,t){return UB([e],[t])}function UB(e,t){for(let n=0;n<e.length;n+=1){let r=e[n],i=t[n];if(r==null||i==null||r!==i)return!0}return!1}function WB(e,t){let n=t;for(;n!=null;){let t=TB(e,n);if(!MR(t)||PR(t,2))return null;if(!kz(e,n,t))return n;n=t.parentId}return null}function GB(e,t){let n=TB(e,t);if(IR(n,(t===e.snapshot.rootId?-1:AR(TB(e,n.parentId)))+1),!MR(n))return;let r=wB(e,t);for(let t of r.childIds)GB(e,t)}function KB(e,t,n){let r=n;for(;r!=null;){if(r===t)return!0;let n=TB(e,r);if(r===e.snapshot.rootId)return!1;r=n.parentId}return!1}function qB(e,t,n=TB(e,t),r=!1){let i=e.instrumentation;if(i==null){YB(e,t,n,r);return}BR(i,`store.recomputeNodeCounts`,()=>YB(e,t,n,r))}function JB(e,t){let n=t;for(;n!=null;){let t=TB(e,n),r=t.subtreeNodeCount,i=t.visibleSubtreeCount;if(qB(e,n,t),n===e.snapshot.rootId)return;let a=t.subtreeNodeCount-r,o=t.visibleSubtreeCount-i,s=t.parentId;(a!==0||o!==0)&&bR(wB(e,s),n,a,o),n=s}}function YB(e,t,n,r){if(!MR(n)){n.subtreeNodeCount=1,n.visibleSubtreeCount=1;return}let i=wB(e,t);if(r){let t=e.instrumentation;t==null?yR(e.snapshot.nodes,i):BR(t,`store.recomputeNodeCounts.rebuildChildAggregates`,()=>yR(e.snapshot.nodes,i))}let a=1+i.totalChildSubtreeNodeCount,o=i.totalChildVisibleSubtreeCount;if(n.subtreeNodeCount=a,PR(n,2)){n.visibleSubtreeCount=o;return}n.visibleSubtreeCount=lB(e,t)==null?kz(e,t,n)?1+o:1:o}function XB(e,t,n){let r=vB(e,t);return r.length===0?n:`${r}${n}`}function ZB(e){return e!=null&&!PR(e,4)}function QB(e,t){let n=e.snapshot.nodes[t];return!ZB(n)||!MR(n)||PR(n,2)?null:n}function $B(e){let t=0;for(let[n,r]of e.pathCacheByNodeId)r.version===e.pathCacheVersion&&ZB(e.snapshot.nodes[n])&&(t+=1);return t}function eV(e){return Math.max(0,e.valueById.length-1)}function tV(e){return{activeNodeCount:e.activeNodeCount,cachedPathEntryCount:$B(e),loadInfoEntryCount:e.directoryLoadInfoById.size,segmentCount:eV(e.snapshot.segmentTable),totalNodeSlotCount:Math.max(0,e.snapshot.nodes.length-1)}}function nV(e,t,n,r){return{activeNodeCountAfter:r.activeNodeCount,activeNodeCountBefore:n.activeNodeCount,cachedPathEntryCountAfter:r.cachedPathEntryCount,cachedPathEntryCountBefore:n.cachedPathEntryCount,idsPreserved:t,loadInfoEntryCountAfter:r.loadInfoEntryCount,loadInfoEntryCountBefore:n.loadInfoEntryCount,mode:e,reclaimedCachedPathEntryCount:n.cachedPathEntryCount-r.cachedPathEntryCount,reclaimedLoadInfoEntryCount:n.loadInfoEntryCount-r.loadInfoEntryCount,reclaimedNodeSlotCount:n.totalNodeSlotCount-r.totalNodeSlotCount,reclaimedSegmentCount:n.segmentCount-r.segmentCount,segmentCountAfter:r.segmentCount,segmentCountBefore:n.segmentCount,totalNodeSlotCountAfter:r.totalNodeSlotCount,totalNodeSlotCountBefore:n.totalNodeSlotCount}}function rV(e){let t=[],n=[];for(let n of e.collapsedDirectoryIds)QB(e,n)!=null&&t.push(vB(e,n));for(let t of e.expandedDirectoryIds)QB(e,t)!=null&&n.push(vB(e,t));return{collapsedPaths:t,expandedPaths:n}}function iV(e){let t=[];for(let[n,r]of e.directoryLoadInfoById)QB(e,n)==null||Mz(e,n)===`loaded`||t.push({info:{activeAttemptId:null,errorMessage:r.errorMessage,nextAttemptId:r.nextAttemptId,state:r.state},path:vB(e,n)});return t}function aV(e,t){e.collapsedDirectoryIds.clear(),e.hasCollapsedDirectoryOverrides=!1,e.expandedDirectoryIds.clear();for(let n of t.expandedPaths){let t=SB(e,n);t!=null&&Az(e,t,!0,TB(e,t))}for(let n of t.collapsedPaths){let t=SB(e,n);t!=null&&Az(e,t,!1,TB(e,t))}}function oV(e,t){e.directoryLoadInfoById.clear();for(let n of t){let t=SB(e,n.path);t!=null&&QB(e,t)!=null&&e.directoryLoadInfoById.set(t,{activeAttemptId:null,errorMessage:n.info.errorMessage,nextAttemptId:n.info.nextAttemptId,state:n.info.state})}}function sV(e){e.pathCacheVersion+=1,e.pathCacheByNodeId.clear(),e.pathCacheByNodeId.set(e.snapshot.rootId,{path:``,version:e.pathCacheVersion})}function cV(e){let t=e.snapshot.segmentTable,n=az();for(let r of e.snapshot.nodes)if(ZB(r)){if(PR(r,2)){r.nameId=0;continue}r.nameId=oz(n,sz(t,r.nameId))}e.snapshot.segmentTable=n}function lV(e){for(let[t,n]of e.snapshot.directories){let r=e.snapshot.nodes[t];if(!ZB(r)||!MR(r)){e.snapshot.directories.delete(t);continue}let i=n.childIds.filter(n=>{let r=e.snapshot.nodes[n];return ZB(r)&&r.parentId===t});n.childIds=i,n.childIdByNameId=new Map(i.map(t=>[TB(e,t).nameId,t])),n.childPositionById=new Map(i.map((e,t)=>[e,t])),yR(e.snapshot.nodes,n)}}function uV(e){let t=e.snapshot.nodes.length-1;for(;t>e.snapshot.rootId;){let n=e.snapshot.nodes[t];if(ZB(n))break;--t}e.snapshot.nodes.length=t+1}function dV(e){let t=rV(e),n=iV(e);BR(e.instrumentation,`store.cleanup.stable.clearPathCaches`,()=>sV(e)),BR(e.instrumentation,`store.cleanup.stable.rebuildSegmentTable`,()=>cV(e)),BR(e.instrumentation,`store.cleanup.stable.rebuildDirectoryIndexes`,()=>lV(e)),BR(e.instrumentation,`store.cleanup.stable.trimTrailingRemovedNodeSlots`,()=>uV(e)),BR(e.instrumentation,`store.cleanup.stable.restoreExpansionOverrides`,()=>aV(e,t)),BR(e.instrumentation,`store.cleanup.stable.restoreDirectoryLoadInfos`,()=>oV(e,n)),BR(e.instrumentation,`store.cleanup.stable.recomputeCounts`,()=>bB(e,e.snapshot.rootId))}function fV(e){let t=rV(e),n=iV(e),r=BR(e.instrumentation,`store.cleanup.aggressive.listPaths`,()=>fB(e)),i=RR({...e.snapshot.options},e.instrumentation),a=BR(e.instrumentation,`store.cleanup.aggressive.rebuildSnapshot`,()=>{let e=new wz(i);return e.appendPaths(r),e.finish()});e.snapshot=a,e.activeNodeCount=a.nodes.length-1,e.pathCacheByNodeId=new Map([[a.rootId,{path:``,version:0}]]),e.pathCacheVersion=0,BR(e.instrumentation,`store.cleanup.aggressive.restoreExpansionOverrides`,()=>aV(e,t)),BR(e.instrumentation,`store.cleanup.aggressive.restoreDirectoryLoadInfos`,()=>oV(e,n)),BR(e.instrumentation,`store.cleanup.aggressive.recomputeCounts`,()=>bB(e,e.snapshot.rootId))}function pV(e){for(let t of e.directoryLoadInfoById.values())if(t.state===`loading`&&t.activeAttemptId!=null)return!0;return!1}function mV(e,t){let n=tV(e);t===`stable`?BR(e.instrumentation,`store.cleanup.stable`,()=>dV(e)):BR(e.instrumentation,`store.cleanup.aggressive`,()=>fV(e));let r=tV(e);return nV(t,t===`stable`,n,r)}var hV=64;function gV(e,t){let n=t+2;if(n<=e.length)return e;let r=e.length;for(;r<n;)r*=2;let i=new Int32Array(r);return i.fill(-1),i.set(e),i}function _V(e){return TB(e,e.snapshot.rootId).visibleSubtreeCount}function vV(e,t,n,r){let i=TB(e,t.terminalNodeId),a=Math.max(1,i.visibleSubtreeCount);return Math.min(r-1,n+a-1)}function yV(e,t,n,r){return{ancestorPaths:r,index:t.index,posInSet:t.posInSet,row:RV(e,t.cursor),setSize:t.setSize,subtreeEndIndex:vV(e,t.cursor,t.index,n)}}function bV(e,t,n,r,i,a){let o=wB(e,t),{childIndex:s,childVisibleIndex:c,localVisibleIndex:l}=xR(e.snapshot.nodes,o,n),u=o.childIds[s];if(u==null)throw Error(`Visible index ${String(n)} is out of range`);return xV(e,u,l,r+c,i+1,s,o.childIds.length,a)}function xV(e,t,n,r,i,a,o,s){if(!MR(TB(e,t))){if(n===0)return{ancestors:s,cursor:{headNodeId:t,terminalNodeId:t,visibleDepth:i},index:r,posInSet:a,setSize:o};throw Error(`Visible index ${String(n)} is out of range for file`)}let c=MV(e,t,i);if(n===0)return{ancestors:s,cursor:c,index:r,posInSet:a,setSize:o};let l=TB(e,c.terminalNodeId);if(!MR(l)||!kz(e,c.terminalNodeId,l))throw Error(`Visible index ${String(n)} is out of range for collapsed directory`);return bV(e,c.terminalNodeId,n-1,r+1,c.visibleDepth,[...s,{cursor:c,index:r,posInSet:a,setSize:o}])}function SV(e,t){let n=_V(e);if(t<0||t>=n)return null;let r=bV(e,e.snapshot.rootId,t,0,-1,[]),i=r.ancestors.map(t=>vB(e,t.cursor.terminalNodeId)),a=null;return{ancestorPaths:i,get ancestorRows(){if(a!=null)return a;let t=[],i=[];for(let a of r.ancestors){let r=yV(e,a,n,[...i]);t.push(r),i.push(r.row.path)}return a=t,a},index:r.index,posInSet:r.posInSet,row:RV(e,r.cursor),setSize:r.setSize,subtreeEndIndex:vV(e,r.cursor,r.index,n)}}function CV(e,t,n){let r=e.instrumentation,i=_V(e);if(i<=0||n<t)return[];let a=Math.max(0,Math.min(t,i-1)),o=Math.max(a,Math.min(n,i-1));if(r==null){if(a===0)return LV(e,o+1);let t=[],n=kV(e,a);for(let r=a;r<=o&&n!=null;r++){let r=RV(e,n);t.push(r),n=PV(e,n)}return t}let s=[],c=0,l=0,u=BR(r,`store.getVisibleSlice.selectFirstRow`,()=>kV(e,a));for(let t=a;t<=o&&u!=null;t++){let t=BR(r,`store.getVisibleSlice.materializeRow`,()=>RV(e,u));s.push(t),t.isFlattened&&(c++,l+=t.flattenedSegments?.length??0),u=BR(r,`store.getVisibleSlice.advanceCursor`,()=>PV(e,u))}return VR(r,`workload.visibleRowsRead`,s.length),VR(r,`workload.flattenedRowsRead`,c),VR(r,`workload.flattenedSegmentsRead`,l),s}function wV(e,t=_V(e)){let n=e.instrumentation;return n==null?IV(e,t):BR(n,`store.getVisibleTreeProjection`,()=>IV(e,t))}function TV(e){return FV(wV(e))}function EV(e,t){let n=SB(e,t);if(n==null||n===e.snapshot.rootId||MR(TB(e,n))&&uB(e,n)!==n)return null;let r=0,i=n,{nodes:a,rootId:o}=e.snapshot;for(;i!==o;){let t=TB(e,i).parentId,n=wB(e,t),s=gR(n).get(i);if(s==null)throw Error(`Child ${String(i)} was not found in its parent index`);if(r+=SR(a,n,s),t!==o){let n=TB(e,t),a=lB(e,t);if(!kz(e,t,n)&&a!==i)return null;uB(e,t)===t&&(r+=1)}i=t}return r}function DV(e,t){let n=SB(e,t);if(n==null)throw Error(`Path does not exist: "${t}"`);let r=TB(e,n);if(!MR(r))throw Error(`Path is not a directory: "${t}"`);return kz(e,n,r)?null:(Az(e,n,!0,r),yB(e,n),Uz({affectedAncestorIds:xB(e,n),affectedNodeIds:[n],path:t,projectionChanged:!0}))}function OV(e,t){let n=SB(e,t);if(n==null)throw Error(`Path does not exist: "${t}"`);let r=TB(e,n);if(!MR(r))throw Error(`Path is not a directory: "${t}"`);return kz(e,n,r)?(Az(e,n,!1,r),yB(e,n),Wz({affectedAncestorIds:xB(e,n),affectedNodeIds:[n],path:t,projectionChanged:!0})):null}function kV(e,t){return t<0||t>=_V(e)?null:AV(e,e.snapshot.rootId,t,-1)}function AV(e,t,n,r){let i=wB(e,t),a=e.instrumentation,{childIndex:o,localVisibleIndex:s}=a==null?xR(e.snapshot.nodes,i,n):BR(a,`store.getVisibleSlice.selectChildIndex`,()=>xR(e.snapshot.nodes,i,n)),c=i.childIds[o];if(c!=null)return jV(e,c,s,r+1);throw Error(`Visible index ${String(n)} is out of range`)}function jV(e,t,n,r){if(!MR(TB(e,t))){if(n===0)return{headNodeId:t,terminalNodeId:t,visibleDepth:r};throw Error(`Visible index ${String(n)} is out of range for file`)}let i=MV(e,t,r);if(n===0)return i;let a=TB(e,i.terminalNodeId);if(!MR(a)||!kz(e,i.terminalNodeId,a))throw Error(`Visible index ${String(n)} is out of range for collapsed directory`);return AV(e,i.terminalNodeId,n-1,i.visibleDepth)}function MV(e,t,n){return MR(TB(e,t))?e.instrumentation==null?{headNodeId:t,terminalNodeId:uB(e,t),visibleDepth:n}:{headNodeId:t,terminalNodeId:BR(e.instrumentation,`store.getVisibleSlice.flatten.resolveTerminalDirectory`,()=>uB(e,t)),visibleDepth:n}:{headNodeId:t,terminalNodeId:t,visibleDepth:n}}function NV(e,t){let n=TB(e,t);if(!MR(n))return!0;let r=n.parentId;return r===e.snapshot.rootId?!0:lB(e,r)!==t}function PV(e,t){let n=TB(e,t.terminalNodeId);if(MR(n)){let r=wB(e,t.terminalNodeId);if(kz(e,t.terminalNodeId,n)&&r.childIds.length>0){let n=r.childIds[0];return n==null?null:jV(e,n,0,t.visibleDepth+1)}}let r=t.terminalNodeId,i=t.visibleDepth;for(;;){let t=TB(e,r);if(r===e.snapshot.rootId)return null;let n=t.parentId,a=wB(e,n),o=gR(a).get(r)??-1;if(o<0)throw Error(`Child ${String(r)} was not found in its parent index`);let s=a.childIds[o+1]??null;if(s!=null)return jV(e,s,0,i);NV(e,r)&&i--,r=n}}function FV(e){let t=e.paths.length,n=Array(t);for(let r=0;r<t;r+=1){let t=e.getParentIndex(r);n[r]={index:r,parentPath:t>=0?e.paths[t]??null:null,path:e.paths[r]??``,posInSet:e.posInSetByIndex[r]??0,setSize:e.setSizeByIndex[r]??0}}return{getParentIndex:e.getParentIndex,rows:n,get visibleIndexByPath(){return e.visibleIndexByPath}}}function IV(e,t){let n=Array(t),r=new Int32Array(t),i=new Int32Array(t),a=new Int32Array(t),o=new Int32Array(hV);o.fill(-1);let s=0,{nodes:c,directories:l,segmentTable:u}=e.snapshot,d=[[l.get(e.snapshot.rootId),0,-1,``]],f=e.snapshot.options.flattenEmptyDirectories,p=e.pathCacheByNodeId,m=e.pathCacheVersion,h=u.valueById;for(;d.length>0&&s<t;){let t=d[d.length-1],u=t[0];if(t[1]>=u.childIds.length){d.pop();continue}let g=t[1],_=u.childIds[t[1]++],v=c[_],y=t[2]+1,b=t[3];o=gV(o,y);let x,S=_;if(MR(v))S=f?uB(e,_):_,x=S===_?`${b}${h[v.nameId]}/`:vB(e,S);else{let e=p.get(_);x=e!=null&&e.version===m?e.path:`${b}${h[v.nameId]}`}r[s]=o[y],n[s]=x,i[s]=g,a[s]=u.childIds.length,o[y+1]=s,s+=1;let C=c[S];C!=null&&MR(C)&&kz(e,S,C)&&d.push([l.get(S),0,y,x])}s<t&&(n.length=s);let g=r.subarray(0,s),_=i.subarray(0,s),v=a.subarray(0,s),y=null;return{getParentIndex(e){return e<0||e>=s?-1:g[e]??-1},paths:n,posInSetByIndex:_,setSizeByIndex:v,get visibleIndexByPath(){if(y==null){y=new Map;for(let e=0;e<s;e+=1)y.set(n[e]??``,e)}return y}}}function LV(e,t){let n=Array(t),r=0,{nodes:i,directories:a,segmentTable:o}=e.snapshot,s=[[a.get(e.snapshot.rootId),0,-1]],c=o.valueById,l=e.snapshot.options.flattenEmptyDirectories,u=e.pathCacheByNodeId,d=e.pathCacheVersion;for(;s.length>0&&r<t;){let t=s[s.length-1],o=t[0];if(t[1]>=o.childIds.length){s.pop();continue}let f=o.childIds[t[1]++],p=i[f],m=t[2]+1;if(!MR(p)){let t=u.get(f);n[r++]={depth:m,flattenedSegments:void 0,hasChildren:!1,id:f,isExpanded:!1,isFlattened:!1,isLoading:!1,kind:`file`,loadState:void 0,name:c[p.nameId],path:t!=null&&t.version===d?t.path:vB(e,f)};continue}let h=l?uB(e,f):f,g={headNodeId:f,terminalNodeId:h,visibleDepth:m};n[r++]=RV(e,g);let _=i[h];_!=null&&MR(_)&&kz(e,h,_)&&s.push([a.get(h),0,m])}return r<t&&(n.length=r),n}function RV(e,t){let n=TB(e,t.terminalNodeId),r=MR(n)?zV(e,t):null,i=vB(e,t.terminalNodeId),a=sz(e.snapshot.segmentTable,n.nameId),o=MR(n)&&wB(e,t.terminalNodeId).childIds.length>0,s=t.headNodeId!==t.terminalNodeId,c=e.instrumentation,l=s?c==null?dB(e,t.headNodeId).map(n=>{let r=TB(e,n);return{isTerminal:n===t.terminalNodeId,name:sz(e.snapshot.segmentTable,r.nameId),nodeId:n,path:vB(e,n)}}):BR(c,`store.getVisibleSlice.flatten.collectSegments`,()=>dB(e,t.headNodeId).map(n=>{let r=TB(e,n);return{isTerminal:n===t.terminalNodeId,name:sz(e.snapshot.segmentTable,r.nameId),nodeId:n,path:vB(e,n)}})):void 0;return{depth:t.visibleDepth,flattenedSegments:l,hasChildren:o,id:t.terminalNodeId,isExpanded:MR(n)&&kz(e,t.terminalNodeId,n),isFlattened:s,isLoading:r===`loading`,kind:MR(n)?`directory`:`file`,loadState:r==null||r===`loaded`?void 0:r,name:a,path:i}}function zV(e,t){if(t.headNodeId===t.terminalNodeId)return Mz(e,t.terminalNodeId);let n=dB(e,t.headNodeId),r=!1,i=!1;for(let t of n){let n=Mz(e,t);if(n===`loading`)return`loading`;if(n===`error`){i=!0;continue}n===`unloaded`&&(r=!0)}return i?`error`:r?`unloaded`:`loaded`}function BV(e){let{directories:t,nodes:n,options:r,rootId:i,presortedDirectoryNodeIds:a}=e.snapshot,o=r.flattenEmptyDirectories===!0,s=e=>{let r=n[e];if(r==null||!MR(r))return;let i=t.get(e);if(i==null)throw Error(`Unknown directory child index for node ${String(e)}`);let a=i.childIds,s=a.length,c=0,l=0;for(let e=0;e<s;e++){let t=a[e];if(t==null)continue;let r=n[t];c+=r.subtreeNodeCount,l+=r.visibleSubtreeCount}i.totalChildSubtreeNodeCount=c,i.totalChildVisibleSubtreeCount=l,s>=128&&CR(n,i),r.subtreeNodeCount=1+c;let u;if(o&&s===1){let e=n[a[0]];u=e!=null&&MR(e)?l:1+l}else u=1+l;r.visibleSubtreeCount=u};if(a!=null)for(let e=a.length-1;e>=0;e--)s(a[e]);else for(let e=n.length-1;e>=1;e--)s(e);let c=n[i],l=t.get(i);if(c==null||l==null)return;let u=l.childIds,d=0,f=0;for(let e=0;e<u.length;e++){let t=u[e];if(t==null)continue;let r=n[t];d+=r.subtreeNodeCount,f+=r.visibleSubtreeCount}l.totalChildSubtreeNodeCount=d,l.totalChildVisibleSubtreeCount=f,CR(n,l),c.subtreeNodeCount=1+d,c.visibleSubtreeCount=f}function VV(e){return e.initialExpansion===`open`&&(e.initialExpandedPaths==null||e.initialExpandedPaths.length===0)}var HV=class e{#e;constructor(e={}){let t=zR(e),n=BR(t,`store.builder.create`,()=>new wz(e));if(e.preparedInput!=null){let t=xz(e.preparedInput);t==null?n.appendPreparedPaths(bz(e.preparedInput),!1):n.appendPresortedPaths(t,Sz(e.preparedInput))}else{let r=e.paths??[];e.presorted===!0?n.appendPaths(r):n.appendPreparedPaths(BR(t,`store.preparePathEntries`,()=>Cz(r,e)))}let r=BR(t,`store.builder.finish`,()=>n.finish({skipSubtreeCountPass:!0})),i=BR(t,`store.state.detectAllDirectoriesExpanded`,()=>(e.initialExpansion??`closed`)===`closed`&&n.didMatchAllInitialExpandedPaths());this.#e=BR(t,`store.state.create`,()=>Tz(r,i?`open`:e.initialExpansion??`closed`,t)),i&&(this.#e.collapseNewDirectoriesByDefault=!0);let a=i?this.#e.snapshot.directories.size-1:BR(t,`store.state.initializeExpandedPaths`,()=>this.initializeExpandedPaths(e.initialExpandedPaths));i||VV(e)||(e.initialExpansion??`closed`)===`closed`&&a===this.#e.snapshot.directories.size-1||(e.initialExpandedPaths?.length??0)>0&&BR(t,`store.state.checkAllDirectoriesExpanded`,()=>this.hasAllDirectoriesExpanded())?BR(t,`store.state.initializeOpenVisibleCounts`,()=>BV(this.#e)):BR(t,`store.state.recomputeCounts`,()=>bB(this.#e,this.#e.snapshot.rootId))}static preparePaths(e,t={}){return _z(e,t)}static prepareInput(e,t={}){return vz(e,t)}static preparePresortedInput(e){return yz(e)}list(e){return BR(this.#e.instrumentation,`store.list`,()=>fB(this.#e,e))}add(e){BR(this.#e.instrumentation,`store.add`,()=>{let t=_V(this.#e);$z(this.#e,Zz(this.#e,t,pB(this.#e,e)))})}remove(e,t={}){BR(this.#e.instrumentation,`store.remove`,()=>{let n=_V(this.#e);$z(this.#e,Zz(this.#e,n,mB(this.#e,e,t)))})}move(e,t,n={}){BR(this.#e.instrumentation,`store.move`,()=>{let r=_V(this.#e),i=hB(this.#e,e,t,n);i!=null&&$z(this.#e,Zz(this.#e,r,i))})}batch(e){Qz(this.#e,()=>{if(typeof e==`function`){e(this);return}for(let t of e)switch(t.type){case`add`:this.add(t.path);break;case`remove`:this.remove(t.path,{recursive:t.recursive});break;case`move`:this.move(t.from,t.to,{collision:t.collision});break}})}getVisibleCount(){return BR(this.#e.instrumentation,`store.getVisibleCount`,()=>_V(this.#e))}getVisibleSlice(e,t){return BR(this.#e.instrumentation,`store.getVisibleSlice`,()=>CV(this.#e,e,t))}getVisibleRowContext(e){return BR(this.#e.instrumentation,`store.getVisibleRowContext`,()=>SV(this.#e,e))}getVisibleTreeProjection(){return TV(this.#e)}getVisibleTreeProjectionData(e){return wV(this.#e,e)}getVisibleIndex(e){return BR(this.#e.instrumentation,`store.getVisibleIndex`,()=>EV(this.#e,e))}getPathInfo(e){return BR(this.#e.instrumentation,`store.getPathInfo`,()=>{let t=SB(this.#e,e);if(t==null)return null;let n=TB(this.#e,t);return{depth:AR(n),kind:MR(n)?`directory`:`file`,path:vB(this.#e,t)}})}isExpanded(e){return BR(this.#e.instrumentation,`store.isExpanded`,()=>{let t=this.requireDirectoryNodeId(e),n=TB(this.#e,t);return kz(this.#e,t,n)})}expand(e){BR(this.#e.instrumentation,`store.expand`,()=>{let t=_V(this.#e),n=DV(this.#e,e);n!=null&&$z(this.#e,Zz(this.#e,t,n))})}collapse(e){BR(this.#e.instrumentation,`store.collapse`,()=>{let t=_V(this.#e),n=OV(this.#e,e);n!=null&&$z(this.#e,Zz(this.#e,t,n))})}on(e,t){return zz(this.#e,e,t)}getDirectoryLoadState(e){let t=this.requireDirectoryNodeId(e);return Mz(this.#e,t)}markDirectoryUnloaded(e){BR(this.#e.instrumentation,`store.markDirectoryUnloaded`,()=>{let t=this.requireDirectoryNodeId(e);if(wB(this.#e,t).childIds.length>0)throw Error(`Cannot mark a directory with known children as unloaded: "${e}"`);let n=_V(this.#e);Pz(this.#e,t),$z(this.#e,Zz(this.#e,n,Gz({affectedAncestorIds:xB(this.#e,t),affectedNodeIds:[t],path:e,projectionChanged:this.isDirectoryProjectionVisible(t)})))})}beginChildLoad(e){return BR(this.#e.instrumentation,`store.beginChildLoad`,()=>{let t=this.requireDirectoryNodeId(e),n=_V(this.#e),r=Nz(this.#e,t);return $z(this.#e,Zz(this.#e,n,Kz({affectedAncestorIds:xB(this.#e,t),affectedNodeIds:[t],attemptId:r.attemptId,path:e,projectionChanged:this.isDirectoryProjectionVisible(t),reused:r.reused}))),r})}applyChildPatch(e,t){return BR(this.#e.instrumentation,`store.applyChildPatch`,()=>{let n=this.resolveActiveDirectoryNodeId(e.nodeId);if(n==null||Mz(this.#e,n)!==`loading`||!Iz(this.#e,n,e.attemptId))return!1;let r=vB(this.#e,n);this.validateChildPatch(r,t);let i=_V(this.#e),a=[];for(let e of t.operations){UV(r,e);let t=_V(this.#e);switch(e.type){case`add`:a.push(Zz(this.#e,t,pB(this.#e,e.path)));break;case`remove`:a.push(Zz(this.#e,t,mB(this.#e,e.path,{recursive:e.recursive})));break;case`move`:{let n=hB(this.#e,e.from,e.to,{collision:e.collision});n!=null&&a.push(Zz(this.#e,t,n));break}}}let o=a.some(e=>e.projectionChanged)||this.isDirectoryProjectionVisible(n);return $z(this.#e,Zz(this.#e,i,qz({affectedAncestorIds:xB(this.#e,n),affectedNodeIds:[n],attemptId:e.attemptId,childEvents:a,path:vB(this.#e,n),projectionChanged:o}))),!0})}completeChildLoad(e){return BR(this.#e.instrumentation,`store.completeChildLoad`,()=>{let t=this.resolveActiveDirectoryNodeId(e.nodeId);if(t==null)return!1;let n=_V(this.#e),r=Fz(this.#e,t,e.attemptId);return $z(this.#e,Zz(this.#e,n,Jz({affectedAncestorIds:xB(this.#e,t),affectedNodeIds:[t],attemptId:e.attemptId,path:vB(this.#e,t),projectionChanged:this.isDirectoryProjectionVisible(t),stale:!r}))),r})}failChildLoad(e,t){return BR(this.#e.instrumentation,`store.failChildLoad`,()=>{let n=this.resolveActiveDirectoryNodeId(e.nodeId);if(n==null)return!1;let r=_V(this.#e),i=Lz(this.#e,n,e.attemptId,t);return $z(this.#e,Zz(this.#e,r,Yz({affectedAncestorIds:xB(this.#e,n),affectedNodeIds:[n],attemptId:e.attemptId,errorMessage:t,path:vB(this.#e,n),projectionChanged:this.isDirectoryProjectionVisible(n),stale:!i}))),i})}cleanup(e={}){return BR(this.#e.instrumentation,`store.cleanup`,()=>{if(this.#e.transactionStack.length>0)throw Error(`Cleanup cannot run during an open batch or transaction.`);if(pV(this.#e))throw Error(`Cleanup cannot run while directory loads are active.`);let t=_V(this.#e),n=mV(this.#e,e.mode??`stable`);return $z(this.#e,Zz(this.#e,t,Xz({...n,affectedAncestorIds:[],affectedNodeIds:[],projectionChanged:n.idsPreserved===!1}))),n})}getNodeCount(){return this.#e.activeNodeCount}initializeExpandedPaths(e){if(e==null||e.length===0)return 0;let t=0,n=[],r=[],i=0,a=null,o=this.#e.snapshot.segmentTable,s=o.valueById,c=this.#e.snapshot.nodes,l=new Map;for(let u of e){a!=null&&u<a&&(a=null,i=0,n.length=0,r.length=0);let e=u.length>0&&u.charCodeAt(u.length-1)===47?u.length-1:u.length;if(e===0){a=u,i=e,n.length=0,r.length=0;continue}let d=0,f=0;if(a!=null){let t=Math.min(e,i),n=!0;for(let e=0;e<t;e+=1){let t=u.charCodeAt(e);if(t!==a.charCodeAt(e)){n=!1;break}t===47&&(d+=1,f=e+1)}n&&(t===i&&e>t&&u.charCodeAt(t)===47?(d+=1,f=t+1):t===e&&i>t&&a.charCodeAt(t)===47&&(d+=1,f=e+1)),d=Math.min(d,r.length)}let p=d===0?this.#e.snapshot.rootId:r[d-1]??this.#e.snapshot.rootId,m=d,h=!0,g=f;for(;g<=e;){let t=u.indexOf(`/`,g),i=t===-1||t>e?e:t,a=u.slice(g,i),f=wB(this.#e,p).childIds,_=m===d?n[m]??0:0,v=_,y,b=l.get(a)??WR(a);l.set(a,b);let x=(e,t)=>{for(v=e;v<t;v+=1){let e=f[v],t=c[e],n=s[t.nameId];if(n===a)return y=e,!0;let r=KR($R(o,t.nameId),b);if(r>0||r===0&&n>a)return!1}return!1};if(!x(_,f.length)&&_>0&&x(0,_),y===void 0){h=!1;break}if(!MR(TB(this.#e,y))){h=!1;break}if(n[m]=v,r[m]=y,p=y,m+=1,i===e)break;g=i+1}if(a=u,i=e,n.length=m,r.length=m,!h){a=null,i=0,n.length=0,r.length=0;continue}for(let e=d;e<m;e+=1){let n=r[e];if(n==null)continue;let i=TB(this.#e,n);kz(this.#e,n,i)||(Az(this.#e,n,!0,i),t+=1)}}return t}hasAllDirectoriesExpanded(){for(let e of this.#e.snapshot.directories.keys()){if(e===this.#e.snapshot.rootId)continue;let t=TB(this.#e,e);if(!kz(this.#e,e,t))return!1}return!0}requireDirectoryNodeId(e){let t=SB(this.#e,e);if(t==null)throw Error(`Path does not exist: "${e}"`);if(!MR(TB(this.#e,t)))throw Error(`Path is not a directory: "${e}"`);return t}resolveActiveDirectoryNodeId(e){try{if(!MR(TB(this.#e,e)))throw Error(`Node is not a directory: ${String(e)}`);return e}catch{return null}}isDirectoryProjectionVisible(e){let t=e;for(;t!==this.#e.snapshot.rootId;){let e=TB(this.#e,t).parentId;if(e!==this.#e.snapshot.rootId){let n=TB(this.#e,e),r=lB(this.#e,e);if(!kz(this.#e,e,n)&&r!==t)return!1}t=e}return!0}validateChildPatch(t,n){new e({paths:this.list(t),presorted:!0,sort:this.#e.snapshot.options.sort}).batch(n.operations)}};function UV(e,t){switch(t.type){case`add`:case`remove`:if(!t.path.startsWith(e)||t.path===e)throw Error(`Child patch operation must stay within ${e}: "${t.path}"`);break;case`move`:if(!t.from.startsWith(e)||!t.to.startsWith(e)||t.from===e||t.to===e)throw Error(`Child patch move must stay within ${e}: "${t.from}" -> "${t.to}"`);break}}var WV={compact:{itemHeight:24,factor:.8},default:{itemHeight:30,factor:1},relaxed:{itemHeight:36,factor:1.2}};function GV(e,t){if(typeof e==`number`)return{itemHeight:t??WV.default.itemHeight,factor:e};let n=WV[e??`default`];return{itemHeight:t??n.itemHeight,factor:n.factor}}var KV=WV.default.itemHeight,qV=`@layer base, theme, unsafe;
|
|
195
|
+
</symbol>`],BL=[VI,HI,WI,GI,KI,qI,YI,eL,tL,aL,fL,pL,mL,hL,gL,vL,xL,SL,CL,wL,TL,OL,kL,ML,NL,PL,FL,IL,LL,RL];function VL(e,t){return t.length===0?e:e.replace(`</svg>`,`\n ${t.join(`
|
|
196
|
+
`)}\n</svg>`)}var HL=VL(BI,zL),UL={minimal:BI,standard:HL,complete:VL(HL,BL)},WL={".babelrc":`babel`,".babelrc.json":`babel`,".bash_profile":`bash`,".bashrc":`bash`,".browserslistrc":`browserslist`,".dockerignore":`docker`,".eslintignore":`eslint`,".eslintrc":`eslint`,".eslintrc.cjs":`eslint`,".eslintrc.js":`eslint`,".eslintrc.json":`eslint`,".eslintrc.yaml":`eslint`,".eslintrc.yml":`eslint`,".gitattributes":`git`,".gitignore":`git`,".gitkeep":`git`,".gitmodules":`git`,".oxlintrc.json":`oxc`,".postcssrc":`postcss`,".postcssrc.json":`postcss`,".postcssrc.yaml":`postcss`,".postcssrc.yml":`postcss`,".prettierignore":`prettier`,".prettierrc":`prettier`,".prettierrc.cjs":`prettier`,".prettierrc.js":`prettier`,".prettierrc.json":`prettier`,".prettierrc.mjs":`prettier`,".prettierrc.toml":`prettier`,".prettierrc.yaml":`prettier`,".prettierrc.yml":`prettier`,".stylelintignore":`stylelint`,".stylelintrc":`stylelint`,".stylelintrc.cjs":`stylelint`,".stylelintrc.js":`stylelint`,".stylelintrc.json":`stylelint`,".stylelintrc.mjs":`stylelint`,".stylelintrc.yaml":`stylelint`,".stylelintrc.yml":`stylelint`,".terraform.lock.hcl":`terraform`,".zprofile":`bash`,".zshenv":`bash`,".zshrc":`bash`,"babel.config.cjs":`babel`,"babel.config.js":`babel`,"babel.config.json":`babel`,"babel.config.mjs":`babel`,"biome.json":`biome`,"biome.jsonc":`biome`,"bootstrap.bundle.js":`bootstrap`,"bootstrap.bundle.min.js":`bootstrap`,"bootstrap.css":`bootstrap`,"bootstrap.js":`bootstrap`,"bootstrap.min.css":`bootstrap`,"bootstrap.min.js":`bootstrap`,"bun.lock":`bun`,"bun.lockb":`bun`,"bunfig.toml":`bun`,"claude.md":`claude`,"compose.yaml":`docker`,"compose.yml":`docker`,"docker-compose.override.yml":`docker`,"docker-compose.yaml":`docker`,"docker-compose.yml":`docker`,dockerfile:`docker`,"eslint.config.cjs":`eslint`,"eslint.config.js":`eslint`,"eslint.config.mjs":`eslint`,"eslint.config.mts":`eslint`,"eslint.config.ts":`eslint`,gemfile:`ruby`,"next.config.js":`nextjs`,"next.config.mjs":`nextjs`,"next.config.mts":`nextjs`,"next.config.ts":`nextjs`,"postcss.config.cjs":`postcss`,"postcss.config.js":`postcss`,"postcss.config.mjs":`postcss`,"postcss.config.ts":`postcss`,"prettier.config.cjs":`prettier`,"prettier.config.js":`prettier`,"prettier.config.mjs":`prettier`,rakefile:`ruby`,"readme.md":`markdown`,"stylelint.config.cjs":`stylelint`,"stylelint.config.js":`stylelint`,"stylelint.config.mjs":`stylelint`,"svgo.config.cjs":`svgo`,"svgo.config.js":`svgo`,"svgo.config.mjs":`svgo`,"svgo.config.ts":`svgo`,"tailwind.config.cjs":`tailwind`,"tailwind.config.js":`tailwind`,"tailwind.config.mjs":`tailwind`,"tailwind.config.ts":`tailwind`,"vite.config.js":`vite`,"vite.config.mjs":`vite`,"vite.config.mts":`vite`,"vite.config.ts":`vite`,"webpack.config.babel.js":`webpack`,"webpack.config.cjs":`webpack`,"webpack.config.js":`webpack`,"webpack.config.mjs":`webpack`,"webpack.config.ts":`webpack`},GL={"7z":`zip`,astro:`astro`,AUTHORS:`text`,avif:`image`,bash:`bash`,bmp:`image`,bz2:`zip`,c:`c`,cc:`cpp`,cfg:`text`,CHANGELOG:`text`,cjs:`javascript`,"code-workspace":`vscode`,conf:`text`,CONTRIBUTORS:`text`,cpp:`cpp`,csh:`bash`,css:`css`,csv:`table`,cts:`typescript`,cxx:`cpp`,db:`database`,editorconfig:`text`,env:`text`,"env.development":`text`,"env.local":`text`,"env.production":`text`,eot:`font`,erb:`ruby`,fish:`bash`,gemspec:`ruby`,gif:`image`,go:`go`,gql:`graphql`,graphql:`graphql`,gz:`zip`,h:`c`,hh:`cpp`,hpp:`cpp`,htm:`html`,html:`html`,hxx:`cpp`,icns:`image`,ico:`image`,ini:`text`,inl:`cpp`,jar:`zip`,jpeg:`image`,jpg:`image`,js:`javascript`,json:`json`,json5:`json`,jsonc:`json`,jsonl:`json`,jsx:`javascript`,ksh:`bash`,less:`css`,LICENSE:`text`,log:`text`,markdown:`markdown`,mcp:`mcp`,md:`markdown`,mdx:`markdown`,"mdx.tsx":`markdown`,mjs:`javascript`,mm:`cpp`,mts:`typescript`,ods:`table`,otf:`font`,png:`image`,postcss:`css`,py:`python`,pyi:`python`,pyw:`python`,pyx:`python`,rake:`ruby`,rar:`zip`,rb:`ruby`,rs:`rust`,rst:`text`,rtf:`text`,sass:`css`,scss:`css`,sh:`bash`,sql:`database`,sqlite:`database`,sqlite3:`database`,styl:`css`,svelte:`svelte`,svg:`svg`,swift:`swift`,tar:`zip`,tf:`terraform`,tfstate:`terraform`,tfvars:`terraform`,tgz:`zip`,tif:`image`,tiff:`image`,ts:`typescript`,tsv:`table`,tsx:`typescript`,ttf:`font`,txt:`text`,vue:`vue`,war:`zip`,wasm:`wasm`,wast:`wasm`,wat:`wasm`,webp:`image`,woff:`font`,woff2:`font`,xhtml:`html`,xls:`table`,xlsx:`table`,xz:`zip`,yaml:`yml`,yml:`yml`,zig:`zig`,zip:`zip`,zsh:`bash`},KL={jsx:`react`,sass:`sass`,scss:`sass`,tsx:`react`},qL=new Set([`bash`,`c`,`cpp`,`css`,`database`,`default`,`font`,`git`,`go`,`html`,`image`,`javascript`,`json`,`markdown`,`mcp`,`python`,`ruby`,`rust`,`swift`,`table`,`text`,`typescript`,`zip`]),JL=new Set([`complete`]);function YL(e){return UL[e===`none`?`minimal`:e]}function XL(e){return`file-tree-builtin-${e}`}function ZL(e){return e!==`none`&&JL.has(e)}function QL(e,t,n){if(e===`minimal`||e===`none`)return;let r=e===`complete`,i=WL[t.toLowerCase()];if(i!=null&&(r||qL.has(i)))return i;for(let e of n){if(r){let t=KL[e];if(t!=null)return t}let t=GL[e];if(t!=null&&(r||qL.has(t)))return t}return`default`}var $L=`file-tree-container`,eR=`data-file-tree-style`,tR=`data-file-tree-unsafe-css`,nR=`data-file-tree-scrollbar-measure`,rR=`data-file-tree-scrollbar-gutter-measured`,iR=`--trees-scrollbar-gutter-measured`,aR=`header`,oR=`context-menu`,sR=`context-menu-trigger`;function cR(e){return e.spriteSheet!=null||e.remap!=null||e.byFileName!=null||e.byFileExtension!=null||e.byFileNameContains!=null}function lR(e){return e==null?{set:`complete`,colored:!0}:typeof e==`string`?{set:e,colored:!0}:{...e,set:e.set??(cR(e)?`none`:`complete`),colored:e.colored??!0}}var uR=e=>e.trim().toLowerCase(),dR=e=>e.split(`/`).at(-1)??e,fR=e=>{let t=e.toLowerCase().split(`.`),n=[];for(let e=1;e<t.length;e+=1)n.push(t.slice(e).join(`.`));return n};function pR(e,t){return typeof e==`string`?{name:e,remappedFrom:t}:{...e,remappedFrom:t}}function mR(e){let t=lR(e),n=t.remap,r=new Map;for(let[e,n]of Object.entries(t.byFileName??{}))r.set(e.toLowerCase(),n);let i=new Map;for(let[e,n]of Object.entries(t.byFileExtension??{}))i.set(uR(e),n);let a=Object.entries(t.byFileNameContains??{}).map(([e,t])=>[e.toLowerCase(),t]);return{resolveIcon:(e,o)=>{if(e===`file-tree-icon-file`&&o!=null){let n=dR(o),s=n.toLowerCase(),c=r.get(s);if(c!=null)return pR(c,e);for(let[t,n]of a)if(s.includes(t))return pR(n,e);let l=fR(n);for(let t of l){let n=i.get(t);if(n!=null)return pR(n,e)}let u=QL(t.set,n,l);if(u!=null&&t.set!==`none`)return{name:XL(u),remappedFrom:e,token:u}}let s=n?.[e];return s==null?{name:e}:pR(s,e)}}}var hR=/^#(?:[0-9a-f]{3}0|[0-9a-f]{6}00)$/i,gR=/^0(?:\.0+)?%?$/;function _R(e){let t=e.indexOf(`(`);if(t<=0||!e.endsWith(`)`))return;let n=e.slice(0,t).trim();if(!/^(?:rgb|rgba|hsl|hsla|hwb|lab|lch|oklab|oklch|color)$/i.test(n))return;let r=e.slice(t+1,-1).trim();if(r.length===0)return;let i=r.lastIndexOf(`/`);if(i!==-1)return r.slice(i+1).trim();if(/^(?:rgba|hsla)$/i.test(n)){let e=r.split(`,`);if(e.length===4)return e[3]?.trim()}}function vR(e){if(e==null)return!1;let t=e.trim().toLowerCase();if(t===`transparent`||hR.test(t))return!0;let n=_R(t);return n!=null&&gR.test(n)}function yR(e){return vR(e)?void 0:e}function bR(e){let t=e.colors??{},n=t[`sideBar.background`]??t[`editor.background`]??e.bg,r=t[`sideBar.foreground`]??t[`editor.foreground`]??e.fg,i=t[`sideBar.border`],a=t[`list.activeSelectionForeground`]??t[`sideBar.foreground`],o=n?.toLowerCase(),s=t[`list.hoverBackground`],c=s?.toLowerCase()===o?void 0:s,l=t[`list.activeSelectionBackground`],u=l?.toLowerCase()===o?t[`list.focusBackground`]??t[`editor.selectionBackground`]:l??t[`editor.selectionBackground`],d=yR(t[`list.focusOutline`])??yR(t.focusBorder),f=t[`input.background`]??n,p=t[`input.border`],m=t[`scrollbarSlider.background`],h=t[`sideBarSectionHeader.foreground`]??r,g=t[`gitDecoration.addedResourceForeground`]??t[`terminal.ansiGreen`]??t[`editorGutter.addedBackground`],_=t[`gitDecoration.modifiedResourceForeground`]??t[`terminal.ansiBlue`]??t[`editorGutter.modifiedBackground`],v=t[`gitDecoration.deletedResourceForeground`]??t[`terminal.ansiRed`]??t[`editorGutter.deletedBackground`],y=e.type===`dark`,b={colorScheme:y?`dark`:`light`,backgroundColor:n??``,color:r??``,borderColor:`var(--trees-theme-sidebar-border, light-dark(oklch(0% 0 0 / 0.15), oklch(100% 0 0 / 0.15)))`,"--trees-theme-sidebar-bg":n??``,"--trees-theme-sidebar-fg":r??``,"--trees-theme-sidebar-header-fg":h??``,"--trees-theme-list-active-selection-fg":a??r??``,"--trees-theme-list-hover-bg":c??(y?`rgba(255,255,255,0.08)`:`rgba(0,0,0,0.06)`),"--trees-theme-list-active-selection-bg":u??`transparent`,"--trees-theme-focus-ring":d??r??``,"--trees-theme-input-bg":f??``};return i!=null&&i!==``&&(b[`--trees-theme-sidebar-border`]=i),p!=null&&p!==``&&(b[`--trees-theme-input-border`]=p),m!=null&&m!==``&&(b[`--trees-theme-scrollbar-thumb`]=m),g!=null&&g!==``&&(b[`--trees-theme-git-added-fg`]=g),_!=null&&_!==``&&(b[`--trees-theme-git-modified-fg`]=_),v!=null&&v!==``&&(b[`--trees-theme-git-deleted-fg`]=v),b}var xR=5,SR=1<<xR,CR=SR*4;function wR(){return{childIdByNameId:new Map,childIds:[],childPositionById:new Map,childVisibleChunkSums:null,totalChildSubtreeNodeCount:0,totalChildVisibleSubtreeCount:0}}function TR(){return{childIdByNameId:null,childIds:[],childPositionById:null,childVisibleChunkSums:null,totalChildSubtreeNodeCount:0,totalChildVisibleSubtreeCount:0}}function ER(e,t){if(t.childIdByNameId!=null)return t.childIdByNameId;let n=new Map;for(let r of t.childIds){let t=e[r];t!=null&&n.set(t.nameId,r)}return t.childIdByNameId=n,n}function DR(e){if(e.childPositionById!=null)return e.childPositionById;let t=new Map;for(let n=0;n<e.childIds.length;n++){let r=e.childIds[n];r!=null&&t.set(r,n)}return e.childPositionById=t,t}function OR(e,t){e.childPositionById!=null&&e.childPositionById.set(t,e.childIds.length),e.childIds.push(t)}function kR(e,t){if(e.childPositionById!=null)for(let n=t;n<e.childIds.length;n++){let t=e.childIds[n];t!=null&&e.childPositionById.set(t,n)}}function AR(e,t){let n=0,r=0;for(let i of t.childIds){let t=e[i];t!=null&&(n+=t.subtreeNodeCount,r+=t.visibleSubtreeCount)}t.totalChildSubtreeNodeCount=n,t.totalChildVisibleSubtreeCount=r,PR(e,t)}function jR(e,t,n,r){if(e.totalChildSubtreeNodeCount+=n,e.totalChildVisibleSubtreeCount+=r,e.childVisibleChunkSums==null||r===0)return;let i=DR(e).get(t);if(i===void 0)return;let a=i>>xR;e.childVisibleChunkSums[a]+=r}function MR(e,t,n){let r=t.childVisibleChunkSums;if(r!=null){let i=n,a=0;for(let o of r){if(i<o){let r=FR(e,t,a,i);return{...r,childVisibleIndex:n-r.localVisibleIndex}}i-=o,a+=SR}throw Error(`Visible child index ${String(n)} is out of range`)}let i=n;for(let r=0;r<t.childIds.length;r++){let a=t.childIds[r];if(a==null)continue;let o=e[a];if(o!=null){if(i<o.visibleSubtreeCount)return{childIndex:r,childVisibleIndex:n-i,localVisibleIndex:i};i-=o.visibleSubtreeCount}}throw Error(`Visible child index ${String(n)} is out of range`)}function NR(e,t,n){let r=0,i=t.childVisibleChunkSums,a=0;if(i!=null){let e=n>>xR;for(let t=0;t<e;t+=1)r+=i[t]??0;a=e<<xR}for(let i=a;i<n;i+=1){let n=t.childIds[i];if(n==null)continue;let a=e[n];a!=null&&(r+=a.visibleSubtreeCount)}return r}function PR(e,t){if(t.childIds.length<CR){t.childVisibleChunkSums=null;return}let n=Math.ceil(t.childIds.length/SR),r=new Int32Array(n);for(let n=0;n<t.childIds.length;n++){let i=t.childIds[n];if(i==null)continue;let a=e[i];a!=null&&(r[n>>xR]+=a.visibleSubtreeCount)}t.childVisibleChunkSums=r}function FR(e,t,n,r){let i=Math.min(t.childIds.length,n+SR),a=r;for(let r=n;r<i;r++){let n=t.childIds[r];if(n==null)continue;let i=e[n];if(i!=null){if(a<i.visibleSubtreeCount)return{childIndex:r,localVisibleIndex:a};a-=i.visibleSubtreeCount}}throw Error(`Visible child index ${String(r)} is out of range`)}var IR=7,LR=3,RR=1<<LR,zR=4;function BR(e,t,n=0){return e<<zR|n<<LR|t}function VR(e){return e.depthAndFlags>>>zR}function HR(e){return(e.depthAndFlags&RR)>>LR}function UR(e){return(e.depthAndFlags&RR)!==0}function WR(e){return e.depthAndFlags&IR}function GR(e,t){return(WR(e)&t)!==0}function KR(e,t){e.depthAndFlags|=t}function qR(e,t){e.depthAndFlags=BR(t,WR(e),HR(e))}var JR=Symbol(`benchmarkInstrumentation`);function YR(e,t){return t==null||Object.defineProperty(e,JR,{configurable:!0,enumerable:!1,value:t,writable:!1}),e}function XR(e){return e==null?null:e[JR]??null}function ZR(e,t,n){return e==null?n():e.measurePhase(t,n)}function QR(e,t,n){!Number.isFinite(n)||e==null||e.setCounter(t,n)}function $R(e){return e>=48&&e<=57}function ez(e){let t=[],n=0,r=0;for(;r<e.length;){for(;r<e.length&&!$R(e.charCodeAt(r));)r+=1;if(r>=e.length)break;r>n&&t.push(e.slice(n,r));let i=0;for(;r<e.length&&$R(e.charCodeAt(r));)i=i*10+(e.charCodeAt(r)-48),r+=1;t.push(i),n=r}return(n<e.length||t.length===0)&&t.push(e.slice(n)),t}function tz(e){let t=e.toLowerCase();return{lowerValue:t,tokens:ez(t)}}function nz(e,t){let n=Math.min(e.length,t.length);for(let r=0;r<n;r++){let n=e[r],i=t[r];if(n===i)continue;if(typeof n==`number`&&typeof i==`number`)return n<i?-1:1;let a=String(n),o=String(i);if(a!==o)return a<o?-1:1}return e.length===t.length?0:e.length<t.length?-1:1}function rz(e,t){if(e.tokens.length===1&&t.tokens.length===1&&typeof e.tokens[0]==`string`&&typeof t.tokens[0]==`string`)return e.lowerValue===t.lowerValue?0:e.lowerValue<t.lowerValue?-1:1;let n=nz(e.tokens,t.tokens);return n===0?e.lowerValue===t.lowerValue?0:e.lowerValue<t.lowerValue?-1:1:n}function iz(e,t,n){let r=rz(n(e),n(t));return r===0?e===t?0:e<t?-1:1:r}function az(e,t){return iz(e,t,tz)}function oz(e,t){return t===e.segments.length-1?+!!e.isDirectory:1}function sz(e,t){let n=Math.min(e.segments.length,t.segments.length);for(let r=0;r<n;r++){let n=e.segments[r],i=t.segments[r];if(n===i)continue;let a=oz(e,r);return a===oz(t,r)?az(n,i):a===1?-1:1}return e.segments.length===t.segments.length?e.isDirectory===t.isDirectory?0:e.isDirectory?-1:1:e.segments.length<t.segments.length?-1:1}function cz(e,t){return sz(e,t)}function lz(e,t,n){let r=e=>{let t=n.get(e);if(t!=null)return t;let r=tz(e);return n.set(e,r),r},i=Math.min(e.segments.length,t.segments.length);for(let n=0;n<i;n++){let i=e.segments[n],a=t.segments[n];if(i===a)continue;let o=oz(e,n);return o===oz(t,n)?iz(i,a,r):o===1?-1:1}return e.segments.length===t.segments.length?e.isDirectory===t.isDirectory?0:e.isDirectory?-1:1:e.segments.length<t.segments.length?-1:1}function uz(e,t){let n=e.sortKeyById[t];if(n!==void 0)return n;let r=e.valueById[t],i=tz(r);return e.sortKeyById[t]=i,i}function dz(e={}){return{flattenEmptyDirectories:e.flattenEmptyDirectories!==!1,sort:e.sort??`default`}}function fz(e){let t=e.length>0&&e.charCodeAt(e.length-1)===47,n=t?e.length-1:e.length,r=[],i=0;for(let t=0;t<n;t++)e.charCodeAt(t)===47&&(r.push(e.slice(i,t)),i=t+1);return r.push(e.slice(i,n)),{hasTrailingSlash:t,segments:r}}function pz(e){let{hasTrailingSlash:t,segments:n}=fz(e);return{basename:n[n.length-1]??``,isDirectory:t,path:e,segments:n}}function mz(e){if(e.length===0)return{requiresDirectory:!1,segments:[]};let{hasTrailingSlash:t,segments:n}=fz(e);return{requiresDirectory:t,segments:n}}var hz=``;function gz(){let e=new Map;return e.set(hz,0),{idByValue:e,valueById:[hz],sortKeyById:[tz(hz)]}}function _z(e,t){let n=e.idByValue.get(t);if(n!==void 0)return n;let r=e.valueById.length;return e.idByValue.set(t,r),e.valueById.push(t),r}function vz(e,t){let n=e.valueById[t];if(n===void 0)throw Error(`Unknown segment ID: ${String(t)}`);return n}var yz=Symbol(`pathStorePreparedInputKind`);function bz(e,t){return e[yz]=t,e}function xz(e){return{basename:e.basename,depth:e.segments.length,isDirectory:e.isDirectory,path:e.path,segments:e.segments}}function Sz(e,t,n){return n===`default`?cz(e,t):n(xz(e),xz(t))}function Cz(){return{depthAndFlags:BR(0,3,1),nameId:0,parentId:0,subtreeNodeCount:1,visibleSubtreeCount:1}}function wz(e,t){let n=Math.min(e.length,t.length);for(let r=0;r<n;r++)if(e[r]!==t[r])return r;return n}function Tz(e){return e.isDirectory?e.segments.length:e.segments.length-1}function Ez(e){return Array.isArray(e)&&e.every(e=>typeof e==`object`&&!!e&&typeof e.path==`string`&&Array.isArray(e.segments)&&typeof e.basename==`string`&&typeof e.isDirectory==`boolean`)}function Dz(e){return Array.isArray(e)&&e.every(e=>typeof e==`string`)}function Oz(e,t={}){return Pz(e,t).map(e=>e.path)}function kz(e,t={}){let n=Pz(e,t);return bz({paths:n.map(e=>e.path),preparedPaths:n},`prepared`)}function Az(e){let t=e.length,n=!1;for(let r=0;r<t;r+=1){let t=e[r];if(t.length>0&&t.charCodeAt(t.length-1)===47){n=!0;break}}return bz({paths:e,presortedPaths:e,presortedPathsContainDirectories:n},`presorted`)}function jz(e){let t=e,n=t.preparedPaths;if(t[yz]===`prepared`&&n!=null)return n;if(!Ez(n))throw Error(`preparedInput must come from PathStore.prepareInput()`);return n}function Mz(e){let t=e;return t[yz]===`presorted`&&t.presortedPaths!=null||Dz(t.presortedPaths)?t.presortedPaths:null}function Nz(e){let t=e;return typeof t.presortedPathsContainDirectories==`boolean`?t.presortedPathsContainDirectories:null}function Pz(e,t={}){let n=dz(t),r=XR(t);QR(r,`workload.inputFiles`,e.length);let i=ZR(r,`store.preparePathEntries.parse`,()=>e.map(e=>pz(e)));return ZR(r,`store.preparePathEntries.sort`,()=>i.sort((e,t)=>Sz(e,t,n.sort))),i}var Fz=class{directories=new Map;directoryStack=[0];presortedDirectoryNodeIds=[];initialExpandedPathSet;createdDirectoriesAllExpanded=!1;createdDirectoryCount=0;lastPreparedPath=null;nodes=[Cz()];options;instrumentation;segmentSortKeyCache=new Map;segmentTable=gz();hasDeferredDirectoryIndexes=!1;constructor(e={}){this.instrumentation=XR(e),this.options=dz(e);let t=e.initialExpandedPaths??null;if(t==null||t.length===0)this.initialExpandedPathSet=null;else{let e=new Set,n=t.length;for(let r=0;r<n;r+=1){let n=t[r],i=n.length;e.add(i>0&&n.charCodeAt(i-1)===47?n.slice(0,i-1):n)}this.initialExpandedPathSet=e,this.createdDirectoriesAllExpanded=!0}this.directories.set(0,wR())}appendPaths(e){return ZR(this.instrumentation,`store.builder.appendPaths.parse`,()=>this.appendPreparedPaths(e.map(e=>pz(e))))}appendPreparedPaths(e,t=!0){return this.createdDirectoriesAllExpanded=!1,ZR(this.instrumentation,`store.builder.appendPreparedPaths`,()=>{for(let n of e)this.appendPreparedPath(n,t)}),this}appendPresortedPaths(e,t=null){return ZR(this.instrumentation,`store.builder.appendPresortedPaths`,()=>{if(t===!1){this.appendPresortedFilePaths(e);return}this.createdDirectoriesAllExpanded=!1;let n=null,r=0,i=this.nodes,a=this.segmentTable,o=a.idByValue,s=a.valueById,c=this.directoryStack,l=0,u=``,d=0;for(let t of e){if(n===t)throw Error(`Duplicate path: "${t}"`);let e=t.length>0&&t.charCodeAt(t.length-1)===47,a=e?t.length-1:t.length,f=0,p=0;if(n!=null)if(u.length>0&&t.length>u.length&&t.startsWith(u))f=d,p=u.length;else{let r=Math.min(a,n.length),i=!0;for(let e=0;e<r;e++){let r=t.charCodeAt(e);if(r!==n.charCodeAt(e)){i=!1;break}r===47&&(f++,p=e+1)}i&&e&&r===a&&n.length>a&&n.charCodeAt(a)===47&&(f++,p=a+1)}l=f,r=f;let m=p,h=t.indexOf(`/`,m);for(;h>=0&&h<a;){let e=c[l];if(e===void 0)throw Error(`Directory stack underflow while building the path store`);r++;let n=t.slice(m,h),a=o.get(n);a===void 0&&(a=s.length,o.set(n,a),s.push(n));let u=i.length;i.push({depthAndFlags:BR(r,0,1),nameId:a,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),this.recordCreatedDirectoryPath(t.slice(0,h)),l++,c[l]=u,m=h+1,h=t.indexOf(`/`,m)}if(e){if(m<a){let e=c[l];if(e===void 0)throw Error(`Unable to resolve directory parent for "${t}"`);r++;let n=t.slice(m,a),u=o.get(n);u===void 0&&(u=s.length,o.set(n,u),s.push(n));let d=i.length;i.push({depthAndFlags:BR(r,0,1),nameId:u,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),l++,c[l]=d}let e=c[l];if(e===void 0)throw Error(`Unable to resolve directory node for "${t}"`);this.promoteDirectoryToExplicit(e,t)}else{let e=c[l];if(e===void 0)throw Error(`Unable to resolve file parent for "${t}"`);let n=t.slice(m),a=o.get(n);a===void 0&&(a=s.length,o.set(n,a),s.push(n)),i.push({depthAndFlags:BR(r+1,0),nameId:a,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1})}m!==u.length&&(u=t.substring(0,m),d=r),n=t}c.length=l+1,n!=null&&(this.lastPreparedPath=pz(n)),this.hasDeferredDirectoryIndexes=!0}),this}appendPresortedFilePaths(e){let t=null,n=0,r=this.nodes,i=this.segmentTable,a=i.idByValue,o=i.valueById,s=this.directoryStack,c=0,l=``,u=0;for(let i of e){if(t===i)throw Error(`Duplicate path: "${i}"`);let e=i.length,d=0,f=0;if(t!=null)if(l.length>0&&i.length>l.length&&i.startsWith(l))d=u,f=l.length;else{let n=Math.min(e,t.length);for(let e=0;e<n;e++){let n=i.charCodeAt(e);if(n!==t.charCodeAt(e))break;n===47&&(d++,f=e+1)}}c=d,n=d;let p=f,m=i.indexOf(`/`,p);for(;m>=0;){let e=s[c];if(e===void 0)throw Error(`Directory stack underflow while building the path store`);n++;let t=i.slice(p,m),l=a.get(t);l===void 0&&(l=o.length,a.set(t,l),o.push(t));let u=r.length;r.push({depthAndFlags:BR(n,0,1),nameId:l,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),this.recordCreatedDirectoryPath(i.slice(0,m)),this.presortedDirectoryNodeIds.push(u),c++,s[c]=u,p=m+1,m=i.indexOf(`/`,p)}let h=s[c];if(h===void 0)throw Error(`Unable to resolve file parent for "${i}"`);let g=i.slice(p),_=a.get(g);_===void 0&&(_=o.length,a.set(g,_),o.push(g)),r.push({depthAndFlags:BR(n+1,0),nameId:_,parentId:h,subtreeNodeCount:1,visibleSubtreeCount:1}),p!==l.length&&(l=i.substring(0,p),u=n),t=i}s.length=c+1,t!=null&&(this.lastPreparedPath=pz(t)),this.hasDeferredDirectoryIndexes=!0}finish(e={}){let t=e.skipSubtreeCountPass===!0;return this.hasDeferredDirectoryIndexes?(ZR(this.instrumentation,`store.builder.buildDirectoryIndexes`,()=>this.buildPresortedFinish(t)),this.hasDeferredDirectoryIndexes=!1):t||ZR(this.instrumentation,`store.builder.computeSubtreeCounts`,()=>this.computeSubtreeCounts(0)),{directories:this.directories,nodes:this.nodes,options:this.options,rootId:0,segmentTable:this.segmentTable,presortedDirectoryNodeIds:this.presortedDirectoryNodeIds.length>0?this.presortedDirectoryNodeIds:null}}didMatchAllInitialExpandedPaths(){return this.createdDirectoriesAllExpanded&&this.initialExpandedPathSet!=null&&this.createdDirectoryCount===this.initialExpandedPathSet.size}appendPreparedPath(e,t){if(this.hasDeferredDirectoryIndexes&&=(this.buildDirectoryIndexes(),!1),this.lastPreparedPath!=null){if(e.path===this.lastPreparedPath.path)throw Error(`Duplicate path: "${e.path}"`);if(t&&(this.options.sort===`default`?lz(this.lastPreparedPath,e,this.segmentSortKeyCache):Sz(this.lastPreparedPath,e,this.options.sort))>0)throw Error(`Builder input must be sorted before appendPaths(): "${e.path}"`)}let n=this.lastPreparedPath,r=Tz(e),i=n==null?0:Tz(n),a=n==null?0:wz(n.segments,e.segments),o=Math.min(a,r,i);this.directoryStack.length=o+1;for(let n=o;n<r;n++){let r=this.directoryStack[this.directoryStack.length-1];if(r===void 0)throw Error(`Directory stack underflow while building the path store`);let i=t?this.getOrCreateDirectoryChild(r,e.segments[n]):this.createDirectoryChild(r,e.segments[n]);this.directoryStack.push(i)}if(e.isDirectory){let t=this.directoryStack[this.directoryStack.length-1];if(t===void 0)throw Error(`Unable to resolve directory node for "${e.path}"`);this.promoteDirectoryToExplicit(t,e.path),this.lastPreparedPath=e;return}let s=this.directoryStack[this.directoryStack.length-1];if(s===void 0)throw Error(`Unable to resolve file parent for "${e.path}"`);t?this.createFileChild(s,e.basename,e.path):this.createFileChildUnchecked(s,e.basename),this.lastPreparedPath=e}recordCreatedDirectoryPath(e){!this.createdDirectoriesAllExpanded||this.initialExpandedPathSet==null||(this.createdDirectoryCount+=1,this.initialExpandedPathSet.has(e)||(this.createdDirectoriesAllExpanded=!1))}createFileChild(e,t,n){let r=_z(this.segmentTable,t),i=this.getDirectoryIndex(e),a=i.childIdByNameId;if(a!=null&&a.get(r)!==void 0)throw Error(`Path collides with an existing entry: "${n}"`);let o=this.nodes[e];if(o===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let s=this.nodes.length;return this.nodes.push({depthAndFlags:BR(VR(o)+1,0),nameId:r,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),a?.set(r,s),OR(i,s),s}createFileChildUnchecked(e,t){let n=_z(this.segmentTable,t),r=this.getDirectoryIndex(e),i=this.nodes[e];if(i===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let a=this.nodes.length;return this.nodes.push({depthAndFlags:BR(VR(i)+1,0),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),OR(r,a),a}getOrCreateDirectoryChild(e,t){let n=_z(this.segmentTable,t),r=this.getDirectoryIndex(e);if(r.childIdByNameId!=null){let e=r.childIdByNameId.get(n);if(e!==void 0){let n=this.nodes[e];if(n!=null&&!UR(n))throw Error(`Path collides with an existing file while creating directory "${t}"`);return e}}let i=this.nodes[e];if(i===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let a=this.nodes.length;return this.nodes.push({depthAndFlags:BR(VR(i)+1,0,1),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),OR(r,a),this.directories.set(a,wR()),a}createDirectoryChild(e,t){let n=_z(this.segmentTable,t),r=this.getDirectoryIndex(e),i=this.nodes[e];if(i===void 0)throw Error(`Unknown parent node ID: ${String(e)}`);let a=this.nodes.length;return this.nodes.push({depthAndFlags:BR(VR(i)+1,0,1),nameId:n,parentId:e,subtreeNodeCount:1,visibleSubtreeCount:1}),r.childIdByNameId!=null&&r.childIdByNameId.set(n,a),OR(r,a),this.directories.set(a,wR()),a}promoteDirectoryToExplicit(e,t){let n=this.nodes[e];if(n===void 0)throw Error(`Unknown directory node ID: ${String(e)}`);if(!UR(n))throw Error(`Path is not a directory: "${t}"`);if(GR(n,1))throw Error(`Duplicate path: "${t}"`);KR(n,1)}getDirectoryIndex(e){let t=this.directories.get(e);if(t!==void 0)return t;throw Error(`Unknown directory child index for node ${String(e)}`)}buildPresortedFinish(e){let t=this.nodes,n=this.directories;n.set(0,TR());let r=-1,i=null;for(let e=1;e<t.length;e++){let a=t[e];if(a==null)continue;if(UR(a)){let t=TR();n.set(e,t),r=e,i=t}let o;a.parentId===r?o=i:(o=n.get(a.parentId),r=a.parentId,i=o??null),o?.childIds.push(e)}if(!e)for(let e=t.length-1;e>=1;e--){let n=t[e];if(n==null)continue;let r=t[n.parentId];r!=null&&(r.subtreeNodeCount+=n.subtreeNodeCount,r.visibleSubtreeCount+=n.visibleSubtreeCount)}}buildDirectoryIndexes(){let e=this.nodes;for(let t=1;t<e.length;t++){let n=e[t];if(n==null)continue;UR(n)&&this.directories.set(t,wR());let r=this.directories.get(n.parentId);r!=null&&(r.childIdByNameId!=null&&r.childIdByNameId.set(n.nameId,t),OR(r,t))}}computeSubtreeCounts(e){let t=this.nodes[e];if(t===void 0)throw Error(`Unknown node ID: ${String(e)}`);if(!UR(t))return t.subtreeNodeCount=1,t.visibleSubtreeCount=1,1;let n=this.getDirectoryIndex(e),r=1;for(let e of n.childIds)r+=this.computeSubtreeCounts(e);return AR(this.nodes,n),t.subtreeNodeCount=r,t.visibleSubtreeCount=r,r}};function Iz(e,t=`closed`,n=null){let r=Rz(t);return{activeNodeCount:e.nodes.length-1,collapsedDirectoryIds:new Set,collapseNewDirectoriesByDefault:!1,defaultExpansion:r,directoriesOpenByDefault:r===`open`,hasCollapsedDirectoryOverrides:!1,directoryLoadInfoById:new Map,expandedDirectoryIds:new Set,instrumentation:n,listeners:new Map,pathCacheByNodeId:new Map([[e.rootId,{path:``,version:0}]]),pathCacheVersion:0,snapshot:e,transactionStack:[]}}function Lz(){return{affectedAncestorIds:new Set,affectedNodeIds:new Set,events:[]}}function Rz(e){if(typeof e!=`number`)return e;if(!Number.isInteger(e)||e<0)throw Error(`initialExpansion must be "open", "closed", or a non-negative integer depth. Received: ${String(e)}`);return e}function zz(e,t){return GR(t,2)||e.defaultExpansion===`open`?!0:e.defaultExpansion===`closed`?!1:VR(t)<=e.defaultExpansion}function Bz(e,t,n=e.snapshot.nodes[t]){return n==null||!UR(n)?!1:e.directoriesOpenByDefault&&!e.hasCollapsedDirectoryOverrides?!0:e.collapsedDirectoryIds.has(t)?!1:e.expandedDirectoryIds.has(t)?!0:zz(e,n)}function Vz(e,t,n,r=e.snapshot.nodes[t]){if(r==null||!UR(r))return;let i=zz(e,r);if(n){if(i){e.collapsedDirectoryIds.delete(t),e.hasCollapsedDirectoryOverrides=e.collapsedDirectoryIds.size>0;return}e.expandedDirectoryIds.add(t);return}if(i){e.collapsedDirectoryIds.add(t),e.hasCollapsedDirectoryOverrides=!0;return}e.expandedDirectoryIds.delete(t)}function Hz(e,t){let n=e.directoryLoadInfoById.get(t);if(n!=null)return n;let r={activeAttemptId:null,errorMessage:null,nextAttemptId:1,state:`loaded`};return e.directoryLoadInfoById.set(t,r),r}function Uz(e,t){return e.directoryLoadInfoById.get(t)?.state??`loaded`}function Wz(e,t){let n=Hz(e,t);if(n.state===`loading`&&n.activeAttemptId!=null)return{attemptId:n.activeAttemptId,nodeId:t,reused:!0};let r=n.nextAttemptId;return n.activeAttemptId=r,n.errorMessage=null,n.nextAttemptId+=1,n.state=`loading`,{attemptId:r,nodeId:t,reused:!1}}function Gz(e,t){let n=Hz(e,t);n.activeAttemptId=null,n.errorMessage=null,n.state=`unloaded`}function Kz(e,t,n){let r=e.directoryLoadInfoById.get(t);return r==null||r.activeAttemptId!==n?!1:(r.activeAttemptId=null,r.errorMessage=null,r.state=`loaded`,!0)}function qz(e,t,n){return e.directoryLoadInfoById.get(t)?.activeAttemptId===n}function Jz(e,t,n,r){let i=e.directoryLoadInfoById.get(t);return i==null||i.activeAttemptId!==n?!1:(i.activeAttemptId=null,i.errorMessage=r??null,i.state=`error`,!0)}function Yz(e,t){e.directoryLoadInfoById.delete(t)}function Xz(e,t,n){let r=n,i=e.listeners.get(t);return i==null?e.listeners.set(t,new Set([r])):i.add(r),()=>{let n=e.listeners.get(t);n!=null&&(n.delete(r),n.size===0&&e.listeners.delete(t))}}function Zz(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,operation:`add`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function Qz(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,operation:`remove`,path:e.path,projectionChanged:e.projectionChanged,recursive:e.recursive,visibleCountDelta:null}}function $z(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!0,from:e.from,operation:`move`,projectionChanged:e.projectionChanged,to:e.to,visibleCountDelta:null}}function eB(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`expand`,path:e.path,projectionChanged:!0,visibleCountDelta:null}}function tB(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`collapse`,path:e.path,projectionChanged:!0,visibleCountDelta:null}}function nB(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],canonicalChanged:!1,operation:`mark-directory-unloaded`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function rB(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:!1,operation:`begin-child-load`,path:e.path,projectionChanged:e.projectionChanged,reused:e.reused,visibleCountDelta:null}}function iB(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:e.childEvents.some(e=>e.canonicalChanged),childEvents:e.childEvents,operation:`apply-child-patch`,path:e.path,projectionChanged:e.projectionChanged,visibleCountDelta:null}}function aB(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:!1,operation:`complete-child-load`,path:e.path,projectionChanged:e.projectionChanged,stale:e.stale,visibleCountDelta:null}}function oB(e){return{affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],attemptId:e.attemptId,canonicalChanged:!1,errorMessage:e.errorMessage,operation:`fail-child-load`,path:e.path,projectionChanged:e.projectionChanged,stale:e.stale,visibleCountDelta:null}}function sB(e){return{activeNodeCountAfter:e.activeNodeCountAfter,activeNodeCountBefore:e.activeNodeCountBefore,affectedAncestorIds:e.affectedAncestorIds??[],affectedNodeIds:e.affectedNodeIds??[],cachedPathEntryCountAfter:e.cachedPathEntryCountAfter,cachedPathEntryCountBefore:e.cachedPathEntryCountBefore,canonicalChanged:!1,idsPreserved:e.idsPreserved,loadInfoEntryCountAfter:e.loadInfoEntryCountAfter,loadInfoEntryCountBefore:e.loadInfoEntryCountBefore,mode:e.mode,operation:`cleanup`,projectionChanged:e.projectionChanged,reclaimedCachedPathEntryCount:e.reclaimedCachedPathEntryCount,reclaimedLoadInfoEntryCount:e.reclaimedLoadInfoEntryCount,reclaimedNodeSlotCount:e.reclaimedNodeSlotCount,reclaimedSegmentCount:e.reclaimedSegmentCount,segmentCountAfter:e.segmentCountAfter,segmentCountBefore:e.segmentCountBefore,totalNodeSlotCountAfter:e.totalNodeSlotCountAfter,totalNodeSlotCountBefore:e.totalNodeSlotCountBefore,visibleCountDelta:null}}function cB(e,t,n){return{...n,visibleCountDelta:yB(e)-t}}function lB(e,t){let n=yB(e),r=Lz();e.transactionStack.push(r);try{t()}catch(t){throw fB(e,r,!1),t}fB(e,r,!0,yB(e)-n)}function uB(e,t){let n=e.instrumentation;if(n==null){dB(e,t);return}ZR(n,`store.events.record`,()=>dB(e,t))}function dB(e,t){let n=e.transactionStack[e.transactionStack.length-1]??null;if(n==null){_B(e,t);return}n.events.push(t),gB(n,t)}function fB(e,t,n,r=null){if(e.transactionStack.pop()!==t)throw Error(`Transaction stack underflow`);if(!n)return;let i=e.transactionStack[e.transactionStack.length-1]??null;if(i!=null){let n=e.instrumentation;n==null?hB(i,t):ZR(n,`store.events.batch.merge`,()=>hB(i,t));return}let a=pB(t,r),o=e.instrumentation;if(o==null){_B(e,a);return}ZR(o,`store.events.batch.commit`,()=>_B(e,a))}function pB(e,t){return{affectedAncestorIds:[...e.affectedAncestorIds],affectedNodeIds:[...e.affectedNodeIds],canonicalChanged:e.events.some(e=>e.canonicalChanged),events:[...e.events],operation:`batch`,projectionChanged:e.events.some(e=>e.projectionChanged),visibleCountDelta:t}}function mB(e,t){for(let n of t.affectedAncestorIds)e.affectedAncestorIds.add(n);for(let n of t.affectedNodeIds)e.affectedNodeIds.add(n)}function hB(e,t){for(let n of t.events)e.events.push(n);mB(e,t)}function gB(e,t){for(let n of t.affectedNodeIds)e.affectedNodeIds.add(n);for(let n of t.affectedAncestorIds)e.affectedAncestorIds.add(n)}function _B(e,t){let n=e.instrumentation;if(n==null){vB(e,t);return}ZR(n,`store.events.emit`,()=>vB(e,t))}function vB(e,t){e.listeners.get(t.operation)?.forEach(e=>e(t)),e.listeners.get(`*`)?.forEach(e=>e(t))}function yB(e){return e.snapshot.nodes[e.snapshot.rootId]?.visibleSubtreeCount??0}function bB(e,t){if(e.snapshot.options.flattenEmptyDirectories!==!0)return null;let n=e.snapshot.nodes[t];if(n==null||!UR(n)||GR(n,2))return null;let r=e.snapshot.directories.get(t);if(r==null||r.childIds.length!==1)return null;let i=r.childIds[0];if(i==null)return null;let a=e.snapshot.nodes[i];return a==null||!UR(a)?null:i}function xB(e,t){let n=t;for(;;){let t=bB(e,n);if(t==null)return n;n=t}}function SB(e,t){let n=[t],r=t;for(;;){let t=bB(e,r);if(t==null)return n;n.push(t),r=t}}function CB(e,t){let n=t==null?e.snapshot.rootId:NB(e,t);return n==null?[]:LB(e,n)}function wB(e,t){let n=pz(t),r=n.isDirectory?n.segments:n.segments.slice(0,-1),i=QB(e,ZB(e,r)),{createdNodeIds:a,directoryId:o}=RB(e,r),s=new Set(a),c=o;if(n.isDirectory){let n=IB(e,o);if(GR(n,1))throw Error(`Path already exists: "${t}"`);KR(n,1),e.pathCacheByNodeId.set(o,{path:t,version:e.pathCacheVersion}),s.add(o)}else c=BB(e,o,n.basename),s.add(c);AB(e,o);let l=QB(e,o);return Zz({affectedAncestorIds:MB(e,c),affectedNodeIds:[...s],path:t,projectionChanged:$B(i,l)})}function TB(e,t,n){let r=NB(e,t);if(r==null)throw Error(`Path does not exist: "${t}"`);let i=IB(e,r);if(GR(i,2))throw Error(`The root node cannot be removed`);if(UR(i)&&FB(e,r).childIds.length>0&&n.recursive!==!0)throw Error(`Cannot remove a non-empty directory without recursive: "${t}"`);let a=i.parentId,o=QB(e,a),s=YB(e,r);UB(e,a,r,i.nameId),XB(e,a),AB(e,a);let c=QB(e,a);return Qz({affectedAncestorIds:MB(e,a),affectedNodeIds:s,path:t,projectionChanged:$B(o,c),recursive:n.recursive===!0})}function EB(e,t,n,r){let i=NB(e,t);if(i==null)throw Error(`Source path does not exist: "${t}"`);let a=IB(e,i);if(GR(a,2))throw Error(`The root node cannot be moved`);let o=r.collision??`error`,s=qB(e,i,n),c=QB(e,a.parentId),l=QB(e,s.parentId),u=vz(e.snapshot.segmentTable,a.nameId),d=_z(e.snapshot.segmentTable,s.basename);if(s.parentId===a.parentId&&u===s.basename)return null;if(UR(a)&&rV(e,i,s.parentId))throw Error(`Cannot move a directory into one of its descendants`);let f=ER(e.snapshot.nodes,FB(e,s.parentId)).get(d),p=s.existingNodeId??f??null;if(p!=null&&p!==i&&JB(e,p,o,HR(a))===`skip`)return null;let m=a.parentId;UB(e,m,i,a.nameId),a.parentId=s.parentId,a.nameId=d,e.pathCacheByNodeId.delete(i),nV(e,i),HB(e,s.parentId,i),XB(e,m),e.pathCacheVersion++,AB(e,m),s.parentId!==m&&AB(e,s.parentId);let h=QB(e,m),g=QB(e,s.parentId);return $z({affectedAncestorIds:[...new Set([...MB(e,m),...MB(e,s.parentId)])],affectedNodeIds:[i],from:t,projectionChanged:eV([c,l],[h,g]),to:kB(e,i)})}function DB(e,t){let n=e.pathCacheByNodeId.get(t);return n!=null&&n.version===e.pathCacheVersion?n.path:null}function OB(e,t,n){return e.pathCacheByNodeId.set(t,{path:n,version:e.pathCacheVersion}),n}function kB(e,t){let n=IB(e,t),r=DB(e,t);if(r!=null)return r;if(GR(n,2))return OB(e,t,``);let i=kB(e,n.parentId),a=vz(e.snapshot.segmentTable,n.nameId),o=i.length===0?a:`${i}${a}`;return OB(e,t,UR(n)?`${o}/`:o)}function AB(e,t){let n=e.instrumentation;if(n==null){aV(e,t);return}ZR(n,`store.recomputeCountsUpwardFrom`,()=>aV(e,t))}function jB(e,t){let n=[[t,0]],{nodes:r,directories:i}=e.snapshot;for(;n.length>0;){let t=n[n.length-1],a=t[0],o=r[a];if(o==null||!UR(o)){iV(e,a,o,!0),n.pop();continue}let s=i.get(a);if(s==null||t[1]>=s.childIds.length){iV(e,a,o,!0),n.pop();continue}let c=s.childIds[t[1]++];n.push([c,0])}}function MB(e,t){let n=[],r=t;for(;r!=null;){let t=IB(e,r);if(n.push(r),r===e.snapshot.rootId)break;r=t.parentId}return n}function NB(e,t){if(t.length===0)return e.snapshot.rootId;let n=mz(t);return PB(e,n.segments,n.requiresDirectory)}function PB(e,t,n){let r=e.snapshot.rootId;for(let n of t){let t=e.snapshot.segmentTable.idByValue.get(n);if(t===void 0)return null;let i=FB(e,r),a=ER(e.snapshot.nodes,i).get(t);if(a===void 0)return null;r=a}let i=IB(e,r);return n&&!UR(i)?null:r}function FB(e,t){let n=e.snapshot.directories.get(t);if(n===void 0)throw Error(`Unknown directory child index for node ${String(t)}`);return n}function IB(e,t){let n=e.snapshot.nodes[t];if(n===void 0||GR(n,4))throw Error(`Unknown node ID: ${String(t)}`);return n}function LB(e,t){let n=e.snapshot.nodes[t];if(n===void 0||GR(n,4))return[];if(!UR(n))return[kB(e,t)];if(FB(e,t).childIds.length===0)return GR(n,1)&&!GR(n,2)?[kB(e,t)]:[];let r=[],i=[{childIndex:0,nodeId:t}];for(;i.length>0;){let t=i[i.length-1];if(t==null)break;let n=e.snapshot.nodes[t.nodeId];if(n===void 0||GR(n,4)){i.pop();continue}if(!UR(n)){r.push(kB(e,t.nodeId)),i.pop();continue}let a=FB(e,t.nodeId);if(a.childIds.length===0){GR(n,1)&&!GR(n,2)&&r.push(kB(e,t.nodeId)),i.pop();continue}let o=a.childIds[t.childIndex];if(o==null){i.pop();continue}t.childIndex++,i.push({childIndex:0,nodeId:o})}return r}function RB(e,t){let n=[],r=e.snapshot.rootId;for(let i of t){let t=_z(e.snapshot.segmentTable,i),a=FB(e,r),o=ER(e.snapshot.nodes,a).get(t);if(o!==void 0){if(!UR(IB(e,o)))throw Error(`Cannot create a directory that collides with an existing file: "${i}"`);r=o;continue}r=zB(e,r,t),n.push(r)}return{createdNodeIds:n,directoryId:r}}function zB(e,t,n){let r=IB(e,t),i=e.snapshot.nodes.length;return e.snapshot.nodes.push({depthAndFlags:BR(VR(r)+1,0,1),nameId:n,parentId:t,subtreeNodeCount:1,visibleSubtreeCount:1}),e.snapshot.directories.set(i,wR()),HB(e,t,i),e.collapseNewDirectoriesByDefault&&(e.collapsedDirectoryIds.add(i),e.hasCollapsedDirectoryOverrides=!0),e.activeNodeCount++,i}function BB(e,t,n){let r=_z(e.snapshot.segmentTable,n),i=FB(e,t);if(ER(e.snapshot.nodes,i).has(r))throw Error(`Path already exists: "${sV(e,t,n)}"`);let a=IB(e,t),o=e.snapshot.nodes.length;return e.snapshot.nodes.push({depthAndFlags:BR(VR(a)+1,0),nameId:r,parentId:t,subtreeNodeCount:1,visibleSubtreeCount:1}),HB(e,t,o),e.activeNodeCount++,o}function VB(e,t,n){let r=0,i=t.childIds.length;for(;r<i;){let a=r+i>>>1,o=t.childIds[a];if(o==null){i=a;continue}WB(e,n,o)<0?i=a:r=a+1}return r}function HB(e,t,n){let r=FB(e,t),i=IB(e,n);ER(e.snapshot.nodes,r).set(i.nameId,n),jR(r,n,i.subtreeNodeCount,i.visibleSubtreeCount);let a=VB(e,r,n);r.childIds.splice(a,0,n),kR(r,a),PR(e.snapshot.nodes,r)}function UB(e,t,n,r){let i=FB(e,t),a=DR(i),o=a.get(n)??-1;ER(e.snapshot.nodes,i).delete(r),a.delete(n);let s=e.snapshot.nodes[n];s!=null&&jR(i,n,-s.subtreeNodeCount,-s.visibleSubtreeCount),o>=0&&(i.childIds.splice(o,1),kR(i,o),PR(e.snapshot.nodes,i))}function WB(e,t,n){let r=e.snapshot.options.sort;return r===`default`?GB(e,t,n):r(KB(e,t),KB(e,n))}function GB(e,t,n){let r=IB(e,t),i=IB(e,n),a=UR(r);if(a!==UR(i))return a?-1:1;let o=rz(uz(e.snapshot.segmentTable,r.nameId),uz(e.snapshot.segmentTable,i.nameId));if(o!==0)return o;let s=vz(e.snapshot.segmentTable,r.nameId),c=vz(e.snapshot.segmentTable,i.nameId);return s===c?t<n?-1:1:s<c?-1:1}function KB(e,t){let n=IB(e,t),r=kB(e,t),i=UR(n),a=i?r.slice(0,-1):r;return{basename:vz(e.snapshot.segmentTable,n.nameId),depth:VR(n),isDirectory:i,path:r,segments:a.length===0?[]:a.split(`/`)}}function qB(e,t,n){let r=IB(e,t),i=NB(e,n);if(i!=null){let t=IB(e,i);if(UR(t))return{basename:vz(e.snapshot.segmentTable,r.nameId),existingNodeId:null,parentId:i};let a=mz(n).segments;return{basename:a[a.length-1]??``,existingNodeId:i,parentId:t.parentId}}let a=mz(n),o=a.segments[a.segments.length-1]??``,s=a.segments.slice(0,-1),c=s.length===0?e.snapshot.rootId:PB(e,s,!0);if(c==null)throw Error(`Destination parent does not exist: "${n}"`);return{basename:o,existingNodeId:null,parentId:c}}function JB(e,t,n,r){if(n===`skip`)return`skip`;if(n===`error`)throw Error(`Destination already exists: "${kB(e,t)}"`);let i=IB(e,t);if(HR(i)!==r)throw Error(`replace collision requires the same source and destination kinds`);if(UR(i)&&FB(e,t).childIds.length>0)throw Error(`replace collision does not support non-empty directories`);let a=i.parentId,o=i.nameId;return YB(e,t),UB(e,a,t,o),XB(e,a),AB(e,a),`handled`}function YB(e,t){let n=[],r=[{nodeId:t,visitedChildren:!1}];for(;r.length>0;){let t=r.pop();if(t==null)break;let i=IB(e,t.nodeId);if(t.visitedChildren||!UR(i)){UR(i)&&e.snapshot.directories.delete(t.nodeId),KR(i,4),e.pathCacheByNodeId.delete(t.nodeId),e.collapsedDirectoryIds.delete(t.nodeId)&&(e.hasCollapsedDirectoryOverrides=e.collapsedDirectoryIds.size>0),e.expandedDirectoryIds.delete(t.nodeId),Yz(e,t.nodeId),e.activeNodeCount--,n.push(t.nodeId);continue}r.push({nodeId:t.nodeId,visitedChildren:!0});let a=FB(e,t.nodeId);for(let e=a.childIds.length-1;e>=0;e--){let t=a.childIds[e];t!=null&&r.push({nodeId:t,visitedChildren:!1})}}return n}function XB(e,t){let n=t;for(;n!=null;){let t=IB(e,n);if(!UR(t)||GR(t,2)||FB(e,n).childIds.length>0)return;KR(t,1),n=t.parentId===n?null:t.parentId}}function ZB(e,t){let n=e.snapshot.rootId;for(let r of t){let t=e.snapshot.segmentTable.idByValue.get(r);if(t==null)break;let i=ER(e.snapshot.nodes,FB(e,n)).get(t);if(i==null||!UR(IB(e,i)))break;n=i}return n}function QB(e,t){let n=tV(e,t);if(n==null)return null;let r=xB(e,n),i=IB(e,r),a=n===r?null:SB(e,n).map(t=>kB(e,t));return JSON.stringify({flattenedSegmentPaths:a,hasChildren:FB(e,r).childIds.length>0,path:kB(e,r),terminalKind:HR(i)})}function $B(e,t){return eV([e],[t])}function eV(e,t){for(let n=0;n<e.length;n+=1){let r=e[n],i=t[n];if(r==null||i==null||r!==i)return!0}return!1}function tV(e,t){let n=t;for(;n!=null;){let t=IB(e,n);if(!UR(t)||GR(t,2))return null;if(!Bz(e,n,t))return n;n=t.parentId}return null}function nV(e,t){let n=IB(e,t);if(qR(n,(t===e.snapshot.rootId?-1:VR(IB(e,n.parentId)))+1),!UR(n))return;let r=FB(e,t);for(let t of r.childIds)nV(e,t)}function rV(e,t,n){let r=n;for(;r!=null;){if(r===t)return!0;let n=IB(e,r);if(r===e.snapshot.rootId)return!1;r=n.parentId}return!1}function iV(e,t,n=IB(e,t),r=!1){let i=e.instrumentation;if(i==null){oV(e,t,n,r);return}ZR(i,`store.recomputeNodeCounts`,()=>oV(e,t,n,r))}function aV(e,t){let n=t;for(;n!=null;){let t=IB(e,n),r=t.subtreeNodeCount,i=t.visibleSubtreeCount;if(iV(e,n,t),n===e.snapshot.rootId)return;let a=t.subtreeNodeCount-r,o=t.visibleSubtreeCount-i,s=t.parentId;(a!==0||o!==0)&&jR(FB(e,s),n,a,o),n=s}}function oV(e,t,n,r){if(!UR(n)){n.subtreeNodeCount=1,n.visibleSubtreeCount=1;return}let i=FB(e,t);if(r){let t=e.instrumentation;t==null?AR(e.snapshot.nodes,i):ZR(t,`store.recomputeNodeCounts.rebuildChildAggregates`,()=>AR(e.snapshot.nodes,i))}let a=1+i.totalChildSubtreeNodeCount,o=i.totalChildVisibleSubtreeCount;if(n.subtreeNodeCount=a,GR(n,2)){n.visibleSubtreeCount=o;return}n.visibleSubtreeCount=bB(e,t)==null?Bz(e,t,n)?1+o:1:o}function sV(e,t,n){let r=kB(e,t);return r.length===0?n:`${r}${n}`}function cV(e){return e!=null&&!GR(e,4)}function lV(e,t){let n=e.snapshot.nodes[t];return!cV(n)||!UR(n)||GR(n,2)?null:n}function uV(e){let t=0;for(let[n,r]of e.pathCacheByNodeId)r.version===e.pathCacheVersion&&cV(e.snapshot.nodes[n])&&(t+=1);return t}function dV(e){return Math.max(0,e.valueById.length-1)}function fV(e){return{activeNodeCount:e.activeNodeCount,cachedPathEntryCount:uV(e),loadInfoEntryCount:e.directoryLoadInfoById.size,segmentCount:dV(e.snapshot.segmentTable),totalNodeSlotCount:Math.max(0,e.snapshot.nodes.length-1)}}function pV(e,t,n,r){return{activeNodeCountAfter:r.activeNodeCount,activeNodeCountBefore:n.activeNodeCount,cachedPathEntryCountAfter:r.cachedPathEntryCount,cachedPathEntryCountBefore:n.cachedPathEntryCount,idsPreserved:t,loadInfoEntryCountAfter:r.loadInfoEntryCount,loadInfoEntryCountBefore:n.loadInfoEntryCount,mode:e,reclaimedCachedPathEntryCount:n.cachedPathEntryCount-r.cachedPathEntryCount,reclaimedLoadInfoEntryCount:n.loadInfoEntryCount-r.loadInfoEntryCount,reclaimedNodeSlotCount:n.totalNodeSlotCount-r.totalNodeSlotCount,reclaimedSegmentCount:n.segmentCount-r.segmentCount,segmentCountAfter:r.segmentCount,segmentCountBefore:n.segmentCount,totalNodeSlotCountAfter:r.totalNodeSlotCount,totalNodeSlotCountBefore:n.totalNodeSlotCount}}function mV(e){let t=[],n=[];for(let n of e.collapsedDirectoryIds)lV(e,n)!=null&&t.push(kB(e,n));for(let t of e.expandedDirectoryIds)lV(e,t)!=null&&n.push(kB(e,t));return{collapsedPaths:t,expandedPaths:n}}function hV(e){let t=[];for(let[n,r]of e.directoryLoadInfoById)lV(e,n)==null||Uz(e,n)===`loaded`||t.push({info:{activeAttemptId:null,errorMessage:r.errorMessage,nextAttemptId:r.nextAttemptId,state:r.state},path:kB(e,n)});return t}function gV(e,t){e.collapsedDirectoryIds.clear(),e.hasCollapsedDirectoryOverrides=!1,e.expandedDirectoryIds.clear();for(let n of t.expandedPaths){let t=NB(e,n);t!=null&&Vz(e,t,!0,IB(e,t))}for(let n of t.collapsedPaths){let t=NB(e,n);t!=null&&Vz(e,t,!1,IB(e,t))}}function _V(e,t){e.directoryLoadInfoById.clear();for(let n of t){let t=NB(e,n.path);t!=null&&lV(e,t)!=null&&e.directoryLoadInfoById.set(t,{activeAttemptId:null,errorMessage:n.info.errorMessage,nextAttemptId:n.info.nextAttemptId,state:n.info.state})}}function vV(e){e.pathCacheVersion+=1,e.pathCacheByNodeId.clear(),e.pathCacheByNodeId.set(e.snapshot.rootId,{path:``,version:e.pathCacheVersion})}function yV(e){let t=e.snapshot.segmentTable,n=gz();for(let r of e.snapshot.nodes)if(cV(r)){if(GR(r,2)){r.nameId=0;continue}r.nameId=_z(n,vz(t,r.nameId))}e.snapshot.segmentTable=n}function bV(e){for(let[t,n]of e.snapshot.directories){let r=e.snapshot.nodes[t];if(!cV(r)||!UR(r)){e.snapshot.directories.delete(t);continue}let i=n.childIds.filter(n=>{let r=e.snapshot.nodes[n];return cV(r)&&r.parentId===t});n.childIds=i,n.childIdByNameId=new Map(i.map(t=>[IB(e,t).nameId,t])),n.childPositionById=new Map(i.map((e,t)=>[e,t])),AR(e.snapshot.nodes,n)}}function xV(e){let t=e.snapshot.nodes.length-1;for(;t>e.snapshot.rootId;){let n=e.snapshot.nodes[t];if(cV(n))break;--t}e.snapshot.nodes.length=t+1}function SV(e){let t=mV(e),n=hV(e);ZR(e.instrumentation,`store.cleanup.stable.clearPathCaches`,()=>vV(e)),ZR(e.instrumentation,`store.cleanup.stable.rebuildSegmentTable`,()=>yV(e)),ZR(e.instrumentation,`store.cleanup.stable.rebuildDirectoryIndexes`,()=>bV(e)),ZR(e.instrumentation,`store.cleanup.stable.trimTrailingRemovedNodeSlots`,()=>xV(e)),ZR(e.instrumentation,`store.cleanup.stable.restoreExpansionOverrides`,()=>gV(e,t)),ZR(e.instrumentation,`store.cleanup.stable.restoreDirectoryLoadInfos`,()=>_V(e,n)),ZR(e.instrumentation,`store.cleanup.stable.recomputeCounts`,()=>jB(e,e.snapshot.rootId))}function CV(e){let t=mV(e),n=hV(e),r=ZR(e.instrumentation,`store.cleanup.aggressive.listPaths`,()=>CB(e)),i=YR({...e.snapshot.options},e.instrumentation),a=ZR(e.instrumentation,`store.cleanup.aggressive.rebuildSnapshot`,()=>{let e=new Fz(i);return e.appendPaths(r),e.finish()});e.snapshot=a,e.activeNodeCount=a.nodes.length-1,e.pathCacheByNodeId=new Map([[a.rootId,{path:``,version:0}]]),e.pathCacheVersion=0,ZR(e.instrumentation,`store.cleanup.aggressive.restoreExpansionOverrides`,()=>gV(e,t)),ZR(e.instrumentation,`store.cleanup.aggressive.restoreDirectoryLoadInfos`,()=>_V(e,n)),ZR(e.instrumentation,`store.cleanup.aggressive.recomputeCounts`,()=>jB(e,e.snapshot.rootId))}function wV(e){for(let t of e.directoryLoadInfoById.values())if(t.state===`loading`&&t.activeAttemptId!=null)return!0;return!1}function TV(e,t){let n=fV(e);t===`stable`?ZR(e.instrumentation,`store.cleanup.stable`,()=>SV(e)):ZR(e.instrumentation,`store.cleanup.aggressive`,()=>CV(e));let r=fV(e);return pV(t,t===`stable`,n,r)}var EV=64;function DV(e,t){let n=t+2;if(n<=e.length)return e;let r=e.length;for(;r<n;)r*=2;let i=new Int32Array(r);return i.fill(-1),i.set(e),i}function OV(e){return IB(e,e.snapshot.rootId).visibleSubtreeCount}function kV(e,t,n,r){let i=IB(e,t.terminalNodeId),a=Math.max(1,i.visibleSubtreeCount);return Math.min(r-1,n+a-1)}function AV(e,t,n,r){return{ancestorPaths:r,index:t.index,posInSet:t.posInSet,row:YV(e,t.cursor),setSize:t.setSize,subtreeEndIndex:kV(e,t.cursor,t.index,n)}}function jV(e,t,n,r,i,a){let o=FB(e,t),{childIndex:s,childVisibleIndex:c,localVisibleIndex:l}=MR(e.snapshot.nodes,o,n),u=o.childIds[s];if(u==null)throw Error(`Visible index ${String(n)} is out of range`);return MV(e,u,l,r+c,i+1,s,o.childIds.length,a)}function MV(e,t,n,r,i,a,o,s){if(!UR(IB(e,t))){if(n===0)return{ancestors:s,cursor:{headNodeId:t,terminalNodeId:t,visibleDepth:i},index:r,posInSet:a,setSize:o};throw Error(`Visible index ${String(n)} is out of range for file`)}let c=UV(e,t,i);if(n===0)return{ancestors:s,cursor:c,index:r,posInSet:a,setSize:o};let l=IB(e,c.terminalNodeId);if(!UR(l)||!Bz(e,c.terminalNodeId,l))throw Error(`Visible index ${String(n)} is out of range for collapsed directory`);return jV(e,c.terminalNodeId,n-1,r+1,c.visibleDepth,[...s,{cursor:c,index:r,posInSet:a,setSize:o}])}function NV(e,t){let n=OV(e);if(t<0||t>=n)return null;let r=jV(e,e.snapshot.rootId,t,0,-1,[]),i=r.ancestors.map(t=>kB(e,t.cursor.terminalNodeId)),a=null;return{ancestorPaths:i,get ancestorRows(){if(a!=null)return a;let t=[],i=[];for(let a of r.ancestors){let r=AV(e,a,n,[...i]);t.push(r),i.push(r.row.path)}return a=t,a},index:r.index,posInSet:r.posInSet,row:YV(e,r.cursor),setSize:r.setSize,subtreeEndIndex:kV(e,r.cursor,r.index,n)}}function PV(e,t,n){let r=e.instrumentation,i=OV(e);if(i<=0||n<t)return[];let a=Math.max(0,Math.min(t,i-1)),o=Math.max(a,Math.min(n,i-1));if(r==null){if(a===0)return JV(e,o+1);let t=[],n=BV(e,a);for(let r=a;r<=o&&n!=null;r++){let r=YV(e,n);t.push(r),n=GV(e,n)}return t}let s=[],c=0,l=0,u=ZR(r,`store.getVisibleSlice.selectFirstRow`,()=>BV(e,a));for(let t=a;t<=o&&u!=null;t++){let t=ZR(r,`store.getVisibleSlice.materializeRow`,()=>YV(e,u));s.push(t),t.isFlattened&&(c++,l+=t.flattenedSegments?.length??0),u=ZR(r,`store.getVisibleSlice.advanceCursor`,()=>GV(e,u))}return QR(r,`workload.visibleRowsRead`,s.length),QR(r,`workload.flattenedRowsRead`,c),QR(r,`workload.flattenedSegmentsRead`,l),s}function FV(e,t=OV(e)){let n=e.instrumentation;return n==null?qV(e,t):ZR(n,`store.getVisibleTreeProjection`,()=>qV(e,t))}function IV(e){return KV(FV(e))}function LV(e,t){let n=NB(e,t);if(n==null||n===e.snapshot.rootId||UR(IB(e,n))&&xB(e,n)!==n)return null;let r=0,i=n,{nodes:a,rootId:o}=e.snapshot;for(;i!==o;){let t=IB(e,i).parentId,n=FB(e,t),s=DR(n).get(i);if(s==null)throw Error(`Child ${String(i)} was not found in its parent index`);if(r+=NR(a,n,s),t!==o){let n=IB(e,t),a=bB(e,t);if(!Bz(e,t,n)&&a!==i)return null;xB(e,t)===t&&(r+=1)}i=t}return r}function RV(e,t){let n=NB(e,t);if(n==null)throw Error(`Path does not exist: "${t}"`);let r=IB(e,n);if(!UR(r))throw Error(`Path is not a directory: "${t}"`);return Bz(e,n,r)?null:(Vz(e,n,!0,r),AB(e,n),eB({affectedAncestorIds:MB(e,n),affectedNodeIds:[n],path:t,projectionChanged:!0}))}function zV(e,t){let n=NB(e,t);if(n==null)throw Error(`Path does not exist: "${t}"`);let r=IB(e,n);if(!UR(r))throw Error(`Path is not a directory: "${t}"`);return Bz(e,n,r)?(Vz(e,n,!1,r),AB(e,n),tB({affectedAncestorIds:MB(e,n),affectedNodeIds:[n],path:t,projectionChanged:!0})):null}function BV(e,t){return t<0||t>=OV(e)?null:VV(e,e.snapshot.rootId,t,-1)}function VV(e,t,n,r){let i=FB(e,t),a=e.instrumentation,{childIndex:o,localVisibleIndex:s}=a==null?MR(e.snapshot.nodes,i,n):ZR(a,`store.getVisibleSlice.selectChildIndex`,()=>MR(e.snapshot.nodes,i,n)),c=i.childIds[o];if(c!=null)return HV(e,c,s,r+1);throw Error(`Visible index ${String(n)} is out of range`)}function HV(e,t,n,r){if(!UR(IB(e,t))){if(n===0)return{headNodeId:t,terminalNodeId:t,visibleDepth:r};throw Error(`Visible index ${String(n)} is out of range for file`)}let i=UV(e,t,r);if(n===0)return i;let a=IB(e,i.terminalNodeId);if(!UR(a)||!Bz(e,i.terminalNodeId,a))throw Error(`Visible index ${String(n)} is out of range for collapsed directory`);return VV(e,i.terminalNodeId,n-1,i.visibleDepth)}function UV(e,t,n){return UR(IB(e,t))?e.instrumentation==null?{headNodeId:t,terminalNodeId:xB(e,t),visibleDepth:n}:{headNodeId:t,terminalNodeId:ZR(e.instrumentation,`store.getVisibleSlice.flatten.resolveTerminalDirectory`,()=>xB(e,t)),visibleDepth:n}:{headNodeId:t,terminalNodeId:t,visibleDepth:n}}function WV(e,t){let n=IB(e,t);if(!UR(n))return!0;let r=n.parentId;return r===e.snapshot.rootId?!0:bB(e,r)!==t}function GV(e,t){let n=IB(e,t.terminalNodeId);if(UR(n)){let r=FB(e,t.terminalNodeId);if(Bz(e,t.terminalNodeId,n)&&r.childIds.length>0){let n=r.childIds[0];return n==null?null:HV(e,n,0,t.visibleDepth+1)}}let r=t.terminalNodeId,i=t.visibleDepth;for(;;){let t=IB(e,r);if(r===e.snapshot.rootId)return null;let n=t.parentId,a=FB(e,n),o=DR(a).get(r)??-1;if(o<0)throw Error(`Child ${String(r)} was not found in its parent index`);let s=a.childIds[o+1]??null;if(s!=null)return HV(e,s,0,i);WV(e,r)&&i--,r=n}}function KV(e){let t=e.paths.length,n=Array(t);for(let r=0;r<t;r+=1){let t=e.getParentIndex(r);n[r]={index:r,parentPath:t>=0?e.paths[t]??null:null,path:e.paths[r]??``,posInSet:e.posInSetByIndex[r]??0,setSize:e.setSizeByIndex[r]??0}}return{getParentIndex:e.getParentIndex,rows:n,get visibleIndexByPath(){return e.visibleIndexByPath}}}function qV(e,t){let n=Array(t),r=new Int32Array(t),i=new Int32Array(t),a=new Int32Array(t),o=new Int32Array(EV);o.fill(-1);let s=0,{nodes:c,directories:l,segmentTable:u}=e.snapshot,d=[[l.get(e.snapshot.rootId),0,-1,``]],f=e.snapshot.options.flattenEmptyDirectories,p=e.pathCacheByNodeId,m=e.pathCacheVersion,h=u.valueById;for(;d.length>0&&s<t;){let t=d[d.length-1],u=t[0];if(t[1]>=u.childIds.length){d.pop();continue}let g=t[1],_=u.childIds[t[1]++],v=c[_],y=t[2]+1,b=t[3];o=DV(o,y);let x,S=_;if(UR(v))S=f?xB(e,_):_,x=S===_?`${b}${h[v.nameId]}/`:kB(e,S);else{let e=p.get(_);x=e!=null&&e.version===m?e.path:`${b}${h[v.nameId]}`}r[s]=o[y],n[s]=x,i[s]=g,a[s]=u.childIds.length,o[y+1]=s,s+=1;let C=c[S];C!=null&&UR(C)&&Bz(e,S,C)&&d.push([l.get(S),0,y,x])}s<t&&(n.length=s);let g=r.subarray(0,s),_=i.subarray(0,s),v=a.subarray(0,s),y=null;return{getParentIndex(e){return e<0||e>=s?-1:g[e]??-1},paths:n,posInSetByIndex:_,setSizeByIndex:v,get visibleIndexByPath(){if(y==null){y=new Map;for(let e=0;e<s;e+=1)y.set(n[e]??``,e)}return y}}}function JV(e,t){let n=Array(t),r=0,{nodes:i,directories:a,segmentTable:o}=e.snapshot,s=[[a.get(e.snapshot.rootId),0,-1]],c=o.valueById,l=e.snapshot.options.flattenEmptyDirectories,u=e.pathCacheByNodeId,d=e.pathCacheVersion;for(;s.length>0&&r<t;){let t=s[s.length-1],o=t[0];if(t[1]>=o.childIds.length){s.pop();continue}let f=o.childIds[t[1]++],p=i[f],m=t[2]+1;if(!UR(p)){let t=u.get(f);n[r++]={depth:m,flattenedSegments:void 0,hasChildren:!1,id:f,isExpanded:!1,isFlattened:!1,isLoading:!1,kind:`file`,loadState:void 0,name:c[p.nameId],path:t!=null&&t.version===d?t.path:kB(e,f)};continue}let h=l?xB(e,f):f,g={headNodeId:f,terminalNodeId:h,visibleDepth:m};n[r++]=YV(e,g);let _=i[h];_!=null&&UR(_)&&Bz(e,h,_)&&s.push([a.get(h),0,m])}return r<t&&(n.length=r),n}function YV(e,t){let n=IB(e,t.terminalNodeId),r=UR(n)?XV(e,t):null,i=kB(e,t.terminalNodeId),a=vz(e.snapshot.segmentTable,n.nameId),o=UR(n)&&FB(e,t.terminalNodeId).childIds.length>0,s=t.headNodeId!==t.terminalNodeId,c=e.instrumentation,l=s?c==null?SB(e,t.headNodeId).map(n=>{let r=IB(e,n);return{isTerminal:n===t.terminalNodeId,name:vz(e.snapshot.segmentTable,r.nameId),nodeId:n,path:kB(e,n)}}):ZR(c,`store.getVisibleSlice.flatten.collectSegments`,()=>SB(e,t.headNodeId).map(n=>{let r=IB(e,n);return{isTerminal:n===t.terminalNodeId,name:vz(e.snapshot.segmentTable,r.nameId),nodeId:n,path:kB(e,n)}})):void 0;return{depth:t.visibleDepth,flattenedSegments:l,hasChildren:o,id:t.terminalNodeId,isExpanded:UR(n)&&Bz(e,t.terminalNodeId,n),isFlattened:s,isLoading:r===`loading`,kind:UR(n)?`directory`:`file`,loadState:r==null||r===`loaded`?void 0:r,name:a,path:i}}function XV(e,t){if(t.headNodeId===t.terminalNodeId)return Uz(e,t.terminalNodeId);let n=SB(e,t.headNodeId),r=!1,i=!1;for(let t of n){let n=Uz(e,t);if(n===`loading`)return`loading`;if(n===`error`){i=!0;continue}n===`unloaded`&&(r=!0)}return i?`error`:r?`unloaded`:`loaded`}function ZV(e){let{directories:t,nodes:n,options:r,rootId:i,presortedDirectoryNodeIds:a}=e.snapshot,o=r.flattenEmptyDirectories===!0,s=e=>{let r=n[e];if(r==null||!UR(r))return;let i=t.get(e);if(i==null)throw Error(`Unknown directory child index for node ${String(e)}`);let a=i.childIds,s=a.length,c=0,l=0;for(let e=0;e<s;e++){let t=a[e];if(t==null)continue;let r=n[t];c+=r.subtreeNodeCount,l+=r.visibleSubtreeCount}i.totalChildSubtreeNodeCount=c,i.totalChildVisibleSubtreeCount=l,s>=128&&PR(n,i),r.subtreeNodeCount=1+c;let u;if(o&&s===1){let e=n[a[0]];u=e!=null&&UR(e)?l:1+l}else u=1+l;r.visibleSubtreeCount=u};if(a!=null)for(let e=a.length-1;e>=0;e--)s(a[e]);else for(let e=n.length-1;e>=1;e--)s(e);let c=n[i],l=t.get(i);if(c==null||l==null)return;let u=l.childIds,d=0,f=0;for(let e=0;e<u.length;e++){let t=u[e];if(t==null)continue;let r=n[t];d+=r.subtreeNodeCount,f+=r.visibleSubtreeCount}l.totalChildSubtreeNodeCount=d,l.totalChildVisibleSubtreeCount=f,PR(n,l),c.subtreeNodeCount=1+d,c.visibleSubtreeCount=f}function QV(e){return e.initialExpansion===`open`&&(e.initialExpandedPaths==null||e.initialExpandedPaths.length===0)}var $V=class e{#e;constructor(e={}){let t=XR(e),n=ZR(t,`store.builder.create`,()=>new Fz(e));if(e.preparedInput!=null){let t=Mz(e.preparedInput);t==null?n.appendPreparedPaths(jz(e.preparedInput),!1):n.appendPresortedPaths(t,Nz(e.preparedInput))}else{let r=e.paths??[];e.presorted===!0?n.appendPaths(r):n.appendPreparedPaths(ZR(t,`store.preparePathEntries`,()=>Pz(r,e)))}let r=ZR(t,`store.builder.finish`,()=>n.finish({skipSubtreeCountPass:!0})),i=ZR(t,`store.state.detectAllDirectoriesExpanded`,()=>(e.initialExpansion??`closed`)===`closed`&&n.didMatchAllInitialExpandedPaths());this.#e=ZR(t,`store.state.create`,()=>Iz(r,i?`open`:e.initialExpansion??`closed`,t)),i&&(this.#e.collapseNewDirectoriesByDefault=!0);let a=i?this.#e.snapshot.directories.size-1:ZR(t,`store.state.initializeExpandedPaths`,()=>this.initializeExpandedPaths(e.initialExpandedPaths));i||QV(e)||(e.initialExpansion??`closed`)===`closed`&&a===this.#e.snapshot.directories.size-1||(e.initialExpandedPaths?.length??0)>0&&ZR(t,`store.state.checkAllDirectoriesExpanded`,()=>this.hasAllDirectoriesExpanded())?ZR(t,`store.state.initializeOpenVisibleCounts`,()=>ZV(this.#e)):ZR(t,`store.state.recomputeCounts`,()=>jB(this.#e,this.#e.snapshot.rootId))}static preparePaths(e,t={}){return Oz(e,t)}static prepareInput(e,t={}){return kz(e,t)}static preparePresortedInput(e){return Az(e)}list(e){return ZR(this.#e.instrumentation,`store.list`,()=>CB(this.#e,e))}add(e){ZR(this.#e.instrumentation,`store.add`,()=>{let t=OV(this.#e);uB(this.#e,cB(this.#e,t,wB(this.#e,e)))})}remove(e,t={}){ZR(this.#e.instrumentation,`store.remove`,()=>{let n=OV(this.#e);uB(this.#e,cB(this.#e,n,TB(this.#e,e,t)))})}move(e,t,n={}){ZR(this.#e.instrumentation,`store.move`,()=>{let r=OV(this.#e),i=EB(this.#e,e,t,n);i!=null&&uB(this.#e,cB(this.#e,r,i))})}batch(e){lB(this.#e,()=>{if(typeof e==`function`){e(this);return}for(let t of e)switch(t.type){case`add`:this.add(t.path);break;case`remove`:this.remove(t.path,{recursive:t.recursive});break;case`move`:this.move(t.from,t.to,{collision:t.collision});break}})}getVisibleCount(){return ZR(this.#e.instrumentation,`store.getVisibleCount`,()=>OV(this.#e))}getVisibleSlice(e,t){return ZR(this.#e.instrumentation,`store.getVisibleSlice`,()=>PV(this.#e,e,t))}getVisibleRowContext(e){return ZR(this.#e.instrumentation,`store.getVisibleRowContext`,()=>NV(this.#e,e))}getVisibleTreeProjection(){return IV(this.#e)}getVisibleTreeProjectionData(e){return FV(this.#e,e)}getVisibleIndex(e){return ZR(this.#e.instrumentation,`store.getVisibleIndex`,()=>LV(this.#e,e))}getPathInfo(e){return ZR(this.#e.instrumentation,`store.getPathInfo`,()=>{let t=NB(this.#e,e);if(t==null)return null;let n=IB(this.#e,t);return{depth:VR(n),kind:UR(n)?`directory`:`file`,path:kB(this.#e,t)}})}isExpanded(e){return ZR(this.#e.instrumentation,`store.isExpanded`,()=>{let t=this.requireDirectoryNodeId(e),n=IB(this.#e,t);return Bz(this.#e,t,n)})}expand(e){ZR(this.#e.instrumentation,`store.expand`,()=>{let t=OV(this.#e),n=RV(this.#e,e);n!=null&&uB(this.#e,cB(this.#e,t,n))})}collapse(e){ZR(this.#e.instrumentation,`store.collapse`,()=>{let t=OV(this.#e),n=zV(this.#e,e);n!=null&&uB(this.#e,cB(this.#e,t,n))})}on(e,t){return Xz(this.#e,e,t)}getDirectoryLoadState(e){let t=this.requireDirectoryNodeId(e);return Uz(this.#e,t)}markDirectoryUnloaded(e){ZR(this.#e.instrumentation,`store.markDirectoryUnloaded`,()=>{let t=this.requireDirectoryNodeId(e);if(FB(this.#e,t).childIds.length>0)throw Error(`Cannot mark a directory with known children as unloaded: "${e}"`);let n=OV(this.#e);Gz(this.#e,t),uB(this.#e,cB(this.#e,n,nB({affectedAncestorIds:MB(this.#e,t),affectedNodeIds:[t],path:e,projectionChanged:this.isDirectoryProjectionVisible(t)})))})}beginChildLoad(e){return ZR(this.#e.instrumentation,`store.beginChildLoad`,()=>{let t=this.requireDirectoryNodeId(e),n=OV(this.#e),r=Wz(this.#e,t);return uB(this.#e,cB(this.#e,n,rB({affectedAncestorIds:MB(this.#e,t),affectedNodeIds:[t],attemptId:r.attemptId,path:e,projectionChanged:this.isDirectoryProjectionVisible(t),reused:r.reused}))),r})}applyChildPatch(e,t){return ZR(this.#e.instrumentation,`store.applyChildPatch`,()=>{let n=this.resolveActiveDirectoryNodeId(e.nodeId);if(n==null||Uz(this.#e,n)!==`loading`||!qz(this.#e,n,e.attemptId))return!1;let r=kB(this.#e,n);this.validateChildPatch(r,t);let i=OV(this.#e),a=[];for(let e of t.operations){eH(r,e);let t=OV(this.#e);switch(e.type){case`add`:a.push(cB(this.#e,t,wB(this.#e,e.path)));break;case`remove`:a.push(cB(this.#e,t,TB(this.#e,e.path,{recursive:e.recursive})));break;case`move`:{let n=EB(this.#e,e.from,e.to,{collision:e.collision});n!=null&&a.push(cB(this.#e,t,n));break}}}let o=a.some(e=>e.projectionChanged)||this.isDirectoryProjectionVisible(n);return uB(this.#e,cB(this.#e,i,iB({affectedAncestorIds:MB(this.#e,n),affectedNodeIds:[n],attemptId:e.attemptId,childEvents:a,path:kB(this.#e,n),projectionChanged:o}))),!0})}completeChildLoad(e){return ZR(this.#e.instrumentation,`store.completeChildLoad`,()=>{let t=this.resolveActiveDirectoryNodeId(e.nodeId);if(t==null)return!1;let n=OV(this.#e),r=Kz(this.#e,t,e.attemptId);return uB(this.#e,cB(this.#e,n,aB({affectedAncestorIds:MB(this.#e,t),affectedNodeIds:[t],attemptId:e.attemptId,path:kB(this.#e,t),projectionChanged:this.isDirectoryProjectionVisible(t),stale:!r}))),r})}failChildLoad(e,t){return ZR(this.#e.instrumentation,`store.failChildLoad`,()=>{let n=this.resolveActiveDirectoryNodeId(e.nodeId);if(n==null)return!1;let r=OV(this.#e),i=Jz(this.#e,n,e.attemptId,t);return uB(this.#e,cB(this.#e,r,oB({affectedAncestorIds:MB(this.#e,n),affectedNodeIds:[n],attemptId:e.attemptId,errorMessage:t,path:kB(this.#e,n),projectionChanged:this.isDirectoryProjectionVisible(n),stale:!i}))),i})}cleanup(e={}){return ZR(this.#e.instrumentation,`store.cleanup`,()=>{if(this.#e.transactionStack.length>0)throw Error(`Cleanup cannot run during an open batch or transaction.`);if(wV(this.#e))throw Error(`Cleanup cannot run while directory loads are active.`);let t=OV(this.#e),n=TV(this.#e,e.mode??`stable`);return uB(this.#e,cB(this.#e,t,sB({...n,affectedAncestorIds:[],affectedNodeIds:[],projectionChanged:n.idsPreserved===!1}))),n})}getNodeCount(){return this.#e.activeNodeCount}initializeExpandedPaths(e){if(e==null||e.length===0)return 0;let t=0,n=[],r=[],i=0,a=null,o=this.#e.snapshot.segmentTable,s=o.valueById,c=this.#e.snapshot.nodes,l=new Map;for(let u of e){a!=null&&u<a&&(a=null,i=0,n.length=0,r.length=0);let e=u.length>0&&u.charCodeAt(u.length-1)===47?u.length-1:u.length;if(e===0){a=u,i=e,n.length=0,r.length=0;continue}let d=0,f=0;if(a!=null){let t=Math.min(e,i),n=!0;for(let e=0;e<t;e+=1){let t=u.charCodeAt(e);if(t!==a.charCodeAt(e)){n=!1;break}t===47&&(d+=1,f=e+1)}n&&(t===i&&e>t&&u.charCodeAt(t)===47?(d+=1,f=t+1):t===e&&i>t&&a.charCodeAt(t)===47&&(d+=1,f=e+1)),d=Math.min(d,r.length)}let p=d===0?this.#e.snapshot.rootId:r[d-1]??this.#e.snapshot.rootId,m=d,h=!0,g=f;for(;g<=e;){let t=u.indexOf(`/`,g),i=t===-1||t>e?e:t,a=u.slice(g,i),f=FB(this.#e,p).childIds,_=m===d?n[m]??0:0,v=_,y,b=l.get(a)??tz(a);l.set(a,b);let x=(e,t)=>{for(v=e;v<t;v+=1){let e=f[v],t=c[e],n=s[t.nameId];if(n===a)return y=e,!0;let r=rz(uz(o,t.nameId),b);if(r>0||r===0&&n>a)return!1}return!1};if(!x(_,f.length)&&_>0&&x(0,_),y===void 0){h=!1;break}if(!UR(IB(this.#e,y))){h=!1;break}if(n[m]=v,r[m]=y,p=y,m+=1,i===e)break;g=i+1}if(a=u,i=e,n.length=m,r.length=m,!h){a=null,i=0,n.length=0,r.length=0;continue}for(let e=d;e<m;e+=1){let n=r[e];if(n==null)continue;let i=IB(this.#e,n);Bz(this.#e,n,i)||(Vz(this.#e,n,!0,i),t+=1)}}return t}hasAllDirectoriesExpanded(){for(let e of this.#e.snapshot.directories.keys()){if(e===this.#e.snapshot.rootId)continue;let t=IB(this.#e,e);if(!Bz(this.#e,e,t))return!1}return!0}requireDirectoryNodeId(e){let t=NB(this.#e,e);if(t==null)throw Error(`Path does not exist: "${e}"`);if(!UR(IB(this.#e,t)))throw Error(`Path is not a directory: "${e}"`);return t}resolveActiveDirectoryNodeId(e){try{if(!UR(IB(this.#e,e)))throw Error(`Node is not a directory: ${String(e)}`);return e}catch{return null}}isDirectoryProjectionVisible(e){let t=e;for(;t!==this.#e.snapshot.rootId;){let e=IB(this.#e,t).parentId;if(e!==this.#e.snapshot.rootId){let n=IB(this.#e,e),r=bB(this.#e,e);if(!Bz(this.#e,e,n)&&r!==t)return!1}t=e}return!0}validateChildPatch(t,n){new e({paths:this.list(t),presorted:!0,sort:this.#e.snapshot.options.sort}).batch(n.operations)}};function eH(e,t){switch(t.type){case`add`:case`remove`:if(!t.path.startsWith(e)||t.path===e)throw Error(`Child patch operation must stay within ${e}: "${t.path}"`);break;case`move`:if(!t.from.startsWith(e)||!t.to.startsWith(e)||t.from===e||t.to===e)throw Error(`Child patch move must stay within ${e}: "${t.from}" -> "${t.to}"`);break}}var tH={compact:{itemHeight:24,factor:.8},default:{itemHeight:30,factor:1},relaxed:{itemHeight:36,factor:1.2}};function nH(e,t){if(typeof e==`number`)return{itemHeight:t??tH.default.itemHeight,factor:e};let n=tH[e??`default`];return{itemHeight:t??n.itemHeight,factor:n.factor}}var rH=tH.default.itemHeight,iH=`@layer base, theme, unsafe;
|
|
197
197
|
|
|
198
198
|
@layer base {
|
|
199
199
|
:host {
|
|
@@ -1857,20 +1857,20 @@ Error generating stack: `+e.message+`
|
|
|
1857
1857
|
}
|
|
1858
1858
|
}
|
|
1859
1859
|
}
|
|
1860
|
-
`,
|
|
1860
|
+
`,aH=`@layer base, unsafe;`;function oH(e){return`${aH}
|
|
1861
1861
|
@layer base {
|
|
1862
1862
|
${e}
|
|
1863
|
-
}`}function
|
|
1863
|
+
}`}function sH(e){return`${aH}
|
|
1864
1864
|
@layer unsafe {
|
|
1865
1865
|
${e}
|
|
1866
|
-
}`}var ZV=new WeakMap;function QV(e){let t=ZV.get(e);if(t!=null)return t;let n=document.createElement(`div`);n.setAttribute(GL,`true`);let r=document.createElement(`div`);r.style.position=`relative`,r.style.height=`200%`,n.appendChild(r),e.appendChild(n);let i=Math.max(n.offsetWidth-n.clientWidth,0);return n.remove(),ZV.set(e,i),i}function $V(e,t){if(!e.isConnected)return;let n=QV(t);if(n==null)return;let r=t.querySelector(`style[${KL}]`),i=r instanceof HTMLStyleElement?r:document.createElement(`style`);r instanceof HTMLStyleElement||(i.setAttribute(KL,``),t.appendChild(i)),i.textContent=`:host { ${qL}: ${n}px; }`}var eH;function tH(e){if(typeof CSSStyleSheet<`u`&&typeof CSSStyleSheet.prototype.replaceSync==`function`&&`adoptedStyleSheets`in e){eH??(eH=new CSSStyleSheet,eH.replaceSync(YV(qV)));let t=!1;try{e.adoptedStyleSheets=[eH],t=!0}catch{}if(t){e.querySelector(`style[${UL}]`)?.remove();return}}if(e.querySelector(`style[data-file-tree-style]`)==null){let t=document.createElement(`style`);t.setAttribute(UL,``),t.textContent=YV(qV),e.prepend(t)}}function nH(e,t){rH(e,t),tH(t),$V(e,t)}function rH(e,t){let n=e.querySelector(`template[shadowrootmode="open"], template[data-file-tree-shadowrootmode="open"]`);n instanceof HTMLTemplateElement&&(t.childNodes.length>0||(t.appendChild(n.content.cloneNode(!0)),n.hasAttribute(`shadowrootmode`)&&n.remove()))}if(typeof HTMLElement<`u`&&customElements.get(`file-tree-container`)==null){class e extends HTMLElement{constructor(){super()}connectedCallback(){let e=this.shadowRoot??this.attachShadow({mode:`open`});nH(this,e)}}if(customElements.define(HL,e),typeof document<`u`)for(let e of Array.from(document.querySelectorAll(HL)))e instanceof HTMLElement&&nH(e,e.shadowRoot??e.attachShadow({mode:`open`}))}var iH=e=>e.startsWith(`f::`)?e.slice(3):e;function aH(e){let t=e.lastIndexOf(`/`);return t<0?{parentPath:``,baseName:e}:{parentPath:e.slice(0,t),baseName:e.slice(t+1)}}function oH(e,t){return e===``?t:`${e}/${t}`}function sH({files:e,path:t,isFolder:n,nextBasename:r}){let i=iH(t),a=r.trim();if(a.length===0)return{error:`Name cannot be empty.`};if(a.includes(`/`))return{error:`Name cannot include "/".`};let{parentPath:o,baseName:s}=aH(i);if(a===s)return{nextFiles:e,sourcePath:i,destinationPath:i,isFolder:n};let c=oH(o,a),l=Array(e.length),u=new Set;if(!n){let t=`${c}/`,r=!1;for(let n=0;n<e.length;n++){let a=e[n];if(a!==i&&a.startsWith(t))return{error:`"${c}" already exists.`};let o=a===i?c:a;if(u.has(o))return{error:`"${c}" already exists.`};u.add(o),l[n]=o,a===i&&(r=!0)}return r?{nextFiles:l,sourcePath:i,destinationPath:c,isFolder:n}:{error:`Could not find the selected file to rename.`}}let d=`${i}/`,f=`${c}/`,p=0;for(let t=0;t<e.length;t++){let n=e[t],r=n===i||n.startsWith(d);if(!r&&(n===c||n.startsWith(f)))return{error:`"${c}" already exists.`};let a=r?`${c}${n.slice(i.length)}`:n;if(u.has(a))return{error:`"${c}" already exists.`};u.add(a),l[t]=a,r&&p++}return p===0?{error:`Could not find the selected folder to rename.`}:{nextFiles:l,sourcePath:i,destinationPath:c,isFolder:n}}function cH(e){return e.endsWith(`/`)}function lH(e){let t=e.endsWith(`/`)?e.slice(0,-1):e,n=t.lastIndexOf(`/`),r=n<0?t:t.slice(n+1);return e.endsWith(`/`)?`${r}/`:r}function uH(e){let t=[],n=new Set;for(let r of e)n.has(r)||(n.add(r),t.push(r));let r=new Set;for(let e of t.toSorted((e,t)=>e.length===t.length?e.localeCompare(t):e.length-t.length)){let t=(e.endsWith(`/`)?e.slice(0,-1):e).split(`/`),n=!1;for(let e=0;e<t.length-1;e+=1){let i=`${t.slice(0,e+1).join(`/`)}/`;if(r.has(i)){n=!0;break}}n||r.add(e)}return t.filter(e=>r.has(e))}function dH(e,t){return t.includes(e)?uH(t):[e]}function fH(e,t){return e===t?!0:e==null||t==null?!1:e.kind===t.kind&&e.directoryPath===t.directoryPath&&e.flattenedSegmentPath===t.flattenedSegmentPath&&e.hoveredPath===t.hoveredPath}function pH(e,t){return{draggedPaths:e,target:t}}function mH(e,t){if(t.kind!==`directory`||t.directoryPath==null)return!1;for(let n of e)if(cH(n)&&(t.directoryPath===n||t.directoryPath.startsWith(n)))return!0;return!1}function hH(e,t){return t.kind===`root`||t.directoryPath==null?lH(e):t.directoryPath}function gH(e,t){let n=e.map(e=>{let n=hH(e,t);return n===e?null:{from:e,to:n,type:`move`}}).filter(e=>e!=null);return n.length===0?null:{operations:n,result:{draggedPaths:e,operation:n.length===1?`move`:`batch`,target:t}}}function _H(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]!==t[n])return!1;return!0}function vH(e,t,n){let{paths:r,preparedInput:i}=e;if(i==null){if(r==null)throw Error(`FileTree requires paths or preparedInput`);return{paths:r,preparedInput:void 0}}let a=i.paths;if(r==null)return{paths:a,preparedInput:i};if(!_H(HV.preparePaths(r,n==null?{}:{sort:n}),a))throw Error(`FileTree ${t} received paths and preparedInput for different path lists`);return{paths:a,preparedInput:i}}function yH(e){return e.operation===`add`||e.operation===`remove`||e.operation===`move`||e.operation===`batch`}function bH(e,t,n){if(e===t)return n;let r=t.endsWith(`/`)?t:`${t}/`;return e.startsWith(r)?`${n.endsWith(`/`)?n:`${n}/`}${e.slice(r.length)}`:e}function xH(e,t){if(e===t)return!0;let n=t.endsWith(`/`)?t:`${t}/`;return e.startsWith(n)}function SH(e,t,n=!1){if(e==null)return null;switch(t.operation){case`add`:case`expand`:case`collapse`:case`mark-directory-unloaded`:case`begin-child-load`:case`apply-child-patch`:case`complete-child-load`:case`fail-child-load`:case`cleanup`:return e;case`remove`:return xH(e,t.path)?n?e:null:e;case`move`:return bH(e,t.from,t.to);case`batch`:{let r=e;for(let e of t.events)if(r=SH(r,e,n),r==null)return null;return r}}}function CH(e){return{canonicalChanged:e.canonicalChanged,projectionChanged:e.projectionChanged,visibleCountDelta:e.visibleCountDelta}}function wH(e){switch(e.operation){case`add`:return{...CH(e),operation:`add`,path:e.path};case`remove`:return{...CH(e),operation:`remove`,path:e.path,recursive:e.recursive};case`move`:return{...CH(e),from:e.from,operation:`move`,to:e.to}}}function TH(e){return{...CH(e),events:e.events.filter(e=>e.operation===`add`||e.operation===`remove`||e.operation===`move`).map(e=>wH(e)),operation:`batch`}}function EH(e){switch(e.operation){case`add`:case`remove`:case`move`:return wH(e);case`batch`:return TH(e);default:return null}}function DH(e,t){if(e.size!==t.length)return!1;for(let n of t)if(!e.has(n))return!1;return!0}function OH(e){let t=e.endsWith(`/`)?e.slice(0,-1):e;if(t.length===0)return[];let n=t.split(`/`);return n.slice(0,-1).map((e,t)=>`${n.slice(0,t+1).join(`/`)}/`)}function kH(e){return OH(e).at(-1)??null}function AH(e,t){return t==null?e:e.startsWith(t)?e.slice(t.length):e}function jH(e){return e.endsWith(`/`)}var MH=e=>e.toLowerCase();function NH(e){let t=e.endsWith(`/`)?e.slice(0,-1):e,n=t.lastIndexOf(`/`);return n<0?t:t.slice(n+1)}function PH(e){return e.endsWith(`/`)?e.slice(0,-1):e}function FH(e,t){return t&&!e.endsWith(`/`)?`${e}/`:e}var IH=e=>{let t=e.trim();return t.length===0?``:(t.includes(`\\`)?t.replaceAll(`\\`,`/`):t).toLowerCase()},LH=Symbol(`FILE_TREE_RENAME_VIEW`),RH=512,zH=512;function BH(e){return e===`top`||e===`center`?e:`nearest`}function VH(e,t,n){if(e===0)return-1;if(n!=null){let e=t(n);if(e!=null)return e;let r=OH(n);for(let e=r.length-1;e>=0;--e){let n=r[e];if(n==null)continue;let i=t(n);if(i!=null)return i}}return 0}function HH(e,t,n){if(e.paths.length===0)return{focusedIndex:-1,getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex};if(t==null)return{focusedIndex:0,getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex};let r=n??(t=>e.visibleIndexByPath.get(t)??null);return{focusedIndex:VH(e.paths.length,r,t),getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex}}var UH=class{#e;#t=new Set;#n=new Map;#r=null;#i=null;#a=new Map;#o=new Map;#s=-1;#c=null;#l=!1;#u=e=>-1;#d=new Map;#f=null;#p=null;#m=null;#h=null;#g=null;#_;#v;#y;#b=[];#x=new Int32Array;#S=new Int32Array;#C=void 0;#w=!1;#T=null;#E=``;#D=!1;#O=new Set;#k=[];#A;#j=null;#M=null;#N=null;#P=null;#F=null;#I=null;#L=null;#R=0;#z=null;#B=new Set;#V=0;#H;#U=0;#W=!1;#G=0;#K;constructor(e){let{dragAndDrop:t,fileTreeSearchMode:n,initialSearchQuery:r,initialSelectedPaths:i,renaming:a,onSearchChange:o,paths:s,preparedInput:c,...l}=e,u=vH({paths:s,preparedInput:c},`constructor`,l.sort);this.#e=l,t!=null&&t!==!1&&(this.#r=t===!0?{}:t),this.#w=a!=null&&a!==!1,a!=null&&a!==!1&&a!==!0&&(this.#C=a.canRename,this.#v=a.onError,this.#_=a.onRename),this.#y=o,this.#A=n??`hide-non-matches`,this.#H=this.#le(u.paths,u.preparedInput);let d=i?.map(e=>this.#Ne(e)).filter(e=>e!=null)??[],f=d.at(-1)??null;d.length>0&&(this.#B=new Set(d),this.#z=f,this.#V=1),this.#je(f,!1),r!=null&&this.#Te(r,!1),this.#K=this.#Re()}destroy(){this.#K?.(),this.#K=null,this.#n.clear(),this.#t.clear(),this.#d.clear(),this.#i=null,this.#he()}focusFirstItem(){this.#be().length>0&&this.#Fe(0)}focusLastItem(){this.#G<=0||(this.#Ie(),this.#Fe(this.#G-1))}focusNextItem(){this.#Ae(1)}focusParentItem(){if(this.#c==null)return;let e=kH(this.#c);if(e==null)return;let t=this.#Z(e);t>=0&&this.#Fe(t)}focusPath(e){let t=this.#H.getPathInfo(e)?.path??null;if(t==null)return;this.#Ie();let n=this.#Z(t);n>=0&&this.#Fe(n)}scrollToPath(e,t){let n=this.#H.getPathInfo(e)?.path??null;if(n==null)return;this.#Ie();let r=this.#xe(n);r<0||this.#Me(r)!=null&&(t?.focus!==!1&&this.#Fe(r,!1),this.#L={id:this.#R+=1,offset:BH(t?.offset),visibleIndex:r},this.#De())}focusMountedPathFromInput(e){let t=this.#H.getPathInfo(e)?.path??null;if(t==null)return;let n=this.#Z(t);n>=0&&this.#Fe(n)}focusNearestPath(e){let t=this.resolveNearestVisiblePath(e);if(t==null)return null;let n=this.#Z(t);return n>=0?(this.#Fe(n),this.#be()[n]??t):null}focusPreviousItem(){this.#Ae(-1)}getFocusedIndex(){return this.#s}getFocusedItem(){return this.#c==null?null:this.#Q(this.#c)}getFocusedPath(){return this.#c}getScrollRequest(){return this.#L}clearScrollRequest(e){this.#L?.id===e&&(this.#L=null)}resolveNearestVisiblePath(e){let t=this.#be();if(this.#G===0)return null;if(e==null)return this.#c??t[0]??null;let n=this.#H.getPathInfo(e)?.path??e,r=this.#Z(n);return r>=0?t[r]??n:this.#X(n)??this.#c??t[0]??null}getSelectedPaths(){return[...this.#B]}getSelectionVersion(){return this.#V}getVisibleCount(){return this.#G}getVisibleRows(e,t){if(t<e||this.#G===0)return[];let n=Math.max(0,e),r=Math.min(this.#G-1,t);if(r<n)return[];let i=r-n+1;if(this.#F==null&&!this.#l&&r>=this.#b.length&&i<=zH){let e=[];for(let t=n;t<=r;t+=1){let n=this.#H.getVisibleRowContext(t);if(n==null)break;e.push(this.#ee(n))}return e}if(!this.#l&&r>=this.#b.length&&this.#Ie(),this.#F!=null){let e=Array.from({length:r-n+1},(e,t)=>this.#Se(n+t)),t=new Map,i=e[0]??-1,a=i;for(let n=1;n<=e.length;n+=1){let r=e[n];if(r!=null&&r===a+1){a=r;continue}if(i>=0&&this.#H.getVisibleSlice(i,a).forEach((e,n)=>{t.set(i+n,e)}),r==null){i=-1,a=-1;continue}i=r,a=r}return Array.from({length:r-n+1},(e,r)=>{let i=n+r,a=this.#Se(i),o=t.get(a),s=this.#b[a];if(o==null||s==null)throw Error(`Missing projection row for filtered visible index ${String(i)}`);return this.#$(o,i,a,{ancestorPaths:this.#re(a),path:s})})}return this.#H.getVisibleSlice(n,r).map((e,t)=>{let r=n+t,i=this.#b[r];if(i==null)throw Error(`Missing projection path for visible index ${String(r)}`);return this.#$(e,r,r,{ancestorPaths:this.#re(r),path:i})})}getStickyRowCandidates(e,t){if(this.#F!=null)return null;if(this.#G===0||e<=0||t<=0)return[];let n=[];for(let r=0;r<this.#G;r+=1){let i=e+r*t,a=Math.min(this.#G-1,Math.floor(i/t)),o=this.#te(a,r)??(a>0?this.#te(a-1,r):void 0);if(o==null)break;n.push({row:this.#ee(o),subtreeEndIndex:o.subtreeEndIndex})}return n}getItem(e){let t=this.#H.getPathInfo(e);return t==null?null:this.#Q(t.path,t)}resolveMountedDirectoryPathFromInput(e){let t=this.#H.getPathInfo(e);return t?.kind===`directory`?t.path:null}toggleMountedDirectoryFromInput(e){let t=this.resolveMountedDirectoryPathFromInput(e);t!=null&&this.#ze(t)}selectAllVisiblePaths(){this.#Ie();let e=[...this.#be()];this.#ae(e,this.#c??this.#z)}selectOnlyPath(e){let t=this.#Ne(e);t!=null&&this.#ae([t],t)}selectOnlyMountedPathFromInput(e){this.#ae([e],e)}selectPath(e){let t=this.#Ne(e);t==null||this.#B.has(t)||this.#ae([...this.#B,t])}deselectPath(e){let t=this.#Ne(e);t==null||!this.#B.has(t)||this.#ae([...this.#B].filter(e=>e!==t))}toggleFocusedSelection(){this.#c!=null&&this.togglePathSelectionFromInput(this.#c)}togglePathSelection(e){let t=this.#Ne(e);if(t!=null){if(this.#B.has(t)){this.deselectPath(t);return}this.selectPath(t)}}togglePathSelectionFromInput(e){let t=this.#Ne(e);if(t!=null){if(this.#B.has(t)){this.#ae([...this.#B].filter(e=>e!==t),t);return}this.#ae([...this.#B,t],t)}}selectPathRange(e,t){let n=this.#Ne(e);if(n==null)return;this.#Ie();let r=this.#z,i=r==null?-1:this.#Ce(r),a=this.#Ce(n);if(i===-1||a===-1){let e=t?[...this.#B,n]:[n];this.#ae(e,n);return}let[o,s]=i<=a?[i,a]:[a,i],c=this.#be().slice(o,s+1),l=t?[...this.#B,...c]:c;this.#ae(l,r)}extendSelectionFromFocused(e){if(this.#c==null)return;let t=this.#s;if(t===-1)return;let n=Math.min(this.#G-1,Math.max(0,t+e));if(n===t)return;!this.#l&&n>=this.#b.length&&this.#Ie();let r=this.#be(),i=r[t]??null,a=r[n]??null;if(i==null||a==null)return;let o=new Set(this.#B);o.has(i)&&o.has(a)?o.delete(i):o.add(a),this.#ae([...o],this.#z??i,!1),this.#Fe(n)}getDragAndDropConfig(){return this.#r}isDragAndDropEnabled(){return this.#r!=null}getDragSession(){return this.#i==null?null:{draggedPaths:[...this.#i.draggedPaths],primaryPath:this.#i.primaryPath,target:this.#i.target==null?null:{...this.#i.target}}}startDrag(e){if(this.#r==null)return!1;let t=this.#Ne(e);if(t==null||this.#M!=null&&this.#M.length>0)return!1;let n=this.getSelectedPaths(),r=dH(t,n);return this.#r.canDrag?.(r)===!1?!1:(n.includes(t)||this.#ae([t],t,!1),this.#Pe(t),this.#i={draggedPaths:r,primaryPath:t,target:null},this.#De(),!0)}setDragTarget(e){let t=this.#i;if(t==null)return;let n=e;if(n!=null){let e=pH(t.draggedPaths,n);(mH(t.draggedPaths,n)||this.#r?.canDrop?.(e)===!1)&&(n=null)}fH(t.target,n)||(this.#i={...t,target:n},this.#De())}cancelDrag(){this.#i!=null&&(this.#i=null,this.#De())}completeDrag(){let e=this.#i;if(e==null)return!1;this.#i=null;let t=e.target==null?null:{...e.target};if(t==null)return this.#De(),!1;let n=pH(e.draggedPaths,t);if(mH(e.draggedPaths,t)||this.#r?.canDrop?.(n)===!1)return this.#De(),!1;let r=gH(e.draggedPaths,t);if(r==null)return this.#De(),!1;try{if(r.operations.length===1){let e=r.operations[0];if(e==null||e.type!==`move`)throw Error(`Expected a single move operation for one-item drops`);this.#H.move(e.from,e.to,{collision:e.collision})}else this.#ce(r.operations),this.#H.batch(r.operations)}catch(e){return this.#De(),this.#r?.onDropError?.(e instanceof Error?e.message:String(e),n),!1}return this.#r?.onDropComplete?.(r.result),!0}subscribe(e){return this.#t.add(e),e(),()=>{this.#t.delete(e)}}add(e){this.#H.add(e)}remove(e,t={}){this.#H.remove(e,t)}move(e,t,n={}){this.#H.move(e,t,n)}batch(e){this.#H.batch(e)}onMutation(e,t){let n=e,r=t,i=this.#n.get(n);return i??(i=new Set,this.#n.set(n,i)),i.add(r),()=>{let e=this.#n.get(n);e?.delete(r),e?.size===0&&this.#n.delete(n)}}setSearch(e){this.#Te(e,!0)}openSearch(e=``){this.#Te(e,!0)}closeSearch(){this.#Te(null,!0)}isSearchOpen(){return this.#M!==null}getSearchValue(){return this.#M??``}getSearchMatchingPaths(){return this.#k}focusNextSearchMatch(){this.#we(1)}focusPreviousSearchMatch(){this.#we(-1)}startRenaming(e=this.#c??``,t={}){if(!this.#w)return!1;let n=this.#H.getPathInfo(e);if(n==null)return!1;let r=n.path,i=jH(r),a=PH(r);if(this.#C?.({isFolder:i,path:a})===!1)return!1;for(let e of OH(r))this.#H.isExpanded(e)||this.#H.expand(e);return this.#ae([r],r,!1),this.#M!=null&&(this.#Te(null,!1),this.#y?.(this.#M)),this.#Pe(r),this.#T=r,this.#E=NH(r),this.#D=t.removeIfCanceled??!1,this.#De(),!0}[LH](){return{cancel:()=>{this.#q()},commit:()=>{this.#J()},getPath:()=>this.#T,getValue:()=>this.#E,isActive:()=>this.#T!=null,setValue:e=>{this.#Y(e)}}}#q(){if(this.#T==null)return;let e=this.#T,t=this.#D;if(this.#T=null,this.#E=``,this.#D=!1,t){this.remove(e,jH(e)?{recursive:!0}:void 0);return}this.#Pe(e),this.#De()}#J(){let e=this.#T;if(e==null)return;if(this.#D&&this.#E.trim().length===0){this.#T=null,this.#E=``,this.#D=!1,this.remove(e,jH(e)?{recursive:!0}:void 0);return}let t=jH(e),n=sH({files:this.#H.list(),isFolder:t,nextBasename:this.#E,path:PH(e)});if(this.#T=null,this.#E=``,this.#D=!1,`error`in n){this.#Pe(e),this.#v?.(n.error),this.#De();return}if(n.sourcePath===n.destinationPath){this.#Pe(e),this.#De();return}this.#_?.({destinationPath:n.destinationPath,isFolder:n.isFolder,sourcePath:n.sourcePath}),this.move(FH(n.sourcePath,t),FH(n.destinationPath,t))}#Y(e){this.#T==null||this.#E===e||(this.#E=e,this.#De())}resetPaths(e,t={}){let n=this.#H.list().length,r=this.#G,i=vH({paths:e,preparedInput:t.preparedInput},`resetPaths`,this.#e.sort),a=this.#le(i.paths,i.preparedInput,t.initialExpandedPaths),o=this.#c,s=this.#T,c=this.getSelectedPaths(),l=this.#z;this.#K?.(),this.#H=a,this.#d.clear(),this.#he();let u=c.map(e=>a.getPathInfo(e)?.path??null).filter(e=>e!=null),d=!DH(this.#B,u);this.#B=new Set(u),d&&(this.#V+=1),this.#z=l==null?null:a.getPathInfo(l)?.path??null,this.#T=s==null?null:a.getPathInfo(s)?.path??null,this.#T??(this.#E=``,this.#D=!1),this.#je(o,o!=null||u.length>0||this.#z!=null),this.#K=this.#Re(),this.#De(),this.#Oe({canonicalChanged:!0,operation:`reset`,pathCountAfter:i.paths.length,pathCountBefore:n,projectionChanged:!0,usedPreparedInput:t.preparedInput!=null,visibleCountDelta:this.#G-r})}#X(e){this.#Ie();let t=kH(e),n=AH(e,t),r=null,i=null;for(let e of this.#be()){if(kH(e)!==t)continue;let a=AH(e,t);if(a<n){r=e;continue}if(a>n){i=e;break}}return r??i}#Z(e){let t=this.#Ce(e);if(t!==-1)return t;let n=OH(e);for(let e=n.length-1;e>=0;--e){let t=n[e];if(t==null)continue;let r=this.#Ce(t);if(r!==-1)return r}return this.#be().length>0?0:-1}#Q(e,t){let n=this.#d.get(e);if(n!=null)return n;let r=t??this.#H.getPathInfo(e);if(r==null)return null;let i=r.kind===`directory`?this.#oe(r.path):this.#se(r.path);return this.#d.set(r.path,i),i}#$(e,t,n,r){return{ancestorPaths:r.ancestorPaths,depth:e.depth,flattenedSegments:e.flattenedSegments?.map(e=>({isTerminal:e.isTerminal,name:e.name,path:e.path})),hasChildren:e.hasChildren,index:t,isExpanded:e.isExpanded,isFlattened:e.isFlattened,isFocused:r.path===this.#c,isSelected:this.#B.has(r.path),kind:e.kind,level:e.depth,name:e.name,path:r.path,posInSet:r.posInSet??this.#x[n]??0,setSize:r.setSize??this.#S[n]??0}}#ee(e){return this.#$(e.row,e.index,e.index,{ancestorPaths:e.ancestorPaths,path:e.row.path,posInSet:e.posInSet,setSize:e.setSize})}#te(e,t){let n=this.#H.getVisibleRowContext(e);return n==null?void 0:n.ancestorRows[t]??(t===n.ancestorRows.length&&n.row.kind===`directory`&&n.row.isExpanded?n:void 0)}#ne(e){let t=this.#a.get(e);if(t!=null)return t;let n=this.#u(e),r=n<0?[]:[...this.#ne(n),n];return this.#a.set(e,r),r}#re(e){let t=this.#o.get(e);if(t!=null)return t;let n=this.#ne(e).map(e=>this.#b[e]??``).filter(e=>e!==``);return this.#o.set(e,n),n}#ie(e){this.#H.collapse(e)}#ae(e,t=this.#z,n=!0){let r=[...new Set(e)],i=!DH(this.#B,r),a=this.#z!==t;!i&&!a||(this.#B=new Set(r),this.#z=t,i&&(this.#V+=1),n&&this.#De())}#oe(e){return{collapse:()=>{this.#ie(e)},deselect:()=>{this.deselectPath(e)},expand:()=>{this.#ke(e)},focus:()=>{this.focusPath(e)},getPath:()=>e,isDirectory:()=>!0,isExpanded:()=>this.#H.isExpanded(e),isFocused:()=>this.#c===e,isSelected:()=>this.#B.has(e),select:()=>{this.selectPath(e)},toggleSelect:()=>{this.togglePathSelection(e)},toggle:()=>{this.#ze(e)}}}#se(e){return{deselect:()=>{this.deselectPath(e)},focus:()=>{this.focusPath(e)},getPath:()=>e,isDirectory:()=>!1,isFocused:()=>this.#c===e,isSelected:()=>this.#B.has(e),select:()=>{this.selectPath(e)},toggleSelect:()=>{this.togglePathSelection(e)}}}#ce(e){let t=this.#H.list();this.#le(t).batch(e)}#le(e,t,n){return new HV({...this.#e,paths:e,preparedInput:t??void 0,...n===void 0?{}:{initialExpandedPaths:n}})}#ue(){return this.#h??=this.#H.list(),this.#h}#de(){if(this.#m!=null)return this.#m;let e=new Set;for(let t of this.#ue()){e.add(t);for(let n of OH(t))e.add(n)}return this.#m=[...e].sort(),this.#m}#fe(){return this.#g??=this.#ue().map(MH),this.#g}#pe(){return this.#f??=this.#de().filter(e=>e.endsWith(`/`)),this.#f}#me(){return this.#p??=this.#pe().map(MH),this.#p}#he(){this.#f=null,this.#p=null,this.#m=null,this.#h=null,this.#g=null}#ge(){return this.#pe().filter(e=>this.#H.isExpanded(e))}#_e(e){let t=new Set(this.#j??[]);if(e)for(let e of this.#B)for(let n of OH(e))t.add(n);this.#ve(t)}#ve(e){this.#W=!0;try{for(let t of this.#pe()){let n=e.has(t),r=this.#H.isExpanded(t);n&&!r?this.#H.expand(t):!n&&r&&this.#H.collapse(t)}}finally{this.#W=!1}}#ye(){if(this.#M==null||this.#M.length===0){this.#k=[],this.#F=null,this.#I=null,this.#P=null,this.#G=this.#U;return}let e=this.#b;if(this.#k=e.filter(e=>this.#O.has(e)),this.#A!==`hide-non-matches`||this.#O.size===0){this.#F=null,this.#I=null,this.#P=null,this.#G=this.#U;return}let t=[],n=[],r=new Map;for(let[i,a]of e.entries())this.#N?.has(a)===!0&&(r.set(a,n.length),t.push(i),n.push(a));this.#F=t,this.#I=n,this.#P=r,this.#G=n.length}#be(){return this.#I??this.#b}#xe(e){return this.#I==null?this.#H.getVisibleIndex(e)??-1:this.#P?.get(e)??-1}#Se(e){return this.#F?.[e]??e}#Ce(e){return this.#P?.get(e)??this.#H.getVisibleIndex(e)??-1}#we(e){let t=this.#k;if(t.length===0)return;let n=this.#c,r=n==null?-1:t.indexOf(n),i=t[r<0?e>0?0:t.length-1:Math.min(t.length-1,Math.max(0,r+e))];i!=null&&this.focusPath(i)}#Te(e,t){let n=e==null?null:IH(e),r=this.#M;if(r!==n){if(r==null&&n!=null&&(this.#j=this.#ge()),this.#M=n,n==null)this.#_e(!0),this.#j=null,this.#O.clear(),this.#N=null,this.#je(this.#c,!0);else if(n.length===0)this.#_e(!1),this.#O.clear(),this.#N=null,this.#je(this.#c,!0);else{let e=this.#Ee();this.#je(e,!0)}t&&(this.#y?.(this.#M),this.#De())}}#Ee(){if(this.#M==null||this.#M.length===0)return this.#O.clear(),this.#c;let e=this.#M,t=this.#ue(),n=this.#fe(),r=[],i=new Set,a=null;for(let o=0;o<t.length;o+=1){if(!n[o].includes(e))continue;let s=t[o];r.push(s),i.add(s),a??=s}let o=this.#pe(),s=this.#me();for(let t=0;t<o.length;t+=1){if(!s[t].includes(e))continue;let n=o[t];i.has(n)||(r.push(n),i.add(n),a??=n)}this.#O=i;let c=this.#A===`hide-non-matches`&&r.length>0?new Set:null;this.#N=c;let l=this.#A===`expand-matches`?new Set(this.#j??[]):new Set;for(let e of r){c?.add(e),e.endsWith(`/`)&&l.add(e);for(let t of OH(e))l.add(t),c?.add(t)}return this.#ve(l),a??this.#c}#De(){for(let e of this.#t)e()}#Oe(e){this.#n.get(e.operation)?.forEach(t=>{t(e)}),this.#n.get(`*`)?.forEach(t=>{t(e)})}#ke(e){for(let t of OH(e))this.#H.isExpanded(t)||this.#H.expand(t);this.#H.isExpanded(e)||this.#H.expand(e)}#Ae(e){let t=this.#G;if(t===0)return;let n=this.#s===-1?0:this.#s,r=Math.min(t-1,Math.max(0,n+e));(r!==n||this.#s===-1)&&(!this.#l&&this.#F==null&&r>=this.#b.length&&this.#Ie(),this.#Fe(r))}#je(e,t=!0){let n=this.#H.getVisibleCount();this.#U=n;let r=HH(this.#H.getVisibleTreeProjectionData(t?void 0:Math.min(n,RH)),e,t?e=>this.#H.getVisibleIndex(e):void 0);this.#a.clear(),this.#o.clear(),this.#l=r.paths.length>=n,this.#u=r.getParentIndex,this.#b=r.paths,this.#x=r.posInSetByIndex,this.#S=r.setSizeByIndex,this.#ye(),this.#s=e==null?this.#be().length>0?0:-1:this.#Z(e),this.#c=this.#s<0?null:this.#Me(this.#s)}#Me(e){return this.#be()[e]??(this.#F==null?this.#H.getVisibleRowContext(e)?.row.path??null:null)}#Ne(e){return this.#H.getPathInfo(e)?.path??null}#Pe(e){if(e==null)return;let t=this.#Z(e);t>=0&&this.#Fe(t,!1)}#Fe(e,t=!0){let n=this.#Me(e);n!=null&&(this.#s===e&&this.#c===n||(this.#s=e,this.#c=n,t&&this.#De()))}#Ie(){this.#l||this.#je(this.#c,!0)}#Le(e){let t=SH(this.#T,e);t==null&&this.#T!=null&&(this.#E=``),this.#T=t;let n=SH(this.#c,e,!0),r=[...this.#B].map(t=>SH(t,e)).filter(e=>e!=null).map(e=>this.#H.getPathInfo(e)?.path??null).filter(e=>e!=null),i=SH(this.#z,e),a=i==null?null:this.#H.getPathInfo(i)?.path??null,o=[...new Set(r)];return DH(this.#B,o)||(this.#B=new Set(o),this.#V+=1),this.#z=a,n}#Re(){return this.#H.on(`*`,e=>{if(this.#W)return;e.canonicalChanged&&(this.#d.clear(),this.#he()),this.#i!=null&&yH(e)&&(this.#i=null);let t=yH(e)?this.#Le(e):this.#c,n=this.#M!=null&&this.#M.length>0?this.#Ee():this.#M===``?this.#c:t,r=this.#M!=null||e.operation!==`expand`&&e.operation!==`collapse`;this.#je(n,r),this.#De();let i=EH(e);i!=null&&this.#Oe(i)})}#ze(e){if(this.#H.isExpanded(e)){this.#ie(e);return}this.#ke(e)}},WH=e=>{if(e==null||e.length===0)return`0`;let t=`${e.length}`;for(let n of e)t+=`\0${n.path}\0${n.status}`;return t};function GH(e){let t=e.endsWith(`/`),n=``,r=-1;for(let t=0;t<=e.length;t+=1){if(!(e[t]===`/`||t===e.length)){r===-1&&(r=t);continue}r!==-1&&(n!==``&&(n+=`/`),n+=e.slice(r,t),r=-1)}return n===``?null:{isDirectory:t,path:n}}function KH(e){let t=e.endsWith(`/`)?e.slice(0,-1):e;if(t.length===0)return[];let n=t.split(`/`);return n.slice(0,-1).map((e,t)=>`${n.slice(0,t+1).join(`/`)}/`)}function qH(e,t){return t?`${e}/`:e}function JH(e,t=null){let n=WH(e==null?void 0:[...e]);if(n===`0`)return null;if(t?.signature===n)return t;let r=new Map,i=new Set,a=new Set;for(let t of e??[]){let e=GH(t.path);if(e==null)continue;let n=qH(e.path,e.isDirectory);r.set(n,t.status),t.status===`ignored`&&e.isDirectory?a.add(n):e.isDirectory&&a.delete(n);for(let t of KH(e.path))i.add(t)}return{directoriesWithChanges:i,ignoredDirectoryPaths:a,signature:n,statusByPath:r}}var YH,XH,ZH,QH,$H,eU,tU,nU,rU,iU,aU={},oU=[],sU=Array.isArray,cU=oU.slice,lU=Object.assign;function uU(e){e&&e.parentNode&&e.remove()}function dU(e,t,n){var r,i,a,o={};for(a in t)a==`key`?r=t[a]:a==`ref`&&typeof e!=`function`?i=t[a]:o[a]=t[a];return arguments.length>2&&(o.children=arguments.length>3?cU.call(arguments,2):n),fU(e,o,r,i,null)}function fU(e,t,n,r,i){var a={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++XH,__i:-1,__u:0};return i==null&&YH.vnode!=null&&YH.vnode(a),a}function pU(e){return e.children}function mU(e,t){this.props=e,this.context=t,this.__g=0}function hU(e,t){if(t==null)return e.__?hU(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type==`function`?hU(e):null}function gU(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=n.__e;break}return gU(e)}}function _U(e){(8&e.__g||!(e.__g|=8)||!ZH.push(e)||$H++)&&QH==YH.debounceRendering||((QH=YH.debounceRendering)||queueMicrotask)(vU)}function vU(){for(var e,t,n,r,i,a,o,s,c=1;ZH.length;)ZH.length>c&&ZH.sort(eU),e=ZH.shift(),c=ZH.length,8&e.__g&&(n=void 0,i=(r=(t=e).__v).__e,a=[],o=[],(s=t.__P)&&((n=lU({},r)).__v=r.__v+1,YH.vnode&&YH.vnode(n),EU(s,n,r,t.__n,s.namespaceURI,32&r.__u?[i]:null,a,i??hU(r),!!(32&r.__u),o,s.ownerDocument),n.__v=r.__v,n.__.__k[n.__i]=n,OU(a,n,o),n.__e!=i&&gU(n)));$H=0}function yU(e,t,n,r,i,a,o,s,c,l,u,d){var f,p,m,h,g,_,v,y=r&&r.__k||oU,b=t.length;for(c=bU(n,t,y,c,b),f=0;f<b;f++)(m=n.__k[f])!=null&&(p=m.__i==-1?aU:y[m.__i]||aU,m.__i=f,_=EU(e,m,p,i,a,o,s,c,l,u,d),h=m.__e,m.ref&&p.ref!=m.ref&&(p.ref&&jU(p.ref,null,m),u.push(m.ref,m.__c||h,m)),g==null&&h!=null&&(g=h),(v=!!(4&m.__u))||p.__k===m.__k?c=xU(m,c,e,v):typeof m.type==`function`&&_!==void 0?c=_:h&&(c=h.nextSibling),m.__u&=-7);return n.__e=g,c}function bU(e,t,n,r,i){var a,o,s,c,l,u=n.length,d=u,f=0;for(e.__k=Array(i),a=0;a<i;a++)(o=t[a])!=null&&typeof o!=`boolean`&&typeof o!=`function`?(c=a+f,(o=e.__k[a]=typeof o==`string`||typeof o==`number`||typeof o==`bigint`||o.constructor==String?fU(null,o,null,null,null):sU(o)?fU(pU,{children:o},null,null,null):o.constructor==null&&o.__b>0?fU(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=e,o.__b=e.__b+1,s=null,(l=o.__i=SU(o,n,c,d))!=-1&&(d--,(s=n[l])&&(s.__u|=2)),s==null||s.__v==null?(l==-1&&(i>u?f--:i<u&&f++),typeof o.type!=`function`&&(o.__u|=4)):l!=c&&(l==c-1?f--:l==c+1?f++:(l>c?f--:f++,o.__u|=4))):e.__k[a]=null;if(d)for(a=0;a<u;a++)(s=n[a])!=null&&!(2&s.__u)&&(s.__e==r&&(r=hU(s)),MU(s,s));return r}function xU(e,t,n,r){var i,a;if(typeof e.type==`function`){for(i=e.__k,a=0;i&&a<i.length;a++)i[a]&&(i[a].__=e,t=xU(i[a],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=hU(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t&&=t.nextSibling;while(t!=null&&t.nodeType==8);return t}function SU(e,t,n,r){var i,a,o,s=e.key,c=e.type,l=t[n],u=l!=null&&(2&l.__u)==0;if(l===null&&e.key==null||u&&s==l.key&&c==l.type)return n;if(r>+!!u){for(i=n-1,a=n+1;i>=0||a<t.length;)if((l=t[o=i>=0?i--:a++])!=null&&!(2&l.__u)&&s==l.key&&c==l.type)return o}return-1}function CU(e,t,n){t[0]==`-`?e.setProperty(t,n??``):e[t]=n??``}function wU(e,t,n,r,i){var a;n:if(t==`style`)if(typeof n==`string`)e.style.cssText=n;else{if(typeof r==`string`&&(e.style.cssText=r=``),r)for(t in r)n&&t in n||CU(e.style,t,``);if(n)for(t in n)r&&n[t]==r[t]||CU(e.style,t,n[t])}else if(t[0]==`o`&&t[1]==`n`)a=t!=(t=t.replace(tU,`$1`)),(t=t.slice(2))[0].toLowerCase()!=t[0]&&(t=t.toLowerCase()),e.__l||={},e.__l[t+a]=n,n?r?n.l=r.l:(n.l=nU,e.addEventListener(t,a?iU:rU,a)):e.removeEventListener(t,a?iU:rU,a);else{if(i==`http://www.w3.org/2000/svg`)t=t.replace(/xlink(H|:h)/,`h`).replace(/sName$/,`s`);else if(t!=`width`&&t!=`height`&&t!=`href`&&t!=`list`&&t!=`form`&&t!=`tabIndex`&&t!=`download`&&t!=`rowSpan`&&t!=`colSpan`&&t!=`role`&&t!=`popover`&&t in e)try{e[t]=n??``;break n}catch{}typeof n==`function`||(n==null||!1===n&&t[4]!=`-`?e.removeAttribute(t):e.setAttribute(t,t==`popover`&&n==1?``:n))}}function TU(e){return function(t){if(this.__l){var n=this.__l[t.type+e];if(t.u==null)t.u=nU++;else if(t.u<n.l)return;return n(YH.event?YH.event(t):t)}}}function EU(e,t,n,r,i,a,o,s,c,l,u){var d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,k,A,j,M=t.type;if(t.constructor!=null)return null;128&n.__u&&(c=!!(32&n.__u),n.__c.__z&&(s=t.__e=n.__e=(a=n.__c.__z)[0],n.__c.__z=null)),(d=YH.__b)&&d(t);n:if(typeof M==`function`)try{if(v=t.props,y=`prototype`in M&&M.prototype.render,b=(d=M.contextType)&&r[d.__c],x=d?b?b.props.value:d.__:r,n.__c?2&(f=t.__c=n.__c).__g&&(f.__g|=1,_=!0):(y?t.__c=f=new M(v,x):(t.__c=f=new mU(v,x),f.constructor=M,f.render=NU),b&&b.sub(f),f.props=v,f.state||={},f.context=x,f.__n=r,p=!0,f.__g|=8,f.__h=[],f._sb=[]),y&&f.__s==null&&(f.__s=f.state),y&&M.getDerivedStateFromProps!=null&&(f.__s==f.state&&(f.__s=lU({},f.__s)),lU(f.__s,M.getDerivedStateFromProps(v,f.__s))),m=f.props,h=f.state,f.__v=t,p)y&&M.getDerivedStateFromProps==null&&f.componentWillMount!=null&&f.componentWillMount(),y&&f.componentDidMount!=null&&f.__h.push(f.componentDidMount);else{if(y&&M.getDerivedStateFromProps==null&&v!==m&&f.componentWillReceiveProps!=null&&f.componentWillReceiveProps(v,x),!(4&f.__g)&&f.shouldComponentUpdate!=null&&!1===f.shouldComponentUpdate(v,f.__s,x)||t.__v==n.__v){for(t.__v!=n.__v&&(f.props=v,f.state=f.__s,f.__g&=-9),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(e){e&&(e.__=t)}),S=0;S<f._sb.length;S++)f.__h.push(f._sb[S]);f._sb=[],f.__h.length&&o.push(f);break n}f.componentWillUpdate!=null&&f.componentWillUpdate(v,f.__s,x),y&&f.componentDidUpdate!=null&&f.__h.push(function(){f.componentDidUpdate(m,h,g)})}if(f.context=x,f.props=v,f.__P=e,f.__g&=-5,C=YH.__r,w=0,y){for(f.state=f.__s,f.__g&=-9,C&&C(t),d=f.render(f.props,f.state,f.context),T=0;T<f._sb.length;T++)f.__h.push(f._sb[T]);f._sb=[]}else do f.__g&=-9,C&&C(t),d=f.render(f.props,f.state,f.context),f.state=f.__s;while(8&f.__g&&++w<25);f.state=f.__s,f.getChildContext!=null&&(r=lU({},r,f.getChildContext())),y&&!p&&f.getSnapshotBeforeUpdate!=null&&(g=f.getSnapshotBeforeUpdate(m,h)),E=d,d!=null&&d.type===pU&&d.key==null&&(E=kU(d.props.children)),s=yU(e,sU(E)?E:[E],t,n,r,i,a,o,s,c,l,u),t.__u&=-161,f.__h.length&&o.push(f),_&&(f.__g&=-4)}catch(e){if(t.__v=null,c||a!=null)if(e.then){for(D=0,O=!1,t.__u|=c?160:128,t.__c.__z=[],k=0;k<a.length;k++)(A=a[k])==null||O||(A.nodeType==8&&A.data==`$s`?(D>0&&t.__c.__z.push(A),D++,a[k]=null):A.nodeType==8&&A.data==`/$s`?(--D>0&&t.__c.__z.push(A),O=D===0,s=a[k],a[k]=null):D>0&&(t.__c.__z.push(A),a[k]=null));if(!O){for(;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;a[a.indexOf(s)]=null,t.__c.__z=[s]}t.__e=s}else{for(j=a.length;j--;)uU(a[j]);DU(t)}else t.__e=n.__e,t.__k=n.__k,e.then||DU(t);YH.__e(e,t,n)}else s=t.__e=AU(n.__e,t,n,r,i,a,o,c,l,u);return(d=YH.diffed)&&d(t),128&t.__u?void 0:s}function DU(e){e&&e.__c&&(e.__c.__g|=4),e&&e.__k&&e.__k.forEach(DU)}function OU(e,t,n){for(var r=0;r<n.length;r++)jU(n[r],n[++r],n[++r]);YH.__c&&YH.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){YH.__e(e,t.__v)}})}function kU(e){return typeof e!=`object`||!e||e.__b&&e.__b>0?e:sU(e)?e.map(kU):lU({},e)}function AU(e,t,n,r,i,a,o,s,c,l){var u,d,f,p,m,h,g,_,v=n.props,y=t.props,b=t.type;if(b==`svg`?i=`http://www.w3.org/2000/svg`:b==`math`?i=`http://www.w3.org/1998/Math/MathML`:i||=`http://www.w3.org/1999/xhtml`,a!=null){for(u=0;u<a.length;u++)if((m=a[u])&&`setAttribute`in m==!!b&&(b?m.localName==b:m.nodeType==3)){e=m,a[u]=null;break}}if(e==null){if(b==null)return l.createTextNode(y);e=l.createElementNS(i,b,y.is&&y),s&&=(YH.__m&&YH.__m(t,a),!1),a=null}if(b==null)v===y||s&&e.data==y||(e.data=y);else{if(a&&=cU.call(e.childNodes),v=n.props||aU,!s&&a!=null)for(v={},u=0;u<e.attributes.length;u++)v[(m=e.attributes[u]).name]=m.value;for(u in v)if(m=v[u],u!=`children`){if(u==`dangerouslySetInnerHTML`)f=m;else if(!(u in y)){if(u==`value`&&`defaultValue`in y||u==`checked`&&`defaultChecked`in y)continue;wU(e,u,null,m,i)}}for(u in _=1&n.__u,y)m=y[u],u==`children`?p=m:u==`dangerouslySetInnerHTML`?d=m:u==`value`?h=m:u==`checked`?g=m:s&&typeof m!=`function`||v[u]===m&&!_||wU(e,u,m,v[u],i);if(d)s||f&&(d.__html==f.__html||d.__html==e.innerHTML)||(e.innerHTML=d.__html),t.__k=[];else if(f&&(e.innerHTML=``),yU(b==`template`?e.content:e,sU(p)?p:[p],t,n,r,b==`foreignObject`?`http://www.w3.org/1999/xhtml`:i,a,o,a?a[0]:n.__k&&hU(n,0),s,c,l),a!=null)for(u=a.length;u--;)uU(a[u]);s||(u=`value`,b==`progress`&&h==null?e.removeAttribute(`value`):h==null||h===e[u]&&(b!==`progress`||h)||wU(e,u,h,v[u],i),u=`checked`,g!=null&&g!=e[u]&&wU(e,u,g,v[u],i))}return e}function jU(e,t,n){try{if(typeof e==`function`){var r=typeof e.__u==`function`;r&&e.__u(),r&&t==null||(e.__u=e(t))}else e.current=t}catch(e){YH.__e(e,n)}}function MU(e,t,n){var r,i;if(YH.unmount&&YH.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||jU(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){YH.__e(e,t)}r.__P=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&MU(r[i],t,n||typeof e.type!=`function`);n||uU(e.__e),e.__e&&e.__e.__l&&(e.__e.__l=null),e.__e=e.__c=e.__=null}function NU(e,t,n){return this.constructor(e,n)}function PU(e,t){var n,r,i,a;t==document&&(t=document.documentElement),YH.__&&YH.__(e,t),r=(n=!!(e&&32&e.__u))?null:t.__k,e=t.__k=dU(pU,null,[e]),i=[],a=[],EU(t,e,r||aU,aU,t.namespaceURI,r?null:t.firstChild?cU.call(t.childNodes):null,i,r?r.__e:t.firstChild,n,a,t.ownerDocument),OU(i,e,a)}function FU(e,t){e.__u|=32,PU(e,t)}YH={__e:function(e,t,n,r){for(var i,a,o;t=t.__;)if((i=t.__c)&&!(1&i.__g)){i.__g|=4;try{if((a=i.constructor)&&a.getDerivedStateFromError!=null&&(i.setState(a.getDerivedStateFromError(e)),o=8&i.__g),i.componentDidCatch!=null&&(i.componentDidCatch(e,r||{}),o=8&i.__g),o)return void(i.__g|=2)}catch(t){e=t}}throw $H=0,e}},XH=0,mU.prototype.setState=function(e,t){var n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=lU({},this.state);typeof e==`function`&&(e=e(lU({},n),this.props)),e&&lU(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),_U(this))},mU.prototype.forceUpdate=function(e){this.__v&&(this.__g|=4,e&&this.__h.push(e),_U(this))},mU.prototype.render=pU,ZH=[],$H=0,eU=function(e,t){return e.__v.__b-t.__v.__b},tU=/(PointerCapture)$|Capture$/i,nU=0,rU=TU(!1),iU=TU(!0);var IU=0;Array.isArray;function LU(e,t,n,r,i,a){t||={};var o,s,c=t;if(`ref`in c&&typeof e!=`function`)for(s in c={},t)s==`ref`?o=t[s]:c[s]=t[s];var l={type:e,props:c,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--IU,__i:-1,__u:0,__source:i,__self:a};return YH.vnode&&YH.vnode(l),l}var RU=16,zU=16,BU={};function VU({name:e,remappedFrom:t,token:n,width:r,height:i,viewBox:a,label:o,alignCapitals:s=!1}){"use no memo";let c=`#${e.replace(/^#/,``)}`,{width:l,height:u,viewBox:d}=BU[e]??{width:RU,height:zU},f=r??l,p=i??u,m=a??d??`0 0 ${l} ${u}`;return LU(`svg`,{"data-icon-name":t??e,"data-icon-token":n,"data-align-capitals":s,...o==null?{"aria-hidden":!0}:{"aria-label":o,role:`img`},viewBox:m,width:f,height:p,children:LU(`use`,{href:c})})}var HU=e=>{if(e.length<2)return[e,``];let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]},UU=e=>{if(e.length<4)return[e,``];let t=e.lastIndexOf(`.`)+1,n=e.length-t>10,r=t>=1&&!n?t:Math.ceil(e.length/2);return[e.slice(0,r),e.slice(r)]},WU=e=>{if(e.length<4)return[e,``];let t=e.lastIndexOf(`/`)+1,n=e.length-t>25,r=t>=1&&!n?t:Math.ceil(e.length/2);return[e.slice(0,r),e.slice(r)]},GU=(e,{splitIndex:t}={})=>{if(typeof t!=`number`){let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]}return[e.slice(0,t),e.slice(t)]},KU=(e,{splitOffset:t}={})=>{if(typeof t!=`number`||t<=0||t>=e.length){let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]}let n=e.length-t;return[e.slice(0,n),e.slice(n)]},qU=(e,{splitOffset:t}={})=>{if(typeof t!=`number`||t<=0||t>=e.length){let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]}let n=t;return[e.slice(0,n),e.slice(n)]};function JU({children:e,marker:t,variant:n=`default`}){"use no memo";return LU(`div`,{"aria-hidden":!0,"data-truncate-marker-cell":!0,children:LU(`div`,{"data-truncate-marker":!0,children:typeof t==`function`?t({children:e}):n===`fade`?LU(`span`,{"data-truncate-fade":!0}):t})})}function YU(e){"use no memo";let{mode:t,children:n}=e;return LU(`div`,{children:[LU(`div`,{"data-truncate-content":`visible`,children:t===`fruncate`?LU(`span`,{children:n}):n}),LU(`div`,{"data-truncate-content":`overflow`,"aria-hidden":!0,children:t===`fruncate`?LU(`span`,{children:n}):n})]})}function XU({children:e,mode:t=`truncate`,marker:n=`…`,variant:r=`default`,...i}){"use no memo";let a=LU(YU,{mode:t,children:e},`content`),o=LU(JU,{marker:n,mode:t,variant:r},`marker`),s=LU(`div`,{"data-truncate-fill":!0},`fill`);return LU(`div`,{"data-truncate-container":t,"data-truncate-variant":r,...i,children:LU(`div`,{"data-truncate-grid":!0,children:t===`truncate`?[a,o]:[o,a,s]})})}function ZU({children:e,...t}){"use no memo";return LU(XU,{mode:`truncate`,...t,children:e})}function QU({children:e,...t}){"use no memo";return LU(XU,{mode:`fruncate`,...t,children:e})}function $U({children:e,contents:t,priority:n=`end`,split:r=`center`,minimumLength:i=12,className:a,style:o,...s}){"use no memo";let c=null,l=null;if(Array.isArray(t)){if(t.length!==2)return console.error(`MiddleTruncate: contents must be an array of two items`),null;c=LU(ZU,{...s,children:t[0]}),l=LU(QU,{...s,children:t[1]})}else{if(typeof e!=`string`)return console.error(`MiddleTruncate: children must be a string`),null;if(e.length===0)return LU(`div`,{className:a,style:o});if(e.length<i)return LU(n===`end`?QU:ZU,{...s,className:a,style:o,children:e});let t=null,u=null,d=null;if(typeof r==`string`)r===`center`?t=HU:r===`extension`?t=UU:r===`leaf-path`&&(t=WU);else if(typeof r==`number`)t=GU,u=r;else if(Array.isArray(r)){let[e,n]=r;d=n,e===`last`?t=KU:e===`first`&&(t=qU)}else typeof r==`function`&&(t=r);t??=HU;let[f,p]=t(e,{priority:n,variant:s.variant,splitIndex:typeof u==`number`?u:void 0,splitOffset:typeof d==`number`?d:void 0}),m=f.length>=p.length,h=n===`equal`&&!m,g=n===`equal`&&m,_={},v={};h&&(_.marker=``),g&&(v.marker=``),c=LU(ZU,{...s,..._,children:f}),l=LU(QU,{...s,...v,children:p})}return LU(`div`,{"data-truncate-group-container":`middle`,className:a,style:o,children:[LU(`div`,{"data-truncate-segment-priority":n===`start`||n===`equal`?`1`:`2`,children:c}),LU(`div`,{"data-truncate-segment-priority":n===`end`||n===`equal`?`1`:`2`,children:l})]})}var eW={endIndex:-1,startIndex:-1};function tW(e,t,n){return Math.min(Math.max(e,t),n)}function nW(e,t){return e<0||t<e?eW:{endIndex:t,startIndex:e}}function rW(e){return e.startIndex<0||e.endIndex<e.startIndex}function iW(e,t){return rW(e)?0:(e.endIndex-e.startIndex+1)*t}function aW(e,t,n){if(t<=0)return-1;let r=t*n;return e<=0?0:e>=r?t:Math.floor(e/n)}function oW(e,t,n){return t<=0||e<=0?-1:e>=t*n?t-1:Math.ceil(e/n)-1}function sW(e){let t=new Map;return e.forEach((e,n)=>{if(e.kind!==`directory`||!e.isExpanded)return;let r=e.ancestorPaths.length,i=t.get(r);if(i==null){t.set(r,[n]);return}i.push(n)}),t}function cW(e,t){let n=0,r=e.length-1,i=-1;for(;n<=r;){let a=Math.floor((n+r)/2),o=e[a];if(o==null)break;if(o<=t){i=a,n=a+1;continue}r=a-1}return i}function lW(e){let t=new Map,n=[];for(let r=0;r<e.length;r+=1){let i=e[r];if(i==null)continue;let a=i.kind===`directory`&&i.isExpanded?[...i.ancestorPaths,i.path]:i.ancestorPaths,o=0;for(;o<n.length&&o<a.length&&n[o]===a[o];)o+=1;for(let e=n.length-1;e>=o;--e){let i=n[e];i!=null&&t.set(i,r-1)}n.length=o;for(let e=o;e<a.length;e+=1){let t=a[e];t!=null&&n.push(t)}}let r=e.length-1;for(let e of n)t.set(e,r);return t}function uW(e,t,n){if(e.length===0||t<=0)return[];let r=lW(e),i=sW(e),a=[];for(let r=0;r<e.length;r+=1){let o=i.get(r);if(o==null||o.length===0)break;let s=t+r*n,c=cW(o,Math.min(e.length-1,Math.floor(s/n))),l=null;for(;c>=0;){let t=o[c],n=t==null?null:e[t]??null;if(n!=null&&(r===0||n.ancestorPaths[r-1]===a[r-1]?.path)){l=n;break}--c}if(l==null)break;a.push(l)}return a.map((i,a)=>{let o=a*n,s=(r.get(i.path)??e.length-1)+1;if(s>=e.length)return{row:i,top:o};let c=s*n-t;return{row:i,top:Math.min(o,c-n)}}).filter(e=>e.top+n>0)}function dW(e,t){let n=t.totalRowCount??e.length,r=n*t.itemHeight,i=Math.max(0,t.viewportHeight),a=Math.max(0,Math.floor(t.overscan)),o=Math.max(0,r-i),s=tW(t.scrollTop,0,o),c=t.stickyRows??uW(e,s,t.itemHeight),l=c.reduce((e,n)=>Math.max(e,n.top+t.itemHeight),0),u=Math.min(r,s+l),d=Math.max(0,i-l),f=Math.max(0,r-u),p=aW(s,n,t.itemHeight),m=aW(u,n,t.itemHeight),h=l<=0||p<0||p>=n?-1:p,g=h===-1?-1:Math.min(n-1,m-1),_=h===-1||g<h?0:g-h+1,v=d<=0||m>=n?eW:nW(m,oW(u+d,n,t.itemHeight)),y=g+1,b=rW(v)?eW:nW(Math.max(y,v.startIndex-a),Math.min(n-1,v.endIndex+a)),x=iW(b,t.itemHeight);return{occlusion:{firstOccludedIndex:h,lastOccludedIndex:g,occludedCount:_},physical:{itemHeight:t.itemHeight,maxScrollTop:o,overscan:a,scrollTop:s,totalHeight:r,totalRowCount:n,viewportHeight:i},projected:{contentHeight:f,paneHeight:d,paneTop:u},sticky:{height:l,rows:c},visible:v,window:{endIndex:b.endIndex,height:x,offsetTop:rW(b)?0:b.startIndex*t.itemHeight,startIndex:b.startIndex}}}var fW={added:`A`,deleted:`D`,ignored:null,modified:`M`,renamed:`R`,untracked:`U`},pW={added:`Git status: added`,deleted:`Git status: deleted`,ignored:`Git status: ignored`,modified:`Git status: modified`,renamed:`Git status: renamed`,untracked:`Git status: untracked`},mW=`Contains git status items`;function hW(e){let{currentScrollTop:t,focusedIndex:n,itemHeight:r,topInset:i=0,viewportHeight:a}=e;if(n<0)return null;let o=Math.max(0,i),s=n*r,c=s+r;if(s<t+o){let e=Math.max(0,s-o);return e===t?null:e}if(c>t+a){let e=c-a;return e===t?null:e}return null}function gW(e){let{currentScrollTop:t,focusedIndex:n,itemHeight:r,offset:i,topInset:a=0,totalHeight:o,viewportHeight:s}=e;if(i===`nearest`)return hW({currentScrollTop:t,focusedIndex:n,itemHeight:r,topInset:a,viewportHeight:s});if(n<0)return null;let c=Math.max(0,a),l=n*r,u=Math.max(0,s-c),d=i===`center`?c+Math.max(0,(u-r)/2):c,f=Math.max(0,o-s),p=Math.max(0,Math.min(l-d,f));return p===t?null:p}function _W(e){let{currentScrollTop:t,focusedIndex:n,itemHeight:r,targetViewportOffset:i,totalHeight:a,viewportHeight:o}=e;if(n<0)return null;let s=Math.max(0,i),c=n*r,l=c+r,u=t+s,d=t+o;if(c>=u&&l<=d)return null;let f=Math.max(0,a-o),p=Math.max(0,Math.min(c-s,f));return p===t?null:p}function vW(e){if(e==null||!e.isConnected||e===document.body||e===document.documentElement)return!1;e.focus({preventScroll:!0});let t=e.getRootNode();return t instanceof ShadowRoot?t.activeElement===e:document.activeElement===e}function yW(e){let t=e.getRootNode();if(t instanceof ShadowRoot){let e=t.activeElement;return e instanceof HTMLElement?e:null}let n=document.activeElement;return n instanceof HTMLElement&&e.contains(n)?n:null}function bW(e,t){if(e==null)return t;let n=e.getBoundingClientRect().height;return n>0?n:e.clientHeight>0?e.clientHeight:t}function xW(e,t){return e!=null&&e>0?e:t}function SW(e){let t=e.borderBoxSize,n=Array.isArray(t)?t[0]:t;return n!=null&&Number.isFinite(n.blockSize)&&n.blockSize>0?n.blockSize:e.contentRect.height>0?e.contentRect.height:null}function CW(e,t,n,r,i=0){let a=hW({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,topInset:i,viewportHeight:r});return a==null?!1:(e.scrollTop=a,!0)}function wW(e,t,n,r,i,a,o=0){let s=gW({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,offset:a,topInset:o,totalHeight:i,viewportHeight:r});return s==null?!1:(e.scrollTop=s,!0)}function TW(e,t,n,r,i,a){let o=_W({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,targetViewportOffset:a,totalHeight:i,viewportHeight:r});return o==null?!1:(e.scrollTop=o,!0)}function EW(e,t,n,r){return n.end<n.start?null:e<n.start?-t:e>n.end?r:null}function DW(e){let{renamingPath:t,previousRenamingPath:n,hasRenderedInput:r}=e;return t==null?`reset`:r?n===t?`ignore`:`focus-input`:`reveal-canonical`}function OW({ariaLabel:e,isFlattened:t=!1,ref:n,value:r,onBlur:i,onInput:a}){return LU(`input`,{ref:n,"data-item-rename-input":!0,...t?{"data-item-flattened-rename-input":!0}:{},"aria-label":e,value:r,onBlur:i,onInput:a,onClick:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation()})}function kW(e){let{row:t,mode:n,targetPath:r,ariaLabel:i,domId:a,isParked:o,itemHeight:s,features:c,state:l,extraStyle:u}=e,d=n===`sticky`,f=t.ancestorPaths.at(-1)??``,p={};return l.isFocusRinged&&(p[`data-item-focused`]=!0),t.isSelected&&(p[`data-item-selected`]=!0),l.isContextHovered&&(p[`data-item-context-hover`]=`true`),l.isDragTarget&&(p[`data-item-drag-target`]=!0),l.isDragging&&(p[`data-item-dragging`]=!0),l.effectiveGitStatus!=null&&(p[`data-item-git-status`]=l.effectiveGitStatus),l.containsGitChange&&(p[`data-item-contains-git-change`]=`true`),{"aria-expanded":!d&&t.kind===`directory`?t.isExpanded:void 0,"aria-haspopup":c.contextMenuEnabled?`menu`:void 0,"aria-label":i,"aria-level":d?void 0:t.level+1,"aria-posinset":d?void 0:t.posInSet+1,"aria-selected":d?void 0:t.isSelected?`true`:`false`,"aria-setsize":d?void 0:t.setSize,"data-file-tree-sticky-path":d?r:void 0,"data-file-tree-sticky-row":d?`true`:void 0,"data-item-context-menu-button-visibility":c.actionLaneEnabled?c.contextMenuButtonVisibility:void 0,"data-item-context-menu-trigger-mode":c.contextMenuEnabled?c.contextMenuTriggerMode:void 0,"data-item-has-context-menu-action-lane":c.actionLaneEnabled?`true`:void 0,"data-item-has-git-lane":c.gitLaneActive?`true`:void 0,"data-item-parent-path":f.length>0?f:void 0,"data-item-parked":o?`true`:void 0,"data-item-path":r,"data-item-type":t.kind===`directory`?`folder`:`file`,"data-type":`item`,id:d?void 0:a,role:d?void 0:`treeitem`,style:{minHeight:`${s}px`,...u},tabIndex:!d&&t.isFocused?0:-1,...p}}function AW(e){let{event:t,mode:n,isSearchOpen:r,isDirectory:i}=e,a=t.ctrlKey||t.metaKey,o=t.shiftKey||a,s=t.shiftKey?{additive:a,kind:`range`}:a?{kind:`toggle`}:{kind:`single`};return{closeSearch:r,revealCanonical:n===`sticky`,selection:s,toggleDirectory:!o&&i}}var jW,MW,NW,PW,FW=Object.is,IW=0,LW=[],RW=YH,zW=RW.__b,BW=RW.__r,VW=RW.diffed,HW=RW.__c,UW=RW.unmount,WW=RW.__;function GW(e,t){RW.__h&&RW.__h(MW,e,IW||t),IW=0;var n=MW.__H||={__:[],__h:[]};return e>=n.__.length&&n.__.push({}),n.__[e]}function KW(e){return IW=1,qW(aG,e)}function qW(e,t,n){var r=GW(jW++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):aG(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);FW(t,n)||(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=MW,!MW.__f)){var i=function(e,t,n){if(!r.__c.__H)return!0;var i=r.__c.__H.__.filter(function(e){return!!e.__c});if(i.every(function(e){return!e.__N}))return!a||a.call(this,e,t,n);var o=r.__c.props!==e;return i.forEach(function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,FW(t,e.__[0])||(o=!0)}}),a&&a.call(this,e,t,n)||o};MW.__f=!0;var a=MW.shouldComponentUpdate,o=MW.componentWillUpdate;MW.componentWillUpdate=function(e,t,n){if(4&this.__g){var r=a;a=void 0,i(e,t,n),a=r}o&&o.call(this,e,t,n)},MW.shouldComponentUpdate=i}return r.__N||r.__}function JW(e,t){var n=GW(jW++,3);!RW.__s&&iG(n.__H,t)&&(n.__=e,n.u=t,MW.__H.__h.push(n))}function YW(e,t){var n=GW(jW++,4);!RW.__s&&iG(n.__H,t)&&(n.__=e,n.u=t,MW.__h.push(n))}function XW(e){return IW=5,ZW(function(){return{current:e}},[])}function ZW(e,t){var n=GW(jW++,7);return iG(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function QW(e,t){return IW=8,ZW(function(){return e},t)}function $W(){for(var e;e=LW.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(nG),e.__H.__h.forEach(rG),e.__H.__h=[]}catch(t){e.__H.__h=[],RW.__e(t,e.__v)}}RW.__b=function(e){MW=null,zW&&zW(e)},RW.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),WW&&WW(e,t)},RW.__r=function(e){BW&&BW(e),jW=0;var t=(MW=e.__c).__H;t&&(NW===MW?(t.__h=[],MW.__h=[],t.__.forEach(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.forEach(nG),t.__h.forEach(rG),t.__h=[],jW=0)),NW=MW},RW.diffed=function(e){VW&&VW(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(LW.push(t)!==1&&PW===RW.requestAnimationFrame||((PW=RW.requestAnimationFrame)||tG)($W)),t.__H.__.forEach(function(e){e.u&&(e.__H=e.u),e.u=void 0})),NW=MW=null},RW.__c=function(e,t){t.some(function(e){try{e.__h.forEach(nG),e.__h=e.__h.filter(function(e){return!e.__||rG(e)})}catch(n){t.some(function(e){e.__h&&=[]}),t=[],RW.__e(n,e.__v)}}),HW&&HW(e,t)},RW.unmount=function(e){UW&&UW(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(e){try{nG(e)}catch(e){t=e}}),n.__H=void 0,t&&RW.__e(t,n.__v))};var eG=typeof requestAnimationFrame==`function`;function tG(e){var t,n=function(){clearTimeout(r),eG&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);eG&&(t=requestAnimationFrame(n))}function nG(e){var t=MW,n=e.__c;typeof n==`function`&&(e.__c=void 0,n()),MW=t}function rG(e){var t=MW;e.__c=e.__(),MW=t}function iG(e,t){return!e||e.length!==t.length||t.some(function(t,n){return!FW(t,e[n])})}function aG(e,t){return typeof t==`function`?t(e):t}function oG(e,t=null,n=null){"use no memo";let r=e.flattenedSegments;return r==null||r.length===0?t??e.name:LU(`span`,{"data-item-flattened-subitems":!0,children:r.map((e,i)=>{let a=i===r.length-1;return LU(pU,{children:[LU(`span`,{"data-item-flattened-subitem":e.path,"data-item-flattened-subitem-drag-target":n===e.path?`true`:void 0,children:a&&t!=null?t:LU(ZU,{children:e.name})}),i<r.length-1?` / `:``]},e.path)})})}function sG(e){return e.isFlattened?e.flattenedSegments?.findLast(e=>e.isTerminal)?.path??e.path:e.path}function cG(e){let t=e.flattenedSegments;return t==null||t.length===0?e.name:t.map(e=>e.name).join(` / `)}function lG(e,t,n,r){return e.map((e,i)=>{let a=i*n,o=e.subtreeEndIndex+1;if(o>=r)return{row:e.row,top:a};let s=o*n-t;return{row:e.row,top:Math.min(a,s-n)}}).filter(e=>e.top+n>0)}function uG({controller:e,itemHeight:t,overscan:n,scrollTop:r,stickyFolders:i,viewportHeight:a}){let o=e.getVisibleCount(),s=i&&o>0?e.getStickyRowCandidates(r,t):[],c=s==null&&i&&o>0?e.getVisibleRows(0,o-1):[],l=dW(c,{itemHeight:t,overscan:n,scrollTop:r,stickyRows:s==null?void 0:lG(s,r,t,o),totalRowCount:o,viewportHeight:a}),u=i&&r<=0&&o>0?e.getStickyRowCandidates(1,t):[],d=u!=null&&r<=0?lG(u,1,t,o):i&&r<=0&&c.length>0?uW(c,1,t):l.sticky.rows;return{overlayHeight:d.reduce((e,n)=>Math.max(e,n.top+t),0),overlayRows:d,snapshot:l,visibleRows:c}}var dG=400,fG=10,pG=40,mG=18;function hG(e,t,n){let r=e,i=document.elementFromPoint?.bind(document)??null,a=r.elementFromPoint?.(t,n)??i?.(t,n)??null;return e instanceof ShadowRoot&&(a==null||!e.contains(a))?gG(e,t,n):a instanceof HTMLElement?a:null}function gG(e,t,n){let r=Array.from(e.querySelectorAll(`[data-type="item"], [data-item-flattened-subitem]`));for(let e=r.length-1;e>=0;e--){let i=r[e],a=i.getBoundingClientRect();if(t>=a.left&&t<=a.right&&n>=a.top&&n<=a.bottom)return i}return null}function _G(e){let t=e?.closest?.(`[data-type="item"]`);if(!(t instanceof HTMLElement))return e?.closest?.(`[data-file-tree-virtualized-scroll]`)instanceof HTMLElement?{directoryPath:null,flattenedSegmentPath:null,hoveredPath:null,kind:`root`}:null;let n=t.dataset.itemPath??null;if(n==null)return null;let r=e?.closest?.(`[data-item-flattened-subitem]`),i=r instanceof HTMLElement?r.getAttribute(`data-item-flattened-subitem`)??null:null;if(i!=null&&i.endsWith(`/`))return{directoryPath:i,flattenedSegmentPath:i,hoveredPath:n,kind:`directory`};if(t.dataset.itemType===`folder`)return{directoryPath:n,flattenedSegmentPath:null,hoveredPath:n,kind:`directory`};let a=t.dataset.itemParentPath??null;return a==null||a.length===0?{directoryPath:null,flattenedSegmentPath:null,hoveredPath:n,kind:`root`}:{directoryPath:a,flattenedSegmentPath:null,hoveredPath:n,kind:`directory`}}function vG(e){let t=e.cloneNode(!0);return t.removeAttribute(`id`),t.dataset.fileTreeDragPreview=`true`,t.setAttribute(`aria-hidden`,`true`),t.tabIndex=-1,Object.assign(t.style,{boxShadow:`0 4px 12px rgba(0, 0, 0, 0.15)`,left:`0px`,margin:`0`,pointerEvents:`none`,position:`fixed`,top:`0px`,willChange:`transform`,zIndex:`10000`}),t}function yG(){return navigator.vendor!==`Apple Computer, Inc.`}function bG(e,t){let n=e-t.top;if(n<pG)return-Math.ceil((pG-Math.max(0,n))/pG*mG);let r=t.bottom-e;return r<pG?Math.ceil((pG-Math.max(0,r))/pG*mG):0}function xG(e,t){if(e!=null){let t=fW[e];return t==null?null:{text:t,title:pW[e]}}return t?{icon:{name:`file-tree-icon-dot`,width:6,height:6},title:mW}:null}function SG(e,t,n){if(t==null||t.size===0)return null;let r=[];for(let i=e.length-1;i>=0;--i){let a=e[i],o=n.get(a);if(o!=null){for(let e of r)n.set(e,o);return o?`ignored`:null}if(t.has(a)){n.set(a,!0);for(let e of r)n.set(e,!0);return`ignored`}r.push(a)}for(let e of r)n.set(e,!1);return null}function CG(e){return e!=null&&`toggle`in e}function wG(e){return e.code===`Space`||e.key===` `||e.key===`Spacebar`}function TG(e){return e.key.length===1&&/^[\p{L}\p{N}]$/u.test(e.key)&&!e.ctrlKey&&!e.metaKey&&!e.altKey}function EG(e){return e==null?``:`[data-item-section="spacing-item"][data-ancestor-path="${e.replaceAll(`\\`,`\\\\`).replaceAll(`"`,`\\"`)}"] { opacity: 1; }`}function DG(e){return e.shiftKey&&e.key===`F10`||e.key===`ContextMenu`}function OG(e,t){return t&&DG(e)||(e.ctrlKey||e.metaKey)&&wG(e)?!0:e.key===`ArrowDown`||e.key===`ArrowLeft`||e.key===`ArrowRight`||e.key===`ArrowUp`}var kG=new Set([`ArrowDown`,`ArrowLeft`,`ArrowRight`,`ArrowUp`,`End`,`Home`,`PageDown`,`PageUp`]);function AG(e){for(let t of e.composedPath())if(t instanceof HTMLElement&&(t.dataset.fileTreeContextMenuRoot===`true`||t.dataset.type===`context-menu-anchor`||t.dataset.type===`context-menu-trigger`||t.getAttribute(`slot`)===`context-menu`))return!0;return!1}function jG(e){return{bottom:e.bottom,height:e.height,left:e.left,right:e.right,top:e.top,width:e.width,x:e.x,y:e.y}}function MG(e,t){return{bottom:t,height:0,left:e,right:e,top:t,width:0,x:e,y:t}}function NG(e,t){if(e==null)return t.offsetTop;let n=t.getBoundingClientRect(),r=e.getBoundingClientRect();return n.top-r.top}function PG(e,t,n){if(n==null){e.delete(t);return}e.set(t,n)}function FG(e,t,n){if(e==null)return null;let r=t.get(e)??null;if(r!=null)return r;let i=n.get(e)??null;return i?.dataset.itemParked===`true`?null:i}function IG(e){if(e==null)return[];let t=[];for(let n of e.querySelectorAll(`button[data-file-tree-sticky-row="true"]`)){if(!(n instanceof HTMLElement))continue;let e=n.dataset.fileTreeStickyPath;e!=null&&t.push(e)}return t}function LG(e,t){if(e==null||t==null)return null;for(let n of e.querySelectorAll(`button[data-item-focused="true"][data-item-parked="true"]`))if(n instanceof HTMLElement&&n.dataset.itemPath===t)return n;return null}function RG(e,t,n,r,i,a,o){let s=Math.max(0,a-i),c=t?.getBoundingClientRect()??null,l=c==null||n==null?null:n.getBoundingClientRect().top-c.top,u=LG(e,r),d=c==null||u==null?null:u.getBoundingClientRect().top-c.top;return Math.max(0,Math.min(d??Math.max(l??0,s),Math.max(0,o-i)))}function zG(e,t){return{kind:e.kind,name:cG(e),path:t}}function BG(e){return e==null?void 0:`${e}__tree`}function VG(e,t,n){if(e!=null)return`${e}__focused-item-${encodeURIComponent(t)}${n?`__parked`:``}`}function HG(e){return e===`file-tree-icon-chevron`||e===`file-tree-icon-dot`||e===`file-tree-icon-file`||e===`file-tree-icon-lock`}function UG(e,t){if(e==null)return null;if(`text`in e)return LU(`span`,{title:e.title,children:e.text});let n=typeof e.icon==`string`?HG(e.icon)?t(e.icon):{name:e.icon}:HG(e.icon.name)?(()=>{let n=t(e.icon.name),{name:r,...i}=e.icon;return{...n,...i}})():e.icon;return LU(`span`,{title:e.title,children:LU(VU,{...n})})}function WG(e){e!=null&&vW(e.querySelector([`button:not([disabled])`,`[href]`,`input:not([disabled])`,`select:not([disabled])`,`textarea:not([disabled])`,`[tabindex]:not([tabindex="-1"])`].join(`, `))??e)}function GG(e,t,{actionLaneEnabled:n=!1,customDecoration:r=null,decorationLaneEnabled:i=!1,dragTargetFlattenedSegmentPath:a=null,gitDecoration:o=null,gitLaneActive:s=!1,renameInput:c=null,showDecorativeActionAffordance:l=!1}={}){let u=sG(e);return LU(pU,{children:[e.depth>0?LU(`div`,{"data-item-section":`spacing`,children:Array.from({length:e.depth}).map((t,n)=>LU(`div`,{"data-item-section":`spacing-item`,"data-ancestor-path":e.ancestorPaths[n]},n))}):null,LU(`div`,{"data-item-section":`icon`,children:e.kind===`directory`?LU(VU,{...t(`file-tree-icon-chevron`)}):LU(VU,{...t(`file-tree-icon-file`,u)})}),LU(`div`,{"data-item-section":`content`,children:e.isFlattened?oG(e,c,a):c??LU($U,{minimumLength:5,split:`extension`,children:e.name})}),i?LU(`div`,{"data-item-section":`decoration`,children:r==null?null:UG(r,t)}):null,s?LU(`div`,{"data-item-section":`git`,children:UG(o,t)}):null,n?LU(`div`,{"data-item-section":`action`,children:l?LU(`span`,{"aria-hidden":`true`,"data-item-action-affordance":`decorative`,children:LU(VU,{...t(`file-tree-icon-ellipsis`)})}):null}):null]})}function KG(e,t,n,r={}){let{controller:i,renameView:a,visualFocusPath:o,contextHoverPath:s,draggedPathSet:c,dragTarget:l,dragAndDropEnabled:u,shouldSuppressContextMenu:d,handleRowDragStart:f,handleRowDragEnd:p,handleRowTouchStart:m,instanceId:h,itemHeight:g,gitStatusByPath:_,ignoredGitDirectories:v,ignoredInheritanceCache:y,directoriesWithGitChanges:b,gitLaneActive:x,contextMenuEnabled:S,contextMenuTriggerMode:C,contextMenuButtonTriggerEnabled:w,contextMenuButtonVisibility:T,contextMenuRightClickEnabled:E,registerRenameInput:D,registerButton:O,resolveIcon:k,renderDecorationForRow:A,openContextMenuForRow:j,onRowClick:M,onKeyDown:N}=e,P=sG(t),{isParked:F=!1,mode:I=`flow`,style:L}=r,R=I===`sticky`,z=_?.get(P)??null??SG(t.ancestorPaths,v,y),B=t.kind===`directory`&&(b?.has(P)??!1),V=A(t,P),H=xG(z,B),U=S&&w,W=V!=null||x||U,G=U&&T===`always`,K=a.getPath()===P,ee=K?a.getValue():``,te=R||!K?null:LU(OW,{ref:D,ariaLabel:`Rename ${cG(t)}`,isFlattened:t.isFlattened,value:ee,onBlur:()=>{a.commit()},onInput:e=>{a.setValue(e.currentTarget.value)}}),ne=GG(t,k,{actionLaneEnabled:U,customDecoration:V,decorationLaneEnabled:W,dragTargetFlattenedSegmentPath:l?.flattenedSegmentPath??null,gitDecoration:H,gitLaneActive:x,renameInput:te,showDecorativeActionAffordance:G}),re={...kW({ariaLabel:cG(t),domId:t.isFocused?VG(h,P,F):void 0,extraStyle:L,features:{actionLaneEnabled:U,contextMenuButtonVisibility:U?T:null,contextMenuEnabled:S,contextMenuTriggerMode:S?C:null,gitLaneActive:x},isParked:F,itemHeight:g,mode:I,row:t,state:{containsGitChange:B,effectiveGitStatus:z,isContextHovered:s===P,isDragTarget:l?.kind===`directory`&&l.directoryPath===P,isDragging:c?.has(P)===!0,isFocusRinged:t.isFocused&&o===P},targetPath:P}),key:n,onContextMenu:S||u?e=>{if(d()){e.preventDefault();return}S&&(e.preventDefault(),E&&(i.focusMountedPathFromInput(P),j(t,P,{anchorRect:MG(e.clientX,e.clientY),source:`right-click`})))}:void 0,onFocus:R?void 0:()=>{i.focusMountedPathFromInput(P)},onKeyDown:R?void 0:N,ref:e=>{O(P,e)}};return!R&&K?LU(`div`,{...re,children:ne}):LU(`button`,{...re,type:`button`,draggable:u&&!F,onDragEnd:u&&!F?p:void 0,onDragStart:u&&!F?e=>{f(e,t,P)}:void 0,onMouseDown:e=>{if(R){e.preventDefault();return}i.isSearchOpen()&&e.preventDefault()},onTouchStart:u&&!F?e=>{m(e,t,P)}:void 0,onClick:e=>{M(e,t,P,I)},children:ne})}function qG(e,t,n){return t.end<t.start?[]:e.controller.getVisibleRows(t.start,t.end).filter(e=>!n.has(sG(e))).map((n,r)=>KG(e,n,t.start+r))}function JG({composition:e,controller:t,gitStatusByPath:n,ignoredGitDirectories:r,directoriesWithGitChanges:i,icons:a,instanceId:o,itemHeight:s=KV,overscan:c=10,renamingEnabled:l=!1,renderRowDecoration:u,searchBlurBehavior:d=`close`,searchEnabled:f=!1,searchFakeFocus:p=!1,slotHost:m,stickyFolders:h=!1,initialViewportHeight:g=420}){"use no memo";let _=XW(null),v=XW(null),y=XW(!1),b=XW(null),x=XW(null),S=XW(null),C=XW(null),w=XW(null),T=XW(new Map),E=XW(new Map),D=XW(()=>{}),O=XW(null),k=XW(0),A=XW(!1),j=XW(null);j.current!==t&&(A.current=!1,j.current=t);let M=XW(!1),N=XW(null),P=XW(null),F=XW(!1),I=XW(null),L=XW(null),R=XW(null),z=XW(null),B=XW(null),V=XW(null),H=XW(null),U=XW(null),W=XW(!1),G=XW(null),K=XW(null),ee=XW(null),te=XW(null),ne=ZW(()=>new Map,[]),[,re]=KW(0),[ie,ae]=KW(null),[oe,se]=KW(null),[ce,le]=KW(null),[q,ue]=KW(null),[de,fe]=KW(0),[pe,me]=KW(null),he=XW(pe);he.current=pe;let ge=XW(null),_e=XW(null),ve=XW(null),ye=XW(null),be=XW(null),xe=XW(!1),Se=()=>{_e.current=null,ve.current=null,ye.current=null},Ce=(e,t)=>{_e.current=e,ve.current=null,ye.current=t==null?null:{path:e,scrollTop:t}},we=(e,t)=>{_e.current=null,ve.current={path:e,viewportOffset:t},ye.current=null},Te=XW(d===`retain`&&t.isSearchOpen()),[Ee,De]=KW(p);JW(()=>{p||De(!1)},[p]);let Oe=XW(!1),ke=QW(()=>{Oe.current=!0,De(e=>e&&!1)},[]),[Ae,je]=KW(()=>uG({controller:t,itemHeight:s,overscan:c,scrollTop:0,stickyFolders:h,viewportHeight:g})),[Me,Ne]=KW(!1);JW(()=>{Ne(!0)},[]);let Pe=e?.contextMenu?.enabled===!0||e?.contextMenu?.render!=null||e?.contextMenu?.onOpen!=null||e?.contextMenu?.onClose!=null,Fe=e?.contextMenu?.triggerMode??(Pe?`right-click`:`both`),Ie=Fe===`both`||Fe===`button`,Le=e?.contextMenu?.buttonVisibility??`when-needed`,Re=Fe===`both`||Fe===`right-click`;YW(()=>{let e=S.current;if(e==null)return;let t=e=>{if(!(e instanceof CustomEvent))return;let t=e.detail?.path??null;be.current=t,se(t),ue(t==null?null:`pointer`)},n=e=>{e instanceof CustomEvent&&(xe.current=e.detail?.disabled===!0)};return e.addEventListener(`file-tree-debug-set-context-menu-trigger`,t),e.addEventListener(`file-tree-debug-set-scroll-suppression`,n),()=>{e.removeEventListener(`file-tree-debug-set-context-menu-trigger`,t),e.removeEventListener(`file-tree-debug-set-scroll-suppression`,n)}},[]);let ze=QW((e,t)=>{PG(T.current,e,t)},[]),Be=QW((e,t)=>{PG(E.current,e,t)},[]),Ve=QW(e=>{x.current=e},[]),He=QW(e=>FG(e,E.current,T.current),[]),Ue=n!=null||r!=null||i!=null,{resolveIcon:We}=ZW(()=>rR(a),[a]),Ge=t[LH](),Ke=Ge.getPath(),qe=Ke!=null,Je=t.isSearchOpen(),Ye=t.getSearchValue(),Xe=t.getFocusedPath(),Ze=t.getFocusedIndex(),Qe=t.getScrollRequest(),$e=t.isDragAndDropEnabled(),et=t.getDragSession(),tt=ZW(()=>et==null?null:new Set(et.draggedPaths),[et]),nt=et?.target??null,rt=et?.primaryPath??null,it=BG(o),{overlayHeight:at,overlayRows:ot,snapshot:st,visibleRows:ct}=Ae,lt=st.physical.viewportHeight,ut=ZW(()=>({end:st.window.endIndex,start:st.window.startIndex}),[st.window.endIndex,st.window.startIndex]),dt=ot,ft=st.sticky.rows,pt=st.physical.totalHeight,mt=st.sticky.height,ht=ZW(()=>new Set(ft.map(e=>sG(e.row))),[ft]),gt=Ze>=0&&Ze>=ut.start&&Ze<=ut.end,_t=QW((e,t)=>u?.({item:zG(e,t),row:e})??null,[u]),vt=QW(e=>vW(e==null?null:T.current.get(e)??null)?!0:vW(S.current),[]),yt=QW(e=>{vt(t.focusNearestPath(e))},[t,vt]),bt=XW(yt);bt.current=yt;let xt=XW(!0),St=XW(()=>{}),Ct=QW((t=!0)=>{let n=he.current;n!=null&&(xt.current=xt.current&&t,me(null),e?.contextMenu?.onClose?.(),xt.current&&yt(n.path))},[e?.contextMenu,yt]);St.current=Ct;let wt=QW(e=>{let t=e==null?null:NG(S.current,e);le(e=>e===t?e:t)},[]),Tt=QW((e,n,r)=>{let i=t.getItem(n);if(i==null)return;let a=He(n);if(a?.dataset.fileTreeStickyRow===`true`){let e=C.current;Ce(n,e?.scrollTop??null),M.current=!0,ae(e=>e===n?e:n)}i.focus(),wt(a),xt.current=!0,me({anchorRect:r?.anchorRect??null,item:zG(e,n),path:n,source:r?.source??`keyboard`})},[t,He,wt]),Et=QW(e=>{if(l){if(t.isSearchOpen()){let e=C.current,t=bW(e,lt);I.current=Ze<0||e==null?null:Math.max(0,Math.min(Ze*s-e.scrollTop,Math.max(0,t-s))),F.current=!0}t.startRenaming(e)!==!1&&(ue(`focus`),re(e=>e+1))}},[t,Ze,s,l,lt]),Dt=QW((e,{restoreTreeFocus:n=!0,targetOffset:r=`live-overlay`}={})=>{let i=C.current;if(i==null)return!1;t.focusPath(e);let a=t.getFocusedIndex();if(a<0)return!1;let o=t.getVisibleRows(a,a)[0]??null;if(o==null)return!1;let l=bW(i,lt),u=t.getVisibleCount()*s,d=r===`sticky-parents`?o.ancestorPaths.length*s:uG({controller:t,itemHeight:s,overscan:c,scrollTop:i.scrollTop,stickyFolders:h,viewportHeight:l}).snapshot.sticky.height;return M.current=!0,TW(i,a,s,l,u,d),D.current(),ge.current=n?e:null,!0},[t,s,c,lt,h]),Ot=()=>y.current===!0||te.current!=null||W.current===!0,kt=e=>typeof window.requestAnimationFrame==`function`?window.requestAnimationFrame(()=>{e()}):window.setTimeout(e,16),At=e=>{if(e!=null){if(typeof window.cancelAnimationFrame==`function`){window.cancelAnimationFrame(e);return}window.clearTimeout(e)}},jt=()=>{z.current!=null&&(clearTimeout(z.current),z.current=null),R.current=null},Mt=()=>{V.current?.remove(),V.current=null},Nt=()=>{At(L.current),L.current=null,B.current=null},Pt=e=>{let t=S.current?.getRootNode();if(t instanceof ShadowRoot){t.append(e);return}document.body.append(e)},Ft=()=>{U.current?.(),U.current=null,te.current!=null&&(clearTimeout(te.current),te.current=null),W.current=!1,G.current=null,ee.current=null,K.current!=null&&(K.current.setAttribute(`draggable`,`true`),K.current.style.removeProperty(`touch-action`),K.current=null),Mt(),jt(),Nt(),H.current=null},It=(e,n)=>{let r=S.current?.getRootNode(),i=_G(hG(r instanceof ShadowRoot?r:document,e,n));return t.setDragTarget(i),t.getDragSession()?.target??null},Lt=e=>{let n=t.getDragAndDropConfig()?.openOnDropDelay??800;if(e==null||e.kind!==`directory`||e.directoryPath==null||n<=0){jt();return}let r=t.getItem(e.directoryPath),i=CG(r)?r:null;if(i==null||i.isExpanded()){jt();return}let a=`${e.directoryPath}::${e.flattenedSegmentPath??``}`;R.current!==a&&(jt(),R.current=a,z.current=setTimeout(()=>{let n=t.getDragSession()?.target;n?.kind!==`directory`||n.directoryPath!==e.directoryPath||n.flattenedSegmentPath!==e.flattenedSegmentPath||i.expand()},n))},Rt=()=>{L.current=null;let e=B.current,n=C.current;if(e==null||n==null||t.getDragSession()==null)return;let r=n.getBoundingClientRect(),i=bG(e.clientY,r);if(i===0)return;let a=Math.max(0,n.scrollHeight-n.clientHeight),o=Math.max(0,Math.min(a,n.scrollTop+i));o!==n.scrollTop&&(n.scrollTop=o,D.current()),Lt(It(e.clientX,e.clientY)),L.current=kt(Rt)},zt=(e,t)=>{B.current={clientX:e,clientY:t},L.current??=kt(Rt)},Bt=(e,n,r)=>{let i=e.currentTarget;if(i!=null){if(Ft(),Mt(),jt(),Nt(),t.startDrag(r)===!1){e.preventDefault();return}if(H.current=n,e.dataTransfer!=null&&(e.dataTransfer.effectAllowed=`move`,e.dataTransfer.dropEffect=`move`,e.dataTransfer.setData(`text/plain`,r),yG())){let t=vG(i),n=i.getBoundingClientRect();Object.assign(t.style,{height:`${n.height}px`,opacity:`0.85`,transform:`translate3d(-9999px, 0px, 0)`,width:`${n.width}px`}),Pt(t),V.current=t,e.dataTransfer.setDragImage(t,Math.max(0,e.clientX-n.left),Math.max(0,e.clientY-n.top))}}},Vt=()=>{Mt(),jt(),Nt(),H.current=null,t.cancelDrag()},Ht=(e,n,r)=>{if(te.current!=null||W.current)return;let i=e.touches[0],a=e.currentTarget;if(i==null||a==null)return;ee.current={clientX:i.clientX,clientY:i.clientY},K.current=a,a.setAttribute(`draggable`,`false`);let o=(e={})=>{let t=e.restoreNativeDraggable??!W.current;te.current!=null&&(clearTimeout(te.current),te.current=null),document.removeEventListener(`touchmove`,s),document.removeEventListener(`touchend`,c),document.removeEventListener(`touchcancel`,c),U.current===o&&(U.current=null),t&&(a.setAttribute(`draggable`,`true`),K.current===a&&(K.current=null),ee.current=null)},s=e=>{let t=e.touches[0],n=ee.current;if(t==null||n==null)return;let r=t.clientX-n.clientX,i=t.clientY-n.clientY;r*r+i*i<=fG*fG||o()},c=()=>{o()};document.addEventListener(`touchmove`,s,{passive:!0}),document.addEventListener(`touchend`,c),document.addEventListener(`touchcancel`,c),U.current=o,te.current=setTimeout(()=>{if(o({restoreNativeDraggable:!1}),t.startDrag(r)===!1){a.setAttribute(`draggable`,`true`),K.current===a&&(K.current=null),ee.current=null;return}W.current=!0,K.current=a,a.setAttribute(`draggable`,`false`),a.style.setProperty(`touch-action`,`none`),H.current=n;let e=a.getBoundingClientRect(),s=vG(a);Object.assign(s.style,{height:`${e.height}px`,opacity:`0.85`,transform:`translate3d(${e.left}px, ${e.top}px, 0)`,width:`${e.width}px`}),Pt(s),V.current=s,G.current={x:i.clientX-e.left,y:i.clientY-e.top};let c=e=>{let t=e.touches[0];if(t==null)return;e.preventDefault();let n=G.current;n!=null&&V.current!=null&&(V.current.style.transform=`translate3d(${t.clientX-n.x}px, ${t.clientY-n.y}px, 0)`),Lt(It(t.clientX,t.clientY)),zt(t.clientX,t.clientY)},l=e=>{let n=e.changedTouches[0];n!=null&&It(n.clientX,n.clientY),t.completeDrag(),Ft()},u=()=>{t.cancelDrag(),Ft()};U.current=()=>{document.removeEventListener(`touchmove`,c),document.removeEventListener(`touchend`,l),document.removeEventListener(`touchcancel`,u)},document.addEventListener(`touchmove`,c,{passive:!1}),document.addEventListener(`touchend`,l),document.addEventListener(`touchcancel`,u)},dG)},Ut=e=>{if(pe!=null){if(e.key===`Escape`){Ct(),e.preventDefault(),e.stopPropagation();return}kG.has(e.key)&&(e.preventDefault(),e.stopPropagation());return}if(Ge.isActive()){if(e.key===`Escape`)Ge.cancel();else if(e.key===`Enter`)Ge.commit();else return;ue(`focus`),re(e=>e+1),e.preventDefault(),e.stopPropagation();return}if(l&&e.key===`F2`){Et(Xe??void 0),e.preventDefault(),e.stopPropagation();return}if(Je){if(e.key===`Escape`)F.current=!1,I.current=null,t.closeSearch();else if(e.key===`Enter`){let e=t.getFocusedPath();e!=null&&t.selectOnlyPath(e);let n=C.current,r=bW(n,lt);I.current=Ze<0||n==null?null:Math.max(0,Math.min(Ze*s-n.scrollTop,Math.max(0,r-s))),F.current=!0,t.closeSearch()}else if(e.key===`ArrowDown`)t.focusNextSearchMatch();else if(e.key===`ArrowUp`)t.focusPreviousSearchMatch();else return;ue(`focus`),re(e=>e+1),e.preventDefault(),e.stopPropagation();return}if(f&&TG(e)){t.openSearch(e.key),re(e=>e+1),e.preventDefault(),e.stopPropagation();return}let n=Pe&&DG(e),r=OG(e,Pe),i=r&&S.current!=null?yW(S.current):null,a=r?new Set(IG(S.current)):new Set,o=i?.dataset.fileTreeStickyPath??null,c=i?.dataset.fileTreeStickyRow===`true`&&o!=null;if(c&&o!==Xe&&a.has(o)){let e=C.current;Ce(o,e?.scrollTop??null),t.focusPath(o)}let u=t.getFocusedPath(),d=t.getFocusedIndex(),p=t.getFocusedItem();if(p==null)return;let m=CG(p)?p:null,h=u!=null&&(ht.has(u)||c&&o===u&&a.has(u)),g=e.key===`ArrowDown`||e.key===`ArrowUp`||e.key===`ArrowRight`&&m!=null&&m.isExpanded(),_=e.key===`ArrowLeft`&&h&&m!=null&&m.isExpanded(),v=C.current,y=!0;if(e.shiftKey&&e.key===`ArrowDown`)t.extendSelectionFromFocused(1);else if(e.shiftKey&&e.key===`ArrowUp`)t.extendSelectionFromFocused(-1);else if(n&&u!=null&&d>=0){let e=t.getVisibleRows(d,d)[0]??null,n=FG(u,E.current,T.current);e==null||n==null?y=!1:Tt(e,u)}else if((e.ctrlKey||e.metaKey)&&wG(e))t.toggleFocusedSelection();else if((e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`a`)t.selectAllVisiblePaths();else switch(e.key){case`ArrowDown`:t.focusNextItem();break;case`ArrowUp`:t.focusPreviousItem();break;case`ArrowRight`:m==null||m.isExpanded()?t.focusNextItem():m.expand();break;case`ArrowLeft`:m!=null&&m.isExpanded()?m.collapse():t.focusParentItem();break;case`Home`:t.focusFirstItem();break;case`End`:t.focusLastItem();break;default:y=!1}if(!y)return;ue(`focus`);let b=t.getFocusedPath(),x=b!=null&&(ht.has(b)||a.has(b)),w=g&&b!==u,D=n&&c&&o===u&&b===u;if((h||D)&&b!=null&&(w&&x||D))Ce(b,v?.scrollTop??null),M.current=!0,ae(e=>e===b?e:b);else{let t=e.key===`ArrowUp`&&h&&b!==u;b!=null&&(t||_&&b===u)?(we(b,RG(S.current,v,i,u,s,mt,lt)),M.current=!0,ae(e=>e===b?e:b)):Se()}re(e=>e+1),e.preventDefault(),e.stopPropagation()};YW(()=>{if(!(!f||!Je)){if(Te.current){Te.current=!1;return}vW(w.current)}},[Je,f]),YW(()=>{let e=x.current;switch(DW({hasRenderedInput:e!=null,previousRenamingPath:P.current,renamingPath:Ke})){case`reset`:P.current=null;return;case`reveal-canonical`:Ke!=null&&Dt(Ke,{restoreTreeFocus:!1,targetOffset:`live-overlay`});return;case`ignore`:return;case`focus-input`:e!=null&&(ge.current=null,P.current=Ke,vW(e),e.select());return}},[ut.end,ut.start,Ke,Dt,ht]),YW(()=>{let e=S.current;if(e==null)return;let t=null,n=()=>{t!=null&&(clearTimeout(t),t=null)},r=()=>{let t=yW(e)?.dataset.itemPath??null;ae(e=>e===t?e:t)},i=()=>{n(),M.current=!0,r()},a=i=>{let a=i.relatedTarget;if(a==null){n(),t=setTimeout(()=>{if(t=null,yW(e)!=null){r();return}M.current=!1,ae(null)},0);return}if(!(a instanceof Node)||!e.contains(a)){n(),M.current=!1,ae(null);return}let o=a instanceof HTMLElement?a.dataset.itemPath??null:null;ae(e=>e===o?e:o)};return e.addEventListener(`focusin`,i),e.addEventListener(`focusout`,a),()=>{n(),e.removeEventListener(`focusin`,i),e.removeEventListener(`focusout`,a)}},[]),YW(()=>{let e=S.current;e!=null&&(st.physical.scrollTop<=0?e.dataset.scrollAtTop=`true`:delete e.dataset.scrollAtTop)},[st.physical.scrollTop]),YW(()=>{let e=null,n=C.current,r=b.current,i=S.current;if(n==null)return;O.current=bW(n,g);let a=()=>{let e=t.getVisibleCount(),r=xW(O.current,g),i=Math.max(0,e*s-r);n.scrollTop>i&&(n.scrollTop=i),je(uG({controller:t,itemHeight:s,overscan:c,scrollTop:Math.min(n.scrollTop,i),stickyFolders:h,viewportHeight:r}))};if(!A.current){A.current=!0;let e=t.getFocusedIndex();if(e>=0){let r=xW(O.current,g),i=t.getVisibleRows(e,e)[0]??null;CW(n,e,s,r,h&&i!=null?Math.max(0,Math.min(i.ancestorPaths.length*s,Math.max(0,r-s))):0)}}D.current=a;let o=!1,l=t.subscribe(()=>{o?re(e=>e+1):o=!0,a()}),u=()=>{xe.current!==!0&&(r!=null&&(r.dataset.isScrolling??=``),i!=null&&(i.dataset.isScrolling??=``),y.current=!0,e!=null&&clearTimeout(e),e=setTimeout(()=>{r!=null&&delete r.dataset.isScrolling,i!=null&&delete i.dataset.isScrolling,y.current=!1,fe(e=>e+1),e=null},50))},d=null,f=()=>{i!=null&&delete i.dataset.overlayReveal,d!=null&&(clearTimeout(d),d=null)},p=()=>{i==null||xe.current===!0||n.scrollTop>0||(i.dataset.overlayReveal=`true`,d!=null&&clearTimeout(d),d=setTimeout(()=>{f()},200))},m=()=>{if(a(),n.scrollTop>0&&f(),he.current!=null&&y.current&&St.current(),xe.current===!0){y.current=!1;return}se(e=>e==null?e:null),u()},_=()=>{u(),p()},v=new Set([`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`PageUp`,`PageDown`,`Home`,`End`,` `,`Spacebar`]),x=e=>{v.has(e.key)&&_()};n.addEventListener(`scroll`,m,{passive:!0}),n.addEventListener(`wheel`,_,{passive:!0}),n.addEventListener(`touchmove`,_,{passive:!0}),n.addEventListener(`keydown`,x);let w=typeof ResizeObserver<`u`?new ResizeObserver(e=>{O.current=(e[0]==null?null:SW(e[0]))??bW(n,g),a()}):null;return w?.observe(n),()=>{D.current=()=>{},l(),n.removeEventListener(`scroll`,m),n.removeEventListener(`wheel`,_),n.removeEventListener(`touchmove`,_),n.removeEventListener(`keydown`,x),e!=null&&clearTimeout(e),d!=null&&clearTimeout(d),r!=null&&delete r.dataset.isScrolling,i!=null&&(delete i.dataset.isScrolling,delete i.dataset.overlayReveal),y.current=!1,O.current=null,w?.disconnect()}},[t,g,s,c,h]),YW(()=>{Pe||pe==null||Ct(!1)},[Ct,Pe,pe]);let Wt=ZW(()=>pe==null?null:`${pe.path}::${pe.source}`,[pe]);YW(()=>{if(Wt==null){m?.clearSlotContent(YL);return}let t=he.current;if(t==null)return;let n=v.current??_.current;if(n==null)return;let r={anchorElement:n,anchorRect:t.anchorRect??jG(n.getBoundingClientRect()),close:e=>{St.current(e?.restoreFocus??!0)},restoreFocus:()=>{xt.current&&bt.current(he.current?.path??null)}},i=e?.contextMenu?.render?.(t.item,r)??null;return m?.setSlotContent(YL,i),e?.contextMenu?.onOpen?.(t.item,r),WG(i),queueMicrotask(()=>{i==null||!i.isConnected||document.activeElement===i&&WG(i)}),()=>{m?.clearSlotContent(YL)}},[Wt,e?.contextMenu,m]),YW(()=>{pe!=null&&t.getItem(pe.path)==null&&Ct()},[Ct,pe,t]),YW(()=>{if(pe==null)return;let e=S.current?.getRootNode(),t=e instanceof ShadowRoot?e.host:S.current,n=e=>{let n=e.target;n instanceof Node&&(AG(e)||_.current?.contains(n)!==!0&&t?.contains(n)!==!0&&Ct())},r=e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),Ct())};return document.addEventListener(`mousedown`,n,!0),document.addEventListener(`keydown`,r,!0),()=>{document.removeEventListener(`mousedown`,n,!0),document.removeEventListener(`keydown`,r,!0)}},[Ct,pe]),YW(()=>{let e=C.current,n=S.current;if(e==null||n==null){N.current=Xe;return}let r=Xe==null?null:T.current.get(Xe)??null,i=yW(n),a=i?.dataset.itemPath??null,o=qe&&x.current===i,c=f&&w.current===i,l=F.current&&!Je,u=I.current??0,d=ge.current,p=_e.current,m=ve.current,g=ye.current,_=i!=null,v=M.current||_,y=N.current!==Xe,b=p!=null&&p===Xe&&Xe!=null,E=!1,O=!1;if(Qe!=null&&Qe.id!==k.current){k.current=Qe.id;let n=Qe.visibleIndex,r=t.getVisibleRows(n,n)[0]??null;if(r!=null){let t=h?Math.max(0,Math.min(r.ancestorPaths.length*s,Math.max(0,lt-s))):mt;E=!0,O=wW(e,n,s,lt,pt,Qe.offset,t)}t.clearScrollRequest(Qe.id)}let A=!E&&l&&TW(e,Ze,s,lt,pt,u),j=!E&&d!=null&&d===Xe&&TW(e,Ze,s,lt,pt,mt),P=!E&&m!=null&&m.path===Xe&&TW(e,Ze,s,lt,pt,m.viewportOffset),L=!E&&g!=null&&g.path===Xe&&e.scrollTop!==g.scrollTop;if(L&&(e.scrollTop=g.scrollTop),(L||O||j||P||A||v&&y&&d!==Xe&&!b&&CW(e,Ze,s,lt,mt))&&D.current(),E){N.current=Xe;return}if(!v){N.current=Xe;return}if(o){N.current=Xe;return}if(c&&!l){N.current=Xe;return}if(r==null){l&&Ze>=0&&(TW(e,Ze,s,lt,pt,u),D.current()),N.current=Xe;return}(y||l||d===Xe||p===Xe||m?.path===Xe||g?.path===Xe||a==null||a!==Xe)&&(vW(r),d===Xe&&(ge.current=null),p===Xe&&(_e.current=null),m?.path===Xe&&(ve.current=null),g?.path===Xe&&(ye.current=null),F.current=!1,I.current=null),N.current=Xe},[t,Ze,Xe,gt,s,qe,Je,ut,lt,f,Qe,h,mt,pt,ct]);let Gt=Ze>=0&&Ze>=st.visible.startIndex&&Ze<=st.visible.endIndex,Kt=Xe!=null&&dt.some(e=>sG(e.row)===Xe),qt=Gt||Kt,Jt=Ie&&M.current===!0&&qt?Xe:null,Yt=q===`pointer`?oe:null,Xt=pe?.path??be.current??Yt??Jt??oe,Zt=pe?.source===`right-click`;YW(()=>{y.current&&pe==null||wt(He(Xt))},[pe,He,ut,lt,de,dt,Xt,wt,ct]);let Qt=QW(e=>{if(y.current||AG(e))return;let t=e.target;if(!(t instanceof HTMLElement)||t.closest?.(`[data-type="context-menu-trigger"]`)!=null)return;let n=t.closest?.(`[data-file-tree-sticky-row="true"]`),r=t.closest?.(`[data-type="item"]`),i=n instanceof HTMLElement?n.dataset.fileTreeStickyPath??null:r instanceof HTMLElement?r.dataset.itemPath??null:null;i!=null&&ue(e=>e===`pointer`?e:`pointer`),se(e=>e===i?e:i)},[]),$t=QW(()=>{se(null)},[]);YW(()=>{if(!$e)return;let e=()=>{Ft(),t.cancelDrag()};return window.addEventListener(`dragend`,e),()=>{window.removeEventListener(`dragend`,e),Ft(),t.cancelDrag()}},[t,$e]);let en=e=>{if(!$e||t.getDragSession()==null||W.current)return;let n=_G(e.target instanceof HTMLElement?e.target:null);t.setDragTarget(n),Lt(t.getDragSession()?.target??null),zt(e.clientX,e.clientY),e.dataTransfer!=null&&(e.dataTransfer.dropEffect=`move`),e.preventDefault()},tn=e=>{if(!$e||t.getDragSession()==null||W.current)return;let n=e.relatedTarget;n instanceof Node&&S.current?.contains(n)===!0||(jt(),Nt(),t.setDragTarget(null))},nn=e=>{!$e||t.getDragSession()==null||W.current||(e.preventDefault(),It(e.clientX,e.clientY),t.completeDrag(),Mt(),jt(),Nt(),H.current=null)},rn=st.window.height,J=st.window.offsetTop,an=Math.min(0,lt-rn),on=Math.min(0,lt-rn-mt),sn=ie===Xe||F.current,cn=Xe!=null&&sn&&!gt&&Ze>=0?ct[Ze]??t.getVisibleRows(Ze,Ze)[0]??null:null,ln=cn==null?null:EW(Ze,s,ut,rn),un=H.current,dn=rt!=null&&un!=null&&un.path===rt&&un.index>=ut.start&&un.index<=ut.end,fn=rt!=null&&un!=null&&un.path===rt&&!dn&&un.path!==cn?.path?un:null,pn=fn==null?null:EW(fn.index,s,ut,rn),mn=EG((Ze>=0?ct[Ze]??t.getVisibleRows(Ze,Ze)[0]??null:null)?.ancestorPaths.at(-1)??null),hn=Je&&Xe!=null?VG(o,Xe,!gt):void 0,gn=pe?.path??(Je?Xe:ie),_n=pe?.path??oe,vn=He(Xt),yn=Pe&&Ie&&!Zt&&!qe&&vn!=null&&ce!=null&&Xt!=null,bn=Pe&&(yn||pe!=null),xn=pe?.anchorRect,Sn=xn==null&&vn!=null&&ce!=null&&(pe!=null||yn)?ce:null,Cn=xn==null?Sn==null?void 0:{top:`${Sn}px`}:{left:`${xn.left}px`,position:`fixed`,right:`auto`,top:`${xn.top}px`},wn=Zt?{opacity:`0`}:void 0,Tn=QW((e,n,r,i)=>{let a=AW({event:{ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey},isDirectory:n.kind===`directory`,isSearchOpen:Je,mode:i}),o=a.toggleDirectory&&n.kind===`directory`,s=o?t.resolveMountedDirectoryPathFromInput(r):null;if(o&&s==null)return;let c=s??r;switch(a.selection.kind){case`range`:t.selectPathRange(c,a.selection.additive);break;case`toggle`:t.togglePathSelectionFromInput(c);break;case`single`:t.selectOnlyMountedPathFromInput(c);break}let l=e.currentTarget instanceof HTMLElement?e.currentTarget:null,u=n.index>=st.visible.startIndex&&n.index<=st.visible.endIndex,d=i===`flow`&&u&&l!=null&&l.dataset.itemParked!==`true`;t.focusMountedPathFromInput(c),d&&(M.current=!0,ae(e=>e===c?e:c),ue(`focus`)),o&&t.toggleMountedDirectoryFromInput(c),a.closeSearch&&t.closeSearch(),a.revealCanonical&&Dt(c,{targetOffset:`sticky-parents`})},[t,Je,st.visible.endIndex,st.visible.startIndex,Dt]),En=()=>{if(y.current||!Ie||Xt==null||vn==null)return;let e=t.getItem(Xt);e!=null&&(wt(vn),xt.current=!0,me({anchorRect:null,item:{kind:e.isDirectory()?`directory`:`file`,name:vn.getAttribute(`aria-label`)??Xt,path:e.getPath()},path:e.getPath(),source:`button`}))},Dn={contextHoverPath:_n,contextMenuButtonTriggerEnabled:Ie,contextMenuButtonVisibility:Le,contextMenuEnabled:Pe,contextMenuRightClickEnabled:Re,contextMenuTriggerMode:Fe,controller:t,directoriesWithGitChanges:i,dragAndDropEnabled:$e,draggedPathSet:tt,dragTarget:nt,gitLaneActive:Ue,gitStatusByPath:n,handleRowDragEnd:Vt,handleRowDragStart:Bt,handleRowTouchStart:Ht,ignoredGitDirectories:r,ignoredInheritanceCache:ne,instanceId:o,itemHeight:s,onKeyDown:Ut,onRowClick:Tn,openContextMenuForRow:Tt,registerButton:ze,registerRenameInput:Ve,renameView:Ge,renderDecorationForRow:_t,resolveIcon:We,shouldSuppressContextMenu:Ot,visualFocusPath:gn},On={...Dn,registerButton:Be};return LU(`div`,{ref:S,id:it,"data-file-tree-context-menu-button-visibility":Pe&&Ie?Le:void 0,"data-file-tree-context-menu-trigger-mode":Pe?Fe:void 0,"data-file-tree-has-context-menu-action-lane":Pe&&Ie?`true`:void 0,"data-file-tree-has-git-lane":Ue?`true`:void 0,"data-file-tree-virtualized-root":`true`,"data-file-tree-root-drag-target":nt?.kind===`root`?`true`:void 0,onDragLeave:$e?tn:void 0,onDragOver:$e?en:void 0,onDrop:$e?nn:void 0,onKeyDown:Ut,onPointerLeave:Pe?$t:void 0,onPointerOver:Pe?Qt:void 0,role:`tree`,tabIndex:-1,style:{outline:`none`,position:`relative`},children:[LU(`style`,{"data-file-tree-guide-style":`true`,dangerouslySetInnerHTML:{__html:mn}}),LU(`slot`,{name:JL,"data-type":`header-slot`}),f?LU(`div`,{"data-file-tree-search-container":!0,"data-open":Je?`true`:`false`,children:LU(`input`,{ref:w,"aria-activedescendant":hn,"aria-controls":it,placeholder:`Search…`,"data-file-tree-search-input":!0,"data-file-tree-search-input-fake-focus":Ee?`true`:void 0,value:Ye,onBlur:()=>{d===`retain`&&!Oe.current||t.closeSearch()},onFocus:ke,onPointerDown:ke,onInput:e=>{ke();let n=e.currentTarget;t.setSearch(n.value)}})}):null,LU(`div`,{ref:C,"data-file-tree-virtualized-scroll":`true`,children:[h&&Me&&dt.length>0?LU(`div`,{"aria-hidden":`true`,"data-file-tree-sticky-overlay":`true`,children:LU(`div`,{"data-file-tree-sticky-overlay-content":`true`,style:{height:`${at}px`},children:dt.map((e,t)=>KG(On,e.row,`sticky:${sG(e.row)}`,{mode:`sticky`,style:{left:`0`,position:`absolute`,right:`0`,top:`${e.top}px`,zIndex:`${dt.length-t}`}}))})}):null,LU(`div`,{ref:b,"data-file-tree-virtualized-list":`true`,style:{height:`${pt}px`},children:[LU(`div`,{"data-file-tree-virtualized-sticky-offset":`true`,"aria-hidden":`true`,style:{height:`${J}px`}}),LU(`div`,{"data-file-tree-virtualized-sticky":`true`,style:{height:`${rn}px`,top:`${an}px`,bottom:`${on}px`},children:[qG(Dn,ut,ht),cn!=null&&ln!=null?KG(Dn,cn,`parked:${cn.path}`,{isParked:!0,style:{left:`0`,opacity:`0`,pointerEvents:rt===cn.path?`none`:void 0,position:`absolute`,right:`0`,top:`${ln}px`}}):null,fn!=null&&pn!=null?KG(Dn,fn,`parked-drag:${fn.path}`,{isParked:!0,style:{left:`0`,opacity:`0`,pointerEvents:`none`,position:`absolute`,right:`0`,top:`${pn}px`}}):null]})]})]}),Pe?LU(`div`,{ref:_,"data-type":`context-menu-anchor`,"data-visible":bn?`true`:`false`,style:Cn,children:[LU(`button`,{ref:v,type:`button`,"data-type":XL,"aria-label":`Options`,"aria-haspopup":`menu`,"aria-expanded":pe==null?`false`:`true`,"data-visible":yn?`true`:`false`,onMouseDown:e=>{e.preventDefault()},onClick:e=>{if(e.preventDefault(),e.stopPropagation(),pe!=null){Ct();return}En()},tabIndex:-1,style:wn,children:LU(VU,{...We(`file-tree-icon-ellipsis`)})}),pe==null?null:LU(`slot`,{name:YL})]}):null,pe==null?null:LU(`div`,{"data-type":`context-menu-wash`,"aria-hidden":`true`,onMouseDownCapture:e=>{e.preventDefault(),Ct()},onTouchStartCapture:e=>{e.preventDefault(),e.stopPropagation(),Ct()},onTouchMoveCapture:e=>{e.preventDefault(),e.stopPropagation()},onWheelCapture:e=>{e.preventDefault(),e.stopPropagation()}})]})}var YG={hydrateRoot:(e,t)=>{FU(dU(JG,t),e)},renderRoot:(e,t)=>{PU(dU(JG,t),e)},unmountRoot:e=>{PU(null,e)}};function XG(e,t){YG.renderRoot(e,t)}function ZG(e,t){YG.hydrateRoot(e,t)}function QG(e){YG.unmountRoot(e)}var $G=class{#e=new Map;#t=null;clearAll(){for(let e of this.#e.values())e.remove();this.#e.clear()}clearSlotContent(e){let t=this.#n(e);t!=null&&(t.remove(),this.#e.delete(e))}setHost(e){if(this.#t=e,e!=null){this.#i(e);for(let[e,t]of this.#e)this.#r(e,t)}}setSlotContent(e,t){let n=this.#n(e);if(n===t){t!=null&&(this.#e.set(e,t),this.#r(e,t));return}if(n?.remove(),t==null){this.#e.delete(e);return}this.#e.set(e,t),this.#r(e,t)}setSlotHtml(e,t){let n=t?.trim()??``;if(n.length===0){this.setSlotContent(e,null);return}let r=this.#n(e);if(r!=null&&r.innerHTML===n){this.#e.set(e,r),this.#r(e,r);return}let i=document.createElement(`div`);i.innerHTML=n,this.setSlotContent(e,i)}#n(e){let t=this.#e.get(e)??null;if(t!=null)return t;let n=this.#t;if(n==null)return null;for(let t of Array.from(n.children))if(t instanceof HTMLElement&&t.dataset.fileTreeManagedSlot===e)return t;return null}#r(e,t){t.slot=e,t.dataset.fileTreeManagedSlot=e,this.#t!=null&&t.parentNode!==this.#t&&this.#t.appendChild(t)}#i(e){for(let t of Array.from(e.children)){if(!(t instanceof HTMLElement))continue;let e=t.dataset.fileTreeManagedSlot;e==null||this.#e.has(e)||this.#e.set(e,t)}}},eK=`__c`,tK=`__k`,nK=`__d`,rK=`__s`,iK=/[\s\n\\/='"\0<>]/,aK=/^(xlink|xmlns|xml)([A-Z])/,oK=/^(?:accessK|auto[A-Z]|cell|ch|col|cont|cross|dateT|encT|form[A-Z]|frame|hrefL|inputM|maxL|minL|noV|playsI|popoverT|readO|rowS|src[A-Z]|tabI|useM|item[A-Z])/,sK=/^ac|^ali|arabic|basel|cap|clipPath$|clipRule$|color|dominant|enable|fill|flood|font|glyph[^R]|horiz|image|letter|lighting|marker[^WUH]|overline|panose|pointe|paint|rendering|shape|stop|strikethrough|stroke|text[^L]|transform|underline|unicode|units|^v[^i]|^w|^xH/,cK=new Set([`draggable`,`spellcheck`]);function lK(e){e.__g===void 0?e[nK]=!0:e.__g|=8}function uK(e){e.__g===void 0?e[nK]=!1:e.__g&=-9}function dK(e){return e.__g===void 0?!0===e[nK]:!!(8&e.__g)}var fK=/["&<]/;function pK(e){if(e.length===0||!1===fK.test(e))return e;for(var t=0,n=0,r=``,i=``;n<e.length;n++){switch(e.charCodeAt(n)){case 34:i=`"`;break;case 38:i=`&`;break;case 60:i=`<`;break;default:continue}n!==t&&(r+=e.slice(t,n)),r+=i,t=n+1}return n!==t&&(r+=e.slice(t,n)),r}var mK={},hK=new Set(`animation-iteration-count.border-image-outset.border-image-slice.border-image-width.box-flex.box-flex-group.box-ordinal-group.column-count.fill-opacity.flex.flex-grow.flex-negative.flex-order.flex-positive.flex-shrink.flood-opacity.font-weight.grid-column.grid-row.line-clamp.line-height.opacity.order.orphans.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-miterlimit.stroke-opacity.stroke-width.tab-size.widows.z-index.zoom`.split(`.`)),gK=/[A-Z]/g;function _K(e){var t=``;for(var n in e){var r=e[n];if(r!=null&&r!==``){var i=n[0]==`-`?n:mK[n]||(mK[n]=n.replace(gK,`-$&`).toLowerCase()),a=`;`;typeof r!=`number`||i.startsWith(`--`)||hK.has(i)||(a=`px;`),t=t+i+`:`+r+a}}return t||void 0}function vK(){this.__d=!0}function yK(e,t){return{__v:e,context:t,props:e.props,setState:vK,forceUpdate:vK,__d:!0,__h:[]}}function bK(e,t,n){if(!e.s){if(n instanceof xK){if(!n.s)return void(n.o=bK.bind(null,e,t));1&t&&(t=n.s),n=n.v}if(n&&n.then)return void n.then(bK.bind(null,e,t),bK.bind(null,e,2));e.s=t,e.v=n;let r=e.o;r&&r(e)}}var xK=function(){function e(){}return e.prototype.then=function(t,n){var r=new e,i=this.s;if(i){var a=1&i?t:n;if(a){try{bK(r,1,a(this.v))}catch(e){bK(r,2,e)}return r}return this}return this.o=function(e){try{var i=e.v;1&e.s?bK(r,1,t?t(i):i):n?bK(r,1,n(i)):bK(r,2,i)}catch(e){bK(r,2,e)}},r},e}(),SK,CK,wK,TK,EK={},DK=Array.isArray,OK=Object.assign,kK=``,AK=`<!--$s-->`,jK=`<!--/$s-->`;function MK(e,t){var n,r=e.type,i=!0;return e[eK]?(i=!1,(n=e[eK]).state=n[rK]):n=new r(e.props,t),e[eK]=n,n.__v=e,n.props=e.props,n.context=t,lK(n),n.state??=EK,n[rK]??(n[rK]=n.state),r.getDerivedStateFromProps?n.state=OK({},n.state,r.getDerivedStateFromProps(n.props,n.state)):i&&n.componentWillMount?(n.componentWillMount(),n.state=n[rK]===n.state?n.state:n[rK]):!i&&n.componentWillUpdate&&n.componentWillUpdate(),wK&&wK(e),n.render(n.props,n.state,t)}function NK(e,t,n,r,i,a,o){if(e==null||!0===e||!1===e||e===kK)return kK;var s=typeof e;if(s!=`object`)return s==`function`?kK:s==`string`?pK(e):e+kK;if(DK(e)){var c,l=kK;i[tK]=e;for(var u=e.length,d=0;d<u;d++){var f=e[d];if(f!=null&&typeof f!=`boolean`){var p,m=NK(f,t,n,r,i,a,o);typeof m==`string`?l+=m:(c||=Array(u),l&&c.push(l),l=kK,DK(m)?(p=c).push.apply(p,m):c.push(m))}}return c?(l&&c.push(l),c):l}if(e.constructor!==void 0)return kK;e.__=i,SK&&SK(e);var h=e.type,g=e.props;if(typeof h==`function`){var _,v,y,b=t;if(h===pU){if(`tpl`in g){for(var x=kK,S=0;S<g.tpl.length;S++)if(x+=g.tpl[S],g.exprs&&S<g.exprs.length){var C=g.exprs[S];if(C==null)continue;typeof C!=`object`||C.constructor!==void 0&&!DK(C)?x+=C:x+=NK(C,t,n,r,e,a,o)}return x}if(`UNSTABLE_comment`in g)return`<!--`+pK(g.UNSTABLE_comment)+`-->`;v=g.children}else{if((_=h.contextType)!=null){var w=t[_.__c];b=w?w.props.value:_.__}var T=h.prototype&&typeof h.prototype.render==`function`;if(T)v=MK(e,b),y=e[eK];else{e[eK]=y=yK(e,b);for(var E=0;dK(y)&&E++<25;){uK(y),wK&&wK(e);try{v=h.call(y,g,b)}catch(t){throw a&&t&&typeof t.then==`function`&&(e._suspended=!0),t}}lK(y)}if(y.getChildContext!=null&&(t=OK({},t,y.getChildContext())),T&&YH.errorBoundaries&&(h.getDerivedStateFromError||y.componentDidCatch)){v=v!=null&&v.type===pU&&v.key==null&&v.props.tpl==null?v.props.children:v;try{return NK(v,t,n,r,e,a,!1)}catch(i){return h.getDerivedStateFromError&&(y[rK]=h.getDerivedStateFromError(i)),y.componentDidCatch&&y.componentDidCatch(i,EK),dK(y)?(v=MK(e,t),(y=e[eK]).getChildContext!=null&&(t=OK({},t,y.getChildContext())),NK(v=v!=null&&v.type===pU&&v.key==null&&v.props.tpl==null?v.props.children:v,t,n,r,e,a,o)):kK}finally{CK&&CK(e),TK&&TK(e)}}}v=v!=null&&v.type===pU&&v.key==null&&v.props.tpl==null?v.props.children:v;try{var D=NK(v,t,n,r,e,a,o);return CK&&CK(e),YH.unmount&&YH.unmount(e),e._suspended?typeof D==`string`?AK+D+jK:DK(D)?(D.unshift(AK),D.push(jK),D):D.then(function(e){return AK+e+jK}):D}catch(i){if(!a&&o&&o.onError){var O=function i(s){return o.onError(s,e,function(e,s){try{return NK(e,t,n,r,s,a,o)}catch(e){return i(e)}})}(i);if(O!==void 0)return O;var k=YH.__e;return k&&k(i,e),kK}if(!a||!i||typeof i.then!=`function`)throw i;return i.then(function i(){try{var s=NK(v,t,n,r,e,a,o);return e._suspended?AK+s+jK:s}catch(e){if(!e||typeof e.then!=`function`)throw e;return e.then(i)}})}}var A,j=`<`+h,M=kK;for(var N in g){var P=g[N];if(typeof(P=FK(P)?P.value:P)!=`function`||N===`class`||N===`className`){switch(N){case`children`:A=P;continue;case`key`:case`ref`:case`__self`:case`__source`:continue;case`htmlFor`:if(`for`in g)continue;N=`for`;break;case`className`:if(`class`in g)continue;N=`class`;break;case`defaultChecked`:N=`checked`;break;case`defaultSelected`:N=`selected`;break;case`defaultValue`:case`value`:switch(N=`value`,h){case`textarea`:A=P;continue;case`select`:r=P;continue;case`option`:r!=P||`selected`in g||(j+=` selected`)}break;case`dangerouslySetInnerHTML`:M=P&&P.__html;continue;case`style`:typeof P==`object`&&(P=_K(P));break;case`acceptCharset`:N=`accept-charset`;break;case`httpEquiv`:N=`http-equiv`;break;default:if(aK.test(N))N=N.replace(aK,`$1:$2`).toLowerCase();else{if(iK.test(N))continue;N[4]!==`-`&&!cK.has(N)||P==null?n?sK.test(N)&&(N=N===`panose1`?`panose-1`:N.replace(/([A-Z])/g,`-$1`).toLowerCase()):oK.test(N)&&(N=N.toLowerCase()):P+=kK}}P!=null&&!1!==P&&(j=!0===P||P===kK?j+` `+N:j+` `+N+`="`+(typeof P==`string`?pK(P):P+kK)+`"`)}}if(iK.test(h))throw Error(h+` is not a valid HTML tag name in `+j+`>`);if(M||(typeof A==`string`?M=pK(A):A!=null&&!1!==A&&!0!==A&&(M=NK(A,t,h===`svg`||h!==`foreignObject`&&n,r,e,a,o))),CK&&CK(e),TK&&TK(e),!M&&PK.has(h))return j+`/>`;var F=`</`+h+`>`,I=j+`>`;return DK(M)?[I].concat(M,[F]):typeof M==`string`?I+M+F:[I,M,F]}var PK=new Set([`area`,`base`,`br`,`col`,`command`,`embed`,`hr`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`]);function FK(e){return typeof e==`object`&&!!e&&typeof e.peek==`function`&&`value`in e}var IK=0;function LK(e){return e!=null&&e.length>0?e:(IK+=1,`pst_ft_${IK}`)}function RK({initialVisibleRowCount:e,itemHeight:t}){return e==null?420:Math.max(0,e)*(t??KV)}function zK(e){if(typeof document>`u`)return;let t=document.createElement(`div`);t.innerHTML=e;let n=t.querySelector(`svg`);return n instanceof SVGElement?n:void 0}function BK(e){return e.querySelector(`#file-tree-icon-chevron`)instanceof SVGElement&&e.querySelector(`#file-tree-icon-file`)instanceof SVGElement&&e.querySelector(`#file-tree-icon-dot`)instanceof SVGElement&&e.querySelector(`#file-tree-icon-lock`)instanceof SVGElement}function VK(e){return Array.from(e.children).filter(e=>e instanceof SVGElement)}var HK=class{static LoadedCustomComponent=!0;#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=new $G;#u;#d;#f;#p;#m;#h;#g;#_;#v;#y=null;#b;#x=!1;#S=!1;constructor(e){let{composition:t,density:n,fileTreeSearchMode:r,gitStatus:i,id:a,initialSearchQuery:o,icons:s,itemHeight:c,onSearchChange:l,onSelectionChange:u,overscan:d,renderRowDecoration:f,renaming:p,search:m,searchBlurBehavior:h,searchFakeFocus:g,stickyFolders:_,unsafeCSS:v,initialVisibleRowCount:y,...b}=e;this.#e=t,this.#n=LK(a),this.#p=JH(i),this.#m=s,this.#h=v,this.#r=u,this.#i=f,this.#a=p!=null&&p!==!1,this.#o=h,this.#s=m===!0,this.#c=g===!0,this.#u=GV(n,c),this.#d={itemHeight:this.#u.itemHeight,overscan:d,stickyFolders:_,initialVisibleRowCount:y},this.#t=new UH({...b,fileTreeSearchMode:r,initialSearchQuery:o,onSearchChange:l,renaming:p}),this.#v=this.#t.getSelectionVersion(),this.#y=this.#r==null?null:this.subscribe(()=>{this.#D()})}unmount(){this.#b!=null&&(QG(this.#b),delete this.#b.dataset.fileTreeVirtualizedWrapper,this.#b=void 0),this.#l.clearAll(),this.#l.setHost(null),this.#f!=null&&(delete this.#f.dataset.fileTreeVirtualized,this.#I(this.#f),this.#f=void 0)}cleanUp(){this.unmount(),this.#y?.(),this.#y=null,this.#t.destroy()}getFileTreeContainer(){return this.#f}getItem(e){return this.#t.getItem(e)}getFocusedItem(){return this.#t.getFocusedItem()}getFocusedPath(){return this.#t.getFocusedPath()}getSelectedPaths(){return this.#t.getSelectedPaths()}getComposition(){return this.#e}getItemHeight(){return this.#u.itemHeight}getDensityFactor(){return this.#u.factor}subscribe(e){let t=!1;return this.#t.subscribe(()=>{if(!t){t=!0;return}e()})}focusPath(e){this.#t.focusPath(e)}scrollToPath(e,t){this.#t.scrollToPath(e,t)}focusNearestPath(e){return this.#t.focusNearestPath(e)}add(e){this.#t.add(e)}batch(e){this.#t.batch(e)}move(e,t,n){this.#t.move(e,t,n)}onMutation(e,t){return this.#t.onMutation(e,t)}setSearch(e){this.#t.setSearch(e)}openSearch(e){this.#t.openSearch(e)}closeSearch(){this.#t.closeSearch()}isSearchOpen(){return this.#t.isSearchOpen()}getSearchValue(){return this.#t.getSearchValue()}getSearchMatchingPaths(){return this.#t.getSearchMatchingPaths()}focusNextSearchMatch(){this.#t.focusNextSearchMatch()}focusPreviousSearchMatch(){this.#t.focusPreviousSearchMatch()}startRenaming(e,t){return this.#t.startRenaming(e,t)}remove(e,t){this.#t.remove(e,t)}resetPaths(e,t){this.#t.resetPaths(e,t)}setComposition(e){this.#e=e;let t=this.#T();t!=null&&(this.#O(),XG(t.wrapper,this.#w()))}setGitStatus(e){this.#p=JH(e,this.#p);let t=this.#T();t!=null&&XG(t.wrapper,this.#w())}setIcons(e){this.#m=e;let t=this.#T();t!=null&&(this.#E(t.host,t.wrapper),XG(t.wrapper,this.#w()))}hydrate({fileTreeContainer:e}){let t=this.#P(e),n=this.#N(t);this.#O(),ZG(n,this.#w())}render({containerWrapper:e,fileTreeContainer:t}){let n=this.#P(t??this.#f,e),r=this.#N(n);this.#O(),XG(r,this.#w())}#C(){return{initialViewportHeight:RK({initialVisibleRowCount:this.#d.initialVisibleRowCount,itemHeight:this.#d.itemHeight}),itemHeight:this.#d.itemHeight,overscan:this.#d.overscan,stickyFolders:this.#d.stickyFolders}}#w(){return{composition:this.#e,controller:this.#t,gitStatusByPath:this.#p?.statusByPath,ignoredGitDirectories:this.#p?.ignoredDirectoryPaths,directoriesWithGitChanges:this.#p?.directoriesWithChanges,icons:this.#m,instanceId:this.#n,renamingEnabled:this.#a,renderRowDecoration:this.#i,searchBlurBehavior:this.#o,searchEnabled:this.#s,searchFakeFocus:this.#c,slotHost:this.#l,...this.#C()}}#T(){let e=this.#f,t=this.#b;return e==null||t==null?null:{host:e,wrapper:t}}#E(e,t){let n=e.shadowRoot;n!=null&&(this.#k(n),this.#A(n)),this.#j(t)}#D(){let e=this.#r;if(e==null)return;let t=this.#t.getSelectionVersion();t!==this.#v&&(this.#v=t,e(this.#t.getSelectedPaths()))}#O(){let e=this.#e?.header?.render;if(e!=null){this.#l.setSlotContent(JL,e());return}this.#l.setSlotHtml(JL,this.#e?.header?.html??null)}#k(e){let t=VK(e).find(e=>BK(e)),n=zK(RL(QL(this.#m).set));n!=null&&(t!=null&&t.outerHTML===n.outerHTML||(t==null?e.prepend(n):t.replaceWith(n)))}#A(e){let t=VK(e),n=t.find(e=>BK(e)),r=t.filter(e=>e!==n),i=QL(this.#m).spriteSheet?.trim()??``;if(i.length===0){for(let e of r)e.remove();return}let a=zK(i);if(a==null){for(let e of r)e.remove();return}if(!(r.length===1&&r[0].outerHTML===a.outerHTML)){for(let e of r)e.remove();e.appendChild(a)}}#j(e){let t=QL(this.#m);t.colored&&BL(t.set)?e.dataset.fileTreeColoredIcons=`true`:delete e.dataset.fileTreeColoredIcons}#M(e){let t=e.querySelector(`style[${WL}]`);if(this.#g==null&&t instanceof HTMLStyleElement&&(this.#g=t),this.#h==null||this.#h===``){this.#g?.remove(),this.#g=void 0,this.#_=void 0;return}this.#g?.parentNode===e&&this.#_===this.#h||(this.#g??=document.createElement(`style`),this.#g.setAttribute(WL,``),this.#g.parentNode!==e&&e.appendChild(this.#g),this.#g.textContent=XV(this.#h),this.#_=this.#h)}#N(e){if(this.#b!=null)return this.#b;let t=e.shadowRoot;if(t==null)throw Error(`FileTree requires a shadow root`);let n=Array.from(t.children).filter(e=>e instanceof HTMLDivElement&&typeof e.dataset.fileTreeId==`string`&&e.dataset.fileTreeId.length>0),r=n.find(e=>e.dataset.fileTreeId===this.#n)??n[0];return r!=null&&(this.#n=r.dataset.fileTreeId??this.#n),this.#b=r??document.createElement(`div`),this.#b.dataset.fileTreeId=this.#n,this.#b.dataset.fileTreeVirtualizedWrapper=`true`,this.#E(e,this.#b),this.#b.parentNode!==t&&t.appendChild(this.#b),this.#b}#P(e,t){let n=e??this.#f??document.createElement(`file-tree-container`);t!=null&&n.parentNode!==t&&t.appendChild(n);let r=n.shadowRoot??n.attachShadow({mode:`open`});return nH(n,r),this.#M(r),n.dataset.fileTreeVirtualized=`true`,n.style.display=`flex`,this.#F(n),this.#l.setHost(n),this.#f=n,n}#F(e){e.style.getPropertyValue(`--trees-item-height`)===``&&(e.style.setProperty(`--trees-item-height`,`${String(this.#u.itemHeight)}px`),this.#x=!0),e.style.getPropertyValue(`--trees-density-override`)===``&&(e.style.setProperty(`--trees-density-override`,String(this.#u.factor)),this.#S=!0)}#I(e){this.#x&&=(e.style.removeProperty(`--trees-item-height`),!1),this.#S&&=(e.style.removeProperty(`--trees-density-override`),!1)}},UK=typeof window>`u`?Q.useEffect:Q.useLayoutEffect;function WK(e,t,n){let r=e==null?null:(0,Z.jsx)(`div`,{slot:JL,children:e}),i=t!=null&&n!=null?(0,Z.jsx)(`div`,{slot:YL,children:t(n.item,n.context)}):null;return r==null&&i==null?null:(0,Z.jsxs)(Z.Fragment,{children:[r,i]})}function GK(e,t){return typeof window>`u`&&t!=null?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`template`,{shadowrootmode:`open`,dangerouslySetInnerHTML:{__html:t.shadowHtml}}),e]}):(0,Z.jsx)(Z.Fragment,{children:e})}function KK(e){let t=e.shadowRoot;return t?.querySelector(`[data-file-tree-id]`)instanceof HTMLElement||t?.querySelector(`[data-file-tree-id]`)instanceof SVGElement?!0:e.querySelector(`template[shadowrootmode="open"]`)instanceof HTMLTemplateElement}function qK(e,t,n,r,i){let a={...e??{}};if(t!=null&&delete a.header,n){let t=e?.contextMenu,n=t?.onClose,o=t?.onOpen;a.contextMenu={...t??{},enabled:!0,onClose:()=>{n?.(),r()},onOpen:(e,t)=>{i(e,t),o?.(e,t)}},delete a.contextMenu.render}return a.header!=null||a.contextMenu!=null?a:void 0}function JK({header:e,id:t,model:n,preloadedData:r,renderContextMenu:i,...a}){let[o,s]=(0,Q.useState)(null),[c,l]=(0,Q.useState)(null),u=(0,Q.useRef)(n.getComposition()),d=(0,Q.useRef)(n);d.current!==n&&(d.current=n,u.current=n.getComposition());let f=i!=null,p=(0,Q.useCallback)(()=>{s(null)},[]),m=(0,Q.useCallback)((e,t)=>{s({context:t,item:e})},[]),h=u.current,g=(0,Q.useMemo)(()=>qK(h,e,f,p,m),[h,p,m,f,e]),_=(0,Q.useCallback)(e=>{l(e)},[]);(0,Q.useEffect)(()=>{f||s(null)},[f]),UK(()=>{n.setComposition(g)},[g,n]),UK(()=>{if(c!=null)return r!=null&&KK(c)?n.hydrate({fileTreeContainer:c}):n.render({fileTreeContainer:c}),()=>{n.unmount(),n.setComposition(h)}},[h,c,n,r]);let v=GK(WK(e,i,o),r),y=t??r?.id,b={"--trees-item-height":`${String(n.getItemHeight())}px`,"--trees-density-override":n.getDensityFactor(),...a.style};return(0,Z.jsx)(HL,{...a,id:y,ref:_,style:b,suppressHydrationWarning:r!=null,children:v})}function YK(e){let[t]=(0,Q.useState)(()=>new HK(e)),n=(0,Q.useRef)({timeout:null,model:t});return(0,Q.useEffect)(()=>{let{current:e}=n;return e.timeout!=null&&(clearTimeout(e.timeout),e.timeout=null),()=>{e.timeout=setTimeout(()=>e.model.cleanUp(),1)}},[]),{model:t}}var XK={density:`compact`,itemHeight:26,flattenEmptyDirectories:!1},ZK={"--trees-level-gap-override":`4px`,"--trees-item-row-gap-override":`4px`,"--trees-icon-width-override":`14px`,"--trees-item-height":`${XK.itemHeight}px`,"--trees-indent-guide-bg-override":`color-mix(in oklab, var(--trees-fg-muted) 30%, transparent)`},QK=`
|
|
1866
|
+
}`}var cH=new WeakMap;function lH(e){let t=cH.get(e);if(t!=null)return t;let n=document.createElement(`div`);n.setAttribute(nR,`true`);let r=document.createElement(`div`);r.style.position=`relative`,r.style.height=`200%`,n.appendChild(r),e.appendChild(n);let i=Math.max(n.offsetWidth-n.clientWidth,0);return n.remove(),cH.set(e,i),i}function uH(e,t){if(!e.isConnected)return;let n=lH(t);if(n==null)return;let r=t.querySelector(`style[${rR}]`),i=r instanceof HTMLStyleElement?r:document.createElement(`style`);r instanceof HTMLStyleElement||(i.setAttribute(rR,``),t.appendChild(i)),i.textContent=`:host { ${iR}: ${n}px; }`}var dH;function fH(e){if(typeof CSSStyleSheet<`u`&&typeof CSSStyleSheet.prototype.replaceSync==`function`&&`adoptedStyleSheets`in e){dH??(dH=new CSSStyleSheet,dH.replaceSync(oH(iH)));let t=!1;try{e.adoptedStyleSheets=[dH],t=!0}catch{}if(t){e.querySelector(`style[${eR}]`)?.remove();return}}if(e.querySelector(`style[data-file-tree-style]`)==null){let t=document.createElement(`style`);t.setAttribute(eR,``),t.textContent=oH(iH),e.prepend(t)}}function pH(e,t){mH(e,t),fH(t),uH(e,t)}function mH(e,t){let n=e.querySelector(`template[shadowrootmode="open"], template[data-file-tree-shadowrootmode="open"]`);n instanceof HTMLTemplateElement&&(t.childNodes.length>0||(t.appendChild(n.content.cloneNode(!0)),n.hasAttribute(`shadowrootmode`)&&n.remove()))}if(typeof HTMLElement<`u`&&customElements.get(`file-tree-container`)==null){class e extends HTMLElement{constructor(){super()}connectedCallback(){let e=this.shadowRoot??this.attachShadow({mode:`open`});pH(this,e)}}if(customElements.define($L,e),typeof document<`u`)for(let e of Array.from(document.querySelectorAll($L)))e instanceof HTMLElement&&pH(e,e.shadowRoot??e.attachShadow({mode:`open`}))}var hH=e=>e.startsWith(`f::`)?e.slice(3):e;function gH(e){let t=e.lastIndexOf(`/`);return t<0?{parentPath:``,baseName:e}:{parentPath:e.slice(0,t),baseName:e.slice(t+1)}}function _H(e,t){return e===``?t:`${e}/${t}`}function vH({files:e,path:t,isFolder:n,nextBasename:r}){let i=hH(t),a=r.trim();if(a.length===0)return{error:`Name cannot be empty.`};if(a.includes(`/`))return{error:`Name cannot include "/".`};let{parentPath:o,baseName:s}=gH(i);if(a===s)return{nextFiles:e,sourcePath:i,destinationPath:i,isFolder:n};let c=_H(o,a),l=Array(e.length),u=new Set;if(!n){let t=`${c}/`,r=!1;for(let n=0;n<e.length;n++){let a=e[n];if(a!==i&&a.startsWith(t))return{error:`"${c}" already exists.`};let o=a===i?c:a;if(u.has(o))return{error:`"${c}" already exists.`};u.add(o),l[n]=o,a===i&&(r=!0)}return r?{nextFiles:l,sourcePath:i,destinationPath:c,isFolder:n}:{error:`Could not find the selected file to rename.`}}let d=`${i}/`,f=`${c}/`,p=0;for(let t=0;t<e.length;t++){let n=e[t],r=n===i||n.startsWith(d);if(!r&&(n===c||n.startsWith(f)))return{error:`"${c}" already exists.`};let a=r?`${c}${n.slice(i.length)}`:n;if(u.has(a))return{error:`"${c}" already exists.`};u.add(a),l[t]=a,r&&p++}return p===0?{error:`Could not find the selected folder to rename.`}:{nextFiles:l,sourcePath:i,destinationPath:c,isFolder:n}}function yH(e){return e.endsWith(`/`)}function bH(e){let t=e.endsWith(`/`)?e.slice(0,-1):e,n=t.lastIndexOf(`/`),r=n<0?t:t.slice(n+1);return e.endsWith(`/`)?`${r}/`:r}function xH(e){let t=[],n=new Set;for(let r of e)n.has(r)||(n.add(r),t.push(r));let r=new Set;for(let e of t.toSorted((e,t)=>e.length===t.length?e.localeCompare(t):e.length-t.length)){let t=(e.endsWith(`/`)?e.slice(0,-1):e).split(`/`),n=!1;for(let e=0;e<t.length-1;e+=1){let i=`${t.slice(0,e+1).join(`/`)}/`;if(r.has(i)){n=!0;break}}n||r.add(e)}return t.filter(e=>r.has(e))}function SH(e,t){return t.includes(e)?xH(t):[e]}function CH(e,t){return e===t?!0:e==null||t==null?!1:e.kind===t.kind&&e.directoryPath===t.directoryPath&&e.flattenedSegmentPath===t.flattenedSegmentPath&&e.hoveredPath===t.hoveredPath}function wH(e,t){return{draggedPaths:e,target:t}}function TH(e,t){if(t.kind!==`directory`||t.directoryPath==null)return!1;for(let n of e)if(yH(n)&&(t.directoryPath===n||t.directoryPath.startsWith(n)))return!0;return!1}function EH(e,t){return t.kind===`root`||t.directoryPath==null?bH(e):t.directoryPath}function DH(e,t){let n=e.map(e=>{let n=EH(e,t);return n===e?null:{from:e,to:n,type:`move`}}).filter(e=>e!=null);return n.length===0?null:{operations:n,result:{draggedPaths:e,operation:n.length===1?`move`:`batch`,target:t}}}function OH(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]!==t[n])return!1;return!0}function kH(e,t,n){let{paths:r,preparedInput:i}=e;if(i==null){if(r==null)throw Error(`FileTree requires paths or preparedInput`);return{paths:r,preparedInput:void 0}}let a=i.paths;if(r==null)return{paths:a,preparedInput:i};if(!OH($V.preparePaths(r,n==null?{}:{sort:n}),a))throw Error(`FileTree ${t} received paths and preparedInput for different path lists`);return{paths:a,preparedInput:i}}function AH(e){return e.operation===`add`||e.operation===`remove`||e.operation===`move`||e.operation===`batch`}function jH(e,t,n){if(e===t)return n;let r=t.endsWith(`/`)?t:`${t}/`;return e.startsWith(r)?`${n.endsWith(`/`)?n:`${n}/`}${e.slice(r.length)}`:e}function MH(e,t){if(e===t)return!0;let n=t.endsWith(`/`)?t:`${t}/`;return e.startsWith(n)}function NH(e,t,n=!1){if(e==null)return null;switch(t.operation){case`add`:case`expand`:case`collapse`:case`mark-directory-unloaded`:case`begin-child-load`:case`apply-child-patch`:case`complete-child-load`:case`fail-child-load`:case`cleanup`:return e;case`remove`:return MH(e,t.path)?n?e:null:e;case`move`:return jH(e,t.from,t.to);case`batch`:{let r=e;for(let e of t.events)if(r=NH(r,e,n),r==null)return null;return r}}}function PH(e){return{canonicalChanged:e.canonicalChanged,projectionChanged:e.projectionChanged,visibleCountDelta:e.visibleCountDelta}}function FH(e){switch(e.operation){case`add`:return{...PH(e),operation:`add`,path:e.path};case`remove`:return{...PH(e),operation:`remove`,path:e.path,recursive:e.recursive};case`move`:return{...PH(e),from:e.from,operation:`move`,to:e.to}}}function IH(e){return{...PH(e),events:e.events.filter(e=>e.operation===`add`||e.operation===`remove`||e.operation===`move`).map(e=>FH(e)),operation:`batch`}}function LH(e){switch(e.operation){case`add`:case`remove`:case`move`:return FH(e);case`batch`:return IH(e);default:return null}}function RH(e,t){if(e.size!==t.length)return!1;for(let n of t)if(!e.has(n))return!1;return!0}function zH(e){let t=e.endsWith(`/`)?e.slice(0,-1):e;if(t.length===0)return[];let n=t.split(`/`);return n.slice(0,-1).map((e,t)=>`${n.slice(0,t+1).join(`/`)}/`)}function BH(e){return zH(e).at(-1)??null}function VH(e,t){return t==null?e:e.startsWith(t)?e.slice(t.length):e}function HH(e){return e.endsWith(`/`)}var UH=e=>e.toLowerCase();function WH(e){let t=e.endsWith(`/`)?e.slice(0,-1):e,n=t.lastIndexOf(`/`);return n<0?t:t.slice(n+1)}function GH(e){return e.endsWith(`/`)?e.slice(0,-1):e}function KH(e,t){return t&&!e.endsWith(`/`)?`${e}/`:e}var qH=e=>{let t=e.trim();return t.length===0?``:(t.includes(`\\`)?t.replaceAll(`\\`,`/`):t).toLowerCase()},JH=Symbol(`FILE_TREE_RENAME_VIEW`),YH=512,XH=512;function ZH(e){return e===`top`||e===`center`?e:`nearest`}function QH(e,t,n){if(e===0)return-1;if(n!=null){let e=t(n);if(e!=null)return e;let r=zH(n);for(let e=r.length-1;e>=0;--e){let n=r[e];if(n==null)continue;let i=t(n);if(i!=null)return i}}return 0}function $H(e,t,n){if(e.paths.length===0)return{focusedIndex:-1,getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex};if(t==null)return{focusedIndex:0,getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex};let r=n??(t=>e.visibleIndexByPath.get(t)??null);return{focusedIndex:QH(e.paths.length,r,t),getParentIndex:e.getParentIndex,paths:e.paths,posInSetByIndex:e.posInSetByIndex,setSizeByIndex:e.setSizeByIndex}}var eU=class{#e;#t=new Set;#n=new Map;#r=null;#i=null;#a=new Map;#o=new Map;#s=-1;#c=null;#l=!1;#u=e=>-1;#d=new Map;#f=null;#p=null;#m=null;#h=null;#g=null;#_;#v;#y;#b=[];#x=new Int32Array;#S=new Int32Array;#C=void 0;#w=!1;#T=null;#E=``;#D=!1;#O=new Set;#k=[];#A;#j=null;#M=null;#N=null;#P=null;#F=null;#I=null;#L=null;#R=0;#z=null;#B=new Set;#V=0;#H;#U=0;#W=!1;#G=0;#K;constructor(e){let{dragAndDrop:t,fileTreeSearchMode:n,initialSearchQuery:r,initialSelectedPaths:i,renaming:a,onSearchChange:o,paths:s,preparedInput:c,...l}=e,u=kH({paths:s,preparedInput:c},`constructor`,l.sort);this.#e=l,t!=null&&t!==!1&&(this.#r=t===!0?{}:t),this.#w=a!=null&&a!==!1,a!=null&&a!==!1&&a!==!0&&(this.#C=a.canRename,this.#v=a.onError,this.#_=a.onRename),this.#y=o,this.#A=n??`hide-non-matches`,this.#H=this.#le(u.paths,u.preparedInput);let d=i?.map(e=>this.#Ne(e)).filter(e=>e!=null)??[],f=d.at(-1)??null;d.length>0&&(this.#B=new Set(d),this.#z=f,this.#V=1),this.#je(f,!1),r!=null&&this.#Te(r,!1),this.#K=this.#Re()}destroy(){this.#K?.(),this.#K=null,this.#n.clear(),this.#t.clear(),this.#d.clear(),this.#i=null,this.#he()}focusFirstItem(){this.#be().length>0&&this.#Fe(0)}focusLastItem(){this.#G<=0||(this.#Ie(),this.#Fe(this.#G-1))}focusNextItem(){this.#Ae(1)}focusParentItem(){if(this.#c==null)return;let e=BH(this.#c);if(e==null)return;let t=this.#Z(e);t>=0&&this.#Fe(t)}focusPath(e){let t=this.#H.getPathInfo(e)?.path??null;if(t==null)return;this.#Ie();let n=this.#Z(t);n>=0&&this.#Fe(n)}scrollToPath(e,t){let n=this.#H.getPathInfo(e)?.path??null;if(n==null)return;this.#Ie();let r=this.#xe(n);r<0||this.#Me(r)!=null&&(t?.focus!==!1&&this.#Fe(r,!1),this.#L={id:this.#R+=1,offset:ZH(t?.offset),visibleIndex:r},this.#De())}focusMountedPathFromInput(e){let t=this.#H.getPathInfo(e)?.path??null;if(t==null)return;let n=this.#Z(t);n>=0&&this.#Fe(n)}focusNearestPath(e){let t=this.resolveNearestVisiblePath(e);if(t==null)return null;let n=this.#Z(t);return n>=0?(this.#Fe(n),this.#be()[n]??t):null}focusPreviousItem(){this.#Ae(-1)}getFocusedIndex(){return this.#s}getFocusedItem(){return this.#c==null?null:this.#Q(this.#c)}getFocusedPath(){return this.#c}getScrollRequest(){return this.#L}clearScrollRequest(e){this.#L?.id===e&&(this.#L=null)}resolveNearestVisiblePath(e){let t=this.#be();if(this.#G===0)return null;if(e==null)return this.#c??t[0]??null;let n=this.#H.getPathInfo(e)?.path??e,r=this.#Z(n);return r>=0?t[r]??n:this.#X(n)??this.#c??t[0]??null}getSelectedPaths(){return[...this.#B]}getSelectionVersion(){return this.#V}getVisibleCount(){return this.#G}getVisibleRows(e,t){if(t<e||this.#G===0)return[];let n=Math.max(0,e),r=Math.min(this.#G-1,t);if(r<n)return[];let i=r-n+1;if(this.#F==null&&!this.#l&&r>=this.#b.length&&i<=XH){let e=[];for(let t=n;t<=r;t+=1){let n=this.#H.getVisibleRowContext(t);if(n==null)break;e.push(this.#ee(n))}return e}if(!this.#l&&r>=this.#b.length&&this.#Ie(),this.#F!=null){let e=Array.from({length:r-n+1},(e,t)=>this.#Se(n+t)),t=new Map,i=e[0]??-1,a=i;for(let n=1;n<=e.length;n+=1){let r=e[n];if(r!=null&&r===a+1){a=r;continue}if(i>=0&&this.#H.getVisibleSlice(i,a).forEach((e,n)=>{t.set(i+n,e)}),r==null){i=-1,a=-1;continue}i=r,a=r}return Array.from({length:r-n+1},(e,r)=>{let i=n+r,a=this.#Se(i),o=t.get(a),s=this.#b[a];if(o==null||s==null)throw Error(`Missing projection row for filtered visible index ${String(i)}`);return this.#$(o,i,a,{ancestorPaths:this.#re(a),path:s})})}return this.#H.getVisibleSlice(n,r).map((e,t)=>{let r=n+t,i=this.#b[r];if(i==null)throw Error(`Missing projection path for visible index ${String(r)}`);return this.#$(e,r,r,{ancestorPaths:this.#re(r),path:i})})}getStickyRowCandidates(e,t){if(this.#F!=null)return null;if(this.#G===0||e<=0||t<=0)return[];let n=[];for(let r=0;r<this.#G;r+=1){let i=e+r*t,a=Math.min(this.#G-1,Math.floor(i/t)),o=this.#te(a,r)??(a>0?this.#te(a-1,r):void 0);if(o==null)break;n.push({row:this.#ee(o),subtreeEndIndex:o.subtreeEndIndex})}return n}getItem(e){let t=this.#H.getPathInfo(e);return t==null?null:this.#Q(t.path,t)}resolveMountedDirectoryPathFromInput(e){let t=this.#H.getPathInfo(e);return t?.kind===`directory`?t.path:null}toggleMountedDirectoryFromInput(e){let t=this.resolveMountedDirectoryPathFromInput(e);t!=null&&this.#ze(t)}selectAllVisiblePaths(){this.#Ie();let e=[...this.#be()];this.#ae(e,this.#c??this.#z)}selectOnlyPath(e){let t=this.#Ne(e);t!=null&&this.#ae([t],t)}selectOnlyMountedPathFromInput(e){this.#ae([e],e)}selectPath(e){let t=this.#Ne(e);t==null||this.#B.has(t)||this.#ae([...this.#B,t])}deselectPath(e){let t=this.#Ne(e);t==null||!this.#B.has(t)||this.#ae([...this.#B].filter(e=>e!==t))}toggleFocusedSelection(){this.#c!=null&&this.togglePathSelectionFromInput(this.#c)}togglePathSelection(e){let t=this.#Ne(e);if(t!=null){if(this.#B.has(t)){this.deselectPath(t);return}this.selectPath(t)}}togglePathSelectionFromInput(e){let t=this.#Ne(e);if(t!=null){if(this.#B.has(t)){this.#ae([...this.#B].filter(e=>e!==t),t);return}this.#ae([...this.#B,t],t)}}selectPathRange(e,t){let n=this.#Ne(e);if(n==null)return;this.#Ie();let r=this.#z,i=r==null?-1:this.#Ce(r),a=this.#Ce(n);if(i===-1||a===-1){let e=t?[...this.#B,n]:[n];this.#ae(e,n);return}let[o,s]=i<=a?[i,a]:[a,i],c=this.#be().slice(o,s+1),l=t?[...this.#B,...c]:c;this.#ae(l,r)}extendSelectionFromFocused(e){if(this.#c==null)return;let t=this.#s;if(t===-1)return;let n=Math.min(this.#G-1,Math.max(0,t+e));if(n===t)return;!this.#l&&n>=this.#b.length&&this.#Ie();let r=this.#be(),i=r[t]??null,a=r[n]??null;if(i==null||a==null)return;let o=new Set(this.#B);o.has(i)&&o.has(a)?o.delete(i):o.add(a),this.#ae([...o],this.#z??i,!1),this.#Fe(n)}getDragAndDropConfig(){return this.#r}isDragAndDropEnabled(){return this.#r!=null}getDragSession(){return this.#i==null?null:{draggedPaths:[...this.#i.draggedPaths],primaryPath:this.#i.primaryPath,target:this.#i.target==null?null:{...this.#i.target}}}startDrag(e){if(this.#r==null)return!1;let t=this.#Ne(e);if(t==null||this.#M!=null&&this.#M.length>0)return!1;let n=this.getSelectedPaths(),r=SH(t,n);return this.#r.canDrag?.(r)===!1?!1:(n.includes(t)||this.#ae([t],t,!1),this.#Pe(t),this.#i={draggedPaths:r,primaryPath:t,target:null},this.#De(),!0)}setDragTarget(e){let t=this.#i;if(t==null)return;let n=e;if(n!=null){let e=wH(t.draggedPaths,n);(TH(t.draggedPaths,n)||this.#r?.canDrop?.(e)===!1)&&(n=null)}CH(t.target,n)||(this.#i={...t,target:n},this.#De())}cancelDrag(){this.#i!=null&&(this.#i=null,this.#De())}completeDrag(){let e=this.#i;if(e==null)return!1;this.#i=null;let t=e.target==null?null:{...e.target};if(t==null)return this.#De(),!1;let n=wH(e.draggedPaths,t);if(TH(e.draggedPaths,t)||this.#r?.canDrop?.(n)===!1)return this.#De(),!1;let r=DH(e.draggedPaths,t);if(r==null)return this.#De(),!1;try{if(r.operations.length===1){let e=r.operations[0];if(e==null||e.type!==`move`)throw Error(`Expected a single move operation for one-item drops`);this.#H.move(e.from,e.to,{collision:e.collision})}else this.#ce(r.operations),this.#H.batch(r.operations)}catch(e){return this.#De(),this.#r?.onDropError?.(e instanceof Error?e.message:String(e),n),!1}return this.#r?.onDropComplete?.(r.result),!0}subscribe(e){return this.#t.add(e),e(),()=>{this.#t.delete(e)}}add(e){this.#H.add(e)}remove(e,t={}){this.#H.remove(e,t)}move(e,t,n={}){this.#H.move(e,t,n)}batch(e){this.#H.batch(e)}onMutation(e,t){let n=e,r=t,i=this.#n.get(n);return i??(i=new Set,this.#n.set(n,i)),i.add(r),()=>{let e=this.#n.get(n);e?.delete(r),e?.size===0&&this.#n.delete(n)}}setSearch(e){this.#Te(e,!0)}openSearch(e=``){this.#Te(e,!0)}closeSearch(){this.#Te(null,!0)}isSearchOpen(){return this.#M!==null}getSearchValue(){return this.#M??``}getSearchMatchingPaths(){return this.#k}focusNextSearchMatch(){this.#we(1)}focusPreviousSearchMatch(){this.#we(-1)}startRenaming(e=this.#c??``,t={}){if(!this.#w)return!1;let n=this.#H.getPathInfo(e);if(n==null)return!1;let r=n.path,i=HH(r),a=GH(r);if(this.#C?.({isFolder:i,path:a})===!1)return!1;for(let e of zH(r))this.#H.isExpanded(e)||this.#H.expand(e);return this.#ae([r],r,!1),this.#M!=null&&(this.#Te(null,!1),this.#y?.(this.#M)),this.#Pe(r),this.#T=r,this.#E=WH(r),this.#D=t.removeIfCanceled??!1,this.#De(),!0}[JH](){return{cancel:()=>{this.#q()},commit:()=>{this.#J()},getPath:()=>this.#T,getValue:()=>this.#E,isActive:()=>this.#T!=null,setValue:e=>{this.#Y(e)}}}#q(){if(this.#T==null)return;let e=this.#T,t=this.#D;if(this.#T=null,this.#E=``,this.#D=!1,t){this.remove(e,HH(e)?{recursive:!0}:void 0);return}this.#Pe(e),this.#De()}#J(){let e=this.#T;if(e==null)return;if(this.#D&&this.#E.trim().length===0){this.#T=null,this.#E=``,this.#D=!1,this.remove(e,HH(e)?{recursive:!0}:void 0);return}let t=HH(e),n=vH({files:this.#H.list(),isFolder:t,nextBasename:this.#E,path:GH(e)});if(this.#T=null,this.#E=``,this.#D=!1,`error`in n){this.#Pe(e),this.#v?.(n.error),this.#De();return}if(n.sourcePath===n.destinationPath){this.#Pe(e),this.#De();return}this.#_?.({destinationPath:n.destinationPath,isFolder:n.isFolder,sourcePath:n.sourcePath}),this.move(KH(n.sourcePath,t),KH(n.destinationPath,t))}#Y(e){this.#T==null||this.#E===e||(this.#E=e,this.#De())}resetPaths(e,t={}){let n=this.#H.list().length,r=this.#G,i=kH({paths:e,preparedInput:t.preparedInput},`resetPaths`,this.#e.sort),a=this.#le(i.paths,i.preparedInput,t.initialExpandedPaths),o=this.#c,s=this.#T,c=this.getSelectedPaths(),l=this.#z;this.#K?.(),this.#H=a,this.#d.clear(),this.#he();let u=c.map(e=>a.getPathInfo(e)?.path??null).filter(e=>e!=null),d=!RH(this.#B,u);this.#B=new Set(u),d&&(this.#V+=1),this.#z=l==null?null:a.getPathInfo(l)?.path??null,this.#T=s==null?null:a.getPathInfo(s)?.path??null,this.#T??(this.#E=``,this.#D=!1),this.#je(o,o!=null||u.length>0||this.#z!=null),this.#K=this.#Re(),this.#De(),this.#Oe({canonicalChanged:!0,operation:`reset`,pathCountAfter:i.paths.length,pathCountBefore:n,projectionChanged:!0,usedPreparedInput:t.preparedInput!=null,visibleCountDelta:this.#G-r})}#X(e){this.#Ie();let t=BH(e),n=VH(e,t),r=null,i=null;for(let e of this.#be()){if(BH(e)!==t)continue;let a=VH(e,t);if(a<n){r=e;continue}if(a>n){i=e;break}}return r??i}#Z(e){let t=this.#Ce(e);if(t!==-1)return t;let n=zH(e);for(let e=n.length-1;e>=0;--e){let t=n[e];if(t==null)continue;let r=this.#Ce(t);if(r!==-1)return r}return this.#be().length>0?0:-1}#Q(e,t){let n=this.#d.get(e);if(n!=null)return n;let r=t??this.#H.getPathInfo(e);if(r==null)return null;let i=r.kind===`directory`?this.#oe(r.path):this.#se(r.path);return this.#d.set(r.path,i),i}#$(e,t,n,r){return{ancestorPaths:r.ancestorPaths,depth:e.depth,flattenedSegments:e.flattenedSegments?.map(e=>({isTerminal:e.isTerminal,name:e.name,path:e.path})),hasChildren:e.hasChildren,index:t,isExpanded:e.isExpanded,isFlattened:e.isFlattened,isFocused:r.path===this.#c,isSelected:this.#B.has(r.path),kind:e.kind,level:e.depth,name:e.name,path:r.path,posInSet:r.posInSet??this.#x[n]??0,setSize:r.setSize??this.#S[n]??0}}#ee(e){return this.#$(e.row,e.index,e.index,{ancestorPaths:e.ancestorPaths,path:e.row.path,posInSet:e.posInSet,setSize:e.setSize})}#te(e,t){let n=this.#H.getVisibleRowContext(e);return n==null?void 0:n.ancestorRows[t]??(t===n.ancestorRows.length&&n.row.kind===`directory`&&n.row.isExpanded?n:void 0)}#ne(e){let t=this.#a.get(e);if(t!=null)return t;let n=this.#u(e),r=n<0?[]:[...this.#ne(n),n];return this.#a.set(e,r),r}#re(e){let t=this.#o.get(e);if(t!=null)return t;let n=this.#ne(e).map(e=>this.#b[e]??``).filter(e=>e!==``);return this.#o.set(e,n),n}#ie(e){this.#H.collapse(e)}#ae(e,t=this.#z,n=!0){let r=[...new Set(e)],i=!RH(this.#B,r),a=this.#z!==t;!i&&!a||(this.#B=new Set(r),this.#z=t,i&&(this.#V+=1),n&&this.#De())}#oe(e){return{collapse:()=>{this.#ie(e)},deselect:()=>{this.deselectPath(e)},expand:()=>{this.#ke(e)},focus:()=>{this.focusPath(e)},getPath:()=>e,isDirectory:()=>!0,isExpanded:()=>this.#H.isExpanded(e),isFocused:()=>this.#c===e,isSelected:()=>this.#B.has(e),select:()=>{this.selectPath(e)},toggleSelect:()=>{this.togglePathSelection(e)},toggle:()=>{this.#ze(e)}}}#se(e){return{deselect:()=>{this.deselectPath(e)},focus:()=>{this.focusPath(e)},getPath:()=>e,isDirectory:()=>!1,isFocused:()=>this.#c===e,isSelected:()=>this.#B.has(e),select:()=>{this.selectPath(e)},toggleSelect:()=>{this.togglePathSelection(e)}}}#ce(e){let t=this.#H.list();this.#le(t).batch(e)}#le(e,t,n){return new $V({...this.#e,paths:e,preparedInput:t??void 0,...n===void 0?{}:{initialExpandedPaths:n}})}#ue(){return this.#h??=this.#H.list(),this.#h}#de(){if(this.#m!=null)return this.#m;let e=new Set;for(let t of this.#ue()){e.add(t);for(let n of zH(t))e.add(n)}return this.#m=[...e].sort(),this.#m}#fe(){return this.#g??=this.#ue().map(UH),this.#g}#pe(){return this.#f??=this.#de().filter(e=>e.endsWith(`/`)),this.#f}#me(){return this.#p??=this.#pe().map(UH),this.#p}#he(){this.#f=null,this.#p=null,this.#m=null,this.#h=null,this.#g=null}#ge(){return this.#pe().filter(e=>this.#H.isExpanded(e))}#_e(e){let t=new Set(this.#j??[]);if(e)for(let e of this.#B)for(let n of zH(e))t.add(n);this.#ve(t)}#ve(e){this.#W=!0;try{for(let t of this.#pe()){let n=e.has(t),r=this.#H.isExpanded(t);n&&!r?this.#H.expand(t):!n&&r&&this.#H.collapse(t)}}finally{this.#W=!1}}#ye(){if(this.#M==null||this.#M.length===0){this.#k=[],this.#F=null,this.#I=null,this.#P=null,this.#G=this.#U;return}let e=this.#b;if(this.#k=e.filter(e=>this.#O.has(e)),this.#A!==`hide-non-matches`||this.#O.size===0){this.#F=null,this.#I=null,this.#P=null,this.#G=this.#U;return}let t=[],n=[],r=new Map;for(let[i,a]of e.entries())this.#N?.has(a)===!0&&(r.set(a,n.length),t.push(i),n.push(a));this.#F=t,this.#I=n,this.#P=r,this.#G=n.length}#be(){return this.#I??this.#b}#xe(e){return this.#I==null?this.#H.getVisibleIndex(e)??-1:this.#P?.get(e)??-1}#Se(e){return this.#F?.[e]??e}#Ce(e){return this.#P?.get(e)??this.#H.getVisibleIndex(e)??-1}#we(e){let t=this.#k;if(t.length===0)return;let n=this.#c,r=n==null?-1:t.indexOf(n),i=t[r<0?e>0?0:t.length-1:Math.min(t.length-1,Math.max(0,r+e))];i!=null&&this.focusPath(i)}#Te(e,t){let n=e==null?null:qH(e),r=this.#M;if(r!==n){if(r==null&&n!=null&&(this.#j=this.#ge()),this.#M=n,n==null)this.#_e(!0),this.#j=null,this.#O.clear(),this.#N=null,this.#je(this.#c,!0);else if(n.length===0)this.#_e(!1),this.#O.clear(),this.#N=null,this.#je(this.#c,!0);else{let e=this.#Ee();this.#je(e,!0)}t&&(this.#y?.(this.#M),this.#De())}}#Ee(){if(this.#M==null||this.#M.length===0)return this.#O.clear(),this.#c;let e=this.#M,t=this.#ue(),n=this.#fe(),r=[],i=new Set,a=null;for(let o=0;o<t.length;o+=1){if(!n[o].includes(e))continue;let s=t[o];r.push(s),i.add(s),a??=s}let o=this.#pe(),s=this.#me();for(let t=0;t<o.length;t+=1){if(!s[t].includes(e))continue;let n=o[t];i.has(n)||(r.push(n),i.add(n),a??=n)}this.#O=i;let c=this.#A===`hide-non-matches`&&r.length>0?new Set:null;this.#N=c;let l=this.#A===`expand-matches`?new Set(this.#j??[]):new Set;for(let e of r){c?.add(e),e.endsWith(`/`)&&l.add(e);for(let t of zH(e))l.add(t),c?.add(t)}return this.#ve(l),a??this.#c}#De(){for(let e of this.#t)e()}#Oe(e){this.#n.get(e.operation)?.forEach(t=>{t(e)}),this.#n.get(`*`)?.forEach(t=>{t(e)})}#ke(e){for(let t of zH(e))this.#H.isExpanded(t)||this.#H.expand(t);this.#H.isExpanded(e)||this.#H.expand(e)}#Ae(e){let t=this.#G;if(t===0)return;let n=this.#s===-1?0:this.#s,r=Math.min(t-1,Math.max(0,n+e));(r!==n||this.#s===-1)&&(!this.#l&&this.#F==null&&r>=this.#b.length&&this.#Ie(),this.#Fe(r))}#je(e,t=!0){let n=this.#H.getVisibleCount();this.#U=n;let r=$H(this.#H.getVisibleTreeProjectionData(t?void 0:Math.min(n,YH)),e,t?e=>this.#H.getVisibleIndex(e):void 0);this.#a.clear(),this.#o.clear(),this.#l=r.paths.length>=n,this.#u=r.getParentIndex,this.#b=r.paths,this.#x=r.posInSetByIndex,this.#S=r.setSizeByIndex,this.#ye(),this.#s=e==null?this.#be().length>0?0:-1:this.#Z(e),this.#c=this.#s<0?null:this.#Me(this.#s)}#Me(e){return this.#be()[e]??(this.#F==null?this.#H.getVisibleRowContext(e)?.row.path??null:null)}#Ne(e){return this.#H.getPathInfo(e)?.path??null}#Pe(e){if(e==null)return;let t=this.#Z(e);t>=0&&this.#Fe(t,!1)}#Fe(e,t=!0){let n=this.#Me(e);n!=null&&(this.#s===e&&this.#c===n||(this.#s=e,this.#c=n,t&&this.#De()))}#Ie(){this.#l||this.#je(this.#c,!0)}#Le(e){let t=NH(this.#T,e);t==null&&this.#T!=null&&(this.#E=``),this.#T=t;let n=NH(this.#c,e,!0),r=[...this.#B].map(t=>NH(t,e)).filter(e=>e!=null).map(e=>this.#H.getPathInfo(e)?.path??null).filter(e=>e!=null),i=NH(this.#z,e),a=i==null?null:this.#H.getPathInfo(i)?.path??null,o=[...new Set(r)];return RH(this.#B,o)||(this.#B=new Set(o),this.#V+=1),this.#z=a,n}#Re(){return this.#H.on(`*`,e=>{if(this.#W)return;e.canonicalChanged&&(this.#d.clear(),this.#he()),this.#i!=null&&AH(e)&&(this.#i=null);let t=AH(e)?this.#Le(e):this.#c,n=this.#M!=null&&this.#M.length>0?this.#Ee():this.#M===``?this.#c:t,r=this.#M!=null||e.operation!==`expand`&&e.operation!==`collapse`;this.#je(n,r),this.#De();let i=LH(e);i!=null&&this.#Oe(i)})}#ze(e){if(this.#H.isExpanded(e)){this.#ie(e);return}this.#ke(e)}},tU=e=>{if(e==null||e.length===0)return`0`;let t=`${e.length}`;for(let n of e)t+=`\0${n.path}\0${n.status}`;return t};function nU(e){let t=e.endsWith(`/`),n=``,r=-1;for(let t=0;t<=e.length;t+=1){if(!(e[t]===`/`||t===e.length)){r===-1&&(r=t);continue}r!==-1&&(n!==``&&(n+=`/`),n+=e.slice(r,t),r=-1)}return n===``?null:{isDirectory:t,path:n}}function rU(e){let t=e.endsWith(`/`)?e.slice(0,-1):e;if(t.length===0)return[];let n=t.split(`/`);return n.slice(0,-1).map((e,t)=>`${n.slice(0,t+1).join(`/`)}/`)}function iU(e,t){return t?`${e}/`:e}function aU(e,t=null){let n=tU(e==null?void 0:[...e]);if(n===`0`)return null;if(t?.signature===n)return t;let r=new Map,i=new Set,a=new Set;for(let t of e??[]){let e=nU(t.path);if(e==null)continue;let n=iU(e.path,e.isDirectory);r.set(n,t.status),t.status===`ignored`&&e.isDirectory?a.add(n):e.isDirectory&&a.delete(n);for(let t of rU(e.path))i.add(t)}return{directoriesWithChanges:i,ignoredDirectoryPaths:a,signature:n,statusByPath:r}}var oU,sU,cU,lU,uU,dU,fU,pU,mU,hU,gU={},_U=[],vU=Array.isArray,yU=_U.slice,bU=Object.assign;function xU(e){e&&e.parentNode&&e.remove()}function SU(e,t,n){var r,i,a,o={};for(a in t)a==`key`?r=t[a]:a==`ref`&&typeof e!=`function`?i=t[a]:o[a]=t[a];return arguments.length>2&&(o.children=arguments.length>3?yU.call(arguments,2):n),CU(e,o,r,i,null)}function CU(e,t,n,r,i){var a={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++sU,__i:-1,__u:0};return i==null&&oU.vnode!=null&&oU.vnode(a),a}function wU(e){return e.children}function TU(e,t){this.props=e,this.context=t,this.__g=0}function EU(e,t){if(t==null)return e.__?EU(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type==`function`?EU(e):null}function DU(e){var t,n;if((e=e.__)!=null&&e.__c!=null){for(e.__e=null,t=0;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null){e.__e=n.__e;break}return DU(e)}}function OU(e){(8&e.__g||!(e.__g|=8)||!cU.push(e)||uU++)&&lU==oU.debounceRendering||((lU=oU.debounceRendering)||queueMicrotask)(kU)}function kU(){for(var e,t,n,r,i,a,o,s,c=1;cU.length;)cU.length>c&&cU.sort(dU),e=cU.shift(),c=cU.length,8&e.__g&&(n=void 0,i=(r=(t=e).__v).__e,a=[],o=[],(s=t.__P)&&((n=bU({},r)).__v=r.__v+1,oU.vnode&&oU.vnode(n),LU(s,n,r,t.__n,s.namespaceURI,32&r.__u?[i]:null,a,i??EU(r),!!(32&r.__u),o,s.ownerDocument),n.__v=r.__v,n.__.__k[n.__i]=n,zU(a,n,o),n.__e!=i&&DU(n)));uU=0}function AU(e,t,n,r,i,a,o,s,c,l,u,d){var f,p,m,h,g,_,v,y=r&&r.__k||_U,b=t.length;for(c=jU(n,t,y,c,b),f=0;f<b;f++)(m=n.__k[f])!=null&&(p=m.__i==-1?gU:y[m.__i]||gU,m.__i=f,_=LU(e,m,p,i,a,o,s,c,l,u,d),h=m.__e,m.ref&&p.ref!=m.ref&&(p.ref&&HU(p.ref,null,m),u.push(m.ref,m.__c||h,m)),g==null&&h!=null&&(g=h),(v=!!(4&m.__u))||p.__k===m.__k?c=MU(m,c,e,v):typeof m.type==`function`&&_!==void 0?c=_:h&&(c=h.nextSibling),m.__u&=-7);return n.__e=g,c}function jU(e,t,n,r,i){var a,o,s,c,l,u=n.length,d=u,f=0;for(e.__k=Array(i),a=0;a<i;a++)(o=t[a])!=null&&typeof o!=`boolean`&&typeof o!=`function`?(c=a+f,(o=e.__k[a]=typeof o==`string`||typeof o==`number`||typeof o==`bigint`||o.constructor==String?CU(null,o,null,null,null):vU(o)?CU(wU,{children:o},null,null,null):o.constructor==null&&o.__b>0?CU(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=e,o.__b=e.__b+1,s=null,(l=o.__i=NU(o,n,c,d))!=-1&&(d--,(s=n[l])&&(s.__u|=2)),s==null||s.__v==null?(l==-1&&(i>u?f--:i<u&&f++),typeof o.type!=`function`&&(o.__u|=4)):l!=c&&(l==c-1?f--:l==c+1?f++:(l>c?f--:f++,o.__u|=4))):e.__k[a]=null;if(d)for(a=0;a<u;a++)(s=n[a])!=null&&!(2&s.__u)&&(s.__e==r&&(r=EU(s)),UU(s,s));return r}function MU(e,t,n,r){var i,a;if(typeof e.type==`function`){for(i=e.__k,a=0;i&&a<i.length;a++)i[a]&&(i[a].__=e,t=MU(i[a],t,n,r));return t}e.__e!=t&&(r&&(t&&e.type&&!t.parentNode&&(t=EU(e)),n.insertBefore(e.__e,t||null)),t=e.__e);do t&&=t.nextSibling;while(t!=null&&t.nodeType==8);return t}function NU(e,t,n,r){var i,a,o,s=e.key,c=e.type,l=t[n],u=l!=null&&(2&l.__u)==0;if(l===null&&e.key==null||u&&s==l.key&&c==l.type)return n;if(r>+!!u){for(i=n-1,a=n+1;i>=0||a<t.length;)if((l=t[o=i>=0?i--:a++])!=null&&!(2&l.__u)&&s==l.key&&c==l.type)return o}return-1}function PU(e,t,n){t[0]==`-`?e.setProperty(t,n??``):e[t]=n??``}function FU(e,t,n,r,i){var a;n:if(t==`style`)if(typeof n==`string`)e.style.cssText=n;else{if(typeof r==`string`&&(e.style.cssText=r=``),r)for(t in r)n&&t in n||PU(e.style,t,``);if(n)for(t in n)r&&n[t]==r[t]||PU(e.style,t,n[t])}else if(t[0]==`o`&&t[1]==`n`)a=t!=(t=t.replace(fU,`$1`)),(t=t.slice(2))[0].toLowerCase()!=t[0]&&(t=t.toLowerCase()),e.__l||={},e.__l[t+a]=n,n?r?n.l=r.l:(n.l=pU,e.addEventListener(t,a?hU:mU,a)):e.removeEventListener(t,a?hU:mU,a);else{if(i==`http://www.w3.org/2000/svg`)t=t.replace(/xlink(H|:h)/,`h`).replace(/sName$/,`s`);else if(t!=`width`&&t!=`height`&&t!=`href`&&t!=`list`&&t!=`form`&&t!=`tabIndex`&&t!=`download`&&t!=`rowSpan`&&t!=`colSpan`&&t!=`role`&&t!=`popover`&&t in e)try{e[t]=n??``;break n}catch{}typeof n==`function`||(n==null||!1===n&&t[4]!=`-`?e.removeAttribute(t):e.setAttribute(t,t==`popover`&&n==1?``:n))}}function IU(e){return function(t){if(this.__l){var n=this.__l[t.type+e];if(t.u==null)t.u=pU++;else if(t.u<n.l)return;return n(oU.event?oU.event(t):t)}}}function LU(e,t,n,r,i,a,o,s,c,l,u){var d,f,p,m,h,g,_,v,y,b,x,S,C,w,T,E,D,O,k,A,j,M=t.type;if(t.constructor!=null)return null;128&n.__u&&(c=!!(32&n.__u),n.__c.__z&&(s=t.__e=n.__e=(a=n.__c.__z)[0],n.__c.__z=null)),(d=oU.__b)&&d(t);n:if(typeof M==`function`)try{if(v=t.props,y=`prototype`in M&&M.prototype.render,b=(d=M.contextType)&&r[d.__c],x=d?b?b.props.value:d.__:r,n.__c?2&(f=t.__c=n.__c).__g&&(f.__g|=1,_=!0):(y?t.__c=f=new M(v,x):(t.__c=f=new TU(v,x),f.constructor=M,f.render=WU),b&&b.sub(f),f.props=v,f.state||={},f.context=x,f.__n=r,p=!0,f.__g|=8,f.__h=[],f._sb=[]),y&&f.__s==null&&(f.__s=f.state),y&&M.getDerivedStateFromProps!=null&&(f.__s==f.state&&(f.__s=bU({},f.__s)),bU(f.__s,M.getDerivedStateFromProps(v,f.__s))),m=f.props,h=f.state,f.__v=t,p)y&&M.getDerivedStateFromProps==null&&f.componentWillMount!=null&&f.componentWillMount(),y&&f.componentDidMount!=null&&f.__h.push(f.componentDidMount);else{if(y&&M.getDerivedStateFromProps==null&&v!==m&&f.componentWillReceiveProps!=null&&f.componentWillReceiveProps(v,x),!(4&f.__g)&&f.shouldComponentUpdate!=null&&!1===f.shouldComponentUpdate(v,f.__s,x)||t.__v==n.__v){for(t.__v!=n.__v&&(f.props=v,f.state=f.__s,f.__g&=-9),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(e){e&&(e.__=t)}),S=0;S<f._sb.length;S++)f.__h.push(f._sb[S]);f._sb=[],f.__h.length&&o.push(f);break n}f.componentWillUpdate!=null&&f.componentWillUpdate(v,f.__s,x),y&&f.componentDidUpdate!=null&&f.__h.push(function(){f.componentDidUpdate(m,h,g)})}if(f.context=x,f.props=v,f.__P=e,f.__g&=-5,C=oU.__r,w=0,y){for(f.state=f.__s,f.__g&=-9,C&&C(t),d=f.render(f.props,f.state,f.context),T=0;T<f._sb.length;T++)f.__h.push(f._sb[T]);f._sb=[]}else do f.__g&=-9,C&&C(t),d=f.render(f.props,f.state,f.context),f.state=f.__s;while(8&f.__g&&++w<25);f.state=f.__s,f.getChildContext!=null&&(r=bU({},r,f.getChildContext())),y&&!p&&f.getSnapshotBeforeUpdate!=null&&(g=f.getSnapshotBeforeUpdate(m,h)),E=d,d!=null&&d.type===wU&&d.key==null&&(E=BU(d.props.children)),s=AU(e,vU(E)?E:[E],t,n,r,i,a,o,s,c,l,u),t.__u&=-161,f.__h.length&&o.push(f),_&&(f.__g&=-4)}catch(e){if(t.__v=null,c||a!=null)if(e.then){for(D=0,O=!1,t.__u|=c?160:128,t.__c.__z=[],k=0;k<a.length;k++)(A=a[k])==null||O||(A.nodeType==8&&A.data==`$s`?(D>0&&t.__c.__z.push(A),D++,a[k]=null):A.nodeType==8&&A.data==`/$s`?(--D>0&&t.__c.__z.push(A),O=D===0,s=a[k],a[k]=null):D>0&&(t.__c.__z.push(A),a[k]=null));if(!O){for(;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;a[a.indexOf(s)]=null,t.__c.__z=[s]}t.__e=s}else{for(j=a.length;j--;)xU(a[j]);RU(t)}else t.__e=n.__e,t.__k=n.__k,e.then||RU(t);oU.__e(e,t,n)}else s=t.__e=VU(n.__e,t,n,r,i,a,o,c,l,u);return(d=oU.diffed)&&d(t),128&t.__u?void 0:s}function RU(e){e&&e.__c&&(e.__c.__g|=4),e&&e.__k&&e.__k.forEach(RU)}function zU(e,t,n){for(var r=0;r<n.length;r++)HU(n[r],n[++r],n[++r]);oU.__c&&oU.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){oU.__e(e,t.__v)}})}function BU(e){return typeof e!=`object`||!e||e.__b&&e.__b>0?e:vU(e)?e.map(BU):bU({},e)}function VU(e,t,n,r,i,a,o,s,c,l){var u,d,f,p,m,h,g,_,v=n.props,y=t.props,b=t.type;if(b==`svg`?i=`http://www.w3.org/2000/svg`:b==`math`?i=`http://www.w3.org/1998/Math/MathML`:i||=`http://www.w3.org/1999/xhtml`,a!=null){for(u=0;u<a.length;u++)if((m=a[u])&&`setAttribute`in m==!!b&&(b?m.localName==b:m.nodeType==3)){e=m,a[u]=null;break}}if(e==null){if(b==null)return l.createTextNode(y);e=l.createElementNS(i,b,y.is&&y),s&&=(oU.__m&&oU.__m(t,a),!1),a=null}if(b==null)v===y||s&&e.data==y||(e.data=y);else{if(a&&=yU.call(e.childNodes),v=n.props||gU,!s&&a!=null)for(v={},u=0;u<e.attributes.length;u++)v[(m=e.attributes[u]).name]=m.value;for(u in v)if(m=v[u],u!=`children`){if(u==`dangerouslySetInnerHTML`)f=m;else if(!(u in y)){if(u==`value`&&`defaultValue`in y||u==`checked`&&`defaultChecked`in y)continue;FU(e,u,null,m,i)}}for(u in _=1&n.__u,y)m=y[u],u==`children`?p=m:u==`dangerouslySetInnerHTML`?d=m:u==`value`?h=m:u==`checked`?g=m:s&&typeof m!=`function`||v[u]===m&&!_||FU(e,u,m,v[u],i);if(d)s||f&&(d.__html==f.__html||d.__html==e.innerHTML)||(e.innerHTML=d.__html),t.__k=[];else if(f&&(e.innerHTML=``),AU(b==`template`?e.content:e,vU(p)?p:[p],t,n,r,b==`foreignObject`?`http://www.w3.org/1999/xhtml`:i,a,o,a?a[0]:n.__k&&EU(n,0),s,c,l),a!=null)for(u=a.length;u--;)xU(a[u]);s||(u=`value`,b==`progress`&&h==null?e.removeAttribute(`value`):h==null||h===e[u]&&(b!==`progress`||h)||FU(e,u,h,v[u],i),u=`checked`,g!=null&&g!=e[u]&&FU(e,u,g,v[u],i))}return e}function HU(e,t,n){try{if(typeof e==`function`){var r=typeof e.__u==`function`;r&&e.__u(),r&&t==null||(e.__u=e(t))}else e.current=t}catch(e){oU.__e(e,n)}}function UU(e,t,n){var r,i;if(oU.unmount&&oU.unmount(e),(r=e.ref)&&(r.current&&r.current!=e.__e||HU(r,null,t)),(r=e.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){oU.__e(e,t)}r.__P=null}if(r=e.__k)for(i=0;i<r.length;i++)r[i]&&UU(r[i],t,n||typeof e.type!=`function`);n||xU(e.__e),e.__e&&e.__e.__l&&(e.__e.__l=null),e.__e=e.__c=e.__=null}function WU(e,t,n){return this.constructor(e,n)}function GU(e,t){var n,r,i,a;t==document&&(t=document.documentElement),oU.__&&oU.__(e,t),r=(n=!!(e&&32&e.__u))?null:t.__k,e=t.__k=SU(wU,null,[e]),i=[],a=[],LU(t,e,r||gU,gU,t.namespaceURI,r?null:t.firstChild?yU.call(t.childNodes):null,i,r?r.__e:t.firstChild,n,a,t.ownerDocument),zU(i,e,a)}function KU(e,t){e.__u|=32,GU(e,t)}oU={__e:function(e,t,n,r){for(var i,a,o;t=t.__;)if((i=t.__c)&&!(1&i.__g)){i.__g|=4;try{if((a=i.constructor)&&a.getDerivedStateFromError!=null&&(i.setState(a.getDerivedStateFromError(e)),o=8&i.__g),i.componentDidCatch!=null&&(i.componentDidCatch(e,r||{}),o=8&i.__g),o)return void(i.__g|=2)}catch(t){e=t}}throw uU=0,e}},sU=0,TU.prototype.setState=function(e,t){var n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=bU({},this.state);typeof e==`function`&&(e=e(bU({},n),this.props)),e&&bU(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),OU(this))},TU.prototype.forceUpdate=function(e){this.__v&&(this.__g|=4,e&&this.__h.push(e),OU(this))},TU.prototype.render=wU,cU=[],uU=0,dU=function(e,t){return e.__v.__b-t.__v.__b},fU=/(PointerCapture)$|Capture$/i,pU=0,mU=IU(!1),hU=IU(!0);var qU=0;Array.isArray;function JU(e,t,n,r,i,a){t||={};var o,s,c=t;if(`ref`in c&&typeof e!=`function`)for(s in c={},t)s==`ref`?o=t[s]:c[s]=t[s];var l={type:e,props:c,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--qU,__i:-1,__u:0,__source:i,__self:a};return oU.vnode&&oU.vnode(l),l}var YU=16,XU=16,ZU={};function QU({name:e,remappedFrom:t,token:n,width:r,height:i,viewBox:a,label:o,alignCapitals:s=!1}){"use no memo";let c=`#${e.replace(/^#/,``)}`,{width:l,height:u,viewBox:d}=ZU[e]??{width:YU,height:XU},f=r??l,p=i??u,m=a??d??`0 0 ${l} ${u}`;return JU(`svg`,{"data-icon-name":t??e,"data-icon-token":n,"data-align-capitals":s,...o==null?{"aria-hidden":!0}:{"aria-label":o,role:`img`},viewBox:m,width:f,height:p,children:JU(`use`,{href:c})})}var $U=e=>{if(e.length<2)return[e,``];let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]},eW=e=>{if(e.length<4)return[e,``];let t=e.lastIndexOf(`.`)+1,n=e.length-t>10,r=t>=1&&!n?t:Math.ceil(e.length/2);return[e.slice(0,r),e.slice(r)]},tW=e=>{if(e.length<4)return[e,``];let t=e.lastIndexOf(`/`)+1,n=e.length-t>25,r=t>=1&&!n?t:Math.ceil(e.length/2);return[e.slice(0,r),e.slice(r)]},nW=(e,{splitIndex:t}={})=>{if(typeof t!=`number`){let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]}return[e.slice(0,t),e.slice(t)]},rW=(e,{splitOffset:t}={})=>{if(typeof t!=`number`||t<=0||t>=e.length){let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]}let n=e.length-t;return[e.slice(0,n),e.slice(n)]},iW=(e,{splitOffset:t}={})=>{if(typeof t!=`number`||t<=0||t>=e.length){let t=Math.ceil(e.length/2);return[e.slice(0,t),e.slice(t)]}let n=t;return[e.slice(0,n),e.slice(n)]};function aW({children:e,marker:t,variant:n=`default`}){"use no memo";return JU(`div`,{"aria-hidden":!0,"data-truncate-marker-cell":!0,children:JU(`div`,{"data-truncate-marker":!0,children:typeof t==`function`?t({children:e}):n===`fade`?JU(`span`,{"data-truncate-fade":!0}):t})})}function oW(e){"use no memo";let{mode:t,children:n}=e;return JU(`div`,{children:[JU(`div`,{"data-truncate-content":`visible`,children:t===`fruncate`?JU(`span`,{children:n}):n}),JU(`div`,{"data-truncate-content":`overflow`,"aria-hidden":!0,children:t===`fruncate`?JU(`span`,{children:n}):n})]})}function sW({children:e,mode:t=`truncate`,marker:n=`…`,variant:r=`default`,...i}){"use no memo";let a=JU(oW,{mode:t,children:e},`content`),o=JU(aW,{marker:n,mode:t,variant:r},`marker`),s=JU(`div`,{"data-truncate-fill":!0},`fill`);return JU(`div`,{"data-truncate-container":t,"data-truncate-variant":r,...i,children:JU(`div`,{"data-truncate-grid":!0,children:t===`truncate`?[a,o]:[o,a,s]})})}function cW({children:e,...t}){"use no memo";return JU(sW,{mode:`truncate`,...t,children:e})}function lW({children:e,...t}){"use no memo";return JU(sW,{mode:`fruncate`,...t,children:e})}function uW({children:e,contents:t,priority:n=`end`,split:r=`center`,minimumLength:i=12,className:a,style:o,...s}){"use no memo";let c=null,l=null;if(Array.isArray(t)){if(t.length!==2)return console.error(`MiddleTruncate: contents must be an array of two items`),null;c=JU(cW,{...s,children:t[0]}),l=JU(lW,{...s,children:t[1]})}else{if(typeof e!=`string`)return console.error(`MiddleTruncate: children must be a string`),null;if(e.length===0)return JU(`div`,{className:a,style:o});if(e.length<i)return JU(n===`end`?lW:cW,{...s,className:a,style:o,children:e});let t=null,u=null,d=null;if(typeof r==`string`)r===`center`?t=$U:r===`extension`?t=eW:r===`leaf-path`&&(t=tW);else if(typeof r==`number`)t=nW,u=r;else if(Array.isArray(r)){let[e,n]=r;d=n,e===`last`?t=rW:e===`first`&&(t=iW)}else typeof r==`function`&&(t=r);t??=$U;let[f,p]=t(e,{priority:n,variant:s.variant,splitIndex:typeof u==`number`?u:void 0,splitOffset:typeof d==`number`?d:void 0}),m=f.length>=p.length,h=n===`equal`&&!m,g=n===`equal`&&m,_={},v={};h&&(_.marker=``),g&&(v.marker=``),c=JU(cW,{...s,..._,children:f}),l=JU(lW,{...s,...v,children:p})}return JU(`div`,{"data-truncate-group-container":`middle`,className:a,style:o,children:[JU(`div`,{"data-truncate-segment-priority":n===`start`||n===`equal`?`1`:`2`,children:c}),JU(`div`,{"data-truncate-segment-priority":n===`end`||n===`equal`?`1`:`2`,children:l})]})}var dW={endIndex:-1,startIndex:-1};function fW(e,t,n){return Math.min(Math.max(e,t),n)}function pW(e,t){return e<0||t<e?dW:{endIndex:t,startIndex:e}}function mW(e){return e.startIndex<0||e.endIndex<e.startIndex}function hW(e,t){return mW(e)?0:(e.endIndex-e.startIndex+1)*t}function gW(e,t,n){if(t<=0)return-1;let r=t*n;return e<=0?0:e>=r?t:Math.floor(e/n)}function _W(e,t,n){return t<=0||e<=0?-1:e>=t*n?t-1:Math.ceil(e/n)-1}function vW(e){let t=new Map;return e.forEach((e,n)=>{if(e.kind!==`directory`||!e.isExpanded)return;let r=e.ancestorPaths.length,i=t.get(r);if(i==null){t.set(r,[n]);return}i.push(n)}),t}function yW(e,t){let n=0,r=e.length-1,i=-1;for(;n<=r;){let a=Math.floor((n+r)/2),o=e[a];if(o==null)break;if(o<=t){i=a,n=a+1;continue}r=a-1}return i}function bW(e){let t=new Map,n=[];for(let r=0;r<e.length;r+=1){let i=e[r];if(i==null)continue;let a=i.kind===`directory`&&i.isExpanded?[...i.ancestorPaths,i.path]:i.ancestorPaths,o=0;for(;o<n.length&&o<a.length&&n[o]===a[o];)o+=1;for(let e=n.length-1;e>=o;--e){let i=n[e];i!=null&&t.set(i,r-1)}n.length=o;for(let e=o;e<a.length;e+=1){let t=a[e];t!=null&&n.push(t)}}let r=e.length-1;for(let e of n)t.set(e,r);return t}function xW(e,t,n){if(e.length===0||t<=0)return[];let r=bW(e),i=vW(e),a=[];for(let r=0;r<e.length;r+=1){let o=i.get(r);if(o==null||o.length===0)break;let s=t+r*n,c=yW(o,Math.min(e.length-1,Math.floor(s/n))),l=null;for(;c>=0;){let t=o[c],n=t==null?null:e[t]??null;if(n!=null&&(r===0||n.ancestorPaths[r-1]===a[r-1]?.path)){l=n;break}--c}if(l==null)break;a.push(l)}return a.map((i,a)=>{let o=a*n,s=(r.get(i.path)??e.length-1)+1;if(s>=e.length)return{row:i,top:o};let c=s*n-t;return{row:i,top:Math.min(o,c-n)}}).filter(e=>e.top+n>0)}function SW(e,t){let n=t.totalRowCount??e.length,r=n*t.itemHeight,i=Math.max(0,t.viewportHeight),a=Math.max(0,Math.floor(t.overscan)),o=Math.max(0,r-i),s=fW(t.scrollTop,0,o),c=t.stickyRows??xW(e,s,t.itemHeight),l=c.reduce((e,n)=>Math.max(e,n.top+t.itemHeight),0),u=Math.min(r,s+l),d=Math.max(0,i-l),f=Math.max(0,r-u),p=gW(s,n,t.itemHeight),m=gW(u,n,t.itemHeight),h=l<=0||p<0||p>=n?-1:p,g=h===-1?-1:Math.min(n-1,m-1),_=h===-1||g<h?0:g-h+1,v=d<=0||m>=n?dW:pW(m,_W(u+d,n,t.itemHeight)),y=g+1,b=mW(v)?dW:pW(Math.max(y,v.startIndex-a),Math.min(n-1,v.endIndex+a)),x=hW(b,t.itemHeight);return{occlusion:{firstOccludedIndex:h,lastOccludedIndex:g,occludedCount:_},physical:{itemHeight:t.itemHeight,maxScrollTop:o,overscan:a,scrollTop:s,totalHeight:r,totalRowCount:n,viewportHeight:i},projected:{contentHeight:f,paneHeight:d,paneTop:u},sticky:{height:l,rows:c},visible:v,window:{endIndex:b.endIndex,height:x,offsetTop:mW(b)?0:b.startIndex*t.itemHeight,startIndex:b.startIndex}}}var CW={added:`A`,deleted:`D`,ignored:null,modified:`M`,renamed:`R`,untracked:`U`},wW={added:`Git status: added`,deleted:`Git status: deleted`,ignored:`Git status: ignored`,modified:`Git status: modified`,renamed:`Git status: renamed`,untracked:`Git status: untracked`},TW=`Contains git status items`;function EW(e){let{currentScrollTop:t,focusedIndex:n,itemHeight:r,topInset:i=0,viewportHeight:a}=e;if(n<0)return null;let o=Math.max(0,i),s=n*r,c=s+r;if(s<t+o){let e=Math.max(0,s-o);return e===t?null:e}if(c>t+a){let e=c-a;return e===t?null:e}return null}function DW(e){let{currentScrollTop:t,focusedIndex:n,itemHeight:r,offset:i,topInset:a=0,totalHeight:o,viewportHeight:s}=e;if(i===`nearest`)return EW({currentScrollTop:t,focusedIndex:n,itemHeight:r,topInset:a,viewportHeight:s});if(n<0)return null;let c=Math.max(0,a),l=n*r,u=Math.max(0,s-c),d=i===`center`?c+Math.max(0,(u-r)/2):c,f=Math.max(0,o-s),p=Math.max(0,Math.min(l-d,f));return p===t?null:p}function OW(e){let{currentScrollTop:t,focusedIndex:n,itemHeight:r,targetViewportOffset:i,totalHeight:a,viewportHeight:o}=e;if(n<0)return null;let s=Math.max(0,i),c=n*r,l=c+r,u=t+s,d=t+o;if(c>=u&&l<=d)return null;let f=Math.max(0,a-o),p=Math.max(0,Math.min(c-s,f));return p===t?null:p}function kW(e){if(e==null||!e.isConnected||e===document.body||e===document.documentElement)return!1;e.focus({preventScroll:!0});let t=e.getRootNode();return t instanceof ShadowRoot?t.activeElement===e:document.activeElement===e}function AW(e){let t=e.getRootNode();if(t instanceof ShadowRoot){let e=t.activeElement;return e instanceof HTMLElement?e:null}let n=document.activeElement;return n instanceof HTMLElement&&e.contains(n)?n:null}function jW(e,t){if(e==null)return t;let n=e.getBoundingClientRect().height;return n>0?n:e.clientHeight>0?e.clientHeight:t}function MW(e,t){return e!=null&&e>0?e:t}function NW(e){let t=e.borderBoxSize,n=Array.isArray(t)?t[0]:t;return n!=null&&Number.isFinite(n.blockSize)&&n.blockSize>0?n.blockSize:e.contentRect.height>0?e.contentRect.height:null}function PW(e,t,n,r,i=0){let a=EW({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,topInset:i,viewportHeight:r});return a==null?!1:(e.scrollTop=a,!0)}function FW(e,t,n,r,i,a,o=0){let s=DW({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,offset:a,topInset:o,totalHeight:i,viewportHeight:r});return s==null?!1:(e.scrollTop=s,!0)}function IW(e,t,n,r,i,a){let o=OW({currentScrollTop:e.scrollTop,focusedIndex:t,itemHeight:n,targetViewportOffset:a,totalHeight:i,viewportHeight:r});return o==null?!1:(e.scrollTop=o,!0)}function LW(e,t,n,r){return n.end<n.start?null:e<n.start?-t:e>n.end?r:null}function RW(e){let{renamingPath:t,previousRenamingPath:n,hasRenderedInput:r}=e;return t==null?`reset`:r?n===t?`ignore`:`focus-input`:`reveal-canonical`}function zW({ariaLabel:e,isFlattened:t=!1,ref:n,value:r,onBlur:i,onInput:a}){return JU(`input`,{ref:n,"data-item-rename-input":!0,...t?{"data-item-flattened-rename-input":!0}:{},"aria-label":e,value:r,onBlur:i,onInput:a,onClick:e=>e.stopPropagation(),onMouseDown:e=>e.stopPropagation(),onPointerDown:e=>e.stopPropagation()})}function BW(e){let{row:t,mode:n,targetPath:r,ariaLabel:i,domId:a,isParked:o,itemHeight:s,features:c,state:l,extraStyle:u}=e,d=n===`sticky`,f=t.ancestorPaths.at(-1)??``,p={};return l.isFocusRinged&&(p[`data-item-focused`]=!0),t.isSelected&&(p[`data-item-selected`]=!0),l.isContextHovered&&(p[`data-item-context-hover`]=`true`),l.isDragTarget&&(p[`data-item-drag-target`]=!0),l.isDragging&&(p[`data-item-dragging`]=!0),l.effectiveGitStatus!=null&&(p[`data-item-git-status`]=l.effectiveGitStatus),l.containsGitChange&&(p[`data-item-contains-git-change`]=`true`),{"aria-expanded":!d&&t.kind===`directory`?t.isExpanded:void 0,"aria-haspopup":c.contextMenuEnabled?`menu`:void 0,"aria-label":i,"aria-level":d?void 0:t.level+1,"aria-posinset":d?void 0:t.posInSet+1,"aria-selected":d?void 0:t.isSelected?`true`:`false`,"aria-setsize":d?void 0:t.setSize,"data-file-tree-sticky-path":d?r:void 0,"data-file-tree-sticky-row":d?`true`:void 0,"data-item-context-menu-button-visibility":c.actionLaneEnabled?c.contextMenuButtonVisibility:void 0,"data-item-context-menu-trigger-mode":c.contextMenuEnabled?c.contextMenuTriggerMode:void 0,"data-item-has-context-menu-action-lane":c.actionLaneEnabled?`true`:void 0,"data-item-has-git-lane":c.gitLaneActive?`true`:void 0,"data-item-parent-path":f.length>0?f:void 0,"data-item-parked":o?`true`:void 0,"data-item-path":r,"data-item-type":t.kind===`directory`?`folder`:`file`,"data-type":`item`,id:d?void 0:a,role:d?void 0:`treeitem`,style:{minHeight:`${s}px`,...u},tabIndex:!d&&t.isFocused?0:-1,...p}}function VW(e){let{event:t,mode:n,isSearchOpen:r,isDirectory:i}=e,a=t.ctrlKey||t.metaKey,o=t.shiftKey||a,s=t.shiftKey?{additive:a,kind:`range`}:a?{kind:`toggle`}:{kind:`single`};return{closeSearch:r,revealCanonical:n===`sticky`,selection:s,toggleDirectory:!o&&i}}var HW,UW,WW,GW,KW=Object.is,qW=0,JW=[],YW=oU,XW=YW.__b,ZW=YW.__r,QW=YW.diffed,$W=YW.__c,eG=YW.unmount,tG=YW.__;function nG(e,t){YW.__h&&YW.__h(UW,e,qW||t),qW=0;var n=UW.__H||={__:[],__h:[]};return e>=n.__.length&&n.__.push({}),n.__[e]}function rG(e){return qW=1,iG(gG,e)}function iG(e,t,n){var r=nG(HW++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):gG(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);KW(t,n)||(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=UW,!UW.__f)){var i=function(e,t,n){if(!r.__c.__H)return!0;var i=r.__c.__H.__.filter(function(e){return!!e.__c});if(i.every(function(e){return!e.__N}))return!a||a.call(this,e,t,n);var o=r.__c.props!==e;return i.forEach(function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,KW(t,e.__[0])||(o=!0)}}),a&&a.call(this,e,t,n)||o};UW.__f=!0;var a=UW.shouldComponentUpdate,o=UW.componentWillUpdate;UW.componentWillUpdate=function(e,t,n){if(4&this.__g){var r=a;a=void 0,i(e,t,n),a=r}o&&o.call(this,e,t,n)},UW.shouldComponentUpdate=i}return r.__N||r.__}function aG(e,t){var n=nG(HW++,3);!YW.__s&&hG(n.__H,t)&&(n.__=e,n.u=t,UW.__H.__h.push(n))}function oG(e,t){var n=nG(HW++,4);!YW.__s&&hG(n.__H,t)&&(n.__=e,n.u=t,UW.__h.push(n))}function sG(e){return qW=5,cG(function(){return{current:e}},[])}function cG(e,t){var n=nG(HW++,7);return hG(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function lG(e,t){return qW=8,cG(function(){return e},t)}function uG(){for(var e;e=JW.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(pG),e.__H.__h.forEach(mG),e.__H.__h=[]}catch(t){e.__H.__h=[],YW.__e(t,e.__v)}}YW.__b=function(e){UW=null,XW&&XW(e)},YW.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),tG&&tG(e,t)},YW.__r=function(e){ZW&&ZW(e),HW=0;var t=(UW=e.__c).__H;t&&(WW===UW?(t.__h=[],UW.__h=[],t.__.forEach(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.forEach(pG),t.__h.forEach(mG),t.__h=[],HW=0)),WW=UW},YW.diffed=function(e){QW&&QW(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(JW.push(t)!==1&&GW===YW.requestAnimationFrame||((GW=YW.requestAnimationFrame)||fG)(uG)),t.__H.__.forEach(function(e){e.u&&(e.__H=e.u),e.u=void 0})),WW=UW=null},YW.__c=function(e,t){t.some(function(e){try{e.__h.forEach(pG),e.__h=e.__h.filter(function(e){return!e.__||mG(e)})}catch(n){t.some(function(e){e.__h&&=[]}),t=[],YW.__e(n,e.__v)}}),$W&&$W(e,t)},YW.unmount=function(e){eG&&eG(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(e){try{pG(e)}catch(e){t=e}}),n.__H=void 0,t&&YW.__e(t,n.__v))};var dG=typeof requestAnimationFrame==`function`;function fG(e){var t,n=function(){clearTimeout(r),dG&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);dG&&(t=requestAnimationFrame(n))}function pG(e){var t=UW,n=e.__c;typeof n==`function`&&(e.__c=void 0,n()),UW=t}function mG(e){var t=UW;e.__c=e.__(),UW=t}function hG(e,t){return!e||e.length!==t.length||t.some(function(t,n){return!KW(t,e[n])})}function gG(e,t){return typeof t==`function`?t(e):t}function _G(e,t=null,n=null){"use no memo";let r=e.flattenedSegments;return r==null||r.length===0?t??e.name:JU(`span`,{"data-item-flattened-subitems":!0,children:r.map((e,i)=>{let a=i===r.length-1;return JU(wU,{children:[JU(`span`,{"data-item-flattened-subitem":e.path,"data-item-flattened-subitem-drag-target":n===e.path?`true`:void 0,children:a&&t!=null?t:JU(cW,{children:e.name})}),i<r.length-1?` / `:``]},e.path)})})}function vG(e){return e.isFlattened?e.flattenedSegments?.findLast(e=>e.isTerminal)?.path??e.path:e.path}function yG(e){let t=e.flattenedSegments;return t==null||t.length===0?e.name:t.map(e=>e.name).join(` / `)}function bG(e,t,n,r){return e.map((e,i)=>{let a=i*n,o=e.subtreeEndIndex+1;if(o>=r)return{row:e.row,top:a};let s=o*n-t;return{row:e.row,top:Math.min(a,s-n)}}).filter(e=>e.top+n>0)}function xG({controller:e,itemHeight:t,overscan:n,scrollTop:r,stickyFolders:i,viewportHeight:a}){let o=e.getVisibleCount(),s=i&&o>0?e.getStickyRowCandidates(r,t):[],c=s==null&&i&&o>0?e.getVisibleRows(0,o-1):[],l=SW(c,{itemHeight:t,overscan:n,scrollTop:r,stickyRows:s==null?void 0:bG(s,r,t,o),totalRowCount:o,viewportHeight:a}),u=i&&r<=0&&o>0?e.getStickyRowCandidates(1,t):[],d=u!=null&&r<=0?bG(u,1,t,o):i&&r<=0&&c.length>0?xW(c,1,t):l.sticky.rows;return{overlayHeight:d.reduce((e,n)=>Math.max(e,n.top+t),0),overlayRows:d,snapshot:l,visibleRows:c}}var SG=400,CG=10,wG=40,TG=18;function EG(e,t,n){let r=e,i=document.elementFromPoint?.bind(document)??null,a=r.elementFromPoint?.(t,n)??i?.(t,n)??null;return e instanceof ShadowRoot&&(a==null||!e.contains(a))?DG(e,t,n):a instanceof HTMLElement?a:null}function DG(e,t,n){let r=Array.from(e.querySelectorAll(`[data-type="item"], [data-item-flattened-subitem]`));for(let e=r.length-1;e>=0;e--){let i=r[e],a=i.getBoundingClientRect();if(t>=a.left&&t<=a.right&&n>=a.top&&n<=a.bottom)return i}return null}function OG(e){let t=e?.closest?.(`[data-type="item"]`);if(!(t instanceof HTMLElement))return e?.closest?.(`[data-file-tree-virtualized-scroll]`)instanceof HTMLElement?{directoryPath:null,flattenedSegmentPath:null,hoveredPath:null,kind:`root`}:null;let n=t.dataset.itemPath??null;if(n==null)return null;let r=e?.closest?.(`[data-item-flattened-subitem]`),i=r instanceof HTMLElement?r.getAttribute(`data-item-flattened-subitem`)??null:null;if(i!=null&&i.endsWith(`/`))return{directoryPath:i,flattenedSegmentPath:i,hoveredPath:n,kind:`directory`};if(t.dataset.itemType===`folder`)return{directoryPath:n,flattenedSegmentPath:null,hoveredPath:n,kind:`directory`};let a=t.dataset.itemParentPath??null;return a==null||a.length===0?{directoryPath:null,flattenedSegmentPath:null,hoveredPath:n,kind:`root`}:{directoryPath:a,flattenedSegmentPath:null,hoveredPath:n,kind:`directory`}}function kG(e){let t=e.cloneNode(!0);return t.removeAttribute(`id`),t.dataset.fileTreeDragPreview=`true`,t.setAttribute(`aria-hidden`,`true`),t.tabIndex=-1,Object.assign(t.style,{boxShadow:`0 4px 12px rgba(0, 0, 0, 0.15)`,left:`0px`,margin:`0`,pointerEvents:`none`,position:`fixed`,top:`0px`,willChange:`transform`,zIndex:`10000`}),t}function AG(){return navigator.vendor!==`Apple Computer, Inc.`}function jG(e,t){let n=e-t.top;if(n<wG)return-Math.ceil((wG-Math.max(0,n))/wG*TG);let r=t.bottom-e;return r<wG?Math.ceil((wG-Math.max(0,r))/wG*TG):0}function MG(e,t){if(e!=null){let t=CW[e];return t==null?null:{text:t,title:wW[e]}}return t?{icon:{name:`file-tree-icon-dot`,width:6,height:6},title:TW}:null}function NG(e,t,n){if(t==null||t.size===0)return null;let r=[];for(let i=e.length-1;i>=0;--i){let a=e[i],o=n.get(a);if(o!=null){for(let e of r)n.set(e,o);return o?`ignored`:null}if(t.has(a)){n.set(a,!0);for(let e of r)n.set(e,!0);return`ignored`}r.push(a)}for(let e of r)n.set(e,!1);return null}function PG(e){return e!=null&&`toggle`in e}function FG(e){return e.code===`Space`||e.key===` `||e.key===`Spacebar`}function IG(e){return e.key.length===1&&/^[\p{L}\p{N}]$/u.test(e.key)&&!e.ctrlKey&&!e.metaKey&&!e.altKey}function LG(e){return e==null?``:`[data-item-section="spacing-item"][data-ancestor-path="${e.replaceAll(`\\`,`\\\\`).replaceAll(`"`,`\\"`)}"] { opacity: 1; }`}function RG(e){return e.shiftKey&&e.key===`F10`||e.key===`ContextMenu`}function zG(e,t){return t&&RG(e)||(e.ctrlKey||e.metaKey)&&FG(e)?!0:e.key===`ArrowDown`||e.key===`ArrowLeft`||e.key===`ArrowRight`||e.key===`ArrowUp`}var BG=new Set([`ArrowDown`,`ArrowLeft`,`ArrowRight`,`ArrowUp`,`End`,`Home`,`PageDown`,`PageUp`]);function VG(e){for(let t of e.composedPath())if(t instanceof HTMLElement&&(t.dataset.fileTreeContextMenuRoot===`true`||t.dataset.type===`context-menu-anchor`||t.dataset.type===`context-menu-trigger`||t.getAttribute(`slot`)===`context-menu`))return!0;return!1}function HG(e){return{bottom:e.bottom,height:e.height,left:e.left,right:e.right,top:e.top,width:e.width,x:e.x,y:e.y}}function UG(e,t){return{bottom:t,height:0,left:e,right:e,top:t,width:0,x:e,y:t}}function WG(e,t){if(e==null)return t.offsetTop;let n=t.getBoundingClientRect(),r=e.getBoundingClientRect();return n.top-r.top}function GG(e,t,n){if(n==null){e.delete(t);return}e.set(t,n)}function KG(e,t,n){if(e==null)return null;let r=t.get(e)??null;if(r!=null)return r;let i=n.get(e)??null;return i?.dataset.itemParked===`true`?null:i}function qG(e){if(e==null)return[];let t=[];for(let n of e.querySelectorAll(`button[data-file-tree-sticky-row="true"]`)){if(!(n instanceof HTMLElement))continue;let e=n.dataset.fileTreeStickyPath;e!=null&&t.push(e)}return t}function JG(e,t){if(e==null||t==null)return null;for(let n of e.querySelectorAll(`button[data-item-focused="true"][data-item-parked="true"]`))if(n instanceof HTMLElement&&n.dataset.itemPath===t)return n;return null}function YG(e,t,n,r,i,a,o){let s=Math.max(0,a-i),c=t?.getBoundingClientRect()??null,l=c==null||n==null?null:n.getBoundingClientRect().top-c.top,u=JG(e,r),d=c==null||u==null?null:u.getBoundingClientRect().top-c.top;return Math.max(0,Math.min(d??Math.max(l??0,s),Math.max(0,o-i)))}function XG(e,t){return{kind:e.kind,name:yG(e),path:t}}function ZG(e){return e==null?void 0:`${e}__tree`}function QG(e,t,n){if(e!=null)return`${e}__focused-item-${encodeURIComponent(t)}${n?`__parked`:``}`}function $G(e){return e===`file-tree-icon-chevron`||e===`file-tree-icon-dot`||e===`file-tree-icon-file`||e===`file-tree-icon-lock`}function eK(e,t){if(e==null)return null;if(`text`in e)return JU(`span`,{title:e.title,children:e.text});let n=typeof e.icon==`string`?$G(e.icon)?t(e.icon):{name:e.icon}:$G(e.icon.name)?(()=>{let n=t(e.icon.name),{name:r,...i}=e.icon;return{...n,...i}})():e.icon;return JU(`span`,{title:e.title,children:JU(QU,{...n})})}function tK(e){e!=null&&kW(e.querySelector([`button:not([disabled])`,`[href]`,`input:not([disabled])`,`select:not([disabled])`,`textarea:not([disabled])`,`[tabindex]:not([tabindex="-1"])`].join(`, `))??e)}function nK(e,t,{actionLaneEnabled:n=!1,customDecoration:r=null,decorationLaneEnabled:i=!1,dragTargetFlattenedSegmentPath:a=null,gitDecoration:o=null,gitLaneActive:s=!1,renameInput:c=null,showDecorativeActionAffordance:l=!1}={}){let u=vG(e);return JU(wU,{children:[e.depth>0?JU(`div`,{"data-item-section":`spacing`,children:Array.from({length:e.depth}).map((t,n)=>JU(`div`,{"data-item-section":`spacing-item`,"data-ancestor-path":e.ancestorPaths[n]},n))}):null,JU(`div`,{"data-item-section":`icon`,children:e.kind===`directory`?JU(QU,{...t(`file-tree-icon-chevron`)}):JU(QU,{...t(`file-tree-icon-file`,u)})}),JU(`div`,{"data-item-section":`content`,children:e.isFlattened?_G(e,c,a):c??JU(uW,{minimumLength:5,split:`extension`,children:e.name})}),i?JU(`div`,{"data-item-section":`decoration`,children:r==null?null:eK(r,t)}):null,s?JU(`div`,{"data-item-section":`git`,children:eK(o,t)}):null,n?JU(`div`,{"data-item-section":`action`,children:l?JU(`span`,{"aria-hidden":`true`,"data-item-action-affordance":`decorative`,children:JU(QU,{...t(`file-tree-icon-ellipsis`)})}):null}):null]})}function rK(e,t,n,r={}){let{controller:i,renameView:a,visualFocusPath:o,contextHoverPath:s,draggedPathSet:c,dragTarget:l,dragAndDropEnabled:u,shouldSuppressContextMenu:d,handleRowDragStart:f,handleRowDragEnd:p,handleRowTouchStart:m,instanceId:h,itemHeight:g,gitStatusByPath:_,ignoredGitDirectories:v,ignoredInheritanceCache:y,directoriesWithGitChanges:b,gitLaneActive:x,contextMenuEnabled:S,contextMenuTriggerMode:C,contextMenuButtonTriggerEnabled:w,contextMenuButtonVisibility:T,contextMenuRightClickEnabled:E,registerRenameInput:D,registerButton:O,resolveIcon:k,renderDecorationForRow:A,openContextMenuForRow:j,onRowClick:M,onKeyDown:N}=e,P=vG(t),{isParked:F=!1,mode:I=`flow`,style:L}=r,R=I===`sticky`,z=_?.get(P)??null??NG(t.ancestorPaths,v,y),B=t.kind===`directory`&&(b?.has(P)??!1),V=A(t,P),H=MG(z,B),U=S&&w,W=V!=null||x||U,G=U&&T===`always`,K=a.getPath()===P,ee=K?a.getValue():``,te=R||!K?null:JU(zW,{ref:D,ariaLabel:`Rename ${yG(t)}`,isFlattened:t.isFlattened,value:ee,onBlur:()=>{a.commit()},onInput:e=>{a.setValue(e.currentTarget.value)}}),ne=nK(t,k,{actionLaneEnabled:U,customDecoration:V,decorationLaneEnabled:W,dragTargetFlattenedSegmentPath:l?.flattenedSegmentPath??null,gitDecoration:H,gitLaneActive:x,renameInput:te,showDecorativeActionAffordance:G}),re={...BW({ariaLabel:yG(t),domId:t.isFocused?QG(h,P,F):void 0,extraStyle:L,features:{actionLaneEnabled:U,contextMenuButtonVisibility:U?T:null,contextMenuEnabled:S,contextMenuTriggerMode:S?C:null,gitLaneActive:x},isParked:F,itemHeight:g,mode:I,row:t,state:{containsGitChange:B,effectiveGitStatus:z,isContextHovered:s===P,isDragTarget:l?.kind===`directory`&&l.directoryPath===P,isDragging:c?.has(P)===!0,isFocusRinged:t.isFocused&&o===P},targetPath:P}),key:n,onContextMenu:S||u?e=>{if(d()){e.preventDefault();return}S&&(e.preventDefault(),E&&(i.focusMountedPathFromInput(P),j(t,P,{anchorRect:UG(e.clientX,e.clientY),source:`right-click`})))}:void 0,onFocus:R?void 0:()=>{i.focusMountedPathFromInput(P)},onKeyDown:R?void 0:N,ref:e=>{O(P,e)}};return!R&&K?JU(`div`,{...re,children:ne}):JU(`button`,{...re,type:`button`,draggable:u&&!F,onDragEnd:u&&!F?p:void 0,onDragStart:u&&!F?e=>{f(e,t,P)}:void 0,onMouseDown:e=>{if(R){e.preventDefault();return}i.isSearchOpen()&&e.preventDefault()},onTouchStart:u&&!F?e=>{m(e,t,P)}:void 0,onClick:e=>{M(e,t,P,I)},children:ne})}function iK(e,t,n){return t.end<t.start?[]:e.controller.getVisibleRows(t.start,t.end).filter(e=>!n.has(vG(e))).map((n,r)=>rK(e,n,t.start+r))}function aK({composition:e,controller:t,gitStatusByPath:n,ignoredGitDirectories:r,directoriesWithGitChanges:i,icons:a,instanceId:o,itemHeight:s=rH,overscan:c=10,renamingEnabled:l=!1,renderRowDecoration:u,searchBlurBehavior:d=`close`,searchEnabled:f=!1,searchFakeFocus:p=!1,slotHost:m,stickyFolders:h=!1,initialViewportHeight:g=420}){"use no memo";let _=sG(null),v=sG(null),y=sG(!1),b=sG(null),x=sG(null),S=sG(null),C=sG(null),w=sG(null),T=sG(new Map),E=sG(new Map),D=sG(()=>{}),O=sG(null),k=sG(0),A=sG(!1),j=sG(null);j.current!==t&&(A.current=!1,j.current=t);let M=sG(!1),N=sG(null),P=sG(null),F=sG(!1),I=sG(null),L=sG(null),R=sG(null),z=sG(null),B=sG(null),V=sG(null),H=sG(null),U=sG(null),W=sG(!1),G=sG(null),K=sG(null),ee=sG(null),te=sG(null),ne=cG(()=>new Map,[]),[,re]=rG(0),[ie,ae]=rG(null),[oe,se]=rG(null),[ce,le]=rG(null),[q,ue]=rG(null),[de,fe]=rG(0),[pe,me]=rG(null),he=sG(pe);he.current=pe;let ge=sG(null),_e=sG(null),ve=sG(null),ye=sG(null),be=sG(null),xe=sG(!1),Se=()=>{_e.current=null,ve.current=null,ye.current=null},Ce=(e,t)=>{_e.current=e,ve.current=null,ye.current=t==null?null:{path:e,scrollTop:t}},we=(e,t)=>{_e.current=null,ve.current={path:e,viewportOffset:t},ye.current=null},Te=sG(d===`retain`&&t.isSearchOpen()),[Ee,De]=rG(p);aG(()=>{p||De(!1)},[p]);let Oe=sG(!1),ke=lG(()=>{Oe.current=!0,De(e=>e&&!1)},[]),[Ae,je]=rG(()=>xG({controller:t,itemHeight:s,overscan:c,scrollTop:0,stickyFolders:h,viewportHeight:g})),[Me,Ne]=rG(!1);aG(()=>{Ne(!0)},[]);let Pe=e?.contextMenu?.enabled===!0||e?.contextMenu?.render!=null||e?.contextMenu?.onOpen!=null||e?.contextMenu?.onClose!=null,Fe=e?.contextMenu?.triggerMode??(Pe?`right-click`:`both`),Ie=Fe===`both`||Fe===`button`,Le=e?.contextMenu?.buttonVisibility??`when-needed`,Re=Fe===`both`||Fe===`right-click`;oG(()=>{let e=S.current;if(e==null)return;let t=e=>{if(!(e instanceof CustomEvent))return;let t=e.detail?.path??null;be.current=t,se(t),ue(t==null?null:`pointer`)},n=e=>{e instanceof CustomEvent&&(xe.current=e.detail?.disabled===!0)};return e.addEventListener(`file-tree-debug-set-context-menu-trigger`,t),e.addEventListener(`file-tree-debug-set-scroll-suppression`,n),()=>{e.removeEventListener(`file-tree-debug-set-context-menu-trigger`,t),e.removeEventListener(`file-tree-debug-set-scroll-suppression`,n)}},[]);let ze=lG((e,t)=>{GG(T.current,e,t)},[]),Be=lG((e,t)=>{GG(E.current,e,t)},[]),Ve=lG(e=>{x.current=e},[]),He=lG(e=>KG(e,E.current,T.current),[]),Ue=n!=null||r!=null||i!=null,{resolveIcon:We}=cG(()=>mR(a),[a]),Ge=t[JH](),Ke=Ge.getPath(),qe=Ke!=null,Je=t.isSearchOpen(),Ye=t.getSearchValue(),Xe=t.getFocusedPath(),Ze=t.getFocusedIndex(),Qe=t.getScrollRequest(),$e=t.isDragAndDropEnabled(),et=t.getDragSession(),tt=cG(()=>et==null?null:new Set(et.draggedPaths),[et]),nt=et?.target??null,rt=et?.primaryPath??null,it=ZG(o),{overlayHeight:at,overlayRows:ot,snapshot:st,visibleRows:ct}=Ae,lt=st.physical.viewportHeight,ut=cG(()=>({end:st.window.endIndex,start:st.window.startIndex}),[st.window.endIndex,st.window.startIndex]),dt=ot,ft=st.sticky.rows,pt=st.physical.totalHeight,mt=st.sticky.height,ht=cG(()=>new Set(ft.map(e=>vG(e.row))),[ft]),gt=Ze>=0&&Ze>=ut.start&&Ze<=ut.end,_t=lG((e,t)=>u?.({item:XG(e,t),row:e})??null,[u]),vt=lG(e=>kW(e==null?null:T.current.get(e)??null)?!0:kW(S.current),[]),yt=lG(e=>{vt(t.focusNearestPath(e))},[t,vt]),bt=sG(yt);bt.current=yt;let xt=sG(!0),St=sG(()=>{}),Ct=lG((t=!0)=>{let n=he.current;n!=null&&(xt.current=xt.current&&t,me(null),e?.contextMenu?.onClose?.(),xt.current&&yt(n.path))},[e?.contextMenu,yt]);St.current=Ct;let wt=lG(e=>{let t=e==null?null:WG(S.current,e);le(e=>e===t?e:t)},[]),Tt=lG((e,n,r)=>{let i=t.getItem(n);if(i==null)return;let a=He(n);if(a?.dataset.fileTreeStickyRow===`true`){let e=C.current;Ce(n,e?.scrollTop??null),M.current=!0,ae(e=>e===n?e:n)}i.focus(),wt(a),xt.current=!0,me({anchorRect:r?.anchorRect??null,item:XG(e,n),path:n,source:r?.source??`keyboard`})},[t,He,wt]),Et=lG(e=>{if(l){if(t.isSearchOpen()){let e=C.current,t=jW(e,lt);I.current=Ze<0||e==null?null:Math.max(0,Math.min(Ze*s-e.scrollTop,Math.max(0,t-s))),F.current=!0}t.startRenaming(e)!==!1&&(ue(`focus`),re(e=>e+1))}},[t,Ze,s,l,lt]),Dt=lG((e,{restoreTreeFocus:n=!0,targetOffset:r=`live-overlay`}={})=>{let i=C.current;if(i==null)return!1;t.focusPath(e);let a=t.getFocusedIndex();if(a<0)return!1;let o=t.getVisibleRows(a,a)[0]??null;if(o==null)return!1;let l=jW(i,lt),u=t.getVisibleCount()*s,d=r===`sticky-parents`?o.ancestorPaths.length*s:xG({controller:t,itemHeight:s,overscan:c,scrollTop:i.scrollTop,stickyFolders:h,viewportHeight:l}).snapshot.sticky.height;return M.current=!0,IW(i,a,s,l,u,d),D.current(),ge.current=n?e:null,!0},[t,s,c,lt,h]),Ot=()=>y.current===!0||te.current!=null||W.current===!0,kt=e=>typeof window.requestAnimationFrame==`function`?window.requestAnimationFrame(()=>{e()}):window.setTimeout(e,16),At=e=>{if(e!=null){if(typeof window.cancelAnimationFrame==`function`){window.cancelAnimationFrame(e);return}window.clearTimeout(e)}},jt=()=>{z.current!=null&&(clearTimeout(z.current),z.current=null),R.current=null},Mt=()=>{V.current?.remove(),V.current=null},Nt=()=>{At(L.current),L.current=null,B.current=null},Pt=e=>{let t=S.current?.getRootNode();if(t instanceof ShadowRoot){t.append(e);return}document.body.append(e)},Ft=()=>{U.current?.(),U.current=null,te.current!=null&&(clearTimeout(te.current),te.current=null),W.current=!1,G.current=null,ee.current=null,K.current!=null&&(K.current.setAttribute(`draggable`,`true`),K.current.style.removeProperty(`touch-action`),K.current=null),Mt(),jt(),Nt(),H.current=null},It=(e,n)=>{let r=S.current?.getRootNode(),i=OG(EG(r instanceof ShadowRoot?r:document,e,n));return t.setDragTarget(i),t.getDragSession()?.target??null},Lt=e=>{let n=t.getDragAndDropConfig()?.openOnDropDelay??800;if(e==null||e.kind!==`directory`||e.directoryPath==null||n<=0){jt();return}let r=t.getItem(e.directoryPath),i=PG(r)?r:null;if(i==null||i.isExpanded()){jt();return}let a=`${e.directoryPath}::${e.flattenedSegmentPath??``}`;R.current!==a&&(jt(),R.current=a,z.current=setTimeout(()=>{let n=t.getDragSession()?.target;n?.kind!==`directory`||n.directoryPath!==e.directoryPath||n.flattenedSegmentPath!==e.flattenedSegmentPath||i.expand()},n))},Rt=()=>{L.current=null;let e=B.current,n=C.current;if(e==null||n==null||t.getDragSession()==null)return;let r=n.getBoundingClientRect(),i=jG(e.clientY,r);if(i===0)return;let a=Math.max(0,n.scrollHeight-n.clientHeight),o=Math.max(0,Math.min(a,n.scrollTop+i));o!==n.scrollTop&&(n.scrollTop=o,D.current()),Lt(It(e.clientX,e.clientY)),L.current=kt(Rt)},zt=(e,t)=>{B.current={clientX:e,clientY:t},L.current??=kt(Rt)},Bt=(e,n,r)=>{let i=e.currentTarget;if(i!=null){if(Ft(),Mt(),jt(),Nt(),t.startDrag(r)===!1){e.preventDefault();return}if(H.current=n,e.dataTransfer!=null&&(e.dataTransfer.effectAllowed=`move`,e.dataTransfer.dropEffect=`move`,e.dataTransfer.setData(`text/plain`,r),AG())){let t=kG(i),n=i.getBoundingClientRect();Object.assign(t.style,{height:`${n.height}px`,opacity:`0.85`,transform:`translate3d(-9999px, 0px, 0)`,width:`${n.width}px`}),Pt(t),V.current=t,e.dataTransfer.setDragImage(t,Math.max(0,e.clientX-n.left),Math.max(0,e.clientY-n.top))}}},Vt=()=>{Mt(),jt(),Nt(),H.current=null,t.cancelDrag()},Ht=(e,n,r)=>{if(te.current!=null||W.current)return;let i=e.touches[0],a=e.currentTarget;if(i==null||a==null)return;ee.current={clientX:i.clientX,clientY:i.clientY},K.current=a,a.setAttribute(`draggable`,`false`);let o=(e={})=>{let t=e.restoreNativeDraggable??!W.current;te.current!=null&&(clearTimeout(te.current),te.current=null),document.removeEventListener(`touchmove`,s),document.removeEventListener(`touchend`,c),document.removeEventListener(`touchcancel`,c),U.current===o&&(U.current=null),t&&(a.setAttribute(`draggable`,`true`),K.current===a&&(K.current=null),ee.current=null)},s=e=>{let t=e.touches[0],n=ee.current;if(t==null||n==null)return;let r=t.clientX-n.clientX,i=t.clientY-n.clientY;r*r+i*i<=CG*CG||o()},c=()=>{o()};document.addEventListener(`touchmove`,s,{passive:!0}),document.addEventListener(`touchend`,c),document.addEventListener(`touchcancel`,c),U.current=o,te.current=setTimeout(()=>{if(o({restoreNativeDraggable:!1}),t.startDrag(r)===!1){a.setAttribute(`draggable`,`true`),K.current===a&&(K.current=null),ee.current=null;return}W.current=!0,K.current=a,a.setAttribute(`draggable`,`false`),a.style.setProperty(`touch-action`,`none`),H.current=n;let e=a.getBoundingClientRect(),s=kG(a);Object.assign(s.style,{height:`${e.height}px`,opacity:`0.85`,transform:`translate3d(${e.left}px, ${e.top}px, 0)`,width:`${e.width}px`}),Pt(s),V.current=s,G.current={x:i.clientX-e.left,y:i.clientY-e.top};let c=e=>{let t=e.touches[0];if(t==null)return;e.preventDefault();let n=G.current;n!=null&&V.current!=null&&(V.current.style.transform=`translate3d(${t.clientX-n.x}px, ${t.clientY-n.y}px, 0)`),Lt(It(t.clientX,t.clientY)),zt(t.clientX,t.clientY)},l=e=>{let n=e.changedTouches[0];n!=null&&It(n.clientX,n.clientY),t.completeDrag(),Ft()},u=()=>{t.cancelDrag(),Ft()};U.current=()=>{document.removeEventListener(`touchmove`,c),document.removeEventListener(`touchend`,l),document.removeEventListener(`touchcancel`,u)},document.addEventListener(`touchmove`,c,{passive:!1}),document.addEventListener(`touchend`,l),document.addEventListener(`touchcancel`,u)},SG)},Ut=e=>{if(pe!=null){if(e.key===`Escape`){Ct(),e.preventDefault(),e.stopPropagation();return}BG.has(e.key)&&(e.preventDefault(),e.stopPropagation());return}if(Ge.isActive()){if(e.key===`Escape`)Ge.cancel();else if(e.key===`Enter`)Ge.commit();else return;ue(`focus`),re(e=>e+1),e.preventDefault(),e.stopPropagation();return}if(l&&e.key===`F2`){Et(Xe??void 0),e.preventDefault(),e.stopPropagation();return}if(Je){if(e.key===`Escape`)F.current=!1,I.current=null,t.closeSearch();else if(e.key===`Enter`){let e=t.getFocusedPath();e!=null&&t.selectOnlyPath(e);let n=C.current,r=jW(n,lt);I.current=Ze<0||n==null?null:Math.max(0,Math.min(Ze*s-n.scrollTop,Math.max(0,r-s))),F.current=!0,t.closeSearch()}else if(e.key===`ArrowDown`)t.focusNextSearchMatch();else if(e.key===`ArrowUp`)t.focusPreviousSearchMatch();else return;ue(`focus`),re(e=>e+1),e.preventDefault(),e.stopPropagation();return}if(f&&IG(e)){t.openSearch(e.key),re(e=>e+1),e.preventDefault(),e.stopPropagation();return}let n=Pe&&RG(e),r=zG(e,Pe),i=r&&S.current!=null?AW(S.current):null,a=r?new Set(qG(S.current)):new Set,o=i?.dataset.fileTreeStickyPath??null,c=i?.dataset.fileTreeStickyRow===`true`&&o!=null;if(c&&o!==Xe&&a.has(o)){let e=C.current;Ce(o,e?.scrollTop??null),t.focusPath(o)}let u=t.getFocusedPath(),d=t.getFocusedIndex(),p=t.getFocusedItem();if(p==null)return;let m=PG(p)?p:null,h=u!=null&&(ht.has(u)||c&&o===u&&a.has(u)),g=e.key===`ArrowDown`||e.key===`ArrowUp`||e.key===`ArrowRight`&&m!=null&&m.isExpanded(),_=e.key===`ArrowLeft`&&h&&m!=null&&m.isExpanded(),v=C.current,y=!0;if(e.shiftKey&&e.key===`ArrowDown`)t.extendSelectionFromFocused(1);else if(e.shiftKey&&e.key===`ArrowUp`)t.extendSelectionFromFocused(-1);else if(n&&u!=null&&d>=0){let e=t.getVisibleRows(d,d)[0]??null,n=KG(u,E.current,T.current);e==null||n==null?y=!1:Tt(e,u)}else if((e.ctrlKey||e.metaKey)&&FG(e))t.toggleFocusedSelection();else if((e.ctrlKey||e.metaKey)&&e.key.toLowerCase()===`a`)t.selectAllVisiblePaths();else switch(e.key){case`ArrowDown`:t.focusNextItem();break;case`ArrowUp`:t.focusPreviousItem();break;case`ArrowRight`:m==null||m.isExpanded()?t.focusNextItem():m.expand();break;case`ArrowLeft`:m!=null&&m.isExpanded()?m.collapse():t.focusParentItem();break;case`Home`:t.focusFirstItem();break;case`End`:t.focusLastItem();break;default:y=!1}if(!y)return;ue(`focus`);let b=t.getFocusedPath(),x=b!=null&&(ht.has(b)||a.has(b)),w=g&&b!==u,D=n&&c&&o===u&&b===u;if((h||D)&&b!=null&&(w&&x||D))Ce(b,v?.scrollTop??null),M.current=!0,ae(e=>e===b?e:b);else{let t=e.key===`ArrowUp`&&h&&b!==u;b!=null&&(t||_&&b===u)?(we(b,YG(S.current,v,i,u,s,mt,lt)),M.current=!0,ae(e=>e===b?e:b)):Se()}re(e=>e+1),e.preventDefault(),e.stopPropagation()};oG(()=>{if(!(!f||!Je)){if(Te.current){Te.current=!1;return}kW(w.current)}},[Je,f]),oG(()=>{let e=x.current;switch(RW({hasRenderedInput:e!=null,previousRenamingPath:P.current,renamingPath:Ke})){case`reset`:P.current=null;return;case`reveal-canonical`:Ke!=null&&Dt(Ke,{restoreTreeFocus:!1,targetOffset:`live-overlay`});return;case`ignore`:return;case`focus-input`:e!=null&&(ge.current=null,P.current=Ke,kW(e),e.select());return}},[ut.end,ut.start,Ke,Dt,ht]),oG(()=>{let e=S.current;if(e==null)return;let t=null,n=()=>{t!=null&&(clearTimeout(t),t=null)},r=()=>{let t=AW(e)?.dataset.itemPath??null;ae(e=>e===t?e:t)},i=()=>{n(),M.current=!0,r()},a=i=>{let a=i.relatedTarget;if(a==null){n(),t=setTimeout(()=>{if(t=null,AW(e)!=null){r();return}M.current=!1,ae(null)},0);return}if(!(a instanceof Node)||!e.contains(a)){n(),M.current=!1,ae(null);return}let o=a instanceof HTMLElement?a.dataset.itemPath??null:null;ae(e=>e===o?e:o)};return e.addEventListener(`focusin`,i),e.addEventListener(`focusout`,a),()=>{n(),e.removeEventListener(`focusin`,i),e.removeEventListener(`focusout`,a)}},[]),oG(()=>{let e=S.current;e!=null&&(st.physical.scrollTop<=0?e.dataset.scrollAtTop=`true`:delete e.dataset.scrollAtTop)},[st.physical.scrollTop]),oG(()=>{let e=null,n=C.current,r=b.current,i=S.current;if(n==null)return;O.current=jW(n,g);let a=()=>{let e=t.getVisibleCount(),r=MW(O.current,g),i=Math.max(0,e*s-r);n.scrollTop>i&&(n.scrollTop=i),je(xG({controller:t,itemHeight:s,overscan:c,scrollTop:Math.min(n.scrollTop,i),stickyFolders:h,viewportHeight:r}))};if(!A.current){A.current=!0;let e=t.getFocusedIndex();if(e>=0){let r=MW(O.current,g),i=t.getVisibleRows(e,e)[0]??null;PW(n,e,s,r,h&&i!=null?Math.max(0,Math.min(i.ancestorPaths.length*s,Math.max(0,r-s))):0)}}D.current=a;let o=!1,l=t.subscribe(()=>{o?re(e=>e+1):o=!0,a()}),u=()=>{xe.current!==!0&&(r!=null&&(r.dataset.isScrolling??=``),i!=null&&(i.dataset.isScrolling??=``),y.current=!0,e!=null&&clearTimeout(e),e=setTimeout(()=>{r!=null&&delete r.dataset.isScrolling,i!=null&&delete i.dataset.isScrolling,y.current=!1,fe(e=>e+1),e=null},50))},d=null,f=()=>{i!=null&&delete i.dataset.overlayReveal,d!=null&&(clearTimeout(d),d=null)},p=()=>{i==null||xe.current===!0||n.scrollTop>0||(i.dataset.overlayReveal=`true`,d!=null&&clearTimeout(d),d=setTimeout(()=>{f()},200))},m=()=>{if(a(),n.scrollTop>0&&f(),he.current!=null&&y.current&&St.current(),xe.current===!0){y.current=!1;return}se(e=>e==null?e:null),u()},_=()=>{u(),p()},v=new Set([`ArrowUp`,`ArrowDown`,`ArrowLeft`,`ArrowRight`,`PageUp`,`PageDown`,`Home`,`End`,` `,`Spacebar`]),x=e=>{v.has(e.key)&&_()};n.addEventListener(`scroll`,m,{passive:!0}),n.addEventListener(`wheel`,_,{passive:!0}),n.addEventListener(`touchmove`,_,{passive:!0}),n.addEventListener(`keydown`,x);let w=typeof ResizeObserver<`u`?new ResizeObserver(e=>{O.current=(e[0]==null?null:NW(e[0]))??jW(n,g),a()}):null;return w?.observe(n),()=>{D.current=()=>{},l(),n.removeEventListener(`scroll`,m),n.removeEventListener(`wheel`,_),n.removeEventListener(`touchmove`,_),n.removeEventListener(`keydown`,x),e!=null&&clearTimeout(e),d!=null&&clearTimeout(d),r!=null&&delete r.dataset.isScrolling,i!=null&&(delete i.dataset.isScrolling,delete i.dataset.overlayReveal),y.current=!1,O.current=null,w?.disconnect()}},[t,g,s,c,h]),oG(()=>{Pe||pe==null||Ct(!1)},[Ct,Pe,pe]);let Wt=cG(()=>pe==null?null:`${pe.path}::${pe.source}`,[pe]);oG(()=>{if(Wt==null){m?.clearSlotContent(oR);return}let t=he.current;if(t==null)return;let n=v.current??_.current;if(n==null)return;let r={anchorElement:n,anchorRect:t.anchorRect??HG(n.getBoundingClientRect()),close:e=>{St.current(e?.restoreFocus??!0)},restoreFocus:()=>{xt.current&&bt.current(he.current?.path??null)}},i=e?.contextMenu?.render?.(t.item,r)??null;return m?.setSlotContent(oR,i),e?.contextMenu?.onOpen?.(t.item,r),tK(i),queueMicrotask(()=>{i==null||!i.isConnected||document.activeElement===i&&tK(i)}),()=>{m?.clearSlotContent(oR)}},[Wt,e?.contextMenu,m]),oG(()=>{pe!=null&&t.getItem(pe.path)==null&&Ct()},[Ct,pe,t]),oG(()=>{if(pe==null)return;let e=S.current?.getRootNode(),t=e instanceof ShadowRoot?e.host:S.current,n=e=>{let n=e.target;n instanceof Node&&(VG(e)||_.current?.contains(n)!==!0&&t?.contains(n)!==!0&&Ct())},r=e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),Ct())};return document.addEventListener(`mousedown`,n,!0),document.addEventListener(`keydown`,r,!0),()=>{document.removeEventListener(`mousedown`,n,!0),document.removeEventListener(`keydown`,r,!0)}},[Ct,pe]),oG(()=>{let e=C.current,n=S.current;if(e==null||n==null){N.current=Xe;return}let r=Xe==null?null:T.current.get(Xe)??null,i=AW(n),a=i?.dataset.itemPath??null,o=qe&&x.current===i,c=f&&w.current===i,l=F.current&&!Je,u=I.current??0,d=ge.current,p=_e.current,m=ve.current,g=ye.current,_=i!=null,v=M.current||_,y=N.current!==Xe,b=p!=null&&p===Xe&&Xe!=null,E=!1,O=!1;if(Qe!=null&&Qe.id!==k.current){k.current=Qe.id;let n=Qe.visibleIndex,r=t.getVisibleRows(n,n)[0]??null;if(r!=null){let t=h?Math.max(0,Math.min(r.ancestorPaths.length*s,Math.max(0,lt-s))):mt;E=!0,O=FW(e,n,s,lt,pt,Qe.offset,t)}t.clearScrollRequest(Qe.id)}let A=!E&&l&&IW(e,Ze,s,lt,pt,u),j=!E&&d!=null&&d===Xe&&IW(e,Ze,s,lt,pt,mt),P=!E&&m!=null&&m.path===Xe&&IW(e,Ze,s,lt,pt,m.viewportOffset),L=!E&&g!=null&&g.path===Xe&&e.scrollTop!==g.scrollTop;if(L&&(e.scrollTop=g.scrollTop),(L||O||j||P||A||v&&y&&d!==Xe&&!b&&PW(e,Ze,s,lt,mt))&&D.current(),E){N.current=Xe;return}if(!v){N.current=Xe;return}if(o){N.current=Xe;return}if(c&&!l){N.current=Xe;return}if(r==null){l&&Ze>=0&&(IW(e,Ze,s,lt,pt,u),D.current()),N.current=Xe;return}(y||l||d===Xe||p===Xe||m?.path===Xe||g?.path===Xe||a==null||a!==Xe)&&(kW(r),d===Xe&&(ge.current=null),p===Xe&&(_e.current=null),m?.path===Xe&&(ve.current=null),g?.path===Xe&&(ye.current=null),F.current=!1,I.current=null),N.current=Xe},[t,Ze,Xe,gt,s,qe,Je,ut,lt,f,Qe,h,mt,pt,ct]);let Gt=Ze>=0&&Ze>=st.visible.startIndex&&Ze<=st.visible.endIndex,Kt=Xe!=null&&dt.some(e=>vG(e.row)===Xe),qt=Gt||Kt,Jt=Ie&&M.current===!0&&qt?Xe:null,Yt=q===`pointer`?oe:null,Xt=pe?.path??be.current??Yt??Jt??oe,Zt=pe?.source===`right-click`;oG(()=>{y.current&&pe==null||wt(He(Xt))},[pe,He,ut,lt,de,dt,Xt,wt,ct]);let Qt=lG(e=>{if(y.current||VG(e))return;let t=e.target;if(!(t instanceof HTMLElement)||t.closest?.(`[data-type="context-menu-trigger"]`)!=null)return;let n=t.closest?.(`[data-file-tree-sticky-row="true"]`),r=t.closest?.(`[data-type="item"]`),i=n instanceof HTMLElement?n.dataset.fileTreeStickyPath??null:r instanceof HTMLElement?r.dataset.itemPath??null:null;i!=null&&ue(e=>e===`pointer`?e:`pointer`),se(e=>e===i?e:i)},[]),$t=lG(()=>{se(null)},[]);oG(()=>{if(!$e)return;let e=()=>{Ft(),t.cancelDrag()};return window.addEventListener(`dragend`,e),()=>{window.removeEventListener(`dragend`,e),Ft(),t.cancelDrag()}},[t,$e]);let en=e=>{if(!$e||t.getDragSession()==null||W.current)return;let n=OG(e.target instanceof HTMLElement?e.target:null);t.setDragTarget(n),Lt(t.getDragSession()?.target??null),zt(e.clientX,e.clientY),e.dataTransfer!=null&&(e.dataTransfer.dropEffect=`move`),e.preventDefault()},tn=e=>{if(!$e||t.getDragSession()==null||W.current)return;let n=e.relatedTarget;n instanceof Node&&S.current?.contains(n)===!0||(jt(),Nt(),t.setDragTarget(null))},nn=e=>{!$e||t.getDragSession()==null||W.current||(e.preventDefault(),It(e.clientX,e.clientY),t.completeDrag(),Mt(),jt(),Nt(),H.current=null)},rn=st.window.height,J=st.window.offsetTop,an=Math.min(0,lt-rn),on=Math.min(0,lt-rn-mt),sn=ie===Xe||F.current,cn=Xe!=null&&sn&&!gt&&Ze>=0?ct[Ze]??t.getVisibleRows(Ze,Ze)[0]??null:null,ln=cn==null?null:LW(Ze,s,ut,rn),un=H.current,dn=rt!=null&&un!=null&&un.path===rt&&un.index>=ut.start&&un.index<=ut.end,fn=rt!=null&&un!=null&&un.path===rt&&!dn&&un.path!==cn?.path?un:null,pn=fn==null?null:LW(fn.index,s,ut,rn),mn=LG((Ze>=0?ct[Ze]??t.getVisibleRows(Ze,Ze)[0]??null:null)?.ancestorPaths.at(-1)??null),hn=Je&&Xe!=null?QG(o,Xe,!gt):void 0,gn=pe?.path??(Je?Xe:ie),_n=pe?.path??oe,vn=He(Xt),yn=Pe&&Ie&&!Zt&&!qe&&vn!=null&&ce!=null&&Xt!=null,bn=Pe&&(yn||pe!=null),xn=pe?.anchorRect,Sn=xn==null&&vn!=null&&ce!=null&&(pe!=null||yn)?ce:null,Cn=xn==null?Sn==null?void 0:{top:`${Sn}px`}:{left:`${xn.left}px`,position:`fixed`,right:`auto`,top:`${xn.top}px`},wn=Zt?{opacity:`0`}:void 0,Tn=lG((e,n,r,i)=>{let a=VW({event:{ctrlKey:e.ctrlKey,metaKey:e.metaKey,shiftKey:e.shiftKey},isDirectory:n.kind===`directory`,isSearchOpen:Je,mode:i}),o=a.toggleDirectory&&n.kind===`directory`,s=o?t.resolveMountedDirectoryPathFromInput(r):null;if(o&&s==null)return;let c=s??r;switch(a.selection.kind){case`range`:t.selectPathRange(c,a.selection.additive);break;case`toggle`:t.togglePathSelectionFromInput(c);break;case`single`:t.selectOnlyMountedPathFromInput(c);break}let l=e.currentTarget instanceof HTMLElement?e.currentTarget:null,u=n.index>=st.visible.startIndex&&n.index<=st.visible.endIndex,d=i===`flow`&&u&&l!=null&&l.dataset.itemParked!==`true`;t.focusMountedPathFromInput(c),d&&(M.current=!0,ae(e=>e===c?e:c),ue(`focus`)),o&&t.toggleMountedDirectoryFromInput(c),a.closeSearch&&t.closeSearch(),a.revealCanonical&&Dt(c,{targetOffset:`sticky-parents`})},[t,Je,st.visible.endIndex,st.visible.startIndex,Dt]),En=()=>{if(y.current||!Ie||Xt==null||vn==null)return;let e=t.getItem(Xt);e!=null&&(wt(vn),xt.current=!0,me({anchorRect:null,item:{kind:e.isDirectory()?`directory`:`file`,name:vn.getAttribute(`aria-label`)??Xt,path:e.getPath()},path:e.getPath(),source:`button`}))},Dn={contextHoverPath:_n,contextMenuButtonTriggerEnabled:Ie,contextMenuButtonVisibility:Le,contextMenuEnabled:Pe,contextMenuRightClickEnabled:Re,contextMenuTriggerMode:Fe,controller:t,directoriesWithGitChanges:i,dragAndDropEnabled:$e,draggedPathSet:tt,dragTarget:nt,gitLaneActive:Ue,gitStatusByPath:n,handleRowDragEnd:Vt,handleRowDragStart:Bt,handleRowTouchStart:Ht,ignoredGitDirectories:r,ignoredInheritanceCache:ne,instanceId:o,itemHeight:s,onKeyDown:Ut,onRowClick:Tn,openContextMenuForRow:Tt,registerButton:ze,registerRenameInput:Ve,renameView:Ge,renderDecorationForRow:_t,resolveIcon:We,shouldSuppressContextMenu:Ot,visualFocusPath:gn},On={...Dn,registerButton:Be};return JU(`div`,{ref:S,id:it,"data-file-tree-context-menu-button-visibility":Pe&&Ie?Le:void 0,"data-file-tree-context-menu-trigger-mode":Pe?Fe:void 0,"data-file-tree-has-context-menu-action-lane":Pe&&Ie?`true`:void 0,"data-file-tree-has-git-lane":Ue?`true`:void 0,"data-file-tree-virtualized-root":`true`,"data-file-tree-root-drag-target":nt?.kind===`root`?`true`:void 0,onDragLeave:$e?tn:void 0,onDragOver:$e?en:void 0,onDrop:$e?nn:void 0,onKeyDown:Ut,onPointerLeave:Pe?$t:void 0,onPointerOver:Pe?Qt:void 0,role:`tree`,tabIndex:-1,style:{outline:`none`,position:`relative`},children:[JU(`style`,{"data-file-tree-guide-style":`true`,dangerouslySetInnerHTML:{__html:mn}}),JU(`slot`,{name:aR,"data-type":`header-slot`}),f?JU(`div`,{"data-file-tree-search-container":!0,"data-open":Je?`true`:`false`,children:JU(`input`,{ref:w,"aria-activedescendant":hn,"aria-controls":it,placeholder:`Search…`,"data-file-tree-search-input":!0,"data-file-tree-search-input-fake-focus":Ee?`true`:void 0,value:Ye,onBlur:()=>{d===`retain`&&!Oe.current||t.closeSearch()},onFocus:ke,onPointerDown:ke,onInput:e=>{ke();let n=e.currentTarget;t.setSearch(n.value)}})}):null,JU(`div`,{ref:C,"data-file-tree-virtualized-scroll":`true`,children:[h&&Me&&dt.length>0?JU(`div`,{"aria-hidden":`true`,"data-file-tree-sticky-overlay":`true`,children:JU(`div`,{"data-file-tree-sticky-overlay-content":`true`,style:{height:`${at}px`},children:dt.map((e,t)=>rK(On,e.row,`sticky:${vG(e.row)}`,{mode:`sticky`,style:{left:`0`,position:`absolute`,right:`0`,top:`${e.top}px`,zIndex:`${dt.length-t}`}}))})}):null,JU(`div`,{ref:b,"data-file-tree-virtualized-list":`true`,style:{height:`${pt}px`},children:[JU(`div`,{"data-file-tree-virtualized-sticky-offset":`true`,"aria-hidden":`true`,style:{height:`${J}px`}}),JU(`div`,{"data-file-tree-virtualized-sticky":`true`,style:{height:`${rn}px`,top:`${an}px`,bottom:`${on}px`},children:[iK(Dn,ut,ht),cn!=null&&ln!=null?rK(Dn,cn,`parked:${cn.path}`,{isParked:!0,style:{left:`0`,opacity:`0`,pointerEvents:rt===cn.path?`none`:void 0,position:`absolute`,right:`0`,top:`${ln}px`}}):null,fn!=null&&pn!=null?rK(Dn,fn,`parked-drag:${fn.path}`,{isParked:!0,style:{left:`0`,opacity:`0`,pointerEvents:`none`,position:`absolute`,right:`0`,top:`${pn}px`}}):null]})]})]}),Pe?JU(`div`,{ref:_,"data-type":`context-menu-anchor`,"data-visible":bn?`true`:`false`,style:Cn,children:[JU(`button`,{ref:v,type:`button`,"data-type":sR,"aria-label":`Options`,"aria-haspopup":`menu`,"aria-expanded":pe==null?`false`:`true`,"data-visible":yn?`true`:`false`,onMouseDown:e=>{e.preventDefault()},onClick:e=>{if(e.preventDefault(),e.stopPropagation(),pe!=null){Ct();return}En()},tabIndex:-1,style:wn,children:JU(QU,{...We(`file-tree-icon-ellipsis`)})}),pe==null?null:JU(`slot`,{name:oR})]}):null,pe==null?null:JU(`div`,{"data-type":`context-menu-wash`,"aria-hidden":`true`,onMouseDownCapture:e=>{e.preventDefault(),Ct()},onTouchStartCapture:e=>{e.preventDefault(),e.stopPropagation(),Ct()},onTouchMoveCapture:e=>{e.preventDefault(),e.stopPropagation()},onWheelCapture:e=>{e.preventDefault(),e.stopPropagation()}})]})}var oK={hydrateRoot:(e,t)=>{KU(SU(aK,t),e)},renderRoot:(e,t)=>{GU(SU(aK,t),e)},unmountRoot:e=>{GU(null,e)}};function sK(e,t){oK.renderRoot(e,t)}function cK(e,t){oK.hydrateRoot(e,t)}function lK(e){oK.unmountRoot(e)}var uK=class{#e=new Map;#t=null;clearAll(){for(let e of this.#e.values())e.remove();this.#e.clear()}clearSlotContent(e){let t=this.#n(e);t!=null&&(t.remove(),this.#e.delete(e))}setHost(e){if(this.#t=e,e!=null){this.#i(e);for(let[e,t]of this.#e)this.#r(e,t)}}setSlotContent(e,t){let n=this.#n(e);if(n===t){t!=null&&(this.#e.set(e,t),this.#r(e,t));return}if(n?.remove(),t==null){this.#e.delete(e);return}this.#e.set(e,t),this.#r(e,t)}setSlotHtml(e,t){let n=t?.trim()??``;if(n.length===0){this.setSlotContent(e,null);return}let r=this.#n(e);if(r!=null&&r.innerHTML===n){this.#e.set(e,r),this.#r(e,r);return}let i=document.createElement(`div`);i.innerHTML=n,this.setSlotContent(e,i)}#n(e){let t=this.#e.get(e)??null;if(t!=null)return t;let n=this.#t;if(n==null)return null;for(let t of Array.from(n.children))if(t instanceof HTMLElement&&t.dataset.fileTreeManagedSlot===e)return t;return null}#r(e,t){t.slot=e,t.dataset.fileTreeManagedSlot=e,this.#t!=null&&t.parentNode!==this.#t&&this.#t.appendChild(t)}#i(e){for(let t of Array.from(e.children)){if(!(t instanceof HTMLElement))continue;let e=t.dataset.fileTreeManagedSlot;e==null||this.#e.has(e)||this.#e.set(e,t)}}},dK=`__c`,fK=`__k`,pK=`__d`,mK=`__s`,hK=/[\s\n\\/='"\0<>]/,gK=/^(xlink|xmlns|xml)([A-Z])/,_K=/^(?:accessK|auto[A-Z]|cell|ch|col|cont|cross|dateT|encT|form[A-Z]|frame|hrefL|inputM|maxL|minL|noV|playsI|popoverT|readO|rowS|src[A-Z]|tabI|useM|item[A-Z])/,vK=/^ac|^ali|arabic|basel|cap|clipPath$|clipRule$|color|dominant|enable|fill|flood|font|glyph[^R]|horiz|image|letter|lighting|marker[^WUH]|overline|panose|pointe|paint|rendering|shape|stop|strikethrough|stroke|text[^L]|transform|underline|unicode|units|^v[^i]|^w|^xH/,yK=new Set([`draggable`,`spellcheck`]);function bK(e){e.__g===void 0?e[pK]=!0:e.__g|=8}function xK(e){e.__g===void 0?e[pK]=!1:e.__g&=-9}function SK(e){return e.__g===void 0?!0===e[pK]:!!(8&e.__g)}var CK=/["&<]/;function wK(e){if(e.length===0||!1===CK.test(e))return e;for(var t=0,n=0,r=``,i=``;n<e.length;n++){switch(e.charCodeAt(n)){case 34:i=`"`;break;case 38:i=`&`;break;case 60:i=`<`;break;default:continue}n!==t&&(r+=e.slice(t,n)),r+=i,t=n+1}return n!==t&&(r+=e.slice(t,n)),r}var TK={},EK=new Set(`animation-iteration-count.border-image-outset.border-image-slice.border-image-width.box-flex.box-flex-group.box-ordinal-group.column-count.fill-opacity.flex.flex-grow.flex-negative.flex-order.flex-positive.flex-shrink.flood-opacity.font-weight.grid-column.grid-row.line-clamp.line-height.opacity.order.orphans.stop-opacity.stroke-dasharray.stroke-dashoffset.stroke-miterlimit.stroke-opacity.stroke-width.tab-size.widows.z-index.zoom`.split(`.`)),DK=/[A-Z]/g;function OK(e){var t=``;for(var n in e){var r=e[n];if(r!=null&&r!==``){var i=n[0]==`-`?n:TK[n]||(TK[n]=n.replace(DK,`-$&`).toLowerCase()),a=`;`;typeof r!=`number`||i.startsWith(`--`)||EK.has(i)||(a=`px;`),t=t+i+`:`+r+a}}return t||void 0}function kK(){this.__d=!0}function AK(e,t){return{__v:e,context:t,props:e.props,setState:kK,forceUpdate:kK,__d:!0,__h:[]}}function jK(e,t,n){if(!e.s){if(n instanceof MK){if(!n.s)return void(n.o=jK.bind(null,e,t));1&t&&(t=n.s),n=n.v}if(n&&n.then)return void n.then(jK.bind(null,e,t),jK.bind(null,e,2));e.s=t,e.v=n;let r=e.o;r&&r(e)}}var MK=function(){function e(){}return e.prototype.then=function(t,n){var r=new e,i=this.s;if(i){var a=1&i?t:n;if(a){try{jK(r,1,a(this.v))}catch(e){jK(r,2,e)}return r}return this}return this.o=function(e){try{var i=e.v;1&e.s?jK(r,1,t?t(i):i):n?jK(r,1,n(i)):jK(r,2,i)}catch(e){jK(r,2,e)}},r},e}(),NK,PK,FK,IK,LK={},RK=Array.isArray,zK=Object.assign,BK=``,VK=`<!--$s-->`,HK=`<!--/$s-->`;function UK(e,t){var n,r=e.type,i=!0;return e[dK]?(i=!1,(n=e[dK]).state=n[mK]):n=new r(e.props,t),e[dK]=n,n.__v=e,n.props=e.props,n.context=t,bK(n),n.state??=LK,n[mK]??(n[mK]=n.state),r.getDerivedStateFromProps?n.state=zK({},n.state,r.getDerivedStateFromProps(n.props,n.state)):i&&n.componentWillMount?(n.componentWillMount(),n.state=n[mK]===n.state?n.state:n[mK]):!i&&n.componentWillUpdate&&n.componentWillUpdate(),FK&&FK(e),n.render(n.props,n.state,t)}function WK(e,t,n,r,i,a,o){if(e==null||!0===e||!1===e||e===BK)return BK;var s=typeof e;if(s!=`object`)return s==`function`?BK:s==`string`?wK(e):e+BK;if(RK(e)){var c,l=BK;i[fK]=e;for(var u=e.length,d=0;d<u;d++){var f=e[d];if(f!=null&&typeof f!=`boolean`){var p,m=WK(f,t,n,r,i,a,o);typeof m==`string`?l+=m:(c||=Array(u),l&&c.push(l),l=BK,RK(m)?(p=c).push.apply(p,m):c.push(m))}}return c?(l&&c.push(l),c):l}if(e.constructor!==void 0)return BK;e.__=i,NK&&NK(e);var h=e.type,g=e.props;if(typeof h==`function`){var _,v,y,b=t;if(h===wU){if(`tpl`in g){for(var x=BK,S=0;S<g.tpl.length;S++)if(x+=g.tpl[S],g.exprs&&S<g.exprs.length){var C=g.exprs[S];if(C==null)continue;typeof C!=`object`||C.constructor!==void 0&&!RK(C)?x+=C:x+=WK(C,t,n,r,e,a,o)}return x}if(`UNSTABLE_comment`in g)return`<!--`+wK(g.UNSTABLE_comment)+`-->`;v=g.children}else{if((_=h.contextType)!=null){var w=t[_.__c];b=w?w.props.value:_.__}var T=h.prototype&&typeof h.prototype.render==`function`;if(T)v=UK(e,b),y=e[dK];else{e[dK]=y=AK(e,b);for(var E=0;SK(y)&&E++<25;){xK(y),FK&&FK(e);try{v=h.call(y,g,b)}catch(t){throw a&&t&&typeof t.then==`function`&&(e._suspended=!0),t}}bK(y)}if(y.getChildContext!=null&&(t=zK({},t,y.getChildContext())),T&&oU.errorBoundaries&&(h.getDerivedStateFromError||y.componentDidCatch)){v=v!=null&&v.type===wU&&v.key==null&&v.props.tpl==null?v.props.children:v;try{return WK(v,t,n,r,e,a,!1)}catch(i){return h.getDerivedStateFromError&&(y[mK]=h.getDerivedStateFromError(i)),y.componentDidCatch&&y.componentDidCatch(i,LK),SK(y)?(v=UK(e,t),(y=e[dK]).getChildContext!=null&&(t=zK({},t,y.getChildContext())),WK(v=v!=null&&v.type===wU&&v.key==null&&v.props.tpl==null?v.props.children:v,t,n,r,e,a,o)):BK}finally{PK&&PK(e),IK&&IK(e)}}}v=v!=null&&v.type===wU&&v.key==null&&v.props.tpl==null?v.props.children:v;try{var D=WK(v,t,n,r,e,a,o);return PK&&PK(e),oU.unmount&&oU.unmount(e),e._suspended?typeof D==`string`?VK+D+HK:RK(D)?(D.unshift(VK),D.push(HK),D):D.then(function(e){return VK+e+HK}):D}catch(i){if(!a&&o&&o.onError){var O=function i(s){return o.onError(s,e,function(e,s){try{return WK(e,t,n,r,s,a,o)}catch(e){return i(e)}})}(i);if(O!==void 0)return O;var k=oU.__e;return k&&k(i,e),BK}if(!a||!i||typeof i.then!=`function`)throw i;return i.then(function i(){try{var s=WK(v,t,n,r,e,a,o);return e._suspended?VK+s+HK:s}catch(e){if(!e||typeof e.then!=`function`)throw e;return e.then(i)}})}}var A,j=`<`+h,M=BK;for(var N in g){var P=g[N];if(typeof(P=KK(P)?P.value:P)!=`function`||N===`class`||N===`className`){switch(N){case`children`:A=P;continue;case`key`:case`ref`:case`__self`:case`__source`:continue;case`htmlFor`:if(`for`in g)continue;N=`for`;break;case`className`:if(`class`in g)continue;N=`class`;break;case`defaultChecked`:N=`checked`;break;case`defaultSelected`:N=`selected`;break;case`defaultValue`:case`value`:switch(N=`value`,h){case`textarea`:A=P;continue;case`select`:r=P;continue;case`option`:r!=P||`selected`in g||(j+=` selected`)}break;case`dangerouslySetInnerHTML`:M=P&&P.__html;continue;case`style`:typeof P==`object`&&(P=OK(P));break;case`acceptCharset`:N=`accept-charset`;break;case`httpEquiv`:N=`http-equiv`;break;default:if(gK.test(N))N=N.replace(gK,`$1:$2`).toLowerCase();else{if(hK.test(N))continue;N[4]!==`-`&&!yK.has(N)||P==null?n?vK.test(N)&&(N=N===`panose1`?`panose-1`:N.replace(/([A-Z])/g,`-$1`).toLowerCase()):_K.test(N)&&(N=N.toLowerCase()):P+=BK}}P!=null&&!1!==P&&(j=!0===P||P===BK?j+` `+N:j+` `+N+`="`+(typeof P==`string`?wK(P):P+BK)+`"`)}}if(hK.test(h))throw Error(h+` is not a valid HTML tag name in `+j+`>`);if(M||(typeof A==`string`?M=wK(A):A!=null&&!1!==A&&!0!==A&&(M=WK(A,t,h===`svg`||h!==`foreignObject`&&n,r,e,a,o))),PK&&PK(e),IK&&IK(e),!M&&GK.has(h))return j+`/>`;var F=`</`+h+`>`,I=j+`>`;return RK(M)?[I].concat(M,[F]):typeof M==`string`?I+M+F:[I,M,F]}var GK=new Set([`area`,`base`,`br`,`col`,`command`,`embed`,`hr`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`]);function KK(e){return typeof e==`object`&&!!e&&typeof e.peek==`function`&&`value`in e}var qK=0;function JK(e){return e!=null&&e.length>0?e:(qK+=1,`pst_ft_${qK}`)}function YK({initialVisibleRowCount:e,itemHeight:t}){return e==null?420:Math.max(0,e)*(t??rH)}function XK(e){if(typeof document>`u`)return;let t=document.createElement(`div`);t.innerHTML=e;let n=t.querySelector(`svg`);return n instanceof SVGElement?n:void 0}function ZK(e){return e.querySelector(`#file-tree-icon-chevron`)instanceof SVGElement&&e.querySelector(`#file-tree-icon-file`)instanceof SVGElement&&e.querySelector(`#file-tree-icon-dot`)instanceof SVGElement&&e.querySelector(`#file-tree-icon-lock`)instanceof SVGElement}function QK(e){return Array.from(e.children).filter(e=>e instanceof SVGElement)}var $K=class{static LoadedCustomComponent=!0;#e;#t;#n;#r;#i;#a;#o;#s;#c;#l=new uK;#u;#d;#f;#p;#m;#h;#g;#_;#v;#y=null;#b;#x=!1;#S=!1;constructor(e){let{composition:t,density:n,fileTreeSearchMode:r,gitStatus:i,id:a,initialSearchQuery:o,icons:s,itemHeight:c,onSearchChange:l,onSelectionChange:u,overscan:d,renderRowDecoration:f,renaming:p,search:m,searchBlurBehavior:h,searchFakeFocus:g,stickyFolders:_,unsafeCSS:v,initialVisibleRowCount:y,...b}=e;this.#e=t,this.#n=JK(a),this.#p=aU(i),this.#m=s,this.#h=v,this.#r=u,this.#i=f,this.#a=p!=null&&p!==!1,this.#o=h,this.#s=m===!0,this.#c=g===!0,this.#u=nH(n,c),this.#d={itemHeight:this.#u.itemHeight,overscan:d,stickyFolders:_,initialVisibleRowCount:y},this.#t=new eU({...b,fileTreeSearchMode:r,initialSearchQuery:o,onSearchChange:l,renaming:p}),this.#v=this.#t.getSelectionVersion(),this.#y=this.#r==null?null:this.subscribe(()=>{this.#D()})}unmount(){this.#b!=null&&(lK(this.#b),delete this.#b.dataset.fileTreeVirtualizedWrapper,this.#b=void 0),this.#l.clearAll(),this.#l.setHost(null),this.#f!=null&&(delete this.#f.dataset.fileTreeVirtualized,this.#I(this.#f),this.#f=void 0)}cleanUp(){this.unmount(),this.#y?.(),this.#y=null,this.#t.destroy()}getFileTreeContainer(){return this.#f}getItem(e){return this.#t.getItem(e)}getFocusedItem(){return this.#t.getFocusedItem()}getFocusedPath(){return this.#t.getFocusedPath()}getSelectedPaths(){return this.#t.getSelectedPaths()}getComposition(){return this.#e}getItemHeight(){return this.#u.itemHeight}getDensityFactor(){return this.#u.factor}subscribe(e){let t=!1;return this.#t.subscribe(()=>{if(!t){t=!0;return}e()})}focusPath(e){this.#t.focusPath(e)}scrollToPath(e,t){this.#t.scrollToPath(e,t)}focusNearestPath(e){return this.#t.focusNearestPath(e)}add(e){this.#t.add(e)}batch(e){this.#t.batch(e)}move(e,t,n){this.#t.move(e,t,n)}onMutation(e,t){return this.#t.onMutation(e,t)}setSearch(e){this.#t.setSearch(e)}openSearch(e){this.#t.openSearch(e)}closeSearch(){this.#t.closeSearch()}isSearchOpen(){return this.#t.isSearchOpen()}getSearchValue(){return this.#t.getSearchValue()}getSearchMatchingPaths(){return this.#t.getSearchMatchingPaths()}focusNextSearchMatch(){this.#t.focusNextSearchMatch()}focusPreviousSearchMatch(){this.#t.focusPreviousSearchMatch()}startRenaming(e,t){return this.#t.startRenaming(e,t)}remove(e,t){this.#t.remove(e,t)}resetPaths(e,t){this.#t.resetPaths(e,t)}setComposition(e){this.#e=e;let t=this.#T();t!=null&&(this.#O(),sK(t.wrapper,this.#w()))}setGitStatus(e){this.#p=aU(e,this.#p);let t=this.#T();t!=null&&sK(t.wrapper,this.#w())}setIcons(e){this.#m=e;let t=this.#T();t!=null&&(this.#E(t.host,t.wrapper),sK(t.wrapper,this.#w()))}hydrate({fileTreeContainer:e}){let t=this.#P(e),n=this.#N(t);this.#O(),cK(n,this.#w())}render({containerWrapper:e,fileTreeContainer:t}){let n=this.#P(t??this.#f,e),r=this.#N(n);this.#O(),sK(r,this.#w())}#C(){return{initialViewportHeight:YK({initialVisibleRowCount:this.#d.initialVisibleRowCount,itemHeight:this.#d.itemHeight}),itemHeight:this.#d.itemHeight,overscan:this.#d.overscan,stickyFolders:this.#d.stickyFolders}}#w(){return{composition:this.#e,controller:this.#t,gitStatusByPath:this.#p?.statusByPath,ignoredGitDirectories:this.#p?.ignoredDirectoryPaths,directoriesWithGitChanges:this.#p?.directoriesWithChanges,icons:this.#m,instanceId:this.#n,renamingEnabled:this.#a,renderRowDecoration:this.#i,searchBlurBehavior:this.#o,searchEnabled:this.#s,searchFakeFocus:this.#c,slotHost:this.#l,...this.#C()}}#T(){let e=this.#f,t=this.#b;return e==null||t==null?null:{host:e,wrapper:t}}#E(e,t){let n=e.shadowRoot;n!=null&&(this.#k(n),this.#A(n)),this.#j(t)}#D(){let e=this.#r;if(e==null)return;let t=this.#t.getSelectionVersion();t!==this.#v&&(this.#v=t,e(this.#t.getSelectedPaths()))}#O(){let e=this.#e?.header?.render;if(e!=null){this.#l.setSlotContent(aR,e());return}this.#l.setSlotHtml(aR,this.#e?.header?.html??null)}#k(e){let t=QK(e).find(e=>ZK(e)),n=XK(YL(lR(this.#m).set));n!=null&&(t!=null&&t.outerHTML===n.outerHTML||(t==null?e.prepend(n):t.replaceWith(n)))}#A(e){let t=QK(e),n=t.find(e=>ZK(e)),r=t.filter(e=>e!==n),i=lR(this.#m).spriteSheet?.trim()??``;if(i.length===0){for(let e of r)e.remove();return}let a=XK(i);if(a==null){for(let e of r)e.remove();return}if(!(r.length===1&&r[0].outerHTML===a.outerHTML)){for(let e of r)e.remove();e.appendChild(a)}}#j(e){let t=lR(this.#m);t.colored&&ZL(t.set)?e.dataset.fileTreeColoredIcons=`true`:delete e.dataset.fileTreeColoredIcons}#M(e){let t=e.querySelector(`style[${tR}]`);if(this.#g==null&&t instanceof HTMLStyleElement&&(this.#g=t),this.#h==null||this.#h===``){this.#g?.remove(),this.#g=void 0,this.#_=void 0;return}this.#g?.parentNode===e&&this.#_===this.#h||(this.#g??=document.createElement(`style`),this.#g.setAttribute(tR,``),this.#g.parentNode!==e&&e.appendChild(this.#g),this.#g.textContent=sH(this.#h),this.#_=this.#h)}#N(e){if(this.#b!=null)return this.#b;let t=e.shadowRoot;if(t==null)throw Error(`FileTree requires a shadow root`);let n=Array.from(t.children).filter(e=>e instanceof HTMLDivElement&&typeof e.dataset.fileTreeId==`string`&&e.dataset.fileTreeId.length>0),r=n.find(e=>e.dataset.fileTreeId===this.#n)??n[0];return r!=null&&(this.#n=r.dataset.fileTreeId??this.#n),this.#b=r??document.createElement(`div`),this.#b.dataset.fileTreeId=this.#n,this.#b.dataset.fileTreeVirtualizedWrapper=`true`,this.#E(e,this.#b),this.#b.parentNode!==t&&t.appendChild(this.#b),this.#b}#P(e,t){let n=e??this.#f??document.createElement(`file-tree-container`);t!=null&&n.parentNode!==t&&t.appendChild(n);let r=n.shadowRoot??n.attachShadow({mode:`open`});return pH(n,r),this.#M(r),n.dataset.fileTreeVirtualized=`true`,n.style.display=`flex`,this.#F(n),this.#l.setHost(n),this.#f=n,n}#F(e){e.style.getPropertyValue(`--trees-item-height`)===``&&(e.style.setProperty(`--trees-item-height`,`${String(this.#u.itemHeight)}px`),this.#x=!0),e.style.getPropertyValue(`--trees-density-override`)===``&&(e.style.setProperty(`--trees-density-override`,String(this.#u.factor)),this.#S=!0)}#I(e){this.#x&&=(e.style.removeProperty(`--trees-item-height`),!1),this.#S&&=(e.style.removeProperty(`--trees-density-override`),!1)}},eq=typeof window>`u`?Q.useEffect:Q.useLayoutEffect;function tq(e,t,n){let r=e==null?null:(0,Z.jsx)(`div`,{slot:aR,children:e}),i=t!=null&&n!=null?(0,Z.jsx)(`div`,{slot:oR,children:t(n.item,n.context)}):null;return r==null&&i==null?null:(0,Z.jsxs)(Z.Fragment,{children:[r,i]})}function nq(e,t){return typeof window>`u`&&t!=null?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`template`,{shadowrootmode:`open`,dangerouslySetInnerHTML:{__html:t.shadowHtml}}),e]}):(0,Z.jsx)(Z.Fragment,{children:e})}function rq(e){let t=e.shadowRoot;return t?.querySelector(`[data-file-tree-id]`)instanceof HTMLElement||t?.querySelector(`[data-file-tree-id]`)instanceof SVGElement?!0:e.querySelector(`template[shadowrootmode="open"]`)instanceof HTMLTemplateElement}function iq(e,t,n,r,i){let a={...e??{}};if(t!=null&&delete a.header,n){let t=e?.contextMenu,n=t?.onClose,o=t?.onOpen;a.contextMenu={...t??{},enabled:!0,onClose:()=>{n?.(),r()},onOpen:(e,t)=>{i(e,t),o?.(e,t)}},delete a.contextMenu.render}return a.header!=null||a.contextMenu!=null?a:void 0}function aq({header:e,id:t,model:n,preloadedData:r,renderContextMenu:i,...a}){let[o,s]=(0,Q.useState)(null),[c,l]=(0,Q.useState)(null),u=(0,Q.useRef)(n.getComposition()),d=(0,Q.useRef)(n);d.current!==n&&(d.current=n,u.current=n.getComposition());let f=i!=null,p=(0,Q.useCallback)(()=>{s(null)},[]),m=(0,Q.useCallback)((e,t)=>{s({context:t,item:e})},[]),h=u.current,g=(0,Q.useMemo)(()=>iq(h,e,f,p,m),[h,p,m,f,e]),_=(0,Q.useCallback)(e=>{l(e)},[]);(0,Q.useEffect)(()=>{f||s(null)},[f]),eq(()=>{n.setComposition(g)},[g,n]),eq(()=>{if(c!=null)return r!=null&&rq(c)?n.hydrate({fileTreeContainer:c}):n.render({fileTreeContainer:c}),()=>{n.unmount(),n.setComposition(h)}},[h,c,n,r]);let v=nq(tq(e,i,o),r),y=t??r?.id,b={"--trees-item-height":`${String(n.getItemHeight())}px`,"--trees-density-override":n.getDensityFactor(),...a.style};return(0,Z.jsx)($L,{...a,id:y,ref:_,style:b,suppressHydrationWarning:r!=null,children:v})}function oq(e){let[t]=(0,Q.useState)(()=>new $K(e)),n=(0,Q.useRef)({timeout:null,model:t});return(0,Q.useEffect)(()=>{let{current:e}=n;return e.timeout!=null&&(clearTimeout(e.timeout),e.timeout=null),()=>{e.timeout=setTimeout(()=>e.model.cleanUp(),1)}},[]),{model:t}}var sq={density:`compact`,itemHeight:26,flattenEmptyDirectories:!1},cq={"--trees-level-gap-override":`4px`,"--trees-item-row-gap-override":`4px`,"--trees-icon-width-override":`14px`,"--trees-item-height":`${sq.itemHeight}px`,"--trees-indent-guide-bg-override":`color-mix(in oklab, var(--trees-fg-muted) 30%, transparent)`},lq=`
|
|
1867
1867
|
[data-item-section='spacing-item'] {
|
|
1868
1868
|
opacity: 0.5;
|
|
1869
1869
|
}
|
|
1870
1870
|
:host(:hover) [data-item-section='spacing-item'] {
|
|
1871
1871
|
opacity: 0.85;
|
|
1872
1872
|
}
|
|
1873
|
-
|
|
1873
|
+
`,uq=`
|
|
1874
1874
|
[data-file-tree-sticky-overlay-content='true'] {
|
|
1875
1875
|
--trees-bg: color-mix(in oklab, var(--sidebar) 92%, var(--sidebar-foreground) 8%);
|
|
1876
1876
|
box-shadow: 0 1px 0 0 var(--sidebar-border);
|
|
@@ -1884,17 +1884,17 @@ Error generating stack: `+e.message+`
|
|
|
1884
1884
|
border-bottom: 1px solid CanvasText;
|
|
1885
1885
|
}
|
|
1886
1886
|
}
|
|
1887
|
-
`;function
|
|
1887
|
+
`;function dq(e){return{...bR({type:e===`dark`?`dark`:`light`,colors:{"sideBar.background":`var(--sidebar)`,"sideBar.foreground":`var(--sidebar-foreground)`,"sideBar.border":`var(--sidebar-border)`,"list.activeSelectionBackground":`var(--sidebar-accent)`,"list.activeSelectionForeground":`var(--sidebar-accent-foreground)`,"list.hoverBackground":`var(--sidebar-hover)`,focusBorder:`var(--color-primary)`,"input.background":`var(--input)`,"input.border":`var(--border)`}}),"--trees-font-family-override":`var(--font-sans)`,"--trees-font-size-override":`0.875rem`,"--trees-item-padding-x-override":`0.5rem`,"--trees-padding-inline-override":`0.5rem`,"--trees-border-radius-override":`0.375rem`,"--trees-selected-fg":`var(--color-primary)`,"--truncate-marker-fade-in-duration":`0s`,"--trees-file-icon-color-markdown":`light-dark(var(--color-gray-400), var(--color-gray-500))`,"--trees-fg-muted":`light-dark(var(--color-gray-400), var(--color-gray-500))`,...cq}}var fq=`data-ok-ext-badge`,pq=`data-ok-ext-row`,mq=`data-ok-fullname-row`,hq=`
|
|
1888
1888
|
[data-item-selected='true'] [data-icon-token='markdown'] {
|
|
1889
1889
|
color: var(--trees-selected-fg);
|
|
1890
1890
|
}
|
|
1891
|
-
[data-type='item'][${
|
|
1891
|
+
[data-type='item'][${pq}] [data-truncate-segment-priority]:last-child {
|
|
1892
1892
|
display: none;
|
|
1893
1893
|
}
|
|
1894
|
-
[data-type='item'][${
|
|
1894
|
+
[data-type='item'][${mq}] [data-truncate-segment-priority]:last-child {
|
|
1895
1895
|
display: none;
|
|
1896
1896
|
}
|
|
1897
|
-
[${
|
|
1897
|
+
[${fq}] {
|
|
1898
1898
|
display: inline-block;
|
|
1899
1899
|
margin-left: 0.375rem;
|
|
1900
1900
|
margin-right: 0.25rem;
|
|
@@ -1906,7 +1906,7 @@ Error generating stack: `+e.message+`
|
|
|
1906
1906
|
pointer-events: none;
|
|
1907
1907
|
user-select: none;
|
|
1908
1908
|
}
|
|
1909
|
-
`;function
|
|
1909
|
+
`;function gq(e){let t=e.querySelectorAll(`[data-type="item"][data-item-path]`);for(let e of t){let t=e.dataset.itemPath;if(!t){vq(e);continue}if(t.endsWith(`/`)){bq(e,t);continue}let n=Qc(t);if(!n){vq(e);continue}let r=yq(e);if(r){if(e.setAttribute(pq,``),e.removeAttribute(mq),wq(r),n.toLowerCase()===`.md`){_q(e);continue}Tq(e,n.slice(1).toUpperCase())}}}function _q(e){let t=e.querySelector(`[${fq}]`);t&&t.remove()}function vq(e){e.removeAttribute(pq),e.removeAttribute(mq),_q(e)}function yq(e){let t=e.querySelector(`[data-truncate-group-container="middle"]`);if(!t)return null;let n=t.querySelectorAll(`[data-truncate-segment-priority]`);return n.length<2?null:n[0]??null}function bq(e,t){e.removeAttribute(pq),_q(e);let n=yq(e),r=xq(t);if(!n||!r){e.removeAttribute(mq);return}Cq(n,r),e.setAttribute(mq,``)}function xq(e){let t=e.replace(/\/+$/,``),n=t.lastIndexOf(`/`);return n>=0?t.slice(n+1):t}function Sq(e,t){let n=e.querySelectorAll(`[data-truncate-content]`);for(let e of n){let n=e.firstChild;if(!n||n.nodeType!==Node.TEXT_NODE)continue;let r=n.textContent??``,i=t(r);i!==r&&(n.textContent=i)}}function Cq(e,t){Sq(e,()=>t)}function wq(e){Sq(e,e=>e.replace(/\.+$/,``))}function Tq(e,t){let n=e.querySelector(`[${fq}]`);if(!n){n=e.ownerDocument.createElement(`span`),n.setAttribute(fq,``),n.setAttribute(`aria-hidden`,`true`);let t=e.querySelector(`[data-item-section="action"]`);t?t.before(n):e.appendChild(n)}n.textContent!==t&&(n.textContent=t)}function Eq(e){return e.replace(/\\/g,`\\\\`).replace(/\[/g,`\\[`).replace(/\]/g,`\\]`).replace(/\*/g,`\\*`)}function Dq(e){let t=Eq(e.path);return e.kind===`folder`?`/${t}/`:`/${t}${e.docExt??`.md`}`}var Oq=`data-ok-renaming`,kq=`data-ok-rename-selection-applied`,Aq=null,jq=null,Mq=5e3,Nq=`
|
|
1910
1910
|
/* Pierre's icon decoration keys off the row's data-item-path. If the user
|
|
1911
1911
|
deletes the extension before commit, Pierre can temporarily key the row
|
|
1912
1912
|
by an extensionless path and swap [data-icon-token] from 'markdown' to
|
|
@@ -1917,16 +1917,16 @@ Error generating stack: `+e.message+`
|
|
|
1917
1917
|
the row to an extensionless path, then clears it when the path next
|
|
1918
1918
|
includes the saved extension (settle / cancel / row recycle to a settled
|
|
1919
1919
|
file). */
|
|
1920
|
-
[${
|
|
1921
|
-
[${
|
|
1920
|
+
[${Oq}='.md'] [data-item-section="icon"],
|
|
1921
|
+
[${Oq}='.mdx'] [data-item-section="icon"] {
|
|
1922
1922
|
position: relative;
|
|
1923
1923
|
}
|
|
1924
|
-
[${
|
|
1925
|
-
[${
|
|
1924
|
+
[${Oq}='.md'] [data-item-section="icon"] [data-icon-token]:not([data-icon-token='markdown']),
|
|
1925
|
+
[${Oq}='.mdx'] [data-item-section="icon"] [data-icon-token]:not([data-icon-token='markdown']) {
|
|
1926
1926
|
visibility: hidden;
|
|
1927
1927
|
}
|
|
1928
|
-
[${
|
|
1929
|
-
[${
|
|
1928
|
+
[${Oq}='.md'] [data-item-section="icon"]::before,
|
|
1929
|
+
[${Oq}='.mdx'] [data-item-section="icon"]::before {
|
|
1930
1930
|
content: '';
|
|
1931
1931
|
display: block;
|
|
1932
1932
|
position: absolute;
|
|
@@ -1938,14 +1938,14 @@ Error generating stack: `+e.message+`
|
|
|
1938
1938
|
mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M1 12V4h2l2 2.5L7 4h2v8H7V7.5l-2 2-2-2V12zm9-3 3 3.5L16 9h-2V4h-2v5z'/></svg>") center / contain no-repeat;
|
|
1939
1939
|
pointer-events: none;
|
|
1940
1940
|
}
|
|
1941
|
-
`;function Cq(e){Eq(e);let t=e.querySelector(`[data-item-rename-input]`);if(!t)return;let n=t.closest(`[data-type="item"]`);if(!n)return;let r=n.dataset.itemPath??``;if(r.endsWith(`/`))return;let i=Qc(r);Xc(r)&&wq(i),!t.hasAttribute(vq)&&(Dq(t),t.setAttribute(vq,``))}function wq(e){yq=e,bq!==null&&clearTimeout(bq),bq=setTimeout(Tq,xq)}function Tq(){yq=null,bq!==null&&(clearTimeout(bq),bq=null)}function Eq(e){let t=e.querySelectorAll(`[${_q}]`);for(let e of t){if(e.querySelector(`[data-item-rename-input]`))continue;let t=e.getAttribute(_q);if(!t){e.removeAttribute(_q);continue}let n=e.dataset.itemPath??``;if(n.toLowerCase().endsWith(t.toLowerCase())){e.removeAttribute(_q);continue}let r=Qc(n);r&&r.toLowerCase()!==t.toLowerCase()&&e.removeAttribute(_q)}if(yq===null)return;let n=e.querySelectorAll(`[data-type="item"][data-item-path]`),r=!1;for(let e of n){let t=e.dataset.itemPath??``;!t||t.endsWith(`/`)||Qc(t)||(r=!0,e.getAttribute(`data-item-selected`)===`true`&&e.getAttribute(`data-ok-renaming`)!==yq&&e.setAttribute(_q,yq))}let i=!!e.querySelector(`[data-item-rename-input]`);!r&&!i&&Tq()}function Dq(e){let t=Qc(e.value),n=t?e.value.length-t.length:e.value.length;e.setSelectionRange(0,n)}function Oq(e){let t=e.getFocusedPath();t&&e.scrollToPath(t,{offset:`nearest`,focus:!1})}function kq(e){return{selectedFilePath:e,selectedFolderPath:null,navigationPath:e}}function Aq(e,t,n={}){if(!e)return kq(t);let r=al(e);if(t&&r!==t)return kq(t);switch(e.kind){case`doc`:return kq(t??e.docName);case`large-file`:return kq(e.docName);case`folder`:case`folder-index`:return{selectedFilePath:null,selectedFolderPath:e.folderPath,navigationPath:e.folderPath};case`missing`:return t&&n.isKnownDocument?.(t)?kq(t):{selectedFilePath:null,selectedFolderPath:null,navigationPath:null};case`asset`:case`skill-file`:return{selectedFilePath:null,selectedFolderPath:null,navigationPath:null}}}function jq(e,t){if(!e)return{kind:`none`};let n=t.find(t=>Pu(t)===e),r=Xu(e),i=e.endsWith(`/`)?r:Zu(e,t);return i===r?n&&il(n)?{kind:`asset`,path:n.path,hash:Dl(n.path),mediaKind:n.mediaKind}:n&&ul(n)?{kind:`document`,path:n.docName}:e.endsWith(`/`)?t.some(e=>tl(e)?e.path===r||e.path.startsWith(`${r}/`):(il(e)?e.path:e.docName).startsWith(`${r}/`))?{kind:`folder`,path:r}:{kind:`none`}:t.some(e=>ul(e)&&e.docName===r)?{kind:`document`,path:r}:{kind:`none`}:{kind:`document`,path:i}}var Mq=`You can restore this file from the Trash.`;function Nq(e){let t=Mq,n=`Move to Trash`,r=`Moving`;if(e.length===0)return{title:`Are you sure you want to delete the selected items?`,detail:t,listedTargets:null,confirmLabel:n,confirmLabelBusy:r};if(e.length===1){let i=e[0];return i?i.kind===`folder`?{title:`Are you sure you want to delete '${i.name}' and its contents?`,detail:t,listedTargets:null,confirmLabel:n,confirmLabelBusy:r}:{title:`Are you sure you want to delete '${i.name}'?`,detail:t,listedTargets:null,confirmLabel:n,confirmLabelBusy:r}:{title:`Are you sure you want to delete the selected item?`,detail:t,listedTargets:null,confirmLabel:n,confirmLabelBusy:r}}let i=e.some(e=>e.kind===`folder`),a=e.some(e=>e.kind!==`folder`);return i&&a?{title:`Are you sure you want to delete the following ${e.length} files/directories and their contents?`,detail:t,listedTargets:e,confirmLabel:n,confirmLabelBusy:r}:i?{title:`Are you sure you want to delete the following ${e.length} directories and their contents?`,detail:t,listedTargets:e,confirmLabel:n,confirmLabelBusy:r}:{title:`Are you sure you want to delete the following ${e.length} files?`,detail:t,listedTargets:e,confirmLabel:n,confirmLabelBusy:r}}function Pq(e,t){return e===`web`?null:Nq(t)}function Fq(e){return e.kind===`folder`?`${e.name}/`:e.kind===`asset`?e.name:e.docExt?`${e.name}${e.docExt}`:e.name}function Iq(e,t,n){let r=jq(e,t);if(r.kind===`none`)return null;if(r.kind===`asset`)return{v:1,kind:`asset`,assetPath:r.path,mediaKind:r.mediaKind};if(r.kind===`folder`)return{v:1,kind:`folder`,folderPath:r.path};let i=t.find(e=>ul(e)&&e.docName===r.path);return{v:1,kind:`doc`,docName:r.path,size:i?.size??n?.get(r.path)?.size??null}}var Lq=[`not-found`,`permission-denied`,`system-error`,`path-escape`];function Rq(e){return typeof e==`string`&&Lq.includes(e)?e:`system-error`}function zq(e){switch(e){case`not-found`:return Yc._({id:`v41fCm`});case`permission-denied`:return Yc._({id:`sJK6pq`});case`system-error`:return Yc._({id:`Jqqevv`});case`path-escape`:return Yc._({id:`WL6puM`})}}function Bq(e){let t=zq(e.reason),n=e.detail;return n?Yc._({id:`Z2M5XM`,values:{reason:t,osDetail:n}}):Yc._({id:`dTaauv`,values:{reason:t}})}function Vq(e){return e.kind===`folder`?`${e.name}/`:e.name}function Hq(e){let t=(0,$.c)(34),{failedTargets:n,isSubmitting:r,onDeletePermanently:i,onRetry:a,onCancel:o}=e,s=n.length>1,c=n[0],l=n.length,u;if(t[0]!==l||t[1]!==s||t[2]!==c){let e=c?Vq(c):``;u=s?Yc._({id:`5qNxOe`,values:{count:l}}):c?`${Yc._({id:`E_BHoD`,values:{targetName:e}})}\n${Bq(c)}`:Yc._({id:`kolRU1`}),t[0]=l,t[1]=s,t[2]=c,t[3]=u}else u=t[3];let d=u,f;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Z.jsx)(zs,{children:(0,Z.jsx)(J,{id:`aOp3hw`})}),t[4]=f):f=t[4];let p;t[5]===d?p=t[6]:(p=(0,Z.jsxs)(Us,{children:[f,(0,Z.jsx)(Rs,{className:`whitespace-pre-wrap`,children:d})]}),t[5]=d,t[6]=p);let m;t[7]!==n||t[8]!==s?(m=s?(0,Z.jsx)(Vs,{children:(0,Z.jsx)(`ul`,{className:`flex flex-col gap-2 text-xs`,children:n.map(Uq)})}):null,t[7]=n,t[8]=s,t[9]=m):m=t[9];let h;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,Z.jsx)(J,{id:`dEgA5A`}),t[10]=h):h=t[10];let g;t[11]!==r||t[12]!==o?(g=(0,Z.jsx)(X,{variant:`outline`,className:`font-mono uppercase`,onClick:o,disabled:r,"data-testid":`trash-failure-modal-cancel`,children:h}),t[11]=r,t[12]=o,t[13]=g):g=t[13];let _;t[14]===r?_=t[15]:(_=r?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(is,{className:`size-4 animate-spin`}),` `,(0,Z.jsx)(J,{id:`mf37rL`})]}):(0,Z.jsx)(J,{id:`6gRgw8`}),t[14]=r,t[15]=_);let v;t[16]!==r||t[17]!==a||t[18]!==_?(v=(0,Z.jsx)(X,{variant:`outline`,className:`font-mono uppercase`,onClick:a,disabled:r,"data-testid":`trash-failure-modal-retry`,children:_}),t[16]=r,t[17]=a,t[18]=_,t[19]=v):v=t[19];let y;t[20]===r?y=t[21]:(y=r?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(is,{className:`size-4 animate-spin`}),` `,(0,Z.jsx)(J,{id:`s3caR3`})]}):(0,Z.jsx)(J,{id:`UBv8UK`}),t[20]=r,t[21]=y);let b;t[22]!==r||t[23]!==i||t[24]!==y?(b=(0,Z.jsx)(X,{variant:`destructive`,onClick:i,disabled:r,"data-testid":`trash-failure-modal-delete-permanently`,children:y}),t[22]=r,t[23]=i,t[24]=y,t[25]=b):b=t[25];let x;t[26]!==b||t[27]!==g||t[28]!==v?(x=(0,Z.jsxs)(Hs,{children:[g,v,b]}),t[26]=b,t[27]=g,t[28]=v,t[29]=x):x=t[29];let S;return t[30]!==x||t[31]!==p||t[32]!==m?(S=(0,Z.jsxs)(Bs,{className:`sm:max-w-md`,children:[p,m,x]}),t[30]=x,t[31]=p,t[32]=m,t[33]=S):S=t[33],S}function Uq(e){return(0,Z.jsxs)(`li`,{"data-testid":`trash-failure-modal-target`,children:[(0,Z.jsx)(`div`,{className:`font-mono text-foreground`,children:Vq(e)}),(0,Z.jsx)(`div`,{className:`text-muted-foreground`,children:Bq(e)})]},e.path)}function Wq(e){let t=(0,$.c)(21),{parentDir:n,onSelectTemplate:r,ItemComponent:i}=e,{state:a}=_o(n);if(a.status===`idle`||a.status===`loading`){let e;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(J,{id:`Hl89Qd`}),t[0]=e):e=t[0];let n;return t[1]===i?n=t[2]:(n=(0,Z.jsx)(i,{disabled:!0,className:`text-muted-foreground`,children:e}),t[1]=i,t[2]=n),n}if(a.status===`error`){let e;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(J,{id:`AQ-Lfg`}),t[3]=e):e=t[3];let n;return t[4]===i?n=t[5]:(n=(0,Z.jsx)(i,{disabled:!0,className:`text-muted-foreground`,children:e}),t[4]=i,t[5]=n),n}let o,s;if(t[6]!==i||t[7]!==r||t[8]!==a.data.folder.templates_available){s=Symbol.for(`react.early_return_sentinel`);bb0:{let e;t[11]===a.data.folder.templates_available?e=t[12]:(e=a.data.folder.templates_available??[],t[11]=a.data.folder.templates_available,t[12]=e);let n=uh(e);if(n.length===0){let e;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(J,{id:`iGCs04`}),t[13]=e):e=t[13];let n;t[14]===i?n=t[15]:(n=(0,Z.jsx)(i,{disabled:!0,className:`text-muted-foreground`,children:e}),t[14]=i,t[15]=n),s=n;break bb0}let c;t[16]!==i||t[17]!==r?(c=e=>(0,Z.jsx)(i,{onSelect:()=>r(e.name),children:e.title??e.name},`${e.scope}:${e.source_folder}:${e.name}`),t[16]=i,t[17]=r,t[18]=c):c=t[18],o=n.map(c)}t[6]=i,t[7]=r,t[8]=a.data.folder.templates_available,t[9]=o,t[10]=s}else o=t[9],s=t[10];if(s!==Symbol.for(`react.early_return_sentinel`))return s;let c;return t[19]===o?c=t[20]:(c=(0,Z.jsx)(Z.Fragment,{children:o}),t[19]=o,t[20]=c),c}function Gq(e){return e?.isDirectory()?e:null}function Kq(e,t){let n=t.getPath();for(let t of e.getSelectedPaths())t!==n&&e.getItem(t)?.deselect();t.isSelected()||t.select()}function qq(e,t,n,r,i){let a=(0,$.c)(11),o;a[0]!==n||a[1]!==t||a[2]!==e||a[3]!==r?(o=()=>{let i=()=>{queueMicrotask(()=>{r.current=!1})};if(r.current=!0,!t){for(let t of e.getSelectedPaths())e.getItem(t)?.deselect();i();return}let a=n?n.split(`\0`):[];for(let t of a){let n=Gq(e.getItem(t));n&&!n.isExpanded()&&n.expand()}let o=e.getItem(t);if(!o){i();return}if(e.getSelectedPaths().length>1&&o.isSelected()){o.focus(),i();return}Kq(e,o),o.focus(),i()},a[0]=n,a[1]=t,a[2]=e,a[3]=r,a[4]=o):o=a[4];let s;a[5]!==n||a[6]!==t||a[7]!==e||a[8]!==r||a[9]!==i?(s=[n,t,e,r,i],a[5]=n,a[6]=t,a[7]=e,a[8]=r,a[9]=i,a[10]=s):s=a[10],(0,Q.useEffect)(o,s)}var Jq=`open-knowledge:file-tree-menu-action-delete`,Yq=`open-knowledge:file-tree-menu-action-rename`,Xq=`open-knowledge:file-tree-menu-action-duplicate`;function Zq(e){window.dispatchEvent(new CustomEvent(Jq,{detail:{target:e}}))}function Qq(e){let t=t=>{let n=t.detail;n?.target&&e(n.target)};return window.addEventListener(Jq,t),()=>window.removeEventListener(Jq,t)}function $q(e){window.dispatchEvent(new CustomEvent(Yq,{detail:{target:e}}))}function eJ(e){let t=t=>{let n=t.detail;n?.target&&e(n.target)};return window.addEventListener(Yq,t),()=>window.removeEventListener(Yq,t)}function tJ(e){window.dispatchEvent(new CustomEvent(Xq,{detail:{target:e}}))}function nJ(e){let t=t=>{let n=t.detail;n?.target&&e(n.target)};return window.addEventListener(Xq,t),()=>window.removeEventListener(Xq,t)}function rJ(e,t){let n=!1,r=!1,i=!1;async function a(){if(!i){n=!0;try{await e()}finally{n=!1,i?r=!1:r&&(r=!1,a())}}}return{request(){if(!i){if(n){r=!0,t?.();return}a()}},dispose(){i=!0,r=!1,t?.()}}}var iJ={Accept:`application/x-ndjson, application/json`};function aJ(e){return!e.ok||!e.body?!1:(e.headers.get(`content-type`)??``).includes(`application/x-ndjson`)}var oJ=class extends Error{};function sJ(e){return typeof e==`object`&&!!e&&`type`in e}async function cJ(e,t={}){let n=e.body;if(!n)throw new oJ(`Show All Files stream had no response body.`);let{onBatch:r}=t,i=n.getReader(),a=new TextDecoder,o=[],s=[],c=!1,l=``,u=e=>{let t=e.trim();if(t.length===0)return!1;let n;try{n=JSON.parse(t)}catch{return console.warn(`[show-all-stream] dropping unparseable NDJSON line:`,t.slice(0,200)),!1}if(sJ(n)){if(n.type===`error`)throw new oJ(typeof n.problem?.title==`string`?n.problem.title:`Show All Files stream failed.`);return c=n.truncated===!0,!0}let r=Kn.safeParse(n);return r.success?(o.push(r.data),s.push(r.data)):console.warn(`[show-all-stream] dropping schema-divergent entry line:`,r.error.issues),!1},d=()=>{if(!r||s.length===0)return;let e=s;s=[],r(e)};try{let e=!1;for(;!e;){let t=await i.read();if(t.done)break;l+=a.decode(t.value,{stream:!0});let n=l.indexOf(`
|
|
1941
|
+
`;function Pq(e){Lq(e);let t=e.querySelector(`[data-item-rename-input]`);if(!t)return;let n=t.closest(`[data-type="item"]`);if(!n)return;let r=n.dataset.itemPath??``;if(r.endsWith(`/`))return;let i=Qc(r);Xc(r)&&Fq(i),!t.hasAttribute(kq)&&(Rq(t),t.setAttribute(kq,``))}function Fq(e){Aq=e,jq!==null&&clearTimeout(jq),jq=setTimeout(Iq,Mq)}function Iq(){Aq=null,jq!==null&&(clearTimeout(jq),jq=null)}function Lq(e){let t=e.querySelectorAll(`[${Oq}]`);for(let e of t){if(e.querySelector(`[data-item-rename-input]`))continue;let t=e.getAttribute(Oq);if(!t){e.removeAttribute(Oq);continue}let n=e.dataset.itemPath??``;if(n.toLowerCase().endsWith(t.toLowerCase())){e.removeAttribute(Oq);continue}let r=Qc(n);r&&r.toLowerCase()!==t.toLowerCase()&&e.removeAttribute(Oq)}if(Aq===null)return;let n=e.querySelectorAll(`[data-type="item"][data-item-path]`),r=!1;for(let e of n){let t=e.dataset.itemPath??``;!t||t.endsWith(`/`)||Qc(t)||(r=!0,e.getAttribute(`data-item-selected`)===`true`&&e.getAttribute(`data-ok-renaming`)!==Aq&&e.setAttribute(Oq,Aq))}let i=!!e.querySelector(`[data-item-rename-input]`);!r&&!i&&Iq()}function Rq(e){let t=Qc(e.value),n=t?e.value.length-t.length:e.value.length;e.setSelectionRange(0,n)}function zq(e){let t=e.getFocusedPath();t&&e.scrollToPath(t,{offset:`nearest`,focus:!1})}function Bq(e){return{selectedFilePath:e,selectedFolderPath:null,navigationPath:e}}function Vq(e,t,n={}){if(!e)return Bq(t);let r=al(e);if(t&&r!==t)return Bq(t);switch(e.kind){case`doc`:return Bq(t??e.docName);case`large-file`:return Bq(e.docName);case`folder`:case`folder-index`:return{selectedFilePath:null,selectedFolderPath:e.folderPath,navigationPath:e.folderPath};case`missing`:return t&&n.isKnownDocument?.(t)?Bq(t):{selectedFilePath:null,selectedFolderPath:null,navigationPath:null};case`asset`:case`skill-file`:return{selectedFilePath:null,selectedFolderPath:null,navigationPath:null}}}function Hq(e,t){if(!e)return{kind:`none`};let n=t.find(t=>Pu(t)===e),r=Xu(e),i=e.endsWith(`/`)?r:Zu(e,t);return i===r?n&&il(n)?{kind:`asset`,path:n.path,hash:Dl(n.path),mediaKind:n.mediaKind}:n&&ul(n)?{kind:`document`,path:n.docName}:e.endsWith(`/`)?t.some(e=>tl(e)?e.path===r||e.path.startsWith(`${r}/`):(il(e)?e.path:e.docName).startsWith(`${r}/`))?{kind:`folder`,path:r}:{kind:`none`}:t.some(e=>ul(e)&&e.docName===r)?{kind:`document`,path:r}:{kind:`none`}:{kind:`document`,path:i}}var Uq=`You can restore this file from the Trash.`;function Wq(e){let t=Uq,n=`Move to Trash`,r=`Moving`;if(e.length===0)return{title:`Are you sure you want to delete the selected items?`,detail:t,listedTargets:null,confirmLabel:n,confirmLabelBusy:r};if(e.length===1){let i=e[0];return i?i.kind===`folder`?{title:`Are you sure you want to delete '${i.name}' and its contents?`,detail:t,listedTargets:null,confirmLabel:n,confirmLabelBusy:r}:{title:`Are you sure you want to delete '${i.name}'?`,detail:t,listedTargets:null,confirmLabel:n,confirmLabelBusy:r}:{title:`Are you sure you want to delete the selected item?`,detail:t,listedTargets:null,confirmLabel:n,confirmLabelBusy:r}}let i=e.some(e=>e.kind===`folder`),a=e.some(e=>e.kind!==`folder`);return i&&a?{title:`Are you sure you want to delete the following ${e.length} files/directories and their contents?`,detail:t,listedTargets:e,confirmLabel:n,confirmLabelBusy:r}:i?{title:`Are you sure you want to delete the following ${e.length} directories and their contents?`,detail:t,listedTargets:e,confirmLabel:n,confirmLabelBusy:r}:{title:`Are you sure you want to delete the following ${e.length} files?`,detail:t,listedTargets:e,confirmLabel:n,confirmLabelBusy:r}}function Gq(e,t){return e===`web`?null:Wq(t)}function Kq(e){return e.kind===`folder`?`${e.name}/`:e.kind===`asset`?e.name:e.docExt?`${e.name}${e.docExt}`:e.name}function qq(e,t,n){let r=Hq(e,t);if(r.kind===`none`)return null;if(r.kind===`asset`)return{v:1,kind:`asset`,assetPath:r.path,mediaKind:r.mediaKind};if(r.kind===`folder`)return{v:1,kind:`folder`,folderPath:r.path};let i=t.find(e=>ul(e)&&e.docName===r.path);return{v:1,kind:`doc`,docName:r.path,size:i?.size??n?.get(r.path)?.size??null}}var Jq=[`not-found`,`permission-denied`,`system-error`,`path-escape`];function Yq(e){return typeof e==`string`&&Jq.includes(e)?e:`system-error`}function Xq(e){switch(e){case`not-found`:return Yc._({id:`v41fCm`});case`permission-denied`:return Yc._({id:`sJK6pq`});case`system-error`:return Yc._({id:`Jqqevv`});case`path-escape`:return Yc._({id:`WL6puM`})}}function Zq(e){let t=Xq(e.reason),n=e.detail;return n?Yc._({id:`Z2M5XM`,values:{reason:t,osDetail:n}}):Yc._({id:`dTaauv`,values:{reason:t}})}function Qq(e){return e.kind===`folder`?`${e.name}/`:e.name}function $q(e){let t=(0,$.c)(34),{failedTargets:n,isSubmitting:r,onDeletePermanently:i,onRetry:a,onCancel:o}=e,s=n.length>1,c=n[0],l=n.length,u;if(t[0]!==l||t[1]!==s||t[2]!==c){let e=c?Qq(c):``;u=s?Yc._({id:`5qNxOe`,values:{count:l}}):c?`${Yc._({id:`E_BHoD`,values:{targetName:e}})}\n${Zq(c)}`:Yc._({id:`kolRU1`}),t[0]=l,t[1]=s,t[2]=c,t[3]=u}else u=t[3];let d=u,f;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Z.jsx)(zs,{children:(0,Z.jsx)(J,{id:`aOp3hw`})}),t[4]=f):f=t[4];let p;t[5]===d?p=t[6]:(p=(0,Z.jsxs)(Us,{children:[f,(0,Z.jsx)(Rs,{className:`whitespace-pre-wrap`,children:d})]}),t[5]=d,t[6]=p);let m;t[7]!==n||t[8]!==s?(m=s?(0,Z.jsx)(Vs,{children:(0,Z.jsx)(`ul`,{className:`flex flex-col gap-2 text-xs`,children:n.map(eJ)})}):null,t[7]=n,t[8]=s,t[9]=m):m=t[9];let h;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,Z.jsx)(J,{id:`dEgA5A`}),t[10]=h):h=t[10];let g;t[11]!==r||t[12]!==o?(g=(0,Z.jsx)(X,{variant:`outline`,className:`font-mono uppercase`,onClick:o,disabled:r,"data-testid":`trash-failure-modal-cancel`,children:h}),t[11]=r,t[12]=o,t[13]=g):g=t[13];let _;t[14]===r?_=t[15]:(_=r?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(is,{className:`size-4 animate-spin`}),` `,(0,Z.jsx)(J,{id:`mf37rL`})]}):(0,Z.jsx)(J,{id:`6gRgw8`}),t[14]=r,t[15]=_);let v;t[16]!==r||t[17]!==a||t[18]!==_?(v=(0,Z.jsx)(X,{variant:`outline`,className:`font-mono uppercase`,onClick:a,disabled:r,"data-testid":`trash-failure-modal-retry`,children:_}),t[16]=r,t[17]=a,t[18]=_,t[19]=v):v=t[19];let y;t[20]===r?y=t[21]:(y=r?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(is,{className:`size-4 animate-spin`}),` `,(0,Z.jsx)(J,{id:`s3caR3`})]}):(0,Z.jsx)(J,{id:`UBv8UK`}),t[20]=r,t[21]=y);let b;t[22]!==r||t[23]!==i||t[24]!==y?(b=(0,Z.jsx)(X,{variant:`destructive`,onClick:i,disabled:r,"data-testid":`trash-failure-modal-delete-permanently`,children:y}),t[22]=r,t[23]=i,t[24]=y,t[25]=b):b=t[25];let x;t[26]!==b||t[27]!==g||t[28]!==v?(x=(0,Z.jsxs)(Hs,{children:[g,v,b]}),t[26]=b,t[27]=g,t[28]=v,t[29]=x):x=t[29];let S;return t[30]!==x||t[31]!==p||t[32]!==m?(S=(0,Z.jsxs)(Bs,{className:`sm:max-w-md`,children:[p,m,x]}),t[30]=x,t[31]=p,t[32]=m,t[33]=S):S=t[33],S}function eJ(e){return(0,Z.jsxs)(`li`,{"data-testid":`trash-failure-modal-target`,children:[(0,Z.jsx)(`div`,{className:`font-mono text-foreground`,children:Qq(e)}),(0,Z.jsx)(`div`,{className:`text-muted-foreground`,children:Zq(e)})]},e.path)}function tJ(e){let t=(0,$.c)(21),{parentDir:n,onSelectTemplate:r,ItemComponent:i}=e,{state:a}=_o(n);if(a.status===`idle`||a.status===`loading`){let e;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(J,{id:`Hl89Qd`}),t[0]=e):e=t[0];let n;return t[1]===i?n=t[2]:(n=(0,Z.jsx)(i,{disabled:!0,className:`text-muted-foreground`,children:e}),t[1]=i,t[2]=n),n}if(a.status===`error`){let e;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(J,{id:`AQ-Lfg`}),t[3]=e):e=t[3];let n;return t[4]===i?n=t[5]:(n=(0,Z.jsx)(i,{disabled:!0,className:`text-muted-foreground`,children:e}),t[4]=i,t[5]=n),n}let o,s;if(t[6]!==i||t[7]!==r||t[8]!==a.data.folder.templates_available){s=Symbol.for(`react.early_return_sentinel`);bb0:{let e;t[11]===a.data.folder.templates_available?e=t[12]:(e=a.data.folder.templates_available??[],t[11]=a.data.folder.templates_available,t[12]=e);let n=uh(e);if(n.length===0){let e;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(J,{id:`iGCs04`}),t[13]=e):e=t[13];let n;t[14]===i?n=t[15]:(n=(0,Z.jsx)(i,{disabled:!0,className:`text-muted-foreground`,children:e}),t[14]=i,t[15]=n),s=n;break bb0}let c;t[16]!==i||t[17]!==r?(c=e=>(0,Z.jsx)(i,{onSelect:()=>r(e.name),children:e.title??e.name},`${e.scope}:${e.source_folder}:${e.name}`),t[16]=i,t[17]=r,t[18]=c):c=t[18],o=n.map(c)}t[6]=i,t[7]=r,t[8]=a.data.folder.templates_available,t[9]=o,t[10]=s}else o=t[9],s=t[10];if(s!==Symbol.for(`react.early_return_sentinel`))return s;let c;return t[19]===o?c=t[20]:(c=(0,Z.jsx)(Z.Fragment,{children:o}),t[19]=o,t[20]=c),c}function nJ(e){return e?.isDirectory()?e:null}function rJ(e,t){let n=t.getPath();for(let t of e.getSelectedPaths())t!==n&&e.getItem(t)?.deselect();t.isSelected()||t.select()}function iJ(e,t,n,r,i){let a=(0,$.c)(11),o;a[0]!==n||a[1]!==t||a[2]!==e||a[3]!==r?(o=()=>{let i=()=>{queueMicrotask(()=>{r.current=!1})};if(r.current=!0,!t){for(let t of e.getSelectedPaths())e.getItem(t)?.deselect();i();return}let a=n?n.split(`\0`):[];for(let t of a){let n=nJ(e.getItem(t));n&&!n.isExpanded()&&n.expand()}let o=e.getItem(t);if(!o){i();return}if(e.getSelectedPaths().length>1&&o.isSelected()){o.focus(),i();return}rJ(e,o),o.focus(),i()},a[0]=n,a[1]=t,a[2]=e,a[3]=r,a[4]=o):o=a[4];let s;a[5]!==n||a[6]!==t||a[7]!==e||a[8]!==r||a[9]!==i?(s=[n,t,e,r,i],a[5]=n,a[6]=t,a[7]=e,a[8]=r,a[9]=i,a[10]=s):s=a[10],(0,Q.useEffect)(o,s)}var aJ=`open-knowledge:file-tree-menu-action-delete`,oJ=`open-knowledge:file-tree-menu-action-rename`,sJ=`open-knowledge:file-tree-menu-action-duplicate`;function cJ(e){window.dispatchEvent(new CustomEvent(aJ,{detail:{target:e}}))}function lJ(e){let t=t=>{let n=t.detail;n?.target&&e(n.target)};return window.addEventListener(aJ,t),()=>window.removeEventListener(aJ,t)}function uJ(e){window.dispatchEvent(new CustomEvent(oJ,{detail:{target:e}}))}function dJ(e){let t=t=>{let n=t.detail;n?.target&&e(n.target)};return window.addEventListener(oJ,t),()=>window.removeEventListener(oJ,t)}function fJ(e){window.dispatchEvent(new CustomEvent(sJ,{detail:{target:e}}))}function pJ(e){let t=t=>{let n=t.detail;n?.target&&e(n.target)};return window.addEventListener(sJ,t),()=>window.removeEventListener(sJ,t)}function mJ(e,t){let n=!1,r=!1,i=!1;async function a(){if(!i){n=!0;try{await e()}finally{n=!1,i?r=!1:r&&(r=!1,a())}}}return{request(){if(!i){if(n){r=!0,t?.();return}a()}},dispose(){i=!0,r=!1,t?.()}}}var hJ={Accept:`application/x-ndjson, application/json`};function gJ(e){return!e.ok||!e.body?!1:(e.headers.get(`content-type`)??``).includes(`application/x-ndjson`)}var _J=class extends Error{};function vJ(e){return typeof e==`object`&&!!e&&`type`in e}async function yJ(e,t={}){let n=e.body;if(!n)throw new _J(`Show All Files stream had no response body.`);let{onBatch:r}=t,i=n.getReader(),a=new TextDecoder,o=[],s=[],c=!1,l=``,u=e=>{let t=e.trim();if(t.length===0)return!1;let n;try{n=JSON.parse(t)}catch{return console.warn(`[show-all-stream] dropping unparseable NDJSON line:`,t.slice(0,200)),!1}if(vJ(n)){if(n.type===`error`)throw new _J(typeof n.problem?.title==`string`?n.problem.title:`Show All Files stream failed.`);return c=n.truncated===!0,!0}let r=Kn.safeParse(n);return r.success?(o.push(r.data),s.push(r.data)):console.warn(`[show-all-stream] dropping schema-divergent entry line:`,r.error.issues),!1},d=()=>{if(!r||s.length===0)return;let e=s;s=[],r(e)};try{let e=!1;for(;!e;){let t=await i.read();if(t.done)break;l+=a.decode(t.value,{stream:!0});let n=l.indexOf(`
|
|
1942
1942
|
`);for(;n!==-1;){let t=u(l.slice(0,n));if(l=l.slice(n+1),t){e=!0;break}n=l.indexOf(`
|
|
1943
1943
|
`)}d()}l+=a.decode(),l.includes(`
|
|
1944
|
-
`)||u(l),d()}finally{i.releaseLock()}return{entries:o,truncated:c}}function
|
|
1945
|
-
${
|
|
1946
|
-
${
|
|
1947
|
-
${
|
|
1948
|
-
</svg>`,
|
|
1944
|
+
`)||u(l),d()}finally{i.releaseLock()}return{entries:o,truncated:c}}function bJ(e,t,n,r=Date.now()){if(n.size===0)return[...e];let i=new Set(e.map(e=>Pu(e))),a=[];for(let e of t){let t=Pu(e);if(i.has(t)){n.delete(t);continue}let o=n.get(t);if(o!==void 0){if(r-o>5e3){n.delete(t);continue}a.push(e)}}return a.length===0?[...e]:[...e,...a]}function xJ(e,t){if(t.length===0)return[...e];let n=new Set(e.map(e=>Pu(e))),r=[...e];for(let e of t){let t=Pu(e);n.has(t)||(n.add(t),r.push(e))}return r}function SJ(e,t,n,r,i=Date.now()){if(t!==``&&!e.some(e=>Pu(e)===t))return[...e];let a=[],o=[];for(let n of e)CJ(t,Pu(n))?a.push(n):o.push(n);let s=bJ(n,a,r,i),c=new Set(s.map(e=>Pu(e)).filter(e=>e.endsWith(`/`)));return[...o.filter(e=>{let n=Pu(e);if(!n.startsWith(t))return!0;let r=n.slice(t.length),i=r.indexOf(`/`);return i===-1?!0:c.has(t+r.slice(0,i+1))}),...s]}function CJ(e,t){if(!t.startsWith(e))return!1;let n=t.slice(e.length);if(n===``)return!1;let r=n.endsWith(`/`)?n.slice(0,-1):n;return r!==``&&!r.includes(`/`)}var wJ=yl(`HOVER_INTENT_MS`,80),TJ=3,EJ=20,DJ=new Map,OJ=new Set,kJ=[],AJ=new Map;function jJ(e){for(AJ.delete(e),AJ.set(e,!0);AJ.size>EJ;){let e=AJ.keys().next().value;if(e===void 0)break;AJ.delete(e)}}function MJ(e){OJ.delete(e),PJ()}function NJ(e,t){let n=Date.now();_l(`ok/sidebar/prewarm-success`,{docName:e,t:n,poolEventId:t}),De(e,t,n)}function PJ(){for(;OJ.size<TJ&&kJ.length>0;){let e=kJ.shift();if(!e)break;if(!AJ.has(e.docName)){OJ.add(e.docName),jJ(e.docName);try{let t=e.prewarm(e.docName);t&&NJ(e.docName,t)}catch(t){_l(`ok/sidebar/prewarm-failed`,{docName:e.docName,message:t instanceof Error?t.message:String(t)})}finally{MJ(e.docName)}}}}function FJ(e,t){if(He(e)||AJ.has(e))return;let n=DJ.get(e);n&&clearTimeout(n.timer);let r=setTimeout(()=>{if(DJ.delete(e),OJ.size>=TJ){kJ.push({docName:e,prewarm:t});return}jJ(e),OJ.add(e);try{let n=t(e);n&&NJ(e,n)}catch(t){_l(`ok/sidebar/prewarm-failed`,{docName:e,message:t instanceof Error?t.message:String(t)})}finally{MJ(e)}},wJ);DJ.set(e,{timer:r,prewarm:t})}function IJ(e){let t=DJ.get(e);t&&(clearTimeout(t.timer),DJ.delete(e))}var LJ=/\.(md|mdx)$/i;function RJ(e){let t=e.match(/^"(.+)" already exists\.$/);return t?t[1]:null}function zJ(e){let t=e.match(LJ);return t?t[0]:null}function BJ(e){window.requestAnimationFrame(()=>{let t=Ce(e);if(!(!t||t.isDestroyed))try{t.commands.focus()}catch{}})}function VJ(e){let t=e.current;t.row?.removeAttribute($J),t.root?.removeAttribute(eY),e.current={row:null,root:null}}function HJ(e,t){let n=e.current;n.row===t.row&&n.root===t.root||(VJ(e),t.row?.setAttribute($J,`true`),t.root?.setAttribute(eY,`true`),e.current={row:t.row,root:t.root})}async function UJ(e,t){try{await navigator.clipboard.writeText(e),bs.success(t===`full`?Yc._({id:`6_ZOw4`}):Yc._({id:`haHgQj`}),{description:e})}catch(e){console.warn(`[FileTree] clipboard write failed:`,e),bs.error(t===`full`?Yc._({id:`vfRlCI`}):Yc._({id:`5QGTaA`}))}}var WJ=new Set([`agents`,`agent`,`claude`,`skill`]),GJ=`ok-file-tree-link-decoration`,KJ=`ok-file-tree-agent-decoration`,qJ=`ok-file-tree-markdown`,JJ=`<symbol id="${qJ}" viewBox="${Jt}" fill="currentColor"><path d="${m}"/></symbol>`;function YJ(e){return e.map(([e,{key:t,...n}])=>`<${e} ${Object.entries(n).map(([e,t])=>`${e}="${t}"`).join(` `)} />`).join(``)}function XJ(e,t){return`<symbol id="${e}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">${YJ(t)}</symbol>`}var ZJ=`<svg data-icon-sprite aria-hidden="true" width="0" height="0">
|
|
1945
|
+
${XJ(GJ,ve)}
|
|
1946
|
+
${XJ(KJ,wd)}
|
|
1947
|
+
${JJ}
|
|
1948
|
+
</svg>`,QJ=`
|
|
1949
1949
|
[data-file-tree-virtualized-root][data-file-tree-root-drag-target="true"] {
|
|
1950
1950
|
position: relative;
|
|
1951
1951
|
}
|
|
@@ -1968,15 +1968,15 @@ Error generating stack: `+e.message+`
|
|
|
1968
1968
|
border: 2px solid Highlight;
|
|
1969
1969
|
}
|
|
1970
1970
|
}
|
|
1971
|
-
|
|
1972
|
-
[data-type="item"][${
|
|
1971
|
+
`,$J=`data-ok-external-file-drop-target`,eY=`data-ok-external-file-drop-root-target`,tY=`__external-file-drop__`,nY=2e3,rY=`
|
|
1972
|
+
[data-type="item"][${$J}="true"] {
|
|
1973
1973
|
background: color-mix(in oklab, var(--color-primary) 10%, transparent);
|
|
1974
1974
|
box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--color-primary) 72%, transparent);
|
|
1975
1975
|
}
|
|
1976
|
-
[data-file-tree-virtualized-root][${
|
|
1976
|
+
[data-file-tree-virtualized-root][${eY}="true"] {
|
|
1977
1977
|
position: relative;
|
|
1978
1978
|
}
|
|
1979
|
-
[data-file-tree-virtualized-root][${
|
|
1979
|
+
[data-file-tree-virtualized-root][${eY}="true"]::after {
|
|
1980
1980
|
content: "";
|
|
1981
1981
|
position: absolute;
|
|
1982
1982
|
inset: 0;
|
|
@@ -1987,17 +1987,17 @@ Error generating stack: `+e.message+`
|
|
|
1987
1987
|
pointer-events: none;
|
|
1988
1988
|
}
|
|
1989
1989
|
@media (forced-colors: active) {
|
|
1990
|
-
[data-type="item"][${
|
|
1990
|
+
[data-type="item"][${$J}="true"] {
|
|
1991
1991
|
outline: 2px solid Highlight;
|
|
1992
1992
|
outline-offset: -2px;
|
|
1993
1993
|
}
|
|
1994
|
-
[data-file-tree-virtualized-root][${
|
|
1994
|
+
[data-file-tree-virtualized-root][${eY}="true"]::after {
|
|
1995
1995
|
border: 2px solid Highlight;
|
|
1996
1996
|
}
|
|
1997
1997
|
}
|
|
1998
|
-
`,
|
|
1999
|
-
:host([${
|
|
1998
|
+
`,iY=`data-ok-creation-cleared`,aY=`${hq}\n${Nq}\n${QJ}\n${rY}\n${`
|
|
1999
|
+
:host([${iY}]) [data-item-focused="true"] {
|
|
2000
2000
|
--trees-focus-ring-color: transparent;
|
|
2001
2001
|
}
|
|
2002
|
-
`}\n${QK}\n${$K}`;function YJ(e){let t=e.split(`/`).pop()?.replace(/\.md$/i,``).toLowerCase();return!!t&&NJ.has(t)}function XJ(e){return e===`darwin`?Yc._({id:`LtSYdi`}):e===`win32`?Yc._({id:`qi1F96`}):Yc._({id:`e1Rn_k`})}function ZJ(e){let t=(0,$.c)(18),{item:n,workspace:r,onClose:i}=e,{_:a}=an(),o=typeof window<`u`?window.okDesktop:void 0;if(!o)return null;let s=o.platform,c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=XJ(s),t[0]=c):c=t[0];let l=c,u,d;t[1]!==a||t[2]!==r?(u=r?null:a({id:`wTcjov`}),d=a(s===`darwin`?u?{id:`FvpFSZ`,values:{hint:u}}:{id:`LtSYdi`}:s===`win32`?u?{id:`o4dcAf`,values:{hint:u}}:{id:`qi1F96`}:u?{id:`zUhPuR`,values:{hint:u}}:{id:`e1Rn_k`}),t[1]=a,t[2]=r,t[3]=u,t[4]=d):(u=t[3],d=t[4]);let f=d,p=!r,m;t[5]!==n||t[6]!==i||t[7]!==r?(m=()=>{if(!r)return;i();let e=aa(r.contentDir,Au(n),r.pathSeparator);o.shell.showItemInFolder(e)},t[5]=n,t[6]=i,t[7]=r,t[8]=m):m=t[8];let h,g;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,Z.jsx)(Bo,{"aria-hidden":`true`}),g=(0,Z.jsx)(`span`,{className:`flex-1`,children:l}),t[9]=h,t[10]=g):(h=t[9],g=t[10]);let _;t[11]===u?_=t[12]:(_=u?(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:u}):null,t[11]=u,t[12]=_);let v;return t[13]!==f||t[14]!==p||t[15]!==m||t[16]!==_?(v=(0,Z.jsxs)(Sc,{disabled:p,onSelect:m,"aria-label":f,children:[h,g,_]}),t[13]=f,t[14]=p,t[15]=m,t[16]=_,t[17]=v):v=t[17],v}function QJ(e,t){return Ou({kind:e.endsWith(`/`)?`directory`:`file`,name:e,path:e},t)}function $J(e){let t=e.match(/\.(md|mdx)$/i);if(!t)return null;let n=t[0].toLowerCase()===`.md`?`.mdx`:`.md`;return`${e.slice(0,-t[0].length)}${n}`}function eY(e,t){let n=$J(e);return n?t.includes(n):!1}function tY(e,t){return e!==t&&e.startsWith(t)}function nY(e,t){let n=[...new Set(e)],r=n.filter(e=>e.endsWith(`/`));return n.filter(e=>!r.some(t=>tY(e,t))).map(e=>QJ(e,t))}function rY(e,t){let n=e.getItem(t)??e.getItem(Wu(t));return n?.isDirectory()?Wu(Qu(n.getPath())):t}function iY(e){let t=e.getFocusedPath()??e.getSelectedPaths()[0]??null;return t?rY(e,t):null}function aY(e,t,n){let r=iY(e);return!r||n.has(r)?null:QJ(r,t)}function oY(e,t){let n=e.getSelectedPaths(),r=iY(e);return nY(n.length>0?n.map(t=>rY(e,t)):r?[r]:[],t)}function sY(e,t){return e===t||e.startsWith(`${t}/`)}function cY(e){if(!(e instanceof HTMLElement))return!1;let t=e.tagName;return t===`INPUT`||t===`TEXTAREA`||t===`SELECT`||e.isContentEditable||e.closest(`[contenteditable="true"]`)!==null}function lY(e,t,n){let r=new Set,i=new Set,a=new Set;for(let o of e){if(o.kind===`file`){r.add(o.path);continue}if(o.kind===`asset`){a.add(o.path);continue}i.add(o.path);for(let e of t)ul(e)&&e.docName.startsWith(`${o.path}/`)?r.add(e.docName):il(e)&&e.path.startsWith(`${o.path}/`)&&a.add(e.path);for(let e of n){let t=Qu(e);sY(t,o.path)&&i.add(t)}}return{docNames:r,folderPaths:i,assetPaths:a}}function uY(e,t){return e.kind===`file`?t.kind===`file`&&e.path===t.createdPath:e.kind===`asset`?!1:sY(t.createdPath,e.path)}function dY(e){let t=(0,$.c)(71),{item:n,context:r,anyActionBusy:i,workspace:a,handoff:o,model:s,okignoreBinding:c,projectLocalBinding:l,mergedConfig:u,onStartCreating:d,onCreateFromTemplate:f,onDuplicate:p,onDelete:m,onExpandSubtree:h,onCollapseSubtree:g,folderTreePaths:_,isAsset:v,documents:y}=e,{_:b}=an(),x=Ou(n,y),S=n.kind===`directory`,C=x.kind===`asset`?null:x,w=C!==null&&c!==null,T;t[0]!==b||t[1]!==S?(T=b(S?{id:`5D3Ior`}:{id:`dbhUX1`}),t[0]=b,t[1]=S,t[2]=T):T=t[2];let E=T,D=u?.appearance?.sidebar?.showHiddenFiles??!1,O=l!==null,k;t[3]!==S||t[4]!==n.path?(k=S?Qu(n.path):null,t[3]=S,t[4]=n.path,t[5]=k):k=t[5];let A=_o(k),j=A.state.status===`ready`?(A.state.data.folder.templates_available?.length??0)>0:!0,M=s.getSelectedPaths(),N=M.includes(x.treePath)?nY(M,y):[],P=N.length>1?N:[x],F=P.length,I=Yc._({id:`djjdjr`,values:{deleteCount:F}}),L;t[6]!==y||t[7]!==v||t[8]!==S||t[9]!==n||t[10]!==a?(L=v?null:S?la({folderRelativePath:Au(n),workspace:a}):Ta({docName:Zu(n.path,y),workspace:a}),t[6]=y,t[7]=v,t[8]=S,t[9]=n,t[10]=a,t[11]=L):L=t[11];let R=L,z;t[12]===r?z=t[13]:(z=()=>r.close({restoreFocus:!1}),t[12]=r,t[13]=z);let B=z,V;t[14]===r?V=t[15]:(V=()=>r.close(),t[14]=r,t[15]=V);let H=V,{status:U}=Pi(),W=U?.hasRemote===!0,G;t[16]!==y||t[17]!==v||t[18]!==S||t[19]!==n.path||t[20]!==x?(G=v||x.kind===`asset`?null:S?Na(Qu(n.path)):Va(Zu(n.path,y)),t[16]=y,t[17]=v,t[18]=S,t[19]=n.path,t[20]=x,t[21]=G):G=t[21];let K=G,ee=W&&K!==null,te;t[22]!==b||t[23]!==W||t[24]!==K?(te=()=>{K&&Ia({...K,hasRemote:W,onClickWhenNoRemote:()=>{bs.error(b({id:`WyQxwa`}))}},{clipboardWrite:xa,toastSuccess:mY,toastError:pY,logEvent:fY})},t[22]=b,t[23]=W,t[24]=K,t[25]=te):te=t[25];let ne=te,re;t[26]!==ee||t[27]!==H||t[28]!==ne?(re=ee?(0,Z.jsxs)(Sc,{"data-testid":`file-tree-menu-share`,onSelect:()=>{H(),ne()},children:[(0,Z.jsx)(Cf,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`Z8lGw6`})]}):null,t[26]=ee,t[27]=H,t[28]=ne,t[29]=re):re=t[29];let ie=re,ae;t[30]!==b||t[31]!==l?(ae=e=>{if(l===null)return;let t=l.patch({appearance:{sidebar:{showHiddenFiles:e}}});t.ok||(console.warn(`[FileTree] showHiddenFiles toggle rejected:`,Bn(t.error)),bs.error(b({id:`P47EWZ`}),{description:Bn(t.error)}))},t[30]=b,t[31]=l,t[32]=ae):ae=t[32];let oe=ae,se=0,ce=0;if(S){let e=Wu(n.path);for(let t of _)(t===e||t.startsWith(e))&&(se++,Gq(s.getItem(t))?.isExpanded()&&ce++)}let le=S&&ce<se,q=S&&ce>0,ue;t[33]===H?ue=t[34]:(ue=e=>{e||H()},t[33]=H,t[34]=ue);let de;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(de=(0,Z.jsx)(bc,{asChild:!0,children:(0,Z.jsx)(`span`,{"aria-hidden":`true`,"data-file-tree-context-menu-root":`true`,className:`block size-px`})}),t[35]=de):de=t[35];let fe;t[36]!==b||t[37]!==i||t[38]!==w||t[39]!==O||t[40]!==H||t[41]!==B||t[42]!==I||t[43]!==P||t[44]!==j||t[45]!==oe||t[46]!==o||t[47]!==R||t[48]!==E||t[49]!==v||t[50]!==S||t[51]!==n||t[52]!==s||t[53]!==c||t[54]!==C||t[55]!==g||t[56]!==f||t[57]!==m||t[58]!==p||t[59]!==h||t[60]!==d||t[61]!==ie||t[62]!==D||t[63]!==q||t[64]!==le||t[65]!==x||t[66]!==a?(fe=(0,Z.jsx)(wc,{sideOffset:0,align:`start`,"data-file-tree-context-menu-root":`true`,className:`min-w-52`,children:S?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(Sc,{disabled:i,onSelect:()=>{B(),d(`file`,Qu(n.path))},children:[(0,Z.jsx)(Df,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`HdkSiO`})]}),j?(0,Z.jsxs)(yc,{children:[(0,Z.jsxs)(Pc,{disabled:i,children:[(0,Z.jsx)(no,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`Uuj_R4`})]}),(0,Z.jsx)(sc,{children:(0,Z.jsx)(Wq,{parentDir:Qu(n.path),onSelectTemplate:e=>{B(),f(Qu(n.path),e)},ItemComponent:Sc})})]}):null,(0,Z.jsxs)(Sc,{disabled:i,onSelect:()=>{B(),d(`folder`,Qu(n.path))},children:[(0,Z.jsx)(Ud,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`96G6Re`})]}),(0,Z.jsx)(Fc,{}),(0,Z.jsx)(ZJ,{item:n,workspace:a,onClose:H}),(0,Z.jsx)(ua,{input:R,installStates:o.installStates,isElectronHost:o.isElectronHost,dispatch:o.dispatch}),ie,(0,Z.jsxs)(yc,{children:[(0,Z.jsxs)(Pc,{children:[(0,Z.jsx)(Eo,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`oCZkaG`})]}),(0,Z.jsxs)(sc,{children:[(0,Z.jsx)(Sc,{disabled:!a,onSelect:()=>{a&&(H(),MJ(aa(a.contentDir,Au(n),a.pathSeparator),`full`))},children:(0,Z.jsx)(J,{id:`oQA-cA`})}),(0,Z.jsx)(Sc,{onSelect:()=>{H(),MJ(Au(n),`relative`)},children:(0,Z.jsx)(J,{id:`s061i4`})})]})]}),(0,Z.jsx)(Fc,{}),(0,Z.jsx)(Oc,{checked:D,onCheckedChange:oe,disabled:!O,"data-testid":`file-tree-menu-show-hidden-files`,children:(0,Z.jsx)(J,{id:`XcGbim`})}),le||q?(0,Z.jsx)(Fc,{}):null,le?(0,Z.jsxs)(Sc,{onSelect:()=>{H(),h(n.path)},children:[(0,Z.jsx)(Vf,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`OlAl5i`})]}):null,q?(0,Z.jsxs)(Sc,{onSelect:()=>{H(),g(n.path)},children:[(0,Z.jsx)(Vd,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`qvWGzP`})]}):null,(0,Z.jsx)(Fc,{}),(0,Z.jsxs)(Sc,{disabled:i,onSelect:()=>{x.kind!==`asset`&&(H(),p(x))},children:[(0,Z.jsx)(Oo,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`euc6Ns`})]}),(0,Z.jsxs)(Sc,{disabled:i,onSelect:()=>{B(),s.startRenaming(n.path)},children:[(0,Z.jsx)(Mo,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`2wxgft`})]}),(0,Z.jsxs)(Sc,{"data-testid":`file-tree-menu-hide`,disabled:!w,onSelect:()=>{if(!c||!C)return;H();let e=gq(C),t=lo(c.current()),n=bo(t,e);if(n===t)return;c.patch(Za(n));let r=C.path.split(`/`).pop()||C.path;bs.success(b({id:`4xtLTl`,values:{basename:r}}),{description:b({id:`nWv1ja`}),duration:5e3})},children:[(0,Z.jsx)(Oe,{"aria-hidden":`true`}),E]}),(0,Z.jsxs)(Sc,{variant:`destructive`,disabled:i,onSelect:()=>{H(),m(P)},children:[(0,Z.jsx)(Ao,{"aria-hidden":`true`}),I]})]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(ZJ,{item:n,workspace:a,onClose:H}),!v&&(0,Z.jsx)(ua,{input:R,installStates:o.installStates,isElectronHost:o.isElectronHost,dispatch:o.dispatch}),ie,(0,Z.jsxs)(yc,{children:[(0,Z.jsxs)(Pc,{children:[(0,Z.jsx)(Eo,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`oCZkaG`})]}),(0,Z.jsxs)(sc,{children:[(0,Z.jsx)(Sc,{disabled:!a,onSelect:()=>{a&&(H(),MJ(aa(a.contentDir,Au(n),a.pathSeparator),`full`))},children:(0,Z.jsx)(J,{id:`oQA-cA`})}),(0,Z.jsx)(Sc,{onSelect:()=>{H(),MJ(Au(n),`relative`)},children:(0,Z.jsx)(J,{id:`s061i4`})})]})]}),(0,Z.jsx)(Fc,{}),v?null:(0,Z.jsxs)(Sc,{disabled:i,onSelect:()=>{H(),p(x)},children:[(0,Z.jsx)(Oo,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`euc6Ns`})]}),(0,Z.jsxs)(Sc,{disabled:i,onSelect:()=>{B(),s.startRenaming(n.path)},children:[(0,Z.jsx)(Mo,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`2wxgft`})]}),C?(0,Z.jsxs)(Sc,{"data-testid":`file-tree-menu-hide`,disabled:!w,onSelect:()=>{if(!c)return;H();let e=gq(C),t=lo(c.current()),n=bo(t,e);if(n===t)return;c.patch(Za(n));let r=C.path.split(`/`).pop()||C.path;bs.success(b({id:`OD0FCX`,values:{basename:r}}),{description:b({id:`nWv1ja`}),duration:5e3})},children:[(0,Z.jsx)(Oe,{"aria-hidden":`true`}),E]}):null,(0,Z.jsxs)(Sc,{variant:`destructive`,disabled:i,onSelect:()=>{H(),m(P)},children:[(0,Z.jsx)(Ao,{"aria-hidden":`true`}),I]})]})}),t[36]=b,t[37]=i,t[38]=w,t[39]=O,t[40]=H,t[41]=B,t[42]=I,t[43]=P,t[44]=j,t[45]=oe,t[46]=o,t[47]=R,t[48]=E,t[49]=v,t[50]=S,t[51]=n,t[52]=s,t[53]=c,t[54]=C,t[55]=g,t[56]=f,t[57]=m,t[58]=p,t[59]=h,t[60]=d,t[61]=ie,t[62]=D,t[63]=q,t[64]=le,t[65]=x,t[66]=a,t[67]=fe):fe=t[67];let pe;return t[68]!==ue||t[69]!==fe?(pe=(0,Z.jsxs)(Ac,{open:!0,modal:!1,onOpenChange:ue,children:[de,fe]}),t[68]=ue,t[69]=fe,t[70]=pe):pe=t[70],pe}function fY(e){return console.log(e)}function pY(e){return bs.error(e)}function mY(e){return bs.success(e)}async function hY(e,t,n,r){try{let i=await fetch(`/api/documents?showAll=true&dir=${encodeURIComponent(e)}&depth=1`,{signal:t,headers:iJ});if(aJ(i)){let e=await cJ(i);return{kind:`entries`,entries:sl(e.entries),truncated:e.truncated}}let a=await Ct(i,n);if(!a.ok)return{kind:`http-error`,title:a.title};let o=Un.safeParse(a.body);return o.success?{kind:`entries`,entries:sl(o.data.documents),truncated:o.data.truncated===!0}:{kind:`http-error`,title:r}}catch(e){return e instanceof oJ?{kind:`http-error`,title:e.message}:{kind:`network-error`,cause:e}}}function gY(e){let t=(0,$.c)(360),{ref:n,onContentHeightChange:r}=e,{_:i,i18n:a}=an(),{activeDocName:o,activeTarget:s,closeTabs:c,closeDocument:l,closeAndClearForRename:u,getPoolActiveDocName:d,poolHas:f,isNewTabActive:p,openTarget:m,prewarm:g,remapTabsForRename:_}=vt(),{notifySidebarFileSelected:v}=Vj(),{resolvedTheme:y}=Ln(),{addPage:b,pageMeta:x}=ea(),S;t[0]===x?S=t[1]:(S=function(e,t){return rl(e,t??x.get(e)?.size)??{kind:`doc`,target:e,docName:e}},t[0]=x,t[1]=S);let C=S,w;t[2]!==b||t[3]!==C||t[4]!==v||t[5]!==m?(w=function(e,t,n){n?.registerPage&&b(e),m(C(e,t),{tabBehavior:`replace-active`}),Sl(kl(e)),v()},t[2]=b,t[3]=C,t[4]=v,t[5]=m,t[6]=w):w=t[6];let T=w,E;t[7]!==v||t[8]!==m?(E=function(e){let t=xl(e);m({kind:`folder`,target:e,folderPath:e},{tabBehavior:`replace-active`}),Sl(t),v()},t[7]=v,t[8]=m,t[9]=E):E=t[9];let D=E,O;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(O=[],t[10]=O):O=t[10];let[k,A]=(0,Q.useState)(O),[j,M]=(0,Q.useState)(!0),[N,P]=(0,Q.useState)(null),[F,I]=(0,Q.useState)(!1),L=EN(),R=(0,Q.useRef)(null),[z,B]=(0,Q.useState)(null),[V,H]=(0,Q.useState)(null),[U,W]=(0,Q.useState)(null),[G,K]=(0,Q.useState)(null),{conflicts:ee}=Ua(),[te,ne]=(0,Q.useState)(null),[re,ie]=(0,Q.useState)(null),[ae,oe]=(0,Q.useState)(!1),se=(0,Q.useRef)(ae),ce;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(ce=new Set,t[11]=ce):ce=t[11];let q=(0,Q.useRef)(ce),ue=(0,Q.useRef)(k),de=(0,Q.useRef)(x),fe=(0,Q.useRef)(null),pe;t[12]!==k||t[13]!==D||t[14]!==T||t[15]!==v||t[16]!==m?(pe=function(e,t){let n=t===void 0?k:t,r=jq(e,n);if(r.kind===`none`){console.debug(`[FileTree] Dropped selection for unknown docName:`,Xu(e));return}if(r.kind===`asset`){m({kind:`asset`,target:r.path,assetPath:r.path,mediaKind:r.mediaKind},{tabBehavior:`replace-active`}),Sl(r.hash),v();return}if(r.kind===`folder`){D(r.path);return}let i=n.find(e=>ul(e)&&e.docName===r.path);T(r.path,i?.size,{registerPage:Xc(r.path)})},t[12]=k,t[13]=D,t[14]=T,t[15]=v,t[16]=m,t[17]=pe):pe=t[17];let me=pe,he;t[18]!==v||t[19]!==m?(he=function(e,t){m({kind:`asset`,target:e,assetPath:e,mediaKind:(t??ue.current).find(t=>il(t)&&t.path===e)?.mediaKind??null},{tabBehavior:`replace-active`}),Sl(Dl(e)),v()},t[18]=v,t[19]=m,t[20]=he):he=t[20];let ge=he,_e=(0,Q.useRef)(o),ve;t[21]===k?ve=t[22]:(ve=new Set(k.filter(il).map(UY)),t[21]=k,t[22]=ve);let ye=ve,be=(0,Q.useRef)(ye),xe;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(xe=[],t[23]=xe):xe=t[23];let Se=(0,Q.useRef)(xe),Ce=(0,Q.useRef)(null),we=(0,Q.useRef)(HY),Te=(0,Q.useRef)(null),Ee=(0,Q.useRef)(null),De=(0,Q.useRef)(!1),Oe=(0,Q.useRef)(!1),ke=(0,Q.useRef)(null),Ae;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(Ae={row:null,root:null},t[24]=Ae):Ae=t[24];let je=(0,Q.useRef)(Ae),Me=(0,Q.useRef)(VY),Ne=(0,Q.useRef)(null),Pe=(0,Q.useRef)(null),Fe;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(Fe=new Map,t[25]=Fe):Fe=t[25];let Ie=(0,Q.useRef)(Fe),Le;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(Le=new Set,t[26]=Le):Le=t[26];let Re=(0,Q.useRef)(Le),ze;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(ze=new Map,t[27]=ze):ze=t[27];let Be=(0,Q.useRef)(ze),Ve=(0,Q.useRef)(0),He;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(He=new Set,t[28]=He):He=t[28];let Ue=(0,Q.useRef)(He),We=(0,Q.useRef)(BY),Ge=(0,Q.useRef)(zY),Ke=(0,Q.useRef)(!1),qe=(0,Q.useRef)(null),Je=(0,Q.useRef)(null),Ye=(0,Q.useRef)(RY),Xe=(0,Q.useRef)(LY),Ze=(0,Q.useRef)(IY),Qe=(0,Q.useRef)(FY),$e=(0,Q.useRef)(s),[et,tt]=(0,Q.useState)(!1),nt;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(nt=function(){R.current!==null&&(clearTimeout(R.current),R.current=null)},t[29]=nt):nt=t[29];let rt=nt,it;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(it=function(){rt(),I(!1)},t[30]=it):it=t[30];let at=it,st;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(st=function(e){at(),P(e)},t[31]=st):st=t[31];let ct=st,lt;t[32]===i?lt=t[33]:(lt=function(){if(rt(),SN()){P(null),I(!0),R.current=setTimeout(()=>{R.current=null,qe.current?.()},GJ);return}I(!1),P(i({id:`34qyH5`}))},t[32]=i,t[33]=lt);let ut=lt,dt=(0,Q.useRef)(!0),ft;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(ft=()=>{if(dt.current){dt.current=!1;return}qe.current?.()},t[34]=ft):ft=t[34];let pt;t[35]===L?pt=t[36]:(pt=[L],t[35]=L,t[36]=pt),(0,Q.useEffect)(ft,pt);let mt,ht;t[37]===Symbol.for(`react.memo_cache_sentinel`)?(mt=()=>rt,ht=[],t[37]=mt,t[38]=ht):(mt=t[37],ht=t[38]),(0,Q.useEffect)(mt,ht);let gt,_t;t[39]!==k.length||t[40]!==j?(gt=()=>{if(j||k.length===0)return;let e=Je.current?.querySelector(HL)?.shadowRoot;if(!e)return;let t=e,n=function(){ke.current!==null&&clearTimeout(ke.current),ke.current=setTimeout(()=>{Oe.current=!1,ke.current=null},0)},r=function(e){if(!(e instanceof DragEvent))return;let t=GY(e),n=t?.dataset.itemPath;if(!n)return;let r=Iq(t.dataset.itemType===`folder`?Wu(n):n,ue.current,de.current);r&&(ke.current!==null&&(clearTimeout(ke.current),ke.current=null),Oe.current=!0,e.dataTransfer?.setData(Tu,Cu(r)))},i=function(e){if(!(e instanceof DragEvent)||!Vu(e))return;let t=qY(e);if(!t){AJ(je);return}e.preventDefault(),e.stopPropagation(),e.dataTransfer&&(e.dataTransfer.dropEffect=`copy`),jJ(je,t)},a=function(e){if(!(e instanceof DragEvent)||!Vu(e))return;let n=e.relatedTarget;n instanceof Node&&t.contains(n)||AJ(je)},o=function(e){if(!(e instanceof DragEvent)||!Vu(e))return;let t=qY(e),n=Fu(e);if(!t||n.length===0){AJ(je);return}e.preventDefault(),e.stopPropagation(),AJ(je),Me.current(n,t.parentDir,t.busyPath)};return e.addEventListener(`dragstart`,r,{capture:!0}),e.addEventListener(`dragover`,i,{capture:!0}),e.addEventListener(`dragleave`,a,{capture:!0}),e.addEventListener(`drop`,o,{capture:!0}),e.addEventListener(`dragend`,n,{capture:!0}),window.addEventListener(`drop`,n,!0),window.addEventListener(`dragend`,n,!0),()=>{e.removeEventListener(`dragstart`,r,{capture:!0}),e.removeEventListener(`dragover`,i,{capture:!0}),e.removeEventListener(`dragleave`,a,{capture:!0}),e.removeEventListener(`drop`,o,{capture:!0}),e.removeEventListener(`dragend`,n,{capture:!0}),window.removeEventListener(`drop`,n,!0),window.removeEventListener(`dragend`,n,!0),AJ(je),ke.current!==null&&(clearTimeout(ke.current),ke.current=null),Oe.current=!1}},_t=[k.length,j],t[39]=k.length,t[40]=j,t[41]=gt,t[42]=_t):(gt=t[41],_t=t[42]),(0,Q.useEffect)(gt,_t);let{selectedFilePath:yt,selectedFolderPath:bt,navigationPath:xt}=Aq(s,p?null:o),St=yt?Ku(yt,k.find(e=>ul(e)&&e.docName===yt)?.docExt):bt?Wu(bt):s?.kind===`asset`?s.assetPath:null,wt=ae?null:St,Tt=va().states,{dispatch:Et}=Ea(),Dt;t[43]!==Et||t[44]!==Tt?(Dt={installStates:Tt,isElectronHost:typeof window<`u`&&window.okDesktop!=null,dispatch:Et},t[43]=Et,t[44]=Tt,t[45]=Dt):Dt=t[45];let Ot=Dt,{okignoreBinding:kt,projectLocalBinding:At,merged:jt}=zo(),Mt=jt?.appearance?.sidebar?.showHiddenFiles??!1,Nt;t[46]===Symbol.for(`react.memo_cache_sentinel`)?(Nt=()=>Ne.current===null,t[46]=Nt):Nt=t[46];let Pt=Nt,Ft;t[47]===Symbol.for(`react.memo_cache_sentinel`)?(Ft=[],t[47]=Ft):Ft=t[47];let Lt;t[48]===Symbol.for(`react.memo_cache_sentinel`)?(Lt={set:`complete`,spriteSheet:BJ,byFileExtension:{md:{name:IJ,viewBox:Jt},mdx:{name:IJ,viewBox:Jt}}},t[48]=Lt):Lt=t[48];let Rt;t[49]===Symbol.for(`react.memo_cache_sentinel`)?(Rt={contextMenu:{enabled:!0,triggerMode:`both`,buttonVisibility:`when-needed`}},t[49]=Rt):Rt=t[49];let zt;t[50]===Symbol.for(`react.memo_cache_sentinel`)?(zt={canDrag:Pt,canDrop:Pt,onDropComplete:e=>Qe.current(e),onDropError:PY},t[50]=zt):zt=t[50];let Bt,Vt;t[51]===Symbol.for(`react.memo_cache_sentinel`)?(Bt={canRename:Pt,onRename:e=>Xe.current(e),onError:e=>Ze.current(e)},Vt=e=>Ye.current(e),t[51]=Bt,t[52]=Vt):(Bt=t[51],Vt=t[52]);let Ht;t[53]===i?Ht=t[54]:(Ht={paths:Ft,initialExpansion:`closed`,fileTreeSearchMode:`hide-non-matches`,initialVisibleRowCount:18,stickyFolders:!0,...XK,icons:Lt,unsafeCSS:JJ,composition:Rt,dragAndDrop:zt,renaming:Bt,onSelectionChange:Vt,renderRowDecoration:e=>{let{item:t}=e;if(t.kind===`file`){let e=ue.current.find(e=>ul(e)&&Ku(e.docName,e.docExt)===t.path);if(e?.isSymlink){let t=e.targetPath;return{icon:PJ,title:i(t?{id:`JE21eh`,values:{targetPath:t}}:{id:`BQu9Pg`})}}return YJ(t.path)?{icon:FJ,title:i({id:`i9toLO`})}:null}let n=ue.current.find(e=>tl(e)&&Wu(e.path)===Wu(t.path));if(n?.isSymlink){let e=n.targetPath;return{icon:PJ,title:i(e?{id:`JE21eh`,values:{targetPath:e}}:{id:`BQu9Pg`})}}return null}},t[53]=i,t[54]=Ht);let{model:Ut}=YK(Ht),Wt;t[55]===Ut?Wt=t[56]:(Wt=function(e){let t=Ut.getItem(e)??Ut.getItem(Wu(e));return t?.isDirectory()?Wu(Qu(t.getPath())):e},t[55]=Ut,t[56]=Wt);let Gt=Wt,Kt,qt;t[57]===k?(Kt=t[58],qt=t[59]):(qt=Nu(k),Kt=wu(qt),t[57]=k,t[58]=Kt,t[59]=qt);let Yt=Kt,Xt=(0,Q.useRef)(qt),Zt;t[60]===k?Zt=t[61]:(Zt=Hu(k),t[60]=k,t[61]=Zt);let Qt=Zt,$t=(0,Q.useRef)(Qt),en=bt?Gu(Wu(bt)).slice(0,-1):Gu(wt??xt),tn=en.join(`\0`),nn;t[62]===Ut?nn=t[63]:(nn=()=>{let e=new Set;for(let t of $t.current)Gq(Ut.getItem(t))?.isExpanded()&&e.add(t);return e},t[62]=Ut,t[63]=nn);let rn=nn,on;t[64]===rn?on=t[65]:(on=e=>{let t=new Set(Hu(e??ue.current)),n=rn();for(let e of Se.current)n.add(e);return[...n].filter(e=>t.has(e))},t[64]=rn,t[65]=on);let sn=on,cn;t[66]!==sn||t[67]!==Ut?(cn=e=>{let t=Nu(e??ue.current);Ut.resetPaths(t,{initialExpandedPaths:sn(e)})},t[66]=sn,t[67]=Ut,t[68]=cn):cn=t[68];let ln=cn,un;t[69]!==i||t[70]!==ut?(un=async function(e){let t=Ve.current,n=new AbortController;Be.current.set(e,n);let r=await hY(Qu(e),n.signal,i({id:`8RtNI0`}),i({id:`HlmZBk`}));if(Be.current.get(e)===n&&Be.current.delete(e),n.signal.aborted||t!==Ve.current)return;if(r.kind===`network-error`){ut(),console.warn(`[FileTree] lazy folder children fetch failed:`,e,r.cause);return}if(r.kind===`http-error`){console.warn(`[FileTree] lazy folder children http error:`,e,r.title),ct(r.title);return}let a=Ke.current,o=el(r.entries,a);Re.current.add(e),A(t=>dJ(t,e,o,Ie.current)),P(null),at(),r.truncated&&B(r.entries.length)},t[69]=i,t[70]=ut,t[71]=un):un=t[71];let dn=un,fn;t[72]!==rn||t[73]!==dn?(fn=()=>{let e=rn(),t=Ue.current;Ue.current=e;for(let n of e){if(t.has(n)||Re.current.has(n)||Be.current.has(n))continue;let e=Qu(n);ue.current.find(t=>tl(t)&&t.path===e)?.hasChildren!==!1&&dn(n)}},t[72]=rn,t[73]=dn,t[74]=fn):fn=t[74];let pn=fn,mn;t[75]!==rn||t[76]!==dn?(mn=()=>{for(let e of rn())Re.current.has(e)||Be.current.has(e)||dn(e)},t[75]=rn,t[76]=dn,t[77]=mn):mn=t[77];let hn=mn,gn;t[78]!==Ut||t[79]!==ln?(gn=(e,t,n,r)=>{let i=r===void 0?[]:r,a=0,o=null;for(let{fromDocName:r,toDocName:i}of n){let n=e.find(e=>ul(e)&&e.docName===r);if(n==null||Ut.getItem(i)==null)continue;let s=Ku(i,t.find(e=>ul(e)&&e.docName===i)?.docExt??n.docExt);Ut.move(i,s),o=s,a+=1}for(let{toPath:e}of i){let t=Qc(e);if(t===``)continue;let n=e.slice(0,-t.length);Ut.getItem(n)!=null&&(Ut.getItem(e)??Ut.move(n,e),o=e,a+=1)}a!==0&&(ln(t),o!=null&&Ut.focusPath(o))},t[78]=Ut,t[79]=ln,t[80]=gn):gn=t[80];let _n=gn,vn;t[81]===Symbol.for(`react.memo_cache_sentinel`)?(vn=e=>{Te.current=Bu(e)},t[81]=vn):vn=t[81];let yn=vn,bn;t[82]===Symbol.for(`react.memo_cache_sentinel`)?(bn=e=>be.current.has(e),t[82]=bn):bn=t[82];let xn=bn,Sn;t[83]!==i||t[84]!==b||t[85]!==D||t[86]!==T||t[87]!==ln?(Sn=async function(e){if(e.kind===`asset`||Ne.current!==null)return;let t=()=>{H(null),Ne.current=null};Ne.current=e.path,H(e.path),P(null);try{let n=await Ct(await fetch(`/api/duplicate-path`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({kind:e.kind,path:e.path})}),i({id:`dw_dUJ`}));if(!n.ok){bs.error(n.title),ln(),t();return}let r=It(sr,n.body,`duplicate-path`,null);if(r===null){let e=i({id:`67f-3g`});bs.error(e),P(e),pl([`files`,`backlinks`,`graph`]),ln(),t();return}for(let e of r.duplicatedDocNames)b(e);A(t=>{let n=QN(t,e,r);return ln(n),yn(n),n}),pl([`files`,`backlinks`,`graph`]),r.path!==e.path&&(r.kind===`folder`?D(r.path):T(r.path)),bs.success(r.kind===`folder`?i({id:`iilQXA`}):i({id:`A6h5b-`}),{description:r.path}),t()}catch(e){let n=e,r=n instanceof Error?n.message:String(n);console.warn(`[FileTree] duplicate failed:`,n),bs.error(i({id:`EBVbtP`}),{description:r}),ln(),t()}},t[83]=i,t[84]=b,t[85]=D,t[86]=T,t[87]=ln,t[88]=Sn):Sn=t[88];let Cn=Sn,wn=(0,Q.useRef)(Cn),Tn;t[89]===Cn?Tn=t[90]:(Tn=()=>{wn.current=Cn},t[89]=Cn,t[90]=Tn),(0,Q.useEffect)(Tn);let En=function(e){let t=DJ(e);if(!t||OJ(t))return!1;let n=Ut.getFocusedPath()??Ut.getSelectedPaths()[0]??null;if(!n||n.endsWith(`/`)||xn(n))return!1;let r=OJ(n);if(!r)return!1;let i=Wu(t);if(!$t.current.includes(i))return!1;let a=`${t}${r}`;return Xt.current.includes(a)?!1:(lr({sourcePath:n,destinationPath:a,isFolder:!1}),Ut.move(n,a),!0)},Dn;t[91]===Symbol.for(`react.memo_cache_sentinel`)?(Dn=e=>{let t=e??Ce.current;!t||Ce.current!==t||(t.disposeCommitListener(),Ce.current=null)},t[91]=Dn):Dn=t[91];let On=Dn,kn;t[92]!==i||t[93]!==On||t[94]!==l||t[95]!==c||t[96]!==ln?(kn=async function(e,t){let n=t===void 0?{}:t,r=n.updateUi??!0,a=n.restoreLocation??r;On(e),r&&H(e.renamePath);try{let t=await fetch(`/api/delete-path`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({kind:e.kind,path:e.createdPath})});if(!t.ok&&t.status!==404){let n=e.kind,a=e.createdPath,o=await Ct(t,i({id:`EcM3k7`,values:{kind:n}}));if(o.ok)return;let s=o.title,c=i({id:`YPFBfr`,values:{detail:s,kind:n,createdPath:a}});r?bs.error(c):console.warn(`[FileTree] cleanup pending create failed: ${c}`),r&&(H(null),ln());return}}catch(t){if(console.warn(`[FileTree] cleanup pending create failed:`,t),r){let t=e.kind,n=e.createdPath;bs.error(i({id:`_TDESN`,values:{kind:t,createdPath:n}}))}r&&(H(null),ln());return}r&&(e.kind===`file`?l(e.createdPath):c([h(e.createdPath)],{force:!0})),r&&A(t=>{let n=XN(t,e.kind===`file`?[e.createdPath]:[],e.kind===`folder`?e.createdPath:void 0);return yn(n),n}),pl([`files`,`backlinks`,`graph`]),a&&(window.location.hash=e.previousHash),r&&H(null)},t[92]=i,t[93]=On,t[94]=l,t[95]=c,t[96]=ln,t[97]=kn):kn=t[97];let An=kn,jn,Mn;t[98]===Symbol.for(`react.memo_cache_sentinel`)?(jn=()=>()=>{let e=Ce.current;e&&we.current(e,{restoreLocation:!1,updateUi:!1}).catch(NY)},Mn=[],t[98]=jn,t[99]=Mn):(jn=t[98],Mn=t[99]),(0,Q.useEffect)(jn,Mn);let Nn;t[100]!==i||t[101]!==ut?(Nn=()=>{let e=!0,t=null,n=rJ(async function(){t?.abort();let n=new AbortController;t=n,Ve.current+=1;for(let e of Be.current.values())e.abort();Be.current.clear(),Re.current.clear();try{let t=await fetch(`/api/documents?showAll=true&dir=&depth=1`,{signal:n.signal,headers:iJ});if(aJ(t)){let r=Ke.current,i=!1,{entries:a,truncated:o}=await cJ(t,{onBatch:t=>{if(!e||n.signal.aborted)return;let a=el(sl(t),r);a.length!==0&&(A(e=>uJ(e,a)),i||(i=!0,P(null),at(),M(!1)))}});if(!e)return;let s=el(sl(a),r);A(e=>dJ(e,``,s,Ie.current)),P(null),at(),B(o?a.length:null),Ge.current()}else{let n=await Ct(t,i({id:`8RtNI0`}));if(!e)return;if(!n.ok)ct(n.title),B(null);else{let e=Un.safeParse(n.body);if(!e.success)ct(i({id:`HlmZBk`})),B(null);else{let t=Ke.current,n=el(sl(e.data.documents),t);A(e=>dJ(e,``,n,Ie.current)),P(null),at(),B(e.data.truncated===!0?e.data.documents.length:null),Ge.current()}}}}catch(t){let r=t;if(n.signal.aborted)return;e&&(r instanceof oJ?ct(r.message):ut()),console.warn(`[FileTree] fetch failed:`,r)}e&&M(!1)},()=>t?.abort());qe.current=()=>n.request(),n.request();let r=()=>{document.visibilityState===`visible`&&n.request()};window.addEventListener(`focus`,r),window.addEventListener(`visibilitychange`,r);let a=ml(e=>{e.includes(`files`)&&n.request()});return()=>{e=!1,qe.current=null,n.dispose();for(let e of Be.current.values())e.abort();Be.current.clear(),window.removeEventListener(`focus`,r),window.removeEventListener(`visibilitychange`,r),a()}},t[100]=i,t[101]=ut,t[102]=Nn):Nn=t[102];let Pn;t[103]===i?Pn=t[104]:(Pn=[i],t[103]=i,t[104]=Pn),(0,Q.useEffect)(Nn,Pn);let Fn=(0,Q.useRef)(!0),In;t[105]===Symbol.for(`react.memo_cache_sentinel`)?(In=()=>{if(Fn.current){Fn.current=!1;return}qe.current?.()},t[105]=In):In=t[105];let Rn;t[106]===Mt?Rn=t[107]:(Rn=[Mt],t[106]=Mt,t[107]=Rn),(0,Q.useEffect)(In,Rn);let zn,Bn;t[108]===Symbol.for(`react.memo_cache_sentinel`)?(zn=()=>{let e=!0;return fetch(`/api/workspace`).then(async t=>{let n=await t.json();if(!e||!t.ok)return;let r=It(ar,n,`workspace`,null);r&&ie({contentDir:r.contentDir,pathSeparator:r.pathSeparator})}).catch(MY),()=>{e=!1}},Bn=[],t[108]=zn,t[109]=Bn):(zn=t[108],Bn=t[109]),(0,Q.useEffect)(zn,Bn);let Vn;t[110]!==sn||t[111]!==Ut||t[112]!==Yt?(Vn=()=>{if(Te.current===Yt){Te.current=null;return}Ut.resetPaths(Xt.current,{initialExpandedPaths:sn()})},t[110]=sn,t[111]=Ut,t[112]=Yt,t[113]=Vn):Vn=t[113];let Hn;t[114]!==Ut||t[115]!==Yt?(Hn=[Ut,Yt],t[114]=Ut,t[115]=Yt,t[116]=Hn):Hn=t[116],(0,Q.useEffect)(Vn,Hn),qq(Ut,wt,tn,De,Yt);let Wn,Gn;t[117]!==Ut||t[118]!==r?(Wn=()=>{if(!r)return;let e=0,t=0,n=()=>Je.current?.querySelector(`file-tree-container`)?.shadowRoot?.querySelector(`[data-file-tree-virtualized-list]`)??null,i=()=>{let e=n();if(!e)return;let t=Number.parseFloat(e.style.height);Number.isFinite(t)&&r(t)},a=()=>{cancelAnimationFrame(e),e=requestAnimationFrame(i)},o=new MutationObserver(i),s=()=>{let e=n();e?(o.observe(e,{attributes:!0,attributeFilter:[`style`]}),i()):t=requestAnimationFrame(s)};s();let c=Ut.subscribe(a);return window.addEventListener(`resize`,a),()=>{cancelAnimationFrame(e),cancelAnimationFrame(t),o.disconnect(),c(),window.removeEventListener(`resize`,a)}},Gn=[r,Ut],t[117]=Ut,t[118]=r,t[119]=Wn,t[120]=Gn):(Wn=t[119],Gn=t[120]),(0,Q.useEffect)(Wn,Gn);let Kn;t[121]===Symbol.for(`react.memo_cache_sentinel`)?(Kn=()=>{oe(!1)},t[121]=Kn):Kn=t[121];let qn;t[122]===St?qn=t[123]:(qn=[St],t[122]=St,t[123]=qn),(0,Q.useEffect)(Kn,qn);let Jn,Yn;t[124]===ae?(Jn=t[125],Yn=t[126]):(Jn=()=>{se.current=ae;for(let e of q.current)e()},Yn=[ae],t[124]=ae,t[125]=Jn,t[126]=Yn),(0,Q.useEffect)(Jn,Yn);let Xn;t[127]!==wt||t[128]!==j||t[129]!==Ut?(Xn=()=>{j||!wt||Oq(Ut)},t[127]=wt,t[128]=j,t[129]=Ut,t[130]=Xn):Xn=t[130];let Zn;t[131]!==tn||t[132]!==wt||t[133]!==j||t[134]!==Ut||t[135]!==Yt?(Zn=[wt,tn,Yt,j,Ut],t[131]=tn,t[132]=wt,t[133]=j,t[134]=Ut,t[135]=Yt,t[136]=Zn):Zn=t[136],(0,Q.useEffect)(Xn,Zn);let Qn,$n;t[137]===Ut?(Qn=t[138],$n=t[139]):(Qn=()=>Ut.subscribe(()=>{if(!Ut.isSearchOpen())for(let e of Se.current){let t=Gq(Ut.getItem(e));t&&!t.isExpanded()&&t.expand()}}),$n=[Ut],t[137]=Ut,t[138]=Qn,t[139]=$n),(0,Q.useEffect)(Qn,$n);let er,tr;t[140]===Ut?(er=t[141],tr=t[142]):(er=()=>Ut.subscribe(()=>We.current()),tr=[Ut],t[140]=Ut,t[141]=er,t[142]=tr),(0,Q.useEffect)(er,tr);let nr,rr;t[143]===Ut?(nr=t[144],rr=t[145]):(nr=()=>Ut.onMutation(`remove`,e=>{let t=Ce.current;!t||e.path!==t.renamePath||we.current(t)}),rr=[Ut],t[143]=Ut,t[144]=nr,t[145]=rr),(0,Q.useEffect)(nr,rr);let ir;t[146]!==b||t[147]!==u||t[148]!==d||t[149]!==ge||t[150]!==D||t[151]!==T||t[152]!==f||t[153]!==_n||t[154]!==_?(ir=async(e,t,n,r,i)=>{let a=t===void 0?[]:t,o=n===void 0?[]:n,s=i===void 0?[]:i,c=r?.docName??_e.current,l=new Map,p=new Map;for(let e of ue.current){if(ul(e)){let t=o.find(t=>t.fromPath===Ku(e.docName,e.docExt))?.toPath;t&&l.set(e.docName,t);continue}if(il(e)){let t=o.find(t=>t.fromPath===e.path)?.toPath;t&&Xc(t)&&p.set(e.path,Mu(t))}}let m=c?l.get(c)??null:null,h=r?.folderPath??($e.current?.kind===`folder`?$e.current.folderPath:null),g=h?le(h,a):null,v=r?.assetPath??($e.current?.kind===`asset`?$e.current.assetPath:null),y=v?p.get(v)??null:null,x=m?null:y??$N(c,e),S=m??(v?y?null:o.find(e=>e.fromPath===v)?.toPath??le(v,a):null);ot(e);let C=[...eP(e,d(),f),...l.keys()];await Promise.all(C.map(e=>u(e)));for(let t of e)b(t.toDocName);for(let e of p.values())b(e);_(e,a,o);let w=null;A(t=>{let n=YN(t,e,a,o,s);return w=n,_n(t,n,e,o),yn(n),n}),h&&g&&g!==h?D(g):x&&x!==c?(T(x),kJ(x)):S&&(m||S!==v)&&ge(S,w??ue.current),pl([`files`,`backlinks`,`graph`])},t[146]=b,t[147]=u,t[148]=d,t[149]=ge,t[150]=D,t[151]=T,t[152]=f,t[153]=_n,t[154]=_,t[155]=ir):ir=t[155];let or=ir;async function lr(e){let t=!e.isFolder&&xn(e.sourcePath),n=t?e.sourcePath:Lu(e.sourcePath,e.isFolder);H(n),P(null);try{let r=Zc(e.sourcePath,e.destinationPath,e.isFolder),a=!e.isFolder&&!t&&!Xc(r.destinationPath),o=t||a?r.destinationPath:Lu(r.destinationPath,e.isFolder),s=e.isFolder?{kind:`folder`,fromPath:Qu(n),toPath:Qu(o)}:t||a?{kind:`asset`,fromPath:n,toPath:o}:{kind:`file`,fromPath:Zu(n,ue.current),toPath:o},c={docName:_e.current,folderPath:$e.current?.kind===`folder`?$e.current.folderPath:null,assetPath:$e.current?.kind===`asset`?$e.current.assetPath:null},l=await Ct(await fetch(`/api/rename-path`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(s)}),i({id:`gijbne`}));if(!l.ok){bs.error(l.title),ln();let e=Ce.current;e&&e.renamePath===n?await An(e):On(),H(null);return}let u=It(Hr,l.body,`rename-path`,{renamed:[],renamedAssets:[]});try{await or(u.renamed,e.isFolder?[{fromPath:Qu(n),toPath:Qu(o)}]:[],u.renamedAssets,c,!e.isFolder&&!t&&!a?u.renamed.flatMap(e=>{let t=Qc(o);return t?[{toDocName:e.toDocName,docExt:t}]:[]}):[])}catch(e){console.warn(`[FileTree] post-rename reconciliation failed`,{err:e,sourceTreePath:n,destinationTreePath:o,renamedCount:u.renamed.length,renamedAssetCount:u.renamedAssets.length}),bs.error(i({id:`dDpCOp`}))}On(),H(null)}catch(e){console.warn(`[FileTree] rename failed:`,e);let t=i({id:`HIb0vl`});bs.error(t),P(t),ln();let r=Ce.current;r&&r.renamePath===n?await An(r):On(),H(null)}}let ur;t[156]!==i||t[157]!==or||t[158]!==ln?(ur=async function(e){let t=e.draggedPaths.map(t=>{let n=Ru(t,e.target);return t===n?null:{sourcePath:t,destinationTreePath:n}}).filter(jY);if(t.length!==0){H(t[0]?.sourcePath??null),P(null);try{let e=[],n=[],r=[],a={docName:_e.current,folderPath:$e.current?.kind===`folder`?$e.current.folderPath:null,assetPath:$e.current?.kind===`asset`?$e.current.assetPath:null};for(let a of t){let t=a.sourcePath.endsWith(`/`),o=!t&&xn(a.sourcePath),s=o?null:Zu(a.sourcePath,ue.current),c=t?{kind:`folder`,fromPath:Qu(a.sourcePath),toPath:Qu(a.destinationTreePath)}:o?{kind:`asset`,fromPath:a.sourcePath,toPath:a.destinationTreePath}:{kind:`file`,fromPath:s??Mu(a.sourcePath),toPath:s&&Xc(s)?a.destinationTreePath:Mu(a.destinationTreePath)},l=await Ct(await fetch(`/api/rename-path`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(c)}),i({id:`dOHMA0`}));if(!l.ok){bs.error(l.title),ln(),H(null);return}let u=It(Hr,l.body,`rename-path:drop`,{renamed:[],renamedAssets:[]});e=e.concat(u.renamed),n=n.concat(u.renamedAssets),t&&r.push({fromPath:Qu(a.sourcePath),toPath:Qu(a.destinationTreePath)})}try{await or(e,r,n,a)}catch(r){console.warn(`[FileTree] post-move reconciliation failed`,{err:r,operationCount:t.length,renamedCount:e.length,renamedAssetCount:n.length}),bs.error(i({id:`8OxKZy`}))}H(null)}catch(e){console.warn(`[FileTree] move failed:`,e),bs.error(i({id:`HIb0vl`})),ln(),H(null)}}},t[156]=i,t[157]=or,t[158]=ln,t[159]=ur):ur=t[159];let fr=ur,pr;t[160]!==i||t[161]!==b||t[162]!==ln?(pr=async function(e,t,n){if(e.length===0||Ne.current!==null)return;let r=()=>{Ne.current=null,H(null)};Ne.current=n,H(n),P(null);let a=[],o=0,s=0;for(let n of e){let e=new FormData;e.append(`file`,n),qu(e,t,n.name||`upload`);try{let r=await Ct(await fetch(`/api/upload`,{method:`POST`,body:e}),i({id:`4Gz2wC`}));if(!r.ok){s+=1,bs.error(r.title,{description:n.name});continue}let c=It(zr,r.body,`upload:drop`,null);if(c===null){s+=1,bs.error(i({id:`4Gz2wC`}),{description:n.name});continue}let l=ku(t,c);if(c.deduped===!0){s+=1,bs.error(i({id:`4sKwf6`}),{description:l});continue}o+=1;let u=Ju(l,n);u&&a.push(u)}catch(e){let t=e;s+=1,console.warn(`[FileTree] external file upload failed:`,t),bs.error(t instanceof TypeError?i({id:`HIb0vl`}):i({id:`4Gz2wC`}),{description:n.name})}}try{if(a.length>0){for(let e of a)ul(e)&&b(e.docName);A(e=>{let t=new Set(e.map(Pu)),n=!1,r=[...e];for(let e of a){let i=Pu(e);Ie.current.set(i,Date.now()),!t.has(i)&&(t.add(i),r.push(e),n=!0)}return n?(ln(r),yn(r),r):e})}o>0&&(pl([`files`,`backlinks`,`graph`]),qe.current?.(),bs.success(Yc._({id:`v75Em9`,values:{uploadedCount:o}}),{description:t||i({id:`RSqaSd`})})),s>0&&P(o>0?Yc._({id:`yH7T4q`,values:{failedCount:s}}):i({id:`4Gz2wC`})),r()}catch(e){let t=e,n=i({id:`VcqWBy`});console.warn(`[FileTree] upload post-upload reconciliation failed:`,t),bs.error(n),P(n),r()}},t[160]=i,t[161]=b,t[162]=ln,t[163]=pr):pr=t[163];let mr=pr,hr;t[164]===Symbol.for(`react.memo_cache_sentinel`)?(hr=function(e){ne({parentDir:e})},t[164]=hr):hr=t[164];let gr=hr,_r;t[165]!==i||t[166]!==b||t[167]!==An||t[168]!==On||t[169]!==Ut||t[170]!==D||t[171]!==T||t[172]!==ln||t[173]!==qt?(_r=async function(e,t,n){if(Ne.current)return;let r=Ce.current;r&&On(r);try{let r=Uu(e,t,[...qt,...$t.current]);H(r.renamePath),Ne.current=r.renamePath;let a=window.location.hash,o;if(e===`file`){let e=ju(`file`,r.addPath),t={path:e};n?.template&&(t.template=n.template);let a=await Ct(await fetch(`/api/create-page`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)}),i({id:`fJgQHX`}));if(!a.ok){bs.error(a.title),H(null),Ne.current=null;return}let s=Mu(e),c=It(dr,a.body,`create-page`,{docName:s}).docName;o=c;let l={kind:`document`,docName:c,docExt:e.toLowerCase().endsWith(`.mdx`)?`.mdx`:`.md`,modified:new Date().toISOString(),size:0};b(c),A(e=>{if(e.some(e=>ul(e)&&e.docName===c))return e;let t=[...e,l];return yn(t),Ie.current.set(Pu(l),Date.now()),t}),pl([`files`,`backlinks`,`graph`]),T(c)}else{let e=Qu(r.addPath),t=await Ct(await fetch(`/api/create-folder`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({path:e})}),i({id:`K1ckLX`}));if(!t.ok){bs.error(t.title),H(null),Ne.current=null;return}o=It(hi,t.body,`create-folder`,{path:e}).path;let n={kind:`folder`,path:o,modified:new Date().toISOString(),size:0};A(e=>{if(e.some(e=>tl(e)&&e.path===o))return e;let t=[...e,n];return yn(t),Ie.current.set(Pu(n),Date.now()),t}),pl([`files`]),D(o)}let s=!1,c=e=>{if(e.key!==`Enter`)return;let t=Ce.current;!t||t.renamePath!==r.renamePath||queueMicrotask(()=>On(t))};document.addEventListener(`keydown`,c,!0),Ce.current={kind:e,renamePath:r.renamePath,createdPath:o,previousHash:a,disposeCommitListener:()=>{s||(s=!0,document.removeEventListener(`keydown`,c,!0))}},H(null),Ne.current=null,Ut.add(r.addPath),Ut.startRenaming(r.renamePath,{removeIfCanceled:!0})}catch(e){console.warn(`[FileTree] create placeholder failed:`,e),bs.error(i({id:`S6l5dv`}));let t=Ce.current;t?await An(t):On(),H(null),Ne.current=null,ln()}},t[165]=i,t[166]=b,t[167]=An,t[168]=On,t[169]=Ut,t[170]=D,t[171]=T,t[172]=ln,t[173]=qt,t[174]=_r):_r=t[174];let yr=_r,br;t[175]===Ut?br=t[176]:(br=function(e){let t=Wu(e);(0,Q.startTransition)(()=>{for(let e of $t.current)if(e===t||e.startsWith(t)){let t=Gq(Ut.getItem(e));t&&t.expand()}})},t[175]=Ut,t[176]=br);let xr=br,Sr;t[177]===Ut?Sr=t[178]:(Sr=function(e){let t=Wu(e),n=new Set(Se.current);(0,Q.startTransition)(()=>{for(let e of[...$t.current].reverse())if((e===t||e.startsWith(t))&&!n.has(e)){let t=Gq(Ut.getItem(e));t&&t.collapse()}})},t[177]=Ut,t[178]=Sr);let Cr=Sr,wr;t[179]===Symbol.for(`react.memo_cache_sentinel`)?(wr=function(){return((Je.current?.querySelector(`file-tree-container`)?.shadowRoot)?.querySelector(`[aria-selected="true"][data-item-path]`))?.dataset.itemPath??null},t[179]=wr):wr=t[179];let Tr=wr,Er;t[180]!==me||t[181]!==en||t[182]!==o||t[183]!==s||t[184]!==ye||t[185]!==V||t[186]!==An||t[187]!==pn||t[188]!==k||t[189]!==Qt||t[190]!==fr||t[191]!==lr||t[192]!==Gt||t[193]!==x||t[194]!==En||t[195]!==hn||t[196]!==Mt||t[197]!==qt||t[198]!==mr?(Er=()=>{ue.current=k,de.current=x,_e.current=o,$e.current=s,be.current=ye,Ne.current=V,Ke.current=Mt,Xt.current=qt,$t.current=Qt,Se.current=en,We.current=pn,Ge.current=hn,we.current=An,Me.current=(e,t,n)=>{mr(e,t,n)},Ye.current=e=>{if(De.current||Oe.current||e.length!==1)return;let t=e[0];if(t){oe(!1);let e=Gt(t),n=fe.current,r=n!==null&&Mu(n)===Mu(e),i=r?n:e;fe.current=null,queueMicrotask(()=>{me(Gt((r?null:Tr())??i),ue.current)})}},Ze.current=e=>{En(e)||bs.error(e)},Xe.current=lr,Qe.current=fr},t[180]=me,t[181]=en,t[182]=o,t[183]=s,t[184]=ye,t[185]=V,t[186]=An,t[187]=pn,t[188]=k,t[189]=Qt,t[190]=fr,t[191]=lr,t[192]=Gt,t[193]=x,t[194]=En,t[195]=hn,t[196]=Mt,t[197]=qt,t[198]=mr,t[199]=Er):Er=t[199],(0,Q.useLayoutEffect)(Er);let Dr,Or;t[200]===Ut?(Dr=t[201],Or=t[202]):(Dr=()=>{let e=e=>{let t=(e.metaKey||e.ctrlKey)&&!e.altKey,n=e.key.toLowerCase(),r=t&&n===`a`,i=t&&!e.shiftKey&&n===`d`,a=t&&!e.shiftKey&&n===`c`,o=t&&!e.shiftKey&&n===`v`,s=!e.altKey&&!e.shiftKey&&(e.metaKey&&!e.ctrlKey&&n===`backspace`||!e.metaKey&&!e.ctrlKey&&n===`delete`);if(!r&&!i&&!a&&!o&&!s||cY(e.target))return;let c=Je.current,l=e.target,u=document.activeElement,d=l instanceof Node&&c?.contains(l),f=u instanceof Node&&c?.contains(u);if(!d&&!f)return;if(a){let t=aY(Ut,ue.current,be.current);if(!t)return;Pe.current=t,e.preventDefault(),e.stopPropagation();return}if(o){let t=Pe.current;if(!t)return;wn.current(t),e.preventDefault(),e.stopPropagation();return}if(i){let t=aY(Ut,ue.current,be.current);if(!t)return;wn.current(t),e.preventDefault(),e.stopPropagation();return}if(s){if(Ne.current!==null)return;let t=oY(Ut,ue.current);if(t.length===0)return;W({targets:t}),e.preventDefault(),e.stopPropagation();return}let p=new Set([...$t.current,...Xt.current]);De.current=!0;for(let e of p)e&&Ut.getItem(e)?.select();queueMicrotask(()=>{De.current=!1}),e.preventDefault(),e.stopPropagation()};return document.addEventListener(`keydown`,e,!0),()=>document.removeEventListener(`keydown`,e,!0)},Or=[Ut],t[200]=Ut,t[201]=Dr,t[202]=Or),(0,Q.useEffect)(Dr,Or);let kr,Ar;t[203]!==k.length||t[204]!==j?(kr=()=>{if(j||k.length===0)return;let e=Je.current?.querySelector(HL)?.shadowRoot;if(!e)return;let t=AY,n=()=>{for(let n of e.querySelectorAll(`[data-item-path]`)){let e=n.dataset.itemPath;if(!e)continue;let r=t(e);n.title!==r&&(n.title=r)}let n=e.querySelector(`[data-type="context-menu-anchor"]`);if(n){let r=e.querySelector(`[data-item-context-hover="true"][data-item-path]`)?.dataset.itemPath,i=r?t(r):``;n.title!==i&&(n.title=i)}};n();let r=new MutationObserver(n);return r.observe(e,{subtree:!0,childList:!0,attributes:!0,attributeFilter:[`data-item-path`,`data-item-context-hover`]}),()=>r.disconnect()},Ar=[j,k.length],t[203]=k.length,t[204]=j,t[205]=kr,t[206]=Ar):(kr=t[205],Ar=t[206]),(0,Q.useEffect)(kr,Ar);let jr,Mr;t[207]!==k.length||t[208]!==j?(jr=()=>{if(j||k.length===0)return;let e=Je.current?.querySelector(HL)?.shadowRoot;if(!e)return;let t=()=>aq(e);t();let n=new MutationObserver(t);return n.observe(e,{subtree:!0,childList:!0,characterData:!0,attributes:!0,attributeFilter:[`data-item-path`]}),()=>n.disconnect()},Mr=[j,k.length],t[207]=k.length,t[208]=j,t[209]=jr,t[210]=Mr):(jr=t[209],Mr=t[210]),(0,Q.useEffect)(jr,Mr);let Nr,Pr;t[211]!==k.length||t[212]!==j?(Nr=()=>{if(j||k.length===0)return;let e=Je.current?.querySelector(HL)?.shadowRoot;if(!e)return;let t=()=>Cq(e);t();let n=new MutationObserver(t);return n.observe(e,{subtree:!0,childList:!0,attributes:!0,attributeFilter:[`data-item-path`]}),()=>n.disconnect()},Pr=[j,k.length],t[211]=k.length,t[212]=j,t[213]=Nr,t[214]=Pr):(Nr=t[213],Pr=t[214]),(0,Q.useEffect)(Nr,Pr);let Fr;t[215]===Symbol.for(`react.memo_cache_sentinel`)?(Fr={folderCount:0,expandedCount:0},t[215]=Fr):Fr=t[215];let Ir=(0,Q.useRef)(Fr),Lr=(0,Q.useRef)(yr),Rr=(0,Q.useRef)(gr),Br;t[216]===yr?Br=t[217]:(Br=()=>{Lr.current=yr,Rr.current=gr},t[216]=yr,t[217]=Br),(0,Q.useEffect)(Br);let Vr,Ur;t[218]===Ut?(Vr=t[219],Ur=t[220]):(Vr=()=>({startCreating(e,t){Lr.current(e,t)},startCreatingFromTemplate(e){Rr.current(e)},createFromTemplate(e,t){Lr.current(`file`,e,{template:t})},expandAll(){(0,Q.startTransition)(()=>{for(let e of $t.current){let t=Gq(Ut.getItem(e));t&&t.expand()}})},collapseAll(){let e=new Set(Se.current);(0,Q.startTransition)(()=>{for(let t of[...$t.current].reverse()){if(e.has(t))continue;let n=Gq(Ut.getItem(t));n&&n.collapse()}})},getFolderState(){let e=$t.current,t=0;for(let n of e)Gq(Ut.getItem(n))?.isExpanded()&&t++;let n=e.length,r=Ir.current;if(r.folderCount===n&&r.expandedCount===t)return r;let i={folderCount:n,expandedCount:t};return Ir.current=i,i},isCreationTargetCleared(){return se.current},clearCreationTarget(){oe(!0)},subscribe(e){q.current.add(e);let t=Ut.subscribe(e);return()=>{q.current.delete(e),t()}}}),Ur=[Ut],t[218]=Ut,t[219]=Vr,t[220]=Ur),(0,Q.useImperativeHandle)(n,Vr,Ur);let Wr;t[221]!==On||t[222]!==u||t[223]!==c||t[224]!==Ut?(Wr=async function(e,t,n){let r=lY(e,ue.current,$t.current),i=Ce.current;i&&e.some(e=>uY(e,i))&&(i.kind===`file`?r.docNames.add(i.createdPath):r.folderPaths.add(i.createdPath),On(i));let a=new Set([...r.docNames,...t]),o=new Set([...r.folderPaths,...n]),s=new Set([...r.assetPaths,...e.filter(kY).map(OY)]);c([...[...a].map(DY),...[...o].map(EY),...[...s].map(TY)],{force:!0}),await Promise.all([...a].map(e=>u(e)));for(let t of e){let e=t.kind===`folder`?Wu(t.path):t.kind===`asset`?t.path:Ku(t.path,t.docExt);Ut.getItem(e)&&Ut.remove(e,t.kind===`folder`?{recursive:!0}:void 0)}A(e=>{let t=XN(e,[...a],void 0,[...s]);for(let e of o)t=XN(t,[],e);return yn(t),t}),pl([`files`,`backlinks`,`graph`])},t[221]=On,t[222]=u,t[223]=c,t[224]=Ut,t[225]=Wr):Wr=t[225];let Gr=Wr,Kr;t[226]!==i||t[227]!==Gr?(Kr=async function(e){let t=[],n=[],r=[];for(let a of e){let e=a.kind;H(a.path);let o=await Ct(await fetch(`/api/delete-path`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({kind:e,path:a.path})}),i({id:`7JtSLi`}));if(!o.ok)return r.length>0&&await Gr(r,t,n),bs.error(o.title),!1;let s=It(fi,o.body,`delete-path`,{deletedDocNames:[]});t.push(...s.deletedDocNames),e===`folder`&&n.push(a.path),r.push(a)}return await Gr(r,t,n),!0},t[226]=i,t[227]=Gr,t[228]=Kr):Kr=t[228];let qr=Kr,Jr;t[229]===Symbol.for(`react.memo_cache_sentinel`)?(Jr=async function(e,t,n){let r=[],i=[];for(let a of e){H(a.path);let e=tP(a,n),o=await t.shell.trashItem(e);o.ok?r.push(a):i.push({kind:a.kind,path:a.path,name:a.name,reason:Rq(o.reason),detail:o.detail})}return{trashed:r,failed:i}},t[229]=Jr):Jr=t[229];let Yr=Jr,Xr;t[230]===i?Xr=t[231]:(Xr=async function(e){let t=[],n=[],r=[];for(let a of e){let e=a.kind;try{let o=await Ct(await fetch(`/api/trash/cleanup`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({kind:e,path:a.path})}),i({id:`DVh_Tb`}));if(!o.ok){console.warn(`[FileTree] trash-cleanup failed`,{target:`${a.kind}:${a.path}`,reason:o.title}),r.push({target:a,reason:o.title});continue}let s=It(cr,o.body,`trash-cleanup`,{deletedDocNames:[]});t.push(...s.deletedDocNames),e===`folder`&&n.push(a.path)}catch(e){let t=e;console.warn(`[FileTree] trash-cleanup threw`,{target:`${a.kind}:${a.path}`,err:t}),r.push({target:a,reason:i({id:`r4R7AZ`})})}}if(r.length>0){let e=r.length;bs.error(i({id:`IrB5AK`,values:{failedCount:e}}),{description:i({id:`vEJDlt`})})}return r.length===e.length&&e.length>0?null:{deletedDocNames:t,deletedFolderPaths:n}},t[230]=i,t[231]=Xr);let Zr=Xr,Qr;t[232]!==i||t[233]!==ee||t[234]!==Gr||t[235]!==qr||t[236]!==Zr||t[237]!==ln||t[238]!==re?(Qr=async function(e){let t=e.map(e=>ZN(e,ue.current)),n=t[0];if(!n)return;let r=ee.filter(e=>t.some(t=>{if(t.kind===`file`){let n=`${t.path}${t.docExt??`.md`}`;return e.file===n}return t.kind===`folder`?e.file.startsWith(`${t.path}/`):!1}));if(r.length>0){let e=r.slice(0,3).map(wY),t=r.length>e.length?`, +${r.length-e.length} more`:``;bs.error(`Cannot delete files with unresolved conflicts`,{description:`Resolve the conflict on ${e.join(`, `)}${t} before deleting.`});return}H(n.path),W(null);let a=typeof window<`u`?window.okDesktop:void 0;try{if(a&&re){let{trashed:e,failed:n}=await Yr(t,a,re);if(e.length>0){let t=await Zr(e);t?await Gr(e,t.deletedDocNames,t.deletedFolderPaths):await Gr(e,e.filter(CY).map(SY),e.filter(xY).map(bY))}n.length>0&&K({failed:n,originalTargets:[...t]}),H(null)}else{let e=await qr(t);H(null),e||ln()}}catch(e){let t=e,n=t instanceof Error?t.message:String(t);console.warn(`[FileTree] delete failed:`,t),bs.error(i({id:`0eHrMb`}),{description:n}),H(null),ln()}},t[232]=i,t[233]=ee,t[234]=Gr,t[235]=qr,t[236]=Zr,t[237]=ln,t[238]=re,t[239]=Qr):Qr=t[239];let $r=Qr,ei;t[240]!==i||t[241]!==qr||t[242]!==ln||t[243]!==G?(ei=async function(){if(!G)return;let e=new Set(G.failed.map(yY)),t=G.originalTargets.filter(t=>e.has(`${t.kind}:${t.path}`));if(K(null),t.length!==0){H(t[0]?.path??null);try{let e=await qr(t);H(null),e||ln()}catch(e){let t=e,n=t instanceof Error?t.message:String(t);console.warn(`[FileTree] hard-delete fallback failed:`,t),bs.error(i({id:`0eHrMb`}),{description:n}),H(null),ln()}}},t[240]=i,t[241]=qr,t[242]=ln,t[243]=G,t[244]=ei):ei=t[244];let ti=ei,ni;t[245]!==$r||t[246]!==G?(ni=async function(){if(!G)return;let e=new Set(G.failed.map(vY)),t=G.originalTargets.filter(t=>e.has(`${t.kind}:${t.path}`));K(null),await $r(t)},t[245]=$r,t[246]=G,t[247]=ni):ni=t[247];let ri=ni,ii=(0,Q.useRef)($r),ai;t[248]===$r?ai=t[249]:(ai=()=>{ii.current=$r},t[248]=$r,t[249]=ai),(0,Q.useEffect)(ai);let oi,si;t[250]===Symbol.for(`react.memo_cache_sentinel`)?(oi=()=>Qq(e=>{if(e.kind===`doc`||e.kind===`folder-index`){let t=e.docName,n=ue.current.find(e=>ul(e)&&e.docName===t);ii.current([{kind:`file`,path:t,name:t.split(`/`).pop()??t,docExt:n?.docExt}]);return}if(e.kind===`folder`){ii.current([{kind:`folder`,path:e.folderPath,name:e.folderPath.split(`/`).pop()??e.folderPath}]);return}if(e.kind===`asset`){ii.current([{kind:`asset`,path:e.assetPath,name:e.assetPath.split(`/`).pop()??e.assetPath}]);return}console.warn(JSON.stringify({event:`file-tree-menu-action-delete-unsupported-kind`,kind:e.kind}))}),si=[],t[250]=oi,t[251]=si):(oi=t[250],si=t[251]),(0,Q.useEffect)(oi,si);let ci,li;t[252]===Symbol.for(`react.memo_cache_sentinel`)?(ci=()=>nJ(e=>{if(e.kind===`doc`||e.kind===`folder-index`){let t=e.docName,n=ue.current.find(e=>ul(e)&&e.docName===t);wn.current({kind:`file`,path:t,name:t.split(`/`).pop()??t,docExt:n?.docExt});return}if(e.kind===`folder`){wn.current({kind:`folder`,path:e.folderPath,name:e.folderPath.split(`/`).pop()??e.folderPath});return}console.warn(JSON.stringify({event:`file-tree-menu-action-duplicate-unsupported-kind`,kind:e.kind}))}),li=[],t[252]=ci,t[253]=li):(ci=t[252],li=t[253]),(0,Q.useEffect)(ci,li);let ui,di;t[254]===Ut?(ui=t[255],di=t[256]):(ui=()=>eJ(e=>{if(e.kind===`doc`||e.kind===`folder-index`){let t=e.docName,n=Ku(t,ue.current.find(e=>ul(e)&&e.docName===t)?.docExt);Ut.startRenaming(n);return}if(e.kind===`folder`){Ut.startRenaming(e.folderPath);return}if(e.kind===`asset`){Ut.startRenaming(e.assetPath);return}console.warn(JSON.stringify({event:`file-tree-menu-action-rename-unsupported-kind`,kind:e.kind}))}),di=[Ut],t[254]=Ut,t[255]=ui,t[256]=di),(0,Q.useEffect)(ui,di);let pi;t[257]===Symbol.for(`react.memo_cache_sentinel`)?(pi=function(){let e=Ee.current;e&&TJ(e),Ee.current=null},t[257]=pi):pi=t[257];let mi=pi,gi;t[258]===Symbol.for(`react.memo_cache_sentinel`)?(gi=function(e){let t=$J(e);if(!t)return!1;let n=Je.current?.querySelector(HL)?.shadowRoot;if(!n)return!1;for(let e of n.querySelectorAll(`[data-item-path]`))if(e.dataset.itemPath===t)return!0;return!1},t[258]=gi):gi=t[258];let _i=gi,vi;t[259]===g?vi=t[260]:(vi=function(e){let t=WY(e.nativeEvent);if(!t||t.endsWith(`/`)){mi();return}let n=ue.current.find(e=>Pu(e)===t);if(n&&il(n)){mi();return}let r=n&&ul(n)?n.docName:Zu(t,ue.current);if(n&&ul(n)&&vr(n.size)){mi();return}Ee.current!==r&&(mi(),Ee.current=r,wJ(r,e=>g(e)))},t[259]=g,t[260]=vi);let yi=vi,bi;t[261]!==me||t[262]!==Ut||t[263]!==D||t[264]!==T?(bi=function(e){if(e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;let t=GY(e.nativeEvent);if(!t){JY(e.nativeEvent)&&oe(!0);return}let n=t.getAttribute(`aria-selected`)===`true`,r=t.dataset.itemPath;if(!r)return;let i=t.dataset.itemType===`folder`?Wu(r):r;if(t.dataset.itemType===`folder`){let t=Qu(i),r=Gq(Ut.getItem(i));if(!n){e.preventDefault(),e.stopPropagation(),r&&!r.isExpanded()&&r.expand(),queueMicrotask(()=>D(t));return}if(Ut.getSelectedPaths().length!==1||window.location.hash===xl(t))return;e.preventDefault(),e.stopPropagation(),r&&!r.isExpanded()&&r.expand(),queueMicrotask(()=>D(t));return}if(!n){if(eY(i,Xt.current)||_i(i)){fe.current=i,setTimeout(()=>T(i,void 0,{registerPage:!0}),0);return}queueMicrotask(()=>me(i));return}let a=Zu(i,ue.current);Ut.getSelectedPaths().length===1&&window.location.hash!==kl(a)&&queueMicrotask(()=>me(i))},t[261]=me,t[262]=Ut,t[263]=D,t[264]=T,t[265]=bi):bi=t[265];let xi=bi,Si;t[266]===Symbol.for(`react.memo_cache_sentinel`)?(Si=function(e){Vu(e.nativeEvent)&&(e.preventDefault(),e.stopPropagation(),e.dataTransfer.dropEffect=`copy`,tt(!0))},t[266]=Si):Si=t[266];let Ci=Si,wi;t[267]===Symbol.for(`react.memo_cache_sentinel`)?(wi=function(e){let t=e.relatedTarget;t instanceof Node&&e.currentTarget.contains(t)||tt(!1)},t[267]=wi):wi=t[267];let Ti=wi,Ei;t[268]===mr?Ei=t[269]:(Ei=function(e){if(!Vu(e.nativeEvent))return;let t=Fu(e.nativeEvent);t.length!==0&&(e.preventDefault(),e.stopPropagation(),tt(!1),mr(t,``,WJ))},t[268]=mr,t[269]=Ei);let Di=Ei;if(j){let e;return t[270]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(XY,{}),t[270]=e):e=t[270],e}let Oi;t[271]!==i||t[272]!==F||t[273]!==L?(Oi=F?i(L?{id:`H-vDm3`}:{id:`09Tv5j`}):null,t[271]=i,t[272]=F,t[273]=L,t[274]=Oi):Oi=t[274];let ki=Oi;if(k.length===0){if(ki!==null){let e;return t[275]===ki?e=t[276]:(e=(0,Z.jsx)(`div`,{className:`flex flex-1 items-center justify-center py-8`,children:(0,Z.jsx)(`span`,{role:`status`,className:`select-none text-sidebar-foreground/50 text-sm`,children:ki})}),t[275]=ki,t[276]=e),e}if(N){let e;return t[277]===N?e=t[278]:(e=(0,Z.jsx)(`div`,{className:`flex flex-1 items-center justify-center py-8`,children:(0,Z.jsx)(`span`,{role:`alert`,className:`select-none text-sidebar-foreground/50 text-sm`,children:N})}),t[277]=N,t[278]=e),e}let e;t[279]===i?e=t[280]:(e=i({id:`5ZB7XC`}),t[279]=i,t[280]=e);let n=et&&`bg-primary/5 ring-2 ring-primary/70 ring-inset`,r;t[281]===n?r=t[282]:(r=Y(`flex flex-1 flex-col items-center justify-center gap-3 rounded-md py-8`,n),t[281]=n,t[282]=r);let a;t[283]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Z.jsx)(`span`,{className:`select-none text-sidebar-foreground/30 text-sm`,children:(0,Z.jsx)(J,{id:`xiv-dW`})}),t[283]=a):a=t[283];let o;t[284]===yr?o=t[285]:(o=()=>yr(`file`,``),t[284]=yr,t[285]=o);let s;t[286]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Z.jsx)(J,{id:`6ibbCg`}),t[286]=s):s=t[286];let c;t[287]===o?c=t[288]:(c=(0,Z.jsx)(X,{variant:`link`,size:`sm`,className:`font-mono uppercase`,onClick:o,children:s}),t[287]=o,t[288]=c);let l;return t[289]!==Di||t[290]!==e||t[291]!==r||t[292]!==c?(l=(0,Z.jsxs)(`section`,{"aria-label":e,className:r,onDragOver:Ci,onDragLeave:Ti,onDrop:Di,children:[a,c]}),t[289]=Di,t[290]=e,t[291]=r,t[292]=c,t[293]=l):l=t[293],l}let Ai=V!==null,ji=U?.targets[0]??null,Mi=null;if(z!==null){let e;if(t[294]!==a.locale||t[295]!==z){let n=new Intl.NumberFormat(a.locale).format(z);e=Yc._({id:`LuoJWu`,values:{truncatedShownCount:z,formattedCount:n}}),t[294]=a.locale,t[295]=z,t[296]=e}else e=t[296];Mi=e}let Ni;t[297]!==N||t[298]!==ki||t[299]!==Mi?(Ni=(N||ki!==null||Mi!==null)&&(0,Z.jsxs)(Z.Fragment,{children:[ki===null?N&&(0,Z.jsx)(QY,{kind:`error`,children:N}):(0,Z.jsx)(QY,{kind:`reconnecting`,children:ki}),Mi!==null&&(0,Z.jsx)(QY,{kind:`info`,children:Mi})]}),t[297]=N,t[298]=ki,t[299]=Mi,t[300]=Ni):Ni=t[300];let Pi;t[301]===y?Pi=t[302]:(Pi=eq(y),t[301]=y,t[302]=Pi);let Fi=ae?``:void 0,Ii;t[303]===Fi?Ii=t[304]:(Ii={[qJ]:Fi},t[303]=Fi,t[304]=Ii);let Li;t[305]!==Ai||t[306]!==ye||t[307]!==Cr||t[308]!==k||t[309]!==xr||t[310]!==Qt||t[311]!==Cn||t[312]!==Ot||t[313]!==jt||t[314]!==Ut||t[315]!==kt||t[316]!==At||t[317]!==yr||t[318]!==re?(Li=(e,t)=>(0,Z.jsx)(dY,{item:e,context:t,anyActionBusy:Ai,workspace:re,handoff:Ot,model:Ut,okignoreBinding:kt,projectLocalBinding:At,mergedConfig:jt,onStartCreating:yr,onCreateFromTemplate:(e,t)=>yr(`file`,e,{template:t}),onDuplicate:Cn,onDelete:e=>W({targets:e}),onExpandSubtree:xr,onCollapseSubtree:Cr,folderTreePaths:Qt,isAsset:ye.has(e.path),documents:k}),t[305]=Ai,t[306]=ye,t[307]=Cr,t[308]=k,t[309]=xr,t[310]=Qt,t[311]=Cn,t[312]=Ot,t[313]=jt,t[314]=Ut,t[315]=kt,t[316]=At,t[317]=yr,t[318]=re,t[319]=Li):Li=t[319];let Ri;t[320]!==xi||t[321]!==yi||t[322]!==Ut||t[323]!==Ni||t[324]!==Pi||t[325]!==Ii||t[326]!==Li?(Ri=(0,Z.jsx)(`div`,{ref:Je,className:`flex min-h-0 flex-1 flex-col`,children:(0,Z.jsx)(JK,{header:Ni,model:Ut,style:Pi,...Ii,onClickCapture:xi,onMouseMove:yi,onMouseLeave:mi,renderContextMenu:Li})}),t[320]=xi,t[321]=yi,t[322]=Ut,t[323]=Ni,t[324]=Pi,t[325]=Ii,t[326]=Li,t[327]=Ri):Ri=t[327];let zi=!!U,Bi;t[328]===V?Bi=t[329]:(Bi=e=>{!e&&!V&&W(null)},t[328]=V,t[329]=Bi);let Vi;t[330]!==i||t[331]!==V||t[332]!==U||t[333]!==$r||t[334]!==ji?(Vi=U&&ji&&(0,Z.jsx)(ba,{...(()=>{let e=Pq(typeof window<`u`&&window.okDesktop!=null?`electron`:`web`,U.targets);if(e)return{customTitle:e.title,customDescription:``,customDetail:e.detail,customConfirmLabel:e.confirmLabel,customConfirmLabelBusy:e.confirmLabelBusy,children:e.listedTargets?(0,Z.jsx)(`ul`,{className:`flex flex-col gap-1 font-mono text-foreground text-xs`,children:e.listedTargets.map(_Y)}):null};let t=U.targets.length,n=ji.name;return{itemName:t===1?ji.kind===`folder`?`${ji.name}/`:ji.kind===`file`?`${ji.name}${ji.docExt??`.md`}`:ji.name:void 0,customTitle:t>1?i({id:`abiHje`}):void 0,customDescription:t>1?i({id:`WMIKXK`,values:{targetCount:t}}):ji.kind===`folder`?i({id:`a5W0q0`,values:{folderName:n}}):void 0}})(),isSubmitting:V!==null,onDelete:()=>$r(U.targets)}),t[330]=i,t[331]=V,t[332]=U,t[333]=$r,t[334]=ji,t[335]=Vi):Vi=t[335];let Hi;t[336]!==zi||t[337]!==Bi||t[338]!==Vi?(Hi=(0,Z.jsx)(Ws,{open:zi,onOpenChange:Bi,children:Vi}),t[336]=zi,t[337]=Bi,t[338]=Vi,t[339]=Hi):Hi=t[339];let Ui=!!G,Wi;t[340]===V?Wi=t[341]:(Wi=e=>{!e&&!V&&K(null)},t[340]=V,t[341]=Wi);let Gi;t[342]!==V||t[343]!==ti||t[344]!==ri||t[345]!==G?(Gi=G&&(0,Z.jsx)(Hq,{failedTargets:G.failed,isSubmitting:V!==null,onDeletePermanently:ti,onRetry:ri,onCancel:()=>K(null)}),t[342]=V,t[343]=ti,t[344]=ri,t[345]=G,t[346]=Gi):Gi=t[346];let Ki;t[347]!==Ui||t[348]!==Wi||t[349]!==Gi?(Ki=(0,Z.jsx)(Ws,{open:Ui,onOpenChange:Wi,children:Gi}),t[347]=Ui,t[348]=Wi,t[349]=Gi,t[350]=Ki):Ki=t[350];let qi=te!==null,Ji;t[351]===Symbol.for(`react.memo_cache_sentinel`)?(Ji=e=>{e||ne(null)},t[351]=Ji):Ji=t[351];let Yi=te?.parentDir??``,Xi;t[352]!==qi||t[353]!==Yi?(Xi=(0,Z.jsx)(_h,{open:qi,onOpenChange:Ji,kind:`file`,initialDir:Yi,defaultToTemplate:!0}),t[352]=qi,t[353]=Yi,t[354]=Xi):Xi=t[354];let Zi;return t[355]!==Ri||t[356]!==Hi||t[357]!==Ki||t[358]!==Xi?(Zi=(0,Z.jsxs)(Z.Fragment,{children:[Ri,Hi,Ki,Xi]}),t[355]=Ri,t[356]=Hi,t[357]=Ki,t[358]=Xi,t[359]=Zi):Zi=t[359],Zi}function _Y(e){return(0,Z.jsx)(`li`,{"data-testid":`delete-target-row`,children:Fq(e)},`${e.kind}:${e.path}`)}function vY(e){return`${e.kind}:${e.path}`}function yY(e){return`${e.kind}:${e.path}`}function bY(e){return e.path}function xY(e){return e.kind===`folder`}function SY(e){return e.path}function CY(e){return e.kind===`file`}function wY(e){return e.file}function TY(e){return je(e)}function EY(e){return h(e)}function DY(e){return Zt(e)}function OY(e){return e.path}function kY(e){return e.kind===`asset`}function AY(e){return e.endsWith(`/`)?e.slice(0,-1):e}function jY(e){return!!e}function MY(e){console.warn(`[FileTree] /api/workspace fetch failed:`,e)}function NY(e){console.warn(`[FileTree] unmount cleanup failed:`,e)}function PY(e){bs.error(e)}function FY(){}function IY(e){return bs.error(e)}function LY(){}function RY(){}function zY(){}function BY(){}function VY(){}async function HY(){}function UY(e){return Pu(e)}function WY(e){return GY(e)?.dataset.itemPath??null}function GY(e){for(let t of e.composedPath())if(t instanceof HTMLElement&&t.dataset.itemPath)return t;return null}function KY(e){for(let t of e.composedPath())if(t instanceof HTMLElement&&t.matches(`[data-file-tree-virtualized-root]`))return t;return null}function qY(e){let t=GY(e);if(t){let e=t.dataset.itemPath;if(!e)return null;let n=t.dataset.itemType===`folder`,r=Iu(e,n);return{parentDir:r,row:t,root:null,busyPath:n?Wu(r):e}}return JY(e)?{parentDir:``,row:null,root:KY(e),busyPath:WJ}:null}function JY(e){for(let t of e.composedPath())if(t instanceof HTMLElement&&t.matches(`[data-file-tree-virtualized-scroll]`))return!0;return!1}var YY=[`w-3/4`,`w-2/3`,`w-4/5`,`w-1/2`,`w-3/5`,`w-2/3`];function XY(){let e=(0,$.c)(5),{_:t}=an(),n;e[0]===t?n=e[1]:(n=t({id:`5Tk8Fb`}),e[0]=t,e[1]=n);let r;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=YY.map(ZY),e[2]=r):r=e[2];let i;return e[3]===n?i=e[4]:(i=(0,Z.jsx)(`div`,{className:`flex flex-1 flex-col gap-1 px-2 py-2`,role:`status`,"aria-busy":`true`,"aria-label":n,children:r}),e[3]=n,e[4]=i),i}function ZY(e,t){return(0,Z.jsxs)(`div`,{className:`flex h-6 items-center gap-2`,children:[(0,Z.jsx)(Ga,{className:`h-3 w-3 shrink-0 rounded-sm`}),(0,Z.jsx)(Ga,{className:`h-3 ${e}`})]},t)}function QY(e){let t=(0,$.c)(14),{kind:n,children:r}=e,i=n===`error`?ds:n===`reconnecting`?os:rs,a=n===`error`?`alert`:`status`,o=n===`error`?`text-destructive`:`text-muted-foreground`,s;t[0]===o?s=t[1]:(s=Y(`mx-2 mb-1 flex items-start gap-1.5 rounded-md bg-muted/50 px-2 py-1.5 text-xs leading-snug`,o),t[0]=o,t[1]=s);let c=n===`reconnecting`&&`animate-spin motion-reduce:animate-none`,l;t[2]===c?l=t[3]:(l=Y(`mt-0.5 size-3.5 shrink-0`,c),t[2]=c,t[3]=l);let u;t[4]!==i||t[5]!==l?(u=(0,Z.jsx)(i,{"aria-hidden":`true`,className:l}),t[4]=i,t[5]=l,t[6]=u):u=t[6];let d;t[7]===r?d=t[8]:(d=(0,Z.jsx)(`span`,{className:`min-w-0`,children:r}),t[7]=r,t[8]=d);let f;return t[9]!==a||t[10]!==s||t[11]!==u||t[12]!==d?(f=(0,Z.jsxs)(`span`,{role:a,className:s,children:[u,d]}),t[9]=a,t[10]=s,t[11]=u,t[12]=d,t[13]=f):f=t[13],f}function $Y(e){return e?Yc._({id:`wTcjov`}):null}function eX(e){let t=(0,$.c)(23),{_:n}=an(),r=ga(),i=wa();if(r)return null;let{input:a,installStates:o,dispatch:s}=e,c=a===null,l,u,d,f,p,m;if(t[0]!==n||t[1]!==s||t[2]!==a||t[3]!==c||t[4]!==o||t[5]!==i){m=Symbol.for(`react.early_return_sentinel`);bb0:{let e=$Y(c),r;t[12]===o?r=t[13]:(r=e=>o[e.id]?.installed===!0,t[12]=o,t[13]=r);let h=oa.filter(r),g=h.length>0,_=i!==null;if(!g&&!_){m=null;break bb0}u=uP,t[14]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Z.jsxs)(pP,{children:[(0,Z.jsx)(ss,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`O7_W_a`})]}),t[14]=p):p=t[14],l=mP,d=_?(0,Z.jsxs)(lP,{"aria-label":n({id:`ALhMYW`}),children:[(0,Z.jsx)(gP,{children:(0,Z.jsx)(J,{id:`ALhMYW`})}),Ca.map(t=>{let{displayName:r}=mi[t];return(0,Z.jsxs)(fP,{onSelect:()=>{a!==null&&i.launchInTerminal(a,t)},disabled:c,"data-testid":`empty-space-open-in-terminal-${t}`,"aria-label":n(e?{id:`AIn2Yv`,values:{displayName:r,hint:e}}:{id:`QYfQdv`,values:{displayName:r}}),children:[(0,Z.jsx)(fa,{id:da(t),"aria-hidden":`true`}),(0,Z.jsx)(`span`,{className:`flex-1`,children:r}),e?(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:e}):null]},t)})]}):null,f=g?(0,Z.jsxs)(Z.Fragment,{children:[_?(0,Z.jsx)(_P,{}):null,(0,Z.jsxs)(lP,{"aria-label":n({id:`BBqGS9`}),children:[(0,Z.jsx)(gP,{children:(0,Z.jsx)(J,{id:`BBqGS9`})}),h.map(t=>{let r=!c,{displayName:i}=t,o=n(e?{id:`1ZpfyB`,values:{displayName:i,hint:e}}:{id:`WqLq6M`,values:{displayName:i}});return(0,Z.jsxs)(fP,{disabled:!r,onSelect:()=>{a&&s(t.id,a)},"data-testid":`empty-space-open-in-${t.id}`,"aria-label":o,children:[(0,Z.jsx)(fa,{id:t.id,"aria-hidden":`true`}),(0,Z.jsx)(`span`,{className:`flex-1`,children:t.displayName}),e?(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:e}):null]},t.id)})]})]}):null}t[0]=n,t[1]=s,t[2]=a,t[3]=c,t[4]=o,t[5]=i,t[6]=l,t[7]=u,t[8]=d,t[9]=f,t[10]=p,t[11]=m}else l=t[6],u=t[7],d=t[8],f=t[9],p=t[10],m=t[11];if(m!==Symbol.for(`react.early_return_sentinel`))return m;let h;t[15]!==l||t[16]!==d||t[17]!==f?(h=(0,Z.jsxs)(l,{children:[d,f]}),t[15]=l,t[16]=d,t[17]=f,t[18]=h):h=t[18];let g;return t[19]!==u||t[20]!==p||t[21]!==h?(g=(0,Z.jsxs)(u,{children:[p,h]}),t[19]=u,t[20]=p,t[21]=h,t[22]=g):g=t[22],g}async function tX(e){try{let t=await e.project.listRecent(),n=e.config.projectPath;return t.some(e=>e.path!==n)?!1:await aT()===0}catch(e){return console.warn(`[onboarding-card-visible] fresh-project probe failed; suppressing card`,e),!1}}function nX(e){let t=(0,$.c)(4),n=e===void 0?tT:e,{initialized:r,dismissed:i,completed:a}=(0,Q.useSyncExternalStore)(n.subscribe,n.getSnapshot,n.getSnapshot),o=i||a,s=!r&&!o,c,l;return t[0]!==s||t[1]!==n?(c=()=>{if(!s)return;let e=window.okDesktop;if(e==null)return;let t=!1;return tX(e).then(e=>{!t&&e&&n.activate()}),()=>{t=!0}},l=[s,n],t[0]=s,t[1]=n,t[2]=c,t[3]=l):(c=t[2],l=t[3]),(0,Q.useEffect)(c,l),r&&!o}function rX(e){let t=(0,$.c)(3),n=e===void 0?tT:e,r,i;t[0]===n?(r=t[1],i=t[2]):(r=()=>{if(n.getSnapshot().steps.file)return;let e=ml(e=>{e.includes(`files`)&&oT(n)});return oT(n),e},i=[n],t[0]=n,t[1]=r,t[2]=i),(0,Q.useEffect)(r,i)}var iX=3,aX=5200,oX=1500,sX=220;function cX(e){let t=(0,$.c)(14),{complete:n,label:r,shortcutId:i}=e,a;t[0]===n?a=t[1]:(a=(0,Z.jsx)(tc,{checked:n,disabled:!0,"aria-hidden":!0,tabIndex:-1,className:`pointer-events-none opacity-100 disabled:opacity-100`}),t[0]=n,t[1]=a);let o=n?`flex-1 text-muted-foreground/60`:`flex-1`,s;t[2]===n?s=t[3]:(s=n?(0,Z.jsxs)(`span`,{className:`sr-only`,children:[(0,Z.jsx)(J,{id:`Qj4RL5`}),` `]}):null,t[2]=n,t[3]=s);let c;t[4]!==r||t[5]!==o||t[6]!==s?(c=(0,Z.jsxs)(`span`,{className:o,children:[s,r]}),t[4]=r,t[5]=o,t[6]=s,t[7]=c):c=t[7];let l;t[8]===i?l=t[9]:(l=i?(0,Z.jsx)(F,{children:Nl(i)}):null,t[8]=i,t[9]=l);let u;return t[10]!==a||t[11]!==c||t[12]!==l?(u=(0,Z.jsxs)(`li`,{className:`flex items-center gap-2 py-0.5 text-sm`,children:[a,c,l]}),t[10]=a,t[11]=c,t[12]=l,t[13]=u):u=t[13],u}function lX(e){let t=(0,$.c)(24),{store:n,lingerMs:r}=e,i=n===void 0?tT:n,a=r===void 0?aX:r,{_:o}=an(),{steps:s}=nT(i);rX(i);let[c,l]=(0,Q.useState)(0),[u,d]=(0,Q.useState)(!1),f=1+ +!!s.file+ +!!s.askedAi,p=f===iX,m,h;t[0]!==p||t[1]!==a?(m=()=>{if(!p)return;l(dX);let e=setInterval(()=>l(uX),oX),t=setTimeout(()=>{clearInterval(e),d(!0)},a);return()=>{clearInterval(e),clearTimeout(t)}},h=[p,a],t[0]=p,t[1]=a,t[2]=m,t[3]=h):(m=t[2],h=t[3]),(0,Q.useEffect)(m,h);let g,_;t[4]!==u||t[5]!==i?(g=()=>{if(!u)return;let e=setTimeout(()=>i.markCompleted(),sX);return()=>clearTimeout(e)},_=[u,i],t[4]=u,t[5]=i,t[6]=g,t[7]=_):(g=t[6],_=t[7]),(0,Q.useEffect)(g,_);let v;t[8]!==o||t[9]!==p?(v=p?o({id:`7jIIFX`}):``,t[8]=o,t[9]=p,t[10]=v):v=t[10];let y;t[11]===v?y=t[12]:(y=(0,Z.jsx)(`div`,{className:`sr-only`,role:`status`,"aria-live":`polite`,children:v}),t[11]=v,t[12]=y);let b;t[13]!==p||t[14]!==c||t[15]!==f||t[16]!==u||t[17]!==s.askedAi||t[18]!==s.file||t[19]!==i?(b=p?(0,Z.jsxs)(`section`,{"aria-hidden":!0,className:Y(`mx-2 mb-1 flex items-center gap-3 rounded-lg border bg-card px-4 py-3 text-card-foreground`,`motion-reduce:animate-none motion-reduce:duration-0`,u?`animate-out fade-out-0 zoom-out-95 fill-mode-forwards duration-200`:`animate-in fade-in-0 zoom-in-95 duration-300`),children:[(0,Z.jsx)(CS,{size:36,celebrateSignal:c}),(0,Z.jsx)(`span`,{className:`font-medium text-sm`,children:(0,Z.jsx)(J,{id:`7jIIFX`})})]}):(0,Z.jsxs)(`section`,{"aria-labelledby":`onboarding-card-heading`,className:`mx-2 mb-1 rounded-lg border bg-card px-4 py-3 text-card-foreground`,children:[(0,Z.jsxs)(`header`,{className:`mb-3 flex items-center justify-between`,children:[(0,Z.jsx)(`h2`,{id:`onboarding-card-heading`,className:`font-medium text-sm`,children:(0,Z.jsx)(J,{id:`Y1QMlM`})}),(0,Z.jsx)(`span`,{className:`text-muted-foreground/60 text-xs tabular-nums`,children:`${f} / ${iX}`})]}),(0,Z.jsxs)(`ul`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(cX,{complete:!0,label:(0,Z.jsx)(J,{id:`4E9jPa`})}),(0,Z.jsx)(cX,{complete:s.file,label:(0,Z.jsx)(J,{id:`6ibbCg`}),shortcutId:`new-item`}),(0,Z.jsx)(cX,{complete:s.askedAi,label:(0,Z.jsx)(J,{id:`xWEvuo`}),shortcutId:`open-ask-ai`})]}),(0,Z.jsx)(`footer`,{className:`-mb-1 mt-2 flex justify-end`,children:(0,Z.jsx)(X,{type:`button`,variant:`ghost`,size:`sm`,className:`h-auto px-2 py-1 text-muted-foreground text-xs`,onClick:()=>i.dismiss(),children:(0,Z.jsx)(J,{id:`1QfxQT`})})})]}),t[13]=p,t[14]=c,t[15]=f,t[16]=u,t[17]=s.askedAi,t[18]=s.file,t[19]=i,t[20]=b):b=t[20];let x;return t[21]!==y||t[22]!==b?(x=(0,Z.jsxs)(Z.Fragment,{children:[y,b]}),t[21]=y,t[22]=b,t[23]=x):x=t[23],x}function uX(e){return e+1}function dX(e){return e+1}function fX(){let e=(0,$.c)(1);if(!nX())return null;let t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Z.jsx)(lX,{}),e[0]=t):t=e[0],t}function pX(e){return e===null?null:e.kind===`local`?e.name:e.ref}function mX(e,t){if(e.length===0)return null;let n=`origin/${e}`;return t.includes(n)?n:t.find(t=>pi(t)===e)??null}function hX(e){switch(e){case`branch-exists`:return{id:`wzq9Rv`};case`already-checked-out`:return{id:`ljHjfg`};case`path-exists`:return{id:`mYzDD_`};case`invalid-branch`:return{id:`r-OJYm`};case`no-git`:return{id:`CFnavk`};default:return{id:`-zA2E7`}}}function gX(e){let t=(0,$.c)(71),{open:n,onOpenChange:r,bridge:i,currentBranch:a,branches:o,existingWorktreeBranches:s,remoteBranches:c,behindByBranch:l,initialBranchName:u}=e,d=o===void 0?[]:o,f=c===void 0?[]:c,p=u===void 0?``:u,{_:m}=an(),h=(0,Q.useId)(),g=(0,Q.useId)(),_=(0,Q.useId)(),v=(0,Q.useId)(),y=(0,Q.useId)(),b=(0,Q.useId)(),[x,S]=(0,Q.useState)(``),C;t[0]===a?C=t[1]:(C=a===null?null:{kind:`local`,name:a},t[0]=a,t[1]=C);let[w,T]=(0,Q.useState)(C),[E,D]=(0,Q.useState)(!1),[k,A]=(0,Q.useState)(``),[j,M]=(0,Q.useState)(!1),[N,P]=(0,Q.useState)(null),F=(0,Q.useRef)(null),I=(0,Q.useRef)(null),L,R;t[2]!==a||t[3]!==p||t[4]!==n?(L=()=>{if(!n)return;S(p),T(a===null?null:{kind:`local`,name:a}),D(!1),A(``),M(!1),P(null);let e=requestAnimationFrame(()=>F.current?.focus());return()=>cancelAnimationFrame(e)},R=[n,a,p],t[2]=a,t[3]=p,t[4]=n,t[5]=L,t[6]=R):(L=t[5],R=t[6]),(0,Q.useEffect)(L,R);let z=x.trim(),B=!j&&z.length>0,V=z.length>0&&d.includes(z),H=V?null:mX(z,f),U=H!==null,W=V||U,G=V&&(s?.has(z)??!1),K=d.filter(e=>e.toLowerCase().startsWith(z.toLowerCase())),ee=!j&&K.length>0&&!W,te=(a!==null&&!d.includes(a)?[a,...d]:d).map(xX),ne=f.map(bX),re=pX(w),ie=k.trim().toLowerCase(),ae=ie===``?te:te.filter(e=>e.name.toLowerCase().includes(ie)),oe=ie===``?ne:ne.filter(e=>e.ref.toLowerCase().includes(ie)),se=ie!==``&&ae.length===0&&oe.length===0,ce=async function(e){if(e.preventDefault(),B){M(!0),P(null);try{let e=U?{branch:z,createBranch:!0,remoteRef:H}:V?{branch:z,createBranch:!1}:{branch:z,createBranch:!0,baseBranch:w?.kind===`local`?w.name:void 0,baseRef:w?.kind===`remote`?w.ref:void 0},t=await i.worktree.create(e);if(!t.ok){P(hX(t.reason)),M(!1);return}ig(),r(!1),await i.project.open({path:t.path,target:`new-window`,entryPoint:`worktree`})}catch(e){console.warn(`[NewWorktreeDialog] worktree create/open failed:`,e),bs.error(m({id:`vAYoCZ`})),M(!1)}}},le=Ws,q;t[7]!==j||t[8]!==r?(q=e=>{j||r(e)},t[7]=j,t[8]=r,t[9]=q):q=t[9];let ue=Bs,de;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(de=(0,Z.jsx)(zs,{children:(0,Z.jsx)(J,{id:`DXd9LM`})}),t[10]=de):de=t[10];let fe;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(fe=(0,Z.jsxs)(Us,{children:[de,(0,Z.jsx)(Rs,{children:(0,Z.jsx)(J,{id:`NEzPEh`})})]}),t[11]=fe):fe=t[11];let pe=Vs,me;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(me=(0,Z.jsx)(J,{id:`ng2Ibo`}),t[12]=me):me=t[12];let he;t[13]===g?he=t[14]:(he=(0,Z.jsx)(Lc,{htmlFor:g,children:me}),t[13]=g,t[14]=he);let _e;t[15]===m?_e=t[16]:(_e=m({id:`IX_uXB`}),t[15]=m,t[16]=_e);let ve;t[17]===N?ve=t[18]:(ve=e=>{S(e.target.value),N!==null&&P(null)},t[17]=N,t[18]=ve);let ye=N!==null,be=N===null?y:`${y} ${b}`,xe;t[19]!==x||t[20]!==j||t[21]!==g||t[22]!==_e||t[23]!==ve||t[24]!==ye||t[25]!==be?(xe=(0,Z.jsx)(qc,{id:g,ref:F,value:x,placeholder:_e,onChange:ve,disabled:j,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-invalid":ye,"aria-describedby":be,"data-testid":`new-worktree-branch`}),t[19]=x,t[20]=j,t[21]=g,t[22]=_e,t[23]=ve,t[24]=ye,t[25]=be,t[26]=xe):xe=t[26];let Se=z.length>0?(0,Z.jsxs)(`p`,{id:y,className:`flex items-start gap-1.5 text-1sm text-muted-foreground`,"data-testid":G?`new-worktree-mode-existing-worktree`:U?`new-worktree-mode-remote-checkout`:V?`new-worktree-mode-checkout`:`new-worktree-mode-create`,children:[G?(0,Z.jsx)(Bo,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0 text-amber-600 dark:text-amber-400`}):U?(0,Z.jsx)(ro,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0 text-violet-600 dark:text-violet-400`}):V?(0,Z.jsx)(Ji,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0 text-blue-600 dark:text-blue-400`}):(0,Z.jsx)(ge,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0 text-green-600 dark:text-green-400`}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1`,children:G?(0,Z.jsx)(J,{id:`QAi7Q9`,values:{trimmed:z},components:{0:(0,Z.jsx)(`code`,{className:`font-mono break-words`})}}):U?(0,Z.jsx)(J,{id:`oAGN8p`,values:{remoteCheckoutRef:H,trimmed:z},components:{0:(0,Z.jsx)(`code`,{className:`font-mono break-words`}),1:(0,Z.jsx)(`code`,{className:`font-mono break-words`}),2:(0,Z.jsx)(`code`,{className:`font-mono`})}}):V?(0,Z.jsx)(J,{id:`b4VvP-`,values:{trimmed:z},components:{0:(0,Z.jsx)(`code`,{className:`font-mono break-words`}),1:(0,Z.jsx)(`code`,{className:`font-mono`})}}):re===null?(0,Z.jsx)(J,{id:`t4sFKC`,values:{trimmed:z},components:{0:(0,Z.jsx)(`code`,{className:`font-mono break-words`}),1:(0,Z.jsx)(`code`,{className:`font-mono`})}}):(0,Z.jsx)(J,{id:`dGAdpH`,values:{trimmed:z,currentBaseLabel:re},components:{0:(0,Z.jsx)(`code`,{className:`font-mono break-words`}),1:(0,Z.jsx)(`code`,{className:`font-mono break-words`}),2:(0,Z.jsx)(`code`,{className:`font-mono`})}})})]}):null,Ce=ee?(0,Z.jsx)(`div`,{className:`max-h-40 overflow-y-auto rounded-md border bg-popover p-1 shadow-xs`,"data-testid":`new-worktree-branch-list`,children:K.map(e=>(0,Z.jsxs)(X,{type:`button`,variant:`ghost`,size:`sm`,tabIndex:-1,onClick:()=>{S(e),N!==null&&P(null),F.current?.focus()},"data-testid":`new-worktree-branch-option-${e}`,className:`h-8 w-full justify-start gap-2 font-normal`,children:[(0,Z.jsx)(Vo,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-left`,children:e})]},e))}):null,we=W?null:(0,Z.jsxs)(`div`,{className:`mt-1 flex flex-col gap-2`,children:[(0,Z.jsx)(Lc,{id:v,htmlFor:_,children:(0,Z.jsx)(J,{id:`ZWwYwM`})}),(0,Z.jsxs)(Ne,{open:E,onOpenChange:e=>{D(e),e||A(``)},children:[(0,Z.jsx)(Ie,{asChild:!0,children:(0,Z.jsxs)(X,{id:_,type:`button`,variant:`outline`,role:`combobox`,"aria-expanded":E,"aria-haspopup":`listbox`,"aria-labelledby":`${v} ${_}`,"aria-label":m({id:`ZWwYwM`}),disabled:j,"data-testid":`new-worktree-base-trigger`,className:`w-full justify-between font-normal`,children:[(0,Z.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[w?.kind===`remote`?(0,Z.jsx)(ro,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`}):(0,Z.jsx)(Vo,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,Z.jsx)(`span`,{className:`min-w-0 truncate text-left`,children:re===null?(0,Z.jsx)(J,{id:`EbjWsS`}):re})]}),(0,Z.jsx)(Dd,{"aria-hidden":`true`,className:`ml-2 size-4 shrink-0 opacity-50`})]})}),(0,Z.jsxs)(Ut,{align:`start`,className:`w-[var(--radix-popover-trigger-width)] p-1`,onWheel:yX,onTouchMove:vX,onOpenAutoFocus:e=>{e.preventDefault(),I.current?.focus()},children:[(0,Z.jsxs)(qC,{className:`mb-1 h-8`,children:[(0,Z.jsx)(QC,{ref:I,"aria-label":m({id:`fuJZKk`}),placeholder:m({id:`hQXiDc`}),value:k,onChange:e=>A(e.target.value),onKeyDown:_X,"data-testid":`new-worktree-base-search`}),(0,Z.jsx)(YC,{children:(0,Z.jsx)(O,{"aria-hidden":`true`})})]}),(0,Z.jsxs)(`div`,{role:`listbox`,"aria-label":m({id:`ZWwYwM`}),className:`max-h-56 overflow-y-auto`,"data-testid":`new-worktree-base-list`,children:[se?(0,Z.jsx)(`p`,{className:`px-2 py-1.5 text-1sm text-muted-foreground`,children:(0,Z.jsx)(J,{id:`Sh3Qkg`})}):null,ae.map(e=>{let t=e.name,n=l?.get(t);return(0,Z.jsxs)(X,{type:`button`,role:`option`,"aria-selected":w?.kind===`local`&&w.name===t,variant:`ghost`,size:`sm`,onClick:()=>{T(e),D(!1),A(``)},"data-testid":`new-worktree-base-option-${t}`,className:`h-8 w-full justify-start gap-2 font-normal`,children:[(0,Z.jsx)(Vo,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-left`,children:t}),n!==void 0&&n>0?(0,Z.jsx)(`span`,{className:`shrink-0 text-xs text-amber-600 dark:text-amber-400`,"data-testid":`new-worktree-base-behind-${t}`,children:(0,Z.jsx)(J,{id:`6-wLTJ`,values:{behind:n}})}):null]},`local:${t}`)}),oe.map(e=>{let t=e.ref;return(0,Z.jsxs)(X,{type:`button`,role:`option`,"aria-selected":w?.kind===`remote`&&w.ref===t,variant:`ghost`,size:`sm`,onClick:()=>{T(e),D(!1),A(``)},"data-testid":`new-worktree-base-option-${t}`,className:`h-8 w-full justify-start gap-2 font-normal`,children:[(0,Z.jsx)(ro,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-left`,children:t}),(0,Z.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground`,children:(0,Z.jsx)(J,{id:`dIYSqk`})})]},`remote:${t}`)})]})]})]})]}),Te;t[27]!==m||t[28]!==N||t[29]!==b?(Te=N===null?null:(0,Z.jsx)(`p`,{id:b,role:`alert`,className:`text-1sm text-destructive`,"data-testid":`new-worktree-error`,children:m(N)}),t[27]=m,t[28]=N,t[29]=b,t[30]=Te):Te=t[30];let Ee;t[31]!==h||t[32]!==ce||t[33]!==he||t[34]!==xe||t[35]!==Se||t[36]!==Ce||t[37]!==we||t[38]!==Te?(Ee=(0,Z.jsxs)(`form`,{id:h,onSubmit:ce,className:`flex flex-col gap-2`,children:[he,xe,Se,Ce,we,Te]}),t[31]=h,t[32]=ce,t[33]=he,t[34]=xe,t[35]=Se,t[36]=Ce,t[37]=we,t[38]=Te,t[39]=Ee):Ee=t[39];let De;t[40]!==pe||t[41]!==Ee?(De=(0,Z.jsx)(pe,{children:Ee}),t[40]=pe,t[41]=Ee,t[42]=De):De=t[42];let Oe;t[43]===r?Oe=t[44]:(Oe=()=>r(!1),t[43]=r,t[44]=Oe);let ke;t[45]===Symbol.for(`react.memo_cache_sentinel`)?(ke=(0,Z.jsx)(J,{id:`dEgA5A`}),t[45]=ke):ke=t[45];let Ae;t[46]!==j||t[47]!==Oe?(Ae=(0,Z.jsx)(X,{type:`button`,variant:`outline`,onClick:Oe,disabled:j,"data-testid":`new-worktree-cancel`,children:ke}),t[46]=j,t[47]=Oe,t[48]=Ae):Ae=t[48];let je=!B,Me;t[49]!==j||t[50]!==G||t[51]!==V||t[52]!==U?(Me=j?(0,Z.jsx)(J,{id:`b4itZn`}):G?(0,Z.jsx)(J,{id:`XV5sC0`}):U?(0,Z.jsx)(J,{id:`XAyxsa`}):V?(0,Z.jsx)(J,{id:`uGaIIS`}):(0,Z.jsx)(J,{id:`iO8V-7`}),t[49]=j,t[50]=G,t[51]=V,t[52]=U,t[53]=Me):Me=t[53];let Pe;t[54]!==h||t[55]!==je||t[56]!==Me?(Pe=(0,Z.jsx)(X,{type:`submit`,form:h,disabled:je,"data-testid":`new-worktree-create`,children:Me}),t[54]=h,t[55]=je,t[56]=Me,t[57]=Pe):Pe=t[57];let Fe;t[58]!==Ae||t[59]!==Pe?(Fe=(0,Z.jsxs)(Hs,{children:[Ae,Pe]}),t[58]=Ae,t[59]=Pe,t[60]=Fe):Fe=t[60];let Le;t[61]!==ue||t[62]!==fe||t[63]!==De||t[64]!==Fe?(Le=(0,Z.jsxs)(ue,{className:`sm:max-w-md`,"data-testid":`new-worktree-dialog`,children:[fe,De,Fe]}),t[61]=ue,t[62]=fe,t[63]=De,t[64]=Fe,t[65]=Le):Le=t[65];let Re;return t[66]!==le||t[67]!==n||t[68]!==Le||t[69]!==q?(Re=(0,Z.jsx)(le,{open:n,onOpenChange:q,children:Le}),t[66]=le,t[67]=n,t[68]=Le,t[69]=q,t[70]=Re):Re=t[70],Re}function _X(e){return e.stopPropagation()}function vX(e){e.stopPropagation()}function yX(e){e.stopPropagation()}function bX(e){return{kind:`remote`,ref:e}}function xX(e){return{kind:`local`,name:e}}function SX(e){let t=(0,$.c)(51),{bridge:n,recents:r,currentPath:i,query:a,worktreeModel:o,closeMenu:s,guardStaleSelect:c,flyoutPath:l,setFlyoutPath:u,openNewWorktreeWith:d}=e,{_:f}=an(),p;t[0]!==f||t[1]!==n.project||t[2]!==s?(p=function(e,t){s(),n.project.open({path:e,target:`new-window`,entryPoint:t}).catch(e=>{console.warn(`[RecentProjectsMenu] project.open failed:`,e),bs.error(f({id:`6HCOwA`}))})},t[0]=f,t[1]=n.project,t[2]=s,t[3]=p):p=t[3];let m=p,h;t[4]!==f||t[5]!==n.project||t[6]!==n.worktree?(h=async function(e){try{let t=await n.worktree.create({branch:e,createBranch:!1});if(!t.ok){bs.error(f({id:`teD0H9`}));return}ig(),await n.project.open({path:t.path,target:`new-window`,entryPoint:`worktree`})}catch(e){console.warn(`[RecentProjectsMenu] create/open branch failed:`,e),bs.error(f({id:`LwMxXg`}))}},t[4]=f,t[5]=n.project,t[6]=n.worktree,t[7]=h):h=t[7];let g=h,_;t[8]!==s||t[9]!==i||t[10]!==m?(_=function(e){if(e.path===i){s();return}m(e.path,e.isLinkedWorktree?`worktree`:`recents`)},t[8]=s,t[9]=i,t[10]=m,t[11]=_):_=t[11];let v=_,y;t[12]!==s||t[13]!==g||t[14]!==i||t[15]!==m?(y=function(e){if(e.path!==null){if(e.path===i){s();return}m(e.path,e.isMain?`recents`:`worktree`);return}e.branch!==null&&(s(),g(e.branch))},t[12]=s,t[13]=g,t[14]=i,t[15]=m,t[16]=y):y=t[16];let b=y;if(a!==``){let e;t[17]!==s||t[18]!==g?(e=e=>{s(),g(e)},t[17]=s,t[18]=g,t[19]=e):e=t[19];let n;return t[20]!==i||t[21]!==c||t[22]!==v||t[23]!==a||t[24]!==r||t[25]!==e||t[26]!==o?(n=(0,Z.jsx)(DX,{recents:r,currentPath:i,query:a,worktreeModel:o,onPickEntry:v,onPickBranch:e,guardStaleSelect:c}),t[20]=i,t[21]=c,t[22]=v,t[23]=a,t[24]=r,t[25]=e,t[26]=o,t[27]=n):n=t[27],n}let x;if(t[28]!==s||t[29]!==i||t[30]!==l||t[31]!==c||t[32]!==b||t[33]!==d||t[34]!==m||t[35]!==r||t[36]!==u||t[37]!==o){let e=_g(r),n;t[39]!==s||t[40]!==i||t[41]!==l||t[42]!==c||t[43]!==b||t[44]!==d||t[45]!==m||t[46]!==u||t[47]!==o?(n=e=>(0,Z.jsx)(CX,{group:e,currentPath:i,worktreeModel:o,flyoutOpen:l===e.project.path,setFlyoutOpen:t=>u(n=>t?e.project.path:n===e.project.path?null:n),onPickProject:()=>{if(e.project.path===i){s();return}m(e.project.path,`recents`)},onPickFlyoutEntry:b,guardStaleSelect:c,openNewWorktreeWith:d},e.project.path),t[39]=s,t[40]=i,t[41]=l,t[42]=c,t[43]=b,t[44]=d,t[45]=m,t[46]=u,t[47]=o,t[48]=n):n=t[48],x=e.map(n),t[28]=s,t[29]=i,t[30]=l,t[31]=c,t[32]=b,t[33]=d,t[34]=m,t[35]=r,t[36]=u,t[37]=o,t[38]=x}else x=t[38];let S;return t[49]===x?S=t[50]:(S=(0,Z.jsx)(Z.Fragment,{children:x}),t[49]=x,t[50]=S),S}function CX(e){let t=(0,$.c)(34),{group:n,currentPath:r,worktreeModel:i,flyoutOpen:a,setFlyoutOpen:o,onPickProject:s,onPickFlyoutEntry:c,guardStaleSelect:l,openNewWorktreeWith:u}=e,d=n.project.path===r,f,p;t[0]!==r||t[1]!==n||t[2]!==i?(f=mg(n,i,r),p=f.filter(wX),t[0]=r,t[1]=n,t[2]=i,t[3]=f,t[4]=p):(f=t[3],p=t[4]);let m=p.length;if(m===0){let e;t[5]!==l||t[6]!==s?(e=e=>{l(e)||s()},t[5]=l,t[6]=s,t[7]=e):e=t[7];let r=`project-switcher-recent-${n.project.path}`,i=d?`true`:void 0,a;t[8]!==n.project.name||t[9]!==n.project.path||t[10]!==d?(a=(0,Z.jsx)(AX,{name:n.project.name,path:n.project.path,current:d}),t[8]=n.project.name,t[9]=n.project.path,t[10]=d,t[11]=a):a=t[11];let o;return t[12]!==e||t[13]!==r||t[14]!==i||t[15]!==a?(o=(0,Z.jsx)(Sc,{onSelect:e,className:`flex w-full min-w-0 flex-col items-start gap-0.5`,"data-testid":r,"data-current":i,children:a}),t[12]=e,t[13]=r,t[14]=i,t[15]=a,t[16]=o):o=t[16],o}let h;t[17]!==r||t[18]!==n.worktrees||t[19]!==d?(h=d||n.worktrees.some(e=>e.path===r),t[17]=r,t[18]=n.worktrees,t[19]=d,t[20]=h):h=t[20];let g=h,_;return t[21]!==g||t[22]!==r||t[23]!==f||t[24]!==a||t[25]!==n||t[26]!==l||t[27]!==c||t[28]!==s||t[29]!==u||t[30]!==m||t[31]!==o||t[32]!==i?(_=(0,Z.jsx)(TX,{group:n,currentPath:r,containsCurrent:g,worktreeModel:i,flyoutEntries:f,openedWorktreeCount:m,flyoutOpen:a,setFlyoutOpen:o,onPickProject:s,onPickFlyoutEntry:c,guardStaleSelect:l,openNewWorktreeWith:u}),t[21]=g,t[22]=r,t[23]=f,t[24]=a,t[25]=n,t[26]=l,t[27]=c,t[28]=s,t[29]=u,t[30]=m,t[31]=o,t[32]=i,t[33]=_):_=t[33],_}function wX(e){return e.opened&&!e.isMain}function TX(e){let t=(0,$.c)(46),{group:n,currentPath:r,containsCurrent:i,worktreeModel:a,flyoutEntries:o,openedWorktreeCount:s,flyoutOpen:c,setFlyoutOpen:l,onPickProject:u,onPickFlyoutEntry:d,guardStaleSelect:f,openNewWorktreeWith:p}=e,{_:m}=an(),h=n.project.path===r,g;t[0]!==f||t[1]!==u?(g=e=>{f(e)||u()},t[0]=f,t[1]=u,t[2]=g):g=t[2];let _=g,v,y;t[3]===_?(v=t[4],y=t[5]):(v=e=>{e.preventDefault(),_(e.nativeEvent)},y=e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),_(e.nativeEvent))},t[3]=_,t[4]=v,t[5]=y);let b=`project-switcher-group-${n.project.path}`,x=c?`true`:void 0,S=i?`true`:void 0,C;t[6]===n.project.name?C=t[7]:(C=(0,Z.jsx)(`span`,{className:`truncate font-medium text-sm`,title:n.project.name,children:n.project.name}),t[6]=n.project.name,t[7]=C);let w;t[8]===n.project.path?w=t[9]:(w=(0,Z.jsx)(`span`,{className:`truncate text-muted-foreground text-xs`,title:n.project.path,children:n.project.path}),t[8]=n.project.path,t[9]=w);let T;t[10]!==C||t[11]!==w?(T=(0,Z.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[C,w]}),t[10]=C,t[11]=w,t[12]=T):T=t[12];let E;t[13]!==m||t[14]!==h?(E=h?(0,Z.jsx)(Ji,{"aria-label":m({id:`Hp1l6f`}),className:`mt-0.5 size-3.5 shrink-0 text-muted-foreground`}):null,t[13]=m,t[14]=h,t[15]=E):E=t[15];let D=`project-switcher-toggle-${n.project.path}`,O;t[16]===s?O=t[17]:(O=(0,Z.jsx)(`span`,{className:`tabular-nums`,children:s}),t[16]=s,t[17]=O);let k;t[18]===s?k=t[19]:(k=(0,Z.jsx)(J,{id:`AKxFtn`,values:{openedWorktreeCount:s}}),t[18]=s,t[19]=k);let A;t[20]!==D||t[21]!==O||t[22]!==k?(A=(0,Z.jsxs)(`span`,{className:`mt-0.5 shrink-0 text-muted-foreground text-xs`,"data-testid":D,children:[O,` `,k]}),t[20]=D,t[21]=O,t[22]=k,t[23]=A):A=t[23];let j;t[24]!==E||t[25]!==A||t[26]!==v||t[27]!==y||t[28]!==b||t[29]!==x||t[30]!==S||t[31]!==T?(j=(0,Z.jsxs)(Pc,{onClick:v,onKeyDown:y,className:`flex w-full min-w-0 items-start gap-2`,"data-testid":b,"data-flyout-open":x,"data-current":S,children:[T,E,A]}),t[24]=E,t[25]=A,t[26]=v,t[27]=y,t[28]=b,t[29]=x,t[30]=S,t[31]=T,t[32]=j):j=t[32];let M;t[33]!==o||t[34]!==c||t[35]!==n||t[36]!==f||t[37]!==d||t[38]!==p||t[39]!==a?(M=(0,Z.jsx)(EX,{group:n,open:c,worktreeModel:a,entries:o,onPickFlyoutEntry:d,guardStaleSelect:f,openNewWorktreeWith:p}),t[33]=o,t[34]=c,t[35]=n,t[36]=f,t[37]=d,t[38]=p,t[39]=a,t[40]=M):M=t[40];let N;return t[41]!==c||t[42]!==l||t[43]!==j||t[44]!==M?(N=(0,Z.jsxs)(yc,{open:c,onOpenChange:l,children:[j,M]}),t[41]=c,t[42]=l,t[43]=j,t[44]=M,t[45]=N):N=t[45],N}function EX(e){let t=(0,$.c)(15),{group:n,open:r,worktreeModel:i,entries:a,onPickFlyoutEntry:o,guardStaleSelect:s,openNewWorktreeWith:c}=e,{_:l}=an(),[u,d]=(0,Q.useState)(``),f=(0,Q.useRef)(null),p=(0,Q.useRef)(null),m,h;t[0]===r?(m=t[1],h=t[2]):(m=()=>{r&&f.current?.focus({preventScroll:!0})},h=[r],t[0]=r,t[1]=m,t[2]=h),(0,Q.useEffect)(m,h);let g=function(){let e=p.current;return e===null?[]:[...e.querySelectorAll(`[role="menuitem"]`)]},_=function(e){g()[e]?.focus()},v=function(e,t){if(e.key===`ArrowDown`){e.preventDefault(),e.stopPropagation();let t=g(),n=t.indexOf(e.currentTarget);_(Math.min(n+1,t.length-1))}else if(e.key===`ArrowUp`){e.preventDefault(),e.stopPropagation();let t=g().indexOf(e.currentTarget);t<=0?f.current?.focus():_(t-1)}else e.key===`Enter`&&(e.preventDefault(),e.stopPropagation(),t())},y;if(t[3]!==a||t[4]!==u){let e=u.trim().toLowerCase();y=e===``?a:a.filter(t=>(t.branch??``).toLowerCase().includes(e)),t[3]=a,t[4]=u,t[5]=y}else y=t[5];let b=y,x=i!==null&&i.mainRoot===n.project.mainRoot,S=u.trim(),C=x&&S.length>0,w;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,Z.jsx)(YC,{align:`inline-start`,children:(0,Z.jsx)(O,{"aria-hidden":`true`})}),t[6]=w):w=t[6];let T;t[7]===l?T=t[8]:(T=l({id:`bSD4im`}),t[7]=l,t[8]=T);let E;t[9]===l?E=t[10]:(E=l({id:`Skr_7L`}),t[9]=l,t[10]=E);let D;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(D=e=>d(e.target.value),t[11]=D):D=t[11];let k=b.length===0?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Nc,{className:`font-normal text-muted-foreground text-xs`,role:`status`,"aria-live":`polite`,children:l({id:`-uaQnI`})}),C?(0,Z.jsxs)(Sc,{onSelect:e=>{s(e)||c(S)},onKeyDown:e=>v(e,()=>c(S)),className:`flex items-center gap-2`,"data-testid":`project-switcher-flyout-create`,children:[(0,Z.jsx)(ge,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm`,title:S,children:(0,Z.jsx)(J,{id:`gHSAWT`,values:{typedName:S},components:{0:(0,Z.jsx)(`span`,{className:`font-medium`}),1:(0,Z.jsx)(`span`,{className:`font-mono`})}})})]}):null]}):b.map(e=>{let t=e.path??`branch:${e.branch}`,n=e.branch??l({id:`D12vtS`});return(0,Z.jsxs)(Sc,{onSelect:t=>{s(t)||o(e)},onKeyDown:t=>v(t,()=>o(e)),className:`flex items-center gap-2`,"data-testid":`project-switcher-flyout-entry-${t}`,"data-current":e.isCurrent?`true`:void 0,children:[(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm`,title:n,children:n}),e.isMain?(0,Z.jsx)(`span`,{className:`shrink-0 text-muted-foreground text-xs`,children:l({id:`Bn9-El`})}):e.opened?null:(0,Z.jsx)(`span`,{className:`shrink-0 text-muted-foreground text-xs`,title:l({id:`Dvwa0U`}),children:l({id:`nfoduq`})}),e.isCurrent?(0,Z.jsx)(jX,{}):null]},t)}),A;return t[12]!==p||t[13]!==k?(A=(0,Z.jsx)(`div`,{ref:p,className:`min-h-0 flex-1 overflow-x-hidden overflow-y-auto overscroll-contain subtle-scrollbar`,children:k}),t[12]=p,t[13]=k,t[14]=A):A=t[14],(0,Z.jsxs)(sc,{sideOffset:4,className:`flex max-h-80 w-96 flex-col gap-1 overflow-hidden p-1`,"data-testid":`project-switcher-flyout-${n.project.path}`,children:[(0,Z.jsxs)(qC,{className:`mb-1 h-8 shrink-0`,children:[w,(0,Z.jsx)(QC,{ref:f,"aria-label":T,placeholder:E,value:u,onChange:D,onKeyDown:e=>{e.key===`ArrowDown`&&(e.preventDefault(),_(0)),e.stopPropagation()},"data-testid":`project-switcher-flyout-search-${n.project.path}`})]}),A]})}function DX(e){let t=(0,$.c)(41),{recents:n,currentPath:r,query:i,worktreeModel:a,onPickEntry:o,onPickBranch:s,guardStaleSelect:c}=e,{_:l}=an(),u;t[0]===i?u=t[1]:(u=e=>e.toLowerCase().includes(i),t[0]=i,t[1]=u);let d=u,f,p,m,h;if(t[2]!==l||t[3]!==r||t[4]!==c||t[5]!==d||t[6]!==s||t[7]!==o||t[8]!==n||t[9]!==a){h=Symbol.for(`react.early_return_sentinel`);bb0:{let e;t[14]===d?e=t[15]:(e=e=>!e.isLinkedWorktree&&(d(e.name)||d(e.path)),t[14]=d,t[15]=e);let i=n.filter(e),u;t[16]===d?u=t[17]:(u=e=>e.isLinkedWorktree===!0&&(d(e.branch??``)||d(e.path)),t[16]=d,t[17]=u);let g=n.filter(u),_=new Set(g.map(OX)),v;t[18]===a?.entries?v=t[19]:(v=a?.entries??[],t[18]=a?.entries,t[19]=v);let y=v.filter(e=>e.branch!==null&&d(e.branch)&&(e.worktreePath===null||!_.has(e.worktreePath))&&e.worktreePath!==r);if(i.length===0&&g.length===0&&y.length===0){let e;t[20]===l?e=t[21]:(e=l({id:`pEQFsW`}),t[20]=l,t[21]=e);let n;t[22]===e?n=t[23]:(n=(0,Z.jsx)(Nc,{className:`font-normal text-muted-foreground text-xs`,role:`status`,"aria-live":`polite`,children:e}),t[22]=e,t[23]=n),h=n;break bb0}let b;t[24]!==r||t[25]!==c||t[26]!==o?(b=e=>(0,Z.jsx)(Sc,{onSelect:t=>{c(t)||o(e)},className:`flex w-full min-w-0 flex-col items-start gap-0.5`,"data-testid":`project-switcher-recent-${e.path}`,children:(0,Z.jsx)(AX,{name:e.name,path:e.path,current:e.path===r})},e.path),t[24]=r,t[25]=c,t[26]=o,t[27]=b):b=t[27],f=i.map(b);let x;t[28]!==r||t[29]!==c||t[30]!==o?(x=e=>(0,Z.jsxs)(Sc,{onSelect:t=>{c(t)||o(e)},className:`flex items-start gap-2`,"data-testid":`project-switcher-worktree-${e.path}`,"data-current":e.path===r?`true`:void 0,children:[(0,Z.jsx)(Vo,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0`}),(0,Z.jsx)(kX,{branch:e.branch??e.name,project:e.mainRoot===void 0?null:gg(e.mainRoot)})]},e.path),t[28]=r,t[29]=c,t[30]=o,t[31]=x):x=t[31],p=g.map(x);let S;t[32]!==l||t[33]!==c||t[34]!==s||t[35]!==a?(S=e=>(0,Z.jsxs)(Sc,{onSelect:t=>{c(t)||e.branch!==null&&s(e.branch)},className:`flex items-start gap-2`,"data-testid":`project-switcher-branch-${e.branch}`,children:[(0,Z.jsx)(Vo,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0 opacity-40`}),(0,Z.jsx)(kX,{branch:e.branch??``,project:a===null?null:gg(a.mainRoot),hint:l({id:`nfoduq`})})]},`branch:${e.branch}`),t[32]=l,t[33]=c,t[34]=s,t[35]=a,t[36]=S):S=t[36],m=y.map(S)}t[2]=l,t[3]=r,t[4]=c,t[5]=d,t[6]=s,t[7]=o,t[8]=n,t[9]=a,t[10]=f,t[11]=p,t[12]=m,t[13]=h}else f=t[10],p=t[11],m=t[12],h=t[13];if(h!==Symbol.for(`react.early_return_sentinel`))return h;let g;return t[37]!==f||t[38]!==p||t[39]!==m?(g=(0,Z.jsxs)(Z.Fragment,{children:[f,p,m]}),t[37]=f,t[38]=p,t[39]=m,t[40]=g):g=t[40],g}function OX(e){return e.path}function kX(e){let t=(0,$.c)(12),{branch:n,project:r,hint:i}=e,a;t[0]===n?a=t[1]:(a=(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm`,children:n}),t[0]=n,t[1]=a);let o;t[2]===i?o=t[3]:(o=i===void 0?null:(0,Z.jsx)(`span`,{className:`shrink-0 text-muted-foreground text-xs`,children:i}),t[2]=i,t[3]=o);let s;t[4]!==a||t[5]!==o?(s=(0,Z.jsxs)(`span`,{className:`flex w-full min-w-0 items-center gap-1.5`,children:[a,o]}),t[4]=a,t[5]=o,t[6]=s):s=t[6];let c;t[7]===r?c=t[8]:(c=r===null?null:(0,Z.jsx)(`span`,{className:`truncate text-muted-foreground text-xs`,title:r,children:r}),t[7]=r,t[8]=c);let l;return t[9]!==s||t[10]!==c?(l=(0,Z.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[s,c]}),t[9]=s,t[10]=c,t[11]=l):l=t[11],l}function AX(e){let t=(0,$.c)(15),{name:n,path:r,current:i}=e,a=i&&`font-medium`,o;t[0]===a?o=t[1]:(o=Y(`flex w-full items-center gap-1.5`,a),t[0]=a,t[1]=o);let s;t[2]===n?s=t[3]:(s=(0,Z.jsx)(`span`,{className:`truncate font-medium text-sm`,title:n,children:n}),t[2]=n,t[3]=s);let c;t[4]===i?c=t[5]:(c=i?(0,Z.jsx)(Ji,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`}):null,t[4]=i,t[5]=c);let l;t[6]!==o||t[7]!==s||t[8]!==c?(l=(0,Z.jsxs)(`span`,{className:o,children:[s,c]}),t[6]=o,t[7]=s,t[8]=c,t[9]=l):l=t[9];let u;t[10]===r?u=t[11]:(u=(0,Z.jsx)(`span`,{className:`w-full truncate text-muted-foreground text-xs`,title:r,children:r}),t[10]=r,t[11]=u);let d;return t[12]!==l||t[13]!==u?(d=(0,Z.jsxs)(`span`,{className:`flex w-full min-w-0 flex-col gap-0.5`,children:[l,u]}),t[12]=l,t[13]=u,t[14]=d):d=t[14],d}function jX(){let e=(0,$.c)(4),{_:t}=an(),n;e[0]===t?n=e[1]:(n=t({id:`Hp1l6f`}),e[0]=t,e[1]=n);let r;return e[2]===n?r=e[3]:(r=(0,Z.jsx)(Ji,{"aria-label":n,className:`size-3.5 shrink-0 text-muted-foreground`}),e[2]=n,e[3]=r),r}var MX=(e,t,n)=>cg(e,t,n,`ProjectSwitcher`),NX=350;function PX(e){let t=(0,$.c)(108),{bridge:n}=e,{_:r}=an(),[i,a]=(0,Q.useState)(null),[o,s]=(0,Q.useState)(!1),[c,l]=(0,Q.useState)(``),[u,d]=(0,Q.useState)(!1),[f,p]=(0,Q.useState)(!1),[m,h]=(0,Q.useState)(``),[g,_]=(0,Q.useState)(null),v=hM(),y=ag(),b=typeof window<`u`&&window.okDesktop!=null,x=(0,Q.useRef)(!1),S=(0,Q.useRef)(!1),C=(0,Q.useRef)(null),w;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(w=e=>{e&&(S.current=!0,C.current!==null&&clearTimeout(C.current),C.current=setTimeout(()=>{S.current=!1},NX)),s(e),e||(l(``),_(null))},t[0]=w):w=t[0];let T=w,E;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(E=e=>!b||!S.current?!1:(e.preventDefault(),!0),t[1]=E):E=t[1];let D=E,k;t[2]!==r||t[3]!==n.project||t[4]!==o?(k=()=>{if(!o)return;let e=!1;return MX(async()=>{let t=await n.project.listRecent();e||a(t)},r({id:`fYKgzG`})),()=>{e=!0}},t[2]=r,t[3]=n.project,t[4]=o,t[5]=k):k=t[5];let A;t[6]!==r||t[7]!==n||t[8]!==o?(A=[o,n,r],t[6]=r,t[7]=n,t[8]=o,t[9]=A):A=t[9],(0,Q.useEffect)(k,A);let j,M;t[10]===n?(j=t[11],M=t[12]):(j=()=>n.onMenuAction(e=>{e===`new-worktree`?(s(!1),_(null),h(``),p(!0)):e===`switch-worktree`&&s(!0)}),M=[n],t[10]=n,t[11]=j,t[12]=M),(0,Q.useEffect)(j,M);let N;t[13]!==r||t[14]!==n.dialog||t[15]!==n.project?(N=()=>{T(!1),MX(async()=>{let e=await n.dialog.openFolder();e&&await n.project.open({path:e,target:`new-window`,entryPoint:`pick-existing`})},r({id:`gmJ0An`}))},t[13]=r,t[14]=n.dialog,t[15]=n.project,t[16]=N):N=t[16];let P=N,F;t[17]!==r||t[18]!==n.navigator?(F=()=>{T(!1),MX(()=>n.navigator.open(),r({id:`jol95m`}))},t[17]=r,t[18]=n.navigator,t[19]=F):F=t[19];let I=F,L;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(L=()=>{T(!1),d(!0)},t[20]=L):L=t[20];let R=L,z;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(z=e=>{T(!1),h(e),p(!0)},t[21]=z):z=t[21];let B=z,V=n.config.projectPath,H;t[22]===c?H=t[23]:(H=c.trim().toLowerCase(),t[22]=c,t[23]=H);let U=H,W=U!==``,G;t[24]===i?G=t[25]:(G=i??[],t[24]=i,t[25]=G);let K=G,ee;t[26]!==W||t[27]!==K?(ee=W?K.filter(HX):K,t[26]=W,t[27]=K,t[28]=ee):ee=t[28];let te=ee,ne=W?null:y,re=v!==null&&`h-auto py-1.5`,ie;t[29]===re?ie=t[30]:(ie=Y(`justify-between text-sidebar-foreground/70 hover:text-sidebar-foreground! data-open:hover:text-sidebar-foreground!`,re),t[29]=re,t[30]=ie);let ae;t[31]===r?ae=t[32]:(ae=r({id:`zZ_I5K`}),t[31]=r,t[32]=ae);let oe;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(oe=b?()=>{x.current=!0}:void 0,t[33]=oe):oe=t[33];let se;t[34]===o?se=t[35]:(se=b?()=>{if(x.current){x.current=!1;return}T(!o)}:void 0,t[34]=o,t[35]=se);let ce;t[36]===n.config.projectName?ce=t[37]:(ce=(0,Z.jsx)(`span`,{className:`truncate`,children:n.config.projectName}),t[36]=n.config.projectName,t[37]=ce);let le;t[38]===v?le=t[39]:(le=v===null?null:(0,Z.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1 text-xs text-sidebar-foreground/50 group-hover/menu-button:text-sidebar-foreground`,"data-testid":`project-switcher-branch`,children:[(0,Z.jsx)(Vo,{"aria-hidden":`true`,className:`size-3! shrink-0`}),(0,Z.jsx)(`span`,{className:`truncate`,children:v})]}),t[38]=v,t[39]=le);let q;t[40]!==ce||t[41]!==le?(q=(0,Z.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5`,children:[ce,le]}),t[40]=ce,t[41]=le,t[42]=q):q=t[42];let ue;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(ue=(0,Z.jsx)(Dd,{"aria-hidden":`true`,className:`opacity-60`}),t[43]=ue):ue=t[43];let de;t[44]!==n.config.projectPath||t[45]!==ie||t[46]!==ae||t[47]!==se||t[48]!==q?(de=(0,Z.jsx)(bc,{asChild:!0,children:(0,Z.jsxs)(aM,{className:ie,"data-testid":`project-switcher-trigger`,"aria-label":ae,title:n.config.projectPath,onPointerDown:oe,onClick:se,children:[q,ue]})}),t[44]=n.config.projectPath,t[45]=ie,t[46]=ae,t[47]=se,t[48]=q,t[49]=de):de=t[49];let fe;t[50]!==r||t[51]!==n||t[52]!==V||t[53]!==g||t[54]!==te||t[55]!==ne||t[56]!==U||t[57]!==i||t[58]!==c?(fe=i===null?null:i.length===0?(0,Z.jsx)(Nc,{className:`font-normal text-muted-foreground text-xs`,children:(0,Z.jsx)(J,{id:`MUrVEo`})}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(qC,{className:`mb-1 h-8 border-0 shadow-none has-[[data-slot=input-group-control]:focus-visible]:ring-0`,children:[(0,Z.jsx)(QC,{"aria-label":r({id:`blFttG`}),placeholder:r({id:`RVZJWQ`}),value:c,onChange:e=>{e.target.value!==``&&_(null),l(e.target.value)},onKeyDown:VX,"data-testid":`project-switcher-search`}),(0,Z.jsx)(YC,{children:(0,Z.jsx)(O,{"aria-hidden":`true`})})]}),(0,Z.jsx)(Fc,{}),(0,Z.jsx)(`div`,{className:`max-h-64 overflow-x-hidden overflow-y-auto overscroll-contain subtle-scrollbar scroll-fade-mask`,"data-testid":`project-switcher-scroll`,onScroll:()=>{g!==null&&_(null)},children:(0,Z.jsx)(SX,{bridge:n,recents:te,currentPath:V,query:U,worktreeModel:ne,closeMenu:()=>T(!1),guardStaleSelect:D,flyoutPath:g,setFlyoutPath:_,openNewWorktreeWith:B})})]}),t[50]=r,t[51]=n,t[52]=V,t[53]=g,t[54]=te,t[55]=ne,t[56]=U,t[57]=i,t[58]=c,t[59]=fe):fe=t[59];let pe;t[60]===Symbol.for(`react.memo_cache_sentinel`)?(pe=(0,Z.jsx)(Fc,{}),t[60]=pe):pe=t[60];let me;t[61]===Symbol.for(`react.memo_cache_sentinel`)?(me=e=>{D(e)||R()},t[61]=me):me=t[61];let he;t[62]===Symbol.for(`react.memo_cache_sentinel`)?(he=(0,Z.jsxs)(Sc,{onSelect:me,"data-testid":`project-switcher-new-project`,children:[(0,Z.jsx)(ge,{"aria-hidden":`true`,className:`text-muted-foreground`}),(0,Z.jsx)(J,{id:`gKi-a_`})]}),t[62]=he):he=t[62];let _e;t[63]===I?_e=t[64]:(_e=e=>{D(e)||I()},t[63]=I,t[64]=_e);let ve,ye;t[65]===Symbol.for(`react.memo_cache_sentinel`)?(ve=(0,Z.jsx)(Se,{"aria-hidden":`true`,className:`text-muted-foreground`}),ye=(0,Z.jsx)(J,{id:`xaDWAI`}),t[65]=ve,t[66]=ye):(ve=t[65],ye=t[66]);let be;t[67]===_e?be=t[68]:(be=(0,Z.jsxs)(Sc,{onSelect:_e,"data-testid":`project-switcher-switch-project`,children:[ve,ye]}),t[67]=_e,t[68]=be);let xe;t[69]===P?xe=t[70]:(xe=e=>{D(e)||P()},t[69]=P,t[70]=xe);let Ce,we;t[71]===Symbol.for(`react.memo_cache_sentinel`)?(Ce=(0,Z.jsx)(Bo,{"aria-hidden":`true`,className:`text-muted-foreground`}),we=(0,Z.jsx)(J,{id:`PVUn_c`}),t[71]=Ce,t[72]=we):(Ce=t[71],we=t[72]);let Te;t[73]===xe?Te=t[74]:(Te=(0,Z.jsxs)(Sc,{onSelect:xe,"data-testid":`project-switcher-open-folder`,children:[Ce,we]}),t[73]=xe,t[74]=Te);let Ee;t[75]===v?Ee=t[76]:(Ee=v===null?null:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Fc,{}),(0,Z.jsxs)(Sc,{onSelect:e=>{D(e)||(T(!1),h(``),p(!0))},"data-testid":`project-switcher-new-worktree`,children:[(0,Z.jsx)(Vo,{"aria-hidden":`true`,className:`text-muted-foreground`}),(0,Z.jsx)(J,{id:`DXd9LM`})]})]}),t[75]=v,t[76]=Ee);let De;t[77]!==fe||t[78]!==be||t[79]!==Te||t[80]!==Ee?(De=(0,Z.jsxs)(wc,{align:`start`,side:`top`,className:`min-w-[260px]`,"data-testid":`project-switcher-menu`,children:[fe,pe,he,be,Te,Ee]}),t[77]=fe,t[78]=be,t[79]=Te,t[80]=Ee,t[81]=De):De=t[81];let Oe;t[82]!==o||t[83]!==de||t[84]!==De?(Oe=(0,Z.jsxs)(Ac,{open:o,onOpenChange:T,modal:!1,children:[de,De]}),t[82]=o,t[83]=de,t[84]=De,t[85]=Oe):Oe=t[85];let ke;t[86]!==n||t[87]!==u?(ke=(0,Z.jsx)(pm,{open:u,onOpenChange:d,bridge:n}),t[86]=n,t[87]=u,t[88]=ke):ke=t[88];let Ae;t[89]===y?.entries?Ae=t[90]:(Ae=y?.entries.map(BX).filter(zX),t[89]=y?.entries,t[90]=Ae);let je;t[91]===y?.entries?je=t[92]:(je=new Set(y?.entries.filter(RX).map(LX)),t[91]=y?.entries,t[92]=je);let Me=y?.remoteBranches,Ne;t[93]===y?.entries?Ne=t[94]:(Ne=new Map(y?.entries.filter(IX).map(FX)),t[93]=y?.entries,t[94]=Ne);let Pe;t[95]!==v||t[96]!==n||t[97]!==m||t[98]!==f||t[99]!==Ae||t[100]!==je||t[101]!==Me||t[102]!==Ne?(Pe=(0,Z.jsx)(gX,{open:f,onOpenChange:p,bridge:n,currentBranch:v,initialBranchName:m,branches:Ae,existingWorktreeBranches:je,remoteBranches:Me,behindByBranch:Ne}),t[95]=v,t[96]=n,t[97]=m,t[98]=f,t[99]=Ae,t[100]=je,t[101]=Me,t[102]=Ne,t[103]=Pe):Pe=t[103];let Fe;return t[104]!==Oe||t[105]!==ke||t[106]!==Pe?(Fe=(0,Z.jsxs)(Z.Fragment,{children:[Oe,ke,Pe]}),t[104]=Oe,t[105]=ke,t[106]=Pe,t[107]=Fe):Fe=t[107],Fe}function FX(e){return[e.branch,e.behind]}function IX(e){return e.branch!==null&&e.behind!==void 0}function LX(e){return e.branch}function RX(e){return e.branch!==null&&e.worktreePath!==null}function zX(e){return e!==null}function BX(e){return e.branch}function VX(e){return e.stopPropagation()}function HX(e){return!e.isLinkedWorktree}function UX(e,t){let n=e instanceof Error?e:Error(String(e));console.warn(JSON.stringify({event:`jsx-render-failure`,component:`sidebarSearchPill`,rawComponentName:`sidebarSearchPill`,error:String(n),stack:t.componentStack})),$n(`sidebarSearchPill`)}function WX(e){let t=(0,$.c)(8),{onClick:n,className:r}=e,i;t[0]===r?i=t[1]:(i=Y(`rounded-lg h-9 w-full justify-start gap-2 px-3 font-normal text-muted-foreground`,r),t[0]=r,t[1]=i);let a;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Z.jsx)(O,{"aria-hidden":`true`}),t[2]=a):a=t[2];let o;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Z.jsx)(`span`,{className:`flex-1 text-left text-sm`,children:(0,Z.jsx)(J,{id:`A1taO8`})}),t[3]=o):o=t[3];let s;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Z.jsx)(F,{className:`text-foreground/70`,children:Nl(`command-palette`)}),t[4]=s):s=t[4];let c;return t[5]!==n||t[6]!==i?(c=(0,Z.jsxs)(X,{variant:`outline`,onClick:n,"data-telemetry-event":`ok.sidebar.search_pill.click`,className:i,children:[a,o,s]}),t[5]=n,t[6]=i,t[7]=c):c=t[7],c}function GX(){let e=(0,$.c)(31),{_:t}=an(),n=ha(),{activeDocName:r}=vt(),[i,a]=(0,Q.useState)(!1),o=Sa(),s;e[0]!==n.data||e[1]!==n.status?(s=n.status===`ready`?n.data:[],e[0]=n.data,e[1]=n.status,e[2]=s):s=e[2];let c=s,l;e[3]===c?l=e[4]:(l=jo(c),e[3]=c,e[4]=l);let u=l,d=Do(),f;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(f={},e[5]=f):f=e[5];let[p,m]=(0,Q.useState)(f),h;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,Z.jsx)($j,{asChild:!0,children:(0,Z.jsxs)(Is,{className:`flex w-full items-center gap-1.5`,children:[(0,Z.jsx)(qd,{className:`size-3.5 shrink-0`}),(0,Z.jsx)(J,{id:`PCSkw2`}),(0,Z.jsx)(Zi,{className:`size-3.5 shrink-0 text-muted-foreground transition-transform group-data-[state=open]/skills:rotate-90`})]})}),e[6]=h):h=e[6];let g;e[7]===t?g=e[8]:(g=t({id:`MdpSC1`}),e[7]=t,e[8]=g);let _,v;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(_=()=>a(!0),v=(0,Z.jsx)(ge,{}),e[9]=_,e[10]=v):(_=e[9],v=e[10]);let y;e[11]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Z.jsx)(`span`,{className:`sr-only`,children:(0,Z.jsx)(J,{id:`MdpSC1`})}),e[11]=y):y=e[11];let b;e[12]===g?b=e[13]:(b=(0,Z.jsxs)(eM,{title:g,onClick:_,children:[v,y]}),e[12]=g,e[13]=b);let x;e[14]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,Z.jsx)(QX,{}),e[14]=x):x=e[14];let S;e[15]!==o||e[16]!==r||e[17]!==u||e[18]!==p||e[19]!==d||e[20]!==c?(S=c.length===0?(0,Z.jsx)(`p`,{className:`px-2 py-1 text-xs text-muted-foreground`,children:(0,Z.jsx)(J,{id:`PdJZ5p`})}):No.filter(e=>c.some(t=>t.scope===e)).map(e=>(0,Z.jsxs)(Ls,{className:`group/scope`,open:c.some(t=>t.scope===e&&fr(t.scope,t.name)===r)||(p[e]??!1),onOpenChange:t=>m(n=>({...n,[e]:t})),children:[(0,Z.jsxs)(Is,{className:`flex w-full items-center gap-1 px-2 pt-1 pb-0.5 text-[11px] text-muted-foreground/70 hover:text-muted-foreground`,children:[(0,Z.jsx)(Zi,{className:`size-3 shrink-0 transition-transform group-data-[state=open]/scope:rotate-90`}),(0,Z.jsx)(`span`,{className:`truncate`,children:d[e]})]}),(0,Z.jsx)(Fs,{children:(0,Z.jsx)(nM,{className:`pl-2`,children:c.filter(t=>t.scope===e).map(e=>(0,Z.jsx)(qX,{skill:e,activeDocName:r,actions:o,existingNames:u[e.scope]},`${e.scope}::${e.name}`))})})]},e)),e[15]=o,e[16]=r,e[17]=u,e[18]=p,e[19]=d,e[20]=c,e[21]=S):S=e[21];let C;e[22]===S?C=e[23]:(C=(0,Z.jsx)(Fs,{children:(0,Z.jsxs)(tM,{children:[x,S]})}),e[22]=S,e[23]=C);let w;e[24]===i?w=e[25]:(w=(0,Z.jsx)(so,{defaultScope:`project`,open:i,onOpenChange:a,onCreated:KX}),e[24]=i,e[25]=w);let T;return e[26]!==o.dialogs||e[27]!==C||e[28]!==w||e[29]!==b?(T=(0,Z.jsx)(Ls,{className:`group/skills shrink-0`,children:(0,Z.jsxs)(Qj,{className:`px-0`,children:[h,b,C,o.dialogs,w]})}),e[26]=o.dialogs,e[27]=C,e[28]=w,e[29]=b,e[30]=T):T=e[30],T}function KX(e){let{scope:t,name:n}=e;return $o(fr(t,n))}function qX(e){let t=(0,$.c)(50),{skill:n,activeDocName:r,actions:i,existingNames:a}=e,{_:o}=an(),[s,c]=(0,Q.useState)(!1),[l,u]=(0,Q.useState)(!1),d;t[0]!==n.name||t[1]!==n.scope?(d=fr(n.scope,n.name),t[0]=n.name,t[1]=n.scope,t[2]=d):d=t[2];let f=r===d,p,m,h;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(p=e=>{e.preventDefault(),u(!0)},m=(0,Z.jsx)(Zi,{className:`size-3 shrink-0 text-muted-foreground transition-transform group-data-[state=open]/skill:rotate-90`}),h=(0,Z.jsx)(qd,{className:`size-3 shrink-0 text-muted-foreground`}),t[3]=p,t[4]=m,t[5]=h):(p=t[3],m=t[4],h=t[5]);let g=n.name,_;t[6]===n.name?_=t[7]:(_=ko(n.name),t[6]=n.name,t[7]=_);let v;t[8]!==n.name||t[9]!==_?(v=(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,title:g,children:_}),t[8]=n.name,t[9]=_,t[10]=v):v=t[10];let y;t[11]!==o||t[12]!==n.bundledVersion||t[13]!==n.updateAvailable?(y=n.updateAvailable?(0,Z.jsx)(`span`,{title:o({id:`1YJ4Yg`,values:{0:n.bundledVersion?` (${n.bundledVersion})`:``}}),className:`flex items-center`,children:(0,Z.jsx)(os,{className:`size-3 text-primary`,"aria-label":o({id:`CifUuG`})})}):null,t[11]=o,t[12]=n.bundledVersion,t[13]=n.updateAvailable,t[14]=y):y=t[14];let b;t[15]===n.installed?b=t[16]:(b=(0,Z.jsx)(to,{installed:n.installed,subtle:!0,className:`shrink-0`}),t[15]=n.installed,t[16]=b);let x;t[17]!==y||t[18]!==b?(x=(0,Z.jsxs)(`span`,{className:`ml-auto flex shrink-0 items-center gap-1`,children:[y,b]}),t[17]=y,t[18]=b,t[19]=x):x=t[19];let S;t[20]!==f||t[21]!==x||t[22]!==v?(S=(0,Z.jsx)(Is,{asChild:!0,children:(0,Z.jsxs)(aM,{size:`sm`,isActive:f,className:`h-6 text-[11px]`,onContextMenu:p,children:[m,h,v,x]})}),t[20]=f,t[21]=x,t[22]=v,t[23]=S):S=t[23];let C;t[24]!==o||t[25]!==n.name?(C=o({id:`RlLl3G`,values:{0:n.name}}),t[24]=o,t[25]=n.name,t[26]=C):C=t[26];let w;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,Z.jsx)(Fd,{}),t[27]=w):w=t[27];let T;t[28]===C?T=t[29]:(T=(0,Z.jsx)(bc,{asChild:!0,children:(0,Z.jsx)(oM,{showOnHover:!0,"aria-label":C,children:w})}),t[28]=C,t[29]=T);let E;t[30]!==i||t[31]!==a||t[32]!==n?(E=(0,Z.jsx)(wc,{side:`right`,align:`start`,className:`min-w-52`,children:(0,Z.jsx)(ya,{skill:n,actions:i,existingNames:a})}),t[30]=i,t[31]=a,t[32]=n,t[33]=E):E=t[33];let D;t[34]!==l||t[35]!==T||t[36]!==E?(D=(0,Z.jsxs)(Ac,{open:l,onOpenChange:u,children:[T,E]}),t[34]=l,t[35]=T,t[36]=E,t[37]=D):D=t[37];let O;t[38]!==s||t[39]!==n?(O=s?(0,Z.jsx)(XX,{skill:n}):null,t[38]=s,t[39]=n,t[40]=O):O=t[40];let k;t[41]===O?k=t[42]:(k=(0,Z.jsx)(Fs,{children:O}),t[41]=O,t[42]=k);let A;t[43]!==S||t[44]!==D||t[45]!==k?(A=(0,Z.jsxs)(rM,{children:[S,D,k]}),t[43]=S,t[44]=D,t[45]=k,t[46]=A):A=t[46];let j;return t[47]!==s||t[48]!==A?(j=(0,Z.jsx)(Ls,{open:s,onOpenChange:c,className:`group/skill`,children:A}),t[47]=s,t[48]=A,t[49]=j):j=t[49],j}function JX(e){let t=[];for(let n of e){let e=n.path.split(`/`),r=t;e.forEach((t,i)=>{let a=i===e.length-1,o=r.find(e=>e.name===t);o||(o=a?{name:t,path:n.path,text:n.text}:{name:t,path:e.slice(0,i+1).join(`/`),children:[]},r.push(o)),!a&&o.children&&(r=o.children)})}return YX(t),t}function YX(e){e.sort((e,t)=>{let n=+!e.children,r=+!t.children;return n===r?e.name.localeCompare(t.name):n-r});for(let t of e)t.children&&YX(t.children)}function XX(e){let t=(0,$.c)(27),{skill:n}=e,{_:r}=an(),[i,a]=(0,Q.useState)(null),[o,s]=(0,Q.useState)(!1),{openTarget:c}=vt(),l;t[0]===c?l=t[1]:(l=function(e){c({kind:`doc`,target:e,docName:e},{tabBehavior:`append`}),Sl(kl(e))},t[0]=c,t[1]=l);let u=l,d;t[2]!==u||t[3]!==c||t[4]!==n.name||t[5]!==n.scope?(d=function(e){let t=e.lastIndexOf(`.`),r=t>=0?e.slice(t+1).toLowerCase():``;if(n.scope===`project`&&(r===`md`||r===`mdx`)){u(lt(n.name,e.replace(/\.mdx?$/i,``)));return}c({kind:`skill-file`,target:`${n.scope}/${n.name}/${e}`,scope:n.scope,name:n.name,path:e},{tabBehavior:`replace-active`}),Sl(Tl({scope:n.scope,name:n.name,path:e}))},t[2]=u,t[3]=c,t[4]=n.name,t[5]=n.scope,t[6]=d):d=t[6];let f=d,p,m;t[7]!==n.name||t[8]!==n.scope?(p=()=>{let e=!0,t=()=>{jc(n.scope,n.name).then(t=>{e&&(t.ok?(a(t.files),s(!1)):(a([]),s(!0)))})};t();let r=gl(t);return()=>{e=!1,r()}},m=[n.scope,n.name],t[7]=n.name,t[8]=n.scope,t[9]=p,t[10]=m):(p=t[9],m=t[10]),(0,Q.useEffect)(p,m);let h;if(t[11]!==r||t[12]!==i||t[13]!==o||t[14]!==f||t[15]!==u||t[16]!==n.name||t[17]!==n.scope){let e=i?JX(i):[],a;t[19]!==u||t[20]!==n.name||t[21]!==n.scope?(a=()=>n.scope===`project`?u(Xr(n.name)):$o(fr(n.scope,n.name)),t[19]=u,t[20]=n.name,t[21]=n.scope,t[22]=a):a=t[22];let s,c;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Z.jsx)(Nt,{className:`size-3 shrink-0 text-muted-foreground`}),c=(0,Z.jsx)(`span`,{className:`truncate`,children:`SKILL.md`}),t[23]=s,t[24]=c):(s=t[23],c=t[24]);let l;t[25]===a?l=t[26]:(l=(0,Z.jsx)(cM,{children:(0,Z.jsxs)(lM,{size:`sm`,onClick:a,className:`text-[11px]`,children:[s,c]})}),t[25]=a,t[26]=l),h=(0,Z.jsxs)(sM,{className:`mr-0 pr-0`,children:[l,i===null?(0,Z.jsx)(cM,{children:(0,Z.jsx)(`span`,{className:`px-2 py-0.5 text-[11px] text-muted-foreground/70`,children:(0,Z.jsx)(J,{id:`yQE2r9`})})}):o?(0,Z.jsx)(cM,{children:(0,Z.jsx)(`span`,{className:`px-2 py-0.5 text-[11px] text-muted-foreground/70`,title:r({id:`3Ijjy1`}),children:(0,Z.jsx)(J,{id:`ZARuZJ`})})}):e.map(e=>(0,Z.jsx)(ZX,{node:e,depth:0,onOpenFile:f},e.path))]}),t[11]=r,t[12]=i,t[13]=o,t[14]=f,t[15]=u,t[16]=n.name,t[17]=n.scope,t[18]=h}else h=t[18];return h}function ZX(e){let t=(0,$.c)(34),{node:n,depth:r,onOpenFile:i}=e,[a,o]=(0,Q.useState)(!1),s=`${r*.6}rem`,c;t[0]===s?c=t[1]:(c={paddingLeft:s},t[0]=s,t[1]=c);let l=c;if(n.children){let e;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(Zi,{className:`size-3 shrink-0 text-muted-foreground transition-transform group-data-[state=open]/dir:rotate-90`}),t[2]=e):e=t[2];let s;t[3]===n.name?s=t[4]:(s=(0,Z.jsxs)(`span`,{className:`truncate`,children:[n.name,`/`]}),t[3]=n.name,t[4]=s);let c;t[5]!==l||t[6]!==s?(c=(0,Z.jsx)(Is,{asChild:!0,children:(0,Z.jsxs)(lM,{size:`sm`,className:`text-[11px]`,style:l,children:[e,s]})}),t[5]=l,t[6]=s,t[7]=c):c=t[7];let u;if(t[8]!==r||t[9]!==n.children||t[10]!==i){let e;t[12]!==r||t[13]!==i?(e=e=>(0,Z.jsx)(ZX,{node:e,depth:r+1,onOpenFile:i},e.path),t[12]=r,t[13]=i,t[14]=e):e=t[14],u=n.children.map(e),t[8]=r,t[9]=n.children,t[10]=i,t[11]=u}else u=t[11];let d;t[15]===u?d=t[16]:(d=(0,Z.jsx)(Fs,{children:u}),t[15]=u,t[16]=d);let f;t[17]!==c||t[18]!==d?(f=(0,Z.jsxs)(cM,{children:[c,d]}),t[17]=c,t[18]=d,t[19]=f):f=t[19];let p;return t[20]!==a||t[21]!==f?(p=(0,Z.jsx)(Ls,{open:a,onOpenChange:o,className:`group/dir`,children:f}),t[20]=a,t[21]=f,t[22]=p):p=t[22],p}let u=`skill-file-${n.path}`,d;t[23]!==n.path||t[24]!==i?(d=()=>i(n.path),t[23]=n.path,t[24]=i,t[25]=d):d=t[25];let f;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Z.jsx)(Rd,{className:`size-3 shrink-0 text-muted-foreground`}),t[26]=f):f=t[26];let p;t[27]===n.name?p=t[28]:(p=(0,Z.jsx)(`span`,{className:`truncate`,children:n.name}),t[27]=n.name,t[28]=p);let m;return t[29]!==l||t[30]!==u||t[31]!==d||t[32]!==p?(m=(0,Z.jsx)(cM,{children:(0,Z.jsxs)(lM,{size:`sm`,className:`text-[11px]`,style:l,"data-testid":u,onClick:d,children:[f,p]})}),t[29]=l,t[30]=u,t[31]=d,t[32]=p,t[33]=m):m=t[33],m}function QX(){let e=(0,$.c)(19),[t,n]=(0,Q.useState)(null),[r,i]=(0,Q.useState)(!1),a,o;if(e[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=()=>{let e=!1;return Tc().then(t=>{e||n(t)}),()=>{e=!0}},o=[],e[0]=a,e[1]=o):(a=e[0],o=e[1]),(0,Q.useEffect)(a,o),!t||t.managed!==null||t.importable===0)return null;let s;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=async e=>{if(i(!0),!await Mc(e)){i(!1);return}n({managed:e,importable:0})},e[2]=s):s=e[2];let c=s,l;e[3]===t.importable?l=e[4]:(l=(0,Z.jsx)(`p`,{className:`mb-2 text-muted-foreground`,children:(0,Z.jsx)(J,{id:`mu1O0q`,values:{0:t.importable}})}),e[3]=t.importable,e[4]=l);let u,d;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(u=()=>c(!0),d=(0,Z.jsx)(J,{id:`l3s5ri`}),e[5]=u,e[6]=d):(u=e[5],d=e[6]);let f;e[7]===r?f=e[8]:(f=(0,Z.jsx)(X,{size:`sm`,className:`h-6 px-2 text-xs`,disabled:r,onClick:u,children:d}),e[7]=r,e[8]=f);let p,m;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(p=()=>c(!1),m=(0,Z.jsx)(J,{id:`PBxg_E`}),e[9]=p,e[10]=m):(p=e[9],m=e[10]);let h;e[11]===r?h=e[12]:(h=(0,Z.jsx)(X,{size:`sm`,variant:`ghost`,className:`h-6 px-2 text-xs`,disabled:r,onClick:p,children:m}),e[11]=r,e[12]=h);let g;e[13]!==f||e[14]!==h?(g=(0,Z.jsxs)(`div`,{className:`flex gap-1.5`,children:[f,h]}),e[13]=f,e[14]=h,e[15]=g):g=e[15];let _;return e[16]!==g||e[17]!==l?(_=(0,Z.jsxs)(`div`,{className:`mx-2 mb-1 rounded-md border border-border/60 bg-muted/40 p-2 text-xs`,children:[l,g]}),e[16]=g,e[17]=l,e[18]=_):_=e[18],_}var $X=`Relaunch`,eZ=`Release notes`,tZ=`Updates paused`,nZ=`Download`,rZ=`Reset to defaults`,iZ=`Relaunching to install the update…`,aZ=`Relaunch failed — please restart manually`;function oZ(e){return`Update to ${e} didn't install.`}var sZ=`Retry`,cZ=`Download manually`,lZ=`Recovery action failed — please try again`;function uZ(e,t){let n=t instanceof Error&&t.message?t.message:``;return n?`${e}: ${n}`:e}function dZ(e){return`Version ${e} ready to install`}function fZ(e){return`Updated to Version ${e}`}function pZ(e){return`Your settings and recent projects were saved by a newer build than this one (v${e}). Reset to defaults to continue.`}var mZ=0,hZ=0,gZ=1,_Z=2,vZ=3,yZ=6e4;function bZ(e,t,n=()=>{},r=yZ,i={isEligible:()=>!1,onShown:()=>{}}){let a=[],o=new Set,s=`update-downloaded`;return a.push(e.onUpdateDownloaded(({version:r})=>{let i=s,a=()=>{t({id:i,body:dZ(r),priority:_Z,action:{label:$X,onClick:()=>{t({id:i,body:iZ,priority:_Z,dismissible:!1}),e.update.relaunchNow().then(()=>{n(i)},e=>{a(),t({id:`relaunch-error-${r}`,body:uZ(aZ,e),variant:`error`,priority:gZ})})}}})};a()})),a.push(e.onUpdateRelaunching(()=>{t({id:s,body:iZ,priority:_Z,dismissible:!1})})),a.push(e.onUpdateRelaunchFailed(({version:r,message:i,downloadUrl:a})=>{if(a){let i=`install-failed-${r}`,o=()=>{t({id:i,body:oZ(r),variant:`error`,priority:gZ,action:{label:sZ,onClick:()=>{e.update.relaunchNow().then(()=>{n(i)},e=>{console.warn(`[update-notice] install-failed retry rejected`,e),o()})}},secondaryAction:{label:cZ,onClick:()=>{e.shell.openExternal(a)}}})};o();return}t({id:`relaunch-error-${r}`,body:i?`${aZ}: ${i}`:aZ,variant:`error`,priority:gZ})})),a.push(e.onWhatsNew(({version:a,releaseUrl:s})=>{if(i.isEligible(a)){i.onShown(a),t({id:`whats-new-combined-${a}`,body:fZ(a),variant:`success`,priority:vZ,combinedSubscribe:!0,whatsNew:{version:a,releaseUrl:s},action:{label:eZ,onClick:()=>{e.shell.openExternal(s)}}}),e.update.dismissWhatsNew(a);return}let c=`whats-new-${a}`;t({id:c,body:fZ(a),variant:`success`,priority:vZ,action:{label:eZ,onClick:()=>{e.shell.openExternal(s)}},onDismiss:()=>{e.update.dismissWhatsNew(a)}});let l=setTimeout(()=>{o.delete(l),n(c),e.update.dismissWhatsNew(a)},r);o.add(l)})),a.push(e.onWhatsNewDismissed(({version:e})=>{n(`whats-new-${e}`)})),a.push(e.onUpdateStuckHint(({downloadUrl:n})=>{t({id:`update-stuck-hint`,body:tZ,priority:hZ,action:{label:nZ,onClick:()=>{e.shell.openExternal(n)}}})})),()=>{for(let e of a)e();for(let e of o)clearTimeout(e);o.clear()}}function xZ(e,t,n,r=()=>{}){let i=`schema-incompatibility-${t.persistedSchemaVersion}`,a=`schema-incompatibility-error-${t.persistedSchemaVersion}`,o=e=>{r(i),n({id:a,body:uZ(lZ,e),variant:`error`,priority:mZ})};n({id:i,body:pZ(t.currentBuild),priority:mZ,action:{label:rZ,onClick:()=>{e.state.resetIncompatible().then(()=>{r(i)},o)}}})}var SZ=[],CZ=new Set,wZ=!1;function TZ(){for(let e of CZ)e()}function EZ(e){let t=SZ.findIndex(t=>t.id===e.id);if(t===-1)SZ=[...SZ,e];else{let n=SZ.slice();n[t]=e,SZ=n}TZ()}function DZ(e){let t=SZ.filter(t=>t.id!==e);t.length!==SZ.length&&(SZ=t,TZ())}function OZ(){return SZ}function kZ(e){return CZ.add(e),()=>{CZ.delete(e)}}function AZ(){if(wZ||typeof window>`u`)return;let e=window.okDesktop;e&&(wZ=!0,bZ(e,EZ,DZ,void 0,{isEligible:e=>gF(CF.getSnapshot(),e),onShown:e=>CF.recordShown(e)}),e.state.query().then(t=>{t.schemaIncompatibility&&xZ(e,t.schemaIncompatibility,EZ,DZ)},e=>{console.warn(`[update-notices-store] bridge.state.query() failed`,e)}))}var jZ=6e4,MZ=e=>{let t=(0,$.c)(11),{href:n,label:r,icon:i}=e,a,o;t[0]===n?(a=t[1],o=t[2]):(a=e=>hu(e,n),o=e=>hu(e,n),t[0]=n,t[1]=a,t[2]=o);let s;t[3]===i?s=t[4]:(s=(0,Z.jsx)(i,{"aria-hidden":`true`,className:`size-3.5`}),t[3]=i,t[4]=s);let c;return t[5]!==n||t[6]!==r||t[7]!==a||t[8]!==o||t[9]!==s?(c=(0,Z.jsx)(`a`,{href:n,target:`_blank`,rel:`noopener noreferrer`,onClick:a,onAuxClick:o,"aria-label":r,className:`rounded-md p-1 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground`,children:s}),t[5]=n,t[6]=r,t[7]=a,t[8]=o,t[9]=s,t[10]=c):c=t[10],c};function NZ(e){let t=(0,$.c)(34),{version:n,onOpenReleaseNotes:r,onClose:i,store:a,autoDismissMs:o}=e,s=a===void 0?CF:a,c=o===void 0?jZ:o,{_:l}=an(),[u,d]=(0,Q.useState)(!1),f,p;t[0]!==c||t[1]!==i||t[2]!==u?(f=()=>{if(!u)return;let e=setTimeout(i,c);return()=>clearTimeout(e)},p=[u,i,c],t[0]=c,t[1]=i,t[2]=u,t[3]=f,t[4]=p):(f=t[3],p=t[4]),(0,Q.useEffect)(f,p);let m;t[5]===l?m=t[6]:(m=l({id:`GzPQ2f`}),t[5]=l,t[6]=m);let h;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,Z.jsx)(J,{id:`yLEyuq`}),t[7]=h):h=t[7];let g;t[8]===s?g=t[9]:(g=()=>{s.markSubscribed(),d(!0)},t[8]=s,t[9]=g);let _;t[10]!==i||t[11]!==s?(_=()=>{s.dismiss(),i()},t[10]=i,t[11]=s,t[12]=_):_=t[12];let v;t[13]!==g||t[14]!==_?(v=(0,Z.jsx)(uF,{source:`post_update_card`,compactSubmit:!0,description:h,onSuccess:g,onDismiss:_}),t[13]=g,t[14]=_,t[15]=v):v=t[15];let y;t[16]!==l||t[17]!==u?(y=u?null:(0,Z.jsxs)(`nav`,{"aria-label":l({id:`dbapvC`}),className:`mt-3 flex items-center gap-1.5 text-muted-foreground text-xs`,children:[(0,Z.jsx)(`span`,{className:`mr-0.5`,children:(0,Z.jsx)(J,{id:`9sBe85`})}),(0,Z.jsx)(MZ,{href:pF,label:l({id:`I7Exsw`}),icon:DF}),(0,Z.jsx)(MZ,{href:dF,label:l({id:`zyKa-I`}),icon:EF}),(0,Z.jsx)(MZ,{href:fF,label:l({id:`36aWJD`}),icon:TF})]}),t[16]=l,t[17]=u,t[18]=y):y=t[18];let b;t[19]!==y||t[20]!==v?(b=(0,Z.jsxs)(`div`,{className:`px-3 py-2.5`,children:[v,y]}),t[19]=y,t[20]=v,t[21]=b):b=t[21];let x;t[22]===n?x=t[23]:(x=(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:(0,Z.jsx)(J,{id:`hLy8b1`,values:{version:n}})}),t[22]=n,t[23]=x);let S;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,Z.jsx)(J,{id:`_PACVa`}),t[24]=S):S=t[24];let C;t[25]===r?C=t[26]:(C=(0,Z.jsx)(X,{variant:`link`,size:`sm`,className:`h-auto p-0 text-muted-foreground text-xs hover:text-foreground`,onClick:r,children:S}),t[25]=r,t[26]=C);let w;t[27]!==x||t[28]!==C?(w=(0,Z.jsxs)(`div`,{className:`flex items-center justify-between border-t bg-muted/30 px-3 py-2.5 space-x-2`,children:[x,C]}),t[27]=x,t[28]=C,t[29]=w):w=t[29];let T;return t[30]!==b||t[31]!==w||t[32]!==m?(T=(0,Z.jsxs)(`section`,{"aria-label":m,className:`mx-1 mb-1 overflow-hidden rounded-lg border bg-card text-card-foreground`,children:[b,w]}),t[30]=b,t[31]=w,t[32]=m,t[33]=T):T=t[33],T}function PZ(e){let t=(0,$.c)(37),{notice:n,onDismiss:r}=e,{_:i}=an(),a=n.variant===`error`?`border-destructive/60 bg-sidebar-accent/30 text-muted-foreground`:n.variant===`success`?`border-emerald-500/40 bg-emerald-500/10 text-emerald-600 dark:text-emerald-400`:`border-sidebar-border bg-sidebar-accent/30 text-muted-foreground`,o;t[0]!==i||t[1]!==n.dismissible||t[2]!==r?(o=n.dismissible===!1?null:(0,Z.jsx)(X,{variant:`ghost`,size:`icon`,className:`size-5 shrink-0 text-muted-foreground hover:text-sidebar-foreground`,"aria-label":i({id:`GUYwCr`}),onClick:r,children:(0,Z.jsx)(xs,{"aria-hidden":`true`,className:`size-3`})}),t[0]=i,t[1]=n.dismissible,t[2]=r,t[3]=o):o=t[3];let s=o,c=`shrink-0 text-xs font-medium underline underline-offset-2 ${n.variant===`success`?`decoration-emerald-500/40`:`decoration-muted-foreground/40`} hover:text-sidebar-foreground hover:decoration-sidebar-foreground`;if(n.secondaryAction){let e=`update-notice-${n.id}`,r=`flex flex-col gap-2 rounded-md border px-2 py-2 text-xs ${a}`,i;t[4]===n.body?i=t[5]:(i=(0,Z.jsx)(`span`,{className:`flex-1 leading-snug`,children:n.body}),t[4]=n.body,t[5]=i);let o;t[6]!==s||t[7]!==i?(o=(0,Z.jsxs)(`div`,{className:`flex items-start gap-2`,children:[i,s]}),t[6]=s,t[7]=i,t[8]=o):o=t[8];let l;t[9]!==c||t[10]!==n.action?(l=n.action?(0,Z.jsx)(`button`,{type:`button`,className:c,onClick:()=>{n.action?.onClick()},children:n.action.label}):null,t[9]=c,t[10]=n.action,t[11]=l):l=t[11];let u;t[12]===n.secondaryAction?u=t[13]:(u=()=>{n.secondaryAction?.onClick()},t[12]=n.secondaryAction,t[13]=u);let d;t[14]!==c||t[15]!==n.secondaryAction.label||t[16]!==u?(d=(0,Z.jsx)(`button`,{type:`button`,className:c,onClick:u,children:n.secondaryAction.label}),t[14]=c,t[15]=n.secondaryAction.label,t[16]=u,t[17]=d):d=t[17];let f;t[18]!==l||t[19]!==d?(f=(0,Z.jsxs)(`div`,{className:`flex gap-3 pl-1`,children:[l,d]}),t[18]=l,t[19]=d,t[20]=f):f=t[20];let p;return t[21]!==e||t[22]!==r||t[23]!==o||t[24]!==f?(p=(0,Z.jsxs)(`div`,{role:`status`,"aria-live":`polite`,"data-testid":e,className:r,children:[o,f]}),t[21]=e,t[22]=r,t[23]=o,t[24]=f,t[25]=p):p=t[25],p}let l=`update-notice-${n.id}`,u=`flex items-center gap-2 rounded-md border px-2 py-1.5 text-xs ${a}`,d;t[26]===n.body?d=t[27]:(d=(0,Z.jsx)(`span`,{className:`flex-1 leading-snug`,children:n.body}),t[26]=n.body,t[27]=d);let f;t[28]!==c||t[29]!==n.action?(f=n.action?(0,Z.jsx)(`button`,{type:`button`,className:c,onClick:()=>{n.action?.onClick()},children:n.action.label}):null,t[28]=c,t[29]=n.action,t[30]=f):f=t[30];let p;return t[31]!==s||t[32]!==l||t[33]!==u||t[34]!==d||t[35]!==f?(p=(0,Z.jsxs)(`div`,{role:`status`,"aria-live":`polite`,"data-testid":l,className:u,children:[d,f,s]}),t[31]=s,t[32]=l,t[33]=u,t[34]=d,t[35]=f,t[36]=p):p=t[36],p}function FZ(e){if(e.length===0)return null;let t=e[0];if(!t)return null;for(let n=1;n<e.length;n++){let r=e[n];r&&r.priority<t.priority&&(t=r)}return t}function IZ(){let e=(0,$.c)(15),t=(0,Q.useSyncExternalStore)(kZ,OZ,OZ),n;e[0]===t?n=e[1]:(n=FZ(t),e[0]=t,e[1]=n);let r=n;if(!r)return null;if(r.combinedSubscribe&&r.whatsNew){let t;e[2]===r.action?t=e[3]:(t=()=>r.action?.onClick(),e[2]=r.action,e[3]=t);let n;e[4]===r.id?n=e[5]:(n=()=>DZ(r.id),e[4]=r.id,e[5]=n);let i;return e[6]!==r.whatsNew.version||e[7]!==t||e[8]!==n?(i=(0,Z.jsx)(`div`,{"data-testid":`update-notices-list`,children:(0,Z.jsx)(NZ,{version:r.whatsNew.version,onOpenReleaseNotes:t,onClose:n})}),e[6]=r.whatsNew.version,e[7]=t,e[8]=n,e[9]=i):i=e[9],i}let i;e[10]===r?i=e[11]:(i=()=>{r.onDismiss?.(),DZ(r.id)},e[10]=r,e[11]=i);let a;return e[12]!==r||e[13]!==i?(a=(0,Z.jsx)(`div`,{"data-testid":`update-notices-list`,children:(0,Z.jsx)(PZ,{notice:r,onDismiss:i})}),e[12]=r,e[13]=i,e[14]=a):a=e[14],a}function LZ(e,t){return e?.kind===`doc`||e?.kind===`folder-index`?aa(t.contentDir,ca(e.docName),t.pathSeparator):e?.kind===`folder`?aa(t.contentDir,e.folderPath,t.pathSeparator):e?.kind===`asset`?aa(t.contentDir,e.assetPath,t.pathSeparator):t.contentDir}function RZ(e){return e?.kind===`doc`||e?.kind===`folder-index`?ca(e.docName):e?.kind===`folder`?e.folderPath:e?.kind===`asset`?e.assetPath:``}function zZ(e,t){return e===null?Oa({workspace:t}):e.kind===`folder`?t?la({folderRelativePath:e.folderPath,workspace:t}):null:e.kind===`doc`||e.kind===`folder-index`?Ta({docName:e.docName,workspace:t}):null}var BZ={folderCount:0,expandedCount:0},VZ=`button, [role="button"], [role="menuitem"], input, textarea, select, a[href]`;function HZ(e){return typeof Element>`u`||!(e instanceof Element)?!1:e.closest(VZ)!==null}function UZ(e){let t=(0,$.c)(2),{onOpenSearch:n}=e,r;return t[0]===n?r=t[1]:(r=(0,Z.jsx)(vl,{name:`file-sidebar`,children:(0,Z.jsx)(KZ,{onOpenSearch:n})}),t[0]=n,t[1]=r),r}var WZ=e=>{let t=(0,$.c)(15),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({icon:n,label:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===n?a=t[5]:(a=(0,Z.jsx)(n,{"aria-hidden":`true`}),t[4]=n,t[5]=a);let o;t[6]!==r||t[7]!==i||t[8]!==a?(o=(0,Z.jsx)(As,{asChild:!0,children:(0,Z.jsx)(X,{variant:`ghost`,size:`icon-sm`,"aria-label":r,...i,children:a})}),t[6]=r,t[7]=i,t[8]=a,t[9]=o):o=t[9];let s;t[10]===r?s=t[11]:(s=(0,Z.jsx)(js,{children:r}),t[10]=r,t[11]=s);let c;return t[12]!==o||t[13]!==s?(c=(0,Z.jsxs)(Ns,{children:[o,s]}),t[12]=o,t[13]=s,t[14]=c):c=t[14],c},GZ=e=>{let t=(0,$.c)(15),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({icon:n,label:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===n?a=t[5]:(a=(0,Z.jsx)(n,{"aria-hidden":`true`}),t[4]=n,t[5]=a);let o;t[6]!==r||t[7]!==i||t[8]!==a?(o=(0,Z.jsx)(As,{asChild:!0,children:(0,Z.jsx)(bc,{asChild:!0,children:(0,Z.jsx)(X,{variant:`ghost`,size:`icon-sm`,"aria-label":r,...i,children:a})})}),t[6]=r,t[7]=i,t[8]=a,t[9]=o):o=t[9];let s;t[10]===r?s=t[11]:(s=(0,Z.jsx)(js,{children:r}),t[10]=r,t[11]=s);let c;return t[12]!==o||t[13]!==s?(c=(0,Z.jsxs)(Ns,{children:[o,s]}),t[12]=o,t[13]=s,t[14]=c):c=t[14],c};function KZ(e){let t=(0,$.c)(208),{onOpenSearch:n}=e,{_:r}=an(),[i,a]=(0,Q.useState)(null),[o,s]=(0,Q.useState)(null),{activeDocName:c,activeTarget:l}=vt(),u;t[0]!==c||t[1]!==l?(u=l?.kind===`folder`||l?.kind===`folder-index`?l.folderPath:ll(c),t[0]=c,t[1]=l,t[2]=u):u=t[2];let d=u,[f,p]=(0,Q.useState)(!1),m=f?``:d,h=typeof window<`u`&&window.okDesktop!=null,{state:_,toggleSidebar:v}=Vj(),y=ga(),b=_===`expanded`,x=h&&_===`collapsed`,[S,C]=(0,Q.useState)(BZ),w,T;t[3]===i?(w=t[4],T=t[5]):(w=()=>{if(i===null)return;let e=()=>{C(i.getFolderState()),p(i.isCreationTargetCleared())};return e(),i.subscribe(e)},T=[i],t[3]=i,t[4]=w,t[5]=T),(0,Q.useEffect)(w,T);let E,D;t[6]===i?(E=t[7],D=t[8]):(E=()=>{if(i!==null)return MS(e=>{let t=e.initialDir??``;if(e.template){i.createFromTemplate(e.template.folder,e.template.name);return}i.startCreating(`file`,t)})},D=[i],t[6]=i,t[7]=E,t[8]=D),(0,Q.useEffect)(E,D);let O=S.folderCount>0,k=O&&S.expandedCount===S.folderCount,A=S.expandedCount===0,j=_o(``),M=_o(m===``?null:m),N=m===``?j:M,P=j.state.status===`ready`?(j.state.data.folder.templates_available?.length??0)>0:!0,F=N.state.status===`ready`?(N.state.data.folder.templates_available?.length??0)>0:!0,I=typeof window<`u`?window.okDesktop:void 0,L=ia(),{status:R}=Pi(),z=R?.hasRemote===!0,B;t[9]!==r||t[10]!==L?.contentDir?(B=I?.config?.projectName||L?.contentDir.split(`/`).filter(Boolean).pop()||r({id:`sER-bs`}),t[9]=r,t[10]=L?.contentDir,t[11]=B):B=t[11];let V=B,H=va().states,{dispatch:U}=Ea(),W;t[12]===L?W=t[13]:(W=Oa({workspace:L}),t[12]=L,t[13]=W);let G=W,{projectLocalBinding:K,merged:ee}=zo(),te=ee?.appearance?.sidebar?.showHiddenFiles??!1,ne=O&&!k,re=O&&!A,ie=ne||re,ae=ZZ,oe;t[14]!==i||t[15]!==L?(oe=()=>{L&&i?.startCreating(`file`,``)},t[14]=i,t[15]=L,t[16]=oe):oe=t[16];let se=oe,ce;t[17]!==i||t[18]!==L?(ce=e=>{L&&i?.createFromTemplate(``,e)},t[17]=i,t[18]=L,t[19]=ce):ce=t[19];let le=ce,q;t[20]!==i||t[21]!==L?(q=()=>{L&&i?.startCreating(`folder`,``)},t[20]=i,t[21]=L,t[22]=q):q=t[22];let ue=q,de;t[23]===L?de=t[24]:(de=()=>{!L||!I||I.shell.showItemInFolder(L.contentDir)},t[23]=L,t[24]=de);let fe=de,pe;t[25]!==r||t[26]!==L?(pe=async()=>{if(L)try{await navigator.clipboard.writeText(L.contentDir),bs.success(r({id:`6_ZOw4`}),{description:L.contentDir})}catch(e){console.warn(`[FileSidebar] clipboard write failed:`,e),bs.error(r({id:`vfRlCI`}))}},t[25]=r,t[26]=L,t[27]=pe):pe=t[27];let me=pe,he;t[28]!==r||t[29]!==z?(he=()=>{Ia({...Na(``),hasRemote:z,onClickWhenNoRemote:()=>{bs.error(r({id:`WyQxwa`}))}},{clipboardWrite:xa,toastSuccess:XZ,toastError:YZ,logEvent:JZ})},t[28]=r,t[29]=z,t[30]=he):he=t[30];let ge=he,_e;t[31]!==r||t[32]!==K?(_e=e=>{if(K===null)return;let t=K.patch({appearance:{sidebar:{showHiddenFiles:e}}});t.ok||(console.warn(`[FileSidebar] showHiddenFiles toggle rejected:`,Bn(t.error)),bs.error(r({id:`P47EWZ`}),{description:Bn(t.error)}))},t[31]=r,t[32]=K,t[33]=_e):_e=t[33];let ve=_e,ye;t[34]===i?ye=t[35]:(ye=()=>{i?.expandAll()},t[34]=i,t[35]=ye);let be=ye,xe;t[36]===i?xe=t[37]:(xe=()=>{i?.collapseAll()},t[36]=i,t[37]=xe);let Se=xe,Ce,we;t[38]!==re||t[39]!==ne||t[40]!==te||t[41]!==_?(Ce=()=>{I&&I.editor.notifyViewMenuStateChanged({showHiddenFiles:te,canExpandAll:ne,canCollapseAll:re,sidebarVisible:_===`expanded`})},we=[I,te,ne,re,_],t[38]=re,t[39]=ne,t[40]=te,t[41]=_,t[42]=Ce,t[43]=we):(Ce=t[42],we=t[43]),(0,Q.useEffect)(Ce,we);let Te,Ee;t[44]!==r||t[45]!==l||t[46]!==U||t[47]!==H||t[48]!==m||t[49]!==K||t[50]!==te||t[51]!==v||t[52]!==i||t[53]!==L?(Te=()=>{if(I)return I.onMenuAction(e=>{switch(e){case`new-doc`:if(!L||!i)return;i.startCreating(`file`,m);return;case`new-folder`:if(!L||!i)return;i.startCreating(`folder`,m);return;case`new-from-template`:if(!L||!i)return;i.startCreatingFromTemplate(m);return;case`rename`:if(!l)return;$q(l);return;case`duplicate`:if(!l)return;tJ(l);return;case`move-to-trash`:if(!l)return;Zq(l);return;case`reveal-in-finder`:{if(!I||!L)return;let e=LZ(l,L);I.shell.showItemInFolder(e);return}case`send-to-ai`:{let e=oa.filter(e=>H[e.id]?.installed===!0);if(e.length===0){bs.error(r({id:`LKOLNn`}));return}let t=zZ(l,L);if(!t)return;let[n]=e;if(!n)return;U(n.id,t);return}case`copy-full-path`:{if(!L)return;let e=LZ(l,L);navigator.clipboard.writeText(e).then(()=>bs.success(r({id:`6_ZOw4`}),{description:e})).catch(e=>{console.warn(`[FileSidebar] clipboard write failed:`,e),bs.error(r({id:`vfRlCI`}))});return}case`copy-relative-path`:{let e=RZ(l);if(e===``){bs.error(r({id:`74eHt-`}));return}navigator.clipboard.writeText(e).then(()=>bs.success(r({id:`haHgQj`}),{description:e})).catch(e=>{console.warn(`[FileSidebar] clipboard write failed:`,e),bs.error(r({id:`5QGTaA`}))});return}case`toggle-show-hidden-files`:{if(K===null)return;let e=K.patch({appearance:{sidebar:{showHiddenFiles:!te}}});e.ok||(console.warn(`[FileSidebar] toggle-show-hidden-files rejected:`,Bn(e.error)),bs.error(r({id:`P47EWZ`}),{description:Bn(e.error)}));return}case`expand-all-tree`:i?.expandAll();return;case`collapse-all-tree`:i?.collapseAll();return;case`toggle-sidebar`:v();return;case`delete`:case`toggle-source`:case`save-version`:case`version-history`:case`focus-search`:case`focus-command-palette`:case`close-active-tab-or-window`:case`toggle-doc-panel`:return}})},Ee=[I,i,L,l,m,K,te,H,U,v,r],t[44]=r,t[45]=l,t[46]=U,t[47]=H,t[48]=m,t[49]=K,t[50]=te,t[51]=v,t[52]=i,t[53]=L,t[54]=Te,t[55]=Ee):(Te=t[54],Ee=t[55]),(0,Q.useEffect)(Te,Ee);let De=h&&b&&`motion-safe:delay-100`,Oe=x&&`opacity-0`,ke;t[56]!==De||t[57]!==Oe?(ke=Y(`flex-row h-12 items-center py-0 px-3`,`justify-between`,h&&`overflow-x-clip`,h&&`motion-safe:transition-opacity motion-safe:duration-100 motion-safe:ease-out`,De,Oe,h&&`[-webkit-app-region:drag]`),t[56]=De,t[57]=Oe,t[58]=ke):ke=t[58];let Ae;t[59]===Symbol.for(`react.memo_cache_sentinel`)?(Ae=h?(0,Z.jsx)(`div`,{"aria-hidden":`true`,"data-testid":`sidebar-traffic-light-reserve`,className:`w-[var(--ok-titlebar-reserve-left,0px)] shrink-0 self-stretch`}):null,t[59]=Ae):Ae=t[59];let je;t[60]===b?je=t[61]:(je=b&&!h?(0,Z.jsx)(`span`,{className:`shrink-0 font-mono text-sm uppercase tracking-wider text-sidebar-foreground/50`,children:(0,Z.jsx)(J,{id:`sER-bs`})}):null,t[60]=b,t[61]=je);let Me;t[62]===Symbol.for(`react.memo_cache_sentinel`)?(Me=Y(`flex items-center gap-1`,h&&`[&>*]:[-webkit-app-region:no-drag]`),t[62]=Me):Me=t[62];let Ne;t[63]!==r||t[64]!==k||t[65]!==O||t[66]!==A||t[67]!==i?(Ne=O?(0,Z.jsxs)(Ac,{children:[(0,Z.jsx)(GZ,{icon:$d,label:r({id:`Rq1vFD`})}),(0,Z.jsxs)(wc,{align:`end`,className:`min-w-52`,children:[k?null:(0,Z.jsxs)(Sc,{onSelect:()=>i?.expandAll(),children:[(0,Z.jsx)(Vf,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`OlAl5i`})]}),A?null:(0,Z.jsxs)(Sc,{onSelect:()=>i?.collapseAll(),children:[(0,Z.jsx)(Vd,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`qvWGzP`})]})]})]}):null,t[63]=r,t[64]=k,t[65]=O,t[66]=A,t[67]=i,t[68]=Ne):Ne=t[68];let Pe;t[69]===r?Pe=t[70]:(Pe=r({id:`HdkSiO`}),t[69]=r,t[70]=Pe);let Fe;t[71]!==m||t[72]!==i?(Fe=()=>i?.startCreating(`file`,m),t[71]=m,t[72]=i,t[73]=Fe):Fe=t[73];let Ie;t[74]!==Pe||t[75]!==Fe?(Ie=(0,Z.jsx)(WZ,{icon:Df,label:Pe,onClick:Fe}),t[74]=Pe,t[75]=Fe,t[76]=Ie):Ie=t[76];let Le;t[77]!==r||t[78]!==F||t[79]!==m||t[80]!==i?(Le=F?(0,Z.jsxs)(Ac,{children:[(0,Z.jsx)(GZ,{icon:no,label:r({id:`Uuj_R4`})}),(0,Z.jsx)(wc,{align:`end`,className:`min-w-52`,children:(0,Z.jsx)(Wq,{parentDir:m,onSelectTemplate:e=>i?.createFromTemplate(m,e),ItemComponent:Sc})})]}):null,t[77]=r,t[78]=F,t[79]=m,t[80]=i,t[81]=Le):Le=t[81];let Re;t[82]===r?Re=t[83]:(Re=r({id:`96G6Re`}),t[82]=r,t[83]=Re);let ze;t[84]!==m||t[85]!==i?(ze=()=>i?.startCreating(`folder`,m),t[84]=m,t[85]=i,t[86]=ze):ze=t[86];let Be;t[87]!==Re||t[88]!==ze?(Be=(0,Z.jsx)(WZ,{icon:Ud,label:Re,onClick:ze}),t[87]=Re,t[88]=ze,t[89]=Be):Be=t[89];let Ve;t[90]!==Ne||t[91]!==Ie||t[92]!==Le||t[93]!==Be?(Ve=(0,Z.jsxs)(`div`,{"data-testid":`sidebar-toolbar`,className:Me,children:[Ne,Ie,Le,Be]}),t[90]=Ne,t[91]=Ie,t[92]=Le,t[93]=Be,t[94]=Ve):Ve=t[94];let He;t[95]!==ke||t[96]!==je||t[97]!==Ve?(He=(0,Z.jsxs)(Yj,{"data-electron-drag":h?``:void 0,className:ke,children:[Ae,je,Ve]}),t[95]=ke,t[96]=je,t[97]=Ve,t[98]=He):He=t[98];let Ue=h&&b&&`motion-safe:delay-100`,We=x&&`opacity-0`,Ge;t[99]!==Ue||t[100]!==We?(Ge=Y(`px-2 pb-2`,h&&`[-webkit-app-region:no-drag]`,h&&`motion-safe:transition-opacity motion-safe:duration-100 motion-safe:ease-out`,Ue,We),t[99]=Ue,t[100]=We,t[101]=Ge):Ge=t[101];let Ke;t[102]===_?Ke=t[103]:(Ke=[_],t[102]=_,t[103]=Ke);let qe;t[104]===n?qe=t[105]:(qe=(0,Z.jsx)(WX,{onClick:n}),t[104]=n,t[105]=qe);let Je;t[106]!==Ke||t[107]!==qe?(Je=(0,Z.jsx)(g,{fallbackRender:qZ,onError:UX,resetKeys:Ke,children:qe}),t[106]=Ke,t[107]=qe,t[108]=Je):Je=t[108];let Ye;t[109]!==Ge||t[110]!==Je?(Ye=(0,Z.jsx)(`div`,{className:Ge,children:Je}),t[109]=Ge,t[110]=Je,t[111]=Ye):Ye=t[111];let Xe;t[112]===Symbol.for(`react.memo_cache_sentinel`)?(Xe=(0,Z.jsx)(DI,{}),t[112]=Xe):Xe=t[112];let Ze;t[113]===Symbol.for(`react.memo_cache_sentinel`)?(Ze=(0,Z.jsx)(Bo,{className:`size-3.5 shrink-0`}),t[113]=Ze):Ze=t[113];let Qe;t[114]===V?Qe=t[115]:(Qe=(0,Z.jsx)(`span`,{className:`truncate`,children:V}),t[114]=V,t[115]=Qe);let $e;t[116]===Symbol.for(`react.memo_cache_sentinel`)?($e=(0,Z.jsx)(Zi,{className:`size-3.5 shrink-0 text-muted-foreground transition-transform group-data-[state=open]/files:rotate-90`}),t[116]=$e):$e=t[116];let et;t[117]===Qe?et=t[118]:(et=(0,Z.jsx)($j,{asChild:!0,className:`shrink-0`,children:(0,Z.jsxs)(Is,{"data-sidebar-root-context":!0,className:`flex w-full items-center gap-1.5`,children:[Ze,Qe,$e]})}),t[117]=Qe,t[118]=et);let tt=o==null?`50vh`:`${o}px`,nt;t[119]===tt?nt=t[120]:(nt={height:tt},t[119]=tt,t[120]=nt);let rt;t[121]===Symbol.for(`react.memo_cache_sentinel`)?(rt=(0,Z.jsx)(gY,{ref:a,onContentHeightChange:s}),t[121]=rt):rt=t[121];let it;t[122]===nt?it=t[123]:(it=(0,Z.jsx)(Fs,{className:`flex max-h-[70vh] flex-col overflow-hidden`,style:nt,children:rt}),t[122]=nt,t[123]=it);let at;t[124]!==et||t[125]!==it?(at=(0,Z.jsx)(Ls,{defaultOpen:!0,className:`group/files flex shrink-0 flex-col`,children:(0,Z.jsxs)(Qj,{className:`min-h-0 px-0`,children:[et,it]})}),t[124]=et,t[125]=it,t[126]=at):at=t[126];let ot;t[127]===Symbol.for(`react.memo_cache_sentinel`)?(ot=(0,Z.jsx)(GX,{}),t[127]=ot):ot=t[127];let st;t[128]===i?st=t[129]:(st=(0,Z.jsx)(`div`,{"aria-hidden":!0,"data-sidebar-empty-deselect":!0,className:`min-h-8 flex-1 cursor-default`,onClick:()=>i?.clearCreationTarget()}),t[128]=i,t[129]=st);let ct;t[130]!==at||t[131]!==st?(ct=(0,Z.jsxs)(Zj,{children:[Xe,at,ot,st]}),t[130]=at,t[131]=st,t[132]=ct):ct=t[132];let lt;t[133]===Symbol.for(`react.memo_cache_sentinel`)?(lt=(0,Z.jsxs)(Xj,{className:`px-0`,children:[(0,Z.jsx)(fX,{}),(0,Z.jsx)(IZ,{}),typeof window<`u`&&window.okDesktop?(0,Z.jsx)(nM,{children:(0,Z.jsx)(rM,{children:(0,Z.jsx)(PX,{bridge:window.okDesktop})})}):null]}),t[133]=lt):lt=t[133];let ut=!(y&&_===`collapsed`),dt;t[134]===ut?dt=t[135]:(dt=(0,Z.jsx)(qj,{enableToggle:!1,enableDrag:ut}),t[134]=ut,t[135]=dt);let ft;t[136]!==He||t[137]!==Ye||t[138]!==ct||t[139]!==dt?(ft=(0,Z.jsx)(cP,{asChild:!0,children:(0,Z.jsxs)(`div`,{className:`contents`,onContextMenu:ae,children:[He,Ye,ct,lt,dt]})}),t[136]=He,t[137]=Ye,t[138]=ct,t[139]=dt,t[140]=ft):ft=t[140];let pt=!L,mt,ht;t[141]===Symbol.for(`react.memo_cache_sentinel`)?(mt=(0,Z.jsx)(Df,{"aria-hidden":`true`}),ht=(0,Z.jsx)(J,{id:`HdkSiO`}),t[141]=mt,t[142]=ht):(mt=t[141],ht=t[142]);let gt;t[143]!==se||t[144]!==pt?(gt=(0,Z.jsxs)(fP,{disabled:pt,onSelect:se,"data-testid":`empty-space-menu-new-file`,children:[mt,ht]}),t[143]=se,t[144]=pt,t[145]=gt):gt=t[145];let _t;t[146]!==le||t[147]!==P||t[148]!==L?(_t=P?(0,Z.jsxs)(uP,{children:[(0,Z.jsxs)(pP,{disabled:!L,"data-testid":`empty-space-menu-new-from-template`,children:[(0,Z.jsx)(no,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`Uuj_R4`})]}),(0,Z.jsx)(mP,{children:(0,Z.jsx)(Wq,{parentDir:``,onSelectTemplate:le,ItemComponent:fP})})]}):null,t[146]=le,t[147]=P,t[148]=L,t[149]=_t):_t=t[149];let yt=!L,bt,xt;t[150]===Symbol.for(`react.memo_cache_sentinel`)?(bt=(0,Z.jsx)(Ud,{"aria-hidden":`true`}),xt=(0,Z.jsx)(J,{id:`96G6Re`}),t[150]=bt,t[151]=xt):(bt=t[150],xt=t[151]);let St;t[152]!==ue||t[153]!==yt?(St=(0,Z.jsxs)(fP,{disabled:yt,onSelect:ue,"data-testid":`empty-space-menu-new-folder`,children:[bt,xt]}),t[152]=ue,t[153]=yt,t[154]=St):St=t[154];let Ct;t[155]===Symbol.for(`react.memo_cache_sentinel`)?(Ct=(0,Z.jsx)(_P,{}),t[155]=Ct):Ct=t[155];let wt;t[156]!==r||t[157]!==fe||t[158]!==L?(wt=I?(0,Z.jsxs)(fP,{disabled:!L,onSelect:fe,"data-testid":`empty-space-menu-reveal-in-finder`,"aria-label":r(L?{id:`LtSYdi`}:{id:`o2yoFu`}),children:[(0,Z.jsx)(Bo,{"aria-hidden":`true`}),(0,Z.jsx)(`span`,{className:`flex-1`,children:(0,Z.jsx)(J,{id:`LtSYdi`})}),L?null:(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:(0,Z.jsx)(J,{id:`wTcjov`})})]}):null,t[156]=r,t[157]=fe,t[158]=L,t[159]=wt):wt=t[159];let Tt;t[160]!==U||t[161]!==G||t[162]!==H?(Tt=(0,Z.jsx)(eX,{input:G,installStates:H,dispatch:U}),t[160]=U,t[161]=G,t[162]=H,t[163]=Tt):Tt=t[163];let Et;t[164]!==ge||t[165]!==z?(Et=z?(0,Z.jsxs)(fP,{onSelect:ge,"data-testid":`empty-space-menu-share`,children:[(0,Z.jsx)(Cf,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`Z8lGw6`})]}):null,t[164]=ge,t[165]=z,t[166]=Et):Et=t[166];let Dt=!L,Ot;t[167]!==r||t[168]!==L?(Ot=r(L?{id:`Up2_7p`}:{id:`U8CD-l`}),t[167]=r,t[168]=L,t[169]=Ot):Ot=t[169];let kt;t[170]===Symbol.for(`react.memo_cache_sentinel`)?(kt=(0,Z.jsx)(Eo,{"aria-hidden":`true`}),t[170]=kt):kt=t[170];let At;t[171]===Symbol.for(`react.memo_cache_sentinel`)?(At=(0,Z.jsx)(`span`,{className:`flex-1`,children:(0,Z.jsx)(J,{id:`Up2_7p`})}),t[171]=At):At=t[171];let jt;t[172]===L?jt=t[173]:(jt=L?null:(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:(0,Z.jsx)(J,{id:`wTcjov`})}),t[172]=L,t[173]=jt);let Mt;t[174]!==me||t[175]!==Dt||t[176]!==Ot||t[177]!==jt?(Mt=(0,Z.jsxs)(fP,{disabled:Dt,onSelect:me,"data-testid":`empty-space-menu-copy-full-path`,"aria-label":Ot,children:[kt,At,jt]}),t[174]=me,t[175]=Dt,t[176]=Ot,t[177]=jt,t[178]=Mt):Mt=t[178];let Nt;t[179]===Symbol.for(`react.memo_cache_sentinel`)?(Nt=(0,Z.jsx)(_P,{}),t[179]=Nt):Nt=t[179];let Pt=K===null,Ft;t[180]===Symbol.for(`react.memo_cache_sentinel`)?(Ft=(0,Z.jsx)(J,{id:`XcGbim`}),t[180]=Ft):Ft=t[180];let It;t[181]!==ve||t[182]!==te||t[183]!==Pt?(It=(0,Z.jsx)(hP,{checked:te,onCheckedChange:ve,disabled:Pt,"data-testid":`empty-space-menu-show-hidden-files`,children:Ft}),t[181]=ve,t[182]=te,t[183]=Pt,t[184]=It):It=t[184];let Lt;t[185]===ie?Lt=t[186]:(Lt=ie?(0,Z.jsx)(_P,{}):null,t[185]=ie,t[186]=Lt);let Rt;t[187]!==be||t[188]!==ne?(Rt=ne?(0,Z.jsxs)(fP,{onSelect:be,"data-testid":`empty-space-menu-expand-all`,children:[(0,Z.jsx)(Vf,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`OlAl5i`})]}):null,t[187]=be,t[188]=ne,t[189]=Rt):Rt=t[189];let zt;t[190]!==Se||t[191]!==re?(zt=re?(0,Z.jsxs)(fP,{onSelect:Se,"data-testid":`empty-space-menu-collapse-all`,children:[(0,Z.jsx)(Vd,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`qvWGzP`})]}):null,t[190]=Se,t[191]=re,t[192]=zt):zt=t[192];let Bt;t[193]!==gt||t[194]!==_t||t[195]!==St||t[196]!==wt||t[197]!==Tt||t[198]!==Et||t[199]!==Mt||t[200]!==It||t[201]!==Lt||t[202]!==Rt||t[203]!==zt?(Bt=(0,Z.jsxs)(dP,{className:`min-w-52`,children:[gt,_t,St,Ct,wt,Tt,Et,Mt,Nt,It,Lt,Rt,zt]}),t[193]=gt,t[194]=_t,t[195]=St,t[196]=wt,t[197]=Tt,t[198]=Et,t[199]=Mt,t[200]=It,t[201]=Lt,t[202]=Rt,t[203]=zt,t[204]=Bt):Bt=t[204];let Vt;return t[205]!==ft||t[206]!==Bt?(Vt=(0,Z.jsx)(Gj,{variant:`inset`,children:(0,Z.jsxs)(sP,{children:[ft,Bt]})}),t[205]=ft,t[206]=Bt,t[207]=Vt):Vt=t[207],Vt}function qZ(){return null}function JZ(e){return console.log(e)}function YZ(e){return bs.error(e)}function XZ(e){return bs.success(e)}function ZZ(e){e.target instanceof Element&&e.target.closest(`[data-sidebar-root-context]`)||HZ(e.target)&&(e.preventDefault(),e.stopPropagation())}var QZ=(0,Q.lazy)(()=>n(()=>import(`./McpConsentDialogBody-BKvKmtg_.js`),__vite__mapDeps([94,1,10,3,11,6,7,74,20,15,13,16,57,58,55,56,76,19,30,63,39,95]),import.meta.url));function $Z(){let e=(0,$.c)(1);if(!(0,Q.useSyncExternalStore)($u.subscribe,tQ,eQ))return null;let t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Z.jsx)(Q.Suspense,{fallback:null,children:(0,Z.jsx)(QZ,{})}),e[0]=t):t=e[0],t}function eQ(){return!1}function tQ(){return $u.getSnapshot()!==null}function nQ(){let e=(0,$.c)(17),t=Mn(),{collabUrl:n,setSystemProvider:r,updateServerInstanceId:i,onBranchSwitched:a,observeBranch:o,observeDiskAck:s,refreshServerInfo:c}=vt(),l;e[0]!==o||e[1]!==s||e[2]!==a||e[3]!==c||e[4]!==i?(l={updateServerInstanceId:i,onBranchSwitched:a,observeBranch:o,observeDiskAck:s,refreshServerInfo:c},e[0]=o,e[1]=s,e[2]=a,e[3]=c,e[4]=i,e[5]=l):l=e[5];let u=(0,Q.useRef)(l),d;e[6]!==o||e[7]!==s||e[8]!==a||e[9]!==c||e[10]!==i?(d=()=>{u.current={updateServerInstanceId:i,onBranchSwitched:a,observeBranch:o,observeDiskAck:s,refreshServerInfo:c}},e[6]=o,e[7]=s,e[8]=a,e[9]=c,e[10]=i,e[11]=d):d=e[11],(0,Q.useEffect)(d);let f,p;return e[12]!==n||e[13]!==t||e[14]!==r?(f=()=>{if(n===null)return;let e=new Io,i=new Po({url:n,name:Wr,document:e,onStateless:e=>{let{payload:t}=e;yt(t,{onServerInfo:e=>{u.current.updateServerInstanceId(e.serverInstanceId),e.currentBranch!==void 0&&u.current.observeBranch(e.currentBranch)},onBranchSwitched:e=>{u.current.onBranchSwitched(e.branch)},onDiskAck:e=>{u.current.observeDiskAck(e.docName,e.sv)},onDerivedView:cQ,onConfigValidationRejected:sQ,onConfigIgnoreNestedError:oQ,onUnknown:aQ})},onClose:iQ,onDisconnect:rQ}),a=ml(e=>{(e.includes(`files`)||e.includes(`backlinks`))&&(t.invalidateQueries({queryKey:[`backlinks`]}),t.invalidateQueries({queryKey:[`forward-links`]})),(e.includes(`files`)||e.includes(`graph`))&&(t.invalidateQueries({queryKey:[`orphans`]}),t.invalidateQueries({queryKey:[`hubs`]}))}),o=tt(()=>{u.current.refreshServerInfo()});i.on(`synced`,()=>{pl([`files`,`backlinks`,`graph`]),o()});let s=new Set,c=()=>{if(i.awareness)for(let[e,t]of i.awareness.getStates().entries())s.has(e)||t.user?.type===`agent`&&(s.add(e),console.warn(`[agent-presence] observed stale AwarenessUser.type === 'agent' from clientID ${e} — probably a stale bundled client`))};return i.awareness?.on(`change`,c),r(i),()=>{a(),i.awareness?.off(`change`,c),r(null),i.destroy(),e.destroy()}},p=[t,n,r],e[12]=n,e[13]=t,e[14]=r,e[15]=f,e[16]=p):(f=e[15],p=e[16]),(0,Q.useEffect)(f,p),null}function rQ(){console.warn(`[CC1] __system__ disconnected - derived views may be stale`)}function iQ(e){let{event:t}=e;console.warn(`[CC1] __system__ connection closed:`,t.code,t.reason)}function aQ(e){console.warn(`[CC1] Unparseable stateless payload, skipping:`,e.slice(0,100))}function oQ(e){Qa(e)}function sQ(e){ho(e)}function cQ(e){pl([e.ch])}function lQ(e){let t=K(e);if(t)return{scope:`project`,name:t};let n=Or(e);return n?.kind===`skill`?{scope:n.scope,name:n.name}:null}function uQ(e,t){let n=new Set(t.map(e=>`${e.scope}\u0000${e.name}`)),r=[];for(let t of e){let e=lQ(t);if(!e||n.has(`${e.scope}\u0000${e.name}`))continue;let i=e.scope===`project`?`global`:`project`;n.has(`${i}\u0000${e.name}`)?r.push({kind:`retarget`,fromDocName:t,toDocName:fr(i,e.name)}):r.push({kind:`close`,docName:t})}return r}function dQ(){let e=(0,$.c)(13),{openTabs:t,closeDocument:n}=vt(),r;e[0]===t?r=e[1]:(r=t.some(pQ),e[0]=t,e[1]=r);let i=r,a;e[2]===i?a=e[3]:(a={enabled:i},e[2]=i,e[3]=a);let o=ha(a),s=(0,Q.useRef)(null),c;e[4]!==n||e[5]!==t||e[6]!==o.data||e[7]!==o.status?(c=()=>{if(o.status!==`ready`)return;let e=o.data,r=`${t.join(``)}\u0002${e.map(fQ).sort().join(``)}`;if(s.current===r)return;s.current=r;let i=uQ(t,e);for(let e of i)e.kind===`retarget`?($o(e.toDocName),n(e.fromDocName)):n(e.docName)},e[4]=n,e[5]=t,e[6]=o.data,e[7]=o.status,e[8]=c):c=e[8];let l;e[9]!==n||e[10]!==t||e[11]!==o?(l=[o,t,n],e[9]=n,e[10]=t,e[11]=o,e[12]=l):l=e[12],(0,Q.useEffect)(c,l)}function fQ(e){return`${e.scope}\u0000${e.name}`}function pQ(e){return lQ(e)!==null}var mQ=1e3,hQ=3e4;function gQ(e){let t=e.scheduler??{setTimeout:(e,t)=>globalThis.setTimeout(e,t),clearTimeout:e=>globalThis.clearTimeout(e)},n=e.initialBackoffMs??mQ,r=e.maxBackoffMs??hQ,i=e.rng??Math.random,a=e.createWebSocket??(e=>new WebSocket(e)),o=e.logger??null,s=e.log,c=null,l=null,u=!1,d=n;function f(e,t,n){try{o?o[e](t,n):s?.(t)}catch{}}function p(){if(u)return;l!==null&&t.clearTimeout(l);let e=d;d=Math.min(d*2,r);let n=i(),a=Math.max(1,Math.floor(e*(1-n/2)));f(`debug`,`scheduling reconnect`,{backoffMs:a,ceilMs:e}),l=t.setTimeout(()=>{l=null,m().catch(e=>f(`warn`,`reconnect failed`,{error:String(e)}))},a)}async function m(){if(u)return;let t;try{t=await e.resolveWsUrl()}catch(e){f(`warn`,`resolveWsUrl threw`,{error:String(e)}),p();return}if(!t){p();return}let r=[];e.pid!==void 0&&r.push(`pid=${encodeURIComponent(String(e.pid))}`),e.connectionId&&r.push(`connectionId=${encodeURIComponent(e.connectionId)}`),e.connectionId&&e.displayName!==void 0&&e.clientName!==void 0&&e.colorSeed!==void 0&&(r.push(`displayName=${encodeURIComponent(e.displayName)}`),r.push(`clientName=${encodeURIComponent(e.clientName)}`),r.push(`colorSeed=${encodeURIComponent(e.colorSeed)}`));let i=r.length>0?`?${r.join(`&`)}`:``,o=`${t}/collab/keepalive${i}`;try{c=a(o)}catch(e){f(`warn`,`WebSocket constructor failed`,{url:o,error:String(e)}),c=null,p();return}c.addEventListener(`open`,()=>{f(`info`,`connected`,{url:t}),d=n}),c.addEventListener(`close`,()=>{u||(f(`info`,`disconnected`,{url:t}),c=null,p())}),c.addEventListener(`error`,()=>{f(`debug`,`websocket error observed`,{url:t,readyState:c?.readyState,reason:`error-event`})})}return queueMicrotask(()=>{m().catch(e=>f(`warn`,`initial connect failed`,{error:String(e)}))}),{close:()=>{if(!u&&(u=!0,l!==null&&(t.clearTimeout(l),l=null),c)){try{c.close()}catch{}c=null}},isConnected:()=>c!==null&&c.readyState===1}}function _Q(e){if(e)return e.replace(/\/collab\/?$/,``)}function vQ(){return Bt(window)!==null}function yQ(e,t){let n=(0,$.c)(5),r=(0,Q.useRef)(e),i=(0,Q.useRef)(t),a,o;n[0]===e?(a=n[1],o=n[2]):(a=()=>{r.current=e},o=[e],n[0]=e,n[1]=a,n[2]=o),(0,Q.useEffect)(a,o);let s,c;n[3]===Symbol.for(`react.memo_cache_sentinel`)?(s=()=>{let e=i.current?.startKeepalive??gQ;if((i.current?.isElectronHost??vQ)())return;let t=e({resolveWsUrl:async()=>_Q(r.current)});return()=>t.close()},c=[],n[3]=s,n[4]=c):(s=n[3],c=n[4]),(0,Q.useEffect)(s,c)}var bQ=(0,Q.lazy)(()=>n(()=>import(`./ShareBranchSwitchDialog-Clk_4Io5.js`).then(e=>({default:e.ShareBranchSwitchDialog})),__vite__mapDeps([96,1,6,7,13,55,15,16,56,62,64,97,98,99,100,10,3,11]),import.meta.url)),xQ=(0,Q.lazy)(()=>n(()=>import(`./ShareReceiveMissDialog-Ds4kHbjr.js`).then(e=>({default:e.ShareReceiveMissDialog})),__vite__mapDeps([101,1,55,6,7,15,13,16,56,102,79,10,3,11,52,53,37,34,30,58,63,64,97,81,36,33,39]),import.meta.url)),SQ=`#install-claude-desktop`,CQ=/\.(md|mdx)$/i;function wQ(e){return e===`#settings`||e===SQ}function TQ(e,t){if(!CQ.test(e))return null;for(let n of t){let t=Yt(n);if(t.kind===`doc`&&t.docName===e)return{kind:`doc`,target:e,docName:e}}return null}function EQ(e,t,n,r){return[e,t,n,r].map(e=>[...e].sort().join(`\0`)).join(``)}function DQ(){let e=(0,$.c)(26),{clearTarget:t,openTabs:n,syncOpenTabsWithKnownTargets:r,tabSessionLoaded:i}=vt(),{openTargetTransition:a}=jt();dQ();let{assetPaths:o,filePaths:s,folderPaths:c,loading:l,pageMeta:u,pages:d,pagesBySlug:f,pagesByBasename:p}=ea(),m=(0,Q.useRef)(null),h;e[0]!==o||e[1]!==s||e[2]!==c||e[3]!==d?(h=EQ(d,c,o,s),e[0]=o,e[1]=s,e[2]=c,e[3]=d,e[4]=h):h=e[4];let g=h,_,v;e[5]!==o||e[6]!==s||e[7]!==c||e[8]!==l||e[9]!==d||e[10]!==r||e[11]!==i||e[12]!==g?(_=()=>{l||!i||m.current===g||(m.current=g,r({pages:d,folderPaths:c,assetPaths:o,filePaths:s}))},v=[o,s,c,l,d,r,i,g],e[5]=o,e[6]=s,e[7]=c,e[8]=l,e[9]=d,e[10]=r,e[11]=i,e[12]=g,e[13]=_,e[14]=v):(_=e[13],v=e[14]),(0,Q.useEffect)(_,v);let y,b;return e[15]!==t||e[16]!==c||e[17]!==l||e[18]!==n||e[19]!==a||e[20]!==u||e[21]!==d||e[22]!==p||e[23]!==f?(y=()=>{e();function e(){if(wQ(window.location.hash))return;let e=El(window.location.hash);if(e){let t=Xn(e.split(`.`).pop()??``);_l(`ok/nav/hash-change`,{docName:null,kind:`asset`}),a({kind:`asset`,target:e,assetPath:e,mediaKind:t});return}let r=Cl(window.location.hash);if(r){_l(`ok/nav/hash-change`,{docName:null,kind:`skill-file`}),a({kind:`skill-file`,target:`${r.scope}/${r.name}/${r.path}`,scope:r.scope,name:r.name,path:r.path});return}if(jl(window.location.hash)){_l(`ok/nav/hash-change`,{docName:null,kind:`folder`}),a({kind:`folder`,target:``,folderPath:``});return}let i=Ol(window.location.hash);if(!i){_l(`ok/nav/hash-change`,{docName:null,kind:`clear`}),t();return}if(l){_l(`ok/nav/hash-change`,{docName:i,kind:`deferred-loading`});return}let o=TQ(i,n)??$c(i,{pages:d,folderPaths:c,pagesBySlug:f,pagesByBasename:p});if(o.kind===`missing`&&/\/+$/.test(i.trim())){_l(`ok/nav/hash-change`,{docName:i,kind:`deferred-missing-folder`});return}let s=ol(cl(o),u);_l(`ok/nav/hash-change`,{docName:i,kind:s.kind}),a(s)}return window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},b=[t,c,l,a,n,u,d,f,p],e[15]=t,e[16]=c,e[17]=l,e[18]=n,e[19]=a,e[20]=u,e[21]=d,e[22]=p,e[23]=f,e[24]=y,e[25]=b):(y=e[24],b=e[25]),(0,Q.useEffect)(y,b),null}function OQ(){let e=(0,$.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=[],e[0]=t):t=e[0],(0,Q.useEffect)(kQ,t),null}function kQ(){let e=MQ;if(!e(window.location.hash))return;let t=new AbortController;return Mt(t.signal).then(n=>{if(t.signal.aborted||n.status!==`ok`)return;let r=n.config.paneTarget;r?.startsWith(`#/`)&&e(window.location.hash)&&(window.location.hash=r,fetch(`/api/config`,{method:`DELETE`}).catch(jQ))}).catch(AQ),()=>t.abort()}function AQ(){}function jQ(){}function MQ(e){return!wQ(e)&&!El(e)&&!Ol(e)&&(e===``||e===`#`||e===`#/`)}function NQ(){let e=(0,$.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=[],e[0]=t):t=e[0],(0,Q.useEffect)(PQ,t),null}function PQ(){let e=function(e){let t=e.target;Xa({target:t,metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey,key:e.key})&&(e.preventDefault(),window.location.hash!==`#settings`&&(window.location.hash=Ja))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)}function FQ(){let e=(0,$.c)(4),{activeTarget:t}=vt(),n=typeof window<`u`?window.okDesktop??null:null,r=t?.kind===`doc`||t?.kind===`folder`||t?.kind===`asset`?t.kind:null,i=t?.kind===`doc`?t.docName:t?.kind===`folder`?t.folderPath:t?.kind===`asset`?t.assetPath:null,a,o;return e[0]!==i||e[1]!==r?(a=()=>{if(n){if(r===null){n.editor.notifyActiveTargetChanged({kind:null});return}i!==null&&n.editor.notifyActiveTargetChanged({kind:r,identifier:i})}},o=[n,r,i],e[0]=i,e[1]=r,e[2]=a,e[3]=o):(a=e[2],o=e[3]),(0,Q.useEffect)(a,o),null}function IQ(){let e=(0,$.c)(8),{activeDocName:t,activeTarget:n}=vt(),[r,i]=(0,Q.useState)(!1),a;e[0]!==t||e[1]!==n?(a=n?.kind===`folder`?n.folderPath:ll(t),e[0]=t,e[1]=n,e[2]=a):a=e[2];let o=a,s,c;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(s=()=>{let e=function(e){let t=e.target;hh({target:t,metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey,key:e.key})&&(e.preventDefault(),i(!0))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},c=[],e[3]=s,e[4]=c):(s=e[3],c=e[4]),(0,Q.useEffect)(s,c);let l;return e[5]!==r||e[6]!==o?(l=(0,Z.jsx)(_h,{open:r,onOpenChange:i,kind:`file`,initialDir:o}),e[5]=r,e[6]=o,e[7]=l):l=e[7],l}function LQ(e){let t=(0,$.c)(3),{children:n}=e,{collabUrl:r}=vt();yQ(r);let i;return t[0]!==n||t[1]!==r?(i=(0,Z.jsx)(Ro,{collabUrl:r,children:n}),t[0]=n,t[1]=r,t[2]=i):i=t[2],i}function RQ(){let e=(0,$.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Z.jsx)(vl,{name:`app`,children:(0,Z.jsx)(zt,{children:(0,Z.jsx)(LQ,{children:(0,Z.jsx)(ug,{children:(0,Z.jsx)(zQ,{})})})})}),e[0]=t):t=e[0],t}function zQ(){let e=(0,$.c)(25),t=typeof window<`u`?window.okDesktop??null:null,n=typeof window<`u`&&window.okDesktop!=null,[r,i]=(0,Q.useState)(!1),a=pg(),o;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=t?{launchInTerminal:BQ}:null,e[0]=o):o=e[0];let s=o,c;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Z.jsx)(Bg,{}),e[1]=c):c=e[1];let l,u,d,f,p;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Z.jsx)(nQ,{}),u=(0,Z.jsx)(DQ,{}),d=(0,Z.jsx)(OQ,{}),f=(0,Z.jsx)(FQ,{}),p=(0,Z.jsx)(IQ,{}),e[2]=l,e[3]=u,e[4]=d,e[5]=f,e[6]=p):(l=e[2],u=e[3],d=e[4],f=e[5],p=e[6]);let m;e[7]===a?m=e[8]:(m=!a&&(0,Z.jsx)(NQ,{}),e[7]=a,e[8]=m);let h,g,_,v;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(_=!1,v=t?(0,Z.jsx)(Vg,{bridge:t}):null,h=(0,Z.jsx)($Z,{}),g=t?(0,Z.jsxs)(Q.Suspense,{fallback:null,children:[(0,Z.jsx)(bQ,{bridge:t}),(0,Z.jsx)(xQ,{})]}):null,e[9]=h,e[10]=g,e[11]=_,e[12]=v):(h=e[9],g=e[10],_=e[11],v=e[12]);let y;e[13]===r?y=e[14]:(y=(0,Z.jsx)(kg,{bridge:t,open:r,onOpenChange:i}),e[13]=r,e[14]=y);let b;e[15]===Symbol.for(`react.memo_cache_sentinel`)?(b=n&&(0,Z.jsx)(`div`,{"aria-hidden":`true`,"data-testid":`editor-window-chrome-drag-strip`,"data-electron-drag":``,className:`pointer-events-none fixed inset-x-0 top-0 z-50 h-2 [-webkit-app-region:drag]`}),e[15]=b):b=e[15];let x;e[16]===a?x=e[17]:(x=!a&&(0,Z.jsx)(UZ,{onOpenSearch:()=>i(!0)}),e[16]=a,e[17]=x);let S;e[18]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,Z.jsx)(Jj,{className:`overflow-hidden h-[calc(100vh-var(--layout-inset-offset))]`,children:(0,Z.jsx)(SI,{onOpenSearch:()=>i(!0)})}),e[18]=S):S=e[18];let C;e[19]===x?C=e[20]:(C=(0,Z.jsx)(_a,{value:s,children:(0,Z.jsxs)(Hj,{className:`h-screen overflow-hidden`,children:[x,S]})}),e[19]=x,e[20]=C);let w;return e[21]!==y||e[22]!==C||e[23]!==m?(w=(0,Z.jsxs)(Z.Fragment,{children:[c,(0,Z.jsxs)(na,{children:[l,u,d,f,p,m,_,v,h,g,y,b,C]})]}),e[21]=y,e[22]=C,e[23]=m,e[24]=w):w=e[24],w}function BQ(e,t){ZF(Da(e,t),t)}function VQ(e){let t=/\/([^/]+?)(?:\.git)?\/?$/.exec(e);return t?t[1]:`repo`}function HQ(e){return{async getAuthStatus(){return e.authQueryTransport.status()},async startSignIn(){return e.openSignIn()},async runClone({url:t,branch:n}){let r=await e.bridge.dialog.openFolder();if(!r)return{kind:`cancelled`};let i=VQ(t),a=`${r.replace(/\/$/,``)}/${i}`,o=bs.loading(Yc._({id:`GXf9hG`,values:{repoName:i}}),{duration:1/0}),s=typeof n==`string`&&n.length>0?n:null;try{let n=e.cloneTransport.start({url:t,dir:a,branch:s});for await(let e of n.events){if(e.type===`progress`){let t=e.phase,n=Math.round(e.pct);bs.loading(Yc._({id:`GXf9hG`,values:{repoName:i}}),{id:o,description:Yc._({id:`SCzAbA`,values:{phase:t,pct:n}}),duration:1/0});continue}if(e.type===`branch-fallback`){console.log(td({branch_action:`fallback`,branch:e.branch})),bs.info(Yc._({id:`3JYy1p`,values:{0:e.branch}}),{duration:8e3});continue}if(e.type===`complete`)return bs.success(Yc._({id:`IRv9cH`,values:{repoName:i}}),{id:o,duration:4e3}),{kind:`ok`,dir:e.dir};if(e.type===`error`)return bs.dismiss(o),{kind:`error`,detail:e.message}}return bs.dismiss(o),{kind:`error`,detail:`Clone ended unexpectedly.`}}catch(e){console.warn(`[clone-controller] clone transport threw`,e);let t=e instanceof Error?e.message:`Unknown error`;return bs.dismiss(o),{kind:`error`,detail:t}}}}}function UQ(){return{start(e){return Ra((t,n)=>{(async()=>{try{let r=await fetch(`/api/local-op/clone`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({url:e.url,dir:e.dir||void 0,branch:typeof e.branch==`string`&&e.branch.length>0?e.branch:void 0}),signal:n});if(!r.ok){let e=`Clone failed — check the URL and try again (${r.status})`;try{let t=await r.json(),n=Fr.safeParse(t);n.success&&(e=`Clone failed: ${n.data.title}`)}catch{}t({type:`error`,message:e});return}if(!r.body){t({type:`error`,message:`Clone failed — empty response body`});return}let i=r.body.getReader(),a=new TextDecoder,o=``;for(;;){let{done:e,value:r}=await i.read();if(e)break;o+=a.decode(r,{stream:!0});let s=o.split(`
|
|
2003
|
-
`);o=s.pop()??``;for(let e of s){if(!e.trim())continue;let n;try{n=JSON.parse(e)}catch{console.warn(`[clone-transport] Dropped unparseable NDJSON line:`,e.slice(0,100));continue}if(n&&typeof n==`object`&&n.type===`error`&&`problem`in n){let e=n.problem;t({type:`error`,message:e?.detail||e?.title||`Unknown error`});break}t(n)}if(n.aborted)break}n.aborted||t({type:`error`,message:`Clone stream ended unexpectedly — check if the clone completed`})}catch(e){if(e instanceof Error&&e.name===`AbortError`)return;t({type:`error`,message:`Clone failed — connection error`})}})()})}}}function WQ(e){return{start(t){let n=typeof t.branch==`string`&&t.branch.length>0?t.branch:null;return e.localOp.clone.start({url:t.url,dir:t.dir,branch:n})}}}function GQ(e){switch(e){case`receiving`:return{id:`qbfj1f`};case`resolving`:return{id:`adsMWO`};case`checking`:return{id:`1HBhDS`};case`init`:return{id:`LlHqdU`};case`done`:return{id:`bD8I7O`};default:return{id:`25Pw6a`}}}function KQ(e){let t=e.trim();if(/^[\w.-]+\/[\w.-]+$/.test(t))return t.split(`/`)[1];try{return new URL(t.replace(/^git@([^:]+):/,`https://$1/`)).pathname.replace(/\.git$/,``).split(`/`).pop()??`repo`}catch{return t.split(`/`).pop()?.replace(/\.git$/,``)??`repo`}}function qQ(e){let t=(0,$.c)(100),{open:n,onOpenChange:r,onSignIn:i,onCloneComplete:a,transport:o,authQueryTransport:s,pickParentFolder:c,initialUrl:l}=e,{_:u}=an(),d;t[0]===o?d=t[1]:(d=o??UQ(),t[0]=o,t[1]=d);let f=d,p;t[2]===s?p=t[3]:(p=s??mo(),t[2]=s,t[3]=p);let m=p,h=c!==void 0,[g,_]=(0,Q.useState)(``),[v,y]=(0,Q.useState)(``),[b,x]=(0,Q.useState)(null),[S,C]=(0,Q.useState)(!1),w;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(w=vo(),t[4]=w):w=t[4];let[T,E]=(0,Q.useState)(w),[D,O]=(0,Q.useState)(!1),[k,A]=(0,Q.useState)(!1),[j,M]=(0,Q.useState)(-1),N=(0,Q.useRef)(null),P=(0,Q.useRef)(null),F=(0,Q.useRef)(null),I=(0,Q.useId)(),L;t[5]!==n||t[6]!==m?(L=()=>{if(!n)return;let e=!1;return m.status().then(t=>{uo(t.authenticated),e||E(t.authenticated)}).catch(()=>{e||E(!1)}),()=>{e=!0}},t[5]=n,t[6]=m,t[7]=L):L=t[7];let R;t[8]===n?R=t[9]:(R=[n],t[8]=n,t[9]=R),(0,Q.useEffect)(L,R);let z;t[10]!==T||t[11]!==n||t[12]!==m?(z=()=>{if(!T||!n)return;let e=!1;return C(!0),m.repos().then(t=>{e||(x(t.ok?t.repos:[]),C(!1))}).catch(()=>{e||(x([]),C(!1))}),()=>{e=!0}},t[10]=T,t[11]=n,t[12]=m,t[13]=z):z=t[13];let B;t[14]!==T||t[15]!==n?(B=[T,n],t[14]=T,t[15]=n,t[16]=B):B=t[16],(0,Q.useEffect)(z,B);let V,H;t[17]!==l||t[18]!==n||t[19]!==h?(V=()=>{if(!n||!l||(_(l),h))return;let e=KQ(l);e&&y(`~/Documents/${e}`)},H=[n,l,h],t[17]=l,t[18]=n,t[19]=h,t[20]=V,t[21]=H):(V=t[20],H=t[21]),(0,Q.useEffect)(V,H);let U,W;t[22]!==j||t[23]!==I?(U=()=>{j<0||document.getElementById(`${I}-opt-${j}`)?.scrollIntoView({block:`nearest`})},W=[j,I],t[22]=j,t[23]=I,t[24]=U,t[25]=W):(U=t[24],W=t[25]),(0,Q.useEffect)(U,W);let G;t[26]===h?G=t[27]:(G=function(e){if(_(e),A(!0),M(-1),h)return;let t=KQ(e);t&&y(`~/Documents/${t}`)},t[26]=h,t[27]=G);let K=G,ee;t[28]===h?ee=t[29]:(ee=function(e){if(_(e.clone_url),h)return;let t=e.full_name.split(`/`)[1];y(`~/Documents/${t}`)},t[28]=h,t[29]=ee);let te=ee,ne;t[30]!==u||t[31]!==v||t[32]!==a||t[33]!==r||t[34]!==c||t[35]!==f||t[36]!==g?(ne=async function(){let e=g.trim();if(!e){bs.error(u({id:`FTUGgh`}));return}let t=v||``;if(c){O(!0);let n=await c();if(!n){O(!1);return}let r=KQ(e);t=`${n.replace(/\/$/,``)}/${r}`}else O(!0);let n=bs.loading(u({id:`2tgFCe`}),{duration:1/0});P.current=n;let i=f.start({url:e,dir:t});N.current=i.cancel;try{let e=i.events[Symbol.asyncIterator](),t=await e.next();for(;!t.done;){let i=t.value;if(i.type===`progress`){let e=u(GQ(i.phase));bs.loading(`${e} — ${i.pct}%`,{id:n})}else if(i.type===`complete`){bs.success(u({id:`u_lS4C`}),{id:n}),r(!1),O(!1),N.current=null;let e=`port`in i?i.port:void 0;a?a({port:e,dir:i.dir}):e!==void 0&&(window.location.href=`http://localhost:${e}`);return}else if(i.type===`error`){let e=i.message;bs.error(u({id:`eFJkVt`,values:{cloneError:e}}),{id:n}),O(!1),N.current=null;return}t=await e.next()}bs.error(u({id:`Tz9pJB`}),{id:n}),O(!1),N.current=null}catch(e){console.error(`[CloneDialog] clone iteration failed:`,e),bs.error(u({id:`K9J00P`}),{id:n}),O(!1),N.current=null}},t[30]=u,t[31]=v,t[32]=a,t[33]=r,t[34]=c,t[35]=f,t[36]=g,t[37]=ne):ne=t[37];let re=ne,ie;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(ie=function(){N.current?.(),N.current=null,O(!1),bs.dismiss(P.current??void 0)},t[38]=ie):ie=t[38];let ae=ie,oe;t[39]!==D||t[40]!==r||t[41]!==h?(oe=function(e){D||(r(e),e||(_(``),h||y(``),A(!1),M(-1)))},t[39]=D,t[40]=r,t[41]=h,t[42]=oe):oe=t[42];let se=oe,ce;t[43]===te?ce=t[44]:(ce=function(e){te(e),A(!1),M(-1),F.current?.focus()},t[43]=te,t[44]=ce);let le=ce,q=T===null||S&&b===null,ue;if(t[45]!==b||t[46]!==g){let e=g.trim().toLowerCase(),n;t[48]===b?n=t[49]:(n=b??[],t[48]=b,t[49]=n),ue=n.filter(t=>`${t.full_name} ${t.clone_url}`.toLowerCase().includes(e)),t[45]=b,t[46]=g,t[47]=ue}else ue=t[47];let de=ue,fe;t[50]===Symbol.for(`react.memo_cache_sentinel`)?(fe=/:\/\/|^git@|\.git$/i,t[50]=fe):fe=t[50];let pe;t[51]===g?pe=t[52]:(pe=fe.test(g.trim()),t[51]=g,t[52]=pe);let me=pe,he=T===!0&&b!==null&&de.length===0&&!me,ge=k&&T!==!1&&!D&&(q||de.length>0||he),_e=de.length,ve=`${I}-loading`,ye,be;t[53]===_e?(ye=t[54],be=t[55]):(ye=()=>{M(e=>e>=_e?_e-1:e)},be=[_e],t[53]=_e,t[54]=ye,t[55]=be),(0,Q.useEffect)(ye,be);let xe;t[56]!==j||t[57]!==D||t[58]!==ge||t[59]!==le||t[60]!==de?(xe=function(e){if(!D)if(e.key===`ArrowDown`){if(e.preventDefault(),!ge){A(!0);return}M(e=>Math.min(e+1,de.length-1))}else e.key===`ArrowUp`?(e.preventDefault(),M($Q)):e.key===`Enter`?ge&&j>=0&&j<de.length&&(e.preventDefault(),le(de[j])):e.key===`Escape`&&ge&&(e.preventDefault(),e.stopPropagation(),A(!1),M(-1))},t[56]=j,t[57]=D,t[58]=ge,t[59]=le,t[60]=de,t[61]=xe):xe=t[61];let Se=xe,Ce;t[62]===Symbol.for(`react.memo_cache_sentinel`)?(Ce=(0,Z.jsx)(Us,{children:(0,Z.jsx)(zs,{children:(0,Z.jsx)(J,{id:`VdXv4D`})})}),t[62]=Ce):Ce=t[62];let we;t[63]===Symbol.for(`react.memo_cache_sentinel`)?(we=(0,Z.jsx)(`label`,{htmlFor:`clone-source`,className:`text-sm font-medium`,children:(0,Z.jsx)(J,{id:`IreQBq`})}),t[63]=we):we=t[63];let Te;t[64]!==u||t[65]!==j||t[66]!==D||t[67]!==Se||t[68]!==K||t[69]!==T||t[70]!==I||t[71]!==ve||t[72]!==i||t[73]!==ge||t[74]!==q||t[75]!==b||t[76]!==le||t[77]!==de||t[78]!==g?(Te=(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[we,T===!1?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(qc,{id:`clone-source`,placeholder:u({id:`Xv_ijG`}),value:g,onChange:e=>K(e.target.value),disabled:D}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2 text-1sm text-muted-foreground`,children:[(0,Z.jsx)(`span`,{children:(0,Z.jsx)(J,{id:`9oE4C3`})}),(0,Z.jsx)(X,{variant:`link`,className:`h-auto p-0`,onClick:()=>i?.(),disabled:D,children:(0,Z.jsx)(J,{id:`3jod3l`})})]})]}):(0,Z.jsxs)(Ne,{open:ge,onOpenChange:A,children:[(0,Z.jsx)(dt,{asChild:!0,children:(0,Z.jsx)(qc,{id:`clone-source`,ref:F,role:`combobox`,"aria-expanded":ge,"aria-controls":ge?q?ve:I:void 0,"aria-activedescendant":j>=0?`${I}-opt-${j}`:void 0,"aria-autocomplete":`list`,autoComplete:`off`,placeholder:u({id:`R0jJzV`}),value:g,onChange:e=>K(e.target.value),onFocus:()=>A(!0),onKeyDown:Se,disabled:D})}),(0,Z.jsx)(Ut,{align:`start`,sideOffset:4,className:`w-(--radix-popover-trigger-width) max-h-56 overflow-y-auto overscroll-y-contain subtle-scrollbar p-0`,onOpenAutoFocus:QQ,onCloseAutoFocus:ZQ,onInteractOutside:e=>{F.current?.contains(e.target)&&e.preventDefault()},onWheel:XQ,onTouchMove:YQ,children:q?(0,Z.jsxs)(`output`,{id:ve,className:`flex flex-col gap-1.5 px-3 py-2`,"aria-label":u({id:`8XQRON`}),children:[(0,Z.jsx)(Ga,{className:`h-4 w-2/3`}),(0,Z.jsx)(Ga,{className:`h-4 w-1/2`}),(0,Z.jsx)(Ga,{className:`h-4 w-3/4`}),(0,Z.jsx)(Ga,{className:`h-4 w-2/5`})]}):(0,Z.jsx)(`div`,{id:I,role:`listbox`,"aria-label":u({id:`KX1MZR`}),className:`py-1`,children:de.length===0?(0,Z.jsx)(`div`,{role:`presentation`,className:`px-3 py-2 text-xs text-muted-foreground`,children:b&&b.length===0?(0,Z.jsx)(J,{id:`cOSAfL`}):(0,Z.jsx)(J,{id:`8eW0WQ`})}):de.map((e,t)=>(0,Z.jsxs)(`div`,{id:`${I}-opt-${t}`,role:`option`,tabIndex:-1,"aria-selected":t===j,onMouseDown:JQ,onMouseEnter:()=>M(t),onClick:()=>le(e),className:Y(`flex cursor-default items-center gap-2 px-3 py-1.5 text-sm`,t===j&&`bg-accent text-accent-foreground`),children:[e.private?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(nf,{className:`size-3.5 shrink-0 text-muted-foreground`,"aria-hidden":`true`}),(0,Z.jsx)(`span`,{className:`sr-only`,children:(0,Z.jsx)(J,{id:`n5n_vi`})})]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)($i,{className:`size-3.5 shrink-0 text-muted-foreground`,"aria-hidden":`true`}),(0,Z.jsx)(`span`,{className:`sr-only`,children:(0,Z.jsx)(J,{id:`NuH1jp`})})]}),(0,Z.jsx)(`span`,{className:`truncate`,children:e.full_name})]},e.full_name))})})]})]}),t[64]=u,t[65]=j,t[66]=D,t[67]=Se,t[68]=K,t[69]=T,t[70]=I,t[71]=ve,t[72]=i,t[73]=ge,t[74]=q,t[75]=b,t[76]=le,t[77]=de,t[78]=g,t[79]=Te):Te=t[79];let Ee;t[80]!==D||t[81]!==v||t[82]!==h?(Ee=!h&&(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(`label`,{htmlFor:`clone-path`,className:`text-sm font-medium`,children:(0,Z.jsx)(J,{id:`Gp_twO`})}),(0,Z.jsx)(qc,{id:`clone-path`,placeholder:`~/Documents/repo-name`,value:v,onChange:e=>y(e.target.value),disabled:D})]}),t[80]=D,t[81]=v,t[82]=h,t[83]=Ee):Ee=t[83];let De;t[84]!==Te||t[85]!==Ee?(De=(0,Z.jsx)(Vs,{children:(0,Z.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[Te,Ee]})}),t[84]=Te,t[85]=Ee,t[86]=De):De=t[86];let Oe;t[87]!==D||t[88]!==re||t[89]!==se||t[90]!==g||t[91]!==h?(Oe=(0,Z.jsx)(Hs,{children:D?(0,Z.jsx)(X,{variant:`outline`,className:`font-mono uppercase`,onClick:ae,children:(0,Z.jsx)(J,{id:`dEgA5A`})}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(X,{variant:`outline`,className:`font-mono uppercase`,onClick:()=>se(!1),children:(0,Z.jsx)(J,{id:`dEgA5A`})}),(0,Z.jsx)(X,{onClick:()=>void re(),disabled:!g.trim(),"aria-describedby":h?`clone-picker-hint`:void 0,children:(0,Z.jsx)(J,{id:`9UQ730`})}),h&&(0,Z.jsx)(`span`,{id:`clone-picker-hint`,className:`sr-only`,children:(0,Z.jsx)(J,{id:`EvPX7f`})})]})}),t[87]=D,t[88]=re,t[89]=se,t[90]=g,t[91]=h,t[92]=Oe):Oe=t[92];let ke;t[93]!==De||t[94]!==Oe?(ke=(0,Z.jsxs)(Bs,{className:`sm:max-w-lg`,children:[Ce,De,Oe]}),t[93]=De,t[94]=Oe,t[95]=ke):ke=t[95];let Ae;return t[96]!==se||t[97]!==n||t[98]!==ke?(Ae=(0,Z.jsx)(Ws,{open:n,onOpenChange:se,children:ke}),t[96]=se,t[97]=n,t[98]=ke,t[99]=Ae):Ae=t[99],Ae}function JQ(e){return e.preventDefault()}function YQ(e){return e.stopPropagation()}function XQ(e){return e.stopPropagation()}function ZQ(e){return e.preventDefault()}function QQ(e){return e.preventDefault()}function $Q(e){return Math.max(e-1,-1)}var e$=(0,Q.lazy)(()=>n(()=>import(`./ConsentDialogBody-u7A2_0jL.js`),__vite__mapDeps([103,1,6,7,74,20,15,13,16,57,58,54,55,56,60,104,76,77,17,18,19,63,66,82]),import.meta.url));function t$(){let e=(0,$.c)(1);if(!(0,Q.useSyncExternalStore)(Kc.subscribe,r$,n$))return null;let t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Z.jsx)(Q.Suspense,{fallback:null,children:(0,Z.jsx)(e$,{})}),e[0]=t):t=e[0],t}function n$(){return!1}function r$(){return Kc.getSnapshot()!==null}function i$(e){let t=(0,$.c)(5),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsx)(`title`,{children:`OpenKnowledge icon`}),t[0]=n):n=t[0];let r;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Z.jsxs)(`g`,{filter:`url(#filter0_d_ok)`,children:[(0,Z.jsx)(`path`,{d:`M66.8902 16.1017C58.2694 3.86669 46.1739 -0.690239 29.9182 2.17749C21.3995 3.67813 13.4602 9.555 8.67934 17.9009C3.93974 26.1701 2.98514 35.6533 6.05714 43.9166C9.31574 52.6868 16.7168 58.4752 24.2299 63.4231C25.7973 64.4562 26.1351 65.7172 26.3551 68.9896C26.5221 71.4625 26.799 75.6011 30.6842 77.7204C31.8176 78.3372 33.0648 78.6515 34.3946 78.6515C37.0796 78.6515 39.4033 77.3649 40.5189 76.7482C47.1049 73.1046 68.8878 59.7147 72.6453 40.4027C74.3444 31.6679 70.9797 21.9019 66.8922 16.1017H66.8902Z`,fill:`white`}),(0,Z.jsx)(`path`,{d:`M37.4214 71.154C28.7888 75.929 36.787 64.0397 27.7458 58.0843C21.6372 54.0616 14.788 49.0568 12.0499 41.6911C6.74463 27.4192 17.5438 10.8473 31.028 8.47262C45.1977 5.97613 54.6946 9.8947 61.6635 19.7844C65.2089 24.8167 67.6013 32.8365 66.3658 39.1828C63.6906 52.9341 49.073 64.7075 37.4214 71.154Z`,fill:`#69A3FF`}),(0,Z.jsx)(`path`,{d:`M52.7244 29.2638C53.4665 28.5217 54.6697 28.5217 55.4119 29.2638V29.2638C56.154 30.0059 56.154 31.2091 55.4119 31.9513L49.2589 38.1042L46.5715 35.4167L52.7244 29.2638Z`,fill:`#D5E5FF`}),(0,Z.jsx)(`path`,{d:`M55.4119 38.8821C56.154 39.6242 56.154 40.8274 55.4119 41.5696V41.5696C54.6698 42.3117 53.4665 42.3117 52.7244 41.5696L46.5715 35.4166L49.259 32.7292L55.4119 38.8821Z`,fill:`#D5E5FF`})]}),t[1]=r):r=t[1];let i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsx)(`defs`,{children:(0,Z.jsxs)(`filter`,{id:`filter0_d_ok`,x:`-9.53674e-07`,y:`-0.0799994`,width:`77.3817`,height:`85.8743`,filterUnits:`userSpaceOnUse`,colorInterpolationFilters:`sRGB`,children:[(0,Z.jsx)(`feFlood`,{floodOpacity:`0`,result:`BackgroundImageFix`}),(0,Z.jsx)(`feColorMatrix`,{in:`SourceAlpha`,type:`matrix`,values:`0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0`,result:`hardAlpha`}),(0,Z.jsx)(`feOffset`,{dy:`2.85714`}),(0,Z.jsx)(`feGaussianBlur`,{stdDeviation:`2.14286`}),(0,Z.jsx)(`feComposite`,{in2:`hardAlpha`,operator:`out`}),(0,Z.jsx)(`feColorMatrix`,{type:`matrix`,values:`0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.1 0`}),(0,Z.jsx)(`feBlend`,{mode:`normal`,in2:`BackgroundImageFix`,result:`effect1_dropShadow_ok`}),(0,Z.jsx)(`feBlend`,{mode:`normal`,in:`SourceGraphic`,in2:`effect1_dropShadow_ok`,result:`shape`})]})}),t[2]=i):i=t[2];let a;return t[3]===e?a=t[4]:(a=(0,Z.jsxs)(`svg`,{role:`img`,"aria-label":`OpenKnowledge icon`,fill:`none`,height:24,width:24,viewBox:`0 0 78 80`,xmlns:`http://www.w3.org/2000/svg`,...e,children:[n,r,i]}),t[3]=e,t[4]=a),a}var a$=(0,Q.lazy)(()=>n(()=>import(`./ShareReceiveDialog-BDmjkthD.js`).then(e=>({default:e.ShareReceiveDialog})),__vite__mapDeps([105,1,10,3,11,6,7,13,55,15,16,56,64,98,99,100]),import.meta.url)),o$=(e,t,n)=>sg(e,t,n,`NavigatorApp`);function s$(e,t){return e.filter(e=>e.path!==t)}function c$(e){let t=(0,$.c)(106),{bridge:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=[],t[0]=r):r=t[0];let[i,a]=(0,Q.useState)(r),o;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=new Map,t[1]=o):o=t[1];let[s,c]=(0,Q.useState)(o),[l,u]=(0,Q.useState)(!0),[d,f]=(0,Q.useState)(!1),[p,m]=(0,Q.useState)(null),[h,g]=(0,Q.useState)(null),[_,v]=(0,Q.useState)(!1),[y,b]=(0,Q.useState)(!1),[x,S]=(0,Q.useState)(void 0),[C,w]=(0,Q.useState)(void 0),[T,E]=(0,Q.useState)(!1),[D,O]=(0,Q.useState)(!1),[k,A]=(0,Q.useState)(null),j=typeof window<`u`&&window.okDesktop!=null,[M,N]=(0,Q.useState)(`auth`),{theme:P}=Ln(),{_:F}=an();Lo(n,P??`system`);let I;t[2]!==F||t[3]!==n.project?(I=()=>{let e=!1;return n.project.listRecent().then(async t=>{if(e)return;a(t);let r=t.filter(l$),i=await Promise.all(r.map(async e=>{try{let{currentBranch:t}=await n.project.readHeadBranch(e.path);return[e.path,t]}catch{return[e.path,null]}}));e||c(e=>{let t=new Map(e);for(let[e,n]of i)t.set(e,n);return t})}).catch(t=>{console.error(`[NavigatorApp] listRecent failed:`,t),e||(m(t instanceof Error?t.message:F({id:`fYKgzG`})),f(!0))}).finally(()=>{e||u(!1)}),()=>{e=!0}},t[2]=F,t[3]=n.project,t[4]=I):I=t[4];let L;t[5]!==F||t[6]!==n?(L=[n,F],t[5]=F,t[6]=n,t[7]=L):L=t[7],(0,Q.useEffect)(I,L);let R,z;t[8]===n?(R=t[9],z=t[10]):(R=()=>n.onMenuAction(e=>{e===`new-project`&&b(!0),e===`close-active-tab-or-window`&&window.close()}),z=[n],t[8]=n,t[9]=R,t[10]=z),(0,Q.useEffect)(R,z);let B;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(B=(e,t)=>o$(e,t,m),t[11]=B):B=t[11];let V=B,H;t[12]!==F||t[13]!==n?(H=(e,t,r)=>V(()=>(g(r),p$(n,e,t).finally(()=>g(null))),F({id:`SUOoXn`})),t[12]=F,t[13]=n,t[14]=H):H=t[14];let U=H,W;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(W=()=>v(!0),t[15]=W):W=t[15];let G=W,K;t[16]!==F||t[17]!==n?(K=()=>V(async()=>{let e=await n.dialog.openFolder();e&&(g(m$(e)),await p$(n,e,`pick-existing`).finally(()=>g(null)))},F({id:`gmJ0An`})),t[16]=F,t[17]=n,t[18]=K):K=t[18];let ee=K,te;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(te=()=>b(!0),t[19]=te):te=t[19];let ne=te,re;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(re=(e,t)=>{S(e),w(t),b(!0)},t[20]=re):re=t[20];let ie=re,ae;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(ae=e=>{b(e),e||(S(void 0),w(void 0))},t[21]=ae):ae=t[21];let oe=ae,se;t[22]===U?se=t[23]:(se=e=>U(e,`recents`,m$(e)),t[22]=U,t[23]=se);let ce=se,le;t[24]!==F||t[25]!==n.project?(le=e=>V(async()=>{await n.project.removeRecent(e),a(t=>s$(t,e)),c(t=>{if(!t.has(e))return t;let n=new Map(t);return n.delete(e),n})},F({id:`viwC-K`})),t[24]=F,t[25]=n.project,t[26]=le):le=t[26];let q=le,ue;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(ue=(0,Z.jsx)(`div`,{className:`pointer-events-none absolute inset-x-0 top-0 z-10 h-9 ${j?`[-webkit-app-region:drag]`:``}`,"data-electron-drag":j?``:void 0,"data-testid":`nav-chrome-row`}),t[27]=ue):ue=t[27];let de;t[28]!==F||t[29]!==h?(de=h===null?null:(0,Z.jsxs)(`div`,{className:`absolute inset-0 z-20 flex flex-col items-center justify-center gap-3 bg-primary-foreground/85 dark:bg-background/85 backdrop-blur-sm`,"data-testid":`nav-opening-overlay`,role:`status`,"aria-live":`polite`,children:[(0,Z.jsx)(is,{className:`size-6 animate-spin text-muted-foreground`}),(0,Z.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:F({id:`s0_GnA`,values:{openingLabel:h}})})]}),t[28]=F,t[29]=h,t[30]=de):de=t[30];let fe;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(fe=(0,Z.jsx)(i$,{className:`size-12 shrink-0`}),t[31]=fe):fe=t[31];let pe;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(pe=(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(`h1`,{className:`font-medium text-xl tracking-tight`,children:`OpenKnowledge`}),(0,Z.jsx)(GN,{})]}),t[32]=pe):pe=t[32];let me;t[33]===n.appVersion?me=t[34]:(me=(0,Z.jsxs)(`header`,{className:`shrink-0 flex-wrap flex items-center gap-2.5`,children:[fe,(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[pe,(0,Z.jsxs)(`p`,{className:`text-muted-foreground text-xs font-mono`,children:[`v`,n.appVersion]})]})]}),t[33]=n.appVersion,t[34]=me);let he;t[35]!==F||t[36]!==l||t[37]!==ee||t[38]!==i||t[39]!==d?(he=l?null:!d&&i.length===0?(0,Z.jsx)(d$,{onPackSelect:ie,onOpenFolder:ee,onClone:G,onCreate:ne}):(0,Z.jsxs)(`section`,{className:`grid shrink-0 sm:grid-cols-3 gap-3`,children:[(0,Z.jsx)(u$,{title:F({id:`wbv9xO`}),description:F({id:`0uTHCg`}),onClick:ne,dataTestId:`nav-create-new`,Icon:ge}),(0,Z.jsx)(u$,{title:F({id:`WPwDin`}),description:F({id:`tUvUfp`}),onClick:ee,dataTestId:`nav-open`,Icon:Bo}),(0,Z.jsx)(u$,{title:F({id:`VdXv4D`}),description:F({id:`JOcPqH`}),onClick:G,dataTestId:`nav-clone`,Icon:EF})]}),t[35]=F,t[36]=l,t[37]=ee,t[38]=i,t[39]=d,t[40]=he):he=t[40];let _e;t[41]===p?_e=t[42]:(_e=p===null?null:(0,Z.jsxs)(`div`,{className:`flex shrink-0 items-start justify-between gap-3 rounded-md border border-red-500/30 bg-red-500/10 px-3 py-2`,"data-testid":`nav-error-banner`,role:`alert`,children:[(0,Z.jsx)(`span`,{className:`text-red-700 text-xs dark:text-red-300`,children:p}),(0,Z.jsx)(X,{type:`button`,variant:`link`,size:`sm`,onClick:()=>m(null),className:`h-auto p-0 text-red-700 text-xs dark:text-red-300`,"data-testid":`nav-error-dismiss`,children:(0,Z.jsx)(J,{id:`1QfxQT`})})]}),t[41]=p,t[42]=_e);let ve;t[43]!==l||t[44]!==ce||t[45]!==q||t[46]!==s||t[47]!==i?(ve=l?(0,Z.jsx)(`section`,{className:`flex shrink-0 flex-col items-center`,children:(0,Z.jsx)(is,{className:`size-4 animate-spin text-muted-foreground/60`})}):i.length>0?(0,Z.jsxs)(`section`,{className:`flex min-h-0 flex-col`,children:[(0,Z.jsx)(`h2`,{className:`mb-2 shrink-0 font-medium text-muted-foreground font-mono text-xs uppercase tracking-wide`,children:(0,Z.jsx)(J,{id:`CCTop_`})}),(0,Z.jsx)(`ul`,{className:`min-h-0 max-h-48 subtle-scrollbar scroll-fade-mask overflow-y-auto space-y-0.5 -mx-4`,"data-testid":`nav-recent-list`,children:i.map(e=>(0,Z.jsx)(f$,{project:e,branch:s.get(e.path)??null,onOpen:()=>ce(e.path),onRemove:()=>q(e.path)},e.path))})]}):null,t[43]=l,t[44]=ce,t[45]=q,t[46]=s,t[47]=i,t[48]=ve):ve=t[48];let ye;t[49]!==me||t[50]!==he||t[51]!==_e||t[52]!==ve?(ye=(0,Z.jsx)(`div`,{className:`mx-auto flex h-full w-full max-w-5xl flex-col overflow-hidden px-12 py-12`,children:(0,Z.jsxs)(`div`,{className:`my-auto flex min-h-0 flex-col space-y-10`,children:[me,he,_e,ve]})}),t[49]=me,t[50]=he,t[51]=_e,t[52]=ve,t[53]=ye):ye=t[53];let be,xe;t[54]===Symbol.for(`react.memo_cache_sentinel`)?(be=(0,Z.jsx)($Z,{}),xe=(0,Z.jsx)(t$,{}),t[54]=be,t[55]=xe):(be=t[54],xe=t[55]);let Se;t[56]!==n||t[57]!==y||t[58]!==x||t[59]!==C?(Se=(0,Z.jsx)(pm,{open:y,onOpenChange:oe,bridge:n,initialPackId:x,packs:C}),t[56]=n,t[57]=y,t[58]=x,t[59]=C,t[60]=Se):Se=t[60];let Ce;t[61]===k?Ce=t[62]:(Ce=e=>{E(e),e||(O(!1),k&&(k(null),A(null)))},t[61]=k,t[62]=Ce);let we;t[63]===n?we=t[64]:(we=Pa(n),t[63]=n,t[64]=we);let Te;t[65]===n?Te=t[66]:(Te=La(n),t[65]=n,t[66]=Te);let Ee=M===`identity`,De;t[67]!==D||t[68]!==k?(De=e=>{E(!1),D&&(O(!1),v(!0)),k&&(k({authenticated:!0,host:`github.com`,login:e.login}),A(null))},t[67]=D,t[68]=k,t[69]=De):De=t[69];let Oe;t[70]!==T||t[71]!==Ce||t[72]!==we||t[73]!==Te||t[74]!==Ee||t[75]!==De?(Oe=(0,Z.jsx)(qa,{open:T,onOpenChange:Ce,transport:we,queryTransport:Te,identityPrompt:Ee,onSuccess:De}),t[70]=T,t[71]=Ce,t[72]=we,t[73]=Te,t[74]=Ee,t[75]=De,t[76]=Oe):Oe=t[76];let ke;t[77]===n?ke=t[78]:(ke=WQ(n),t[77]=n,t[78]=ke);let Ae;t[79]===n?Ae=t[80]:(Ae=La(n),t[79]=n,t[80]=Ae);let je;t[81]===n.dialog?je=t[82]:(je=()=>n.dialog.openFolder(),t[81]=n.dialog,t[82]=je);let Me;t[83]===Symbol.for(`react.memo_cache_sentinel`)?(Me=()=>{v(!1),N(`auth`),O(!0),E(!0)},t[83]=Me):Me=t[83];let Ne;t[84]!==F||t[85]!==n?(Ne=e=>{let{dir:t}=e;V(()=>(g(m$(t)),p$(n,t,`pick-existing`).finally(()=>g(null))),F({id:`iSnkwB`}))},t[84]=F,t[85]=n,t[86]=Ne):Ne=t[86];let Pe;t[87]!==_||t[88]!==ke||t[89]!==Ae||t[90]!==je||t[91]!==Ne?(Pe=(0,Z.jsx)(qQ,{open:_,onOpenChange:v,transport:ke,authQueryTransport:Ae,pickParentFolder:je,onSignIn:Me,onCloneComplete:Ne}),t[87]=_,t[88]=ke,t[89]=Ae,t[90]=je,t[91]=Ne,t[92]=Pe):Pe=t[92];let Fe;if(t[93]!==n){let e;t[95]===Symbol.for(`react.memo_cache_sentinel`)?(e=()=>new Promise(e=>{A(()=>e),E(!0)}),t[95]=e):e=t[95],Fe=HQ({bridge:n,authQueryTransport:La(n),cloneTransport:WQ(n),openSignIn:e}),t[93]=n,t[94]=Fe}else Fe=t[94];let Ie;t[96]!==n||t[97]!==Fe?(Ie=(0,Z.jsx)(Q.Suspense,{fallback:null,children:(0,Z.jsx)(a$,{bridge:n,cloneController:Fe})}),t[96]=n,t[97]=Fe,t[98]=Ie):Ie=t[98];let Le;return t[99]!==de||t[100]!==ye||t[101]!==Se||t[102]!==Oe||t[103]!==Pe||t[104]!==Ie?(Le=(0,Z.jsxs)(`div`,{className:`relative flex h-screen w-screen flex-col overflow-hidden bg-primary-foreground dark:bg-background text-foreground`,children:[ue,de,ye,be,xe,Se,Oe,Pe,Ie]}),t[99]=de,t[100]=ye,t[101]=Se,t[102]=Oe,t[103]=Pe,t[104]=Ie,t[105]=Le):Le=t[105],Le}function l$(e){return!e.missing}function u$(e){let t=(0,$.c)(14),{title:n,description:r,onClick:i,dataTestId:a,Icon:o}=e,s;t[0]===o?s=t[1]:(s=o?(0,Z.jsx)(o,{className:`size-4 shrink-0 text-muted-foreground`}):null,t[0]=o,t[1]=s);let c;t[2]===n?c=t[3]:(c=(0,Z.jsx)(`span`,{className:`font-medium text-gray-700 dark:text-foreground text-sm`,children:n}),t[2]=n,t[3]=c);let l;t[4]!==s||t[5]!==c?(l=(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[s,c]}),t[4]=s,t[5]=c,t[6]=l):l=t[6];let u;t[7]===r?u=t[8]:(u=(0,Z.jsx)(`span`,{className:`line-clamp-2 text-muted-foreground text-xs leading-snug`,children:r}),t[7]=r,t[8]=u);let d;return t[9]!==a||t[10]!==i||t[11]!==l||t[12]!==u?(d=(0,Z.jsxs)(X,{type:`button`,variant:`outline`,onClick:i,"data-testid":a,className:`h-auto flex-col items-start justify-start gap-1.5 whitespace-normal bg-card px-4 py-3.5 text-left`,children:[l,u]}),t[9]=a,t[10]=i,t[11]=l,t[12]=u,t[13]=d):d=t[13],d}function d$(e){let t=(0,$.c)(31),{onPackSelect:n,onOpenFolder:r,onClone:i,onCreate:a}=e,[o,s]=(0,Q.useState)(null),c,l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=()=>{let e=!1;return(async()=>{try{let t=await Ih().listPacks();if(e)return;t.ok?s(t.packs):(console.error(`[NavigatorApp] listPacks returned error:`,t),s([]))}catch(t){let n=t;if(e)return;console.error(`[NavigatorApp] listPacks failed:`,n),s([])}})(),()=>{e=!0}},l=[],t[0]=c,t[1]=l):(c=t[0],l=t[1]),(0,Q.useEffect)(c,l);let u;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Z.jsx)(`h2`,{className:`text-xl font-light tracking-tighter text-balance`,children:(0,Z.jsx)(J,{id:`QnjpOq`})}),t[2]=u):u=t[2];let d;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Z.jsxs)(`div`,{className:`flex shrink-0 flex-col gap-1`,children:[u,(0,Z.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:(0,Z.jsx)(J,{id:`gYuDfu`})})]}),t[3]=d):d=t[3];let f;t[4]!==n||t[5]!==o?(f=e=>n(e,o??[]),t[4]=n,t[5]=o,t[6]=f):f=t[6];let p;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(p=[`okf`,`entity-vault`],t[7]=p):p=t[7];let m;t[8]!==o||t[9]!==f?(m=(0,Z.jsx)(`div`,{className:`-m-1 min-h-0 flex-1 overflow-y-auto subtle-scrollbar p-1`,children:(0,Z.jsx)(zh,{packs:o,onPackSelect:f,collapsedPackIds:p})}),t[8]=o,t[9]=f,t[10]=m):m=t[10];let h;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,Z.jsx)(`span`,{className:`text-muted-foreground text-sm`,children:(0,Z.jsx)(J,{id:`S34Vju`})}),t[11]=h):h=t[11];let g,_;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,Z.jsx)(Bo,{"aria-hidden":`true`,className:`size-3.5`}),g=(0,Z.jsx)(J,{id:`PVUn_c`}),t[12]=g,t[13]=_):(g=t[12],_=t[13]);let v;t[14]===r?v=t[15]:(v=(0,Z.jsxs)(X,{type:`button`,variant:`link-muted`,size:`sm`,onClick:r,"data-testid":`nav-first-run-open`,children:[_,g]}),t[14]=r,t[15]=v);let y,b;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Z.jsx)(EF,{"aria-hidden":`true`,className:`size-3.5`}),b=(0,Z.jsx)(J,{id:`VdXv4D`}),t[16]=y,t[17]=b):(y=t[16],b=t[17]);let x;t[18]===i?x=t[19]:(x=(0,Z.jsxs)(X,{type:`button`,variant:`link-muted`,size:`sm`,onClick:i,"data-testid":`nav-first-run-clone`,children:[y,b]}),t[18]=i,t[19]=x);let S,C;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,Z.jsx)(ge,{"aria-hidden":`true`,className:`size-3.5`}),C=(0,Z.jsx)(J,{id:`ircigK`}),t[20]=S,t[21]=C):(S=t[20],C=t[21]);let w;t[22]===a?w=t[23]:(w=(0,Z.jsxs)(X,{type:`button`,variant:`link-muted`,size:`sm`,onClick:a,"data-testid":`nav-first-run-blank`,children:[S,C]}),t[22]=a,t[23]=w);let T;t[24]!==v||t[25]!==x||t[26]!==w?(T=(0,Z.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-x-3 gap-y-1`,"data-testid":`nav-first-run-secondary`,children:[h,(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-1 gap-y-1`,children:[v,x,w]})]}),t[24]=v,t[25]=x,t[26]=w,t[27]=T):T=t[27];let E;return t[28]!==T||t[29]!==m?(E=(0,Z.jsxs)(`section`,{className:`flex min-h-0 shrink flex-col gap-6`,"data-testid":`nav-first-run`,children:[d,m,T]}),t[28]=T,t[29]=m,t[30]=E):E=t[30],E}function f$(e){let t=(0,$.c)(44),{project:n,branch:r,onOpen:i,onRemove:a}=e,{_:o}=an(),{name:s}=n,c=n.isLinkedWorktree===!0,l=c?n.branch??r:r,u=n.missing,d=n.missing&&`opacity-50`,f;t[0]===d?f=t[1]:(f=Y(`h-auto min-w-0 flex-1 justify-between gap-3 py-3.5 pl-4 pr-2 text-left hover:bg-transparent`,d),t[0]=d,t[1]=f);let p;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Z.jsx)(Wd,{"aria-hidden":`true`,className:`size-[18px] shrink-0 text-muted-foreground`}),t[2]=p):p=t[2];let m;t[3]===n.name?m=t[4]:(m=(0,Z.jsx)(`span`,{className:`truncate font-medium text-sm text-gray-700 dark:text-foreground`,children:n.name}),t[3]=n.name,t[4]=m);let h;t[5]===c?h=t[6]:(h=c?(0,Z.jsxs)(Ae,{variant:`secondary`,className:`shrink-0 gap-1 rounded-full border-transparent bg-green-600/10 px-2 py-0 font-medium text-2xs text-green-800 dark:bg-green-400/10 dark:text-green-400`,children:[(0,Z.jsx)(Vo,{"aria-hidden":`true`,className:`size-2.5`}),(0,Z.jsx)(J,{id:`z-lawV`})]}):null,t[5]=c,t[6]=h);let g;t[7]!==m||t[8]!==h?(g=(0,Z.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[m,h]}),t[7]=m,t[8]=h,t[9]=g):g=t[9];let _=c?n.mainRoot??``:n.path,v;t[10]!==c||t[11]!==n.mainRoot||t[12]!==n.path?(v=c?(0,Z.jsx)(J,{id:`PRnH8G`,values:{0:gg(n.mainRoot??``)}}):n.path,t[10]=c,t[11]=n.mainRoot,t[12]=n.path,t[13]=v):v=t[13];let y;t[14]!==_||t[15]!==v?(y=(0,Z.jsx)(`span`,{className:`truncate w-full text-muted-foreground text-xs`,title:_,children:v}),t[14]=_,t[15]=v,t[16]=y):y=t[16];let b;t[17]!==y||t[18]!==g?(b=(0,Z.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[p,(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1 truncate`,children:[g,y]})]}),t[17]=y,t[18]=g,t[19]=b):b=t[19];let x;t[20]!==n.missing||t[21]!==n.path||t[22]!==l?(x=n.missing?(0,Z.jsx)(Ae,{className:`text-2xs rounded-sm`,variant:`warning`,children:(0,Z.jsx)(J,{id:`VU3Nrn`})}):l==null?null:(0,Z.jsxs)(`span`,{className:`flex max-w-[40%] items-center gap-1 text-muted-foreground text-xs`,"data-testid":`nav-recent-branch-${n.path}`,children:[(0,Z.jsx)(Vo,{"aria-hidden":`true`,className:`size-3 shrink-0`}),(0,Z.jsx)(`span`,{className:`truncate font-mono`,children:l})]}),t[20]=n.missing,t[21]=n.path,t[22]=l,t[23]=x):x=t[23];let S;t[24]!==i||t[25]!==n.missing||t[26]!==b||t[27]!==x||t[28]!==f?(S=(0,Z.jsxs)(X,{type:`button`,variant:`ghost`,onClick:i,disabled:u,className:f,children:[b,x]}),t[24]=i,t[25]=n.missing,t[26]=b,t[27]=x,t[28]=f,t[29]=S):S=t[29];let C;t[30]!==o||t[31]!==s?(C=o({id:`hDoLrm`,values:{projectName:s}}),t[30]=o,t[31]=s,t[32]=C):C=t[32];let w;t[33]===o?w=t[34]:(w=o({id:`Es-eZU`}),t[33]=o,t[34]=w);let T=`nav-recent-remove-${n.path}`,E;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,Z.jsx)(xs,{"aria-hidden":`true`}),t[35]=E):E=t[35];let D;t[36]!==a||t[37]!==C||t[38]!==w||t[39]!==T?(D=(0,Z.jsx)(X,{type:`button`,variant:`ghost`,size:`icon-sm`,onClick:a,"aria-label":C,title:w,className:`pointer-events-none mr-2 opacity-0 group-hover:pointer-events-auto group-hover:opacity-100 focus-visible:pointer-events-auto focus-visible:opacity-100`,"data-testid":T,children:E}),t[36]=a,t[37]=C,t[38]=w,t[39]=T,t[40]=D):D=t[40];let O;return t[41]!==S||t[42]!==D?(O=(0,Z.jsxs)(`li`,{className:`group flex items-center justify-between rounded-lg hover:bg-accent`,children:[S,D]}),t[41]=S,t[42]=D,t[43]=O):O=t[43],O}async function p$(e,t,n){await e.project.open({path:t,target:`new-window`,entryPoint:n})}function m$(e){let t=e.split(/[/\\]/).filter(Boolean);return t.length>0?t[t.length-1]??e:e}function h$(e){let t=(0,$.c)(5),{bridge:n}=e,r=n.config.collabUrl?n.config.collabUrl:null,i;t[0]===n?i=t[1]:(i=(0,Z.jsx)(g$,{bridge:n}),t[0]=n,t[1]=i);let a;return t[2]!==r||t[3]!==i?(a=(0,Z.jsx)(Ro,{collabUrl:r,children:i}),t[2]=r,t[3]=i,t[4]=a):a=t[4],a}function g$(e){let t=(0,$.c)(11),{bridge:n}=e,{resolvedTheme:r}=Ln(),i=t_(),[a,o]=(0,Q.useState)(null),s;t[0]===r?s=t[1]:(s=Eu(r),t[0]=r,t[1]=s);let c;t[2]===s.background?c=t[3]:(c=(0,Z.jsx)(`div`,{ref:o,className:`flex h-screen min-h-0 flex-col`,style:{backgroundColor:s.background}}),t[2]=s.background,t[3]=c);let l;t[4]!==n||t[5]!==a||t[6]!==i?(l=(0,Z.jsx)(hI,{bridge:n,variant:`window`,visible:!0,onVisibleChange:v$,installedClis:i,container:a,isShowing:!0,onRequestEditorFocus:_$}),t[4]=n,t[5]=a,t[6]=i,t[7]=l):l=t[7];let u;return t[8]!==c||t[9]!==l?(u=(0,Z.jsxs)(Z.Fragment,{children:[c,l]}),t[8]=c,t[9]=l,t[10]=u):u=t[10],u}function _$(){}function v$(e){e||window.close()}function y$(e){return e?.config.mode===`terminal`?(0,Z.jsx)(h$,{bridge:e}):e?.config.mode===`navigator`?(0,Z.jsx)(c$,{bridge:e}):(0,Z.jsx)(RQ,{})}var b$=e=>{let t=(0,$.c)(8),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let{theme:r}=Ln(),i=r===void 0?`system`:r,a,o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(a={success:(0,Z.jsx)(ta,{className:`size-4`}),info:(0,Z.jsx)(rs,{className:`size-4`}),warning:(0,Z.jsx)(ds,{className:`size-4`}),error:(0,Z.jsx)(sf,{className:`size-4`}),loading:(0,Z.jsx)(is,{className:`size-4 animate-spin`})},o={"--normal-bg":`var(--popover)`,"--normal-text":`var(--popover-foreground)`,"--normal-border":`var(--border)`,"--border-radius":`var(--radius)`},t[2]=a,t[3]=o):(a=t[2],o=t[3]);let s;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(s={classNames:{toast:`cn-toast`}},t[4]=s):s=t[4];let c;return t[5]!==n||t[6]!==i?(c=(0,Z.jsx)(Ss,{theme:i,className:`toaster group`,icons:a,style:o,toastOptions:s,...n}),t[5]=n,t[6]=i,t[7]=c):c=t[7],c},x$=Symbol.for(`ok.client.fetchWrapper`);function S$(e={}){if(typeof window>`u`)return;let t=e.apiOrigin&&e.apiOrigin.length>0?e.apiOrigin:void 0;if(window.fetch[x$])return;let n=window.fetch.bind(window),r=Fo(),i=((e,i)=>{let a=w$(e,t);if(!a.isApi)return n(e,i);if(e instanceof Request){let t=C$(e.headers,r);return n(new Request(a.url,e),{headers:t})}let o=C$(i?.headers,r);return n(a.url,{...i,headers:o})});i[x$]=!0,window.fetch=i}function C$(e,t){let n=new Headers(e);for(let[e,r]of Object.entries(t))n.set(e,r);return n}function w$(e,t){if(typeof e==`string`){if(e.startsWith(`/api/`))return{isApi:!0,url:t?t+e:e};let n=T$(e);return n&&E$(n,t)?{isApi:!0,url:e}:{isApi:!1,url:e}}let n=e instanceof URL?e:T$(e.url,window.location.origin);if(n&&E$(n,t)){let r=e instanceof URL?e.href:e.url;return t&&(n.origin===window.location.origin||n.protocol===`file:`)?{isApi:!0,url:t+n.pathname+n.search+n.hash}:{isApi:!0,url:r}}return{isApi:!1,url:e instanceof URL?e.href:e.url}}function T$(e,t){try{return new URL(e,t)}catch{return null}}function E$(e,t){if(!e.pathname.startsWith(`/api/`))return!1;if(e.origin===window.location.origin||e.protocol===`file:`)return!0;if(t){let n=T$(t);if(n&&e.origin===n.origin)return!0}return!1}var D$={messages:JSON.parse(`{"--T3kB":["Loading preview"],"-3Qbv7":[["count","plural",{"one":["matches ","#"," file"],"other":["matches ","#"," files"]}]],"-3ois8":["Hard break"],"-5jISU":[["0","plural",{"one":["#"," template"],"other":["#"," templates"]}]],"-8PP0T":["Match case"],"-K0AvT":["Disconnect"],"-LHLx7":["edited template"],"-QCLWk":["Templates available"],"-Qw-1t":["GitHub authentication failed. Try signing in again."],"-WFFG2":["Default properties"],"-YV1Uo":["Pattern ",["patternNumber"]],"-g6KIS":["Unrecognized link"],"-gdcIo":["Auto-sync is on — your commits push and remote changes pull on intervals."],"-i7ik4":["Collapse burst ",["burstNumber"]," diff"],"-lCAuQ":["Loading graph"],"-q4abP":["Results capped — this workspace has more files than search can index. A missing file may be a cap artifact, not a typo."],"-r_Kx7":["Create skill"],"-slrNR":["Toggle a task list."],"-uaQnI":["No matching worktrees or branches."],"-wePNM":["Search matches file names, paths, and folders. Open a file to search its body (⌘F)."],"-zA2E7":["Couldn't create the worktree. Try a different name."],"-zy2Nq":["Type"],"0-31GV":["Removing"],"02P3hL":["Upload failed: ",["message"]],"04RA0-":["Failed to enable sync — ",["detail"]],"04XyCH":["Adds a managed block to ",["0"]],"05n5wS":["Doc mention suggestions"],"06SZfb":["Template \\"",["trimmedTitle"],"\\" created"],"07eGJB":["Couldn't move skill: ",["0"]],"07gHun":["You don't have access to this private repo. Sign in with an account that does."],"07q4Qk":["File sidebar"],"09Tv5j":["Reconnecting…"],"0BB9ID":["No headings yet."],"0BfhAj":["Reset view"],"0E9DR6":["Type to find a doc"],"0Er6-M":["Restarting"],"0Gd0NU":["Shared"],"0LBDjY":["\\"",["0"],"\\" uninstalled — back to a draft"],"0NA4b3":["Keep my version"],"0SBTff":["Show terminal"],"0YEbfk":["Connect to AI tools"],"0YUS3Q":["Subfolder under current folder"],"0_J12R":["New file from template \\"",["displayTitle"],"\\" (",["fileName"],") in ",["targetLabel"]],"0eHrMb":["Could not complete delete"],"0g7rCZ":["Duplicated to \\"",["0"],"\\""],"0inVGS":["Helps your coding agent recognize OpenKnowledge projects and route reads and writes through it."],"0jD-Gn":["A team knowledge base, a personal wiki, project docs..."],"0kTAXe":["Open source: ",["mirrorSrc"]],"0njBIq":["Setup files include: <0>.ok/</0>, AI-tool MCP configs (<1>.mcp.json</1> and per-tool files), project skills, and <2>.claude/launch.json</2>.<3/><4>Shared</4> commits them to git, so anyone who clones the repo gets the same setup. <5/><6>Local only</6> keeps them out of git (via <7>.git/info/exclude</7>)."],"0rwwOn":["By tag"],"0s8-e8":["Select, enter, or leave block components and fallback source blocks from keyboard boundaries."],"0t0bbC":["Could not save sync preference: ",["detail"]],"0uTHCg":["Start a new OpenKnowledge project."],"0wswKc":["Horizontal rule that divides sections."],"0xnmlQ":["Repository name"],"0yL--g":["Review conflicts"],"12F9WL":["(no id)"],"16D5Zj":["Are you sure you want to delete ",["itemName"],"? This action cannot be undone."],"1AumWo":["Push failed — check the server logs for details."],"1EcCom":[["keyName"]," value"],"1FLarN":["Describe what you want to create to continue"],"1GhYxC":["of ",["totalPages"]],"1HBhDS":["Checking out files"],"1MGRQl":["Terminal sessions"],"1QfxQT":["Dismiss"],"1RluQD":["Show replace"],"1TNIig":["Open"],"1Ta7Fd":["Open ",["basename"]],"1XSMhZ":["Switching to <0>local-only</0> will refuse until they're untracked via<1> git rm --cached</1>."],"1YJ4Yg":["Update available",["0"]],"1ZpfyB":["Open with AI ",["displayName"],", ",["hint"]],"1bDVu5":["Workspace Command Palette"],"1d1F11":["Select all files and folders"],"1di5fu":["Document not found"],"1hvhf0":["The folder on disk and the id agents use to invoke this skill."],"1nke1r":["Open ",["0"]," on GitHub (opens in a new tab)"],"1t_NnN":["Reject"],"2277Tu":["Collapse graph"],"237hSL":["Ended"],"25Pw6a":["Cloning"],"27XW26":["Clone happens in the Project Navigator. Reclick the share link there."],"28B21t":["Agent Skills"],"29VNqC":["Unknown error"],"29XZXN":["Set git identity"],"2B6eYX":["What this checkbox changes"],"2BBAbc":["List"],"2FYpfJ":["More"],"2GT3Hf":["Global"],"2IYGkU":["This doc has unpushed changes. Recipients will see the last pushed version."],"2QM24L":["All tags"],"2RBzMG":["Network error — check your connection and try again"],"2XQ8Ww":["Open preview when agent edits"],"2YOwme":["Restarted — now running v",["appRuntime"],"."],"2YZwPB":["Forward-links response did not match expected shape."],"2bVHbB":["Available in every project on this computer."],"2fkdnR":["Nothing to undo on this file"],"2hYmUH":["my@email.com"],"2hpdRq":["Hide panel (",["panelShortcutLabel"],")"],"2n3oDU":["Project-level pages ordered by inbound link count, up to ",["FULLSCREEN_HUB_LIMIT"]," results."],"2q_Q7x":["Visibility"],"2ryd91":["Failed to rename property"],"2tgFCe":["Starting clone"],"2vIPtm":["Open link in new tab"],"2wxgft":["Rename"],"322lyb":["Highlight tips, warnings, and notes."],"34qyH5":["Could not reach server"],"36WXSC":["Couldn't delete template: ",["error"]],"36aWJD":["Join us on Discord"],"379t2h":["Unified diff"],"38foVZ":["Loading diff"],"3BnyYc":["This doc isn't on GitHub yet. The link won't work until it's pushed."],"3DTatP":["Copy a prompt for your agent, start a blank file, or scaffold from a template."],"3FMvls":["A short line shown under the title in the template list."],"3Fcb0I":["Open graph"],"3HNlwb":["Hello, world!"],"3Ib6FN":["Move down"],"3Ijjy1":["Couldn't load this skill's files."],"3IseAk":["Install an AI agent to create with AI"],"3J7d2N":["Big section heading."],"3JYy1p":["Branch ",["0"]," no longer exists. Cloned to default branch."],"3MnvrL":["Showing top ",["0"]," matches — keep typing to narrow"],"3Mwaly":["Could not initialize ",["0"],"."],"3SDfZl":["<0>Mirror — pick a source.</0> Set <1>src</1> + <2>anchor</2> via the property panel to point at a <3><MirrorSource></3> elsewhere."],"3TCafD":["Stored on this machine."],"3VbwPp":["Open ",["keyName"]," in browser"],"3VsNTI":["Loading document"],"3YvS-c":["New tab"],"3_6U6f":["Connect to GitHub"],"3__SjS":["breadcrumb"],"3a_Bd7":["Open source doc: ",["mirrorSrc"]],"3aeN7X":["All files"],"3cOo2C":["Create a folder from the current document or folder context."],"3ePd3I":["What's new"],"3h5zMp":["Something went wrong loading the settings panel."],"3iyGWF":["Open recent project"],"3jod3l":["Connect GitHub"],"3m2GBo":["Searching docs"],"3mFsc3":["Restore with remote changes"],"3o3tur":["Starter content"],"3oh0nQ":["Nested .okignore error in ",["path"]],"3pU8e-":["Pin tab"],"3wiBAs":["Where should it live?"],"3y6XTb":["Semantic search"],"3zyg_A":["Ignore patterns"],"438Fca":["Cloned successfully, but could not open the project."],"44DSl0":["Already have a git repository? Add it with <0>git remote add origin <url></0> in this project's folder. This page updates automatically once a remote is detected."],"45MZFs":["Commands"],"47EXvY":["This replaces the current skill content with the bundled version ",["0"]," (you have ",["1"],"). Any local edits will be replaced — your current version is saved to history first, so you can restore it."],"484LKL":["Remove link"],"48uGTI":["Failed to load docs. Press Escape and re-open to retry."],"4A3Yzu":["Code block"],"4BITzH":["Error:"],"4CfgPM":["Project folder created, but git init failed. Try again."],"4E9jPa":["Create your first project"],"4Gz2wC":["Failed to upload file"],"4KmEoC":["Hotkeys"],"4NC2Ym":["Move to the next or previous table cell."],"4PYsOz":["Hide Files (",["sidebarShortcutLabel"],")"],"4Sxexw":["Source undo or redo"],"4TzU0n":["Initialize"],"4XL6N4":["Detected from the editors this project is set up for. Adjust to control where every skill installs."],"4buZWd":["Inherited from ",["path"]],"4c_a6S":["Nothing set yet."],"4g19V6":["Failed to update property"],"4hJhzz":["Table"],"4jDd0j":["Anyone can see"],"4mLBx9":["Subscriptions aren't available right now."],"4niEzY":["Sandboxed HTML embed — write HTML, see the rendered preview live."],"4nj6n8":["/api/config returned HTTP ",["code"]],"4rjwLG":["Create with ",["0"]," CLI"],"4sKwf6":["File already exists"],"4uNLmk":["Pulling"],"4v2Yyz":["Select every visible file-tree row when focus is in the Files sidebar."],"4xtLTl":["Hidden folder “",["basename"],"”"],"4zEZS5":["Auto-sync is on for this worktree, inherited from ",["project"],". Change it in Settings → Sync."],"4zGlN_":["Paste image URL or click upload"],"5-FeN2":["Share URL"],"54Y6Fg":["Could not load templates. Try again later."],"56WWtu":["Couldn't load starter packs: ",["error"]],"56xUL1":["Property name"],"57fiu8":["(read-only — edit in source mode for now)"],"5ALjdr":["Move through visual-editor find results from the find field."],"5Ajb15":["The formula <0>c = √(a² + b²)</0> renders inline."],"5ClEAu":["Inline hashtag for cross-doc grouping."],"5D3Ior":["Hide folder"],"5DFPDh":["Started a fresh OpenKnowledge server (v",["appRuntime"],") for this dev session — the server already running for this project was terminated. Connected agents (Claude Code, Codex, Cursor) just lost their OpenKnowledge MCP connection; restart the agent, or toggle its OpenKnowledge MCP server off and on, to reconnect."],"5F5HYj":[["ahead"]," ahead, ",["behind"]," behind"],"5GKMSz":["Indent or outdent the current list item."],"5GRxoA":["Search files, folders, and commands for the current workspace."],"5LXwX8":["This permanently removes ",["path"],". Agents that reference this template by name will fail until it's recreated or replaced by one in a parent folder."],"5OTgC7":["Open and focus the bottom Ask AI prompt composer."],"5OqaJi":["Enter a project name"],"5QGTaA":["Could not copy relative path"],"5SwVv1":["Not installed"],"5Tk8Fb":["Loading files"],"5WDhAk":["Link to a page or external URL."],"5ZB7XC":["File drop zone"],"5e1Dri":["The menu label agents pick this template by (required)."],"5gr_ev":["Becomes the document's content when someone creates a doc from this template. Type <0>",["dateToken"],"</0> or <1>",["userToken"],"</1> to fill in today's date or the author's name automatically."],"5kWklo":["(some may already be hidden by other rules)"],"5lWFkC":["Sign in"],"5mksg0":["Failed to disable semantic search — ",["detail"]],"5qNxOe":[["count","plural",{"one":["#"," item could not be moved to the Trash. Do you want to permanently delete instead?"],"other":["#"," items could not be moved to the Trash. Do you want to permanently delete instead?"]}]],"5wV2qQ":["and more"],"5y_9lO":["Waiting for authorization"],"6-wLTJ":[["behind"]," behind origin"],"62Pc08":["Install for Claude Chat & Cowork (Desktop App)"],"636K3K":["Delete adjacent chip"],"67f-3g":["Duplicate succeeded but the sidebar may be out of date — refresh to resync"],"6Aih4U":["Offline"],"6EKG_c":["What agents match on to decide when to use the skill."],"6HCOwA":["Failed to open."],"6LbUG7":["The repository is private and your GitHub account doesn't have access to it."],"6MnZEC":["Terminal failed to load"],"6O626z":["No headings match \\"",["trimmedAnchorQuery"],"\\""],"6Pxqwv":["No project templates yet. Create one to make it available everywhere in this project. Folder-scoped templates live on each folder's overview page."],"6Uau97":["Skip"],"6V3Ea3":["Copied"],"6VqW-1":["Remove ",["keyName"]],"6WdDG7":["Page"],"6YtxFj":["Name"],"6ZhdPI":["What the agent may read, write, and surface."],"6_ZOw4":["Copied full path"],"6bTTAN":["Invalid input — pick a different folder."],"6cR-PU":["Already open"],"6caB2T":["Connect an existing repository"],"6cuT_1":["Open date picker for ",["keyName"]],"6cyguR":["Connect GitHub to continue."],"6eniID":["Map the architecture"],"6fGjTz":["Show fewer"],"6g2jsp":["Update skill"],"6gRgw8":["Retry"],"6h4zVU":["What would you like to create?"],"6hfDJr":["Server error: ",["status"]],"6ibbCg":["Create your first file"],"6ki7F2":[["0","plural",{"one":["#"," item"],"other":["#"," items"]}]],"6lGV3K":["Show less"],"6m_7We":["Open this settings dialog."],"6q0rnH":["writing"],"6qMe0o":["Draft a technical spec for my project. Start with an overview, then add cross-linked pages for the architecture, the key modules, and the open questions, all linked from a specs index."],"6s7LXO":["Heads up"],"6u9LvN":[["days","plural",{"one":["#"," day ago"],"other":["#"," days ago"]}]],"6vEr3W":["Link target"],"72xhRD":["Diagram view mode"],"74-bX-":["A pull quote stands out from the surrounding text."],"74eHt-":["No file or folder selected"],"75Y1dk":["Horizontal pill strip + active panel below; click a pill to switch panels."],"77SdEP":["Delete ",["itemName"]],"7FamGZ":["Go to line"],"7Fkcej":["+ Add ",["addChildName"]],"7H4UHD":["Documents tagged <0>#",["tagName"],"</0>"],"7JtSLi":["Failed to delete path"],"7KeV5F":["Undo all failed: ",["message"]],"7OhaRy":["Source search"],"7Ongq0":["Condense my AGENTS.md file to less than 40k characters"],"7OwvEL":["Show HTML preview"],"7PNNNs":["This sends content off your machine"],"7PXYaF":["<0>ok</0> won't run in external terminals until you add it later from the File menu. OpenKnowledge's built-in terminal and AI tools keep working."],"7PzzBU":["User"],"7YRrJ9":["Available in the OpenKnowledge desktop app. From a terminal, use<0> ok config-sharing status</0> / <1>share</1> / <2>unshare</2>."],"7_bFEL":["Drag ",["patternText"]," to reorder"],"7apDiJ":["A folder named <0>",["sanitized"],"</0> already has files here. Pick a different name."],"7d1a0d":["Public"],"7hctf2":["Describe the project you want to create"],"7jIIFX":["You're all set up!"],"7qRHf0":["Install for Claude Chat & Cowork"],"7uBlRT":["Copy the focused file-tree item so Paste can duplicate it."],"80c4-P":["Code copied to clipboard"],"81H_23":["Add properties"],"881Uwh":["Delete selected table"],"89TtiD":["New file from template \\"",["displayTitle"],"\\" (",["fileName"],") in the project root"],"8BsGpU":["A key is set, but the embeddings provider rejected it or was unreachable — search fell back to keyword matching. Check the key in <0>Settings → Account</0> and your provider settings."],"8F1i42":["Page not found"],"8FqTCr":[["chunksRemaining","plural",{"one":["#"," unresolved hunk"],"other":["#"," unresolved hunks"]}]],"8Gzz2G":["worktree of ",["worktreeOf"]],"8IP5jY":["Each selected tool gets an OpenKnowledge MCP entry."],"8Jm2EP":["Toggle heading levels 1 through 6."],"8OGgNM":["Open or close visual-editor find."],"8OxKZy":["Move succeeded but the sidebar may be out of date — refresh to resync"],"8PmoQF":["Open the insert menu in an empty or active text position."],"8RtNI0":["Failed to load documents"],"8XQRON":["Loading repositories"],"8_brI5":["Name is required"],"8cS0nH":["Config sharing unavailable: ",["0"],"."],"8cpOa8":["Couldn't disconnect — please try again."],"8cpeU3":["Shared repositories"],"8eW0WQ":["No matching repositories."],"8fRyLo":["Invalid patch payload"],"8fc_3j":["Protected branch — cannot push"],"8m8diM":["No location selected. Use Browse to choose a folder."],"8tjQCz":["Explore"],"8uAWix":["This template lives in a parent folder — deleting it affects every folder beneath it that doesn't define its own version."],"92rbk2":["Mirror loading <0>",["mirrorRef"],"</0>"],"96G6Re":["New folder"],"96w9hU":["Something went wrong opening this file (HTTP ",["status"],")."],"99eR72":["Visual editor table selection"],"9Bd18D":["Failed to load hub pages"],"9NJWgv":["Backlinks"],"9OIqw4":["You don't have write access to this repo."],"9PQysm":["Hide advanced"],"9R7pRC":["No tags match \\"",["trimmed"],"\\". Continue typing to create one."],"9UQ730":["Clone"],"9V0W-R":["Adds the OpenKnowledge skill to the <0>Claude Desktop App</0> so it's available in Chat and Cowork sessions."],"9bCiQ8":["No pages are missing incoming graph links."],"9clcD5":["Open documents tagged #",["chip"]],"9dw5bW":["Create with ",["0"]],"9euN0m":[["count","plural",{"one":["#"," more cross-doc participant"],"other":["#"," more cross-doc participants"]}]],"9fhQRL":["Beta channel"],"9fvog2":["Preview unavailable: ",["errorDetail"]],"9i21pa":["Commits happen automatically"],"9jnjV0":["Embed an audio file with native player controls."],"9mEZeD":[["name"]," CLI"],"9npOH9":["Open file"],"9o1bIV":[["behind"]," behind"],"9oE4C3":["Browse your repos:"],"9sBe85":["Follow us on"],"9tJX8r":["By meaning"],"9zb2WA":["Connecting"],"A1taO8":["Search"],"A50vr3":["Use lowercase letters, digits, and <0>-</0> only."],"A5CYnd":["Broken link"],"A5hiCy":["Create template"],"A67Uwj":["Still loading"],"A6h5b-":["File duplicated"],"AAlr5Y":["No collab server for this worktree — run <0>ok start</0> here, or reopen the project."],"AB4qw9":["New terminal"],"AE7BY3":["The terminal session ended."],"AIn2Yv":[["displayName"]," CLI, ",["hint"]],"AItsE5":["Open it there"],"AKxFtn":[["openedWorktreeCount","plural",{"one":["worktree"],"other":["worktrees"]}]],"ALhMYW":["Terminal"],"AQ-Lfg":["Couldn't load templates"],"AQGtjK":["Commands run with the full access of your macOS user account on this machine. Turn this off to disable the shell."],"ATGYL1":["Email address"],"AVW-K9":["Failed to load orphan pages"],"AWOSPo":["Zoom in"],"AaaESH":["Auto-sync is off for this worktree, inherited from ",["project"],". Change it in Settings → Sync."],"AcK_r0":["Claude CLI"],"AczYxH":["Custom open-knowledge entry — not managed by OpenKnowledge"],"AdcGcG":["Applying your change"],"AddR83":["Could not create project. Try again or pick a different location."],"AeHuzT":["# One pattern per line.\\n# Examples:\\n# drafts/\\n# *.draft.md\\n# !keep.md"],"AeXO77":["Account"],"AiNMQ7":["This project lives only on this computer. Connect it to GitHub to back it up and share it with other people."],"Aif3E7":["Enable semantic search"],"Am78jY":["Drag ",["keyName"]," to reorder"],"Aq-O0x":["status"],"AqnqMJ":["API key set"],"ArBWJf":["Undo last edit"],"AsqRE_":["Default location for new attachments"],"AtBdnD":["Couldn't delete skill: ",["error"]],"B11p-O":["Edit markdown link"],"B2DrPb":["Auto-save"],"B2Srgd":[["packName"]," skill installed."],"B3NAZC":["Open Navigator"],"B4_ipX":[["conflictCount","plural",{"one":["#"," file conflicted"],"other":["#"," files conflicted"]}]],"BAH4qX":["Selected graph item"],"BBqGS9":["Desktop"],"BD0XSC":["Failed to load project templates"],"BEkF-P":[["userName"],", ",["tabCount","plural",{"one":["#"," concurrent tab"],"other":["#"," concurrent tabs"]}]],"BGHHtQ":["Single page"],"BH56dn":["Custom display text"],"BQKHuL":["Restart terminal"],"BQu9Pg":["Symlink"],"BUyQnq":["Couldn't restart the server. Try \`ok start\` in this folder."],"BY-g4_":["Add pattern"],"Bdha5y":["Publishing..."],"BeWTQy":["Loading starter packs"],"BgV29F":["Visual editor find input focused"],"Bn9-El":["default"],"Bv5a9_":["Selection statistics"],"Bx4EXG":["Actions for ",["label"]],"By-7Pn":["Toggle a bullet list."],"BymzO4":["Document outline"],"C37Zkt":["Send to"],"C62P6b":["Editor selection"],"C7XjNB":["Global Skill"],"C9TBvF":["No Outgoing"],"CCTop_":["Recent"],"CFnavk":["This project isn't a git repository, so worktrees aren't available."],"CKyk7Q":["Go back"],"COr1Y7":["Pick <0>openknowledge.skill</0> from your <1>Downloads</1> folder. It enables automatically."],"CSL0l1":["Couldn't clear the key — please try again."],"CTJLpz":["\\"",["trimmed"],"\\" already exists here"],"CU3AiE":["Switching branches"],"CWzc2T":["<0>~/.ok/bin</0> and <1>~/.ok/env.sh</1> stay either way — the app always maintains them."],"CXTwen":["Can't safely edit this project config"],"CXj9C-":["New property name"],"C_WGy8":["This file is too large to open in the built-in text editor (1 MB limit). Use Open file below to open it in another app."],"C_cPoW":["Your GitHub session expired — sign in again to verify push access."],"ChAtFg":["You don't have permission to push to this repo"],"CifUuG":["Update available"],"Ck9XRt":["Couldn't save the key — please try again."],"CmeH9S":["Add property to ",["keyName"]],"CvsD6Y":["via ",["viaTags"]],"D-Oh1s":["How to set up ",["0"]," (opens in browser)"],"D12vtS":["(detached)"],"D2CwBE":["Create a new OpenKnowledge project from the <0>",["0"],"</0> starter pack (",["1","plural",{"one":["#"," folder"],"other":["#"," folders"]}]," and starter templates) in the folder of your choice."],"D4H2N6":["Remove ",["tag"]],"D8OV7J":["Only collaborators"],"DDTdLl":["Code block settings"],"DELNQk":["Collaborators see your in-progress edits as soon as they sync."],"DEWDbv":["Show diagram"],"DF1MtZ":["Loading conflict for ",["filePath"]],"DFfRbX":["Sync status: ",["syncStateLabel"]," — git identity unset"],"DId6MT":["Project-level pages with no outgoing graph edges."],"DJd000":["Activate the previous editor tab."],"DPfwMq":["Done"],"DVh_Tb":["Failed to clean up after trash"],"DXd9LM":["New worktree"],"D_WKe_":["Click an agent's avatar in the presence bar to view their session."],"DbILZA":["No matches. Some files are excluded from search (hidden or ignored files)."],"DeDYLr":["Unrecognized wiki link"],"DgcGrb":[["fileCount","plural",{"one":["file"],"other":["files"]}]],"DhK_hZ":["Moved \\"",["name"],"\\" to ",["0"]," (",["skipped"]," binary file(s) not copied)"],"DhLHEb":["Failed to load activity"],"DiFKSL":["Counting markdown files"],"Dnn2XG":["Automatic"],"DrYM2Z":["Sync disabled"],"DskIkK":["Sign-in stream ended without confirmation — please try again"],"Dub54T":["Preview browsers can't auto-copy. Use Cmd/Ctrl+C on the URL above, or open OK in the desktop app."],"Dvwa0U":["Create a worktree from this branch"],"Dw1T_W":["Rename ",["label"]],"E1Da_b":["This permanently removes ",["0"],". Agents that invoke this skill by name will fail until it's recreated."],"E1_c72":["Task list"],"E1tG2u":["Get Claude Code"],"E2Mv-X":["Copy source"],"E4XYYH":["Enable terminal for this project"],"E5WeIy":["Reopen the most recently closed editor tab."],"E6lrpp":["Manage the GitHub account OpenKnowledge uses to browse and sync your repositories."],"E7BhZn":["Blank note"],"E9bKSA":["Creating"],"EBVbtP":["Could not duplicate item"],"EDl9kS":["Subscribe"],"EDm3wJ":["Loading diff renderer"],"EEYbdt":["Publish"],"EHu0x2":["Syncing"],"EJuO7B":["Connect a GitHub account to browse and sync your repositories."],"EL_YRd":["Mirror of <0>api-spec</0>"],"EOjU5V":["Inline Math Properties"],"ETyvvg":["No language match."],"EVnzPs":["Edit with AI"],"EWX92Z":["Collapse Ask AI"],"EZVxVz":["Replace the active match from the replace field."],"E_BHoD":["Could not move \\"",["targetName"],"\\" to the Trash. Do you want to permanently delete instead?"],"E_tNGD":["Connected as @",["login"]],"Ea1prf":["Choose which editors every skill in this project installs into."],"EarrCe":["Search emoji"],"EbZT7P":["Toggle the left file sidebar."],"EbjWsS":["Current commit"],"EcM3k7":["Failed to clean up pending ",["kind"]],"EcR0fl":["Checking for installed agents"],"EdQY6l":["None"],"EeRZnZ":["Expand burst ",["burstNumber"]," diff"],"Ef7StM":["Unknown"],"EhDLBx":["You modified <0>",["filePath"],"</0> locally, but it was deleted upstream."],"Ehkru0":["Open, navigate, accept, or dismiss CodeMirror completion suggestions."],"EiVgl5":["You don't have permission to push to this repo."],"Eji13z":["Toggle highlight formatting."],"EkH9pt":["Update"],"El7NbA":["Heading 2"],"Emz5BG":["Embeddings are computed only when a search runs and are cached locally under <0>.ok/local</0>."],"EoaQyO":["Append-only log of what changed."],"EqrC_R":["Undo failed: ",["message"]],"EqtBXb":["Visual editor find open"],"ErRi6L":["Template \\"",["label"],"\\" deleted"],"Es-eZU":["Remove from recent projects"],"Ev2r9A":["No results"],"EvPX7f":["Opens a folder picker to choose where to clone the repository."],"Evq3lu":["Orphan mode"],"ExPiRQ":["Move to the next CodeMirror lint diagnostic."],"ExUzM4":["skill \\"",["0"],"\\""],"F-NRCj":["Add property"],"F-vBv0":["Ask"],"F0OA00":["Get ",["displayName"]],"F1T9y_":["Showing top matches — keep typing to narrow"],"F4IYWe":["Share doc"],"F4vEsL":["Sync status: ",["syncStateLabel"]],"F6pfE9":["Active"],"FBknns":["HTML"],"FCAcjR":["Run a real terminal docked inside OpenKnowledge, starting in this project's folder."],"FCxvG5":["First item"],"FEK4oC":["OpenKnowledge will be initialized at <0>",["gitRoot"],"</0> — the parent of your new folder, because it contains a <1>.git</1> folder (one project per git repo)."],"FEqWFL":["Guides your AI agents on how to work here."],"FEr96N":["Theme"],"FNTx6u":["Search \\"",["semanticSubmitQuery"],"\\" by meaning"],"FOGD7m":["Create something great."],"FOyCTr":["Your OpenAI API key, used only to create embeddings of your content for semantic search. Stored once for this machine in <0>~/.ok/secrets.yml</0> (readable only by your user account) and shared across all projects. Turn the feature on per project in This project → Search."],"FRYB1Q":["/api/config returned a malformed body"],"FRqZ9v":["Couldn't update skill: ",["0"]],"FTUGgh":["Enter a repository URL or owner/repo"],"FUMerq":["Could not enable sync: ",["detail"]],"FWQuPE":["This project is running a different, incompatible build of OpenKnowledge than this app (v",["0"],")."],"FXk_zY":["Adds a guided workflow for authoring new Agent Skills."],"FjkaiT":["Zoom out"],"FnMkli":["Sync disabled — you don't have permission to push"],"FqTpiN":["Bird wiki"],"Fqr8BP":["Multi-page PDF viewer with toolbar controls (thumbnails, page nav, zoom)."],"Fsx78O":["Add the <0>ok</0> command to your terminal"],"FvMSms":["Renaming changes the file on disk and the id agents use to pick this template."],"FvpFSZ":["Reveal in Finder, ",["hint"]],"Fxf4jq":["Description (optional)"],"Fy4GgU":["Explain how your codebase works so teammates and AI agents can find their way around. Good for documenting the architecture, the main parts, and the questions new contributors always ask."],"FyW0WO":["Authorize in browser"],"G-JBA1":["Source mode requires a live connection — your edits are saved and will appear when you reconnect."],"G0YZ-I":["Indent or outdent list item"],"G1Gw0v":["New template"],"G1XxbZ":["Checkbox"],"G4-bgo":["Ask AI (from selection)"],"G7-rf8":["Pattern syntax error: ",["message"]],"G7cMuO":["HTML preview"],"G8t9NN":["Add a property"],"GA-UkN":[["keyName"]," type: ",["typeLabel"],". Click to change."],"GDvlUT":["Role"],"GF51cw":["Give the AI tools you use access to read and update your projects. Pick what to set up below, and change it anytime."],"GGsM4y":["Selected in graph"],"GJH-AT":[["docName"]," is ",["0"],". OpenKnowledge currently opens files up to ",["1"],"."],"GK-IRZ":["Undo buttons are disabled — per-session state has been garbage-collected."],"GLxIKR":["How to push manually"],"GN6L5F":["Filename"],"GQDSBN":["Layout options"],"GUYwCr":["Dismiss notice"],"GUqTzn":["Competitor research"],"GXf9hG":["Cloning ",["repoName"],"..."],"G_686w":["Task List"],"G_efLf":["Installed into"],"G_mWXb":["Filter languages"],"GamjcN":["Template saved"],"GemPfn":["Failed to parse forward-links error response (HTTP ",["status"],")"],"Gfr4fu":["Server can't open documents"],"GhjUB_":["Reconnected"],"Gp_twO":["Local path"],"GsBUCk":["Loading settings"],"Gt4gOO":["This folder has unpushed changes. Recipients will see the last pushed version."],"GubkSu":["Use a starter pack"],"GuqOb1":["Failed to load headings"],"Gx0VS1":["e.g. drafts/ or *.draft.md"],"GzPQ2f":["Stay in the loop"],"H-vDm3":["Relaunching to install the update…"],"H0WlWQ":["Grid of rows and columns with a header row."],"H86f9p":["Collapse"],"HAvRAI":[["skillCount","plural",{"one":["skill"],"other":["skills"]}]],"HCn0Ay":["Toggle strikethrough formatting."],"HGNCsl":["Connection lost — keep this tab open, your edits will sync when reconnected"],"HIb0vl":["Network error — please try again"],"HM56Bx":["Creating..."],"HPTPGr":["Create a new spec file for my user story"],"HSh8u_":["Folders"],"HTW0Zw":["One more step: run <0>claude</0> in this project and approve OpenKnowledge once."],"HXFyWD":["Split diff"],"HdkSiO":["New file"],"HfI1dR":["I already have it locally →"],"Hl89Qd":["Loading templates"],"HlmZBk":["Documents response did not match expected shape."],"Hnl9nT":["Set where pasted and dropped files are stored for this project."],"HoWElC":["This ",["targetNoun"]," has been moved, renamed, or deleted in your local copy of branch <0>",["branch"],"</0>. Please commit your changes or enable auto-sync."],"Hp1l6f":["Current"],"HpK_8d":["Reload"],"HptUxX":["Number"],"HqiZvw":["OpenKnowledge stores its configuration and internal files inside a newly created <0>.ok</0> directory in your project root folder."],"Hrz9NY":["Wiki link"],"HyvSqq":["Project Skill"],"I1gRhX":["Failed to rename"],"I5685_":["Try a prompt"],"I5AfhE":["Sync status unavailable — server unreachable."],"I7Exsw":["Follow us on X"],"IA1wNb":["The Claude Desktop App didn't open the file. Is it installed? (",["msg"],")"],"IA6JW2":["Detecting"],"ICoNYz":["You can also manage this in Settings."],"IInnZo":["Conflict"],"IKoTAC":["Keep disabled"],"IN4UX8":["Search (",["searchShortcut"],")"],"IQPyrD":["Missing page — click to create"],"IRv9cH":["Cloned ",["repoName"],"."],"IWGfGF":["Checking your GitHub connection"],"IX7-sq":["Something went wrong opening \\"",["docName"],"\\"."],"IX_uXB":["my-feature"],"IajAbS":["Add a starter pack"],"If0crP":["Open with AI ",["targetDisplayName"],", ",["hint"]],"IgTwLt":["Open this document in the editor and collapse the graph."],"Ik-gP0":["Heading H",["level"],": ",["text"]],"Iq8zdU":["Close terminal"],"IrB5AK":["Server-side cleanup failed for ",["failedCount","plural",{"one":["#"," item"],"other":["#"," items"]}]],"IreQBq":["Repository"],"It9ARY":["Toggle the right document panel."],"Ix0K8o":["Hide external URL nodes"],"J2MgzQ":["Undo all edits on ",["docName"]],"J2Mv98":["Name (e.g. ",["login"],")"],"J2eKUI":["File"],"J3HzPL":["Collapse ",["keyName"]],"J6N5MX":["Couldn't construct the share URL. Try Done and re-share."],"J6mxC1":["A network problem or GitHub outage interrupted the clone."],"JCxGEX":["No disconnected pages. Pages appear here only when they have no incoming and no outgoing graph edges."],"JE21eh":["Symlink to ",["targetPath"]],"JK-Ave":["Hide thumbnails"],"JL3si7":["Updating"],"JLUTgi":["No tags yet — author \`#tagname\` in any doc to populate the index."],"JLzQi_":["Close ",["accessibleLabel"]],"JOcPqH":["Bring a remote repository onto this machine."],"JWsZlx":["Open a project to edit."],"JZ8cO6":["Light, dark, or follow the OS."],"Jejur6":["Couldn't load document"],"Jhj_lh":["Modify the link target, anchor, and display label."],"JkCD2u":["Sync paused — you don't have permission to push to this repo"],"JmfgFc":["(a worktree of ",["0"],")"],"Jqqevv":["System error"],"JtD-Br":["Page link"],"Jw6EC4":["Branch switch failed — try opening the ",["targetNoun"]," manually."],"K-a33w":["Start writing to create this page"],"K-h9cT":["Couldn't save the resolution for ",["filePath"],"."],"K0N7zS":["Config sharing status read failed"],"K1ckLX":["Failed to create folder"],"K6MQQk":["Sync is failing. See the sync status for details."],"K6jjWB":[["packName"]," was already set up. Nothing to do."],"K6jxcj":["Add a key"],"K8-WWn":["Move between table cells"],"K9J00P":["Clone failed — connection error"],"KDuPiY":["Uploading ",["fileName"]],"KDw4GX":["Try again"],"KFdXwz":["Show panel (",["panelShortcut"],")"],"KH5bQi":["Using the <0>OK_EMBEDDINGS_API_KEY</0> environment variable (managed outside OpenKnowledge)."],"KIIamL":["OpenKnowledge will create commits and push them to your remote automatically. If you do not want automatic commits in your git history, you should not enable auto-sync."],"KOZud0":["Build a competitor research knowledge base. Start with an overview page, then add cross-linked pages for each competitor, their products and pricing, and the sources behind every claim."],"KPW5WC":["moved template"],"KQGZuq":["Reused if it already exists, created if not."],"KRJ6xh":["No tags yet. Continue typing to create one."],"KWL_Ih":["Blog post"],"KX1MZR":["Your repositories"],"KYSocE":["Research the extinction of flightless birds"],"KYcZ6Y":["Above"],"KZLdgR":["See <0>#design-docs</0> for the latest specs."],"K_vT1F":["Upstream sync"],"KaFCD3":["Open this link in a new tab and collapse the graph."],"Kf7GG5":["Restarting the server…"],"Kgdbkt":["Switch to local-only refused"],"Kh1n4a":["<",["componentName"],"> isn't a known component. Copy the source to use it elsewhere, or delete the block."],"Khxcyu":["Terminal access isn't enabled for this project."],"KkEAud":["Create a file from the current document or folder context."],"KmydK6":["Bold"],"KnoB--":["Will be saved as <0>",["sanitized"],"</0>."],"KsAPaB":["This branch is checked out in:"],"KszKI_":["Skill level"],"KujtjC":["Find"],"L-rMC9":["Reset to default"],"L1ZE3M":["Document statistics"],"L3CEC1":["this item"],"L4Cdd9":["or create a new file <0/>"],"L6Hhh6":["(root)"],"L8fKuc":["Run this in your terminal"],"L9Y9Om":["Top linked pages"],"LBwUR6":["Branch switch timed out — try opening the ",["targetNoun"]," manually."],"LCUy_N":["Session ended"],"LDuM35":["Replace current match from field"],"LE7t79":["Clone to a new folder"],"LKOLNn":["No AI agents installed"],"LNum6A":[["minutes"]," min ago"],"LRgZAt":[["owner"],"/",["name"]," already exists"],"LXdWeS":["Medium section heading."],"LXfNU-":["Navigation and suggestions"],"LYufDw":["Failed to enable semantic search — ",["detail"]],"LbmLyU":["Can't safely edit this tool's config"],"Lcehxn":["Save resolution"],"LdABLa":["Could not open ",["target"],". Try opening it manually."],"LdKIHS":["Draft a spec"],"LhQlGR":["This project is running an older version of OpenKnowledge (v",["0"],") than this app (v",["1"],")."],"LhWYpm":["Other OK paths are tracked upstream:"],"LiAw2k":["What this changes"],"LlHqdU":["Initializing project"],"Llyqvo":["This usually means one of:"],"LpB85N":["Plain"],"LtI9AS":["Owner"],"LtSYdi":["Reveal in Finder"],"LtiJ5c":["Project skill"],"LuoJWu":[["truncatedShownCount","plural",{"one":["Showing the first item in one folder — the rest of that folder is hidden."],"other":["Showing the first ",["formattedCount"]," items in one folder — the rest of that folder is hidden."]}]],"LwMxXg":["Failed to open worktree."],"M1OfV9":["Next source diagnostic"],"M3ytY_":["This looks like a drive root (e.g., C:\\\\). Scaffolding here will scan an entire drive."],"M5mfAe":["Add tag"],"M9597s":["Preparing share URL..."],"MCjC9A":["Delete ",["deleteDescriptorLabel"]],"MDZSJe":["When the agent runs its scheduled work."],"MGb89P":["Insert, delete, move, copy, and indent source editor lines through CodeMirror's default keymap."],"MHrjPM":["Title"],"MKOVhz":["Enable git auto-sync"],"MQIM_Y":["Couldn't copy. Select the URL above to copy it manually."],"MTs6g3":["Couldn't reconnect after server restart"],"MUBR8r":["Rename succeeded but the tabstrip may be out of date — refresh to resync"],"MUrVEo":["No recent projects."],"MV-Dkb":["Found ",["countDisplay"]," markdown files"],"MVxpbf":["Find and replace"],"MWrUEd":["Undo all"],"MZSBsh":["No templates yet. Add one to give new docs in this folder a ready-made starting point."],"MZoxVx":["Failed to load tags. Press Escape and re-open to retry."],"Mb_20S":["Visual"],"Md709y":["Loading ",["fileName"]],"MdpSC1":["New skill"],"Mh_4hd":["Previous tab"],"Mj8R8K":["Couldn't install skill: ",["0"]],"MmDDWK":["Recently opened"],"MmqnGI":["No global skills yet."],"Mnavhe":[["propPanelDescriptorLabel"]," Properties"],"MqQoV-":["Describe what you want to build, start a blank file, or scaffold from a template."],"MrwYIK":["Toggle a source comment through CodeMirror."],"MsuXaI":["Hide panel (",["panelShortcut"],")"],"My9uXI":["Updated \\"",["display"],"\\" to ",["0"]," — your previous version is in history if you need to restore it."],"N1KkEO":["Jump to last tab"],"N1YYa7":["Loading image"],"N1mdmS":["This file can't be opened in the text editor."],"N2FcBE":["Synced"],"N2S1rs":["Empty"],"N2eHWq":["Code Block"],"N3_ozB":["Hubs"],"N55YNr":["Choose whether this project's OpenKnowledge setup, including its AI-tool connections, is saved with the project so teammates get it too, or kept only on your computer."],"NEzPEh":["Create a new branch, or check out an existing one, in its own window."],"NIWAux":["No docs registered under #",["tagDocsName"],"."],"NJyQi_":["Branch ",["shareBranch"]," no longer exists on the remote."],"NKkZXl":["Initialize and open"],"NNJsn7":["One more step: enable it in Cursor → Settings → Tools & MCP (Cursor leaves project servers off until you turn them on)."],"NOHyEE":["Retry push"],"NORKZU":["Pattern warnings: ",["summary"]],"NQ8llq":["Add item"],"NRSLBe":[["diffMin"],"m ago"],"NSnIUP":["Two-page (even)"],"NUr4kz":["A reusable starting point for new documents in this folder."],"NYUhy5":["Subfolder name"],"N_7kkF":["Read through this codebase and draft a technical spec for the most complex module: an overview, the architecture, key files, and open questions, all linked from a specs index page."],"NcurBF":["Pan down"],"NjrIak":["File: <0>",["fixedName"],".md</0>"],"NkXEFS":["Restore failed — document unchanged"],"NmPNJJ":["Copy code"],"Nn4GgW":["Will be created as <0>",["sanitizedName"],"</0>"],"NnQapF":["Open with AI ",["targetDisplayName"]],"NpC29w":["Create a new list item from the current list item."],"Nu4DdT":["Sync"],"Nu4oKW":["Description"],"NuH1jp":["Public repository"],"Nv3mUj":["Show advanced"],"NvOvTi":["Create in <0>",["dirDisplay"],"</0>"],"Nx7BWE":["Git auto-sync"],"NxW-md":["Resize ",["handleKey"]],"NzFvyK":["Session ended — undo unavailable"],"O0Z2Xr":["Outgoing"],"O2UpM1":["Browse"],"O3oNi5":["Email"],"O4PnDd":["AI tool management is only available in the OpenKnowledge desktop app."],"O6yEPk":["Create a new OpenKnowledge project in the folder of your choice."],"O7_W_a":["Open with AI"],"OD0FCX":["Hidden “",["basename"],"”"],"ODGGlj":["Folder name: ",["detail"]],"OETysD":["No hub pages yet. Hubs appear once pages accumulate inbound graph links."],"OEu_0l":["Failed to load skills: ",["0"]],"OFBmkg":["Search files, commands, projects, and AI handoff actions. With text selected in the visual editor, this chord adds a link instead."],"OJTOUj":["Requires ",["brand"],"."],"OJeiSH":["Failed to add property"],"OLBz-_":["Mermaid diagram failed to render."],"OLIKgw":["Drag item ",["0"]," to reorder"],"ONPvOb":["Loading agent activity"],"ONgEZF":["Loading headings for ",["pageTarget"]],"OOIVJo":["Uninstalled \\"",["0"],"\\" from ",["1"]],"OTF92M":["Label <0>(optional display text)</0>"],"OVjNeX":["Terminal ",["0"]],"OX2Neh":["Inline code"],"OXb_Df":["Settings content"],"OYnx7O":["Path cannot start with \\"/\\""],"OZJeTZ":["Skill"],"OdmsFg":["Failed to delete item"],"OeAl1e":["e.g. assets/uploads"],"OgyJSr":["Local only"],"OiHJdA":["Move through slash, wiki-link, tag, and path suggestions; accept or dismiss the active suggestion."],"Okd2Xv":["Toggle underline formatting."],"OlAl5i":["Expand all"],"OmHTGj":["Disable git auto-sync"],"On0aF2":["Website"],"Oo_WWc":["No pages found"],"Oos8fo":["Copy command"],"OplnBG":["Managing AI tools is unavailable in this build."],"OuY8t9":["Open in current branch"],"OvEjsP":["Copying..."],"OxplNM":["Updated \\"",["0"],"\\": added ",["1"],", removed ",["2"]],"Oxyd5f":["Pick a name"],"OyIC0Q":["Project name"],"P-ye9o":["Could not open folder picker"],"P0HC30":["This ",["targetNoun"]," moved to <0>",["0"],"</0>. Open it there?"],"P3NS4G":["Pattern syntax error (line ",["lineNumber"],"): ",["message"]],"P3hnm0":["File too large to open"],"P47EWZ":["Could not update sidebar settings"],"P6gXB-":["Replace ",["keyName"]],"P6lAT3":["Folder target: ",["linkTitle"],". Click to open the overview."],"P8yDjG":["Name can’t be empty, \\".\\", \\"..\\", or contain / or \\\\"],"PB4upl":["Find previous match"],"PBwmDJ":["Searching by meaning"],"PBxg_E":["Not now"],"PCNIuJ":["File an issue"],"PCSkw2":["Skills"],"PIMM5l":["You're subscribed!"],"PKLY-1":["Opening..."],"PMyJ9C":["No edit session yet"],"PPFQ3o":["Installed \\"",["0"],"\\" into ",["1"]],"PQCdtv":["\\"",["docName"],"\\" doesn't exist."],"PR9FSv":["Move to the next visual-editor find result."],"PRnH8G":["of ",["0"]],"PVUn_c":["Open folder"],"P_bX4O":["How to set up"],"PdA9NZ":[["ahead"]," ahead"],"PdJZ5p":["No skills yet."],"Pgu10b":["Saved as <0>",["slug"],".md</0>"],"PgzIpb":["Move to the previous visual-editor find result."],"PiH3UR":["Copied!"],"PkeYXL":["Expanded graph mode"],"Pkw7J9":["This folder is empty."],"PqYWiC":["Couldn't restart the server automatically. Try running \`ok stop all\` in a terminal, then reopen this project — or restart your computer if it persists."],"PrJYSN":["This folder isn't on GitHub yet. The link won't work until it's pushed."],"PrhzDE":["Pan up"],"Pyp1NA":["Restore to this point?"],"Q5fqMz":["Connection error — try again"],"Q6hhn8":["Preferences"],"Q7W-mC":["Same folder as current file"],"Q8A-U_":["Connected to"],"QAi7Q9":["Branch <0>",["trimmed"],"</0> already has a worktree — it'll open in its own window."],"QDZbvN":[["diffDays"],"d ago"],"QJaG-9":["Choose CLI for new chat"],"QNxpRm":["Dock terminal to the right"],"QOINDn":["empty"],"QQghPu":["Install in Claude Desktop"],"QR5SP1":["created template"],"QYfQdv":[["displayName"]," CLI"],"QcpeeE":["Navigate to ",["docName"]],"QfFBdJ":["The template's filename (without \`.md\`)."],"Qj4RL5":["Completed:"],"QlxHAH":["Showing results for \\"",["semanticResultsLabel"],"\\""],"QnjpOq":["What do you want to build?"],"QqBQu1":["Label <0>(visible link text)</0>"],"Qvls7J":["Eng specs"],"Qw-7Ie":["A simple place to write, with one file per topic and a daily journal. Pick this if you just want to start writing and let the links between notes build up over time."],"QyioBP":["Move up"],"R0cyYB":[["0","plural",{"one":["#"," request blocked by the preview's security policy"],"other":["#"," requests blocked by the preview's security policy"]}]],"R0jJzV":["Paste URL, owner/repo, or search your repos"],"R3y75Z":["Edit source"],"R65q-K":["A real shell is off for this project. Turning it on runs commands with the full access of your macOS user account."],"R9IDFz":["Renames the folder on disk and the id agents use to invoke it."],"RDjuBN":["Setup"],"RDrXh4":["Configure user, project, and integration settings."],"RG4XHV":["Copy ",["0"]," prompt"],"RGCCrg":["Copy share link"],"RGkNeJ":["Initialize a starter pack"],"RJ3a8Z":["Looking for <0>",["lookingForUrl"],"</0>."],"RN62Q8":["We'll build <0>openknowledge.skill</0>, save it to <1>~/Downloads</1>, and open the Claude Desktop App for you."],"RSqaSd":["Project root"],"RVZJWQ":["Search projects..."],"RXNu_r":["Shared via git with everyone working on this project."],"RY6Bq1":["Open shared ",["targetNoun"]],"RaPMZv":["Keyboard shortcuts available in the editor and workspace."],"Rah7yq":["What should the AI do? (optional)"],"RfHNf8":["Open activity panel for ",["tooltipName"]],"RfaEio":["Toggle source comment"],"RgbKEe":["You don't have access to this repository."],"Rj01Fz":["Links"],"RlCInP":["Slash commands"],"RlLl3G":["Actions for ",["0"]],"RmBY0A":["No git remote"],"RnrnTe":["Already set up — ok is available in your terminal"],"RobAKV":["Update the destination and optional section anchor."],"Rq1vFD":["Tree view options"],"RrAIZx":["What config sharing covers"],"Rx5ReQ":["Rename ",["keyName"]],"RyIKxy":["This ",["targetNoun"]," has been moved, renamed, or deleted in your local copy, and that change hasn't synced yet."],"S33tz3":["Not connected"],"S34Vju":["Have something else in mind?"],"S6l5dv":["Could not start creating a new item"],"S9Vnum":["Remove ",["patternText"]],"SCoBBH":["Tag suggestions"],"SCzAbA":[["phase"]," — ",["pct"],"%"],"SEYWYq":["Undo all edits on this file?"],"SFN6dN":["Heading 3"],"STTOnz":[["keyName"]," type: complex value (nested; read-only)"],"SUOoXn":["Failed to open project."],"SVLPt5":[["formatted"]," GitHub stars"],"SXCSQd":["Copied path"],"SYfHmN":["Unpin tab"],"Sc1bKE":["Local collaboration data for \\"",["docName"],"\\" could not be cleared in time. Reload to retry."],"ScwcF2":["A project already exists at this location. Pick a different parent folder."],"SgKLfA":["Not connected to GitHub."],"Sh3Qkg":["No matching branches."],"SiUUCS":["Next match"],"SkMZlS":["Couldn't remove <0>",["targetGitPath"],"</0>: ",["removeGitError"]],"Skr_7L":["Search worktrees"],"Sq8lf2":["Editors to install skills into"],"SrOuyg":["Document panels"],"T-654M":["Loading PDF"],"T0OVm7":["The default branch is protected — pushes need a pull request."],"T67A0Y":["Auto-sync pushes/pulls commits to your git remote on intervals and on save. Toggling on requires confirmation."],"TEEPPF":["Will replace existing OpenKnowledge entry"],"TJnkyf":["ok ui responded but server.lock has no port yet"],"TKQ7K-":["Install"],"TLIO3j":["Toggle italic formatting."],"T_wG4n":["We couldn't check your GitHub connection."],"Ta25TG":["No history yet"],"TbjyhA":["Docs"],"ThmUrC":["Could not finalize project setup. Try again."],"Tjc1pH":["Section <0>(optional heading anchor)</0>"],"TsZmgr":["The file on disk, and the id agents use."],"TwYboS":["Navigate CodeMirror source search results or dismiss the search panel."],"Tz0i8g":["Settings"],"Tz9pJB":["Clone stream ended unexpectedly — check if the clone completed"],"U2Kx6T":["Close all unpinned"],"U2pMtf":["tag-name"],"U3IvM5":["Full guide"],"U5Spo9":["Content directory must be inside the project"],"U8CD-l":["Copy full path, No workspace"],"UBv8UK":["Delete Permanently"],"UDFrWm":["Checking GitHub connection..."],"UL8A9w":["Tag"],"UMrOy2":["Skill \\"",["trimmedName"],"\\" created"],"UPjaXD":["Couldn't duplicate \\"",["0"],"\\": ",["1"]],"UQAp48":["Search templates"],"UQMMvx":["Moved \\"",["name"],"\\" to ",["0"]],"URmyfc":["Details"],"UTNVyS":["Select the full source document."],"UTZ97u":["Selection must be inside the project"],"UVLlMV":["Couldn't reach GitHub. Try again?"],"UW2Fg3":["This project's running server doesn't support live editing. Restart OpenKnowledge to fix."],"UW93oq":["Replace key"],"UYcGIW":["Connecting — waiting for collab server"],"Ua78MH":["no response"],"UaDyeb":["Hide selection preview"],"Uay5NL":["This ",["targetNoun"]," was added to branch <0>",["shareBranch"],"</0> recently. Switch and update to open it."],"Uci-Ph":["Ordered List"],"Ud0Pj9":["<0>Mirror source removed.</0> The doc <1>",["src"],"</1> is no longer available."],"UfW9Kr":["Your search queries and the full text of matching pages are sent to your embeddings provider (OpenAI by default) to compute embeddings."],"UhpfxY":["Pan left"],"UkQGhd":["Hide replace"],"Up2_7p":["Copy full path"],"UuYo7g":["This ",["targetNoun"]," has been moved, renamed, or deleted in your local copy. Please commit your changes or enable auto-sync."],"Uuj_R4":["New from template"],"Uw6ERJ":["Couldn't copy: ",["detail"]],"UyROxs":[["mins","plural",{"one":["#"," min ago"],"other":["#"," min ago"]}]],"V48OUT":["You deleted <0>",["filePath"],"</0> locally, but it was modified upstream."],"V7QxyT":["Connection dropped"],"VAHWL_":["Connected as <0>@",["signedInLogin"],"</0>"],"VBE2dw":["Build and keep track of the world behind your story. A home for your characters, places, factions, and the lore that ties them together, so details stay consistent as you write."],"VIwCaD":["Entry"],"VM7H66":["This file is binary and can't be shown as text."],"VNgKZz":["Advanced settings"],"VU3Nrn":["Missing"],"VUijjF":["Embed an image with optional alt text."],"VYd_YA":["Open an existing project folder from disk."],"VZGGPK":["Collapse terminal"],"VZGh8G":["Fold, unfold, fold all, or unfold all source ranges."],"VZSBXL":["Semantic ranking activates the first time an agent runs a search."],"V_6bJ4":["Terminal settings not loaded yet — try again in a moment."],"V_wltx":["Enter a title for this template."],"VbqhBI":["Already at ",["assetContentPath"]," — reusing."],"VcqWBy":["Upload may have succeeded but the sidebar is out of date — refresh to resync"],"VdXv4D":["Clone from GitHub"],"Vlc75q":["Keep file deleted"],"VsaI0G":[["folderCount","plural",{"one":["folder"],"other":["folders"]}]],"VuxVSP":["Start source completion"],"VvS_k_":["Config sharing is now local-only."],"VxO6wR":["Delete selected files or folders"],"VzGJRl":["Add link"],"W-ntoW":["heading-slug"],"W0i24j":["Object"],"W1qRuM":["This document is already active in the editor. Use Open to collapse the graph."],"W3Xlpc":["Set the auto-sync default for users opening this project for the first time. This setting is committed to your repository."],"W5A0Ly":["An unexpected error occurred."],"W7XJN4":["Can't nest projects. An OpenKnowledge project already exists at <0>",["rootPath"],"</0>. Choose a location outside it, or open that project instead."],"W8vpBM":["starter pack"],"W9_Bub":["Local changes overlap with incoming sync"],"WL6puM":["Path resolves outside project"],"WMIKXK":["Are you sure you want to delete ",["targetCount"]," selected items? Folders and all files inside them will be deleted. This action cannot be undone."],"WPwDin":["Open folder on disk"],"WR0y2O":["Share folder"],"WRNXKp":["Searching"],"WWcqsG":["Start here: what this is and how it's organized."],"WZ-vBy":["Permanently deletes <0>",["targetGitPath"],"</0> and all its git history. Working files stay in place. If the parent git repo is intentional (e.g. you cloned it), cancel and pick a location outside it."],"Waiy-j":["The agent's persona, values, and voice."],"WamGNs":["Failed to load PDF: ",["error"]],"WcWS__":["Download file"],"Wcv-Zi":["Make this knowledge base available as a Claude Skill."],"We7h2I":["📝 or assets/icon.png"],"Weq9zb":["General"],"Wgmlsw":["Fetching"],"Wh0im4":["editing [[",["realCurrentDoc"],"]]"],"WhOsNE":["Strikethrough"],"WmPbvm":["Get product updates in your inbox."],"Wq6Wcm":["Please enter a valid email address."],"WqLq6M":["Open with AI ",["displayName"]],"Wt5W56":["Sync is off — your edits will not sync to the remote repository."],"Wtw22s":["Installing"],"WyQxwa":["Connect this project to GitHub to share."],"WyXG7w":["Close all"],"Wyxs0x":["Path cannot contain \\"..\\""],"X0ttSN":["No tags match \\"",["tagListQuery"],"\\"."],"X7u0xR":[["0"]," templates available"],"X8kjQX":["Re-authenticate with GitHub"],"X9VpsP":["Loading folder contents"],"XAyxsa":["Check out remote branch"],"XDzAnp":["Opens in a new tab"],"XH30C4":["document"],"XJOV1Y":["Activity"],"XPJ0sN":[["settingsDescriptorLabel"]," properties"],"XPqe3B":["Create new tag #",["tagValue"]],"XRuL0i":["Create page"],"XU0OXn":["Enable auto-sync"],"XV5sC0":["Open worktree"],"XW18jo":["Page headings response did not match success schema"],"XYlJJT":["Setting up"],"XcGbim":["Show hidden files"],"Xet9MX":["Failed to load backlinks"],"Xewl6B":["Your local copy is behind. Pull the latest changes, then open the link again."],"XfzqjK":["template \\"",["name"],"\\""],"Xl-UUg":["guides/install or https://example.com"],"XmJfZT":["name"],"XnlF3W":["Add the next matching source selection."],"XnoA1k":["This ",["targetNoun"]," only exists on branch <0>",["shareBranch"],"</0>. You have uncommitted changes that prevent switching. Commit or stash your changes, then open the share link again."],"XopE_I":["Failed to parse backlinks error response (HTTP ",["status"],")"],"XpIZmv":["Fenced code block with monospace text."],"XqNHcm":["Couldn't update skill targets: ",["0"]],"XtRoxT":["Page ",["pageNumber"]],"XuQzrk":["Couldn't restart the server — another process owns it. Quit other OpenKnowledge windows for this project, then try again."],"XvPJaT":["Diff layout"],"Xv_ijG":["https://github.com/owner/repo or owner/repo"],"Xw_maT":["Type a query, then press ↵ to search your pages by meaning."],"XyOUTJ":["Exit merge"],"Xzy0s0":["Remove ",["fullLabel"]," from context"],"Y-Urt2":["Block math equation rendered with KaTeX from a LaTeX source string."],"Y1QMlM":["Get set up"],"Y1kX2z":["OpenKnowledge initializes at <0>",["projectDir"],"</0> — the parent of <1>",["pickedRelative"],"</1> because it contains a <2>.git</2> folder (one .ok/ per git repo). <3>Content directory</3> defaults to <4>.</4> (the whole repo); type a sub-folder to narrow it."],"Y6SK9K":["Show source"],"Y8ViJx":["A newer version may have been deployed since this tab opened."],"YC6_wP":["Edit ",["keyName"]],"YEP3X2":["Delete a table when the active table cell selection covers the full table."],"YGIi_c":["Reinstall"],"YJ1BTp":["A skill with that name already exists."],"YKLP_-":["Template renamed"],"YPFBfr":[["detail"]," - ",["kind"]," \\"",["createdPath"],"\\" still exists on disk"],"YSFv5w":["No git repository — config sharing does not apply here."],"YTLmTM":["Remove the parent <0>.git</0> folder"],"YW7Q86":["Search settings not yet loaded — try again in a moment"],"Y_kL7X":["Customize how the editor looks and behaves."],"YaeyFh":["Pulls may overwrite uncommitted edits in your local files."],"Yea-K5":["Restore to this point"],"Yi0VMG":["Upload ",["keyName"]],"YjhKI5":["Cloning..."],"YlDuro":["Fit height"],"YsEYYS":[["behind","plural",{"one":["#"," commit behind"],"other":["#"," commits behind"]}]],"YwPUUP":["This pack is already set up here."],"YyXtnN":["Underline"],"Z1LF1M":["Sharing a doc needs a GitHub repository. Create one for this project."],"Z2M5XM":["Reason: ",["reason"]," (",["osDetail"],")"],"Z3FXyt":["Loading..."],"Z5HWHd":["On"],"Z5h97D":["Hide files and folders from your knowledge base. Hidden items don’t appear in the file tree, search, or AI tools. <0>Learn more about patterns</0>."],"Z8KDox":["Enter a folder name (e.g. brain)."],"Z8lGw6":["Share"],"ZARuZJ":["Couldn't load files"],"ZBYKxv":["Reverts every change this agent made to <0>",["docName"],"</0> this session (",["burstCount","plural",{"one":["#"," burst"],"other":["#"," bursts"]}],"). Other files and writers are unaffected."],"ZBt4rI":["Instruction for the AI"],"ZLQol-":["You can turn this on later in <0>Settings → Sync</0>."],"ZNK2Tq":["root"],"ZQJ1IV":["Activate the last editor tab."],"ZQLDTl":["created folder"],"ZU8VV_":["Remove failed: ",["error"]],"ZWgr0b":["In a subfolder"],"ZWolSV":["You picked the filesystem root (/). Scaffolding here will scan every file on this machine — make sure that's what you want."],"ZWwYwM":["Base branch"],"ZWxfrc":["cleared folder properties"],"ZWyHmq":["This project"],"ZYtq3m":["Connect the AI tools you use to this specific project. These files live in the project folder, so anyone who opens it gets the same setup."],"Zf0w-R":["Take a piece of writing from a rough idea to a finished draft to something you're ready to share. Good for blog posts, essays, or anything you want to move through clear stages."],"ZgGuA4":[["0","plural",{"one":["File"],"other":["Files"]}]],"ZhhOwV":["Quote"],"ZjtgI-":["Command palette"],"Zon_qG":["Mirror source <0>",["label"],"</0>"],"ZptNUh":["Show ",["hidden"]," more"],"ZsGpr_":["Paste link"],"Zue_jx":["Your GitHub token is missing required scopes. Try signing in again."],"Zul8Ry":["never"],"ZvzbDF":["Add it directly to this project."],"ZxXhLY":["Hide Files (",["sidebarShortcut"],")"],"Zz25kq":["Show Files (",["sidebarShortcut"],")"],"_5qBNl":["AI tools & CLI"],"_6FVBz":["Jump to tab 1-8"],"_7UQ7y":["Whole word"],"_8quCH":["From template"],"_902BE":["This ",["targetNoun"]," was shared from branch <0>",["shareBranch"],"</0>. You're currently on <1>",["currentLabel"],"</1>."],"_BthEY":["Open in ",["shareBranch"]],"_NX6gG":["Managing project AI tools is unavailable in this build."],"_PACVa":["Release notes"],"_PBJRl":["Add at least one letter or number."],"_QwkMu":["No matching paths"],"_RcqUM":["You picked your home directory. OpenKnowledge will index everything in your home tree — large and may surface personal files."],"_TDESN":["Network error - ",["kind"]," \\"",["createdPath"],"\\" still exists on disk"],"_TF8ep":["Failed to render PDF"],"_VRtd7":["Couldn't send the selection — please try again."],"_W-elG":["(inline)"],"_WPP7e":["Read-only copy of a MirrorSource block from another doc. Edit at the source and it updates live."],"_XWY2J":["Terminal disabled"],"_ayOfA":["A knowledge base that follows Google's Open Knowledge Format, a shared way of organizing what you know. Pick this if you want your notes to work well with other tools that understand the format."],"_bth6g":["Claude Code is installed, but OpenKnowledge tools aren't connected to it yet."],"_eguJc":["Uploading"],"_gkGSK":["deleted template"],"_hPpdX":["Skill renamed"],"_pY_Vq":["The repository was moved, renamed, or deleted."],"_qD6mn":["Pick the folder where you've cloned it."],"_rP3HI":[["minutes"],"m ago"],"_tekeB":["updated folder properties"],"_tjopj":["Paste duplicate"],"a-cKXz":["Select all source"],"a3H_MR":["Open and focus the Ask AI composer for the current editor selection."],"a5Gha5":["Local changes blocked the merge"],"a5W0q0":["Are you sure you want to delete ",["folderName"],"/ and all files inside? This action cannot be undone."],"a9OzSn":["No pages found for \\"",["trimmedQuery"],"\\""],"aBgwis":["Scope"],"aByJ8j":["How does sharing work?"],"aE2_XM":["One pattern per line — appended to <0>.okignore</0>."],"aENGMB":["Semantic search adds meaning-based ranking to the search tool so conceptually-related pages surface even without shared keywords."],"aM23Wr":["page-name"],"aOp3hw":["Couldn't move to Trash"],"aWlJai":["Starting sign-in flow"],"a_u4ck":["Loading tags"],"aaE55D":["Clear ",["keyName"]],"aalx4E":["Editing broken MDX source: ",["reason"]],"abiHje":["Delete selected items"],"adsMWO":["Resolving deltas"],"aiArms":["We couldn't clone this repository."],"ajz9F8":["Couldn't load conflict content for ",["filePath"],". Try reloading the page."],"aoa6xA":["network error (is \`ok ui\` running?)"],"arUUsK":["Product updates"],"az8lvo":["Off"],"b3Thhd":["Upload failed"],"b4AQFK":["Open activity panel for ",["tooltipName"],", editing ",["realCurrentDoc"]],"b4VvP-":["Existing branch <0>",["trimmed"],"</0> will be checked out into its own window, under <1>.ok/worktrees/</1>."],"b4itZn":["Working"],"b5aNbi":["The ",["targetNoun"]," could not be opened — try navigating to it manually."],"bBE5tC":["Detected on this machine"],"bBcFK_":["Open emoji picker for ",["keyName"]],"bD8I7O":["Complete"],"bGa3Fk":["Uploading file"],"bH382I":["Edit this HTML — the preview updates live."],"bSD4im":["Search worktrees and branches"],"bS_boY":["Replace current match"],"bUUVED":["Asset"],"bV6DJA":["Who you are, so the agent has your context."],"bWLmRK":["Could not fetch branch. Check your connection."],"ba3vIW":[["templateCount","plural",{"one":["template"],"other":["templates"]}]],"bcDHUM":[["descriptorLabel"]," — render error, source editable below"],"bcjYUA":["Fold or unfold source"],"bkQRMh":["Paragraph"],"blFttG":["Search projects"],"bmC18N":["Clearing local collaboration data for \\"",["docName"],"\\" before reconnecting."],"brCtGB":["History unavailable"],"bultyE":["When enabled, the agent opens or refreshes the preview after each edit. Disable if you manage your own preview window (OK Desktop, a browser tab on another display, etc.)."],"bwil08":["Building <0>openknowledge.skill</0> and opening the Claude Desktop App"],"c1LZZH":["Link copied."],"c5f7sm":["Code block language: ",["currentLabel"],". Click to change."],"c5rF4v":["What is this knowledge base for?"],"c863eW":["Could not switch to ",["shareBranch"],". Try switching manually."],"c8iK2Y":["No templates found."],"c8jBgX":["Checking for updates on GitHub"],"cEoyWz":["Add item to ",["keyName"]],"cF9DyA":["Reconnecting after server restart"],"cIptmH":["In the Claude Desktop App"],"cKjLuT":["(project + user)"],"cOSAfL":["No repositories found on your GitHub account."],"cOrTMo":["Your share link is ready below."],"cRHuuI":["Couldn't copy path"],"cSCbv3":["BETA"],"cUK8lW":[["conflictCount","plural",{"one":["#"," conflict"],"other":["#"," conflicts"]}]],"cUk6TF":["Sync failed — check the server logs for details."],"cV7LOw":["Team Wiki"],"cZGNlb":["Add another pattern"],"cZI5AL":["OK Desktop"],"cZ_8zB":["Stays on this computer."],"cdm00A":["No Incoming"],"cdmk8A":["Uncommitted changes"],"chL5IG":["Community"],"cklVjM":["Timeline"],"cn1sLi":["Couldn't connect OpenKnowledge tools to Claude Code. Please try again."],"cnGeoo":["Delete"],"cqQyPB":["Folder name"],"crqzW5":["AI tools"],"cs4mps":["Config sharing"],"csDS2L":["Available"],"ct2kv5":["No headings in ",["pageTarget"]],"cuA8QW":["Organize specs"],"d1JjXo":["Your local copy of branch <0>",["branch"],"</0> is behind. Pull the latest changes, then open the link again."],"d2uTPx":["Server error (HTTP ",["status"],")"],"d5rK4X":[["chars","plural",{"one":["char"],"other":["chars"]}]],"dD7NPy":["Outline"],"dDpCOp":["Rename succeeded but the sidebar may be out of date — refresh to resync"],"dEgA5A":["Cancel"],"dGAdpH":["New branch <0>",["trimmed"],"</0> will be created from <1>",["currentBaseLabel"],"</1>, in its own worktree under <2>.ok/worktrees/</2>."],"dIYSqk":["remote"],"dJw2_7":["Saved with the project for your team."],"dMsx3p":["Home page and navigation hub."],"dN20LW":["Semantic search is on, but no API key is set — search falls back to keyword matching. Add one in <0>Settings → Account</0> (it's stored once for your whole machine)."],"dNM58w":["Claude Code (claude) isn't installed or on your PATH."],"dOHMA0":["Failed to move"],"dOxPd4":["Footnote"],"dPOFid":["Show or hide terminal"],"dTaauv":["Reason: ",["reason"]],"dUCQo4":["Renamed to \\"",["trimmed"],"\\""],"dUQ7_J":["Add meaning-based ranking to search so conceptually-related pages surface even when they share no keywords. This setting applies only to this computer."],"dURmlQ":["\\"frontmatter\\" is a reserved property name"],"dXWMFn":["Removes this skill from your editors."],"dbapvC":["Follow us on social media"],"dbhUX1":["Hide this file"],"dbtjJh":["(opens in new tab)"],"djc1l9":["More than ",["0"]," requests were blocked by the preview's security policy"],"djjdjr":[["deleteCount","plural",{"one":["Delete"],"other":["Delete ","#"," items"]}]],"dprWmL":["Anchor in this page"],"dr1vFs":["Replace all matches"],"dvGKu2":["Shared auto-sync default"],"dw_3cv":["Rename skill"],"dw_dUJ":["Failed to duplicate path"],"e0NrBM":["Project"],"e1Rn_k":["Open containing folder"],"e1hptq":["Embed a video with native player controls."],"e4GHWP":["Pull"],"e4PbgC":["Duplicate the file-tree item copied from the Files sidebar."],"e8L17t":["A non-empty folder already exists at this path. Pick a different folder."],"e8zRrb":["Show Files"],"eBIT9h":["Paste failed.",["restoreSuffix"]],"eFJkVt":["Clone failed: ",["cloneError"]],"eG8Jsg":["Toggle source tab focus mode"],"eGUbmF":["Copy selected file or folder"],"eJitUk":["Upload from computer"],"eKThTQ":["Failed to reorder"],"eNQGRb":["Inline LaTeX math rendered with KaTeX."],"ePK91l":["Edit"],"eQkgKV":["Installed"],"eQxm13":["Failed to update attachment location — ",["detail"]],"eSu2Xn":["Writes a project-MCP config for each selected tool; Claude also gets <0>.claude/launch.json</0>."],"eTL5y9":["Show selection preview"],"eTsJYJ":["description"],"eVPynQ":["Open <0><1>",["verificationUri"],"</1><2/></0> and enter this code:"],"el312q":["Install skills into"],"emgiet":["Authoritative content; mirrored verbatim everywhere it's referenced."],"eneWvv":["Draft"],"epuNYK":["Mark a block as the source of truth. Mirrors elsewhere update live as you edit it."],"euc6Ns":["Duplicate"],"evs0iw":["Tags matching \\"",["tagListQuery"],"\\""],"f1XQyZ":["Move block"],"f65AOQ":["Start from"],"f8jU-L":[["0"],"/",["1"]," — ",["2"]],"f9lQNJ":["Adds a managed block to"],"fBHvBn":["There's no project folder for this window, so a terminal can't start here."],"fBaTkM":["Toggle the bottom terminal panel."],"fG0X0e":["Install ",["brand"]," →"],"fIgqfQ":["Reinstalling"],"fJgQHX":["Failed to create file"],"fNr-MX":["Disable semantic search"],"fR-Kdc":["(project-level only)"],"fVcm9t":[["0","plural",{"one":["#"," doc"],"other":["#"," docs"]}]],"fWi7pn":["Initialize starter pack"],"fWsBTs":["Something went wrong. Please try again."],"fYKgzG":["Failed to load recent projects."],"fYjgXu":["Unordered list of items."],"f_PkYv":["Restarting closes this project's server. Connected agents (Claude Code, Codex, Cursor) will see their OpenKnowledge MCP connection close unexpectedly — you may need to restart the agent, or toggle its OpenKnowledge MCP server off and on, to reconnect."],"fbdLmk":["Toggle bold formatting."],"fbsiBw":["Something went wrong starting the terminal."],"fcgvCA":["Claude"],"fiMNLl":["Sync settings not yet loaded — try again in a moment"],"fj5YiP":["Downloads a fresh copy from GitHub."],"fo0VXg":["Uninstall"],"fqSfXY":["Replace"],"fuJZKk":["Search branches"],"fwhX-N":["Indent or outdent source"],"fxbCNQ":["Synced. The link is up to date."],"g3UF2V":["Accept"],"g4WlQK":["Project AI tool management is only available in the OpenKnowledge desktop app."],"g4XBm0":["Small section heading."],"g58Kwy":["<",["descriptorLabel"],"> failed to render (likely a bad prop). Copy the source to see what went wrong, or delete the block."],"gBbxn_":["Checking sign-in status"],"gGVP4q":["Click <0>+</0> <1/> <2>Create skill</2> <3/> <4>Upload skill</4>."],"gHSAWT":["Create worktree <0>“<1>",["typedName"],"</1>”</0>"],"gITz7o":["Move the cursor or extend selection through CodeMirror's standard source-editor navigation keymap."],"gJR87V":["Could not create the project folder. Pick a different folder."],"gKi-a_":["New project"],"gQV-9w":["Branch switched but the ",["targetNoun"]," could not be opened — try navigating to it manually."],"gUlRQj":["Orphans"],"gYuDfu":["Pick a starter pack to scaffold your project with ready-made folders and templates."],"gYz2ep":["Expires in ",["timeLabel"]],"gbHcbI":["Failed to delete property"],"gfdqcY":["Couldn't apply the change: ",["0"]],"gfohmY":["Connect tools"],"ggm6JX":["This page doesn't exist yet. Open it to create the page in the editor and collapse the graph."],"ggs9f8":["Search files, folders, or commands"],"gijbne":["Failed to rename path"],"gk_-qj":["Couldn't rename template: ",["0"]],"gljvbT":[["words","plural",{"one":["word"],"other":["words"]}]],"glzsS_":["Pan right"],"gmJ0An":["Failed to open folder."],"goO4Ll":["Editor status bar"],"gp3I7-":["Before syncing, set your identity for git commits:"],"gtEbeW":["Highlight"],"gvApb7":["Turn the things you read into clear, trusted articles. Save a source, figure out what it means, then keep the final version so you can rely on it later."],"gwykHF":["This doc hasn't synced to GitHub yet. The link will work after the next sync."],"h-AdvS":["The folders and templates are already here, so there's nothing to add."],"h06R3C":["No pages are missing outgoing graph links."],"h6EvY-":["This will replace the current document content with the version from <0>",["relative"]," (",["absoluteTime"],", ",["entrySha"],")</0> by <1>",["authorName"],"</1>. Your current content is already saved in the timeline — you can restore it anytime."],"h7FzJC":["Link-graph response did not match expected shape."],"h9QFb9":["Skill \\"",["0"],"\\" deleted"],"hBMK4W":["Project templates"],"hCOLSd":["Keep a written record of how your product gets built. A home for proposing ideas, recording decisions, writing specs, and capturing what you learned after something broke."],"hDEaQu":["Connect OpenKnowledge to other tools you use."],"hDKtoF":[["diffHrs"],"h ago"],"hDoLrm":["Remove ",["projectName"]," from recent projects"],"hGmuTc":["Docs tagged #",["tagDocsName"]],"hHMv6l":["Delete block"],"hIQkLb":["New chat"],"hItdtk":["Browse folder"],"hLy8b1":["Updated to Version ",["version"]],"hQXiDc":["Search branches..."],"hSBIG-":["A title, description, tags — anything that describes this folder."],"hSySVc":["Install handoff failed: ",["msg"]],"hXUWyd":["Value is required"],"hXbSxc":["Asset: ",["title"]],"hY8pka":["Select next occurrence"],"hYDc6B":["Name cannot be empty"],"hYgDIe":["Create"],"hZoBHK":["Empty starting content"],"haHgQj":["Copied relative path"],"he3ygx":["Copy"],"hjO0Mq":["Add tab"],"hmYd9H":["Keep track of the people and companies you work with and the meetings you have with them. Good for remembering who someone is, how you know them, and what you last talked about."],"hnq8fP":["Remove ",["label"]," from context"],"hpDtUm":["External wiki link"],"hpzRlK":["Reopen closed tab"],"hwFOFD":["Settings failed to load"],"hxBHxQ":["A line with a footnote<0><1>[1]</1></0> and a definition shown below."],"hxEUVJ":["Initialize ",["selectedPackName"]],"hyCxJY":["Open that worktree instead"],"hynz2K":["Download started"],"i-ShMB":["Diagram"],"i1flq_":["Wiki link suggestions"],"i3f2kh":["No matching commands."],"i92eAT":["We'll create a repository and start syncing — no terminal needed."],"i9OyGp":["Undo or redo"],"i9TPUi":["This ",["targetNoun"]," isn't on branch <0>",["branch"],"</0>. It may not have been pushed yet."],"i9toLO":["Agent configuration file"],"iAoh55":["Update \\"",["0"],"\\"?"],"iDZtvM":["Failed to load templates: ",["message"]],"iEQQyu":["Agent"],"iEYxO4":["Show thumbnails"],"iGCs04":["No templates available"],"iH8pgl":["Back"],"iHAJDj":["Resolving default location"],"iKSP5j":["Word wrap"],"iKZkk1":["Property value"],"iMkWoF":["Turn on"],"iNFKkm":["No diff."],"iO8V-7":["Create worktree"],"iOHg1t":["Open embedded URL in new tab"],"iSLIjg":["Connect"],"iSQTsg":["Ordered list"],"iSnkwB":["Failed to open cloned project."],"iTlqm3":[["ahead","plural",{"one":["#"," commit ahead"],"other":["#"," commits ahead"]}]],"iTylMl":["Templates"],"iXTp5j":["Scope: "],"idD8Ev":["Saved"],"ig5vUe":["Failed to load file"],"iilQXA":["Folder duplicated"],"ijLc3m":["Bullet list"],"ipn17C":["The <0>type</0> every document created from this template gets (e.g. <1>research-note</1>). Keeps new docs Open Knowledge Format–conformant."],"iqIDv4":["Sync status unavailable"],"iqugog":["Initialize failed: ",["errorDetail"]],"irFGwu":["Template list"],"ircigK":["Blank project"],"irrm_E":["Remove selection"],"isRobC":["New"],"iuTKci":["No edits yet."],"iycx_A":["Pushing"],"j9Vqvc":["inherited"],"jAMpHn":["What is a starter pack?"],"jBVUXo":["Couldn't open the terminal — please try again."],"jEZ6Lf":["provisional"],"jEdF24":["Missing page: ",["linkTitle"],". Click to create."],"jKd3AP":["Could not enable the terminal: ",["0"]],"jPUPvG":["Couldn't resolve the conflict for ",["filePath"],"."],"jRHdCz":["Failed to load PDF"],"jSO1X5":["Inherited templates can't be renamed here — rename it in the folder that owns it."],"jSY41h":["\\"",["docName"],"\\" took too long. Check your connection."],"jTLWxh":["Embed an external page in an inline iframe (docs, demos, Figma, CodeSandbox)."],"jX0IPx":["A skill with this name already exists."],"jZ_E5M":["Fetch failed — check the server logs for details."],"j_Z6g7":["Shared default"],"jbSG8V":["Show Files (",["sidebarShortcutLabel"],")"],"jdGUeI":["Couldn't create template: ",["error"]],"jerqF0":["Loading branch state"],"jhtG3I":[" Your selection has been restored."],"jjtmV_":["First file name"],"jol95m":["Failed to open Project Navigator."],"jtg_8-":["Build a knowledge wiki about the different types of flightless birds. Start with an overview page, then add cross-linked pages for each major group (ratites like ostriches, emus, and kiwis; penguins; and flightless rails), the regions they live in, and a timeline of how flightlessness evolved."],"ju38ms":["This project has no git repository — sharing mode does not apply. Initialize a repo to enable the toggle."],"jwnpdM":["A template named <0>",["trimmedSlug"],"</0> already exists here. Saving creates a local copy that overrides it for this folder."],"k4CuuV":["Ready-made folders and templates to get you started quickly. Select a pack to preview what gets created, then add it to your project."],"kCNU4q":["Indexing your pages — ",["semanticIndexedCount"]," of ",["semanticTotalCount"]," ready. Results may be incomplete."],"kCqCyf":["Open CodeMirror's lint diagnostics panel."],"kFLlsI":["Insert a footnote reference + matching definition stub."],"kLv8d3":["Your copy of branch <0>",["shareBranch"],"</0> has changes that aren't on GitHub. The ",["targetNoun"]," will appear once the branch syncs."],"kNqMMd":["Folder"],"kUn-CN":["Sync off"],"kV2YZv":["Don't see <0>Skills</0>? Enable <1>Settings <2/> Capabilities <3/> Code execution and file creation</1> first."],"kYL1lH":["Agent activity"],"k_pade":["Config sharing is now shared. Commit the OK files to share with your team."],"k_yIIc":["Will be created at: <0>",["targetPreview"],"</0>"],"kdzzOK":["Off — search ranks by keyword only. No content leaves this computer."],"keNFEd":["Set identity"],"khCa4M":["Teaches coding agents in this project to read and write through OpenKnowledge."],"kj9pAE":["Creating page"],"kknhfj":["No changes"],"kmKqZg":["Clusters"],"knjOzA":["Tag value"],"kolRU1":["Do you want to permanently delete instead?"],"kpqWwG":["This ",["targetNoun"]," was removed from branch <0>",["branch"],"</0>."],"ku0yLQ":["Pages are embedded the first time a search needs them."],"ky9Tuc":["Edit ",["0"]," source"],"l17ab4":["Could not write project files. Try a different location."],"l1aQKz":["Visual editor table"],"l1l8sj":[["0"],"d ago"],"l3s5ri":["Import"],"l46MqT":["Next tab"],"l6OXqI":["No installed agents found"],"l6kpzR":["This ",["targetNoun"]," has been moved, renamed, or deleted in your local copy of branch <0>",["branch"],"</0>, and that change hasn't synced yet."],"l8G3S9":["Auto-sync is off — you don't have permission to push to this repo"],"lAiyU_":["Only the current document uses <0>#",["tag"],"</0>."],"lCC_D5":["Subscribing..."],"lGs_bQ":["Page <0>*</0>"],"lHwYMr":["Server error: ",["status"]," ",["statusText"]],"lI0Td2":["Use letters, digits, <0>_</0> and <1>-</1> only."],"lIn9L9":["Disable sync"],"lPzyrU":["All hunks resolved"],"lVWEIL":["Indexed ",["embedded"]," of ",["total"]," pages."],"lWNpNB":["Add cursors or select matching occurrences through CodeMirror."],"lXKZGw":["Heading 1"],"lZAiSP":["Backlinks response did not match expected shape."],"l_FAT6":["Use letters, digits, <0>-</0> or <1>_</1> only."],"l_UFPv":["Properties"],"lb_UU4":["Sync now"],"lbkOif":["Undo or redo visual-editor changes through TipTap collaboration history."],"lhjq3G":["Reset ",["labelText"]," to default"],"ljHjfg":["That branch is already open in another worktree."],"lkYioO":["Show or hide document panel"],"ll2yNl":["Content directory"],"lond3p":["Shows above the code body. Round-trips as \`title=\\"...\\"\` in markdown."],"lrhetp":["+ ",["overflow"]," more"],"ls1N1w":["(missing)"],"lyWa43":["Project-level disconnected pages"],"lzmtKp":["Failed to load folder properties: ",["message"]],"lzwo7p":["Could not open GitHub sign-in. Please try again."],"m16xKo":["Add"],"m2T1Xj":["Tag #",["tagValue"],", ",["uses"]],"m4v3XT":["Undo last edit on ",["docName"]],"m6YGpY":["Active panel content for the selected tab shows here."],"mBltnd":["Path suggestions"],"mGaZwZ":["See the full install guide"],"mHVPm5":["Reconnect required"],"mLAjyL":["Give the AI tools you use access to read and update your projects. Checking a box sets it up right away; unchecking removes it."],"mNY1G6":["Undo all edits"],"mPneVR":["Updated \\"",["display"],"\\" to ",["0"],"."],"mPy9lS":["Organize my existing specs into a linked index grouped by area, and flag any that have drifted out of sync with the current code."],"mU3j1b":["Remove item ",["0"]],"mVFyH-":[["accessibleLabel"]," (conflict)"],"mWVJRX":["Collapsible section with a clickable summary."],"mY8U64":["Teach agents a repeatable task. You can edit the body after creating."],"mYGY3B":["Date"],"mYzDD_":["A worktree folder for that branch already exists."],"mZ1r4i":["Create a document from ",["label"]],"maDWIB":["Mirror source <0>api-spec</0>"],"makN88":["No patterns yet. Type a folder or file name below to start hiding files."],"mdKFEy":["You cancelled loading \\"",["docName"],"\\"."],"mdzKSV":[["nodeCount","plural",{"one":["#"," node"],"other":["#"," nodes"]}]],"mf37rL":["Retrying"],"mg0YGL":["Source multi-cursor and multi-select"],"mk2poV":["e.g. server.ts"],"mmpzAq":["Wrap long lines in the markdown source editor."],"mo22UP":["Toggle inline code formatting."],"mqSwZH":["<0>Mirror anchor not found.</0> No <1>",["mirrorSourceTag"],"</1> exists in <2>",["src"],"</2>."],"msOK6I":["Repositories you've already cloned may keep syncing through git's own saved credentials, even after you disconnect."],"msqUNq":["Ready-made folders and templates to get you started quickly."],"mu1O0q":["Open Knowledge can manage ",["0"]," editor skill(s) for this project. Import moves them into .ok/skills and replaces the .claude, .codex, etc. copies with symlinks — one place to edit, in sync everywhere. If those folders are committed to git, review the change first; symlinks can behave differently on some editors and on Windows."],"mwMF9u":["Open CodeMirror search in source editor mode."],"mxY24F":["Duplicate the focused file-tree item when focus is in the Files sidebar."],"n2lRue":["Commit or stash changes to switch:"],"n5n_vi":["Private repository"],"n6hXUm":["Auto-sync periodically fetches, pulls, and pushes commits to your remote git repository so your edits stay in sync across machines."],"n7aopT":["Editor mode"],"n8DwqQ":["Connects automatically the next time you open this project in a trusted Codex session."],"nCzR-G":["Copy code ",["userCode"]],"nD7Fx9":["This replaces the current skill content with the bundled version ",["0"],". Any local edits will be replaced — your current version is saved to history first, so you can restore it."],"nDT8qt":["Initialized ",["0"]," but could not open it."],"nJq7et":["Couldn't uninstall skill: ",["0"]],"nMSYz5":["This path is on an external volume (/Volumes/...). OpenKnowledge will lose track of files when the drive ejects."],"nNYV3Y":["and ",["remaining"]," more"],"nP-KFo":["New ",["0"]," chat"],"nTwL53":["Open a doc to share its URL."],"nUNZL4":["Ask ",["0"]],"nWv1ja":["Manage hidden files in Settings → Ignore patterns."],"nYKerc":["(user-level only)"],"nYeBmY":[["hours"],"h ago"],"nbfdhU":["Integrations"],"ndeI89":["Use Cmd/Ctrl+C to copy the link below, or open OK in the desktop app."],"ndwmea":["unavailable on this platform"],"neRy3o":["Split list item"],"nfoduq":["create worktree"],"nft48x":["Stored at <0>.ok/templates/</0> in this project. Available in every folder (folder-scoped templates can override by filename)."],"ng2Ibo":["Branch name"],"nh3wwx":["Embeddings provider key"],"njBeMm":["Both"],"njU86j":["Property \\"",["trimmed"],"\\" already exists"],"noH1JX":["Couldn't reach collab server — ",["errorDetail"],". Try <0>ok status</0> or check <1>.ok/local/last-spawn-error.log</1>."],"npcziF":["Install on"],"nqV0Kk":["This folder hasn't synced to GitHub yet. The link will work after the next sync."],"nrGWJ7":["Git identity isn't set — commits use a default author. Set yours so teammates see your name."],"nskygk":["Choose agent"],"nxlOpL":["OpenKnowledge is using this GitHub account."],"ny6vNn":["OpenKnowledge is using a GitHub account provided by the gh CLI. There's no separate OpenKnowledge credential to disconnect."],"nzHlj8":["Close ",["0"]],"nzaV6Q":["Page thumbnails"],"o2yoFu":["Reveal in Finder, No workspace"],"o49mDZ":["Loading timeline history"],"o4dcAf":["Reveal in File Explorer, ",["hint"]],"o5gfs1":["This setting is per-machine and isn't shared with collaborators. It needs an API key set with <0>ok embeddings set-key</0>."],"o9CrsQ":["research-note"],"oAFVKX":["Failed to update the project sync default — ",["detail"]],"oAGN8p":["Remote branch <0>",["remoteCheckoutRef"],"</0> will be checked out as a new local tracking branch <1>",["trimmed"],"</1>, in its own window under <2>.ok/worktrees/</2>."],"oBXkm2":["Delete code block"],"oCHfGC":["Level"],"oCZkaG":["Copy path"],"oJl7eO":["Unknown component: ",["componentName"]," — source editable below"],"oKBnk5":["More requests were blocked."],"oQA-cA":["Full path"],"oS1YpJ":["Open the Project Navigator."],"oXKEsy":["Delete an adjacent wiki-link or tag chip."],"oYepHb":["The terminal is turned off for this project. Turn it back on to run commands here."],"of3tF-":["You picked ~/Documents. OpenKnowledge will index every markdown file under it. If you only want to manage a sub-folder, choose a smaller scope."],"ogAuyr":["Back to document view"],"omXJcU":["Close others"],"optX0N":[["0"],"h ago"],"oqB2ez":["Previous match"],"osRqlv":["Open delete confirmation for the selected file-tree items."],"ot5BRK":["Duplicate selected file or folder"],"otE4aj":["Show external URL nodes"],"ou1hFW":["Toggle an ordered list."],"outYNy":["Duplicate name \\"",["keyName"],"\\""],"ovIGrT":["Local collaboration data for \\"",["docName"],"\\" could not be cleared. Reload to retry."],"p0Iq25":["Insert link"],"p9sdCy":["New ignore pattern"],"pAgkuZ":["Reopening \\"",["docName"],"\\" with a fresh local collaboration cache."],"pBROkv":["Thanks for subscribing. Watch your inbox for product updates."],"pEQFsW":["No matching projects."],"pFagOn":["Source editing"],"pHYP6v":["Open <0>Customize</0> in the sidebar <1/> <2>Skills</2>."],"pRc-Im":["Undone all edits on ",["docName"]],"pTPqMK":["Toggle a fenced code block."],"pWT04I":["Checking..."],"pWbsW6":["Loading docs"],"pZAs1T":["Failed to load outgoing links"],"pajIrl":["Could not turn off the terminal: ",["0"]],"pbwTg6":[["seconds"],"s ago"],"pckX1A":[["0","plural",{"one":["#"," use"],"other":["#"," uses"]}]],"pcqlQu":[["0","plural",{"one":["Folder"],"other":["Folders"]}]],"pgq_xf":[["0"],"/",["1"]," ",["2"]],"phM8Kh":["Found the repo but could not open the project. Please try again."],"pha01Y":["Project-level pages with no incoming graph edges."],"pkAft1":["Search failed."],"pmKdif":["Failed: ",["loadError"]],"pmUArF":["Workspace"],"ppDgFi":["Restart with this app's version"],"psfGPX":["MCP connections"],"pzutoc":["Italic"],"q2kXMG":["Inline Math"],"q4YJl_":["The terminal session ended (exit code ",["0"],")."],"q6-JVU":["Loading pages"],"q7F5am":["title"],"qAQVSD":["Page headings response was not JSON"],"qAhFeg":[["userName"]," · ",["tabCount","plural",{"one":["#"," tab"],"other":["#"," tabs"]}]],"qAx7xG":["Fixed folder in content root"],"qEIFZu":["Key ending in ",["keyHint"]],"qEue6Q":[" or "],"qFWMl-":["View as text"],"qNOgUu":["Edits at the source land here — no copy-paste drift."],"qRZh7J":["Let Tab leave the source editor instead of indenting."],"qSKu2v":["Source navigation and selection"],"qSxaOz":["Accept their deletion"],"qUB_o_":["Auto-sync is off — your edits stay local until you commit and push manually."],"qXg5W9":["File saves to <0>~/Downloads/openknowledge.skill</0>."],"qXsafh":["Publish to GitHub"],"qZv5ZR":["Config sharing toggle failed"],"q_9EcE":["Enable git auto-sync?"],"q_z77Z":["Heading levels"],"qaHyRJ":[["linkCount","plural",{"one":["#"," link"],"other":["#"," links"]}]],"qbfj1f":["Receiving objects"],"qdBUHP":["Couldn't load ",["fileName"]],"qi1F96":["Reveal in File Explorer"],"qiRoLb":["Summarize everything I changed this week"],"qioCwA":["Jump to page ",["pageNumber"]],"qjHMHf":["Failed to disable sync — ",["detail"]],"qo4zCg":["Path cannot contain backslashes"],"qpQwGC":["Describe what you're working on and the agent sets it up for you."],"qvWGzP":["Collapse all"],"qyLmWw":["Source editor search panel"],"r-OJYm":["Enter a valid branch name (no spaces, no leading dot, no \\"..\\")."],"r2huLx":["Undo, redo, or undo selection changes through CodeMirror history."],"r4R7AZ":["Network error during cleanup"],"r51jLC":["File saved & Claude Desktop App opened"],"r871ed":["Your knowledge base is now on GitHub at <0>",["ownerLogin"],"/",["repoName"],"</0>."],"rBc32v":["Couldn't reach the embeddings provider — press ↵ to retry"],"rFw02Q":["Uploading ",["keyName"]],"rJVoVX":["Source find results"],"rNifQd":["Remove property"],"rQAQus":["Couldn't save template: ",["error"]],"rQRrkB":["yesterday"],"rSoi6g":[["displayName"]," (",["bin"],") isn't installed or on your PATH."],"rVgSRB":["Collapse ",["docName"]],"rVxu1k":["No pages link here yet."],"rXz97P":["Numbered list of items."],"rZ9HZq":["To do"],"rZVMkf":["Visual editor replace input focused"],"rageVb":["Custom HTML with a live preview pane (sandboxed iframe)."],"rdU729":["Layout"],"rf6x3F":["Dock terminal to the bottom"],"rfFpcF":["Remove ",["chip"]],"rgPqOw":["Convert the current block to a paragraph."],"riqekz":["Suggestion menu navigation"],"rlUzXK":["Could not validate folder. Please try again."],"roAe2K":["Link URL"],"roiUQQ":["This page doesn't link to anything yet."],"rppgXF":["Disconnecting"],"rssK8c":["Ignore patterns (raw text)"],"rtdR4v":["Show or hide Files"],"rwrPbS":["Component boundary navigation"],"s-MGs7":["Resources"],"s-XOaI":["File name"],"s061i4":["Relative path"],"s0IDhW":["This file could not be found."],"s0J_k9":[["0","plural",{"one":["#"," key"],"other":["#"," keys"]}]],"s0_GnA":["Opening ",["openingLabel"],"…"],"s1c0ja":["Bullet List"],"s3caR3":["Deleting"],"sE7R19":["Could not load templates: ",["templatesError"],". You can still create a blank note."],"sER-bs":["Files"],"sFhaTJ":["Disambiguates similarly-named templates in the menu."],"sHrqDx":["Couldn't rename skill: ",["0"]],"sIGbBZ":["Convert selection to footnote"],"sIxSSP":["Resolve conflict in your terminal"],"sJK6pq":["Permission denied"],"sJWhgo":["Unknown component: ",["unregisteredComponentName"]],"sOxZaS":["Failed to load graph"],"sZ2IOu":["This ",["targetNoun"]," was shared from branch <0>",["shareBranch"],"</0>. It doesn't exist on your current branch (<1>",["currentLabel"],"</1>)."],"saIASg":["Second item"],"saYiIO":["Path cannot contain null bytes"],"seeS6l":["Setup OpenKnowledge in this folder?"],"shNd9t":["Slash command menu"],"skf5Ix":["Indent or outdent source editor lines."],"snrVQ7":["probe failed"],"ssuwjF":["Branch"],"stlgky":["On — your search queries and the text of matching pages are sent to your embeddings provider (OpenAI by default) to compute embeddings."],"sxTdZI":["Loading paths…"],"sxjyRq":["Worktrees"],"sxkWRg":["Advanced"],"t-JXbf":["Notion-style inline row for a downloadable file. Drag-drop also works."],"t18QYR":["Unpin ",["accessibleLabel"]],"t2TkQ3":["Sync paused — resolve conflicts to resume."],"t422_7":["Uninstall everywhere"],"t4sFKC":["New branch <0>",["trimmed"],"</0> will be created from the current commit, in its own worktree under <1>.ok/worktrees/</1>."],"t6w1cq":["Open a blank editor tab."],"tAPZEx":["Below"],"tHKQ6j":["Renaming"],"tP5DDk":["Apply link"],"tUvUfp":["Use a folder you already have."],"tW_yvQ":["Expand ",["docName"]],"t_YqKh":["Remove"],"teD0H9":["Couldn't open a worktree for that branch."],"tfDRzk":["Save"],"tfi40B":["Failed to create page"],"tgWuMB":["Modified"],"thnPBX":["Activate the next editor tab."],"ti6aF_":["Ask ",["0"]," CLI"],"tiWX6q":["Source editor"],"tjXez2":["blog-post"],"toyw51":["Mermaid diagram controls"],"tsiTqO":["Paste your API key"],"tsyExA":["Connect your AI tools to OpenKnowledge"],"u-9fWA":["See <0>Architecture</0> for the system overview."],"u3BOHd":[["fileCount","plural",{"one":["#"," file"],"other":["#"," files"]}]],"u3YnKw":["Could not construct share URL."],"u3wRF-":["Published"],"u6Hp4N":["Markdown"],"u7H-Wn":["Show panel (",["panelShortcutLabel"],")"],"u7U_Ij":["Link the selected text, or edit the link under the caret."],"uA_jXp":["Switch and update branch"],"uCaIdy":["GitHub sign-in is missing or expired. Reconnect to resume syncing."],"uDlyqd":["Document the architecture of this repo: create an overview page that links to a page per major module describing its responsibilities and entry points."],"uF9ruK":["Saving"],"uFOL2y":["No project skills yet. Author one to teach agents a repeatable task scoped to this knowledge base."],"uFQbYd":["Home page and entry point."],"uGaIIS":["Check out worktree"],"uH_S-u":[["loadErrorTitle"],": ",["message"]],"uKRYiW":["Sync status unavailable — server error."],"uL_Wx8":["The terminal stopped unexpectedly."],"uM6jnS":["Restore failed"],"uO9WLl":["Push"],"uQNW00":["Detached HEAD — checkout a branch to resume"],"uQewpR":["Couldn't restart the server — it's running under a different account. Restart your computer to clear it, then reopen this project."],"uWtdQR":["No templates yet. Add one in this folder's Templates section, or in Settings → Templates."],"uWx2ZP":["Last sync"],"u_lS4C":["Clone complete — opening project"],"uaUc6t":["Restart server"],"ubMwcO":["The terminal session ended (signal ",["0"],")."],"ugoTXs":["folder"],"uhJEA2":[["count","plural",{"one":["#"," more participant"],"other":["#"," more participants"]}]],"uksqrP":["Repository not found. It may have been renamed, deleted, or moved."],"un8kBM":["Creating page: ",["linkTitle"],"."],"ur2XSb":["Visual editor"],"uuoHOU":["Command failed."],"uynXup":[["tokens","plural",{"one":["token"],"other":["tokens"]}]],"v-h2hx":["Delete ",["targetGitPath"]],"v2ZW0K":["Enable terminal"],"v41fCm":["File not found"],"v75Em9":[["uploadedCount","plural",{"one":["Uploaded one file"],"other":["Uploaded ",["uploadedCount"]," files"]}]],"v77jrg":["Visual editor selection"],"v7hK0U":["Use lowercase letters, digits, and hyphens only."],"v7lbnC":["Find next match"],"vAYoCZ":["Couldn't open the worktree. Try again."],"vDXqVv":["Insert a markdown hard break."],"vEJDlt":["The file is in your Trash; the file-watcher will reconcile."],"vGeNNQ":["Copy a prompt and paste it into your agent to set up your project."],"vIxrEk":["Fit width"],"vLyv1R":["Hide"],"vQIVHc":["Folder properties"],"vWc9a0":["Type to edit; <0>⌘ Enter</0> saves, <1>Esc</1> cancels."],"vZVeFG":["Upload failed — please try again"],"vbK_ZG":["Files sidebar"],"ve8vEM":["Code expired — please try again"],"vfRlCI":["Could not copy full path"],"vfWA_g":["You picked ~/Desktop. OpenKnowledge will index everything on your desktop."],"vhAnzJ":["Turn on semantic search?"],"viwC-K":["Failed to remove project."],"vppAju":["Where newly added attachments are placed."],"vv7kpg":["Cancelled"],"vvWZnu":["Diff unavailable"],"w3tVpc":["No links yet. Add wiki links or markdown links to build a graph."],"w3vFfL":["Hide Files"],"w4hMYl":["Could not read branch state for this project. Close this dialog and open the share link again."],"w7SsvI":["That folder isn't an OpenKnowledge project yet. Initialize it and open?"],"w7nm4K":["Indented blockquote for citations."],"wDgmsr":["\\"",["0"],"\\" install refreshed (",["1"],")"],"wGSHzy":["Activate one of the first eight editor tabs."],"wJijgU":["Location"],"wJo9oS":["Close find"],"wQp1V3":["Mirror of <0>",["src"],"</0>"],"wT4iQr":["Open visual-editor find with replace controls expanded."],"wTcjov":["No workspace"],"wXO4Tg":[["hrs"],"h ago"],"w_Sphq":["Attachments"],"wbv9xO":["Create new project"],"wbwHYD":["Enable sync"],"wdxz7K":["Source"],"weP6me":["Couldn't load docs — type @ again to retry"],"wlwXUk":["You picked ~/Downloads. Files there are usually transient — consider a stable folder instead."],"wn8EJi":["Skills teach agents repeatable tasks. Author them here; install a skill to project it into your editors' skill folders."],"wndeIl":["Project-level pages with neither incoming nor outgoing graph edges."],"wtcxiD":["Share this setup with your team?"],"wvbc1r":["Couldn't open document"],"wzq9Rv":["A branch with that name already exists. Open its worktree from the switcher instead."],"x-5mJ1":["Install on all"],"x2fr_j":["Graph"],"x3-2ta":[["packName"]," initialized (",["projectEntries","plural",{"one":["#"," entry"],"other":["#"," entries"]}],")"],"x57cJf":["Open link"],"xCJdfg":["Clear"],"xCdTnb":["Close new tab"],"xDBki3":["Heading suggestions"],"xFQRu4":["I already have it locally"],"xG4tb6":["Lost connection to \\"",["docName"],"\\"."],"xHGM4U":["Hide HTML preview"],"xK291b":["Two-page (odd)"],"xNyj3h":["Reinstall for Claude Chat & Cowork"],"xOTzt5":["just now"],"xSVO3J":["What gets created"],"xWEvuo":["Ask AI"],"xXo8FT":["Save failed: ",["error"]],"xYMPyY":["Paste was incomplete — ",["chunksCompleted"]," of ",["totalChunks"]," chunks landed.",["restoreSuffix"]],"xaDWAI":["Switch project"],"xbdtfY":["Markdown source"],"xc4g25":["Parse failed"],"xeXS4P":["Or use a starter pack"],"xeiujy":["Text"],"xhlFsx":["Inherited — set a value here to replace it."],"xiv-dW":["No files yet."],"xloBjn":["Relative Path"],"xnP32l":["No description yet — add one so agents know when to use this skill."],"xrVr_k":["Couldn't create skill: ",["0"]],"xsZhu-":["Page number"],"xzktOa":["Edit wiki link"],"y1t8bQ":["Settings sections"],"y3aU20":["Save changes"],"y46m5r":["The desktop app isn't responding. Refresh and try again."],"y5FUYi":["Suggestion menu open"],"y8B54M":["Couldn't send your prompt — please try again."],"yCX4jp":[" Your selection could not be restored."],"yEJ-sl":["The preview blocks resources that don't meet its security rules (for example plain http:// URLs, or code that uses eval). The content above may render incompletely."],"yFyZMJ":["No pages matched \\"",["semanticQueryText"],"\\" by meaning."],"yH7T4q":[["failedCount","plural",{"one":["1 file failed to upload"],"other":[["failedCount"]," files failed to upload"]}]],"yHikCO":["Open CodeMirror's go-to-line prompt."],"yIPXut":["Preparing search"],"yKu_3Y":["Restore"],"yLEyuq":["Product updates in your inbox."],"yLq4w4":["Separator"],"yMgL_E":["Find field navigation"],"yQE2r9":["Loading"],"yQyglE":["No matching docs"],"yUxR-Q":["Expand ",["keyName"]],"yWSvcf":["Content root"],"yWWThY":["Asset reference"],"yYR6za":["Display text"],"yZmvQ4":["This project's server (v",["0"],") is newer than this app (v",["1"],")."],"y_5CE8":["Item ",["0"]],"yaPGPa":["Open a project to manage its AI tool connections."],"yf5r22":[["keyName"]," type: ",["typeLabel"]," (inherited from folder properties; not editable here)"],"yhdqox":["Installed — ok is available in external terminals. Unchecking removes it; OpenKnowledge's built-in terminal and AI tools keep working."],"yitgD9":["Failed to load skill targets: ",["0"]],"yjExfe":["Branch <0>",["shareBranch"],"</0> is checked out in:"],"ylXj1N":["Selected"],"ymWJLd":["Show ",["0"]," more"],"ynIa4S":["Visual editor list item"],"ypw6My":["Showing top ",["0"]," headings — keep typing to narrow"],"ysxgu8":["project"],"yutJKi":["Checklist with checkboxes."],"yvG-l1":["Open source lint panel"],"yvHDYG":["Claude Desktop"],"yz7wBu":["Close"],"yzF66j":["Link"],"yzGPkm":["Expand graph"],"z-lawV":["worktree"],"z0a2EA":["Diagram from Mermaid source — flowchart, sequence, class, state, ER, gantt, pie."],"z1uNN0":["No emoji found."],"z2JdQ-":["Config sharing unchanged — see details below."],"z2funE":["Full Path"],"z5pqI8":["Cannot upload: no document is open"],"z60Lgn":["Saves the file to <0>~/Downloads/openknowledge.skill</0> and opens the Claude Desktop App. Requires Node.js or Bun on your PATH."],"zAsDLY":["Graph visualization of document links"],"zKxoPm":["Couldn't rename \\"",["0"],"\\": ",["1"]],"zL0LPh":["Global outside text fields"],"zLGXna":["No starter packs available."],"zLak8b":["Activate new tab"],"zQBg2C":["Move the current block up or down one position."],"zUhPuR":["Open containing folder, ",["hint"]],"zXj1rA":["Search by meaning"],"zZ_I5K":["Open project menu"],"zaXlhf":["The properties block at the top of this doc has a formatting error. Switch to source mode to fix it."],"zbymaY":[["0"],"m ago"],"zd00pH":["Copy Path"],"zgSFyG":["External link"],"zkz0Fg":["Set up syncing"],"zlErBl":["Page headings error response did not match RFC 9457"],"zo3Dl7":["Toggle thumbnails"],"zrP8HX":["Frontmatter every document created from this template starts with. Values are YAML — a list is <0>[a, b]</0>; <1>{",["date"],"}</1> fills in on create."],"ztKII6":["Failed to add item"],"zwBp5t":["Private"],"zyKa-I":["Star us on GitHub"]}`)},O$=`en`;Yc.load(O$,D$.messages),Yc.activate(O$);var k$=Symbol.for(`ok.client.logForwarder`),A$=2e3,j$=[`log`,`info`,`warn`,`error`],M$={log:`info`,info:`info`,warn:`warn`,error:`error`};function N$(e){if(typeof e==`string`)return e;if(e instanceof Error)return`${e.name}: ${e.message}`;try{return JSON.stringify(e)??String(e)}catch{return String(e)}}function P$(e){let t=e.message.length+80;if(e.event&&(t+=e.event.length),e.fields)try{t+=JSON.stringify(e.fields).length}catch{}return t}function F$(e={}){let t=e.windowObj??(typeof window<`u`?window:void 0);if(!t||t.okDesktop)return;let n=t;if(n[k$])return;n[k$]=!0;let r=e.consoleObj??console,i=e.documentObj===void 0?typeof document<`u`?document:null:e.documentObj,a=e.flushIntervalMs??A$,o=e.fetchImpl??n.fetch.bind(n),s=e.now??Date.now,c=[],l=0,u=null,d=!1,f={log:r.log.bind(r),info:r.info.bind(r),warn:r.warn.bind(r),error:r.error.bind(r)};function p(){if(u!==null&&(clearTimeout(u),u=null),c.length===0)return;let e=c.splice(0,100);l=0,d=!0;try{o(`/api/client-logs`,{method:`POST`,headers:{"content-type":`application/json`},keepalive:!0,body:JSON.stringify({entries:e})}).catch(()=>{})}catch{}finally{d=!1}}function m(e){if(c.push(e),l+=P$(e),c.length>100){let e=c.shift();e&&(l-=P$(e))}if(c.length>=100||l>=32768){p();return}u===null&&(u=setTimeout(p,a))}function h(e,t){if(!d)try{let n=Gn(t.map(N$).join(` `)),r=t[0],i=typeof r==`string`&&r.length<=32768?r:void 0,a=i?si(i):null,o=a?.fields;if(o)try{JSON.stringify(o).length>8192&&(o=void 0)}catch{o=void 0}m({level:e,message:n,ts:s(),...a?.event?{event:a.event}:{},...o?{fields:o}:{}})}catch{}}for(let e of j$)r[e]=(...t)=>{f[e](...t),h(M$[e],t)};let g=e=>{if(d)return;let t=e;h(`error`,[`uncaught error: ${t.message} (${t.filename}:${t.lineno}:${t.colno})`])},_=e=>{d||h(`error`,[`unhandledrejection: ${N$(e.reason)}`])},v=()=>p(),y=()=>{i&&i.visibilityState===`hidden`&&p()};n.addEventListener(`error`,g),n.addEventListener(`unhandledrejection`,_),n.addEventListener(`pagehide`,v),i&&i.addEventListener(`visibilitychange`,y);function b(){for(let e of j$)r[e]=f[e];n.removeEventListener(`error`,g),n.removeEventListener(`unhandledrejection`,_),n.removeEventListener(`pagehide`,v),i&&i.removeEventListener(`visibilitychange`,y),u!==null&&(clearTimeout(u),u=null),c.length=0,delete n[k$]}return{flushNow:p,uninstall:b}}function I$(e,t){return e.branch===void 0||e.branch===null||e.branch===``||t===``||e.multiCandidate!==!0?null:{message:`Opened on branch ${e.branch}`,description:t}}function L$(e){let t=e.bridge;if(!t)return;let n=e.setHash??(e=>{window.location.hash=e}),r=e.emitToast??((e,t)=>{bs(e,t)});return t.onDeepLink(e=>{let i=e.kind??`doc`,a={kind:i,path:e.doc,branch:e.branch??null};if(e.targetMissing===!0){as.arm(a);return}Di.arm(a),n(wl(i,e.doc,i===`doc`?e.branch:void 0));let o=I$(e,t.config.projectPath);o!==null&&r(o.message,{description:o.description,duration:3e3})})}var R$=4e3,z$=1440*60*1e3;function B$(e){let t=e.bridge;if(t&&t.onboarding)return t.onboarding.onToast(e=>{if(e.kind===`ancestor-promote`){bs.success(`Opened existing OpenKnowledge project at ${e.ancestorPath}`,{duration:R$});return}if(e.kind===`startup-reclaim`){let t=[];if(e.mcp.status===`repaired`){let n=e.mcp.editors.map(e=>Rr[e]??e).join(`, `);t.push(`repaired ${n} MCP integration`)}else e.mcp.status===`failed`&&t.push(`MCP auto-repair failed`);e.path.status===`installed`&&t.push(e.path.summary),e.path.status===`failed`&&t.push(`PATH install failed: ${e.path.summary}`);let n=t.length>0?t.join(`; `):`OpenKnowledge integrations checked.`,r=e.mcp.status===`failed`||e.path.status===`failed`,i=e.path.status!==`none`;bs[r?`error`:`success`](n,{duration:r||i?z$:R$,position:`bottom-left`});return}if(e.kind===`sharing-refused-tracked`){bs.error(`Config sharing unchanged: ${e.tracked.length} OK file(s) tracked upstream — see message below.`,{duration:z$,description:e.remediation});return}if(e.kind===`sharing-no-git`){bs.warning(`Local-only requested but no git repository was created. Switch later via Settings → Config sharing once the project is in a git repo.`,{duration:R$});return}let t=Gc(e.gitRoot,e.pickedPath)??e.pickedPath;bs.success(`Initialized OpenKnowledge at ${e.gitRoot} — opened parent of ${t} because it contains a .git folder`,{duration:R$})})}function V$(e){let t=(0,$.c)(18),{body:n,warning:r,restartLabel:i,cancelLabel:a,onRestart:o,onDismiss:s}=e,c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Z.jsx)(ds,{className:`mt-0.5 size-4 shrink-0 text-amber-500`}),t[0]=c):c=t[0];let l;t[1]===n?l=t[2]:(l=(0,Z.jsx)(`p`,{className:`font-medium text-sm`,children:n}),t[1]=n,t[2]=l);let u;t[3]===r?u=t[4]:(u=(0,Z.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:r}),t[3]=r,t[4]=u);let d;t[5]!==o||t[6]!==i?(d=(0,Z.jsx)(X,{size:`sm`,onClick:o,children:i}),t[5]=o,t[6]=i,t[7]=d):d=t[7];let f;t[8]!==a||t[9]!==s?(f=(0,Z.jsx)(X,{size:`sm`,variant:`ghost`,onClick:s,children:a}),t[8]=a,t[9]=s,t[10]=f):f=t[10];let p;t[11]!==d||t[12]!==f?(p=(0,Z.jsxs)(`div`,{className:`mt-1 flex flex-wrap gap-2`,children:[d,f]}),t[11]=d,t[12]=f,t[13]=p):p=t[13];let m;return t[14]!==l||t[15]!==u||t[16]!==p?(m=(0,Z.jsxs)(`div`,{className:`flex w-full gap-3 rounded-lg border bg-popover p-4 text-popover-foreground shadow-lg`,children:[c,(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1.5`,children:[l,u,p]})]}),t[14]=l,t[15]=u,t[16]=p,t[17]=m):m=t[17],m}function H$(){return Yc._({id:`f_PkYv`})}function U$(e){return e.serverRuntime===e.appRuntime?Yc._({id:`FWQuPE`,values:{0:e.appRuntime}}):e.relation===`older`?Yc._({id:`LhQlGR`,values:{0:e.serverRuntime,1:e.appRuntime}}):Yc._({id:`yZmvQ4`,values:{0:e.serverRuntime,1:e.appRuntime}})}function W$(e){return Yc._({id:`2YOwme`,values:{appRuntime:e}})}function G$(e){return Yc._({id:`5DFPDh`,values:{appRuntime:e}})}function K$(e){return e===`eperm`?Yc._({id:`uQewpR`}):Yc._({id:`PqYWiC`})}async function q$(e){let t=bs.loading(Yc._({id:`Kf7GG5`}),{duration:1/0}),n;try{n=await e.restartServer(e.config.projectPath)}catch{return}bs.dismiss(t),n.ok===!1&&bs.error(K$(n.reason),{duration:1/0})}function J$(e){let t=e.bridge;if(!t)return;let n=t.onServerVersionDrift(e=>{bs.custom(n=>(0,Q.createElement)(V$,{body:U$(e),warning:H$(),restartLabel:Yc._({id:`ppDgFi`}),cancelLabel:Yc._({id:`PBxg_E`}),onRestart:()=>{bs.dismiss(n),q$(t)},onDismiss:()=>bs.dismiss(n)}),{duration:1/0})}),r=t.onServerRestarted(e=>{bs.success(W$(e.appRuntime))}),i=t.onServerReclaimed(e=>{bs.warning(G$(e.appRuntime),{duration:15e3})});return()=>{n(),r(),i()}}function Y$(e){let{initialDoc:t}=e;if(!t)return;let n=e.getHash();n!==``&&n!==`#`&&n!==`#/`||e.setHash(kl(t))}function X$(){typeof window>`u`||!window.okDesktop||Y$({initialDoc:window.okDesktop.config.initialDoc,getHash:()=>window.location.hash,setHash:e=>{window.location.hash=e}})}rd(),n(()=>import(`./telemetry-startup-ChBVT3Gs.js`).then(e=>e.initStartupTrace()),__vite__mapDeps([106,0,1,2,3,4,35,7]),import.meta.url),S$({apiOrigin:typeof window<`u`?window.okDesktop?.config.apiOrigin:void 0}),F$(),YT()&&tE(),AZ(),rT(),wF(),TN(),typeof window<`u`&&L$({bridge:window.okDesktop}),typeof window<`u`&&J$({bridge:window.okDesktop}),typeof window<`u`&&ed({bridge:window.okDesktop}),typeof window<`u`&&Wc({bridge:window.okDesktop}),typeof window<`u`&&B$({bridge:window.okDesktop}),typeof window<`u`&&nd({bridge:window.okDesktop}),X$();var Z$=new fd({defaultOptions:{queries:{retry:1,staleTime:1e4}}}),Q$=document.getElementById(`root`);if(!Q$)throw Error(`Root element not found`);var $$=typeof window>`u`?void 0:window.okDesktop;(0,Cd.createRoot)(Q$).render((0,Z.jsx)(Q.StrictMode,{children:(0,Z.jsx)(on,{i18n:Yc,children:(0,Z.jsx)(wn,{client:Z$,children:(0,Z.jsxs)(Rn,{attribute:`class`,defaultTheme:`system`,enableSystem:!0,disableTransitionOnChange:!0,storageKey:`ok-theme-v1`,children:[(0,Z.jsx)(Ms,{children:y$($$)}),(0,Z.jsx)(b$,{richColors:!0,closeButton:!0})]})})})}));
|
|
2002
|
+
`}\n${lq}\n${uq}`;function oY(e){let t=e.split(`/`).pop()?.replace(/\.md$/i,``).toLowerCase();return!!t&&WJ.has(t)}function sY(e){return e===`darwin`?Yc._({id:`LtSYdi`}):e===`win32`?Yc._({id:`qi1F96`}):Yc._({id:`e1Rn_k`})}function cY(e){let t=(0,$.c)(18),{item:n,workspace:r,onClose:i}=e,{_:a}=an(),o=typeof window<`u`?window.okDesktop:void 0;if(!o)return null;let s=o.platform,c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=sY(s),t[0]=c):c=t[0];let l=c,u,d;t[1]!==a||t[2]!==r?(u=r?null:a({id:`wTcjov`}),d=a(s===`darwin`?u?{id:`FvpFSZ`,values:{hint:u}}:{id:`LtSYdi`}:s===`win32`?u?{id:`o4dcAf`,values:{hint:u}}:{id:`qi1F96`}:u?{id:`zUhPuR`,values:{hint:u}}:{id:`e1Rn_k`}),t[1]=a,t[2]=r,t[3]=u,t[4]=d):(u=t[3],d=t[4]);let f=d,p=!r,m;t[5]!==n||t[6]!==i||t[7]!==r?(m=()=>{if(!r)return;i();let e=aa(r.contentDir,Au(n),r.pathSeparator);o.shell.showItemInFolder(e)},t[5]=n,t[6]=i,t[7]=r,t[8]=m):m=t[8];let h,g;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,Z.jsx)(Bo,{"aria-hidden":`true`}),g=(0,Z.jsx)(`span`,{className:`flex-1`,children:l}),t[9]=h,t[10]=g):(h=t[9],g=t[10]);let _;t[11]===u?_=t[12]:(_=u?(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:u}):null,t[11]=u,t[12]=_);let v;return t[13]!==f||t[14]!==p||t[15]!==m||t[16]!==_?(v=(0,Z.jsxs)(Sc,{disabled:p,onSelect:m,"aria-label":f,children:[h,g,_]}),t[13]=f,t[14]=p,t[15]=m,t[16]=_,t[17]=v):v=t[17],v}function lY(e,t){return Ou({kind:e.endsWith(`/`)?`directory`:`file`,name:e,path:e},t)}function uY(e){let t=e.match(/\.(md|mdx)$/i);if(!t)return null;let n=t[0].toLowerCase()===`.md`?`.mdx`:`.md`;return`${e.slice(0,-t[0].length)}${n}`}function dY(e,t){let n=uY(e);return n?t.includes(n):!1}function fY(e,t){return e!==t&&e.startsWith(t)}function pY(e,t){let n=[...new Set(e)],r=n.filter(e=>e.endsWith(`/`));return n.filter(e=>!r.some(t=>fY(e,t))).map(e=>lY(e,t))}function mY(e,t){let n=e.getItem(t)??e.getItem(Wu(t));return n?.isDirectory()?Wu(Qu(n.getPath())):t}function hY(e){let t=e.getFocusedPath()??e.getSelectedPaths()[0]??null;return t?mY(e,t):null}function gY(e,t,n){let r=hY(e);return!r||n.has(r)?null:lY(r,t)}function _Y(e,t){let n=e.getSelectedPaths(),r=hY(e);return pY(n.length>0?n.map(t=>mY(e,t)):r?[r]:[],t)}function vY(e,t){return e===t||e.startsWith(`${t}/`)}function yY(e){if(!(e instanceof HTMLElement))return!1;let t=e.tagName;return t===`INPUT`||t===`TEXTAREA`||t===`SELECT`||e.isContentEditable||e.closest(`[contenteditable="true"]`)!==null}function bY(e,t,n){let r=new Set,i=new Set,a=new Set;for(let o of e){if(o.kind===`file`){r.add(o.path);continue}if(o.kind===`asset`){a.add(o.path);continue}i.add(o.path);for(let e of t)ul(e)&&e.docName.startsWith(`${o.path}/`)?r.add(e.docName):il(e)&&e.path.startsWith(`${o.path}/`)&&a.add(e.path);for(let e of n){let t=Qu(e);vY(t,o.path)&&i.add(t)}}return{docNames:r,folderPaths:i,assetPaths:a}}function xY(e,t){return e.kind===`file`?t.kind===`file`&&e.path===t.createdPath:e.kind===`asset`?!1:vY(t.createdPath,e.path)}function SY(e){let t=(0,$.c)(71),{item:n,context:r,anyActionBusy:i,workspace:a,handoff:o,model:s,okignoreBinding:c,projectLocalBinding:l,mergedConfig:u,onStartCreating:d,onCreateFromTemplate:f,onDuplicate:p,onDelete:m,onExpandSubtree:h,onCollapseSubtree:g,folderTreePaths:_,isAsset:v,documents:y}=e,{_:b}=an(),x=Ou(n,y),S=n.kind===`directory`,C=x.kind===`asset`?null:x,w=C!==null&&c!==null,T;t[0]!==b||t[1]!==S?(T=b(S?{id:`5D3Ior`}:{id:`dbhUX1`}),t[0]=b,t[1]=S,t[2]=T):T=t[2];let E=T,D=u?.appearance?.sidebar?.showHiddenFiles??!1,O=l!==null,k;t[3]!==S||t[4]!==n.path?(k=S?Qu(n.path):null,t[3]=S,t[4]=n.path,t[5]=k):k=t[5];let A=_o(k),j=A.state.status===`ready`?(A.state.data.folder.templates_available?.length??0)>0:!0,M=s.getSelectedPaths(),N=M.includes(x.treePath)?pY(M,y):[],P=N.length>1?N:[x],F=P.length,I=Yc._({id:`djjdjr`,values:{deleteCount:F}}),L;t[6]!==y||t[7]!==v||t[8]!==S||t[9]!==n||t[10]!==a?(L=v?null:S?la({folderRelativePath:Au(n),workspace:a}):Ta({docName:Zu(n.path,y),workspace:a}),t[6]=y,t[7]=v,t[8]=S,t[9]=n,t[10]=a,t[11]=L):L=t[11];let R=L,z;t[12]===r?z=t[13]:(z=()=>r.close({restoreFocus:!1}),t[12]=r,t[13]=z);let B=z,V;t[14]===r?V=t[15]:(V=()=>r.close(),t[14]=r,t[15]=V);let H=V,{status:U}=Pi(),W=U?.hasRemote===!0,G;t[16]!==y||t[17]!==v||t[18]!==S||t[19]!==n.path||t[20]!==x?(G=v||x.kind===`asset`?null:S?Na(Qu(n.path)):Va(Zu(n.path,y)),t[16]=y,t[17]=v,t[18]=S,t[19]=n.path,t[20]=x,t[21]=G):G=t[21];let K=G,ee=W&&K!==null,te;t[22]!==b||t[23]!==W||t[24]!==K?(te=()=>{K&&Ia({...K,hasRemote:W,onClickWhenNoRemote:()=>{bs.error(b({id:`WyQxwa`}))}},{clipboardWrite:xa,toastSuccess:TY,toastError:wY,logEvent:CY})},t[22]=b,t[23]=W,t[24]=K,t[25]=te):te=t[25];let ne=te,re;t[26]!==ee||t[27]!==H||t[28]!==ne?(re=ee?(0,Z.jsxs)(Sc,{"data-testid":`file-tree-menu-share`,onSelect:()=>{H(),ne()},children:[(0,Z.jsx)(Cf,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`Z8lGw6`})]}):null,t[26]=ee,t[27]=H,t[28]=ne,t[29]=re):re=t[29];let ie=re,ae;t[30]!==b||t[31]!==l?(ae=e=>{if(l===null)return;let t=l.patch({appearance:{sidebar:{showHiddenFiles:e}}});t.ok||(console.warn(`[FileTree] showHiddenFiles toggle rejected:`,Bn(t.error)),bs.error(b({id:`P47EWZ`}),{description:Bn(t.error)}))},t[30]=b,t[31]=l,t[32]=ae):ae=t[32];let oe=ae,se=0,ce=0;if(S){let e=Wu(n.path);for(let t of _)(t===e||t.startsWith(e))&&(se++,nJ(s.getItem(t))?.isExpanded()&&ce++)}let le=S&&ce<se,q=S&&ce>0,ue;t[33]===H?ue=t[34]:(ue=e=>{e||H()},t[33]=H,t[34]=ue);let de;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(de=(0,Z.jsx)(bc,{asChild:!0,children:(0,Z.jsx)(`span`,{"aria-hidden":`true`,"data-file-tree-context-menu-root":`true`,className:`block size-px`})}),t[35]=de):de=t[35];let fe;t[36]!==b||t[37]!==i||t[38]!==w||t[39]!==O||t[40]!==H||t[41]!==B||t[42]!==I||t[43]!==P||t[44]!==j||t[45]!==oe||t[46]!==o||t[47]!==R||t[48]!==E||t[49]!==v||t[50]!==S||t[51]!==n||t[52]!==s||t[53]!==c||t[54]!==C||t[55]!==g||t[56]!==f||t[57]!==m||t[58]!==p||t[59]!==h||t[60]!==d||t[61]!==ie||t[62]!==D||t[63]!==q||t[64]!==le||t[65]!==x||t[66]!==a?(fe=(0,Z.jsx)(wc,{sideOffset:0,align:`start`,"data-file-tree-context-menu-root":`true`,className:`min-w-52`,children:S?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(Sc,{disabled:i,onSelect:()=>{B(),d(`file`,Qu(n.path))},children:[(0,Z.jsx)(Df,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`HdkSiO`})]}),j?(0,Z.jsxs)(yc,{children:[(0,Z.jsxs)(Pc,{disabled:i,children:[(0,Z.jsx)(no,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`Uuj_R4`})]}),(0,Z.jsx)(sc,{children:(0,Z.jsx)(tJ,{parentDir:Qu(n.path),onSelectTemplate:e=>{B(),f(Qu(n.path),e)},ItemComponent:Sc})})]}):null,(0,Z.jsxs)(Sc,{disabled:i,onSelect:()=>{B(),d(`folder`,Qu(n.path))},children:[(0,Z.jsx)(Ud,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`96G6Re`})]}),(0,Z.jsx)(Fc,{}),(0,Z.jsx)(cY,{item:n,workspace:a,onClose:H}),(0,Z.jsx)(ua,{input:R,installStates:o.installStates,isElectronHost:o.isElectronHost,dispatch:o.dispatch}),ie,(0,Z.jsxs)(yc,{children:[(0,Z.jsxs)(Pc,{children:[(0,Z.jsx)(Eo,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`oCZkaG`})]}),(0,Z.jsxs)(sc,{children:[(0,Z.jsx)(Sc,{disabled:!a,onSelect:()=>{a&&(H(),UJ(aa(a.contentDir,Au(n),a.pathSeparator),`full`))},children:(0,Z.jsx)(J,{id:`oQA-cA`})}),(0,Z.jsx)(Sc,{onSelect:()=>{H(),UJ(Au(n),`relative`)},children:(0,Z.jsx)(J,{id:`s061i4`})})]})]}),(0,Z.jsx)(Fc,{}),(0,Z.jsx)(Oc,{checked:D,onCheckedChange:oe,disabled:!O,"data-testid":`file-tree-menu-show-hidden-files`,children:(0,Z.jsx)(J,{id:`XcGbim`})}),le||q?(0,Z.jsx)(Fc,{}):null,le?(0,Z.jsxs)(Sc,{onSelect:()=>{H(),h(n.path)},children:[(0,Z.jsx)(Vf,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`OlAl5i`})]}):null,q?(0,Z.jsxs)(Sc,{onSelect:()=>{H(),g(n.path)},children:[(0,Z.jsx)(Vd,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`qvWGzP`})]}):null,(0,Z.jsx)(Fc,{}),(0,Z.jsxs)(Sc,{disabled:i,onSelect:()=>{x.kind!==`asset`&&(H(),p(x))},children:[(0,Z.jsx)(Oo,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`euc6Ns`})]}),(0,Z.jsxs)(Sc,{disabled:i,onSelect:()=>{B(),s.startRenaming(n.path)},children:[(0,Z.jsx)(Mo,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`2wxgft`})]}),(0,Z.jsxs)(Sc,{"data-testid":`file-tree-menu-hide`,disabled:!w,onSelect:()=>{if(!c||!C)return;H();let e=Dq(C),t=lo(c.current()),n=bo(t,e);if(n===t)return;c.patch(Za(n));let r=C.path.split(`/`).pop()||C.path;bs.success(b({id:`4xtLTl`,values:{basename:r}}),{description:b({id:`nWv1ja`}),duration:5e3})},children:[(0,Z.jsx)(Oe,{"aria-hidden":`true`}),E]}),(0,Z.jsxs)(Sc,{variant:`destructive`,disabled:i,onSelect:()=>{H(),m(P)},children:[(0,Z.jsx)(Ao,{"aria-hidden":`true`}),I]})]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(cY,{item:n,workspace:a,onClose:H}),!v&&(0,Z.jsx)(ua,{input:R,installStates:o.installStates,isElectronHost:o.isElectronHost,dispatch:o.dispatch}),ie,(0,Z.jsxs)(yc,{children:[(0,Z.jsxs)(Pc,{children:[(0,Z.jsx)(Eo,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`oCZkaG`})]}),(0,Z.jsxs)(sc,{children:[(0,Z.jsx)(Sc,{disabled:!a,onSelect:()=>{a&&(H(),UJ(aa(a.contentDir,Au(n),a.pathSeparator),`full`))},children:(0,Z.jsx)(J,{id:`oQA-cA`})}),(0,Z.jsx)(Sc,{onSelect:()=>{H(),UJ(Au(n),`relative`)},children:(0,Z.jsx)(J,{id:`s061i4`})})]})]}),(0,Z.jsx)(Fc,{}),v?null:(0,Z.jsxs)(Sc,{disabled:i,onSelect:()=>{H(),p(x)},children:[(0,Z.jsx)(Oo,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`euc6Ns`})]}),(0,Z.jsxs)(Sc,{disabled:i,onSelect:()=>{B(),s.startRenaming(n.path)},children:[(0,Z.jsx)(Mo,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`2wxgft`})]}),C?(0,Z.jsxs)(Sc,{"data-testid":`file-tree-menu-hide`,disabled:!w,onSelect:()=>{if(!c)return;H();let e=Dq(C),t=lo(c.current()),n=bo(t,e);if(n===t)return;c.patch(Za(n));let r=C.path.split(`/`).pop()||C.path;bs.success(b({id:`OD0FCX`,values:{basename:r}}),{description:b({id:`nWv1ja`}),duration:5e3})},children:[(0,Z.jsx)(Oe,{"aria-hidden":`true`}),E]}):null,(0,Z.jsxs)(Sc,{variant:`destructive`,disabled:i,onSelect:()=>{H(),m(P)},children:[(0,Z.jsx)(Ao,{"aria-hidden":`true`}),I]})]})}),t[36]=b,t[37]=i,t[38]=w,t[39]=O,t[40]=H,t[41]=B,t[42]=I,t[43]=P,t[44]=j,t[45]=oe,t[46]=o,t[47]=R,t[48]=E,t[49]=v,t[50]=S,t[51]=n,t[52]=s,t[53]=c,t[54]=C,t[55]=g,t[56]=f,t[57]=m,t[58]=p,t[59]=h,t[60]=d,t[61]=ie,t[62]=D,t[63]=q,t[64]=le,t[65]=x,t[66]=a,t[67]=fe):fe=t[67];let pe;return t[68]!==ue||t[69]!==fe?(pe=(0,Z.jsxs)(Ac,{open:!0,modal:!1,onOpenChange:ue,children:[de,fe]}),t[68]=ue,t[69]=fe,t[70]=pe):pe=t[70],pe}function CY(e){return console.log(e)}function wY(e){return bs.error(e)}function TY(e){return bs.success(e)}async function EY(e,t,n,r){try{let i=await fetch(`/api/documents?showAll=true&dir=${encodeURIComponent(e)}&depth=1`,{signal:t,headers:hJ});if(gJ(i)){let e=await yJ(i);return{kind:`entries`,entries:sl(e.entries),truncated:e.truncated}}let a=await Ct(i,n);if(!a.ok)return{kind:`http-error`,title:a.title};let o=Un.safeParse(a.body);return o.success?{kind:`entries`,entries:sl(o.data.documents),truncated:o.data.truncated===!0}:{kind:`http-error`,title:r}}catch(e){return e instanceof _J?{kind:`http-error`,title:e.message}:{kind:`network-error`,cause:e}}}function DY(e){let t=(0,$.c)(360),{ref:n,onContentHeightChange:r}=e,{_:i,i18n:a}=an(),{activeDocName:o,activeTarget:s,closeTabs:c,closeDocument:l,closeAndClearForRename:u,getPoolActiveDocName:d,poolHas:f,isNewTabActive:p,openTarget:m,prewarm:g,remapTabsForRename:_}=vt(),{notifySidebarFileSelected:v}=Vj(),{resolvedTheme:y}=Ln(),{addPage:b,pageMeta:x}=ea(),S;t[0]===x?S=t[1]:(S=function(e,t){return rl(e,t??x.get(e)?.size)??{kind:`doc`,target:e,docName:e}},t[0]=x,t[1]=S);let C=S,w;t[2]!==b||t[3]!==C||t[4]!==v||t[5]!==m?(w=function(e,t,n){n?.registerPage&&b(e),m(C(e,t),{tabBehavior:`replace-active`}),Sl(kl(e)),v()},t[2]=b,t[3]=C,t[4]=v,t[5]=m,t[6]=w):w=t[6];let T=w,E;t[7]!==v||t[8]!==m?(E=function(e){let t=xl(e);m({kind:`folder`,target:e,folderPath:e},{tabBehavior:`replace-active`}),Sl(t),v()},t[7]=v,t[8]=m,t[9]=E):E=t[9];let D=E,O;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(O=[],t[10]=O):O=t[10];let[k,A]=(0,Q.useState)(O),[j,M]=(0,Q.useState)(!0),[N,P]=(0,Q.useState)(null),[F,I]=(0,Q.useState)(!1),L=EN(),R=(0,Q.useRef)(null),[z,B]=(0,Q.useState)(null),[V,H]=(0,Q.useState)(null),[U,W]=(0,Q.useState)(null),[G,K]=(0,Q.useState)(null),{conflicts:ee}=Ua(),[te,ne]=(0,Q.useState)(null),[re,ie]=(0,Q.useState)(null),[ae,oe]=(0,Q.useState)(!1),se=(0,Q.useRef)(ae),ce;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(ce=new Set,t[11]=ce):ce=t[11];let q=(0,Q.useRef)(ce),ue=(0,Q.useRef)(k),de=(0,Q.useRef)(x),fe=(0,Q.useRef)(null),pe;t[12]!==k||t[13]!==D||t[14]!==T||t[15]!==v||t[16]!==m?(pe=function(e,t){let n=t===void 0?k:t,r=Hq(e,n);if(r.kind===`none`){console.debug(`[FileTree] Dropped selection for unknown docName:`,Xu(e));return}if(r.kind===`asset`){m({kind:`asset`,target:r.path,assetPath:r.path,mediaKind:r.mediaKind},{tabBehavior:`replace-active`}),Sl(r.hash),v();return}if(r.kind===`folder`){D(r.path);return}let i=n.find(e=>ul(e)&&e.docName===r.path);T(r.path,i?.size,{registerPage:Xc(r.path)})},t[12]=k,t[13]=D,t[14]=T,t[15]=v,t[16]=m,t[17]=pe):pe=t[17];let me=pe,he;t[18]!==v||t[19]!==m?(he=function(e,t){m({kind:`asset`,target:e,assetPath:e,mediaKind:(t??ue.current).find(t=>il(t)&&t.path===e)?.mediaKind??null},{tabBehavior:`replace-active`}),Sl(Dl(e)),v()},t[18]=v,t[19]=m,t[20]=he):he=t[20];let ge=he,_e=(0,Q.useRef)(o),ve;t[21]===k?ve=t[22]:(ve=new Set(k.filter(il).map(eX)),t[21]=k,t[22]=ve);let ye=ve,be=(0,Q.useRef)(ye),xe;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(xe=[],t[23]=xe):xe=t[23];let Se=(0,Q.useRef)(xe),Ce=(0,Q.useRef)(null),we=(0,Q.useRef)($Y),Te=(0,Q.useRef)(null),Ee=(0,Q.useRef)(null),De=(0,Q.useRef)(!1),Oe=(0,Q.useRef)(!1),ke=(0,Q.useRef)(null),Ae;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(Ae={row:null,root:null},t[24]=Ae):Ae=t[24];let je=(0,Q.useRef)(Ae),Me=(0,Q.useRef)(QY),Ne=(0,Q.useRef)(null),Pe=(0,Q.useRef)(null),Fe;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(Fe=new Map,t[25]=Fe):Fe=t[25];let Ie=(0,Q.useRef)(Fe),Le;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(Le=new Set,t[26]=Le):Le=t[26];let Re=(0,Q.useRef)(Le),ze;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(ze=new Map,t[27]=ze):ze=t[27];let Be=(0,Q.useRef)(ze),Ve=(0,Q.useRef)(0),He;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(He=new Set,t[28]=He):He=t[28];let Ue=(0,Q.useRef)(He),We=(0,Q.useRef)(ZY),Ge=(0,Q.useRef)(XY),Ke=(0,Q.useRef)(!1),qe=(0,Q.useRef)(null),Je=(0,Q.useRef)(null),Ye=(0,Q.useRef)(YY),Xe=(0,Q.useRef)(JY),Ze=(0,Q.useRef)(qY),Qe=(0,Q.useRef)(KY),$e=(0,Q.useRef)(s),[et,tt]=(0,Q.useState)(!1),nt;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(nt=function(){R.current!==null&&(clearTimeout(R.current),R.current=null)},t[29]=nt):nt=t[29];let rt=nt,it;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(it=function(){rt(),I(!1)},t[30]=it):it=t[30];let at=it,st;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(st=function(e){at(),P(e)},t[31]=st):st=t[31];let ct=st,lt;t[32]===i?lt=t[33]:(lt=function(){if(rt(),SN()){P(null),I(!0),R.current=setTimeout(()=>{R.current=null,qe.current?.()},nY);return}I(!1),P(i({id:`34qyH5`}))},t[32]=i,t[33]=lt);let ut=lt,dt=(0,Q.useRef)(!0),ft;t[34]===Symbol.for(`react.memo_cache_sentinel`)?(ft=()=>{if(dt.current){dt.current=!1;return}qe.current?.()},t[34]=ft):ft=t[34];let pt;t[35]===L?pt=t[36]:(pt=[L],t[35]=L,t[36]=pt),(0,Q.useEffect)(ft,pt);let mt,ht;t[37]===Symbol.for(`react.memo_cache_sentinel`)?(mt=()=>rt,ht=[],t[37]=mt,t[38]=ht):(mt=t[37],ht=t[38]),(0,Q.useEffect)(mt,ht);let gt,_t;t[39]!==k.length||t[40]!==j?(gt=()=>{if(j||k.length===0)return;let e=Je.current?.querySelector($L)?.shadowRoot;if(!e)return;let t=e,n=function(){ke.current!==null&&clearTimeout(ke.current),ke.current=setTimeout(()=>{Oe.current=!1,ke.current=null},0)},r=function(e){if(!(e instanceof DragEvent))return;let t=nX(e),n=t?.dataset.itemPath;if(!n)return;let r=qq(t.dataset.itemType===`folder`?Wu(n):n,ue.current,de.current);r&&(ke.current!==null&&(clearTimeout(ke.current),ke.current=null),Oe.current=!0,e.dataTransfer?.setData(Tu,Cu(r)))},i=function(e){if(!(e instanceof DragEvent)||!Vu(e))return;let t=iX(e);if(!t){VJ(je);return}e.preventDefault(),e.stopPropagation(),e.dataTransfer&&(e.dataTransfer.dropEffect=`copy`),HJ(je,t)},a=function(e){if(!(e instanceof DragEvent)||!Vu(e))return;let n=e.relatedTarget;n instanceof Node&&t.contains(n)||VJ(je)},o=function(e){if(!(e instanceof DragEvent)||!Vu(e))return;let t=iX(e),n=Fu(e);if(!t||n.length===0){VJ(je);return}e.preventDefault(),e.stopPropagation(),VJ(je),Me.current(n,t.parentDir,t.busyPath)};return e.addEventListener(`dragstart`,r,{capture:!0}),e.addEventListener(`dragover`,i,{capture:!0}),e.addEventListener(`dragleave`,a,{capture:!0}),e.addEventListener(`drop`,o,{capture:!0}),e.addEventListener(`dragend`,n,{capture:!0}),window.addEventListener(`drop`,n,!0),window.addEventListener(`dragend`,n,!0),()=>{e.removeEventListener(`dragstart`,r,{capture:!0}),e.removeEventListener(`dragover`,i,{capture:!0}),e.removeEventListener(`dragleave`,a,{capture:!0}),e.removeEventListener(`drop`,o,{capture:!0}),e.removeEventListener(`dragend`,n,{capture:!0}),window.removeEventListener(`drop`,n,!0),window.removeEventListener(`dragend`,n,!0),VJ(je),ke.current!==null&&(clearTimeout(ke.current),ke.current=null),Oe.current=!1}},_t=[k.length,j],t[39]=k.length,t[40]=j,t[41]=gt,t[42]=_t):(gt=t[41],_t=t[42]),(0,Q.useEffect)(gt,_t);let{selectedFilePath:yt,selectedFolderPath:bt,navigationPath:xt}=Vq(s,p?null:o),St=yt?Ku(yt,k.find(e=>ul(e)&&e.docName===yt)?.docExt):bt?Wu(bt):s?.kind===`asset`?s.assetPath:null,wt=ae?null:St,Tt=va().states,{dispatch:Et}=Ea(),Dt;t[43]!==Et||t[44]!==Tt?(Dt={installStates:Tt,isElectronHost:typeof window<`u`&&window.okDesktop!=null,dispatch:Et},t[43]=Et,t[44]=Tt,t[45]=Dt):Dt=t[45];let Ot=Dt,{okignoreBinding:kt,projectLocalBinding:At,merged:jt}=zo(),Mt=jt?.appearance?.sidebar?.showHiddenFiles??!1,Nt;t[46]===Symbol.for(`react.memo_cache_sentinel`)?(Nt=()=>Ne.current===null,t[46]=Nt):Nt=t[46];let Pt=Nt,Ft;t[47]===Symbol.for(`react.memo_cache_sentinel`)?(Ft=[],t[47]=Ft):Ft=t[47];let Lt;t[48]===Symbol.for(`react.memo_cache_sentinel`)?(Lt={set:`complete`,spriteSheet:ZJ,byFileExtension:{md:{name:qJ,viewBox:Jt},mdx:{name:qJ,viewBox:Jt}}},t[48]=Lt):Lt=t[48];let Rt;t[49]===Symbol.for(`react.memo_cache_sentinel`)?(Rt={contextMenu:{enabled:!0,triggerMode:`both`,buttonVisibility:`when-needed`}},t[49]=Rt):Rt=t[49];let zt;t[50]===Symbol.for(`react.memo_cache_sentinel`)?(zt={canDrag:Pt,canDrop:Pt,onDropComplete:e=>Qe.current(e),onDropError:GY},t[50]=zt):zt=t[50];let Bt,Vt;t[51]===Symbol.for(`react.memo_cache_sentinel`)?(Bt={canRename:Pt,onRename:e=>Xe.current(e),onError:e=>Ze.current(e)},Vt=e=>Ye.current(e),t[51]=Bt,t[52]=Vt):(Bt=t[51],Vt=t[52]);let Ht;t[53]===i?Ht=t[54]:(Ht={paths:Ft,initialExpansion:`closed`,fileTreeSearchMode:`hide-non-matches`,initialVisibleRowCount:18,stickyFolders:!0,...sq,icons:Lt,unsafeCSS:aY,composition:Rt,dragAndDrop:zt,renaming:Bt,onSelectionChange:Vt,renderRowDecoration:e=>{let{item:t}=e;if(t.kind===`file`){let e=ue.current.find(e=>ul(e)&&Ku(e.docName,e.docExt)===t.path);if(e?.isSymlink){let t=e.targetPath;return{icon:GJ,title:i(t?{id:`JE21eh`,values:{targetPath:t}}:{id:`BQu9Pg`})}}return oY(t.path)?{icon:KJ,title:i({id:`i9toLO`})}:null}let n=ue.current.find(e=>tl(e)&&Wu(e.path)===Wu(t.path));if(n?.isSymlink){let e=n.targetPath;return{icon:GJ,title:i(e?{id:`JE21eh`,values:{targetPath:e}}:{id:`BQu9Pg`})}}return null}},t[53]=i,t[54]=Ht);let{model:Ut}=oq(Ht),Wt;t[55]===Ut?Wt=t[56]:(Wt=function(e){let t=Ut.getItem(e)??Ut.getItem(Wu(e));return t?.isDirectory()?Wu(Qu(t.getPath())):e},t[55]=Ut,t[56]=Wt);let Gt=Wt,Kt,qt;t[57]===k?(Kt=t[58],qt=t[59]):(qt=Nu(k),Kt=wu(qt),t[57]=k,t[58]=Kt,t[59]=qt);let Yt=Kt,Xt=(0,Q.useRef)(qt),Zt;t[60]===k?Zt=t[61]:(Zt=Hu(k),t[60]=k,t[61]=Zt);let Qt=Zt,$t=(0,Q.useRef)(Qt),en=bt?Gu(Wu(bt)).slice(0,-1):Gu(wt??xt),tn=en.join(`\0`),nn;t[62]===Ut?nn=t[63]:(nn=()=>{let e=new Set;for(let t of $t.current)nJ(Ut.getItem(t))?.isExpanded()&&e.add(t);return e},t[62]=Ut,t[63]=nn);let rn=nn,on;t[64]===rn?on=t[65]:(on=e=>{let t=new Set(Hu(e??ue.current)),n=rn();for(let e of Se.current)n.add(e);return[...n].filter(e=>t.has(e))},t[64]=rn,t[65]=on);let sn=on,cn;t[66]!==sn||t[67]!==Ut?(cn=e=>{let t=Nu(e??ue.current);Ut.resetPaths(t,{initialExpandedPaths:sn(e)})},t[66]=sn,t[67]=Ut,t[68]=cn):cn=t[68];let ln=cn,un;t[69]!==i||t[70]!==ut?(un=async function(e){let t=Ve.current,n=new AbortController;Be.current.set(e,n);let r=await EY(Qu(e),n.signal,i({id:`8RtNI0`}),i({id:`HlmZBk`}));if(Be.current.get(e)===n&&Be.current.delete(e),n.signal.aborted||t!==Ve.current)return;if(r.kind===`network-error`){ut(),console.warn(`[FileTree] lazy folder children fetch failed:`,e,r.cause);return}if(r.kind===`http-error`){console.warn(`[FileTree] lazy folder children http error:`,e,r.title),ct(r.title);return}let a=Ke.current,o=el(r.entries,a);Re.current.add(e),A(t=>SJ(t,e,o,Ie.current)),P(null),at(),r.truncated&&B(r.entries.length)},t[69]=i,t[70]=ut,t[71]=un):un=t[71];let dn=un,fn;t[72]!==rn||t[73]!==dn?(fn=()=>{let e=rn(),t=Ue.current;Ue.current=e;for(let n of e){if(t.has(n)||Re.current.has(n)||Be.current.has(n))continue;let e=Qu(n);ue.current.find(t=>tl(t)&&t.path===e)?.hasChildren!==!1&&dn(n)}},t[72]=rn,t[73]=dn,t[74]=fn):fn=t[74];let pn=fn,mn;t[75]!==rn||t[76]!==dn?(mn=()=>{for(let e of rn())Re.current.has(e)||Be.current.has(e)||dn(e)},t[75]=rn,t[76]=dn,t[77]=mn):mn=t[77];let hn=mn,gn;t[78]!==Ut||t[79]!==ln?(gn=(e,t,n,r)=>{let i=r===void 0?[]:r,a=0,o=null;for(let{fromDocName:r,toDocName:i}of n){let n=e.find(e=>ul(e)&&e.docName===r);if(n==null||Ut.getItem(i)==null)continue;let s=Ku(i,t.find(e=>ul(e)&&e.docName===i)?.docExt??n.docExt);Ut.move(i,s),o=s,a+=1}for(let{toPath:e}of i){let t=Qc(e);if(t===``)continue;let n=e.slice(0,-t.length);Ut.getItem(n)!=null&&(Ut.getItem(e)??Ut.move(n,e),o=e,a+=1)}a!==0&&(ln(t),o!=null&&Ut.focusPath(o))},t[78]=Ut,t[79]=ln,t[80]=gn):gn=t[80];let _n=gn,vn;t[81]===Symbol.for(`react.memo_cache_sentinel`)?(vn=e=>{Te.current=Bu(e)},t[81]=vn):vn=t[81];let yn=vn,bn;t[82]===Symbol.for(`react.memo_cache_sentinel`)?(bn=e=>be.current.has(e),t[82]=bn):bn=t[82];let xn=bn,Sn;t[83]!==i||t[84]!==b||t[85]!==D||t[86]!==T||t[87]!==ln?(Sn=async function(e){if(e.kind===`asset`||Ne.current!==null)return;let t=()=>{H(null),Ne.current=null};Ne.current=e.path,H(e.path),P(null);try{let n=await Ct(await fetch(`/api/duplicate-path`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({kind:e.kind,path:e.path})}),i({id:`dw_dUJ`}));if(!n.ok){bs.error(n.title),ln(),t();return}let r=It(sr,n.body,`duplicate-path`,null);if(r===null){let e=i({id:`67f-3g`});bs.error(e),P(e),pl([`files`,`backlinks`,`graph`]),ln(),t();return}for(let e of r.duplicatedDocNames)b(e);A(t=>{let n=QN(t,e,r);return ln(n),yn(n),n}),pl([`files`,`backlinks`,`graph`]),r.path!==e.path&&(r.kind===`folder`?D(r.path):T(r.path)),bs.success(r.kind===`folder`?i({id:`iilQXA`}):i({id:`A6h5b-`}),{description:r.path}),t()}catch(e){let n=e,r=n instanceof Error?n.message:String(n);console.warn(`[FileTree] duplicate failed:`,n),bs.error(i({id:`EBVbtP`}),{description:r}),ln(),t()}},t[83]=i,t[84]=b,t[85]=D,t[86]=T,t[87]=ln,t[88]=Sn):Sn=t[88];let Cn=Sn,wn=(0,Q.useRef)(Cn),Tn;t[89]===Cn?Tn=t[90]:(Tn=()=>{wn.current=Cn},t[89]=Cn,t[90]=Tn),(0,Q.useEffect)(Tn);let En=function(e){let t=RJ(e);if(!t||zJ(t))return!1;let n=Ut.getFocusedPath()??Ut.getSelectedPaths()[0]??null;if(!n||n.endsWith(`/`)||xn(n))return!1;let r=zJ(n);if(!r)return!1;let i=Wu(t);if(!$t.current.includes(i))return!1;let a=`${t}${r}`;return Xt.current.includes(a)?!1:(lr({sourcePath:n,destinationPath:a,isFolder:!1}),Ut.move(n,a),!0)},Dn;t[91]===Symbol.for(`react.memo_cache_sentinel`)?(Dn=e=>{let t=e??Ce.current;!t||Ce.current!==t||(t.disposeCommitListener(),Ce.current=null)},t[91]=Dn):Dn=t[91];let On=Dn,kn;t[92]!==i||t[93]!==On||t[94]!==l||t[95]!==c||t[96]!==ln?(kn=async function(e,t){let n=t===void 0?{}:t,r=n.updateUi??!0,a=n.restoreLocation??r;On(e),r&&H(e.renamePath);try{let t=await fetch(`/api/delete-path`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({kind:e.kind,path:e.createdPath})});if(!t.ok&&t.status!==404){let n=e.kind,a=e.createdPath,o=await Ct(t,i({id:`EcM3k7`,values:{kind:n}}));if(o.ok)return;let s=o.title,c=i({id:`YPFBfr`,values:{detail:s,kind:n,createdPath:a}});r?bs.error(c):console.warn(`[FileTree] cleanup pending create failed: ${c}`),r&&(H(null),ln());return}}catch(t){if(console.warn(`[FileTree] cleanup pending create failed:`,t),r){let t=e.kind,n=e.createdPath;bs.error(i({id:`_TDESN`,values:{kind:t,createdPath:n}}))}r&&(H(null),ln());return}r&&(e.kind===`file`?l(e.createdPath):c([h(e.createdPath)],{force:!0})),r&&A(t=>{let n=XN(t,e.kind===`file`?[e.createdPath]:[],e.kind===`folder`?e.createdPath:void 0);return yn(n),n}),pl([`files`,`backlinks`,`graph`]),a&&(window.location.hash=e.previousHash),r&&H(null)},t[92]=i,t[93]=On,t[94]=l,t[95]=c,t[96]=ln,t[97]=kn):kn=t[97];let An=kn,jn,Mn;t[98]===Symbol.for(`react.memo_cache_sentinel`)?(jn=()=>()=>{let e=Ce.current;e&&we.current(e,{restoreLocation:!1,updateUi:!1}).catch(WY)},Mn=[],t[98]=jn,t[99]=Mn):(jn=t[98],Mn=t[99]),(0,Q.useEffect)(jn,Mn);let Nn;t[100]!==i||t[101]!==ut?(Nn=()=>{let e=!0,t=null,n=mJ(async function(){t?.abort();let n=new AbortController;t=n,Ve.current+=1;for(let e of Be.current.values())e.abort();Be.current.clear(),Re.current.clear();try{let t=await fetch(`/api/documents?showAll=true&dir=&depth=1`,{signal:n.signal,headers:hJ});if(gJ(t)){let r=Ke.current,i=!1,{entries:a,truncated:o}=await yJ(t,{onBatch:t=>{if(!e||n.signal.aborted)return;let a=el(sl(t),r);a.length!==0&&(A(e=>xJ(e,a)),i||(i=!0,P(null),at(),M(!1)))}});if(!e)return;let s=el(sl(a),r);A(e=>SJ(e,``,s,Ie.current)),P(null),at(),B(o?a.length:null),Ge.current()}else{let n=await Ct(t,i({id:`8RtNI0`}));if(!e)return;if(!n.ok)ct(n.title),B(null);else{let e=Un.safeParse(n.body);if(!e.success)ct(i({id:`HlmZBk`})),B(null);else{let t=Ke.current,n=el(sl(e.data.documents),t);A(e=>SJ(e,``,n,Ie.current)),P(null),at(),B(e.data.truncated===!0?e.data.documents.length:null),Ge.current()}}}}catch(t){let r=t;if(n.signal.aborted)return;e&&(r instanceof _J?ct(r.message):ut()),console.warn(`[FileTree] fetch failed:`,r)}e&&M(!1)},()=>t?.abort());qe.current=()=>n.request(),n.request();let r=()=>{document.visibilityState===`visible`&&n.request()};window.addEventListener(`focus`,r),window.addEventListener(`visibilitychange`,r);let a=ml(e=>{e.includes(`files`)&&n.request()});return()=>{e=!1,qe.current=null,n.dispose();for(let e of Be.current.values())e.abort();Be.current.clear(),window.removeEventListener(`focus`,r),window.removeEventListener(`visibilitychange`,r),a()}},t[100]=i,t[101]=ut,t[102]=Nn):Nn=t[102];let Pn;t[103]===i?Pn=t[104]:(Pn=[i],t[103]=i,t[104]=Pn),(0,Q.useEffect)(Nn,Pn);let Fn=(0,Q.useRef)(!0),In;t[105]===Symbol.for(`react.memo_cache_sentinel`)?(In=()=>{if(Fn.current){Fn.current=!1;return}qe.current?.()},t[105]=In):In=t[105];let Rn;t[106]===Mt?Rn=t[107]:(Rn=[Mt],t[106]=Mt,t[107]=Rn),(0,Q.useEffect)(In,Rn);let zn,Bn;t[108]===Symbol.for(`react.memo_cache_sentinel`)?(zn=()=>{let e=!0;return fetch(`/api/workspace`).then(async t=>{let n=await t.json();if(!e||!t.ok)return;let r=It(ar,n,`workspace`,null);r&&ie({contentDir:r.contentDir,pathSeparator:r.pathSeparator})}).catch(UY),()=>{e=!1}},Bn=[],t[108]=zn,t[109]=Bn):(zn=t[108],Bn=t[109]),(0,Q.useEffect)(zn,Bn);let Vn;t[110]!==sn||t[111]!==Ut||t[112]!==Yt?(Vn=()=>{if(Te.current===Yt){Te.current=null;return}Ut.resetPaths(Xt.current,{initialExpandedPaths:sn()})},t[110]=sn,t[111]=Ut,t[112]=Yt,t[113]=Vn):Vn=t[113];let Hn;t[114]!==Ut||t[115]!==Yt?(Hn=[Ut,Yt],t[114]=Ut,t[115]=Yt,t[116]=Hn):Hn=t[116],(0,Q.useEffect)(Vn,Hn),iJ(Ut,wt,tn,De,Yt);let Wn,Gn;t[117]!==Ut||t[118]!==r?(Wn=()=>{if(!r)return;let e=0,t=0,n=()=>Je.current?.querySelector(`file-tree-container`)?.shadowRoot?.querySelector(`[data-file-tree-virtualized-list]`)??null,i=()=>{let e=n();if(!e)return;let t=Number.parseFloat(e.style.height);Number.isFinite(t)&&r(t)},a=()=>{cancelAnimationFrame(e),e=requestAnimationFrame(i)},o=new MutationObserver(i),s=()=>{let e=n();e?(o.observe(e,{attributes:!0,attributeFilter:[`style`]}),i()):t=requestAnimationFrame(s)};s();let c=Ut.subscribe(a);return window.addEventListener(`resize`,a),()=>{cancelAnimationFrame(e),cancelAnimationFrame(t),o.disconnect(),c(),window.removeEventListener(`resize`,a)}},Gn=[r,Ut],t[117]=Ut,t[118]=r,t[119]=Wn,t[120]=Gn):(Wn=t[119],Gn=t[120]),(0,Q.useEffect)(Wn,Gn);let Kn;t[121]===Symbol.for(`react.memo_cache_sentinel`)?(Kn=()=>{oe(!1)},t[121]=Kn):Kn=t[121];let qn;t[122]===St?qn=t[123]:(qn=[St],t[122]=St,t[123]=qn),(0,Q.useEffect)(Kn,qn);let Jn,Yn;t[124]===ae?(Jn=t[125],Yn=t[126]):(Jn=()=>{se.current=ae;for(let e of q.current)e()},Yn=[ae],t[124]=ae,t[125]=Jn,t[126]=Yn),(0,Q.useEffect)(Jn,Yn);let Xn;t[127]!==wt||t[128]!==j||t[129]!==Ut?(Xn=()=>{j||!wt||zq(Ut)},t[127]=wt,t[128]=j,t[129]=Ut,t[130]=Xn):Xn=t[130];let Zn;t[131]!==tn||t[132]!==wt||t[133]!==j||t[134]!==Ut||t[135]!==Yt?(Zn=[wt,tn,Yt,j,Ut],t[131]=tn,t[132]=wt,t[133]=j,t[134]=Ut,t[135]=Yt,t[136]=Zn):Zn=t[136],(0,Q.useEffect)(Xn,Zn);let Qn,$n;t[137]===Ut?(Qn=t[138],$n=t[139]):(Qn=()=>Ut.subscribe(()=>{if(!Ut.isSearchOpen())for(let e of Se.current){let t=nJ(Ut.getItem(e));t&&!t.isExpanded()&&t.expand()}}),$n=[Ut],t[137]=Ut,t[138]=Qn,t[139]=$n),(0,Q.useEffect)(Qn,$n);let er,tr;t[140]===Ut?(er=t[141],tr=t[142]):(er=()=>Ut.subscribe(()=>We.current()),tr=[Ut],t[140]=Ut,t[141]=er,t[142]=tr),(0,Q.useEffect)(er,tr);let nr,rr;t[143]===Ut?(nr=t[144],rr=t[145]):(nr=()=>Ut.onMutation(`remove`,e=>{let t=Ce.current;!t||e.path!==t.renamePath||we.current(t)}),rr=[Ut],t[143]=Ut,t[144]=nr,t[145]=rr),(0,Q.useEffect)(nr,rr);let ir;t[146]!==b||t[147]!==u||t[148]!==d||t[149]!==ge||t[150]!==D||t[151]!==T||t[152]!==f||t[153]!==_n||t[154]!==_?(ir=async(e,t,n,r,i)=>{let a=t===void 0?[]:t,o=n===void 0?[]:n,s=i===void 0?[]:i,c=r?.docName??_e.current,l=new Map,p=new Map;for(let e of ue.current){if(ul(e)){let t=o.find(t=>t.fromPath===Ku(e.docName,e.docExt))?.toPath;t&&l.set(e.docName,t);continue}if(il(e)){let t=o.find(t=>t.fromPath===e.path)?.toPath;t&&Xc(t)&&p.set(e.path,Mu(t))}}let m=c?l.get(c)??null:null,h=r?.folderPath??($e.current?.kind===`folder`?$e.current.folderPath:null),g=h?le(h,a):null,v=r?.assetPath??($e.current?.kind===`asset`?$e.current.assetPath:null),y=v?p.get(v)??null:null,x=m?null:y??$N(c,e),S=m??(v?y?null:o.find(e=>e.fromPath===v)?.toPath??le(v,a):null);ot(e);let C=[...eP(e,d(),f),...l.keys()];await Promise.all(C.map(e=>u(e)));for(let t of e)b(t.toDocName);for(let e of p.values())b(e);_(e,a,o);let w=null;A(t=>{let n=YN(t,e,a,o,s);return w=n,_n(t,n,e,o),yn(n),n}),h&&g&&g!==h?D(g):x&&x!==c?(T(x),BJ(x)):S&&(m||S!==v)&&ge(S,w??ue.current),pl([`files`,`backlinks`,`graph`])},t[146]=b,t[147]=u,t[148]=d,t[149]=ge,t[150]=D,t[151]=T,t[152]=f,t[153]=_n,t[154]=_,t[155]=ir):ir=t[155];let or=ir;async function lr(e){let t=!e.isFolder&&xn(e.sourcePath),n=t?e.sourcePath:Lu(e.sourcePath,e.isFolder);H(n),P(null);try{let r=Zc(e.sourcePath,e.destinationPath,e.isFolder),a=!e.isFolder&&!t&&!Xc(r.destinationPath),o=t||a?r.destinationPath:Lu(r.destinationPath,e.isFolder),s=e.isFolder?{kind:`folder`,fromPath:Qu(n),toPath:Qu(o)}:t||a?{kind:`asset`,fromPath:n,toPath:o}:{kind:`file`,fromPath:Zu(n,ue.current),toPath:o},c={docName:_e.current,folderPath:$e.current?.kind===`folder`?$e.current.folderPath:null,assetPath:$e.current?.kind===`asset`?$e.current.assetPath:null},l=await Ct(await fetch(`/api/rename-path`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(s)}),i({id:`gijbne`}));if(!l.ok){bs.error(l.title),ln();let e=Ce.current;e&&e.renamePath===n?await An(e):On(),H(null);return}let u=It(Hr,l.body,`rename-path`,{renamed:[],renamedAssets:[]});try{await or(u.renamed,e.isFolder?[{fromPath:Qu(n),toPath:Qu(o)}]:[],u.renamedAssets,c,!e.isFolder&&!t&&!a?u.renamed.flatMap(e=>{let t=Qc(o);return t?[{toDocName:e.toDocName,docExt:t}]:[]}):[])}catch(e){console.warn(`[FileTree] post-rename reconciliation failed`,{err:e,sourceTreePath:n,destinationTreePath:o,renamedCount:u.renamed.length,renamedAssetCount:u.renamedAssets.length}),bs.error(i({id:`dDpCOp`}))}On(),H(null)}catch(e){console.warn(`[FileTree] rename failed:`,e);let t=i({id:`HIb0vl`});bs.error(t),P(t),ln();let r=Ce.current;r&&r.renamePath===n?await An(r):On(),H(null)}}let ur;t[156]!==i||t[157]!==or||t[158]!==ln?(ur=async function(e){let t=e.draggedPaths.map(t=>{let n=Ru(t,e.target);return t===n?null:{sourcePath:t,destinationTreePath:n}}).filter(HY);if(t.length!==0){H(t[0]?.sourcePath??null),P(null);try{let e=[],n=[],r=[],a={docName:_e.current,folderPath:$e.current?.kind===`folder`?$e.current.folderPath:null,assetPath:$e.current?.kind===`asset`?$e.current.assetPath:null};for(let a of t){let t=a.sourcePath.endsWith(`/`),o=!t&&xn(a.sourcePath),s=o?null:Zu(a.sourcePath,ue.current),c=t?{kind:`folder`,fromPath:Qu(a.sourcePath),toPath:Qu(a.destinationTreePath)}:o?{kind:`asset`,fromPath:a.sourcePath,toPath:a.destinationTreePath}:{kind:`file`,fromPath:s??Mu(a.sourcePath),toPath:s&&Xc(s)?a.destinationTreePath:Mu(a.destinationTreePath)},l=await Ct(await fetch(`/api/rename-path`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(c)}),i({id:`dOHMA0`}));if(!l.ok){bs.error(l.title),ln(),H(null);return}let u=It(Hr,l.body,`rename-path:drop`,{renamed:[],renamedAssets:[]});e=e.concat(u.renamed),n=n.concat(u.renamedAssets),t&&r.push({fromPath:Qu(a.sourcePath),toPath:Qu(a.destinationTreePath)})}try{await or(e,r,n,a)}catch(r){console.warn(`[FileTree] post-move reconciliation failed`,{err:r,operationCount:t.length,renamedCount:e.length,renamedAssetCount:n.length}),bs.error(i({id:`8OxKZy`}))}H(null)}catch(e){console.warn(`[FileTree] move failed:`,e),bs.error(i({id:`HIb0vl`})),ln(),H(null)}}},t[156]=i,t[157]=or,t[158]=ln,t[159]=ur):ur=t[159];let fr=ur,pr;t[160]!==i||t[161]!==b||t[162]!==ln?(pr=async function(e,t,n){if(e.length===0||Ne.current!==null)return;let r=()=>{Ne.current=null,H(null)};Ne.current=n,H(n),P(null);let a=[],o=0,s=0;for(let n of e){let e=new FormData;e.append(`file`,n),qu(e,t,n.name||`upload`);try{let r=await Ct(await fetch(`/api/upload`,{method:`POST`,body:e}),i({id:`4Gz2wC`}));if(!r.ok){s+=1,bs.error(r.title,{description:n.name});continue}let c=It(zr,r.body,`upload:drop`,null);if(c===null){s+=1,bs.error(i({id:`4Gz2wC`}),{description:n.name});continue}let l=ku(t,c);if(c.deduped===!0){s+=1,bs.error(i({id:`4sKwf6`}),{description:l});continue}o+=1;let u=Ju(l,n);u&&a.push(u)}catch(e){let t=e;s+=1,console.warn(`[FileTree] external file upload failed:`,t),bs.error(t instanceof TypeError?i({id:`HIb0vl`}):i({id:`4Gz2wC`}),{description:n.name})}}try{if(a.length>0){for(let e of a)ul(e)&&b(e.docName);A(e=>{let t=new Set(e.map(Pu)),n=!1,r=[...e];for(let e of a){let i=Pu(e);Ie.current.set(i,Date.now()),!t.has(i)&&(t.add(i),r.push(e),n=!0)}return n?(ln(r),yn(r),r):e})}o>0&&(pl([`files`,`backlinks`,`graph`]),qe.current?.(),bs.success(Yc._({id:`v75Em9`,values:{uploadedCount:o}}),{description:t||i({id:`RSqaSd`})})),s>0&&P(o>0?Yc._({id:`yH7T4q`,values:{failedCount:s}}):i({id:`4Gz2wC`})),r()}catch(e){let t=e,n=i({id:`VcqWBy`});console.warn(`[FileTree] upload post-upload reconciliation failed:`,t),bs.error(n),P(n),r()}},t[160]=i,t[161]=b,t[162]=ln,t[163]=pr):pr=t[163];let mr=pr,hr;t[164]===Symbol.for(`react.memo_cache_sentinel`)?(hr=function(e){ne({parentDir:e})},t[164]=hr):hr=t[164];let gr=hr,_r;t[165]!==i||t[166]!==b||t[167]!==An||t[168]!==On||t[169]!==Ut||t[170]!==D||t[171]!==T||t[172]!==ln||t[173]!==qt?(_r=async function(e,t,n){if(Ne.current)return;let r=Ce.current;r&&On(r);try{let r=Uu(e,t,[...qt,...$t.current]);H(r.renamePath),Ne.current=r.renamePath;let a=window.location.hash,o;if(e===`file`){let e=ju(`file`,r.addPath),t={path:e};n?.template&&(t.template=n.template);let a=await Ct(await fetch(`/api/create-page`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)}),i({id:`fJgQHX`}));if(!a.ok){bs.error(a.title),H(null),Ne.current=null;return}let s=Mu(e),c=It(dr,a.body,`create-page`,{docName:s}).docName;o=c;let l={kind:`document`,docName:c,docExt:e.toLowerCase().endsWith(`.mdx`)?`.mdx`:`.md`,modified:new Date().toISOString(),size:0};b(c),A(e=>{if(e.some(e=>ul(e)&&e.docName===c))return e;let t=[...e,l];return yn(t),Ie.current.set(Pu(l),Date.now()),t}),pl([`files`,`backlinks`,`graph`]),T(c)}else{let e=Qu(r.addPath),t=await Ct(await fetch(`/api/create-folder`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({path:e})}),i({id:`K1ckLX`}));if(!t.ok){bs.error(t.title),H(null),Ne.current=null;return}o=It(hi,t.body,`create-folder`,{path:e}).path;let n={kind:`folder`,path:o,modified:new Date().toISOString(),size:0};A(e=>{if(e.some(e=>tl(e)&&e.path===o))return e;let t=[...e,n];return yn(t),Ie.current.set(Pu(n),Date.now()),t}),pl([`files`]),D(o)}let s=!1,c=e=>{if(e.key!==`Enter`)return;let t=Ce.current;!t||t.renamePath!==r.renamePath||queueMicrotask(()=>On(t))};document.addEventListener(`keydown`,c,!0),Ce.current={kind:e,renamePath:r.renamePath,createdPath:o,previousHash:a,disposeCommitListener:()=>{s||(s=!0,document.removeEventListener(`keydown`,c,!0))}},H(null),Ne.current=null,Ut.add(r.addPath),Ut.startRenaming(r.renamePath,{removeIfCanceled:!0})}catch(e){console.warn(`[FileTree] create placeholder failed:`,e),bs.error(i({id:`S6l5dv`}));let t=Ce.current;t?await An(t):On(),H(null),Ne.current=null,ln()}},t[165]=i,t[166]=b,t[167]=An,t[168]=On,t[169]=Ut,t[170]=D,t[171]=T,t[172]=ln,t[173]=qt,t[174]=_r):_r=t[174];let yr=_r,br;t[175]===Ut?br=t[176]:(br=function(e){let t=Wu(e);(0,Q.startTransition)(()=>{for(let e of $t.current)if(e===t||e.startsWith(t)){let t=nJ(Ut.getItem(e));t&&t.expand()}})},t[175]=Ut,t[176]=br);let xr=br,Sr;t[177]===Ut?Sr=t[178]:(Sr=function(e){let t=Wu(e),n=new Set(Se.current);(0,Q.startTransition)(()=>{for(let e of[...$t.current].reverse())if((e===t||e.startsWith(t))&&!n.has(e)){let t=nJ(Ut.getItem(e));t&&t.collapse()}})},t[177]=Ut,t[178]=Sr);let Cr=Sr,wr;t[179]===Symbol.for(`react.memo_cache_sentinel`)?(wr=function(){return((Je.current?.querySelector(`file-tree-container`)?.shadowRoot)?.querySelector(`[aria-selected="true"][data-item-path]`))?.dataset.itemPath??null},t[179]=wr):wr=t[179];let Tr=wr,Er;t[180]!==me||t[181]!==en||t[182]!==o||t[183]!==s||t[184]!==ye||t[185]!==V||t[186]!==An||t[187]!==pn||t[188]!==k||t[189]!==Qt||t[190]!==fr||t[191]!==lr||t[192]!==Gt||t[193]!==x||t[194]!==En||t[195]!==hn||t[196]!==Mt||t[197]!==qt||t[198]!==mr?(Er=()=>{ue.current=k,de.current=x,_e.current=o,$e.current=s,be.current=ye,Ne.current=V,Ke.current=Mt,Xt.current=qt,$t.current=Qt,Se.current=en,We.current=pn,Ge.current=hn,we.current=An,Me.current=(e,t,n)=>{mr(e,t,n)},Ye.current=e=>{if(De.current||Oe.current||e.length!==1)return;let t=e[0];if(t){oe(!1);let e=Gt(t),n=fe.current,r=n!==null&&Mu(n)===Mu(e),i=r?n:e;fe.current=null,queueMicrotask(()=>{me(Gt((r?null:Tr())??i),ue.current)})}},Ze.current=e=>{En(e)||bs.error(e)},Xe.current=lr,Qe.current=fr},t[180]=me,t[181]=en,t[182]=o,t[183]=s,t[184]=ye,t[185]=V,t[186]=An,t[187]=pn,t[188]=k,t[189]=Qt,t[190]=fr,t[191]=lr,t[192]=Gt,t[193]=x,t[194]=En,t[195]=hn,t[196]=Mt,t[197]=qt,t[198]=mr,t[199]=Er):Er=t[199],(0,Q.useLayoutEffect)(Er);let Dr,Or;t[200]===Ut?(Dr=t[201],Or=t[202]):(Dr=()=>{let e=e=>{let t=(e.metaKey||e.ctrlKey)&&!e.altKey,n=e.key.toLowerCase(),r=t&&n===`a`,i=t&&!e.shiftKey&&n===`d`,a=t&&!e.shiftKey&&n===`c`,o=t&&!e.shiftKey&&n===`v`,s=!e.altKey&&!e.shiftKey&&(e.metaKey&&!e.ctrlKey&&n===`backspace`||!e.metaKey&&!e.ctrlKey&&n===`delete`);if(!r&&!i&&!a&&!o&&!s||yY(e.target))return;let c=Je.current,l=e.target,u=document.activeElement,d=l instanceof Node&&c?.contains(l),f=u instanceof Node&&c?.contains(u);if(!d&&!f)return;if(a){let t=gY(Ut,ue.current,be.current);if(!t)return;Pe.current=t,e.preventDefault(),e.stopPropagation();return}if(o){let t=Pe.current;if(!t)return;wn.current(t),e.preventDefault(),e.stopPropagation();return}if(i){let t=gY(Ut,ue.current,be.current);if(!t)return;wn.current(t),e.preventDefault(),e.stopPropagation();return}if(s){if(Ne.current!==null)return;let t=_Y(Ut,ue.current);if(t.length===0)return;W({targets:t}),e.preventDefault(),e.stopPropagation();return}let p=new Set([...$t.current,...Xt.current]);De.current=!0;for(let e of p)e&&Ut.getItem(e)?.select();queueMicrotask(()=>{De.current=!1}),e.preventDefault(),e.stopPropagation()};return document.addEventListener(`keydown`,e,!0),()=>document.removeEventListener(`keydown`,e,!0)},Or=[Ut],t[200]=Ut,t[201]=Dr,t[202]=Or),(0,Q.useEffect)(Dr,Or);let kr,Ar;t[203]!==k.length||t[204]!==j?(kr=()=>{if(j||k.length===0)return;let e=Je.current?.querySelector($L)?.shadowRoot;if(!e)return;let t=VY,n=()=>{for(let n of e.querySelectorAll(`[data-item-path]`)){let e=n.dataset.itemPath;if(!e)continue;let r=t(e);n.title!==r&&(n.title=r)}let n=e.querySelector(`[data-type="context-menu-anchor"]`);if(n){let r=e.querySelector(`[data-item-context-hover="true"][data-item-path]`)?.dataset.itemPath,i=r?t(r):``;n.title!==i&&(n.title=i)}};n();let r=new MutationObserver(n);return r.observe(e,{subtree:!0,childList:!0,attributes:!0,attributeFilter:[`data-item-path`,`data-item-context-hover`]}),()=>r.disconnect()},Ar=[j,k.length],t[203]=k.length,t[204]=j,t[205]=kr,t[206]=Ar):(kr=t[205],Ar=t[206]),(0,Q.useEffect)(kr,Ar);let jr,Mr;t[207]!==k.length||t[208]!==j?(jr=()=>{if(j||k.length===0)return;let e=Je.current?.querySelector($L)?.shadowRoot;if(!e)return;let t=()=>gq(e);t();let n=new MutationObserver(t);return n.observe(e,{subtree:!0,childList:!0,characterData:!0,attributes:!0,attributeFilter:[`data-item-path`]}),()=>n.disconnect()},Mr=[j,k.length],t[207]=k.length,t[208]=j,t[209]=jr,t[210]=Mr):(jr=t[209],Mr=t[210]),(0,Q.useEffect)(jr,Mr);let Nr,Pr;t[211]!==k.length||t[212]!==j?(Nr=()=>{if(j||k.length===0)return;let e=Je.current?.querySelector($L)?.shadowRoot;if(!e)return;let t=()=>Pq(e);t();let n=new MutationObserver(t);return n.observe(e,{subtree:!0,childList:!0,attributes:!0,attributeFilter:[`data-item-path`]}),()=>n.disconnect()},Pr=[j,k.length],t[211]=k.length,t[212]=j,t[213]=Nr,t[214]=Pr):(Nr=t[213],Pr=t[214]),(0,Q.useEffect)(Nr,Pr);let Fr;t[215]===Symbol.for(`react.memo_cache_sentinel`)?(Fr={folderCount:0,expandedCount:0},t[215]=Fr):Fr=t[215];let Ir=(0,Q.useRef)(Fr),Lr=(0,Q.useRef)(yr),Rr=(0,Q.useRef)(gr),Br;t[216]===yr?Br=t[217]:(Br=()=>{Lr.current=yr,Rr.current=gr},t[216]=yr,t[217]=Br),(0,Q.useEffect)(Br);let Vr,Ur;t[218]===Ut?(Vr=t[219],Ur=t[220]):(Vr=()=>({startCreating(e,t){Lr.current(e,t)},startCreatingFromTemplate(e){Rr.current(e)},createFromTemplate(e,t){Lr.current(`file`,e,{template:t})},expandAll(){(0,Q.startTransition)(()=>{for(let e of $t.current){let t=nJ(Ut.getItem(e));t&&t.expand()}})},collapseAll(){let e=new Set(Se.current);(0,Q.startTransition)(()=>{for(let t of[...$t.current].reverse()){if(e.has(t))continue;let n=nJ(Ut.getItem(t));n&&n.collapse()}})},getFolderState(){let e=$t.current,t=0;for(let n of e)nJ(Ut.getItem(n))?.isExpanded()&&t++;let n=e.length,r=Ir.current;if(r.folderCount===n&&r.expandedCount===t)return r;let i={folderCount:n,expandedCount:t};return Ir.current=i,i},isCreationTargetCleared(){return se.current},clearCreationTarget(){oe(!0)},subscribe(e){q.current.add(e);let t=Ut.subscribe(e);return()=>{q.current.delete(e),t()}}}),Ur=[Ut],t[218]=Ut,t[219]=Vr,t[220]=Ur),(0,Q.useImperativeHandle)(n,Vr,Ur);let Wr;t[221]!==On||t[222]!==u||t[223]!==c||t[224]!==Ut?(Wr=async function(e,t,n){let r=bY(e,ue.current,$t.current),i=Ce.current;i&&e.some(e=>xY(e,i))&&(i.kind===`file`?r.docNames.add(i.createdPath):r.folderPaths.add(i.createdPath),On(i));let a=new Set([...r.docNames,...t]),o=new Set([...r.folderPaths,...n]),s=new Set([...r.assetPaths,...e.filter(BY).map(zY)]);c([...[...a].map(RY),...[...o].map(LY),...[...s].map(IY)],{force:!0}),await Promise.all([...a].map(e=>u(e)));for(let t of e){let e=t.kind===`folder`?Wu(t.path):t.kind===`asset`?t.path:Ku(t.path,t.docExt);Ut.getItem(e)&&Ut.remove(e,t.kind===`folder`?{recursive:!0}:void 0)}A(e=>{let t=XN(e,[...a],void 0,[...s]);for(let e of o)t=XN(t,[],e);return yn(t),t}),pl([`files`,`backlinks`,`graph`])},t[221]=On,t[222]=u,t[223]=c,t[224]=Ut,t[225]=Wr):Wr=t[225];let Gr=Wr,Kr;t[226]!==i||t[227]!==Gr?(Kr=async function(e){let t=[],n=[],r=[];for(let a of e){let e=a.kind;H(a.path);let o=await Ct(await fetch(`/api/delete-path`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({kind:e,path:a.path})}),i({id:`7JtSLi`}));if(!o.ok)return r.length>0&&await Gr(r,t,n),bs.error(o.title),!1;let s=It(fi,o.body,`delete-path`,{deletedDocNames:[]});t.push(...s.deletedDocNames),e===`folder`&&n.push(a.path),r.push(a)}return await Gr(r,t,n),!0},t[226]=i,t[227]=Gr,t[228]=Kr):Kr=t[228];let qr=Kr,Jr;t[229]===Symbol.for(`react.memo_cache_sentinel`)?(Jr=async function(e,t,n){let r=[],i=[];for(let a of e){H(a.path);let e=tP(a,n),o=await t.shell.trashItem(e);o.ok?r.push(a):i.push({kind:a.kind,path:a.path,name:a.name,reason:Yq(o.reason),detail:o.detail})}return{trashed:r,failed:i}},t[229]=Jr):Jr=t[229];let Yr=Jr,Xr;t[230]===i?Xr=t[231]:(Xr=async function(e){let t=[],n=[],r=[];for(let a of e){let e=a.kind;try{let o=await Ct(await fetch(`/api/trash/cleanup`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({kind:e,path:a.path})}),i({id:`DVh_Tb`}));if(!o.ok){console.warn(`[FileTree] trash-cleanup failed`,{target:`${a.kind}:${a.path}`,reason:o.title}),r.push({target:a,reason:o.title});continue}let s=It(cr,o.body,`trash-cleanup`,{deletedDocNames:[]});t.push(...s.deletedDocNames),e===`folder`&&n.push(a.path)}catch(e){let t=e;console.warn(`[FileTree] trash-cleanup threw`,{target:`${a.kind}:${a.path}`,err:t}),r.push({target:a,reason:i({id:`r4R7AZ`})})}}if(r.length>0){let e=r.length;bs.error(i({id:`IrB5AK`,values:{failedCount:e}}),{description:i({id:`vEJDlt`})})}return r.length===e.length&&e.length>0?null:{deletedDocNames:t,deletedFolderPaths:n}},t[230]=i,t[231]=Xr);let Zr=Xr,Qr;t[232]!==i||t[233]!==ee||t[234]!==Gr||t[235]!==qr||t[236]!==Zr||t[237]!==ln||t[238]!==re?(Qr=async function(e){let t=e.map(e=>ZN(e,ue.current)),n=t[0];if(!n)return;let r=ee.filter(e=>t.some(t=>{if(t.kind===`file`){let n=`${t.path}${t.docExt??`.md`}`;return e.file===n}return t.kind===`folder`?e.file.startsWith(`${t.path}/`):!1}));if(r.length>0){let e=r.slice(0,3).map(FY),t=r.length>e.length?`, +${r.length-e.length} more`:``;bs.error(`Cannot delete files with unresolved conflicts`,{description:`Resolve the conflict on ${e.join(`, `)}${t} before deleting.`});return}H(n.path),W(null);let a=typeof window<`u`?window.okDesktop:void 0;try{if(a&&re){let{trashed:e,failed:n}=await Yr(t,a,re);if(e.length>0){let t=await Zr(e);t?await Gr(e,t.deletedDocNames,t.deletedFolderPaths):await Gr(e,e.filter(PY).map(NY),e.filter(MY).map(jY))}n.length>0&&K({failed:n,originalTargets:[...t]}),H(null)}else{let e=await qr(t);H(null),e||ln()}}catch(e){let t=e,n=t instanceof Error?t.message:String(t);console.warn(`[FileTree] delete failed:`,t),bs.error(i({id:`0eHrMb`}),{description:n}),H(null),ln()}},t[232]=i,t[233]=ee,t[234]=Gr,t[235]=qr,t[236]=Zr,t[237]=ln,t[238]=re,t[239]=Qr):Qr=t[239];let $r=Qr,ei;t[240]!==i||t[241]!==qr||t[242]!==ln||t[243]!==G?(ei=async function(){if(!G)return;let e=new Set(G.failed.map(AY)),t=G.originalTargets.filter(t=>e.has(`${t.kind}:${t.path}`));if(K(null),t.length!==0){H(t[0]?.path??null);try{let e=await qr(t);H(null),e||ln()}catch(e){let t=e,n=t instanceof Error?t.message:String(t);console.warn(`[FileTree] hard-delete fallback failed:`,t),bs.error(i({id:`0eHrMb`}),{description:n}),H(null),ln()}}},t[240]=i,t[241]=qr,t[242]=ln,t[243]=G,t[244]=ei):ei=t[244];let ti=ei,ni;t[245]!==$r||t[246]!==G?(ni=async function(){if(!G)return;let e=new Set(G.failed.map(kY)),t=G.originalTargets.filter(t=>e.has(`${t.kind}:${t.path}`));K(null),await $r(t)},t[245]=$r,t[246]=G,t[247]=ni):ni=t[247];let ri=ni,ii=(0,Q.useRef)($r),ai;t[248]===$r?ai=t[249]:(ai=()=>{ii.current=$r},t[248]=$r,t[249]=ai),(0,Q.useEffect)(ai);let oi,si;t[250]===Symbol.for(`react.memo_cache_sentinel`)?(oi=()=>lJ(e=>{if(e.kind===`doc`||e.kind===`folder-index`){let t=e.docName,n=ue.current.find(e=>ul(e)&&e.docName===t);ii.current([{kind:`file`,path:t,name:t.split(`/`).pop()??t,docExt:n?.docExt}]);return}if(e.kind===`folder`){ii.current([{kind:`folder`,path:e.folderPath,name:e.folderPath.split(`/`).pop()??e.folderPath}]);return}if(e.kind===`asset`){ii.current([{kind:`asset`,path:e.assetPath,name:e.assetPath.split(`/`).pop()??e.assetPath}]);return}console.warn(JSON.stringify({event:`file-tree-menu-action-delete-unsupported-kind`,kind:e.kind}))}),si=[],t[250]=oi,t[251]=si):(oi=t[250],si=t[251]),(0,Q.useEffect)(oi,si);let ci,li;t[252]===Symbol.for(`react.memo_cache_sentinel`)?(ci=()=>pJ(e=>{if(e.kind===`doc`||e.kind===`folder-index`){let t=e.docName,n=ue.current.find(e=>ul(e)&&e.docName===t);wn.current({kind:`file`,path:t,name:t.split(`/`).pop()??t,docExt:n?.docExt});return}if(e.kind===`folder`){wn.current({kind:`folder`,path:e.folderPath,name:e.folderPath.split(`/`).pop()??e.folderPath});return}console.warn(JSON.stringify({event:`file-tree-menu-action-duplicate-unsupported-kind`,kind:e.kind}))}),li=[],t[252]=ci,t[253]=li):(ci=t[252],li=t[253]),(0,Q.useEffect)(ci,li);let ui,di;t[254]===Ut?(ui=t[255],di=t[256]):(ui=()=>dJ(e=>{if(e.kind===`doc`||e.kind===`folder-index`){let t=e.docName,n=Ku(t,ue.current.find(e=>ul(e)&&e.docName===t)?.docExt);Ut.startRenaming(n);return}if(e.kind===`folder`){Ut.startRenaming(e.folderPath);return}if(e.kind===`asset`){Ut.startRenaming(e.assetPath);return}console.warn(JSON.stringify({event:`file-tree-menu-action-rename-unsupported-kind`,kind:e.kind}))}),di=[Ut],t[254]=Ut,t[255]=ui,t[256]=di),(0,Q.useEffect)(ui,di);let pi;t[257]===Symbol.for(`react.memo_cache_sentinel`)?(pi=function(){let e=Ee.current;e&&IJ(e),Ee.current=null},t[257]=pi):pi=t[257];let mi=pi,gi;t[258]===Symbol.for(`react.memo_cache_sentinel`)?(gi=function(e){let t=uY(e);if(!t)return!1;let n=Je.current?.querySelector($L)?.shadowRoot;if(!n)return!1;for(let e of n.querySelectorAll(`[data-item-path]`))if(e.dataset.itemPath===t)return!0;return!1},t[258]=gi):gi=t[258];let _i=gi,vi;t[259]===g?vi=t[260]:(vi=function(e){let t=tX(e.nativeEvent);if(!t||t.endsWith(`/`)){mi();return}let n=ue.current.find(e=>Pu(e)===t);if(n&&il(n)){mi();return}let r=n&&ul(n)?n.docName:Zu(t,ue.current);if(n&&ul(n)&&vr(n.size)){mi();return}Ee.current!==r&&(mi(),Ee.current=r,FJ(r,e=>g(e)))},t[259]=g,t[260]=vi);let yi=vi,bi;t[261]!==me||t[262]!==Ut||t[263]!==D||t[264]!==T?(bi=function(e){if(e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;let t=nX(e.nativeEvent);if(!t){aX(e.nativeEvent)&&oe(!0);return}let n=t.getAttribute(`aria-selected`)===`true`,r=t.dataset.itemPath;if(!r)return;let i=t.dataset.itemType===`folder`?Wu(r):r;if(t.dataset.itemType===`folder`){let t=Qu(i),r=nJ(Ut.getItem(i));if(!n){e.preventDefault(),e.stopPropagation(),r&&!r.isExpanded()&&r.expand(),queueMicrotask(()=>D(t));return}if(Ut.getSelectedPaths().length!==1||window.location.hash===xl(t))return;e.preventDefault(),e.stopPropagation(),r&&!r.isExpanded()&&r.expand(),queueMicrotask(()=>D(t));return}if(!n){if(dY(i,Xt.current)||_i(i)){fe.current=i,setTimeout(()=>T(i,void 0,{registerPage:!0}),0);return}queueMicrotask(()=>me(i));return}let a=Zu(i,ue.current);Ut.getSelectedPaths().length===1&&window.location.hash!==kl(a)&&queueMicrotask(()=>me(i))},t[261]=me,t[262]=Ut,t[263]=D,t[264]=T,t[265]=bi):bi=t[265];let xi=bi,Si;t[266]===Symbol.for(`react.memo_cache_sentinel`)?(Si=function(e){Vu(e.nativeEvent)&&(e.preventDefault(),e.stopPropagation(),e.dataTransfer.dropEffect=`copy`,tt(!0))},t[266]=Si):Si=t[266];let Ci=Si,wi;t[267]===Symbol.for(`react.memo_cache_sentinel`)?(wi=function(e){let t=e.relatedTarget;t instanceof Node&&e.currentTarget.contains(t)||tt(!1)},t[267]=wi):wi=t[267];let Ti=wi,Ei;t[268]===mr?Ei=t[269]:(Ei=function(e){if(!Vu(e.nativeEvent))return;let t=Fu(e.nativeEvent);t.length!==0&&(e.preventDefault(),e.stopPropagation(),tt(!1),mr(t,``,tY))},t[268]=mr,t[269]=Ei);let Di=Ei;if(j){let e;return t[270]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(sX,{}),t[270]=e):e=t[270],e}let Oi;t[271]!==i||t[272]!==F||t[273]!==L?(Oi=F?i(L?{id:`H-vDm3`}:{id:`09Tv5j`}):null,t[271]=i,t[272]=F,t[273]=L,t[274]=Oi):Oi=t[274];let ki=Oi;if(k.length===0){if(ki!==null){let e;return t[275]===ki?e=t[276]:(e=(0,Z.jsx)(`div`,{className:`flex flex-1 items-center justify-center py-8`,children:(0,Z.jsx)(`span`,{role:`status`,className:`select-none text-sidebar-foreground/50 text-sm`,children:ki})}),t[275]=ki,t[276]=e),e}if(N){let e;return t[277]===N?e=t[278]:(e=(0,Z.jsx)(`div`,{className:`flex flex-1 items-center justify-center py-8`,children:(0,Z.jsx)(`span`,{role:`alert`,className:`select-none text-sidebar-foreground/50 text-sm`,children:N})}),t[277]=N,t[278]=e),e}let e;t[279]===i?e=t[280]:(e=i({id:`5ZB7XC`}),t[279]=i,t[280]=e);let n=et&&`bg-primary/5 ring-2 ring-primary/70 ring-inset`,r;t[281]===n?r=t[282]:(r=Y(`flex flex-1 flex-col items-center justify-center gap-3 rounded-md py-8`,n),t[281]=n,t[282]=r);let a;t[283]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Z.jsx)(`span`,{className:`select-none text-sidebar-foreground/30 text-sm`,children:(0,Z.jsx)(J,{id:`xiv-dW`})}),t[283]=a):a=t[283];let o;t[284]===yr?o=t[285]:(o=()=>yr(`file`,``),t[284]=yr,t[285]=o);let s;t[286]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Z.jsx)(J,{id:`6ibbCg`}),t[286]=s):s=t[286];let c;t[287]===o?c=t[288]:(c=(0,Z.jsx)(X,{variant:`link`,size:`sm`,className:`font-mono uppercase`,onClick:o,children:s}),t[287]=o,t[288]=c);let l;return t[289]!==Di||t[290]!==e||t[291]!==r||t[292]!==c?(l=(0,Z.jsxs)(`section`,{"aria-label":e,className:r,onDragOver:Ci,onDragLeave:Ti,onDrop:Di,children:[a,c]}),t[289]=Di,t[290]=e,t[291]=r,t[292]=c,t[293]=l):l=t[293],l}let Ai=V!==null,ji=U?.targets[0]??null,Mi=null;if(z!==null){let e;if(t[294]!==a.locale||t[295]!==z){let n=new Intl.NumberFormat(a.locale).format(z);e=Yc._({id:`LuoJWu`,values:{truncatedShownCount:z,formattedCount:n}}),t[294]=a.locale,t[295]=z,t[296]=e}else e=t[296];Mi=e}let Ni;t[297]!==N||t[298]!==ki||t[299]!==Mi?(Ni=(N||ki!==null||Mi!==null)&&(0,Z.jsxs)(Z.Fragment,{children:[ki===null?N&&(0,Z.jsx)(lX,{kind:`error`,children:N}):(0,Z.jsx)(lX,{kind:`reconnecting`,children:ki}),Mi!==null&&(0,Z.jsx)(lX,{kind:`info`,children:Mi})]}),t[297]=N,t[298]=ki,t[299]=Mi,t[300]=Ni):Ni=t[300];let Pi;t[301]===y?Pi=t[302]:(Pi=dq(y),t[301]=y,t[302]=Pi);let Fi=ae?``:void 0,Ii;t[303]===Fi?Ii=t[304]:(Ii={[iY]:Fi},t[303]=Fi,t[304]=Ii);let Li;t[305]!==Ai||t[306]!==ye||t[307]!==Cr||t[308]!==k||t[309]!==xr||t[310]!==Qt||t[311]!==Cn||t[312]!==Ot||t[313]!==jt||t[314]!==Ut||t[315]!==kt||t[316]!==At||t[317]!==yr||t[318]!==re?(Li=(e,t)=>(0,Z.jsx)(SY,{item:e,context:t,anyActionBusy:Ai,workspace:re,handoff:Ot,model:Ut,okignoreBinding:kt,projectLocalBinding:At,mergedConfig:jt,onStartCreating:yr,onCreateFromTemplate:(e,t)=>yr(`file`,e,{template:t}),onDuplicate:Cn,onDelete:e=>W({targets:e}),onExpandSubtree:xr,onCollapseSubtree:Cr,folderTreePaths:Qt,isAsset:ye.has(e.path),documents:k}),t[305]=Ai,t[306]=ye,t[307]=Cr,t[308]=k,t[309]=xr,t[310]=Qt,t[311]=Cn,t[312]=Ot,t[313]=jt,t[314]=Ut,t[315]=kt,t[316]=At,t[317]=yr,t[318]=re,t[319]=Li):Li=t[319];let Ri;t[320]!==xi||t[321]!==yi||t[322]!==Ut||t[323]!==Ni||t[324]!==Pi||t[325]!==Ii||t[326]!==Li?(Ri=(0,Z.jsx)(`div`,{ref:Je,className:`flex min-h-0 flex-1 flex-col`,children:(0,Z.jsx)(aq,{header:Ni,model:Ut,style:Pi,...Ii,onClickCapture:xi,onMouseMove:yi,onMouseLeave:mi,renderContextMenu:Li})}),t[320]=xi,t[321]=yi,t[322]=Ut,t[323]=Ni,t[324]=Pi,t[325]=Ii,t[326]=Li,t[327]=Ri):Ri=t[327];let zi=!!U,Bi;t[328]===V?Bi=t[329]:(Bi=e=>{!e&&!V&&W(null)},t[328]=V,t[329]=Bi);let Vi;t[330]!==i||t[331]!==V||t[332]!==U||t[333]!==$r||t[334]!==ji?(Vi=U&&ji&&(0,Z.jsx)(ba,{...(()=>{let e=Gq(typeof window<`u`&&window.okDesktop!=null?`electron`:`web`,U.targets);if(e)return{customTitle:e.title,customDescription:``,customDetail:e.detail,customConfirmLabel:e.confirmLabel,customConfirmLabelBusy:e.confirmLabelBusy,children:e.listedTargets?(0,Z.jsx)(`ul`,{className:`flex flex-col gap-1 font-mono text-foreground text-xs`,children:e.listedTargets.map(OY)}):null};let t=U.targets.length,n=ji.name;return{itemName:t===1?ji.kind===`folder`?`${ji.name}/`:ji.kind===`file`?`${ji.name}${ji.docExt??`.md`}`:ji.name:void 0,customTitle:t>1?i({id:`abiHje`}):void 0,customDescription:t>1?i({id:`WMIKXK`,values:{targetCount:t}}):ji.kind===`folder`?i({id:`a5W0q0`,values:{folderName:n}}):void 0}})(),isSubmitting:V!==null,onDelete:()=>$r(U.targets)}),t[330]=i,t[331]=V,t[332]=U,t[333]=$r,t[334]=ji,t[335]=Vi):Vi=t[335];let Hi;t[336]!==zi||t[337]!==Bi||t[338]!==Vi?(Hi=(0,Z.jsx)(Ws,{open:zi,onOpenChange:Bi,children:Vi}),t[336]=zi,t[337]=Bi,t[338]=Vi,t[339]=Hi):Hi=t[339];let Ui=!!G,Wi;t[340]===V?Wi=t[341]:(Wi=e=>{!e&&!V&&K(null)},t[340]=V,t[341]=Wi);let Gi;t[342]!==V||t[343]!==ti||t[344]!==ri||t[345]!==G?(Gi=G&&(0,Z.jsx)($q,{failedTargets:G.failed,isSubmitting:V!==null,onDeletePermanently:ti,onRetry:ri,onCancel:()=>K(null)}),t[342]=V,t[343]=ti,t[344]=ri,t[345]=G,t[346]=Gi):Gi=t[346];let Ki;t[347]!==Ui||t[348]!==Wi||t[349]!==Gi?(Ki=(0,Z.jsx)(Ws,{open:Ui,onOpenChange:Wi,children:Gi}),t[347]=Ui,t[348]=Wi,t[349]=Gi,t[350]=Ki):Ki=t[350];let qi=te!==null,Ji;t[351]===Symbol.for(`react.memo_cache_sentinel`)?(Ji=e=>{e||ne(null)},t[351]=Ji):Ji=t[351];let Yi=te?.parentDir??``,Xi;t[352]!==qi||t[353]!==Yi?(Xi=(0,Z.jsx)(_h,{open:qi,onOpenChange:Ji,kind:`file`,initialDir:Yi,defaultToTemplate:!0}),t[352]=qi,t[353]=Yi,t[354]=Xi):Xi=t[354];let Zi;return t[355]!==Ri||t[356]!==Hi||t[357]!==Ki||t[358]!==Xi?(Zi=(0,Z.jsxs)(Z.Fragment,{children:[Ri,Hi,Ki,Xi]}),t[355]=Ri,t[356]=Hi,t[357]=Ki,t[358]=Xi,t[359]=Zi):Zi=t[359],Zi}function OY(e){return(0,Z.jsx)(`li`,{"data-testid":`delete-target-row`,children:Kq(e)},`${e.kind}:${e.path}`)}function kY(e){return`${e.kind}:${e.path}`}function AY(e){return`${e.kind}:${e.path}`}function jY(e){return e.path}function MY(e){return e.kind===`folder`}function NY(e){return e.path}function PY(e){return e.kind===`file`}function FY(e){return e.file}function IY(e){return je(e)}function LY(e){return h(e)}function RY(e){return Zt(e)}function zY(e){return e.path}function BY(e){return e.kind===`asset`}function VY(e){return e.endsWith(`/`)?e.slice(0,-1):e}function HY(e){return!!e}function UY(e){console.warn(`[FileTree] /api/workspace fetch failed:`,e)}function WY(e){console.warn(`[FileTree] unmount cleanup failed:`,e)}function GY(e){bs.error(e)}function KY(){}function qY(e){return bs.error(e)}function JY(){}function YY(){}function XY(){}function ZY(){}function QY(){}async function $Y(){}function eX(e){return Pu(e)}function tX(e){return nX(e)?.dataset.itemPath??null}function nX(e){for(let t of e.composedPath())if(t instanceof HTMLElement&&t.dataset.itemPath)return t;return null}function rX(e){for(let t of e.composedPath())if(t instanceof HTMLElement&&t.matches(`[data-file-tree-virtualized-root]`))return t;return null}function iX(e){let t=nX(e);if(t){let e=t.dataset.itemPath;if(!e)return null;let n=t.dataset.itemType===`folder`,r=Iu(e,n);return{parentDir:r,row:t,root:null,busyPath:n?Wu(r):e}}return aX(e)?{parentDir:``,row:null,root:rX(e),busyPath:tY}:null}function aX(e){for(let t of e.composedPath())if(t instanceof HTMLElement&&t.matches(`[data-file-tree-virtualized-scroll]`))return!0;return!1}var oX=[`w-3/4`,`w-2/3`,`w-4/5`,`w-1/2`,`w-3/5`,`w-2/3`];function sX(){let e=(0,$.c)(5),{_:t}=an(),n;e[0]===t?n=e[1]:(n=t({id:`5Tk8Fb`}),e[0]=t,e[1]=n);let r;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=oX.map(cX),e[2]=r):r=e[2];let i;return e[3]===n?i=e[4]:(i=(0,Z.jsx)(`div`,{className:`flex flex-1 flex-col gap-1 px-2 py-2`,role:`status`,"aria-busy":`true`,"aria-label":n,children:r}),e[3]=n,e[4]=i),i}function cX(e,t){return(0,Z.jsxs)(`div`,{className:`flex h-6 items-center gap-2`,children:[(0,Z.jsx)(Ga,{className:`h-3 w-3 shrink-0 rounded-sm`}),(0,Z.jsx)(Ga,{className:`h-3 ${e}`})]},t)}function lX(e){let t=(0,$.c)(14),{kind:n,children:r}=e,i=n===`error`?ds:n===`reconnecting`?os:rs,a=n===`error`?`alert`:`status`,o=n===`error`?`text-destructive`:`text-muted-foreground`,s;t[0]===o?s=t[1]:(s=Y(`mx-2 mb-1 flex items-start gap-1.5 rounded-md bg-muted/50 px-2 py-1.5 text-xs leading-snug`,o),t[0]=o,t[1]=s);let c=n===`reconnecting`&&`animate-spin motion-reduce:animate-none`,l;t[2]===c?l=t[3]:(l=Y(`mt-0.5 size-3.5 shrink-0`,c),t[2]=c,t[3]=l);let u;t[4]!==i||t[5]!==l?(u=(0,Z.jsx)(i,{"aria-hidden":`true`,className:l}),t[4]=i,t[5]=l,t[6]=u):u=t[6];let d;t[7]===r?d=t[8]:(d=(0,Z.jsx)(`span`,{className:`min-w-0`,children:r}),t[7]=r,t[8]=d);let f;return t[9]!==a||t[10]!==s||t[11]!==u||t[12]!==d?(f=(0,Z.jsxs)(`span`,{role:a,className:s,children:[u,d]}),t[9]=a,t[10]=s,t[11]=u,t[12]=d,t[13]=f):f=t[13],f}function uX(e){return e?Yc._({id:`wTcjov`}):null}function dX(e){let t=(0,$.c)(23),{_:n}=an(),r=ga(),i=wa();if(r)return null;let{input:a,installStates:o,dispatch:s}=e,c=a===null,l,u,d,f,p,m;if(t[0]!==n||t[1]!==s||t[2]!==a||t[3]!==c||t[4]!==o||t[5]!==i){m=Symbol.for(`react.early_return_sentinel`);bb0:{let e=uX(c),r;t[12]===o?r=t[13]:(r=e=>o[e.id]?.installed===!0,t[12]=o,t[13]=r);let h=oa.filter(r),g=h.length>0,_=i!==null;if(!g&&!_){m=null;break bb0}u=uP,t[14]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Z.jsxs)(pP,{children:[(0,Z.jsx)(ss,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`O7_W_a`})]}),t[14]=p):p=t[14],l=mP,d=_?(0,Z.jsxs)(lP,{"aria-label":n({id:`ALhMYW`}),children:[(0,Z.jsx)(gP,{children:(0,Z.jsx)(J,{id:`ALhMYW`})}),Ca.map(t=>{let{displayName:r}=mi[t];return(0,Z.jsxs)(fP,{onSelect:()=>{a!==null&&i.launchInTerminal(a,t)},disabled:c,"data-testid":`empty-space-open-in-terminal-${t}`,"aria-label":n(e?{id:`AIn2Yv`,values:{displayName:r,hint:e}}:{id:`QYfQdv`,values:{displayName:r}}),children:[(0,Z.jsx)(fa,{id:da(t),"aria-hidden":`true`}),(0,Z.jsx)(`span`,{className:`flex-1`,children:r}),e?(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:e}):null]},t)})]}):null,f=g?(0,Z.jsxs)(Z.Fragment,{children:[_?(0,Z.jsx)(_P,{}):null,(0,Z.jsxs)(lP,{"aria-label":n({id:`BBqGS9`}),children:[(0,Z.jsx)(gP,{children:(0,Z.jsx)(J,{id:`BBqGS9`})}),h.map(t=>{let r=!c,{displayName:i}=t,o=n(e?{id:`1ZpfyB`,values:{displayName:i,hint:e}}:{id:`WqLq6M`,values:{displayName:i}});return(0,Z.jsxs)(fP,{disabled:!r,onSelect:()=>{a&&s(t.id,a)},"data-testid":`empty-space-open-in-${t.id}`,"aria-label":o,children:[(0,Z.jsx)(fa,{id:t.id,"aria-hidden":`true`}),(0,Z.jsx)(`span`,{className:`flex-1`,children:t.displayName}),e?(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:e}):null]},t.id)})]})]}):null}t[0]=n,t[1]=s,t[2]=a,t[3]=c,t[4]=o,t[5]=i,t[6]=l,t[7]=u,t[8]=d,t[9]=f,t[10]=p,t[11]=m}else l=t[6],u=t[7],d=t[8],f=t[9],p=t[10],m=t[11];if(m!==Symbol.for(`react.early_return_sentinel`))return m;let h;t[15]!==l||t[16]!==d||t[17]!==f?(h=(0,Z.jsxs)(l,{children:[d,f]}),t[15]=l,t[16]=d,t[17]=f,t[18]=h):h=t[18];let g;return t[19]!==u||t[20]!==p||t[21]!==h?(g=(0,Z.jsxs)(u,{children:[p,h]}),t[19]=u,t[20]=p,t[21]=h,t[22]=g):g=t[22],g}async function fX(e){try{let t=await e.project.listRecent(),n=e.config.projectPath;return t.some(e=>e.path!==n)?!1:await aT()===0}catch(e){return console.warn(`[onboarding-card-visible] fresh-project probe failed; suppressing card`,e),!1}}function pX(e){let t=(0,$.c)(4),n=e===void 0?tT:e,{initialized:r,dismissed:i,completed:a}=(0,Q.useSyncExternalStore)(n.subscribe,n.getSnapshot,n.getSnapshot),o=i||a,s=!r&&!o,c,l;return t[0]!==s||t[1]!==n?(c=()=>{if(!s)return;let e=window.okDesktop;if(e==null)return;let t=!1;return fX(e).then(e=>{!t&&e&&n.activate()}),()=>{t=!0}},l=[s,n],t[0]=s,t[1]=n,t[2]=c,t[3]=l):(c=t[2],l=t[3]),(0,Q.useEffect)(c,l),r&&!o}function mX(e){let t=(0,$.c)(3),n=e===void 0?tT:e,r,i;t[0]===n?(r=t[1],i=t[2]):(r=()=>{if(n.getSnapshot().steps.file)return;let e=ml(e=>{e.includes(`files`)&&oT(n)});return oT(n),e},i=[n],t[0]=n,t[1]=r,t[2]=i),(0,Q.useEffect)(r,i)}var hX=3,gX=5200,_X=1500,vX=220;function yX(e){let t=(0,$.c)(14),{complete:n,label:r,shortcutId:i}=e,a;t[0]===n?a=t[1]:(a=(0,Z.jsx)(tc,{checked:n,disabled:!0,"aria-hidden":!0,tabIndex:-1,className:`pointer-events-none opacity-100 disabled:opacity-100`}),t[0]=n,t[1]=a);let o=n?`flex-1 text-muted-foreground/60`:`flex-1`,s;t[2]===n?s=t[3]:(s=n?(0,Z.jsxs)(`span`,{className:`sr-only`,children:[(0,Z.jsx)(J,{id:`Qj4RL5`}),` `]}):null,t[2]=n,t[3]=s);let c;t[4]!==r||t[5]!==o||t[6]!==s?(c=(0,Z.jsxs)(`span`,{className:o,children:[s,r]}),t[4]=r,t[5]=o,t[6]=s,t[7]=c):c=t[7];let l;t[8]===i?l=t[9]:(l=i?(0,Z.jsx)(F,{children:Nl(i)}):null,t[8]=i,t[9]=l);let u;return t[10]!==a||t[11]!==c||t[12]!==l?(u=(0,Z.jsxs)(`li`,{className:`flex items-center gap-2 py-0.5 text-sm`,children:[a,c,l]}),t[10]=a,t[11]=c,t[12]=l,t[13]=u):u=t[13],u}function bX(e){let t=(0,$.c)(24),{store:n,lingerMs:r}=e,i=n===void 0?tT:n,a=r===void 0?gX:r,{_:o}=an(),{steps:s}=nT(i);mX(i);let[c,l]=(0,Q.useState)(0),[u,d]=(0,Q.useState)(!1),f=1+ +!!s.file+ +!!s.askedAi,p=f===hX,m,h;t[0]!==p||t[1]!==a?(m=()=>{if(!p)return;l(SX);let e=setInterval(()=>l(xX),_X),t=setTimeout(()=>{clearInterval(e),d(!0)},a);return()=>{clearInterval(e),clearTimeout(t)}},h=[p,a],t[0]=p,t[1]=a,t[2]=m,t[3]=h):(m=t[2],h=t[3]),(0,Q.useEffect)(m,h);let g,_;t[4]!==u||t[5]!==i?(g=()=>{if(!u)return;let e=setTimeout(()=>i.markCompleted(),vX);return()=>clearTimeout(e)},_=[u,i],t[4]=u,t[5]=i,t[6]=g,t[7]=_):(g=t[6],_=t[7]),(0,Q.useEffect)(g,_);let v;t[8]!==o||t[9]!==p?(v=p?o({id:`7jIIFX`}):``,t[8]=o,t[9]=p,t[10]=v):v=t[10];let y;t[11]===v?y=t[12]:(y=(0,Z.jsx)(`div`,{className:`sr-only`,role:`status`,"aria-live":`polite`,children:v}),t[11]=v,t[12]=y);let b;t[13]!==p||t[14]!==c||t[15]!==f||t[16]!==u||t[17]!==s.askedAi||t[18]!==s.file||t[19]!==i?(b=p?(0,Z.jsxs)(`section`,{"aria-hidden":!0,className:Y(`mx-2 mb-1 flex items-center gap-3 rounded-lg border bg-card px-4 py-3 text-card-foreground`,`motion-reduce:animate-none motion-reduce:duration-0`,u?`animate-out fade-out-0 zoom-out-95 fill-mode-forwards duration-200`:`animate-in fade-in-0 zoom-in-95 duration-300`),children:[(0,Z.jsx)(CS,{size:36,celebrateSignal:c}),(0,Z.jsx)(`span`,{className:`font-medium text-sm`,children:(0,Z.jsx)(J,{id:`7jIIFX`})})]}):(0,Z.jsxs)(`section`,{"aria-labelledby":`onboarding-card-heading`,className:`mx-2 mb-1 rounded-lg border bg-card px-4 py-3 text-card-foreground`,children:[(0,Z.jsxs)(`header`,{className:`mb-3 flex items-center justify-between`,children:[(0,Z.jsx)(`h2`,{id:`onboarding-card-heading`,className:`font-medium text-sm`,children:(0,Z.jsx)(J,{id:`Y1QMlM`})}),(0,Z.jsx)(`span`,{className:`text-muted-foreground/60 text-xs tabular-nums`,children:`${f} / ${hX}`})]}),(0,Z.jsxs)(`ul`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(yX,{complete:!0,label:(0,Z.jsx)(J,{id:`4E9jPa`})}),(0,Z.jsx)(yX,{complete:s.file,label:(0,Z.jsx)(J,{id:`6ibbCg`}),shortcutId:`new-item`}),(0,Z.jsx)(yX,{complete:s.askedAi,label:(0,Z.jsx)(J,{id:`xWEvuo`}),shortcutId:`open-ask-ai`})]}),(0,Z.jsx)(`footer`,{className:`-mb-1 mt-2 flex justify-end`,children:(0,Z.jsx)(X,{type:`button`,variant:`ghost`,size:`sm`,className:`h-auto px-2 py-1 text-muted-foreground text-xs`,onClick:()=>i.dismiss(),children:(0,Z.jsx)(J,{id:`1QfxQT`})})})]}),t[13]=p,t[14]=c,t[15]=f,t[16]=u,t[17]=s.askedAi,t[18]=s.file,t[19]=i,t[20]=b):b=t[20];let x;return t[21]!==y||t[22]!==b?(x=(0,Z.jsxs)(Z.Fragment,{children:[y,b]}),t[21]=y,t[22]=b,t[23]=x):x=t[23],x}function xX(e){return e+1}function SX(e){return e+1}function CX(){let e=(0,$.c)(1);if(!pX())return null;let t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Z.jsx)(bX,{}),e[0]=t):t=e[0],t}function wX(e){return e===null?null:e.kind===`local`?e.name:e.ref}function TX(e,t){if(e.length===0)return null;let n=`origin/${e}`;return t.includes(n)?n:t.find(t=>pi(t)===e)??null}function EX(e){switch(e){case`branch-exists`:return{id:`wzq9Rv`};case`already-checked-out`:return{id:`ljHjfg`};case`path-exists`:return{id:`mYzDD_`};case`invalid-branch`:return{id:`r-OJYm`};case`no-git`:return{id:`CFnavk`};default:return{id:`-zA2E7`}}}function DX(e){let t=(0,$.c)(71),{open:n,onOpenChange:r,bridge:i,currentBranch:a,branches:o,existingWorktreeBranches:s,remoteBranches:c,behindByBranch:l,initialBranchName:u}=e,d=o===void 0?[]:o,f=c===void 0?[]:c,p=u===void 0?``:u,{_:m}=an(),h=(0,Q.useId)(),g=(0,Q.useId)(),_=(0,Q.useId)(),v=(0,Q.useId)(),y=(0,Q.useId)(),b=(0,Q.useId)(),[x,S]=(0,Q.useState)(``),C;t[0]===a?C=t[1]:(C=a===null?null:{kind:`local`,name:a},t[0]=a,t[1]=C);let[w,T]=(0,Q.useState)(C),[E,D]=(0,Q.useState)(!1),[k,A]=(0,Q.useState)(``),[j,M]=(0,Q.useState)(!1),[N,P]=(0,Q.useState)(null),F=(0,Q.useRef)(null),I=(0,Q.useRef)(null),L,R;t[2]!==a||t[3]!==p||t[4]!==n?(L=()=>{if(!n)return;S(p),T(a===null?null:{kind:`local`,name:a}),D(!1),A(``),M(!1),P(null);let e=requestAnimationFrame(()=>F.current?.focus());return()=>cancelAnimationFrame(e)},R=[n,a,p],t[2]=a,t[3]=p,t[4]=n,t[5]=L,t[6]=R):(L=t[5],R=t[6]),(0,Q.useEffect)(L,R);let z=x.trim(),B=!j&&z.length>0,V=z.length>0&&d.includes(z),H=V?null:TX(z,f),U=H!==null,W=V||U,G=V&&(s?.has(z)??!1),K=d.filter(e=>e.toLowerCase().startsWith(z.toLowerCase())),ee=!j&&K.length>0&&!W,te=(a!==null&&!d.includes(a)?[a,...d]:d).map(MX),ne=f.map(jX),re=wX(w),ie=k.trim().toLowerCase(),ae=ie===``?te:te.filter(e=>e.name.toLowerCase().includes(ie)),oe=ie===``?ne:ne.filter(e=>e.ref.toLowerCase().includes(ie)),se=ie!==``&&ae.length===0&&oe.length===0,ce=async function(e){if(e.preventDefault(),B){M(!0),P(null);try{let e=U?{branch:z,createBranch:!0,remoteRef:H}:V?{branch:z,createBranch:!1}:{branch:z,createBranch:!0,baseBranch:w?.kind===`local`?w.name:void 0,baseRef:w?.kind===`remote`?w.ref:void 0},t=await i.worktree.create(e);if(!t.ok){P(EX(t.reason)),M(!1);return}ig(),r(!1),await i.project.open({path:t.path,target:`new-window`,entryPoint:`worktree`})}catch(e){console.warn(`[NewWorktreeDialog] worktree create/open failed:`,e),bs.error(m({id:`vAYoCZ`})),M(!1)}}},le=Ws,q;t[7]!==j||t[8]!==r?(q=e=>{j||r(e)},t[7]=j,t[8]=r,t[9]=q):q=t[9];let ue=Bs,de;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(de=(0,Z.jsx)(zs,{children:(0,Z.jsx)(J,{id:`DXd9LM`})}),t[10]=de):de=t[10];let fe;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(fe=(0,Z.jsxs)(Us,{children:[de,(0,Z.jsx)(Rs,{children:(0,Z.jsx)(J,{id:`NEzPEh`})})]}),t[11]=fe):fe=t[11];let pe=Vs,me;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(me=(0,Z.jsx)(J,{id:`ng2Ibo`}),t[12]=me):me=t[12];let he;t[13]===g?he=t[14]:(he=(0,Z.jsx)(Lc,{htmlFor:g,children:me}),t[13]=g,t[14]=he);let _e;t[15]===m?_e=t[16]:(_e=m({id:`IX_uXB`}),t[15]=m,t[16]=_e);let ve;t[17]===N?ve=t[18]:(ve=e=>{S(e.target.value),N!==null&&P(null)},t[17]=N,t[18]=ve);let ye=N!==null,be=N===null?y:`${y} ${b}`,xe;t[19]!==x||t[20]!==j||t[21]!==g||t[22]!==_e||t[23]!==ve||t[24]!==ye||t[25]!==be?(xe=(0,Z.jsx)(qc,{id:g,ref:F,value:x,placeholder:_e,onChange:ve,disabled:j,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-invalid":ye,"aria-describedby":be,"data-testid":`new-worktree-branch`}),t[19]=x,t[20]=j,t[21]=g,t[22]=_e,t[23]=ve,t[24]=ye,t[25]=be,t[26]=xe):xe=t[26];let Se=z.length>0?(0,Z.jsxs)(`p`,{id:y,className:`flex items-start gap-1.5 text-1sm text-muted-foreground`,"data-testid":G?`new-worktree-mode-existing-worktree`:U?`new-worktree-mode-remote-checkout`:V?`new-worktree-mode-checkout`:`new-worktree-mode-create`,children:[G?(0,Z.jsx)(Bo,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0 text-amber-600 dark:text-amber-400`}):U?(0,Z.jsx)(ro,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0 text-violet-600 dark:text-violet-400`}):V?(0,Z.jsx)(Ji,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0 text-blue-600 dark:text-blue-400`}):(0,Z.jsx)(ge,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0 text-green-600 dark:text-green-400`}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1`,children:G?(0,Z.jsx)(J,{id:`QAi7Q9`,values:{trimmed:z},components:{0:(0,Z.jsx)(`code`,{className:`font-mono break-words`})}}):U?(0,Z.jsx)(J,{id:`oAGN8p`,values:{remoteCheckoutRef:H,trimmed:z},components:{0:(0,Z.jsx)(`code`,{className:`font-mono break-words`}),1:(0,Z.jsx)(`code`,{className:`font-mono break-words`}),2:(0,Z.jsx)(`code`,{className:`font-mono`})}}):V?(0,Z.jsx)(J,{id:`b4VvP-`,values:{trimmed:z},components:{0:(0,Z.jsx)(`code`,{className:`font-mono break-words`}),1:(0,Z.jsx)(`code`,{className:`font-mono`})}}):re===null?(0,Z.jsx)(J,{id:`t4sFKC`,values:{trimmed:z},components:{0:(0,Z.jsx)(`code`,{className:`font-mono break-words`}),1:(0,Z.jsx)(`code`,{className:`font-mono`})}}):(0,Z.jsx)(J,{id:`dGAdpH`,values:{trimmed:z,currentBaseLabel:re},components:{0:(0,Z.jsx)(`code`,{className:`font-mono break-words`}),1:(0,Z.jsx)(`code`,{className:`font-mono break-words`}),2:(0,Z.jsx)(`code`,{className:`font-mono`})}})})]}):null,Ce=ee?(0,Z.jsx)(`div`,{className:`max-h-40 overflow-y-auto rounded-md border bg-popover p-1 shadow-xs`,"data-testid":`new-worktree-branch-list`,children:K.map(e=>(0,Z.jsxs)(X,{type:`button`,variant:`ghost`,size:`sm`,tabIndex:-1,onClick:()=>{S(e),N!==null&&P(null),F.current?.focus()},"data-testid":`new-worktree-branch-option-${e}`,className:`h-8 w-full justify-start gap-2 font-normal`,children:[(0,Z.jsx)(Vo,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-left`,children:e})]},e))}):null,we=W?null:(0,Z.jsxs)(`div`,{className:`mt-1 flex flex-col gap-2`,children:[(0,Z.jsx)(Lc,{id:v,htmlFor:_,children:(0,Z.jsx)(J,{id:`ZWwYwM`})}),(0,Z.jsxs)(Ne,{open:E,onOpenChange:e=>{D(e),e||A(``)},children:[(0,Z.jsx)(Ie,{asChild:!0,children:(0,Z.jsxs)(X,{id:_,type:`button`,variant:`outline`,role:`combobox`,"aria-expanded":E,"aria-haspopup":`listbox`,"aria-labelledby":`${v} ${_}`,"aria-label":m({id:`ZWwYwM`}),disabled:j,"data-testid":`new-worktree-base-trigger`,className:`w-full justify-between font-normal`,children:[(0,Z.jsxs)(`span`,{className:`flex min-w-0 items-center gap-2`,children:[w?.kind===`remote`?(0,Z.jsx)(ro,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`}):(0,Z.jsx)(Vo,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,Z.jsx)(`span`,{className:`min-w-0 truncate text-left`,children:re===null?(0,Z.jsx)(J,{id:`EbjWsS`}):re})]}),(0,Z.jsx)(Dd,{"aria-hidden":`true`,className:`ml-2 size-4 shrink-0 opacity-50`})]})}),(0,Z.jsxs)(Ut,{align:`start`,className:`w-[var(--radix-popover-trigger-width)] p-1`,onWheel:AX,onTouchMove:kX,onOpenAutoFocus:e=>{e.preventDefault(),I.current?.focus()},children:[(0,Z.jsxs)(qC,{className:`mb-1 h-8`,children:[(0,Z.jsx)(QC,{ref:I,"aria-label":m({id:`fuJZKk`}),placeholder:m({id:`hQXiDc`}),value:k,onChange:e=>A(e.target.value),onKeyDown:OX,"data-testid":`new-worktree-base-search`}),(0,Z.jsx)(YC,{children:(0,Z.jsx)(O,{"aria-hidden":`true`})})]}),(0,Z.jsxs)(`div`,{role:`listbox`,"aria-label":m({id:`ZWwYwM`}),className:`max-h-56 overflow-y-auto`,"data-testid":`new-worktree-base-list`,children:[se?(0,Z.jsx)(`p`,{className:`px-2 py-1.5 text-1sm text-muted-foreground`,children:(0,Z.jsx)(J,{id:`Sh3Qkg`})}):null,ae.map(e=>{let t=e.name,n=l?.get(t);return(0,Z.jsxs)(X,{type:`button`,role:`option`,"aria-selected":w?.kind===`local`&&w.name===t,variant:`ghost`,size:`sm`,onClick:()=>{T(e),D(!1),A(``)},"data-testid":`new-worktree-base-option-${t}`,className:`h-8 w-full justify-start gap-2 font-normal`,children:[(0,Z.jsx)(Vo,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-left`,children:t}),n!==void 0&&n>0?(0,Z.jsx)(`span`,{className:`shrink-0 text-xs text-amber-600 dark:text-amber-400`,"data-testid":`new-worktree-base-behind-${t}`,children:(0,Z.jsx)(J,{id:`6-wLTJ`,values:{behind:n}})}):null]},`local:${t}`)}),oe.map(e=>{let t=e.ref;return(0,Z.jsxs)(X,{type:`button`,role:`option`,"aria-selected":w?.kind===`remote`&&w.ref===t,variant:`ghost`,size:`sm`,onClick:()=>{T(e),D(!1),A(``)},"data-testid":`new-worktree-base-option-${t}`,className:`h-8 w-full justify-start gap-2 font-normal`,children:[(0,Z.jsx)(ro,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-left`,children:t}),(0,Z.jsx)(`span`,{className:`shrink-0 text-xs text-muted-foreground`,children:(0,Z.jsx)(J,{id:`dIYSqk`})})]},`remote:${t}`)})]})]})]})]}),Te;t[27]!==m||t[28]!==N||t[29]!==b?(Te=N===null?null:(0,Z.jsx)(`p`,{id:b,role:`alert`,className:`text-1sm text-destructive`,"data-testid":`new-worktree-error`,children:m(N)}),t[27]=m,t[28]=N,t[29]=b,t[30]=Te):Te=t[30];let Ee;t[31]!==h||t[32]!==ce||t[33]!==he||t[34]!==xe||t[35]!==Se||t[36]!==Ce||t[37]!==we||t[38]!==Te?(Ee=(0,Z.jsxs)(`form`,{id:h,onSubmit:ce,className:`flex flex-col gap-2`,children:[he,xe,Se,Ce,we,Te]}),t[31]=h,t[32]=ce,t[33]=he,t[34]=xe,t[35]=Se,t[36]=Ce,t[37]=we,t[38]=Te,t[39]=Ee):Ee=t[39];let De;t[40]!==pe||t[41]!==Ee?(De=(0,Z.jsx)(pe,{children:Ee}),t[40]=pe,t[41]=Ee,t[42]=De):De=t[42];let Oe;t[43]===r?Oe=t[44]:(Oe=()=>r(!1),t[43]=r,t[44]=Oe);let ke;t[45]===Symbol.for(`react.memo_cache_sentinel`)?(ke=(0,Z.jsx)(J,{id:`dEgA5A`}),t[45]=ke):ke=t[45];let Ae;t[46]!==j||t[47]!==Oe?(Ae=(0,Z.jsx)(X,{type:`button`,variant:`outline`,onClick:Oe,disabled:j,"data-testid":`new-worktree-cancel`,children:ke}),t[46]=j,t[47]=Oe,t[48]=Ae):Ae=t[48];let je=!B,Me;t[49]!==j||t[50]!==G||t[51]!==V||t[52]!==U?(Me=j?(0,Z.jsx)(J,{id:`b4itZn`}):G?(0,Z.jsx)(J,{id:`XV5sC0`}):U?(0,Z.jsx)(J,{id:`XAyxsa`}):V?(0,Z.jsx)(J,{id:`uGaIIS`}):(0,Z.jsx)(J,{id:`iO8V-7`}),t[49]=j,t[50]=G,t[51]=V,t[52]=U,t[53]=Me):Me=t[53];let Pe;t[54]!==h||t[55]!==je||t[56]!==Me?(Pe=(0,Z.jsx)(X,{type:`submit`,form:h,disabled:je,"data-testid":`new-worktree-create`,children:Me}),t[54]=h,t[55]=je,t[56]=Me,t[57]=Pe):Pe=t[57];let Fe;t[58]!==Ae||t[59]!==Pe?(Fe=(0,Z.jsxs)(Hs,{children:[Ae,Pe]}),t[58]=Ae,t[59]=Pe,t[60]=Fe):Fe=t[60];let Le;t[61]!==ue||t[62]!==fe||t[63]!==De||t[64]!==Fe?(Le=(0,Z.jsxs)(ue,{className:`sm:max-w-md`,"data-testid":`new-worktree-dialog`,children:[fe,De,Fe]}),t[61]=ue,t[62]=fe,t[63]=De,t[64]=Fe,t[65]=Le):Le=t[65];let Re;return t[66]!==le||t[67]!==n||t[68]!==Le||t[69]!==q?(Re=(0,Z.jsx)(le,{open:n,onOpenChange:q,children:Le}),t[66]=le,t[67]=n,t[68]=Le,t[69]=q,t[70]=Re):Re=t[70],Re}function OX(e){return e.stopPropagation()}function kX(e){e.stopPropagation()}function AX(e){e.stopPropagation()}function jX(e){return{kind:`remote`,ref:e}}function MX(e){return{kind:`local`,name:e}}function NX(e){let t=(0,$.c)(51),{bridge:n,recents:r,currentPath:i,query:a,worktreeModel:o,closeMenu:s,guardStaleSelect:c,flyoutPath:l,setFlyoutPath:u,openNewWorktreeWith:d}=e,{_:f}=an(),p;t[0]!==f||t[1]!==n.project||t[2]!==s?(p=function(e,t){s(),n.project.open({path:e,target:`new-window`,entryPoint:t}).catch(e=>{console.warn(`[RecentProjectsMenu] project.open failed:`,e),bs.error(f({id:`6HCOwA`}))})},t[0]=f,t[1]=n.project,t[2]=s,t[3]=p):p=t[3];let m=p,h;t[4]!==f||t[5]!==n.project||t[6]!==n.worktree?(h=async function(e){try{let t=await n.worktree.create({branch:e,createBranch:!1});if(!t.ok){bs.error(f({id:`teD0H9`}));return}ig(),await n.project.open({path:t.path,target:`new-window`,entryPoint:`worktree`})}catch(e){console.warn(`[RecentProjectsMenu] create/open branch failed:`,e),bs.error(f({id:`LwMxXg`}))}},t[4]=f,t[5]=n.project,t[6]=n.worktree,t[7]=h):h=t[7];let g=h,_;t[8]!==s||t[9]!==i||t[10]!==m?(_=function(e){if(e.path===i){s();return}m(e.path,e.isLinkedWorktree?`worktree`:`recents`)},t[8]=s,t[9]=i,t[10]=m,t[11]=_):_=t[11];let v=_,y;t[12]!==s||t[13]!==g||t[14]!==i||t[15]!==m?(y=function(e){if(e.path!==null){if(e.path===i){s();return}m(e.path,e.isMain?`recents`:`worktree`);return}e.branch!==null&&(s(),g(e.branch))},t[12]=s,t[13]=g,t[14]=i,t[15]=m,t[16]=y):y=t[16];let b=y;if(a!==``){let e;t[17]!==s||t[18]!==g?(e=e=>{s(),g(e)},t[17]=s,t[18]=g,t[19]=e):e=t[19];let n;return t[20]!==i||t[21]!==c||t[22]!==v||t[23]!==a||t[24]!==r||t[25]!==e||t[26]!==o?(n=(0,Z.jsx)(RX,{recents:r,currentPath:i,query:a,worktreeModel:o,onPickEntry:v,onPickBranch:e,guardStaleSelect:c}),t[20]=i,t[21]=c,t[22]=v,t[23]=a,t[24]=r,t[25]=e,t[26]=o,t[27]=n):n=t[27],n}let x;if(t[28]!==s||t[29]!==i||t[30]!==l||t[31]!==c||t[32]!==b||t[33]!==d||t[34]!==m||t[35]!==r||t[36]!==u||t[37]!==o){let e=_g(r),n;t[39]!==s||t[40]!==i||t[41]!==l||t[42]!==c||t[43]!==b||t[44]!==d||t[45]!==m||t[46]!==u||t[47]!==o?(n=e=>(0,Z.jsx)(PX,{group:e,currentPath:i,worktreeModel:o,flyoutOpen:l===e.project.path,setFlyoutOpen:t=>u(n=>t?e.project.path:n===e.project.path?null:n),onPickProject:()=>{if(e.project.path===i){s();return}m(e.project.path,`recents`)},onPickFlyoutEntry:b,guardStaleSelect:c,openNewWorktreeWith:d},e.project.path),t[39]=s,t[40]=i,t[41]=l,t[42]=c,t[43]=b,t[44]=d,t[45]=m,t[46]=u,t[47]=o,t[48]=n):n=t[48],x=e.map(n),t[28]=s,t[29]=i,t[30]=l,t[31]=c,t[32]=b,t[33]=d,t[34]=m,t[35]=r,t[36]=u,t[37]=o,t[38]=x}else x=t[38];let S;return t[49]===x?S=t[50]:(S=(0,Z.jsx)(Z.Fragment,{children:x}),t[49]=x,t[50]=S),S}function PX(e){let t=(0,$.c)(34),{group:n,currentPath:r,worktreeModel:i,flyoutOpen:a,setFlyoutOpen:o,onPickProject:s,onPickFlyoutEntry:c,guardStaleSelect:l,openNewWorktreeWith:u}=e,d=n.project.path===r,f,p;t[0]!==r||t[1]!==n||t[2]!==i?(f=mg(n,i,r),p=f.filter(FX),t[0]=r,t[1]=n,t[2]=i,t[3]=f,t[4]=p):(f=t[3],p=t[4]);let m=p.length;if(m===0){let e;t[5]!==l||t[6]!==s?(e=e=>{l(e)||s()},t[5]=l,t[6]=s,t[7]=e):e=t[7];let r=`project-switcher-recent-${n.project.path}`,i=d?`true`:void 0,a;t[8]!==n.project.name||t[9]!==n.project.path||t[10]!==d?(a=(0,Z.jsx)(VX,{name:n.project.name,path:n.project.path,current:d}),t[8]=n.project.name,t[9]=n.project.path,t[10]=d,t[11]=a):a=t[11];let o;return t[12]!==e||t[13]!==r||t[14]!==i||t[15]!==a?(o=(0,Z.jsx)(Sc,{onSelect:e,className:`flex w-full min-w-0 flex-col items-start gap-0.5`,"data-testid":r,"data-current":i,children:a}),t[12]=e,t[13]=r,t[14]=i,t[15]=a,t[16]=o):o=t[16],o}let h;t[17]!==r||t[18]!==n.worktrees||t[19]!==d?(h=d||n.worktrees.some(e=>e.path===r),t[17]=r,t[18]=n.worktrees,t[19]=d,t[20]=h):h=t[20];let g=h,_;return t[21]!==g||t[22]!==r||t[23]!==f||t[24]!==a||t[25]!==n||t[26]!==l||t[27]!==c||t[28]!==s||t[29]!==u||t[30]!==m||t[31]!==o||t[32]!==i?(_=(0,Z.jsx)(IX,{group:n,currentPath:r,containsCurrent:g,worktreeModel:i,flyoutEntries:f,openedWorktreeCount:m,flyoutOpen:a,setFlyoutOpen:o,onPickProject:s,onPickFlyoutEntry:c,guardStaleSelect:l,openNewWorktreeWith:u}),t[21]=g,t[22]=r,t[23]=f,t[24]=a,t[25]=n,t[26]=l,t[27]=c,t[28]=s,t[29]=u,t[30]=m,t[31]=o,t[32]=i,t[33]=_):_=t[33],_}function FX(e){return e.opened&&!e.isMain}function IX(e){let t=(0,$.c)(46),{group:n,currentPath:r,containsCurrent:i,worktreeModel:a,flyoutEntries:o,openedWorktreeCount:s,flyoutOpen:c,setFlyoutOpen:l,onPickProject:u,onPickFlyoutEntry:d,guardStaleSelect:f,openNewWorktreeWith:p}=e,{_:m}=an(),h=n.project.path===r,g;t[0]!==f||t[1]!==u?(g=e=>{f(e)||u()},t[0]=f,t[1]=u,t[2]=g):g=t[2];let _=g,v,y;t[3]===_?(v=t[4],y=t[5]):(v=e=>{e.target.closest(`[data-project-open]`)!==null&&(e.preventDefault(),_(e.nativeEvent))},y=e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),_(e.nativeEvent))},t[3]=_,t[4]=v,t[5]=y);let b=`project-switcher-group-${n.project.path}`,x=c?`true`:void 0,S=i?`true`:void 0,C;t[6]===n.project.name?C=t[7]:(C=(0,Z.jsx)(`span`,{className:`truncate font-medium text-sm`,"data-project-open":``,title:n.project.name,children:n.project.name}),t[6]=n.project.name,t[7]=C);let w;t[8]===n.project.path?w=t[9]:(w=(0,Z.jsx)(`span`,{className:`truncate text-muted-foreground text-xs`,title:n.project.path,children:n.project.path}),t[8]=n.project.path,t[9]=w);let T;t[10]!==C||t[11]!==w?(T=(0,Z.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[C,w]}),t[10]=C,t[11]=w,t[12]=T):T=t[12];let E;t[13]!==m||t[14]!==h?(E=h?(0,Z.jsx)(Ji,{"aria-label":m({id:`Hp1l6f`}),className:`mt-0.5 size-3.5 shrink-0 text-muted-foreground`}):null,t[13]=m,t[14]=h,t[15]=E):E=t[15];let D=`project-switcher-toggle-${n.project.path}`,O;t[16]===s?O=t[17]:(O=(0,Z.jsx)(`span`,{className:`tabular-nums`,children:s}),t[16]=s,t[17]=O);let k;t[18]===s?k=t[19]:(k=(0,Z.jsx)(J,{id:`AKxFtn`,values:{openedWorktreeCount:s}}),t[18]=s,t[19]=k);let A;t[20]!==D||t[21]!==O||t[22]!==k?(A=(0,Z.jsxs)(`span`,{className:`mt-0.5 shrink-0 text-muted-foreground text-xs`,"data-testid":D,children:[O,` `,k]}),t[20]=D,t[21]=O,t[22]=k,t[23]=A):A=t[23];let j;t[24]!==E||t[25]!==A||t[26]!==v||t[27]!==y||t[28]!==b||t[29]!==x||t[30]!==S||t[31]!==T?(j=(0,Z.jsxs)(Pc,{onClick:v,onKeyDown:y,className:`flex w-full min-w-0 items-start gap-2`,"data-testid":b,"data-flyout-open":x,"data-current":S,children:[T,E,A]}),t[24]=E,t[25]=A,t[26]=v,t[27]=y,t[28]=b,t[29]=x,t[30]=S,t[31]=T,t[32]=j):j=t[32];let M;t[33]!==o||t[34]!==c||t[35]!==n||t[36]!==f||t[37]!==d||t[38]!==p||t[39]!==a?(M=(0,Z.jsx)(LX,{group:n,open:c,worktreeModel:a,entries:o,onPickFlyoutEntry:d,guardStaleSelect:f,openNewWorktreeWith:p}),t[33]=o,t[34]=c,t[35]=n,t[36]=f,t[37]=d,t[38]=p,t[39]=a,t[40]=M):M=t[40];let N;return t[41]!==c||t[42]!==l||t[43]!==j||t[44]!==M?(N=(0,Z.jsxs)(yc,{open:c,onOpenChange:l,children:[j,M]}),t[41]=c,t[42]=l,t[43]=j,t[44]=M,t[45]=N):N=t[45],N}function LX(e){let t=(0,$.c)(15),{group:n,open:r,worktreeModel:i,entries:a,onPickFlyoutEntry:o,guardStaleSelect:s,openNewWorktreeWith:c}=e,{_:l}=an(),[u,d]=(0,Q.useState)(``),f=(0,Q.useRef)(null),p=(0,Q.useRef)(null),m,h;t[0]===r?(m=t[1],h=t[2]):(m=()=>{r&&f.current?.focus({preventScroll:!0})},h=[r],t[0]=r,t[1]=m,t[2]=h),(0,Q.useEffect)(m,h);let g=function(){let e=p.current;return e===null?[]:[...e.querySelectorAll(`[role="menuitem"]`)]},_=function(e){g()[e]?.focus()},v=function(e,t){if(e.key===`ArrowDown`){e.preventDefault(),e.stopPropagation();let t=g(),n=t.indexOf(e.currentTarget);_(Math.min(n+1,t.length-1))}else if(e.key===`ArrowUp`){e.preventDefault(),e.stopPropagation();let t=g().indexOf(e.currentTarget);t<=0?f.current?.focus():_(t-1)}else e.key===`Enter`&&(e.preventDefault(),e.stopPropagation(),t())},y;if(t[3]!==a||t[4]!==u){let e=u.trim().toLowerCase();y=e===``?a:a.filter(t=>(t.branch??``).toLowerCase().includes(e)),t[3]=a,t[4]=u,t[5]=y}else y=t[5];let b=y,x=i!==null&&i.mainRoot===n.project.mainRoot,S=u.trim(),C=x&&S.length>0,w;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,Z.jsx)(YC,{align:`inline-start`,children:(0,Z.jsx)(O,{"aria-hidden":`true`})}),t[6]=w):w=t[6];let T;t[7]===l?T=t[8]:(T=l({id:`bSD4im`}),t[7]=l,t[8]=T);let E;t[9]===l?E=t[10]:(E=l({id:`Skr_7L`}),t[9]=l,t[10]=E);let D;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(D=e=>d(e.target.value),t[11]=D):D=t[11];let k=b.length===0?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Nc,{className:`font-normal text-muted-foreground text-xs`,role:`status`,"aria-live":`polite`,children:l({id:`-uaQnI`})}),C?(0,Z.jsxs)(Sc,{onSelect:e=>{s(e)||c(S)},onKeyDown:e=>v(e,()=>c(S)),className:`flex items-center gap-2`,"data-testid":`project-switcher-flyout-create`,children:[(0,Z.jsx)(ge,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm`,title:S,children:(0,Z.jsx)(J,{id:`gHSAWT`,values:{typedName:S},components:{0:(0,Z.jsx)(`span`,{className:`font-medium`}),1:(0,Z.jsx)(`span`,{className:`font-mono`})}})})]}):null]}):b.map(e=>{let t=e.path??`branch:${e.branch}`,n=e.branch??l({id:`D12vtS`});return(0,Z.jsxs)(Sc,{onSelect:t=>{s(t)||o(e)},onKeyDown:t=>v(t,()=>o(e)),className:`flex items-center gap-2`,"data-testid":`project-switcher-flyout-entry-${t}`,"data-current":e.isCurrent?`true`:void 0,children:[(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm`,title:n,children:n}),e.isMain?(0,Z.jsx)(`span`,{className:`shrink-0 text-muted-foreground text-xs`,children:l({id:`Bn9-El`})}):e.opened?null:(0,Z.jsx)(`span`,{className:`shrink-0 text-muted-foreground text-xs`,title:l({id:`Dvwa0U`}),children:l({id:`nfoduq`})}),e.isCurrent?(0,Z.jsx)(HX,{}):null]},t)}),A;return t[12]!==p||t[13]!==k?(A=(0,Z.jsx)(`div`,{ref:p,className:`min-h-0 flex-1 overflow-x-hidden overflow-y-auto overscroll-contain subtle-scrollbar`,children:k}),t[12]=p,t[13]=k,t[14]=A):A=t[14],(0,Z.jsxs)(sc,{sideOffset:4,className:`flex max-h-80 w-96 flex-col gap-1 overflow-hidden p-1`,"data-testid":`project-switcher-flyout-${n.project.path}`,children:[(0,Z.jsxs)(qC,{className:`mb-1 h-8 shrink-0`,children:[w,(0,Z.jsx)(QC,{ref:f,"aria-label":T,placeholder:E,value:u,onChange:D,onKeyDown:e=>{e.key===`ArrowDown`&&(e.preventDefault(),_(0)),e.stopPropagation()},"data-testid":`project-switcher-flyout-search-${n.project.path}`})]}),A]})}function RX(e){let t=(0,$.c)(41),{recents:n,currentPath:r,query:i,worktreeModel:a,onPickEntry:o,onPickBranch:s,guardStaleSelect:c}=e,{_:l}=an(),u;t[0]===i?u=t[1]:(u=e=>e.toLowerCase().includes(i),t[0]=i,t[1]=u);let d=u,f,p,m,h;if(t[2]!==l||t[3]!==r||t[4]!==c||t[5]!==d||t[6]!==s||t[7]!==o||t[8]!==n||t[9]!==a){h=Symbol.for(`react.early_return_sentinel`);bb0:{let e;t[14]===d?e=t[15]:(e=e=>!e.isLinkedWorktree&&(d(e.name)||d(e.path)),t[14]=d,t[15]=e);let i=n.filter(e),u;t[16]===d?u=t[17]:(u=e=>e.isLinkedWorktree===!0&&(d(e.branch??``)||d(e.path)),t[16]=d,t[17]=u);let g=n.filter(u),_=new Set(g.map(zX)),v;t[18]===a?.entries?v=t[19]:(v=a?.entries??[],t[18]=a?.entries,t[19]=v);let y=v.filter(e=>e.branch!==null&&d(e.branch)&&(e.worktreePath===null||!_.has(e.worktreePath))&&e.worktreePath!==r);if(i.length===0&&g.length===0&&y.length===0){let e;t[20]===l?e=t[21]:(e=l({id:`pEQFsW`}),t[20]=l,t[21]=e);let n;t[22]===e?n=t[23]:(n=(0,Z.jsx)(Nc,{className:`font-normal text-muted-foreground text-xs`,role:`status`,"aria-live":`polite`,children:e}),t[22]=e,t[23]=n),h=n;break bb0}let b;t[24]!==r||t[25]!==c||t[26]!==o?(b=e=>(0,Z.jsx)(Sc,{onSelect:t=>{c(t)||o(e)},className:`flex w-full min-w-0 flex-col items-start gap-0.5`,"data-testid":`project-switcher-recent-${e.path}`,children:(0,Z.jsx)(VX,{name:e.name,path:e.path,current:e.path===r})},e.path),t[24]=r,t[25]=c,t[26]=o,t[27]=b):b=t[27],f=i.map(b);let x;t[28]!==r||t[29]!==c||t[30]!==o?(x=e=>(0,Z.jsxs)(Sc,{onSelect:t=>{c(t)||o(e)},className:`flex items-start gap-2`,"data-testid":`project-switcher-worktree-${e.path}`,"data-current":e.path===r?`true`:void 0,children:[(0,Z.jsx)(Vo,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0`}),(0,Z.jsx)(BX,{branch:e.branch??e.name,project:e.mainRoot===void 0?null:gg(e.mainRoot)})]},e.path),t[28]=r,t[29]=c,t[30]=o,t[31]=x):x=t[31],p=g.map(x);let S;t[32]!==l||t[33]!==c||t[34]!==s||t[35]!==a?(S=e=>(0,Z.jsxs)(Sc,{onSelect:t=>{c(t)||e.branch!==null&&s(e.branch)},className:`flex items-start gap-2`,"data-testid":`project-switcher-branch-${e.branch}`,children:[(0,Z.jsx)(Vo,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0 opacity-40`}),(0,Z.jsx)(BX,{branch:e.branch??``,project:a===null?null:gg(a.mainRoot),hint:l({id:`nfoduq`})})]},`branch:${e.branch}`),t[32]=l,t[33]=c,t[34]=s,t[35]=a,t[36]=S):S=t[36],m=y.map(S)}t[2]=l,t[3]=r,t[4]=c,t[5]=d,t[6]=s,t[7]=o,t[8]=n,t[9]=a,t[10]=f,t[11]=p,t[12]=m,t[13]=h}else f=t[10],p=t[11],m=t[12],h=t[13];if(h!==Symbol.for(`react.early_return_sentinel`))return h;let g;return t[37]!==f||t[38]!==p||t[39]!==m?(g=(0,Z.jsxs)(Z.Fragment,{children:[f,p,m]}),t[37]=f,t[38]=p,t[39]=m,t[40]=g):g=t[40],g}function zX(e){return e.path}function BX(e){let t=(0,$.c)(12),{branch:n,project:r,hint:i}=e,a;t[0]===n?a=t[1]:(a=(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm`,children:n}),t[0]=n,t[1]=a);let o;t[2]===i?o=t[3]:(o=i===void 0?null:(0,Z.jsx)(`span`,{className:`shrink-0 text-muted-foreground text-xs`,children:i}),t[2]=i,t[3]=o);let s;t[4]!==a||t[5]!==o?(s=(0,Z.jsxs)(`span`,{className:`flex w-full min-w-0 items-center gap-1.5`,children:[a,o]}),t[4]=a,t[5]=o,t[6]=s):s=t[6];let c;t[7]===r?c=t[8]:(c=r===null?null:(0,Z.jsx)(`span`,{className:`truncate text-muted-foreground text-xs`,title:r,children:r}),t[7]=r,t[8]=c);let l;return t[9]!==s||t[10]!==c?(l=(0,Z.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[s,c]}),t[9]=s,t[10]=c,t[11]=l):l=t[11],l}function VX(e){let t=(0,$.c)(15),{name:n,path:r,current:i}=e,a=i&&`font-medium`,o;t[0]===a?o=t[1]:(o=Y(`flex w-full items-center gap-1.5`,a),t[0]=a,t[1]=o);let s;t[2]===n?s=t[3]:(s=(0,Z.jsx)(`span`,{className:`truncate font-medium text-sm`,title:n,children:n}),t[2]=n,t[3]=s);let c;t[4]===i?c=t[5]:(c=i?(0,Z.jsx)(Ji,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`}):null,t[4]=i,t[5]=c);let l;t[6]!==o||t[7]!==s||t[8]!==c?(l=(0,Z.jsxs)(`span`,{className:o,children:[s,c]}),t[6]=o,t[7]=s,t[8]=c,t[9]=l):l=t[9];let u;t[10]===r?u=t[11]:(u=(0,Z.jsx)(`span`,{className:`w-full truncate text-muted-foreground text-xs`,title:r,children:r}),t[10]=r,t[11]=u);let d;return t[12]!==l||t[13]!==u?(d=(0,Z.jsxs)(`span`,{className:`flex w-full min-w-0 flex-col gap-0.5`,children:[l,u]}),t[12]=l,t[13]=u,t[14]=d):d=t[14],d}function HX(){let e=(0,$.c)(4),{_:t}=an(),n;e[0]===t?n=e[1]:(n=t({id:`Hp1l6f`}),e[0]=t,e[1]=n);let r;return e[2]===n?r=e[3]:(r=(0,Z.jsx)(Ji,{"aria-label":n,className:`size-3.5 shrink-0 text-muted-foreground`}),e[2]=n,e[3]=r),r}var UX=(e,t,n)=>cg(e,t,n,`ProjectSwitcher`),WX=350;function GX(e){let t=(0,$.c)(108),{bridge:n}=e,{_:r}=an(),[i,a]=(0,Q.useState)(null),[o,s]=(0,Q.useState)(!1),[c,l]=(0,Q.useState)(``),[u,d]=(0,Q.useState)(!1),[f,p]=(0,Q.useState)(!1),[m,h]=(0,Q.useState)(``),[g,_]=(0,Q.useState)(null),v=hM(),y=ag(),b=typeof window<`u`&&window.okDesktop!=null,x=(0,Q.useRef)(!1),S=(0,Q.useRef)(!1),C=(0,Q.useRef)(null),w;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(w=e=>{e&&(S.current=!0,C.current!==null&&clearTimeout(C.current),C.current=setTimeout(()=>{S.current=!1},WX)),s(e),e||(l(``),_(null))},t[0]=w):w=t[0];let T=w,E;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(E=e=>!b||!S.current?!1:(e.preventDefault(),!0),t[1]=E):E=t[1];let D=E,k;t[2]!==r||t[3]!==n.project||t[4]!==o?(k=()=>{if(!o)return;let e=!1;return UX(async()=>{let t=await n.project.listRecent();e||a(t)},r({id:`fYKgzG`})),()=>{e=!0}},t[2]=r,t[3]=n.project,t[4]=o,t[5]=k):k=t[5];let A;t[6]!==r||t[7]!==n||t[8]!==o?(A=[o,n,r],t[6]=r,t[7]=n,t[8]=o,t[9]=A):A=t[9],(0,Q.useEffect)(k,A);let j,M;t[10]===n?(j=t[11],M=t[12]):(j=()=>n.onMenuAction(e=>{e===`new-worktree`?(s(!1),_(null),h(``),p(!0)):e===`switch-worktree`&&s(!0)}),M=[n],t[10]=n,t[11]=j,t[12]=M),(0,Q.useEffect)(j,M);let N;t[13]!==r||t[14]!==n.dialog||t[15]!==n.project?(N=()=>{T(!1),UX(async()=>{let e=await n.dialog.openFolder();e&&await n.project.open({path:e,target:`new-window`,entryPoint:`pick-existing`})},r({id:`gmJ0An`}))},t[13]=r,t[14]=n.dialog,t[15]=n.project,t[16]=N):N=t[16];let P=N,F;t[17]!==r||t[18]!==n.navigator?(F=()=>{T(!1),UX(()=>n.navigator.open(),r({id:`jol95m`}))},t[17]=r,t[18]=n.navigator,t[19]=F):F=t[19];let I=F,L;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(L=()=>{T(!1),d(!0)},t[20]=L):L=t[20];let R=L,z;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(z=e=>{T(!1),h(e),p(!0)},t[21]=z):z=t[21];let B=z,V=n.config.projectPath,H;t[22]===c?H=t[23]:(H=c.trim().toLowerCase(),t[22]=c,t[23]=H);let U=H,W=U!==``,G;t[24]===i?G=t[25]:(G=i??[],t[24]=i,t[25]=G);let K=G,ee;t[26]!==W||t[27]!==K?(ee=W?K.filter($X):K,t[26]=W,t[27]=K,t[28]=ee):ee=t[28];let te=ee,ne=W?null:y,re=v!==null&&`h-auto py-1.5`,ie;t[29]===re?ie=t[30]:(ie=Y(`justify-between text-sidebar-foreground/70 hover:text-sidebar-foreground! data-open:hover:text-sidebar-foreground!`,re),t[29]=re,t[30]=ie);let ae;t[31]===r?ae=t[32]:(ae=r({id:`zZ_I5K`}),t[31]=r,t[32]=ae);let oe;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(oe=b?()=>{x.current=!0}:void 0,t[33]=oe):oe=t[33];let se;t[34]===o?se=t[35]:(se=b?()=>{if(x.current){x.current=!1;return}T(!o)}:void 0,t[34]=o,t[35]=se);let ce;t[36]===n.config.projectName?ce=t[37]:(ce=(0,Z.jsx)(`span`,{className:`truncate`,children:n.config.projectName}),t[36]=n.config.projectName,t[37]=ce);let le;t[38]===v?le=t[39]:(le=v===null?null:(0,Z.jsxs)(`span`,{className:`flex min-w-0 items-center gap-1 text-xs text-sidebar-foreground/50 group-hover/menu-button:text-sidebar-foreground`,"data-testid":`project-switcher-branch`,children:[(0,Z.jsx)(Vo,{"aria-hidden":`true`,className:`size-3! shrink-0`}),(0,Z.jsx)(`span`,{className:`truncate`,children:v})]}),t[38]=v,t[39]=le);let q;t[40]!==ce||t[41]!==le?(q=(0,Z.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5`,children:[ce,le]}),t[40]=ce,t[41]=le,t[42]=q):q=t[42];let ue;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(ue=(0,Z.jsx)(Dd,{"aria-hidden":`true`,className:`opacity-60`}),t[43]=ue):ue=t[43];let de;t[44]!==n.config.projectPath||t[45]!==ie||t[46]!==ae||t[47]!==se||t[48]!==q?(de=(0,Z.jsx)(bc,{asChild:!0,children:(0,Z.jsxs)(aM,{className:ie,"data-testid":`project-switcher-trigger`,"aria-label":ae,title:n.config.projectPath,onPointerDown:oe,onClick:se,children:[q,ue]})}),t[44]=n.config.projectPath,t[45]=ie,t[46]=ae,t[47]=se,t[48]=q,t[49]=de):de=t[49];let fe;t[50]!==r||t[51]!==n||t[52]!==V||t[53]!==g||t[54]!==te||t[55]!==ne||t[56]!==U||t[57]!==i||t[58]!==c?(fe=i===null?null:i.length===0?(0,Z.jsx)(Nc,{className:`font-normal text-muted-foreground text-xs`,children:(0,Z.jsx)(J,{id:`MUrVEo`})}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(qC,{className:`mb-1 h-8 border-0 shadow-none has-[[data-slot=input-group-control]:focus-visible]:ring-0`,children:[(0,Z.jsx)(QC,{"aria-label":r({id:`blFttG`}),placeholder:r({id:`RVZJWQ`}),value:c,onChange:e=>{e.target.value!==``&&_(null),l(e.target.value)},onKeyDown:QX,"data-testid":`project-switcher-search`}),(0,Z.jsx)(YC,{children:(0,Z.jsx)(O,{"aria-hidden":`true`})})]}),(0,Z.jsx)(Fc,{}),(0,Z.jsx)(`div`,{className:`max-h-64 overflow-x-hidden overflow-y-auto overscroll-contain subtle-scrollbar scroll-fade-mask`,"data-testid":`project-switcher-scroll`,onScroll:()=>{g!==null&&_(null)},children:(0,Z.jsx)(NX,{bridge:n,recents:te,currentPath:V,query:U,worktreeModel:ne,closeMenu:()=>T(!1),guardStaleSelect:D,flyoutPath:g,setFlyoutPath:_,openNewWorktreeWith:B})})]}),t[50]=r,t[51]=n,t[52]=V,t[53]=g,t[54]=te,t[55]=ne,t[56]=U,t[57]=i,t[58]=c,t[59]=fe):fe=t[59];let pe;t[60]===Symbol.for(`react.memo_cache_sentinel`)?(pe=(0,Z.jsx)(Fc,{}),t[60]=pe):pe=t[60];let me;t[61]===Symbol.for(`react.memo_cache_sentinel`)?(me=e=>{D(e)||R()},t[61]=me):me=t[61];let he;t[62]===Symbol.for(`react.memo_cache_sentinel`)?(he=(0,Z.jsxs)(Sc,{onSelect:me,"data-testid":`project-switcher-new-project`,children:[(0,Z.jsx)(ge,{"aria-hidden":`true`,className:`text-muted-foreground`}),(0,Z.jsx)(J,{id:`gKi-a_`})]}),t[62]=he):he=t[62];let _e;t[63]===I?_e=t[64]:(_e=e=>{D(e)||I()},t[63]=I,t[64]=_e);let ve,ye;t[65]===Symbol.for(`react.memo_cache_sentinel`)?(ve=(0,Z.jsx)(Se,{"aria-hidden":`true`,className:`text-muted-foreground`}),ye=(0,Z.jsx)(J,{id:`xaDWAI`}),t[65]=ve,t[66]=ye):(ve=t[65],ye=t[66]);let be;t[67]===_e?be=t[68]:(be=(0,Z.jsxs)(Sc,{onSelect:_e,"data-testid":`project-switcher-switch-project`,children:[ve,ye]}),t[67]=_e,t[68]=be);let xe;t[69]===P?xe=t[70]:(xe=e=>{D(e)||P()},t[69]=P,t[70]=xe);let Ce,we;t[71]===Symbol.for(`react.memo_cache_sentinel`)?(Ce=(0,Z.jsx)(Bo,{"aria-hidden":`true`,className:`text-muted-foreground`}),we=(0,Z.jsx)(J,{id:`PVUn_c`}),t[71]=Ce,t[72]=we):(Ce=t[71],we=t[72]);let Te;t[73]===xe?Te=t[74]:(Te=(0,Z.jsxs)(Sc,{onSelect:xe,"data-testid":`project-switcher-open-folder`,children:[Ce,we]}),t[73]=xe,t[74]=Te);let Ee;t[75]===v?Ee=t[76]:(Ee=v===null?null:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Fc,{}),(0,Z.jsxs)(Sc,{onSelect:e=>{D(e)||(T(!1),h(``),p(!0))},"data-testid":`project-switcher-new-worktree`,children:[(0,Z.jsx)(Vo,{"aria-hidden":`true`,className:`text-muted-foreground`}),(0,Z.jsx)(J,{id:`DXd9LM`})]})]}),t[75]=v,t[76]=Ee);let De;t[77]!==fe||t[78]!==be||t[79]!==Te||t[80]!==Ee?(De=(0,Z.jsxs)(wc,{align:`start`,side:`top`,className:`min-w-[260px]`,"data-testid":`project-switcher-menu`,children:[fe,pe,he,be,Te,Ee]}),t[77]=fe,t[78]=be,t[79]=Te,t[80]=Ee,t[81]=De):De=t[81];let Oe;t[82]!==o||t[83]!==de||t[84]!==De?(Oe=(0,Z.jsxs)(Ac,{open:o,onOpenChange:T,modal:!1,children:[de,De]}),t[82]=o,t[83]=de,t[84]=De,t[85]=Oe):Oe=t[85];let ke;t[86]!==n||t[87]!==u?(ke=(0,Z.jsx)(pm,{open:u,onOpenChange:d,bridge:n}),t[86]=n,t[87]=u,t[88]=ke):ke=t[88];let Ae;t[89]===y?.entries?Ae=t[90]:(Ae=y?.entries.map(ZX).filter(XX),t[89]=y?.entries,t[90]=Ae);let je;t[91]===y?.entries?je=t[92]:(je=new Set(y?.entries.filter(YX).map(JX)),t[91]=y?.entries,t[92]=je);let Me=y?.remoteBranches,Ne;t[93]===y?.entries?Ne=t[94]:(Ne=new Map(y?.entries.filter(qX).map(KX)),t[93]=y?.entries,t[94]=Ne);let Pe;t[95]!==v||t[96]!==n||t[97]!==m||t[98]!==f||t[99]!==Ae||t[100]!==je||t[101]!==Me||t[102]!==Ne?(Pe=(0,Z.jsx)(DX,{open:f,onOpenChange:p,bridge:n,currentBranch:v,initialBranchName:m,branches:Ae,existingWorktreeBranches:je,remoteBranches:Me,behindByBranch:Ne}),t[95]=v,t[96]=n,t[97]=m,t[98]=f,t[99]=Ae,t[100]=je,t[101]=Me,t[102]=Ne,t[103]=Pe):Pe=t[103];let Fe;return t[104]!==Oe||t[105]!==ke||t[106]!==Pe?(Fe=(0,Z.jsxs)(Z.Fragment,{children:[Oe,ke,Pe]}),t[104]=Oe,t[105]=ke,t[106]=Pe,t[107]=Fe):Fe=t[107],Fe}function KX(e){return[e.branch,e.behind]}function qX(e){return e.branch!==null&&e.behind!==void 0}function JX(e){return e.branch}function YX(e){return e.branch!==null&&e.worktreePath!==null}function XX(e){return e!==null}function ZX(e){return e.branch}function QX(e){return e.stopPropagation()}function $X(e){return!e.isLinkedWorktree}function eZ(e,t){let n=e instanceof Error?e:Error(String(e));console.warn(JSON.stringify({event:`jsx-render-failure`,component:`sidebarSearchPill`,rawComponentName:`sidebarSearchPill`,error:String(n),stack:t.componentStack})),$n(`sidebarSearchPill`)}function tZ(e){let t=(0,$.c)(8),{onClick:n,className:r}=e,i;t[0]===r?i=t[1]:(i=Y(`rounded-lg h-9 w-full justify-start gap-2 px-3 font-normal text-muted-foreground`,r),t[0]=r,t[1]=i);let a;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Z.jsx)(O,{"aria-hidden":`true`}),t[2]=a):a=t[2];let o;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Z.jsx)(`span`,{className:`flex-1 text-left text-sm`,children:(0,Z.jsx)(J,{id:`A1taO8`})}),t[3]=o):o=t[3];let s;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Z.jsx)(F,{className:`text-foreground/70`,children:Nl(`command-palette`)}),t[4]=s):s=t[4];let c;return t[5]!==n||t[6]!==i?(c=(0,Z.jsxs)(X,{variant:`outline`,onClick:n,"data-telemetry-event":`ok.sidebar.search_pill.click`,className:i,children:[a,o,s]}),t[5]=n,t[6]=i,t[7]=c):c=t[7],c}function nZ(){let e=(0,$.c)(31),{_:t}=an(),n=ha(),{activeDocName:r}=vt(),[i,a]=(0,Q.useState)(!1),o=Sa(),s;e[0]!==n.data||e[1]!==n.status?(s=n.status===`ready`?n.data:[],e[0]=n.data,e[1]=n.status,e[2]=s):s=e[2];let c=s,l;e[3]===c?l=e[4]:(l=jo(c),e[3]=c,e[4]=l);let u=l,d=Do(),f;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(f={},e[5]=f):f=e[5];let[p,m]=(0,Q.useState)(f),h;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,Z.jsx)($j,{asChild:!0,children:(0,Z.jsxs)(Is,{className:`flex w-full items-center gap-1.5`,children:[(0,Z.jsx)(qd,{className:`size-3.5 shrink-0`}),(0,Z.jsx)(J,{id:`PCSkw2`}),(0,Z.jsx)(Zi,{className:`size-3.5 shrink-0 text-muted-foreground transition-transform group-data-[state=open]/skills:rotate-90`})]})}),e[6]=h):h=e[6];let g;e[7]===t?g=e[8]:(g=t({id:`MdpSC1`}),e[7]=t,e[8]=g);let _,v;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(_=()=>a(!0),v=(0,Z.jsx)(ge,{}),e[9]=_,e[10]=v):(_=e[9],v=e[10]);let y;e[11]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Z.jsx)(`span`,{className:`sr-only`,children:(0,Z.jsx)(J,{id:`MdpSC1`})}),e[11]=y):y=e[11];let b;e[12]===g?b=e[13]:(b=(0,Z.jsxs)(eM,{title:g,onClick:_,children:[v,y]}),e[12]=g,e[13]=b);let x;e[14]===Symbol.for(`react.memo_cache_sentinel`)?(x=(0,Z.jsx)(lZ,{}),e[14]=x):x=e[14];let S;e[15]!==o||e[16]!==r||e[17]!==u||e[18]!==p||e[19]!==d||e[20]!==c?(S=c.length===0?(0,Z.jsx)(`p`,{className:`px-2 py-1 text-xs text-muted-foreground`,children:(0,Z.jsx)(J,{id:`PdJZ5p`})}):No.filter(e=>c.some(t=>t.scope===e)).map(e=>(0,Z.jsxs)(Ls,{className:`group/scope`,open:c.some(t=>t.scope===e&&fr(t.scope,t.name)===r)||(p[e]??!1),onOpenChange:t=>m(n=>({...n,[e]:t})),children:[(0,Z.jsxs)(Is,{className:`flex w-full items-center gap-1 px-2 pt-1 pb-0.5 text-[11px] text-muted-foreground/70 hover:text-muted-foreground`,children:[(0,Z.jsx)(Zi,{className:`size-3 shrink-0 transition-transform group-data-[state=open]/scope:rotate-90`}),(0,Z.jsx)(`span`,{className:`truncate`,children:d[e]})]}),(0,Z.jsx)(Fs,{children:(0,Z.jsx)(nM,{className:`pl-2`,children:c.filter(t=>t.scope===e).map(e=>(0,Z.jsx)(iZ,{skill:e,activeDocName:r,actions:o,existingNames:u[e.scope]},`${e.scope}::${e.name}`))})})]},e)),e[15]=o,e[16]=r,e[17]=u,e[18]=p,e[19]=d,e[20]=c,e[21]=S):S=e[21];let C;e[22]===S?C=e[23]:(C=(0,Z.jsx)(Fs,{children:(0,Z.jsxs)(tM,{children:[x,S]})}),e[22]=S,e[23]=C);let w;e[24]===i?w=e[25]:(w=(0,Z.jsx)(so,{defaultScope:`project`,open:i,onOpenChange:a,onCreated:rZ}),e[24]=i,e[25]=w);let T;return e[26]!==o.dialogs||e[27]!==C||e[28]!==w||e[29]!==b?(T=(0,Z.jsx)(Ls,{className:`group/skills shrink-0`,children:(0,Z.jsxs)(Qj,{className:`px-0`,children:[h,b,C,o.dialogs,w]})}),e[26]=o.dialogs,e[27]=C,e[28]=w,e[29]=b,e[30]=T):T=e[30],T}function rZ(e){let{scope:t,name:n}=e;return $o(fr(t,n))}function iZ(e){let t=(0,$.c)(50),{skill:n,activeDocName:r,actions:i,existingNames:a}=e,{_:o}=an(),[s,c]=(0,Q.useState)(!1),[l,u]=(0,Q.useState)(!1),d;t[0]!==n.name||t[1]!==n.scope?(d=fr(n.scope,n.name),t[0]=n.name,t[1]=n.scope,t[2]=d):d=t[2];let f=r===d,p,m,h;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(p=e=>{e.preventDefault(),u(!0)},m=(0,Z.jsx)(Zi,{className:`size-3 shrink-0 text-muted-foreground transition-transform group-data-[state=open]/skill:rotate-90`}),h=(0,Z.jsx)(qd,{className:`size-3 shrink-0 text-muted-foreground`}),t[3]=p,t[4]=m,t[5]=h):(p=t[3],m=t[4],h=t[5]);let g=n.name,_;t[6]===n.name?_=t[7]:(_=ko(n.name),t[6]=n.name,t[7]=_);let v;t[8]!==n.name||t[9]!==_?(v=(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate`,title:g,children:_}),t[8]=n.name,t[9]=_,t[10]=v):v=t[10];let y;t[11]!==o||t[12]!==n.bundledVersion||t[13]!==n.updateAvailable?(y=n.updateAvailable?(0,Z.jsx)(`span`,{title:o({id:`1YJ4Yg`,values:{0:n.bundledVersion?` (${n.bundledVersion})`:``}}),className:`flex items-center`,children:(0,Z.jsx)(os,{className:`size-3 text-primary`,"aria-label":o({id:`CifUuG`})})}):null,t[11]=o,t[12]=n.bundledVersion,t[13]=n.updateAvailable,t[14]=y):y=t[14];let b;t[15]===n.installed?b=t[16]:(b=(0,Z.jsx)(to,{installed:n.installed,subtle:!0,className:`shrink-0`}),t[15]=n.installed,t[16]=b);let x;t[17]!==y||t[18]!==b?(x=(0,Z.jsxs)(`span`,{className:`ml-auto flex shrink-0 items-center gap-1`,children:[y,b]}),t[17]=y,t[18]=b,t[19]=x):x=t[19];let S;t[20]!==f||t[21]!==x||t[22]!==v?(S=(0,Z.jsx)(Is,{asChild:!0,children:(0,Z.jsxs)(aM,{size:`sm`,isActive:f,className:`h-6 text-[11px]`,onContextMenu:p,children:[m,h,v,x]})}),t[20]=f,t[21]=x,t[22]=v,t[23]=S):S=t[23];let C;t[24]!==o||t[25]!==n.name?(C=o({id:`RlLl3G`,values:{0:n.name}}),t[24]=o,t[25]=n.name,t[26]=C):C=t[26];let w;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(w=(0,Z.jsx)(Fd,{}),t[27]=w):w=t[27];let T;t[28]===C?T=t[29]:(T=(0,Z.jsx)(bc,{asChild:!0,children:(0,Z.jsx)(oM,{showOnHover:!0,"aria-label":C,children:w})}),t[28]=C,t[29]=T);let E;t[30]!==i||t[31]!==a||t[32]!==n?(E=(0,Z.jsx)(wc,{side:`right`,align:`start`,className:`min-w-52`,children:(0,Z.jsx)(ya,{skill:n,actions:i,existingNames:a})}),t[30]=i,t[31]=a,t[32]=n,t[33]=E):E=t[33];let D;t[34]!==l||t[35]!==T||t[36]!==E?(D=(0,Z.jsxs)(Ac,{open:l,onOpenChange:u,children:[T,E]}),t[34]=l,t[35]=T,t[36]=E,t[37]=D):D=t[37];let O;t[38]!==s||t[39]!==n?(O=s?(0,Z.jsx)(sZ,{skill:n}):null,t[38]=s,t[39]=n,t[40]=O):O=t[40];let k;t[41]===O?k=t[42]:(k=(0,Z.jsx)(Fs,{children:O}),t[41]=O,t[42]=k);let A;t[43]!==S||t[44]!==D||t[45]!==k?(A=(0,Z.jsxs)(rM,{children:[S,D,k]}),t[43]=S,t[44]=D,t[45]=k,t[46]=A):A=t[46];let j;return t[47]!==s||t[48]!==A?(j=(0,Z.jsx)(Ls,{open:s,onOpenChange:c,className:`group/skill`,children:A}),t[47]=s,t[48]=A,t[49]=j):j=t[49],j}function aZ(e){let t=[];for(let n of e){let e=n.path.split(`/`),r=t;e.forEach((t,i)=>{let a=i===e.length-1,o=r.find(e=>e.name===t);o||(o=a?{name:t,path:n.path,text:n.text}:{name:t,path:e.slice(0,i+1).join(`/`),children:[]},r.push(o)),!a&&o.children&&(r=o.children)})}return oZ(t),t}function oZ(e){e.sort((e,t)=>{let n=+!e.children,r=+!t.children;return n===r?e.name.localeCompare(t.name):n-r});for(let t of e)t.children&&oZ(t.children)}function sZ(e){let t=(0,$.c)(27),{skill:n}=e,{_:r}=an(),[i,a]=(0,Q.useState)(null),[o,s]=(0,Q.useState)(!1),{openTarget:c}=vt(),l;t[0]===c?l=t[1]:(l=function(e){c({kind:`doc`,target:e,docName:e},{tabBehavior:`append`}),Sl(kl(e))},t[0]=c,t[1]=l);let u=l,d;t[2]!==u||t[3]!==c||t[4]!==n.name||t[5]!==n.scope?(d=function(e){let t=e.lastIndexOf(`.`),r=t>=0?e.slice(t+1).toLowerCase():``;if(n.scope===`project`&&(r===`md`||r===`mdx`)){u(lt(n.name,e.replace(/\.mdx?$/i,``)));return}c({kind:`skill-file`,target:`${n.scope}/${n.name}/${e}`,scope:n.scope,name:n.name,path:e},{tabBehavior:`replace-active`}),Sl(Tl({scope:n.scope,name:n.name,path:e}))},t[2]=u,t[3]=c,t[4]=n.name,t[5]=n.scope,t[6]=d):d=t[6];let f=d,p,m;t[7]!==n.name||t[8]!==n.scope?(p=()=>{let e=!0,t=()=>{jc(n.scope,n.name).then(t=>{e&&(t.ok?(a(t.files),s(!1)):(a([]),s(!0)))})};t();let r=gl(t);return()=>{e=!1,r()}},m=[n.scope,n.name],t[7]=n.name,t[8]=n.scope,t[9]=p,t[10]=m):(p=t[9],m=t[10]),(0,Q.useEffect)(p,m);let h;if(t[11]!==r||t[12]!==i||t[13]!==o||t[14]!==f||t[15]!==u||t[16]!==n.name||t[17]!==n.scope){let e=i?aZ(i):[],a;t[19]!==u||t[20]!==n.name||t[21]!==n.scope?(a=()=>n.scope===`project`?u(Xr(n.name)):$o(fr(n.scope,n.name)),t[19]=u,t[20]=n.name,t[21]=n.scope,t[22]=a):a=t[22];let s,c;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Z.jsx)(Nt,{className:`size-3 shrink-0 text-muted-foreground`}),c=(0,Z.jsx)(`span`,{className:`truncate`,children:`SKILL.md`}),t[23]=s,t[24]=c):(s=t[23],c=t[24]);let l;t[25]===a?l=t[26]:(l=(0,Z.jsx)(cM,{children:(0,Z.jsxs)(lM,{size:`sm`,onClick:a,className:`text-[11px]`,children:[s,c]})}),t[25]=a,t[26]=l),h=(0,Z.jsxs)(sM,{className:`mr-0 pr-0`,children:[l,i===null?(0,Z.jsx)(cM,{children:(0,Z.jsx)(`span`,{className:`px-2 py-0.5 text-[11px] text-muted-foreground/70`,children:(0,Z.jsx)(J,{id:`yQE2r9`})})}):o?(0,Z.jsx)(cM,{children:(0,Z.jsx)(`span`,{className:`px-2 py-0.5 text-[11px] text-muted-foreground/70`,title:r({id:`3Ijjy1`}),children:(0,Z.jsx)(J,{id:`ZARuZJ`})})}):e.map(e=>(0,Z.jsx)(cZ,{node:e,depth:0,onOpenFile:f},e.path))]}),t[11]=r,t[12]=i,t[13]=o,t[14]=f,t[15]=u,t[16]=n.name,t[17]=n.scope,t[18]=h}else h=t[18];return h}function cZ(e){let t=(0,$.c)(34),{node:n,depth:r,onOpenFile:i}=e,[a,o]=(0,Q.useState)(!1),s=`${r*.6}rem`,c;t[0]===s?c=t[1]:(c={paddingLeft:s},t[0]=s,t[1]=c);let l=c;if(n.children){let e;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(Zi,{className:`size-3 shrink-0 text-muted-foreground transition-transform group-data-[state=open]/dir:rotate-90`}),t[2]=e):e=t[2];let s;t[3]===n.name?s=t[4]:(s=(0,Z.jsxs)(`span`,{className:`truncate`,children:[n.name,`/`]}),t[3]=n.name,t[4]=s);let c;t[5]!==l||t[6]!==s?(c=(0,Z.jsx)(Is,{asChild:!0,children:(0,Z.jsxs)(lM,{size:`sm`,className:`text-[11px]`,style:l,children:[e,s]})}),t[5]=l,t[6]=s,t[7]=c):c=t[7];let u;if(t[8]!==r||t[9]!==n.children||t[10]!==i){let e;t[12]!==r||t[13]!==i?(e=e=>(0,Z.jsx)(cZ,{node:e,depth:r+1,onOpenFile:i},e.path),t[12]=r,t[13]=i,t[14]=e):e=t[14],u=n.children.map(e),t[8]=r,t[9]=n.children,t[10]=i,t[11]=u}else u=t[11];let d;t[15]===u?d=t[16]:(d=(0,Z.jsx)(Fs,{children:u}),t[15]=u,t[16]=d);let f;t[17]!==c||t[18]!==d?(f=(0,Z.jsxs)(cM,{children:[c,d]}),t[17]=c,t[18]=d,t[19]=f):f=t[19];let p;return t[20]!==a||t[21]!==f?(p=(0,Z.jsx)(Ls,{open:a,onOpenChange:o,className:`group/dir`,children:f}),t[20]=a,t[21]=f,t[22]=p):p=t[22],p}let u=`skill-file-${n.path}`,d;t[23]!==n.path||t[24]!==i?(d=()=>i(n.path),t[23]=n.path,t[24]=i,t[25]=d):d=t[25];let f;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Z.jsx)(Rd,{className:`size-3 shrink-0 text-muted-foreground`}),t[26]=f):f=t[26];let p;t[27]===n.name?p=t[28]:(p=(0,Z.jsx)(`span`,{className:`truncate`,children:n.name}),t[27]=n.name,t[28]=p);let m;return t[29]!==l||t[30]!==u||t[31]!==d||t[32]!==p?(m=(0,Z.jsx)(cM,{children:(0,Z.jsxs)(lM,{size:`sm`,className:`text-[11px]`,style:l,"data-testid":u,onClick:d,children:[f,p]})}),t[29]=l,t[30]=u,t[31]=d,t[32]=p,t[33]=m):m=t[33],m}function lZ(){let e=(0,$.c)(19),[t,n]=(0,Q.useState)(null),[r,i]=(0,Q.useState)(!1),a,o;if(e[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=()=>{let e=!1;return Tc().then(t=>{e||n(t)}),()=>{e=!0}},o=[],e[0]=a,e[1]=o):(a=e[0],o=e[1]),(0,Q.useEffect)(a,o),!t||t.managed!==null||t.importable===0)return null;let s;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(s=async e=>{if(i(!0),!await Mc(e)){i(!1);return}n({managed:e,importable:0})},e[2]=s):s=e[2];let c=s,l;e[3]===t.importable?l=e[4]:(l=(0,Z.jsx)(`p`,{className:`mb-2 text-muted-foreground`,children:(0,Z.jsx)(J,{id:`mu1O0q`,values:{0:t.importable}})}),e[3]=t.importable,e[4]=l);let u,d;e[5]===Symbol.for(`react.memo_cache_sentinel`)?(u=()=>c(!0),d=(0,Z.jsx)(J,{id:`l3s5ri`}),e[5]=u,e[6]=d):(u=e[5],d=e[6]);let f;e[7]===r?f=e[8]:(f=(0,Z.jsx)(X,{size:`sm`,className:`h-6 px-2 text-xs`,disabled:r,onClick:u,children:d}),e[7]=r,e[8]=f);let p,m;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(p=()=>c(!1),m=(0,Z.jsx)(J,{id:`PBxg_E`}),e[9]=p,e[10]=m):(p=e[9],m=e[10]);let h;e[11]===r?h=e[12]:(h=(0,Z.jsx)(X,{size:`sm`,variant:`ghost`,className:`h-6 px-2 text-xs`,disabled:r,onClick:p,children:m}),e[11]=r,e[12]=h);let g;e[13]!==f||e[14]!==h?(g=(0,Z.jsxs)(`div`,{className:`flex gap-1.5`,children:[f,h]}),e[13]=f,e[14]=h,e[15]=g):g=e[15];let _;return e[16]!==g||e[17]!==l?(_=(0,Z.jsxs)(`div`,{className:`mx-2 mb-1 rounded-md border border-border/60 bg-muted/40 p-2 text-xs`,children:[l,g]}),e[16]=g,e[17]=l,e[18]=_):_=e[18],_}var uZ=`Relaunch`,dZ=`Release notes`,fZ=`Updates paused`,pZ=`Download`,mZ=`Reset to defaults`,hZ=`Relaunching to install the update…`,gZ=`Relaunch failed — please restart manually`;function _Z(e){return`Update to ${e} didn't install.`}var vZ=`Retry`,yZ=`Download manually`,bZ=`Recovery action failed — please try again`;function xZ(e,t){let n=t instanceof Error&&t.message?t.message:``;return n?`${e}: ${n}`:e}function SZ(e){return`Version ${e} ready to install`}function CZ(e){return`Updated to Version ${e}`}function wZ(e){return`Your settings and recent projects were saved by a newer build than this one (v${e}). Reset to defaults to continue.`}var TZ=0,EZ=0,DZ=1,OZ=2,kZ=3,AZ=6e4;function jZ(e,t,n=()=>{},r=AZ,i={isEligible:()=>!1,onShown:()=>{}}){let a=[],o=new Set,s=`update-downloaded`;return a.push(e.onUpdateDownloaded(({version:r})=>{let i=s,a=()=>{t({id:i,body:SZ(r),priority:OZ,action:{label:uZ,onClick:()=>{t({id:i,body:hZ,priority:OZ,dismissible:!1}),e.update.relaunchNow().then(()=>{n(i)},e=>{a(),t({id:`relaunch-error-${r}`,body:xZ(gZ,e),variant:`error`,priority:DZ})})}}})};a()})),a.push(e.onUpdateRelaunching(()=>{t({id:s,body:hZ,priority:OZ,dismissible:!1})})),a.push(e.onUpdateRelaunchFailed(({version:r,message:i,downloadUrl:a})=>{if(a){let i=`install-failed-${r}`,o=()=>{t({id:i,body:_Z(r),variant:`error`,priority:DZ,action:{label:vZ,onClick:()=>{e.update.relaunchNow().then(()=>{n(i)},e=>{console.warn(`[update-notice] install-failed retry rejected`,e),o()})}},secondaryAction:{label:yZ,onClick:()=>{e.shell.openExternal(a)}}})};o();return}t({id:`relaunch-error-${r}`,body:i?`${gZ}: ${i}`:gZ,variant:`error`,priority:DZ})})),a.push(e.onWhatsNew(({version:a,releaseUrl:s})=>{if(i.isEligible(a)){i.onShown(a),t({id:`whats-new-combined-${a}`,body:CZ(a),variant:`success`,priority:kZ,combinedSubscribe:!0,whatsNew:{version:a,releaseUrl:s},action:{label:dZ,onClick:()=>{e.shell.openExternal(s)}}}),e.update.dismissWhatsNew(a);return}let c=`whats-new-${a}`;t({id:c,body:CZ(a),variant:`success`,priority:kZ,action:{label:dZ,onClick:()=>{e.shell.openExternal(s)}},onDismiss:()=>{e.update.dismissWhatsNew(a)}});let l=setTimeout(()=>{o.delete(l),n(c),e.update.dismissWhatsNew(a)},r);o.add(l)})),a.push(e.onWhatsNewDismissed(({version:e})=>{n(`whats-new-${e}`)})),a.push(e.onUpdateStuckHint(({downloadUrl:n})=>{t({id:`update-stuck-hint`,body:fZ,priority:EZ,action:{label:pZ,onClick:()=>{e.shell.openExternal(n)}}})})),()=>{for(let e of a)e();for(let e of o)clearTimeout(e);o.clear()}}function MZ(e,t,n,r=()=>{}){let i=`schema-incompatibility-${t.persistedSchemaVersion}`,a=`schema-incompatibility-error-${t.persistedSchemaVersion}`,o=e=>{r(i),n({id:a,body:xZ(bZ,e),variant:`error`,priority:TZ})};n({id:i,body:wZ(t.currentBuild),priority:TZ,action:{label:mZ,onClick:()=>{e.state.resetIncompatible().then(()=>{r(i)},o)}}})}var NZ=[],PZ=new Set,FZ=!1;function IZ(){for(let e of PZ)e()}function LZ(e){let t=NZ.findIndex(t=>t.id===e.id);if(t===-1)NZ=[...NZ,e];else{let n=NZ.slice();n[t]=e,NZ=n}IZ()}function RZ(e){let t=NZ.filter(t=>t.id!==e);t.length!==NZ.length&&(NZ=t,IZ())}function zZ(){return NZ}function BZ(e){return PZ.add(e),()=>{PZ.delete(e)}}function VZ(){if(FZ||typeof window>`u`)return;let e=window.okDesktop;e&&(FZ=!0,jZ(e,LZ,RZ,void 0,{isEligible:e=>gF(CF.getSnapshot(),e),onShown:e=>CF.recordShown(e)}),e.state.query().then(t=>{t.schemaIncompatibility&&MZ(e,t.schemaIncompatibility,LZ,RZ)},e=>{console.warn(`[update-notices-store] bridge.state.query() failed`,e)}))}var HZ=6e4,UZ=e=>{let t=(0,$.c)(11),{href:n,label:r,icon:i}=e,a,o;t[0]===n?(a=t[1],o=t[2]):(a=e=>hu(e,n),o=e=>hu(e,n),t[0]=n,t[1]=a,t[2]=o);let s;t[3]===i?s=t[4]:(s=(0,Z.jsx)(i,{"aria-hidden":`true`,className:`size-3.5`}),t[3]=i,t[4]=s);let c;return t[5]!==n||t[6]!==r||t[7]!==a||t[8]!==o||t[9]!==s?(c=(0,Z.jsx)(`a`,{href:n,target:`_blank`,rel:`noopener noreferrer`,onClick:a,onAuxClick:o,"aria-label":r,className:`rounded-md p-1 text-muted-foreground transition-colors hover:bg-accent hover:text-foreground`,children:s}),t[5]=n,t[6]=r,t[7]=a,t[8]=o,t[9]=s,t[10]=c):c=t[10],c};function WZ(e){let t=(0,$.c)(34),{version:n,onOpenReleaseNotes:r,onClose:i,store:a,autoDismissMs:o}=e,s=a===void 0?CF:a,c=o===void 0?HZ:o,{_:l}=an(),[u,d]=(0,Q.useState)(!1),f,p;t[0]!==c||t[1]!==i||t[2]!==u?(f=()=>{if(!u)return;let e=setTimeout(i,c);return()=>clearTimeout(e)},p=[u,i,c],t[0]=c,t[1]=i,t[2]=u,t[3]=f,t[4]=p):(f=t[3],p=t[4]),(0,Q.useEffect)(f,p);let m;t[5]===l?m=t[6]:(m=l({id:`GzPQ2f`}),t[5]=l,t[6]=m);let h;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,Z.jsx)(J,{id:`yLEyuq`}),t[7]=h):h=t[7];let g;t[8]===s?g=t[9]:(g=()=>{s.markSubscribed(),d(!0)},t[8]=s,t[9]=g);let _;t[10]!==i||t[11]!==s?(_=()=>{s.dismiss(),i()},t[10]=i,t[11]=s,t[12]=_):_=t[12];let v;t[13]!==g||t[14]!==_?(v=(0,Z.jsx)(uF,{source:`post_update_card`,compactSubmit:!0,description:h,onSuccess:g,onDismiss:_}),t[13]=g,t[14]=_,t[15]=v):v=t[15];let y;t[16]!==l||t[17]!==u?(y=u?null:(0,Z.jsxs)(`nav`,{"aria-label":l({id:`dbapvC`}),className:`mt-3 flex items-center gap-1.5 text-muted-foreground text-xs`,children:[(0,Z.jsx)(`span`,{className:`mr-0.5`,children:(0,Z.jsx)(J,{id:`9sBe85`})}),(0,Z.jsx)(UZ,{href:pF,label:l({id:`I7Exsw`}),icon:DF}),(0,Z.jsx)(UZ,{href:dF,label:l({id:`zyKa-I`}),icon:EF}),(0,Z.jsx)(UZ,{href:fF,label:l({id:`36aWJD`}),icon:TF})]}),t[16]=l,t[17]=u,t[18]=y):y=t[18];let b;t[19]!==y||t[20]!==v?(b=(0,Z.jsxs)(`div`,{className:`px-3 py-2.5`,children:[v,y]}),t[19]=y,t[20]=v,t[21]=b):b=t[21];let x;t[22]===n?x=t[23]:(x=(0,Z.jsx)(`span`,{className:`text-xs text-muted-foreground`,children:(0,Z.jsx)(J,{id:`hLy8b1`,values:{version:n}})}),t[22]=n,t[23]=x);let S;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,Z.jsx)(J,{id:`_PACVa`}),t[24]=S):S=t[24];let C;t[25]===r?C=t[26]:(C=(0,Z.jsx)(X,{variant:`link`,size:`sm`,className:`h-auto p-0 text-muted-foreground text-xs hover:text-foreground`,onClick:r,children:S}),t[25]=r,t[26]=C);let w;t[27]!==x||t[28]!==C?(w=(0,Z.jsxs)(`div`,{className:`flex items-center justify-between border-t bg-muted/30 px-3 py-2.5 space-x-2`,children:[x,C]}),t[27]=x,t[28]=C,t[29]=w):w=t[29];let T;return t[30]!==b||t[31]!==w||t[32]!==m?(T=(0,Z.jsxs)(`section`,{"aria-label":m,className:`mx-1 mb-1 overflow-hidden rounded-lg border bg-card text-card-foreground`,children:[b,w]}),t[30]=b,t[31]=w,t[32]=m,t[33]=T):T=t[33],T}function GZ(e){let t=(0,$.c)(37),{notice:n,onDismiss:r}=e,{_:i}=an(),a=n.variant===`error`?`border-destructive/60 bg-sidebar-accent/30 text-muted-foreground`:n.variant===`success`?`border-emerald-500/40 bg-emerald-500/10 text-emerald-600 dark:text-emerald-400`:`border-sidebar-border bg-sidebar-accent/30 text-muted-foreground`,o;t[0]!==i||t[1]!==n.dismissible||t[2]!==r?(o=n.dismissible===!1?null:(0,Z.jsx)(X,{variant:`ghost`,size:`icon`,className:`size-5 shrink-0 text-muted-foreground hover:text-sidebar-foreground`,"aria-label":i({id:`GUYwCr`}),onClick:r,children:(0,Z.jsx)(xs,{"aria-hidden":`true`,className:`size-3`})}),t[0]=i,t[1]=n.dismissible,t[2]=r,t[3]=o):o=t[3];let s=o,c=`shrink-0 text-xs font-medium underline underline-offset-2 ${n.variant===`success`?`decoration-emerald-500/40`:`decoration-muted-foreground/40`} hover:text-sidebar-foreground hover:decoration-sidebar-foreground`;if(n.secondaryAction){let e=`update-notice-${n.id}`,r=`flex flex-col gap-2 rounded-md border px-2 py-2 text-xs ${a}`,i;t[4]===n.body?i=t[5]:(i=(0,Z.jsx)(`span`,{className:`flex-1 leading-snug`,children:n.body}),t[4]=n.body,t[5]=i);let o;t[6]!==s||t[7]!==i?(o=(0,Z.jsxs)(`div`,{className:`flex items-start gap-2`,children:[i,s]}),t[6]=s,t[7]=i,t[8]=o):o=t[8];let l;t[9]!==c||t[10]!==n.action?(l=n.action?(0,Z.jsx)(`button`,{type:`button`,className:c,onClick:()=>{n.action?.onClick()},children:n.action.label}):null,t[9]=c,t[10]=n.action,t[11]=l):l=t[11];let u;t[12]===n.secondaryAction?u=t[13]:(u=()=>{n.secondaryAction?.onClick()},t[12]=n.secondaryAction,t[13]=u);let d;t[14]!==c||t[15]!==n.secondaryAction.label||t[16]!==u?(d=(0,Z.jsx)(`button`,{type:`button`,className:c,onClick:u,children:n.secondaryAction.label}),t[14]=c,t[15]=n.secondaryAction.label,t[16]=u,t[17]=d):d=t[17];let f;t[18]!==l||t[19]!==d?(f=(0,Z.jsxs)(`div`,{className:`flex gap-3 pl-1`,children:[l,d]}),t[18]=l,t[19]=d,t[20]=f):f=t[20];let p;return t[21]!==e||t[22]!==r||t[23]!==o||t[24]!==f?(p=(0,Z.jsxs)(`div`,{role:`status`,"aria-live":`polite`,"data-testid":e,className:r,children:[o,f]}),t[21]=e,t[22]=r,t[23]=o,t[24]=f,t[25]=p):p=t[25],p}let l=`update-notice-${n.id}`,u=`flex items-center gap-2 rounded-md border px-2 py-1.5 text-xs ${a}`,d;t[26]===n.body?d=t[27]:(d=(0,Z.jsx)(`span`,{className:`flex-1 leading-snug`,children:n.body}),t[26]=n.body,t[27]=d);let f;t[28]!==c||t[29]!==n.action?(f=n.action?(0,Z.jsx)(`button`,{type:`button`,className:c,onClick:()=>{n.action?.onClick()},children:n.action.label}):null,t[28]=c,t[29]=n.action,t[30]=f):f=t[30];let p;return t[31]!==s||t[32]!==l||t[33]!==u||t[34]!==d||t[35]!==f?(p=(0,Z.jsxs)(`div`,{role:`status`,"aria-live":`polite`,"data-testid":l,className:u,children:[d,f,s]}),t[31]=s,t[32]=l,t[33]=u,t[34]=d,t[35]=f,t[36]=p):p=t[36],p}function KZ(e){if(e.length===0)return null;let t=e[0];if(!t)return null;for(let n=1;n<e.length;n++){let r=e[n];r&&r.priority<t.priority&&(t=r)}return t}function qZ(){let e=(0,$.c)(15),t=(0,Q.useSyncExternalStore)(BZ,zZ,zZ),n;e[0]===t?n=e[1]:(n=KZ(t),e[0]=t,e[1]=n);let r=n;if(!r)return null;if(r.combinedSubscribe&&r.whatsNew){let t;e[2]===r.action?t=e[3]:(t=()=>r.action?.onClick(),e[2]=r.action,e[3]=t);let n;e[4]===r.id?n=e[5]:(n=()=>RZ(r.id),e[4]=r.id,e[5]=n);let i;return e[6]!==r.whatsNew.version||e[7]!==t||e[8]!==n?(i=(0,Z.jsx)(`div`,{"data-testid":`update-notices-list`,children:(0,Z.jsx)(WZ,{version:r.whatsNew.version,onOpenReleaseNotes:t,onClose:n})}),e[6]=r.whatsNew.version,e[7]=t,e[8]=n,e[9]=i):i=e[9],i}let i;e[10]===r?i=e[11]:(i=()=>{r.onDismiss?.(),RZ(r.id)},e[10]=r,e[11]=i);let a;return e[12]!==r||e[13]!==i?(a=(0,Z.jsx)(`div`,{"data-testid":`update-notices-list`,children:(0,Z.jsx)(GZ,{notice:r,onDismiss:i})}),e[12]=r,e[13]=i,e[14]=a):a=e[14],a}function JZ(e,t){return e?.kind===`doc`||e?.kind===`folder-index`?aa(t.contentDir,ca(e.docName),t.pathSeparator):e?.kind===`folder`?aa(t.contentDir,e.folderPath,t.pathSeparator):e?.kind===`asset`?aa(t.contentDir,e.assetPath,t.pathSeparator):t.contentDir}function YZ(e){return e?.kind===`doc`||e?.kind===`folder-index`?ca(e.docName):e?.kind===`folder`?e.folderPath:e?.kind===`asset`?e.assetPath:``}function XZ(e,t){return e===null?Oa({workspace:t}):e.kind===`folder`?t?la({folderRelativePath:e.folderPath,workspace:t}):null:e.kind===`doc`||e.kind===`folder-index`?Ta({docName:e.docName,workspace:t}):null}var ZZ={folderCount:0,expandedCount:0},QZ=`button, [role="button"], [role="menuitem"], input, textarea, select, a[href]`;function $Z(e){return typeof Element>`u`||!(e instanceof Element)?!1:e.closest(QZ)!==null}function eQ(e){let t=(0,$.c)(2),{onOpenSearch:n}=e,r;return t[0]===n?r=t[1]:(r=(0,Z.jsx)(vl,{name:`file-sidebar`,children:(0,Z.jsx)(rQ,{onOpenSearch:n})}),t[0]=n,t[1]=r),r}var tQ=e=>{let t=(0,$.c)(15),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({icon:n,label:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===n?a=t[5]:(a=(0,Z.jsx)(n,{"aria-hidden":`true`}),t[4]=n,t[5]=a);let o;t[6]!==r||t[7]!==i||t[8]!==a?(o=(0,Z.jsx)(As,{asChild:!0,children:(0,Z.jsx)(X,{variant:`ghost`,size:`icon-sm`,"aria-label":r,...i,children:a})}),t[6]=r,t[7]=i,t[8]=a,t[9]=o):o=t[9];let s;t[10]===r?s=t[11]:(s=(0,Z.jsx)(js,{children:r}),t[10]=r,t[11]=s);let c;return t[12]!==o||t[13]!==s?(c=(0,Z.jsxs)(Ns,{children:[o,s]}),t[12]=o,t[13]=s,t[14]=c):c=t[14],c},nQ=e=>{let t=(0,$.c)(15),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({icon:n,label:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===n?a=t[5]:(a=(0,Z.jsx)(n,{"aria-hidden":`true`}),t[4]=n,t[5]=a);let o;t[6]!==r||t[7]!==i||t[8]!==a?(o=(0,Z.jsx)(As,{asChild:!0,children:(0,Z.jsx)(bc,{asChild:!0,children:(0,Z.jsx)(X,{variant:`ghost`,size:`icon-sm`,"aria-label":r,...i,children:a})})}),t[6]=r,t[7]=i,t[8]=a,t[9]=o):o=t[9];let s;t[10]===r?s=t[11]:(s=(0,Z.jsx)(js,{children:r}),t[10]=r,t[11]=s);let c;return t[12]!==o||t[13]!==s?(c=(0,Z.jsxs)(Ns,{children:[o,s]}),t[12]=o,t[13]=s,t[14]=c):c=t[14],c};function rQ(e){let t=(0,$.c)(208),{onOpenSearch:n}=e,{_:r}=an(),[i,a]=(0,Q.useState)(null),[o,s]=(0,Q.useState)(null),{activeDocName:c,activeTarget:l}=vt(),u;t[0]!==c||t[1]!==l?(u=l?.kind===`folder`||l?.kind===`folder-index`?l.folderPath:ll(c),t[0]=c,t[1]=l,t[2]=u):u=t[2];let d=u,[f,p]=(0,Q.useState)(!1),m=f?``:d,h=typeof window<`u`&&window.okDesktop!=null,{state:_,toggleSidebar:v}=Vj(),y=ga(),b=_===`expanded`,x=h&&_===`collapsed`,[S,C]=(0,Q.useState)(ZZ),w,T;t[3]===i?(w=t[4],T=t[5]):(w=()=>{if(i===null)return;let e=()=>{C(i.getFolderState()),p(i.isCreationTargetCleared())};return e(),i.subscribe(e)},T=[i],t[3]=i,t[4]=w,t[5]=T),(0,Q.useEffect)(w,T);let E,D;t[6]===i?(E=t[7],D=t[8]):(E=()=>{if(i!==null)return MS(e=>{let t=e.initialDir??``;if(e.template){i.createFromTemplate(e.template.folder,e.template.name);return}i.startCreating(`file`,t)})},D=[i],t[6]=i,t[7]=E,t[8]=D),(0,Q.useEffect)(E,D);let O=S.folderCount>0,k=O&&S.expandedCount===S.folderCount,A=S.expandedCount===0,j=_o(``),M=_o(m===``?null:m),N=m===``?j:M,P=j.state.status===`ready`?(j.state.data.folder.templates_available?.length??0)>0:!0,F=N.state.status===`ready`?(N.state.data.folder.templates_available?.length??0)>0:!0,I=typeof window<`u`?window.okDesktop:void 0,L=ia(),{status:R}=Pi(),z=R?.hasRemote===!0,B;t[9]!==r||t[10]!==L?.contentDir?(B=I?.config?.projectName||L?.contentDir.split(`/`).filter(Boolean).pop()||r({id:`sER-bs`}),t[9]=r,t[10]=L?.contentDir,t[11]=B):B=t[11];let V=B,H=va().states,{dispatch:U}=Ea(),W;t[12]===L?W=t[13]:(W=Oa({workspace:L}),t[12]=L,t[13]=W);let G=W,{projectLocalBinding:K,merged:ee}=zo(),te=ee?.appearance?.sidebar?.showHiddenFiles??!1,ne=O&&!k,re=O&&!A,ie=ne||re,ae=cQ,oe;t[14]!==i||t[15]!==L?(oe=()=>{L&&i?.startCreating(`file`,``)},t[14]=i,t[15]=L,t[16]=oe):oe=t[16];let se=oe,ce;t[17]!==i||t[18]!==L?(ce=e=>{L&&i?.createFromTemplate(``,e)},t[17]=i,t[18]=L,t[19]=ce):ce=t[19];let le=ce,q;t[20]!==i||t[21]!==L?(q=()=>{L&&i?.startCreating(`folder`,``)},t[20]=i,t[21]=L,t[22]=q):q=t[22];let ue=q,de;t[23]===L?de=t[24]:(de=()=>{!L||!I||I.shell.showItemInFolder(L.contentDir)},t[23]=L,t[24]=de);let fe=de,pe;t[25]!==r||t[26]!==L?(pe=async()=>{if(L)try{await navigator.clipboard.writeText(L.contentDir),bs.success(r({id:`6_ZOw4`}),{description:L.contentDir})}catch(e){console.warn(`[FileSidebar] clipboard write failed:`,e),bs.error(r({id:`vfRlCI`}))}},t[25]=r,t[26]=L,t[27]=pe):pe=t[27];let me=pe,he;t[28]!==r||t[29]!==z?(he=()=>{Ia({...Na(``),hasRemote:z,onClickWhenNoRemote:()=>{bs.error(r({id:`WyQxwa`}))}},{clipboardWrite:xa,toastSuccess:sQ,toastError:oQ,logEvent:aQ})},t[28]=r,t[29]=z,t[30]=he):he=t[30];let ge=he,_e;t[31]!==r||t[32]!==K?(_e=e=>{if(K===null)return;let t=K.patch({appearance:{sidebar:{showHiddenFiles:e}}});t.ok||(console.warn(`[FileSidebar] showHiddenFiles toggle rejected:`,Bn(t.error)),bs.error(r({id:`P47EWZ`}),{description:Bn(t.error)}))},t[31]=r,t[32]=K,t[33]=_e):_e=t[33];let ve=_e,ye;t[34]===i?ye=t[35]:(ye=()=>{i?.expandAll()},t[34]=i,t[35]=ye);let be=ye,xe;t[36]===i?xe=t[37]:(xe=()=>{i?.collapseAll()},t[36]=i,t[37]=xe);let Se=xe,Ce,we;t[38]!==re||t[39]!==ne||t[40]!==te||t[41]!==_?(Ce=()=>{I&&I.editor.notifyViewMenuStateChanged({showHiddenFiles:te,canExpandAll:ne,canCollapseAll:re,sidebarVisible:_===`expanded`})},we=[I,te,ne,re,_],t[38]=re,t[39]=ne,t[40]=te,t[41]=_,t[42]=Ce,t[43]=we):(Ce=t[42],we=t[43]),(0,Q.useEffect)(Ce,we);let Te,Ee;t[44]!==r||t[45]!==l||t[46]!==U||t[47]!==H||t[48]!==m||t[49]!==K||t[50]!==te||t[51]!==v||t[52]!==i||t[53]!==L?(Te=()=>{if(I)return I.onMenuAction(e=>{switch(e){case`new-doc`:if(!L||!i)return;i.startCreating(`file`,m);return;case`new-folder`:if(!L||!i)return;i.startCreating(`folder`,m);return;case`new-from-template`:if(!L||!i)return;i.startCreatingFromTemplate(m);return;case`rename`:if(!l)return;uJ(l);return;case`duplicate`:if(!l)return;fJ(l);return;case`move-to-trash`:if(!l)return;cJ(l);return;case`reveal-in-finder`:{if(!I||!L)return;let e=JZ(l,L);I.shell.showItemInFolder(e);return}case`send-to-ai`:{let e=oa.filter(e=>H[e.id]?.installed===!0);if(e.length===0){bs.error(r({id:`LKOLNn`}));return}let t=XZ(l,L);if(!t)return;let[n]=e;if(!n)return;U(n.id,t);return}case`copy-full-path`:{if(!L)return;let e=JZ(l,L);navigator.clipboard.writeText(e).then(()=>bs.success(r({id:`6_ZOw4`}),{description:e})).catch(e=>{console.warn(`[FileSidebar] clipboard write failed:`,e),bs.error(r({id:`vfRlCI`}))});return}case`copy-relative-path`:{let e=YZ(l);if(e===``){bs.error(r({id:`74eHt-`}));return}navigator.clipboard.writeText(e).then(()=>bs.success(r({id:`haHgQj`}),{description:e})).catch(e=>{console.warn(`[FileSidebar] clipboard write failed:`,e),bs.error(r({id:`5QGTaA`}))});return}case`toggle-show-hidden-files`:{if(K===null)return;let e=K.patch({appearance:{sidebar:{showHiddenFiles:!te}}});e.ok||(console.warn(`[FileSidebar] toggle-show-hidden-files rejected:`,Bn(e.error)),bs.error(r({id:`P47EWZ`}),{description:Bn(e.error)}));return}case`expand-all-tree`:i?.expandAll();return;case`collapse-all-tree`:i?.collapseAll();return;case`toggle-sidebar`:v();return;case`delete`:case`toggle-source`:case`save-version`:case`version-history`:case`focus-search`:case`focus-command-palette`:case`close-active-tab-or-window`:case`toggle-doc-panel`:return}})},Ee=[I,i,L,l,m,K,te,H,U,v,r],t[44]=r,t[45]=l,t[46]=U,t[47]=H,t[48]=m,t[49]=K,t[50]=te,t[51]=v,t[52]=i,t[53]=L,t[54]=Te,t[55]=Ee):(Te=t[54],Ee=t[55]),(0,Q.useEffect)(Te,Ee);let De=h&&b&&`motion-safe:delay-100`,Oe=x&&`opacity-0`,ke;t[56]!==De||t[57]!==Oe?(ke=Y(`flex-row h-12 items-center py-0 px-3`,`justify-between`,h&&`overflow-x-clip`,h&&`motion-safe:transition-opacity motion-safe:duration-100 motion-safe:ease-out`,De,Oe,h&&`[-webkit-app-region:drag]`),t[56]=De,t[57]=Oe,t[58]=ke):ke=t[58];let Ae;t[59]===Symbol.for(`react.memo_cache_sentinel`)?(Ae=h?(0,Z.jsx)(`div`,{"aria-hidden":`true`,"data-testid":`sidebar-traffic-light-reserve`,className:`w-[var(--ok-titlebar-reserve-left,0px)] shrink-0 self-stretch`}):null,t[59]=Ae):Ae=t[59];let je;t[60]===b?je=t[61]:(je=b&&!h?(0,Z.jsx)(`span`,{className:`shrink-0 font-mono text-sm uppercase tracking-wider text-sidebar-foreground/50`,children:(0,Z.jsx)(J,{id:`sER-bs`})}):null,t[60]=b,t[61]=je);let Me;t[62]===Symbol.for(`react.memo_cache_sentinel`)?(Me=Y(`flex items-center gap-1`,h&&`[&>*]:[-webkit-app-region:no-drag]`),t[62]=Me):Me=t[62];let Ne;t[63]!==r||t[64]!==k||t[65]!==O||t[66]!==A||t[67]!==i?(Ne=O?(0,Z.jsxs)(Ac,{children:[(0,Z.jsx)(nQ,{icon:$d,label:r({id:`Rq1vFD`})}),(0,Z.jsxs)(wc,{align:`end`,className:`min-w-52`,children:[k?null:(0,Z.jsxs)(Sc,{onSelect:()=>i?.expandAll(),children:[(0,Z.jsx)(Vf,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`OlAl5i`})]}),A?null:(0,Z.jsxs)(Sc,{onSelect:()=>i?.collapseAll(),children:[(0,Z.jsx)(Vd,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`qvWGzP`})]})]})]}):null,t[63]=r,t[64]=k,t[65]=O,t[66]=A,t[67]=i,t[68]=Ne):Ne=t[68];let Pe;t[69]===r?Pe=t[70]:(Pe=r({id:`HdkSiO`}),t[69]=r,t[70]=Pe);let Fe;t[71]!==m||t[72]!==i?(Fe=()=>i?.startCreating(`file`,m),t[71]=m,t[72]=i,t[73]=Fe):Fe=t[73];let Ie;t[74]!==Pe||t[75]!==Fe?(Ie=(0,Z.jsx)(tQ,{icon:Df,label:Pe,onClick:Fe}),t[74]=Pe,t[75]=Fe,t[76]=Ie):Ie=t[76];let Le;t[77]!==r||t[78]!==F||t[79]!==m||t[80]!==i?(Le=F?(0,Z.jsxs)(Ac,{children:[(0,Z.jsx)(nQ,{icon:no,label:r({id:`Uuj_R4`})}),(0,Z.jsx)(wc,{align:`end`,className:`min-w-52`,children:(0,Z.jsx)(tJ,{parentDir:m,onSelectTemplate:e=>i?.createFromTemplate(m,e),ItemComponent:Sc})})]}):null,t[77]=r,t[78]=F,t[79]=m,t[80]=i,t[81]=Le):Le=t[81];let Re;t[82]===r?Re=t[83]:(Re=r({id:`96G6Re`}),t[82]=r,t[83]=Re);let ze;t[84]!==m||t[85]!==i?(ze=()=>i?.startCreating(`folder`,m),t[84]=m,t[85]=i,t[86]=ze):ze=t[86];let Be;t[87]!==Re||t[88]!==ze?(Be=(0,Z.jsx)(tQ,{icon:Ud,label:Re,onClick:ze}),t[87]=Re,t[88]=ze,t[89]=Be):Be=t[89];let Ve;t[90]!==Ne||t[91]!==Ie||t[92]!==Le||t[93]!==Be?(Ve=(0,Z.jsxs)(`div`,{"data-testid":`sidebar-toolbar`,className:Me,children:[Ne,Ie,Le,Be]}),t[90]=Ne,t[91]=Ie,t[92]=Le,t[93]=Be,t[94]=Ve):Ve=t[94];let He;t[95]!==ke||t[96]!==je||t[97]!==Ve?(He=(0,Z.jsxs)(Yj,{"data-electron-drag":h?``:void 0,className:ke,children:[Ae,je,Ve]}),t[95]=ke,t[96]=je,t[97]=Ve,t[98]=He):He=t[98];let Ue=h&&b&&`motion-safe:delay-100`,We=x&&`opacity-0`,Ge;t[99]!==Ue||t[100]!==We?(Ge=Y(`px-2 pb-2`,h&&`[-webkit-app-region:no-drag]`,h&&`motion-safe:transition-opacity motion-safe:duration-100 motion-safe:ease-out`,Ue,We),t[99]=Ue,t[100]=We,t[101]=Ge):Ge=t[101];let Ke;t[102]===_?Ke=t[103]:(Ke=[_],t[102]=_,t[103]=Ke);let qe;t[104]===n?qe=t[105]:(qe=(0,Z.jsx)(tZ,{onClick:n}),t[104]=n,t[105]=qe);let Je;t[106]!==Ke||t[107]!==qe?(Je=(0,Z.jsx)(g,{fallbackRender:iQ,onError:eZ,resetKeys:Ke,children:qe}),t[106]=Ke,t[107]=qe,t[108]=Je):Je=t[108];let Ye;t[109]!==Ge||t[110]!==Je?(Ye=(0,Z.jsx)(`div`,{className:Ge,children:Je}),t[109]=Ge,t[110]=Je,t[111]=Ye):Ye=t[111];let Xe;t[112]===Symbol.for(`react.memo_cache_sentinel`)?(Xe=(0,Z.jsx)(RI,{}),t[112]=Xe):Xe=t[112];let Ze;t[113]===Symbol.for(`react.memo_cache_sentinel`)?(Ze=(0,Z.jsx)(Bo,{className:`size-3.5 shrink-0`}),t[113]=Ze):Ze=t[113];let Qe;t[114]===V?Qe=t[115]:(Qe=(0,Z.jsx)(`span`,{className:`truncate`,children:V}),t[114]=V,t[115]=Qe);let $e;t[116]===Symbol.for(`react.memo_cache_sentinel`)?($e=(0,Z.jsx)(Zi,{className:`size-3.5 shrink-0 text-muted-foreground transition-transform group-data-[state=open]/files:rotate-90`}),t[116]=$e):$e=t[116];let et;t[117]===Qe?et=t[118]:(et=(0,Z.jsx)($j,{asChild:!0,className:`shrink-0`,children:(0,Z.jsxs)(Is,{"data-sidebar-root-context":!0,className:`flex w-full items-center gap-1.5`,children:[Ze,Qe,$e]})}),t[117]=Qe,t[118]=et);let tt=o==null?`50vh`:`${o}px`,nt;t[119]===tt?nt=t[120]:(nt={height:tt},t[119]=tt,t[120]=nt);let rt;t[121]===Symbol.for(`react.memo_cache_sentinel`)?(rt=(0,Z.jsx)(DY,{ref:a,onContentHeightChange:s}),t[121]=rt):rt=t[121];let it;t[122]===nt?it=t[123]:(it=(0,Z.jsx)(Fs,{className:`flex max-h-[70vh] flex-col overflow-hidden`,style:nt,children:rt}),t[122]=nt,t[123]=it);let at;t[124]!==et||t[125]!==it?(at=(0,Z.jsx)(Ls,{defaultOpen:!0,className:`group/files flex shrink-0 flex-col`,children:(0,Z.jsxs)(Qj,{className:`min-h-0 px-0`,children:[et,it]})}),t[124]=et,t[125]=it,t[126]=at):at=t[126];let ot;t[127]===Symbol.for(`react.memo_cache_sentinel`)?(ot=(0,Z.jsx)(nZ,{}),t[127]=ot):ot=t[127];let st;t[128]===i?st=t[129]:(st=(0,Z.jsx)(`div`,{"aria-hidden":!0,"data-sidebar-empty-deselect":!0,className:`min-h-8 flex-1 cursor-default`,onClick:()=>i?.clearCreationTarget()}),t[128]=i,t[129]=st);let ct;t[130]!==at||t[131]!==st?(ct=(0,Z.jsxs)(Zj,{children:[Xe,at,ot,st]}),t[130]=at,t[131]=st,t[132]=ct):ct=t[132];let lt;t[133]===Symbol.for(`react.memo_cache_sentinel`)?(lt=(0,Z.jsxs)(Xj,{className:`px-0`,children:[(0,Z.jsx)(CX,{}),(0,Z.jsx)(qZ,{}),typeof window<`u`&&window.okDesktop?(0,Z.jsx)(nM,{children:(0,Z.jsx)(rM,{children:(0,Z.jsx)(GX,{bridge:window.okDesktop})})}):null]}),t[133]=lt):lt=t[133];let ut=!(y&&_===`collapsed`),dt;t[134]===ut?dt=t[135]:(dt=(0,Z.jsx)(qj,{enableToggle:!1,enableDrag:ut}),t[134]=ut,t[135]=dt);let ft;t[136]!==He||t[137]!==Ye||t[138]!==ct||t[139]!==dt?(ft=(0,Z.jsx)(cP,{asChild:!0,children:(0,Z.jsxs)(`div`,{className:`contents`,onContextMenu:ae,children:[He,Ye,ct,lt,dt]})}),t[136]=He,t[137]=Ye,t[138]=ct,t[139]=dt,t[140]=ft):ft=t[140];let pt=!L,mt,ht;t[141]===Symbol.for(`react.memo_cache_sentinel`)?(mt=(0,Z.jsx)(Df,{"aria-hidden":`true`}),ht=(0,Z.jsx)(J,{id:`HdkSiO`}),t[141]=mt,t[142]=ht):(mt=t[141],ht=t[142]);let gt;t[143]!==se||t[144]!==pt?(gt=(0,Z.jsxs)(fP,{disabled:pt,onSelect:se,"data-testid":`empty-space-menu-new-file`,children:[mt,ht]}),t[143]=se,t[144]=pt,t[145]=gt):gt=t[145];let _t;t[146]!==le||t[147]!==P||t[148]!==L?(_t=P?(0,Z.jsxs)(uP,{children:[(0,Z.jsxs)(pP,{disabled:!L,"data-testid":`empty-space-menu-new-from-template`,children:[(0,Z.jsx)(no,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`Uuj_R4`})]}),(0,Z.jsx)(mP,{children:(0,Z.jsx)(tJ,{parentDir:``,onSelectTemplate:le,ItemComponent:fP})})]}):null,t[146]=le,t[147]=P,t[148]=L,t[149]=_t):_t=t[149];let yt=!L,bt,xt;t[150]===Symbol.for(`react.memo_cache_sentinel`)?(bt=(0,Z.jsx)(Ud,{"aria-hidden":`true`}),xt=(0,Z.jsx)(J,{id:`96G6Re`}),t[150]=bt,t[151]=xt):(bt=t[150],xt=t[151]);let St;t[152]!==ue||t[153]!==yt?(St=(0,Z.jsxs)(fP,{disabled:yt,onSelect:ue,"data-testid":`empty-space-menu-new-folder`,children:[bt,xt]}),t[152]=ue,t[153]=yt,t[154]=St):St=t[154];let Ct;t[155]===Symbol.for(`react.memo_cache_sentinel`)?(Ct=(0,Z.jsx)(_P,{}),t[155]=Ct):Ct=t[155];let wt;t[156]!==r||t[157]!==fe||t[158]!==L?(wt=I?(0,Z.jsxs)(fP,{disabled:!L,onSelect:fe,"data-testid":`empty-space-menu-reveal-in-finder`,"aria-label":r(L?{id:`LtSYdi`}:{id:`o2yoFu`}),children:[(0,Z.jsx)(Bo,{"aria-hidden":`true`}),(0,Z.jsx)(`span`,{className:`flex-1`,children:(0,Z.jsx)(J,{id:`LtSYdi`})}),L?null:(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:(0,Z.jsx)(J,{id:`wTcjov`})})]}):null,t[156]=r,t[157]=fe,t[158]=L,t[159]=wt):wt=t[159];let Tt;t[160]!==U||t[161]!==G||t[162]!==H?(Tt=(0,Z.jsx)(dX,{input:G,installStates:H,dispatch:U}),t[160]=U,t[161]=G,t[162]=H,t[163]=Tt):Tt=t[163];let Et;t[164]!==ge||t[165]!==z?(Et=z?(0,Z.jsxs)(fP,{onSelect:ge,"data-testid":`empty-space-menu-share`,children:[(0,Z.jsx)(Cf,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`Z8lGw6`})]}):null,t[164]=ge,t[165]=z,t[166]=Et):Et=t[166];let Dt=!L,Ot;t[167]!==r||t[168]!==L?(Ot=r(L?{id:`Up2_7p`}:{id:`U8CD-l`}),t[167]=r,t[168]=L,t[169]=Ot):Ot=t[169];let kt;t[170]===Symbol.for(`react.memo_cache_sentinel`)?(kt=(0,Z.jsx)(Eo,{"aria-hidden":`true`}),t[170]=kt):kt=t[170];let At;t[171]===Symbol.for(`react.memo_cache_sentinel`)?(At=(0,Z.jsx)(`span`,{className:`flex-1`,children:(0,Z.jsx)(J,{id:`Up2_7p`})}),t[171]=At):At=t[171];let jt;t[172]===L?jt=t[173]:(jt=L?null:(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`ml-2 text-muted-foreground text-xs`,children:(0,Z.jsx)(J,{id:`wTcjov`})}),t[172]=L,t[173]=jt);let Mt;t[174]!==me||t[175]!==Dt||t[176]!==Ot||t[177]!==jt?(Mt=(0,Z.jsxs)(fP,{disabled:Dt,onSelect:me,"data-testid":`empty-space-menu-copy-full-path`,"aria-label":Ot,children:[kt,At,jt]}),t[174]=me,t[175]=Dt,t[176]=Ot,t[177]=jt,t[178]=Mt):Mt=t[178];let Nt;t[179]===Symbol.for(`react.memo_cache_sentinel`)?(Nt=(0,Z.jsx)(_P,{}),t[179]=Nt):Nt=t[179];let Pt=K===null,Ft;t[180]===Symbol.for(`react.memo_cache_sentinel`)?(Ft=(0,Z.jsx)(J,{id:`XcGbim`}),t[180]=Ft):Ft=t[180];let It;t[181]!==ve||t[182]!==te||t[183]!==Pt?(It=(0,Z.jsx)(hP,{checked:te,onCheckedChange:ve,disabled:Pt,"data-testid":`empty-space-menu-show-hidden-files`,children:Ft}),t[181]=ve,t[182]=te,t[183]=Pt,t[184]=It):It=t[184];let Lt;t[185]===ie?Lt=t[186]:(Lt=ie?(0,Z.jsx)(_P,{}):null,t[185]=ie,t[186]=Lt);let Rt;t[187]!==be||t[188]!==ne?(Rt=ne?(0,Z.jsxs)(fP,{onSelect:be,"data-testid":`empty-space-menu-expand-all`,children:[(0,Z.jsx)(Vf,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`OlAl5i`})]}):null,t[187]=be,t[188]=ne,t[189]=Rt):Rt=t[189];let zt;t[190]!==Se||t[191]!==re?(zt=re?(0,Z.jsxs)(fP,{onSelect:Se,"data-testid":`empty-space-menu-collapse-all`,children:[(0,Z.jsx)(Vd,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`qvWGzP`})]}):null,t[190]=Se,t[191]=re,t[192]=zt):zt=t[192];let Bt;t[193]!==gt||t[194]!==_t||t[195]!==St||t[196]!==wt||t[197]!==Tt||t[198]!==Et||t[199]!==Mt||t[200]!==It||t[201]!==Lt||t[202]!==Rt||t[203]!==zt?(Bt=(0,Z.jsxs)(dP,{className:`min-w-52`,children:[gt,_t,St,Ct,wt,Tt,Et,Mt,Nt,It,Lt,Rt,zt]}),t[193]=gt,t[194]=_t,t[195]=St,t[196]=wt,t[197]=Tt,t[198]=Et,t[199]=Mt,t[200]=It,t[201]=Lt,t[202]=Rt,t[203]=zt,t[204]=Bt):Bt=t[204];let Vt;return t[205]!==ft||t[206]!==Bt?(Vt=(0,Z.jsx)(Gj,{variant:`inset`,children:(0,Z.jsxs)(sP,{children:[ft,Bt]})}),t[205]=ft,t[206]=Bt,t[207]=Vt):Vt=t[207],Vt}function iQ(){return null}function aQ(e){return console.log(e)}function oQ(e){return bs.error(e)}function sQ(e){return bs.success(e)}function cQ(e){e.target instanceof Element&&e.target.closest(`[data-sidebar-root-context]`)||$Z(e.target)&&(e.preventDefault(),e.stopPropagation())}var lQ=(0,Q.lazy)(()=>n(()=>import(`./McpConsentDialogBody-BKvKmtg_.js`),__vite__mapDeps([94,1,10,3,11,6,7,74,20,15,13,16,57,58,55,56,76,19,30,63,39,95]),import.meta.url));function uQ(){let e=(0,$.c)(1);if(!(0,Q.useSyncExternalStore)($u.subscribe,fQ,dQ))return null;let t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Z.jsx)(Q.Suspense,{fallback:null,children:(0,Z.jsx)(lQ,{})}),e[0]=t):t=e[0],t}function dQ(){return!1}function fQ(){return $u.getSnapshot()!==null}function pQ(){let e=(0,$.c)(17),t=Mn(),{collabUrl:n,setSystemProvider:r,updateServerInstanceId:i,onBranchSwitched:a,observeBranch:o,observeDiskAck:s,refreshServerInfo:c}=vt(),l;e[0]!==o||e[1]!==s||e[2]!==a||e[3]!==c||e[4]!==i?(l={updateServerInstanceId:i,onBranchSwitched:a,observeBranch:o,observeDiskAck:s,refreshServerInfo:c},e[0]=o,e[1]=s,e[2]=a,e[3]=c,e[4]=i,e[5]=l):l=e[5];let u=(0,Q.useRef)(l),d;e[6]!==o||e[7]!==s||e[8]!==a||e[9]!==c||e[10]!==i?(d=()=>{u.current={updateServerInstanceId:i,onBranchSwitched:a,observeBranch:o,observeDiskAck:s,refreshServerInfo:c}},e[6]=o,e[7]=s,e[8]=a,e[9]=c,e[10]=i,e[11]=d):d=e[11],(0,Q.useEffect)(d);let f,p;return e[12]!==n||e[13]!==t||e[14]!==r?(f=()=>{if(n===null)return;let e=new Io,i=new Po({url:n,name:Wr,document:e,onStateless:e=>{let{payload:t}=e;yt(t,{onServerInfo:e=>{u.current.updateServerInstanceId(e.serverInstanceId),e.currentBranch!==void 0&&u.current.observeBranch(e.currentBranch)},onBranchSwitched:e=>{u.current.onBranchSwitched(e.branch)},onDiskAck:e=>{u.current.observeDiskAck(e.docName,e.sv)},onDerivedView:yQ,onConfigValidationRejected:vQ,onConfigIgnoreNestedError:_Q,onUnknown:gQ})},onClose:hQ,onDisconnect:mQ}),a=ml(e=>{(e.includes(`files`)||e.includes(`backlinks`))&&(t.invalidateQueries({queryKey:[`backlinks`]}),t.invalidateQueries({queryKey:[`forward-links`]})),(e.includes(`files`)||e.includes(`graph`))&&(t.invalidateQueries({queryKey:[`orphans`]}),t.invalidateQueries({queryKey:[`hubs`]}))}),o=tt(()=>{u.current.refreshServerInfo()});i.on(`synced`,()=>{pl([`files`,`backlinks`,`graph`]),o()});let s=new Set,c=()=>{if(i.awareness)for(let[e,t]of i.awareness.getStates().entries())s.has(e)||t.user?.type===`agent`&&(s.add(e),console.warn(`[agent-presence] observed stale AwarenessUser.type === 'agent' from clientID ${e} — probably a stale bundled client`))};return i.awareness?.on(`change`,c),r(i),()=>{a(),i.awareness?.off(`change`,c),r(null),i.destroy(),e.destroy()}},p=[t,n,r],e[12]=n,e[13]=t,e[14]=r,e[15]=f,e[16]=p):(f=e[15],p=e[16]),(0,Q.useEffect)(f,p),null}function mQ(){console.warn(`[CC1] __system__ disconnected - derived views may be stale`)}function hQ(e){let{event:t}=e;console.warn(`[CC1] __system__ connection closed:`,t.code,t.reason)}function gQ(e){console.warn(`[CC1] Unparseable stateless payload, skipping:`,e.slice(0,100))}function _Q(e){Qa(e)}function vQ(e){ho(e)}function yQ(e){pl([e.ch])}function bQ(e){let t=K(e);if(t)return{scope:`project`,name:t};let n=Or(e);return n?.kind===`skill`?{scope:n.scope,name:n.name}:null}function xQ(e,t){let n=new Set(t.map(e=>`${e.scope}\u0000${e.name}`)),r=[];for(let t of e){let e=bQ(t);if(!e||n.has(`${e.scope}\u0000${e.name}`))continue;let i=e.scope===`project`?`global`:`project`;n.has(`${i}\u0000${e.name}`)?r.push({kind:`retarget`,fromDocName:t,toDocName:fr(i,e.name)}):r.push({kind:`close`,docName:t})}return r}function SQ(){let e=(0,$.c)(13),{openTabs:t,closeDocument:n}=vt(),r;e[0]===t?r=e[1]:(r=t.some(wQ),e[0]=t,e[1]=r);let i=r,a;e[2]===i?a=e[3]:(a={enabled:i},e[2]=i,e[3]=a);let o=ha(a),s=(0,Q.useRef)(null),c;e[4]!==n||e[5]!==t||e[6]!==o.data||e[7]!==o.status?(c=()=>{if(o.status!==`ready`)return;let e=o.data,r=`${t.join(``)}\u0002${e.map(CQ).sort().join(``)}`;if(s.current===r)return;s.current=r;let i=xQ(t,e);for(let e of i)e.kind===`retarget`?($o(e.toDocName),n(e.fromDocName)):n(e.docName)},e[4]=n,e[5]=t,e[6]=o.data,e[7]=o.status,e[8]=c):c=e[8];let l;e[9]!==n||e[10]!==t||e[11]!==o?(l=[o,t,n],e[9]=n,e[10]=t,e[11]=o,e[12]=l):l=e[12],(0,Q.useEffect)(c,l)}function CQ(e){return`${e.scope}\u0000${e.name}`}function wQ(e){return bQ(e)!==null}var TQ=1e3,EQ=3e4;function DQ(e){let t=e.scheduler??{setTimeout:(e,t)=>globalThis.setTimeout(e,t),clearTimeout:e=>globalThis.clearTimeout(e)},n=e.initialBackoffMs??TQ,r=e.maxBackoffMs??EQ,i=e.rng??Math.random,a=e.createWebSocket??(e=>new WebSocket(e)),o=e.logger??null,s=e.log,c=null,l=null,u=!1,d=n;function f(e,t,n){try{o?o[e](t,n):s?.(t)}catch{}}function p(){if(u)return;l!==null&&t.clearTimeout(l);let e=d;d=Math.min(d*2,r);let n=i(),a=Math.max(1,Math.floor(e*(1-n/2)));f(`debug`,`scheduling reconnect`,{backoffMs:a,ceilMs:e}),l=t.setTimeout(()=>{l=null,m().catch(e=>f(`warn`,`reconnect failed`,{error:String(e)}))},a)}async function m(){if(u)return;let t;try{t=await e.resolveWsUrl()}catch(e){f(`warn`,`resolveWsUrl threw`,{error:String(e)}),p();return}if(!t){p();return}let r=[];e.pid!==void 0&&r.push(`pid=${encodeURIComponent(String(e.pid))}`),e.connectionId&&r.push(`connectionId=${encodeURIComponent(e.connectionId)}`),e.connectionId&&e.displayName!==void 0&&e.clientName!==void 0&&e.colorSeed!==void 0&&(r.push(`displayName=${encodeURIComponent(e.displayName)}`),r.push(`clientName=${encodeURIComponent(e.clientName)}`),r.push(`colorSeed=${encodeURIComponent(e.colorSeed)}`));let i=r.length>0?`?${r.join(`&`)}`:``,o=`${t}/collab/keepalive${i}`;try{c=a(o)}catch(e){f(`warn`,`WebSocket constructor failed`,{url:o,error:String(e)}),c=null,p();return}c.addEventListener(`open`,()=>{f(`info`,`connected`,{url:t}),d=n}),c.addEventListener(`close`,()=>{u||(f(`info`,`disconnected`,{url:t}),c=null,p())}),c.addEventListener(`error`,()=>{f(`debug`,`websocket error observed`,{url:t,readyState:c?.readyState,reason:`error-event`})})}return queueMicrotask(()=>{m().catch(e=>f(`warn`,`initial connect failed`,{error:String(e)}))}),{close:()=>{if(!u&&(u=!0,l!==null&&(t.clearTimeout(l),l=null),c)){try{c.close()}catch{}c=null}},isConnected:()=>c!==null&&c.readyState===1}}function OQ(e){if(e)return e.replace(/\/collab\/?$/,``)}function kQ(){return Bt(window)!==null}function AQ(e,t){let n=(0,$.c)(5),r=(0,Q.useRef)(e),i=(0,Q.useRef)(t),a,o;n[0]===e?(a=n[1],o=n[2]):(a=()=>{r.current=e},o=[e],n[0]=e,n[1]=a,n[2]=o),(0,Q.useEffect)(a,o);let s,c;n[3]===Symbol.for(`react.memo_cache_sentinel`)?(s=()=>{let e=i.current?.startKeepalive??DQ;if((i.current?.isElectronHost??kQ)())return;let t=e({resolveWsUrl:async()=>OQ(r.current)});return()=>t.close()},c=[],n[3]=s,n[4]=c):(s=n[3],c=n[4]),(0,Q.useEffect)(s,c)}var jQ=(0,Q.lazy)(()=>n(()=>import(`./ShareBranchSwitchDialog-Clk_4Io5.js`).then(e=>({default:e.ShareBranchSwitchDialog})),__vite__mapDeps([96,1,6,7,13,55,15,16,56,62,64,97,98,99,100,10,3,11]),import.meta.url)),MQ=(0,Q.lazy)(()=>n(()=>import(`./ShareReceiveMissDialog-Ds4kHbjr.js`).then(e=>({default:e.ShareReceiveMissDialog})),__vite__mapDeps([101,1,55,6,7,15,13,16,56,102,79,10,3,11,52,53,37,34,30,58,63,64,97,81,36,33,39]),import.meta.url)),NQ=`#install-claude-desktop`,PQ=/\.(md|mdx)$/i;function FQ(e){return e===`#settings`||e===NQ}function IQ(e,t){if(!PQ.test(e))return null;for(let n of t){let t=Yt(n);if(t.kind===`doc`&&t.docName===e)return{kind:`doc`,target:e,docName:e}}return null}function LQ(e,t,n,r){return[e,t,n,r].map(e=>[...e].sort().join(`\0`)).join(``)}function RQ(){let e=(0,$.c)(26),{clearTarget:t,openTabs:n,syncOpenTabsWithKnownTargets:r,tabSessionLoaded:i}=vt(),{openTargetTransition:a}=jt();SQ();let{assetPaths:o,filePaths:s,folderPaths:c,loading:l,pageMeta:u,pages:d,pagesBySlug:f,pagesByBasename:p}=ea(),m=(0,Q.useRef)(null),h;e[0]!==o||e[1]!==s||e[2]!==c||e[3]!==d?(h=LQ(d,c,o,s),e[0]=o,e[1]=s,e[2]=c,e[3]=d,e[4]=h):h=e[4];let g=h,_,v;e[5]!==o||e[6]!==s||e[7]!==c||e[8]!==l||e[9]!==d||e[10]!==r||e[11]!==i||e[12]!==g?(_=()=>{l||!i||m.current===g||(m.current=g,r({pages:d,folderPaths:c,assetPaths:o,filePaths:s}))},v=[o,s,c,l,d,r,i,g],e[5]=o,e[6]=s,e[7]=c,e[8]=l,e[9]=d,e[10]=r,e[11]=i,e[12]=g,e[13]=_,e[14]=v):(_=e[13],v=e[14]),(0,Q.useEffect)(_,v);let y,b;return e[15]!==t||e[16]!==c||e[17]!==l||e[18]!==n||e[19]!==a||e[20]!==u||e[21]!==d||e[22]!==p||e[23]!==f?(y=()=>{e();function e(){if(FQ(window.location.hash))return;let e=El(window.location.hash);if(e){let t=Xn(e.split(`.`).pop()??``);_l(`ok/nav/hash-change`,{docName:null,kind:`asset`}),a({kind:`asset`,target:e,assetPath:e,mediaKind:t});return}let r=Cl(window.location.hash);if(r){_l(`ok/nav/hash-change`,{docName:null,kind:`skill-file`}),a({kind:`skill-file`,target:`${r.scope}/${r.name}/${r.path}`,scope:r.scope,name:r.name,path:r.path});return}if(jl(window.location.hash)){_l(`ok/nav/hash-change`,{docName:null,kind:`folder`}),a({kind:`folder`,target:``,folderPath:``});return}let i=Ol(window.location.hash);if(!i){_l(`ok/nav/hash-change`,{docName:null,kind:`clear`}),t();return}if(l){_l(`ok/nav/hash-change`,{docName:i,kind:`deferred-loading`});return}let o=IQ(i,n)??$c(i,{pages:d,folderPaths:c,pagesBySlug:f,pagesByBasename:p});if(o.kind===`missing`&&/\/+$/.test(i.trim())){_l(`ok/nav/hash-change`,{docName:i,kind:`deferred-missing-folder`});return}let s=ol(cl(o),u);_l(`ok/nav/hash-change`,{docName:i,kind:s.kind}),a(s)}return window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},b=[t,c,l,a,n,u,d,f,p],e[15]=t,e[16]=c,e[17]=l,e[18]=n,e[19]=a,e[20]=u,e[21]=d,e[22]=p,e[23]=f,e[24]=y,e[25]=b):(y=e[24],b=e[25]),(0,Q.useEffect)(y,b),null}function zQ(){let e=(0,$.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=[],e[0]=t):t=e[0],(0,Q.useEffect)(BQ,t),null}function BQ(){let e=UQ;if(!e(window.location.hash))return;let t=new AbortController;return Mt(t.signal).then(n=>{if(t.signal.aborted||n.status!==`ok`)return;let r=n.config.paneTarget;r?.startsWith(`#/`)&&e(window.location.hash)&&(window.location.hash=r,fetch(`/api/config`,{method:`DELETE`}).catch(HQ))}).catch(VQ),()=>t.abort()}function VQ(){}function HQ(){}function UQ(e){return!FQ(e)&&!El(e)&&!Ol(e)&&(e===``||e===`#`||e===`#/`)}function WQ(){let e=(0,$.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=[],e[0]=t):t=e[0],(0,Q.useEffect)(GQ,t),null}function GQ(){let e=function(e){let t=e.target;Xa({target:t,metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey,key:e.key})&&(e.preventDefault(),window.location.hash!==`#settings`&&(window.location.hash=Ja))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)}function KQ(){let e=(0,$.c)(4),{activeTarget:t}=vt(),n=typeof window<`u`?window.okDesktop??null:null,r=t?.kind===`doc`||t?.kind===`folder`||t?.kind===`asset`?t.kind:null,i=t?.kind===`doc`?t.docName:t?.kind===`folder`?t.folderPath:t?.kind===`asset`?t.assetPath:null,a,o;return e[0]!==i||e[1]!==r?(a=()=>{if(n){if(r===null){n.editor.notifyActiveTargetChanged({kind:null});return}i!==null&&n.editor.notifyActiveTargetChanged({kind:r,identifier:i})}},o=[n,r,i],e[0]=i,e[1]=r,e[2]=a,e[3]=o):(a=e[2],o=e[3]),(0,Q.useEffect)(a,o),null}function qQ(){let e=(0,$.c)(8),{activeDocName:t,activeTarget:n}=vt(),[r,i]=(0,Q.useState)(!1),a;e[0]!==t||e[1]!==n?(a=n?.kind===`folder`?n.folderPath:ll(t),e[0]=t,e[1]=n,e[2]=a):a=e[2];let o=a,s,c;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(s=()=>{let e=function(e){let t=e.target;hh({target:t,metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey,key:e.key})&&(e.preventDefault(),i(!0))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},c=[],e[3]=s,e[4]=c):(s=e[3],c=e[4]),(0,Q.useEffect)(s,c);let l;return e[5]!==r||e[6]!==o?(l=(0,Z.jsx)(_h,{open:r,onOpenChange:i,kind:`file`,initialDir:o}),e[5]=r,e[6]=o,e[7]=l):l=e[7],l}function JQ(e){let t=(0,$.c)(3),{children:n}=e,{collabUrl:r}=vt();AQ(r);let i;return t[0]!==n||t[1]!==r?(i=(0,Z.jsx)(Ro,{collabUrl:r,children:n}),t[0]=n,t[1]=r,t[2]=i):i=t[2],i}function YQ(){let e=(0,$.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Z.jsx)(vl,{name:`app`,children:(0,Z.jsx)(zt,{children:(0,Z.jsx)(JQ,{children:(0,Z.jsx)(ug,{children:(0,Z.jsx)(XQ,{})})})})}),e[0]=t):t=e[0],t}function XQ(){let e=(0,$.c)(25),t=typeof window<`u`?window.okDesktop??null:null,n=typeof window<`u`&&window.okDesktop!=null,[r,i]=(0,Q.useState)(!1),a=pg(),o;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=t?{launchInTerminal:ZQ}:null,e[0]=o):o=e[0];let s=o,c;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Z.jsx)(Bg,{}),e[1]=c):c=e[1];let l,u,d,f,p;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Z.jsx)(pQ,{}),u=(0,Z.jsx)(RQ,{}),d=(0,Z.jsx)(zQ,{}),f=(0,Z.jsx)(KQ,{}),p=(0,Z.jsx)(qQ,{}),e[2]=l,e[3]=u,e[4]=d,e[5]=f,e[6]=p):(l=e[2],u=e[3],d=e[4],f=e[5],p=e[6]);let m;e[7]===a?m=e[8]:(m=!a&&(0,Z.jsx)(WQ,{}),e[7]=a,e[8]=m);let h,g,_,v;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(_=!1,v=t?(0,Z.jsx)(Vg,{bridge:t}):null,h=(0,Z.jsx)(uQ,{}),g=t?(0,Z.jsxs)(Q.Suspense,{fallback:null,children:[(0,Z.jsx)(jQ,{bridge:t}),(0,Z.jsx)(MQ,{})]}):null,e[9]=h,e[10]=g,e[11]=_,e[12]=v):(h=e[9],g=e[10],_=e[11],v=e[12]);let y;e[13]===r?y=e[14]:(y=(0,Z.jsx)(kg,{bridge:t,open:r,onOpenChange:i}),e[13]=r,e[14]=y);let b;e[15]===Symbol.for(`react.memo_cache_sentinel`)?(b=n&&(0,Z.jsx)(`div`,{"aria-hidden":`true`,"data-testid":`editor-window-chrome-drag-strip`,"data-electron-drag":``,className:`pointer-events-none fixed inset-x-0 top-0 z-50 h-2 [-webkit-app-region:drag]`}),e[15]=b):b=e[15];let x;e[16]===a?x=e[17]:(x=!a&&(0,Z.jsx)(eQ,{onOpenSearch:()=>i(!0)}),e[16]=a,e[17]=x);let S;e[18]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,Z.jsx)(Jj,{className:`overflow-hidden h-[calc(100vh-var(--layout-inset-offset))]`,children:(0,Z.jsx)(NI,{onOpenSearch:()=>i(!0)})}),e[18]=S):S=e[18];let C;e[19]===x?C=e[20]:(C=(0,Z.jsx)(_a,{value:s,children:(0,Z.jsxs)(Hj,{className:`h-screen overflow-hidden`,children:[x,S]})}),e[19]=x,e[20]=C);let w;return e[21]!==y||e[22]!==C||e[23]!==m?(w=(0,Z.jsxs)(Z.Fragment,{children:[c,(0,Z.jsxs)(na,{children:[l,u,d,f,p,m,_,v,h,g,y,b,C]})]}),e[21]=y,e[22]=C,e[23]=m,e[24]=w):w=e[24],w}function ZQ(e,t){ZF(Da(e,t),t)}function QQ(e){let t=/\/([^/]+?)(?:\.git)?\/?$/.exec(e);return t?t[1]:`repo`}function $Q(e){return{async getAuthStatus(){return e.authQueryTransport.status()},async startSignIn(){return e.openSignIn()},async runClone({url:t,branch:n}){let r=await e.bridge.dialog.openFolder();if(!r)return{kind:`cancelled`};let i=QQ(t),a=`${r.replace(/\/$/,``)}/${i}`,o=bs.loading(Yc._({id:`GXf9hG`,values:{repoName:i}}),{duration:1/0}),s=typeof n==`string`&&n.length>0?n:null;try{let n=e.cloneTransport.start({url:t,dir:a,branch:s});for await(let e of n.events){if(e.type===`progress`){let t=e.phase,n=Math.round(e.pct);bs.loading(Yc._({id:`GXf9hG`,values:{repoName:i}}),{id:o,description:Yc._({id:`SCzAbA`,values:{phase:t,pct:n}}),duration:1/0});continue}if(e.type===`branch-fallback`){console.log(td({branch_action:`fallback`,branch:e.branch})),bs.info(Yc._({id:`3JYy1p`,values:{0:e.branch}}),{duration:8e3});continue}if(e.type===`complete`)return bs.success(Yc._({id:`IRv9cH`,values:{repoName:i}}),{id:o,duration:4e3}),{kind:`ok`,dir:e.dir};if(e.type===`error`)return bs.dismiss(o),{kind:`error`,detail:e.message}}return bs.dismiss(o),{kind:`error`,detail:`Clone ended unexpectedly.`}}catch(e){console.warn(`[clone-controller] clone transport threw`,e);let t=e instanceof Error?e.message:`Unknown error`;return bs.dismiss(o),{kind:`error`,detail:t}}}}}function e$(){return{start(e){return Ra((t,n)=>{(async()=>{try{let r=await fetch(`/api/local-op/clone`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({url:e.url,dir:e.dir||void 0,branch:typeof e.branch==`string`&&e.branch.length>0?e.branch:void 0}),signal:n});if(!r.ok){let e=`Clone failed — check the URL and try again (${r.status})`;try{let t=await r.json(),n=Fr.safeParse(t);n.success&&(e=`Clone failed: ${n.data.title}`)}catch{}t({type:`error`,message:e});return}if(!r.body){t({type:`error`,message:`Clone failed — empty response body`});return}let i=r.body.getReader(),a=new TextDecoder,o=``;for(;;){let{done:e,value:r}=await i.read();if(e)break;o+=a.decode(r,{stream:!0});let s=o.split(`
|
|
2003
|
+
`);o=s.pop()??``;for(let e of s){if(!e.trim())continue;let n;try{n=JSON.parse(e)}catch{console.warn(`[clone-transport] Dropped unparseable NDJSON line:`,e.slice(0,100));continue}if(n&&typeof n==`object`&&n.type===`error`&&`problem`in n){let e=n.problem;t({type:`error`,message:e?.detail||e?.title||`Unknown error`});break}t(n)}if(n.aborted)break}n.aborted||t({type:`error`,message:`Clone stream ended unexpectedly — check if the clone completed`})}catch(e){if(e instanceof Error&&e.name===`AbortError`)return;t({type:`error`,message:`Clone failed — connection error`})}})()})}}}function t$(e){return{start(t){let n=typeof t.branch==`string`&&t.branch.length>0?t.branch:null;return e.localOp.clone.start({url:t.url,dir:t.dir,branch:n})}}}function n$(e){switch(e){case`receiving`:return{id:`qbfj1f`};case`resolving`:return{id:`adsMWO`};case`checking`:return{id:`1HBhDS`};case`init`:return{id:`LlHqdU`};case`done`:return{id:`bD8I7O`};default:return{id:`25Pw6a`}}}function r$(e){let t=e.trim();if(/^[\w.-]+\/[\w.-]+$/.test(t))return t.split(`/`)[1];try{return new URL(t.replace(/^git@([^:]+):/,`https://$1/`)).pathname.replace(/\.git$/,``).split(`/`).pop()??`repo`}catch{return t.split(`/`).pop()?.replace(/\.git$/,``)??`repo`}}function i$(e){let t=(0,$.c)(100),{open:n,onOpenChange:r,onSignIn:i,onCloneComplete:a,transport:o,authQueryTransport:s,pickParentFolder:c,initialUrl:l}=e,{_:u}=an(),d;t[0]===o?d=t[1]:(d=o??e$(),t[0]=o,t[1]=d);let f=d,p;t[2]===s?p=t[3]:(p=s??mo(),t[2]=s,t[3]=p);let m=p,h=c!==void 0,[g,_]=(0,Q.useState)(``),[v,y]=(0,Q.useState)(``),[b,x]=(0,Q.useState)(null),[S,C]=(0,Q.useState)(!1),w;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(w=vo(),t[4]=w):w=t[4];let[T,E]=(0,Q.useState)(w),[D,O]=(0,Q.useState)(!1),[k,A]=(0,Q.useState)(!1),[j,M]=(0,Q.useState)(-1),N=(0,Q.useRef)(null),P=(0,Q.useRef)(null),F=(0,Q.useRef)(null),I=(0,Q.useId)(),L;t[5]!==n||t[6]!==m?(L=()=>{if(!n)return;let e=!1;return m.status().then(t=>{uo(t.authenticated),e||E(t.authenticated)}).catch(()=>{e||E(!1)}),()=>{e=!0}},t[5]=n,t[6]=m,t[7]=L):L=t[7];let R;t[8]===n?R=t[9]:(R=[n],t[8]=n,t[9]=R),(0,Q.useEffect)(L,R);let z;t[10]!==T||t[11]!==n||t[12]!==m?(z=()=>{if(!T||!n)return;let e=!1;return C(!0),m.repos().then(t=>{e||(x(t.ok?t.repos:[]),C(!1))}).catch(()=>{e||(x([]),C(!1))}),()=>{e=!0}},t[10]=T,t[11]=n,t[12]=m,t[13]=z):z=t[13];let B;t[14]!==T||t[15]!==n?(B=[T,n],t[14]=T,t[15]=n,t[16]=B):B=t[16],(0,Q.useEffect)(z,B);let V,H;t[17]!==l||t[18]!==n||t[19]!==h?(V=()=>{if(!n||!l||(_(l),h))return;let e=r$(l);e&&y(`~/Documents/${e}`)},H=[n,l,h],t[17]=l,t[18]=n,t[19]=h,t[20]=V,t[21]=H):(V=t[20],H=t[21]),(0,Q.useEffect)(V,H);let U,W;t[22]!==j||t[23]!==I?(U=()=>{j<0||document.getElementById(`${I}-opt-${j}`)?.scrollIntoView({block:`nearest`})},W=[j,I],t[22]=j,t[23]=I,t[24]=U,t[25]=W):(U=t[24],W=t[25]),(0,Q.useEffect)(U,W);let G;t[26]===h?G=t[27]:(G=function(e){if(_(e),A(!0),M(-1),h)return;let t=r$(e);t&&y(`~/Documents/${t}`)},t[26]=h,t[27]=G);let K=G,ee;t[28]===h?ee=t[29]:(ee=function(e){if(_(e.clone_url),h)return;let t=e.full_name.split(`/`)[1];y(`~/Documents/${t}`)},t[28]=h,t[29]=ee);let te=ee,ne;t[30]!==u||t[31]!==v||t[32]!==a||t[33]!==r||t[34]!==c||t[35]!==f||t[36]!==g?(ne=async function(){let e=g.trim();if(!e){bs.error(u({id:`FTUGgh`}));return}let t=v||``;if(c){O(!0);let n=await c();if(!n){O(!1);return}let r=r$(e);t=`${n.replace(/\/$/,``)}/${r}`}else O(!0);let n=bs.loading(u({id:`2tgFCe`}),{duration:1/0});P.current=n;let i=f.start({url:e,dir:t});N.current=i.cancel;try{let e=i.events[Symbol.asyncIterator](),t=await e.next();for(;!t.done;){let i=t.value;if(i.type===`progress`){let e=u(n$(i.phase));bs.loading(`${e} — ${i.pct}%`,{id:n})}else if(i.type===`complete`){bs.success(u({id:`u_lS4C`}),{id:n}),r(!1),O(!1),N.current=null;let e=`port`in i?i.port:void 0;a?a({port:e,dir:i.dir}):e!==void 0&&(window.location.href=`http://localhost:${e}`);return}else if(i.type===`error`){let e=i.message;bs.error(u({id:`eFJkVt`,values:{cloneError:e}}),{id:n}),O(!1),N.current=null;return}t=await e.next()}bs.error(u({id:`Tz9pJB`}),{id:n}),O(!1),N.current=null}catch(e){console.error(`[CloneDialog] clone iteration failed:`,e),bs.error(u({id:`K9J00P`}),{id:n}),O(!1),N.current=null}},t[30]=u,t[31]=v,t[32]=a,t[33]=r,t[34]=c,t[35]=f,t[36]=g,t[37]=ne):ne=t[37];let re=ne,ie;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(ie=function(){N.current?.(),N.current=null,O(!1),bs.dismiss(P.current??void 0)},t[38]=ie):ie=t[38];let ae=ie,oe;t[39]!==D||t[40]!==r||t[41]!==h?(oe=function(e){D||(r(e),e||(_(``),h||y(``),A(!1),M(-1)))},t[39]=D,t[40]=r,t[41]=h,t[42]=oe):oe=t[42];let se=oe,ce;t[43]===te?ce=t[44]:(ce=function(e){te(e),A(!1),M(-1),F.current?.focus()},t[43]=te,t[44]=ce);let le=ce,q=T===null||S&&b===null,ue;if(t[45]!==b||t[46]!==g){let e=g.trim().toLowerCase(),n;t[48]===b?n=t[49]:(n=b??[],t[48]=b,t[49]=n),ue=n.filter(t=>`${t.full_name} ${t.clone_url}`.toLowerCase().includes(e)),t[45]=b,t[46]=g,t[47]=ue}else ue=t[47];let de=ue,fe;t[50]===Symbol.for(`react.memo_cache_sentinel`)?(fe=/:\/\/|^git@|\.git$/i,t[50]=fe):fe=t[50];let pe;t[51]===g?pe=t[52]:(pe=fe.test(g.trim()),t[51]=g,t[52]=pe);let me=pe,he=T===!0&&b!==null&&de.length===0&&!me,ge=k&&T!==!1&&!D&&(q||de.length>0||he),_e=de.length,ve=`${I}-loading`,ye,be;t[53]===_e?(ye=t[54],be=t[55]):(ye=()=>{M(e=>e>=_e?_e-1:e)},be=[_e],t[53]=_e,t[54]=ye,t[55]=be),(0,Q.useEffect)(ye,be);let xe;t[56]!==j||t[57]!==D||t[58]!==ge||t[59]!==le||t[60]!==de?(xe=function(e){if(!D)if(e.key===`ArrowDown`){if(e.preventDefault(),!ge){A(!0);return}M(e=>Math.min(e+1,de.length-1))}else e.key===`ArrowUp`?(e.preventDefault(),M(u$)):e.key===`Enter`?ge&&j>=0&&j<de.length&&(e.preventDefault(),le(de[j])):e.key===`Escape`&&ge&&(e.preventDefault(),e.stopPropagation(),A(!1),M(-1))},t[56]=j,t[57]=D,t[58]=ge,t[59]=le,t[60]=de,t[61]=xe):xe=t[61];let Se=xe,Ce;t[62]===Symbol.for(`react.memo_cache_sentinel`)?(Ce=(0,Z.jsx)(Us,{children:(0,Z.jsx)(zs,{children:(0,Z.jsx)(J,{id:`VdXv4D`})})}),t[62]=Ce):Ce=t[62];let we;t[63]===Symbol.for(`react.memo_cache_sentinel`)?(we=(0,Z.jsx)(`label`,{htmlFor:`clone-source`,className:`text-sm font-medium`,children:(0,Z.jsx)(J,{id:`IreQBq`})}),t[63]=we):we=t[63];let Te;t[64]!==u||t[65]!==j||t[66]!==D||t[67]!==Se||t[68]!==K||t[69]!==T||t[70]!==I||t[71]!==ve||t[72]!==i||t[73]!==ge||t[74]!==q||t[75]!==b||t[76]!==le||t[77]!==de||t[78]!==g?(Te=(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[we,T===!1?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(qc,{id:`clone-source`,placeholder:u({id:`Xv_ijG`}),value:g,onChange:e=>K(e.target.value),disabled:D}),(0,Z.jsxs)(`div`,{className:`flex items-center gap-2 text-1sm text-muted-foreground`,children:[(0,Z.jsx)(`span`,{children:(0,Z.jsx)(J,{id:`9oE4C3`})}),(0,Z.jsx)(X,{variant:`link`,className:`h-auto p-0`,onClick:()=>i?.(),disabled:D,children:(0,Z.jsx)(J,{id:`3jod3l`})})]})]}):(0,Z.jsxs)(Ne,{open:ge,onOpenChange:A,children:[(0,Z.jsx)(dt,{asChild:!0,children:(0,Z.jsx)(qc,{id:`clone-source`,ref:F,role:`combobox`,"aria-expanded":ge,"aria-controls":ge?q?ve:I:void 0,"aria-activedescendant":j>=0?`${I}-opt-${j}`:void 0,"aria-autocomplete":`list`,autoComplete:`off`,placeholder:u({id:`R0jJzV`}),value:g,onChange:e=>K(e.target.value),onFocus:()=>A(!0),onKeyDown:Se,disabled:D})}),(0,Z.jsx)(Ut,{align:`start`,sideOffset:4,className:`w-(--radix-popover-trigger-width) max-h-56 overflow-y-auto overscroll-y-contain subtle-scrollbar p-0`,onOpenAutoFocus:l$,onCloseAutoFocus:c$,onInteractOutside:e=>{F.current?.contains(e.target)&&e.preventDefault()},onWheel:s$,onTouchMove:o$,children:q?(0,Z.jsxs)(`output`,{id:ve,className:`flex flex-col gap-1.5 px-3 py-2`,"aria-label":u({id:`8XQRON`}),children:[(0,Z.jsx)(Ga,{className:`h-4 w-2/3`}),(0,Z.jsx)(Ga,{className:`h-4 w-1/2`}),(0,Z.jsx)(Ga,{className:`h-4 w-3/4`}),(0,Z.jsx)(Ga,{className:`h-4 w-2/5`})]}):(0,Z.jsx)(`div`,{id:I,role:`listbox`,"aria-label":u({id:`KX1MZR`}),className:`py-1`,children:de.length===0?(0,Z.jsx)(`div`,{role:`presentation`,className:`px-3 py-2 text-xs text-muted-foreground`,children:b&&b.length===0?(0,Z.jsx)(J,{id:`cOSAfL`}):(0,Z.jsx)(J,{id:`8eW0WQ`})}):de.map((e,t)=>(0,Z.jsxs)(`div`,{id:`${I}-opt-${t}`,role:`option`,tabIndex:-1,"aria-selected":t===j,onMouseDown:a$,onMouseEnter:()=>M(t),onClick:()=>le(e),className:Y(`flex cursor-default items-center gap-2 px-3 py-1.5 text-sm`,t===j&&`bg-accent text-accent-foreground`),children:[e.private?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(nf,{className:`size-3.5 shrink-0 text-muted-foreground`,"aria-hidden":`true`}),(0,Z.jsx)(`span`,{className:`sr-only`,children:(0,Z.jsx)(J,{id:`n5n_vi`})})]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)($i,{className:`size-3.5 shrink-0 text-muted-foreground`,"aria-hidden":`true`}),(0,Z.jsx)(`span`,{className:`sr-only`,children:(0,Z.jsx)(J,{id:`NuH1jp`})})]}),(0,Z.jsx)(`span`,{className:`truncate`,children:e.full_name})]},e.full_name))})})]})]}),t[64]=u,t[65]=j,t[66]=D,t[67]=Se,t[68]=K,t[69]=T,t[70]=I,t[71]=ve,t[72]=i,t[73]=ge,t[74]=q,t[75]=b,t[76]=le,t[77]=de,t[78]=g,t[79]=Te):Te=t[79];let Ee;t[80]!==D||t[81]!==v||t[82]!==h?(Ee=!h&&(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(`label`,{htmlFor:`clone-path`,className:`text-sm font-medium`,children:(0,Z.jsx)(J,{id:`Gp_twO`})}),(0,Z.jsx)(qc,{id:`clone-path`,placeholder:`~/Documents/repo-name`,value:v,onChange:e=>y(e.target.value),disabled:D})]}),t[80]=D,t[81]=v,t[82]=h,t[83]=Ee):Ee=t[83];let De;t[84]!==Te||t[85]!==Ee?(De=(0,Z.jsx)(Vs,{children:(0,Z.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[Te,Ee]})}),t[84]=Te,t[85]=Ee,t[86]=De):De=t[86];let Oe;t[87]!==D||t[88]!==re||t[89]!==se||t[90]!==g||t[91]!==h?(Oe=(0,Z.jsx)(Hs,{children:D?(0,Z.jsx)(X,{variant:`outline`,className:`font-mono uppercase`,onClick:ae,children:(0,Z.jsx)(J,{id:`dEgA5A`})}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(X,{variant:`outline`,className:`font-mono uppercase`,onClick:()=>se(!1),children:(0,Z.jsx)(J,{id:`dEgA5A`})}),(0,Z.jsx)(X,{onClick:()=>void re(),disabled:!g.trim(),"aria-describedby":h?`clone-picker-hint`:void 0,children:(0,Z.jsx)(J,{id:`9UQ730`})}),h&&(0,Z.jsx)(`span`,{id:`clone-picker-hint`,className:`sr-only`,children:(0,Z.jsx)(J,{id:`EvPX7f`})})]})}),t[87]=D,t[88]=re,t[89]=se,t[90]=g,t[91]=h,t[92]=Oe):Oe=t[92];let ke;t[93]!==De||t[94]!==Oe?(ke=(0,Z.jsxs)(Bs,{className:`sm:max-w-lg`,children:[Ce,De,Oe]}),t[93]=De,t[94]=Oe,t[95]=ke):ke=t[95];let Ae;return t[96]!==se||t[97]!==n||t[98]!==ke?(Ae=(0,Z.jsx)(Ws,{open:n,onOpenChange:se,children:ke}),t[96]=se,t[97]=n,t[98]=ke,t[99]=Ae):Ae=t[99],Ae}function a$(e){return e.preventDefault()}function o$(e){return e.stopPropagation()}function s$(e){return e.stopPropagation()}function c$(e){return e.preventDefault()}function l$(e){return e.preventDefault()}function u$(e){return Math.max(e-1,-1)}var d$=(0,Q.lazy)(()=>n(()=>import(`./ConsentDialogBody-u7A2_0jL.js`),__vite__mapDeps([103,1,6,7,74,20,15,13,16,57,58,54,55,56,60,104,76,77,17,18,19,63,66,82]),import.meta.url));function f$(){let e=(0,$.c)(1);if(!(0,Q.useSyncExternalStore)(Kc.subscribe,m$,p$))return null;let t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Z.jsx)(Q.Suspense,{fallback:null,children:(0,Z.jsx)(d$,{})}),e[0]=t):t=e[0],t}function p$(){return!1}function m$(){return Kc.getSnapshot()!==null}function h$(e){let t=(0,$.c)(5),n;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsx)(`title`,{children:`OpenKnowledge icon`}),t[0]=n):n=t[0];let r;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Z.jsxs)(`g`,{filter:`url(#filter0_d_ok)`,children:[(0,Z.jsx)(`path`,{d:`M66.8902 16.1017C58.2694 3.86669 46.1739 -0.690239 29.9182 2.17749C21.3995 3.67813 13.4602 9.555 8.67934 17.9009C3.93974 26.1701 2.98514 35.6533 6.05714 43.9166C9.31574 52.6868 16.7168 58.4752 24.2299 63.4231C25.7973 64.4562 26.1351 65.7172 26.3551 68.9896C26.5221 71.4625 26.799 75.6011 30.6842 77.7204C31.8176 78.3372 33.0648 78.6515 34.3946 78.6515C37.0796 78.6515 39.4033 77.3649 40.5189 76.7482C47.1049 73.1046 68.8878 59.7147 72.6453 40.4027C74.3444 31.6679 70.9797 21.9019 66.8922 16.1017H66.8902Z`,fill:`white`}),(0,Z.jsx)(`path`,{d:`M37.4214 71.154C28.7888 75.929 36.787 64.0397 27.7458 58.0843C21.6372 54.0616 14.788 49.0568 12.0499 41.6911C6.74463 27.4192 17.5438 10.8473 31.028 8.47262C45.1977 5.97613 54.6946 9.8947 61.6635 19.7844C65.2089 24.8167 67.6013 32.8365 66.3658 39.1828C63.6906 52.9341 49.073 64.7075 37.4214 71.154Z`,fill:`#69A3FF`}),(0,Z.jsx)(`path`,{d:`M52.7244 29.2638C53.4665 28.5217 54.6697 28.5217 55.4119 29.2638V29.2638C56.154 30.0059 56.154 31.2091 55.4119 31.9513L49.2589 38.1042L46.5715 35.4167L52.7244 29.2638Z`,fill:`#D5E5FF`}),(0,Z.jsx)(`path`,{d:`M55.4119 38.8821C56.154 39.6242 56.154 40.8274 55.4119 41.5696V41.5696C54.6698 42.3117 53.4665 42.3117 52.7244 41.5696L46.5715 35.4166L49.259 32.7292L55.4119 38.8821Z`,fill:`#D5E5FF`})]}),t[1]=r):r=t[1];let i;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsx)(`defs`,{children:(0,Z.jsxs)(`filter`,{id:`filter0_d_ok`,x:`-9.53674e-07`,y:`-0.0799994`,width:`77.3817`,height:`85.8743`,filterUnits:`userSpaceOnUse`,colorInterpolationFilters:`sRGB`,children:[(0,Z.jsx)(`feFlood`,{floodOpacity:`0`,result:`BackgroundImageFix`}),(0,Z.jsx)(`feColorMatrix`,{in:`SourceAlpha`,type:`matrix`,values:`0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0`,result:`hardAlpha`}),(0,Z.jsx)(`feOffset`,{dy:`2.85714`}),(0,Z.jsx)(`feGaussianBlur`,{stdDeviation:`2.14286`}),(0,Z.jsx)(`feComposite`,{in2:`hardAlpha`,operator:`out`}),(0,Z.jsx)(`feColorMatrix`,{type:`matrix`,values:`0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.1 0`}),(0,Z.jsx)(`feBlend`,{mode:`normal`,in2:`BackgroundImageFix`,result:`effect1_dropShadow_ok`}),(0,Z.jsx)(`feBlend`,{mode:`normal`,in:`SourceGraphic`,in2:`effect1_dropShadow_ok`,result:`shape`})]})}),t[2]=i):i=t[2];let a;return t[3]===e?a=t[4]:(a=(0,Z.jsxs)(`svg`,{role:`img`,"aria-label":`OpenKnowledge icon`,fill:`none`,height:24,width:24,viewBox:`0 0 78 80`,xmlns:`http://www.w3.org/2000/svg`,...e,children:[n,r,i]}),t[3]=e,t[4]=a),a}var g$=(0,Q.lazy)(()=>n(()=>import(`./ShareReceiveDialog-BDmjkthD.js`).then(e=>({default:e.ShareReceiveDialog})),__vite__mapDeps([105,1,10,3,11,6,7,13,55,15,16,56,64,98,99,100]),import.meta.url)),_$=(e,t,n)=>sg(e,t,n,`NavigatorApp`);function v$(e,t){return e.filter(e=>e.path!==t)}function y$(e){let t=(0,$.c)(106),{bridge:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=[],t[0]=r):r=t[0];let[i,a]=(0,Q.useState)(r),o;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(o=new Map,t[1]=o):o=t[1];let[s,c]=(0,Q.useState)(o),[l,u]=(0,Q.useState)(!0),[d,f]=(0,Q.useState)(!1),[p,m]=(0,Q.useState)(null),[h,g]=(0,Q.useState)(null),[_,v]=(0,Q.useState)(!1),[y,b]=(0,Q.useState)(!1),[x,S]=(0,Q.useState)(void 0),[C,w]=(0,Q.useState)(void 0),[T,E]=(0,Q.useState)(!1),[D,O]=(0,Q.useState)(!1),[k,A]=(0,Q.useState)(null),j=typeof window<`u`&&window.okDesktop!=null,[M,N]=(0,Q.useState)(`auth`),{theme:P}=Ln(),{_:F}=an();Lo(n,P??`system`);let I;t[2]!==F||t[3]!==n.project?(I=()=>{let e=!1;return n.project.listRecent().then(async t=>{if(e)return;a(t);let r=t.filter(b$),i=await Promise.all(r.map(async e=>{try{let{currentBranch:t}=await n.project.readHeadBranch(e.path);return[e.path,t]}catch{return[e.path,null]}}));e||c(e=>{let t=new Map(e);for(let[e,n]of i)t.set(e,n);return t})}).catch(t=>{console.error(`[NavigatorApp] listRecent failed:`,t),e||(m(t instanceof Error?t.message:F({id:`fYKgzG`})),f(!0))}).finally(()=>{e||u(!1)}),()=>{e=!0}},t[2]=F,t[3]=n.project,t[4]=I):I=t[4];let L;t[5]!==F||t[6]!==n?(L=[n,F],t[5]=F,t[6]=n,t[7]=L):L=t[7],(0,Q.useEffect)(I,L);let R,z;t[8]===n?(R=t[9],z=t[10]):(R=()=>n.onMenuAction(e=>{e===`new-project`&&b(!0),e===`close-active-tab-or-window`&&window.close()}),z=[n],t[8]=n,t[9]=R,t[10]=z),(0,Q.useEffect)(R,z);let B;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(B=(e,t)=>_$(e,t,m),t[11]=B):B=t[11];let V=B,H;t[12]!==F||t[13]!==n?(H=(e,t,r)=>V(()=>(g(r),w$(n,e,t).finally(()=>g(null))),F({id:`SUOoXn`})),t[12]=F,t[13]=n,t[14]=H):H=t[14];let U=H,W;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(W=()=>v(!0),t[15]=W):W=t[15];let G=W,K;t[16]!==F||t[17]!==n?(K=()=>V(async()=>{let e=await n.dialog.openFolder();e&&(g(T$(e)),await w$(n,e,`pick-existing`).finally(()=>g(null)))},F({id:`gmJ0An`})),t[16]=F,t[17]=n,t[18]=K):K=t[18];let ee=K,te;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(te=()=>b(!0),t[19]=te):te=t[19];let ne=te,re;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(re=(e,t)=>{S(e),w(t),b(!0)},t[20]=re):re=t[20];let ie=re,ae;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(ae=e=>{b(e),e||(S(void 0),w(void 0))},t[21]=ae):ae=t[21];let oe=ae,se;t[22]===U?se=t[23]:(se=e=>U(e,`recents`,T$(e)),t[22]=U,t[23]=se);let ce=se,le;t[24]!==F||t[25]!==n.project?(le=e=>V(async()=>{await n.project.removeRecent(e),a(t=>v$(t,e)),c(t=>{if(!t.has(e))return t;let n=new Map(t);return n.delete(e),n})},F({id:`viwC-K`})),t[24]=F,t[25]=n.project,t[26]=le):le=t[26];let q=le,ue;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(ue=(0,Z.jsx)(`div`,{className:`pointer-events-none absolute inset-x-0 top-0 z-10 h-9 ${j?`[-webkit-app-region:drag]`:``}`,"data-electron-drag":j?``:void 0,"data-testid":`nav-chrome-row`}),t[27]=ue):ue=t[27];let de;t[28]!==F||t[29]!==h?(de=h===null?null:(0,Z.jsxs)(`div`,{className:`absolute inset-0 z-20 flex flex-col items-center justify-center gap-3 bg-primary-foreground/85 dark:bg-background/85 backdrop-blur-sm`,"data-testid":`nav-opening-overlay`,role:`status`,"aria-live":`polite`,children:[(0,Z.jsx)(is,{className:`size-6 animate-spin text-muted-foreground`}),(0,Z.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:F({id:`s0_GnA`,values:{openingLabel:h}})})]}),t[28]=F,t[29]=h,t[30]=de):de=t[30];let fe;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(fe=(0,Z.jsx)(h$,{className:`size-12 shrink-0`}),t[31]=fe):fe=t[31];let pe;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(pe=(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(`h1`,{className:`font-medium text-xl tracking-tight`,children:`OpenKnowledge`}),(0,Z.jsx)(GN,{})]}),t[32]=pe):pe=t[32];let me;t[33]===n.appVersion?me=t[34]:(me=(0,Z.jsxs)(`header`,{className:`shrink-0 flex-wrap flex items-center gap-2.5`,children:[fe,(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[pe,(0,Z.jsxs)(`p`,{className:`text-muted-foreground text-xs font-mono`,children:[`v`,n.appVersion]})]})]}),t[33]=n.appVersion,t[34]=me);let he;t[35]!==F||t[36]!==l||t[37]!==ee||t[38]!==i||t[39]!==d?(he=l?null:!d&&i.length===0?(0,Z.jsx)(S$,{onPackSelect:ie,onOpenFolder:ee,onClone:G,onCreate:ne}):(0,Z.jsxs)(`section`,{className:`grid shrink-0 sm:grid-cols-3 gap-3`,children:[(0,Z.jsx)(x$,{title:F({id:`wbv9xO`}),description:F({id:`0uTHCg`}),onClick:ne,dataTestId:`nav-create-new`,Icon:ge}),(0,Z.jsx)(x$,{title:F({id:`WPwDin`}),description:F({id:`tUvUfp`}),onClick:ee,dataTestId:`nav-open`,Icon:Bo}),(0,Z.jsx)(x$,{title:F({id:`VdXv4D`}),description:F({id:`JOcPqH`}),onClick:G,dataTestId:`nav-clone`,Icon:EF})]}),t[35]=F,t[36]=l,t[37]=ee,t[38]=i,t[39]=d,t[40]=he):he=t[40];let _e;t[41]===p?_e=t[42]:(_e=p===null?null:(0,Z.jsxs)(`div`,{className:`flex shrink-0 items-start justify-between gap-3 rounded-md border border-red-500/30 bg-red-500/10 px-3 py-2`,"data-testid":`nav-error-banner`,role:`alert`,children:[(0,Z.jsx)(`span`,{className:`text-red-700 text-xs dark:text-red-300`,children:p}),(0,Z.jsx)(X,{type:`button`,variant:`link`,size:`sm`,onClick:()=>m(null),className:`h-auto p-0 text-red-700 text-xs dark:text-red-300`,"data-testid":`nav-error-dismiss`,children:(0,Z.jsx)(J,{id:`1QfxQT`})})]}),t[41]=p,t[42]=_e);let ve;t[43]!==l||t[44]!==ce||t[45]!==q||t[46]!==s||t[47]!==i?(ve=l?(0,Z.jsx)(`section`,{className:`flex shrink-0 flex-col items-center`,children:(0,Z.jsx)(is,{className:`size-4 animate-spin text-muted-foreground/60`})}):i.length>0?(0,Z.jsxs)(`section`,{className:`flex min-h-0 flex-col`,children:[(0,Z.jsx)(`h2`,{className:`mb-2 shrink-0 font-medium text-muted-foreground font-mono text-xs uppercase tracking-wide`,children:(0,Z.jsx)(J,{id:`CCTop_`})}),(0,Z.jsx)(`ul`,{className:`min-h-0 max-h-48 subtle-scrollbar scroll-fade-mask overflow-y-auto space-y-0.5 -mx-4`,"data-testid":`nav-recent-list`,children:i.map(e=>(0,Z.jsx)(C$,{project:e,branch:s.get(e.path)??null,onOpen:()=>ce(e.path),onRemove:()=>q(e.path)},e.path))})]}):null,t[43]=l,t[44]=ce,t[45]=q,t[46]=s,t[47]=i,t[48]=ve):ve=t[48];let ye;t[49]!==me||t[50]!==he||t[51]!==_e||t[52]!==ve?(ye=(0,Z.jsx)(`div`,{className:`mx-auto flex h-full w-full max-w-5xl flex-col overflow-hidden px-12 py-12`,children:(0,Z.jsxs)(`div`,{className:`my-auto flex min-h-0 flex-col space-y-10`,children:[me,he,_e,ve]})}),t[49]=me,t[50]=he,t[51]=_e,t[52]=ve,t[53]=ye):ye=t[53];let be,xe;t[54]===Symbol.for(`react.memo_cache_sentinel`)?(be=(0,Z.jsx)(uQ,{}),xe=(0,Z.jsx)(f$,{}),t[54]=be,t[55]=xe):(be=t[54],xe=t[55]);let Se;t[56]!==n||t[57]!==y||t[58]!==x||t[59]!==C?(Se=(0,Z.jsx)(pm,{open:y,onOpenChange:oe,bridge:n,initialPackId:x,packs:C}),t[56]=n,t[57]=y,t[58]=x,t[59]=C,t[60]=Se):Se=t[60];let Ce;t[61]===k?Ce=t[62]:(Ce=e=>{E(e),e||(O(!1),k&&(k(null),A(null)))},t[61]=k,t[62]=Ce);let we;t[63]===n?we=t[64]:(we=Pa(n),t[63]=n,t[64]=we);let Te;t[65]===n?Te=t[66]:(Te=La(n),t[65]=n,t[66]=Te);let Ee=M===`identity`,De;t[67]!==D||t[68]!==k?(De=e=>{E(!1),D&&(O(!1),v(!0)),k&&(k({authenticated:!0,host:`github.com`,login:e.login}),A(null))},t[67]=D,t[68]=k,t[69]=De):De=t[69];let Oe;t[70]!==T||t[71]!==Ce||t[72]!==we||t[73]!==Te||t[74]!==Ee||t[75]!==De?(Oe=(0,Z.jsx)(qa,{open:T,onOpenChange:Ce,transport:we,queryTransport:Te,identityPrompt:Ee,onSuccess:De}),t[70]=T,t[71]=Ce,t[72]=we,t[73]=Te,t[74]=Ee,t[75]=De,t[76]=Oe):Oe=t[76];let ke;t[77]===n?ke=t[78]:(ke=t$(n),t[77]=n,t[78]=ke);let Ae;t[79]===n?Ae=t[80]:(Ae=La(n),t[79]=n,t[80]=Ae);let je;t[81]===n.dialog?je=t[82]:(je=()=>n.dialog.openFolder(),t[81]=n.dialog,t[82]=je);let Me;t[83]===Symbol.for(`react.memo_cache_sentinel`)?(Me=()=>{v(!1),N(`auth`),O(!0),E(!0)},t[83]=Me):Me=t[83];let Ne;t[84]!==F||t[85]!==n?(Ne=e=>{let{dir:t}=e;V(()=>(g(T$(t)),w$(n,t,`pick-existing`).finally(()=>g(null))),F({id:`iSnkwB`}))},t[84]=F,t[85]=n,t[86]=Ne):Ne=t[86];let Pe;t[87]!==_||t[88]!==ke||t[89]!==Ae||t[90]!==je||t[91]!==Ne?(Pe=(0,Z.jsx)(i$,{open:_,onOpenChange:v,transport:ke,authQueryTransport:Ae,pickParentFolder:je,onSignIn:Me,onCloneComplete:Ne}),t[87]=_,t[88]=ke,t[89]=Ae,t[90]=je,t[91]=Ne,t[92]=Pe):Pe=t[92];let Fe;if(t[93]!==n){let e;t[95]===Symbol.for(`react.memo_cache_sentinel`)?(e=()=>new Promise(e=>{A(()=>e),E(!0)}),t[95]=e):e=t[95],Fe=$Q({bridge:n,authQueryTransport:La(n),cloneTransport:t$(n),openSignIn:e}),t[93]=n,t[94]=Fe}else Fe=t[94];let Ie;t[96]!==n||t[97]!==Fe?(Ie=(0,Z.jsx)(Q.Suspense,{fallback:null,children:(0,Z.jsx)(g$,{bridge:n,cloneController:Fe})}),t[96]=n,t[97]=Fe,t[98]=Ie):Ie=t[98];let Le;return t[99]!==de||t[100]!==ye||t[101]!==Se||t[102]!==Oe||t[103]!==Pe||t[104]!==Ie?(Le=(0,Z.jsxs)(`div`,{className:`relative flex h-screen w-screen flex-col overflow-hidden bg-primary-foreground dark:bg-background text-foreground`,children:[ue,de,ye,be,xe,Se,Oe,Pe,Ie]}),t[99]=de,t[100]=ye,t[101]=Se,t[102]=Oe,t[103]=Pe,t[104]=Ie,t[105]=Le):Le=t[105],Le}function b$(e){return!e.missing}function x$(e){let t=(0,$.c)(14),{title:n,description:r,onClick:i,dataTestId:a,Icon:o}=e,s;t[0]===o?s=t[1]:(s=o?(0,Z.jsx)(o,{className:`size-4 shrink-0 text-muted-foreground`}):null,t[0]=o,t[1]=s);let c;t[2]===n?c=t[3]:(c=(0,Z.jsx)(`span`,{className:`font-medium text-gray-700 dark:text-foreground text-sm`,children:n}),t[2]=n,t[3]=c);let l;t[4]!==s||t[5]!==c?(l=(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[s,c]}),t[4]=s,t[5]=c,t[6]=l):l=t[6];let u;t[7]===r?u=t[8]:(u=(0,Z.jsx)(`span`,{className:`line-clamp-2 text-muted-foreground text-xs leading-snug`,children:r}),t[7]=r,t[8]=u);let d;return t[9]!==a||t[10]!==i||t[11]!==l||t[12]!==u?(d=(0,Z.jsxs)(X,{type:`button`,variant:`outline`,onClick:i,"data-testid":a,className:`h-auto flex-col items-start justify-start gap-1.5 whitespace-normal bg-card px-4 py-3.5 text-left`,children:[l,u]}),t[9]=a,t[10]=i,t[11]=l,t[12]=u,t[13]=d):d=t[13],d}function S$(e){let t=(0,$.c)(31),{onPackSelect:n,onOpenFolder:r,onClone:i,onCreate:a}=e,[o,s]=(0,Q.useState)(null),c,l;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=()=>{let e=!1;return(async()=>{try{let t=await Ih().listPacks();if(e)return;t.ok?s(t.packs):(console.error(`[NavigatorApp] listPacks returned error:`,t),s([]))}catch(t){let n=t;if(e)return;console.error(`[NavigatorApp] listPacks failed:`,n),s([])}})(),()=>{e=!0}},l=[],t[0]=c,t[1]=l):(c=t[0],l=t[1]),(0,Q.useEffect)(c,l);let u;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Z.jsx)(`h2`,{className:`text-xl font-light tracking-tighter text-balance`,children:(0,Z.jsx)(J,{id:`QnjpOq`})}),t[2]=u):u=t[2];let d;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Z.jsxs)(`div`,{className:`flex shrink-0 flex-col gap-1`,children:[u,(0,Z.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:(0,Z.jsx)(J,{id:`gYuDfu`})})]}),t[3]=d):d=t[3];let f;t[4]!==n||t[5]!==o?(f=e=>n(e,o??[]),t[4]=n,t[5]=o,t[6]=f):f=t[6];let p;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(p=[`okf`,`entity-vault`],t[7]=p):p=t[7];let m;t[8]!==o||t[9]!==f?(m=(0,Z.jsx)(`div`,{className:`-m-1 min-h-0 flex-1 overflow-y-auto subtle-scrollbar p-1`,children:(0,Z.jsx)(zh,{packs:o,onPackSelect:f,collapsedPackIds:p})}),t[8]=o,t[9]=f,t[10]=m):m=t[10];let h;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(h=(0,Z.jsx)(`span`,{className:`text-muted-foreground text-sm`,children:(0,Z.jsx)(J,{id:`S34Vju`})}),t[11]=h):h=t[11];let g,_;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(_=(0,Z.jsx)(Bo,{"aria-hidden":`true`,className:`size-3.5`}),g=(0,Z.jsx)(J,{id:`PVUn_c`}),t[12]=g,t[13]=_):(g=t[12],_=t[13]);let v;t[14]===r?v=t[15]:(v=(0,Z.jsxs)(X,{type:`button`,variant:`link-muted`,size:`sm`,onClick:r,"data-testid":`nav-first-run-open`,children:[_,g]}),t[14]=r,t[15]=v);let y,b;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Z.jsx)(EF,{"aria-hidden":`true`,className:`size-3.5`}),b=(0,Z.jsx)(J,{id:`VdXv4D`}),t[16]=y,t[17]=b):(y=t[16],b=t[17]);let x;t[18]===i?x=t[19]:(x=(0,Z.jsxs)(X,{type:`button`,variant:`link-muted`,size:`sm`,onClick:i,"data-testid":`nav-first-run-clone`,children:[y,b]}),t[18]=i,t[19]=x);let S,C;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,Z.jsx)(ge,{"aria-hidden":`true`,className:`size-3.5`}),C=(0,Z.jsx)(J,{id:`ircigK`}),t[20]=S,t[21]=C):(S=t[20],C=t[21]);let w;t[22]===a?w=t[23]:(w=(0,Z.jsxs)(X,{type:`button`,variant:`link-muted`,size:`sm`,onClick:a,"data-testid":`nav-first-run-blank`,children:[S,C]}),t[22]=a,t[23]=w);let T;t[24]!==v||t[25]!==x||t[26]!==w?(T=(0,Z.jsxs)(`div`,{className:`flex shrink-0 flex-wrap items-center gap-x-3 gap-y-1`,"data-testid":`nav-first-run-secondary`,children:[h,(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-x-1 gap-y-1`,children:[v,x,w]})]}),t[24]=v,t[25]=x,t[26]=w,t[27]=T):T=t[27];let E;return t[28]!==T||t[29]!==m?(E=(0,Z.jsxs)(`section`,{className:`flex min-h-0 shrink flex-col gap-6`,"data-testid":`nav-first-run`,children:[d,m,T]}),t[28]=T,t[29]=m,t[30]=E):E=t[30],E}function C$(e){let t=(0,$.c)(44),{project:n,branch:r,onOpen:i,onRemove:a}=e,{_:o}=an(),{name:s}=n,c=n.isLinkedWorktree===!0,l=c?n.branch??r:r,u=n.missing,d=n.missing&&`opacity-50`,f;t[0]===d?f=t[1]:(f=Y(`h-auto min-w-0 flex-1 justify-between gap-3 py-3.5 pl-4 pr-2 text-left hover:bg-transparent`,d),t[0]=d,t[1]=f);let p;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Z.jsx)(Wd,{"aria-hidden":`true`,className:`size-[18px] shrink-0 text-muted-foreground`}),t[2]=p):p=t[2];let m;t[3]===n.name?m=t[4]:(m=(0,Z.jsx)(`span`,{className:`truncate font-medium text-sm text-gray-700 dark:text-foreground`,children:n.name}),t[3]=n.name,t[4]=m);let h;t[5]===c?h=t[6]:(h=c?(0,Z.jsxs)(Ae,{variant:`secondary`,className:`shrink-0 gap-1 rounded-full border-transparent bg-green-600/10 px-2 py-0 font-medium text-2xs text-green-800 dark:bg-green-400/10 dark:text-green-400`,children:[(0,Z.jsx)(Vo,{"aria-hidden":`true`,className:`size-2.5`}),(0,Z.jsx)(J,{id:`z-lawV`})]}):null,t[5]=c,t[6]=h);let g;t[7]!==m||t[8]!==h?(g=(0,Z.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[m,h]}),t[7]=m,t[8]=h,t[9]=g):g=t[9];let _=c?n.mainRoot??``:n.path,v;t[10]!==c||t[11]!==n.mainRoot||t[12]!==n.path?(v=c?(0,Z.jsx)(J,{id:`PRnH8G`,values:{0:gg(n.mainRoot??``)}}):n.path,t[10]=c,t[11]=n.mainRoot,t[12]=n.path,t[13]=v):v=t[13];let y;t[14]!==_||t[15]!==v?(y=(0,Z.jsx)(`span`,{className:`truncate w-full text-muted-foreground text-xs`,title:_,children:v}),t[14]=_,t[15]=v,t[16]=y):y=t[16];let b;t[17]!==y||t[18]!==g?(b=(0,Z.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3`,children:[p,(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1 truncate`,children:[g,y]})]}),t[17]=y,t[18]=g,t[19]=b):b=t[19];let x;t[20]!==n.missing||t[21]!==n.path||t[22]!==l?(x=n.missing?(0,Z.jsx)(Ae,{className:`text-2xs rounded-sm`,variant:`warning`,children:(0,Z.jsx)(J,{id:`VU3Nrn`})}):l==null?null:(0,Z.jsxs)(`span`,{className:`flex max-w-[40%] items-center gap-1 text-muted-foreground text-xs`,"data-testid":`nav-recent-branch-${n.path}`,children:[(0,Z.jsx)(Vo,{"aria-hidden":`true`,className:`size-3 shrink-0`}),(0,Z.jsx)(`span`,{className:`truncate font-mono`,children:l})]}),t[20]=n.missing,t[21]=n.path,t[22]=l,t[23]=x):x=t[23];let S;t[24]!==i||t[25]!==n.missing||t[26]!==b||t[27]!==x||t[28]!==f?(S=(0,Z.jsxs)(X,{type:`button`,variant:`ghost`,onClick:i,disabled:u,className:f,children:[b,x]}),t[24]=i,t[25]=n.missing,t[26]=b,t[27]=x,t[28]=f,t[29]=S):S=t[29];let C;t[30]!==o||t[31]!==s?(C=o({id:`hDoLrm`,values:{projectName:s}}),t[30]=o,t[31]=s,t[32]=C):C=t[32];let w;t[33]===o?w=t[34]:(w=o({id:`Es-eZU`}),t[33]=o,t[34]=w);let T=`nav-recent-remove-${n.path}`,E;t[35]===Symbol.for(`react.memo_cache_sentinel`)?(E=(0,Z.jsx)(xs,{"aria-hidden":`true`}),t[35]=E):E=t[35];let D;t[36]!==a||t[37]!==C||t[38]!==w||t[39]!==T?(D=(0,Z.jsx)(X,{type:`button`,variant:`ghost`,size:`icon-sm`,onClick:a,"aria-label":C,title:w,className:`pointer-events-none mr-2 opacity-0 group-hover:pointer-events-auto group-hover:opacity-100 focus-visible:pointer-events-auto focus-visible:opacity-100`,"data-testid":T,children:E}),t[36]=a,t[37]=C,t[38]=w,t[39]=T,t[40]=D):D=t[40];let O;return t[41]!==S||t[42]!==D?(O=(0,Z.jsxs)(`li`,{className:`group flex items-center justify-between rounded-lg hover:bg-accent`,children:[S,D]}),t[41]=S,t[42]=D,t[43]=O):O=t[43],O}async function w$(e,t,n){await e.project.open({path:t,target:`new-window`,entryPoint:n})}function T$(e){let t=e.split(/[/\\]/).filter(Boolean);return t.length>0?t[t.length-1]??e:e}function E$(e){let t=(0,$.c)(5),{bridge:n}=e,r=n.config.collabUrl?n.config.collabUrl:null,i;t[0]===n?i=t[1]:(i=(0,Z.jsx)(D$,{bridge:n}),t[0]=n,t[1]=i);let a;return t[2]!==r||t[3]!==i?(a=(0,Z.jsx)(Ro,{collabUrl:r,children:i}),t[2]=r,t[3]=i,t[4]=a):a=t[4],a}function D$(e){let t=(0,$.c)(11),{bridge:n}=e,{resolvedTheme:r}=Ln(),i=t_(),[a,o]=(0,Q.useState)(null),s;t[0]===r?s=t[1]:(s=Eu(r),t[0]=r,t[1]=s);let c;t[2]===s.background?c=t[3]:(c=(0,Z.jsx)(`div`,{ref:o,className:`flex h-screen min-h-0 flex-col`,style:{backgroundColor:s.background}}),t[2]=s.background,t[3]=c);let l;t[4]!==n||t[5]!==a||t[6]!==i?(l=(0,Z.jsx)(xI,{bridge:n,variant:`window`,visible:!0,onVisibleChange:k$,installedClis:i,container:a,isShowing:!0,onRequestEditorFocus:O$}),t[4]=n,t[5]=a,t[6]=i,t[7]=l):l=t[7];let u;return t[8]!==c||t[9]!==l?(u=(0,Z.jsxs)(Z.Fragment,{children:[c,l]}),t[8]=c,t[9]=l,t[10]=u):u=t[10],u}function O$(){}function k$(e){e||window.close()}function A$(e){return e?.config.mode===`terminal`?(0,Z.jsx)(E$,{bridge:e}):e?.config.mode===`navigator`?(0,Z.jsx)(y$,{bridge:e}):(0,Z.jsx)(YQ,{})}var j$=e=>{let t=(0,$.c)(8),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let{theme:r}=Ln(),i=r===void 0?`system`:r,a,o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(a={success:(0,Z.jsx)(ta,{className:`size-4`}),info:(0,Z.jsx)(rs,{className:`size-4`}),warning:(0,Z.jsx)(ds,{className:`size-4`}),error:(0,Z.jsx)(sf,{className:`size-4`}),loading:(0,Z.jsx)(is,{className:`size-4 animate-spin`})},o={"--normal-bg":`var(--popover)`,"--normal-text":`var(--popover-foreground)`,"--normal-border":`var(--border)`,"--border-radius":`var(--radius)`},t[2]=a,t[3]=o):(a=t[2],o=t[3]);let s;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(s={classNames:{toast:`cn-toast`}},t[4]=s):s=t[4];let c;return t[5]!==n||t[6]!==i?(c=(0,Z.jsx)(Ss,{theme:i,className:`toaster group`,icons:a,style:o,toastOptions:s,...n}),t[5]=n,t[6]=i,t[7]=c):c=t[7],c},M$=Symbol.for(`ok.client.fetchWrapper`);function N$(e={}){if(typeof window>`u`)return;let t=e.apiOrigin&&e.apiOrigin.length>0?e.apiOrigin:void 0;if(window.fetch[M$])return;let n=window.fetch.bind(window),r=Fo(),i=((e,i)=>{let a=F$(e,t);if(!a.isApi)return n(e,i);if(e instanceof Request){let t=P$(e.headers,r);return n(new Request(a.url,e),{headers:t})}let o=P$(i?.headers,r);return n(a.url,{...i,headers:o})});i[M$]=!0,window.fetch=i}function P$(e,t){let n=new Headers(e);for(let[e,r]of Object.entries(t))n.set(e,r);return n}function F$(e,t){if(typeof e==`string`){if(e.startsWith(`/api/`))return{isApi:!0,url:t?t+e:e};let n=I$(e);return n&&L$(n,t)?{isApi:!0,url:e}:{isApi:!1,url:e}}let n=e instanceof URL?e:I$(e.url,window.location.origin);if(n&&L$(n,t)){let r=e instanceof URL?e.href:e.url;return t&&(n.origin===window.location.origin||n.protocol===`file:`)?{isApi:!0,url:t+n.pathname+n.search+n.hash}:{isApi:!0,url:r}}return{isApi:!1,url:e instanceof URL?e.href:e.url}}function I$(e,t){try{return new URL(e,t)}catch{return null}}function L$(e,t){if(!e.pathname.startsWith(`/api/`))return!1;if(e.origin===window.location.origin||e.protocol===`file:`)return!0;if(t){let n=I$(t);if(n&&e.origin===n.origin)return!0}return!1}var R$={messages:JSON.parse(`{"--T3kB":["Loading preview"],"-3Qbv7":[["count","plural",{"one":["matches ","#"," file"],"other":["matches ","#"," files"]}]],"-3ois8":["Hard break"],"-5jISU":[["0","plural",{"one":["#"," template"],"other":["#"," templates"]}]],"-8PP0T":["Match case"],"-K0AvT":["Disconnect"],"-LHLx7":["edited template"],"-QCLWk":["Templates available"],"-Qw-1t":["GitHub authentication failed. Try signing in again."],"-WFFG2":["Default properties"],"-YV1Uo":["Pattern ",["patternNumber"]],"-g6KIS":["Unrecognized link"],"-gdcIo":["Auto-sync is on — your commits push and remote changes pull on intervals."],"-i7ik4":["Collapse burst ",["burstNumber"]," diff"],"-lCAuQ":["Loading graph"],"-q4abP":["Results capped — this workspace has more files than search can index. A missing file may be a cap artifact, not a typo."],"-r_Kx7":["Create skill"],"-slrNR":["Toggle a task list."],"-uaQnI":["No matching worktrees or branches."],"-wePNM":["Search matches file names, paths, and folders. Open a file to search its body (⌘F)."],"-zA2E7":["Couldn't create the worktree. Try a different name."],"-zy2Nq":["Type"],"0-31GV":["Removing"],"02P3hL":["Upload failed: ",["message"]],"04RA0-":["Failed to enable sync — ",["detail"]],"04XyCH":["Adds a managed block to ",["0"]],"05n5wS":["Doc mention suggestions"],"06SZfb":["Template \\"",["trimmedTitle"],"\\" created"],"07eGJB":["Couldn't move skill: ",["0"]],"07gHun":["You don't have access to this private repo. Sign in with an account that does."],"07q4Qk":["File sidebar"],"09Tv5j":["Reconnecting…"],"0BB9ID":["No headings yet."],"0BfhAj":["Reset view"],"0E9DR6":["Type to find a doc"],"0Er6-M":["Restarting"],"0Gd0NU":["Shared"],"0LBDjY":["\\"",["0"],"\\" uninstalled — back to a draft"],"0NA4b3":["Keep my version"],"0SBTff":["Show terminal"],"0TnCvC":["Rename ",["0"]],"0YEbfk":["Connect to AI tools"],"0YUS3Q":["Subfolder under current folder"],"0_J12R":["New file from template \\"",["displayTitle"],"\\" (",["fileName"],") in ",["targetLabel"]],"0eHrMb":["Could not complete delete"],"0g7rCZ":["Duplicated to \\"",["0"],"\\""],"0inVGS":["Helps your coding agent recognize OpenKnowledge projects and route reads and writes through it."],"0jD-Gn":["A team knowledge base, a personal wiki, project docs..."],"0kTAXe":["Open source: ",["mirrorSrc"]],"0njBIq":["Setup files include: <0>.ok/</0>, AI-tool MCP configs (<1>.mcp.json</1> and per-tool files), project skills, and <2>.claude/launch.json</2>.<3/><4>Shared</4> commits them to git, so anyone who clones the repo gets the same setup. <5/><6>Local only</6> keeps them out of git (via <7>.git/info/exclude</7>)."],"0rwwOn":["By tag"],"0s8-e8":["Select, enter, or leave block components and fallback source blocks from keyboard boundaries."],"0t0bbC":["Could not save sync preference: ",["detail"]],"0uTHCg":["Start a new OpenKnowledge project."],"0wswKc":["Horizontal rule that divides sections."],"0xnmlQ":["Repository name"],"0yL--g":["Review conflicts"],"12F9WL":["(no id)"],"16D5Zj":["Are you sure you want to delete ",["itemName"],"? This action cannot be undone."],"1AumWo":["Push failed — check the server logs for details."],"1EcCom":[["keyName"]," value"],"1FLarN":["Describe what you want to create to continue"],"1GhYxC":["of ",["totalPages"]],"1HBhDS":["Checking out files"],"1MGRQl":["Terminal sessions"],"1QfxQT":["Dismiss"],"1RluQD":["Show replace"],"1TNIig":["Open"],"1Ta7Fd":["Open ",["basename"]],"1XSMhZ":["Switching to <0>local-only</0> will refuse until they're untracked via<1> git rm --cached</1>."],"1YJ4Yg":["Update available",["0"]],"1ZpfyB":["Open with AI ",["displayName"],", ",["hint"]],"1bDVu5":["Workspace Command Palette"],"1d1F11":["Select all files and folders"],"1di5fu":["Document not found"],"1hvhf0":["The folder on disk and the id agents use to invoke this skill."],"1nke1r":["Open ",["0"]," on GitHub (opens in a new tab)"],"1t_NnN":["Reject"],"2277Tu":["Collapse graph"],"237hSL":["Ended"],"25Pw6a":["Cloning"],"27XW26":["Clone happens in the Project Navigator. Reclick the share link there."],"28B21t":["Agent Skills"],"29VNqC":["Unknown error"],"29XZXN":["Set git identity"],"2B6eYX":["What this checkbox changes"],"2BBAbc":["List"],"2FYpfJ":["More"],"2GT3Hf":["Global"],"2IYGkU":["This doc has unpushed changes. Recipients will see the last pushed version."],"2QM24L":["All tags"],"2RBzMG":["Network error — check your connection and try again"],"2XQ8Ww":["Open preview when agent edits"],"2YOwme":["Restarted — now running v",["appRuntime"],"."],"2YZwPB":["Forward-links response did not match expected shape."],"2bVHbB":["Available in every project on this computer."],"2fkdnR":["Nothing to undo on this file"],"2hYmUH":["my@email.com"],"2hpdRq":["Hide panel (",["panelShortcutLabel"],")"],"2n3oDU":["Project-level pages ordered by inbound link count, up to ",["FULLSCREEN_HUB_LIMIT"]," results."],"2q_Q7x":["Visibility"],"2ryd91":["Failed to rename property"],"2tgFCe":["Starting clone"],"2vIPtm":["Open link in new tab"],"2wxgft":["Rename"],"322lyb":["Highlight tips, warnings, and notes."],"34qyH5":["Could not reach server"],"36WXSC":["Couldn't delete template: ",["error"]],"36aWJD":["Join us on Discord"],"379t2h":["Unified diff"],"38foVZ":["Loading diff"],"3BnyYc":["This doc isn't on GitHub yet. The link won't work until it's pushed."],"3DTatP":["Copy a prompt for your agent, start a blank file, or scaffold from a template."],"3FMvls":["A short line shown under the title in the template list."],"3Fcb0I":["Open graph"],"3HNlwb":["Hello, world!"],"3Ib6FN":["Move down"],"3Ijjy1":["Couldn't load this skill's files."],"3IseAk":["Install an AI agent to create with AI"],"3J7d2N":["Big section heading."],"3JYy1p":["Branch ",["0"]," no longer exists. Cloned to default branch."],"3MnvrL":["Showing top ",["0"]," matches — keep typing to narrow"],"3Mwaly":["Could not initialize ",["0"],"."],"3SDfZl":["<0>Mirror — pick a source.</0> Set <1>src</1> + <2>anchor</2> via the property panel to point at a <3><MirrorSource></3> elsewhere."],"3TCafD":["Stored on this machine."],"3VbwPp":["Open ",["keyName"]," in browser"],"3VsNTI":["Loading document"],"3YvS-c":["New tab"],"3_6U6f":["Connect to GitHub"],"3__SjS":["breadcrumb"],"3a_Bd7":["Open source doc: ",["mirrorSrc"]],"3aeN7X":["All files"],"3cOo2C":["Create a folder from the current document or folder context."],"3ePd3I":["What's new"],"3h5zMp":["Something went wrong loading the settings panel."],"3iyGWF":["Open recent project"],"3jod3l":["Connect GitHub"],"3m2GBo":["Searching docs"],"3mFsc3":["Restore with remote changes"],"3o3tur":["Starter content"],"3oh0nQ":["Nested .okignore error in ",["path"]],"3pU8e-":["Pin tab"],"3wiBAs":["Where should it live?"],"3y6XTb":["Semantic search"],"3zyg_A":["Ignore patterns"],"438Fca":["Cloned successfully, but could not open the project."],"44DSl0":["Already have a git repository? Add it with <0>git remote add origin <url></0> in this project's folder. This page updates automatically once a remote is detected."],"45MZFs":["Commands"],"47EXvY":["This replaces the current skill content with the bundled version ",["0"]," (you have ",["1"],"). Any local edits will be replaced — your current version is saved to history first, so you can restore it."],"484LKL":["Remove link"],"48uGTI":["Failed to load docs. Press Escape and re-open to retry."],"4A3Yzu":["Code block"],"4BITzH":["Error:"],"4CfgPM":["Project folder created, but git init failed. Try again."],"4E9jPa":["Create your first project"],"4Gz2wC":["Failed to upload file"],"4KmEoC":["Hotkeys"],"4NC2Ym":["Move to the next or previous table cell."],"4PYsOz":["Hide Files (",["sidebarShortcutLabel"],")"],"4Sxexw":["Source undo or redo"],"4TzU0n":["Initialize"],"4XL6N4":["Detected from the editors this project is set up for. Adjust to control where every skill installs."],"4buZWd":["Inherited from ",["path"]],"4c_a6S":["Nothing set yet."],"4g19V6":["Failed to update property"],"4hJhzz":["Table"],"4jDd0j":["Anyone can see"],"4mLBx9":["Subscriptions aren't available right now."],"4niEzY":["Sandboxed HTML embed — write HTML, see the rendered preview live."],"4nj6n8":["/api/config returned HTTP ",["code"]],"4rjwLG":["Create with ",["0"]," CLI"],"4sKwf6":["File already exists"],"4uNLmk":["Pulling"],"4v2Yyz":["Select every visible file-tree row when focus is in the Files sidebar."],"4xtLTl":["Hidden folder “",["basename"],"”"],"4zEZS5":["Auto-sync is on for this worktree, inherited from ",["project"],". Change it in Settings → Sync."],"4zGlN_":["Paste image URL or click upload"],"5-FeN2":["Share URL"],"54Y6Fg":["Could not load templates. Try again later."],"56WWtu":["Couldn't load starter packs: ",["error"]],"56xUL1":["Property name"],"57fiu8":["(read-only — edit in source mode for now)"],"5ALjdr":["Move through visual-editor find results from the find field."],"5Ajb15":["The formula <0>c = √(a² + b²)</0> renders inline."],"5ClEAu":["Inline hashtag for cross-doc grouping."],"5D3Ior":["Hide folder"],"5DFPDh":["Started a fresh OpenKnowledge server (v",["appRuntime"],") for this dev session — the server already running for this project was terminated. Connected agents (Claude Code, Codex, Cursor) just lost their OpenKnowledge MCP connection; restart the agent, or toggle its OpenKnowledge MCP server off and on, to reconnect."],"5F5HYj":[["ahead"]," ahead, ",["behind"]," behind"],"5GKMSz":["Indent or outdent the current list item."],"5GRxoA":["Search files, folders, and commands for the current workspace."],"5LXwX8":["This permanently removes ",["path"],". Agents that reference this template by name will fail until it's recreated or replaced by one in a parent folder."],"5OTgC7":["Open and focus the bottom Ask AI prompt composer."],"5OqaJi":["Enter a project name"],"5QGTaA":["Could not copy relative path"],"5SwVv1":["Not installed"],"5Tk8Fb":["Loading files"],"5WDhAk":["Link to a page or external URL."],"5ZB7XC":["File drop zone"],"5e1Dri":["The menu label agents pick this template by (required)."],"5gr_ev":["Becomes the document's content when someone creates a doc from this template. Type <0>",["dateToken"],"</0> or <1>",["userToken"],"</1> to fill in today's date or the author's name automatically."],"5kWklo":["(some may already be hidden by other rules)"],"5lWFkC":["Sign in"],"5mksg0":["Failed to disable semantic search — ",["detail"]],"5qNxOe":[["count","plural",{"one":["#"," item could not be moved to the Trash. Do you want to permanently delete instead?"],"other":["#"," items could not be moved to the Trash. Do you want to permanently delete instead?"]}]],"5wV2qQ":["and more"],"5y_9lO":["Waiting for authorization"],"6-wLTJ":[["behind"]," behind origin"],"62Pc08":["Install for Claude Chat & Cowork (Desktop App)"],"636K3K":["Delete adjacent chip"],"67f-3g":["Duplicate succeeded but the sidebar may be out of date — refresh to resync"],"6Aih4U":["Offline"],"6EKG_c":["What agents match on to decide when to use the skill."],"6HCOwA":["Failed to open."],"6LbUG7":["The repository is private and your GitHub account doesn't have access to it."],"6MnZEC":["Terminal failed to load"],"6O626z":["No headings match \\"",["trimmedAnchorQuery"],"\\""],"6Pxqwv":["No project templates yet. Create one to make it available everywhere in this project. Folder-scoped templates live on each folder's overview page."],"6Uau97":["Skip"],"6V3Ea3":["Copied"],"6VqW-1":["Remove ",["keyName"]],"6WdDG7":["Page"],"6YtxFj":["Name"],"6ZhdPI":["What the agent may read, write, and surface."],"6_ZOw4":["Copied full path"],"6bTTAN":["Invalid input — pick a different folder."],"6cR-PU":["Already open"],"6caB2T":["Connect an existing repository"],"6cuT_1":["Open date picker for ",["keyName"]],"6cyguR":["Connect GitHub to continue."],"6eniID":["Map the architecture"],"6fGjTz":["Show fewer"],"6g2jsp":["Update skill"],"6gRgw8":["Retry"],"6h4zVU":["What would you like to create?"],"6hfDJr":["Server error: ",["status"]],"6ibbCg":["Create your first file"],"6ki7F2":[["0","plural",{"one":["#"," item"],"other":["#"," items"]}]],"6lGV3K":["Show less"],"6m_7We":["Open this settings dialog."],"6q0rnH":["writing"],"6qMe0o":["Draft a technical spec for my project. Start with an overview, then add cross-linked pages for the architecture, the key modules, and the open questions, all linked from a specs index."],"6s7LXO":["Heads up"],"6u9LvN":[["days","plural",{"one":["#"," day ago"],"other":["#"," days ago"]}]],"6vEr3W":["Link target"],"72xhRD":["Diagram view mode"],"74-bX-":["A pull quote stands out from the surrounding text."],"74eHt-":["No file or folder selected"],"75Y1dk":["Horizontal pill strip + active panel below; click a pill to switch panels."],"77SdEP":["Delete ",["itemName"]],"7FamGZ":["Go to line"],"7Fkcej":["+ Add ",["addChildName"]],"7H4UHD":["Documents tagged <0>#",["tagName"],"</0>"],"7JtSLi":["Failed to delete path"],"7KeV5F":["Undo all failed: ",["message"]],"7OhaRy":["Source search"],"7Ongq0":["Condense my AGENTS.md file to less than 40k characters"],"7OwvEL":["Show HTML preview"],"7PNNNs":["This sends content off your machine"],"7PXYaF":["<0>ok</0> won't run in external terminals until you add it later from the File menu. OpenKnowledge's built-in terminal and AI tools keep working."],"7PzzBU":["User"],"7YRrJ9":["Available in the OpenKnowledge desktop app. From a terminal, use<0> ok config-sharing status</0> / <1>share</1> / <2>unshare</2>."],"7_bFEL":["Drag ",["patternText"]," to reorder"],"7apDiJ":["A folder named <0>",["sanitized"],"</0> already has files here. Pick a different name."],"7d1a0d":["Public"],"7hctf2":["Describe the project you want to create"],"7jIIFX":["You're all set up!"],"7qRHf0":["Install for Claude Chat & Cowork"],"7uBlRT":["Copy the focused file-tree item so Paste can duplicate it."],"80c4-P":["Code copied to clipboard"],"81H_23":["Add properties"],"881Uwh":["Delete selected table"],"89TtiD":["New file from template \\"",["displayTitle"],"\\" (",["fileName"],") in the project root"],"8BsGpU":["A key is set, but the embeddings provider rejected it or was unreachable — search fell back to keyword matching. Check the key in <0>Settings → Account</0> and your provider settings."],"8F1i42":["Page not found"],"8FqTCr":[["chunksRemaining","plural",{"one":["#"," unresolved hunk"],"other":["#"," unresolved hunks"]}]],"8Gzz2G":["worktree of ",["worktreeOf"]],"8IP5jY":["Each selected tool gets an OpenKnowledge MCP entry."],"8Jm2EP":["Toggle heading levels 1 through 6."],"8OGgNM":["Open or close visual-editor find."],"8OxKZy":["Move succeeded but the sidebar may be out of date — refresh to resync"],"8PmoQF":["Open the insert menu in an empty or active text position."],"8RtNI0":["Failed to load documents"],"8XQRON":["Loading repositories"],"8_brI5":["Name is required"],"8cS0nH":["Config sharing unavailable: ",["0"],"."],"8cpOa8":["Couldn't disconnect — please try again."],"8cpeU3":["Shared repositories"],"8eW0WQ":["No matching repositories."],"8fRyLo":["Invalid patch payload"],"8fc_3j":["Protected branch — cannot push"],"8m8diM":["No location selected. Use Browse to choose a folder."],"8tjQCz":["Explore"],"8uAWix":["This template lives in a parent folder — deleting it affects every folder beneath it that doesn't define its own version."],"92rbk2":["Mirror loading <0>",["mirrorRef"],"</0>"],"96G6Re":["New folder"],"96w9hU":["Something went wrong opening this file (HTTP ",["status"],")."],"99eR72":["Visual editor table selection"],"9Bd18D":["Failed to load hub pages"],"9NJWgv":["Backlinks"],"9OIqw4":["You don't have write access to this repo."],"9PQysm":["Hide advanced"],"9R7pRC":["No tags match \\"",["trimmed"],"\\". Continue typing to create one."],"9UQ730":["Clone"],"9V0W-R":["Adds the OpenKnowledge skill to the <0>Claude Desktop App</0> so it's available in Chat and Cowork sessions."],"9bCiQ8":["No pages are missing incoming graph links."],"9clcD5":["Open documents tagged #",["chip"]],"9dw5bW":["Create with ",["0"]],"9euN0m":[["count","plural",{"one":["#"," more cross-doc participant"],"other":["#"," more cross-doc participants"]}]],"9fhQRL":["Beta channel"],"9fvog2":["Preview unavailable: ",["errorDetail"]],"9i21pa":["Commits happen automatically"],"9jnjV0":["Embed an audio file with native player controls."],"9mEZeD":[["name"]," CLI"],"9npOH9":["Open file"],"9o1bIV":[["behind"]," behind"],"9oE4C3":["Browse your repos:"],"9sBe85":["Follow us on"],"9tJX8r":["By meaning"],"9zb2WA":["Connecting"],"A1taO8":["Search"],"A50vr3":["Use lowercase letters, digits, and <0>-</0> only."],"A5CYnd":["Broken link"],"A5hiCy":["Create template"],"A67Uwj":["Still loading"],"A6h5b-":["File duplicated"],"AAlr5Y":["No collab server for this worktree — run <0>ok start</0> here, or reopen the project."],"AB4qw9":["New terminal"],"AE7BY3":["The terminal session ended."],"AIn2Yv":[["displayName"]," CLI, ",["hint"]],"AItsE5":["Open it there"],"AKxFtn":[["openedWorktreeCount","plural",{"one":["worktree"],"other":["worktrees"]}]],"ALhMYW":["Terminal"],"AQ-Lfg":["Couldn't load templates"],"AQGtjK":["Commands run with the full access of your macOS user account on this machine. Turn this off to disable the shell."],"ATGYL1":["Email address"],"AVW-K9":["Failed to load orphan pages"],"AWOSPo":["Zoom in"],"AaaESH":["Auto-sync is off for this worktree, inherited from ",["project"],". Change it in Settings → Sync."],"AcK_r0":["Claude CLI"],"AczYxH":["Custom open-knowledge entry — not managed by OpenKnowledge"],"AdcGcG":["Applying your change"],"AddR83":["Could not create project. Try again or pick a different location."],"AeHuzT":["# One pattern per line.\\n# Examples:\\n# drafts/\\n# *.draft.md\\n# !keep.md"],"AeXO77":["Account"],"AiNMQ7":["This project lives only on this computer. Connect it to GitHub to back it up and share it with other people."],"Aif3E7":["Enable semantic search"],"Am78jY":["Drag ",["keyName"]," to reorder"],"Aq-O0x":["status"],"AqnqMJ":["API key set"],"ArBWJf":["Undo last edit"],"AsqRE_":["Default location for new attachments"],"AtBdnD":["Couldn't delete skill: ",["error"]],"B11p-O":["Edit markdown link"],"B2DrPb":["Auto-save"],"B2Srgd":[["packName"]," skill installed."],"B3NAZC":["Open Navigator"],"B4_ipX":[["conflictCount","plural",{"one":["#"," file conflicted"],"other":["#"," files conflicted"]}]],"BAH4qX":["Selected graph item"],"BBqGS9":["Desktop"],"BD0XSC":["Failed to load project templates"],"BEkF-P":[["userName"],", ",["tabCount","plural",{"one":["#"," concurrent tab"],"other":["#"," concurrent tabs"]}]],"BGHHtQ":["Single page"],"BH56dn":["Custom display text"],"BQKHuL":["Restart terminal"],"BQu9Pg":["Symlink"],"BUyQnq":["Couldn't restart the server. Try \`ok start\` in this folder."],"BY-g4_":["Add pattern"],"Bdha5y":["Publishing..."],"BeWTQy":["Loading starter packs"],"BgV29F":["Visual editor find input focused"],"Bn9-El":["default"],"Bv5a9_":["Selection statistics"],"Bx4EXG":["Actions for ",["label"]],"By-7Pn":["Toggle a bullet list."],"BymzO4":["Document outline"],"C37Zkt":["Send to"],"C62P6b":["Editor selection"],"C7XjNB":["Global Skill"],"C9TBvF":["No Outgoing"],"CCTop_":["Recent"],"CFnavk":["This project isn't a git repository, so worktrees aren't available."],"CKyk7Q":["Go back"],"COr1Y7":["Pick <0>openknowledge.skill</0> from your <1>Downloads</1> folder. It enables automatically."],"CSL0l1":["Couldn't clear the key — please try again."],"CTJLpz":["\\"",["trimmed"],"\\" already exists here"],"CU3AiE":["Switching branches"],"CWzc2T":["<0>~/.ok/bin</0> and <1>~/.ok/env.sh</1> stay either way — the app always maintains them."],"CXTwen":["Can't safely edit this project config"],"CXj9C-":["New property name"],"C_WGy8":["This file is too large to open in the built-in text editor (1 MB limit). Use Open file below to open it in another app."],"C_cPoW":["Your GitHub session expired — sign in again to verify push access."],"ChAtFg":["You don't have permission to push to this repo"],"CifUuG":["Update available"],"Ck9XRt":["Couldn't save the key — please try again."],"CmeH9S":["Add property to ",["keyName"]],"CoHvYd":["Moved ",["0"]," to position ",["1"]," of ",["2"]],"CvsD6Y":["via ",["viaTags"]],"D-Oh1s":["How to set up ",["0"]," (opens in browser)"],"D12vtS":["(detached)"],"D2CwBE":["Create a new OpenKnowledge project from the <0>",["0"],"</0> starter pack (",["1","plural",{"one":["#"," folder"],"other":["#"," folders"]}]," and starter templates) in the folder of your choice."],"D4H2N6":["Remove ",["tag"]],"D8OV7J":["Only collaborators"],"DDTdLl":["Code block settings"],"DELNQk":["Collaborators see your in-progress edits as soon as they sync."],"DEWDbv":["Show diagram"],"DF1MtZ":["Loading conflict for ",["filePath"]],"DFfRbX":["Sync status: ",["syncStateLabel"]," — git identity unset"],"DId6MT":["Project-level pages with no outgoing graph edges."],"DJd000":["Activate the previous editor tab."],"DPfwMq":["Done"],"DVh_Tb":["Failed to clean up after trash"],"DXd9LM":["New worktree"],"D_WKe_":["Click an agent's avatar in the presence bar to view their session."],"DbILZA":["No matches. Some files are excluded from search (hidden or ignored files)."],"DeDYLr":["Unrecognized wiki link"],"DgcGrb":[["fileCount","plural",{"one":["file"],"other":["files"]}]],"DhK_hZ":["Moved \\"",["name"],"\\" to ",["0"]," (",["skipped"]," binary file(s) not copied)"],"DhLHEb":["Failed to load activity"],"DiFKSL":["Counting markdown files"],"Dnn2XG":["Automatic"],"DrYM2Z":["Sync disabled"],"DskIkK":["Sign-in stream ended without confirmation — please try again"],"Dub54T":["Preview browsers can't auto-copy. Use Cmd/Ctrl+C on the URL above, or open OK in the desktop app."],"Dvwa0U":["Create a worktree from this branch"],"Dw1T_W":["Rename ",["label"]],"E1Da_b":["This permanently removes ",["0"],". Agents that invoke this skill by name will fail until it's recreated."],"E1_c72":["Task list"],"E1tG2u":["Get Claude Code"],"E2Mv-X":["Copy source"],"E4XYYH":["Enable terminal for this project"],"E5WeIy":["Reopen the most recently closed editor tab."],"E6lrpp":["Manage the GitHub account OpenKnowledge uses to browse and sync your repositories."],"E7BhZn":["Blank note"],"E9bKSA":["Creating"],"EBVbtP":["Could not duplicate item"],"EDl9kS":["Subscribe"],"EDm3wJ":["Loading diff renderer"],"EEYbdt":["Publish"],"EHu0x2":["Syncing"],"EJuO7B":["Connect a GitHub account to browse and sync your repositories."],"EL_YRd":["Mirror of <0>api-spec</0>"],"EOjU5V":["Inline Math Properties"],"ETyvvg":["No language match."],"EVnzPs":["Edit with AI"],"EWX92Z":["Collapse Ask AI"],"EZVxVz":["Replace the active match from the replace field."],"E_BHoD":["Could not move \\"",["targetName"],"\\" to the Trash. Do you want to permanently delete instead?"],"E_tNGD":["Connected as @",["login"]],"Ea1prf":["Choose which editors every skill in this project installs into."],"EarrCe":["Search emoji"],"EbZT7P":["Toggle the left file sidebar."],"EbjWsS":["Current commit"],"EcM3k7":["Failed to clean up pending ",["kind"]],"EcR0fl":["Checking for installed agents"],"EdQY6l":["None"],"EeRZnZ":["Expand burst ",["burstNumber"]," diff"],"Ef7StM":["Unknown"],"EhDLBx":["You modified <0>",["filePath"],"</0> locally, but it was deleted upstream."],"Ehkru0":["Open, navigate, accept, or dismiss CodeMirror completion suggestions."],"EiVgl5":["You don't have permission to push to this repo."],"Eji13z":["Toggle highlight formatting."],"EkH9pt":["Update"],"El7NbA":["Heading 2"],"Emz5BG":["Embeddings are computed only when a search runs and are cached locally under <0>.ok/local</0>."],"EoaQyO":["Append-only log of what changed."],"EqrC_R":["Undo failed: ",["message"]],"EqtBXb":["Visual editor find open"],"ErRi6L":["Template \\"",["label"],"\\" deleted"],"Es-eZU":["Remove from recent projects"],"Ev2r9A":["No results"],"EvPX7f":["Opens a folder picker to choose where to clone the repository."],"Evq3lu":["Orphan mode"],"ExPiRQ":["Move to the next CodeMirror lint diagnostic."],"ExUzM4":["skill \\"",["0"],"\\""],"F-NRCj":["Add property"],"F-vBv0":["Ask"],"F0OA00":["Get ",["displayName"]],"F1T9y_":["Showing top matches — keep typing to narrow"],"F4IYWe":["Share doc"],"F4vEsL":["Sync status: ",["syncStateLabel"]],"F6pfE9":["Active"],"FBknns":["HTML"],"FCAcjR":["Run a real terminal docked inside OpenKnowledge, starting in this project's folder."],"FCxvG5":["First item"],"FEK4oC":["OpenKnowledge will be initialized at <0>",["gitRoot"],"</0> — the parent of your new folder, because it contains a <1>.git</1> folder (one project per git repo)."],"FEqWFL":["Guides your AI agents on how to work here."],"FEr96N":["Theme"],"FNTx6u":["Search \\"",["semanticSubmitQuery"],"\\" by meaning"],"FOGD7m":["Create something great."],"FOyCTr":["Your OpenAI API key, used only to create embeddings of your content for semantic search. Stored once for this machine in <0>~/.ok/secrets.yml</0> (readable only by your user account) and shared across all projects. Turn the feature on per project in This project → Search."],"FRYB1Q":["/api/config returned a malformed body"],"FRqZ9v":["Couldn't update skill: ",["0"]],"FTUGgh":["Enter a repository URL or owner/repo"],"FUMerq":["Could not enable sync: ",["detail"]],"FWQuPE":["This project is running a different, incompatible build of OpenKnowledge than this app (v",["0"],")."],"FXk_zY":["Adds a guided workflow for authoring new Agent Skills."],"FjkaiT":["Zoom out"],"FnMkli":["Sync disabled — you don't have permission to push"],"FqTpiN":["Bird wiki"],"Fqr8BP":["Multi-page PDF viewer with toolbar controls (thumbnails, page nav, zoom)."],"Fsx78O":["Add the <0>ok</0> command to your terminal"],"FvMSms":["Renaming changes the file on disk and the id agents use to pick this template."],"FvpFSZ":["Reveal in Finder, ",["hint"]],"Fxf4jq":["Description (optional)"],"Fy4GgU":["Explain how your codebase works so teammates and AI agents can find their way around. Good for documenting the architecture, the main parts, and the questions new contributors always ask."],"FyW0WO":["Authorize in browser"],"G-JBA1":["Source mode requires a live connection — your edits are saved and will appear when you reconnect."],"G0YZ-I":["Indent or outdent list item"],"G1Gw0v":["New template"],"G1XxbZ":["Checkbox"],"G4-bgo":["Ask AI (from selection)"],"G7-rf8":["Pattern syntax error: ",["message"]],"G7cMuO":["HTML preview"],"G8t9NN":["Add a property"],"GA-UkN":[["keyName"]," type: ",["typeLabel"],". Click to change."],"GDvlUT":["Role"],"GF51cw":["Give the AI tools you use access to read and update your projects. Pick what to set up below, and change it anytime."],"GGsM4y":["Selected in graph"],"GJH-AT":[["docName"]," is ",["0"],". OpenKnowledge currently opens files up to ",["1"],"."],"GK-IRZ":["Undo buttons are disabled — per-session state has been garbage-collected."],"GLxIKR":["How to push manually"],"GN6L5F":["Filename"],"GQDSBN":["Layout options"],"GUYwCr":["Dismiss notice"],"GUqTzn":["Competitor research"],"GXf9hG":["Cloning ",["repoName"],"..."],"G_686w":["Task List"],"G_efLf":["Installed into"],"G_mWXb":["Filter languages"],"GamjcN":["Template saved"],"GemPfn":["Failed to parse forward-links error response (HTTP ",["status"],")"],"Gfr4fu":["Server can't open documents"],"GhjUB_":["Reconnected"],"Gp_twO":["Local path"],"GsBUCk":["Loading settings"],"Gt4gOO":["This folder has unpushed changes. Recipients will see the last pushed version."],"GubkSu":["Use a starter pack"],"GuqOb1":["Failed to load headings"],"Gx0VS1":["e.g. drafts/ or *.draft.md"],"GzPQ2f":["Stay in the loop"],"H-vDm3":["Relaunching to install the update…"],"H0WlWQ":["Grid of rows and columns with a header row."],"H86f9p":["Collapse"],"HAvRAI":[["skillCount","plural",{"one":["skill"],"other":["skills"]}]],"HCn0Ay":["Toggle strikethrough formatting."],"HGNCsl":["Connection lost — keep this tab open, your edits will sync when reconnected"],"HIb0vl":["Network error — please try again"],"HM56Bx":["Creating..."],"HPTPGr":["Create a new spec file for my user story"],"HSh8u_":["Folders"],"HTW0Zw":["One more step: run <0>claude</0> in this project and approve OpenKnowledge once."],"HXFyWD":["Split diff"],"HdkSiO":["New file"],"HfI1dR":["I already have it locally →"],"Hl89Qd":["Loading templates"],"HlmZBk":["Documents response did not match expected shape."],"Hnl9nT":["Set where pasted and dropped files are stored for this project."],"HoWElC":["This ",["targetNoun"]," has been moved, renamed, or deleted in your local copy of branch <0>",["branch"],"</0>. Please commit your changes or enable auto-sync."],"Hp1l6f":["Current"],"HpK_8d":["Reload"],"HptUxX":["Number"],"HqiZvw":["OpenKnowledge stores its configuration and internal files inside a newly created <0>.ok</0> directory in your project root folder."],"Hrz9NY":["Wiki link"],"HyvSqq":["Project Skill"],"I1gRhX":["Failed to rename"],"I5685_":["Try a prompt"],"I5AfhE":["Sync status unavailable — server unreachable."],"I7Exsw":["Follow us on X"],"IA1wNb":["The Claude Desktop App didn't open the file. Is it installed? (",["msg"],")"],"IA6JW2":["Detecting"],"ICoNYz":["You can also manage this in Settings."],"IInnZo":["Conflict"],"IKoTAC":["Keep disabled"],"IN4UX8":["Search (",["searchShortcut"],")"],"IQPyrD":["Missing page — click to create"],"IRv9cH":["Cloned ",["repoName"],"."],"IWGfGF":["Checking your GitHub connection"],"IX7-sq":["Something went wrong opening \\"",["docName"],"\\"."],"IX_uXB":["my-feature"],"IajAbS":["Add a starter pack"],"If0crP":["Open with AI ",["targetDisplayName"],", ",["hint"]],"IgTwLt":["Open this document in the editor and collapse the graph."],"Ik-gP0":["Heading H",["level"],": ",["text"]],"Iq8zdU":["Close terminal"],"IrB5AK":["Server-side cleanup failed for ",["failedCount","plural",{"one":["#"," item"],"other":["#"," items"]}]],"IreQBq":["Repository"],"It9ARY":["Toggle the right document panel."],"Ix0K8o":["Hide external URL nodes"],"J2MgzQ":["Undo all edits on ",["docName"]],"J2Mv98":["Name (e.g. ",["login"],")"],"J2eKUI":["File"],"J3HzPL":["Collapse ",["keyName"]],"J6N5MX":["Couldn't construct the share URL. Try Done and re-share."],"J6mxC1":["A network problem or GitHub outage interrupted the clone."],"JCxGEX":["No disconnected pages. Pages appear here only when they have no incoming and no outgoing graph edges."],"JE21eh":["Symlink to ",["targetPath"]],"JK-Ave":["Hide thumbnails"],"JL3si7":["Updating"],"JLUTgi":["No tags yet — author \`#tagname\` in any doc to populate the index."],"JLzQi_":["Close ",["accessibleLabel"]],"JOcPqH":["Bring a remote repository onto this machine."],"JWsZlx":["Open a project to edit."],"JZ8cO6":["Light, dark, or follow the OS."],"Jejur6":["Couldn't load document"],"Jhj_lh":["Modify the link target, anchor, and display label."],"JkCD2u":["Sync paused — you don't have permission to push to this repo"],"JmfgFc":["(a worktree of ",["0"],")"],"Jqqevv":["System error"],"JtD-Br":["Page link"],"Jw6EC4":["Branch switch failed — try opening the ",["targetNoun"]," manually."],"K-a33w":["Start writing to create this page"],"K-h9cT":["Couldn't save the resolution for ",["filePath"],"."],"K0N7zS":["Config sharing status read failed"],"K1ckLX":["Failed to create folder"],"K6MQQk":["Sync is failing. See the sync status for details."],"K6jjWB":[["packName"]," was already set up. Nothing to do."],"K6jxcj":["Add a key"],"K8-WWn":["Move between table cells"],"K9J00P":["Clone failed — connection error"],"KDuPiY":["Uploading ",["fileName"]],"KDw4GX":["Try again"],"KFdXwz":["Show panel (",["panelShortcut"],")"],"KH5bQi":["Using the <0>OK_EMBEDDINGS_API_KEY</0> environment variable (managed outside OpenKnowledge)."],"KIIamL":["OpenKnowledge will create commits and push them to your remote automatically. If you do not want automatic commits in your git history, you should not enable auto-sync."],"KOZud0":["Build a competitor research knowledge base. Start with an overview page, then add cross-linked pages for each competitor, their products and pricing, and the sources behind every claim."],"KPW5WC":["moved template"],"KQGZuq":["Reused if it already exists, created if not."],"KRJ6xh":["No tags yet. Continue typing to create one."],"KWL_Ih":["Blog post"],"KX1MZR":["Your repositories"],"KYSocE":["Research the extinction of flightless birds"],"KYcZ6Y":["Above"],"KZLdgR":["See <0>#design-docs</0> for the latest specs."],"K_vT1F":["Upstream sync"],"KaFCD3":["Open this link in a new tab and collapse the graph."],"Kf7GG5":["Restarting the server…"],"Kgdbkt":["Switch to local-only refused"],"Kh1n4a":["<",["componentName"],"> isn't a known component. Copy the source to use it elsewhere, or delete the block."],"Khxcyu":["Terminal access isn't enabled for this project."],"KkEAud":["Create a file from the current document or folder context."],"KmydK6":["Bold"],"KnoB--":["Will be saved as <0>",["sanitized"],"</0>."],"KsAPaB":["This branch is checked out in:"],"KszKI_":["Skill level"],"KujtjC":["Find"],"L-rMC9":["Reset to default"],"L1ZE3M":["Document statistics"],"L3CEC1":["this item"],"L4Cdd9":["or create a new file <0/>"],"L6Hhh6":["(root)"],"L8fKuc":["Run this in your terminal"],"L9Y9Om":["Top linked pages"],"LBwUR6":["Branch switch timed out — try opening the ",["targetNoun"]," manually."],"LCUy_N":["Session ended"],"LDuM35":["Replace current match from field"],"LE7t79":["Clone to a new folder"],"LKOLNn":["No AI agents installed"],"LNum6A":[["minutes"]," min ago"],"LRgZAt":[["owner"],"/",["name"]," already exists"],"LXdWeS":["Medium section heading."],"LXfNU-":["Navigation and suggestions"],"LYufDw":["Failed to enable semantic search — ",["detail"]],"LbmLyU":["Can't safely edit this tool's config"],"Lcehxn":["Save resolution"],"LdABLa":["Could not open ",["target"],". Try opening it manually."],"LdKIHS":["Draft a spec"],"LhQlGR":["This project is running an older version of OpenKnowledge (v",["0"],") than this app (v",["1"],")."],"LhWYpm":["Other OK paths are tracked upstream:"],"LiAw2k":["What this changes"],"LlHqdU":["Initializing project"],"Llyqvo":["This usually means one of:"],"LpB85N":["Plain"],"LtI9AS":["Owner"],"LtSYdi":["Reveal in Finder"],"LtiJ5c":["Project skill"],"LuoJWu":[["truncatedShownCount","plural",{"one":["Showing the first item in one folder — the rest of that folder is hidden."],"other":["Showing the first ",["formattedCount"]," items in one folder — the rest of that folder is hidden."]}]],"LwMxXg":["Failed to open worktree."],"M1OfV9":["Next source diagnostic"],"M3ytY_":["This looks like a drive root (e.g., C:\\\\). Scaffolding here will scan an entire drive."],"M5mfAe":["Add tag"],"M9597s":["Preparing share URL..."],"MCjC9A":["Delete ",["deleteDescriptorLabel"]],"MDZSJe":["When the agent runs its scheduled work."],"MGb89P":["Insert, delete, move, copy, and indent source editor lines through CodeMirror's default keymap."],"MHrjPM":["Title"],"MKOVhz":["Enable git auto-sync"],"MQIM_Y":["Couldn't copy. Select the URL above to copy it manually."],"MTs6g3":["Couldn't reconnect after server restart"],"MUBR8r":["Rename succeeded but the tabstrip may be out of date — refresh to resync"],"MUrVEo":["No recent projects."],"MV-Dkb":["Found ",["countDisplay"]," markdown files"],"MVxpbf":["Find and replace"],"MWrUEd":["Undo all"],"MZSBsh":["No templates yet. Add one to give new docs in this folder a ready-made starting point."],"MZoxVx":["Failed to load tags. Press Escape and re-open to retry."],"Mb_20S":["Visual"],"Md709y":["Loading ",["fileName"]],"MdpSC1":["New skill"],"Mh_4hd":["Previous tab"],"Mj8R8K":["Couldn't install skill: ",["0"]],"MmDDWK":["Recently opened"],"MmqnGI":["No global skills yet."],"Mnavhe":[["propPanelDescriptorLabel"]," Properties"],"MqQoV-":["Describe what you want to build, start a blank file, or scaffold from a template."],"MrwYIK":["Toggle a source comment through CodeMirror."],"MsuXaI":["Hide panel (",["panelShortcut"],")"],"My9uXI":["Updated \\"",["display"],"\\" to ",["0"]," — your previous version is in history if you need to restore it."],"N1KkEO":["Jump to last tab"],"N1YYa7":["Loading image"],"N1mdmS":["This file can't be opened in the text editor."],"N2FcBE":["Synced"],"N2S1rs":["Empty"],"N2eHWq":["Code Block"],"N3_ozB":["Hubs"],"N55YNr":["Choose whether this project's OpenKnowledge setup, including its AI-tool connections, is saved with the project so teammates get it too, or kept only on your computer."],"NEzPEh":["Create a new branch, or check out an existing one, in its own window."],"NIWAux":["No docs registered under #",["tagDocsName"],"."],"NJyQi_":["Branch ",["shareBranch"]," no longer exists on the remote."],"NKkZXl":["Initialize and open"],"NNJsn7":["One more step: enable it in Cursor → Settings → Tools & MCP (Cursor leaves project servers off until you turn them on)."],"NOHyEE":["Retry push"],"NORKZU":["Pattern warnings: ",["summary"]],"NQ8llq":["Add item"],"NRSLBe":[["diffMin"],"m ago"],"NSnIUP":["Two-page (even)"],"NUr4kz":["A reusable starting point for new documents in this folder."],"NYUhy5":["Subfolder name"],"N_7kkF":["Read through this codebase and draft a technical spec for the most complex module: an overview, the architecture, key files, and open questions, all linked from a specs index page."],"NcurBF":["Pan down"],"NjrIak":["File: <0>",["fixedName"],".md</0>"],"NkXEFS":["Restore failed — document unchanged"],"NmPNJJ":["Copy code"],"Nn4GgW":["Will be created as <0>",["sanitizedName"],"</0>"],"NnQapF":["Open with AI ",["targetDisplayName"]],"NpC29w":["Create a new list item from the current list item."],"Nu4DdT":["Sync"],"Nu4oKW":["Description"],"NuH1jp":["Public repository"],"Nv3mUj":["Show advanced"],"NvOvTi":["Create in <0>",["dirDisplay"],"</0>"],"Nx7BWE":["Git auto-sync"],"NxW-md":["Resize ",["handleKey"]],"NzFvyK":["Session ended — undo unavailable"],"O0Z2Xr":["Outgoing"],"O2UpM1":["Browse"],"O3oNi5":["Email"],"O4PnDd":["AI tool management is only available in the OpenKnowledge desktop app."],"O6yEPk":["Create a new OpenKnowledge project in the folder of your choice."],"O7_W_a":["Open with AI"],"OD0FCX":["Hidden “",["basename"],"”"],"ODGGlj":["Folder name: ",["detail"]],"OETysD":["No hub pages yet. Hubs appear once pages accumulate inbound graph links."],"OEu_0l":["Failed to load skills: ",["0"]],"OFBmkg":["Search files, commands, projects, and AI handoff actions. With text selected in the visual editor, this chord adds a link instead."],"OJTOUj":["Requires ",["brand"],"."],"OJeiSH":["Failed to add property"],"OLBz-_":["Mermaid diagram failed to render."],"OLIKgw":["Drag item ",["0"]," to reorder"],"ONPvOb":["Loading agent activity"],"ONgEZF":["Loading headings for ",["pageTarget"]],"OOIVJo":["Uninstalled \\"",["0"],"\\" from ",["1"]],"OTF92M":["Label <0>(optional display text)</0>"],"OVjNeX":["Terminal ",["0"]],"OX2Neh":["Inline code"],"OXb_Df":["Settings content"],"OYnx7O":["Path cannot start with \\"/\\""],"OZJeTZ":["Skill"],"OdmsFg":["Failed to delete item"],"OeAl1e":["e.g. assets/uploads"],"OgyJSr":["Local only"],"OiHJdA":["Move through slash, wiki-link, tag, and path suggestions; accept or dismiss the active suggestion."],"Okd2Xv":["Toggle underline formatting."],"OlAl5i":["Expand all"],"OmHTGj":["Disable git auto-sync"],"On0aF2":["Website"],"Oo_WWc":["No pages found"],"Oos8fo":["Copy command"],"OplnBG":["Managing AI tools is unavailable in this build."],"OuY8t9":["Open in current branch"],"OvEjsP":["Copying..."],"OxplNM":["Updated \\"",["0"],"\\": added ",["1"],", removed ",["2"]],"Oxyd5f":["Pick a name"],"OyIC0Q":["Project name"],"P-ye9o":["Could not open folder picker"],"P0HC30":["This ",["targetNoun"]," moved to <0>",["0"],"</0>. Open it there?"],"P3NS4G":["Pattern syntax error (line ",["lineNumber"],"): ",["message"]],"P3hnm0":["File too large to open"],"P47EWZ":["Could not update sidebar settings"],"P6gXB-":["Replace ",["keyName"]],"P6lAT3":["Folder target: ",["linkTitle"],". Click to open the overview."],"P8yDjG":["Name can’t be empty, \\".\\", \\"..\\", or contain / or \\\\"],"PB4upl":["Find previous match"],"PBwmDJ":["Searching by meaning"],"PBxg_E":["Not now"],"PCNIuJ":["File an issue"],"PCSkw2":["Skills"],"PIMM5l":["You're subscribed!"],"PKLY-1":["Opening..."],"PMyJ9C":["No edit session yet"],"PPFQ3o":["Installed \\"",["0"],"\\" into ",["1"]],"PQCdtv":["\\"",["docName"],"\\" doesn't exist."],"PR9FSv":["Move to the next visual-editor find result."],"PRnH8G":["of ",["0"]],"PVUn_c":["Open folder"],"P_bX4O":["How to set up"],"PdA9NZ":[["ahead"]," ahead"],"PdJZ5p":["No skills yet."],"Pgu10b":["Saved as <0>",["slug"],".md</0>"],"PgzIpb":["Move to the previous visual-editor find result."],"PiH3UR":["Copied!"],"PkeYXL":["Expanded graph mode"],"Pkw7J9":["This folder is empty."],"PqYWiC":["Couldn't restart the server automatically. Try running \`ok stop all\` in a terminal, then reopen this project — or restart your computer if it persists."],"PrJYSN":["This folder isn't on GitHub yet. The link won't work until it's pushed."],"PrhzDE":["Pan up"],"Pyp1NA":["Restore to this point?"],"Q5fqMz":["Connection error — try again"],"Q6hhn8":["Preferences"],"Q7W-mC":["Same folder as current file"],"Q8A-U_":["Connected to"],"QAi7Q9":["Branch <0>",["trimmed"],"</0> already has a worktree — it'll open in its own window."],"QDZbvN":[["diffDays"],"d ago"],"QJaG-9":["Choose CLI for new chat"],"QNxpRm":["Dock terminal to the right"],"QOINDn":["empty"],"QQghPu":["Install in Claude Desktop"],"QR5SP1":["created template"],"QYfQdv":[["displayName"]," CLI"],"QcpeeE":["Navigate to ",["docName"]],"QfFBdJ":["The template's filename (without \`.md\`)."],"Qj4RL5":["Completed:"],"QlxHAH":["Showing results for \\"",["semanticResultsLabel"],"\\""],"QnjpOq":["What do you want to build?"],"QqBQu1":["Label <0>(visible link text)</0>"],"Qvls7J":["Eng specs"],"Qw-7Ie":["A simple place to write, with one file per topic and a daily journal. Pick this if you just want to start writing and let the links between notes build up over time."],"QyioBP":["Move up"],"R0cyYB":[["0","plural",{"one":["#"," request blocked by the preview's security policy"],"other":["#"," requests blocked by the preview's security policy"]}]],"R0jJzV":["Paste URL, owner/repo, or search your repos"],"R3y75Z":["Edit source"],"R65q-K":["A real shell is off for this project. Turning it on runs commands with the full access of your macOS user account."],"R9IDFz":["Renames the folder on disk and the id agents use to invoke it."],"RDjuBN":["Setup"],"RDrXh4":["Configure user, project, and integration settings."],"RG4XHV":["Copy ",["0"]," prompt"],"RGCCrg":["Copy share link"],"RGkNeJ":["Initialize a starter pack"],"RJ3a8Z":["Looking for <0>",["lookingForUrl"],"</0>."],"RN62Q8":["We'll build <0>openknowledge.skill</0>, save it to <1>~/Downloads</1>, and open the Claude Desktop App for you."],"RSqaSd":["Project root"],"RVZJWQ":["Search projects..."],"RXNu_r":["Shared via git with everyone working on this project."],"RY6Bq1":["Open shared ",["targetNoun"]],"RaPMZv":["Keyboard shortcuts available in the editor and workspace."],"Rah7yq":["What should the AI do? (optional)"],"RfHNf8":["Open activity panel for ",["tooltipName"]],"RfaEio":["Toggle source comment"],"RgbKEe":["You don't have access to this repository."],"Rj01Fz":["Links"],"RlCInP":["Slash commands"],"RlLl3G":["Actions for ",["0"]],"RmBY0A":["No git remote"],"RnrnTe":["Already set up — ok is available in your terminal"],"RobAKV":["Update the destination and optional section anchor."],"Rq1vFD":["Tree view options"],"RrAIZx":["What config sharing covers"],"Rx5ReQ":["Rename ",["keyName"]],"RyIKxy":["This ",["targetNoun"]," has been moved, renamed, or deleted in your local copy, and that change hasn't synced yet."],"S33tz3":["Not connected"],"S34Vju":["Have something else in mind?"],"S6l5dv":["Could not start creating a new item"],"S9Vnum":["Remove ",["patternText"]],"SCoBBH":["Tag suggestions"],"SCzAbA":[["phase"]," — ",["pct"],"%"],"SEYWYq":["Undo all edits on this file?"],"SFN6dN":["Heading 3"],"STTOnz":[["keyName"]," type: complex value (nested; read-only)"],"SUOoXn":["Failed to open project."],"SVLPt5":[["formatted"]," GitHub stars"],"SXCSQd":["Copied path"],"SYfHmN":["Unpin tab"],"Sc1bKE":["Local collaboration data for \\"",["docName"],"\\" could not be cleared in time. Reload to retry."],"ScwcF2":["A project already exists at this location. Pick a different parent folder."],"SgKLfA":["Not connected to GitHub."],"Sh3Qkg":["No matching branches."],"SiUUCS":["Next match"],"SkMZlS":["Couldn't remove <0>",["targetGitPath"],"</0>: ",["removeGitError"]],"Skr_7L":["Search worktrees"],"Sq8lf2":["Editors to install skills into"],"SrOuyg":["Document panels"],"T-654M":["Loading PDF"],"T0OVm7":["The default branch is protected — pushes need a pull request."],"T67A0Y":["Auto-sync pushes/pulls commits to your git remote on intervals and on save. Toggling on requires confirmation."],"TEEPPF":["Will replace existing OpenKnowledge entry"],"TJnkyf":["ok ui responded but server.lock has no port yet"],"TKQ7K-":["Install"],"TLIO3j":["Toggle italic formatting."],"T_wG4n":["We couldn't check your GitHub connection."],"Ta25TG":["No history yet"],"TbjyhA":["Docs"],"ThmUrC":["Could not finalize project setup. Try again."],"Tjc1pH":["Section <0>(optional heading anchor)</0>"],"TsZmgr":["The file on disk, and the id agents use."],"TwYboS":["Navigate CodeMirror source search results or dismiss the search panel."],"Tz0i8g":["Settings"],"Tz9pJB":["Clone stream ended unexpectedly — check if the clone completed"],"U2Kx6T":["Close all unpinned"],"U2pMtf":["tag-name"],"U3IvM5":["Full guide"],"U5Spo9":["Content directory must be inside the project"],"U8CD-l":["Copy full path, No workspace"],"UBv8UK":["Delete Permanently"],"UDFrWm":["Checking GitHub connection..."],"UL8A9w":["Tag"],"UMrOy2":["Skill \\"",["trimmedName"],"\\" created"],"UPjaXD":["Couldn't duplicate \\"",["0"],"\\": ",["1"]],"UQAp48":["Search templates"],"UQMMvx":["Moved \\"",["name"],"\\" to ",["0"]],"URmyfc":["Details"],"UTNVyS":["Select the full source document."],"UTZ97u":["Selection must be inside the project"],"UVLlMV":["Couldn't reach GitHub. Try again?"],"UW2Fg3":["This project's running server doesn't support live editing. Restart OpenKnowledge to fix."],"UW93oq":["Replace key"],"UYcGIW":["Connecting — waiting for collab server"],"Ua78MH":["no response"],"UaDyeb":["Hide selection preview"],"Uay5NL":["This ",["targetNoun"]," was added to branch <0>",["shareBranch"],"</0> recently. Switch and update to open it."],"Uci-Ph":["Ordered List"],"Ud0Pj9":["<0>Mirror source removed.</0> The doc <1>",["src"],"</1> is no longer available."],"UfW9Kr":["Your search queries and the full text of matching pages are sent to your embeddings provider (OpenAI by default) to compute embeddings."],"UhpfxY":["Pan left"],"UkQGhd":["Hide replace"],"Up2_7p":["Copy full path"],"UuYo7g":["This ",["targetNoun"]," has been moved, renamed, or deleted in your local copy. Please commit your changes or enable auto-sync."],"Uuj_R4":["New from template"],"Uw6ERJ":["Couldn't copy: ",["detail"]],"UyROxs":[["mins","plural",{"one":["#"," min ago"],"other":["#"," min ago"]}]],"V48OUT":["You deleted <0>",["filePath"],"</0> locally, but it was modified upstream."],"V7QxyT":["Connection dropped"],"VAHWL_":["Connected as <0>@",["signedInLogin"],"</0>"],"VBE2dw":["Build and keep track of the world behind your story. A home for your characters, places, factions, and the lore that ties them together, so details stay consistent as you write."],"VIwCaD":["Entry"],"VM7H66":["This file is binary and can't be shown as text."],"VNgKZz":["Advanced settings"],"VU3Nrn":["Missing"],"VUijjF":["Embed an image with optional alt text."],"VYd_YA":["Open an existing project folder from disk."],"VZGGPK":["Collapse terminal"],"VZGh8G":["Fold, unfold, fold all, or unfold all source ranges."],"VZSBXL":["Semantic ranking activates the first time an agent runs a search."],"V_6bJ4":["Terminal settings not loaded yet — try again in a moment."],"V_wltx":["Enter a title for this template."],"VbqhBI":["Already at ",["assetContentPath"]," — reusing."],"VcqWBy":["Upload may have succeeded but the sidebar is out of date — refresh to resync"],"VdXv4D":["Clone from GitHub"],"Vlc75q":["Keep file deleted"],"VsaI0G":[["folderCount","plural",{"one":["folder"],"other":["folders"]}]],"VuxVSP":["Start source completion"],"VvS_k_":["Config sharing is now local-only."],"VxO6wR":["Delete selected files or folders"],"VzGJRl":["Add link"],"W-ntoW":["heading-slug"],"W0i24j":["Object"],"W1qRuM":["This document is already active in the editor. Use Open to collapse the graph."],"W3Xlpc":["Set the auto-sync default for users opening this project for the first time. This setting is committed to your repository."],"W5A0Ly":["An unexpected error occurred."],"W7XJN4":["Can't nest projects. An OpenKnowledge project already exists at <0>",["rootPath"],"</0>. Choose a location outside it, or open that project instead."],"W8vpBM":["starter pack"],"W9_Bub":["Local changes overlap with incoming sync"],"WL6puM":["Path resolves outside project"],"WMIKXK":["Are you sure you want to delete ",["targetCount"]," selected items? Folders and all files inside them will be deleted. This action cannot be undone."],"WPwDin":["Open folder on disk"],"WR0y2O":["Share folder"],"WRNXKp":["Searching"],"WWcqsG":["Start here: what this is and how it's organized."],"WZ-vBy":["Permanently deletes <0>",["targetGitPath"],"</0> and all its git history. Working files stay in place. If the parent git repo is intentional (e.g. you cloned it), cancel and pick a location outside it."],"Waiy-j":["The agent's persona, values, and voice."],"WamGNs":["Failed to load PDF: ",["error"]],"WcWS__":["Download file"],"Wcv-Zi":["Make this knowledge base available as a Claude Skill."],"We7h2I":["📝 or assets/icon.png"],"Weq9zb":["General"],"Wgmlsw":["Fetching"],"Wh0im4":["editing [[",["realCurrentDoc"],"]]"],"WhOsNE":["Strikethrough"],"WmPbvm":["Get product updates in your inbox."],"Wq6Wcm":["Please enter a valid email address."],"WqLq6M":["Open with AI ",["displayName"]],"Wt5W56":["Sync is off — your edits will not sync to the remote repository."],"Wtw22s":["Installing"],"WyQxwa":["Connect this project to GitHub to share."],"WyXG7w":["Close all"],"Wyxs0x":["Path cannot contain \\"..\\""],"X0ttSN":["No tags match \\"",["tagListQuery"],"\\"."],"X7u0xR":[["0"]," templates available"],"X8kjQX":["Re-authenticate with GitHub"],"X9VpsP":["Loading folder contents"],"XAyxsa":["Check out remote branch"],"XDzAnp":["Opens in a new tab"],"XH30C4":["document"],"XJOV1Y":["Activity"],"XPJ0sN":[["settingsDescriptorLabel"]," properties"],"XPqe3B":["Create new tag #",["tagValue"]],"XRuL0i":["Create page"],"XU0OXn":["Enable auto-sync"],"XV5sC0":["Open worktree"],"XW18jo":["Page headings response did not match success schema"],"XYlJJT":["Setting up"],"XcGbim":["Show hidden files"],"Xet9MX":["Failed to load backlinks"],"Xewl6B":["Your local copy is behind. Pull the latest changes, then open the link again."],"XfzqjK":["template \\"",["name"],"\\""],"Xl-UUg":["guides/install or https://example.com"],"XmJfZT":["name"],"XnlF3W":["Add the next matching source selection."],"XnoA1k":["This ",["targetNoun"]," only exists on branch <0>",["shareBranch"],"</0>. You have uncommitted changes that prevent switching. Commit or stash your changes, then open the share link again."],"XopE_I":["Failed to parse backlinks error response (HTTP ",["status"],")"],"XpIZmv":["Fenced code block with monospace text."],"XqNHcm":["Couldn't update skill targets: ",["0"]],"XtRoxT":["Page ",["pageNumber"]],"XuQzrk":["Couldn't restart the server — another process owns it. Quit other OpenKnowledge windows for this project, then try again."],"XvPJaT":["Diff layout"],"Xv_ijG":["https://github.com/owner/repo or owner/repo"],"Xw_maT":["Type a query, then press ↵ to search your pages by meaning."],"XyOUTJ":["Exit merge"],"Xzy0s0":["Remove ",["fullLabel"]," from context"],"Y-Urt2":["Block math equation rendered with KaTeX from a LaTeX source string."],"Y1QMlM":["Get set up"],"Y1kX2z":["OpenKnowledge initializes at <0>",["projectDir"],"</0> — the parent of <1>",["pickedRelative"],"</1> because it contains a <2>.git</2> folder (one .ok/ per git repo). <3>Content directory</3> defaults to <4>.</4> (the whole repo); type a sub-folder to narrow it."],"Y6SK9K":["Show source"],"Y8ViJx":["A newer version may have been deployed since this tab opened."],"YC6_wP":["Edit ",["keyName"]],"YEP3X2":["Delete a table when the active table cell selection covers the full table."],"YGIi_c":["Reinstall"],"YJ1BTp":["A skill with that name already exists."],"YKLP_-":["Template renamed"],"YPFBfr":[["detail"]," - ",["kind"]," \\"",["createdPath"],"\\" still exists on disk"],"YSFv5w":["No git repository — config sharing does not apply here."],"YTLmTM":["Remove the parent <0>.git</0> folder"],"YW7Q86":["Search settings not yet loaded — try again in a moment"],"Y_kL7X":["Customize how the editor looks and behaves."],"YaeyFh":["Pulls may overwrite uncommitted edits in your local files."],"Yea-K5":["Restore to this point"],"Yi0VMG":["Upload ",["keyName"]],"YjhKI5":["Cloning..."],"YlDuro":["Fit height"],"YsEYYS":[["behind","plural",{"one":["#"," commit behind"],"other":["#"," commits behind"]}]],"YwPUUP":["This pack is already set up here."],"YyXtnN":["Underline"],"Z1LF1M":["Sharing a doc needs a GitHub repository. Create one for this project."],"Z2M5XM":["Reason: ",["reason"]," (",["osDetail"],")"],"Z3FXyt":["Loading..."],"Z5HWHd":["On"],"Z5h97D":["Hide files and folders from your knowledge base. Hidden items don’t appear in the file tree, search, or AI tools. <0>Learn more about patterns</0>."],"Z8KDox":["Enter a folder name (e.g. brain)."],"Z8lGw6":["Share"],"ZARuZJ":["Couldn't load files"],"ZBYKxv":["Reverts every change this agent made to <0>",["docName"],"</0> this session (",["burstCount","plural",{"one":["#"," burst"],"other":["#"," bursts"]}],"). Other files and writers are unaffected."],"ZBt4rI":["Instruction for the AI"],"ZLQol-":["You can turn this on later in <0>Settings → Sync</0>."],"ZNK2Tq":["root"],"ZQJ1IV":["Activate the last editor tab."],"ZQLDTl":["created folder"],"ZU8VV_":["Remove failed: ",["error"]],"ZWgr0b":["In a subfolder"],"ZWolSV":["You picked the filesystem root (/). Scaffolding here will scan every file on this machine — make sure that's what you want."],"ZWwYwM":["Base branch"],"ZWxfrc":["cleared folder properties"],"ZWyHmq":["This project"],"ZYtq3m":["Connect the AI tools you use to this specific project. These files live in the project folder, so anyone who opens it gets the same setup."],"Zf0w-R":["Take a piece of writing from a rough idea to a finished draft to something you're ready to share. Good for blog posts, essays, or anything you want to move through clear stages."],"ZgGuA4":[["0","plural",{"one":["File"],"other":["Files"]}]],"ZhhOwV":["Quote"],"ZjtgI-":["Command palette"],"Zon_qG":["Mirror source <0>",["label"],"</0>"],"ZptNUh":["Show ",["hidden"]," more"],"ZsGpr_":["Paste link"],"Zue_jx":["Your GitHub token is missing required scopes. Try signing in again."],"Zul8Ry":["never"],"ZvzbDF":["Add it directly to this project."],"ZxXhLY":["Hide Files (",["sidebarShortcut"],")"],"Zz25kq":["Show Files (",["sidebarShortcut"],")"],"_5qBNl":["AI tools & CLI"],"_6FVBz":["Jump to tab 1-8"],"_7UQ7y":["Whole word"],"_8quCH":["From template"],"_902BE":["This ",["targetNoun"]," was shared from branch <0>",["shareBranch"],"</0>. You're currently on <1>",["currentLabel"],"</1>."],"_BthEY":["Open in ",["shareBranch"]],"_NX6gG":["Managing project AI tools is unavailable in this build."],"_PACVa":["Release notes"],"_PBJRl":["Add at least one letter or number."],"_QwkMu":["No matching paths"],"_RcqUM":["You picked your home directory. OpenKnowledge will index everything in your home tree — large and may surface personal files."],"_TDESN":["Network error - ",["kind"]," \\"",["createdPath"],"\\" still exists on disk"],"_TF8ep":["Failed to render PDF"],"_VRtd7":["Couldn't send the selection — please try again."],"_W-elG":["(inline)"],"_WPP7e":["Read-only copy of a MirrorSource block from another doc. Edit at the source and it updates live."],"_XWY2J":["Terminal disabled"],"_ayOfA":["A knowledge base that follows Google's Open Knowledge Format, a shared way of organizing what you know. Pick this if you want your notes to work well with other tools that understand the format."],"_bth6g":["Claude Code is installed, but OpenKnowledge tools aren't connected to it yet."],"_eguJc":["Uploading"],"_gkGSK":["deleted template"],"_hPpdX":["Skill renamed"],"_pY_Vq":["The repository was moved, renamed, or deleted."],"_qD6mn":["Pick the folder where you've cloned it."],"_rP3HI":[["minutes"],"m ago"],"_tekeB":["updated folder properties"],"_tjopj":["Paste duplicate"],"a-cKXz":["Select all source"],"a3H_MR":["Open and focus the Ask AI composer for the current editor selection."],"a5Gha5":["Local changes blocked the merge"],"a5W0q0":["Are you sure you want to delete ",["folderName"],"/ and all files inside? This action cannot be undone."],"a9OzSn":["No pages found for \\"",["trimmedQuery"],"\\""],"aBgwis":["Scope"],"aByJ8j":["How does sharing work?"],"aE2_XM":["One pattern per line — appended to <0>.okignore</0>."],"aENGMB":["Semantic search adds meaning-based ranking to the search tool so conceptually-related pages surface even without shared keywords."],"aM23Wr":["page-name"],"aOp3hw":["Couldn't move to Trash"],"aWlJai":["Starting sign-in flow"],"a_u4ck":["Loading tags"],"aaE55D":["Clear ",["keyName"]],"aalx4E":["Editing broken MDX source: ",["reason"]],"abiHje":["Delete selected items"],"adsMWO":["Resolving deltas"],"aiArms":["We couldn't clone this repository."],"ajz9F8":["Couldn't load conflict content for ",["filePath"],". Try reloading the page."],"aoa6xA":["network error (is \`ok ui\` running?)"],"arUUsK":["Product updates"],"az8lvo":["Off"],"b3Thhd":["Upload failed"],"b4AQFK":["Open activity panel for ",["tooltipName"],", editing ",["realCurrentDoc"]],"b4VvP-":["Existing branch <0>",["trimmed"],"</0> will be checked out into its own window, under <1>.ok/worktrees/</1>."],"b4itZn":["Working"],"b5aNbi":["The ",["targetNoun"]," could not be opened — try navigating to it manually."],"bBE5tC":["Detected on this machine"],"bBcFK_":["Open emoji picker for ",["keyName"]],"bD8I7O":["Complete"],"bGa3Fk":["Uploading file"],"bH382I":["Edit this HTML — the preview updates live."],"bSD4im":["Search worktrees and branches"],"bS_boY":["Replace current match"],"bUUVED":["Asset"],"bV6DJA":["Who you are, so the agent has your context."],"bWLmRK":["Could not fetch branch. Check your connection."],"ba3vIW":[["templateCount","plural",{"one":["template"],"other":["templates"]}]],"bcDHUM":[["descriptorLabel"]," — render error, source editable below"],"bcjYUA":["Fold or unfold source"],"bkQRMh":["Paragraph"],"blFttG":["Search projects"],"bmC18N":["Clearing local collaboration data for \\"",["docName"],"\\" before reconnecting."],"brCtGB":["History unavailable"],"bultyE":["When enabled, the agent opens or refreshes the preview after each edit. Disable if you manage your own preview window (OK Desktop, a browser tab on another display, etc.)."],"bwil08":["Building <0>openknowledge.skill</0> and opening the Claude Desktop App"],"c1LZZH":["Link copied."],"c5f7sm":["Code block language: ",["currentLabel"],". Click to change."],"c5rF4v":["What is this knowledge base for?"],"c863eW":["Could not switch to ",["shareBranch"],". Try switching manually."],"c8iK2Y":["No templates found."],"c8jBgX":["Checking for updates on GitHub"],"cEoyWz":["Add item to ",["keyName"]],"cF9DyA":["Reconnecting after server restart"],"cIptmH":["In the Claude Desktop App"],"cKjLuT":["(project + user)"],"cOSAfL":["No repositories found on your GitHub account."],"cOrTMo":["Your share link is ready below."],"cRHuuI":["Couldn't copy path"],"cSCbv3":["BETA"],"cUK8lW":[["conflictCount","plural",{"one":["#"," conflict"],"other":["#"," conflicts"]}]],"cUk6TF":["Sync failed — check the server logs for details."],"cV7LOw":["Team Wiki"],"cZGNlb":["Add another pattern"],"cZI5AL":["OK Desktop"],"cZ_8zB":["Stays on this computer."],"cdm00A":["No Incoming"],"cdmk8A":["Uncommitted changes"],"chL5IG":["Community"],"cklVjM":["Timeline"],"cn1sLi":["Couldn't connect OpenKnowledge tools to Claude Code. Please try again."],"cnGeoo":["Delete"],"cqQyPB":["Folder name"],"crqzW5":["AI tools"],"cs4mps":["Config sharing"],"csDS2L":["Available"],"ct2kv5":["No headings in ",["pageTarget"]],"cuA8QW":["Organize specs"],"d1JjXo":["Your local copy of branch <0>",["branch"],"</0> is behind. Pull the latest changes, then open the link again."],"d2uTPx":["Server error (HTTP ",["status"],")"],"d5rK4X":[["chars","plural",{"one":["char"],"other":["chars"]}]],"dD7NPy":["Outline"],"dDpCOp":["Rename succeeded but the sidebar may be out of date — refresh to resync"],"dEgA5A":["Cancel"],"dGAdpH":["New branch <0>",["trimmed"],"</0> will be created from <1>",["currentBaseLabel"],"</1>, in its own worktree under <2>.ok/worktrees/</2>."],"dIYSqk":["remote"],"dJw2_7":["Saved with the project for your team."],"dMsx3p":["Home page and navigation hub."],"dN20LW":["Semantic search is on, but no API key is set — search falls back to keyword matching. Add one in <0>Settings → Account</0> (it's stored once for your whole machine)."],"dNM58w":["Claude Code (claude) isn't installed or on your PATH."],"dOHMA0":["Failed to move"],"dOxPd4":["Footnote"],"dPOFid":["Show or hide terminal"],"dTaauv":["Reason: ",["reason"]],"dUCQo4":["Renamed to \\"",["trimmed"],"\\""],"dUQ7_J":["Add meaning-based ranking to search so conceptually-related pages surface even when they share no keywords. This setting applies only to this computer."],"dURmlQ":["\\"frontmatter\\" is a reserved property name"],"dXWMFn":["Removes this skill from your editors."],"dbapvC":["Follow us on social media"],"dbhUX1":["Hide this file"],"dbtjJh":["(opens in new tab)"],"djc1l9":["More than ",["0"]," requests were blocked by the preview's security policy"],"djjdjr":[["deleteCount","plural",{"one":["Delete"],"other":["Delete ","#"," items"]}]],"dprWmL":["Anchor in this page"],"dr1vFs":["Replace all matches"],"dvGKu2":["Shared auto-sync default"],"dw_3cv":["Rename skill"],"dw_dUJ":["Failed to duplicate path"],"e0NrBM":["Project"],"e1Rn_k":["Open containing folder"],"e1hptq":["Embed a video with native player controls."],"e4GHWP":["Pull"],"e4PbgC":["Duplicate the file-tree item copied from the Files sidebar."],"e8L17t":["A non-empty folder already exists at this path. Pick a different folder."],"e8zRrb":["Show Files"],"eBIT9h":["Paste failed.",["restoreSuffix"]],"eFJkVt":["Clone failed: ",["cloneError"]],"eG8Jsg":["Toggle source tab focus mode"],"eGUbmF":["Copy selected file or folder"],"eJitUk":["Upload from computer"],"eKThTQ":["Failed to reorder"],"eNQGRb":["Inline LaTeX math rendered with KaTeX."],"ePK91l":["Edit"],"eQkgKV":["Installed"],"eQxm13":["Failed to update attachment location — ",["detail"]],"eSu2Xn":["Writes a project-MCP config for each selected tool; Claude also gets <0>.claude/launch.json</0>."],"eTL5y9":["Show selection preview"],"eTsJYJ":["description"],"eVPynQ":["Open <0><1>",["verificationUri"],"</1><2/></0> and enter this code:"],"el312q":["Install skills into"],"emgiet":["Authoritative content; mirrored verbatim everywhere it's referenced."],"eneWvv":["Draft"],"epuNYK":["Mark a block as the source of truth. Mirrors elsewhere update live as you edit it."],"euc6Ns":["Duplicate"],"evs0iw":["Tags matching \\"",["tagListQuery"],"\\""],"f1XQyZ":["Move block"],"f65AOQ":["Start from"],"f8jU-L":[["0"],"/",["1"]," — ",["2"]],"f9lQNJ":["Adds a managed block to"],"fBHvBn":["There's no project folder for this window, so a terminal can't start here."],"fBaTkM":["Toggle the bottom terminal panel."],"fG0X0e":["Install ",["brand"]," →"],"fIgqfQ":["Reinstalling"],"fJgQHX":["Failed to create file"],"fNr-MX":["Disable semantic search"],"fR-Kdc":["(project-level only)"],"fVcm9t":[["0","plural",{"one":["#"," doc"],"other":["#"," docs"]}]],"fWi7pn":["Initialize starter pack"],"fWsBTs":["Something went wrong. Please try again."],"fYKgzG":["Failed to load recent projects."],"fYjgXu":["Unordered list of items."],"f_PkYv":["Restarting closes this project's server. Connected agents (Claude Code, Codex, Cursor) will see their OpenKnowledge MCP connection close unexpectedly — you may need to restart the agent, or toggle its OpenKnowledge MCP server off and on, to reconnect."],"fbdLmk":["Toggle bold formatting."],"fbsiBw":["Something went wrong starting the terminal."],"fcgvCA":["Claude"],"fiMNLl":["Sync settings not yet loaded — try again in a moment"],"fj5YiP":["Downloads a fresh copy from GitHub."],"fo0VXg":["Uninstall"],"fqSfXY":["Replace"],"fuJZKk":["Search branches"],"fwhX-N":["Indent or outdent source"],"fxbCNQ":["Synced. The link is up to date."],"g3UF2V":["Accept"],"g4WlQK":["Project AI tool management is only available in the OpenKnowledge desktop app."],"g4XBm0":["Small section heading."],"g58Kwy":["<",["descriptorLabel"],"> failed to render (likely a bad prop). Copy the source to see what went wrong, or delete the block."],"gBbxn_":["Checking sign-in status"],"gGVP4q":["Click <0>+</0> <1/> <2>Create skill</2> <3/> <4>Upload skill</4>."],"gHSAWT":["Create worktree <0>“<1>",["typedName"],"</1>”</0>"],"gITz7o":["Move the cursor or extend selection through CodeMirror's standard source-editor navigation keymap."],"gJR87V":["Could not create the project folder. Pick a different folder."],"gKi-a_":["New project"],"gQV-9w":["Branch switched but the ",["targetNoun"]," could not be opened — try navigating to it manually."],"gUlRQj":["Orphans"],"gYuDfu":["Pick a starter pack to scaffold your project with ready-made folders and templates."],"gYz2ep":["Expires in ",["timeLabel"]],"gbHcbI":["Failed to delete property"],"gfdqcY":["Couldn't apply the change: ",["0"]],"gfohmY":["Connect tools"],"ggm6JX":["This page doesn't exist yet. Open it to create the page in the editor and collapse the graph."],"ggs9f8":["Search files, folders, or commands"],"gijbne":["Failed to rename path"],"gk_-qj":["Couldn't rename template: ",["0"]],"gljvbT":[["words","plural",{"one":["word"],"other":["words"]}]],"glzsS_":["Pan right"],"gmJ0An":["Failed to open folder."],"goO4Ll":["Editor status bar"],"gp3I7-":["Before syncing, set your identity for git commits:"],"gtEbeW":["Highlight"],"gvApb7":["Turn the things you read into clear, trusted articles. Save a source, figure out what it means, then keep the final version so you can rely on it later."],"gwykHF":["This doc hasn't synced to GitHub yet. The link will work after the next sync."],"h-AdvS":["The folders and templates are already here, so there's nothing to add."],"h06R3C":["No pages are missing outgoing graph links."],"h6EvY-":["This will replace the current document content with the version from <0>",["relative"]," (",["absoluteTime"],", ",["entrySha"],")</0> by <1>",["authorName"],"</1>. Your current content is already saved in the timeline — you can restore it anytime."],"h7FzJC":["Link-graph response did not match expected shape."],"h9QFb9":["Skill \\"",["0"],"\\" deleted"],"hBMK4W":["Project templates"],"hCOLSd":["Keep a written record of how your product gets built. A home for proposing ideas, recording decisions, writing specs, and capturing what you learned after something broke."],"hDEaQu":["Connect OpenKnowledge to other tools you use."],"hDKtoF":[["diffHrs"],"h ago"],"hDoLrm":["Remove ",["projectName"]," from recent projects"],"hGmuTc":["Docs tagged #",["tagDocsName"]],"hHMv6l":["Delete block"],"hIQkLb":["New chat"],"hItdtk":["Browse folder"],"hLy8b1":["Updated to Version ",["version"]],"hQXiDc":["Search branches..."],"hSBIG-":["A title, description, tags — anything that describes this folder."],"hSySVc":["Install handoff failed: ",["msg"]],"hXUWyd":["Value is required"],"hXbSxc":["Asset: ",["title"]],"hY8pka":["Select next occurrence"],"hYDc6B":["Name cannot be empty"],"hYgDIe":["Create"],"hZoBHK":["Empty starting content"],"haHgQj":["Copied relative path"],"he3ygx":["Copy"],"hjO0Mq":["Add tab"],"hmYd9H":["Keep track of the people and companies you work with and the meetings you have with them. Good for remembering who someone is, how you know them, and what you last talked about."],"hnq8fP":["Remove ",["label"]," from context"],"hpDtUm":["External wiki link"],"hpzRlK":["Reopen closed tab"],"hwFOFD":["Settings failed to load"],"hxBHxQ":["A line with a footnote<0><1>[1]</1></0> and a definition shown below."],"hxEUVJ":["Initialize ",["selectedPackName"]],"hyCxJY":["Open that worktree instead"],"hynz2K":["Download started"],"i-ShMB":["Diagram"],"i1flq_":["Wiki link suggestions"],"i3f2kh":["No matching commands."],"i92eAT":["We'll create a repository and start syncing — no terminal needed."],"i9OyGp":["Undo or redo"],"i9TPUi":["This ",["targetNoun"]," isn't on branch <0>",["branch"],"</0>. It may not have been pushed yet."],"i9toLO":["Agent configuration file"],"iAoh55":["Update \\"",["0"],"\\"?"],"iDZtvM":["Failed to load templates: ",["message"]],"iEQQyu":["Agent"],"iEYxO4":["Show thumbnails"],"iGCs04":["No templates available"],"iH8pgl":["Back"],"iHAJDj":["Resolving default location"],"iKSP5j":["Word wrap"],"iKZkk1":["Property value"],"iMkWoF":["Turn on"],"iNFKkm":["No diff."],"iO8V-7":["Create worktree"],"iOHg1t":["Open embedded URL in new tab"],"iSLIjg":["Connect"],"iSQTsg":["Ordered list"],"iSnkwB":["Failed to open cloned project."],"iTlqm3":[["ahead","plural",{"one":["#"," commit ahead"],"other":["#"," commits ahead"]}]],"iTylMl":["Templates"],"iXTp5j":["Scope: "],"idD8Ev":["Saved"],"ig5vUe":["Failed to load file"],"iilQXA":["Folder duplicated"],"ijLc3m":["Bullet list"],"ipn17C":["The <0>type</0> every document created from this template gets (e.g. <1>research-note</1>). Keeps new docs Open Knowledge Format–conformant."],"iqIDv4":["Sync status unavailable"],"iqugog":["Initialize failed: ",["errorDetail"]],"irFGwu":["Template list"],"ircigK":["Blank project"],"irrm_E":["Remove selection"],"isRobC":["New"],"iuTKci":["No edits yet."],"iycx_A":["Pushing"],"j9Vqvc":["inherited"],"jAMpHn":["What is a starter pack?"],"jBVUXo":["Couldn't open the terminal — please try again."],"jEZ6Lf":["provisional"],"jEdF24":["Missing page: ",["linkTitle"],". Click to create."],"jKd3AP":["Could not enable the terminal: ",["0"]],"jPUPvG":["Couldn't resolve the conflict for ",["filePath"],"."],"jRHdCz":["Failed to load PDF"],"jSO1X5":["Inherited templates can't be renamed here — rename it in the folder that owns it."],"jSY41h":["\\"",["docName"],"\\" took too long. Check your connection."],"jTLWxh":["Embed an external page in an inline iframe (docs, demos, Figma, CodeSandbox)."],"jX0IPx":["A skill with this name already exists."],"jZ_E5M":["Fetch failed — check the server logs for details."],"j_Z6g7":["Shared default"],"jbSG8V":["Show Files (",["sidebarShortcutLabel"],")"],"jdGUeI":["Couldn't create template: ",["error"]],"jerqF0":["Loading branch state"],"jhtG3I":[" Your selection has been restored."],"jjtmV_":["First file name"],"jol95m":["Failed to open Project Navigator."],"jtg_8-":["Build a knowledge wiki about the different types of flightless birds. Start with an overview page, then add cross-linked pages for each major group (ratites like ostriches, emus, and kiwis; penguins; and flightless rails), the regions they live in, and a timeline of how flightlessness evolved."],"ju38ms":["This project has no git repository — sharing mode does not apply. Initialize a repo to enable the toggle."],"jwnpdM":["A template named <0>",["trimmedSlug"],"</0> already exists here. Saving creates a local copy that overrides it for this folder."],"k4CuuV":["Ready-made folders and templates to get you started quickly. Select a pack to preview what gets created, then add it to your project."],"kCNU4q":["Indexing your pages — ",["semanticIndexedCount"]," of ",["semanticTotalCount"]," ready. Results may be incomplete."],"kCqCyf":["Open CodeMirror's lint diagnostics panel."],"kFLlsI":["Insert a footnote reference + matching definition stub."],"kLv8d3":["Your copy of branch <0>",["shareBranch"],"</0> has changes that aren't on GitHub. The ",["targetNoun"]," will appear once the branch syncs."],"kNqMMd":["Folder"],"kUn-CN":["Sync off"],"kV2YZv":["Don't see <0>Skills</0>? Enable <1>Settings <2/> Capabilities <3/> Code execution and file creation</1> first."],"kYL1lH":["Agent activity"],"k_pade":["Config sharing is now shared. Commit the OK files to share with your team."],"k_yIIc":["Will be created at: <0>",["targetPreview"],"</0>"],"kdzzOK":["Off — search ranks by keyword only. No content leaves this computer."],"keNFEd":["Set identity"],"khCa4M":["Teaches coding agents in this project to read and write through OpenKnowledge."],"kj9pAE":["Creating page"],"kknhfj":["No changes"],"kmKqZg":["Clusters"],"knjOzA":["Tag value"],"kolRU1":["Do you want to permanently delete instead?"],"kpqWwG":["This ",["targetNoun"]," was removed from branch <0>",["branch"],"</0>."],"ku0yLQ":["Pages are embedded the first time a search needs them."],"ky9Tuc":["Edit ",["0"]," source"],"l17ab4":["Could not write project files. Try a different location."],"l1aQKz":["Visual editor table"],"l1l8sj":[["0"],"d ago"],"l3s5ri":["Import"],"l46MqT":["Next tab"],"l6OXqI":["No installed agents found"],"l6kpzR":["This ",["targetNoun"]," has been moved, renamed, or deleted in your local copy of branch <0>",["branch"],"</0>, and that change hasn't synced yet."],"l8G3S9":["Auto-sync is off — you don't have permission to push to this repo"],"lAiyU_":["Only the current document uses <0>#",["tag"],"</0>."],"lCC_D5":["Subscribing..."],"lGs_bQ":["Page <0>*</0>"],"lHwYMr":["Server error: ",["status"]," ",["statusText"]],"lI0Td2":["Use letters, digits, <0>_</0> and <1>-</1> only."],"lIn9L9":["Disable sync"],"lPzyrU":["All hunks resolved"],"lVWEIL":["Indexed ",["embedded"]," of ",["total"]," pages."],"lWNpNB":["Add cursors or select matching occurrences through CodeMirror."],"lXKZGw":["Heading 1"],"lZAiSP":["Backlinks response did not match expected shape."],"l_FAT6":["Use letters, digits, <0>-</0> or <1>_</1> only."],"l_UFPv":["Properties"],"lb_UU4":["Sync now"],"lbkOif":["Undo or redo visual-editor changes through TipTap collaboration history."],"lhjq3G":["Reset ",["labelText"]," to default"],"ljHjfg":["That branch is already open in another worktree."],"lkYioO":["Show or hide document panel"],"ll2yNl":["Content directory"],"lond3p":["Shows above the code body. Round-trips as \`title=\\"...\\"\` in markdown."],"lrhetp":["+ ",["overflow"]," more"],"ls1N1w":["(missing)"],"lyWa43":["Project-level disconnected pages"],"lzmtKp":["Failed to load folder properties: ",["message"]],"lzwo7p":["Could not open GitHub sign-in. Please try again."],"m16xKo":["Add"],"m2T1Xj":["Tag #",["tagValue"],", ",["uses"]],"m4v3XT":["Undo last edit on ",["docName"]],"m6YGpY":["Active panel content for the selected tab shows here."],"mBltnd":["Path suggestions"],"mGaZwZ":["See the full install guide"],"mHVPm5":["Reconnect required"],"mLAjyL":["Give the AI tools you use access to read and update your projects. Checking a box sets it up right away; unchecking removes it."],"mNY1G6":["Undo all edits"],"mPneVR":["Updated \\"",["display"],"\\" to ",["0"],"."],"mPy9lS":["Organize my existing specs into a linked index grouped by area, and flag any that have drifted out of sync with the current code."],"mU3j1b":["Remove item ",["0"]],"mVFyH-":[["accessibleLabel"]," (conflict)"],"mWVJRX":["Collapsible section with a clickable summary."],"mY8U64":["Teach agents a repeatable task. You can edit the body after creating."],"mYGY3B":["Date"],"mYzDD_":["A worktree folder for that branch already exists."],"mZ1r4i":["Create a document from ",["label"]],"maDWIB":["Mirror source <0>api-spec</0>"],"makN88":["No patterns yet. Type a folder or file name below to start hiding files."],"mdKFEy":["You cancelled loading \\"",["docName"],"\\"."],"mdzKSV":[["nodeCount","plural",{"one":["#"," node"],"other":["#"," nodes"]}]],"mf37rL":["Retrying"],"mg0YGL":["Source multi-cursor and multi-select"],"mk2poV":["e.g. server.ts"],"mmpzAq":["Wrap long lines in the markdown source editor."],"mo22UP":["Toggle inline code formatting."],"mqSwZH":["<0>Mirror anchor not found.</0> No <1>",["mirrorSourceTag"],"</1> exists in <2>",["src"],"</2>."],"msOK6I":["Repositories you've already cloned may keep syncing through git's own saved credentials, even after you disconnect."],"msqUNq":["Ready-made folders and templates to get you started quickly."],"mu1O0q":["Open Knowledge can manage ",["0"]," editor skill(s) for this project. Import moves them into .ok/skills and replaces the .claude, .codex, etc. copies with symlinks — one place to edit, in sync everywhere. If those folders are committed to git, review the change first; symlinks can behave differently on some editors and on Windows."],"mwMF9u":["Open CodeMirror search in source editor mode."],"mxY24F":["Duplicate the focused file-tree item when focus is in the Files sidebar."],"n2lRue":["Commit or stash changes to switch:"],"n5n_vi":["Private repository"],"n6hXUm":["Auto-sync periodically fetches, pulls, and pushes commits to your remote git repository so your edits stay in sync across machines."],"n7aopT":["Editor mode"],"n8DwqQ":["Connects automatically the next time you open this project in a trusted Codex session."],"nCzR-G":["Copy code ",["userCode"]],"nD7Fx9":["This replaces the current skill content with the bundled version ",["0"],". Any local edits will be replaced — your current version is saved to history first, so you can restore it."],"nDT8qt":["Initialized ",["0"]," but could not open it."],"nJq7et":["Couldn't uninstall skill: ",["0"]],"nMSYz5":["This path is on an external volume (/Volumes/...). OpenKnowledge will lose track of files when the drive ejects."],"nNYV3Y":["and ",["remaining"]," more"],"nP-KFo":["New ",["0"]," chat"],"nTwL53":["Open a doc to share its URL."],"nUNZL4":["Ask ",["0"]],"nWv1ja":["Manage hidden files in Settings → Ignore patterns."],"nYKerc":["(user-level only)"],"nYeBmY":[["hours"],"h ago"],"nbfdhU":["Integrations"],"ndeI89":["Use Cmd/Ctrl+C to copy the link below, or open OK in the desktop app."],"ndwmea":["unavailable on this platform"],"neRy3o":["Split list item"],"nfoduq":["create worktree"],"nft48x":["Stored at <0>.ok/templates/</0> in this project. Available in every folder (folder-scoped templates can override by filename)."],"ng2Ibo":["Branch name"],"nh3wwx":["Embeddings provider key"],"njBeMm":["Both"],"njU86j":["Property \\"",["trimmed"],"\\" already exists"],"noH1JX":["Couldn't reach collab server — ",["errorDetail"],". Try <0>ok status</0> or check <1>.ok/local/last-spawn-error.log</1>."],"npcziF":["Install on"],"nqV0Kk":["This folder hasn't synced to GitHub yet. The link will work after the next sync."],"nrGWJ7":["Git identity isn't set — commits use a default author. Set yours so teammates see your name."],"nskygk":["Choose agent"],"nxlOpL":["OpenKnowledge is using this GitHub account."],"ny6vNn":["OpenKnowledge is using a GitHub account provided by the gh CLI. There's no separate OpenKnowledge credential to disconnect."],"nzHlj8":["Close ",["0"]],"nzaV6Q":["Page thumbnails"],"o2yoFu":["Reveal in Finder, No workspace"],"o49mDZ":["Loading timeline history"],"o4dcAf":["Reveal in File Explorer, ",["hint"]],"o5gfs1":["This setting is per-machine and isn't shared with collaborators. It needs an API key set with <0>ok embeddings set-key</0>."],"o9CrsQ":["research-note"],"oAFVKX":["Failed to update the project sync default — ",["detail"]],"oAGN8p":["Remote branch <0>",["remoteCheckoutRef"],"</0> will be checked out as a new local tracking branch <1>",["trimmed"],"</1>, in its own window under <2>.ok/worktrees/</2>."],"oBXkm2":["Delete code block"],"oCHfGC":["Level"],"oCZkaG":["Copy path"],"oJl7eO":["Unknown component: ",["componentName"]," — source editable below"],"oKBnk5":["More requests were blocked."],"oQA-cA":["Full path"],"oS1YpJ":["Open the Project Navigator."],"oXKEsy":["Delete an adjacent wiki-link or tag chip."],"oYepHb":["The terminal is turned off for this project. Turn it back on to run commands here."],"of3tF-":["You picked ~/Documents. OpenKnowledge will index every markdown file under it. If you only want to manage a sub-folder, choose a smaller scope."],"ogAuyr":["Back to document view"],"omXJcU":["Close others"],"optX0N":[["0"],"h ago"],"oqB2ez":["Previous match"],"osRqlv":["Open delete confirmation for the selected file-tree items."],"ot5BRK":["Duplicate selected file or folder"],"otE4aj":["Show external URL nodes"],"ou1hFW":["Toggle an ordered list."],"outYNy":["Duplicate name \\"",["keyName"],"\\""],"ovIGrT":["Local collaboration data for \\"",["docName"],"\\" could not be cleared. Reload to retry."],"p0Iq25":["Insert link"],"p9sdCy":["New ignore pattern"],"pAgkuZ":["Reopening \\"",["docName"],"\\" with a fresh local collaboration cache."],"pBROkv":["Thanks for subscribing. Watch your inbox for product updates."],"pEQFsW":["No matching projects."],"pFagOn":["Source editing"],"pHYP6v":["Open <0>Customize</0> in the sidebar <1/> <2>Skills</2>."],"pRc-Im":["Undone all edits on ",["docName"]],"pTPqMK":["Toggle a fenced code block."],"pWT04I":["Checking..."],"pWbsW6":["Loading docs"],"pZAs1T":["Failed to load outgoing links"],"pajIrl":["Could not turn off the terminal: ",["0"]],"pbwTg6":[["seconds"],"s ago"],"pckX1A":[["0","plural",{"one":["#"," use"],"other":["#"," uses"]}]],"pcqlQu":[["0","plural",{"one":["Folder"],"other":["Folders"]}]],"pgq_xf":[["0"],"/",["1"]," ",["2"]],"phM8Kh":["Found the repo but could not open the project. Please try again."],"pha01Y":["Project-level pages with no incoming graph edges."],"pkAft1":["Search failed."],"pmKdif":["Failed: ",["loadError"]],"pmUArF":["Workspace"],"ppDgFi":["Restart with this app's version"],"psfGPX":["MCP connections"],"pzutoc":["Italic"],"q2kXMG":["Inline Math"],"q4YJl_":["The terminal session ended (exit code ",["0"],")."],"q6-JVU":["Loading pages"],"q7F5am":["title"],"qAQVSD":["Page headings response was not JSON"],"qAhFeg":[["userName"]," · ",["tabCount","plural",{"one":["#"," tab"],"other":["#"," tabs"]}]],"qAx7xG":["Fixed folder in content root"],"qEIFZu":["Key ending in ",["keyHint"]],"qEue6Q":[" or "],"qFWMl-":["View as text"],"qNOgUu":["Edits at the source land here — no copy-paste drift."],"qRZh7J":["Let Tab leave the source editor instead of indenting."],"qSKu2v":["Source navigation and selection"],"qSxaOz":["Accept their deletion"],"qUB_o_":["Auto-sync is off — your edits stay local until you commit and push manually."],"qXg5W9":["File saves to <0>~/Downloads/openknowledge.skill</0>."],"qXsafh":["Publish to GitHub"],"qZv5ZR":["Config sharing toggle failed"],"q_9EcE":["Enable git auto-sync?"],"q_z77Z":["Heading levels"],"qaHyRJ":[["linkCount","plural",{"one":["#"," link"],"other":["#"," links"]}]],"qbfj1f":["Receiving objects"],"qdBUHP":["Couldn't load ",["fileName"]],"qi1F96":["Reveal in File Explorer"],"qiRoLb":["Summarize everything I changed this week"],"qioCwA":["Jump to page ",["pageNumber"]],"qjHMHf":["Failed to disable sync — ",["detail"]],"qo4zCg":["Path cannot contain backslashes"],"qpQwGC":["Describe what you're working on and the agent sets it up for you."],"qvWGzP":["Collapse all"],"qyLmWw":["Source editor search panel"],"r-OJYm":["Enter a valid branch name (no spaces, no leading dot, no \\"..\\")."],"r2huLx":["Undo, redo, or undo selection changes through CodeMirror history."],"r4R7AZ":["Network error during cleanup"],"r51jLC":["File saved & Claude Desktop App opened"],"r871ed":["Your knowledge base is now on GitHub at <0>",["ownerLogin"],"/",["repoName"],"</0>."],"rBc32v":["Couldn't reach the embeddings provider — press ↵ to retry"],"rFw02Q":["Uploading ",["keyName"]],"rJVoVX":["Source find results"],"rNifQd":["Remove property"],"rQAQus":["Couldn't save template: ",["error"]],"rQRrkB":["yesterday"],"rSoi6g":[["displayName"]," (",["bin"],") isn't installed or on your PATH."],"rVgSRB":["Collapse ",["docName"]],"rVxu1k":["No pages link here yet."],"rXz97P":["Numbered list of items."],"rZ9HZq":["To do"],"rZVMkf":["Visual editor replace input focused"],"rageVb":["Custom HTML with a live preview pane (sandboxed iframe)."],"rdU729":["Layout"],"rf6x3F":["Dock terminal to the bottom"],"rfFpcF":["Remove ",["chip"]],"rgPqOw":["Convert the current block to a paragraph."],"riqekz":["Suggestion menu navigation"],"rlUzXK":["Could not validate folder. Please try again."],"roAe2K":["Link URL"],"roiUQQ":["This page doesn't link to anything yet."],"rppgXF":["Disconnecting"],"rssK8c":["Ignore patterns (raw text)"],"rtdR4v":["Show or hide Files"],"rwrPbS":["Component boundary navigation"],"s-MGs7":["Resources"],"s-XOaI":["File name"],"s061i4":["Relative path"],"s0IDhW":["This file could not be found."],"s0J_k9":[["0","plural",{"one":["#"," key"],"other":["#"," keys"]}]],"s0_GnA":["Opening ",["openingLabel"],"…"],"s1c0ja":["Bullet List"],"s3caR3":["Deleting"],"sE7R19":["Could not load templates: ",["templatesError"],". You can still create a blank note."],"sER-bs":["Files"],"sFhaTJ":["Disambiguates similarly-named templates in the menu."],"sHrqDx":["Couldn't rename skill: ",["0"]],"sIGbBZ":["Convert selection to footnote"],"sIxSSP":["Resolve conflict in your terminal"],"sJK6pq":["Permission denied"],"sJWhgo":["Unknown component: ",["unregisteredComponentName"]],"sOxZaS":["Failed to load graph"],"sZ2IOu":["This ",["targetNoun"]," was shared from branch <0>",["shareBranch"],"</0>. It doesn't exist on your current branch (<1>",["currentLabel"],"</1>)."],"saIASg":["Second item"],"saYiIO":["Path cannot contain null bytes"],"seeS6l":["Setup OpenKnowledge in this folder?"],"shNd9t":["Slash command menu"],"skf5Ix":["Indent or outdent source editor lines."],"snrVQ7":["probe failed"],"ssuwjF":["Branch"],"stlgky":["On — your search queries and the text of matching pages are sent to your embeddings provider (OpenAI by default) to compute embeddings."],"sxTdZI":["Loading paths…"],"sxjyRq":["Worktrees"],"sxkWRg":["Advanced"],"t-JXbf":["Notion-style inline row for a downloadable file. Drag-drop also works."],"t18QYR":["Unpin ",["accessibleLabel"]],"t2TkQ3":["Sync paused — resolve conflicts to resume."],"t422_7":["Uninstall everywhere"],"t4sFKC":["New branch <0>",["trimmed"],"</0> will be created from the current commit, in its own worktree under <1>.ok/worktrees/</1>."],"t6w1cq":["Open a blank editor tab."],"tAPZEx":["Below"],"tHKQ6j":["Renaming"],"tP5DDk":["Apply link"],"tUvUfp":["Use a folder you already have."],"tW_yvQ":["Expand ",["docName"]],"t_YqKh":["Remove"],"teD0H9":["Couldn't open a worktree for that branch."],"tfDRzk":["Save"],"tfi40B":["Failed to create page"],"tgWuMB":["Modified"],"thnPBX":["Activate the next editor tab."],"ti6aF_":["Ask ",["0"]," CLI"],"tiWX6q":["Source editor"],"tjXez2":["blog-post"],"toyw51":["Mermaid diagram controls"],"tsiTqO":["Paste your API key"],"tsyExA":["Connect your AI tools to OpenKnowledge"],"u-9fWA":["See <0>Architecture</0> for the system overview."],"u3BOHd":[["fileCount","plural",{"one":["#"," file"],"other":["#"," files"]}]],"u3YnKw":["Could not construct share URL."],"u3wRF-":["Published"],"u6Hp4N":["Markdown"],"u7H-Wn":["Show panel (",["panelShortcutLabel"],")"],"u7U_Ij":["Link the selected text, or edit the link under the caret."],"uA_jXp":["Switch and update branch"],"uCaIdy":["GitHub sign-in is missing or expired. Reconnect to resume syncing."],"uDlyqd":["Document the architecture of this repo: create an overview page that links to a page per major module describing its responsibilities and entry points."],"uF9ruK":["Saving"],"uFOL2y":["No project skills yet. Author one to teach agents a repeatable task scoped to this knowledge base."],"uFQbYd":["Home page and entry point."],"uGaIIS":["Check out worktree"],"uH_S-u":[["loadErrorTitle"],": ",["message"]],"uKRYiW":["Sync status unavailable — server error."],"uL_Wx8":["The terminal stopped unexpectedly."],"uM6jnS":["Restore failed"],"uO9WLl":["Push"],"uQNW00":["Detached HEAD — checkout a branch to resume"],"uQewpR":["Couldn't restart the server — it's running under a different account. Restart your computer to clear it, then reopen this project."],"uWtdQR":["No templates yet. Add one in this folder's Templates section, or in Settings → Templates."],"uWx2ZP":["Last sync"],"u_lS4C":["Clone complete — opening project"],"uaUc6t":["Restart server"],"ubMwcO":["The terminal session ended (signal ",["0"],")."],"ugoTXs":["folder"],"uhJEA2":[["count","plural",{"one":["#"," more participant"],"other":["#"," more participants"]}]],"uksqrP":["Repository not found. It may have been renamed, deleted, or moved."],"un8kBM":["Creating page: ",["linkTitle"],"."],"ur2XSb":["Visual editor"],"uuoHOU":["Command failed."],"uynXup":[["tokens","plural",{"one":["token"],"other":["tokens"]}]],"v-h2hx":["Delete ",["targetGitPath"]],"v2ZW0K":["Enable terminal"],"v41fCm":["File not found"],"v75Em9":[["uploadedCount","plural",{"one":["Uploaded one file"],"other":["Uploaded ",["uploadedCount"]," files"]}]],"v77jrg":["Visual editor selection"],"v7hK0U":["Use lowercase letters, digits, and hyphens only."],"v7lbnC":["Find next match"],"vAYoCZ":["Couldn't open the worktree. Try again."],"vDXqVv":["Insert a markdown hard break."],"vEJDlt":["The file is in your Trash; the file-watcher will reconcile."],"vGeNNQ":["Copy a prompt and paste it into your agent to set up your project."],"vIxrEk":["Fit width"],"vLyv1R":["Hide"],"vQIVHc":["Folder properties"],"vWc9a0":["Type to edit; <0>⌘ Enter</0> saves, <1>Esc</1> cancels."],"vZVeFG":["Upload failed — please try again"],"vbK_ZG":["Files sidebar"],"ve8vEM":["Code expired — please try again"],"vfRlCI":["Could not copy full path"],"vfWA_g":["You picked ~/Desktop. OpenKnowledge will index everything on your desktop."],"vhAnzJ":["Turn on semantic search?"],"viwC-K":["Failed to remove project."],"vppAju":["Where newly added attachments are placed."],"vv7kpg":["Cancelled"],"vvWZnu":["Diff unavailable"],"w3tVpc":["No links yet. Add wiki links or markdown links to build a graph."],"w3vFfL":["Hide Files"],"w4hMYl":["Could not read branch state for this project. Close this dialog and open the share link again."],"w7SsvI":["That folder isn't an OpenKnowledge project yet. Initialize it and open?"],"w7nm4K":["Indented blockquote for citations."],"wDgmsr":["\\"",["0"],"\\" install refreshed (",["1"],")"],"wGSHzy":["Activate one of the first eight editor tabs."],"wJijgU":["Location"],"wJo9oS":["Close find"],"wQp1V3":["Mirror of <0>",["src"],"</0>"],"wT4iQr":["Open visual-editor find with replace controls expanded."],"wTcjov":["No workspace"],"wXO4Tg":[["hrs"],"h ago"],"w_Sphq":["Attachments"],"wbv9xO":["Create new project"],"wbwHYD":["Enable sync"],"wdxz7K":["Source"],"weP6me":["Couldn't load docs — type @ again to retry"],"wlwXUk":["You picked ~/Downloads. Files there are usually transient — consider a stable folder instead."],"wn8EJi":["Skills teach agents repeatable tasks. Author them here; install a skill to project it into your editors' skill folders."],"wndeIl":["Project-level pages with neither incoming nor outgoing graph edges."],"wtcxiD":["Share this setup with your team?"],"wvbc1r":["Couldn't open document"],"wzq9Rv":["A branch with that name already exists. Open its worktree from the switcher instead."],"x-5mJ1":["Install on all"],"x2fr_j":["Graph"],"x3-2ta":[["packName"]," initialized (",["projectEntries","plural",{"one":["#"," entry"],"other":["#"," entries"]}],")"],"x57cJf":["Open link"],"xCJdfg":["Clear"],"xCdTnb":["Close new tab"],"xDBki3":["Heading suggestions"],"xFQRu4":["I already have it locally"],"xG4tb6":["Lost connection to \\"",["docName"],"\\"."],"xHGM4U":["Hide HTML preview"],"xK291b":["Two-page (odd)"],"xNyj3h":["Reinstall for Claude Chat & Cowork"],"xOTzt5":["just now"],"xSVO3J":["What gets created"],"xWEvuo":["Ask AI"],"xXo8FT":["Save failed: ",["error"]],"xYMPyY":["Paste was incomplete — ",["chunksCompleted"]," of ",["totalChunks"]," chunks landed.",["restoreSuffix"]],"xaDWAI":["Switch project"],"xbdtfY":["Markdown source"],"xc4g25":["Parse failed"],"xeXS4P":["Or use a starter pack"],"xeiujy":["Text"],"xhlFsx":["Inherited — set a value here to replace it."],"xiv-dW":["No files yet."],"xloBjn":["Relative Path"],"xnP32l":["No description yet — add one so agents know when to use this skill."],"xrVr_k":["Couldn't create skill: ",["0"]],"xsZhu-":["Page number"],"xzktOa":["Edit wiki link"],"y1t8bQ":["Settings sections"],"y3aU20":["Save changes"],"y46m5r":["The desktop app isn't responding. Refresh and try again."],"y5FUYi":["Suggestion menu open"],"y8B54M":["Couldn't send your prompt — please try again."],"yCX4jp":[" Your selection could not be restored."],"yEJ-sl":["The preview blocks resources that don't meet its security rules (for example plain http:// URLs, or code that uses eval). The content above may render incompletely."],"yFyZMJ":["No pages matched \\"",["semanticQueryText"],"\\" by meaning."],"yH7T4q":[["failedCount","plural",{"one":["1 file failed to upload"],"other":[["failedCount"]," files failed to upload"]}]],"yHikCO":["Open CodeMirror's go-to-line prompt."],"yIPXut":["Preparing search"],"yKu_3Y":["Restore"],"yLEyuq":["Product updates in your inbox."],"yLq4w4":["Separator"],"yMgL_E":["Find field navigation"],"yQE2r9":["Loading"],"yQyglE":["No matching docs"],"yUxR-Q":["Expand ",["keyName"]],"yWSvcf":["Content root"],"yWWThY":["Asset reference"],"yYR6za":["Display text"],"yZmvQ4":["This project's server (v",["0"],") is newer than this app (v",["1"],")."],"y_5CE8":["Item ",["0"]],"yaPGPa":["Open a project to manage its AI tool connections."],"yf5r22":[["keyName"]," type: ",["typeLabel"]," (inherited from folder properties; not editable here)"],"yhdqox":["Installed — ok is available in external terminals. Unchecking removes it; OpenKnowledge's built-in terminal and AI tools keep working."],"yitgD9":["Failed to load skill targets: ",["0"]],"yjExfe":["Branch <0>",["shareBranch"],"</0> is checked out in:"],"ylXj1N":["Selected"],"ymWJLd":["Show ",["0"]," more"],"ynIa4S":["Visual editor list item"],"ypw6My":["Showing top ",["0"]," headings — keep typing to narrow"],"ysxgu8":["project"],"yutJKi":["Checklist with checkboxes."],"yvG-l1":["Open source lint panel"],"yvHDYG":["Claude Desktop"],"yz7wBu":["Close"],"yzF66j":["Link"],"yzGPkm":["Expand graph"],"z-lawV":["worktree"],"z0a2EA":["Diagram from Mermaid source — flowchart, sequence, class, state, ER, gantt, pie."],"z1uNN0":["No emoji found."],"z2JdQ-":["Config sharing unchanged — see details below."],"z2funE":["Full Path"],"z5pqI8":["Cannot upload: no document is open"],"z60Lgn":["Saves the file to <0>~/Downloads/openknowledge.skill</0> and opens the Claude Desktop App. Requires Node.js or Bun on your PATH."],"zAsDLY":["Graph visualization of document links"],"zKxoPm":["Couldn't rename \\"",["0"],"\\": ",["1"]],"zL0LPh":["Global outside text fields"],"zLGXna":["No starter packs available."],"zLak8b":["Activate new tab"],"zQBg2C":["Move the current block up or down one position."],"zUhPuR":["Open containing folder, ",["hint"]],"zXj1rA":["Search by meaning"],"zZ_I5K":["Open project menu"],"zaXlhf":["The properties block at the top of this doc has a formatting error. Switch to source mode to fix it."],"zbymaY":[["0"],"m ago"],"zd00pH":["Copy Path"],"zgSFyG":["External link"],"zkz0Fg":["Set up syncing"],"zlErBl":["Page headings error response did not match RFC 9457"],"zo3Dl7":["Toggle thumbnails"],"zrP8HX":["Frontmatter every document created from this template starts with. Values are YAML — a list is <0>[a, b]</0>; <1>{",["date"],"}</1> fills in on create."],"ztKII6":["Failed to add item"],"zwBp5t":["Private"],"zyKa-I":["Star us on GitHub"]}`)},z$=`en`;Yc.load(z$,R$.messages),Yc.activate(z$);var B$=Symbol.for(`ok.client.logForwarder`),V$=2e3,H$=[`log`,`info`,`warn`,`error`],U$={log:`info`,info:`info`,warn:`warn`,error:`error`};function W$(e){if(typeof e==`string`)return e;if(e instanceof Error)return`${e.name}: ${e.message}`;try{return JSON.stringify(e)??String(e)}catch{return String(e)}}function G$(e){let t=e.message.length+80;if(e.event&&(t+=e.event.length),e.fields)try{t+=JSON.stringify(e.fields).length}catch{}return t}function K$(e={}){let t=e.windowObj??(typeof window<`u`?window:void 0);if(!t||t.okDesktop)return;let n=t;if(n[B$])return;n[B$]=!0;let r=e.consoleObj??console,i=e.documentObj===void 0?typeof document<`u`?document:null:e.documentObj,a=e.flushIntervalMs??V$,o=e.fetchImpl??n.fetch.bind(n),s=e.now??Date.now,c=[],l=0,u=null,d=!1,f={log:r.log.bind(r),info:r.info.bind(r),warn:r.warn.bind(r),error:r.error.bind(r)};function p(){if(u!==null&&(clearTimeout(u),u=null),c.length===0)return;let e=c.splice(0,100);l=0,d=!0;try{o(`/api/client-logs`,{method:`POST`,headers:{"content-type":`application/json`},keepalive:!0,body:JSON.stringify({entries:e})}).catch(()=>{})}catch{}finally{d=!1}}function m(e){if(c.push(e),l+=G$(e),c.length>100){let e=c.shift();e&&(l-=G$(e))}if(c.length>=100||l>=32768){p();return}u===null&&(u=setTimeout(p,a))}function h(e,t){if(!d)try{let n=Gn(t.map(W$).join(` `)),r=t[0],i=typeof r==`string`&&r.length<=32768?r:void 0,a=i?si(i):null,o=a?.fields;if(o)try{JSON.stringify(o).length>8192&&(o=void 0)}catch{o=void 0}m({level:e,message:n,ts:s(),...a?.event?{event:a.event}:{},...o?{fields:o}:{}})}catch{}}for(let e of H$)r[e]=(...t)=>{f[e](...t),h(U$[e],t)};let g=e=>{if(d)return;let t=e;h(`error`,[`uncaught error: ${t.message} (${t.filename}:${t.lineno}:${t.colno})`])},_=e=>{d||h(`error`,[`unhandledrejection: ${W$(e.reason)}`])},v=()=>p(),y=()=>{i&&i.visibilityState===`hidden`&&p()};n.addEventListener(`error`,g),n.addEventListener(`unhandledrejection`,_),n.addEventListener(`pagehide`,v),i&&i.addEventListener(`visibilitychange`,y);function b(){for(let e of H$)r[e]=f[e];n.removeEventListener(`error`,g),n.removeEventListener(`unhandledrejection`,_),n.removeEventListener(`pagehide`,v),i&&i.removeEventListener(`visibilitychange`,y),u!==null&&(clearTimeout(u),u=null),c.length=0,delete n[B$]}return{flushNow:p,uninstall:b}}function q$(e,t){return e.branch===void 0||e.branch===null||e.branch===``||t===``||e.multiCandidate!==!0?null:{message:`Opened on branch ${e.branch}`,description:t}}function J$(e){let t=e.bridge;if(!t)return;let n=e.setHash??(e=>{window.location.hash=e}),r=e.emitToast??((e,t)=>{bs(e,t)});return t.onDeepLink(e=>{let i=e.kind??`doc`,a={kind:i,path:e.doc,branch:e.branch??null};if(e.targetMissing===!0){as.arm(a);return}Di.arm(a),n(wl(i,e.doc,i===`doc`?e.branch:void 0));let o=q$(e,t.config.projectPath);o!==null&&r(o.message,{description:o.description,duration:3e3})})}var Y$=4e3,X$=1440*60*1e3;function Z$(e){let t=e.bridge;if(t&&t.onboarding)return t.onboarding.onToast(e=>{if(e.kind===`ancestor-promote`){bs.success(`Opened existing OpenKnowledge project at ${e.ancestorPath}`,{duration:Y$});return}if(e.kind===`startup-reclaim`){let t=[];if(e.mcp.status===`repaired`){let n=e.mcp.editors.map(e=>Rr[e]??e).join(`, `);t.push(`repaired ${n} MCP integration`)}else e.mcp.status===`failed`&&t.push(`MCP auto-repair failed`);e.path.status===`installed`&&t.push(e.path.summary),e.path.status===`failed`&&t.push(`PATH install failed: ${e.path.summary}`);let n=t.length>0?t.join(`; `):`OpenKnowledge integrations checked.`,r=e.mcp.status===`failed`||e.path.status===`failed`,i=e.path.status!==`none`;bs[r?`error`:`success`](n,{duration:r||i?X$:Y$,position:`bottom-left`});return}if(e.kind===`sharing-refused-tracked`){bs.error(`Config sharing unchanged: ${e.tracked.length} OK file(s) tracked upstream — see message below.`,{duration:X$,description:e.remediation});return}if(e.kind===`sharing-no-git`){bs.warning(`Local-only requested but no git repository was created. Switch later via Settings → Config sharing once the project is in a git repo.`,{duration:Y$});return}let t=Gc(e.gitRoot,e.pickedPath)??e.pickedPath;bs.success(`Initialized OpenKnowledge at ${e.gitRoot} — opened parent of ${t} because it contains a .git folder`,{duration:Y$})})}function Q$(e){let t=(0,$.c)(18),{body:n,warning:r,restartLabel:i,cancelLabel:a,onRestart:o,onDismiss:s}=e,c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Z.jsx)(ds,{className:`mt-0.5 size-4 shrink-0 text-amber-500`}),t[0]=c):c=t[0];let l;t[1]===n?l=t[2]:(l=(0,Z.jsx)(`p`,{className:`font-medium text-sm`,children:n}),t[1]=n,t[2]=l);let u;t[3]===r?u=t[4]:(u=(0,Z.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:r}),t[3]=r,t[4]=u);let d;t[5]!==o||t[6]!==i?(d=(0,Z.jsx)(X,{size:`sm`,onClick:o,children:i}),t[5]=o,t[6]=i,t[7]=d):d=t[7];let f;t[8]!==a||t[9]!==s?(f=(0,Z.jsx)(X,{size:`sm`,variant:`ghost`,onClick:s,children:a}),t[8]=a,t[9]=s,t[10]=f):f=t[10];let p;t[11]!==d||t[12]!==f?(p=(0,Z.jsxs)(`div`,{className:`mt-1 flex flex-wrap gap-2`,children:[d,f]}),t[11]=d,t[12]=f,t[13]=p):p=t[13];let m;return t[14]!==l||t[15]!==u||t[16]!==p?(m=(0,Z.jsxs)(`div`,{className:`flex w-full gap-3 rounded-lg border bg-popover p-4 text-popover-foreground shadow-lg`,children:[c,(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1.5`,children:[l,u,p]})]}),t[14]=l,t[15]=u,t[16]=p,t[17]=m):m=t[17],m}function $$(){return Yc._({id:`f_PkYv`})}function e1(e){return e.serverRuntime===e.appRuntime?Yc._({id:`FWQuPE`,values:{0:e.appRuntime}}):e.relation===`older`?Yc._({id:`LhQlGR`,values:{0:e.serverRuntime,1:e.appRuntime}}):Yc._({id:`yZmvQ4`,values:{0:e.serverRuntime,1:e.appRuntime}})}function t1(e){return Yc._({id:`2YOwme`,values:{appRuntime:e}})}function n1(e){return Yc._({id:`5DFPDh`,values:{appRuntime:e}})}function r1(e){return e===`eperm`?Yc._({id:`uQewpR`}):Yc._({id:`PqYWiC`})}async function i1(e){let t=bs.loading(Yc._({id:`Kf7GG5`}),{duration:1/0}),n;try{n=await e.restartServer(e.config.projectPath)}catch{return}bs.dismiss(t),n.ok===!1&&bs.error(r1(n.reason),{duration:1/0})}function a1(e){let t=e.bridge;if(!t)return;let n=t.onServerVersionDrift(e=>{bs.custom(n=>(0,Q.createElement)(Q$,{body:e1(e),warning:$$(),restartLabel:Yc._({id:`ppDgFi`}),cancelLabel:Yc._({id:`PBxg_E`}),onRestart:()=>{bs.dismiss(n),i1(t)},onDismiss:()=>bs.dismiss(n)}),{duration:1/0})}),r=t.onServerRestarted(e=>{bs.success(t1(e.appRuntime))}),i=t.onServerReclaimed(e=>{bs.warning(n1(e.appRuntime),{duration:15e3})});return()=>{n(),r(),i()}}function o1(e){let{initialDoc:t}=e;if(!t)return;let n=e.getHash();n!==``&&n!==`#`&&n!==`#/`||e.setHash(kl(t))}function s1(){typeof window>`u`||!window.okDesktop||o1({initialDoc:window.okDesktop.config.initialDoc,getHash:()=>window.location.hash,setHash:e=>{window.location.hash=e}})}rd(),n(()=>import(`./telemetry-startup-ChBVT3Gs.js`).then(e=>e.initStartupTrace()),__vite__mapDeps([106,0,1,2,3,4,35,7]),import.meta.url),N$({apiOrigin:typeof window<`u`?window.okDesktop?.config.apiOrigin:void 0}),K$(),YT()&&tE(),VZ(),rT(),wF(),TN(),typeof window<`u`&&J$({bridge:window.okDesktop}),typeof window<`u`&&a1({bridge:window.okDesktop}),typeof window<`u`&&ed({bridge:window.okDesktop}),typeof window<`u`&&Wc({bridge:window.okDesktop}),typeof window<`u`&&Z$({bridge:window.okDesktop}),typeof window<`u`&&nd({bridge:window.okDesktop}),s1();var c1=new fd({defaultOptions:{queries:{retry:1,staleTime:1e4}}}),l1=document.getElementById(`root`);if(!l1)throw Error(`Root element not found`);var u1=typeof window>`u`?void 0:window.okDesktop;(0,Cd.createRoot)(l1).render((0,Z.jsx)(Q.StrictMode,{children:(0,Z.jsx)(on,{i18n:Yc,children:(0,Z.jsx)(wn,{client:c1,children:(0,Z.jsxs)(Rn,{attribute:`class`,defaultTheme:`system`,enableSystem:!0,disableTransitionOnChange:!0,storageKey:`ok-theme-v1`,children:[(0,Z.jsx)(Ms,{children:A$(u1)}),(0,Z.jsx)(j$,{richColors:!0,closeButton:!0})]})})})}));
|