import{j as e}from"./v_7_4_3_73_d3c9bac7-c74e-47f6-ac42-499f067843a53.js";import{u as m,e as u,q as h,V as x}from"./v_7_4_3_73_d3c9bac7-c74e-47f6-ac42-499f067843a54.js";import{a as g}from"./v_7_4_3_73_d3c9bac7-c74e-47f6-ac42-499f067843a534.js";import{D as f,bc as j,E as a,bi as v,bd as b,b1 as w,H as k,I as p}from"./v_7_4_3_73_d3c9bac7-c74e-47f6-ac42-499f067843a58.js";import"./v_7_4_3_73_d3c9bac7-c74e-47f6-ac42-499f067843a52.js";import"./v_7_4_3_73_d3c9bac7-c74e-47f6-ac42-499f067843a55.js";import{u as y}from"./v_7_4_3_73_d3c9bac7-c74e-47f6-ac42-499f067843a556.js";import"./v_7_4_3_73_d3c9bac7-c74e-47f6-ac42-499f067843a56.js";import"./v_7_4_3_73_d3c9bac7-c74e-47f6-ac42-499f067843a5.js";import"./v_7_4_3_73_d3c9bac7-c74e-47f6-ac42-499f067843a537.js";import"./v_7_4_3_73_d3c9bac7-c74e-47f6-ac42-499f067843a525.js";import"./v_7_4_3_73_d3c9bac7-c74e-47f6-ac42-499f067843a59.js";import"./v_7_4_3_73_d3c9bac7-c74e-47f6-ac42-499f067843a510.js";import"./v_7_4_3_73_d3c9bac7-c74e-47f6-ac42-499f067843a57.js";import"./v_7_4_3_73_d3c9bac7-c74e-47f6-ac42-499f067843a520.js";import"./v_7_4_3_73_d3c9bac7-c74e-47f6-ac42-499f067843a543.js";function U(){const{language:t}=m(),{active:n,toggleSwitch:l,token:o,getToken:c}=g(),{tutorial_api:r}=u(y(i=>({tutorial_api:i.getUrl("tutoriais","api")}))),d=()=>{const i=x.webSocket["api-whatsapp"]+"/api-docs";window.open(`https://www.relaccion.com/relaccion-lite-plus/api-doc`,"_blank")},s=()=>{o?(h(o),p({type:"Success",message:t.tokenCopied,position:"top-right"})):p({type:"Error",message:t.tokenIsEmpty,position:"top-right"})};return e.jsxs("div",{className:"grid gap-6 !w-[550px]",children:[e.jsxs("div",{className:"pb-2",children:[e.jsxs("div",{className:"flex gap-3 items-center",children:[e.jsx(f,{children:t.configAPI}),r.active&&e.jsx(j,{funcao:()=>window.open(r.link,"_blank")})]}),e.jsx(a,{children:t.ApiDesc})]}),e.jsxs("div",{className:"w-full flex gap-1 items-center",style:{maxHeight:"2rem"},children:[e.jsx("div",{className:"!w-4/5 lg:tooltip lg:tooltip-top cursor-pointer","data-tip":"Clique para copiar o token",onClick:()=>s(),children:e.jsx("input",{type:"text",placeholder:t.APIinputPlace,value:o,className:"input input-bordered !w-full input-sm pointer-events-none",readOnly:!0})}),e.jsxs("div",{onClick:()=>c(),className:"flex items-center justify-center gap-0.5 h-full text-sm w-min whitespace-nowrap px-2 border border-[var(--primaria)] border-solid rounded-lg pulse hover:text-[var(--primaria)] cursor-pointer",children:[e.jsx("p",{children:t.APIGerarToken}),e.jsx(v,{})]}),e.jsx("div",{onClick:()=>s(),className:"p-2 lg:tooltip lg:tooltip-left gap-0.5 h-full text-sm border border-[var(--primaria)] border-solid rounded-lg pulse hover:text-[var(--primaria)] cursor-pointer","data-tip":"Copiar Token",children:e.jsx(b,{})})]}),e.jsxs("div",{children:[e.jsxs("label",{htmlFor:"toggle",className:"flex justify-between cursor-pointer mb-1.5 items-center hover:bg-[var(--dropdown-background-hover)] h-9 px-1 py-2 rounded",children:[e.jsx(a,{children:t.APISwitch}),e.jsx(w,{estado:n,switchUpdate:()=>l(),id:"toggle"})]}),e.jsx("div",{className:"flex",children:e.jsx(k,{name:t.APIOpenDoc,funcao:d})})]})]})}export{U as default};
