import{c as a,f as t,u as n,a as l,h as e,_ as o}from"./public.js?v=1763625242172";import{k as i,P as s,r as u,R as r,S as c,U as f,X as p,V as d,aj as m,ak as g,a3 as _,j as v,a4 as y}from"./vue.js?v=1763625242172";import{x as j,m as x,hc as S}from"./page_layout.js?v=1763625242172";import{K as h,L as w,M as W,N as b,O as C}from"./setting.js?v=1763625242172";import{_ as k}from"./index99.js?v=1763625242172";import{au as $,aC as P,d9 as B}from"./naive.js?v=1763625242172";import"./common.js?v=1763625242172";import"./__commonjsHelpers__.js?v=1763625242172";const U={class:"p-20px"},L={class:"flex mb-16px"},E={class:"flex-1 mr-16px"},K="uri_find",R=i({__name:"config",setup(i){const{t:R}=s(),A=u(""),D=async()=>{""!==A.value.trim()?(await W({url_find:A.value}),A.value="",X()):x.error(R("Waf.Setting.config_176"))},H=()=>{const a=u("");n({title:R("Waf.Setting.config_177"),width:440,footer:!0,content:()=>p("div",{class:"p-20px"},[p(k,{value:a.value,"onUpdate:value":t=>a.value=t,rows:14,placeholder:R("Waf.Setting.config_178")},null)]),onConfirm:async()=>{if(""===a.value.trim())return x.error(R("Waf.Setting.config_179")),!1;await b({pdata:a.value,json:1}),X()}})},I=()=>{const a=u(N.data.map((a=>a.url)).join("\n"));n({title:R("Waf.Setting.config_177"),width:440,footer:!0,content:()=>p("div",{class:"p-20px"},[p(k,{value:a.value,"onUpdate:value":t=>a.value=t,rows:14,readonly:!0},null)]),onConfirm:()=>(S(a.value,"".concat(K,".json")),!1)})},M=()=>{l({title:R("Waf.Setting.config_180"),content:R("Waf.Setting.config_181"),onConfirm:async()=>{await C({type:K}),X()}})},{table:N,columns:O,setLoading:V}=a([{key:"url",title:"URL"},t({width:80,options:a=>[{label:R("Public.Btn.Del"),onClick:async()=>{await h({url_find:a.url}),X()}}]})]),X=async()=>{try{V(!0);const{message:a}=await w();j(a)&&(N.data=a.map((a=>({url:a}))))}finally{V(!1)}};return X(),(a,t)=>{const n=$,l=P,i=e,s=B,u=o;return r(),c("div",U,[f("div",L,[f("div",E,[p(n,{value:d(A),"onUpdate:value":t[0]||(t[0]=a=>m(A)?A.value=a:null),placeholder:a.$t("Waf.Setting.config_173"),onKeyup:g(D,["enter"])},null,8,["value","placeholder"])]),p(l,{type:"primary",onClick:D},{default:_((()=>[v(y(a.$t("Public.Btn.Add")),1)])),_:1})]),p(i,{"max-height":258,loading:d(N).loading,data:d(N).data,columns:d(O)},null,8,["loading","data","columns"]),p(s,{class:"mt-16px"},{default:_((()=>[p(l,{onClick:H},{default:_((()=>[v(y(a.$t("Public.Btn.Import")),1)])),_:1}),p(l,{onClick:I},{default:_((()=>[v(y(a.$t("Public.Btn.Export")),1)])),_:1}),p(l,{onClick:M},{default:_((()=>[v(y(a.$t("Public.Btn.Empty")),1)])),_:1})])),_:1}),p(u,{class:"mt-16px"},{default:_((()=>[f("li",null,y(a.$t("Waf.Setting.config_174")),1),f("li",null,y(a.$t("Waf.Setting.config_175")),1)])),_:1})])}}});export{R as default};
