import{a as g,aB as h,r as l,f as a,q as d,aj as b,at as k,c as u,o as r,L as w,J as B,K as C,Q as H}from"./vue.D1BjjNmv.js";import{G as x}from"./api.DTCXdPzK.js";import{d as m}from"./marked.esm.CbTws8Ir.js";import N from"./purify.es.aGzT-_H7.js";import{_ as T}from"./_plugin-vue_export-helper.DlAUqK2U.js";import"./index.CL7yl-Wb.js";const q={class:"agreement-page"},A={key:0,class:"agreement-error"},D=["innerHTML"],I=g({__name:"view",setup(L){const n=h(),o=l(!1),t=l(""),s=l(""),p={"/user-agreement":"user_service_Agreement","/privacy-policy":"privacy_Policy"},_=a(()=>{const e=Number(n.query.id);return!Number.isNaN(e)&&e>0?e:p[n.path]??3});a(()=>n.path==="/privacy-policy"?"隐私协议":"用户服务协议");const v=e=>(e==null?void 0:e.content_html)||(e==null?void 0:e.content)||(e==null?void 0:e.detail)||(e==null?void 0:e.description)||"";d(async()=>{o.value=!0,t.value="",s.value="";try{const e=await x(_.value),c=(e==null?void 0:e.data)??e;s.value=v(c)||"<p>暂无内容</p>"}catch(e){t.value=(e==null?void 0:e.msg)||"内容加载失败"}finally{o.value=!1}}),m.setOptions({breaks:!0,gfm:!0});const f=a(()=>{const e=s.value||"",i=/<\/?[a-z][\s\S]*>/i.test(e)?e:m.parse(e);return N.sanitize(i)});return(e,c)=>{const i=b("el-scrollbar"),y=k("loading");return r(),u("div",q,[w((r(),B(i,{class:"agreement-content"},{default:C(()=>[t.value?(r(),u("div",A,H(t.value),1)):(r(),u("div",{key:1,class:"agreement-body",innerHTML:f.value},null,8,D))]),_:1})),[[y,o.value]])])}}}),E=T(I,[["__scopeId","data-v-8ffa8edd"]]);export{E as default};
