PageSourceSearch

https://app.dinzo.com.br/assets/cancel-CMlGBHHL.js

js dinzo.com.br collected 2026-09-24 14:35:57 UTC 10,111 bytes, 1 lines download raw bytes

1import{p as ne,dD as oe,kO as le,me as ce,r as t,dF as g,a1 as h,j as e,dJ as re,mf as ie,cI as de,ca as xe,bE as L,dR as C,d5 as A,d6 as S,L as b,i as x,a6 as ue,a9 as j,dM as w,aq as me,mg as pe,er as fe,dN as ge,a4 as he,cA as be,en as je,k as Ne,ai as B}from"./index-B0X-vWe1.js";import{P as k}from"./PageHeader-CvfFVIhQ.js";import{u as ye}from"./useProofStats-Q2KEuotY.js";try{let o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new o.Error().stack;n&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[n]="d329687c-1035-4917-8472-a7d0827f2cbc",o._sentryDebugIdIdentifier="sentry-dbid-d329687c-1035-4917-8472-a7d0827f2cbc")}catch{}const ve=["Tá caro pra mim","Não usei o suficiente","Faltou um recurso","Problema técnico","Outro"],we=function(){const{localUser:n}=ne(),{has:D,hasFetched:z,refetch:O}=oe(),c=ye(),{streakDays:u}=le(),{toggleChat:H}=ce(),[m,W]=t.useState(null),[r,G]=t.useState(""),[N,R]=t.useState(!1),[M,E]=t.useState(null),[I,V]=t.useState(!1),[p,K]=t.useState(null),[J,Q]=t.useState("PAID"),[U,X]=t.useState(!1),[P,y]=t.useState(!1),[a,Y]=t.useState(null),[Z,v]=t.useState(!1),[_,T]=t.useState(!1),[i,$]=t.useState(null);t.useEffect(()=>{g.GetWebSubscription().then(({data:s})=>{y(s.subscriptions.length>0),Y(s.subscriptions.find(d=>d.gateway==="PAGARME_CARD")??null)}).catch(()=>y(!1)).finally(()=>X(!0)),g.GetRetentionOffer().then(({data:s})=>{v(s.eligible),s.eligible&&h("retention_offer_eligible")}).catch(()=>v(!1))},[]);const ee=D.premium||D.ultra;if(z&&!ee&&!I)return e.jsx(re,{to:"/plans",replace:!0});if(!z||!U)return e.jsx(ie,{});const se=P,ae=Z&&a!==null&&a.canceled_at===null&&(a.status==="ACTIVE"||a.status==="TRIAL")&&!a.scheduled_plan,q=a!==null?Math.round(a.value/2):null,te=async()=>{if(!(_||i)){T(!0);try{const{data:s}=await g.AcceptRetentionOffer();h("retention_offer_accepted",{plan:(a==null?void 0:a.subscription_type)??null,frequency:(a==null?void 0:a.frequency)??null}),B("success"),$(s)}catch{v(!1)}finally{T(!1)}}},f=c.oldestTransactionAt?de(new Date,c.oldestTransactionAt)+1:0,F=async()=>{var d;if(!P||N)return;R(!0),E(null);const s=[m,r.trim()].filter(Boolean).join(" — ")||void 0;try{const{data:l}=await g.CancelWebSubscription(s);h("web_cancel_confirmed",{reason:m,has_text:r.trim().length>0,reason_text:r.trim().slice(0,500)||null}),K(l.access_until?new Date(l.access_until):null),Q(l.access_kind==="TRIAL"?"TRIAL":"PAID"),V(!0),O()}catch(l){((d=l==null?void 0:l.response)==null?void 0:d.status)===404?y(!1):E("Não conseguimos cancelar agora. Tenta de novo — ou fala com a gente que resolvemos na hora.")}finally{R(!1)}};if(i){const s=i.next_billing_at?xe(new Date(i.next_billing_at)):null;return e.jsxs("div",{className:"flex flex-1 flex-col",children:[e.jsx(k,{}),e.jsxs("div",{className:"mx-auto flex w-full max-w-[560px] flex-1 flex-col items-center gap-4 py-10 text-center",children:[e.jsx(L,{size:44,className:"text-success"}),e.jsx("span",{className:"text-[24px] font-extrabold tracking-[-0.02em]",children:"Desconto aplicado!"}),e.jsxs("p",{className:"text-[13.5px] leading-[1.6] text-foreground-muted",children:["Sua assinatura continua exatamente como está — e a próxima cobrança sai por"," ",e.jsx("b",{className:"dz-money text-foreground",children:C(i.next_charge_cents)}),s&&e.jsxs(e.Fragment,{children:[" ","em"," ",e.jsx("b",{className:"text-foreground",children:A(s,"d 'de' MMMM 'de' yyyy",{locale:S})})]}),", com ",i.discount_percent,"% de desconto."]}),e.jsx(b,{to:"/plan",className:"contents",children:e.jsx(x,{className:"mt-2",children:"Voltar ao meu plano"})})]})]})}return I?e.jsxs("div",{className:"flex flex-1 flex-col",children:[e.jsx(k,{}),e.jsxs("div",{className:"mx-auto flex w-full max-w-[560px] flex-1 flex-col items-center gap-4 py-10 text-center",children:[e.jsx(L,{size:44,className:"text-success"}),e.jsx("span",{className:"text-[24px] font-extrabold tracking-[-0.02em]",children:"Assinatura cancelada"}),e.jsx("p",{className:"text-[13.5px] leading-[1.6] text-foreground-muted",children:J==="TRIAL"&&p?e.jsxs(e.Fragment,{children:["Seu teste segue até"," ",e.jsx("b",{className:"text-foreground",children:A(p,"d 'de' MMMM 'de' yyyy",{locale:S})}),". Você não pagou nada — e não vamos cobrar."]}):e.jsxs(e.Fragment,{children:[p?e.jsxs(e.Fragment,{children:["Seu acesso continua até"," ",e.jsx("b",{className:"text-foreground",children:A(p,"d 'de' MMMM 'de' yyyy",{locale:S})})," ","— o período que você já pagou."]}):e.jsx(e.Fragment,{children:"Seu acesso continua até o fim do período já pago."})," ","Depois disso, não cobramos mais nada."]})}),e.jsx("p",{className:"text-[13px] leading-[1.55] text-foreground-muted",children:"Nada foi apagado: suas transações, contas e histórico ficam guardados esperando você — voltar é 1 clique."}),e.jsx(b,{to:"/",className:"contents",children:e.jsx(x,{className:"mt-2",children:"Voltar ao painel"})})]})]}):e.jsxs("div",{className:"flex flex-1 flex-col",children:[e.jsx(k,{}),e.jsxs("div",{className:"mx-auto flex w-full max-w-[640px] flex-1 flex-col gap-5 pb-10",onKeyDown:s=>{Ne(s)&&(s.preventDefault(),s.stopPropagation(),F())},children:[e.jsxs("div",{className:"flex flex-col items-center gap-2.5 text-center",children:[e.jsx(ue,{state:"crying",size:128}),e.jsx("p",{className:"max-w-[440px] text-[13.5px] leading-[1.55] text-foreground-muted",children:"Uma tela, sem labirinto. Seu acesso continua até o fim do período já pago — e nada é apagado."})]}),(c.connectedBanksCount>0||f>0||u>0||!!(n!=null&&n.phone))&&e.jsxs(j,{className:"flex flex-col gap-3 px-6 py-5",children:[e.jsx("span",{className:"text-[13.5px] font-bold",children:"O que entra em pausa quando o acesso terminar:"}),e.jsxs("div",{className:"flex flex-col gap-2.5 text-[13px] text-foreground-muted",children:[c.connectedBanksCount>0&&e.jsxs("span",{className:"flex items-center gap-2.5",children:[e.jsx(me,{size:15,className:"flex-none text-primary"}),c.connectedBanksCount," ",w(c.connectedBanksCount,"banco sincronizando sozinho","bancos sincronizando sozinhos")]}),f>0&&e.jsxs("span",{className:"flex items-center gap-2.5",children:[e.jsx(pe,{size:15,className:"flex-none text-primary"}),f," ",w(f,"mês","meses")," ","de histórico organizado"]}),u>0&&e.jsxs("span",{className:"flex items-center gap-2.5",children:[e.jsx(fe,{size:15,className:"flex-none text-accent-gold"}),"ofensiva de ",u," ",w(u,"dia","dias")]}),!!(n!=null&&n.phone)&&e.jsxs("span",{className:"flex items-center gap-2.5",children:[e.jsx("img",{src:"/icons/whatsapp.svg",width:15,height:15,alt:"",className:"flex-none"}
1),"Dino no WhatsApp — lançamentos por texto, áudio e foto"]})]}),e.jsx("span",{className:"text-[12px] leading-[1.5] text-foreground-subtle",children:"Nada é apagado — seus dados ficam guardados e voltam com você."})]}),ae&&q!==null&&e.jsxs(j,{className:"flex flex-col gap-3 border-primary/40 px-6 py-5",children:[e.jsxs("span",{className:"inline-flex items-center gap-2 text-[13.5px] font-bold",children:[e.jsx(ge,{size:16,className:"text-primary"}),"Antes de ir: fica com 50% de desconto"]}),e.jsxs("p",{className:"text-[13px] leading-[1.55] text-foreground-muted",children:["A gente corta a próxima cobrança pela metade:"," ",e.jsx("b",{className:"dz-money text-foreground",children:C(q)})," ","em vez de"," ",e.jsx("span",{className:"dz-money line-through",children:C(a.value)}),", no mesmo plano, sem mudar mais nada."]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx(x,{size:"sm",disabled:_,onClick:()=>void te(),children:_?"Aplicando...":"Aceitar 50% e continuar"}),e.jsx("span",{className:"text-[12px] text-foreground-subtle",children:"ou siga com o cancelamento abaixo — sem pegadinha."})]})]}),e.jsxs(j,{className:"flex flex-col gap-3 px-6 py-5",children:[e.jsxs("span",{className:"text-[13.5px] font-bold",children:["Quer contar o motivo?"," ",e.jsx("span",{className:"font-medium text-foreground-subtle",children:"(opcional)"})]}),e.jsx("div",{className:"flex flex-wrap gap-2",children:ve.map(s=>e.jsx("button",{type:"button",onClick:()=>{B("tick"),W(d=>d===s?null:s)},className:he("inline-flex h-[30px] cursor-pointer items-center rounded-full border px-3.5 text-[12.5px] leading-none font-semibold transition-colors",m===s?"border-primary bg-primary-soft font-bold text-primary-soft-foreground":"border-border bg-surface-card text-foreground-muted hover:bg-surface-sunken"),children:s},s))}),e.jsx("textarea",{value:r,onChange:s=>G(s.target.value),placeholder:"Se quiser, conta mais — a gente lê tudo.",rows:2,className:"w-full resize-none rounded-[11px] border border-input bg-surface-card px-3.5 py-2.5 text-[13px] outline-none placeholder:text-foreground-subtle focus:border-ring focus:shadow-[inset_0_0_0_1px_var(--ring),0_0_0_3px_var(--primary-soft)]"})]}),se?e.jsxs("div",{className:"flex flex-col gap-3",children:[M&&e.jsx("span",{className:"text-[12.5px] font-semibold text-destructive",children:M}),e.jsx(x,{variant:"destructive",block:!0,disabled:N,onClick:F,kbd:be,children:N?"Cancelando...":"Cancelar assinatura"}),e.jsx(b,{to:"/plan",className:"text-center text-[13px] font-semibold text-foreground-muted hover:text-foreground",children:"mudei de ideia — voltar ao meu plano"})]}):e.jsxs(j,{className:"flex flex-col gap-3 px-6 py-5",children:[e.jsxs("span",{className:"text-[13.5px] leading-[1.55] text-foreground-muted",children:["Não encontramos uma assinatura cancelável por aqui — se você assinou pelo app (App Store ou Google Play), o cancelamento acontece por lá. Prefere que a gente faça?"," ",e.jsx("b",{className:"text-foreground",children:"Chama no suporte que te guiamos na hora"}),", sem perguntas em série."]}),e.jsxs(x,{block:!0,variant:"outline",onClick:()=>{h("web_cancel_support_handoff",{reason:m,has_text:r.trim().length>0,reason_text:r.trim().slice(0,500)||null}),H()},children:[e.jsx(je,{size:15}),"Falar com o suporte"]}),e.jsx(b,{to:"/plan",className:"text-center text-[13px] font-semibold text-foreground-muted hover:text-foreground",children:"voltar ao meu plano"})]})]})]})};export{we 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.