PageSourceSearch

https://spargel.net/theme/233bfbb6606c847b541487108c200100/js/stor…/storefront.offcanvas-tabs.plugin.ade9ed.js

js spargel.net collected 2026-09-25 10:52:10 UTC 4,840 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[13139],{3139(t,e,s){s.r(e),s.d(e,{default:()=>r});var a=s(6105),i=s(640),n=s(4335);class r extends n.A{static #t=this.options={offcanvasPostion:"right"};init(){this._registerEventListeners()}_registerEventListeners(){this.el.addEventListener("click",this._onClickOffCanvasTab.bind(this))}_onClickOffCanvasTab(t){if(!1===this._isInAllowedViewports())return;t.preventDefault();let e=t.currentTarget;if(e.hasAttribute("href")){let t=e.getAttribute("href"),s=document.querySelector(t);a.A.open(s.innerHTML,()=>{let t=a.A.getOffCanvas();t.length>0&&window.PluginManager.initializePluginsInParentElement(t[0])},this.options.offcanvasPostion,!0,a.A.REMOVE_OFF_CANVAS_DELAY(),!1)}this.$emitter.publish("onClickOffCanvasTab")}_isInAllowedViewports(){return i.A.isXS()}}},6105(t,e,s){s.d(e,{A:()=>f,r:()=>o});var a=s(8308);let i="js-offcanvas-singleton",n=new WeakMap;class r{constructor(){this.$emitter=new a.A}open(t,e,s,a,i,n,r){this._removeExistingOffCanvas();let o=this._createOffCanvas(s,n,r,a);this.setContent(t,i),this._openOffcanvas(o,e)}setContent(t,e){let s=this.getOffCanvas();s[0]&&(s[0].innerHTML=t,this._registerEvents(e),this._setAriaAttrs())}setAdditionalClassName(t){this.getOffCanvas()[0].classList.add(t)}getOffCanvas(){return document.querySelectorAll(`.${i}`)}close(t){let e=this.getOffCanvas();e.forEach(t=>{bootstrap.Offcanvas.getInstance(t).hide()}),setTimeout(()=>{this.$emitter.publish("onCloseOffcanvas",{offCanvasContent:e})},t)}goBackInHistory(){window.history.back()}exists(){return this.getOffCanvas().length>0}_openOffcanvas(t,e){window.focusHandler.saveFocusState("offcanvas"),this._disableBackgroundAccessibility(t),window.focusHandler._addFocusTrapGuard(t),r.bsOffcanvas.show(),window.history.pushState("offcanvas-open",""),"function"==typeof e&&e()}_registerEvents(t){let e=this.getOffCanvas();e.forEach(s=>{let a=()=>{setTimeout(()=>
1{this._restoreBackgroundState(),s.remove(),window.focusHandler._removeFocusTrapGuard(),window.focusHandler.resumeFocusState("offcanvas"),this.$emitter.publish("onCloseOffcanvas",{offCanvasContent:e})},t),s.removeEventListener("hide.bs.offcanvas",a)};s.addEventListener("hide.bs.offcanvas",a)}),window.addEventListener("popstate",this.close.bind(this,t),{once:!0}),document.querySelectorAll(".js-offcanvas-close").forEach(e=>{e.addEventListener("click",this.close.bind(this,t))})}_setAriaAttrs(){let t=this.getOffCanvas()[0],e="off-canvas-headline",s=t.querySelector(`[data-id="${e}"]`);s&&!t.hasAttribute("aria-labelledby")&&(s.setAttribute("id",e),t.setAttribute("aria-labelledby",e))}_disableBackgroundAccessibility(t){let e=[...document.body.children].filter(e=>e!==t).map(t=>({element:t,inert:t.inert,ariaHidden:t.getAttribute("aria-hidden")}));n.set(this,e),e.forEach(t=>{let{element:e}=t;e.inert=!0,e.setAttribute("aria-hidden","true")})}_restoreBackgroundState(){let t=n.get(this);t?.forEach(t=>{let{element:e,inert:s,ariaHidden:a}=t;if(e.inert=s,null===a){e.removeAttribute("aria-hidden");return}e.setAttribute("aria-hidden",a)}),n.delete(this)}_removeExistingOffCanvas(){this.getOffCanvas().forEach(t=>{let e=bootstrap.Offcanvas.getInstance(t);e&&"function"==typeof e.dispose&&e.dispose(),t.remove(),window.focusHandler._removeFocusTrapGuard()}
1),this._restoreBackgroundState(),r.bsOffcanvas=null}_getPositionClass(t){return"left"===t?"offcanvas-start":"right"===t?"offcanvas-end":`offcanvas-${t}`}_createOffCanvas(t,e,s,a){let n=document.createElement("div");if(n.classList.add("offcanvas",i),n.classList.add(this._getPositionClass(t)),n.setAttribute("tabindex","-1"),!0===e&&n.classList.add("is-fullwidth"),s){let t=typeof s;if("string"===t)n.classList.add(s);else if(Array.isArray(s))s.forEach(t=>{n.classList.add(t)});else throw Error(`The type "${t}" is not supported. Please pass an array or a string.`)}return document.body.appendChild(n),r.bsOffcanvas=new bootstrap.Offcanvas(n,{backdrop:!1!==a||"static"}),n}}let o=Object.freeze(new r);class f{static open(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"left",a=!(arguments.length>3)||void 0===arguments[3]||arguments[3],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:350,n=arguments.length>5&&void 0!==arguments[5]&&arguments[5],r=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"";o.open(t,e,s,a,i,n,r)}static setContent(t){let e=!(arguments.length>1)||void 0===arguments[1]||arguments[1],s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:350;o.setContent(t,e,s)}static setAdditionalClassName(t){o.setAdditionalClassName(t)}static close(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:350;o.close(t)}static exists(){return o.exists()}static getOffCanvas(){return o.getOffCanvas()}static REMOVE_OFF_CANVAS_DELAY(){return 350}}}}]);

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.