import{h as e,r as t,H as i,g as o}from"./p-6b2342e0.js";import{c as r,V as s}from"./p-dcc98162.js";import{I as a}from"./p-c45f0189.js";import{V as n,I as l}from"./p-9deec7a5.js";import{s as c}from"./p-717cb35f.js";import{T as p}from"./p-80ddc287.js";import{V as d}from"./p-ce3cf81d.js";import{D as f}from"./p-2d3e1a65.js";import{d as m}from"./p-633fe47e.js";import{f as h}from"./p-2ade684f.js";import{C as v}from"./p-816f6fc6.js";import{d as g}from"./p-243c99c3.js";import{t as u}from"./p-72158667.js";import{i as b,n as j,s as S,P as y}from"./p-9dcecdd3.js";import"./p-a528714c.js";import"./p-331a62d5.js";var R=function(e,t,i,o){var r,s=arguments.length,a=s<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var n=e.length-1;n>=0;n--)(r=e[n])&&(a=(s<3?r(a):s>3?r(t,i,a):r(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};class w extends s{render(){return"pageSizeSelectorMobile"===this.type?this.renderPageSizeSelectorMobile():this.renderPageSizeSelectorMobileAndCurrentPageLabel()}renderPageSizeSelectorMobile(){const e=d.tWithPreservedBlocks("Show [{0} items / page]",w.clickableReg,this.pageSize);return this.renderTranslatedMessage(e)}renderPageSizeSelectorMobileAndCurrentPageLabel(){const e=this.total>0?this.pageSize*(this.current-1)+1:0,t=Math.min(this.current*this.pageSize,this.total),i=d.tWithPreservedBlocks("Viewing [{0}-{1}] of {2}",w.clickableReg,e,t,this.total);return this.renderTranslatedMessage(i)}renderTranslatedMessage(t){return e("vega-flex",{alignItems:"center",justifyContent:"center",gap:"size-4"},t.map((t=>t.isPreserved?this.pageSizeSelectorMobileDropdownRenderer.render(e("vega-button-link",{label:t.content})):e("vega-font",{variant:"font-field-label",color:"text-primary"},t.content))))}}w.clickableReg=/(\[[^\]]*\])/g,R([r()],w.prototype,"translationSlimmer",void 0),R([r()],w.prototype,"type",void 0),R([r()],w.prototype,"pageSize",void 0),R([r()],w.prototype,"total",void 0),R([r()],w.prototype,"current",void 0),R([r()],w.prototype,"pageSizeSelectorMobileDropdownRenderer",void 0);var z=function(e,t,i,o){var r,s=arguments.length,a=s<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var n=e.length-1;n>=0;n--)(r=e[n])&&(a=(s<3?r(a):s>3?r(t,i,a):r(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};class P extends s{render(t){var i;const o=(this.isAllActive||b(this.pageSizeSelectorOptions,this.pageSize)?this.pageSizeSelectorOptions:[...this.pageSizeSelectorOptions,this.pageSize]).map(j),r=S(o),s=this.translationSlimmer.t("Items Per Page");return e("vega-dropdown",{trigger:"click",selectType:"single",alignment:"center",minWidth:160,selectedSourceKey:(this.isAllActive?y:this.pageSize).toString(),source:[{key:"items-per-page",label:s,children:[...r.map((e=>({key:e.value.toString(),label:e.label})))]}],ref:e=>{f.addUniqueObserverToNode(e,m,(e=>{this.notifyParentPagination(e.detail)}))},isScreenPosition:null===(i=this.dropdownProps)||void 0===i?void 0:i.isScreenPosition},t)}notifyParentPagination(e){const t=h(this.host,"vega-pagination");t&&v.notify(g.getSubject(t,u),{host:this.host,detail:e})}}z([r()],P.prototype,"host",void 0),z([r()],P.prototype,"translationSlimmer",void 0),z([r()],P.prototype,"pageSizeSelectorOptions",void 0),z([r({writable:!0})],P.prototype,"pageSize",void 0),z([r()],P.prototype,"dropdownProps",void 0),z([r()],P.prototype,"total",void 0),z([r()],P.prototype,"isAllActive",void 0);var M=function(e,t,i,o){var r,s=arguments.length,a=s<3?t:null===o?o=Object.getOwnPropertyDescriptor(t,i):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,o);else for(var n=e.length-1;n>=0;n--)(r=e[n])&&(a=(s<3?r(a):s>3?r(t,i,a):r(t,i))||a);return s>3&&a&&Object.defineProperty(t,i,a),a};const O=class{constructor(e){t(this,e),this.globalSlimmers={},this.translationSlimmer=new p,this.vegaComponentUsageRuntimeMetricsSlimmer=new n,this.pageSizeSelectorMobileRenderer=new w,this.pageSizeSelectorMobileDropdownRenderer=new P,this.pageSize=10,this.pageSizeSelectorOptions=[10,20,50,100],this.total=0,this.current=1,this.isAllActive=!1}render(){return c(e(i,null,this.pageSizeSelectorMobileRenderer.render()),this.host)}get host(){return o(this)}};M([l()],O.prototype,"globalSlimmers",void 0),M([a()],O.prototype,"translationSlimmer",void 0),M([a()],O.prototype,"vegaComponentUsageRuntimeMetricsSlimmer",void 0),M([a()],O.prototype,"pageSizeSelectorMobileRenderer",void 0),M([a()],O.prototype,"pageSizeSelectorMobileDropdownRenderer",void 0),O.style=":host{display:inline-block}";export{O as vega_pagination_page_size_selector_mobile}