import{Q as S,x as m,o as k,ca as o,cb as h,a8 as e,Z as I,B as s,U as i,bD as V,bg as N,S as g,ao as d,ab as c,a0 as f,W as p,R as C,a9 as E,a_ as T,Y as x,bE as B}from"./index-Bduq4vJM.js";import{E as q}from"./EditConfig-CEDj8nuH.js";import{D as v}from"./constants-BXWEQHoz.js";import{V as R}from"./VToolbar-CG7bivmQ.js";import{b as w}from"./VBtn-DWiYTBpb.js";import"./VForm-Cm4j-rit.js";import"./VCheckboxBtn-DLibXb0-.js";import"./VExpansionPanels-CUuvVvLb.js";import"./VAlert-BjDi0iTj.js";import"./VSwitch-7T-ZmqqN.js";import"./VTextField-lpT7m_Xn.js";import"./VVirtualScroll-VdTkqEkN.js";import"./VSlider-ZsJroA_b.js";import"./VDialog-B3s_EL-H.js";import"./VSpacer-BnmXZ56R.js";/* empty css              */import"./_plugin-vue_export-helper-DlAUqK2U.js";const J=S({__name:"FrontendConfig",setup(D){const y=B(),r=m([]),n=m(!1);k(()=>{const a=localStorage.getItem("frontend.settings.menu_items"),t=a?a.split(","):v;r.value=[{key:"theme",type:o.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:o.STRING,label:"language",default_value:"auto",required:!1,options:[{title:"auto",value:"auto"},...h.global.availableLocales.map(l=>({title:l,value:l}))],multi_value:!1,category:"generic",value:localStorage.getItem("frontend.settings.language")},{key:"menu_style",type:o.STRING,label:"menu_style",default_value:"horizontal",required:!1,options:[{title:"horizontal",value:"horizontal"},{title:"vertical",value:"vertical"}],multi_value:!1,category:"generic",value:localStorage.getItem("frontend.settings.menu_style")},{key:"menu_items",type:o.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:"hide_settings",type:o.BOOLEAN,label:"hide_settings",default_value:!1,required:!1,multi_value:!1,category:"advanced",value:localStorage.getItem("frontend.settings.hide_settings")=="true"},{key:"enable_builtin_player",type:o.BOOLEAN,label:"enable_builtin_player",default_value:!0,required:!0,multi_value:!1,category:"generic",value:localStorage.getItem("frontend.settings.enable_builtin_player")!="false"}]});const _=async function(a){for(const t in a){const l=`frontend.settings.${t}`,u=a[t];u!=null?localStorage.setItem(l,u.toString()):localStorage.removeItem(l)}y.push({name:"home"}).then(()=>{window.location.reload()})},b=async function(a,t){};return(a,t)=>(g(),I("section",null,[s(R,{color:"transparent"},{title:i(()=>[d(c(f(e)("settings.frontend")),1)]),_:1}),s(V,{style:{"margin-left":"-5px","margin-right":"-5px"}},{default:i(()=>[s(T,null,{default:i(()=>[d(c(f(e)("settings.frontend_desc")),1)]),_:1}),t[1]||(t[1]=p("br",null,null,-1)),t[2]||(t[2]=p("br",null,null,-1)),s(x),r.value?(g(),C(q,{key:0,"config-entries":r.value,disabled:!1,onSubmit:_,onAction:b},null,8,["config-entries"])):E("",!0)]),_:1}),s(N,{modelValue:n.value,"onUpdate:modelValue":t[0]||(t[0]=l=>n.value=l),scrim:"true",persistent:"",style:{display:"flex","align-items":"center","justify-content":"center"}},{default:i(()=>[s(w,{indeterminate:"",size:"64",color:"primary"})]),_:1},8,["modelValue"])]))}});export{J as default};
