import{u as a,a as l,D as e,c as s,m as u,o as t,v as o,s as i,d as n,e as d,f as c,x as r,y as v,C as p,g as m,l as b,z as g,t as w,i as _,k as f,w as h,j as y,E as k,F as j,h as V,_ as x,B as O,G as C,A as E,p as P,H as U}from"./wbs-f6dQykzJ.js";import{_ as $}from"./el-checkbox-group-Bch8jmbW.js";import{E as D,_ as H}from"./GeneralForm-CjXfP0VJ.js";import{E as R,a as T}from"./el-select-BHr6UOna.js";import"./el-popper-DAeOyDKB.js";import{E as z}from"./el-switch-Crq5Wtjf.js";import"./el-checkbox-Dm1dSfR0.js";import"./el-radio-DbVhzpF1.js";import"./strings-D7s33Q9h.js";const F={class:"wbs-content"},G={class:"wbs-main"},L={class:"opt-function-hd"},M={class:"func-name"},A=["innerHTML"],B={key:0,class:"mt"},S={class:"ml ib"},q={key:1,class:"mt"},I={class:"ml"},J={key:0,class:"setting-box"},K={key:0,style:{"max-height":"400px","overflow-y":"auto"}},N={key:1,class:"wk"},Q={class:"flex-row"},W={class:"ml"},X={__name:"Translate",setup(X){const{wbsCnf:Y}=a(),{wb_e:Z}=l(Y),aa=e(),la=s(Y.actpanel_visible),ea=s(0),sa=s(!1),ua=s(Y.is_pro),ta=u({}),oa=u({});s("google");const ia=s([]),na=s(["en","zh"]);function da(a){na.value[0]&&na.value[1]&&(ta.lan=na.value.join("-"));const l={op:"translate_update",opt:ta};E.saveData(l).then((l=>{U.success(Z("设置保存成功")),ea.value=0,a&&a()}))}function ca(){aa.push("/pro")}return t((()=>{Y.is_pro&&o(((a,l)=>{a?(Y.is_pro=a,ua.value=a):(ua.value=0,Y.is_pro=0)})),E.getData({op:"translate_setting"}).then((a=>{Object.assign(ta,a.opt),Object.assign(oa,a.cnf),ta.lan&&(na.value=ta.lan.split("-")),a.data&&(ia.value=a.data),P((()=>{ea.value=0})),sa.value=!0}))})),i(ta,(()=>{ea.value++}),{deep:!0}),(a,l)=>{const e=z,s=k,u=D,t=T,o=R,i=H,E=x,P=$,U=C,X=n("wbs-ctrl-bar"),aa=v;return c(),d("div",F,[r((c(),d("div",{class:p(["wbs-content-inner",{"wb-page-loaded":sa.value}])},[m("div",{class:p(["wbs-group",{"with-actpanel":la.value}])},[m("div",G,[m("div",L,[m("h3",M,[m("strong",null,w(oa.label),1),l[7]||(l[7]=m("i",{class:"tag-pro"},"Pro",-1))]),m("div",{class:"func-desc",innerHTML:oa.description},null,8,A),ua.value?(c(),d("div",B,[_(e,{modelValue:ta.switch,"onUpdate:modelValue":l[0]||(l[0]=a=>ta.switch=a),"active-value":"1","inactive-value":"0"},null,8,["modelValue"]),m("span",S,w("1"==ta.switch?f(Z)("功能开启"):f(Z)("功能关闭")),1)])):(c(),d("div",q,[_(s,{type:"primary",onClick:l[1]||(l[1]=a=>ca())},{default:h((()=>[y(w(f(Z)("获取PRO版本")),1)])),_:1}),m("span",I,w(f(Z)("激活PRO版本即可使用")),1)]))]),sa.value?(c(),d("div",J,[_(i,{modelValue:ta,"onUpdate:modelValue":l[4]||(l[4]=a=>ta=a),fields:oa.fields,wb_e:f(Z)},{custom:h((({field:a})=>["log-list"==a.type?(c(),b(u,{key:0,"data-slug":a.slug,label:a.label,class:p({"with-sub-group":a.group})},{default:h((()=>[ia.value&&ia.value.length?(c(),d("ul",K,[(c(!0),d(j,null,V(ia.value,((a,l)=>(c(),d("li",{key:"err-li-"+l},w(a),1)))),128))])):(c(),d("div",N,w(f(Z)("(暂无)")),1))])),_:2},1032,["data-slug","label","class"])):g("",!0),"lan-seter"==a.type?(c(),b(u,{key:1,"data-slug":a.slug,label:a.label,class:p({"with-sub-group":a.group})},{default:h((()=>[m("div",Q,[_(o,{class:"w8em",modelValue:na.value[0],"onUpdate:modelValue":l[2]||(l[2]=a=>na.value[0]=a),placeholder:f(Z)("源语言")},{default:h((()=>[(c(!0),d(j,null,V(a.attrs.items,(a=>(c(),b(t,{key:a.value,label:`${a.label} (${a.value})`,value:a.value,disabled:a.value==na.value[1]},null,8,["label","value","disabled"])))),128))])),_:2},1032,["modelValue","placeholder"]),m("span",W,w(f(Z)("译为")),1),_(o,{class:"w8em ml",modelValue:na.value[1],"onUpdate:modelValue":l[3]||(l[3]=a=>na.value[1]=a),placeholder:f(Z)("目标语言")},{default:h((()=>[(c(!0),d(j,null,V(a.attrs.items,(a=>(c(),b(t,{key:a.value,label:`${a.label} (${a.value})`,value:a.value,disabled:a.value==na.value[0]||"auto"==a.value},null,8,["label","value","disabled"])))),128))])),_:2},1032,["modelValue","placeholder"])])])),_:2},1032,["data-slug","label","class"])):g("",!0)])),_:1},8,["modelValue","fields","wb_e"])])):g("",!0),r(_(E,{class:"mt"},null,512),[[O,sa.value]])]),la.value?r((c(),b(P,{key:0,onVisible:l[5]||(l[5]=a=>la.value=a),wb_e:f(Z)},null,8,["wb_e"])),[[O,sa.value]]):g("",!0)],2),f(Y).is_pro?g("",!0):(c(),b(U,{key:0})),ua.value?(c(),b(X,{key:1,changed:ea.value,wb_e:f(Z),onSubmit:da},null,8,["changed","wb_e"])):(c(),b(X,{key:2},{default:h((()=>[_(s,{type:"primary",onClick:l[6]||(l[6]=a=>ca())},{default:h((()=>[y(w(f(Z)("获取PRO版本")),1)])),_:1})])),_:1}))],2)),[[aa,!sa.value]])])}}};export{X as default};
