PageSourceSearch

https://timnegocia.com.br/assets/home-dbc6da3a.js

js timnegocia.com.br collected 2026-10-08 01:37:32 UTC 19,999 bytes, 2 lines download raw bytes

1import{j as e,ab as j,e as h,aH as W,K as Q,aI as K,aJ as Z,aK as G,ae as V,ai as X,ag as Y,aj as B,aL as L,aM as _,L as M,x as O,aN as P,aO as z,ak as S,av as ee,ar as se,aP as te,aQ as ae,aR as E,aS as le,aC as $,aT as re,ay as ne,az as ie,al as q,aU as oe,aV as de,c as ce,p as xe,d as me,b as ge,aW as he,u as ue,n as U}from"./index-93377146.js";import{I as pe}from"./Inactivity-8b4e4419.js";import"./PrivacyPolicy-207606d4.js";import{m as fe,r as je}from"./Script-ccf5e1b3.js";import{u as we}from"./useCookieStorage-aa830b9f.js";import{u as be}from"./index.esm-ea02730e.js";import{z as F,t as Ne}from"./zod-92923329.js";const H="/assets/[email protected]",ve="/assets/[email protected]",ye=n=>e.jsx("img",{src:H,srcSet:`${H} 1x, ${ve} 2x`,...n}),I="/assets/[email protected]",Ce=n=>e.jsx("img",{src:I,srcSet:`${I} 1x, ${I} 2x`,...n}),De=({contracts:n})=>{const m=j(["break-words w-full text-left text-black font-bold text-sm "]),t=j(["text-[0.75rem] text-gray-600 font-normal text-left whitespace-nowrap lg:text-sm"]),u={1:{bgIcon:"bg-red-700",bgText:"bg-red-50"},2:{bgIcon:"bg-red-700",bgText:"bg-red-50"},3:{bgIcon:"bg-[#FC6E04]",bgText:"bg-[#FFFAEC]"},4:{bgIcon:"bg-[#FC6E04]",bgText:"bg-[#FFFAEC]"},5:{bgIcon:"bg-[#F6E245]",bgText:"bg-yellow-50"}},[w,b]=we("contractsListDueDate"),N=a=>Math.min.apply(null,a),x=a=>{const i=a.map(d=>new Date(d.dueDate).getTime()),l=new Date().getTime()-N(i);return Math.floor(l/(1e3*60*60*24))},v=a=>new Date(a).toLocaleDateString("pt-BR",{timeZone:"UTC"}),[o,y]=h.useState(()=>n==null?void 0:n.some(a=>{var d;const i=(d=a.products)!=null&&d.length?a.products[0].name:null,l=new Date(`${a.debts[0].dueDate} 00:00:00`).getDate()===10&&i==="TIM"?18:20;return x(a.debts)>=15&&x(a.debts)<l})),C=n==null?void 0:n.map(({debts:a,contacts:i,reference:l,products:r})=>{const d=new Date(`${a[0].dueDate} 00:00:00`).getDate()===10&&r[0].name==="TIM"?18:20;return{telephone:W((i==null?void 0:i.phone)??""),dueDate:v(N(a.map(g=>new Date(g.dueDate).getTime()))),suspensionDate:d-x(a),custCode:l,cep:r[0].name}}).sort((a,i)=>a.suspensionDate-i.suspensionDate),f=a=>{const i=a.target,l=i.closest(".btn-rybena-sign-language"),r=i.closest(".btn-rybena-voice"),d=i.closest(".btn-rybena-vision"),g=i.closest("#rybena-player-div"),p=document.getElementById("rybena-player-div"),s=document.getElementById("dialog-lateBills");(l||r||d)&&p&&(s==null||s.appendChild(p)),g&&(s==null||s.appendChild(g))};return h.useEffect(()=>(o&&!w?setTimeout(()=>(document.body.style.pointerEvents="",fe("dialog-lateBills")),0):je(),n&&y(n==null?void 0:n.some(a=>{var d;const i=(d=a.products)!=null&&d.length?a.products[0].name:null,l=new Date(`${a.debts[0].dueDate} 00:00:00`).getDate()===10&&i==="TIM"?18:20;return x(a.debts)>=15&&x(a.debts)<l})),document.addEventListener("click",f),()=>{document.removeEventListener("click",f)}),[w,o,n]),e.jsx(Q,{open:o&&!w,onOpenChange:a=>b(!a),children:e.jsxs(K,{container:document.getElementById("root"),children:[e.jsx(Z,{className:"fixed inset-0 bg-black/60 z-10"}),e.jsx(G,{id:"dialog-lateBills",className:j(["z-50","relative"]),children:e.jsx("section",{className:j(["fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2","w-full max-w-[356px]","lg:max-w-[39.75rem]"]),children:e.jsxs("div",{className:j(["relative overflow-hidden bg-linear-gradient-blue-700 rounded-[0.625rem]","py-[2.875rem] px-6 max-xs:mx-5 z-10","lg:py-13 lg:px-[3.75rem] "]),children:[e.jsx(V,{className:"absolute right-4 top-4 text-white lg:right-5",children:e.jsx(X,{size:32})}),e.jsx(Y,{className:"text-white text-[1.625rem] font-bold text-center lg:text-left lg:text-[2rem]",children:"Atenção"}),e.jsxs(B,{className:"w-full text-gray-100 mt-1 lg:mt-3 lg:max-w-[441px]",children:["Efetue o pagamento para evitar a"," ",e.jsx("b",{children:"suspensão parcial dos serviços contratados nos próximos dias."})]}),e.jsx("div",{className:"bg-white pt-4 pb-1 px-3 rounded-lg mt-3 pr-1 w-full",children:e.jsxs("div",{className:"overflow-auto max-h-[10.125rem] pr-2 scrollbar",children:[e.jsxs("div",{className:"sticky top-0 bg-white w-full pb-3 grid grid-cols-[82px_1fr_1fr] grid-rows-1 gap-x-2 lg:gap-x-8 lg:grid-cols-[125px_1fr_1fr] max-lg:hidden",children:[e.jsxs("p",{className:t,children:["Telefone/",e.jsx("br",{className:"lg:hidden"}),"Contrato:"," "]}),e.jsx("p",{className:t,children:"Vencimento:"}),e.jsx("p",{className:t,children:"Suspensão em:"})]}),e.jsx("div",{className:"w-full flex flex-col gap-y-2 ",children:C&&C.map(({telephone:a,dueDate:i,suspensionDate:l,custCode:r,cep:d})=>{var g,p,s,c;return e.jsxs("ul",{className:j(["text-sm text-black font-normal break-all gap-x-3.5","border-b border-gray-200 pb-3 last:border-none","grid grid-cols-[82px_1fr_1fr] grid-rows-1 items-center","lg:gap-x-6 lg:justify-between w-full lg:grid-cols-[125px_1fr_1fr]","max-lg:flex max-lg:flex-col",{"!hidden":l<=0||l>5}]),children:[e.jsxs("div",{className:"w-full lg:hidden",children:[e.jsxs("div",{className:"flex justify-between",children:[e.jsxs("div",{className:"flex flex-col",children:[e.jsx("p",{className:t,children:"Telefone/Contrato:"}),e.jsx("p",{className:m,children:a||(d==="LIVE"?e.jsx("img",{src:`${L}`,srcSet:`${L} 1x, ${_} 2x`,alt:"Logo da Tim Ultra Fibra",className:"w-[82px] h-[17px] lg:w-[100px] lg:h-[21px]"}):r)})]}),e.jsxs("div",{children:[e.jsx("p",{className:t,children:"Vencimento:"}),e.jsx("p",{className:m+"max-lg:whitespace-nowrap",children:i})]})]}),e.jsxs("div",{className:m+"mt-1.5 flex flex-col gap-2",children:[e.jsx("p",{className:t,children:"Suspensão em:"}),e.jsx(M,{to:`contas/${O(r)}`,children:e.jsxs("div",{className:"flex",children:[e.jsx("div",{className:`rounded-s-lg py-1.5 px-2 ${(g=u[l])==null?void 0:g.bgIcon} flex items-center`,children:e.jsx(P,{size:20,color:"white"})}),e.jsxs("div",{className:`rounded-e-lg px-4 ${(p=u[l])==null?void 0:p.bgText} py-1.5 w-full flex items-center gap-3 text-xl`,children:[e.jsxs("span",{children:[l," dias"]}),e.jsx(z,{})]})]})})]})]}),e.jsx("li",{className:m+"max-lg:hidden",children:a||(d==="LIVE"?e.jsx("img",{src:`${L}`,srcSet:`${L} 1x, ${_} 2x`,alt:"Logo da Tim Ultra Fibra",className:"w-[82px] h-[17px] lg:w-[100px] lg:h-[21px]"}):r)}),e.jsx("li",{className:m+"max-lg:whitespace-nowrap max-lg:hidden",children:i}),e.jsx("li",{className:m+"max-lg:-ml-2 max-lg:whitespace-nowrap max-lg:hidden",children:e.jsxs(M,{to:`contas/${O(r)}`,className:"group flex",children:[e.jsx("div",{className:`rounded-s-lg py-1.5 px-2 ${(s=u[l])==null?void 0:s.bgIcon} flex items-center`,children:e.jsx(P,{size:20,color:"white"})}),e.jsxs("div",{className:j(["rounded-e-lg px-4 py-1.5 w-full flex items-center gap-3 text-xl",`${(c=u[l])==null?void 0:c.bgText}`,{"group-hover:bg-red-100":[1,2].includes(l),"group-hover:bg-[#FFF1D3]":[3,4].includes(l),"group-hover:bg-yellow-100":[5].includes(l)}]),children:[e.jsxs("span",{children:[l," dias"]}),e.jsx(z,{})]})]})})]},r)})})]})}),e.jsx(B,{className:"w-full text-gray-100 my-4 text-xs text-center lg:text-left",children:"Caso tenha realizado o pagamento, por favor, desconsidere a mensagem."}),e.jsx(V,{asChild:!0,children:e.jsx(S,{appearance:"secondary",className:"w-full items-center justify-center lg:max-w-[15.938rem] max-h-[40px] lg:max-h-[52px]",children:"Ver contas"})}),e.jsx(Ce,{className:j(["absolute bottom-6 -right-5 -z-10 opacity-20","w-full h-full max-w-[13.313rem] max-h-[13.313rem]","lg:max-w-[17.625rem] lg:max-h-[17.625rem] lg:bottom-auto lg:top-20 lg:-right-1"])})]})})})]})})},ke=({...n})=>e.jsxs("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("rect",{width:"20",height:"20",rx:"10",fill:"#578316"}),e.jsx("g",{clipPath:"url(#clip0_7488_5449)",children:e.jsx("path",{d:"M5.875 10.75L8.5 13.375L14.5 7.375",stroke:"white",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),e.jsx("defs",{children:e.jsx("clipPath",{id:"clip0_7488_5449",children:e.jsx("rect",{width:"12",height:"12",fill:"white",transform:"translate(4 4)"})})})]}),Le=({...n})=>e.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsxs("g",{clipPath:"url(#clip0_7488_5454)",children:[e.jsx("path",{d:"M12.5 3.5L3.5 12.5",stroke:"#385017",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M12.5 12.5L3.5 3.5",stroke:"#385017",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),e.jsx("defs",{children:e.jsx("clipPath",{id:"clip0_7488_5454",children:e.jsx("rect",{width:"16",height:"16",fill:"white"})})})]}),J=n=>e.jsxs("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("rect",{x:"0.5",y:"0.5",width:"27",height:"27",rx:"13.5",fill:"#E0F5FE"}),e.jsx("rect",{x:"0.5",y:"0.5",width:"27",height:"27",rx:"13.5",stroke:"#0026D9"}),e.jsxs("g",{clipPath:"url(#clip0_7668_5487)",children:[e.jsx("path",{d:"M12 18C12 18.5304 12.2107 19.0391 12.5858 19.4142C12.9609 19.7893 13.4696 20 14 20C14.5304 20 15.0391 19.7893 15.4142 19.4142C15.7893 19.0391 16 18.5304 16 18",stroke:"#0026D9",strokeLinecap:"round",strokeLinejoin:"round"}),e.jsx("path",{d:"M9.49992 12.5C9.49992 11.3065 9.97403 10.1619 10.8179 9.31802C11.6619 8.47411 12.8064 8 13.9999 8C15.1934 8 16.338 8.47411 17.1819 9.31802C18.0258 10.1619 18.4999 11.3065 18.4999 12.5C18.4999 14.7387 19.0187 16.5375 19.4312 17.25C19.475 17.3259 19.4981 17.4119 19.4982 17.4996C19.4982 17.5872 19.4753 17.6733 19.4316 17.7492C19.3879 17.8252 19.3251 17.8883 19.2493 17.9324C19.1735 17.9764 19.0875 17.9997 18.9999 18H8.99992C8.91241 17.9995 8.82657 17.976 8.75098 17.9319C8.67539 17.8878 8.61269 17.8246 8.56916 17.7487C8.52564 17.6728 8.5028 17.5868 8.50293 17.4992C8.50306 17.4117 8.52616 17.3258 8.56992 17.25C8.9818 16.5375 9.49992 14.7381 9.49992 12.5Z",stroke:"#0026D9",strokeLinecap:"round",strokeLinejoin:"round"})]}),e.jsx("circle",{cx:"18",cy:"10",r:"2",fill:"#F03E42"}),e.jsx("defs",{children:e.jsx("clipPath",{id:"clip0_7668_5487",children:e.jsx("rect",{width:"16",height:"16",fill:"white",transform:"translate(6 6)"})})})]}),Te=({children:n,...m})=>e.jsx(ee,{className:"relative bg-blue-50",...m,children:n}),Ee=({name:n,quantity:m,protocol:t})=>e.jsxs(se,{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("h2",{className:"text-2xl md:text-3xl capitalize",children:["Olá, ",n]}),e.jsxs("p",{className:"flex items-center gap-2 text-sm before:block before:h-2 before:w-2 before:rounded-full before:bg-red md:text-base",children:["Você possui ",m," contrato(s)"]})]}),e.jsxs("div",{className:"text-right max-md:hidden",children:[e.jsx("p",{children:"Protocolo de atendimento:"}),e.jsx("p",{children:t})]})]}),Oe=({children:n,title:m,contracts:t,userType:u})=>e.jsxs("div",{className:"container mt-6 grow md:mt-10 lg:mt-14",children:[e.jsx("h3",{className:"text-center text-lg font-bold text-gray-900 md:text-xl",children:m||"Selecione o contrato desejado para prosseguir com o atendimento:"}),e.jsx("div",{className:"my-4 flex flex-col items-center gap-4 md:my-6 md:gap-6 lg:my-8 ",children:n}),u!=="PJ"&&e.jsx(De,{contracts:t})]}),$e=q(["flex w-full max-w-sm flex-col rounded-[1rem] p-5","md:max-w-[48.375rem] md:items-start md:justify-between","xl:max-w-full"],{variants:{type:{true:["gap-5 bg-[linear-gradient(90deg,#2147FF_22.59%,#021EA3_93.27%)] curs
1or-pointer","md:flex-row md:flex-wrap md:gap-5","xl:flex-row xl:flex-nowrap xl:items-center xl:gap-10"],false:["gap-5 bg-white","md:flex-row md:items-center md:justify-between md:gap-x-8 md:flex-wrap md:gap-y-3","xl:grid xl:grid-cols-2 xl:max-h-[128px]","2xl:gap-x-[5.625rem]"]}}}),Fe=({userType:n,children:m,type:t,refBtnDetails:u,serviceSuspension:w,showOfferMessage:b,contractLength:N,onClick:x,onClickDetails:v,...o})=>{const y=t?oe:"div",C=t?de:"div",f=h.useRef(null),a=l=>{var d,g,p;l.stopPropagation();const r=(d=f.current)==null?void 0:d.classList;r!=null&&r.contains("hidden")?(g=f.current)==null||g.classList.remove("hidden"):(p=f.current)==null||p.classList.add("hidden")},i=q(["relative md:pt-8","after:absolute after:top-0 after:right-0 after:rounded-bl-md after:rounded-tr-2xl","after:font-bold after:text-white after:text-sm after:text-center after:leading-[1.375rem] ","after:content-['Oferta!!']","after:w-[92px]","after:bg-gradient-to-r after:from-[#F2082A] after:to-[#FF6479]"]);return e.jsxs("div",{children:[b&&e.jsxs("div",{className:"bg-green-50 w-full pt-4 pb-8 px-6 flex gap-4 justify-between items-center rounded-t-2xl min-h-16 -mb-4 max-w-sm cursor-pointer md:max-w-[48.375rem] md:items-start md:justify-between xl:max-w-full",ref:f,children:[e.jsxs("p",{className:"text-green-600 flex gap-4 items-center text-sm lg:text-lg",children:[e.jsx("span",{children:e.jsx(ke,{})}),"Após o pagamento",N>1||t?" deste contrato":null,", uma oferta exclusiva de menor valor do seu plano será desbloqueada para você!"]}),e.jsx("button",{onClick:a,children:e.jsx(Le,{})})]}),e.jsxs(y,{className:te($e({type:!!t}),t==="PROMOTIONAL"&&i()),onClick:t?x:void 0,children:[t?e.jsxs("div",{className:"flex items-center gap-5 md:min-h-full md:w-full xl:w-fit xl:items-center xl:justify-start",children:[t==="PROMOTIONAL_FEES"&&e.jsxs(e.Fragment,{children:[e.jsx(ae,{className:"md:h-31 h-14 w-14 md:w-13 xl:h-14 xl:w-14"}),e.jsx("p",{className:"text-sm font-bold text-white xl:block xl:max-w-[12.813rem] xl:text-base",children:"100% de desconto nos juros e multa na próxima fatura."})]}),t==="PROMOTIONAL"&&e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(ye,{className:"md:h-31 h-14 w-14 md:w-13 xl:h-14 xl:w-14"}),e.jsxs("span",{className:"font-bold text-5xl text-[#F6D94E] drop-shadow-black",children:[o.discountPercentage,"%"]}),e.jsx("p",{className:"text-base font-bold text-white xl:block xl:max-w-[8.625rem]",children:"De desconto neste contrato."})]})]}):null,w&&!t&&n!=="PJ"&&e.jsxs("div",{className:"flex gap-2 w-full md:justify-center xl:col-span-2",children:[e.jsx(P,{size:20,className:"flex-none"}),e.jsx("span",{className:"text-sm text-gray-800 lg:text-base",children:"Efetue o pagamento para evitar a suspensão dos serviços contratados nos próximos dias."})]}),e.jsxs("div",{className:"flex",children:[e.jsxs("ul",{className:`flex-1 flex flex-col gap-5 ${t?"justify-start md:flex-1 flex-col-reverse md:items-start xl:flex-auto xl:items-end":"md:flex-row md:gap-8 xl:gap-[5.625rem] 2xl:w-full"} `,children:[e.jsxs(C,{className:j(["flex items-center gap-4 transition-all data-closed:hidden","md:w-full xl:gap-[3rem] xl:justify-between md:gap-8",`${t&&"xl:max-w-[24rem] xl:justify-between"}`]),children:[e.jsxs("li",{className:"w-6/12 xl:w-[8.75rem]",children:[e.jsx("p",{className:`text-sm md:text-base ${t?"text-blue-100":"text-gray-400"}`,children:"Contrato:"}),e.jsx("p",{className:t?"font-bold text-white":"font-bold text-gray-700",children:o.reference})]}),e.jsx("li",{className:"w-6/12 xl:w-[8.75rem]",children:o.phone?e.jsxs(e.Fragment,{children:[e.jsx("p",{className:`text-sm md:text-base ${t?"text-blue-100":"text-gray-400"}`,children:"Telefone:"}),e.jsx("p",{className:t?"font-bold text-white":"whitespace-nowrap font-bold text-gray-700",children:W(o.phone)})]}):o.productType==="LIVE"?e.jsx("img",{src:`${L}`,srcSet:`${L} 1x, ${_} 2x`}):null})]}),e.jsxs("div",{className:j(["flex justify-between gap-4","xl:w-full xl:items-center xl:justify-center xl:gap-[3rem]",`${t&&"xl:max-w-[24rem] xl:justify-between"}`]),children:[e.jsxs("li",{className:`w-6/12 md:w-fit xl:w-[8.75rem] 
2                ${t&&t==="PROMOTIONAL_FEES"&&"xl:min-w-[14.688rem]"}`,children:[e.jsxs("p",{className:`text-sm md:text-base ${t?"text-blue-100 xl:whitespace-nowrap":"text-gray-400"}`,children:[t?t==="PROMOTIONAL_FEES"?"Juros e Multa na próxima fatura":"Valor sem desconto":"Conta(s)",":"]}),e.jsx("p",{className:`font-bold ${t?t==="PROMOTIONAL_FEES"?"text-white":"text-white line-through":"text-gray-700"}`,children:t?t==="PROMOTIONAL_FEES"?E(o.discountedValue??""):E(o.value):o.invoiceQuantity})]}),e.jsxs("li",{className:`w-6/12 md:w-fit ${t?t==="PROMOTIONAL_FEES"&&"xl:w-[5.7rem]":"xl:w-[8.75rem]"}`,children:[e.jsxs("p",{className:`text-sm md:whitespace-nowrap md:text-base ${t?"text-blue-100":"text-gray-400"}`,children:[t?t==="PROMOTIONAL_FEES"?"Valor":"Valor com desconto":"Valor em aberto",":"]}
2),e.jsx("p",{className:t?"font-bold text-green-100":"font-bold text-gray-700",children:t==="PROMOTIONAL"?E(o.discountedValue??""):E(o.value)})]})]})]}),b&&e.jsx("div",{className:"md:hidden lg:hidden",onClick:a,children:e.jsx(J,{})})]}),e.jsxs("div",{className:"flex gap-3 md:flex-1 md:justify-end xl:flex-auto items-center",children:[t&&e.jsx(le,{asChild:!0,ref:u,onClick:l=>l.stopPropagation(),children:e.jsxs(S,{appearance:"tertiary",className:"group md:min-w-[8.125rem] md:px-3",children:[e.jsx($,{className:"group-data-closed:hidden",children:"Ocultar"}),e.jsx($,{className:"group-data-open:hidden",children:"Detalhes"}),e.jsx(re,{className:"transition-all group-data-open:rotate-180",size:24})]})}),e.jsx(S,{asChild:!0,appearance:t?"secondary":"primary",onClick:l=>{v&&v(),l.stopPropagation()},children:e.jsxs(ne,{className:`!justify-center whitespace-nowrap ${t?"w-full max-w-[12.625rem]":"w-full flex-1 md:max-w-[12.625rem] xl:w-[12.625rem]"}`,children:[e.jsx(ie,{children:m}),e.jsx($,{className:"text-center",children:t?"Aproveitar oferta":"Ver contas"})]})}),b&&e.jsx("div",{className:"hidden md:block",onClick:a,children:e.jsx(J,{})})]})]})]})},Ve=()=>{const n=s=>(s=O(s),!(s.length!==11||s[2]!=="9")),m=F.object({phone:F.string().optional().transform(s=>s==null?void 0:s.replace(/\D/g,"")),email:F.string().email("default").optional()}).refine(s=>!!n((s==null?void 0:s.phone)??""),{path:["phone"],message:"invalid"}),{registerNavigation:t,reports:u}=ce(),{isInactive:w,handleStopDetection:b}=xe(),{refetch:N,contracts:x,contractCriteria:v}=me(),{user:o}=ge(),{state:y}=he();be({resolver:Ne(m)}),h.useState(!1),h.useState(void 0);const C=h.useRef([]),[,f]=ue(),a=h.useCallback(async()=>{await N()},[N]);h.useEffect(()=>{x||a()},[x,a]),h.useEffect(()=>{if(x){const s=x.map(c=>{if(c!=null&&c.products.find(D=>v.includes(D.name)))return{contract:c.reference,products:c.products,origin:c.origin}});t({action:u.home_page,...s.length&&{custom:{blindage:{contracts:s}}}}),b()}},[]);const i=s=>Math.min.apply(null,s),l=s=>{const c=s.map(T=>new Date(T.dueDate).getTime()),D=new Date().getTime()-i(c);return Math.floor(D/(1e3*60*60*24))},r=x==null?void 0:x.map(s=>{var T,R,A;const c=(T=s.products)!=null&&T.length?s.products[0].name:null,D=new Date(`${s.debts[0].dueDate} 00:00:00`).getDate()===10&&c==="TIM"?18:20,k=l(s.debts)>=15&&l(s.debts)<D;return{reference:s.reference,phone:((R=s.contacts)==null?void 0:R.phone)??null,invoiceQuantity:s.debts.length,value:s.values.total,products:s.products,...((A=s.campaign)==null?void 0:A.value)&&{type:s.campaign.discountPercentage==="0"?"PROMOTIONAL_FEES":"PROMOTIONAL",discountedValue:s.campaign.discountPercentage==="0"?0:s.campaign.value,discountPercentage:s.campaign.discountPercentage},serviceSuspension:k,productType:c??""}}).sort((s,c)=>s.type?-1:c.type?1:0);h.useEffect(()=>{r!=null&&r.length?f(!1):f(!0)},[r==null?void 0:r.length]);const d=s=>{C.current[s].click()},g=h.useRef(!1);h.useEffect(()=>(w&&U.get("paymentStatus")!=="success"&&(g.current||(t({action:u.stop_at_home_contracts_screen}),g.current=!0)),()=>{w&&b()}),[w,g]);const p=U.get("name")??void 0;return e.jsxs(Te,{children:[e.jsx(pe,{name:p}),e.jsx(Ee,{name:p??"",quantity:r==null?void 0:r.length,protocol:(y==null?void 0:y.protocol)??""}),e.jsx(Oe,{contracts:x,userType:o==null?void 0:o.type,children:x&&(r==null?void 0:r.map((s,c)=>{const D=!!s.products.find(k=>v.includes(k.name));return e.jsx(Fe,{userType:o==null?void 0:o.type,refBtnDetails:k=>k&&(C.current[c]=k),onClick:()=>d(c),onClickDetails:()=>b(),...s,showOfferMessage:D,contractLength:x.length,children:e.jsx(M,{to:`contas/${O(s.reference)}`})},s==null?void 0:s.reference)}))})]})};export{Ve as default};

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.