import{r as t,c as s,h as i}from"./p-dfbe004d.js";import{_ as a,s as h}from"./p-8415f806.js";import"./p-fd56940f.js";import"./p-9a7a47e8.js";const n=class{constructor(i){t(this,i),this.scPrevPage=s(this,"scPrevPage",7),this.scNextPage=s(this,"scNextPage",7),this.page=1,this.perPage=0,this.total=0,this.totalShowing=0,this.totalPages=0}componentWillLoad(){this.handlePaginationChange()}handlePaginationChange(){this.hasNextPage=this.total>1&&this.page<this.totalPages,this.hasPreviousPage=this.totalPages>1&&this.page>1,this.from=this.perPage*(this.page-1)+1,this.to=Math.min(this.from+this.totalShowing-1,this.total)}render(){return this.hasNextPage||this.hasPreviousPage?i("sc-flex",null,i("div",null,h(a("Displaying %1d to %2d of %3d items","surecart"),this.from,this.to,this.total)),i("sc-flex",null,i("sc-button",{onClick:()=>this.scPrevPage.emit(),disabled:!this.hasPreviousPage,size:"small"},a("Previous","surecart")),i("sc-button",{onClick:()=>this.scNextPage.emit(),disabled:!this.hasNextPage,size:"small"},a("Next","surecart")))):null}static get watchers(){return{total:["handlePaginationChange"],totalPages:["handlePaginationChange"],page:["handlePaginationChange"],perPage:["handlePaginationChange"],totalShowing:["handlePaginationChange"]}}};n.style=":host{display:block}";export{n as sc_pagination}