import{r as e}from"./rolldown-runtime-BM3Ffeng.js";import{A as t,D as n,I as r,N as i,O as a,P as o,Pt as s,U as c,Xt as l,et as u,k as d,nt as f,qt as p,ut as m,x as h}from"./vue-vendor-DMUmTARL.js";import{Ko as g}from"./icons-vendor-Buq6V-Ga.js";import{D as _,b as v,x as y}from"./index-y6crcKNt.js";import{t as b}from"./pro-capability-D8kuUk-o.js";import{t as x}from"./el-date-picker-plus-D4_gPLNn.js";import{t as S}from"./ProBadge-v9S-_mI9.js";var C={class:`flex flex-col gap-4 rounded-zf-lg border border-border-light bg-surface p-5 sm:p-6 lg:flex-row lg:items-start lg:justify-between`},w={class:`flex items-center gap-2 text-2xl font-semibold tracking-tight text-primary`},T={class:`flex flex-col items-stretch gap-2 sm:flex-row sm:flex-wrap sm:items-center`},E={class:`flex max-w-full items-center gap-1 overflow-x-auto rounded-zf-md border border-border-light bg-surface p-1 text-xs`},D=[`onClick`],O=[`disabled`],k=r({__name:`DownloadStatsHeader`,props:c({modelValue:{},ranges:{},loading:{type:Boolean}},{searchDate:{required:!0},searchDateModifiers:{}}),emits:c([`update:modelValue`,`custom-change`,`refresh`],[`update:searchDate`]),setup(e,{emit:r}){let c=m(e,`searchDate`),k=r;return(r,m)=>{let A=x;return u(),t(`header`,C,[n(`div`,null,[n(`h1`,w,[m[3]||=i(` 下载统计 `,-1),o(S,{capability:s(b).downloadStats},null,8,[`capability`])]),m[4]||=n(`p`,{class:`mt-1 text-sm text-secondary`},`直链、短链、直接下载与在线预览的数据分析`,-1)]),n(`div`,T,[n(`div`,E,[(u(!0),t(h,null,f(e.ranges,n=>(u(),t(`button`,{key:n.key,type:`button`,class:p([`shrink-0 rounded-zf-sm px-2.5 py-1.5 font-medium transition-all duration-300 ease-in-out`,e.modelValue===n.key?`bg-zp/10 text-zp`:`text-secondary hover:bg-page hover:text-primary`]),onClick:e=>k(`update:modelValue`,n.key)},l(n.label),11,D))),128))]),e.modelValue===`custom`?(u(),a(A,{key:0,modelValue:c.value,"onUpdate:modelValue":m[0]||=e=>c.value=e,shortcuts:s(_),type:`daterange`,size:`small`,"value-format":s(v),"default-time":s(y),"range-separator":`至`,"start-placeholder":`开始时间`,"end-placeholder":`结束时间`,class:`w-full sm:w-80`,onChange:m[1]||=e=>k(`custom-change`)},null,8,[`modelValue`,`shortcuts`,`value-format`,`default-time`])):d(``,!0),n(`button`,{type:`button`,class:`inline-flex items-center justify-center gap-1.5 rounded-zf-md border border-border-light bg-surface px-3 py-2 text-xs font-medium text-regular transition-all duration-300 ease-in-out hover:bg-page disabled:cursor-not-allowed disabled:opacity-60`,disabled:e.loading,onClick:m[2]||=e=>k(`refresh`)},[o(s(g),{class:p([`h-3.5 w-3.5`,{"animate-spin":e.loading}])},null,8,[`class`]),m[5]||=i(` 刷新 `,-1)],8,O)])])}}}),A=e({default:()=>j}),j=k;export{A as n,j as t};