import{m as n,b as i,a as s,c as o}from"./app.2QwBxAe.js";import{n as l}from"./_plugin-vue2_normalizer.1767861d.js";const p={props:{id:{type:Number,required:!0},apiUrl:{type:String,required:!0},showPagination:{type:Boolean,required:!1,default:!0},template:{type:String,required:!1}},data(){return{pagination:{nextTitle:"",nextUrl:"",prevTitle:"",prevUrl:""},prev:window.translations.Previous,next:window.translations.Next}},created(){this.updateCounter()},computed:{...n(["currentSearchPosition"]),prevUrl(){return this.currentSearchPosition&&this.pagination.prevUrl?this.pagination.prevUrl:""},nextUrl(){return this.currentSearchPosition&&this.pagination.nextUrl?this.pagination.nextUrl:""}},methods:{...i([]),...s(["setCurrentSearchPosition"]),updateCounter:async function(){let r=new FormData;r.append("type","increment"),r.append("id",this.id),r.append("template",this.template);let t=await o({method:"post",url:this.apiUrl,data:r,config:{headers:{"Content-Type":"multipart/form-data"}}});this.pagination=t.data},changeCurrentPageNumber(r){this.setCurrentSearchPosition(r)}}};var c=function(){var t=this,e=t._self._c;return e("div",{staticClass:"paginate sticky sticky-b0"},[t.prevUrl&&t.showPagination?e("a",{staticClass:"previous",attrs:{"aria-label":t.pagination.prevTitle,href:t.prevUrl},on:{click:function(a){return t.changeCurrentPageNumber(t.currentSearchPosition-1)}}},[e("i",{staticClass:"icon icon-arrow-left4 scale-150"}),e("h5",[e("span",[t._v(t._s(t.pagination.prevTitle))]),t._v(t._s(t.prev))])]):t._e(),t.prevUrl||t.nextUrl?e("div",{staticClass:"spacer-x inline-block md:hidden"}):t._e(),t.nextUrl&&t.showPagination?e("a",{staticClass:"next",attrs:{"aria-label":t.pagination.nextTitle,href:t.nextUrl},on:{click:function(a){return t.changeCurrentPageNumber(t.currentSearchPosition+1)}}},[e("h5",[e("span",[t._v(t._s(t.pagination.nextTitle))]),t._v(t._s(t.next))]),e("i",{staticClass:"icon icon-arrow-right4 scale-150"})]):t._e()])},u=[],h=l(p,c,u,!1,null,null,null,null);const v=h.exports;export{v as default};