import{j as e,V as g,$ as v,a2 as u}from"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab710.js";import{u as f}from"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab719.js";import{u as h,a as N}from"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab733.js";import{C as b}from"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab7115.js";import{a as w}from"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab7108.js";import"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab747.js";import{E as y}from"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab7116.js";import{a as k}from"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab74.js";import"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab718.js";import"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab76.js";import"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab78.js";import"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab7.js";import"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab75.js";import"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab77.js";import"./v_7_4_2_13_59773d94-6a68-4ed1-8b86-dcf9791b0ab79.js";const _=({base64:t})=>{let s;switch(t.split(";")[0].split(":")[1].split("/")[0]){case"image":s=e.jsx("img",{src:t,className:"w-[150px] max-h-[180px]"});break;case"video":s=e.jsx("video",{src:t,className:"w-[150px] max-h-[180px]",controls:!0});break;case"audio":s=e.jsx("audio",{src:t,className:"w-full",controls:!0});break;default:s=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 s};function C({id:t}){var c;const{language:s}=f(),{getContainer:o}=h(),{note:r,setNote:n}=o(t)(),l=a=>{const i=new FileReader;i.onloadend=function(){const j=i.result;n("base64",j)},i.readAsDataURL(a)},d=a=>{a.preventDefault();const i=a.dataTransfer.files[0];i&&l(i)},m=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(b,{className:"h-6 w-6 text-[var(--primaria)]",strokeWidth:1}),e.jsx("strong",{className:"text-[var(--primaria)]",children:s.importar}),e.jsx("input",{type:"file",className:"hidden",onChange:a=>l(a.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:d,onDragOver:a=>a.preventDefault(),children:s.arrasteOArquivoAqui})]}),x=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:()=>n("base64",""),children:e.jsx(w,{className:"w-5 h-5 text-red-500"})})}),e.jsx(_,{base64:r.base64})]});return e.jsxs("div",{children:[e.jsx("p",{className:"pb-2",children:s.note_midia_desc}),!r.base64||((c=r.base64)==null?void 0:c.length)===0?m:x]})}function H({id:t}){const{language:s}=f(),{getContainer:o}=h(),{renderView:r,viwerModel:n,setRenderView:l,note:d,setNote:m,userID:x}=o(t)(),{createNote:p,editNote:c}=N();return k.useEffect(()=>(r==="create"&&o(t).setState({note:{id:Date.now(),userID:x,text:"",base64:""}}),()=>{o(t).setState({note:{id:NaN,userID:"",text:"",base64:""}})}),[]),e.jsxs("div",{className:(n==="modal"?"w-[600px]":"p-2")+" grid gap-4",children:[n==="modal"?e.jsx(g,{children:r==="create"?s.note_title:s.editarAnotacao}):e.jsx("div",{className:"text-center",children:e.jsx(v,{weight:"600",children:r==="create"?s.note_title:s.editarAnotacao})}),e.jsx(C,{id:t}),e.jsxs("div",{className:"mt-3",children:[e.jsx("p",{className:"pb-2",children:s.note_insert_desc}),e.jsx(y,{id:t,type:"textarea",className:"w-full",position:"right",placeholder:s.note_place,text:d.text,setText:i=>m("text",i),heightCamp:110})]}),e.jsxs("div",{className:"flex justify-between",children:[e.jsx(u,{name:s.cancel,funcao:()=>l("list")}),e.jsx(u,{name:s.save,funcao:()=>r==="create"?p(t):c(t)})]})]})}export{H as default};
