PageSourceSearch

https://richandroyal.ch/cdn/shop/t/112/assets/custom.js?v=120067999623262461871786619123

js richandroyal.ch collected 2026-09-26 07:39:37 UTC 22,677 bytes, 4 lines download raw bytes

1document.addEventListener("DOMContentLoaded",()=>{(async function freeProductBar(){if(document.querySelector(".free-product-bar")){let addFreeProduct2=function(freeProductID){let formData={items:[{id:freeProductID,quantity:1,properties:{_gift:"true"}}]};giftInCart||fetch(window.Shopify.routes.root+"cart/add.js",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(formData)}).then(()=>{window.themeVariables.settings.pageType==="cart"?location.reload():document.dispatchEvent(new CustomEvent("cart:refresh")),cartDot.innerHTML=cartContent.item_count+1}).catch(error=>{console.error("Error:",error)})},removeFreeProduct2=function(freeProductKey){fetch(window.Shopify.routes.root+"cart/change.js",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:freeProductKey,quantity:0,sections:["sections--22807016931593__cart-drawer"]})}).then(()=>{window.themeVariables.settings.pageType==="cart"?location.reload():document.dispatchEvent(new CustomEvent("cart:refresh")),cartDot.innerHTML=cartContent.item_count-1||""}).catch(error=>{console.error("Error:",error)})};var addFreeProduct=addFreeProduct2,removeFreeProduct=removeFreeProduct2;const cartContent=await(await fetch(`${Shopify.routes.root}cart.js`)).json(),cartDot=document.querySelector("cart-dot"),threshold=Number(document.querySelector(".free-product-bar").getAttribute("threshold")),giftId=Number(document.querySelector(".free-product-bar").getAttribute("variant-id"));let thresholdReached=!1,giftInCart=!1,giftKey;if(cartContent.total_price>threshold&&(thresholdReached=!0),cartContent&&cartContent.items.length>0){for(const item of cartContent.items)for(const property in item.properties)if(property=="_gift"){giftInCart=!0,giftKey=item.key;break}}thresholdReached&&!giftInCart&&giftId&&!localStorage.getItem("block_free_product")?addFreeProduct2(giftId):!thresholdReached&&giftInCart&&giftKey?(removeFreeProduct2(giftKey),localStorage.removeItem("block_free_product")):thresholdReached||localStorage.removeItem("block_free_product")}document.addEventListener("cart:change",()=>{setTimeout(()=>{freeProductBar()})})})()}),document.addEventListener("DOMContentLoaded",()=>{function tryClick(){const start=Date.now(),btn=document.querySelector("#saiz-widget-button");btn?btn.click():Date.now()-start<1e4&&setTimeout(tryClick,100)}function handleTextSizeGuideOpener(){const sizeGuideOpener2=document.querySelector(".size-guide-opener"),saizButton=document.querySelector("#saiz-widget-button"),saizButtonSize=document.querySelector(".saiz-recommender-button-size");console.log({saizButton,sizeGuideOpener:sizeGuideOpener2}),saizButton&&saizButton.textContent.trim()&&(saizButtonSize&&saizButtonSize.textContent.length>0?sizeGuideOpener2.innerText=sizeGuideOpener2.getAttribute("data-size-guide-active").replace("{{ size }}",saizButtonSize.textContent.trim()):sizeGuideOpener2.innerText=sizeGuideOpener2.getAttribute("data-size-guide"))}let currentObserver=null;function startObserving(element){currentObserver&&currentObserver.disconnect(),currentObserver=new MutationObserver((mutations,obs)=>{const saizButton=document.querySelector(".saiz-recommender-button"),saizButtonContent=document.querySelector(".saiz-recommender-button-content");(saizButton||saizButtonContent)&&(handleTextSizeGuideOpener(),obs.disconnect(),currentObserver=null)}),currentObserver.observe(element,{childList:!0,subtree:!0}),setTimeout(()=>{currentObserver&&(currentObserver.disconnect(),currentObserver=null)},1e4)}const sizeGuideOpener=document.querySelector(".size-guide-opener");sizeGuideOpener&&(startObserving(document.body),sizeGuideOpener.addEventListener("click",()=>{setTimeout(()=>{const saizButtonSize=document.querySelector(".saiz-recommender-button-size");if(saizButtonSize){const sizeObserver=new MutationObserver(mutations=>{handleTextSizeGuideOpener(),sizeObserver.disconnect()});sizeObserver.observe(saizButtonSize,{childList:!0,characterData:!0,subtree:!0})}},5e3),tryClick()}),document.addEventListener("variant:change",()=>{const sizeGuideOpener2=document.querySelector(".size-guide-opener");handleTextSizeGuideOpener(),sizeGuideOpener2.addEventListener("click",()=>tryClick())}))});class ProductCardVideo extends HTMLElement{constructor(){super(),this.pauseVideoButton=this.querySelector(".pause-video-button"),this.playVideoButton=this.querySelector(".play-video-button");const localContainer=this.parentElement,container=this.closest("product-card")||this.closest(".horizontal-product-card")||this.closest(".media-grid__item");this.videoMedia=localContainer?.querySelector("video-media")||container?.querySelector("video-media"),this.video=localContainer?.querySelector("video")||container?.querySelector("video"),this.animatedImage=localContainer?.querySelector(".media-grid__animated-image")||null,this.staticImage=localContainer?.querySelector(".media-grid__static-image")||null,this.isGif=!!(this.animatedImage&&this.staticImage),this.isGifPlaying=this.isGif,!(!this.pauseVideoButton||!this.playVideoButton||!this.videoMedia&&!this.video&&!this.isGif)&&(this.handlePause=this.handlePause.bind(this),this.handlePlay=this.handlePlay.bind(this),this.handleState=this.handleState.bind(this),this.pauseVideoButton.addEventListener("click",this.handlePause),this.playVideoButton.addEventListener("click",this.handlePlay),this.videoMedia&&(this.videoMedia.addEventListener("media:play",this.handleState),this.videoMedia.addEventListener("media:pause",this.handleState)),this.video&&(this.video.addEventListener("play",this.handleState),this.video.addEventListener("pause",this.handleState)),this.handleState())}disconnectedCallback(){this.pauseVideoButton?.removeEventListener("click",this.handlePause),this.playVideoButton?.removeEventListener("click",this.handlePlay),this.videoMedia?.removeEventListener("media:play",this.handleState),this.videoMedia?.removeEventListener("media:pause",this.handleState),this.video?.removeEventListener("play",this.handleState),this.video?.removeEventListener("pause",this.handleState)}handlePause(event){event.preventDefault(),event.stopPropagation(),this.videoMedia?this.videoMedia.pause():this.isGif?(this.isGifPlaying=!1,this.handleState()):this.video.pause()}handlePlay(event){event.preventDefault(),event.stopPropagation(),this.videoMedia?this.videoMedia.play():this.isGif?(this.isGifPlaying=!0,this.handleState()):this.video.play()}handleState(){const isPlaying=this.videoMedia?this.videoMedia.hasAttribute("playing"):this.isGif?this.isGifPlaying:!this.video.paused;this.isGif&&(this.animatedImage.hidden=!isPlaying,this.staticImage.hidden=isPlaying),this.hidden=!1,this.playVideoButton.style.display=isPlaying?"n
1one":"block",this.pauseVideoButton.style.display=isPlaying?"block":"none"}}customElements.define("product-card-video",ProductCardVideo);function getDiscountCode(){const cookieDiscountCode=document.cookie.split("; ")?.find(row=>row.startsWith("discount_code="))?.split("=")[1];if(cookieDiscountCode)return cookieDiscountCode;let urlDiscountCode=new URLSearchParams(window.location.search).get("discount");if(!urlDiscountCode){const pathMatch=window.location.pathname.match(/\/discount\/([^\/]+)/);pathMatch&&(urlDiscountCode=pathMatch[1])}if(!urlDiscountCode&&document.referrer){const referrerPathMatch=document.referrer.match(/\/discount\/([^\/\?]+)/);referrerPathMatch&&(urlDiscountCode=referrerPathMatch[1])}return urlDiscountCode}function md5(r){var n,t,e,o,u,f,i,a,c,g,C,h=function(r2,n2){return r2<<n2|r2>>>32-n2},l=function(r2,n2){var t2,e2,o2,u2,f2;return o2=2147483648&r2,u2=2147483648&n2,f2=(1073741823&r2)+(1073741823&n2),(t2=1073741824&r2)&(e2=1073741824&n2)?2147483648^f2^o2^u2:t2|e2?1073741824&f2?3221225472^f2^o2^u2:1073741824^f2^o2^u2:f2^o2^u2},d=function(r2,n2,t2,e2,o2,u2,f2){return r2=l(r2,l(l((function(r3,n3,t3){return r3&n3|~r3&t3})(n2,t2,e2),o2),f2)),l(h(r2,u2),n2)},s=function(r2,n2,t2,e2,o2,u2,f2){return r2=l(r2,l(l((function(r3,n3,t3){return r3&t3|n3&~t3})(n2,t2,e2),o2),f2)),l(h(r2,u2),n2)},v=function(r2,n2,t2,e2,o2,u2,f2){return r2=l(r2,l(l((function(r3,n3,t3){return r3^n3^t3})(n2,t2,e2),o2),f2)),l(h(r2,u2),n2)},m=function(r2,n2,t2,e2,o2,u2,f2){return r2=l(r2,l(l((function(r3,n3,t3){return n3^(r3|~t3)})(n2,t2,e2),o2),f2)),l(h(r2,u2),n2)},S=function(r2){var n2,t2="",e2="";for(n2=0;n2<=3;n2++)t2+=(e2="0"+(r2>>>8*n2&255).toString(16)).substr(e2.length-2,2);return t2};for(a=1732584193,c=4023233417,g=2562383102,C=271733878,n=(t=(function(r2){for(var n2,t2=r2.length,e2=t2+8,o2=16*((e2-e2%64)/64+1),u2=new Array(o2-1),f2=0,i2=0;i2<t2;)f2=i2%4*8,u2[n2=(i2-i2%4)/4]=u2[n2]|r2.charCodeAt(i2)<<f2,i2++;return f2=i2%4*8,u2[n2=(i2-i2%4)/4]=u2[n2]|128<<f2,u2[o2-2]=t2<<3,u2[o2-1]=t2>>>29,u2})(r=(function(r2){var n2,t2,e2,o2="";n2=t2=0,e2=(r2=(r2+"").replace(/\r\n/g,`
2`).replace(/\r/g,`
3`)).length;for(var u2=0;u2<e2;u2++){var f2=r2.charCodeAt(u2),i2=null;f2<128?t2++:i2=f2>127&&f2<2048?String.fromCharCode(f2>>6|192)+String.fromCharCode(63&f2|128):String.fromCharCode(f2>>12|224)+String.fromCharCode(f2>>6&63|128)+String.fromCharCode(63&f2|128),i2!=null&&(t2>n2&&(o2+=r2.substring(n2,t2)),o2+=i2,n2=t2=u2+1)}return t2>n2&&(o2+=r2.substring(n2,r2.length)),o2})(r))).length,e=0;e<n;e+=16)o=a,u=c,f=g,i=C,a=d(a,c,g,C,t[e+0],7,3614090360),C=d(C,a,c,g,t[e+1],12,3905402710),g=d(g,C,a,c,t[e+2],17,606105819),c=d(c,g,C,a,t[e+3],22,3250441966),a=d(a,c,g,C,t[e+4],7,4118548399),C=d(C,a,c,g,t[e+5],12,1200080426),g=d(g,C,a,c,t[e+6],17,2821735955),c=d(c,g,C,a,t[e+7],22,4249261313),a=d(a,c,g,C,t[e+8],7,1770035416),C=d(C,a,c,g,t[e+9],12,2336552879),g=d(g,C,a,c,t[e+10],17,4294925233),c=d(c,g,C,a,t[e+11],22,2304563134),a=d(a,c,g,C,t[e+12],7,1804603682),C=d(C,a,c,g,t[e+13],12,4254626195),g=d(g,C,a,c,t[e+14],17,2792965006),a=s(a,c=d(c,g,C,a,t[e+15],22,1236535329),g,C,t[e+1],5,4129170786),C=s(C,a,c,g,t[e+6],9,3225465664),g=s(g,C,a,c,t[e+11],14,643717713),c=s(c,g,C,a,t[e+0],20,3921069994),a=s(a,c,g,C,t[e+5],5,3593408605),C=s(C,a,c,g,t[e+10],9,38016083),g=s(g,C,a,c,t[e+15],14,3634488961),c=s(c,g,C,a,t[e+4],20,3889429448),a=s(a,c,g,C,t[e+9],5,568446438),C=s(C,a,c,g,t[e+14],9,3275163606),g=s(g,C,a,c,t[e+3],14,4107603335),c=s(c,g,C,a,t[e+8],20,1163531501),a=s(a,c,g,C,t[e+13],5,2850285829),C=s(C,a,c,g,t[e+2],9,4243563512),g=s(g,C,a,c,t[e+7],14,1735328473),a=v(a,c=s(c,g,C,a,t[e+12],20,2368359562),g,C,t[e+5],4,4294588738),C=v(C,a,c,g,t[e+8],11,2272392833),g=v(g,C,a,c,t[e+11],16,1839030562),c=v(c,g,C,a,t[e+14],23,4259657740),a=v(a,c,g,C,t[e+1],4,2763975236),C=v(C,a,c,g,t[e+4],11,1272893353),g=v(g,C,a,c,t[e+7],16,4139469664),c=v(c,g,C,a,t[e+10],23,3200236656),a=v(a,c,g,C,t[e+13],4,681279174),C=v(C,a,c,g,t[e+0],11,3936430074),g=v(g,C,a,c,t[e+3],16,3572445317),c=v(c,g,C,a,t[e+6],23,76029189),a=v(a,c,g,C,t[e+9],4,3654602809),C=v(C,a,c,g,t[e+12],11,3873151461),g=v(g,C,a,c,t[e+15],16,530742520),a=m(a,c=v(c,g,C,a,t[e+2],23,3299628645),g,C,t[e+0],6,4096336452),C=m(C,a,c,g,t[e+7],10,1126891415),g=m(g,C,a,c,t[e+14],15,2878612391),c=m(c,g,C,a,t[e+5],21,4237533241),a=m(a,c,g,C,t[e+12],6,1700485571),C=m(C,a,c,g,t[e+3],10,2399980690),g=m(g,C,a,c,t[e+10],15,4293915773),c=m(c,g,C,a,t[e+1],21,2240044497),a=m(a,c,g,C,t[e+8],6,1873313359),C=m(C,a,c,g,t[e+15],10,4264355552),g=m(g,C,a,c,t[e+6],15,2734768916),c=m(c,g,C,a,t[e+13],21,1309151649),a=m(a,c,g,C,t[e+4],6,4149444226),C=m(C,a,c,g,t[e+11],10,3174756917),g=m(g,C,a,c,t[e+2],15,718787259),c=m(c,g,C,a,t[e+9],21,3951481745),a=l(a,o),c=l(c,u),g=l(g,f),C=l(C,i);return(S(a)+S(c)+S(g)+S(C)).toLowerCase()}class DiscountNotification extends HTMLElement{constructor(){super();const discountNotificationMember=localStorage.getItem("discount_banner_member"),discountNotificationPromo=localStorage.getItem("discount_banner_promo"),discountCode=md5(getDiscountCode());if(this.memberDiscount=this.querySelector(".discount-banner--member"),this.memberDiscount&&discountNotificationMember!==this.memberDiscount.getAttribute("data-discount-name")&&(localStorage.setItem("discount_banner_member",this.memberDiscount.getAttribute("data-discount-name")),this.memberDiscount.removeAttribute("hidden",""),setTimeout(()=>{this.memberDiscount.setAttribute("hidden","")},5e3)),discountCode&&!discountNotificationPromo){localStorage.setItem("discount_banner_promo",discountCode);const discountNotificationElement=document.querySelector(`#discount_banner-${discountCode}`);if(discountNotificationElement){const timeToShow=Number(discountNotificationElement.getAttribute("data-time-to-show")*1e3);
3console.log({timeToShow}),discountNotificationElement.removeAttribute("hidden"),setTimeout(()=>{discountNotificationElement.setAttribute("hidden","")},timeToShow)}}else discountNotificationPromo&&discountCode&&discountNotificationPromo!==discountCode?localStorage.removeItem("discount_banner_promo"):discountCode||localStorage.removeItem("discount_banner_promo")}}customElements.define("discount-notification",DiscountNotification);class PriceList extends HTMLElement{constructor(){super(),this.price=this.getAttribute("data-price"),this.compareAtPrice=this.getAttribute("data-compare-at-price"),this.discountPercentage=this.getAttribute("data-discount-percentage"),this.cartItem=this.closest("line-item"),this.PDP=this.closest(".product-info");const discountCode=md5(getDiscountCode()),productCollection=this.getAttribute("data-collections"),discountCollection=document.querySelector(`#discount_banner-${discountCode}`)?.getAttribute("data-product-collection"),discountNotificationMember=localStorage.getItem("discount_banner_member");if(!(discountNotificationMember&&document.querySelector(`#discount_banner-${discountNotificationMember}`)?.getAttribute("data-discount-percentage")>this.discountPercentage)&&productCollection&&productCollection.includes(discountCollection)&&discountCode&&!this.cartItem){const bannerDiscountPercentage=document.querySelector(`#discount_banner-${discountCode}`)?.getAttribute("data-discount-percentage"),newPrice=this.price*(1-bannerDiscountPercentage/100),applyDiscount=(attempt=1,maxAttempts=5)=>{const salePrice=this.querySelector("sale-price"),compareAtPrice=this.querySelector("compare-at-price"),onSaleBadge=this.querySelector("on-sale-badge");if(!salePrice){attempt<maxAttempts&&setTimeout(()=>applyDiscount(attempt+1,maxAttempts),100*attempt);return}if(compareAtPrice)if(salePrice.innerHTML=`<span class="sr-only">new price</span>${Shopify.formatMoney(newPrice,"{{amount}}").replace(".",",")}\u20AC`,this.compareAtPrice&&onSaleBadge){const discountRatio=(this.compareAtPrice-newPrice)/this.compareAtPrice,calculatedDiscountPercentage=Math.round(discountRatio*100);onSaleBadge.innerText=`-${calculatedDiscountPercentage}%`}else onSaleBadge&&(onSaleBadge.innerText=`-${bannerDiscountPercentage}%`);else{salePrice.innerHTML=`<span class="sr-only">new price</span>${Shopify.formatMoney(newPrice,"{{amount}}").replace(".",",")}\u20AC`,salePrice.classList.add("text-on-sale");const compareAtPriceNode=document.createElement("compare-at-price");compareAtPriceNode.classList.add("h6","text-subdued","line-through"),compareAtPriceNode.innerHTML=`<span class="sr-only">Regul\xE4rer Preis</span>${Shopify.formatMoney(this.price,"{{amount}}").replace(".",",")}\u20AC`,this.insertBefore(compareAtPriceNode,this.firstChild)}if(this.PDP){const compareAtPriceElement=this.querySelector("compare-at-price");if(compareAtPriceElement&&(compareAtPriceElement.classList.remove("h6"),compareAtPriceElement.classList.add("h4")),!this.querySelector("on-sale-badge")){const badge=document.createElement("on-sale-badge");badge.classList.add("badge","badge--on-sale"),badge.innerHTML=`-${bannerDiscountPercentage}%`,this.appendChild(badge)}}};setTimeout(()=>applyDiscount(),150)}}}customElements.define("price-list",PriceList);class BadgeList extends HTMLElement{constructor(){super();const productCollection=this.getAttribute("data-collections"),discountCode=md5(getDiscountCode()),discountNotificationMember=localStorage.getItem("discount_banner_member");if(discountNotificationMember){const memberDiscount=document.querySelector(`#discount_banner-${discountNotificationMember}`)?.getAttribute("data-discount-percentage"),promoDiscount=document.querySelector(`#discount_banner-${discountCode}`)?.getAttribute("data-discount-percentage");if(memberDiscount>promoDiscount)return}if(discountCode){const discountCollection=document.querySelector(`#discount_banner-${discountCode}`)?.getAttribute("data-product-collection"),discountPercentage=document.querySelector(`#discount_banner-${discountCode}`)?.getAttribute("data-discount-percentage");if(productCollection&&productCollection.includes(discountCollection))if(this.querySelector("on-sale-badge"))this.compareAtPrice=Number(this.getAttribute("data-compare-at-price")),this.oldPrice=Number(this?.getAttribute("data-price")),this.newPrice=this.oldPrice*(1-discountPercentage/100),this.discountAmount=this.compareAtPrice-this.newPrice,this.discountRatio=this.discountAmount/this.compareAtPrice,this.discountPercentage=this.discountRatio*100,this.discountPercentage=Math.round(this.discountPercentage),this.querySelector("on-sale-badge").innerHTML=`-${this.discountPercentage}%`;
3else{const badge=document.createElement("on-sale-badge");badge.classList.add("badge","badge--on-sale"),badge.innerHTML=`-${discountPercentage}%`,this.appendChild(badge)}}}}customElements.define("badge-list",BadgeList),(function(){let lastKnownCartToken=null;async function checkAndRefreshCart(){try{const cart=await(await fetch(`${Shopify.routes.root}cart.js`)).json(),cartDrawer=document.querySelector("cart-drawer"),cartDot=document.querySelector("cart-dot"),cartCount=document.querySelector("cart-count"),renderedItems=cartDrawer?cartDrawer.querySelectorAll(".cart-drawer__items line-item, .cart-drawer__items .line-item").length:0,renderedDotCount=cartDot&&parseInt(cartDot.innerHTML)||0,actualItemCount=cart.item_count;(renderedItems!==actualItemCount||renderedDotCount!==actualItemCount||lastKnownCartToken&&lastKnownCartToken!==cart.token)&&(console.log("[Cart Fix] Mismatch detected - rendered:",renderedItems,"dot:",renderedDotCount,"actual:",actualItemCount),cartDot&&(cartDot.innerHTML=actualItemCount>0?actualItemCount:"",cartDot.classList.toggle("is-visible",actualItemCount>0)),cartCount&&(cartCount.innerHTML=actualItemCount),cartDrawer&&document.dispatchEvent(new CustomEvent("cart:refresh"))),lastKnownCartToken=cart.token}catch(e){console.error("[Cart Fix] Error checking cart:",e)}}window.addEventListener("pageshow",event=>{setTimeout(checkAndRefreshCart,100)}),window.addEventListener("popstate",()=>{setTimeout(checkAndRefreshCart,100)}),window.addEventListener("pagehide",async()=>{try{lastKnownCartToken=(await(await fetch(`${Shopify.routes.root}cart.js`)).json()).token}catch{}})})(),(function(){"use strict";const prefetchedUrls=new Set;function getFakeColorUrls(root){return[...new Set(Array.from((root||document).querySelectorAll("[data-fake-color-link]")).map(link=>link.href).filter(href=>{if(!href)return!1;try{const url=new URL(href,window.location.origin);return url.origin===window.location.origin&&url.href!==window.location.href}catch{return!1}}))]}function prefetchUrl(url){if(!url||prefetchedUrls.has(url))return;const link=document.createElement("link");link.rel="prefetch",link.href=url,link.as="document",document.head.appendChild(link),prefetchedUrls.add(url)}function updateSpeculationRules(root){if(!window.HTMLScriptElement||typeof HTMLScriptElement.supports!="function"||!HTMLScriptElement.supports("speculationrules"))return;const urls=getFakeColorUrls(root);if(!urls.length)return;const existingRules=document.querySelector("[data-fake-color-speculation]");existingRules&&existingRules.remove();const rulesScript=document.createElement("script");rulesScript.type="speculationrules",rulesScript.setAttribute("data-fake-color-speculation",""),rulesScript.textContent=JSON.stringify({prefetch:[{source:"list",urls}]}),document.head.appendChild(rulesScript)}function handleFakeColorInteraction(event){const link=event.target.closest("[data-fake-color-link]");link&&prefetchUrl(link.href)}document.addEventListener("DOMContentLoaded",()=>{updateSpeculationRules(document)}),document.addEventListener("pointerenter",handleFakeColorInteraction,!0),document.addEventListener("focus",handleFakeColorInteraction,!0),document.addEventListener("touchstart",handleFakeColorInteraction,{passive:!0,capture:!0}),document.addEventListener("dialog:after-show",event=>{updateSpeculationRules(event.target)})})(),(function(){const STORAGE_KEY="header-sidebar:last-position";let isRestoring=!1;function readState(){try{const raw=sessionStorage.getItem(STORAGE_KEY);return raw?JSON.parse(raw):null}catch{return null}}function writeState(state){try{sessionStorage.setItem(STORAGE_KEY,JSON.stringify(state))}catch{}}function captureState(sidebar,activeKey){if(isRestoring)return;const openKeys=Array.from(sidebar.querySelectorAll("accordion-disclosure[data-menu-key]")).filter(accordion=>accordion.querySelector("details")?.getAttribute("aria-expanded")==="true").map(accordion=>accordion.getAttribute("data-menu-key")),state=readState()||{};writeState({openKeys,activeKey:activeKey||state.activeKey||null})}function restoreState(sidebar){const state=readState();
3state&&(isRestoring=!0,(state.openKeys||[]).forEach(key=>{sidebar.querySelector(`accordion-disclosure[data-menu-key="${CSS.escape(key)}"]`)?.toggle?.(!0,!1)}),state.activeKey&&sidebar.querySelector(`[data-menu-key="${CSS.escape(state.activeKey)}"]`)?.scrollIntoView({block:"center"}),isRestoring=!1)}document.addEventListener("DOMContentLoaded",()=>{const sidebar=document.querySelector("header-sidebar");if(!sidebar)return;new MutationObserver(mutations=>{if(isRestoring)return;const toggledAccordion=mutations.map(mutation=>mutation.target.closest("accordion-disclosure[data-menu-key]")).find(accordion=>accordion?.querySelector("details")?.getAttribute("aria-expanded")==="true");captureState(sidebar,toggledAccordion?.getAttribute("data-menu-key"))}).observe(sidebar,{attributes:!0,attributeFilter:["aria-expanded"],subtree:!0}),sidebar.addEventListener("click",event=>{const link=event.target.closest("a[data-menu-key]");link&&captureState(sidebar,link.getAttribute("data-menu-key"))}),sidebar.addEventListener("dialog:after-show",()=>{restoreState(sidebar)})})})(),document.addEventListener("DOMContentLoaded",()=>{document.querySelectorAll(".mega-menu--no-block").forEach(menu=>{const details=menu.closest("details"),summary=details?.querySelector(":scope > summary");summary&&details.addEventListener("toggle",()=>{details.open&&menu.style.setProperty("--mega-menu-item-offset",`${Math.max(summary.getBoundingClientRect().left,0)}px`)})})});
4//# sourceMappingURL=/cdn/shop/t/112/assets/custom.js.map?v=120067999623262461871786619123

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.