import{_ as e,a as t,i as n,s as r}from"./i18n-DfIivedY.js";import{I as i}from"./app-BUWZBqJJ.js";import{PlanForm as a}from"./plan-form-a5kqclLN.js";var o=e(),s=t();function c(e){let t=(0,o.c)(64),{plan:c,currency:l}=e,{t:u}=n(),d;t[0]===u?d=t[1]:(d=u(`Admin`),t[0]=u,t[1]=d);let f;t[2]===d?f=t[3]:(f={title:d,href:`/admin`},t[2]=d,t[3]=f);let p;t[4]===u?p=t[5]:(p=u(`Plans`),t[4]=u,t[5]=p);let m;t[6]===p?m=t[7]:(m={title:p,href:`/admin/plans`},t[6]=p,t[7]=m);let h=`/admin/plans/${c.id}/edit`,g;t[8]!==c.name||t[9]!==h?(g={title:c.name,href:h},t[8]=c.name,t[9]=h,t[10]=g):g=t[10];let _;t[11]!==f||t[12]!==m||t[13]!==g?(_=[f,m,g],t[11]=f,t[12]=m,t[13]=g,t[14]=_):_=t[14];let v;t[15]!==c.name||t[16]!==u?(v=u(`Edit :name · Admin`,{name:c.name}),t[15]=c.name,t[16]=u,t[17]=v):v=t[17];let y;t[18]===v?y=t[19]:(y=(0,s.jsx)(r,{title:v}),t[18]=v,t[19]=y);let b;t[20]===c.name?b=t[21]:(b=(0,s.jsx)(`h1`,{className:`text-2xl font-semibold tracking-tight`,children:c.name}),t[20]=c.name,t[21]=b);let x;t[22]===u?x=t[23]:(x=u(`Slug:`),t[22]=u,t[23]=x);let S;t[24]===c.slug?S=t[25]:(S=(0,s.jsx)(`span`,{className:`font-mono`,children:c.slug}),t[24]=c.slug,t[25]=S);let C;t[26]===u?C=t[27]:(C=u(`Saving a price change archives the prior Stripe Price and creates a new one. Existing subscriptions stay grandfathered on the old price.`),t[26]=u,t[27]=C);let w;t[28]!==x||t[29]!==S||t[30]!==C?(w=(0,s.jsxs)(`p`,{className:`mt-1 text-sm text-muted-foreground`,children:[x,` `,S,` ·`,` `,C]}),t[28]=x,t[29]=S,t[30]=C,t[31]=w):w=t[31];let T;t[32]!==b||t[33]!==w?(T=(0,s.jsxs)(`div`,{children:[b,w]}),t[32]=b,t[33]=w,t[34]=T):T=t[34];let E=c.name,D=c.monthly_conversations,O=c.monthly_messages,k=c.max_tokens_per_response,A=c.price_cents,j=c.interval??`month`,M=c.is_active,N=!!c.features.remove_branding,P;t[35]===N?P=t[36]:(P={remove_branding:N},t[35]=N,t[36]=P);let F;t[37]!==c.is_active||t[38]!==c.max_tokens_per_response||t[39]!==c.monthly_conversations||t[40]!==c.monthly_messages||t[41]!==c.name||t[42]!==c.price_cents||t[43]!==j||t[44]!==P?(F={name:E,monthly_conversations:D,monthly_messages:O,max_tokens_per_response:k,price_cents:A,interval:j,is_active:M,features:P},t[37]=c.is_active,t[38]=c.max_tokens_per_response,t[39]=c.monthly_conversations,t[40]=c.monthly_messages,t[41]=c.name,t[42]=c.price_cents,t[43]=j,t[44]=P,t[45]=F):F=t[45];let I=`/admin/plans/${c.id}`,L;t[46]===u?L=t[47]:(L=u(`Save plan`),t[46]=u,t[47]=L);let R;t[48]!==c.stripe_price_id||t[49]!==c.stripe_product_id?(R={stripe_product_id:c.stripe_product_id,stripe_price_id:c.stripe_price_id},t[48]=c.stripe_price_id,t[49]=c.stripe_product_id,t[50]=R):R=t[50];let z;t[51]!==l||t[52]!==F||t[53]!==I||t[54]!==L||t[55]!==R?(z=(0,s.jsx)(a,{initial:F,method:`patch`,action:I,submitLabel:L,currency:l,readonly:R}),t[51]=l,t[52]=F,t[53]=I,t[54]=L,t[55]=R,t[56]=z):z=t[56];let B;t[57]!==T||t[58]!==z?(B=(0,s.jsxs)(`div`,{className:`flex flex-1 flex-col gap-4 p-4`,children:[T,z]}),t[57]=T,t[58]=z,t[59]=B):B=t[59];let V;return t[60]!==B||t[61]!==_||t[62]!==y?(V=(0,s.jsxs)(i,{breadcrumbs:_,children:[y,B]}),t[60]=B,t[61]=_,t[62]=y,t[63]=V):V=t[63],V}export{c as default};