import{j as e}from"./v_7_4_3_28_345c6a4a-aab6-4ec9-a0c6-3718e7fdb1165.js";import{u as j}from"./v_7_4_3_28_345c6a4a-aab6-4ec9-a0c6-3718e7fdb1164.js";import{d0 as g,d5 as N,o as b,p as w,d6 as y,r as h}from"./v_7_4_3_28_345c6a4a-aab6-4ec9-a0c6-3718e7fdb1167.js";import{C as k}from"./v_7_4_3_28_345c6a4a-aab6-4ec9-a0c6-3718e7fdb116117.js";import{a as _}from"./v_7_4_3_28_345c6a4a-aab6-4ec9-a0c6-3718e7fdb116110.js";import{r as C}from"./v_7_4_3_28_345c6a4a-aab6-4ec9-a0c6-3718e7fdb116.js";import"./v_7_4_3_28_345c6a4a-aab6-4ec9-a0c6-3718e7fdb1163.js";import"./v_7_4_3_28_345c6a4a-aab6-4ec9-a0c6-3718e7fdb1162.js";import"./v_7_4_3_28_345c6a4a-aab6-4ec9-a0c6-3718e7fdb1166.js";import"./v_7_4_3_28_345c6a4a-aab6-4ec9-a0c6-3718e7fdb1168.js";var D=function(d){var a=d.base64,r;switch(a.split(";")[0].split(":")[1].split("/")[0]){case"image":r=e.jsx("img",{src:a,className:"w-[150px] max-h-[180px]"});break;case"video":r=e.jsx("video",{src:a,className:"w-[150px] max-h-[180px]",controls:!0});break;case"audio":r=e.jsx("audio",{src:a,className:"w-full",controls:!0});break;default:r=e.jsx("div",{className:"animate__animated animate__zoomIn",children:e.jsx("div",{className:"tvf2evcx m0h2a7mj lb5m6g5c j7l1k36l ktfrpxia nu7pwgvd p357zi0d dnb887gk gjuq5ydh i2cterl7 ac2vgrno f8m0rgwh gndfcl4n cm280p3y jmly3brn qqs366u4 ikqdvm1y m3qqxsiz r1ncx0sg mmj7r7ye py-2",children:e.jsxs("div",{className:"du8bjn1j px-2 !m-0",children:[e.jsx("span",{"data-icon":"preview-generic",className:"flex justify-center",children:e.jsxs("svg",{viewBox:"0 0 88 110",height:"110",width:"88",preserveAspectRatio:"xMidYMid meet",children:[e.jsx("g",{transform:"translate(4 3)",children:e.jsx("path",{"stroke-opacity":"0.08",stroke:"#000",d:"M3-.5h56.929a5.5 5.5 0 0 1 3.889 1.61l15.071 15.072a5.5 5.5 0 0 1 1.611 3.89V101a3.5 3.5 0 0 1-3.5 3.5H3A3.5 3.5 0 0 1-.5 101V3A3.5 3.5 0 0 1 3-.5z",fill:"#FFF","fill-rule":"evenodd"})}),e.jsx("path",{d:"M65.5 3.5v15a3 3 0 0 0 3 3h15","stroke-opacity":"0.12",stroke:"#000",fill:"#FFF"})]})}),e.jsx("span",{className:"pt-1 text-center font-semibold w-full block uppercase",children:"documento"})]})})});break}return r};function M(d){var a,r=d.id,n=j().language,s=g().getContainer,o=s(r)(),l=o.note,c=o.setNote,m=function(t){var i=new FileReader;i.onloadend=function(){var v=i.result;c("base64",v)},i.readAsDataURL(t)},x=function(t){t.preventDefault();var i=t.dataTransfer.files[0];i&&m(i)},p=e.jsxs("div",{className:"flex gap-2 items-center justify-center h-24 w-full",children:[e.jsxs("label",{className:"m-auto p-2 border-base-200 hover:border-[var(--primaria)] border border-solid rounded-lg h-24 w-20 pulse flex justify-center items-center flex-col shadow-lg cursor-pointer",children:[e.jsx(k,{className:"h-6 w-6 text-[var(--primaria)]",strokeWidth:1}),e.jsx("strong",{className:"text-[var(--primaria)]",children:n.importar}),e.jsx("input",{type:"file",className:"hidden",onChange:function(t){return m(t.target.files[0])}})]}),e.jsx("div",{className:"border-dashed border-2 border-[var(--primaria)] rounded-lg h-full w-full flex justify-center items-center",onDrop:x,onDragOver:function(t){return t.preventDefault()},children:n.arrasteOArquivoAqui})]}),u=e.jsxs("div",{className:"flex flex-col items-center",children:[e.jsx("div",{className:"flex justify-end w-full",children:e.jsx("span",{className:"cursor-pointer pulse",onClick:function(){return c("base64","")},children:e.jsx(_,{className:"w-5 h-5 text-red-500"})})}),e.jsx(D,{base64:l.base64})]}),f=e.jsxs("div",{children:[e.jsx("p",{className:"pb-2",children:n.note_midia_desc}),!l.base64||((a=l.base64)===null||a===void 0?void 0:a.length)===0?p:u]});return f}function L(d){var a=d.id,r=j().language,n=g().getContainer,s=n(a)(),o=s.renderView,l=s.viwerModel,c=s.setRenderView,m=s.note,x=s.setNote,p=s.userID,u=N(),f=u.createNote,t=u.editNote;C.useEffect(function(){return o==="create"&&n(a).setState({note:{id:Date.now(),userID:p,text:"",base64:""}}),function(){n(a).setState({note:{id:NaN,userID:"",text:"",base64:""}})}},[]);var i=e.jsxs("div",{className:(l==="modal"?"w-[600px]":"p-2")+" grid gap-4",children:[l==="modal"?e.jsx(b,{children:o==="create"?r.note_title:r.editarAnotacao}):e.jsx("div",{className:"text-center",children:e.jsx(w,{weight:"600",children:o==="create"?r.note_title:r.editarAnotacao})}),e.jsx(M,{id:a}),e.jsxs("div",{className:"mt-3",children:[e.jsx("p",{className:"pb-2",children:r.note_insert_desc}),e.jsx(y,{id:a,type:"textarea",className:"w-full",position:"right",placeholder:r.note_place,text:m.text,setText:function(v){return x("text",v)},heightCamp:110})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx(h,{name:r.cancel,funcao:function(){return c("list")}}),e.jsx(h,{name:r.save,funcao:function(){return o==="create"?f(a):t(a)}})]})]});return i}export{L as default};
