1import{c as L,A as p}from"./aria-live-region-context.BZEtRCSs.min.js";import{c as _,a as P}from"./cart-sections.WoVMkNAv.min.js";import{c as C}from"./deferred-media.DLykk27G.min.js";import{m as A}from"./modal-context.eEhUllgb.min.js";import{c as x}from"./quickshop.CQYPJqsz.min.js";import{s as w}from"./context-request-event.CcEA9XIP.min.js";import{s as y}from"./lit-element.mvcqtviJ.min.js";import{t as R}from"./custom-element.BhZVzxrc.min.js";import{r as c}from"./state.Cmay8SOG.min.js";import"./create-context.89xeped_.min.js";import"./property.C7OeqhA5.min.js";/** 2 * @license 3 * Copyright 2021 Google LLC 4 * SPDX-License-Identifier: BSD-3-Clause 5 */class M{get value(){return this.o}set value(e){this.setValue(e)}setValue(e,i=!1){const s=i||!Object.is(e,this.o);this.o=e,s&&this.updateObservers()}constructor(e){this.subscriptions=new Map,this.updateObservers=()=>{for(const[i,{disposer:s}]of this.subscriptions)i(this.o,s)},e!==void 0&&(this.value=e)}addCallback(e,i,s){if(!s)return void e(this.value);this.subscriptions.has(e)||this.subscriptions.set(e,{disposer:()=>{this.subscriptions.delete(e)},consumerHost:i});const{disposer:a}=this.subscriptions.get(e);e(this.value,a)}clearCallbacks(){this.subscriptions.clear()}}/** 6 * @license 7 * Copyright 2021 Google LLC 8 * SPDX-License-Identifier: BSD-3-Clause 9 */let O=class extends Event{constructor(e){super("context-provider",{bubbles:!0,composed:!0}),this.context=e}};class S extends M{constructor(e,i,s){var a,n;super(i.context!==void 0?i.initialValue:s),this.onContextRequest=o=>{const r=o.composedPath()[0];o.context===this.context&&r!==this.host&&(o.stopPropagation(),this.addCallback(o.callback,r,o.subscribe))},this.onProviderRequest=o=>{const r=o.composedPath()[0];if(o.context!==this.context||r===this.host)return;const g=new Set;for(const[f,{consumerHost:D}]of this.subscriptions)g.has(f)||(g.add(f),D.dispatchEvent(new w(this.context,f,!0)));o.stopPropagation()},this.host=e,i.context!==void 0?this.context=i.context:this.context=i,this.attachListeners(),(n=(a=this.host).addController)==null||n.call(a,this)}attachListeners(){this.host.addEventListener("context-request",this.onContextRequest),this.host.addEventListener("context-provider",this.onProviderRequest)}hostConnected(){this.host.dispatchEvent(new O(this.context))}}/** 10 * @license 11 * Copyright 2017 Google LLC 12 * SPDX-License-Identifier: BSD-3-Clause 13 */function u({context:t}){return(e,i)=>{const s=new WeakMap;if(typeof i=="object")return i.addInitializer(function(){s.set(this,new S(this,{context:t}))}),{get(){return e.get.call(this)},set(a){var n;return(n=s.get(this))==null||n.setValue(a),e.set.call(this,a)},init(a){var n;return(n=s.get(this))==null||n.setValue(a),a}};{e.constructor.addInitializer(o=>{s.set(o,new S(o,{context:t}))});const a=Object.getOwnPropertyDescriptor(e,i);let n;if(a===void 0){const o=new WeakMap;n={get:function(){return o.get(this)},set:function(r){s.get(this).setValue(r),o.set(this,r)},configurable:!0,enumerable:!0}}else{const o=a.set;n={...a,set:function(r){s.get(this).setValue(r),o==null||o.call(this,r)}}}return void Object.defineProperty(e,i,n)}}}var H=Object.defineProperty,k=Object.getOwnPropertyDescriptor,l=(t,e,i,s)=>{for(var a=s>1?void 0:s?k(e,i):e,n=t.length-1,o;n>=0;n--)(o=t[n])&&(a=(s?o(e,i,a):o(a))||a);return s&&a&&H(e,i,a),a};const h={OPEN:"modal-dialog::open",CLOSE:"modal-dialog::close",CLOSE_ALL:"modal-dialog::close-all"},m={UPDATED:"cart:updated",UPDATED_SECTIONS:"cart:updated-sections"},E={PAUSE:"deferred-media::pause",PLAY:"deferred-media::play"},v={OPEN:"quickshop::open",CLOSE:"quickshop::close"},b="modals";let d=class extends y{constructor(){super(),this.cart=window.__CART__,this.cartSections={},this.modals=[],this.activeDeferredMedia=null,this.quickShop=null,this.boundHandleCartUpdate=this._handleCartUpdate.bind(this),this.boundHandleCartSectionsUpdate=this._handleCartSectionsUpdate.bind(this),this.boundHandleAriaLiveRegionSet=this._handleAriaLiveRegionSet.bind(this),this.boundHandleAriaLiveRegionClear=this._handleAriaLiveRegionClear.bind(this),this.boundHandleDeferredMediaPause=this._handleDeferredMediaPause.bind(this),this.boundHandleDeferredMediaPlay=this._handleDeferredMediaPlay.bind(this),this.boundHandleDialogSchemaClick=this._handleDialogSchemaClick.bind(this),this.boundHandleDialogEvent=this._handleDialogEvent.bind(this),this.boundHandleQuickShopEvent=this._handleQuickShopEvent.bind(this)}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.addEventListener(m.UPDATED,this.boundHandleCartUpdate),this.addEventListener(m.UPDATED_SECTIONS,this.boundHandleCartSectionsUpdate),this.addEventListener(p.SET,this.boundHandleAriaLiveRegionSet),this.addEventListener(p.CLEAR,this.boundHandleAriaLiveRegionClear),this.addEventListener(E.PAUSE,this.boundHandleDeferredMediaPause),this.addEventListener(E.PLAY,this.boundHandleDeferredMediaPlay),this.addEventListener("click",this.boundHandleDialogSchemaClick),Object.values(h).forEac
13h(t=>{this.addEventListener(t,this.boundHandleDialogEvent)}),Object.values(v).forEach(t=>{this.addEventListener(t,this.boundHandleQuickShopEvent)}),this._handleRestoreModals()}disconnectedCallback(){this.removeEventListener(m.UPDATED,this.boundHandleCartUpdate),this.removeEventListener(m.UPDATED_SECTIONS,this.boundHandleCartSectionsUpdate),this.removeEventListener(p.SET,this.boundHandleAriaLiveRegionSet),this.removeEventListener(p.CLEAR,this.boundHandleAriaLiveRegionClear),this.removeEventListener(E.PAUSE,this.boundHandleDeferredMediaPause),this.removeEventListener(E.PLAY,this.boundHandleDeferredMediaPlay),this.removeEventListener("click",this.boundHandleDialogSchemaClick),Object.values(h).forEach(t=>{this.removeEventListener(t,this.boundHandleDialogEvent)}),Object.values(v).forEach(t=>{this.removeEventListener(t,this.boundHandleQuickShopEvent)}),super.disconnectedCallback()}_handleDeferredMediaPlay(t){const e=t.composedPath(),i=e.length>0?e[0]:t.target;i===this.activeDeferredMedia||i.tagName!=="DEFERRED-MEDIA"||(this.activeDeferredMedia=i)}_handleDeferredMediaPause(){this._pauseAllDeferredMedia()}_handleCartUpdate(t){t.detail&&(this.cart=t.detail)}_handleCartSectionsUpdate(t){t.detail&&(this.cartSections=t.detail||{})}_handleDialogSchemaClick(t){const e=t.composedPath(),i=e.length>0?e[0]:t.target;if(i.tagName==="A"){const s=i.getAttribute("href");if(s&&(s.startsWith("modal-dialog://")||s.startsWith("#modal-dialog://"))){t.preventDefault();const a=s.replace("modal-dialog://","").replace("#","");a&&this._handleDialogEvent(new CustomEvent(h.OPEN,{detail:a}))}}}_handleDialogEvent(t){let e=[...this.modals];switch(t.type){case h.OPEN:t.detail&&(e=[...e,t.detail]);break;case h.CLOSE:t.detail&&(e=e.filter(i=>i!==t.detail)),this.quickShop=null;break;case h.CLOSE_ALL:e=[],this.quickShop=null;break}e=[...new Set(e)],this.modals=e,this._applyModalsState(),this._pauseAllDeferredMedia(),this._updateQueryParams()}_pauseAllDeferredMedia(){try{if(this.activeDeferredMedia===null){Array.from(this.querySelectorAll("deferred-media")).forEach(e=>e.pause(!0));return}this.activeDeferredMedia=null}catch(t){console.error(t)}}async _applyModalsState(){await customElements.whenDefined("modal-dialog");const t=this.modals,e=Array.from(this.querySelectorAll("modal-dialog"));if(t.length>0){const i=window.innerWidth-document.body.getBoundingClientRect().width;document.documentElement.style.setProperty("--scrollbar-width",`${i}px`)}else document.documentElement.style.setProperty("--scrollbar-width","0px");for(const i of e)t.includes(i.id)?i.show():i.hide()}_handleRestoreModals(){const e=new URLSearchParams(window.location.search).get(b);e&&(this.modals=e.split(",").map(i=>i.trim()).filter(Boolean),this._applyModalsState())}_updateQueryParams(){const t=new URLSearchParams(window.location.search),e=this.modals,i=this.modals.join(",");e.length>0?t.set(b,i):t.delete(b);const s=`${window.location.pathname}?${t.toString()}`;window.history.replaceState({},"",s)}_handleAriaLiveRegionSet(t){t.detail&&(this.ariaLiveRegion=t.detail)}_handleAriaLiveRegionClear(){this.ariaLiveRegion={message:""}}_handleQuickShopEvent(t){const e=t.type,i=t.detail;e===v.OPEN?this.quickShop=i:this.quickShop=null}};l([u({context:_}),c()],d.prototype,"cart",2);l([u({context:P}),c()],d.prototype,"cartSections",2);l([u({context:A}),c()],d.prototype,"modals",2);l([u({context:L}),c()],d.prototype,"ariaLiveRegion",2);l([u({context:C}),c()],d.prototype,"activeDeferredMedia",2);l([u({context:x}),c()],d.prototype,"quickShop",2);d=l([R("app-provider")],d);
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.