PageSourceSearch

https://www2.madeiramadeira.com.br/_next/static/chunks/pages/myaccount/orders/callcenter-cf900937f84bd331.js

js madeiramadeira.com.br collected 2026-10-01 12:39:24 UTC 131,878 bytes, 2 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[766,2988],{9001:function(e,t){"use strict";t.DF={prefix:"fas",iconName:"camera",icon:[512,512,[62258,"camera-alt"],"f030","M149.1 64.8L138.7 96 64 96C28.7 96 0 124.7 0 160L0 416c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-256c0-35.3-28.7-64-64-64l-74.7 0L362.9 64.8C356.4 45.2 338.1 32 317.4 32L194.6 32c-20.7 0-39 13.2-45.5 32.8zM256 192a96 96 0 1 1 0 192 96 96 0 1 1 0-192z"]},t._j=t.DF},48079:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a="circle-info",s=["info-circle"],o="f05a",n="M256 512A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM216 336l24 0 0-64-24 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l48 0c13.3 0 24 10.7 24 24l0 88 8 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-80 0c-13.3 0-24-10.7-24-24s10.7-24 24-24zm40-208a32 32 0 1 1 0 64 32 32 0 1 1 0-64z";t.definition={prefix:"fas",iconName:a,icon:[512,512,s,o,n]},t.faCircleInfo=t.definition,t.prefix="fas",t.iconName=a,t.width=512,t.height=512,t.ligatures=s,t.unicode=o,t.svgPathData=n,t.aliases=s},41233:function(e,t,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/myaccount/orders/callcenter",function(){return a(20041)}])},76987:function(e,t,a){"use strict";a.d(t,{P:function(){return l},Z:function(){return TextQuestion}});var s=a(85893),o=a(63940),n=a(34356),i=a(44118),r=a(15484);function TextQuestion({number:e,title:t,description:a,css:r}){return(0,s.jsxs)(o.Z,{css:r,children:[(0,s.jsxs)(n.Z,{css:{"@md":{alignItems:"center"}},children:[(0,s.jsx)(l,{children:e}),(0,s.jsx)(i.Z,{as:"span",textStyle:"bodyMediumSemibold",css:{flex:1,mt:"-$small1","@md":{mt:"0"}},children:t})]}),(0,s.jsx)(i.Z,{as:"p",textStyle:"bodySmallRegular",css:{color:"$neutral4",mt:"$small2"},children:a})]})}let l=(0,r.zo)(n.Z,{ta:"center",width:"$medium1",height:"$medium1",fontSize:"$bodyXSmall",lineHeight:1,justifyContent:"center",alignItems:"center",bc:"$primary2",fontWeight:"$bold",color:"white",br:"$circle",mr:"$small2"})},92426:function(e,t,a){"use strict";var s=a(85893);t.Z=function({href:e,target:t,children:a,rel:o,onClick:n,ariaLabel:i}){return(0,s.jsx)("a",{href:e,target:t,onClick:n,rel:o,"aria-label":i,style:{textDecoration:"none"},children:a})}},5612:function(e,t,a){"use strict";a.d(t,{Z:function(){return ShadowCard}});var s=a(85893),o=a(63940),n=a(76987);function ShadowCard({number:e,title:t,description:a,children:i,css:r}){return(0,s.jsxs)(o.Z,{css:{bc:"$mono1",bs:"$shadowXSmall",br:"$small",p:"$medium1","@md":{mx:"0"},...r},children:[t&&(0,s.jsx)(n.Z,{number:e,title:t,description:a}),i]})}(0,a(15484).zo)(o.Z,{bs:"none",display:"none","@md":{br:"$small",bs:"$shadowXSmall",display:"block",bc:"$mono1"}})},3449:function(e,t,a){"use strict";var s=a(85893),o=a(44118),n=a(34356),i=a(56135),r=a(35067),l=a(92426);t.Z=function({message:e,link:t,targetBlank:a,linkUnderline:d=!1,icon:c=r.sp,showIcon:m=!0,css:u,onClickHelp:x}){return(0,s.jsx)(n.Z,{alignItems:"center",css:u,children:(0,s.jsxs)(o.Z,{textStyle:"bodySmallRegular",css:{color:"$neutral4",textAlign:"center"},children:[e?"string"==typeof e?`${e} `:`${e[0]} `:"",a?(0,s.jsx)(l.Z,{href:a,target:"_blank",children:(0,s.jsx)(o.Z,{textStyle:"bodySmallSemibold",css:{color:"$secondary4",cursor:"pointer",textDecoration:d?"underline":"none"},children:t})}):(0,s.jsx)(o.Z,{textStyle:"bodySmallSemibold",css:{color:"$secondary4",cursor:"pointer",textDecoration:d?"underline":"none"},onClick:x,children:t}),m&&(0,s.jsx)(i.Z,{icon:c,iconSize:14}),e&&"string"!=typeof e?` ${e[1]}`:""]})})}},61119:function(e,t,a){"use strict";a.d(t,{Z:function(){return TimeLineMyAccount}});var s=a(85893),o=a(63940),n=a(34356),i=a(44118),r=a(56135),l=a(81472),d=a(12489),c=a(35067),m=a(5612);function TimeLineMyAccount({events:e,css:t}){return(0,s.jsx)(m.Z,{css:t,children:(0,s.jsx)(n.Z,{direction:"column",css:{flexGrow:1},children:e.map((t,a)=>(0,s.jsxs)(n.Z,{css:{position:"relative",minHeight:t.done?"75px":a+1<e.length?"47px":"20px","@md":{minHeight:t.done?"48px":a+1<e.length?"39px":"20px"}},children:[(0,s.jsxs)(n.Z,{direction:"column",alignItems:"center",css:{width:"$medium1"},children:[t.done?(0,s.jsx)(IconDone,{}):(0,s.jsx)(IconDefault,{}),a+1<e.length&&(0,s.jsx)(ConnectorDefault,{})]}),(0,s.jsx)(o.Z,{css:{flex:"1 1",ta:"left"},children:(0,s.jsxs)(n.Z,{direction:"column",css:{ml:"$small2",mt:"-$small1",pb:t.tooltip?"$medium2":"0"},children:[(0,s.jsx)(i.Z,{as:t.done?"h3":"h5",textStyle:t.done?"h3Semibold":"h5Semibold",css:t.done?{color:"$neutral5",lh:1.2,mt:"$small1"}:{color:"$neutral4",lh:1.2},children:t.title}),t.content,t.tooltip&&(0,s.jsx)(l.Z,{trigger:(0,s.jsxs)(n.Z,{alignItems:"center",css:{color:"$secondary4"},children:[(0,s.jsx)(i.Z,{as:"span",textStyle:"bodySmallSemibold",css:{mr:"$small1",ml:"-$small1",color:"$secondary4"},children:t.tooltip}),(0,s.jsx)(r.Z,{icon:c.sp,iconSize:14})]}),message:t.tooltipMessage,side:"bottom",align:"center"})]})})]},a))})})}
1function IconDefault(){return(0,s.jsx)(o.Z,{css:{border:"2px solid $white",width:"$small3",height:"$small3",br:"$circle",zIndex:1,bc:"$neutral3"}})}function IconDone(){return(0,s.jsx)(n.Z,{alignItems:"center",justifyContent:"center",css:{bc:"$warning2",width:"$medium3",height:"$medium3",br:"$circle",border:"1px solid $mono1"},children:(0,s.jsx)(r.Z,{icon:d.f8,iconSize:19,css:{color:"$primary2"}})})}function ConnectorDefault(){return(0,s.jsx)(o.Z,{css:{width:"2px",flexGrow:1,bc:"$neutral3"}})}},42988:function(e,t,a){"use strict";a.d(t,{Z:function(){return layout_LayoutMyAccount}});var s=a(85893),o=a(33299),n=a(5152),i=a.n(n),r=a(9008),l=a.n(r),d=a(11163),c=a(83457),m=a.n(c),u=a(67294);a(14717),a(96533);var x=a(63940),p=a(34356),h=a(44118),g=a(25939),f=a(15484),b=a(5612),j=a(79414),y=a(22451),S=a(30158),v=a(52755),C=a(31393),$=a(28199),Z=a(44468),w=a(57579),_=a(98502),I=a(88659),M=a(24832),R=a(40720),E=a(20824),T=a(3457),A=a(48193);let defaultLinks=(e,t)=>{let a={orders:{title:"Pedidos",size:"small",as:"a",href:A.t$,element:(0,s.jsx)(Z.J,{icon:_.IA,size:"icon-small",color:"$background-brand-primary-default"})},services:{title:(0,s.jsxs)(p.Z,{direction:"row-reverse",alignItems:"center",children:["Servi\xe7os",t?.services&&(0,s.jsx)(x.Z,{css:{width:"8px",height:"8px",ml:"$medium1",backgroundColor:"$danger2",borderRadius:"50%"}})]}),size:"small",as:"a",href:A.Jb,element:(0,s.jsx)(Z.J,{icon:R.faScrewdriverWrench,size:"icon-small",color:"$background-brand-primary-default"})},wallet:{title:"Carteira",size:"small",as:"a",href:A.bH,element:(0,s.jsx)(Z.J,{icon:T.X5,size:"icon-small",color:"$background-brand-primary-default"})},attendence:{title:"Atendimentos",size:"small",as:"a",href:"https://ajuda.madeiramadeira.com.br/hc/pt-br/requests",element:(0,s.jsx)(Z.J,{icon:T.X5,size:"icon-small",color:"$background-brand-primary-default"})},adresses:{title:"Endere\xe7os",size:"small",as:"a",href:A.v2,element:(0,s.jsx)(Z.J,{icon:M.FG,size:"icon-small",color:"$background-brand-primary-default"})},information:{title:"Cadastro",size:"small",as:"a",href:A.ed,element:(0,s.jsx)(Z.J,{icon:E.IL,size:"icon-small",color:"$background-brand-primary-default"})},privacy:{title:"Privacidade",size:"small",as:"a",href:A.Vm,element:(0,s.jsx)(Z.J,{icon:I.by,size:"icon-small",color:"$background-brand-primary-default"})}};return a[e]},getLinks=(e,t)=>Object.entries(e).filter(([,e])=>e).map(([e])=>defaultLinks(e,t)),parseDatoInfo=(e,t,a,o)=>e?.length===0?getLinks(t,a):e?.map(e=>({text:e.titleDesktop,href:e?.link?.url,icon:e.icon?s.jsx(Z.J,{icon:w.q[e?.icon],size:o?"icon-medium":"icon-small"}):""})),parseInformation=(e,t,a,s)=>{let o=parseDatoInfo(e,t,a,s);return[...o]};var k=a(33887),P=a(41664),N=a.n(P);let q={fontSize:"$bodySmall","@md":{fontSize:"$bodyMedium"},marginLeft:"10px"};var LinksLogged=function({showIcons:e,css:t,typeTrack:a,clientChannels:o,clientMenu:n,hasNotification:i,isNew:r,sideMenu:l}){let d=parseInformation(o,n,(0,k.Z)(),l),{trackHeaderInteraction:c}=(0,$.Z)(),m="$small2";return l&&(m="$small1"),(0,s.jsx)(x.Z,{as:"ul",css:{"li:nth-child(1)":{mt:"$none"},"li:nth-child(n+2)":{mt:m}},children:d.map(o=>!o||"Sair"===o.text&&l?null:(0,s.jsxs)(p.Z,{as:"li",alignItems:"center",css:{...t,"> i":{color:"#EA5B0C"},minWidth:"150px"},onClick:()=>c({interaction_type:a,interaction_value:o?.text||null}),children:[e&&o?.icon,o?.href.includes("/minha-conta")?(0,s.jsx)(N(),{href:o?.href,children:(0,s.jsx)(h.Z,{as:"span",css:q,children:o?.text})}):(0,s.jsx)(h.Z,{as:"a",href:o?.href,css:q,children:o?.text}),r&&o?.text?.includes("Servi\xe7os")&&(0,s.jsx)(x.Z,{css:{ml:"6px",p:"6px",fontSize:"12px",backgroundColor:"#F5EB64",borderRadius:"6px",fontWeight:600},children:"NOVIDADE"}),o?.text?.includes("Servi\xe7os")&&i&&(0,s.jsx)(x.Z,{css:{width:"8px",height:"8px",ml:"$medium1",backgroundColor:"$danger2",borderRadius:"50%"}})]},o?.text))})},O=a(95096),D=a(51492),F=a(36463),z=a(71479),L=a(20803);function MenuBalanceCard({value:e}){let{pathname:t}=(0,d.useRouter)(),{navigate:a}=(0,D.H)();if("/myaccount/wallet"!==t)return(0,s.jsxs)(z.kC,{align:"center",justify:"spaceBetween",css:{py:"$medium",px:"$small",borderRadius:"$large",bgColor:"$background-neutral-subtlest",mt:"$medium",mb:"$small"},children:[(0,s.jsxs)(z.kC,{direction:"column",gap:"$small",children:[(0,s.jsx)(L.x,{as:"span",textStyle:"xsmall",weight:"regular",css:{fontSize:"$body-xxsmall"},children:"Saldo para compras na Madeira"}),(0,s.jsx)(L.x,{as:"p",textStyle:"h7",children:(0,O.tf)({value:e})})]}),(0,s.jsx)(F.z,{label:"Abrir",variant:"tertiary",size:"xsmall",onClick:a.toWallet})]})}
1var V=a(65109),U=a(95382),B=a(25352),J=a(2147),X=a(67711),W=a(79237),G=a(26862);let H=i()(()=>a.e(1740).then(a.bind(a,81740)),{loadableGenerated:{webpack:()=>[81740]},ssr:!1}),Q=i()(()=>a.e(1685).then(a.bind(a,81102)),{loadableGenerated:{webpack:()=>[81102]}}),K=i()(()=>a.e(9424).then(a.bind(a,9424)),{loadableGenerated:{webpack:()=>[9424]},ssr:!1});var layout_LayoutMyAccount=function({children:e,pageProps:{menu:t,footerData:a,header:n}}){let i=(0,d.useRouter)(),{slug:r}=i.query,{data:c}=(0,o.useSession)(),{preview:$}=(0,X.Z)(),{balances:Z}=(0,B.KQ)(),{setPageView:w}=(0,v.l8)(),{isNewCustomerArea:_,isResolved:I}=(0,W.t)(),M=i.asPath.startsWith(A.xO),R=(0,u.useContext)(U.F),E=c?c.given_name:"Cliente",{header:{clientMenu:T,clientChannels:k}}=R;return(0,u.useEffect)(()=>{w(i.pathname)},[i.pathname]),(0,u.useEffect)(()=>{document.body.classList.add(J.x2.SCROLL)},[]),(0,s.jsxs)(x.Z,{children:[(0,s.jsxs)(l(),{children:[(0,s.jsx)("title",{children:"Minha Conta"}),(0,s.jsx)("meta",{charSet:"utf-8"}),(0,s.jsx)("meta",{name:"theme-color",content:"#FAFAFA"}),(0,s.jsx)("meta",{name:"viewport",content:"initial-scale=1.0, width=device-width"}),(0,s.jsx)("meta",{httpEquiv:"Accept-CH",content:"viewport-width, width, device-memory, dpr, downlink, ect"}),(0,s.jsx)("link",{rel:"apple-touch-icon",href:"/assets/apple-touch-icon-152x152.png"})]}),(0,s.jsx)(m(),{color:f.O9.secondary4,options:{showSpinner:!1,easing:"ease",speed:500},height:7}),$&&(0,s.jsx)(Q,{}),(0,s.jsx)(y.Z,{menuData:t,header:n}),(0,s.jsx)(S.Z,{sideMenuData:t}),!I&&(0,s.jsx)(z.xu,{as:"main",css:{minH:"50vh"}}),I&&_&&(0,s.jsxs)(z.xu,{as:"main","data-testid":"page-content",css:{bgColor:M?"$background-neutral-subtlest":"$background-neutral-default",pt:"$large"},children:[(0,s.jsx)(z.xu,{css:{maxWidth:"1366px",mx:"auto"},children:e}),(0,s.jsx)(G.i,{css:{mt:"$xlarge"}})]}),I&&!_&&(0,s.jsx)(x.Z,{id:"control-box-content",as:"main",css:{border:"1px solid $neutral2",bc:"$neutral1",mx:"0",py:"$medium3",width:"100%"},children:(0,s.jsx)(g.W2,{children:(0,s.jsxs)(g.X2,{children:[(0,s.jsx)(g.JX,{md:4,lg:3,children:(0,s.jsx)(x.Z,{css:{display:"none","@md":{display:"block"}},children:(0,s.jsx)(b.Z,{children:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(p.Z,{alignItems:"center",children:[(0,s.jsx)(C.Z,{name:"Avatar",width:45,height:45}),(0,s.jsxs)(x.Z,{css:{ml:"$small2"},children:[c?(0,s.jsxs)(h.Z,{as:"h4",textStyle:"h4Semibold",children:["Ol\xe1, ",E,"!"]}):(0,s.jsx)(V.Skeleton,{height:"20px",animation:!0,css:{my:"$small2"}}),(0,s.jsx)(h.Z,{as:"p",textStyle:"bodyXSmallRegular",css:{color:"$neutral4"},children:"Bem-vindo(a) a \xc1rea do Cliente"})]})]}),(0,s.jsx)(x.Z,{css:{width:"100%",borderTop:"1px solid $neutral2",mt:"$medium1"}}),(0,s.jsxs)(p.Z,{direction:"column",children:[Z?.balance_types.checking_account>0&&(0,s.jsx)(MenuBalanceCard,{value:Z.balance_types.checking_account}),(0,s.jsx)(LinksLogged,{showIcons:!0,isNew:!1,sideMenu:!0,css:{p:"$small2 $none","> a":{textDecoration:"none"}},typeTrack:"Area Logada",hasNotification:!1,clientMenu:T||{},clientChannels:k||[]})]})]})})})}),(0,s.jsx)(g.JX,{md:8,lg:9,children:e})]})})}),(0,s.jsxs)(x.Z,{as:"footer",css:{left:"0",bottom:"0",width:"100%"},children:[(0,s.jsx)(j.Z,{footerData:a}),(0,s.jsx)(H,{pathname:i.pathname,routerSlug:r})]}),(0,s.jsx)(K,{title:"Cookies: A MadeiraMadeira utiliza cookies para personalizar conte\xfados e melhorar a sua experi\xeancia no site. Ao continuar navegando, voc\xea concorda com a nossa Pol\xedtica de Privacidade"})]})}},40768:function(e,t,a){"use strict";a.d(t,{Z:function(){return CSAT}});var s=a(85893),o=a(67294),n=a(24235),i=a(41642),r=a(55388),l=a(79619),d=a(63940),c=a(34356),m=a(44118),u=a(50592),x=a(56135),p=a(47598),h=a(5612),g=a(76987),f=a(42384),b=a(57546),j=a(83064),y=a(22127),S=a(19738),v=a(12489),C=a(2741),$=a(76),Z=a(81259),w=a(41796);let _=[{id:"5",icon:S.rQ,label:"Muito satisfeito",color:"$success2"},{id:"4",icon:y.xC,label:"Satisfeito",color:"$success1"},{id:"3",icon:j.I3,label:"Neutro",color:"$warning4"},{id:"2",icon:b.C4,label:"Insatisfeito",color:"$danger2"},{id:"1",icon:f.Kf,label:"Muito insatisfeito",color:"$danger3"}],I=[{number:"1",callcenterTitle:"Como voc\xea avalia sua satisfa\xe7\xe3o com essa solicita\xe7\xe3o de atendimento?",trackingTitle:'Qual foi a sua satisfa\xe7\xe3o <b style="font-weight: bold">durante o acompanhamento</b> da sua entrega?',array:_},{number:"2",title:"Qual o motivo da sua avalia\xe7\xe3o?",array:[{id:"5",label:"N\xe3o encontrei a informa\xe7\xe3o que eu preciso"},{id:"4",label:"Dificuldade de encontrar a op\xe7\xe3o de solicita\xe7\xe3o de atendimento"},{id:"3",label:"Atendimento n\xe3o sanou as d\xfavidas sobre o pedido"},{id:"2",label:"N\xe3o concordo com a pol\xedtica apresentada"},{id:"1",label:"Outro motivo"}]}];function CSAT({origin:e,reference:t,css:a,order:f,items:b,reason:j}){let{showAlert:y}=(0,i.Z)(),{setShowLoading:S}=(0,n.OI)(),_=(0,o.useRef)(),[M,R]=(0,o.useState)(0),[E,T]=(0,o.useState)(!1),[A,k]=(0,o.useState)(!1),[P,N]=(0,o.useState)(""),[q,O]=(0,o.useState)({satisfaction_scale:"",reason_evaluation:"",positive_comments:"",description_other_reason:""});(0,o.useEffect)(()=>{(0,$.l)({interaction_step:"4",interaction_orderid:String(f)||null,interaction_orderstatus:sessionStorage.getItem("orderStatus")||null,interaction_orderpaymentmethod:sessionStorage.getItem("paymentMethod")||null,interaction_value:"Solicitar Atendimento",interaction_sku:String(b)||null,interaction_reason:j||null,attendance_id:String(t)})},[]);let handleSatisfactionTest=e=>{O({...q,satisfaction_scale:String(e)}),k(!0),e>3&&(R(1),T(!0)),e<4&&(R(2),T(!0))},handleRatingSend=async a=>{(0,C.AQ)(q);let s=q.reason_evaluation;q.description_other_reason?s=q.description_other_reason:1===M&&(s=q.positive_comments);let o={idfk_avaliacao_origem:e,id_referencia:String(t),satisfacao:q.satisfaction_scale,observacao:s};try{let{status:e}=await (0,r.lZ)(a,o);200===e&&(S(null),R(4))}catch(e){console.error(e),y({type:"error",title:"N\xe3o foi poss\xedvel registrar sua avalia\xe7\xe3o.",autohide:!0,variation:"toast"})}};return(0,s.jsxs)(d.Z,{css:a,children:[(0,s.jsx)(h.Z,{children:(0,s.jsxs)(c.Z,{direction:"column",children:[(0,s.jsxs)(m.Z,{as:"h5",textStyle:"h5Light",children:[4===M&&(0,s.jsx)(x.Z,{icon:v.f8,iconSize:20,css:{color:"$success1",mr:"$small2"}}
1),M<4?"Como foi sua experi\xeancia?":"Avalia\xe7\xe3o enviada!"]}),e===r.AY.RASTREIO_1P?(0,s.jsx)(m.Z,{as:"p",textStyle:"bodySmallRegular",css:{mt:"$medium1"},children:M<4?"Conte para gente como foi acompanhar essa entrega.":"A MadeiraMadeira agradece a sua participa\xe7\xe3o."}):(0,s.jsx)(m.Z,{as:"p",textStyle:"bodySmallRegular",css:{mt:"$medium1"},children:M<4?"Nos ajude a melhorar contando como foi sua experi\xeancia ao abrir a solicita\xe7\xe3o de atendimento.":"A MadeiraMadeira agradece a sua participa\xe7\xe3o."}),M<=3&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(d.Z,{css:{my:"$medium1",borderTop:"1px solid $neutral2"}}),(0,s.jsx)(w.Z,{number:I[0].number,title:e===r.AY.RASTREIO_1P?I[0].trackingTitle:I[0].callcenterTitle}),(0,s.jsx)(c.Z,{css:{flexDirection:"column","@md":{flexDirection:"row"}},children:I[0].array.map(e=>(0,s.jsxs)(c.Z,{alignItems:"center",css:{width:"100%",cursor:"pointer",mt:"$small2",py:"$small2",px:"$medium1",br:"$small",color:q.satisfaction_scale===e.id?"$alwaysWhite":e.color,bc:q.satisfaction_scale===e.id?e.color:"$alwaysWhite","@md":{width:"auto"},"& > p":{color:q.satisfaction_scale===e.id?"$alwaysWhite":e.color},"&:hover":{bc:e.color,color:"$alwaysWhite","& > p":{color:"$alwaysWhite"}}},onClick:()=>handleSatisfactionTest(Number(e.id)),children:[(0,s.jsx)(x.Z,{icon:e.icon,iconSize:20,css:{mr:"$small2"}}),(0,s.jsx)(m.Z,{as:"p",textStyle:"bodyMediumBold",children:e.label})]},e.id))})]}),1===M&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(d.Z,{css:{my:"$medium1",borderTop:"1px solid $neutral2"}}),(0,s.jsx)(g.Z,{number:I[1].number,title:I[1].title,css:{mb:"$medium1"}}),(0,s.jsx)(u.Z,{as:"textarea",floatingLabel:!0,label:"Conte mais detalhes (opcional)",caption:`${q.positive_comments.length} / 120`,maxLength:120,onChange:e=>O({...q,positive_comments:e.target.value})})]}),(2===M||3===M)&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(d.Z,{css:{my:"$medium1",borderTop:"1px solid $neutral2"}}),(0,s.jsx)(g.Z,{number:I[1].number,title:I[1].title,css:{mb:"$medium1"}}),(0,s.jsx)(u.Z,{as:"textarea",floatingLabel:!0,label:"Conte mais detalhes (opcional)",caption:`${q.description_other_reason.length} / 120`,maxLength:120,onChange:e=>O({...q,description_other_reason:e.target.value})})]}),M>0&&M<4&&(0,s.jsx)(p.Z,{as:"button",label:"Enviar avalia\xe7\xe3o",state:"default",variant:"secondary",css:{mt:"$medium2",width:"100%","@md":{width:"auto",mx:"auto"}},disabled:!E,onClick:()=>{(0,$.l)({interaction_step:"5",interaction_orderid:String(f)||null,interaction_orderstatus:sessionStorage.getItem("orderStatus")||null,interaction_orderpaymentmethod:sessionStorage.getItem("paymentMethod")||null,interaction_value:"Solicitar Atendimento",interaction_sku:String(b)||null,interaction_reason:j||null,attendance_id:String(t),attendance_ratting:(0,Z.t)(Number(q.satisfaction_scale))||null}),S("Enviando avalia\xe7\xe3o. Aguarde, por favor."),_.current?.execute()}})]})}),(0,s.jsx)(l.Z,{theme:"light",size:"invisible",ref:_,onVerify:handleRatingSend})]})}},41796:function(e,t,a){"use strict";a.d(t,{Z:function(){return CSATQuestionText}});var s=a(85893),o=a(76987),n=a(34356),i=a(44118),r=a(47311);function CSATQuestionText({number:e,title:t,description:a}){return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(n.Z,{alignItems:"center",children:[(0,s.jsx)(o.P,{children:e}),(0,s.jsx)(i.Z,{as:"span",children:(0,r.ZP)(t)})]}),(0,s.jsx)(i.Z,{as:"p",textStyle:"bodySmallRegular",css:{color:"$neutral4",mt:"$small2"},children:a})]})}},18992:function(e,t,a){"use strict";a.d(t,{Z:function(){return BackButton}});var s=a(85893),o=a(63940),n=a(34356),i=a(56135),r=a(44118),l=a(67992),d=a(11163);function BackButton({label:e="Voltar",parentOrderId:t,onClick:a}){let c=(0,d.useRouter)(),m=`${t}`,u=localStorage.getItem(m)||localStorage.getItem("lastOrdersPagination");return(0,s.jsx)(o.Z,{children:(0,s.jsxs)(n.Z,{as:"button",type:"button",role:"button",onClick:()=>{t?(localStorage.removeItem(m),localStorage.setItem("scrollToOrder",m),c.push(`/minha-conta/pedidos?page=${u}`)):a()},css:{bc:"transparent",alignItems:"center",cursor:"pointer",p:0,border:"none"},children:[(0,s.jsx)(i.Z,{icon:l.ac,iconSize:15,css:{mr:"$small2",color:"$secondary4"}}),(0,s.jsx)(r.Z,{as:"span",textStyle:"bodySmallSemibold",css:{color:"$secondary4"},children:e})]})})}},2267:function(e,t,a){"use strict";a.d(t,{Z:function(){return EnumeratedTitleText}});var s=a(85893),o=a(47311),n=a(34356),i=a(44118);function EnumeratedTitleText({number:e,title:t,subtitle:a}){return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(n.Z,{alignItems:"start",ga
1p:"small2",css:{mb:"$medium1"},children:[(0,s.jsx)(n.Z,{"data-testid":"number",css:{mt:"$small1",alignItems:"center",justifyContent:"center",width:"16px",height:"16px",br:"$circle",lineHeight:1,fontSize:"10px",fontWeight:"$bold",bc:"$primary2",color:"white"},children:e}),(0,s.jsx)(i.Z,{"data-testid":"title",as:"p",textStyle:"bodyMediumSemibold",css:{flex:1},children:t})]}),a&&(0,s.jsx)(i.Z,{"data-testid":"subtitle",as:"p",textStyle:"bodySmallRegular",css:{color:"$neutral4",mb:"$medium1"},children:(0,o.ZP)(a)})]})}},65273:function(e,t,a){"use strict";a.d(t,{Z:function(){return ReasonRadios}});var s=a(85893),o=a(5612),n=a(63940),i=a(34356),r=a(25939),l=a(65268),d=a(44118),c=a(11163),m=a(2267);function ReasonRadios({number:e,title:t,subtitle:a,value:u,options:x,onChange:p}){let{push:h}=(0,c.useRouter)();return(0,s.jsx)(o.Z,{children:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(m.Z,{number:e,title:t,subtitle:a}),(0,s.jsx)(l.Z,{value:u,onValueChange:p,children:(0,s.jsx)(r.X2,{css:{px:"$small1"},children:(0,s.jsx)(r.JX,{sm:12,children:x.map((e,t)=>(0,s.jsxs)(n.Z,{css:{mb:t+1===x.length?"none":"$medium2",pb:e?.serviceAlreadyRequested?"$medium3":0},children:[(0,s.jsx)(l.Y,{id:e.value,"data-testid":e.label,value:e.value,disabled:e?.disabled,label:(0,s.jsx)(i.Z,{direction:"column",children:(0,s.jsx)(d.Z,{as:"p",css:{opacity:e?.disabled?.4:1},children:e.label})})}),e?.serviceAlreadyRequested&&(0,s.jsxs)(d.Z,{as:"span",textStyle:"bodyXSmallRegular",css:{color:"$neutral4",mt:"$small1",position:"absolute",left:"40px"},children:[e.serviceAlreadyRequested.description,(0,s.jsx)(d.Z,{"data-testid":"link",as:"button",onClick:e.serviceAlreadyRequested.onClick??h(e.serviceAlreadyRequested.link),textStyle:"bodyXSmallBold",css:{color:"$secondary4",textDecoration:"none",cursor:"pointer",ml:"$small1"},children:e.serviceAlreadyRequested.labelLink})]})]},e.value))})})})]})})}},2741:function(e,t,a){"use strict";a.d(t,{AQ:function(){return trackCSATEvaluation},Ib:function(){return trackingCTAContinue},MF:function(){return trackingInitialPage},yT:function(){return trackingForm}});var s=a(45183);let o="Call Center Clicked",removeBreakingChars=e=>{let t="\xe0\xe1\xe2\xe4\xe6\xe3\xe5āăą\xe7ćčđď\xe8\xe9\xea\xebēėęěğǵḧ\xee\xef\xedīį\xecłḿ\xf1ńǹň\xf4\xf6\xf2\xf3œ\xf8ō\xf5őṕŕř\xdfśšşșťț\xfb\xfc\xf9\xfaūǘůűųẃẍ\xff\xfdžźż",a=RegExp(t.split("").join("|"),"g");return e.toString().replace(a,e=>"aaaaaaaaaacccddeeeeeeeegghiiiiiilmnnnnoooooooooprrsssssttuuuuuuuuuwxyyzzz".charAt(t.indexOf(e)))},trackingInitialPage=async e=>{let t=removeBreakingChars(e.join(","));return s.Z.track(o,{type:"reasons page",value:t})},trackingCTAContinue=async(e,t)=>s.Z.track(o,{type:"reason",id:e,name:t}),trackingForm=async(e,t,a)=>s.Z.track(o,{type:"field",reason:e,field:t,value:a}),trackCSATEvaluation=async e=>s.Z.track("Csat Evaluation",e)},76:function(e,t,a){"use strict";a.d(t,{l:function(){return trackOrderAttendanceStep}});var s=a(43023),o=a(59016);function trackOrderAttendanceStep(e){(0,o.Z)(s.Q.EventOrderAttendanceStep,e)}},1682:function(e,t,a){"use strict";a.d(t,{P:function(){return o},_:function(){return trackSellerMessage}});var s,o,n=a(45183);function trackSellerMessage(e,t){n.Z.track(`Seller Message: ${e}`,{...t,id_pedido:Number(t.id_pedido),id_seller:Number(t.id_seller)})}(s=o||(o={})).CLICK_REQUEST_SERVICE="Click Request Service",s.CLICK_REQUEST_CANCELLATION="Click Request Cancellation",s.CLICK_HELP_MM="Click Help MM",s.REPORTED_PROBLEM="Reported Problem",s.CLICK_RESTART_CONVERSATION="Click Restart Conversation",s.CLICK_SEE_CANCELLATION_REQUEST="Click See Cancellation Request"},11259:function(e,t,a){"use strict";a.d(t,{R:function(){return getZeConstants}});let s={production:{zeSuportFormId:"33922632911131",zeHelpCenterFormId:"30345808807963",zeCancellationFormId:"33908117951259",zeDeliveryIssuesFormId:"33401961931675",zeItemFieldId:"33670027501339",zeRefundFieldId:"36562550658203",zeParentOrderFieldId:"33462945946907",zeChildOrderFieldId:"33669974881435",zeDeliveryDateFieldId:"36562950712347",zeChannelFieldId:"33462478650011",zeRefundBalanceOptionId:36562572449563,zeCxScheduleId:37407403214619,zeSellerId:"48196900793627",zeSellerName:"33670152364955",zeOrderStatus:"33670131195931",zeComplaintDescription:"33681751409051",zeAutomaticRefund:"36850048621339",zeRefundArticle:"35970065282971-Como-usar-meu-saldo-do-reembolso-em-novas-compras-na-Madeira"}},getZeConstants=()=>s.production},59394:function(e,t){"use strict";t.Z=function(e){e&&e.scrollTo({top:0})}},5635:function(e,t,a){"use strict";a.d(t,{AH:function(){return productGalleryImageLoader},FY:function(){return fixImageProtocol},SB:function(){return productImageLoader},pE:function(){return customLoaderImage},tK:function(){return squareCanvasImage}});let optimizeImage=(e,t)=>
1{if(!e)return e;let a=[];return t.width&&a.push(`width=${t.width}`),t.height&&a.push(`height=${t.height}`),t.fit&&a.push(`fit=${t.fit}`),t.q&&a.push(`q=${t.q}`),t.canvas&&(t.canvas.ratio?a.push(`canvas=${t.canvas.ratio}`):t.canvas.width&&t.canvas.height&&a.push(`canvas=${t.canvas.width},${t.canvas.height}`)),t.bgColor&&a.push(`bg-color=${t.bgColor}`),fixImageProtocol(e+(e.includes("?")?"&":"?")+a.join("&"))},squareCanvasImage=(e,t,a="FFF")=>optimizeImage(e,{width:t,bgColor:a,canvas:{ratio:"1:1"}}),customLoaderImage=({imageUrl:e,width:t,bgColor:a,q:s=75,canvas:o})=>optimizeImage(e,{width:t,bgColor:a,q:s,canvas:o}),fixImageProtocol=e=>e?e.startsWith("http:")?`${e}`.replace("http:","https:"):e.startsWith("https:")?`${e}`:`https:${e}`:e,productImageLoader=({src:e,width:t})=>squareCanvasImage(e,t),fitInImage=(e,t)=>{if(!e)return e;let a=e.includes("?")?"&":"?";return fixImageProtocol(`${e}${a}ims=fit-in/${t}x${t}`)},productGalleryImageLoader=({src:e,width:t})=>fitInImage(e,t)},81743:function(e,t,a){"use strict";var s=a(98005),o=a.n(s);async function compress(e){let t=[];for(let a=0;a<e.length;a++){let s=e[a],n=await new Promise((e,t)=>{new(o())(s,{quality:.8,width:1024,mimeType:"image/jpeg",convertTypes:["image/png","image/webp","image/gif"],convertSize:2e5,success:e,error:t})});t.push(new File([n],s.name,{type:"image/jpeg",lastModified:s.lastModified}))}return t}t.Z=compress},50304:function(e,t,a){"use strict";var s=a(6230),o=a.n(s);let parseXmlToJson=e=>{let t={};for(let a of e.matchAll(/(?:<(\w*)(?:\s[^>]*)*>)((?:(?!<\1).)*)(?:<\/\1>)|<(\w*)(?:\s+)*\/>/gm)){let e=a[1]||a[3],s=a[2]&&parseXmlToJson(a[2]);t[e]=(s&&Object.keys(s).length?s:a[2])||null}return t},postUploadFile=async(e,t)=>{let{signature:a,postEndpoint:s}=e,n=new(o());Object.entries(a).forEach(([e,t])=>{n.append(e,t)}),n.append("file",t);let i=await fetch(s,{method:"POST",body:n}),{status:r,statusText:l}=i;if(201!==r)return Promise.reject(Error(JSON.stringify({status:r,statusText:l})));let d=parseXmlToJson(await i.text()),c=decodeURIComponent(d?.PostResponse?.Location),m=encodeURIComponent(c);return{status:r,statusText:l,data:m}};t.Z=postUploadFile},82208:function(e,t,a){"use strict";var s=a(86606),o=a.n(s);let n=new(o())("655c20d1f9dc6ec2b92b",{authEndpoint:"/api/myaccount/callcenter/seller-message/v2/auth-channel",cluster:"us2"});t.Z=n},41642:function(e,t,a){"use strict";var s=a(61363),o=a(67294);t.Z=()=>{let e=(0,o.useContext)(s.w);if(!e)throw Error("useAlert must be used within an AlertProvider");return e}},60482:function(e,t,a){"use strict";var s=a(67294);t.Z=(e,t)=>{(0,s.useEffect)(()=>{if(e){e.style.height="0px";let{scrollHeight:t}=e;e.style.height=`${t+4}px`}},[e,t])}},79237:function(e,t,a){"use strict";a.d(t,{t:function(){return useNewCustomerArea}});var s=a(62286),o=a(67294),n=a(4873);function useNewCustomerArea(){let[e,t]=(0,o.useState)(null);return(0,o.useEffect)(()=>{let e=(0,s.parseCookies)();t(e[n.nv.NEW_CUSTOMER_AREA]===n.qq.CUSTOMER_AREA_V2)},[]),{isNewCustomerArea:!0===e,isResolved:null!==e}}},20041:function(e,t,a){"use strict";a.r(t),a.d(t,{__N_SSG:function(){return eY},default:function(){return CallCenter}});var s=a(85893),o=a(42988),n=a(61119),i=a(47598),r=a(34356),l=a(25939),d=a(44118),c=a(34155);let{NEXT_PUBLIC_PRODUCTHUB_URL:m}=c.env,getClientManual=async e=>{let t=await fetch(`/api/myaccount/callcenter/manual?id=${e}`,{method:"GET",headers:{"Content-Type":"application/json"}});if(200!==t.status)return t.status;let a=await t.json();return{data:a,...t}};var u=a(5493);let getClientReasonsOrder=async e=>{let t=await fetch(`/api/myaccount/callcenter/reasons?${u.Z.stringify(e)}`,{method:"GET",headers:{"Content-Type":"application/json"}}),{ok:a,status:s,statusText:o}=t;if(s<200||s>299)return Promise.reject(Error(JSON.stringify({status:s,statusText:o})));let n=await t.json();return{ok:a,status:s,statusText:o,data:n}},getClientOrderDetails=async e=>{let t=await fetch(`/api/myaccount/order?id_pedped=${e}`,{method:"GET",headers:{"Content-Type":"application/json"}}),{status:a,statusText:s}=t;if(200!==a)return Promise.reject(Error(JSON.stringify({status:a,statusText:s})));let o=await t.json();return{data:o,status:a,statusText:s}},getClientOrderDetailsByHash=async e=>{let t=await fetch(`/api/myaccount/order?order_hash_id=${e}`,{method:"GET"}),{status:a,statusText:s}=t;
1if(200!==a)return Promise.reject(Error(JSON.stringify({status:a,statusText:s})));let o=await t.json();return{data:o,status:a,statusText:s}};var x=a(24235),p=a(2741),h=a(11163),g=a(67294);let f=(0,g.createContext)({}),b=(0,g.memo)(({children:e})=>{let{setShowLoading:t}=(0,x.OI)(),[a,o]=(0,g.useState)(1),n=(0,h.useRouter)(),i=String(n.query.sub).split("-"),r=i[3===i.length?1:0],[l,d]=(0,g.useState)(""),c=`sub=${r}`,[m,u]=(0,g.useState)(null),[b,j]=(0,g.useState)([]),y=b.filter(e=>[11,22].includes(e.id)),[S,v]=(0,g.useState)(null),[C,$]=(0,g.useState)(!1),Z=m&&{id_pedido:m.id_pedped,id_seller:m.id_seller},[w,_]=(0,g.useState)(!1),[I,M]=(0,g.useState)(null),R=(0,g.useCallback)(async()=>{try{let{data:e}=await getClientReasonsOrder({id:l,central_atendimento:1});(0,p.MF)(e.map(e=>e.name)),j(e)}catch(e){v("Estamos processando o seu pedido no momento. Volte mais tarde e tente novamente por favor.")}},[l]);return(0,g.useEffect)(()=>{let fetchOrder=async()=>{t("Aguarde, buscando informa\xe7\xf5es do pedido...");try{let e=null;if(24===r.length){let{data:t}=await getClientOrderDetailsByHash(r),a=Object.keys(t);e=t[a[0]]}else{let{data:t}=await getClientOrderDetails(r);e=t[r]}if(e){d(e.id_pedped),u(e);let a=!["","0"].includes(e.id_seller);$(a),a||(t("Aguarde, buscando op\xe7\xf5es de atendimento..."),await R(),t(null))}else v("Ocorreu um erro ao buscar os dados do pedido.")}catch(e){v("Estamos processando o seu pedido no momento. Volte mais tarde e tente novamente por favor."),t(null)}};r&&"undefined"!==r&&!m&&fetchOrder()},[r,m]),(0,s.jsx)(f.Provider,{value:{childOrderId:l,queryStringattendance:c,step:a,setStep:o,order:m,reasons:b,cancellationReasons:y,fetchReasons:R,integrationError:S,isSeller:C,trackSellerMessageProps:Z,autoRefund:w,setAutoRefund:_,returnToStep:I,setReturnToStep:M},children:e})}),useCallcenter=()=>(0,g.useContext)(f);var j=a(47311),y=a(87536),S=a(63940),v=a(62804),C=a(19261),$=a(50592),Z=a(76627),w=a.n(Z),_=a(65268),I=a(5612),M=a(34155);let{NEXT_PUBLIC_PRODUCTHUB_URL:R}=M.env,getClientProductImage=async e=>{let t=await fetch(`/api/myaccount/orders/product-image?id=${e}`,{method:"GET",headers:{"Content-Type":"application/json"}}),{status:a,statusText:s}=t;if(200!==a)return Promise.reject(Error(JSON.stringify({status:a,statusText:s})));let o=await t.json();return{data:o,status:a,statusText:s}};var E=a(5635),T=a(25675),A=a.n(T),k=a(65109),P=a(76),N=a(81259);let loadProductImage=({src:e})=>(0,E.tK)(e,100);var callcenter_CardOrderProducts=function(){let[e,t]=(0,g.useState)(""),{setReturnToStep:a,setStep:o,childOrderId:n,order:c}=useCallcenter(),{watch:m,setValue:u}=(0,y.Gc)(),{setShowLoading:h}=(0,x.OI)(),[f,b]=(0,g.useState)([]),[j,Z]=(0,g.useState)([]);(0,g.useEffect)(()=>{let fetchReasonItems=async()=>{h("Aguarde, buscando produtos...");let{data:e}=await getClientReasonsOrder({id:n,central_atendimento:1,reason:m("reason")}),t=e.items,s=e.scripts.not_multiple;if(1===t.length){if(s){let e=s.find(e=>e.suggestion_id.includes("qnt")).suggestion_id;u("items",[{sku:String(t[0].sku),scripts:{[e.substring(1)]:1===t[0].quantity?t[0].quantity:null,montado_desembalado:"0"}}]),1===t[0].quantity&&s.every(e=>"#is_avaria"!==e.suggestion_id)&&(o(3),a(1))}else u("items",[{sku:String(t[0].sku),quantity:t[0].quantity}]),o(3),a(1)}s&&Z(s),await Promise.all(t.map(async e=>{let t=await getClientProductImage(e.sku);return{id_prdprd:String(e.sku),nome:e.description,image:t.data.images[0].value,quantidade:e.quantity}})).then(e=>b(e)),h(null)};fetchReasonItems()},[]);let onChangeItem=(e,t)=>{let{id_prdprd:a,quantidade:s}=t;e?j.length>0?u("items",[...m("items"),{sku:a,scripts:{[findScript().suggestion_id]:Number.isInteger(s)&&1===Number(s)?s:null,montado_desembalado:"0"}}]):u("items",[...m("items"),{sku:a,quantity:s}]):u("items",m("items").filter(e=>e.sku!==a))},onChangeParams=(e,t,a)=>{u("items",m("items").map(s=>s.sku===e?{...s,scripts:{...s.scripts,[t]:a}}:s))},renderRadios=(e,t)=>(0,s.jsxs)(S.Z,{css:{width:"100%",bc:"$neutral1",p:"$medium1"},children:[(0,s.jsx)(d.Z,{as:"p",textStyle:"bodySmallRegular",css:{mb:"$small2"},children:findScript(`#${t}`).observation}),(0,s.jsx)(_.Z,{onValueChange:a=>onChangeParams(e.id_prdprd,t,a),children:findScript(`#${t}`).options.map(t=>(0,s.jsx)(_.Y,{id:`${e.id_prdprd}-${t.name}`,value:t.value,label:t.name}
1,t.name))})]}),findScript=e=>{let t=["#qnt_item_avariado","#qnt_troca","#qnt_devolvida","#qnt_peca_faltante","#qnt_item","#qnt_entrega_errada"],a=null;return(a=e?j.find(t=>t.suggestion_id===e):j.find(e=>t.includes(e.suggestion_id)))?{...a,suggestion_id:a.suggestion_id.substring(1,a.suggestion_id.length)}:null},validateQuantity=(e,a)=>{let s=parseFloat(a);a.split(".").length>2||0===s||s>e.quantidade?(onChangeParams(e.id_prdprd,findScript().suggestion_id,null),t("A quantidade informada est\xe1 incorreta.")):(onChangeParams(e.id_prdprd,findScript().suggestion_id,s),t(""))};return(0,s.jsxs)(s.Fragment,{children:[!!f.length&&(0,s.jsx)(I.Z,{number:"1",title:"Item dessa solicita\xe7\xe3o:",children:(0,s.jsx)(r.Z,{flexWrap:"wrap",css:{width:"100%"},children:f.map((t,a)=>(0,s.jsxs)(r.Z,{direction:"column",alignItems:"center",css:{width:"100%","@md":{width:"50%",pr:a%2==0?"$small3":"0",pl:a%2!=0?"$small3":"0"}},children:[(0,s.jsxs)(r.Z,{alignItems:"center",css:{width:"100%",mt:a>0?"$medium3":0,"@md":{mt:a>1?"$medium3":0}},children:[(0,s.jsxs)(r.Z,{children:[(0,s.jsx)(v.Z,{id:t.id_prdprd,value:t.id_prdprd,onCheckedChange:e=>onChangeItem(e,t),defaultChecked:1===f.length,disabled:1===f.length}),(0,s.jsx)("label",{htmlFor:t.id_prdprd,children:(0,s.jsxs)(d.Z,{as:"p",textStyle:"bodySmallRegular",css:{pr:"$medium1"},children:[t.nome,t.quantidade>1&&(0,s.jsxs)(d.Z,{as:"span",textStyle:"bodyXSmallRegular",asBlock:"true",children:[String(t.quantidade).replace(".",",")," unidades"]})]})})]}),(0,s.jsx)(S.Z,{css:{ml:"auto","& > img":{br:"$small"}},children:t.image?(0,s.jsx)(A(),{width:87,height:87,src:t?.image,alt:t.nome,loader:loadProductImage,layout:"fixed"}):(0,s.jsx)(k.Skeleton,{height:"87px",width:"87px",animation:!0})})]}),(0,s.jsx)(S.Z,{css:{width:"100%",height:"1px",bc:"$neutral2",mt:"$small1",mb:"$small2","@md":{display:"none"}}}),m("items").some(e=>e.sku===t.id_prdprd)&&(0,s.jsxs)(s.Fragment,{children:[findScript("#is_avaria")&&renderRadios(t,"is_avaria"),findScript()&&Number.isInteger(t.quantidade)&&t.quantidade>1&&(0,s.jsx)(S.Z,{css:{width:"100%",bc:"$neutral1",p:"$medium1"},children:(0,s.jsx)(C.Z,{title:findScript().observation,label:"Selecione...",width:"100%",modal:!1,onChange:e=>onChangeParams(t.id_prdprd,findScript().suggestion_id,e),options:[...Array(Number(t.quantidade)).keys()].map(e=>({label:`${String(e+1).padStart(2,"0")}  ${0===e?"Unidade":"Unidades"}`,value:String(e+1)})),value:1===Number(t.quantidade)?"1":"",disabled:1===f.length&&1===Number(t.quantidade)})}),findScript()&&!Number.isInteger(t.quantidade)&&(0,s.jsx)(S.Z,{css:{width:"100%",bc:"$neutral1",p:"$medium1"},children:(0,s.jsx)(w(),{mask:"DDDDDD",maskChar:"",formatChars:{D:"[0-9.]"},value:m("items").find(e=>e.sku===t.id_prdprd)[findScript().suggestion_id],onChange:e=>validateQuantity(t,e.target.value),children:t=>(0,s.jsx)($.Z,{as:"input",label:findScript().observation,floatingLabel:!0,type:"tel",hasError:!!e,errorMessage:e,...t})})})]})]},t.id_prdprd))})}),!!f.length&&(0,s.jsx)(l.X2,{css:{px:"$medium1",mt:"$large1"},children:(0,s.jsx)(l.JX,{sm:12,children:(0,s.jsx)(i.Z,{type:"button",label:"Continuar",css:{mx:"auto",width:"100%","@md":{width:"auto"}},disabled:!!(0===m("items").length||j.length&&(m("items").some(e=>null===e.scripts[findScript().suggestion_id])||j.some(e=>"#is_avaria"===e.suggestion_id)&&!m("items").every(e=>e.scripts.is_avaria))),onClick:()=>{o(3),(0,p.yT)(m("reason"),"items",m("items")),(0,P.l)({interaction_step:"2",interaction_orderid:String(c.id_pedped_pai)||null,interaction_orderstatus:sessionStorage.getItem("orderStatus")||null,interaction_orderpaymentmethod:sessionStorage.getItem("paymentMethod")||null,interaction_value:"Solicitar Atendimento",interaction_sku:m("items").map(e=>String(e.sku))||null,interaction_reason:(0,N.E)(m("reason"))||null})}})})})]})},q=a(38191),CardOrderProductSelected=function({selectedItems:e,indexItem:t}){let{order:a}=useCallcenter(),[o,n]=(0,g.useState)({});return(0,g.useEffect)(()=>{Object.keys(a.items).forEach(s=>{s===e[t].sku&&n(a.items[s])})},[t]),(0,g.useEffect)(()=>{null===o.image&&fetchImages();async function fetchImages(){let{data:e}=await getClientProductImage(o.id_prdprd),{images:t}=e,a={...o,image:t[0].value};n(a)}},[o]),(0,s.jsx)(I.Z,{number:"1",title:"Item selecionado",children:(0,s.jsx)(r.Z,{flexWrap:"wrap",css:{width:"100%"},children:(0,s.jsx)(r.Z,{direction:"column",alignItems:"center",css:{width:"100%","@md":{width:"50%"}},children:(0,s.jsxs)(r.Z,{alignItems:"center",css:{width:"100%"},children:[(0,s.jsx)(r.Z,{children:(0,s.jsxs)(d.Z,{as:"p",textStyle:"bodySmallRegular",css:{pr:"$medium1"},children:[o.nome,(e=>{if(e.quantity>1)return(0,s.jsxs)(d.Z,{as:"span",textStyle:"bodyXSmallRegular",asBlock:"true",children:[e.quantity," unidades"]});let t=Object.keys(e);if(t.includes("scripts")){let t=Object.keys(e.scripts).find(e=>e.includes("qnt"));if(e.scripts[t]>1)return(0,s.jsxs)(d.Z,{as:"span",textStyle:"bodyXSmallRegular",asBlock:"true",children:[String(e.scripts[t]).replace(".",",")," unidades"]})}return""})(e[t])]})}),(0,s.jsx)(S.Z,{css:{ml:"auto","& > img":{br:"$small"}},children:o.image?(0,s.jsx)(A(),{width:87,height:87,src:o.image,alt:o.nome,loading:"lazy"}):(0,s.jsx)(k.Skeleton,{height:"87px",width:"87px",animation:!0})})]})})})})};function SectionMoreDetails({number:e,title:t="Quer nos contar mais detalhes para entendermos o que aconteceu?",css:a,value:o,setValue:n}){return(0,s.jsx)(S.Z,{css:a,children:(0,s.jsx)(I.Z,{number:e,title:t,children:(0,s.jsx)(S.Z,{css:{mt:"$medium2"},children:(0,s.jsx)($.Z,{as:"input",floatingLabel:!0,label:"Escreva aqui (opcional)",value:o,onChange:e=>n(e.target.value)})})})})}
1var O=a(3449),D=a(11358),F=a(38074),z=a(85518),L=a(56135),V=a(9001),U=a(31420),B=a(55636),J=a(81743);function DragAndDropImages({setValue:e}){let[t,a]=(0,g.useState)([]),{getRootProps:o,getInputProps:n,open:i}=(0,F.uI)({disabled:5===t.length,noClick:!0,noKeyboard:!0,accept:{"image/*":[".jpeg",".jpg",".png",".webp"]},maxFiles:5,onDrop:async e=>{let s=await (0,J.Z)(e);e.length+t.length<=5&&a([...t,...s.map(e=>Object.assign(e,{preview:URL.createObjectURL(e)}))])}});(0,g.useEffect)(()=>{e(t.map(e=>(URL.revokeObjectURL(e.preview),{name:`${e.name.split(".")[0]}.jpeg`,content:e,type:"image/jpeg"})))},[t]);let l=t.map(e=>(0,s.jsxs)(S.Z,{css:{position:"relative",display:"inline-flex",br:"$small",border:"1px solid $secondary4",bc:"$mono1",mr:"$small1",mb:"$small1",width:"100px",height:"100px",padding:"$small2",boxSizing:"border-box","@lg":{mb:t.length>7?"$small1":0}},children:[(0,s.jsx)(r.Z,{css:{minWidth:"0",overflow:"hidden"},children:(0,s.jsx)("img",{src:e.preview,width:"auto",height:"100%",alt:""})}),(0,s.jsx)(r.Z,{alignItems:"center",justifyContent:"center",css:{position:"absolute",width:"$medium3",height:"$medium3",top:"-1px",right:"-1px",btrr:"$small",bblr:"$small",bc:"$secondary4",cursor:"pointer"},onClick:()=>a(t.filter(t=>t.preview!==e.preview)),children:(0,s.jsx)(L.Z,{icon:U.NB,iconSize:15,css:{color:"$mono1"}})})]},e.name));return(0,s.jsxs)(r.Z,{direction:"column",alignItems:"center",css:{minHeight:"135px",bc:"$neutral1",br:"$small",border:"1px dashed $secondary4",p:"$medium1",mt:"$medium1"},...o({className:"dropzone"}),children:[t.length>0?(0,s.jsxs)(r.Z,{justifyContent:"center",flexWrap:"wrap",children:[l,(0,s.jsx)(r.Z,{alignItems:"center",justifyContent:"center",css:{br:"$small",bc:"$neutral3",mr:"$small1",width:"100px",height:"100px",cursor:"pointer"},onClick:i,children:(0,s.jsx)(L.Z,{icon:B.r8,iconSize:28,css:{color:"$mono1"}})})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(L.Z,{icon:V._j,iconSize:62,css:{color:"$neutral3",lineHeight:1,mb:"$small3"},onClick:i}),z.tq?(0,s.jsx)(O.Z,{link:"Adicionar fotos",showIcon:!1,onClickHelp:i}):(0,s.jsx)(O.Z,{message:["Arraste e solte as fotos ou","para procurar e adicionar arquivos de uma pasta."],link:"clique aqui",showIcon:!1,linkUnderline:!0,onClickHelp:i})]}),(0,s.jsx)("input",{...n()})]})}function SectionUploadImages({number:e,title:t="Quer nos contar mais detalhes para entendermos o que aconteceu?",description:a,css:o,showLabel:n,setValue:r}){let[l,c]=(0,g.useState)(!1),toggleDialog=()=>c(e=>!e);return(0,s.jsx)(S.Z,{css:o,children:(0,s.jsx)(I.Z,{number:e,title:t,description:a,children:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(S.Z,{css:{mt:"$medium2"},children:[n&&(0,s.jsx)(O.Z,{link:"Como identificar a etiqueta",showIcon:!1,css:{mt:"-$small2"},onClickHelp:toggleDialog}),(0,s.jsx)(DragAndDropImages,{setValue:r})]}),(0,s.jsxs)(D.Z,{open:l,onHide:toggleDialog,tagLine:"SOLICITAR ATENDIMENTO",title:"Como identificar a etiqueta",footer:(0,s.jsx)(i.Z,{label:"Voltar",variant:"secondary",onClick:toggleDialog,css:{ml:"auto",display:"none","@md":{display:"block"}}}),children:[(0,s.jsx)(d.Z,{as:"h3",textStyle:"bodyMediumBold",children:"Exemplo de etiqueta do fornecedor"}),(0,s.jsx)(S.Z,{css:{m:"$medium1 auto","@md":{width:"65%"}},children:(0,s.jsx)("img",{src:"/assets/supplier-label.svg",alt:"Etiqueta",width:"100%"})}),(0,s.jsx)(d.Z,{as:"p",textStyle:"bodyMediumRegular",children:"Pode ser que a etiqueta do fornecedor seja de uma cor diferente. Nela, est\xe3o o nome do fornecedor e a descri\xe7\xe3o do produto: nome do produto, cor e volume."})]})]})})})}let X={315:"Nos ajude a identificar o produto que recebeu. Procure na embalagem a etiqueta do fornecedor e tire uma foto em que o nome e a cor do produto apare\xe7am nitidamente. Aproveite para enviar fotos do produto em ambientes com boa ilumina\xe7\xe3o, mostrando a diferen\xe7a de cor.",316:"Nos ajude a identificar o produto que est\xe1 com voc\xea. Procure na embalagem a etiqueta do fornecedor e tire uma foto em que o nome do produto apare\xe7a nitidamente. Tamb\xe9m envie fotos do produto, usando uma r\xe9gua, trena ou fita m\xe9trica, para demonstrar a diferen\xe7a de tamanho.",317:"Nos ajude a identificar o produto que recebeu. Procure na embalagem a etiqueta do fornecedor e tire uma foto em que o nome do produto apare\xe7a nitidamente. Tamb\xe9m envie fotos do produto ou das pe\xe7as para demonstrar as diferen\xe7as.",318:"Nos ajude a identificar o produto que est\xe1 com voc\xea. Procure na embalagem a etiqueta do fornecedor e tire uma foto em que o nome do produto apare\xe7a nitidamente.",319:"Nos ajude a identificar o produto que recebeu. Procure na embalagem a etiqueta do fornecedor e tire uma foto em que o nome do produto apare\xe7a nitidamente. Tamb\xe9m envie fotos do produto ou das pe\xe7as para demonstrar as diferen\xe7as.",320:"Nos ajude a identificar o produto que est\xe1 com voc\xea. Procure na embalagem a etiqueta do fornecedor e tire uma foto em que o nome do produto apare\xe7a nitidamente."};var callcenter_FormItem=function({parts:e}){let{watch:t,setValue:a}=(0,y.Gc)(),[o,n]=(0,g.useState)(0);(0,g.useEffect)(()=>
1{if(["54","60","61"].includes(t("items")[o].subreason)){let e=t("items");delete e[o].pieces,a("items",e)}},[t("items")[o].subreason]);let changeLabel=e=>{switch(t("reason")){case 2:return{pictureNumber:"2",select:"O que est\xe1 quebrado ou com defeito?",pieces:"Descreva as partes ou pe\xe7as  quebradas ou com defeito:",detailsNumber:"3"};case 11:case 22:return{select:"Por que deseja cancelar?",detailsNumber:"3"};case 20:return{pictureNumber:"2",pictures:"Nos ajude a identificar o produto que recebeu. Procure na embalagem a etiqueta da MadeiraMadeira e tire uma foto em que o nome e o endere\xe7o apare\xe7am nitidamente.",detailsNumber:"3"};case 39:return{select:"O que est\xe1 diferente?",pictureNumber:"3",pictures:X[t("items")[e].subreason],detailsNumber:"4"};case 49:return{select:"O que voc\xea n\xe3o recebeu?",pieces:"Descreva as partes ou pe\xe7as que faltam:",detailsNumber:"2"};case 25:return{pictureNumber:"2",pictures:"Nos ajude a encontramos uma solu\xe7\xe3o mais r\xe1pida enviando fotos do defeito.",detailsNumber:"3"};default:return{select:"O que voc\xea n\xe3o recebeu?",pictures:"Para encontramos uma solu\xe7\xe3o mais r\xe1pida, nos ajude enviando fotos da etiqueta do fornecedor coladas nas embalagens mostrando com clareza o nome do produto.",detailsNumber:"2"}}},setFieldValue=(e,s,o)=>{let n=t("items").map((t,a)=>a===o?{...t,[e]:s}:t);a("items",n)};return 1===t("items").length?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(CardOrderProductSelected,{selectedItems:t("items"),indexItem:0}),[39,11,22].includes(t("reason"))&&(0,s.jsx)(I.Z,{number:"2",title:changeLabel(0).select,css:{mt:"$small3"},children:(0,s.jsx)(S.Z,{css:{mt:"$medium2"},children:(0,s.jsx)(C.Z,{label:"Selecione uma op\xe7\xe3o",onChange:e=>{setFieldValue("subreason",e,0),(0,p.yT)(t("reason"),"subreason",e)},title:"",width:"100%",modal:!1,options:e,value:t("items")[0].subreason||""})})}),[2,20,39,25].includes(t("reason"))&&(0,s.jsx)(SectionUploadImages,{number:changeLabel(0).pictureNumber,title:"Adicione fotos:",description:changeLabel(0).pictures,showLabel:25!==t("reason"),setValue:e=>{setFieldValue("photos",e,0),(0,p.yT)(t("reason"),"photos",e)},css:{mt:"$small3"}}),(0,s.jsx)(SectionMoreDetails,{number:changeLabel(0).detailsNumber,title:9===t("reason")?"Tem informa\xe7\xf5es sobre onde o produto foi entregue?":"Quer nos contar mais detalhes para entendermos o que aconteceu?",value:t("items")[0].description||"",setValue:e=>setFieldValue("description",e,0),css:{mt:"$small3"}})]}):(0,s.jsx)(q.Z,{columns:1,defaultValue:[],type:"multiple",special:!0,children:t("items").map((a,o)=>(0,s.jsx)(q.T,{title:`Item ${o+1}`,value:a.sku,css:{"& > div":{bc:"$neutral1",px:0,"@md":{px:"$medium1"}}},children:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(CardOrderProductSelected,{selectedItems:t("items"),indexItem:o}),[39,11,22].includes(t("reason"))&&(0,s.jsx)(I.Z,{number:"2",title:changeLabel(o).select,css:{mt:"$small3"},children:(0,s.jsx)(S.Z,{css:{mt:"$medium2"},children:(0,s.jsx)(C.Z,{label:"Selecione uma op\xe7\xe3o",onChange:e=>{n(o),setFieldValue("subreason",e,o),(0,p.yT)(t("reason"),"subreason",e)},title:"",width:"100%",modal:!1,options:e,value:t("items")[o].subreason||""})})}),[2,20,39,25].includes(t("reason"))&&(0,s.jsx)(SectionUploadImages,{number:changeLabel(o).pictureNumber,title:"Adicione fotos:",description:changeLabel(o).pictures,showLabel:25!==t("reason"),setValue:e=>{setFieldValue("photos",e,o),(0,p.yT)(t("reason"),"photos",e)},css:{mt:"$small3"}}),(0,s.jsx)(SectionMoreDetails,{number:changeLabel(o).detailsNumber,title:9===t("reason")?"Tem informa\xe7\xf5es sobre onde o produto foi entregue?":"Quer nos contar mais detalhes para entendermos o que aconteceu?",value:t("items")[o].description||"",setValue:e=>setFieldValue("description",e,o),css:{mt:"$small3"}})]})},a.sku))})};function ContentBrokenProduct({textFinalization:e}){let{step:t,order:a}=useCallcenter(),[o,c]=(0,g.useState)(null);return(0,g.useEffect)(()=>{let fetchManual=async()=>{let e=Object.keys(a.items),t={};for(let a=0;a<e.length;a++){let{data:s}=await getClientManual(e[a]);try{t[e[a]]=s.documents[0].value}catch(s){t[e[a]]=null}}c(t)};fetchManual()},[]),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(d.Z,{as:"h2",textStyle:"h2Semibold",css:{px:"$small3",mt:"$small3",mb:"$medium3","@md":{p:"0"}},children:"Produto chegou quebrado ou com defeito"}),2===t&&(0,s.jsx)(callcenter_CardOrderProducts,{}),3===t&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(callcenter_FormItem,{manuals:o}),(0,s.jsx)(l.X2,{css:{px:"$small3",mt:"$large1"},children:(0,s.jsx)(l.JX,{sm:12,children:(0,s.jsx)(i.Z,{type:"submit",label:"Enviar solicita\xe7\xe3o",css:{mx:"auto",width:"100%","@md":{width:"auto"}}})})})]}),5===t&&(0,s.jsx)(n.Z,{css:{mt:"$small3"},events:[{title:"Solicita\xe7\xe3o de assist\xeancia aberta",tooltip:"Meu e-mail est\xe1 incorreto",tooltipMessage:"N\xf3s te ajudamos! \xc9 s\xf3 chamar a gente no chat.",done:!0,content:(0,s.jsx)(r.Z,{direction:"column",children:(0,s.jsx)(d.Z,{as:"p",textStyle:"bodyMediumRegular",css:{my:"$small3"},children:(0,j.ZP)(e)})})},{title:"Solicita\xe7\xe3o encaminhada ao fornecedor"},{title:"Pe\xe7as enviadas para seu endere\xe7o"}]})]})}function ContentCancelExtendedWarranty({textFinalization:e}){let{step:t}=useCallcenter();return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(d.Z,{as:"h2",textStyle:"h2Semibold",css:{px:"$small3",mt:"$small3",mb:"$medium3","@md":{p:"0"}},children:"Cancelar garantia estendida"}),2===t&&(0,s.jsx)(callcenter_CardOrderProducts,{}),3===t&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(callcenter_FormItem,{}),(0,s.jsx)(l.X2,{css:{px:"$small3",mt:"$large1"},children:(0,s.jsx)(l.JX,{sm:12,children:(0,s.jsx)(i.Z,{type:"submit",label:"Enviar solicita\xe7\xe3o",css:{mx:"auto",width:"100%","@md":{width:"auto"}}})})})]}),5===t&&(0,s.jsx)(n.Z,{css:{mt:"$small3"},events:[{title:"Cancelamento de garantia estendida solicitado",tooltip:"Meu e-mail est\xe1 incorreto",tooltipMessage:"N\xf3s te ajudamos! \xc9 s\xf3 chamar a gente no chat.",done:!0,content:(0,s.jsx)(r.Z,{direction:"column",children:(0,s.jsx)(d.Z,{as:"p",textStyle:"bodyMediumRegular",css:{my:"$small3"},children:(0,j.ZP)(e)})})},{title:"Cancelamento confirmado"},{title:"Saldo ou reembolso liberado"}]})]})}a(34155);let getClientVerifyAutoRefund=async e=>{let t=await fetch(`/api/myaccount/callcenter/verify-auto-refund?order=${e}`,{method:"GET",headers:{"Content-Type":"application/json"}}),{status:a,statusText:s}=t;
1if(200!==a)return Promise.reject(Error(JSON.stringify({status:a,statusText:s})));let o=await t.json();return{data:o,status:a,statusText:s}};var W=a(41664),G=a.n(W),H=a(10588),Q=a(32660);function SectionRefundType(){let{watch:e,setValue:t}=(0,y.Gc)();return(0,s.jsx)(I.Z,{number:"4",title:"Como voc\xea quer o seu reembolso?",description:"Escolha como o valor da compra + frete deve retornar para voc\xea.",css:{mt:"$small3"},children:(0,s.jsx)(S.Z,{css:{mt:"$medium2"},children:(0,s.jsx)(_.Z,{defaultValue:!0===e("refund")?"refund":"balance",onValueChange:e=>t("refund","refund"===e),children:(0,s.jsxs)(r.Z,{css:{flexDirection:"column",gap:"$small2",alignItems:"flex-start","@md":{flexDirection:"row"}},children:[(0,s.jsxs)(r.Z,{gap:"small3",css:{width:"100%"},children:[(0,s.jsx)(L.Z,{icon:H.sq,iconSize:32,css:{color:e("refund")?"$neutral5":"$secondary4",width:"40px",display:"flex",justifyContent:"center",mt:"$small2"}}),(0,s.jsx)(r.Z,{css:{flex:1},children:(0,s.jsx)(_.Y,{id:"balance",value:"balance",css:{mt:"$small3"},label:(0,s.jsxs)(r.Z,{direction:"column",css:{mt:"-2px"},children:[(0,s.jsx)(d.Z,{as:"span",textStyle:"bodyMediumRegular",children:"Saldo para novas compras"}),(0,s.jsx)(d.Z,{as:"p",textStyle:"bodySmallRegular",css:{color:"$neutral4",mt:"$small1"},children:"O saldo n\xe3o expira, use na Madeira quando quiser!"})]})})})]}),(0,s.jsxs)(r.Z,{gap:"small3",css:{width:"100%"},children:[(0,s.jsx)(L.Z,{icon:Q.X5,iconSize:32,css:{color:e("refund")?"$secondary4":"$neutral5",width:"40px",display:"flex",justifyContent:"center",mt:"$small2"}}),(0,s.jsx)(r.Z,{css:{flex:1},children:(0,s.jsx)(_.Y,{id:"credit_card",value:"refund",css:{mt:"$small3"},label:(0,s.jsxs)(r.Z,{direction:"column",css:{mt:"-2px"},children:[(0,s.jsx)(d.Z,{as:"span",textStyle:"bodyMediumRegular",children:"Estorno"}),(0,s.jsx)(r.Z,{direction:"column",children:(0,s.jsx)(d.Z,{as:"p",textStyle:"bodySmallRegular",css:{color:"$neutral4",mt:"$small1"},children:"Para o mesmo cart\xe3o usado na compra"})})]})})})]})]})})})})}function ContentCancellation({textFinalization:e,protocol:t}){let{step:a,childOrderId:o,setAutoRefund:c,autoRefund:m}=useCallcenter(),{watch:u,setValue:x}=(0,y.Gc)(),[p,h]=(0,g.useState)([]);return(0,g.useEffect)(()=>{let fetchSubreason=async()=>{let{data:e}=await getClientReasonsOrder({id:o,central_atendimento:1,reason:u("reason")});h(e.subreasons.filter(e=>e.customer_view).map(e=>e&&{label:e.name,value:String(e.id)}));try{let{data:e}=await getClientVerifyAutoRefund(o);c(e.able),e.able&&x("isPartialPercentage",e.able)}catch(e){console.error(e),c(!1),x("isPartialPercentage",!1)}};fetchSubreason()},[]),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(d.Z,{as:"h2",textStyle:"h2Semibold",css:{px:"$small3",mt:"$small3",mb:"$medium3","@md":{p:"0"}},children:11===u("reason")?"Cancelar produto recebido":"Cancelar produto que n\xe3o foi entregue"}),2===a&&(0,s.jsx)(callcenter_CardOrderProducts,{}),3===a&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(callcenter_FormItem,{parts:p}),m&&(0,s.jsx)(SectionRefundType,{}),(0,s.jsx)(l.X2,{css:{px:"$small3",mt:"$large1"},children:(0,s.jsx)(l.JX,{sm:12,children:(0,s.jsx)(i.Z,{type:"submit",label:"Enviar solicita\xe7\xe3o",disabled:!u("items").every(e=>e.subreason),css:{mx:"auto",width:"100%","@md":{width:"auto"}}})})})]}),5===a&&t?.delay_cancellation&&(0,s.jsx)(n.Z,{css:{mt:"$small3"},events:[{title:"Cancelamento realizado",done:!0,content:(0,s.jsxs)(r.Z,{direction:"column",children:[(0,s.jsx)(d.Z,{as:"p",textStyle:"bodyMediumRegular",css:{my:"$small3"},children:"Seu pedido foi cancelado. Nenhuma cobran\xe7a ser\xe1 realizada no seu cart\xe3o."}),(0,s.jsx)(G(),{href:"https://ajuda.madeiramadeira.com.br/hc/pt-br",children:(0,s.jsx)(d.Z,{as:"p",textStyle:"bodyMediumSemibold",css:{color:"$secondary4",my:"$none",cursor:"pointer"},children:"Saiba mais sobre cancelamento"})})]})}]}),5===a&&!t?.delay_cancellation&&(0,s.jsx)(n.Z,{css:{mt:"$small3"},events:[{title:"Cancelamento solicitado",tooltip:"Meu e-mail est\xe1 incorreto",tooltipMessage:"N\xf3s te ajudamos! \xc9 s\xf3 chamar a gente no chat.",done:!0,content:(0,s.jsx)(r.Z,{direction:"column",children:(0,s.jsx)(d.Z,{as:"p",textStyle:"bodyMediumRegular",css:{my:"$small3"},children:(0,j.ZP)(e)})})},{title:"Cancelamento confirmado"},{title:u("refund")?"Reembolso realizado":"Saldo liberado"}]})]})}function ContentTemplate({textFinalization:e,contentTitle:t,eventsTlTitle:a,eventsTlTooltip:o,eventsTlTooltipMessage:c,tlFirstTitle:m,tlSecondTitle:u}){let{step:x}=useCallcenter(),{watch:p}=(0,y.Gc)();return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(d.Z,{as:"h2",textStyle:"h2Semibold",css:{px:"$small3",mt:"$small3",mb:"$medium3","@md":{p:"0"}},children:t}),2===x&&(0,s.jsx)(callcenter_CardOrderProducts,{}),3===x&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(callcenter_FormItem,{}),(0,s.jsx)(l.X2,{css:{px:"$small3",mt:"$large1"},children:(0,s.jsxs)(l.JX,{sm:12,children:[(0,s.jsx)(i.Z,{type:"submit",label:"Enviar solicita\xe7\xe3o",disabled:20===p("reason")&&!p("items").every(e=>e.photos&&e.photos.length),css:{mx:"auto",width:"100%","@md":{width:"auto"}}}),[15,31].includes(p("reason"))&&(0,s.jsx)(O.Z,{message:"Confira nossa",link:"Pol\xedtica de Trocas e Devolu\xe7\xf5es.",targetBlank:"/termos",linkUnderline:!0,showIcon:!1,css:{mt:"$small3",jc:"center","@md":{mt:"$large1"}}})]})})]}),5===x&&(0,s.jsx)(n.Z,{css:{mt:"$small3"},events:[{title:a,tooltip:o,tooltipMessage:c,done:!0,content:(0,s.jsx)(r.Z,{direction:"column",children:(0,s.jsx)(d.Z,{as:"p",textStyle:"bodyMediumRegular",css:{my:"$small3"},children:(0,j.ZP)(e)})})},{title:m},{title:u}]})]})}function ContentDeliveredWrongAddress(e){return(0,s.jsx)(ContentTemplate,{contentTitle:"Foi entregue em outro endere\xe7o",eventsTlTitle:"Solicita\xe7\xe3o aberta",eventsTlTooltip:"Meu e-mail est\xe1 incorreto",eventsTlTooltipMessage:"N\xf3s te ajudamos! \xc9 s\xf3 chamar a gente no chat.",tlFirstTitle:"Verifica\xe7\xe3o junto \xe0 transportadora",tlSecondTitle:"Entrega do produto no endere\xe7o correto",...e})}function ContentChangeProductDelivered(e){return(0,s.jsx)(ContentTemplate,{contentTitle:"Trocar produto recebido",eventsTlTitle:"Troca solicitada",eventsTlTooltip:"
1Como usar o saldo",eventsTlTooltipMessage:"Adicione ao carrinho os produtos que deseja e, durante o pagamento, ative a op\xe7\xe3o “Usar meu saldo”.",tlFirstTitle:"Coleta do produto",tlSecondTitle:"Saldo liberado para novas compras",...e})}function ContentChangeProduct(e){return(0,s.jsx)(ContentTemplate,{contentTitle:"Trocar produto que n\xe3o foi entregue",eventsTlTitle:"Troca solicitada",eventsTlTooltip:"Como usar o saldo",eventsTlTooltipMessage:"Adicione ao carrinho os produtos que deseja e, durante o pagamento, ative a op\xe7\xe3o “Usar meu saldo”.",tlFirstTitle:"Cancelamento realizado",tlSecondTitle:"Saldo liberado para novas compras",...e})}function ContentIncorrectCustomerName(e){return(0,s.jsx)(ContentTemplate,{contentTitle:"Chegou com o nome de outra pessoa",eventsTlTitle:"Solicita\xe7\xe3o aberta",eventsTlTooltip:"Meu e-mail est\xe1 incorreto",eventsTlTooltipMessage:"N\xf3s te ajudamos! \xc9 s\xf3 chamar a gente no chat.",tlFirstTitle:"Coleta do produto errado",tlSecondTitle:"Entrega do produto correto",...e})}function ContentRefusedDelivery(e){return(0,s.jsx)(ContentTemplate,{contentTitle:"Recusei a entrega do produto",eventsTlTitle:"Solicita\xe7\xe3o aberta",eventsTlTooltip:"Meu e-mail est\xe1 incorreto",eventsTlTooltipMessage:"N\xf3s te ajudamos! \xc9 s\xf3 chamar a gente no chat.",tlFirstTitle:"Novo produto enviado",tlSecondTitle:"Novo produto entregue",...e})}function ContentDifferentProduct({textFinalization:e}){let{step:t,childOrderId:a}=useCallcenter(),{watch:o}=(0,y.Gc)(),[c,m]=(0,g.useState)([]);return(0,g.useEffect)(()=>{let fetchSubreason=async()=>{let{data:e}=await getClientReasonsOrder({id:a,central_atendimento:1,reason:o("reason")});m(e.subreasons.map(e=>e&&{label:e.name,value:String(e.id)}))};fetchSubreason()},[]),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(d.Z,{as:"h2",textStyle:"h2Semibold",css:{px:"$small3",mt:"$small3",mb:"$medium3","@md":{p:"0"}},children:"Produto veio diferente do que comprei"}),2===t&&(0,s.jsx)(callcenter_CardOrderProducts,{}),3===t&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(callcenter_FormItem,{parts:c}),(0,s.jsx)(l.X2,{css:{px:"$small3",mt:"$large1"},children:(0,s.jsx)(l.JX,{sm:12,children:(0,s.jsx)(i.Z,{type:"submit",label:"Enviar solicita\xe7\xe3o",disabled:!o("items").every(e=>e.subreason&&e.photos&&e.photos.length),css:{mx:"auto",width:"100%","@md":{width:"auto"}}})})})]}),5===t&&(0,s.jsx)(n.Z,{css:{mt:"$small3"},events:[{title:"Solicita\xe7\xe3o aberta",tooltip:"Meu e-mail est\xe1 incorreto",tooltipMessage:"N\xf3s te ajudamos! \xc9 s\xf3 chamar a gente no chat.",done:!0,content:(0,s.jsx)(r.Z,{direction:"column",children:(0,s.jsx)(d.Z,{as:"p",textStyle:"bodyMediumRegular",css:{my:"$small3"},children:(0,j.ZP)(e)})})},{title:"An\xe1lise do produto recebido"},{title:"Entrega do produto correto"}]})]})}function ContentIncompleteProduct({textFinalization:e}){let{step:t,order:a}=useCallcenter(),[o,c]=(0,g.useState)(null);return(0,g.useEffect)(()=>{let fetchManual=async()=>{let e=Object.keys(a.items),t={};for(let a=0;a<e.length;a++){let{data:s}=await getClientManual(e[a]);try{t[e[a]]=s.documents[0].value}catch(s){t[e[a]]=null}}c(t)};fetchManual()},[]),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(d.Z,{as:"h2",textStyle:"h2Semibold",css:{px:"$small3",mt:"$small3",mb:"$medium3","@md":{p:"0"}},children:"Produto chegou incompleto ou com pe\xe7as faltando"}),2===t&&(0,s.jsx)(callcenter_CardOrderProducts,{}),3===t&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(callcenter_FormItem,{manuals:o}),(0,s.jsx)(l.X2,{css:{px:"$small3",mt:"$large1"},children:(0,s.jsx)(l.JX,{sm:12,children:(0,s.jsx)(i.Z,{type:"submit",label:"Enviar solicita\xe7\xe3o",css:{mx:"auto",width:"100%","@md":{width:"auto"}}})})})]}),5===t&&(0,s.jsx)(n.Z,{css:{mt:"$small3"},events:[{title:"Solicita\xe7\xe3o de assist\xeancia aberta",tooltip:"Meu e-mail est\xe1 incorreto",tooltipMessage:"N\xf3s te ajudamos! \xc9 s\xf3 chamar a gente no chat.",done:!0,content:(0,s.jsx)(r.Z,{direction:"column",children:(0,s.jsx)(d.Z,{as:"p",textStyle:"bodyMediumRegular",css:{my:"$small3"},children:(0,j.ZP)(e)})})},{title:"Solicita\xe7\xe3o encaminhada ao fornecedor"},{title:"Pe\xe7as enviadas para seu endere\xe7o"}]})]})}function ContentLateDelivery({textFinalization:e,enableTesting:t}){let{step:a}=useCallcenter();return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(d.Z,{as:"h2",textStyle:"h2Semibold",css:{px:"$small3",mt:"$small3",mb:"$medium3","@md":{p:"0"}},children:"Minha entrega est\xe1 atrasada"}),2===a&&(0,s.jsx)(callcenter_CardOrderProducts,{}),3===a&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(callcenter_FormItem,{}),(0,s.jsx)(l.X2,{css:{px:"$small3",mt:"$large1"},children:(0,s.jsx)(l.JX,{sm:12,children:(0,s.jsx)(i.Z,{type:"submit",label:"Enviar solicita\xe7\xe3o",css:{mx:"auto",width:"100%","@md":{width:"auto"}}})})})]}),5===a&&(0,s.jsx)(n.Z,{css:{mt:"$small3"},events:[{title:t?"Solicita\xe7\xe3o aberta":"Temos uma nova data para voc\xea",done:!0,content:(0,s.jsx)(r.Z,{direction:"column",children:(0,s.jsx)(d.Z,{as:"p",textStyle:"bodyMediumRegular",css:{my:"$small3"},children:(0,j.ZP)(e)})})}]})]})}function ContentNotRecieveProduct({onSubmit:e,textFinalization:t}){let{setValue:a}=(0,y.Gc)(),{step:o}=useCallcenter();return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(d.Z,{as:"h2",textStyle:"h2Semibold",css:{px:"$small3",mt:"$small3",mb:"$medium3","@md":{p:"0"}},children:"N\xe3o recebi meu produto"}),2===o&&(0,s.jsx)(callcenter_CardOrderProducts,{}),3===o&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(callcenter_FormItem,{}),(0,s.jsx)(l.X2,{css:{px:"$small3",mt:"$large1"},children:(0,s.jsx)(l.JX,{sm:12,children:(0,s.jsx)(i.Z,{type:"button",label:"Enviar solicita\xe7\xe3o",css:{mx:"auto",width:"100%","@md":{width:"auto"}},onClick:()=>{a("reason",54),e()}})})})]}),5===o&&(0,s.jsx)(n.Z,{css:{mt:"$small3"},events:[{title:"Solicita\xe7\xe3o aberta",tooltip:"Meu e-mail est\xe1 incorreto",tooltipMessage:"N\xf3s te ajudamos! \xc9 s\xf3 chamar a gente no chat.",done:!0,content:(0,s.jsx)(r.Z,{direction:"column",children:(0,s.jsx)(d.Z,{as:"p",textStyle:"bodyMediumRegular",css:{my:"$small3"},children:(0,j.ZP)(t)})})},{title:"Verifica\xe7\xe3o junto \xe0 transportadora"},{title:"Entrega do produto"}]})]})}function ContentProductFailedAfterUse({textFinalization:e}){let{step:t}=useCallcenter(),{watch:a}=(0,y.Gc)();return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(d.Z,{as:"h2",textStyle:"h2Semibold",css:{px:"$small3",mt:"$small3",mb:"$medium3","@md":{p:"0"}}
1,children:"Produto apresentou defeito ap\xf3s o uso"}),2===t&&(0,s.jsx)(callcenter_CardOrderProducts,{}),3===t&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(callcenter_FormItem,{}),(0,s.jsx)(l.X2,{css:{px:"$small3",mt:"$large1"},children:(0,s.jsx)(l.JX,{sm:12,children:(0,s.jsx)(i.Z,{type:"submit",label:"Enviar solicita\xe7\xe3o",disabled:!a("items").every(e=>e.photos&&e.photos.length),css:{mx:"auto",width:"100%","@md":{width:"auto"}}})})})]}),5===t&&(0,s.jsx)(n.Z,{css:{mt:"$small3"},events:[{title:"Solicita\xe7\xe3o aberta",tooltip:"Meu e-mail est\xe1 incorreto",tooltipMessage:"N\xf3s te ajudamos! \xc9 s\xf3 chamar a gente no chat.",done:!0,content:(0,s.jsx)(r.Z,{direction:"column",children:(0,s.jsx)(d.Z,{as:"p",textStyle:"bodyMediumRegular",css:{my:"$small3"},children:(0,j.ZP)(e)})})},{title:"An\xe1lise do defeito do produto"},{title:"Entrega de novo produto"}]})]})}var K=a(67992);function GoBack({label:e,onClick:t}){return(0,s.jsxs)(r.Z,{alignItems:"center",css:{cursor:"pointer"},onClick:t,children:[(0,s.jsx)(L.Z,{icon:K.ac,iconSize:15,css:{mr:"$small2",color:"$secondary4"}}),(0,s.jsx)(d.Z,{as:"span",textStyle:"bodySmallSemibold",css:{color:"$secondary4"},children:e})]})}var Y={2:{default:"Recebemos sua solicita\xe7\xe3o e em at\xe9 2 dias \xfateis entraremos em contato pelo e-mail {{email}} para confirmar e informar os pr\xf3ximos passos.",test:'Pronto, {{nome}}! Pode deixar que nosso time vai resolver tudo para voc\xea! Vamos te avisar dos pr\xf3ximos passos dessa solicita\xe7\xe3o pelo e-mail <b style="font-weight: bold"> {{email}} </b> em <b style="font-weight: bold"> at\xe9 2 dias \xfateis. </b>'},15:{default:"Recebemos sua solicita\xe7\xe3o. Vamos cancelar seu pedido e liberar o saldo para que voc\xea possa comprar um novo item no site.",test:'Pronto, {{nome}}! Vamos cancelar o seu pedido. Em breve, seu saldo aparece na <b style="font-weight: bold"> Carteira </b> da sua <b style="font-weight: bold"> \xc1rea do Cliente </b>. Depois, \xe9 s\xf3 us\xe1-lo para fazer uma nova compra no site!'},31:{default:"Vamos solicitar a coleta do produto e logo que retornar ao nosso centro de distribui\xe7\xe3o, o saldo ficar\xe1 dispon\xedvel para voc\xea comprar um novo item no site.",test:'Pronto, {{nome}}! Vamos fazer a coleta do produto. Assim que ele chegar no nosso Centro de Distribui\xe7\xe3o, seu saldo aparece na <b style="font-weight: bold"> Carteira </b> da sua <b style="font-weight: bold"> \xc1rea do Cliente </b>. Depois, \xe9 s\xf3 us\xe1-lo para fazer uma nova compra no site'},9:{default:"Vamos conferir o que houve junto \xe0 transportadora e providenciar a entrega no endere\xe7o correto. Enviaremos todas as informa\xe7\xf5es pelo e-mail {{email}}.",test:'Pronto, {{nome}}! Nosso time vai verificar o que aconteceu e entregar seu produto no endere\xe7o certo. Vamos te avisar de cada passo dessa solicita\xe7\xe3o no e-mail <b style="font-weight: bold"> {{email}} </b> at\xe9 resolvermos tudo para voc\xea.'},39:{default:"Nosso time j\xe1 est\xe1 com sua solicita\xe7\xe3o e em at\xe9 2 dias \xfateis entrar\xe1 em contato pelo e-mail {{email}} para informar sobre os pr\xf3ximos passos. ",test:'Pronto, {{nome}}! Nosso time vai mandar o produto certo para voc\xea o mais r\xe1pido poss\xedvel. Vamos te avisar dos pr\xf3ximos passos dessa solicita\xe7\xe3o pelo e-mail <b style="font-weight: bold"> {{email}} </b> em <b style="font-weight: bold"> at\xe9 2 dias \xfateis. </b>'},49:{default:"Recebemos sua solicita\xe7\xe3o e em at\xe9 2 dias \xfateis entraremos em contato pelo e-mail {{email}} para confirmar e informar os pr\xf3ximos passos.",test:'Pronto, {{nome}}! Pode deixar que nosso time vai resolver tudo para voc\xea! Vamos te avisar dos pr\xf3ximos passos dessa solicita\xe7\xe3o pelo e-mail <b style="font-weight: bold"> {{email}} </b> em <b style="font-weight: bold"> at\xe9 2 dias \xfateis. </b>'},114:{default:"Seu pedido deve ser entregue at\xe9 o dia {{nova_data}}. Pedimos desculpas pelo atraso em seu pedido. Estamos acompanhando de perto para que a entrega seja feita o quanto antes.",test:"Pedimos desculpas pelo atraso! Nosso time vai investigar o que aconteceu para resolver o quanto antes. Em at\xe9 2 dias \xfateis, informaremos sua nova data de entrega. Se precisar, anote o n\xfamero desta solicita\xe7\xe3o: {{numero_protocolo}}."},54:{default:"Vamos conferir o que houve junto \xe0 transportadora e providenciar a entrega no seu endere\xe7o. Enviaremos todas as informa\xe7\xf5es para o e-mail {{email}}.",test:'Pronto, {{nome}}. Nosso time vai analisar o que aconteceu e entregar seu produto em breve. Vamos te avisar de cada passo dessa solicita\xe7\xe3o no e-mail <b style="font-weight: bold"> {{email}} </b> at\xe9 resolvermos tudo para voc\xea.'},121:{default:"Vamos conferir o que houve junto \xe0 transportadora e providenciar a entrega no seu endere\xe7o. Enviaremos todas as informa\xe7\xf5es para o e-mail {{email}}.",test:'Pronto, {{nome}}. Nosso time vai analisar o que aconteceu e entregar seu produto em breve. Vamos te avisar de cada passo dessa solicita\xe7\xe3o no e-mail <b style="font-weight: bold"> {{email}} </b> at\xe9 resolvermos tudo para voc\xea.'},141:{default:"Vamos conferir o que houve junto \xe0 transportadora e providenciar a entrega no seu endere\xe7o. Enviaremos todas as informa\xe7\xf5es para o e-mail {{email}}.",test:'Pronto, {{nome}}. Nosso time vai analisar o que aconteceu e entregar seu produto em breve. Vamos te avisar de cada passo dessa solicita\xe7\xe3o no e-mail <b style="font-weight: bold"> {{email}} </b> at\xe9 resolvermos tudo para voc\xea.'},19:{default:"Vamos verificar o que houve e providenciar o envio de um novo produto. Enviaremos todas as informa\xe7\xf5es para o e-mail  {{email}}.",test:'Pronto, {{nome}}! Nosso time vai providenciar o envio do seu novo produto. Vamos te avisar de cada passo dessa solicita\xe7\xe3o no e-mail <b style="font-weight: bold"> {{email}} </b> at\xe9 resolvermos tudo para voc\xea.'},20:{default:"Vamos fazer a coleta do produto e providenciar a entrega do produto correto.  Enviaremos todas as informa\xe7\xf5es para o e-mail {{email}}.",test:'Pronto, {{nome}}! Nosso time vai fazer a coleta do produto e entregar o item correto em breve. Vamos te avisar de cada passo dessa solicita\xe7\xe3o no e-mail <b style="font-weight: bold"> {{email}} </b> at\xe9 resolvermos tudo para voc\xea.'},11:{default:"Vamos entrar em contato pelo e-mail {{email}} em at\xe9 dois dias \xfateis para responder sua solicita\xe7\xe3o e te informar dos pr\xf3ximos passos.",test:'Pronto, {{nome}}! Nosso time vai cancelar o pedido. Em <b style="font-weight: bold"> at\xe9 dois dias \xfateis </b>, enviaremos um e-mail para <b style="font-weight: bold"> {{email}} </b> para te explicar os pr\xf3ximos passos.'},22:{default:"Vamos entrar em contato pelo e-mail {{email}} em at\xe9 dois dias \xfateis para responder sua solicita\xe7\xe3o e te informar dos pr\xf3ximos passos.",test:'Pronto, {{nome}}! Nosso time vai cancelar o pedido. Em <b style="font-weight: bold"> at\xe9 dois dias \xfateis </b>, enviaremos um e-mail para <b style="font-weight: bold"> {{email}} </b> para te explicar os pr\xf3ximos passos.'},25:{default:"Nosso time j\xe1 est\xe1 com sua solicita\xe7\xe3o e at\xe9 {{nova_data}} entrar\xe1 em contato pelo e-mail {{email}} para informar sobre os pr\xf3ximos passos.",test:'Pronto, {{nome}}. Pode deixar que vamos te ajudar! Enviaremos um e-mail para <b style="font-weight: bold"> {{email}} </b> at\xe9 <b style="font-weight: bold"> {{nova_data}} </b> para te informar sobre os pr\xf3ximos passos.'},130:{default:"Nosso time j\xe1 est\xe1 com sua solicita\xe7\xe3o e at\xe9 {{nova_data}} entrar\xe1 em contato pelo e-mail {{email}} para informar sobre os pr\xf3ximos passos.",test:'Pronto, {{nome}}! Nosso time vai cancelar a garantia estendida. Em <b style="font-weight: bold"> at\xe9 dois dias \xfateis </b>, enviaremos um e-mail para <b style="font-weight: bold"> {{email}} </b> para te explicar os pr\xf3ximos passos.'}};function SectionReasons(){let{childOrderId:e,setStep:t,order:a,reasons:o,integrationError:n}=useCallcenter(),{watch:c,setValue:m}=(0,y.Gc)(),handleReasonsSelection=e=>{localStorage.setItem("reasonSelectedDate",new Date().toISOString()),m("reason","141"===e?121:Number(e))};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(G(),{href:"/minha-conta/pedidos",children:(0,s.jsx)(GoBack,{label:`Pedido #${e}`})}),(0,s.jsx)(d.Z,{as:"h2",textStyle:"h2Semibold",css:{mb:"$medium1","@md":{p:"$none"}},children:"Solicitar atendimento"}),(0,s.jsx)(d.Z,{as:"p",textStyle:"bodySmallRegular",css:{color:"$neutral4",mb:"$medium1","@md":{p:"$none"}},children:"Conte pra gente como podemos te ajudar! Vamos passar todos os detalhes para que nosso time entenda o que aconteceu e agilize seu atendimento."}
1),(o.length>0||n)&&(0,s.jsx)(I.Z,{css:{mb:"$medium1"},children:(0,s.jsx)(s.Fragment,{children:n?(0,s.jsx)(d.Z,{as:"p",textStyle:"bodyMediumRegular",children:n}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(_.Z,{defaultValue:String(c("reason")),onValueChange:e=>handleReasonsSelection(e),children:(0,s.jsx)(l.X2,{css:{px:"$small1"},children:(0,s.jsx)(s.Fragment,{children:[...new Set(o.flatMap(e=>e.tema))].map(e=>({tema:e,reasons:o.filter(t=>t.tema===e)})).map(e=>(0,s.jsxs)(l.JX,{sm:12,children:[(0,s.jsx)(d.Z,{as:"p",textStyle:"bodyMediumSemibold",css:{mb:"$medium2"},children:e.tema}),e.reasons.map(e=>(0,s.jsx)(S.Z,{css:{mb:"$medium2"},children:(0,s.jsx)(_.Y,{id:String(e.id),value:String(e.id),label:(0,s.jsx)(r.Z,{direction:"column",children:(0,s.jsx)(d.Z,{as:"p",children:e.name})})})},String(e.id)))]},e.tema))})})}),(0,s.jsx)(i.Z,{type:"button",label:"Continuar",css:{mx:"auto",mb:"$small2",width:"100%","@md":{width:"auto"}},disabled:!c("reason"),onClick:()=>{(0,p.Ib)(c("reason"),o.find(e=>e.id===c("reason")).name),(0,P.l)({interaction_step:"1",interaction_orderid:String(a.id_pedped_pai)||null,interaction_orderstatus:sessionStorage.getItem("orderStatus")||null,interaction_orderpaymentmethod:sessionStorage.getItem("paymentMethod")||null,interaction_value:"Solicitar Atendimento",interaction_reason:(0,N.E)(c("reason"))}),t(2)}})]})})}),(0,s.jsx)(O.Z,{message:"D\xfavidas? Confira nossa",link:"Central de Ajuda",targetBlank:"https://ajuda.madeiramadeira.com.br/hc/pt-br",linkUnderline:!0,showIcon:!1,css:{mt:"$medium1",jc:"center","@md":{mt:"$medium3"}}})]})}var ee=a(11259);a(34155);let getClientVerifyMadeiraEnvios=async(e,t)=>{let a=await fetch(`/api/myaccount/callcenter/verify-mm-envios?order=${e}&reason=${t}`,{method:"GET",headers:{"Content-Type":"application/json"}}),{ok:s,status:o,statusText:n}=a;return s?a.json():Promise.reject(Error(JSON.stringify({status:o,statusText:n})))};var et=a(13996),ea=a(32537);let postClientMediation=async e=>{let t=await fetch("/api/myaccount/callcenter/seller-message/v2/mediation",{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}}),{ok:a,status:s,statusText:o}=t;return a?{ok:a,status:s,statusText:o}:Promise.reject(Error(JSON.stringify({status:s,statusText:o})))};var es=a(41642);let eo=(0,g.createContext)({}),en={title:"Erro ao executar",type:"error",variation:"toast",autohide:!0,position:"right"},ei=(0,g.memo)(({children:e,messagingContent:t,setMessagingContent:a,setStep:o,isQueryCancellation:n,orderId:i,sessionId:r,setIsQueryCancellation:l,setThemeSelected:d,themeSelected:c})=>{let{showAlert:m}=(0,es.Z)(),{fetchReasons:u}=useCallcenter(),{setShowLoading:p}=(0,x.OI)(),[h,f]=(0,g.useState)({}),[b,j]=(0,g.useState)([]),[y,S]=(0,g.useState)(null),v=b.length>0?b[0].sessionId:0,errorAlert=e=>m({...en,message:e}),fetchSessions=async()=>{let e=await (0,ea.Y)([i]);if(e[i]){let{allSessions:t}=e[i];f(e[i].sessionsByDate),j(t),S(t.find(({status:e})=>[1,2,4,6].includes(e.id)))}else a("form")},fetchHistoricSessions=async()=>{p("Aguarde, buscando op\xe7\xf5es de atendimento..."),await fetchSessions(),await u("sellerMessaging"),p(null)};(0,g.useEffect)(()=>{i&&fetchHistoricSessions()},[i]);let onMediate=async e=>{try{p("Aguarde, enviando sua solicita\xe7\xe3o de ajuda...");let{ok:t}=await postClientMediation({sessionId:e});t?(await fetchSessions(),a("mediation")):errorAlert("N\xe3o foi poss\xedvel enviar sua solicita\xe7\xe3o, tente novamente mais tarde.")}catch(e){errorAlert("N\xe3o foi poss\xedvel enviar sua solicita\xe7\xe3o, tente novamente mais tarde.")}finally{p(null)}};return(0,s.jsx)(eo.Provider,{value:{sessionId:r,sessionsByDate:h,setSessionsByDate:f,sessions:b,setSessions:j,lastSessionId:v,isQueryCancellation:n,errorAlert,messagingContent:t,setMessagingContent:a,sessionInProgress:y,setSessionInProgress:S,fetchSessions,onMediate,setStep:o,setIsQueryCancellation:l,setThemeSelected:d,themeSelected:c},children:e})}),useMessaging=()=>(0,g.useContext)(eo);var er=a(82241),el=a(18992),ed=a(90868);function ServiceConfirmationCard({showIcon:e=!0,title:t,description:a,button:o}){return(0,s.jsxs)(I.Z,{children:[(0,s.jsxs)(r.Z,{gap:"small3",children:[e&&(0,s.jsx)(L.Z,{"data-testid":"icon",icon:ed.f8,
1iconSize:24,css:{color:"$primary3"}}),(0,s.jsx)(d.Z,{"data-testid":"title",as:"h5",textStyle:"h5Semibold",css:{mt:"2px"},children:t})]}),(0,s.jsxs)(r.Z,{css:{flexDirection:"column",mt:"$medium1",gap:"$medium1","@md":{flexDirection:"row",gap:"$small1"}},children:[(0,s.jsx)(d.Z,{"data-testid":"description",as:"p",textStyle:"bodySmallRegular",children:(0,j.ZP)(a)}),o&&(0,s.jsx)(i.Z,{variant:"primary",label:o.label,onClick:o.onClick})]})]})}function MediatedSection(){let{push:e}=(0,h.useRouter)(),{order:t}=useCallcenter(),{sessions:a}=useMessaging(),o=a.find(e=>4===e.status.id);return(0,s.jsxs)(r.Z,{direction:"column",gap:"medium1",css:{px:"$small2"},children:[(0,s.jsx)(el.Z,{label:`Pedido ${t.id_pedped}`,parentOrderId:t.id_pedped_pai}),(0,s.jsx)(d.Z,{as:"h2",textStyle:"h2Semibold",children:"Pedir ajuda da Madeira"}),(0,s.jsx)(ServiceConfirmationCard,{title:"O time Madeira vai te ajudar!",description:`Voc\xea receber\xe1 uma resposta at\xe9 o dia ${o?.mediationSla} por telefone ou pelo e-mail ${t.email_cobranca}. Voc\xea tamb\xe9m n\xe3o precisar\xe1 mais entrar em contato com o vendedor ${t.nome_seller}.`,button:{label:"Ir para meus pedidos",onClick:()=>e("/minha-conta/pedidos")}}),(0,s.jsxs)(r.Z,{alignItems:"center",gap:"small2",as:"a",href:"https://ajuda.madeiramadeira.com.br/hc/pt-br",css:{textDecoration:"none"},children:[(0,s.jsx)(d.Z,{as:"p",textStyle:"bodyMediumSemibold",css:{color:"$secondary4"},children:"Como alterar informa\xe7\xf5es pessoais"}),(0,s.jsx)(L.Z,{icon:er.sp,iconSize:20,css:{color:"$secondary4"}})]})]})}var ec=a(82208),em=a(89117),eu=a(16655),ex=a(50462);let formatDate=(e,t)=>e?(0,em.WU)((0,ex.D)(e),t):null,sessionMapper=e=>{let{order:t,session_id:a,created_at:s,expired_date:o,messages:n,status:i,reason:r,csat_id:l,mediation_sla:d}=e;return{orderId:t,sessionId:a,createdAtFormated:formatDate(s,"dd/MM/yy HH:mm"),expiredDate:o,expiredDateFormated:formatDate(o,"dd/MM HH:mm"),isExpired:o&&(0,eu.C)((0,ex.D)(e.expired_date)),mediationSla:formatDate(d,"dd/MM"),messages:n&&Array.isArray(n)?n?.map(({created_at:e,received_at:t,...a})=>({...a,createdAt:e,receivedAt:t})):[],status:i,isDone:[3,5].includes(i.id),csatIsPending:!l,reason:{friendlyDescription:r.descricao_central_atendimento,description:r.description,id:r.external_id}}};var ep=a(79533),eh=a(33299);let getResignedUrl=async e=>{let t=await fetch(`/api/myaccount/callcenter/seller-message/resignUrl?url=${encodeURIComponent(e)}`,{method:"GET",headers:{"Content-Type":"application/json"}});return t.json()};var eg=a(38310);let ef={buyer:"flex-end",attendant:"flex-end",seller:"flex-start",system:"center"},eb={area_cliente:"#A3D5FF",app:"#A3D5FF",marketplace:"$neutral2",system:"#FFCA95",infobip:"#89E19A",crm:"#FFB05C"},formatTime=e=>e?(0,em.WU)(e,"HH:mm"):"";function MessageCard({sender:e="system",type:t,message:a,origin:o,receivedAt:n}){let[i,l]=(0,g.useState)(null),resignedUrlImage=async()=>{let{ok:e,resignedUrl:t}=await getResignedUrl(a);t&&e&&l(t)}
1;return(0,g.useEffect)(()=>{"image"===t&&((0,eu.C)((0,eg.T)(n,1))?resignedUrlImage():l(a))},[]),(0,s.jsxs)(r.Z,{gap:"small1",css:{width:"100%",alignItems:ef[e],flexDirection:"column"},children:[(0,s.jsxs)(r.Z,{css:{position:"relative",flexDirection:"column",justifyContent:"center",overflowWrap:"break-word",maxWidth:"system"===o?"auto":"266px",minWidth:"60px",width:"system"===o?"100%":`${"image"===t?"228px":"auto"}`,bc:eb[o],br:"system"===o?"$medium":"$small",ta:"system"===o?"center":"left",p:"$small3",pb:"image"===t?"$large1":`${"system"===o?"$small3":"$medium3"}`,"@md":{maxWidth:"system"===o?"auto":"436px",width:"system"===o?"100%":"auto",minHeight:"52px"}},children:["text"===t?(0,s.jsx)(d.Z,{as:"p",textStyle:"bodySmallRegular",children:(0,j.ZP)(a)}):(0,s.jsx)(r.Z,{onClick:()=>window.open(i,"_blank"),css:{cursor:"pointer","& > img":{br:"$small",width:"216px",height:"216px","@md":{width:"320px",height:"320px"}}},children:i?(0,s.jsx)("img",{src:i,alt:String(n),style:{objectFit:"cover"}}):(0,s.jsx)(k.Skeleton,{animation:!0,css:{width:"216px",height:"216px","@md":{width:"320px",height:"320px"}}})}),n&&(0,s.jsx)(d.Z,{textStyle:"bodyXSmallRegular",css:{color:"$neutral4",position:"absolute",right:"13px",bottom:"5px"},children:formatTime(n)})]}),"crm"===o&&(0,s.jsx)(d.Z,{textStyle:"bodyXSmallRegular",css:{color:"$neutral4"},children:"Mensagem autom\xe1tica - MadeiraMadeira"})]})}var ej=a(98081);function CustomAlert({type:e="info",children:t}){return(0,s.jsx)(ej.Z,{type:e,variation:"inline-box",css:{height:"auto",alignItems:"flex-start"},children:t})}function MediatedAlert({mediationExpired:e,cancellationEnabled:t,onCancel:a}){return(0,s.jsx)(CustomAlert,{children:(0,s.jsxs)(d.Z,{"data-testid":"description",as:"p",textStyle:"bodySmallRegular",children:["O time da Madeira j\xe1 est\xe1 cuidando do seu atendimento e vai te responder at\xe9 o dia"," ",e," por e-mail ou telefone cadastrados.",t&&(0,s.jsxs)(s.Fragment,{children:["Se preferir, voc\xea tamb\xe9m pode"," ",(0,s.jsx)(d.Z,{textStyle:"bodySmallSemibold",css:{color:"$secondary4",cursor:"pointer",textDecoration:"none"},onClick:a,children:"cancelar a compra"}),"."]})]})})}function RequestServiceAlert({onClick:e}){return(0,s.jsx)(CustomAlert,{children:(0,s.jsxs)(d.Z,{"data-testid":"description",as:"p",textStyle:"bodySmallRegular",css:{pt:"7px"},children:["Se precisar, solicite atendimento",(0,s.jsx)(d.Z,{as:"button","data-testid":"button",textStyle:"bodySmallSemibold",onClick:e,css:{color:"$secondary4",cursor:"pointer",textDecoration:"none",p:0,border:"none",bc:"transparent",ml:"$small1"},children:"clicando aqui"}),"."]})})}function ExpiredSessionAlert({sellerName:e,onMediate:t}){return(0,s.jsx)(CustomAlert,{type:"warning",children:(0,s.jsxs)(d.Z,{"data-testid":"description",as:"p",textStyle:"bodySmallRegular",children:["O vendedor ",e," n\xe3o respondeu sua mensagem dentro do prazo. Se desejar, voc\xea pode"," ",(0,s.jsx)(d.Z,{"data-testid":"link",textStyle:"bodySmallSemibold",css:{color:"$secondary4",cursor:"pointer",textDecoration:"none"},onClick:t,children:"pedir ajuda da Madeira"}),"."]})})}var ey=a(55388),eS=a(79619),ev=a(30313);function TextSeparator({showLine:e=!0,description:t}){return(0,s.jsx)(r.Z,{"data-testid":"separator",css:{justifyContent:"center",width:"100%",position:"relative",alignItems:"center","&:before":{borderTop:`1px solid ${e?"$neutral2":"transparent"}`,position:"absolute",display:"block",top:"50%",left:0,width:"100%",content:""}},children:t&&(0,s.jsx)(r.Z,{css:{padding:"0 0.5rem",zIndex:1,bc:"$background2"},children:(0,s.jsx)(d.Z,{"data-testid":"description",as:"span",textStyle:"bodyXSmallRegular",css:{color:"$neutral4"},children:t})})})}var eC=a(42384),e$=a(57546),eZ=a(83064),ew=a(22127),e_=a(19738);let eI=[{value:"Sim",icon:e_.rQ,label:"Sim",color:"$success2"},{value:"N\xe3o",icon:eC.Kf,label:"N\xe3o",color:"$danger3"}],eM=[{value:"5",icon:e_.rQ,label:"Muito satisfeito",color:"$success2"},{value:"4",icon:ew.xC,label:"Satisfeito",color:"$success1"},{value:"3",icon:eZ.I3,label:"Neutro",color:"$warning4"},{value:"2",icon:e$.C4,label:"Insatisfeito",color:"$danger2"},{value:"1",icon:eC.Kf,label:"Muito insatisfeito",color:"$danger3"}];var eR=a(76987);function CSATQuestion({number:e,title:t,description:a}){return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(S.Z,{children:[(0,s.jsx)(eR.P,{children:e}),(0,s.jsx)(d.Z,{as:"span",textStyle:"bodySmallRegular",children:(0,j.ZP)(t)})]}),a&&(0,s.jsx)(d.Z,{as:"p",textStyle:"bodySmallRegular",css:{color:"$neutral4",mt:"$small2"},children:a})]})}function CSATInput({stepDetail:e,form:t,step:a,setStep:o}){return(0,s.jsxs)(r.Z,{direction:"column",gap:"medium1",children:[(0,s.jsx)(TextSeparator,{}),(0,s.jsx)(CSATQuestion,{number:e.number,title:e.title}),e.options&&(0,s.jsx)(r.Z,{css:{flexDirection:"column"},children:e.options.map((n,i)=>(0,s.jsxs)(r.Z,{alignItems:"center",css:{width:"100%",cursor:"pointer",mt:i>0?"$small2":"none",py:"$small2",px:"$medium1",br:"$small",color:t.wat
1ch(e.field)===n.value?"$alwaysWhite":n.color,bc:t.watch(e.field)===n.value?n.color:"$alwaysWhite","@md":{width:"auto"},"& > p":{color:t.watch(e.field)===n.value?"$alwaysWhite":n.color},"&:hover":{bc:n.color,color:"$alwaysWhite","& > p":{color:"$alwaysWhite"}}},onClick:()=>{t.setValue(e.field,n.value),3!==a&&o(1===a?2:3)},children:[(0,s.jsx)(L.Z,{icon:n.icon,iconSize:20,css:{mr:"$small2"}}),(0,s.jsx)(d.Z,{as:"p",textStyle:"bodyMediumBold",children:n.label})]},n.value))}),"comments"===e.field&&(0,s.jsxs)(r.Z,{direction:"column",alignItems:"end",css:{"&>div:first-of-type":{bc:"$alwaysWhite"}},children:[(0,s.jsx)($.Z,{as:"textarea",floatingLabel:!0,label:"Conte mais detalhes (opcional)",maxLength:120,onChange:e=>t.setValue("comments",e.target.value)}),(0,s.jsx)(d.Z,{as:"span",textStyle:"bodyXSmallRegular",css:{color:"$neutral4",mt:"$small1"},children:`${t.watch("comments").length} / 120`})]})]})}function MessagingCSAT({sessionId:e,csatIsPending:t}){let{setShowLoading:a}=(0,x.OI)(),{onMediate:o,errorAlert:n}=useMessaging(),{order:l}=useCallcenter(),c=(0,g.useRef)(),[m,u]=(0,g.useState)(t),[p,h]=(0,g.useState)(1),f=(0,y.cI)({defaultValues:{origin:ey.AY.MENSAGERIA_WEB_ENCERRAMENTO,reference:e,solved:"",evaluation:"",comments:""}});(0,g.useEffect)(()=>{f.register("origin"),f.register("reference"),f.register("solved"),f.register("evaluation"),f.register("comments")});let b=[{field:"solved",number:1,heading:"Avalie esse atendimento",title:`O vendedor ${l.nome_seller} resolveu suas d\xfavidas?`,description:"Sua opini\xe3o \xe9 muito importante para melhorarmos nosso atendimento.",options:eI},{field:"evaluation",number:2,title:`Como voc\xea avalia sua experi\xeancia de atendimento com o vendedor ${l.nome_seller}?`,options:eM},{field:"comments",number:3,title:"Qual o motivo da sua avalia\xe7\xe3o?"}],onSendRating=async t=>{let s=f.getValues();try{let{status:o,data:n}=await (0,ey.lZ)(t,{idfk_avaliacao_origem:s.origin,id_referencia:String(s.reference),satisfacao:Number(s.evaluation),observacao:`Resolvido: ${s.solved}, Comentario: ${s.comments}`});if(200===o)await (0,ev.c)({sessionId:e,csatId:n.id,answer:s.solved}),a(null),u(!1);else throw Error("Erro ao enviar avalia\xe7\xe3o.")}catch(e){a(null),n("N\xe3o foi poss\xedvel registrar sua avalia\xe7\xe3o, tente novamente mais tarde.")}};return(0,s.jsx)(I.Z,{css:{mb:"$small2"},children:m?(0,s.jsxs)(S.Z,{css:{mb:"$medium1"},children:[(0,s.jsxs)(S.Z,{css:{pb:"$small3"},children:[(0,s.jsx)(d.Z,{as:"p",textStyle:"bodyMediumBold",css:{color:"$secondary4",mb:"$small2"},children:"Avalie esse atendimento"}),(0,s.jsx)(d.Z,{as:"h5",textStyle:"bodySmallRegular",children:"Sua opini\xe3o \xe9 muito importante para melhorarmos nosso atendimento."})]}),(0,s.jsx)(S.Z,{css:{br:"$small"},children:(0,s.jsxs)(r.Z,{direction:"column",gap:"medium1",children:[p>=1&&(0,s.jsx)(CSATInput,{step:p,setStep:h,stepDetail:b[0],form:f}),p>=2&&(0,s.jsx)(CSATInput,{step:p,setStep:h,stepDetail:b[1],form:f}),p>=3&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(CSATInput,{stepDetail:b[2],form:f}),(0,s.jsx)(i.Z,{as:"button",label:"Enviar avalia\xe7\xe3o",state:"default",variant:"secondary",css:{width:"100%"},onClick:()=>{a("Aguarde, enviando sua avalia\xe7\xe3o..."),c.current?.execute()}})]})]})}),(0,s.jsx)(eS.Z,{theme:"light",size:"invisible",ref:c,onVerify:onSendRating})]}):(0,s.jsxs)(r.Z,{direction:"column",gap:"small2",children:[(0,s.jsxs)(r.Z,{css:{alignItems:"center",gap:"$small3"},children:[(0,s.jsx)(L.Z,{icon:ed.f8,iconSize:24,css:{color:"$success2"}}),(0,s.jsx)(d.Z,{textStyle:"bodyMediumRegular",children:"A Madeira agradece a sua participa\xe7\xe3o."})]}),"N\xe3o"===f.watch("solved")&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(TextSeparator,{}),(0,s.jsxs)(d.Z,{textStyle:"bodyMediumRegular",children:["Se desejar, voc\xea pode pedir ajuda da Madeira para tirar as d\xfavidas que o vendedor"," ",l.nome_seller," n\xe3o resolveu."]}),(0,s.jsx)(i.Z,{type:"button",variant:"primary",label:"Pedir ajuda da Madeira",onClick:()=>o(e),css:{width:"100%","@md":{width:"auto"}}})]})]})})}var eE=a(21860);function MediationConfirmDialog({open:e,setOpen:t,email:a,sellerName:o}){let{sessionInProgress:n,onMediate:l}=useMessaging();return(0,s.jsxs)(D.Z,{large:"4",open:e,sidebar:!0,onHide:()=>t(null),dismissableMask:!1,tagLine:"PEDIR AJUDA DA MADEIRA",title:z.tq?"Pedir ajuda da Madeira":"Deseja pedir ajuda da Madeira?",footer:(0,s.jsxs)(r.Z,{gap:"small3",css:{pb:"$small2",flexDirection:"row",justifyContent:"end","@md":{pb:"none",flexDirection:"column"}},children:[(0,s.jsx)(i.Z,{type:"button",variant:"secondary",label:"Voltar",onClick:()=>t("mediation"),css:{width:"100%"}}),(0,s.jsx)(i.Z,{type:"button",variant:"primary",label:"Confirmar",onClick:()=>l(n.sessionId),css:{width:"100%"}})]}),children:[z.tq&&(0,s.jsx)(d.Z,{as:"h5",textStyle:"h5Semibold",css:{mb:"$medium1"},children:"Deseja pedir ajuda da Madeira?"}),(0,s.jsxs)(d.Z,{as:"p",textStyle:"bodySmallRegular",children:["Voc\xea receber\xe1 uma resposta at\xe9 o dia ",(0,em.WU)((0,eE.E)(new Date,2),"dd/MM")," por telefone ou pelo e-mail ",a,". Voc\xea tamb\xe9m n\xe3o precisar\xe1 mais entrar em contato com o vendedor"," ",o,"."]})]})}function MediationDialog({open:e,sellerName:t,cancellationEnabled:a,setOpen:o,onCancel:n}){return z.tq&&e?(0,s.jsxs)(r.Z,{direction:"column",css:{position:"absolute",top:0,left:0,width:"100%",height:"100vh",zIndex:20,bc:"rgba(0,0,0,0.3)"},children:[(0,s.jsx)(r.Z,{css:{width:"100%",flex:1},onClick:()=>o(null)}),(0,s.jsxs)(r.Z,{gap:"medium1",direction:"column",css:{width:"100%",p:"$large1",bc:"white",borderTopLeftRadius:"$medium",borderTopRightRadius:"$medium",alignItems:"center"},children:[(0,s.jsx)(d.Z,{textStyle:"h5Semibold",children:"Precisa de ajuda?"}),(0,s.jsxs)(d.Z,{textStyle:"bodySmallRegular",children:["O vendedor ",t," n\xe3o respondeu sua mensagem dentro do prazo. Como deseja continuar?"]}),(0,s.jsx)(i.Z,{type:"button",variant:"primary",label:"Pedir ajuda da Madeira",css:{width:"100%"},onClick:()=>o("confirm_mediation")}),a&&(0,s.jsx)(i.Z,{type:"button",variant:"secondary",label:"Cancelar compra",css:{width:"100%"},onClick:n}),(0,s.jsx)(i.Z,{type:"button",variant:"terciary",label:"Aguardar resposta do vendedor",css:{width:"100%"},onClick:()=>o(null)})]})]}):(0,s.jsx)(D.Z,{large:"4",open:e,onHide:()=>o(null),dismissableMask:!1,title:"Precisa de ajuda?",sidebar:!0,footer:(0,s.jsxs)(r.Z,{gap:"small3",direction:"column",children:[(0,s.jsx)(i.Z,{type:"button",variant:"terciary",label:"Aguardar resposta do vendedor",css:{width:"100%"},onClick:()=>o(null)}),a&&(0,s.jsx)(i.Z,{type:"button",variant:"secondary",label:"Cancelar compra",css:{width:"100%"},onClick:n}),(0,s.jsx)(i.Z,{type:"button",variant:"primary",label:"Pedir ajuda da Madeira",css:{width:"100%"},onClick:()=>o("confirm_mediation")})]}),children:(0,s.jsxs)(d.Z,{textStyle:"bodySmallRegular",children:["O vendedor ",t," n\xe3o respondeu sua mensagem dentro do prazo. Como deseja continuar?"]})})}var eT=a(30595),eA=a(19824),ek=a(50304);let postClientSendMessage=async e=>{let t=await fetch("/api/myaccount/callcenter/seller-message/v2/messages/send",{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}}),{ok:a,status:s,statusText:o}=t;return a?{ok:a,status:s,statusText:o}
1:Promise.reject(Error(JSON.stringify({status:s,statusText:o})))};var eP=a(56821),eN=a(71980),eq=a(60482);function MessagingForm(){let{sessionsByDate:e,setSessionsByDate:t,setSessions:a,sessionInProgress:o,setSessionInProgress:n,errorAlert:l,fetchSessions:d}=useMessaging(),c=(0,g.useRef)(null),[m,u]=(0,g.useState)(!1),[x,p]=(0,g.useState)(!1),[h,f]=(0,g.useState)("");(0,eq.Z)(c.current,h);let onSendMessage=async(s,i)=>{p(!0);let r=new Date,{ok:c}=await postClientSendMessage({createSession:!0,session_id:o.sessionId,type:s,text:i,received_at:r.getTime()});if(c){let{messages:l}=o,c=l[l.length-1];if("buyer"===c.role){let l={createdAt:(0,em.WU)(r,"yyyy-MM-dd hh:mm:ss"),from:"",origin:"area_cliente",receivedAt:r.getTime(),role:"buyer",text:i,type:s},d=Object.keys(e),c=d[d.length-1];a(e=>e.map(e=>e.sessionId===o.sessionId?{...e,messages:[...e.messages,l]}:e)),t(e=>({...e,[c]:[...e[c].map(e=>e.sessionId===o.sessionId?{...e,messages:[...e.messages,l]}:e)]})),n(e=>({...e,messages:[...e.messages,l]}))}else await d()}else l("N\xe3o foi poss\xedvel enviar sua mensagem, por favor, tente novamente mais tarde.");f(""),"image"===s&&u(!1),p(!1)},onFileChange=async e=>{if(e.target.files.length>0){u(!0);let t=await (0,J.Z)(e.target.files),a=t[0],s=`${a.name.split(".")[0]}.jpeg`;f(s);let n=await (0,eN.K)({orderId:o.orderId,fileName:s});if(n.success){let e=await (0,ek.Z)(n.data,a),t=await (0,eP.Q)(e.data);t.success&&await onSendMessage("image",t.data.resignedUrl)}else l("N\xe3o foi poss\xedvel enviar sua imagem.");p(!1),u(!1),f("")}};return(0,s.jsx)("form",{onSubmit:e=>{e.preventDefault(),onSendMessage("text",h)},noValidate:!0,children:(0,s.jsxs)(r.Z,{css:{gap:"$small2",bc:"$background1",bs:"$shadowMedium",p:"$medium1"},children:[(0,s.jsxs)(S.Z,{css:{position:"relative",width:"100%"},children:[m?(0,s.jsx)($.Z,{as:"input",label:"",value:"Enviando imagem, aguarde...",style:{height:"45px",paddingRight:"30px"},disabled:!0}):(0,s.jsx)($.Z,{as:"textarea",ref:c,label:"Digite sua mensagem",value:h,floatingLabel:!0,onChange:e=>f(e.target.value),rows:1,style:{height:"auto",paddingRight:"30px"},disabled:x}),(0,s.jsx)(r.Z,{as:"label",htmlFor:"image",css:{top:8,right:9,position:"absolute",cursor:m||x?"not-allowed":"pointer",zIndex:10},children:(0,s.jsx)(L.Z,{icon:eT.Al,iconSize:21,css:{color:m||x?"$neutral4":"$secondary4"}})})]}),(0,s.jsx)("input",{type:"file",id:"image",accept:"image/*",onChange:onFileChange,style:{display:"none"},disabled:m||x}),(0,s.jsx)(i.Z,{type:"submit",state:m||x?"loading":"default",icon:eA.eF,iconSize:20,loadingText:"",css:{width:"45px",height:"45px"},disabled:!h||x||m})]})})}var eO=a(81472),eD=a(86442);let patchClientCloseSession=async e=>{let t=await fetch("/api/myaccount/callcenter/seller-message/v2/close-session",{method:"PATCH",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}}),{ok:a,status:s,statusText:o}=t;return a?{ok:a,status:s,statusText:o}:Promise.reject(Error(JSON.stringify({status:s,statusText:o})))};function CloseSessionDialog({open:e,setOpen:t}){let a=(0,g.useRef)(),{setShowLoading:o}=(0,x.OI)(),{sessionInProgress:n,fetchSessions:l,setStep:c,isQueryCancellation:m,errorAlert:u}=useMessaging(),onCloseSession=async e=>{o("Aguarde, encerrando atendimento...");try{let{ok:a}=await patchClientCloseSession({captchaToken:e,sessionId:n.sessionId});a&&(c(m?"reason":"theme"),await l(),o(null),t(!1))}catch(e){o(null),u("N\xe3o foi poss\xedvel encerrar o atendimento, por favor, tente novamente mais tarde.")}};return(0,s.jsxs)(D.Z,{large:"6",open:e,sidebar:z.tq,onHide:()=>t(!1),dismissableMask:!1,tagLine:"ENCERRAR ATENDIMENTO",title:z.tq?"Encerrar atendimento":"Deseja encerrar este atendimento?",footer:(0,s.jsx)(r.Z,{gap:"small3",justifyContent:"end",children:(0,s.jsx)(i.Z,{type:"button",variant:"primary",label:"Encerrar",onClick:()=>a.current?.execute()})}),children:[(0,s.jsxs)(s.Fragment,{children:[z.tq&&(0,s.jsx)(d.Z,{as:"h5",textStyle:"h5Semibold",css:{mb:"$medium1"},children:"Deseja encerrar este atendimento?"}),(0,s.jsx)(d.Z,{as:"p",textStyle:"bodySmallRegular",children:"Voc\xea pode encerrar este atendimento caso ele n\xe3o seja mais necess\xe1rio. Se ainda precisar de ajuda, voc\xea pode realizar um novo atendimento."})]}),(0,s.jsx)(eS.Z,{theme:"light",size:"invisible",ref:a,onVerify:onCloseSession})]})}function MessagingSessionCard({session:e}){let{sessionInProgress:t}=useMessaging(),[a,o]=(0,g.useState)(!1);return(0,s.jsxs)("div",{id:`${e.sessionId}`,children:[(0,s.jsx)(CloseSessionDialog,{open:a,setOpen:o}),(0,s.jsx)(I.Z,{children:(0,s.jsxs)(r.Z,{direction:"column",gap:"small3",children:[(0,s.jsxs)(r.Z,{css:{gap:"$small1",flexDirection:"column","@md":{flexDirection:"row",justifyContent:"space-between",alignItems:"center"}},children:[(0,s.jsxs)(r.Z,{alignItems:"center",gap:"small2",children:[(0,s.jsx)(L.Z,{icon:eD.qW,iconSize:22,css:{color:"$primary3"}}),(0,s.jsx)(d.Z,{as:"p",textStyle:"bodyMediumSemibold",css:{color:"$primary3"},children:e.reason.friendlyDescription||e.reason.description})]}),(0,s.jsxs)(d.Z,{as:"span",textStyle:"bodyXSmallRegular",children:["Criado em ",e.createdAtFormated]})]}),t&&4!==t.status.id&&t.sessionId===e.sessionId&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(TextSeparator,{}),(0,s.jsxs)(r.Z,{css:{alignItems:"center",justifyContent:"space-between",gap:"small2",flexDirection:"row-reverse","@md":{flexDirection:"row"}},children:[(0,s.jsx)(S.Z,{css:{display:"block","@md":{display:"none"}},children:(0,s.jsx)(eO.Z,{align:"center",message:"Se precisar de ajuda com outro assunto, encerre este atendimento e abra uma nova solicita\xe7\xe3o.",side:"left",trigger:(0,s.jsx)(L.Z,{icon:er.sp,iconSize:20,css:{color:"$neutral4"}})})}),(0,s.jsx)(d.Z,{as:"p",textStyle:"bodyXSmallRegular",css:{display:"none","@md":{display:"block"}},children:"Se precisar de ajuda com outro assunto, encerre este atendimento e abra uma nova solicita\xe7\xe3o."}),(0,s.jsx)(i.Z,{variant:"terciary",type:"button",label:"Encerrar atendimento",onClick:()=>o(!0),css:{p:0,fontWeight:600,fontSize:"small","&:hover":{bc:"transparent"}}})]})]})]})})]})}function ListMessages({messages:e}){return(0,s.jsx)(s.Fragment,{children:e.map(({receivedAt:e,text:t,role:a,origin:o,type:n})=>(0,s.jsx)(MessageCard,{sender:a,type:n,message:t,origin:o,receivedAt:e},e))})}let{zeCancellationFormId:eF}=(0,ee.R)();function MessagingContent(){let{push:e}=(0,h.useRouter)(),{data:t}=(0,eh.useSession)(),a=(0,g.useRef)(null),{sessionId:o,sessionsByDate:n,setSessionsByDate:i,sessions:l,setSessions:d,lastSessionId:c,setMessagingContent:m,sessionInProgress:u,setSessionInProgress:x}=useMessaging(),p=Object.keys(n),{order:f,cancellationReasons:b}=useCallcenter(),j=b.length>0,[y,S]=(0,g.useState)(null);(0,g.useEffect)(()=>{u&&u.isExpired&&1===u.status.id&&S("mediation")},[u]);let scrollToLast=()=>{a.current?.scroll({top:a.current?.scrollHeight,behavior:"smooth"})};(0,g.useEffect)(()=>{let e=l.length>0?l[0]:null;if(o&&e&&o!==`${e.sessionId}`){let e=document.getElementById(o);if(e&&a.current?.scrollTop===0){let t=a.current.getBoundingClientRect(),s=e.getBoundingClientRect();a.current?.scrollTo({top:s.top-(t.top+15),behavior:"smooth"})}else scrollToLast()}else scrollToLast()},[n,u,o]);let updateSession=(e,t,a)=>{if(e.sessionId===t.session_id){let s=sessionMapper(t),o=e.messages.find(e=>e.receivedAt.toString()===a.received_at.toString()&&e.origin===a.origin);if(o)return{...s,messages:[...e.messages]};if(a){let{created_at:t,received_at:o,...n}=a;return{...s,messages:[...e.messages,{...n,createdAt:t,receivedAt:o}]}}return{...s,messages:[...e.messages]}}return e},onMessageSeller=e=>{let{session:t,message:a}=e;if("seller"===a.role){d(e=>e.map(e=>
1updateSession(e,t,a))),x(e=>updateSession(e,t,a));let e=p[p.length-1];i(s=>({...s,[e]:[...s[e].map(e=>updateSession(e,t,a))]}))}},onFinishSession=e=>{d(t=>t.map(t=>updateSession(t,e,null))),x(null);let t=p[p.length-1];i(a=>({...a,[t]:[...a[t].map(t=>updateSession(t,e,null))]})),scrollToLast()};(0,g.useEffect)(()=>{let e=`presence-mensageria-seller-client-${t.customer_id}`,a=ec.Z.subscribe(e);return a.bind("new-message",onMessageSeller),a.bind("finish",onFinishSession),()=>a.unsubscribe()},[]);let goToCancellation=()=>{e((0,et.Av)(f.id_pedped_pai,f.id_pedped,eF))};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(r.Z,{ref:a,css:{p:"$medium1",flex:1,flexDirection:"column",gap:"$medium1",overflowY:"auto",overflowX:"hidden",bc:"$background2","@md":{flex:"auto",height:"437px"}},children:[p.map(e=>(0,s.jsxs)(g.Fragment,{children:[(0,s.jsx)(TextSeparator,{description:(0,em.WU)((0,ex.D)(e),"dd 'de' MMMM",{locale:ep.F}),showLine:!1}),n[e].map(e=>(0,s.jsxs)(g.Fragment,{children:[(0,s.jsx)(MessagingSessionCard,{session:e}),(0,s.jsx)(ListMessages,{messages:e.messages}),!e.isExpired&&1===e.status.id&&e.expiredDate&&(0,s.jsx)(MessageCard,{origin:"system",type:"text",message:`${f.nome_seller} tem at\xe9 o dia ${e.expiredDateFormated} para responder. Vamos avisar quando chegar a resposta!`}),3===e.status.id&&(0,s.jsx)(TextSeparator,{description:"Conversa encerrada"}),e.isDone&&e.csatIsPending&&c===e.sessionId&&(0,s.jsx)(MessagingCSAT,{sessionId:e.sessionId,csatIsPending:e.csatIsPending}),[4,5].includes(e.status.id)&&(0,s.jsx)(TextSeparator,{description:"Transferido para Madeira"}),4===e.status.id&&(0,s.jsx)(MediatedAlert,{mediationExpired:e?.mediationSla,cancellationEnabled:j,onCancel:goToCancellation}),u&&u.sessionId===e.sessionId&&1===u.status.id&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(MediationDialog,{open:"mediation"===y,setOpen:S,sellerName:f.nome_seller,cancellationEnabled:j,onCancel:goToCancellation}),(0,s.jsx)(MediationConfirmDialog,{open:"confirm_mediation"===y,setOpen:S,sellerName:f.nome_seller,email:f.email_cobranca}),u.isExpired&&(0,s.jsx)(ExpiredSessionAlert,{sellerName:f.nome_seller,onMediate:()=>S("mediation")})]})]},`${e.sessionId}`))]},e)),l.every(e=>e.isDone)&&(0,s.jsx)(RequestServiceAlert,{onClick:()=>{let e=new URLSearchParams(window.location.search);e.set("sub",`${f.id_pedped}`),window.history.replaceState(null,"",`?${e.toString()}`),m("form")}})]}),u&&4!==u.status.id&&(0,s.jsx)(MessagingForm,{})]})}var ez=a(4300);function SellerInformationCard({nomeSeller:e,onReturn:t}){let{setMessagingContent:a,sessions:o}=useMessaging(),n=o[0],{sessionId:l,status:c,messages:m=[]}=n??{},u=[1,2].includes(c?.id),x=m.some(({role:e})=>"seller"===e);return(0,s.jsxs)(r.Z,{css:{height:"64px",bc:"$background1",borderBottom:"1px solid $neutral2",justifyContent:"space-between",alignItems:"center",px:"$medium2","@md":{px:"$small3"}},children:[(0,s.jsx)(S.Z,{css:{display:"block","@md":{display:"none"}},children:(0,s.jsx)(i.Z,{type:"button",variant:"terciary",icon:K.ac,iconSize:20,css:{p:"0px",color:"$neutral4"},onClick:t})}),(0,s.jsx)(d.Z,{as:"h4",textStyle:"h4Semibold",css:{width:"100%",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",textAlign:"center"},children:e}),(0,s.jsx)(S.Z,{children:(0,s.jsx)(i.Z,{variant:"secondary",label:"Reportar problema",icon:ez.FO,iconSize:20,onClick:()=>a("report"),disabled:!(l&&u&&x),css:{p:"0px",boxShadow:"none",color:"$neutral4","& > span":{display:"none","@md":{display:"block"}},"&:disabled":{bc:"$neutral3 !important"},"&:disabled > i":{mx:"$small1",mt:"2px"},"@md":{py:"$small2",px:"$medium1",border:"1px solid $secondary4",boxShadow:"initial",color:"$secondary4","&:disabled":{bc:"transparent !important"},"&:disabled > i":{mr:"$small2",mt:"0"}}}})})]})}function ProductInformationCard({orderId:e,firstProduct:t,productIds:a,productImages:o}){let n=a.length>1;return(0,s.jsxs)(r.Z,{css:{bc:"$background1",alignItems:"center",p:"$small3",gap:"$small2"},children:[o.map((e,t)=>(0,s.jsx)(S.Z,{css:{width:"40px",height:"40px"},children:(0,s.jsx)(A(),{width:40,height:40,src:e,alt:`Produto ${a[t]}`,layout:"fixed"})},a[t])),z.tq?(0,s.jsxs)(r.Z,{css:{flexDirection:"column",width:"calc(100% - 50px)",position:"relative"},children:[(0,s.jsxs)(d.Z,{textStyle:"bodySmallSemibold",css:{color:n?"$secondary4":"$neutral5"},children:["Pedido #",e]}),(0,s.jsx)(d.Z,{as:"p",textStyle:"bodySmallRegular",css:{width:"100%",overflow:"hidden",
1whiteSpace:"nowrap",textOverflow:"ellipsis"},children:n?`${a.length} itens`:t.nome})]}):(0,s.jsxs)(d.Z,{as:"p",textStyle:"bodySmallRegular",css:{whiteSpace:"nowrap",flex:"1",overflow:"hidden",textOverflow:"ellipsis"},children:[(0,s.jsxs)(d.Z,{as:"b",textStyle:"bodySmallSemibold",css:{color:n?"$secondary4":"$neutral5"},children:["Pedido #",e]}),n?` - ${a.length} itens`:` - ${t.nome}`]})]})}function MessagingHeader({onReturn:e}){let{order:t}=useCallcenter(),{items:a}=t,o=(0,g.useMemo)(()=>Object.keys(a)||[],[a]),n=o.map(e=>a[e].image),[i,r]=(0,g.useState)([]);return(0,g.useEffect)(()=>{let fetchProductImage=async()=>{0===i.length&&Promise.all(o.map(e=>getClientProductImage(a[e].id_prdprd))).then(e=>{r(e.map(({data:e})=>e.images[0].value))})};n.some(e=>"string"!=typeof e)?fetchProductImage():r(n)},[o,n,a,i]),(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(SellerInformationCard,{nomeSeller:t.nome_seller,onReturn:e}),(0,s.jsx)(ProductInformationCard,{orderId:t.id_pedped,firstProduct:a[o[0]],productIds:o,productImages:i})]})}function MessagingSection(){let e=(0,h.useRouter)(),{order:t}=useCallcenter(),{sessions:a}=useMessaging();return(0,s.jsxs)(r.Z,{direction:"column",gap:"medium1",css:{px:"$small2"},children:[(0,s.jsx)(el.Z,{label:`Pedido ${t.id_pedped}`,parentOrderId:t.id_pedped_pai}),0===a.length?null:z.tq?(0,s.jsx)(D.Z,{open:!0,onHide:()=>!1,dismissableMask:!1,children:(0,s.jsxs)(r.Z,{css:{position:"absolute",top:"0px",left:"0px",height:"100vh",width:"100vw",flexDirection:"column",bc:"$background2",zIndex:10},children:[(0,s.jsx)(MessagingHeader,{onReturn:()=>{let a=t.id_pedped_pai,s=localStorage.getItem(a)||localStorage.getItem("lastOrdersPagination");localStorage.removeItem(a),localStorage.setItem("scrollToOrder",a),e.push(`/minha-conta/pedidos?page=${s}`)}}),(0,s.jsx)(MessagingContent,{})]})}):(0,s.jsx)(I.Z,{css:{p:"0",overflow:"hidden"},children:(0,s.jsxs)(r.Z,{direction:"column",children:[(0,s.jsx)(MessagingHeader,{}),(0,s.jsx)(MessagingContent,{})]})})]})}let postClientReportProblem=async(e,t)=>{let a=await fetch("/api/myaccount/callcenter/seller-message/v2/report-problem",{method:"POST",body:JSON.stringify({sessionId:e,description:t}),headers:{"Content-Type":"application/json"}}),{status:s,statusText:o,ok:n}=a;return n?a.json():Promise.reject(Error(JSON.stringify({status:s,statusText:o})))};var eL=a(1682),eV=a(65273);let eU=["Respondeu sem solucionar a d\xfavida ou problema","Pagamento indevido","Direcionou para a\xe7\xe3o ou links suspeitos","Entrou em contato fora do site ou app Madeira","Direcionou a conversa para fora do site ou app Madeira","Meu problema n\xe3o est\xe1 na lista"].map(e=>({label:e,value:e}));function ReportProblemSection(){let{push:e}=(0,h.useRouter)(),{setShowLoading:t}=(0,x.OI)(),{order:a,trackSellerMessageProps:o}=useCallcenter(),n=a.nome_seller,{sessionInProgress:l,errorAlert:c,fetchSessions:m,setMessagingContent:u}=useMessaging(),[p,f]=(0,g.useState)(""),[b,j]=(0,g.useState)(!1),openReport=async()=>{t("Aguarde, reportando problema..."),(0,eL._)(eL.P.REPORTED_PROBLEM,{...o,reason:p});let{sessionId:e,status:a,messages:s=[]}=l??{},n=[1,2].includes(a?.id),i=s.some(({role:e})=>"seller"===e);if(!(e&&n&&i)){t(null),c("N\xe3o foi poss\xedvel reportar o problema, tente novamente mais tarde.");return}try{await postClientReportProblem(l?.sessionId,p),await m(),t(null),j(!0)}catch(e){t(null),c("N\xe3o foi poss\xedvel reportar o problema, tente novamente mais tarde.")}};return(0,s.jsxs)(r.Z,{direction:"column",gap:"medium1",css:{px:"$small2"},children:[(0,s.jsx)(el.Z,{label:"Voltar",onClick:()=>u("chat")}),(0,s.jsx)(d.Z,{as:"h2",textStyle:"h2Semibold",children:"Reportar problema"}),b?(0,s.jsx)(ServiceConfirmationCard,{title:"O time Madeira vai te ajudar!",description:`Voc\xea receber\xe1 uma resposta at\xe9 o dia ${l?.mediationSla} por telefone ou pelo e-mail ${a.email_cobranca}. Voc\xea tamb\xe9m n\xe3o precisar\xe1 mais entrar em contato com o vendedor ${n}.`,button:{label:"Ir para meus pedidos",onClick:()=>e("/minha-conta/pedidos")}}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(d.Z,{as:"p",textStyle:"bodySmallRegular",children:["Descreva o problema que voc\xea teve ao se comunicar com o vendedor parceiro ",n,"."]}),(0,s.jsx)(eV.Z,{number:1,title:"Qual foi o problema ao se comunicar com o vendedor?",options:eU,value:p,onChange:e=>f(e)}),(0,s.jsx)(i.Z,{type:"button",label:"Continuar",css:{mx:"auto"},onClick:openReport,disabled:!p})]})]})}function SelectReason({title:e,reasons:t,reasonSelected:a,setReasonSelected:o,fetchScripts:n,setStep:l}){let{order:c}=useCallcenter(),{sessions:m,sessionInProgress:u,isQueryCancellation:x}=useMessaging(),disableReasonOption=e=>u&&![11,22].includes(e),changeServiceAlreadyRequested=e=>u?.reason.id===e?{description:"Atendimento em andamento",labelLink:"Ac
1ompanhar",link:`/minha-conta/pedidos/central-de-atendimento?sub=${c.id_pedped}-${u.sessionId}`}:m.some(t=>t.reason.id===e)?{description:"Atendimento encerrado",labelLink:"Ver hist\xf3rico",link:`/minha-conta/pedidos/atendimentos/${c.id_pedped_pai}/${c.id_pedped}`}:null;return(0,s.jsxs)(r.Z,{direction:"column",gap:"medium1",css:{px:"$small2"},children:[x?(0,s.jsx)(el.Z,{label:`Pedido ${c.id_pedped}`,parentOrderId:c.id_pedped_pai}):(0,s.jsx)(el.Z,{label:"Voltar",onClick:()=>l("theme")}),(0,s.jsx)(d.Z,{as:"h2",textStyle:"h2Semibold",children:e}),x&&(0,s.jsx)(ej.Z,{isSolid:!0,type:"info",variation:"banner",title:"Por que n\xe3o posso trocar o produto?",css:{position:"relative",width:"100%",top:0,left:0,boxShadow:"none",maxWidth:"calc(100% - $medium1)"},children:"Este pedido n\xe3o pode ser trocado, pois \xe9 vendido por um vendedor parceiro. Por favor, cancele e fa\xe7a uma nova compra."}),(0,s.jsx)(eV.Z,{number:x?1:2,title:"Como podemos ajudar?",options:t.map(e=>({label:e.name,value:String(e.id),disabled:disableReasonOption(e.id),serviceAlreadyRequested:changeServiceAlreadyRequested(e.id)})),value:String(a),onChange:e=>o(Number(e))}),"Cancelar ou tirar d\xfavidas sobre cancelamento"===e&&(0,s.jsxs)(d.Z,{as:"p",textStyle:"bodySmallRegular",css:{mx:"auto"},children:["D\xfavidas? Confira nossa"," ",(0,s.jsx)(d.Z,{as:"a",target:"_blank",href:"https://ajuda.madeiramadeira.com.br/hc/pt-br",textStyle:"bodySmallSemibold",css:{textDecoration:"underline",color:"$secondary4"},children:"Central de ajuda"})]}),(0,s.jsx)(i.Z,{type:"button",label:"Continuar",css:{mx:"auto"},onClick:n,disabled:!a})]})}function SelectTheme({themes:e,themeSelected:t,setThemeSelected:a,setStep:o}){let{order:n}=useCallcenter();return(0,s.jsxs)(r.Z,{direction:"column",gap:"medium1",css:{px:"$small2"},children:[(0,s.jsx)(el.Z,{label:`Pedido ${n.id_pedped}`,parentOrderId:n.id_pedped_pai}),(0,s.jsxs)(d.Z,{as:"h2",textStyle:"h2Semibold",children:["Solicite atendimento para ",n.nome_seller]}),(0,s.jsxs)(d.Z,{as:"p",textStyle:"bodySmallRegular",children:["Vamos passar todos os detalhes para que o ",n.nome_seller," entenda o que houve e agilize seu atendimento."]}),e.length>0&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(eV.Z,{number:1,title:"Com qual tema voc\xea quer ajuda?",options:e.filter(e=>"Cancelar ou tirar d\xfavidas sobre cancelamento"!==e).map(e=>({label:e,value:e})),value:t,onChange:a}),(0,s.jsxs)(d.Z,{as:"p",textStyle:"bodySmallRegular",css:{mx:"auto"},children:["D\xfavidas? Confira nossa"," ",(0,s.jsx)(d.Z,{as:"a",target:"_blank",href:"https://ajuda.madeiramadeira.com.br/hc/pt-br",textStyle:"bodySmallSemibold",css:{textDecoration:"underline",color:"$secondary4"},children:"Central de ajuda"})]}),(0,s.jsx)(i.Z,{type:"button",label:"Continuar",css:{mx:"auto"},onClick:()=>o("reason"),disabled:!t})]})]})}let postClientCheckAndShortenUrl=async e=>{let t=await fetch("/api/myaccount/check-and-shorten-url",{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}}),{status:a,statusText:s}=t;if(200!==a)return Promise.reject(Error(JSON.stringify({status:a,statusText:s})));let o=await t.json();return{data:o,status:a,statusText:s}};a(6230);let postClientGenerateSignedUrl=async e=>{let t=await fetch("/api/myaccount/generate-signed-url",{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}}),{status:a,statusText:s}=t;if(200!==a)return Promise.reject(Error(JSON.stringify({status:a,statusText:s})));let o=await t.json();return{data:o,status:a,statusText:s}},postClientCreateSession=async e=>{let t=await fetch("/api/myaccount/callcenter/seller-message/v2/session",{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}}),{ok:a,status:s,statusText:o}=t;return a?t.json():Promise.reject(Error(JSON.stringify({status:s,statusText:o})))};var eB=a(14784),eJ=a(2267);function InputDescription({title:e,onReturn:t,questionNumber:a,inputPlaceholder:o,showInformation:n,disableSubmit:l}){let{watch:c,setValue:m}=(0,y.Gc)();return(0,s.jsxs)(r.Z,{direction:"column",gap:"medium1",css:{px:"$small2"},children:[(0,s.jsx)(el.Z,{onClick:t}),(0,s.jsx)(d.Z,{as:"h2",textStyle:"h2Semibold",children:e}),(0,s.jsxs)(I.Z,{children:[(0,s.jsx)(eJ.Z,{number:a,title:"Deseja nos contar mais detalhes para entendermos melhor o que aconteceu c
1om seu pedido?"}),(0,s.jsx)($.Z,{as:"input",type:"text",placeholder:o,value:c("description"),onChange:e=>m("description",e.target.value)})]}),n&&(0,s.jsxs)(r.Z,{alignItems:"center",gap:"small2",children:[(0,s.jsx)(L.Z,{icon:eB.sq,iconSize:20,css:{color:"#005E80"}}),(0,s.jsx)(d.Z,{as:"p",textStyle:"bodyMediumSemibold",children:"Vamos compartilhar sua mensagem com o vendedor"})]}),(0,s.jsx)(i.Z,{type:"submit",label:"Enviar",css:{mx:"auto"},disabled:l})]})}var eX=a(40768);function RequestCompleted({title:e,reference:t,items:a,titleConfirmationCard:o,descriptionConfirmationCard:n,buttonConfirmationCard:i}){let{order:l}=useCallcenter();return(0,s.jsxs)(r.Z,{direction:"column",gap:"medium1",css:{px:"$small2"},children:[(0,s.jsx)(el.Z,{label:`Pedido ${l.id_pedped}`,parentOrderId:l.id_pedped_pai}),(0,s.jsx)(d.Z,{as:"h2",textStyle:"h2Semibold",children:e}),(0,s.jsx)(ServiceConfirmationCard,{title:o,description:n,button:i}),(0,s.jsx)(eX.Z,{origin:ey.AY.MENSAGERIA_WEB_ABERTURA,reference:t,order:l.id_pedped,items:a||[],reason:e})]})}function ImagesDragAndDrop({maxFiles:e,accept:t={"image/*":[".png",".jpg",".jpeg",".webp"]},files:a,onDrop:o}){let{getRootProps:n,getInputProps:i,open:l}=(0,F.uI)({disabled:a.length===e,noClick:!0,noKeyboard:!0,accept:t,maxFiles:e,onDrop:async t=>{let s=await (0,J.Z)(t);if(t.length+a.length<=e){let e=s.map(e=>Object.assign(e,{preview:URL.createObjectURL(e)}));o([...a,...e])}}});return(0,s.jsxs)(r.Z,{direction:"column",alignItems:"center",css:{bc:"$neutral1",br:"$small",border:"1px dashed $secondary4",p:"$small2"},...n({className:"dropzone"}),children:[a.length>0?(0,s.jsxs)(r.Z,{justifyContent:"center",flexWrap:"wrap",gap:"small2",children:[a.map(e=>(0,s.jsxs)(S.Z,{css:{position:"relative",display:"inline-flex",br:"$small",border:"1px solid $secondary4",bc:"$mono1",width:"100px",height:"100px",padding:"$small2",boxSizing:"border-box"},children:[(0,s.jsx)(r.Z,{css:{minWidth:"0",overflow:"hidden"},children:(0,s.jsx)("img",{src:e.preview,width:"auto",height:"100%",alt:""})}),(0,s.jsx)(r.Z,{alignItems:"center",justifyContent:"center",css:{position:"absolute",width:"$medium3",height:"$medium3",top:"-1px",right:"-1px",btrr:"$small",bblr:"$small",bc:"$secondary4",cursor:"pointer"},onClick:()=>o(a.filter(t=>t.preview!==e.preview)),children:(0,s.jsx)(L.Z,{icon:U.NB,iconSize:15,css:{color:"$mono1"}})})]},e.name)),a.length<e&&(0,s.jsx)(r.Z,{alignItems:"center",justifyContent:"center",css:{br:"$small",bc:"$neutral3",mr:"$small1",width:"100px",height:"100px",cursor:"pointer"},onClick:l,children:(0,s.jsx)(L.Z,{icon:B.r8,iconSize:28,css:{color:"$mono1"}})})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(L.Z,{icon:V._j,iconSize:62,css:{color:"$neutral3",lineHeight:1,mb:"$small2"},onClick:l}),(0,s.jsx)(d.Z,{as:"button",type:"button",textStyle:"bodyMediumBold",css:{color:"$secondary4",cursor:"pointer",bc:"transparent",border:"none"},onClick:l,children:"Adicionar fotos"})]}),(0,s.jsx)("input",{...i()})]})}let eW={2:"Envie fotos que mostrem detalhes do item quebrado ou com defeito.",20:"Nos ajude a identificar o produto que recebeu. Procure na embalagem a etiqueta da MadeiraMadeira e tire uma foto em que o nome e o endere\xe7o apare\xe7am nitidamente.",39:"Nos ajude a identificar o produto que recebeu. Procure na embalagem a etiqueta do fornecedor e tire uma foto em que o nome e a cor do produto apare\xe7am nitidamente.",49:"Nos ajude a identificar o produto que recebeu. Procure na embalagem a etiqueta da MadeiraMadeira e tire uma foto em que o nome e o endere\xe7o apare\xe7am nitidamente."};function SelectImages({title:e,questionNumber:t,questionTitle:a,reasonSelected:o,disabledContinue:n,onReturn:l,onContinue:c}){let{setValue:m,watch:u}=(0,y.Gc)(),[x,p]=(0,g.useState)(!1);return(0,s.jsxs)(r.Z,{direction:"column",gap:"medium1",css:{px:"$small2"},children:[(0,s.jsx)(el.Z,{onClick:l}),(0,s.jsx)(d.Z,{as:"h2",textStyle:"h2Semibold",children:e}),(0,s.jsx)(I.Z,{children:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(eJ.Z,{number:t,title:a,subtitle:eW[o]}),2!==o&&(0,s.jsx)(d.Z,{as:"button",type:"button",textStyle:"bodyMediumBold",css:{color:"$secondary4",cursor:"pointer",bc:"transparent",border:"none",mb:"$medium1"},onClick:()=>p(!0),children:"Como identificar a etiqueta"}),(0,s.jsx)(ImagesDragAndDrop,{maxFiles:5,files:u("images"),onDrop:e=>m("images",e)}),(0,s.jsxs)(D.Z,{open:x,onHide:()=>p(!1),tagLine:"SOLICITAR ATENDIMENTO",title:"Como identificar a etiqueta",footer
1:(0,s.jsx)(i.Z,{type:"button",label:"Voltar",variant:"secondary",onClick:()=>p(!1),css:{ml:"auto",display:"none","@md":{display:"block"}}}),children:[(0,s.jsx)(d.Z,{as:"h3",textStyle:"bodyMediumBold",children:"Exemplo de etiqueta do fornecedor"}),(0,s.jsx)(S.Z,{css:{m:"$medium1 auto","@md":{width:"65%"}},children:(0,s.jsx)("img",{src:"/assets/supplier-label.svg",alt:"Etiqueta",width:"100%"})}),(0,s.jsx)(d.Z,{as:"p",textStyle:"bodyMediumRegular",children:"Pode ser que a etiqueta do fornecedor seja de uma cor diferente. Nela, est\xe3o o nome do fornecedor e a descri\xe7\xe3o do produto: nome do produto, cor e volume."})]})]})}),(0,s.jsx)(i.Z,{type:"button",label:"Continuar",css:{mx:"auto"},onClick:c,disabled:n})]})}let eG={2:"O que chegou quebrado ou com defeito?",11:"Por que deseja cancelar?",22:"Por que deseja cancelar?",25:"O que chegou quebrado ou com defeito?",27:"Por que voc\xea n\xe3o consegue acessar o link de rastreio?",39:"O que chegou diferente?",49:"O que voc\xea n\xe3o recebeu?",183:"O que aconteceu durante a entrega?"};function SelectSubreason({title:e,reasonSelected:t,onReturn:a,onContinue:o,subreasons:n,questionNumber:l,questionSubtitle:c}){let{watch:m,setValue:u}=(0,y.Gc)();return(0,s.jsxs)(r.Z,{direction:"column",gap:"medium1",css:{px:"$small2"},children:[(0,s.jsx)(el.Z,{onClick:a}),(0,s.jsx)(d.Z,{as:"h2",textStyle:"h2Semibold",children:e}),(0,s.jsx)(eV.Z,{number:l,title:eG[t]??"Nos d\xea detalhes sobre o ocorrido:",subtitle:c,options:n.map(e=>({label:e.name,value:String(e.id)})),value:m("subreason"),onChange:e=>u("subreason",e)}),(0,s.jsx)(i.Z,{type:"button",label:"Continuar",css:{mx:"auto"},onClick:o,disabled:!m("subreason")})]})}function SessionForm({setStep:e,reasonSelected:t,reasonScripts:a}){let o=(0,g.useRef)(),{subreasons:n,scripts:i}=a,r=n?.length>0,l=i?.some(e=>e.suggestion_id.includes("foto")),{setShowLoading:d}=(0,x.OI)(),{order:c,reasons:m}=useCallcenter(),{fetchSessions:u,setMessagingContent:p,isQueryCancellation:h,sessionInProgress:f}=useMessaging(),[b,j]=(0,g.useState)(null),[S,v]=(0,g.useState)(null),C=m.find(e=>e.id===t).name,{register:$,watch:Z,getValues:w,..._}=(0,y.cI)({defaultValues:{subreason:null,images:[],description:""}});(0,g.useEffect)(()=>{$("subreason"),$("images"),$("description",{required:!0})},[]),(0,g.useEffect)(()=>{r?j("subreason"):l?j("image"):j("description")},[r,l]);let onSubmitForm=async e=>{d("Aguarde, enviando solicita\xe7\xe3o...");let{subreason:a,images:s,description:o}=w(),updateSessions=async()=>{await u(),d(null),j("done")};try{let{data:n}=await postClientCreateSession({captchaToken:e,order_id:c.id_pedped,reason_id:t,subreason_id:Number(a)});if(n){v(n.session_id);let e=new Date,t=await postClientSendMessage({createSession:!0,session_id:n.session_id,type:"text",text:o,received_at:e.getTime()});if(!t)throw Error("N\xe3o foi poss\xedvel enviar sua mensagem para o vendedor.");if(s.length>0){d("Aguarde, anexando imagens...");let t=s.map(e=>({name:`${e.name.split(".")[0]}.jpeg`,content:e,type:"image/jpeg"})),a=Promise.all(t.map(t=>postClientGenerateSignedUrl({orderId:c.id_pedped,name:t.name,rootPath:"sellerMessage"}).then(a=>(0,ek.Z)(a.data,t.content).then(a=>postClientCheckAndShortenUrl({name:t.name,type:t.type,encodedUrl:a.data}).then(t=>(e=new Date,postClientSendMessage({createSession:!0,session_id:n.session_id,type:"image",text:t.data.content,received_at:e.getTime()}).then(e=>e)))))));a.then(()=>updateSessions())}else updateSessions()}else throw Error("Ocorreu um erro ao tentar criar a sess\xe3o.")}catch(e){d(null)}};return(0,s.jsxs)(y.RV,{..._,register:$,watch:Z,getValues:w,children:[(0,s.jsxs)("form",{onSubmit:e=>{e&&e.preventDefault(),o.current?.execute()},children:["subreason"===b&&n&&(0,s.jsx)(SelectSubreason,{title:C,reasonSelected:t,onReturn:()=>e("reason"),onContinue:()=>j(l?"image":"description"),subreasons:n,questionNumber:h?2:3}),"image"===b&&(0,s.jsx)(SelectImages,{title:C,questionNumber:r?4:3,questionTitle:2===t?"Adicione fotos (Opcional)":"Fotos das etiquetas (Opcional)",onReturn:()=>r?j("subreason"):e("reason"),onContinue:()=>j("description"),reasonSelected:t}),"description"===b&&(0,s.jsx)(InputDescription,{title:C,questionNumber:r&&l?5:r||l?4:h?2:3,inputPlaceholder:"Escreva aqui",showInformation:!0,disableSubmit:!Z("description"),onReturn:()=>{l?j("image"):r?j("subreason"):e("reason")}})]}),"done"===b&&(0,s.jsx)(RequestCompleted,{title:C,reference:S,titleConfirmationCard:`Mensagem enviada para ${c.nome_seller}`,descriptionConfirmationCard:`O vendedor parceiro tem ${f?.expiredDate?`at\xe9 o dia ${(0,em.WU)((0,ex.D)(f?.expiredDate),"dd/MM HH:mm")}`:"2 dias \xfateis"} para te responder. Se ele n\xe3o responder at\xe9 l\xe1, voc\xea poder\xe1 pedir nossa ajuda.`,buttonConfirmationCard:{label:"Ver mensagem",onClick:()=>{let e=new URLSearchParams(window.location.search);e.set("sub",`${c.id_pedped}-${S}`),window.history.replaceState(null,"",`?${e.toString()}`),p("chat")}}}),(0,s.jsx)(eS.Z,{theme:"light",size:"invisible",ref:o,onVerify:onSubmitForm})]})}let{zeCancellationFormId:eH,zeDeliveryIssuesFormId:eQ}=(0,ee.R)();function SellerChatv2(){let{query:e,push:t}=(0,h.useRouter)(),a=String(e.sub).split("-"),o=a[3===a.length?2:1],[n,i]=(0,g.useState)("cancelamento"===e.motivo),{setShowLoading:r}=(0,x.OI)(),{order:l,reasons:d,childOrderId:c}=useCallcenter(),[m,u]=(0,g.useState)(null),[p,f]=(0,g.useState)([]),[b,j]=(0,g.useState)(null),[y,S]=(0,g.useState)(null),[v,C]=(0,g.useState)(null),[$,Z]=(0,g.useState)(o?"chat":"form"),w=[11,22].includes(y);(0,g.useEffect)(()=>
1{if(d.length>0){if(d.some(e=>[11,22].includes(e.id))&&n)j(d.find(e=>[11,22].includes(e.id)).tema),u("reason");else{let e=d.map(e=>e.tema);f([...new Set(e)].filter(e=>e)),u("theme")}}else u(null)},[d,n]);let fetchScripts=async()=>{let fetchReasonParams=async()=>{let e=await getClientReasonsOrder({id:l.id_pedped,central_atendimento:1,reason:y}),{scripts:t,subreasons:a}=e.data;a=Array.isArray(a)&&a.length>0?a.filter(e=>e.customer_view):[],C({items:[],scripts:t=Array.isArray(t.not_multiple)&&t.not_multiple.length>0?t.not_multiple.map(e=>({...e,suggestion_id:e.suggestion_id.replace("#","")})):[],subreasons:a}),u("session"),r(null)};if(w)t((0,et.Av)(l.id_pedped_pai,l.id_pedped,eH));else{r("Aguarde, buscando detalhes do atendimento...");let e=Object.keys(l.items),a=l.items[e[0]];if(a.mm_envios){let e=await getClientVerifyMadeiraEnvios(l.id_pedped,y);e.is_mmenvios?(r(null),t((0,et.Av)(l.id_pedped_pai,l.id_pedped,eQ))):await fetchReasonParams()}else await fetchReasonParams()}};return(0,s.jsxs)(ei,{isQueryCancellation:n,messagingContent:$,setMessagingContent:Z,setStep:u,orderId:c,sessionId:o,setIsQueryCancellation:i,setThemeSelected:j,themeSelected:b,children:["form"===$&&(0,s.jsxs)(s.Fragment,{children:["theme"===m&&(0,s.jsx)(SelectTheme,{themes:p,themeSelected:b,setThemeSelected:j,setStep:u}),"reason"===m&&(0,s.jsx)(SelectReason,{title:b,reasons:d.filter(e=>e.tema===b),reasonSelected:y,setReasonSelected:S,fetchScripts:fetchScripts,setStep:u}),"session"===m&&(0,s.jsx)(SessionForm,{setStep:u,reasonSelected:y,reasonScripts:v})]}),"chat"===$&&(0,s.jsx)(MessagingSection,{}),"report"===$&&(0,s.jsx)(ReportProblemSection,{}),"mediation"===$&&(0,s.jsx)(MediatedSection,{})]})}var eK=a(59394);function CallCenterContent(){let{step:e,setStep:t,order:a,childOrderId:o,queryStringattendance:n,returnToStep:r,setReturnToStep:c}=useCallcenter(),{data:m}=(0,eh.useSession)(),u=(0,h.useRouter)();sessionStorage.getItem("testAB")||sessionStorage.setItem("testAB","1");let x=sessionStorage.getItem("testAB"),p={order:`Z${o}`,user:m.customer_id,reason:null,items:[],scripts:{ressalva:"0",data_contato:(0,em.WU)(new Date,"dd/MM/yyyy")},refund:!1,isPartialPercentage:!1},{register:f,watch:b,setValue:j,...S}=(0,y.cI)({defaultValues:p});return((0,g.useEffect)(()=>{f("order",{required:!0}),f("user",{required:!0}),f("reason",{required:!0}),f("items",{required:!0}),f("scripts",{required:!0}),f("origin"),f("refund"),f("isPartialPercentage"),f("description")},[]),(0,g.useEffect)(()=>{(0,eK.Z)(window)},[e]),a)?(0,s.jsx)(s.Fragment,{children:["","0"].includes(a.id_seller)?(0,s.jsxs)(y.RV,{...S,register:f,watch:b,setValue:j,children:[[2,3,4].includes(e)&&(0,s.jsx)(GoBack,{label:"Voltar",onClick:()=>{r?(t(r),c(null)):t(e-1),j("items",[])}}),1===e?(0,s.jsx)(SectionReasons,{}):(0,s.jsxs)(s.Fragment,{children:[5===e&&(0,s.jsx)(d.Z,{as:"a",href:`/minha-conta/pedidos/central-de-atendimento?${n}`,css:{textDecoration:"none"},children:(0,s.jsx)(GoBack,{label:"Solicitar atendimento"})}),(0,s.jsx)("form",{children:(()=>{let e={textFinalization:Y[b("reason")]["1"===x?"test":"default"],enableTesting:"1"===x};switch(b("reason")){case 2:return(0,s.jsx)(ContentBrokenProduct,{...e});case 15:return(0,s.jsx)(ContentChangeProduct,{...e});case 31:return(0,s.jsx)(ContentChangeProductDelivered,{...e});case 9:return(0,s.jsx)(ContentDeliveredWrongAddress,{...e});case 39:return(0,s.jsx)(ContentDifferentProduct,{...e});case 49:return(0,s.jsx)(ContentIncompleteProduct,{...e});case 114:return(0,s.jsx)(ContentLateDelivery,{...e});case 54:case 121:case 141:return(0,s.jsx)(ContentNotRecieveProduct,{...e});case 19:return(0,s.jsx)(ContentRefusedDelivery,{...e});case 20:return(0,s.jsx)(ContentIncorrectCustomerName,{...e});case 11:case 22:return(0,s.jsx)(ContentCancellation,{...e});case 25:return(0,s.jsx)(ContentProductFailedAfterUse,{...e});case 130:return(0,s.jsx)(ContentCancelExtendedWarranty,{...e});default:return null}})()}),5===e&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(eX.Z,{origin:ey.AY.CENTRAL_DE_ATENDIMENTO,reference:"",css:{mt:"$medium3"},order:Number(a.id_pedped_pai),items:b("items").map(e=>e.sku),reason:(0,N.E)(b("reason"))}),(0,s.jsx)(l.X2,{css:{px:"$medium1",mt:"$large1"},children:(0,s.jsx)(l.JX,{sm:12,children:(0,s.jsx)(i.Z,{type:"button",label:"Voltar para meu pedido",css:{mx:"auto",width:"100%","@md":{width:"auto"}},onClick:()=>u.push("/minha-conta/pedidos")})})})]})]})]}):(0,s.jsx)(SellerChatv2,{})}):(0,s.jsx)(s.Fragment,{})}var eY=!0;function CallCenter(){return(0,s.jsx)(b,{children:(0,s.jsx)(CallCenterContent,{})})}CallCenter.Layout=o.Z,CallCenter.auth=!0,CallCenter.displayName="Minha Conta | Central de Atendimento"},55388:function(e,t,a){"use strict";var s,o;a.d(t,{AY:function(){return s},lZ:function(){return postClientCSAT}}),(o=s||(s={}))[o.CENTRAL_DE_ATENDIMENTO=1]="CENTRAL_DE_ATENDIMENTO",o[o.ACOMPANHAMENTO_DE_PROTOCOLOS=2]="ACOMPANHAMENTO_DE_PROTOCOLOS",o[o.CHAT=3]="CHAT",o[o.RASTREIO_1P=4]="RASTREIO_1P",o[o.MENSAGERIA_SELLER=6]="MENSAGERIA_SELLER",o[o.NOVA_MENSAGERIA_SELLER=8]="NOVA_MENSAGERIA_SELLER",o[o.MENSAGERIA_WEB_ABERTURA=10]="MENSAGERIA_WEB_ABERTURA",o[o.MENSAGERIA_WEB_ENCERRAMENTO=11]="MENSAGERIA_WEB_ENCERRAMENTO";let postClientCSAT=async(e,t)=>{let a=await fetch("/api/myaccount/csat",{method:"POST",body:JSON.stringify({captchaToken:e,csat:t}),headers:{"Content-Type":"application/json"}}),{status:s,statusText:o}=a;
1if(200!==s)return Promise.reject(Error(JSON.stringify({status:s,statusText:o})));let n=await a.json();return{status:s,statusText:o,data:n}}},56821:function(e,t,a){"use strict";a.d(t,{Q:function(){return fetchGetShortenUploadUrlServerless}});let fetchGetShortenUploadUrlServerless=async e=>{let t=await fetch("/api/customer-area/seller-messaging/images/shorten-url",{method:"POST",body:JSON.stringify({encodedUrl:e}),headers:{"Content-Type":"application/json"}});return t.json()}},71980:function(e,t,a){"use strict";a.d(t,{K:function(){return fetchPostGenerateUploadUrlServerless}});let fetchPostGenerateUploadUrlServerless=async e=>{let t=await fetch("/api/customer-area/seller-messaging/images/generate-url",{method:"POST",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}});return t.json()}},32537:function(e,t,a){"use strict";a.d(t,{Y:function(){return getClientMessagingSessions}});var s=a(5493);let getClientMessagingSessions=async e=>{let t=s.Z.stringify({orderIds:e},{arrayFormat:"comma"}),a=await fetch(`/api/myaccount/callcenter/seller-message/v2/messages?${t}`,{method:"GET",headers:{"Content-Type":"application/json"}}),{ok:o,status:n,statusText:i}=a;return o?a.json():Promise.reject(Error(JSON.stringify({status:n,statusText:i})))}},30313:function(e,t,a){"use strict";a.d(t,{c:function(){return patchClientCloseSessionCSAT}});let patchClientCloseSessionCSAT=async e=>{let t=await fetch("/api/myaccount/callcenter/seller-message/v2/csat-answered",{method:"PATCH",body:JSON.stringify(e),headers:{"Content-Type":"application/json"}}),{ok:a,status:s,statusText:o}=t;return a?{ok:a,status:s,statusText:o}:Promise.reject(Error(JSON.stringify({status:s,statusText:o})))}},43023:function(e,t,a){"use strict";var s,o;a.d(t,{Q:function(){return s}}),(o=s||(s={})).EventOrderInteraction="OrderInteraction",o.EventOrderAttendanceStep="OrderAttendanceStep"},81259:function(e,t,a){"use strict";function translateReason(e){switch(e){case 2:return"Produto chegou quebrado ou com defeito";case 15:return"Quero trocar meu produto";case 31:return"Trocar produto recebido";case 9:return"Foi entregue em outro endere\xe7o";case 39:return"Produto veio diferente do que comprei";case 49:return"Produto chegou incompleto ou com pe\xe7as faltando";case 114:return"Minha entrega est\xe1 atrasada";case 54:case 121:case 141:return"N\xe3o recebi meu produto";case 19:return"Recusei a entrega do produto";case 20:return"Chegou com o nome de outra pessoa";case 11:return"Cancelar produtos entregues";case 22:return"Cancelar produtos que n\xe3o foram entregues";case 25:return"Produto apresentou defeito ap\xf3s o uso";case 130:return"Cancelamento da garantia estendida";default:return e}}function translateSatisfaction(e){switch(e){case 5:return"Muito satisfeito";case 4:return"Satisfeito";case 3:return"Neutro";case 2:return"Insatisfeito";case 1:return"Muito insatisfeito";default:return null}}a.d(t,{E:function(){return translateReason},t:function(){return translateSatisfaction}})},13996:function(e,t,a){"use strict";a.d(t,{Av:function(){return handleHelpCenterUrl},ou:function(){return handleCallCenterUrl},rO:function(){return handleMensageriaUrl}});let handleCallCenterUrl=(e,t)=>`/minha-conta/pedidos/central-de-atendimento?sub=${e}${t||""}`,handleHelpCenterUrl=(e,t,a)=>{let s=`/minha-conta/solicitar-atendimento/${e}/${t}`;return a?`${s}?formId=${a}`:s},handleMensageriaUrl=(e,t)=>`/minha-conta/pedidos/central-de-atendimento?sub=${e}-${t}`}},function(e){e.O(0,[3512,4904,431,1038,1852,5254,2003,7154,193,5077,7353,4874,7536,1664,2334,5518,9261,3670,7311,4031,4864,7658,2007,8263,2451,9774,2888,179],function(){return e(e.s=41233)}),_N_E=e.O()}]);
2//# sourceMappingURL=callcenter-cf900937f84bd331.js.map

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.