import{Z as c,o as f,c as y,p as v,n as p,s as d,N as z,cv as _,_ as b}from"./index.8d733f79.js";Math.easeInOutQuad=function(e,t,n,a){return e/=a/2,e<1?n/2*e*e+t:(e--,-n/2*(e*(e-2)-1)+t)};var h=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(e){window.setTimeout(e,1e3/60)}}();function S(e){document.documentElement.scrollTop=e,document.body.parentNode.scrollTop=e,document.body.scrollTop=e}function w(){return document.documentElement.scrollTop||document.body.parentNode.scrollTop||document.body.scrollTop}function g(e,t,n){const a=w(),u=e-a,l=20;let i=0;t=typeof t>"u"?500:t;var o=function(){i+=l;var r=Math.easeInOutQuad(i,a,u,t);S(r),i<t?h(o):n&&typeof n=="function"&&n()};o()}const C={__name:"index",props:{total:{required:!0,type:Number},page:{type:Number,default:1},limit:{type:Number,default:20},pageSizes:{type:Array,default(){return[10,20,30,50]}},pagerCount:{type:Number,default:document.body.clientWidth<992?5:7},layout:{type:String,default:"total, sizes, prev, pager, next, jumper"},background:{type:Boolean,default:!0},autoScroll:{type:Boolean,default:!0},hidden:{type:Boolean,default:!1}},setup(e,{emit:t}){const n=e,a=c({get(){return n.page},set(o){t("update:page",o)}}),u=c({get(){return n.limit},set(o){t("update:limit",o)}});function l(o){a.value*o>n.total&&(a.value=1),t("pagination",{page:a.value,limit:o}),n.autoScroll&&g(0,800)}function i(o){t("pagination",{page:o,limit:u.value}),n.autoScroll&&g(0,800)}return(o,r)=>{const m=_;return f(),y("div",{class:z([{hidden:e.hidden},"pagination-container"])},[v(m,{background:e.background,"current-page":p(a),"onUpdate:current-page":r[0]||(r[0]=s=>d(a)?a.value=s:null),"page-size":p(u),"onUpdate:page-size":r[1]||(r[1]=s=>d(u)?u.value=s:null),layout:e.layout,"page-sizes":e.pageSizes,"pager-count":e.pagerCount,total:e.total,onSizeChange:l,onCurrentChange:i},null,8,["background","current-page","page-size","layout","page-sizes","pager-count","total"])],2)}}},N=b(C,[["__scopeId","data-v-096a3e53"]]);export{N as _};
