1const{lang:l}=window;function f(p){const e='a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';function t(o){if(o.key!=="Tab")return;const s=[...p.querySelectorAll(e)];if(!s.length)return;const n=s[0],i=s[s.length-1];o.shiftKey?document.activeElement===n&&(i.focus(),o.preventDefault()):document.activeElement===i&&(n.focus(),o.preventDefault())}return document.addEventListener("keydown",t),()=>document.removeEventListener("keydown",t)}class m extends HTMLElement{#e=null;#i=null;#t=null;#o=new Map;#c=null;#r=null;#s=null;#n=null;constructor(){super()}async connectedCallback(){window.addEventListener("elements-facet-wrapper",this.initFacetEvents.bind(this));const e=document.getElementById("plp-fragment-wrapper");e&&new MutationObserver(()=>{clearTimeout(this.#c),document.querySelector(".facets-loading-state")?.classList.remove("active"),this.updateViewButtonCount()}).observe(e,{childList:!0}),document.readyState!=="complete"?document.addEventListener("DOMContentLoaded",()=>{this.subscribeToElementsRefreshEvent(),this.addTrackingObservers(),this.facetEventsOverride()}):(this.subscribeToElementsRefreshEvent(),this.addTrackingObservers(),this.facetEventsOverride()),this.fixAriaAttributes(this),this.stripCountParentheses(this),new MutationObserver(o=>{o.forEach(s=>{s.addedNodes.forEach(n=>{this.fixAriaAttributes(n),this.stripCountParentheses(n)})})}).observe(this,{childList:!0,subtree:!0})}disconnectedCallback(){document.removeEventListener("keydown",this.#i),document.removeEventListener("focusin",this.handleFacetOptionFocus,!0),document.removeEventListener("keydown",this.handleFacetKeyboardScrollStart,!0),document.removeEventListener("scroll",this.handleFacetDropdownListScroll,!0),document.removeEventListener("wheel",this.handleFacetDropdownListWheel,!0),document.removeEventListener("touchstart",this.handleFacetDropdownListTouchStart,!0),document.removeEventListener("touchmove",this.handleFacetDropdownListTouchMove,!0),document.removeEventListener("touchend",this.clearFacetTouchList,!0),document.removeEventListener("touchcancel",this.clearFacetTouchList,!0),window.removeEventListener("elements-facet-wrapper",this.initFacetEvents),this.cleanupMobileFacets(),this.cleanupFacetToggleListeners(),this.#e&&(this.#e(),this.#e=null)}addTrackingObservers=()=>{window.elements&&window.elements.facets&&window.elements.facets.observer&&window.elements.facets.observer.subscribe("refresh-facets",()=>{setTimeout(()=>this.initTracking(),0)});const e=document.getElementById("facet-wrapper");if(e){const t=new MutationObserver(o=>{o.some(n=>Array.from(n.addedNodes).some(i=>i.nodeType===1&&(i instanceof HTMLElement&&i.querySelector(".elements-facets-dropdown-summary")||i instanceof HTMLElement&&i.classList.contains("elements-facets-dropdown-summary"))))&&(setTimeout(()=>this.initTracking(),0),t.disconnect())});t.observe(e,{childList:!0,subtree:!0})}};async initFacetEvents(){window.elements.facets.observer.subscribe("facet-toggle",t=>{this.toggleFacetToggleButton(this,t)}),this.initMobileFacets()}handleFacetClear=()=>{const e=new URL(window.location.href);e.searchParams.has("pageNumber")&&(e.searchParams.delete("pageNumber"),window.history.replaceState(null,"",e.href))};subscribeToElementsRefreshEvent=()=>{window.elements&&window.elements.facets&&window.elements.facets.observer&&(window.elements.facets.observer.subscribe("refresh-product-list",this.handleReload),window.elements.facets.observer.subscribe("clear-facet",this.handleFacetClear),window.elements.facets.observer.subscribe("refresh-facets",()=>{this.cleanupFacetToggleListeners(),setTimeout(()=>this.setupFacetOptionsToggle(),100)}))};toggleFacetToggleButton=(e,t)=>{const o=e.querySelector(".elements-facets-more-filters-toggle");o&&(t?o.textContent=window.altitude.i18n(()=>l.altitude.productlist.filter.less.text)||"Less Filters -":o.textContent=window.altitude.i18n(()=>l.altitude.productlist.filter.more.text)||"More Filters +")};createToggleHandler=(e,t,o,s)=>()=>{const n=e.querySelector(".elements-facets-dropdown-list"),i=o.dataset.showingAll==="true",c=i?s:"*";window.elements.facets.mapOptions(e,t,e.currentSelections,e.facetType,c),document.contains(o)&&(o.innerText=window.altitude.i18n(()=>i?window.lang.altitude.productlist.filter.more.text:window.lang.altitude.productlist.filter.less.text),o.dataset.showingAll=i?"false":"true"),n&&(i?(n.style.maxHeight="300px",n.style.overflowY="auto"):(n.style.maxHeight="none",n.style.overflowY="visible"))};setupFacetOptionsToggle=()=>{this.#t&&window.elements.facets.observer.unsubscribe?.("facet-hydrated",this.#t),this.#t=({element:e,data:t})=>{const o=e.getAttribute("facet-id"),s=e.getAttribute("facet-visible-options"),n=e.querySelector(".facet-options-total");if(n&&t.options){const c=window.altitude.i18n(()=>l.altitude.components.facets.options)||"option(s)";n.textContent=`${t.options.length} ${c}`}if(s==="*")return;const i=parseInt(s);t.options?.length<=i||setTimeout(()=>{const c=e.querySelector("[facet-options-wrapper]");let r=e.querySelector(".elements-facets-options-toggle-button");
1if(!r&&c&&(r=document.createElement("button"),r.className="elements-facets-options-toggle-button",r.setAttribute("facet-show-more",""),r.dataset.showingAll="false",r.dataset.state="collapsed",r.textContent=window.altitude.i18n(()=>window.lang.altitude.productlist.filter.more.text),c.parentElement.insertBefore(r,c.nextSibling)),!r)return;const a=`${o}-${t.facetName}`,u=this.#o.get(a);u&&(r.removeEventListener("click",u),this.#o.delete(a));const d=this.createToggleHandler(e,t,r,i);this.#o.set(a,d),r.addEventListener("click",d),r.style.display="block",r.dataset.showingAll||(r.dataset.showingAll="true");const h=e.querySelector(".elements-facets-dropdown-list");h&&(h.style.maxHeight="none",h.style.overflowY="visible")},0)},window.elements.facets.observer.subscribe("facet-hydrated",this.#t)};cleanupFacetToggleListeners=()=>{this.#o.forEach((e,t)=>{const[o]=t.split("-"),s=document.querySelector(`elements-facet[facet-id="${o}"]`);if(s){const n=s.querySelector(".elements-facets-options-toggle-button");n&&n.removeEventListener("click",e)}}),this.#o.clear(),this.#t&&(window.elements.facets.observer.unsubscribe?.("facet-hydrated",this.#t),this.#t=null)};isScrollableFacetDropdownList=e=>e instanceof HTMLElement&&e.classList.contains("elements-facets-dropdown-list")&&e.scrollHeight>e.clientHeight;getFacetDropdownList=e=>{const t=e instanceof Element?e:e instanceof Node?e.parentElement:null;if(!t)return null;const o=t.closest(".elements-facets-dropdown-list");if(this.isScrollableFacetDropdownList(o))return o;const n=t.closest(".elements-facets-options-wrapper")?.querySelector(".elements-facets-dropdown-list");return this.isScrollableFacetDropdownList(n)?n:null};focusFacetOptionsWrapper=e=>{const t=e.closest(".elements-facets-options-wrapper");t instanceof HTMLElement&&(t.hasAttribute("tabindex")||t.setAttribute("tabindex","-1"),document.activeElement!==t&&t.focus({preventScroll:!0}))};scrollFacetDropdownList=(e,t)=>{const o=e.scrollHeight-e.clientHeight;o<=0||(e.scrollTop=Math.max(0,Math.min(o,e.scrollTop+t)))};restoreFacetKeyboardScrollPosition=()=>{this.#n&&(window.scrollTo(this.#n.x,this.#n.y),this.#n=null)};handleFacetKeyboardScrollStart=e=>{const t=this.getFacetDropdownList(document.activeElement);if(t){if(e.key!=="Tab"){const o={ArrowDown:40,ArrowUp:-40,PageDown:t.clientHeight,PageUp:-t.clientHeight};if(e.key in o){e.preventDefault(),e.stopPropagation(),this.focusFacetOptionsWrapper(t),this.scrollFacetDropdownList(t,o[e.key]);return}(e.key==="Home"||e.key==="End")&&(e.preventDefault(),e.stopPropagation(),this.focusFacetOptionsWrapper(t),t.scrollTop=e.key==="Home"?0:t.scrollHeight-t.clientHeight);return}this.#n={x:window.scrollX,y:window.scrollY}}};handleFacetDropdownListScroll=e=>{const t=e.target;this.isScrollableFacetDropdownList(t)&&(document.activeElement instanceof HTMLElement&&document.activeElement.classList.contains("elements-facet-option-checkbox")&&t.contains(document.activeElement)||this.focusFacetOptionsWrapper(t))};handleFacetDropdownListWheel=e=>{if(!e.deltaY)return;const t=this.getFacetDropdownList(e.target);t&&(e.preventDefault(),e.stopPropagation(),this.focusFacetOptionsWrapper(t),this.scrollFacetDropdownList(t,e.deltaY))};handleFacetDropdownListTouchStart=e=>{if(e.touches.length!==1)return;const t=this.getFacetDropdownList(e.target);t&&(this.#r=t,this.#s=e.touches[0].clientY,this.focusFacetOptionsWrapper(t))};handleFacetDropdownListTouchMove=e=>{if(!this.#r||this.#s===null||e.touches.length!==1)return;e.preventDefault(),e.stopPropagation();const t=e.touches[0].clientY;this.scrollFacetDropdownList(this.#r,this.#s-t),this.#s=t};clearFacetTouchList=()=>{this.#r=null,this.#s=null};handleFacetOptionFocus=e=>{const t=e.target;if(!(t instanceof HTMLElement)){this.restoreFacetKeyboardScrollPosition();return}if(!t.classList.contains("elements-facet-option-checkbox")){this.restoreFacetKeyboardScrollPosition();return}const o=t.closest(".elements-facet-option");if(!(o instanceof HTMLElement)){this.restoreFacetKeyboardScrollPosition();return}window.requestAnimationFrame(()=>{const s=o.closest(".elements-facets-dropdown-list");if(!this.isScrollableFacetDropdownList(s)){this.restoreFacetKeyboardScrollPosition();return}const n=s.getBoundingClientRect(),i=o.getBoundingClientRect(),c=i.top-n.top+s.scrollTop,r
1=c+i.height,a=s.scrollTop,u=a+s.clientHeight,d=4;c<a?s.scrollTop=Math.max(0,c-d):r>u&&(s.scrollTop=r-s.clientHeight+d),this.restoreFacetKeyboardScrollPosition()})};closeSortDropdown=()=>{document.querySelector(".sort-button-primary-btn")?.setAttribute("aria-expanded","false")};closeAllFacets=()=>{document.querySelectorAll("elements-facet").forEach(t=>{const o=t.querySelector('[facet-receiver="options"]');o?.classList.contains("active")&&(o.classList.remove("active"),t.querySelector('[facet-transmitter="options"]')?.setAttribute("aria-expanded","false"),t.facetOpen=!1)})};setupToggleTextObserver=()=>{const e=this.querySelector(".elements-facets-more-filters-toggle");if(!e)return;const t=window.altitude.i18n(()=>l.altitude.productlist.filter.more.text)||"More Filters +",o=window.altitude.i18n(()=>l.altitude.productlist.filter.less.text)||"Less Filters -";new MutationObserver(()=>{const s=e.getAttribute("aria-expanded")==="true";e.textContent=s?o:t}).observe(e,{attributes:!0,attributeFilter:["aria-expanded"]})};facetEventsOverride=()=>{document.addEventListener("mousedown",e=>{const t=e.target;t instanceof Element&&t.closest('[facet-receiver="options"]')&&!t.matches("input")&&e.preventDefault()},!0),document.addEventListener("click",e=>{const t=e.target;if(t instanceof Element){if(t.closest("elements-facet")){this.closeSortDropdown();return}if(t.closest("sort-button-handler")){this.closeAllFacets();return}this.closeSortDropdown(),this.closeAllFacets()}},!0),document.addEventListener("focusin",this.handleFacetOptionFocus,!0),document.addEventListener("keydown",this.handleFacetKeyboardScrollStart,!0),document.addEventListener("scroll",this.handleFacetDropdownListScroll,!0),document.addEventListener("wheel",this.handleFacetDropdownListWheel,{capture:!0,passive:!1}),document.addEventListener("touchstart",this.handleFacetDropdownListTouchStart,{capture:!0,passive:!0}),document.addEventListener("touchmove",this.handleFacetDropdownListTouchMove,{capture:!0,passive:!1}),document.addEventListener("touchend",this.clearFacetTouchList,!0),document.addEventListener("touchcancel",this.clearFacetTouchList,!0),this.setupFacetOptionsToggle(),this.setupToggleTextObserver()};startLoadingState=()=>{clearTimeout(this.#c),this.#c=setTimeout(()=>{document.querySelector(".facets-loading-state")?.classList.add("active")},300)};handleReload=()=>{const e=new URL(window.location.href);e.searchParams.has("pageNumber")&&(e.searchParams.delete("pageNumber"),window.history.replaceState(null,"",e.href));const t=new PopStateEvent("popstate",{state:null});dispatchEvent(t),this.startLoadingState(),this.initTracking()};initTracking=()=>{const e=document.querySelectorAll(".elements-facets-clear-all-button"),t=document.querySelectorAll(".elements-facets-dropdown-summary"),o=document.querySelectorAll("input[data-name]");e?.forEach(s=>s?.setAttribute("data-track","filterClear")),t?.forEach(s=>{s?.setAttribute("data-track","filterOpen")}),o.forEach(s=>{s?.setAttribute("data-facetoption",s?.getAttribute("data-option")),s?.setAttribute("data-facetname",s?.getAttribute("data-name"))})};initMobileFacets=()=>{const e=document.querySelector(".mobile-facets-open-btn"),t=document.querySelector(".view-product-btn"),o=document.querySelector(".close-mobile-facet-btn");e?.addEventListener("click",this.toggleMobileFacetMenu),o?.addEventListener("click",this.toggleMobileFacetMenu),t?.addEventListener("click",this.toggleMobileFacetMenu),t?.addEventListener("click",this.handleReload)};cleanupMobileFacets=()=>{const e=document.querySelector(".mobile-facets-open-btn"),t=document.querySelector(".view-product-btn"),o=document.querySelector(".close-mobile-facet-btn");e?.removeEventListener("click",this.toggleMobileFacetMenu),o?.removeEventListener("click",this.toggleMobileFacetMenu),t?.removeEventListener("click",this.toggleMobileFacetMenu),t?.removeEventListener("click",this.handleReload)};toggleMobileFacetMenu=()=>{document.querySelector(".mobile-facets-modal")?.classList.contains("hidden")?this.showModal():this.hideModal()};handleKeyDown=e=>{e.key==="Escape"&&this.hideModal()};showModal=()=>{const e=document.getElementById("facet-wrapper"),t=document.querySelector(".mobile-facets-modal"),o=document.querySelector(".mobile-facets-open-btn"),s=e?.querySelector(".close-mobile-facet-btn");this.#i=this.handleKeyDown.bind(this),document.addEventListener("keydown",this.#i),this.#e=f(t),t?.classList.remove("hidden"),e?.classList.add("!z-[1000]"),document.body?.classList.add("scrollBlock");const n=t?.querySelector(".list-height");
1n&&(n.scrollTop=0),o===document.activeElement&&s?.focus()};hideModal=()=>{const e=document.getElementById("facet-wrapper"),t=document.querySelector(".mobile-facets-modal"),o=document.querySelector(".mobile-facets-open-btn");document.removeEventListener("keydown",this.#i),e?.contains(document.activeElement)&&o?.focus(),this.#e&&(this.#e(),this.#e=null),t?.classList.add("hidden"),e?.classList.remove("!z-[1000]"),document.body?.classList.remove("scrollBlock")};updateViewButtonCount=()=>{const e=document.querySelector(".total-products"),t=document.querySelector(".view-product-text");if(!e||!t)return;const o=e.textContent.trim(),s=window.altitude?.i18n(()=>l.altitude.productlist.filter.mobile.view)||"View";t.textContent=o?`${s} ${o} items`:s};stripCountParentheses=e=>{if(!(e instanceof HTMLElement))return;(e.querySelectorAll?e.querySelectorAll(".elements-facet-option-count-text"):[]).forEach(o=>{o.textContent.startsWith("(")&&o.textContent.endsWith(")")&&(o.textContent=o.textContent.slice(1,-1))}),e.classList?.contains("elements-facet-option-count-text")&&e.textContent.startsWith("(")&&e.textContent.endsWith(")")&&(e.textContent=e.textContent.slice(1,-1))};fixAriaAttributes=e=>{if(!(e instanceof HTMLElement))return;e.querySelectorAll(".elements-facets-dropdown-summary").forEach(o=>{o.getAttribute("aria-haspopup")==="combobox"&&o.setAttribute("aria-haspopup","listbox")}),e.classList.contains("elements-facets-dropdown-summary")&&e.getAttribute("aria-haspopup")==="combobox"&&e.setAttribute("aria-haspopup","listbox")}}customElements.get("elements-facet-wrapper")||customElements.define("elements-facet-wrapper",m);
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.