import{F as B}from"./range-DMwB57B3.js";import{C as s,aA as C,b as n,M as k,j as w,bd as F,d as M}from"./app-QjDgb7aF.js";import{F as j}from"./section-Dbg05qO2.js";import{b as $,a as D,ab as N,j as f,p as b,k as p,i as l,J as r,D as d,u as i,q as _,F as S,G as A,g as G,f as L}from"./vue-Cm77DuTi.js";import"./charts-3gEHPHRq.js";import"./media-DuCIZ-3n.js";const O={class:"_formRoot"},R={class:"_formLinksGrid"},z=$({__name:"sounds",async setup(T){let m,v;const g=L({get:()=>s.get("sound_masterVolume"),set:t=>{s.set("sound_masterVolume",t)}}),a=D({note:s.get("sound_note"),noteMy:s.get("sound_noteMy"),notification:s.get("sound_notification"),chat:s.get("sound_chat"),chatBg:s.get("sound_chatBg"),antenna:s.get("sound_antenna"),channel:s.get("sound_channel")}),y=([m,v]=N(()=>M("get-sounds")),m=await m,v(),m);async function x(t){const{canceled:e,result:o}=await w(n.t("_sfx."+t),{type:{type:"enum",enum:y.map(u=>({value:u,label:u??n.ts.none})),label:n.ts.sound,default:a.value[t].type},volume:{type:"range",min:0,max:1,step:.05,textConverter:u=>`${Math.floor(u*100)}%`,label:n.ts.volume,default:a.value[t].volume},listen:{type:"button",content:n.ts.listen,action:(u,h)=>{F(h.type,h.volume)}}});if(e)return;const c={type:o.type,volume:o.volume};s.set("sound_"+t,c),a.value[t]=c}function V(){for(const t of Object.keys(a.value)){const e=s.default["sound_"+t];s.set("sound_"+t,e),a.value[t]=e}}return C({title:n.ts.sounds,icon:"ph-speaker-high ph-bold ph-lg"}),(t,e)=>(f(),b("div",O,[p(B,{modelValue:g.value,"onUpdate:modelValue":e[0]||(e[0]=o=>g.value=o),min:0,max:1,step:.05,"text-converter":o=>`${Math.floor(o*100)}%`,class:"_formBlock"},{label:l(()=>[r(d(i(n).ts.masterVolume),1)]),_:1},8,["modelValue","text-converter"]),p(j,null,{label:l(()=>[r(d(i(n).ts.sounds),1)]),default:l(()=>[_("div",R,[(f(!0),b(S,null,A(Object.keys(a.value),o=>(f(),G(k,{key:o,onClick:c=>x(o)},{suffix:l(()=>[r(d(a.value[o].type||i(n).ts.none),1)]),suffixIcon:l(()=>[...e[2]||(e[2]=[_("i",{class:"ph-caret-down ph-bold ph-lg"},null,-1)])]),default:l(()=>[r(d(i(n).t("_sfx."+o))+" ",1)]),_:2},1032,["onClick"]))),128))])]),_:1}),p(k,{danger:"",class:"_formBlock",onClick:e[1]||(e[1]=o=>V())},{default:l(()=>[e[3]||(e[3]=_("i",{class:"ph-arrow-clockwise ph-bold ph-lg"},null,-1)),r(" "+d(i(n).ts.default),1)]),_:1})]))}});export{z as default};
//# sourceMappingURL=sounds-j4RABdBZ.js.map
