functiont(t){returnfunction(t){if(Array.isArray(t))returnn(t)}(t)||function(t){if("undefined"!=typeofSymbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])returnArray.from(t)}(t)||a(t)||function(){thrownewTypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}functione(t,e){varn="undefined"!=typeofSymbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=a(t))||e&&t&&"number"==typeoft.length){n&&(t=n);vari=0,r=function(){};return{s:r,n:function(){returni>=t.length?{done:!0}:{done:!1,value:t[i++]}},e:function(t){throwt},f:r}}thrownewTypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}varo,s=!0,l=!1;return{s:function(){n=n.call(t)},n:function(){vart=n.next();returns=t.done,t},e:function(t){l=!0,o=t},f:function(){try{s||null==n.return||n.return()}finally{if(l)throwo}}}}functiona(t,e){if(t){if("string"==typeoft)returnn(t,e);vara=Object.prototype.toString.call(t).slice(8,-1);return"Object"===a&&t.constructor&&(a=t.constructor.name),"Map"===a||"Set"===a?Array.from(t):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?n(t,e):void0}}functionn(t,e){(null==e||e>t.length)&&(e=t.length);for(vara=0,n=newArray(e);a<e;a++)n[a]=t[a];returnn}functioni(t){returni="function"==typeofSymbol&&"symbol"==typeofSymbol.iterator?function(t){returntypeoft}:function(t){returnt&&"function"==typeofSymbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeoft},i(t)}functionr(t,e){if(!(tinstanceofe))thrownewTypeError("Cannot call a class as a function")}functiono(t,e){for(vara=0;a<e.length;a++){varn=e[a];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"inn&&(n.writable=!0),Object.defineProperty(t,(r=n.key,o=void0,o=function(t,e){if("object"!==i(t)||null===t)returnt;vara=t[Symbol.toPrimitive];if(void0!==a){varn=a.call(t,e||"default");if("object"!==i(n))returnn;thrownewTypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(r,"string"),"symbol"===i(o)?o:String(o)),n)}varr,o}functions(t,e,a){returne&&o(t.prototype,e),a&&o(t,a),Object.defineProperty(t,"prototype",{writable:!1}),t}varl,c=function(t){returndocument.querySelector(t)},u=function(t){returndocument.querySelectorAll(t)||[]},d=function(t){vare=document.createElement("template");returne.innerHTML=t.trim(),e.content.firstChild},h=function(t){for(;t.firstChild;)t.removeChild(t.firstChild)},p=function(t){t.classList.contains("is-hidden")?t.classList.remove("is-hidden"):t.classList.add("is-hidden")},f=function(t){returnt.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")},g=function(){functiont(e){r(this,t),this.element=e}returns(t,[{key:"attach",value:function(t){this.element.addEventListener("click",(function(e){e.target&&e.target.classList.contains("paginator__button")&&t(+e.target.dataset.page)}))}},{key:"update",value:function(t,e,a){h(this.element);varn=Math.floor(t/e);if(0!==n){vari=a-2<0?0:a-2,r=a+2>n?n:a+2,o=Math.abs(0-a)>2,s=Math.abs(n-a)>2,l=0===a?"disabled":"";this.element.appendChild(d('<button class="paginator__button previous" '.concat(l,' data-page="').concat(a-1,'">Previous</button>'))),o&&(this.element.appendChild(d('<button class="paginator__button" data-page="'.concat(0,'">').concat(0,"</button>"))),this.element.appendChild(d('<span class="ellipsis">…</span>')));for(varc=i;c<=r;c++){varu=c===a?"paginator__button--selected":"";this.element.appendChild(d('<button class="paginator__button '.concat(u,'" data-page="').concat(c,'">').concat(c,"</button>")))}s&&(this.element.appendChild(d('<span class="ellipsis">…</span>')),this.element.appendChild(d('<button class="paginator__button" data-page="'.concat(n,'">').concat(n,"</button>"))));varp=a===n?"disabled":"";this.element.appendChild(d('<button class="paginator__button next" '.concat(p,' data-page="').concat(a+1,'">Next</button>'))