import{db as j,j as e,dg as N,X as b,a1 as w,dh as y,a4 as h}from"./v_7_4_2_16_364f475f-21c1-4d89-bf17-70efc8c405b710.js";import{u as g}from"./v_7_4_2_16_364f475f-21c1-4d89-bf17-70efc8c405b719.js";import{C as k}from"./v_7_4_2_16_364f475f-21c1-4d89-bf17-70efc8c405b7113.js";import{a as _}from"./v_7_4_2_16_364f475f-21c1-4d89-bf17-70efc8c405b7106.js";import{a as C}from"./v_7_4_2_16_364f475f-21c1-4d89-bf17-70efc8c405b74.js";import"./v_7_4_2_16_364f475f-21c1-4d89-bf17-70efc8c405b718.js";import"./v_7_4_2_16_364f475f-21c1-4d89-bf17-70efc8c405b76.js";import"./v_7_4_2_16_364f475f-21c1-4d89-bf17-70efc8c405b78.js";import"./v_7_4_2_16_364f475f-21c1-4d89-bf17-70efc8c405b7.js";import"./v_7_4_2_16_364f475f-21c1-4d89-bf17-70efc8c405b75.js";import"./v_7_4_2_16_364f475f-21c1-4d89-bf17-70efc8c405b77.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=g().language,s=j().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 S(d){var a=d.id,r=g().language,n=j().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{S as default};
