PageSourceSearch

https://www.spiris.se/dist/js/comparison-table-block.ec4032b147dbfda81fcd.bundle.js

js spiris.se collected 2026-10-02 18:39:21 UTC 31,200 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkvismaspcscore=self.webpackChunkvismaspcscore||[]).push([[595],{4333:function(e,t,i){i.d(t,{ComparisonTableBlock:function(){return h}});var o=i(9336),s=i(1236),n=i(3385),r=i(7083),a=i(7643),l=i(7044);const d=({swiper:e,extendParams:t,on:i})=>{t({a11y:{enabled:!0,notificationClass:"swiper-notification",prevSlideMessage:"Previous slide",nextSlideMessage:"Next slide",firstSlideMessage:"This is the first slide",lastSlideMessage:"This is the last slide",paginationBulletMessage:"Go to slide {{index}}",slideLabelMessage:"{{index}} / {{slidesLength}}",containerMessage:null,containerRoleDescriptionMessage:null,containerRole:null,itemRoleDescriptionMessage:null,slideRole:"group",id:null,scrollOnFocus:!0,wrapperLiveRegion:!0}}),e.a11y={clicked:!1};let o,s=null,n=!1,r=(new Date).getTime();function d(){return e.params.a11y}function c(e){const t=s;t&&e&&(0,l.w)(t,e)}function h(e){(0,l.s)(e).forEach(e=>{e.setAttribute("tabIndex","0")})}function p(e){(0,l.s)(e).forEach(e=>{e.setAttribute("tabIndex","-1")})}function u(e,t){(0,l.s)(e).forEach(e=>{e.setAttribute("role",t)})}function m(e,t){(0,l.s)(e).forEach(e=>{e.setAttribute("aria-roledescription",t)})}function g(e,t){(0,l.s)(e).forEach(e=>{e.setAttribute("aria-label",t)})}function f(e){(0,l.s)(e).forEach(e=>{e.setAttribute("aria-disabled","true")})}function S(e){(0,l.s)(e).forEach(e=>{e.removeAttribute("aria-disabled")})}function w(t){if(13!==t.keyCode&&32!==t.keyCode)return;const i=d(),o=e.params.pagination,s=t.target;if(!e.pagination||!e.pagination.el||s!==e.pagination.el&&!e.pagination.el.contains(s)||s.matches((0,a.c)(o?.bulletClass))){if(e.navigation&&e.navigation.prevEl&&e.navigation.nextEl){const t=(0,l.s)(e.navigation.prevEl);(0,l.s)(e.navigation.nextEl).includes(s)&&(e.isEnd&&!e.params.loop||e.slideNext(),e.isEnd?c(i.lastSlideMessage):c(i.nextSlideMessage)),t.includes(s)&&(e.isBeginning&&!e.params.loop||e.slidePrev(),e.isBeginning?c(i.firstSlideMessage):c(i.prevSlideMessage))}e.pagination&&s.matches((0,a.c)(o?.bulletClass))&&s.click()}}function b(){return!!(e.pagination&&e.pagination.bullets&&e.pagination.bullets.length)}function v(){const t=e.params.pagination;return b()&&!!t?.clickable}const k=(e,t,i)=>{h(e),"BUTTON"!==e.tagName&&(u(e,"button"),e.addEventListener("keydown",w)),g(e,i)},E=t=>
1{o&&o!==t.target&&!o.contains(t.target)&&(n=!0),e.a11y.clicked=!0},y=()=>{n=!1,requestAnimationFrame(()=>{requestAnimationFrame(()=>{e.destroyed||(e.a11y.clicked=!1)})})},x=e=>{r=(new Date).getTime()},L=t=>{const i=d();if(e.a11y.clicked||!i.scrollOnFocus)return;if((new Date).getTime()-r<100)return;const s=t.target.closest(`.${e.params.slideClass}, swiper-slide`);if(!s||!e.slides.includes(s))return;o=s;const a=(e=>!!e.virtual&&!!e.params.virtual?.enabled)(e),l=(a?parseInt(s.getAttribute("data-swiper-slide-index")||"0",10):e.slides.indexOf(s))===e.activeIndex,c=e.params.watchSlidesProgress&&e.visibleSlides&&e.visibleSlides.includes(s);if(l||c)return;const h=t.sourceCapabilities;h&&h.firesTouchEvents||(e.isHorizontal()?e.el.scrollLeft=0:e.el.scrollTop=0,requestAnimationFrame(()=>{n||(e.params.loop?e.slideToLoop(e.getSlideIndexWhenGrid(parseInt(s.getAttribute("data-swiper-slide-index")||"0",10)),0):a?e.slideTo(e.getSlideIndexWhenGrid(parseInt(s.getAttribute("data-swiper-slide-index")||"0",10)),0):e.slideTo(e.getSlideIndexWhenGrid(e.slides.indexOf(s)),0),n=!1)}))},R=()=>{const t=d();t.itemRoleDescriptionMessage&&m(e.slides,t.itemRoleDescriptionMessage),t.slideRole&&u(e.slides,t.slideRole);const i=e.slides.length,o=t.slideLabelMessage;o&&e.slides.forEach((t,s)=>{const n=e.params.loop?parseInt(t.getAttribute("data-swiper-slide-index")||"0",10):s;g(t,o.replace(/\{\{index\}\}/,String(n+1)).replace(/\{\{slidesLength\}\}/,String(i)))})},C=()=>{const t=d();s&&e.el.append(s);const i=e.el;t.containerRoleDescriptionMessage&&m(i,t.containerRoleDescriptionMessage),t.containerMessage&&g(i,t.containerMessage),t.containerRole&&u(i,t.containerRole);const o=e.wrapperEl,n=String(t.id||o.getAttribute("id")||`swiper-wrapper-${function(e=16){return"x".repeat(e).replace(/x/g,()=>Math.round(16*Math.random()).toString(16))}(16)}`);var r,a;if(r=o,a=n,(0,l.s)(r).forEach(e=>{e.setAttribute("id",a)}),t.wrapperLiveRegion){const t=e.params.autoplay;!function(e,t){(0,l.s)(e).forEach(e=>{e.setAttribute("aria-live",t)})}(o,e.params.autoplay&&t?.enabled?"off":"polite")}R();const c=e.navigation?e.navigation:{nextEl:void 0,prevEl:void 0},h=(0,l.s)(c.nextEl),p=(0,l.s)(c.prevEl);if(h&&h.forEach(e=>k(e,0,t.nextSlideMessage)),p&&p.forEach(e=>k(e,0,t.prevSlideMessage)),v()){(0,l.s)(e.pagination.el).forEach(e=>{e.addEventListener("keydown",w)})}document.addEventListener("visibilitychange",x),e.el.addEventListener("focus",L,!0),e.el.addEventListener("pointerdown",E,!0),e.el.addEventListener("pointerup",y,!0)};i("beforeInit",()=>{s=(0,l.a)("span",d().notificationClass),s.setAttribute("aria-live","assertive"),s.setAttribute("aria-atomic","true")}),i("afterInit",()=>{d().enabled&&C()}),i("slidesLengthChange snapGridLengthChange slidesGridLengthChange",()=>{d().enabled&&R()}),i("fromEdge toEdge afterInit lock unlock",()=>{d().enabled&&function(){if(e.params.loop||e.params.rewind||!e.navigation)return;const{nextEl:t,prevEl:i}=e.navigation;i&&(e.isBeginning?(f(i),p(i)):(S(i),h(i))),t&&(e.isEnd?(f(t),p(t)):(S(t),h(t)))}()}),i("paginationUpdate",()=>{d().enabled&&function(){const t=d();if(!b())return;const i=e.params.pagination;e.pagination.bullets.forEach(e=>{i.clickable&&(h(e),i.renderBullet||(u(e,"button"),g(e,t.paginationBulletMessage.replace(/\{\{index\}\}/,String(((0,l.b)(e)??0)+1))))),e.matches((0,a.c)(i.bulletActiveClass))?e.setAttribute("aria-current","true"):e.removeAttribute("aria-current")})}()}),i("destroy",()=>{d().enabled&&function(){s&&s.remove();const t=e.navigation?e.navigation:{nextEl:void 0,prevEl:void 0},i=(0,l.s)(t.nextEl),o=(0,l.s)(t.prevEl);i&&i.forEach(e=>e.removeEventListener("keydown",w)),o&&o.forEach(e=>e.removeEventListener("keydown",w)),v()&&(0,l.s)(e.pagination.el).forEach(e=>{e.removeEventListener("keydown",w)});document.removeEventListener("visibilitychange",x),e.el&&"string"!=typeof e.el&&(e.el.removeEventListener("focus",L,!0),e.el.removeEventListener("pointerdown",E,!0),e.el.removeEventListener("pointerup",y,!0))}()})};var c=i(383);class h extends c.x{static selector=".ComparisonTableBlock";cardsHeader;cardsHeadingSlot;sections;menu;lgMediaQuery=window.matchMedia("(min-width: 992px)");xlMediaQuery=window.matchMedia("(min-width: 1200px)");openPopovers=new Set;scrollTicking=!1;resizeTicking=!1;headingScrollTicking=!1;stuckScrollTicking=!1;dataRows=[];rowsRafId=null;rowsActive=!1;static MIN_ROW_HEIGHT_PX=100;mobileRoot;mobileStickyEl=null;mobileDeeplinkBadgeSlot=null;mobileStickyBaseTop=0;mobileLastScrollY=0;mobileStickyScrollTicking=!1;modeButtons=[];modeMirrorTrigger=null;singleProductHeadingSlot=null;statusSecondProduct=null;singleProductLabel=null;singleProductLabelText=null;singleHeader=null;compareHeader=null;compareHeadingLeft=null;compareHeadingRight=null;comparePickerTrigger=null;swiperEl=null;swiperInstance=null;prevBtn=null;nextBtn=null;paginationEl=null;slides=[];compareEl=null;singleLinkSlot=null;compareLinkLeftSlot=null;compareLinkRightSlot=null;
1comparePriceLeftSlot=null;comparePriceRightSlot=null;defaultDropdownEl=null;compareDropdownEl=null;dropdownBackdropEl=null;openDropdownEl=null;defaultRadios=[];compareCheckboxes=[];compareCounter=null;compareEvictAnnouncer=null;compareSubmit=null;activeSingleIndex=0;compareLeftIndex=0;compareRightIndex=1;pendingCompareSelection=new Set;currentMode="single";cardAnchorToIndex=new Map;constructor(e){super(e),this.cardsHeader=e.querySelector(".ComparisonTableBlock-cards-header"),this.cardsHeadingSlot=e.querySelector("[data-cards-heading-slot]"),this.sections=Array.from(e.querySelectorAll(".ComparisonTableBlock-section")),this.menu=document.getElementById("main-menu"),this.mobileRoot=e.querySelector(".ComparisonTableBlock-mobile"),this.init()}init(){this.initPopoverTracking(),this.initPopoverOutsideClickDismiss(),window.addEventListener("scroll",this.onScrollDismissPopovers,{passive:!0}),this.buildAnchorIndex(),this.mobileRoot&&this.initMobile(),(this.cardsHeader||this.mobileRoot)&&(this.lgMediaQuery.addEventListener("change",this.onBreakpointChange),this.lgMediaQuery.matches?this.cardsHeader&&this.activate():this.mobileRoot&&this.activateMobile()),window.addEventListener("hashchange",this.onHashChange),document.addEventListener("click",this.onSameHashClick),this.handleDeepLink()}onBreakpointChange=e=>{e.matches?(this.cardsHeader&&this.activate(),this.mobileRoot&&this.deactivateMobile()):(this.cardsHeader&&this.deactivate(),this.mobileRoot&&this.activateMobile(),this.handleDeepLink())};activate(){window.addEventListener("scroll",this.onScrollToggleStuck,{passive:!0}),window.addEventListener("scroll",this.onScrollUpdateOffset,{passive:!0}),window.addEventListener("resize",this.onResize,{passive:!0}),this.cardsHeadingSlot&&this.sections.length>=2&&(window.addEventListener("scroll",this.onScrollUpdateHeading,{passive:!0}),this.updateCardsHeading()),this.updateHeaderOffset(),this.updateStuckState(),this.activateRowEqualization()}deactivate(){window.removeEventListener("scroll",this.onScrollToggleStuck),window.removeEventListener("scroll",this.onScrollUpdateOffset),window.removeEventListener("resize",this.onResize),window.removeEventListener("scroll",this.onScrollUpdateHeading),this.cardsHeader&&(this.cardsHeader.style.top="",this.cardsHeader.classList.remove("is-stuck")),this.deactivateRowEqualization()}activateRowEqualization(){this.dataRows=Array.from(this.nodeElement.querySelectorAll(".ComparisonTableBlock-section [role='row']")),0!==this.dataRows.length&&(this.rowsActive=!0,window.addEventListener("resize",this.scheduleRowEqualization,{passive:!0}),this.xlMediaQuery.addEventListener("change",this.scheduleRowEqualization),document.fonts&&document.fonts.ready.then(()=>{this.rowsActive&&this.scheduleRowEqualization()}),this.equalizeRows())}deactivateRowEqualization(){this.rowsActive=!1,window.removeEventListener("resize",this.scheduleRowEqualization),this.xlMediaQuery.removeEventListener("change",this.scheduleRowEqualization),null!==this.rowsRafId&&(cancelAnimationFrame(this.rowsRafId),this.rowsRafId=null);for(const e of this.dataRows)e.style.minHeight=""}scheduleRowEqualization=()=>{null===this.rowsRafId&&(this.rowsRafId=requestAnimationFrame(()=>{this.rowsRafId=null,this.equalizeRows()}))};equalizeRows(){if(0===this.dataRows.length)return;if(!this.xlMediaQuery.matches){for(const e of this.dataRows)e.style.minHeight="";return}for(const e of this.dataRows)e.style.minHeight="";let e=0;for(const t of this.dataRows){const i=t.getBoundingClientRect().height;i>e&&(e=i)}const t=`${Math.max(Math.ceil(e),h.MIN_ROW_HEIGHT_PX)}px`;for(const e of this.dataRows)e.style.minHeight=t}getMenuBottom(){return this.menu?Math.max(0,this.menu.getBoundingClientRect().bottom):0}updateHeaderOffset(){this.cardsHeader&&(this.cardsHeader.style.top=`${this.getMenuBottom()}px`)}initPopoverTracking(){this.nodeElement.addEventListener("shown.bs.popover",e=>{const t=e.target;t&&this.openPopovers.add(t)}),this.nodeElement.addEventListener("hidden.bs.popover",e=>{const t=e.target;t&&this.openPopovers.delete(t)})}initPopoverOutsideClickDismiss(){document.addEventListener("click",e=>{if(0===this.openPopovers.size)return;const t=e.target instanceof Element?e.target:null;if(!t)return;if(t.closest(".popover.show"))return;const i=t.closest('[data-bs-toggle="popover"]');for(const e of this.openPopovers)e!==i&&o.AM.getInstance(e)?.hide();i&&!this.openPopovers.has(i)&&o.AM.getInstance(i)?.show()})}onScrollUpdateHeading=()=>{this.headingScrollTicking||(this.headingScrollTicking=!0,requestAnimationFrame(()=>{this.updateCardsHeading(),this.headingScrollTicking=!1}))};updateCardsHeading(){if(!this.cardsHeadingSlot||!this.cardsHeader)return;const e=this.cardsHeader.getBoundingClientRect().bottom+1;let t=null;for(const i of this.sections){const o=i.getBoundingClientRect();if(o.top<e&&o.bottom>e){t=i;break}}if(!t)for(const i of this.sections){if(!(i.getBoundingClientRect().top<e))break;t=i}t||(t=this.sections[0]??null);const i=t?.dataset.cardsHeading??"";this.cardsHeadingSlot.textContent!==i&&(this.cardsHeadingSlot.textContent=i)}onScrollDismissPopovers=()=>{this.dismissOpenPopovers()};onScrollToggleStuck=()=>{this.stuckScrollTicking||(this.stuckScrollTicking=!0,requestAnimationFrame(()=>{this.updateStuckState(),this.stuckScrollTicking=!1}))};updateStuckState(){if(!this.cardsHeader)return;const e=this.getMenuBottom(),t=this.cardsHeader.getBoundingClientRect().top<=e+1;this.cardsHeader.classList.toggle("is-stuck",t)}onScrollUpdateOffset=()=>{this.scrollTicking||(this.scrollTicking=!0,requestAnimationFrame(()=>{this.updateHeaderOffset(),this.scrollTicking=!1}))};onResize=()=>{this.resizeTicking||(this.resizeTicking=!0,requestAnimationFrame(()=>{this.updateHeaderOffset(),this.resizeTicking=!1}))};dismissOpenPopovers(){for(const e of this.openPopovers)o.AM.getInstance(e)?.hide()}readIntDataset(e,t,i){const o=e.dataset[t];if(void 0===o||""===o)return i;const s=parseInt(o,10);return Number.isFinite(s)?s:i}initMobile(){this.mobileRoot&&(this.activeSingleIndex=this.readIntDataset(this.mobileRoot,"defaultCardIndex",0),this.compareLeftIndex=this.readIntDataset(this.mobileRoot,"compareLeftIndex",0),this.compareRightIndex=this.readIntDataset(this.mobileRoot,"compareRightIndex",1),this.mobileStickyEl=this.mobileRoot.querySelector("[data-mobile-sticky]"),this.mobileDeeplinkBadgeSlot=this.mobileRoot.querySelector("[data-mobile-deeplink-badge]"),this.modeButtons=Array.from(this.mobileRoot.querySelectorAll(".btn-toggle[data-mode-target]")),this.modeMirrorTrigger=this.mobileRoot.querySelector("[data-mode-mirror-trigger]"),this.singleProductHeadingSlot=this.mobileRoot.querySelector("[data-single-product-heading-slot]"),this.statusSecondProduct=this.mobileRoot.querySelector("[data-status-second-product]"),this.singleProductLabel=this.mobileRoot.querySelector("[data-single-product-label]"),this.singleProductLabelText=this.mobileRoot.querySelector("[data-single-product-label-text]"),this.singleHeader=this.mobileRoot.querySelector("[data-single-header]"),this.compareHeader=this.mobileRoot.querySelector("[data-compare-header]"),this.compareHeadingLeft=this.mobileRoot.querySelector("[data-compare-heading='left']"),this.compareHeadingRight=this.mobileRoot.querySelector("[data-compare-heading='right']"),this.comparePickerTrigger=this.mobileRoot.querySelector("[data-compare-picker-trigger]"),this.swiperEl=this.mobileRoot.querySelector("[data-comparison-swiper]"),this.prevBtn=this.mobileRoot.querySelector("[data-swiper-prev]"),this.nextBtn=this.mobileRoot.querySelector("[data-swiper-next]"),this.paginationEl=this.mobileRoot.querySelector("[data-swiper-pagination]"),this.slides=this.swiperEl?Array.from(this.swiperEl.querySelectorAll(".swiper-slide[data-card-index]")):[],this.compareEl=this.mobileRoot.querySelector("[data-comparison-compare]"),this.comparePrice
1LeftSlot=this.compareEl?.querySelector("[data-compare-price='left']")??null,this.comparePriceRightSlot=this.compareEl?.querySelector("[data-compare-price='right']")??null,this.compareLinkLeftSlot=this.mobileRoot.querySelector("[data-compare-link='left']"),this.compareLinkRightSlot=this.mobileRoot.querySelector("[data-compare-link='right']"),this.singleLinkSlot=this.mobileRoot.querySelector("[data-single-link-slot]"),this.defaultDropdownEl=this.mobileRoot.querySelector("[data-dropdown-default]"),this.compareDropdownEl=this.mobileRoot.querySelector("[data-dropdown-compare]"),this.dropdownBackdropEl=this.mobileRoot.querySelector("[data-dropdown-backdrop]"),this.defaultRadios=this.defaultDropdownEl?Array.from(this.defaultDropdownEl.querySelectorAll("input[type='radio'][data-card-index]")):[],this.compareCheckboxes=this.compareDropdownEl?Array.from(this.compareDropdownEl.querySelectorAll("input[type='checkbox'][data-card-index]")):[],this.compareCounter=this.compareDropdownEl?.querySelector("[data-compare-counter]")??null,this.compareEvictAnnouncer=this.compareDropdownEl?.querySelector("[data-compare-evict-announcer]")??null,this.compareSubmit=this.compareDropdownEl?.querySelector("[data-compare-submit]")??null,this.applyHashToInitialIndices(),this.initMobileToggle(),this.initSwiper(),this.updateSingleLinkSlot(),this.initDefaultDropdown(),this.initCompareDropdown(),this.initDropdownGlobalCloseHandlers(),this.initMobileSticky(),this.initBlockVisibilityObserver())}initBlockVisibilityObserver(){if(!this.mobileRoot)return;new IntersectionObserver(e=>{for(const t of e)!t.isIntersecting&&this.openDropdownEl&&this.hideDropdown(this.openDropdownEl)},{threshold:0}).observe(this.mobileRoot)}initMobileSticky(){if(!this.mobileStickyEl)return;const e=window.getComputedStyle(this.mobileStickyEl).top;this.mobileStickyBaseTop=Number.parseFloat(e)||0}activateMobile(){this.mobileStickyEl&&this.menu&&(this.mobileLastScrollY=window.scrollY,window.addEventListener("scroll",this.onScrollUpdateMobileSticky,{passive:!0}),window.visualViewport?.addEventListener("resize",this.onVisualViewportResize,{passive:!0}),this.updateMobileStickyOffset())}deactivateMobile(){window.removeEventListener("scroll",this.onScrollUpdateMobileSticky),window.visualViewport?.removeEventListener("resize",this.onVisualViewportResize),this.mobileStickyEl&&(this.mobileStickyEl.style.top="",this.mobileStickyEl.classList.remove("is-stuck"))}updateMobileStickyOffset(e=0){if(!this.mobileStickyEl||!this.menu)return;if(this.openDropdownEl)return this.mobileStickyEl.style.top=`${this.mobileStickyBaseTop}px`,void this.mobileStickyEl.classList.remove("is-stuck");const t=Math.max(0,this.menu.getBoundingClientRect().bottom),i=this.mobileStickyBaseTop+t;if(this.mobileStickyEl.style.top=`${i}px`,e>0){const e=this.mobileStickyEl.getBoundingClientRect().top<=i+1;this.mobileStickyEl.classList.toggle("is-stuck",e)}else e<0&&this.mobileStickyEl.classList.remove("is-stuck")}onScrollUpdateMobileSticky=()=>{this.mobileStickyScrollTicking||(this.mobileStickyScrollTicking=!0,requestAnimationFrame(()=>{const e=Math.max(0,window.scrollY),t=e-Math.max(0,this.mobileLastScrollY);this.mobileLastScrollY=e,this.updateMobileStickyOffset(t),this.mobileStickyScrollTicking=!1}))};onVisualViewportResize=()=>{this.updateMobileStickyOffset()};initMobileToggle(){for(const e of this.modeButtons)e.addEventListener("click",()=>{const t=e.dataset.modeTarget;t&&this.setMode(t)});this.modeMirrorTrigger?.addEventListener("click",()=>{const e="single"===this.currentMode?"compare":"single";this.setMode(e)})}setMode(e,t="user"){if(e===this.currentMode&&"deeplink"!==t)return;"user"===t&&this.setMobileDeeplinkBadge(null);const i=e!==this.currentMode,o=window.scrollY;i&&(this.currentMode=e,this.mobileRoot?.setAttribute("data-mode",e));for(const t of this.modeButtons){const i=t.dataset.modeTarget===e;t.classList.toggle("active",i),t.setAttribute("aria-pressed",i?"true":"false")}"single"===e?this.enterSingleMode():this.enterCompareMode(),i&&requestAnimationFrame(()=>{window.scrollY!==o&&window.scrollTo({top:o})})}enterSingleMode(){this.singleHeader?.classList.remove("d-none"),this.swiperEl?.classList.remove("d-none"),this.compareHeader?.classList.add("d-none"),this.compareEl?.classList.add("d-none"),this.syncSingleSlide
1Ui(),this.updateSingleLinkSlot(),this.swiperInstance?.enable(),this.swiperInstance?.update(),this.dismissOpenPopovers()}syncSingleSlideUi(){const e=this.readCardHeading(this.activeSingleIndex);this.singleProductHeadingSlot&&(this.singleProductHeadingSlot.textContent=e),this.singleProductLabelText&&(this.singleProductLabelText.textContent=e);for(const e of this.defaultRadios)e.checked=parseInt(e.dataset.cardIndex??"-1",10)===this.activeSingleIndex}enterCompareMode(){this.singleHeader?.classList.add("d-none"),this.swiperEl?.classList.add("d-none"),this.compareHeader?.classList.remove("d-none"),this.compareEl?.classList.remove("d-none"),this.updateCompareStatus(),this.swiperInstance?.disable(),this.renderCompareCard(),this.dismissOpenPopovers()}initSwiper(){if(!this.swiperEl||0===this.slides.length)return;const e={modules:[n.A,r.A,d],slidesPerView:1,spaceBetween:16,autoHeight:!0,initialSlide:this.activeSingleIndex,navigation:!(!this.prevBtn||!this.nextBtn)&&{prevEl:this.prevBtn,nextEl:this.nextBtn},pagination:!!this.paginationEl&&{el:this.paginationEl,clickable:!0,type:"bullets"},noSwiping:!0,noSwipingSelector:'[data-bs-toggle="popover"]',a11y:{prevSlideMessage:"Föregående produkt",nextSlideMessage:"Nästa produkt",paginationBulletMessage:"Gå till produkt {{index}}",slideLabelMessage:"Produkt {{index}} av {{slidesLength}}"},on:{slideChange:()=>this.onSlideChange()}};this.swiperInstance=new s.A(this.swiperEl,e)}onSlideChange(){if(!this.swiperInstance)return;this.activeSingleIndex=this.swiperInstance.activeIndex;this.slides[this.activeSingleIndex]&&(this.setMobileDeeplinkBadge(null),this.syncSingleSlideUi(),this.updateSingleLinkSlot(),this.dismissOpenPopovers())}updateSingleLinkSlot(){if(!this.singleLinkSlot)return;if("single"!==this.currentMode)return;this.singleLinkSlot.replaceChildren();const e=this.slides[this.activeSingleIndex],t=e?.querySelector("[data-slide-link]");if(!t)return;const i=t.cloneNode(!0);i.classList.remove("d-none"),i.id&&i.removeAttribute("id");for(const e of i.querySelectorAll("[id]"))e.removeAttribute("id");this.singleLinkSlot.appendChild(i)}readCardHeading(e){return this.slides[e]?.dataset.cardHeading??""}initDefaultDropdown(){if(!this.defaultDropdownEl)return;this.defaultDropdownEl.addEventListener("show.bs.collapse",()=>{this.onDropdownShow(this.defaultDropdownEl),this.singleProductLabel?.classList.add("is-open")}),this.defaultDropdownEl.addEventListener("hidden.bs.collapse",()=>{this.onDropdownHidden(this.defaultDropdownEl),this.singleProductLabel?.classList.remove("is-open"),this.singleProductLabel?.focus()});const e=this.defaultDropdownEl.querySelector("[data-default-submit]");e?.addEventListener("click",e=>{e.preventDefault();const t=this.defaultRadios.find(e=>e.checked),i=t?parseInt(t.dataset.cardIndex??"0",10):this.activeSingleIndex;this.swiperInstance?.slideTo(i),this.hideDropdown(this.defaultDropdownEl)});const t=this.defaultDropdownEl.querySelector("[data-dropdown-close]");t?.addEventListener("click",e=>{e.preventDefault(),this.hideDropdown(this.defaultDropdownEl)})}initCompareDropdown(){if(!this.compareDropdownEl)return;this.compareDropdownEl.addEventListener("show.bs.collapse",()=>{this.pendingCompareSelection.clear(),this.pendingCompareSelection.add(this.compareLeftIndex),this.pendingCompareSelection.add(this.compareRightIndex);for(const e of this.compareCheckboxes){const t=parseInt(e.dataset.cardIndex??"-1",10);e.checked=this.pendingCompareSelection.has(t)}this.updateCompareDropdownState(),this.onDropdownShow(this.compareDropdownEl),this.comparePickerTrigger?.classList.add("is-open")}),this.compareDropdownEl.addEventListener("hidden.bs.collapse",()=>{this.pendingCompareSelection.clear(),this.onDropdownHidden(this.compareDropdownEl),this.comparePickerTrigger?.classList.remove("is-open"),this.comparePickerTrigger?.focus()});for(const e of this.compareCheckboxes)e.addEventListener("change",()=>{const t=parseInt(e.dataset.cardIndex??"-1",10);if(e.checked){if(this.pendingCompareSelection.size>=2){const e=this.pendingCompareSelection.values().next().value;if(void 0!==e){this.pendingCompareSelection.delete(e);const t=this.compareCheckboxes.find(t=>parseInt(t.dataset.cardIndex??"-1",10)===e);t&&(t.checked=!1,this.announceCompareEviction(t))}}this.pendingCompareSelection.add(t)}else this.pendingCompareSelection.delete(t);this.updateCompareDropdownState()});this.compareSubmit?.addEventListener("click",e=>{if(e.preventDefault(),2!==this.pendingCompareSelection.size)return;const t=Array.from(this.pendingCompareSelection);this.compareLeftIndex=Math.min(...t),this.compareRightIndex=Math.max(...t),this.renderCompareCard(),this.updateCompareStatus(),this.hideDropdown(this.compareDropdownEl)});const e=this.compareDropdownEl.querySelector("[data-dropdown-close]");e?.addEventListener("click",e=>{e.preventDefault(),this.hideDropdown(this.compareDropdownEl)})}updateCompareStatus(){this.singleProductHeadingSlot&&(this.singleProductHeadingSlot.textContent=this.readCardHeading(this.compareLeftIndex)),this.statusSecondProduct&&(this.statusSecondProduct.textContent=this.readCardHeading(this.compareRightIndex))}updateCompareDropdownState(){const e=this.pendingCompareSelection.size;this.compareCounter&&(this.compareCounter.textContent=`${e} av 2 valda`),this.compareSubmit&&(this.compareSubmit.disabled=2!==e)}announceCompareEviction(e){if(!this.compareEvictAnnouncer)return;const t=e.labels?.[0]?.querySelector(".h4")?.textContent?.trim()??"";this.compareEvictAnnouncer.textContent=t?`${t} togs bort från jämförelsen`:""}hideDropdown(e){o.SD.getOrCreateInstance(e,{toggle:!1}).hide()}onDropdownShow(e){this.openDropdownEl=e,this.dropdownBackdropEl?.classList.add("is-shown"),this.updateMobileStickyOffset(),this.scrollToStickyPin()}scrollToStickyPin(){if(!this.mobileStickyEl)return;const e=this.mobileStickyEl.getBoundingClientRect();if(e.top<=0)return;const t=window.matchMedia("(prefers-reduced-motion: reduce)").matches;window.scrollTo({top:Math.max(0,window.scrollY+e.top),behavior:t?"auto":"smooth"})}onDropdownHidden(e){this.openDropdownEl===e&&(this.openDropdownEl=null,this.dropdownBackdropEl?.classList.remove("is-shown"),this.updateMobileStickyOffset())}initDropdownGlobalCloseHandlers(){this.dropdownBackdropEl?.addEventListener("click",()=>{this.openDropdownEl&&this.hideDropdown(this.openDropdownEl)}),document.addEventListener("keydown",e=>{"Escape"===e.key&&this.openDropdownEl&&this.hideDropdown(this.openDropdownEl)}),document.addEventListener("click",e=>{if(!this.openDropdownEl)return;const t=e.target;this.openDropdownEl.contains(t)||this.mobileStickyEl?.contains(t)||this.hideDropdown(this.openDropdownEl)})}renderCompareCard(){const e=this.slides[this.compareLeftIndex],t=this.slides[this.compareRightIndex];if(!e||!t||!this.compareEl)return;this.compareHeadingLeft&&(this.compareHeadingLeft.textContent=this.readCardHeading(this.compareLeftIndex)),this.compareHeadingRight&&(this.compareHeadingRight.textContent=this.readCardHeading(this.compareRightIndex)),this.fillPriceSlot(this.comparePrice
1LeftSlot,e),this.fillPriceSlot(this.comparePriceRightSlot,t);const i=this.indexRowsByDataAttr(e),o=this.indexRowsByDataAttr(t),s=this.compareEl.querySelectorAll("[data-row-index]");for(const e of s){const t=e.dataset.rowIndex;if(void 0===t)continue;const s=e.querySelector("[data-compare-slot='left']"),n=e.querySelector("[data-compare-slot='right']");this.fillBadgeSlot(s,i.get(t)??null),this.fillBadgeSlot(n,o.get(t)??null)}this.fillLinkSlot(this.compareLinkLeftSlot,e),this.fillLinkSlot(this.compareLinkRightSlot,t)}indexRowsByDataAttr(e){const t=new Map;for(const i of e.querySelectorAll("[data-row-index]")){const e=i.dataset.rowIndex;void 0!==e&&t.set(e,i)}return t}fillPriceSlot(e,t){if(!e)return;const i=e.querySelector("[data-compare-price-amount]"),o=t.querySelector("[data-slide-price-amount]");i&&(i.textContent=o?.textContent?.trim()??"")}fillBadgeSlot(e,t){if(!e)return;if(e.replaceChildren(),!t)return;const i=t.querySelector(".badge");i&&e.appendChild(i.cloneNode(!0));const o=t.querySelector(".ComparisonTableBlock-more-info-text");o&&e.appendChild(o.cloneNode(!0))}fillLinkSlot(e,t){if(!e)return;e.replaceChildren();const i=t.querySelector("[data-slide-link]");if(i)for(const t of Array.from(i.children)){const i=t.cloneNode(!0);i instanceof HTMLElement&&i.classList.add("w-100"),e.appendChild(i)}}buildAnchorIndex(){this.cardAnchorToIndex.clear();const e=this.nodeElement.querySelectorAll("[data-card-anchor][data-card-index]");for(const t of e){const e=t.dataset.cardAnchor?.trim().toLowerCase(),i=t.dataset.cardIndex;if(!e||void 0===i)continue;const o=parseInt(i,10);Number.isFinite(o)&&(this.cardAnchorToIndex.has(e)||this.cardAnchorToIndex.set(e,o))}}parseDeepLinkHash(){const e=window.location.hash;if(!e||e.length<=1)return{primary:null,secondary:null,scroll:!0};const[t="",i=""]=e.slice(1).split("?"),o=!i.split("&").includes("noscroll");if(t.startsWith("tabell-")){const e=this.decodeAnchor(t.slice(7));if(e)return{primary:e,secondary:null,scroll:o}}else if(t.startsWith("jamfor-")){const e=t.slice(7),i=e.indexOf("_");if(i>=0){const t=this.decodeAnchor(e.slice(0,i)),s=this.decodeAnchor(e.slice(i+1));if(t&&s)return{primary:t,secondary:s,scroll:o}}}return{primary:null,secondary:null,scroll:o}}decodeAnchor(e){if(!e)return null;try{return decodeURIComponent(e).trim().toLowerCase()||null}catch{return null}}setMobileDeeplinkBadge(e){if(!this.mobileDeeplinkBadgeSlot)return;if(this.mobileDeeplinkBadgeSlot.replaceChildren(),null===e)return;const t=this.nodeElement.querySelector(`.ComparisonTableBlock-cards-header [data-card-index="${e}"] .badge`);t&&this.mobileDeeplinkBadgeSlot.appendChild(t.cloneNode(!0))}clearDeeplinkHighlight(){for(const e of this.nodeElement.querySelectorAll("[data-card-highlight-style]"))e.classList.remove("highlight-gray","highlight-lavender")}applyDeeplinkHighlight(e){const t=new Set(e);for(const e of this.nodeElement.querySelectorAll("[data-card-index][data-card-highlight-style]")){const i=parseInt(e.dataset.cardIndex??"-1",10);if(!t.has(i))continue;const o=e.dataset.cardHighlightStyle?.trim();o&&e.classList.add(o)}}applyHashToInitialIndices(){const{primary:e,secondary:t}=this.parseDeepLinkHash();if(!e)return;const i=this.cardAnchorToIndex.get(e);if(void 0!==i)if(t){const e=this.cardAnchorToIndex.get(t);if(void 0===e||e===i)return;this.compareLeftIndex=Math.min(i,e),this.compareRightIndex=Math.max(i,e),this.lgMediaQuery.matches||(this.currentMode="compare",this.mobileRoot?.setAttribute("data-mode","compare"))}else this.activeSingleIndex=i}handleDeepLink=()=>{this.clearDeeplinkHighlight();const{primary:e,secondary:t,scroll:i}=this.parseDeepLinkHash();if(!e)return void this.setMobileDeeplinkBadge(null);const o=this.cardAnchorToIndex.get(e);if(void 0===o)return;let s=null;if(t){const e=this.cardAnchorToIndex.get(t);void 0!==e&&e!==o&&(s=e)}if(this.applyDeeplinkHighlight(null!==s?[o,s]:[o]),this.mobileRoot&&!this.lgMediaQuery.matches&&(null!==s?(this.compareLeftIndex=Math.min(o,s),this.compareRightIndex=Math.max(o,s),this.setMode("compare","deeplink"),this.setMobileDeeplinkBadge(null)):(this.activeSingleIndex=o,this.setMode("single","deeplink"),this.swiperInstance?.
1slideTo(o),this.setMobileDeeplinkBadge(o))),!i)return;const n=window.matchMedia("(prefers-reduced-motion: reduce)").matches,r=this.lgMediaQuery.matches?this.nodeElement.querySelector(`.ComparisonTableBlock-cards-header [data-card-index="${o}"]`):this.mobileStickyEl;r?.scrollIntoView({block:"start",behavior:n?"auto":"smooth"})};onHashChange=()=>{this.handleDeepLink()};onSameHashClick=e=>{const t=e.target?.closest('a[href*="#tabell-"], a[href*="#jamfor-"]');if(!t)return;const i=new URL(t.href,window.location.href);i.origin===window.location.origin&&i.pathname===window.location.pathname&&i.hash===window.location.hash&&requestAnimationFrame(()=>this.handleDeepLink())}}}}]);

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.