import{r as e}from"./rolldown-runtime-BM3Ffeng.js";import{p as t,ut as n}from"./element-plus-vendor-BF9PNysW.js";import{A as r,D as i,E as a,I as o,N as s,P as c,Pt as l,Xt as u,et as d,ht as f,it as p,nt as m,qt as h,x as g}from"./vue-vendor-DMUmTARL.js";import{t as _}from"./recordLogSwitches-DYy2J7EU.js";var v={"aria-label":`下载日志记录设置`,class:`rounded-zf-lg border border-border-light bg-surface px-4 py-3`},y={class:`flex flex-col gap-1 sm:flex-row sm:items-start sm:justify-between sm:gap-4`},b={class:`mt-0.5 text-xs text-secondary`},x={class:`mt-3 grid gap-2 sm:grid-cols-2 xl:grid-cols-5`},S={class:`min-w-0`},C={class:`truncate text-xs font-medium text-regular`},w=o({__name:`DownloadRecordSettings`,props:{modelValue:{},updatingKey:{}},emits:[`change`],setup(e,{emit:o}){let w=e,T=o,E=a(()=>_.filter(e=>!w.modelValue[e.key]).map(e=>e.shortLabel)),D=a(()=>E.value.length?`${E.value.join(`、`)}已关闭；统计仅展示已记录的历史数据，关闭期间的数据无法补录。`:`全部类型均在记录，后续下载与预览行为会持续纳入统计。`),O=(e,t)=>{T(`change`,e,!!t)};return(a,o)=>{let w=p(`router-link`),T=n,E=t;return d(),r(`section`,v,[i(`div`,y,[i(`div`,null,[o[0]||=i(`h2`,{class:`text-sm font-semibold text-primary`},`下载记录设置`,-1),i(`p`,b,u(l(D)),1)]),c(w,{to:`/admin/download-link/setting`,class:`shrink-0 text-xs font-medium text-zp hover:underline`},{default:f(()=>[...o[1]||=[s(` 完整设置 → `,-1)]]),_:1})]),i(`div`,x,[(d(!0),r(g,null,m(l(_),t=>(d(),r(`div`,{key:t.key,class:`flex min-w-0 items-center justify-between gap-3 rounded-zf-md border border-border-light px-3 py-2.5`},[c(T,{content:t.tip,placement:`top`},{default:f(()=>[i(`div`,S,[i(`div`,C,u(t.shortLabel),1),i(`div`,{class:h([`mt-0.5 text-xs`,e.modelValue[t.key]?`text-success`:`text-warning`])},u(e.modelValue[t.key]?`记录中`:`已关闭`),3)])]),_:2},1032,[`content`]),c(E,{"model-value":e.modelValue[t.key],loading:e.updatingKey===t.key,disabled:e.updatingKey!==null&&e.updatingKey!==t.key,"aria-label":`${t.shortLabel}记录开关`,onChange:e=>O(t.key,e)},null,8,[`model-value`,`loading`,`disabled`,`aria-label`,`onChange`])]))),128))])])}}}),T=e({default:()=>E}),E=w;export{T as n,E as t};