import{j as e,_ as h,U as v,ah as j,Q as y,ai as f,a1 as _,I as N,aj as w,ak as k}from"./v_7_4_2_9_8cb79d4f-81e0-49c1-b597-7f2344477fbf10.js";import{u as C}from"./v_7_4_2_9_8cb79d4f-81e0-49c1-b597-7f2344477fbf19.js";import{a as M,u as L,b as T}from"./v_7_4_2_9_8cb79d4f-81e0-49c1-b597-7f2344477fbf33.js";import{a as c}from"./v_7_4_2_9_8cb79d4f-81e0-49c1-b597-7f2344477fbf4.js";import{c as I}from"./v_7_4_2_9_8cb79d4f-81e0-49c1-b597-7f2344477fbf8.js";import"./v_7_4_2_9_8cb79d4f-81e0-49c1-b597-7f2344477fbf18.js";import"./v_7_4_2_9_8cb79d4f-81e0-49c1-b597-7f2344477fbf6.js";import"./v_7_4_2_9_8cb79d4f-81e0-49c1-b597-7f2344477fbf7.js";import"./v_7_4_2_9_8cb79d4f-81e0-49c1-b597-7f2344477fbf.js";import"./v_7_4_2_9_8cb79d4f-81e0-49c1-b597-7f2344477fbf5.js";const z=c.lazy(() => __vitePreload(()=>import(chrome.runtime.getURL("content/assets/js/v_7_4_2_9_8cb79d4f-81e0-49c1-b597-7f2344477fbf118.js")),[]));function D({base64:t}){return e.jsx(c.Suspense,{fallback:e.jsx(e.Fragment,{}),children:e.jsx(z,{base64:t})})}const R=({base64:t})=>{const s=t.split(";")[0].split(":")[1].split("/")[0];return e.jsx(k,{type:s!=="image"&&s!=="video"&&s!=="audio"?"doc":s,style:"w-4 h-4 text-[var(--icon)]"})};function A({id:t}){const{language:s}=C(),{getNotes:i,deleteNote:p}=M(),{getContainer:o}=L(),{userID:l,viwerModel:r,setRenderView:d}=o(t)(),{open:b}=T.useModalOptions(),n=["video","image","audio"],g=a=>{N({type:"Success",message:s.note_copy,position:"top-right"}),w(a)},m=a=>{d("edit"),o(t).setState({note:a})},x=e.jsx("div",{className:(r==="modal"?"my-4":"")+" flex flex-col gap-4 overflow-auto p-2",style:{maxHeight:"calc(100vh - 167px)"},children:i(l).map(a=>e.jsx("div",{className:"card shadow-sm bg-[var(--background-default-active)]",children:e.jsxs("div",{className:"card-body px-4 pt-2 pb-4",children:[e.jsxs("h2",{className:"card-title text-base",children:[v.MillisToFormattedDate(a.id),a.base64&&a.base64.length!==0&&e.jsx(R,{base64:a.base64})]}),e.jsx("p",{dangerouslySetInnerHTML:{__html:a.text.replace(/\*\_(.*?)\_\*/g,'<strong class="italic">$1</strong>').replace(/\*(.*?)\*/g,"<strong>$1</strong>").replace(/\n/g,"<br>")}}),e.jsxs("div",{className:"flex flex-wrap justify-end gap-2",children:[a.text&&a.text.length!==0&&e.jsx("div",{role:"button",className:"badge badge-outline border-solid pulse badge-success hover:!bg-[oklch(var(--su))] hover:!text-[var(--letra)]",onClick:()=>g(a.text),children:s.copiar}),e.jsx("div",{role:"button",className:"badge badge-outline border-solid pulse badge-warning hover:bg-warning hover:!text-[var(--letra)]",onClick:()=>m(a),children:s.edit}),e.jsx("div",{role:"button",className:"badge badge-outline border-solid pulse badge-error hover:bg-error hover:!text-[var(--letra)]",onClick:()=>p(a.id),children:s.Deletar}),a.base64&&a.base64.length!==0&&n.includes(a.base64.split(";")[0].split(":")[1].split("/")[0])&&e.jsx("div",{role:"button",className:"badge badge-outline border-solid pulse badge-primary hover:!bg-[oklch(var(--p))] hover:!text-[var(--letra)]",onClick:u=>b(e.jsx(D,{base64:a.base64}),{placement:"left-end"},u.target),children:s.visualizarMidia}),a.base64&&a.base64.length!==0&&!n.includes(a.base64.split(";")[0].split(":")[1].split("/")[0])&&e.jsx("div",{role:"button",className:"badge badge-outline border-solid pulse badge-primary hover:!bg-[oklch(var(--p))] hover:!text-[var(--letra)]",onClick:()=>j(a.base64,Date.now().toString()),children:s.baixar})]})]})}))});return e.jsxs("div",{className:r==="modal"?"w-[800px]":"",children:[r==="modal"&&e.jsx(y,{children:s.note_list_title}),i(l).length===0?e.jsx(f,{title:s.note_empty_title,description:s.note_empty_desc,icon:e.jsx(I,{size:28,className:"text-[var(--primaria)]"})}):x,e.jsx("div",{className:"flex justify-center mt-1",children:e.jsx(_,{name:s.note_create,funcao:()=>d("create")})})]})}export{A as default};
