1import{g as s,c as Y,r as S,j as n,B as A,a2 as G,bz as Q,P as L,bA as X,N as ee,aO as g,aP as p,aQ as b,aR as f,aU as m,bs as y,be as h,L as w,R as k,a5 as R,aV as U,a as D}from"./main-BBKsD6D_.js";import{D as ne}from"./dashboard-layout-DeyxNRv9.js";import{B as W}from"./badge-A1BR_W1-.js";import{a as x}from"./formatter-C5Z-0fih.js";import{u as te,g as re}from"./use-payment-BTkdrDOA.js";import{c as se}from"./common_settings-BDEV4JQI.js";import{s as ie}from"./settings_billing_breadcrumb-BQw2u6xR.js";import"./dashboard-header-CPsW0IZ_.js";import"./useRender-D2m_4lVx.js";import"./sidebar-B-RmEO8u.js";const ae=()=>"Failed to open customer portal",le=()=>"æå¼å®¢æ·é¨æ·å¤±è´¥",ce=()=>"Failed to open customer portal",_e=()=>"Falha ao abrir o portal do cliente",oe=()=>"Das Kundenportal konnte nicht geöffnet werden",V=((r={},t={})=>{const e=t.locale??s();return e==="en"?ae():e==="zh"?le():e==="es"?ce():e==="pt-BR"?_e():oe()}),ue=()=>"Loading...",de=()=>"å è½½ä¸...",ge=()=>"Loading...",pe=()=>"Carregando...",be=()=>"Laden...",fe=((r={},t={})=>{const e=t.locale??s();return e==="en"?ue():e==="zh"?de():e==="es"?ge():e==="pt-BR"?pe():be()}),me=()=>"Could not cancel auto-renew. Try again.",he=()=>"åæ¶å¤±è´¥ï¼è¯·ç¨ååè¯",xe=()=>"No se pudo cancelar la renovación. Inténtalo de nuevo.",je=()=>"Não foi possÃvel cancelar a renovação. Tente de novo.",Ne=()=>"Die Verlängerung konnte nicht beendet werden.",ve=((r={},t={})=>{const e=t.locale??s();return e==="en"?me():e==="zh"?he():e==="es"?xe():e==="pt-BR"?je():Ne()}),ze=()=>"Cancel auto-renew",Ce=()=>"åæ¶èªå¨ç»è´¹",Pe=()=>"Cancelar la renovación",ye=()=>"Cancelar a renovação",we=()=>"Automatische Verlängerung beenden",ke=((r={},t={})=>{const e=t.locale??s();return e==="en"?ze():e==="zh"?Ce():e==="es"?Pe():e==="pt-BR"?ye():we()}),Re=()=>"(cancels at period end)",Be=()=>"ï¼å¨æç»ææ¶åæ¶ï¼",Le=()=>"(cancels at period end)",Se=()=>"(cancela no final do perÃodo)",Ae=()=>"(storniert am Ende der Periode)",De=((r={},t={})=>{const e=t.locale??s();return e==="en"?Re():e==="zh"?Be():e==="es"?Le():e==="pt-BR"?Se():Ae()}),Ee=()=>"Current plan",Fe=()=>"å½åæ¹æ¡",Ie=()=>"Current plan",Me=()=>"Plano atual",Te=()=>"Aktueller Plan",j=((r={},t={})=>{const e=t.locale??s();return e==="en"?Ee():e==="zh"?Fe():e==="es"?Ie():e==="pt-BR"?Me():Te()}),Ue=()=>"Your current plan and subscription status",We=()=>"æ¨å½åçæ¹æ¡ä¸è®¢é
ç¶æ",Ve=()=>"Your current plan and subscription status",$e=()=>"Seu plano atual e status de assinatura",Oe=()=>"Ihr aktueller Plan und Abonnementstatus",N=((r={},t={})=>{const e=t.locale??s();return e==="en"?Ue():e==="zh"?We():e==="es"?Ve():e==="pt-BR"?$e():Oe()}),Ye=()=>"Free",Ge=()=>"å
è´¹ç",Ke=()=>"Free",Ze=()=>"Livre",qe=()=>"Frei",He=((r={},t={})=>{const e=t.locale??s();return e==="en"?Ye():e==="zh"?Ge():e==="es"?Ke():e==="pt-BR"?Ze():qe()}),Je=()=>"Upgrade to a paid plan to unlock more features",Qe=()=>"å级å°ä»è´¹æ¹æ¡ä»¥è§£éæ´å¤åè½",Xe=()=>"Upgrade to a paid plan to unlock more features",en=()=>"Atualize para um plano pago para desbloquear mais recursos",nn=()=>"Führen Sie ein Upgrade auf einen kostenpflichtigen Plan durch, um weitere Funktionen freizuschalten",tn=((r={},t={})=>{const e=t.locale??s();return e==="en"?Je():e==="zh"?Qe():e==="es"?Xe():e==="pt-BR"?en():nn()}),rn=()=>"You have lifetime access to all features",sn=()=>"æ¨æ¥æææåè½çç»èº«ä½¿ç¨æ",an=()=>"You have lifetime access to all features",ln=()=>"Você tem acesso vitalÃcio a todos os recursos",cn=()=>"Sie haben lebenslangen Zugriff auf alle Funktionen",_n=((r={},t={})=>{const e=t.locale??s();return e==="en"?rn():e==="zh"?sn():e==="es"?an():e==="pt-BR"?ln():cn()}),on=()=>"Manage billing",un=()=>"管çè´¦å",dn=()=>"Manage billing",gn=()=>"Gerenciar faturamento",pn=()=>"Abrechnung verwalten",bn=((r={},t={})=>{const e=t.locale??s();return e==="en"?on():e==="zh"?un():e==="es"?dn():e==="pt-BR"?gn():pn()}),fn=()=>"Manage subscription",mn=()=>"管ç订é
",hn=()=>"Manage subscription",xn=()=>"Gerenciar assinatura",jn=()=>"Abonnement verwalten",Nn=((r={},t={})=>{const e=t.locale??s();return e==="en"?fn():e==="zh"?mn():e==="es"?hn():e==="pt-BR"?xn():jn()}),vn=()=>"No plan selected",zn=()=>"æªéæ©æ¹æ¡",Cn=()=>"No plan selected",Pn=()=>"Nenhum plano selecionado",yn=()=>"Kein Plan ausgewählt",wn=((r={},t={})=>{const e=t.locale??s();return e==="en"?vn():e==="zh"?zn():e==="es"?Cn():e==="pt-BR"?Pn():yn()}),kn=()=>"Current period ends:",Rn=()=>"å½åå¨æç»æï¼",Bn=()=>"Current period ends:",Ln=()=>"O perÃodo atual termina:",Sn=()=>"Der aktuelle Zeitraum endet:",An=((r={},t={})=>{const e=t.locale??s();return e==="en"?kn():e==="zh"?Rn():e==="es"?Bn():e==="pt-BR"?Ln():Sn()}),Dn=()=>"Current period starts:",En=()=>"å½å卿å¼å§ï¼",Fn=()=>"Current period starts:",In=()=>"O perÃodo atual começa:",Mn=()=>"Der aktuelle Zeitraum beginnt:",Tn=((r={},t={})=>{const e=t.locale??s();return e==="en"?Dn():e==="zh"?En():e==="es"?Fn():e==="pt-BR"?In():Mn()}),Un=()=>"Retry",Wn=()=>"éè¯",Vn=()=>"Retry",$n=()=>"Tentar novamente",On=()=>"Wiederholen",Yn=((r={},t={})=>{const e=t.locale??s();return e==="en"?Un():e==="zh"?Wn():e==="es"?Vn():e==="pt-BR"?$n():On()}),Gn=()=>"Active",Kn=()=>"å·²æ¿æ´»",Zn=()=>"Active",qn=()=>"Ativo",Hn=()=>"Aktiv",$=((r={},t={})=>{const e=t.locale??s();return e==="en"?Gn():e==="zh"?Kn():e==="es"?Zn():e==="pt-BR"?qn():Hn()}),Jn=()=>"Trial",Qn=()=>"è¯ç¨ä¸",Xn=()=>"Trial",et=()=>"Julgamento",nt=()=>"Versuch",tt=((r={},t={})=>{const e=t.locale??s();return e==="en"?Jn():e==="zh"?Qn():e==="es"?Xn():e==="pt-BR"?et():nt()}),rt=()=>"Trial ends:",st=()=>"è¯ç¨ç»æï¼",it=()=>"Trial ends:",at=()=>"O teste termina:",lt=()=>"Testversion endet:",ct=((r={},t={})=>{const e=t.locale??s();return e==="en"?rt():e==="zh"?st():e==="es"?it():e==="pt-BR"?at():lt()}),_t=()=>"Upgrade plan",ot=()=>"åçº§æ¹æ¡",ut=()=>"Upgrade plan",dt=()=>"Plano de atualização",gt=()=>"Upgrade-Plan",B=((r={},t={})=>{const e=t.locale??s();return e==="en"?_t():e==="zh"?ot():e==="es"?ut():e==="pt-BR"?dt():gt()}),pt=r=>`WeChat Pay through ${r?.date}. It does not auto-renew.`,bt=r=>`微信æ¯ä»è³ ${r?.date}ï¼ä¸èªå¨ç»è´¹`,ft=r=>`WeChat Pay hasta ${r?.date}. No se renueva solo.`,mt=r=>`WeChat Pay até ${r?.date}. Não renova sozinho.`,ht=r=>`WeChat Pay bis ${r?.date}. Keine automatische Verlängerung.`,xt=((r,t={})=>{const e=t.locale??s();return e==="en"?pt(r):e==="zh"?bt(r):e==="es"?ft(r):e==="pt-BR"?mt(r):ht(r)}),jt=()=>"Manage your subscription and billing",Nt=()=>"ç®¡çæ¨ç订é
ä¸è´¦å",vt=()=>"Manage your subscription and billing",zt=()=>"Gerencie sua assinatura e faturamento",Ct=()=>"Verwalten Sie Ihr Abonnement und Ihre Abrechnung",Pt=((r={},t={})=>{const e=t.locale??s();return e==="en"?jt():e==="zh"?Nt():e==="es"?vt():e==="pt-BR"?zt():Ct()}),yt=()=>"Billing",wt=()=>"è´¦å",kt=()=>"Billing",Rt=()=>"Cobrança",Bt=()=>"Abrechnung",Lt=((r={},t={})=>{const e=t.locale??s();return e==="en"?yt():e==="zh"?wt():e==="es"?kt():e==="pt-BR"?Rt():Bt()});const St=[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0",key:"svg-0"}],["path",{d:"M12 7v5l3 3",key:"svg-1"}]],At=Y("outline","clock","Clock",St);const Dt=[["path",{d:"M20 11a8.1 8.1 0 0 0 -15.5 -2m-.5 -4v4h4",key:"svg-0"}],["path",{d:"M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4",key:"svg-1"}]],Et=Y("outline","refresh","Refresh",Dt);function O({returnUrl:r,variant:t="default",size:e="default",className:a,children:c}){const[o,_]=S.useState(!1),l=async()=>{try{_(!0);const i=await Q({data:{returnUrl:r}});i?.url?window.location.href=i.url:L.error(V())}catch(i){console.error("Customer portal error:",i),L.error(V())}finally{_(!1)}};return n.jsx(A,{variant:t,size:e,className:a,onClick:l,disabled:o,children:o?n.jsxs(n.Fragment,{children:[n.jsx(G,{className:"mr-2 size-4 animate-spin"}),fe()]}):c})}function Ft({onCanceled:r}){const[t,e]=S.useState(!1),a=async()=>{try{e(!0),await X({data:{}}),r()}catch(c){console.error("waffo cancel failed",c instanceof Error?c.message:"unknown"),L.error(ve())}finally{e(!1)}};return n.jsxs(A,{variant:"outline",onClick:a,disabled:t,children:[t?n.jsx(G,{className:"mr-2 size-4 animate-spin"}):null,ke()]})}function It(r){if(!r)return null;const t=r instanceof Date?r:new Date(r);return Number.isNaN(t.getTime())?null:t}const v=D("w-full overflow-hidden pt-6 pb-0 flex flex-col"),z=D("mt-2 px-6 py-4 flex justify-end items-center bg-muted rounded-none");function Mt(){const{data:r,isPending:t}=ee.useSession(),e=r?.user,{data:a,isLoading:c,error:o,refetch:_}=te(!!e?.id),l=a?.currentPlan??null,i=a?.subscription??null,E=a?.hasStripeSubscription===!0,K=a?.canCancelWaffo===!0,C=It(a?.passPeriodEnd),F=!!C&&!i,u=l?.isLifetime??!1,Z=re(),q=Object.values(Z),P=l?q.find(J=>J.id===l.id)??l:null,d=P?.isFree??!1,I=i?.currentPeriodStart?x(i.currentPeriodStart):null,M=i?.currentPeriodEnd?x(i.currentPeriodEnd):null,T=i?.trialEndDate?x(i.trialEndDate):null,H=S.useCallback(()=>_(),[_]);return c||t?n.jsxs(g,{className:v,children:[n.jsxs(p,{children:[n.jsx(b,{className:"text-lg font-semibold",children:j()}),n.jsx(f,{children:N()})]}),n.jsxs(m,{className:"space-y-4 flex-1",children:[n.jsx("div",{className:"flex items-center justify-start space-x-4",children:n.jsx(y,{className:"h-8 w-1/5"})}),n.jsx("div",{className:"text-sm text-muted-foreground space-y-2",children:n.jsx(y,{className:"h-6 w-3/5"})})]}),n.jsx(h,{className:z,children:n.jsx(y,{className:"h-8 w-1/4"})})]}):o?n.jsxs(g,{className:v,children:[n.jsxs(p,{children:[n.jsx(b,{className:"text-lg font-semibold",children:j()}),n.jsx(f,{children:N()})]}),n.jsx(m,{className:"space-y-4 flex-1",children:n.jsx("div",{className:"text-destructive text-sm",children:o?.message})}),n.jsx(h,{className:z,children:n.jsxs(A,{variant:"outline",onClick:H,children:[n.jsx(Et,{className:"size-4 mr-1"}),Yn()]})})]}):P?n.jsxs(g,{className:v,children:[n.jsxs(p,{children:[n.jsx(b,{className:"text-lg font-semibold",children:j()}),n.jsx(f,{children:N()})]}),n.jsxs(m,{className:"space-y-4 flex-1",children:[n.jsxs("div",{className:"flex items-center justify-start space-x-4",children:[n.jsx("div",{className:"text-3xl font-medium",children:P?.name??l?.id??He()}),F&&n.jsx(W,{variant:"outline",className:"border-transparent bg-green-100 text-xs text-green-700 dark:bg-green-500/20 dark:text-green-400",children:n.jsxs("span",{className:"flex items-center space-x-2",children:[n.jsx(U,{className:"mr-1 size-3"}),$()]})}),i&&(i.status==="trialing"||i.status==="active")&&n.jsx(W,{variant:"outline",className:D("text-xs border-transparent",i.status==="trialing"?"bg-amber-100 text-amber-700 dark:bg-amber-500/20 dark:text-amber-400":"bg-green-100 text-green-700 dark:bg-green-500/20 dark:text-green-400"),children:i.status==="trialing"?n.jsxs("span",{className:"flex items-center space-x-2",children:[n.jsx(At,{className:"size-3 mr-1"}),tt()]}):n.jsxs("span",{className:"flex items-center space-x-2",children:[n.jsx(U,{className:"size-3 mr-1"}),$()]})})]}),d&&n.jsx("div",{className:"text-sm text-muted-foreground",children:tn()}),u&&n.jsx("div",{className:"text-sm text-muted-foreground",children:_n()}),F&&C&&n.jsx("div",{className:"text-sm text-muted-foreground",children:xt({date:x(C)})}),i&&n.jsxs("div",{className:"text-sm text-muted-foreground space-y-2",children:[I&&n.jsxs("div",{className:"text-muted-foreground",children:[Tn()," ",I]}),M&&n.jsxs("div",{className:"text-muted-foreground",children:[An()," ",M,i.cancelAtPeriodEnd&&` ${De()}`]}),i.status==="trialing"&&T&&n.jsxs("div",{className:"text-amber-600",children:[ct()," ",T]})]})]}),n.jsxs(h,{className:z,children:[d&&n.jsx(w,{to:k.Pricing,className:R({variant:"default"}),children:B()}),u&&e&&n.jsx(O,{returnUrl:void 0,children:bn()}),!d&&!u&&E&&e&&n.jsx(O,{returnUrl:void 0,children:Nn()}),!d&&!u&&!E&&!i&&e&&n.jsx(w,{to:k.Pricing,className:R({variant:"outline"}),children:B()}),K&&e&&n.jsx(Ft,{onCanceled:()=>_()})]})]}):n.jsxs(g,{className:v,children:[n.jsxs(p,{children:[n.jsx(b,{className:"text-lg font-semibold",children:j()}),n.jsx(f,{children:N()})]}),n.jsx(m,{children:n.jsx("div",{className:"text-sm text-muted-foreground",children:wn()})}),n.jsx(h,{className:z,children:n.jsx(w,{to:k.Pricing,className:R({variant:"default"}),children:B()})})]})}function qt(){const r=[{label:se(),isCurrentPage:!1},{label:ie(),isCurrentPage:!0}];return n.jsx(ne,{breadcrumbs:r,title:Lt(),description:Pt(),children:n.jsx("div",{className:"grid grid-cols-1 gap-8 md:grid-cols-2",children:n.jsx(Mt,{})})})}export{qt as component};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.