PageSourceSearch

https://www.lovisa.co.uk/cdn/shop/t/811/assets/site-header-mobile.js?v=150996754559946774451789977862

js lovisa.co.uk collected 2026-09-26 13:25:23 UTC 25,835 bytes, 2 lines download raw bytes

1(function(){const sectionSelector='[data-section-type="site-header"]',OPEN_CLASS="shm-menu-open",SUBPANEL_CLASS="is-subpanel";let savedScrollY=0;function prefersReducedMotion(){return!!(window.matchMedia&&window.matchMedia("(prefers-reduced-motion: reduce)").matches)}function isMobile(){return window.matchMedia&&window.matchMedia("(max-width: 989px)").matches}function getScrollLock(){return window.bodyScrollLock}function getScrollTarget(section){const panel=section.querySelector(".shm__panel[data-panel-id].is-active")||section.querySelector(".shm__panel--root");return panel?panel.querySelector(".shm__panel-body")||panel.querySelector(".shm__panel-scroll")||panel:section.querySelector("[data-shm-drawer]")}function syncChromeMetrics(section){const chrome=section.querySelector("[data-shm-chrome]"),spacer=section.querySelector("[data-shm-chrome-spacer]");if(!chrome)return;const rect=chrome.getBoundingClientRect(),top=Math.max(Math.round(rect.top),0),height=Math.round(rect.height),bottom=Math.max(Math.round(rect.bottom),0);section.style.setProperty("--shm-chrome-top",top+"px"),section.style.setProperty("--shm-chrome-height",height+"px"),section.style.setProperty("--shm-drawer-top",bottom+"px"),isMobile()&&document.body.style.setProperty("--headerHeight",height+"px"),spacer&&(spacer.style.height=document.body.classList.contains(OPEN_CLASS)?height+"px":"0")}function updateDrawerTop(section){syncChromeMetrics(section)}function applyChromePin(section){const chrome=section.querySelector("[data-shm-chrome]"),spacer=section.querySelector("[data-shm-chrome-spacer]");chrome&&chrome.classList.add("is-pinned"),spacer&&(spacer.style.height=section.style.getPropertyValue("--shm-chrome-height")||"0px")}function unpinChrome(section){const chrome=section.querySelector("[data-shm-chrome]"),spacer=section.querySelector("[data-shm-chrome-spacer]");chrome&&chrome.classList.remove("is-pinned"),spacer&&(spacer.style.height="0")}function lockPageScroll(section){if(!isMobile())return;document.body.style.position!=="fixed"&&(savedScrollY=window.scrollY||window.pageYOffset||0,document.body.style.position="fixed",document.body.style.top="-"+savedScrollY+"px",document.body.style.left="0",document.body.style.right="0",document.body.style.width="100%");const scrollLock=getScrollLock(),target=getScrollTarget(section);!scrollLock||!target||(section.__shmScrollTarget&&section.__shmScrollTarget!==target&&scrollLock.enableBodyScroll(section.__shmScrollTarget),scrollLock.disableBodyScroll(target,{reserveScrollBarGap:!0}),section.__shmScrollTarget=target)}function unlockPageScroll(section){const scrollLock=getScrollLock();if(scrollLock&&section.__shmScrollTarget)scrollLock.enableBodyScroll(section.__shmScrollTarget),section.__shmScrollTarget=null;else if(scrollLock){const drawer=section.querySelector("[data-shm-drawer]");drawer&&scrollLock.enableBodyScroll(drawer)}document.body.style.position="",document.body.style.top="",document.body.style.left="",document.body.style.right="",document.body.style.width="",window.scrollTo(0,savedScrollY)}function refreshMenuScroll(section){document.body.classList.contains(OPEN_CLASS)&&(syncChromeMetrics(section),lockPageScroll(section))}function setAccordionOpen(acc,isOpen){if(!acc)return;acc.classList.toggle("is-open",isOpen);const toggle=acc.querySelector(".shm__acc-toggle");toggle&&toggle.setAttribute("aria-expanded",isOpen?"true":"false")}function resetSubpanelScroll(panel){const body=panel&&panel.querySelector(".shm__panel-body");body&&(body.__shmScrollRaf&&(cancelAnimationFrame(body.__shmScrollRaf),body.__shmScrollRaf=null),body.scrollTop=0)}const ACC_SCROLL_MS=280;function scrollSubpanelToAccordion(acc){const body=acc&&acc.closest(".shm__panel[data-panel-id] .shm__panel-body"),toggle=acc&&acc.querySelector(".shm__acc-toggle");if(!body||!toggle)return;body.__shmScrollRaf&&(cancelAnimationFrame(body.__shmScrollRaf),body.__shmScrollRaf=null);function targetTop(){const head=body.querySelector(".shm__panel-head"),headHeight=head?head.offsetHeight:0,top=toggle.getBoundingClientRect().top-body.getBoundingClientRect().top+body.scrollTop-headHeight,max=body.scrollHeight-body.clientHeight;return Math.max(0,Math.min(top,max))}if(prefersReducedMotion()){body.scrollTop=targetTop();return}const from=body.scrollTop,start=performance.now();function step(now){const p=Math.min((now-start)/ACC_SCROLL_MS,1);body.scrollTop=from+(targetTop()-from)*p,p<1?body.__shmScrollRaf=requestAnimationFrame(step):(body.scrollTop=targetTop(),body.__shmScrollRaf=null)}body.__shmScrollRaf=requestAnimationFrame(step)}function closeSiblingAccordions(panel,exceptAcc){panel&&panel.querySelectorAll(".shm__acc.is-open").forEach(function(openAcc){o
1penAcc!==exceptAcc&&(openAcc.classList.add("shm__acc--instant"),setAccordionOpen(openAcc,!1),window.requestAnimationFrame(function(){openAcc.classList.remove("shm__acc--instant")}))})}function resetPanelAccordions(panel){if(!panel)return;const openFirst=panel.hasAttribute("data-shm-open-first");panel.querySelectorAll(".shm__acc").forEach(function(acc,index){setAccordionOpen(acc,openFirst&&index===0)})}function resetPanels(section){const panels=section.querySelector("[data-shm-panels]");panels&&(panels.classList.remove(SUBPANEL_CLASS),section.querySelectorAll(".shm__panel[data-panel-id]").forEach(function(panel){panel.classList.remove("is-active"),panel.hidden=!0,resetPanelAccordions(panel)}))}function openMenu(section){isSearchOpen()?closeMobileSearch(section):blurMobileSearch(section),syncChromeMetrics(section),savedScrollY=window.scrollY||window.pageYOffset||0,document.body.classList.add(OPEN_CLASS),applyChromePin(section),lockPageScroll(section);const toggle=section.querySelector("[data-shm-menu-toggle]"),drawer=section.querySelector("[data-shm-drawer]");toggle&&toggle.setAttribute("aria-expanded","true"),drawer&&drawer.setAttribute("aria-hidden","false")}function closeMenu(section){document.body.classList.remove(OPEN_CLASS);const toggle=section.querySelector("[data-shm-menu-toggle]"),drawer=section.querySelector("[data-shm-drawer]");toggle&&toggle.setAttribute("aria-expanded","false"),drawer&&drawer.setAttribute("aria-hidden","true"),unlockPageScroll(section),unpinChrome(section),resetPanels(section)}function openSubpanel(section,panelId){const panels=section.querySelector("[data-shm-panels]"),target=section.querySelector('.shm__panel[data-panel-id="'+panelId+'"]');!panels||!target||(section.querySelectorAll(".shm__panel[data-panel-id].is-active").forEach(function(panel){panel.classList.remove("is-active"),panel.hidden=!0}),target.hidden=!1,window.requestAnimationFrame(function(){target.classList.add("is-active"),panels.classList.add(SUBPANEL_CLASS),refreshMenuScroll(section)}),resetPanelAccordions(target),resetSubpanelScroll(target))}function closeSubpanel(section){const panels=section.querySelector("[data-shm-panels]"),active=section.querySelector(".shm__panel[data-panel-id].is-active");panels&&(panels.classList.remove(SUBPANEL_CLASS),active?(resetSubpanelScroll(active),active.classList.remove("is-active"),window.setTimeout(function(){active.hidden=!0,refreshMenuScroll(section)},prefersReducedMotion()?0:300)):refreshMenuScroll(section))}function getSearchApp(){const existing=window.theme&&window.theme.SearchApp;if(existing&&typeof existing.showModal=="function")return existing;const predictive=document.querySelector("predictive-search.search");if(predictive&&typeof predictive.showModal=="function")return window.theme=window.theme||{},window.theme.SearchApp=predictive,predictive;const tagalysEl=document.querySelector("#search--app"),tagalysApp=tagalysEl&&tagalysEl.__vue__;return tagalysApp&&typeof tagalysApp.showModal=="function"?(window.theme=window.theme||{},window.theme.SearchApp=tagalysApp,tagalysApp):null}function stripSearchDismissListeners(app){!app||!app.boundClickHandler||(app.mainContent&&app.mainContent.removeEventListener("click",app.boundClickHandler),app.bgOverlay&&app.bgOverlay.removeEventListener("click",app.boundClickHandler))}function refreshMobileSuggestions(headerInput){if(!isMobile()||!isSearchOpen())return;const suggestions=document.querySelector("#search--app .search-suggestions");if(suggestions&&suggestions.querySelector(".click-suggestions, .popular-view"))return;const app=getSearchApp();if(app&&typeof app.setTrendingSearches=="function"){app.setTrendingSearches();return}const panelInput=document.querySelector("#search-input-main");if(panelInput)try{panelInput.dispatchEvent(new Event("focus",{bubbles:!0})),panelInput.dispatchEvent(new Event("input",{bubbles:!0}))}catch{}headerInput&&headerInput.focus()}function bindMobileSearchPanelGuard(){const panel=document.querySelector("#search--app");if(!panel||panel.__shmPanelGuard)return;panel.__shmPanelGuard=!0;function guardPanelInteraction(event){!isMobile()||!isSearchOpen()||event.target.closest(".search-suggestions, a, button, input, textarea, select, label")||(event.stopPropagation(),event.type!=="click"&&event.preventDefault())}panel.addEventListener("mousedown",guardPanelInteraction,!0),panel.addEventListener("touchstart",guardPanelInteraction,{capture:!0,passive:!1}),panel.addEventListener("click",guardPanelInteraction,!0)}function getSearchPanelElement(){const searchApp=getSearchApp();if(searchApp){if(searchApp.$el)return searchApp.$el;if(searchApp.nodeType===1)return searchApp}return document.querySelector("#search--app")||document.querySelector("predictive-search.search")}function isSearchOpen(){const searchApp=getSearchApp();return!!(searchApp&&searchApp.isVisible||document.body.classList.contains("search-is-visible"))}function getMobileSearch(section){return section.querySelector("[data-shm-inline-search]")}function setSearchBackVisible(search,isVisible){const backBtn=search&&search.querySelector("[data-shm-search-back]");backBtn&&(isVisible?(backBtn.removeAttribute("hidden"),backBtn.tabIndex=0):(backBtn.setAttribute("hidden",""),backBtn.tabIndex=-1))}function resetMobileSearchUi(section){const search=getMobileSearch(section);if(!search)return;search.classList.remove("is-focused"),setSearchBackVisible(search,!1);const input=search.querySelector("[data-shm-search-input]");input&&document.activeElement===input&&input.blur()}function syncMobileSearchState(search){const input=search.querySelector("[data-shm-search-input]");if(!input)return;const hasValue=!!(input.value&&input.value.trim());search.classList.toggle("has-value",hasValue)}function blurMobileSearch(section){if(isSearchOpen()){closeMobileSearch(section);return}section.__shmIgnoreSearchFocus=!0,resetMobileSearchUi(section),window.setTimeout(function(){section.__shmIgnoreSearchFocus=!1},100)}function positionMobileSearch(section){const searchElement=getSearchPanelElement(),chrome=section.querySelector("[data-shm-chrome]");if(!chrome)return;const bottom=Math.max(Math.round(chrome.getBoundingClientRect().bottom),0);section.style.setProperty("--shm-search-panel-top",bottom+"px"),searchElement&&searchElement.style&&(searchElement.style.top=Math.max(bottom-1,0)+"px",searchElement.style.left="0",searchElement.style.right="0",searchElement.style.width="100%",searchElement.style.maxWidth="none",searchElement.style.marginLeft="0",searchElement.style.marginRight="0")}function getSearchAppInput(app){if(!app)return null;if(app.searchInput)return app.searchInput;if(app.$refs&&app.$refs.searchQuery)return app.$refs.searchQuery;const panel=getSearchPanelElement();return panel&&panel.querySelector?panel.querySelector("#search-input-main")||panel.querySelector('input[name="q"]')||panel.querySelector('input[name="query"]'):document.querySelector("#search-input-main")||document.querySelector('#search--app input[name="q"]')}function syncQueryToSearchApp(headerInput){const app=getSearchApp(),appInput=getSearchAppInput(app);if(!appInput||!headerInput)return;const nextValue=headerInput.value;appInput.value!==nextValue&&(appInput.value=nextValue);try{appInput.dispatchEvent(new Event("input",{bubbles:!0})),appInput.dispatchEvent(new Event("keyup",{bubbles:!0}))}catch{}typeof app.onSearch=="function"&&app.onSearch()}function closeMobileSearch(section){if(section.__shmClosingSearch)return;section.__shmClosingSearch=!0,section.__shmIgnoreSearchFocus=!0,window.theme&&(window.theme.lastActiveElement=null);const searchApp=getSearchApp();if(searchApp&&typeof searchApp.hideModal=="function")(searchApp.isVisible||document.body.classList.contains("search-is-visible"))&&searchApp.hideModal();else{document.body.classList.remove("search-is-visible");const panel2=getSearchPanelElement();panel2&&panel2.classList&&panel2.classList.remove("is-visible")}resetMobileSearchUi(section);const panel=getSearchPanelElement();panel&&panel.style&&(panel.style.top="",panel.style.left="",panel.style.right="",panel.style.width="",panel.style.maxWidth="",panel.style.marginLeft="",panel.style.marginRight=""),section.style.removeProperty("--shm-search-panel-top"),window.setTimeout(function(){section.__shmClosingSearch=!1,section.__shmIgnoreSearchFocus=!1},150)}function openMobileSearch(section,headerInput){if(section.__shmClosingSearch||section.__shmIgnoreSearchFocus)return;const searchApp=getSearchApp(),search=getMobileSearch(section);if(document.body.classList.contains(OPEN_CLASS)&&closeMenu(section),!!searchApp){if(searchApp.isVisible||document.body.classList.contains("search-is-visible")){stripSearchDismissListeners(searchApp),search&&(search.classList.add("is-focused"),setSearchBackVisible(search,!0)),positionMobileSearch(section),syncQueryToSearchApp(headerInput),refreshMobileSuggestions(headerInput);return}if(window.theme=window.theme||{},typeof searchApp.showModal=="function")searchApp.showModal();else if(typeof searchApp.toggleModal=="function")searchApp.toggleModal();else return;stripSearchDismissListeners(searchApp),window.theme.lastActiveElement=null,search&&(search.classList.add("is-focused"),setSearchBackVisible(search,!0)),positionMobileSearch(section),window.requestAnimationFrame(function(){window.requestAnimationFrame(function(){positionMobileSearch(section),syncQueryToSearchApp(headerInput),window.setTimeout(function(){headerInput&&isSearchOpen()&&!section.__shmClosingSearch&&!section.__shmIgnoreSearchFocus&&(headerInput.focus(),syncQueryToSearchApp(headerInput))},60)})})}}function rememberSearchQuery(query){if(!query)return;let lastSearches=[];try{lastSearches=localStorage.getItem("lastSearches")?JSON.parse(localStorage.getItem("lastSearches")):[]}catch{lastSearches=[]}lastSearches=lastSearches.filter(function(s){return String(s).toLowerCase()!==query.toLowerCase()}),lastSearches.unshift(query),lastSearches=lastSearches.slice(0,10);try{localStorage.setItem("lastSearches",JSON.stringify(lastSearches))}catch{}}function getActivePlaceholderQuery(search){if(!search||!search.querySelector)return"";const fallback=search.querySelector("[data-ph-word].is-active")||search.querySelector("[data-ph-word]");if(!fallback)return"";const label=fallback.getAttribute("data-label")||fallback.textContent||"";return String(label).trim()}function getPhInterval(section){const raw=section&&section.getAttribute("data-ph-interval"),value=parseInt(raw,10);return value>=2e3?value:4e3}function rememberPhLabel(label){if(label)try{sessionStorage.setItem(PH_LABEL_KEY,label)}catch{}}function readActivePhIndex(words){for(let i=0;i<words.length;i++)if(words[i].classList.contains("is-active"))return i;return 0}function stopPhRotator(host){host&&host.__shmPhTimer&&(window.clearInterval(host.__shmPhTimer),host.__shmPhTimer=null)}function getProviderSearchParam(){return window.theme&&window.theme.searchProvider==="tagalys"?"query":"q"}function buildSearchUrl(action,param,query){return action+"?"+param+"="+encodeURIComponent(query)}function setupMobilePlaceholder(search){const section=search.closest(sectionSelector),words=search.querySelectorAll("[data-ph-word]");if(!words.length)return;const rotator=search.querySelector("[data-ph-rotator]");let index=0;rotator&&rotator.classList.contains("is-ph-ready")?index=readActivePhIndex(words):window.__shInitPhRotator&&rotator?index=window.__shInitPhRotator(rotator):words[0]&&(words[0].classList.add("is-active"),rotator&&rotator.classList.add("is-ph-ready"));let hovering=!1;search.addEventListener("mouseenter",function(){hovering=!0}),search.addEventListener("mouseleave",function(){hovering=!1}),search.addEventListener("focusin",function(){hovering=!0}),search.addEventListener("focusout",function(){hovering=!1});function paused(){return hovering||document.hidden||search.classList.contains("is-focused")||search.classList.contains("has-value")||document.body.classList.contains("search-is-visible")}function advance(){if(paused())return;const current=words[index],nextIndex=(index+1)%words.length,next=words[nextIndex];current.classList.remove("is-active"),current.classList.add("is-leaving"),window.setTimeout(function(){current.classList.remove("is-leaving")},550),next.classList.remove("is-leaving"),next.classList.add("is-active"),index=nextIndex}
1function startRotator(){stopPhRotator(search),!(words.length<2||prefersReducedMotion())&&(search.__shmPhTimer=window.setInterval(advance,getPhInterval(section)))}search.__shPhUnpause=function(){hovering=!1,search.classList.remove("is-focused","has-value"),setSearchBackVisible(search,!1),document.body.classList.remove("search-is-visible"),index=readActivePhIndex(words);for(let i=0;i<words.length;i++)words[i].classList.remove("is-leaving");startRotator()},startRotator()}function refreshMobileBag(section){const target=section.querySelector(".shm__bag-count");if(!target)return;const count=parseInt(target.textContent,10)||0;target.classList.toggle("hide",count===0);const bagLink=target.closest("a");bagLink&&bagLink.getAttribute("data-bag-label")&&bagLink.setAttribute("aria-label",bagLink.getAttribute("data-bag-label")+" ("+count+")")}function setupMobileSearch(section){const search=getMobileSearch(section);if(!search||search.__shmSearchBound)return;search.__shmSearchBound=!0;const input=search.querySelector("[data-shm-search-input]"),backBtn=search.querySelector("[data-shm-search-back]");bindMobileSearchPanelGuard(),input&&(input.addEventListener("pointerdown",function(event){!isMobile()||!isSearchOpen()||document.activeElement!==input||event.preventDefault()}),input.addEventListener("focus",function(){!isMobile()||section.__shmIgnoreSearchFocus||section.__shmClosingSearch||(search.classList.add("is-focused"),setSearchBackVisible(search,!0),isSearchOpen()?(positionMobileSearch(section),syncQueryToSearchApp(input),refreshMobileSuggestions(input)):openMobileSearch(section,input))}),input.addEventListener("input",function(){!isMobile()||section.__shmIgnoreSearchFocus||section.__shmClosingSearch||(syncMobileSearchState(search),isSearchOpen()?syncQueryToSearchApp(input):openMobileSearch(section,input))})),backBtn&&(backBtn.addEventListener("mousedown",function(event){event.preventDefault()}),backBtn.addEventListener("click",function(event){event.preventDefault(),closeMobileSearch(section)})),search.addEventListener("submit",function(event){let query=input?input.value.trim():"";if(!query&&input&&(query=getActivePlaceholderQuery(search),query&&(input.value=query,syncMobileSearchState(search),syncQueryToSearchApp(input))),!query){event.preventDefault();return}rememberSearchQuery(query),rememberPhLabel(query);const desiredParam=getProviderSearchParam();input&&input.name!==desiredParam&&(event.preventDefault(),window.location.assign(buildSearchUrl(search.getAttribute("action")||"/search",desiredParam,query)))});const onPointerDownOutside=function(event){if(!isMobile()||!(isSearchOpen()||search&&search.classList.contains("is-focused")))return;const target=event.target;!target||!target.closest||target.closest("[data-shm-inline-search]")||target.closest("#shopify-search-host, .bg-overlay, predictive-search.search, .search.is-visible, #search--app, .tagalys-search-suggestions, .search-suggestions")||target.closest("[data-shm-menu-toggle]")||target.closest(".shm__chrome")&&closeMobileSearch(section)};document.addEventListener("pointerdown",onPointerDownOutside,!0),section.__shmSearchOutsideHandler=onPointerDownOutside;const onSearchReposition=function(){isMobile()&&isSearchOpen()&&positionMobileSearch(section)};window.addEventListener("scroll",onSearchReposition,{passive:!0}),section.__shmSearchRepositionHandler=onSearchReposition,section.__shmSearchObserver=new MutationObserver(function(){if(!isMobile())return;isSearchOpen()?(positionMobileSearch(section),search&&(search.classList.add("is-focused"),setSearchBackVisible(search,!0))):search&&!section.__shmClosingSearch&&(section.__shmIgnoreSearchFocus=!0,resetMobileSearchUi(section),window.setTimeout(function(){section.__shmIgnoreSearchFocus=!1},100))}),section.__shmSearchObserver.observe(document.body,{attributes:!0,attributeFilter:["class"]}),syncMobileSearchState(search),setupMobilePlaceholder(search)}function setupAccordions(section){section.querySelectorAll("[data-shm-acc]").forEach(function(acc){if(acc.__shmAccBound)return;acc.__shmAccBound=!0;const toggle=acc.querySelector(".shm__acc-toggle");toggle&&toggle.addEventListener("click",function(){const panel=acc.closest(".shm__panel[data-panel-id]"),isOpen=acc.classList.contains("is-open");
1isOpen||closeSiblingAccordions(panel,acc),setAccordionOpen(acc,!isOpen),isOpen||scrollSubpanelToAccordion(acc)})})}function init(section){if(!section||section.__shmInit)return;section.__shmInit=!0;const menuToggle=section.querySelector("[data-shm-menu-toggle]"),drawer=section.querySelector("[data-shm-drawer]"),overlay=document.querySelector(".bg-overlay");if(menuToggle&&menuToggle.addEventListener("click",function(){document.body.classList.contains(OPEN_CLASS)?closeMenu(section):openMenu(section)}),section.addEventListener("click",function(event){const trigger=event.target.closest("[data-shm-panel-trigger]");if(trigger){event.preventDefault(),openSubpanel(section,trigger.getAttribute("data-shm-panel-trigger"));return}event.target.closest("[data-shm-panel-back]")&&(event.preventDefault(),closeSubpanel(section))}),overlay){const onOverlayClick=function(){document.body.classList.contains(OPEN_CLASS)&&closeMenu(section)};overlay.addEventListener("click",onOverlayClick),section.__shmOverlayHandler=onOverlayClick}section.querySelectorAll("[data-region-currency-trigger]").forEach(function(trigger){trigger.addEventListener("click",function(){document.body.classList.contains(OPEN_CLASS)&&closeMenu(section)},!0)});const onKeydown=function(event){if(event.key!=="Escape")return;if(isSearchOpen()){closeMobileSearch(section);return}const search=getMobileSearch(section);if(search&&search.classList.contains("is-focused")){blurMobileSearch(section);return}if(section.querySelector(".shm__panel[data-panel-id].is-active")){closeSubpanel(section);return}document.body.classList.contains(OPEN_CLASS)&&closeMenu(section)};document.addEventListener("keydown",onKeydown),section.__shmKeyHandler=onKeydown;const onResize=function(){document.body.classList.contains(OPEN_CLASS)?refreshMenuScroll(section):updateDrawerTop(section),isMobile()&&isSearchOpen()&&positionMobileSearch(section),!isMobile()&&document.body.classList.contains(OPEN_CLASS)&&closeMenu(section)};if(window.addEventListener("resize",onResize,{passive:!0}),section.__shmResizeHandler=onResize,setupAccordions(section),setupMobileSearch(section),updateDrawerTop(section),section.querySelector(".shm__bag-count")){refreshMobileBag(section);const onCartChange=function(){refreshMobileBag(section)};document.addEventListener("cart:rendered",onCartChange),document.addEventListener("side-cart:rendered",onCartChange),section.__shmCartHandler=onCartChange}}function destroy(section){if(!section)return;if(document.body.classList.contains(OPEN_CLASS)&&closeMenu(section),section.__shmOverlayHandler){const overlay=document.querySelector(".bg-overlay");overlay&&overlay.removeEventListener("click",section.__shmOverlayHandler),section.__shmOverlayHandler=null}section.__shmSearchRepositionHandler&&(window.removeEventListener("scroll",section.__shmSearchRepositionHandler),section.__shmSearchRepositionHandler=null),section.__shmKeyHandler&&document.removeEventListener("keydown",section.__shmKeyHandler),section.__shmResizeHandler&&window.removeEventListener("resize",section.__shmResizeHandler),section.__shmSearchObserver&&(section.__shmSearchObserver.disconnect(),section.__shmSearchObserver=null),section.__shmSearchOutsideHandler&&(document.removeEventListener("pointerdown",section.__shmSearchOutsideHandler,!0),section.__shmSearchOutsideHandler=null);const search=getMobileSearch(section);search&&search.__shmPhTimer&&(window.clearInterval(search.__shmPhTimer),search.__shmPhTimer=null),section.__shmCartHandler&&(document.removeEventListener("cart:rendered",section.__shmCartHandler),document.removeEventListener("side-cart:rendered",section.__shmCartHandler),section.__shmCartHandler=null),section.__shmInit=!1}function boot(){document.querySelectorAll(sectionSelector).forEach(init)}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",boot):boot(),window.addEventListener("load",function(){document.querySelectorAll(sectionSelector).forEach(updateDrawerTop),bindMobileSearchPanelGuard()}),document.addEventListener("shopify:section:load",function(event){if(!event.target||!event.target.querySelector)return;const node=event.target.matches&&event.target.matches(sectionSelector)?event.target:event.target.querySelector(sectionSelector);init(node)}),document.addEventListener("shopify:section:unload",function(event){if(!event.target||!event.target.querySelector)return;const node=event.target.matches&&event.target.matches(sectionSelector)?event.target:event.target.querySelector(sectionSelector);destroy(node)}
1)})();
2//# sourceMappingURL=/cdn/shop/t/811/assets/site-header-mobile.js.map?v=150996754559946774451789977862

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.