1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[99759,26131],{74253:function(e,t,n){"use strict";var l=n(64836).default,r=n(75263).default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=r(n(67294)),s=l(n(94184));n(13594);var o=n(31929),d=l(n(56120)),__rest=function(e,t){var n={};for(var l in e)Object.prototype.hasOwnProperty.call(e,l)&&0>t.indexOf(l)&&(n[l]=e[l]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var r=0,l=Object.getOwnPropertySymbols(e);r<l.length;r++)0>t.indexOf(l[r])&&Object.prototype.propertyIsEnumerable.call(e,l[r])&&(n[l[r]]=e[l[r]]);return n};t.default=e=>{let{getPrefixCls:t,direction:n,divider:l}=i.useContext(o.ConfigContext),{prefixCls:r,type:c="horizontal",orientation:u="center",orientationMargin:x,className:p,rootClassName:m,children:f,dashed:h,plain:g,style:y}=e,j=__rest(e,["prefixCls","type","orientation","orientationMargin","className","rootClassName","children","dashed","plain","style"]),v=t("divider",r),[b,S]=(0,d.default)(v),w=u.length>0?`-${u}`:u,C=!!f,_="left"===u&&null!=x,k="right"===u&&null!=x,I=(0,s.default)(v,null==l?void 0:l.className,S,`${v}-${c}`,{[`${v}-with-text`]:C,[`${v}-with-text${w}`]:C,[`${v}-dashed`]:!!h,[`${v}-plain`]:!!g,[`${v}-rtl`]:"rtl"===n,[`${v}-no-default-orientation-margin-left`]:_,[`${v}-no-default-orientation-margin-right`]:k},p,m),E=i.useMemo(()=>"number"==typeof x?x:/^\d+$/.test(x)?Number(x):x,[x]),z=Object.assign(Object.assign({},_&&{marginLeft:E}),k&&{marginRight:E});return b(i.createElement("div",Object.assign({className:I,style:Object.assign(Object.assign({},null==l?void 0:l.style),y)},j,{role:"separator"}),f&&"vertical"!==c&&i.createElement("span",{className:`${v}-inner-text`,style:z},f)))}},56120:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var l=n(98078),r=n(3184);let genSharedDividerStyle=e=>{let{componentCls:t,sizePaddingEdgeHorizontal:n,colorSplit:r,lineWidth:i,textPaddingInline:s,orientationMargin:o,verticalMarginInline:d}=e;return{[t]:Object.assign(Object.assign({},(0,l.resetComponent)(e)),{borderBlockStart:`${i}px solid ${r}`,"&-vertical":{position:"relative",top:"-0.06em",display:"inline-block",height:"0.9em",marginInline:d,marginBlock:0,verticalAlign:"middle",borderTop:0,borderInlineStart:`${i}px solid ${r}`},"&-horizontal":{display:"flex",clear:"both",width:"100%",minWidth:"100%",margin:`${e.dividerHorizontalGutterMargin}px 0`},[`&-horizontal${t}-with-text`]:{display:"flex",alignItems:"center",margin:`${e.dividerHorizontalWithTextGutterMargin}px 0`,color:e.colorTextHeading,fontWeight:500,fontSize:e.fontSizeLG,whiteSpace:"nowrap",textAlign:"center",borderBlockStart:`0 ${r}`,"&::before, &::after":{position:"relative",width:"50%",borderBlockStart:`${i}px solid transparent`,borderBlockStartColor:"inherit",borderBlockEnd:0,transform:"translateY(50%)",content:"''"}},[`&-horizontal${t}-with-text-left`]:{"&::before":{width:`${100*o}%`},"&::after":{width:`${100-100*o}%`}},[`&-horizontal${t}-with-text-right`]:{"&::before":{width:`${100-100*o}%`},"&::after":{width:`${100*o}%`}},[`${t}-inner-text`]:{display:"inline-block",paddingBlock:0,paddingInline:s},"&-dashed":{background:"none",borderColor:r,borderStyle:"dashed",borderWidth:`${i}px 0 0`},[`&-horizontal${t}-with-text${t}-dashed`]:{"&::before, &::after":{borderStyle:"dashed none none"}},[`&-vertical${t}-dashed`]:{borderInlineStartWidth:i,borderInlineEnd:0,borderBlockStart:0,borderBlockEnd:0},[`&-plain${t}-with-text`]:{color:e.colorText,fontWeight:"normal",fontSize:e.fontSize},[`&-horizontal${t}-with-text-left${t}-no-default-orientation-margin-left`]:{"&::before":{width:0},"&::after":{width:"100%"},[`${t}-inner-text`]:{paddingInlineStart:n}},[`&-horizontal${t}-with-text-right${t}-no-default-orientation-margin-right`]:{"&::before":{width:"100%"},"&::after":{width:0},[`${t}-inner-text`]:{paddingInlineEnd:n}}})}};t.default=(0,r.genComponentStyleHook)("Divider",e=>{let t=(0,r.mergeToken)(e,{dividerHorizontalWithTextGutterMargin:e.margin,dividerHorizontalGutterMargin:e.marginLG,sizePaddingEdgeHorizontal:0});return[genSharedDividerStyle(t)]},e=>({textPaddingInline:"1em",orientationMargin:.05,verticalMarginInline:e.marginXS}))},62705:function(e,t,n){var l=n(55639).Symbol;e.exports=l},44239:function(e,t,n){var l=n(62705),r=n(89607),i=n(2333),s=l?l.toStringTag:void 0;
1e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":s&&s in Object(e)?r(e):i(e)}},31957:function(e,t,n){var l="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;e.exports=l},89607:function(e,t,n){var l=n(62705),r=Object.prototype,i=r.hasOwnProperty,s=r.toString,o=l?l.toStringTag:void 0;e.exports=function(e){var t=i.call(e,o),n=e[o];try{e[o]=void 0;var l=!0}catch(e){}var r=s.call(e);return l&&(t?e[o]=n:delete e[o]),r}},2333:function(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},55639:function(e,t,n){var l=n(31957),r="object"==typeof self&&self&&self.Object===Object&&self,i=l||r||Function("return this")();e.exports=i},13218:function(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},37005:function(e){e.exports=function(e){return null!=e&&"object"==typeof e}},27749:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/correspondencia/pre-cadastro",function(){return n(7954)}])},29793:function(e,t,n){"use strict";var l=n(85893),r=n(67294),i=n(56590),s=n(55673),o=n(5789),d=n(53740),c=n(59361);n(5904);var u=n(67814);let{Title:x,Text:p}=d.default;t.Z=(0,r.memo)(e=>{let{company:t,keys:n=[],icon:r=null,size:d="small",title:m=""}=e;if(!t)return!1;let f=[],h=m,TagsRoles=e=>{let t=[...new Set(e)];return t.map(e=>(0,l.jsx)(c.default,{color:"blue",children:e},"tag_".concat(e)))};return Object.keys(t).filter(e=>n.indexOf(e)>-1&&("object"!=typeof t[e]||Array.isArray(t[e]))&&""!==t[e]).map(e=>{var l;let r=Array.isArray(t[e])?TagsRoles(t[e]):"function"==typeof t[e]?t[e]:null===(l=t[e])||void 0===l?void 0:l.toString();return f.splice(n.indexOf(e),0,{key:e,value:r}),f}),h&&(h=(0,l.jsxs)(x,{level:5,children:[r&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(u.FontAwesomeIcon,{icon:r}),"\xa0\xa0"]}),m]})),(0,l.jsx)(i.default,{header:h||!1,itemLayout:"horizontal",style:{marginBottom:"10%",fontSize:"small"===d?"14px":"16px"},dataSource:f,renderItem:e=>(0,l.jsx)(i.default.Item,{children:(0,l.jsxs)(s.default,{type:"flex",justify:"space-between",style:{width:"100%"},children:[(0,l.jsx)(o.default,{span:11,children:(0,l.jsx)(p,{style:{whiteSpace:"normal"},children:(0,l.jsx)("strong",{children:e.key.replace(/_/," ")})})}),(0,l.jsx)(o.default,{span:13,children:(0,l.jsx)(p,{style:{whiteSpace:"normal"},children:"function"==typeof e.value?e.value():e.value})})]})})})})},41927:function(e,t,n){"use strict";var l=n(85893),r=n(67294),i=n(56590),s=n(55673),o=n(5789),d=n(59361),c=n(53740),u=n(7136),x=n(85518),p=n(27484),m=n.n(p);let{Text:f}=c.default;t.Z=(0,r.memo)(e=>{if(!e.company)return!1;let{company:t}=e,{credits_and_points:{credits:n,points:r}}=t,c={green:"#87d068",gray:"#bcbcbc",yellow:"#faad14",red:"#ef233c"},p=1===t.authorize_scanning?"Aceito":0===t.authorize_scanning?"Rejeitado":"Sem resposta",h=[{title:"Situa\xe7\xe3o Financeira",value:(0,l.jsx)(d.default,{color:"ativo"===t.financial_situation?c.green:"inadimplente"===t.financial_situation?c.yellow:"cancelado"===t.financial_situation?c.red:c.gray,className:"big capitalize",children:t.financial_situation}),description:(0,l.jsxs)(f,{type:"secondary",children:["Atualiza\xe7\xe3o:"," ",m()(t.financial_situation_last_update).locale("pt-br").format("MMMM D, YYYY")]})},{title:"Escaneamento",value:(0,l.jsx)(d.default,{color:"Aceito"===p?c.green:"Rejeitado"===p?c.red:c.gray,className:"big capitalize",children:p}),description:(0,l.jsxs)(f,{type:"secondary",children:["Atualiza\xe7\xe3o:"," ",m()(t.updated_at).locale("pt-br").format("MMMM D, YYYY")]})},{title:"Horas usadas",value:(0,l.jsx)(d.default,{color:n.credits_left>0?c.green:n.credits_total>0?c.red:c.gray,className:"big",children:"".concat(n.credits_used_current_month,"/").concat(n.credist_total)})},{title:"Pontos usados",value:(0,l.jsx)(d.default,{color:r.points_contracted>0?c.green:r.credits_total>0?c.red:c.gray,className:"big",children:"".concat(r.points_left,"/").concat(r.points_contracted)})}];return(0,l.jsx)(i.default,{grid:{gutter:[30,20],column:x.tq?1:2},dataSource:h,renderItem:e=>(0,l.jsxs)(i.default.Item,{children:[(0,l.jsx)(u.Card,{className:"smallPadding",children:(0,l.jsxs)(s.default,{type:"flex",justify:"space-between",style:{width:"100%"},children:[(0,l.jsx)(o.default,{span:14,children:(0,l.jsx)("b",{children:e.title})}),(0,l.jsx)(o.default,{span:10,style:{textAlign:"right"},children:e.value})]})}),e.description&&(0,l.jsx)("div",{className:"textCenter",children:(0,l.jsx)(f,{className:"p5",style:{marginTop:"10px"},children:e.description})})]})})})},36056:function(e,t,n){"use strict";var l=n(85893),r=n(28465);n(5904);var i=n(67814),s=n(94761),o=n.n(s);let{Dragger:d}=r.default;t.Z=e=>{let{accept:t,icon:n,infoText:r}=e;return(0,l.jsx)("div",{className:o().uploadStyle,children:(0,l.jsxs)(d,{name:"file",...e,showUploadList:!1,children:[(0,l.jsx)("p",{className:"ant-upload-drag-icon",children:n||(0,l.jsx)(i.FontAwesomeIcon,{icon:"file-invoice",size:"2x",style:{opacity:.5}})}),r||(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("p",{className:"ant-upload-text",children:"Clique ou arraste os arquivos para serem adicionados"}),(0,l.jsx)("p",{className:"ant-upload-hint",children:"Suporte para um ou mais arquivos"}),(0,l.jsx)("br",{})]}),t&&(0,l.jsxs)("p",{className:"ant-upload-hint",style:{fontSize:11},children:["Formatos de arquivos aceitos:"," ",(0,l.jsx)("span",{style:{fontWeight:600},children:t})]})]})})}},26131:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return Custom404}});var l=n(85893),r=n(73818),i=n(7136),s=n(18945),o=n(25675),d=n.n(o);function Custom404(e){let{message:t}=e;return(0,l.jsx)(r.default,{icon:(0,l.jsx)(d(),{src:"/404.svg",alt:"Error",title:"Error",width:300,height:300}),title:"Error 404!",subTitle:t||"N\xe3o conseguimos encontrar esta p\xe1gina",extra:(0,l.jsx)(s.default,{href:"/",children:(0,l.jsx)(i.zx,{type:"primary",children:"Voltar na home"})})})}},7954:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return ei}});var l=n(85893),r=n(67294),i=n(11163),s=n(4670),o=n(7136);let d=(0,r.createContext)({});function CreateMailingContextProvider(e){let{children:t}=e,[n,i]=(0,r.useState)(null),[s,o]=(0,r.useState)(null),[c,u]=(0,r.useState)(null),[x,p]=(0,r.useState)(null),[m,f]=(0,r.useState)(null),[h,g]=(0,r.useState)(null),[y,j]=(0,r.useState)(null),[v,b]=(0,r.useState)([]),[S,w]=(0,r.useState)(null);function toggleUnityAndDate(e,t){o(t),i(e)}function toggleCompany(e){u(e)}function togglePreMailing(e,t,n,l,r){p(e),f(t),g(n),j(l),b(r)}let C=(0,r.useMemo)(()=>
1({unity:n,date:s,company:c,mailingType:x,principalImage:m,volumeNumber:h,judice:y,scans:v,toggleUnityAndDate,toggleCompany,togglePreMailing,setUnityName:w,unityName:S}),[n,s,c]);return(0,l.jsx)(d.Provider,{value:C,children:t})}let useCreateMailingContext=()=>(0,r.useContext)(d);var c=n(97538),u=n(64749),x=n(14321),p=n(11187),m=n(90008);let{Option:f}=u.default;var unityChoice=()=>{let{toggleUnityAndDate:e,setUnityName:t}=useCreateMailingContext(),[n,i]=(0,r.useState)(null),[s,d]=(0,r.useState)(null),[h,g]=(0,r.useState)([{}]);(0,r.useEffect)(()=>{m.ApiPrivate.getPrivateEv().then(e=>{g(e.data.items)}).catch(e=>{g([{error:"Houve um erro em nosso servidor"}])})},[]);let handleSelectEv=e=>{i(e)},handleSelectDate=e=>{d(e)};return(0,l.jsxs)(c.default,{layout:"vertical",children:[(0,l.jsx)(c.default.Item,{label:"Selecione a unidade",required:!0,children:(0,l.jsx)(u.default,{showSearch:!0,placeholder:"Selecione a unidade",optionFilterProp:"children",onChange:e=>{handleSelectEv(e)},children:h.map(e=>(0,l.jsx)(f,{value:e.id,children:e.smart_name},e.id))})}),(0,l.jsx)(c.default.Item,{label:"Selecione a data",required:!0,children:(0,l.jsx)(x.default,{placeholder:"Selecione a data",onChange:(e,t)=>
1{handleSelectDate(t)}},"date")}),(0,l.jsx)(o.zx,{type:"primary",onClick:function(){(null==n||null==s)&&(null==n&&p.default.error("Voc\xea deve selecionar uma unidade"),null==s&&p.default.error("Voc\xea deve selecionar uma data")),e(n,s),h.map(e=>{if(e.id==n)return t(e.smart_name)})},children:"Escanear correspond\xeancias"})]})},h=n(55673),g=n(5789),y=n(17669),j=n(51024),v=n(2307),b=n(23279),S=n.n(b),w=n(85518);let columns=(e,t)=>[{title:"Nome",dataIndex:"title",key:"title",width:w.tq?"":"13%",render:(e,t)=>(0,l.jsx)("span",{children:e})},{title:"Raz\xe3o Social",dataIndex:"social_reason",key:"social_reason",width:w.tq?"":"18%",render:(e,t)=>(0,l.jsx)("span",{children:e})},{title:"N\xfamero de membros",dataIndex:"icon_text",key:"icon_text",width:w.tq?"":"6%",render:(e,t)=>(0,l.jsx)("span",{children:e})},{title:"Ver informa\xe7\xf5es",dataIndex:"url",key:"url",width:w.tq?"":"6%",render:(e,n)=>(0,l.jsx)(o.zx,{onClick:()=>t(n.id),children:"Selecionar"})}];var C=n(10149),_=n(53740),k=n(20838),I=n(74253),E=n(56590),z=n(31132),O=n(12274),F=n(18945),N=n(29793);n(5904);var M=n(67814);let{Title:P,Text:A}=_.default,$=(0,r.memo)(e=>{if(!e.members)return!1;let t=e.members,n=e.icon||!1,r=e.title||!1,i=[{title:"Nome",dataIndex:"name",key:"name",render:e=>(0,l.jsx)(A,{children:(0,l.jsx)("b",{children:e})})},{title:"Email",dataIndex:"email",key:"email",render:e=>(0,l.jsx)(A,{children:e})}],s=t.map(e=>({key:e.id,name:e.member_name,email:e.member_email}));return r&&(r=(0,l.jsxs)(P,{level:3,children:[n&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(M.FontAwesomeIcon,{icon:n}),"\xa0\xa0"]}),e.title]})),(0,l.jsxs)(l.Fragment,{children:[r,(0,l.jsx)(v.default,{columns:i,dataSource:s,pagination:!1})]})});var T=n(41927),D=n(96023);let{Title:q}=_.default;async function getForm(){let e=await m.eZ.getForm("formulario-de-cadastro");return{fields:e.data.fields,id:e.data.id}}async function getAnswers(e,t){let n=await (0,D.Z)(e,t);return n}let B=(0,r.memo)(e=>{let[t,n]=(0,r.useState)(!1),[i,s]=(0,r.useState)(!1),[o,d]=(0,r.useState)(!1),[c,u]=(0,r.useState)([]),[x,p]=(0,r.useState)([]),[m,f]=(0,r.useState)(!0),[y,j]=(0,r.useState)([]);(0,r.useEffect)(()=>{getForm().then(t=>{n(t.fields),s(t.id),getAnswers(e.companyId,t.id).then(e=>{d(e)})})},[]),(0,r.useEffect)(()=>{e.updateForm&&(f(!0),setTimeout(()=>{getAnswers(e.companyId,i).then(t=>{d(t),e.setUpdateForm(!1)})},1e3))},[e.updateForm]),(0,r.useEffect)(()=>{if(t&&o){let e=[],n=[],r=[];t.map(t=>{if(!t.hasOwnProperty("value")||!t.value.hasOwnProperty("key")&&"FieldsGroup"!=t.type)return!1;if("FieldsGroup"==t.type){let e=[];return e.title=t.value.title,e.value=[],t.value.group.map(t=>{if(o[t.key])return e.value.push({key:t.title,value:o[t.key]}),delete o[t.key],!0}),r.push(e),!1}o[t.value.key]&&(e.push({key:t.value.title,value:o[t.value.key].toString()}),delete o[t.value.key])}),Object.keys(o).map(e=>{""!=o[e]&&n.push({key:e.replace(/_/g," "),value:o[e]})}),u(e),p(n);let i=r.map(e=>{if(e.value.length>0){let t="";e.title.toLowerCase().includes("contato")&&(t=(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(M.FontAwesomeIcon,{icon:"user-tie"}),"\xa0\xa0"]}));let n=(0,l.jsxs)(q,{level:3,children:[t,e.title]});return(0,l.jsx)(E.default,{header:n,itemLayout:"horizontal",style:v,dataSource:e.value,renderItem:e=>itemList(e.key,e.value)},e.title)}});j(i),f(!1)}},[t,o]);let itemList=(e,t)=>(0,l.jsx)(E.default.Item,{children:(0,l.jsxs)(h.default,{type:"flex",justify:"space-between",style:{width:"100%"},gutter:[30,10],children:[(0,l.jsx)(g.default,{span:12,children:(0,l.jsx)("strong",{children:e})}),(0,l.jsx)(g.default,{span:12,children:t})]})}),v={marginBottom:"10%",fontSize:"16px"};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(E.default,{header:(0,l.jsxs)(q,{level:3,children:[(0,l.jsx)(M.FontAwesomeIcon,{icon:"clipboard-list"}),"\xa0\xa0Formulario de cad\xe1stro"]}),itemLayout:"horizontal",style:v,dataSource:c,renderItem:e=>itemList(e.key,e.value),loading:m}),y,(0,l.jsx)(E.default,{header:(0,l.jsx)(q,{level:3,children:"Outras Informa\xe7\xf5es:"}),itemLayout:"horizontal",style:v,dataSource:x,renderItem:e=>itemList(e.key,e.value),loading:m})]})});var L=n(56697),R=n(76272);let Z=(0,r.memo)(e=>
1{let t={object_type:"Company",object_id:e.companyId},[n,i]=(0,r.useState)(!0),[s,d]=(0,r.useState)(t),[c,u]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{i(!0),m.eZ.getForm("formulario-de-cadastro").then(n=>{let l=n.data;return u(l),(0,D.Z)(e.companyId,l.id).then(e=>{d({...t,...e}),i(!1)}),n})},[]),(0,l.jsx)(o.Card,{children:(0,l.jsx)(C.default,{active:!0,loading:n,paragraph:{rows:10},children:!n&&c&&(0,l.jsx)(R.default,{formFields:c,formParams:s,hideSuccess:!0,GTMEventName:"FormCadastroSent"})})})});var V=(0,r.memo)(e=>{let{companyId:t}=e,[n,i]=(0,r.useState)(!1);return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{style:{textAlign:"right"},children:(0,l.jsxs)(o.zx,{type:"link",onClick:()=>i(!0),children:[(0,l.jsx)(M.FontAwesomeIcon,{icon:"edit"})," \xa0\xa0Editar formul\xe1rio de cadastro"]})}),(0,l.jsx)(L.default,{title:"Formul\xe1rio",open:n,style:{top:40},onCancel:()=>i(!1),destroyOnClose:!1,width:"50%",footer:null,children:(0,l.jsx)(Z,{companyId:t})})]})}),W=n(26131);let{Title:H,Text:G}=_.default;var Y=(0,r.memo)(e=>{let{slug:t}=e,[n,i]=(0,r.useState)(null),[s,d]=(0,r.useState)(null),[c,u]=(0,r.useState)(0),[x,p]=(0,r.useState)(!0),[f,y]=(0,r.useState)(!1),[j,v]=(0,r.useState)({}),[b,S]=(0,r.useState)([]),[_,P]=(0,r.useState)(null);async function getCredits(e){m.ApiPrivate.getCompanyCredits(e).then(e=>{let t=e.data;return d(t),i({...n,...t}),e})}(0,r.useEffect)(()=>{d(!1),m.ApiPrivate.getCompany(t).then(e=>{let{data:t}=e,n=t.receitaws_fields.map(e=>"receitaws_date_last_sync"===e.key?{...e,value:(0,O.Z)(new Date(e.value))?(0,z.Z)(new Date(e.value),"dd/MM/yyyy - HH:mm:ss"):e.value}:e),l={},r={};return n&&(null==n?void 0:n.length)!==0&&(n.forEach(e=>{if("receitaws_associates"===e.key){r=e;return}Object.assign(l,{[e.label]:e.value})}),v(l),P(r)),S(t.cnaes),i(t),u(t.members.length),p(!1),e}).catch(()=>{y(!0)})},[t]),(0,r.useEffect)(()=>{n&&!s&&getCredits(null==n?void 0:n.id)},[n]);let A=(0,l.jsxs)(h.default,{type:"flex",justify:"space-between",align:"middle",children:[(0,l.jsx)(g.default,{span:16,children:(0,l.jsxs)(H,{level:4,style:{margin:"10px",whiteSpace:"normal"},children:[(0,l.jsx)(M.FontAwesomeIcon,{icon:"briefcase"}),"\xa0\xa0",null==n?void 0:n.title]})}),(0,l.jsx)(g.default,{span:7,style:{fontSize:"14px",textAlign:"right"},children:(0,l.jsx)(G,{children:(0,l.jsxs)(F.default,{href:"".concat("https://admin.companyhero.com/","/cms/company/company/edit/").concat(null==n?void 0:n.id,"/"),children:[(0,l.jsx)(M.FontAwesomeIcon,{icon:"edit"}),"\xa0Editar em wagtail"]})})})]});if(f)return(0,l.jsx)(W.default,{message:404});let D=(0,l.jsx)(o.Card,{type:"inner",className:"padding10",title:A,children:(0,l.jsxs)(C.default,{active:!0,loading:x,paragraph:{rows:10},children:[(0,l.jsx)(T.Z,{company:n}),(0,l.jsx)(I.default,{}),(0,l.jsx)(N.Z,{company:n,keys:["id","title","fantasy_name","slug","courtesy_customer","checkout","cpf_cnpj","pessoa","endereco_comercial"],title:"Dados b\xe1sicos"}),(0,l.jsx)(N.Z,{company:n,keys:["administrator","phone","email","social_reason"],title:"Dados de contato",icon:"phone"}),(0,l.jsx)(N.Z,{company:n,keys:["zip_code","street","number","complement","district","state","city"],title:"Endere\xe7o",icon:"map-marker-alt"}),(0,l.jsx)(N.Z,{company:j,keys:Object.keys(j),title:"Informa\xe7\xf5es da receita federal",icon:"university"}),_&&(0,l.jsxs)(E.default,{header:(0,l.jsx)(H,{level:4,children:_.label}),itemLayout:"horizontal",style:{fontSize:"14px",marginBottom:"5%",marginTop:"-5%"},children:[(0,l.jsx)(E.default.Item,{children:(0,l.jsxs)(h.default,{type:"flex",justify:"space-between",style:{width:"100%"},children:[(0,l.jsx)(g.default,{span:11,children:(0,l.jsx)(G,{style:{whiteSpace:"normal"},children:(0,l.jsx)("strong",{children:"Nome"})})}),(0,l.jsx)(g.default,{span:13,children:(0,l.jsx)(G,{style:{whiteSpace:"normal"},children:(0,l.jsx)("strong",{children:"Qualifica\xe7\xe3o"})})})]})}),_.value.map(e=>{var t,n;return(0,l.jsx)(E.default.Item,{children:(0,l.jsxs)(h.default,{type:"flex",justify:"space-between",style:{width:"100%"},children:[(0,l.jsx)(g.default,{span:11,children:(0,l.jsx)(G,{style:{whiteSpace:"normal"},children:null===(t=e[0])||void 0===t?void 0:t.value})}),(0,l.jsx)(g.default,{span:13,children:(0,l.jsx)(G,{style:{whiteSpace:"normal"},children:(null===(n=e[1])||void 0===n?void 0:n.value)||""})})]})},JSON.stringify(e))})]}),b.map(e=>(0,l.jsxs)(E.default,{header:(0,l.jsx)(H,{level:4,children:e.label}),itemLayout:"horizontal",style:{fontSize:"14px"},children:[(0,l.jsx)(E.default.Item,{children:(0,l.jsxs)(h.default,{type:"flex",justify:"space-between",style:{width:"100%"},children:[(0,l.jsx)(g.default,{span:11,children:(0,l.jsx)(G,{style:{whiteSpace:"normal"},children:(0,l.jsx)("strong",{children:"C\xf3digo"})})}),(0,l.jsx)(g.default,{span:13,children:(0,l.jsx)(G,{style:{whiteSpace:"normal"},children:(0,l.jsx)("strong",{children:"Descri\xe7\xe3o"})})})]})}),e.value.map((e,t)=>{var n,r;return(0,l.jsx)(E.default.Item,{children:(0,l.jsxs)(h.default,{type:"flex",justify:"space-between",style:{width:"100%"},children:[(0,l.jsx)(g.default,{span:11,children:(0,l.jsx)(G,{style:{whiteSpace:"normal"},children:(null===(n=e[1])||void 0===n?void 0:n.value)||""})}),(0,l.jsx)(g.default,{span:13,children:(0,l.jsx)(G,{style:{whiteSpace:"normal"},children:(null===(r=e[0])||void 0===r?void 0:r.value)||""})})]})},t)})]},e.key))]})}),q=(0,l.jsx)(o.Card,{bordered:!0,style:{maxWidth:"1000px"},className:"centerDiv padding10",title:A,type:"inner",children:(0,l.jsxs)(C.default,{active:!0,loading:x,paragraph:{rows:10},children:[(0,l.jsx)(V,{companyId:null==n?void 0:n.id}),(0,l.jsx)(B,{companyId:null==n?void 0:n.id})]})}),L=(0,l.jsx)(o.Card,{bordered:!0,style:{maxWidth:"1000px"},className:"centerDiv padding10",title:A,type:"inner",children:(0,l.jsx)(C.default,{active:!0,loading:x,paragraph:{rows:10},children:(0,l.jsx)($,{members:null==n?void 0:n.members,title:"Membros (".concat(c,")"),icon:"address-card"})})});return(0,l.jsx)(k.default,{tabPosition:w.tq?"top":"left",style:{paddingTop:"20px"},items:[{label:"Informa\xe7\xf5es basicas",key:"informacoes_basicas",children:D},{label:"Formul\xe1rio de cad\xe1stro",key:"form_cadastro",children:q},{label:"Membros (".concat(c,")"),key:"membros",children:L}]})}),U=n(28465),X=n(73818),J=n(39691),Q=n(36056),K=n(63362);let{Option:ee}=u.default,{Title:et}=_.default,ea=(0,r.memo)(e=>{let{unity:t,date:n,company:s,toggleVisible:d,setMailId:x}=e,p=(0,i.useRouter)(),{user:f}=(0,r.useContext)(J.S),[y,v]=(0,r.useState)(),[b,S]=(0,r.useState)(!0),[w,_]=(0,r.useState)(!1),[k,E]=(0,r.useState)(!1),[z,O]=(0,r.useState)(!1),[F,N]=(0,r.useState)([]),[M,P]=(0,r.useState)("letter"),[A,$]=(0,r.useState)(),[T,D]=(0,r.useState)(),[q,B]=(0,r.useState)(),[R,Z]=(0,r.useState)("to_notify"),[V,W]=(0,r.useState)("general"),[H,G]=(0,r.useState)(),[Y,ea]=(0,r.useState)(),[en,el]=(0,r.useState)();(0,r.useEffect)(()=>{m.ApiPrivate.getPrivateMailingSenders().then(e=>{e.data&&el(e.data.senders)}).catch(e=>{el(null)}).finally(()=>{S(!1)})},[]);let setMultipleErrors=e=>{N([...F,{error:e}])},goToNotify=()=>{x(y),d(!1)};return b?(0,l.jsx)(l.Fragment,{children:(0,l.jsxs)(h.default,{type:"flex",justify:"space-between",children:[(0,l.jsx)(g.default,{xs:24,sm:24,md:24,className:"first _white",style:{padding:"5%"},children:(0,l.jsx)(C.default,{loading:b,active:!0,paragraph:{rows:8,width:[450]},avatar:{shape:"square",size:450},title:!1,className:"avatar-top"})}),(0,l.jsx)(g.default,{xs:24,sm:24,md:24,className:"last _gray _round_bottom",style:{padding:"5%"},children:(0,l.jsx)(C.default,{loading:b,active:!0})})]})}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(c.default,{labelCol:{span:6},wrapperCol:{span:14},layout:"horizontal",children:(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(c.default.Item,{label:"Tipo de correspond\xeancia",required:!0,children:(0,l.jsx)(u.default,{placeholder:"Deve selecionar um tipo",defaultValue:M,onChange:e=>P(e),children:K.m4.map(e=>(0,l.jsx)(ee,{name:"mailing_type",value:e.value,children:e.verbose},e.value))})}),(0,l.jsx)(c.default.Item,{label:"Localiza\xe7\xe3o Interna",children:(0,l.jsx)(j.default,{name:"internal_localization",defaultValue:A,onChange:e=>{$(e.target.value)}})}),(0,l.jsx)(c.default.Item,{label:"N\xfamero de volumes",children:(0,l.jsx)(j.default,{name:"volumes_number",type:"number",defaultValue:T,onChange:e=>{D(e.target.value)}})}),(0,l.jsx)(c.default.Item,{label:"Remetente",required:!0,children:(0,l.jsx)(u.default,{mode:"tags",style:{width:"100%"},placeholder:"Selecione o remetente ou adicione um novo",defaultValue:Y,onChange:e=>ea(e),children:null==en?void 0:en.map(e=>(0,l.jsx)(ee,{children:e},e))})}),(0,l.jsx)(c.default.Item,{label:"Imagem da correspond\xeancia",children:(0,l.jsx)(U.default,{onChange:e=>{let{fileList:t}=e;B(t)},name:"mailing_image",children:(0,l.jsx)(o.zx,{children:"Selecionar imagem"})})}),(0,l.jsx)(c.default.Item,{label:"Caixa de entrada",children:(0,l.jsx)(u.default,{placeholder:"Selecione um tipo",defaultValue:V,onChange:e=>W(e),children:K.E6.map(e=>(0,l.jsx)(ee,{value:e.value,children:e.verbose},e.value))})}),(0,l.jsx)(I.default,{}),(0,l.jsx)(et,{level:4,children:"Escaneamentos"}),(0,l.jsx)(Q.Z,{accept:".pdf,.arm,.pfx,.p12,.pem,.pub,.docx,.doc,.xls,.xlsx,.jpg,.jpeg,.png",multiple:!0,onChange:e=>{let{fileList:t}=e;G(t)},name:"scans"}
1),(0,l.jsx)(L.default,{open:z,style:{top:40,marginBottom:"100px"},onCancel:()=>O(!1),destroyOnClose:!0,footer:!1,closable:!0,children:F.length>0?(0,l.jsx)(X.default,{status:"warning",title:"Ocorreram problemas ao cadastrar a nova correspond\xeancia.",subTitle:[F.map(e=>e.error)],extra:(0,l.jsx)(o.zx,{type:"primary",onClick:()=>{O(!1)},children:"Fechar"},"console")}):(0,l.jsx)(X.default,{status:"success",title:"A correspond\xeancia foi cadastrada com sucesso",extra:[(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(h.default,{align:"middle",type:"flex",justify:"space-around",children:[(0,l.jsx)(o.zx,{type:"primary",onClick:()=>goToNotify(),children:"Completar o cadastro"},"notify-mailing"),(0,l.jsx)(o.zx,{type:"primary",onClick:()=>{d(!1)},children:"Criar nova correspond\xeancia"},"new-mailing")]}),(0,l.jsx)(h.default,{style:{padding:"20px"},children:(0,l.jsx)(o.zx,{onClick:()=>{p.push("/admin/correspondencia")},children:"Voltar \xe0 central de correspond\xeancias"},"back-to-home")})]})]})})]})}),(0,l.jsx)(I.default,{}),(0,l.jsx)(h.default,{type:"flex",justify:"end",style:{padding:"20px"},children:(0,l.jsx)(o.zx,{type:"primary",onClick:()=>{O(!0);let e={company:s,date:new Date(n),mailing_type:M,internal_localization:A,volumes_number:T,status:R,inbox:V,virtual_office:t,sender:Y,last_user:f.name},sendData=async e=>{await m.ApiPrivate.postPrivateMailing(e,s).then(e=>{let t=e.data.id;if(t){v(t),H&&uploadScans(t),q&&uploadImage(t);return}throw Error()}).catch(e=>{setMultipleErrors("N\xe3o foi poss\xedvel criar a correspond\xeancia")})};sendData(e);let uploadImage=async e=>{try{q[0].originFileObj.mailing=e;let t=new FormData;t.append("file",q[0].originFileObj),m.ApiPrivate.postPrivateImageMailing(t,e).then(e=>{if(e.data.id)_(!1);else throw Error()}).catch(e=>{setMultipleErrors("N\xe3o foi poss\xedvel adicionar a imagem")})}catch(e){setMultipleErrors("N\xe3o foi poss\xedvel adicionar a imagem")}},uploadScans=async e=>{try{let t=new FormData;H.forEach(e=>{t.append("documents",e.originFileObj)}),m.ApiPrivate.postPrivateDocuments(t,e).then(e=>{if(e.data.company)E(!1);else throw Error()}).catch(e=>{setMultipleErrors("N\xe3o foi poss\xedvel adicionar os scans")})}catch(e){setMultipleErrors("N\xe3o foi poss\xedvel adicionar os scans")}}},children:"Cadastrar nova correspond\xeancia"})})]})}),en=(0,r.memo)(e=>{let{visible:t,onCancel:n,toggleVisible:r,setMailId:i}=e,{unity:s,date:o,company:d}=useCreateMailingContext();return(0,l.jsx)(L.default,{title:"Criar nova correspond\xeancia",open:t,style:{to
1p:40,marginBottom:"100px"},onCancel:n,destroyOnClose:!0,footer:!1,width:w.tq?"100%":"60%",closable:!0,children:(0,l.jsx)(ea,{unity:s,date:o,company:d,toggleVisible:r,setMailId:i})})});var el=n(88827);let{Search:er}=j.default;var companyChoice=()=>{let[e,t]=(0,r.useState)([]),[n,i]=(0,r.useState)(!1),[s,d]=(0,r.useState)(),[c,u]=(0,r.useState)(!1),[x,p]=(0,r.useState)(!1),[f,j]=(0,r.useState)(null),{toggleCompany:b,unityName:C,toggleUnityAndDate:_}=useCreateMailingContext();(0,r.useEffect)(()=>{null!=f&&p(!0)},[f]);let searchResult=e=>{i(!0);let n=m.ApiPrivate.getAPICall("/v2/company/search/".concat(e,"/")).then(e=>(!e.data.error&&e.data?t(e.data):t([{key:"error",title:"Sem resultados",url:"#",id:null,icon:null,icon_text:null,slug:null,social_reason:null}]),i(!1),e.data));return n},handleSearch=async e=>{if(e.length<3)return!1;searchResult(e)};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(en,{visible:c,onCancel:()=>u(!1),toggleVisible:u,setMailId:j}),(0,l.jsx)(el.Z,{visible:x,mailId:f,onCancel:()=>p(!1)}),s?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(h.default,{type:"flex",justify:"space-between",align:"middle",style:{padding:"20px"},children:[(0,l.jsx)(g.default,{xs:24,sm:24,md:{span:8,offset:0},children:(0,l.jsx)(o.zx,{onClick:()=>d(null),children:"Selecionar outra empresa"})}),(0,l.jsx)(g.default,{xs:24,sm:24,md:{span:8,offset:0},children:(0,l.jsx)(o.zx,{type:"primary",onClick:()=>{b(s),u(!0)},children:"Criar Correspond\xeancia"})})]}),(0,l.jsx)(Y,{slug:s})]}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(h.default,{type:"flex",align:"middle",justify:"space-between",style:{padding:"20px"},children:[(0,l.jsxs)(g.default,{children:[(0,l.jsx)("h4",{children:C}),(0,l.jsx)("a",{onClick:()=>_(null,null),children:"Selecioner nova unidade"})]}),(0,l.jsx)(g.default,{xs:24,sm:24,md:{span:8,offset:0},children:(0,l.jsx)(y.default,{className:"global-search",size:"default",onSearch:S()(handleSearch,300),placeholder:"Procurar empresa",optionLabelProp:"text",children:(0,l.jsx)(er,{style:{border:"0px"},loading:n})},"autocomplete")}
1)]}),(0,l.jsx)(v.default,{columns:columns(e,d),dataSource:e,loading:n,rowClassName:(e,t)=>e.title,scroll:{x:w.tq?1e3:0},onRow:e=>({onClick:e=>{w.tq}}),locale:{emptyText:"Fa\xe7a uma busca para carregar a lista"}},"company_table")]})]})},mailing_PreRegistration=()=>{let{unity:e,date:t}=useCreateMailingContext();return(0,r.useEffect)(()=>{},[e,t]),e&&t?(0,l.jsx)(companyChoice,{}):(0,l.jsx)(unityChoice,{})},ei=(0,s.Xy)(()=>{let e=(0,i.useRouter)();return(0,l.jsx)(CreateMailingContextProvider,{children:(0,l.jsxs)("section",{className:"padding paddingTop50 container MobilePadding",children:[(0,l.jsx)(o.zx,{style:{marginBottom:"20px"},onClick:()=>e.push("/admin/correspondencia"),children:"Voltar para a central"}),(0,l.jsx)(o.mr,{title:"Pr\xe9-cadastro de correspond\xeancias",avatar:{src:"/icons/mail.svg"},style:{display:"flex",flexDirection:"row",alignContent:"space-between",marginBottom:"50px"}}),(0,l.jsx)(o.Card,{className:"padding4 center",children:(0,l.jsx)(mailing_PreRegistration,{})})]})})})},96023:function(e,t,n){"use strict";var l=n(90008);let getAnswers=async function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=await l.eZ.getAnswers(e,t,n).then(e=>{let t=e.data.items,n=[];return Object.keys(t).map(e=>{let l=t[e].value;return t[e].value.includes("[")&&(l=l.replace(/[.*"+?^${}()|[\]\\]/g,"").split(", ")),"True"===l?l=!0:"False"===l&&(l=!1),n[t[e].key]=l,n}),n}).catch(e=>{});return r};t.Z=getAnswers},50139:function(e,t,n){"use strict";/** 2 * @license React 3 * use-sync-external-store-shim/with-selector.production.min.js 4 * 5 * Copyright (c) Facebook, Inc. and its affiliates. 6 * 7 * This source code is licensed under the MIT license found in the 8 * LICENSE file in the root directory of this source tree. 9 */var l=n(67294),r=n(61688),i="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},s=r.useSyncExternalStore,o=l.useRef,d=l.useEffect,c=l.useMemo,u=l.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,n,l,r){var x=o(null);if(null===x.current){var p={hasValue:!1,value:null};x.current=p}else p=x.current;var m=s(e,(x=c(function(){function a(t){if(!o){if(o=!0,e=t,t=l(t),void 0!==r&&p.hasValue){var n=p.value;if(r(n,t))return s=n}return s=t}if(n=s,i(e,t))return n;var d=l(t);return void 0!==r&&r(n,d)?n:(e=t,s=d)}var e,s,o=!1,d=void 0===n?null:n;return[function(){return a(t())},null===d?void 0:function(){return a(d())}]},[t,n,l,r]))[0],x[1]);return d(function(){p.hasValue=!0,p.value=m},[m]),u(m),m}},52798:function(e,t,n){"use strict";e.exports=n(50139)},64529:function(e,t,n){"use strict";n.d(t,{Ue:function(){return create}});let createStoreImpl=e=>{let t;let n=new Set,setState=(e,l)=>{let r="function"==typeof e?e(t):e;if(!Object.is(r,t)){let e=t;t=(null!=l?l:"object"!=typeof r)?r:Object.assign({},t,r),n.forEach(n=>n(t,e))}},getState=()=>t,l={setState,getState,subscribe:e=>(n.add(e),()=>n.delete(e)),destroy:()=>{console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}};return t=e(setState,getState,l),l},createStore=e=>e?createStoreImpl(e):createStoreImpl;var l=n(67294),r=n(52798);let{useDebugValue:i}=l,{useSyncExternalStoreWithSelector:s}=r,o=!1,createImpl=e=>{"function"!=typeof e&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");let t="function"==typeof e?createStore(e):e,useBoundStore=(e,n)=>(function(e,t=e.getState,n){n&&!o&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),o=!0);let l=s(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return i(l),l})(t,e,n);return Object.assign(useBoundStore,t),useBoundStore},create=e=>e?createImpl(e):createImpl}},function(e){e.O(0,[94976,97948,23636,25675,69843,12386,48301,97538,64713,73818,39517,2307,56590,74806,28465,14321,31132,84478,76272,66386,49774,92888,40179],function(){return e(e.s=27749)}),_N_E=e.O()}]);
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.