import{j as t,y as j,H as g,bi as N,J as S,Q as p,I as u}from"./v_7_4_1_21_73d2acb1-b7f3-47a2-a8fe-3772b225080910.js";import{a as b}from"./v_7_4_1_21_73d2acb1-b7f3-47a2-a8fe-3772b22508094.js";import{o as C,ai as w,ab as r,a2 as y}from"./v_7_4_1_21_73d2acb1-b7f3-47a2-a8fe-3772b225080923.js";import{u as _}from"./v_7_4_1_21_73d2acb1-b7f3-47a2-a8fe-3772b225080919.js";import{W as d}from"./v_7_4_1_21_73d2acb1-b7f3-47a2-a8fe-3772b225080918.js";import"./v_7_4_1_21_73d2acb1-b7f3-47a2-a8fe-3772b22508098.js";import"./v_7_4_1_21_73d2acb1-b7f3-47a2-a8fe-3772b2250809.js";import"./v_7_4_1_21_73d2acb1-b7f3-47a2-a8fe-3772b22508095.js";import"./v_7_4_1_21_73d2acb1-b7f3-47a2-a8fe-3772b22508097.js";import"./v_7_4_1_21_73d2acb1-b7f3-47a2-a8fe-3772b22508096.js";import"./v_7_4_1_21_73d2acb1-b7f3-47a2-a8fe-3772b22508092.js";import"./v_7_4_1_21_73d2acb1-b7f3-47a2-a8fe-3772b22508093.js";import"./v_7_4_1_21_73d2acb1-b7f3-47a2-a8fe-3772b22508099.js";function F(){const{language:e}=_(),{close:c}=C(),{contatos:l,setContatos:m}=w(),{setAutoSaveChatName:x,chatName:a}=r(),[n,h]=b.useState(a.name),f=async()=>{if(await y("contatos")===!0)return;const s=l.filter(i=>i.id!==a.number),o={id:a.number,name:n};s.push(o),d.Utils("contatoSave",o),chrome.runtime.sendMessage({action:"contatoSave",dados:o}),r.setState({chatName:{...a,name:n,number:a.number}}),m(s),c(),u({type:"Success",message:e.contatosNotifiSave,position:"top-right"})},v=async()=>{const s=l.filter(i=>i.id!==a.number),o={id:a.number,name:a.number};d.Utils("contatoSave",o),chrome.runtime.sendMessage({action:"contatoSave",dados:o}),r.setState({chatName:{...a,name:a.number,number:a.number}}),m(s),c(),u({type:"Success",message:e.contatosNotifiRM,position:"top-right"})};return t.jsxs("div",{className:"w-[450px] grid gap-4",children:[t.jsx("div",{className:"flex gap-4",children:t.jsx(j,{children:e.contatos_title})}),t.jsx(g,{children:e.contatos_text}),t.jsxs("div",{className:"form-control w-full",children:[t.jsx("label",{className:"label",children:t.jsx("span",{className:"label-text",children:e.contatos_textInp})}),t.jsx("input",{type:"text",value:n,onChange:s=>h(s.target.value),placeholder:e.contatos_placeInp,className:"input input-bordered w-full input-sm"})]}),t.jsxs("div",{className:"flex justify-between cursor-pointer items-center h-9 px-1 py-2 rounded",children:[t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsxs("span",{children:[e.contatos_autoSave," "]}),t.jsx("span",{className:"lg:tooltip lg:tooltip-top","data-tip":e.contatos_info,children:t.jsx(N,{className:"h-5 w-5"})})]}),t.jsx(S,{estado:a.autoSave,switchUpdate:()=>x(!a.autoSave),id:"autoSave"})]}),t.jsxs("div",{className:"flex justify-around",children:[t.jsx(p,{name:e.contatos_rm,funcao:v}),t.jsx(p,{name:e.contatos_save,funcao:f})]})]})}export{F as default};
