PageSourceSearch

https://www.eau-thermale-avene.pt/assets/build/dfp/eta/product-filters.963f6797.js

js eau-thermale-avene.pt collected 2026-09-26 11:17:00 UTC 7,613 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[870],{2696:(e,t,i)=>{i.r(t),i.d(t,{default:()=>d});var r=i(3458),n=i(8909),a=i(5913),l=i(8860);function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function s(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,c(r.key),r)}}function c(e){var t=function(e,t){if("object"!=o(e)||!e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var r=i.call(e,t||"default");if("object"!=o(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==o(t)?t:t+""}var u="PAGER",d=function(){return e=function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.element=t,this.filters=this.element.querySelector('[data-filters-element="filters"]'),this.form=this.element.querySelector('[data-filters-element="form"]'),this.selectedWrapper=this.element.querySelector('[data-filters-element="selected-wrapper"]'),this.inputActionUrl=document.querySelector('[data-filters-element="action-url"]'),this.pageWrapper=document.querySelector('[data-filters-element="page"]'),this.productsWrapper=document.querySelector('[data-filters-element="products"]'),this.removeAllLink=this.form&&this.form.querySelectorAll('[data-filters-element="remove-all"]'),this.mobileWrapper=this.element.querySelector('[data-filters-element="mobile-wrapper"]'),this.paginationLinks=null,this.seoBlock=document.querySelector(".block-mesh"),this.screenResolution=window.screen.width,this.isLocalHost="localhost"===window.location.hostname,this.actionUrl=this.isLocalHost?"https://mocki.io/v1/2272a6d8-6e4f-480c-ac0f-c76de39f0ff5":this.inputActionUrl.value,this.contentId=this.pageWrapper.dataset.contentId,this.selectedFilterTemplate=this.selectedWrapper&&this.selectedWrapper.dataset.filtersSelectedTemplate,this.onResize=this.onResize.bind(this),this.updateFilters=this.updateFilters.bind(this),this.removeSelectedFilter=this.removeSelectedFilter.bind(this),this.removeAllFilters=this.removeAllFilters.bind(this),this.onPaginationChange=this.onPaginationChange.bind(this),this.updateFiltersPosition=this.updateFiltersPosition.bind(this),this.bindEvents(),this.initPagination(),this.updateFiltersPosition()},t=[{key:"bindEvents",value:function(){this.filters&&(this.form.addEventListener("change",this.updateFilters),(0,a.F5)(this.removeAllLink,"click",this.removeAllFilters),window.addEventListener("resize",this.onResize))}},{key:"initPagination",value:function(){this.paginationLinks=this.pageWrapper.querySelectorAll("[data-page]"),this.paginationLinks.forEach((function(e){var t=document.createElement("button");t.type="button",t.innerHTML=e.innerHTML,t.className=e.className,t.id=e.id,e.hasAttribute("id")&&(t.id=e.id),e.hasAttribute("aria-label")&&t.setAttribute("aria-label",e.getAttribute("aria-label")),e.hasAttribute("title")&&(t.title=e.title),e.hasAttribute("data-page")&&t.setAttribute("data-page",e.getAttribute("data-page")),e.hasAttribute("rel")&&t.setAttribute("rel",e.getAttribute("rel")),e.replaceWith(t)})),this.paginationLinks=this.pageWrapper.querySelectorAll("[data-page]"),this.bindPagination()}},{key:"bindPagination",value:function(){(0,a.F5)(this.paginationLinks,"click",this.onPaginationChange)}},{key:"onResize",value:function(){(0,l.Ih)(this.screenResolution,l.O2)&&(this.updateFiltersPosition(),this.screenResolution=window.screen.width)}},{key:"getFiltersParams",value:function(e){var t=[];return e&&e.forEach((function(e){t.push({id:e.id,value:e.value,type:e.type,name:e.name,attribute:e.dataset.attribute})})),t}},{key:"updateFilters",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,i=this.form.querySelectorAll('input[type="checkbox"]:checked'),r=this.getFiltersParams(i);this.updateSelectedFilters(i),this.enableRemoveAllBtn(),this.updatePageContent("FORM",r,1,t)}},{key:"updateSelectedFilters",value:function(e){var t=this;this.selectedWrapper.innerHTML="",e.forEach((function(e){var i=t.selectedFilterTemplate;i=(i=(i=(i=(i=i.replace("%value%",e.dataset.label)).replace("%remove_value%",e.dataset.label)).replace("%id%",e.id)).replace("%
1option_id%",e.id)).replace("%attribute%",e.dataset.attribute);var r=document.createElement("div");r.innerHTML=i;var n=r.firstElementChild;t.selectedWrapper.appendChild(n),n.querySelector('[data-filter-element="remove-btn"][data-id="'.concat(e.id,'"]')).addEventListener("click",(function(){return t.removeSelectedFilter([e.id],!0,!0)}))}))}},{key:"updatePageContent",value:function(e,t,i){var a=this,l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null;(0,n.ro)(!0);var o=new URLSearchParams({contentId:this.contentId,filters:t.length?JSON.stringify(t):null,page:i||1});fetch("".concat(this.actionUrl,"?").concat(o),{headers:{"X-Requested-With":"XMLHttpRequest"}}).then((function(e){return e.json()})).then((function(t){a.pageWrapper.innerHTML=a.isLocalHost?t.data:t,(0,r.D)("disclosure",a.pageWrapper),(0,r.D)("video",a.pageWrapper),a.initPagination(),a.productsWrapper=a.pageWrapper.querySelector('[data-filters-element="products"]'),window.SkeepersProductWidget&&window.SkeepersProductWidget.generate();var o=new URLSearchParams(window.location.search);"1"===i||1===i?(o.delete("page"),a.seoBlock&&a.seoBlock.classList.remove(n.FY)):(o.set("page",i),a.seoBlock&&a.seoBlock.classList.add(n.FY)),e===u&&a.productsWrapper.scrollIntoView(),setTimeout((function(){var t=null;l?t=document.querySelector(l):e===u&&(t=document.querySelector('[data-filters-element="firstItem"]')),t&&(0,n.pW)(t)}),100),history.pushState({page:i},"Page ".concat(i," ").concat(o.toString()),"?".concat(o.toString())),(0,n.ro)(!1)}))}},{key:"removeSelectedFilter",value:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];e.forEach((function(e){var n=t.form.querySelector("#".concat(e)),a=t.selectedWrapper.querySelector('[data-filter-element="remove-btn"][data-id="'.concat(e,'"]'));if(n&&a){var l=a.parentElement.previousElementSibling||a.parentElement.nextElementSibling,o=l?"#".concat(l.id,' [data-filter-element="remove-btn"]'):'[data-filter-element="results-title"]';n.checked=!1,a.parentElement.remove(),i&&t.updateFilters(null,r?o:null)}}))}},{key:"removeAllFilters",value:function(e){var t=e.currentTarget,i=t.closest('[data-filters-element="dropdown"]').querySelectorAll('input[type="checkbox"]:checked'),r=Array.from(i).map((function(e){return e.id})),n=t.closest("li").querySelector("[data-disclosure-trigger]");this.removeSelectedFilter(r,!0),n.focus()}},{key:"onPaginationChange",value:function(e){e.preventDefault();var t=e.currentTarget.dataset.page,i=this.filters?this.form.querySelectorAll('input[type="checkbox"]:checked'):null,r=this.getFiltersParams(i);this.updatePageContent(u,r,t)}},{key:"updateFiltersPosition",value:function(){this.filters&&((0,l.Xk)(l.O2)?this.mobileWrapper.prepend(this.form):(this.filters.prepend(this.form),this.filters.click()))}},{key:"enableRemoveAllBtn",value:function(){this.removeAllLink.forEach((function(e){var t=e,i=t.closest('[data-filters-element="dropdown"]').querySelectorAll('input[type="checkbox"]:checked');t.disabled=i.length<=0}))}}],t&&s(e.prototype,t),i&&s(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t,i}()}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.