import{Hc as v,Ic as d}from"./cli-0.5.12-y66stscm.mjs";import{Bf as D,xf as B,yf as j,zf as F}from"./cli-0.5.12-xdx5bcxv.mjs";import{Cm as I,Fk as U,Gk as _,Gm as u,Jk as g,Xk as A,al as m,sH as y,uH as P}from"./cli-0.5.12-zc0qwdy2.mjs";import"./cli-0.5.12-whfz3xsx.mjs";import"./cli-0.5.12-z100r543.mjs";import"./cli-0.5.12-bzab36pn.mjs";import"./cli-0.5.12-pp1549k7.mjs";import"./cli-0.5.12-9mq24qzr.mjs";import"./cli-0.5.12-7repzgzv.mjs";import"./cli-0.5.12-pdqnfqg3.mjs";import"./cli-0.5.12-c2yq69h9.mjs";import"./cli-0.5.12-kez9r81a.mjs";import"./cli-0.5.12-zbcr8cbk.mjs";import"./cli-0.5.12-2wf629mh.mjs";import"./cli-0.5.12-ghtxkxqx.mjs";import"./cli-0.5.12-xg7a0dy4.mjs";import"./cli-0.5.12-s0h788we.mjs";import"./cli-0.5.12-m22yxpb9.mjs";import"./cli-0.5.12-cw1qs4bg.mjs";import"./cli-0.5.12-yq8ds97a.mjs";import"./cli-0.5.12-qew4mzgp.mjs";import"./cli-0.5.12-gwg1e43k.mjs";import"./cli-0.5.12-36swspqa.mjs";import"./cli-0.5.12-4dn79vqp.mjs";import"./cli-0.5.12-f5pfjvdk.mjs";import{YX as c,_V as T,rX as V,tX as G}from"./cli-0.5.12-fqp5s15p.mjs";import"./cli-0.5.12-rc1p9wk6.mjs";import"./cli-0.5.12-x479axrj.mjs";import"./cli-0.5.12-ysy6e9rz.mjs";import"./cli-0.5.12-cqv7z22w.mjs";import"./cli-0.5.12-7cn41yy7.mjs";import"./cli-0.5.12-34cd39ve.mjs";import"./cli-0.5.12-m2gh4ewc.mjs";import{BZ as w,CZ as W,DZ as Z}from"./cli-0.5.12-c6whkxmz.mjs";import"./cli-0.5.12-w3hy6c60.mjs";import"./cli-0.5.12-5d3qcvf5.mjs";import"./cli-0.5.12-f141d2qa.mjs";import"./cli-0.5.12-khvy67r3.mjs";import"./cli-0.5.12-pycnjaeg.mjs";import"./cli-0.5.12-8v5w8znc.mjs";import"./cli-0.5.12-ctqkj6ve.mjs";import"./cli-0.5.12-cbevkwg4.mjs";import"./cli-0.5.12-w00qj83e.mjs";import"./cli-0.5.12-nbcjwzzn.mjs";import"./cli-0.5.12-3t06hwwh.mjs";import"./cli-0.5.12-057c2cp2.mjs";import"./cli-0.5.12-ecgx5n54.mjs";import"./cli-0.5.12-g4wb8mj2.mjs";import"./cli-0.5.12-vp5smcs1.mjs";import"./cli-0.5.12-y2kq7fe8.mjs";import"./cli-0.5.12-7vxpqr5a.mjs";import"./cli-0.5.12-hvtcdcev.mjs";import"./cli-0.5.12-asbn3d19.mjs";import"./cli-0.5.12-k1crwtdc.mjs";import"./cli-0.5.12-2jxq8gnm.mjs";import"./cli-0.5.12-p5ps8gf0.mjs";import"./cli-0.5.12-hp0508v9.mjs";import"./cli-0.5.12-tfdwzg37.mjs";import"./cli-0.5.12-60w1a0bs.mjs";import{rma as h,sla as R}from"./cli-0.5.12-c8f4daey.mjs";import"./cli-0.5.12-0qasc0ef.mjs";import"./cli-0.5.12-f8850v2j.mjs";import"./cli-0.5.12-495d826j.mjs";import"./cli-0.5.12-rt0k97yj.mjs";import"./cli-0.5.12-1vyz0tt9.mjs";import{Yna as C,aoa as N}from"./cli-0.5.12-xzeb7mtb.mjs";function $(z){let b=M.c(11),{planContent:H,planPath:K,editorName:J}=z,L;if(b[0]===Symbol.for("react.memo_cache_sentinel"))L=w(G,{bold:!0,children:"Current Plan"}),b[0]=L;else L=b[0];let k;if(b[1]!==K)k=w(G,{dimColor:!0,children:K}),b[1]=K,b[2]=k;else k=b[2];let q;if(b[3]!==H)q=w(V,{marginTop:1,children:w(G,{children:H})}),b[3]=H,b[4]=q;else q=b[4];let f;if(b[5]!==J)f=J&&W(V,{marginTop:1,children:[w(G,{dimColor:!0,children:'"/plan open"'}),w(G,{dimColor:!0,children:" to edit this plan in "}),w(G,{bold:!0,dimColor:!0,children:J})]}),b[5]=J,b[6]=f;else f=b[6];let O;if(b[7]!==k||b[8]!==q||b[9]!==f)O=W(V,{flexDirection:"column",children:[L,k,q,f]}),b[7]=k,b[8]=q,b[9]=f,b[10]=O;else O=b[10];return O}async function bb(z,b,H){let{getAppState:K,setAppState:J}=b,k=K().toolPermissionContext.mode;if(k!=="plan"){R(k,"plan"),J((Y)=>({...Y,toolPermissionContext:A(y(Y.toolPermissionContext),{type:"setMode",mode:"plan",destination:"session"})}));let Q=H.trim();if(Q&&Q!=="open")z("Enabled plan mode",{shouldQuery:!0});else z("Enabled plan mode");return null}let q=_(),f=U();if(!q)return z("Already in plan mode. No plan written yet."),null;if(H.trim().split(/\s+/)[0]==="open"){let Q=await F(f);if(Q.error)z(`Failed to open plan in editor: ${Q.error}`);else z(`Opened plan in editor: ${f}`);return null}let X=B(),S=X?I(X):void 0,E=await v(w($,{planContent:q,planPath:f,editorName:S}));return z(E),null}var M;var x=N(()=>{h();c();j();u();m();P();g();D();d();Z();M=C(T(),1)});x();export{bb as call};
