1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5243],{34523:function(e,t,a){a.r(t),a.d(t,{default:function(){return Z}});var r=a(85893),l=a(30646),n=a(93105),i=a(67294),o=a(62634),c=a(80823),d=a(70125),s=a(82062),m=a(26481),h=a(84086),u=a(24896),p=a(28045),v=a(70242),g=a(55678),x=a(43034);let b={horizontal:"frontWeb/default_content_h.webp",vertical:"frontWeb/default_content_v.webp"},f=async e=>{let t=e?b.horizontal:b.vertical,a=await (0,x.Z)(t);if(!a)throw Error("N\xe3o foi poss\xedvel obter a URL da capa padr\xe3o");let r=await fetch(a);if(!r.ok)throw Error("N\xe3o foi poss\xedvel carregar a capa padr\xe3o");let l=await r.blob(),n=t.split("/").pop()||"default-content.png";return new File([l],n,{type:l.type||"image/png"})},j={video:"V\xeddeo",pdf:"PDF",image:"Imagem"};var Z=e=>{let{onCreateContent:t,thumbnailHorizontal:a}=e,{userData:x}=(0,o.Z)(),[b,Z]=(0,i.useState)(!1),[w,E]=(0,i.useState)(!1),{setModalOpen:y}=(0,p.Z)(),[A,C]=(0,i.useState)({title:"",description:"",file:void 0,link:"",extra_url:"",kind_extension:"",visible:!0,thumb:void 0,thumbPreview:"",filePreview:"",pro:!1,max_imc:0,min_imc:0}),k=async()=>{if(b)return;let e=(0,v.YO)(A.link);if(A.thumb&&(w||!e)){t(A);return}try{Z(!0);let r=e?await (0,v.s7)(A.link):await f(a);if(!r)return;t({...A,thumb:r,thumbPreview:URL.createObjectURL(r)})}catch(t){g.Am.error(e?"N\xe3o foi poss\xedvel gerar a capa do YouTube. Adicione uma capa manualmente.":"N\xe3o foi poss\xedvel carregar a capa padr\xe3o. Adicione uma capa manualmente.")}finally{Z(!1)}};return(0,r.jsxs)(m.UQ,{children:[(0,r.jsxs)(m.Sm,{children:[(0,r.jsx)(u.X,{color:"#F3F4F9",size:20}),(0,r.jsx)(n.MS,{children:"Criar conte\xfado"}),(0,r.jsx)(h.qk,{onClick:()=>y(!1),children:(0,r.jsx)(u.X,{color:"#FFF",size:20})})]}),(0,r.jsxs)(m.DC,{children:[(0,r.jsxs)(m.qc,{children:[(0,r.jsx)(l.Z,{label:"T\xedtulo",placeholder:"Digite seu t\xedtulo aqui",type:"text",value:A.title||"",maxLength:100,required:!0,onChange:e=>C(t=>({...t,title:e.target.value}))}),(0,r.jsxs)(c.Z,{label:"Tipo de extens\xe3o",name:"kind_extension",selectSize:"small",mobileStyle:!0,value:A.kind_extension,onChange:e=>C(t=>({...t,kind_extension:e.target.value})),children:[(0,r.jsx)("option",{value:"",disabled:!0,children:"Selecione o tipo"}),Object.entries(j).map(e=>{let[t,a]=e;return(0,r.jsx)("option",{value:t,children:a},t)})]}),(0,r.jsx)(l.Z,{label:"Descri\xe7\xe3o",placeholder:"Escreva aqui a descri\xe7\xe3o do seu m\xf3dulo",type:"textarea",value:A.description||"",maxLength:300,onChange:e=>C(t=>({...t,description:e.target.value}))}),(0,r.jsxs)(n.tp,{children:[(0,r.jsx)(s.Z,{label:"Vis\xedvel",checked:A.visible,onChange:e=>C(t=>({...t,visible:e}))}),x.admin&&(0,r.jsx)(s.Z,{label:"Pro",checked:!!A.pro,onChange:e=>C(t=>({...t,pro:e}))})]}),(0,r.jsx)(l.Z,{label:"Link",placeholder:"Cole seu link aqui",type:"text",value:(null==A?void 0:A.link)||"",maxLength:300,onChange:e=>{let t=e.target.value,a=(0,v.YO)(t);a&&E(!1),C(e=>({...e,link:t,thumb:a?void 0:e.thumb,thumbPreview:null!=a?a:e.thumb?e.thumbPreview:""}))}}),(0,r.jsxs)(n.wG,{children:[(0,r.jsx)(n.W9,{children:"Exibir para usu\xe1rios com IMC entre:"}),(0,r.jsxs)(n.dZ,{children:[(0,r.jsx)(l.Z,{placeholder:"M\xednimo",value:A.min_imc,type:"number",onChange:e=>C(t=>{let a=Number(e.target.value);return{...t,min_imc:a<0?0:a}})}),(0,r.jsx)(l.Z,{placeholder:"M\xe1ximo",value:A.max_imc,type:"number",onChange:e=>C(t=>{let a=Number(e.target.value);return{...t,max_imc:a<0?0:a}})})]})]})]}),(0,r.jsx)(n.OO,{children:(0,r.jsxs)(n.B0,{children:[(0,r.jsxs)(n.ay,{children:[(0,r.jsx)(n.W9,{children:"Capa"}),(0,r.jsxs)(n.Pg,{children:[(0,r.jsx)(d.G,{inputId:"upload-content-cover",accept:".jpg, .jpeg, .png, .svg",handleDoc:e=>{E(!0),C(t=>({...t,thumb:e,thumbPreview:URL.createObjectURL(e)}))},label:"Selecionar capa"},"upload-content-cover"),A.thumbPreview&&(0,r.jsx)("div",{children:(0,r.jsx)("img",{src:A.thumbPreview,alt:"Preview da capa",style:{width:50,height:50}})})]})]}),(0,r.jsxs)(n.DF,{children:[(0,r.jsx)(n.W9,{children:"Conte\xfado"}),(0,r.jsxs)(n.Pg,{children:[(0,r.jsx)(d.G,{inputId:"upload-content-file",accept:".pdf, .mp4, .mp3, .jpg, .jpeg, .png, .svg",handleDoc:async e=>{let t=URL.createObjectURL(e);C(a=>({...a,file:e,filePreview:t}));try{let t=await (0,v.m4)(e);t&&C(e=>({...e,thumb:t,thumbPreview:URL.createObjectURL(t)}))}catch(e){console.error("Erro ao gerar capa autom\xe1tica:",e)}},label:"Selecionar conte\xfado"},"upload-content-file"),A.file&&(0,r.jsxs)("div",{children:[A.filePreview&&(0,r.jsx)("div",{children:(0,r.jsx)("img",{src:A.filePreview,alt:"Preview do conte\xfado",style:{width:10,height:10}})}),"application/pdf"===A.file.type&&(0,r.jsx)("embed",{src:A.filePreview,type:"application/pdf",style:{width:100,height:100,marginBottom:5,border:"1px solid #ccc",borderRadius:8,backgroundColor:"#fff"}}),A.file.type.startsWith("video/")&&(0,r.jsx)("video",{src:A.filePreview,controls:!0,style:{width:250,maxHeight:200,borderRadius:12,border:"1px solid #ccc",backgroundColor:"#000"}}),A.file.type.startsWith("audio/")&&(0,r.jsx)("audio",{src:A.filePreview,controls:!0,style:{width:250,marginTop:8}}),A.file.type.startsWith("image/")&&(0,r.jsx)("img",{src:A.filePreview,alt:"Preview do conte\xfado",style:{width:250,maxHeight:200,borderRadius:12,border:"1px solid #ccc",backgroundColor:"#000"}})]})]})]})]})})]}),(0,r.jsx)(n.fl,{onClick:k,children:b?"Criando...":"Criar conte\xfado"})]})}},51365:function(e,t,a){a.d(t,{v:function(){return o},p:function(){return i}});var r=a(67294),l=a(27589);let n=new Map([["bold",r.createElement(r.Fragment,null,r.createElement("path",{d:"M228,128a12,12,0,0,1-12,12H140v76a12,12,0,0,1-24,0V140H40a12,12,0,0,1,0-24h76V40a12,12,0,0,1,24,0v76h76A12,12,0,0,1,228,128Z"}))],["duotone",r.createElement(r.Fragment,null,r.createElement("path",{d:"M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z",opacity:"0.2"}),r.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z"}))],["fill",r.createElement(r.Fragment,null,r.createElement("path",{d:"M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM184,136H136v48a8,8,0,0,1-16,0V136H72a8,8,0,0,1,0-16h48V72a8,8,0,0,1,16,0v48h48a8,8,0,0,1,0,16Z"}))],["light",r.createElement(r.Fragment,null,r.createElement("path",{d:"M222,128a6,6,0,0,1-6,6H134v82a6,6,0,0,1-12,0V134H40a6,6,0,0,1,0-12h82V40a6,6,0,0,1,12,0v82h82A6,6,0,0,1,222,128Z"}))],["regular",r.createElement(r.Fragment,null,r.createElement("path",{d:"M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z"}))],["thin",r.createElement(r.Fragment,null,r.createElement("path",{d:"M220,128a4,4,0,0,1-4,4H132v84a4,4,0,0,1-8,0V132H40a4,4,0,0,1,0-8h84V40a4,4,0,0,1,8,0v84h84A4,4,0,0,1,220,128Z"}))]]),i=r.forwardRef((e,t)=>
1r.createElement(l.Z,{ref:t,...e,weights:n}));i.displayName="PlusIcon";let o=i},75379:function(e,t,a){a.d(t,{Q:function(){return o},h:function(){return i}});var r=a(67294),l=a(27589);let n=new Map([["bold",r.createElement(r.Fragment,null,r.createElement("path",{d:"M128,20A108,108,0,1,0,236,128,108.12,108.12,0,0,0,128,20Zm0,192a84,84,0,1,1,84-84A84.09,84.09,0,0,1,128,212Zm-12-80V80a12,12,0,0,1,24,0v52a12,12,0,0,1-24,0Zm28,40a16,16,0,1,1-16-16A16,16,0,0,1,144,172Z"}))],["duotone",r.createElement(r.Fragment,null,r.createElement("path",{d:"M224,128a96,96,0,1,1-96-96A96,96,0,0,1,224,128Z",opacity:"0.2"}),r.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm-8-80V80a8,8,0,0,1,16,0v56a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,172Z"}))],["fill",r.createElement(r.Fragment,null,r.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm-8,56a8,8,0,0,1,16,0v56a8,8,0,0,1-16,0Zm8,104a12,12,0,1,1,12-12A12,12,0,0,1,128,184Z"}))],["light",r.createElement(r.Fragment,null,r.createElement("path",{d:"M128,26A102,102,0,1,0,230,128,102.12,102.12,0,0,0,128,26Zm0,192a90,90,0,1,1,90-90A90.1,90.1,0,0,1,128,218Zm-6-82V80a6,6,0,0,1,12,0v56a6,6,0,0,1-12,0Zm16,36a10,10,0,1,1-10-10A10,10,0,0,1,138,172Z"}))],["regular",r.createElement(r.Fragment,null,r.createElement("path",{d:"M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm0,192a88,88,0,1,1,88-88A88.1,88.1,0,0,1,128,216Zm-8-80V80a8,8,0,0,1,16,0v56a8,8,0,0,1-16,0Zm20,36a12,12,0,1,1-12-12A12,12,0,0,1,140,172Z"}))],["thin",r.createElement(r.Fragment,null,r.createElement("path",{d:"M128,28A100,100,0,1,0,228,128,100.11,100.11,0,0,0,128,28Zm0,192a92,92,0,1,1,92-92A92.1,92.1,0,0,1,128,220Zm-4-84V80a4,4,0,0,1,8,0v56a4,4,0,0,1-8,0Zm12,36a8,8,0,1,1-8-8A8,8,0,0,1,136,172Z"}))]]),i=r.forwardRef((e,t)=>r.createElement(l.Z,{ref:t,...e,weights:n}));i.displayName="WarningCircleIcon";let o=i}}]);
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.