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