(function(s,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(s=typeof globalThis<"u"?globalThis:s||self,e(s.VueBasicPagination={},s.Vue))})(this,function(s,e){"use strict";const d={class:"pagination-container"},p={key:0},g={key:0},u=["onClick"],V={key:1},f=e.defineComponent({__name:"VueBasicPagination",props:{totalRows:{type:Number,default:1},perPage:{type:Number,default:1},modelValue:{default:""},prevBtn:{type:String,default:"‹"},nextBtn:{type:String,default:"›"},firstBtn:{type:String,default:"«"},lastBtn:{type:String,default:"»"},small:{type:Boolean,default:!1}},emits:["update:modelValue","change"],setup(n,{emit:m}){const r=m,t=n,o=e.computed(()=>{let a=Math.ceil(t.totalRows/t.perPage);return Array.from({length:a},(i,l)=>l+1)}),B=a=>parseInt(t.modelValue)<4&&a<5||parseInt(t.modelValue)==o.value.length&&a>parseInt(t.modelValue)-3?!0:a>=parseInt(t.modelValue)-1&&a<=parseInt(t.modelValue)+1,y=()=>{parseInt(t.modelValue)>1&&c(parseInt(t.modelValue)-1)},k=()=>{parseInt(t.modelValue){c(1)},N=()=>{c(o.value.length)},c=a=>{r("update:modelValue",a),r("change",a)};return(a,i)=>(e.openBlock(),e.createElementBlock("ul",d,[e.createElementVNode("li",null,[e.createElementVNode("button",{class:e.normalizeClass(["pagination-btn pagination-first-btn",n.small?"pagination-btn-small":""]),onClick:i[0]||(i[0]=l=>E())},[e.createElementVNode("span",null,e.toDisplayString(t.firstBtn),1)],2)]),e.createElementVNode("li",null,[e.createElementVNode("button",{class:e.normalizeClass(["pagination-btn pagination-prev-btn",n.small?"pagination-btn-small":""]),onClick:i[1]||(i[1]=l=>y())},[e.createElementVNode("span",null,e.toDisplayString(t.prevBtn),1)],2)]),o.value.length>4&&parseInt(t.modelValue)>3?(e.openBlock(),e.createElementBlock("li",p,[e.createElementVNode("button",{class:e.normalizeClass(["pagination-btn",n.small?"pagination-btn-small":""])}," ... ",2)])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(o.value,(l,C)=>(e.openBlock(),e.createElementBlock(e.Fragment,{key:C},[B(l)?(e.openBlock(),e.createElementBlock("li",g,[e.createElementVNode("button",{class:e.normalizeClass(["pagination-btn",[l==parseInt(t.modelValue)?"active-pagination-btn":"",n.small?"pagination-btn-small":""]]),onClick:h=>c(l)},e.toDisplayString(l),11,u)])):e.createCommentVNode("",!0)],64))),128)),o.value.length>4&&parseInt(t.modelValue)k())},[e.createElementVNode("span",null,e.toDisplayString(t.nextBtn),1)],2)]),e.createElementVNode("li",null,[e.createElementVNode("button",{class:e.normalizeClass(["pagination-btn pagination-last-btn",n.small?"pagination-btn-small":""]),onClick:i[3]||(i[3]=l=>N())},[e.createElementVNode("span",null,e.toDisplayString(t.lastBtn),1)],2)])]))}}),I="",b=((n,m)=>{const r=n.__vccOpts||n;for(const[t,o]of m)r[t]=o;return r})(f,[["__scopeId","data-v-d7e1ad46"]]);s.VueBasicPagination=b,Object.defineProperty(s,Symbol.toStringTag,{value:"Module"})});