import{_ as e}from"./public.js?v=1753954525509";import{_ as t}from"./index.vue_vue_type_script_setup_true_lang.js?v=1753954525509";import{c as a}from"./page_layout.js?v=1753954525509";import{aG as l,X as s}from"./site.js?v=1753954525509";import{aq as i,cA as u,_ as r,ay as n}from"./naive.js?v=1753954525509";import{k as d,P as o,t as _,r as p,e as f,U as c,V as m,Q as x,a2 as v,W as h,X as b,j as g,a3 as k}from"./vue.js?v=1753954525509";const S={class:"w-300px"},w={class:"w-300px"},$={class:"w-300px"},j={class:"flex flex-col"},y=d({__name:"form",props:{site:{}},emits:["changeHotlink"],setup(d,{expose:y,emit:C}){const{t:U}=o(),R=C,E=_(d,"site"),L=p(null),H=f({fix:"",domains:"",return_rule:"",status:!1,http_status:!1}),X={fix:{trigger:["blur","change"],validator:()=>""!==H.fix.trim()||new Error(U("Site.RulesError.index_330"))},return_rule:{trigger:["blur","change"],validator:()=>""!==H.return_rule.trim()||new Error(U("Site.RulesError.index_330"))}},q=()=>{A()},z=()=>{A()},A=async()=>{var e;await(null==(e=L.value)?void 0:e.validate()),await l({id:E.value.id,name:E.value.name,fix:H.fix,domains:H.domains.trim().split("\n").join(","),return_rule:H.return_rule,status:H.status,http_status:H.http_status}),R("changeHotlink",H.status),G()},G=async()=>{const{message:e}=await s({id:E.value.id,name:E.value.name});a(e)&&(H.fix=e.fix,H.domains=e.domains.split(",").join("\n"),H.return_rule=e.return_rule,H.status=e.status,H.http_status="true"===e.http_status||!0===e.http_status)};return G(),y({init:G}),(a,l)=>{const s=i,d=u,o=r,_=n,p=t,f=e;return c(),m("div",null,[x(p,{ref_key:"formRef",ref:L,class:"px-8px",model:b(H),rules:X},{default:v((()=>[x(d,{label:a.$t("Site.Lable.index_6"),path:"fix"},{default:v((()=>[h("div",S,[x(s,{value:b(H).fix,"onUpdate:value":l[0]||(l[0]=e=>b(H).fix=e),disabled:b(H).status,placeholder:""},null,8,["value","disabled"])])])),_:1},8,["label"]),x(d,{label:a.$t("Site.Lable.index_7")},{default:v((()=>[h("div",w,[x(s,{value:b(H).domains,"onUpdate:value":l[1]||(l[1]=e=>b(H).domains=e),type:"textarea",autosize:{minRows:6,maxRows:6},placeholder:""},null,8,["value"])])])),_:1},8,["label"]),x(d,{label:a.$t("Site.Lable.index_13"),path:"return_rule"},{default:v((()=>[h("div",$,[x(s,{value:b(H).return_rule,"onUpdate:value":l[2]||(l[2]=e=>b(H).return_rule=e),disabled:b(H).status,placeholder:""},null,8,["value","disabled"])])])),_:1},8,["label"]),x(d,{label:" "},{default:v((()=>[h("div",j,[x(o,{checked:b(H).status,"onUpdate:checked":[l[3]||(l[3]=e=>b(H).status=e),q]},{default:v((()=>[g(k(a.$t("Site.Config.index_94")),1)])),_:1},8,["checked"]),x(o,{checked:b(H).http_status,"onUpdate:checked":[l[4]||(l[4]=e=>b(H).http_status=e),z],class:"mt-16px"},{default:v((()=>[g(k(a.$t("Site.Config.index_95")),1)])),_:1},8,["checked"])])])),_:1}),x(d,{label:" ","show-feedback":!1},{default:v((()=>[x(_,{type:"primary",onClick:A},{default:v((()=>[g(k(a.$t("Site.Cert.index_60")),1)])),_:1})])),_:1})])),_:1},8,["model"]),x(f,{class:"mt-20px"},{default:v((()=>[h("li",null,[g(k(a.$t("Site.Config.index_96")),1),l[5]||(l[5]=h("br",null,null,-1)),g(" "+k(a.$t("Site.Config.index_97")),1)]),h("li",null,k(a.$t("Site.Config.index_98")),1),h("li",null,k(a.$t("Site.Config.index_99")),1)])),_:1})])}}});export{y as _};
