import{HD as A,JD as c,OD as O,PD as u,QD as _,RD as S,Ut as m,Yt as g,dm as f,em as v}from"./cli-0.5.4-k5fz4zd3.mjs";import"./cli-0.5.4-wbqf44ym.mjs";import"./cli-0.5.4-9ewg9gfs.mjs";import"./cli-0.5.4-we3mspgg.mjs";import"./cli-0.5.4-jzhazry0.mjs";import"./cli-0.5.4-82sw3hrw.mjs";import"./cli-0.5.4-31v143kt.mjs";import"./cli-0.5.4-1cy7wd6s.mjs";import"./cli-0.5.4-5e0pk96f.mjs";import"./cli-0.5.4-z154a7bp.mjs";import"./cli-0.5.4-ng5p0zjs.mjs";import"./cli-0.5.4-5hp7ks3t.mjs";import"./cli-0.5.4-8hdwp78f.mjs";import"./cli-0.5.4-mr9aznxx.mjs";import"./cli-0.5.4-jevfk5q7.mjs";import"./cli-0.5.4-27dzbzdy.mjs";import"./cli-0.5.4-a5bkdqqb.mjs";import"./cli-0.5.4-j2hnw539.mjs";import"./cli-0.5.4-9w59nnw4.mjs";import"./cli-0.5.4-z5d3q8kh.mjs";import"./cli-0.5.4-c0r12dqp.mjs";import"./cli-0.5.4-kqh172jk.mjs";import"./cli-0.5.4-vv4jbgkc.mjs";import{KW as K,MW as Z,nX as C,pX as R,rV as D}from"./cli-0.5.4-s7k1f0wc.mjs";import"./cli-0.5.4-0h0yz2k5.mjs";import"./cli-0.5.4-942dm5q1.mjs";import"./cli-0.5.4-rcmp5h4y.mjs";import"./cli-0.5.4-xdcww3x8.mjs";import"./cli-0.5.4-fq32ny1h.mjs";import"./cli-0.5.4-h1m67ngp.mjs";import"./cli-0.5.4-49erze3e.mjs";import"./cli-0.5.4-jytjks37.mjs";import{PY as G,QY as Y,RY as M}from"./cli-0.5.4-mn22gk7g.mjs";import"./cli-0.5.4-5t3jj85n.mjs";import"./cli-0.5.4-5shjmmkz.mjs";import"./cli-0.5.4-zb412kkm.mjs";import"./cli-0.5.4-prfn3sxd.mjs";import"./cli-0.5.4-6xmgebmk.mjs";import"./cli-0.5.4-vjgejcrz.mjs";import"./cli-0.5.4-jqt00ywx.mjs";import"./cli-0.5.4-9e7rkd8e.mjs";import"./cli-0.5.4-jp4wtw87.mjs";import"./cli-0.5.4-hambpq58.mjs";import"./cli-0.5.4-syvgmg9g.mjs";import"./cli-0.5.4-w8ttefr5.mjs";import"./cli-0.5.4-j7kkqxv6.mjs";import"./cli-0.5.4-qrwczx7j.mjs";import"./cli-0.5.4-v2z6p9td.mjs";import"./cli-0.5.4-cbq01zg3.mjs";import"./cli-0.5.4-37v5fhf1.mjs";import"./cli-0.5.4-7grzwf6q.mjs";import"./cli-0.5.4-9qmek5dq.mjs";import"./cli-0.5.4-9c6r1fjg.mjs";import"./cli-0.5.4-2dw33ms6.mjs";import"./cli-0.5.4-x1fzfxmm.mjs";import"./cli-0.5.4-e822fzaq.mjs";import"./cli-0.5.4-09dvrzcr.mjs";import{sfa as b,vfa as B,xfa as T}from"./cli-0.5.4-end8wj9r.mjs";import"./cli-0.5.4-4x206j04.mjs";import"./cli-0.5.4-yd3rd9qt.mjs";import"./cli-0.5.4-sgcaw17t.mjs";import"./cli-0.5.4-jmc3bzbn.mjs";import"./cli-0.5.4-959vxhhb.mjs";import{Vma as P}from"./cli-0.5.4-aacw1src.mjs";R();u();g();S();T();c();v();M();var h=P(D(),1);function p(J){let q=h.c(19),{filePath:L,errorDescription:Q,onExit:z,onReset:w}=J,k;if(q[0]!==z||q[1]!==w)k=(y)=>{if(y==="exit")z();else w()},q[0]=z,q[1]=w,q[2]=k;else k=q[2];let F=k,U;if(q[3]!==L)U=Y(Z,{children:["The configuration file at ",G(Z,{bold:!0,children:L})," contains invalid JSON."]}),q[3]=L,q[4]=U;else U=q[4];let V;if(q[5]!==Q)V=G(Z,{children:Q}),q[5]=Q,q[6]=V;else V=q[6];let W;if(q[7]!==U||q[8]!==V)W=Y(K,{flexDirection:"column",gap:1,children:[U,V]}),q[7]=U,q[8]=V,q[9]=W;else W=q[9];let H;if(q[10]===Symbol.for("react.memo_cache_sentinel"))H=G(Z,{bold:!0,children:"Choose an option:"}),q[10]=H;else H=q[10];let I;if(q[11]===Symbol.for("react.memo_cache_sentinel"))I=[{label:"Exit and fix manually",value:"exit"},{label:"Reset with default configuration",value:"reset"}],q[11]=I;else I=q[11];let X;if(q[12]!==F||q[13]!==z)X=Y(K,{flexDirection:"column",children:[H,G(A,{options:I,onChange:F,onCancel:z})]}),q[12]=F,q[13]=z,q[14]=X;else X=q[14];let N;if(q[15]!==z||q[16]!==W||q[17]!==X)N=Y(f,{title:"Configuration Error",color:"error",onCancel:z,children:[W,X]}),q[15]=z,q[16]=W,q[17]=X,q[18]=N;else N=q[18];return N}var d="dark";async function n({error:J}){let q={..._(!1),theme:d};await new Promise(async(L)=>{let{unmount:Q}=await C(G(m,{children:G(O,{children:G(p,{filePath:J.filePath,errorDescription:J.message,onExit:()=>{Q(),L(),process.exit(1)},onReset:()=>{B(J.filePath,b(J.defaultConfig,null,2),{flush:!1,encoding:"utf8"}),Q(),L(),process.exit(0)}})})}),q)})}export{n as showInvalidConfigDialog};
