1import{j as e}from"./ui-916dc9d9.js";import{aJ as O,aZ as V,P as F,af as q,a_ as B,T as R,F as y,Y as L,a$ as $,j as T,b0 as E,n as w,b1 as _,L as U,m as J,C as Y,r as Z}from"./index-eb73e3da.js";import{r as a}from"./vendor-aea060b0.js";import{C as W}from"./index-e0a030aa.js";import{j as S,k as G,l as K,m as X,D as ee,n as te,d as se,o as ae,p as ne,q as oe}from"./CreditCardPaymentError-5d6ed24c.js";import{N as re}from"./NegotiateDebtsItems-a7755e54.js";import{I as ie}from"./IconCircleCheck-b8bb1f85.js";import{I as M}from"./IconBrandWhatsapp-b5761246.js";import{P as H,I as ce}from"./useInvoicePixStatus-122dcc21.js";import{b as le}from"./index-83931a48.js";import{P as de}from"./PaymentOptions-09b28a1f.js";import{C as me}from"./ContractStatus-ae0d6c99.js";import"./pdf-viewer-9b371a90.js";import"./motion-b076d11a.js";import"./index-72cc605b.js";import"./luxon-cc86f6dc.js";const ue="/assets/roteador-d7639ed3.png";function xe(){const[s,r]=a.useState(""),{setErpCustomerTxId:m,setCurrentStep:l,setToken:i}=a.useContext(S),{mutate:t,isLoading:u}=G(),h=d=>{u||t(d,{onSuccess:p=>{m(d),i(p.token),l(2)},onError:()=>{R("error",d.length>11?"Canal exclusivo para Pessoa FÃsica, contate o suporte.":"Usuário inválido. Por favor, confira se seus dados estão corretos.")}})},g=()=>{q.isValidCpfOrCnpj(B(s))&&h(B(s))};return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"flex items-center justify-center p-5",children:e.jsx("img",{src:ue,width:131,height:108,alt:"roteador-img"})}),e.jsx(W.Title,{title:"Sua conexão está indisponÃvel no momento."}),e.jsx(W.Description,{children:"Para que possamos resolver, por favor, insira o seu CPF abaixo para verificarmos a situação:"}),e.jsxs("div",{className:"flex items-center flex-col mt-2",children:[e.jsx(O,{placeholder:"Digite seu CPF",value:V(s),onChange:d=>r(d.target.value)}),e.jsx(F,{disabled:!s,action:g,aditionalClasses:"!mt-4 !font-medium }",label:u?"Carregando...":"Verificar situação"})]})]})}const pe=y.div` 2w-full h-[1px] bg-gray-200 mt-4 mb-2 3`;function z(){const{handleBackToFirstStep:s}=a.useContext(S);return e.jsxs(e.Fragment,{children:[e.jsx(pe,{}),e.jsx(L,{aditionalClasses:"!mt-2 !items-center !text-sm !font-medium !bg-gray-200",icon:e.jsx($,{stroke:1.25,width:20}),label:"Voltar para o inÃcio ",action:s})]})}function fe(){const{selectedContractId:s,token:r,setSelectedContractId:m,setCurrentStep:l,handleBackToFirstStep:i}=a.useContext(S),t=T(),{data:u,isLoading:h}=K(s,r),{data:g,isLoading:d}=X(s,r),p=h||d,n=u??g??[],[f,x]=a.useState(!1),[k,A]=a.useState("55"),o=localStorage.getItem("7azAppMode")??!1,j=y.div` 4 w-full h-[1px] bg-gray-200 my-2 lg:my-4 5 `,C=()=>{l(4)},b=()=>{l(2),m("")};a.useEffect(()=>{var c,v,N,I,Q,P;x(((v=(c=t==null?void 0:t.Extras)==null?void 0:c.Services)==null?void 0:v.QuickAccessWhats)&&((I=(N=t==null?void 0:t.Extras)==null?void 0:N.Services)==null?void 0:I.QuickAccessWhats)!==""),A(((P=(Q=t==null?void 0:t.Extras)==null?void 0:Q.Services)==null?void 0:P.QuickAccessCountryWhats)??"55")},[t]);function D(){var c,v,N,I;f&&!o&&window.open("https://api.whatsapp.com/send?phone="+k+((v=(c=t==null?void 0:t.Extras)==null?void 0:c.Services)==null?void 0:v.QuickAccessWhats)+"&text="+((I=(N=t==null?void 0:t.Extras)==null?void 0:N.Services)==null?void 0:I.QuickAccessWhatsMessage),"_blank")}return e.jsxs(e.Fragment,{children:[p&&e.jsx(E,{}),!p&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-row items-center gap-2 mb-2 text-lg text-neutral-900 font-medium ",children:[e.jsx(w,{onClick:s?b:i,stroke:1.25})," ",e.jsx("span",{className:"text-lg",children:" Lista de cobranças pendentes"})]}),e.jsx("span",{className:"text-sm text-left font-normal text-gray-600 tracking-wide mb-2 ",children:"Veja suas pendências e gere uma cobrança atualizada."}),e.jsx("span",{className:"pb-2",children:"Faturas "}),n.length===0&&e.jsxs("div",{className:" bg-supportSuccess rounded-lg text-sm p-4 flex gap-2 items-center",children:[e.jsx(ie,{className:"text-success"}),"Não existem faturas pendentes para o seu contrato."]}),n.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"border rounded-lg p-2 text-sm mb-4 max-h-[170px] overflow-auto ",children:n==null?void 0:n.map(c=>e.jsx(re,{debt:c},c.id))}),e.jsxs("div",{className:"bg-secondary rounded-lg py-3 px-4 flex flex-row justify-between items-center mb-2",children:[e.jsx("span",{className:"text-sm leading-[22px] text-contrast tracking-wide",children:"Valor total:"}),e.jsxs("span",{className:"text-[18px] leading-[22px] font-medium text-contrast tracking-wide",children:["R$"," ",ee.formatAmou
5nt((n==null?void 0:n.reduce((c,v)=>c+v.updatedAmount,0))??0)]})]}),e.jsx(F,{aditionalClasses:"!mt-2 !font-medium",label:"Escolher forma de pagamento",action:C})]}),e.jsx(z,{}),f&&e.jsxs(e.Fragment,{children:[e.jsx(j,{}),e.jsxs("div",{id:"info-support",className:"flex flex-col gap-4 items-center",children:[e.jsx("span",{className:"text-base flex items-center w-full justify-start font-semibold",children:"Tem alguma dúvida? Fale conosco!"}),e.jsx(L,{action:D,label:"Whatsapp",icon:e.jsx(M,{stroke:1.25,width:22}),aditionalClasses:"!font-medium !p-2 !text-sm !border !border-primary"})]})," "]})]})]})}const he=y.div` 6w-full h-[1px] bg-gray-200 mb-4 7`;function ge(){const{paymentsOptions:s,erpCustomerTxId:r,selectedContractId:m,token:l,setCurrentStep:i,setInvoiceId:t,setSelectPaymentOption:u,handleBackToListDebts:h}=a.useContext(S),{mutate:g,isLoading:d}=te(),p=x=>{d||g({collectionTypeId:x,erpCustomerTxId:r,erpContractId:m,token:l},{onSuccess:k=>{u(x),t(k.invoiceId),i(5)},onError:()=>{i(1)}})},n=a.useMemo(()=>s.map(x=>x.paymentMethodValue),[s]),f=x=>{p(Number(x))};return s.length===0?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("div",{className:"flex items-center",children:[e.jsx(se,{})," "]}),e.jsx("span",{className:"text-md flex items-center p-2",children:"Não existem formas de pagamentos disponÃveis, contate o suporte."})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(w,{stroke:1.25,onClick:h}),e.jsx("span",{className:"flex text-lg text-neutral-900 font-medium ",children:"Escolha como pagar"})]}),d&&e.jsx(_,{size:32,className:"text-primary animate-spin"})]}),e.jsx(he,{}),e.jsxs("div",{className:"w-full flex flex-col items-start gap-3 ",children:[n.includes(3)&&e.jsx(H,{paymentForm:"3",flag:"",buttonText:"Cartão",buttonSecondaryText:"Pague sua fatura com cartão de crédito",changePaymentForm:f,icon:le}),n.includes(1)&&e.jsx(H,{paymentForm:"1",buttonText:"Pix",buttonSecondaryText:"Confirmação imediata",changePaymentForm:f,icon:ce})]}),e.jsx(z,{})]})}function je(){const{selectPaymentOption:s,handleBackToSelectPaymentOptionStep:r,invoiceId:m,token:l}=a.useContext(S),{data:i,isFetching:t}=ae(m,l),u=y.div` 8w-full h-[1px] bg-gray-200 mt-4 mb-2 9`;return e.jsxs(e.Fragment,{children:[t&&e.jsx(E,{}),!t&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center justify-start gap-1",children:[e.jsx(w,{stroke:2.25,color:"#525252",onClick:r,className:"cursor-pointer"}),e.jsx("span",{className:"flex flex-row items-center gap-2 text-lg text-neutral-900 font-medium",children:"Escolha como pagar"})]}),e.jsx(de,{invoice:i,exclusivePaymentMethodByProp:s,isDefaulterDebtsByProp:!0})]}),e.jsxs("div",{className:" flex flex-col items-center justify-start ",children:[e.jsx(u,{}),e.jsx("span",{className:"text-sm font-semibold",children:"Após o pagamento sua internet voltará ao normal."}),e.jsx("span",{className:"text-xs ",children:" Se após o pagamento isso não acontecer, reinicie o modem. "})]})]})}function Ce(){const{handleBackToFirstStep:s,setCurrentStep:r,token:m,selectedContractId:l,setSelectedContractId:i}=a.useContext(S),t=T(),[u,h]=a.useState(!1),[g,d]=a.useState("55"),p=localStorage.getItem("7azAppMode")??!1,{data:n,isLoading:f}=ne(m),x=y.div` 10 w-full h-[1px] bg-gray-200 my-2 lg:my-4 11 `,k=()=>{r(3)};function A(){var o,j,C,b;u&&!p&&window.open("https://api.whatsapp.com/send?phone="+g+((j=(o=t==null?void 0:t.Extras)==null?void 0:o.Services)==null?void 0:j.QuickAccessWhats)+"&text="+((b=(C=t==null?void 0:t.Extras)==null?void 0:C.Services)==null?void 0:b.QuickAccessWhatsMessage),"_blank")}return a.useEffect(()=>{var o,j,C,b,D,c;h(((j=(o=t==null?void 0:t.Extras)==null?void 0:o.Services)==null?void 0:j.QuickAccessWhats)&&((b=(C=t==null?void 0:t.Extras)==null?void 0:C.Services)==null?void 0:b.QuickAccessWhats)!==""),d(((c=(D=t==null?void 0:t.Extras)==null?void 0:D.Services)==null?void 0:c.QuickAccessCountryWhats)??"55")},[t]),a.useEffect(()=>{n&&n.length===0&&r(3)},[n,r]),e.jsxs("div",{children:[f&&e.jsx(E,{}),!f&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex flex-row items-center gap-2 mb-2 text-lg text-neutral-900 font-medium ",children:[e.jsx(w,{onClick:s,stroke:1.25}
11)," ",e.jsx("span",{className:"text-lg",children:" Selecione o contrato"})]}),e.jsx("span",{className:"text-sm text-left font-normal text-gray-600 tracking-wide flex items-center gap-1 ",children:"Para realizar o desbloqueio selecione o contrato que corresponde ao endereço em que você se encontra:"}),n==null?void 0:n.map(o=>e.jsxs("div",{className:`flex h-18 min-h-[85px] items-center p-3 cursor-pointer border border-gray-400 hover:border-primary rounded-lg mt-2 mb-2 hover:bg-primaryTransparent20 lg:text-xs text-[11px] justify-between ${l===o.id&&"border border-primary bg-primaryTransparent20"}`,onClick:()=>i(o.id),children:[e.jsxs("div",{className:"flex items-start flex-col justify-start gap-1",children:[e.jsx(me,{status:o.status}),e.jsxs("span",{className:"mt-1",children:[e.jsxs("a",{className:"font-semibold ",children:[o.id," "]}),"- ",o.anonymizedAddress]}),e.jsxs("span",{children:[" ",o.planName," "]})]}),e.jsx("div",{className:"flex items-center"})]},o.id)),e.jsx(F,{label:"Selecionar contrato",aditionalClasses:"!mt-3 !font-medium",action:k,disabled:!l}),u&&e.jsxs(e.Fragment,{children:[e.jsx(x,{}),e.jsxs("div",{id:"info-support",className:"flex flex-col gap-4 items-center",children:[e.jsx("span",{className:"text-base flex items-center w-full justify-start font-semibold",children:"Tem alguma dúvida? Fale conosco!"}),e.jsx(L,{action:A,label:"Whatsapp",icon:e.jsx(M,{stroke:1.25,width:22}),aditionalClasses:"!font-medium !p-2 !text-sm !border !border-primary"})]})," "]})]})," "]})}function be(){const{currentStep:s}=a.useContext(S);return e.jsxs(W.Root,{children:[s===1&&e.jsx(xe,{}),s===2&&e.jsx(Ce,{}),s===3&&e.jsx(fe,{}),s===4&&e.jsx(ge,{}),s===5&&e.jsx(je,{})]})}function Be(){var i,t;const s=T(),[r,m]=a.useState(!1);return new URLSearchParams(window.location.search).get("token"),a.useState(!1),a.useEffect(()=>{s&&m(!0)},[s]),e.jsx(e.Fragment,{children:s&&((i=s==null?void 0:s.Logo)!=null&&i.Content)?e.jsx(U,{id:"bgLoginPix",children:e.jsxs(e.Fragment,{children:[e.jsx(J,{children:r&&e.jsx(Y,{src:((t=s==null?void 0:s.Logo)==null?void 0:t.Content)||"",alt:(s==null?void 0:s.Name)||""})}),e.jsx(oe,{children:e.jsx(be,{})})]})}):e.jsx(Z,{})})}export{Be as DefaulterPortal};
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.