import{aw as k,J as c,a3 as S,cD as n,cE as V,aR as e,aN as C,ax as E,ay as m,o,aD as i,bf as f,aL as g,aB as d,E as p,aG as I,az as N,bg as T,aS as h,c1 as B,b6 as w,bv as x,aC as D}from"./index-BeguICWm.js";import{E as R}from"./EditConfig-BikzkWGK.js";import{D as v}from"./constants-CXMxJR4j.js";import{V as q}from"./VToolbar-DZP2Ylkv.js";import"./VForm-o34xemXk.js";import"./VExpansionPanels-B8yzmmSz.js";import"./VDialog-3N5CnNiB.js";import"./VAlert-Dkia6PbV.js";import"./VSwitch-DhgrqvI4.js";import"./VCheckboxBtn-HpD-UT_z.js";import"./VSlider-5AtOwDvY.js";import"./VSelect-Be4aEu8s.js";import"./VVirtualScroll-Vx_hX6dw.js";const Q=k({__name:"FrontendConfig",setup(L){const y=D(),r=c([]),u=c(!1);S(()=>{const a=localStorage.getItem("frontend.settings.menu_items"),t=a?a.split(","):v,l=[{key:"theme",type:n.STRING,label:"theme",default_value:"auto",required:!1,options:[{title:"auto",value:"auto"},{title:"dark",value:"dark"},{title:"light",value:"light"}],multi_value:!1,category:"generic",value:localStorage.getItem("frontend.settings.theme")},{key:"language",type:n.STRING,label:"language",default_value:"auto",required:!1,options:[{title:"auto",value:"auto"},...V.global.availableLocales.map(s=>({title:s,value:s}))],multi_value:!1,category:"generic",value:localStorage.getItem("frontend.settings.language")},{key:"menu_items",type:n.STRING,label:"menu_items",default_value:v,required:!1,options:[{title:e("home"),value:"home"},{title:e("search"),value:"search"},{title:e("artists"),value:"artists"},{title:e("albums"),value:"albums"},{title:e("tracks"),value:"tracks"},{title:e("playlists"),value:"playlists"},{title:e("audiobooks"),value:"audiobooks"},{title:e("podcasts"),value:"podcasts"},{title:e("radios"),value:"radios"},{title:e("browse"),value:"browse"},{title:e("settings.settings"),value:"settings"}],multi_value:!0,category:"generic",value:t},{key:"force_mobile_layout",type:n.BOOLEAN,label:"force_mobile_layout",default_value:!1,required:!1,multi_value:!1,category:"generic",value:localStorage.getItem("frontend.settings.force_mobile_layout")==="true"}];C.isRemoteConnection.value||l.splice(3,0,{key:"enable_builtin_player",type:n.BOOLEAN,label:"enable_builtin_player",default_value:!0,required:!0,multi_value:!1,category:"generic",value:localStorage.getItem("frontend.settings.enable_builtin_player")!="false"}),r.value=l});const _=async function(a){for(const t in a){const l=`frontend.settings.${t}`,s=a[t];s!=null?localStorage.setItem(l,s.toString()):localStorage.removeItem(l)}y.push({name:"home"}).then(()=>{window.location.reload()})},b=async function(a,t){};return(a,t)=>(m(),E("section",null,[o(q,{color:"transparent"},{title:i(()=>[f(g(d(e)("settings.frontend")),1)]),_:1}),o(B,null,{default:i(()=>[o(T,null,{default:i(()=>[f(g(d(e)("settings.frontend_desc")),1)]),_:1}),t[1]||(t[1]=p("br",null,null,-1)),t[2]||(t[2]=p("br",null,null,-1)),o(h),r.value?(m(),I(R,{key:0,"config-entries":r.value,disabled:!1,onSubmit:_,onAction:b},null,8,["config-entries"])):N("",!0)]),_:1}),o(x,{modelValue:u.value,"onUpdate:modelValue":t[0]||(t[0]=l=>u.value=l),scrim:"true",persistent:"",style:{display:"flex","align-items":"center","justify-content":"center"}},{default:i(()=>[o(w,{indeterminate:"",size:"64",color:"primary"})]),_:1},8,["modelValue"])]))}});export{Q as default};
