import{IF as P,JF as g,LF as m,Pt as T,RF as d,Tt as c}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{HX as h,YX as u,_V as S,rX as D,tX as X}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 A,DZ as _}from"./cli-0.5.12-c6whkxmz.mjs";import{EZ as I}from"./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{A6 as j,z6 as O}from"./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"./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}from"./cli-0.5.12-xzeb7mtb.mjs";j();u();c();d();_();var f=C(S(),1),l=C(I(),1),N=["◐","◓","◑","◒"],b=[{key:"validating",label:"Validating session"},{key:"fetching_logs",label:"Fetching session logs"},{key:"fetching_branch",label:"Getting branch info"},{key:"checking_out",label:"Checking out branch"}];function x(B){let q=f.c(16),{currentStep:y,sessionId:G}=B,[H,E]=h(100),J=Math.floor(E/100)%N.length,K;if(q[0]!==y)K=(Z)=>Z.key===y,q[0]=y,q[1]=K;else K=q[1];let z=b.findIndex(K),F=N[J],L;if(q[2]!==F)L=w(D,{marginBottom:1,children:A(X,{bold:!0,color:"claude",children:[F," Teleporting session…"]})}),q[2]=F,q[3]=L;else L=q[3];let Q;if(q[4]!==G)Q=G&&w(D,{marginBottom:1,children:w(X,{dimColor:!0,children:G})}),q[4]=G,q[5]=Q;else Q=q[5];let U;if(q[6]!==z||q[7]!==J)U=b.map((Z,M)=>{let a=M<z,R=M===z,W=M>z,k,v;if(a)k=O.tick,v="green";else if(R)k=N[J],v="claude";else k=O.circle,v=void 0;return A(D,{flexDirection:"row",children:[w(D,{width:2,children:w(X,{color:v,dimColor:W,children:k})}),w(X,{dimColor:W,bold:R,children:Z.label})]},Z.key)}),q[6]=z,q[7]=J,q[8]=U;else U=q[8];let V;if(q[9]!==U)V=w(D,{flexDirection:"column",marginLeft:2,children:U}),q[9]=U,q[10]=V;else V=q[10];let Y;if(q[11]!==H||q[12]!==L||q[13]!==Q||q[14]!==V)Y=A(D,{ref:H,flexDirection:"column",paddingX:1,paddingY:1,children:[L,Q,V]}),q[11]=H,q[12]=L,q[13]=Q,q[14]=V,q[15]=Y;else Y=q[15];return Y}async function n(B,q){let y=()=>{};function G(){let[K,z]=l.useState("validating");return y=z,w(x,{currentStep:K,sessionId:q})}B.render(w(T,{children:w(G,{})}));let H=await m(q,y);y("checking_out");let{branchName:E,branchError:J}=await g(H.branch);return{messages:P(H.log,J),branchName:E}}export{n as teleportWithProgress,x as TeleportProgress};
