import{u as k,r as o,m as t,aw as f,ax as h,ay as u,n as E,o as x,az as S,aA as O,H as K,$ as Y,aB as H,aC as L,aD as M,aE as y,aF as F,aG as R,aH as W,j as a,M as G,N as U,a5 as N}from"./index-KAtljJVt.js";import{C as r}from"./CheckboxField-DhE3iyQ3.js";import{N as b}from"./NumberField-CpqFpk71.js";import"./envs-CSqIi4cL.js";function J(){const{t:s}=k(["settings","navbar","network","common"]),[i,p]=o.useState(t.get(f,254)),[l,g]=o.useState(t.get(h,3)),[m,C]=o.useState(t.get(u,!1)),[c,T]=o.useState(t.get(E,!0)),[_,w]=o.useState(t.get(x,!0)),[d,v]=o.useState(t.get(S,!0));o.useEffect(()=>{t.set(f,i)},[i]),o.useEffect(()=>{t.set(h,l)},[l]),o.useEffect(()=>{t.set(u,m)},[m]),o.useEffect(()=>{t.set(E,c)},[c]),o.useEffect(()=>{t.set(x,_)},[_]),o.useEffect(()=>{t.set(S,d)},[d]);const A=o.useCallback(()=>{const e=t.keys();t.remove(O),t.remove(f),t.remove(h),t.remove(u),t.remove(K),t.remove(E),t.remove(x),t.remove(Y),t.remove(H),t.remove(S),t.remove(L);for(const n of e)(n.startsWith(M)||n.startsWith(y)||n.startsWith(F))&&t.remove(n);window.location.reload()},[]),I=o.useCallback(()=>{const e=t.keys();for(const n of e)(n.startsWith(R)||n.startsWith(W))&&t.remove(n);window.location.reload()},[]),j=o.useCallback(()=>{t.clearAll(),window.location.reload()},[]);return a.jsxs(a.Fragment,{children:[a.jsx(U,{children:a.jsxs("div",{className:"flex flex-row flex-wrap flex-1 gap-1.5",children:[a.jsx(N,{className:"btn btn-sm btn-outline btn-error tooltip-bottom",onClick:A,title:s(e=>e.reset_settings),modalDescription:s(e=>e.dialog_confirmation_prompt,{ns:"common"}),modalCancelLabel:s(e=>e.cancel,{ns:"common"}),children:s(e=>e.reset_settings)}),a.jsx(N,{className:"btn btn-sm btn-outline btn-error tooltip-bottom",onClick:I,title:s(e=>e.reset_auth),modalDescription:s(e=>e.dialog_confirmation_prompt,{ns:"common"}),modalCancelLabel:s(e=>e.cancel,{ns:"common"}),children:s(e=>e.reset_auth)}),a.jsx(N,{className:"btn btn-sm btn-outline btn-error tooltip-bottom",onClick:j,title:s(e=>e.reset_all),modalDescription:s(e=>e.dialog_confirmation_prompt,{ns:"common"}),modalCancelLabel:s(e=>e.cancel,{ns:"common"}),children:s(e=>e.reset_all)})]})}),a.jsx("div",{className:"alert alert-info alert-vertical sm:alert-horizontal",children:s(e=>e.frontend_notice)}),a.jsxs("div",{className:"flex flex-row flex-wrap gap-4 mt-3",children:[a.jsx(b,{type:"number",name:"permit_join_time",label:s(e=>e.permit_join_time),min:10,max:254,required:!0,minimal:!0,initialValue:i,onSubmit:(e,n)=>n&&e!==""&&p(e)}),a.jsx(b,{type:"number",name:"max_on_screen_notifications",label:s(e=>e.max_on_screen_notifications),min:1,max:5,required:!0,minimal:!0,initialValue:l,onSubmit:(e,n)=>n&&e!==""&&g(e)}),a.jsx(r,{name:"hide_static_info_alerts",label:s(e=>e.hide_static_info_alerts,{ns:"common"}),onChange:e=>C(e.target.checked),defaultChecked:m})]}),a.jsx("h2",{className:"text-lg mt-2",children:s(e=>e.home,{ns:"navbar"})}),a.jsxs("div",{className:"flex flex-row flex-wrap gap-4",children:[a.jsx(r,{name:"show_activity",label:`${s(e=>e.show,{ns:"common"})}: ${s(e=>e.activity,{ns:"navbar"})}`,onChange:e=>T(e.target.checked),defaultChecked:c}),a.jsx(r,{name:"show_group_scenes",label:`${s(e=>e.show,{ns:"common"})}: ${s(e=>e.group_scenes,{ns:"common"})}`,onChange:e=>w(e.target.checked),defaultChecked:_})]}),G&&a.jsxs(a.Fragment,{children:[a.jsx("h2",{className:"text-lg mt-2",children:s(e=>e.multi_instance,{ns:"common"})}),a.jsx("div",{className:"flex flex-row flex-wrap gap-4",children:a.jsx(r,{name:"show_source_name",label:s(e=>e.show_source_name,{ns:"common"}),onChange:e=>v(e.target.checked),defaultChecked:d})})]})]})}export{J as default};
