import{fh as V,gh as v}from"./cli-0.5.3-bkhcnkx5.mjs";import{NY as U,PY as J}from"./cli-0.5.3-vqmxwet2.mjs";import{lZ as W,mZ as B}from"./cli-0.5.3-6163zevg.mjs";import{$2 as Q,WZ as N,XZ as _,e3 as R,z3 as $}from"./cli-0.5.3-1vt6twff.mjs";import{H6 as Z,z6 as K}from"./cli-0.5.3-t65dek0m.mjs";import{Xma as Y}from"./cli-0.5.3-0df3r78b.mjs";async function w(y,X){try{if(R()){let q=Q(),z=!1;if(q?.subscriptionType&&q?.rateLimitTier)z=q.subscriptionType==="max"&&q.rateLimitTier==="default_claude_max_20x";else if(q?.accessToken){let H=await N(q.accessToken);z=H?.organization?.organization_type==="claude_max"&&H?.organization?.rate_limit_tier==="default_claude_max_20x"}if(z)return setTimeout(y,0,"You are already on the highest Max subscription plan. For additional usage, run /login to switch to an API usage-billed account."),null}return await W("https://claude.ai/upgrade/max"),U(V,{startingMessage:"Starting new login following /upgrade. Exit with Ctrl-C to use existing account.",onDone:(q)=>{X.onChangeAPIKey(),y(q?"Login successful":"Login interrupted")}})}catch(G){K(G),setTimeout(y,0,"Failed to open browser. Please visit https://claude.ai/upgrade/max to upgrade.")}return null}var E=Y(()=>{_();$();B();Z();v();J()});
export{w as Ib,E as Jb};
