@inkeep/open-knowledge 0.25.0 → 0.25.1-beta.0
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/assets/skills/write-skill/SKILL.md +1 -1
- package/dist/cli.mjs +20 -20
- package/dist/constants-CgXx1dPb.mjs +2 -0
- package/dist/{dist-V-C0Ejac.mjs → dist-D13xYuEX.mjs} +16 -16
- package/dist/dist-D9WKY736.mjs +1 -0
- package/dist/{gh-detect-DD9zzsz3.mjs → gh-detect-BcBj3YlE.mjs} +2 -2
- package/dist/index.mjs +1 -1
- package/dist/{init-By8oGFWX.mjs → init-BOHFI-M4.mjs} +6 -6
- package/dist/init-CWlEXg63.mjs +1 -0
- package/dist/loader-BZIOGAPP.mjs +1 -0
- package/dist/{loader-C6q_dNMP.mjs → loader-ea54dQyy.mjs} +2 -2
- package/dist/{preview-DNM7BfJy.mjs → preview-CLxs2bk2.mjs} +2 -2
- package/dist/preview-YrlSomd6.mjs +1 -0
- package/dist/public/assets/{ActivityModeContent-DLFbXUxu.js → ActivityModeContent-mJH5LtOR.js} +1 -1
- package/dist/public/assets/{DocumentContext-G9L-k-gp.js → DocumentContext-WluK-pvu.js} +1 -1
- package/dist/public/assets/{EnableSyncConfirmDialog-CN-y9rVU.js → EnableSyncConfirmDialog-BWfcC03w.js} +1 -1
- package/dist/public/assets/{ManagedArtifactProperties-BHlXkycH.js → ManagedArtifactProperties-BoAxNvK5.js} +1 -1
- package/dist/public/assets/{PropertyPanel-COyeCUEm.js → PropertyPanel-Bbn9RXvr.js} +1 -1
- package/dist/public/assets/{SettingsDialogBody-aM9cYdrY.js → SettingsDialogBody-BVNxduDH.js} +1 -1
- package/dist/public/assets/{ShareReceiveMissDialog-5z7ipD0K.js → ShareReceiveMissDialog-8HKZBtux.js} +1 -1
- package/dist/public/assets/{SourceEditor-5neNfhZp.js → SourceEditor-D0oQT5qb.js} +1 -1
- package/dist/public/assets/{auth-state-cache-DL7IyBXT.js → auth-state-cache-CaiWuhtJ.js} +1 -1
- package/dist/public/assets/{config-provider-NM1p9Zm_.js → config-provider-D-gGfmXm.js} +1 -1
- package/dist/public/assets/{index-CAO2ZCmA.js → index-BG8OZejR.js} +7 -7
- package/dist/public/assets/index-D53MQUCD.css +1 -0
- package/dist/public/assets/{pending-receive-nav-store-Vn0w1zmV.js → pending-receive-nav-store-BV9CpxST.js} +1 -1
- package/dist/public/assets/{selection-context-DaaHnwDJ.js → selection-context-DG6CuE_n.js} +1 -1
- package/dist/public/assets/{telemetry-impl-CgvC5Fqj.js → telemetry-impl-6qacFa_I.js} +1 -1
- package/dist/public/assets/{telemetry-startup-CJa6t0AY.js → telemetry-startup-ZaSL-kj2.js} +1 -1
- package/dist/public/assets/{typing-burst-detector-D5zZVgAZ.js → typing-burst-detector-D-XypHNF.js} +1 -1
- package/dist/public/index.html +10 -10
- package/dist/{repair-launch-json-DyLvrVW1.mjs → repair-launch-json-DsDdzz5S.mjs} +2 -2
- package/dist/{repair-mcp-configs-CT33n5tH.mjs → repair-mcp-configs-CAw5k6Ut.mjs} +2 -2
- package/dist/{repair-skills-DVU2ihEV.mjs → repair-skills-BbCNUguw.mjs} +2 -2
- package/dist/repair-skills-Bj4d8jaz.mjs +1 -0
- package/dist/server-lock-GuuouVft-BG2sFhIR.mjs +1 -0
- package/dist/{server-lock-ltHt39S2-p0c2u2YF.mjs → server-lock-iLcBw_q0-CPFOrsBn.mjs} +129 -129
- package/dist/src-7DlZEyGh.mjs +3 -0
- package/dist/start-CMWosjhu.mjs +3 -0
- package/dist/start-ame0DmVr.mjs +1 -0
- package/dist/{write-project-skill-CrWQ96do.mjs → write-project-skill-4cQ_oGJO.mjs} +2 -2
- package/package.json +1 -1
- package/dist/constants-yKbJK8XR.mjs +0 -2
- package/dist/dist-DX1pr3BF.mjs +0 -1
- package/dist/init-BRGhGrt3.mjs +0 -1
- package/dist/loader-D2NUZ1XL.mjs +0 -1
- package/dist/preview-BbcPCLGI.mjs +0 -1
- package/dist/public/assets/index-DJtUU5yP.css +0 -1
- package/dist/repair-skills-CdRibIoP.mjs +0 -1
- package/dist/server-lock-LsXsWtim-BrcDoV-6.mjs +0 -1
- package/dist/src-DcaRpMrD.mjs +0 -3
- package/dist/start-DJG5OWGG.mjs +0 -3
- package/dist/start-DSlZGsa_.mjs +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./telemetry-impl-
|
|
2
|
-
import{o as e,t}from"./chunk-CFjPhJqf.js";import{t as n}from"./preload-helper-2ej06EnG.js";import{n as r,r as i,t as a}from"./compiler-runtime-CVnuRdak.js";import{$ as o,$n as s,$t as c,A as l,An as u,B as d,Bn as f,Bt as p,Cn as m,Ct as h,D as g,Dn as _,Dt as v,En as y,Et as b,F as x,Ft as S,G as C,Gn as w,Gt as T,H as E,Hn as D,Ht as O,I as k,In as A,It as j,Jn as M,Jt as N,K as P,Kn as F,L as I,Ln as L,Lt as R,Mn as z,Mt as B,Nn as V,Nt as H,O as U,On as W,Ot as G,Pn as K,Pt as ee,Qn as te,Qt as ne,R as re,Rn as ie,Rt as ae,Sn as oe,St as se,Tn as ce,Tt as le,U as q,Un as ue,Ut as de,V as fe,Vn as pe,Vt as me,W as he,Wn as ge,Wt as _e,Xn as ve,Xt as ye,Yn as be,Yt as xe,Z as Se,Zn as Ce,Zt as we,_n as Te,_t as Ee,a as De,an as Oe,at as ke,bn as Ae,bt as je,c as Me,cn as Ne,cr as Pe,ct as Fe,d as Ie,dn as Le,dr as Re,dt as ze,en as Be,er as Ve,et as He,f as Ue,fn as We,ft as Ge,g as Ke,gn as qe,gt as Je,h as Ye,hn as Xe,ht as Ze,i as Qe,in as $e,ir as et,it as tt,j as nt,jn as rt,jt as it,k as at,kn as ot,l as st,ln as ct,lr as lt,lt as ut,m as dt,mn as ft,mt as pt,n as mt,nn as ht,nr as gt,nt as _t,o as vt,on as yt,or as bt,ot as xt,p as St,pn as Ct,pt as wt,qn as Tt,qt as Et,r as Dt,rn as Ot,rt as kt,s as At,sn as jt,sr as Mt,st as Nt,t as Pt,tn as Ft,u as It,un as Lt,ur as Rt,ut as zt,v as Bt,vn as Vt,vt as Ht,wn as Ut,wt as Wt,xn as Gt,xt as Kt,y as qt,yn as Jt,yt as Yt,z as Xt,zn as Zt,zt as Qt}from"./DocumentContext-G9L-k-gp.js";import{n as J,r as $t,t as en}from"./dist-CQw2y-s3.js";import{A as tn,C as nn,D as rn,E as an,O as on,S as sn,T as cn,_ as ln,a as un,b as dn,c as fn,d as pn,f as mn,g as hn,h as gn,i as _n,k as vn,l as yn,m as bn,n as xn,o as Sn,p as Cn,r as wn,s as Tn,t as En,u as Dn,v as On,w as kn,x as An,y as jn}from"./panel-BH2RZRZQ.js";import{n as Mn,t as Nn}from"./dist-BVOt51sU.js";import{t as Pn}from"./react-dom-C-oc-P2K.js";import{A as Fn,Bi as In,Br as Ln,Cr as Rn,Ct as zn,D as Bn,Dt as Vn,E as Hn,En as Un,F as Wn,Fi as Gn,Fn as Kn,Fr as qn,Ft as Jn,Hi as Yn,K as Xn,Mr as Zn,Ni as Qn,Nr as $n,O as er,Ot as tr,P as nr,Pr as rr,Ri as ir,Rn as ar,S as or,Sn as sr,Sr as cr,Tr as lr,Ui as ur,Ur as dr,Vn as fr,Vr as pr,Wi as mr,Wn as hr,Xr as gr,Xt as _r,Yt as vr,Zr as yr,_n as br,_r as xr,an as Sr,bn as Cr,br as wr,cn as Tr,cr as Er,ct as Dr,di as Or,dn as kr,dr as Ar,ei as jr,fi as Mr,fn as Nr,fr as Pr,gn as Fr,gr as Ir,ji as Lr,jr as Rr,jt as zr,k as Br,kr as Vr,li as Hr,ln as Ur,mt as Wr,n as Gr,ni as Kr,nn as qr,o as Jr,oi as Yr,or as Xr,pi as Zr,pr as Qr,pt as $r,r as ei,ri as ti,rt as ni,t as ri,ti as ii,tr as ai,un as oi,v as si,vn as ci,vr as li,w as ui,wn as di,wt as fi,x as pi,xr as mi,zn as hi}from"./dist-BkxMNfFN.js";import{a as gi,i as Y,r as _i,t as X,u as vi}from"./button-cneJOVxD.js";import{a as yi,c as bi,i as xi,n as Si,o as Ci,r as wi,s as Ti,t as Ei}from"./pending-receive-nav-store-Vn0w1zmV.js";import{a as Di,c as Oi,l as ki,o as Ai,s as ji}from"./EnableSyncConfirmDialog-CN-y9rVU.js";import{t as Mi}from"./arrow-up-right-DoN2FmSd.js";import{a as Ni,c as Pi,d as Fi,i as Ii,l as Li,o as Ri,r as zi,s as Bi,t as Vi,u as Hi}from"./PropertyPanel-COyeCUEm.js";import{t as Ui}from"./check-Dqb-7gfx.js";import{t as Wi}from"./chevron-down-D3nis7uo.js";import{t as Gi}from"./chevron-left-C6Q_NKVx.js";import{t as Ki}from"./chevron-right-BfmqRYl8.js";import{a as qi,c as Ji,i as Yi,l as Xi,n as Zi}from"./prop-types-PwAyvfNz.js";import{C as Qi,D as $i,E as ea,O as ta,S as na,T as ra,_ as ia,a as aa,c as oa,d as sa,g as ca,h as la,i as ua,k as da,l as fa,m as pa,n as ma,o as ha,p as ga,r as _a,s as va,u as ya,v as ba,w as xa,x as Sa,y as Ca}from"./skill-actions-DmQL_HGK.js";import{$ as wa,A as Ta,B as Ea,D as Da,F as Oa,G as ka,H as Aa,I as ja,J as Ma,K as Na,L as Pa,O as Fa,P as Ia,Q as La,R as Ra,T as za,U as Ba,V as Va,W as Ha,X as Ua,Y as Wa,Z as Ga,_ as Ka,a as qa,at as Ja,b as Ya,c as Xa,ct as Za,dt as Qa,et as $a,it as eo,k as to,l as no,lt as ro,m as io,n as ao,nt as oo,ot as so,q as co,r as lo,rt as uo,st as fo,t as po,tt as mo,u as ho,ut as go,v as _o,w as vo,y as yo,z as bo}from"./auth-state-cache-DL7IyBXT.js";import{c as xo,i as So,l as Co,n as wo,o as To,r as Eo,s as Do,t as Oo}from"./skill-scope-Bt2TwqtA.js";import{a as ko,i as Ao,l as jo,n as Mo,t as No}from"./config-provider-NM1p9Zm_.js";import{n as Po,r as Fo}from"./config-context-CVpOcWSZ.js";import{t as Io}from"./git-branch-DtntyZcb.js";import{_ as Lo,c as Ro,f as zo,g as Bo,h as Vo,i as Ho,l as Uo,m as Wo,o as Go,p as Ko,s as qo,t as Jo,u as Yo,v as Xo,y as Zo}from"./open-managed-artifact-tab-TH1tyrz4.js";import{t as Qo}from"./info-B_9IOYHV.js";import{t as $o}from"./loader-circle-CiIO3Fk-.js";import{t as es}from"./miss-dialog-store-Ay7SdCdU.js";import{t as ts}from"./refresh-cw-EVALIeLp.js";import{a as ns,i as rs,r as is,t as as}from"./cursor-CGeB2PU5.js";import{t as os}from"./triangle-alert-r1Ou0VrE.js";import{a as ss,c as cs,i as ls,n as us,o as ds,r as fs,s as ps,t as ms}from"./agent-presence-C79Orlhd.js";import{n as hs,r as gs,t as _s}from"./dist-IEs1iCqd.js";import{a as vs,c as ys,d as bs,i as xs,o as Ss,r as Cs,u as ws}from"./dist-D9WIglau.js";import{i as Ts,n as Es,r as Ds,t as Os}from"./tooltip-C9Dd0rIc.js";import{c as ks,d as As,f as js,g as Ms,h as Ns,l as Ps,m as Fs,o as Is,p as Ls,s as Rs,u as zs}from"./dist-C0qRhuIN.js";import{n as Bs,r as Vs,t as Hs}from"./collapsible-iVWLn36m.js";import{a as Us,c as Ws,i as Gs,n as Ks,o as qs,s as Js,t as Ys}from"./dialog-BiB39Lhy.js";import{t as Xs}from"./checkbox-P04sbGVQ.js";import{n as Zs,r as Qs,t as $s}from"./dist-DQdOYnjt.js";import{A as ec,B as tc,C as nc,D as rc,E as ic,F as ac,H as oc,I as sc,L as cc,M as lc,N as uc,O as dc,P as fc,R as pc,S as mc,T as hc,V as gc,_ as _c,g as vc,h as yc,i as bc,j as xc,k as Sc,m as Cc,o as wc,p as Tc,r as Ec,u as Dc,v as Oc,w as kc,x as Ac,z as jc}from"./skills-api-T8UMKFuI.js";import{t as Mc}from"./label-hTzLGQhh.js";import{n as Nc,t as Pc}from"./radio-group-1_2tsQbc.js";import{n as Fc,r as Ic,t as Lc}from"./toggle-group-IN7Np0Is.js";import{a as Rc,i as zc,n as Bc,r as Vc}from"./project-paths-Dvd83Cnz.js";import{t as Hc}from"./input-D0MSkqYi.js";import{n as Uc,t as Wc}from"./dist-0Zj_lz7j.js";import{n as Gc,r as Kc,t as qc}from"./file-tree-rename-validation-BkATWpiZ.js";import{C as Jc,D as Yc,E as Xc,O as Zc,T as Qc,a as $c,c as el,d as tl,f as nl,g as rl,h as il,i as al,k as ol,l as sl,m as cl,n as ll,o as ul,r as dl,s as fl,t as pl,u as ml,v as hl,w as gl,y as _l}from"./doc-hash-5OIPOG-G.js";import{a as vl,c as yl,n as bl,o as xl,r as Sl,s as Cl}from"./documents-events-D064jVvV.js";import{a as wl,i as Tl,o as El}from"./startup-marks-DdMtjWR-.js";import{c as Dl,i as Ol,l as kl,o as Al}from"./keyboard-shortcuts-DiiTkD4P.js";import{$ as jl,At as Ml,Ct as Nl,Dt as Pl,Ft as Fl,I as Il,It as Ll,J as Rl,Mt as zl,Ot as Bl,Pt as Vl,Q as Hl,Tt as Ul,X as Wl,Z as Gl,at as Kl,bt as ql,jt as Jl,k as Yl,w as Xl}from"./dist-DVPtn9Zx.js";import{n as Zl}from"./dist-D7I9jMga.js";import{c as Ql,f as $l,g as eu,i as tu,l as nu,n as ru,o as iu,p as au,r as ou,s as su,t as cu,u as lu}from"./typing-burst-detector-D5zZVgAZ.js";import{t as uu}from"./external-link-ChNdN5KK.js";import{t as du}from"./target-navigation-intent-idRDy9hG.js";import"./textarea-CUjvX3CU.js";import{c as fu,i as pu,n as mu,r as hu,s as gu,u as _u}from"./selection-context-DaaHnwDJ.js";import{C as vu,D as yu,E as bu,O as xu,S as Su,T as Cu,_ as wu,a as Tu,b as Eu,c as Du,d as Ou,f as ku,g as Au,h as ju,i as Mu,k as Nu,l as Pu,m as Fu,n as Iu,o as Lu,p as Ru,r as zu,s as Bu,t as Vu,u as Hu,v as Uu,w as Wu,x as Gu,y as Ku}from"./file-tree-adapter-Bg8FQvOB.js";import{n as qu,t as Ju}from"./mcp-consent-store-Bx7YkTj-.js";import{a as Yu,t as Xu}from"./receive-store-z_JiltPn.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();function Zu(){({BASE_URL:`./`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1,VITE_APP_VERSION:`0.24.0`})?.VITE_OTEL_ENABLED===`true`&&n(()=>import(`./telemetry-impl-CgvC5Fqj.js`).then(e=>e.install()),__vite__mapDeps([0,1,2,3,4]),import.meta.url)}function Qu(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{hn(e,()=>t.signal,()=>n=!0)},u=jn(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject();if(r==null&&e.pages.length)return Promise.resolve(e);let a=await u((()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})()),{maxPages:o}=t.options,s=i?On:ln;return{pages:s(e.pages,a,o),pageParams:s(e.pageParams,r,o)}};if(i&&a.length){let e=i===`backward`,t=e?ed:$u,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:$u(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function $u(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function ed(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var td=class extends mn{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||nd(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=Cn({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#n.runNext(this)}}#i(e){this.state=(t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}})(this.state),gn.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function nd(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var rd=class extends tn{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new td({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=id(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=id(e);if(typeof t==`string`){let n=this.#t.get(t);if(n)if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=id(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}else return!0}runNext(e){let t=id(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){gn.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>nn(t,e))}findAll(e={}){return this.getAll().filter(t=>nn(e,t))}notify(e){gn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return gn.batch(()=>Promise.all(e.map(e=>e.continue().catch(cn))))}};function id(e){return e.options.scope?.id}var ad=class extends tn{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??sn(r,t),a=this.get(i);return a||(a=new pn({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){gn.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>kn(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>kn(e,t)):t}notify(e){gn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){gn.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){gn.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},od=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new ad,this.#t=e.mutationCache||new rd,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=vn.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=bn.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(rn(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=dn(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return gn.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;gn.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return gn.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=gn.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(cn).catch(cn)}invalidateQueries(e,t={}){return gn.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=gn.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(cn)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(cn)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(rn(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(cn).catch(cn)}fetchInfiniteQuery(e){return e.behavior=Qu(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(cn).catch(cn)}ensureInfiniteQueryData(e){return e.behavior=Qu(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return bn.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(An(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{an(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(An(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{an(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=sn(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===on&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},sd=t((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),cd=t(((e,t)=>{t.exports=sd()})),ld=t((e=>{var t=cd(),n=r(),i=Pn();function a(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function o(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function s(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function c(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function u(e){if(s(e)!==e)throw Error(a(188))}function d(e){var t=e.alternate;if(!t){if(t=s(e),t===null)throw Error(a(188));return t===e?e:null}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var o=i.alternate;if(o===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return u(i),e;if(o===r)return u(i),t;o=o.sibling}throw Error(a(188))}if(n.return!==r.return)n=i,r=o;else{for(var c=!1,l=i.child;l;){if(l===n){c=!0,n=i,r=o;break}if(l===r){c=!0,r=i,n=o;break}l=l.sibling}if(!c){for(l=o.child;l;){if(l===n){c=!0,n=o,r=i;break}if(l===r){c=!0,r=o,n=i;break}l=l.sibling}if(!c)throw Error(a(189))}}if(n.alternate!==r)throw Error(a(190))}if(n.tag!==3)throw Error(a(188));return n.stateNode.current===n?e:t}function f(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=f(e),t!==null)return t;e=e.sibling}return null}var p=Object.assign,m=Symbol.for(`react.element`),h=Symbol.for(`react.transitional.element`),g=Symbol.for(`react.portal`),_=Symbol.for(`react.fragment`),v=Symbol.for(`react.strict_mode`),y=Symbol.for(`react.profiler`),b=Symbol.for(`react.consumer`),x=Symbol.for(`react.context`),S=Symbol.for(`react.forward_ref`),C=Symbol.for(`react.suspense`),w=Symbol.for(`react.suspense_list`),T=Symbol.for(`react.memo`),E=Symbol.for(`react.lazy`),D=Symbol.for(`react.activity`),O=Symbol.for(`react.memo_cache_sentinel`),k=Symbol.iterator;function A(e){return typeof e!=`object`||!e?null:(e=k&&e[k]||e[`@@iterator`],typeof e==`function`?e:null)}var j=Symbol.for(`react.client.reference`);function M(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===j?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case _:return`Fragment`;case y:return`Profiler`;case v:return`StrictMode`;case C:return`Suspense`;case w:return`SuspenseList`;case D:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case g:return`Portal`;case x:return e.displayName||`Context`;case b:return(e._context.displayName||`Context`)+`.Consumer`;case S:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case T:return t=e.displayName||null,t===null?M(e.type)||`Memo`:t;case E:t=e._payload,e=e._init;try{return M(e(t))}catch{}}return null}var N=Array.isArray,P=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I={pending:!1,data:null,method:null,action:null},L=[],R=-1;function z(e){return{current:e}}function B(e){0>R||(e.current=L[R],L[R]=null,R--)}function V(e,t){R++,L[R]=e.current,e.current=t}var H=z(null),U=z(null),W=z(null),G=z(null);function K(e,t){switch(V(W,t),V(U,e),V(H,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Vd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Vd(t),e=Hd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}B(H),V(H,e)}function ee(){B(H),B(U),B(W)}function te(e){e.memoizedState!==null&&V(G,e);var t=H.current,n=Hd(t,e.type);t!==n&&(V(U,e),V(H,n))}function ne(e){U.current===e&&(B(H),B(U)),G.current===e&&(B(G),Qf._currentValue=I)}var re,ie;function ae(e){if(re===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);re=t&&t[1]||``,ie=-1<e.stack.indexOf(`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./telemetry-impl-6qacFa_I.js","./chunk-CFjPhJqf.js","./preload-helper-2ej06EnG.js","./trace-api-D6fqC5Nw.js","./propagation-api-BHhJitgG.js","./ActivityPanelDiffView-BPrpOwiv.js","./dist-CQw2y-s3.js","./compiler-runtime-CVnuRdak.js","./ActivityPanelDiffView-legcy4jI.css","./GraphPanel-Cf9lwwnw.js","./dist-BkxMNfFN.js","./w3c-keyname-CHcJEDvG.js","./dist-0Zj_lz7j.js","./button-cneJOVxD.js","./toggle-group-IN7Np0Is.js","./dist-C0qRhuIN.js","./dist-D9WIglau.js","./react-dom-C-oc-P2K.js","./dist-DfThKWJX.js","./dist-DQdOYnjt.js","./tooltip-C9Dd0rIc.js","./panel-BH2RZRZQ.js","./min-cXlECwx8.js","./src-BjEzLuzr.js","./colors-BwB-X4pV.js","./ordinal-Ca5DZ3xr.js","./init-20ACqh4a.js","./isObjectLike-DURfeUEd.js","./now-Cnt3xXdO.js","./isSymbol-BR3mCdgP.js","./arrow-up-right-DoN2FmSd.js","./prop-types-PwAyvfNz.js","./doc-hash-5OIPOG-G.js","./documents-events-D064jVvV.js","./startup-marks-DdMtjWR-.js","./triangle-alert-r1Ou0VrE.js","./dist-BVOt51sU.js","./target-navigation-intent-idRDy9hG.js","./external-link-ChNdN5KK.js","./ActivityModeContent-mJH5LtOR.js","./DocumentContext-WluK-pvu.js","./dist-DI8cI4NP.js","./dist-DVPtn9Zx.js","./dist-CPpRuwFX.js","./dist-D8Itza26.js","./dist-DPfhM7y8.js","./dist-Dg5nhLZ2.js","./dist-CkLidFHS.js","./dist-D7I9jMga.js","./dist-BEW6C_CZ.js","./stex-DYxKXJZx.js","./config-provider-D-gGfmXm.js","./config-context-CVpOcWSZ.js","./collapsible-iVWLn36m.js","./dialog-BiB39Lhy.js","./dist-IEs1iCqd.js","./dist-CbgmYSt6.js","./check-Dqb-7gfx.js","./chevron-down-D3nis7uo.js","./chevron-right-BfmqRYl8.js","./skill-scope-Bt2TwqtA.js","./git-branch-DtntyZcb.js","./info-B_9IOYHV.js","./loader-circle-CiIO3Fk-.js","./file-tree-rename-validation-BkATWpiZ.js","./input-D0MSkqYi.js","./DocumentContext-B0sQn39F.css","./agent-presence-C79Orlhd.js","./cursor-CGeB2PU5.js","./dist-BuoXuHTG.js","./dist-CgYE3gek.js","./SettingsDialogBody-BVNxduDH.js","./open-managed-artifact-tab-TH1tyrz4.js","./checkbox-P04sbGVQ.js","./skills-api-T8UMKFuI.js","./label-hTzLGQhh.js","./radio-group-1_2tsQbc.js","./auth-state-cache-CaiWuhtJ.js","./EnableSyncConfirmDialog-BWfcC03w.js","./skill-actions-DmQL_HGK.js","./refresh-cw-EVALIeLp.js","./textarea-CUjvX3CU.js","./keyboard-shortcuts-DiiTkD4P.js","./ManagedArtifactProperties-BoAxNvK5.js","./PropertyPanel-Bbn9RXvr.js","./format-CFXD031r.js","./selection-context-DG6CuE_n.js","./SourceEditor-D0oQT5qb.js","./typing-burst-detector-D-XypHNF.js","./SkillEditorActions-85awfZeZ.js","./TerminalPanel-BNR82pgE.js","./file-tree-adapter-Bg8FQvOB.js","./TerminalPanel-BrP-ENHg.css","./McpConsentDialogBody-DXwlUNR4.js","./mcp-consent-store-Bx7YkTj-.js","./ShareBranchSwitchDialog-Bo95Aacz.js","./miss-dialog-store-Ay7SdCdU.js","./share-metadata-rows-COyU9rhn.js","./desktop-bridge-types-C22Y6m5Y.js","./receive-store-z_JiltPn.js","./ShareReceiveMissDialog-8HKZBtux.js","./pending-receive-nav-store-BV9CpxST.js","./ConsentDialogBody-Bza0TMPd.js","./project-paths-Dvd83Cnz.js","./ShareReceiveDialog-jEI9GD0l.js","./telemetry-startup-ZaSL-kj2.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{o as e,t}from"./chunk-CFjPhJqf.js";import{t as n}from"./preload-helper-2ej06EnG.js";import{n as r,r as i,t as a}from"./compiler-runtime-CVnuRdak.js";import{$ as o,$n as s,$t as c,A as l,An as u,B as d,Bn as f,Bt as p,Cn as m,Ct as h,D as g,Dn as _,Dt as v,En as y,Et as b,F as x,Ft as S,G as C,Gn as w,Gt as T,H as E,Hn as D,Ht as O,I as k,In as A,It as j,Jn as M,Jt as N,K as P,Kn as F,L as I,Ln as L,Lt as R,Mn as z,Mt as B,Nn as V,Nt as H,O as U,On as W,Ot as G,Pn as K,Pt as ee,Qn as te,Qt as ne,R as re,Rn as ie,Rt as ae,Sn as oe,St as se,Tn as ce,Tt as le,U as q,Un as ue,Ut as de,V as fe,Vn as pe,Vt as me,W as he,Wn as ge,Wt as _e,Xn as ve,Xt as ye,Yn as be,Yt as xe,Z as Se,Zn as Ce,Zt as we,_n as Te,_t as Ee,a as De,an as Oe,at as ke,bn as Ae,bt as je,c as Me,cn as Ne,cr as Pe,ct as Fe,d as Ie,dn as Le,dr as Re,dt as ze,en as Be,er as Ve,et as He,f as Ue,fn as We,ft as Ge,g as Ke,gn as qe,gt as Je,h as Ye,hn as Xe,ht as Ze,i as Qe,in as $e,ir as et,it as tt,j as nt,jn as rt,jt as it,k as at,kn as ot,l as st,ln as ct,lr as lt,lt as ut,m as dt,mn as ft,mt as pt,n as mt,nn as ht,nr as gt,nt as _t,o as vt,on as yt,or as bt,ot as xt,p as St,pn as Ct,pt as wt,qn as Tt,qt as Et,r as Dt,rn as Ot,rt as kt,s as At,sn as jt,sr as Mt,st as Nt,t as Pt,tn as Ft,u as It,un as Lt,ur as Rt,ut as zt,v as Bt,vn as Vt,vt as Ht,wn as Ut,wt as Wt,xn as Gt,xt as Kt,y as qt,yn as Jt,yt as Yt,z as Xt,zn as Zt,zt as Qt}from"./DocumentContext-WluK-pvu.js";import{n as J,r as $t,t as en}from"./dist-CQw2y-s3.js";import{A as tn,C as nn,D as rn,E as an,O as on,S as sn,T as cn,_ as ln,a as un,b as dn,c as fn,d as pn,f as mn,g as hn,h as gn,i as _n,k as vn,l as yn,m as bn,n as xn,o as Sn,p as Cn,r as wn,s as Tn,t as En,u as Dn,v as On,w as kn,x as An,y as jn}from"./panel-BH2RZRZQ.js";import{n as Mn,t as Nn}from"./dist-BVOt51sU.js";import{t as Pn}from"./react-dom-C-oc-P2K.js";import{A as Fn,Bi as In,Br as Ln,Cr as Rn,Ct as zn,D as Bn,Dt as Vn,E as Hn,En as Un,F as Wn,Fi as Gn,Fn as Kn,Fr as qn,Ft as Jn,Hi as Yn,K as Xn,Mr as Zn,Ni as Qn,Nr as $n,O as er,Ot as tr,P as nr,Pr as rr,Ri as ir,Rn as ar,S as or,Sn as sr,Sr as cr,Tr as lr,Ui as ur,Ur as dr,Vn as fr,Vr as pr,Wi as mr,Wn as hr,Xr as gr,Xt as _r,Yt as vr,Zr as yr,_n as br,_r as xr,an as Sr,bn as Cr,br as wr,cn as Tr,cr as Er,ct as Dr,di as Or,dn as kr,dr as Ar,ei as jr,fi as Mr,fn as Nr,fr as Pr,gn as Fr,gr as Ir,ji as Lr,jr as Rr,jt as zr,k as Br,kr as Vr,li as Hr,ln as Ur,mt as Wr,n as Gr,ni as Kr,nn as qr,o as Jr,oi as Yr,or as Xr,pi as Zr,pr as Qr,pt as $r,r as ei,ri as ti,rt as ni,t as ri,ti as ii,tr as ai,un as oi,v as si,vn as ci,vr as li,w as ui,wn as di,wt as fi,x as pi,xr as mi,zn as hi}from"./dist-BkxMNfFN.js";import{a as gi,i as Y,r as _i,t as X,u as vi}from"./button-cneJOVxD.js";import{a as yi,c as bi,i as xi,n as Si,o as Ci,r as wi,s as Ti,t as Ei}from"./pending-receive-nav-store-BV9CpxST.js";import{a as Di,c as Oi,l as ki,o as Ai,s as ji}from"./EnableSyncConfirmDialog-BWfcC03w.js";import{t as Mi}from"./arrow-up-right-DoN2FmSd.js";import{a as Ni,c as Pi,d as Fi,i as Ii,l as Li,o as Ri,r as zi,s as Bi,t as Vi,u as Hi}from"./PropertyPanel-Bbn9RXvr.js";import{t as Ui}from"./check-Dqb-7gfx.js";import{t as Wi}from"./chevron-down-D3nis7uo.js";import{t as Gi}from"./chevron-left-C6Q_NKVx.js";import{t as Ki}from"./chevron-right-BfmqRYl8.js";import{a as qi,c as Ji,i as Yi,l as Xi,n as Zi}from"./prop-types-PwAyvfNz.js";import{C as Qi,D as $i,E as ea,O as ta,S as na,T as ra,_ as ia,a as aa,c as oa,d as sa,g as ca,h as la,i as ua,k as da,l as fa,m as pa,n as ma,o as ha,p as ga,r as _a,s as va,u as ya,v as ba,w as xa,x as Sa,y as Ca}from"./skill-actions-DmQL_HGK.js";import{$ as wa,A as Ta,B as Ea,D as Da,F as Oa,G as ka,H as Aa,I as ja,J as Ma,K as Na,L as Pa,O as Fa,P as Ia,Q as La,R as Ra,T as za,U as Ba,V as Va,W as Ha,X as Ua,Y as Wa,Z as Ga,_ as Ka,a as qa,at as Ja,b as Ya,c as Xa,ct as Za,dt as Qa,et as $a,it as eo,k as to,l as no,lt as ro,m as io,n as ao,nt as oo,ot as so,q as co,r as lo,rt as uo,st as fo,t as po,tt as mo,u as ho,ut as go,v as _o,w as vo,y as yo,z as bo}from"./auth-state-cache-CaiWuhtJ.js";import{c as xo,i as So,l as Co,n as wo,o as To,r as Eo,s as Do,t as Oo}from"./skill-scope-Bt2TwqtA.js";import{a as ko,i as Ao,l as jo,n as Mo,t as No}from"./config-provider-D-gGfmXm.js";import{n as Po,r as Fo}from"./config-context-CVpOcWSZ.js";import{t as Io}from"./git-branch-DtntyZcb.js";import{_ as Lo,c as Ro,f as zo,g as Bo,h as Vo,i as Ho,l as Uo,m as Wo,o as Go,p as Ko,s as qo,t as Jo,u as Yo,v as Xo,y as Zo}from"./open-managed-artifact-tab-TH1tyrz4.js";import{t as Qo}from"./info-B_9IOYHV.js";import{t as $o}from"./loader-circle-CiIO3Fk-.js";import{t as es}from"./miss-dialog-store-Ay7SdCdU.js";import{t as ts}from"./refresh-cw-EVALIeLp.js";import{a as ns,i as rs,r as is,t as as}from"./cursor-CGeB2PU5.js";import{t as os}from"./triangle-alert-r1Ou0VrE.js";import{a as ss,c as cs,i as ls,n as us,o as ds,r as fs,s as ps,t as ms}from"./agent-presence-C79Orlhd.js";import{n as hs,r as gs,t as _s}from"./dist-IEs1iCqd.js";import{a as vs,c as ys,d as bs,i as xs,o as Ss,r as Cs,u as ws}from"./dist-D9WIglau.js";import{i as Ts,n as Es,r as Ds,t as Os}from"./tooltip-C9Dd0rIc.js";import{c as ks,d as As,f as js,g as Ms,h as Ns,l as Ps,m as Fs,o as Is,p as Ls,s as Rs,u as zs}from"./dist-C0qRhuIN.js";import{n as Bs,r as Vs,t as Hs}from"./collapsible-iVWLn36m.js";import{a as Us,c as Ws,i as Gs,n as Ks,o as qs,s as Js,t as Ys}from"./dialog-BiB39Lhy.js";import{t as Xs}from"./checkbox-P04sbGVQ.js";import{n as Zs,r as Qs,t as $s}from"./dist-DQdOYnjt.js";import{A as ec,B as tc,C as nc,D as rc,E as ic,F as ac,H as oc,I as sc,L as cc,M as lc,N as uc,O as dc,P as fc,R as pc,S as mc,T as hc,V as gc,_ as _c,g as vc,h as yc,i as bc,j as xc,k as Sc,m as Cc,o as wc,p as Tc,r as Ec,u as Dc,v as Oc,w as kc,x as Ac,z as jc}from"./skills-api-T8UMKFuI.js";import{t as Mc}from"./label-hTzLGQhh.js";import{n as Nc,t as Pc}from"./radio-group-1_2tsQbc.js";import{n as Fc,r as Ic,t as Lc}from"./toggle-group-IN7Np0Is.js";import{a as Rc,i as zc,n as Bc,r as Vc}from"./project-paths-Dvd83Cnz.js";import{t as Hc}from"./input-D0MSkqYi.js";import{n as Uc,t as Wc}from"./dist-0Zj_lz7j.js";import{n as Gc,r as Kc,t as qc}from"./file-tree-rename-validation-BkATWpiZ.js";import{C as Jc,D as Yc,E as Xc,O as Zc,T as Qc,a as $c,c as el,d as tl,f as nl,g as rl,h as il,i as al,k as ol,l as sl,m as cl,n as ll,o as ul,r as dl,s as fl,t as pl,u as ml,v as hl,w as gl,y as _l}from"./doc-hash-5OIPOG-G.js";import{a as vl,c as yl,n as bl,o as xl,r as Sl,s as Cl}from"./documents-events-D064jVvV.js";import{a as wl,i as Tl,o as El}from"./startup-marks-DdMtjWR-.js";import{c as Dl,i as Ol,l as kl,o as Al}from"./keyboard-shortcuts-DiiTkD4P.js";import{$ as jl,At as Ml,Ct as Nl,Dt as Pl,Ft as Fl,I as Il,It as Ll,J as Rl,Mt as zl,Ot as Bl,Pt as Vl,Q as Hl,Tt as Ul,X as Wl,Z as Gl,at as Kl,bt as ql,jt as Jl,k as Yl,w as Xl}from"./dist-DVPtn9Zx.js";import{n as Zl}from"./dist-D7I9jMga.js";import{c as Ql,f as $l,g as eu,i as tu,l as nu,n as ru,o as iu,p as au,r as ou,s as su,t as cu,u as lu}from"./typing-burst-detector-D-XypHNF.js";import{t as uu}from"./external-link-ChNdN5KK.js";import{t as du}from"./target-navigation-intent-idRDy9hG.js";import"./textarea-CUjvX3CU.js";import{c as fu,i as pu,n as mu,r as hu,s as gu,u as _u}from"./selection-context-DG6CuE_n.js";import{C as vu,D as yu,E as bu,O as xu,S as Su,T as Cu,_ as wu,a as Tu,b as Eu,c as Du,d as Ou,f as ku,g as Au,h as ju,i as Mu,k as Nu,l as Pu,m as Fu,n as Iu,o as Lu,p as Ru,r as zu,s as Bu,t as Vu,u as Hu,v as Uu,w as Wu,x as Gu,y as Ku}from"./file-tree-adapter-Bg8FQvOB.js";import{n as qu,t as Ju}from"./mcp-consent-store-Bx7YkTj-.js";import{a as Yu,t as Xu}from"./receive-store-z_JiltPn.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();function Zu(){({BASE_URL:`./`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1,VITE_APP_VERSION:`0.25.0`})?.VITE_OTEL_ENABLED===`true`&&n(()=>import(`./telemetry-impl-6qacFa_I.js`).then(e=>e.install()),__vite__mapDeps([0,1,2,3,4]),import.meta.url)}function Qu(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{hn(e,()=>t.signal,()=>n=!0)},u=jn(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject();if(r==null&&e.pages.length)return Promise.resolve(e);let a=await u((()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})()),{maxPages:o}=t.options,s=i?On:ln;return{pages:s(e.pages,a,o),pageParams:s(e.pageParams,r,o)}};if(i&&a.length){let e=i===`backward`,t=e?ed:$u,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:$u(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.options.persister?t.fetchFn=()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):t.fetchFn=l}}}function $u(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function ed(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var td=class extends mn{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||nd(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=Cn({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#n.runNext(this)}}#i(e){this.state=(t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}})(this.state),gn.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function nd(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var rd=class extends tn{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new td({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=id(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=id(e);if(typeof t==`string`){let n=this.#t.get(t);if(n)if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=id(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}else return!0}runNext(e){let t=id(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){gn.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>nn(t,e))}findAll(e={}){return this.getAll().filter(t=>nn(e,t))}notify(e){gn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return gn.batch(()=>Promise.all(e.map(e=>e.continue().catch(cn))))}};function id(e){return e.options.scope?.id}var ad=class extends tn{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??sn(r,t),a=this.get(i);return a||(a=new pn({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){gn.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>kn(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>kn(e,t)):t}notify(e){gn.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){gn.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){gn.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},od=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new ad,this.#t=e.mutationCache||new rd,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=vn.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=bn.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(rn(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=dn(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return gn.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;gn.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return gn.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=gn.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(cn).catch(cn)}invalidateQueries(e,t={}){return gn.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=gn.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(cn)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(cn)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(rn(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(cn).catch(cn)}fetchInfiniteQuery(e){return e.behavior=Qu(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(cn).catch(cn)}ensureInfiniteQueryData(e){return e.behavior=Qu(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return bn.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(An(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{an(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(An(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{an(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=sn(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===on&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},sd=t((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m)if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),cd=t(((e,t)=>{t.exports=sd()})),ld=t((e=>{var t=cd(),n=r(),i=Pn();function a(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function o(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function s(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function c(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function u(e){if(s(e)!==e)throw Error(a(188))}function d(e){var t=e.alternate;if(!t){if(t=s(e),t===null)throw Error(a(188));return t===e?e:null}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var o=i.alternate;if(o===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return u(i),e;if(o===r)return u(i),t;o=o.sibling}throw Error(a(188))}if(n.return!==r.return)n=i,r=o;else{for(var c=!1,l=i.child;l;){if(l===n){c=!0,n=i,r=o;break}if(l===r){c=!0,r=i,n=o;break}l=l.sibling}if(!c){for(l=o.child;l;){if(l===n){c=!0,n=o,r=i;break}if(l===r){c=!0,r=o,n=i;break}l=l.sibling}if(!c)throw Error(a(189))}}if(n.alternate!==r)throw Error(a(190))}if(n.tag!==3)throw Error(a(188));return n.stateNode.current===n?e:t}function f(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=f(e),t!==null)return t;e=e.sibling}return null}var p=Object.assign,m=Symbol.for(`react.element`),h=Symbol.for(`react.transitional.element`),g=Symbol.for(`react.portal`),_=Symbol.for(`react.fragment`),v=Symbol.for(`react.strict_mode`),y=Symbol.for(`react.profiler`),b=Symbol.for(`react.consumer`),x=Symbol.for(`react.context`),S=Symbol.for(`react.forward_ref`),C=Symbol.for(`react.suspense`),w=Symbol.for(`react.suspense_list`),T=Symbol.for(`react.memo`),E=Symbol.for(`react.lazy`),D=Symbol.for(`react.activity`),O=Symbol.for(`react.memo_cache_sentinel`),k=Symbol.iterator;function A(e){return typeof e!=`object`||!e?null:(e=k&&e[k]||e[`@@iterator`],typeof e==`function`?e:null)}var j=Symbol.for(`react.client.reference`);function M(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===j?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case _:return`Fragment`;case y:return`Profiler`;case v:return`StrictMode`;case C:return`Suspense`;case w:return`SuspenseList`;case D:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case g:return`Portal`;case x:return e.displayName||`Context`;case b:return(e._context.displayName||`Context`)+`.Consumer`;case S:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case T:return t=e.displayName||null,t===null?M(e.type)||`Memo`:t;case E:t=e._payload,e=e._init;try{return M(e(t))}catch{}}return null}var N=Array.isArray,P=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I={pending:!1,data:null,method:null,action:null},L=[],R=-1;function z(e){return{current:e}}function B(e){0>R||(e.current=L[R],L[R]=null,R--)}function V(e,t){R++,L[R]=e.current,e.current=t}var H=z(null),U=z(null),W=z(null),G=z(null);function K(e,t){switch(V(W,t),V(U,e),V(H,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Vd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Vd(t),e=Hd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}B(H),V(H,e)}function ee(){B(H),B(U),B(W)}function te(e){e.memoizedState!==null&&V(G,e);var t=H.current,n=Hd(t,e.type);t!==n&&(V(U,e),V(H,n))}function ne(e){U.current===e&&(B(H),B(U)),G.current===e&&(B(G),Qf._currentValue=I)}var re,ie;function ae(e){if(re===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);re=t&&t[1]||``,ie=-1<e.stack.indexOf(`
|
|
3
3
|
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
4
4
|
`+re+e+ie}var oe=!1;function se(e,t){if(!e||oe)return``;oe=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,`props`,{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,`name`,{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
|
|
5
5
|
`),l=s.split(`
|
|
@@ -19,14 +19,14 @@ Error generating stack: `+e.message+`
|
|
|
19
19
|
`}function sv(e,t,n,r,i,a,o){if(typeof o==`function`&&(o={callback:o}),o?.callback){let{callback:s}=o;av(e,t,n,r,i,a,Object.assign(Object.assign({},o),{callback:e=>{s(e?ov(e,o.headerOptions):void 0)}}))}else{let s=av(e,t,n,r,i,a,o);return s?ov(s,o?.headerOptions):void 0}}function cv(e,t,n,r,i,a){return sv(e,e,t,n,r,i,a)}function lv(e){let t=e.endsWith(`
|
|
20
20
|
`),n=e.split(`
|
|
21
21
|
`).map(e=>e+`
|
|
22
|
-
`);return t?n.pop():n.push(n.pop().slice(0,-1)),n}function uv(e,t){return`${e}\u0000${t}`}function dv(e,t,n){let r=mi(e).body,i=mi(t).body;return r===i?``:cv(n,r,i,``,``,{context:3})}function fv(e,t,n){let r=(0,$.c)(8),{activeProvider:i}=mt(),a;r[0]===Symbol.for(`react.memo_cache_sentinel`)?(a={status:`idle`,diff:null},r[0]=a):a=r[0];let[o,s]=(0,Q.useState)(a),c=(0,Q.useRef)(i),l;r[1]===i?l=r[2]:(l=()=>{c.current=i},r[1]=i,r[2]=l),(0,Q.useEffect)(l);let u,d;return r[3]!==n||r[4]!==t||r[5]!==e?(u=()=>{if(!e){s({status:`idle`,diff:null});return}let r=e,i=!1;return s({status:`loading`,diff:null}),(async function(){try{let e=uv(t,r),a=n.get(e);if(a===void 0){let o=await fetch(`/api/history/${r}?docName=${encodeURIComponent(t)}`);if(i)return;if(!o.ok){s({status:`error`,diff:null});return}let c=await o.json();if(i)return;a=c.content??``,n.set(e,a)}if(i)return;let o=c.current?.document.getText(`source`).toString()??``,l=dv(a,o,t);if(i)return;s({status:`ready`,diff:l})}catch(e){i||(console.error(`[timeline-diff] failed to load entry diff`,{sha:r,docName:t,err:e}),s({status:`error`,diff:null}))}})(),()=>{i=!0}},d=[e,t,n],r[3]=n,r[4]=t,r[5]=e,r[6]=u,r[7]=d):(u=r[6],d=r[7]),(0,Q.useEffect)(u,d),o}var pv=(0,Q.lazy)(async()=>({default:(await n(()=>import(`./ActivityPanelDiffView-BPrpOwiv.js`),__vite__mapDeps([5,1,6,7,8]),import.meta.url)).ActivityPanelDiffView})),mv=1e4,hv=6e4;async function gv(e,t,n){try{let r=await fetch(`/api/history?docName=${encodeURIComponent(e)}&limit=100`,{signal:t});if(!r.ok)return n.setError(n.unavailableMessage),`error`;let i=await r.json();return n.setEntries((i.entries??[]).filter(e=>e.type!==`checkpoint`)),n.setError(null),`ok`}catch(e){if(e instanceof DOMException&&e.name===`AbortError`)throw e;return n.setError(n.unavailableMessage),console.error(`[timeline]`,e),`error`}finally{t.aborted||n.setLoading(!1)}}function _v(e){let t=new Date(e),n=new Date().getTime()-t.getTime(),r=Math.floor(n/1e3);if(r<60)return Wc._({id:`xOTzt5`});if(r<3600){let e=Math.floor(r/60);return Wc._({id:`UyROxs`,values:{mins:e}})}if(r<86400){let e=Math.floor(r/3600);return Wc._({id:`wXO4Tg`,values:{hrs:e}})}if(r<86400*2)return Wc._({id:`rQRrkB`});let i=Math.floor(r/86400);return i<7?Wc._({id:`6u9LvN`,values:{days:i}}):t.toLocaleDateString()}function vv(e){return new Date(e).toLocaleString(void 0,{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`})}function yv(e){return e.slice(0,7)}function bv(e){return e.type===`upstream`?Wc._({id:`K_vT1F`}):e.contributors.length===1?e.contributors[0].name:e.contributors.length>1?e.contributors.map(e=>e.name).join(`, `):e.author===`openknowledge-server`||e.author===`server`?Wc._({id:`B2DrPb`}):e.author}function xv(e){let t=(0,$.c)(17),n,r;if(t[0]===e?(n=t[1],r=t[2]):({icon:n,...r}=e,t[0]=e,t[1]=n,t[2]=r),n===`claude`){let e;return t[3]===r?e=t[4]:(e=(0,Z.jsx)(rs,{...r}),t[3]=r,t[4]=e),e}if(n===`cursor`){let e;return t[5]===r?e=t[6]:(e=(0,Z.jsx)(as,{...r}),t[5]=r,t[6]=e),e}if(n===`windsurf`){let e;return t[7]===r?e=t[8]:(e=(0,Z.jsx)(ss,{...r}),t[7]=r,t[8]=e),e}if(n===`openai`){let e;return t[9]===r?e=t[10]:(e=(0,Z.jsx)(is,{...r}),t[9]=r,t[10]=e),e}if(n===`cline`){let e;return t[11]===r?e=t[12]:(e=(0,Z.jsx)(ps,{...r}),t[11]=r,t[12]=e),e}if(n===`github`){let e;return t[13]===r?e=t[14]:(e=(0,Z.jsx)(ds,{...r}),t[13]=r,t[14]=e),e}let i=r,a;return t[15]===i?a=t[16]:(a=(0,Z.jsx)(ns,{strokeWidth:1.5,...i}),t[15]=i,t[16]=a),a}function Sv(e){let t=(0,$.c)(17),{entry:n,isDark:r}=e;if(n.type===`upstream`){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(Io,{className:`size-3.5 shrink-0 text-muted-foreground`}),t[0]=e):e=t[0],e}if(n.contributors.length>0){let e=n.contributors[0],i=e.colorSeed??e.name,a;t[1]===i?a=t[2]:(a=Un(i),t[1]=i,t[2]=a);let o=a,s=r?Gr[o]??ri[o]:ri[o],c;t[3]!==s||t[4]!==i?(c=s??_r(i),t[3]=s,t[4]=i,t[5]=c):c=t[5];let l=c;if(o!==`bot`){let e;t[6]===l?e=t[7]:(e={color:l},t[6]=l,t[7]=e);let n;return t[8]!==o||t[9]!==e?(n=(0,Z.jsx)(xv,{icon:o,width:14,height:14,className:`shrink-0`,style:e}),t[8]=o,t[9]=e,t[10]=n):n=t[10],n}if(e.name===`File System`){let e;return t[11]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(Bd,{className:`size-3.5 shrink-0 text-muted-foreground`}),t[11]=e):e=t[11],e}if(e.name===`OpenKnowledge (service)`||e.name===`Git (upstream)`){let e;return t[12]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(bi,{className:`size-3.5 shrink-0 text-muted-foreground`}),t[12]=e):e=t[12],e}let u;return t[13]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Z.jsx)(If,{className:`size-3.5 shrink-0 text-muted-foreground`}),t[13]=u):u=t[13],u}if(n.authorEmail.includes(`agent`)||n.author.includes(`agent`)||n.authorEmail.includes(`cursor`)||n.authorEmail.includes(`claude`)){let e;return t[14]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(ns,{className:`size-3.5 shrink-0 text-muted-foreground`}),t[14]=e):e=t[14],e}if(n.author===`openknowledge-server`||n.author===`server`){let e;return t[15]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(bi,{className:`size-3.5 shrink-0 text-muted-foreground`}),t[15]=e):e=t[15],e}let i;return t[16]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsx)(If,{className:`size-3.5 shrink-0 text-muted-foreground`}),t[16]=i):i=t[16],i}function Cv(e){let t=[];for(let n of e.contributors)if(n.summaries)for(let e of n.summaries)t.push(e);return t}function wv(e){let t=(0,$.c)(21),{summaries:n}=e,[r,i]=(0,Q.useState)(!1),a=(0,Q.useId)();if(n.length===0)return null;let o,s;t[0]===n?(o=t[1],s=t[2]):([o,...s]=n,t[0]=n,t[1]=o,t[2]=s);let c=s.length,l;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Z.jsx)(`span`,{"aria-hidden":`true`,children:`• `}),t[3]=l):l=t[3];let u;t[4]===o?u=t[5]:(u=(0,Z.jsxs)(`li`,{className:`text-xs text-foreground/90`,children:[l,o]}),t[4]=o,t[5]=u);let d;t[6]!==r||t[7]!==s?(d=r&&s.map(Ev),t[6]=r,t[7]=s,t[8]=d):d=t[8];let f;t[9]!==a||t[10]!==u||t[11]!==d?(f=(0,Z.jsxs)(`ul`,{id:a,className:`list-none`,children:[u,d]}),t[9]=a,t[10]=u,t[11]=d,t[12]=f):f=t[12];let p;t[13]!==r||t[14]!==c||t[15]!==a||t[16]!==s.length?(p=s.length>0&&(0,Z.jsxs)(`button`,{type:`button`,"aria-expanded":r,"aria-controls":a,className:`inline-flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors cursor-pointer`,onClick:e=>{e.stopPropagation(),i(Tv)},children:[r?(0,Z.jsx)(Wi,{className:`size-3`}):(0,Z.jsx)(Ki,{className:`size-3`}),r?(0,Z.jsx)(J,{id:`vLyv1R`}):(0,Z.jsx)(J,{id:`ZptNUh`,values:{hidden:c}})]}),t[13]=r,t[14]=c,t[15]=a,t[16]=s.length,t[17]=p):p=t[17];let m;return t[18]!==f||t[19]!==p?(m=(0,Z.jsxs)(`div`,{className:`mt-0.5`,children:[f,p]}),t[18]=f,t[19]=p,t[20]=m):m=t[20],m}function Tv(e){return!e}function Ev(e,t){return(0,Z.jsxs)(`li`,{className:`text-xs text-foreground/90`,children:[(0,Z.jsx)(`span`,{"aria-hidden":`true`,children:`• `}),e]},`${t}-${e}`)}function Dv(e){let t=(0,$.c)(13),{sha:n,docName:r,cache:i,diffLayout:a,panelId:o}=e,s=fv(n,r,i),c;t[0]===s.status?c=t[1]:(c=s.status===`loading`&&(0,Z.jsxs)(`div`,{className:`flex items-center gap-2 py-2 text-xs text-muted-foreground`,children:[(0,Z.jsx)($o,{className:`size-3 animate-spin`}),(0,Z.jsx)(J,{id:`38foVZ`})]}),t[0]=s.status,t[1]=c);let l;t[2]===s.status?l=t[3]:(l=s.status===`error`&&(0,Z.jsx)(`p`,{className:`py-2 text-xs text-destructive`,children:(0,Z.jsx)(J,{id:`vvWZnu`})}),t[2]=s.status,t[3]=l);let u;t[4]!==a||t[5]!==s.diff||t[6]!==s.status?(u=s.status===`ready`&&(0,Z.jsx)(Q.Suspense,{fallback:(0,Z.jsxs)(`div`,{className:`flex items-center gap-2 py-2 text-xs text-muted-foreground`,children:[(0,Z.jsx)($o,{className:`size-3 animate-spin`}),(0,Z.jsx)(J,{id:`EDm3wJ`})]}),children:(0,Z.jsx)(pv,{diff:s.diff,viewType:a})}),t[4]=a,t[5]=s.diff,t[6]=s.status,t[7]=u):u=t[7];let d;return t[8]!==o||t[9]!==c||t[10]!==l||t[11]!==u?(d=(0,Z.jsxs)(`div`,{id:o,className:`px-3 pb-2`,"data-testid":`timeline-entry-diff`,children:[c,l,u]}),t[8]=o,t[9]=c,t[10]=l,t[11]=u,t[12]=d):d=t[12],d}function Ov(e){let t=(0,$.c)(127),{entry:n,isDark:r,diffLayout:i,cache:a,docName:o,expanded:s,onToggleExpanded:c,onRestoreSuccess:l}=e,{_:u}=$t(),d;t[0]===n.timestamp?d=t[1]:(d=_v(n.timestamp),t[0]=n.timestamp,t[1]=d);let f=d,p;t[2]===n?p=t[3]:(p=bv(n),t[2]=n,t[3]=p);let m=p,h;t[4]===n.timestamp?h=t[5]:(h=vv(n.timestamp),t[4]=n.timestamp,t[5]=h);let g=h,_;t[6]===n.sha?_=t[7]:(_=yv(n.sha),t[6]=n.sha,t[7]=_);let v=_,y=n.contributors.flatMap(kv),b;t[8]===n?b=t[9]:(b=Cv(n),t[8]=n,t[9]=b);let x=b,[S,C]=(0,Q.useState)(!1),[w,T]=(0,Q.useState)(!1),E=(0,Q.useRef)(null),D=(0,Q.useId)(),O,k;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(O=()=>()=>E.current?.abort(),k=[],t[10]=O,t[11]=k):(O=t[10],k=t[11]),(0,Q.useEffect)(O,k);let A;t[12]!==n.sha||t[13]!==c?(A=()=>c(n.sha),t[12]=n.sha,t[13]=c,t[14]=A):A=t[14];let j=A,M;t[15]===C?M=t[16]:(M=function(){E.current?.abort(),E.current=null,T(!1),C(!1)},t[15]=C,t[16]=M);let N=M,P;t[17]!==u||t[18]!==o||t[19]!==n.sha||t[20]!==l||t[21]!==C?(P=async function(){T(!0);let e=new AbortController;E.current=e;let t=function(){e.signal.aborted||T(!1),E.current===e&&(E.current=null)},r;try{r=await fetch(`/api/rollback`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({docName:o,commitSha:n.sha}),signal:e.signal})}catch(r){let i=r;!e.signal.aborted&&!(i instanceof DOMException&&i.name===`AbortError`)&&(console.error(`[timeline] rollback fetch failed`,{docName:o,sha:n.sha,err:i}),hs.error(u({id:`NkXEFS`}),{duration:4e3})),t();return}if(e.signal.aborted){t();return}if(r.ok)C(!1),l();else{let e=`HTTP ${r.status}`;try{let t=ni.safeParse(await r.json());t.success&&(e=t.data.title)}catch{}console.error(`[timeline] rollback failed`,{docName:o,sha:n.sha,status:r.status,detail:e}),hs.error(u({id:`uM6jnS`}),{description:e,duration:6e3})}t()},t[17]=u,t[18]=o,t[19]=n.sha,t[20]=l,t[21]=C,t[22]=P):P=t[22];let F=P,I;t[23]!==n||t[24]!==r?(I=(0,Z.jsx)(Sv,{entry:n,isDark:r}),t[23]=n,t[24]=r,t[25]=I):I=t[25];let L=I,R=s?D:void 0,z=s?`bg-muted`:`hover:bg-muted/80`,B;t[26]===z?B=t[27]:(B=[`group flex w-full items-start gap-2.5 rounded-lg px-3 py-2.5 text-left transition-colors cursor-pointer outline-none focus-visible:ring-2 focus-visible:ring-ring`,z],t[26]=z,t[27]=B);let V=B.join(` `),H;t[28]===j?H=t[29]:(H=e=>{e.target===e.currentTarget&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),j())},t[28]=j,t[29]=H);let U;t[30]===L?U=t[31]:(U=(0,Z.jsx)(`span`,{className:`mt-0.5 shrink-0`,children:L}),t[30]=L,t[31]=U);let W;t[32]===m?W=t[33]:(W=(0,Z.jsx)(`span`,{className:`truncate text-xs text-foreground`,children:m}),t[32]=m,t[33]=W);let G;t[34]!==n.timestamp||t[35]!==f?(G=(0,Z.jsx)(`time`,{className:`ml-auto shrink-0 text-xs text-muted-foreground/80`,dateTime:n.timestamp,title:n.timestamp,children:f}),t[34]=n.timestamp,t[35]=f,t[36]=G):G=t[36];let K;t[37]===Symbol.for(`react.memo_cache_sentinel`)?(K=(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`h-3 w-px shrink-0 bg-border`}),t[37]=K):K=t[37];let ee;t[38]===u?ee=t[39]:(ee=u({id:`Yea-K5`}),t[38]=u,t[39]=ee);let te;t[40]===C?te=t[41]:(te=e=>{e.stopPropagation(),C(!0)},t[40]=C,t[41]=te);let ne;t[42]===w?ne=t[43]:(ne=w?(0,Z.jsx)($o,{className:`size-3 animate-spin`}):(0,Z.jsx)(cs,{className:`size-3`}),t[42]=w,t[43]=ne);let re;t[44]!==w||t[45]!==ee||t[46]!==te||t[47]!==ne?(re=(0,Z.jsx)(Ts,{asChild:!0,children:(0,Z.jsx)(X,{variant:`ghost`,size:`icon`,className:`size-5 shrink-0 text-muted-foreground hover:text-destructive`,"data-testid":`timeline-entry-restore`,"aria-label":ee,disabled:w,onClick:te,children:ne})}),t[44]=w,t[45]=ee,t[46]=te,t[47]=ne,t[48]=re):re=t[48];let ie;t[49]===u?ie=t[50]:(ie=u({id:`Yea-K5`}),t[49]=u,t[50]=ie);let ae;t[51]===ie?ae=t[52]:(ae=(0,Z.jsx)(Es,{side:`top`,children:ie}),t[51]=ie,t[52]=ae);let oe;t[53]!==re||t[54]!==ae?(oe=(0,Z.jsxs)(Os,{children:[re,ae]}),t[53]=re,t[54]=ae,t[55]=oe):oe=t[55];let se;t[56]!==W||t[57]!==G||t[58]!==oe?(se=(0,Z.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[W,G,K,oe]}),t[56]=W,t[57]=G,t[58]=oe,t[59]=se):se=t[59];let ce;t[60]===x?ce=t[61]:(ce=x.length>0&&(0,Z.jsx)(wv,{summaries:x}),t[60]=x,t[61]=ce);let le=y.length>0?(0,Z.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,title:y.join(`, `),children:y.join(`, `)}):(0,Z.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,title:n.message,children:n.message}),q;t[62]!==se||t[63]!==ce||t[64]!==le?(q=(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-0.5`,children:[se,ce,le]}),t[62]=se,t[63]=ce,t[64]=le,t[65]=q):q=t[65];let ue;t[66]!==s||t[67]!==j||t[68]!==R||t[69]!==V||t[70]!==H||t[71]!==U||t[72]!==q?(ue=(0,Z.jsxs)(`div`,{role:`button`,tabIndex:0,"aria-expanded":s,"aria-controls":R,"data-testid":`timeline-entry-expand`,className:V,onClick:j,onKeyDown:H,children:[U,q]}),t[66]=s,t[67]=j,t[68]=R,t[69]=V,t[70]=H,t[71]=U,t[72]=q,t[73]=ue):ue=t[73];let de;t[74]!==a||t[75]!==i||t[76]!==D||t[77]!==o||t[78]!==n.sha||t[79]!==s?(de=s&&(0,Z.jsx)(Dv,{sha:n.sha,docName:o,cache:a,diffLayout:i,panelId:D}),t[74]=a,t[75]=i,t[76]=D,t[77]=o,t[78]=n.sha,t[79]=s,t[80]=de):de=t[80];let fe;t[81]!==ue||t[82]!==de?(fe=(0,Z.jsxs)(`div`,{className:`flex flex-col rounded-lg`,children:[ue,de]}),t[81]=ue,t[82]=de,t[83]=fe):fe=t[83];let pe;t[84]!==N||t[85]!==C?(pe=e=>{e?C(!0):N()},t[84]=N,t[85]=C,t[86]=pe):pe=t[86];let me;t[87]===u?me=t[88]:(me=u({id:`Pyp1NA`}),t[87]=u,t[88]=me);let he;t[89]===me?he=t[90]:(he=(0,Z.jsx)(Ws,{children:me}),t[89]=me,t[90]=he);let ge;t[91]!==g||t[92]!==m||t[93]!==v||t[94]!==f?(ge={relative:f,absoluteTime:g,entrySha:v,authorName:m},t[91]=g,t[92]=m,t[93]=v,t[94]=f,t[95]=ge):ge=t[95];let _e;t[96]===Symbol.for(`react.memo_cache_sentinel`)?(_e={0:(0,Z.jsx)(`span`,{className:`font-medium text-foreground`}),1:(0,Z.jsx)(`span`,{className:`font-medium text-foreground`})},t[96]=_e):_e=t[96];let ve;t[97]===ge?ve=t[98]:(ve=(0,Z.jsx)(Us,{children:(0,Z.jsx)(J,{id:`h6EvY-`,values:ge,components:_e})}),t[97]=ge,t[98]=ve);let ye;t[99]!==he||t[100]!==ve?(ye=(0,Z.jsxs)(Js,{children:[he,ve]}),t[99]=he,t[100]=ve,t[101]=ye):ye=t[101];let be;t[102]===Symbol.for(`react.memo_cache_sentinel`)?(be=(0,Z.jsx)(J,{id:`dEgA5A`}),t[102]=be):be=t[102];let xe;t[103]===N?xe=t[104]:(xe=(0,Z.jsx)(X,{variant:`outline`,"data-testid":`timeline-entry-restore-cancel`,onClick:N,children:be}),t[103]=N,t[104]=xe);let Se;t[105]===F?Se=t[106]:(Se=()=>F(),t[105]=F,t[106]=Se);let Ce;t[107]===w?Ce=t[108]:(Ce=w?(0,Z.jsx)($o,{className:`mr-2 size-4 animate-spin`}):null,t[107]=w,t[108]=Ce);let we;t[109]===Symbol.for(`react.memo_cache_sentinel`)?(we=(0,Z.jsx)(J,{id:`yKu_3Y`}),t[109]=we):we=t[109];let Te;t[110]!==w||t[111]!==Se||t[112]!==Ce?(Te=(0,Z.jsxs)(X,{variant:`destructive`,"data-testid":`timeline-entry-restore-confirm`,disabled:w,onClick:Se,children:[Ce,we]}),t[110]=w,t[111]=Se,t[112]=Ce,t[113]=Te):Te=t[113];let Ee;t[114]!==xe||t[115]!==Te?(Ee=(0,Z.jsxs)(qs,{children:[xe,Te]}),t[114]=xe,t[115]=Te,t[116]=Ee):Ee=t[116];let De;t[117]!==ye||t[118]!==Ee?(De=(0,Z.jsxs)(Gs,{children:[ye,Ee]}),t[117]=ye,t[118]=Ee,t[119]=De):De=t[119];let Oe;t[120]!==S||t[121]!==pe||t[122]!==De?(Oe=(0,Z.jsx)(Ys,{open:S,onOpenChange:pe,children:De}),t[120]=S,t[121]=pe,t[122]=De,t[123]=Oe):Oe=t[123];let ke;return t[124]!==fe||t[125]!==Oe?(ke=(0,Z.jsxs)(Z.Fragment,{children:[fe,Oe]}),t[124]=fe,t[125]=Oe,t[126]=ke):ke=t[126],ke}function kv(e){return e.docs}function Av(e){let t=(0,$.c)(46),{docName:n,diffLayout:r,onDiffLayoutChange:i}=e,{_:a}=$t(),{resolvedTheme:o}=Mn(),s=o===`dark`,c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=[],t[0]=c):c=t[0];let[l,u]=(0,Q.useState)(c),[d,f]=(0,Q.useState)(!1),[p,m]=(0,Q.useState)(null),[h]=(0,Q.useState)(Pv),[g,_]=(0,Q.useState)(Nv),v;t[1]===h?v=t[2]:(v=()=>{_(new Set),h.clear()},t[1]=h,t[2]=v);let y;t[3]===n?y=t[4]:(y=[n],t[3]=n,t[4]=y),(0,Q.useEffect)(v,y);let b;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(b=function(e){_(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},t[5]=b):b=t[5];let x=b,S;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(S=function(){_(new Set)},t[6]=S):S=t[6];let C=S,w,T;t[7]!==a||t[8]!==n?(w=()=>{if(!n){u([]);return}f(!0);let e=I_({baseMs:mv,maxBackoffMs:hv,isPaused:Mv,poll:e=>gv(n,e,{setEntries:u,setError:m,setLoading:f,unavailableMessage:a({id:`brCtGB`})})});e.start();let t=()=>e.resume();return typeof document<`u`&&document.addEventListener(`visibilitychange`,t),()=>{e.stop(),typeof document<`u`&&document.removeEventListener(`visibilitychange`,t)}},T=[n,a],t[7]=a,t[8]=n,t[9]=w,t[10]=T):(w=t[9],T=t[10]),(0,Q.useEffect)(w,T);let E=!d&&!p&&l.length>0,D;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,Z.jsx)(Tn,{children:(0,Z.jsx)(J,{id:`cklVjM`})}),t[11]=D):D=t[11];let O;t[12]!==a||t[13]!==r||t[14]!==E||t[15]!==i?(O=E&&(0,Z.jsxs)(Os,{children:[(0,Z.jsx)(Ts,{asChild:!0,children:(0,Z.jsxs)(Lc,{type:`single`,value:r,onValueChange:e=>{e&&i(e)},"aria-label":a({id:`XvPJaT`}),variant:`segmented`,size:`sm`,spacing:1,className:`bg-muted dark:bg-background p-0.5 rounded-md shrink-0`,children:[(0,Z.jsx)(Fc,{value:`unified`,"aria-label":a({id:`379t2h`}),className:`size-6 px-0`,children:(0,Z.jsx)(hf,{className:`size-3.5`})}),(0,Z.jsx)(Fc,{value:`split`,"aria-label":a({id:`HXFyWD`}),className:`size-6 px-0`,children:(0,Z.jsx)(wd,{className:`size-3.5`})})]})}),(0,Z.jsx)(Es,{children:r===`unified`?(0,Z.jsx)(J,{id:`379t2h`}):(0,Z.jsx)(J,{id:`HXFyWD`})})]}),t[12]=a,t[13]=r,t[14]=E,t[15]=i,t[16]=O):O=t[16];let k;t[17]===O?k=t[18]:(k=(0,Z.jsxs)(Sn,{children:[D,O]}),t[17]=O,t[18]=k);let A;t[19]!==a||t[20]!==d?(A=d&&(0,Z.jsx)(`div`,{className:`flex flex-col gap-1 p-2`,role:`status`,"aria-busy":`true`,"aria-label":a({id:`o49mDZ`}),children:[1,2,3].map(jv)}),t[19]=a,t[20]=d,t[21]=A):A=t[21];let j;t[22]!==p||t[23]!==d?(j=!d&&p&&(0,Z.jsx)(`div`,{className:`px-4 py-3`,children:(0,Z.jsx)(`p`,{className:`text-xs text-destructive`,children:p})}),t[22]=p,t[23]=d,t[24]=j):j=t[24];let M;t[25]!==l||t[26]!==p||t[27]!==d?(M=!d&&!p&&l.length===0&&(0,Z.jsx)(`div`,{className:`px-4 py-8 text-center`,children:(0,Z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:(0,Z.jsx)(J,{id:`Ta25TG`})})}),t[25]=l,t[26]=p,t[27]=d,t[28]=M):M=t[28];let N;t[29]!==h||t[30]!==r||t[31]!==n||t[32]!==l||t[33]!==p||t[34]!==g||t[35]!==s||t[36]!==d?(N=!d&&!p&&l.length>0&&(0,Z.jsx)(`div`,{className:`flex flex-col gap-1 p-2`,children:l.map(e=>(0,Z.jsx)(Ov,{entry:e,isDark:s,diffLayout:r,cache:h,docName:n,expanded:g.has(e.sha),onToggleExpanded:x,onRestoreSuccess:C},e.sha))}),t[29]=h,t[30]=r,t[31]=n,t[32]=l,t[33]=p,t[34]=g,t[35]=s,t[36]=d,t[37]=N):N=t[37];let P;t[38]!==A||t[39]!==j||t[40]!==M||t[41]!==N?(P=(0,Z.jsxs)(`div`,{className:`flex-1 overflow-y-auto subtle-scrollbar scroll-fade-mask`,children:[A,j,M,N]}),t[38]=A,t[39]=j,t[40]=M,t[41]=N,t[42]=P):P=t[42];let F;return t[43]!==k||t[44]!==P?(F=(0,Z.jsxs)(`div`,{className:`flex h-full flex-col`,children:[k,P]}),t[43]=k,t[44]=P,t[45]=F):F=t[45],F}function jv(e){return(0,Z.jsxs)(`div`,{className:`flex items-start gap-2.5 rounded-lg px-3 py-2.5`,children:[(0,Z.jsx)(Ba,{className:`size-3.5 rounded mt-0.5 shrink-0`}),(0,Z.jsxs)(`div`,{className:`flex-1 space-y-1.5`,children:[(0,Z.jsx)(Ba,{className:`h-3 w-28`}),(0,Z.jsx)(Ba,{className:`h-3 w-40`})]})]},e)}function Mv(){return typeof document<`u`&&document.visibilityState===`hidden`}function Nv(){return new Set}function Pv(){return new ls(32)}var Fv=[{id:`outline`,icon:Yd},{id:`links`,icon:ge},{id:`graph`,icon:$d},{id:`timeline`,icon:Cd}];function Iv(e){return e===`outline`?Wc._({id:`dD7NPy`}):e===`links`?Wc._({id:`Rj01Fz`}):e===`graph`?Wc._({id:`x2fr_j`}):Wc._({id:`cklVjM`})}function Lv(){return n(()=>import(`./GraphPanel-Cf9lwwnw.js`),__vite__mapDeps([9,1,10,3,11,12,6,7,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38]),import.meta.url)}var Rv=(0,Q.lazy)(async()=>({default:(await Lv()).GraphPanel})),zv=(0,Q.lazy)(async()=>({default:(await n(()=>import(`./ActivityModeContent-DLFbXUxu.js`),__vite__mapDeps([39,1,2,40,41,42,11,43,44,45,46,47,48,49,50,15,16,13,7,17,18,10,3,51,52,36,12,6,4,53,54,55,20,56,57,58,59,31,32,33,34,60,61,62,63,35,64,65,66,67,68]),import.meta.url)).ActivityModeContent}));function Bv(e){let t=(0,$.c)(18),{docName:n,isSourceMode:r,activeTab:i,onActiveTabChange:a,mode:o}=e,{_:s}=$t(),[c,l]=(0,Q.useState)(`unified`),u=sg(),d,f,p;if(t[0]!==s||t[1]!==i||t[2]!==o||t[3]!==a||t[4]!==u){let e=u?Fv.filter(Hv):Fv;d=e.some(e=>e.id===i)?i:`outline`,f=o===`doc`&&e.length>1,p=f?(0,Z.jsx)(`div`,{className:`flex flex-row items-center justify-center gap-3 p-2`,children:(0,Z.jsx)(Lc,{type:`single`,variant:`outline`,value:d,onValueChange:e=>{e&&a(e)},"aria-label":s({id:`SrOuyg`}),children:e.map(Vv)})}):null,t[0]=s,t[1]=i,t[2]=o,t[3]=a,t[4]=u,t[5]=d,t[6]=f,t[7]=p}else d=t[5],f=t[6],p=t[7];let m;t[8]!==c||t[9]!==n||t[10]!==d||t[11]!==r||t[12]!==o||t[13]!==f?(m=o===`doc`?(0,Z.jsxs)(`div`,{...f?{role:`tabpanel`,id:`panel-${d}`,"aria-labelledby":`tab-${d}`}:{},className:`min-h-0 flex-1`,children:[d===`outline`&&(0,Z.jsx)(au,{docName:n,isSourceMode:r}),d===`links`&&(0,Z.jsx)(F_,{docName:n}),d===`graph`&&(0,Z.jsx)(Q.Suspense,{fallback:(0,Z.jsx)(`div`,{className:`flex h-full items-center justify-center text-sm text-muted-foreground`,children:(0,Z.jsx)(J,{id:`-lCAuQ`})}),children:(0,Z.jsx)(Rv,{activeDocName:n})}),d===`timeline`&&(0,Z.jsx)(Av,{docName:n,diffLayout:c,onDiffLayoutChange:l})]}):(0,Z.jsx)(`div`,{className:`min-h-0 flex-1`,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)(zv,{})})}),t[8]=c,t[9]=n,t[10]=d,t[11]=r,t[12]=o,t[13]=f,t[14]=m):m=t[14];let h;return t[15]!==p||t[16]!==m?(h=(0,Z.jsxs)(Z.Fragment,{children:[p,m]}),t[15]=p,t[16]=m,t[17]=h):h=t[17],h}function Vv(e){let{id:t,icon:n}=e,r=Iv(t);return(0,Z.jsxs)(Os,{children:[(0,Z.jsx)(Fc,{value:t,role:`tab`,id:`tab-${t}`,"aria-controls":`panel-${t}`,"aria-label":r,asChild:!0,children:(0,Z.jsx)(Ts,{children:(0,Z.jsx)(n,{})})}),(0,Z.jsx)(Es,{side:`bottom`,children:r})]},t)}function Hv(e){return e.id===`outline`}function Uv(e,t){let n=getComputedStyle(e);return t*parseFloat(n.fontSize)}function Wv(e,t){let n=getComputedStyle(e.ownerDocument.body);return t*parseFloat(n.fontSize)}function Gv(e){return e/100*window.innerHeight}function Kv(e){return e/100*window.innerWidth}function qv(e){switch(typeof e){case`number`:return[e,`px`];case`string`:{let t=parseFloat(e);return e.endsWith(`%`)?[t,`%`]:e.endsWith(`px`)?[t,`px`]:e.endsWith(`rem`)?[t,`rem`]:e.endsWith(`em`)?[t,`em`]:e.endsWith(`vh`)?[t,`vh`]:e.endsWith(`vw`)?[t,`vw`]:[t,`%`]}}}function Jv({groupSize:e,panelElement:t,styleProp:n}){let r,[i,a]=qv(n);switch(a){case`%`:r=i/100*e;break;case`px`:r=i;break;case`rem`:r=Wv(t,i);break;case`em`:r=Uv(t,i);break;case`vh`:r=Gv(i);break;case`vw`:r=Kv(i);break}return r}function Yv(e){return parseFloat(e.toFixed(3))}function Xv({group:e}){let{orientation:t,panels:n}=e;return n.reduce((e,n)=>(e+=t===`horizontal`?n.element.offsetWidth:n.element.offsetHeight,e),0)}function Zv(e){let{panels:t}=e,n=Xv({group:e});return n===0?t.map(e=>({groupResizeBehavior:e.panelConstraints.groupResizeBehavior,collapsedSize:0,collapsible:e.panelConstraints.collapsible===!0,defaultSize:void 0,disabled:e.panelConstraints.disabled,minSize:0,maxSize:100,panelId:e.id})):t.map(e=>{let{element:t,panelConstraints:r}=e,i=0;r.collapsedSize!==void 0&&(i=Yv(Jv({groupSize:n,panelElement:t,styleProp:r.collapsedSize})/n*100));let a;r.defaultSize!==void 0&&(a=Yv(Jv({groupSize:n,panelElement:t,styleProp:r.defaultSize})/n*100));let o=0;r.minSize!==void 0&&(o=Yv(Jv({groupSize:n,panelElement:t,styleProp:r.minSize})/n*100));let s=100;return r.maxSize!==void 0&&(s=Yv(Jv({groupSize:n,panelElement:t,styleProp:r.maxSize})/n*100)),{groupResizeBehavior:r.groupResizeBehavior,collapsedSize:i,collapsible:r.collapsible===!0,defaultSize:a,disabled:r.disabled,minSize:o,maxSize:s,panelId:e.id}})}function Qv(e,t=`Assertion error`){if(!e)throw Error(t)}function $v(e,t){return Array.from(t).sort(e===`horizontal`?ey:ty)}function ey(e,t){let n=e.element.offsetLeft-t.element.offsetLeft;return n===0?e.element.offsetWidth-t.element.offsetWidth:n}function ty(e,t){let n=e.element.offsetTop-t.element.offsetTop;return n===0?e.element.offsetHeight-t.element.offsetHeight:n}function ny(e){return typeof e==`object`&&!!e&&`nodeType`in e&&e.nodeType===Node.ELEMENT_NODE}function ry(e,t){return{x:e.x>=t.left&&e.x<=t.right?0:Math.min(Math.abs(e.x-t.left),Math.abs(e.x-t.right)),y:e.y>=t.top&&e.y<=t.bottom?0:Math.min(Math.abs(e.y-t.top),Math.abs(e.y-t.bottom))}}function iy({orientation:e,rects:t,targetRect:n}){let r={x:n.x+n.width/2,y:n.y+n.height/2},i,a=Number.MAX_VALUE;for(let n of t){let{x:t,y:o}=ry(r,n),s=e===`horizontal`?t:o;s<a&&(a=s,i=n)}return Qv(i,`No rect found`),i}var ay;function oy(){return ay===void 0&&(ay=typeof matchMedia==`function`?!!matchMedia(`(pointer:coarse)`).matches:!1),ay}function sy(e){let{element:t,orientation:n,panels:r,separators:i}=e,a=$v(n,Array.from(t.children).filter(ny).map(e=>({element:e}))).map(({element:e})=>e),o=[],s=!1,c=!1,l=-1,u=-1,d=0,f,p=[];{let e=-1;for(let t of a)t.hasAttribute(`data-panel`)&&(e++,t.hasAttribute(`data-disabled`)||(d++,l===-1&&(l=e),u=e))}if(d>1){let t=-1;for(let d of a)if(d.hasAttribute(`data-panel`)){t++;let i=r.find(e=>e.element===d);if(i){if(f){let r=f.element.getBoundingClientRect(),a=d.getBoundingClientRect(),m;if(c){let e=n===`horizontal`?new DOMRect(r.right,r.top,0,r.height):new DOMRect(r.left,r.bottom,r.width,0),t=n===`horizontal`?new DOMRect(a.left,a.top,0,a.height):new DOMRect(a.left,a.top,a.width,0);switch(p.length){case 0:m=[e,t];break;case 1:{let i=p[0];m=[i,iy({orientation:n,rects:[r,a],targetRect:i.element.getBoundingClientRect()})===r?t:e];break}default:m=p;break}}else m=p.length?p:[n===`horizontal`?new DOMRect(r.right,a.top,a.left-r.right,a.height):new DOMRect(a.left,r.bottom,a.width,a.top-r.bottom)];for(let n of m){let r=`width`in n?n:n.element.getBoundingClientRect(),a=oy()?e.resizeTargetMinimumSize.coarse:e.resizeTargetMinimumSize.fine;if(r.width<a){let e=a-r.width;r=new DOMRect(r.x-e/2,r.y,r.width+e,r.height)}if(r.height<a){let e=a-r.height;r=new DOMRect(r.x,r.y-e/2,r.width,r.height+e)}!s&&!(t<=l||t>u)&&o.push({group:e,groupSize:Xv({group:e}),panels:[f,i],separator:`width`in n?void 0:n,rect:r}),s=!1}}c=!1,f=i,p=[]}}else if(d.hasAttribute(`data-separator`)){d.ariaDisabled!==null&&(s=!0);let e=i.find(e=>e.element===d);e?p.push(e):(f=void 0,p=[])}else c=!0}return o}var cy=class{#e={};addListener(e,t){let n=this.#e[e];return n===void 0?this.#e[e]=[t]:n.includes(t)||n.push(t),()=>{this.removeListener(e,t)}}emit(e,t){let n=this.#e[e];if(n!==void 0)if(n.length===1)n[0].call(null,t);else{let e=!1,r=null,i=Array.from(n);for(let n=0;n<i.length;n++){let a=i[n];try{a.call(null,t)}catch(t){r===null&&(e=!0,r=t)}}if(e)throw r}}removeAllListeners(){this.#e={}}removeListener(e,t){let n=this.#e[e];if(n!==void 0){let e=n.indexOf(t);e>=0&&n.splice(e,1)}}},ly=new Map,uy=new cy;function dy(e){ly=new Map(ly),ly.delete(e)}function fy(e,t){for(let[t]of ly)if(t.id===e)return t}function py(e,t){for(let[t,n]of ly)if(t.id===e)return n;if(t)throw Error(`Could not find data for Group with id ${e}`)}function my(){return ly}function hy(e,t){return uy.addListener(`groupChange`,n=>{n.group.id===e&&t(n)})}function gy(e,t){let n=ly.get(e);ly=new Map(ly),ly.set(e,t),uy.emit(`groupChange`,{group:e,prev:n,next:t})}function _y(e,t,n){let r,i={x:1/0,y:1/0};for(let a of t){let t=ry(n,a.rect);switch(e){case`horizontal`:t.x<=i.x&&(r=a,i=t);break;case`vertical`:t.y<=i.y&&(r=a,i=t);break}}return r?{distance:i,hitRegion:r}:void 0}function vy(e){return typeof e==`object`&&!!e&&`nodeType`in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function yy(e,t){if(e===t)throw Error(`Cannot compare node with itself`);let n={a:Ty(e),b:Ty(t)},r;for(;n.a.at(-1)===n.b.at(-1);)r=n.a.pop(),n.b.pop();Qv(r,`Stacking order can only be calculated for elements with a common ancestor`);let i={a:wy(Cy(n.a)),b:wy(Cy(n.b))};if(i.a===i.b){let e=r.childNodes,t={a:n.a.at(-1),b:n.b.at(-1)},i=e.length;for(;i--;){let n=e[i];if(n===t.a)return 1;if(n===t.b)return-1}}return Math.sign(i.a-i.b)}var by=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function xy(e){let t=getComputedStyle(Ey(e)??e).display;return t===`flex`||t===`inline-flex`}function Sy(e){let t=getComputedStyle(e);return!!(t.position===`fixed`||t.zIndex!==`auto`&&(t.position!==`static`||xy(e))||+t.opacity<1||`transform`in t&&t.transform!==`none`||`webkitTransform`in t&&t.webkitTransform!==`none`||`mixBlendMode`in t&&t.mixBlendMode!==`normal`||`filter`in t&&t.filter!==`none`||`webkitFilter`in t&&t.webkitFilter!==`none`||`isolation`in t&&t.isolation===`isolate`||by.test(t.willChange)||t.webkitOverflowScrolling===`touch`)}function Cy(e){let t=e.length;for(;t--;){let n=e[t];if(Qv(n,`Missing node`),Sy(n))return n}return null}function wy(e){return e&&Number(getComputedStyle(e).zIndex)||0}function Ty(e){let t=[];for(;e;)t.push(e),e=Ey(e);return t}function Ey(e){let{parentNode:t}=e;return vy(t)?t.host:t}function Dy(e,t){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function Oy({groupElement:e,hitRegion:t,pointerEventTarget:n}){if(!ny(n)||n.contains(e)||e.contains(n))return!0;if(yy(n,e)>0){let r=n;for(;r;){if(r.contains(e))return!0;if(Dy(r.getBoundingClientRect(),t))return!1;r=r.parentElement}}return!0}function ky(e,t){let n=[];return t.forEach((t,r)=>{if(r.disabled)return;let i=sy(r),a=_y(r.orientation,i,{x:e.clientX,y:e.clientY});a&&a.distance.x<=0&&a.distance.y<=0&&Oy({groupElement:r.element,hitRegion:a.hitRegion.rect,pointerEventTarget:e.target})&&n.push(a.hitRegion)}),n}function Ay(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function jy(e,t,n=0){return Math.abs(Yv(e)-Yv(t))<=n}function My(e,t){return jy(e,t)?0:e>t?1:-1}function Ny({overrideDisabledPanels:e,panelConstraints:t,prevSize:n,size:r}){let{collapsedSize:i=0,collapsible:a,disabled:o,maxSize:s=100,minSize:c=0}=t;if(o&&!e)return n;if(My(r,c)<0)if(a){let e=(i+c)/2;r=My(r,e)<0?i:c}else r=c;return r=Math.min(s,r),r=Yv(r),r}function Py({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:r,prevLayout:i,trigger:a}){if(jy(e,0))return t;let o=a===`imperative-api`,s=Object.values(t),c=Object.values(i),l=[...s],[u,d]=r;Qv(u!=null,`Invalid first pivot index`),Qv(d!=null,`Invalid second pivot index`);let f=0;switch(a){case`keyboard`:{let t=e<0?d:u,r=n[t];Qv(r,`Panel constraints not found for index ${t}`);let{collapsedSize:i=0,collapsible:a,minSize:o=0}=r;if(a){let n=s[t];if(Qv(n!=null,`Previous layout not found for panel index ${t}`),jy(n,i)){let t=o-n;My(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}{let t=e<0?u:d,r=n[t];Qv(r,`No panel constraints found for index ${t}`);let{collapsedSize:i=0,collapsible:a,minSize:o=0}=r;if(a){let n=s[t];if(Qv(n!=null,`Previous layout not found for panel index ${t}`),jy(n,o)){let t=n-i;My(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}break;default:{let t=e<0?d:u,r=n[t];Qv(r,`Panel constraints not found for index ${t}`);let i=s[t],{collapsible:a,collapsedSize:o,minSize:c}=r;if(a&&My(i,c)<0)if(e>0){let t=c-o,n=t/2;My(i+e,c)<0&&(e=My(e,n)<=0?0:t)}else{let t=c-o,n=100-t/2;My(i-e,c)<0&&(e=My(100+e,n)>0?0:-t)}break}}{let t=e<0?1:-1,r=e<0?d:u,i=0;for(;;){let e=s[r];Qv(e!=null,`Previous layout not found for panel index ${r}`);let a=Ny({overrideDisabledPanels:o,panelConstraints:n[r],prevSize:e,size:100})-e;if(i+=a,r+=t,r<0||r>=n.length)break}let a=Math.min(Math.abs(e),Math.abs(i));e=e<0?0-a:a}{let t=e<0?u:d;for(;t>=0&&t<n.length;){let r=Math.abs(e)-Math.abs(f),i=s[t];Qv(i!=null,`Previous layout not found for panel index ${t}`);let a=i-r,c=Ny({overrideDisabledPanels:o,panelConstraints:n[t],prevSize:i,size:a});if(!jy(i,c)&&(f+=i-c,l[t]=c,f.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?t--:t++}}if(Ay(c,l))return i;{let t=e<0?d:u,r=s[t];Qv(r!=null,`Previous layout not found for panel index ${t}`);let i=r+f,a=Ny({overrideDisabledPanels:o,panelConstraints:n[t],prevSize:r,size:i});if(l[t]=a,!jy(a,i)){let t=i-a,r=e<0?d:u;for(;r>=0&&r<n.length;){let i=l[r];Qv(i!=null,`Previous layout not found for panel index ${r}`);let a=i+t,s=Ny({overrideDisabledPanels:o,panelConstraints:n[r],prevSize:i,size:a});if(jy(i,s)||(t-=s-i,l[r]=s),jy(t,0))break;e>0?r--:r++}}}if(!jy(Object.values(l).reduce((e,t)=>t+e,0),100,.1))return i;let p=Object.keys(i);return l.reduce((e,t,n)=>(e[p[n]]=t,e),{})}function Fy(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(t[n]===void 0||My(e[n],t[n])!==0)return!1;return!0}function Iy({layout:e,panelConstraints:t}){let n=Object.values(e),r=[...n],i=r.reduce((e,t)=>e+t,0);if(r.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${r.map(e=>`${e}%`).join(`, `)}`);if(!jy(i,100)&&r.length>0)for(let e=0;e<t.length;e++){let t=r[e];Qv(t!=null,`No layout data found for index ${e}`),r[e]=100/i*t}let a=0;for(let e=0;e<t.length;e++){let i=n[e];Qv(i!=null,`No layout data found for index ${e}`);let o=r[e];Qv(o!=null,`No layout data found for index ${e}`);let s=Ny({overrideDisabledPanels:!0,panelConstraints:t[e],prevSize:i,size:o});o!=s&&(a+=o-s,r[e]=s)}if(!jy(a,0))for(let e=0;e<t.length;e++){let n=r[e];Qv(n!=null,`No layout data found for index ${e}`);let i=n+a,o=Ny({overrideDisabledPanels:!0,panelConstraints:t[e],prevSize:n,size:i});if(n!==o&&(a-=o-n,r[e]=o,jy(a,0)))break}let o=Object.keys(e);return r.reduce((e,t,n)=>(e[o[n]]=t,e),{})}function Ly({groupId:e,panelId:t}){let n=()=>{let t=my();for(let[n,{defaultLayoutDeferred:r,derivedPanelConstraints:i,layout:a,groupSize:o,separatorToPanels:s}]of t)if(n.id===e)return{defaultLayoutDeferred:r,derivedPanelConstraints:i,group:n,groupSize:o,layout:a,separatorToPanels:s};throw Error(`Group ${e} not found`)},r=()=>{let e=n().derivedPanelConstraints.find(e=>e.panelId===t);if(e!==void 0)return e;throw Error(`Panel constraints not found for Panel ${t}`)},i=()=>{let e=n().group.panels.find(e=>e.id===t);if(e!==void 0)return e;throw Error(`Layout not found for Panel ${t}`)},a=()=>{let e=n().layout[t];if(e!==void 0)return e;throw Error(`Layout not found for Panel ${t}`)},o=e=>{let r=a();if(e===r)return;let{defaultLayoutDeferred:i,derivedPanelConstraints:o,group:s,groupSize:c,layout:l,separatorToPanels:u}=n(),d=s.panels.findIndex(e=>e.id===t),f=d===s.panels.length-1,p=Iy({layout:Py({delta:f?r-e:e-r,initialLayout:l,panelConstraints:o,pivotIndices:f?[d-1,d]:[d,d+1],prevLayout:l,trigger:`imperative-api`}),panelConstraints:o});Fy(l,p)||gy(s,{defaultLayoutDeferred:i,derivedPanelConstraints:o,groupSize:c,layout:p,separatorToPanels:u})};return{collapse:()=>{let{collapsible:e,collapsedSize:t}=r(),{mutableValues:n}=i(),s=a();e&&s!==t&&(n.expandToSize=s,o(t))},expand:()=>{let{collapsible:e,collapsedSize:t,minSize:n}=r(),{mutableValues:s}=i(),c=a();if(e&&c===t){let e=s.expandToSize??n;e===0&&(e=1),o(e)}},getSize:()=>{let{group:e}=n(),t=a(),{element:r}=i();return{asPercentage:t,inPixels:e.orientation===`horizontal`?r.offsetWidth:r.offsetHeight}},isCollapsed:()=>{let{collapsible:e,collapsedSize:t}=r(),n=a();return e&&jy(t,n)},resize:e=>{let{group:t}=n(),{element:r}=i(),a=Xv({group:t});o(Yv(Jv({groupSize:a,panelElement:r,styleProp:e})/a*100))}}}function Ry(e){e.defaultPrevented||ky(e,my()).forEach(t=>{if(t.separator&&!t.separator.disableDoubleClick){let n=t.panels.find(e=>e.panelConstraints.defaultSize!==void 0);if(n){let r=n.panelConstraints.defaultSize,i=Ly({groupId:t.group.id,panelId:n.id});i&&r!==void 0&&(i.resize(r),e.preventDefault())}}})}function zy(e){let t=my();for(let[n]of t)if(n.separators.some(t=>t.element===e))return n;throw Error(`Could not find parent Group for separator element`)}function By({groupId:e}){let t=()=>{let t=my();for(let[n,r]of t)if(n.id===e)return{group:n,...r};throw Error(`Could not find Group with id "${e}"`)};return{getLayout(){let{defaultLayoutDeferred:e,layout:n}=t();return e?{}:n},setLayout(e){let{defaultLayoutDeferred:n,derivedPanelConstraints:r,group:i,groupSize:a,layout:o,separatorToPanels:s}=t(),c=Iy({layout:e,panelConstraints:r});return n?o:(Fy(o,c)||gy(i,{defaultLayoutDeferred:n,derivedPanelConstraints:r,groupSize:a,layout:c,separatorToPanels:s}),c)}}}function Vy(e,t){let n=zy(e),r=py(n.id,!0),i=n.separators.find(t=>t.element===e);Qv(i,`Matching separator not found`);let a=r.separatorToPanels.get(i);Qv(a,`Matching panels not found`);let o=a.map(e=>n.panels.indexOf(e)),s=By({groupId:n.id}).getLayout(),c=Iy({layout:Py({delta:t,initialLayout:s,panelConstraints:r.derivedPanelConstraints,pivotIndices:o,prevLayout:s,trigger:`keyboard`}),panelConstraints:r.derivedPanelConstraints});Fy(s,c)||gy(n,{defaultLayoutDeferred:r.defaultLayoutDeferred,derivedPanelConstraints:r.derivedPanelConstraints,groupSize:r.groupSize,layout:c,separatorToPanels:r.separatorToPanels})}function Hy(e){if(e.defaultPrevented)return;let t=e.currentTarget,n=zy(t);if(!n.disabled)switch(e.key){case`ArrowDown`:e.preventDefault(),n.orientation===`vertical`&&Vy(t,5);break;case`ArrowLeft`:e.preventDefault(),n.orientation===`horizontal`&&Vy(t,-5);break;case`ArrowRight`:e.preventDefault(),n.orientation===`horizontal`&&Vy(t,5);break;case`ArrowUp`:e.preventDefault(),n.orientation===`vertical`&&Vy(t,-5);break;case`End`:e.preventDefault(),Vy(t,100);break;case`Enter`:{e.preventDefault();let n=zy(t),{derivedPanelConstraints:r,layout:i,separatorToPanels:a}=py(n.id,!0),o=n.separators.find(e=>e.element===t);Qv(o,`Matching separator not found`);let s=a.get(o);Qv(s,`Matching panels not found`);let c=s[0],l=r.find(e=>e.panelId===c.id);if(Qv(l,`Panel metadata not found`),l.collapsible){let e=i[c.id];Vy(t,(l.collapsedSize===e?n.mutableState.expandedPanelSizes[c.id]??l.minSize:l.collapsedSize)-e)}break}case`F6`:{e.preventDefault();let n=zy(t).separators.map(e=>e.element),r=Array.from(n).findIndex(t=>t===e.currentTarget);Qv(r!==null,`Index not found`),n[e.shiftKey?r>0?r-1:n.length-1:r+1<n.length?r+1:0].focus({preventScroll:!0});break}case`Home`:e.preventDefault(),Vy(t,-100);break}}var Uy={cursorFlags:0,state:`inactive`},Wy=new cy;function Gy(){return Uy}function Ky(e){return Wy.addListener(`change`,e)}function qy(e){let t=Uy,n={...Uy};n.cursorFlags=e,Uy=n,Wy.emit(`change`,{prev:t,next:n})}function Jy(e){let t=Uy;Uy=e,Wy.emit(`change`,{prev:t,next:e})}function Yy(e){if(e.defaultPrevented||e.pointerType===`mouse`&&e.button>0)return;let t=my(),n=ky(e,t),r=new Map,i=!1;n.forEach(e=>{e.separator&&(i||(i=!0,e.separator.element.focus({preventScroll:!0})));let n=t.get(e.group);n&&r.set(e.group,n.layout)}),Jy({cursorFlags:0,hitRegions:n,initialLayoutMap:r,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:`active`}),n.length&&e.preventDefault()}var Xy=e=>e,Zy=()=>{},Qy=1,$y=2,eb=4,tb=8,nb=3,rb=12,ib;function ab(){return ib===void 0&&(ib=!1,typeof window<`u`&&(window.navigator.userAgent.includes(`Chrome`)||window.navigator.userAgent.includes(`Firefox`))&&(ib=!0)),ib}function ob({cursorFlags:e,groups:t,state:n}){let r=0,i=0;switch(n){case`active`:case`hover`:t.forEach(e=>{if(!e.mutableState.disableCursor)switch(e.orientation){case`horizontal`:r++;break;case`vertical`:i++;break}})}if(!(r===0&&i===0)){switch(n){case`active`:if(e&&ab()){let t=(e&Qy)!==0,n=(e&$y)!==0,r=(e&eb)!==0,i=(e&tb)!==0;if(t)return r?`se-resize`:i?`ne-resize`:`e-resize`;if(n)return r?`sw-resize`:i?`nw-resize`:`w-resize`;if(r)return`s-resize`;if(i)return`n-resize`}break}return ab()?r>0&&i>0?`move`:r>0?`ew-resize`:`ns-resize`:r>0&&i>0?`grab`:r>0?`col-resize`:`row-resize`}}var sb=new WeakMap;function cb(e){if(e.defaultView===null||e.defaultView===void 0)return;let{prevStyle:t,styleSheet:n}=sb.get(e)??{};n===void 0&&(n=new e.defaultView.CSSStyleSheet,e.adoptedStyleSheets&&e.adoptedStyleSheets.push(n));let r=Gy();switch(r.state){case`active`:case`hover`:{let e=ob({cursorFlags:r.cursorFlags,groups:r.hitRegions.map(e=>e.group),state:r.state}),i=`*, *:hover {cursor: ${e} !important; }`;if(t===i)return;t=i,e?n.cssRules.length===0?n.insertRule(i):n.replaceSync(i):n.cssRules.length===1&&n.deleteRule(0);break}case`inactive`:t=void 0,n.cssRules.length===1&&n.deleteRule(0);break}sb.set(e,{prevStyle:t,styleSheet:n})}function lb({document:e,event:t,hitRegions:n,initialLayoutMap:r,mountedGroups:i,pointerDownAtPoint:a,prevCursorFlags:o}){let s=0;n.forEach(e=>{let{group:n,groupSize:o}=e,{orientation:c,panels:l}=n,{disableCursor:u}=n.mutableState,d=0;d=a?c===`horizontal`?(t.clientX-a.x)/o*100:(t.clientY-a.y)/o*100:c===`horizontal`?t.clientX<0?-100:100:t.clientY<0?-100:100;let f=r.get(n),p=i.get(n);if(!f||!p)return;let{defaultLayoutDeferred:m,derivedPanelConstraints:h,groupSize:g,layout:_,separatorToPanels:v}=p;if(h&&_&&v){let t=Py({delta:d,initialLayout:f,panelConstraints:h,pivotIndices:e.panels.map(e=>l.indexOf(e)),prevLayout:_,trigger:`mouse-or-touch`});if(Fy(t,_)){if(d!==0&&!u)switch(c){case`horizontal`:s|=d<0?Qy:$y;break;case`vertical`:s|=d<0?eb:tb;break}}else gy(e.group,{defaultLayoutDeferred:m,derivedPanelConstraints:h,groupSize:g,layout:t,separatorToPanels:v})}});let c=0;t.movementX===0?c|=o&nb:c|=s&nb,t.movementY===0?c|=o&rb:c|=s&rb,qy(c),cb(e)}function ub(e){let t=my(),n=Gy();switch(n.state){case`active`:lb({document:e.currentTarget,event:e,hitRegions:n.hitRegions,initialLayoutMap:n.initialLayoutMap,mountedGroups:t,prevCursorFlags:n.cursorFlags})}}function db(e){if(e.defaultPrevented)return;let t=Gy(),n=my();switch(t.state){case`active`:if(e.buttons===0){Jy({cursorFlags:0,state:`inactive`}),t.hitRegions.forEach(e=>{let t=py(e.group.id,!0);gy(e.group,t)});return}for(let n of t.hitRegions)if(n.separator){let{element:t}=n.separator;t.hasPointerCapture?.(e.pointerId)||t.setPointerCapture?.(e.pointerId)}lb({document:e.currentTarget,event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:n,pointerDownAtPoint:t.pointerDownAtPoint,prevCursorFlags:t.cursorFlags});break;default:{let r=ky(e,n);r.length===0?t.state!==`inactive`&&Jy({cursorFlags:0,state:`inactive`}):Jy({cursorFlags:0,hitRegions:r,state:`hover`}),cb(e.currentTarget);break}}}function fb(e){if(e.relatedTarget instanceof HTMLIFrameElement)switch(Gy().state){case`hover`:Jy({cursorFlags:0,state:`inactive`})}}function pb(e){if(e.defaultPrevented||e.pointerType===`mouse`&&e.button>0)return;let t=Gy();switch(t.state){case`active`:Jy({cursorFlags:0,state:`inactive`}),t.hitRegions.length>0&&(cb(e.currentTarget),t.hitRegions.forEach(e=>{let t=py(e.group.id,!0);gy(e.group,t)}),e.preventDefault())}}function mb(e){let t=0,n=0,r={};for(let i of e)if(i.defaultSize!==void 0){t++;let e=Yv(i.defaultSize);n+=e,r[i.panelId]=e}else r[i.panelId]=void 0;let i=e.length-t;if(i!==0){let t=Yv((100-n)/i);for(let n of e)n.defaultSize===void 0&&(r[n.panelId]=t)}return r}function hb(e,t,n){if(!n[0])return;let r=e.panels.find(e=>e.element===t);if(!r||!r.onResize)return;let i=Xv({group:e}),a=e.orientation===`horizontal`?r.element.offsetWidth:r.element.offsetHeight,o=r.mutableValues.prevSize,s={asPercentage:Yv(a/i*100),inPixels:a};r.mutableValues.prevSize=s,r.onResize(s,r.id,o)}function gb(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function _b({group:e,nextGroupSize:t,prevGroupSize:n,prevLayout:r}){if(n<=0||t<=0||n===t)return r;let i=0,a=0,o=!1,s=new Map,c=[];for(let l of e.panels){let e=r[l.id]??0;switch(l.panelConstraints.groupResizeBehavior){case`preserve-pixel-size`:{o=!0;let r=Yv(e/100*n/t*100);s.set(l.id,r),i+=r;break}default:c.push(l.id),a+=e;break}}if(!o||c.length===0)return r;let l=100-i,u={...r};if(s.forEach((e,t)=>{u[t]=e}),a>0)for(let e of c)u[e]=Yv((r[e]??0)/a*l);else{let e=Yv(l/c.length);for(let t of c)u[t]=e}return u}function vb(e,t){let n=e.map(e=>e.id),r=Object.keys(t);if(n.length!==r.length)return!1;for(let e of n)if(!r.includes(e))return!1;return!0}var yb=new Map;function bb(e){let t=!0;Qv(e.element.ownerDocument.defaultView,`Cannot register an unmounted Group`);let n=e.element.ownerDocument.defaultView.ResizeObserver,r=new Set,i=new Set,a=new n(n=>{for(let r of n){let{borderBoxSize:n,target:i}=r;if(i===e.element){if(t){let t=Xv({group:e});if(t===0)return;let n=py(e.id);if(!n)return;let r=Zv(e),i=n.defaultLayoutDeferred?mb(r):n.layout,a=Iy({layout:_b({group:e,nextGroupSize:t,prevGroupSize:n.groupSize,prevLayout:i}),panelConstraints:r});if(!n.defaultLayoutDeferred&&Fy(n.layout,a)&&gb(n.derivedPanelConstraints,r)&&n.groupSize===t)return;gy(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:r,groupSize:t,layout:a,separatorToPanels:n.separatorToPanels})}}else hb(e,i,n)}});a.observe(e.element),e.panels.forEach(e=>{Qv(!r.has(e.id),`Panel ids must be unique; id "${e.id}" was used more than once`),r.add(e.id),e.onResize&&a.observe(e.element)});let o=Xv({group:e}),s=Zv(e),c=e.panels.map(({id:e})=>e).join(`,`),l=e.mutableState.defaultLayout;l&&(vb(e.panels,l)||(l=void 0));let u=Iy({layout:e.mutableState.layouts[c]??l??mb(s),panelConstraints:s}),d=e.element.ownerDocument;yb.set(d,(yb.get(d)??0)+1);let f=new Map;return sy(e).forEach(e=>{e.separator&&f.set(e.separator,e.panels)}),gy(e,{defaultLayoutDeferred:o===0,derivedPanelConstraints:s,groupSize:o,layout:u,separatorToPanels:f}),e.separators.forEach(e=>{Qv(!i.has(e.id),`Separator ids must be unique; id "${e.id}" was used more than once`),i.add(e.id),e.element.addEventListener(`keydown`,Hy)}),yb.get(d)===1&&(d.addEventListener(`dblclick`,Ry,!0),d.addEventListener(`pointerdown`,Yy,!0),d.addEventListener(`pointerleave`,ub),d.addEventListener(`pointermove`,db),d.addEventListener(`pointerout`,fb),d.addEventListener(`pointerup`,pb,!0)),function(){t=!1,yb.set(d,Math.max(0,(yb.get(d)??0)-1)),dy(e),e.separators.forEach(e=>{e.element.removeEventListener(`keydown`,Hy)}),yb.get(d)||(d.removeEventListener(`dblclick`,Ry,!0),d.removeEventListener(`pointerdown`,Yy,!0),d.removeEventListener(`pointerleave`,ub),d.removeEventListener(`pointermove`,db),d.removeEventListener(`pointerout`,fb),d.removeEventListener(`pointerup`,pb,!0)),a.disconnect()}}function xb(){let[e,t]=(0,Q.useState)({});return[e,(0,Q.useCallback)(()=>t({}),[])]}function Sb(e){let t=(0,Q.useId)();return`${e??t}`}var Cb=typeof window<`u`?Q.useLayoutEffect:Q.useEffect;function wb(e){let t=(0,Q.useRef)(e);return Cb(()=>{t.current=e},[e]),(0,Q.useCallback)((...e)=>t.current?.(...e),[t])}function Tb(...e){return wb(t=>{e.forEach(e=>{if(e)switch(typeof e){case`function`:e(t);break;case`object`:e.current=t;break}})})}function Eb(e){let t=(0,Q.useRef)({...e});return Cb(()=>{for(let n in e)t.current[n]=e[n]},[e]),t.current}var Db=(0,Q.createContext)(null);function Ob(e,t){let n=(0,Q.useRef)({getLayout:()=>({}),setLayout:Xy});(0,Q.useImperativeHandle)(t,()=>n.current,[]),Cb(()=>{Object.assign(n.current,By({groupId:e}))})}function kb({children:e,className:t,defaultLayout:n,disableCursor:r,disabled:i,elementRef:a,groupRef:o,id:s,onLayoutChange:c,onLayoutChanged:l,orientation:u=`horizontal`,resizeTargetMinimumSize:d={coarse:20,fine:10},style:f,...p}){let m=(0,Q.useRef)({onLayoutChange:{},onLayoutChanged:{}}),h=wb(e=>{Fy(m.current.onLayoutChange,e)||(m.current.onLayoutChange=e,c?.(e))}),g=wb(e=>{Fy(m.current.onLayoutChanged,e)||(m.current.onLayoutChanged=e,l?.(e))}),_=Sb(s),v=(0,Q.useRef)(null),[y,b]=xb(),x=(0,Q.useRef)({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:d,separators:[]}),S=Tb(v,a);Ob(_,o);let C=wb((e,t)=>{let r=Gy(),i=fy(e),a=py(e);if(a){let e=!1;switch(r.state){case`active`:e=r.hitRegions.some(e=>e.group===i);break}return{flexGrow:a.layout[t]??1,pointerEvents:e?`none`:void 0}}if(n?.[t])return{flexGrow:n?.[t]}}),w=Eb({defaultLayout:n,disableCursor:r}),T=(0,Q.useMemo)(()=>({get disableCursor(){return!!w.disableCursor},getPanelStyles:C,id:_,orientation:u,registerPanel:e=>{let t=x.current;return t.panels=$v(u,[...t.panels,e]),b(),()=>{t.panels=t.panels.filter(t=>t!==e),b()}},registerSeparator:e=>{let t=x.current;return t.separators=$v(u,[...t.separators,e]),b(),()=>{t.separators=t.separators.filter(t=>t!==e),b()}},updatePanelProps:(e,{disabled:t})=>{let n=x.current.panels.find(t=>t.id===e);n&&(n.panelConstraints.disabled=t);let r=fy(_),i=py(_);r&&i&&gy(r,{...i,derivedPanelConstraints:Zv(r)})},updateSeparatorProps:(e,{disabled:t,disableDoubleClick:n})=>{let r=x.current.separators.find(t=>t.id===e);r&&(r.disabled=t,r.disableDoubleClick=n)}}),[C,_,b,u,w]),E=(0,Q.useRef)(null);return Cb(()=>{let e=v.current;if(e===null)return;let t=x.current,n;if(w.defaultLayout!==void 0&&Object.keys(w.defaultLayout).length===t.panels.length){n={};for(let e of t.panels){let t=w.defaultLayout[e.id];t!==void 0&&(n[e.id]=t)}}let r={disabled:!!i,element:e,id:_,mutableState:{defaultLayout:n,disableCursor:!!w.disableCursor,expandedPanelSizes:x.current.lastExpandedPanelSizes,layouts:x.current.layouts},orientation:u,panels:t.panels,resizeTargetMinimumSize:t.resizeTargetMinimumSize,separators:t.separators};E.current=r;let a=bb(r),{defaultLayoutDeferred:o,derivedPanelConstraints:s,layout:c}=py(r.id,!0);!o&&s.length>0&&(h(c),g(c));let l=hy(_,e=>{let{defaultLayoutDeferred:t,derivedPanelConstraints:n,layout:i}=e.next;if(t||n.length===0)return;let a=r.panels.map(({id:e})=>e).join(`,`);r.mutableState.layouts[a]=i,n.forEach(t=>{if(t.collapsible){let{layout:n}=e.prev??{};if(n){let e=jy(t.collapsedSize,i[t.panelId]),a=jy(t.collapsedSize,n[t.panelId]);e&&!a&&(r.mutableState.expandedPanelSizes[t.panelId]=n[t.panelId])}}});let o=Gy().state!==`active`;h(i),o&&g(i)});return()=>{E.current=null,a(),l()}},[i,_,g,h,u,y,w]),(0,Q.useEffect)(()=>{let e=E.current;e&&(e.mutableState.defaultLayout=n,e.mutableState.disableCursor=!!r)}),(0,Z.jsx)(Db.Provider,{value:T,children:(0,Z.jsx)(`div`,{...p,className:t,"data-group":!0,"data-testid":_,id:_,ref:S,style:{height:`100%`,width:`100%`,overflow:`hidden`,...f,display:`flex`,flexDirection:u===`horizontal`?`row`:`column`,flexWrap:`nowrap`,touchAction:u===`horizontal`?`pan-y`:`pan-x`},children:e})})}kb.displayName=`Group`;function Ab(){return(0,Q.useRef)(null)}function jb(){let e=(0,Q.useContext)(Db);return Qv(e,`Group Context not found; did you render a Panel or Separator outside of a Group?`),e}function Mb(e,t){let{id:n}=jb(),r=(0,Q.useRef)({collapse:Zy,expand:Zy,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:Zy});(0,Q.useImperativeHandle)(t,()=>r.current,[]),Cb(()=>{Object.assign(r.current,Ly({groupId:n,panelId:e}))})}function Nb({children:e,className:t,collapsedSize:n=`0%`,collapsible:r=!1,defaultSize:i,disabled:a,elementRef:o,groupResizeBehavior:s=`preserve-relative-size`,id:c,maxSize:l=`100%`,minSize:u=`0%`,onResize:d,panelRef:f,style:p,...m}){let h=!!c,g=Sb(c),_=Eb({disabled:a}),v=(0,Q.useRef)(null),y=Tb(v,o),{getPanelStyles:b,id:x,orientation:S,registerPanel:C,updatePanelProps:w}=jb(),T=d!==null,E=wb((e,t,n)=>{d?.(e,c,n)});Cb(()=>{let e=v.current;if(e!==null)return C({element:e,id:g,idIsStable:h,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:T?E:void 0,panelConstraints:{groupResizeBehavior:s,collapsedSize:n,collapsible:r,defaultSize:i,disabled:_.disabled,maxSize:l,minSize:u}})},[s,n,r,i,T,g,h,l,u,E,C,_]),(0,Q.useEffect)(()=>{w(g,{disabled:a})},[a,g,w]),Mb(g,f);let D=()=>{let e=b(x,g);if(e)return JSON.stringify(e)},O=(0,Q.useSyncExternalStore)(e=>hy(x,e),D,D),k;return k=O?JSON.parse(O):i?{flexGrow:void 0,flexShrink:void 0,flexBasis:i}:{flexGrow:1},(0,Z.jsx)(`div`,{...m,"data-disabled":a||void 0,"data-panel":!0,"data-testid":g,id:g,ref:y,style:{...Pb,display:`flex`,flexBasis:0,flexShrink:1,overflow:`visible`,...k},children:(0,Z.jsx)(`div`,{className:t,style:{maxHeight:`100%`,maxWidth:`100%`,flexGrow:1,overflow:`auto`,...p,touchAction:S===`horizontal`?`pan-y`:`pan-x`},children:e})})}Nb.displayName=`Panel`;var Pb={minHeight:0,maxHeight:`100%`,height:`auto`,minWidth:0,maxWidth:`100%`,width:`auto`,border:`none`,borderWidth:0,padding:0,margin:0};function Fb(){return(0,Q.useRef)(null)}function Ib({layout:e,panelConstraints:t,panelId:n,panelIndex:r}){let i,a,o=e[n],s=t.find(e=>e.panelId===n);if(s){let c=s.maxSize,l=s.collapsible?s.collapsedSize:s.minSize,u=[r,r+1];a=Iy({layout:Py({delta:l-o,initialLayout:e,panelConstraints:t,pivotIndices:u,prevLayout:e}),panelConstraints:t})[n],i=Iy({layout:Py({delta:c-o,initialLayout:e,panelConstraints:t,pivotIndices:u,prevLayout:e}),panelConstraints:t})[n]}return{valueControls:n,valueMax:i,valueMin:a,valueNow:o}}function Lb({children:e,className:t,disabled:n,disableDoubleClick:r,elementRef:i,id:a,style:o,...s}){let c=Sb(a),l=Eb({disabled:n,disableDoubleClick:r}),[u,d]=(0,Q.useState)({}),[f,p]=(0,Q.useState)(`inactive`),m=(0,Q.useRef)(null),h=Tb(m,i),{disableCursor:g,id:_,orientation:v,registerSeparator:y,updateSeparatorProps:b}=jb(),x=v===`horizontal`?`vertical`:`horizontal`;Cb(()=>{let e=m.current;if(e!==null){let t={disabled:l.disabled,disableDoubleClick:l.disableDoubleClick,element:e,id:c},n=y(t),r=Ky(e=>{p(e.next.state!==`inactive`&&e.next.hitRegions.some(e=>e.separator===t)?e.next.state:`inactive`)}),i=hy(_,e=>{let{derivedPanelConstraints:n,layout:r,separatorToPanels:i}=e.next,a=i.get(t);if(a){let e=a[0],t=a.indexOf(e);d(Ib({layout:r,panelConstraints:n,panelId:e.id,panelIndex:t}))}});return()=>{r(),i(),n()}}},[_,c,y,l]),(0,Q.useEffect)(()=>{b(c,{disabled:n,disableDoubleClick:r})},[n,r,c,b]);let S;return n&&!g&&(S=`not-allowed`),(0,Z.jsx)(`div`,{...s,"aria-controls":u.valueControls,"aria-disabled":n||void 0,"aria-orientation":x,"aria-valuemax":u.valueMax,"aria-valuemin":u.valueMin,"aria-valuenow":u.valueNow,children:e,className:t,"data-separator":n?`disabled`:f,"data-testid":c,id:c,ref:h,role:`separator`,style:{flexBasis:`auto`,cursor:S,...o,flexGrow:0,flexShrink:0,touchAction:`none`},tabIndex:n?void 0:0})}Lb.displayName=`Separator`;var Rb=new Map;function zb(e){let t=Rb.get(e);if(t)return t;let n=Bb(e);return Rb.set(e,n),n}async function Bb(e){switch(e){case`bash`:case`shell`:return(await n(async()=>{let{StreamLanguage:e}=await import(`./dist-DVPtn9Zx.js`).then(e=>e.h);return{StreamLanguage:e}},__vite__mapDeps([42,1,11]),import.meta.url)).StreamLanguage.define((await n(async()=>{let{shell:e}=await import(`./shell-CYSl653a.js`);return{shell:e}},[],import.meta.url)).shell);case`c`:return(await n(async()=>{let{StreamLanguage:e}=await import(`./dist-DVPtn9Zx.js`).then(e=>e.h);return{StreamLanguage:e}},__vite__mapDeps([42,1,11]),import.meta.url)).StreamLanguage.define((await n(async()=>{let{c:e}=await import(`./clike-CY4jFeI9.js`);return{c:e}},[],import.meta.url)).c);case`cpp`:return(await n(async()=>{let{StreamLanguage:e}=await import(`./dist-DVPtn9Zx.js`).then(e=>e.h);return{StreamLanguage:e}},__vite__mapDeps([42,1,11]),import.meta.url)).StreamLanguage.define((await n(async()=>{let{cpp:e}=await import(`./clike-CY4jFeI9.js`);return{cpp:e}},[],import.meta.url)).cpp);case`csharp`:return(await n(async()=>{let{StreamLanguage:e}=await import(`./dist-DVPtn9Zx.js`).then(e=>e.h);return{StreamLanguage:e}},__vite__mapDeps([42,1,11]),import.meta.url)).StreamLanguage.define((await n(async()=>{let{csharp:e}=await import(`./clike-CY4jFeI9.js`);return{csharp:e}},[],import.meta.url)).csharp);case`css`:case`less`:case`scss`:return(await n(async()=>{let{css:e}=await import(`./dist-DI8cI4NP.js`).then(e=>e.r);return{css:e}},__vite__mapDeps([41,1,42,11,43]),import.meta.url)).css().language;case`diff`:return(await n(async()=>{let{StreamLanguage:e}=await import(`./dist-DVPtn9Zx.js`).then(e=>e.h);return{StreamLanguage:e}},__vite__mapDeps([42,1,11]),import.meta.url)).StreamLanguage.define((await n(async()=>{let{diff:e}=await import(`./diff-VsLDmRbo.js`);return{diff:e}},[],import.meta.url)).diff);case`go`:return(await n(async()=>{let{StreamLanguage:e}=await import(`./dist-DVPtn9Zx.js`).then(e=>e.h);return{StreamLanguage:e}},__vite__mapDeps([42,1,11]),import.meta.url)).StreamLanguage.define((await n(async()=>{let{go:e}=await import(`./go-CJnIK4Uo.js`);return{go:e}},[],import.meta.url)).go);case`ini`:return(await n(async()=>{let{StreamLanguage:e}=await import(`./dist-DVPtn9Zx.js`).then(e=>e.h);return{StreamLanguage:e}},__vite__mapDeps([42,1,11]),import.meta.url)).StreamLanguage.define((await n(async()=>{let{properties:e}=await import(`./properties-KpJMIKzZ.js`);return{properties:e}},[],import.meta.url)).properties);case`java`:return(await n(async()=>{let{StreamLanguage:e}=await import(`./dist-DVPtn9Zx.js`).then(e=>e.h);return{StreamLanguage:e}},__vite__mapDeps([42,1,11]),import.meta.url)).StreamLanguage.define((await n(async()=>{let{java:e}=await import(`./clike-CY4jFeI9.js`);return{java:e}},[],import.meta.url)).java);case`javascript`:return(await n(async()=>{let{javascript:e}=await import(`./dist-DPfhM7y8.js`).then(e=>e.t);return{javascript:e}},__vite__mapDeps([45,1,46,42,11,43]),import.meta.url)).javascript().language;case`json`:return(await n(async()=>{let{json:e}=await import(`./dist-CkLidFHS.js`).then(e=>e.t);return{json:e}},__vite__mapDeps([47,1,42,11,43]),import.meta.url)).json().language;case`kotlin`:return(await n(async()=>{let{StreamLanguage:e}=await import(`./dist-DVPtn9Zx.js`).then(e=>e.h);return{StreamLanguage:e}},__vite__mapDeps([42,1,11]),import.meta.url)).StreamLanguage.define((await n(async()=>{let{kotlin:e}=await import(`./clike-CY4jFeI9.js`);return{kotlin:e}},[],import.meta.url)).kotlin);case`lua`:return(await n(async()=>{let{StreamLanguage:e}=await import(`./dist-DVPtn9Zx.js`).then(e=>e.h);return{StreamLanguage:e}},__vite__mapDeps([42,1,11]),import.meta.url)).StreamLanguage.define((await n(async()=>{let{lua:e}=await import(`./lua-BTUOHEPy.js`);return{lua:e}},[],import.meta.url)).lua);case`markdown`:return(await n(async()=>{let{markdown:e}=await import(`./dist-D7I9jMga.js`).then(e=>e.t);return{markdown:e}},__vite__mapDeps([48,1,46,42,11,44,41,43,45]),import.meta.url)).markdown().language;case`objectivec`:return(await n(async()=>{let{StreamLanguage:e}=await import(`./dist-DVPtn9Zx.js`).then(e=>e.h);return{StreamLanguage:e}},__vite__mapDeps([42,1,11]),import.meta.url)).StreamLanguage.define((await n(async()=>{let{objectiveC:e}=await import(`./clike-CY4jFeI9.js`);return{objectiveC:e}},[],import.meta.url)).objectiveC);case`perl`:return(await n(async()=>{let{StreamLanguage:e}=await import(`./dist-DVPtn9Zx.js`).then(e=>e.h);return{StreamLanguage:e}},__vite__mapDeps([42,1,11]),import.meta.url)).StreamLanguage.define((await n(async()=>{let{perl:e}=await import(`./perl-CSl7RrAK.js`);return{perl:e}},[],import.meta.url)).perl);case`python`:return(await n(async()=>{let{python:e}=await import(`./dist-BuoXuHTG.js`);return{python:e}},__vite__mapDeps([69,46,42,1,11,43]),import.meta.url)).python().language;case`r`:return(await n(async()=>{let{StreamLanguage:e}=await import(`./dist-DVPtn9Zx.js`).then(e=>e.h);return{StreamLanguage:e}},__vite__mapDeps([42,1,11]),import.meta.url)).StreamLanguage.define((await n(async()=>{let{r:e}=await import(`./r-DFsc7DIH.js`);return{r:e}},[],import.meta.url)).r);case`ruby`:return(await n(async()=>{let{StreamLanguage:e}=await import(`./dist-DVPtn9Zx.js`).then(e=>e.h);return{StreamLanguage:e}},__vite__mapDeps([42,1,11]),import.meta.url)).StreamLanguage.define((await n(async()=>{let{ruby:e}=await import(`./ruby-dZPnOz8h.js`);return{ruby:e}},[],import.meta.url)).ruby);case`rust`:return(await n(async()=>{let{rust:e}=await import(`./dist-CgYE3gek.js`);return{rust:e}},__vite__mapDeps([70,42,1,11,43]),import.meta.url)).rust().language;case`sql`:return(await n(async()=>{let{StreamLanguage:e}=await import(`./dist-DVPtn9Zx.js`).then(e=>e.h);return{StreamLanguage:e}},__vite__mapDeps([42,1,11]),import.meta.url)).StreamLanguage.define((await n(async()=>{let{standardSQL:e}=await import(`./sql-BfVjfYES.js`);return{standardSQL:e}},[],import.meta.url)).standardSQL);case`swift`:return(await n(async()=>{let{StreamLanguage:e}=await import(`./dist-DVPtn9Zx.js`).then(e=>e.h);return{StreamLanguage:e}},__vite__mapDeps([42,1,11]),import.meta.url)).StreamLanguage.define((await n(async()=>{let{swift:e}=await import(`./swift-DjBuuwmF.js`);return{swift:e}},[],import.meta.url)).swift);case`typescript`:return(await n(async()=>{let{javascript:e}=await import(`./dist-DPfhM7y8.js`).then(e=>e.t);return{javascript:e}},__vite__mapDeps([45,1,46,42,11,43]),import.meta.url)).javascript({typescript:!0,jsx:!0}).language;case`xml`:return(await n(async()=>{let{html:e}=await import(`./dist-D8Itza26.js`).then(e=>e.t);return{html:e}},__vite__mapDeps([44,1,41,42,11,43,45,46]),import.meta.url)).html().language;case`yaml`:return(await n(async()=>{let{yaml:e}=await import(`./dist-BEW6C_CZ.js`).then(e=>e.t);return{yaml:e}},__vite__mapDeps([49,1,42,11,43]),import.meta.url)).yaml().language;default:return null}}async function Vb(e,t){if(e===`canvas`)return(await n(async()=>{let{json:e}=await import(`./dist-CkLidFHS.js`).then(e=>e.t);return{json:e}},__vite__mapDeps([47,1,42,11,43]),import.meta.url)).json().language;if(t){let e=await zb(t);if(e)return e}return e===`toml`?(await n(async()=>{let{StreamLanguage:e}=await import(`./dist-DVPtn9Zx.js`).then(e=>e.h);return{StreamLanguage:e}},__vite__mapDeps([42,1,11]),import.meta.url)).StreamLanguage.define((await n(async()=>{let{toml:e}=await import(`./toml-C3_Svn60.js`);return{toml:e}},[],import.meta.url)).toml):null}function Hb(e){let t=(0,$.c)(10),{_:n}=$t(),r;t[0]===n?r=t[1]:(r=e=>n(e===413?{id:`C_WGy8`}:e===415?{id:`VM7H66`}:e===404?{id:`s0IDhW`}:e===400?{id:`N1mdmS`}:typeof e==`number`?{id:`96w9hU`,values:{status:e}}:{id:`ig5vUe`}),t[0]=n,t[1]=r);let i=r,{src:a,loadText:o}=e,s=(0,Q.useRef)(o),c=(0,Q.useRef)(i),l;t[2]!==o||t[3]!==i?(l=()=>{s.current=o,c.current=i},t[2]=o,t[3]=i,t[4]=l):l=t[4],(0,Q.useEffect)(l);let u;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(u={status:`loading`},t[5]=u):u=t[5];let[d,f]=(0,Q.useState)(u),p,m;return t[6]!==n||t[7]!==a?(p=()=>{let e=!1,t=new AbortController;f({status:`loading`});let r=s.current;return r?(r(t.signal).then(t=>{if(!e){if(t.ok){f({status:`loaded`,content:t.text});return}f({status:`error`,message:t.message??c.current(t.status)})}}).catch(t=>{e||t instanceof Error&&t.name===`AbortError`||f({status:`error`,message:n({id:`ig5vUe`})})}),()=>{e=!0,t.abort()}):(fetch(a??``,{credentials:`same-origin`,signal:t.signal}).then(async e=>{if(!e.ok)throw Error(c.current(e.status));return e.text()}).then(t=>{e||f({status:`loaded`,content:t})}).catch(t=>{e||t instanceof Error&&t.name===`AbortError`||f({status:`error`,message:t instanceof Error?t.message:n({id:`ig5vUe`})})}),()=>{e=!0,t.abort()})},m=[a,n],t[6]=n,t[7]=a,t[8]=p,t[9]=m):(p=t[8],m=t[9]),(0,Q.useEffect)(p,m),d}function Ub(e){let t=(0,$.c)(10),{fileName:n,dataAttr:r,extraAttrs:i}=e,a=`${r}-state`,o;t[0]!==r||t[1]!==a?(o={[r]:``,[a]:`loading`},t[0]=r,t[1]=a,t[2]=o):o=t[2];let s;t[3]===n?s=t[4]:(s=(0,Z.jsx)(`span`,{children:(0,Z.jsx)(J,{id:`Md709y`,values:{fileName:n}})}),t[3]=n,t[4]=s);let c;return t[5]!==i||t[6]!==n||t[7]!==o||t[8]!==s?(c=(0,Z.jsx)(`main`,{className:`flex h-full min-h-0 flex-col items-center justify-center bg-background text-muted-foreground text-sm`,"aria-label":n,...o,...i,children:s}),t[5]=i,t[6]=n,t[7]=o,t[8]=s,t[9]=c):c=t[9],c}function Wb(e){let t=(0,$.c)(16),{fileName:n,dataAttr:r,extraAttrs:i,message:a,openHref:o}=e,s=`${r}-state`,c;t[0]!==r||t[1]!==s?(c={[r]:``,[s]:`error`},t[0]=r,t[1]=s,t[2]=c):c=t[2];let l;t[3]===n?l=t[4]:(l=(0,Z.jsx)(`div`,{className:`font-medium text-sm`,children:(0,Z.jsx)(J,{id:`qdBUHP`,values:{fileName:n}})}),t[3]=n,t[4]=l);let u;t[5]===a?u=t[6]:(u=(0,Z.jsx)(`div`,{className:`text-muted-foreground text-xs`,children:a}),t[5]=a,t[6]=u);let d;t[7]===o?d=t[8]:(d=o?(0,Z.jsx)(`a`,{href:o,className:`mt-2 rounded-md border px-3 py-1.5 text-sm hover:bg-accent hover:text-accent-foreground`,children:(0,Z.jsx)(J,{id:`9npOH9`})}):null,t[7]=o,t[8]=d);let f;return t[9]!==i||t[10]!==n||t[11]!==c||t[12]!==l||t[13]!==u||t[14]!==d?(f=(0,Z.jsxs)(`main`,{className:`flex h-full min-h-0 flex-col items-center justify-center gap-2 bg-background p-4 text-center`,"aria-label":n,...c,...i,children:[l,u,d]}),t[9]=i,t[10]=n,t[11]=c,t[12]=l,t[13]=u,t[14]=d,t[15]=f):f=t[15],f}var Gb=q({settings:{background:`var(--background)`,gutterBackground:`var(--muted)`}}),Kb=E({settings:{background:`var(--background)`,gutterBackground:`var(--muted)`}});function qb(e){let t=(0,$.c)(23),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({fileName:r,extension:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=(0,Q.useRef)(null),o=(0,Q.useRef)(null),{resolvedTheme:s}=Mn(),c=Hb(i),l=c.status===`loaded`?c.content:null,u,d;t[4]!==n||t[5]!==l||t[6]!==s?(u=()=>{if(!a.current||l===null)return;let e=n.toLowerCase(),t=Lr(e),r=s===`dark`?Gb:Kb,i=!1,c=null;return Vb(e,t).then(e=>{if(i||!a.current)return;let t=[lu,...e?[e]:[],Wl.editable.of(!0),Pl.readOnly.of(!0),Wl.lineWrapping,r];c=new Wl({state:Pl.create({doc:l,extensions:t}),parent:a.current}),o.current=c}),()=>{i=!0,c?.destroy(),o.current=null}},d=[l,n,s],t[4]=n,t[5]=l,t[6]=s,t[7]=u,t[8]=d):(u=t[7],d=t[8]),(0,Q.useEffect)(u,d);let f;t[9]===n?f=t[10]:(f={"data-text-viewer-extension":n},t[9]=n,t[10]=f);let p=f;if(c.status===`loading`){let e;return t[11]!==p||t[12]!==r?(e=(0,Z.jsx)(Ub,{fileName:r,dataAttr:`data-text-viewer`,extraAttrs:p}),t[11]=p,t[12]=r,t[13]=e):e=t[13],e}if(c.status===`error`){let e;return t[14]!==p||t[15]!==c.message||t[16]!==r||t[17]!==i.src?(e=(0,Z.jsx)(Wb,{fileName:r,dataAttr:`data-text-viewer`,extraAttrs:p,message:c.message,openHref:i.src}),t[14]=p,t[15]=c.message,t[16]=r,t[17]=i.src,t[18]=e):e=t[18],e}let m;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,Z.jsx)(`div`,{ref:a,className:`min-h-0 flex-1 overflow-auto`}),t[19]=m):m=t[19];let h;return t[20]!==n||t[21]!==r?(h=(0,Z.jsx)(`main`,{className:`flex h-full min-h-0 flex-col bg-background`,"aria-label":r,"data-text-viewer":``,"data-text-viewer-state":`loaded`,"data-text-viewer-extension":n,children:m}),t[20]=n,t[21]=r,t[22]=h):h=t[22],h}function Jb(e){return Rn(`/api/asset?path=${encodeURIComponent(e)}`)}function Yb(e){return`/api/asset-text?path=${encodeURIComponent(e)}`}function Xb(e){let t=(0,$.c)(31),{assetPath:n,mediaKind:r}=e,[i,a]=(0,Q.useState)(!1),o;t[0]===n?o=t[1]:(o=Jb(n),t[0]=n,t[1]=o);let s=o,c;t[2]===n?c=t[3]:(c=n.split(`/`).pop()??n,t[2]=n,t[3]=c);let l=c,u,f,p,m;if(t[4]!==n||t[5]!==l||t[6]!==i||t[7]!==r||t[8]!==s){m=Symbol.for(`react.early_return_sentinel`);bb0:{if(p=l.includes(`.`)?l.split(`.`).pop()??``:``,f=p.length>0?p.toUpperCase():`FILE`,u=i?`text`:r,u===`pdf`){let e;t[13]!==l||t[14]!==s?(e=(0,Z.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden`,children:(0,Z.jsx)(ke,{src:s,title:l,fillContainer:!0})}),t[13]=l,t[14]=s,t[15]=e):e=t[15];let n;t[16]!==l||t[17]!==e?(n=(0,Z.jsx)(`main`,{className:`flex h-full min-h-0 flex-col bg-background`,"aria-label":l,children:e}),t[16]=l,t[17]=e,t[18]=n):n=t[18],m=n;break bb0}if(u===`text`){let e;t[19]===n?e=t[20]:(e=Yb(n),t[19]=n,t[20]=e),m=(0,Z.jsx)(qb,{src:e,fileName:l,extension:p.toLowerCase()},n);break bb0}}t[4]=n,t[5]=l,t[6]=i,t[7]=r,t[8]=s,t[9]=u,t[10]=f,t[11]=p,t[12]=m}else u=t[9],f=t[10],p=t[11],m=t[12];if(m!==Symbol.for(`react.early_return_sentinel`))return m;let h;t[21]!==n||t[22]!==u||t[23]!==f||t[24]!==l||t[25]!==p||t[26]!==s?(h=(0,Z.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center overflow-auto p-4`,children:u===`image`?(0,Z.jsx)(Nt,{src:s,alt:l,draggable:!1,slotClassName:`flex h-full w-full items-center justify-center`,className:`max-h-full max-w-full`}):u===`video`?(0,Z.jsx)(`video`,{src:s,controls:!0,className:`max-h-full max-w-full`}):u===`audio`?(0,Z.jsx)(`audio`,{src:s,controls:!0,className:`w-full max-w-md`}):(0,Z.jsxs)(`div`,{className:`flex max-w-sm flex-col items-center gap-8 text-center`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-col items-center gap-1`,children:[(0,Z.jsx)(`div`,{className:`flex items-center justify-center tracking-wide text-muted-foreground/80 text-2xs font-mono`,children:f}),(0,Z.jsx)(`div`,{className:`max-w-full text-balance break-words tracking-tight font-light text-2xl`,children:l})]}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center justify-center gap-2`,children:[(0,Z.jsx)(X,{variant:`default`,size:`sm`,onClick:()=>a(!0),"data-testid":`asset-preview-open-as-text`,className:`font-mono uppercase`,children:(0,Z.jsx)(J,{id:`qFWMl-`})}),(0,Z.jsx)(X,{variant:`outline`,size:`sm`,className:`font-mono uppercase`,onClick:()=>{d({url:s,projectRelPath:n,ext:p.toLowerCase(),title:l,forceOsDelegation:!1})},children:(0,Z.jsx)(J,{id:`9npOH9`})})]})]})}),t[21]=n,t[22]=u,t[23]=f,t[24]=l,t[25]=p,t[26]=s,t[27]=h):h=t[27];let g;return t[28]!==l||t[29]!==h?(g=(0,Z.jsx)(`main`,{className:`flex h-full min-h-0 flex-col bg-background`,"aria-label":l,children:h}),t[28]=l,t[29]=h,t[30]=g):g=t[30],g}function Zb(){let e=(0,$.c)(5),{_:t}=$t(),n;e[0]===t?n=e[1]:(n=t({id:`3VsNTI`}),e[0]=t,e[1]=n);let r;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Z.jsxs)(`div`,{className:`space-y-3`,children:[(0,Z.jsx)(Ba,{className:`h-9 w-2/5 mt-6 mb-5`}),(0,Z.jsx)(Ba,{className:`h-4 w-full`}),(0,Z.jsx)(Ba,{className:`h-4 w-3/4`})]}),e[2]=r):r=e[2];let i;return e[3]===n?i=e[4]:(i=(0,Z.jsx)(`div`,{className:`tiptap-editor pt-10`,role:`status`,"aria-busy":`true`,"aria-label":n,children:r}),e[3]=n,e[4]=i),i}function Qb(e){let{_:t}=$t();return e===`existing-repo`?[{id:`draft-spec`,icon:jd,label:t({id:`LdKIHS`}),prompt:t({id:`N_7kkF`})},{id:`organize-specs`,icon:Yd,label:t({id:`cuA8QW`}),prompt:t({id:`mPy9lS`})},{id:`document-architecture`,icon:$d,label:t({id:`6eniID`}),prompt:t({id:`uDlyqd`})}]:[{id:`competitor-research`,icon:Of,label:t({id:`GUqTzn`}),prompt:t({id:`KOZud0`})},{id:`eng-specs`,icon:jd,label:t({id:`Qvls7J`}),prompt:t({id:`6qMe0o`})},{id:`bird-wiki`,icon:pd,label:t({id:`FqTpiN`}),prompt:t({id:`jtg_8-`})}]}function $b(e){let t=(0,$.c)(13),{scenario:n,className:r}=e,{_:i}=$t(),a=Qb(n),[o,s]=(0,Q.useState)(null),c=(0,Q.useRef)(void 0),l,u;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(l=()=>()=>clearTimeout(c.current),u=[],t[0]=l,t[1]=u):(l=t[0],u=t[1]),(0,Q.useEffect)(l,u);let d,f;if(t[2]!==i||t[3]!==r||t[4]!==o||t[5]!==a){let e=function(e,t){ga(t).then(()=>{s(e),clearTimeout(c.current),c.current=setTimeout(()=>s(null),1600)}).catch(ex)};t[8]===r?d=t[9]:(d=Y(`w-full divide-y divide-border/60 overflow-hidden rounded-2xl border border-border/60 bg-card`,r),t[8]=r,t[9]=d),f=a.map(t=>{let n=t.icon,r=o===t.id;return(0,Z.jsxs)(`li`,{className:`group flex items-start gap-3 p-3.5`,"data-testid":`copy-prompt-${t.id}`,children:[(0,Z.jsx)(n,{className:`mt-0.5 size-4 shrink-0 text-muted-foreground`,"aria-hidden":`true`}),(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1.5`,children:[(0,Z.jsx)(`span`,{className:`text-sm font-medium leading-tight text-foreground`,children:t.label}),(0,Z.jsx)(`span`,{className:`truncate text-1sm leading-relaxed text-muted-foreground`,children:t.prompt})]}),(0,Z.jsxs)(X,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>e(t.id,t.prompt),"aria-label":i(r?{id:`6V3Ea3`}:{id:`RG4XHV`,values:{0:t.label}}),className:Y(`shrink-0 gap-1.5 transition-opacity focus-visible:opacity-100 uppercase font-mono`,r?`opacity-100`:`opacity-0 group-hover:opacity-100`),"data-testid":`copy-prompt-button-${t.id}`,children:[r?(0,Z.jsx)(Ui,{className:`size-3.5`,"aria-hidden":`true`}):(0,Z.jsx)(xo,{className:`size-3.5`,"aria-hidden":`true`}),i(r?{id:`6V3Ea3`}:{id:`he3ygx`})]})]},t.id)}),t[2]=i,t[3]=r,t[4]=o,t[5]=a,t[6]=d,t[7]=f}else d=t[6],f=t[7];let p;return t[10]!==d||t[11]!==f?(p=(0,Z.jsx)(`ul`,{className:d,children:f}),t[10]=d,t[11]=f,t[12]=p):p=t[12],p}function ex(){}var tx=`ok-ask-ai-draft-v2`,nx={doc:null,dismissed:!1};function rx(){if(typeof window>`u`)return null;try{return window.localStorage}catch{return null}}var ix=null,ax=new Set;function ox(e){if(e===null)return!0;let t=e.content;return!Array.isArray(t)||t.length===0?!0:t.every(e=>{let t=e.content;return!Array.isArray(t)||t.length===0})}function sx(){let e=rx();if(!e)return nx;try{let t=e.getItem(tx);if(!t)return nx;let n=JSON.parse(t);return typeof n!=`object`||!n||Array.isArray(n)?nx:{doc:n,dismissed:!1}}catch(e){return console.warn(`failed to parse stored draft — clearing`,e),nx}}function cx(){return ix===null&&(ix=sx()),ix}function lx(e){let t=rx();if(t)try{e&&!ox(e)?t.setItem(tx,JSON.stringify(e)):t.removeItem(tx)}catch{}}function ux(){for(let e of ax)e()}function dx(){return cx()}function fx(e){let t=e&&!ox(e)?e:null;ix={...cx(),doc:t},lx(t),ux()}function px(){fx(null)}var mx=_i(`group/button-group flex w-fit items-stretch *:focus-visible:relative *:focus-visible:z-10 has-[>[data-slot=button-group]]:gap-2 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-lg [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1`,{variants:{orientation:{horizontal:`[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-r-lg!`,vertical:`flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-b-lg!`}},defaultVariants:{orientation:`horizontal`}});function hx(e){let t=(0,$.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,orientation:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]!==n||t[5]!==r?(a=Y(mx({orientation:r}),n),t[4]=n,t[5]=r,t[6]=a):a=t[6];let o;return t[7]!==r||t[8]!==i||t[9]!==a?(o=(0,Z.jsx)(`div`,{role:`group`,"data-slot":`button-group`,"data-orientation":r,className:a,...i}),t[7]=r,t[8]=i,t[9]=a,t[10]=o):o=t[10],o}var gx=Rr;function _x(e){let t=I(e).kind;return t===`folder`||t===`asset`?t:`page`}function vx(e){let t=(0,$.c)(14),{items:n,query:r,selectedIndex:i,onSelect:a,loading:o,error:s,hasMore:c}=e,l=o===void 0?!1:o,u=s===void 0?!1:s,d=c===void 0?!1:c,{_:f}=$t(),p=(0,Q.useId)(),m=(0,Q.useRef)(null),h,g;t[0]===i?(h=t[1],g=t[2]):(h=()=>{(m.current?.querySelectorAll(`[role="option"]`))?.item(i)?.scrollIntoView({block:`nearest`})},g=[i],t[0]=i,t[1]=h,t[2]=g),(0,Q.useEffect)(h,g);let _=i>=0&&i<n.length?n[i]:null,v;return t[3]!==f||t[4]!==u||t[5]!==d||t[6]!==n||t[7]!==p||t[8]!==l||t[9]!==a||t[10]!==r||t[11]!==i||t[12]!==_?(v=(0,Z.jsx)(`div`,{ref:m,className:`w-80 max-w-[min(28rem,90vw)] overflow-hidden rounded-lg border bg-popover p-1 text-popover-foreground shadow-md`,children:l?(0,Z.jsx)(`p`,{className:`px-2 py-1.5 text-sm text-muted-foreground`,"aria-live":`polite`,children:f({id:`3m2GBo`})}):u?(0,Z.jsx)(`p`,{className:`px-2 py-1.5 text-sm text-muted-foreground`,"aria-live":`assertive`,children:f({id:`weP6me`})}):n.length===0?(0,Z.jsx)(`p`,{className:`px-2 py-1.5 text-sm text-muted-foreground`,"aria-live":`polite`,children:r.trim()===``?f({id:`0E9DR6`}):f({id:`yQyglE`})}):(0,Z.jsxs)(`div`,{role:`listbox`,id:p,"aria-label":f({id:`05n5wS`}),tabIndex:-1,className:`max-h-64 overflow-y-auto subtle-scrollbar`,children:[(0,Z.jsx)(`span`,{className:`sr-only`,"aria-live":`polite`,"aria-atomic":`true`,children:_?_.title:``}),n.map((e,t)=>{let n=t===i,r=_x(e.path),o=r===`folder`,s=o?`${e.path}/`:e.path;return(0,Z.jsxs)(`button`,{id:`${p}-option-${t}`,type:`button`,role:`option`,"aria-selected":n,"data-active":n,"data-mention-kind":r,"data-testid":`composer-mention-option-${e.docName}`,className:`flex w-full items-start gap-2 rounded-md px-2 py-1.5 text-left ${n?`bg-accent text-accent-foreground`:``}`,onMouseDown:t=>{t.preventDefault(),a(e)},children:[(0,Z.jsx)(Vt,{path:e.path,className:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),(0,Z.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,Z.jsxs)(`span`,{className:`flex items-baseline gap-1.5`,children:[(0,Z.jsx)(`span`,{className:`truncate text-sm font-medium`,children:e.title}),o?(0,Z.jsx)(`span`,{className:`shrink-0 text-[10px] font-medium uppercase tracking-wide text-muted-foreground`,children:f({id:`kNqMMd`})}):null]}),(0,Z.jsx)(`span`,{className:`line-clamp-2 break-all text-xs text-muted-foreground`,children:s})]})]},e.docName)}),d?(0,Z.jsx)(`div`,{className:`px-2 py-1 text-xs text-muted-foreground`,"aria-hidden":!0,children:f({id:`F1T9y_`})}):null]})}),t[3]=f,t[4]=u,t[5]=d,t[6]=n,t[7]=p,t[8]=l,t[9]=a,t[10]=r,t[11]=i,t[12]=_,t[13]=v):v=t[13],v}var yx=8,bx=new Zr(`composerMentionSuggestion`);function xx(e){return e.kind===`asset`?e.docName.replace(/^\//,``):e.kind===`folder`?e.docName:ra(e.docName)}var Sx=dr.create({name:`doc`,topNode:!0,content:`paragraph+`}),Cx=dr.create({name:`paragraph`,group:`block`,content:`inline*`,parseHTML(){return[{tag:`p`}]},renderHTML(){return[`p`,0]}}),wx=dr.create({name:`text`,group:`inline`}),Tx=dr.create({name:`hardBreak`,group:`inline`,inline:!0,selectable:!1,parseHTML(){return[{tag:`br`}]},renderHTML(){return[`br`]},addKeyboardShortcuts(){return{"Shift-Enter":()=>this.editor.commands.insertContent({type:`hardBreak`})}}}),Ex=pr.create({name:`composerHistory`,addProseMirrorPlugins(){return[Zn(),Yr({"Mod-z":rr,"Mod-y":$n,"Shift-Mod-z":$n})]}}),Dx=dr.create({name:`composerMention`,group:`inline`,inline:!0,atom:!0,selectable:!0,addAttributes(){return{path:{default:``},label:{default:``}}},parseHTML(){return[{tag:`span[data-composer-mention]`}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.label||e.attrs.path);return[`span`,Kr(t,{"data-composer-mention":String(e.attrs.path??``),class:`composer-mention-chip`}),`@${n}`]},renderText({node:e}){return`@${e.attrs.path}`},addNodeView(){return({node:e,editor:t,getPos:n})=>{let r=String(e.attrs.path??``),i=String(e.attrs.label||e.attrs.path),a=document.createElement(`span`);a.className=`composer-mention-chip group/mention`,a.setAttribute(`data-composer-mention`,r),a.title=i;let o=document.createElement(`button`);o.type=`button`,o.className=`composer-mention-icon`,o.setAttribute(`aria-label`,Wc._({id:`Xzy0s0`,values:{fullLabel:i}}));let s=document.createElement(`span`);s.className=`composer-mention-glyph composer-mention-glyph-icon`,s.setAttribute(`aria-hidden`,`true`),s.innerHTML=Gt(r),o.appendChild(s);let c=document.createElement(`span`);c.className=`composer-mention-glyph composer-mention-glyph-x`,c.setAttribute(`aria-hidden`,`true`),c.innerHTML=oe(gs),o.appendChild(c),o.addEventListener(`mousedown`,e=>e.preventDefault()),o.addEventListener(`click`,r=>{r.preventDefault();let i=typeof n==`function`?n():null;i!=null&&t.chain().focus().deleteRange({from:i,to:i+e.nodeSize}).run()}),a.appendChild(o);let l=document.createElement(`span`);return l.className=`composer-mention-label`,l.textContent=i,a.appendChild(l),{dom:a}}},addProseMirrorPlugins(){return[Ax(this.editor)]}});function Ox(e){return[Sx,Cx,wx,Tx,Ex,Dx,...e?.placeholder?[gx.configure({placeholder:e.placeholder})]:[]]}function kx(e=x){let t=[],n=!1,r=null,i=!1;return{snapshot(){return{loaded:n,error:i}},async getItems(a){if(!n){r||=e();try{t=await r,n=!0,i=!1}catch(e){console.error(`[composer-mention] failed to fetch pages`,e),t=[],i=!0}finally{r=null}}return k(t,a).map(e=>({docName:e.docName,title:e.title,path:xx(e)})).filter(e=>e.path!==``)},reset(){t=[],n=!1,r=null,i=!1}}}function Ax(e){let t=kx();return W({editor:e,pluginKey:bx,char:`@`,items:({query:e})=>t.getItems(e),command:({editor:e,range:t,props:n})=>{try{e.chain().focus().deleteRange(t).insertContent([{type:`composerMention`,attrs:{path:n.path,label:n.title}},{type:`text`,text:` `}]).run()}catch(e){console.error(`[composer-mention] insert failed`,{item:n,range:t},e)}},render:()=>{let e=null,n=null,r=0,i={popup:null,stopAutoUpdate:null},a=null,o=null,s=e=>{n?.command(e)},c=e=>{let n=e.items??[],{loaded:i,error:a}=t.snapshot();return{items:n,query:e.query??``,selectedIndex:r,onSelect:s,loading:!i&&!a,error:a,hasMore:n.length>=yx}},l=()=>{!e||!n||e.updateProps(c(n))};return{onBeforeStart(t){n=t,r=0;let s=ce(()=>n,`composer-mention`);i.popup=s.popup,a=s.doPosition,o=s.reveal,e=new rt(vx,{props:c(t),editor:t.editor}),s.popup.appendChild(e.element),i.stopAutoUpdate=s.startAutoUpdate()},onStart(e){n=e,r=0,l(),o?.()},onUpdate(e){n=e,r=Math.min(r,Math.max(0,e.items.length-1)),l(),a?.()},onKeyDown({event:e}){if(!n)return!1;let t=n.items;if(e.key===`ArrowDown`)return t.length===0?!1:(r=(r+1)%t.length,l(),!0);if(e.key===`ArrowUp`)return t.length===0?!1:(r=(r-1+t.length)%t.length,l(),!0);if(e.key===`Enter`||e.key===`Tab`){let e=t[r];return e?(n.command(e),!0):!1}return!1},onExit(){y(i),a=null,o=null,e?.destroy(),e=null,n=null,r=0,t.reset()}}}})}function jx(e){let t=[],n=new Set,r=[];return e.state.doc.forEach(e=>{let i=``;e.forEach(e=>{if(e.type.name===`composerMention`){let r=String(e.attrs.path??``);r!==``&&(i+=`@${r}`,n.has(r)||(n.add(r),t.push(r)))}else e.isText?i+=e.text??``:e.type.name===`hardBreak`&&(i+=`
|
|
22
|
+
`);return t?n.pop():n.push(n.pop().slice(0,-1)),n}function uv(e,t){return`${e}\u0000${t}`}function dv(e,t,n){let r=mi(e).body,i=mi(t).body;return r===i?``:cv(n,r,i,``,``,{context:3})}function fv(e,t,n){let r=(0,$.c)(8),{activeProvider:i}=mt(),a;r[0]===Symbol.for(`react.memo_cache_sentinel`)?(a={status:`idle`,diff:null},r[0]=a):a=r[0];let[o,s]=(0,Q.useState)(a),c=(0,Q.useRef)(i),l;r[1]===i?l=r[2]:(l=()=>{c.current=i},r[1]=i,r[2]=l),(0,Q.useEffect)(l);let u,d;return r[3]!==n||r[4]!==t||r[5]!==e?(u=()=>{if(!e){s({status:`idle`,diff:null});return}let r=e,i=!1;return s({status:`loading`,diff:null}),(async function(){try{let e=uv(t,r),a=n.get(e);if(a===void 0){let o=await fetch(`/api/history/${r}?docName=${encodeURIComponent(t)}`);if(i)return;if(!o.ok){s({status:`error`,diff:null});return}let c=await o.json();if(i)return;a=c.content??``,n.set(e,a)}if(i)return;let o=c.current?.document.getText(`source`).toString()??``,l=dv(a,o,t);if(i)return;s({status:`ready`,diff:l})}catch(e){i||(console.error(`[timeline-diff] failed to load entry diff`,{sha:r,docName:t,err:e}),s({status:`error`,diff:null}))}})(),()=>{i=!0}},d=[e,t,n],r[3]=n,r[4]=t,r[5]=e,r[6]=u,r[7]=d):(u=r[6],d=r[7]),(0,Q.useEffect)(u,d),o}var pv=(0,Q.lazy)(async()=>({default:(await n(()=>import(`./ActivityPanelDiffView-BPrpOwiv.js`),__vite__mapDeps([5,1,6,7,8]),import.meta.url)).ActivityPanelDiffView})),mv=1e4,hv=6e4;async function gv(e,t,n){try{let r=await fetch(`/api/history?docName=${encodeURIComponent(e)}&limit=100`,{signal:t});if(!r.ok)return n.setError(n.unavailableMessage),`error`;let i=await r.json();return n.setEntries((i.entries??[]).filter(e=>e.type!==`checkpoint`)),n.setError(null),`ok`}catch(e){if(e instanceof DOMException&&e.name===`AbortError`)throw e;return n.setError(n.unavailableMessage),console.error(`[timeline]`,e),`error`}finally{t.aborted||n.setLoading(!1)}}function _v(e){let t=new Date(e),n=new Date().getTime()-t.getTime(),r=Math.floor(n/1e3);if(r<60)return Wc._({id:`xOTzt5`});if(r<3600){let e=Math.floor(r/60);return Wc._({id:`UyROxs`,values:{mins:e}})}if(r<86400){let e=Math.floor(r/3600);return Wc._({id:`wXO4Tg`,values:{hrs:e}})}if(r<86400*2)return Wc._({id:`rQRrkB`});let i=Math.floor(r/86400);return i<7?Wc._({id:`6u9LvN`,values:{days:i}}):t.toLocaleDateString()}function vv(e){return new Date(e).toLocaleString(void 0,{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`})}function yv(e){return e.slice(0,7)}function bv(e){return e.type===`upstream`?Wc._({id:`K_vT1F`}):e.contributors.length===1?e.contributors[0].name:e.contributors.length>1?e.contributors.map(e=>e.name).join(`, `):e.author===`openknowledge-server`||e.author===`server`?Wc._({id:`B2DrPb`}):e.author}function xv(e){let t=(0,$.c)(17),n,r;if(t[0]===e?(n=t[1],r=t[2]):({icon:n,...r}=e,t[0]=e,t[1]=n,t[2]=r),n===`claude`){let e;return t[3]===r?e=t[4]:(e=(0,Z.jsx)(rs,{...r}),t[3]=r,t[4]=e),e}if(n===`cursor`){let e;return t[5]===r?e=t[6]:(e=(0,Z.jsx)(as,{...r}),t[5]=r,t[6]=e),e}if(n===`windsurf`){let e;return t[7]===r?e=t[8]:(e=(0,Z.jsx)(ss,{...r}),t[7]=r,t[8]=e),e}if(n===`openai`){let e;return t[9]===r?e=t[10]:(e=(0,Z.jsx)(is,{...r}),t[9]=r,t[10]=e),e}if(n===`cline`){let e;return t[11]===r?e=t[12]:(e=(0,Z.jsx)(ps,{...r}),t[11]=r,t[12]=e),e}if(n===`github`){let e;return t[13]===r?e=t[14]:(e=(0,Z.jsx)(ds,{...r}),t[13]=r,t[14]=e),e}let i=r,a;return t[15]===i?a=t[16]:(a=(0,Z.jsx)(ns,{strokeWidth:1.5,...i}),t[15]=i,t[16]=a),a}function Sv(e){let t=(0,$.c)(17),{entry:n,isDark:r}=e;if(n.type===`upstream`){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(Io,{className:`size-3.5 shrink-0 text-muted-foreground`}),t[0]=e):e=t[0],e}if(n.contributors.length>0){let e=n.contributors[0],i=e.colorSeed??e.name,a;t[1]===i?a=t[2]:(a=Un(i),t[1]=i,t[2]=a);let o=a,s=r?Gr[o]??ri[o]:ri[o],c;t[3]!==s||t[4]!==i?(c=s??_r(i),t[3]=s,t[4]=i,t[5]=c):c=t[5];let l=c;if(o!==`bot`){let e;t[6]===l?e=t[7]:(e={color:l},t[6]=l,t[7]=e);let n;return t[8]!==o||t[9]!==e?(n=(0,Z.jsx)(xv,{icon:o,width:14,height:14,className:`shrink-0`,style:e}),t[8]=o,t[9]=e,t[10]=n):n=t[10],n}if(e.name===`File System`){let e;return t[11]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(Bd,{className:`size-3.5 shrink-0 text-muted-foreground`}),t[11]=e):e=t[11],e}if(e.name===`OpenKnowledge (service)`||e.name===`Git (upstream)`){let e;return t[12]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(bi,{className:`size-3.5 shrink-0 text-muted-foreground`}),t[12]=e):e=t[12],e}let u;return t[13]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Z.jsx)(If,{className:`size-3.5 shrink-0 text-muted-foreground`}),t[13]=u):u=t[13],u}if(n.authorEmail.includes(`agent`)||n.author.includes(`agent`)||n.authorEmail.includes(`cursor`)||n.authorEmail.includes(`claude`)){let e;return t[14]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(ns,{className:`size-3.5 shrink-0 text-muted-foreground`}),t[14]=e):e=t[14],e}if(n.author===`openknowledge-server`||n.author===`server`){let e;return t[15]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(bi,{className:`size-3.5 shrink-0 text-muted-foreground`}),t[15]=e):e=t[15],e}let i;return t[16]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsx)(If,{className:`size-3.5 shrink-0 text-muted-foreground`}),t[16]=i):i=t[16],i}function Cv(e){let t=[];for(let n of e.contributors)if(n.summaries)for(let e of n.summaries)t.push(e);return t}function wv(e){let t=(0,$.c)(21),{summaries:n}=e,[r,i]=(0,Q.useState)(!1),a=(0,Q.useId)();if(n.length===0)return null;let o,s;t[0]===n?(o=t[1],s=t[2]):([o,...s]=n,t[0]=n,t[1]=o,t[2]=s);let c=s.length,l;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Z.jsx)(`span`,{"aria-hidden":`true`,children:`• `}),t[3]=l):l=t[3];let u;t[4]===o?u=t[5]:(u=(0,Z.jsxs)(`li`,{className:`text-xs text-foreground/90`,children:[l,o]}),t[4]=o,t[5]=u);let d;t[6]!==r||t[7]!==s?(d=r&&s.map(Ev),t[6]=r,t[7]=s,t[8]=d):d=t[8];let f;t[9]!==a||t[10]!==u||t[11]!==d?(f=(0,Z.jsxs)(`ul`,{id:a,className:`list-none`,children:[u,d]}),t[9]=a,t[10]=u,t[11]=d,t[12]=f):f=t[12];let p;t[13]!==r||t[14]!==c||t[15]!==a||t[16]!==s.length?(p=s.length>0&&(0,Z.jsxs)(`button`,{type:`button`,"aria-expanded":r,"aria-controls":a,className:`inline-flex items-center gap-1 text-xs text-muted-foreground hover:text-foreground transition-colors cursor-pointer`,onClick:e=>{e.stopPropagation(),i(Tv)},children:[r?(0,Z.jsx)(Wi,{className:`size-3`}):(0,Z.jsx)(Ki,{className:`size-3`}),r?(0,Z.jsx)(J,{id:`vLyv1R`}):(0,Z.jsx)(J,{id:`ZptNUh`,values:{hidden:c}})]}),t[13]=r,t[14]=c,t[15]=a,t[16]=s.length,t[17]=p):p=t[17];let m;return t[18]!==f||t[19]!==p?(m=(0,Z.jsxs)(`div`,{className:`mt-0.5`,children:[f,p]}),t[18]=f,t[19]=p,t[20]=m):m=t[20],m}function Tv(e){return!e}function Ev(e,t){return(0,Z.jsxs)(`li`,{className:`text-xs text-foreground/90`,children:[(0,Z.jsx)(`span`,{"aria-hidden":`true`,children:`• `}),e]},`${t}-${e}`)}function Dv(e){let t=(0,$.c)(13),{sha:n,docName:r,cache:i,diffLayout:a,panelId:o}=e,s=fv(n,r,i),c;t[0]===s.status?c=t[1]:(c=s.status===`loading`&&(0,Z.jsxs)(`div`,{className:`flex items-center gap-2 py-2 text-xs text-muted-foreground`,children:[(0,Z.jsx)($o,{className:`size-3 animate-spin`}),(0,Z.jsx)(J,{id:`38foVZ`})]}),t[0]=s.status,t[1]=c);let l;t[2]===s.status?l=t[3]:(l=s.status===`error`&&(0,Z.jsx)(`p`,{className:`py-2 text-xs text-destructive`,children:(0,Z.jsx)(J,{id:`vvWZnu`})}),t[2]=s.status,t[3]=l);let u;t[4]!==a||t[5]!==s.diff||t[6]!==s.status?(u=s.status===`ready`&&(0,Z.jsx)(Q.Suspense,{fallback:(0,Z.jsxs)(`div`,{className:`flex items-center gap-2 py-2 text-xs text-muted-foreground`,children:[(0,Z.jsx)($o,{className:`size-3 animate-spin`}),(0,Z.jsx)(J,{id:`EDm3wJ`})]}),children:(0,Z.jsx)(pv,{diff:s.diff,viewType:a})}),t[4]=a,t[5]=s.diff,t[6]=s.status,t[7]=u):u=t[7];let d;return t[8]!==o||t[9]!==c||t[10]!==l||t[11]!==u?(d=(0,Z.jsxs)(`div`,{id:o,className:`px-3 pb-2`,"data-testid":`timeline-entry-diff`,children:[c,l,u]}),t[8]=o,t[9]=c,t[10]=l,t[11]=u,t[12]=d):d=t[12],d}function Ov(e){let t=(0,$.c)(127),{entry:n,isDark:r,diffLayout:i,cache:a,docName:o,expanded:s,onToggleExpanded:c,onRestoreSuccess:l}=e,{_:u}=$t(),d;t[0]===n.timestamp?d=t[1]:(d=_v(n.timestamp),t[0]=n.timestamp,t[1]=d);let f=d,p;t[2]===n?p=t[3]:(p=bv(n),t[2]=n,t[3]=p);let m=p,h;t[4]===n.timestamp?h=t[5]:(h=vv(n.timestamp),t[4]=n.timestamp,t[5]=h);let g=h,_;t[6]===n.sha?_=t[7]:(_=yv(n.sha),t[6]=n.sha,t[7]=_);let v=_,y=n.contributors.flatMap(kv),b;t[8]===n?b=t[9]:(b=Cv(n),t[8]=n,t[9]=b);let x=b,[S,C]=(0,Q.useState)(!1),[w,T]=(0,Q.useState)(!1),E=(0,Q.useRef)(null),D=(0,Q.useId)(),O,k;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(O=()=>()=>E.current?.abort(),k=[],t[10]=O,t[11]=k):(O=t[10],k=t[11]),(0,Q.useEffect)(O,k);let A;t[12]!==n.sha||t[13]!==c?(A=()=>c(n.sha),t[12]=n.sha,t[13]=c,t[14]=A):A=t[14];let j=A,M;t[15]===C?M=t[16]:(M=function(){E.current?.abort(),E.current=null,T(!1),C(!1)},t[15]=C,t[16]=M);let N=M,P;t[17]!==u||t[18]!==o||t[19]!==n.sha||t[20]!==l||t[21]!==C?(P=async function(){T(!0);let e=new AbortController;E.current=e;let t=function(){e.signal.aborted||T(!1),E.current===e&&(E.current=null)},r;try{r=await fetch(`/api/rollback`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({docName:o,commitSha:n.sha}),signal:e.signal})}catch(r){let i=r;!e.signal.aborted&&!(i instanceof DOMException&&i.name===`AbortError`)&&(console.error(`[timeline] rollback fetch failed`,{docName:o,sha:n.sha,err:i}),hs.error(u({id:`NkXEFS`}),{duration:4e3})),t();return}if(e.signal.aborted){t();return}if(r.ok)C(!1),l();else{let e=`HTTP ${r.status}`;try{let t=ni.safeParse(await r.json());t.success&&(e=t.data.title)}catch{}console.error(`[timeline] rollback failed`,{docName:o,sha:n.sha,status:r.status,detail:e}),hs.error(u({id:`uM6jnS`}),{description:e,duration:6e3})}t()},t[17]=u,t[18]=o,t[19]=n.sha,t[20]=l,t[21]=C,t[22]=P):P=t[22];let F=P,I;t[23]!==n||t[24]!==r?(I=(0,Z.jsx)(Sv,{entry:n,isDark:r}),t[23]=n,t[24]=r,t[25]=I):I=t[25];let L=I,R=s?D:void 0,z=s?`bg-muted`:`hover:bg-muted/80`,B;t[26]===z?B=t[27]:(B=[`group flex w-full items-start gap-2.5 rounded-lg px-3 py-2.5 text-left transition-colors cursor-pointer outline-none focus-visible:ring-2 focus-visible:ring-ring`,z],t[26]=z,t[27]=B);let V=B.join(` `),H;t[28]===j?H=t[29]:(H=e=>{e.target===e.currentTarget&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),j())},t[28]=j,t[29]=H);let U;t[30]===L?U=t[31]:(U=(0,Z.jsx)(`span`,{className:`mt-0.5 shrink-0`,children:L}),t[30]=L,t[31]=U);let W;t[32]===m?W=t[33]:(W=(0,Z.jsx)(`span`,{className:`truncate text-xs text-foreground`,children:m}),t[32]=m,t[33]=W);let G;t[34]!==n.timestamp||t[35]!==f?(G=(0,Z.jsx)(`time`,{className:`ml-auto shrink-0 text-xs text-muted-foreground/80`,dateTime:n.timestamp,title:n.timestamp,children:f}),t[34]=n.timestamp,t[35]=f,t[36]=G):G=t[36];let K;t[37]===Symbol.for(`react.memo_cache_sentinel`)?(K=(0,Z.jsx)(`span`,{"aria-hidden":`true`,className:`h-3 w-px shrink-0 bg-border`}),t[37]=K):K=t[37];let ee;t[38]===u?ee=t[39]:(ee=u({id:`Yea-K5`}),t[38]=u,t[39]=ee);let te;t[40]===C?te=t[41]:(te=e=>{e.stopPropagation(),C(!0)},t[40]=C,t[41]=te);let ne;t[42]===w?ne=t[43]:(ne=w?(0,Z.jsx)($o,{className:`size-3 animate-spin`}):(0,Z.jsx)(cs,{className:`size-3`}),t[42]=w,t[43]=ne);let re;t[44]!==w||t[45]!==ee||t[46]!==te||t[47]!==ne?(re=(0,Z.jsx)(Ts,{asChild:!0,children:(0,Z.jsx)(X,{variant:`ghost`,size:`icon`,className:`size-5 shrink-0 text-muted-foreground hover:text-destructive`,"data-testid":`timeline-entry-restore`,"aria-label":ee,disabled:w,onClick:te,children:ne})}),t[44]=w,t[45]=ee,t[46]=te,t[47]=ne,t[48]=re):re=t[48];let ie;t[49]===u?ie=t[50]:(ie=u({id:`Yea-K5`}),t[49]=u,t[50]=ie);let ae;t[51]===ie?ae=t[52]:(ae=(0,Z.jsx)(Es,{side:`top`,children:ie}),t[51]=ie,t[52]=ae);let oe;t[53]!==re||t[54]!==ae?(oe=(0,Z.jsxs)(Os,{children:[re,ae]}),t[53]=re,t[54]=ae,t[55]=oe):oe=t[55];let se;t[56]!==W||t[57]!==G||t[58]!==oe?(se=(0,Z.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[W,G,K,oe]}),t[56]=W,t[57]=G,t[58]=oe,t[59]=se):se=t[59];let ce;t[60]===x?ce=t[61]:(ce=x.length>0&&(0,Z.jsx)(wv,{summaries:x}),t[60]=x,t[61]=ce);let le=y.length>0?(0,Z.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,title:y.join(`, `),children:y.join(`, `)}):(0,Z.jsx)(`p`,{className:`truncate text-xs text-muted-foreground`,title:n.message,children:n.message}),q;t[62]!==se||t[63]!==ce||t[64]!==le?(q=(0,Z.jsxs)(`div`,{className:`min-w-0 flex-1 space-y-0.5`,children:[se,ce,le]}),t[62]=se,t[63]=ce,t[64]=le,t[65]=q):q=t[65];let ue;t[66]!==s||t[67]!==j||t[68]!==R||t[69]!==V||t[70]!==H||t[71]!==U||t[72]!==q?(ue=(0,Z.jsxs)(`div`,{role:`button`,tabIndex:0,"aria-expanded":s,"aria-controls":R,"data-testid":`timeline-entry-expand`,className:V,onClick:j,onKeyDown:H,children:[U,q]}),t[66]=s,t[67]=j,t[68]=R,t[69]=V,t[70]=H,t[71]=U,t[72]=q,t[73]=ue):ue=t[73];let de;t[74]!==a||t[75]!==i||t[76]!==D||t[77]!==o||t[78]!==n.sha||t[79]!==s?(de=s&&(0,Z.jsx)(Dv,{sha:n.sha,docName:o,cache:a,diffLayout:i,panelId:D}),t[74]=a,t[75]=i,t[76]=D,t[77]=o,t[78]=n.sha,t[79]=s,t[80]=de):de=t[80];let fe;t[81]!==ue||t[82]!==de?(fe=(0,Z.jsxs)(`div`,{className:`flex flex-col rounded-lg`,children:[ue,de]}),t[81]=ue,t[82]=de,t[83]=fe):fe=t[83];let pe;t[84]!==N||t[85]!==C?(pe=e=>{e?C(!0):N()},t[84]=N,t[85]=C,t[86]=pe):pe=t[86];let me;t[87]===u?me=t[88]:(me=u({id:`Pyp1NA`}),t[87]=u,t[88]=me);let he;t[89]===me?he=t[90]:(he=(0,Z.jsx)(Ws,{children:me}),t[89]=me,t[90]=he);let ge;t[91]!==g||t[92]!==m||t[93]!==v||t[94]!==f?(ge={relative:f,absoluteTime:g,entrySha:v,authorName:m},t[91]=g,t[92]=m,t[93]=v,t[94]=f,t[95]=ge):ge=t[95];let _e;t[96]===Symbol.for(`react.memo_cache_sentinel`)?(_e={0:(0,Z.jsx)(`span`,{className:`font-medium text-foreground`}),1:(0,Z.jsx)(`span`,{className:`font-medium text-foreground`})},t[96]=_e):_e=t[96];let ve;t[97]===ge?ve=t[98]:(ve=(0,Z.jsx)(Us,{children:(0,Z.jsx)(J,{id:`h6EvY-`,values:ge,components:_e})}),t[97]=ge,t[98]=ve);let ye;t[99]!==he||t[100]!==ve?(ye=(0,Z.jsxs)(Js,{children:[he,ve]}),t[99]=he,t[100]=ve,t[101]=ye):ye=t[101];let be;t[102]===Symbol.for(`react.memo_cache_sentinel`)?(be=(0,Z.jsx)(J,{id:`dEgA5A`}),t[102]=be):be=t[102];let xe;t[103]===N?xe=t[104]:(xe=(0,Z.jsx)(X,{variant:`outline`,"data-testid":`timeline-entry-restore-cancel`,onClick:N,children:be}),t[103]=N,t[104]=xe);let Se;t[105]===F?Se=t[106]:(Se=()=>F(),t[105]=F,t[106]=Se);let Ce;t[107]===w?Ce=t[108]:(Ce=w?(0,Z.jsx)($o,{className:`mr-2 size-4 animate-spin`}):null,t[107]=w,t[108]=Ce);let we;t[109]===Symbol.for(`react.memo_cache_sentinel`)?(we=(0,Z.jsx)(J,{id:`yKu_3Y`}),t[109]=we):we=t[109];let Te;t[110]!==w||t[111]!==Se||t[112]!==Ce?(Te=(0,Z.jsxs)(X,{variant:`destructive`,"data-testid":`timeline-entry-restore-confirm`,disabled:w,onClick:Se,children:[Ce,we]}),t[110]=w,t[111]=Se,t[112]=Ce,t[113]=Te):Te=t[113];let Ee;t[114]!==xe||t[115]!==Te?(Ee=(0,Z.jsxs)(qs,{children:[xe,Te]}),t[114]=xe,t[115]=Te,t[116]=Ee):Ee=t[116];let De;t[117]!==ye||t[118]!==Ee?(De=(0,Z.jsxs)(Gs,{children:[ye,Ee]}),t[117]=ye,t[118]=Ee,t[119]=De):De=t[119];let Oe;t[120]!==S||t[121]!==pe||t[122]!==De?(Oe=(0,Z.jsx)(Ys,{open:S,onOpenChange:pe,children:De}),t[120]=S,t[121]=pe,t[122]=De,t[123]=Oe):Oe=t[123];let ke;return t[124]!==fe||t[125]!==Oe?(ke=(0,Z.jsxs)(Z.Fragment,{children:[fe,Oe]}),t[124]=fe,t[125]=Oe,t[126]=ke):ke=t[126],ke}function kv(e){return e.docs}function Av(e){let t=(0,$.c)(46),{docName:n,diffLayout:r,onDiffLayoutChange:i}=e,{_:a}=$t(),{resolvedTheme:o}=Mn(),s=o===`dark`,c;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(c=[],t[0]=c):c=t[0];let[l,u]=(0,Q.useState)(c),[d,f]=(0,Q.useState)(!1),[p,m]=(0,Q.useState)(null),[h]=(0,Q.useState)(Pv),[g,_]=(0,Q.useState)(Nv),v;t[1]===h?v=t[2]:(v=()=>{_(new Set),h.clear()},t[1]=h,t[2]=v);let y;t[3]===n?y=t[4]:(y=[n],t[3]=n,t[4]=y),(0,Q.useEffect)(v,y);let b;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(b=function(e){_(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},t[5]=b):b=t[5];let x=b,S;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(S=function(){_(new Set)},t[6]=S):S=t[6];let C=S,w,T;t[7]!==a||t[8]!==n?(w=()=>{if(!n){u([]);return}f(!0);let e=I_({baseMs:mv,maxBackoffMs:hv,isPaused:Mv,poll:e=>gv(n,e,{setEntries:u,setError:m,setLoading:f,unavailableMessage:a({id:`brCtGB`})})});e.start();let t=()=>e.resume();return typeof document<`u`&&document.addEventListener(`visibilitychange`,t),()=>{e.stop(),typeof document<`u`&&document.removeEventListener(`visibilitychange`,t)}},T=[n,a],t[7]=a,t[8]=n,t[9]=w,t[10]=T):(w=t[9],T=t[10]),(0,Q.useEffect)(w,T);let E=!d&&!p&&l.length>0,D;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,Z.jsx)(Tn,{children:(0,Z.jsx)(J,{id:`cklVjM`})}),t[11]=D):D=t[11];let O;t[12]!==a||t[13]!==r||t[14]!==E||t[15]!==i?(O=E&&(0,Z.jsxs)(Os,{children:[(0,Z.jsx)(Ts,{asChild:!0,children:(0,Z.jsxs)(Lc,{type:`single`,value:r,onValueChange:e=>{e&&i(e)},"aria-label":a({id:`XvPJaT`}),variant:`segmented`,size:`sm`,spacing:1,className:`bg-muted dark:bg-background p-0.5 rounded-md shrink-0`,children:[(0,Z.jsx)(Fc,{value:`unified`,"aria-label":a({id:`379t2h`}),className:`size-6 px-0`,children:(0,Z.jsx)(hf,{className:`size-3.5`})}),(0,Z.jsx)(Fc,{value:`split`,"aria-label":a({id:`HXFyWD`}),className:`size-6 px-0`,children:(0,Z.jsx)(wd,{className:`size-3.5`})})]})}),(0,Z.jsx)(Es,{children:r===`unified`?(0,Z.jsx)(J,{id:`379t2h`}):(0,Z.jsx)(J,{id:`HXFyWD`})})]}),t[12]=a,t[13]=r,t[14]=E,t[15]=i,t[16]=O):O=t[16];let k;t[17]===O?k=t[18]:(k=(0,Z.jsxs)(Sn,{children:[D,O]}),t[17]=O,t[18]=k);let A;t[19]!==a||t[20]!==d?(A=d&&(0,Z.jsx)(`div`,{className:`flex flex-col gap-1 p-2`,role:`status`,"aria-busy":`true`,"aria-label":a({id:`o49mDZ`}),children:[1,2,3].map(jv)}),t[19]=a,t[20]=d,t[21]=A):A=t[21];let j;t[22]!==p||t[23]!==d?(j=!d&&p&&(0,Z.jsx)(`div`,{className:`px-4 py-3`,children:(0,Z.jsx)(`p`,{className:`text-xs text-destructive`,children:p})}),t[22]=p,t[23]=d,t[24]=j):j=t[24];let M;t[25]!==l||t[26]!==p||t[27]!==d?(M=!d&&!p&&l.length===0&&(0,Z.jsx)(`div`,{className:`px-4 py-8 text-center`,children:(0,Z.jsx)(`p`,{className:`text-xs text-muted-foreground`,children:(0,Z.jsx)(J,{id:`Ta25TG`})})}),t[25]=l,t[26]=p,t[27]=d,t[28]=M):M=t[28];let N;t[29]!==h||t[30]!==r||t[31]!==n||t[32]!==l||t[33]!==p||t[34]!==g||t[35]!==s||t[36]!==d?(N=!d&&!p&&l.length>0&&(0,Z.jsx)(`div`,{className:`flex flex-col gap-1 p-2`,children:l.map(e=>(0,Z.jsx)(Ov,{entry:e,isDark:s,diffLayout:r,cache:h,docName:n,expanded:g.has(e.sha),onToggleExpanded:x,onRestoreSuccess:C},e.sha))}),t[29]=h,t[30]=r,t[31]=n,t[32]=l,t[33]=p,t[34]=g,t[35]=s,t[36]=d,t[37]=N):N=t[37];let P;t[38]!==A||t[39]!==j||t[40]!==M||t[41]!==N?(P=(0,Z.jsxs)(`div`,{className:`flex-1 overflow-y-auto subtle-scrollbar scroll-fade-mask`,children:[A,j,M,N]}),t[38]=A,t[39]=j,t[40]=M,t[41]=N,t[42]=P):P=t[42];let F;return t[43]!==k||t[44]!==P?(F=(0,Z.jsxs)(`div`,{className:`flex h-full flex-col`,children:[k,P]}),t[43]=k,t[44]=P,t[45]=F):F=t[45],F}function jv(e){return(0,Z.jsxs)(`div`,{className:`flex items-start gap-2.5 rounded-lg px-3 py-2.5`,children:[(0,Z.jsx)(Ba,{className:`size-3.5 rounded mt-0.5 shrink-0`}),(0,Z.jsxs)(`div`,{className:`flex-1 space-y-1.5`,children:[(0,Z.jsx)(Ba,{className:`h-3 w-28`}),(0,Z.jsx)(Ba,{className:`h-3 w-40`})]})]},e)}function Mv(){return typeof document<`u`&&document.visibilityState===`hidden`}function Nv(){return new Set}function Pv(){return new ls(32)}var Fv=[{id:`outline`,icon:Yd},{id:`links`,icon:ge},{id:`graph`,icon:$d},{id:`timeline`,icon:Cd}];function Iv(e){return e===`outline`?Wc._({id:`dD7NPy`}):e===`links`?Wc._({id:`Rj01Fz`}):e===`graph`?Wc._({id:`x2fr_j`}):Wc._({id:`cklVjM`})}function Lv(){return n(()=>import(`./GraphPanel-Cf9lwwnw.js`),__vite__mapDeps([9,1,10,3,11,12,6,7,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38]),import.meta.url)}var Rv=(0,Q.lazy)(async()=>({default:(await Lv()).GraphPanel})),zv=(0,Q.lazy)(async()=>({default:(await n(()=>import(`./ActivityModeContent-mJH5LtOR.js`),__vite__mapDeps([39,1,2,40,41,42,11,43,44,45,46,47,48,49,50,15,16,13,7,17,18,10,3,51,52,36,12,6,4,53,54,55,20,56,57,58,59,31,32,33,34,60,61,62,63,35,64,65,66,67,68]),import.meta.url)).ActivityModeContent}));function Bv(e){let t=(0,$.c)(18),{docName:n,isSourceMode:r,activeTab:i,onActiveTabChange:a,mode:o}=e,{_:s}=$t(),[c,l]=(0,Q.useState)(`unified`),u=sg(),d,f,p;if(t[0]!==s||t[1]!==i||t[2]!==o||t[3]!==a||t[4]!==u){let e=u?Fv.filter(Hv):Fv;d=e.some(e=>e.id===i)?i:`outline`,f=o===`doc`&&e.length>1,p=f?(0,Z.jsx)(`div`,{className:`flex flex-row items-center justify-center gap-3 p-2`,children:(0,Z.jsx)(Lc,{type:`single`,variant:`outline`,value:d,onValueChange:e=>{e&&a(e)},"aria-label":s({id:`SrOuyg`}),children:e.map(Vv)})}):null,t[0]=s,t[1]=i,t[2]=o,t[3]=a,t[4]=u,t[5]=d,t[6]=f,t[7]=p}else d=t[5],f=t[6],p=t[7];let m;t[8]!==c||t[9]!==n||t[10]!==d||t[11]!==r||t[12]!==o||t[13]!==f?(m=o===`doc`?(0,Z.jsxs)(`div`,{...f?{role:`tabpanel`,id:`panel-${d}`,"aria-labelledby":`tab-${d}`}:{},className:`min-h-0 flex-1`,children:[d===`outline`&&(0,Z.jsx)(au,{docName:n,isSourceMode:r}),d===`links`&&(0,Z.jsx)(F_,{docName:n}),d===`graph`&&(0,Z.jsx)(Q.Suspense,{fallback:(0,Z.jsx)(`div`,{className:`flex h-full items-center justify-center text-sm text-muted-foreground`,children:(0,Z.jsx)(J,{id:`-lCAuQ`})}),children:(0,Z.jsx)(Rv,{activeDocName:n})}),d===`timeline`&&(0,Z.jsx)(Av,{docName:n,diffLayout:c,onDiffLayoutChange:l})]}):(0,Z.jsx)(`div`,{className:`min-h-0 flex-1`,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)(zv,{})})}),t[8]=c,t[9]=n,t[10]=d,t[11]=r,t[12]=o,t[13]=f,t[14]=m):m=t[14];let h;return t[15]!==p||t[16]!==m?(h=(0,Z.jsxs)(Z.Fragment,{children:[p,m]}),t[15]=p,t[16]=m,t[17]=h):h=t[17],h}function Vv(e){let{id:t,icon:n}=e,r=Iv(t);return(0,Z.jsxs)(Os,{children:[(0,Z.jsx)(Fc,{value:t,role:`tab`,id:`tab-${t}`,"aria-controls":`panel-${t}`,"aria-label":r,asChild:!0,children:(0,Z.jsx)(Ts,{children:(0,Z.jsx)(n,{})})}),(0,Z.jsx)(Es,{side:`bottom`,children:r})]},t)}function Hv(e){return e.id===`outline`}function Uv(e,t){let n=getComputedStyle(e);return t*parseFloat(n.fontSize)}function Wv(e,t){let n=getComputedStyle(e.ownerDocument.body);return t*parseFloat(n.fontSize)}function Gv(e){return e/100*window.innerHeight}function Kv(e){return e/100*window.innerWidth}function qv(e){switch(typeof e){case`number`:return[e,`px`];case`string`:{let t=parseFloat(e);return e.endsWith(`%`)?[t,`%`]:e.endsWith(`px`)?[t,`px`]:e.endsWith(`rem`)?[t,`rem`]:e.endsWith(`em`)?[t,`em`]:e.endsWith(`vh`)?[t,`vh`]:e.endsWith(`vw`)?[t,`vw`]:[t,`%`]}}}function Jv({groupSize:e,panelElement:t,styleProp:n}){let r,[i,a]=qv(n);switch(a){case`%`:r=i/100*e;break;case`px`:r=i;break;case`rem`:r=Wv(t,i);break;case`em`:r=Uv(t,i);break;case`vh`:r=Gv(i);break;case`vw`:r=Kv(i);break}return r}function Yv(e){return parseFloat(e.toFixed(3))}function Xv({group:e}){let{orientation:t,panels:n}=e;return n.reduce((e,n)=>(e+=t===`horizontal`?n.element.offsetWidth:n.element.offsetHeight,e),0)}function Zv(e){let{panels:t}=e,n=Xv({group:e});return n===0?t.map(e=>({groupResizeBehavior:e.panelConstraints.groupResizeBehavior,collapsedSize:0,collapsible:e.panelConstraints.collapsible===!0,defaultSize:void 0,disabled:e.panelConstraints.disabled,minSize:0,maxSize:100,panelId:e.id})):t.map(e=>{let{element:t,panelConstraints:r}=e,i=0;r.collapsedSize!==void 0&&(i=Yv(Jv({groupSize:n,panelElement:t,styleProp:r.collapsedSize})/n*100));let a;r.defaultSize!==void 0&&(a=Yv(Jv({groupSize:n,panelElement:t,styleProp:r.defaultSize})/n*100));let o=0;r.minSize!==void 0&&(o=Yv(Jv({groupSize:n,panelElement:t,styleProp:r.minSize})/n*100));let s=100;return r.maxSize!==void 0&&(s=Yv(Jv({groupSize:n,panelElement:t,styleProp:r.maxSize})/n*100)),{groupResizeBehavior:r.groupResizeBehavior,collapsedSize:i,collapsible:r.collapsible===!0,defaultSize:a,disabled:r.disabled,minSize:o,maxSize:s,panelId:e.id}})}function Qv(e,t=`Assertion error`){if(!e)throw Error(t)}function $v(e,t){return Array.from(t).sort(e===`horizontal`?ey:ty)}function ey(e,t){let n=e.element.offsetLeft-t.element.offsetLeft;return n===0?e.element.offsetWidth-t.element.offsetWidth:n}function ty(e,t){let n=e.element.offsetTop-t.element.offsetTop;return n===0?e.element.offsetHeight-t.element.offsetHeight:n}function ny(e){return typeof e==`object`&&!!e&&`nodeType`in e&&e.nodeType===Node.ELEMENT_NODE}function ry(e,t){return{x:e.x>=t.left&&e.x<=t.right?0:Math.min(Math.abs(e.x-t.left),Math.abs(e.x-t.right)),y:e.y>=t.top&&e.y<=t.bottom?0:Math.min(Math.abs(e.y-t.top),Math.abs(e.y-t.bottom))}}function iy({orientation:e,rects:t,targetRect:n}){let r={x:n.x+n.width/2,y:n.y+n.height/2},i,a=Number.MAX_VALUE;for(let n of t){let{x:t,y:o}=ry(r,n),s=e===`horizontal`?t:o;s<a&&(a=s,i=n)}return Qv(i,`No rect found`),i}var ay;function oy(){return ay===void 0&&(ay=typeof matchMedia==`function`?!!matchMedia(`(pointer:coarse)`).matches:!1),ay}function sy(e){let{element:t,orientation:n,panels:r,separators:i}=e,a=$v(n,Array.from(t.children).filter(ny).map(e=>({element:e}))).map(({element:e})=>e),o=[],s=!1,c=!1,l=-1,u=-1,d=0,f,p=[];{let e=-1;for(let t of a)t.hasAttribute(`data-panel`)&&(e++,t.hasAttribute(`data-disabled`)||(d++,l===-1&&(l=e),u=e))}if(d>1){let t=-1;for(let d of a)if(d.hasAttribute(`data-panel`)){t++;let i=r.find(e=>e.element===d);if(i){if(f){let r=f.element.getBoundingClientRect(),a=d.getBoundingClientRect(),m;if(c){let e=n===`horizontal`?new DOMRect(r.right,r.top,0,r.height):new DOMRect(r.left,r.bottom,r.width,0),t=n===`horizontal`?new DOMRect(a.left,a.top,0,a.height):new DOMRect(a.left,a.top,a.width,0);switch(p.length){case 0:m=[e,t];break;case 1:{let i=p[0];m=[i,iy({orientation:n,rects:[r,a],targetRect:i.element.getBoundingClientRect()})===r?t:e];break}default:m=p;break}}else m=p.length?p:[n===`horizontal`?new DOMRect(r.right,a.top,a.left-r.right,a.height):new DOMRect(a.left,r.bottom,a.width,a.top-r.bottom)];for(let n of m){let r=`width`in n?n:n.element.getBoundingClientRect(),a=oy()?e.resizeTargetMinimumSize.coarse:e.resizeTargetMinimumSize.fine;if(r.width<a){let e=a-r.width;r=new DOMRect(r.x-e/2,r.y,r.width+e,r.height)}if(r.height<a){let e=a-r.height;r=new DOMRect(r.x,r.y-e/2,r.width,r.height+e)}!s&&!(t<=l||t>u)&&o.push({group:e,groupSize:Xv({group:e}),panels:[f,i],separator:`width`in n?void 0:n,rect:r}),s=!1}}c=!1,f=i,p=[]}}else if(d.hasAttribute(`data-separator`)){d.ariaDisabled!==null&&(s=!0);let e=i.find(e=>e.element===d);e?p.push(e):(f=void 0,p=[])}else c=!0}return o}var cy=class{#e={};addListener(e,t){let n=this.#e[e];return n===void 0?this.#e[e]=[t]:n.includes(t)||n.push(t),()=>{this.removeListener(e,t)}}emit(e,t){let n=this.#e[e];if(n!==void 0)if(n.length===1)n[0].call(null,t);else{let e=!1,r=null,i=Array.from(n);for(let n=0;n<i.length;n++){let a=i[n];try{a.call(null,t)}catch(t){r===null&&(e=!0,r=t)}}if(e)throw r}}removeAllListeners(){this.#e={}}removeListener(e,t){let n=this.#e[e];if(n!==void 0){let e=n.indexOf(t);e>=0&&n.splice(e,1)}}},ly=new Map,uy=new cy;function dy(e){ly=new Map(ly),ly.delete(e)}function fy(e,t){for(let[t]of ly)if(t.id===e)return t}function py(e,t){for(let[t,n]of ly)if(t.id===e)return n;if(t)throw Error(`Could not find data for Group with id ${e}`)}function my(){return ly}function hy(e,t){return uy.addListener(`groupChange`,n=>{n.group.id===e&&t(n)})}function gy(e,t){let n=ly.get(e);ly=new Map(ly),ly.set(e,t),uy.emit(`groupChange`,{group:e,prev:n,next:t})}function _y(e,t,n){let r,i={x:1/0,y:1/0};for(let a of t){let t=ry(n,a.rect);switch(e){case`horizontal`:t.x<=i.x&&(r=a,i=t);break;case`vertical`:t.y<=i.y&&(r=a,i=t);break}}return r?{distance:i,hitRegion:r}:void 0}function vy(e){return typeof e==`object`&&!!e&&`nodeType`in e&&e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function yy(e,t){if(e===t)throw Error(`Cannot compare node with itself`);let n={a:Ty(e),b:Ty(t)},r;for(;n.a.at(-1)===n.b.at(-1);)r=n.a.pop(),n.b.pop();Qv(r,`Stacking order can only be calculated for elements with a common ancestor`);let i={a:wy(Cy(n.a)),b:wy(Cy(n.b))};if(i.a===i.b){let e=r.childNodes,t={a:n.a.at(-1),b:n.b.at(-1)},i=e.length;for(;i--;){let n=e[i];if(n===t.a)return 1;if(n===t.b)return-1}}return Math.sign(i.a-i.b)}var by=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function xy(e){let t=getComputedStyle(Ey(e)??e).display;return t===`flex`||t===`inline-flex`}function Sy(e){let t=getComputedStyle(e);return!!(t.position===`fixed`||t.zIndex!==`auto`&&(t.position!==`static`||xy(e))||+t.opacity<1||`transform`in t&&t.transform!==`none`||`webkitTransform`in t&&t.webkitTransform!==`none`||`mixBlendMode`in t&&t.mixBlendMode!==`normal`||`filter`in t&&t.filter!==`none`||`webkitFilter`in t&&t.webkitFilter!==`none`||`isolation`in t&&t.isolation===`isolate`||by.test(t.willChange)||t.webkitOverflowScrolling===`touch`)}function Cy(e){let t=e.length;for(;t--;){let n=e[t];if(Qv(n,`Missing node`),Sy(n))return n}return null}function wy(e){return e&&Number(getComputedStyle(e).zIndex)||0}function Ty(e){let t=[];for(;e;)t.push(e),e=Ey(e);return t}function Ey(e){let{parentNode:t}=e;return vy(t)?t.host:t}function Dy(e,t){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function Oy({groupElement:e,hitRegion:t,pointerEventTarget:n}){if(!ny(n)||n.contains(e)||e.contains(n))return!0;if(yy(n,e)>0){let r=n;for(;r;){if(r.contains(e))return!0;if(Dy(r.getBoundingClientRect(),t))return!1;r=r.parentElement}}return!0}function ky(e,t){let n=[];return t.forEach((t,r)=>{if(r.disabled)return;let i=sy(r),a=_y(r.orientation,i,{x:e.clientX,y:e.clientY});a&&a.distance.x<=0&&a.distance.y<=0&&Oy({groupElement:r.element,hitRegion:a.hitRegion.rect,pointerEventTarget:e.target})&&n.push(a.hitRegion)}),n}function Ay(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!=t[n])return!1;return!0}function jy(e,t,n=0){return Math.abs(Yv(e)-Yv(t))<=n}function My(e,t){return jy(e,t)?0:e>t?1:-1}function Ny({overrideDisabledPanels:e,panelConstraints:t,prevSize:n,size:r}){let{collapsedSize:i=0,collapsible:a,disabled:o,maxSize:s=100,minSize:c=0}=t;if(o&&!e)return n;if(My(r,c)<0)if(a){let e=(i+c)/2;r=My(r,e)<0?i:c}else r=c;return r=Math.min(s,r),r=Yv(r),r}function Py({delta:e,initialLayout:t,panelConstraints:n,pivotIndices:r,prevLayout:i,trigger:a}){if(jy(e,0))return t;let o=a===`imperative-api`,s=Object.values(t),c=Object.values(i),l=[...s],[u,d]=r;Qv(u!=null,`Invalid first pivot index`),Qv(d!=null,`Invalid second pivot index`);let f=0;switch(a){case`keyboard`:{let t=e<0?d:u,r=n[t];Qv(r,`Panel constraints not found for index ${t}`);let{collapsedSize:i=0,collapsible:a,minSize:o=0}=r;if(a){let n=s[t];if(Qv(n!=null,`Previous layout not found for panel index ${t}`),jy(n,i)){let t=o-n;My(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}{let t=e<0?u:d,r=n[t];Qv(r,`No panel constraints found for index ${t}`);let{collapsedSize:i=0,collapsible:a,minSize:o=0}=r;if(a){let n=s[t];if(Qv(n!=null,`Previous layout not found for panel index ${t}`),jy(n,o)){let t=n-i;My(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}break;default:{let t=e<0?d:u,r=n[t];Qv(r,`Panel constraints not found for index ${t}`);let i=s[t],{collapsible:a,collapsedSize:o,minSize:c}=r;if(a&&My(i,c)<0)if(e>0){let t=c-o,n=t/2;My(i+e,c)<0&&(e=My(e,n)<=0?0:t)}else{let t=c-o,n=100-t/2;My(i-e,c)<0&&(e=My(100+e,n)>0?0:-t)}break}}{let t=e<0?1:-1,r=e<0?d:u,i=0;for(;;){let e=s[r];Qv(e!=null,`Previous layout not found for panel index ${r}`);let a=Ny({overrideDisabledPanels:o,panelConstraints:n[r],prevSize:e,size:100})-e;if(i+=a,r+=t,r<0||r>=n.length)break}let a=Math.min(Math.abs(e),Math.abs(i));e=e<0?0-a:a}{let t=e<0?u:d;for(;t>=0&&t<n.length;){let r=Math.abs(e)-Math.abs(f),i=s[t];Qv(i!=null,`Previous layout not found for panel index ${t}`);let a=i-r,c=Ny({overrideDisabledPanels:o,panelConstraints:n[t],prevSize:i,size:a});if(!jy(i,c)&&(f+=i-c,l[t]=c,f.toFixed(3).localeCompare(Math.abs(e).toFixed(3),void 0,{numeric:!0})>=0))break;e<0?t--:t++}}if(Ay(c,l))return i;{let t=e<0?d:u,r=s[t];Qv(r!=null,`Previous layout not found for panel index ${t}`);let i=r+f,a=Ny({overrideDisabledPanels:o,panelConstraints:n[t],prevSize:r,size:i});if(l[t]=a,!jy(a,i)){let t=i-a,r=e<0?d:u;for(;r>=0&&r<n.length;){let i=l[r];Qv(i!=null,`Previous layout not found for panel index ${r}`);let a=i+t,s=Ny({overrideDisabledPanels:o,panelConstraints:n[r],prevSize:i,size:a});if(jy(i,s)||(t-=s-i,l[r]=s),jy(t,0))break;e>0?r--:r++}}}if(!jy(Object.values(l).reduce((e,t)=>t+e,0),100,.1))return i;let p=Object.keys(i);return l.reduce((e,t,n)=>(e[p[n]]=t,e),{})}function Fy(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(t[n]===void 0||My(e[n],t[n])!==0)return!1;return!0}function Iy({layout:e,panelConstraints:t}){let n=Object.values(e),r=[...n],i=r.reduce((e,t)=>e+t,0);if(r.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${r.map(e=>`${e}%`).join(`, `)}`);if(!jy(i,100)&&r.length>0)for(let e=0;e<t.length;e++){let t=r[e];Qv(t!=null,`No layout data found for index ${e}`),r[e]=100/i*t}let a=0;for(let e=0;e<t.length;e++){let i=n[e];Qv(i!=null,`No layout data found for index ${e}`);let o=r[e];Qv(o!=null,`No layout data found for index ${e}`);let s=Ny({overrideDisabledPanels:!0,panelConstraints:t[e],prevSize:i,size:o});o!=s&&(a+=o-s,r[e]=s)}if(!jy(a,0))for(let e=0;e<t.length;e++){let n=r[e];Qv(n!=null,`No layout data found for index ${e}`);let i=n+a,o=Ny({overrideDisabledPanels:!0,panelConstraints:t[e],prevSize:n,size:i});if(n!==o&&(a-=o-n,r[e]=o,jy(a,0)))break}let o=Object.keys(e);return r.reduce((e,t,n)=>(e[o[n]]=t,e),{})}function Ly({groupId:e,panelId:t}){let n=()=>{let t=my();for(let[n,{defaultLayoutDeferred:r,derivedPanelConstraints:i,layout:a,groupSize:o,separatorToPanels:s}]of t)if(n.id===e)return{defaultLayoutDeferred:r,derivedPanelConstraints:i,group:n,groupSize:o,layout:a,separatorToPanels:s};throw Error(`Group ${e} not found`)},r=()=>{let e=n().derivedPanelConstraints.find(e=>e.panelId===t);if(e!==void 0)return e;throw Error(`Panel constraints not found for Panel ${t}`)},i=()=>{let e=n().group.panels.find(e=>e.id===t);if(e!==void 0)return e;throw Error(`Layout not found for Panel ${t}`)},a=()=>{let e=n().layout[t];if(e!==void 0)return e;throw Error(`Layout not found for Panel ${t}`)},o=e=>{let r=a();if(e===r)return;let{defaultLayoutDeferred:i,derivedPanelConstraints:o,group:s,groupSize:c,layout:l,separatorToPanels:u}=n(),d=s.panels.findIndex(e=>e.id===t),f=d===s.panels.length-1,p=Iy({layout:Py({delta:f?r-e:e-r,initialLayout:l,panelConstraints:o,pivotIndices:f?[d-1,d]:[d,d+1],prevLayout:l,trigger:`imperative-api`}),panelConstraints:o});Fy(l,p)||gy(s,{defaultLayoutDeferred:i,derivedPanelConstraints:o,groupSize:c,layout:p,separatorToPanels:u})};return{collapse:()=>{let{collapsible:e,collapsedSize:t}=r(),{mutableValues:n}=i(),s=a();e&&s!==t&&(n.expandToSize=s,o(t))},expand:()=>{let{collapsible:e,collapsedSize:t,minSize:n}=r(),{mutableValues:s}=i(),c=a();if(e&&c===t){let e=s.expandToSize??n;e===0&&(e=1),o(e)}},getSize:()=>{let{group:e}=n(),t=a(),{element:r}=i();return{asPercentage:t,inPixels:e.orientation===`horizontal`?r.offsetWidth:r.offsetHeight}},isCollapsed:()=>{let{collapsible:e,collapsedSize:t}=r(),n=a();return e&&jy(t,n)},resize:e=>{let{group:t}=n(),{element:r}=i(),a=Xv({group:t});o(Yv(Jv({groupSize:a,panelElement:r,styleProp:e})/a*100))}}}function Ry(e){e.defaultPrevented||ky(e,my()).forEach(t=>{if(t.separator&&!t.separator.disableDoubleClick){let n=t.panels.find(e=>e.panelConstraints.defaultSize!==void 0);if(n){let r=n.panelConstraints.defaultSize,i=Ly({groupId:t.group.id,panelId:n.id});i&&r!==void 0&&(i.resize(r),e.preventDefault())}}})}function zy(e){let t=my();for(let[n]of t)if(n.separators.some(t=>t.element===e))return n;throw Error(`Could not find parent Group for separator element`)}function By({groupId:e}){let t=()=>{let t=my();for(let[n,r]of t)if(n.id===e)return{group:n,...r};throw Error(`Could not find Group with id "${e}"`)};return{getLayout(){let{defaultLayoutDeferred:e,layout:n}=t();return e?{}:n},setLayout(e){let{defaultLayoutDeferred:n,derivedPanelConstraints:r,group:i,groupSize:a,layout:o,separatorToPanels:s}=t(),c=Iy({layout:e,panelConstraints:r});return n?o:(Fy(o,c)||gy(i,{defaultLayoutDeferred:n,derivedPanelConstraints:r,groupSize:a,layout:c,separatorToPanels:s}),c)}}}function Vy(e,t){let n=zy(e),r=py(n.id,!0),i=n.separators.find(t=>t.element===e);Qv(i,`Matching separator not found`);let a=r.separatorToPanels.get(i);Qv(a,`Matching panels not found`);let o=a.map(e=>n.panels.indexOf(e)),s=By({groupId:n.id}).getLayout(),c=Iy({layout:Py({delta:t,initialLayout:s,panelConstraints:r.derivedPanelConstraints,pivotIndices:o,prevLayout:s,trigger:`keyboard`}),panelConstraints:r.derivedPanelConstraints});Fy(s,c)||gy(n,{defaultLayoutDeferred:r.defaultLayoutDeferred,derivedPanelConstraints:r.derivedPanelConstraints,groupSize:r.groupSize,layout:c,separatorToPanels:r.separatorToPanels})}function Hy(e){if(e.defaultPrevented)return;let t=e.currentTarget,n=zy(t);if(!n.disabled)switch(e.key){case`ArrowDown`:e.preventDefault(),n.orientation===`vertical`&&Vy(t,5);break;case`ArrowLeft`:e.preventDefault(),n.orientation===`horizontal`&&Vy(t,-5);break;case`ArrowRight`:e.preventDefault(),n.orientation===`horizontal`&&Vy(t,5);break;case`ArrowUp`:e.preventDefault(),n.orientation===`vertical`&&Vy(t,-5);break;case`End`:e.preventDefault(),Vy(t,100);break;case`Enter`:{e.preventDefault();let n=zy(t),{derivedPanelConstraints:r,layout:i,separatorToPanels:a}=py(n.id,!0),o=n.separators.find(e=>e.element===t);Qv(o,`Matching separator not found`);let s=a.get(o);Qv(s,`Matching panels not found`);let c=s[0],l=r.find(e=>e.panelId===c.id);if(Qv(l,`Panel metadata not found`),l.collapsible){let e=i[c.id];Vy(t,(l.collapsedSize===e?n.mutableState.expandedPanelSizes[c.id]??l.minSize:l.collapsedSize)-e)}break}case`F6`:{e.preventDefault();let n=zy(t).separators.map(e=>e.element),r=Array.from(n).findIndex(t=>t===e.currentTarget);Qv(r!==null,`Index not found`),n[e.shiftKey?r>0?r-1:n.length-1:r+1<n.length?r+1:0].focus({preventScroll:!0});break}case`Home`:e.preventDefault(),Vy(t,-100);break}}var Uy={cursorFlags:0,state:`inactive`},Wy=new cy;function Gy(){return Uy}function Ky(e){return Wy.addListener(`change`,e)}function qy(e){let t=Uy,n={...Uy};n.cursorFlags=e,Uy=n,Wy.emit(`change`,{prev:t,next:n})}function Jy(e){let t=Uy;Uy=e,Wy.emit(`change`,{prev:t,next:e})}function Yy(e){if(e.defaultPrevented||e.pointerType===`mouse`&&e.button>0)return;let t=my(),n=ky(e,t),r=new Map,i=!1;n.forEach(e=>{e.separator&&(i||(i=!0,e.separator.element.focus({preventScroll:!0})));let n=t.get(e.group);n&&r.set(e.group,n.layout)}),Jy({cursorFlags:0,hitRegions:n,initialLayoutMap:r,pointerDownAtPoint:{x:e.clientX,y:e.clientY},state:`active`}),n.length&&e.preventDefault()}var Xy=e=>e,Zy=()=>{},Qy=1,$y=2,eb=4,tb=8,nb=3,rb=12,ib;function ab(){return ib===void 0&&(ib=!1,typeof window<`u`&&(window.navigator.userAgent.includes(`Chrome`)||window.navigator.userAgent.includes(`Firefox`))&&(ib=!0)),ib}function ob({cursorFlags:e,groups:t,state:n}){let r=0,i=0;switch(n){case`active`:case`hover`:t.forEach(e=>{if(!e.mutableState.disableCursor)switch(e.orientation){case`horizontal`:r++;break;case`vertical`:i++;break}})}if(!(r===0&&i===0)){switch(n){case`active`:if(e&&ab()){let t=(e&Qy)!==0,n=(e&$y)!==0,r=(e&eb)!==0,i=(e&tb)!==0;if(t)return r?`se-resize`:i?`ne-resize`:`e-resize`;if(n)return r?`sw-resize`:i?`nw-resize`:`w-resize`;if(r)return`s-resize`;if(i)return`n-resize`}break}return ab()?r>0&&i>0?`move`:r>0?`ew-resize`:`ns-resize`:r>0&&i>0?`grab`:r>0?`col-resize`:`row-resize`}}var sb=new WeakMap;function cb(e){if(e.defaultView===null||e.defaultView===void 0)return;let{prevStyle:t,styleSheet:n}=sb.get(e)??{};n===void 0&&(n=new e.defaultView.CSSStyleSheet,e.adoptedStyleSheets&&e.adoptedStyleSheets.push(n));let r=Gy();switch(r.state){case`active`:case`hover`:{let e=ob({cursorFlags:r.cursorFlags,groups:r.hitRegions.map(e=>e.group),state:r.state}),i=`*, *:hover {cursor: ${e} !important; }`;if(t===i)return;t=i,e?n.cssRules.length===0?n.insertRule(i):n.replaceSync(i):n.cssRules.length===1&&n.deleteRule(0);break}case`inactive`:t=void 0,n.cssRules.length===1&&n.deleteRule(0);break}sb.set(e,{prevStyle:t,styleSheet:n})}function lb({document:e,event:t,hitRegions:n,initialLayoutMap:r,mountedGroups:i,pointerDownAtPoint:a,prevCursorFlags:o}){let s=0;n.forEach(e=>{let{group:n,groupSize:o}=e,{orientation:c,panels:l}=n,{disableCursor:u}=n.mutableState,d=0;d=a?c===`horizontal`?(t.clientX-a.x)/o*100:(t.clientY-a.y)/o*100:c===`horizontal`?t.clientX<0?-100:100:t.clientY<0?-100:100;let f=r.get(n),p=i.get(n);if(!f||!p)return;let{defaultLayoutDeferred:m,derivedPanelConstraints:h,groupSize:g,layout:_,separatorToPanels:v}=p;if(h&&_&&v){let t=Py({delta:d,initialLayout:f,panelConstraints:h,pivotIndices:e.panels.map(e=>l.indexOf(e)),prevLayout:_,trigger:`mouse-or-touch`});if(Fy(t,_)){if(d!==0&&!u)switch(c){case`horizontal`:s|=d<0?Qy:$y;break;case`vertical`:s|=d<0?eb:tb;break}}else gy(e.group,{defaultLayoutDeferred:m,derivedPanelConstraints:h,groupSize:g,layout:t,separatorToPanels:v})}});let c=0;t.movementX===0?c|=o&nb:c|=s&nb,t.movementY===0?c|=o&rb:c|=s&rb,qy(c),cb(e)}function ub(e){let t=my(),n=Gy();switch(n.state){case`active`:lb({document:e.currentTarget,event:e,hitRegions:n.hitRegions,initialLayoutMap:n.initialLayoutMap,mountedGroups:t,prevCursorFlags:n.cursorFlags})}}function db(e){if(e.defaultPrevented)return;let t=Gy(),n=my();switch(t.state){case`active`:if(e.buttons===0){Jy({cursorFlags:0,state:`inactive`}),t.hitRegions.forEach(e=>{let t=py(e.group.id,!0);gy(e.group,t)});return}for(let n of t.hitRegions)if(n.separator){let{element:t}=n.separator;t.hasPointerCapture?.(e.pointerId)||t.setPointerCapture?.(e.pointerId)}lb({document:e.currentTarget,event:e,hitRegions:t.hitRegions,initialLayoutMap:t.initialLayoutMap,mountedGroups:n,pointerDownAtPoint:t.pointerDownAtPoint,prevCursorFlags:t.cursorFlags});break;default:{let r=ky(e,n);r.length===0?t.state!==`inactive`&&Jy({cursorFlags:0,state:`inactive`}):Jy({cursorFlags:0,hitRegions:r,state:`hover`}),cb(e.currentTarget);break}}}function fb(e){if(e.relatedTarget instanceof HTMLIFrameElement)switch(Gy().state){case`hover`:Jy({cursorFlags:0,state:`inactive`})}}function pb(e){if(e.defaultPrevented||e.pointerType===`mouse`&&e.button>0)return;let t=Gy();switch(t.state){case`active`:Jy({cursorFlags:0,state:`inactive`}),t.hitRegions.length>0&&(cb(e.currentTarget),t.hitRegions.forEach(e=>{let t=py(e.group.id,!0);gy(e.group,t)}),e.preventDefault())}}function mb(e){let t=0,n=0,r={};for(let i of e)if(i.defaultSize!==void 0){t++;let e=Yv(i.defaultSize);n+=e,r[i.panelId]=e}else r[i.panelId]=void 0;let i=e.length-t;if(i!==0){let t=Yv((100-n)/i);for(let n of e)n.defaultSize===void 0&&(r[n.panelId]=t)}return r}function hb(e,t,n){if(!n[0])return;let r=e.panels.find(e=>e.element===t);if(!r||!r.onResize)return;let i=Xv({group:e}),a=e.orientation===`horizontal`?r.element.offsetWidth:r.element.offsetHeight,o=r.mutableValues.prevSize,s={asPercentage:Yv(a/i*100),inPixels:a};r.mutableValues.prevSize=s,r.onResize(s,r.id,o)}function gb(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function _b({group:e,nextGroupSize:t,prevGroupSize:n,prevLayout:r}){if(n<=0||t<=0||n===t)return r;let i=0,a=0,o=!1,s=new Map,c=[];for(let l of e.panels){let e=r[l.id]??0;switch(l.panelConstraints.groupResizeBehavior){case`preserve-pixel-size`:{o=!0;let r=Yv(e/100*n/t*100);s.set(l.id,r),i+=r;break}default:c.push(l.id),a+=e;break}}if(!o||c.length===0)return r;let l=100-i,u={...r};if(s.forEach((e,t)=>{u[t]=e}),a>0)for(let e of c)u[e]=Yv((r[e]??0)/a*l);else{let e=Yv(l/c.length);for(let t of c)u[t]=e}return u}function vb(e,t){let n=e.map(e=>e.id),r=Object.keys(t);if(n.length!==r.length)return!1;for(let e of n)if(!r.includes(e))return!1;return!0}var yb=new Map;function bb(e){let t=!0;Qv(e.element.ownerDocument.defaultView,`Cannot register an unmounted Group`);let n=e.element.ownerDocument.defaultView.ResizeObserver,r=new Set,i=new Set,a=new n(n=>{for(let r of n){let{borderBoxSize:n,target:i}=r;if(i===e.element){if(t){let t=Xv({group:e});if(t===0)return;let n=py(e.id);if(!n)return;let r=Zv(e),i=n.defaultLayoutDeferred?mb(r):n.layout,a=Iy({layout:_b({group:e,nextGroupSize:t,prevGroupSize:n.groupSize,prevLayout:i}),panelConstraints:r});if(!n.defaultLayoutDeferred&&Fy(n.layout,a)&&gb(n.derivedPanelConstraints,r)&&n.groupSize===t)return;gy(e,{defaultLayoutDeferred:!1,derivedPanelConstraints:r,groupSize:t,layout:a,separatorToPanels:n.separatorToPanels})}}else hb(e,i,n)}});a.observe(e.element),e.panels.forEach(e=>{Qv(!r.has(e.id),`Panel ids must be unique; id "${e.id}" was used more than once`),r.add(e.id),e.onResize&&a.observe(e.element)});let o=Xv({group:e}),s=Zv(e),c=e.panels.map(({id:e})=>e).join(`,`),l=e.mutableState.defaultLayout;l&&(vb(e.panels,l)||(l=void 0));let u=Iy({layout:e.mutableState.layouts[c]??l??mb(s),panelConstraints:s}),d=e.element.ownerDocument;yb.set(d,(yb.get(d)??0)+1);let f=new Map;return sy(e).forEach(e=>{e.separator&&f.set(e.separator,e.panels)}),gy(e,{defaultLayoutDeferred:o===0,derivedPanelConstraints:s,groupSize:o,layout:u,separatorToPanels:f}),e.separators.forEach(e=>{Qv(!i.has(e.id),`Separator ids must be unique; id "${e.id}" was used more than once`),i.add(e.id),e.element.addEventListener(`keydown`,Hy)}),yb.get(d)===1&&(d.addEventListener(`dblclick`,Ry,!0),d.addEventListener(`pointerdown`,Yy,!0),d.addEventListener(`pointerleave`,ub),d.addEventListener(`pointermove`,db),d.addEventListener(`pointerout`,fb),d.addEventListener(`pointerup`,pb,!0)),function(){t=!1,yb.set(d,Math.max(0,(yb.get(d)??0)-1)),dy(e),e.separators.forEach(e=>{e.element.removeEventListener(`keydown`,Hy)}),yb.get(d)||(d.removeEventListener(`dblclick`,Ry,!0),d.removeEventListener(`pointerdown`,Yy,!0),d.removeEventListener(`pointerleave`,ub),d.removeEventListener(`pointermove`,db),d.removeEventListener(`pointerout`,fb),d.removeEventListener(`pointerup`,pb,!0)),a.disconnect()}}function xb(){let[e,t]=(0,Q.useState)({});return[e,(0,Q.useCallback)(()=>t({}),[])]}function Sb(e){let t=(0,Q.useId)();return`${e??t}`}var Cb=typeof window<`u`?Q.useLayoutEffect:Q.useEffect;function wb(e){let t=(0,Q.useRef)(e);return Cb(()=>{t.current=e},[e]),(0,Q.useCallback)((...e)=>t.current?.(...e),[t])}function Tb(...e){return wb(t=>{e.forEach(e=>{if(e)switch(typeof e){case`function`:e(t);break;case`object`:e.current=t;break}})})}function Eb(e){let t=(0,Q.useRef)({...e});return Cb(()=>{for(let n in e)t.current[n]=e[n]},[e]),t.current}var Db=(0,Q.createContext)(null);function Ob(e,t){let n=(0,Q.useRef)({getLayout:()=>({}),setLayout:Xy});(0,Q.useImperativeHandle)(t,()=>n.current,[]),Cb(()=>{Object.assign(n.current,By({groupId:e}))})}function kb({children:e,className:t,defaultLayout:n,disableCursor:r,disabled:i,elementRef:a,groupRef:o,id:s,onLayoutChange:c,onLayoutChanged:l,orientation:u=`horizontal`,resizeTargetMinimumSize:d={coarse:20,fine:10},style:f,...p}){let m=(0,Q.useRef)({onLayoutChange:{},onLayoutChanged:{}}),h=wb(e=>{Fy(m.current.onLayoutChange,e)||(m.current.onLayoutChange=e,c?.(e))}),g=wb(e=>{Fy(m.current.onLayoutChanged,e)||(m.current.onLayoutChanged=e,l?.(e))}),_=Sb(s),v=(0,Q.useRef)(null),[y,b]=xb(),x=(0,Q.useRef)({lastExpandedPanelSizes:{},layouts:{},panels:[],resizeTargetMinimumSize:d,separators:[]}),S=Tb(v,a);Ob(_,o);let C=wb((e,t)=>{let r=Gy(),i=fy(e),a=py(e);if(a){let e=!1;switch(r.state){case`active`:e=r.hitRegions.some(e=>e.group===i);break}return{flexGrow:a.layout[t]??1,pointerEvents:e?`none`:void 0}}if(n?.[t])return{flexGrow:n?.[t]}}),w=Eb({defaultLayout:n,disableCursor:r}),T=(0,Q.useMemo)(()=>({get disableCursor(){return!!w.disableCursor},getPanelStyles:C,id:_,orientation:u,registerPanel:e=>{let t=x.current;return t.panels=$v(u,[...t.panels,e]),b(),()=>{t.panels=t.panels.filter(t=>t!==e),b()}},registerSeparator:e=>{let t=x.current;return t.separators=$v(u,[...t.separators,e]),b(),()=>{t.separators=t.separators.filter(t=>t!==e),b()}},updatePanelProps:(e,{disabled:t})=>{let n=x.current.panels.find(t=>t.id===e);n&&(n.panelConstraints.disabled=t);let r=fy(_),i=py(_);r&&i&&gy(r,{...i,derivedPanelConstraints:Zv(r)})},updateSeparatorProps:(e,{disabled:t,disableDoubleClick:n})=>{let r=x.current.separators.find(t=>t.id===e);r&&(r.disabled=t,r.disableDoubleClick=n)}}),[C,_,b,u,w]),E=(0,Q.useRef)(null);return Cb(()=>{let e=v.current;if(e===null)return;let t=x.current,n;if(w.defaultLayout!==void 0&&Object.keys(w.defaultLayout).length===t.panels.length){n={};for(let e of t.panels){let t=w.defaultLayout[e.id];t!==void 0&&(n[e.id]=t)}}let r={disabled:!!i,element:e,id:_,mutableState:{defaultLayout:n,disableCursor:!!w.disableCursor,expandedPanelSizes:x.current.lastExpandedPanelSizes,layouts:x.current.layouts},orientation:u,panels:t.panels,resizeTargetMinimumSize:t.resizeTargetMinimumSize,separators:t.separators};E.current=r;let a=bb(r),{defaultLayoutDeferred:o,derivedPanelConstraints:s,layout:c}=py(r.id,!0);!o&&s.length>0&&(h(c),g(c));let l=hy(_,e=>{let{defaultLayoutDeferred:t,derivedPanelConstraints:n,layout:i}=e.next;if(t||n.length===0)return;let a=r.panels.map(({id:e})=>e).join(`,`);r.mutableState.layouts[a]=i,n.forEach(t=>{if(t.collapsible){let{layout:n}=e.prev??{};if(n){let e=jy(t.collapsedSize,i[t.panelId]),a=jy(t.collapsedSize,n[t.panelId]);e&&!a&&(r.mutableState.expandedPanelSizes[t.panelId]=n[t.panelId])}}});let o=Gy().state!==`active`;h(i),o&&g(i)});return()=>{E.current=null,a(),l()}},[i,_,g,h,u,y,w]),(0,Q.useEffect)(()=>{let e=E.current;e&&(e.mutableState.defaultLayout=n,e.mutableState.disableCursor=!!r)}),(0,Z.jsx)(Db.Provider,{value:T,children:(0,Z.jsx)(`div`,{...p,className:t,"data-group":!0,"data-testid":_,id:_,ref:S,style:{height:`100%`,width:`100%`,overflow:`hidden`,...f,display:`flex`,flexDirection:u===`horizontal`?`row`:`column`,flexWrap:`nowrap`,touchAction:u===`horizontal`?`pan-y`:`pan-x`},children:e})})}kb.displayName=`Group`;function Ab(){return(0,Q.useRef)(null)}function jb(){let e=(0,Q.useContext)(Db);return Qv(e,`Group Context not found; did you render a Panel or Separator outside of a Group?`),e}function Mb(e,t){let{id:n}=jb(),r=(0,Q.useRef)({collapse:Zy,expand:Zy,getSize:()=>({asPercentage:0,inPixels:0}),isCollapsed:()=>!1,resize:Zy});(0,Q.useImperativeHandle)(t,()=>r.current,[]),Cb(()=>{Object.assign(r.current,Ly({groupId:n,panelId:e}))})}function Nb({children:e,className:t,collapsedSize:n=`0%`,collapsible:r=!1,defaultSize:i,disabled:a,elementRef:o,groupResizeBehavior:s=`preserve-relative-size`,id:c,maxSize:l=`100%`,minSize:u=`0%`,onResize:d,panelRef:f,style:p,...m}){let h=!!c,g=Sb(c),_=Eb({disabled:a}),v=(0,Q.useRef)(null),y=Tb(v,o),{getPanelStyles:b,id:x,orientation:S,registerPanel:C,updatePanelProps:w}=jb(),T=d!==null,E=wb((e,t,n)=>{d?.(e,c,n)});Cb(()=>{let e=v.current;if(e!==null)return C({element:e,id:g,idIsStable:h,mutableValues:{expandToSize:void 0,prevSize:void 0},onResize:T?E:void 0,panelConstraints:{groupResizeBehavior:s,collapsedSize:n,collapsible:r,defaultSize:i,disabled:_.disabled,maxSize:l,minSize:u}})},[s,n,r,i,T,g,h,l,u,E,C,_]),(0,Q.useEffect)(()=>{w(g,{disabled:a})},[a,g,w]),Mb(g,f);let D=()=>{let e=b(x,g);if(e)return JSON.stringify(e)},O=(0,Q.useSyncExternalStore)(e=>hy(x,e),D,D),k;return k=O?JSON.parse(O):i?{flexGrow:void 0,flexShrink:void 0,flexBasis:i}:{flexGrow:1},(0,Z.jsx)(`div`,{...m,"data-disabled":a||void 0,"data-panel":!0,"data-testid":g,id:g,ref:y,style:{...Pb,display:`flex`,flexBasis:0,flexShrink:1,overflow:`visible`,...k},children:(0,Z.jsx)(`div`,{className:t,style:{maxHeight:`100%`,maxWidth:`100%`,flexGrow:1,overflow:`auto`,...p,touchAction:S===`horizontal`?`pan-y`:`pan-x`},children:e})})}Nb.displayName=`Panel`;var Pb={minHeight:0,maxHeight:`100%`,height:`auto`,minWidth:0,maxWidth:`100%`,width:`auto`,border:`none`,borderWidth:0,padding:0,margin:0};function Fb(){return(0,Q.useRef)(null)}function Ib({layout:e,panelConstraints:t,panelId:n,panelIndex:r}){let i,a,o=e[n],s=t.find(e=>e.panelId===n);if(s){let c=s.maxSize,l=s.collapsible?s.collapsedSize:s.minSize,u=[r,r+1];a=Iy({layout:Py({delta:l-o,initialLayout:e,panelConstraints:t,pivotIndices:u,prevLayout:e}),panelConstraints:t})[n],i=Iy({layout:Py({delta:c-o,initialLayout:e,panelConstraints:t,pivotIndices:u,prevLayout:e}),panelConstraints:t})[n]}return{valueControls:n,valueMax:i,valueMin:a,valueNow:o}}function Lb({children:e,className:t,disabled:n,disableDoubleClick:r,elementRef:i,id:a,style:o,...s}){let c=Sb(a),l=Eb({disabled:n,disableDoubleClick:r}),[u,d]=(0,Q.useState)({}),[f,p]=(0,Q.useState)(`inactive`),m=(0,Q.useRef)(null),h=Tb(m,i),{disableCursor:g,id:_,orientation:v,registerSeparator:y,updateSeparatorProps:b}=jb(),x=v===`horizontal`?`vertical`:`horizontal`;Cb(()=>{let e=m.current;if(e!==null){let t={disabled:l.disabled,disableDoubleClick:l.disableDoubleClick,element:e,id:c},n=y(t),r=Ky(e=>{p(e.next.state!==`inactive`&&e.next.hitRegions.some(e=>e.separator===t)?e.next.state:`inactive`)}),i=hy(_,e=>{let{derivedPanelConstraints:n,layout:r,separatorToPanels:i}=e.next,a=i.get(t);if(a){let e=a[0],t=a.indexOf(e);d(Ib({layout:r,panelConstraints:n,panelId:e.id,panelIndex:t}))}});return()=>{r(),i(),n()}}},[_,c,y,l]),(0,Q.useEffect)(()=>{b(c,{disabled:n,disableDoubleClick:r})},[n,r,c,b]);let S;return n&&!g&&(S=`not-allowed`),(0,Z.jsx)(`div`,{...s,"aria-controls":u.valueControls,"aria-disabled":n||void 0,"aria-orientation":x,"aria-valuemax":u.valueMax,"aria-valuemin":u.valueMin,"aria-valuenow":u.valueNow,children:e,className:t,"data-separator":n?`disabled`:f,"data-testid":c,id:c,ref:h,role:`separator`,style:{flexBasis:`auto`,cursor:S,...o,flexGrow:0,flexShrink:0,touchAction:`none`},tabIndex:n?void 0:0})}Lb.displayName=`Separator`;var Rb=new Map;function zb(e){let t=Rb.get(e);if(t)return t;let n=Bb(e);return Rb.set(e,n),n}async function Bb(e){switch(e){case`bash`:case`shell`:return(await n(async()=>{let{StreamLanguage:e}=await import(`./dist-DVPtn9Zx.js`).then(e=>e.h);return{StreamLanguage:e}},__vite__mapDeps([42,1,11]),import.meta.url)).StreamLanguage.define((await n(async()=>{let{shell:e}=await import(`./shell-CYSl653a.js`);return{shell:e}},[],import.meta.url)).shell);case`c`:return(await n(async()=>{let{StreamLanguage:e}=await import(`./dist-DVPtn9Zx.js`).then(e=>e.h);return{StreamLanguage:e}},__vite__mapDeps([42,1,11]),import.meta.url)).StreamLanguage.define((await n(async()=>{let{c:e}=await import(`./clike-CY4jFeI9.js`);return{c:e}},[],import.meta.url)).c);case`cpp`:return(await n(async()=>{let{StreamLanguage:e}=await import(`./dist-DVPtn9Zx.js`).then(e=>e.h);return{StreamLanguage:e}},__vite__mapDeps([42,1,11]),import.meta.url)).StreamLanguage.define((await n(async()=>{let{cpp:e}=await import(`./clike-CY4jFeI9.js`);return{cpp:e}},[],import.meta.url)).cpp);case`csharp`:return(await n(async()=>{let{StreamLanguage:e}=await import(`./dist-DVPtn9Zx.js`).then(e=>e.h);return{StreamLanguage:e}},__vite__mapDeps([42,1,11]),import.meta.url)).StreamLanguage.define((await n(async()=>{let{csharp:e}=await import(`./clike-CY4jFeI9.js`);return{csharp:e}},[],import.meta.url)).csharp);case`css`:case`less`:case`scss`:return(await n(async()=>{let{css:e}=await import(`./dist-DI8cI4NP.js`).then(e=>e.r);return{css:e}},__vite__mapDeps([41,1,42,11,43]),import.meta.url)).css().language;case`diff`:return(await n(async()=>{let{StreamLanguage:e}=await import(`./dist-DVPtn9Zx.js`).then(e=>e.h);return{StreamLanguage:e}},__vite__mapDeps([42,1,11]),import.meta.url)).StreamLanguage.define((await n(async()=>{let{diff:e}=await import(`./diff-VsLDmRbo.js`);return{diff:e}},[],import.meta.url)).diff);case`go`:return(await n(async()=>{let{StreamLanguage:e}=await import(`./dist-DVPtn9Zx.js`).then(e=>e.h);return{StreamLanguage:e}},__vite__mapDeps([42,1,11]),import.meta.url)).StreamLanguage.define((await n(async()=>{let{go:e}=await import(`./go-CJnIK4Uo.js`);return{go:e}},[],import.meta.url)).go);case`ini`:return(await n(async()=>{let{StreamLanguage:e}=await import(`./dist-DVPtn9Zx.js`).then(e=>e.h);return{StreamLanguage:e}},__vite__mapDeps([42,1,11]),import.meta.url)).StreamLanguage.define((await n(async()=>{let{properties:e}=await import(`./properties-KpJMIKzZ.js`);return{properties:e}},[],import.meta.url)).properties);case`java`:return(await n(async()=>{let{StreamLanguage:e}=await import(`./dist-DVPtn9Zx.js`).then(e=>e.h);return{StreamLanguage:e}},__vite__mapDeps([42,1,11]),import.meta.url)).StreamLanguage.define((await n(async()=>{let{java:e}=await import(`./clike-CY4jFeI9.js`);return{java:e}},[],import.meta.url)).java);case`javascript`:return(await n(async()=>{let{javascript:e}=await import(`./dist-DPfhM7y8.js`).then(e=>e.t);return{javascript:e}},__vite__mapDeps([45,1,46,42,11,43]),import.meta.url)).javascript().language;case`json`:return(await n(async()=>{let{json:e}=await import(`./dist-CkLidFHS.js`).then(e=>e.t);return{json:e}},__vite__mapDeps([47,1,42,11,43]),import.meta.url)).json().language;case`kotlin`:return(await n(async()=>{let{StreamLanguage:e}=await import(`./dist-DVPtn9Zx.js`).then(e=>e.h);return{StreamLanguage:e}},__vite__mapDeps([42,1,11]),import.meta.url)).StreamLanguage.define((await n(async()=>{let{kotlin:e}=await import(`./clike-CY4jFeI9.js`);return{kotlin:e}},[],import.meta.url)).kotlin);case`lua`:return(await n(async()=>{let{StreamLanguage:e}=await import(`./dist-DVPtn9Zx.js`).then(e=>e.h);return{StreamLanguage:e}},__vite__mapDeps([42,1,11]),import.meta.url)).StreamLanguage.define((await n(async()=>{let{lua:e}=await import(`./lua-BTUOHEPy.js`);return{lua:e}},[],import.meta.url)).lua);case`markdown`:return(await n(async()=>{let{markdown:e}=await import(`./dist-D7I9jMga.js`).then(e=>e.t);return{markdown:e}},__vite__mapDeps([48,1,46,42,11,44,41,43,45]),import.meta.url)).markdown().language;case`objectivec`:return(await n(async()=>{let{StreamLanguage:e}=await import(`./dist-DVPtn9Zx.js`).then(e=>e.h);return{StreamLanguage:e}},__vite__mapDeps([42,1,11]),import.meta.url)).StreamLanguage.define((await n(async()=>{let{objectiveC:e}=await import(`./clike-CY4jFeI9.js`);return{objectiveC:e}},[],import.meta.url)).objectiveC);case`perl`:return(await n(async()=>{let{StreamLanguage:e}=await import(`./dist-DVPtn9Zx.js`).then(e=>e.h);return{StreamLanguage:e}},__vite__mapDeps([42,1,11]),import.meta.url)).StreamLanguage.define((await n(async()=>{let{perl:e}=await import(`./perl-CSl7RrAK.js`);return{perl:e}},[],import.meta.url)).perl);case`python`:return(await n(async()=>{let{python:e}=await import(`./dist-BuoXuHTG.js`);return{python:e}},__vite__mapDeps([69,46,42,1,11,43]),import.meta.url)).python().language;case`r`:return(await n(async()=>{let{StreamLanguage:e}=await import(`./dist-DVPtn9Zx.js`).then(e=>e.h);return{StreamLanguage:e}},__vite__mapDeps([42,1,11]),import.meta.url)).StreamLanguage.define((await n(async()=>{let{r:e}=await import(`./r-DFsc7DIH.js`);return{r:e}},[],import.meta.url)).r);case`ruby`:return(await n(async()=>{let{StreamLanguage:e}=await import(`./dist-DVPtn9Zx.js`).then(e=>e.h);return{StreamLanguage:e}},__vite__mapDeps([42,1,11]),import.meta.url)).StreamLanguage.define((await n(async()=>{let{ruby:e}=await import(`./ruby-dZPnOz8h.js`);return{ruby:e}},[],import.meta.url)).ruby);case`rust`:return(await n(async()=>{let{rust:e}=await import(`./dist-CgYE3gek.js`);return{rust:e}},__vite__mapDeps([70,42,1,11,43]),import.meta.url)).rust().language;case`sql`:return(await n(async()=>{let{StreamLanguage:e}=await import(`./dist-DVPtn9Zx.js`).then(e=>e.h);return{StreamLanguage:e}},__vite__mapDeps([42,1,11]),import.meta.url)).StreamLanguage.define((await n(async()=>{let{standardSQL:e}=await import(`./sql-BfVjfYES.js`);return{standardSQL:e}},[],import.meta.url)).standardSQL);case`swift`:return(await n(async()=>{let{StreamLanguage:e}=await import(`./dist-DVPtn9Zx.js`).then(e=>e.h);return{StreamLanguage:e}},__vite__mapDeps([42,1,11]),import.meta.url)).StreamLanguage.define((await n(async()=>{let{swift:e}=await import(`./swift-DjBuuwmF.js`);return{swift:e}},[],import.meta.url)).swift);case`typescript`:return(await n(async()=>{let{javascript:e}=await import(`./dist-DPfhM7y8.js`).then(e=>e.t);return{javascript:e}},__vite__mapDeps([45,1,46,42,11,43]),import.meta.url)).javascript({typescript:!0,jsx:!0}).language;case`xml`:return(await n(async()=>{let{html:e}=await import(`./dist-D8Itza26.js`).then(e=>e.t);return{html:e}},__vite__mapDeps([44,1,41,42,11,43,45,46]),import.meta.url)).html().language;case`yaml`:return(await n(async()=>{let{yaml:e}=await import(`./dist-BEW6C_CZ.js`).then(e=>e.t);return{yaml:e}},__vite__mapDeps([49,1,42,11,43]),import.meta.url)).yaml().language;default:return null}}async function Vb(e,t){if(e===`canvas`)return(await n(async()=>{let{json:e}=await import(`./dist-CkLidFHS.js`).then(e=>e.t);return{json:e}},__vite__mapDeps([47,1,42,11,43]),import.meta.url)).json().language;if(t){let e=await zb(t);if(e)return e}return e===`toml`?(await n(async()=>{let{StreamLanguage:e}=await import(`./dist-DVPtn9Zx.js`).then(e=>e.h);return{StreamLanguage:e}},__vite__mapDeps([42,1,11]),import.meta.url)).StreamLanguage.define((await n(async()=>{let{toml:e}=await import(`./toml-C3_Svn60.js`);return{toml:e}},[],import.meta.url)).toml):null}function Hb(e){let t=(0,$.c)(10),{_:n}=$t(),r;t[0]===n?r=t[1]:(r=e=>n(e===413?{id:`C_WGy8`}:e===415?{id:`VM7H66`}:e===404?{id:`s0IDhW`}:e===400?{id:`N1mdmS`}:typeof e==`number`?{id:`96w9hU`,values:{status:e}}:{id:`ig5vUe`}),t[0]=n,t[1]=r);let i=r,{src:a,loadText:o}=e,s=(0,Q.useRef)(o),c=(0,Q.useRef)(i),l;t[2]!==o||t[3]!==i?(l=()=>{s.current=o,c.current=i},t[2]=o,t[3]=i,t[4]=l):l=t[4],(0,Q.useEffect)(l);let u;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(u={status:`loading`},t[5]=u):u=t[5];let[d,f]=(0,Q.useState)(u),p,m;return t[6]!==n||t[7]!==a?(p=()=>{let e=!1,t=new AbortController;f({status:`loading`});let r=s.current;return r?(r(t.signal).then(t=>{if(!e){if(t.ok){f({status:`loaded`,content:t.text});return}f({status:`error`,message:t.message??c.current(t.status)})}}).catch(t=>{e||t instanceof Error&&t.name===`AbortError`||f({status:`error`,message:n({id:`ig5vUe`})})}),()=>{e=!0,t.abort()}):(fetch(a??``,{credentials:`same-origin`,signal:t.signal}).then(async e=>{if(!e.ok)throw Error(c.current(e.status));return e.text()}).then(t=>{e||f({status:`loaded`,content:t})}).catch(t=>{e||t instanceof Error&&t.name===`AbortError`||f({status:`error`,message:t instanceof Error?t.message:n({id:`ig5vUe`})})}),()=>{e=!0,t.abort()})},m=[a,n],t[6]=n,t[7]=a,t[8]=p,t[9]=m):(p=t[8],m=t[9]),(0,Q.useEffect)(p,m),d}function Ub(e){let t=(0,$.c)(10),{fileName:n,dataAttr:r,extraAttrs:i}=e,a=`${r}-state`,o;t[0]!==r||t[1]!==a?(o={[r]:``,[a]:`loading`},t[0]=r,t[1]=a,t[2]=o):o=t[2];let s;t[3]===n?s=t[4]:(s=(0,Z.jsx)(`span`,{children:(0,Z.jsx)(J,{id:`Md709y`,values:{fileName:n}})}),t[3]=n,t[4]=s);let c;return t[5]!==i||t[6]!==n||t[7]!==o||t[8]!==s?(c=(0,Z.jsx)(`main`,{className:`flex h-full min-h-0 flex-col items-center justify-center bg-background text-muted-foreground text-sm`,"aria-label":n,...o,...i,children:s}),t[5]=i,t[6]=n,t[7]=o,t[8]=s,t[9]=c):c=t[9],c}function Wb(e){let t=(0,$.c)(16),{fileName:n,dataAttr:r,extraAttrs:i,message:a,openHref:o}=e,s=`${r}-state`,c;t[0]!==r||t[1]!==s?(c={[r]:``,[s]:`error`},t[0]=r,t[1]=s,t[2]=c):c=t[2];let l;t[3]===n?l=t[4]:(l=(0,Z.jsx)(`div`,{className:`font-medium text-sm`,children:(0,Z.jsx)(J,{id:`qdBUHP`,values:{fileName:n}})}),t[3]=n,t[4]=l);let u;t[5]===a?u=t[6]:(u=(0,Z.jsx)(`div`,{className:`text-muted-foreground text-xs`,children:a}),t[5]=a,t[6]=u);let d;t[7]===o?d=t[8]:(d=o?(0,Z.jsx)(`a`,{href:o,className:`mt-2 rounded-md border px-3 py-1.5 text-sm hover:bg-accent hover:text-accent-foreground`,children:(0,Z.jsx)(J,{id:`9npOH9`})}):null,t[7]=o,t[8]=d);let f;return t[9]!==i||t[10]!==n||t[11]!==c||t[12]!==l||t[13]!==u||t[14]!==d?(f=(0,Z.jsxs)(`main`,{className:`flex h-full min-h-0 flex-col items-center justify-center gap-2 bg-background p-4 text-center`,"aria-label":n,...c,...i,children:[l,u,d]}),t[9]=i,t[10]=n,t[11]=c,t[12]=l,t[13]=u,t[14]=d,t[15]=f):f=t[15],f}var Gb=q({settings:{background:`var(--background)`,gutterBackground:`var(--muted)`}}),Kb=E({settings:{background:`var(--background)`,gutterBackground:`var(--muted)`}});function qb(e){let t=(0,$.c)(23),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({fileName:r,extension:n,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=(0,Q.useRef)(null),o=(0,Q.useRef)(null),{resolvedTheme:s}=Mn(),c=Hb(i),l=c.status===`loaded`?c.content:null,u,d;t[4]!==n||t[5]!==l||t[6]!==s?(u=()=>{if(!a.current||l===null)return;let e=n.toLowerCase(),t=Lr(e),r=s===`dark`?Gb:Kb,i=!1,c=null;return Vb(e,t).then(e=>{if(i||!a.current)return;let t=[lu,...e?[e]:[],Wl.editable.of(!0),Pl.readOnly.of(!0),Wl.lineWrapping,r];c=new Wl({state:Pl.create({doc:l,extensions:t}),parent:a.current}),o.current=c}),()=>{i=!0,c?.destroy(),o.current=null}},d=[l,n,s],t[4]=n,t[5]=l,t[6]=s,t[7]=u,t[8]=d):(u=t[7],d=t[8]),(0,Q.useEffect)(u,d);let f;t[9]===n?f=t[10]:(f={"data-text-viewer-extension":n},t[9]=n,t[10]=f);let p=f;if(c.status===`loading`){let e;return t[11]!==p||t[12]!==r?(e=(0,Z.jsx)(Ub,{fileName:r,dataAttr:`data-text-viewer`,extraAttrs:p}),t[11]=p,t[12]=r,t[13]=e):e=t[13],e}if(c.status===`error`){let e;return t[14]!==p||t[15]!==c.message||t[16]!==r||t[17]!==i.src?(e=(0,Z.jsx)(Wb,{fileName:r,dataAttr:`data-text-viewer`,extraAttrs:p,message:c.message,openHref:i.src}),t[14]=p,t[15]=c.message,t[16]=r,t[17]=i.src,t[18]=e):e=t[18],e}let m;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,Z.jsx)(`div`,{ref:a,className:`min-h-0 flex-1 overflow-auto`}),t[19]=m):m=t[19];let h;return t[20]!==n||t[21]!==r?(h=(0,Z.jsx)(`main`,{className:`flex h-full min-h-0 flex-col bg-background`,"aria-label":r,"data-text-viewer":``,"data-text-viewer-state":`loaded`,"data-text-viewer-extension":n,children:m}),t[20]=n,t[21]=r,t[22]=h):h=t[22],h}function Jb(e){return Rn(`/api/asset?path=${encodeURIComponent(e)}`)}function Yb(e){return`/api/asset-text?path=${encodeURIComponent(e)}`}function Xb(e){let t=(0,$.c)(31),{assetPath:n,mediaKind:r}=e,[i,a]=(0,Q.useState)(!1),o;t[0]===n?o=t[1]:(o=Jb(n),t[0]=n,t[1]=o);let s=o,c;t[2]===n?c=t[3]:(c=n.split(`/`).pop()??n,t[2]=n,t[3]=c);let l=c,u,f,p,m;if(t[4]!==n||t[5]!==l||t[6]!==i||t[7]!==r||t[8]!==s){m=Symbol.for(`react.early_return_sentinel`);bb0:{if(p=l.includes(`.`)?l.split(`.`).pop()??``:``,f=p.length>0?p.toUpperCase():`FILE`,u=i?`text`:r,u===`pdf`){let e;t[13]!==l||t[14]!==s?(e=(0,Z.jsx)(`div`,{className:`min-h-0 flex-1 overflow-hidden`,children:(0,Z.jsx)(ke,{src:s,title:l,fillContainer:!0})}),t[13]=l,t[14]=s,t[15]=e):e=t[15];let n;t[16]!==l||t[17]!==e?(n=(0,Z.jsx)(`main`,{className:`flex h-full min-h-0 flex-col bg-background`,"aria-label":l,children:e}),t[16]=l,t[17]=e,t[18]=n):n=t[18],m=n;break bb0}if(u===`text`){let e;t[19]===n?e=t[20]:(e=Yb(n),t[19]=n,t[20]=e),m=(0,Z.jsx)(qb,{src:e,fileName:l,extension:p.toLowerCase()},n);break bb0}}t[4]=n,t[5]=l,t[6]=i,t[7]=r,t[8]=s,t[9]=u,t[10]=f,t[11]=p,t[12]=m}else u=t[9],f=t[10],p=t[11],m=t[12];if(m!==Symbol.for(`react.early_return_sentinel`))return m;let h;t[21]!==n||t[22]!==u||t[23]!==f||t[24]!==l||t[25]!==p||t[26]!==s?(h=(0,Z.jsx)(`div`,{className:`flex min-h-0 flex-1 items-center justify-center overflow-auto p-4`,children:u===`image`?(0,Z.jsx)(Nt,{src:s,alt:l,draggable:!1,slotClassName:`flex h-full w-full items-center justify-center`,className:`max-h-full max-w-full`}):u===`video`?(0,Z.jsx)(`video`,{src:s,controls:!0,className:`max-h-full max-w-full`}):u===`audio`?(0,Z.jsx)(`audio`,{src:s,controls:!0,className:`w-full max-w-md`}):(0,Z.jsxs)(`div`,{className:`flex max-w-sm flex-col items-center gap-8 text-center`,children:[(0,Z.jsxs)(`div`,{className:`flex flex-col items-center gap-1`,children:[(0,Z.jsx)(`div`,{className:`flex items-center justify-center tracking-wide text-muted-foreground/80 text-2xs font-mono`,children:f}),(0,Z.jsx)(`div`,{className:`max-w-full text-balance break-words tracking-tight font-light text-2xl`,children:l})]}),(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center justify-center gap-2`,children:[(0,Z.jsx)(X,{variant:`default`,size:`sm`,onClick:()=>a(!0),"data-testid":`asset-preview-open-as-text`,className:`font-mono uppercase`,children:(0,Z.jsx)(J,{id:`qFWMl-`})}),(0,Z.jsx)(X,{variant:`outline`,size:`sm`,className:`font-mono uppercase`,onClick:()=>{d({url:s,projectRelPath:n,ext:p.toLowerCase(),title:l,forceOsDelegation:!1})},children:(0,Z.jsx)(J,{id:`9npOH9`})})]})]})}),t[21]=n,t[22]=u,t[23]=f,t[24]=l,t[25]=p,t[26]=s,t[27]=h):h=t[27];let g;return t[28]!==l||t[29]!==h?(g=(0,Z.jsx)(`main`,{className:`flex h-full min-h-0 flex-col bg-background`,"aria-label":l,children:h}),t[28]=l,t[29]=h,t[30]=g):g=t[30],g}function Zb(){let e=(0,$.c)(5),{_:t}=$t(),n;e[0]===t?n=e[1]:(n=t({id:`3VsNTI`}),e[0]=t,e[1]=n);let r;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Z.jsxs)(`div`,{className:`space-y-3`,children:[(0,Z.jsx)(Ba,{className:`h-9 w-2/5 mt-6 mb-5`}),(0,Z.jsx)(Ba,{className:`h-4 w-full`}),(0,Z.jsx)(Ba,{className:`h-4 w-3/4`})]}),e[2]=r):r=e[2];let i;return e[3]===n?i=e[4]:(i=(0,Z.jsx)(`div`,{className:`tiptap-editor pt-10`,role:`status`,"aria-busy":`true`,"aria-label":n,children:r}),e[3]=n,e[4]=i),i}function Qb(e){let{_:t}=$t();return e===`existing-repo`?[{id:`draft-spec`,icon:jd,label:t({id:`LdKIHS`}),prompt:t({id:`N_7kkF`})},{id:`organize-specs`,icon:Yd,label:t({id:`cuA8QW`}),prompt:t({id:`mPy9lS`})},{id:`document-architecture`,icon:$d,label:t({id:`6eniID`}),prompt:t({id:`uDlyqd`})}]:[{id:`competitor-research`,icon:Of,label:t({id:`GUqTzn`}),prompt:t({id:`KOZud0`})},{id:`eng-specs`,icon:jd,label:t({id:`Qvls7J`}),prompt:t({id:`6qMe0o`})},{id:`bird-wiki`,icon:pd,label:t({id:`FqTpiN`}),prompt:t({id:`jtg_8-`})}]}function $b(e){let t=(0,$.c)(13),{scenario:n,className:r}=e,{_:i}=$t(),a=Qb(n),[o,s]=(0,Q.useState)(null),c=(0,Q.useRef)(void 0),l,u;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(l=()=>()=>clearTimeout(c.current),u=[],t[0]=l,t[1]=u):(l=t[0],u=t[1]),(0,Q.useEffect)(l,u);let d,f;if(t[2]!==i||t[3]!==r||t[4]!==o||t[5]!==a){let e=function(e,t){ga(t).then(()=>{s(e),clearTimeout(c.current),c.current=setTimeout(()=>s(null),1600)}).catch(ex)};t[8]===r?d=t[9]:(d=Y(`w-full divide-y divide-border/60 overflow-hidden rounded-2xl border border-border/60 bg-card`,r),t[8]=r,t[9]=d),f=a.map(t=>{let n=t.icon,r=o===t.id;return(0,Z.jsxs)(`li`,{className:`group flex items-start gap-3 p-3.5`,"data-testid":`copy-prompt-${t.id}`,children:[(0,Z.jsx)(n,{className:`mt-0.5 size-4 shrink-0 text-muted-foreground`,"aria-hidden":`true`}),(0,Z.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1.5`,children:[(0,Z.jsx)(`span`,{className:`text-sm font-medium leading-tight text-foreground`,children:t.label}),(0,Z.jsx)(`span`,{className:`truncate text-1sm leading-relaxed text-muted-foreground`,children:t.prompt})]}),(0,Z.jsxs)(X,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>e(t.id,t.prompt),"aria-label":i(r?{id:`6V3Ea3`}:{id:`RG4XHV`,values:{0:t.label}}),className:Y(`shrink-0 gap-1.5 transition-opacity focus-visible:opacity-100 uppercase font-mono`,r?`opacity-100`:`opacity-0 group-hover:opacity-100`),"data-testid":`copy-prompt-button-${t.id}`,children:[r?(0,Z.jsx)(Ui,{className:`size-3.5`,"aria-hidden":`true`}):(0,Z.jsx)(xo,{className:`size-3.5`,"aria-hidden":`true`}),i(r?{id:`6V3Ea3`}:{id:`he3ygx`})]})]},t.id)}),t[2]=i,t[3]=r,t[4]=o,t[5]=a,t[6]=d,t[7]=f}else d=t[6],f=t[7];let p;return t[10]!==d||t[11]!==f?(p=(0,Z.jsx)(`ul`,{className:d,children:f}),t[10]=d,t[11]=f,t[12]=p):p=t[12],p}function ex(){}var tx=`ok-ask-ai-draft-v2`,nx={doc:null,dismissed:!1};function rx(){if(typeof window>`u`)return null;try{return window.localStorage}catch{return null}}var ix=null,ax=new Set;function ox(e){if(e===null)return!0;let t=e.content;return!Array.isArray(t)||t.length===0?!0:t.every(e=>{let t=e.content;return!Array.isArray(t)||t.length===0})}function sx(){let e=rx();if(!e)return nx;try{let t=e.getItem(tx);if(!t)return nx;let n=JSON.parse(t);return typeof n!=`object`||!n||Array.isArray(n)?nx:{doc:n,dismissed:!1}}catch(e){return console.warn(`failed to parse stored draft — clearing`,e),nx}}function cx(){return ix===null&&(ix=sx()),ix}function lx(e){let t=rx();if(t)try{e&&!ox(e)?t.setItem(tx,JSON.stringify(e)):t.removeItem(tx)}catch{}}function ux(){for(let e of ax)e()}function dx(){return cx()}function fx(e){let t=e&&!ox(e)?e:null;ix={...cx(),doc:t},lx(t),ux()}function px(){fx(null)}var mx=_i(`group/button-group flex w-fit items-stretch *:focus-visible:relative *:focus-visible:z-10 has-[>[data-slot=button-group]]:gap-2 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-lg [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1`,{variants:{orientation:{horizontal:`[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-r-lg!`,vertical:`flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none [&>[data-slot]:not(:has(~[data-slot]))]:rounded-b-lg!`}},defaultVariants:{orientation:`horizontal`}});function hx(e){let t=(0,$.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,orientation:r,...i}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]!==n||t[5]!==r?(a=Y(mx({orientation:r}),n),t[4]=n,t[5]=r,t[6]=a):a=t[6];let o;return t[7]!==r||t[8]!==i||t[9]!==a?(o=(0,Z.jsx)(`div`,{role:`group`,"data-slot":`button-group`,"data-orientation":r,className:a,...i}),t[7]=r,t[8]=i,t[9]=a,t[10]=o):o=t[10],o}var gx=Rr;function _x(e){let t=I(e).kind;return t===`folder`||t===`asset`?t:`page`}function vx(e){let t=(0,$.c)(14),{items:n,query:r,selectedIndex:i,onSelect:a,loading:o,error:s,hasMore:c}=e,l=o===void 0?!1:o,u=s===void 0?!1:s,d=c===void 0?!1:c,{_:f}=$t(),p=(0,Q.useId)(),m=(0,Q.useRef)(null),h,g;t[0]===i?(h=t[1],g=t[2]):(h=()=>{(m.current?.querySelectorAll(`[role="option"]`))?.item(i)?.scrollIntoView({block:`nearest`})},g=[i],t[0]=i,t[1]=h,t[2]=g),(0,Q.useEffect)(h,g);let _=i>=0&&i<n.length?n[i]:null,v;return t[3]!==f||t[4]!==u||t[5]!==d||t[6]!==n||t[7]!==p||t[8]!==l||t[9]!==a||t[10]!==r||t[11]!==i||t[12]!==_?(v=(0,Z.jsx)(`div`,{ref:m,className:`w-80 max-w-[min(28rem,90vw)] overflow-hidden rounded-lg border bg-popover p-1 text-popover-foreground shadow-md`,children:l?(0,Z.jsx)(`p`,{className:`px-2 py-1.5 text-sm text-muted-foreground`,"aria-live":`polite`,children:f({id:`3m2GBo`})}):u?(0,Z.jsx)(`p`,{className:`px-2 py-1.5 text-sm text-muted-foreground`,"aria-live":`assertive`,children:f({id:`weP6me`})}):n.length===0?(0,Z.jsx)(`p`,{className:`px-2 py-1.5 text-sm text-muted-foreground`,"aria-live":`polite`,children:r.trim()===``?f({id:`0E9DR6`}):f({id:`yQyglE`})}):(0,Z.jsxs)(`div`,{role:`listbox`,id:p,"aria-label":f({id:`05n5wS`}),tabIndex:-1,className:`max-h-64 overflow-y-auto subtle-scrollbar`,children:[(0,Z.jsx)(`span`,{className:`sr-only`,"aria-live":`polite`,"aria-atomic":`true`,children:_?_.title:``}),n.map((e,t)=>{let n=t===i,r=_x(e.path),o=r===`folder`,s=o?`${e.path}/`:e.path;return(0,Z.jsxs)(`button`,{id:`${p}-option-${t}`,type:`button`,role:`option`,"aria-selected":n,"data-active":n,"data-mention-kind":r,"data-testid":`composer-mention-option-${e.docName}`,className:`flex w-full items-start gap-2 rounded-md px-2 py-1.5 text-left ${n?`bg-accent text-accent-foreground`:``}`,onMouseDown:t=>{t.preventDefault(),a(e)},children:[(0,Z.jsx)(Vt,{path:e.path,className:`mt-0.5 size-4 shrink-0 text-muted-foreground`}),(0,Z.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[(0,Z.jsxs)(`span`,{className:`flex items-baseline gap-1.5`,children:[(0,Z.jsx)(`span`,{className:`truncate text-sm font-medium`,children:e.title}),o?(0,Z.jsx)(`span`,{className:`shrink-0 text-[10px] font-medium uppercase tracking-wide text-muted-foreground`,children:f({id:`kNqMMd`})}):null]}),(0,Z.jsx)(`span`,{className:`line-clamp-2 break-all text-xs text-muted-foreground`,children:s})]})]},e.docName)}),d?(0,Z.jsx)(`div`,{className:`px-2 py-1 text-xs text-muted-foreground`,"aria-hidden":!0,children:f({id:`F1T9y_`})}):null]})}),t[3]=f,t[4]=u,t[5]=d,t[6]=n,t[7]=p,t[8]=l,t[9]=a,t[10]=r,t[11]=i,t[12]=_,t[13]=v):v=t[13],v}var yx=8,bx=new Zr(`composerMentionSuggestion`);function xx(e){return e.kind===`asset`?e.docName.replace(/^\//,``):e.kind===`folder`?e.docName:ra(e.docName)}var Sx=dr.create({name:`doc`,topNode:!0,content:`paragraph+`}),Cx=dr.create({name:`paragraph`,group:`block`,content:`inline*`,parseHTML(){return[{tag:`p`}]},renderHTML(){return[`p`,0]}}),wx=dr.create({name:`text`,group:`inline`}),Tx=dr.create({name:`hardBreak`,group:`inline`,inline:!0,selectable:!1,parseHTML(){return[{tag:`br`}]},renderHTML(){return[`br`]},addKeyboardShortcuts(){return{"Shift-Enter":()=>this.editor.commands.insertContent({type:`hardBreak`})}}}),Ex=pr.create({name:`composerHistory`,addProseMirrorPlugins(){return[Zn(),Yr({"Mod-z":rr,"Mod-y":$n,"Shift-Mod-z":$n})]}}),Dx=dr.create({name:`composerMention`,group:`inline`,inline:!0,atom:!0,selectable:!0,addAttributes(){return{path:{default:``},label:{default:``}}},parseHTML(){return[{tag:`span[data-composer-mention]`}]},renderHTML({node:e,HTMLAttributes:t}){let n=String(e.attrs.label||e.attrs.path);return[`span`,Kr(t,{"data-composer-mention":String(e.attrs.path??``),class:`composer-mention-chip`}),`@${n}`]},renderText({node:e}){return`@${e.attrs.path}`},addNodeView(){return({node:e,editor:t,getPos:n})=>{let r=String(e.attrs.path??``),i=String(e.attrs.label||e.attrs.path),a=document.createElement(`span`);a.className=`composer-mention-chip group/mention`,a.setAttribute(`data-composer-mention`,r),a.title=i;let o=document.createElement(`button`);o.type=`button`,o.className=`composer-mention-icon`,o.setAttribute(`aria-label`,Wc._({id:`Xzy0s0`,values:{fullLabel:i}}));let s=document.createElement(`span`);s.className=`composer-mention-glyph composer-mention-glyph-icon`,s.setAttribute(`aria-hidden`,`true`),s.innerHTML=Gt(r),o.appendChild(s);let c=document.createElement(`span`);c.className=`composer-mention-glyph composer-mention-glyph-x`,c.setAttribute(`aria-hidden`,`true`),c.innerHTML=oe(gs),o.appendChild(c),o.addEventListener(`mousedown`,e=>e.preventDefault()),o.addEventListener(`click`,r=>{r.preventDefault();let i=typeof n==`function`?n():null;i!=null&&t.chain().focus().deleteRange({from:i,to:i+e.nodeSize}).run()}),a.appendChild(o);let l=document.createElement(`span`);return l.className=`composer-mention-label`,l.textContent=i,a.appendChild(l),{dom:a}}},addProseMirrorPlugins(){return[Ax(this.editor)]}});function Ox(e){return[Sx,Cx,wx,Tx,Ex,Dx,...e?.placeholder?[gx.configure({placeholder:e.placeholder})]:[]]}function kx(e=x){let t=[],n=!1,r=null,i=!1;return{snapshot(){return{loaded:n,error:i}},async getItems(a){if(!n){r||=e();try{t=await r,n=!0,i=!1}catch(e){console.error(`[composer-mention] failed to fetch pages`,e),t=[],i=!0}finally{r=null}}return k(t,a).map(e=>({docName:e.docName,title:e.title,path:xx(e)})).filter(e=>e.path!==``)},reset(){t=[],n=!1,r=null,i=!1}}}function Ax(e){let t=kx();return W({editor:e,pluginKey:bx,char:`@`,items:({query:e})=>t.getItems(e),command:({editor:e,range:t,props:n})=>{try{e.chain().focus().deleteRange(t).insertContent([{type:`composerMention`,attrs:{path:n.path,label:n.title}},{type:`text`,text:` `}]).run()}catch(e){console.error(`[composer-mention] insert failed`,{item:n,range:t},e)}},render:()=>{let e=null,n=null,r=0,i={popup:null,stopAutoUpdate:null},a=null,o=null,s=e=>{n?.command(e)},c=e=>{let n=e.items??[],{loaded:i,error:a}=t.snapshot();return{items:n,query:e.query??``,selectedIndex:r,onSelect:s,loading:!i&&!a,error:a,hasMore:n.length>=yx}},l=()=>{!e||!n||e.updateProps(c(n))};return{onBeforeStart(t){n=t,r=0;let s=ce(()=>n,`composer-mention`);i.popup=s.popup,a=s.doPosition,o=s.reveal,e=new rt(vx,{props:c(t),editor:t.editor}),s.popup.appendChild(e.element),i.stopAutoUpdate=s.startAutoUpdate()},onStart(e){n=e,r=0,l(),o?.()},onUpdate(e){n=e,r=Math.min(r,Math.max(0,e.items.length-1)),l(),a?.()},onKeyDown({event:e}){if(!n)return!1;let t=n.items;if(e.key===`ArrowDown`)return t.length===0?!1:(r=(r+1)%t.length,l(),!0);if(e.key===`ArrowUp`)return t.length===0?!1:(r=(r-1+t.length)%t.length,l(),!0);if(e.key===`Enter`||e.key===`Tab`){let e=t[r];return e?(n.command(e),!0):!1}return!1},onExit(){y(i),a=null,o=null,e?.destroy(),e=null,n=null,r=0,t.reset()}}}})}function jx(e){let t=[],n=new Set,r=[];return e.state.doc.forEach(e=>{let i=``;e.forEach(e=>{if(e.type.name===`composerMention`){let r=String(e.attrs.path??``);r!==``&&(i+=`@${r}`,n.has(r)||(n.add(r),t.push(r)))}else e.isText?i+=e.text??``:e.type.name===`hardBreak`&&(i+=`
|
|
23
23
|
`)}),r.push(i)}),{instruction:r.join(`
|
|
24
|
-
`).trim(),mentions:t}}function Mx(e){let{instruction:t,mentions:n}=jx(e);return t===``&&n.length===0}function Nx(e){let t=e?.content;return!Array.isArray(t)||t.length===0?!1:t.some(e=>Array.isArray(e.content)&&e.content.length>0)}function Px(e){let t=(0,$.c)(29),{ref:n,ariaLabel:r,onEmptyChange:i,onContentChange:a,onMentionsChange:o,onSubmit:s,className:c,placeholder:l,initialDoc:u}=e,d=(0,Q.useRef)(i),f=(0,Q.useRef)(a),p=(0,Q.useRef)(o),m=(0,Q.useRef)(s),h;t[0]!==a||t[1]!==i||t[2]!==o||t[3]!==s?(h=()=>{d.current=i,f.current=a,p.current=o,m.current=s},t[0]=a,t[1]=i,t[2]=o,t[3]=s,t[4]=h):h=t[4],(0,Q.useEffect)(h);let g;t[5]===l?g=t[6]:(g=Ox({placeholder:l}),t[5]=l,t[6]=g);let _=u??void 0,v;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(v=Y(`composer-prosemirror py-1 outline-none`),t[7]=v):v=t[7];let y;t[8]===r?y=t[9]:(y={role:`textbox`,"aria-label":r,"aria-multiline":`true`,class:v},t[8]=r,t[9]=y);let b;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(b=(e,t)=>t.key===`Escape`?bx.getState(e.state)?.active?!1:(e.dom.blur(),!0):t.key===`Enter`&&!t.shiftKey&&!t.isComposing&&!e.composing?bx.getState(e.state)?.active?!1:(m.current(),!0):!1,t[10]=b):b=t[10];let x;t[11]===y?x=t[12]:(x={attributes:y,handleKeyDown:b},t[11]=y,t[12]=x);let S;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(S=e=>{let{editor:t}=e;d.current(Mx(t)),f.current?.(t.getJSON()),p.current?.(jx(t).mentions)},t[13]=S):S=t[13];let C;t[14]!==g||t[15]!==_||t[16]!==x?(C={extensions:g,content:_,immediatelyRender:!0,editorProps:x,onUpdate:S},t[14]=g,t[15]=_,t[16]=x,t[17]=C):C=t[17];let w=V(C),T;t[18]!==w||t[19]!==u?(T=()=>{w&&(Mx(w)&&Nx(u)&&(console.warn(`composer draft was incompatible with the current schema — clearing it`),px()),d.current(Mx(w)),p.current?.(jx(w).mentions))},t[18]=w,t[19]=u,t[20]=T):T=t[20];let E;t[21]===w?E=t[22]:(E=[w],t[21]=w,t[22]=E),(0,Q.useEffect)(T,E);let D,O;t[23]===w?(D=t[24],O=t[25]):(D=()=>({focus:()=>w?.commands.focus(),blur:()=>w?.commands.blur(),clear:()=>w?.commands.clearContent(!0),setText:e=>{w&&(w.commands.setContent(e),f.current?.(w.getJSON()),p.current?.(jx(w).mentions))},getContent:()=>w?jx(w):{instruction:``,mentions:[]}}),O=[w],t[23]=w,t[24]=D,t[25]=O),(0,Q.useImperativeHandle)(n,D,O);let k;return t[26]!==c||t[27]!==w?(k=(0,Z.jsx)(ot,{editor:w,className:c}),t[26]=c,t[27]=w,t[28]=k):k=t[28],k}function Fx(e,t,n){return e.trim().length>0||t.length>0||n}var Ix=new Set(ta.map(e=>e.id));function Lx(e){return typeof e==`string`&&Ix.has(e)}function Rx(e){try{let t=o_(e);return Lx(t)?t:null}catch{return null}}function zx(e,t){s_(e,t)}function Bx(e){let{lastUsed:t,states:n}=e;return t&&n[t]?.installed===!0?t:ta.find(e=>n[e.id]?.installed===!0)?.id??null}function Vx(e){let t=(0,$.c)(28),{scenario:n,className:r}=e,{_:i}=$t(),{states:a,refresh:o}=pa(),{dispatch:s}=xa(),c=$i(),l=ya(),[u,d]=(0,Q.useState)(Wx),f=(0,Q.useRef)(!1),[p,m]=(0,Q.useState)(null),h=p!==null&&l!==null,g=(0,Q.useRef)(null),[_]=(0,Q.useState)(Ux),[v,y]=(0,Q.useState)(!0),[b,x]=(0,Q.useState)(!1),S;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(S=function(e){y(e),e||x(!1)},t[0]=S):S=t[0];let C=S,w=Qb(n),T;t[1]===a?T=t[2]:(T=e=>a[e.id]?.installed===!0,t[1]=a,t[2]=T);let E=ta.filter(T),D;t[3]===a?D=t[4]:(D=ta.every(e=>a[e.id]?.installed!=null),t[3]=a,t[4]=D);let O=D,k=O&&E.length===0,A,j;t[5]!==O||t[6]!==a?(A=()=>{if(!O||f.current)return;let e=Bx({lastUsed:Rx(),states:a});d(t=>e===t?t:e)},j=[O,a],t[5]=O,t[6]=a,t[7]=A,t[8]=j):(A=t[7],j=t[8]),(0,Q.useEffect)(A,j);let M=function(e){f.current=!0,m(null),d(e),zx(e)},N=function(e){f.current=!0,m(e)},P=function(){if(l===null||p===null)return;let{instruction:e,mentions:t}=g.current?.getContent()??{instruction:``,mentions:[]};if(!Fx(e,t,!1)){x(!0);return}let r=ca({workspace:c,description:e,scenario:n,mentions:t});r!==null&&(l.launchInTerminal(r,p),g.current?.clear(),px())},F=function(e){let{instruction:t,mentions:r}=g.current?.getContent()??{instruction:``,mentions:[]};if(!Fx(t,r,!1)){x(!0);return}zx(e);let i=ca({workspace:c,description:t,scenario:n,mentions:r});i!==null&&(s(e,i),g.current?.clear(),px())},I=function(){h?P():u!==null&&F(u)},L=function(e){g.current?.setText(e),g.current?.focus()};if(k){let e;t[9]===r?e=t[10]:(e=Y(`flex w-full flex-wrap items-center justify-between gap-3 rounded-2xl border border-border/60 bg-card px-4 py-3`,r),t[9]=r,t[10]=e);let n;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsx)(ns,{"aria-hidden":`true`,className:`size-4 shrink-0 text-muted-foreground`}),t[11]=n):n=t[11];let i;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2.5`,children:[n,(0,Z.jsx)(`span`,{className:`text-1sm text-muted-foreground`,children:(0,Z.jsx)(J,{id:`3IseAk`})})]}),t[12]=i):i=t[12];let a;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Z.jsx)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:ta.map(Hx)}),t[13]=a):a=t[13];let o;return t[14]===e?o=t[15]:(o=(0,Z.jsxs)(`div`,{className:e,"data-testid":`create-no-agents`,children:[i,a]}),t[14]=e,t[15]=o),o}let R=E.length>0,z=l!==null,B;t[16]===r?B=t[17]:(B=Y(`flex w-full flex-col gap-3`,r),t[16]=r,t[17]=B);let V;t[18]===i?V=t[19]:(V=i({id:`7hctf2`}),t[18]=i,t[19]=V);let H;t[20]===i?H=t[21]:(H=i({id:`0jD-Gn`}),t[20]=i,t[21]=H);let U;t[22]!==v||t[23]!==b?(U=b&&v?(0,Z.jsx)(`p`,{role:`alert`,className:`text-1sm text-destructive`,"data-testid":`create-input-required`,children:(0,Z.jsx)(J,{id:`1FLarN`})}):(0,Z.jsx)(`span`,{}),t[22]=v,t[23]=b,t[24]=U):U=t[24];let W=u===null?(0,Z.jsx)(X,{type:`button`,variant:`outline`,disabled:!0,className:`gap-1.5`,"data-testid":`create-with-agent`,children:(0,Z.jsx)(J,{id:`hYgDIe`})}):(0,Z.jsxs)(hx,{children:[(0,Z.jsx)(X,{type:`button`,onClick:()=>h?P():F(u),variant:`outline`,className:`gap-1.5`,"data-testid":`create-with-agent`,children:h&&p!==null?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(sa,{id:oa(p),"aria-hidden":`true`,className:`size-3.5`}),(0,Z.jsx)(J,{id:`4rjwLG`,values:{0:zn[p].displayName}})]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(sa,{id:u,"aria-hidden":`true`,className:`size-3.5`}),(0,Z.jsx)(J,{id:`9dw5bW`,values:{0:na(u)}})]})}),(0,Z.jsxs)(Tc,{onOpenChange:e=>{e&&o()},children:[(0,Z.jsx)(hc,{asChild:!0,children:(0,Z.jsx)(X,{type:`button`,"aria-label":i({id:`nskygk`}),size:`icon`,variant:`outline`,"data-testid":`create-with-agent-menu`,children:(0,Z.jsx)(Wi,{"aria-hidden":`true`,className:`size-3.5`})})}),(0,Z.jsxs)(yc,{align:`end`,className:`min-w-[200px]`,children:[z?(0,Z.jsxs)(vc,{"aria-label":i({id:`ALhMYW`}),children:[(0,Z.jsx)(Oc,{children:(0,Z.jsx)(J,{id:`ALhMYW`})}),va.map(e=>{let{displayName:t}=zn[e];return(0,Z.jsxs)(_c,{onSelect:()=>N(e),"data-testid":`create-with-cli-${e}`,"aria-label":i({id:`QYfQdv`,values:{displayName:t}}),children:[(0,Z.jsx)(sa,{id:oa(e),"aria-hidden":`true`,className:`size-4`}),(0,Z.jsx)(`span`,{className:`flex-1`,children:t}),p===e?(0,Z.jsx)(Ui,{"aria-hidden":`true`,className:`size-4 text-muted-foreground`}):null]},e)})]}):null,R?(0,Z.jsxs)(Z.Fragment,{children:[z?(0,Z.jsx)(Ac,{}):null,(0,Z.jsxs)(vc,{"aria-label":i({id:`BBqGS9`}),children:[(0,Z.jsx)(Oc,{children:(0,Z.jsx)(J,{id:`BBqGS9`})}),E.map(e=>(0,Z.jsxs)(_c,{onSelect:()=>M(e.id),"data-testid":`create-agent-option-${e.id}`,children:[(0,Z.jsx)(sa,{id:e.id,"aria-hidden":`true`,className:`size-4`}),(0,Z.jsx)(`span`,{className:`flex-1`,children:e.displayName}),!h&&e.id===u?(0,Z.jsx)(Ui,{"aria-hidden":`true`,className:`size-4 text-muted-foreground`}):null]},e.id))]})]}):null]})]})]}),G;return t[25]!==W||t[26]!==U?(G=(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2 px-3 pb-3`,children:[U,W]}),t[25]=W,t[26]=U,t[27]=G):G=t[27],(0,Z.jsxs)(`div`,{className:B,children:[(0,Z.jsxs)(`div`,{className:`flex w-full flex-col rounded-2xl border border-border/60 bg-card shadow-sm transition-colors focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/50`,children:[(0,Z.jsx)(Px,{ref:g,ariaLabel:V,placeholder:H,onEmptyChange:C,onContentChange:fx,onSubmit:I,initialDoc:_,className:`max-h-96 overflow-y-auto px-4 py-3 text-sm leading-relaxed subtle-scrollbar [&_.ProseMirror]:min-h-16`}),G]}),n!==`existing-repo`&&w.length>0?(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center justify-center gap-2`,children:[(0,Z.jsx)(`span`,{className:`text-1sm text-muted-foreground`,children:(0,Z.jsx)(J,{id:`I5685_`})}),w.map(e=>{let t=e.icon;return(0,Z.jsxs)(X,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>L(e.prompt),className:`gap-1.5 rounded-md font-normal text-muted-foreground hover:text-foreground`,"data-testid":`create-suggestion-${e.id}`,children:[(0,Z.jsx)(t,{className:`size-3.5`,"aria-hidden":`true`}),e.label]},e.id)})]}):null]})}function Hx(e){return(0,Z.jsxs)(X,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>void Qi(e),className:`gap-1.5`,"data-testid":`install-agent-${e.id}`,children:[(0,Z.jsx)(sa,{id:e.id,"aria-hidden":`true`,className:`size-3.5`}),e.displayName,(0,Z.jsx)(Mi,{"aria-hidden":`true`,className:`size-3`})]},e.id)}function Ux(){return dx().doc??void 0}function Wx(){return Rx()}var Gx=3100,Kx=3;function qx(e,t,n){let r=n?.windowMs??600,i=n?.maxLevel??Kx;if(e===0||t>=r)return 1;let a=e+1;return a>i?i:a}var Jx={0:{count:0,startRadius:0,baseDistance:0,distanceVariance:0,sizeMin:0,sizeMax:0,maxDelay:0,durationMin:0,durationMax:0},1:{count:0,startRadius:0,baseDistance:0,distanceVariance:0,sizeMin:0,sizeMax:0,maxDelay:0,durationMin:0,durationMax:0},2:{count:0,startRadius:0,baseDistance:0,distanceVariance:0,sizeMin:0,sizeMax:0,maxDelay:0,durationMin:0,durationMax:0},3:{count:16,startRadius:11,baseDistance:7,distanceVariance:3,sizeMin:.45,sizeMax:1.2,maxDelay:500,durationMin:1100,durationMax:2400}},Yx=[`var(--color-azure-blue)`,`var(--color-sky-blue)`,`var(--color-violet-300)`,`var(--color-orange-light)`,`var(--color-crystal-blue)`,`var(--color-white-cream)`];function Xx(e,t={}){let n=t.rng??Math.random,r=t.colors??Yx,i=Jx[e];if(i.count===0||r.length===0)return[];let a=[],o=Math.PI*2/i.count;for(let e=0;e<i.count;e++){let t=e*o+(n()-.5)*o*.7,s=i.baseDistance+(n()-.5)*2*i.distanceVariance,c=i.sizeMin+n()*(i.sizeMax-i.sizeMin),l=n()*i.maxDelay,u=i.durationMin+n()*(i.durationMax-i.durationMin),d=Math.floor(n()*r.length),f=Math.cos(t),p=Math.sin(t);a.push({id:e,dx:f*s,dy:p*s,originDx:f*i.startRadius,originDy:p*i.startRadius,size:c,color:r[d]??`currentColor`,delay:l,duration:u})}return a}var Zx=1.8,Qx=90,$x=16,eS=380,tS=.025,nS=.1,rS=.18,iS=400,aS=9.2736,oS=18.1799,sS=14.5244,cS={1:{halfWidth:1.5,apexLift:2.2},2:{halfWidth:1.4,apexLift:2.6},3:{halfWidth:1.25,apexLift:3}};function lS(e,t){let{halfWidth:n,apexLift:r}=cS[t];return`M${e-n} ${sS+.3} Q${e} ${sS-r}, ${e+n} ${sS+.3}`}function uS(e){let t=1.5,n=.3;return`M${e-t} ${sS-n} Q${e} ${sS+1.4}, ${e+t} ${sS-n}`}var dS=15,fS=15;function pS(e){return{fill:e.color,"--fx-tx":`${e.dx}px`,"--fx-ty":`${e.dy}px`,"--fx-delay":`${e.delay}ms`,"--fx-duration":`${e.duration}ms`}}function mS(e){let t=(0,$.c)(71),{size:n,className:r,trackMouse:i,variant:a,celebrateSignal:o}=e,s=n===void 0?48:n,c=i===void 0?!0:i,l=a===void 0?`default`:a,u=o===void 0?0:o,d=(0,Q.useRef)(null),f=(0,Q.useRef)(null),p=(0,Q.useRef)(null),m;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(m={x:0,y:0},t[0]=m):m=t[0];let h=(0,Q.useRef)(m),[g,_]=(0,Q.useState)(0),[v,y]=(0,Q.useState)(0),b;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(b=[],t[1]=b):b=t[1];let[x,S]=(0,Q.useState)(b),C=(0,Q.useRef)(0),w=(0,Q.useRef)(void 0),T=l===`sleeping`,E;t[2]!==g||t[3]!==T?(E=function(){if(T)return;let e=typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now(),t=C.current===0?1/0:e-C.current;C.current=e;let n=qx(g,t);_(n),y(vS),S(Xx(n)),clearTimeout(w.current),w.current=setTimeout(()=>{_(0),S([])},Gx)},t[2]=g,t[3]=T,t[4]=E):E=t[4];let D=E,O,k;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(O=()=>()=>clearTimeout(w.current),k=[],t[5]=O,t[6]=k):(O=t[5],k=t[6]),(0,Q.useEffect)(O,k);let A,j;t[7]!==u||t[8]!==T?(A=()=>{u===0||T||(_(3),y(_S),S(Xx(3)),clearTimeout(w.current),w.current=setTimeout(()=>{_(0),S([])},Gx))},j=[u,T],t[7]=u,t[8]=T,t[9]=A,t[10]=j):(A=t[9],j=t[10]),(0,Q.useEffect)(A,j);let M,N;t[11]!==T||t[12]!==c?(M=()=>{if(!c||T||window.matchMedia(`(prefers-reduced-motion: reduce)`).matches)return;let e=0,t=0,n=!1,r=0,i=0,a=0,o=0,s=0,l=function(){s===0&&(s=requestAnimationFrame(m))},u=function(r){e=r.clientX,t=r.clientY,n=!0,l()};function m(){s=0;let c=f.current,u=d.current;if(!c||!u){l();return}let m=n;n=!1;let g=c.getBoundingClientRect(),_=g.left+g.width/2,v=g.top+g.height*.48,y=e-_,b=t-v,x=Math.hypot(y,b),S=Math.max(-1,Math.min(1,y/eS)),C=-Math.max(-1,Math.min(1,b/eS))*$x,w=S*$x,T=0,E=0;if(x>=1){let e=Math.min(x/Qx,1)*Zx;T=y/x*e,E=b/x*e}let D=Math.abs(C-r)<.01&&Math.abs(w-i)<.01&&Math.abs(T-a)<.01&&Math.abs(E-o)<.01;if(!m&&D)return;l(),r+=(C-r)*nS,i+=(w-i)*nS,u.style.transform=`perspective(${iS}px) rotateX(${r.toFixed(3)}deg) rotateY(${i.toFixed(3)}deg)`,a+=(T-a)*rS,o+=(E-o)*rS;let O=i*tS,k=-r*tS,A=a+O,j=o+k;h.current.x=A,h.current.y=j,p.current?.setAttribute(`transform`,`translate(${A.toFixed(3)} ${j.toFixed(3)})`)}return document.addEventListener(`mousemove`,u,{passive:!0}),l(),()=>{document.removeEventListener(`mousemove`,u),s!==0&&cancelAnimationFrame(s),s=0,d.current&&(d.current.style.transform=``),h.current={x:0,y:0},p.current?.removeAttribute(`transform`)}},N=[c,T],t[11]=T,t[12]=c,t[13]=M,t[14]=N):(M=t[13],N=t[14]),(0,Q.useEffect)(M,N);let P;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(P=()=>{let e=p.current;if(!e)return;let{x:t,y:n}=h.current;e.setAttribute(`transform`,`translate(${t.toFixed(3)} ${n.toFixed(3)})`)},t[15]=P):P=t[15],(0,Q.useLayoutEffect)(P);let F=g>0,I=F?g:1,L=F?`ok-blob-clicked-${g}`:null,R;t[16]===r?R=t[17]:(R=Y(`ok-blob-3d-wrapper`,r),t[16]=r,t[17]=R);let z=T?`cursor-default`:`cursor-pointer`,B=`body-${v}`,V=T&&`ok-blob-sleeping`,H;t[18]!==L||t[19]!==V?(H=Y(`ok-blob-group`,V,L),t[18]=L,t[19]=V,t[20]=H):H=t[20];let U;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,Z.jsx)(`path`,{d:`M25.2339 6.78134C25.5199 7.35734 25.8179 8.47234 26.0179 9.07834C26.0189 9.08234 26.0209 9.08634 26.0219 9.09134C26.0229 9.09534 26.0249 9.10034 26.0259 9.10434C26.0539 9.19734 26.0949 9.29533 26.1519 9.41633C26.2919 9.71133 26.5269 10.1173 27.1299 11.1683C27.3259 11.4643 27.5209 11.7693 27.7119 12.0903C29.9739 15.1623 29.3259 20.1913 27.0469 22.9153C26.7779 23.2953 26.4869 23.6043 26.1889 23.8863C26.1519 23.9253 26.1129 23.9643 26.0729 24.0033C25.3159 24.7543 24.2949 25.4673 23.6129 25.8323C22.7469 26.2983 22.1349 26.5483 21.6299 26.7463C20.3649 27.3063 19.0609 27.7733 17.6569 28.0423C15.9649 28.3513 14.1939 28.4433 12.4569 28.1373C11.4779 27.9663 10.5119 27.6663 9.60891 27.2493C8.77491 26.8663 7.99192 26.3853 7.26992 25.8403C6.83592 25.5393 6.43893 25.2343 6.08093 24.9383C5.57893 24.5223 5.15993 24.1263 4.83493 23.7793C4.04993 22.9443 3.31593 21.8893 2.80893 21.0953C2.72593 20.9663 2.64792 20.8433 2.57592 20.7293C2.56192 20.7093 2.54793 20.6893 2.53393 20.6703C2.08593 20.0263 1.71892 19.3293 1.43792 18.5993C1.42892 18.5453 1.42093 18.4903 1.41293 18.4353C1.32093 17.7443 1.08292 16.9423 1.01092 15.6333C0.984921 15.0653 0.998928 14.4013 1.12393 13.6353C1.20693 13.1413 1.31993 12.9023 1.40893 12.7113C1.43593 12.6543 1.46193 12.6023 1.48593 12.5483C1.56793 12.3653 1.59392 12.1563 1.63592 11.9083C1.68992 11.5883 1.76992 11.1943 2.04592 10.7553C2.94392 9.37934 3.36792 8.81934 3.66592 8.33934C3.75592 8.20334 3.84292 8.08134 3.94192 7.96634C4.21592 7.64634 4.67693 7.29534 5.10293 7.05734C5.16693 7.02234 5.23093 6.98834 5.29193 6.95534C5.62993 6.77834 6.22592 6.30135 6.66992 5.92035C6.83692 5.77635 7.08193 5.60735 7.37393 5.40935C7.67393 5.20535 8.02593 4.96934 8.39193 4.70234C9.32093 4.02634 9.84091 3.69134 10.2599 3.42334C10.3799 3.34734 10.4919 3.27734 10.6049 3.20834C10.9609 2.98834 11.4149 2.73034 11.8869 2.48634C12.4519 2.19334 13.0469 1.92133 13.5089 1.72233C14.7399 1.30233 16.0539 1.01333 17.4169 1.00033C18.1169 0.991333 18.7939 1.16534 19.2389 1.43034C19.6869 1.69534 19.8689 2.00335 19.8039 2.23935C19.7379 2.47835 19.4399 2.63634 19.0109 2.74734C18.5789 2.85634 18.0469 2.92035 17.4889 2.96135C16.3639 3.04235 15.2399 3.36435 14.1499 3.80835C12.8199 4.35135 11.5379 5.07133 10.2719 5.84733C9.38691 6.39133 8.51192 6.97334 7.63592 7.56834C7.54492 7.63034 7.45492 7.69135 7.36492 7.75235C6.97392 8.06635 6.58293 8.38134 6.22293 8.66334C5.97893 8.85734 5.76793 9.04834 5.59393 9.21434C5.26893 9.52334 5.02393 9.74334 4.81893 9.93934C4.67793 10.0753 4.55793 10.2013 4.45593 10.3443C4.40093 10.4213 4.32992 10.5273 4.24792 10.6593C3.90492 11.1933 3.44493 12.1693 3.15393 13.1173C3.01893 13.5363 2.87991 14.0343 2.79391 14.5253C2.66591 15.2253 2.65594 15.9053 2.71994 16.2373C2.82794 16.8193 2.95593 17.4833 3.14093 18.0553C3.31293 18.6003 3.52991 19.0583 3.70791 19.2823C3.81591 19.4183 3.90394 19.5473 3.99594 19.6913C4.09394 19.8413 4.19191 20.0073 4.31091 20.2033C4.47891 20.4803 4.68592 20.8163 5.00192 21.2493C5.36492 21.7463 5.61793 22.1043 5.83493 22.4023C6.14493 22.8243 6.38591 23.1343 6.83691 23.5033C7.33891 23.9113 7.86593 24.3113 8.26693 24.6393C8.44893 24.7883 8.66993 24.9443 8.90493 25.0963C9.21593 25.2963 9.55192 25.4893 9.85592 25.6703C10.1059 25.8203 10.3059 25.9633 10.4869 26.0863C10.5429 26.1243 10.5979 26.1603 10.6519 26.1943C10.8699 26.2803 11.0929 26.3593 11.3159 26.4283C11.3539 26.4323 11.3949 26.4353 11.4369 26.4393C11.6509 26.4573 11.9089 26.4733 12.2209 26.5133C12.7169 26.5753 13.1399 26.6603 13.6019 26.7243C13.9589 26.7733 14.3409 26.8083 14.7729 26.7893C15.0729 26.7753 15.4069 26.7353 15.7389 26.6813C16.2349 26.6023 16.7179 26.4943 17.0569 26.4473C17.1499 26.4343 17.2359 26.4343 17.3209 26.4373C17.3489 26.4393 17.3799 26.4413 17.4109 26.4433C17.4119 26.4433 17.4119 26.4433 17.4129 26.4433C17.4199 26.4433 17.4279 26.4443 17.4349 26.4443C18.2329 26.2413 19.0259 25.9433 19.7959 25.5983C19.8609 25.5633 19.9259 25.5273 19.9899 25.4913C20.3059 25.3173 20.6049 25.1383 20.7869 24.9943C20.9829 24.8393 21.5189 24.5373 22.0579 24.1853C22.4109 23.9553 22.7649 23.7053 23.0369 23.4833C23.1949 23.3553 23.3689 23.2693 23.5479 23.1773C23.7129 23.0923 23.8809 23.0013 24.0349 22.8653C24.1109 22.7983 24.1869 22.7173 24.2639 22.6303C24.3309 22.5563 24.4039 22.4723 24.4759 22.3923C24.5459 22.3153 24.7199 22.1723 24.9139 21.9793C25.0079 21.8863 25.1059 21.7783 25.1909 21.6713C25.2199 21.6323 25.2489 21.5943 25.2769 21.5553C25.5919 21.0403 25.8779 20.5003 26.1019 19.9653C26.1299 19.8403 26.1379 19.7293 26.1279 19.6373C26.1199 19.5703 26.1029 19.5113 26.0839 19.4503C26.0599 19.3643 26.0329 19.2773 26.0239 19.1723C26.0169 19.0893 26.0309 19.0043 26.0629 18.9543C26.0779 18.9323 26.0969 18.9143 26.1129 18.8993C26.1329 18.8823 26.1499 18.8673 26.1569 18.8443C26.1609 18.8273 26.1579 18.8073 26.1529 18.7833C26.1459 18.7443 26.1369 18.6943 26.1539 18.6293C26.2189 18.3853 26.2869 18.1103 26.3319 17.8383C26.3829 17.5393 26.4049 17.2433 26.3949 17.0123C26.3849 16.7493 26.3909 16.3823 26.3469 16.0003C26.3179 15.7343 26.2659 15.4663 26.1979 15.2383C26.1319 15.0143 26.0219 14.7913 25.9039 14.5783C25.7629 14.3223 25.6119 14.0783 25.5169 13.8453C25.4969 13.7983 25.4999 13.7263 25.4999 13.6323C25.5009 13.5673 25.4999 13.4913 25.4919 13.4083C25.3239 13.1243 25.1459 12.8423 24.9589 12.5483C24.9479 12.5413 24.9369 12.5333 24.9249 12.5263C24.6689 12.3503 24.3139 12.1173 24.0769 11.5503C24.0179 11.4063 24.0069 11.2983 23.9969 11.1993C23.9859 11.1013 23.9799 11.0183 23.9289 10.9093C23.8709 10.7853 23.7759 10.6583 23.6709 10.4993C23.5849 10.3703 23.4899 10.2133 23.4199 10.0423C23.3819 9.95134 23.3509 9.85734 23.3329 9.75934C23.3299 9.74334 23.3269 9.72534 23.3229 9.70634C23.2899 9.52734 23.2439 9.26534 23.2409 8.98634C23.0209 8.24434 22.8339 7.48833 22.6519 6.77633C22.3429 5.57133 22.0519 4.54234 21.3329 3.95434C20.9839 3.65334 20.5689 3.35433 20.2459 3.05433C19.9259 2.75633 19.7449 2.47534 19.8019 2.23834C19.8639 2.00634 20.1589 1.82934 20.6659 1.80534C21.1699 1.78334 21.8699 1.93235 22.5209 2.39235C23.6159 3.14235 24.2029 4.38334 24.5599 5.35734C24.5829 5.40834 24.6049 5.46034 24.6259 5.51234C24.7849 5.89434 24.9529 6.22834 25.1199 6.55534C25.1579 6.63034 25.1969 6.70834 25.2339 6.78134Z`,className:`ok-blob-body`}),t[21]=U):U=t[21];let W=(F||T)&&`ok-blob-eye-hidden`,G;t[22]===W?G=t[23]:(G=Y(`ok-blob-eye`,W),t[22]=W,t[23]=G);let K;t[24]===G?K=t[25]:(K=(0,Z.jsx)(`ellipse`,{cx:aS,cy:sS,rx:1.2722,ry:1.9083,className:G}),t[24]=G,t[25]=K);let ee=(F||T)&&`ok-blob-eye-hidden`,te;t[26]===ee?te=t[27]:(te=Y(`ok-blob-eye ok-blob-eye-right`,ee),t[26]=ee,t[27]=te);let ne;t[28]===te?ne=t[29]:(ne=(0,Z.jsx)(`ellipse`,{cx:oS,cy:sS,rx:1.2722,ry:1.9083,className:te}),t[28]=te,t[29]=ne);let re;t[30]===I?re=t[31]:(re=lS(aS,I),t[30]=I,t[31]=re);let ie=(!F||T)&&`ok-blob-eye-hidden`,ae;t[32]===ie?ae=t[33]:(ae=Y(`ok-blob-happy-eye`,ie),t[32]=ie,t[33]=ae);let oe;t[34]!==re||t[35]!==ae?(oe=(0,Z.jsx)(`path`,{d:re,strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:ae}),t[34]=re,t[35]=ae,t[36]=oe):oe=t[36];let se;t[37]===I?se=t[38]:(se=lS(oS,I),t[37]=I,t[38]=se);let ce=(!F||T)&&`ok-blob-eye-hidden`,le;t[39]===ce?le=t[40]:(le=Y(`ok-blob-happy-eye`,ce),t[39]=ce,t[40]=le);let q;t[41]!==se||t[42]!==le?(q=(0,Z.jsx)(`path`,{d:se,strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:le}),t[41]=se,t[42]=le,t[43]=q):q=t[43];let ue;t[44]===T?ue=t[45]:(ue=T?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`path`,{d:uS(aS),strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:`ok-blob-sleeping-eye`}),(0,Z.jsx)(`path`,{d:uS(oS),strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:`ok-blob-sleeping-eye`})]}):null,t[44]=T,t[45]=ue);let de;t[46]!==K||t[47]!==ne||t[48]!==oe||t[49]!==q||t[50]!==ue?(de=(0,Z.jsxs)(`g`,{ref:p,children:[K,ne,oe,q,ue]}),t[46]=K,t[47]=ne,t[48]=oe,t[49]=q,t[50]=ue,t[51]=de):de=t[51];let fe;t[52]!==B||t[53]!==H||t[54]!==de?(fe=(0,Z.jsxs)(`g`,{className:H,children:[U,de]},B),t[52]=B,t[53]=H,t[54]=de,t[55]=fe):fe=t[55];let pe;t[56]===T?pe=t[57]:(pe=T?(0,Z.jsxs)(`g`,{children:[(0,Z.jsx)(`text`,{x:21,y:7,className:`ok-blob-z ok-blob-z-1`,children:`z`}),(0,Z.jsx)(`text`,{x:26,y:2,className:`ok-blob-z ok-blob-z-2`,children:`z`})]}):null,t[56]=T,t[57]=pe);let me;t[58]!==v||t[59]!==x?(me=x.length>0&&(0,Z.jsx)(`g`,{children:x.map(hS)},`firework-${v}`),t[58]=v,t[59]=x,t[60]=me):me=t[60];let he;t[61]!==D||t[62]!==s||t[63]!==z||t[64]!==fe||t[65]!==pe||t[66]!==me?(he=(0,Z.jsxs)(`svg`,{ref:f,width:s,height:s,viewBox:`0 0 30 30`,fill:`none`,overflow:`visible`,xmlns:`http://www.w3.org/2000/svg`,className:z,"aria-hidden":`true`,onClick:D,onMouseDown:gS,children:[fe,pe,me]}),t[61]=D,t[62]=s,t[63]=z,t[64]=fe,t[65]=pe,t[66]=me,t[67]=he):he=t[67];let ge;return t[68]!==R||t[69]!==he?(ge=(0,Z.jsx)(`span`,{ref:d,className:R,children:he}),t[68]=R,t[69]=he,t[70]=ge):ge=t[70],ge}function hS(e){return(0,Z.jsx)(`circle`,{cx:dS+e.originDx,cy:fS+e.originDy,r:e.size,className:`ok-blob-firework`,style:pS(e)},e.id)}function gS(e){return e.preventDefault()}function _S(e){return e+1}function vS(e){return e+1}function yS(e){let t=(0,$.c)(12),{title:n,subtitle:r,celebrateSignal:i}=e,a;t[0]===i?a=t[1]:(a=(0,Z.jsx)(mS,{size:64,celebrateSignal:i}),t[0]=i,t[1]=a);let o;t[2]===n?o=t[3]:(o=(0,Z.jsx)(`h2`,{className:`text-2xl font-light tracking-tighter text-balance`,children:n}),t[2]=n,t[3]=o);let s;t[4]===r?s=t[5]:(s=r?(0,Z.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:r}):null,t[4]=r,t[5]=s);let c;t[6]!==o||t[7]!==s?(c=(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[o,s]}),t[6]=o,t[7]=s,t[8]=c):c=t[8];let l;return t[9]!==a||t[10]!==c?(l=(0,Z.jsxs)(`div`,{className:`flex flex-col items-start gap-3 @md/emptystate:flex-row @md/emptystate:items-center @md/emptystate:gap-4`,children:[a,c]}),t[9]=a,t[10]=c,t[11]=l):l=t[11],l}function bS({isOnboarding:e,isEmbedded:t}){return e?{title:{id:`6h4zVU`},subtitle:t?{id:`vGeNNQ`}:{id:`qpQwGC`}}:{title:{id:`FOGD7m`},subtitle:t?{id:`3DTatP`}:{id:`MqQoV-`}}}var xS=`open-knowledge:create-top-level-file`;function SS(e={}){window.dispatchEvent(new CustomEvent(xS,{detail:e}))}function CS(e){let t=t=>{let n=t.detail;e(n??{})};return window.addEventListener(xS,t),()=>window.removeEventListener(xS,t)}function wS(e){let t=(0,$.c)(28),{celebrateSignal:n,onAddStarterPack:r}=e,{_:i}=$t(),a=da(),{title:o,subtitle:s}=bS({isOnboarding:!1,isEmbedded:a}),c=so(),l;t[0]!==c.data||t[1]!==c.status?(l=c.status===`ready`?c.data:[],t[0]=c.data,t[1]=c.status,t[2]=l):l=t[2];let u=l,d=c.status===`loading`||c.status===`idle`,f=c.status===`error`,p=yS,m=i(o),h=i(s),g;t[3]!==p||t[4]!==n||t[5]!==m||t[6]!==h?(g=(0,Z.jsx)(p,{title:m,subtitle:h,celebrateSignal:n}),t[3]=p,t[4]=n,t[5]=m,t[6]=h,t[7]=g):g=t[7];let _;t[8]===a?_=t[9]:(_=a?(0,Z.jsx)($b,{scenario:`existing-repo`}):(0,Z.jsx)(Vx,{scenario:`existing-repo`}),t[8]=a,t[9]=_);let v;t[10]!==u||t[11]!==f||t[12]!==d?(v=d||f||u.length>0?(0,Z.jsx)(DS,{templates:u,loading:d,error:f,onSelect:ES}):null,t[10]=u,t[11]=f,t[12]=d,t[13]=v):v=t[13];let y,b;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Z.jsx)(Zt,{"aria-hidden":`true`,className:`size-3`}),b=(0,Z.jsx)(J,{id:`IajAbS`}),t[14]=y,t[15]=b):(y=t[14],b=t[15]);let x;t[16]===r?x=t[17]:(x=(0,Z.jsxs)(X,{onClick:r,variant:`link-muted`,size:`xs`,className:`font-mono text-xs uppercase tracking-wider`,children:[y,b]}),t[16]=r,t[17]=x);let S;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,Z.jsx)(X,{variant:`link-muted`,className:`justify-end`,size:`sm`,onClick:TS,children:(0,Z.jsx)(J,{id:`L4Cdd9`,components:{0:(0,Z.jsx)(lt,{"aria-hidden":`true`,className:`size-3`})}})}),t[18]=S):S=t[18];let C;t[19]===x?C=t[20]:(C=(0,Z.jsxs)(`div`,{className:`-mt-6 flex w-full items-center justify-between gap-4`,children:[x,S]}),t[19]=x,t[20]=C);let w;t[21]!==C||t[22]!==v?(w=(0,Z.jsxs)(`div`,{className:`flex w-full flex-col gap-8`,children:[v,C]}),t[21]=C,t[22]=v,t[23]=w):w=t[23];let T;return t[24]!==w||t[25]!==g||t[26]!==_?(T=(0,Z.jsxs)(`div`,{className:`flex w-full flex-col gap-8 py-12 max-w-5xl my-auto`,children:[g,_,w]}),t[24]=w,t[25]=g,t[26]=_,t[27]=T):T=t[27],T}function TS(){return SS({initialDir:``})}function ES(e,t){return SS({template:{folder:e,name:t}})}function DS(e){let t=(0,$.c)(25),{templates:n,loading:r,error:i,onSelect:a}=e,{_:o}=$t(),s;t[0]===o?s=t[1]:(s=o({id:`_8quCH`}),t[0]=o,t[1]=s);let c;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Z.jsx)(`span`,{children:(0,Z.jsx)(J,{id:`_8quCH`})}),t[2]=c):c=t[2];let l;t[3]!==o||t[4]!==i||t[5]!==r||t[6]!==n?(l=r||i?null:(0,Z.jsx)(qe,{className:`text-2xs`,variant:`gray`,"aria-label":o({id:`X7u0xR`,values:{0:n.length}}),children:n.length}),t[3]=o,t[4]=i,t[5]=r,t[6]=n,t[7]=l):l=t[7];let u;t[8]===l?u=t[9]:(u=(0,Z.jsxs)(`header`,{className:`flex items-center gap-2 font-mono text-2xs uppercase tracking-wider text-muted-foreground`,children:[c,l]}),t[8]=l,t[9]=u);let d;t[10]===o?d=t[11]:(d=o({id:`irFGwu`}),t[10]=o,t[11]=d);let f;t[12]!==i||t[13]!==r||t[14]!==a||t[15]!==n?(f=r?(0,Z.jsx)(`p`,{className:`p-4 text-1sm text-muted-foreground`,children:(0,Z.jsx)(J,{id:`Hl89Qd`})}):i?(0,Z.jsx)(`p`,{role:`alert`,className:`p-4 text-1sm text-destructive`,children:(0,Z.jsx)(J,{id:`54Y6Fg`})}):n.map(e=>(0,Z.jsx)(OS,{template:e,targetLabel:e.source_folder===``?`/`:`${e.source_folder}/`,onClick:()=>a(e.source_folder,e.name)},`${e.source_folder}/${e.name}`)),t[12]=i,t[13]=r,t[14]=a,t[15]=n,t[16]=f):f=t[16];let p;t[17]!==r||t[18]!==d||t[19]!==f?(p=(0,Z.jsx)(`div`,{className:`w-full overflow-hidden rounded-xl border border-border/60 bg-card`,children:(0,Z.jsx)(`section`,{"aria-busy":r,"aria-label":d,tabIndex:0,className:`subtle-scrollbar scroll-fade-mask flex max-h-[260px] w-full flex-col overflow-y-auto overscroll-contain focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring/50`,children:f})}),t[17]=r,t[18]=d,t[19]=f,t[20]=p):p=t[20];let m;return t[21]!==s||t[22]!==u||t[23]!==p?(m=(0,Z.jsxs)(`section`,{"aria-label":s,className:`flex w-full flex-col gap-3`,children:[u,p]}),t[21]=s,t[22]=u,t[23]=p,t[24]=m):m=t[24],m}function OS(e){let t=(0,$.c)(24),{template:n,targetLabel:r,onClick:i}=e,{_:a}=$t(),o;t[0]!==n.name||t[1]!==n.title?(o=n.title?.trim()||n.name,t[0]=n.name,t[1]=n.title,t[2]=o):o=t[2];let s=o,c=`${n.name}.md`,l=n.source_folder===``,u;t[3]!==a||t[4]!==s||t[5]!==c||t[6]!==l||t[7]!==r?(u=a(l?{id:`89TtiD`,values:{displayTitle:s,fileName:c}}:{id:`0_J12R`,values:{displayTitle:s,fileName:c,targetLabel:r}}),t[3]=a,t[4]=s,t[5]=c,t[6]=l,t[7]=r,t[8]=u):u=t[8];let d=u,f;t[9]===s?f=t[10]:(f=(0,Z.jsx)(`span`,{className:`truncate text-sm font-medium leading-tight text-foreground/80`,children:s}),t[9]=s,t[10]=f);let p;t[11]===c?p=t[12]:(p=(0,Z.jsx)(`span`,{className:`truncate font-mono text-1sm font-normal text-muted-foreground`,children:c}),t[11]=c,t[12]=p);let m;t[13]!==f||t[14]!==p?(m=(0,Z.jsxs)(`span`,{className:`flex min-w-0 items-baseline gap-2`,children:[f,p]}),t[13]=f,t[14]=p,t[15]=m):m=t[15];let h=`shrink-0 font-mono text-1sm ${l?`text-muted-foreground/70`:`text-muted-foreground`}`,g;t[16]!==h||t[17]!==r?(g=(0,Z.jsx)(`span`,{className:h,children:r}),t[16]=h,t[17]=r,t[18]=g):g=t[18];let _;return t[19]!==d||t[20]!==i||t[21]!==m||t[22]!==g?(_=(0,Z.jsxs)(X,{type:`button`,variant:`ghost`,onClick:i,"aria-label":d,className:`group flex h-auto w-full items-center justify-between gap-4 rounded-none p-4 text-left transition-colors hover:bg-muted/50 focus-visible:bg-muted/50`,children:[m,g]}),t[19]=d,t[20]=i,t[21]=m,t[22]=g,t[23]=_):_=t[23],_}function kS(e){let t=(0,$.c)(25),{terminalDock:n}=e,r=n===void 0?null:n,[i,a]=(0,Q.useState)(!1),[o,s]=(0,Q.useState)(void 0),[c,l]=(0,Q.useState)(null),[u,d]=(0,Q.useState)(0),f=(0,Q.useRef)(!1),p=(0,Q.useRef)(void 0),m,h;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(m=()=>{let e=!1,t=async function(){try{let{ok:t,body:n}=await qi();if(e)return;let r=t?Bn.safeParse(n):null;r?.success?(l(MS(r.data.documents)),f.current=!0):f.current||=(l(1),!0)}catch{!e&&!f.current&&(l(1),f.current=!0)}};t();let n=xl(e=>{e.includes(`files`)&&t()});return()=>{e=!0,n(),clearTimeout(p.current)}},h=[],t[0]=m,t[1]=h):(m=t[0],h=t[1]),(0,Q.useEffect)(m,h);let g;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(g=function(){clearTimeout(p.current),p.current=setTimeout(()=>d(jS),500),qi().then(e=>{let{ok:t,body:n}=e;if(!t)return;let r=Bn.safeParse(n);r.success&&l(MS(r.data.documents))}).catch(AS)},t[2]=g):g=t[2];let _=g,v=c!==null,y=c===0,b;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(b=function(e){a(e),e||s(void 0)},t[3]=b):b=t[3];let x=b;if(r!==null){let e=r===`bottom`?`justify-end`:`justify-center`,n;t[4]===e?n=t[5]:(n=Y(`@container/emptystate flex min-h-0 flex-1 flex-col items-center pb-8 pt-10`,e),t[4]=e,t[5]=n);let i;t[6]!==u||t[7]!==y||t[8]!==v?(i=v?(0,Z.jsx)(NS,{isOnboarding:y,celebrateSignal:u}):null,t[6]=u,t[7]=y,t[8]=v,t[9]=i):i=t[9];let a;t[10]===i?a=t[11]:(a=(0,Z.jsx)(`div`,{className:`flex w-full flex-col items-center px-4 @md/emptystate:px-10 @2xl/emptystate:px-16`,children:i}),t[10]=i,t[11]=a);let o;return t[12]!==n||t[13]!==a?(o=(0,Z.jsx)(`div`,{className:n,children:a}),t[12]=n,t[13]=a,t[14]=o):o=t[14],o}let S;t[15]!==u||t[16]!==y||t[17]!==v?(S=v?y?(0,Z.jsx)(PS,{celebrateSignal:u,onPackSelect:e=>{s(e),a(!0)}}):(0,Z.jsx)(wS,{celebrateSignal:u,onAddStarterPack:()=>{a(!0)}}):null,t[15]=u,t[16]=y,t[17]=v,t[18]=S):S=t[18];let C;t[19]!==o||t[20]!==i?(C=(0,Z.jsx)(Bh,{open:i,onOpenChange:x,onSeedApplied:_,initialPackId:o}),t[19]=o,t[20]=i,t[21]=C):C=t[21];let w;return t[22]!==S||t[23]!==C?(w=(0,Z.jsx)(`div`,{className:`@container/emptystate flex min-h-0 flex-1 flex-col items-center overflow-y-auto subtle-scrollbar`,children:(0,Z.jsxs)(`div`,{className:`flex w-full flex-1 flex-col items-center px-4 @md/emptystate:px-10 @2xl/emptystate:px-16`,children:[S,C]})}),t[22]=S,t[23]=C,t[24]=w):w=t[24],w}function AS(){}function jS(e){return e+1}function MS(e){return gl(e).filter(e=>e.kind===`document`||e.kind===`folder`).length}function NS(e){let t=(0,$.c)(15),{isOnboarding:n,celebrateSignal:r}=e,{_:i}=$t(),a=da(),o,s,c,l;if(t[0]!==i||t[1]!==a||t[2]!==n){let{title:e,subtitle:r}=bS({isOnboarding:n,isEmbedded:a});l=`w-full max-w-5xl`,o=yS,s=i(e),c=i(r),t[0]=i,t[1]=a,t[2]=n,t[3]=o,t[4]=s,t[5]=c,t[6]=l}else o=t[3],s=t[4],c=t[5],l=t[6];let u;t[7]!==o||t[8]!==r||t[9]!==s||t[10]!==c?(u=(0,Z.jsx)(o,{title:s,subtitle:c,celebrateSignal:r}),t[7]=o,t[8]=r,t[9]=s,t[10]=c,t[11]=u):u=t[11];let d;return t[12]!==l||t[13]!==u?(d=(0,Z.jsx)(`div`,{className:l,children:u}),t[12]=l,t[13]=u,t[14]=d):d=t[14],d}function PS(e){let t=(0,$.c)(29),{celebrateSignal:n,onPackSelect:r}=e,{_:i}=$t(),a=da(),o,s,c,l;if(t[0]!==i||t[1]!==a){let{title:e,subtitle:n}=bS({isOnboarding:!0,isEmbedded:a});l=`flex w-full flex-col gap-10 py-12 max-w-5xl my-auto`,o=yS,s=i(e),c=i(n),t[0]=i,t[1]=a,t[2]=o,t[3]=s,t[4]=c,t[5]=l}else o=t[2],s=t[3],c=t[4],l=t[5];let u;t[6]!==o||t[7]!==n||t[8]!==s||t[9]!==c?(u=(0,Z.jsx)(o,{title:s,subtitle:c,celebrateSignal:n}),t[6]=o,t[7]=n,t[8]=s,t[9]=c,t[10]=u):u=t[10];let d;t[11]===a?d=t[12]:(d=a?(0,Z.jsx)($b,{scenario:`new-project`}):(0,Z.jsx)(Vx,{scenario:`new-project`}),t[11]=a,t[12]=d);let f;t[13]!==i||t[14]!==a?(f=i(a?{id:`GubkSu`}:{id:`xeXS4P`}),t[13]=i,t[14]=a,t[15]=f):f=t[15];let p;t[16]===f?p=t[17]:(p=(0,Z.jsx)(IS,{label:f}),t[16]=f,t[17]=p);let m;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(m=[`okf`,`entity-vault`],t[18]=m):m=t[18];let h;t[19]===r?h=t[20]:(h=(0,Z.jsx)(Ph,{onPackSelect:r,onCreateBlankFile:FS,collapsedPackIds:m}),t[19]=r,t[20]=h);let g;t[21]!==p||t[22]!==h?(g=(0,Z.jsxs)(`div`,{className:`flex w-full flex-col gap-3`,children:[p,h]}),t[21]=p,t[22]=h,t[23]=g):g=t[23];let _;return t[24]!==g||t[25]!==l||t[26]!==u||t[27]!==d?(_=(0,Z.jsxs)(`div`,{className:l,children:[u,d,g]}),t[24]=g,t[25]=l,t[26]=u,t[27]=d,t[28]=_):_=t[28],_}function FS(){return SS()}function IS(e){let t=(0,$.c)(13),{label:n}=e,{_:r}=$t(),i;t[0]===n?i=t[1]:(i=(0,Z.jsx)(`span`,{className:`font-mono text-2xs uppercase tracking-wider text-muted-foreground whitespace-nowrap`,children:n}),t[0]=n,t[1]=i);let a;t[2]===r?a=t[3]:(a=r({id:`jAMpHn`}),t[2]=r,t[3]=a);let o;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Z.jsx)(Qo,{className:`size-3.5`,"aria-hidden":!0}),t[4]=o):o=t[4];let s;t[5]===a?s=t[6]:(s=(0,Z.jsx)(Ts,{className:`text-muted-foreground transition-colors hover:text-foreground`,"aria-label":a,"data-testid":`starter-pack-info`,children:o}),t[5]=a,t[6]=s);let c;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Z.jsx)(Es,{className:`max-w-xs`,children:(0,Z.jsx)(`p`,{className:`leading-relaxed wrap-break-word`,children:(0,Z.jsx)(J,{id:`k4CuuV`})})}),t[7]=c):c=t[7];let l;t[8]===s?l=t[9]:(l=(0,Z.jsxs)(Os,{children:[s,c]}),t[8]=s,t[9]=l);let u;return t[10]!==i||t[11]!==l?(u=(0,Z.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[i,l]}),t[10]=i,t[11]=l,t[12]=u):u=t[12],u}function LS(e){return e===``?`.ok/frontmatter.yml`:`${e}/.ok/frontmatter.yml`}function RS(e){let t=(0,$.c)(70),{folderPath:n,state:r,onChange:i}=e,{_:a}=$t(),[o,s]=(0,Q.useState)(!1),[c,l]=(0,Q.useState)(null),[u,d]=(0,Q.useState)(null);if(r.status===`idle`||r.status===`loading`){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsxs)(`section`,{className:`rounded-lg border bg-card p-4 space-y-3`,children:[(0,Z.jsx)(BS,{}),(0,Z.jsx)(Ba,{className:`h-7 w-full`}),(0,Z.jsx)(Ba,{className:`h-7 w-full`}),(0,Z.jsx)(Ba,{className:`h-7 w-full`})]}),t[0]=e):e=t[0],e}if(r.status===`error`){let{message:e}=r,n;return t[1]===e?n=t[2]:(n=(0,Z.jsx)(`section`,{className:`rounded-lg border border-destructive/30 bg-destructive/5 p-4 text-sm text-destructive`,role:`alert`,children:(0,Z.jsx)(J,{id:`lzmtKp`,values:{message:e}})}),t[1]=e,t[2]=n),n}let f;t[3]===r.data.frontmatterLocal?f=t[4]:(f=r.data.frontmatterLocal??{},t[3]=r.data.frontmatterLocal,t[4]=f);let p=f,m;t[5]===r.data.folder.path?m=t[6]:(m=LS(r.data.folder.path),t[5]=r.data.folder.path,t[6]=m);let h=m,g;t[7]===p?g=t[8]:(g=Object.keys(p),t[7]=p,t[8]=g);let _=g,v;t[9]!==a||t[10]!==n||t[11]!==i?(v=async function(e,t){let r=await Ho(n,{[e]:t});if(!r.ok){let{error:e}=r;hs.error(a({id:`xXo8FT`,values:{error:e}}));return}i()},t[9]=a,t[10]=n,t[11]=i,t[12]=v):v=t[12];let y=v,b;t[13]!==a||t[14]!==n||t[15]!==i?(b=async function(e){let t=await Ho(n,{[e]:null});if(!t.ok){let{error:e}=t;hs.error(a({id:`ZU8VV_`,values:{error:e}}));return}i()},t[13]=a,t[14]=n,t[15]=i,t[16]=b):b=t[16];let x=b,S;t[17]!==y||t[18]!==p?(S=function(e,t){let n=p[e];y(e,Hi(n,t))},t[17]=y,t[18]=p,t[19]=S):S=t[19];let C=S,w;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(w=function(){l({name:``,type:`text`,value:``,error:null}),s(!1)},t[20]=w):w=t[20];let T=w,E;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(E=function(e){l(t=>{if(!t)return t;let n=e===`date`?new Date().toISOString().slice(0,10):Li[e];return{...t,type:e,value:n,error:null}})},t[21]=E):E=t[21];let D=E,O;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(O=function(e){l(t=>t&&{...t,value:e})},t[22]=O):O=t[22];let k=O,A;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(A=function(e){l(t=>t&&{...t,name:e,error:null})},t[23]=A):A=t[23];let j=A,M;t[24]!==a||t[25]!==c||t[26]!==n||t[27]!==i||t[28]!==p?(M=async function(e){if(!c)return;let t=e??c.value,r=c.name.trim();if(!r){l({...c,value:t,error:a({id:`8_brI5`})});return}if(fr(t)){l({...c,value:t,error:a({id:`hXUWyd`})});return}if(Object.hasOwn(p,r)){l({...c,value:t,error:a({id:`CTJLpz`,values:{trimmed:r}})});return}let o=await Ho(n,{[r]:t});if(!o.ok){l({...c,value:t,error:o.error});return}l(null),i()},t[24]=a,t[25]=c,t[26]=n,t[27]=i,t[28]=p,t[29]=M):M=t[29];let N=M,P;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(P=function(e){d({key:e,draft:e,error:null})},t[30]=P):P=t[30];let F=P,I;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(I=function(e){d(t=>t&&{...t,draft:e,error:null})},t[31]=I):I=t[31];let L=I,R;t[32]!==a||t[33]!==n||t[34]!==i||t[35]!==p||t[36]!==u?(R=async function(){if(!u)return;let e=u.draft.trim();if(!e){d({...u,error:a({id:`8_brI5`})});return}if(e===u.key){d(null);return}if(Object.hasOwn(p,e)){d({...u,error:a({id:`CTJLpz`,values:{trimmed:e}})});return}let t=p[u.key],r=await Ho(n,{[u.key]:null,[e]:t});if(!r.ok){d({...u,error:r.error});return}d(null),i()},t[32]=a,t[33]=n,t[34]=i,t[35]=p,t[36]=u,t[37]=R):R=t[37];let z=R,B;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(B=function(){d(null)},t[38]=B):B=t[38];let V=B,H=!o,U;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(U=e=>s(!e),t[39]=U):U=t[39];let W=`size-3 transition-transform ${o?``:`rotate-90`}`,G;t[40]===W?G=t[41]:(G=(0,Z.jsx)(Ki,{className:W,"aria-hidden":!0}),t[40]=W,t[41]=G);let K;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(K=(0,Z.jsx)(`span`,{children:(0,Z.jsx)(J,{id:`vQIVHc`})}),t[42]=K):K=t[42];let ee;t[43]===G?ee=t[44]:(ee=(0,Z.jsxs)(`span`,{className:`flex items-center gap-1.5 text-xs font-semibold uppercase font-mono tracking-wider text-muted-foreground`,children:[G,K]}),t[43]=G,t[44]=ee);let te;t[45]===h?te=t[46]:(te=(0,Z.jsx)(`code`,{className:`text-xs text-muted-foreground font-mono cursor-text select-text`,onClick:zS,children:h}),t[45]=h,t[46]=te);let ne;t[47]!==ee||t[48]!==te?(ne=(0,Z.jsxs)(Vs,{className:`flex w-full cursor-pointer items-center justify-between gap-2 px-3 py-2.5 data-[state=open]:border-b border-border`,children:[ee,te]}),t[47]=ee,t[48]=te,t[49]=ne):ne=t[49];let re;t[50]===Symbol.for(`react.memo_cache_sentinel`)?(re=(0,Z.jsx)(`p`,{className:`px-1 pb-2 text-sm text-muted-foreground`,children:(0,Z.jsx)(J,{id:`hSBIG-`})}),t[50]=re):re=t[50];let ie;t[51]!==c||t[52]!==y||t[53]!==z||t[54]!==_||t[55]!==p||t[56]!==x||t[57]!==u||t[58]!==C?(ie=_.length===0&&!c?(0,Z.jsx)(`p`,{className:`px-1 py-1 text-sm text-muted-foreground`,children:(0,Z.jsx)(J,{id:`4c_a6S`})}):_.map(e=>{let t=p[e];return(0,Z.jsx)(Bi,{keyName:e,value:t,declared:Fi(t,ar(t)),rename:{state:u?.key===e?u:null,onBegin:()=>F(e),onChangeDraft:L,onCommit:z,onCancel:V},badge:null,onCommit:t=>void y(e,t),onChangeType:t=>C(e,t),onRemove:()=>void x(e)},e)}),t[51]=c,t[52]=y,t[53]=z,t[54]=_,t[55]=p,t[56]=x,t[57]=u,t[58]=C,t[59]=ie):ie=t[59];let ae;t[60]!==c||t[61]!==N?(ae=c?(0,Z.jsx)(Ri,{draft:c,onChangeName:j,onChangeType:D,onChangeValue:k,onCommit:e=>void N(e),onCancel:()=>l(null)}):(0,Z.jsx)(`div`,{className:`mt-1 flex flex-wrap items-center gap-1`,children:(0,Z.jsxs)(X,{type:`button`,variant:`ghost`,size:`sm`,"data-testid":`add-property-trigger`,onClick:()=>T(),className:`flex items-center gap-1.5 rounded px-2 py-1 font-medium text-sm hover:bg-muted/50 hover:text-foreground`,children:[(0,Z.jsx)(Zt,{className:`size-3.5`}),(0,Z.jsx)(`span`,{children:(0,Z.jsx)(J,{id:`G8t9NN`})})]})}),t[60]=c,t[61]=N,t[62]=ae):ae=t[62];let oe;t[63]!==ie||t[64]!==ae?(oe=(0,Z.jsx)(Bs,{children:(0,Z.jsxs)(`div`,{className:`px-2 py-2`,children:[re,ie,ae]})}),t[63]=ie,t[64]=ae,t[65]=oe):oe=t[65];let se;return t[66]!==H||t[67]!==ne||t[68]!==oe?(se=(0,Z.jsx)(`section`,{className:`rounded-lg border bg-card`,children:(0,Z.jsxs)(Hs,{open:H,onOpenChange:U,children:[ne,oe]})}),t[66]=H,t[67]=ne,t[68]=oe,t[69]=se):se=t[69],se}function zS(e){return e.stopPropagation()}function BS(){let e=(0,$.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Z.jsx)(Id,{className:`size-4 text-muted-foreground`,"aria-hidden":!0}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[t,(0,Z.jsx)(`h2`,{className:`text-xs font-semibold uppercase font-mono tracking-wider text-muted-foreground`,children:(0,Z.jsx)(J,{id:`vQIVHc`})})]}),e[1]=n):n=e[1],n}function VS(e){let t=Math.floor((Date.now()-new Date(e).getTime())/1e3);return t<60?Wc._({id:`xOTzt5`}):t<3600?Wc._({id:`zbymaY`,values:{0:Math.floor(t/60)}}):t<86400?Wc._({id:`optX0N`,values:{0:Math.floor(t/3600)}}):t<86400*7?Wc._({id:`l1l8sj`,values:{0:Math.floor(t/86400)}}):new Date(e).toLocaleDateString(void 0,{month:`short`,day:`numeric`})}function HS(e){return(e.split(`/`).pop()??e).replace(/\.md$/,``)}function US(e){let t=e.message,n=t.indexOf(`: `),r=n===-1?t:t.slice(0,n),i=n===-1?``:t.slice(n+2);switch(r){case`template-create`:return{Icon:Za,label:Wc._({id:`QR5SP1`}),detail:HS(i)};case`template-edit`:return{Icon:Do,label:Wc._({id:`-LHLx7`}),detail:HS(i)};case`template-delete`:return{Icon:To,label:Wc._({id:`_gkGSK`}),detail:HS(i)};case`template-rename`:case`template-move`:{let[e,t]=i.split(` -> `);return{Icon:dd,label:Wc._({id:`KPW5WC`}),detail:`${HS(e??``)} → ${HS(t??i)}`}}case`folder-frontmatter-edit`:return{Icon:Id,label:Wc._({id:`_tekeB`}),detail:``};case`folder-frontmatter-delete`:return{Icon:Id,label:Wc._({id:`ZWxfrc`}),detail:``};case`folder-create`:return{Icon:Id,label:Wc._({id:`ZQLDTl`}),detail:``};default:return{Icon:Ud,label:r.replace(/-/g,` `),detail:HS(i)}}}function WS(e){return e.contributors.length>0?e.contributors[0].name:e.author===`openknowledge-service`||e.author===`server`?Wc._({id:`B2DrPb`}):e.author||Wc._({id:`Ef7StM`})}function GS(e){let t=(0,$.c)(15),{folderPath: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,s]=(0,Q.useState)(!0),[c,l]=(0,Q.useState)(!1),u,d;if(t[1]===n?(u=t[2],d=t[3]):(u=()=>{let e=!1,t=async function(){try{let t=await fetch(`/api/history?folder=${encodeURIComponent(n)}&limit=50`);if(e)return;if(!t.ok){l(!0),s(!1);return}let r=await t.json();if(e)return;a(r.entries??[]),l(!1),s(!1)}catch(t){e||(console.warn(`[FolderTimelineCard] failed to load folder timeline:`,t),l(!0),s(!1))}};s(!0),t();let r=yl(t);return()=>{e=!0,r()}},d=[n],t[1]=n,t[2]=u,t[3]=d),(0,Q.useEffect)(u,d),c||!o&&i.length===0)return null;let f;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Z.jsx)(`h2`,{className:`text-xs font-semibold uppercase font-mono tracking-wider text-muted-foreground`,children:(0,Z.jsx)(J,{id:`XJOV1Y`})}),t[4]=f):f=t[4];let p;t[5]===i.length?p=t[6]:(p=i.length>0?(0,Z.jsx)(qe,{className:`text-xs`,variant:`secondary`,children:i.length}):null,t[5]=i.length,t[6]=p);let m;t[7]===p?m=t[8]:(m=(0,Z.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border px-3 py-1`,children:[f,p]}),t[7]=p,t[8]=m);let h;t[9]!==i||t[10]!==o?(h=(0,Z.jsx)(`div`,{className:`px-3 py-2.5`,children:o?(0,Z.jsxs)(`div`,{className:`space-y-2`,role:`status`,"aria-busy":`true`,children:[(0,Z.jsx)(Ba,{className:`h-8 w-full`}),(0,Z.jsx)(Ba,{className:`h-8 w-full`})]}):(0,Z.jsx)(`ul`,{className:`space-y-1`,children:i.map(KS)})}),t[9]=i,t[10]=o,t[11]=h):h=t[11];let g;return t[12]!==m||t[13]!==h?(g=(0,Z.jsxs)(`section`,{className:`rounded-lg border bg-card`,"data-testid":`folder-timeline-card`,children:[m,h]}),t[12]=m,t[13]=h,t[14]=g):g=t[14],g}function KS(e){let{Icon:t,label:n,detail:r}=US(e);return(0,Z.jsxs)(`li`,{className:`flex items-center gap-2.5 rounded-md px-2 py-1.5 text-sm`,children:[(0,Z.jsx)(t,{className:`size-3.5 shrink-0 text-muted-foreground`,"aria-hidden":!0}),(0,Z.jsxs)(`span`,{className:`min-w-0 flex-1 truncate`,children:[(0,Z.jsx)(`span`,{className:`text-foreground`,children:n}),r?(0,Z.jsx)(`code`,{className:`ml-1.5 font-mono text-xs text-muted-foreground`,children:r}):null]}),(0,Z.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1 text-xs text-muted-foreground`,children:[(0,Z.jsx)(If,{className:`size-3`,"aria-hidden":!0}),WS(e)]}),(0,Z.jsx)(`time`,{className:`shrink-0 text-xs text-muted-foreground/80`,dateTime:e.timestamp,title:new Date(e.timestamp).toLocaleString(),children:VS(e.timestamp)})]},e.sha)}function qS(e){let t=e.split(`/`).pop();return t?`${e}/${t}`:null}function JS(e,t){let n=t.get(`${e}/index`);if(n)return n;let r=qS(e);if(r){let e=t.get(r);if(e)return e}return e.split(`/`).pop()??e}function YS(e,t,n){let r=n.get(e);return r&&r!==e?r:t}function XS(e,t){let n=e===``?``:`${e}/`,r=[...t.folderPaths].filter(e=>e.startsWith(n)).map(e=>({path:e,rel:e.slice(n.length)})).filter(e=>e.rel.length>0&&!e.rel.includes(`/`)).map(({path:e,rel:n})=>({kind:`folder`,path:e,name:n,title:JS(e,t.pageTitles)})),i=[...t.pages].filter(e=>e.startsWith(n)).map(e=>({docName:e,rel:e.slice(n.length)})).filter(e=>e.rel.length>0&&!e.rel.includes(`/`)).map(({docName:e,rel:n})=>{let r=t.pageMeta.get(e);return{kind:`file`,path:e,name:n,title:YS(e,n,t.pageTitles),size:r?.size??0,modified:r?.modified??``}}),a=[...r,...i].sort((e,t)=>e.kind===t.kind?e.title.localeCompare(t.title)||e.name.localeCompare(t.name):e.kind===`folder`?-1:1);return{title:JS(e,t.pageTitles),children:a}}function ZS(e){let t=(0,$.c)(41),{folderPath:n,state:r,onChange:i,folderConfigHandle:a}=e,[o,s]=(0,Q.useState)(null),[c,l]=(0,Q.useState)(null),[u,d]=(0,Q.useState)(!1);if(r.status===`idle`||r.status===`loading`){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsxs)(`section`,{className:`rounded-lg border bg-card px-3 py-2.5 space-y-3`,children:[(0,Z.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,Z.jsx)(`h2`,{className:`text-xs font-semibold uppercase font-mono tracking-wider text-muted-foreground`,children:(0,Z.jsx)(J,{id:`-QCLWk`})})}),(0,Z.jsx)(Ba,{className:`h-12 w-full`}),(0,Z.jsx)(Ba,{className:`h-12 w-full`})]}),t[0]=e):e=t[0],e}if(r.status===`error`){let{message:e}=r,n;return t[1]===e?n=t[2]:(n=(0,Z.jsx)(`section`,{className:`rounded-lg border border-destructive/30 bg-destructive/5 p-4 text-sm text-destructive`,role:`alert`,children:(0,Z.jsx)(J,{id:`iDZtvM`,values:{message:e}})}),t[1]=e,t[2]=n),n}let f;t[3]===r.data.folder.templates_available?f=t[4]:(f=r.data.folder.templates_available??[],t[3]=r.data.folder.templates_available,t[4]=f);let p=f,m;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,Z.jsx)(`h2`,{className:`text-xs font-semibold uppercase font-mono tracking-wider text-muted-foreground`,children:(0,Z.jsx)(J,{id:`-QCLWk`})}),t[5]=m):m=t[5];let h;t[6]===p.length?h=t[7]:(h=(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[m,(0,Z.jsx)(qe,{className:`text-xs`,variant:`secondary`,children:p.length})]}),t[6]=p.length,t[7]=h);let g;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,Z.jsxs)(X,{variant:`ghost`,className:`font-mono uppercase`,size:`sm`,onClick:()=>d(!0),children:[(0,Z.jsx)(Zt,{className:`size-3.5`,"aria-hidden":!0}),(0,Z.jsx)(J,{id:`G1Gw0v`})]}),t[8]=g):g=t[8];let _;t[9]===h?_=t[10]:(_=(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-2 border-b border-border px-3 py-1`,children:[h,g]}),t[9]=h,t[10]=_);let v;t[11]===p?v=t[12]:(v=(0,Z.jsx)(`div`,{className:`px-3 py-2.5`,children:p.length===0?(0,Z.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,Z.jsx)(J,{id:`MZSBsh`})}):(0,Z.jsx)(`ul`,{className:`space-y-1`,children:p.map(e=>(0,Z.jsx)(Ea,{template:e,onCreate:()=>l(e.name),onEdit:()=>Jo(b(e.source_folder,e.name)),onDelete:()=>s(e),badge:e.scope===`inherited`?(0,Z.jsx)(Pi,{source:e.source_folder,target:`templates/${e.name}.md`}):void 0},e.path))})}),t[11]=p,t[12]=v);let y;t[13]!==_||t[14]!==v?(y=(0,Z.jsxs)(`section`,{className:`rounded-lg border bg-card`,children:[_,v]}),t[13]=_,t[14]=v,t[15]=y):y=t[15];let x;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(x=e=>{e||s(null)},t[16]=x):x=t[16];let S;t[17]!==o||t[18]!==i?(S=(0,Z.jsx)(Va,{template:o,onOpenChange:x,onDeleted:i}),t[17]=o,t[18]=i,t[19]=S):S=t[19];let C;t[20]===p?C=t[21]:(C=new Set(p.map(QS)),t[20]=p,t[21]=C);let w;t[22]!==n||t[23]!==i?(w=e=>{i(),Jo(b(n,e))},t[22]=n,t[23]=i,t[24]=w):w=t[24];let T;t[25]!==n||t[26]!==u||t[27]!==C||t[28]!==w?(T=(0,Z.jsx)(Aa,{folderPath:n,existingNames:C,open:u,onOpenChange:d,onCreated:w}),t[25]=n,t[26]=u,t[27]=C,t[28]=w,t[29]=T):T=t[29];let E=c!==null,D;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(D=e=>{e||l(null)},t[30]=D):D=t[30];let O=c??void 0,k;t[31]!==a||t[32]!==n||t[33]!==E||t[34]!==O?(k=(0,Z.jsx)(dh,{open:E,onOpenChange:D,kind:`file`,initialDir:n,initialTemplate:O,folderConfig:a}),t[31]=a,t[32]=n,t[33]=E,t[34]=O,t[35]=k):k=t[35];let A;return t[36]!==T||t[37]!==k||t[38]!==y||t[39]!==S?(A=(0,Z.jsxs)(Z.Fragment,{children:[y,S,T,k]}),t[36]=T,t[37]=k,t[38]=y,t[39]=S,t[40]=A):A=t[40],A}function QS(e){return e.name}function $S(e){let t=(0,$.c)(14),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,containerClassName: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(`relative w-full overflow-x-auto subtle-scrollbar`,r),t[4]=r,t[5]=a);let o;t[6]===n?o=t[7]:(o=Y(`w-full caption-bottom text-sm`,n),t[6]=n,t[7]=o);let s;t[8]!==i||t[9]!==o?(s=(0,Z.jsx)(`table`,{"data-slot":`table`,className:o,...i}),t[8]=i,t[9]=o,t[10]=s):s=t[10];let c;return t[11]!==a||t[12]!==s?(c=(0,Z.jsx)(`div`,{"data-slot":`table-container`,className:a,children:s}),t[11]=a,t[12]=s,t[13]=c):c=t[13],c}function eC(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(`[&_tr]:border-b`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`thead`,{"data-slot":`table-header`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function tC(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(`[&_tr:last-child]:border-0`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`tbody`,{"data-slot":`table-body`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function nC(e){let t=(0,$.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,noHover:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=(i===void 0?!1:i)&&`hover:bg-transparent`,o;t[4]!==n||t[5]!==a?(o=Y(`hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors`,a,n),t[4]=n,t[5]=a,t[6]=o):o=t[6];let s;return t[7]!==r||t[8]!==o?(s=(0,Z.jsx)(`tr`,{"data-slot":`table-row`,className:o,...r}),t[7]=r,t[8]=o,t[9]=s):s=t[9],s}function rC(e){let t=(0,$.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,scope:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?`col`:i,o;t[4]===n?o=t[5]:(o=Y(`font-mono uppercase text-xs text-muted-foreground h-10 px-4 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]`,n),t[4]=n,t[5]=o);let s;return t[6]!==r||t[7]!==a||t[8]!==o?(s=(0,Z.jsx)(`th`,{"data-slot":`table-head`,scope:a,className:o,...r}),t[6]=r,t[7]=a,t[8]=o,t[9]=s):s=t[9],s}function iC(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(`py-3 px-4 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`td`,{"data-slot":`table-cell`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function aC(e){if(!e)return`—`;let t=new Date(e),n=new Date().getTime()-t.getTime(),r=Math.floor(n/6e4);if(r<1)return Wc._({id:`xOTzt5`});if(r<60)return Wc._({id:`NRSLBe`,values:{diffMin:r}});let i=Math.floor(r/60);if(i<24)return Wc._({id:`hDKtoF`,values:{diffHrs:i}});let a=Math.floor(i/24);return a<30?Wc._({id:`QDZbvN`,values:{diffDays:a}}):t.toLocaleDateString(void 0,{month:`short`,day:`numeric`,year:`numeric`})}function oC(e,t,n){return[...e].sort((e,r)=>{if(e.kind!==r.kind)return e.kind===`folder`?-1:1;let i=0;switch(t){case`name`:i=e.title.localeCompare(r.title)||e.name.localeCompare(r.name);break;case`modified`:{let t=e.kind===`file`?e.modified:``,n=r.kind===`file`?r.modified:``;i=t.localeCompare(n);break}}return n===`asc`?i:-i})}function sC(e){let t=(0,$.c)(10),{label:n,sortKey:r,activeKey:i,activeDir:a,onSort:o}=e,s=i===r,c;t[0]!==o||t[1]!==r?(c=()=>o(r),t[0]=o,t[1]=r,t[2]=c):c=t[2];let l;t[3]!==a||t[4]!==s?(l=s?a===`asc`?(0,Z.jsx)(Pe,{className:`ml-1 size-3`}):(0,Z.jsx)(Re,{className:`ml-1 size-3`}):(0,Z.jsx)(fd,{className:`ml-1 size-3 text-muted-foreground/50`}),t[3]=a,t[4]=s,t[5]=l):l=t[5];let u;return t[6]!==n||t[7]!==c||t[8]!==l?(u=(0,Z.jsxs)(X,{variant:`ghost`,size:`sm`,className:`-ml-3 h-8 uppercase font-mono`,onClick:c,children:[n,l]}),t[6]=n,t[7]=c,t[8]=l,t[9]=u):u=t[9],u}function cC(e){let t=(0,$.c)(96),{folderPath:n}=e,{_:r}=$t(),{folderPaths:i,loading:a,pages:o,pageTitles:s,pageMeta:c}=Yi(),l=fo(n),{state:u,refresh:d}=l,[f,p]=(0,Q.useState)(!1),[m,h]=(0,Q.useState)(`name`),[g,_]=(0,Q.useState)(`asc`);if(a){let e;t[0]===r?e=t[1]:(e=r({id:`X9VpsP`}),t[0]=r,t[1]=e);let n;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(Ba,{className:`size-5 rounded`}),(0,Z.jsx)(Ba,{className:`h-7 w-48`})]}),(0,Z.jsx)(Ba,{className:`h-9 w-20 rounded-md`})]}),t[2]=n):n=t[2];let i;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsx)(Ba,{className:`h-4 w-16`}),t[3]=i):i=t[3];let a;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Z.jsxs)(`div`,{className:`mx-auto flex w-full max-w-4xl flex-col gap-6 px-6 py-8`,children:[n,(0,Z.jsxs)(`div`,{className:`rounded-lg border`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-4 border-b px-4 py-3`,children:[i,(0,Z.jsx)(`div`,{className:`ml-auto`,children:(0,Z.jsx)(Ba,{className:`h-4 w-20`})})]}),[`a`,`b`,`c`,`d`].map(dC)]})]}),t[4]=a):a=t[4];let o;return t[5]===e?o=t[6]:(o=(0,Z.jsx)(`div`,{className:`flex min-h-0 flex-1 items-start overflow-y-auto subtle-scrollbar`,role:`status`,"aria-busy":`true`,"aria-label":e,children:a}),t[5]=e,t[6]=o),o}let v,y,b,x,S,C,w,T,E,D,O;if(t[7]!==r||t[8]!==u||t[9]!==l||t[10]!==n||t[11]!==i||t[12]!==c||t[13]!==s||t[14]!==o||t[15]!==d||t[16]!==g||t[17]!==m){let e=XS(n,{pages:o,pageTitles:s,pageMeta:c,folderPaths:i}),a=oC(e.children,m,g),f=e.title||(n===``?r({id:`3aeN7X`}):e.title),k;t[29]===m?k=t[30]:(k=function(e){e===m?_(uC):(h(e),_(`asc`))},t[29]=m,t[30]=k);let A=k;O=`flex min-h-0 flex-1 items-start overflow-y-auto subtle-scrollbar`,C=`mx-auto flex w-full max-w-4xl flex-col gap-6 px-6 py-8`;let j;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,Z.jsx)(Fo,{className:`size-5 text-muted-foreground`}),t[31]=j):j=t[31];let M=(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[j,(0,Z.jsx)(`h1`,{className:`text-2xl font-light tracking-tight`,children:f})]}),N;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,Z.jsxs)(X,{onClick:()=>p(!0),children:[(0,Z.jsx)(Zt,{className:`size-4`}),(0,Z.jsx)(J,{id:`isRobC`})]}),t[32]=N):N=t[32],t[33]===M?w=t[34]:(w=(0,Z.jsx)(`div`,{className:`flex flex-col gap-6`,children:(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[M,N]})}),t[33]=M,t[34]=w),t[35]!==u||t[36]!==n||t[37]!==d?(T=(0,Z.jsx)(RS,{folderPath:n,state:u,onChange:d}),t[35]=u,t[36]=n,t[37]=d,t[38]=T):T=t[38],t[39]!==u||t[40]!==l||t[41]!==n||t[42]!==d?(E=(0,Z.jsx)(ZS,{folderPath:n,state:u,onChange:d,folderConfigHandle:l}),t[39]=u,t[40]=l,t[41]=n,t[42]=d,t[43]=E):E=t[43],t[44]===n?D=t[45]:(D=(0,Z.jsx)(GS,{folderPath:n}),t[44]=n,t[45]=D),S=`rounded-lg border`,y=$S;let P=m===`name`?g===`asc`?`ascending`:`descending`:`none`,F;t[46]===r?F=t[47]:(F=r({id:`6YtxFj`}),t[46]=r,t[47]=F);let I;t[48]!==A||t[49]!==g||t[50]!==m||t[51]!==F?(I=(0,Z.jsx)(sC,{label:F,sortKey:`name`,activeKey:m,activeDir:g,onSort:A}),t[48]=A,t[49]=g,t[50]=m,t[51]=F,t[52]=I):I=t[52];let L;t[53]!==P||t[54]!==I?(L=(0,Z.jsx)(rC,{"aria-sort":P,children:I}),t[53]=P,t[54]=I,t[55]=L):L=t[55];let R=m===`modified`?g===`asc`?`ascending`:`descending`:`none`,z;t[56]===r?z=t[57]:(z=r({id:`tgWuMB`}),t[56]=r,t[57]=z);let B;t[58]!==A||t[59]!==g||t[60]!==m||t[61]!==z?(B=(0,Z.jsx)(sC,{label:z,sortKey:`modified`,activeKey:m,activeDir:g,onSort:A}),t[58]=A,t[59]=g,t[60]=m,t[61]=z,t[62]=B):B=t[62];let V;t[63]!==R||t[64]!==B?(V=(0,Z.jsx)(rC,{className:`w-32`,"aria-sort":R,children:B}),t[63]=R,t[64]=B,t[65]=V):V=t[65],t[66]!==L||t[67]!==V?(x=(0,Z.jsx)(eC,{children:(0,Z.jsxs)(nC,{children:[L,V]})}),t[66]=L,t[67]=V,t[68]=x):x=t[68],v=tC,b=a.length?a.map(lC):(0,Z.jsx)(nC,{children:(0,Z.jsx)(iC,{colSpan:2,className:`h-24 text-center text-muted-foreground`,children:(0,Z.jsx)(J,{id:`Pkw7J9`})})}),t[7]=r,t[8]=u,t[9]=l,t[10]=n,t[11]=i,t[12]=c,t[13]=s,t[14]=o,t[15]=d,t[16]=g,t[17]=m,t[18]=v,t[19]=y,t[20]=b,t[21]=x,t[22]=S,t[23]=C,t[24]=w,t[25]=T,t[26]=E,t[27]=D,t[28]=O}else v=t[18],y=t[19],b=t[20],x=t[21],S=t[22],C=t[23],w=t[24],T=t[25],E=t[26],D=t[27],O=t[28];let k;t[69]!==v||t[70]!==b?(k=(0,Z.jsx)(v,{children:b}),t[69]=v,t[70]=b,t[71]=k):k=t[71];let A;t[72]!==y||t[73]!==k||t[74]!==x?(A=(0,Z.jsxs)(y,{children:[x,k]}),t[72]=y,t[73]=k,t[74]=x,t[75]=A):A=t[75];let j;t[76]!==A||t[77]!==S?(j=(0,Z.jsx)(`div`,{className:S,children:A}),t[76]=A,t[77]=S,t[78]=j):j=t[78];let M;t[79]!==j||t[80]!==C||t[81]!==w||t[82]!==T||t[83]!==E||t[84]!==D?(M=(0,Z.jsxs)(`div`,{className:C,children:[w,T,E,D,j]}),t[79]=j,t[80]=C,t[81]=w,t[82]=T,t[83]=E,t[84]=D,t[85]=M):M=t[85];let N;t[86]!==M||t[87]!==O?(N=(0,Z.jsx)(`div`,{className:O,children:M}),t[86]=M,t[87]=O,t[88]=N):N=t[88];let P;t[89]!==f||t[90]!==l||t[91]!==n?(P=(0,Z.jsx)(dh,{open:f,onOpenChange:p,kind:`file`,initialDir:n,folderConfig:l,suggestedName:`index`}),t[89]=f,t[90]=l,t[91]=n,t[92]=P):P=t[92];let F;return t[93]!==N||t[94]!==P?(F=(0,Z.jsxs)(Z.Fragment,{children:[N,P]}),t[93]=N,t[94]=P,t[95]=F):F=t[95],F}function lC(e){return(0,Z.jsxs)(nC,{children:[(0,Z.jsx)(iC,{children:(0,Z.jsxs)(`a`,{href:fl(e.path),className:`flex items-center gap-2 rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,children:[e.kind===`folder`?(0,Z.jsx)(Rd,{className:`size-4 shrink-0 text-muted-foreground`}):(0,Z.jsx)(Ce,{className:`size-4 shrink-0 text-muted-foreground`}),(0,Z.jsx)(`span`,{className:`truncate`,children:e.title})]})}),(0,Z.jsx)(iC,{className:`text-muted-foreground`,children:e.kind===`file`?aC(e.modified):`—`})]},e.path)}function uC(e){return e===`asc`?`desc`:`asc`}function dC(e){return(0,Z.jsxs)(`div`,{className:`flex items-center gap-3 border-b px-4 py-3 last:border-b-0`,children:[(0,Z.jsx)(Ba,{className:`size-4 rounded`}),(0,Z.jsx)(Ba,{className:`h-4 w-40`}),(0,Z.jsx)(`div`,{className:`ml-auto`,children:(0,Z.jsx)(Ba,{className:`h-4 w-16`})})]},e)}function fC(e){let t=(0,$.c)(24),{docName:n,size:r,limit:i,backNav:a}=e,o=a!==void 0,s=(0,Q.useRef)(null),c=(0,Q.useRef)(null),l,u;t[0]===o?(l=t[1],u=t[2]):(l=()=>{o?s.current?.focus():c.current?.focus()},u=[o],t[0]=o,t[1]=l,t[2]=u),(0,Q.useEffect)(l,u);let d;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Z.jsx)(`div`,{className:`flex size-16 items-center justify-center rounded-full border bg-muted/40 text-muted-foreground`,children:(0,Z.jsx)(Nd,{className:`size-9`,"aria-hidden":`true`})}),t[3]=d):d=t[3];let f=o?void 0:-1,p;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Z.jsx)(J,{id:`P3hnm0`}),t[4]=p):p=t[4];let m;t[5]===f?m=t[6]:(m=(0,Z.jsx)(`h2`,{ref:c,id:`large-file-title`,tabIndex:f,className:`text-2xl font-light text-balance outline-none`,children:p}),t[5]=f,t[6]=m);let h;t[7]===r?h=t[8]:(h=br(r),t[7]=r,t[8]=h);let g;t[9]===i?g=t[10]:(g=br(i),t[9]=i,t[10]=g);let _;t[11]!==n||t[12]!==h||t[13]!==g?(_=(0,Z.jsx)(`p`,{className:`max-w-md text-sm text-muted-foreground`,children:(0,Z.jsx)(J,{id:`GJH-AT`,values:{0:h,1:g,docName:n}})}),t[11]=n,t[12]=h,t[13]=g,t[14]=_):_=t[14];let v;t[15]!==m||t[16]!==_?(v=(0,Z.jsxs)(`div`,{className:`flex flex-col items-center gap-1`,children:[m,_]}),t[15]=m,t[16]=_,t[17]=v):v=t[17];let y;t[18]!==a||t[19]!==o?(y=o?(0,Z.jsxs)(X,{ref:s,variant:`default`,onClick:()=>a.onNavigateBack(a.previousDocName),children:[(0,Z.jsx)(Rt,{className:`size-4`,"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`CKyk7Q`})]}):null,t[18]=a,t[19]=o,t[20]=y):y=t[20];let b;return t[21]!==v||t[22]!==y?(b=(0,Z.jsxs)(`div`,{role:`status`,"aria-labelledby":`large-file-title`,"data-slot":`large-file-editor-state`,className:`flex h-full flex-col items-center justify-center gap-8 p-8 text-center`,children:[d,v,y]}),t[21]=v,t[22]=y,t[23]=b):b=t[23],b}function pC(e){let t=(0,$.c)(8),{docName:n}=e,[r,i]=(0,Q.useState)(mC),a,o;if(t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=()=>ae(e=>{i(t=>{if(t.has(e))return t;let n=new Set(t);return n.add(e),n})}),o=[],t[0]=a,t[1]=o):(a=t[0],o=t[1]),(0,Q.useEffect)(a,o),!r.has(n))return null;let s;t[2]===n?s=t[3]:(s=function(){S(n)?.abort(),i(e=>{if(!e.has(n))return e;let t=new Set(e);return t.delete(n),t})},t[2]=n,t[3]=s);let c=s,l;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Z.jsx)(`span`,{children:(0,Z.jsx)(J,{id:`A67Uwj`})}),t[4]=l):l=t[4];let u;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Z.jsx)(J,{id:`dEgA5A`}),t[5]=u):u=t[5];let d;return t[6]===c?d=t[7]:(d=(0,Z.jsxs)(`div`,{className:`absolute inset-x-0 bottom-8 z-20 flex justify-center text-xs text-muted-foreground`,children:[l,(0,Z.jsx)(X,{variant:`link`,size:`sm`,className:`h-auto px-2 py-0 text-xs`,onClick:c,children:u})]}),t[6]=c,t[7]=d),d}function mC(){return new Set}function hC(e){let t=(0,$.c)(20),{nav:n}=e,{state:r,refetch:i}=yi(n),a=(0,Q.useRef)(null),o=n.branch,s,c;t[0]===r.phase?(s=t[1],c=t[2]):(s=()=>{r.phase===`resolved`&&a.current?.querySelector(`button`)?.focus()},c=[r.phase],t[0]=r.phase,t[1]=s,t[2]=c),(0,Q.useEffect)(s,c);let l;t[3]===n.path?l=t[4]:(l=function(){window.location.hash=el(xi(n.path))},t[3]=n.path,t[4]=l);let u=l,d;t[5]!==o||t[6]!==n.kind?(d=function(e){Si.arm({kind:n.kind,path:e,branch:o}),window.location.hash=n.kind===`folder`?el(e):fl(e)},t[5]=o,t[6]=n.kind,t[7]=d):d=t[7];let f=d,p=r.phase===`pending`?`polite`:void 0,m=r.phase===`resolved`?r.resolution.verdict:void 0,h=r.phase===`pending`?`flex h-full flex-col items-center justify-center gap-3 p-8 text-center text-sm text-muted-foreground`:`flex h-full flex-col items-center justify-center gap-6 p-8 text-center`,g;t[8]!==u||t[9]!==n||t[10]!==f||t[11]!==i||t[12]!==r?(g=(0,Z.jsx)(wi,{nav:n,state:r,onBrowseFolder:u,onOpenRenamed:f,onEnableAutoSync:u,onSyncCompleted:i}),t[8]=u,t[9]=n,t[10]=f,t[11]=i,t[12]=r,t[13]=g):g=t[13];let _;return t[14]!==r.phase||t[15]!==p||t[16]!==m||t[17]!==h||t[18]!==g?(_=(0,Z.jsx)(`div`,{ref:a,role:`status`,"aria-live":p,"data-testid":`share-receive-miss-panel`,"data-phase":r.phase,"data-verdict":m,className:h,children:g}),t[14]=r.phase,t[15]=p,t[16]=m,t[17]=h,t[18]=g,t[19]=_):_=t[19],_}function gC(e){let t=(0,$.c)(24),{fileName:n,text:r}=e,i,a,o,s;if(t[0]!==r){let e=mi(r).body;s=V,i=St,a=!1,o=xt().parseWithFallback(e),t[0]=r,t[1]=i,t[2]=a,t[3]=o,t[4]=s}else i=t[1],a=t[2],o=t[3],s=t[4];let c;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(c={attributes:{class:`pt-4 pb-4`}},t[5]=c):c=t[5];let l;t[6]!==i||t[7]!==a||t[8]!==o?(l={extensions:i,editable:a,content:o,editorProps:c},t[6]=i,t[7]=a,t[8]=o,t[9]=l):l=t[9];let u;t[10]===r?u=t[11]:(u=[r],t[10]=r,t[11]=u);let d=s(l,u),[f]=(0,Q.useState)(_C),p=(0,Q.useRef)(null),m,h;t[12]===f?(m=t[13],h=t[14]):(m=()=>{let e=p.current;if(e)return e.appendChild(f),()=>{f.parentNode===e&&e.removeChild(f)}},h=[f],t[12]=f,t[13]=m,t[14]=h),(0,Q.useLayoutEffect)(m,h);let g;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,Z.jsx)(`div`,{className:`editor-doc-scroll min-h-0 flex-1 overflow-auto`,children:(0,Z.jsx)(`div`,{className:`tiptap-editor`,children:(0,Z.jsx)(`div`,{ref:p,style:{display:`contents`}})})}),t[15]=g):g=t[15];let _;t[16]===d?_=t[17]:(_=(0,Z.jsx)(ot,{editor:d,className:`tiptap-editor-portal-content h-full`}),t[16]=d,t[17]=_);let v;t[18]!==f||t[19]!==_?(v=(0,gd.createPortal)(_,f),t[18]=f,t[19]=_,t[20]=v):v=t[20];let y;return t[21]!==n||t[22]!==v?(y=(0,Z.jsxs)(`main`,{className:`flex h-full min-h-0 flex-col bg-background`,"aria-label":n,"data-skill-markdown-viewer":``,"data-skill-markdown-viewer-state":`loaded`,children:[g,v]}),t[21]=n,t[22]=v,t[23]=y):y=t[23],y}function _C(){let e=document.createElement(`div`);return e.style.display=`contents`,e}var vC=`data-skill-markdown`;function yC(e){let t=(0,$.c)(12),{scope:n,name:r,path:i,fileName:a}=e,o;t[0]!==r||t[1]!==i||t[2]!==n?(o={loadText:e=>wc({scope:n,name:r,path:i},e)},t[0]=r,t[1]=i,t[2]=n,t[3]=o):o=t[3];let s=Hb(o);if(s.status===`loading`){let e;return t[4]===a?e=t[5]:(e=(0,Z.jsx)(Ub,{fileName:a,dataAttr:vC}),t[4]=a,t[5]=e),e}if(s.status===`error`){let e;return t[6]!==s.message||t[7]!==a?(e=(0,Z.jsx)(Wb,{fileName:a,dataAttr:vC,message:s.message}),t[6]=s.message,t[7]=a,t[8]=e):e=t[8],e}let c;return t[9]!==s.content||t[10]!==a?(c=(0,Z.jsx)(gC,{fileName:a,text:s.content}),t[9]=s.content,t[10]=a,t[11]=c):c=t[11],c}var bC=new Set([`md`,`mdx`]);function xC(e){let t=(0,$.c)(19),{scope:n,name:r,path:i}=e,a;t[0]===i?a=t[1]:(a=i.split(`/`).pop()??i,t[0]=i,t[1]=a);let o=a,s=o.lastIndexOf(`.`),c,l;if(t[2]!==s||t[3]!==o?(c=s>=0?o.slice(s+1).toLowerCase():``,l=bC.has(c),t[2]=s,t[3]=o,t[4]=c,t[5]=l):(c=t[4],l=t[5]),l){let e;return t[6]!==o||t[7]!==r||t[8]!==i||t[9]!==n?(e=(0,Z.jsx)(yC,{scope:n,name:r,path:i,fileName:o}),t[6]=o,t[7]=r,t[8]=i,t[9]=n,t[10]=e):e=t[10],e}let u;t[11]!==r||t[12]!==i||t[13]!==n?(u=e=>wc({scope:n,name:r,path:i},e),t[11]=r,t[12]=i,t[13]=n,t[14]=u):u=t[14];let d;return t[15]!==c||t[16]!==o||t[17]!==u?(d=(0,Z.jsx)(qb,{fileName:o,extension:c,loadText:u}),t[15]=c,t[16]=o,t[17]=u,t[18]=d):d=t[18],d}function SC(e){let t=null,n=()=>(t===null&&(t=e(),t.catch(()=>{})),t),r=(0,Q.lazy)(n);return r.preload=n,r}var CC=SC(()=>n(()=>import(`./SettingsDialogBody-aM9cYdrY.js`).then(e=>({default:e.SettingsDialogBody})),__vite__mapDeps([71,1,40,2,41,42,11,43,44,45,46,47,48,49,50,15,16,13,7,17,18,10,3,51,52,36,12,6,4,53,54,55,20,56,57,58,59,31,32,33,34,60,61,62,63,35,64,65,66,72,73,74,19,75,76,77,78,30,79,80,68,81,38,82,14]),import.meta.url));function wC(e){let t=(0,$.c)(9),{error:n}=e,{_:r}=$t(),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:`3h5zMp`}),t[0]=r,t[1]=n,t[2]=i):i=t[2];let a=i,o;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Z.jsx)(`h3`,{id:`settings-body-error-title`,className:`font-heading text-base leading-none font-medium`,children:(0,Z.jsx)(J,{id:`hwFOFD`})}),t[3]=o):o=t[3];let s;t[4]===a?s=t[5]:(s=(0,Z.jsxs)(`div`,{className:`flex flex-col items-center gap-1`,children:[o,(0,Z.jsx)(`p`,{className:`max-w-xs text-sm text-muted-foreground`,children:a})]}),t[4]=a,t[5]=s);let c;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Z.jsx)(X,{variant:`default`,onClick:TC,children:(0,Z.jsx)(J,{id:`HpK_8d`})}),t[6]=c):c=t[6];let l;return t[7]===s?l=t[8]:(l=(0,Z.jsxs)(`div`,{role:`alert`,"aria-labelledby":`settings-body-error-title`,"data-slot":`settings-body-error-boundary`,className:`flex h-full flex-col items-center justify-center gap-5 p-8 text-center`,children:[s,c]}),t[7]=s,t[8]=l),l}function TC(){return window.location.reload()}function EC(e){let t=(0,$.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,Z.jsx)(g,{fallbackRender:OC,onError:DC,children:n}),t[0]=n,t[1]=r),r}function DC(e,t){console.error(`[SettingsDialogErrorBoundary] rendered fallback for Settings body`,e,t.componentStack)}function OC(e){return(0,Z.jsx)(wC,{...e})}function kC(e){return`https://github.com/inkeep/open-knowledge/releases/tag/v${encodeURIComponent(e)}`}function AC(e){let t=(0,$.c)(99),{open:n,onOpenChange:r}=e,{_:i}=$t(),{collabUrl:a}=mt(),{userBinding:o,userSynced:s,okignoreBinding:c,okignoreSynced:l}=Po(),{desktopPresent:u}=bo(),[d,f]=(0,Q.useState)(`preferences`),p,m;t[0]===n?(p=t[1],m=t[2]):(p=()=>{n&&f(`preferences`)},m=[n],t[0]=n,t[1]=p,t[2]=m),(0,Q.useEffect)(p,m);let h=a!==null,g=typeof window<`u`&&window.okDesktop!=null,_;t[3]===i?_=t[4]:(_=i({id:`7PzzBU`}),t[3]=i,t[4]=_);let v;t[5]===i?v=t[6]:(v=i({id:`Q6hhn8`}),t[5]=i,t[6]=v);let y;t[7]===v?y=t[8]:(y={id:`preferences`,label:v},t[7]=v,t[8]=y);let b;t[9]===i?b=t[10]:(b=i({id:`4KmEoC`}),t[9]=i,t[10]=b);let x;t[11]===b?x=t[12]:(x={id:`hotkeys`,label:b},t[11]=b,t[12]=x);let S;t[13]===i?S=t[14]:(S=i({id:`AeXO77`}),t[13]=i,t[14]=S);let C;t[15]===S?C=t[16]:(C={id:`account`,label:S},t[15]=S,t[16]=C);let w;t[17]!==y||t[18]!==x||t[19]!==C?(w=[y,x,C],t[17]=y,t[18]=x,t[19]=C,t[20]=w):w=t[20];let T;t[21]!==w||t[22]!==_?(T={id:`user`,label:_,enabled:!0,items:w},t[21]=w,t[22]=_,t[23]=T):T=t[23];let E;t[24]===i?E=t[25]:(E=i({id:`ZWyHmq`}),t[24]=i,t[25]=E);let D;t[26]===i?D=t[27]:(D=i({id:`Nu4DdT`}),t[26]=i,t[27]=D);let O;t[28]===D?O=t[29]:(O={id:`sync`,label:D},t[28]=D,t[29]=O);let k;t[30]===i?k=t[31]:(k=i({id:`A1taO8`}),t[30]=i,t[31]=k);let A;t[32]===k?A=t[33]:(A={id:`search`,label:k},t[32]=k,t[33]=A);let j;t[34]===i?j=t[35]:(j=g?[{id:`terminal`,label:i({id:`ALhMYW`})}]:[],t[34]=i,t[35]=j);let M;t[36]===i?M=t[37]:(M=i({id:`iTylMl`}),t[36]=i,t[37]=M);let N;t[38]===M?N=t[39]:(N={id:`project-templates`,label:M},t[38]=M,t[39]=N);let P;t[40]===i?P=t[41]:(P=i({id:`PCSkw2`}),t[40]=i,t[41]=P);let F;t[42]===P?F=t[43]:(F={id:`skills`,label:P},t[42]=P,t[43]=F);let I;t[44]===i?I=t[45]:(I=i({id:`3zyg_A`}),t[44]=i,t[45]=I);let L;t[46]===I?L=t[47]:(L={id:`okignore`,label:I},t[46]=I,t[47]=L);let R;t[48]===i?R=t[49]:(R=i({id:`cs4mps`}),t[48]=i,t[49]=R);let z;t[50]===R?z=t[51]:(z={id:`sharing`,label:R},t[50]=R,t[51]=z);let B;t[52]!==O||t[53]!==A||t[54]!==j||t[55]!==N||t[56]!==F||t[57]!==L||t[58]!==z?(B=[O,A,...j,N,F,L,z],t[52]=O,t[53]=A,t[54]=j,t[55]=N,t[56]=F,t[57]=L,t[58]=z,t[59]=B):B=t[59];let V;t[60]!==h||t[61]!==E||t[62]!==B?(V={id:`project`,label:E,enabled:h,items:B},t[60]=h,t[61]=E,t[62]=B,t[63]=V):V=t[63];let H;t[64]===i?H=t[65]:(H=i({id:`nbfdhU`}),t[64]=i,t[65]=H);let U;t[66]!==i||t[67]!==u?(U=[],t[66]=i,t[67]=u,t[68]=U):U=t[68];let W;t[69]!==H||t[70]!==U?(W={id:`integrations`,label:H,enabled:!0,items:U},t[69]=H,t[70]=U,t[71]=W):W=t[71];let G;t[72]!==T||t[73]!==V||t[74]!==W?(G=[T,V,W],t[72]=T,t[73]=V,t[74]=W,t[75]=G):G=t[75];let K=G,ee;t[76]===Symbol.for(`react.memo_cache_sentinel`)?(ee=(0,Z.jsx)(Ws,{className:`sr-only`,children:(0,Z.jsx)(J,{id:`Tz0i8g`})}),t[76]=ee):ee=t[76];let te;t[77]===Symbol.for(`react.memo_cache_sentinel`)?(te=(0,Z.jsx)(Us,{className:`sr-only`,children:(0,Z.jsx)(J,{id:`RDrXh4`})}),t[77]=te):te=t[77];let ne;t[78]!==d||t[79]!==K?(ne=(0,Z.jsx)(jC,{groups:K,activeId:d,onSelect:f}),t[78]=d,t[79]=K,t[80]=ne):ne=t[80];let re;t[81]===i?re=t[82]:(re=i({id:`OXb_Df`}),t[81]=i,t[82]=re);let ie;t[83]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(0,Z.jsx)(PC,{}),t[83]=ie):ie=t[83];let ae=s?o:null,oe;t[84]!==d||t[85]!==c||t[86]!==l||t[87]!==ae?(oe=(0,Z.jsx)(EC,{children:(0,Z.jsx)(Q.Suspense,{fallback:ie,children:(0,Z.jsx)(CC,{activeId:d,userBinding:ae,okignoreBinding:c,okignoreSynced:l})})}),t[84]=d,t[85]=c,t[86]=l,t[87]=ae,t[88]=oe):oe=t[88];let se;t[89]!==re||t[90]!==oe?(se=(0,Z.jsx)(`section`,{"aria-label":re,className:`min-h-0 flex-1 overflow-y-auto overscroll-contain subtle-scrollbar p-6`,tabIndex:0,children:oe}),t[89]=re,t[90]=oe,t[91]=se):se=t[91];let ce;t[92]!==ne||t[93]!==se?(ce=(0,Z.jsxs)(Gs,{className:`flex h-[700px] max-h-[calc(100dvh-4rem)] w-[900px] max-w-[calc(100%-2rem)] flex-col gap-0 overflow-hidden p-0 sm:grid sm:grid-cols-[220px_1fr] sm:max-w-[min(900px,calc(100%-2rem))]`,"data-testid":`settings-dialog`,children:[ee,te,ne,se]}),t[92]=ne,t[93]=se,t[94]=ce):ce=t[94];let le;return t[95]!==r||t[96]!==n||t[97]!==ce?(le=(0,Z.jsx)(Ys,{open:n,onOpenChange:r,children:ce}),t[95]=r,t[96]=n,t[97]=ce,t[98]=le):le=t[98],le}function jC(e){let t=(0,$.c)(13),{groups:n,activeId:r,onSelect:i}=e,{_:a}=$t(),o;t[0]===a?o=t[1]:(o=a({id:`y1t8bQ`}),t[0]=a,t[1]=o);let s;if(t[2]!==r||t[3]!==n||t[4]!==i){let e;t[6]!==r||t[7]!==i?(e=e=>(0,Z.jsx)(NC,{group:e,activeId:r,onSelect:i},e.id),t[6]=r,t[7]=i,t[8]=e):e=t[8],s=n.map(e),t[2]=r,t[3]=n,t[4]=i,t[5]=s}else s=t[5];let c;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Z.jsx)(MC,{}),t[9]=c):c=t[9];let l;return t[10]!==o||t[11]!==s?(l=(0,Z.jsxs)(`nav`,{"aria-label":o,className:`flex shrink-0 gap-x-3 overflow-x-auto overscroll-contain subtle-scrollbar scroll-fade-mask-x-max-sm border-b bg-muted/30 px-3 py-2 max-sm:pt-10 sm:h-full sm:flex-col sm:gap-0 sm:overflow-x-visible sm:overflow-y-auto sm:border-r sm:border-b-0 sm:py-4`,children:[s,c]}),t[10]=o,t[11]=s,t[12]=l):l=t[12],l}function MC(){let e=(0,$.c)(4),t=typeof window<`u`?window.okDesktop??null:null,n=t?.appVersion;if(!t||!n)return null;let r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=kC(n),e[0]=r):r=e[0];let i=r,a;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Z.jsxs)(`p`,{className:`whitespace-nowrap font-mono text-xs text-muted-foreground/70`,"data-testid":`settings-sidebar-version`,children:[`v`,n]}),e[1]=a):a=e[1];let o;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=()=>{t.shell.openExternal(i)},e[2]=o):o=e[2];let s;return e[3]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Z.jsxs)(`div`,{className:`ml-auto shrink-0 px-2 sm:ml-0 sm:mt-auto sm:pt-3`,children:[a,(0,Z.jsxs)(`button`,{type:`button`,onClick:o,"data-testid":`settings-sidebar-release-notes`,className:Y(`mt-0.5 inline-flex items-center gap-1 whitespace-nowrap rounded text-xs text-muted-foreground transition-colors hover:text-foreground`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`),children:[(0,Z.jsx)(J,{id:`_PACVa`}),(0,Z.jsx)(Mi,{className:`size-3`,"aria-hidden":`true`})]})]}),e[3]=s):s=e[3],s}function NC(e){let t=(0,$.c)(28),{group:n,activeId:r,onSelect:i}=e;if(n.items.length===0)return null;let a=`settings-group-${n.id}`,o=`${a}-caption`,s=n.enabled?void 0:o,c=n.enabled?`text-muted-foreground/80`:`text-muted-foreground/50`,l;t[0]===c?l=t[1]:(l=Y(`shrink-0 whitespace-nowrap px-2 text-xs font-semibold uppercase tracking-wide font-mono sm:mb-1`,c),t[0]=c,t[1]=l);let u;t[2]!==n.label||t[3]!==a||t[4]!==s||t[5]!==l?(u=(0,Z.jsx)(`h3`,{id:a,"aria-describedby":s,className:l,children:n.label}),t[2]=n.label,t[3]=a,t[4]=s,t[5]=l,t[6]=u):u=t[6];let d;t[7]!==o||t[8]!==n.enabled?(d=n.enabled?null:(0,Z.jsx)(`p`,{id:o,className:`px-2 text-xs italic text-muted-foreground/60 sm:mb-1`,children:(0,Z.jsx)(J,{id:`JWsZlx`})}),t[7]=o,t[8]=n.enabled,t[9]=d):d=t[9];let f;if(t[10]!==r||t[11]!==o||t[12]!==n.enabled||t[13]!==n.items||t[14]!==i){let e;t[16]!==r||t[17]!==o||t[18]!==n.enabled||t[19]!==i?(e=e=>(0,Z.jsx)(`li`,{children:(0,Z.jsx)(`button`,{type:`button`,"aria-current":r===e.id?`page`:void 0,"aria-disabled":n.enabled?void 0:!0,"aria-describedby":n.enabled?void 0:o,tabIndex:n.enabled?0:-1,disabled:!n.enabled,onClick:()=>n.enabled&&i(e.id),"data-testid":`settings-sidebar-item-${e.id}`,className:Y(`w-auto whitespace-nowrap rounded px-2 py-1.5 text-left text-sm transition-colors sm:w-full`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,`disabled:cursor-not-allowed disabled:opacity-50`,r===e.id&&n.enabled?`bg-accent text-accent-foreground`:`hover:bg-accent/50`),children:e.label})},e.id),t[16]=r,t[17]=o,t[18]=n.enabled,t[19]=i,t[20]=e):e=t[20],f=n.items.map(e),t[10]=r,t[11]=o,t[12]=n.enabled,t[13]=n.items,t[14]=i,t[15]=f}else f=t[15];let p;t[21]!==a||t[22]!==f?(p=(0,Z.jsx)(`ul`,{"aria-labelledby":a,className:`flex gap-1 sm:block sm:space-y-0.5`,children:f}),t[21]=a,t[22]=f,t[23]=p):p=t[23];let m;return t[24]!==u||t[25]!==d||t[26]!==p?(m=(0,Z.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 sm:mb-4 sm:block`,children:[u,d,p]}),t[24]=u,t[25]=d,t[26]=p,t[27]=m):m=t[27],m}function PC(){let e=(0,$.c)(4),t,n,r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Z.jsx)(`span`,{className:`sr-only`,children:(0,Z.jsx)(J,{id:`GsBUCk`})}),n=(0,Z.jsx)(Ba,{className:`h-5 w-32`}),r=(0,Z.jsx)(Ba,{className:`h-4 w-64`}),e[0]=t,e[1]=n,e[2]=r):(t=e[0],n=e[1],r=e[2]);let i;return e[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsxs)(`div`,{role:`status`,"aria-live":`polite`,"aria-busy":`true`,className:`space-y-3`,"data-testid":`settings-content-skeleton`,children:[t,n,r,(0,Z.jsxs)(`div`,{className:`space-y-2`,children:[(0,Z.jsx)(Ba,{className:`h-9 w-full`}),(0,Z.jsx)(Ba,{className:`h-9 w-full`})]})]}),e[3]=i):i=e[3],i}function FC(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 h-full w-full aria-[orientation=vertical]:flex-col`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(kb,{"data-slot":`resizable-panel-group`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function IC(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)(Nb,{"data-slot":`resizable-panel`,...n}),t[2]=n,t[3]=r),r}function LC(e){let t=(0,$.c)(12),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({withHandle:i,className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===n?a=t[5]:(a=Y(`relative flex w-px items-center justify-center bg-border ring-offset-background after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-ring focus-visible:outline-hidden aria-[orientation=horizontal]:h-px aria-[orientation=horizontal]:w-full aria-[orientation=horizontal]:after:left-0 aria-[orientation=horizontal]:after:h-1 aria-[orientation=horizontal]:after:w-full aria-[orientation=horizontal]:after:translate-x-0 aria-[orientation=horizontal]:after:-translate-y-1/2 [&[aria-orientation=horizontal]>div]:rotate-90`,n),t[4]=n,t[5]=a);let o;t[6]===i?o=t[7]:(o=i&&(0,Z.jsx)(`div`,{className:`z-10 flex h-6 w-1 shrink-0 rounded-lg bg-border`}),t[6]=i,t[7]=o);let s;return t[8]!==r||t[9]!==a||t[10]!==o?(s=(0,Z.jsx)(Lb,{"data-slot":`resizable-handle`,className:a,...r,children:o}),t[8]=r,t[9]=a,t[10]=o,t[11]=s):s=t[11],s}function RC(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/input-group relative flex h-8 w-full min-w-0 items-center rounded-lg border border-input transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:bg-input/50 has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-disabled:bg-input/80 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`div`,{"data-slot":`input-group`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var zC=_i(`flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4`,{variants:{align:{"inline-start":`order-first pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem]`,"inline-end":`order-last pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem]`,"block-start":`order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2`,"block-end":`order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2`}},defaultVariants:{align:`inline-start`}});function BC(e){let t=(0,$.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,align:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?`inline-start`:i,o;t[4]!==a||t[5]!==n?(o=Y(zC({align:a}),n),t[4]=a,t[5]=n,t[6]=o):o=t[6];let s;return t[7]!==a||t[8]!==r||t[9]!==o?(s=(0,Z.jsx)(`div`,{"data-slot":`input-group-addon`,"data-align":a,className:o,onMouseDown:VC,...r}),t[7]=a,t[8]=r,t[9]=o,t[10]=s):s=t[10],s}function VC(e){e.target.closest(`button`)||(e.preventDefault(),e.currentTarget.parentElement?.querySelector(`input`)?.focus())}_i(`flex items-center gap-2 text-sm shadow-none`,{variants:{size:{xs:`h-6 gap-1 rounded-[calc(var(--radius)-3px)] px-1.5 [&>svg:not([class*='size-'])]:size-3.5`,sm:``,"icon-xs":`size-6 rounded-[calc(var(--radius)-3px)] p-0 has-[>svg]:p-0`,"icon-sm":`size-8 p-0 has-[>svg]:p-0`}},defaultVariants:{size:`xs`}});function HC(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 items-center gap-2 text-sm text-muted-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`span`,{className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function UC(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 rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(Hc,{"data-slot":`input-group-control`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function WC(e){let t=(0,$.c)(119),{findInputRef:n,query:r,replacement:i,replaceOpen:a,caseSensitive:o,wholeWord:s,current:c,total:l,onQueryChange:u,onReplacementChange:d,onReplaceOpenChange:f,onCaseSensitiveChange:p,onWholeWordChange:m,onNext:h,onPrevious:g,onReplaceCurrent:_,onReplaceAll:v,onClose:y}=e,{_:b}=$t(),x=r.length>0,S=l>0,C;t[0]!==b||t[1]!==c||t[2]!==S||t[3]!==x||t[4]!==l?(C=x?S?`${c} / ${l}`:b({id:`Ev2r9A`}):``,t[0]=b,t[1]=c,t[2]=S,t[3]=x,t[4]=l,t[5]=C):C=t[5];let w=C,T;t[6]!==y||t[7]!==h||t[8]!==g?(T=function(e){e.key===`Enter`?(e.preventDefault(),e.shiftKey?g():h()):e.key===`Escape`&&(e.preventDefault(),y())},t[6]=y,t[7]=h,t[8]=g,t[9]=T):T=t[9];let E=T,D;t[10]!==y||t[11]!==_?(D=function(e){e.key===`Enter`?(e.preventDefault(),_()):e.key===`Escape`&&(e.preventDefault(),y())},t[10]=y,t[11]=_,t[12]=D):D=t[12];let O=D,k;t[13]===b?k=t[14]:(k=b({id:`MVxpbf`}),t[13]=b,t[14]=k);let A;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,Z.jsx)(`label`,{className:`sr-only`,htmlFor:`ok-find-input`,children:(0,Z.jsx)(J,{id:`KujtjC`})}),t[15]=A):A=t[15];let j;t[16]===u?j=t[17]:(j=e=>u(e.target.value),t[16]=u,t[17]=j);let M;t[18]===b?M=t[19]:(M=b({id:`KujtjC`}),t[18]=b,t[19]=M);let N;t[20]!==n||t[21]!==E||t[22]!==r||t[23]!==j||t[24]!==M?(N=(0,Z.jsx)(UC,{ref:n,id:`ok-find-input`,value:r,onChange:j,onKeyDown:E,placeholder:M,autoComplete:`off`,spellCheck:!1,className:`h-7 px-2 text-sm`}),t[20]=n,t[21]=E,t[22]=r,t[23]=j,t[24]=M,t[25]=N):N=t[25];let P;t[26]===b?P=t[27]:(P=b({id:`-8PP0T`}),t[26]=b,t[27]=P);let F;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,Z.jsx)(yd,{"aria-hidden":`true`}),t[28]=F):F=t[28];let I;t[29]!==o||t[30]!==p||t[31]!==P?(I=(0,Z.jsx)(Ts,{asChild:!0,children:(0,Z.jsx)(Ic,{type:`button`,variant:`segmented`,size:`sm`,"aria-label":P,pressed:o,onPressedChange:p,className:`size-6 min-w-6 px-0`,children:F})}),t[29]=o,t[30]=p,t[31]=P,t[32]=I):I=t[32];let L;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,Z.jsx)(Es,{side:`bottom`,children:(0,Z.jsx)(J,{id:`-8PP0T`})}),t[33]=L):L=t[33];let R;t[34]===I?R=t[35]:(R=(0,Z.jsxs)(Os,{children:[I,L]}),t[34]=I,t[35]=R);let z;t[36]===b?z=t[37]:(z=b({id:`_7UQ7y`}),t[36]=b,t[37]=z);let B;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,Z.jsx)(Lf,{"aria-hidden":`true`}),t[38]=B):B=t[38];let V;t[39]!==m||t[40]!==z||t[41]!==s?(V=(0,Z.jsx)(Ts,{asChild:!0,children:(0,Z.jsx)(Ic,{type:`button`,variant:`segmented`,size:`sm`,"aria-label":z,pressed:s,onPressedChange:m,className:`size-6 min-w-6 px-0`,children:B})}),t[39]=m,t[40]=z,t[41]=s,t[42]=V):V=t[42];let H;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,Z.jsx)(Es,{side:`bottom`,children:(0,Z.jsx)(J,{id:`_7UQ7y`})}),t[43]=H):H=t[43];let U;t[44]===V?U=t[45]:(U=(0,Z.jsxs)(Os,{children:[V,H]}),t[44]=V,t[45]=U);let W;t[46]!==R||t[47]!==U?(W=(0,Z.jsxs)(BC,{align:`inline-end`,className:`gap-0.5`,children:[R,U]}),t[46]=R,t[47]=U,t[48]=W):W=t[48];let G;t[49]!==W||t[50]!==N?(G=(0,Z.jsxs)(RC,{className:`h-7 w-56 rounded-[min(var(--radius-md),12px)]`,children:[N,W]}),t[49]=W,t[50]=N,t[51]=G):G=t[51];let K;t[52]===w?K=t[53]:(K=(0,Z.jsx)(`span`,{role:`status`,"aria-live":`polite`,className:`min-w-14 px-1 text-right text-muted-foreground text-xs tabular-nums shrink-0`,children:w}),t[52]=w,t[53]=K);let ee;t[54]===b?ee=t[55]:(ee=b({id:`oqB2ez`}),t[54]=b,t[55]=ee);let te=!S,ne;t[56]===Symbol.for(`react.memo_cache_sentinel`)?(ne=(0,Z.jsx)(bt,{"data-icon":`inline-start`,"aria-hidden":`true`}),t[56]=ne):ne=t[56];let re;t[57]!==g||t[58]!==ee||t[59]!==te?(re=(0,Z.jsx)(Ts,{asChild:!0,children:(0,Z.jsx)(X,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":ee,disabled:te,onClick:g,children:ne})}),t[57]=g,t[58]=ee,t[59]=te,t[60]=re):re=t[60];let ie;t[61]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(0,Z.jsx)(Es,{side:`bottom`,children:(0,Z.jsx)(J,{id:`oqB2ez`})}),t[61]=ie):ie=t[61];let ae;t[62]===re?ae=t[63]:(ae=(0,Z.jsxs)(Os,{children:[re,ie]}),t[62]=re,t[63]=ae);let oe;t[64]===b?oe=t[65]:(oe=b({id:`SiUUCS`}),t[64]=b,t[65]=oe);let se=!S,ce;t[66]===Symbol.for(`react.memo_cache_sentinel`)?(ce=(0,Z.jsx)(Wi,{"data-icon":`inline-start`,"aria-hidden":`true`}),t[66]=ce):ce=t[66];let le;t[67]!==h||t[68]!==oe||t[69]!==se?(le=(0,Z.jsx)(Ts,{asChild:!0,children:(0,Z.jsx)(X,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":oe,disabled:se,onClick:h,children:ce})}),t[67]=h,t[68]=oe,t[69]=se,t[70]=le):le=t[70];let q;t[71]===Symbol.for(`react.memo_cache_sentinel`)?(q=(0,Z.jsx)(Es,{side:`bottom`,children:(0,Z.jsx)(J,{id:`SiUUCS`})}),t[71]=q):q=t[71];let ue;t[72]===le?ue=t[73]:(ue=(0,Z.jsxs)(Os,{children:[le,q]}),t[72]=le,t[73]=ue);let de=a?`secondary`:`ghost`,fe;t[74]!==b||t[75]!==a?(fe=b(a?{id:`UkQGhd`}:{id:`1RluQD`}),t[74]=b,t[75]=a,t[76]=fe):fe=t[76];let pe=a?`ok-replace-input`:void 0,me;t[77]!==f||t[78]!==a?(me=()=>f(!a),t[77]=f,t[78]=a,t[79]=me):me=t[79];let he;t[80]===Symbol.for(`react.memo_cache_sentinel`)?(he=(0,Z.jsx)(mf,{"data-icon":`inline-start`,"aria-hidden":`true`}),t[80]=he):he=t[80];let ge;t[81]!==a||t[82]!==de||t[83]!==fe||t[84]!==pe||t[85]!==me?(ge=(0,Z.jsx)(Ts,{asChild:!0,children:(0,Z.jsx)(X,{type:`button`,variant:de,size:`icon-sm`,"aria-label":fe,"aria-expanded":a,"aria-controls":pe,onClick:me,children:he})}),t[81]=a,t[82]=de,t[83]=fe,t[84]=pe,t[85]=me,t[86]=ge):ge=t[86];let _e;t[87]===a?_e=t[88]:(_e=(0,Z.jsx)(Es,{side:`bottom`,children:a?(0,Z.jsx)(J,{id:`UkQGhd`}):(0,Z.jsx)(J,{id:`1RluQD`})}),t[87]=a,t[88]=_e);let ve;t[89]!==ge||t[90]!==_e?(ve=(0,Z.jsxs)(Os,{children:[ge,_e]}),t[89]=ge,t[90]=_e,t[91]=ve):ve=t[91];let ye;t[92]!==b||t[93]!==O||t[94]!==S||t[95]!==v||t[96]!==_||t[97]!==d||t[98]!==a||t[99]!==i?(ye=a?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`label`,{className:`sr-only`,htmlFor:`ok-replace-input`,children:(0,Z.jsx)(J,{id:`fqSfXY`})}),(0,Z.jsx)(Hc,{id:`ok-replace-input`,value:i,onChange:e=>d(e.target.value),onKeyDown:O,placeholder:b({id:`fqSfXY`}),autoComplete:`off`,spellCheck:!1,className:`h-7 w-48 rounded-[min(var(--radius-md),12px)] px-2 text-sm shadow-none focus-visible:ring-2`}),(0,Z.jsxs)(Os,{children:[(0,Z.jsx)(Ts,{asChild:!0,children:(0,Z.jsx)(X,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":b({id:`bS_boY`}),disabled:!S,onClick:_,children:(0,Z.jsx)(mf,{"data-icon":`inline-start`,"aria-hidden":`true`})})}),(0,Z.jsx)(Es,{side:`bottom`,children:(0,Z.jsx)(J,{id:`bS_boY`})})]}),(0,Z.jsxs)(Os,{children:[(0,Z.jsx)(Ts,{asChild:!0,children:(0,Z.jsx)(X,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":b({id:`dr1vFs`}),disabled:!S,onClick:v,children:(0,Z.jsx)(pf,{"data-icon":`inline-start`,"aria-hidden":`true`})})}),(0,Z.jsx)(Es,{side:`bottom`,children:(0,Z.jsx)(J,{id:`dr1vFs`})})]})]}):null,t[92]=b,t[93]=O,t[94]=S,t[95]=v,t[96]=_,t[97]=d,t[98]=a,t[99]=i,t[100]=ye):ye=t[100];let be;t[101]===b?be=t[102]:(be=b({id:`wJo9oS`}),t[101]=b,t[102]=be);let xe;t[103]===Symbol.for(`react.memo_cache_sentinel`)?(xe=(0,Z.jsx)(gs,{"data-icon":`inline-start`,"aria-hidden":`true`}),t[103]=xe):xe=t[103];let Se;t[104]!==y||t[105]!==be?(Se=(0,Z.jsx)(Ts,{asChild:!0,children:(0,Z.jsx)(X,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":be,onClick:y,children:xe})}),t[104]=y,t[105]=be,t[106]=Se):Se=t[106];let Ce;t[107]===Symbol.for(`react.memo_cache_sentinel`)?(Ce=(0,Z.jsx)(Es,{side:`bottom`,children:(0,Z.jsx)(J,{id:`yz7wBu`})}),t[107]=Ce):Ce=t[107];let we;t[108]===Se?we=t[109]:(we=(0,Z.jsxs)(Os,{children:[Se,Ce]}),t[108]=Se,t[109]=we);let Te;return t[110]!==G||t[111]!==K||t[112]!==ae||t[113]!==ue||t[114]!==k||t[115]!==ve||t[116]!==ye||t[117]!==we?(Te=(0,Z.jsxs)(`search`,{"data-testid":`find-replace-bar`,"aria-label":k,className:`pointer-events-auto flex max-w-[min(calc(100vw-1rem),720px)] touch-manipulation items-center gap-1 rounded-[calc(var(--radius)+2px)] border border-input bg-popover/95 p-1 text-popover-foreground shadow-md shadow-black/10 backdrop-blur`,children:[A,G,K,ae,ue,ve,ye,we]}),t[110]=G,t[111]=K,t[112]=ae,t[113]=ue,t[114]=k,t[115]=ve,t[116]=ye,t[117]=we,t[118]=Te):Te=t[118],Te}var GC={current:0,total:0},KC=120,qC=100;function JC(e){let t=(0,$.c)(2),n;return t[0]===e?n=t[1]:(n=()=>e?Et(e):null,t[0]=e,t[1]=n),(0,Q.useSyncExternalStore)(xe,n,YC)}function YC(){return null}function XC(e){if(!e||e.isDestroyed)return null;let{from:t,to:n,empty:r}=e.state.selection;if(r)return null;let i=e.state.doc.textBetween(t,n,`
|
|
24
|
+
`).trim(),mentions:t}}function Mx(e){let{instruction:t,mentions:n}=jx(e);return t===``&&n.length===0}function Nx(e){let t=e?.content;return!Array.isArray(t)||t.length===0?!1:t.some(e=>Array.isArray(e.content)&&e.content.length>0)}function Px(e){let t=(0,$.c)(29),{ref:n,ariaLabel:r,onEmptyChange:i,onContentChange:a,onMentionsChange:o,onSubmit:s,className:c,placeholder:l,initialDoc:u}=e,d=(0,Q.useRef)(i),f=(0,Q.useRef)(a),p=(0,Q.useRef)(o),m=(0,Q.useRef)(s),h;t[0]!==a||t[1]!==i||t[2]!==o||t[3]!==s?(h=()=>{d.current=i,f.current=a,p.current=o,m.current=s},t[0]=a,t[1]=i,t[2]=o,t[3]=s,t[4]=h):h=t[4],(0,Q.useEffect)(h);let g;t[5]===l?g=t[6]:(g=Ox({placeholder:l}),t[5]=l,t[6]=g);let _=u??void 0,v;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(v=Y(`composer-prosemirror py-1 outline-none`),t[7]=v):v=t[7];let y;t[8]===r?y=t[9]:(y={role:`textbox`,"aria-label":r,"aria-multiline":`true`,class:v},t[8]=r,t[9]=y);let b;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(b=(e,t)=>t.key===`Escape`?bx.getState(e.state)?.active?!1:(e.dom.blur(),!0):t.key===`Enter`&&!t.shiftKey&&!t.isComposing&&!e.composing?bx.getState(e.state)?.active?!1:(m.current(),!0):!1,t[10]=b):b=t[10];let x;t[11]===y?x=t[12]:(x={attributes:y,handleKeyDown:b},t[11]=y,t[12]=x);let S;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(S=e=>{let{editor:t}=e;d.current(Mx(t)),f.current?.(t.getJSON()),p.current?.(jx(t).mentions)},t[13]=S):S=t[13];let C;t[14]!==g||t[15]!==_||t[16]!==x?(C={extensions:g,content:_,immediatelyRender:!0,editorProps:x,onUpdate:S},t[14]=g,t[15]=_,t[16]=x,t[17]=C):C=t[17];let w=V(C),T;t[18]!==w||t[19]!==u?(T=()=>{w&&(Mx(w)&&Nx(u)&&(console.warn(`composer draft was incompatible with the current schema — clearing it`),px()),d.current(Mx(w)),p.current?.(jx(w).mentions))},t[18]=w,t[19]=u,t[20]=T):T=t[20];let E;t[21]===w?E=t[22]:(E=[w],t[21]=w,t[22]=E),(0,Q.useEffect)(T,E);let D,O;t[23]===w?(D=t[24],O=t[25]):(D=()=>({focus:()=>w?.commands.focus(),blur:()=>w?.commands.blur(),clear:()=>w?.commands.clearContent(!0),setText:e=>{w&&(w.commands.setContent(e),f.current?.(w.getJSON()),p.current?.(jx(w).mentions))},getContent:()=>w?jx(w):{instruction:``,mentions:[]}}),O=[w],t[23]=w,t[24]=D,t[25]=O),(0,Q.useImperativeHandle)(n,D,O);let k;return t[26]!==c||t[27]!==w?(k=(0,Z.jsx)(ot,{editor:w,className:c}),t[26]=c,t[27]=w,t[28]=k):k=t[28],k}function Fx(e,t,n){return e.trim().length>0||t.length>0||n}var Ix=new Set(ta.map(e=>e.id));function Lx(e){return typeof e==`string`&&Ix.has(e)}function Rx(e){try{let t=o_(e);return Lx(t)?t:null}catch{return null}}function zx(e,t){s_(e,t)}function Bx(e){let{lastUsed:t,states:n}=e;return t&&n[t]?.installed===!0?t:ta.find(e=>n[e.id]?.installed===!0)?.id??null}function Vx(e){let t=(0,$.c)(28),{scenario:n,className:r}=e,{_:i}=$t(),{states:a,refresh:o}=pa(),{dispatch:s}=xa(),c=$i(),l=ya(),[u,d]=(0,Q.useState)(Wx),f=(0,Q.useRef)(!1),[p,m]=(0,Q.useState)(null),h=p!==null&&l!==null,g=(0,Q.useRef)(null),[_]=(0,Q.useState)(Ux),[v,y]=(0,Q.useState)(!0),[b,x]=(0,Q.useState)(!1),S;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(S=function(e){y(e),e||x(!1)},t[0]=S):S=t[0];let C=S,w=Qb(n),T;t[1]===a?T=t[2]:(T=e=>a[e.id]?.installed===!0,t[1]=a,t[2]=T);let E=ta.filter(T),D;t[3]===a?D=t[4]:(D=ta.every(e=>a[e.id]?.installed!=null),t[3]=a,t[4]=D);let O=D,k=O&&E.length===0,A,j;t[5]!==O||t[6]!==a?(A=()=>{if(!O||f.current)return;let e=Bx({lastUsed:Rx(),states:a});d(t=>e===t?t:e)},j=[O,a],t[5]=O,t[6]=a,t[7]=A,t[8]=j):(A=t[7],j=t[8]),(0,Q.useEffect)(A,j);let M=function(e){f.current=!0,m(null),d(e),zx(e)},N=function(e){f.current=!0,m(e)},P=function(){if(l===null||p===null)return;let{instruction:e,mentions:t}=g.current?.getContent()??{instruction:``,mentions:[]};if(!Fx(e,t,!1)){x(!0);return}let r=ca({workspace:c,description:e,scenario:n,mentions:t});r!==null&&(l.launchInTerminal(r,p),g.current?.clear(),px())},F=function(e){let{instruction:t,mentions:r}=g.current?.getContent()??{instruction:``,mentions:[]};if(!Fx(t,r,!1)){x(!0);return}zx(e);let i=ca({workspace:c,description:t,scenario:n,mentions:r});i!==null&&(s(e,i),g.current?.clear(),px())},I=function(){h?P():u!==null&&F(u)},L=function(e){g.current?.setText(e),g.current?.focus()};if(k){let e;t[9]===r?e=t[10]:(e=Y(`flex w-full flex-wrap items-center justify-between gap-3 rounded-2xl border border-border/60 bg-card px-4 py-3`,r),t[9]=r,t[10]=e);let n;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsx)(ns,{"aria-hidden":`true`,className:`size-4 shrink-0 text-muted-foreground`}),t[11]=n):n=t[11];let i;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2.5`,children:[n,(0,Z.jsx)(`span`,{className:`text-1sm text-muted-foreground`,children:(0,Z.jsx)(J,{id:`3IseAk`})})]}),t[12]=i):i=t[12];let a;t[13]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Z.jsx)(`div`,{className:`flex flex-wrap items-center gap-1.5`,children:ta.map(Hx)}),t[13]=a):a=t[13];let o;return t[14]===e?o=t[15]:(o=(0,Z.jsxs)(`div`,{className:e,"data-testid":`create-no-agents`,children:[i,a]}),t[14]=e,t[15]=o),o}let R=E.length>0,z=l!==null,B;t[16]===r?B=t[17]:(B=Y(`flex w-full flex-col gap-3`,r),t[16]=r,t[17]=B);let V;t[18]===i?V=t[19]:(V=i({id:`7hctf2`}),t[18]=i,t[19]=V);let H;t[20]===i?H=t[21]:(H=i({id:`0jD-Gn`}),t[20]=i,t[21]=H);let U;t[22]!==v||t[23]!==b?(U=b&&v?(0,Z.jsx)(`p`,{role:`alert`,className:`text-1sm text-destructive`,"data-testid":`create-input-required`,children:(0,Z.jsx)(J,{id:`1FLarN`})}):(0,Z.jsx)(`span`,{}),t[22]=v,t[23]=b,t[24]=U):U=t[24];let W=u===null?(0,Z.jsx)(X,{type:`button`,variant:`outline`,disabled:!0,className:`gap-1.5`,"data-testid":`create-with-agent`,children:(0,Z.jsx)(J,{id:`hYgDIe`})}):(0,Z.jsxs)(hx,{children:[(0,Z.jsx)(X,{type:`button`,onClick:()=>h?P():F(u),variant:`outline`,className:`gap-1.5`,"data-testid":`create-with-agent`,children:h&&p!==null?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(sa,{id:oa(p),"aria-hidden":`true`,className:`size-3.5`}),(0,Z.jsx)(J,{id:`4rjwLG`,values:{0:zn[p].displayName}})]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(sa,{id:u,"aria-hidden":`true`,className:`size-3.5`}),(0,Z.jsx)(J,{id:`9dw5bW`,values:{0:na(u)}})]})}),(0,Z.jsxs)(Tc,{onOpenChange:e=>{e&&o()},children:[(0,Z.jsx)(hc,{asChild:!0,children:(0,Z.jsx)(X,{type:`button`,"aria-label":i({id:`nskygk`}),size:`icon`,variant:`outline`,"data-testid":`create-with-agent-menu`,children:(0,Z.jsx)(Wi,{"aria-hidden":`true`,className:`size-3.5`})})}),(0,Z.jsxs)(yc,{align:`end`,className:`min-w-[200px]`,children:[z?(0,Z.jsxs)(vc,{"aria-label":i({id:`ALhMYW`}),children:[(0,Z.jsx)(Oc,{children:(0,Z.jsx)(J,{id:`ALhMYW`})}),va.map(e=>{let{displayName:t}=zn[e];return(0,Z.jsxs)(_c,{onSelect:()=>N(e),"data-testid":`create-with-cli-${e}`,"aria-label":i({id:`QYfQdv`,values:{displayName:t}}),children:[(0,Z.jsx)(sa,{id:oa(e),"aria-hidden":`true`,className:`size-4`}),(0,Z.jsx)(`span`,{className:`flex-1`,children:t}),p===e?(0,Z.jsx)(Ui,{"aria-hidden":`true`,className:`size-4 text-muted-foreground`}):null]},e)})]}):null,R?(0,Z.jsxs)(Z.Fragment,{children:[z?(0,Z.jsx)(Ac,{}):null,(0,Z.jsxs)(vc,{"aria-label":i({id:`BBqGS9`}),children:[(0,Z.jsx)(Oc,{children:(0,Z.jsx)(J,{id:`BBqGS9`})}),E.map(e=>(0,Z.jsxs)(_c,{onSelect:()=>M(e.id),"data-testid":`create-agent-option-${e.id}`,children:[(0,Z.jsx)(sa,{id:e.id,"aria-hidden":`true`,className:`size-4`}),(0,Z.jsx)(`span`,{className:`flex-1`,children:e.displayName}),!h&&e.id===u?(0,Z.jsx)(Ui,{"aria-hidden":`true`,className:`size-4 text-muted-foreground`}):null]},e.id))]})]}):null]})]})]}),G;return t[25]!==W||t[26]!==U?(G=(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2 px-3 pb-3`,children:[U,W]}),t[25]=W,t[26]=U,t[27]=G):G=t[27],(0,Z.jsxs)(`div`,{className:B,children:[(0,Z.jsxs)(`div`,{className:`flex w-full flex-col rounded-2xl border border-border/60 bg-card shadow-sm transition-colors focus-within:border-ring focus-within:ring-3 focus-within:ring-ring/50`,children:[(0,Z.jsx)(Px,{ref:g,ariaLabel:V,placeholder:H,onEmptyChange:C,onContentChange:fx,onSubmit:I,initialDoc:_,className:`max-h-96 overflow-y-auto px-4 py-3 text-sm leading-relaxed subtle-scrollbar [&_.ProseMirror]:min-h-16`}),G]}),n!==`existing-repo`&&w.length>0?(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center justify-center gap-2`,children:[(0,Z.jsx)(`span`,{className:`text-1sm text-muted-foreground`,children:(0,Z.jsx)(J,{id:`I5685_`})}),w.map(e=>{let t=e.icon;return(0,Z.jsxs)(X,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>L(e.prompt),className:`gap-1.5 rounded-md font-normal text-muted-foreground hover:text-foreground`,"data-testid":`create-suggestion-${e.id}`,children:[(0,Z.jsx)(t,{className:`size-3.5`,"aria-hidden":`true`}),e.label]},e.id)})]}):null]})}function Hx(e){return(0,Z.jsxs)(X,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>void Qi(e),className:`gap-1.5`,"data-testid":`install-agent-${e.id}`,children:[(0,Z.jsx)(sa,{id:e.id,"aria-hidden":`true`,className:`size-3.5`}),e.displayName,(0,Z.jsx)(Mi,{"aria-hidden":`true`,className:`size-3`})]},e.id)}function Ux(){return dx().doc??void 0}function Wx(){return Rx()}var Gx=3100,Kx=3;function qx(e,t,n){let r=n?.windowMs??600,i=n?.maxLevel??Kx;if(e===0||t>=r)return 1;let a=e+1;return a>i?i:a}var Jx={0:{count:0,startRadius:0,baseDistance:0,distanceVariance:0,sizeMin:0,sizeMax:0,maxDelay:0,durationMin:0,durationMax:0},1:{count:0,startRadius:0,baseDistance:0,distanceVariance:0,sizeMin:0,sizeMax:0,maxDelay:0,durationMin:0,durationMax:0},2:{count:0,startRadius:0,baseDistance:0,distanceVariance:0,sizeMin:0,sizeMax:0,maxDelay:0,durationMin:0,durationMax:0},3:{count:16,startRadius:11,baseDistance:7,distanceVariance:3,sizeMin:.45,sizeMax:1.2,maxDelay:500,durationMin:1100,durationMax:2400}},Yx=[`var(--color-azure-blue)`,`var(--color-sky-blue)`,`var(--color-violet-300)`,`var(--color-orange-light)`,`var(--color-crystal-blue)`,`var(--color-white-cream)`];function Xx(e,t={}){let n=t.rng??Math.random,r=t.colors??Yx,i=Jx[e];if(i.count===0||r.length===0)return[];let a=[],o=Math.PI*2/i.count;for(let e=0;e<i.count;e++){let t=e*o+(n()-.5)*o*.7,s=i.baseDistance+(n()-.5)*2*i.distanceVariance,c=i.sizeMin+n()*(i.sizeMax-i.sizeMin),l=n()*i.maxDelay,u=i.durationMin+n()*(i.durationMax-i.durationMin),d=Math.floor(n()*r.length),f=Math.cos(t),p=Math.sin(t);a.push({id:e,dx:f*s,dy:p*s,originDx:f*i.startRadius,originDy:p*i.startRadius,size:c,color:r[d]??`currentColor`,delay:l,duration:u})}return a}var Zx=1.8,Qx=90,$x=16,eS=380,tS=.025,nS=.1,rS=.18,iS=400,aS=9.2736,oS=18.1799,sS=14.5244,cS={1:{halfWidth:1.5,apexLift:2.2},2:{halfWidth:1.4,apexLift:2.6},3:{halfWidth:1.25,apexLift:3}};function lS(e,t){let{halfWidth:n,apexLift:r}=cS[t];return`M${e-n} ${sS+.3} Q${e} ${sS-r}, ${e+n} ${sS+.3}`}function uS(e){let t=1.5,n=.3;return`M${e-t} ${sS-n} Q${e} ${sS+1.4}, ${e+t} ${sS-n}`}var dS=15,fS=15;function pS(e){return{fill:e.color,"--fx-tx":`${e.dx}px`,"--fx-ty":`${e.dy}px`,"--fx-delay":`${e.delay}ms`,"--fx-duration":`${e.duration}ms`}}function mS(e){let t=(0,$.c)(71),{size:n,className:r,trackMouse:i,variant:a,celebrateSignal:o}=e,s=n===void 0?48:n,c=i===void 0?!0:i,l=a===void 0?`default`:a,u=o===void 0?0:o,d=(0,Q.useRef)(null),f=(0,Q.useRef)(null),p=(0,Q.useRef)(null),m;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(m={x:0,y:0},t[0]=m):m=t[0];let h=(0,Q.useRef)(m),[g,_]=(0,Q.useState)(0),[v,y]=(0,Q.useState)(0),b;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(b=[],t[1]=b):b=t[1];let[x,S]=(0,Q.useState)(b),C=(0,Q.useRef)(0),w=(0,Q.useRef)(void 0),T=l===`sleeping`,E;t[2]!==g||t[3]!==T?(E=function(){if(T)return;let e=typeof performance<`u`&&typeof performance.now==`function`?performance.now():Date.now(),t=C.current===0?1/0:e-C.current;C.current=e;let n=qx(g,t);_(n),y(vS),S(Xx(n)),clearTimeout(w.current),w.current=setTimeout(()=>{_(0),S([])},Gx)},t[2]=g,t[3]=T,t[4]=E):E=t[4];let D=E,O,k;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(O=()=>()=>clearTimeout(w.current),k=[],t[5]=O,t[6]=k):(O=t[5],k=t[6]),(0,Q.useEffect)(O,k);let A,j;t[7]!==u||t[8]!==T?(A=()=>{u===0||T||(_(3),y(_S),S(Xx(3)),clearTimeout(w.current),w.current=setTimeout(()=>{_(0),S([])},Gx))},j=[u,T],t[7]=u,t[8]=T,t[9]=A,t[10]=j):(A=t[9],j=t[10]),(0,Q.useEffect)(A,j);let M,N;t[11]!==T||t[12]!==c?(M=()=>{if(!c||T||window.matchMedia(`(prefers-reduced-motion: reduce)`).matches)return;let e=0,t=0,n=!1,r=0,i=0,a=0,o=0,s=0,l=function(){s===0&&(s=requestAnimationFrame(m))},u=function(r){e=r.clientX,t=r.clientY,n=!0,l()};function m(){s=0;let c=f.current,u=d.current;if(!c||!u){l();return}let m=n;n=!1;let g=c.getBoundingClientRect(),_=g.left+g.width/2,v=g.top+g.height*.48,y=e-_,b=t-v,x=Math.hypot(y,b),S=Math.max(-1,Math.min(1,y/eS)),C=-Math.max(-1,Math.min(1,b/eS))*$x,w=S*$x,T=0,E=0;if(x>=1){let e=Math.min(x/Qx,1)*Zx;T=y/x*e,E=b/x*e}let D=Math.abs(C-r)<.01&&Math.abs(w-i)<.01&&Math.abs(T-a)<.01&&Math.abs(E-o)<.01;if(!m&&D)return;l(),r+=(C-r)*nS,i+=(w-i)*nS,u.style.transform=`perspective(${iS}px) rotateX(${r.toFixed(3)}deg) rotateY(${i.toFixed(3)}deg)`,a+=(T-a)*rS,o+=(E-o)*rS;let O=i*tS,k=-r*tS,A=a+O,j=o+k;h.current.x=A,h.current.y=j,p.current?.setAttribute(`transform`,`translate(${A.toFixed(3)} ${j.toFixed(3)})`)}return document.addEventListener(`mousemove`,u,{passive:!0}),l(),()=>{document.removeEventListener(`mousemove`,u),s!==0&&cancelAnimationFrame(s),s=0,d.current&&(d.current.style.transform=``),h.current={x:0,y:0},p.current?.removeAttribute(`transform`)}},N=[c,T],t[11]=T,t[12]=c,t[13]=M,t[14]=N):(M=t[13],N=t[14]),(0,Q.useEffect)(M,N);let P;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(P=()=>{let e=p.current;if(!e)return;let{x:t,y:n}=h.current;e.setAttribute(`transform`,`translate(${t.toFixed(3)} ${n.toFixed(3)})`)},t[15]=P):P=t[15],(0,Q.useLayoutEffect)(P);let F=g>0,I=F?g:1,L=F?`ok-blob-clicked-${g}`:null,R;t[16]===r?R=t[17]:(R=Y(`ok-blob-3d-wrapper`,r),t[16]=r,t[17]=R);let z=T?`cursor-default`:`cursor-pointer`,B=`body-${v}`,V=T&&`ok-blob-sleeping`,H;t[18]!==L||t[19]!==V?(H=Y(`ok-blob-group`,V,L),t[18]=L,t[19]=V,t[20]=H):H=t[20];let U;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(U=(0,Z.jsx)(`path`,{d:`M25.2339 6.78134C25.5199 7.35734 25.8179 8.47234 26.0179 9.07834C26.0189 9.08234 26.0209 9.08634 26.0219 9.09134C26.0229 9.09534 26.0249 9.10034 26.0259 9.10434C26.0539 9.19734 26.0949 9.29533 26.1519 9.41633C26.2919 9.71133 26.5269 10.1173 27.1299 11.1683C27.3259 11.4643 27.5209 11.7693 27.7119 12.0903C29.9739 15.1623 29.3259 20.1913 27.0469 22.9153C26.7779 23.2953 26.4869 23.6043 26.1889 23.8863C26.1519 23.9253 26.1129 23.9643 26.0729 24.0033C25.3159 24.7543 24.2949 25.4673 23.6129 25.8323C22.7469 26.2983 22.1349 26.5483 21.6299 26.7463C20.3649 27.3063 19.0609 27.7733 17.6569 28.0423C15.9649 28.3513 14.1939 28.4433 12.4569 28.1373C11.4779 27.9663 10.5119 27.6663 9.60891 27.2493C8.77491 26.8663 7.99192 26.3853 7.26992 25.8403C6.83592 25.5393 6.43893 25.2343 6.08093 24.9383C5.57893 24.5223 5.15993 24.1263 4.83493 23.7793C4.04993 22.9443 3.31593 21.8893 2.80893 21.0953C2.72593 20.9663 2.64792 20.8433 2.57592 20.7293C2.56192 20.7093 2.54793 20.6893 2.53393 20.6703C2.08593 20.0263 1.71892 19.3293 1.43792 18.5993C1.42892 18.5453 1.42093 18.4903 1.41293 18.4353C1.32093 17.7443 1.08292 16.9423 1.01092 15.6333C0.984921 15.0653 0.998928 14.4013 1.12393 13.6353C1.20693 13.1413 1.31993 12.9023 1.40893 12.7113C1.43593 12.6543 1.46193 12.6023 1.48593 12.5483C1.56793 12.3653 1.59392 12.1563 1.63592 11.9083C1.68992 11.5883 1.76992 11.1943 2.04592 10.7553C2.94392 9.37934 3.36792 8.81934 3.66592 8.33934C3.75592 8.20334 3.84292 8.08134 3.94192 7.96634C4.21592 7.64634 4.67693 7.29534 5.10293 7.05734C5.16693 7.02234 5.23093 6.98834 5.29193 6.95534C5.62993 6.77834 6.22592 6.30135 6.66992 5.92035C6.83692 5.77635 7.08193 5.60735 7.37393 5.40935C7.67393 5.20535 8.02593 4.96934 8.39193 4.70234C9.32093 4.02634 9.84091 3.69134 10.2599 3.42334C10.3799 3.34734 10.4919 3.27734 10.6049 3.20834C10.9609 2.98834 11.4149 2.73034 11.8869 2.48634C12.4519 2.19334 13.0469 1.92133 13.5089 1.72233C14.7399 1.30233 16.0539 1.01333 17.4169 1.00033C18.1169 0.991333 18.7939 1.16534 19.2389 1.43034C19.6869 1.69534 19.8689 2.00335 19.8039 2.23935C19.7379 2.47835 19.4399 2.63634 19.0109 2.74734C18.5789 2.85634 18.0469 2.92035 17.4889 2.96135C16.3639 3.04235 15.2399 3.36435 14.1499 3.80835C12.8199 4.35135 11.5379 5.07133 10.2719 5.84733C9.38691 6.39133 8.51192 6.97334 7.63592 7.56834C7.54492 7.63034 7.45492 7.69135 7.36492 7.75235C6.97392 8.06635 6.58293 8.38134 6.22293 8.66334C5.97893 8.85734 5.76793 9.04834 5.59393 9.21434C5.26893 9.52334 5.02393 9.74334 4.81893 9.93934C4.67793 10.0753 4.55793 10.2013 4.45593 10.3443C4.40093 10.4213 4.32992 10.5273 4.24792 10.6593C3.90492 11.1933 3.44493 12.1693 3.15393 13.1173C3.01893 13.5363 2.87991 14.0343 2.79391 14.5253C2.66591 15.2253 2.65594 15.9053 2.71994 16.2373C2.82794 16.8193 2.95593 17.4833 3.14093 18.0553C3.31293 18.6003 3.52991 19.0583 3.70791 19.2823C3.81591 19.4183 3.90394 19.5473 3.99594 19.6913C4.09394 19.8413 4.19191 20.0073 4.31091 20.2033C4.47891 20.4803 4.68592 20.8163 5.00192 21.2493C5.36492 21.7463 5.61793 22.1043 5.83493 22.4023C6.14493 22.8243 6.38591 23.1343 6.83691 23.5033C7.33891 23.9113 7.86593 24.3113 8.26693 24.6393C8.44893 24.7883 8.66993 24.9443 8.90493 25.0963C9.21593 25.2963 9.55192 25.4893 9.85592 25.6703C10.1059 25.8203 10.3059 25.9633 10.4869 26.0863C10.5429 26.1243 10.5979 26.1603 10.6519 26.1943C10.8699 26.2803 11.0929 26.3593 11.3159 26.4283C11.3539 26.4323 11.3949 26.4353 11.4369 26.4393C11.6509 26.4573 11.9089 26.4733 12.2209 26.5133C12.7169 26.5753 13.1399 26.6603 13.6019 26.7243C13.9589 26.7733 14.3409 26.8083 14.7729 26.7893C15.0729 26.7753 15.4069 26.7353 15.7389 26.6813C16.2349 26.6023 16.7179 26.4943 17.0569 26.4473C17.1499 26.4343 17.2359 26.4343 17.3209 26.4373C17.3489 26.4393 17.3799 26.4413 17.4109 26.4433C17.4119 26.4433 17.4119 26.4433 17.4129 26.4433C17.4199 26.4433 17.4279 26.4443 17.4349 26.4443C18.2329 26.2413 19.0259 25.9433 19.7959 25.5983C19.8609 25.5633 19.9259 25.5273 19.9899 25.4913C20.3059 25.3173 20.6049 25.1383 20.7869 24.9943C20.9829 24.8393 21.5189 24.5373 22.0579 24.1853C22.4109 23.9553 22.7649 23.7053 23.0369 23.4833C23.1949 23.3553 23.3689 23.2693 23.5479 23.1773C23.7129 23.0923 23.8809 23.0013 24.0349 22.8653C24.1109 22.7983 24.1869 22.7173 24.2639 22.6303C24.3309 22.5563 24.4039 22.4723 24.4759 22.3923C24.5459 22.3153 24.7199 22.1723 24.9139 21.9793C25.0079 21.8863 25.1059 21.7783 25.1909 21.6713C25.2199 21.6323 25.2489 21.5943 25.2769 21.5553C25.5919 21.0403 25.8779 20.5003 26.1019 19.9653C26.1299 19.8403 26.1379 19.7293 26.1279 19.6373C26.1199 19.5703 26.1029 19.5113 26.0839 19.4503C26.0599 19.3643 26.0329 19.2773 26.0239 19.1723C26.0169 19.0893 26.0309 19.0043 26.0629 18.9543C26.0779 18.9323 26.0969 18.9143 26.1129 18.8993C26.1329 18.8823 26.1499 18.8673 26.1569 18.8443C26.1609 18.8273 26.1579 18.8073 26.1529 18.7833C26.1459 18.7443 26.1369 18.6943 26.1539 18.6293C26.2189 18.3853 26.2869 18.1103 26.3319 17.8383C26.3829 17.5393 26.4049 17.2433 26.3949 17.0123C26.3849 16.7493 26.3909 16.3823 26.3469 16.0003C26.3179 15.7343 26.2659 15.4663 26.1979 15.2383C26.1319 15.0143 26.0219 14.7913 25.9039 14.5783C25.7629 14.3223 25.6119 14.0783 25.5169 13.8453C25.4969 13.7983 25.4999 13.7263 25.4999 13.6323C25.5009 13.5673 25.4999 13.4913 25.4919 13.4083C25.3239 13.1243 25.1459 12.8423 24.9589 12.5483C24.9479 12.5413 24.9369 12.5333 24.9249 12.5263C24.6689 12.3503 24.3139 12.1173 24.0769 11.5503C24.0179 11.4063 24.0069 11.2983 23.9969 11.1993C23.9859 11.1013 23.9799 11.0183 23.9289 10.9093C23.8709 10.7853 23.7759 10.6583 23.6709 10.4993C23.5849 10.3703 23.4899 10.2133 23.4199 10.0423C23.3819 9.95134 23.3509 9.85734 23.3329 9.75934C23.3299 9.74334 23.3269 9.72534 23.3229 9.70634C23.2899 9.52734 23.2439 9.26534 23.2409 8.98634C23.0209 8.24434 22.8339 7.48833 22.6519 6.77633C22.3429 5.57133 22.0519 4.54234 21.3329 3.95434C20.9839 3.65334 20.5689 3.35433 20.2459 3.05433C19.9259 2.75633 19.7449 2.47534 19.8019 2.23834C19.8639 2.00634 20.1589 1.82934 20.6659 1.80534C21.1699 1.78334 21.8699 1.93235 22.5209 2.39235C23.6159 3.14235 24.2029 4.38334 24.5599 5.35734C24.5829 5.40834 24.6049 5.46034 24.6259 5.51234C24.7849 5.89434 24.9529 6.22834 25.1199 6.55534C25.1579 6.63034 25.1969 6.70834 25.2339 6.78134Z`,className:`ok-blob-body`}),t[21]=U):U=t[21];let W=(F||T)&&`ok-blob-eye-hidden`,G;t[22]===W?G=t[23]:(G=Y(`ok-blob-eye`,W),t[22]=W,t[23]=G);let K;t[24]===G?K=t[25]:(K=(0,Z.jsx)(`ellipse`,{cx:aS,cy:sS,rx:1.2722,ry:1.9083,className:G}),t[24]=G,t[25]=K);let ee=(F||T)&&`ok-blob-eye-hidden`,te;t[26]===ee?te=t[27]:(te=Y(`ok-blob-eye ok-blob-eye-right`,ee),t[26]=ee,t[27]=te);let ne;t[28]===te?ne=t[29]:(ne=(0,Z.jsx)(`ellipse`,{cx:oS,cy:sS,rx:1.2722,ry:1.9083,className:te}),t[28]=te,t[29]=ne);let re;t[30]===I?re=t[31]:(re=lS(aS,I),t[30]=I,t[31]=re);let ie=(!F||T)&&`ok-blob-eye-hidden`,ae;t[32]===ie?ae=t[33]:(ae=Y(`ok-blob-happy-eye`,ie),t[32]=ie,t[33]=ae);let oe;t[34]!==re||t[35]!==ae?(oe=(0,Z.jsx)(`path`,{d:re,strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:ae}),t[34]=re,t[35]=ae,t[36]=oe):oe=t[36];let se;t[37]===I?se=t[38]:(se=lS(oS,I),t[37]=I,t[38]=se);let ce=(!F||T)&&`ok-blob-eye-hidden`,le;t[39]===ce?le=t[40]:(le=Y(`ok-blob-happy-eye`,ce),t[39]=ce,t[40]=le);let q;t[41]!==se||t[42]!==le?(q=(0,Z.jsx)(`path`,{d:se,strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:le}),t[41]=se,t[42]=le,t[43]=q):q=t[43];let ue;t[44]===T?ue=t[45]:(ue=T?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`path`,{d:uS(aS),strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:`ok-blob-sleeping-eye`}),(0,Z.jsx)(`path`,{d:uS(oS),strokeWidth:`1.2`,strokeLinecap:`round`,fill:`none`,className:`ok-blob-sleeping-eye`})]}):null,t[44]=T,t[45]=ue);let de;t[46]!==K||t[47]!==ne||t[48]!==oe||t[49]!==q||t[50]!==ue?(de=(0,Z.jsxs)(`g`,{ref:p,children:[K,ne,oe,q,ue]}),t[46]=K,t[47]=ne,t[48]=oe,t[49]=q,t[50]=ue,t[51]=de):de=t[51];let fe;t[52]!==B||t[53]!==H||t[54]!==de?(fe=(0,Z.jsxs)(`g`,{className:H,children:[U,de]},B),t[52]=B,t[53]=H,t[54]=de,t[55]=fe):fe=t[55];let pe;t[56]===T?pe=t[57]:(pe=T?(0,Z.jsxs)(`g`,{children:[(0,Z.jsx)(`text`,{x:21,y:7,className:`ok-blob-z ok-blob-z-1`,children:`z`}),(0,Z.jsx)(`text`,{x:26,y:2,className:`ok-blob-z ok-blob-z-2`,children:`z`})]}):null,t[56]=T,t[57]=pe);let me;t[58]!==v||t[59]!==x?(me=x.length>0&&(0,Z.jsx)(`g`,{children:x.map(hS)},`firework-${v}`),t[58]=v,t[59]=x,t[60]=me):me=t[60];let he;t[61]!==D||t[62]!==s||t[63]!==z||t[64]!==fe||t[65]!==pe||t[66]!==me?(he=(0,Z.jsxs)(`svg`,{ref:f,width:s,height:s,viewBox:`0 0 30 30`,fill:`none`,overflow:`visible`,xmlns:`http://www.w3.org/2000/svg`,className:z,"aria-hidden":`true`,onClick:D,onMouseDown:gS,children:[fe,pe,me]}),t[61]=D,t[62]=s,t[63]=z,t[64]=fe,t[65]=pe,t[66]=me,t[67]=he):he=t[67];let ge;return t[68]!==R||t[69]!==he?(ge=(0,Z.jsx)(`span`,{ref:d,className:R,children:he}),t[68]=R,t[69]=he,t[70]=ge):ge=t[70],ge}function hS(e){return(0,Z.jsx)(`circle`,{cx:dS+e.originDx,cy:fS+e.originDy,r:e.size,className:`ok-blob-firework`,style:pS(e)},e.id)}function gS(e){return e.preventDefault()}function _S(e){return e+1}function vS(e){return e+1}function yS(e){let t=(0,$.c)(12),{title:n,subtitle:r,celebrateSignal:i}=e,a;t[0]===i?a=t[1]:(a=(0,Z.jsx)(mS,{size:64,celebrateSignal:i}),t[0]=i,t[1]=a);let o;t[2]===n?o=t[3]:(o=(0,Z.jsx)(`h2`,{className:`text-2xl font-light tracking-tighter text-balance`,children:n}),t[2]=n,t[3]=o);let s;t[4]===r?s=t[5]:(s=r?(0,Z.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:r}):null,t[4]=r,t[5]=s);let c;t[6]!==o||t[7]!==s?(c=(0,Z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[o,s]}),t[6]=o,t[7]=s,t[8]=c):c=t[8];let l;return t[9]!==a||t[10]!==c?(l=(0,Z.jsxs)(`div`,{className:`flex flex-col items-start gap-3 @md/emptystate:flex-row @md/emptystate:items-center @md/emptystate:gap-4`,children:[a,c]}),t[9]=a,t[10]=c,t[11]=l):l=t[11],l}function bS({isOnboarding:e,isEmbedded:t}){return e?{title:{id:`6h4zVU`},subtitle:t?{id:`vGeNNQ`}:{id:`qpQwGC`}}:{title:{id:`FOGD7m`},subtitle:t?{id:`3DTatP`}:{id:`MqQoV-`}}}var xS=`open-knowledge:create-top-level-file`;function SS(e={}){window.dispatchEvent(new CustomEvent(xS,{detail:e}))}function CS(e){let t=t=>{let n=t.detail;e(n??{})};return window.addEventListener(xS,t),()=>window.removeEventListener(xS,t)}function wS(e){let t=(0,$.c)(28),{celebrateSignal:n,onAddStarterPack:r}=e,{_:i}=$t(),a=da(),{title:o,subtitle:s}=bS({isOnboarding:!1,isEmbedded:a}),c=so(),l;t[0]!==c.data||t[1]!==c.status?(l=c.status===`ready`?c.data:[],t[0]=c.data,t[1]=c.status,t[2]=l):l=t[2];let u=l,d=c.status===`loading`||c.status===`idle`,f=c.status===`error`,p=yS,m=i(o),h=i(s),g;t[3]!==p||t[4]!==n||t[5]!==m||t[6]!==h?(g=(0,Z.jsx)(p,{title:m,subtitle:h,celebrateSignal:n}),t[3]=p,t[4]=n,t[5]=m,t[6]=h,t[7]=g):g=t[7];let _;t[8]===a?_=t[9]:(_=a?(0,Z.jsx)($b,{scenario:`existing-repo`}):(0,Z.jsx)(Vx,{scenario:`existing-repo`}),t[8]=a,t[9]=_);let v;t[10]!==u||t[11]!==f||t[12]!==d?(v=d||f||u.length>0?(0,Z.jsx)(DS,{templates:u,loading:d,error:f,onSelect:ES}):null,t[10]=u,t[11]=f,t[12]=d,t[13]=v):v=t[13];let y,b;t[14]===Symbol.for(`react.memo_cache_sentinel`)?(y=(0,Z.jsx)(Zt,{"aria-hidden":`true`,className:`size-3`}),b=(0,Z.jsx)(J,{id:`IajAbS`}),t[14]=y,t[15]=b):(y=t[14],b=t[15]);let x;t[16]===r?x=t[17]:(x=(0,Z.jsxs)(X,{onClick:r,variant:`link-muted`,size:`xs`,className:`font-mono text-xs uppercase tracking-wider`,children:[y,b]}),t[16]=r,t[17]=x);let S;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,Z.jsx)(X,{variant:`link-muted`,className:`justify-end`,size:`sm`,onClick:TS,children:(0,Z.jsx)(J,{id:`L4Cdd9`,components:{0:(0,Z.jsx)(lt,{"aria-hidden":`true`,className:`size-3`})}})}),t[18]=S):S=t[18];let C;t[19]===x?C=t[20]:(C=(0,Z.jsxs)(`div`,{className:`-mt-6 flex w-full items-center justify-between gap-4`,children:[x,S]}),t[19]=x,t[20]=C);let w;t[21]!==C||t[22]!==v?(w=(0,Z.jsxs)(`div`,{className:`flex w-full flex-col gap-8`,children:[v,C]}),t[21]=C,t[22]=v,t[23]=w):w=t[23];let T;return t[24]!==w||t[25]!==g||t[26]!==_?(T=(0,Z.jsxs)(`div`,{className:`flex w-full flex-col gap-8 py-12 max-w-5xl my-auto`,children:[g,_,w]}),t[24]=w,t[25]=g,t[26]=_,t[27]=T):T=t[27],T}function TS(){return SS({initialDir:``})}function ES(e,t){return SS({template:{folder:e,name:t}})}function DS(e){let t=(0,$.c)(25),{templates:n,loading:r,error:i,onSelect:a}=e,{_:o}=$t(),s;t[0]===o?s=t[1]:(s=o({id:`_8quCH`}),t[0]=o,t[1]=s);let c;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Z.jsx)(`span`,{children:(0,Z.jsx)(J,{id:`_8quCH`})}),t[2]=c):c=t[2];let l;t[3]!==o||t[4]!==i||t[5]!==r||t[6]!==n?(l=r||i?null:(0,Z.jsx)(qe,{className:`text-2xs`,variant:`gray`,"aria-label":o({id:`X7u0xR`,values:{0:n.length}}),children:n.length}),t[3]=o,t[4]=i,t[5]=r,t[6]=n,t[7]=l):l=t[7];let u;t[8]===l?u=t[9]:(u=(0,Z.jsxs)(`header`,{className:`flex items-center gap-2 font-mono text-2xs uppercase tracking-wider text-muted-foreground`,children:[c,l]}),t[8]=l,t[9]=u);let d;t[10]===o?d=t[11]:(d=o({id:`irFGwu`}),t[10]=o,t[11]=d);let f;t[12]!==i||t[13]!==r||t[14]!==a||t[15]!==n?(f=r?(0,Z.jsx)(`p`,{className:`p-4 text-1sm text-muted-foreground`,children:(0,Z.jsx)(J,{id:`Hl89Qd`})}):i?(0,Z.jsx)(`p`,{role:`alert`,className:`p-4 text-1sm text-destructive`,children:(0,Z.jsx)(J,{id:`54Y6Fg`})}):n.map(e=>(0,Z.jsx)(OS,{template:e,targetLabel:e.source_folder===``?`/`:`${e.source_folder}/`,onClick:()=>a(e.source_folder,e.name)},`${e.source_folder}/${e.name}`)),t[12]=i,t[13]=r,t[14]=a,t[15]=n,t[16]=f):f=t[16];let p;t[17]!==r||t[18]!==d||t[19]!==f?(p=(0,Z.jsx)(`div`,{className:`w-full overflow-hidden rounded-xl border border-border/60 bg-card`,children:(0,Z.jsx)(`section`,{"aria-busy":r,"aria-label":d,tabIndex:0,className:`subtle-scrollbar scroll-fade-mask flex max-h-[260px] w-full flex-col overflow-y-auto overscroll-contain focus-visible:outline-none focus-visible:ring-3 focus-visible:ring-ring/50`,children:f})}),t[17]=r,t[18]=d,t[19]=f,t[20]=p):p=t[20];let m;return t[21]!==s||t[22]!==u||t[23]!==p?(m=(0,Z.jsxs)(`section`,{"aria-label":s,className:`flex w-full flex-col gap-3`,children:[u,p]}),t[21]=s,t[22]=u,t[23]=p,t[24]=m):m=t[24],m}function OS(e){let t=(0,$.c)(24),{template:n,targetLabel:r,onClick:i}=e,{_:a}=$t(),o;t[0]!==n.name||t[1]!==n.title?(o=n.title?.trim()||n.name,t[0]=n.name,t[1]=n.title,t[2]=o):o=t[2];let s=o,c=`${n.name}.md`,l=n.source_folder===``,u;t[3]!==a||t[4]!==s||t[5]!==c||t[6]!==l||t[7]!==r?(u=a(l?{id:`89TtiD`,values:{displayTitle:s,fileName:c}}:{id:`0_J12R`,values:{displayTitle:s,fileName:c,targetLabel:r}}),t[3]=a,t[4]=s,t[5]=c,t[6]=l,t[7]=r,t[8]=u):u=t[8];let d=u,f;t[9]===s?f=t[10]:(f=(0,Z.jsx)(`span`,{className:`truncate text-sm font-medium leading-tight text-foreground/80`,children:s}),t[9]=s,t[10]=f);let p;t[11]===c?p=t[12]:(p=(0,Z.jsx)(`span`,{className:`truncate font-mono text-1sm font-normal text-muted-foreground`,children:c}),t[11]=c,t[12]=p);let m;t[13]!==f||t[14]!==p?(m=(0,Z.jsxs)(`span`,{className:`flex min-w-0 items-baseline gap-2`,children:[f,p]}),t[13]=f,t[14]=p,t[15]=m):m=t[15];let h=`shrink-0 font-mono text-1sm ${l?`text-muted-foreground/70`:`text-muted-foreground`}`,g;t[16]!==h||t[17]!==r?(g=(0,Z.jsx)(`span`,{className:h,children:r}),t[16]=h,t[17]=r,t[18]=g):g=t[18];let _;return t[19]!==d||t[20]!==i||t[21]!==m||t[22]!==g?(_=(0,Z.jsxs)(X,{type:`button`,variant:`ghost`,onClick:i,"aria-label":d,className:`group flex h-auto w-full items-center justify-between gap-4 rounded-none p-4 text-left transition-colors hover:bg-muted/50 focus-visible:bg-muted/50`,children:[m,g]}),t[19]=d,t[20]=i,t[21]=m,t[22]=g,t[23]=_):_=t[23],_}function kS(e){let t=(0,$.c)(25),{terminalDock:n}=e,r=n===void 0?null:n,[i,a]=(0,Q.useState)(!1),[o,s]=(0,Q.useState)(void 0),[c,l]=(0,Q.useState)(null),[u,d]=(0,Q.useState)(0),f=(0,Q.useRef)(!1),p=(0,Q.useRef)(void 0),m,h;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(m=()=>{let e=!1,t=async function(){try{let{ok:t,body:n}=await qi();if(e)return;let r=t?Bn.safeParse(n):null;r?.success?(l(MS(r.data.documents)),f.current=!0):f.current||=(l(1),!0)}catch{!e&&!f.current&&(l(1),f.current=!0)}};t();let n=xl(e=>{e.includes(`files`)&&t()});return()=>{e=!0,n(),clearTimeout(p.current)}},h=[],t[0]=m,t[1]=h):(m=t[0],h=t[1]),(0,Q.useEffect)(m,h);let g;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(g=function(){clearTimeout(p.current),p.current=setTimeout(()=>d(jS),500),qi().then(e=>{let{ok:t,body:n}=e;if(!t)return;let r=Bn.safeParse(n);r.success&&l(MS(r.data.documents))}).catch(AS)},t[2]=g):g=t[2];let _=g,v=c!==null,y=c===0,b;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(b=function(e){a(e),e||s(void 0)},t[3]=b):b=t[3];let x=b;if(r!==null){let e=r===`bottom`?`justify-end`:`justify-center`,n;t[4]===e?n=t[5]:(n=Y(`@container/emptystate flex min-h-0 flex-1 flex-col items-center pb-8 pt-10`,e),t[4]=e,t[5]=n);let i;t[6]!==u||t[7]!==y||t[8]!==v?(i=v?(0,Z.jsx)(NS,{isOnboarding:y,celebrateSignal:u}):null,t[6]=u,t[7]=y,t[8]=v,t[9]=i):i=t[9];let a;t[10]===i?a=t[11]:(a=(0,Z.jsx)(`div`,{className:`flex w-full flex-col items-center px-4 @md/emptystate:px-10 @2xl/emptystate:px-16`,children:i}),t[10]=i,t[11]=a);let o;return t[12]!==n||t[13]!==a?(o=(0,Z.jsx)(`div`,{className:n,children:a}),t[12]=n,t[13]=a,t[14]=o):o=t[14],o}let S;t[15]!==u||t[16]!==y||t[17]!==v?(S=v?y?(0,Z.jsx)(PS,{celebrateSignal:u,onPackSelect:e=>{s(e),a(!0)}}):(0,Z.jsx)(wS,{celebrateSignal:u,onAddStarterPack:()=>{a(!0)}}):null,t[15]=u,t[16]=y,t[17]=v,t[18]=S):S=t[18];let C;t[19]!==o||t[20]!==i?(C=(0,Z.jsx)(Bh,{open:i,onOpenChange:x,onSeedApplied:_,initialPackId:o}),t[19]=o,t[20]=i,t[21]=C):C=t[21];let w;return t[22]!==S||t[23]!==C?(w=(0,Z.jsx)(`div`,{className:`@container/emptystate flex min-h-0 flex-1 flex-col items-center overflow-y-auto subtle-scrollbar`,children:(0,Z.jsxs)(`div`,{className:`flex w-full flex-1 flex-col items-center px-4 @md/emptystate:px-10 @2xl/emptystate:px-16`,children:[S,C]})}),t[22]=S,t[23]=C,t[24]=w):w=t[24],w}function AS(){}function jS(e){return e+1}function MS(e){return gl(e).filter(e=>e.kind===`document`||e.kind===`folder`).length}function NS(e){let t=(0,$.c)(15),{isOnboarding:n,celebrateSignal:r}=e,{_:i}=$t(),a=da(),o,s,c,l;if(t[0]!==i||t[1]!==a||t[2]!==n){let{title:e,subtitle:r}=bS({isOnboarding:n,isEmbedded:a});l=`w-full max-w-5xl`,o=yS,s=i(e),c=i(r),t[0]=i,t[1]=a,t[2]=n,t[3]=o,t[4]=s,t[5]=c,t[6]=l}else o=t[3],s=t[4],c=t[5],l=t[6];let u;t[7]!==o||t[8]!==r||t[9]!==s||t[10]!==c?(u=(0,Z.jsx)(o,{title:s,subtitle:c,celebrateSignal:r}),t[7]=o,t[8]=r,t[9]=s,t[10]=c,t[11]=u):u=t[11];let d;return t[12]!==l||t[13]!==u?(d=(0,Z.jsx)(`div`,{className:l,children:u}),t[12]=l,t[13]=u,t[14]=d):d=t[14],d}function PS(e){let t=(0,$.c)(29),{celebrateSignal:n,onPackSelect:r}=e,{_:i}=$t(),a=da(),o,s,c,l;if(t[0]!==i||t[1]!==a){let{title:e,subtitle:n}=bS({isOnboarding:!0,isEmbedded:a});l=`flex w-full flex-col gap-10 py-12 max-w-5xl my-auto`,o=yS,s=i(e),c=i(n),t[0]=i,t[1]=a,t[2]=o,t[3]=s,t[4]=c,t[5]=l}else o=t[2],s=t[3],c=t[4],l=t[5];let u;t[6]!==o||t[7]!==n||t[8]!==s||t[9]!==c?(u=(0,Z.jsx)(o,{title:s,subtitle:c,celebrateSignal:n}),t[6]=o,t[7]=n,t[8]=s,t[9]=c,t[10]=u):u=t[10];let d;t[11]===a?d=t[12]:(d=a?(0,Z.jsx)($b,{scenario:`new-project`}):(0,Z.jsx)(Vx,{scenario:`new-project`}),t[11]=a,t[12]=d);let f;t[13]!==i||t[14]!==a?(f=i(a?{id:`GubkSu`}:{id:`xeXS4P`}),t[13]=i,t[14]=a,t[15]=f):f=t[15];let p;t[16]===f?p=t[17]:(p=(0,Z.jsx)(IS,{label:f}),t[16]=f,t[17]=p);let m;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(m=[`okf`,`entity-vault`],t[18]=m):m=t[18];let h;t[19]===r?h=t[20]:(h=(0,Z.jsx)(Ph,{onPackSelect:r,onCreateBlankFile:FS,collapsedPackIds:m}),t[19]=r,t[20]=h);let g;t[21]!==p||t[22]!==h?(g=(0,Z.jsxs)(`div`,{className:`flex w-full flex-col gap-3`,children:[p,h]}),t[21]=p,t[22]=h,t[23]=g):g=t[23];let _;return t[24]!==g||t[25]!==l||t[26]!==u||t[27]!==d?(_=(0,Z.jsxs)(`div`,{className:l,children:[u,d,g]}),t[24]=g,t[25]=l,t[26]=u,t[27]=d,t[28]=_):_=t[28],_}function FS(){return SS()}function IS(e){let t=(0,$.c)(13),{label:n}=e,{_:r}=$t(),i;t[0]===n?i=t[1]:(i=(0,Z.jsx)(`span`,{className:`font-mono text-2xs uppercase tracking-wider text-muted-foreground whitespace-nowrap`,children:n}),t[0]=n,t[1]=i);let a;t[2]===r?a=t[3]:(a=r({id:`jAMpHn`}),t[2]=r,t[3]=a);let o;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Z.jsx)(Qo,{className:`size-3.5`,"aria-hidden":!0}),t[4]=o):o=t[4];let s;t[5]===a?s=t[6]:(s=(0,Z.jsx)(Ts,{className:`text-muted-foreground transition-colors hover:text-foreground`,"aria-label":a,"data-testid":`starter-pack-info`,children:o}),t[5]=a,t[6]=s);let c;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Z.jsx)(Es,{className:`max-w-xs`,children:(0,Z.jsx)(`p`,{className:`leading-relaxed wrap-break-word`,children:(0,Z.jsx)(J,{id:`k4CuuV`})})}),t[7]=c):c=t[7];let l;t[8]===s?l=t[9]:(l=(0,Z.jsxs)(Os,{children:[s,c]}),t[8]=s,t[9]=l);let u;return t[10]!==i||t[11]!==l?(u=(0,Z.jsxs)(`div`,{className:`flex items-center gap-1.5`,children:[i,l]}),t[10]=i,t[11]=l,t[12]=u):u=t[12],u}function LS(e){return e===``?`.ok/frontmatter.yml`:`${e}/.ok/frontmatter.yml`}function RS(e){let t=(0,$.c)(70),{folderPath:n,state:r,onChange:i}=e,{_:a}=$t(),[o,s]=(0,Q.useState)(!1),[c,l]=(0,Q.useState)(null),[u,d]=(0,Q.useState)(null);if(r.status===`idle`||r.status===`loading`){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsxs)(`section`,{className:`rounded-lg border bg-card p-4 space-y-3`,children:[(0,Z.jsx)(BS,{}),(0,Z.jsx)(Ba,{className:`h-7 w-full`}),(0,Z.jsx)(Ba,{className:`h-7 w-full`}),(0,Z.jsx)(Ba,{className:`h-7 w-full`})]}),t[0]=e):e=t[0],e}if(r.status===`error`){let{message:e}=r,n;return t[1]===e?n=t[2]:(n=(0,Z.jsx)(`section`,{className:`rounded-lg border border-destructive/30 bg-destructive/5 p-4 text-sm text-destructive`,role:`alert`,children:(0,Z.jsx)(J,{id:`lzmtKp`,values:{message:e}})}),t[1]=e,t[2]=n),n}let f;t[3]===r.data.frontmatterLocal?f=t[4]:(f=r.data.frontmatterLocal??{},t[3]=r.data.frontmatterLocal,t[4]=f);let p=f,m;t[5]===r.data.folder.path?m=t[6]:(m=LS(r.data.folder.path),t[5]=r.data.folder.path,t[6]=m);let h=m,g;t[7]===p?g=t[8]:(g=Object.keys(p),t[7]=p,t[8]=g);let _=g,v;t[9]!==a||t[10]!==n||t[11]!==i?(v=async function(e,t){let r=await Ho(n,{[e]:t});if(!r.ok){let{error:e}=r;hs.error(a({id:`xXo8FT`,values:{error:e}}));return}i()},t[9]=a,t[10]=n,t[11]=i,t[12]=v):v=t[12];let y=v,b;t[13]!==a||t[14]!==n||t[15]!==i?(b=async function(e){let t=await Ho(n,{[e]:null});if(!t.ok){let{error:e}=t;hs.error(a({id:`ZU8VV_`,values:{error:e}}));return}i()},t[13]=a,t[14]=n,t[15]=i,t[16]=b):b=t[16];let x=b,S;t[17]!==y||t[18]!==p?(S=function(e,t){let n=p[e];y(e,Hi(n,t))},t[17]=y,t[18]=p,t[19]=S):S=t[19];let C=S,w;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(w=function(){l({name:``,type:`text`,value:``,error:null}),s(!1)},t[20]=w):w=t[20];let T=w,E;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(E=function(e){l(t=>{if(!t)return t;let n=e===`date`?new Date().toISOString().slice(0,10):Li[e];return{...t,type:e,value:n,error:null}})},t[21]=E):E=t[21];let D=E,O;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(O=function(e){l(t=>t&&{...t,value:e})},t[22]=O):O=t[22];let k=O,A;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(A=function(e){l(t=>t&&{...t,name:e,error:null})},t[23]=A):A=t[23];let j=A,M;t[24]!==a||t[25]!==c||t[26]!==n||t[27]!==i||t[28]!==p?(M=async function(e){if(!c)return;let t=e??c.value,r=c.name.trim();if(!r){l({...c,value:t,error:a({id:`8_brI5`})});return}if(fr(t)){l({...c,value:t,error:a({id:`hXUWyd`})});return}if(Object.hasOwn(p,r)){l({...c,value:t,error:a({id:`CTJLpz`,values:{trimmed:r}})});return}let o=await Ho(n,{[r]:t});if(!o.ok){l({...c,value:t,error:o.error});return}l(null),i()},t[24]=a,t[25]=c,t[26]=n,t[27]=i,t[28]=p,t[29]=M):M=t[29];let N=M,P;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(P=function(e){d({key:e,draft:e,error:null})},t[30]=P):P=t[30];let F=P,I;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(I=function(e){d(t=>t&&{...t,draft:e,error:null})},t[31]=I):I=t[31];let L=I,R;t[32]!==a||t[33]!==n||t[34]!==i||t[35]!==p||t[36]!==u?(R=async function(){if(!u)return;let e=u.draft.trim();if(!e){d({...u,error:a({id:`8_brI5`})});return}if(e===u.key){d(null);return}if(Object.hasOwn(p,e)){d({...u,error:a({id:`CTJLpz`,values:{trimmed:e}})});return}let t=p[u.key],r=await Ho(n,{[u.key]:null,[e]:t});if(!r.ok){d({...u,error:r.error});return}d(null),i()},t[32]=a,t[33]=n,t[34]=i,t[35]=p,t[36]=u,t[37]=R):R=t[37];let z=R,B;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(B=function(){d(null)},t[38]=B):B=t[38];let V=B,H=!o,U;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(U=e=>s(!e),t[39]=U):U=t[39];let W=`size-3 transition-transform ${o?``:`rotate-90`}`,G;t[40]===W?G=t[41]:(G=(0,Z.jsx)(Ki,{className:W,"aria-hidden":!0}),t[40]=W,t[41]=G);let K;t[42]===Symbol.for(`react.memo_cache_sentinel`)?(K=(0,Z.jsx)(`span`,{children:(0,Z.jsx)(J,{id:`vQIVHc`})}),t[42]=K):K=t[42];let ee;t[43]===G?ee=t[44]:(ee=(0,Z.jsxs)(`span`,{className:`flex items-center gap-1.5 text-xs font-semibold uppercase font-mono tracking-wider text-muted-foreground`,children:[G,K]}),t[43]=G,t[44]=ee);let te;t[45]===h?te=t[46]:(te=(0,Z.jsx)(`code`,{className:`text-xs text-muted-foreground font-mono cursor-text select-text`,onClick:zS,children:h}),t[45]=h,t[46]=te);let ne;t[47]!==ee||t[48]!==te?(ne=(0,Z.jsxs)(Vs,{className:`flex w-full cursor-pointer items-center justify-between gap-2 px-3 py-2.5 data-[state=open]:border-b border-border`,children:[ee,te]}),t[47]=ee,t[48]=te,t[49]=ne):ne=t[49];let re;t[50]===Symbol.for(`react.memo_cache_sentinel`)?(re=(0,Z.jsx)(`p`,{className:`px-1 pb-2 text-sm text-muted-foreground`,children:(0,Z.jsx)(J,{id:`hSBIG-`})}),t[50]=re):re=t[50];let ie;t[51]!==c||t[52]!==y||t[53]!==z||t[54]!==_||t[55]!==p||t[56]!==x||t[57]!==u||t[58]!==C?(ie=_.length===0&&!c?(0,Z.jsx)(`p`,{className:`px-1 py-1 text-sm text-muted-foreground`,children:(0,Z.jsx)(J,{id:`4c_a6S`})}):_.map(e=>{let t=p[e];return(0,Z.jsx)(Bi,{keyName:e,value:t,declared:Fi(t,ar(t)),rename:{state:u?.key===e?u:null,onBegin:()=>F(e),onChangeDraft:L,onCommit:z,onCancel:V},badge:null,onCommit:t=>void y(e,t),onChangeType:t=>C(e,t),onRemove:()=>void x(e)},e)}),t[51]=c,t[52]=y,t[53]=z,t[54]=_,t[55]=p,t[56]=x,t[57]=u,t[58]=C,t[59]=ie):ie=t[59];let ae;t[60]!==c||t[61]!==N?(ae=c?(0,Z.jsx)(Ri,{draft:c,onChangeName:j,onChangeType:D,onChangeValue:k,onCommit:e=>void N(e),onCancel:()=>l(null)}):(0,Z.jsx)(`div`,{className:`mt-1 flex flex-wrap items-center gap-1`,children:(0,Z.jsxs)(X,{type:`button`,variant:`ghost`,size:`sm`,"data-testid":`add-property-trigger`,onClick:()=>T(),className:`flex items-center gap-1.5 rounded px-2 py-1 font-medium text-sm hover:bg-muted/50 hover:text-foreground`,children:[(0,Z.jsx)(Zt,{className:`size-3.5`}),(0,Z.jsx)(`span`,{children:(0,Z.jsx)(J,{id:`G8t9NN`})})]})}),t[60]=c,t[61]=N,t[62]=ae):ae=t[62];let oe;t[63]!==ie||t[64]!==ae?(oe=(0,Z.jsx)(Bs,{children:(0,Z.jsxs)(`div`,{className:`px-2 py-2`,children:[re,ie,ae]})}),t[63]=ie,t[64]=ae,t[65]=oe):oe=t[65];let se;return t[66]!==H||t[67]!==ne||t[68]!==oe?(se=(0,Z.jsx)(`section`,{className:`rounded-lg border bg-card`,children:(0,Z.jsxs)(Hs,{open:H,onOpenChange:U,children:[ne,oe]})}),t[66]=H,t[67]=ne,t[68]=oe,t[69]=se):se=t[69],se}function zS(e){return e.stopPropagation()}function BS(){let e=(0,$.c)(2),t;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Z.jsx)(Id,{className:`size-4 text-muted-foreground`,"aria-hidden":!0}),e[0]=t):t=e[0];let n;return e[1]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[t,(0,Z.jsx)(`h2`,{className:`text-xs font-semibold uppercase font-mono tracking-wider text-muted-foreground`,children:(0,Z.jsx)(J,{id:`vQIVHc`})})]}),e[1]=n):n=e[1],n}function VS(e){let t=Math.floor((Date.now()-new Date(e).getTime())/1e3);return t<60?Wc._({id:`xOTzt5`}):t<3600?Wc._({id:`zbymaY`,values:{0:Math.floor(t/60)}}):t<86400?Wc._({id:`optX0N`,values:{0:Math.floor(t/3600)}}):t<86400*7?Wc._({id:`l1l8sj`,values:{0:Math.floor(t/86400)}}):new Date(e).toLocaleDateString(void 0,{month:`short`,day:`numeric`})}function HS(e){return(e.split(`/`).pop()??e).replace(/\.md$/,``)}function US(e){let t=e.message,n=t.indexOf(`: `),r=n===-1?t:t.slice(0,n),i=n===-1?``:t.slice(n+2);switch(r){case`template-create`:return{Icon:Za,label:Wc._({id:`QR5SP1`}),detail:HS(i)};case`template-edit`:return{Icon:Do,label:Wc._({id:`-LHLx7`}),detail:HS(i)};case`template-delete`:return{Icon:To,label:Wc._({id:`_gkGSK`}),detail:HS(i)};case`template-rename`:case`template-move`:{let[e,t]=i.split(` -> `);return{Icon:dd,label:Wc._({id:`KPW5WC`}),detail:`${HS(e??``)} → ${HS(t??i)}`}}case`folder-frontmatter-edit`:return{Icon:Id,label:Wc._({id:`_tekeB`}),detail:``};case`folder-frontmatter-delete`:return{Icon:Id,label:Wc._({id:`ZWxfrc`}),detail:``};case`folder-create`:return{Icon:Id,label:Wc._({id:`ZQLDTl`}),detail:``};default:return{Icon:Ud,label:r.replace(/-/g,` `),detail:HS(i)}}}function WS(e){return e.contributors.length>0?e.contributors[0].name:e.author===`openknowledge-service`||e.author===`server`?Wc._({id:`B2DrPb`}):e.author||Wc._({id:`Ef7StM`})}function GS(e){let t=(0,$.c)(15),{folderPath: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,s]=(0,Q.useState)(!0),[c,l]=(0,Q.useState)(!1),u,d;if(t[1]===n?(u=t[2],d=t[3]):(u=()=>{let e=!1,t=async function(){try{let t=await fetch(`/api/history?folder=${encodeURIComponent(n)}&limit=50`);if(e)return;if(!t.ok){l(!0),s(!1);return}let r=await t.json();if(e)return;a(r.entries??[]),l(!1),s(!1)}catch(t){e||(console.warn(`[FolderTimelineCard] failed to load folder timeline:`,t),l(!0),s(!1))}};s(!0),t();let r=yl(t);return()=>{e=!0,r()}},d=[n],t[1]=n,t[2]=u,t[3]=d),(0,Q.useEffect)(u,d),c||!o&&i.length===0)return null;let f;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Z.jsx)(`h2`,{className:`text-xs font-semibold uppercase font-mono tracking-wider text-muted-foreground`,children:(0,Z.jsx)(J,{id:`XJOV1Y`})}),t[4]=f):f=t[4];let p;t[5]===i.length?p=t[6]:(p=i.length>0?(0,Z.jsx)(qe,{className:`text-xs`,variant:`secondary`,children:i.length}):null,t[5]=i.length,t[6]=p);let m;t[7]===p?m=t[8]:(m=(0,Z.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-border px-3 py-1`,children:[f,p]}),t[7]=p,t[8]=m);let h;t[9]!==i||t[10]!==o?(h=(0,Z.jsx)(`div`,{className:`px-3 py-2.5`,children:o?(0,Z.jsxs)(`div`,{className:`space-y-2`,role:`status`,"aria-busy":`true`,children:[(0,Z.jsx)(Ba,{className:`h-8 w-full`}),(0,Z.jsx)(Ba,{className:`h-8 w-full`})]}):(0,Z.jsx)(`ul`,{className:`space-y-1`,children:i.map(KS)})}),t[9]=i,t[10]=o,t[11]=h):h=t[11];let g;return t[12]!==m||t[13]!==h?(g=(0,Z.jsxs)(`section`,{className:`rounded-lg border bg-card`,"data-testid":`folder-timeline-card`,children:[m,h]}),t[12]=m,t[13]=h,t[14]=g):g=t[14],g}function KS(e){let{Icon:t,label:n,detail:r}=US(e);return(0,Z.jsxs)(`li`,{className:`flex items-center gap-2.5 rounded-md px-2 py-1.5 text-sm`,children:[(0,Z.jsx)(t,{className:`size-3.5 shrink-0 text-muted-foreground`,"aria-hidden":!0}),(0,Z.jsxs)(`span`,{className:`min-w-0 flex-1 truncate`,children:[(0,Z.jsx)(`span`,{className:`text-foreground`,children:n}),r?(0,Z.jsx)(`code`,{className:`ml-1.5 font-mono text-xs text-muted-foreground`,children:r}):null]}),(0,Z.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1 text-xs text-muted-foreground`,children:[(0,Z.jsx)(If,{className:`size-3`,"aria-hidden":!0}),WS(e)]}),(0,Z.jsx)(`time`,{className:`shrink-0 text-xs text-muted-foreground/80`,dateTime:e.timestamp,title:new Date(e.timestamp).toLocaleString(),children:VS(e.timestamp)})]},e.sha)}function qS(e){let t=e.split(`/`).pop();return t?`${e}/${t}`:null}function JS(e,t){let n=t.get(`${e}/index`);if(n)return n;let r=qS(e);if(r){let e=t.get(r);if(e)return e}return e.split(`/`).pop()??e}function YS(e,t,n){let r=n.get(e);return r&&r!==e?r:t}function XS(e,t){let n=e===``?``:`${e}/`,r=[...t.folderPaths].filter(e=>e.startsWith(n)).map(e=>({path:e,rel:e.slice(n.length)})).filter(e=>e.rel.length>0&&!e.rel.includes(`/`)).map(({path:e,rel:n})=>({kind:`folder`,path:e,name:n,title:JS(e,t.pageTitles)})),i=[...t.pages].filter(e=>e.startsWith(n)).map(e=>({docName:e,rel:e.slice(n.length)})).filter(e=>e.rel.length>0&&!e.rel.includes(`/`)).map(({docName:e,rel:n})=>{let r=t.pageMeta.get(e);return{kind:`file`,path:e,name:n,title:YS(e,n,t.pageTitles),size:r?.size??0,modified:r?.modified??``}}),a=[...r,...i].sort((e,t)=>e.kind===t.kind?e.title.localeCompare(t.title)||e.name.localeCompare(t.name):e.kind===`folder`?-1:1);return{title:JS(e,t.pageTitles),children:a}}function ZS(e){let t=(0,$.c)(41),{folderPath:n,state:r,onChange:i,folderConfigHandle:a}=e,[o,s]=(0,Q.useState)(null),[c,l]=(0,Q.useState)(null),[u,d]=(0,Q.useState)(!1);if(r.status===`idle`||r.status===`loading`){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsxs)(`section`,{className:`rounded-lg border bg-card px-3 py-2.5 space-y-3`,children:[(0,Z.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,Z.jsx)(`h2`,{className:`text-xs font-semibold uppercase font-mono tracking-wider text-muted-foreground`,children:(0,Z.jsx)(J,{id:`-QCLWk`})})}),(0,Z.jsx)(Ba,{className:`h-12 w-full`}),(0,Z.jsx)(Ba,{className:`h-12 w-full`})]}),t[0]=e):e=t[0],e}if(r.status===`error`){let{message:e}=r,n;return t[1]===e?n=t[2]:(n=(0,Z.jsx)(`section`,{className:`rounded-lg border border-destructive/30 bg-destructive/5 p-4 text-sm text-destructive`,role:`alert`,children:(0,Z.jsx)(J,{id:`iDZtvM`,values:{message:e}})}),t[1]=e,t[2]=n),n}let f;t[3]===r.data.folder.templates_available?f=t[4]:(f=r.data.folder.templates_available??[],t[3]=r.data.folder.templates_available,t[4]=f);let p=f,m;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,Z.jsx)(`h2`,{className:`text-xs font-semibold uppercase font-mono tracking-wider text-muted-foreground`,children:(0,Z.jsx)(J,{id:`-QCLWk`})}),t[5]=m):m=t[5];let h;t[6]===p.length?h=t[7]:(h=(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[m,(0,Z.jsx)(qe,{className:`text-xs`,variant:`secondary`,children:p.length})]}),t[6]=p.length,t[7]=h);let g;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,Z.jsxs)(X,{variant:`ghost`,className:`font-mono uppercase`,size:`sm`,onClick:()=>d(!0),children:[(0,Z.jsx)(Zt,{className:`size-3.5`,"aria-hidden":!0}),(0,Z.jsx)(J,{id:`G1Gw0v`})]}),t[8]=g):g=t[8];let _;t[9]===h?_=t[10]:(_=(0,Z.jsxs)(`div`,{className:`flex items-center justify-between gap-2 border-b border-border px-3 py-1`,children:[h,g]}),t[9]=h,t[10]=_);let v;t[11]===p?v=t[12]:(v=(0,Z.jsx)(`div`,{className:`px-3 py-2.5`,children:p.length===0?(0,Z.jsx)(`p`,{className:`text-sm text-muted-foreground`,children:(0,Z.jsx)(J,{id:`MZSBsh`})}):(0,Z.jsx)(`ul`,{className:`space-y-1`,children:p.map(e=>(0,Z.jsx)(Ea,{template:e,onCreate:()=>l(e.name),onEdit:()=>Jo(b(e.source_folder,e.name)),onDelete:()=>s(e),badge:e.scope===`inherited`?(0,Z.jsx)(Pi,{source:e.source_folder,target:`templates/${e.name}.md`}):void 0},e.path))})}),t[11]=p,t[12]=v);let y;t[13]!==_||t[14]!==v?(y=(0,Z.jsxs)(`section`,{className:`rounded-lg border bg-card`,children:[_,v]}),t[13]=_,t[14]=v,t[15]=y):y=t[15];let x;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(x=e=>{e||s(null)},t[16]=x):x=t[16];let S;t[17]!==o||t[18]!==i?(S=(0,Z.jsx)(Va,{template:o,onOpenChange:x,onDeleted:i}),t[17]=o,t[18]=i,t[19]=S):S=t[19];let C;t[20]===p?C=t[21]:(C=new Set(p.map(QS)),t[20]=p,t[21]=C);let w;t[22]!==n||t[23]!==i?(w=e=>{i(),Jo(b(n,e))},t[22]=n,t[23]=i,t[24]=w):w=t[24];let T;t[25]!==n||t[26]!==u||t[27]!==C||t[28]!==w?(T=(0,Z.jsx)(Aa,{folderPath:n,existingNames:C,open:u,onOpenChange:d,onCreated:w}),t[25]=n,t[26]=u,t[27]=C,t[28]=w,t[29]=T):T=t[29];let E=c!==null,D;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(D=e=>{e||l(null)},t[30]=D):D=t[30];let O=c??void 0,k;t[31]!==a||t[32]!==n||t[33]!==E||t[34]!==O?(k=(0,Z.jsx)(dh,{open:E,onOpenChange:D,kind:`file`,initialDir:n,initialTemplate:O,folderConfig:a}),t[31]=a,t[32]=n,t[33]=E,t[34]=O,t[35]=k):k=t[35];let A;return t[36]!==T||t[37]!==k||t[38]!==y||t[39]!==S?(A=(0,Z.jsxs)(Z.Fragment,{children:[y,S,T,k]}),t[36]=T,t[37]=k,t[38]=y,t[39]=S,t[40]=A):A=t[40],A}function QS(e){return e.name}function $S(e){let t=(0,$.c)(14),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,containerClassName: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(`relative w-full overflow-x-auto subtle-scrollbar`,r),t[4]=r,t[5]=a);let o;t[6]===n?o=t[7]:(o=Y(`w-full caption-bottom text-sm`,n),t[6]=n,t[7]=o);let s;t[8]!==i||t[9]!==o?(s=(0,Z.jsx)(`table`,{"data-slot":`table`,className:o,...i}),t[8]=i,t[9]=o,t[10]=s):s=t[10];let c;return t[11]!==a||t[12]!==s?(c=(0,Z.jsx)(`div`,{"data-slot":`table-container`,className:a,children:s}),t[11]=a,t[12]=s,t[13]=c):c=t[13],c}function eC(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(`[&_tr]:border-b`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`thead`,{"data-slot":`table-header`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function tC(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(`[&_tr:last-child]:border-0`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`tbody`,{"data-slot":`table-body`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function nC(e){let t=(0,$.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,noHover:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=(i===void 0?!1:i)&&`hover:bg-transparent`,o;t[4]!==n||t[5]!==a?(o=Y(`hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors`,a,n),t[4]=n,t[5]=a,t[6]=o):o=t[6];let s;return t[7]!==r||t[8]!==o?(s=(0,Z.jsx)(`tr`,{"data-slot":`table-row`,className:o,...r}),t[7]=r,t[8]=o,t[9]=s):s=t[9],s}function rC(e){let t=(0,$.c)(10),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,scope:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?`col`:i,o;t[4]===n?o=t[5]:(o=Y(`font-mono uppercase text-xs text-muted-foreground h-10 px-4 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]`,n),t[4]=n,t[5]=o);let s;return t[6]!==r||t[7]!==a||t[8]!==o?(s=(0,Z.jsx)(`th`,{"data-slot":`table-head`,scope:a,className:o,...r}),t[6]=r,t[7]=a,t[8]=o,t[9]=s):s=t[9],s}function iC(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(`py-3 px-4 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`td`,{"data-slot":`table-cell`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function aC(e){if(!e)return`—`;let t=new Date(e),n=new Date().getTime()-t.getTime(),r=Math.floor(n/6e4);if(r<1)return Wc._({id:`xOTzt5`});if(r<60)return Wc._({id:`NRSLBe`,values:{diffMin:r}});let i=Math.floor(r/60);if(i<24)return Wc._({id:`hDKtoF`,values:{diffHrs:i}});let a=Math.floor(i/24);return a<30?Wc._({id:`QDZbvN`,values:{diffDays:a}}):t.toLocaleDateString(void 0,{month:`short`,day:`numeric`,year:`numeric`})}function oC(e,t,n){return[...e].sort((e,r)=>{if(e.kind!==r.kind)return e.kind===`folder`?-1:1;let i=0;switch(t){case`name`:i=e.title.localeCompare(r.title)||e.name.localeCompare(r.name);break;case`modified`:{let t=e.kind===`file`?e.modified:``,n=r.kind===`file`?r.modified:``;i=t.localeCompare(n);break}}return n===`asc`?i:-i})}function sC(e){let t=(0,$.c)(10),{label:n,sortKey:r,activeKey:i,activeDir:a,onSort:o}=e,s=i===r,c;t[0]!==o||t[1]!==r?(c=()=>o(r),t[0]=o,t[1]=r,t[2]=c):c=t[2];let l;t[3]!==a||t[4]!==s?(l=s?a===`asc`?(0,Z.jsx)(Pe,{className:`ml-1 size-3`}):(0,Z.jsx)(Re,{className:`ml-1 size-3`}):(0,Z.jsx)(fd,{className:`ml-1 size-3 text-muted-foreground/50`}),t[3]=a,t[4]=s,t[5]=l):l=t[5];let u;return t[6]!==n||t[7]!==c||t[8]!==l?(u=(0,Z.jsxs)(X,{variant:`ghost`,size:`sm`,className:`-ml-3 h-8 uppercase font-mono`,onClick:c,children:[n,l]}),t[6]=n,t[7]=c,t[8]=l,t[9]=u):u=t[9],u}function cC(e){let t=(0,$.c)(96),{folderPath:n}=e,{_:r}=$t(),{folderPaths:i,loading:a,pages:o,pageTitles:s,pageMeta:c}=Yi(),l=fo(n),{state:u,refresh:d}=l,[f,p]=(0,Q.useState)(!1),[m,h]=(0,Q.useState)(`name`),[g,_]=(0,Q.useState)(`asc`);if(a){let e;t[0]===r?e=t[1]:(e=r({id:`X9VpsP`}),t[0]=r,t[1]=e);let n;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-3`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,Z.jsx)(Ba,{className:`size-5 rounded`}),(0,Z.jsx)(Ba,{className:`h-7 w-48`})]}),(0,Z.jsx)(Ba,{className:`h-9 w-20 rounded-md`})]}),t[2]=n):n=t[2];let i;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsx)(Ba,{className:`h-4 w-16`}),t[3]=i):i=t[3];let a;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Z.jsxs)(`div`,{className:`mx-auto flex w-full max-w-4xl flex-col gap-6 px-6 py-8`,children:[n,(0,Z.jsxs)(`div`,{className:`rounded-lg border`,children:[(0,Z.jsxs)(`div`,{className:`flex items-center gap-4 border-b px-4 py-3`,children:[i,(0,Z.jsx)(`div`,{className:`ml-auto`,children:(0,Z.jsx)(Ba,{className:`h-4 w-20`})})]}),[`a`,`b`,`c`,`d`].map(dC)]})]}),t[4]=a):a=t[4];let o;return t[5]===e?o=t[6]:(o=(0,Z.jsx)(`div`,{className:`flex min-h-0 flex-1 items-start overflow-y-auto subtle-scrollbar`,role:`status`,"aria-busy":`true`,"aria-label":e,children:a}),t[5]=e,t[6]=o),o}let v,y,b,x,S,C,w,T,E,D,O;if(t[7]!==r||t[8]!==u||t[9]!==l||t[10]!==n||t[11]!==i||t[12]!==c||t[13]!==s||t[14]!==o||t[15]!==d||t[16]!==g||t[17]!==m){let e=XS(n,{pages:o,pageTitles:s,pageMeta:c,folderPaths:i}),a=oC(e.children,m,g),f=e.title||(n===``?r({id:`3aeN7X`}):e.title),k;t[29]===m?k=t[30]:(k=function(e){e===m?_(uC):(h(e),_(`asc`))},t[29]=m,t[30]=k);let A=k;O=`flex min-h-0 flex-1 items-start overflow-y-auto subtle-scrollbar`,C=`mx-auto flex w-full max-w-4xl flex-col gap-6 px-6 py-8`;let j;t[31]===Symbol.for(`react.memo_cache_sentinel`)?(j=(0,Z.jsx)(Fo,{className:`size-5 text-muted-foreground`}),t[31]=j):j=t[31];let M=(0,Z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[j,(0,Z.jsx)(`h1`,{className:`text-2xl font-light tracking-tight`,children:f})]}),N;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,Z.jsxs)(X,{onClick:()=>p(!0),children:[(0,Z.jsx)(Zt,{className:`size-4`}),(0,Z.jsx)(J,{id:`isRobC`})]}),t[32]=N):N=t[32],t[33]===M?w=t[34]:(w=(0,Z.jsx)(`div`,{className:`flex flex-col gap-6`,children:(0,Z.jsxs)(`div`,{className:`flex flex-wrap items-start justify-between gap-3`,children:[M,N]})}),t[33]=M,t[34]=w),t[35]!==u||t[36]!==n||t[37]!==d?(T=(0,Z.jsx)(RS,{folderPath:n,state:u,onChange:d}),t[35]=u,t[36]=n,t[37]=d,t[38]=T):T=t[38],t[39]!==u||t[40]!==l||t[41]!==n||t[42]!==d?(E=(0,Z.jsx)(ZS,{folderPath:n,state:u,onChange:d,folderConfigHandle:l}),t[39]=u,t[40]=l,t[41]=n,t[42]=d,t[43]=E):E=t[43],t[44]===n?D=t[45]:(D=(0,Z.jsx)(GS,{folderPath:n}),t[44]=n,t[45]=D),S=`rounded-lg border`,y=$S;let P=m===`name`?g===`asc`?`ascending`:`descending`:`none`,F;t[46]===r?F=t[47]:(F=r({id:`6YtxFj`}),t[46]=r,t[47]=F);let I;t[48]!==A||t[49]!==g||t[50]!==m||t[51]!==F?(I=(0,Z.jsx)(sC,{label:F,sortKey:`name`,activeKey:m,activeDir:g,onSort:A}),t[48]=A,t[49]=g,t[50]=m,t[51]=F,t[52]=I):I=t[52];let L;t[53]!==P||t[54]!==I?(L=(0,Z.jsx)(rC,{"aria-sort":P,children:I}),t[53]=P,t[54]=I,t[55]=L):L=t[55];let R=m===`modified`?g===`asc`?`ascending`:`descending`:`none`,z;t[56]===r?z=t[57]:(z=r({id:`tgWuMB`}),t[56]=r,t[57]=z);let B;t[58]!==A||t[59]!==g||t[60]!==m||t[61]!==z?(B=(0,Z.jsx)(sC,{label:z,sortKey:`modified`,activeKey:m,activeDir:g,onSort:A}),t[58]=A,t[59]=g,t[60]=m,t[61]=z,t[62]=B):B=t[62];let V;t[63]!==R||t[64]!==B?(V=(0,Z.jsx)(rC,{className:`w-32`,"aria-sort":R,children:B}),t[63]=R,t[64]=B,t[65]=V):V=t[65],t[66]!==L||t[67]!==V?(x=(0,Z.jsx)(eC,{children:(0,Z.jsxs)(nC,{children:[L,V]})}),t[66]=L,t[67]=V,t[68]=x):x=t[68],v=tC,b=a.length?a.map(lC):(0,Z.jsx)(nC,{children:(0,Z.jsx)(iC,{colSpan:2,className:`h-24 text-center text-muted-foreground`,children:(0,Z.jsx)(J,{id:`Pkw7J9`})})}),t[7]=r,t[8]=u,t[9]=l,t[10]=n,t[11]=i,t[12]=c,t[13]=s,t[14]=o,t[15]=d,t[16]=g,t[17]=m,t[18]=v,t[19]=y,t[20]=b,t[21]=x,t[22]=S,t[23]=C,t[24]=w,t[25]=T,t[26]=E,t[27]=D,t[28]=O}else v=t[18],y=t[19],b=t[20],x=t[21],S=t[22],C=t[23],w=t[24],T=t[25],E=t[26],D=t[27],O=t[28];let k;t[69]!==v||t[70]!==b?(k=(0,Z.jsx)(v,{children:b}),t[69]=v,t[70]=b,t[71]=k):k=t[71];let A;t[72]!==y||t[73]!==k||t[74]!==x?(A=(0,Z.jsxs)(y,{children:[x,k]}),t[72]=y,t[73]=k,t[74]=x,t[75]=A):A=t[75];let j;t[76]!==A||t[77]!==S?(j=(0,Z.jsx)(`div`,{className:S,children:A}),t[76]=A,t[77]=S,t[78]=j):j=t[78];let M;t[79]!==j||t[80]!==C||t[81]!==w||t[82]!==T||t[83]!==E||t[84]!==D?(M=(0,Z.jsxs)(`div`,{className:C,children:[w,T,E,D,j]}),t[79]=j,t[80]=C,t[81]=w,t[82]=T,t[83]=E,t[84]=D,t[85]=M):M=t[85];let N;t[86]!==M||t[87]!==O?(N=(0,Z.jsx)(`div`,{className:O,children:M}),t[86]=M,t[87]=O,t[88]=N):N=t[88];let P;t[89]!==f||t[90]!==l||t[91]!==n?(P=(0,Z.jsx)(dh,{open:f,onOpenChange:p,kind:`file`,initialDir:n,folderConfig:l,suggestedName:`index`}),t[89]=f,t[90]=l,t[91]=n,t[92]=P):P=t[92];let F;return t[93]!==N||t[94]!==P?(F=(0,Z.jsxs)(Z.Fragment,{children:[N,P]}),t[93]=N,t[94]=P,t[95]=F):F=t[95],F}function lC(e){return(0,Z.jsxs)(nC,{children:[(0,Z.jsx)(iC,{children:(0,Z.jsxs)(`a`,{href:fl(e.path),className:`flex items-center gap-2 rounded-sm focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,children:[e.kind===`folder`?(0,Z.jsx)(Rd,{className:`size-4 shrink-0 text-muted-foreground`}):(0,Z.jsx)(Ce,{className:`size-4 shrink-0 text-muted-foreground`}),(0,Z.jsx)(`span`,{className:`truncate`,children:e.title})]})}),(0,Z.jsx)(iC,{className:`text-muted-foreground`,children:e.kind===`file`?aC(e.modified):`—`})]},e.path)}function uC(e){return e===`asc`?`desc`:`asc`}function dC(e){return(0,Z.jsxs)(`div`,{className:`flex items-center gap-3 border-b px-4 py-3 last:border-b-0`,children:[(0,Z.jsx)(Ba,{className:`size-4 rounded`}),(0,Z.jsx)(Ba,{className:`h-4 w-40`}),(0,Z.jsx)(`div`,{className:`ml-auto`,children:(0,Z.jsx)(Ba,{className:`h-4 w-16`})})]},e)}function fC(e){let t=(0,$.c)(24),{docName:n,size:r,limit:i,backNav:a}=e,o=a!==void 0,s=(0,Q.useRef)(null),c=(0,Q.useRef)(null),l,u;t[0]===o?(l=t[1],u=t[2]):(l=()=>{o?s.current?.focus():c.current?.focus()},u=[o],t[0]=o,t[1]=l,t[2]=u),(0,Q.useEffect)(l,u);let d;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Z.jsx)(`div`,{className:`flex size-16 items-center justify-center rounded-full border bg-muted/40 text-muted-foreground`,children:(0,Z.jsx)(Nd,{className:`size-9`,"aria-hidden":`true`})}),t[3]=d):d=t[3];let f=o?void 0:-1,p;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Z.jsx)(J,{id:`P3hnm0`}),t[4]=p):p=t[4];let m;t[5]===f?m=t[6]:(m=(0,Z.jsx)(`h2`,{ref:c,id:`large-file-title`,tabIndex:f,className:`text-2xl font-light text-balance outline-none`,children:p}),t[5]=f,t[6]=m);let h;t[7]===r?h=t[8]:(h=br(r),t[7]=r,t[8]=h);let g;t[9]===i?g=t[10]:(g=br(i),t[9]=i,t[10]=g);let _;t[11]!==n||t[12]!==h||t[13]!==g?(_=(0,Z.jsx)(`p`,{className:`max-w-md text-sm text-muted-foreground`,children:(0,Z.jsx)(J,{id:`GJH-AT`,values:{0:h,1:g,docName:n}})}),t[11]=n,t[12]=h,t[13]=g,t[14]=_):_=t[14];let v;t[15]!==m||t[16]!==_?(v=(0,Z.jsxs)(`div`,{className:`flex flex-col items-center gap-1`,children:[m,_]}),t[15]=m,t[16]=_,t[17]=v):v=t[17];let y;t[18]!==a||t[19]!==o?(y=o?(0,Z.jsxs)(X,{ref:s,variant:`default`,onClick:()=>a.onNavigateBack(a.previousDocName),children:[(0,Z.jsx)(Rt,{className:`size-4`,"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`CKyk7Q`})]}):null,t[18]=a,t[19]=o,t[20]=y):y=t[20];let b;return t[21]!==v||t[22]!==y?(b=(0,Z.jsxs)(`div`,{role:`status`,"aria-labelledby":`large-file-title`,"data-slot":`large-file-editor-state`,className:`flex h-full flex-col items-center justify-center gap-8 p-8 text-center`,children:[d,v,y]}),t[21]=v,t[22]=y,t[23]=b):b=t[23],b}function pC(e){let t=(0,$.c)(8),{docName:n}=e,[r,i]=(0,Q.useState)(mC),a,o;if(t[0]===Symbol.for(`react.memo_cache_sentinel`)?(a=()=>ae(e=>{i(t=>{if(t.has(e))return t;let n=new Set(t);return n.add(e),n})}),o=[],t[0]=a,t[1]=o):(a=t[0],o=t[1]),(0,Q.useEffect)(a,o),!r.has(n))return null;let s;t[2]===n?s=t[3]:(s=function(){S(n)?.abort(),i(e=>{if(!e.has(n))return e;let t=new Set(e);return t.delete(n),t})},t[2]=n,t[3]=s);let c=s,l;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Z.jsx)(`span`,{children:(0,Z.jsx)(J,{id:`A67Uwj`})}),t[4]=l):l=t[4];let u;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(u=(0,Z.jsx)(J,{id:`dEgA5A`}),t[5]=u):u=t[5];let d;return t[6]===c?d=t[7]:(d=(0,Z.jsxs)(`div`,{className:`absolute inset-x-0 bottom-8 z-20 flex justify-center text-xs text-muted-foreground`,children:[l,(0,Z.jsx)(X,{variant:`link`,size:`sm`,className:`h-auto px-2 py-0 text-xs`,onClick:c,children:u})]}),t[6]=c,t[7]=d),d}function mC(){return new Set}function hC(e){let t=(0,$.c)(20),{nav:n}=e,{state:r,refetch:i}=yi(n),a=(0,Q.useRef)(null),o=n.branch,s,c;t[0]===r.phase?(s=t[1],c=t[2]):(s=()=>{r.phase===`resolved`&&a.current?.querySelector(`button`)?.focus()},c=[r.phase],t[0]=r.phase,t[1]=s,t[2]=c),(0,Q.useEffect)(s,c);let l;t[3]===n.path?l=t[4]:(l=function(){window.location.hash=el(xi(n.path))},t[3]=n.path,t[4]=l);let u=l,d;t[5]!==o||t[6]!==n.kind?(d=function(e){Si.arm({kind:n.kind,path:e,branch:o}),window.location.hash=n.kind===`folder`?el(e):fl(e)},t[5]=o,t[6]=n.kind,t[7]=d):d=t[7];let f=d,p=r.phase===`pending`?`polite`:void 0,m=r.phase===`resolved`?r.resolution.verdict:void 0,h=r.phase===`pending`?`flex h-full flex-col items-center justify-center gap-3 p-8 text-center text-sm text-muted-foreground`:`flex h-full flex-col items-center justify-center gap-6 p-8 text-center`,g;t[8]!==u||t[9]!==n||t[10]!==f||t[11]!==i||t[12]!==r?(g=(0,Z.jsx)(wi,{nav:n,state:r,onBrowseFolder:u,onOpenRenamed:f,onEnableAutoSync:u,onSyncCompleted:i}),t[8]=u,t[9]=n,t[10]=f,t[11]=i,t[12]=r,t[13]=g):g=t[13];let _;return t[14]!==r.phase||t[15]!==p||t[16]!==m||t[17]!==h||t[18]!==g?(_=(0,Z.jsx)(`div`,{ref:a,role:`status`,"aria-live":p,"data-testid":`share-receive-miss-panel`,"data-phase":r.phase,"data-verdict":m,className:h,children:g}),t[14]=r.phase,t[15]=p,t[16]=m,t[17]=h,t[18]=g,t[19]=_):_=t[19],_}function gC(e){let t=(0,$.c)(24),{fileName:n,text:r}=e,i,a,o,s;if(t[0]!==r){let e=mi(r).body;s=V,i=St,a=!1,o=xt().parseWithFallback(e),t[0]=r,t[1]=i,t[2]=a,t[3]=o,t[4]=s}else i=t[1],a=t[2],o=t[3],s=t[4];let c;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(c={attributes:{class:`pt-4 pb-4`}},t[5]=c):c=t[5];let l;t[6]!==i||t[7]!==a||t[8]!==o?(l={extensions:i,editable:a,content:o,editorProps:c},t[6]=i,t[7]=a,t[8]=o,t[9]=l):l=t[9];let u;t[10]===r?u=t[11]:(u=[r],t[10]=r,t[11]=u);let d=s(l,u),[f]=(0,Q.useState)(_C),p=(0,Q.useRef)(null),m,h;t[12]===f?(m=t[13],h=t[14]):(m=()=>{let e=p.current;if(e)return e.appendChild(f),()=>{f.parentNode===e&&e.removeChild(f)}},h=[f],t[12]=f,t[13]=m,t[14]=h),(0,Q.useLayoutEffect)(m,h);let g;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(g=(0,Z.jsx)(`div`,{className:`editor-doc-scroll min-h-0 flex-1 overflow-auto`,children:(0,Z.jsx)(`div`,{className:`tiptap-editor`,children:(0,Z.jsx)(`div`,{ref:p,style:{display:`contents`}})})}),t[15]=g):g=t[15];let _;t[16]===d?_=t[17]:(_=(0,Z.jsx)(ot,{editor:d,className:`tiptap-editor-portal-content h-full`}),t[16]=d,t[17]=_);let v;t[18]!==f||t[19]!==_?(v=(0,gd.createPortal)(_,f),t[18]=f,t[19]=_,t[20]=v):v=t[20];let y;return t[21]!==n||t[22]!==v?(y=(0,Z.jsxs)(`main`,{className:`flex h-full min-h-0 flex-col bg-background`,"aria-label":n,"data-skill-markdown-viewer":``,"data-skill-markdown-viewer-state":`loaded`,children:[g,v]}),t[21]=n,t[22]=v,t[23]=y):y=t[23],y}function _C(){let e=document.createElement(`div`);return e.style.display=`contents`,e}var vC=`data-skill-markdown`;function yC(e){let t=(0,$.c)(12),{scope:n,name:r,path:i,fileName:a}=e,o;t[0]!==r||t[1]!==i||t[2]!==n?(o={loadText:e=>wc({scope:n,name:r,path:i},e)},t[0]=r,t[1]=i,t[2]=n,t[3]=o):o=t[3];let s=Hb(o);if(s.status===`loading`){let e;return t[4]===a?e=t[5]:(e=(0,Z.jsx)(Ub,{fileName:a,dataAttr:vC}),t[4]=a,t[5]=e),e}if(s.status===`error`){let e;return t[6]!==s.message||t[7]!==a?(e=(0,Z.jsx)(Wb,{fileName:a,dataAttr:vC,message:s.message}),t[6]=s.message,t[7]=a,t[8]=e):e=t[8],e}let c;return t[9]!==s.content||t[10]!==a?(c=(0,Z.jsx)(gC,{fileName:a,text:s.content}),t[9]=s.content,t[10]=a,t[11]=c):c=t[11],c}var bC=new Set([`md`,`mdx`]);function xC(e){let t=(0,$.c)(19),{scope:n,name:r,path:i}=e,a;t[0]===i?a=t[1]:(a=i.split(`/`).pop()??i,t[0]=i,t[1]=a);let o=a,s=o.lastIndexOf(`.`),c,l;if(t[2]!==s||t[3]!==o?(c=s>=0?o.slice(s+1).toLowerCase():``,l=bC.has(c),t[2]=s,t[3]=o,t[4]=c,t[5]=l):(c=t[4],l=t[5]),l){let e;return t[6]!==o||t[7]!==r||t[8]!==i||t[9]!==n?(e=(0,Z.jsx)(yC,{scope:n,name:r,path:i,fileName:o}),t[6]=o,t[7]=r,t[8]=i,t[9]=n,t[10]=e):e=t[10],e}let u;t[11]!==r||t[12]!==i||t[13]!==n?(u=e=>wc({scope:n,name:r,path:i},e),t[11]=r,t[12]=i,t[13]=n,t[14]=u):u=t[14];let d;return t[15]!==c||t[16]!==o||t[17]!==u?(d=(0,Z.jsx)(qb,{fileName:o,extension:c,loadText:u}),t[15]=c,t[16]=o,t[17]=u,t[18]=d):d=t[18],d}function SC(e){let t=null,n=()=>(t===null&&(t=e(),t.catch(()=>{})),t),r=(0,Q.lazy)(n);return r.preload=n,r}var CC=SC(()=>n(()=>import(`./SettingsDialogBody-BVNxduDH.js`).then(e=>({default:e.SettingsDialogBody})),__vite__mapDeps([71,1,40,2,41,42,11,43,44,45,46,47,48,49,50,15,16,13,7,17,18,10,3,51,52,36,12,6,4,53,54,55,20,56,57,58,59,31,32,33,34,60,61,62,63,35,64,65,66,72,73,74,19,75,76,77,78,30,79,80,68,81,38,82,14]),import.meta.url));function wC(e){let t=(0,$.c)(9),{error:n}=e,{_:r}=$t(),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:`3h5zMp`}),t[0]=r,t[1]=n,t[2]=i):i=t[2];let a=i,o;t[3]===Symbol.for(`react.memo_cache_sentinel`)?(o=(0,Z.jsx)(`h3`,{id:`settings-body-error-title`,className:`font-heading text-base leading-none font-medium`,children:(0,Z.jsx)(J,{id:`hwFOFD`})}),t[3]=o):o=t[3];let s;t[4]===a?s=t[5]:(s=(0,Z.jsxs)(`div`,{className:`flex flex-col items-center gap-1`,children:[o,(0,Z.jsx)(`p`,{className:`max-w-xs text-sm text-muted-foreground`,children:a})]}),t[4]=a,t[5]=s);let c;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Z.jsx)(X,{variant:`default`,onClick:TC,children:(0,Z.jsx)(J,{id:`HpK_8d`})}),t[6]=c):c=t[6];let l;return t[7]===s?l=t[8]:(l=(0,Z.jsxs)(`div`,{role:`alert`,"aria-labelledby":`settings-body-error-title`,"data-slot":`settings-body-error-boundary`,className:`flex h-full flex-col items-center justify-center gap-5 p-8 text-center`,children:[s,c]}),t[7]=s,t[8]=l),l}function TC(){return window.location.reload()}function EC(e){let t=(0,$.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,Z.jsx)(g,{fallbackRender:OC,onError:DC,children:n}),t[0]=n,t[1]=r),r}function DC(e,t){console.error(`[SettingsDialogErrorBoundary] rendered fallback for Settings body`,e,t.componentStack)}function OC(e){return(0,Z.jsx)(wC,{...e})}function kC(e){return`https://github.com/inkeep/open-knowledge/releases/tag/v${encodeURIComponent(e)}`}function AC(e){let t=(0,$.c)(99),{open:n,onOpenChange:r}=e,{_:i}=$t(),{collabUrl:a}=mt(),{userBinding:o,userSynced:s,okignoreBinding:c,okignoreSynced:l}=Po(),{desktopPresent:u}=bo(),[d,f]=(0,Q.useState)(`preferences`),p,m;t[0]===n?(p=t[1],m=t[2]):(p=()=>{n&&f(`preferences`)},m=[n],t[0]=n,t[1]=p,t[2]=m),(0,Q.useEffect)(p,m);let h=a!==null,g=typeof window<`u`&&window.okDesktop!=null,_;t[3]===i?_=t[4]:(_=i({id:`7PzzBU`}),t[3]=i,t[4]=_);let v;t[5]===i?v=t[6]:(v=i({id:`Q6hhn8`}),t[5]=i,t[6]=v);let y;t[7]===v?y=t[8]:(y={id:`preferences`,label:v},t[7]=v,t[8]=y);let b;t[9]===i?b=t[10]:(b=i({id:`4KmEoC`}),t[9]=i,t[10]=b);let x;t[11]===b?x=t[12]:(x={id:`hotkeys`,label:b},t[11]=b,t[12]=x);let S;t[13]===i?S=t[14]:(S=i({id:`AeXO77`}),t[13]=i,t[14]=S);let C;t[15]===S?C=t[16]:(C={id:`account`,label:S},t[15]=S,t[16]=C);let w;t[17]!==y||t[18]!==x||t[19]!==C?(w=[y,x,C],t[17]=y,t[18]=x,t[19]=C,t[20]=w):w=t[20];let T;t[21]!==w||t[22]!==_?(T={id:`user`,label:_,enabled:!0,items:w},t[21]=w,t[22]=_,t[23]=T):T=t[23];let E;t[24]===i?E=t[25]:(E=i({id:`ZWyHmq`}),t[24]=i,t[25]=E);let D;t[26]===i?D=t[27]:(D=i({id:`Nu4DdT`}),t[26]=i,t[27]=D);let O;t[28]===D?O=t[29]:(O={id:`sync`,label:D},t[28]=D,t[29]=O);let k;t[30]===i?k=t[31]:(k=i({id:`A1taO8`}),t[30]=i,t[31]=k);let A;t[32]===k?A=t[33]:(A={id:`search`,label:k},t[32]=k,t[33]=A);let j;t[34]===i?j=t[35]:(j=g?[{id:`terminal`,label:i({id:`ALhMYW`})}]:[],t[34]=i,t[35]=j);let M;t[36]===i?M=t[37]:(M=i({id:`iTylMl`}),t[36]=i,t[37]=M);let N;t[38]===M?N=t[39]:(N={id:`project-templates`,label:M},t[38]=M,t[39]=N);let P;t[40]===i?P=t[41]:(P=i({id:`PCSkw2`}),t[40]=i,t[41]=P);let F;t[42]===P?F=t[43]:(F={id:`skills`,label:P},t[42]=P,t[43]=F);let I;t[44]===i?I=t[45]:(I=i({id:`3zyg_A`}),t[44]=i,t[45]=I);let L;t[46]===I?L=t[47]:(L={id:`okignore`,label:I},t[46]=I,t[47]=L);let R;t[48]===i?R=t[49]:(R=i({id:`cs4mps`}),t[48]=i,t[49]=R);let z;t[50]===R?z=t[51]:(z={id:`sharing`,label:R},t[50]=R,t[51]=z);let B;t[52]!==O||t[53]!==A||t[54]!==j||t[55]!==N||t[56]!==F||t[57]!==L||t[58]!==z?(B=[O,A,...j,N,F,L,z],t[52]=O,t[53]=A,t[54]=j,t[55]=N,t[56]=F,t[57]=L,t[58]=z,t[59]=B):B=t[59];let V;t[60]!==h||t[61]!==E||t[62]!==B?(V={id:`project`,label:E,enabled:h,items:B},t[60]=h,t[61]=E,t[62]=B,t[63]=V):V=t[63];let H;t[64]===i?H=t[65]:(H=i({id:`nbfdhU`}),t[64]=i,t[65]=H);let U;t[66]!==i||t[67]!==u?(U=[],t[66]=i,t[67]=u,t[68]=U):U=t[68];let W;t[69]!==H||t[70]!==U?(W={id:`integrations`,label:H,enabled:!0,items:U},t[69]=H,t[70]=U,t[71]=W):W=t[71];let G;t[72]!==T||t[73]!==V||t[74]!==W?(G=[T,V,W],t[72]=T,t[73]=V,t[74]=W,t[75]=G):G=t[75];let K=G,ee;t[76]===Symbol.for(`react.memo_cache_sentinel`)?(ee=(0,Z.jsx)(Ws,{className:`sr-only`,children:(0,Z.jsx)(J,{id:`Tz0i8g`})}),t[76]=ee):ee=t[76];let te;t[77]===Symbol.for(`react.memo_cache_sentinel`)?(te=(0,Z.jsx)(Us,{className:`sr-only`,children:(0,Z.jsx)(J,{id:`RDrXh4`})}),t[77]=te):te=t[77];let ne;t[78]!==d||t[79]!==K?(ne=(0,Z.jsx)(jC,{groups:K,activeId:d,onSelect:f}),t[78]=d,t[79]=K,t[80]=ne):ne=t[80];let re;t[81]===i?re=t[82]:(re=i({id:`OXb_Df`}),t[81]=i,t[82]=re);let ie;t[83]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(0,Z.jsx)(PC,{}),t[83]=ie):ie=t[83];let ae=s?o:null,oe;t[84]!==d||t[85]!==c||t[86]!==l||t[87]!==ae?(oe=(0,Z.jsx)(EC,{children:(0,Z.jsx)(Q.Suspense,{fallback:ie,children:(0,Z.jsx)(CC,{activeId:d,userBinding:ae,okignoreBinding:c,okignoreSynced:l})})}),t[84]=d,t[85]=c,t[86]=l,t[87]=ae,t[88]=oe):oe=t[88];let se;t[89]!==re||t[90]!==oe?(se=(0,Z.jsx)(`section`,{"aria-label":re,className:`min-h-0 flex-1 overflow-y-auto overscroll-contain subtle-scrollbar p-6`,tabIndex:0,children:oe}),t[89]=re,t[90]=oe,t[91]=se):se=t[91];let ce;t[92]!==ne||t[93]!==se?(ce=(0,Z.jsxs)(Gs,{className:`flex h-[700px] max-h-[calc(100dvh-4rem)] w-[900px] max-w-[calc(100%-2rem)] flex-col gap-0 overflow-hidden p-0 sm:grid sm:grid-cols-[220px_1fr] sm:max-w-[min(900px,calc(100%-2rem))]`,"data-testid":`settings-dialog`,children:[ee,te,ne,se]}),t[92]=ne,t[93]=se,t[94]=ce):ce=t[94];let le;return t[95]!==r||t[96]!==n||t[97]!==ce?(le=(0,Z.jsx)(Ys,{open:n,onOpenChange:r,children:ce}),t[95]=r,t[96]=n,t[97]=ce,t[98]=le):le=t[98],le}function jC(e){let t=(0,$.c)(13),{groups:n,activeId:r,onSelect:i}=e,{_:a}=$t(),o;t[0]===a?o=t[1]:(o=a({id:`y1t8bQ`}),t[0]=a,t[1]=o);let s;if(t[2]!==r||t[3]!==n||t[4]!==i){let e;t[6]!==r||t[7]!==i?(e=e=>(0,Z.jsx)(NC,{group:e,activeId:r,onSelect:i},e.id),t[6]=r,t[7]=i,t[8]=e):e=t[8],s=n.map(e),t[2]=r,t[3]=n,t[4]=i,t[5]=s}else s=t[5];let c;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Z.jsx)(MC,{}),t[9]=c):c=t[9];let l;return t[10]!==o||t[11]!==s?(l=(0,Z.jsxs)(`nav`,{"aria-label":o,className:`flex shrink-0 gap-x-3 overflow-x-auto overscroll-contain subtle-scrollbar scroll-fade-mask-x-max-sm border-b bg-muted/30 px-3 py-2 max-sm:pt-10 sm:h-full sm:flex-col sm:gap-0 sm:overflow-x-visible sm:overflow-y-auto sm:border-r sm:border-b-0 sm:py-4`,children:[s,c]}),t[10]=o,t[11]=s,t[12]=l):l=t[12],l}function MC(){let e=(0,$.c)(4),t=typeof window<`u`?window.okDesktop??null:null,n=t?.appVersion;if(!t||!n)return null;let r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=kC(n),e[0]=r):r=e[0];let i=r,a;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(a=(0,Z.jsxs)(`p`,{className:`whitespace-nowrap font-mono text-xs text-muted-foreground/70`,"data-testid":`settings-sidebar-version`,children:[`v`,n]}),e[1]=a):a=e[1];let o;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(o=()=>{t.shell.openExternal(i)},e[2]=o):o=e[2];let s;return e[3]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Z.jsxs)(`div`,{className:`ml-auto shrink-0 px-2 sm:ml-0 sm:mt-auto sm:pt-3`,children:[a,(0,Z.jsxs)(`button`,{type:`button`,onClick:o,"data-testid":`settings-sidebar-release-notes`,className:Y(`mt-0.5 inline-flex items-center gap-1 whitespace-nowrap rounded text-xs text-muted-foreground transition-colors hover:text-foreground`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`),children:[(0,Z.jsx)(J,{id:`_PACVa`}),(0,Z.jsx)(Mi,{className:`size-3`,"aria-hidden":`true`})]})]}),e[3]=s):s=e[3],s}function NC(e){let t=(0,$.c)(28),{group:n,activeId:r,onSelect:i}=e;if(n.items.length===0)return null;let a=`settings-group-${n.id}`,o=`${a}-caption`,s=n.enabled?void 0:o,c=n.enabled?`text-muted-foreground/80`:`text-muted-foreground/50`,l;t[0]===c?l=t[1]:(l=Y(`shrink-0 whitespace-nowrap px-2 text-xs font-semibold uppercase tracking-wide font-mono sm:mb-1`,c),t[0]=c,t[1]=l);let u;t[2]!==n.label||t[3]!==a||t[4]!==s||t[5]!==l?(u=(0,Z.jsx)(`h3`,{id:a,"aria-describedby":s,className:l,children:n.label}),t[2]=n.label,t[3]=a,t[4]=s,t[5]=l,t[6]=u):u=t[6];let d;t[7]!==o||t[8]!==n.enabled?(d=n.enabled?null:(0,Z.jsx)(`p`,{id:o,className:`px-2 text-xs italic text-muted-foreground/60 sm:mb-1`,children:(0,Z.jsx)(J,{id:`JWsZlx`})}),t[7]=o,t[8]=n.enabled,t[9]=d):d=t[9];let f;if(t[10]!==r||t[11]!==o||t[12]!==n.enabled||t[13]!==n.items||t[14]!==i){let e;t[16]!==r||t[17]!==o||t[18]!==n.enabled||t[19]!==i?(e=e=>(0,Z.jsx)(`li`,{children:(0,Z.jsx)(`button`,{type:`button`,"aria-current":r===e.id?`page`:void 0,"aria-disabled":n.enabled?void 0:!0,"aria-describedby":n.enabled?void 0:o,tabIndex:n.enabled?0:-1,disabled:!n.enabled,onClick:()=>n.enabled&&i(e.id),"data-testid":`settings-sidebar-item-${e.id}`,className:Y(`w-auto whitespace-nowrap rounded px-2 py-1.5 text-left text-sm transition-colors sm:w-full`,`focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring`,`disabled:cursor-not-allowed disabled:opacity-50`,r===e.id&&n.enabled?`bg-accent text-accent-foreground`:`hover:bg-accent/50`),children:e.label})},e.id),t[16]=r,t[17]=o,t[18]=n.enabled,t[19]=i,t[20]=e):e=t[20],f=n.items.map(e),t[10]=r,t[11]=o,t[12]=n.enabled,t[13]=n.items,t[14]=i,t[15]=f}else f=t[15];let p;t[21]!==a||t[22]!==f?(p=(0,Z.jsx)(`ul`,{"aria-labelledby":a,className:`flex gap-1 sm:block sm:space-y-0.5`,children:f}),t[21]=a,t[22]=f,t[23]=p):p=t[23];let m;return t[24]!==u||t[25]!==d||t[26]!==p?(m=(0,Z.jsxs)(`div`,{className:`flex shrink-0 items-center gap-2 sm:mb-4 sm:block`,children:[u,d,p]}),t[24]=u,t[25]=d,t[26]=p,t[27]=m):m=t[27],m}function PC(){let e=(0,$.c)(4),t,n,r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Z.jsx)(`span`,{className:`sr-only`,children:(0,Z.jsx)(J,{id:`GsBUCk`})}),n=(0,Z.jsx)(Ba,{className:`h-5 w-32`}),r=(0,Z.jsx)(Ba,{className:`h-4 w-64`}),e[0]=t,e[1]=n,e[2]=r):(t=e[0],n=e[1],r=e[2]);let i;return e[3]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsxs)(`div`,{role:`status`,"aria-live":`polite`,"aria-busy":`true`,className:`space-y-3`,"data-testid":`settings-content-skeleton`,children:[t,n,r,(0,Z.jsxs)(`div`,{className:`space-y-2`,children:[(0,Z.jsx)(Ba,{className:`h-9 w-full`}),(0,Z.jsx)(Ba,{className:`h-9 w-full`})]})]}),e[3]=i):i=e[3],i}function FC(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 h-full w-full aria-[orientation=vertical]:flex-col`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(kb,{"data-slot":`resizable-panel-group`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function IC(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)(Nb,{"data-slot":`resizable-panel`,...n}),t[2]=n,t[3]=r),r}function LC(e){let t=(0,$.c)(12),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({withHandle:i,className:n,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a;t[4]===n?a=t[5]:(a=Y(`relative flex w-px items-center justify-center bg-border ring-offset-background after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-ring focus-visible:outline-hidden aria-[orientation=horizontal]:h-px aria-[orientation=horizontal]:w-full aria-[orientation=horizontal]:after:left-0 aria-[orientation=horizontal]:after:h-1 aria-[orientation=horizontal]:after:w-full aria-[orientation=horizontal]:after:translate-x-0 aria-[orientation=horizontal]:after:-translate-y-1/2 [&[aria-orientation=horizontal]>div]:rotate-90`,n),t[4]=n,t[5]=a);let o;t[6]===i?o=t[7]:(o=i&&(0,Z.jsx)(`div`,{className:`z-10 flex h-6 w-1 shrink-0 rounded-lg bg-border`}),t[6]=i,t[7]=o);let s;return t[8]!==r||t[9]!==a||t[10]!==o?(s=(0,Z.jsx)(Lb,{"data-slot":`resizable-handle`,className:a,...r,children:o}),t[8]=r,t[9]=a,t[10]=o,t[11]=s):s=t[11],s}function RC(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/input-group relative flex h-8 w-full min-w-0 items-center rounded-lg border border-input transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:bg-input/50 has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-disabled:bg-input/80 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`div`,{"data-slot":`input-group`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var zC=_i(`flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4`,{variants:{align:{"inline-start":`order-first pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem]`,"inline-end":`order-last pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem]`,"block-start":`order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2`,"block-end":`order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2`}},defaultVariants:{align:`inline-start`}});function BC(e){let t=(0,$.c)(11),n,r,i;t[0]===e?(n=t[1],r=t[2],i=t[3]):({className:n,align:i,...r}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i);let a=i===void 0?`inline-start`:i,o;t[4]!==a||t[5]!==n?(o=Y(zC({align:a}),n),t[4]=a,t[5]=n,t[6]=o):o=t[6];let s;return t[7]!==a||t[8]!==r||t[9]!==o?(s=(0,Z.jsx)(`div`,{"data-slot":`input-group-addon`,"data-align":a,className:o,onMouseDown:VC,...r}),t[7]=a,t[8]=r,t[9]=o,t[10]=s):s=t[10],s}function VC(e){e.target.closest(`button`)||(e.preventDefault(),e.currentTarget.parentElement?.querySelector(`input`)?.focus())}_i(`flex items-center gap-2 text-sm shadow-none`,{variants:{size:{xs:`h-6 gap-1 rounded-[calc(var(--radius)-3px)] px-1.5 [&>svg:not([class*='size-'])]:size-3.5`,sm:``,"icon-xs":`size-6 rounded-[calc(var(--radius)-3px)] p-0 has-[>svg]:p-0`,"icon-sm":`size-8 p-0 has-[>svg]:p-0`}},defaultVariants:{size:`xs`}});function HC(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 items-center gap-2 text-sm text-muted-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(`span`,{className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function UC(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 rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent`,n),t[3]=n,t[4]=i);let a;return t[5]!==r||t[6]!==i?(a=(0,Z.jsx)(Hc,{"data-slot":`input-group-control`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function WC(e){let t=(0,$.c)(119),{findInputRef:n,query:r,replacement:i,replaceOpen:a,caseSensitive:o,wholeWord:s,current:c,total:l,onQueryChange:u,onReplacementChange:d,onReplaceOpenChange:f,onCaseSensitiveChange:p,onWholeWordChange:m,onNext:h,onPrevious:g,onReplaceCurrent:_,onReplaceAll:v,onClose:y}=e,{_:b}=$t(),x=r.length>0,S=l>0,C;t[0]!==b||t[1]!==c||t[2]!==S||t[3]!==x||t[4]!==l?(C=x?S?`${c} / ${l}`:b({id:`Ev2r9A`}):``,t[0]=b,t[1]=c,t[2]=S,t[3]=x,t[4]=l,t[5]=C):C=t[5];let w=C,T;t[6]!==y||t[7]!==h||t[8]!==g?(T=function(e){e.key===`Enter`?(e.preventDefault(),e.shiftKey?g():h()):e.key===`Escape`&&(e.preventDefault(),y())},t[6]=y,t[7]=h,t[8]=g,t[9]=T):T=t[9];let E=T,D;t[10]!==y||t[11]!==_?(D=function(e){e.key===`Enter`?(e.preventDefault(),_()):e.key===`Escape`&&(e.preventDefault(),y())},t[10]=y,t[11]=_,t[12]=D):D=t[12];let O=D,k;t[13]===b?k=t[14]:(k=b({id:`MVxpbf`}),t[13]=b,t[14]=k);let A;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,Z.jsx)(`label`,{className:`sr-only`,htmlFor:`ok-find-input`,children:(0,Z.jsx)(J,{id:`KujtjC`})}),t[15]=A):A=t[15];let j;t[16]===u?j=t[17]:(j=e=>u(e.target.value),t[16]=u,t[17]=j);let M;t[18]===b?M=t[19]:(M=b({id:`KujtjC`}),t[18]=b,t[19]=M);let N;t[20]!==n||t[21]!==E||t[22]!==r||t[23]!==j||t[24]!==M?(N=(0,Z.jsx)(UC,{ref:n,id:`ok-find-input`,value:r,onChange:j,onKeyDown:E,placeholder:M,autoComplete:`off`,spellCheck:!1,className:`h-7 px-2 text-sm`}),t[20]=n,t[21]=E,t[22]=r,t[23]=j,t[24]=M,t[25]=N):N=t[25];let P;t[26]===b?P=t[27]:(P=b({id:`-8PP0T`}),t[26]=b,t[27]=P);let F;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(F=(0,Z.jsx)(yd,{"aria-hidden":`true`}),t[28]=F):F=t[28];let I;t[29]!==o||t[30]!==p||t[31]!==P?(I=(0,Z.jsx)(Ts,{asChild:!0,children:(0,Z.jsx)(Ic,{type:`button`,variant:`segmented`,size:`sm`,"aria-label":P,pressed:o,onPressedChange:p,className:`size-6 min-w-6 px-0`,children:F})}),t[29]=o,t[30]=p,t[31]=P,t[32]=I):I=t[32];let L;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,Z.jsx)(Es,{side:`bottom`,children:(0,Z.jsx)(J,{id:`-8PP0T`})}),t[33]=L):L=t[33];let R;t[34]===I?R=t[35]:(R=(0,Z.jsxs)(Os,{children:[I,L]}),t[34]=I,t[35]=R);let z;t[36]===b?z=t[37]:(z=b({id:`_7UQ7y`}),t[36]=b,t[37]=z);let B;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(B=(0,Z.jsx)(Lf,{"aria-hidden":`true`}),t[38]=B):B=t[38];let V;t[39]!==m||t[40]!==z||t[41]!==s?(V=(0,Z.jsx)(Ts,{asChild:!0,children:(0,Z.jsx)(Ic,{type:`button`,variant:`segmented`,size:`sm`,"aria-label":z,pressed:s,onPressedChange:m,className:`size-6 min-w-6 px-0`,children:B})}),t[39]=m,t[40]=z,t[41]=s,t[42]=V):V=t[42];let H;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(H=(0,Z.jsx)(Es,{side:`bottom`,children:(0,Z.jsx)(J,{id:`_7UQ7y`})}),t[43]=H):H=t[43];let U;t[44]===V?U=t[45]:(U=(0,Z.jsxs)(Os,{children:[V,H]}),t[44]=V,t[45]=U);let W;t[46]!==R||t[47]!==U?(W=(0,Z.jsxs)(BC,{align:`inline-end`,className:`gap-0.5`,children:[R,U]}),t[46]=R,t[47]=U,t[48]=W):W=t[48];let G;t[49]!==W||t[50]!==N?(G=(0,Z.jsxs)(RC,{className:`h-7 w-56 rounded-[min(var(--radius-md),12px)]`,children:[N,W]}),t[49]=W,t[50]=N,t[51]=G):G=t[51];let K;t[52]===w?K=t[53]:(K=(0,Z.jsx)(`span`,{role:`status`,"aria-live":`polite`,className:`min-w-14 px-1 text-right text-muted-foreground text-xs tabular-nums shrink-0`,children:w}),t[52]=w,t[53]=K);let ee;t[54]===b?ee=t[55]:(ee=b({id:`oqB2ez`}),t[54]=b,t[55]=ee);let te=!S,ne;t[56]===Symbol.for(`react.memo_cache_sentinel`)?(ne=(0,Z.jsx)(bt,{"data-icon":`inline-start`,"aria-hidden":`true`}),t[56]=ne):ne=t[56];let re;t[57]!==g||t[58]!==ee||t[59]!==te?(re=(0,Z.jsx)(Ts,{asChild:!0,children:(0,Z.jsx)(X,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":ee,disabled:te,onClick:g,children:ne})}),t[57]=g,t[58]=ee,t[59]=te,t[60]=re):re=t[60];let ie;t[61]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(0,Z.jsx)(Es,{side:`bottom`,children:(0,Z.jsx)(J,{id:`oqB2ez`})}),t[61]=ie):ie=t[61];let ae;t[62]===re?ae=t[63]:(ae=(0,Z.jsxs)(Os,{children:[re,ie]}),t[62]=re,t[63]=ae);let oe;t[64]===b?oe=t[65]:(oe=b({id:`SiUUCS`}),t[64]=b,t[65]=oe);let se=!S,ce;t[66]===Symbol.for(`react.memo_cache_sentinel`)?(ce=(0,Z.jsx)(Wi,{"data-icon":`inline-start`,"aria-hidden":`true`}),t[66]=ce):ce=t[66];let le;t[67]!==h||t[68]!==oe||t[69]!==se?(le=(0,Z.jsx)(Ts,{asChild:!0,children:(0,Z.jsx)(X,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":oe,disabled:se,onClick:h,children:ce})}),t[67]=h,t[68]=oe,t[69]=se,t[70]=le):le=t[70];let q;t[71]===Symbol.for(`react.memo_cache_sentinel`)?(q=(0,Z.jsx)(Es,{side:`bottom`,children:(0,Z.jsx)(J,{id:`SiUUCS`})}),t[71]=q):q=t[71];let ue;t[72]===le?ue=t[73]:(ue=(0,Z.jsxs)(Os,{children:[le,q]}),t[72]=le,t[73]=ue);let de=a?`secondary`:`ghost`,fe;t[74]!==b||t[75]!==a?(fe=b(a?{id:`UkQGhd`}:{id:`1RluQD`}),t[74]=b,t[75]=a,t[76]=fe):fe=t[76];let pe=a?`ok-replace-input`:void 0,me;t[77]!==f||t[78]!==a?(me=()=>f(!a),t[77]=f,t[78]=a,t[79]=me):me=t[79];let he;t[80]===Symbol.for(`react.memo_cache_sentinel`)?(he=(0,Z.jsx)(mf,{"data-icon":`inline-start`,"aria-hidden":`true`}),t[80]=he):he=t[80];let ge;t[81]!==a||t[82]!==de||t[83]!==fe||t[84]!==pe||t[85]!==me?(ge=(0,Z.jsx)(Ts,{asChild:!0,children:(0,Z.jsx)(X,{type:`button`,variant:de,size:`icon-sm`,"aria-label":fe,"aria-expanded":a,"aria-controls":pe,onClick:me,children:he})}),t[81]=a,t[82]=de,t[83]=fe,t[84]=pe,t[85]=me,t[86]=ge):ge=t[86];let _e;t[87]===a?_e=t[88]:(_e=(0,Z.jsx)(Es,{side:`bottom`,children:a?(0,Z.jsx)(J,{id:`UkQGhd`}):(0,Z.jsx)(J,{id:`1RluQD`})}),t[87]=a,t[88]=_e);let ve;t[89]!==ge||t[90]!==_e?(ve=(0,Z.jsxs)(Os,{children:[ge,_e]}),t[89]=ge,t[90]=_e,t[91]=ve):ve=t[91];let ye;t[92]!==b||t[93]!==O||t[94]!==S||t[95]!==v||t[96]!==_||t[97]!==d||t[98]!==a||t[99]!==i?(ye=a?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(`label`,{className:`sr-only`,htmlFor:`ok-replace-input`,children:(0,Z.jsx)(J,{id:`fqSfXY`})}),(0,Z.jsx)(Hc,{id:`ok-replace-input`,value:i,onChange:e=>d(e.target.value),onKeyDown:O,placeholder:b({id:`fqSfXY`}),autoComplete:`off`,spellCheck:!1,className:`h-7 w-48 rounded-[min(var(--radius-md),12px)] px-2 text-sm shadow-none focus-visible:ring-2`}),(0,Z.jsxs)(Os,{children:[(0,Z.jsx)(Ts,{asChild:!0,children:(0,Z.jsx)(X,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":b({id:`bS_boY`}),disabled:!S,onClick:_,children:(0,Z.jsx)(mf,{"data-icon":`inline-start`,"aria-hidden":`true`})})}),(0,Z.jsx)(Es,{side:`bottom`,children:(0,Z.jsx)(J,{id:`bS_boY`})})]}),(0,Z.jsxs)(Os,{children:[(0,Z.jsx)(Ts,{asChild:!0,children:(0,Z.jsx)(X,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":b({id:`dr1vFs`}),disabled:!S,onClick:v,children:(0,Z.jsx)(pf,{"data-icon":`inline-start`,"aria-hidden":`true`})})}),(0,Z.jsx)(Es,{side:`bottom`,children:(0,Z.jsx)(J,{id:`dr1vFs`})})]})]}):null,t[92]=b,t[93]=O,t[94]=S,t[95]=v,t[96]=_,t[97]=d,t[98]=a,t[99]=i,t[100]=ye):ye=t[100];let be;t[101]===b?be=t[102]:(be=b({id:`wJo9oS`}),t[101]=b,t[102]=be);let xe;t[103]===Symbol.for(`react.memo_cache_sentinel`)?(xe=(0,Z.jsx)(gs,{"data-icon":`inline-start`,"aria-hidden":`true`}),t[103]=xe):xe=t[103];let Se;t[104]!==y||t[105]!==be?(Se=(0,Z.jsx)(Ts,{asChild:!0,children:(0,Z.jsx)(X,{type:`button`,variant:`ghost`,size:`icon-sm`,"aria-label":be,onClick:y,children:xe})}),t[104]=y,t[105]=be,t[106]=Se):Se=t[106];let Ce;t[107]===Symbol.for(`react.memo_cache_sentinel`)?(Ce=(0,Z.jsx)(Es,{side:`bottom`,children:(0,Z.jsx)(J,{id:`yz7wBu`})}),t[107]=Ce):Ce=t[107];let we;t[108]===Se?we=t[109]:(we=(0,Z.jsxs)(Os,{children:[Se,Ce]}),t[108]=Se,t[109]=we);let Te;return t[110]!==G||t[111]!==K||t[112]!==ae||t[113]!==ue||t[114]!==k||t[115]!==ve||t[116]!==ye||t[117]!==we?(Te=(0,Z.jsxs)(`search`,{"data-testid":`find-replace-bar`,"aria-label":k,className:`pointer-events-auto flex max-w-[min(calc(100vw-1rem),720px)] touch-manipulation items-center gap-1 rounded-[calc(var(--radius)+2px)] border border-input bg-popover/95 p-1 text-popover-foreground shadow-md shadow-black/10 backdrop-blur`,children:[A,G,K,ae,ue,ve,ye,we]}),t[110]=G,t[111]=K,t[112]=ae,t[113]=ue,t[114]=k,t[115]=ve,t[116]=ye,t[117]=we,t[118]=Te):Te=t[118],Te}var GC={current:0,total:0},KC=120,qC=100;function JC(e){let t=(0,$.c)(2),n;return t[0]===e?n=t[1]:(n=()=>e?Et(e):null,t[0]=e,t[1]=n),(0,Q.useSyncExternalStore)(xe,n,YC)}function YC(){return null}function XC(e){if(!e||e.isDestroyed)return null;let{from:t,to:n,empty:r}=e.state.selection;if(r)return null;let i=e.state.doc.textBetween(t,n,`
|
|
25
25
|
`,`
|
|
26
26
|
`).trim();return i.length===0||i.length>KC||i.includes(`
|
|
27
27
|
`)?null:i}function ZC(e){let t=Ze(e.state);return{current:t.matches.length===0?0:t.activeIndex+1,total:t.matches.length}}function QC(e,t){return e.current===t.current&&e.total===t.total}function $C(e,t,n){e&&!e.isDestroyed&&(e.commands.clearFindMatches(),e.commands.focus()),t(e=>({...e,open:!1,activeIndex:0})),n(GC)}function ew(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 tw(e){let t=(0,$.c)(81),{activeDocName:n,isSourceMode:r}=e,i=JC(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)(GC),m,h;t[1]===n?(m=t[2],h=t[3]):(m=()=>{s.current!==n&&(s.current=n,d(rw))},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(nw)},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(GC);return}if(!u.open||r){i.commands.clearFindMatches(),p(GC);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=ZC(i);p(t=>QC(t,e)?t:e)},qC);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=Ze(i.state),t=ZC(i);p(e=>QC(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=XC(i);d(n=>({...n,open:!0,replaceOpen:e,query:t??n.query,activeIndex:0}))},t=function(t){if(!(!n||r||t.defaultPrevented)){if(kl(t,`find`)){t.preventDefault(),u.open?$C(i,d,p):e(!1);return}if(kl(t,`replace`)){t.preventDefault(),e(!0);return}if(u.open){let e=kl(t,`find-next`),n=kl(t,`find-previous`);if(e||n){t.preventDefault(),(n?i?.commands.selectPreviousFindMatch():i?.commands.selectNextFindMatch())&&ew(i);return}}t.key===`Escape`&&u.open&&(t.preventDefault(),$C(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=Ze(i.state),t=ZC(i);p(e=>QC(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(){$C(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()&&ew(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()&&ew(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)&&ew(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)&&ew(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)(WC,{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 nw(e){return{...e,open:!1,activeIndex:0}}function rw(e){return{...e,activeIndex:0}}var iw=300;function aw(e,t){let n=(0,$.c)(4),[r,i]=(0,Q.useState)(Ql),a,o;return n[0]!==t||n[1]!==e?(a=()=>{if(!e||!t){i(Ql);return}let n=e.document.getText(`source`),r=!1,a=null,o=function(){r||i(nu(n.toString()))};o();let s=function(){a&&clearTimeout(a),a=setTimeout(o,iw)};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 ow(e){return e&&e.document.getMap(`lifecycle`).get(`status`)===`conflict`?`conflict`:null}function sw(e){let t=(0,$.c)(8),{poolEntries:n}=mt(),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=()=>ow(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(ow(i));let t=()=>s(ow(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 cw(e,t){let n=(0,$.c)(3),r;return n[0]!==e||n[1]!==t?(r=()=>ou(e,t),n[0]=e,n[1]=t,n[2]=r):r=n[2],(0,Q.useSyncExternalStore)(su,r)}var lw=`ok-doc-panel-width-v1`;function uw(e){return Number.isFinite(e)?e<300?300:e>600?600:Math.round(e):320}function dw(e){try{let t=(e??localStorage).getItem(lw);if(t==null)return 320;let n=Number.parseInt(t,10);return Number.isFinite(n)?uw(n):320}catch{return 320}}function fw(e,t){try{(t??localStorage).setItem(lw,String(uw(e)))}catch{}}function pw(){try{return typeof localStorage>`u`?320:dw()}catch{return 320}}var mw=1024,hw=1280,gw={left:mw,right:hw};function _w(e,t,n){return e==null?t>=gw[n]?`above`:`below`:`embedded`}function vw(e){return e===`above`?`open`:`collapsed`}var yw=`ok-sidebar-pins-v2`;function bw(e){return e===`open`||e===`collapsed`}function xw(e){return e===`above`||e===`below`||e===`embedded`}function Sw(e){if(typeof e!=`object`||!e)return!1;let t=e;for(let e of Object.keys(t))if(!xw(e)||!bw(t[e]))return!1;return!0}function Cw(e){let t=JSON.parse(e);if(typeof t!=`object`||!t)return{};let n=t,r={};return Sw(n.left)&&(r.left=n.left),Sw(n.right)&&(r.right=n.right),r}function ww(e){try{let t=(e??localStorage).getItem(yw);return t==null?{}:Cw(t)}catch{return{}}}function Tw(e,t){try{t.setItem(yw,JSON.stringify(e))}catch{}}function Ew(e,t,n){return n[e]?.[t]??vw(t)}function Dw(e,t,n,r){let i=r??localStorage,a=ww(i);return a[e]={...a[e],[t]:n},Tw(a,i),a}var Ow=`ok-terminal-width-v1`;function kw(e){return Number.isFinite(e)?e<320?320:Math.round(e):480}function Aw(e){try{let t=(e??localStorage).getItem(Ow);if(t==null)return 480;let n=Number.parseInt(t,10);return Number.isFinite(n)?kw(n):480}catch{return 480}}function jw(e,t){try{(t??localStorage).setItem(Ow,String(kw(e)))}catch{}}function Mw(){try{return typeof localStorage>`u`?480:Aw()}catch{return 480}}function Nw(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`?Pw: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 Pw(e){return e===`synced`?`synced`:`connected`}function Fw(e){let t=e.lastIndexOf(`/`);return t>=0?e.slice(t+1):e}function Iw(e){let t=(0,$.c)(21),{path:n,onRemove:r}=e,{_:i}=$t(),a,o;t[0]!==i||t[1]!==n?(a=Fw(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)(Vt,{path:n,className:`size-3`})}),t[6]=n,t[7]=u);let d;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,Z.jsx)(gs,{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 Lw(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)(Iw,{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 Rw(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,{_}=$t(),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)(Wi,{"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)(hc,{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)(vc,{"aria-label":_({id:`ALhMYW`}),children:[(0,Z.jsx)(Oc,{children:(0,Z.jsx)(J,{id:`ALhMYW`})}),y?y.map(e=>(0,Z.jsxs)(_c,{onSelect:e.onSelect,"data-testid":C(e.cli),"aria-label":e.ariaLabel,children:[(0,Z.jsx)(sa,{id:oa(e.cli),className:`size-4`,"aria-hidden":`true`}),(0,Z.jsx)(`span`,{className:`flex-1`,children:e.label}),e.selected?(0,Z.jsx)(Ui,{"aria-hidden":`true`,className:`size-4 text-muted-foreground`}):null]},e.cli)):c?(0,Z.jsxs)(_c,{onSelect:c.onSelect,"data-testid":C(`claude`),"aria-label":_({id:`AcK_r0`}),children:[(0,Z.jsx)(sa,{id:oa(`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)(Ui,{"aria-hidden":`true`,className:`size-4 text-muted-foreground`}):null]}):null]}):null,v?(0,Z.jsxs)(Z.Fragment,{children:[b?(0,Z.jsx)(Ac,{}):null,(0,Z.jsxs)(vc,{"aria-label":_({id:`BBqGS9`}),children:[(0,Z.jsx)(Oc,{children:(0,Z.jsx)(J,{id:`BBqGS9`})}),a.map(e=>(0,Z.jsxs)(_c,{onSelect:()=>s(e),"data-testid":m.option(e.id),children:[(0,Z.jsx)(sa,{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)(Ui,{"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)(yc,{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)(Tc,{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)(hx,{children:[w,k]}),t[32]=w,t[33]=k,t[34]=A):A=t[34],A}var zw=`ok-onboarding-card-v1`,Bw={initialized:!1,steps:{file:!1,askedAi:!1},dismissed:!1,completed:!1};function Vw(e){return e===!0}function Hw(e){if(typeof e!=`object`||!e)return Bw;let t=e,n=typeof t.steps==`object`&&t.steps!==null?t.steps:{};return{initialized:Vw(t.initialized),steps:{file:Vw(n.file),askedAi:Vw(n.askedAi)},dismissed:Vw(t.dismissed),completed:Vw(t.completed)}}function Uw(e){try{let t=(e??localStorage).getItem(zw);return t==null?Bw:Hw(JSON.parse(t))}catch(e){return console.warn(`[onboarding-card-store] readPersistedState failed (corrupt/privacy/SSR)`,e),Bw}}function Ww(e,t){try{(t??localStorage).setItem(zw,JSON.stringify(e))}catch(e){console.warn(`[onboarding-card-store] writePersistedState failed (quota/privacy/SSR)`,e)}}function Gw(e){let t=Uw(e),n=new Set,r=!1;function i(){for(let e of n)e()}function a(n){t=n,Ww(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=Uw(e),i())}}}var Kw=Gw();function qw(e){let t=e===void 0?Kw:e;return(0,Q.useSyncExternalStore)(t.subscribe,t.getSnapshot,t.getSnapshot)}function Jw(){Kw.install()}function Yw(e){return gl(e).filter(e=>e.kind===`document`||e.kind===`folder`).length}async function Xw(){let e=await fetch(`/api/documents`);if(!e.ok)throw Error(`documents request failed: ${e.status}`);let t=await e.json(),n=Bn.safeParse(t);if(!n.success)throw Error(`documents response did not match schema`,{cause:n.error});return Yw(n.data.documents)}async function Zw(e=Kw){let t=e.getSnapshot();if(!(t.steps.file||!t.initialized))try{await Xw()>=1&&e.markStepComplete(`file`)}catch(e){console.warn(`[onboarding-signals] file-step count read failed; leaving step incomplete`,e)}}function Qw(e=Kw){e.getSnapshot().initialized&&e.markStepComplete(`askedAi`)}var $w=5200,eT=500;function tT(e){if(!(e instanceof HTMLElement))return!1;let t=e.tagName.toUpperCase();return t===`INPUT`||t===`TEXTAREA`||t===`SELECT`}function nT(){let e=(0,$.c)(2),[t,n]=(0,Q.useState)(rT),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 rT(){return typeof window<`u`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}function iT(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),$w);return()=>clearTimeout(e)}let e=setTimeout(()=>{i(aT),o(!0)},eT);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 aT(e){return e+1}function oT(e){let t=(0,$.c)(153),{docName:n,surface:r,folderPath:i,dismissed:a,onDismiss:o,onReopen:s}=e,c=a===void 0?!1:a,{_:l}=$t(),u=i!==void 0,d=u?null:n??null,f=r??`wysiwyg`,p=nT(),m=$i(),{states:h}=pa(),{dispatch:g}=xa(),_=ya(),[v]=(0,Q.useState)(_T),[y,b]=(0,Q.useState)(null),x=Yg(),[S,C]=(0,Q.useState)(!0),[w,T]=(0,Q.useState)(!1),E=(0,Q.useRef)(null),D=(0,Q.useRef)(null),[O]=(0,Q.useState)(gT),k,A;t[0]!==c||t[1]!==n||t[2]!==u||t[3]!==r?(k=()=>{if(u||n==null)return;let e=document.documentElement,t=mT,i=()=>{r===`wysiwyg`&&requestAnimationFrame(()=>{let e=Et(n),t=D.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=D.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`)}},A=[c,r,n,u],t[0]=c,t[1]=n,t[2]=u,t[3]=r,t[4]=k,t[5]=A):(k=t[4],A=t[5]),(0,Q.useEffect)(k,A);let j=(0,Q.useRef)(c),M=(0,Q.useRef)(s),N;t[6]!==c||t[7]!==s?(N=()=>{j.current=c,M.current=s},t[6]=c,t[7]=s,t[8]=N):N=t[8],(0,Q.useEffect)(N);let P,F;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(P=()=>ru(()=>{j.current?M.current?.():E.current?.focus()}),F=[],t[9]=P,t[10]=F):(P=t[9],F=t[10]),(0,Q.useEffect)(P,F);let I;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(I=[],t[11]=I):I=t[11],(0,Q.useEffect)(fT,I);let L=(0,Q.useRef)(c),R,z;t[12]===c?(R=t[13],z=t[14]):(R=()=>{let e=L.current;L.current=c,e&&!c&&E.current?.focus()},z=[c],t[12]=c,t[13]=R,t[14]=z),(0,Q.useEffect)(R,z);let B;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(B=[],t[15]=B):B=t[15];let[V,H]=(0,Q.useState)(B),[U,W]=(0,Q.useState)(dT),G;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(G=[],t[16]=G):G=t[16];let[K,ee]=(0,Q.useState)(G),te;t[17]!==n||t[18]!==u?(te=u||n==null?``:ra(n),t[17]=n,t[18]=u,t[19]=te):te=t[19];let ne=te,re,ie;t[20]!==ne||t[21]!==U||t[22]!==u||t[23]!==S?(re=()=>{u||S||H(e=>e.includes(ne)||U.has(ne)?e:[...e,ne])},ie=[u,S,ne,U],t[20]=ne,t[21]=U,t[22]=u,t[23]=S,t[24]=re,t[25]=ie):(re=t[24],ie=t[25]),(0,Q.useEffect)(re,ie);let ae;t[26]!==U||t[27]!==u||t[28]!==i||t[29]!==K||t[30]!==V?(ae=u?i&&!U.has(i)&&!K.includes(i)?[i]:[]:V.filter(e=>!U.has(e)&&!K.includes(e)),t[26]=U,t[27]=u,t[28]=i,t[29]=K,t[30]=V,t[31]=ae):ae=t[31];let oe=ae,se=zi(d,f),ce=zi(d,`frontmatter`),[le,q]=(0,Q.useState)(null),[ue,de]=(0,Q.useState)(!1),fe,pe;t[32]===se?(fe=t[33],pe=t[34]):(fe=()=>{se&&q(se)},pe=[se],t[32]=se,t[33]=fe,t[34]=pe),(0,Q.useEffect)(fe,pe);let me,he;t[35]===ce?(me=t[36],he=t[37]):(me=()=>{ce&&q(ce)},he=[ce],t[35]=ce,t[36]=me,t[37]=he),(0,Q.useEffect)(me,he);let ge=y??v,_e;t[38]!==ge||t[39]!==_?(_e=_===null?null:i_(ge),t[38]=ge,t[39]=_,t[40]=_e):_e=t[40];let ve=_e,ye;t[41]!==ge||t[42]!==x||t[43]!==_?(ye=_!==null&&ge===null?l_(null,x):null,t[41]=ge,t[42]=x,t[43]=_,t[44]=ye):ye=t[44];let be=ve??ye,xe=be!==null,Se;t[45]!==ge||t[46]!==xe||t[47]!==h?(Se=xe?null:c_(h,ge),t[45]=ge,t[46]=xe,t[47]=h,t[48]=Se):Se=t[48];let Ce=Se,we=!w&&(!S||le!==null)&&(xe||Ce!==null),Te;t[49]===h?Te=t[50]:(Te=ta.filter(e=>h[e.id]?.installed===!0),t[49]=h,t[50]=Te);let Ee=Te,De;t[51]===h?De=t[52]:(De=ta.some(e=>h[e.id]?.installed==null),t[51]=h,t[52]=De);let Oe=De,ke=_===null?void 0:fi.map(e=>{let{displayName:t}=zn[e];return{cli:e,label:t,ariaLabel:l({id:`QYfQdv`,values:{displayName:t}}),selected:be===e,onSelect:()=>Re(e)}}),Ae;t[53]===l?Ae=t[54]:(Ae=l({id:`KYSocE`}),t[53]=l,t[54]=Ae);let je;t[55]===l?je=t[56]:(je=l({id:`7Ongq0`}),t[55]=l,t[56]=je);let Me;t[57]===l?Me=t[58]:(Me=l({id:`HPTPGr`}),t[57]=l,t[58]=Me);let Ne;t[59]===l?Ne=t[60]:(Ne=l({id:`qiRoLb`}),t[59]=l,t[60]=Ne);let Pe;t[61]!==Ae||t[62]!==je||t[63]!==Me||t[64]!==Ne?(Pe=[Ae,je,Me,Ne],t[61]=Ae,t[62]=je,t[63]=Me,t[64]=Ne,t[65]=Pe):Pe=t[65];let Fe=iT(Pe,!p&&S&&!c),Ie;t[66]===Symbol.for(`react.memo_cache_sentinel`)?(Ie=e=>{b(e.id),s_(e.id)},t[66]=Ie):Ie=t[66];let Le=Ie,Re=e=>{let t=r_(e);b(t),s_(t)},ze;t[67]===Symbol.for(`react.memo_cache_sentinel`)?(ze=()=>{E.current?.clear(),q(null),de(!1),H([]),W(new Set),px()},t[67]=ze):ze=t[67];let Be=ze,Ve;t[68]!==l||t[69]!==g||t[70]!==Ce||t[71]!==be||t[72]!==_?(Ve=e=>{if(e===null){hs.error(l({id:`y8B54M`}));return}if(be!==null&&_!==null){try{_.launchInTerminal(e,be)}catch{hs.error(l({id:`jBVUXo`}));return}Qw(),Be();return}Ce!==null&&(T(!0),g(Ce.id,e).then(uT).finally(()=>{T(!1),Be()}))},t[68]=l,t[69]=g,t[70]=Ce,t[71]=be,t[72]=_,t[73]=Ve):Ve=t[73];let He=Ve,Ue;t[74]!==ne||t[75]!==we||t[76]!==He||t[77]!==n||t[78]!==oe||t[79]!==u||t[80]!==i||t[81]!==le||t[82]!==m?(Ue=()=>{if(!we)return;let{instruction:e,mentions:t}=E.current?.getContent()??{instruction:``,mentions:[]};if(u){He(la({docName:null,folderRelativePath:i,workspace:m,instruction:e,mentions:[...new Set([...oe,...t])].filter(e=>e!==i)}));return}let r=le?fu(le):void 0,a=le?.docName??null,o=le?a:oe.includes(ne)?n??null:null,s=o===null?null:ra(o);He(la({docName:o,workspace:m,instruction:e,mentions:[...new Set([...oe,...t])].filter(e=>e!==s),selection:r}))},t[74]=ne,t[75]=we,t[76]=He,t[77]=n,t[78]=oe,t[79]=u,t[80]=i,t[81]=le,t[82]=m,t[83]=Ue):Ue=t[83];let We=Ue;if(c)return null;let Ge=``,Ke=``;if(le){let e;t[84]===le?e=t[85]:(e=pu(le,ra(le.docName).split(`/`).pop()??``),t[84]=le,t[85]=e),Ge=e;let n;t[86]===le.markdown?n=t[87]:(n=mu(le.markdown),t[86]=le.markdown,t[87]=n),Ke=n}let qe;t[88]!==l||t[89]!==u||t[90]!==o?(qe=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)(Wi,{className:`size-3.5`,"aria-hidden":!0})}),t[88]=l,t[89]=u,t[90]=o,t[91]=qe):qe=t[91];let Je;t[92]===Symbol.for(`react.memo_cache_sentinel`)?(Je=e=>W(t=>{let n=new Set(t);return n.add(e),n}),t[92]=Je):Je=t[92];let Ye;t[93]!==l||t[94]!==Ge||t[95]!==Ke||t[96]!==le||t[97]!==ue?(Ye=le?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(`span`,{"data-testid":`composer-selection-pill`,title:Ge,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:()=>{q(null),de(!1)},className:`group/remove relative size-3.5 shrink-0 rounded-sm text-muted-foreground/80 hover:text-foreground`,children:[(0,Z.jsx)(Mf,{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)(gs,{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":ue,"aria-label":l(ue?{id:`UaDyeb`}:{id:`eTL5y9`}),onClick:()=>de(lT),"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:Ge})})]}),ue&&Ke!==``?(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:Ke}):null]}):null,t[93]=l,t[94]=Ge,t[95]=Ke,t[96]=le,t[97]=ue,t[98]=Ye):Ye=t[98];let Xe;t[99]!==oe||t[100]!==Ye?(Xe=(0,Z.jsx)(Lw,{files:oe,onRemoveFile:Je,children:Ye}),t[99]=oe,t[100]=Ye,t[101]=Xe):Xe=t[101];let Ze;t[102]===l?Ze=t[103]:(Ze=l({id:`xWEvuo`}),t[102]=l,t[103]=Ze);let Qe;t[104]!==O||t[105]!==We||t[106]!==Ze?(Qe=(0,Z.jsx)(Px,{ref:E,ariaLabel:Ze,onEmptyChange:C,onContentChange:fx,onMentionsChange:ee,onSubmit:We,initialDoc:O,className:`max-h-[200px] overflow-y-auto text-base md:text-sm`}),t[104]=O,t[105]=We,t[106]=Ze,t[107]=Qe):Qe=t[107];let $e;t[108]!==S||t[109]!==p||t[110]!==Fe?($e=S?(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`,Fe.visible?`opacity-100`:`opacity-0`),children:Fe.text}):null,t[108]=S,t[109]=p,t[110]=Fe,t[111]=$e):$e=t[111];let et;t[112]!==Qe||t[113]!==$e?(et=(0,Z.jsxs)(`div`,{className:`relative flex-1`,children:[Qe,$e]}),t[112]=Qe,t[113]=$e,t[114]=et):et=t[114];let tt;t[115]!==Ce||t[116]!==be?(tt=be===null?Ce?(0,Z.jsx)(sa,{id:Ce.id,className:`size-4`,"aria-hidden":!0}):null:(0,Z.jsx)(sa,{id:oa(be),className:`size-4`,"aria-hidden":!0}),t[115]=Ce,t[116]=be,t[117]=tt):tt=t[117];let nt;t[118]!==Ce||t[119]!==be?(nt=(0,Z.jsx)(`span`,{children:be===null?Ce?(0,Z.jsx)(J,{id:`nUNZL4`,values:{0:Ce.displayName}}):(0,Z.jsx)(J,{id:`F-vBv0`}):(0,Z.jsx)(J,{id:`ti6aF_`,values:{0:zn[be].displayName}})}),t[118]=Ce,t[119]=be,t[120]=nt):nt=t[120];let rt;t[121]===w?rt=t[122]:(rt=w?(0,Z.jsx)($o,{className:`size-3.5 animate-spin`,"aria-hidden":!0}):null,t[121]=w,t[122]=rt);let it;t[123]!==tt||t[124]!==nt||t[125]!==rt?(it=(0,Z.jsxs)(Z.Fragment,{children:[tt,nt,rt]}),t[123]=tt,t[124]=nt,t[125]=rt,t[126]=it):it=t[126];let at=!we,ot=xe?null:Ce?.id??null,st;t[127]===Oe?st=t[128]:(st=(0,Z.jsx)(`p`,{className:`px-2 py-1.5 text-sm text-muted-foreground`,"aria-live":`polite`,children:Oe?(0,Z.jsx)(J,{id:`EcR0fl`}):(0,Z.jsx)(J,{id:`l6OXqI`})}),t[127]=Oe,t[128]=st);let ct;t[129]===l?ct=t[130]:(ct=l({id:`nskygk`}),t[129]=l,t[130]=ct);let lt;t[131]===Symbol.for(`react.memo_cache_sentinel`)?(lt={primary:`ask-ai-send`,trigger:`ask-ai-agent-trigger`,menu:`ask-ai-agent-menu`,option:cT,terminal:sT},t[131]=lt):lt=t[131];let ut;t[132]!==ke||t[133]!==Le||t[134]!==Ee||t[135]!==We||t[136]!==it||t[137]!==at||t[138]!==ot||t[139]!==st||t[140]!==ct?(ut=(0,Z.jsx)(Rw,{primary:it,onPrimary:We,primaryDisabled:at,installedTargets:Ee,selectedTargetId:ot,onSelectTarget:Le,terminals:ke,menuEmptyState:st,triggerAriaLabel:ct,testIds:lt}),t[132]=ke,t[133]=Le,t[134]=Ee,t[135]=We,t[136]=it,t[137]=at,t[138]=ot,t[139]=st,t[140]=ct,t[141]=ut):ut=t[141];let dt;t[142]!==et||t[143]!==ut?(dt=(0,Z.jsxs)(`div`,{className:`flex items-end gap-2`,children:[et,ut]}),t[142]=et,t[143]=ut,t[144]=dt):dt=t[144];let ft;t[145]!==qe||t[146]!==Xe||t[147]!==dt?(ft=(0,Z.jsxs)(`div`,{ref:D,className:`pointer-events-auto group relative flex 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:[qe,Xe,dt]}),t[145]=qe,t[146]=Xe,t[147]=dt,t[148]=ft):ft=t[148];let pt=ft;if(u){let e;return t[149]===pt?e=t[150]:(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:pt})}),t[149]=pt,t[150]=e),e}let mt;return t[151]===pt?mt=t[152]:(mt=(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:pt}),t[151]=pt,t[152]=mt),mt}function sT(e){return e===`claude`?`ask-ai-agent-option-terminal`:`ask-ai-agent-option-terminal-${e}`}function cT(e){return`ask-ai-agent-option-${e}`}function lT(e){return!e}function uT(e){e.ok&&Qw()}function dT(){return new Set}function fT(){let e=pT;return window.addEventListener(`keydown`,e,{capture:!0}),()=>window.removeEventListener(`keydown`,e,{capture:!0})}function pT(e){kl(e,`open-ask-ai`)&&(tT(e.target)||(e.preventDefault(),cu()))}function mT(){let e=[...document.querySelectorAll(`.editor-doc-scroll`)].filter(hT);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 hT(e){let t=e.scrollHeight-e.clientHeight;return t>0&&e.scrollTop>=t-40}function gT(){return dx().doc??void 0}function _T(){return o_()}function vT(e){return!e.terminalVisible&&!e.isEmbedded&&e.activeDocName!==null}function yT(e){return!e.terminalVisible&&!e.isEmbedded}function bT(e,t={}){let n=tt(e.componentName);return n.name===`*`?t.unregisteredSuffix?`${e.componentName} (unregistered)`:e.componentName:n.displayName??n.name}var xT=200,ST=`Outside any block`;function CT(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?wT(n,r):o.current?ST:``,a.current=window.setTimeout(()=>{i.current&&(i.current.textContent=``,i.current.textContent=t),o.current=e,a.current=null},xT),()=>{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 wT(e,t){if(!t||t.ancestorChain.length===0)return``;let n=t.ancestorChain,r=n[n.length-1],i=bT(r,{unregisteredSuffix:!0});if(n.length===1)return`Selected: ${i}`;let a=n[n.length-2],o=bT(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 TT=!1;function ET(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{wl(n,{durationMs:Math.round(e*1e3)/1e3,threw:!o,...i},{startTime:t,duration:e})}catch{}}}}function DT(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 OT=0,kT=0,AT=0,jT=0,MT=null,NT=[`linkResolutionDecoration$`],PT=new WeakSet,FT=new WeakSet;function IT(e){return e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase()}function LT(){return!1}function RT(){return!LT()}function zT(e,t){if(RT())return t;let n=`ok/cold/nodeview-factory-${IT(e)}`;return function(...r){let i=performance.now();try{return t(...r)}finally{let t=performance.now()-i;wl(n,{nodeType:e,durationMs:Math.round(t*1e3)/1e3},{startTime:i,duration:t})}}}function BT(e){if(RT())return;let t=e.state.plugins;for(let e of t){if(FT.has(e))continue;let t=e.spec?.key?.key;if(!t||!NT.some(e=>t.startsWith(e)))continue;let n=e.props,r=n.decorations;if(typeof r!=`function`){FT.add(e);continue}let i=`ok/cold/decoration-${IT(t.replace(/\$\d*$/,``))}`;n.decorations=function(...e){let n=performance.now();try{return r.apply(this,e)}finally{let e=performance.now()-n;wl(i,{pluginKey:t,durationMs:Math.round(e*1e3)/1e3},{startTime:n,duration:e})}},FT.add(e)}}function VT(e){if(RT())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 HT(e){return RT()?e:e.map(e=>{let t=e.name??`unknown`,n=IT(t);return e.extend({onBeforeCreate(){let e=performance.now();try{this.parent?.()}finally{let r=performance.now()-e;wl(`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;wl(`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;wl(`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;wl(`ok/cold/ext-${n}-on-destroy`,{ext:t,hook:`onDestroy`,durationMs:Math.round(r*1e3)/1e3},{startTime:e,duration:r})}}})})}function UT(){if(!TT){TT=!0,ET(Ln.prototype,`mount`,`ok/cold/editor-mount`,(e,t,n,r)=>{let i=e;return RT()||(MT=performance.now()),{elementDefault:i.options?.element?.nodeName??null,docSize:DT(i.editorState),durationMs:r}}),ET(Ln.prototype,`createView`,`ok/cold/editor-create-view`,e=>{let t=e;return!RT()&&!PT.has(e)&&t.view&&(BT(t.view),VT(t.view),PT.add(e)),{docSize:DT(t.editorState)}}),ET(Ln.prototype,`createNodeViews`,`ok/cold/create-node-views`,(e,t,n,r)=>{jT+=1;let i=e;return!RT()&&i.view&&VT(i.view),{docSize:DT(i.view),seq:jT,durationMs:r}}),ET(Hr.prototype,`updateState`,`ok/cold/pm-update-state`,(e,t,n,r)=>(kT+=1,{seq:kT,docSize:DT(e.state),durationMs:r})),ET(Hr.prototype,`setProps`,`ok/cold/pm-set-props`,(e,t,n,r)=>(AT+=1,{seq:AT,docSize:DT(e.state),durationMs:r})),ET(O.prototype,`_forceRerender`,`ok/cold/force-rerender`,(e,t,n,r)=>{OT+=1;let i=e,a=(()=>{try{return i.type?.toArray?i.type.toArray().length:null}catch{return null}})();return{seq:OT,topLevelYElements:a,durationMs:r}}),ET(u.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`)&&(wl(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}),!RT()&&e===`first-paint`&&MT!==null)){let e=MT,n=Math.max(0,t.startTime-e);wl(`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}),MT=null}}}).observe({type:`paint`,buffered:!0})}catch{}globalThis.__okColdMountInstrumented=!0}}function WT(){let[e]=(0,Q.useState)(sr);return e}function GT({principal:e,identity:t}){return e&&e.source===`git-config`?{type:`human`,name:ci(e.display_name),color:_r(e.id,Wn),coeditor:t.coeditor,tabId:t.tabId,principalId:e.id}:e&&e.source===`synthesized`?{type:`human`,name:t.name,color:_r(e.id,Wn),coeditor:t.coeditor,tabId:t.tabId}:{type:`human`,name:t.name,color:t.color,coeditor:t.coeditor,tabId:t.tabId}}function KT(e,t){return e>t}function qT(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 JT=3,YT=6e4;function XT(e,t){let n=0;for(let r of e)t-r<YT&&(n+=1);return n<JT}var ZT=new Map;function QT(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 $T(e){let t=T.getState(e);return t?.snapshot!=null||t?.prevSnapshot!=null}function eE(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=T.getState(e)?.binding;if(!t)return;if(typeof t._prosemirrorChanged!=`function`){wl.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=>{KT(i,a)||r(e)}},f=()=>{if(c=!1,!s||o||!KT(i,a)||l!==null&&$T(l.state))return;o=!0;let e=Date.now();for(let[t,n]of ZT)n.every(t=>e-t>=YT)&&ZT.delete(t);let t=(ZT.get(n)??[]).filter(t=>e-t<YT);if(!XT(t,e)){ZT.set(n,t),wl.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),ZT.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,wl.count(`ok/editor/binding-wedge-recovery-error`,{docName:n}),console.error(`[binding-staleness-guard] wedge recovery threw for "${n}":`,e)}},p=e=>{e.origin!==T&&QT(e,t)&&(i+=1,c||(c=!0,queueMicrotask(f)))};return new Mr({state:{init:()=>null,apply:e=>(qT(e.getMeta(T))&&(a=i,o&&wl.count(`ok/editor/binding-wedge-recovered`,{docName:n}),o=!1),null)},filterTransaction:(e,t)=>!KT(i,a)||$T(t)?!0:e.getMeta(T)!==void 0,view:e=>{let r=t.doc;return r==null?(wl.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 tE(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 nE=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&&ii(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(zs(typeof this.floatingUIOptions.flip==`boolean`?void 0:this.floatingUIOptions.flip)),this.floatingUIOptions.shift&&e.push(Fs(typeof this.floatingUIOptions.shift==`boolean`?void 0:this.floatingUIOptions.shift)),this.floatingUIOptions.offset&&e.push(Ls(typeof this.floatingUIOptions.offset==`boolean`?void 0:this.floatingUIOptions.offset)),this.floatingUIOptions.arrow&&e.push(Is(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&e.push(Ns(typeof this.floatingUIOptions.size==`boolean`?void 0:this.floatingUIOptions.size)),this.floatingUIOptions.autoPlacement&&e.push(Rs(typeof this.floatingUIOptions.autoPlacement==`boolean`?void 0:this.floatingUIOptions.autoPlacement)),this.floatingUIOptions.hide&&e.push(As(typeof this.floatingUIOptions.hide==`boolean`?void 0:this.floatingUIOptions.hide)),this.floatingUIOptions.inline&&e.push(js(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=ti(this.view,e.from,e.to),r={getBoundingClientRect:()=>n,getClientRects:()=>[n]};if(e instanceof Or){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 qn){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():tE(o.getBoundingClientRect(),s.getBoundingClientRect());r={getBoundingClientRect:()=>c,getClientRects:()=>[c]}}return r}updatePosition(){if(!this.isVisible)return;let e=this.virtualElement;e&&Ps(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()}},rE=e=>new Mr({key:typeof e.pluginKey==`string`?new Zr(e.pluginKey):e.pluginKey,view:t=>new nE({view:t,...e})});pr.create({name:`bubbleMenu`,addOptions(){return{element:null,pluginKey:`bubbleMenu`,updateDelay:void 0,appendTo:void 0,shouldShow:null}},addProseMirrorPlugins(){return this.options.element?[rE({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 iE=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 gr(e,{textSerializers:yr(this.editor.schema)})}get middlewares(){let e=[];return this.floatingUIOptions.flip&&e.push(zs(typeof this.floatingUIOptions.flip==`boolean`?void 0:this.floatingUIOptions.flip)),this.floatingUIOptions.shift&&e.push(Fs(typeof this.floatingUIOptions.shift==`boolean`?void 0:this.floatingUIOptions.shift)),this.floatingUIOptions.offset&&e.push(Ls(typeof this.floatingUIOptions.offset==`boolean`?void 0:this.floatingUIOptions.offset)),this.floatingUIOptions.arrow&&e.push(Is(this.floatingUIOptions.arrow)),this.floatingUIOptions.size&&e.push(Ns(typeof this.floatingUIOptions.size==`boolean`?void 0:this.floatingUIOptions.size)),this.floatingUIOptions.autoPlacement&&e.push(Rs(typeof this.floatingUIOptions.autoPlacement==`boolean`?void 0:this.floatingUIOptions.autoPlacement)),this.floatingUIOptions.hide&&e.push(As(typeof this.floatingUIOptions.hide==`boolean`?void 0:this.floatingUIOptions.hide)),this.floatingUIOptions.inline&&e.push(js(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=ti(this.view,e.from,e.to);Ps({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()}},aE=e=>new Mr({key:typeof e.pluginKey==`string`?new Zr(e.pluginKey):e.pluginKey,view:t=>new iE({view:t,...e})});pr.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?[aE({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 oE(e,t){return e??new Zr(t)}var sE=typeof window<`u`?Q.useLayoutEffect:Q.useEffect,cE=new Set([`left`,`opacity`,`position`,`top`,`visibility`,`width`]),lE=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(`.`)),uE=new Set([`children`,`className`,`style`]),dE=new Set([`tabIndex`]),fE=new Set([`accessKey`,`autoCapitalize`,`contentEditable`,`contextMenu`,`dir`,`draggable`,`enterKeyHint`,`hidden`,`id`,`lang`,`nonce`,`role`,`slot`,`spellCheck`,`tabIndex`,`title`,`translate`]),pE={Blur:`focusout`,DoubleClick:`dblclick`,Focus:`focusin`,MouseEnter:`mouseenter`,MouseLeave:`mouseleave`};function mE(e,t){return/^on[A-Z]/.test(e)&&typeof t==`function`}function hE(e){return e.startsWith(`aria-`)||e.startsWith(`data-`),e}function gE(e){return e.startsWith(`aria-`)||e.startsWith(`data-`)||fE.has(e)}function _E(e){return e.startsWith(`--`)?e:e.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}function vE(e){let t=e.endsWith(`Capture`),n=(t?e.slice(0,-7):e).slice(2);return{eventName:pE[n]??n.toLowerCase(),options:t?{capture:!0}:void 0}}function yE(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 bE(e){return dE.has(e)}function xE(e,t,n){if(t===`tabIndex`){e.tabIndex=Number(n);return}e[t]=n}function SE(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 CE(e,t){return typeof t!=`number`||t===0||e.startsWith(`--`)||lE.has(e)?String(t):`${t}px`}function wE(e,t){cE.has(t)||e.style.removeProperty(_E(t))}function TE(e,t,n){cE.has(t)||e.style.setProperty(_E(t),CE(t,n))}function EE(e,t,n){new Set([...Object.keys(t),...Object.keys(n)]).forEach(r=>{if(uE.has(r)||!gE(r)||mE(r,t[r])||mE(r,n[r]))return;let i=t[r],a=n[r];if(i===a)return;let o=hE(r);if(a==null||a===!1){bE(r)&&SE(e,r),e.removeAttribute(o);return}if(a===!0){bE(r)&&xE(e,r,!0),e.setAttribute(o,``);return}if(bE(r)){xE(e,r,a);return}e.setAttribute(o,String(a))})}function DE(e,t,n){if(t!==n){if(n){e.className=n;return}e.removeAttribute(`class`)}}function OE(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){wE(e,t);return}TE(e,t,a)}})}function kE(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(!mE(t,n))return;let{eventName:i,options:a}=vE(t),o=t=>{n(yE(e,t))};e.addEventListener(i,o,a),r.push({eventName:i,listener:o,options:a})}),r}function AE(e,t){let n=(0,Q.useRef)({}),r=(0,Q.useRef)([]);sE(()=>{let i=n.current;return DE(e,i.className,t.className),OE(e,i.style,t.style),EE(e,i,t),r.current=kE(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 jE=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)(oE(e,`bubbleMenu`)).current;AE(d.current,l),typeof u==`function`?u(d.current):u&&(u.current=d.current);let{editor:p}=z(),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=rE({...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,gd.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)(oE(e,`floatingMenu`)).current;AE(u.current,c),typeof l==`function`?l(u.current):l&&(l.current=u.current);let{editor:f}=z(),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=aE({...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,gd.createPortal)(s,u.current)});var ME=[{name:`paragraph`,label:`Text`,icon:lf,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:M,isActive:e=>e.isActive(`heading`,{level:2}),command:e=>e.chain().focus().toggleHeading({level:2}).run()},{name:`heading3`,label:`Heading 3`,icon:Tt,isActive:e=>e.isActive(`heading`,{level:3}),command:e=>e.chain().focus().toggleHeading({level:3}).run()},{name:`bulletList`,label:`Bullet List`,icon:pe,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:ue,isActive:e=>e.isActive(`list`,{ordered:!0}),command:e=>e.chain().focus().toggleOrderedList().run()},{name:`taskList`,label:`Task List`,icon:D,isActive:e=>e.isActive(`listItem`,{checked:!0})||e.isActive(`listItem`,{checked:!1}),command:e=>e.chain().focus().toggleTaskList().run()},{name:`blockquote`,label:`Quote`,icon:ie,isActive:e=>e.isActive(`blockquote`),command:e=>e.chain().focus().toggleBlockquote().run()},{name:`codeBlock`,label:`Code Block`,icon:bf,isActive:e=>e.isActive(`codeBlock`),command:e=>e.chain().focus().toggleCodeBlock({language:`js`}).run()}];function NE(e){let t=(0,$.c)(18),{editor:n}=e,r;t[0]===n?r=t[1]:(r={editor:n,selector:PE},t[0]=n,t[1]=r);let{current:i,activeStates:a}=K(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)(Wi,{className:`size-3 opacity-50`}),t[6]=l):l=t[6];let u;t[7]!==s||t[8]!==c?(u=(0,Z.jsx)(hc,{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=ME.map(e=>{let t=e.icon,r=a[e.name];return(0,Z.jsxs)(_c,{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)(yc,{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)(Tc,{children:[u,f]}),t[15]=u,t[16]=f,t[17]=p):p=t[17],p}function PE(e){let t=Object.fromEntries(ME.map(t=>[t.name,t.isActive(e.editor)]));return{current:ME.find(e=>t[e.name])??ME[0],activeStates:t}}var FE=`open-knowledge:active-terminal-input`;function IE(e,t=typeof window>`u`?new EventTarget:window){t.dispatchEvent(new CustomEvent(FE,{detail:e}))}function LE(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(FE,n),()=>t.removeEventListener(FE,n)}function RE(e){if(!(e instanceof HTMLElement))return!1;let t=e.tagName.toUpperCase();return t===`INPUT`||t===`TEXTAREA`||t===`SELECT`}function zE(e){let t=(0,$.c)(3),{editor:n,shortcutEnabled:r}=e,i=r===void 0?!1:r;if(da())return null;let a;return t[0]!==n||t[1]!==i?(a=(0,Z.jsx)(BE,{editor:n,shortcutEnabled:i}),t[0]=n,t[1]=i,t[2]=a):a=t[2],a}function BE(e){let t=(0,$.c)(11),{editor:n,shortcutEnabled:r}=e,i;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(i=jr(),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&&kl(e,`edit-with-ai`)&&(RE(e.target)||(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation(),cu()))};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)(Ja,{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=wt(n),t=_u(n);requestAnimationFrame(()=>{if(e===null||t.trim()===``){cu();return}IE(qr({relativePath:ra(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)(ns,{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 VE(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 HE(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:Fe(typeof n.src==`string`?n.src:``)}function UE(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 WE(e){let t=(0,$.c)(13),{editor:n}=e,{_:r}=$t(),i;if(t[0]===n?i=t[1]:(i={editor:n,selector:GE},t[0]=n,t[1]=i),K(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=VE(n);t&&UE(t,HE(n))},t[4]=n,t[5]=o);let s;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Z.jsx)(go,{className:`size-3.5`}),t[6]=s):s=t[6];let c;t[7]!==a||t[8]!==o?(c=(0,Z.jsx)(Ts,{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)(Es,{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)(Os,{children:[c,l]})}),t[11]=c,t[12]=u),u}function GE(e){return VE(e.editor)}function KE(e){return VE(e)!==null}function qE(e){let t=e.schema.nodes;return!!(t.footnoteReference&&t.footnoteDefinition)}function JE(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 YE(e){let{$from:t,$to:n}=e.state.selection;return!t.sameParent(n)}function XE(e){let t=(0,$.c)(21),{editor:n}=e,{_:r}=$t(),i;t[0]===n?i=t[1]:(i={editor:n,selector:ZE},t[0]=n,t[1]=i);let a=K(i),o;t[2]!==a||t[3]!==n?(o=()=>{if(a||!qE(n)||n.state.selection.empty||YE(n)||JE(n))return;let{from:e,to:t}=n.state.selection,r=n.state.doc.textBetween(e,t,` `);if(!r.trim())return;let i=ai(vr(n.state.doc)),o=Fr(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)(A,{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)(Ts,{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)(Es,{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)(Os,{children:[d,p]}),t[18]=d,t[19]=p,t[20]=m):m=t[20],m}function ZE(e){let t=e.editor;return!!(!qE(t)||t.state.selection.empty||YE(t)||JE(t))}var QE=`img, .ok-embed, .ok-video`,$E=220,eD=`cubic-bezier(0.23, 1, 0.32, 1)`,tD=`ok-image-align-flip`,nD=.5;function rD(){return typeof window>`u`||typeof window.matchMedia!=`function`?!1:window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}function iD(){return typeof requestAnimationFrame==`function`}function aD(e){return e?e.querySelector(QE):null}function oD(e,t){if(rD()||!iD()){t();return}let n=aD(e);if(!n){t();return}let r=n.getBoundingClientRect().left;t(),requestAnimationFrame(()=>{let t=aD(e);if(!t)return;for(let e of t.getAnimations())e.id===tD&&e.cancel();let n=r-t.getBoundingClientRect().left;if(Math.abs(n)<nD)return;let i=t.animate([{transform:`translateX(${n}px)`},{transform:`translateX(0)`}],{duration:$E,easing:eD,fill:`none`});i.id=tD})}var sD=[{value:`left`,label:`Align left`,icon:jf},{value:`center`,label:`Align center`,icon:kf},{value:`right`,label:`Align right`,icon:Af}];function cD(e){let t=e.state.selection.node;if(!t||t.type.name!==`jsxComponent`)return null;let n=t.attrs.componentName;if(!Bt.has(String(n)))return null;let r=(t.attrs.props??{}).align;return r===`left`||r===`right`||r===`center`?r:`center`}function lD(e){let t=(0,$.c)(7),{editor:n}=e,r;t[0]===n?r=t[1]:(r={editor:n,selector:uD},t[0]=n,t[1]=r);let i=K(r);if(i===null)return null;let a;t[2]!==i||t[3]!==n?(a=sD.map(e=>{let{value:t,label:r,icon:a}=e,o=i===t;return(0,Z.jsxs)(Os,{children:[(0,Z.jsx)(Ts,{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(!Bt.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(Or.create(u.doc,s)),oD(n.view.nodeDOM(s),()=>{n.view.dispatch(u)})},children:(0,Z.jsx)(a,{className:`size-3.5`})})}),(0,Z.jsx)(Es,{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 uD(e){return cD(e.editor)}function dD(e){return cD(e)!==null}var fD=[{name:`bold`,icon:md,command:e=>e.chain().focus().toggleBold().run(),isActive:e=>e.isActive(`strong`),shortcutId:`format-bold`},{name:`italic`,icon:Wd,command:e=>e.chain().focus().toggleItalic().run(),isActive:e=>e.isActive(`emphasis`),shortcutId:`format-italic`},{name:`underline`,icon:Pf,command:e=>e.chain().focus().toggleUnderline().run(),isActive:e=>e.isActive(`underline`),shortcutId:`format-underline`},{name:`strikethrough`,icon:Ef,command:e=>e.chain().focus().toggleStrike().run(),isActive:e=>e.isActive(`strike`),shortcutId:`format-strike`},{name:`code`,icon:gt,command:e=>e.chain().focus().toggleCode().run(),isActive:e=>e.isActive(`code`),shortcutId:`format-inline-code`},{name:`highlight`,icon:Hd,command:e=>e.chain().focus().toggleHighlight().run(),isActive:e=>e.isActive(`highlight`),shortcutId:`format-highlight`}];function pD(e){let t=(0,$.c)(7),{editor:n}=e,r;t[0]===n?r=t[1]:(r={editor:n,selector:mD},t[0]=n,t[1]=r);let i=K(r),a;t[2]!==i||t[3]!==n?(a=fD.map(e=>{let t=e.icon,r=i[e.name];return(0,Z.jsxs)(Os,{children:[(0,Z.jsx)(Ts,{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)(Es,{side:`bottom`,sideOffset:8,children:[(0,Z.jsx)(`span`,{className:`capitalize`,children:e.name}),(0,Z.jsx)(P,{"aria-label":Al(e.shortcutId),children:Ol(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 mD(e){return Object.fromEntries(fD.map(t=>[t.name,t.isActive(e.editor)]))}function hD(e){let t=(0,$.c)(66),{editor:n}=e,{_:r}=$t(),[i,a]=(0,Q.useState)(!1),[o,s]=(0,Q.useState)(``),c=(0,Q.useRef)(null),{folderPaths:l,loading:u,pages:d}=Yi(),f;t[0]===n?f=t[1]:(f=n.state.selection.empty&&n.isActive(`link`),t[0]=n,t[1]=f);let p=f,m;t[2]===n?m=t[3]:(m=n.getAttributes(`link`).href??``,t[2]=n,t[3]=m);let h=m,g;t[4]===n?g=t[5]:(g=function(){return n.state.selection.empty&&n.isActive(`link`)?n.getAttributes(`link`).href??``:``},t[4]=n,t[5]=g);let _=g,v,y;t[6]===n?(v=t[7],y=t[8]):(v=()=>{let e=function(){n.state.selection.empty&&a(!1)};return n.on(`selectionUpdate`,e),()=>{n.off(`selectionUpdate`,e)}},y=[n],t[6]=n,t[7]=v,t[8]=y),(0,Q.useEffect)(v,y);let b,x;t[9]===i?(b=t[10],x=t[11]):(b=()=>{i&&requestAnimationFrame(()=>c.current?.focus())},x=[i],t[9]=i,t[10]=b,t[11]=x),(0,Q.useEffect)(b,x);let S;t[12]!==n||t[13]!==p||t[14]!==o?(S=function(){o.trim()?n.chain().focus().setLink({href:o.trim()}).run():p&&n.chain().focus().unsetLink().run(),a(!1)},t[12]=n,t[13]=p,t[14]=o,t[15]=S):S=t[15];let C=S,w;t[16]===n?w=t[17]:(w=function(){n.chain().focus().unsetLink().run(),a(!1)},t[16]=n,t[17]=w);let T=w,E;t[18]===Symbol.for(`react.memo_cache_sentinel`)?(E=function(e){s(re(e.path,null))},t[18]=E):E=t[18];let D=E,O;t[19]!==C||t[20]!==n?(O=function(e){e.key===`Enter`&&(e.preventDefault(),C()),e.key===`Escape`&&(e.preventDefault(),a(!1),n.chain().focus().run())},t[19]=C,t[20]=n,t[21]=O):O=t[21];let k=O;if(i){let e;t[22]===r?e=t[23]:(e=r({id:`ZsGpr_`}),t[22]=r,t[23]=e);let n;t[24]===r?n=t[25]:(n=r({id:`roAe2K`}),t[24]=r,t[25]=n);let i;t[26]!==l||t[27]!==k||t[28]!==u||t[29]!==d||t[30]!==e||t[31]!==n||t[32]!==o?(i=(0,Z.jsx)(at,{ref:c,type:`text`,placeholder:e,value:o,pages:d,folderPaths:l,loading:u,onValueChange:s,onSuggestionSelect:D,onKeyDown:k,"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[26]=l,t[27]=k,t[28]=u,t[29]=d,t[30]=e,t[31]=n,t[32]=o,t[33]=i):i=t[33];let a;t[34]===r?a=t[35]:(a=r({id:`tP5DDk`}),t[34]=r,t[35]=a);let f;t[36]===C?f=t[37]:(f=()=>{C()},t[36]=C,t[37]=f);let m;t[38]===Symbol.for(`react.memo_cache_sentinel`)?(m=(0,Z.jsx)(Dd,{className:`size-3.5 shrink-0 text-muted-foreground`}),t[38]=m):m=t[38];let g;t[39]!==a||t[40]!==f?(g=(0,Z.jsx)(X,{variant:`ghost`,size:`icon-xs`,"aria-label":a,onClick:f,children:m}),t[39]=a,t[40]=f,t[41]=g):g=t[41];let _;t[42]!==i||t[43]!==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:[i,g]}),t[42]=i,t[43]=g,t[44]=_):_=t[44];let v;t[45]!==r||t[46]!==h||t[47]!==p||t[48]!==T?(v=p&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(Os,{children:[(0,Z.jsx)(Ts,{asChild:!0,children:(0,Z.jsx)(X,{variant:`ghost`,size:`icon-xs`,"aria-label":r({id:`2vIPtm`}),onMouseDown:e=>{e.preventDefault(),Xt(h)},children:(0,Z.jsx)(Mi,{className:`size-3.5`})})}),(0,Z.jsx)(Es,{side:`bottom`,sideOffset:8,children:(0,Z.jsx)(J,{id:`2vIPtm`})})]}),(0,Z.jsxs)(Os,{children:[(0,Z.jsx)(Ts,{asChild:!0,children:(0,Z.jsx)(X,{variant:`ghost`,size:`icon-xs`,"aria-label":r({id:`484LKL`}),onMouseDown:e=>{e.preventDefault(),T()},children:(0,Z.jsx)(To,{className:`size-3.5`})})}),(0,Z.jsx)(Es,{side:`bottom`,sideOffset:8,children:(0,Z.jsx)(J,{id:`484LKL`})})]})]}),t[45]=r,t[46]=h,t[47]=p,t[48]=T,t[49]=v):v=t[49];let y;return t[50]!==_||t[51]!==v?(y=(0,Z.jsxs)(`div`,{className:`flex items-center gap-0.5`,children:[_,v]}),t[50]=_,t[51]=v,t[52]=y):y=t[52],y}let A;t[53]===r?A=t[54]:(A=r({id:`p0Iq25`}),t[53]=r,t[54]=A);let j=p?`bg-accent text-primary`:`text-accent-foreground`,M;t[55]===_?M=t[56]:(M=e=>{e.preventDefault(),s(_()),a(!0)},t[55]=_,t[56]=M);let N;t[57]===Symbol.for(`react.memo_cache_sentinel`)?(N=(0,Z.jsx)(Kd,{className:`size-3.5`}),t[57]=N):N=t[57];let F;t[58]!==A||t[59]!==j||t[60]!==M?(F=(0,Z.jsx)(Ts,{asChild:!0,children:(0,Z.jsx)(X,{variant:`ghost`,size:`icon-xs`,"aria-label":A,className:j,onMouseDown:M,children:N})}),t[58]=A,t[59]=j,t[60]=M,t[61]=F):F=t[61];let I;t[62]===Symbol.for(`react.memo_cache_sentinel`)?(I=(0,Z.jsx)(J,{id:`yzF66j`}),t[62]=I):I=t[62];let L;t[63]===Symbol.for(`react.memo_cache_sentinel`)?(L=(0,Z.jsxs)(Es,{side:`bottom`,sideOffset:8,children:[I,(0,Z.jsx)(P,{children:Ol(`command-palette`)})]}),t[63]=L):L=t[63];let R;return t[64]===F?R=t[65]:(R=(0,Z.jsxs)(Os,{children:[F,L]}),t[64]=F,t[65]=R),R}function gD({editor:e}){if(Ze(e.state).query||e.isActive(`codeBlock`))return!1;if(dD(e)||KE(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 _D(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:SD},t[0]=n,t[1]=l);let u=K(l),d;t[2]===n?d=t[3]:(d={editor:n,selector:xD},t[2]=n,t[3]=d);let f=K(d),p;t[4]!==n.state||t[5]!==n.view?(p=()=>{try{let{from:e,to:t}=n.state.selection;return ti(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=ks(e,t,()=>{Ps(e,t,{placement:`top`,strategy:`fixed`,middleware:[Ls(8),zs(),Fs({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(yD)},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)(lD,{editor:n},`${o}-img-align`):f?(0,Z.jsx)(WE,{editor:n},`${o}-file`):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(NE,{editor:n}),(0,Z.jsx)(Ja,{orientation:`vertical`,className:`mx-0.5 h-5 data-vertical:self-center`}),(0,Z.jsx)(pD,{editor:n},o),(0,Z.jsx)(Ja,{orientation:`vertical`,className:`mx-0.5 h-5 data-vertical:self-center`}),(0,Z.jsx)(hD,{editor:n},`${o}-link`),(0,Z.jsx)(XE,{editor:n},`${o}-footnote`),(0,Z.jsx)(zE,{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)(jE,{ref:a,editor:n,"data-testid":`bubble-menu-bar`,appendTo:vD,shouldShow:gD,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 vD(){return document.body}function yD(e){return e+1}function bD(){}function xD(e){return KE(e.editor)}function SD(e){return dD(e.editor)}var CD=56,wD=`0 2px 4px rgba(0, 0, 0, 0.08)`,TD=150,ED=globalThis.ScrollTimeline;function DD(e,t,n,r,i){let a=r-i;if(a<=0)return null;let o=e+n-(t+CD);return{startOffset:o,endOffset:o+a,maxShift:a}}var OD=new WeakMap;function kD(e){let t=OD.get(e);if(t){for(let e of t.animations)e.cancel();OD.delete(e)}}function AD(e){for(let t of Array.from(e.cells))kD(t)}var jD=e=>e.cellIndex===0?`3`:`2`;function MD(e,t){return ND(e,t,e=>({transform:`translateY(${e}px)`}))}function ND(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 PD(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 FD(e,t,n){return PD(e,t,{zIndex:`auto`,boxShadow:`none`},{zIndex:n,boxShadow:wD})}function ID(e,t){return PD(e,t,{opacity:`0`},{opacity:`1`})}function LD(e,t,n,r){let i=jD(e),a=`sd|${n.startOffset}|${n.maxShift}|${r}|${i}`,o=OD.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(MD(n,r),s),l=e.animate(FD(n,r,i),s),u=e.animate(ID(n,r),{...s,pseudoElement:`::before`});OD.set(e,{key:a,animations:[c,l,u]})}function RD(e,t){let n=jD(e),r=`in|${t}|${n}`,i=OD.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`});OD.set(e,{key:r,animations:[a,o]})}function zD(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=DD(a,i,c.top,c.height,l.height);if(!u){AD(s);continue}if(n){if(o<=0){AD(s);continue}for(let e of Array.from(s.cells))LD(e,n,u,o);continue}let d=Math.max(0,Math.min(a-u.startOffset,u.maxShift));if(d<=0||c.bottom<=i+CD){AD(s);continue}for(let e of Array.from(s.cells))RD(e,d)}}var BD=pr.create({name:`frozenTableHeaders`,addProseMirrorPlugins(){return[new Mr({key:new Zr(`frozenTableHeaders`),view(e){let t=null,n=null,r=null,i=null,a=null,o=!1,s=new Set,c=()=>{o||!t||zD(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()},TD);return}l()};return requestAnimationFrame(()=>{if(!o){if(t=e.dom.closest(`[data-testid="editor-scroll-container"]`),t&&ED)try{n=new ED({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`))AD(t)}}}})]}});function VD(e,t){return(n,r)=>{let i=r,a=xu(i.dataTransfer);return a?(i.preventDefault(),t?.(a),!0):e(n,i)}}function HD(e,t){let n=yu(e);t(n.target,{tabBehavior:`append`}),tl(n.hash)}var UD=5,WD=1;function GD(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)<UD)return;t.isDragging=!0,m(!0),document.body.style.cursor=`grabbing`,document.body.style.userSelect=`none`}let n=KD(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?XD(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 KD(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:WD,rect:JD(a,qD(e,0,n.top))};if(r<=n.bottom){let i=r>=n.top+n.height/2,o=i?t+1:t,s=Math.max(WD,o);return{index:s,rect:JD(a,s===o?i?n.bottom:n.top:qD(e,0,n.top))}}}let t=e[e.length-1].getBoundingClientRect();return{index:e.length,rect:JD(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:YD(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:YD(a,i)}}}let c=s[s.length-1].getBoundingClientRect();return{index:s.length,rect:YD(a,c.right)}}function qD(e,t,n){let r=e[t];return r?r.getBoundingClientRect().bottom:n}function JD(e,t){return{left:e.left,top:t-1,width:e.width,height:2}}function YD(e,t){return{left:t-1,top:e.top,width:2,height:e.height}}function XD(e,t,n,r){let i=n===`row`?ZD(t):t.cellIndex;if(i<0||n===`row`&&(i<WD||r<WD)||r===i||r===i+1)return;let{state:a,view:o}=e,s=QD(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;tO(l,s,c,n===`row`?$D(c,i,r):eO(c,i,r)),o.dispatch(l)}function ZD(e){let t=e.parentElement,n=t?.closest(`table`);return n?Array.prototype.indexOf.call(n.rows,t):-1}function QD(e){for(let t=e.depth;t>0;t--)if(e.node(t).type.spec.tableRole===`table`)return e.before(t);return-1}function $D(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 eO(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 tO(e,t,n,r){e.replaceRangeWith(t,t+n.nodeSize,r)}function nO(e){return[...e?[{label:`Toggle header column`,icon:Td,run:e=>e.chain().focus().toggleHeaderColumn().run()}]:[],{label:`Insert column left`,icon:Rt,run:e=>e.chain().focus().addColumnBefore().run()},{label:`Insert column right`,icon:lt,run:e=>e.chain().focus().addColumnAfter().run()},{label:`Delete column`,icon:To,separatorBefore:!0,run:e=>e.chain().focus().deleteColumn().run()},{label:`Delete table`,icon:zd,run:e=>e.chain().focus().deleteTable().run()}]}function rO(e){return[...e?[{label:`Toggle header row`,icon:Df,run:e=>e.chain().focus().toggleHeaderRow().run()}]:[],{label:`Insert row above`,icon:Pe,run:e=>e.chain().focus().addRowBefore().run()},{label:`Insert row below`,icon:Re,run:e=>e.chain().focus().addRowAfter().run()},{label:`Delete row`,icon:To,separatorBefore:!0,run:e=>e.chain().focus().deleteRow().run()},{label:`Delete table`,icon:zd,run:e=>e.chain().focus().deleteTable().run()}]}function iO(e){if(!e.isEditable||Ze(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 aO(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=GD(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 ks(r,e,()=>{Ps(r,e,{strategy:`absolute`,placement:t,middleware:[Ls(n)]}).then(t=>{let{x:n,y:r}=t;e.style.left=`${n}px`,e.style.top=`${r}px`,e.style.opacity=`1`}).catch(oO)})},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`?kd:ro,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)(hc,{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)(Ac,{}),(0,Z.jsxs)(_c,{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)(yc,{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)(Tc,{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 oO(){}function sO(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=iO(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=nO(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)(aO,{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=rO(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)(aO,{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 cO(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=T.getState(e.state)?.binding;if(!t){wl.count(`ok/editor/walk-currency-disarmed`,{docName:n,reason:`no-binding`}),s(`no ySync binding on "${n}"`);return}if(typeof t._forceRerender!=`function`){wl.count(`ok/editor/walk-currency-disarmed`,{docName:n,reason:`no-force-rerender`}),s(`ySync binding on "${n}" exposes no _forceRerender`);return}wl.count(`ok/editor/pattern-d-stale-prewarm`,{docName:n}),t._forceRerender()};return pr.create({name:`walkCurrency`,onBeforeCreate(){t.observeDeep(o),i=!0},onDestroy(){c()},addProseMirrorPlugins(){return[new Mr({view:e=>(a||(a=!0,c(),r&&l(e)),{})})]}})}var lO=new WeakMap;function uO(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=oi(e.color),n.textContent=e.name,t.append(n),t}var dO={state:`idle`,count:0,lastFiredAt:null,position:`append`,lastAgentId:null},fO=100,pO=100,mO=3,hO=250;function gO(e){return`contentComponent`in e&&`isEditorContentInitialized`in e}function _O(e,t){let n=he(e);if(!n||t.contains(n.dom))return!1;if(!gO(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 vO(){let e=new Xn({extensions:li});return{mdManager:e,text:He({mdManager:e}),html:o({mdManager:e}),paste:kt({mdManager:e}),drop:_t({mdManager:e})}}function yO(e,t){return t?{collaboration:nt.configure({document:e.document,ySyncOptions:{mapping:t}}),guard:[cO({fragment:e.document.getXmlFragment(`default`),docName:e.configuration.name??``})]}:{collaboration:nt.configure({document:e.document}),guard:[]}}function bO(e){let{provider:t,placeholder:n,prebuiltMapping:r,onWedged:i}=e,{collaboration:a,guard:o}=yO(t,r);return[...St.map(e=>e.name===`link`||e.name===`wikiLink`||e.name===`jsxComponent`?e.configure({docName:t.configuration.name??``}):e),gx.configure({placeholder:n??`Type '/' for commands`,showOnlyCurrent:!0}),a,pr.create({name:`imageUploadDecoration`,addProseMirrorPlugins(){return[ze]}}),pr.create({name:`collaborationCursor`,addProseMirrorPlugins(){let e=t.awareness;if(!e)throw Error(`[TiptapEditor] HocuspocusProvider has no awareness instance — cursor plugin cannot initialize`);return[_e(e,{cursorBuilder:uO})]}}),pr.create({name:`bindingStalenessGuard`,addProseMirrorPlugins(){return[eE({fragment:t.document.getXmlFragment(`default`),docName:t.configuration.name??``,onWedged:i??(()=>{})})]}}),...o,BD]}function xO(e){let{provider:t,clipboard:n,ctorStart:r}=e;return{onBeforeCreate:({editor:e})=>{lO.set(e,r)},onCreate:({editor:e})=>{n.html.setView(e.view);let r=lO.get(e);if(lO.delete(e),r==null)return;let i=performance.now();wl(`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:VD(n.drop,e.onSidebarDrop)},extensions:HT(bO(e))}}function SO(e){let{provider:t,placeholder:n,clipboard:r,ctorStart:i,onWedged:a,onSidebarDrop:o}=e,s=t.document.getXmlFragment(`default`),c=new Map,l=xO({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}=de(s,t.schema);r.forEach((e,t)=>{c.set(t,e)}),t.options.content=n.toJSON()},element:null}}var CO=e=>{let t=(0,$.c)(24),{provider:n,placeholder:r,isSourceMode:i,portalTarget:a}=e,o=(0,Q.useRef)(null),s=(0,Q.useRef)(dO),c=WT(),{principal:l,activeDocName:u,recycleDocument:d,openTarget:f}=mt(),m=n.configuration.name??``,[h]=(0,Q.useState)(vO),g;t[0]!==h||t[1]!==m||t[2]!==f||t[3]!==r||t[4]!==n||t[5]!==d?(g=()=>()=>({editor:new Ln(SO({provider:n,placeholder:r,clipboard:h,ctorStart:performance.now(),onWedged:e=>{let{externalSeq:t,appliedSeq:n}=e;wl(`ok/editor/binding-wedge-recycle`,{docName:m,externalSeq:t,appliedSeq:n}),d(m)},onSidebarDrop:e=>{HD(e,f)}})),ydoc:n.document,ytext:n.document.getText(`source`),provider:n}),t[0]=h,t[1]=m,t[2]=f,t[3]=r,t[4]=n,t[5]=d,t[6]=g):g=t[6];let[_]=(0,Q.useState)(g),v,y;if(t[7]!==_||t[8]!==m||t[9]!==n.document){let e={viewCount:0,bytes:n.document.getText(`source`).length},r=p(m)??crypto.randomUUID();v=Q.use,y=R({docName:m,mountId:r,construct:_,sizeStats:e}),t[7]=_,t[8]=m,t[9]=n.document,t[10]=v,t[11]=y}else v=t[10],y=t[11];let b=v(y),x=b.editor,S,C;t[12]===b?(S=t[13],C=t[14]):(S=()=>()=>{it(b)},C=[b],t[12]=b,t[13]=S,t[14]=C),(0,Q.useEffect)(S,C);let w;return t[15]!==u||t[16]!==m||t[17]!==x||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:m,activeDocName:u,identity:c,principal:l,editor:x,wrapperRef:o,flashStateRef:s,portalTarget:a}),t[15]=u,t[16]=m,t[17]=x,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,y;t[3]!==c||t[4]!==d?(v=()=>{_O(c,d)&&m(TO)},y=[c,d],t[3]=c,t[4]=d,t[5]=v,t[6]=y):(v=t[5],y=t[6]),(0,Q.useEffect)(v,y);let b;t[7]!==c||t[8]!==n.configuration.name?(b=()=>(pt(c,n.configuration.name??null),()=>{pt(c,null)}),t[7]=c,t[8]=n.configuration.name,t[9]=b):b=t[9];let x;t[10]!==c||t[11]!==n?(x=[c,n],t[10]=c,t[11]=n,t[12]=x):x=t[12],(0,Q.useEffect)(b,x);let S;t[13]!==c||t[14]!==n.configuration.name?(S=()=>{let e=n.configuration.name;if(e)return N(e,c),()=>ye(e,c)},t[13]=c,t[14]=n.configuration.name,t[15]=S):S=t[15];let C;t[16]!==c||t[17]!==n?(C=[c,n],t[16]=c,t[17]=n,t[18]=C):C=t[18],(0,Q.useEffect)(S,C);let w;t[19]!==c||t[20]!==n.configuration.name?(w=()=>{let e=n.configuration.name;if(!e)return;let t=null,r=()=>{t=null,tu(e,`wysiwyg`,iu(c)),hu(e,`wysiwyg`,gu(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),tu(e,`wysiwyg`,null),hu(e,`wysiwyg`,null)}},t[19]=c,t[20]=n.configuration.name,t[21]=w):w=t[21];let T;t[22]!==c||t[23]!==n?(T=[c,n],t[22]=c,t[23]=n,t[24]=T):T=t[24],(0,Q.useEffect)(w,T);let E;t[25]!==c||t[26]!==n.configuration.name?(E=()=>{},t[25]=c,t[26]=n.configuration.name,t[27]=E):E=t[27];let D;t[28]!==c||t[29]!==n?(D=[c,n],t[28]=c,t[29]=n,t[30]=D):D=t[30],(0,Q.useEffect)(E,D);let O,k;t[31]===c?(O=t[32],k=t[33]):(O=()=>{let e=EO,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()}},k=[c],t[31]=c,t[32]=O,t[33]=k),(0,Q.useEffect)(O,k);let A,j;t[34]!==i||t[35]!==c?(A=()=>{let e=!1,t=()=>{if(e||c.isDestroyed||!he(c))return;e=!0;let t=B(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})),wl(`ok/editor/selection-restore-failed`,{docName:i,message:n})}G(i)};if(he(c)){t();return}return c.on(`create`,t),()=>{c.off(`create`,t)}},j=[c,i],t[34]=i,t[35]=c,t[36]=A,t[37]=j):(A=t[36],j=t[37]),(0,Q.useEffect)(A,j);let M,P;t[38]!==u||t[39]!==n.document||t[40]!==l?(M=()=>{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)},Fn)};c(dO);let f=()=>{if(Nr(e),!di(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`?di(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)}},P=[n.document,u,l],t[38]=u,t[39]=n.document,t[40]=l,t[41]=M,t[42]=P):(M=t[41],P=t[42]),(0,Q.useEffect)(M,P);let F,I;t[43]!==a||t[44]!==i||t[45]!==c||t[46]!==n?(F=()=>{let e=0,t,r=null,o=null,s=null,l=function(){if(e<fO){e+=1,t=window.setTimeout(p,pO);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=mO,o=()=>{t=void 0,!(i!==a||window.location.hash!==n)&&(d(e),--r,r>0&&(t=window.setTimeout(o,hO)))};t=window.setTimeout(o,hO)};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=pl(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)}},I=[n,c,i,a],t[43]=a,t[44]=i,t[45]=c,t[46]=n,t[47]=F,t[48]=I):(F=t[47],I=t[48]),(0,Q.useEffect)(F,I);let L,R;t[49]===c?(L=t[50],R=t[51]):(L=()=>{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($l,e),()=>window.removeEventListener($l,e)},R=[c],t[49]=c,t[50]=L,t[51]=R),(0,Q.useEffect)(L,R);let z;t[52]!==a||t[53]!==i||t[54]!==o||t[55]!==r||t[56]!==s||t[57]!==n.awareness?(z=()=>{let e=n.awareness;if(e){if(i!==a){e.setLocalState(null);return}e.setLocalState({user:GT({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]=z):z=t[58];let V;t[59]!==a||t[60]!==i||t[61]!==o||t[62]!==r||t[63]!==s||t[64]!==n?(V=[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]=V):V=t[65],(0,Q.useEffect)(z,V);let H,U;t[66]!==c||t[67]!==r?(H=()=>(_(c,r),()=>{_(c,!1)}),U=[c,r],t[66]=c,t[67]=r,t[68]=H,t[69]=U):(H=t[68],U=t[69]),(0,Q.useEffect)(H,U);let W;t[70]!==a||t[71]!==i||t[72]!==c||t[73]!==r?(W=!r&&(0,Z.jsx)(_D,{editor:c,shortcutEnabled:i===a}),t[70]=a,t[71]=i,t[72]=c,t[73]=r,t[74]=W):W=t[74];let K;t[75]!==c||t[76]!==r?(K=!r&&(0,Z.jsx)(sO,{editor:c}),t[75]=c,t[76]=r,t[77]=K):K=t[77];let ee;t[78]===Symbol.for(`react.memo_cache_sentinel`)?(ee=(0,Z.jsx)(`div`,{ref:f,style:{display:`contents`}}),t[78]=ee):ee=t[78];let te;t[79]!==c||t[80]!==p?(te=(0,Z.jsx)(ot,{editor:c,className:`tiptap-editor-portal-content h-full`},p),t[79]=c,t[80]=p,t[81]=te):te=t[81];let ne;t[82]!==d||t[83]!==te?(ne=(0,gd.createPortal)(te,d),t[82]=d,t[83]=te,t[84]=ne):ne=t[84];let re;t[85]===c?re=t[86]:(re=(0,Z.jsx)(CT,{editor:c}),t[85]=c,t[86]=re);let ie;t[87]===c?ie=t[88]:(ie=ut(c),t[87]=c,t[88]=ie);let ae;t[89]===ie.store?ae=t[90]:(ae=(0,Z.jsx)(zt,{store:ie.store}),t[89]=ie.store,t[90]=ae);let oe;return t[91]!==W||t[92]!==K||t[93]!==ne||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,K,ee,ne,re,ae]}),t[91]=W,t[92]=K,t[93]=ne,t[94]=re,t[95]=ae,t[96]=l,t[97]=oe):oe=t[97],oe};function TO(e){return e+1}function EO(){return C()}var DO=null;function OO(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={};DO=r;let i=document.documentElement,a=null,o=()=>{if(DO!==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(),DO===r&&(DO=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 kO=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 AO(e,t,n,r,i,a){if(e==r)return[];let o=BO(e,t,n,r,i,a),s=VO(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 kO(t,n,i,a)];if(c>l){let o=e.slice(t,n).indexOf(r.slice(i,a));if(o>-1)return[new kO(t,t+o,i,i),new kO(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 kO(t,t,i,i+o),new kO(n,n,i+o+c,a)]}if(c==1||l==1)return[new kO(t,n,i,a)];let u=UO(e,t,n,r,i,a);if(u){let[o,s,c]=u;return AO(e,t,o,r,i,s).concat(AO(e,o+c,n,r,s+c,a))}return PO(e,t,n,r,i,a)}var jO=1e9,MO=0,NO=!1;function PO(e,t,n,r,i,a){let o=n-t,s=a-i;if(jO<1e9&&Math.min(o,s)>jO*16||MO>0&&Date.now()>MO)return Math.min(o,s)>jO*64?[new kO(t,n,i,a)]:WO(e,t,n,r,i,a);let c=Math.ceil((o+s)/2);IO.reset(c),LO.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:LO,f=d?null:IO;for(let p=0;p<c;p++){if(p>jO||MO>0&&!(p&63)&&Date.now()>MO)return WO(e,t,n,r,i,a);let m=IO.advance(p,o,s,c,d,!1,l)||LO.advance(p,o,s,c,f,!0,u);if(m)return RO(e,t,n,t+m[0],r,i,a,i+m[1])}return[new kO(t,n,i,a)]}var FO=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}},IO=new FO,LO=new FO;function RO(e,t,n,r,i,a,o,s){let c=!1;return!ak(e,r)&&++r==n&&(c=!0),!ak(i,s)&&++s==o&&(c=!0),c?[new kO(t,n,a,o)]:AO(e,t,r,i,a,s).concat(AO(e,r,n,i,s,o))}function zO(e,t){let n=1,r=Math.min(e,t);for(;n<r;)n<<=1;return n}function BO(e,t,n,r,i,a){if(t==n||t==a||e.charCodeAt(t)!=r.charCodeAt(i))return 0;let o=zO(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-+!ak(e,s);o>>=1}else if(i==n||l==a)return i-t;else s=i,c=l}}function VO(e,t,n,r,i,a){if(t==n||i==a||e.charCodeAt(n-1)!=r.charCodeAt(a-1))return 0;let o=zO(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-+!ak(e,s);o>>=1}else if(a==t||l==i)return n-a;else s=a,c=l}}function HO(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;;){ak(e,s)||s++;let u=s+o;if(ak(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=BO(e,u,n,r,i+f+d.length,a),c=VO(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 UO(e,t,n,r,i,a){let o=n-t,s=a-i;if(o<s){let o=UO(r,i,a,e,t,n);return o&&[o[1],o[0],o[2]]}return o<4||s*2<o?null:HO(e,t,n,r,i,a,Math.floor(o/4),-1)}function WO(e,t,n,r,i,a){NO=!0;let o=n-t,s=a-i,c;if(o<s){let s=HO(r,i,a,e,t,n,Math.floor(o/6),50);c=s&&[s[1],s[0],s[2]]}else c=HO(e,t,n,r,i,a,Math.floor(s/6),50);if(!c)return[new kO(t,n,i,a)];let[l,u,d]=c;return AO(e,t,l,r,i,u).concat(AO(e,l+d,n,r,u+d,a))}function GO(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 kO(r.fromA,i.toA,r.fromB,i.toB),e.splice(n--,1))}}function KO(e,t,n){for(;;){GO(n,1);let r=!1;for(let i=0;i<n.length;i++){let a=n[i],o,s;(o=BO(e,a.fromA,a.toA,t,a.fromB,a.toB))&&(a=n[i]=new kO(a.fromA+o,a.toA,a.fromB+o,a.toB)),(s=VO(e,a.fromA,a.toA,t,a.fromB,a.toB))&&(a=n[i]=new kO(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 kO(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 kO(a.fromA+d,a.toA+d,a.fromB+d,a.toB+d),r=!0)}if(!r)break}return n}function qO(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=ek(t,a.fromA,l),f=$O(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 kO(d,d+o,a.fromB-p,a.toB-p),d=a.fromA,f=$O(t,a.toA,c-a.toA)):l>m&&t.slice(a.toA,f)==u.slice(h,h+m)&&(a=e[i]=new kO(f-o,f,a.fromB+m,a.toB+m),f=a.toA,d=ek(t,a.fromA,a.fromA-r)),p=a.fromA-d,m=f-a.toA}if(p||m)a=e[i]=new kO(a.fromA-p,a.toA+m,a.fromB-p,a.toB+m);else if(!o){let t=nk(n,a.fromB,a.toB),r,o=t<0?-1:tk(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=nk(t,a.fromA,a.toA),r,o=n<0?-1:tk(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 GO(e,3),e}var JO;try{JO=RegExp(`[\\p{Alphabetic}\\p{Number}]`,`u`)}catch{}function YO(e){return e>48&&e<58||e>64&&e<91||e>96&&e<123}function XO(e,t){if(t==e.length)return 0;let n=e.charCodeAt(t);return n<192?+!!YO(n):JO?!rk(n)||t==e.length-1?+!!JO.test(String.fromCharCode(n)):JO.test(e.slice(t,t+2))?2:0:0}function ZO(e,t){if(!t)return 0;let n=e.charCodeAt(t-1);return n<192?+!!YO(n):JO?!ik(n)||t==1?+!!JO.test(String.fromCharCode(n)):JO.test(e.slice(t-2,t))?2:0:0}var QO=8;function $O(e,t,n){if(t==e.length||!ZO(e,t))return t;for(let r=t,i=t+n,a=0;a<QO;a++){let t=XO(e,r);if(!t||r+t>i)return r;r+=t}return t}function ek(e,t,n){if(!t||!XO(e,t))return t;for(let r=t,i=t-n,a=0;a<QO;a++){let t=ZO(e,r);if(!t||r-t<i)return r;r-=t}return t}function tk(e,t,n){for(;t!=n;t--)if(e.charCodeAt(t-1)==10)return t;return-1}function nk(e,t,n){for(;t!=n;t++)if(e.charCodeAt(t)==10)return t;return-1}var rk=e=>e>=55296&&e<=56319,ik=e=>e>=56320&&e<=57343;function ak(e,t){return!t||t==e.length||!rk(e.charCodeAt(t-1))||!ik(e.charCodeAt(t))}function ok(e,t,n){let r=n?.override;return r?r(e,t):(jO=(n?.scanLimit??1e9)>>1,MO=n?.timeout?Date.now()+n.timeout:0,NO=!1,KO(e,t,AO(e,0,e.length,t,0,t.length)))}function sk(){return!NO}function ck(e,t,n){return qO(ok(e,t,n),e,t)}var lk=Bl.define({combine:e=>e[0]}),uk=Vl.define(),dk=Bl.define(),fk=Fl.define({create(e){return null},update(e,t){for(let n of t.effects)n.is(uk)&&(e=n.value);for(let n of t.state.facet(dk))e=n(e,t);return e}});function pk(e){let t=e.field(fk,!1);if(!t)return null;let n=e.facet(lk);return{chunks:t,side:n?n.side:null}}var mk=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 _k(ck(e.toString(),t.toString(),n),e,t,0,0,sk())}static updateA(e,t,n,r,i){return xk(bk(e,r,!0,n.length),e,t,n,i)}static updateB(e,t,n,r,i){return xk(bk(e,r,!1,t.length),e,t,n,i)}};function hk(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 gk(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 _k(e,t,n,r,i,a){let o=[];for(let s=0;s<e.length;s++){let c=e[s],[l,u]=hk(c.fromA+r,c.fromB+i,t,n),[d,f]=gk(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]=hk(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]=gk(a.toA+r,a.toB+i,t,n),s++}o.push(new mk(p,l,Math.max(l,d),u,Math.max(u,f),a))}return o}var vk=1e3;function yk(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>vk&&([l,d]=yk(e,a-vk,n,!0)),o<t.length-vk&&([u,f]=yk(e,o+vk,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 xk(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=ck(n.sliceString(d,p),r.sliceString(f,m),i);for(let e of _k(h,n,r,d,f,sk()))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 Sk={scanLimit:500},Ck=Hl.fromClass(class{constructor(e){({deco:this.deco,gutter:this.gutter}=Nk(e))}update(e){(e.docChanged||e.viewportChanged||Tk(e.startState,e.state)||Ek(e.startState,e.state))&&({deco:this.deco,gutter:this.gutter}=Nk(e.view))}},{decorations:e=>e.deco}),wk=Ml.low(Kl({class:`cm-changeGutter`,markers:e=>e.plugin(Ck)?.gutter||Jl.empty}));function Tk(e,t){return e.field(fk,!1)!=t.field(fk,!1)}function Ek(e,t){return e.facet(lk)!=t.facet(lk)}var Dk=Rl.line({class:`cm-changedLine`}),Ok=Rl.mark({class:`cm-changedText`}),kk=Rl.mark({tagName:`ins`,class:`cm-insertedLine`}),Ak=Rl.mark({tagName:`del`,class:`cm-deletedLine`}),jk=new class extends Gl{constructor(){super(...arguments),this.elementClass=`cm-changedLineGutter`}};function Mk(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,Dk),i.add(o,s,n?Ak:kk),a&&a.add(o,o,jk);for(let l=t.iterRange(o,s-1),u=o;!l.next().done;){if(l.lineBreak){u++,i.add(u,u,Dk),a&&a.add(u,u,jk);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,Ok),s<t)c++;else break}u=t}}}function Nk(e){let t=e.state.field(fk),{side:n,highlightChanges:r,markGutter:i,overrideChunk:a}=e.state.facet(lk),o=n==`a`,s=new zl,c=i?new zl: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))&&Mk(n,e.state.doc,o,r,s,c)}return{deco:s.finish(),gutter:c&&c.finish()}}var Pk=class extends jl{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}},Fk=Vl.define({map:(e,t)=>e.map(t)}),Ik=Fl.define({create:()=>Rl.none,update:(e,t)=>{for(let e of t.effects)if(e.is(Fk))return e.value;return e.map(t.changes)},provide:e=>Wl.decorations.from(e)}),Lk=.01;function Rk(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 zk(e,t,n){let r=new zl,i=new zl,a=e.state.field(Ik).iter(),o=t.state.field(Ik).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<-Lk?(l-=n,r.add(s,s,Rl.widget({widget:new Pk(-n),block:!0,side:-1}))):n>Lk&&(u+=n,i.add(c,c,Rl.widget({widget:new Pk(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<Lk?r.add(e.state.doc.length,e.state.doc.length,Rl.widget({widget:new Pk(-p),block:!0,side:1})):p>Lk&&i.add(t.state.doc.length,t.state.doc.length,Rl.widget({widget:new Pk(p),block:!0,side:1}));let m=r.finish(),h=i.finish();Rk(m,e.state.field(Ik))||e.dispatch({effects:Fk.of(m)}),Rk(h,t.state.field(Ik))||t.dispatch({effects:Fk.of(h)})}var Bk=Vl.define({map:(e,t)=>t.mapPos(e)}),Vk=class extends jl{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:Bk.of(n)});let{side:r,sibling:i}=e.state.facet(lk);i&&i().dispatch({effects:Bk.of(Hk(n,e.state.field(fk),r==`a`))})}),t}ignoreEvent(e){return e instanceof MouseEvent}get estimatedHeight(){return 27}get type(){return`collapsed-unchanged-code`}};function Hk(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 Uk=Fl.define({create(e){return Rl.none},update(e,t){e=e.map(t.changes);for(let n of t.effects)n.is(Bk)&&(e=e.update({filter:e=>e!=n.value}));return e},provide:e=>Wl.decorations.from(e)});function Wk({margin:e=3,minSize:t=4}){return Uk.init(n=>Gk(n,e,t))}function Gk(e,t,n){let r=new zl,i=e.facet(lk).side==`a`,a=e.field(fk),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,Rl.replace({widget:new Vk(d),block:!0})),!c)break;o=e.doc.lineAt(Math.min(e.doc.length,i?c.toA:c.toB)).number}return r.finish()}var Kk=Wl.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`}})),qk=Wl.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`}}),Jk=new Ul,Yk=new Ul,Xk=class{constructor(e){this.revertDOM=null,this.revertToA=!1,this.revertToLeft=!1,this.measuring=-1,this.diffConf=e.diffConfig||Sk;let t=[Ml.low(Ck),qk,Kk,Ik,Wl.updateListener.of(e=>{this.measuring<0&&(e.heightChanged||e.viewportChanged)&&!e.transactions.some(e=>e.effects.some(e=>e.is(Fk)))&&this.measure()})],n=[lk.of({side:`a`,sibling:()=>this.b,highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1})];e.gutter!==!1&&n.push(wk);let r=Pl.create({doc:e.a.doc,selection:e.a.selection,extensions:[e.a.extensions||[],Wl.editorAttributes.of({class:`cm-merge-a`}),Yk.of(n),t]}),i=[lk.of({side:`b`,sibling:()=>this.a,highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1})];e.gutter!==!1&&i.push(wk);let a=Pl.create({doc:e.b.doc,selection:e.b.selection,extensions:[e.b.extensions||[],Wl.editorAttributes.of({class:`cm-merge-b`}),Yk.of(i),t]});this.chunks=mk.build(r.doc,a.doc,this.diffConf);let o=[fk.init(()=>this.chunks),Jk.of(e.collapseUnchanged?Wk(e.collapseUnchanged):[])];r=r.update({effects:Vl.appendConfig.of(o)}).state,a=a.update({effects:Vl.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 Wl({state:r,parent:c,root:e.root,dispatchTransactions:e=>this.dispatch(e,this.a)}),this.b=new Wl({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),Nl.empty(e[0].startState.doc.length));this.chunks=t==this.a?mk.updateA(this.chunks,n.newDoc,this.b.state.doc,r,this.diffConf):mk.updateB(this.chunks,this.a.state.doc,n.newDoc,r,this.diffConf),t.update([...e,n.state.update({effects:uk.of(this.chunks)})]);let i=t==this.a?this.b:this.a;i.update([i.state.update({effects:uk.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(lk),o=n?e.gutter!==!1:r.markGutter,s=t?e.highlightChanges!==!1:r.highlightChanges;i.push(Yk.reconfigure([lk.of({side:`a`,sibling:()=>this.b,highlightChanges:s,markGutter:o}),o?wk:[]])),a.push(Yk.reconfigure([lk.of({side:`b`,sibling:()=>this.a,highlightChanges:s,markGutter:o}),o?wk:[]]))}if(r){let t=Jk.reconfigure(e.collapseUnchanged?Wk(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(){zk(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=Zk(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=Zk(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 Zk(e){let t=e.nextSibling;return e.remove(),t}var Qk=new class extends Gl{constructor(){super(...arguments),this.elementClass=`cm-deletedLineGutter`}},$k=Ml.low(Kl({class:`cm-changeGutter`,markers:e=>e.plugin(Ck)?.gutter||Jl.empty,widgetMarker:(e,t)=>t instanceof iA?Qk:null}));function eA(e){let t=typeof e.original==`string`?Ll.of(e.original.split(/\r?\n/)):e.original,n=e.diffConfig||Sk;return[Ml.low(Ck),lA,qk,Wl.editorAttributes.of({class:`cm-merge-b`}),dk.of((e,t)=>{let r=t.effects.find(e=>e.is(tA));return r&&(e=mk.updateA(e,r.value.doc,t.startState.doc,r.value.changes,n)),t.docChanged&&(e=mk.updateB(e,t.state.field(nA),t.newDoc,t.changes,n)),e}),lk.of({highlightChanges:e.highlightChanges!==!1,markGutter:e.gutter!==!1,syntaxHighlightDeletions:e.syntaxHighlightDeletions!==!1,syntaxHighlightDeletionsMaxLength:3e3,mergeControls:e.mergeControls??!0,overrideChunk:e.allowInlineDiffs?hA:void 0,side:`b`}),nA.init(()=>t),e.gutter===!1?[]:$k,e.collapseUnchanged?Wk(e.collapseUnchanged):[],fk.init(e=>mk.build(t,e.doc,n))]}var tA=Vl.define(),nA=Fl.define({create:()=>Ll.empty,update(e,t){for(let n of t.effects)n.is(tA)&&(e=n.value.doc);return e}}),rA=new WeakMap,iA=class extends jl{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 aA(e,t,n){let r=rA.get(t.changes);if(r)return r;let i=Rl.widget({block:!0,side:-1,widget:new iA(r=>{let{highlightChanges:i,syntaxHighlightDeletions:a,syntaxHighlightDeletionsMaxLength:o,mergeControls:s}=e.facet(lk),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(),oA(r,r.posAtDOM(c))},i=e=>{e.preventDefault(),sA(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(nA).sliceString(t.fromA,t.endA),u=a&&e.facet(Yl),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;Il(t,{style:t=>Xl(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 rA.set(t.changes,i),i}function oA(e,t){let{state:n}=e,r=t??n.selection.main.head,i=e.state.field(fk).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(nA);i.fromB!=i.toB&&i.toA<=o.length&&(a+=e.state.lineBreak);let s=Nl.of({from:i.fromA,to:Math.min(o.length,i.toA),insert:a},o.length);return e.dispatch({effects:tA.of({doc:s.apply(o),changes:s}),userEvent:`accept`}),!0}function sA(e,t){let{state:n}=e,r=t??n.selection.main.head,i=n.field(fk).find(e=>e.fromB<=r&&e.endB>=r);if(!i)return!1;let a=n.field(nA).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 cA(e){let t=new zl;for(let n of e.field(fk)){let r=e.facet(lk).overrideChunk&&dA(e,n);t.add(n.fromB,n.fromB,aA(e,n,!!r))}return t.finish()}var lA=Fl.define({create:e=>cA(e),update(e,t){return t.state.field(fk,!1)==t.startState.field(fk,!1)?e:cA(t.state)},provide:e=>Wl.decorations.from(e)}),uA=new WeakMap;function dA(e,t){let n=uA.get(t);if(n!==void 0)return n;n=null;let r=e.field(nA),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(Rl.widget({widget:new fA(t),side:-1}).range(s+n.fromB))}n.fromB<n.toB&&e.push(Ok.range(s+n.fromB,s+n.toB))}i<t.endA-t.fromA-a*2&&(n=e)}return uA.set(t,n),n}var fA=class extends jl{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}},pA=new class extends Gl{constructor(){super(...arguments),this.elementClass=`cm-inlineChangedLineGutter`}},mA=Rl.line({class:`cm-inlineChangedLine`});function hA(e,t,n,r){let i=dA(e,t),a=0;if(!i)return!1;for(let o=e.doc.lineAt(t.fromB);;){for(r&&r.add(o.from,o.from,pA),n.add(o.from,o.from,mA);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 gA=q({settings:{background:`var(--background)`,gutterBackground:`var(--muted)`}}),_A=E({settings:{background:`var(--background)`,gutterBackground:`var(--muted)`}}),vA=Wl.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 yA({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}=$t(),d=s??r,f=(0,Q.useRef)(null),p=(0,Q.useRef)(null),m=(0,Q.useRef)(0),{resolvedTheme:h}=Mn(),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=OO(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`?gA:_A,u=[Wl.editable.of(!1),Pl.readOnly.of(!0)],g=[lu,Zl(),...u,l,Wl.lineWrapping];if(p.current&&=(p.current.destroy(),null),o)p.current=new Wl({doc:d,extensions:g,parent:e}),y(null);else if(a){let i=yA({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 Wl({doc:d,extensions:[lu,Zl(),Wl.editable.of(!1),l,vA,Wl.lineWrapping,eA({original:n,highlightChanges:!0,gutter:!0,mergeControls:i,collapseUnchanged:{margin:3,minSize:4}}),Wl.updateListener.of(e=>{let t=pk(e.state);y(t?t.chunks.length:0)})],parent:e});p.current=a;let o=pk(a.state);y(o?o.chunks.length:0)}else i===`split`?p.current=new Xk({a:{doc:n,extensions:g},b:{doc:d,extensions:g},parent:e,highlightChanges:!0,gutter:!0,collapseUnchanged:{margin:3,minSize:4}}):p.current=new Wl({doc:d,extensions:[...g,eA({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 Wl)||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 Wl)||Se(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`}):Wc._({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,gd.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 xA(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 SA(e,t){return xA(e,`content`,t)}async function CA(e){return xA(e,`mine`)}async function wA(e){return xA(e,`theirs`)}async function TA(e){return xA(e,`delete`)}async function EA(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 DA(e){let t=(0,$.c)(86),{docName:n}=e,{_:r}=$t(),{conflicts:i,loading:a}=Ra(),o;if(t[0]!==i||t[1]!==n){let e;t[3]===n?e=t[4]:(e=e=>$c(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=OO(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),EA(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 SA(c,e);t.ok||hs.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),hs.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(TA),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(CA),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(TA),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 OA(e){let t=(0,$.c)(2),{docName:n,provider:r,children:i}=e;(0,Q.use)(It(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 kA=`__back-nav__`;function AA(e){return e instanceof Me||e instanceof vt||e instanceof De||e instanceof Qe||e instanceof At||e instanceof ee?e.docName:null}function jA(e){return e instanceof Me||e instanceof vt}function MA(e){if(e instanceof Me){let t=e.docName;return{title:Wc._({id:`Jejur6`}),summary:Wc._({id:`jSY41h`,values:{docName:t}})}}if(e instanceof vt){let t=e.docName;return{title:Wc._({id:`V7QxyT`}),summary:Wc._({id:`xG4tb6`,values:{docName:t}})}}if(e instanceof De){let t=e.docName;return{title:Wc._({id:`1di5fu`}),summary:Wc._({id:`PQCdtv`,values:{docName:t}})}}if(e instanceof Qe){let t=e.docName;return{title:Wc._({id:`wvbc1r`}),summary:Wc._({id:`IX7-sq`,values:{docName:t}})}}if(e instanceof At)return{title:Wc._({id:`Gfr4fu`}),summary:Wc._({id:`UW2Fg3`})};if(e instanceof ee){let t=e.docName;return{title:Wc._({id:`vv7kpg`}),summary:Wc._({id:`mdKFEy`,values:{docName:t}})}}let t=e instanceof Error&&e.message?e.message:Wc._({id:`W5A0Ly`});return{title:Wc._({id:`29VNqC`}),summary:t}}function NA(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=MA(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&&jA(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)(mS,{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:()=>{kg(p).then(FA).catch(PA)},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||(st(AA(n)??i),o(a),r(kA))},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 PA(){}function FA(e){e.ok||hs.error(e.message,{id:`server-restart-error`,duration:1/0})}function IA(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)(NA,{...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]===kA){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}: ${MA(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 LA(e){let t=e.document.getText(`source`).toString(),{map:n,parseError:r}=Qr(t);return{map:n,keys:Pr(t),parseError:r}}function RA(e){let t=(0,$.c)(21),{provider:n}=e,r;t[0]===n?r=t[1]:(r=()=>LA(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=Jn(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=Ye(i.map.icon),t[5]=i.map.icon,t[6]=c);let l=c,u;t[7]===i.map.cover?u=t[8]:(u=dt(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)(zA,{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)(BA,{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 zA(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 BA(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 VA=(0,Q.lazy)(async()=>({default:(await n(async()=>{let{ManagedArtifactProperties:e}=await import(`./ManagedArtifactProperties-BHlXkycH.js`);return{ManagedArtifactProperties:e}},__vite__mapDeps([83,1,40,2,41,42,11,43,44,45,46,47,48,49,50,15,16,13,7,17,18,10,3,51,52,36,12,6,4,53,54,55,20,56,57,58,59,31,32,33,34,60,61,62,63,35,64,65,66,72,74,19,84,73,85,86,38,81]),import.meta.url)).ManagedArtifactProperties})),HA=El(`LARGE_DOC_CHAR_THRESHOLD`,5e5);function UA(e){let t=e.threshold??HA;return e.ytextLength>t?{renderSource:e.isSourceMode||e.visitedSource,renderVisual:!e.isSourceMode||e.visitedVisual,isLarge:!0}:{renderSource:!0,renderVisual:!0,isLarge:!1}}function WA(e){return e.hasEmittedFirstToggle||!e.isLarge?!1:e.renderSource&&e.renderVisual}var GA=El(`ACTIVITY_MOUNT_LIMIT`,3);function KA(){return n(()=>import(`./SourceEditor-5neNfhZp.js`),__vite__mapDeps([87,1,40,2,41,42,11,43,44,45,46,47,48,49,50,15,16,13,7,17,18,10,3,51,52,36,12,6,4,53,54,55,20,56,57,58,59,31,32,33,34,60,61,62,63,35,64,65,66,88,21,86,82]),import.meta.url)}var qA=(0,Q.lazy)(async()=>({default:(await KA()).SourceEditor}));function JA(e,t,n){if(n<=0)return[];let r=e.filter(e=>!Ue(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 YA(e,t){return t.kind===`idle`?null:t.kind===`failed`&&t.failedDocNames.includes(e)?{kind:`failed`,title:Wc._({id:`MTs6g3`}),summary:t.reason===`clear-data-timeout`?Wc._({id:`Sc1bKE`,values:{docName:e}}):Wc._({id:`ovIGrT`,values:{docName:e}}),actionLabel:Wc._({id:`HpK_8d`})}:t.kind===`recovering`&&t.docNames.includes(e)?{kind:`recovering`,title:Wc._({id:`cF9DyA`}),summary:t.phase===`clearing-local-cache`?Wc._({id:`bmC18N`,values:{docName:e}}):Wc._({id:`pAgkuZ`,values:{docName:e}})}:null}function XA(e){let t=(0,$.c)(2),n;return t[0]===e?n=t[1]:(n=(0,Z.jsx)(Tl,{name:`activity-pool`,children:(0,Z.jsx)(ZA,{...e})}),t[0]=e,t[1]=n),n}function ZA(e){let t=(0,$.c)(15),{activeDocName:n,isSourceMode:r,editorPlaceholder:i,previousDocName:a,onNavigateBack:o,onRecycle:s}=e,{poolEntries:c,serverRestartRecovery:l}=mt(),{pages:u,loading:d}=Yi(),f=JA(c,n,GA),p=(0,Q.useRef)(``),m=f.map(QA).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)Qt(e);for(let e of i){let t=h.current.find(t=>t.docName===e)?.poolEventId;me(e,t&&t.length>0?t:crypto.randomUUID())}wl(`ok/activity/mount-list-change`,{active:n,mounted:t,evicted:r}),p.current=m,H(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)(ij,{entry:e,isActive:e.docName===n,isSourceMode:r,editorPlaceholder:i,isNewDoc:!d&&!u.has(e.docName)&&!hr(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 QA(e){return e.docName}function $A(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&&wl(`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&&(wl(`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&&wl(`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 ej(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)(Zb,{}),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)(qA,{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 tj(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)(ts,{className:`size-5`,"aria-hidden":`true`}):(0,Z.jsx)($o,{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:nj,children:[(0,Z.jsx)(ts,{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 nj(){return window.location.reload()}function rj(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 ij(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=YA(n.docName,u),t[0]=n.docName,t[1]=u,t[2]=d):d=t[2];let f=d,m=sw(n.docName)===`conflict`,h;t[3]===n.docName?h=t[4]:(h=()=>{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]=h);let[g]=(0,Q.useState)(h),_=n.provider.document.getText(`source`).length,[v,y]=(0,Q.useState)(i),[b,x]=(0,Q.useState)(!i),S,C;t[5]!==i||t[6]!==v||t[7]!==b?(S=()=>{i&&!v?y(!0):!i&&!b&&x(!0)},C=[i,v,b],t[5]=i,t[6]=v,t[7]=b,t[8]=S,t[9]=C):(S=t[8],C=t[9]),(0,Q.useEffect)(S,C);let w=UA({ytextLength:_,isSourceMode:i,visitedSource:v,visitedVisual:b}),T=(0,Q.useRef)(``),E=`${w.isLarge}-${w.renderSource}-${w.renderVisual}`,D,O;t[10]!==n.docName||t[11]!==w.isLarge||t[12]!==w.renderSource||t[13]!==w.renderVisual||t[14]!==E||t[15]!==i||t[16]!==_?(D=()=>{T.current!==E&&(T.current=E,w.isLarge&&wl(`ok/activity/defer-mount`,{docName:n.docName,ytextLength:_,isSourceMode:i,renderSource:w.renderSource,renderVisual:w.renderVisual}))},O=[E,w.isLarge,w.renderSource,w.renderVisual,n.docName,_,i],t[10]=n.docName,t[11]=w.isLarge,t[12]=w.renderSource,t[13]=w.renderVisual,t[14]=E,t[15]=i,t[16]=_,t[17]=D,t[18]=O):(D=t[17],O=t[18]),(0,Q.useEffect)(D,O);let k;t[19]===n.docName?k=t[20]:(k=()=>B(n.docName),t[19]=n.docName,t[20]=k);let[A]=(0,Q.useState)(k),j=A?.html??null,[M,N]=(0,Q.useState)(!1),P,F;t[21]!==n.docName||t[22]!==w.isLarge||t[23]!==w.renderSource||t[24]!==w.renderVisual||t[25]!==M||t[26]!==i||t[27]!==_?(P=()=>{WA({isLarge:w.isLarge,renderSource:w.renderSource,renderVisual:w.renderVisual,hasEmittedFirstToggle:M})&&(wl(`ok/cold/first-toggle`,{docName:n.docName,mountId:p(n.docName),ytextLength:_,modeEnteredFirst:i?`source`:`visual`}),N(!0))},F=[M,w.isLarge,w.renderSource,w.renderVisual,n.docName,_,i],t[21]=n.docName,t[22]=w.isLarge,t[23]=w.renderSource,t[24]=w.renderVisual,t[25]=M,t[26]=i,t[27]=_,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=A?.scrollTop,z;t[30]!==a||t[31]!==n||t[32]!==w.renderSource||t[33]!==w.renderVisual||t[34]!==r||t[35]!==m||t[36]!==o||t[37]!==i||t[38]!==c||t[39]!==l||t[40]!==g||t[41]!==s||t[42]!==f||t[43]!==j?(z=f?(0,Z.jsx)(tj,{view:f}):(0,Z.jsx)(Z.Fragment,{children:(0,Z.jsx)(IA,{activeDocName:n.docName,previousDocName:s,onNavigateBack:c,onRecycle:l,children:(0,Z.jsx)(Q.Suspense,{fallback:j?(0,Z.jsx)(rj,{html:j}):(0,Z.jsx)(Zb,{}),children:(0,Z.jsx)(OA,{docName:n.docName,provider:n.provider,children:m?(0,Z.jsx)(DA,{docName:n.docName,provider:n.provider}):(0,Z.jsxs)(`div`,{className:`flex h-full flex-col`,children:[!i&&(hr(n.docName)||Wt(n.docName)?(0,Z.jsx)(Q.Suspense,{fallback:null,children:(0,Z.jsx)(VA,{docName:n.docName,provider:n.provider})}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(RA,{provider:n.provider}),(0,Z.jsx)(Vi,{provider:n.provider})]})),(0,Z.jsxs)(`div`,{className:`relative flex-1`,children:[w.renderSource?(0,Z.jsx)(`div`,{className:i?`h-full`:`ok-mode-hidden h-full`,children:(0,Z.jsx)(ej,{entry:n,isActive:r,isSourceMode:i,editorPlaceholder:a})}):null,w.renderVisual?(0,Z.jsx)(`div`,{className:i?`ok-mode-hidden h-full`:`h-full`,children:(0,Z.jsx)(CO,{provider:n.provider,placeholder:a,isSourceMode:i,portalTarget:g},`${n.docName}-${String(o)}-${n.poolEventId}`)}):null]})]})})})})}),t[30]=a,t[31]=n,t[32]=w.renderSource,t[33]=w.renderVisual,t[34]=r,t[35]=m,t[36]=o,t[37]=i,t[38]=c,t[39]=l,t[40]=g,t[41]=s,t[42]=f,t[43]=j,t[44]=z):z=t[44];let V;t[45]!==r||t[46]!==R||t[47]!==z?(V=(0,Z.jsx)($A,{isActive:r,initialScrollTop:R,children:z}),t[45]=r,t[46]=R,t[47]=z,t[48]=V):V=t[48];let H;return t[49]!==I||t[50]!==L||t[51]!==V?(H=(0,Z.jsx)(Q.Activity,{mode:I,name:L,children:V}),t[49]=I,t[50]=L,t[51]=V,t[52]=H):H=t[52],H}function aj(e){let t=e.endsWith(`rem`)?`rem`:`px`;return{value:Number.parseFloat(e),unit:t}}function oj(e){let{value:t,unit:n}=aj(e);return n===`rem`?t*16:t}function sj(e,t){return`${t===`rem`?e.toFixed(1):Math.round(e)}${t}`}var cj=3600*24*7;function lj(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?uj:m,O=g===void 0?cj: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=oj(b),te;t[6]===x?te=t[7]:(te=oj(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:oj(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}=aj(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=sj(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=sj(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 uj(){}var dj=3600*24*7,fj=`18rem`,pj=`3rem`,mj=`app-file-sidebar`,hj=`14.625rem`,gj=`32rem`,_j=`sidebar_width`,vj=/^\d+(?:\.\d+)?(?:rem|px)$/,yj=Q.createContext(null);function bj(e){if(typeof document>`u`)return e;let t=document.cookie.split(`; `).find(e=>e.startsWith(`${_j}=`))?.split(`=`)[1];if(!t)return e;let n;try{n=decodeURIComponent(t)}catch{return e}return vj.test(n)?n:e}function xj(){let e=Q.use(yj);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e}function Sj(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?fj:c,[u]=Q.useState(wj),d;t[8]===u?d=t[9]:(d=()=>_w(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=ww();return Ew(`left`,_w(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),Dw(`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(Cj)},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: ${mw}px)`),t=()=>{let e=_w(u,window.innerWidth,`left`);p(e),C(Ew(`left`,e,ww())===`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(mj)?.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=>{kl(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":pj,...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)(yj.Provider,{value:H,children:K}),t[55]=H,t[56]=K,t[57]=ee):ee=t[57],ee}function Cj(e){return!e}function wj(){return kr()}function Tj(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}=$t(),{state:f,isDraggingRail:p}=xj();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:mj,"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 Ej(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}=$t(),{toggleSidebar:o,state:s}=xj(),c,l,u,d,p,m,h,g;if(t[4]!==a||t[5]!==s){let e=Al(`toggle-files-sidebar`);c=X,l=`trigger`,u=`sidebar-trigger`,d=`ghost`,p=`icon-sm`,m=s===`expanded`,h=mj,g=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]=p,t[11]=m,t[12]=h,t[13]=g}else c=t[6],l=t[7],u=t[8],d=t[9],p=t[10],m=t[11],h=t[12],g=t[13];let _;t[14]===n?_=t[15]:(_=Y(n),t[14]=n,t[15]=_);let v;t[16]!==r||t[17]!==o?(v=e=>{r?.(e),o()},t[16]=r,t[17]=o,t[18]=v):v=t[18];let y;t[19]===s?y=t[20]:(y=s===`expanded`?(0,Z.jsx)(f,{}):(0,Z.jsx)(rf,{}),t[19]=s,t[20]=y);let b;return t[21]!==c||t[22]!==i||t[23]!==l||t[24]!==y||t[25]!==u||t[26]!==d||t[27]!==p||t[28]!==m||t[29]!==h||t[30]!==g||t[31]!==_||t[32]!==v?(b=(0,Z.jsx)(c,{"data-sidebar":l,"data-slot":u,variant:d,size:p,"aria-expanded":m,"aria-controls":h,"aria-label":g,className:_,onClick:v,...i,children:y}),t[21]=c,t[22]=i,t[23]=l,t[24]=y,t[25]=u,t[26]=d,t[27]=p,t[28]=m,t[29]=h,t[30]=g,t[31]=_,t[32]=v,t[33]=b):b=t[33],b}function Dj(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}=$t(),{toggleSidebar:u,setWidth:d,state:f,width:p,setIsDraggingRail:m}=xj(),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:hj,maxResizeWidth:gj,setIsDraggingRail:m,widthCookieName:_j,widthCookieMaxAge:dj},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}=lj(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 Oj(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}=xj(),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 kj(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 Aj(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 jj(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 Mj(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 Nj(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?gi:`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 Pj(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?gi:`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 Fj(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 Ij(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 Lj(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 Rj=_i(`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 zj(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?gi:`button`,{state:m}=xj(),h;t[8]!==n||t[9]!==f||t[10]!==d?(h=Y(Rj({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)(Ts,{asChild:!0,children:_}),t[20]=_,t[21]=v);let y=m!==`collapsed`,b;t[22]!==y||t[23]!==c?(b=(0,Z.jsx)(Es,{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)(Os,{children:[v,b]}),t[25]=v,t[26]=b,t[27]=x):x=t[27],x}function Bj(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?gi:`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 Vj(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 Hj(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 Uj(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?gi:`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 Wj(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 Gj(){let e=await fetch(`/api/server-info`,{signal:AbortSignal.timeout(5e3)});if(!e.ok)return null;let t=await e.json(),n=Wr.safeParse(t);return n.success?n.data.currentBranch??null:null}var Kj=typeof window>`u`?{getSnapshot:()=>null,subscribe:()=>()=>{}}:Wj({fetchBranch:Gj,subscribeToEvent:vl}),qj=Kj.subscribe,Jj=Kj.getSnapshot;function Yj(){return(0,Q.useSyncExternalStore)(qj,Jj,Jj)}function Xj(){let e=(0,$.c)(6),t=Yj(),n=$i(),{state:r}=xj(),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&&Pa(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 Zj(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}=$t(),u=Xj();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)(ns,{className:`size-3`,"aria-hidden":!0}),l({id:`xWEvuo`}),(0,Z.jsx)(bt,{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)(Qj,{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 Qj(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)(Os,{children:[(0,Z.jsx)(Ts,{asChild:!0,children:(0,Z.jsx)(`span`,{tabIndex:0,className:`truncate`,"data-testid":`editor-footer-project-name`,children:r})}),(0,Z.jsx)(Es,{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)(Io,{"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 $j(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}=$t(),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 eM(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 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(`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 nM(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 rM(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)(Ki,{}),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 iM=1,aM=2,oM=4;function sM(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=Xr(n),u=e?e.kind===`template`?e.folder.split(`/`).filter(Boolean):[]:h(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>oM?[...u.slice(0,iM).map((e,t)=>d(e,t)),{kind:`ellipsis`,hidden:u.slice(iM,-aM)},...u.slice(-aM).map((e,t)=>d(e,u.length-aM+t))]:u.map((e,t)=>d(e,t));a=$j,t[8]===r?c=t[9]:(c=Y(`flex min-w-0 items-center`,r),t[8]=r,t[9]=c),i=eM,o=`min-w-0 flex-nowrap gap-1 overflow-hidden text-muted-foreground/70 text-xs`,s=f.map(cM)}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 cM(e,t){let n=e.kind===`segment`?e.key:`ellipsis`;return(0,Z.jsxs)(Q.Fragment,{children:[t>0&&(0,Z.jsx)(rM,{className:`shrink-0 text-muted-foreground/70 [&>svg]:size-3`}),e.kind===`ellipsis`?(0,Z.jsxs)(tM,{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)(kd,{className:`size-3.5`})}),(0,Z.jsx)(`span`,{className:`sr-only`,children:e.hidden.join(` / `)})]}):(0,Z.jsx)(tM,{className:`min-w-0`,children:(0,Z.jsx)(nM,{current:!1,className:`min-w-0 truncate font-normal text-muted-foreground/70`,title:e.value,children:e.value})})]},n)}var lM={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`},uM=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`,...lM,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},dM=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)(uM,{...e,viewBox:`0 0 256 256`,fill:`currentColor`,children:[n,r]}),t[2]=e,t[3]=i),i},fM=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)(uM,{...e,viewBox:`0 0 256 256`,fill:`currentColor`,children:[n,r]}),t[2]=e,t[3]=i),i};function pM(e){let t=(0,$.c)(29),{isSourceMode:n,onModeChange:r,sourceDisabled:i}=e,a=i===void 0?!1:i,{_:o}=$t(),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)(Ts,{children:(0,Z.jsx)(fM,{className:`size-4`})}),t[6]=d):d=t[6];let f;t[7]===u?f=t[8]:(f=(0,Z.jsx)(Fc,{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)(Es,{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)(Os,{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)(dM,{className:`size-4`}),t[14]=g):g=t[14];let _;t[15]!==a||t[16]!==h?(_=(0,Z.jsx)(Ts,{asChild:!0,children:(0,Z.jsx)(`div`,{children:(0,Z.jsx)(Fc,{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)(Es,{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)(Os,{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)(Lc,{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 mM=(0,Q.lazy)(async()=>({default:(await n(async()=>{let{SkillEditorActions:e}=await import(`./SkillEditorActions-85awfZeZ.js`);return{SkillEditorActions:e}},__vite__mapDeps([89,1,10,3,11,6,7,13,74,15,16,17,18,12,54,55,19,57,59,33,58,79,75,60,52,63,80,68,36,65]),import.meta.url)).SkillEditorActions}));function hM(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}=$t(),p;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(p=Ol(`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=Al(`toggle-document-panel`),u;t[26]===n?u=t[27]:(u=n?Xr(n):null,t[26]=n,t[27]=u);let p=u,m;t[28]===n?m=t[29]:(m=n?Wt(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)(sM,{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)(pM,{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)(mM,{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)(Os,{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)(Ts,{children:(0,Z.jsx)(Jd,{})})}),(0,Z.jsx)(Es,{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=Os,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)(Ts,{children:c?(0,Z.jsx)(of,{}):(0,Z.jsx)(af,{})}),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)(Es,{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 gM(e){let{activeDocName:t,deferredActiveDocName:n,mountResolved:r,syncResolved:i}=e;return t===null||t===n?!1:!(r&&i)}function _M(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 vM=`ok-terminal-height-v1`,yM=1/3,bM=.5;function xM(e){return Math.max(120,Math.round((Number.isFinite(e)?e:0)*bM))}function SM(e){let t=Number.isFinite(e)?e:0;return t<=0?240:Math.round(t*yM)}function CM(e,t){let n=xM(t);return Number.isFinite(e)?e<120?120:e>n?n:Math.round(e):Math.min(SM(t),n)}function wM(){return typeof window>`u`?0:window.innerHeight}function TM(e,t){try{let n=e??localStorage,r=t??wM(),i=n.getItem(vM);if(i==null)return CM(SM(r),r);let a=Number.parseInt(i,10);return CM(Number.isFinite(a)?a:SM(r),r)}catch{return 240}}function EM(e,t,n){try{let r=t??localStorage,i=n??wM();r.setItem(vM,String(CM(e,i)))}catch{}}function DM(){try{return typeof localStorage>`u`?240:TM()}catch{return 240}}function OM(e){let t=(0,$.c)(19),{dockPosition:n,onReveal:r,className:i}=e,{_:a}=$t(),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)(Gi,{"aria-hidden":`true`}):(0,Z.jsx)(bt,{"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)(Ts,{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)(Es,{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)(Os,{children:[f,m]}),t[16]=f,t[17]=m,t[18]=h):h=t[18],h}var kM=`terminal-dock-panel`;function AM(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}=Mn(),d=Fb(),[f,p]=(0,Q.useState)(!r),m;t[0]===u?m=t[1]:(m=Cu(u),t[0]=u,t[1]=m);let h=m.background,g=r&&l===`bottom`,_=!r&&l===`bottom`&&c!=null,[v]=(0,Q.useState)(jM),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(()=>{EM(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)(OM,{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)(IC,{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)(LC,{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)(IC,{id:kM,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)(FC,{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 jM(){return DM()}var MM=(0,Q.lazy)(async()=>({default:(await n(()=>import(`./ActivityModeContent-DLFbXUxu.js`),__vite__mapDeps([39,1,2,40,41,42,11,43,44,45,46,47,48,49,50,15,16,13,7,17,18,10,3,51,52,36,12,6,4,53,54,55,20,56,57,58,59,31,32,33,34,60,61,62,63,35,64,65,66,67,68]),import.meta.url)).ActivityModeContent})),NM=`300px`,PM=`600px`,FM=new Set([`doc-panel`,`terminal-column`,`agent-panel`]);function IM(e){let t=(0,$.c)(5),n;t[0]===e?n=t[1]:(n=(0,Z.jsx)(RM,{...e}),t[0]=e,t[1]=n);let r;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Z.jsx)(LM,{}),t[2]=r):r=t[2];let i;return t[3]===n?i=t[4]:(i=(0,Z.jsx)(Tl,{name:`editor-area`,children:(0,Z.jsxs)(Ii,{children:[n,r]})}),t[3]=n,t[4]=i),i}function LM(){let e=(0,$.c)(5),t=La(),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)(AC,{open:t.open,onOpenChange:n}),e[2]=t.open,e[3]=n,e[4]=r):r=e[4],r}function RM(e){let t=(0,$.c)(243),{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,p=l===void 0?`right`:l,{_:m}=$t(),{resolvedTheme:h}=Mn(),g;t[0]===h?g=t[1]:(g=Cu(h),t[0]=h,t[1]=g);let _=g.background,{activeDocName:v,activeProvider:y,activeTarget:b,recycleDocument:x,docPanelMode:S,docPanelAgentId:C,docPanelExpandSignal:w}=mt(),{openDocumentTransition:T}=Dt(),{requestAddProperty:E}=Ni(),D=aw(y,v),O=cw(v,n===`source`?`source`:`wysiwyg`),k=Nw(y),A=k===`connected`||k===`synced`,M=sw(v)===`conflict`,[N,P]=(0,Q.useState)(!1),F,I;t[2]!==y||t[3]!==N?(F=()=>{y!=null&&!N&&P(!0)},I=[y,N],t[2]=y,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)(v),R=b?.kind===`missing`,z=!!v&&b?.kind!==`folder`,B;t[6]!==m||t[7]!==R?(B=R?m({id:`K-a33w`}):void 0,t[6]=m,t[7]=R,t[8]=B):B=t[8];let V=B,H=(0,Q.useSyncExternalStore)(Si.subscribe,Si.getSnapshot,Si.getSnapshot),U;t[9]!==b||t[10]!==H?(U=Ei(b,H),t[9]=b,t[10]=H,t[11]=U):U=t[11];let W=U,[G]=(0,Q.useState)(UM),K=G!==null,ee;t[12]===G?ee=t[13]:(ee=()=>_w(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=Fb(),se=Fb(),ce;t[17]===te?ce=t[18]:(ce=()=>Ew(`right`,te,ww())===`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=p===`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)(HM),Fe=(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(()=>{fw(e),Le.current=null},100)},t[29]=Re):Re=t[29];let ze=Re,[Be]=(0,Q.useState)(VM),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(()=>{jw(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=Ab(),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(BM);if(a==null)return;let o={};if(`doc-panel`in r&&(o[`doc-panel`]=e?0:Fe.current),`terminal-column`in r&&(o[`terminal-column`]=Ve.current),Object.keys(o).length===0)return;let s=_M({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?(Dw(`right`,e,`open`),et.current?ot(!1):oe.current?.expand()):(Dw(`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,ht;t[51]!==ot||t[52]!==G||t[53]!==oe?(pt=()=>{let e=window.matchMedia(`(min-width: ${hw}px)`),t=()=>{let e=_w(G,window.innerWidth,`right`);ne(e);let t=Ew(`right`,e,ww())===`collapsed`;ue(t),et.current?ot(t):t?oe.current?.collapse():oe.current?.expand()};return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},ht=[G,oe,ot],t[51]=ot,t[52]=G,t[53]=oe,t[54]=pt,t[55]=ht):(pt=t[54],ht=t[55]),(0,Q.useEffect)(pt,ht);let gt,_t;t[56]!==Xe||t[57]!==K?(gt=()=>{if(Xe==null||K)return;let e=new ResizeObserver(()=>{st.current(de.current)});return e.observe(Xe),()=>e.disconnect()},_t=[Xe,K],t[56]=Xe,t[57]=K,t[58]=gt,t[59]=_t):(gt=t[58],_t=t[59]),(0,Q.useEffect)(gt,_t);let vt,yt;t[60]!==ut||t[61]!==a?(vt=()=>{let e=e=>{a(e),ut()},t=Qm();return t&&e(t),eh(t=>{Qm(),e(t)})},yt=[a,ut],t[60]=ut,t[61]=a,t[62]=vt,t[63]=yt):(vt=t[62],yt=t[63]),(0,Q.useEffect)(vt,yt);let bt,xt;t[64]!==w||t[65]!==ut?(bt=()=>{w!==0&&ut()},xt=[w,ut],t[64]=w,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 Ot,kt;t[75]===q?(Ot=t[76],kt=t[77]):(Ot=()=>{window.okDesktop!=null&&window.okDesktop.editor.notifyViewMenuStateChanged({docPanelVisible:!q})},kt=[q],t[75]=q,t[76]=Ot,t[77]=kt),(0,Q.useEffect)(Ot,kt);let At,jt;t[78]===ft?(At=t[79],jt=t[80]):(At=()=>{if(window.okDesktop!=null)return window.okDesktop.onMenuAction(e=>{e===`toggle-doc-panel`&&ft()})},jt=[ft],t[78]=ft,t[79]=At,t[80]=jt),(0,Q.useEffect)(At,jt);let Mt,Nt;t[81]===ft?(Mt=t[82],Nt=t[83]):(Mt=()=>{if(window.okDesktop!=null)return;let e=e=>{kl(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=b?.kind===`large-file`?b.docName:v,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]===T?Ht=t[88]:(Ht=function(e){let t=fl(e);window.location.hash===t?T(e):window.location.hash=t},t[87]=T,t[88]=Ht);let Ut=Ht,Wt,Gt=null;if(b?.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]!==b.docName||t[93]!==b.limit||t[94]!==b.size||t[95]!==e?(n=(0,Z.jsx)(fC,{docName:b.docName,size:b.size,limit:b.limit,backNav:e}),t[92]=b.docName,t[93]=b.limit,t[94]=b.size,t[95]=e,t[96]=n):n=t[96],Wt=n}else if(b?.kind===`folder`){let e;t[97]!==K||t[98]!==f?(e=yT({terminalVisible:f,isEmbedded:K}),t[97]=K,t[98]=f,t[99]=e):e=t[99];let n=e,r;t[100]===b.folderPath?r=t[101]:(r=(0,Z.jsx)(cC,{folderPath:b.folderPath}),t[100]=b.folderPath,t[101]=r);let i;t[102]!==b.folderPath||t[103]!==n?(i=n?(0,Z.jsx)(oT,{folderPath:b.folderPath}):null,t[102]=b.folderPath,t[103]=n,t[104]=i):i=t[104];let a;if(t[105]!==r||t[106]!==i?(a=(0,Z.jsxs)(`div`,{className:`relative flex h-full min-h-0 flex-col`,children:[r,i]}),t[105]=r,t[106]=i,t[107]=a):a=t[107],Wt=a,S===`agent`&&C!==null){let e;t[108]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(LC,{withHandle:!0}),t[108]=e):e=t[108];let n;t[109]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsxs)(Z.Fragment,{children:[e,(0,Z.jsx)(IC,{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)(MM,{showBackButton:!1})})})]}),t[109]=n):n=t[109],Gt=n}}else if(b?.kind===`asset`){let e;t[110]!==b.assetPath||t[111]!==b.mediaKind?(e=(0,Z.jsx)(Xb,{assetPath:b.assetPath,mediaKind:b.mediaKind},b.assetPath),t[110]=b.assetPath,t[111]=b.mediaKind,t[112]=e):e=t[112],Wt=e}else if(b?.kind===`skill-file`){let e=`${b.scope}/${b.name}/${b.path}`,n;t[113]!==b.name||t[114]!==b.path||t[115]!==b.scope||t[116]!==e?(n=(0,Z.jsx)(xC,{scope:b.scope,name:b.name,path:b.path},e),t[113]=b.name,t[114]=b.path,t[115]=b.scope,t[116]=e,t[117]=n):n=t[117],Wt=n}else if(W){let e;t[118]===W?e=t[119]:(e=(0,Z.jsx)(hC,{nav:W},W.path),t[118]=W,t[119]=e),Wt=e}else if(!y||!v)if((typeof window<`u`?dl(window.location.hash):null)!==null)if(o!=null&&N){let e;t[120]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(Zb,{}),t[120]=e):e=t[120],Wt=e;let n;t[121]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsx)(LC,{withHandle:!0,disabled:!0}),t[121]=n):n=t[121];let r=le?0:`${Pe}px`,i;t[122]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsx)(`div`,{className:`min-h-0 flex-1`}),t[122]=i):i=t[122];let a;t[123]===r?a=t[124]:(a=(0,Z.jsxs)(Z.Fragment,{children:[n,(0,Z.jsx)(IC,{id:`doc-panel`,defaultSize:r,minSize:NM,maxSize:PM,collapsible:!0,collapsedSize:0,inert:!0,className:`flex flex-col bg-muted/20`,children:i})]}),t[123]=r,t[124]=a),Gt=a}else{let e;return t[125]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(Zb,{}),t[125]=e):e=t[125],e}else{let e=f?ye:null,n;t[126]===e?n=t[127]:(n=(0,Z.jsx)(kS,{terminalDock:e}),t[126]=e,t[127]=n),Wt=n}else{let e=n===`source`,o=!A,s=q,c;t[128]!==v||t[129]!==E?(c=function(){v&&E(v)},t[128]=v,t[129]=E,t[130]=c):c=t[130];let l=c,u;t[131]!==v||t[132]!==K||t[133]!==f?(u=vT({terminalVisible:f,isEmbedded:K,activeDocName:v}),t[131]=v,t[132]=K,t[133]=f,t[134]=u):u=t[134];let d=u,p=L??v,m=Ft??void 0,h;t[135]!==V||t[136]!==e||t[137]!==Ut||t[138]!==x||t[139]!==p||t[140]!==m?(h=(0,Z.jsx)(XA,{activeDocName:p,isSourceMode:e,editorPlaceholder:V,previousDocName:m,onNavigateBack:Ut,onRecycle:x}),t[135]=V,t[136]=e,t[137]=Ut,t[138]=x,t[139]=p,t[140]=m,t[141]=h):h=t[141];let g;t[142]!==v||t[143]!==e?(g=(0,Z.jsx)(tw,{activeDocName:v,isSourceMode:e}),t[142]=v,t[143]=e,t[144]=g):g=t[144];let _;t[145]!==v||t[146]!==L?(_=gM({activeDocName:v,deferredActiveDocName:L,mountResolved:v!==null&&j(v),syncResolved:v!==null&&Ie(v)})?(0,Z.jsxs)(`div`,{className:`absolute inset-0 z-10 bg-background`,children:[(0,Z.jsx)(Zb,{}),v===null?null:(0,Z.jsx)(pC,{docName:v})]}):null,t[145]=v,t[146]=L,t[147]=_):_=t[147];let y;t[148]!==h||t[149]!==g||t[150]!==_?(y=(0,Z.jsxs)(`div`,{className:`relative h-full`,children:[h,g,_]}),t[148]=h,t[149]=g,t[150]=_,t[151]=y):y=t[151];let b;t[152]!==v||t[153]!==M||t[154]!==s||t[155]!==e||t[156]!==r||t[157]!==l||t[158]!==Ce||t[159]!==o||t[160]!==ft?(b=!M&&(0,Z.jsx)(hM,{activeDocName:v,isSourceMode:e,sourceDisabled:o,onModeChange:r,showAddPropertyButton:!e,onAddProperty:l,isPanelCollapsed:s,onTogglePanel:ft,reserveRightGutter:Ce&&s}),t[152]=v,t[153]=M,t[154]=s,t[155]=e,t[156]=r,t[157]=l,t[158]=Ce,t[159]=o,t[160]=ft,t[161]=b):b=t[161];let C;t[162]!==v||t[163]!==Lt||t[164]!==e||t[165]!==d?(C=d?(0,Z.jsx)(oT,{docName:v,surface:e?`source`:`wysiwyg`,dismissed:Lt,onDismiss:()=>Rt(!0),onReopen:()=>Rt(!1)}):null,t[162]=v,t[163]=Lt,t[164]=e,t[165]=d,t[166]=C):C=t[166];let w;t[167]!==y||t[168]!==b||t[169]!==C?(w=(0,Z.jsxs)(`div`,{className:`relative min-h-0 flex-1`,children:[y,b,C]}),t[167]=y,t[168]=b,t[169]=C,t[170]=w):w=t[170];let T;t[171]!==Lt||t[172]!==d?(T=d&&Lt?{onReopen:()=>Rt(!1)}:null,t[171]=Lt,t[172]=d,t[173]=T):T=t[173];let k;t[174]!==Se||t[175]!==O||t[176]!==z||t[177]!==D||t[178]!==T?(k=(0,Z.jsx)(Zj,{stats:D,selectionStats:O,showStats:z,composerBadge:T,reserveRightGutter:Se}),t[174]=Se,t[175]=O,t[176]=z,t[177]=D,t[178]=T,t[179]=k):k=t[179];let N;t[180]!==w||t[181]!==k?(N=(0,Z.jsxs)(`div`,{className:`relative flex h-full flex-col`,children:[w,k]}),t[180]=w,t[181]=k,t[182]=N):N=t[182],Wt=N;let P=be&&q,F=!q,I;t[183]===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[183]=I):I=t[183];let R;t[184]!==q||t[185]!==F?(R=(0,Z.jsx)(LC,{withHandle:F,disabled:q,onPointerDown:I}),t[184]=q,t[185]=F,t[186]=R):R=t[186];let B=le?0:`${Pe}px`,H=P?`0px`:NM,U;t[187]===Symbol.for(`react.memo_cache_sentinel`)?(U=e=>{ue(e.asPercentage===0),e.inPixels>0&&Ne.current&&(Fe.current=e.inPixels,ze(e.inPixels))},t[187]=U):U=t[187];let W=!je&&`transition-[flex-grow] duration-200 ease-out motion-reduce:transition-none motion-reduce:duration-0`,G;t[188]===W?G=t[189]:(G=Y(`flex flex-col bg-muted/20`,W),t[188]=W,t[189]=G);let ee;t[190]!==v||t[191]!==i||t[192]!==S||t[193]!==e||t[194]!==a?(ee=(0,Z.jsx)(Bv,{docName:v,isSourceMode:e,activeTab:i,onActiveTabChange:a,mode:S}),t[190]=v,t[191]=i,t[192]=S,t[193]=e,t[194]=a,t[195]=ee):ee=t[195];let te;t[196]!==P||t[197]!==q||t[198]!==oe||t[199]!==B||t[200]!==H||t[201]!==G||t[202]!==ee?(te=(0,Z.jsx)(IC,{id:`doc-panel`,panelRef:oe,disabled:P,defaultSize:B,minSize:H,maxSize:PM,collapsible:!0,collapsedSize:0,onResize:U,inert:q,className:G,children:ee}),t[196]=P,t[197]=q,t[198]=oe,t[199]=B,t[200]=H,t[201]=G,t[202]=ee,t[203]=te):te=t[203];let ne;t[204]!==R||t[205]!==te?(ne=(0,Z.jsxs)(Z.Fragment,{children:[R,te]}),t[204]=R,t[205]=te,t[206]=ne):ne=t[206],Gt=ne}let Kt;t[207]!==d||t[208]!==c||t[209]!==o||t[210]!==ye||t[211]!==f||t[212]!==Wt?(Kt=o==null?Wt:(0,Z.jsx)(AM,{visible:f,onVisibleChange:c??zM,dockPosition:ye,onBottomContainer:he,onEditorRegion:_e,onReveal:d,children:Wt}),t[207]=d,t[208]=c,t[209]=o,t[210]=ye,t[211]=f,t[212]=Wt,t[213]=Kt):Kt=t[213];let qt=Kt,Jt;t[214]!==Be||t[215]!==He||t[216]!==c||t[217]!==se||t[218]!==be||t[219]!==_?(Jt=be?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(LC,{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)(IC,{id:`terminal-column`,panelRef:se,style:{backgroundColor:_},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[214]=Be,t[215]=He,t[216]=c,t[217]=se,t[218]=be,t[219]=_,t[220]=Jt):Jt=t[220];let Yt=Jt,Xt=Gt!=null&&!le||be,Zt;t[221]===Symbol.for(`react.memo_cache_sentinel`)?(Zt=e=>{Ze(e),Qe.current=e},t[221]=Zt):Zt=t[221];let Qt=je||He||void 0,en=be?`5%`:`30%`,tn;t[222]===Xt?tn=t[223]:(tn=Xt?{}:{defaultSize:`100%`},t[222]=Xt,t[223]=tn);let nn=!(je||He)&&`transition-[flex-grow] duration-200 ease-out motion-reduce:transition-none motion-reduce:duration-0`,rn;t[224]===nn?rn=t[225]:(rn=Y(nn),t[224]=nn,t[225]=rn);let an;t[226]!==qt||t[227]!==en||t[228]!==tn||t[229]!==rn?(an=(0,Z.jsx)(IC,{minSize:en,...tn,className:rn,children:qt}),t[226]=qt,t[227]=en,t[228]=tn,t[229]=rn,t[230]=an):an=t[230];let on;t[231]!==$e||t[232]!==Gt||t[233]!==Qt||t[234]!==an||t[235]!==Yt?(on=(0,Z.jsxs)(FC,{orientation:`horizontal`,groupRef:$e,"data-dragging":Qt,children:[an,Gt,Yt]}),t[231]=$e,t[232]=Gt,t[233]=Qt,t[234]=an,t[235]=Yt,t[236]=on):on=t[236];let sn;t[237]!==d||t[238]!==Ce?(sn=Ce?(0,Z.jsx)(OM,{dockPosition:`right`,onReveal:d,className:`top-2.5 right-0`}):null,t[237]=d,t[238]=Ce,t[239]=sn):sn=t[239];let cn;return t[240]!==on||t[241]!==sn?(cn=(0,Z.jsxs)(`div`,{className:`relative flex min-h-0 flex-1`,ref:Zt,children:[on,sn]}),t[240]=on,t[241]=sn,t[242]=cn):cn=t[242],cn}function zM(){}function BM(e){return!FM.has(e)}function VM(){return Mw()}function HM(){return pw()}function UM(){return kr()}function WM(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 GM(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 KM=1e3,qM=!1;function JM(e){return!!(e.localPrincipalId&&e.entryPrincipalId===e.localPrincipalId||!e.localPrincipalId&&e.entryClientId===e.localClientId)}function YM(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:ms(i)?a=i:(a=void 0,qM||(qM=!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`&&(JM({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=GM(i),{current:c,crossDoc:l}=a?us(a,n,Date.now()):{current:[],crossDoc:[]},u=XM,d=c.map(u),f=l.map(u),p=[...s,...d],m=f;o(e=>WM(e.current,p)&&WM(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,KM);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 XM(e){let{agentId:t,entry:n}=e;return{kind:`agent`,agentId:t,presence:n}}var ZM=!1,QM=new Set,$M=!1;function eN(){for(let e of QM)e()}function tN(e){ZM!==e&&(ZM=e,eN())}function nN(){return ZM}function rN(e){return QM.add(e),()=>{QM.delete(e)}}function iN(e){let t=[e.onUpdateRelaunching(()=>tN(!0)),e.onUpdateRelaunchFailed(()=>tN(!1))];return()=>{for(let e of t)e()}}function aN(){if($M||typeof window>`u`)return;let e=window.okDesktop;e&&($M=!0,iN(e))}function oN(){return(0,Q.useSyncExternalStore)(rN,nN,sN)}function sN(){return!1}var cN=`sync-status`;async function lN(e){try{let t=await kg(e);t.ok||hs.error(t.message,{id:cN,duration:1/0})}catch{}}function uN(e,t){let n=(0,$.c)(6),{_:r}=$t(),i=oN(),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){hs.dismiss(cN);return}o.current=!0;let e=window.okDesktop;hs.warning(r({id:`HGNCsl`}),{id:cN,duration:1/0,...e?{action:{label:r({id:`uaUc6t`}),onClick:()=>{lN(e)}}}:{}})}else o.current&&e===`synced`&&(o.current=!1,hs.success(r({id:`GhjUB_`}),{id:cN,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 dN=4,fN=3,pN={Bird:pd,Cat:bd,Dog:Od,Fish:Pd,Mouse:ff,Rabbit:df,Shrimp:vf,Snail:yf,Squirrel:Cf,Turtle:Nf};Object.freeze(Object.keys(pN));function mN(e){if(typeof e.principalId==`string`&&e.principalId.length>0)return{kind:`initials`};let t=e.name.split(` `)[1];return t&&Object.hasOwn(pN,t)?{kind:`animal`,animal:t}:{kind:`initials`}}var hN={claude:`Claude`,cursor:`Cursor`,windsurf:`Windsurf`,openai:`Codex`,github:`Copilot`,cline:`Cline`,bot:`Agent`};function gN(e){let t=(0,$.c)(28),{user:n,mode:r,tabCount:i}=e,{_:a}=$t(),o=mN(n),s=o.kind===`animal`?pN[o.animal]:void 0,c;t[0]===n.name?c=t[1]:(c=Sr(n.name),t[0]=n.name,t[1]=c);let l=c,u;t[2]===n.color?u=t[3]:(u=oi(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)(Ts,{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)(Es,{children:m}),t[23]=m,t[24]=b);let x;return t[25]!==y||t[26]!==b?(x=(0,Z.jsxs)(Os,{children:[y,b]}),t[25]=y,t[26]=b,t[27]=x):x=t[27],x}function _N(e){let t=hN[e.icon];return e.displayName||t||Wc._({id:`iEQQyu`})}function vN(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 yN(e){let t=(0,$.c)(33),{participant:n,crossDoc:r,scoped:i,onClickAgent:a}=e,{_:o}=$t(),{activeDocName:s}=mt(),{presence:c,agentId:l}=n,u=_N(c),d=vN(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)(fs,{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)(fs,{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)(Ts,{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)(Es,{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)(Os,{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?Wc._({id:`9euN0m`,values:{count:n}}):Wc._({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)(jt,{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)(gN,{user:e.user,mode:e.mode,tabCount:e.tabCount},e.clientId):(0,Z.jsx)(yN,{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)(yt,{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)($e,{children:[u,f]}),t[18]=u,t[19]=f,t[20]=p):p=t[20],p}function xN(e,t,n,r){return e.kind===`human`?(0,Z.jsx)(gN,{user:e.user,mode:e.mode,tabCount:e.tabCount},e.clientId):(0,Z.jsx)(yN,{participant:e,crossDoc:n,scoped:r===e.agentId,onClickAgent:t},e.agentId)}function SN(){let e=(0,$.c)(20),{activeProvider:t,activeDocName:n,systemProvider:r,openActivityPanel:i,docPanelMode:a,docPanelAgentId:o}=mt(),{current:s,crossDoc:c}=YM(t,r,n);if(uN(Nw(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,dN),n;e[6]===s?n=e[7]:(n=s.slice(dN),e[6]=s,e[7]=n);let r=n,u=c.slice(0,fN),d;e[8]===c?d=e[9]:(d=c.slice(fN),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=>xN(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=>xN(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 CN(){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 TN(e){let t=(0,$.c)(6),{className:n}=e,{_:r}=$t(),{channel:i}=CN();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)(qe,{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 EN(e,t){return t.trim()}function DN(e){return![``,`.`,`..`].includes(e)&&!e.includes(`/`)&&!e.includes(`\\`)&&!e.includes(`\0`)}function ON(e,t){let n=EN(e.kind,t),r=e.path.split(`/`);return r[r.length-1]=n,r.join(`/`)}function kN(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(Xc(e)){let t=s.get(Bu(e.docName,e.docExt));if(t){let n=Zc(t);return{kind:`asset`,path:t,assetExt:n,mediaKind:Gn(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(Yc(e))return{...e,path:IN(e.path,n)};if(Qc(e)){let t=s.get(e.path);return t&&Gc(t)?{kind:`document`,docName:Eu(t),docExt:qc(t),size:e.size,modified:e.modified}:{...e,path:t??IN(e.path,n)}}return e})}function AN(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=>Xc(e)?!i.has(e.docName)&&!BN(e.docName,n):Yc(e)?!BN(e.path,n):Qc(e)?!a.has(e.path)&&!BN(e.path,n):!0)}function jN(e,t){if(e.kind!==`asset`||t.some(t=>Qc(t)&&t.path===e.path))return e;let n=Uu(e.path,t);return n?{...e,path:n,name:n.split(`/`).pop()??n}:e}function MN(e,t,n,r=new Date().toISOString()){let i=!1,a=[...e],o=e=>{a.some(t=>LN(t,e))||(a.push(e),i=!0)};if(n.kind===`file`){let s=e.find(e=>Xc(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=>Yc(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(Xc(i)){let e=zN(i.docName,t.path,n.path);e&&c.has(e)&&o({...i,docName:e,modified:r});continue}if(Yc(i)){let e=RN(i.path,t.path,n.path);e&&o({...i,path:e,modified:r})}}return i?a:e}function NN(e,t){return e?t.find(t=>t.fromDocName===e)?.toDocName??e:null}function PN(e,t,n){return e.flatMap(e=>t===e.toDocName||!n(e.toDocName)?[e.fromDocName]:[e.fromDocName,e.toDocName])}function FN(e,t){let n=e.kind===`file`?Bu(e.path,e.docExt):e.path;return ea(t.contentDir,n,t.pathSeparator)}function IN(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 LN(e,t){return Xc(e)&&Xc(t)?e.docName===t.docName:Yc(e)&&Yc(t)||Qc(e)&&Qc(t)?e.path===t.path:!1}function RN(e,t,n){return e===t?n:zN(e,t,n)}function zN(e,t,n){return e.startsWith(`${t}/`)?`${n}${e.slice(t.length)}`:null}function BN(e,t){return!!t&&(e===t||e.startsWith(`${t}/`))}function VN(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)(Sp,{"data-slot":`context-menu`,...n}),t[2]=n,t[3]=r),r}function HN(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)(Cp,{"data-slot":`context-menu-trigger`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function UN(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)(Ep,{"data-slot":`context-menu-group`,...n}),t[2]=n,t[3]=r),r}function WN(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-sub`,...n}),t[2]=n,t[3]=r),r}function GN(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)(wp,{children:(0,Z.jsx)(Tp,{"data-slot":`context-menu-content`,className:i,...r})}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function KN(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)(Op,{"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 qN(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)(Ki,{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)(Np,{"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 JN(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)(Pp,{"data-slot":`context-menu-sub-content`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function YN(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)(Ap,{children:(0,Z.jsx)(Ui,{})})}),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)(kp,{"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 XN(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)(Dp,{"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 ZN(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)(jp,{"data-slot":`context-menu-separator`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var QN=`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`,$N=`border-border bg-background text-foreground hover:bg-background focus-visible:bg-background`,eP={start:[Ko.Space],cancel:[Ko.Esc],end:[Ko.Space,Ko.Enter]};function tP(e){return Y(QN,e?`opacity-100`:`pointer-events-none opacity-0 group-hover:pointer-events-auto group-hover:opacity-100`)}function nP(e){return e?void 0:-1}function rP({className:e,isDragging:t}){return Y(e,t&&$N)}function iP(e){return e.code===Ko.Enter&&e.target===e.currentTarget}function aP({event:e,hasKeyboardActivation:t,isDragging:n}){return e.defaultPrevented?`ignore`:!n&&t&&iP(e)?`activate-tab`:`delegate-sortable`}function oP({activeWidth:e,isDragging:t,outerStyle:n,transform:r,transition:i}){let a=t&&e?e:void 0;return{...n,transform:Zo.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 sP(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 cP(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 lP=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 Bo(e)},uP=[`.md`,`.mdx`],dP=`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`,fP=`z-10 rounded-t-lg rounded-b-none border-border border-b-0 bg-background text-foreground`,pP=Y(fP,`bg-transparent hover:bg-muted focus-visible:bg-muted border-transparent hover:border-border focus-visible:border-border`),mP=`flex h-full min-w-0 flex-1 cursor-pointer items-center overflow-hidden px-3 text-left text-[13px]`;function hP(e){return e.replace(/[^A-Za-z0-9_-]/g,`-`)}function gP(e){let t=fl(e);window.location.hash!==t&&(window.location.hash=t)}function _P(e){Math.abs(e.deltaX)>=Math.abs(e.deltaY)||e.currentTarget.scrollWidth<=e.currentTarget.clientWidth||(e.preventDefault(),e.currentTarget.scrollLeft+=e.deltaY)}function vP(e,t){let n=[t,...uP].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 yP(e){return e.metaKey||e.ctrlKey}var bP=1e3;function xP(e,t){return e<0||e>=t?null:e<8?String(e+1):e===t-1?`9`:null}function SP(e,t){return xP(e,t)}function CP(e,t){let n=xP(e,t);if(n)return[`Meta+${n}`,`Control+${n}`].join(` `)}function wP(e,t){if(!yP(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 TP(e){let t=(0,$.c)(3),{value:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=Y(tP(!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)(P,{className:`text-[10px]`,children:i})}),t[1]=i,t[2]=a),a}function EP(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:_}=Yo(u),v=p.current?.width,y;t[12]!==_||t[13]!==s||t[14]!==v||t[15]!==h||t[16]!==g?(y=oP({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=aP({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=rP({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 DP(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=Ht(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?(_=Ht(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)(HN,{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)(KN,{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)(KN,{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)(KN,{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)(ZN,{}),(0,Z.jsx)(KN,{"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)(GN,{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)(VN,{children:[y,M]}),t[49]=M,t[50]=y,t[51]=N):N=t[51],N}function OP(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}=$t();if(d){let e;return t[0]===d?e=t[1]:(e=(0,Z.jsx)(TP,{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)(uf,{"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=tP(m),t[15]=m,t[16]=h);let g;t[17]===a?g=t[18]:(g=nP(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)(gs,{"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 kP(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)(os,{"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 AP(e){let t=(0,$.c)(27),{accessibleLabel:n,activateTab:r,baseName:i,docName:a,enterRenameMode:o,extension:s,hideDocExtension:c,tabId:l}=e,{_:u}=$t(),d=sw(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)(kP,{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:mP,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 jP(){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:g,openTabs:_,pinTab:y,pinnedTabIds:b,reopenClosedTab:x,remapTabsForRename:S,reorderTabs:C,unpinTab:w,visibleTabIds:T}=mt(),{_:E}=$t(),{pageMeta:D}=Yi(),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?se(i):t?Ee(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]!==_?(ie=p?`${r??`__new-tab__`}\u0000${_.join(`\0`)}\u0000${m.join(`\0`)}`:re?`${re}\u0000${_.join(`\0`)}`:``,e[4]=r,e[5]=re,e[6]=p,e[7]=m,e[8]=_,e[9]=ie):ie=e[9];let ae=ie,oe,ce;e[10]===t?(oe=e[11],ce=e[12]):(oe=()=>{G.current=t},ce=[t],e[10]=t,e[11]=oe,e[12]=ce),(0,Q.useEffect)(oe,ce);let le,q;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(le=()=>()=>{K.current!==null&&(window.clearTimeout(K.current),K.current=null)},q=[],e[13]=le,e[14]=q):(le=e[13],q=e[14]),(0,Q.useEffect)(le,q);let ue,de;e[15]===ae?(ue=e[16],de=e[17]):(ue=()=>{ae&&(O.current?.querySelector(`[data-active-tab="true"]`))?.scrollIntoView({block:`nearest`,inline:`nearest`})},de=[ae],e[15]=ae,e[16]=ue,e[17]=de),(0,Q.useEffect)(ue,de);let fe,pe;e[18]===j?(fe=e[19],pe=e[20]):(fe=()=>{j&&(V.current?.focus(),V.current?.select())},pe=[j],e[18]=j,e[19]=fe,e[20]=pe),(0,Q.useEffect)(fe,pe);let me,he;e[21]!==_||e[22]!==j?(me=()=>{!j||_.includes(j.tabId)||(U.current=!0,W.current=null,M(null),P(``),I(null),R(!1))},he=[_,j],e[21]=_,e[22]=j,e[23]=me,e[24]=he):(me=e[23],he=e[24]),(0,Q.useEffect)(me,he);let ge;e[25]===Symbol.for(`react.memo_cache_sentinel`)?(ge=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]=ge):ge=e[25];let _e=ge,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=EN(`file`,vP(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(!DN(t)){I(E({id:`P8yDjG`})),V.current?.focus();return}let i=ON({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 ht(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=Ot(Dr,r.body,`rename-path:tab`,{renamed:[],renamedAssets:[]}).renamed,o=G.current,c=NN(o,a);v(a);let l=!0;try{let e=PN(a,d(),f);await Promise.all(e.map(e=>s(e))),S(a),bl([`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}),hs.error(E({id:`MUBR8r`}))}U.current=!0,M(null),P(``),I(null),R(!1),H.current=!1,W.current=null,l&&c&&c!==o&&gP(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=cP(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,De;e[32]!==c||e[33]!==u||e[34]!==Se?(De=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]=De):De=e[35];let Oe=De,ke,Ae;e[36]!==o||e[37]!==a||e[38]!==r||e[39]!==re||e[40]!==p||e[41]!==m||e[42]!==g||e[43]!==x||e[44]!==T?(ke=()=>{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(yP(e)&&s(),kl(e,`tab-new`)){e.preventDefault(),g();return}if(kl(e,`tab-reopen-closed`)){e.preventDefault(),x();return}if(kl(e,`tab-next`)){e.preventDefault(),u(1);return}if(kl(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)}},Ae=[r,re,o,a,p,m,g,x,T],e[36]=o,e[37]=a,e[38]=r,e[39]=re,e[40]=p,e[41]=m,e[42]=g,e[43]=x,e[44]=T,e[45]=ke,e[46]=Ae):(ke=e[45],Ae=e[46]),(0,Q.useEffect)(ke,Ae);let Me;e[47]===Symbol.for(`react.memo_cache_sentinel`)?(Me={activationConstraint:{distance:8}},e[47]=Me):Me=e[47];let Ne;e[48]===Symbol.for(`react.memo_cache_sentinel`)?(Ne={coordinateGetter:Uo,keyboardCodes:eP},e[48]=Ne):Ne=e[48];let Pe=Xo(Lo(Vo,Me),Lo(Wo,Ne)),Fe=z,Ie;e[49]===Symbol.for(`react.memo_cache_sentinel`)?(Ie=function(){A(sP(O.current))},e[49]=Ie):Ie=e[49];let Le=Ie,Re;e[50]===Symbol.for(`react.memo_cache_sentinel`)?(Re=function(){A(null)},e[50]=Re):Re=e[50];let ze=Re,Be;e[51]!==ze||e[52]!==C||e[53]!==T?(Be=function(e){ze();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]=ze,e[52]=C,e[53]=T,e[54]=Be):Be=e[54];let Ve=Be,He=be?``:void 0,Ue;e[55]===Symbol.for(`react.memo_cache_sentinel`)?(Ue=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]=Ue):Ue=e[55];let We=_P,Ge;e[56]===Symbol.for(`react.memo_cache_sentinel`)?(Ge=Y(`flex items-end gap-1`,be&&`[-webkit-app-region:no-drag]`),e[56]=Ge):Ge=e[56];let Ke=zo,qe=lP,Je;e[57]===Symbol.for(`react.memo_cache_sentinel`)?(Je={container:typeof document<`u`?document.body:void 0},e[57]=Je):Je=e[57];let Ye=Go,Xe;e[58]===T?Xe=e[59]:(Xe=[...T],e[58]=T,e[59]=Xe);let Ze=Ro,Qe=T.map((e,t)=>{let n=z?SP(t,T.length):null,i=CP(t,T.length);if(Se.has(e)){let t=e===r;return(0,Z.jsx)(DP,{tabId:e,canPin:!1,openTabs:T,closeTab:c,closeTabs:Oe,pinTab:y,pinnedTabIds:b,unpinTab:w,children:(0,Z.jsxs)(EP,{tabId:e,activateFromKeyboard:()=>o(e),"aria-current":t?`page`:void 0,"aria-keyshortcuts":i,"data-active-tab":t?`true`:void 0,className:Y(dP,t?fP:pP),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:mP,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)(TP,{value:n}):(0,Z.jsx)(`button`,{type:`button`,"aria-label":E({id:`xCdTnb`}),"data-testid":`editor-new-tab-placeholder-close`,className:tP(Fe||t),tabIndex:nP(t),onClick:t=>{t.stopPropagation(),c(e)},children:(0,Z.jsx)(gs,{"aria-hidden":`true`,className:`size-3.5`})})]})},e)}let s=je(e),u=e===re,d=b.includes(e);if(s.kind===`folder`){let{baseName:t,label:r,prefix:o}=h(s.folderPath,`/`),c=`${o}${r}`;return(0,Z.jsx)(DP,{tabId:e,openTabs:T,closeTab:l,closeTabs:Oe,pinTab:y,pinnedTabIds:b,unpinTab:w,children:(0,Z.jsxs)(EP,{tabId:e,activateFromKeyboard:()=>a(e),"aria-current":u?`page`:void 0,"aria-keyshortcuts":i,"data-active-tab":u?`true`:void 0,className:Y(dP,u?fP:pP),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:mP,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)(OP,{accessibleLabel:c,closeTab:l,forceCloseVisible:Fe,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}=h(s.kind===`asset`?s.assetPath:s.path,``),c=`${o}${r}`;return(0,Z.jsx)(DP,{tabId:e,openTabs:T,closeTab:l,closeTabs:Oe,pinTab:y,pinnedTabIds:b,unpinTab:w,children:(0,Z.jsxs)(EP,{tabId:e,activateFromKeyboard:()=>a(e),"aria-current":u?`page`:void 0,"aria-keyshortcuts":i,"data-active-tab":u?`true`:void 0,className:Y(dP,u?fP:pP),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:mP,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)(OP,{accessibleLabel:c,closeTab:l,forceCloseVisible:Fe,isActive:u,isPinned:d,shortcutHint:n,tabId:e,unpinTab:w})]})},e)}let f=s.docName,p=D.get(f)?.docExt??`.md`,{baseName:m,extension:g,label:_,prefix:v}=h(f,p),x=`${v}${_}`,S=p===`.md`||p===`.mdx`,C=j?.tabId===e,O=`editor-tab-rename-error-${hP(f)}`;return(0,Z.jsx)(DP,{disabled:C,tabId:e,openTabs:T,closeTab:l,closeTabs:Oe,pinTab:y,pinnedTabIds:b,unpinTab:w,children:(0,Z.jsx)(EP,{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(dP,u?fP:pP,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)(RC,{className:`h-full min-w-0 flex-1 rounded-none border-0 bg-transparent dark:bg-transparent`,children:[(0,Z.jsx)(UC,{ref:V,value:N,disabled:L,"aria-label":E({id:`Dw1T_W`,values:{label:_}}),"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(vP(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)(BC,{align:`inline-end`,"aria-hidden":`true`,className:`pr-2 text-xs`,children:(0,Z.jsx)(HC,{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)(AP,{accessibleLabel:x,activateTab:a,baseName:m,docName:f,enterRenameMode:_e,extension:g,hideDocExtension:S,tabId:e}),(0,Z.jsx)(OP,{accessibleLabel:x,closeTab:l,forceCloseVisible:Fe,isActive:u,isPinned:d,shortcutHint:n,tabId:e,unpinTab:w})]})})},e)}),$e;e[60]!==Ye||e[61]!==Xe||e[62]!==Ze||e[63]!==Qe?($e=(0,Z.jsx)(Ye,{items:Xe,strategy:Ze,children:Qe}),e[60]=Ye,e[61]=Xe,e[62]=Ze,e[63]=Qe,e[64]=$e):$e=e[64];let et;e[65]!==Ke||e[66]!==ze||e[67]!==Ve||e[68]!==Le||e[69]!==Pe||e[70]!==!1||e[71]!==qe||e[72]!==Je||e[73]!==$e||e[74]!==Te?(et=(0,Z.jsx)(Ke,{sensors:Pe,autoScroll:!1,collisionDetection:qe,modifiers:Te,onDragStart:Le,onDragEnd:Ve,onDragCancel:ze,accessibility:Je,children:$e}),e[65]=Ke,e[66]=ze,e[67]=Ve,e[68]=Le,e[69]=Pe,e[70]=!1,e[71]=qe,e[72]=Je,e[73]=$e,e[74]=Te,e[75]=et):et=e[75];let tt;e[76]===E?tt=e[77]:(tt=E({id:`3YvS-c`}),e[76]=E,e[77]=tt);let nt;e[78]===Symbol.for(`react.memo_cache_sentinel`)?(nt=(0,Z.jsx)(Zt,{"aria-hidden":`true`}),e[78]=nt):nt=e[78];let rt;e[79]!==g||e[80]!==tt?(rt=(0,Z.jsx)(Ts,{asChild:!0,children:(0,Z.jsx)(X,{type:`button`,size:`icon-xs`,variant:`ghost`,"aria-label":tt,"data-testid":`editor-new-tab-button`,className:`first:mb-3 mb-1.5`,onClick:g,children:nt})}),e[79]=g,e[80]=tt,e[81]=rt):rt=e[81];let it;e[82]===Symbol.for(`react.memo_cache_sentinel`)?(it=(0,Z.jsx)(Es,{children:(0,Z.jsx)(J,{id:`3YvS-c`})}),e[82]=it):it=e[82];let at;e[83]===rt?at=e[84]:(at=(0,Z.jsxs)(Os,{children:[rt,it]}),e[83]=rt,e[84]=at);let ot;e[85]!==Ge||e[86]!==et||e[87]!==at?(ot=(0,Z.jsxs)(`div`,{className:Ge,children:[et,at]}),e[85]=Ge,e[86]=et,e[87]=at,e[88]=ot):ot=e[88];let st;return e[89]!==He||e[90]!==Ue||e[91]!==We||e[92]!==ot?(st=(0,Z.jsx)(`div`,{ref:O,"data-electron-drag":He,className:Ue,onWheel:We,children:ot}),e[89]=He,e[90]=Ue,e[91]=We,e[92]=ot,e[93]=st):st=e[93],st}var MP=(e,t,n)=>{if(e&&`reportValidity`in e){let r=Fa(n,t);e.setCustomValidity(r&&r.message||``),e.reportValidity()}},NP=(e,t)=>{for(let n in t.fields){let r=t.fields[n];r&&r.ref&&`reportValidity`in r.ref?MP(r.ref,n,e):r&&r.refs&&r.refs.forEach(t=>MP(t,n,e))}},PP=(e,t)=>{t.shouldUseNativeValidation&&NP(e,t);let n={};for(let r in e){let i=Fa(t.fields,r),a=Object.assign(e[r]||{},{ref:i&&i.ref});if(FP(t.names||Object.keys(e),r)){let e=Object.assign({},Fa(n,r));to(e,`root`,a),to(n,r,e)}else to(n,r,a)}return n},FP=(e,t)=>{let n=IP(t).replace(/[.*+?^${}()|\\]/g,`\\$&`);return e.some(e=>IP(e).match(`^${n}\\.\\d+`))};function IP(e){return e.replace(/[\[\]]/g,``)}function LP(){return LP=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},LP.apply(null,arguments)}function RP(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}function zP(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]=Da(o,t,n,i,l?[].concat(l,r.message):r.message)}e.shift()}return n}function BP(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(LP({},t,{path:[].concat(r.path,t.path)}))})}),t){var c=n[o].types,l=c&&c[r.code];n[o]=Da(o,t,n,i,l?[].concat(l,r.message):r.message)}e.shift()};e.length;)r();return n}function VP(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(RP(function(){return Promise.resolve(e[n.mode===`sync`?`parse`:`parseAsync`](r,t)).then(function(e){return a.shouldUseNativeValidation&&NP({},a),{errors:{},values:n.raw?Object.assign({},r):e}})},function(e){if(function(e){return Array.isArray(e?.issues)}(e))return{values:{},errors:PP(zP(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(RP(function(){return Promise.resolve((n.mode===`sync`?Yn:ur)(e,r,t)).then(function(e){return a.shouldUseNativeValidation&&NP({},a),{errors:{},values:n.raw?Object.assign({},r):e}})},function(e){if(function(e){return e instanceof mr}(e))return{values:{},errors:PP(BP(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 HP=`https://openknowledge.ai/api/subscribe`;async function UP(e,t){try{let n=await fetch(HP,{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 WP(e){let t=(0,$.c)(49),{source:n,title:r,description:i,onSuccess:a,onDismiss:o,autoFocus:s,compactSubmit:c,className:l}=e,{_:u}=$t(),[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=In({email:ir({message:u({id:`Wq6Wcm`})})});_=Ta,g=VP(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 UP(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)(Ui,{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)(gs,{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)(za,{control:b.control,name:`email`,render:e=>{let{field:t,fieldState:n}=e;return(0,Z.jsxs)(RC,{className:`h-10 rounded-xl`,children:[(0,Z.jsx)(BC,{className:`pl-2.5`,children:(0,Z.jsx)(Zd,{className:`size-4 text-muted-foreground opacity-60`})}),(0,Z.jsx)(UC,{...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)($o,{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)(lt,{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 GP=`https://github.com/inkeep/open-knowledge`,KP=`https://discord.com/invite/YujKpFN49`,qP=`https://x.com/OpenKnowledge`,JP=`ok-subscribe-card-v1`,YP={subscribed:!1,dismissed:!1,shownVersions:[]};function XP(e,t){return!e.subscribed&&!e.dismissed&&e.shownVersions.length<3&&!e.shownVersions.includes(t)}function ZP(e){return e===!0}function QP(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}function $P(e){if(typeof e!=`object`||!e)return YP;let t=e;return{subscribed:ZP(t.subscribed),dismissed:ZP(t.dismissed),shownVersions:QP(t.shownVersions)}}function eF(e){try{let t=(e??localStorage).getItem(JP);return t==null?YP:$P(JSON.parse(t))}catch(e){return console.warn(`[subscribe-card-store] readPersistedState failed (corrupt/privacy/SSR)`,e),YP}}function tF(e,t){try{(t??localStorage).setItem(JP,JSON.stringify(e))}catch(e){console.warn(`[subscribe-card-store] writePersistedState failed (quota/privacy/SSR)`,e)}}function nF(e){let t=eF(e),n=new Set,r=!1;function i(){for(let e of n)e()}function a(n){t=n,tF(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=eF(e),i())}}}var rF=nF();function iF(){rF.install()}function aF(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 oF(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 sF(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 cF=[{key:`resources`,heading:{id:`s-MGs7`},links:[{label:{id:`TbjyhA`},href:`https://openknowledge.ai/docs`,icon:Mt},{label:{id:`PCNIuJ`},href:`${GP}/issues/new`,icon:Sd},{label:{id:`On0aF2`},href:`https://openknowledge.ai/`,icon:Ji}]},{key:`community`,heading:{id:`chL5IG`},links:[{label:`Discord`,href:KP,icon:aF},{label:`X (Twitter)`,href:qP,icon:sF},{label:`GitHub`,href:GP,icon:oF}]}],lF=`${GP}/releases`,uF=`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 dF(e){if(e<1e3)return String(e);let t=e/1e3;return`${t>=10?Math.round(t):t.toFixed(1)}k`}var fF=e=>{let t=(0,$.c)(12),{count:n}=e,{_:r}=$t(),i,a,o,s;t[0]!==r||t[1]!==n?(i=dF(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)(wf,{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},pF=e=>{let t=(0,$.c)(15),{link:n,trailing:r}=e,{_:i}=$t(),{label:a,href:o,icon:s}=n,c,l;t[0]===o?(c=t[1],l=t[2]):(c=e=>uu(e,o),l=e=>uu(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:uF,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},mF=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},hF=()=>{let e=(0,$.c)(28),{_:t}=$t(),[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 Cr({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)(et,{className:`size-4`}),e[5]=d):d=e[5];let f;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Z.jsx)(Ts,{asChild:!0,children:(0,Z.jsx)(jt,{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)(Os,{children:[f,(0,Z.jsx)(Es,{children:(0,Z.jsx)(J,{id:`s-MGs7`})})]}),e[7]=p):p=e[7];let m;e[8]!==t||e[9]!==o?(m=cF.map((e,n)=>(0,Z.jsxs)(`div`,{className:Y(n>0&&`mt-3`),children:[(0,Z.jsx)(mF,{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)(pF,{link:e,trailing:e.href===`https://github.com/inkeep/open-knowledge`&&o!==null?(0,Z.jsx)(fF,{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)(mF,{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)(pF,{link:{label:{id:`3ePd3I`},href:lF,icon:Qd}}),e[14]=_):_=e[14];let v;e[15]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,Z.jsx)(jt,{asChild:!0,children:(0,Z.jsxs)(X,{variant:`ghost`,className:Y(uF,`h-auto w-full justify-start font-normal`),children:[(0,Z.jsx)(Zd,{"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)(yt,{side:`left`,align:`center`,sideOffset:20,className:`w-80`,children:(0,Z.jsx)(WP,{source:`resources_menu`,autoFocus:!0,onDismiss:()=>a(!1),onSuccess:gF})}),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)($e,{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)(yt,{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)($e,{open:n,onOpenChange:u,children:[p,S]}),e[25]=n,e[26]=S,e[27]=C):C=e[27],C};function gF(){return rF.markSubscribed()}var _F=50,vF=()=>{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,CC.preload()},_F))},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=Ua)},l=(0,Z.jsx)(gf,{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)(Ts,{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)(Os,{children:[u,(0,Z.jsx)(Es,{children:(0,Z.jsx)(J,{id:`Tz0i8g`})})]}),e[7]=d):d=e[7],d},yF=`https://openknowledge.ai/docs/features/share`;function bF(e){let t=(0,$.c)(50),{input:n,onClickWhenNoRemote:r}=e,{_:i}=$t(),{status:a}=ki(),[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=Ti(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 ja({...n,hasRemote:p,onClickWhenNoRemote:r},{clipboardWrite:ga,toastSuccess:OF,toastError:DF,logEvent:EF});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{hs.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)(_f,{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)(Oe,{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)(Hc,{ref:u,readOnly:!0,value:k,onFocus:TF,onClick:wF,onContextMenu:CF,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)(U,{copyContent:M,clipboardWrite:ga,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)(Ci,{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:yF,target:`_blank`,rel:`noopener noreferrer`,onClick:SF,onAuxClick:xF,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)(et,{"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)(yt,{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)($e,{open:v,onOpenChange:y,children:[w,B]}),t[46]=w,t[47]=B,t[48]=v,t[49]=V):V=t[49],V}function xF(e){return uu(e,yF)}function SF(e){return uu(e,yF)}function CF(e){return e.currentTarget.select()}function wF(e){return e.currentTarget.select()}function TF(e){return e.currentTarget.select()}function EF(e){return console.log(e)}function DF(e){e!==`Link ready but could not copy to clipboard.`&&hs.error(e)}function OF(e){return hs.success(e)}function kF(e){let t=(0,$.c)(35),{onSignIn:n,onSetIdentity:r,onOpenSearch:i}=e,{_:a}=$t(),{activeDocName:o,activeTarget:s}=mt(),c=o?Xr(o):null,{state:l,isDraggingRail:u}=xj(),d=sg(),f;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(f=Ol(`toggle-files-sidebar`),t[0]=f):f=t[0];let p=f,m=Ol(`command-palette`),[h,g]=(0,Q.useState)(!1),_;bb0:{if(s?.kind===`folder`){let e;t[1]===s.folderPath?e=t[2]:(e=Oa(s.folderPath),t[1]=s.folderPath,t[2]=e),_=e;break bb0}if(o&&!c){let e;t[3]===o?e=t[4]:(e=Ia(o),t[3]=o,t[4]=e),_=e;break bb0}if(!s&&!o){let e;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(e=Oa(``),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)(Os,{children:[(0,Z.jsx)(Ts,{asChild:!0,children:(0,Z.jsx)(Ej,{className:Y(`-ml-1 shrink-0 text-muted-foreground`,y&&`[-webkit-app-region:no-drag]`)})}),(0,Z.jsx)(Es,{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)(Os,{children:[(0,Z.jsx)(Ts,{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)(L,{"aria-hidden":`true`})})}),(0,Z.jsx)(Es,{children:(0,Z.jsx)(J,{id:`IN4UX8`,values:{searchShortcut:m}})})]}),(0,Z.jsx)(Ja,{orientation:`vertical`,className:`mr-1 h-4 shrink-0 data-vertical:self-center`}),(0,Z.jsx)(jP,{})]}),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 O;t[12]!==h||t[13]!==g||t[14]!==v||t[15]!==d?(O=!d&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(bF,{input:v,onClickWhenNoRemote:()=>g(!0)}),(0,Z.jsx)(vo,{open:h,onOpenChange:g})]}),t[12]=h,t[13]=g,t[14]=v,t[15]=d,t[16]=O):O=t[16];let k;t[17]!==r||t[18]!==n?(k=(0,Z.jsx)(Ya,{onSignIn:n,onSetIdentity:r}),t[17]=r,t[18]=n,t[19]=k):k=t[19];let A,j,M;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,Z.jsx)(SN,{}),j=(0,Z.jsx)(Ja,{orientation:`vertical`,className:`h-4 shrink-0 data-vertical:self-center`}),M=(0,Z.jsx)(TN,{}),t[20]=A,t[21]=j,t[22]=M):(A=t[20],j=t[21],M=t[22]);let N;t[23]===d?N=t[24]:(N=!d&&(0,Z.jsx)(vF,{}),t[23]=d,t[24]=N);let P;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,Z.jsx)(hF,{}),t[25]=P):P=t[25];let F;t[26]!==O||t[27]!==k||t[28]!==N?(F=(0,Z.jsxs)(`div`,{className:D,children:[O,k,A,j,M,N,P]}),t[26]=O,t[27]=k,t[28]=N,t[29]=F):F=t[29];let I;return t[30]!==F||t[31]!==x||t[32]!==w||t[33]!==E?(I=(0,Z.jsxs)(`header`,{"data-electron-drag":x,className:w,children:[E,F]}),t[30]=F,t[31]=x,t[32]=w,t[33]=E,t[34]=I):I=t[34],I}var AF=`open-knowledge:terminal-launch`;function jF(e,t,n=typeof window>`u`?new EventTarget:window){n.dispatchEvent(new CustomEvent(AF,{detail:{prompt:e,cli:t}}))}function MF(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(AF,n),()=>t.removeEventListener(AF,n)}function NF(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)(Xp,{"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 PF=_i(`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 FF(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(PF({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)(Zp,{"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 IF(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)(Qp,{"data-slot":`tabs-trigger`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function LF(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)($p,{"data-slot":`tabs-content`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var RF=(0,Q.lazy)(()=>n(()=>import(`./TerminalPanel-BNR82pgE.js`).then(e=>({default:e.TerminalPanel})),__vite__mapDeps([90,1,10,3,11,6,7,13,55,17,36,91,64,32,92]),import.meta.url));function zF(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}=_o(),f=yo(),{_:p}=$t(),m=d&&u===!1,h;t[0]!==p||t[1]!==f?(h=function(){if(f===null){hs.error(p({id:`V_6bJ4`}));return}let e=f(!0);e.ok||hs.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:VF,onError:BF,children:(0,Z.jsx)(Q.Suspense,{fallback:e,children:(0,Z.jsx)(RF,{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)(WF,{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 BF(e,t){console.error(`[TerminalGate] rendered fallback for the terminal panel`,e,t.componentStack)}function VF(e){return(0,Z.jsx)(HF,{...e})}function HF(e){let t=(0,$.c)(15),{error:n}=e,{_:r}=$t(),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:UF,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 UF(){return window.location.reload()}function WF(e){let t=(0,$.c)(20),{onEnable:n}=e,{_:r}=$t(),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 GF(e){let t=(0,$.c)(48),{selected:n,onLaunchSelected:r,onPickCli:i,onPickTerminal:a,className:o}=e,{_:s}=$t(),c=n===`terminal`,l;t[0]!==s||t[1]!==c||t[2]!==n?(l=s(c?{id:`AB4qw9`}:{id:`nP-KFo`,values:{0:zn[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)(Sf,{"aria-hidden":`true`,className:`size-3.5`}):(0,Z.jsx)(sa,{id:oa(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)(Zt,{"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)(Ts,{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)(Es,{side:`bottom`,sideOffset:8,children:u}),t[14]=u,t[15]=h);let g;t[16]!==m||t[17]!==h?(g=(0,Z.jsxs)(Os,{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)(Wi,{"aria-hidden":`true`,className:`size-3`}),t[21]=v):v=t[21];let y;t[22]===_?y=t[23]:(y=(0,Z.jsx)(hc,{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)(Oc,{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=va.map(e=>{let{displayName:t}=zn[e];return(0,Z.jsxs)(_c,{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)(sa,{id:oa(e),className:`size-4`,"aria-hidden":`true`}),(0,Z.jsx)(`span`,{className:`flex-1`,children:t}),n===e?(0,Z.jsx)(Ui,{"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)(Ac,{}),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)(Sf,{"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)(Ui,{"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)(_c,{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)(yc,{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)(Tc,{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 KF(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,{_}=$t(),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)(Os,{children:[(0,Z.jsx)(Ts,{asChild:!0,children:(0,Z.jsx)(IF,{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)(Es,{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)(gs,{"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)(FF,{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)(GF,{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)(Os,{children:[(0,Z.jsx)(Ts,{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)(nf,{"aria-hidden":`true`}):(0,Z.jsx)(sf,{"aria-hidden":`true`})})}),(0,Z.jsx)(Es,{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)(Os,{children:[(0,Z.jsx)(Ts,{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)(Ki,{"aria-hidden":`true`}):(0,Z.jsx)(Wi,{"aria-hidden":`true`})})}),(0,Z.jsx)(Es,{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)(NF,{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 qF(e){return`terminal-session-${e}`}function JF(e){e!==``&&document.querySelector(`[data-terminal-session="${e}"] .xterm-helper-textarea`)?.focus()}function YF(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}=$t(),[_]=(0,Q.useState)(tI),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:qF(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?qF(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=qF(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)(eI),[H,U]=(0,Q.useState)($F),W;t[12]===s?W=t[13]:(W=s??{},t[12]=s,t[13]=W);let G;t[14]!==B||t[15]!==W?(G=l_(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),v_(!1);let t=r_(e);V(t),s_(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),v_(!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(()=>JF(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)(QF),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(ZF);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)(()=>LE(e=>{let t=A.current,r=t===``?void 0:F.current.get(t);r==null?cu():(n.terminal.input(r,e),queueMicrotask(()=>JF(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(()=>JF(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&&JF(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)(KF,{sessions:Ne,activeSessionId:T,onSelect:E,onTabActivate:XF,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)(LF,{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)(zF,{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,gd.createPortal)(Pe,_),t[76]=_,t[77]=Pe,t[78]=Fe):Fe=t[78],Fe}function XF(e){return queueMicrotask(()=>JF(e))}function ZF(e,t){return{id:qF(t+1),launch:null,title:null,adoptPtyId:e.ptyId}}function QF(){}function $F(){return y_()}function eI(){return o_()}function tI(){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]=Jg(),[o,s]=(0,Q.useState)(i),[c,l]=(0,Q.useState)(!1),[u,d]=(0,Q.useState)(`auth`),[f,p]=(0,Q.useState)(Fv[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=Yg(),[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)(h_),A;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(A=function(e){k(e),m_(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??l_(o_(),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&&!__()&&z()},t[8]=x,t[9]=z,t[10]=B):B=t[10];let V=B,H=Oi(),{projectConfig:U,projectLocalConfig:W,projectLocalSynced:G,projectSynced:K}=Po(),{activeDocName:ee}=mt(),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=S_({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&&eu(ee,{kind:`raw-mdx`,detail:t}),s(`source`)};return window.addEventListener(Bg,e),()=>window.removeEventListener(Bg,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(aI):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){kl(e,`toggle-terminal-panel`)&&(e.preventDefault(),y(iI))};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=()=>MF((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(rI).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&&Wa()}},ye=[v],t[37]=v,t[38]=ve,t[39]=ye),(0,Q.useEffect)(ve,ye),Zg(H?.pausedReason),Qg();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)(kF,{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)(IM,{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)(YF,{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)(Ha,{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)(b_,{open:ie,onResolved:je}),t[65]=ie,t[66]=Me);let Ne;t[67]===Symbol.for(`react.memo_cache_sentinel`)?(Ne=(0,Z.jsx)(Lg,{}),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 rI(e){console.error(`[terminal] dock-state restore failed; staying hidden:`,e)}function iI(e){return!e}function aI(e){return!e}function oI(e){let t=fl($c(e));typeof window>`u`||window.location.hash!==t&&(window.location.hash=t)}function sI(){let e=(0,$.c)(11),{conflicts:t,loading:n,error:r}=Ra();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)(os,{"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)(os,{"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(cI),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 cI(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:()=>oI(e.file),children:[(0,Z.jsx)(os,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,Z.jsx)(`span`,{className:`min-w-0 truncate`,children:e.file})]})},e.file)}var lI=`<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;Il(t,{style:t=>Xl(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 rA.set(t.changes,i),i}function oA(e,t){let{state:n}=e,r=t??n.selection.main.head,i=e.state.field(fk).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(nA);i.fromB!=i.toB&&i.toA<=o.length&&(a+=e.state.lineBreak);let s=Nl.of({from:i.fromA,to:Math.min(o.length,i.toA),insert:a},o.length);return e.dispatch({effects:tA.of({doc:s.apply(o),changes:s}),userEvent:`accept`}),!0}function sA(e,t){let{state:n}=e,r=t??n.selection.main.head,i=n.field(fk).find(e=>e.fromB<=r&&e.endB>=r);if(!i)return!1;let a=n.field(nA).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 cA(e){let t=new zl;for(let n of e.field(fk)){let r=e.facet(lk).overrideChunk&&dA(e,n);t.add(n.fromB,n.fromB,aA(e,n,!!r))}return t.finish()}var lA=Fl.define({create:e=>cA(e),update(e,t){return t.state.field(fk,!1)==t.startState.field(fk,!1)?e:cA(t.state)},provide:e=>Wl.decorations.from(e)}),uA=new WeakMap;function dA(e,t){let n=uA.get(t);if(n!==void 0)return n;n=null;let r=e.field(nA),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(Rl.widget({widget:new fA(t),side:-1}).range(s+n.fromB))}n.fromB<n.toB&&e.push(Ok.range(s+n.fromB,s+n.toB))}i<t.endA-t.fromA-a*2&&(n=e)}return uA.set(t,n),n}var fA=class extends jl{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}},pA=new class extends Gl{constructor(){super(...arguments),this.elementClass=`cm-inlineChangedLineGutter`}},mA=Rl.line({class:`cm-inlineChangedLine`});function hA(e,t,n,r){let i=dA(e,t),a=0;if(!i)return!1;for(let o=e.doc.lineAt(t.fromB);;){for(r&&r.add(o.from,o.from,pA),n.add(o.from,o.from,mA);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 gA=q({settings:{background:`var(--background)`,gutterBackground:`var(--muted)`}}),_A=E({settings:{background:`var(--background)`,gutterBackground:`var(--muted)`}}),vA=Wl.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 yA({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}=$t(),d=s??r,f=(0,Q.useRef)(null),p=(0,Q.useRef)(null),m=(0,Q.useRef)(0),{resolvedTheme:h}=Mn(),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=OO(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`?gA:_A,u=[Wl.editable.of(!1),Pl.readOnly.of(!0)],g=[lu,Zl(),...u,l,Wl.lineWrapping];if(p.current&&=(p.current.destroy(),null),o)p.current=new Wl({doc:d,extensions:g,parent:e}),y(null);else if(a){let i=yA({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 Wl({doc:d,extensions:[lu,Zl(),Wl.editable.of(!1),l,vA,Wl.lineWrapping,eA({original:n,highlightChanges:!0,gutter:!0,mergeControls:i,collapseUnchanged:{margin:3,minSize:4}}),Wl.updateListener.of(e=>{let t=pk(e.state);y(t?t.chunks.length:0)})],parent:e});p.current=a;let o=pk(a.state);y(o?o.chunks.length:0)}else i===`split`?p.current=new Xk({a:{doc:n,extensions:g},b:{doc:d,extensions:g},parent:e,highlightChanges:!0,gutter:!0,collapseUnchanged:{margin:3,minSize:4}}):p.current=new Wl({doc:d,extensions:[...g,eA({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 Wl)||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 Wl)||Se(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`}):Wc._({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,gd.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 xA(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 SA(e,t){return xA(e,`content`,t)}async function CA(e){return xA(e,`mine`)}async function wA(e){return xA(e,`theirs`)}async function TA(e){return xA(e,`delete`)}async function EA(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 DA(e){let t=(0,$.c)(86),{docName:n}=e,{_:r}=$t(),{conflicts:i,loading:a}=Ra(),o;if(t[0]!==i||t[1]!==n){let e;t[3]===n?e=t[4]:(e=e=>$c(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=OO(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),EA(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 SA(c,e);t.ok||hs.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),hs.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(TA),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(CA),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(TA),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 OA(e){let t=(0,$.c)(2),{docName:n,provider:r,children:i}=e;(0,Q.use)(It(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 kA=`__back-nav__`;function AA(e){return e instanceof Me||e instanceof vt||e instanceof De||e instanceof Qe||e instanceof At||e instanceof ee?e.docName:null}function jA(e){return e instanceof Me||e instanceof vt}function MA(e){if(e instanceof Me){let t=e.docName;return{title:Wc._({id:`Jejur6`}),summary:Wc._({id:`jSY41h`,values:{docName:t}})}}if(e instanceof vt){let t=e.docName;return{title:Wc._({id:`V7QxyT`}),summary:Wc._({id:`xG4tb6`,values:{docName:t}})}}if(e instanceof De){let t=e.docName;return{title:Wc._({id:`1di5fu`}),summary:Wc._({id:`PQCdtv`,values:{docName:t}})}}if(e instanceof Qe){let t=e.docName;return{title:Wc._({id:`wvbc1r`}),summary:Wc._({id:`IX7-sq`,values:{docName:t}})}}if(e instanceof At)return{title:Wc._({id:`Gfr4fu`}),summary:Wc._({id:`UW2Fg3`})};if(e instanceof ee){let t=e.docName;return{title:Wc._({id:`vv7kpg`}),summary:Wc._({id:`mdKFEy`,values:{docName:t}})}}let t=e instanceof Error&&e.message?e.message:Wc._({id:`W5A0Ly`});return{title:Wc._({id:`29VNqC`}),summary:t}}function NA(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=MA(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&&jA(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)(mS,{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:()=>{kg(p).then(FA).catch(PA)},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||(st(AA(n)??i),o(a),r(kA))},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 PA(){}function FA(e){e.ok||hs.error(e.message,{id:`server-restart-error`,duration:1/0})}function IA(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)(NA,{...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]===kA){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}: ${MA(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 LA(e){let t=e.document.getText(`source`).toString(),{map:n,parseError:r}=Qr(t);return{map:n,keys:Pr(t),parseError:r}}function RA(e){let t=(0,$.c)(21),{provider:n}=e,r;t[0]===n?r=t[1]:(r=()=>LA(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=Jn(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=Ye(i.map.icon),t[5]=i.map.icon,t[6]=c);let l=c,u;t[7]===i.map.cover?u=t[8]:(u=dt(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)(zA,{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)(BA,{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 zA(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 BA(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 VA=(0,Q.lazy)(async()=>({default:(await n(async()=>{let{ManagedArtifactProperties:e}=await import(`./ManagedArtifactProperties-BoAxNvK5.js`);return{ManagedArtifactProperties:e}},__vite__mapDeps([83,1,40,2,41,42,11,43,44,45,46,47,48,49,50,15,16,13,7,17,18,10,3,51,52,36,12,6,4,53,54,55,20,56,57,58,59,31,32,33,34,60,61,62,63,35,64,65,66,72,74,19,84,73,85,86,38,81]),import.meta.url)).ManagedArtifactProperties})),HA=El(`LARGE_DOC_CHAR_THRESHOLD`,5e5);function UA(e){let t=e.threshold??HA;return e.ytextLength>t?{renderSource:e.isSourceMode||e.visitedSource,renderVisual:!e.isSourceMode||e.visitedVisual,isLarge:!0}:{renderSource:!0,renderVisual:!0,isLarge:!1}}function WA(e){return e.hasEmittedFirstToggle||!e.isLarge?!1:e.renderSource&&e.renderVisual}var GA=El(`ACTIVITY_MOUNT_LIMIT`,3);function KA(){return n(()=>import(`./SourceEditor-D0oQT5qb.js`),__vite__mapDeps([87,1,40,2,41,42,11,43,44,45,46,47,48,49,50,15,16,13,7,17,18,10,3,51,52,36,12,6,4,53,54,55,20,56,57,58,59,31,32,33,34,60,61,62,63,35,64,65,66,88,21,86,82]),import.meta.url)}var qA=(0,Q.lazy)(async()=>({default:(await KA()).SourceEditor}));function JA(e,t,n){if(n<=0)return[];let r=e.filter(e=>!Ue(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 YA(e,t){return t.kind===`idle`?null:t.kind===`failed`&&t.failedDocNames.includes(e)?{kind:`failed`,title:Wc._({id:`MTs6g3`}),summary:t.reason===`clear-data-timeout`?Wc._({id:`Sc1bKE`,values:{docName:e}}):Wc._({id:`ovIGrT`,values:{docName:e}}),actionLabel:Wc._({id:`HpK_8d`})}:t.kind===`recovering`&&t.docNames.includes(e)?{kind:`recovering`,title:Wc._({id:`cF9DyA`}),summary:t.phase===`clearing-local-cache`?Wc._({id:`bmC18N`,values:{docName:e}}):Wc._({id:`pAgkuZ`,values:{docName:e}})}:null}function XA(e){let t=(0,$.c)(2),n;return t[0]===e?n=t[1]:(n=(0,Z.jsx)(Tl,{name:`activity-pool`,children:(0,Z.jsx)(ZA,{...e})}),t[0]=e,t[1]=n),n}function ZA(e){let t=(0,$.c)(15),{activeDocName:n,isSourceMode:r,editorPlaceholder:i,previousDocName:a,onNavigateBack:o,onRecycle:s}=e,{poolEntries:c,serverRestartRecovery:l}=mt(),{pages:u,loading:d}=Yi(),f=JA(c,n,GA),p=(0,Q.useRef)(``),m=f.map(QA).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)Qt(e);for(let e of i){let t=h.current.find(t=>t.docName===e)?.poolEventId;me(e,t&&t.length>0?t:crypto.randomUUID())}wl(`ok/activity/mount-list-change`,{active:n,mounted:t,evicted:r}),p.current=m,H(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)(ij,{entry:e,isActive:e.docName===n,isSourceMode:r,editorPlaceholder:i,isNewDoc:!d&&!u.has(e.docName)&&!hr(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 QA(e){return e.docName}function $A(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&&wl(`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&&(wl(`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&&wl(`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 ej(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)(Zb,{}),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)(qA,{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 tj(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)(ts,{className:`size-5`,"aria-hidden":`true`}):(0,Z.jsx)($o,{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:nj,children:[(0,Z.jsx)(ts,{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 nj(){return window.location.reload()}function rj(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 ij(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=YA(n.docName,u),t[0]=n.docName,t[1]=u,t[2]=d):d=t[2];let f=d,m=sw(n.docName)===`conflict`,h;t[3]===n.docName?h=t[4]:(h=()=>{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]=h);let[g]=(0,Q.useState)(h),_=n.provider.document.getText(`source`).length,[v,y]=(0,Q.useState)(i),[b,x]=(0,Q.useState)(!i),S,C;t[5]!==i||t[6]!==v||t[7]!==b?(S=()=>{i&&!v?y(!0):!i&&!b&&x(!0)},C=[i,v,b],t[5]=i,t[6]=v,t[7]=b,t[8]=S,t[9]=C):(S=t[8],C=t[9]),(0,Q.useEffect)(S,C);let w=UA({ytextLength:_,isSourceMode:i,visitedSource:v,visitedVisual:b}),T=(0,Q.useRef)(``),E=`${w.isLarge}-${w.renderSource}-${w.renderVisual}`,D,O;t[10]!==n.docName||t[11]!==w.isLarge||t[12]!==w.renderSource||t[13]!==w.renderVisual||t[14]!==E||t[15]!==i||t[16]!==_?(D=()=>{T.current!==E&&(T.current=E,w.isLarge&&wl(`ok/activity/defer-mount`,{docName:n.docName,ytextLength:_,isSourceMode:i,renderSource:w.renderSource,renderVisual:w.renderVisual}))},O=[E,w.isLarge,w.renderSource,w.renderVisual,n.docName,_,i],t[10]=n.docName,t[11]=w.isLarge,t[12]=w.renderSource,t[13]=w.renderVisual,t[14]=E,t[15]=i,t[16]=_,t[17]=D,t[18]=O):(D=t[17],O=t[18]),(0,Q.useEffect)(D,O);let k;t[19]===n.docName?k=t[20]:(k=()=>B(n.docName),t[19]=n.docName,t[20]=k);let[A]=(0,Q.useState)(k),j=A?.html??null,[M,N]=(0,Q.useState)(!1),P,F;t[21]!==n.docName||t[22]!==w.isLarge||t[23]!==w.renderSource||t[24]!==w.renderVisual||t[25]!==M||t[26]!==i||t[27]!==_?(P=()=>{WA({isLarge:w.isLarge,renderSource:w.renderSource,renderVisual:w.renderVisual,hasEmittedFirstToggle:M})&&(wl(`ok/cold/first-toggle`,{docName:n.docName,mountId:p(n.docName),ytextLength:_,modeEnteredFirst:i?`source`:`visual`}),N(!0))},F=[M,w.isLarge,w.renderSource,w.renderVisual,n.docName,_,i],t[21]=n.docName,t[22]=w.isLarge,t[23]=w.renderSource,t[24]=w.renderVisual,t[25]=M,t[26]=i,t[27]=_,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=A?.scrollTop,z;t[30]!==a||t[31]!==n||t[32]!==w.renderSource||t[33]!==w.renderVisual||t[34]!==r||t[35]!==m||t[36]!==o||t[37]!==i||t[38]!==c||t[39]!==l||t[40]!==g||t[41]!==s||t[42]!==f||t[43]!==j?(z=f?(0,Z.jsx)(tj,{view:f}):(0,Z.jsx)(Z.Fragment,{children:(0,Z.jsx)(IA,{activeDocName:n.docName,previousDocName:s,onNavigateBack:c,onRecycle:l,children:(0,Z.jsx)(Q.Suspense,{fallback:j?(0,Z.jsx)(rj,{html:j}):(0,Z.jsx)(Zb,{}),children:(0,Z.jsx)(OA,{docName:n.docName,provider:n.provider,children:m?(0,Z.jsx)(DA,{docName:n.docName,provider:n.provider}):(0,Z.jsxs)(`div`,{className:`flex h-full flex-col`,children:[!i&&(hr(n.docName)||Wt(n.docName)?(0,Z.jsx)(Q.Suspense,{fallback:null,children:(0,Z.jsx)(VA,{docName:n.docName,provider:n.provider})}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(RA,{provider:n.provider}),(0,Z.jsx)(Vi,{provider:n.provider})]})),(0,Z.jsxs)(`div`,{className:`relative flex-1`,children:[w.renderSource?(0,Z.jsx)(`div`,{className:i?`h-full`:`ok-mode-hidden h-full`,children:(0,Z.jsx)(ej,{entry:n,isActive:r,isSourceMode:i,editorPlaceholder:a})}):null,w.renderVisual?(0,Z.jsx)(`div`,{className:i?`ok-mode-hidden h-full`:`h-full`,children:(0,Z.jsx)(CO,{provider:n.provider,placeholder:a,isSourceMode:i,portalTarget:g},`${n.docName}-${String(o)}-${n.poolEventId}`)}):null]})]})})})})}),t[30]=a,t[31]=n,t[32]=w.renderSource,t[33]=w.renderVisual,t[34]=r,t[35]=m,t[36]=o,t[37]=i,t[38]=c,t[39]=l,t[40]=g,t[41]=s,t[42]=f,t[43]=j,t[44]=z):z=t[44];let V;t[45]!==r||t[46]!==R||t[47]!==z?(V=(0,Z.jsx)($A,{isActive:r,initialScrollTop:R,children:z}),t[45]=r,t[46]=R,t[47]=z,t[48]=V):V=t[48];let H;return t[49]!==I||t[50]!==L||t[51]!==V?(H=(0,Z.jsx)(Q.Activity,{mode:I,name:L,children:V}),t[49]=I,t[50]=L,t[51]=V,t[52]=H):H=t[52],H}function aj(e){let t=e.endsWith(`rem`)?`rem`:`px`;return{value:Number.parseFloat(e),unit:t}}function oj(e){let{value:t,unit:n}=aj(e);return n===`rem`?t*16:t}function sj(e,t){return`${t===`rem`?e.toFixed(1):Math.round(e)}${t}`}var cj=3600*24*7;function lj(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?uj:m,O=g===void 0?cj: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=oj(b),te;t[6]===x?te=t[7]:(te=oj(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:oj(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}=aj(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=sj(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=sj(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 uj(){}var dj=3600*24*7,fj=`18rem`,pj=`3rem`,mj=`app-file-sidebar`,hj=`14.625rem`,gj=`32rem`,_j=`sidebar_width`,vj=/^\d+(?:\.\d+)?(?:rem|px)$/,yj=Q.createContext(null);function bj(e){if(typeof document>`u`)return e;let t=document.cookie.split(`; `).find(e=>e.startsWith(`${_j}=`))?.split(`=`)[1];if(!t)return e;let n;try{n=decodeURIComponent(t)}catch{return e}return vj.test(n)?n:e}function xj(){let e=Q.use(yj);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e}function Sj(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?fj:c,[u]=Q.useState(wj),d;t[8]===u?d=t[9]:(d=()=>_w(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=ww();return Ew(`left`,_w(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),Dw(`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(Cj)},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: ${mw}px)`),t=()=>{let e=_w(u,window.innerWidth,`left`);p(e),C(Ew(`left`,e,ww())===`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(mj)?.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=>{kl(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":pj,...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)(yj.Provider,{value:H,children:K}),t[55]=H,t[56]=K,t[57]=ee):ee=t[57],ee}function Cj(e){return!e}function wj(){return kr()}function Tj(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}=$t(),{state:f,isDraggingRail:p}=xj();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:mj,"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 Ej(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}=$t(),{toggleSidebar:o,state:s}=xj(),c,l,u,d,p,m,h,g;if(t[4]!==a||t[5]!==s){let e=Al(`toggle-files-sidebar`);c=X,l=`trigger`,u=`sidebar-trigger`,d=`ghost`,p=`icon-sm`,m=s===`expanded`,h=mj,g=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]=p,t[11]=m,t[12]=h,t[13]=g}else c=t[6],l=t[7],u=t[8],d=t[9],p=t[10],m=t[11],h=t[12],g=t[13];let _;t[14]===n?_=t[15]:(_=Y(n),t[14]=n,t[15]=_);let v;t[16]!==r||t[17]!==o?(v=e=>{r?.(e),o()},t[16]=r,t[17]=o,t[18]=v):v=t[18];let y;t[19]===s?y=t[20]:(y=s===`expanded`?(0,Z.jsx)(f,{}):(0,Z.jsx)(rf,{}),t[19]=s,t[20]=y);let b;return t[21]!==c||t[22]!==i||t[23]!==l||t[24]!==y||t[25]!==u||t[26]!==d||t[27]!==p||t[28]!==m||t[29]!==h||t[30]!==g||t[31]!==_||t[32]!==v?(b=(0,Z.jsx)(c,{"data-sidebar":l,"data-slot":u,variant:d,size:p,"aria-expanded":m,"aria-controls":h,"aria-label":g,className:_,onClick:v,...i,children:y}),t[21]=c,t[22]=i,t[23]=l,t[24]=y,t[25]=u,t[26]=d,t[27]=p,t[28]=m,t[29]=h,t[30]=g,t[31]=_,t[32]=v,t[33]=b):b=t[33],b}function Dj(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}=$t(),{toggleSidebar:u,setWidth:d,state:f,width:p,setIsDraggingRail:m}=xj(),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:hj,maxResizeWidth:gj,setIsDraggingRail:m,widthCookieName:_j,widthCookieMaxAge:dj},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}=lj(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 Oj(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}=xj(),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 kj(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 Aj(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 jj(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 Mj(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 Nj(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?gi:`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 Pj(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?gi:`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 Fj(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 Ij(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 Lj(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 Rj=_i(`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 zj(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?gi:`button`,{state:m}=xj(),h;t[8]!==n||t[9]!==f||t[10]!==d?(h=Y(Rj({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)(Ts,{asChild:!0,children:_}),t[20]=_,t[21]=v);let y=m!==`collapsed`,b;t[22]!==y||t[23]!==c?(b=(0,Z.jsx)(Es,{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)(Os,{children:[v,b]}),t[25]=v,t[26]=b,t[27]=x):x=t[27],x}function Bj(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?gi:`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 Vj(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 Hj(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 Uj(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?gi:`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 Wj(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 Gj(){let e=await fetch(`/api/server-info`,{signal:AbortSignal.timeout(5e3)});if(!e.ok)return null;let t=await e.json(),n=Wr.safeParse(t);return n.success?n.data.currentBranch??null:null}var Kj=typeof window>`u`?{getSnapshot:()=>null,subscribe:()=>()=>{}}:Wj({fetchBranch:Gj,subscribeToEvent:vl}),qj=Kj.subscribe,Jj=Kj.getSnapshot;function Yj(){return(0,Q.useSyncExternalStore)(qj,Jj,Jj)}function Xj(){let e=(0,$.c)(6),t=Yj(),n=$i(),{state:r}=xj(),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&&Pa(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 Zj(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}=$t(),u=Xj();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)(ns,{className:`size-3`,"aria-hidden":!0}),l({id:`xWEvuo`}),(0,Z.jsx)(bt,{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)(Qj,{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 Qj(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)(Os,{children:[(0,Z.jsx)(Ts,{asChild:!0,children:(0,Z.jsx)(`span`,{tabIndex:0,className:`truncate`,"data-testid":`editor-footer-project-name`,children:r})}),(0,Z.jsx)(Es,{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)(Io,{"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 $j(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}=$t(),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 eM(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 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(`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 nM(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 rM(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)(Ki,{}),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 iM=1,aM=2,oM=4;function sM(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=Xr(n),u=e?e.kind===`template`?e.folder.split(`/`).filter(Boolean):[]:h(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>oM?[...u.slice(0,iM).map((e,t)=>d(e,t)),{kind:`ellipsis`,hidden:u.slice(iM,-aM)},...u.slice(-aM).map((e,t)=>d(e,u.length-aM+t))]:u.map((e,t)=>d(e,t));a=$j,t[8]===r?c=t[9]:(c=Y(`flex min-w-0 items-center`,r),t[8]=r,t[9]=c),i=eM,o=`min-w-0 flex-nowrap gap-1 overflow-hidden text-muted-foreground/70 text-xs`,s=f.map(cM)}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 cM(e,t){let n=e.kind===`segment`?e.key:`ellipsis`;return(0,Z.jsxs)(Q.Fragment,{children:[t>0&&(0,Z.jsx)(rM,{className:`shrink-0 text-muted-foreground/70 [&>svg]:size-3`}),e.kind===`ellipsis`?(0,Z.jsxs)(tM,{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)(kd,{className:`size-3.5`})}),(0,Z.jsx)(`span`,{className:`sr-only`,children:e.hidden.join(` / `)})]}):(0,Z.jsx)(tM,{className:`min-w-0`,children:(0,Z.jsx)(nM,{current:!1,className:`min-w-0 truncate font-normal text-muted-foreground/70`,title:e.value,children:e.value})})]},n)}var lM={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`},uM=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`,...lM,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},dM=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)(uM,{...e,viewBox:`0 0 256 256`,fill:`currentColor`,children:[n,r]}),t[2]=e,t[3]=i),i},fM=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)(uM,{...e,viewBox:`0 0 256 256`,fill:`currentColor`,children:[n,r]}),t[2]=e,t[3]=i),i};function pM(e){let t=(0,$.c)(29),{isSourceMode:n,onModeChange:r,sourceDisabled:i}=e,a=i===void 0?!1:i,{_:o}=$t(),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)(Ts,{children:(0,Z.jsx)(fM,{className:`size-4`})}),t[6]=d):d=t[6];let f;t[7]===u?f=t[8]:(f=(0,Z.jsx)(Fc,{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)(Es,{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)(Os,{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)(dM,{className:`size-4`}),t[14]=g):g=t[14];let _;t[15]!==a||t[16]!==h?(_=(0,Z.jsx)(Ts,{asChild:!0,children:(0,Z.jsx)(`div`,{children:(0,Z.jsx)(Fc,{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)(Es,{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)(Os,{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)(Lc,{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 mM=(0,Q.lazy)(async()=>({default:(await n(async()=>{let{SkillEditorActions:e}=await import(`./SkillEditorActions-85awfZeZ.js`);return{SkillEditorActions:e}},__vite__mapDeps([89,1,10,3,11,6,7,13,74,15,16,17,18,12,54,55,19,57,59,33,58,79,75,60,52,63,80,68,36,65]),import.meta.url)).SkillEditorActions}));function hM(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}=$t(),p;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(p=Ol(`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=Al(`toggle-document-panel`),u;t[26]===n?u=t[27]:(u=n?Xr(n):null,t[26]=n,t[27]=u);let p=u,m;t[28]===n?m=t[29]:(m=n?Wt(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)(sM,{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)(pM,{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)(mM,{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)(Os,{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)(Ts,{children:(0,Z.jsx)(Jd,{})})}),(0,Z.jsx)(Es,{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=Os,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)(Ts,{children:c?(0,Z.jsx)(of,{}):(0,Z.jsx)(af,{})}),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)(Es,{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 gM(e){let{activeDocName:t,deferredActiveDocName:n,mountResolved:r,syncResolved:i}=e;return t===null||t===n?!1:!(r&&i)}function _M(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 vM=`ok-terminal-height-v1`,yM=1/3,bM=.5;function xM(e){return Math.max(120,Math.round((Number.isFinite(e)?e:0)*bM))}function SM(e){let t=Number.isFinite(e)?e:0;return t<=0?240:Math.round(t*yM)}function CM(e,t){let n=xM(t);return Number.isFinite(e)?e<120?120:e>n?n:Math.round(e):Math.min(SM(t),n)}function wM(){return typeof window>`u`?0:window.innerHeight}function TM(e,t){try{let n=e??localStorage,r=t??wM(),i=n.getItem(vM);if(i==null)return CM(SM(r),r);let a=Number.parseInt(i,10);return CM(Number.isFinite(a)?a:SM(r),r)}catch{return 240}}function EM(e,t,n){try{let r=t??localStorage,i=n??wM();r.setItem(vM,String(CM(e,i)))}catch{}}function DM(){try{return typeof localStorage>`u`?240:TM()}catch{return 240}}function OM(e){let t=(0,$.c)(19),{dockPosition:n,onReveal:r,className:i}=e,{_:a}=$t(),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)(Gi,{"aria-hidden":`true`}):(0,Z.jsx)(bt,{"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)(Ts,{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)(Es,{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)(Os,{children:[f,m]}),t[16]=f,t[17]=m,t[18]=h):h=t[18],h}var kM=`terminal-dock-panel`;function AM(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}=Mn(),d=Fb(),[f,p]=(0,Q.useState)(!r),m;t[0]===u?m=t[1]:(m=Cu(u),t[0]=u,t[1]=m);let h=m.background,g=r&&l===`bottom`,_=!r&&l===`bottom`&&c!=null,[v]=(0,Q.useState)(jM),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(()=>{EM(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)(OM,{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)(IC,{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)(LC,{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)(IC,{id:kM,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)(FC,{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 jM(){return DM()}var MM=(0,Q.lazy)(async()=>({default:(await n(()=>import(`./ActivityModeContent-mJH5LtOR.js`),__vite__mapDeps([39,1,2,40,41,42,11,43,44,45,46,47,48,49,50,15,16,13,7,17,18,10,3,51,52,36,12,6,4,53,54,55,20,56,57,58,59,31,32,33,34,60,61,62,63,35,64,65,66,67,68]),import.meta.url)).ActivityModeContent})),NM=`300px`,PM=`600px`,FM=new Set([`doc-panel`,`terminal-column`,`agent-panel`]);function IM(e){let t=(0,$.c)(5),n;t[0]===e?n=t[1]:(n=(0,Z.jsx)(RM,{...e}),t[0]=e,t[1]=n);let r;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,Z.jsx)(LM,{}),t[2]=r):r=t[2];let i;return t[3]===n?i=t[4]:(i=(0,Z.jsx)(Tl,{name:`editor-area`,children:(0,Z.jsxs)(Ii,{children:[n,r]})}),t[3]=n,t[4]=i),i}function LM(){let e=(0,$.c)(5),t=La(),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)(AC,{open:t.open,onOpenChange:n}),e[2]=t.open,e[3]=n,e[4]=r):r=e[4],r}function RM(e){let t=(0,$.c)(243),{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,p=l===void 0?`right`:l,{_:m}=$t(),{resolvedTheme:h}=Mn(),g;t[0]===h?g=t[1]:(g=Cu(h),t[0]=h,t[1]=g);let _=g.background,{activeDocName:v,activeProvider:y,activeTarget:b,recycleDocument:x,docPanelMode:S,docPanelAgentId:C,docPanelExpandSignal:w}=mt(),{openDocumentTransition:T}=Dt(),{requestAddProperty:E}=Ni(),D=aw(y,v),O=cw(v,n===`source`?`source`:`wysiwyg`),k=Nw(y),A=k===`connected`||k===`synced`,M=sw(v)===`conflict`,[N,P]=(0,Q.useState)(!1),F,I;t[2]!==y||t[3]!==N?(F=()=>{y!=null&&!N&&P(!0)},I=[y,N],t[2]=y,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)(v),R=b?.kind===`missing`,z=!!v&&b?.kind!==`folder`,B;t[6]!==m||t[7]!==R?(B=R?m({id:`K-a33w`}):void 0,t[6]=m,t[7]=R,t[8]=B):B=t[8];let V=B,H=(0,Q.useSyncExternalStore)(Si.subscribe,Si.getSnapshot,Si.getSnapshot),U;t[9]!==b||t[10]!==H?(U=Ei(b,H),t[9]=b,t[10]=H,t[11]=U):U=t[11];let W=U,[G]=(0,Q.useState)(UM),K=G!==null,ee;t[12]===G?ee=t[13]:(ee=()=>_w(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=Fb(),se=Fb(),ce;t[17]===te?ce=t[18]:(ce=()=>Ew(`right`,te,ww())===`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=p===`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)(HM),Fe=(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(()=>{fw(e),Le.current=null},100)},t[29]=Re):Re=t[29];let ze=Re,[Be]=(0,Q.useState)(VM),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(()=>{jw(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=Ab(),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(BM);if(a==null)return;let o={};if(`doc-panel`in r&&(o[`doc-panel`]=e?0:Fe.current),`terminal-column`in r&&(o[`terminal-column`]=Ve.current),Object.keys(o).length===0)return;let s=_M({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?(Dw(`right`,e,`open`),et.current?ot(!1):oe.current?.expand()):(Dw(`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,ht;t[51]!==ot||t[52]!==G||t[53]!==oe?(pt=()=>{let e=window.matchMedia(`(min-width: ${hw}px)`),t=()=>{let e=_w(G,window.innerWidth,`right`);ne(e);let t=Ew(`right`,e,ww())===`collapsed`;ue(t),et.current?ot(t):t?oe.current?.collapse():oe.current?.expand()};return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},ht=[G,oe,ot],t[51]=ot,t[52]=G,t[53]=oe,t[54]=pt,t[55]=ht):(pt=t[54],ht=t[55]),(0,Q.useEffect)(pt,ht);let gt,_t;t[56]!==Xe||t[57]!==K?(gt=()=>{if(Xe==null||K)return;let e=new ResizeObserver(()=>{st.current(de.current)});return e.observe(Xe),()=>e.disconnect()},_t=[Xe,K],t[56]=Xe,t[57]=K,t[58]=gt,t[59]=_t):(gt=t[58],_t=t[59]),(0,Q.useEffect)(gt,_t);let vt,yt;t[60]!==ut||t[61]!==a?(vt=()=>{let e=e=>{a(e),ut()},t=Qm();return t&&e(t),eh(t=>{Qm(),e(t)})},yt=[a,ut],t[60]=ut,t[61]=a,t[62]=vt,t[63]=yt):(vt=t[62],yt=t[63]),(0,Q.useEffect)(vt,yt);let bt,xt;t[64]!==w||t[65]!==ut?(bt=()=>{w!==0&&ut()},xt=[w,ut],t[64]=w,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 Ot,kt;t[75]===q?(Ot=t[76],kt=t[77]):(Ot=()=>{window.okDesktop!=null&&window.okDesktop.editor.notifyViewMenuStateChanged({docPanelVisible:!q})},kt=[q],t[75]=q,t[76]=Ot,t[77]=kt),(0,Q.useEffect)(Ot,kt);let At,jt;t[78]===ft?(At=t[79],jt=t[80]):(At=()=>{if(window.okDesktop!=null)return window.okDesktop.onMenuAction(e=>{e===`toggle-doc-panel`&&ft()})},jt=[ft],t[78]=ft,t[79]=At,t[80]=jt),(0,Q.useEffect)(At,jt);let Mt,Nt;t[81]===ft?(Mt=t[82],Nt=t[83]):(Mt=()=>{if(window.okDesktop!=null)return;let e=e=>{kl(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=b?.kind===`large-file`?b.docName:v,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]===T?Ht=t[88]:(Ht=function(e){let t=fl(e);window.location.hash===t?T(e):window.location.hash=t},t[87]=T,t[88]=Ht);let Ut=Ht,Wt,Gt=null;if(b?.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]!==b.docName||t[93]!==b.limit||t[94]!==b.size||t[95]!==e?(n=(0,Z.jsx)(fC,{docName:b.docName,size:b.size,limit:b.limit,backNav:e}),t[92]=b.docName,t[93]=b.limit,t[94]=b.size,t[95]=e,t[96]=n):n=t[96],Wt=n}else if(b?.kind===`folder`){let e;t[97]!==K||t[98]!==f?(e=yT({terminalVisible:f,isEmbedded:K}),t[97]=K,t[98]=f,t[99]=e):e=t[99];let n=e,r;t[100]===b.folderPath?r=t[101]:(r=(0,Z.jsx)(cC,{folderPath:b.folderPath}),t[100]=b.folderPath,t[101]=r);let i;t[102]!==b.folderPath||t[103]!==n?(i=n?(0,Z.jsx)(oT,{folderPath:b.folderPath}):null,t[102]=b.folderPath,t[103]=n,t[104]=i):i=t[104];let a;if(t[105]!==r||t[106]!==i?(a=(0,Z.jsxs)(`div`,{className:`relative flex h-full min-h-0 flex-col`,children:[r,i]}),t[105]=r,t[106]=i,t[107]=a):a=t[107],Wt=a,S===`agent`&&C!==null){let e;t[108]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(LC,{withHandle:!0}),t[108]=e):e=t[108];let n;t[109]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsxs)(Z.Fragment,{children:[e,(0,Z.jsx)(IC,{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)(MM,{showBackButton:!1})})})]}),t[109]=n):n=t[109],Gt=n}}else if(b?.kind===`asset`){let e;t[110]!==b.assetPath||t[111]!==b.mediaKind?(e=(0,Z.jsx)(Xb,{assetPath:b.assetPath,mediaKind:b.mediaKind},b.assetPath),t[110]=b.assetPath,t[111]=b.mediaKind,t[112]=e):e=t[112],Wt=e}else if(b?.kind===`skill-file`){let e=`${b.scope}/${b.name}/${b.path}`,n;t[113]!==b.name||t[114]!==b.path||t[115]!==b.scope||t[116]!==e?(n=(0,Z.jsx)(xC,{scope:b.scope,name:b.name,path:b.path},e),t[113]=b.name,t[114]=b.path,t[115]=b.scope,t[116]=e,t[117]=n):n=t[117],Wt=n}else if(W){let e;t[118]===W?e=t[119]:(e=(0,Z.jsx)(hC,{nav:W},W.path),t[118]=W,t[119]=e),Wt=e}else if(!y||!v)if((typeof window<`u`?dl(window.location.hash):null)!==null)if(o!=null&&N){let e;t[120]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(Zb,{}),t[120]=e):e=t[120],Wt=e;let n;t[121]===Symbol.for(`react.memo_cache_sentinel`)?(n=(0,Z.jsx)(LC,{withHandle:!0,disabled:!0}),t[121]=n):n=t[121];let r=le?0:`${Pe}px`,i;t[122]===Symbol.for(`react.memo_cache_sentinel`)?(i=(0,Z.jsx)(`div`,{className:`min-h-0 flex-1`}),t[122]=i):i=t[122];let a;t[123]===r?a=t[124]:(a=(0,Z.jsxs)(Z.Fragment,{children:[n,(0,Z.jsx)(IC,{id:`doc-panel`,defaultSize:r,minSize:NM,maxSize:PM,collapsible:!0,collapsedSize:0,inert:!0,className:`flex flex-col bg-muted/20`,children:i})]}),t[123]=r,t[124]=a),Gt=a}else{let e;return t[125]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(Zb,{}),t[125]=e):e=t[125],e}else{let e=f?ye:null,n;t[126]===e?n=t[127]:(n=(0,Z.jsx)(kS,{terminalDock:e}),t[126]=e,t[127]=n),Wt=n}else{let e=n===`source`,o=!A,s=q,c;t[128]!==v||t[129]!==E?(c=function(){v&&E(v)},t[128]=v,t[129]=E,t[130]=c):c=t[130];let l=c,u;t[131]!==v||t[132]!==K||t[133]!==f?(u=vT({terminalVisible:f,isEmbedded:K,activeDocName:v}),t[131]=v,t[132]=K,t[133]=f,t[134]=u):u=t[134];let d=u,p=L??v,m=Ft??void 0,h;t[135]!==V||t[136]!==e||t[137]!==Ut||t[138]!==x||t[139]!==p||t[140]!==m?(h=(0,Z.jsx)(XA,{activeDocName:p,isSourceMode:e,editorPlaceholder:V,previousDocName:m,onNavigateBack:Ut,onRecycle:x}),t[135]=V,t[136]=e,t[137]=Ut,t[138]=x,t[139]=p,t[140]=m,t[141]=h):h=t[141];let g;t[142]!==v||t[143]!==e?(g=(0,Z.jsx)(tw,{activeDocName:v,isSourceMode:e}),t[142]=v,t[143]=e,t[144]=g):g=t[144];let _;t[145]!==v||t[146]!==L?(_=gM({activeDocName:v,deferredActiveDocName:L,mountResolved:v!==null&&j(v),syncResolved:v!==null&&Ie(v)})?(0,Z.jsxs)(`div`,{className:`absolute inset-0 z-10 bg-background`,children:[(0,Z.jsx)(Zb,{}),v===null?null:(0,Z.jsx)(pC,{docName:v})]}):null,t[145]=v,t[146]=L,t[147]=_):_=t[147];let y;t[148]!==h||t[149]!==g||t[150]!==_?(y=(0,Z.jsxs)(`div`,{className:`relative h-full`,children:[h,g,_]}),t[148]=h,t[149]=g,t[150]=_,t[151]=y):y=t[151];let b;t[152]!==v||t[153]!==M||t[154]!==s||t[155]!==e||t[156]!==r||t[157]!==l||t[158]!==Ce||t[159]!==o||t[160]!==ft?(b=!M&&(0,Z.jsx)(hM,{activeDocName:v,isSourceMode:e,sourceDisabled:o,onModeChange:r,showAddPropertyButton:!e,onAddProperty:l,isPanelCollapsed:s,onTogglePanel:ft,reserveRightGutter:Ce&&s}),t[152]=v,t[153]=M,t[154]=s,t[155]=e,t[156]=r,t[157]=l,t[158]=Ce,t[159]=o,t[160]=ft,t[161]=b):b=t[161];let C;t[162]!==v||t[163]!==Lt||t[164]!==e||t[165]!==d?(C=d?(0,Z.jsx)(oT,{docName:v,surface:e?`source`:`wysiwyg`,dismissed:Lt,onDismiss:()=>Rt(!0),onReopen:()=>Rt(!1)}):null,t[162]=v,t[163]=Lt,t[164]=e,t[165]=d,t[166]=C):C=t[166];let w;t[167]!==y||t[168]!==b||t[169]!==C?(w=(0,Z.jsxs)(`div`,{className:`relative min-h-0 flex-1`,children:[y,b,C]}),t[167]=y,t[168]=b,t[169]=C,t[170]=w):w=t[170];let T;t[171]!==Lt||t[172]!==d?(T=d&&Lt?{onReopen:()=>Rt(!1)}:null,t[171]=Lt,t[172]=d,t[173]=T):T=t[173];let k;t[174]!==Se||t[175]!==O||t[176]!==z||t[177]!==D||t[178]!==T?(k=(0,Z.jsx)(Zj,{stats:D,selectionStats:O,showStats:z,composerBadge:T,reserveRightGutter:Se}),t[174]=Se,t[175]=O,t[176]=z,t[177]=D,t[178]=T,t[179]=k):k=t[179];let N;t[180]!==w||t[181]!==k?(N=(0,Z.jsxs)(`div`,{className:`relative flex h-full flex-col`,children:[w,k]}),t[180]=w,t[181]=k,t[182]=N):N=t[182],Wt=N;let P=be&&q,F=!q,I;t[183]===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[183]=I):I=t[183];let R;t[184]!==q||t[185]!==F?(R=(0,Z.jsx)(LC,{withHandle:F,disabled:q,onPointerDown:I}),t[184]=q,t[185]=F,t[186]=R):R=t[186];let B=le?0:`${Pe}px`,H=P?`0px`:NM,U;t[187]===Symbol.for(`react.memo_cache_sentinel`)?(U=e=>{ue(e.asPercentage===0),e.inPixels>0&&Ne.current&&(Fe.current=e.inPixels,ze(e.inPixels))},t[187]=U):U=t[187];let W=!je&&`transition-[flex-grow] duration-200 ease-out motion-reduce:transition-none motion-reduce:duration-0`,G;t[188]===W?G=t[189]:(G=Y(`flex flex-col bg-muted/20`,W),t[188]=W,t[189]=G);let ee;t[190]!==v||t[191]!==i||t[192]!==S||t[193]!==e||t[194]!==a?(ee=(0,Z.jsx)(Bv,{docName:v,isSourceMode:e,activeTab:i,onActiveTabChange:a,mode:S}),t[190]=v,t[191]=i,t[192]=S,t[193]=e,t[194]=a,t[195]=ee):ee=t[195];let te;t[196]!==P||t[197]!==q||t[198]!==oe||t[199]!==B||t[200]!==H||t[201]!==G||t[202]!==ee?(te=(0,Z.jsx)(IC,{id:`doc-panel`,panelRef:oe,disabled:P,defaultSize:B,minSize:H,maxSize:PM,collapsible:!0,collapsedSize:0,onResize:U,inert:q,className:G,children:ee}),t[196]=P,t[197]=q,t[198]=oe,t[199]=B,t[200]=H,t[201]=G,t[202]=ee,t[203]=te):te=t[203];let ne;t[204]!==R||t[205]!==te?(ne=(0,Z.jsxs)(Z.Fragment,{children:[R,te]}),t[204]=R,t[205]=te,t[206]=ne):ne=t[206],Gt=ne}let Kt;t[207]!==d||t[208]!==c||t[209]!==o||t[210]!==ye||t[211]!==f||t[212]!==Wt?(Kt=o==null?Wt:(0,Z.jsx)(AM,{visible:f,onVisibleChange:c??zM,dockPosition:ye,onBottomContainer:he,onEditorRegion:_e,onReveal:d,children:Wt}),t[207]=d,t[208]=c,t[209]=o,t[210]=ye,t[211]=f,t[212]=Wt,t[213]=Kt):Kt=t[213];let qt=Kt,Jt;t[214]!==Be||t[215]!==He||t[216]!==c||t[217]!==se||t[218]!==be||t[219]!==_?(Jt=be?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(LC,{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)(IC,{id:`terminal-column`,panelRef:se,style:{backgroundColor:_},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[214]=Be,t[215]=He,t[216]=c,t[217]=se,t[218]=be,t[219]=_,t[220]=Jt):Jt=t[220];let Yt=Jt,Xt=Gt!=null&&!le||be,Zt;t[221]===Symbol.for(`react.memo_cache_sentinel`)?(Zt=e=>{Ze(e),Qe.current=e},t[221]=Zt):Zt=t[221];let Qt=je||He||void 0,en=be?`5%`:`30%`,tn;t[222]===Xt?tn=t[223]:(tn=Xt?{}:{defaultSize:`100%`},t[222]=Xt,t[223]=tn);let nn=!(je||He)&&`transition-[flex-grow] duration-200 ease-out motion-reduce:transition-none motion-reduce:duration-0`,rn;t[224]===nn?rn=t[225]:(rn=Y(nn),t[224]=nn,t[225]=rn);let an;t[226]!==qt||t[227]!==en||t[228]!==tn||t[229]!==rn?(an=(0,Z.jsx)(IC,{minSize:en,...tn,className:rn,children:qt}),t[226]=qt,t[227]=en,t[228]=tn,t[229]=rn,t[230]=an):an=t[230];let on;t[231]!==$e||t[232]!==Gt||t[233]!==Qt||t[234]!==an||t[235]!==Yt?(on=(0,Z.jsxs)(FC,{orientation:`horizontal`,groupRef:$e,"data-dragging":Qt,children:[an,Gt,Yt]}),t[231]=$e,t[232]=Gt,t[233]=Qt,t[234]=an,t[235]=Yt,t[236]=on):on=t[236];let sn;t[237]!==d||t[238]!==Ce?(sn=Ce?(0,Z.jsx)(OM,{dockPosition:`right`,onReveal:d,className:`top-2.5 right-0`}):null,t[237]=d,t[238]=Ce,t[239]=sn):sn=t[239];let cn;return t[240]!==on||t[241]!==sn?(cn=(0,Z.jsxs)(`div`,{className:`relative flex min-h-0 flex-1`,ref:Zt,children:[on,sn]}),t[240]=on,t[241]=sn,t[242]=cn):cn=t[242],cn}function zM(){}function BM(e){return!FM.has(e)}function VM(){return Mw()}function HM(){return pw()}function UM(){return kr()}function WM(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 GM(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 KM=1e3,qM=!1;function JM(e){return!!(e.localPrincipalId&&e.entryPrincipalId===e.localPrincipalId||!e.localPrincipalId&&e.entryClientId===e.localClientId)}function YM(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:ms(i)?a=i:(a=void 0,qM||(qM=!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`&&(JM({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=GM(i),{current:c,crossDoc:l}=a?us(a,n,Date.now()):{current:[],crossDoc:[]},u=XM,d=c.map(u),f=l.map(u),p=[...s,...d],m=f;o(e=>WM(e.current,p)&&WM(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,KM);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 XM(e){let{agentId:t,entry:n}=e;return{kind:`agent`,agentId:t,presence:n}}var ZM=!1,QM=new Set,$M=!1;function eN(){for(let e of QM)e()}function tN(e){ZM!==e&&(ZM=e,eN())}function nN(){return ZM}function rN(e){return QM.add(e),()=>{QM.delete(e)}}function iN(e){let t=[e.onUpdateRelaunching(()=>tN(!0)),e.onUpdateRelaunchFailed(()=>tN(!1))];return()=>{for(let e of t)e()}}function aN(){if($M||typeof window>`u`)return;let e=window.okDesktop;e&&($M=!0,iN(e))}function oN(){return(0,Q.useSyncExternalStore)(rN,nN,sN)}function sN(){return!1}var cN=`sync-status`;async function lN(e){try{let t=await kg(e);t.ok||hs.error(t.message,{id:cN,duration:1/0})}catch{}}function uN(e,t){let n=(0,$.c)(6),{_:r}=$t(),i=oN(),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){hs.dismiss(cN);return}o.current=!0;let e=window.okDesktop;hs.warning(r({id:`HGNCsl`}),{id:cN,duration:1/0,...e?{action:{label:r({id:`uaUc6t`}),onClick:()=>{lN(e)}}}:{}})}else o.current&&e===`synced`&&(o.current=!1,hs.success(r({id:`GhjUB_`}),{id:cN,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 dN=4,fN=3,pN={Bird:pd,Cat:bd,Dog:Od,Fish:Pd,Mouse:ff,Rabbit:df,Shrimp:vf,Snail:yf,Squirrel:Cf,Turtle:Nf};Object.freeze(Object.keys(pN));function mN(e){if(typeof e.principalId==`string`&&e.principalId.length>0)return{kind:`initials`};let t=e.name.split(` `)[1];return t&&Object.hasOwn(pN,t)?{kind:`animal`,animal:t}:{kind:`initials`}}var hN={claude:`Claude`,cursor:`Cursor`,windsurf:`Windsurf`,openai:`Codex`,github:`Copilot`,cline:`Cline`,bot:`Agent`};function gN(e){let t=(0,$.c)(28),{user:n,mode:r,tabCount:i}=e,{_:a}=$t(),o=mN(n),s=o.kind===`animal`?pN[o.animal]:void 0,c;t[0]===n.name?c=t[1]:(c=Sr(n.name),t[0]=n.name,t[1]=c);let l=c,u;t[2]===n.color?u=t[3]:(u=oi(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)(Ts,{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)(Es,{children:m}),t[23]=m,t[24]=b);let x;return t[25]!==y||t[26]!==b?(x=(0,Z.jsxs)(Os,{children:[y,b]}),t[25]=y,t[26]=b,t[27]=x):x=t[27],x}function _N(e){let t=hN[e.icon];return e.displayName||t||Wc._({id:`iEQQyu`})}function vN(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 yN(e){let t=(0,$.c)(33),{participant:n,crossDoc:r,scoped:i,onClickAgent:a}=e,{_:o}=$t(),{activeDocName:s}=mt(),{presence:c,agentId:l}=n,u=_N(c),d=vN(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)(fs,{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)(fs,{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)(Ts,{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)(Es,{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)(Os,{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?Wc._({id:`9euN0m`,values:{count:n}}):Wc._({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)(jt,{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)(gN,{user:e.user,mode:e.mode,tabCount:e.tabCount},e.clientId):(0,Z.jsx)(yN,{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)(yt,{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)($e,{children:[u,f]}),t[18]=u,t[19]=f,t[20]=p):p=t[20],p}function xN(e,t,n,r){return e.kind===`human`?(0,Z.jsx)(gN,{user:e.user,mode:e.mode,tabCount:e.tabCount},e.clientId):(0,Z.jsx)(yN,{participant:e,crossDoc:n,scoped:r===e.agentId,onClickAgent:t},e.agentId)}function SN(){let e=(0,$.c)(20),{activeProvider:t,activeDocName:n,systemProvider:r,openActivityPanel:i,docPanelMode:a,docPanelAgentId:o}=mt(),{current:s,crossDoc:c}=YM(t,r,n);if(uN(Nw(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,dN),n;e[6]===s?n=e[7]:(n=s.slice(dN),e[6]=s,e[7]=n);let r=n,u=c.slice(0,fN),d;e[8]===c?d=e[9]:(d=c.slice(fN),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=>xN(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=>xN(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 CN(){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 TN(e){let t=(0,$.c)(6),{className:n}=e,{_:r}=$t(),{channel:i}=CN();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)(qe,{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 EN(e,t){return t.trim()}function DN(e){return![``,`.`,`..`].includes(e)&&!e.includes(`/`)&&!e.includes(`\\`)&&!e.includes(`\0`)}function ON(e,t){let n=EN(e.kind,t),r=e.path.split(`/`);return r[r.length-1]=n,r.join(`/`)}function kN(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(Xc(e)){let t=s.get(Bu(e.docName,e.docExt));if(t){let n=Zc(t);return{kind:`asset`,path:t,assetExt:n,mediaKind:Gn(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(Yc(e))return{...e,path:IN(e.path,n)};if(Qc(e)){let t=s.get(e.path);return t&&Gc(t)?{kind:`document`,docName:Eu(t),docExt:qc(t),size:e.size,modified:e.modified}:{...e,path:t??IN(e.path,n)}}return e})}function AN(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=>Xc(e)?!i.has(e.docName)&&!BN(e.docName,n):Yc(e)?!BN(e.path,n):Qc(e)?!a.has(e.path)&&!BN(e.path,n):!0)}function jN(e,t){if(e.kind!==`asset`||t.some(t=>Qc(t)&&t.path===e.path))return e;let n=Uu(e.path,t);return n?{...e,path:n,name:n.split(`/`).pop()??n}:e}function MN(e,t,n,r=new Date().toISOString()){let i=!1,a=[...e],o=e=>{a.some(t=>LN(t,e))||(a.push(e),i=!0)};if(n.kind===`file`){let s=e.find(e=>Xc(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=>Yc(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(Xc(i)){let e=zN(i.docName,t.path,n.path);e&&c.has(e)&&o({...i,docName:e,modified:r});continue}if(Yc(i)){let e=RN(i.path,t.path,n.path);e&&o({...i,path:e,modified:r})}}return i?a:e}function NN(e,t){return e?t.find(t=>t.fromDocName===e)?.toDocName??e:null}function PN(e,t,n){return e.flatMap(e=>t===e.toDocName||!n(e.toDocName)?[e.fromDocName]:[e.fromDocName,e.toDocName])}function FN(e,t){let n=e.kind===`file`?Bu(e.path,e.docExt):e.path;return ea(t.contentDir,n,t.pathSeparator)}function IN(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 LN(e,t){return Xc(e)&&Xc(t)?e.docName===t.docName:Yc(e)&&Yc(t)||Qc(e)&&Qc(t)?e.path===t.path:!1}function RN(e,t,n){return e===t?n:zN(e,t,n)}function zN(e,t,n){return e.startsWith(`${t}/`)?`${n}${e.slice(t.length)}`:null}function BN(e,t){return!!t&&(e===t||e.startsWith(`${t}/`))}function VN(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)(Sp,{"data-slot":`context-menu`,...n}),t[2]=n,t[3]=r),r}function HN(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)(Cp,{"data-slot":`context-menu-trigger`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function UN(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)(Ep,{"data-slot":`context-menu-group`,...n}),t[2]=n,t[3]=r),r}function WN(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-sub`,...n}),t[2]=n,t[3]=r),r}function GN(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)(wp,{children:(0,Z.jsx)(Tp,{"data-slot":`context-menu-content`,className:i,...r})}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function KN(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)(Op,{"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 qN(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)(Ki,{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)(Np,{"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 JN(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)(Pp,{"data-slot":`context-menu-sub-content`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function YN(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)(Ap,{children:(0,Z.jsx)(Ui,{})})}),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)(kp,{"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 XN(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)(Dp,{"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 ZN(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)(jp,{"data-slot":`context-menu-separator`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var QN=`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`,$N=`border-border bg-background text-foreground hover:bg-background focus-visible:bg-background`,eP={start:[Ko.Space],cancel:[Ko.Esc],end:[Ko.Space,Ko.Enter]};function tP(e){return Y(QN,e?`opacity-100`:`pointer-events-none opacity-0 group-hover:pointer-events-auto group-hover:opacity-100`)}function nP(e){return e?void 0:-1}function rP({className:e,isDragging:t}){return Y(e,t&&$N)}function iP(e){return e.code===Ko.Enter&&e.target===e.currentTarget}function aP({event:e,hasKeyboardActivation:t,isDragging:n}){return e.defaultPrevented?`ignore`:!n&&t&&iP(e)?`activate-tab`:`delegate-sortable`}function oP({activeWidth:e,isDragging:t,outerStyle:n,transform:r,transition:i}){let a=t&&e?e:void 0;return{...n,transform:Zo.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 sP(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 cP(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 lP=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 Bo(e)},uP=[`.md`,`.mdx`],dP=`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`,fP=`z-10 rounded-t-lg rounded-b-none border-border border-b-0 bg-background text-foreground`,pP=Y(fP,`bg-transparent hover:bg-muted focus-visible:bg-muted border-transparent hover:border-border focus-visible:border-border`),mP=`flex h-full min-w-0 flex-1 cursor-pointer items-center overflow-hidden px-3 text-left text-[13px]`;function hP(e){return e.replace(/[^A-Za-z0-9_-]/g,`-`)}function gP(e){let t=fl(e);window.location.hash!==t&&(window.location.hash=t)}function _P(e){Math.abs(e.deltaX)>=Math.abs(e.deltaY)||e.currentTarget.scrollWidth<=e.currentTarget.clientWidth||(e.preventDefault(),e.currentTarget.scrollLeft+=e.deltaY)}function vP(e,t){let n=[t,...uP].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 yP(e){return e.metaKey||e.ctrlKey}var bP=1e3;function xP(e,t){return e<0||e>=t?null:e<8?String(e+1):e===t-1?`9`:null}function SP(e,t){return xP(e,t)}function CP(e,t){let n=xP(e,t);if(n)return[`Meta+${n}`,`Control+${n}`].join(` `)}function wP(e,t){if(!yP(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 TP(e){let t=(0,$.c)(3),{value:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=Y(tP(!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)(P,{className:`text-[10px]`,children:i})}),t[1]=i,t[2]=a),a}function EP(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:_}=Yo(u),v=p.current?.width,y;t[12]!==_||t[13]!==s||t[14]!==v||t[15]!==h||t[16]!==g?(y=oP({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=aP({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=rP({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 DP(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=Ht(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?(_=Ht(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)(HN,{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)(KN,{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)(KN,{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)(KN,{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)(ZN,{}),(0,Z.jsx)(KN,{"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)(GN,{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)(VN,{children:[y,M]}),t[49]=M,t[50]=y,t[51]=N):N=t[51],N}function OP(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}=$t();if(d){let e;return t[0]===d?e=t[1]:(e=(0,Z.jsx)(TP,{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)(uf,{"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=tP(m),t[15]=m,t[16]=h);let g;t[17]===a?g=t[18]:(g=nP(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)(gs,{"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 kP(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)(os,{"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 AP(e){let t=(0,$.c)(27),{accessibleLabel:n,activateTab:r,baseName:i,docName:a,enterRenameMode:o,extension:s,hideDocExtension:c,tabId:l}=e,{_:u}=$t(),d=sw(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)(kP,{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:mP,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 jP(){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:g,openTabs:_,pinTab:y,pinnedTabIds:b,reopenClosedTab:x,remapTabsForRename:S,reorderTabs:C,unpinTab:w,visibleTabIds:T}=mt(),{_:E}=$t(),{pageMeta:D}=Yi(),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?se(i):t?Ee(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]!==_?(ie=p?`${r??`__new-tab__`}\u0000${_.join(`\0`)}\u0000${m.join(`\0`)}`:re?`${re}\u0000${_.join(`\0`)}`:``,e[4]=r,e[5]=re,e[6]=p,e[7]=m,e[8]=_,e[9]=ie):ie=e[9];let ae=ie,oe,ce;e[10]===t?(oe=e[11],ce=e[12]):(oe=()=>{G.current=t},ce=[t],e[10]=t,e[11]=oe,e[12]=ce),(0,Q.useEffect)(oe,ce);let le,q;e[13]===Symbol.for(`react.memo_cache_sentinel`)?(le=()=>()=>{K.current!==null&&(window.clearTimeout(K.current),K.current=null)},q=[],e[13]=le,e[14]=q):(le=e[13],q=e[14]),(0,Q.useEffect)(le,q);let ue,de;e[15]===ae?(ue=e[16],de=e[17]):(ue=()=>{ae&&(O.current?.querySelector(`[data-active-tab="true"]`))?.scrollIntoView({block:`nearest`,inline:`nearest`})},de=[ae],e[15]=ae,e[16]=ue,e[17]=de),(0,Q.useEffect)(ue,de);let fe,pe;e[18]===j?(fe=e[19],pe=e[20]):(fe=()=>{j&&(V.current?.focus(),V.current?.select())},pe=[j],e[18]=j,e[19]=fe,e[20]=pe),(0,Q.useEffect)(fe,pe);let me,he;e[21]!==_||e[22]!==j?(me=()=>{!j||_.includes(j.tabId)||(U.current=!0,W.current=null,M(null),P(``),I(null),R(!1))},he=[_,j],e[21]=_,e[22]=j,e[23]=me,e[24]=he):(me=e[23],he=e[24]),(0,Q.useEffect)(me,he);let ge;e[25]===Symbol.for(`react.memo_cache_sentinel`)?(ge=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]=ge):ge=e[25];let _e=ge,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=EN(`file`,vP(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(!DN(t)){I(E({id:`P8yDjG`})),V.current?.focus();return}let i=ON({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 ht(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=Ot(Dr,r.body,`rename-path:tab`,{renamed:[],renamedAssets:[]}).renamed,o=G.current,c=NN(o,a);v(a);let l=!0;try{let e=PN(a,d(),f);await Promise.all(e.map(e=>s(e))),S(a),bl([`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}),hs.error(E({id:`MUBR8r`}))}U.current=!0,M(null),P(``),I(null),R(!1),H.current=!1,W.current=null,l&&c&&c!==o&&gP(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=cP(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,De;e[32]!==c||e[33]!==u||e[34]!==Se?(De=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]=De):De=e[35];let Oe=De,ke,Ae;e[36]!==o||e[37]!==a||e[38]!==r||e[39]!==re||e[40]!==p||e[41]!==m||e[42]!==g||e[43]!==x||e[44]!==T?(ke=()=>{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(yP(e)&&s(),kl(e,`tab-new`)){e.preventDefault(),g();return}if(kl(e,`tab-reopen-closed`)){e.preventDefault(),x();return}if(kl(e,`tab-next`)){e.preventDefault(),u(1);return}if(kl(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)}},Ae=[r,re,o,a,p,m,g,x,T],e[36]=o,e[37]=a,e[38]=r,e[39]=re,e[40]=p,e[41]=m,e[42]=g,e[43]=x,e[44]=T,e[45]=ke,e[46]=Ae):(ke=e[45],Ae=e[46]),(0,Q.useEffect)(ke,Ae);let Me;e[47]===Symbol.for(`react.memo_cache_sentinel`)?(Me={activationConstraint:{distance:8}},e[47]=Me):Me=e[47];let Ne;e[48]===Symbol.for(`react.memo_cache_sentinel`)?(Ne={coordinateGetter:Uo,keyboardCodes:eP},e[48]=Ne):Ne=e[48];let Pe=Xo(Lo(Vo,Me),Lo(Wo,Ne)),Fe=z,Ie;e[49]===Symbol.for(`react.memo_cache_sentinel`)?(Ie=function(){A(sP(O.current))},e[49]=Ie):Ie=e[49];let Le=Ie,Re;e[50]===Symbol.for(`react.memo_cache_sentinel`)?(Re=function(){A(null)},e[50]=Re):Re=e[50];let ze=Re,Be;e[51]!==ze||e[52]!==C||e[53]!==T?(Be=function(e){ze();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]=ze,e[52]=C,e[53]=T,e[54]=Be):Be=e[54];let Ve=Be,He=be?``:void 0,Ue;e[55]===Symbol.for(`react.memo_cache_sentinel`)?(Ue=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]=Ue):Ue=e[55];let We=_P,Ge;e[56]===Symbol.for(`react.memo_cache_sentinel`)?(Ge=Y(`flex items-end gap-1`,be&&`[-webkit-app-region:no-drag]`),e[56]=Ge):Ge=e[56];let Ke=zo,qe=lP,Je;e[57]===Symbol.for(`react.memo_cache_sentinel`)?(Je={container:typeof document<`u`?document.body:void 0},e[57]=Je):Je=e[57];let Ye=Go,Xe;e[58]===T?Xe=e[59]:(Xe=[...T],e[58]=T,e[59]=Xe);let Ze=Ro,Qe=T.map((e,t)=>{let n=z?SP(t,T.length):null,i=CP(t,T.length);if(Se.has(e)){let t=e===r;return(0,Z.jsx)(DP,{tabId:e,canPin:!1,openTabs:T,closeTab:c,closeTabs:Oe,pinTab:y,pinnedTabIds:b,unpinTab:w,children:(0,Z.jsxs)(EP,{tabId:e,activateFromKeyboard:()=>o(e),"aria-current":t?`page`:void 0,"aria-keyshortcuts":i,"data-active-tab":t?`true`:void 0,className:Y(dP,t?fP:pP),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:mP,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)(TP,{value:n}):(0,Z.jsx)(`button`,{type:`button`,"aria-label":E({id:`xCdTnb`}),"data-testid":`editor-new-tab-placeholder-close`,className:tP(Fe||t),tabIndex:nP(t),onClick:t=>{t.stopPropagation(),c(e)},children:(0,Z.jsx)(gs,{"aria-hidden":`true`,className:`size-3.5`})})]})},e)}let s=je(e),u=e===re,d=b.includes(e);if(s.kind===`folder`){let{baseName:t,label:r,prefix:o}=h(s.folderPath,`/`),c=`${o}${r}`;return(0,Z.jsx)(DP,{tabId:e,openTabs:T,closeTab:l,closeTabs:Oe,pinTab:y,pinnedTabIds:b,unpinTab:w,children:(0,Z.jsxs)(EP,{tabId:e,activateFromKeyboard:()=>a(e),"aria-current":u?`page`:void 0,"aria-keyshortcuts":i,"data-active-tab":u?`true`:void 0,className:Y(dP,u?fP:pP),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:mP,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)(OP,{accessibleLabel:c,closeTab:l,forceCloseVisible:Fe,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}=h(s.kind===`asset`?s.assetPath:s.path,``),c=`${o}${r}`;return(0,Z.jsx)(DP,{tabId:e,openTabs:T,closeTab:l,closeTabs:Oe,pinTab:y,pinnedTabIds:b,unpinTab:w,children:(0,Z.jsxs)(EP,{tabId:e,activateFromKeyboard:()=>a(e),"aria-current":u?`page`:void 0,"aria-keyshortcuts":i,"data-active-tab":u?`true`:void 0,className:Y(dP,u?fP:pP),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:mP,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)(OP,{accessibleLabel:c,closeTab:l,forceCloseVisible:Fe,isActive:u,isPinned:d,shortcutHint:n,tabId:e,unpinTab:w})]})},e)}let f=s.docName,p=D.get(f)?.docExt??`.md`,{baseName:m,extension:g,label:_,prefix:v}=h(f,p),x=`${v}${_}`,S=p===`.md`||p===`.mdx`,C=j?.tabId===e,O=`editor-tab-rename-error-${hP(f)}`;return(0,Z.jsx)(DP,{disabled:C,tabId:e,openTabs:T,closeTab:l,closeTabs:Oe,pinTab:y,pinnedTabIds:b,unpinTab:w,children:(0,Z.jsx)(EP,{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(dP,u?fP:pP,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)(RC,{className:`h-full min-w-0 flex-1 rounded-none border-0 bg-transparent dark:bg-transparent`,children:[(0,Z.jsx)(UC,{ref:V,value:N,disabled:L,"aria-label":E({id:`Dw1T_W`,values:{label:_}}),"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(vP(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)(BC,{align:`inline-end`,"aria-hidden":`true`,className:`pr-2 text-xs`,children:(0,Z.jsx)(HC,{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)(AP,{accessibleLabel:x,activateTab:a,baseName:m,docName:f,enterRenameMode:_e,extension:g,hideDocExtension:S,tabId:e}),(0,Z.jsx)(OP,{accessibleLabel:x,closeTab:l,forceCloseVisible:Fe,isActive:u,isPinned:d,shortcutHint:n,tabId:e,unpinTab:w})]})})},e)}),$e;e[60]!==Ye||e[61]!==Xe||e[62]!==Ze||e[63]!==Qe?($e=(0,Z.jsx)(Ye,{items:Xe,strategy:Ze,children:Qe}),e[60]=Ye,e[61]=Xe,e[62]=Ze,e[63]=Qe,e[64]=$e):$e=e[64];let et;e[65]!==Ke||e[66]!==ze||e[67]!==Ve||e[68]!==Le||e[69]!==Pe||e[70]!==!1||e[71]!==qe||e[72]!==Je||e[73]!==$e||e[74]!==Te?(et=(0,Z.jsx)(Ke,{sensors:Pe,autoScroll:!1,collisionDetection:qe,modifiers:Te,onDragStart:Le,onDragEnd:Ve,onDragCancel:ze,accessibility:Je,children:$e}),e[65]=Ke,e[66]=ze,e[67]=Ve,e[68]=Le,e[69]=Pe,e[70]=!1,e[71]=qe,e[72]=Je,e[73]=$e,e[74]=Te,e[75]=et):et=e[75];let tt;e[76]===E?tt=e[77]:(tt=E({id:`3YvS-c`}),e[76]=E,e[77]=tt);let nt;e[78]===Symbol.for(`react.memo_cache_sentinel`)?(nt=(0,Z.jsx)(Zt,{"aria-hidden":`true`}),e[78]=nt):nt=e[78];let rt;e[79]!==g||e[80]!==tt?(rt=(0,Z.jsx)(Ts,{asChild:!0,children:(0,Z.jsx)(X,{type:`button`,size:`icon-xs`,variant:`ghost`,"aria-label":tt,"data-testid":`editor-new-tab-button`,className:`first:mb-3 mb-1.5`,onClick:g,children:nt})}),e[79]=g,e[80]=tt,e[81]=rt):rt=e[81];let it;e[82]===Symbol.for(`react.memo_cache_sentinel`)?(it=(0,Z.jsx)(Es,{children:(0,Z.jsx)(J,{id:`3YvS-c`})}),e[82]=it):it=e[82];let at;e[83]===rt?at=e[84]:(at=(0,Z.jsxs)(Os,{children:[rt,it]}),e[83]=rt,e[84]=at);let ot;e[85]!==Ge||e[86]!==et||e[87]!==at?(ot=(0,Z.jsxs)(`div`,{className:Ge,children:[et,at]}),e[85]=Ge,e[86]=et,e[87]=at,e[88]=ot):ot=e[88];let st;return e[89]!==He||e[90]!==Ue||e[91]!==We||e[92]!==ot?(st=(0,Z.jsx)(`div`,{ref:O,"data-electron-drag":He,className:Ue,onWheel:We,children:ot}),e[89]=He,e[90]=Ue,e[91]=We,e[92]=ot,e[93]=st):st=e[93],st}var MP=(e,t,n)=>{if(e&&`reportValidity`in e){let r=Fa(n,t);e.setCustomValidity(r&&r.message||``),e.reportValidity()}},NP=(e,t)=>{for(let n in t.fields){let r=t.fields[n];r&&r.ref&&`reportValidity`in r.ref?MP(r.ref,n,e):r&&r.refs&&r.refs.forEach(t=>MP(t,n,e))}},PP=(e,t)=>{t.shouldUseNativeValidation&&NP(e,t);let n={};for(let r in e){let i=Fa(t.fields,r),a=Object.assign(e[r]||{},{ref:i&&i.ref});if(FP(t.names||Object.keys(e),r)){let e=Object.assign({},Fa(n,r));to(e,`root`,a),to(n,r,e)}else to(n,r,a)}return n},FP=(e,t)=>{let n=IP(t).replace(/[.*+?^${}()|\\]/g,`\\$&`);return e.some(e=>IP(e).match(`^${n}\\.\\d+`))};function IP(e){return e.replace(/[\[\]]/g,``)}function LP(){return LP=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},LP.apply(null,arguments)}function RP(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}function zP(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]=Da(o,t,n,i,l?[].concat(l,r.message):r.message)}e.shift()}return n}function BP(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(LP({},t,{path:[].concat(r.path,t.path)}))})}),t){var c=n[o].types,l=c&&c[r.code];n[o]=Da(o,t,n,i,l?[].concat(l,r.message):r.message)}e.shift()};e.length;)r();return n}function VP(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(RP(function(){return Promise.resolve(e[n.mode===`sync`?`parse`:`parseAsync`](r,t)).then(function(e){return a.shouldUseNativeValidation&&NP({},a),{errors:{},values:n.raw?Object.assign({},r):e}})},function(e){if(function(e){return Array.isArray(e?.issues)}(e))return{values:{},errors:PP(zP(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(RP(function(){return Promise.resolve((n.mode===`sync`?Yn:ur)(e,r,t)).then(function(e){return a.shouldUseNativeValidation&&NP({},a),{errors:{},values:n.raw?Object.assign({},r):e}})},function(e){if(function(e){return e instanceof mr}(e))return{values:{},errors:PP(BP(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 HP=`https://openknowledge.ai/api/subscribe`;async function UP(e,t){try{let n=await fetch(HP,{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 WP(e){let t=(0,$.c)(49),{source:n,title:r,description:i,onSuccess:a,onDismiss:o,autoFocus:s,compactSubmit:c,className:l}=e,{_:u}=$t(),[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=In({email:ir({message:u({id:`Wq6Wcm`})})});_=Ta,g=VP(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 UP(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)(Ui,{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)(gs,{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)(za,{control:b.control,name:`email`,render:e=>{let{field:t,fieldState:n}=e;return(0,Z.jsxs)(RC,{className:`h-10 rounded-xl`,children:[(0,Z.jsx)(BC,{className:`pl-2.5`,children:(0,Z.jsx)(Zd,{className:`size-4 text-muted-foreground opacity-60`})}),(0,Z.jsx)(UC,{...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)($o,{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)(lt,{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 GP=`https://github.com/inkeep/open-knowledge`,KP=`https://discord.com/invite/YujKpFN49`,qP=`https://x.com/OpenKnowledge`,JP=`ok-subscribe-card-v1`,YP={subscribed:!1,dismissed:!1,shownVersions:[]};function XP(e,t){return!e.subscribed&&!e.dismissed&&e.shownVersions.length<3&&!e.shownVersions.includes(t)}function ZP(e){return e===!0}function QP(e){return Array.isArray(e)?e.filter(e=>typeof e==`string`):[]}function $P(e){if(typeof e!=`object`||!e)return YP;let t=e;return{subscribed:ZP(t.subscribed),dismissed:ZP(t.dismissed),shownVersions:QP(t.shownVersions)}}function eF(e){try{let t=(e??localStorage).getItem(JP);return t==null?YP:$P(JSON.parse(t))}catch(e){return console.warn(`[subscribe-card-store] readPersistedState failed (corrupt/privacy/SSR)`,e),YP}}function tF(e,t){try{(t??localStorage).setItem(JP,JSON.stringify(e))}catch(e){console.warn(`[subscribe-card-store] writePersistedState failed (quota/privacy/SSR)`,e)}}function nF(e){let t=eF(e),n=new Set,r=!1;function i(){for(let e of n)e()}function a(n){t=n,tF(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=eF(e),i())}}}var rF=nF();function iF(){rF.install()}function aF(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 oF(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 sF(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 cF=[{key:`resources`,heading:{id:`s-MGs7`},links:[{label:{id:`TbjyhA`},href:`https://openknowledge.ai/docs`,icon:Mt},{label:{id:`PCNIuJ`},href:`${GP}/issues/new`,icon:Sd},{label:{id:`On0aF2`},href:`https://openknowledge.ai/`,icon:Ji}]},{key:`community`,heading:{id:`chL5IG`},links:[{label:`Discord`,href:KP,icon:aF},{label:`X (Twitter)`,href:qP,icon:sF},{label:`GitHub`,href:GP,icon:oF}]}],lF=`${GP}/releases`,uF=`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 dF(e){if(e<1e3)return String(e);let t=e/1e3;return`${t>=10?Math.round(t):t.toFixed(1)}k`}var fF=e=>{let t=(0,$.c)(12),{count:n}=e,{_:r}=$t(),i,a,o,s;t[0]!==r||t[1]!==n?(i=dF(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)(wf,{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},pF=e=>{let t=(0,$.c)(15),{link:n,trailing:r}=e,{_:i}=$t(),{label:a,href:o,icon:s}=n,c,l;t[0]===o?(c=t[1],l=t[2]):(c=e=>uu(e,o),l=e=>uu(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:uF,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},mF=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},hF=()=>{let e=(0,$.c)(28),{_:t}=$t(),[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 Cr({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)(et,{className:`size-4`}),e[5]=d):d=e[5];let f;e[6]===Symbol.for(`react.memo_cache_sentinel`)?(f=(0,Z.jsx)(Ts,{asChild:!0,children:(0,Z.jsx)(jt,{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)(Os,{children:[f,(0,Z.jsx)(Es,{children:(0,Z.jsx)(J,{id:`s-MGs7`})})]}),e[7]=p):p=e[7];let m;e[8]!==t||e[9]!==o?(m=cF.map((e,n)=>(0,Z.jsxs)(`div`,{className:Y(n>0&&`mt-3`),children:[(0,Z.jsx)(mF,{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)(pF,{link:e,trailing:e.href===`https://github.com/inkeep/open-knowledge`&&o!==null?(0,Z.jsx)(fF,{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)(mF,{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)(pF,{link:{label:{id:`3ePd3I`},href:lF,icon:Qd}}),e[14]=_):_=e[14];let v;e[15]===Symbol.for(`react.memo_cache_sentinel`)?(v=(0,Z.jsx)(jt,{asChild:!0,children:(0,Z.jsxs)(X,{variant:`ghost`,className:Y(uF,`h-auto w-full justify-start font-normal`),children:[(0,Z.jsx)(Zd,{"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)(yt,{side:`left`,align:`center`,sideOffset:20,className:`w-80`,children:(0,Z.jsx)(WP,{source:`resources_menu`,autoFocus:!0,onDismiss:()=>a(!1),onSuccess:gF})}),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)($e,{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)(yt,{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)($e,{open:n,onOpenChange:u,children:[p,S]}),e[25]=n,e[26]=S,e[27]=C):C=e[27],C};function gF(){return rF.markSubscribed()}var _F=50,vF=()=>{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,CC.preload()},_F))},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=Ua)},l=(0,Z.jsx)(gf,{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)(Ts,{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)(Os,{children:[u,(0,Z.jsx)(Es,{children:(0,Z.jsx)(J,{id:`Tz0i8g`})})]}),e[7]=d):d=e[7],d},yF=`https://openknowledge.ai/docs/features/share`;function bF(e){let t=(0,$.c)(50),{input:n,onClickWhenNoRemote:r}=e,{_:i}=$t(),{status:a}=ki(),[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=Ti(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 ja({...n,hasRemote:p,onClickWhenNoRemote:r},{clipboardWrite:ga,toastSuccess:OF,toastError:DF,logEvent:EF});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{hs.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)(_f,{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)(Oe,{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)(Hc,{ref:u,readOnly:!0,value:k,onFocus:TF,onClick:wF,onContextMenu:CF,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)(U,{copyContent:M,clipboardWrite:ga,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)(Ci,{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:yF,target:`_blank`,rel:`noopener noreferrer`,onClick:SF,onAuxClick:xF,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)(et,{"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)(yt,{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)($e,{open:v,onOpenChange:y,children:[w,B]}),t[46]=w,t[47]=B,t[48]=v,t[49]=V):V=t[49],V}function xF(e){return uu(e,yF)}function SF(e){return uu(e,yF)}function CF(e){return e.currentTarget.select()}function wF(e){return e.currentTarget.select()}function TF(e){return e.currentTarget.select()}function EF(e){return console.log(e)}function DF(e){e!==`Link ready but could not copy to clipboard.`&&hs.error(e)}function OF(e){return hs.success(e)}function kF(e){let t=(0,$.c)(35),{onSignIn:n,onSetIdentity:r,onOpenSearch:i}=e,{_:a}=$t(),{activeDocName:o,activeTarget:s}=mt(),c=o?Xr(o):null,{state:l,isDraggingRail:u}=xj(),d=sg(),f;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(f=Ol(`toggle-files-sidebar`),t[0]=f):f=t[0];let p=f,m=Ol(`command-palette`),[h,g]=(0,Q.useState)(!1),_;bb0:{if(s?.kind===`folder`){let e;t[1]===s.folderPath?e=t[2]:(e=Oa(s.folderPath),t[1]=s.folderPath,t[2]=e),_=e;break bb0}if(o&&!c){let e;t[3]===o?e=t[4]:(e=Ia(o),t[3]=o,t[4]=e),_=e;break bb0}if(!s&&!o){let e;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(e=Oa(``),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)(Os,{children:[(0,Z.jsx)(Ts,{asChild:!0,children:(0,Z.jsx)(Ej,{className:Y(`-ml-1 shrink-0 text-muted-foreground`,y&&`[-webkit-app-region:no-drag]`)})}),(0,Z.jsx)(Es,{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)(Os,{children:[(0,Z.jsx)(Ts,{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)(L,{"aria-hidden":`true`})})}),(0,Z.jsx)(Es,{children:(0,Z.jsx)(J,{id:`IN4UX8`,values:{searchShortcut:m}})})]}),(0,Z.jsx)(Ja,{orientation:`vertical`,className:`mr-1 h-4 shrink-0 data-vertical:self-center`}),(0,Z.jsx)(jP,{})]}),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 O;t[12]!==h||t[13]!==g||t[14]!==v||t[15]!==d?(O=!d&&(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(bF,{input:v,onClickWhenNoRemote:()=>g(!0)}),(0,Z.jsx)(vo,{open:h,onOpenChange:g})]}),t[12]=h,t[13]=g,t[14]=v,t[15]=d,t[16]=O):O=t[16];let k;t[17]!==r||t[18]!==n?(k=(0,Z.jsx)(Ya,{onSignIn:n,onSetIdentity:r}),t[17]=r,t[18]=n,t[19]=k):k=t[19];let A,j,M;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(A=(0,Z.jsx)(SN,{}),j=(0,Z.jsx)(Ja,{orientation:`vertical`,className:`h-4 shrink-0 data-vertical:self-center`}),M=(0,Z.jsx)(TN,{}),t[20]=A,t[21]=j,t[22]=M):(A=t[20],j=t[21],M=t[22]);let N;t[23]===d?N=t[24]:(N=!d&&(0,Z.jsx)(vF,{}),t[23]=d,t[24]=N);let P;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(P=(0,Z.jsx)(hF,{}),t[25]=P):P=t[25];let F;t[26]!==O||t[27]!==k||t[28]!==N?(F=(0,Z.jsxs)(`div`,{className:D,children:[O,k,A,j,M,N,P]}),t[26]=O,t[27]=k,t[28]=N,t[29]=F):F=t[29];let I;return t[30]!==F||t[31]!==x||t[32]!==w||t[33]!==E?(I=(0,Z.jsxs)(`header`,{"data-electron-drag":x,className:w,children:[E,F]}),t[30]=F,t[31]=x,t[32]=w,t[33]=E,t[34]=I):I=t[34],I}var AF=`open-knowledge:terminal-launch`;function jF(e,t,n=typeof window>`u`?new EventTarget:window){n.dispatchEvent(new CustomEvent(AF,{detail:{prompt:e,cli:t}}))}function MF(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(AF,n),()=>t.removeEventListener(AF,n)}function NF(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)(Xp,{"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 PF=_i(`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 FF(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(PF({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)(Zp,{"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 IF(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)(Qp,{"data-slot":`tabs-trigger`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}function LF(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)($p,{"data-slot":`tabs-content`,className:i,...r}),t[5]=r,t[6]=i,t[7]=a):a=t[7],a}var RF=(0,Q.lazy)(()=>n(()=>import(`./TerminalPanel-BNR82pgE.js`).then(e=>({default:e.TerminalPanel})),__vite__mapDeps([90,1,10,3,11,6,7,13,55,17,36,91,64,32,92]),import.meta.url));function zF(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}=_o(),f=yo(),{_:p}=$t(),m=d&&u===!1,h;t[0]!==p||t[1]!==f?(h=function(){if(f===null){hs.error(p({id:`V_6bJ4`}));return}let e=f(!0);e.ok||hs.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:VF,onError:BF,children:(0,Z.jsx)(Q.Suspense,{fallback:e,children:(0,Z.jsx)(RF,{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)(WF,{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 BF(e,t){console.error(`[TerminalGate] rendered fallback for the terminal panel`,e,t.componentStack)}function VF(e){return(0,Z.jsx)(HF,{...e})}function HF(e){let t=(0,$.c)(15),{error:n}=e,{_:r}=$t(),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:UF,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 UF(){return window.location.reload()}function WF(e){let t=(0,$.c)(20),{onEnable:n}=e,{_:r}=$t(),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 GF(e){let t=(0,$.c)(48),{selected:n,onLaunchSelected:r,onPickCli:i,onPickTerminal:a,className:o}=e,{_:s}=$t(),c=n===`terminal`,l;t[0]!==s||t[1]!==c||t[2]!==n?(l=s(c?{id:`AB4qw9`}:{id:`nP-KFo`,values:{0:zn[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)(Sf,{"aria-hidden":`true`,className:`size-3.5`}):(0,Z.jsx)(sa,{id:oa(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)(Zt,{"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)(Ts,{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)(Es,{side:`bottom`,sideOffset:8,children:u}),t[14]=u,t[15]=h);let g;t[16]!==m||t[17]!==h?(g=(0,Z.jsxs)(Os,{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)(Wi,{"aria-hidden":`true`,className:`size-3`}),t[21]=v):v=t[21];let y;t[22]===_?y=t[23]:(y=(0,Z.jsx)(hc,{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)(Oc,{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=va.map(e=>{let{displayName:t}=zn[e];return(0,Z.jsxs)(_c,{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)(sa,{id:oa(e),className:`size-4`,"aria-hidden":`true`}),(0,Z.jsx)(`span`,{className:`flex-1`,children:t}),n===e?(0,Z.jsx)(Ui,{"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)(Ac,{}),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)(Sf,{"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)(Ui,{"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)(_c,{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)(yc,{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)(Tc,{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 KF(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,{_}=$t(),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)(Os,{children:[(0,Z.jsx)(Ts,{asChild:!0,children:(0,Z.jsx)(IF,{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)(Es,{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)(gs,{"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)(FF,{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)(GF,{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)(Os,{children:[(0,Z.jsx)(Ts,{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)(nf,{"aria-hidden":`true`}):(0,Z.jsx)(sf,{"aria-hidden":`true`})})}),(0,Z.jsx)(Es,{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)(Os,{children:[(0,Z.jsx)(Ts,{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)(Ki,{"aria-hidden":`true`}):(0,Z.jsx)(Wi,{"aria-hidden":`true`})})}),(0,Z.jsx)(Es,{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)(NF,{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 qF(e){return`terminal-session-${e}`}function JF(e){e!==``&&document.querySelector(`[data-terminal-session="${e}"] .xterm-helper-textarea`)?.focus()}function YF(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}=$t(),[_]=(0,Q.useState)(tI),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:qF(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?qF(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=qF(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)(eI),[H,U]=(0,Q.useState)($F),W;t[12]===s?W=t[13]:(W=s??{},t[12]=s,t[13]=W);let G;t[14]!==B||t[15]!==W?(G=l_(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),v_(!1);let t=r_(e);V(t),s_(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),v_(!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(()=>JF(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)(QF),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(ZF);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)(()=>LE(e=>{let t=A.current,r=t===``?void 0:F.current.get(t);r==null?cu():(n.terminal.input(r,e),queueMicrotask(()=>JF(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(()=>JF(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&&JF(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)(KF,{sessions:Ne,activeSessionId:T,onSelect:E,onTabActivate:XF,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)(LF,{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)(zF,{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,gd.createPortal)(Pe,_),t[76]=_,t[77]=Pe,t[78]=Fe):Fe=t[78],Fe}function XF(e){return queueMicrotask(()=>JF(e))}function ZF(e,t){return{id:qF(t+1),launch:null,title:null,adoptPtyId:e.ptyId}}function QF(){}function $F(){return y_()}function eI(){return o_()}function tI(){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]=Jg(),[o,s]=(0,Q.useState)(i),[c,l]=(0,Q.useState)(!1),[u,d]=(0,Q.useState)(`auth`),[f,p]=(0,Q.useState)(Fv[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=Yg(),[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)(h_),A;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(A=function(e){k(e),m_(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??l_(o_(),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&&!__()&&z()},t[8]=x,t[9]=z,t[10]=B):B=t[10];let V=B,H=Oi(),{projectConfig:U,projectLocalConfig:W,projectLocalSynced:G,projectSynced:K}=Po(),{activeDocName:ee}=mt(),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=S_({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&&eu(ee,{kind:`raw-mdx`,detail:t}),s(`source`)};return window.addEventListener(Bg,e),()=>window.removeEventListener(Bg,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(aI):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){kl(e,`toggle-terminal-panel`)&&(e.preventDefault(),y(iI))};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=()=>MF((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(rI).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&&Wa()}},ye=[v],t[37]=v,t[38]=ve,t[39]=ye),(0,Q.useEffect)(ve,ye),Zg(H?.pausedReason),Qg();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)(kF,{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)(IM,{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)(YF,{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)(Ha,{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)(b_,{open:ie,onResolved:je}),t[65]=ie,t[66]=Me);let Ne;t[67]===Symbol.for(`react.memo_cache_sentinel`)?(Ne=(0,Z.jsx)(Lg,{}),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 rI(e){console.error(`[terminal] dock-state restore failed; staying hidden:`,e)}function iI(e){return!e}function aI(e){return!e}function oI(e){let t=fl($c(e));typeof window>`u`||window.location.hash!==t&&(window.location.hash=t)}function sI(){let e=(0,$.c)(11),{conflicts:t,loading:n,error:r}=Ra();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)(os,{"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)(os,{"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(cI),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 cI(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:()=>oI(e.file),children:[(0,Z.jsx)(os,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,Z.jsx)(`span`,{className:`min-w-0 truncate`,children:e.file})]})},e.file)}var lI=`<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>
|
|
@@ -1999,5 +1999,5 @@ Error generating stack: `+e.message+`
|
|
|
1999
1999
|
:host([${DJ}]) [data-item-focused="true"] {
|
|
2000
2000
|
--trees-focus-ring-color: transparent;
|
|
2001
2001
|
}
|
|
2002
|
-
`}\n${MK}\n${NK}`;function kJ(e){let t=e.split(`/`).pop()?.replace(/\.md$/i,``).toLowerCase();return!!t&&pJ.has(t)}function AJ(e){return e===`darwin`?Wc._({id:`LtSYdi`}):e===`win32`?Wc._({id:`qi1F96`}):Wc._({id:`e1Rn_k`})}function jJ(e){let t=(0,$.c)(18),{item:n,workspace:r,onClose:i}=e,{_:a}=$t(),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=AJ(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=ea(r.contentDir,wu(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)(Fo,{"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)(_c,{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 MJ(e,t){return Gu({kind:e.endsWith(`/`)?`directory`:`file`,name:e,path:e},t)}function NJ(e,t){return e!==t&&e.startsWith(t)}function PJ(e,t){let n=[...new Set(e)],r=n.filter(e=>e.endsWith(`/`));return n.filter(e=>!r.some(t=>NJ(e,t))).map(e=>MJ(e,t))}function FJ(e,t){return e===t||e.startsWith(`${t}/`)}function IJ(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 LJ(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)Xc(e)&&e.docName.startsWith(`${o.path}/`)?r.add(e.docName):Qc(e)&&e.path.startsWith(`${o.path}/`)&&a.add(e.path);for(let e of n){let t=Ku(e);FJ(t,o.path)&&i.add(t)}}return{docNames:r,folderPaths:i,assetPaths:a}}function RJ(e,t){return e.kind===`file`?t.kind===`file`&&e.path===t.createdPath:e.kind===`asset`?!1:FJ(t.createdPath,e.path)}function zJ(e){let t=(0,$.c)(69),{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}=$t(),x=Gu(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?Ku(n.path):null,t[3]=S,t[4]=n.path,t[5]=k):k=t[5];let A=fo(k),j=A.state.status===`ready`?(A.state.data.folder.templates_available?.length??0)>0:!0,M=s.getSelectedPaths(),N=M.includes(x.treePath)?PJ(M,y):[],P=N.length>1?N:[x],F=P.length,I=Wc._({id:`djjdjr`,values:{deleteCount:F}}),L;t[6]!==v||t[7]!==S||t[8]!==n||t[9]!==a?(L=v?null:S?ia({folderRelativePath:wu(n),workspace:a}):ba({docName:Eu(n.path),workspace:a}),t[6]=v,t[7]=S,t[8]=n,t[9]=a,t[10]=L):L=t[10];let R=L,z;t[11]===r?z=t[12]:(z=()=>r.close({restoreFocus:!1}),t[11]=r,t[12]=z);let B=z,V;t[13]===r?V=t[14]:(V=()=>r.close(),t[13]=r,t[14]=V);let H=V,{status:U}=ki(),W=U?.hasRemote===!0,G;t[15]!==v||t[16]!==S||t[17]!==n.path||t[18]!==x?(G=v||x.kind===`asset`?null:S?Oa(Ku(n.path)):Ia(Eu(n.path)),t[15]=v,t[16]=S,t[17]=n.path,t[18]=x,t[19]=G):G=t[19];let K=G,ee=W&&K!==null,te;t[20]!==b||t[21]!==W||t[22]!==K?(te=()=>{K&&ja({...K,hasRemote:W,onClickWhenNoRemote:()=>{hs.error(b({id:`WyQxwa`}))}},{clipboardWrite:ga,toastSuccess:HJ,toastError:VJ,logEvent:BJ})},t[20]=b,t[21]=W,t[22]=K,t[23]=te):te=t[23];let ne=te,re;t[24]!==ee||t[25]!==H||t[26]!==ne?(re=ee?(0,Z.jsxs)(_c,{"data-testid":`file-tree-menu-share`,onSelect:()=>{H(),ne()},children:[(0,Z.jsx)(_f,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`Z8lGw6`})]}):null,t[24]=ee,t[25]=H,t[26]=ne,t[27]=re):re=t[27];let ie=re,ae;t[28]!==b||t[29]!==l?(ae=e=>{if(l===null)return;let t=l.patch({appearance:{sidebar:{showHiddenFiles:e}}});t.ok||(console.warn(`[FileTree] showHiddenFiles toggle rejected:`,Qn(t.error)),hs.error(b({id:`P47EWZ`}),{description:Qn(t.error)}))},t[28]=b,t[29]=l,t[30]=ae):ae=t[30];let oe=ae,se=0,ce=0;if(S){let e=Ru(n.path);for(let t of _)(t===e||t.startsWith(e))&&(se++,Tq(s.getItem(t))?.isExpanded()&&ce++)}let le=S&&ce<se,q=S&&ce>0,ue;t[31]===H?ue=t[32]:(ue=e=>{e||H()},t[31]=H,t[32]=ue);let de;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(de=(0,Z.jsx)(hc,{asChild:!0,children:(0,Z.jsx)(`span`,{"aria-hidden":`true`,"data-file-tree-context-menu-root":`true`,className:`block size-px`})}),t[33]=de):de=t[33];let fe;t[34]!==b||t[35]!==i||t[36]!==w||t[37]!==O||t[38]!==H||t[39]!==B||t[40]!==I||t[41]!==P||t[42]!==j||t[43]!==oe||t[44]!==o||t[45]!==R||t[46]!==E||t[47]!==v||t[48]!==S||t[49]!==n||t[50]!==s||t[51]!==c||t[52]!==C||t[53]!==g||t[54]!==f||t[55]!==m||t[56]!==p||t[57]!==h||t[58]!==d||t[59]!==ie||t[60]!==D||t[61]!==q||t[62]!==le||t[63]!==x||t[64]!==a?(fe=(0,Z.jsx)(yc,{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)(_c,{disabled:i,onSelect:()=>{B(),d(`file`,Ku(n.path))},children:[(0,Z.jsx)(xf,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`HdkSiO`})]}),j?(0,Z.jsxs)(mc,{children:[(0,Z.jsxs)(kc,{disabled:i,children:[(0,Z.jsx)(Za,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`Uuj_R4`})]}),(0,Z.jsx)(nc,{children:(0,Z.jsx)(wq,{parentDir:Ku(n.path),onSelectTemplate:e=>{B(),f(Ku(n.path),e)},ItemComponent:_c})})]}):null,(0,Z.jsxs)(_c,{disabled:i,onSelect:()=>{B(),d(`folder`,Ku(n.path))},children:[(0,Z.jsx)(Ld,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`96G6Re`})]}),(0,Z.jsx)(Ac,{}),(0,Z.jsx)(jJ,{item:n,workspace:a,onClose:H}),(0,Z.jsx)(aa,{input:R,installStates:o.installStates,isElectronHost:o.isElectronHost,dispatch:o.dispatch}),ie,(0,Z.jsxs)(mc,{children:[(0,Z.jsxs)(kc,{children:[(0,Z.jsx)(xo,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`oCZkaG`})]}),(0,Z.jsxs)(nc,{children:[(0,Z.jsx)(_c,{disabled:!a,onSelect:()=>{a&&(H(),fJ(ea(a.contentDir,wu(n),a.pathSeparator),`full`))},children:(0,Z.jsx)(J,{id:`oQA-cA`})}),(0,Z.jsx)(_c,{onSelect:()=>{H(),fJ(wu(n),`relative`)},children:(0,Z.jsx)(J,{id:`s061i4`})})]})]}),(0,Z.jsx)(Ac,{}),(0,Z.jsx)(Cc,{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)(Ac,{}):null,le?(0,Z.jsxs)(_c,{onSelect:()=>{H(),h(n.path)},children:[(0,Z.jsx)(Ff,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`OlAl5i`})]}):null,q?(0,Z.jsxs)(_c,{onSelect:()=>{H(),g(n.path)},children:[(0,Z.jsx)(Fd,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`qvWGzP`})]}):null,(0,Z.jsx)(Ac,{}),(0,Z.jsxs)(_c,{disabled:i,onSelect:()=>{x.kind!==`asset`&&(H(),p(x))},children:[(0,Z.jsx)(Co,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`euc6Ns`})]}),(0,Z.jsxs)(_c,{disabled:i,onSelect:()=>{B(),s.startRenaming(n.path)},children:[(0,Z.jsx)(Do,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`2wxgft`})]}),(0,Z.jsxs)(_c,{"data-testid":`file-tree-menu-hide`,disabled:!w,onSelect:()=>{if(!c||!C)return;H();let e=XK(C),t=io(c.current()),n=ho(t,e);if(n===t)return;c.patch(Ka(n));let r=C.path.split(`/`).pop()||C.path;hs.success(b({id:`4xtLTl`,values:{basename:r}}),{description:b({id:`nWv1ja`}),duration:5e3})},children:[(0,Z.jsx)(Ve,{"aria-hidden":`true`}),E]}),(0,Z.jsxs)(_c,{variant:`destructive`,disabled:i,onSelect:()=>{H(),m(P)},children:[(0,Z.jsx)(To,{"aria-hidden":`true`}),I]})]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(jJ,{item:n,workspace:a,onClose:H}),!v&&(0,Z.jsx)(aa,{input:R,installStates:o.installStates,isElectronHost:o.isElectronHost,dispatch:o.dispatch}),ie,(0,Z.jsxs)(mc,{children:[(0,Z.jsxs)(kc,{children:[(0,Z.jsx)(xo,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`oCZkaG`})]}),(0,Z.jsxs)(nc,{children:[(0,Z.jsx)(_c,{disabled:!a,onSelect:()=>{a&&(H(),fJ(ea(a.contentDir,wu(n),a.pathSeparator),`full`))},children:(0,Z.jsx)(J,{id:`oQA-cA`})}),(0,Z.jsx)(_c,{onSelect:()=>{H(),fJ(wu(n),`relative`)},children:(0,Z.jsx)(J,{id:`s061i4`})})]})]}),(0,Z.jsx)(Ac,{}),v?null:(0,Z.jsxs)(_c,{disabled:i,onSelect:()=>{H(),p(x)},children:[(0,Z.jsx)(Co,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`euc6Ns`})]}),(0,Z.jsxs)(_c,{disabled:i,onSelect:()=>{B(),s.startRenaming(n.path)},children:[(0,Z.jsx)(Do,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`2wxgft`})]}),C?(0,Z.jsxs)(_c,{"data-testid":`file-tree-menu-hide`,disabled:!w,onSelect:()=>{if(!c)return;H();let e=XK(C),t=io(c.current()),n=ho(t,e);if(n===t)return;c.patch(Ka(n));let r=C.path.split(`/`).pop()||C.path;hs.success(b({id:`OD0FCX`,values:{basename:r}}),{description:b({id:`nWv1ja`}),duration:5e3})},children:[(0,Z.jsx)(Ve,{"aria-hidden":`true`}),E]}):null,(0,Z.jsxs)(_c,{variant:`destructive`,disabled:i,onSelect:()=>{H(),m(P)},children:[(0,Z.jsx)(To,{"aria-hidden":`true`}),I]})]})}),t[34]=b,t[35]=i,t[36]=w,t[37]=O,t[38]=H,t[39]=B,t[40]=I,t[41]=P,t[42]=j,t[43]=oe,t[44]=o,t[45]=R,t[46]=E,t[47]=v,t[48]=S,t[49]=n,t[50]=s,t[51]=c,t[52]=C,t[53]=g,t[54]=f,t[55]=m,t[56]=p,t[57]=h,t[58]=d,t[59]=ie,t[60]=D,t[61]=q,t[62]=le,t[63]=x,t[64]=a,t[65]=fe):fe=t[65];let pe;return t[66]!==ue||t[67]!==fe?(pe=(0,Z.jsxs)(Tc,{open:!0,modal:!1,onOpenChange:ue,children:[de,fe]}),t[66]=ue,t[67]=fe,t[68]=pe):pe=t[68],pe}function BJ(e){return console.log(e)}function VJ(e){return hs.error(e)}function HJ(e){return hs.success(e)}async function UJ(e,t,n,r){try{let i=await fetch(`/api/documents?showAll=true&dir=${encodeURIComponent(e)}&depth=1`,{signal:t,headers:Rq});if(zq(i)){let e=await Hq(i);return{kind:`entries`,entries:ol(e.entries),truncated:e.truncated}}let a=await ht(i,n);if(!a.ok)return{kind:`http-error`,title:a.title};let o=Bn.safeParse(a.body);return o.success?{kind:`entries`,entries:ol(o.data.documents),truncated:o.data.truncated===!0}:{kind:`http-error`,title:r}}catch(e){return e instanceof Bq?{kind:`http-error`,title:e.message}:{kind:`network-error`,cause:e}}}function WJ(e){let t=(0,$.c)(356),{ref:n,onContentHeightChange:r}=e,{_:i,i18n:a}=$t(),{activeDocName:o,activeTarget:s,closeTabs:c,closeDocument:l,closeAndClearForRename:u,getPoolActiveDocName:d,poolHas:f,isNewTabActive:p,openTarget:m,prewarm:h,remapTabsForRename:g}=mt(),{notifySidebarFileSelected:_}=xj(),{resolvedTheme:y}=Mn(),{addPage:b,pageMeta:x}=Yi(),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]!==C||t[3]!==_||t[4]!==m?(w=function(e,t){m(C(e,t),{tabBehavior:`replace-active`}),tl(fl(e)),_()},t[2]=C,t[3]=_,t[4]=m,t[5]=w):w=t[5];let T=w,E;t[6]!==_||t[7]!==m?(E=function(e){let t=el(e);m({kind:`folder`,target:e,folderPath:e},{tabBehavior:`replace-active`}),tl(t),_()},t[6]=_,t[7]=m,t[8]=E):E=t[8];let D=E,O;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(O=[],t[9]=O):O=t[9];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=oN(),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}=Ra(),[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[10]===Symbol.for(`react.memo_cache_sentinel`)?(ce=new Set,t[10]=ce):ce=t[10];let le=(0,Q.useRef)(ce),q=(0,Q.useRef)(k),ue=(0,Q.useRef)(x),de;t[11]!==k||t[12]!==D||t[13]!==T||t[14]!==_||t[15]!==m?(de=function(e,t){let n=t===void 0?k:t,r=dq(e,n);if(r.kind===`none`){console.debug(`[FileTree] Dropped selection for unknown docName:`,vu(e));return}if(r.kind===`asset`){m({kind:`asset`,target:r.path,assetPath:r.path,mediaKind:r.mediaKind},{tabBehavior:`replace-active`}),tl(r.hash),_();return}if(r.kind===`folder`){D(r.path);return}let i=n.find(e=>Xc(e)&&e.docName===r.path);T(r.path,i?.size)},t[11]=k,t[12]=D,t[13]=T,t[14]=_,t[15]=m,t[16]=de):de=t[16];let fe=de,pe;t[17]!==_||t[18]!==m?(pe=function(e,t){m({kind:`asset`,target:e,assetPath:e,mediaKind:(t??q.current).find(t=>Qc(t)&&t.path===e)?.mediaKind??null},{tabBehavior:`replace-active`}),tl(ul(e)),_()},t[17]=_,t[18]=m,t[19]=pe):pe=t[19];let me=pe,he=(0,Q.useRef)(o),ge;t[20]===k?ge=t[21]:(ge=new Set(k.filter(Qc).map(_Y)),t[20]=k,t[21]=ge);let _e=ge,ve=(0,Q.useRef)(_e),ye;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(ye=[],t[22]=ye):ye=t[22];let be=(0,Q.useRef)(ye),xe=(0,Q.useRef)(null),Se=(0,Q.useRef)(gY),Ce=(0,Q.useRef)(null),we=(0,Q.useRef)(null),Te=(0,Q.useRef)(!1),Ee=(0,Q.useRef)(!1),De=(0,Q.useRef)(null),Oe;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(Oe={row:null,root:null},t[23]=Oe):Oe=t[23];let ke=(0,Q.useRef)(Oe),je=(0,Q.useRef)(hY),Me=(0,Q.useRef)(null),Ne;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(Ne=new Map,t[24]=Ne):Ne=t[24];let Pe=(0,Q.useRef)(Ne),Fe;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(Fe=new Set,t[25]=Fe):Fe=t[25];let Ie=(0,Q.useRef)(Fe),Le;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(Le=new Map,t[26]=Le):Le=t[26];let Re=(0,Q.useRef)(Le),ze=(0,Q.useRef)(0),Be;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(Be=new Set,t[27]=Be):Be=t[27];let Ve=(0,Q.useRef)(Be),He=(0,Q.useRef)(mY),Ue=(0,Q.useRef)(pY),We=(0,Q.useRef)(!1),Ge=(0,Q.useRef)(null),Ke=(0,Q.useRef)(null),qe=(0,Q.useRef)(fY),Je=(0,Q.useRef)(dY),Ye=(0,Q.useRef)(uY),Xe=(0,Q.useRef)(lY),Ze=(0,Q.useRef)(s),[Qe,$e]=(0,Q.useState)(!1),et;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(et=function(){R.current!==null&&(clearTimeout(R.current),R.current=null)},t[28]=et):et=t[28];let tt=et,nt;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(nt=function(){tt(),I(!1)},t[29]=nt):nt=t[29];let rt=nt,it;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(it=function(e){rt(),P(e)},t[30]=it):it=t[30];let at=it,ot;t[31]===i?ot=t[32]:(ot=function(){if(tt(),nN()){P(null),I(!0),R.current=setTimeout(()=>{R.current=null,Ge.current?.()},TJ);return}I(!1),P(i({id:`34qyH5`}))},t[31]=i,t[32]=ot);let st=ot,ct=(0,Q.useRef)(!0),lt;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(lt=()=>{if(ct.current){ct.current=!1;return}Ge.current?.()},t[33]=lt):lt=t[33];let ut;t[34]===L?ut=t[35]:(ut=[L],t[34]=L,t[35]=ut),(0,Q.useEffect)(lt,ut);let dt,ft;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(dt=()=>tt,ft=[],t[36]=dt,t[37]=ft):(dt=t[36],ft=t[37]),(0,Q.useEffect)(dt,ft);let pt,gt;t[38]!==k.length||t[39]!==j?(pt=()=>{if(j||k.length===0)return;let e=Ke.current?.querySelector(SL)?.shadowRoot;if(!e)return;let t=e,n=function(){De.current!==null&&clearTimeout(De.current),De.current=setTimeout(()=>{Ee.current=!1,De.current=null},0)},r=function(e){if(!(e instanceof DragEvent))return;let t=yY(e),n=t?.dataset.itemPath;if(!n)return;let r=gq(t.dataset.itemType===`folder`?Ru(n):n,q.current,ue.current);r&&(De.current!==null&&(clearTimeout(De.current),De.current=null),Ee.current=!0,e.dataTransfer?.setData(bu,Nu(r)))},i=function(e){if(!(e instanceof DragEvent)||!Fu(e))return;let t=xY(e);if(!t){uJ(ke);return}e.preventDefault(),e.stopPropagation(),e.dataTransfer&&(e.dataTransfer.dropEffect=`copy`),dJ(ke,t)},a=function(e){if(!(e instanceof DragEvent)||!Fu(e))return;let n=e.relatedTarget;n instanceof Node&&t.contains(n)||uJ(ke)},o=function(e){if(!(e instanceof DragEvent)||!Fu(e))return;let t=xY(e),n=ku(e);if(!t||n.length===0){uJ(ke);return}e.preventDefault(),e.stopPropagation(),uJ(ke),je.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),uJ(ke),De.current!==null&&(clearTimeout(De.current),De.current=null),Ee.current=!1}},gt=[k.length,j],t[38]=k.length,t[39]=j,t[40]=pt,t[41]=gt):(pt=t[40],gt=t[41]),(0,Q.useEffect)(pt,gt);let{selectedFilePath:_t,selectedFolderPath:vt,navigationPath:yt}=uq(s,p?null:o),bt=_t?Bu(_t,k.find(e=>Xc(e)&&e.docName===_t)?.docExt):vt?Ru(vt):s?.kind===`asset`?s.assetPath:null,xt=ae?null:bt,St=pa().states,{dispatch:Ct}=xa(),wt;t[42]!==Ct||t[43]!==St?(wt={installStates:St,isElectronHost:typeof window<`u`&&window.okDesktop!=null,dispatch:Ct},t[42]=Ct,t[43]=St,t[44]=wt):wt=t[44];let Tt=wt,{okignoreBinding:Et,projectLocalBinding:Dt,merged:kt}=Po(),At=kt?.appearance?.sidebar?.showHiddenFiles??!1,jt;t[45]===Symbol.for(`react.memo_cache_sentinel`)?(jt=()=>Me.current===null,t[45]=jt):jt=t[45];let Mt=jt,Nt;t[46]===Symbol.for(`react.memo_cache_sentinel`)?(Nt=[],t[46]=Nt):Nt=t[46];let Pt;t[47]===Symbol.for(`react.memo_cache_sentinel`)?(Pt={set:`complete`,spriteSheet:bJ,byFileExtension:{md:{name:gJ,viewBox:Ae},mdx:{name:gJ,viewBox:Ae}}},t[47]=Pt):Pt=t[47];let Ft;t[48]===Symbol.for(`react.memo_cache_sentinel`)?(Ft={contextMenu:{enabled:!0,triggerMode:`both`,buttonVisibility:`when-needed`}},t[48]=Ft):Ft=t[48];let It;t[49]===Symbol.for(`react.memo_cache_sentinel`)?(It={canDrag:Mt,canDrop:Mt,onDropComplete:e=>Xe.current(e),onDropError:cY},t[49]=It):It=t[49];let Lt,Rt;t[50]===Symbol.for(`react.memo_cache_sentinel`)?(Lt={canRename:Mt,onRename:e=>Je.current(e),onError:e=>Ye.current(e)},Rt=e=>qe.current(e),t[50]=Lt,t[51]=Rt):(Lt=t[50],Rt=t[51]);let zt;t[52]===i?zt=t[53]:(zt={paths:Nt,initialExpansion:`closed`,fileTreeSearchMode:`hide-non-matches`,initialVisibleRowCount:18,stickyFolders:!0,...AK,icons:Pt,unsafeCSS:OJ,composition:Ft,dragAndDrop:It,renaming:Lt,onSelectionChange:Rt,renderRowDecoration:e=>{let{item:t}=e;if(t.kind===`file`){let e=q.current.find(e=>Xc(e)&&Bu(e.docName,e.docExt)===t.path);if(e?.isSymlink){let t=e.targetPath;return{icon:mJ,title:i(t?{id:`JE21eh`,values:{targetPath:t}}:{id:`BQu9Pg`})}}return kJ(t.path)?{icon:hJ,title:i({id:`i9toLO`})}:null}let n=q.current.find(e=>Yc(e)&&Ru(e.path)===Ru(t.path));if(n?.isSymlink){let e=n.targetPath;return{icon:mJ,title:i(e?{id:`JE21eh`,values:{targetPath:e}}:{id:`BQu9Pg`})}}return null}},t[52]=i,t[53]=zt);let{model:Bt}=kK(zt),Vt;t[54]===Bt?Vt=t[55]:(Vt=function(e){let t=Bt.getItem(e)??Bt.getItem(Ru(e));return t?.isDirectory()?Ru(Ku(t.getPath())):e},t[54]=Bt,t[55]=Vt);let Ht=Vt,Ut,Wt;t[56]===k?(Ut=t[57],Wt=t[58]):(Wt=Du(k),Ut=Su(Wt),t[56]=k,t[57]=Ut,t[58]=Wt);let Gt=Ut,qt=(0,Q.useRef)(Wt),Jt;t[59]===k?Jt=t[60]:(Jt=Iu(k),t[59]=k,t[60]=Jt);let Xt=Jt,Zt=(0,Q.useRef)(Xt),Qt=vt?zu(Ru(vt)).slice(0,-1):zu(xt??yt),en=Qt.join(`\0`),tn;t[61]===Bt?tn=t[62]:(tn=()=>{let e=new Set;for(let t of Zt.current)Tq(Bt.getItem(t))?.isExpanded()&&e.add(t);return e},t[61]=Bt,t[62]=tn);let nn=tn,rn;t[63]===nn?rn=t[64]:(rn=e=>{let t=new Set(Iu(e??q.current)),n=nn();for(let e of be.current)n.add(e);return[...n].filter(e=>t.has(e))},t[63]=nn,t[64]=rn);let an=rn,on;t[65]!==an||t[66]!==Bt?(on=e=>{let t=Du(e??q.current);Bt.resetPaths(t,{initialExpandedPaths:an(e)})},t[65]=an,t[66]=Bt,t[67]=on):on=t[67];let sn=on,cn;t[68]!==i||t[69]!==st?(cn=async function(e){let t=ze.current,n=new AbortController;Re.current.set(e,n);let r=await UJ(Ku(e),n.signal,i({id:`8RtNI0`}),i({id:`HlmZBk`}));if(Re.current.get(e)===n&&Re.current.delete(e),n.signal.aborted||t!==ze.current)return;if(r.kind===`network-error`){st(),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),at(r.title);return}let a=We.current,o=gl(r.entries,a);Ie.current.add(e),A(t=>Gq(t,e,o,Pe.current)),P(null),rt(),r.truncated&&B(r.entries.length)},t[68]=i,t[69]=st,t[70]=cn):cn=t[70];let ln=cn,un;t[71]!==nn||t[72]!==ln?(un=()=>{let e=nn(),t=Ve.current;Ve.current=e;for(let n of e){if(t.has(n)||Ie.current.has(n)||Re.current.has(n))continue;let e=Ku(n);q.current.find(t=>Yc(t)&&t.path===e)?.hasChildren!==!1&&ln(n)}},t[71]=nn,t[72]=ln,t[73]=un):un=t[73];let dn=un,fn;t[74]!==nn||t[75]!==ln?(fn=()=>{for(let e of nn())Ie.current.has(e)||Re.current.has(e)||ln(e)},t[74]=nn,t[75]=ln,t[76]=fn):fn=t[76];let pn=fn,mn;t[77]!==Bt||t[78]!==sn?(mn=(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=>Xc(e)&&e.docName===r);if(n==null||Bt.getItem(i)==null)continue;let s=Bu(i,t.find(e=>Xc(e)&&e.docName===i)?.docExt??n.docExt);Bt.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);Bt.getItem(n)!=null&&(Bt.getItem(e)??Bt.move(n,e),o=e,a+=1)}a!==0&&(sn(t),o!=null&&Bt.focusPath(o))},t[77]=Bt,t[78]=sn,t[79]=mn):mn=t[79];let hn=mn,gn;t[80]===Symbol.for(`react.memo_cache_sentinel`)?(gn=e=>{Ce.current=Pu(e)},t[80]=gn):gn=t[80];let _n=gn,vn;t[81]===Symbol.for(`react.memo_cache_sentinel`)?(vn=e=>ve.current.has(e),t[81]=vn):vn=t[81];let yn=vn,bn;t[82]!==i||t[83]!==b||t[84]!==D||t[85]!==T||t[86]!==sn?(bn=async function(e){if(e.kind===`asset`||Me.current!==null)return;let t=()=>{H(null),Me.current=null};Me.current=e.path,H(e.path),P(null);try{let n=await ht(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){hs.error(n.title),sn(),t();return}let r=Ot(er,n.body,`duplicate-path`,null);if(r===null){let e=i({id:`67f-3g`});hs.error(e),P(e),bl([`files`,`backlinks`,`graph`]),sn(),t();return}for(let e of r.duplicatedDocNames)b(e);A(t=>{let n=MN(t,e,r);return sn(n),_n(n),n}),bl([`files`,`backlinks`,`graph`]),r.path!==e.path&&(r.kind===`folder`?D(r.path):T(r.path)),hs.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),hs.error(i({id:`EBVbtP`}),{description:r}),sn(),t()}},t[82]=i,t[83]=b,t[84]=D,t[85]=T,t[86]=sn,t[87]=bn):bn=t[87];let xn=bn,Sn=(0,Q.useRef)(xn),Cn;t[88]===xn?Cn=t[89]:(Cn=()=>{Sn.current=xn},t[88]=xn,t[89]=Cn),(0,Q.useEffect)(Cn);let wn=function(e){let t=sJ(e);if(!t||cJ(t))return!1;let n=Bt.getFocusedPath()??Bt.getSelectedPaths()[0]??null;if(!n||n.endsWith(`/`)||yn(n))return!1;let r=cJ(n);if(!r)return!1;let i=Ru(t);if(!Zt.current.includes(i))return!1;let a=`${t}${r}`;return qt.current.includes(a)?!1:(cr({sourcePath:n,destinationPath:a,isFolder:!1}),Bt.move(n,a),!0)},Tn;t[90]===Symbol.for(`react.memo_cache_sentinel`)?(Tn=e=>{let t=e??xe.current;!t||xe.current!==t||(t.disposeCommitListener(),xe.current=null)},t[90]=Tn):Tn=t[90];let En=Tn,Dn;t[91]!==i||t[92]!==En||t[93]!==l||t[94]!==c||t[95]!==sn?(Dn=async function(e,t){let n=t===void 0?{}:t,r=n.updateUi??!0,a=n.restoreLocation??r;En(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 ht(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?hs.error(c):console.warn(`[FileTree] cleanup pending create failed: ${c}`),r&&(H(null),sn());return}}catch(t){if(console.warn(`[FileTree] cleanup pending create failed:`,t),r){let t=e.kind,n=e.createdPath;hs.error(i({id:`_TDESN`,values:{kind:t,createdPath:n}}))}r&&(H(null),sn());return}r&&(e.kind===`file`?l(e.createdPath):c([Yt(e.createdPath)],{force:!0})),r&&A(t=>{let n=AN(t,e.kind===`file`?[e.createdPath]:[],e.kind===`folder`?e.createdPath:void 0);return _n(n),n}),bl([`files`,`backlinks`,`graph`]),a&&(window.location.hash=e.previousHash),r&&H(null)},t[91]=i,t[92]=En,t[93]=l,t[94]=c,t[95]=sn,t[96]=Dn):Dn=t[96];let On=Dn,kn,An;t[97]===Symbol.for(`react.memo_cache_sentinel`)?(kn=()=>()=>{let e=xe.current;e&&Se.current(e,{restoreLocation:!1,updateUi:!1}).catch(sY)},An=[],t[97]=kn,t[98]=An):(kn=t[97],An=t[98]),(0,Q.useEffect)(kn,An);let jn;t[99]!==i||t[100]!==st?(jn=()=>{let e=!0,t=null,n=Lq(async function(){t?.abort();let n=new AbortController;t=n,ze.current+=1;for(let e of Re.current.values())e.abort();Re.current.clear(),Ie.current.clear();try{let t=await fetch(`/api/documents?showAll=true&dir=&depth=1`,{signal:n.signal,headers:Rq});if(zq(t)){let r=We.current,i=!1,{entries:a,truncated:o}=await Hq(t,{onBatch:t=>{if(!e||n.signal.aborted)return;let a=gl(ol(t),r);a.length!==0&&(A(e=>Wq(e,a)),i||(i=!0,P(null),rt(),M(!1)))}});if(!e)return;let s=gl(ol(a),r);A(e=>Gq(e,``,s,Pe.current)),P(null),rt(),B(o?a.length:null),Ue.current()}else{let n=await ht(t,i({id:`8RtNI0`}));if(!e)return;if(!n.ok)at(n.title),B(null);else{let e=Bn.safeParse(n.body);if(!e.success)at(i({id:`HlmZBk`})),B(null);else{let t=We.current,n=gl(ol(e.data.documents),t);A(e=>Gq(e,``,n,Pe.current)),P(null),rt(),B(e.data.truncated===!0?e.data.documents.length:null),Ue.current()}}}}catch(t){let r=t;if(n.signal.aborted)return;e&&(r instanceof Bq?at(r.message):st()),console.warn(`[FileTree] fetch failed:`,r)}e&&M(!1)},()=>t?.abort());Ge.current=()=>n.request(),n.request();let r=()=>{document.visibilityState===`visible`&&n.request()};window.addEventListener(`focus`,r),window.addEventListener(`visibilitychange`,r);let a=xl(e=>{e.includes(`files`)&&n.request()});return()=>{e=!1,Ge.current=null,n.dispose();for(let e of Re.current.values())e.abort();Re.current.clear(),window.removeEventListener(`focus`,r),window.removeEventListener(`visibilitychange`,r),a()}},t[99]=i,t[100]=st,t[101]=jn):jn=t[101];let Nn;t[102]===i?Nn=t[103]:(Nn=[i],t[102]=i,t[103]=Nn),(0,Q.useEffect)(jn,Nn);let Pn=(0,Q.useRef)(!0),Fn;t[104]===Symbol.for(`react.memo_cache_sentinel`)?(Fn=()=>{if(Pn.current){Pn.current=!1;return}Ge.current?.()},t[104]=Fn):Fn=t[104];let In;t[105]===At?In=t[106]:(In=[At],t[105]=At,t[106]=In),(0,Q.useEffect)(Fn,In);let Ln,Rn;t[107]===Symbol.for(`react.memo_cache_sentinel`)?(Ln=()=>{let e=!0;return fetch(`/api/workspace`).then(async t=>{let n=await t.json();if(!e||!t.ok)return;let r=Ot(zr,n,`workspace`,null);r&&ie({contentDir:r.contentDir,pathSeparator:r.pathSeparator})}).catch(oY),()=>{e=!1}},Rn=[],t[107]=Ln,t[108]=Rn):(Ln=t[107],Rn=t[108]),(0,Q.useEffect)(Ln,Rn);let zn;t[109]!==an||t[110]!==Bt||t[111]!==Gt?(zn=()=>{if(Ce.current===Gt){Ce.current=null;return}Bt.resetPaths(qt.current,{initialExpandedPaths:an()})},t[109]=an,t[110]=Bt,t[111]=Gt,t[112]=zn):zn=t[112];let Hn;t[113]!==Bt||t[114]!==Gt?(Hn=[Bt,Gt],t[113]=Bt,t[114]=Gt,t[115]=Hn):Hn=t[115],(0,Q.useEffect)(zn,Hn),Dq(Bt,xt,en,Te,Gt);let Un,Wn;t[116]!==Bt||t[117]!==r?(Un=()=>{if(!r)return;let e=0,t=0,n=()=>Ke.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=Bt.subscribe(a);return window.addEventListener(`resize`,a),()=>{cancelAnimationFrame(e),cancelAnimationFrame(t),o.disconnect(),c(),window.removeEventListener(`resize`,a)}},Wn=[r,Bt],t[116]=Bt,t[117]=r,t[118]=Un,t[119]=Wn):(Un=t[118],Wn=t[119]),(0,Q.useEffect)(Un,Wn);let Gn;t[120]===Symbol.for(`react.memo_cache_sentinel`)?(Gn=()=>{oe(!1)},t[120]=Gn):Gn=t[120];let Kn;t[121]===bt?Kn=t[122]:(Kn=[bt],t[121]=bt,t[122]=Kn),(0,Q.useEffect)(Gn,Kn);let qn,Jn;t[123]===ae?(qn=t[124],Jn=t[125]):(qn=()=>{se.current=ae;for(let e of le.current)e()},Jn=[ae],t[123]=ae,t[124]=qn,t[125]=Jn),(0,Q.useEffect)(qn,Jn);let Yn;t[126]!==xt||t[127]!==j||t[128]!==Bt?(Yn=()=>{j||!xt||cq(Bt)},t[126]=xt,t[127]=j,t[128]=Bt,t[129]=Yn):Yn=t[129];let Xn;t[130]!==en||t[131]!==xt||t[132]!==j||t[133]!==Bt||t[134]!==Gt?(Xn=[xt,en,Gt,j,Bt],t[130]=en,t[131]=xt,t[132]=j,t[133]=Bt,t[134]=Gt,t[135]=Xn):Xn=t[135],(0,Q.useEffect)(Yn,Xn);let Zn,Qn;t[136]===Bt?(Zn=t[137],Qn=t[138]):(Zn=()=>Bt.subscribe(()=>{if(!Bt.isSearchOpen())for(let e of be.current){let t=Tq(Bt.getItem(e));t&&!t.isExpanded()&&t.expand()}}),Qn=[Bt],t[136]=Bt,t[137]=Zn,t[138]=Qn),(0,Q.useEffect)(Zn,Qn);let $n,nr;t[139]===Bt?($n=t[140],nr=t[141]):($n=()=>Bt.subscribe(()=>He.current()),nr=[Bt],t[139]=Bt,t[140]=$n,t[141]=nr),(0,Q.useEffect)($n,nr);let rr,ir;t[142]===Bt?(rr=t[143],ir=t[144]):(rr=()=>Bt.onMutation(`remove`,e=>{let t=xe.current;!t||e.path!==t.renamePath||Se.current(t)}),ir=[Bt],t[142]=Bt,t[143]=rr,t[144]=ir),(0,Q.useEffect)(rr,ir);let ar;t[145]!==b||t[146]!==u||t[147]!==d||t[148]!==me||t[149]!==D||t[150]!==T||t[151]!==f||t[152]!==hn||t[153]!==g?(ar=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??he.current,l=new Map,p=new Map;for(let e of q.current){if(Xc(e)){let t=o.find(t=>t.fromPath===Bu(e.docName,e.docExt))?.toPath;t&&l.set(e.docName,t);continue}if(Qc(e)){let t=o.find(t=>t.fromPath===e.path)?.toPath;t&&Gc(t)&&p.set(e.path,Eu(t))}}let m=c?l.get(c)??null:null,h=r?.folderPath??(Ze.current?.kind===`folder`?Ze.current.folderPath:null),_=h?Kt(h,a):null,y=r?.assetPath??(Ze.current?.kind===`asset`?Ze.current.assetPath:null),x=y?p.get(y)??null:null,S=m?null:x??NN(c,e),C=m??(y?x?null:o.find(e=>e.fromPath===y)?.toPath??Kt(y,a):null);v(e);let w=[...PN(e,d(),f),...l.keys()];await Promise.all(w.map(e=>u(e)));for(let t of e)b(t.toDocName);for(let e of p.values())b(e);g(e,a,o);let E=null;A(t=>{let n=kN(t,e,a,o,s);return E=n,hn(t,n,e,o),_n(n),n}),h&&_&&_!==h?D(_):S&&S!==c?(T(S),lJ(S)):C&&(m||C!==y)&&me(C,E??q.current),bl([`files`,`backlinks`,`graph`])},t[145]=b,t[146]=u,t[147]=d,t[148]=me,t[149]=D,t[150]=T,t[151]=f,t[152]=hn,t[153]=g,t[154]=ar):ar=t[154];let sr=ar;async function cr(e){let t=!e.isFolder&&yn(e.sourcePath),n=t?e.sourcePath:ju(e.sourcePath,e.isFolder);H(n),P(null);try{let r=Kc(e.sourcePath,e.destinationPath,e.isFolder),a=!e.isFolder&&!t&&!Gc(r.destinationPath),o=t||a?r.destinationPath:ju(r.destinationPath,e.isFolder),s=e.isFolder?{kind:`folder`,fromPath:Ku(n),toPath:Ku(o)}:t||a?{kind:`asset`,fromPath:n,toPath:o}:{kind:`file`,fromPath:Eu(n),toPath:o},c={docName:he.current,folderPath:Ze.current?.kind===`folder`?Ze.current.folderPath:null,assetPath:Ze.current?.kind===`asset`?Ze.current.assetPath:null},l=await ht(await fetch(`/api/rename-path`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(s)}),i({id:`gijbne`}));if(!l.ok){hs.error(l.title),sn();let e=xe.current;e&&e.renamePath===n?await On(e):En(),H(null);return}let u=Ot(Dr,l.body,`rename-path`,{renamed:[],renamedAssets:[]});try{await sr(u.renamed,e.isFolder?[{fromPath:Ku(n),toPath:Ku(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}),hs.error(i({id:`dDpCOp`}))}En(),H(null)}catch(e){console.warn(`[FileTree] rename failed:`,e);let t=i({id:`HIb0vl`});hs.error(t),P(t),sn();let r=xe.current;r&&r.renamePath===n?await On(r):En(),H(null)}}let lr;t[155]!==i||t[156]!==sr||t[157]!==sn?(lr=async function(e){let t=e.draggedPaths.map(t=>{let n=Mu(t,e.target);return t===n?null:{sourcePath:t,destinationTreePath:n}}).filter(aY);if(t.length!==0){H(t[0]?.sourcePath??null),P(null);try{let e=[],n=[],r=[],a={docName:he.current,folderPath:Ze.current?.kind===`folder`?Ze.current.folderPath:null,assetPath:Ze.current?.kind===`asset`?Ze.current.assetPath:null};for(let a of t){let t=a.sourcePath.endsWith(`/`),o=!t&&yn(a.sourcePath),s=t?{kind:`folder`,fromPath:Ku(a.sourcePath),toPath:Ku(a.destinationTreePath)}:o?{kind:`asset`,fromPath:a.sourcePath,toPath:a.destinationTreePath}:{kind:`file`,fromPath:Eu(a.sourcePath),toPath:Eu(a.destinationTreePath)},c=await ht(await fetch(`/api/rename-path`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(s)}),i({id:`dOHMA0`}));if(!c.ok){hs.error(c.title),sn(),H(null);return}let l=Ot(Dr,c.body,`rename-path:drop`,{renamed:[],renamedAssets:[]});e=e.concat(l.renamed),n=n.concat(l.renamedAssets),t&&r.push({fromPath:Ku(a.sourcePath),toPath:Ku(a.destinationTreePath)})}try{await sr(e,r,n,a)}catch(r){console.warn(`[FileTree] post-move reconciliation failed`,{err:r,operationCount:t.length,renamedCount:e.length,renamedAssetCount:n.length}),hs.error(i({id:`8OxKZy`}))}H(null)}catch(e){console.warn(`[FileTree] move failed:`,e),hs.error(i({id:`HIb0vl`})),sn(),H(null)}}},t[155]=i,t[156]=sr,t[157]=sn,t[158]=lr):lr=t[158];let ur=lr,dr;t[159]!==i||t[160]!==b||t[161]!==sn?(dr=async function(e,t,n){if(e.length===0||Me.current!==null)return;let r=()=>{Me.current=null,H(null)};Me.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),Vu(e,t,n.name||`upload`);try{let r=await ht(await fetch(`/api/upload`,{method:`POST`,body:e}),i({id:`4Gz2wC`}));if(!r.ok){s+=1,hs.error(r.title,{description:n.name});continue}let c=Ot(tr,r.body,`upload:drop`,null);if(c===null){s+=1,hs.error(i({id:`4Gz2wC`}),{description:n.name});continue}let l=Wu(t,c);if(c.deduped===!0){s+=1,hs.error(i({id:`4sKwf6`}),{description:l});continue}o+=1;let u=Hu(l,n);u&&a.push(u)}catch(e){let t=e;s+=1,console.warn(`[FileTree] external file upload failed:`,t),hs.error(t instanceof TypeError?i({id:`HIb0vl`}):i({id:`4Gz2wC`}),{description:n.name})}}try{if(a.length>0){for(let e of a)Xc(e)&&b(e.docName);A(e=>{let t=new Set(e.map(Ou)),n=!1,r=[...e];for(let e of a){let i=Ou(e);Pe.current.set(i,Date.now()),!t.has(i)&&(t.add(i),r.push(e),n=!0)}return n?(sn(r),_n(r),r):e})}o>0&&(bl([`files`,`backlinks`,`graph`]),Ge.current?.(),hs.success(Wc._({id:`v75Em9`,values:{uploadedCount:o}}),{description:t||i({id:`RSqaSd`})})),s>0&&P(o>0?Wc._({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),hs.error(n),P(n),r()}},t[159]=i,t[160]=b,t[161]=sn,t[162]=dr):dr=t[162];let fr=dr,pr;t[163]===Symbol.for(`react.memo_cache_sentinel`)?(pr=function(e){ne({parentDir:e})},t[163]=pr):pr=t[163];let mr=pr,hr;t[164]!==i||t[165]!==b||t[166]!==On||t[167]!==En||t[168]!==Bt||t[169]!==D||t[170]!==T||t[171]!==sn||t[172]!==Wt?(hr=async function(e,t,n){if(Me.current)return;let r=xe.current;r&&En(r);try{let r=Lu(e,t,[...Wt,...Zt.current]);H(r.renamePath),Me.current=r.renamePath;let a=window.location.hash,o;if(e===`file`){let e=Tu(`file`,r.addPath),t={path:e};n?.template&&(t.template=n.template);let a=await ht(await fetch(`/api/create-page`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)}),i({id:`fJgQHX`}));if(!a.ok){hs.error(a.title),H(null),Me.current=null;return}let s=Eu(e),c=Ot(or,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=>Xc(e)&&e.docName===c))return e;let t=[...e,l];return _n(t),Pe.current.set(Ou(l),Date.now()),t}),bl([`files`,`backlinks`,`graph`]),T(c)}else{let e=Ku(r.addPath),t=await ht(await fetch(`/api/create-folder`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({path:e})}),i({id:`K1ckLX`}));if(!t.ok){hs.error(t.title),H(null),Me.current=null;return}o=Ot(pi,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=>Yc(e)&&e.path===o))return e;let t=[...e,n];return _n(t),Pe.current.set(Ou(n),Date.now()),t}),bl([`files`]),D(o)}let s=!1,c=e=>{if(e.key!==`Enter`)return;let t=xe.current;!t||t.renamePath!==r.renamePath||queueMicrotask(()=>En(t))};document.addEventListener(`keydown`,c,!0),xe.current={kind:e,renamePath:r.renamePath,createdPath:o,previousHash:a,disposeCommitListener:()=>{s||(s=!0,document.removeEventListener(`keydown`,c,!0))}},H(null),Me.current=null,Bt.add(r.addPath),Bt.startRenaming(r.renamePath,{removeIfCanceled:!0})}catch(e){console.warn(`[FileTree] create placeholder failed:`,e),hs.error(i({id:`S6l5dv`}));let t=xe.current;t?await On(t):En(),H(null),Me.current=null,sn()}},t[164]=i,t[165]=b,t[166]=On,t[167]=En,t[168]=Bt,t[169]=D,t[170]=T,t[171]=sn,t[172]=Wt,t[173]=hr):hr=t[173];let gr=hr,_r;t[174]===Bt?_r=t[175]:(_r=function(e){let t=Ru(e);(0,Q.startTransition)(()=>{for(let e of Zt.current)if(e===t||e.startsWith(t)){let t=Tq(Bt.getItem(e));t&&t.expand()}})},t[174]=Bt,t[175]=_r);let vr=_r,yr;t[176]===Bt?yr=t[177]:(yr=function(e){let t=Ru(e),n=new Set(be.current);(0,Q.startTransition)(()=>{for(let e of[...Zt.current].reverse())if((e===t||e.startsWith(t))&&!n.has(e)){let t=Tq(Bt.getItem(e));t&&t.collapse()}})},t[176]=Bt,t[177]=yr);let br=yr,xr;t[178]!==fe||t[179]!==Qt||t[180]!==o||t[181]!==s||t[182]!==_e||t[183]!==V||t[184]!==On||t[185]!==dn||t[186]!==k||t[187]!==Xt||t[188]!==ur||t[189]!==cr||t[190]!==Ht||t[191]!==x||t[192]!==wn||t[193]!==pn||t[194]!==At||t[195]!==Wt||t[196]!==fr?(xr=()=>{q.current=k,ue.current=x,he.current=o,Ze.current=s,ve.current=_e,Me.current=V,We.current=At,qt.current=Wt,Zt.current=Xt,be.current=Qt,He.current=dn,Ue.current=pn,Se.current=On,je.current=(e,t,n)=>{fr(e,t,n)},qe.current=e=>{if(Te.current||Ee.current||e.length!==1)return;let t=e[0];t&&(oe(!1),fe(Ht(t),k))},Ye.current=e=>{wn(e)||hs.error(e)},Je.current=cr,Xe.current=ur},t[178]=fe,t[179]=Qt,t[180]=o,t[181]=s,t[182]=_e,t[183]=V,t[184]=On,t[185]=dn,t[186]=k,t[187]=Xt,t[188]=ur,t[189]=cr,t[190]=Ht,t[191]=x,t[192]=wn,t[193]=pn,t[194]=At,t[195]=Wt,t[196]=fr,t[197]=xr):xr=t[197],(0,Q.useLayoutEffect)(xr);let Sr,Cr;t[198]===Bt?(Sr=t[199],Cr=t[200]):(Sr=()=>{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`;if(!r&&!i||IJ(e.target))return;let a=Ke.current,o=e.target,s=document.activeElement,c=o instanceof Node&&a?.contains(o),l=s instanceof Node&&a?.contains(s);if(!c&&!l)return;if(i){let t=Bt.getFocusedPath()??Bt.getSelectedPaths()[0]??null;if(!t)return;let n=Bt.getItem(t)??Bt.getItem(Ru(t)),r=n?.isDirectory()?Ru(Ku(n.getPath())):t;if(ve.current.has(r))return;Sn.current(MJ(r,q.current)),e.preventDefault(),e.stopPropagation();return}let u=new Set([...Zt.current,...qt.current]);Te.current=!0;for(let e of u)e&&Bt.getItem(e)?.select();queueMicrotask(()=>{Te.current=!1}),e.preventDefault(),e.stopPropagation()};return document.addEventListener(`keydown`,e,!0),()=>document.removeEventListener(`keydown`,e,!0)},Cr=[Bt],t[198]=Bt,t[199]=Sr,t[200]=Cr),(0,Q.useEffect)(Sr,Cr);let wr,Tr;t[201]!==k.length||t[202]!==j?(wr=()=>{if(j||k.length===0)return;let e=Ke.current?.querySelector(SL)?.shadowRoot;if(!e)return;let t=iY,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()},Tr=[j,k.length],t[201]=k.length,t[202]=j,t[203]=wr,t[204]=Tr):(wr=t[203],Tr=t[204]),(0,Q.useEffect)(wr,Tr);let Er,Or;t[205]!==k.length||t[206]!==j?(Er=()=>{if(j||k.length===0)return;let e=Ke.current?.querySelector(SL)?.shadowRoot;if(!e)return;let t=()=>zK(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()},Or=[j,k.length],t[205]=k.length,t[206]=j,t[207]=Er,t[208]=Or):(Er=t[207],Or=t[208]),(0,Q.useEffect)(Er,Or);let kr,Ar;t[209]!==k.length||t[210]!==j?(kr=()=>{if(j||k.length===0)return;let e=Ke.current?.querySelector(SL)?.shadowRoot;if(!e)return;let t=()=>rq(e);t();let n=new MutationObserver(t);return n.observe(e,{subtree:!0,childList:!0,attributes:!0,attributeFilter:[`data-item-path`]}),()=>n.disconnect()},Ar=[j,k.length],t[209]=k.length,t[210]=j,t[211]=kr,t[212]=Ar):(kr=t[211],Ar=t[212]),(0,Q.useEffect)(kr,Ar);let jr;t[213]===Symbol.for(`react.memo_cache_sentinel`)?(jr={folderCount:0,expandedCount:0},t[213]=jr):jr=t[213];let Mr=(0,Q.useRef)(jr),Nr=(0,Q.useRef)(gr),Pr=(0,Q.useRef)(mr),Fr;t[214]===gr?Fr=t[215]:(Fr=()=>{Nr.current=gr,Pr.current=mr},t[214]=gr,t[215]=Fr),(0,Q.useEffect)(Fr);let Ir,Lr;t[216]===Bt?(Ir=t[217],Lr=t[218]):(Ir=()=>({startCreating(e,t){Nr.current(e,t)},startCreatingFromTemplate(e){Pr.current(e)},createFromTemplate(e,t){Nr.current(`file`,e,{template:t})},expandAll(){(0,Q.startTransition)(()=>{for(let e of Zt.current){let t=Tq(Bt.getItem(e));t&&t.expand()}})},collapseAll(){let e=new Set(be.current);(0,Q.startTransition)(()=>{for(let t of[...Zt.current].reverse()){if(e.has(t))continue;let n=Tq(Bt.getItem(t));n&&n.collapse()}})},getFolderState(){let e=Zt.current,t=0;for(let n of e)Tq(Bt.getItem(n))?.isExpanded()&&t++;let n=e.length,r=Mr.current;if(r.folderCount===n&&r.expandedCount===t)return r;let i={folderCount:n,expandedCount:t};return Mr.current=i,i},isCreationTargetCleared(){return se.current},clearCreationTarget(){oe(!0)},subscribe(e){le.current.add(e);let t=Bt.subscribe(e);return()=>{le.current.delete(e),t()}}}),Lr=[Bt],t[216]=Bt,t[217]=Ir,t[218]=Lr),(0,Q.useImperativeHandle)(n,Ir,Lr);let Rr;t[219]!==En||t[220]!==u||t[221]!==c||t[222]!==Bt?(Rr=async function(e,t,n){let r=LJ(e,q.current,Zt.current),i=xe.current;i&&e.some(e=>RJ(e,i))&&(i.kind===`file`?r.docNames.add(i.createdPath):r.folderPaths.add(i.createdPath),En(i));let a=new Set([...r.docNames,...t]),o=new Set([...r.folderPaths,...n]),s=new Set([...r.assetPaths,...e.filter(rY).map(nY)]);c([...[...a].map(tY),...[...o].map(eY),...[...s].map($J)],{force:!0}),await Promise.all([...a].map(e=>u(e)));for(let t of e){let e=t.kind===`folder`?Ru(t.path):t.kind===`asset`?t.path:Bu(t.path,t.docExt);Bt.getItem(e)&&Bt.remove(e,t.kind===`folder`?{recursive:!0}:void 0)}A(e=>{let t=AN(e,[...a],void 0,[...s]);for(let e of o)t=AN(t,[],e);return _n(t),t}),bl([`files`,`backlinks`,`graph`])},t[219]=En,t[220]=u,t[221]=c,t[222]=Bt,t[223]=Rr):Rr=t[223];let Br=Rr,Vr;t[224]!==i||t[225]!==Br?(Vr=async function(e){let t=[],n=[],r=[];for(let a of e){let e=a.kind;H(a.path);let o=await ht(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 Br(r,t,n),hs.error(o.title),!1;let s=Ot(ui,o.body,`delete-path`,{deletedDocNames:[]});t.push(...s.deletedDocNames),e===`folder`&&n.push(a.path),r.push(a)}return await Br(r,t,n),!0},t[224]=i,t[225]=Br,t[226]=Vr):Vr=t[226];let Hr=Vr,Ur;t[227]===Symbol.for(`react.memo_cache_sentinel`)?(Ur=async function(e,t,n){let r=[],i=[];for(let a of e){H(a.path);let e=FN(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:vq(o.reason),detail:o.detail})}return{trashed:r,failed:i}},t[227]=Ur):Ur=t[227];let Wr=Ur,Gr;t[228]===i?Gr=t[229]:(Gr=async function(e){let t=[],n=[],r=[];for(let a of e){let e=a.kind;try{let o=await ht(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=Ot(Vn,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;hs.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[228]=i,t[229]=Gr);let Kr=Gr,qr;t[230]!==i||t[231]!==ee||t[232]!==Br||t[233]!==Hr||t[234]!==Kr||t[235]!==sn||t[236]!==re?(qr=async function(e){let t=e.map(e=>jN(e,q.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(QJ),t=r.length>e.length?`, +${r.length-e.length} more`:``;hs.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 Wr(t,a,re);if(e.length>0){let t=await Kr(e);t?await Br(e,t.deletedDocNames,t.deletedFolderPaths):await Br(e,e.filter(ZJ).map(XJ),e.filter(YJ).map(JJ))}n.length>0&&K({failed:n,originalTargets:[...t]}),H(null)}else{let e=await Hr(t);H(null),e||sn()}}catch(e){let t=e,n=t instanceof Error?t.message:String(t);console.warn(`[FileTree] delete failed:`,t),hs.error(i({id:`0eHrMb`}),{description:n}),H(null),sn()}},t[230]=i,t[231]=ee,t[232]=Br,t[233]=Hr,t[234]=Kr,t[235]=sn,t[236]=re,t[237]=qr):qr=t[237];let Jr=qr,Yr;t[238]!==i||t[239]!==Hr||t[240]!==sn||t[241]!==G?(Yr=async function(){if(!G)return;let e=new Set(G.failed.map(qJ)),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 Hr(t);H(null),e||sn()}catch(e){let t=e,n=t instanceof Error?t.message:String(t);console.warn(`[FileTree] hard-delete fallback failed:`,t),hs.error(i({id:`0eHrMb`}),{description:n}),H(null),sn()}}},t[238]=i,t[239]=Hr,t[240]=sn,t[241]=G,t[242]=Yr):Yr=t[242];let Xr=Yr,Zr;t[243]!==Jr||t[244]!==G?(Zr=async function(){if(!G)return;let e=new Set(G.failed.map(KJ)),t=G.originalTargets.filter(t=>e.has(`${t.kind}:${t.path}`));K(null),await Jr(t)},t[243]=Jr,t[244]=G,t[245]=Zr):Zr=t[245];let Qr=Zr,$r=(0,Q.useRef)(Jr),ei;t[246]===Jr?ei=t[247]:(ei=()=>{$r.current=Jr},t[246]=Jr,t[247]=ei),(0,Q.useEffect)(ei);let ti,ni;t[248]===Symbol.for(`react.memo_cache_sentinel`)?(ti=()=>Mq(e=>{if(e.kind===`doc`||e.kind===`folder-index`){let t=e.docName,n=q.current.find(e=>Xc(e)&&e.docName===t);$r.current([{kind:`file`,path:t,name:t.split(`/`).pop()??t,docExt:n?.docExt}]);return}if(e.kind===`folder`){$r.current([{kind:`folder`,path:e.folderPath,name:e.folderPath.split(`/`).pop()??e.folderPath}]);return}if(e.kind===`asset`){$r.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}))}),ni=[],t[248]=ti,t[249]=ni):(ti=t[248],ni=t[249]),(0,Q.useEffect)(ti,ni);let ri,ii;t[250]===Symbol.for(`react.memo_cache_sentinel`)?(ri=()=>Iq(e=>{if(e.kind===`doc`||e.kind===`folder-index`){let t=e.docName,n=q.current.find(e=>Xc(e)&&e.docName===t);Sn.current({kind:`file`,path:t,name:t.split(`/`).pop()??t,docExt:n?.docExt});return}if(e.kind===`folder`){Sn.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}))}),ii=[],t[250]=ri,t[251]=ii):(ri=t[250],ii=t[251]),(0,Q.useEffect)(ri,ii);let ai,oi;t[252]===Bt?(ai=t[253],oi=t[254]):(ai=()=>Pq(e=>{if(e.kind===`doc`||e.kind===`folder-index`){let t=e.docName,n=Bu(t,q.current.find(e=>Xc(e)&&e.docName===t)?.docExt);Bt.startRenaming(n);return}if(e.kind===`folder`){Bt.startRenaming(e.folderPath);return}if(e.kind===`asset`){Bt.startRenaming(e.assetPath);return}console.warn(JSON.stringify({event:`file-tree-menu-action-rename-unsupported-kind`,kind:e.kind}))}),oi=[Bt],t[252]=Bt,t[253]=ai,t[254]=oi),(0,Q.useEffect)(ai,oi);let si;t[255]===Symbol.for(`react.memo_cache_sentinel`)?(si=function(){let e=we.current;e&&aJ(e),we.current=null},t[255]=si):si=t[255];let ci=si,li;t[256]===h?li=t[257]:(li=function(e){let t=vY(e.nativeEvent);if(!t||t.endsWith(`/`)){ci();return}let n=Eu(t),r=q.current.find(e=>Ou(e)===t);if(r&&Qc(r)){ci();return}if(r&&Xc(r)&&hi(r.size)){ci();return}we.current!==n&&(ci(),we.current=n,iJ(n,e=>h(e)))},t[256]=h,t[257]=li);let di=li,fi;t[258]!==fe||t[259]!==Bt||t[260]!==D?(fi=function(e){if(e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;let t=yY(e.nativeEvent);if(!t){SY(e.nativeEvent)&&oe(!0);return}if(t.getAttribute(`aria-selected`)!==`true`)return;let n=t.dataset.itemPath;if(!n)return;let r=t.dataset.itemType===`folder`?Ru(n):n;if(Bt.getSelectedPaths().length!==1)return;if(t.dataset.itemType===`folder`){let e=Ku(r);if(window.location.hash===el(e))return;queueMicrotask(()=>D(e));return}let i=Eu(r);window.location.hash!==fl(i)&&queueMicrotask(()=>fe(r))},t[258]=fe,t[259]=Bt,t[260]=D,t[261]=fi):fi=t[261];let mi=fi,gi;t[262]===Symbol.for(`react.memo_cache_sentinel`)?(gi=function(e){Fu(e.nativeEvent)&&(e.preventDefault(),e.stopPropagation(),e.dataTransfer.dropEffect=`copy`,$e(!0))},t[262]=gi):gi=t[262];let _i=gi,vi;t[263]===Symbol.for(`react.memo_cache_sentinel`)?(vi=function(e){let t=e.relatedTarget;t instanceof Node&&e.currentTarget.contains(t)||$e(!1)},t[263]=vi):vi=t[263];let yi=vi,bi;t[264]===fr?bi=t[265]:(bi=function(e){if(!Fu(e.nativeEvent))return;let t=ku(e.nativeEvent);t.length!==0&&(e.preventDefault(),e.stopPropagation(),$e(!1),fr(t,``,wJ))},t[264]=fr,t[265]=bi);let xi=bi;if(j){let e;return t[266]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(wY,{}),t[266]=e):e=t[266],e}let Si;t[267]!==i||t[268]!==F||t[269]!==L?(Si=F?i(L?{id:`H-vDm3`}:{id:`09Tv5j`}):null,t[267]=i,t[268]=F,t[269]=L,t[270]=Si):Si=t[270];let Ci=Si;if(k.length===0){if(Ci!==null){let e;return t[271]===Ci?e=t[272]:(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:Ci})}),t[271]=Ci,t[272]=e),e}if(N){let e;return t[273]===N?e=t[274]:(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[273]=N,t[274]=e),e}let e;t[275]===i?e=t[276]:(e=i({id:`5ZB7XC`}),t[275]=i,t[276]=e);let n=Qe&&`bg-primary/5 ring-2 ring-primary/70 ring-inset`,r;t[277]===n?r=t[278]:(r=Y(`flex flex-1 flex-col items-center justify-center gap-3 rounded-md py-8`,n),t[277]=n,t[278]=r);let a;t[279]===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[279]=a):a=t[279];let o;t[280]===gr?o=t[281]:(o=()=>gr(`file`,``),t[280]=gr,t[281]=o);let s;t[282]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Z.jsx)(J,{id:`6ibbCg`}),t[282]=s):s=t[282];let c;t[283]===o?c=t[284]:(c=(0,Z.jsx)(X,{variant:`link`,size:`sm`,className:`font-mono uppercase`,onClick:o,children:s}),t[283]=o,t[284]=c);let l;return t[285]!==xi||t[286]!==e||t[287]!==r||t[288]!==c?(l=(0,Z.jsxs)(`section`,{"aria-label":e,className:r,onDragOver:_i,onDragLeave:yi,onDrop:xi,children:[a,c]}),t[285]=xi,t[286]=e,t[287]=r,t[288]=c,t[289]=l):l=t[289],l}let wi=V!==null,Ti=U?.targets[0]??null,Ei=null;if(z!==null){let e;if(t[290]!==a.locale||t[291]!==z){let n=new Intl.NumberFormat(a.locale).format(z);e=Wc._({id:`LuoJWu`,values:{truncatedShownCount:z,formattedCount:n}}),t[290]=a.locale,t[291]=z,t[292]=e}else e=t[292];Ei=e}let Di;t[293]!==N||t[294]!==Ci||t[295]!==Ei?(Di=(N||Ci!==null||Ei!==null)&&(0,Z.jsxs)(Z.Fragment,{children:[Ci===null?N&&(0,Z.jsx)(EY,{kind:`error`,children:N}):(0,Z.jsx)(EY,{kind:`reconnecting`,children:Ci}),Ei!==null&&(0,Z.jsx)(EY,{kind:`info`,children:Ei})]}),t[293]=N,t[294]=Ci,t[295]=Ei,t[296]=Di):Di=t[296];let Oi;t[297]===y?Oi=t[298]:(Oi=PK(y),t[297]=y,t[298]=Oi);let ki=ae?``:void 0,Ai;t[299]===ki?Ai=t[300]:(Ai={[DJ]:ki},t[299]=ki,t[300]=Ai);let ji;t[301]!==wi||t[302]!==_e||t[303]!==br||t[304]!==k||t[305]!==vr||t[306]!==Xt||t[307]!==xn||t[308]!==Tt||t[309]!==kt||t[310]!==Bt||t[311]!==Et||t[312]!==Dt||t[313]!==gr||t[314]!==re?(ji=(e,t)=>(0,Z.jsx)(zJ,{item:e,context:t,anyActionBusy:wi,workspace:re,handoff:Tt,model:Bt,okignoreBinding:Et,projectLocalBinding:Dt,mergedConfig:kt,onStartCreating:gr,onCreateFromTemplate:(e,t)=>gr(`file`,e,{template:t}),onDuplicate:xn,onDelete:e=>W({targets:e}),onExpandSubtree:vr,onCollapseSubtree:br,folderTreePaths:Xt,isAsset:_e.has(e.path),documents:k}),t[301]=wi,t[302]=_e,t[303]=br,t[304]=k,t[305]=vr,t[306]=Xt,t[307]=xn,t[308]=Tt,t[309]=kt,t[310]=Bt,t[311]=Et,t[312]=Dt,t[313]=gr,t[314]=re,t[315]=ji):ji=t[315];let Mi;t[316]!==mi||t[317]!==di||t[318]!==Bt||t[319]!==Di||t[320]!==Oi||t[321]!==Ai||t[322]!==ji?(Mi=(0,Z.jsx)(`div`,{ref:Ke,className:`flex min-h-0 flex-1 flex-col`,children:(0,Z.jsx)(OK,{header:Di,model:Bt,style:Oi,...Ai,onClickCapture:mi,onMouseMove:di,onMouseLeave:ci,renderContextMenu:ji})}),t[316]=mi,t[317]=di,t[318]=Bt,t[319]=Di,t[320]=Oi,t[321]=Ai,t[322]=ji,t[323]=Mi):Mi=t[323];let Ni=!!U,Pi;t[324]===V?Pi=t[325]:(Pi=e=>{!e&&!V&&W(null)},t[324]=V,t[325]=Pi);let Fi;t[326]!==i||t[327]!==V||t[328]!==U||t[329]!==Jr||t[330]!==Ti?(Fi=U&&Ti&&(0,Z.jsx)(ha,{...(()=>{let e=mq(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(GJ)}):null};let t=U.targets.length,n=Ti.name;return{itemName:t===1?Ti.kind===`folder`?`${Ti.name}/`:Ti.kind===`file`?`${Ti.name}${Ti.docExt??`.md`}`:Ti.name:void 0,customTitle:t>1?i({id:`abiHje`}):void 0,customDescription:t>1?i({id:`WMIKXK`,values:{targetCount:t}}):Ti.kind===`folder`?i({id:`a5W0q0`,values:{folderName:n}}):void 0}})(),isSubmitting:V!==null,onDelete:()=>Jr(U.targets)}),t[326]=i,t[327]=V,t[328]=U,t[329]=Jr,t[330]=Ti,t[331]=Fi):Fi=t[331];let Ii;t[332]!==Ni||t[333]!==Pi||t[334]!==Fi?(Ii=(0,Z.jsx)(Ys,{open:Ni,onOpenChange:Pi,children:Fi}),t[332]=Ni,t[333]=Pi,t[334]=Fi,t[335]=Ii):Ii=t[335];let Li=!!G,Ri;t[336]===V?Ri=t[337]:(Ri=e=>{!e&&!V&&K(null)},t[336]=V,t[337]=Ri);let zi;t[338]!==V||t[339]!==Xr||t[340]!==Qr||t[341]!==G?(zi=G&&(0,Z.jsx)(Sq,{failedTargets:G.failed,isSubmitting:V!==null,onDeletePermanently:Xr,onRetry:Qr,onCancel:()=>K(null)}),t[338]=V,t[339]=Xr,t[340]=Qr,t[341]=G,t[342]=zi):zi=t[342];let Bi;t[343]!==Li||t[344]!==Ri||t[345]!==zi?(Bi=(0,Z.jsx)(Ys,{open:Li,onOpenChange:Ri,children:zi}),t[343]=Li,t[344]=Ri,t[345]=zi,t[346]=Bi):Bi=t[346];let Vi=te!==null,Hi;t[347]===Symbol.for(`react.memo_cache_sentinel`)?(Hi=e=>{e||ne(null)},t[347]=Hi):Hi=t[347];let Ui=te?.parentDir??``,Wi;t[348]!==Vi||t[349]!==Ui?(Wi=(0,Z.jsx)(dh,{open:Vi,onOpenChange:Hi,kind:`file`,initialDir:Ui,defaultToTemplate:!0}),t[348]=Vi,t[349]=Ui,t[350]=Wi):Wi=t[350];let Gi;return t[351]!==Mi||t[352]!==Ii||t[353]!==Bi||t[354]!==Wi?(Gi=(0,Z.jsxs)(Z.Fragment,{children:[Mi,Ii,Bi,Wi]}),t[351]=Mi,t[352]=Ii,t[353]=Bi,t[354]=Wi,t[355]=Gi):Gi=t[355],Gi}function GJ(e){return(0,Z.jsx)(`li`,{"data-testid":`delete-target-row`,children:hq(e)},`${e.kind}:${e.path}`)}function KJ(e){return`${e.kind}:${e.path}`}function qJ(e){return`${e.kind}:${e.path}`}function JJ(e){return e.path}function YJ(e){return e.kind===`folder`}function XJ(e){return e.path}function ZJ(e){return e.kind===`file`}function QJ(e){return e.file}function $J(e){return Je(e)}function eY(e){return Yt(e)}function tY(e){return Ee(e)}function nY(e){return e.path}function rY(e){return e.kind===`asset`}function iY(e){return e.endsWith(`/`)?e.slice(0,-1):e}function aY(e){return!!e}function oY(e){console.warn(`[FileTree] /api/workspace fetch failed:`,e)}function sY(e){console.warn(`[FileTree] unmount cleanup failed:`,e)}function cY(e){hs.error(e)}function lY(){}function uY(e){return hs.error(e)}function dY(){}function fY(){}function pY(){}function mY(){}function hY(){}async function gY(){}function _Y(e){return Ou(e)}function vY(e){return yY(e)?.dataset.itemPath??null}function yY(e){for(let t of e.composedPath())if(t instanceof HTMLElement&&t.dataset.itemPath)return t;return null}function bY(e){for(let t of e.composedPath())if(t instanceof HTMLElement&&t.matches(`[data-file-tree-virtualized-root]`))return t;return null}function xY(e){let t=yY(e);if(t){let e=t.dataset.itemPath;if(!e)return null;let n=t.dataset.itemType===`folder`,r=Au(e,n);return{parentDir:r,row:t,root:null,busyPath:n?Ru(r):e}}return SY(e)?{parentDir:``,row:null,root:bY(e),busyPath:wJ}:null}function SY(e){for(let t of e.composedPath())if(t instanceof HTMLElement&&t.matches(`[data-file-tree-virtualized-scroll]`))return!0;return!1}var CY=[`w-3/4`,`w-2/3`,`w-4/5`,`w-1/2`,`w-3/5`,`w-2/3`];function wY(){let e=(0,$.c)(5),{_:t}=$t(),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=CY.map(TY),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 TY(e,t){return(0,Z.jsxs)(`div`,{className:`flex h-6 items-center gap-2`,children:[(0,Z.jsx)(Ba,{className:`h-3 w-3 shrink-0 rounded-sm`}),(0,Z.jsx)(Ba,{className:`h-3 ${e}`})]},t)}function EY(e){let t=(0,$.c)(14),{kind:n,children:r}=e,i=n===`error`?os:n===`reconnecting`?ts:Qo,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 DY(e){return e?Wc._({id:`wTcjov`}):null}function OY(e){let t=(0,$.c)(23),{_:n}=$t(),r=da(),i=ya();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=DY(c),r;t[12]===o?r=t[13]:(r=e=>o[e.id]?.installed===!0,t[12]=o,t[13]=r);let h=ta.filter(r),g=h.length>0,_=i!==null;if(!g&&!_){m=null;break bb0}u=WN,t[14]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Z.jsxs)(qN,{children:[(0,Z.jsx)(ns,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`O7_W_a`})]}),t[14]=p):p=t[14],l=JN,d=_?(0,Z.jsxs)(UN,{"aria-label":n({id:`ALhMYW`}),children:[(0,Z.jsx)(XN,{children:(0,Z.jsx)(J,{id:`ALhMYW`})}),va.map(t=>{let{displayName:r}=zn[t];return(0,Z.jsxs)(KN,{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)(sa,{id:oa(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)(ZN,{}):null,(0,Z.jsxs)(UN,{"aria-label":n({id:`BBqGS9`}),children:[(0,Z.jsx)(XN,{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)(KN,{disabled:!r,onSelect:()=>{a&&s(t.id,a)},"data-testid":`empty-space-open-in-${t.id}`,"aria-label":o,children:[(0,Z.jsx)(sa,{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 kY(e){try{let t=await e.project.listRecent(),n=e.config.projectPath;return t.some(e=>e.path!==n)?!1:await Xw()===0}catch(e){return console.warn(`[onboarding-card-visible] fresh-project probe failed; suppressing card`,e),!1}}function AY(e){let t=(0,$.c)(4),n=e===void 0?Kw: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 kY(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 jY(e){let t=(0,$.c)(3),n=e===void 0?Kw:e,r,i;t[0]===n?(r=t[1],i=t[2]):(r=()=>{if(n.getSnapshot().steps.file)return;let e=xl(e=>{e.includes(`files`)&&Zw(n)});return Zw(n),e},i=[n],t[0]=n,t[1]=r,t[2]=i),(0,Q.useEffect)(r,i)}var MY=3,NY=5200,PY=1500,FY=220;function IY(e){let t=(0,$.c)(14),{complete:n,label:r,shortcutId:i}=e,a;t[0]===n?a=t[1]:(a=(0,Z.jsx)(Xs,{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)(P,{children:Ol(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 LY(e){let t=(0,$.c)(24),{store:n,lingerMs:r}=e,i=n===void 0?Kw:n,a=r===void 0?NY:r,{_:o}=$t(),{steps:s}=qw(i);jY(i);let[c,l]=(0,Q.useState)(0),[u,d]=(0,Q.useState)(!1),f=1+ +!!s.file+ +!!s.askedAi,p=f===MY,m,h;t[0]!==p||t[1]!==a?(m=()=>{if(!p)return;l(zY);let e=setInterval(()=>l(RY),PY),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(),FY);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)(mS,{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} / ${MY}`})]}),(0,Z.jsxs)(`ul`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(IY,{complete:!0,label:(0,Z.jsx)(J,{id:`4E9jPa`})}),(0,Z.jsx)(IY,{complete:s.file,label:(0,Z.jsx)(J,{id:`6ibbCg`}),shortcutId:`new-item`}),(0,Z.jsx)(IY,{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 RY(e){return e+1}function zY(e){return e+1}function BY(){let e=(0,$.c)(1);if(!AY())return null;let t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Z.jsx)(LY,{}),e[0]=t):t=e[0],t}function VY(e){return e===null?null:e.kind===`local`?e.name:e.ref}function HY(e,t){if(e.length===0)return null;let n=`origin/${e}`;return t.includes(n)?n:t.find(t=>cr(t)===e)??null}function UY(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 WY(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}=$t(),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),[O,k]=(0,Q.useState)(``),[A,j]=(0,Q.useState)(!1),[M,N]=(0,Q.useState)(null),P=(0,Q.useRef)(null),F=(0,Q.useRef)(null),I,R;t[2]!==a||t[3]!==p||t[4]!==n?(I=()=>{if(!n)return;S(p),T(a===null?null:{kind:`local`,name:a}),D(!1),k(``),j(!1),N(null);let e=requestAnimationFrame(()=>P.current?.focus());return()=>cancelAnimationFrame(e)},R=[n,a,p],t[2]=a,t[3]=p,t[4]=n,t[5]=I,t[6]=R):(I=t[5],R=t[6]),(0,Q.useEffect)(I,R);let z=x.trim(),B=!A&&z.length>0,V=z.length>0&&d.includes(z),H=V?null:HY(z,f),U=H!==null,W=V||U,G=V&&(s?.has(z)??!1),K=d.filter(e=>e.toLowerCase().startsWith(z.toLowerCase())),ee=!A&&K.length>0&&!W,te=(a!==null&&!d.includes(a)?[a,...d]:d).map(YY),ne=f.map(JY),re=VY(w),ie=O.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){j(!0),N(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){N(UY(t.reason)),j(!1);return}Qh(),r(!1),await i.project.open({path:t.path,target:`new-window`,entryPoint:`worktree`})}catch(e){console.warn(`[NewWorktreeDialog] worktree create/open failed:`,e),hs.error(m({id:`vAYoCZ`})),j(!1)}}},le=Ys,q;t[7]!==A||t[8]!==r?(q=e=>{A||r(e)},t[7]=A,t[8]=r,t[9]=q):q=t[9];let ue=Gs,de;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(de=(0,Z.jsx)(Ws,{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)(Js,{children:[de,(0,Z.jsx)(Us,{children:(0,Z.jsx)(J,{id:`NEzPEh`})})]}),t[11]=fe):fe=t[11];let pe=Ks,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)(Mc,{htmlFor:g,children:me}),t[13]=g,t[14]=he);let ge;t[15]===m?ge=t[16]:(ge=m({id:`IX_uXB`}),t[15]=m,t[16]=ge);let _e;t[17]===M?_e=t[18]:(_e=e=>{S(e.target.value),M!==null&&N(null)},t[17]=M,t[18]=_e);let ve=M!==null,ye=M===null?y:`${y} ${b}`,be;t[19]!==x||t[20]!==A||t[21]!==g||t[22]!==ge||t[23]!==_e||t[24]!==ve||t[25]!==ye?(be=(0,Z.jsx)(Hc,{id:g,ref:P,value:x,placeholder:ge,onChange:_e,disabled:A,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-invalid":ve,"aria-describedby":ye,"data-testid":`new-worktree-branch`}),t[19]=x,t[20]=A,t[21]=g,t[22]=ge,t[23]=_e,t[24]=ve,t[25]=ye,t[26]=be):be=t[26];let xe=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)(Fo,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0 text-amber-600 dark:text-amber-400`}):U?(0,Z.jsx)(Qa,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0 text-violet-600 dark:text-violet-400`}):V?(0,Z.jsx)(Ui,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0 text-blue-600 dark:text-blue-400`}):(0,Z.jsx)(Zt,{"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,Se=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),M!==null&&N(null),P.current?.focus()},"data-testid":`new-worktree-branch-option-${e}`,className:`h-8 w-full justify-start gap-2 font-normal`,children:[(0,Z.jsx)(Io,{"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,Ce=W?null:(0,Z.jsxs)(`div`,{className:`mt-1 flex flex-col gap-2`,children:[(0,Z.jsx)(Mc,{id:v,htmlFor:_,children:(0,Z.jsx)(J,{id:`ZWwYwM`})}),(0,Z.jsxs)($e,{open:E,onOpenChange:e=>{D(e),e||k(``)},children:[(0,Z.jsx)(jt,{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:A,"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)(Qa,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`}):(0,Z.jsx)(Io,{"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)(xd,{"aria-hidden":`true`,className:`ml-2 size-4 shrink-0 opacity-50`})]})}),(0,Z.jsxs)(yt,{align:`start`,className:`w-[var(--radix-popover-trigger-width)] p-1`,onWheel:qY,onTouchMove:KY,onOpenAutoFocus:e=>{e.preventDefault(),F.current?.focus()},children:[(0,Z.jsxs)(RC,{className:`mb-1 h-8`,children:[(0,Z.jsx)(UC,{ref:F,"aria-label":m({id:`fuJZKk`}),placeholder:m({id:`hQXiDc`}),value:O,onChange:e=>k(e.target.value),onKeyDown:GY,"data-testid":`new-worktree-base-search`}),(0,Z.jsx)(BC,{children:(0,Z.jsx)(L,{"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),k(``)},"data-testid":`new-worktree-base-option-${t}`,className:`h-8 w-full justify-start gap-2 font-normal`,children:[(0,Z.jsx)(Io,{"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),k(``)},"data-testid":`new-worktree-base-option-${t}`,className:`h-8 w-full justify-start gap-2 font-normal`,children:[(0,Z.jsx)(Qa,{"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}`)})]})]})]})]}),we;t[27]!==m||t[28]!==M||t[29]!==b?(we=M===null?null:(0,Z.jsx)(`p`,{id:b,role:`alert`,className:`text-1sm text-destructive`,"data-testid":`new-worktree-error`,children:m(M)}),t[27]=m,t[28]=M,t[29]=b,t[30]=we):we=t[30];let Te;t[31]!==h||t[32]!==ce||t[33]!==he||t[34]!==be||t[35]!==xe||t[36]!==Se||t[37]!==Ce||t[38]!==we?(Te=(0,Z.jsxs)(`form`,{id:h,onSubmit:ce,className:`flex flex-col gap-2`,children:[he,be,xe,Se,Ce,we]}),t[31]=h,t[32]=ce,t[33]=he,t[34]=be,t[35]=xe,t[36]=Se,t[37]=Ce,t[38]=we,t[39]=Te):Te=t[39];let Ee;t[40]!==pe||t[41]!==Te?(Ee=(0,Z.jsx)(pe,{children:Te}),t[40]=pe,t[41]=Te,t[42]=Ee):Ee=t[42];let De;t[43]===r?De=t[44]:(De=()=>r(!1),t[43]=r,t[44]=De);let Oe;t[45]===Symbol.for(`react.memo_cache_sentinel`)?(Oe=(0,Z.jsx)(J,{id:`dEgA5A`}),t[45]=Oe):Oe=t[45];let ke;t[46]!==A||t[47]!==De?(ke=(0,Z.jsx)(X,{type:`button`,variant:`outline`,onClick:De,disabled:A,"data-testid":`new-worktree-cancel`,children:Oe}),t[46]=A,t[47]=De,t[48]=ke):ke=t[48];let Ae=!B,je;t[49]!==A||t[50]!==G||t[51]!==V||t[52]!==U?(je=A?(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]=A,t[50]=G,t[51]=V,t[52]=U,t[53]=je):je=t[53];let Me;t[54]!==h||t[55]!==Ae||t[56]!==je?(Me=(0,Z.jsx)(X,{type:`submit`,form:h,disabled:Ae,"data-testid":`new-worktree-create`,children:je}),t[54]=h,t[55]=Ae,t[56]=je,t[57]=Me):Me=t[57];let Ne;t[58]!==ke||t[59]!==Me?(Ne=(0,Z.jsxs)(qs,{children:[ke,Me]}),t[58]=ke,t[59]=Me,t[60]=Ne):Ne=t[60];let Pe;t[61]!==ue||t[62]!==fe||t[63]!==Ee||t[64]!==Ne?(Pe=(0,Z.jsxs)(ue,{className:`sm:max-w-md`,"data-testid":`new-worktree-dialog`,children:[fe,Ee,Ne]}),t[61]=ue,t[62]=fe,t[63]=Ee,t[64]=Ne,t[65]=Pe):Pe=t[65];let Fe;return t[66]!==le||t[67]!==n||t[68]!==Pe||t[69]!==q?(Fe=(0,Z.jsx)(le,{open:n,onOpenChange:q,children:Pe}),t[66]=le,t[67]=n,t[68]=Pe,t[69]=q,t[70]=Fe):Fe=t[70],Fe}function GY(e){return e.stopPropagation()}function KY(e){e.stopPropagation()}function qY(e){e.stopPropagation()}function JY(e){return{kind:`remote`,ref:e}}function YY(e){return{kind:`local`,name:e}}function XY(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}=$t(),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),hs.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){hs.error(f({id:`teD0H9`}));return}Qh(),await n.project.open({path:t.path,target:`new-window`,entryPoint:`worktree`})}catch(e){console.warn(`[RecentProjectsMenu] create/open branch failed:`,e),hs.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)(iX,{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=dg(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)(ZY,{group:e,currentPath:i,worktreeModel:o,flyoutOpen:l===e.project.path,setFlyoutOpen:t=>u(t?e.project.path:null),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 ZY(e){let t=(0,$.c)(27),{group:n,currentPath:r,worktreeModel:i,flyoutOpen:a,setFlyoutOpen:o,onPickProject:s,onPickFlyoutEntry:c,guardStaleSelect:l,openNewWorktreeWith:u}=e,d=n.project.path===r;if(n.worktrees.length===0){let e;t[0]!==l||t[1]!==s?(e=e=>{l(e)||s()},t[0]=l,t[1]=s,t[2]=e):e=t[2];let r=`project-switcher-recent-${n.project.path}`,i=d?`true`:void 0,a;t[3]!==n.project.name||t[4]!==n.project.path||t[5]!==d?(a=(0,Z.jsx)(sX,{name:n.project.name,path:n.project.path,current:d}),t[3]=n.project.name,t[4]=n.project.path,t[5]=d,t[6]=a):a=t[6];let o;return t[7]!==e||t[8]!==r||t[9]!==i||t[10]!==a?(o=(0,Z.jsx)(_c,{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[7]=e,t[8]=r,t[9]=i,t[10]=a,t[11]=o):o=t[11],o}let f;t[12]!==r||t[13]!==n.worktrees||t[14]!==d?(f=d||n.worktrees.some(e=>e.path===r),t[12]=r,t[13]=n.worktrees,t[14]=d,t[15]=f):f=t[15];let p=f,m;return t[16]!==p||t[17]!==r||t[18]!==a||t[19]!==n||t[20]!==l||t[21]!==c||t[22]!==s||t[23]!==u||t[24]!==o||t[25]!==i?(m=(0,Z.jsx)(QY,{group:n,currentPath:r,containsCurrent:p,worktreeModel:i,flyoutOpen:a,setFlyoutOpen:o,onPickProject:s,onPickFlyoutEntry:c,guardStaleSelect:l,openNewWorktreeWith:u}),t[16]=p,t[17]=r,t[18]=a,t[19]=n,t[20]=l,t[21]=c,t[22]=s,t[23]=u,t[24]=o,t[25]=i,t[26]=m):m=t[26],m}function QY(e){let t=(0,$.c)(56),{group:n,currentPath:r,containsCurrent:i,worktreeModel:a,flyoutOpen:o,setFlyoutOpen:s,onPickProject:c,onPickFlyoutEntry:l,guardStaleSelect:u,openNewWorktreeWith:d}=e,{_:f}=$t(),p=n.project.path===r,m;t[0]!==u||t[1]!==c?(m=e=>{u(e)||c()},t[0]=u,t[1]=c,t[2]=m):m=t[2];let h;t[3]!==o||t[4]!==s?(h=e=>{e.key===`ArrowRight`?(e.preventDefault(),s(!0)):(e.key===`ArrowLeft`||e.key===`Escape`)&&o&&(e.preventDefault(),e.stopPropagation(),s(!1))},t[3]=o,t[4]=s,t[5]=h):h=t[5];let g=`project-switcher-group-${n.project.path}`,_=o?`true`:void 0,v=i?`true`:void 0,y;t[6]===n.project.name?y=t[7]:(y=(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]=y);let b;t[8]===n.project.path?b=t[9]:(b=(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]=b);let x;t[10]!==y||t[11]!==b?(x=(0,Z.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[y,b]}),t[10]=y,t[11]=b,t[12]=x):x=t[12];let S;t[13]!==f||t[14]!==p?(S=p?(0,Z.jsx)(Ui,{"aria-label":f({id:`Hp1l6f`}),className:`mt-0.5 size-3.5 shrink-0 text-muted-foreground`}):null,t[13]=f,t[14]=p,t[15]=S):S=t[15];let C;t[16]!==f||t[17]!==o?(C=f(o?{id:`Aj1D9r`}:{id:`UaRsDu`}),t[16]=f,t[17]=o,t[18]=C):C=t[18];let w;t[19]===s?w=t[20]:(w=()=>{s(!0)},t[19]=s,t[20]=w);let T=`project-switcher-toggle-${n.project.path}`,E;t[21]===n.worktrees.length?E=t[22]:(E=(0,Z.jsx)(`span`,{className:`tabular-nums`,children:n.worktrees.length}),t[21]=n.worktrees.length,t[22]=E);let D;t[23]===n.worktrees.length?D=t[24]:(D=(0,Z.jsx)(J,{id:`ij5sBu`,values:{0:n.worktrees.length}}),t[23]=n.worktrees.length,t[24]=D);let O;t[25]!==E||t[26]!==D?(O=(0,Z.jsxs)(`span`,{className:`text-xs`,children:[E,` `,D]}),t[25]=E,t[26]=D,t[27]=O):O=t[27];let k;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,Z.jsx)(Ki,{"aria-hidden":`true`,className:`size-3.5`}),t[28]=k):k=t[28];let A;t[29]!==o||t[30]!==C||t[31]!==w||t[32]!==T||t[33]!==O?(A=(0,Z.jsx)(jt,{asChild:!0,children:(0,Z.jsxs)(X,{type:`button`,variant:`ghost`,size:`sm`,tabIndex:-1,"aria-label":C,"aria-expanded":o,onMouseDown:eX,onClick:$Y,onMouseEnter:w,"data-testid":T,className:`-my-1 -mr-1 h-auto shrink-0 gap-1 rounded-md px-1.5 py-1 text-muted-foreground hover:bg-accent-foreground/15 hover:text-foreground hover:ring-1 hover:ring-border hover:ring-inset`,children:[O,k]})}),t[29]=o,t[30]=C,t[31]=w,t[32]=T,t[33]=O,t[34]=A):A=t[34];let j;t[35]!==m||t[36]!==A||t[37]!==h||t[38]!==g||t[39]!==_||t[40]!==v||t[41]!==x||t[42]!==S?(j=(0,Z.jsxs)(_c,{onSelect:m,onKeyDown:h,className:`flex w-full min-w-0 items-start gap-2`,"data-testid":g,"data-flyout-open":_,"data-current":v,children:[x,S,A]}),t[35]=m,t[36]=A,t[37]=h,t[38]=g,t[39]=_,t[40]=v,t[41]=x,t[42]=S,t[43]=j):j=t[43];let M;t[44]!==r||t[45]!==n||t[46]!==u||t[47]!==l||t[48]!==d||t[49]!==a?(M=(0,Z.jsx)(tX,{group:n,currentPath:r,worktreeModel:a,onPickFlyoutEntry:l,guardStaleSelect:u,openNewWorktreeWith:d}),t[44]=r,t[45]=n,t[46]=u,t[47]=l,t[48]=d,t[49]=a,t[50]=M):M=t[50];let N;return t[51]!==o||t[52]!==s||t[53]!==j||t[54]!==M?(N=(0,Z.jsxs)($e,{open:o,onOpenChange:s,children:[j,M]}),t[51]=o,t[52]=s,t[53]=j,t[54]=M,t[55]=N):N=t[55],N}function $Y(e){e.stopPropagation()}function eX(e){e.stopPropagation()}function tX(e){let t=(0,$.c)(11),{group:n,currentPath:r,worktreeModel:i,onPickFlyoutEntry:a,guardStaleSelect:o,openNewWorktreeWith:s}=e,{_:c}=$t(),[l,u]=(0,Q.useState)(``),d=(0,Q.useRef)(null),f=(0,Q.useRef)(null),p=function(){let e=f.current;return e===null?[]:[...e.querySelectorAll(`[role="menuitem"]`)]},m=function(e){p()[e]?.focus()},h=function(e,t){if(e.key===`ArrowDown`){e.preventDefault();let t=p(),n=t.indexOf(e.currentTarget);m(Math.min(n+1,t.length-1))}else if(e.key===`ArrowUp`){e.preventDefault();let t=p().indexOf(e.currentTarget);t<=0?d.current?.focus():m(t-1)}else e.key===`Enter`&&(e.preventDefault(),t())},g=cg(n,i,r),_=l.trim().toLowerCase(),v=_===``?g:g.filter(e=>(e.branch??``).toLowerCase().includes(_)),y=i!==null&&i.mainRoot===n.project.mainRoot,b=l.trim(),x=y&&b.length>0,S;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(S=e=>{e.preventDefault(),d.current?.focus()},t[0]=S):S=t[0];let C;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,Z.jsx)(BC,{align:`inline-start`,children:(0,Z.jsx)(L,{"aria-hidden":`true`})}),t[1]=C):C=t[1];let w;t[2]===c?w=t[3]:(w=c({id:`bSD4im`}),t[2]=c,t[3]=w);let T;t[4]===c?T=t[5]:(T=c({id:`Skr_7L`}),t[4]=c,t[5]=T);let E;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(E=e=>u(e.target.value),t[6]=E):E=t[6];let D;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,Z.jsx)(BC,{align:`inline-end`,children:(0,Z.jsx)(Io,{"aria-hidden":`true`})}),t[7]=D):D=t[7];let O=v.length===0?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Oc,{className:`font-normal text-muted-foreground text-xs`,role:`status`,"aria-live":`polite`,children:c({id:`-uaQnI`})}),x?(0,Z.jsxs)(_c,{onSelect:e=>{o(e)||s(b)},onKeyDown:e=>h(e,()=>s(b)),className:`flex items-center gap-2`,"data-testid":`project-switcher-flyout-create`,children:[(0,Z.jsx)(Zt,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm`,title:b,children:(0,Z.jsx)(J,{id:`gHSAWT`,values:{typedName:b},components:{0:(0,Z.jsx)(`span`,{className:`font-medium`}),1:(0,Z.jsx)(`span`,{className:`font-mono`})}})})]}):null]}):v.map(e=>{let t=e.path??`branch:${e.branch}`,n=e.branch??c({id:`D12vtS`});return(0,Z.jsxs)(_c,{onSelect:t=>{o(t)||a(e)},onKeyDown:t=>h(t,()=>a(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:c({id:`Bn9-El`})}):e.opened?null:(0,Z.jsx)(`span`,{className:`shrink-0 text-muted-foreground text-xs`,title:c({id:`Dvwa0U`}),children:c({id:`nfoduq`})}),e.isCurrent?(0,Z.jsx)(cX,{}):null]},t)}),k;return t[8]!==f||t[9]!==O?(k=(0,Z.jsx)(`div`,{ref:f,className:`min-h-0 flex-1 overflow-x-hidden overflow-y-auto overscroll-contain subtle-scrollbar`,children:O}),t[8]=f,t[9]=O,t[10]=k):k=t[10],(0,Z.jsxs)(yt,{side:`right`,align:`start`,sideOffset:4,className:`flex max-h-80 w-96 flex-col gap-1 overflow-hidden p-1`,onPointerDownOutside:rX,onFocusOutside:nX,onOpenAutoFocus:S,"data-testid":`project-switcher-flyout-${n.project.path}`,children:[(0,Z.jsxs)(RC,{className:`mb-1 h-8 shrink-0`,children:[C,(0,Z.jsx)(UC,{ref:d,"aria-label":w,placeholder:T,value:l,onChange:E,onKeyDown:e=>{e.key===`ArrowDown`&&(e.preventDefault(),m(0)),e.stopPropagation()},"data-testid":`project-switcher-flyout-search-${n.project.path}`}),D]}),k]})}function nX(e){return e.preventDefault()}function rX(e){return e.preventDefault()}function iX(e){let t=(0,$.c)(41),{recents:n,currentPath:r,query:i,worktreeModel:a,onPickEntry:o,onPickBranch:s,guardStaleSelect:c}=e,{_:l}=$t(),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(aX)),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)(Oc,{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)(_c,{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)(sX,{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)(_c,{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)(Io,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0`}),(0,Z.jsx)(oX,{branch:e.branch??e.name,project:e.mainRoot===void 0?null:ug(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)(_c,{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)(Io,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0 opacity-40`}),(0,Z.jsx)(oX,{branch:e.branch??``,project:a===null?null:ug(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 aX(e){return e.path}function oX(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 sX(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)(Ui,{"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 cX(){let e=(0,$.c)(4),{_:t}=$t(),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)(Ui,{"aria-label":n,className:`size-3.5 shrink-0 text-muted-foreground`}),e[2]=n,e[3]=r),r}var lX=(e,t,n)=>ng(e,t,n,`ProjectSwitcher`),uX=350;function dX(e){let t=(0,$.c)(108),{bridge:n}=e,{_:r}=$t(),[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=Yj(),y=$h(),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},uX)),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,O;t[2]!==r||t[3]!==n.project||t[4]!==o?(O=()=>{if(!o)return;let e=!1;return lX(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]=O):O=t[5];let k;t[6]!==r||t[7]!==n||t[8]!==o?(k=[o,n,r],t[6]=r,t[7]=n,t[8]=o,t[9]=k):k=t[9],(0,Q.useEffect)(O,k);let A,j;t[10]===n?(A=t[11],j=t[12]):(A=()=>n.onMenuAction(e=>{e===`new-worktree`?(s(!1),_(null),h(``),p(!0)):e===`switch-worktree`&&s(!0)}),j=[n],t[10]=n,t[11]=A,t[12]=j),(0,Q.useEffect)(A,j);let M;t[13]!==r||t[14]!==n.dialog||t[15]!==n.project?(M=()=>{T(!1),lX(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]=M):M=t[16];let N=M,P;t[17]!==r||t[18]!==n.navigator?(P=()=>{T(!1),lX(()=>n.navigator.open(),r({id:`jol95m`}))},t[17]=r,t[18]=n.navigator,t[19]=P):P=t[19];let I=P,R;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(R=()=>{T(!1),d(!0)},t[20]=R):R=t[20];let z=R,B;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(B=e=>{T(!1),h(e),p(!0)},t[21]=B):B=t[21];let V=B,H=n.config.projectPath,U;t[22]===c?U=t[23]:(U=c.trim().toLowerCase(),t[22]=c,t[23]=U);let W=U,G=W!==``,K;t[24]===i?K=t[25]:(K=i??[],t[24]=i,t[25]=K);let ee=K,te;t[26]!==G||t[27]!==ee?(te=G?ee.filter(yX):ee,t[26]=G,t[27]=ee,t[28]=te):te=t[28];let ne=te,re=G?null:y,ie=v!==null&&`h-auto py-1.5`,ae;t[29]===ie?ae=t[30]:(ae=Y(`justify-between text-sidebar-foreground/70 hover:text-sidebar-foreground! data-open:hover:text-sidebar-foreground!`,ie),t[29]=ie,t[30]=ae);let oe;t[31]===r?oe=t[32]:(oe=r({id:`zZ_I5K`}),t[31]=r,t[32]=oe);let se;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(se=b?()=>{x.current=!0}:void 0,t[33]=se):se=t[33];let ce;t[34]===o?ce=t[35]:(ce=b?()=>{if(x.current){x.current=!1;return}T(!o)}:void 0,t[34]=o,t[35]=ce);let le;t[36]===n.config.projectName?le=t[37]:(le=(0,Z.jsx)(`span`,{className:`truncate`,children:n.config.projectName}),t[36]=n.config.projectName,t[37]=le);let q;t[38]===v?q=t[39]:(q=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)(Io,{"aria-hidden":`true`,className:`size-3! shrink-0`}),(0,Z.jsx)(`span`,{className:`truncate`,children:v})]}),t[38]=v,t[39]=q);let ue;t[40]!==le||t[41]!==q?(ue=(0,Z.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5`,children:[le,q]}),t[40]=le,t[41]=q,t[42]=ue):ue=t[42];let de;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(de=(0,Z.jsx)(xd,{"aria-hidden":`true`,className:`opacity-60`}),t[43]=de):de=t[43];let fe;t[44]!==n.config.projectPath||t[45]!==ae||t[46]!==oe||t[47]!==ce||t[48]!==ue?(fe=(0,Z.jsx)(hc,{asChild:!0,children:(0,Z.jsxs)(zj,{className:ae,"data-testid":`project-switcher-trigger`,"aria-label":oe,title:n.config.projectPath,onPointerDown:se,onClick:ce,children:[ue,de]})}),t[44]=n.config.projectPath,t[45]=ae,t[46]=oe,t[47]=ce,t[48]=ue,t[49]=fe):fe=t[49];let pe;t[50]!==r||t[51]!==n||t[52]!==H||t[53]!==g||t[54]!==ne||t[55]!==re||t[56]!==W||t[57]!==i||t[58]!==c?(pe=i===null?null:i.length===0?(0,Z.jsx)(Oc,{className:`font-normal text-muted-foreground text-xs`,children:(0,Z.jsx)(J,{id:`MUrVEo`})}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(RC,{className:`mb-1 h-8 border-0 shadow-none has-[[data-slot=input-group-control]:focus-visible]:ring-0`,children:[(0,Z.jsx)(UC,{"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)(BC,{children:(0,Z.jsx)(L,{"aria-hidden":`true`})})]}),(0,Z.jsx)(Ac,{}),(0,Z.jsx)(`div`,{className:`max-h-64 overflow-x-hidden overflow-y-auto overscroll-contain subtle-scrollbar scroll-fade-mask`,children:(0,Z.jsx)(XY,{bridge:n,recents:ne,currentPath:H,query:W,worktreeModel:re,closeMenu:()=>T(!1),guardStaleSelect:D,flyoutPath:g,setFlyoutPath:_,openNewWorktreeWith:V})})]}),t[50]=r,t[51]=n,t[52]=H,t[53]=g,t[54]=ne,t[55]=re,t[56]=W,t[57]=i,t[58]=c,t[59]=pe):pe=t[59];let me;t[60]===Symbol.for(`react.memo_cache_sentinel`)?(me=(0,Z.jsx)(Ac,{}),t[60]=me):me=t[60];let he;t[61]===Symbol.for(`react.memo_cache_sentinel`)?(he=e=>{D(e)||z()},t[61]=he):he=t[61];let ge;t[62]===Symbol.for(`react.memo_cache_sentinel`)?(ge=(0,Z.jsxs)(_c,{onSelect:he,"data-testid":`project-switcher-new-project`,children:[(0,Z.jsx)(Zt,{"aria-hidden":`true`,className:`text-muted-foreground`}),(0,Z.jsx)(J,{id:`gKi-a_`})]}),t[62]=ge):ge=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)(F,{"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)(_c,{onSelect:_e,"data-testid":`project-switcher-switch-project`,children:[ve,ye]}),t[67]=_e,t[68]=be);let xe;t[69]===N?xe=t[70]:(xe=e=>{D(e)||N()},t[69]=N,t[70]=xe);let Se,Ce;t[71]===Symbol.for(`react.memo_cache_sentinel`)?(Se=(0,Z.jsx)(Fo,{"aria-hidden":`true`,className:`text-muted-foreground`}),Ce=(0,Z.jsx)(J,{id:`PVUn_c`}),t[71]=Se,t[72]=Ce):(Se=t[71],Ce=t[72]);let we;t[73]===xe?we=t[74]:(we=(0,Z.jsxs)(_c,{onSelect:xe,"data-testid":`project-switcher-open-folder`,children:[Se,Ce]}),t[73]=xe,t[74]=we);let Te;t[75]===v?Te=t[76]:(Te=v===null?null:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Ac,{}),(0,Z.jsxs)(_c,{onSelect:e=>{D(e)||(T(!1),h(``),p(!0))},"data-testid":`project-switcher-new-worktree`,children:[(0,Z.jsx)(Io,{"aria-hidden":`true`,className:`text-muted-foreground`}),(0,Z.jsx)(J,{id:`DXd9LM`})]})]}),t[75]=v,t[76]=Te);let Ee;t[77]!==pe||t[78]!==be||t[79]!==we||t[80]!==Te?(Ee=(0,Z.jsxs)(yc,{align:`start`,side:`top`,className:`min-w-[260px]`,"data-testid":`project-switcher-menu`,children:[pe,me,ge,be,we,Te]}),t[77]=pe,t[78]=be,t[79]=we,t[80]=Te,t[81]=Ee):Ee=t[81];let De;t[82]!==o||t[83]!==fe||t[84]!==Ee?(De=(0,Z.jsxs)(Tc,{open:o,onOpenChange:T,modal:!1,children:[fe,Ee]}),t[82]=o,t[83]=fe,t[84]=Ee,t[85]=De):De=t[85];let Oe;t[86]!==n||t[87]!==u?(Oe=(0,Z.jsx)(sm,{open:u,onOpenChange:d,bridge:n}),t[86]=n,t[87]=u,t[88]=Oe):Oe=t[88];let ke;t[89]===y?.entries?ke=t[90]:(ke=y?.entries.map(_X).filter(gX),t[89]=y?.entries,t[90]=ke);let Ae;t[91]===y?.entries?Ae=t[92]:(Ae=new Set(y?.entries.filter(hX).map(mX)),t[91]=y?.entries,t[92]=Ae);let je=y?.remoteBranches,Me;t[93]===y?.entries?Me=t[94]:(Me=new Map(y?.entries.filter(pX).map(fX)),t[93]=y?.entries,t[94]=Me);let Ne;t[95]!==v||t[96]!==n||t[97]!==m||t[98]!==f||t[99]!==ke||t[100]!==Ae||t[101]!==je||t[102]!==Me?(Ne=(0,Z.jsx)(WY,{open:f,onOpenChange:p,bridge:n,currentBranch:v,initialBranchName:m,branches:ke,existingWorktreeBranches:Ae,remoteBranches:je,behindByBranch:Me}),t[95]=v,t[96]=n,t[97]=m,t[98]=f,t[99]=ke,t[100]=Ae,t[101]=je,t[102]=Me,t[103]=Ne):Ne=t[103];let Pe;return t[104]!==De||t[105]!==Oe||t[106]!==Ne?(Pe=(0,Z.jsxs)(Z.Fragment,{children:[De,Oe,Ne]}),t[104]=De,t[105]=Oe,t[106]=Ne,t[107]=Pe):Pe=t[107],Pe}function fX(e){return[e.branch,e.behind]}function pX(e){return e.branch!==null&&e.behind!==void 0}function mX(e){return e.branch}function hX(e){return e.branch!==null&&e.worktreePath!==null}function gX(e){return e!==null}function _X(e){return e.branch}function vX(e){return e.stopPropagation()}function yX(e){return!e.isLinkedWorktree}function bX(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})),Kn(`sidebarSearchPill`)}function xX(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)(L,{"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)(P,{className:`text-foreground/70`,children:Ol(`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 SX(){let e=(0,$.c)(31),{_:t}=$t(),n=ua(),{activeDocName:r}=mt(),[i,a]=(0,Q.useState)(!1),o=_a(),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=Eo(c),e[3]=c,e[4]=l);let u=l,d=So(),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)(Nj,{asChild:!0,children:(0,Z.jsxs)(Vs,{className:`flex w-full items-center gap-1.5`,children:[(0,Z.jsx)(Vd,{className:`size-3.5 shrink-0`}),(0,Z.jsx)(J,{id:`PCSkw2`}),(0,Z.jsx)(Ki,{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)(Zt,{}),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)(Pj,{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)(kX,{}),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`})}):Oo.filter(e=>c.some(t=>t.scope===e)).map(e=>(0,Z.jsxs)(Hs,{className:`group/scope`,open:c.some(t=>t.scope===e&&wr(t.scope,t.name)===r)||(p[e]??!1),onOpenChange:t=>m(n=>({...n,[e]:t})),children:[(0,Z.jsxs)(Vs,{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)(Ki,{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)(Bs,{children:(0,Z.jsx)(Ij,{className:`pl-2`,children:c.filter(t=>t.scope===e).map(e=>(0,Z.jsx)(wX,{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)(Bs,{children:(0,Z.jsxs)(Fj,{children:[x,S]})}),e[22]=S,e[23]=C);let w;e[24]===i?w=e[25]:(w=(0,Z.jsx)(no,{defaultScope:`project`,open:i,onOpenChange:a,onCreated:CX}),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)(Hs,{className:`group/skills shrink-0`,children:(0,Z.jsxs)(Mj,{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 CX(e){let{scope:t,name:n}=e;return Jo(wr(t,n))}function wX(e){let t=(0,$.c)(50),{skill:n,activeDocName:r,actions:i,existingNames:a}=e,{_:o}=$t(),[s,c]=(0,Q.useState)(!1),[l,u]=(0,Q.useState)(!1),d;t[0]!==n.name||t[1]!==n.scope?(d=wr(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)(Ki,{className:`size-3 shrink-0 text-muted-foreground transition-transform group-data-[state=open]/skill:rotate-90`}),h=(0,Z.jsx)(Vd,{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]:(_=wo(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)(ts,{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)(Xa,{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)(Vs,{asChild:!0,children:(0,Z.jsxs)(zj,{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)(kd,{}),t[27]=w):w=t[27];let T;t[28]===C?T=t[29]:(T=(0,Z.jsx)(hc,{asChild:!0,children:(0,Z.jsx)(Bj,{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)(yc,{side:`right`,align:`start`,className:`min-w-52`,children:(0,Z.jsx)(ma,{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)(Tc,{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)(DX,{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)(Bs,{children:O}),t[41]=O,t[42]=k);let A;t[43]!==S||t[44]!==D||t[45]!==k?(A=(0,Z.jsxs)(Lj,{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)(Hs,{open:s,onOpenChange:c,className:`group/skill`,children:A}),t[47]=s,t[48]=A,t[49]=j):j=t[49],j}function TX(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 EX(t),t}function EX(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&&EX(t.children)}function DX(e){let t=(0,$.c)(27),{skill:n}=e,{_:r}=$t(),[i,a]=(0,Q.useState)(null),[o,s]=(0,Q.useState)(!1),{openTarget:c}=mt(),l;t[0]===c?l=t[1]:(l=function(e){c({kind:`doc`,target:e,docName:e},{tabBehavior:`append`}),tl(fl(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(le(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`}),tl(sl({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=()=>{Ec(n.scope,n.name).then(t=>{e&&(t.ok?(a(t.files),s(!1)):(a([]),s(!0)))})};t();let r=Cl(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?TX(i):[],a;t[19]!==u||t[20]!==n.name||t[21]!==n.scope?(a=()=>n.scope===`project`?u(Ar(n.name)):Jo(wr(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)(te,{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)(Hj,{children:(0,Z.jsxs)(Uj,{size:`sm`,onClick:a,className:`text-[11px]`,children:[s,c]})}),t[25]=a,t[26]=l),h=(0,Z.jsxs)(Vj,{className:`mr-0 pr-0`,children:[l,i===null?(0,Z.jsx)(Hj,{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)(Hj,{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)(OX,{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 OX(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)(Ki,{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)(Vs,{asChild:!0,children:(0,Z.jsxs)(Uj,{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)(OX,{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)(Bs,{children:u}),t[15]=u,t[16]=d);let f;t[17]!==c||t[18]!==d?(f=(0,Z.jsxs)(Hj,{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)(Hs,{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)(Md,{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)(Hj,{children:(0,Z.jsxs)(Uj,{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 kX(){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 bc().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 Dc(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 AX=`Relaunch`,jX=`Release notes`,MX=`Updates paused`,NX=`Download`,PX=`Reset to defaults`,FX=`Relaunching to install the update…`,IX=`Relaunch failed — please restart manually`;function LX(e){return`Update to ${e} didn't install.`}var RX=`Retry`,zX=`Download manually`,BX=`Recovery action failed — please try again`;function VX(e,t){let n=t instanceof Error&&t.message?t.message:``;return n?`${e}: ${n}`:e}function HX(e){return`Version ${e} ready to install`}function UX(e){return`Updated to Version ${e}`}function WX(e){return`Your settings and recent projects were saved by a newer build than this one (v${e}). Reset to defaults to continue.`}var GX=0,KX=0,qX=1,JX=2,YX=3,XX=6e4;function ZX(e,t,n=()=>{},r=XX,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:HX(r),priority:JX,action:{label:AX,onClick:()=>{t({id:i,body:FX,priority:JX,dismissible:!1}),e.update.relaunchNow().then(()=>{n(i)},e=>{a(),t({id:`relaunch-error-${r}`,body:VX(IX,e),variant:`error`,priority:qX})})}}})};a()})),a.push(e.onUpdateRelaunching(()=>{t({id:s,body:FX,priority:JX,dismissible:!1})})),a.push(e.onUpdateRelaunchFailed(({version:r,message:i,downloadUrl:a})=>{if(a){let i=`install-failed-${r}`,o=()=>{t({id:i,body:LX(r),variant:`error`,priority:qX,action:{label:RX,onClick:()=>{e.update.relaunchNow().then(()=>{n(i)},e=>{console.warn(`[update-notice] install-failed retry rejected`,e),o()})}},secondaryAction:{label:zX,onClick:()=>{e.shell.openExternal(a)}}})};o();return}t({id:`relaunch-error-${r}`,body:i?`${IX}: ${i}`:IX,variant:`error`,priority:qX})})),a.push(e.onWhatsNew(({version:a,releaseUrl:s})=>{if(i.isEligible(a)){i.onShown(a),t({id:`whats-new-combined-${a}`,body:UX(a),variant:`success`,priority:YX,combinedSubscribe:!0,whatsNew:{version:a,releaseUrl:s},action:{label:jX,onClick:()=>{e.shell.openExternal(s)}}}),e.update.dismissWhatsNew(a);return}let c=`whats-new-${a}`;t({id:c,body:UX(a),variant:`success`,priority:YX,action:{label:jX,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:MX,priority:KX,action:{label:NX,onClick:()=>{e.shell.openExternal(n)}}})})),()=>{for(let e of a)e();for(let e of o)clearTimeout(e);o.clear()}}function QX(e,t,n,r=()=>{}){let i=`schema-incompatibility-${t.persistedSchemaVersion}`,a=`schema-incompatibility-error-${t.persistedSchemaVersion}`,o=e=>{r(i),n({id:a,body:VX(BX,e),variant:`error`,priority:GX})};n({id:i,body:WX(t.currentBuild),priority:GX,action:{label:PX,onClick:()=>{e.state.resetIncompatible().then(()=>{r(i)},o)}}})}var $X=[],eZ=new Set,tZ=!1;function nZ(){for(let e of eZ)e()}function rZ(e){let t=$X.findIndex(t=>t.id===e.id);if(t===-1)$X=[...$X,e];else{let n=$X.slice();n[t]=e,$X=n}nZ()}function iZ(e){let t=$X.filter(t=>t.id!==e);t.length!==$X.length&&($X=t,nZ())}function aZ(){return $X}function oZ(e){return eZ.add(e),()=>{eZ.delete(e)}}function sZ(){if(tZ||typeof window>`u`)return;let e=window.okDesktop;e&&(tZ=!0,ZX(e,rZ,iZ,void 0,{isEligible:e=>XP(rF.getSnapshot(),e),onShown:e=>rF.recordShown(e)}),e.state.query().then(t=>{t.schemaIncompatibility&&QX(e,t.schemaIncompatibility,rZ,iZ)},e=>{console.warn(`[update-notices-store] bridge.state.query() failed`,e)}))}var cZ=6e4,lZ=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=>uu(e,n),o=e=>uu(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 uZ(e){let t=(0,$.c)(34),{version:n,onOpenReleaseNotes:r,onClose:i,store:a,autoDismissMs:o}=e,s=a===void 0?rF:a,c=o===void 0?cZ:o,{_:l}=$t(),[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)(WP,{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)(lZ,{href:qP,label:l({id:`I7Exsw`}),icon:sF}),(0,Z.jsx)(lZ,{href:GP,label:l({id:`zyKa-I`}),icon:oF}),(0,Z.jsx)(lZ,{href:KP,label:l({id:`36aWJD`}),icon:aF})]}),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 dZ(e){let t=(0,$.c)(37),{notice:n,onDismiss:r}=e,{_:i}=$t(),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)(gs,{"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 pZ(){let e=(0,$.c)(15),t=(0,Q.useSyncExternalStore)(oZ,aZ,aZ),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=()=>iZ(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)(uZ,{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?.(),iZ(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)(dZ,{notice:r,onDismiss:i})}),e[12]=r,e[13]=i,e[14]=a):a=e[14],a}function mZ(e,t,n){return e?.kind===`doc`&&t||e?.kind===`folder-index`&&t?ea(n.contentDir,ra(t),n.pathSeparator):e?.kind===`folder`?ea(n.contentDir,e.folderPath,n.pathSeparator):e?.kind===`asset`?ea(n.contentDir,e.assetPath,n.pathSeparator):n.contentDir}function hZ(e,t){return(e?.kind===`doc`||e?.kind===`folder-index`)&&t?ra(t):e?.kind===`folder`?e.folderPath:e?.kind===`asset`?e.assetPath:``}function gZ(e,t,n){return e===null?Ca({workspace:n}):e.kind===`folder`?n?ia({folderRelativePath:e.folderPath,workspace:n}):null:e.kind===`doc`||e.kind===`folder-index`?ba({docName:t,workspace:n}):null}var _Z={folderCount:0,expandedCount:0},vZ=`button, [role="button"], [role="menuitem"], input, textarea, select, a[href]`;function yZ(e){return typeof Element>`u`||!(e instanceof Element)?!1:e.closest(vZ)!==null}function bZ(e){let t=(0,$.c)(2),{onOpenSearch:n}=e,r;return t[0]===n?r=t[1]:(r=(0,Z.jsx)(Tl,{name:`file-sidebar`,children:(0,Z.jsx)(SZ,{onOpenSearch:n})}),t[0]=n,t[1]=r),r}var xZ=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)(Ts,{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)(Es,{children:r}),t[10]=r,t[11]=s);let c;return t[12]!==o||t[13]!==s?(c=(0,Z.jsxs)(Os,{children:[o,s]}),t[12]=o,t[13]=s,t[14]=c):c=t[14],c};function SZ(e){let t=(0,$.c)(209),{onOpenSearch:n}=e,{_:r}=$t(),[i,a]=(0,Q.useState)(null),[o,s]=(0,Q.useState)(null),{activeDocName:c,activeTarget:l}=mt(),u;t[0]!==c||t[1]!==l?(u=l?.kind===`folder`||l?.kind===`folder-index`?l.folderPath:Jc(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}=xj(),y=da(),b=_===`expanded`,x=h&&_===`collapsed`,[S,C]=(0,Q.useState)(_Z),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 CS(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=fo(``),M=fo(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=$i(),{status:R}=ki(),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=pa().states,{dispatch:U}=xa(),W;t[12]===L?W=t[13]:(W=Ca({workspace:L}),t[12]=L,t[13]=W);let G=W,{projectLocalBinding:K,merged:ee}=Po(),te=ee?.appearance?.sidebar?.showHiddenFiles??!1,ne=O&&!k,re=O&&!A,ie=ne||re,ae=DZ,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),hs.success(r({id:`6_ZOw4`}),{description:L.contentDir})}catch(e){console.warn(`[FileSidebar] clipboard write failed:`,e),hs.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=()=>{ja({...Oa(``),hasRemote:z,onClickWhenNoRemote:()=>{hs.error(r({id:`WyQxwa`}))}},{clipboardWrite:ga,toastSuccess:EZ,toastError:TZ,logEvent:wZ})},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:`,Qn(t.error)),hs.error(r({id:`P47EWZ`}),{description:Qn(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]!==c||t[46]!==l||t[47]!==U||t[48]!==H||t[49]!==m||t[50]!==K||t[51]!==te||t[52]!==v||t[53]!==i||t[54]!==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;Nq(l);return;case`duplicate`:if(!l)return;Fq(l);return;case`move-to-trash`:if(!l)return;jq(l);return;case`reveal-in-finder`:{if(!I||!L)return;let e=mZ(l,c,L);I.shell.showItemInFolder(e);return}case`send-to-ai`:{let e=ta.filter(e=>H[e.id]?.installed===!0);if(e.length===0){hs.error(r({id:`LKOLNn`}));return}let t=gZ(l,c,L);if(!t)return;let[n]=e;if(!n)return;U(n.id,t);return}case`copy-full-path`:{if(!L)return;let e=mZ(l,c,L);navigator.clipboard.writeText(e).then(()=>hs.success(r({id:`6_ZOw4`}),{description:e})).catch(e=>{console.warn(`[FileSidebar] clipboard write failed:`,e),hs.error(r({id:`vfRlCI`}))});return}case`copy-relative-path`:{let e=hZ(l,c);if(e===``){hs.error(r({id:`74eHt-`}));return}navigator.clipboard.writeText(e).then(()=>hs.success(r({id:`haHgQj`}),{description:e})).catch(e=>{console.warn(`[FileSidebar] clipboard write failed:`,e),hs.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:`,Qn(e.error)),hs.error(r({id:`P47EWZ`}),{description:Qn(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,c,m,K,te,H,U,v,r],t[44]=r,t[45]=c,t[46]=l,t[47]=U,t[48]=H,t[49]=m,t[50]=K,t[51]=te,t[52]=v,t[53]=i,t[54]=L,t[55]=Te,t[56]=Ee):(Te=t[55],Ee=t[56]),(0,Q.useEffect)(Te,Ee);let De=h&&b&&`motion-safe:delay-100`,Oe=x&&`opacity-0`,ke;t[57]!==De||t[58]!==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[57]=De,t[58]=Oe,t[59]=ke):ke=t[59];let Ae;t[60]===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[60]=Ae):Ae=t[60];let je;t[61]===b?je=t[62]:(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[61]=b,t[62]=je);let Me;t[63]===Symbol.for(`react.memo_cache_sentinel`)?(Me=Y(`flex items-center gap-1`,h&&`[&>*]:[-webkit-app-region:no-drag]`),t[63]=Me):Me=t[63];let Ne;t[64]!==r||t[65]!==k||t[66]!==O||t[67]!==A||t[68]!==i?(Ne=O?(0,Z.jsxs)(Tc,{children:[(0,Z.jsx)(hc,{asChild:!0,children:(0,Z.jsx)(xZ,{icon:qd,label:r({id:`Rq1vFD`})})}),(0,Z.jsxs)(yc,{align:`end`,className:`min-w-52`,children:[k?null:(0,Z.jsxs)(_c,{onSelect:()=>i?.expandAll(),children:[(0,Z.jsx)(Ff,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`OlAl5i`})]}),A?null:(0,Z.jsxs)(_c,{onSelect:()=>i?.collapseAll(),children:[(0,Z.jsx)(Fd,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`qvWGzP`})]})]})]}):null,t[64]=r,t[65]=k,t[66]=O,t[67]=A,t[68]=i,t[69]=Ne):Ne=t[69];let Pe;t[70]===r?Pe=t[71]:(Pe=r({id:`HdkSiO`}),t[70]=r,t[71]=Pe);let Fe;t[72]!==m||t[73]!==i?(Fe=()=>i?.startCreating(`file`,m),t[72]=m,t[73]=i,t[74]=Fe):Fe=t[74];let Ie;t[75]!==Pe||t[76]!==Fe?(Ie=(0,Z.jsx)(xZ,{icon:xf,label:Pe,onClick:Fe}),t[75]=Pe,t[76]=Fe,t[77]=Ie):Ie=t[77];let Le;t[78]!==r||t[79]!==F||t[80]!==m||t[81]!==i?(Le=F?(0,Z.jsxs)(Tc,{children:[(0,Z.jsx)(hc,{asChild:!0,children:(0,Z.jsx)(xZ,{icon:Za,label:r({id:`Uuj_R4`})})}),(0,Z.jsx)(yc,{align:`end`,className:`min-w-52`,children:(0,Z.jsx)(wq,{parentDir:m,onSelectTemplate:e=>i?.createFromTemplate(m,e),ItemComponent:_c})})]}):null,t[78]=r,t[79]=F,t[80]=m,t[81]=i,t[82]=Le):Le=t[82];let Re;t[83]===r?Re=t[84]:(Re=r({id:`96G6Re`}),t[83]=r,t[84]=Re);let ze;t[85]!==m||t[86]!==i?(ze=()=>i?.startCreating(`folder`,m),t[85]=m,t[86]=i,t[87]=ze):ze=t[87];let Be;t[88]!==Re||t[89]!==ze?(Be=(0,Z.jsx)(xZ,{icon:Ld,label:Re,onClick:ze}),t[88]=Re,t[89]=ze,t[90]=Be):Be=t[90];let Ve;t[91]!==Ne||t[92]!==Ie||t[93]!==Le||t[94]!==Be?(Ve=(0,Z.jsxs)(`div`,{"data-testid":`sidebar-toolbar`,className:Me,children:[Ne,Ie,Le,Be]}),t[91]=Ne,t[92]=Ie,t[93]=Le,t[94]=Be,t[95]=Ve):Ve=t[95];let He;t[96]!==ke||t[97]!==je||t[98]!==Ve?(He=(0,Z.jsxs)(kj,{"data-electron-drag":h?``:void 0,className:ke,children:[Ae,je,Ve]}),t[96]=ke,t[97]=je,t[98]=Ve,t[99]=He):He=t[99];let Ue=h&&b&&`motion-safe:delay-100`,We=x&&`opacity-0`,Ge;t[100]!==Ue||t[101]!==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[100]=Ue,t[101]=We,t[102]=Ge):Ge=t[102];let Ke;t[103]===_?Ke=t[104]:(Ke=[_],t[103]=_,t[104]=Ke);let qe;t[105]===n?qe=t[106]:(qe=(0,Z.jsx)(xX,{onClick:n}),t[105]=n,t[106]=qe);let Je;t[107]!==Ke||t[108]!==qe?(Je=(0,Z.jsx)(g,{fallbackRender:CZ,onError:bX,resetKeys:Ke,children:qe}),t[107]=Ke,t[108]=qe,t[109]=Je):Je=t[109];let Ye;t[110]!==Ge||t[111]!==Je?(Ye=(0,Z.jsx)(`div`,{className:Ge,children:Je}),t[110]=Ge,t[111]=Je,t[112]=Ye):Ye=t[112];let Xe;t[113]===Symbol.for(`react.memo_cache_sentinel`)?(Xe=(0,Z.jsx)(sI,{}),t[113]=Xe):Xe=t[113];let Ze;t[114]===Symbol.for(`react.memo_cache_sentinel`)?(Ze=(0,Z.jsx)(Fo,{className:`size-3.5 shrink-0`}),t[114]=Ze):Ze=t[114];let Qe;t[115]===V?Qe=t[116]:(Qe=(0,Z.jsx)(`span`,{className:`truncate`,children:V}),t[115]=V,t[116]=Qe);let $e;t[117]===Symbol.for(`react.memo_cache_sentinel`)?($e=(0,Z.jsx)(Ki,{className:`size-3.5 shrink-0 text-muted-foreground transition-transform group-data-[state=open]/files:rotate-90`}),t[117]=$e):$e=t[117];let et;t[118]===Qe?et=t[119]:(et=(0,Z.jsx)(Nj,{asChild:!0,className:`shrink-0`,children:(0,Z.jsxs)(Vs,{"data-sidebar-root-context":!0,className:`flex w-full items-center gap-1.5`,children:[Ze,Qe,$e]})}),t[118]=Qe,t[119]=et);let tt=o==null?`50vh`:`${o}px`,nt;t[120]===tt?nt=t[121]:(nt={height:tt},t[120]=tt,t[121]=nt);let rt;t[122]===Symbol.for(`react.memo_cache_sentinel`)?(rt=(0,Z.jsx)(WJ,{ref:a,onContentHeightChange:s}),t[122]=rt):rt=t[122];let it;t[123]===nt?it=t[124]:(it=(0,Z.jsx)(Bs,{className:`flex max-h-[70vh] flex-col overflow-hidden`,style:nt,children:rt}),t[123]=nt,t[124]=it);let at;t[125]!==et||t[126]!==it?(at=(0,Z.jsx)(Hs,{defaultOpen:!0,className:`group/files flex shrink-0 flex-col`,children:(0,Z.jsxs)(Mj,{className:`min-h-0 px-0`,children:[et,it]})}),t[125]=et,t[126]=it,t[127]=at):at=t[127];let ot;t[128]===Symbol.for(`react.memo_cache_sentinel`)?(ot=(0,Z.jsx)(SX,{}),t[128]=ot):ot=t[128];let st;t[129]===i?st=t[130]:(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[129]=i,t[130]=st);let ct;t[131]!==at||t[132]!==st?(ct=(0,Z.jsxs)(jj,{children:[Xe,at,ot,st]}),t[131]=at,t[132]=st,t[133]=ct):ct=t[133];let lt;t[134]===Symbol.for(`react.memo_cache_sentinel`)?(lt=(0,Z.jsxs)(Aj,{className:`px-0`,children:[(0,Z.jsx)(BY,{}),(0,Z.jsx)(pZ,{}),typeof window<`u`&&window.okDesktop?(0,Z.jsx)(Ij,{children:(0,Z.jsx)(Lj,{children:(0,Z.jsx)(dX,{bridge:window.okDesktop})})}):null]}),t[134]=lt):lt=t[134];let ut=!(y&&_===`collapsed`),dt;t[135]===ut?dt=t[136]:(dt=(0,Z.jsx)(Dj,{enableToggle:!1,enableDrag:ut}),t[135]=ut,t[136]=dt);let ft;t[137]!==He||t[138]!==Ye||t[139]!==ct||t[140]!==dt?(ft=(0,Z.jsx)(HN,{asChild:!0,children:(0,Z.jsxs)(`div`,{className:`contents`,onContextMenu:ae,children:[He,Ye,ct,lt,dt]})}),t[137]=He,t[138]=Ye,t[139]=ct,t[140]=dt,t[141]=ft):ft=t[141];let pt=!L,ht,gt;t[142]===Symbol.for(`react.memo_cache_sentinel`)?(ht=(0,Z.jsx)(xf,{"aria-hidden":`true`}),gt=(0,Z.jsx)(J,{id:`HdkSiO`}),t[142]=ht,t[143]=gt):(ht=t[142],gt=t[143]);let _t;t[144]!==se||t[145]!==pt?(_t=(0,Z.jsxs)(KN,{disabled:pt,onSelect:se,"data-testid":`empty-space-menu-new-file`,children:[ht,gt]}),t[144]=se,t[145]=pt,t[146]=_t):_t=t[146];let vt;t[147]!==le||t[148]!==P||t[149]!==L?(vt=P?(0,Z.jsxs)(WN,{children:[(0,Z.jsxs)(qN,{disabled:!L,"data-testid":`empty-space-menu-new-from-template`,children:[(0,Z.jsx)(Za,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`Uuj_R4`})]}),(0,Z.jsx)(JN,{children:(0,Z.jsx)(wq,{parentDir:``,onSelectTemplate:le,ItemComponent:KN})})]}):null,t[147]=le,t[148]=P,t[149]=L,t[150]=vt):vt=t[150];let yt=!L,bt,xt;t[151]===Symbol.for(`react.memo_cache_sentinel`)?(bt=(0,Z.jsx)(Ld,{"aria-hidden":`true`}),xt=(0,Z.jsx)(J,{id:`96G6Re`}),t[151]=bt,t[152]=xt):(bt=t[151],xt=t[152]);let St;t[153]!==ue||t[154]!==yt?(St=(0,Z.jsxs)(KN,{disabled:yt,onSelect:ue,"data-testid":`empty-space-menu-new-folder`,children:[bt,xt]}),t[153]=ue,t[154]=yt,t[155]=St):St=t[155];let Ct;t[156]===Symbol.for(`react.memo_cache_sentinel`)?(Ct=(0,Z.jsx)(ZN,{}),t[156]=Ct):Ct=t[156];let wt;t[157]!==r||t[158]!==fe||t[159]!==L?(wt=I?(0,Z.jsxs)(KN,{disabled:!L,onSelect:fe,"data-testid":`empty-space-menu-reveal-in-finder`,"aria-label":r(L?{id:`LtSYdi`}:{id:`o2yoFu`}),children:[(0,Z.jsx)(Fo,{"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[157]=r,t[158]=fe,t[159]=L,t[160]=wt):wt=t[160];let Tt;t[161]!==U||t[162]!==G||t[163]!==H?(Tt=(0,Z.jsx)(OY,{input:G,installStates:H,dispatch:U}),t[161]=U,t[162]=G,t[163]=H,t[164]=Tt):Tt=t[164];let Et;t[165]!==ge||t[166]!==z?(Et=z?(0,Z.jsxs)(KN,{onSelect:ge,"data-testid":`empty-space-menu-share`,children:[(0,Z.jsx)(_f,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`Z8lGw6`})]}):null,t[165]=ge,t[166]=z,t[167]=Et):Et=t[167];let Dt=!L,Ot;t[168]!==r||t[169]!==L?(Ot=r(L?{id:`Up2_7p`}:{id:`U8CD-l`}),t[168]=r,t[169]=L,t[170]=Ot):Ot=t[170];let kt;t[171]===Symbol.for(`react.memo_cache_sentinel`)?(kt=(0,Z.jsx)(xo,{"aria-hidden":`true`}),t[171]=kt):kt=t[171];let At;t[172]===Symbol.for(`react.memo_cache_sentinel`)?(At=(0,Z.jsx)(`span`,{className:`flex-1`,children:(0,Z.jsx)(J,{id:`Up2_7p`})}),t[172]=At):At=t[172];let jt;t[173]===L?jt=t[174]:(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[173]=L,t[174]=jt);let Mt;t[175]!==me||t[176]!==Dt||t[177]!==Ot||t[178]!==jt?(Mt=(0,Z.jsxs)(KN,{disabled:Dt,onSelect:me,"data-testid":`empty-space-menu-copy-full-path`,"aria-label":Ot,children:[kt,At,jt]}),t[175]=me,t[176]=Dt,t[177]=Ot,t[178]=jt,t[179]=Mt):Mt=t[179];let Nt;t[180]===Symbol.for(`react.memo_cache_sentinel`)?(Nt=(0,Z.jsx)(ZN,{}),t[180]=Nt):Nt=t[180];let Pt=K===null,Ft;t[181]===Symbol.for(`react.memo_cache_sentinel`)?(Ft=(0,Z.jsx)(J,{id:`XcGbim`}),t[181]=Ft):Ft=t[181];let It;t[182]!==ve||t[183]!==te||t[184]!==Pt?(It=(0,Z.jsx)(YN,{checked:te,onCheckedChange:ve,disabled:Pt,"data-testid":`empty-space-menu-show-hidden-files`,children:Ft}),t[182]=ve,t[183]=te,t[184]=Pt,t[185]=It):It=t[185];let Lt;t[186]===ie?Lt=t[187]:(Lt=ie?(0,Z.jsx)(ZN,{}):null,t[186]=ie,t[187]=Lt);let Rt;t[188]!==be||t[189]!==ne?(Rt=ne?(0,Z.jsxs)(KN,{onSelect:be,"data-testid":`empty-space-menu-expand-all`,children:[(0,Z.jsx)(Ff,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`OlAl5i`})]}):null,t[188]=be,t[189]=ne,t[190]=Rt):Rt=t[190];let zt;t[191]!==Se||t[192]!==re?(zt=re?(0,Z.jsxs)(KN,{onSelect:Se,"data-testid":`empty-space-menu-collapse-all`,children:[(0,Z.jsx)(Fd,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`qvWGzP`})]}):null,t[191]=Se,t[192]=re,t[193]=zt):zt=t[193];let Bt;t[194]!==_t||t[195]!==vt||t[196]!==St||t[197]!==wt||t[198]!==Tt||t[199]!==Et||t[200]!==Mt||t[201]!==It||t[202]!==Lt||t[203]!==Rt||t[204]!==zt?(Bt=(0,Z.jsxs)(GN,{className:`min-w-52`,children:[_t,vt,St,Ct,wt,Tt,Et,Mt,Nt,It,Lt,Rt,zt]}),t[194]=_t,t[195]=vt,t[196]=St,t[197]=wt,t[198]=Tt,t[199]=Et,t[200]=Mt,t[201]=It,t[202]=Lt,t[203]=Rt,t[204]=zt,t[205]=Bt):Bt=t[205];let Vt;return t[206]!==ft||t[207]!==Bt?(Vt=(0,Z.jsx)(Tj,{variant:`inset`,children:(0,Z.jsxs)(VN,{children:[ft,Bt]})}),t[206]=ft,t[207]=Bt,t[208]=Vt):Vt=t[208],Vt}function CZ(){return null}function wZ(e){return console.log(e)}function TZ(e){return hs.error(e)}function EZ(e){return hs.success(e)}function DZ(e){e.target instanceof Element&&e.target.closest(`[data-sidebar-root-context]`)||yZ(e.target)&&(e.preventDefault(),e.stopPropagation())}var OZ=(0,Q.lazy)(()=>n(()=>import(`./McpConsentDialogBody-DXwlUNR4.js`),__vite__mapDeps([93,1,6,7,73,16,13,17,56,18,57,54,55,75,94]),import.meta.url));function kZ(){let e=(0,$.c)(1);if(!(0,Q.useSyncExternalStore)(qu.subscribe,jZ,AZ))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)(OZ,{})}),e[0]=t):t=e[0],t}function AZ(){return!1}function jZ(){return qu.getSnapshot()!==null}function MZ(){let e=(0,$.c)(17),t=Dn(),{collabUrl:n,setSystemProvider:r,updateServerInstanceId:i,onBranchSwitched:a,observeBranch:o,observeDiskAck:s,refreshServerInfo:c}=mt(),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 jo,i=new ko({url:n,name:$r,document:e,onStateless:e=>{let{payload:t}=e;ne(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:RZ,onConfigValidationRejected:LZ,onConfigIgnoreNestedError:IZ,onUnknown:FZ})},onClose:PZ,onDisconnect:NZ}),a=xl(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=Be(()=>{u.current.refreshServerInfo()});i.on(`synced`,()=>{bl([`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 NZ(){console.warn(`[CC1] __system__ disconnected - derived views may be stale`)}function PZ(e){let{event:t}=e;console.warn(`[CC1] __system__ connection closed:`,t.code,t.reason)}function FZ(e){console.warn(`[CC1] Unparseable stateless payload, skipping:`,e.slice(0,100))}function IZ(e){qa(e)}function LZ(e){lo(e)}function RZ(e){bl([e.ch])}function zZ(e){let t=Wt(e);if(t)return{scope:`project`,name:t};let n=Xr(e);return n?.kind===`skill`?{scope:n.scope,name:n.name}:null}function BZ(e,t){let n=new Set(t.map(e=>`${e.scope}\u0000${e.name}`)),r=[];for(let t of e){let e=zZ(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:wr(i,e.name)}):r.push({kind:`close`,docName:t})}return r}function VZ(){let e=(0,$.c)(13),{openTabs:t,closeDocument:n}=mt(),r;e[0]===t?r=e[1]:(r=t.some(UZ),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=ua(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(HZ).sort().join(``)}`;if(s.current===r)return;s.current=r;let i=BZ(t,e);for(let e of i)e.kind===`retarget`?(Jo(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 HZ(e){return`${e.scope}\u0000${e.name}`}function UZ(e){return zZ(e)!==null}var WZ=1e3,GZ=3e4;function KZ(e){let t=e.scheduler??{setTimeout:(e,t)=>globalThis.setTimeout(e,t),clearTimeout:e=>globalThis.clearTimeout(e)},n=e.initialBackoffMs??WZ,r=e.maxBackoffMs??GZ,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 qZ(e){if(e)return e.replace(/\/collab\/?$/,``)}function JZ(){return we(window)!==null}function YZ(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??KZ;if((i.current?.isElectronHost??JZ)())return;let t=e({resolveWsUrl:async()=>qZ(r.current)});return()=>t.close()},c=[],n[3]=s,n[4]=c):(s=n[3],c=n[4]),(0,Q.useEffect)(s,c)}var XZ=(0,Q.lazy)(()=>n(()=>import(`./ShareBranchSwitchDialog-Bo95Aacz.js`).then(e=>({default:e.ShareBranchSwitchDialog})),__vite__mapDeps([95,1,6,7,13,54,16,17,55,61,63,96,97,98,99,10,3,11]),import.meta.url)),ZZ=(0,Q.lazy)(()=>n(()=>import(`./ShareReceiveMissDialog-5z7ipD0K.js`).then(e=>({default:e.ShareReceiveMissDialog})),__vite__mapDeps([100,1,54,6,7,16,13,17,55,101,78,10,3,11,51,52,36,33,30,57,62,63,96,80,35,32,38]),import.meta.url)),QZ=`#install-claude-desktop`;function $Z(e){return e===`#settings`||e===QZ}function eQ(e,t,n){return[e,t,n].map(e=>[...e].sort().join(`\0`)).join(``)}function tQ(){let e=(0,$.c)(23),{clearTarget:t,syncOpenTabsWithKnownTargets:n,tabSessionLoaded:r}=mt(),{openTargetTransition:i}=Dt();VZ();let{assetPaths:a,folderPaths:o,loading:s,pageMeta:c,pages:l,pagesBySlug:u,pagesByBasename:d}=Yi(),f=(0,Q.useRef)(null),p;e[0]!==a||e[1]!==o||e[2]!==l?(p=eQ(l,o,a),e[0]=a,e[1]=o,e[2]=l,e[3]=p):p=e[3];let m=p,h,g;e[4]!==a||e[5]!==o||e[6]!==s||e[7]!==l||e[8]!==n||e[9]!==r||e[10]!==m?(h=()=>{s||!r||f.current===m||(f.current=m,n({pages:l,folderPaths:o,assetPaths:a}))},g=[a,o,s,l,n,r,m],e[4]=a,e[5]=o,e[6]=s,e[7]=l,e[8]=n,e[9]=r,e[10]=m,e[11]=h,e[12]=g):(h=e[11],g=e[12]),(0,Q.useEffect)(h,g);let _,v;return e[13]!==t||e[14]!==o||e[15]!==s||e[16]!==i||e[17]!==c||e[18]!==l||e[19]!==d||e[20]!==u?(_=()=>{e();function e(){if($Z(window.location.hash))return;let e=ll(window.location.hash);if(e){let t=Gn(e.split(`.`).pop()??``);wl(`ok/nav/hash-change`,{docName:null,kind:`asset`}),i({kind:`asset`,target:e,assetPath:e,mediaKind:t});return}let n=nl(window.location.hash);if(n){wl(`ok/nav/hash-change`,{docName:null,kind:`skill-file`}),i({kind:`skill-file`,target:`${n.scope}/${n.name}/${n.path}`,scope:n.scope,name:n.name,path:n.path});return}if(ml(window.location.hash)){wl(`ok/nav/hash-change`,{docName:null,kind:`folder`}),i({kind:`folder`,target:``,folderPath:``});return}let r=dl(window.location.hash);if(!r){wl(`ok/nav/hash-change`,{docName:null,kind:`clear`}),t();return}if(s){wl(`ok/nav/hash-change`,{docName:r,kind:`deferred-loading`});return}let a=hl(r,{pages:l,folderPaths:o,pagesBySlug:u,pagesByBasename:d});if(a.kind===`missing`&&/\/+$/.test(r.trim())){wl(`ok/nav/hash-change`,{docName:r,kind:`deferred-missing-folder`});return}let f=_l(il(a),c);wl(`ok/nav/hash-change`,{docName:r,kind:f.kind}),i(f)}return window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},v=[t,o,s,i,c,l,u,d],e[13]=t,e[14]=o,e[15]=s,e[16]=i,e[17]=c,e[18]=l,e[19]=d,e[20]=u,e[21]=_,e[22]=v):(_=e[21],v=e[22]),(0,Q.useEffect)(_,v),null}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)(rQ,t),null}function rQ(){let e=oQ;if(!e(window.location.hash))return;let t=new AbortController;return c(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(aQ))}).catch(iQ),()=>t.abort()}function iQ(){}function aQ(){}function oQ(e){return!$Z(e)&&!ll(e)&&!dl(e)&&(e===``||e===`#`||e===`#/`)}function sQ(){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)(cQ,t),null}function cQ(){let e=function(e){let t=e.target;Ga({target:t,metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey,key:e.key})&&(e.preventDefault(),window.location.hash!==`#settings`&&(window.location.hash=Ua))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)}function lQ(){let e=(0,$.c)(4),{activeTarget:t}=mt(),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 uQ(){let e=(0,$.c)(8),{activeDocName:t,activeTarget:n}=mt(),[r,i]=(0,Q.useState)(!1),a;e[0]!==t||e[1]!==n?(a=n?.kind===`folder`?n.folderPath:Jc(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;lh({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)(dh,{open:r,onOpenChange:i,kind:`file`,initialDir:o}),e[5]=r,e[6]=o,e[7]=l):l=e[7],l}function dQ(e){let t=(0,$.c)(3),{children:n}=e,{collabUrl:r}=mt();YZ(r);let i;return t[0]!==n||t[1]!==r?(i=(0,Z.jsx)(No,{collabUrl:r,children:n}),t[0]=n,t[1]=r,t[2]=i):i=t[2],i}function fQ(){let e=(0,$.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Z.jsx)(Tl,{name:`app`,children:(0,Z.jsx)(Pt,{children:(0,Z.jsx)(dQ,{children:(0,Z.jsx)(ig,{children:(0,Z.jsx)(pQ,{})})})})}),e[0]=t):t=e[0],t}function pQ(){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=sg(),o;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=t?{launchInTerminal:mQ}:null,e[0]=o):o=e[0];let s=o,c;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Z.jsx)(Pg,{}),e[1]=c):c=e[1];let l,u,d,f,p;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Z.jsx)(MZ,{}),u=(0,Z.jsx)(tQ,{}),d=(0,Z.jsx)(nQ,{}),f=(0,Z.jsx)(lQ,{}),p=(0,Z.jsx)(uQ,{}),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)(sQ,{}),e[7]=a,e[8]=m);let h,g,_,v;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(_=!1,v=t?(0,Z.jsx)(Fg,{bridge:t}):null,h=(0,Z.jsx)(kZ,{}),g=t?(0,Z.jsxs)(Q.Suspense,{fallback:null,children:[(0,Z.jsx)(XZ,{bridge:t}),(0,Z.jsx)(ZZ,{})]}):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)(Cg,{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)(bZ,{onOpenSearch:()=>i(!0)}),e[16]=a,e[17]=x);let S;e[18]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,Z.jsx)(Oj,{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)(fa,{value:s,children:(0,Z.jsxs)(Sj,{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)(Zi,{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 mQ(e,t){jF(Sa(e,t),t)}function hQ(e){let t=/\/([^/]+?)(?:\.git)?\/?$/.exec(e);return t?t[1]:`repo`}function gQ(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=hQ(t),a=`${r.replace(/\/$/,``)}/${i}`,o=hs.loading(Wc._({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);hs.loading(Wc._({id:`GXf9hG`,values:{repoName:i}}),{id:o,description:Wc._({id:`SCzAbA`,values:{phase:t,pct:n}}),duration:1/0});continue}if(e.type===`branch-fallback`){console.log(Yu({branch_action:`fallback`,branch:e.branch})),hs.info(Wc._({id:`3JYy1p`,values:{0:e.branch}}),{duration:8e3});continue}if(e.type===`complete`)return hs.success(Wc._({id:`IRv9cH`,values:{repoName:i}}),{id:o,duration:4e3}),{kind:`ok`,dir:e.dir};if(e.type===`error`)return hs.dismiss(o),{kind:`error`,detail:e.message}}return hs.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 hs.dismiss(o),{kind:`error`,detail:t}}}}}function _Q(){return{start(e){return Na((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=ni.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 vQ(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 yQ(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 bQ(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 xQ(e){let t=(0,$.c)(100),{open:n,onOpenChange:r,onSignIn:i,onCloneComplete:a,transport:o,authQueryTransport:s,pickParentFolder:c,initialUrl:l}=e,{_:u}=$t(),d;t[0]===o?d=t[1]:(d=o??_Q(),t[0]=o,t[1]=d);let f=d,p;t[2]===s?p=t[3]:(p=s??co(),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=po(),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=>{ao(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=bQ(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=bQ(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){hs.error(u({id:`FTUGgh`}));return}let t=v||``;if(c){O(!0);let n=await c();if(!n){O(!1);return}let r=bQ(e);t=`${n.replace(/\/$/,``)}/${r}`}else O(!0);let n=hs.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(yQ(i.phase));hs.loading(`${e} — ${i.pct}%`,{id:n})}else if(i.type===`complete`){hs.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;hs.error(u({id:`eFJkVt`,values:{cloneError:e}}),{id:n}),O(!1),N.current=null;return}t=await e.next()}hs.error(u({id:`Tz9pJB`}),{id:n}),O(!1),N.current=null}catch(e){console.error(`[CloneDialog] clone iteration failed:`,e),hs.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),hs.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(DQ)):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)(Js,{children:(0,Z.jsx)(Ws,{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)(Hc,{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)($e,{open:ge,onOpenChange:A,children:[(0,Z.jsx)(Oe,{asChild:!0,children:(0,Z.jsx)(Hc,{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)(yt,{align:`start`,sideOffset:4,className:`w-(--radix-popover-trigger-width) max-h-56 overflow-y-auto overscroll-y-contain subtle-scrollbar p-0`,onOpenAutoFocus:EQ,onCloseAutoFocus:TQ,onInteractOutside:e=>{F.current?.contains(e.target)&&e.preventDefault()},onWheel:wQ,onTouchMove:CQ,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)(Ba,{className:`h-4 w-2/3`}),(0,Z.jsx)(Ba,{className:`h-4 w-1/2`}),(0,Z.jsx)(Ba,{className:`h-4 w-3/4`}),(0,Z.jsx)(Ba,{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:SQ,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)(Xd,{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)(Ji,{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)(Hc,{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)(Ks,{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 ke;t[87]!==D||t[88]!==re||t[89]!==se||t[90]!==g||t[91]!==h?(ke=(0,Z.jsx)(qs,{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]=ke):ke=t[92];let Ae;t[93]!==De||t[94]!==ke?(Ae=(0,Z.jsxs)(Gs,{className:`sm:max-w-lg`,children:[Ce,De,ke]}),t[93]=De,t[94]=ke,t[95]=Ae):Ae=t[95];let je;return t[96]!==se||t[97]!==n||t[98]!==Ae?(je=(0,Z.jsx)(Ys,{open:n,onOpenChange:se,children:Ae}),t[96]=se,t[97]=n,t[98]=Ae,t[99]=je):je=t[99],je}function SQ(e){return e.preventDefault()}function CQ(e){return e.stopPropagation()}function wQ(e){return e.stopPropagation()}function TQ(e){return e.preventDefault()}function EQ(e){return e.preventDefault()}function DQ(e){return Math.max(e-1,-1)}var OQ=(0,Q.lazy)(()=>n(()=>import(`./ConsentDialogBody-Bza0TMPd.js`),__vite__mapDeps([102,1,6,7,73,16,13,17,56,18,57,53,54,55,59,103,75,76,15,19,20,62,65,81]),import.meta.url));function kQ(){let e=(0,$.c)(1);if(!(0,Q.useSyncExternalStore)(Vc.subscribe,jQ,AQ))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)(OQ,{})}),e[0]=t):t=e[0],t}function AQ(){return!1}function jQ(){return Vc.getSnapshot()!==null}function MQ(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 NQ=(0,Q.lazy)(()=>n(()=>import(`./ShareReceiveDialog-jEI9GD0l.js`).then(e=>({default:e.ShareReceiveDialog})),__vite__mapDeps([104,1,10,3,11,6,7,13,54,16,17,55,63,97,98,99]),import.meta.url)),PQ=(e,t,n)=>tg(e,t,n,`NavigatorApp`);function FQ(e,t){return e.filter(e=>e.path!==t)}function IQ(e){let t=(0,$.c)(116),{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)(null),[p,m]=(0,Q.useState)(!1),[h,g]=(0,Q.useState)(!1),[_,v]=(0,Q.useState)(!1),[y,b]=(0,Q.useState)(!1),[x,S]=(0,Q.useState)(null),C=typeof window<`u`&&window.okDesktop!=null,[w,T]=(0,Q.useState)(`auth`),{theme:E}=Mn(),{_:D}=$t();Mo(n,E??`system`);let O;t[2]!==D||t[3]!==n.project?(O=()=>{let e=!1;return n.project.listRecent().then(async t=>{if(e)return;a(t);let r=t.filter(LQ),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||f(t instanceof Error?t.message:D({id:`fYKgzG`}))}).finally(()=>{e||u(!1)}),()=>{e=!0}},t[2]=D,t[3]=n.project,t[4]=O):O=t[4];let k;t[5]!==D||t[6]!==n?(k=[n,D],t[5]=D,t[6]=n,t[7]=k):k=t[7],(0,Q.useEffect)(O,k);let A,j;t[8]===n?(A=t[9],j=t[10]):(A=()=>n.onMenuAction(e=>{e===`new-project`&&g(!0),e===`close-active-tab-or-window`&&window.close()}),j=[n],t[8]=n,t[9]=A,t[10]=j),(0,Q.useEffect)(A,j);let M;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(M=(e,t)=>PQ(e,t,f),t[11]=M):M=t[11];let N=M,P;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(P=()=>m(!0),t[12]=P):P=t[12];let F=P,I;t[13]!==D||t[14]!==n?(I=()=>N(async()=>{let e=await n.dialog.openFolder();e&&await BQ(n,e,`pick-existing`)},D({id:`gmJ0An`})),t[13]=D,t[14]=n,t[15]=I):I=t[15];let L=I,R;t[16]===Symbol.for(`react.memo_cache_sentinel`)?(R=()=>g(!0),t[16]=R):R=t[16];let z=R,B;t[17]!==D||t[18]!==n?(B=e=>N(async()=>{await BQ(n,e,`recents`)},D({id:`SUOoXn`})),t[17]=D,t[18]=n,t[19]=B):B=t[19];let V=B,H;t[20]!==D||t[21]!==n.project?(H=e=>N(async()=>{await n.project.removeRecent(e),a(t=>FQ(t,e)),c(t=>{if(!t.has(e))return t;let n=new Map(t);return n.delete(e),n})},D({id:`viwC-K`})),t[20]=D,t[21]=n.project,t[22]=H):H=t[22];let U=H,W;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(W=(0,Z.jsx)(`div`,{className:`pointer-events-none absolute inset-x-0 top-0 z-10 h-9 ${C?`[-webkit-app-region:drag]`:``}`,"data-electron-drag":C?``:void 0,"data-testid":`nav-chrome-row`}),t[23]=W):W=t[23];let G;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(G=(0,Z.jsx)(MQ,{className:`size-12 shrink-0`}),t[24]=G):G=t[24];let K;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(K=(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)(TN,{})]}),t[25]=K):K=t[25];let ee;t[26]===n.appVersion?ee=t[27]:(ee=(0,Z.jsxs)(`header`,{className:`shrink-0 flex-wrap flex items-center gap-2.5`,children:[G,(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[K,(0,Z.jsxs)(`p`,{className:`text-muted-foreground text-xs font-mono`,children:[`v`,n.appVersion]})]})]}),t[26]=n.appVersion,t[27]=ee);let te;t[28]===D?te=t[29]:(te=D({id:`wbv9xO`}),t[28]=D,t[29]=te);let ne;t[30]===D?ne=t[31]:(ne=D({id:`0uTHCg`}),t[30]=D,t[31]=ne);let re;t[32]!==te||t[33]!==ne?(re=(0,Z.jsx)(RQ,{title:te,description:ne,onClick:z,dataTestId:`nav-create-new`,Icon:Zt}),t[32]=te,t[33]=ne,t[34]=re):re=t[34];let ie;t[35]===D?ie=t[36]:(ie=D({id:`WPwDin`}),t[35]=D,t[36]=ie);let ae;t[37]===D?ae=t[38]:(ae=D({id:`tUvUfp`}),t[37]=D,t[38]=ae);let oe;t[39]!==L||t[40]!==ie||t[41]!==ae?(oe=(0,Z.jsx)(RQ,{title:ie,description:ae,onClick:L,dataTestId:`nav-open`,Icon:Fo}),t[39]=L,t[40]=ie,t[41]=ae,t[42]=oe):oe=t[42];let se;t[43]===D?se=t[44]:(se=D({id:`VdXv4D`}),t[43]=D,t[44]=se);let ce;t[45]===D?ce=t[46]:(ce=D({id:`JOcPqH`}),t[45]=D,t[46]=ce);let le;t[47]!==se||t[48]!==ce?(le=(0,Z.jsx)(RQ,{title:se,description:ce,onClick:F,dataTestId:`nav-clone`,Icon:oF}),t[47]=se,t[48]=ce,t[49]=le):le=t[49];let q;t[50]!==re||t[51]!==oe||t[52]!==le?(q=(0,Z.jsxs)(`section`,{className:`grid shrink-0 sm:grid-cols-3 gap-3`,children:[re,oe,le]}),t[50]=re,t[51]=oe,t[52]=le,t[53]=q):q=t[53];let ue;t[54]===d?ue=t[55]:(ue=d===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:d}),(0,Z.jsx)(X,{type:`button`,variant:`link`,size:`sm`,onClick:()=>f(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[54]=d,t[55]=ue);let de;t[56]!==l||t[57]!==V||t[58]!==U||t[59]!==s||t[60]!==i?(de=l?(0,Z.jsx)(`section`,{className:`flex shrink-0 flex-col items-center`,children:(0,Z.jsx)($o,{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)(zQ,{project:e,branch:s.get(e.path)??null,onOpen:()=>V(e.path),onRemove:()=>U(e.path)},e.path))})]}):null,t[56]=l,t[57]=V,t[58]=U,t[59]=s,t[60]=i,t[61]=de):de=t[61];let fe;t[62]!==ee||t[63]!==q||t[64]!==ue||t[65]!==de?(fe=(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:[ee,q,ue,de]})}),t[62]=ee,t[63]=q,t[64]=ue,t[65]=de,t[66]=fe):fe=t[66];let pe,me;t[67]===Symbol.for(`react.memo_cache_sentinel`)?(pe=(0,Z.jsx)(kZ,{}),me=(0,Z.jsx)(kQ,{}),t[67]=pe,t[68]=me):(pe=t[67],me=t[68]);let he;t[69]!==n||t[70]!==h?(he=(0,Z.jsx)(sm,{open:h,onOpenChange:g,bridge:n}),t[69]=n,t[70]=h,t[71]=he):he=t[71];let ge;t[72]===x?ge=t[73]:(ge=e=>{v(e),e||(b(!1),x&&(x(null),S(null)))},t[72]=x,t[73]=ge);let _e;t[74]===n?_e=t[75]:(_e=ka(n),t[74]=n,t[75]=_e);let ve;t[76]===n?ve=t[77]:(ve=Ma(n),t[76]=n,t[77]=ve);let ye=w===`identity`,be;t[78]!==y||t[79]!==x?(be=e=>{v(!1),y&&(b(!1),m(!0)),x&&(x({authenticated:!0,host:`github.com`,login:e.login}),S(null))},t[78]=y,t[79]=x,t[80]=be):be=t[80];let xe;t[81]!==_||t[82]!==ge||t[83]!==_e||t[84]!==ve||t[85]!==ye||t[86]!==be?(xe=(0,Z.jsx)(Ha,{open:_,onOpenChange:ge,transport:_e,queryTransport:ve,identityPrompt:ye,onSuccess:be}),t[81]=_,t[82]=ge,t[83]=_e,t[84]=ve,t[85]=ye,t[86]=be,t[87]=xe):xe=t[87];let Se;t[88]===n?Se=t[89]:(Se=vQ(n),t[88]=n,t[89]=Se);let Ce;t[90]===n?Ce=t[91]:(Ce=Ma(n),t[90]=n,t[91]=Ce);let we;t[92]===n.dialog?we=t[93]:(we=()=>n.dialog.openFolder(),t[92]=n.dialog,t[93]=we);let Te;t[94]===Symbol.for(`react.memo_cache_sentinel`)?(Te=()=>{m(!1),T(`auth`),b(!0),v(!0)},t[94]=Te):Te=t[94];let Ee;t[95]!==D||t[96]!==n?(Ee=e=>{let{dir:t}=e;N(()=>BQ(n,t,`pick-existing`),D({id:`iSnkwB`}))},t[95]=D,t[96]=n,t[97]=Ee):Ee=t[97];let De;t[98]!==p||t[99]!==Se||t[100]!==Ce||t[101]!==we||t[102]!==Ee?(De=(0,Z.jsx)(xQ,{open:p,onOpenChange:m,transport:Se,authQueryTransport:Ce,pickParentFolder:we,onSignIn:Te,onCloneComplete:Ee}),t[98]=p,t[99]=Se,t[100]=Ce,t[101]=we,t[102]=Ee,t[103]=De):De=t[103];let Oe;if(t[104]!==n){let e;t[106]===Symbol.for(`react.memo_cache_sentinel`)?(e=()=>new Promise(e=>{S(()=>e),v(!0)}),t[106]=e):e=t[106],Oe=gQ({bridge:n,authQueryTransport:Ma(n),cloneTransport:vQ(n),openSignIn:e}),t[104]=n,t[105]=Oe}else Oe=t[105];let ke;t[107]!==n||t[108]!==Oe?(ke=(0,Z.jsx)(Q.Suspense,{fallback:null,children:(0,Z.jsx)(NQ,{bridge:n,cloneController:Oe})}),t[107]=n,t[108]=Oe,t[109]=ke):ke=t[109];let Ae;return t[110]!==fe||t[111]!==he||t[112]!==xe||t[113]!==De||t[114]!==ke?(Ae=(0,Z.jsxs)(`div`,{className:`relative flex h-screen w-screen flex-col overflow-hidden bg-primary-foreground dark:bg-background text-foreground`,children:[W,fe,pe,me,he,xe,De,ke]}),t[110]=fe,t[111]=he,t[112]=xe,t[113]=De,t[114]=ke,t[115]=Ae):Ae=t[115],Ae}function LQ(e){return!e.missing}function RQ(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 zQ(e){let t=(0,$.c)(44),{project:n,branch:r,onOpen:i,onRemove:a}=e,{_:o}=$t(),{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)(Rd,{"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)(qe,{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)(Io,{"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:ug(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)(qe,{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)(Io,{"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)(gs,{"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 BQ(e,t,n){await e.project.open({path:t,target:`new-window`,entryPoint:n})}function VQ(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)(HQ,{bridge:n}),t[0]=n,t[1]=i);let a;return t[2]!==r||t[3]!==i?(a=(0,Z.jsx)(No,{collabUrl:r,children:i}),t[2]=r,t[3]=i,t[4]=a):a=t[4],a}function HQ(e){let t=(0,$.c)(11),{bridge:n}=e,{resolvedTheme:r}=Mn(),i=Yg(),[a,o]=(0,Q.useState)(null),s;t[0]===r?s=t[1]:(s=Cu(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)(YF,{bridge:n,variant:`window`,visible:!0,onVisibleChange:WQ,installedClis:i,container:a,isShowing:!0,onRequestEditorFocus:UQ}),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 UQ(){}function WQ(e){e||window.close()}function GQ(e){return e?.config.mode===`terminal`?(0,Z.jsx)(VQ,{bridge:e}):e?.config.mode===`navigator`?(0,Z.jsx)(IQ,{bridge:e}):(0,Z.jsx)(fQ,{})}var KQ=e=>{let t=(0,$.c)(8),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let{theme:r}=Mn(),i=r===void 0?`system`:r,a,o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(a={success:(0,Z.jsx)(Xi,{className:`size-4`}),info:(0,Z.jsx)(Qo,{className:`size-4`}),warning:(0,Z.jsx)(os,{className:`size-4`}),error:(0,Z.jsx)(ef,{className:`size-4`}),loading:(0,Z.jsx)($o,{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)(_s,{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},qQ=Symbol.for(`ok.client.fetchWrapper`);function JQ(e={}){if(typeof window>`u`)return;let t=e.apiOrigin&&e.apiOrigin.length>0?e.apiOrigin:void 0;if(window.fetch[qQ])return;let n=window.fetch.bind(window),r=Ao(),i=((e,i)=>{let a=XQ(e,t);if(!a.isApi)return n(e,i);if(e instanceof Request){let t=YQ(e.headers,r);return n(new Request(a.url,e),{headers:t})}let o=YQ(i?.headers,r);return n(a.url,{...i,headers:o})});i[qQ]=!0,window.fetch=i}function YQ(e,t){let n=new Headers(e);for(let[e,r]of Object.entries(t))n.set(e,r);return n}function XQ(e,t){if(typeof e==`string`){if(e.startsWith(`/api/`))return{isApi:!0,url:t?t+e:e};let n=ZQ(e);return n&&QQ(n,t)?{isApi:!0,url:e}:{isApi:!1,url:e}}let n=e instanceof URL?e:ZQ(e.url,window.location.origin);if(n&&QQ(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 ZQ(e,t){try{return new URL(e,t)}catch{return null}}function QQ(e,t){if(!e.pathname.startsWith(`/api/`))return!1;if(e.origin===window.location.origin||e.protocol===`file:`)return!0;if(t){let n=ZQ(t);if(n&&e.origin===n.origin)return!0}return!1}var $Q={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"],"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."],"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"],"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"],"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"],"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"],"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"],"Aj1D9r":["Hide worktrees"],"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"],"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"]],"D12vtS":["(detached)"],"D4H2N6":["Remove ",["tag"]],"D8OV7J":["Only collaborators"],"DDTdLl":["Code block settings"],"DELNQk":["Collaborators see your in-progress edits as soon as they sync."],"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"],"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"],"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"],")"],"INEQsp":["Items to be created"],"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"]],"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:"],"LlHqdU":["Initializing project"],"Llyqvo":["This usually means one of:"],"LpB85N":["Plain"],"LtI9AS":["Owner"],"LtSYdi":["Reveal in Finder"],"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"],"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"],"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"]],"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"],"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"],"PZt1uN":["Search files, commands, projects, and AI handoff actions."],"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"],"QWks14":["A short line shown under the name in the template list."],"QYfQdv":[["displayName"]," CLI"],"QcpeeE":["Navigate to ",["docName"]],"QfFBdJ":["The template's filename (without \`.md\`)."],"Qj4RL5":["Completed:"],"QlxHAH":["Showing results for \\"",["semanticResultsLabel"],"\\""],"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"],"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."],"Sfh6zL":["The file on disk, and the id agents use. It can't be changed later."],"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>"],"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"],"UaRsDu":["Show worktrees"],"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."],"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."],"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."],"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"],"YGQm6y":["OpenKnowledge manages the <0>open-knowledge</0> MCP server name, the <1>open-knowledge-ui</1> launch config, and <2>ok</2> / <3>open-knowledge</3> on PATH (including OK-owned symlinks). Using a custom wrapper? Register it under a different name."],"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"],"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."],"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"],")"],"_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"]],"_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"],"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"],"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"],"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"]],"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"],"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"],"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"],"gYz2ep":["Expires in ",["timeLabel"]],"gbHcbI":["Failed to delete property"],"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"],"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"],"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"],"ij5sBu":[["0","plural",{"one":["worktree"],"other":["worktrees"]}]],"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"],"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"],"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"],"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"],"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."],"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"],"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"]}]],"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"],"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"]}]],"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"],"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"],")"],"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"]}]],"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"],"vM7XUh":["Add OpenKnowledge to your AI tools"],"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"],"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"]],"yf5r22":[["keyName"]," type: ",["typeLabel"]," (inherited from folder properties; not editable here)"],"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"],"yu8Pzy":["Not detected"],"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."],"zTHnl4":["Files & folders"],"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"]}`)},e$=`en`;Wc.load(e$,$Q.messages),Wc.activate(e$);var t$=Symbol.for(`ok.client.logForwarder`),n$=2e3,r$=[`log`,`info`,`warn`,`error`],i$={log:`info`,info:`info`,warn:`warn`,error:`error`};function a$(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 o$(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 s$(e={}){let t=e.windowObj??(typeof window<`u`?window:void 0);if(!t||t.okDesktop)return;let n=t;if(n[t$])return;n[t$]=!0;let r=e.consoleObj??console,i=e.documentObj===void 0?typeof document<`u`?document:null:e.documentObj,a=e.flushIntervalMs??n$,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+=o$(e),c.length>100){let e=c.shift();e&&(l-=o$(e))}if(c.length>=100||l>=32768){p();return}u===null&&(u=setTimeout(p,a))}function h(e,t){if(!d)try{let n=lr(t.map(a$).join(` `)),r=t[0],i=typeof r==`string`&&r.length<=32768?r:void 0,a=i?Er(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 r$)r[e]=(...t)=>{f[e](...t),h(i$[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: ${a$(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 r$)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[t$]}return{flushNow:p,uninstall:b}}function c$(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)=>{hs(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){es.arm(a);return}Si.arm(a),n(al(i,e.doc,i===`doc`?e.branch:void 0));let o=c$(e,t.config.projectPath);o!==null&&r(o.message,{description:o.description,duration:3e3})})}var u$=4e3,d$=1440*60*1e3;function f$(e){let t=e.bridge;if(t&&t.onboarding)return t.onboarding.onToast(e=>{if(e.kind===`ancestor-promote`){hs.success(`Opened existing OpenKnowledge project at ${e.ancestorPath}`,{duration:u$});return}if(e.kind===`startup-reclaim`){let t=[];if(e.mcp.status===`repaired`){let n=e.mcp.editors.map(e=>Br[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`;hs[r?`error`:`success`](n,{duration:r||i?d$:u$});return}if(e.kind===`sharing-refused-tracked`){hs.error(`Config sharing unchanged: ${e.tracked.length} OK file(s) tracked upstream — see message below.`,{duration:d$,description:e.remediation});return}if(e.kind===`sharing-no-git`){hs.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:u$});return}let t=Bc(e.gitRoot,e.pickedPath)??e.pickedPath;hs.success(`Initialized OpenKnowledge at ${e.gitRoot} — opened parent of ${t} because it contains a .git folder`,{duration:u$})})}function p$(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)(os,{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 m$(){return Wc._({id:`f_PkYv`})}function h$(e){return e.serverRuntime===e.appRuntime?Wc._({id:`FWQuPE`,values:{0:e.appRuntime}}):e.relation===`older`?Wc._({id:`LhQlGR`,values:{0:e.serverRuntime,1:e.appRuntime}}):Wc._({id:`yZmvQ4`,values:{0:e.serverRuntime,1:e.appRuntime}})}function g$(e){return Wc._({id:`2YOwme`,values:{appRuntime:e}})}function _$(e){return Wc._({id:`5DFPDh`,values:{appRuntime:e}})}function v$(e){return e===`eperm`?Wc._({id:`uQewpR`}):Wc._({id:`PqYWiC`})}async function y$(e){let t=hs.loading(Wc._({id:`Kf7GG5`}),{duration:1/0}),n;try{n=await e.restartServer(e.config.projectPath)}catch{return}hs.dismiss(t),n.ok===!1&&hs.error(v$(n.reason),{duration:1/0})}function b$(e){let t=e.bridge;if(!t)return;let n=t.onServerVersionDrift(e=>{hs.custom(n=>(0,Q.createElement)(p$,{body:h$(e),warning:m$(),restartLabel:Wc._({id:`ppDgFi`}),cancelLabel:Wc._({id:`PBxg_E`}),onRestart:()=>{hs.dismiss(n),y$(t)},onDismiss:()=>hs.dismiss(n)}),{duration:1/0})}),r=t.onServerRestarted(e=>{hs.success(g$(e.appRuntime))}),i=t.onServerReclaimed(e=>{hs.warning(_$(e.appRuntime),{duration:15e3})});return()=>{n(),r(),i()}}function x$(e){let{initialDoc:t}=e;if(!t)return;let n=e.getHash();n!==``&&n!==`#`&&n!==`#/`||e.setHash(fl(t))}function S$(){typeof window>`u`||!window.okDesktop||x$({initialDoc:window.okDesktop.config.initialDoc,getHash:()=>window.location.hash,setHash:e=>{window.location.hash=e}})}Zu(),n(()=>import(`./telemetry-startup-CJa6t0AY.js`).then(e=>e.initStartupTrace()),__vite__mapDeps([105,0,1,2,3,4,34,7]),import.meta.url),JQ({apiOrigin:typeof window<`u`?window.okDesktop?.config.apiOrigin:void 0}),s$(),LT()&&UT(),sZ(),Jw(),iF(),aN(),typeof window<`u`&&l$({bridge:window.okDesktop}),typeof window<`u`&&b$({bridge:window.okDesktop}),typeof window<`u`&&Ju({bridge:window.okDesktop}),typeof window<`u`&&zc({bridge:window.okDesktop}),typeof window<`u`&&f$({bridge:window.okDesktop}),typeof window<`u`&&Xu({bridge:window.okDesktop}),S$();var C$=new od({defaultOptions:{queries:{retry:1,staleTime:1e4}}}),w$=document.getElementById(`root`);if(!w$)throw Error(`Root element not found`);var T$=typeof window>`u`?void 0:window.okDesktop;(0,_d.createRoot)(w$).render((0,Z.jsx)(Q.StrictMode,{children:(0,Z.jsx)(en,{i18n:Wc,children:(0,Z.jsx)(yn,{client:C$,children:(0,Z.jsxs)(Nn,{attribute:`class`,defaultTheme:`system`,enableSystem:!0,disableTransitionOnChange:!0,storageKey:`ok-theme-v1`,children:[(0,Z.jsx)(Ds,{children:GQ(T$)}),(0,Z.jsx)(KQ,{richColors:!0,closeButton:!0})]})})})}));
|
|
2002
|
+
`}\n${MK}\n${NK}`;function kJ(e){let t=e.split(`/`).pop()?.replace(/\.md$/i,``).toLowerCase();return!!t&&pJ.has(t)}function AJ(e){return e===`darwin`?Wc._({id:`LtSYdi`}):e===`win32`?Wc._({id:`qi1F96`}):Wc._({id:`e1Rn_k`})}function jJ(e){let t=(0,$.c)(18),{item:n,workspace:r,onClose:i}=e,{_:a}=$t(),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=AJ(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=ea(r.contentDir,wu(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)(Fo,{"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)(_c,{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 MJ(e,t){return Gu({kind:e.endsWith(`/`)?`directory`:`file`,name:e,path:e},t)}function NJ(e,t){return e!==t&&e.startsWith(t)}function PJ(e,t){let n=[...new Set(e)],r=n.filter(e=>e.endsWith(`/`));return n.filter(e=>!r.some(t=>NJ(e,t))).map(e=>MJ(e,t))}function FJ(e,t){return e===t||e.startsWith(`${t}/`)}function IJ(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 LJ(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)Xc(e)&&e.docName.startsWith(`${o.path}/`)?r.add(e.docName):Qc(e)&&e.path.startsWith(`${o.path}/`)&&a.add(e.path);for(let e of n){let t=Ku(e);FJ(t,o.path)&&i.add(t)}}return{docNames:r,folderPaths:i,assetPaths:a}}function RJ(e,t){return e.kind===`file`?t.kind===`file`&&e.path===t.createdPath:e.kind===`asset`?!1:FJ(t.createdPath,e.path)}function zJ(e){let t=(0,$.c)(69),{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}=$t(),x=Gu(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?Ku(n.path):null,t[3]=S,t[4]=n.path,t[5]=k):k=t[5];let A=fo(k),j=A.state.status===`ready`?(A.state.data.folder.templates_available?.length??0)>0:!0,M=s.getSelectedPaths(),N=M.includes(x.treePath)?PJ(M,y):[],P=N.length>1?N:[x],F=P.length,I=Wc._({id:`djjdjr`,values:{deleteCount:F}}),L;t[6]!==v||t[7]!==S||t[8]!==n||t[9]!==a?(L=v?null:S?ia({folderRelativePath:wu(n),workspace:a}):ba({docName:Eu(n.path),workspace:a}),t[6]=v,t[7]=S,t[8]=n,t[9]=a,t[10]=L):L=t[10];let R=L,z;t[11]===r?z=t[12]:(z=()=>r.close({restoreFocus:!1}),t[11]=r,t[12]=z);let B=z,V;t[13]===r?V=t[14]:(V=()=>r.close(),t[13]=r,t[14]=V);let H=V,{status:U}=ki(),W=U?.hasRemote===!0,G;t[15]!==v||t[16]!==S||t[17]!==n.path||t[18]!==x?(G=v||x.kind===`asset`?null:S?Oa(Ku(n.path)):Ia(Eu(n.path)),t[15]=v,t[16]=S,t[17]=n.path,t[18]=x,t[19]=G):G=t[19];let K=G,ee=W&&K!==null,te;t[20]!==b||t[21]!==W||t[22]!==K?(te=()=>{K&&ja({...K,hasRemote:W,onClickWhenNoRemote:()=>{hs.error(b({id:`WyQxwa`}))}},{clipboardWrite:ga,toastSuccess:HJ,toastError:VJ,logEvent:BJ})},t[20]=b,t[21]=W,t[22]=K,t[23]=te):te=t[23];let ne=te,re;t[24]!==ee||t[25]!==H||t[26]!==ne?(re=ee?(0,Z.jsxs)(_c,{"data-testid":`file-tree-menu-share`,onSelect:()=>{H(),ne()},children:[(0,Z.jsx)(_f,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`Z8lGw6`})]}):null,t[24]=ee,t[25]=H,t[26]=ne,t[27]=re):re=t[27];let ie=re,ae;t[28]!==b||t[29]!==l?(ae=e=>{if(l===null)return;let t=l.patch({appearance:{sidebar:{showHiddenFiles:e}}});t.ok||(console.warn(`[FileTree] showHiddenFiles toggle rejected:`,Qn(t.error)),hs.error(b({id:`P47EWZ`}),{description:Qn(t.error)}))},t[28]=b,t[29]=l,t[30]=ae):ae=t[30];let oe=ae,se=0,ce=0;if(S){let e=Ru(n.path);for(let t of _)(t===e||t.startsWith(e))&&(se++,Tq(s.getItem(t))?.isExpanded()&&ce++)}let le=S&&ce<se,q=S&&ce>0,ue;t[31]===H?ue=t[32]:(ue=e=>{e||H()},t[31]=H,t[32]=ue);let de;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(de=(0,Z.jsx)(hc,{asChild:!0,children:(0,Z.jsx)(`span`,{"aria-hidden":`true`,"data-file-tree-context-menu-root":`true`,className:`block size-px`})}),t[33]=de):de=t[33];let fe;t[34]!==b||t[35]!==i||t[36]!==w||t[37]!==O||t[38]!==H||t[39]!==B||t[40]!==I||t[41]!==P||t[42]!==j||t[43]!==oe||t[44]!==o||t[45]!==R||t[46]!==E||t[47]!==v||t[48]!==S||t[49]!==n||t[50]!==s||t[51]!==c||t[52]!==C||t[53]!==g||t[54]!==f||t[55]!==m||t[56]!==p||t[57]!==h||t[58]!==d||t[59]!==ie||t[60]!==D||t[61]!==q||t[62]!==le||t[63]!==x||t[64]!==a?(fe=(0,Z.jsx)(yc,{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)(_c,{disabled:i,onSelect:()=>{B(),d(`file`,Ku(n.path))},children:[(0,Z.jsx)(xf,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`HdkSiO`})]}),j?(0,Z.jsxs)(mc,{children:[(0,Z.jsxs)(kc,{disabled:i,children:[(0,Z.jsx)(Za,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`Uuj_R4`})]}),(0,Z.jsx)(nc,{children:(0,Z.jsx)(wq,{parentDir:Ku(n.path),onSelectTemplate:e=>{B(),f(Ku(n.path),e)},ItemComponent:_c})})]}):null,(0,Z.jsxs)(_c,{disabled:i,onSelect:()=>{B(),d(`folder`,Ku(n.path))},children:[(0,Z.jsx)(Ld,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`96G6Re`})]}),(0,Z.jsx)(Ac,{}),(0,Z.jsx)(jJ,{item:n,workspace:a,onClose:H}),(0,Z.jsx)(aa,{input:R,installStates:o.installStates,isElectronHost:o.isElectronHost,dispatch:o.dispatch}),ie,(0,Z.jsxs)(mc,{children:[(0,Z.jsxs)(kc,{children:[(0,Z.jsx)(xo,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`oCZkaG`})]}),(0,Z.jsxs)(nc,{children:[(0,Z.jsx)(_c,{disabled:!a,onSelect:()=>{a&&(H(),fJ(ea(a.contentDir,wu(n),a.pathSeparator),`full`))},children:(0,Z.jsx)(J,{id:`oQA-cA`})}),(0,Z.jsx)(_c,{onSelect:()=>{H(),fJ(wu(n),`relative`)},children:(0,Z.jsx)(J,{id:`s061i4`})})]})]}),(0,Z.jsx)(Ac,{}),(0,Z.jsx)(Cc,{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)(Ac,{}):null,le?(0,Z.jsxs)(_c,{onSelect:()=>{H(),h(n.path)},children:[(0,Z.jsx)(Ff,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`OlAl5i`})]}):null,q?(0,Z.jsxs)(_c,{onSelect:()=>{H(),g(n.path)},children:[(0,Z.jsx)(Fd,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`qvWGzP`})]}):null,(0,Z.jsx)(Ac,{}),(0,Z.jsxs)(_c,{disabled:i,onSelect:()=>{x.kind!==`asset`&&(H(),p(x))},children:[(0,Z.jsx)(Co,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`euc6Ns`})]}),(0,Z.jsxs)(_c,{disabled:i,onSelect:()=>{B(),s.startRenaming(n.path)},children:[(0,Z.jsx)(Do,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`2wxgft`})]}),(0,Z.jsxs)(_c,{"data-testid":`file-tree-menu-hide`,disabled:!w,onSelect:()=>{if(!c||!C)return;H();let e=XK(C),t=io(c.current()),n=ho(t,e);if(n===t)return;c.patch(Ka(n));let r=C.path.split(`/`).pop()||C.path;hs.success(b({id:`4xtLTl`,values:{basename:r}}),{description:b({id:`nWv1ja`}),duration:5e3})},children:[(0,Z.jsx)(Ve,{"aria-hidden":`true`}),E]}),(0,Z.jsxs)(_c,{variant:`destructive`,disabled:i,onSelect:()=>{H(),m(P)},children:[(0,Z.jsx)(To,{"aria-hidden":`true`}),I]})]}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(jJ,{item:n,workspace:a,onClose:H}),!v&&(0,Z.jsx)(aa,{input:R,installStates:o.installStates,isElectronHost:o.isElectronHost,dispatch:o.dispatch}),ie,(0,Z.jsxs)(mc,{children:[(0,Z.jsxs)(kc,{children:[(0,Z.jsx)(xo,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`oCZkaG`})]}),(0,Z.jsxs)(nc,{children:[(0,Z.jsx)(_c,{disabled:!a,onSelect:()=>{a&&(H(),fJ(ea(a.contentDir,wu(n),a.pathSeparator),`full`))},children:(0,Z.jsx)(J,{id:`oQA-cA`})}),(0,Z.jsx)(_c,{onSelect:()=>{H(),fJ(wu(n),`relative`)},children:(0,Z.jsx)(J,{id:`s061i4`})})]})]}),(0,Z.jsx)(Ac,{}),v?null:(0,Z.jsxs)(_c,{disabled:i,onSelect:()=>{H(),p(x)},children:[(0,Z.jsx)(Co,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`euc6Ns`})]}),(0,Z.jsxs)(_c,{disabled:i,onSelect:()=>{B(),s.startRenaming(n.path)},children:[(0,Z.jsx)(Do,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`2wxgft`})]}),C?(0,Z.jsxs)(_c,{"data-testid":`file-tree-menu-hide`,disabled:!w,onSelect:()=>{if(!c)return;H();let e=XK(C),t=io(c.current()),n=ho(t,e);if(n===t)return;c.patch(Ka(n));let r=C.path.split(`/`).pop()||C.path;hs.success(b({id:`OD0FCX`,values:{basename:r}}),{description:b({id:`nWv1ja`}),duration:5e3})},children:[(0,Z.jsx)(Ve,{"aria-hidden":`true`}),E]}):null,(0,Z.jsxs)(_c,{variant:`destructive`,disabled:i,onSelect:()=>{H(),m(P)},children:[(0,Z.jsx)(To,{"aria-hidden":`true`}),I]})]})}),t[34]=b,t[35]=i,t[36]=w,t[37]=O,t[38]=H,t[39]=B,t[40]=I,t[41]=P,t[42]=j,t[43]=oe,t[44]=o,t[45]=R,t[46]=E,t[47]=v,t[48]=S,t[49]=n,t[50]=s,t[51]=c,t[52]=C,t[53]=g,t[54]=f,t[55]=m,t[56]=p,t[57]=h,t[58]=d,t[59]=ie,t[60]=D,t[61]=q,t[62]=le,t[63]=x,t[64]=a,t[65]=fe):fe=t[65];let pe;return t[66]!==ue||t[67]!==fe?(pe=(0,Z.jsxs)(Tc,{open:!0,modal:!1,onOpenChange:ue,children:[de,fe]}),t[66]=ue,t[67]=fe,t[68]=pe):pe=t[68],pe}function BJ(e){return console.log(e)}function VJ(e){return hs.error(e)}function HJ(e){return hs.success(e)}async function UJ(e,t,n,r){try{let i=await fetch(`/api/documents?showAll=true&dir=${encodeURIComponent(e)}&depth=1`,{signal:t,headers:Rq});if(zq(i)){let e=await Hq(i);return{kind:`entries`,entries:ol(e.entries),truncated:e.truncated}}let a=await ht(i,n);if(!a.ok)return{kind:`http-error`,title:a.title};let o=Bn.safeParse(a.body);return o.success?{kind:`entries`,entries:ol(o.data.documents),truncated:o.data.truncated===!0}:{kind:`http-error`,title:r}}catch(e){return e instanceof Bq?{kind:`http-error`,title:e.message}:{kind:`network-error`,cause:e}}}function WJ(e){let t=(0,$.c)(356),{ref:n,onContentHeightChange:r}=e,{_:i,i18n:a}=$t(),{activeDocName:o,activeTarget:s,closeTabs:c,closeDocument:l,closeAndClearForRename:u,getPoolActiveDocName:d,poolHas:f,isNewTabActive:p,openTarget:m,prewarm:h,remapTabsForRename:g}=mt(),{notifySidebarFileSelected:_}=xj(),{resolvedTheme:y}=Mn(),{addPage:b,pageMeta:x}=Yi(),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]!==C||t[3]!==_||t[4]!==m?(w=function(e,t){m(C(e,t),{tabBehavior:`replace-active`}),tl(fl(e)),_()},t[2]=C,t[3]=_,t[4]=m,t[5]=w):w=t[5];let T=w,E;t[6]!==_||t[7]!==m?(E=function(e){let t=el(e);m({kind:`folder`,target:e,folderPath:e},{tabBehavior:`replace-active`}),tl(t),_()},t[6]=_,t[7]=m,t[8]=E):E=t[8];let D=E,O;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(O=[],t[9]=O):O=t[9];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=oN(),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}=Ra(),[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[10]===Symbol.for(`react.memo_cache_sentinel`)?(ce=new Set,t[10]=ce):ce=t[10];let le=(0,Q.useRef)(ce),q=(0,Q.useRef)(k),ue=(0,Q.useRef)(x),de;t[11]!==k||t[12]!==D||t[13]!==T||t[14]!==_||t[15]!==m?(de=function(e,t){let n=t===void 0?k:t,r=dq(e,n);if(r.kind===`none`){console.debug(`[FileTree] Dropped selection for unknown docName:`,vu(e));return}if(r.kind===`asset`){m({kind:`asset`,target:r.path,assetPath:r.path,mediaKind:r.mediaKind},{tabBehavior:`replace-active`}),tl(r.hash),_();return}if(r.kind===`folder`){D(r.path);return}let i=n.find(e=>Xc(e)&&e.docName===r.path);T(r.path,i?.size)},t[11]=k,t[12]=D,t[13]=T,t[14]=_,t[15]=m,t[16]=de):de=t[16];let fe=de,pe;t[17]!==_||t[18]!==m?(pe=function(e,t){m({kind:`asset`,target:e,assetPath:e,mediaKind:(t??q.current).find(t=>Qc(t)&&t.path===e)?.mediaKind??null},{tabBehavior:`replace-active`}),tl(ul(e)),_()},t[17]=_,t[18]=m,t[19]=pe):pe=t[19];let me=pe,he=(0,Q.useRef)(o),ge;t[20]===k?ge=t[21]:(ge=new Set(k.filter(Qc).map(_Y)),t[20]=k,t[21]=ge);let _e=ge,ve=(0,Q.useRef)(_e),ye;t[22]===Symbol.for(`react.memo_cache_sentinel`)?(ye=[],t[22]=ye):ye=t[22];let be=(0,Q.useRef)(ye),xe=(0,Q.useRef)(null),Se=(0,Q.useRef)(gY),Ce=(0,Q.useRef)(null),we=(0,Q.useRef)(null),Te=(0,Q.useRef)(!1),Ee=(0,Q.useRef)(!1),De=(0,Q.useRef)(null),Oe;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(Oe={row:null,root:null},t[23]=Oe):Oe=t[23];let ke=(0,Q.useRef)(Oe),je=(0,Q.useRef)(hY),Me=(0,Q.useRef)(null),Ne;t[24]===Symbol.for(`react.memo_cache_sentinel`)?(Ne=new Map,t[24]=Ne):Ne=t[24];let Pe=(0,Q.useRef)(Ne),Fe;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(Fe=new Set,t[25]=Fe):Fe=t[25];let Ie=(0,Q.useRef)(Fe),Le;t[26]===Symbol.for(`react.memo_cache_sentinel`)?(Le=new Map,t[26]=Le):Le=t[26];let Re=(0,Q.useRef)(Le),ze=(0,Q.useRef)(0),Be;t[27]===Symbol.for(`react.memo_cache_sentinel`)?(Be=new Set,t[27]=Be):Be=t[27];let Ve=(0,Q.useRef)(Be),He=(0,Q.useRef)(mY),Ue=(0,Q.useRef)(pY),We=(0,Q.useRef)(!1),Ge=(0,Q.useRef)(null),Ke=(0,Q.useRef)(null),qe=(0,Q.useRef)(fY),Je=(0,Q.useRef)(dY),Ye=(0,Q.useRef)(uY),Xe=(0,Q.useRef)(lY),Ze=(0,Q.useRef)(s),[Qe,$e]=(0,Q.useState)(!1),et;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(et=function(){R.current!==null&&(clearTimeout(R.current),R.current=null)},t[28]=et):et=t[28];let tt=et,nt;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(nt=function(){tt(),I(!1)},t[29]=nt):nt=t[29];let rt=nt,it;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(it=function(e){rt(),P(e)},t[30]=it):it=t[30];let at=it,ot;t[31]===i?ot=t[32]:(ot=function(){if(tt(),nN()){P(null),I(!0),R.current=setTimeout(()=>{R.current=null,Ge.current?.()},TJ);return}I(!1),P(i({id:`34qyH5`}))},t[31]=i,t[32]=ot);let st=ot,ct=(0,Q.useRef)(!0),lt;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(lt=()=>{if(ct.current){ct.current=!1;return}Ge.current?.()},t[33]=lt):lt=t[33];let ut;t[34]===L?ut=t[35]:(ut=[L],t[34]=L,t[35]=ut),(0,Q.useEffect)(lt,ut);let dt,ft;t[36]===Symbol.for(`react.memo_cache_sentinel`)?(dt=()=>tt,ft=[],t[36]=dt,t[37]=ft):(dt=t[36],ft=t[37]),(0,Q.useEffect)(dt,ft);let pt,gt;t[38]!==k.length||t[39]!==j?(pt=()=>{if(j||k.length===0)return;let e=Ke.current?.querySelector(SL)?.shadowRoot;if(!e)return;let t=e,n=function(){De.current!==null&&clearTimeout(De.current),De.current=setTimeout(()=>{Ee.current=!1,De.current=null},0)},r=function(e){if(!(e instanceof DragEvent))return;let t=yY(e),n=t?.dataset.itemPath;if(!n)return;let r=gq(t.dataset.itemType===`folder`?Ru(n):n,q.current,ue.current);r&&(De.current!==null&&(clearTimeout(De.current),De.current=null),Ee.current=!0,e.dataTransfer?.setData(bu,Nu(r)))},i=function(e){if(!(e instanceof DragEvent)||!Fu(e))return;let t=xY(e);if(!t){uJ(ke);return}e.preventDefault(),e.stopPropagation(),e.dataTransfer&&(e.dataTransfer.dropEffect=`copy`),dJ(ke,t)},a=function(e){if(!(e instanceof DragEvent)||!Fu(e))return;let n=e.relatedTarget;n instanceof Node&&t.contains(n)||uJ(ke)},o=function(e){if(!(e instanceof DragEvent)||!Fu(e))return;let t=xY(e),n=ku(e);if(!t||n.length===0){uJ(ke);return}e.preventDefault(),e.stopPropagation(),uJ(ke),je.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),uJ(ke),De.current!==null&&(clearTimeout(De.current),De.current=null),Ee.current=!1}},gt=[k.length,j],t[38]=k.length,t[39]=j,t[40]=pt,t[41]=gt):(pt=t[40],gt=t[41]),(0,Q.useEffect)(pt,gt);let{selectedFilePath:_t,selectedFolderPath:vt,navigationPath:yt}=uq(s,p?null:o),bt=_t?Bu(_t,k.find(e=>Xc(e)&&e.docName===_t)?.docExt):vt?Ru(vt):s?.kind===`asset`?s.assetPath:null,xt=ae?null:bt,St=pa().states,{dispatch:Ct}=xa(),wt;t[42]!==Ct||t[43]!==St?(wt={installStates:St,isElectronHost:typeof window<`u`&&window.okDesktop!=null,dispatch:Ct},t[42]=Ct,t[43]=St,t[44]=wt):wt=t[44];let Tt=wt,{okignoreBinding:Et,projectLocalBinding:Dt,merged:kt}=Po(),At=kt?.appearance?.sidebar?.showHiddenFiles??!1,jt;t[45]===Symbol.for(`react.memo_cache_sentinel`)?(jt=()=>Me.current===null,t[45]=jt):jt=t[45];let Mt=jt,Nt;t[46]===Symbol.for(`react.memo_cache_sentinel`)?(Nt=[],t[46]=Nt):Nt=t[46];let Pt;t[47]===Symbol.for(`react.memo_cache_sentinel`)?(Pt={set:`complete`,spriteSheet:bJ,byFileExtension:{md:{name:gJ,viewBox:Ae},mdx:{name:gJ,viewBox:Ae}}},t[47]=Pt):Pt=t[47];let Ft;t[48]===Symbol.for(`react.memo_cache_sentinel`)?(Ft={contextMenu:{enabled:!0,triggerMode:`both`,buttonVisibility:`when-needed`}},t[48]=Ft):Ft=t[48];let It;t[49]===Symbol.for(`react.memo_cache_sentinel`)?(It={canDrag:Mt,canDrop:Mt,onDropComplete:e=>Xe.current(e),onDropError:cY},t[49]=It):It=t[49];let Lt,Rt;t[50]===Symbol.for(`react.memo_cache_sentinel`)?(Lt={canRename:Mt,onRename:e=>Je.current(e),onError:e=>Ye.current(e)},Rt=e=>qe.current(e),t[50]=Lt,t[51]=Rt):(Lt=t[50],Rt=t[51]);let zt;t[52]===i?zt=t[53]:(zt={paths:Nt,initialExpansion:`closed`,fileTreeSearchMode:`hide-non-matches`,initialVisibleRowCount:18,stickyFolders:!0,...AK,icons:Pt,unsafeCSS:OJ,composition:Ft,dragAndDrop:It,renaming:Lt,onSelectionChange:Rt,renderRowDecoration:e=>{let{item:t}=e;if(t.kind===`file`){let e=q.current.find(e=>Xc(e)&&Bu(e.docName,e.docExt)===t.path);if(e?.isSymlink){let t=e.targetPath;return{icon:mJ,title:i(t?{id:`JE21eh`,values:{targetPath:t}}:{id:`BQu9Pg`})}}return kJ(t.path)?{icon:hJ,title:i({id:`i9toLO`})}:null}let n=q.current.find(e=>Yc(e)&&Ru(e.path)===Ru(t.path));if(n?.isSymlink){let e=n.targetPath;return{icon:mJ,title:i(e?{id:`JE21eh`,values:{targetPath:e}}:{id:`BQu9Pg`})}}return null}},t[52]=i,t[53]=zt);let{model:Bt}=kK(zt),Vt;t[54]===Bt?Vt=t[55]:(Vt=function(e){let t=Bt.getItem(e)??Bt.getItem(Ru(e));return t?.isDirectory()?Ru(Ku(t.getPath())):e},t[54]=Bt,t[55]=Vt);let Ht=Vt,Ut,Wt;t[56]===k?(Ut=t[57],Wt=t[58]):(Wt=Du(k),Ut=Su(Wt),t[56]=k,t[57]=Ut,t[58]=Wt);let Gt=Ut,qt=(0,Q.useRef)(Wt),Jt;t[59]===k?Jt=t[60]:(Jt=Iu(k),t[59]=k,t[60]=Jt);let Xt=Jt,Zt=(0,Q.useRef)(Xt),Qt=vt?zu(Ru(vt)).slice(0,-1):zu(xt??yt),en=Qt.join(`\0`),tn;t[61]===Bt?tn=t[62]:(tn=()=>{let e=new Set;for(let t of Zt.current)Tq(Bt.getItem(t))?.isExpanded()&&e.add(t);return e},t[61]=Bt,t[62]=tn);let nn=tn,rn;t[63]===nn?rn=t[64]:(rn=e=>{let t=new Set(Iu(e??q.current)),n=nn();for(let e of be.current)n.add(e);return[...n].filter(e=>t.has(e))},t[63]=nn,t[64]=rn);let an=rn,on;t[65]!==an||t[66]!==Bt?(on=e=>{let t=Du(e??q.current);Bt.resetPaths(t,{initialExpandedPaths:an(e)})},t[65]=an,t[66]=Bt,t[67]=on):on=t[67];let sn=on,cn;t[68]!==i||t[69]!==st?(cn=async function(e){let t=ze.current,n=new AbortController;Re.current.set(e,n);let r=await UJ(Ku(e),n.signal,i({id:`8RtNI0`}),i({id:`HlmZBk`}));if(Re.current.get(e)===n&&Re.current.delete(e),n.signal.aborted||t!==ze.current)return;if(r.kind===`network-error`){st(),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),at(r.title);return}let a=We.current,o=gl(r.entries,a);Ie.current.add(e),A(t=>Gq(t,e,o,Pe.current)),P(null),rt(),r.truncated&&B(r.entries.length)},t[68]=i,t[69]=st,t[70]=cn):cn=t[70];let ln=cn,un;t[71]!==nn||t[72]!==ln?(un=()=>{let e=nn(),t=Ve.current;Ve.current=e;for(let n of e){if(t.has(n)||Ie.current.has(n)||Re.current.has(n))continue;let e=Ku(n);q.current.find(t=>Yc(t)&&t.path===e)?.hasChildren!==!1&&ln(n)}},t[71]=nn,t[72]=ln,t[73]=un):un=t[73];let dn=un,fn;t[74]!==nn||t[75]!==ln?(fn=()=>{for(let e of nn())Ie.current.has(e)||Re.current.has(e)||ln(e)},t[74]=nn,t[75]=ln,t[76]=fn):fn=t[76];let pn=fn,mn;t[77]!==Bt||t[78]!==sn?(mn=(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=>Xc(e)&&e.docName===r);if(n==null||Bt.getItem(i)==null)continue;let s=Bu(i,t.find(e=>Xc(e)&&e.docName===i)?.docExt??n.docExt);Bt.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);Bt.getItem(n)!=null&&(Bt.getItem(e)??Bt.move(n,e),o=e,a+=1)}a!==0&&(sn(t),o!=null&&Bt.focusPath(o))},t[77]=Bt,t[78]=sn,t[79]=mn):mn=t[79];let hn=mn,gn;t[80]===Symbol.for(`react.memo_cache_sentinel`)?(gn=e=>{Ce.current=Pu(e)},t[80]=gn):gn=t[80];let _n=gn,vn;t[81]===Symbol.for(`react.memo_cache_sentinel`)?(vn=e=>ve.current.has(e),t[81]=vn):vn=t[81];let yn=vn,bn;t[82]!==i||t[83]!==b||t[84]!==D||t[85]!==T||t[86]!==sn?(bn=async function(e){if(e.kind===`asset`||Me.current!==null)return;let t=()=>{H(null),Me.current=null};Me.current=e.path,H(e.path),P(null);try{let n=await ht(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){hs.error(n.title),sn(),t();return}let r=Ot(er,n.body,`duplicate-path`,null);if(r===null){let e=i({id:`67f-3g`});hs.error(e),P(e),bl([`files`,`backlinks`,`graph`]),sn(),t();return}for(let e of r.duplicatedDocNames)b(e);A(t=>{let n=MN(t,e,r);return sn(n),_n(n),n}),bl([`files`,`backlinks`,`graph`]),r.path!==e.path&&(r.kind===`folder`?D(r.path):T(r.path)),hs.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),hs.error(i({id:`EBVbtP`}),{description:r}),sn(),t()}},t[82]=i,t[83]=b,t[84]=D,t[85]=T,t[86]=sn,t[87]=bn):bn=t[87];let xn=bn,Sn=(0,Q.useRef)(xn),Cn;t[88]===xn?Cn=t[89]:(Cn=()=>{Sn.current=xn},t[88]=xn,t[89]=Cn),(0,Q.useEffect)(Cn);let wn=function(e){let t=sJ(e);if(!t||cJ(t))return!1;let n=Bt.getFocusedPath()??Bt.getSelectedPaths()[0]??null;if(!n||n.endsWith(`/`)||yn(n))return!1;let r=cJ(n);if(!r)return!1;let i=Ru(t);if(!Zt.current.includes(i))return!1;let a=`${t}${r}`;return qt.current.includes(a)?!1:(cr({sourcePath:n,destinationPath:a,isFolder:!1}),Bt.move(n,a),!0)},Tn;t[90]===Symbol.for(`react.memo_cache_sentinel`)?(Tn=e=>{let t=e??xe.current;!t||xe.current!==t||(t.disposeCommitListener(),xe.current=null)},t[90]=Tn):Tn=t[90];let En=Tn,Dn;t[91]!==i||t[92]!==En||t[93]!==l||t[94]!==c||t[95]!==sn?(Dn=async function(e,t){let n=t===void 0?{}:t,r=n.updateUi??!0,a=n.restoreLocation??r;En(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 ht(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?hs.error(c):console.warn(`[FileTree] cleanup pending create failed: ${c}`),r&&(H(null),sn());return}}catch(t){if(console.warn(`[FileTree] cleanup pending create failed:`,t),r){let t=e.kind,n=e.createdPath;hs.error(i({id:`_TDESN`,values:{kind:t,createdPath:n}}))}r&&(H(null),sn());return}r&&(e.kind===`file`?l(e.createdPath):c([Yt(e.createdPath)],{force:!0})),r&&A(t=>{let n=AN(t,e.kind===`file`?[e.createdPath]:[],e.kind===`folder`?e.createdPath:void 0);return _n(n),n}),bl([`files`,`backlinks`,`graph`]),a&&(window.location.hash=e.previousHash),r&&H(null)},t[91]=i,t[92]=En,t[93]=l,t[94]=c,t[95]=sn,t[96]=Dn):Dn=t[96];let On=Dn,kn,An;t[97]===Symbol.for(`react.memo_cache_sentinel`)?(kn=()=>()=>{let e=xe.current;e&&Se.current(e,{restoreLocation:!1,updateUi:!1}).catch(sY)},An=[],t[97]=kn,t[98]=An):(kn=t[97],An=t[98]),(0,Q.useEffect)(kn,An);let jn;t[99]!==i||t[100]!==st?(jn=()=>{let e=!0,t=null,n=Lq(async function(){t?.abort();let n=new AbortController;t=n,ze.current+=1;for(let e of Re.current.values())e.abort();Re.current.clear(),Ie.current.clear();try{let t=await fetch(`/api/documents?showAll=true&dir=&depth=1`,{signal:n.signal,headers:Rq});if(zq(t)){let r=We.current,i=!1,{entries:a,truncated:o}=await Hq(t,{onBatch:t=>{if(!e||n.signal.aborted)return;let a=gl(ol(t),r);a.length!==0&&(A(e=>Wq(e,a)),i||(i=!0,P(null),rt(),M(!1)))}});if(!e)return;let s=gl(ol(a),r);A(e=>Gq(e,``,s,Pe.current)),P(null),rt(),B(o?a.length:null),Ue.current()}else{let n=await ht(t,i({id:`8RtNI0`}));if(!e)return;if(!n.ok)at(n.title),B(null);else{let e=Bn.safeParse(n.body);if(!e.success)at(i({id:`HlmZBk`})),B(null);else{let t=We.current,n=gl(ol(e.data.documents),t);A(e=>Gq(e,``,n,Pe.current)),P(null),rt(),B(e.data.truncated===!0?e.data.documents.length:null),Ue.current()}}}}catch(t){let r=t;if(n.signal.aborted)return;e&&(r instanceof Bq?at(r.message):st()),console.warn(`[FileTree] fetch failed:`,r)}e&&M(!1)},()=>t?.abort());Ge.current=()=>n.request(),n.request();let r=()=>{document.visibilityState===`visible`&&n.request()};window.addEventListener(`focus`,r),window.addEventListener(`visibilitychange`,r);let a=xl(e=>{e.includes(`files`)&&n.request()});return()=>{e=!1,Ge.current=null,n.dispose();for(let e of Re.current.values())e.abort();Re.current.clear(),window.removeEventListener(`focus`,r),window.removeEventListener(`visibilitychange`,r),a()}},t[99]=i,t[100]=st,t[101]=jn):jn=t[101];let Nn;t[102]===i?Nn=t[103]:(Nn=[i],t[102]=i,t[103]=Nn),(0,Q.useEffect)(jn,Nn);let Pn=(0,Q.useRef)(!0),Fn;t[104]===Symbol.for(`react.memo_cache_sentinel`)?(Fn=()=>{if(Pn.current){Pn.current=!1;return}Ge.current?.()},t[104]=Fn):Fn=t[104];let In;t[105]===At?In=t[106]:(In=[At],t[105]=At,t[106]=In),(0,Q.useEffect)(Fn,In);let Ln,Rn;t[107]===Symbol.for(`react.memo_cache_sentinel`)?(Ln=()=>{let e=!0;return fetch(`/api/workspace`).then(async t=>{let n=await t.json();if(!e||!t.ok)return;let r=Ot(zr,n,`workspace`,null);r&&ie({contentDir:r.contentDir,pathSeparator:r.pathSeparator})}).catch(oY),()=>{e=!1}},Rn=[],t[107]=Ln,t[108]=Rn):(Ln=t[107],Rn=t[108]),(0,Q.useEffect)(Ln,Rn);let zn;t[109]!==an||t[110]!==Bt||t[111]!==Gt?(zn=()=>{if(Ce.current===Gt){Ce.current=null;return}Bt.resetPaths(qt.current,{initialExpandedPaths:an()})},t[109]=an,t[110]=Bt,t[111]=Gt,t[112]=zn):zn=t[112];let Hn;t[113]!==Bt||t[114]!==Gt?(Hn=[Bt,Gt],t[113]=Bt,t[114]=Gt,t[115]=Hn):Hn=t[115],(0,Q.useEffect)(zn,Hn),Dq(Bt,xt,en,Te,Gt);let Un,Wn;t[116]!==Bt||t[117]!==r?(Un=()=>{if(!r)return;let e=0,t=0,n=()=>Ke.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=Bt.subscribe(a);return window.addEventListener(`resize`,a),()=>{cancelAnimationFrame(e),cancelAnimationFrame(t),o.disconnect(),c(),window.removeEventListener(`resize`,a)}},Wn=[r,Bt],t[116]=Bt,t[117]=r,t[118]=Un,t[119]=Wn):(Un=t[118],Wn=t[119]),(0,Q.useEffect)(Un,Wn);let Gn;t[120]===Symbol.for(`react.memo_cache_sentinel`)?(Gn=()=>{oe(!1)},t[120]=Gn):Gn=t[120];let Kn;t[121]===bt?Kn=t[122]:(Kn=[bt],t[121]=bt,t[122]=Kn),(0,Q.useEffect)(Gn,Kn);let qn,Jn;t[123]===ae?(qn=t[124],Jn=t[125]):(qn=()=>{se.current=ae;for(let e of le.current)e()},Jn=[ae],t[123]=ae,t[124]=qn,t[125]=Jn),(0,Q.useEffect)(qn,Jn);let Yn;t[126]!==xt||t[127]!==j||t[128]!==Bt?(Yn=()=>{j||!xt||cq(Bt)},t[126]=xt,t[127]=j,t[128]=Bt,t[129]=Yn):Yn=t[129];let Xn;t[130]!==en||t[131]!==xt||t[132]!==j||t[133]!==Bt||t[134]!==Gt?(Xn=[xt,en,Gt,j,Bt],t[130]=en,t[131]=xt,t[132]=j,t[133]=Bt,t[134]=Gt,t[135]=Xn):Xn=t[135],(0,Q.useEffect)(Yn,Xn);let Zn,Qn;t[136]===Bt?(Zn=t[137],Qn=t[138]):(Zn=()=>Bt.subscribe(()=>{if(!Bt.isSearchOpen())for(let e of be.current){let t=Tq(Bt.getItem(e));t&&!t.isExpanded()&&t.expand()}}),Qn=[Bt],t[136]=Bt,t[137]=Zn,t[138]=Qn),(0,Q.useEffect)(Zn,Qn);let $n,nr;t[139]===Bt?($n=t[140],nr=t[141]):($n=()=>Bt.subscribe(()=>He.current()),nr=[Bt],t[139]=Bt,t[140]=$n,t[141]=nr),(0,Q.useEffect)($n,nr);let rr,ir;t[142]===Bt?(rr=t[143],ir=t[144]):(rr=()=>Bt.onMutation(`remove`,e=>{let t=xe.current;!t||e.path!==t.renamePath||Se.current(t)}),ir=[Bt],t[142]=Bt,t[143]=rr,t[144]=ir),(0,Q.useEffect)(rr,ir);let ar;t[145]!==b||t[146]!==u||t[147]!==d||t[148]!==me||t[149]!==D||t[150]!==T||t[151]!==f||t[152]!==hn||t[153]!==g?(ar=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??he.current,l=new Map,p=new Map;for(let e of q.current){if(Xc(e)){let t=o.find(t=>t.fromPath===Bu(e.docName,e.docExt))?.toPath;t&&l.set(e.docName,t);continue}if(Qc(e)){let t=o.find(t=>t.fromPath===e.path)?.toPath;t&&Gc(t)&&p.set(e.path,Eu(t))}}let m=c?l.get(c)??null:null,h=r?.folderPath??(Ze.current?.kind===`folder`?Ze.current.folderPath:null),_=h?Kt(h,a):null,y=r?.assetPath??(Ze.current?.kind===`asset`?Ze.current.assetPath:null),x=y?p.get(y)??null:null,S=m?null:x??NN(c,e),C=m??(y?x?null:o.find(e=>e.fromPath===y)?.toPath??Kt(y,a):null);v(e);let w=[...PN(e,d(),f),...l.keys()];await Promise.all(w.map(e=>u(e)));for(let t of e)b(t.toDocName);for(let e of p.values())b(e);g(e,a,o);let E=null;A(t=>{let n=kN(t,e,a,o,s);return E=n,hn(t,n,e,o),_n(n),n}),h&&_&&_!==h?D(_):S&&S!==c?(T(S),lJ(S)):C&&(m||C!==y)&&me(C,E??q.current),bl([`files`,`backlinks`,`graph`])},t[145]=b,t[146]=u,t[147]=d,t[148]=me,t[149]=D,t[150]=T,t[151]=f,t[152]=hn,t[153]=g,t[154]=ar):ar=t[154];let sr=ar;async function cr(e){let t=!e.isFolder&&yn(e.sourcePath),n=t?e.sourcePath:ju(e.sourcePath,e.isFolder);H(n),P(null);try{let r=Kc(e.sourcePath,e.destinationPath,e.isFolder),a=!e.isFolder&&!t&&!Gc(r.destinationPath),o=t||a?r.destinationPath:ju(r.destinationPath,e.isFolder),s=e.isFolder?{kind:`folder`,fromPath:Ku(n),toPath:Ku(o)}:t||a?{kind:`asset`,fromPath:n,toPath:o}:{kind:`file`,fromPath:Eu(n),toPath:o},c={docName:he.current,folderPath:Ze.current?.kind===`folder`?Ze.current.folderPath:null,assetPath:Ze.current?.kind===`asset`?Ze.current.assetPath:null},l=await ht(await fetch(`/api/rename-path`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(s)}),i({id:`gijbne`}));if(!l.ok){hs.error(l.title),sn();let e=xe.current;e&&e.renamePath===n?await On(e):En(),H(null);return}let u=Ot(Dr,l.body,`rename-path`,{renamed:[],renamedAssets:[]});try{await sr(u.renamed,e.isFolder?[{fromPath:Ku(n),toPath:Ku(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}),hs.error(i({id:`dDpCOp`}))}En(),H(null)}catch(e){console.warn(`[FileTree] rename failed:`,e);let t=i({id:`HIb0vl`});hs.error(t),P(t),sn();let r=xe.current;r&&r.renamePath===n?await On(r):En(),H(null)}}let lr;t[155]!==i||t[156]!==sr||t[157]!==sn?(lr=async function(e){let t=e.draggedPaths.map(t=>{let n=Mu(t,e.target);return t===n?null:{sourcePath:t,destinationTreePath:n}}).filter(aY);if(t.length!==0){H(t[0]?.sourcePath??null),P(null);try{let e=[],n=[],r=[],a={docName:he.current,folderPath:Ze.current?.kind===`folder`?Ze.current.folderPath:null,assetPath:Ze.current?.kind===`asset`?Ze.current.assetPath:null};for(let a of t){let t=a.sourcePath.endsWith(`/`),o=!t&&yn(a.sourcePath),s=t?{kind:`folder`,fromPath:Ku(a.sourcePath),toPath:Ku(a.destinationTreePath)}:o?{kind:`asset`,fromPath:a.sourcePath,toPath:a.destinationTreePath}:{kind:`file`,fromPath:Eu(a.sourcePath),toPath:Eu(a.destinationTreePath)},c=await ht(await fetch(`/api/rename-path`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(s)}),i({id:`dOHMA0`}));if(!c.ok){hs.error(c.title),sn(),H(null);return}let l=Ot(Dr,c.body,`rename-path:drop`,{renamed:[],renamedAssets:[]});e=e.concat(l.renamed),n=n.concat(l.renamedAssets),t&&r.push({fromPath:Ku(a.sourcePath),toPath:Ku(a.destinationTreePath)})}try{await sr(e,r,n,a)}catch(r){console.warn(`[FileTree] post-move reconciliation failed`,{err:r,operationCount:t.length,renamedCount:e.length,renamedAssetCount:n.length}),hs.error(i({id:`8OxKZy`}))}H(null)}catch(e){console.warn(`[FileTree] move failed:`,e),hs.error(i({id:`HIb0vl`})),sn(),H(null)}}},t[155]=i,t[156]=sr,t[157]=sn,t[158]=lr):lr=t[158];let ur=lr,dr;t[159]!==i||t[160]!==b||t[161]!==sn?(dr=async function(e,t,n){if(e.length===0||Me.current!==null)return;let r=()=>{Me.current=null,H(null)};Me.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),Vu(e,t,n.name||`upload`);try{let r=await ht(await fetch(`/api/upload`,{method:`POST`,body:e}),i({id:`4Gz2wC`}));if(!r.ok){s+=1,hs.error(r.title,{description:n.name});continue}let c=Ot(tr,r.body,`upload:drop`,null);if(c===null){s+=1,hs.error(i({id:`4Gz2wC`}),{description:n.name});continue}let l=Wu(t,c);if(c.deduped===!0){s+=1,hs.error(i({id:`4sKwf6`}),{description:l});continue}o+=1;let u=Hu(l,n);u&&a.push(u)}catch(e){let t=e;s+=1,console.warn(`[FileTree] external file upload failed:`,t),hs.error(t instanceof TypeError?i({id:`HIb0vl`}):i({id:`4Gz2wC`}),{description:n.name})}}try{if(a.length>0){for(let e of a)Xc(e)&&b(e.docName);A(e=>{let t=new Set(e.map(Ou)),n=!1,r=[...e];for(let e of a){let i=Ou(e);Pe.current.set(i,Date.now()),!t.has(i)&&(t.add(i),r.push(e),n=!0)}return n?(sn(r),_n(r),r):e})}o>0&&(bl([`files`,`backlinks`,`graph`]),Ge.current?.(),hs.success(Wc._({id:`v75Em9`,values:{uploadedCount:o}}),{description:t||i({id:`RSqaSd`})})),s>0&&P(o>0?Wc._({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),hs.error(n),P(n),r()}},t[159]=i,t[160]=b,t[161]=sn,t[162]=dr):dr=t[162];let fr=dr,pr;t[163]===Symbol.for(`react.memo_cache_sentinel`)?(pr=function(e){ne({parentDir:e})},t[163]=pr):pr=t[163];let mr=pr,hr;t[164]!==i||t[165]!==b||t[166]!==On||t[167]!==En||t[168]!==Bt||t[169]!==D||t[170]!==T||t[171]!==sn||t[172]!==Wt?(hr=async function(e,t,n){if(Me.current)return;let r=xe.current;r&&En(r);try{let r=Lu(e,t,[...Wt,...Zt.current]);H(r.renamePath),Me.current=r.renamePath;let a=window.location.hash,o;if(e===`file`){let e=Tu(`file`,r.addPath),t={path:e};n?.template&&(t.template=n.template);let a=await ht(await fetch(`/api/create-page`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(t)}),i({id:`fJgQHX`}));if(!a.ok){hs.error(a.title),H(null),Me.current=null;return}let s=Eu(e),c=Ot(or,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=>Xc(e)&&e.docName===c))return e;let t=[...e,l];return _n(t),Pe.current.set(Ou(l),Date.now()),t}),bl([`files`,`backlinks`,`graph`]),T(c)}else{let e=Ku(r.addPath),t=await ht(await fetch(`/api/create-folder`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({path:e})}),i({id:`K1ckLX`}));if(!t.ok){hs.error(t.title),H(null),Me.current=null;return}o=Ot(pi,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=>Yc(e)&&e.path===o))return e;let t=[...e,n];return _n(t),Pe.current.set(Ou(n),Date.now()),t}),bl([`files`]),D(o)}let s=!1,c=e=>{if(e.key!==`Enter`)return;let t=xe.current;!t||t.renamePath!==r.renamePath||queueMicrotask(()=>En(t))};document.addEventListener(`keydown`,c,!0),xe.current={kind:e,renamePath:r.renamePath,createdPath:o,previousHash:a,disposeCommitListener:()=>{s||(s=!0,document.removeEventListener(`keydown`,c,!0))}},H(null),Me.current=null,Bt.add(r.addPath),Bt.startRenaming(r.renamePath,{removeIfCanceled:!0})}catch(e){console.warn(`[FileTree] create placeholder failed:`,e),hs.error(i({id:`S6l5dv`}));let t=xe.current;t?await On(t):En(),H(null),Me.current=null,sn()}},t[164]=i,t[165]=b,t[166]=On,t[167]=En,t[168]=Bt,t[169]=D,t[170]=T,t[171]=sn,t[172]=Wt,t[173]=hr):hr=t[173];let gr=hr,_r;t[174]===Bt?_r=t[175]:(_r=function(e){let t=Ru(e);(0,Q.startTransition)(()=>{for(let e of Zt.current)if(e===t||e.startsWith(t)){let t=Tq(Bt.getItem(e));t&&t.expand()}})},t[174]=Bt,t[175]=_r);let vr=_r,yr;t[176]===Bt?yr=t[177]:(yr=function(e){let t=Ru(e),n=new Set(be.current);(0,Q.startTransition)(()=>{for(let e of[...Zt.current].reverse())if((e===t||e.startsWith(t))&&!n.has(e)){let t=Tq(Bt.getItem(e));t&&t.collapse()}})},t[176]=Bt,t[177]=yr);let br=yr,xr;t[178]!==fe||t[179]!==Qt||t[180]!==o||t[181]!==s||t[182]!==_e||t[183]!==V||t[184]!==On||t[185]!==dn||t[186]!==k||t[187]!==Xt||t[188]!==ur||t[189]!==cr||t[190]!==Ht||t[191]!==x||t[192]!==wn||t[193]!==pn||t[194]!==At||t[195]!==Wt||t[196]!==fr?(xr=()=>{q.current=k,ue.current=x,he.current=o,Ze.current=s,ve.current=_e,Me.current=V,We.current=At,qt.current=Wt,Zt.current=Xt,be.current=Qt,He.current=dn,Ue.current=pn,Se.current=On,je.current=(e,t,n)=>{fr(e,t,n)},qe.current=e=>{if(Te.current||Ee.current||e.length!==1)return;let t=e[0];t&&(oe(!1),fe(Ht(t),k))},Ye.current=e=>{wn(e)||hs.error(e)},Je.current=cr,Xe.current=ur},t[178]=fe,t[179]=Qt,t[180]=o,t[181]=s,t[182]=_e,t[183]=V,t[184]=On,t[185]=dn,t[186]=k,t[187]=Xt,t[188]=ur,t[189]=cr,t[190]=Ht,t[191]=x,t[192]=wn,t[193]=pn,t[194]=At,t[195]=Wt,t[196]=fr,t[197]=xr):xr=t[197],(0,Q.useLayoutEffect)(xr);let Sr,Cr;t[198]===Bt?(Sr=t[199],Cr=t[200]):(Sr=()=>{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`;if(!r&&!i||IJ(e.target))return;let a=Ke.current,o=e.target,s=document.activeElement,c=o instanceof Node&&a?.contains(o),l=s instanceof Node&&a?.contains(s);if(!c&&!l)return;if(i){let t=Bt.getFocusedPath()??Bt.getSelectedPaths()[0]??null;if(!t)return;let n=Bt.getItem(t)??Bt.getItem(Ru(t)),r=n?.isDirectory()?Ru(Ku(n.getPath())):t;if(ve.current.has(r))return;Sn.current(MJ(r,q.current)),e.preventDefault(),e.stopPropagation();return}let u=new Set([...Zt.current,...qt.current]);Te.current=!0;for(let e of u)e&&Bt.getItem(e)?.select();queueMicrotask(()=>{Te.current=!1}),e.preventDefault(),e.stopPropagation()};return document.addEventListener(`keydown`,e,!0),()=>document.removeEventListener(`keydown`,e,!0)},Cr=[Bt],t[198]=Bt,t[199]=Sr,t[200]=Cr),(0,Q.useEffect)(Sr,Cr);let wr,Tr;t[201]!==k.length||t[202]!==j?(wr=()=>{if(j||k.length===0)return;let e=Ke.current?.querySelector(SL)?.shadowRoot;if(!e)return;let t=iY,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()},Tr=[j,k.length],t[201]=k.length,t[202]=j,t[203]=wr,t[204]=Tr):(wr=t[203],Tr=t[204]),(0,Q.useEffect)(wr,Tr);let Er,Or;t[205]!==k.length||t[206]!==j?(Er=()=>{if(j||k.length===0)return;let e=Ke.current?.querySelector(SL)?.shadowRoot;if(!e)return;let t=()=>zK(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()},Or=[j,k.length],t[205]=k.length,t[206]=j,t[207]=Er,t[208]=Or):(Er=t[207],Or=t[208]),(0,Q.useEffect)(Er,Or);let kr,Ar;t[209]!==k.length||t[210]!==j?(kr=()=>{if(j||k.length===0)return;let e=Ke.current?.querySelector(SL)?.shadowRoot;if(!e)return;let t=()=>rq(e);t();let n=new MutationObserver(t);return n.observe(e,{subtree:!0,childList:!0,attributes:!0,attributeFilter:[`data-item-path`]}),()=>n.disconnect()},Ar=[j,k.length],t[209]=k.length,t[210]=j,t[211]=kr,t[212]=Ar):(kr=t[211],Ar=t[212]),(0,Q.useEffect)(kr,Ar);let jr;t[213]===Symbol.for(`react.memo_cache_sentinel`)?(jr={folderCount:0,expandedCount:0},t[213]=jr):jr=t[213];let Mr=(0,Q.useRef)(jr),Nr=(0,Q.useRef)(gr),Pr=(0,Q.useRef)(mr),Fr;t[214]===gr?Fr=t[215]:(Fr=()=>{Nr.current=gr,Pr.current=mr},t[214]=gr,t[215]=Fr),(0,Q.useEffect)(Fr);let Ir,Lr;t[216]===Bt?(Ir=t[217],Lr=t[218]):(Ir=()=>({startCreating(e,t){Nr.current(e,t)},startCreatingFromTemplate(e){Pr.current(e)},createFromTemplate(e,t){Nr.current(`file`,e,{template:t})},expandAll(){(0,Q.startTransition)(()=>{for(let e of Zt.current){let t=Tq(Bt.getItem(e));t&&t.expand()}})},collapseAll(){let e=new Set(be.current);(0,Q.startTransition)(()=>{for(let t of[...Zt.current].reverse()){if(e.has(t))continue;let n=Tq(Bt.getItem(t));n&&n.collapse()}})},getFolderState(){let e=Zt.current,t=0;for(let n of e)Tq(Bt.getItem(n))?.isExpanded()&&t++;let n=e.length,r=Mr.current;if(r.folderCount===n&&r.expandedCount===t)return r;let i={folderCount:n,expandedCount:t};return Mr.current=i,i},isCreationTargetCleared(){return se.current},clearCreationTarget(){oe(!0)},subscribe(e){le.current.add(e);let t=Bt.subscribe(e);return()=>{le.current.delete(e),t()}}}),Lr=[Bt],t[216]=Bt,t[217]=Ir,t[218]=Lr),(0,Q.useImperativeHandle)(n,Ir,Lr);let Rr;t[219]!==En||t[220]!==u||t[221]!==c||t[222]!==Bt?(Rr=async function(e,t,n){let r=LJ(e,q.current,Zt.current),i=xe.current;i&&e.some(e=>RJ(e,i))&&(i.kind===`file`?r.docNames.add(i.createdPath):r.folderPaths.add(i.createdPath),En(i));let a=new Set([...r.docNames,...t]),o=new Set([...r.folderPaths,...n]),s=new Set([...r.assetPaths,...e.filter(rY).map(nY)]);c([...[...a].map(tY),...[...o].map(eY),...[...s].map($J)],{force:!0}),await Promise.all([...a].map(e=>u(e)));for(let t of e){let e=t.kind===`folder`?Ru(t.path):t.kind===`asset`?t.path:Bu(t.path,t.docExt);Bt.getItem(e)&&Bt.remove(e,t.kind===`folder`?{recursive:!0}:void 0)}A(e=>{let t=AN(e,[...a],void 0,[...s]);for(let e of o)t=AN(t,[],e);return _n(t),t}),bl([`files`,`backlinks`,`graph`])},t[219]=En,t[220]=u,t[221]=c,t[222]=Bt,t[223]=Rr):Rr=t[223];let Br=Rr,Vr;t[224]!==i||t[225]!==Br?(Vr=async function(e){let t=[],n=[],r=[];for(let a of e){let e=a.kind;H(a.path);let o=await ht(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 Br(r,t,n),hs.error(o.title),!1;let s=Ot(ui,o.body,`delete-path`,{deletedDocNames:[]});t.push(...s.deletedDocNames),e===`folder`&&n.push(a.path),r.push(a)}return await Br(r,t,n),!0},t[224]=i,t[225]=Br,t[226]=Vr):Vr=t[226];let Hr=Vr,Ur;t[227]===Symbol.for(`react.memo_cache_sentinel`)?(Ur=async function(e,t,n){let r=[],i=[];for(let a of e){H(a.path);let e=FN(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:vq(o.reason),detail:o.detail})}return{trashed:r,failed:i}},t[227]=Ur):Ur=t[227];let Wr=Ur,Gr;t[228]===i?Gr=t[229]:(Gr=async function(e){let t=[],n=[],r=[];for(let a of e){let e=a.kind;try{let o=await ht(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=Ot(Vn,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;hs.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[228]=i,t[229]=Gr);let Kr=Gr,qr;t[230]!==i||t[231]!==ee||t[232]!==Br||t[233]!==Hr||t[234]!==Kr||t[235]!==sn||t[236]!==re?(qr=async function(e){let t=e.map(e=>jN(e,q.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(QJ),t=r.length>e.length?`, +${r.length-e.length} more`:``;hs.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 Wr(t,a,re);if(e.length>0){let t=await Kr(e);t?await Br(e,t.deletedDocNames,t.deletedFolderPaths):await Br(e,e.filter(ZJ).map(XJ),e.filter(YJ).map(JJ))}n.length>0&&K({failed:n,originalTargets:[...t]}),H(null)}else{let e=await Hr(t);H(null),e||sn()}}catch(e){let t=e,n=t instanceof Error?t.message:String(t);console.warn(`[FileTree] delete failed:`,t),hs.error(i({id:`0eHrMb`}),{description:n}),H(null),sn()}},t[230]=i,t[231]=ee,t[232]=Br,t[233]=Hr,t[234]=Kr,t[235]=sn,t[236]=re,t[237]=qr):qr=t[237];let Jr=qr,Yr;t[238]!==i||t[239]!==Hr||t[240]!==sn||t[241]!==G?(Yr=async function(){if(!G)return;let e=new Set(G.failed.map(qJ)),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 Hr(t);H(null),e||sn()}catch(e){let t=e,n=t instanceof Error?t.message:String(t);console.warn(`[FileTree] hard-delete fallback failed:`,t),hs.error(i({id:`0eHrMb`}),{description:n}),H(null),sn()}}},t[238]=i,t[239]=Hr,t[240]=sn,t[241]=G,t[242]=Yr):Yr=t[242];let Xr=Yr,Zr;t[243]!==Jr||t[244]!==G?(Zr=async function(){if(!G)return;let e=new Set(G.failed.map(KJ)),t=G.originalTargets.filter(t=>e.has(`${t.kind}:${t.path}`));K(null),await Jr(t)},t[243]=Jr,t[244]=G,t[245]=Zr):Zr=t[245];let Qr=Zr,$r=(0,Q.useRef)(Jr),ei;t[246]===Jr?ei=t[247]:(ei=()=>{$r.current=Jr},t[246]=Jr,t[247]=ei),(0,Q.useEffect)(ei);let ti,ni;t[248]===Symbol.for(`react.memo_cache_sentinel`)?(ti=()=>Mq(e=>{if(e.kind===`doc`||e.kind===`folder-index`){let t=e.docName,n=q.current.find(e=>Xc(e)&&e.docName===t);$r.current([{kind:`file`,path:t,name:t.split(`/`).pop()??t,docExt:n?.docExt}]);return}if(e.kind===`folder`){$r.current([{kind:`folder`,path:e.folderPath,name:e.folderPath.split(`/`).pop()??e.folderPath}]);return}if(e.kind===`asset`){$r.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}))}),ni=[],t[248]=ti,t[249]=ni):(ti=t[248],ni=t[249]),(0,Q.useEffect)(ti,ni);let ri,ii;t[250]===Symbol.for(`react.memo_cache_sentinel`)?(ri=()=>Iq(e=>{if(e.kind===`doc`||e.kind===`folder-index`){let t=e.docName,n=q.current.find(e=>Xc(e)&&e.docName===t);Sn.current({kind:`file`,path:t,name:t.split(`/`).pop()??t,docExt:n?.docExt});return}if(e.kind===`folder`){Sn.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}))}),ii=[],t[250]=ri,t[251]=ii):(ri=t[250],ii=t[251]),(0,Q.useEffect)(ri,ii);let ai,oi;t[252]===Bt?(ai=t[253],oi=t[254]):(ai=()=>Pq(e=>{if(e.kind===`doc`||e.kind===`folder-index`){let t=e.docName,n=Bu(t,q.current.find(e=>Xc(e)&&e.docName===t)?.docExt);Bt.startRenaming(n);return}if(e.kind===`folder`){Bt.startRenaming(e.folderPath);return}if(e.kind===`asset`){Bt.startRenaming(e.assetPath);return}console.warn(JSON.stringify({event:`file-tree-menu-action-rename-unsupported-kind`,kind:e.kind}))}),oi=[Bt],t[252]=Bt,t[253]=ai,t[254]=oi),(0,Q.useEffect)(ai,oi);let si;t[255]===Symbol.for(`react.memo_cache_sentinel`)?(si=function(){let e=we.current;e&&aJ(e),we.current=null},t[255]=si):si=t[255];let ci=si,li;t[256]===h?li=t[257]:(li=function(e){let t=vY(e.nativeEvent);if(!t||t.endsWith(`/`)){ci();return}let n=Eu(t),r=q.current.find(e=>Ou(e)===t);if(r&&Qc(r)){ci();return}if(r&&Xc(r)&&hi(r.size)){ci();return}we.current!==n&&(ci(),we.current=n,iJ(n,e=>h(e)))},t[256]=h,t[257]=li);let di=li,fi;t[258]!==fe||t[259]!==Bt||t[260]!==D?(fi=function(e){if(e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey)return;let t=yY(e.nativeEvent);if(!t){SY(e.nativeEvent)&&oe(!0);return}if(t.getAttribute(`aria-selected`)!==`true`)return;let n=t.dataset.itemPath;if(!n)return;let r=t.dataset.itemType===`folder`?Ru(n):n;if(Bt.getSelectedPaths().length!==1)return;if(t.dataset.itemType===`folder`){let e=Ku(r);if(window.location.hash===el(e))return;queueMicrotask(()=>D(e));return}let i=Eu(r);window.location.hash!==fl(i)&&queueMicrotask(()=>fe(r))},t[258]=fe,t[259]=Bt,t[260]=D,t[261]=fi):fi=t[261];let mi=fi,gi;t[262]===Symbol.for(`react.memo_cache_sentinel`)?(gi=function(e){Fu(e.nativeEvent)&&(e.preventDefault(),e.stopPropagation(),e.dataTransfer.dropEffect=`copy`,$e(!0))},t[262]=gi):gi=t[262];let _i=gi,vi;t[263]===Symbol.for(`react.memo_cache_sentinel`)?(vi=function(e){let t=e.relatedTarget;t instanceof Node&&e.currentTarget.contains(t)||$e(!1)},t[263]=vi):vi=t[263];let yi=vi,bi;t[264]===fr?bi=t[265]:(bi=function(e){if(!Fu(e.nativeEvent))return;let t=ku(e.nativeEvent);t.length!==0&&(e.preventDefault(),e.stopPropagation(),$e(!1),fr(t,``,wJ))},t[264]=fr,t[265]=bi);let xi=bi;if(j){let e;return t[266]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,Z.jsx)(wY,{}),t[266]=e):e=t[266],e}let Si;t[267]!==i||t[268]!==F||t[269]!==L?(Si=F?i(L?{id:`H-vDm3`}:{id:`09Tv5j`}):null,t[267]=i,t[268]=F,t[269]=L,t[270]=Si):Si=t[270];let Ci=Si;if(k.length===0){if(Ci!==null){let e;return t[271]===Ci?e=t[272]:(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:Ci})}),t[271]=Ci,t[272]=e),e}if(N){let e;return t[273]===N?e=t[274]:(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[273]=N,t[274]=e),e}let e;t[275]===i?e=t[276]:(e=i({id:`5ZB7XC`}),t[275]=i,t[276]=e);let n=Qe&&`bg-primary/5 ring-2 ring-primary/70 ring-inset`,r;t[277]===n?r=t[278]:(r=Y(`flex flex-1 flex-col items-center justify-center gap-3 rounded-md py-8`,n),t[277]=n,t[278]=r);let a;t[279]===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[279]=a):a=t[279];let o;t[280]===gr?o=t[281]:(o=()=>gr(`file`,``),t[280]=gr,t[281]=o);let s;t[282]===Symbol.for(`react.memo_cache_sentinel`)?(s=(0,Z.jsx)(J,{id:`6ibbCg`}),t[282]=s):s=t[282];let c;t[283]===o?c=t[284]:(c=(0,Z.jsx)(X,{variant:`link`,size:`sm`,className:`font-mono uppercase`,onClick:o,children:s}),t[283]=o,t[284]=c);let l;return t[285]!==xi||t[286]!==e||t[287]!==r||t[288]!==c?(l=(0,Z.jsxs)(`section`,{"aria-label":e,className:r,onDragOver:_i,onDragLeave:yi,onDrop:xi,children:[a,c]}),t[285]=xi,t[286]=e,t[287]=r,t[288]=c,t[289]=l):l=t[289],l}let wi=V!==null,Ti=U?.targets[0]??null,Ei=null;if(z!==null){let e;if(t[290]!==a.locale||t[291]!==z){let n=new Intl.NumberFormat(a.locale).format(z);e=Wc._({id:`LuoJWu`,values:{truncatedShownCount:z,formattedCount:n}}),t[290]=a.locale,t[291]=z,t[292]=e}else e=t[292];Ei=e}let Di;t[293]!==N||t[294]!==Ci||t[295]!==Ei?(Di=(N||Ci!==null||Ei!==null)&&(0,Z.jsxs)(Z.Fragment,{children:[Ci===null?N&&(0,Z.jsx)(EY,{kind:`error`,children:N}):(0,Z.jsx)(EY,{kind:`reconnecting`,children:Ci}),Ei!==null&&(0,Z.jsx)(EY,{kind:`info`,children:Ei})]}),t[293]=N,t[294]=Ci,t[295]=Ei,t[296]=Di):Di=t[296];let Oi;t[297]===y?Oi=t[298]:(Oi=PK(y),t[297]=y,t[298]=Oi);let ki=ae?``:void 0,Ai;t[299]===ki?Ai=t[300]:(Ai={[DJ]:ki},t[299]=ki,t[300]=Ai);let ji;t[301]!==wi||t[302]!==_e||t[303]!==br||t[304]!==k||t[305]!==vr||t[306]!==Xt||t[307]!==xn||t[308]!==Tt||t[309]!==kt||t[310]!==Bt||t[311]!==Et||t[312]!==Dt||t[313]!==gr||t[314]!==re?(ji=(e,t)=>(0,Z.jsx)(zJ,{item:e,context:t,anyActionBusy:wi,workspace:re,handoff:Tt,model:Bt,okignoreBinding:Et,projectLocalBinding:Dt,mergedConfig:kt,onStartCreating:gr,onCreateFromTemplate:(e,t)=>gr(`file`,e,{template:t}),onDuplicate:xn,onDelete:e=>W({targets:e}),onExpandSubtree:vr,onCollapseSubtree:br,folderTreePaths:Xt,isAsset:_e.has(e.path),documents:k}),t[301]=wi,t[302]=_e,t[303]=br,t[304]=k,t[305]=vr,t[306]=Xt,t[307]=xn,t[308]=Tt,t[309]=kt,t[310]=Bt,t[311]=Et,t[312]=Dt,t[313]=gr,t[314]=re,t[315]=ji):ji=t[315];let Mi;t[316]!==mi||t[317]!==di||t[318]!==Bt||t[319]!==Di||t[320]!==Oi||t[321]!==Ai||t[322]!==ji?(Mi=(0,Z.jsx)(`div`,{ref:Ke,className:`flex min-h-0 flex-1 flex-col`,children:(0,Z.jsx)(OK,{header:Di,model:Bt,style:Oi,...Ai,onClickCapture:mi,onMouseMove:di,onMouseLeave:ci,renderContextMenu:ji})}),t[316]=mi,t[317]=di,t[318]=Bt,t[319]=Di,t[320]=Oi,t[321]=Ai,t[322]=ji,t[323]=Mi):Mi=t[323];let Ni=!!U,Pi;t[324]===V?Pi=t[325]:(Pi=e=>{!e&&!V&&W(null)},t[324]=V,t[325]=Pi);let Fi;t[326]!==i||t[327]!==V||t[328]!==U||t[329]!==Jr||t[330]!==Ti?(Fi=U&&Ti&&(0,Z.jsx)(ha,{...(()=>{let e=mq(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(GJ)}):null};let t=U.targets.length,n=Ti.name;return{itemName:t===1?Ti.kind===`folder`?`${Ti.name}/`:Ti.kind===`file`?`${Ti.name}${Ti.docExt??`.md`}`:Ti.name:void 0,customTitle:t>1?i({id:`abiHje`}):void 0,customDescription:t>1?i({id:`WMIKXK`,values:{targetCount:t}}):Ti.kind===`folder`?i({id:`a5W0q0`,values:{folderName:n}}):void 0}})(),isSubmitting:V!==null,onDelete:()=>Jr(U.targets)}),t[326]=i,t[327]=V,t[328]=U,t[329]=Jr,t[330]=Ti,t[331]=Fi):Fi=t[331];let Ii;t[332]!==Ni||t[333]!==Pi||t[334]!==Fi?(Ii=(0,Z.jsx)(Ys,{open:Ni,onOpenChange:Pi,children:Fi}),t[332]=Ni,t[333]=Pi,t[334]=Fi,t[335]=Ii):Ii=t[335];let Li=!!G,Ri;t[336]===V?Ri=t[337]:(Ri=e=>{!e&&!V&&K(null)},t[336]=V,t[337]=Ri);let zi;t[338]!==V||t[339]!==Xr||t[340]!==Qr||t[341]!==G?(zi=G&&(0,Z.jsx)(Sq,{failedTargets:G.failed,isSubmitting:V!==null,onDeletePermanently:Xr,onRetry:Qr,onCancel:()=>K(null)}),t[338]=V,t[339]=Xr,t[340]=Qr,t[341]=G,t[342]=zi):zi=t[342];let Bi;t[343]!==Li||t[344]!==Ri||t[345]!==zi?(Bi=(0,Z.jsx)(Ys,{open:Li,onOpenChange:Ri,children:zi}),t[343]=Li,t[344]=Ri,t[345]=zi,t[346]=Bi):Bi=t[346];let Vi=te!==null,Hi;t[347]===Symbol.for(`react.memo_cache_sentinel`)?(Hi=e=>{e||ne(null)},t[347]=Hi):Hi=t[347];let Ui=te?.parentDir??``,Wi;t[348]!==Vi||t[349]!==Ui?(Wi=(0,Z.jsx)(dh,{open:Vi,onOpenChange:Hi,kind:`file`,initialDir:Ui,defaultToTemplate:!0}),t[348]=Vi,t[349]=Ui,t[350]=Wi):Wi=t[350];let Gi;return t[351]!==Mi||t[352]!==Ii||t[353]!==Bi||t[354]!==Wi?(Gi=(0,Z.jsxs)(Z.Fragment,{children:[Mi,Ii,Bi,Wi]}),t[351]=Mi,t[352]=Ii,t[353]=Bi,t[354]=Wi,t[355]=Gi):Gi=t[355],Gi}function GJ(e){return(0,Z.jsx)(`li`,{"data-testid":`delete-target-row`,children:hq(e)},`${e.kind}:${e.path}`)}function KJ(e){return`${e.kind}:${e.path}`}function qJ(e){return`${e.kind}:${e.path}`}function JJ(e){return e.path}function YJ(e){return e.kind===`folder`}function XJ(e){return e.path}function ZJ(e){return e.kind===`file`}function QJ(e){return e.file}function $J(e){return Je(e)}function eY(e){return Yt(e)}function tY(e){return Ee(e)}function nY(e){return e.path}function rY(e){return e.kind===`asset`}function iY(e){return e.endsWith(`/`)?e.slice(0,-1):e}function aY(e){return!!e}function oY(e){console.warn(`[FileTree] /api/workspace fetch failed:`,e)}function sY(e){console.warn(`[FileTree] unmount cleanup failed:`,e)}function cY(e){hs.error(e)}function lY(){}function uY(e){return hs.error(e)}function dY(){}function fY(){}function pY(){}function mY(){}function hY(){}async function gY(){}function _Y(e){return Ou(e)}function vY(e){return yY(e)?.dataset.itemPath??null}function yY(e){for(let t of e.composedPath())if(t instanceof HTMLElement&&t.dataset.itemPath)return t;return null}function bY(e){for(let t of e.composedPath())if(t instanceof HTMLElement&&t.matches(`[data-file-tree-virtualized-root]`))return t;return null}function xY(e){let t=yY(e);if(t){let e=t.dataset.itemPath;if(!e)return null;let n=t.dataset.itemType===`folder`,r=Au(e,n);return{parentDir:r,row:t,root:null,busyPath:n?Ru(r):e}}return SY(e)?{parentDir:``,row:null,root:bY(e),busyPath:wJ}:null}function SY(e){for(let t of e.composedPath())if(t instanceof HTMLElement&&t.matches(`[data-file-tree-virtualized-scroll]`))return!0;return!1}var CY=[`w-3/4`,`w-2/3`,`w-4/5`,`w-1/2`,`w-3/5`,`w-2/3`];function wY(){let e=(0,$.c)(5),{_:t}=$t(),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=CY.map(TY),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 TY(e,t){return(0,Z.jsxs)(`div`,{className:`flex h-6 items-center gap-2`,children:[(0,Z.jsx)(Ba,{className:`h-3 w-3 shrink-0 rounded-sm`}),(0,Z.jsx)(Ba,{className:`h-3 ${e}`})]},t)}function EY(e){let t=(0,$.c)(14),{kind:n,children:r}=e,i=n===`error`?os:n===`reconnecting`?ts:Qo,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 DY(e){return e?Wc._({id:`wTcjov`}):null}function OY(e){let t=(0,$.c)(23),{_:n}=$t(),r=da(),i=ya();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=DY(c),r;t[12]===o?r=t[13]:(r=e=>o[e.id]?.installed===!0,t[12]=o,t[13]=r);let h=ta.filter(r),g=h.length>0,_=i!==null;if(!g&&!_){m=null;break bb0}u=WN,t[14]===Symbol.for(`react.memo_cache_sentinel`)?(p=(0,Z.jsxs)(qN,{children:[(0,Z.jsx)(ns,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`O7_W_a`})]}),t[14]=p):p=t[14],l=JN,d=_?(0,Z.jsxs)(UN,{"aria-label":n({id:`ALhMYW`}),children:[(0,Z.jsx)(XN,{children:(0,Z.jsx)(J,{id:`ALhMYW`})}),va.map(t=>{let{displayName:r}=zn[t];return(0,Z.jsxs)(KN,{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)(sa,{id:oa(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)(ZN,{}):null,(0,Z.jsxs)(UN,{"aria-label":n({id:`BBqGS9`}),children:[(0,Z.jsx)(XN,{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)(KN,{disabled:!r,onSelect:()=>{a&&s(t.id,a)},"data-testid":`empty-space-open-in-${t.id}`,"aria-label":o,children:[(0,Z.jsx)(sa,{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 kY(e){try{let t=await e.project.listRecent(),n=e.config.projectPath;return t.some(e=>e.path!==n)?!1:await Xw()===0}catch(e){return console.warn(`[onboarding-card-visible] fresh-project probe failed; suppressing card`,e),!1}}function AY(e){let t=(0,$.c)(4),n=e===void 0?Kw: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 kY(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 jY(e){let t=(0,$.c)(3),n=e===void 0?Kw:e,r,i;t[0]===n?(r=t[1],i=t[2]):(r=()=>{if(n.getSnapshot().steps.file)return;let e=xl(e=>{e.includes(`files`)&&Zw(n)});return Zw(n),e},i=[n],t[0]=n,t[1]=r,t[2]=i),(0,Q.useEffect)(r,i)}var MY=3,NY=5200,PY=1500,FY=220;function IY(e){let t=(0,$.c)(14),{complete:n,label:r,shortcutId:i}=e,a;t[0]===n?a=t[1]:(a=(0,Z.jsx)(Xs,{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)(P,{children:Ol(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 LY(e){let t=(0,$.c)(24),{store:n,lingerMs:r}=e,i=n===void 0?Kw:n,a=r===void 0?NY:r,{_:o}=$t(),{steps:s}=qw(i);jY(i);let[c,l]=(0,Q.useState)(0),[u,d]=(0,Q.useState)(!1),f=1+ +!!s.file+ +!!s.askedAi,p=f===MY,m,h;t[0]!==p||t[1]!==a?(m=()=>{if(!p)return;l(zY);let e=setInterval(()=>l(RY),PY),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(),FY);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)(mS,{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} / ${MY}`})]}),(0,Z.jsxs)(`ul`,{className:`flex flex-col gap-2`,children:[(0,Z.jsx)(IY,{complete:!0,label:(0,Z.jsx)(J,{id:`4E9jPa`})}),(0,Z.jsx)(IY,{complete:s.file,label:(0,Z.jsx)(J,{id:`6ibbCg`}),shortcutId:`new-item`}),(0,Z.jsx)(IY,{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 RY(e){return e+1}function zY(e){return e+1}function BY(){let e=(0,$.c)(1);if(!AY())return null;let t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Z.jsx)(LY,{}),e[0]=t):t=e[0],t}function VY(e){return e===null?null:e.kind===`local`?e.name:e.ref}function HY(e,t){if(e.length===0)return null;let n=`origin/${e}`;return t.includes(n)?n:t.find(t=>cr(t)===e)??null}function UY(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 WY(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}=$t(),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),[O,k]=(0,Q.useState)(``),[A,j]=(0,Q.useState)(!1),[M,N]=(0,Q.useState)(null),P=(0,Q.useRef)(null),F=(0,Q.useRef)(null),I,R;t[2]!==a||t[3]!==p||t[4]!==n?(I=()=>{if(!n)return;S(p),T(a===null?null:{kind:`local`,name:a}),D(!1),k(``),j(!1),N(null);let e=requestAnimationFrame(()=>P.current?.focus());return()=>cancelAnimationFrame(e)},R=[n,a,p],t[2]=a,t[3]=p,t[4]=n,t[5]=I,t[6]=R):(I=t[5],R=t[6]),(0,Q.useEffect)(I,R);let z=x.trim(),B=!A&&z.length>0,V=z.length>0&&d.includes(z),H=V?null:HY(z,f),U=H!==null,W=V||U,G=V&&(s?.has(z)??!1),K=d.filter(e=>e.toLowerCase().startsWith(z.toLowerCase())),ee=!A&&K.length>0&&!W,te=(a!==null&&!d.includes(a)?[a,...d]:d).map(YY),ne=f.map(JY),re=VY(w),ie=O.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){j(!0),N(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){N(UY(t.reason)),j(!1);return}Qh(),r(!1),await i.project.open({path:t.path,target:`new-window`,entryPoint:`worktree`})}catch(e){console.warn(`[NewWorktreeDialog] worktree create/open failed:`,e),hs.error(m({id:`vAYoCZ`})),j(!1)}}},le=Ys,q;t[7]!==A||t[8]!==r?(q=e=>{A||r(e)},t[7]=A,t[8]=r,t[9]=q):q=t[9];let ue=Gs,de;t[10]===Symbol.for(`react.memo_cache_sentinel`)?(de=(0,Z.jsx)(Ws,{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)(Js,{children:[de,(0,Z.jsx)(Us,{children:(0,Z.jsx)(J,{id:`NEzPEh`})})]}),t[11]=fe):fe=t[11];let pe=Ks,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)(Mc,{htmlFor:g,children:me}),t[13]=g,t[14]=he);let ge;t[15]===m?ge=t[16]:(ge=m({id:`IX_uXB`}),t[15]=m,t[16]=ge);let _e;t[17]===M?_e=t[18]:(_e=e=>{S(e.target.value),M!==null&&N(null)},t[17]=M,t[18]=_e);let ve=M!==null,ye=M===null?y:`${y} ${b}`,be;t[19]!==x||t[20]!==A||t[21]!==g||t[22]!==ge||t[23]!==_e||t[24]!==ve||t[25]!==ye?(be=(0,Z.jsx)(Hc,{id:g,ref:P,value:x,placeholder:ge,onChange:_e,disabled:A,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-invalid":ve,"aria-describedby":ye,"data-testid":`new-worktree-branch`}),t[19]=x,t[20]=A,t[21]=g,t[22]=ge,t[23]=_e,t[24]=ve,t[25]=ye,t[26]=be):be=t[26];let xe=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)(Fo,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0 text-amber-600 dark:text-amber-400`}):U?(0,Z.jsx)(Qa,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0 text-violet-600 dark:text-violet-400`}):V?(0,Z.jsx)(Ui,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0 text-blue-600 dark:text-blue-400`}):(0,Z.jsx)(Zt,{"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,Se=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),M!==null&&N(null),P.current?.focus()},"data-testid":`new-worktree-branch-option-${e}`,className:`h-8 w-full justify-start gap-2 font-normal`,children:[(0,Z.jsx)(Io,{"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,Ce=W?null:(0,Z.jsxs)(`div`,{className:`mt-1 flex flex-col gap-2`,children:[(0,Z.jsx)(Mc,{id:v,htmlFor:_,children:(0,Z.jsx)(J,{id:`ZWwYwM`})}),(0,Z.jsxs)($e,{open:E,onOpenChange:e=>{D(e),e||k(``)},children:[(0,Z.jsx)(jt,{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:A,"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)(Qa,{"aria-hidden":`true`,className:`size-3.5 shrink-0 text-muted-foreground`}):(0,Z.jsx)(Io,{"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)(xd,{"aria-hidden":`true`,className:`ml-2 size-4 shrink-0 opacity-50`})]})}),(0,Z.jsxs)(yt,{align:`start`,className:`w-[var(--radix-popover-trigger-width)] p-1`,onWheel:qY,onTouchMove:KY,onOpenAutoFocus:e=>{e.preventDefault(),F.current?.focus()},children:[(0,Z.jsxs)(RC,{className:`mb-1 h-8`,children:[(0,Z.jsx)(UC,{ref:F,"aria-label":m({id:`fuJZKk`}),placeholder:m({id:`hQXiDc`}),value:O,onChange:e=>k(e.target.value),onKeyDown:GY,"data-testid":`new-worktree-base-search`}),(0,Z.jsx)(BC,{children:(0,Z.jsx)(L,{"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),k(``)},"data-testid":`new-worktree-base-option-${t}`,className:`h-8 w-full justify-start gap-2 font-normal`,children:[(0,Z.jsx)(Io,{"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),k(``)},"data-testid":`new-worktree-base-option-${t}`,className:`h-8 w-full justify-start gap-2 font-normal`,children:[(0,Z.jsx)(Qa,{"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}`)})]})]})]})]}),we;t[27]!==m||t[28]!==M||t[29]!==b?(we=M===null?null:(0,Z.jsx)(`p`,{id:b,role:`alert`,className:`text-1sm text-destructive`,"data-testid":`new-worktree-error`,children:m(M)}),t[27]=m,t[28]=M,t[29]=b,t[30]=we):we=t[30];let Te;t[31]!==h||t[32]!==ce||t[33]!==he||t[34]!==be||t[35]!==xe||t[36]!==Se||t[37]!==Ce||t[38]!==we?(Te=(0,Z.jsxs)(`form`,{id:h,onSubmit:ce,className:`flex flex-col gap-2`,children:[he,be,xe,Se,Ce,we]}),t[31]=h,t[32]=ce,t[33]=he,t[34]=be,t[35]=xe,t[36]=Se,t[37]=Ce,t[38]=we,t[39]=Te):Te=t[39];let Ee;t[40]!==pe||t[41]!==Te?(Ee=(0,Z.jsx)(pe,{children:Te}),t[40]=pe,t[41]=Te,t[42]=Ee):Ee=t[42];let De;t[43]===r?De=t[44]:(De=()=>r(!1),t[43]=r,t[44]=De);let Oe;t[45]===Symbol.for(`react.memo_cache_sentinel`)?(Oe=(0,Z.jsx)(J,{id:`dEgA5A`}),t[45]=Oe):Oe=t[45];let ke;t[46]!==A||t[47]!==De?(ke=(0,Z.jsx)(X,{type:`button`,variant:`outline`,onClick:De,disabled:A,"data-testid":`new-worktree-cancel`,children:Oe}),t[46]=A,t[47]=De,t[48]=ke):ke=t[48];let Ae=!B,je;t[49]!==A||t[50]!==G||t[51]!==V||t[52]!==U?(je=A?(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]=A,t[50]=G,t[51]=V,t[52]=U,t[53]=je):je=t[53];let Me;t[54]!==h||t[55]!==Ae||t[56]!==je?(Me=(0,Z.jsx)(X,{type:`submit`,form:h,disabled:Ae,"data-testid":`new-worktree-create`,children:je}),t[54]=h,t[55]=Ae,t[56]=je,t[57]=Me):Me=t[57];let Ne;t[58]!==ke||t[59]!==Me?(Ne=(0,Z.jsxs)(qs,{children:[ke,Me]}),t[58]=ke,t[59]=Me,t[60]=Ne):Ne=t[60];let Pe;t[61]!==ue||t[62]!==fe||t[63]!==Ee||t[64]!==Ne?(Pe=(0,Z.jsxs)(ue,{className:`sm:max-w-md`,"data-testid":`new-worktree-dialog`,children:[fe,Ee,Ne]}),t[61]=ue,t[62]=fe,t[63]=Ee,t[64]=Ne,t[65]=Pe):Pe=t[65];let Fe;return t[66]!==le||t[67]!==n||t[68]!==Pe||t[69]!==q?(Fe=(0,Z.jsx)(le,{open:n,onOpenChange:q,children:Pe}),t[66]=le,t[67]=n,t[68]=Pe,t[69]=q,t[70]=Fe):Fe=t[70],Fe}function GY(e){return e.stopPropagation()}function KY(e){e.stopPropagation()}function qY(e){e.stopPropagation()}function JY(e){return{kind:`remote`,ref:e}}function YY(e){return{kind:`local`,name:e}}function XY(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}=$t(),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),hs.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){hs.error(f({id:`teD0H9`}));return}Qh(),await n.project.open({path:t.path,target:`new-window`,entryPoint:`worktree`})}catch(e){console.warn(`[RecentProjectsMenu] create/open branch failed:`,e),hs.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)(iX,{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=dg(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)(ZY,{group:e,currentPath:i,worktreeModel:o,flyoutOpen:l===e.project.path,setFlyoutOpen:t=>u(t?e.project.path:null),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 ZY(e){let t=(0,$.c)(27),{group:n,currentPath:r,worktreeModel:i,flyoutOpen:a,setFlyoutOpen:o,onPickProject:s,onPickFlyoutEntry:c,guardStaleSelect:l,openNewWorktreeWith:u}=e,d=n.project.path===r;if(n.worktrees.length===0){let e;t[0]!==l||t[1]!==s?(e=e=>{l(e)||s()},t[0]=l,t[1]=s,t[2]=e):e=t[2];let r=`project-switcher-recent-${n.project.path}`,i=d?`true`:void 0,a;t[3]!==n.project.name||t[4]!==n.project.path||t[5]!==d?(a=(0,Z.jsx)(sX,{name:n.project.name,path:n.project.path,current:d}),t[3]=n.project.name,t[4]=n.project.path,t[5]=d,t[6]=a):a=t[6];let o;return t[7]!==e||t[8]!==r||t[9]!==i||t[10]!==a?(o=(0,Z.jsx)(_c,{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[7]=e,t[8]=r,t[9]=i,t[10]=a,t[11]=o):o=t[11],o}let f;t[12]!==r||t[13]!==n.worktrees||t[14]!==d?(f=d||n.worktrees.some(e=>e.path===r),t[12]=r,t[13]=n.worktrees,t[14]=d,t[15]=f):f=t[15];let p=f,m;return t[16]!==p||t[17]!==r||t[18]!==a||t[19]!==n||t[20]!==l||t[21]!==c||t[22]!==s||t[23]!==u||t[24]!==o||t[25]!==i?(m=(0,Z.jsx)(QY,{group:n,currentPath:r,containsCurrent:p,worktreeModel:i,flyoutOpen:a,setFlyoutOpen:o,onPickProject:s,onPickFlyoutEntry:c,guardStaleSelect:l,openNewWorktreeWith:u}),t[16]=p,t[17]=r,t[18]=a,t[19]=n,t[20]=l,t[21]=c,t[22]=s,t[23]=u,t[24]=o,t[25]=i,t[26]=m):m=t[26],m}function QY(e){let t=(0,$.c)(56),{group:n,currentPath:r,containsCurrent:i,worktreeModel:a,flyoutOpen:o,setFlyoutOpen:s,onPickProject:c,onPickFlyoutEntry:l,guardStaleSelect:u,openNewWorktreeWith:d}=e,{_:f}=$t(),p=n.project.path===r,m;t[0]!==u||t[1]!==c?(m=e=>{u(e)||c()},t[0]=u,t[1]=c,t[2]=m):m=t[2];let h;t[3]!==o||t[4]!==s?(h=e=>{e.key===`ArrowRight`?(e.preventDefault(),s(!0)):(e.key===`ArrowLeft`||e.key===`Escape`)&&o&&(e.preventDefault(),e.stopPropagation(),s(!1))},t[3]=o,t[4]=s,t[5]=h):h=t[5];let g=`project-switcher-group-${n.project.path}`,_=o?`true`:void 0,v=i?`true`:void 0,y;t[6]===n.project.name?y=t[7]:(y=(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]=y);let b;t[8]===n.project.path?b=t[9]:(b=(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]=b);let x;t[10]!==y||t[11]!==b?(x=(0,Z.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col gap-0.5`,children:[y,b]}),t[10]=y,t[11]=b,t[12]=x):x=t[12];let S;t[13]!==f||t[14]!==p?(S=p?(0,Z.jsx)(Ui,{"aria-label":f({id:`Hp1l6f`}),className:`mt-0.5 size-3.5 shrink-0 text-muted-foreground`}):null,t[13]=f,t[14]=p,t[15]=S):S=t[15];let C;t[16]!==f||t[17]!==o?(C=f(o?{id:`Aj1D9r`}:{id:`UaRsDu`}),t[16]=f,t[17]=o,t[18]=C):C=t[18];let w;t[19]===s?w=t[20]:(w=()=>{s(!0)},t[19]=s,t[20]=w);let T=`project-switcher-toggle-${n.project.path}`,E;t[21]===n.worktrees.length?E=t[22]:(E=(0,Z.jsx)(`span`,{className:`tabular-nums`,children:n.worktrees.length}),t[21]=n.worktrees.length,t[22]=E);let D;t[23]===n.worktrees.length?D=t[24]:(D=(0,Z.jsx)(J,{id:`ij5sBu`,values:{0:n.worktrees.length}}),t[23]=n.worktrees.length,t[24]=D);let O;t[25]!==E||t[26]!==D?(O=(0,Z.jsxs)(`span`,{className:`text-xs`,children:[E,` `,D]}),t[25]=E,t[26]=D,t[27]=O):O=t[27];let k;t[28]===Symbol.for(`react.memo_cache_sentinel`)?(k=(0,Z.jsx)(Ki,{"aria-hidden":`true`,className:`size-3.5`}),t[28]=k):k=t[28];let A;t[29]!==o||t[30]!==C||t[31]!==w||t[32]!==T||t[33]!==O?(A=(0,Z.jsx)(jt,{asChild:!0,children:(0,Z.jsxs)(X,{type:`button`,variant:`ghost`,size:`sm`,tabIndex:-1,"aria-label":C,"aria-expanded":o,onMouseDown:eX,onClick:$Y,onMouseEnter:w,"data-testid":T,className:`-my-1 -mr-1 h-auto shrink-0 gap-1 rounded-md px-1.5 py-1 text-muted-foreground hover:bg-accent-foreground/15 hover:text-foreground hover:ring-1 hover:ring-border hover:ring-inset`,children:[O,k]})}),t[29]=o,t[30]=C,t[31]=w,t[32]=T,t[33]=O,t[34]=A):A=t[34];let j;t[35]!==m||t[36]!==A||t[37]!==h||t[38]!==g||t[39]!==_||t[40]!==v||t[41]!==x||t[42]!==S?(j=(0,Z.jsxs)(_c,{onSelect:m,onKeyDown:h,className:`flex w-full min-w-0 items-start gap-2`,"data-testid":g,"data-flyout-open":_,"data-current":v,children:[x,S,A]}),t[35]=m,t[36]=A,t[37]=h,t[38]=g,t[39]=_,t[40]=v,t[41]=x,t[42]=S,t[43]=j):j=t[43];let M;t[44]!==r||t[45]!==n||t[46]!==u||t[47]!==l||t[48]!==d||t[49]!==a?(M=(0,Z.jsx)(tX,{group:n,currentPath:r,worktreeModel:a,onPickFlyoutEntry:l,guardStaleSelect:u,openNewWorktreeWith:d}),t[44]=r,t[45]=n,t[46]=u,t[47]=l,t[48]=d,t[49]=a,t[50]=M):M=t[50];let N;return t[51]!==o||t[52]!==s||t[53]!==j||t[54]!==M?(N=(0,Z.jsxs)($e,{open:o,onOpenChange:s,children:[j,M]}),t[51]=o,t[52]=s,t[53]=j,t[54]=M,t[55]=N):N=t[55],N}function $Y(e){e.stopPropagation()}function eX(e){e.stopPropagation()}function tX(e){let t=(0,$.c)(11),{group:n,currentPath:r,worktreeModel:i,onPickFlyoutEntry:a,guardStaleSelect:o,openNewWorktreeWith:s}=e,{_:c}=$t(),[l,u]=(0,Q.useState)(``),d=(0,Q.useRef)(null),f=(0,Q.useRef)(null),p=function(){let e=f.current;return e===null?[]:[...e.querySelectorAll(`[role="menuitem"]`)]},m=function(e){p()[e]?.focus()},h=function(e,t){if(e.key===`ArrowDown`){e.preventDefault();let t=p(),n=t.indexOf(e.currentTarget);m(Math.min(n+1,t.length-1))}else if(e.key===`ArrowUp`){e.preventDefault();let t=p().indexOf(e.currentTarget);t<=0?d.current?.focus():m(t-1)}else e.key===`Enter`&&(e.preventDefault(),t())},g=cg(n,i,r),_=l.trim().toLowerCase(),v=_===``?g:g.filter(e=>(e.branch??``).toLowerCase().includes(_)),y=i!==null&&i.mainRoot===n.project.mainRoot,b=l.trim(),x=y&&b.length>0,S;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(S=e=>{e.preventDefault(),d.current?.focus()},t[0]=S):S=t[0];let C;t[1]===Symbol.for(`react.memo_cache_sentinel`)?(C=(0,Z.jsx)(BC,{align:`inline-start`,children:(0,Z.jsx)(L,{"aria-hidden":`true`})}),t[1]=C):C=t[1];let w;t[2]===c?w=t[3]:(w=c({id:`bSD4im`}),t[2]=c,t[3]=w);let T;t[4]===c?T=t[5]:(T=c({id:`Skr_7L`}),t[4]=c,t[5]=T);let E;t[6]===Symbol.for(`react.memo_cache_sentinel`)?(E=e=>u(e.target.value),t[6]=E):E=t[6];let D;t[7]===Symbol.for(`react.memo_cache_sentinel`)?(D=(0,Z.jsx)(BC,{align:`inline-end`,children:(0,Z.jsx)(Io,{"aria-hidden":`true`})}),t[7]=D):D=t[7];let O=v.length===0?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Oc,{className:`font-normal text-muted-foreground text-xs`,role:`status`,"aria-live":`polite`,children:c({id:`-uaQnI`})}),x?(0,Z.jsxs)(_c,{onSelect:e=>{o(e)||s(b)},onKeyDown:e=>h(e,()=>s(b)),className:`flex items-center gap-2`,"data-testid":`project-switcher-flyout-create`,children:[(0,Z.jsx)(Zt,{"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,Z.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm`,title:b,children:(0,Z.jsx)(J,{id:`gHSAWT`,values:{typedName:b},components:{0:(0,Z.jsx)(`span`,{className:`font-medium`}),1:(0,Z.jsx)(`span`,{className:`font-mono`})}})})]}):null]}):v.map(e=>{let t=e.path??`branch:${e.branch}`,n=e.branch??c({id:`D12vtS`});return(0,Z.jsxs)(_c,{onSelect:t=>{o(t)||a(e)},onKeyDown:t=>h(t,()=>a(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:c({id:`Bn9-El`})}):e.opened?null:(0,Z.jsx)(`span`,{className:`shrink-0 text-muted-foreground text-xs`,title:c({id:`Dvwa0U`}),children:c({id:`nfoduq`})}),e.isCurrent?(0,Z.jsx)(cX,{}):null]},t)}),k;return t[8]!==f||t[9]!==O?(k=(0,Z.jsx)(`div`,{ref:f,className:`min-h-0 flex-1 overflow-x-hidden overflow-y-auto overscroll-contain subtle-scrollbar`,children:O}),t[8]=f,t[9]=O,t[10]=k):k=t[10],(0,Z.jsxs)(yt,{side:`right`,align:`start`,sideOffset:4,className:`flex max-h-80 w-96 flex-col gap-1 overflow-hidden p-1`,onPointerDownOutside:rX,onFocusOutside:nX,onOpenAutoFocus:S,"data-testid":`project-switcher-flyout-${n.project.path}`,children:[(0,Z.jsxs)(RC,{className:`mb-1 h-8 shrink-0`,children:[C,(0,Z.jsx)(UC,{ref:d,"aria-label":w,placeholder:T,value:l,onChange:E,onKeyDown:e=>{e.key===`ArrowDown`&&(e.preventDefault(),m(0)),e.stopPropagation()},"data-testid":`project-switcher-flyout-search-${n.project.path}`}),D]}),k]})}function nX(e){return e.preventDefault()}function rX(e){return e.preventDefault()}function iX(e){let t=(0,$.c)(41),{recents:n,currentPath:r,query:i,worktreeModel:a,onPickEntry:o,onPickBranch:s,guardStaleSelect:c}=e,{_:l}=$t(),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(aX)),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)(Oc,{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)(_c,{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)(sX,{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)(_c,{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)(Io,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0`}),(0,Z.jsx)(oX,{branch:e.branch??e.name,project:e.mainRoot===void 0?null:ug(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)(_c,{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)(Io,{"aria-hidden":`true`,className:`mt-0.5 size-3.5 shrink-0 opacity-40`}),(0,Z.jsx)(oX,{branch:e.branch??``,project:a===null?null:ug(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 aX(e){return e.path}function oX(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 sX(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)(Ui,{"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 cX(){let e=(0,$.c)(4),{_:t}=$t(),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)(Ui,{"aria-label":n,className:`size-3.5 shrink-0 text-muted-foreground`}),e[2]=n,e[3]=r),r}var lX=(e,t,n)=>ng(e,t,n,`ProjectSwitcher`),uX=350;function dX(e){let t=(0,$.c)(108),{bridge:n}=e,{_:r}=$t(),[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=Yj(),y=$h(),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},uX)),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,O;t[2]!==r||t[3]!==n.project||t[4]!==o?(O=()=>{if(!o)return;let e=!1;return lX(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]=O):O=t[5];let k;t[6]!==r||t[7]!==n||t[8]!==o?(k=[o,n,r],t[6]=r,t[7]=n,t[8]=o,t[9]=k):k=t[9],(0,Q.useEffect)(O,k);let A,j;t[10]===n?(A=t[11],j=t[12]):(A=()=>n.onMenuAction(e=>{e===`new-worktree`?(s(!1),_(null),h(``),p(!0)):e===`switch-worktree`&&s(!0)}),j=[n],t[10]=n,t[11]=A,t[12]=j),(0,Q.useEffect)(A,j);let M;t[13]!==r||t[14]!==n.dialog||t[15]!==n.project?(M=()=>{T(!1),lX(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]=M):M=t[16];let N=M,P;t[17]!==r||t[18]!==n.navigator?(P=()=>{T(!1),lX(()=>n.navigator.open(),r({id:`jol95m`}))},t[17]=r,t[18]=n.navigator,t[19]=P):P=t[19];let I=P,R;t[20]===Symbol.for(`react.memo_cache_sentinel`)?(R=()=>{T(!1),d(!0)},t[20]=R):R=t[20];let z=R,B;t[21]===Symbol.for(`react.memo_cache_sentinel`)?(B=e=>{T(!1),h(e),p(!0)},t[21]=B):B=t[21];let V=B,H=n.config.projectPath,U;t[22]===c?U=t[23]:(U=c.trim().toLowerCase(),t[22]=c,t[23]=U);let W=U,G=W!==``,K;t[24]===i?K=t[25]:(K=i??[],t[24]=i,t[25]=K);let ee=K,te;t[26]!==G||t[27]!==ee?(te=G?ee.filter(yX):ee,t[26]=G,t[27]=ee,t[28]=te):te=t[28];let ne=te,re=G?null:y,ie=v!==null&&`h-auto py-1.5`,ae;t[29]===ie?ae=t[30]:(ae=Y(`justify-between text-sidebar-foreground/70 hover:text-sidebar-foreground! data-open:hover:text-sidebar-foreground!`,ie),t[29]=ie,t[30]=ae);let oe;t[31]===r?oe=t[32]:(oe=r({id:`zZ_I5K`}),t[31]=r,t[32]=oe);let se;t[33]===Symbol.for(`react.memo_cache_sentinel`)?(se=b?()=>{x.current=!0}:void 0,t[33]=se):se=t[33];let ce;t[34]===o?ce=t[35]:(ce=b?()=>{if(x.current){x.current=!1;return}T(!o)}:void 0,t[34]=o,t[35]=ce);let le;t[36]===n.config.projectName?le=t[37]:(le=(0,Z.jsx)(`span`,{className:`truncate`,children:n.config.projectName}),t[36]=n.config.projectName,t[37]=le);let q;t[38]===v?q=t[39]:(q=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)(Io,{"aria-hidden":`true`,className:`size-3! shrink-0`}),(0,Z.jsx)(`span`,{className:`truncate`,children:v})]}),t[38]=v,t[39]=q);let ue;t[40]!==le||t[41]!==q?(ue=(0,Z.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5`,children:[le,q]}),t[40]=le,t[41]=q,t[42]=ue):ue=t[42];let de;t[43]===Symbol.for(`react.memo_cache_sentinel`)?(de=(0,Z.jsx)(xd,{"aria-hidden":`true`,className:`opacity-60`}),t[43]=de):de=t[43];let fe;t[44]!==n.config.projectPath||t[45]!==ae||t[46]!==oe||t[47]!==ce||t[48]!==ue?(fe=(0,Z.jsx)(hc,{asChild:!0,children:(0,Z.jsxs)(zj,{className:ae,"data-testid":`project-switcher-trigger`,"aria-label":oe,title:n.config.projectPath,onPointerDown:se,onClick:ce,children:[ue,de]})}),t[44]=n.config.projectPath,t[45]=ae,t[46]=oe,t[47]=ce,t[48]=ue,t[49]=fe):fe=t[49];let pe;t[50]!==r||t[51]!==n||t[52]!==H||t[53]!==g||t[54]!==ne||t[55]!==re||t[56]!==W||t[57]!==i||t[58]!==c?(pe=i===null?null:i.length===0?(0,Z.jsx)(Oc,{className:`font-normal text-muted-foreground text-xs`,children:(0,Z.jsx)(J,{id:`MUrVEo`})}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsxs)(RC,{className:`mb-1 h-8 border-0 shadow-none has-[[data-slot=input-group-control]:focus-visible]:ring-0`,children:[(0,Z.jsx)(UC,{"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)(BC,{children:(0,Z.jsx)(L,{"aria-hidden":`true`})})]}),(0,Z.jsx)(Ac,{}),(0,Z.jsx)(`div`,{className:`max-h-64 overflow-x-hidden overflow-y-auto overscroll-contain subtle-scrollbar scroll-fade-mask`,children:(0,Z.jsx)(XY,{bridge:n,recents:ne,currentPath:H,query:W,worktreeModel:re,closeMenu:()=>T(!1),guardStaleSelect:D,flyoutPath:g,setFlyoutPath:_,openNewWorktreeWith:V})})]}),t[50]=r,t[51]=n,t[52]=H,t[53]=g,t[54]=ne,t[55]=re,t[56]=W,t[57]=i,t[58]=c,t[59]=pe):pe=t[59];let me;t[60]===Symbol.for(`react.memo_cache_sentinel`)?(me=(0,Z.jsx)(Ac,{}),t[60]=me):me=t[60];let he;t[61]===Symbol.for(`react.memo_cache_sentinel`)?(he=e=>{D(e)||z()},t[61]=he):he=t[61];let ge;t[62]===Symbol.for(`react.memo_cache_sentinel`)?(ge=(0,Z.jsxs)(_c,{onSelect:he,"data-testid":`project-switcher-new-project`,children:[(0,Z.jsx)(Zt,{"aria-hidden":`true`,className:`text-muted-foreground`}),(0,Z.jsx)(J,{id:`gKi-a_`})]}),t[62]=ge):ge=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)(F,{"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)(_c,{onSelect:_e,"data-testid":`project-switcher-switch-project`,children:[ve,ye]}),t[67]=_e,t[68]=be);let xe;t[69]===N?xe=t[70]:(xe=e=>{D(e)||N()},t[69]=N,t[70]=xe);let Se,Ce;t[71]===Symbol.for(`react.memo_cache_sentinel`)?(Se=(0,Z.jsx)(Fo,{"aria-hidden":`true`,className:`text-muted-foreground`}),Ce=(0,Z.jsx)(J,{id:`PVUn_c`}),t[71]=Se,t[72]=Ce):(Se=t[71],Ce=t[72]);let we;t[73]===xe?we=t[74]:(we=(0,Z.jsxs)(_c,{onSelect:xe,"data-testid":`project-switcher-open-folder`,children:[Se,Ce]}),t[73]=xe,t[74]=we);let Te;t[75]===v?Te=t[76]:(Te=v===null?null:(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Ac,{}),(0,Z.jsxs)(_c,{onSelect:e=>{D(e)||(T(!1),h(``),p(!0))},"data-testid":`project-switcher-new-worktree`,children:[(0,Z.jsx)(Io,{"aria-hidden":`true`,className:`text-muted-foreground`}),(0,Z.jsx)(J,{id:`DXd9LM`})]})]}),t[75]=v,t[76]=Te);let Ee;t[77]!==pe||t[78]!==be||t[79]!==we||t[80]!==Te?(Ee=(0,Z.jsxs)(yc,{align:`start`,side:`top`,className:`min-w-[260px]`,"data-testid":`project-switcher-menu`,children:[pe,me,ge,be,we,Te]}),t[77]=pe,t[78]=be,t[79]=we,t[80]=Te,t[81]=Ee):Ee=t[81];let De;t[82]!==o||t[83]!==fe||t[84]!==Ee?(De=(0,Z.jsxs)(Tc,{open:o,onOpenChange:T,modal:!1,children:[fe,Ee]}),t[82]=o,t[83]=fe,t[84]=Ee,t[85]=De):De=t[85];let Oe;t[86]!==n||t[87]!==u?(Oe=(0,Z.jsx)(sm,{open:u,onOpenChange:d,bridge:n}),t[86]=n,t[87]=u,t[88]=Oe):Oe=t[88];let ke;t[89]===y?.entries?ke=t[90]:(ke=y?.entries.map(_X).filter(gX),t[89]=y?.entries,t[90]=ke);let Ae;t[91]===y?.entries?Ae=t[92]:(Ae=new Set(y?.entries.filter(hX).map(mX)),t[91]=y?.entries,t[92]=Ae);let je=y?.remoteBranches,Me;t[93]===y?.entries?Me=t[94]:(Me=new Map(y?.entries.filter(pX).map(fX)),t[93]=y?.entries,t[94]=Me);let Ne;t[95]!==v||t[96]!==n||t[97]!==m||t[98]!==f||t[99]!==ke||t[100]!==Ae||t[101]!==je||t[102]!==Me?(Ne=(0,Z.jsx)(WY,{open:f,onOpenChange:p,bridge:n,currentBranch:v,initialBranchName:m,branches:ke,existingWorktreeBranches:Ae,remoteBranches:je,behindByBranch:Me}),t[95]=v,t[96]=n,t[97]=m,t[98]=f,t[99]=ke,t[100]=Ae,t[101]=je,t[102]=Me,t[103]=Ne):Ne=t[103];let Pe;return t[104]!==De||t[105]!==Oe||t[106]!==Ne?(Pe=(0,Z.jsxs)(Z.Fragment,{children:[De,Oe,Ne]}),t[104]=De,t[105]=Oe,t[106]=Ne,t[107]=Pe):Pe=t[107],Pe}function fX(e){return[e.branch,e.behind]}function pX(e){return e.branch!==null&&e.behind!==void 0}function mX(e){return e.branch}function hX(e){return e.branch!==null&&e.worktreePath!==null}function gX(e){return e!==null}function _X(e){return e.branch}function vX(e){return e.stopPropagation()}function yX(e){return!e.isLinkedWorktree}function bX(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})),Kn(`sidebarSearchPill`)}function xX(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)(L,{"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)(P,{className:`text-foreground/70`,children:Ol(`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 SX(){let e=(0,$.c)(31),{_:t}=$t(),n=ua(),{activeDocName:r}=mt(),[i,a]=(0,Q.useState)(!1),o=_a(),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=Eo(c),e[3]=c,e[4]=l);let u=l,d=So(),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)(Nj,{asChild:!0,children:(0,Z.jsxs)(Vs,{className:`flex w-full items-center gap-1.5`,children:[(0,Z.jsx)(Vd,{className:`size-3.5 shrink-0`}),(0,Z.jsx)(J,{id:`PCSkw2`}),(0,Z.jsx)(Ki,{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)(Zt,{}),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)(Pj,{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)(kX,{}),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`})}):Oo.filter(e=>c.some(t=>t.scope===e)).map(e=>(0,Z.jsxs)(Hs,{className:`group/scope`,open:c.some(t=>t.scope===e&&wr(t.scope,t.name)===r)||(p[e]??!1),onOpenChange:t=>m(n=>({...n,[e]:t})),children:[(0,Z.jsxs)(Vs,{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)(Ki,{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)(Bs,{children:(0,Z.jsx)(Ij,{className:`pl-2`,children:c.filter(t=>t.scope===e).map(e=>(0,Z.jsx)(wX,{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)(Bs,{children:(0,Z.jsxs)(Fj,{children:[x,S]})}),e[22]=S,e[23]=C);let w;e[24]===i?w=e[25]:(w=(0,Z.jsx)(no,{defaultScope:`project`,open:i,onOpenChange:a,onCreated:CX}),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)(Hs,{className:`group/skills shrink-0`,children:(0,Z.jsxs)(Mj,{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 CX(e){let{scope:t,name:n}=e;return Jo(wr(t,n))}function wX(e){let t=(0,$.c)(50),{skill:n,activeDocName:r,actions:i,existingNames:a}=e,{_:o}=$t(),[s,c]=(0,Q.useState)(!1),[l,u]=(0,Q.useState)(!1),d;t[0]!==n.name||t[1]!==n.scope?(d=wr(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)(Ki,{className:`size-3 shrink-0 text-muted-foreground transition-transform group-data-[state=open]/skill:rotate-90`}),h=(0,Z.jsx)(Vd,{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]:(_=wo(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)(ts,{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)(Xa,{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)(Vs,{asChild:!0,children:(0,Z.jsxs)(zj,{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)(kd,{}),t[27]=w):w=t[27];let T;t[28]===C?T=t[29]:(T=(0,Z.jsx)(hc,{asChild:!0,children:(0,Z.jsx)(Bj,{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)(yc,{side:`right`,align:`start`,className:`min-w-52`,children:(0,Z.jsx)(ma,{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)(Tc,{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)(DX,{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)(Bs,{children:O}),t[41]=O,t[42]=k);let A;t[43]!==S||t[44]!==D||t[45]!==k?(A=(0,Z.jsxs)(Lj,{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)(Hs,{open:s,onOpenChange:c,className:`group/skill`,children:A}),t[47]=s,t[48]=A,t[49]=j):j=t[49],j}function TX(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 EX(t),t}function EX(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&&EX(t.children)}function DX(e){let t=(0,$.c)(27),{skill:n}=e,{_:r}=$t(),[i,a]=(0,Q.useState)(null),[o,s]=(0,Q.useState)(!1),{openTarget:c}=mt(),l;t[0]===c?l=t[1]:(l=function(e){c({kind:`doc`,target:e,docName:e},{tabBehavior:`append`}),tl(fl(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(le(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`}),tl(sl({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=()=>{Ec(n.scope,n.name).then(t=>{e&&(t.ok?(a(t.files),s(!1)):(a([]),s(!0)))})};t();let r=Cl(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?TX(i):[],a;t[19]!==u||t[20]!==n.name||t[21]!==n.scope?(a=()=>n.scope===`project`?u(Ar(n.name)):Jo(wr(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)(te,{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)(Hj,{children:(0,Z.jsxs)(Uj,{size:`sm`,onClick:a,className:`text-[11px]`,children:[s,c]})}),t[25]=a,t[26]=l),h=(0,Z.jsxs)(Vj,{className:`mr-0 pr-0`,children:[l,i===null?(0,Z.jsx)(Hj,{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)(Hj,{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)(OX,{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 OX(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)(Ki,{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)(Vs,{asChild:!0,children:(0,Z.jsxs)(Uj,{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)(OX,{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)(Bs,{children:u}),t[15]=u,t[16]=d);let f;t[17]!==c||t[18]!==d?(f=(0,Z.jsxs)(Hj,{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)(Hs,{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)(Md,{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)(Hj,{children:(0,Z.jsxs)(Uj,{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 kX(){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 bc().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 Dc(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 AX=`Relaunch`,jX=`Release notes`,MX=`Updates paused`,NX=`Download`,PX=`Reset to defaults`,FX=`Relaunching to install the update…`,IX=`Relaunch failed — please restart manually`;function LX(e){return`Update to ${e} didn't install.`}var RX=`Retry`,zX=`Download manually`,BX=`Recovery action failed — please try again`;function VX(e,t){let n=t instanceof Error&&t.message?t.message:``;return n?`${e}: ${n}`:e}function HX(e){return`Version ${e} ready to install`}function UX(e){return`Updated to Version ${e}`}function WX(e){return`Your settings and recent projects were saved by a newer build than this one (v${e}). Reset to defaults to continue.`}var GX=0,KX=0,qX=1,JX=2,YX=3,XX=6e4;function ZX(e,t,n=()=>{},r=XX,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:HX(r),priority:JX,action:{label:AX,onClick:()=>{t({id:i,body:FX,priority:JX,dismissible:!1}),e.update.relaunchNow().then(()=>{n(i)},e=>{a(),t({id:`relaunch-error-${r}`,body:VX(IX,e),variant:`error`,priority:qX})})}}})};a()})),a.push(e.onUpdateRelaunching(()=>{t({id:s,body:FX,priority:JX,dismissible:!1})})),a.push(e.onUpdateRelaunchFailed(({version:r,message:i,downloadUrl:a})=>{if(a){let i=`install-failed-${r}`,o=()=>{t({id:i,body:LX(r),variant:`error`,priority:qX,action:{label:RX,onClick:()=>{e.update.relaunchNow().then(()=>{n(i)},e=>{console.warn(`[update-notice] install-failed retry rejected`,e),o()})}},secondaryAction:{label:zX,onClick:()=>{e.shell.openExternal(a)}}})};o();return}t({id:`relaunch-error-${r}`,body:i?`${IX}: ${i}`:IX,variant:`error`,priority:qX})})),a.push(e.onWhatsNew(({version:a,releaseUrl:s})=>{if(i.isEligible(a)){i.onShown(a),t({id:`whats-new-combined-${a}`,body:UX(a),variant:`success`,priority:YX,combinedSubscribe:!0,whatsNew:{version:a,releaseUrl:s},action:{label:jX,onClick:()=>{e.shell.openExternal(s)}}}),e.update.dismissWhatsNew(a);return}let c=`whats-new-${a}`;t({id:c,body:UX(a),variant:`success`,priority:YX,action:{label:jX,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:MX,priority:KX,action:{label:NX,onClick:()=>{e.shell.openExternal(n)}}})})),()=>{for(let e of a)e();for(let e of o)clearTimeout(e);o.clear()}}function QX(e,t,n,r=()=>{}){let i=`schema-incompatibility-${t.persistedSchemaVersion}`,a=`schema-incompatibility-error-${t.persistedSchemaVersion}`,o=e=>{r(i),n({id:a,body:VX(BX,e),variant:`error`,priority:GX})};n({id:i,body:WX(t.currentBuild),priority:GX,action:{label:PX,onClick:()=>{e.state.resetIncompatible().then(()=>{r(i)},o)}}})}var $X=[],eZ=new Set,tZ=!1;function nZ(){for(let e of eZ)e()}function rZ(e){let t=$X.findIndex(t=>t.id===e.id);if(t===-1)$X=[...$X,e];else{let n=$X.slice();n[t]=e,$X=n}nZ()}function iZ(e){let t=$X.filter(t=>t.id!==e);t.length!==$X.length&&($X=t,nZ())}function aZ(){return $X}function oZ(e){return eZ.add(e),()=>{eZ.delete(e)}}function sZ(){if(tZ||typeof window>`u`)return;let e=window.okDesktop;e&&(tZ=!0,ZX(e,rZ,iZ,void 0,{isEligible:e=>XP(rF.getSnapshot(),e),onShown:e=>rF.recordShown(e)}),e.state.query().then(t=>{t.schemaIncompatibility&&QX(e,t.schemaIncompatibility,rZ,iZ)},e=>{console.warn(`[update-notices-store] bridge.state.query() failed`,e)}))}var cZ=6e4,lZ=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=>uu(e,n),o=e=>uu(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 uZ(e){let t=(0,$.c)(34),{version:n,onOpenReleaseNotes:r,onClose:i,store:a,autoDismissMs:o}=e,s=a===void 0?rF:a,c=o===void 0?cZ:o,{_:l}=$t(),[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)(WP,{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)(lZ,{href:qP,label:l({id:`I7Exsw`}),icon:sF}),(0,Z.jsx)(lZ,{href:GP,label:l({id:`zyKa-I`}),icon:oF}),(0,Z.jsx)(lZ,{href:KP,label:l({id:`36aWJD`}),icon:aF})]}),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 dZ(e){let t=(0,$.c)(37),{notice:n,onDismiss:r}=e,{_:i}=$t(),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)(gs,{"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 pZ(){let e=(0,$.c)(15),t=(0,Q.useSyncExternalStore)(oZ,aZ,aZ),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=()=>iZ(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)(uZ,{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?.(),iZ(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)(dZ,{notice:r,onDismiss:i})}),e[12]=r,e[13]=i,e[14]=a):a=e[14],a}function mZ(e,t,n){return e?.kind===`doc`&&t||e?.kind===`folder-index`&&t?ea(n.contentDir,ra(t),n.pathSeparator):e?.kind===`folder`?ea(n.contentDir,e.folderPath,n.pathSeparator):e?.kind===`asset`?ea(n.contentDir,e.assetPath,n.pathSeparator):n.contentDir}function hZ(e,t){return(e?.kind===`doc`||e?.kind===`folder-index`)&&t?ra(t):e?.kind===`folder`?e.folderPath:e?.kind===`asset`?e.assetPath:``}function gZ(e,t,n){return e===null?Ca({workspace:n}):e.kind===`folder`?n?ia({folderRelativePath:e.folderPath,workspace:n}):null:e.kind===`doc`||e.kind===`folder-index`?ba({docName:t,workspace:n}):null}var _Z={folderCount:0,expandedCount:0},vZ=`button, [role="button"], [role="menuitem"], input, textarea, select, a[href]`;function yZ(e){return typeof Element>`u`||!(e instanceof Element)?!1:e.closest(vZ)!==null}function bZ(e){let t=(0,$.c)(2),{onOpenSearch:n}=e,r;return t[0]===n?r=t[1]:(r=(0,Z.jsx)(Tl,{name:`file-sidebar`,children:(0,Z.jsx)(SZ,{onOpenSearch:n})}),t[0]=n,t[1]=r),r}var xZ=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)(Ts,{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)(Es,{children:r}),t[10]=r,t[11]=s);let c;return t[12]!==o||t[13]!==s?(c=(0,Z.jsxs)(Os,{children:[o,s]}),t[12]=o,t[13]=s,t[14]=c):c=t[14],c};function SZ(e){let t=(0,$.c)(209),{onOpenSearch:n}=e,{_:r}=$t(),[i,a]=(0,Q.useState)(null),[o,s]=(0,Q.useState)(null),{activeDocName:c,activeTarget:l}=mt(),u;t[0]!==c||t[1]!==l?(u=l?.kind===`folder`||l?.kind===`folder-index`?l.folderPath:Jc(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}=xj(),y=da(),b=_===`expanded`,x=h&&_===`collapsed`,[S,C]=(0,Q.useState)(_Z),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 CS(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=fo(``),M=fo(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=$i(),{status:R}=ki(),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=pa().states,{dispatch:U}=xa(),W;t[12]===L?W=t[13]:(W=Ca({workspace:L}),t[12]=L,t[13]=W);let G=W,{projectLocalBinding:K,merged:ee}=Po(),te=ee?.appearance?.sidebar?.showHiddenFiles??!1,ne=O&&!k,re=O&&!A,ie=ne||re,ae=DZ,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),hs.success(r({id:`6_ZOw4`}),{description:L.contentDir})}catch(e){console.warn(`[FileSidebar] clipboard write failed:`,e),hs.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=()=>{ja({...Oa(``),hasRemote:z,onClickWhenNoRemote:()=>{hs.error(r({id:`WyQxwa`}))}},{clipboardWrite:ga,toastSuccess:EZ,toastError:TZ,logEvent:wZ})},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:`,Qn(t.error)),hs.error(r({id:`P47EWZ`}),{description:Qn(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]!==c||t[46]!==l||t[47]!==U||t[48]!==H||t[49]!==m||t[50]!==K||t[51]!==te||t[52]!==v||t[53]!==i||t[54]!==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;Nq(l);return;case`duplicate`:if(!l)return;Fq(l);return;case`move-to-trash`:if(!l)return;jq(l);return;case`reveal-in-finder`:{if(!I||!L)return;let e=mZ(l,c,L);I.shell.showItemInFolder(e);return}case`send-to-ai`:{let e=ta.filter(e=>H[e.id]?.installed===!0);if(e.length===0){hs.error(r({id:`LKOLNn`}));return}let t=gZ(l,c,L);if(!t)return;let[n]=e;if(!n)return;U(n.id,t);return}case`copy-full-path`:{if(!L)return;let e=mZ(l,c,L);navigator.clipboard.writeText(e).then(()=>hs.success(r({id:`6_ZOw4`}),{description:e})).catch(e=>{console.warn(`[FileSidebar] clipboard write failed:`,e),hs.error(r({id:`vfRlCI`}))});return}case`copy-relative-path`:{let e=hZ(l,c);if(e===``){hs.error(r({id:`74eHt-`}));return}navigator.clipboard.writeText(e).then(()=>hs.success(r({id:`haHgQj`}),{description:e})).catch(e=>{console.warn(`[FileSidebar] clipboard write failed:`,e),hs.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:`,Qn(e.error)),hs.error(r({id:`P47EWZ`}),{description:Qn(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,c,m,K,te,H,U,v,r],t[44]=r,t[45]=c,t[46]=l,t[47]=U,t[48]=H,t[49]=m,t[50]=K,t[51]=te,t[52]=v,t[53]=i,t[54]=L,t[55]=Te,t[56]=Ee):(Te=t[55],Ee=t[56]),(0,Q.useEffect)(Te,Ee);let De=h&&b&&`motion-safe:delay-100`,Oe=x&&`opacity-0`,ke;t[57]!==De||t[58]!==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[57]=De,t[58]=Oe,t[59]=ke):ke=t[59];let Ae;t[60]===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[60]=Ae):Ae=t[60];let je;t[61]===b?je=t[62]:(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[61]=b,t[62]=je);let Me;t[63]===Symbol.for(`react.memo_cache_sentinel`)?(Me=Y(`flex items-center gap-1`,h&&`[&>*]:[-webkit-app-region:no-drag]`),t[63]=Me):Me=t[63];let Ne;t[64]!==r||t[65]!==k||t[66]!==O||t[67]!==A||t[68]!==i?(Ne=O?(0,Z.jsxs)(Tc,{children:[(0,Z.jsx)(hc,{asChild:!0,children:(0,Z.jsx)(xZ,{icon:qd,label:r({id:`Rq1vFD`})})}),(0,Z.jsxs)(yc,{align:`end`,className:`min-w-52`,children:[k?null:(0,Z.jsxs)(_c,{onSelect:()=>i?.expandAll(),children:[(0,Z.jsx)(Ff,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`OlAl5i`})]}),A?null:(0,Z.jsxs)(_c,{onSelect:()=>i?.collapseAll(),children:[(0,Z.jsx)(Fd,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`qvWGzP`})]})]})]}):null,t[64]=r,t[65]=k,t[66]=O,t[67]=A,t[68]=i,t[69]=Ne):Ne=t[69];let Pe;t[70]===r?Pe=t[71]:(Pe=r({id:`HdkSiO`}),t[70]=r,t[71]=Pe);let Fe;t[72]!==m||t[73]!==i?(Fe=()=>i?.startCreating(`file`,m),t[72]=m,t[73]=i,t[74]=Fe):Fe=t[74];let Ie;t[75]!==Pe||t[76]!==Fe?(Ie=(0,Z.jsx)(xZ,{icon:xf,label:Pe,onClick:Fe}),t[75]=Pe,t[76]=Fe,t[77]=Ie):Ie=t[77];let Le;t[78]!==r||t[79]!==F||t[80]!==m||t[81]!==i?(Le=F?(0,Z.jsxs)(Tc,{children:[(0,Z.jsx)(hc,{asChild:!0,children:(0,Z.jsx)(xZ,{icon:Za,label:r({id:`Uuj_R4`})})}),(0,Z.jsx)(yc,{align:`end`,className:`min-w-52`,children:(0,Z.jsx)(wq,{parentDir:m,onSelectTemplate:e=>i?.createFromTemplate(m,e),ItemComponent:_c})})]}):null,t[78]=r,t[79]=F,t[80]=m,t[81]=i,t[82]=Le):Le=t[82];let Re;t[83]===r?Re=t[84]:(Re=r({id:`96G6Re`}),t[83]=r,t[84]=Re);let ze;t[85]!==m||t[86]!==i?(ze=()=>i?.startCreating(`folder`,m),t[85]=m,t[86]=i,t[87]=ze):ze=t[87];let Be;t[88]!==Re||t[89]!==ze?(Be=(0,Z.jsx)(xZ,{icon:Ld,label:Re,onClick:ze}),t[88]=Re,t[89]=ze,t[90]=Be):Be=t[90];let Ve;t[91]!==Ne||t[92]!==Ie||t[93]!==Le||t[94]!==Be?(Ve=(0,Z.jsxs)(`div`,{"data-testid":`sidebar-toolbar`,className:Me,children:[Ne,Ie,Le,Be]}),t[91]=Ne,t[92]=Ie,t[93]=Le,t[94]=Be,t[95]=Ve):Ve=t[95];let He;t[96]!==ke||t[97]!==je||t[98]!==Ve?(He=(0,Z.jsxs)(kj,{"data-electron-drag":h?``:void 0,className:ke,children:[Ae,je,Ve]}),t[96]=ke,t[97]=je,t[98]=Ve,t[99]=He):He=t[99];let Ue=h&&b&&`motion-safe:delay-100`,We=x&&`opacity-0`,Ge;t[100]!==Ue||t[101]!==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[100]=Ue,t[101]=We,t[102]=Ge):Ge=t[102];let Ke;t[103]===_?Ke=t[104]:(Ke=[_],t[103]=_,t[104]=Ke);let qe;t[105]===n?qe=t[106]:(qe=(0,Z.jsx)(xX,{onClick:n}),t[105]=n,t[106]=qe);let Je;t[107]!==Ke||t[108]!==qe?(Je=(0,Z.jsx)(g,{fallbackRender:CZ,onError:bX,resetKeys:Ke,children:qe}),t[107]=Ke,t[108]=qe,t[109]=Je):Je=t[109];let Ye;t[110]!==Ge||t[111]!==Je?(Ye=(0,Z.jsx)(`div`,{className:Ge,children:Je}),t[110]=Ge,t[111]=Je,t[112]=Ye):Ye=t[112];let Xe;t[113]===Symbol.for(`react.memo_cache_sentinel`)?(Xe=(0,Z.jsx)(sI,{}),t[113]=Xe):Xe=t[113];let Ze;t[114]===Symbol.for(`react.memo_cache_sentinel`)?(Ze=(0,Z.jsx)(Fo,{className:`size-3.5 shrink-0`}),t[114]=Ze):Ze=t[114];let Qe;t[115]===V?Qe=t[116]:(Qe=(0,Z.jsx)(`span`,{className:`truncate`,children:V}),t[115]=V,t[116]=Qe);let $e;t[117]===Symbol.for(`react.memo_cache_sentinel`)?($e=(0,Z.jsx)(Ki,{className:`size-3.5 shrink-0 text-muted-foreground transition-transform group-data-[state=open]/files:rotate-90`}),t[117]=$e):$e=t[117];let et;t[118]===Qe?et=t[119]:(et=(0,Z.jsx)(Nj,{asChild:!0,className:`shrink-0`,children:(0,Z.jsxs)(Vs,{"data-sidebar-root-context":!0,className:`flex w-full items-center gap-1.5`,children:[Ze,Qe,$e]})}),t[118]=Qe,t[119]=et);let tt=o==null?`50vh`:`${o}px`,nt;t[120]===tt?nt=t[121]:(nt={height:tt},t[120]=tt,t[121]=nt);let rt;t[122]===Symbol.for(`react.memo_cache_sentinel`)?(rt=(0,Z.jsx)(WJ,{ref:a,onContentHeightChange:s}),t[122]=rt):rt=t[122];let it;t[123]===nt?it=t[124]:(it=(0,Z.jsx)(Bs,{className:`flex max-h-[70vh] flex-col overflow-hidden`,style:nt,children:rt}),t[123]=nt,t[124]=it);let at;t[125]!==et||t[126]!==it?(at=(0,Z.jsx)(Hs,{defaultOpen:!0,className:`group/files flex shrink-0 flex-col`,children:(0,Z.jsxs)(Mj,{className:`min-h-0 px-0`,children:[et,it]})}),t[125]=et,t[126]=it,t[127]=at):at=t[127];let ot;t[128]===Symbol.for(`react.memo_cache_sentinel`)?(ot=(0,Z.jsx)(SX,{}),t[128]=ot):ot=t[128];let st;t[129]===i?st=t[130]:(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[129]=i,t[130]=st);let ct;t[131]!==at||t[132]!==st?(ct=(0,Z.jsxs)(jj,{children:[Xe,at,ot,st]}),t[131]=at,t[132]=st,t[133]=ct):ct=t[133];let lt;t[134]===Symbol.for(`react.memo_cache_sentinel`)?(lt=(0,Z.jsxs)(Aj,{className:`px-0`,children:[(0,Z.jsx)(BY,{}),(0,Z.jsx)(pZ,{}),typeof window<`u`&&window.okDesktop?(0,Z.jsx)(Ij,{children:(0,Z.jsx)(Lj,{children:(0,Z.jsx)(dX,{bridge:window.okDesktop})})}):null]}),t[134]=lt):lt=t[134];let ut=!(y&&_===`collapsed`),dt;t[135]===ut?dt=t[136]:(dt=(0,Z.jsx)(Dj,{enableToggle:!1,enableDrag:ut}),t[135]=ut,t[136]=dt);let ft;t[137]!==He||t[138]!==Ye||t[139]!==ct||t[140]!==dt?(ft=(0,Z.jsx)(HN,{asChild:!0,children:(0,Z.jsxs)(`div`,{className:`contents`,onContextMenu:ae,children:[He,Ye,ct,lt,dt]})}),t[137]=He,t[138]=Ye,t[139]=ct,t[140]=dt,t[141]=ft):ft=t[141];let pt=!L,ht,gt;t[142]===Symbol.for(`react.memo_cache_sentinel`)?(ht=(0,Z.jsx)(xf,{"aria-hidden":`true`}),gt=(0,Z.jsx)(J,{id:`HdkSiO`}),t[142]=ht,t[143]=gt):(ht=t[142],gt=t[143]);let _t;t[144]!==se||t[145]!==pt?(_t=(0,Z.jsxs)(KN,{disabled:pt,onSelect:se,"data-testid":`empty-space-menu-new-file`,children:[ht,gt]}),t[144]=se,t[145]=pt,t[146]=_t):_t=t[146];let vt;t[147]!==le||t[148]!==P||t[149]!==L?(vt=P?(0,Z.jsxs)(WN,{children:[(0,Z.jsxs)(qN,{disabled:!L,"data-testid":`empty-space-menu-new-from-template`,children:[(0,Z.jsx)(Za,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`Uuj_R4`})]}),(0,Z.jsx)(JN,{children:(0,Z.jsx)(wq,{parentDir:``,onSelectTemplate:le,ItemComponent:KN})})]}):null,t[147]=le,t[148]=P,t[149]=L,t[150]=vt):vt=t[150];let yt=!L,bt,xt;t[151]===Symbol.for(`react.memo_cache_sentinel`)?(bt=(0,Z.jsx)(Ld,{"aria-hidden":`true`}),xt=(0,Z.jsx)(J,{id:`96G6Re`}),t[151]=bt,t[152]=xt):(bt=t[151],xt=t[152]);let St;t[153]!==ue||t[154]!==yt?(St=(0,Z.jsxs)(KN,{disabled:yt,onSelect:ue,"data-testid":`empty-space-menu-new-folder`,children:[bt,xt]}),t[153]=ue,t[154]=yt,t[155]=St):St=t[155];let Ct;t[156]===Symbol.for(`react.memo_cache_sentinel`)?(Ct=(0,Z.jsx)(ZN,{}),t[156]=Ct):Ct=t[156];let wt;t[157]!==r||t[158]!==fe||t[159]!==L?(wt=I?(0,Z.jsxs)(KN,{disabled:!L,onSelect:fe,"data-testid":`empty-space-menu-reveal-in-finder`,"aria-label":r(L?{id:`LtSYdi`}:{id:`o2yoFu`}),children:[(0,Z.jsx)(Fo,{"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[157]=r,t[158]=fe,t[159]=L,t[160]=wt):wt=t[160];let Tt;t[161]!==U||t[162]!==G||t[163]!==H?(Tt=(0,Z.jsx)(OY,{input:G,installStates:H,dispatch:U}),t[161]=U,t[162]=G,t[163]=H,t[164]=Tt):Tt=t[164];let Et;t[165]!==ge||t[166]!==z?(Et=z?(0,Z.jsxs)(KN,{onSelect:ge,"data-testid":`empty-space-menu-share`,children:[(0,Z.jsx)(_f,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`Z8lGw6`})]}):null,t[165]=ge,t[166]=z,t[167]=Et):Et=t[167];let Dt=!L,Ot;t[168]!==r||t[169]!==L?(Ot=r(L?{id:`Up2_7p`}:{id:`U8CD-l`}),t[168]=r,t[169]=L,t[170]=Ot):Ot=t[170];let kt;t[171]===Symbol.for(`react.memo_cache_sentinel`)?(kt=(0,Z.jsx)(xo,{"aria-hidden":`true`}),t[171]=kt):kt=t[171];let At;t[172]===Symbol.for(`react.memo_cache_sentinel`)?(At=(0,Z.jsx)(`span`,{className:`flex-1`,children:(0,Z.jsx)(J,{id:`Up2_7p`})}),t[172]=At):At=t[172];let jt;t[173]===L?jt=t[174]:(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[173]=L,t[174]=jt);let Mt;t[175]!==me||t[176]!==Dt||t[177]!==Ot||t[178]!==jt?(Mt=(0,Z.jsxs)(KN,{disabled:Dt,onSelect:me,"data-testid":`empty-space-menu-copy-full-path`,"aria-label":Ot,children:[kt,At,jt]}),t[175]=me,t[176]=Dt,t[177]=Ot,t[178]=jt,t[179]=Mt):Mt=t[179];let Nt;t[180]===Symbol.for(`react.memo_cache_sentinel`)?(Nt=(0,Z.jsx)(ZN,{}),t[180]=Nt):Nt=t[180];let Pt=K===null,Ft;t[181]===Symbol.for(`react.memo_cache_sentinel`)?(Ft=(0,Z.jsx)(J,{id:`XcGbim`}),t[181]=Ft):Ft=t[181];let It;t[182]!==ve||t[183]!==te||t[184]!==Pt?(It=(0,Z.jsx)(YN,{checked:te,onCheckedChange:ve,disabled:Pt,"data-testid":`empty-space-menu-show-hidden-files`,children:Ft}),t[182]=ve,t[183]=te,t[184]=Pt,t[185]=It):It=t[185];let Lt;t[186]===ie?Lt=t[187]:(Lt=ie?(0,Z.jsx)(ZN,{}):null,t[186]=ie,t[187]=Lt);let Rt;t[188]!==be||t[189]!==ne?(Rt=ne?(0,Z.jsxs)(KN,{onSelect:be,"data-testid":`empty-space-menu-expand-all`,children:[(0,Z.jsx)(Ff,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`OlAl5i`})]}):null,t[188]=be,t[189]=ne,t[190]=Rt):Rt=t[190];let zt;t[191]!==Se||t[192]!==re?(zt=re?(0,Z.jsxs)(KN,{onSelect:Se,"data-testid":`empty-space-menu-collapse-all`,children:[(0,Z.jsx)(Fd,{"aria-hidden":`true`}),(0,Z.jsx)(J,{id:`qvWGzP`})]}):null,t[191]=Se,t[192]=re,t[193]=zt):zt=t[193];let Bt;t[194]!==_t||t[195]!==vt||t[196]!==St||t[197]!==wt||t[198]!==Tt||t[199]!==Et||t[200]!==Mt||t[201]!==It||t[202]!==Lt||t[203]!==Rt||t[204]!==zt?(Bt=(0,Z.jsxs)(GN,{className:`min-w-52`,children:[_t,vt,St,Ct,wt,Tt,Et,Mt,Nt,It,Lt,Rt,zt]}),t[194]=_t,t[195]=vt,t[196]=St,t[197]=wt,t[198]=Tt,t[199]=Et,t[200]=Mt,t[201]=It,t[202]=Lt,t[203]=Rt,t[204]=zt,t[205]=Bt):Bt=t[205];let Vt;return t[206]!==ft||t[207]!==Bt?(Vt=(0,Z.jsx)(Tj,{variant:`inset`,children:(0,Z.jsxs)(VN,{children:[ft,Bt]})}),t[206]=ft,t[207]=Bt,t[208]=Vt):Vt=t[208],Vt}function CZ(){return null}function wZ(e){return console.log(e)}function TZ(e){return hs.error(e)}function EZ(e){return hs.success(e)}function DZ(e){e.target instanceof Element&&e.target.closest(`[data-sidebar-root-context]`)||yZ(e.target)&&(e.preventDefault(),e.stopPropagation())}var OZ=(0,Q.lazy)(()=>n(()=>import(`./McpConsentDialogBody-DXwlUNR4.js`),__vite__mapDeps([93,1,6,7,73,16,13,17,56,18,57,54,55,75,94]),import.meta.url));function kZ(){let e=(0,$.c)(1);if(!(0,Q.useSyncExternalStore)(qu.subscribe,jZ,AZ))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)(OZ,{})}),e[0]=t):t=e[0],t}function AZ(){return!1}function jZ(){return qu.getSnapshot()!==null}function MZ(){let e=(0,$.c)(17),t=Dn(),{collabUrl:n,setSystemProvider:r,updateServerInstanceId:i,onBranchSwitched:a,observeBranch:o,observeDiskAck:s,refreshServerInfo:c}=mt(),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 jo,i=new ko({url:n,name:$r,document:e,onStateless:e=>{let{payload:t}=e;ne(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:RZ,onConfigValidationRejected:LZ,onConfigIgnoreNestedError:IZ,onUnknown:FZ})},onClose:PZ,onDisconnect:NZ}),a=xl(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=Be(()=>{u.current.refreshServerInfo()});i.on(`synced`,()=>{bl([`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 NZ(){console.warn(`[CC1] __system__ disconnected - derived views may be stale`)}function PZ(e){let{event:t}=e;console.warn(`[CC1] __system__ connection closed:`,t.code,t.reason)}function FZ(e){console.warn(`[CC1] Unparseable stateless payload, skipping:`,e.slice(0,100))}function IZ(e){qa(e)}function LZ(e){lo(e)}function RZ(e){bl([e.ch])}function zZ(e){let t=Wt(e);if(t)return{scope:`project`,name:t};let n=Xr(e);return n?.kind===`skill`?{scope:n.scope,name:n.name}:null}function BZ(e,t){let n=new Set(t.map(e=>`${e.scope}\u0000${e.name}`)),r=[];for(let t of e){let e=zZ(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:wr(i,e.name)}):r.push({kind:`close`,docName:t})}return r}function VZ(){let e=(0,$.c)(13),{openTabs:t,closeDocument:n}=mt(),r;e[0]===t?r=e[1]:(r=t.some(UZ),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=ua(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(HZ).sort().join(``)}`;if(s.current===r)return;s.current=r;let i=BZ(t,e);for(let e of i)e.kind===`retarget`?(Jo(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 HZ(e){return`${e.scope}\u0000${e.name}`}function UZ(e){return zZ(e)!==null}var WZ=1e3,GZ=3e4;function KZ(e){let t=e.scheduler??{setTimeout:(e,t)=>globalThis.setTimeout(e,t),clearTimeout:e=>globalThis.clearTimeout(e)},n=e.initialBackoffMs??WZ,r=e.maxBackoffMs??GZ,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 qZ(e){if(e)return e.replace(/\/collab\/?$/,``)}function JZ(){return we(window)!==null}function YZ(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??KZ;if((i.current?.isElectronHost??JZ)())return;let t=e({resolveWsUrl:async()=>qZ(r.current)});return()=>t.close()},c=[],n[3]=s,n[4]=c):(s=n[3],c=n[4]),(0,Q.useEffect)(s,c)}var XZ=(0,Q.lazy)(()=>n(()=>import(`./ShareBranchSwitchDialog-Bo95Aacz.js`).then(e=>({default:e.ShareBranchSwitchDialog})),__vite__mapDeps([95,1,6,7,13,54,16,17,55,61,63,96,97,98,99,10,3,11]),import.meta.url)),ZZ=(0,Q.lazy)(()=>n(()=>import(`./ShareReceiveMissDialog-8HKZBtux.js`).then(e=>({default:e.ShareReceiveMissDialog})),__vite__mapDeps([100,1,54,6,7,16,13,17,55,101,78,10,3,11,51,52,36,33,30,57,62,63,96,80,35,32,38]),import.meta.url)),QZ=`#install-claude-desktop`;function $Z(e){return e===`#settings`||e===QZ}function eQ(e,t,n){return[e,t,n].map(e=>[...e].sort().join(`\0`)).join(``)}function tQ(){let e=(0,$.c)(23),{clearTarget:t,syncOpenTabsWithKnownTargets:n,tabSessionLoaded:r}=mt(),{openTargetTransition:i}=Dt();VZ();let{assetPaths:a,folderPaths:o,loading:s,pageMeta:c,pages:l,pagesBySlug:u,pagesByBasename:d}=Yi(),f=(0,Q.useRef)(null),p;e[0]!==a||e[1]!==o||e[2]!==l?(p=eQ(l,o,a),e[0]=a,e[1]=o,e[2]=l,e[3]=p):p=e[3];let m=p,h,g;e[4]!==a||e[5]!==o||e[6]!==s||e[7]!==l||e[8]!==n||e[9]!==r||e[10]!==m?(h=()=>{s||!r||f.current===m||(f.current=m,n({pages:l,folderPaths:o,assetPaths:a}))},g=[a,o,s,l,n,r,m],e[4]=a,e[5]=o,e[6]=s,e[7]=l,e[8]=n,e[9]=r,e[10]=m,e[11]=h,e[12]=g):(h=e[11],g=e[12]),(0,Q.useEffect)(h,g);let _,v;return e[13]!==t||e[14]!==o||e[15]!==s||e[16]!==i||e[17]!==c||e[18]!==l||e[19]!==d||e[20]!==u?(_=()=>{e();function e(){if($Z(window.location.hash))return;let e=ll(window.location.hash);if(e){let t=Gn(e.split(`.`).pop()??``);wl(`ok/nav/hash-change`,{docName:null,kind:`asset`}),i({kind:`asset`,target:e,assetPath:e,mediaKind:t});return}let n=nl(window.location.hash);if(n){wl(`ok/nav/hash-change`,{docName:null,kind:`skill-file`}),i({kind:`skill-file`,target:`${n.scope}/${n.name}/${n.path}`,scope:n.scope,name:n.name,path:n.path});return}if(ml(window.location.hash)){wl(`ok/nav/hash-change`,{docName:null,kind:`folder`}),i({kind:`folder`,target:``,folderPath:``});return}let r=dl(window.location.hash);if(!r){wl(`ok/nav/hash-change`,{docName:null,kind:`clear`}),t();return}if(s){wl(`ok/nav/hash-change`,{docName:r,kind:`deferred-loading`});return}let a=hl(r,{pages:l,folderPaths:o,pagesBySlug:u,pagesByBasename:d});if(a.kind===`missing`&&/\/+$/.test(r.trim())){wl(`ok/nav/hash-change`,{docName:r,kind:`deferred-missing-folder`});return}let f=_l(il(a),c);wl(`ok/nav/hash-change`,{docName:r,kind:f.kind}),i(f)}return window.addEventListener(`hashchange`,e),()=>window.removeEventListener(`hashchange`,e)},v=[t,o,s,i,c,l,u,d],e[13]=t,e[14]=o,e[15]=s,e[16]=i,e[17]=c,e[18]=l,e[19]=d,e[20]=u,e[21]=_,e[22]=v):(_=e[21],v=e[22]),(0,Q.useEffect)(_,v),null}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)(rQ,t),null}function rQ(){let e=oQ;if(!e(window.location.hash))return;let t=new AbortController;return c(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(aQ))}).catch(iQ),()=>t.abort()}function iQ(){}function aQ(){}function oQ(e){return!$Z(e)&&!ll(e)&&!dl(e)&&(e===``||e===`#`||e===`#/`)}function sQ(){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)(cQ,t),null}function cQ(){let e=function(e){let t=e.target;Ga({target:t,metaKey:e.metaKey,ctrlKey:e.ctrlKey,altKey:e.altKey,key:e.key})&&(e.preventDefault(),window.location.hash!==`#settings`&&(window.location.hash=Ua))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)}function lQ(){let e=(0,$.c)(4),{activeTarget:t}=mt(),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 uQ(){let e=(0,$.c)(8),{activeDocName:t,activeTarget:n}=mt(),[r,i]=(0,Q.useState)(!1),a;e[0]!==t||e[1]!==n?(a=n?.kind===`folder`?n.folderPath:Jc(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;lh({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)(dh,{open:r,onOpenChange:i,kind:`file`,initialDir:o}),e[5]=r,e[6]=o,e[7]=l):l=e[7],l}function dQ(e){let t=(0,$.c)(3),{children:n}=e,{collabUrl:r}=mt();YZ(r);let i;return t[0]!==n||t[1]!==r?(i=(0,Z.jsx)(No,{collabUrl:r,children:n}),t[0]=n,t[1]=r,t[2]=i):i=t[2],i}function fQ(){let e=(0,$.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,Z.jsx)(Tl,{name:`app`,children:(0,Z.jsx)(Pt,{children:(0,Z.jsx)(dQ,{children:(0,Z.jsx)(ig,{children:(0,Z.jsx)(pQ,{})})})})}),e[0]=t):t=e[0],t}function pQ(){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=sg(),o;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(o=t?{launchInTerminal:mQ}:null,e[0]=o):o=e[0];let s=o,c;e[1]===Symbol.for(`react.memo_cache_sentinel`)?(c=(0,Z.jsx)(Pg,{}),e[1]=c):c=e[1];let l,u,d,f,p;e[2]===Symbol.for(`react.memo_cache_sentinel`)?(l=(0,Z.jsx)(MZ,{}),u=(0,Z.jsx)(tQ,{}),d=(0,Z.jsx)(nQ,{}),f=(0,Z.jsx)(lQ,{}),p=(0,Z.jsx)(uQ,{}),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)(sQ,{}),e[7]=a,e[8]=m);let h,g,_,v;e[9]===Symbol.for(`react.memo_cache_sentinel`)?(_=!1,v=t?(0,Z.jsx)(Fg,{bridge:t}):null,h=(0,Z.jsx)(kZ,{}),g=t?(0,Z.jsxs)(Q.Suspense,{fallback:null,children:[(0,Z.jsx)(XZ,{bridge:t}),(0,Z.jsx)(ZZ,{})]}):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)(Cg,{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)(bZ,{onOpenSearch:()=>i(!0)}),e[16]=a,e[17]=x);let S;e[18]===Symbol.for(`react.memo_cache_sentinel`)?(S=(0,Z.jsx)(Oj,{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)(fa,{value:s,children:(0,Z.jsxs)(Sj,{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)(Zi,{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 mQ(e,t){jF(Sa(e,t),t)}function hQ(e){let t=/\/([^/]+?)(?:\.git)?\/?$/.exec(e);return t?t[1]:`repo`}function gQ(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=hQ(t),a=`${r.replace(/\/$/,``)}/${i}`,o=hs.loading(Wc._({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);hs.loading(Wc._({id:`GXf9hG`,values:{repoName:i}}),{id:o,description:Wc._({id:`SCzAbA`,values:{phase:t,pct:n}}),duration:1/0});continue}if(e.type===`branch-fallback`){console.log(Yu({branch_action:`fallback`,branch:e.branch})),hs.info(Wc._({id:`3JYy1p`,values:{0:e.branch}}),{duration:8e3});continue}if(e.type===`complete`)return hs.success(Wc._({id:`IRv9cH`,values:{repoName:i}}),{id:o,duration:4e3}),{kind:`ok`,dir:e.dir};if(e.type===`error`)return hs.dismiss(o),{kind:`error`,detail:e.message}}return hs.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 hs.dismiss(o),{kind:`error`,detail:t}}}}}function _Q(){return{start(e){return Na((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=ni.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 vQ(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 yQ(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 bQ(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 xQ(e){let t=(0,$.c)(100),{open:n,onOpenChange:r,onSignIn:i,onCloneComplete:a,transport:o,authQueryTransport:s,pickParentFolder:c,initialUrl:l}=e,{_:u}=$t(),d;t[0]===o?d=t[1]:(d=o??_Q(),t[0]=o,t[1]=d);let f=d,p;t[2]===s?p=t[3]:(p=s??co(),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=po(),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=>{ao(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=bQ(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=bQ(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){hs.error(u({id:`FTUGgh`}));return}let t=v||``;if(c){O(!0);let n=await c();if(!n){O(!1);return}let r=bQ(e);t=`${n.replace(/\/$/,``)}/${r}`}else O(!0);let n=hs.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(yQ(i.phase));hs.loading(`${e} — ${i.pct}%`,{id:n})}else if(i.type===`complete`){hs.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;hs.error(u({id:`eFJkVt`,values:{cloneError:e}}),{id:n}),O(!1),N.current=null;return}t=await e.next()}hs.error(u({id:`Tz9pJB`}),{id:n}),O(!1),N.current=null}catch(e){console.error(`[CloneDialog] clone iteration failed:`,e),hs.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),hs.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(DQ)):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)(Js,{children:(0,Z.jsx)(Ws,{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)(Hc,{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)($e,{open:ge,onOpenChange:A,children:[(0,Z.jsx)(Oe,{asChild:!0,children:(0,Z.jsx)(Hc,{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)(yt,{align:`start`,sideOffset:4,className:`w-(--radix-popover-trigger-width) max-h-56 overflow-y-auto overscroll-y-contain subtle-scrollbar p-0`,onOpenAutoFocus:EQ,onCloseAutoFocus:TQ,onInteractOutside:e=>{F.current?.contains(e.target)&&e.preventDefault()},onWheel:wQ,onTouchMove:CQ,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)(Ba,{className:`h-4 w-2/3`}),(0,Z.jsx)(Ba,{className:`h-4 w-1/2`}),(0,Z.jsx)(Ba,{className:`h-4 w-3/4`}),(0,Z.jsx)(Ba,{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:SQ,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)(Xd,{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)(Ji,{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)(Hc,{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)(Ks,{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 ke;t[87]!==D||t[88]!==re||t[89]!==se||t[90]!==g||t[91]!==h?(ke=(0,Z.jsx)(qs,{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]=ke):ke=t[92];let Ae;t[93]!==De||t[94]!==ke?(Ae=(0,Z.jsxs)(Gs,{className:`sm:max-w-lg`,children:[Ce,De,ke]}),t[93]=De,t[94]=ke,t[95]=Ae):Ae=t[95];let je;return t[96]!==se||t[97]!==n||t[98]!==Ae?(je=(0,Z.jsx)(Ys,{open:n,onOpenChange:se,children:Ae}),t[96]=se,t[97]=n,t[98]=Ae,t[99]=je):je=t[99],je}function SQ(e){return e.preventDefault()}function CQ(e){return e.stopPropagation()}function wQ(e){return e.stopPropagation()}function TQ(e){return e.preventDefault()}function EQ(e){return e.preventDefault()}function DQ(e){return Math.max(e-1,-1)}var OQ=(0,Q.lazy)(()=>n(()=>import(`./ConsentDialogBody-Bza0TMPd.js`),__vite__mapDeps([102,1,6,7,73,16,13,17,56,18,57,53,54,55,59,103,75,76,15,19,20,62,65,81]),import.meta.url));function kQ(){let e=(0,$.c)(1);if(!(0,Q.useSyncExternalStore)(Vc.subscribe,jQ,AQ))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)(OQ,{})}),e[0]=t):t=e[0],t}function AQ(){return!1}function jQ(){return Vc.getSnapshot()!==null}function MQ(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 NQ=(0,Q.lazy)(()=>n(()=>import(`./ShareReceiveDialog-jEI9GD0l.js`).then(e=>({default:e.ShareReceiveDialog})),__vite__mapDeps([104,1,10,3,11,6,7,13,54,16,17,55,63,97,98,99]),import.meta.url)),PQ=(e,t,n)=>tg(e,t,n,`NavigatorApp`);function FQ(e,t){return e.filter(e=>e.path!==t)}function IQ(e){let t=(0,$.c)(122),{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)(null),[p,m]=(0,Q.useState)(null),[h,g]=(0,Q.useState)(!1),[_,v]=(0,Q.useState)(!1),[y,b]=(0,Q.useState)(!1),[x,S]=(0,Q.useState)(!1),[C,w]=(0,Q.useState)(null),T=typeof window<`u`&&window.okDesktop!=null,[E,D]=(0,Q.useState)(`auth`),{theme:O}=Mn(),{_:k}=$t();Mo(n,O??`system`);let A;t[2]!==k||t[3]!==n.project?(A=()=>{let e=!1;return n.project.listRecent().then(async t=>{if(e)return;a(t);let r=t.filter(LQ),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||f(t instanceof Error?t.message:k({id:`fYKgzG`}))}).finally(()=>{e||u(!1)}),()=>{e=!0}},t[2]=k,t[3]=n.project,t[4]=A):A=t[4];let j;t[5]!==k||t[6]!==n?(j=[n,k],t[5]=k,t[6]=n,t[7]=j):j=t[7],(0,Q.useEffect)(A,j);let M,N;t[8]===n?(M=t[9],N=t[10]):(M=()=>n.onMenuAction(e=>{e===`new-project`&&v(!0),e===`close-active-tab-or-window`&&window.close()}),N=[n],t[8]=n,t[9]=M,t[10]=N),(0,Q.useEffect)(M,N);let P;t[11]===Symbol.for(`react.memo_cache_sentinel`)?(P=(e,t)=>PQ(e,t,f),t[11]=P):P=t[11];let F=P,I;t[12]!==k||t[13]!==n?(I=(e,t,r)=>F(()=>(m(r),BQ(n,e,t).finally(()=>m(null))),k({id:`SUOoXn`})),t[12]=k,t[13]=n,t[14]=I):I=t[14];let L=I,R;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(R=()=>g(!0),t[15]=R):R=t[15];let z=R,B;t[16]!==k||t[17]!==n?(B=()=>F(async()=>{let e=await n.dialog.openFolder();e&&(m(VQ(e)),await BQ(n,e,`pick-existing`).finally(()=>m(null)))},k({id:`gmJ0An`})),t[16]=k,t[17]=n,t[18]=B):B=t[18];let V=B,H;t[19]===Symbol.for(`react.memo_cache_sentinel`)?(H=()=>v(!0),t[19]=H):H=t[19];let U=H,W;t[20]===L?W=t[21]:(W=e=>L(e,`recents`,VQ(e)),t[20]=L,t[21]=W);let G=W,K;t[22]!==k||t[23]!==n.project?(K=e=>F(async()=>{await n.project.removeRecent(e),a(t=>FQ(t,e)),c(t=>{if(!t.has(e))return t;let n=new Map(t);return n.delete(e),n})},k({id:`viwC-K`})),t[22]=k,t[23]=n.project,t[24]=K):K=t[24];let ee=K,te;t[25]===Symbol.for(`react.memo_cache_sentinel`)?(te=(0,Z.jsx)(`div`,{className:`pointer-events-none absolute inset-x-0 top-0 z-10 h-9 ${T?`[-webkit-app-region:drag]`:``}`,"data-electron-drag":T?``:void 0,"data-testid":`nav-chrome-row`}),t[25]=te):te=t[25];let ne;t[26]!==k||t[27]!==p?(ne=p===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)($o,{className:`size-6 animate-spin text-muted-foreground`}),(0,Z.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:k({id:`s0_GnA`,values:{openingLabel:p}})})]}),t[26]=k,t[27]=p,t[28]=ne):ne=t[28];let re;t[29]===Symbol.for(`react.memo_cache_sentinel`)?(re=(0,Z.jsx)(MQ,{className:`size-12 shrink-0`}),t[29]=re):re=t[29];let ie;t[30]===Symbol.for(`react.memo_cache_sentinel`)?(ie=(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)(TN,{})]}),t[30]=ie):ie=t[30];let ae;t[31]===n.appVersion?ae=t[32]:(ae=(0,Z.jsxs)(`header`,{className:`shrink-0 flex-wrap flex items-center gap-2.5`,children:[re,(0,Z.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[ie,(0,Z.jsxs)(`p`,{className:`text-muted-foreground text-xs font-mono`,children:[`v`,n.appVersion]})]})]}),t[31]=n.appVersion,t[32]=ae);let oe;t[33]===k?oe=t[34]:(oe=k({id:`wbv9xO`}),t[33]=k,t[34]=oe);let se;t[35]===k?se=t[36]:(se=k({id:`0uTHCg`}),t[35]=k,t[36]=se);let ce;t[37]!==oe||t[38]!==se?(ce=(0,Z.jsx)(RQ,{title:oe,description:se,onClick:U,dataTestId:`nav-create-new`,Icon:Zt}),t[37]=oe,t[38]=se,t[39]=ce):ce=t[39];let le;t[40]===k?le=t[41]:(le=k({id:`WPwDin`}),t[40]=k,t[41]=le);let q;t[42]===k?q=t[43]:(q=k({id:`tUvUfp`}),t[42]=k,t[43]=q);let ue;t[44]!==V||t[45]!==le||t[46]!==q?(ue=(0,Z.jsx)(RQ,{title:le,description:q,onClick:V,dataTestId:`nav-open`,Icon:Fo}),t[44]=V,t[45]=le,t[46]=q,t[47]=ue):ue=t[47];let de;t[48]===k?de=t[49]:(de=k({id:`VdXv4D`}),t[48]=k,t[49]=de);let fe;t[50]===k?fe=t[51]:(fe=k({id:`JOcPqH`}),t[50]=k,t[51]=fe);let pe;t[52]!==de||t[53]!==fe?(pe=(0,Z.jsx)(RQ,{title:de,description:fe,onClick:z,dataTestId:`nav-clone`,Icon:oF}),t[52]=de,t[53]=fe,t[54]=pe):pe=t[54];let me;t[55]!==ce||t[56]!==ue||t[57]!==pe?(me=(0,Z.jsxs)(`section`,{className:`grid shrink-0 sm:grid-cols-3 gap-3`,children:[ce,ue,pe]}),t[55]=ce,t[56]=ue,t[57]=pe,t[58]=me):me=t[58];let he;t[59]===d?he=t[60]:(he=d===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:d}),(0,Z.jsx)(X,{type:`button`,variant:`link`,size:`sm`,onClick:()=>f(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[59]=d,t[60]=he);let ge;t[61]!==l||t[62]!==G||t[63]!==ee||t[64]!==s||t[65]!==i?(ge=l?(0,Z.jsx)(`section`,{className:`flex shrink-0 flex-col items-center`,children:(0,Z.jsx)($o,{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)(zQ,{project:e,branch:s.get(e.path)??null,onOpen:()=>G(e.path),onRemove:()=>ee(e.path)},e.path))})]}):null,t[61]=l,t[62]=G,t[63]=ee,t[64]=s,t[65]=i,t[66]=ge):ge=t[66];let _e;t[67]!==ae||t[68]!==me||t[69]!==he||t[70]!==ge?(_e=(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:[ae,me,he,ge]})}),t[67]=ae,t[68]=me,t[69]=he,t[70]=ge,t[71]=_e):_e=t[71];let ve,ye;t[72]===Symbol.for(`react.memo_cache_sentinel`)?(ve=(0,Z.jsx)(kZ,{}),ye=(0,Z.jsx)(kQ,{}),t[72]=ve,t[73]=ye):(ve=t[72],ye=t[73]);let be;t[74]!==n||t[75]!==_?(be=(0,Z.jsx)(sm,{open:_,onOpenChange:v,bridge:n}),t[74]=n,t[75]=_,t[76]=be):be=t[76];let xe;t[77]===C?xe=t[78]:(xe=e=>{b(e),e||(S(!1),C&&(C(null),w(null)))},t[77]=C,t[78]=xe);let Se;t[79]===n?Se=t[80]:(Se=ka(n),t[79]=n,t[80]=Se);let Ce;t[81]===n?Ce=t[82]:(Ce=Ma(n),t[81]=n,t[82]=Ce);let we=E===`identity`,Te;t[83]!==x||t[84]!==C?(Te=e=>{b(!1),x&&(S(!1),g(!0)),C&&(C({authenticated:!0,host:`github.com`,login:e.login}),w(null))},t[83]=x,t[84]=C,t[85]=Te):Te=t[85];let Ee;t[86]!==y||t[87]!==xe||t[88]!==Se||t[89]!==Ce||t[90]!==we||t[91]!==Te?(Ee=(0,Z.jsx)(Ha,{open:y,onOpenChange:xe,transport:Se,queryTransport:Ce,identityPrompt:we,onSuccess:Te}),t[86]=y,t[87]=xe,t[88]=Se,t[89]=Ce,t[90]=we,t[91]=Te,t[92]=Ee):Ee=t[92];let De;t[93]===n?De=t[94]:(De=vQ(n),t[93]=n,t[94]=De);let Oe;t[95]===n?Oe=t[96]:(Oe=Ma(n),t[95]=n,t[96]=Oe);let ke;t[97]===n.dialog?ke=t[98]:(ke=()=>n.dialog.openFolder(),t[97]=n.dialog,t[98]=ke);let Ae;t[99]===Symbol.for(`react.memo_cache_sentinel`)?(Ae=()=>{g(!1),D(`auth`),S(!0),b(!0)},t[99]=Ae):Ae=t[99];let je;t[100]!==k||t[101]!==n?(je=e=>{let{dir:t}=e;F(()=>(m(VQ(t)),BQ(n,t,`pick-existing`).finally(()=>m(null))),k({id:`iSnkwB`}))},t[100]=k,t[101]=n,t[102]=je):je=t[102];let Me;t[103]!==h||t[104]!==De||t[105]!==Oe||t[106]!==ke||t[107]!==je?(Me=(0,Z.jsx)(xQ,{open:h,onOpenChange:g,transport:De,authQueryTransport:Oe,pickParentFolder:ke,onSignIn:Ae,onCloneComplete:je}),t[103]=h,t[104]=De,t[105]=Oe,t[106]=ke,t[107]=je,t[108]=Me):Me=t[108];let Ne;if(t[109]!==n){let e;t[111]===Symbol.for(`react.memo_cache_sentinel`)?(e=()=>new Promise(e=>{w(()=>e),b(!0)}),t[111]=e):e=t[111],Ne=gQ({bridge:n,authQueryTransport:Ma(n),cloneTransport:vQ(n),openSignIn:e}),t[109]=n,t[110]=Ne}else Ne=t[110];let Pe;t[112]!==n||t[113]!==Ne?(Pe=(0,Z.jsx)(Q.Suspense,{fallback:null,children:(0,Z.jsx)(NQ,{bridge:n,cloneController:Ne})}),t[112]=n,t[113]=Ne,t[114]=Pe):Pe=t[114];let Fe;return t[115]!==ne||t[116]!==_e||t[117]!==be||t[118]!==Ee||t[119]!==Me||t[120]!==Pe?(Fe=(0,Z.jsxs)(`div`,{className:`relative flex h-screen w-screen flex-col overflow-hidden bg-primary-foreground dark:bg-background text-foreground`,children:[te,ne,_e,ve,ye,be,Ee,Me,Pe]}),t[115]=ne,t[116]=_e,t[117]=be,t[118]=Ee,t[119]=Me,t[120]=Pe,t[121]=Fe):Fe=t[121],Fe}function LQ(e){return!e.missing}function RQ(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 zQ(e){let t=(0,$.c)(44),{project:n,branch:r,onOpen:i,onRemove:a}=e,{_:o}=$t(),{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)(Rd,{"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)(qe,{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)(Io,{"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:ug(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)(qe,{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)(Io,{"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)(gs,{"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 BQ(e,t,n){await e.project.open({path:t,target:`new-window`,entryPoint:n})}function VQ(e){let t=e.split(/[/\\]/).filter(Boolean);return t.length>0?t[t.length-1]??e:e}function HQ(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)(UQ,{bridge:n}),t[0]=n,t[1]=i);let a;return t[2]!==r||t[3]!==i?(a=(0,Z.jsx)(No,{collabUrl:r,children:i}),t[2]=r,t[3]=i,t[4]=a):a=t[4],a}function UQ(e){let t=(0,$.c)(11),{bridge:n}=e,{resolvedTheme:r}=Mn(),i=Yg(),[a,o]=(0,Q.useState)(null),s;t[0]===r?s=t[1]:(s=Cu(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)(YF,{bridge:n,variant:`window`,visible:!0,onVisibleChange:GQ,installedClis:i,container:a,isShowing:!0,onRequestEditorFocus:WQ}),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 WQ(){}function GQ(e){e||window.close()}function KQ(e){return e?.config.mode===`terminal`?(0,Z.jsx)(HQ,{bridge:e}):e?.config.mode===`navigator`?(0,Z.jsx)(IQ,{bridge:e}):(0,Z.jsx)(fQ,{})}var qQ=e=>{let t=(0,$.c)(8),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let{theme:r}=Mn(),i=r===void 0?`system`:r,a,o;t[2]===Symbol.for(`react.memo_cache_sentinel`)?(a={success:(0,Z.jsx)(Xi,{className:`size-4`}),info:(0,Z.jsx)(Qo,{className:`size-4`}),warning:(0,Z.jsx)(os,{className:`size-4`}),error:(0,Z.jsx)(ef,{className:`size-4`}),loading:(0,Z.jsx)($o,{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)(_s,{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},JQ=Symbol.for(`ok.client.fetchWrapper`);function YQ(e={}){if(typeof window>`u`)return;let t=e.apiOrigin&&e.apiOrigin.length>0?e.apiOrigin:void 0;if(window.fetch[JQ])return;let n=window.fetch.bind(window),r=Ao(),i=((e,i)=>{let a=ZQ(e,t);if(!a.isApi)return n(e,i);if(e instanceof Request){let t=XQ(e.headers,r);return n(new Request(a.url,e),{headers:t})}let o=XQ(i?.headers,r);return n(a.url,{...i,headers:o})});i[JQ]=!0,window.fetch=i}function XQ(e,t){let n=new Headers(e);for(let[e,r]of Object.entries(t))n.set(e,r);return n}function ZQ(e,t){if(typeof e==`string`){if(e.startsWith(`/api/`))return{isApi:!0,url:t?t+e:e};let n=QQ(e);return n&&$Q(n,t)?{isApi:!0,url:e}:{isApi:!1,url:e}}let n=e instanceof URL?e:QQ(e.url,window.location.origin);if(n&&$Q(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 QQ(e,t){try{return new URL(e,t)}catch{return null}}function $Q(e,t){if(!e.pathname.startsWith(`/api/`))return!1;if(e.origin===window.location.origin||e.protocol===`file:`)return!0;if(t){let n=QQ(t);if(n&&e.origin===n.origin)return!0}return!1}var e$={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"],"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."],"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"],"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"],"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"],"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"],"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"],"Aj1D9r":["Hide worktrees"],"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"],"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"]],"D12vtS":["(detached)"],"D4H2N6":["Remove ",["tag"]],"D8OV7J":["Only collaborators"],"DDTdLl":["Code block settings"],"DELNQk":["Collaborators see your in-progress edits as soon as they sync."],"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"],"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"],"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"],")"],"INEQsp":["Items to be created"],"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"]],"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:"],"LlHqdU":["Initializing project"],"Llyqvo":["This usually means one of:"],"LpB85N":["Plain"],"LtI9AS":["Owner"],"LtSYdi":["Reveal in Finder"],"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"],"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"],"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"]],"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"],"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"],"PZt1uN":["Search files, commands, projects, and AI handoff actions."],"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"],"QWks14":["A short line shown under the name in the template list."],"QYfQdv":[["displayName"]," CLI"],"QcpeeE":["Navigate to ",["docName"]],"QfFBdJ":["The template's filename (without \`.md\`)."],"Qj4RL5":["Completed:"],"QlxHAH":["Showing results for \\"",["semanticResultsLabel"],"\\""],"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"],"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."],"Sfh6zL":["The file on disk, and the id agents use. It can't be changed later."],"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>"],"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"],"UaRsDu":["Show worktrees"],"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."],"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."],"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."],"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"],"YGQm6y":["OpenKnowledge manages the <0>open-knowledge</0> MCP server name, the <1>open-knowledge-ui</1> launch config, and <2>ok</2> / <3>open-knowledge</3> on PATH (including OK-owned symlinks). Using a custom wrapper? Register it under a different name."],"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"],"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."],"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"],")"],"_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"]],"_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"],"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"],"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"],"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"]],"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"],"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"],"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"],"gYz2ep":["Expires in ",["timeLabel"]],"gbHcbI":["Failed to delete property"],"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"],"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"],"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"],"ij5sBu":[["0","plural",{"one":["worktree"],"other":["worktrees"]}]],"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"],"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"],"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"],"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"],"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."],"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"],"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"]}]],"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"],"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"],"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"],")"],"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"]}]],"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"],"vM7XUh":["Add OpenKnowledge to your AI tools"],"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"],"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"]],"yf5r22":[["keyName"]," type: ",["typeLabel"]," (inherited from folder properties; not editable here)"],"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"],"yu8Pzy":["Not detected"],"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."],"zTHnl4":["Files & folders"],"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"]}`)},t$=`en`;Wc.load(t$,e$.messages),Wc.activate(t$);var n$=Symbol.for(`ok.client.logForwarder`),r$=2e3,i$=[`log`,`info`,`warn`,`error`],a$={log:`info`,info:`info`,warn:`warn`,error:`error`};function o$(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 s$(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 c$(e={}){let t=e.windowObj??(typeof window<`u`?window:void 0);if(!t||t.okDesktop)return;let n=t;if(n[n$])return;n[n$]=!0;let r=e.consoleObj??console,i=e.documentObj===void 0?typeof document<`u`?document:null:e.documentObj,a=e.flushIntervalMs??r$,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+=s$(e),c.length>100){let e=c.shift();e&&(l-=s$(e))}if(c.length>=100||l>=32768){p();return}u===null&&(u=setTimeout(p,a))}function h(e,t){if(!d)try{let n=lr(t.map(o$).join(` `)),r=t[0],i=typeof r==`string`&&r.length<=32768?r:void 0,a=i?Er(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 i$)r[e]=(...t)=>{f[e](...t),h(a$[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: ${o$(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 i$)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[n$]}return{flushNow:p,uninstall:b}}function l$(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 u$(e){let t=e.bridge;if(!t)return;let n=e.setHash??(e=>{window.location.hash=e}),r=e.emitToast??((e,t)=>{hs(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){es.arm(a);return}Si.arm(a),n(al(i,e.doc,i===`doc`?e.branch:void 0));let o=l$(e,t.config.projectPath);o!==null&&r(o.message,{description:o.description,duration:3e3})})}var d$=4e3,f$=1440*60*1e3;function p$(e){let t=e.bridge;if(t&&t.onboarding)return t.onboarding.onToast(e=>{if(e.kind===`ancestor-promote`){hs.success(`Opened existing OpenKnowledge project at ${e.ancestorPath}`,{duration:d$});return}if(e.kind===`startup-reclaim`){let t=[];if(e.mcp.status===`repaired`){let n=e.mcp.editors.map(e=>Br[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`;hs[r?`error`:`success`](n,{duration:r||i?f$:d$});return}if(e.kind===`sharing-refused-tracked`){hs.error(`Config sharing unchanged: ${e.tracked.length} OK file(s) tracked upstream — see message below.`,{duration:f$,description:e.remediation});return}if(e.kind===`sharing-no-git`){hs.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:d$});return}let t=Bc(e.gitRoot,e.pickedPath)??e.pickedPath;hs.success(`Initialized OpenKnowledge at ${e.gitRoot} — opened parent of ${t} because it contains a .git folder`,{duration:d$})})}function m$(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)(os,{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 Wc._({id:`f_PkYv`})}function g$(e){return e.serverRuntime===e.appRuntime?Wc._({id:`FWQuPE`,values:{0:e.appRuntime}}):e.relation===`older`?Wc._({id:`LhQlGR`,values:{0:e.serverRuntime,1:e.appRuntime}}):Wc._({id:`yZmvQ4`,values:{0:e.serverRuntime,1:e.appRuntime}})}function _$(e){return Wc._({id:`2YOwme`,values:{appRuntime:e}})}function v$(e){return Wc._({id:`5DFPDh`,values:{appRuntime:e}})}function y$(e){return e===`eperm`?Wc._({id:`uQewpR`}):Wc._({id:`PqYWiC`})}async function b$(e){let t=hs.loading(Wc._({id:`Kf7GG5`}),{duration:1/0}),n;try{n=await e.restartServer(e.config.projectPath)}catch{return}hs.dismiss(t),n.ok===!1&&hs.error(y$(n.reason),{duration:1/0})}function x$(e){let t=e.bridge;if(!t)return;let n=t.onServerVersionDrift(e=>{hs.custom(n=>(0,Q.createElement)(m$,{body:g$(e),warning:h$(),restartLabel:Wc._({id:`ppDgFi`}),cancelLabel:Wc._({id:`PBxg_E`}),onRestart:()=>{hs.dismiss(n),b$(t)},onDismiss:()=>hs.dismiss(n)}),{duration:1/0})}),r=t.onServerRestarted(e=>{hs.success(_$(e.appRuntime))}),i=t.onServerReclaimed(e=>{hs.warning(v$(e.appRuntime),{duration:15e3})});return()=>{n(),r(),i()}}function S$(e){let{initialDoc:t}=e;if(!t)return;let n=e.getHash();n!==``&&n!==`#`&&n!==`#/`||e.setHash(fl(t))}function C$(){typeof window>`u`||!window.okDesktop||S$({initialDoc:window.okDesktop.config.initialDoc,getHash:()=>window.location.hash,setHash:e=>{window.location.hash=e}})}Zu(),n(()=>import(`./telemetry-startup-ZaSL-kj2.js`).then(e=>e.initStartupTrace()),__vite__mapDeps([105,0,1,2,3,4,34,7]),import.meta.url),YQ({apiOrigin:typeof window<`u`?window.okDesktop?.config.apiOrigin:void 0}),c$(),LT()&&UT(),sZ(),Jw(),iF(),aN(),typeof window<`u`&&u$({bridge:window.okDesktop}),typeof window<`u`&&x$({bridge:window.okDesktop}),typeof window<`u`&&Ju({bridge:window.okDesktop}),typeof window<`u`&&zc({bridge:window.okDesktop}),typeof window<`u`&&p$({bridge:window.okDesktop}),typeof window<`u`&&Xu({bridge:window.okDesktop}),C$();var w$=new od({defaultOptions:{queries:{retry:1,staleTime:1e4}}}),T$=document.getElementById(`root`);if(!T$)throw Error(`Root element not found`);var E$=typeof window>`u`?void 0:window.okDesktop;(0,_d.createRoot)(T$).render((0,Z.jsx)(Q.StrictMode,{children:(0,Z.jsx)(en,{i18n:Wc,children:(0,Z.jsx)(yn,{client:w$,children:(0,Z.jsxs)(Nn,{attribute:`class`,defaultTheme:`system`,enableSystem:!0,disableTransitionOnChange:!0,storageKey:`ok-theme-v1`,children:[(0,Z.jsx)(Ds,{children:KQ(E$)}),(0,Z.jsx)(qQ,{richColors:!0,closeButton:!0})]})})})}));
|