PageSourceSearch

https://shop.lkz.de/theme/151143c57b490ac8701b6dc1717f257a/js/stor…/storefront.offcanvas-menu.plugin.609df9.js

js lkz.de collected 2026-09-24 09:22:29 UTC 10,225 bytes, 3 lines download raw bytes

1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[3685],{3685(e,t,n){n.r(t),n.d(t,{default:()=>o});var s=n(4335),i=n(6105),a=n(5683),r=n(9068);class o extends s.A{static #e=this.options={navigationUrl:window.router["frontend.menu.offcanvas"],position:"left",triggerEvent:"click",additionalOffcanvasClass:"navigation-offcanvas",linkSelector:".js-navigation-offcanvas-link",loadingIconSelector:".js-navigation-offcanvas-loading-icon",linkLoadingClass:"is-loading",menuSelector:".navigation-offcanvas-container",initialContentSelector:".js-navigation-offcanvas-initial-content",currentCategorySelector:"a.is-current-category"};init(){this._cache={},this._client=new r.A,this._content=a.A.getTemplate(),this._registerEvents()}_registerEvents(){this._boundGetLinkEventHandler||(this._boundGetLinkEventHandler=this._getLinkEventHandler.bind(this)),this.el.removeEventListener(this.options.triggerEvent,this._boundGetLinkEventHandler),this.el.addEventListener(this.options.triggerEvent,this._boundGetLinkEventHandler),i.A.exists()&&i.A.getOffCanvas().forEach(e=>{e.querySelectorAll(this.options.linkSelector).forEach(e=>{o._resetLoader(e),e.addEventListener("click",t=>{this._getLinkEventHandler(t,e)})}),window.PluginManager.initializePluginsInParentElement(e)}),this._openMenuViaUrlParameter()}_openMenu(e){o._stopEvent(e),i.A.open(this._content,this._registerEvents.bind(this),this.options.position),i.A.setAdditionalClassName(this.options.additionalOffcanvasClass),this.$emitter.publish("openMenu")}_openMenuViaUrlParameter(){let e=new URLSearchParams(window.location.search);if(e.has("offcanvas")&&"menu"===e.get("offcanvas")&&(document.querySelector('[data-off-canvas-menu="true"]')?.click(),window.history.replaceState)){let e=new URL(window.location);e.searchParams.delete("offcanvas"),window.history.replaceState({},document.title,e)}}_getLinkEventHandler(e,t){if(!t){let t=document.querySelector(this.options.initialContentSelector),n=`${this.options.navigationUrl}?navigationId=${window.activeNavigationId}`;return this._fetchMenu(n,n=>(t.querySelector(this.options.menuSelector).innerHTML=n,this._content=t.innerHTML,this._openMenu(e)))}if(o._stopEvent(e),t.classList.contains(this.options.linkLoadingClass))return;o._setLoader(t);let n=t.getAttribute("data-href")||t.getAttribute("href");n&&(this.$emitter.publish("getLinkEventHandler"),this._fetchMenu(n,this._updateContent.bind(this)))}static _setLoader(e){e.classList.add(this.options.linkLoadingClass);let t=e.querySelector(this.options.loadingIconSelector);t&&(t._linkIcon=t.innerHTML,t.innerHTML=a.A.getTemplate())}static _resetLoader(e){e.classList.remove(this.options.linkLoadingClass);let t=e.querySelector(this.options.loadingIconSelector);t&&t._linkIcon&&(t.innerHTML=t._linkIcon)}_updateContent(e){if(this._content=e,i.A.exists()){let t=o._getOffcanvasMenu();t.innerHTML=e;let n=t.querySelector(this.options.currentCategorySelector);window.focusHandler.setFocus(n,{focusVisible:!0}),this._registerEvents()}this.$emitter.publish("updateContent")}_fetchMenu(e,t){return!!e&&(this._cache[e]&&"function"==typeof t?t(this._cache[e]):void(this.$emitter.publish("beforeFetchMenu"),fetch(e,{headers:{"X-Requested-With":"XMLHttpRequest"}}).then(e=>e.text()).then(n=>{this._cache[e]=n,"function"==typeof t&&t(n)})))}static _stopEvent(e){e.preventDefault(),e.stopImmediatePropagation()}static _getOffcanvas(){return i.A.getOffCanvas()[0]}static _getOffcanvasMenu(){return o._getOffcanvas().querySelector(this.options.menuSelector)}}},5683(e,t,n){n.d(t,{A:()=>a,c:()=>i});let s="loader",i={BEFORE:"before",AFTER:"after",INNER:"inner"};class a{constructor(e,t=i.BEFORE){this.parent=e instanceof Element?e:document.body.querySelector(e),this.position=t}create(){if(!this.exists()){if(this.position===i.INNER){this._previousHTML=this.parent.innerHTML,this.parent.innerHTML=a.getTemplate();return}this.parent.insertAdjacentHTML(this._getPosition(),a.getTemplate())}}remove(){if(this.position===i.INNER){this.parent.innerHTML=this._previousHTML;return}this.parent.querySelectorAll(`.${s}`).forEach(e=>e.remove())}exists(){return this.parent.querySelectorAll(`.${s}`).length>0}_getPosition(){return this.position===i.BEFORE?"afterbegin":"beforeend"}static getTemplate(){return`<div class="${s}" role="status">
2                    <span class="visually-hidden">Loading...</span>
3                </div>`}static SELECTOR_CLASS(){return s}}},6105(e,t,n){n.d(t,{A:()=>l,r:()=>o});var s=n(8308);let i="js-offcanvas-singleton",a=new WeakMap;class r{constructor(){this.$emitter=new s.A}open(e,t,n,s,i,a,r){this._removeExistingOffCanvas();let o=this._createOffCanvas(n,a,r,s);this.setContent(e,i),this._openOffcanvas(o,t)}setContent(e,t){let n=this.getOffCanvas();n[0]&&(n[0].innerHTML=e,this._registerEvents(t),this._setAriaAttrs())}setAdditionalClassName(e){this.getOffCanvas()[0].classList.add(e)}getOffCanvas(){return document.querySelectorAll(`.${i}`)}close(e){let t=this.getOffCanvas();t.forEach(e=>{bootstrap.Offcanvas.getInstance(e).hide()}),setTimeout(()=>{this.$emitter.publish("onCloseOffcanvas",{offCanvasContent:t})},e)}goBackInHistory(){window.history.back()}exists(){return this.getOffCanvas().length>0}_openOffcanvas(e,t){window.focusHandler.saveFocusState("offcanvas"),this._disableBackgroundAccessibility(e),window.focusHandler._addFocusTrapGuard(e),r.bsOffcanvas.show(),window.history.pushState("offcanvas-open",""),"function"==typeof t&&t()}_registerEvents(e){let t=this.getOffCanvas();t.forEach(n=>{let s=()=>{setTimeout(()=>
3{this._restoreBackgroundState(),n.remove(),window.focusHandler._removeFocusTrapGuard(),window.focusHandler.resumeFocusState("offcanvas"),this.$emitter.publish("onCloseOffcanvas",{offCanvasContent:t})},e),n.removeEventListener("hide.bs.offcanvas",s)};n.addEventListener("hide.bs.offcanvas",s)}),window.addEventListener("popstate",this.close.bind(this,e),{once:!0}),document.querySelectorAll(".js-offcanvas-close").forEach(t=>{t.addEventListener("click",this.close.bind(this,e))})}_setAriaAttrs(){let e=this.getOffCanvas()[0],t="off-canvas-headline",n=e.querySelector(`[data-id="${t}"]`);n&&!e.hasAttribute("aria-labelledby")&&(n.setAttribute("id",t),e.setAttribute("aria-labelledby",t))}_disableBackgroundAccessibility(e){let t=[...document.body.children].filter(t=>t!==e).map(e=>({element:e,inert:e.inert,ariaHidden:e.getAttribute("aria-hidden")}));a.set(this,t),t.forEach(e=>{let{element:t}=e;t.inert=!0,t.setAttribute("aria-hidden","true")})}_restoreBackgroundState(){let e=a.get(this);e?.forEach(e=>{let{element:t,inert:n,ariaHidden:s}=e;if(t.inert=n,null===s){t.removeAttribute("aria-hidden");return}t.setAttribute("aria-hidden",s)}),a.delete(this)}_removeExistingOffCanvas(){this.getOffCanvas().forEach(e=>{let t=bootstrap.Offcanvas.getInstance(e);t&&"function"==typeof t.dispose&&t.dispose(),e.remove(),window.focusHandler._removeFocusTrapGuard()}
3),this._restoreBackgroundState(),r.bsOffcanvas=null}_getPositionClass(e){return"left"===e?"offcanvas-start":"right"===e?"offcanvas-end":`offcanvas-${e}`}_createOffCanvas(e,t,n,s){let a=document.createElement("div");if(a.classList.add("offcanvas",i),a.classList.add(this._getPositionClass(e)),a.setAttribute("tabindex","-1"),!0===t&&a.classList.add("is-fullwidth"),n){let e=typeof n;if("string"===e)a.classList.add(n);else if(Array.isArray(n))n.forEach(e=>{a.classList.add(e)});else throw Error(`The type "${e}" is not supported. Please pass an array or a string.`)}return document.body.appendChild(a),r.bsOffcanvas=new bootstrap.Offcanvas(a,{backdrop:!1!==s||"static"}),a}}let o=Object.freeze(new r);class l{static open(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"left",s=!(arguments.length>3)||void 0===arguments[3]||arguments[3],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:350,a=arguments.length>5&&void 0!==arguments[5]&&arguments[5],r=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"";o.open(e,t,n,s,i,a,r)}static setContent(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:350;o.setContent(e,t,n)}static setAdditionalClassName(e){o.setAdditionalClassName(e)}static close(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:350;o.close(e)}static exists(){return o.exists()}static getOffCanvas(){return o.getOffCanvas()}static REMOVE_OFF_CANVAS_DELAY(){return 350}}},9068(e,t,n){n.d(t,{A:()=>s});class s{constructor(){this._request=null,this._errorHandlingInternal=!1}get(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"application/json",s=this._createPreparedRequest("GET",e,n);return this._sendRequest(s,null,t)}post(e,t,n){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";s=this._getContentType(t,s);let i=this._createPreparedRequest("POST",e,s);return this._sendRequest(i,t,n)}delete(e,t,n){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";s=this._getContentType(t,s);let i=this._createPreparedRequest("DELETE",e,s);return this._sendRequest(i,t,n)}patch(e,t,n){let s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"application/json";s=this._getContentType(t,s);let i=this._createPreparedRequest("PATCH",e,s);return this._sendRequest(i,t,n)}abort(){if(this._request)return this._request.abort()}setErrorHandlingInternal(e){this._errorHandlingInternal=e}_registerOnLoaded(e,t){t&&(!0===this._errorHandlingInternal?(e.addEventListener("load",()=>{t(e.responseText,e)}),e.addEventListener("abort",()=>{console.warn(`the request to ${e.responseURL} was aborted`)}),e.addEventListener("error",()=>{console.warn(`the request to ${e.responseURL} failed with status ${e.status}`)}),e.addEventListener("timeout",()=>{console.warn(`the request to ${e.responseURL} timed out`)})):e.addEventListener("loadend",()=>{t(e.responseText,e)}))}_sendRequest(e,t,n){return this._registerOnLoaded(e,n),e.send(t),e}_getContentType(e,t){return e instanceof FormData&&(t=!1),t}_createPreparedRequest(e,t,n){return this._request=new XMLHttpRequest,this._request.open(e,t),this._request.setRequestHeader("X-Requested-With","XMLHttpRequest"),n&&this._request.setRequestHeader("Content-type",n),this._request}}}}]);

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.