import{b as S,a as v,w as V,c as W,h as T,t as j,l as n,j as d,u as a,E as s,z as o,q as b,v as y,K as u}from"./vue-y3KLWBaS.js";import{a as B,$ as C,a4 as N,i as e,an as x,a6 as D,M as U,f as A,g as R}from"./app-JmgyQoR0.js";import{_ as q}from"./MkTab.vue_vue_type_style_index_0_lang-bgKDPAJl.js";const z={class:"_formRoot"},I={value:"soft"},K={value:"hard"},P={class:"_formBlock"},F=a("br",null,null,-1),G=a("br",null,null,-1),H=a("i",{class:"ph-floppy-disk-back ph-bold ph-lg"},null,-1),X=S({__name:"word-mute",setup(J){const M=i=>i.map(t=>Array.isArray(t)?t.join(" "):t).join(`
`),c=v("soft"),p=v(M(B.state.mutedWords)),m=v(M(C.mutedWords)),f=v(!1);V(p,()=>{f.value=!0}),V(m,()=>{f.value=!0});async function E(){const i=(w,$)=>{let _=w.trim().split(`
`).map(l=>l.trim()).filter(l=>l!=="");for(let l=0;l<_.length;l++){const k=_[l],h=k.match(/^\/(.+)\/(.*)$/);if(h)try{new RegExp(h[1],h[2])}catch(g){throw R({type:"error",title:e.ts.regexpError,text:e.t("regexpErrorDescription",{tab:$,line:l+1})+`
`+g.toString()}),g}else _[l]=k.split(" ")}return _};let t,r;try{t=i(p.value,e.ts._wordMute.soft),r=i(m.value,e.ts._wordMute.hard)}catch(w){return}B.set("mutedWords",t),await A("i/update",{mutedWords:r}),f.value=!1}return W(()=>[]),W(()=>[]),N({title:e.ts.wordMute,icon:"ph-speaker-x ph-bold ph-lg"}),(i,t)=>(T(),j("div",z,[n(q,{modelValue:c.value,"onUpdate:modelValue":t[0]||(t[0]=r=>c.value=r),class:"_formBlock"},{default:d(()=>[a("option",I,s(o(e).ts._wordMute.soft),1),a("option",K,s(o(e).ts._wordMute.hard),1)]),_:1},8,["modelValue"]),a("div",P,[b(a("div",null,[n(x,{class:"_formBlock"},{default:d(()=>[u(s(o(e).ts._wordMute.softDescription),1)]),_:1}),n(D,{modelValue:p.value,"onUpdate:modelValue":t[1]||(t[1]=r=>p.value=r),class:"_formBlock"},{caption:d(()=>[u(s(o(e).ts._wordMute.muteWordsDescription),1),F,u(s(o(e).ts._wordMute.muteWordsDescription2),1)]),default:d(()=>[a("span",null,s(o(e).ts._wordMute.muteWords),1)]),_:1},8,["modelValue"])],512),[[y,c.value==="soft"]]),b(a("div",null,[n(x,{class:"_formBlock"},{default:d(()=>[u(s(o(e).ts._wordMute.hardDescription)+" "+s(o(e).ts.reflectMayTakeTime),1)]),_:1}),n(D,{modelValue:m.value,"onUpdate:modelValue":t[2]||(t[2]=r=>m.value=r),class:"_formBlock"},{caption:d(()=>[u(s(o(e).ts._wordMute.muteWordsDescription),1),G,u(s(o(e).ts._wordMute.muteWordsDescription2),1)]),default:d(()=>[a("span",null,s(o(e).ts._wordMute.muteWords),1)]),_:1},8,["modelValue"])],512),[[y,c.value==="hard"]])]),n(U,{primary:"",inline:"",disabled:!f.value,onClick:t[3]||(t[3]=r=>E())},{default:d(()=>[H,u(" "+s(o(e).ts.save),1)]),_:1},8,["disabled"])]))}});export{X as default};
