1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3334],{67302:function(e,n,t){t.d(n,{O:function(){return f}});var r=t(47568),i=t(97582),o=t(85893),s=t(57747),a=t(32556),l=t(89993),c=t(4186),u=t(27239),d=t(55723),x=t(93717),h=t(22757),p=(t(67294),t(8193)),m=t(93114),j=t(89583),v=t(1451),f=function(e){var n=e.url,t=e.order,f=e.remove,g=e.moveUp,b=e.moveDown,y=function(){var e=(0,r.Z)((function(){var e,r,o,s,a;return(0,i.__generator)(this,(function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),[4,fetch(n)];case 1:return[4,i.sent().blob()];case 2:return e=i.sent(),r="midia-".concat(t),n.includes(".mp4")||n.includes(".webm")||n.includes(".mov")?r+=".mp4":n.includes(".jpg")||n.includes(".jpeg")?r+=".jpg":n.includes(".png")?r+=".png":n.includes(".gif")?r+=".gif":n.includes(".webp")?r+=".webp":r+=".file",o=window.URL.createObjectURL(e),(s=document.createElement("a")).href=o,s.download=r,document.body.appendChild(s),s.click(),document.body.removeChild(s),window.URL.revokeObjectURL(o),[3,4];case 3:return a=i.sent(),console.error("Erro ao fazer download:",a),[3,4];case 4:return[2]}}
1))}));return function(){return e.apply(this,arguments)}}();return(0,o.jsxs)(s.xu,{border:"none",color:"var(--black-primary)",borderRadius:"4px",p:"10px",backgroundColor:"gray.100",children:[(0,o.jsxs)(x.k,{justify:"space-between",align:"center",mb:"2",children:[(0,o.jsx)(d.J,{as:p.ql3,color:"var(--red-primary)",fontSize:"1rem",cursor:"pointer",onClick:function(){return f()}}),(0,o.jsxs)(h.X,{as:"h6",className:"paragrafo-preto text-black",fontSize:"0.9rem",textAlign:"center",children:["Ordem: ",t]})]}),function(e){var n=e.toLowerCase();return[".mp4",".webm",".mov",".avi",".mkv"].some((function(e){return n.includes(e)}))}(n)?(0,o.jsxs)(s.xu,{position:"relative",children:[(0,o.jsxs)("video",{style:{width:"150px",height:"150px",objectFit:"cover",borderRadius:"4px"},controls:!0,onContextMenu:m.I,children:[(0,o.jsx)("source",{src:n,type:"video/mp4"}),"Seu navegador n\xe3o suporta v\xeddeos."]}),(0,o.jsx)(a.u,{label:"Download v\xeddeo",placement:"top",children:(0,o.jsx)(l.h,{"aria-label":"Download v\xeddeo",icon:(0,o.jsx)(v.$0x,{}),size:"sm",position:"absolute",top:"2",right:"2",colorScheme:"gray",onClick:y,op
1acity:"0.8",_hover:{opacity:1}})})]}):function(e){var n=e.toLowerCase();return[".jpg",".jpeg",".png",".gif",".webp",".svg"].some((function(e){return n.includes(e)}))}(n)?(0,o.jsxs)(s.xu,{position:"relative",children:[(0,o.jsx)(c.E,{boxSize:"150px",objectFit:"cover",src:n,alt:"product",onContextMenu:m.I}),(0,o.jsx)(a.u,{label:"Download imagem",placement:"top",children:(0,o.jsx)(l.h,{"aria-label":"Download imagem",icon:(0,o.jsx)(v.$0x,{}),size:"sm",position:"absolute",top:"2",right:"2",colorScheme:"gray",onClick:y,opacity:"0.8",_hover:{opacity:1}})})]}):(0,o.jsx)(u.M,{boxSize:"150px",bg:"gray.200",borderRadius:"4px",border:"1px solid",borderColor:"gray.300",children:(0,o.jsx)(d.J,{as:p.ql3,color:"gray.500",fontSize:"2rem"})}),(0,o.jsxs)(s.xu,{mt:"2",textAlign:"center",children:[(0,o.jsx)(l.h,{"aria-label":"Mover para cima",icon:(0,o.jsx)(j._HU,{}),onClick:function(){return g()},mr:"12%",backgroundColor:"white"}),(0,o.jsx)(l.h,{"aria-label":"Mover para baixo",icon:(0,o.jsx)(j.H_v,{}),onClick:function(){return b()},backgroundColor:"white"})]})]})}},63334:function(e,n,t){t.r(n),t.d(n,{default:function(){return F}});var r=t(47568),i=t(828),o=t(29815),s=t(97582),a=t(85893),l=t(67294),c=t(40655),u=t(99710),d=t(53575),x=t(51904),h=t(86738),p=t(31156),m=t(33749),j=t(39711),v=t(79531),f=t(3587),g=t(68351),b=t(86548),y=t(48689),C=t(57747),S=t(64190),A=t(50151),E=t(64325),I=t(72303),w=t(13591),Z=t(74574),k=t(82509),D=t(60557),T=t(91170),L=t(93855),O=t(4040),R=t(80972),P=t(93717),U=t(54744),N=t(27484),_=t.n(N),V=t(61969),H=t(79323),z=t(67302),q=c.Z.Option;function F(){var e=(0,l.useState)(!1),n=e[0],t=e[1],N=(0,i.Z)(u.Z.useForm(),1)[0],F=(0,l.useState)([]),M=F[0],B=F[1],G=(0,l.useState)("NONE"),Y=G[0],W=G[1],J=(0,l.useState)([]),$=J[0],K=J[1],Q=(0,l.useState)(null),X=Q[0],ee=Q[1],ne=function(){var e=(0,r.Z)((function(){var e,n;return(0,s.__generator)(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,V.api.get("/linkedin/scheduled")];case 1:return e=t.sent().data,B(e),[3,3];case 2:return n=t.sent(),console.error("Erro ao buscar agendamentos:",n),[3,3];case 3:return[2]}}
1))}));return function(){return e.apply(this,arguments)}}();(0,l.useEffect)((function(){ne()}),[]);var te=function(){var e=(0,r.Z)((function(e){return(0,s.__generator)(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,V.api.post("/linkedin/cancel/".concat(e))];case 1:return n.sent(),ne(),[3,3];case 2:return n.sent(),console.error("Erro ao excluir agendamento"),[3,3];case 3:return[2]}}))}));return function(n){return e.apply(this,arguments)}}(),re=function(){var e=(0,r.Z)((function(e,n){return(0,s.__generator)(this,(function(t){switch(t.label){case 0:return t.trys.push([0,2,,3]),[4,V.api.patch("/linkedin/approve/".concat(e),{postStatus:n})];case 1:return t.sent(),ne(),[3,3];case 2:return t.sent(),console.error("Erro ao alterar status"),[3,3];case 3:return[2]}}))}));return function(n,t){return e.apply(this,arguments)}}(),ie=function(e,n){var r;W(e),K((null===n||void 0===n||null===(r=n.mediaElements)||void 0===r?void 0:r.map((function(e){return e.urn})))||[]),N.resetFields(),N.setFieldsValue({mediaCategory:e,visibility:(null===n||void 0===n?void 0:n.visibility)||"PUBLIC",contentText:null===n||void 0===n?void 0:n.contentText,date:n?_()(n.scheduledAt):void 0,time:n?_()(n.scheduledAt):void 0,articleUrl:null===n||void 0===n?void 0:n.articleUrl,articleTitle:null===n||void 0===n?void 0:n.articleTitle,articleDescription:null===n||void 0===n?void 0:n.articleDescription,postStatus:(null===n||void 0===n?void 0:n.postStatus)||"AWAITING_APPROVAL"}),ee(n||null),t(!0)},oe=function(){var e=(0,r.Z)((function(e){var n,r,i,o;return(0,s.__generator)(this,(function(s){switch(s.label){case 0:n=_()(e.date).hour(e.time.hour()).minute(e.time.minute()).toISOString(),r=$.length>0?$.map((function(e){return{type:Y,urn:e}})):null,i={contentText:e.contentText,articleUrl:e.articleUrl||null,articleTitle:e.articleTitle||null,articleDescription:e.articleDescription||null,mediaCategory:Y,visibility:e.visibility,mediaElements:r,scheduledAt:n,postStatus:e.postStatus},s.label=1;case 1:return s.trys.push([1,6,,7]),X?[4,V.api.put("/linkedin/schedule/".concat(X.id),i)]:[3,3];case 2:return s.sent(),[3,5];case 3:return[4,V.api.post("/linkedin/schedule",i)];case 4:s.sent(),s.label=5;case 5:return N.resetFields(),t(!1),ne(),ee(null),[3,7];case 6:return o=s.sent(),console.error("Erro ao salvar agendamento",o),[3,7];case 7:return[2]}}
1))}));return function(n){return e.apply(this,arguments)}}(),se=[{title:"Conte\xfado",dataIndex:"contentText",key:"contentText",ellipsis:!0},{title:"Agendado para",dataIndex:"scheduledAt",key:"scheduledAt",render:function(e){return _()(e).format("DD/MM/YYYY HH:mm")}},{title:"Status",dataIndex:"postStatus",key:"postStatus",render:function(e){var n="PUBLISHED"===e?"green":"ERROR"===e?"red":"APPROVED"===e?"blue":"orange";return(0,a.jsx)(x.Z,{color:n,children:e})}},{title:"A\xe7\xf5es",key:"actions",render:function(e,n){return(0,a.jsxs)(C.xu,{display:"flex",gap:2,alignItems:"center",children:[(0,a.jsx)(b.Z,{style:{color:"#1890ff",fontSize:"16px",cursor:"PUBLISHED"!==n.postStatus?"pointer":"not-allowed",opacity:"PUBLISHED"===n.postStatus?.5:1},onClick:function(){return"PUBLISHED"!==n.postStatus&&ie(n.mediaCategory||"NONE",n)}}),"PUBLISHED"!==n.postStatus&&(0,a.jsxs)(S.J,{children:[(0,a.jsx)(A.x,{children:(0,a.jsx)(x.Z,{children:n.postStatus})}),(0,a.jsxs)(E.y,{children:[(0,a.jsx)(I.Q,{}),(0,a.jsx)(w.u,{}),(0,a.jsx)(Z.Y,{children:"Alterar status"}),(0,a.jsx)(k.b,{children:(0,a.jsxs)(c.Z,{defaultValue:n.postStatus,onChange:function(e){return re(n.id,e)},style:{width:"100%"},children:[(0,a.jsx)(q,{value:"AWAITING_APPROVAL",children:"Aguardando"}),(0,a.jsx)(q,{value:"APPROVED",children:"Aprovado"}),(0,a.jsx)(q,{value:"CANCELED",children:"Cancelado"})]})})]})]}),(0,a.jsx)(h.Z,{title:"Tem certeza que deseja excluir?",onConfirm:function(){return te(n.id)},okText:"Sim",cancelText:"N\xe3o",children:(0,a.jsx)(y.Z,{style:{color:"red",fontSize:"16px",cursor:"pointer"}})})]})}}];return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(D.v,{children:[(0,a.jsx)(T.j,{as:L.z,rightIcon:(0,a.jsx)(U.v4,{}),colorScheme:"blue",mb:4,children:"Agendar Post"}),(0,a.jsxs)(O.q,{children:[(0,a.jsx)(R.s,{onClick:function(){return ie("NONE")},children:"Texto"}),(0,a.jsx)(R.s,{onClick:function(){return ie("IMAGE")},children:"Imagem"}),(0,a.jsx)(R.s,{onClick:function(){return ie("VIDEO")},children:"V\xeddeo"}),(0,a.jsx)(R.s,{onClick:function(){return ie("CAROUSEL")},children:"Carrossel"}),(0,a.jsx)(R.s,{onClick:function(){return ie("ARTICLE")},children:"Artigo"})]})]}),(0,a.jsx)(p.Z,{dateCellRender:function(e){var n=M.filter((function(n){return _()(n.scheduledAt).isSame(e,"day")}));return(0,a.jsx)("ul",{className:"events",children:n.map((function(e){return(0,a.jsx)("li",{children:(0,a.jsx)(d.Z,{status:"APPROVED"===e.postStatus?"success":"default",text:e.contentText.slice(0,10)+"..."})},e.id)}))})}}),(0,a.jsx)(m.Z,{dataSource:M,columns:se,rowKey:"id",pagination:{pageSize:5},style:{marginTop:16}}),(0,a.jsx)(j.Z,{title:X?"Editar Postagem":"Agendar Post no LinkedIn",visible:n,onCancel:function(){return t(!1)},onOk:function(){return N.submit()},children:(0,a.jsxs)(u.Z,{form:N,onFinish:oe,layout:"vertical",initialValues:{visibility:"PUBLIC"},children:[(0,a.jsxs)(P.k,{w:"100%",gap:"5",children:[(0,a.jsx)(C.xu,{w:"70%",children:(0,a.jsx)(u.Z.Item,{label:"Categoria",name:"mediaCategory",children:(0,a.jsxs)(c.Z,{value:Y,onChange:function(e){W(e),K([]);var n={mediaCategory:e,content:void 0};"ARTICLE"===e&&Object.assign(n,{articleUrl:void 0,articleTitle:void 0,articleDescription:void 0}),N.setFieldsValue(n)},children:[(0,a.jsx)(q,{value:"NONE",children:"Nenhuma"}),(0,a.jsx)(q,{value:"ARTICLE",children:"Artigo"}),(0,a.jsx)(q,{value:"IMAGE",children:"Imagem"}),(0,a.jsx)(q,{value:"VIDEO",children:"V\xeddeo"}),(0,a.jsx)(q,{value:"CAROUSEL",children:"Carrossel"})]})})}),(0,a.jsx)(C.xu,{w:"30%",children:(0,a.jsx)(u.Z.Item,{name:"postStatus",label:"Status",rules:[{required:!0,message:"Selecione o status"}],children:(0,a.jsxs)(c.Z,{children:[(0,a.jsx)(q,{value:"AWAITING_APPROVAL",children:"Em Aprova\xe7\xe3o"}),(0,a.jsx)(q,{value:"APPROVED",children:"Aprovado"}),(0,a.jsx)(q,{value:"SCHEDULED",children:"Agendado"}),(0,a.jsx)(q,{value:"PUBLISHED",children:"Publicado"}),(0,a.jsx)(q,{value:"CANCELED",children:"Cancelado"}),(0,a.jsx)(q,{value:"ERROR",children:"Erro"})]})})})]}),(0,a.jsxs)(u.Z.Item,{name:"contentText",label:"Texto",rules:[{required:!0,message:"Insira o texto da postagem"}],children:[" ",(0,a.jsx)(v.Z.TextArea,{rows:4})," "]}),"ARTICLE"===Y&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(u.Z.Item,{name:"articleUrl",label:"URL do Artigo",children:(0,a.jsx)(v.Z,{})}),(0,a.jsx)(u.Z.Item,{name:"articleTitle",label:"T\xedtulo do Artigo",children:(0,a.jsx)(v.Z,{})}),(0,a.jsx)(u.Z.Item,{name:"articleDescription",label:"Descri\xe7\xe3o do Artigo",children:(0,a.jsx)(v.Z.TextArea,{rows:2})})]}),["IMAGE","VIDEO","CAROUSEL"].includes(Y)&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(u.Z.Item,{label:"Enviar M\xeddia",children:(0,a.jsx)(H.Z,{name:"",question:"Selecione arquivos (at\xe9 10 para carrossel)",typeInput:"file",getUrls:function(e){return K((function(n){return(0,o.Z)(n).concat((0,o.Z)(e))}))}})}),(0,a.jsx)(C.xu,{display:"flex",flexWrap:"wrap",gap:2,children:$.map((function(e,n){return(0,a.jsx)(z.O,{url:e,order:n+1,remove:function(){return K((function(e){return e.filter((function(e,t){return t!==n}))}))},moveUp:function(){return function(e){if(e>0){var n,t=(0,o.Z)($);n=[t[e],t[e-1]],t[e-1]=n[0],t[e]=n[1],K(t)}}(n)},moveDown:function(){return function(e){if(e<$.length-1){var n,t=(0,o.Z)($);n=[t[e],t[e+1]],t[e+1]=n[0],t[e]=n[1],K(t)}}(n)}},n)}))})]}),(0,a.jsxs)(P.k,{w:"100%",gap:"5",children:[(0,a.jsx)(C.xu,{w:"33%",children:(0,a.jsx)(u.Z.Item,{name:"visibility",label:"Visibilidade",rules:[{required:!0,message:"Selecione visibilidade"}],children:(0,a.jsxs)(c.Z,{children:[(0,a.jsx)(q,{value:"PUBLIC",children:"P\xfablico"}),(0,a.jsx)(q,{value:"CONNECTIONS",children:"Conex\xf5es"})]})})}),(0,a.jsx)(C.xu,{w:"33%",children:(0,a.jsx)(u.Z.Item,{name:"date",label:"Data",rules:[{required:!0,message:"Selecione data"}],children:(0,a.jsx)(f.Z,{style:{width:"100%"}})})}),(0,a.jsx)(C.xu,{w:"33%",children:(0,a.jsx)(u.Z.Item,{name:"time",label:"Hora",rules:[{required:!0,message:"Selecione hora"}],children:(0,a.jsx)(g.Z,{style:{width:"100%"},format:"HH:mm"})})})]})]})})]})}},93114:function(e,n,t){t.d(n,{I:function(){return r}});var r=function(){return!1}}}]);
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.