import{D as _}from"./constants-CXMxJR4j.js";import{a2 as l,a3 as w,$ as e,c as E,a4 as N,w as V,_ as C}from"./index-CxiRlsCY.js";import{s as T}from"./vueuse-DIaEWNCo.js";import{u as D}from"./vue-router-BgJK_hRC.js";import{E as q}from"./EditConfig-CHstsLqU.js";import{d as A,a as B,l as L,L as M}from"./vuetify-RelkxOq-.js";import{d as O,r as f,o as R,b as x,e as g,H as r,D as G,I as $,E as d,f as i,$ as F,a1 as y,u as v}from"./lucide-C2DU1LFb.js";import"./qrcode-DSFhiIp2.js";import"./marked-C0Rlrcoy.js";import"./color-BTziYnFN.js";import"./vue-i18n-DySrp6mW.js";/* empty css            */import"./swiper-Jy9GbtzK.js";import"./index-DV1JBmju.js";import"./utils-CDN07tui.js";import"./reka-ui-GpbaI08z.js";import"./index-B_jtOnfb.js";const P={class:"frontend-config"},U={class:"header-content"},z={class:"header-icon"},j={class:"header-info"},H={class:"header-title"},K={class:"header-description"},J=O({__name:"FrontendConfig",setup(Q){const b=D(),u=f([]),c=f(!1),p=T();R(()=>{const t=localStorage.getItem("frontend.settings.menu_items"),a=t?t.split(","):_,o=localStorage.getItem("frontend.settings.theme")||"auto";p.value=o;const s=[{key:"theme",type:l.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:o},{key:"language",type:l.STRING,label:"language",default_value:"auto",required:!1,options:[{title:"auto",value:"auto"},...w.global.availableLocales.map(n=>({title:n,value:n}))],multi_value:!1,category:"generic",value:localStorage.getItem("frontend.settings.language")},{key:"menu_items",type:l.STRING,label:"menu_items",default_value:_,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:a},{key:"force_mobile_layout",type:l.BOOLEAN,label:"force_mobile_layout",default_value:!1,required:!1,multi_value:!1,category:"generic",value:localStorage.getItem("frontend.settings.force_mobile_layout")==="true"}];if(E.getProvider("sendspin")?.available??!1){s.splice(3,0,{key:"web_player_mode",type:l.STRING,label:"web_player_mode",default_value:"sendspin",required:!1,options:[{title:e("settings.web_player_mode.options.sendspin"),value:"sendspin"},{title:e("settings.web_player_mode.options.disabled"),value:"disabled"}],multi_value:!1,category:"web_player",value:localStorage.getItem("frontend.settings.web_player_mode")||"sendspin"});const n=N();s.splice(4,0,{key:"sendspin_sync_delay",type:l.INTEGER,label:"sendspin_sync_delay",default_value:n,required:!1,multi_value:!1,category:"web_player",value:parseInt(localStorage.getItem("frontend.settings.sendspin_sync_delay")||String(n),10),range:[-1e3,1e3],immediate_apply:!0});const m=localStorage.getItem("frontend.settings.sendspin_output_latency_compensation");s.splice(5,0,{key:"sendspin_output_latency_compensation",type:l.BOOLEAN,label:"sendspin_output_latency_compensation",default_value:!0,required:!1,multi_value:!1,category:"web_player",value:m!==null?m==="true":!0})}u.value=s});const h=function(t){for(const a in t){const o=`frontend.settings.${a}`,s=t[a];s!=null?(localStorage.setItem(o,s.toString()),a==="theme"&&(p.value=s.toString())):localStorage.removeItem(o)}b.push({name:"home"}).then(()=>{window.location.reload()})},S=function(t){h(t)},I=async function(t,a){},k=function(t){for(const a in t)localStorage.setItem(`frontend.settings.${a}`,String(t[a]));"sendspin_sync_delay"in t&&V.setSyncDelay(t.sendspin_sync_delay)};return(t,a)=>(g(),x("section",P,[r(B,{class:"header-card mb-4",elevation:"0"},{default:d(()=>[i("div",U,[i("div",z,[r(A,{size:"32",color:"orange"},{default:d(()=>[...a[1]||(a[1]=[F("mdi-palette",-1)])]),_:1})]),i("div",j,[i("h2",H,y(v(e)("settings.frontend")),1),i("p",K,y(v(e)("settings.frontend_description")),1)])])]),_:1}),u.value.length>0?(g(),G(q,{key:0,"config-entries":u.value,disabled:!1,onSubmit:S,onAction:I,onImmediateApply:k},null,8,["config-entries"])):$("",!0),r(M,{modelValue:c.value,"onUpdate:modelValue":a[0]||(a[0]=o=>c.value=o),scrim:"true",persistent:"",style:{display:"flex","align-items":"center","justify-content":"center"}},{default:d(()=>[r(L,{indeterminate:"",size:"64",color:"primary"})]),_:1},8,["modelValue"])]))}}),_e=C(J,[["__scopeId","data-v-4f14f3c8"]]);export{_e as default};
