https://betseyjohnson.com/cdn/shop/t/1305/assets/slideshow.bundle.js?v=17653361503216470581774858268
vendor: 13,109 bytes, lines 1-15
1var Slideshow=(function(_){"use strict";var Ht=Object.defineProperty,Rt=(_2,f2,$2)=>f2 in _2?Ht(_2,f2,{enumerable:!0,configurable:!0,writable:!0,value:$2}):_2[f2]=$2,D=(_2,f2,$2)=>Rt(_2,typeof f2!="symbol"?f2+"":f2,$2);/** 2* @license 3* Copyright 2019 Google LLC 4* SPDX-License-Identifier: BSD-3-Clause 5*/var ut;const f=globalThis,$=f.ShadowRoot&&(f.ShadyCSS===void 0||f.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,J=Symbol(),Z=new WeakMap;let pt=class{constructor(t,e,i){if(this._$cssResult$=!0,i!==J)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if($&&t===void 0){const i=e!==void 0&&e.length===1;i&&(t=Z.get(e)),t===void 0&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),i&&Z.set(e,t))}return t}toString(){return this.cssText}};const gt=n=>new pt(typeof n=="string"?n:n+"",void 0,J),ft=(n,t)=>{if($)n.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet);else for(const e of t){const i=document.createElement("style"),s=f.litNonce;s!==void 0&&i.setAttribute("nonce",s),i.textContent=e.cssText,n.appendChild(i)}},G=$?n=>n:n=>n instanceof CSSStyleSheet?(t=>{let e="";for(const i of t.cssRules)e+=i.cssText;return gt(e)})(n):n;/** 6* @license 7* Copyright 2017 Google LLC 8* SPDX-License-Identifier: BSD-3-Clause 9*/const{is:_t,defineProperty:mt,getOwnPropertyDescriptor:$t,getOwnPropertyNames:yt,getOwnPropertySymbols:vt,getPrototypeOf:St}=Object,y=globalThis,Y=y.trustedTypes,wt=Y?Y.emptyScript:"",j=y.reactiveElementPolyfillSupport,I=(n,t)=>n,F={toAttribute(n,t){switch(t){case Boolean:n=n?wt:null;break;case Object:case Array:n=n==null?n:JSON.stringify(n)}return n},fromAttribute(n,t){let e=n;switch(t){case Boolean:e=n!==null;break;case Number:e=n===null?null:Number(n);break;case Object:case Array:try{e=JSON.parse(n)}catch{e=null}}return e}},Q=(n,t)=>!_t(n,t),tt={attribute:!0,type:String,converter:F,reflect:!1,useDefault:!1,hasChanged:Q};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),y.litPropertyMetadata??(y.litPropertyMetadata=new WeakMap);let E=class extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=tt){if(e.state&&(e.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(t)&&((e=Object.create(e)).wrapped=!0),this.elementProperties.set(t,e),!e.noAccessor){const i=Symbol(),s=this.getPropertyDescriptor(t,i,e);s!==void 0&&mt(this.prototype,t,s)}}static getPropertyDescriptor(t,e,i){const{get:s,set:o}=$t(this.prototype,t)??{get(){return this[e]},set(r){this[e]=r}};return{get:s,set(r){const a=s?.call(this);o?.call(this,r),this.requestUpdate(t,a,i)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??tt}static _$Ei(){if(this.hasOwnProperty(I("elementProperties")))return;const t=St(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(I("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(I("properties"))){const e=this.properties,i=[...yt(e),...vt(e)];for(const s of i)this.createProperty(s,e[s])}const t=this[Symbol.metadata];if(t!==null){const e=litPropertyMetadata.get(t);if(e!==void 0)for(const[i,s]of e)this.elementProperties.set(i,s)}this._$Eh=new Map;for(const[e,i]of this.elementProperties){const s=this._$Eu(e,i);s!==void 0&&this._$Eh.set(s,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const i=new Set(t.flat(1/0).reverse());for(const s of i)e.unshift(G(s))}else t!==void 0&&e.push(G(t));return e}static _$Eu(t,e){const i=e.attribute;return i===!1?void 0:typeof i=="string"?i:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$ES=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$E_(),this.requestUpdate(),(t=this.constructor.l)==null||t.forEach(e=>e(this))}addController(t){var e;(this._$EO??(this._$EO=new Set)).add(t),this.renderRoot!==void 0&&this.isConnected&&((e=t.hostConnected)==null||e.call(t))}removeController(t){var e;(e=this._$EO)==null||e.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const i of e.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return ft(t,this.constructor.elementStyles),t}connectedCallback(){var t;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$EO)==null||t.forEach(e=>{var i;return(i=e.hostConnected)==null?void 0:i.call(e)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$EO)==null||t.forEach(e=>{var i;return(i=e.hostDisconnected)==null?void 0:i.call(e)})}attributeChangedCallback(t,e,i){this._$AK(t,i)}_$ET(t,e){var o;const i=this.constructor.elementProperties.get(t),s=this.constructor._$Eu(t,i);if(s!==void 0&&i.reflect===!0){const r=(((o=i.converter)==null?void 0:o.toAttribute)!==void 0?i.converter:F).toAttribute(e,i.type);this._$Em=t,r==null?this.removeAttribute(s):this.setAttribute(s,r),this._$Em=null}}_$AK(t,e){var o,r;const i=this.constructor,s=i._$Eh.get(t);if(s!==void 0&&this._$Em!==s){const a=i.getPropertyOptions(s),l=typeof a.converter=="function"?{fromAttribute:a.converter}:((o=a.converter)==null?void 0:o.fromAttribute)!==void 0?a.converter:F;this._$Em=s;const c=l.fromAttribute(e,a.type);this[s]=c??((r=this._$Ej)==null?void 0:r.get(s))??c,this._$Em=null}}requestUpdate(t,e,i){var s;if(t!==void 0){const o=this.constructor,r=this[t];if(i??(i=o.getPropertyOptions(t)),!((i.hasChanged??Q)(r,e)||i.useDefault&&i.reflect&&r===((s=this._$Ej)==null?void 0:s.get(t))&&!this.hasAttribute(o._$Eu(t,i))))return;this.C(t,e,i)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(t,e,{useDefault:i,reflect:s,wrapped:o},r){i&&!(this._$Ej??(this._$Ej=new Map)).has(t)&&(this._$Ej.set(t,r??e??this[t]),o!==!0||r!==void 0)||(this._$AL.has(t)||(this.hasUpdated||i||(e=void 0),this._$AL.set(t,e)),s===!0&&this._$Em!==t&&(this._$Eq??(this._$Eq=new Set)).add(t))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var i;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[o,r]of this._$Ep)this[o]=r;this._$Ep=void 0}const s=this.constructor.elementProperties;if(s.size>0)for(const[o,r]of s){const{wrapped:a}=r,l=this[o];a!==!0||this._$AL.has(o)||l===void 0||this.C(o,void 0,r,l)}}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),(i=this._$EO)==null||i.forEach(s=>{var o;return(o=s.hostUpdate)==null?void 0:o.call(s)}),this.update(e)):this._$EM()}catch(s){throw t=!1,this._$EM(),s}t&&this._$AE(e)}willUpdate(t){}_$AE(t){var e;(e=this._$EO)==null||e.forEach(i=>{var s;return(s=i.hostUpdated)==null?void 0:s.call(i)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Eq&&(this._$Eq=this._$Eq.forEach(e=>this._$ET(e,this[e]))),this._$EM()}updated(t){}firstUpdated(t){}};E.elementStyles=[],E.shadowRootOptions={mode:"open"},E[I("elementProperties")]=new Map,E[I("finalized")]=new Map,j?.({ReactiveElement:E}),(y.reactiveElementVersions??(y.reactiveElementVersions=[])).push("2.1.1");/** 10* @license 11* Copyright 2017 Google LLC 12* SPDX-License-Identifier: BSD-3-Clause 13*/const P=globalThis,R=P.trustedTypes,et=R?R.createPolicy("lit-html",{createHTML:n=>n}):void 0,it="$lit$",v=`lit$${Math.random().toFixed(9).slice(2)}$`,st="?"+v,bt=`<${st}>`,w=document,L=()=>w.createComment(""),T=n=>n===null||typeof n!="object"&&typeof n!="function",q=Array.isArray,At=n=>q(n)||typeof n?.[Symbol.iterator]=="function",W=`[ 14\f\r]`,M=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,ot=/-->/g,rt=/>/g,b=RegExp(`>|${W}(?:([^\\s"'>=/]+)(${W}*=${W}*(?:[^ 15\f\r"'\`<>=]|("|')|))|$)`,"g"),nt=/'/g,lt=/"/g,at=/^(?:script|style|textarea|title)$/i,xt=n=>(t,...e)=>({_$litType$:n,strings:t,values:e}),d=xt(1),A=Symbol.for("lit-noChange"),u=Symbol.for("lit-nothing"),ht=new WeakMap,x=w.createTreeWalker(w,129);function dt(n,t){if(!q(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return et!==void 0?et.createHTML(t):t}const Ct=(n,t)=>{const e=n.length-1,i=[];let s,o=t===2?"<svg>":t===3?"<math>":"",r=M;for(let a=0;a<e;a++){const l=n[a];let c,p,h=-1,m=0;for(;m<l.length&&(r.lastIndex=m,p=r.exec(l),p!==null);)m=r.lastIndex,r===M?p[1]==="!--"?r=ot:p[1]!==void 0?r=rt:p[2]!==void 0?(at.test(p[2])&&(s=RegExp("</"+p[2],"g")),r=b):p[3]!==void 0&&(r=b):r===b?p[0]===">"?(r=s??M,h=-1):p[1]===void 0?h=-2:(h=r.lastIndex-p[2].length,c=p[1],r=p[3]===void 0?b:p[3]==='"'?lt:nt):r===lt||r===nt?r=b:r===ot||r===rt?r=M:(r=b,s=void 0);const S=r===b&&n[a+1].startsWith("/>")?" ":"";o+=r===M?l+bt:h>=0?(i.push(c),l.slice(0,h)+it+l.slice(h)+v+S):l+v+(h===-2?a:S)}return[dt(n,o+(n[e]||"<?>")+(t===2?"</svg>":t===3?"</math>":"")),i]};class U{constructor({strings:t,_$litType$:e},i){let s;this.parts=[];let o=0,r=0;const a=t.length-1,l=this.parts,[c,p]=Ct(t,e);if(this.el=U.createElement(c,i),x.currentNode=this.el.content,e===2||e===3){const h=this.el.content.firstChild;h.replaceWith(...h.childNodes)}for(;(s=x.nextNode())!==null&&l.length<a;){if(s.nodeType===1){if(s.hasAttributes())for(const h of s.getAttributeNames())if(h.endsWith(it)){const m=p[r++],S=s.getAttribute(h).split(v),z=/([.?@])?(.*)/.exec(m);l.push({type:1,index:o,name:z[2],strings:S,ctor:z[1]==="."?kt:z[1]==="?"?It:z[1]==="@"?Pt:O}),s.removeAttribute(h)}else h.startsWith(v)&&(l.push({type:6,index:o}),s.removeAttribute(h));if(at.test(s.tagName)){const h=s.textContent.split(v),m=h.length-1;if(m>0){s.textContent=R?R.emptyScript:"";for(let S=0;S<m;S++)s.append(h[S],L()),x.nextNode(),l.push({type:2,index:++o});s.append(h[m],L())}}}else if(s.nodeType===8)if(s.data===st)l.push({type:2,index:o});else{let h=-1;for(;(h=s.data.indexOf(v,h+1))!==-1;)l.push({type:7,index:o}),h+=v.length-1}o++}}static createElement(t,e){const i=w.createElement("template");return i.innerHTML=t,i}}function k(n,t,e=n,i){var r,a;if(t===A)return t;let s=i!==void 0?(r=e._$Co)==null?void 0:r[i]:e._$Cl;const o=T(t)?void 0:t._$litDirective$;return s?.constructor!==o&&((a=s?._$AO)==null||a.call(s,!1),o===void 0?s=void 0:(s=new o(n),s._$AT(n,e,i)),i!==void 0?(e._$Co??(e._$Co=[]))[i]=s:e._$Cl=s),s!==void 0&&(t=k(n,s._$AS(n,t.values),s,i)),t}class Et{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:i}=this._$AD,s=(t?.creationScope??w).importNode(e,!0);x.currentNode=s;let o=x.nextNode(),r=0,a=0,l=i[0];for(;l!==void 0;){if(r===l.index){let c;l.type===2?c=new N(o,o.nextSibling,this,t):l.type===1?c=new l.ctor(o,l.name,l.strings,this,t):l.type===6&&(c=new Lt(o,this,t)),this._$AV.push(c),l=i[++a]}r!==l?.index&&(o=x.nextNode(),r++)}return x.currentNode=w,s}p(t){let e=0;for(const i of this._$AV)i!==void 0&&(i.strings!==void 0?(i._$AI(t,i,e),e+=i.strings.length-2):i._$AI(t[e])),e++}}class N{get _$AU(){var t;return((t=this._$AM)==null?void 0:t._$AU)??this._$Cv}constructor(t,e,i,s){this.type=2,this._$AH=u,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=i,this.options=s,this._$Cv=s?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return e!==void 0&&t?.nodeType===11&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=k(this,t,e),T(t)?t===u||t==null||t===""?(this._$AH!==u&&this._$AR(),this._$AH=u):t!==this._$AH&&t!==A&&this._(t):t._$litType$!==void 0?this.$(t):t.nodeType!==void 0?this.T(t):At(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==u&&T(this._$AH)?this._$AA.nextSibling.data=t:this.T(w.createTextNode(t)),this._$AH=t}$(t){var o;const{values:e,_$litType$:i}=t,s=typeof i=="number"?this._$AC(t):(i.el===void 0&&(i.el=U.createElement(dt(i.h,i.h[0]),this.options)),i);if(((o=this._$AH)==null?void 0:o._$AD)===s)this._$AH.p(e);else{const r=new Et(s,this),a=r.u(this.options);r.p(e),this.T(a),this._$AH=r}}_$AC(t){let e=ht.get(t.strings);return e===void 0&&ht.set(t.strings,e=new U(t)),e}k(t){q(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let i,s=0;for(const o of t)s===e.length?e.push(i=new N(this.O(L()),this.O(L()),this,this.options)):i=e[s],i._$AI(o),s++;s<e.length&&(this._$AR(i&&i._$AB.nextSibling,s),e.length=s)}_$AR(t=this._$AA.nextSibling,e){var i;
15for((i=this._$AP)==null?void 0:i.call(this,!1,!0,e);t!==this._$AB;){const s=t.nextSibling;t.remove(),t=s}}setConnected(t){var e;this._$AM===void 0&&(this._$Cv=t,(e=this._$AP)==null||e.call(this,t))}}class O{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,i,s,o){this.type=1,this._$AH=u,this._$AN=void 0,this.element=t,this.name=e,this._$AM=s,this.options=o,i.length>2||i[0]!==""||i[1]!==""?(this._$AH=Array(i.length-1).fill(new String),this.strings=i):this._$AH=u}_$AI(t,e=this,i,s){const o=this.strings;let r=!1;if(o===void 0)t=k(this,t,e,0),r=!T(t)||t!==this._$AH&&t!==A,r&&(this._$AH=t);else{const a=t;let l,c;for(t=o[0],l=0;l<o.length-1;l++)c=k(this,a[i+l],e,l),c===A&&(c=this._$AH[l]),r||(r=!T(c)||c!==this._$AH[l]),c===u?t=u:t!==u&&(t+=(c??"")+o[l+1]),this._$AH[l]=c}r&&!s&&this.j(t)}j(t){t===u?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class kt extends O{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===u?void 0:t}}class It extends O{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==u)}}class Pt extends O{constructor(t,e,i,s,o){super(t,e,i,s,o),this.type=5}_$AI(t,e=this){if((t=k(this,t,e,0)??u)===A)return;const i=this._$AH,s=t===u&&i!==u||t.capture!==i.capture||t.once!==i.once||t.passive!==i.passive,o=t!==u&&(i===u||s);s&&this.element.removeEventListener(this.name,this,i),o&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){var e;typeof this._$AH=="function"?this._$AH.call(((e=this.options)==null?void 0:e.host)??this.element,t):this._$AH.handleEvent(t)}}class Lt{constructor(t,e,i){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=i}get _$AU(){return this._$AM._$AU}_$AI(t){k(this,t)}}const X=P.litHtmlPolyfillSupport;X?.(U,N),(P.litHtmlVersions??(P.litHtmlVersions=[])).push("3.3.1");const Tt=(n,t,e)=>{const i=e?.renderBefore??t;let s=i._$litPart$;if(s===void 0){const o=e?.renderBefore??null;i._$litPart$=s=new N(t.insertBefore(L(),o),o,void 0,e??{})}return s._$AI(n),s};/** 16* @license 17* Copyright 2017 Google LLC 18* SPDX-License-Identifier: BSD-3-Clause 19*/const C=globalThis;let H=class extends E{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e;const t=super.createRenderRoot();return(e=this.renderOptions).renderBefore??(e.renderBefore=t.firstChild),t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=Tt(e,this.renderRoot,this.renderOptions)}connectedCallback(){var t;super.connectedCallback(),(t=this._$Do)==null||t.setConnected(!0)}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this._$Do)==null||t.setConnected(!1)}render(){return A}};H._$litElement$=!0,H.finalized=!0,(ut=C.litElementHydrateSupport)==null||ut.call(C,{LitElement:H});const V=C.litElementPolyfillSupport;V?.({LitElement:H}),(C.litElementVersions??(C.litElementVersions=[])).push("4.2.1");/** 20* @license 21* Copyright 2017 Google LLC 22* SPDX-License-Identifier: BSD-3-Clause 23*/const Mt={CHILD:2},Ut=n=>(...t)=>({_$litDirective$:n,values:t});class Nt{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}/** 24* @license 25* Copyright 2017 Google LLC 26* SPDX-License-Identifier: BSD-3-Clause 27*/class K extends Nt{constructor(t){if(super(t),this.it=u,t.type!==Mt.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(t){if(t===u||t==null)return this._t=void 0,this.it=t;if(t===A)return t;if(typeof t!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(t===this.it)return this._t;this.it=t;const e=[t];return e.raw=e,this._t={_$litType$:this.constructor.resultType,strings:e,values:[]}}}K.directiveName="unsafeHTML",K.resultType=1;const ct=Ut(K),g=class extends H{constructor(){super(),this.images=[],this.imagesMobile=[],this.links=[],this.creativeNames=[],this.speed=5e3,this.height="400px",this.showArrows=!0,this.showButtons=!0,this.showPlayPause=!0,this.autoplay=!0,this.currentIndex=0,this.isPlaying=!0,this.hideSlot=!1,this.isMobile=this._checkIsMobile(),this.intervalId=null,this._resizeHandler=this._handleResize.bind(this),this.DlInfo={},this.viewedSlides=new Set,this.isInitialLoad=!0,this._isTransitioning=!1,this._touchStartX=0,this._touchEndX=0,this._touchStartTime=0,this._isSwiping=!1,this.slottedSlides=[],this.useSlottedSlides=!1,this.useSlottedSlidesAttr=!1,this._slottedSlidesCollected=!1,this._isWrappingBackward=!1}createRenderRoot(){return this}connectedCallback(){super.connectedCallback(),this.addEventListener("keydown",this._handleKeydown),this.addEventListener("touchstart",this._handleTouchStart.bind(this),!1),this.addEventListener("touchend",this._handleTouchEnd.bind(this),!1),window.addEventListener("resize",this._resizeHandler),this.viewedSlides.add(0),requestAnimationFrame(()=>{var t;this._collectSlottedSlides(),this.useSlottedSlides?(this.hideSlot=!0,this._setAspectRatioFromSlottedFirstImage()):((t=this.images)==null?void 0:t.length)>0&&(this.hideSlot=!0,this._setAspectRatioFromFirstImage()),this.autoplay&&this.isPlaying&&this._getSlidesCount()>1&&this._startAutoplay()})}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("keydown",this._handleKeydown),this.removeEventListener("touchstart",this._handleTouchStart.bind(this)),this.removeEventListener("touchend",this._handleTouchEnd.bind(this)),window.removeEventListener("resize",this._resizeHandler),this._stopAutoplay()}updated(t){var e,i,s,o,r;(t.has("speed")||t.has("isPlaying"))&&(this.isPlaying?this._startAutoplay():this._stopAutoplay()),t.has("currentIndex")&&this._updateSlideTransform(),(t.has("images")||t.has("useSlottedSlidesAttr"))&&(this._collectSlottedSlides(),this.useSlottedSlides?(this.hideSlot=!0,this._setAspectRatioFromSlottedFirstImage()):((e=this.images)==null?void 0:e.length)>0&&(this.hideSlot=!0,this._setAspectRatioFromFirstImage()),this.viewedSlides.clear(),this.isInitialLoad=!0,this.autoplay&&this.isPlaying&&this._getSlidesCount()>1&&this._startAutoplay()),t.has("imagesMobile")&&((i=this.imagesMobile)==null?void 0:i.length)>0&&((s=this.images)==null?void 0:s.length)>0&&this.imagesMobile.length!==this.images.length&&console.warn(`SlideshowComponent: Mobile images array length (${this.imagesMobile.length}) does not match images array length (${this.images.length}). Some slides may not have mobile images.`),t.has("links")&&((o=this.links)==null?void 0:o.length)>0&&((r=this.images)==null?void 0:r.length)>0&&this.links.length!==this.images.length&&console.warn(`SlideshowComponent: Links array length (${this.links.length}) does not match images array length (${this.images.length}). Some slides may not have links.`),t.has("height")&&this.style.setProperty("--slideshow-height",this.height)}_getSlidesCount(){return this.useSlottedSlides?this.slottedSlides.length:this.images.length}_getActualSlides(){return this.useSlottedSlides?this.slottedSlides:this.images}_getActualCurrentIndex(){const t=this._getSlidesCount();return t?this.currentIndex%t:0}_collectSlottedSlides(){if(this._slottedSlidesCollected&&this.slottedSlides.length){this.useSlottedSlides=this.useSlottedSlidesAttr&&this.slottedSlides.length>0;return}const e=Array.from(this.children||[]).filter(i=>i.classList&&i.classList.contains("slideshow-slot-slide"));if(!e.length){this.slottedSlides=[],this.useSlottedSlides=!1;return}this.slottedSlides=e.map(i=>i.cloneNode(!0)),e.forEach(i=>
27i.remove()),this._slottedSlidesCollected=!0,this.useSlottedSlides=this.useSlottedSlidesAttr&&this.slottedSlides.length>0,this.requestUpdate()}_setAspectRatioFromSlottedFirstImage(){if(!this.slottedSlides.length)return;const t=this.slottedSlides[0].querySelector("img");if(!t){this.style.setProperty("--slideshow-aspect-ratio","16 / 9");return}const e=()=>{if(t.naturalWidth&&t.naturalHeight){const i=t.naturalWidth/t.naturalHeight;this.style.setProperty("--slideshow-aspect-ratio",i)}else this.style.setProperty("--slideshow-aspect-ratio","16 / 9")};t.complete?e():(t.addEventListener("load",e,{once:!0}),t.addEventListener("error",()=>{this.style.setProperty("--slideshow-aspect-ratio","16 / 9")},{once:!0}))}_checkIsMobile(){return window.innerWidth<=768}_handleResize(){const t=this._checkIsMobile();t!==this.isMobile&&(this.isMobile=t)}_getImageUrl(t,e){var i;if(this.isMobile&&((i=this.imagesMobile)==null?void 0:i.length)>0){const s=this.imagesMobile[e];if(s!=null&&s!=="null"&&s!=="")return typeof s=="string"?s:s?.url||""}return typeof t=="string"?t:t?.url||""}_getSlideLink(t,e){if(this.links&&this.links[e]!==void 0){const i=this.links[e];return i===null||i==="null"||i===""?null:i}if(typeof t=="object"&&t!=null&&t.link){const i=t.link;return i===null||i==="null"||i===""?null:i}return null}_isSlideClickable(t,e){return this._getSlideLink(t,e)!==null}_setAspectRatioFromFirstImage(){if(!this.images||this.images.length===0)return;const t=this._getImageUrl(this.images[0],0),e=new Image;e.onload=()=>{const i=e.width/e.height;this.style.setProperty("--slideshow-aspect-ratio",i)},e.onerror=()=>{this.style.setProperty("--slideshow-aspect-ratio","16 / 9")},e.src=t}_updateSlideTransform(){var o;if(this._isTransitioning)return;const t=(o=this.renderRoot)==null?void 0:o.querySelector(".slides");if(!t)return;const e=this._getSlidesCount();if(!e)return;const i=-this.currentIndex*100;if(t.style.transform=`translateX(${i}%)`,this.currentIndex===e&&!this._isWrappingBackward){this._isTransitioning=!0;const r=()=>{var l;const a=(l=this.renderRoot)==null?void 0:l.querySelector(".slides");if(!a){this._isTransitioning=!1;return}a.removeEventListener("transitionend",r),a.classList.add("no-transition"),a.offsetHeight,a.style.transform="translateX(0%)",a.offsetHeight,a.classList.remove("no-transition"),this.currentIndex=0,this._isTransitioning=!1};t.addEventListener("transitionend",r,{once:!0}),setTimeout(()=>{this._isTransitioning&&r()},600)}const s=this.currentIndex%e;this._pushViewPromotion(s)}_pushViewPromotion(t){var e;if(this.isInitialLoad&&t===0){this.isInitialLoad=!1,this.viewedSlides.add(0);return}if(!this.viewedSlides.has(t)){const s=this._getActualSlides()[t];let o="",r="";if(this.useSlottedSlides){const a=s?.querySelector("img");o=a?.getAttribute("src")||"",r=((e=s?.dataset)==null?void 0:e.creativeName)||""}else o=this._getImageUrl(this.images[t],t),r=this.creativeNames[t];this.DlInfo.promotionCreativeName=r,this.DlInfo.promotionId=o,window.dataLayer&&window.dataLayer.push({event:"view_promotion",promotions:this.DlInfo,_clear:!0}),this.viewedSlides.add(t)}}_startAutoplay(){this._stopAutoplay(),this._getSlidesCount()>1&&this.speed>0&&(this.intervalId=setInterval(()=>{this._nextSlide()},this.speed))}_stopAutoplay(){this.intervalId&&(clearInterval(this.intervalId),this.intervalId=null)}_nextSlide(t){t?.stopImmediatePropagation();const e=this._getSlidesCount();e&&(this.currentIndex===e-1?this.currentIndex=e:this.currentIndex=this.currentIndex+1)}_prevSlide(t){var s;t?.stopImmediatePropagation();const e=(s=this.renderRoot)==null?void 0:s.querySelector(".slides"),i=this._getSlidesCount();!i||!e||(this.currentIndex===0?(this._isWrappingBackward=!0,e.classList.add("no-transition"),e.style.transform=`translateX(-${i*100}%)`,requestAnimationFrame(()=>{requestAnimationFrame(()=>{e.classList.remove("no-transition"),this.currentIndex=i-1,this._isWrappingBackward=!1})})):this.currentIndex=this.currentIndex-1)}_goToSlide(t){this.currentIndex=t}_togglePlayPause(t){t?.stopImmediatePropagation(),this.isPlaying=!this.isPlaying,this.dispatchEvent(new CustomEvent("slideshow-play-pause",{detail:{isPlaying:this.isPlaying}}))}
27_handleSlideClick(t,e,i){console.log("handleSlideClick",t,e,i),t.stopImmediatePropagation();const s=this._getSlideLink(e,i);if(s){t.preventDefault();const o=this._getImageUrl(e,i);this.DlInfo.promotionId=o,this.DlInfo.promotionCreativeName=this.creativeNames[i],window.dataLayer&&window.dataLayer.push({event:"select_promotion",promotions:this.DlInfo,_clear:!0}),window.location.href=s}}_handleKeydown(t){if(this.matches(":focus-within"))switch(t.key){case"ArrowLeft":t.preventDefault(),this._prevSlide();break;case"ArrowRight":t.preventDefault(),this._nextSlide();break;case" ":t.preventDefault(),this._togglePlayPause();break;case"Home":t.preventDefault(),this._goToSlide(0);break;case"End":t.preventDefault(),this._goToSlide(this._getSlidesCount()-1);break;case"Escape":t.preventDefault(),this.blur();break;case"Enter":const e=this._getActualSlides();if(e[this.currentIndex]&&!this.useSlottedSlides){const i=e[this.currentIndex];this._isSlideClickable(i,this.currentIndex)&&(t.preventDefault(),this._handleSlideClick(t,i,this.currentIndex))}break}}_handleTouchStart(t){this._touchStartX=t.changedTouches[0].screenX,this._touchStartTime=Date.now(),this._isSwiping=!0}_handleTouchEnd(t){if(!this._isSwiping)return;this._touchEndX=t.changedTouches[0].screenX;const e=Date.now()-this._touchStartTime,i=this._touchStartX-this._touchEndX;Math.abs(i)>50&&e<500&&(i>0?this._nextSlide(t):this._prevSlide(t)),this._isSwiping=!1}_onSlideChange(){const t=this._getSlidesCount();if(!t)return;const e=this.currentIndex%t;this._pushViewPromotion(e)}_renderLightDomStyles(){return d` 28 <style> 29 :host { 30 display: block; 31 position: relative; 32 max-width: 100%; 33 background: #000; 34 overflow: hidden; 35 --slideshow-icon-color: #0d0d0d; 36 } 37 38 .slideshow-container { 39 position: relative; 40 width: 100%; 41 aspect-ratio: var(--slideshow-aspect-ratio, 16 / 9); 42 overflow: hidden; 43 z-index: 1; 44 } 45 46 .initial-slot { 47 position: absolute; 48 top: 0; 49 left: 0; 50 width: 100%; 51 height: 100%; 52 z-index: 1; 53 } 54 55 .initial-slot.hidden { 56 display: none; 57 } 58 59 .initial-slot ::slotted(img) { 60 width: 100%; 61 height: 100%; 62 object-fit: cover; 63 display: block; 64 } 65 66 .slides { 67 display: flex; 68 width: 100%; 69 height: 100%; 70 transition: transform 0.5s ease-in-out; 71 position: relative; 72 z-index: 2; 73 } 74 75 .slides.no-transition { 76 transition: none; 77 } 78 79 .slide { 80 min-width: 100%; 81 height: 100%; 82 position: relative; 83 } 84 85 .slide img { 86 width: 100%; 87 height: 100%; 88 object-fit: cover; 89 display: block; 90 } 91 92 .slide img:focus { 93 outline: 2px solid #007bff; 94 outline-offset: -2px; 95 } 96 97 .slide-link { 98 display: block; 99 width: 100%; 100 height: 100%; 101 text-decoration: none; 102 cursor: pointer; 103 } 104 105 .slide-link:hover img { 106 opacity: 0.9; 107 transition: opacity 0.3s ease; 108 } 109 110 .slide-link:focus { 111 outline: 2px solid #007bff; 112 outline-offset: -2px; 113 } 114 115 .slide-link:focus img { 116 outline: none; 117 } 118 119 .navigation { 120 position: absolute; 121 top: 50%; 122 transform: translateY(-50%); 123 background: transparent; 124 border: none; 125 width: 25px; 126 height: 25px; 127 cursor: pointer; 128 display: flex; 129 align-items: center; 130 justify-content: center; 131 transition: opacity 0.3s; 132 z-index: 10; 133 padding: 0; 134 } 135 136 .navigation svg { 137 width: 25px; 138 height: 25px; 139 fill: var(--slideshow-icon-color, #0d0d0d); 140 transition: opacity 0.3s; 141 color: var(--slideshow-icon-color, #0d0d0d); 142 } 143 144 .navigation:hover svg { 145 opacity: 0.7; 146 } 147 148 .navigation:focus { 149 outline: 2px solid #007bff; 150 outline-offset: 2px; 151 } 152 153 .navigation:disabled { 154 opacity: 0.3;
155 cursor: not-allowed; 156 } 157 158 .nav-prev { 159 left: 10px; 160 } 161 162 .nav-next { 163 right: 10px; 164 } 165 166 .controls { 167 position: absolute; 168 bottom: 10px; 169 left: 50%; 170 transform: translateX(-50%); 171 display: flex; 172 gap: 10px; 173 align-items: center; 174 z-index: 10; 175 } 176 177 .dot-buttons { 178 display: flex; 179 gap: 8px; 180 } 181 182 .dot { 183 width: 9px; 184 height: 9px; 185 border-radius: 50%; 186 border: solid 1px #fff; 187 background-color: #f1f1f1; 188 cursor: pointer; 189 transition: background-color 0.3s; 190 opacity: 1; 191 padding: 0; 192 } 193 194 .dot:hover, 195 .dot:focus { 196 background-color: #ddd; 197 outline: 2px solid #007bff; 198 outline-offset: 2px; 199 } 200 201 .dot.active { 202 background-color: var(--slideshow-icon-color, #0d0d0d); 203 } 204 205 .play-pause { 206 position: absolute; 207 bottom: 10px; 208 left: 10px; 209 background: transparent; 210 border: none; 211 color: var(--slideshow-icon-color, #0d0d0d); 212 width: 40px; 213 height: 40px; 214 border-radius: 6px; 215 cursor: pointer; 216 display: flex; 217 align-items: center; 218 justify-content: center; 219 font-size: 16px; 220 transition: background-color 0.3s; 221 font-family: Arial, sans-serif; 222 font-weight: bold; 223 z-index: 10; 224 } 225 226 .play-pause:hover { 227 background: var(--slideshow-icon-color, #0d0d0d); 228 filter: invert(1); 229 box-shadow: 0 2px 4px rgba(0,0,0,0.1); 230 } 231 232 .play-pause:hover svg { 233 box-shadow: 0 2px 4px rgba(0,0,0,0.1); 234 filter: invert(1); 235 } 236 237 .play-pause:focus { 238 outline: 2px solid #007bff; 239 outline-offset: 2px; 240 } 241 242 .sr-only { 243 position: absolute; 244 width: 1px; 245 height: 1px; 246 padding: 0; 247 margin: -1px; 248 overflow: hidden; 249 clip: rect(0, 0, 0, 0); 250 white-space: nowrap; 251 border: 0; 252 } 253 254 .arrow-icon { 255 display: inline-flex; 256 align-items: center; 257 justify-content: center; 258 } 259 260 .arrow-icon.rotate-90 { 261 transform: rotate(90deg); 262 } 263 264 .arrow-icon.rotate-270 { 265 transform: rotate(270deg); 266 } 267 268 @media (max-width: 768px) { 269 .slideshow-container { 270 height: 100%; 271 } 272 273 .play-pause { 274 bottom: 5px; 275 left: 5px; 276 width: 30px; 277 height: 30px; 278 279 } 280 281 .navigation { 282 width: 30px; 283 height: 30px; 284 border-radius: 50%; 285 font-size: 16px; 286 } 287 288 .nav-prev { 289 left: 5px; 290 } 291 292 .nav-next { 293 right: 5px; 294 } 295 } 296 </style> 297 `}render(){const t=this._getSlidesCount();return(!this.images||this.images.length===0)&&!this.useSlottedSlides&&!this.useSlottedSlidesAttr?d` 298 <div class="slideshow-container"> 299 <div class="slide"> 300 <div style="display: flex; align-items: center; justify-content: center; height: 100%; color: #666; font-size: 18px;"> 301 No images to display 302 </div> 303 </div> 304 </div> 305 `:d` 306 ${this._renderLightDomStyles()} 307 <div 308 class="slideshow-container" 309 role="region" 310 aria-label="Image slideshow" 311 aria-live="polite" 312 tabindex="0" 313 > 314 ${this.useSlottedSlides?"":d` 315 <div class="initial-slot ${this.hideSlot?"hidden":""}"> 316 <slot></slot> 317 </div> 318 `} 319 320 <div class="slides"> 321 ${this.useSlottedSlides?d` 322 ${this.slottedSlides.map((e,i)=>d` 323 <div 324 class="slide" 325 role="group" 326 aria-label="Slide ${i+1} of ${t}" 327 > 328 ${ct(e.outerHTML)} 329 </div> 330 `)} 331 332 ${this.slottedSlides.length>0?d` 333 <div 334 class="slide" 335 role="group" 336 aria-label="Slide 1 of ${t} (clone)" 337 aria-hidden="true" 338 > 339 ${ct(this.slottedSlides[0].outerHTML)} 340 </div> 341 `:""} 342 `:d` 343 ${this.images.map((e,i)=>{const s=this._getImageUrl(e,i),o=this._getSlideLink(e,i),r=this._isSlideClickable(e,i),a=d` 344 <img 345 src="${s}" 346 alt="Slide ${i+1}" 347 tabindex="${i===this.currentIndex?"0":"-1"}" 348 @load="${()=>this._onSlideChange()}" 349 /> 350 `;return d` 351 <div 352 class="slide" 353 role="img" 354 aria-label="Slide ${i+1} of ${this.images.length}${r?" (clickable)":""}" 355 > 356 ${r?d` 357 <a 358 class="slide-link" 359 href="${o}" 360 @click="${l=>{this._handleSlideClick(l,e,i)}}" 361 aria-label="View slide ${i+1} details" 362 > 363 ${a} 364 </a> 365 `:d` 366 <div 367 class="slide-link" 368 @click="${l=>{this._handleSlideClick(l,e,i)}}" 369 style="width: 100%; height: 100%; cursor: default;" 370 > 371 ${a} 372 </div> 373 `} 374 </div> 375 `})} 376 377 ${this.images.length>0?(()=>{const e=this.images[0],i=this._getImageUrl(e,0),s=this._getSlideLink(e,0),o=this._isSlideClickable(e,0),r=d` 378 <img 379 src="${i}" 380 alt="Slide 1 (clone)" 381 tabindex="-1" 382 /> 383 `;return d` 384 <div 385 class="slide" 386 role="img" 387 aria-label="Slide 1 of ${this.images.length} (clone)" 388 aria-hidden="true" 389 > 390 ${o?d` 391 <a 392 class="slide-link" 393 href="${s}"
394 tabindex="-1" 395 @click="${a=>{this._handleSlideClick(a,e,0)}}" 396 aria-label="View slide 1 details" 397 > 398 ${r} 399 </a> 400 `:r} 401 </div> 402 `})():""} 403 `} 404 </div> 405 406 ${this.showArrows?d` 407 <button 408 class="navigation nav-prev" 409 @click="${this._prevSlide}" 410 aria-label="Previous slide" 411 ?disabled="${t<=1}" 412 > 413 <span class="arrow-icon rotate-270"> 414 <svg width="25px" height="25px" viewBox="0 -4.5 20 20" xmlns="http://www.w3.org/2000/svg" fill="currentColor"> 415 <path d="M84,6532.61035 L85.4053672,6534 L94.0131154,6525.73862 L94.9311945,6526.61986 L94.9261501,6526.61502 L102.573446,6533.95545 L104,6532.58614 C101.8864,6530.55736 95.9854722,6524.89321 94.0131154,6523 C92.5472155,6524.40611 93.9757869,6523.03486 84,6532.61035" transform="translate(-84 -6523)"></path> 416 </svg> 417 </span> 418 </button> 419 <button 420 class="navigation nav-next" 421 @click="${this._nextSlide}" 422 aria-label="Next slide" 423 ?disabled="${t<=1}" 424 > 425 <span class="arrow-icon rotate-90"> 426 <svg width="25px" height="25px" viewBox="0 -4.5 20 20" xmlns="http://www.w3.org/2000/svg" fill="currentColor"> 427 <path d="M84,6532.61035 L85.4053672,6534 L94.0131154,6525.73862 L94.9311945,6526.61986 L94.9261501,6526.61502 L102.573446,6533.95545 L104,6532.58614 C101.8864,6530.55736 95.9854722,6524.89321 94.0131154,6523 C92.5472155,6524.40611 93.9757869,6523.03486 84,6532.61035" transform="translate(-84 -6523)"></path> 428 </svg> 429 </span> 430 </button> 431 `:""} 432 433 ${this.showButtons?d` 434 <div class="controls"> 435 <div class="dot-buttons" role="tablist" aria-label="Slide navigation"> 436 ${Array.from({length:t}).map((e,i)=>{const s=this._getActualCurrentIndex();return d` 437 <button 438 class="dot ${i===s?"active":""}" 439 @click="${()=>this._goToSlide(i)}" 440 role="tab" 441 aria-selected="${i===s}" 442 aria-label="Go to slide ${i+1}" 443 ></button> 444 `})} 445 </div> 446 </div> 447 `:""} 448 449 ${this.showPlayPause?d` 450 <button 451 class="play-pause" 452 @click="${this._togglePlayPause}" 453 aria-label="${this.isPlaying?"Pause slideshow":"Play slideshow"}" 454 > 455 ${this.isPlaying?d` 456 <svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor" xmlns="http://www.w3.org/2000/svg"> 457 <rect x="6" y="4" width="3" height="16" rx="1"/> 458 <rect x="15" y="4" width="3" height="16" rx="1"/> 459 </svg> 460 `:d` 461 <svg width="16" height="16" viewBox="0 0 24 24" fill="currentColor" xmlns="http://www.w3.org/2000/svg"> 462 <path d="M8 5v14l11-7z"/> 463 </svg> 464 `} 465 </button> 466 `:""} 467 468 <div class="sr-only" aria-live="assertive"> 469 Currently showing slide ${this._getActualCurrentIndex()+1} of ${t} 470 </div> 471 </div> 472 `}};D(g,"booleanConverter",{fromAttribute:t=>t==null?!1:t===""?!0:t.toLowerCase()==="false"?!1:t.toLowerCase()==="true"?!0:!!t,toAttribute:t=>t?"":null}),D(g,"arrayConverter",{fromAttribute:t=>{if(!t)return[];try{const e=t.replace(/'/g,'"');return JSON.parse(e)}catch(e){return console.warn("Failed to parse array attribute:",e,"Value:",t),[]}},toAttribute:t=>JSON.stringify(t)}),D(g,"properties",{images:{type:Array,attribute:"slideshow-images",converter:g.arrayConverter},imagesMobile:{type:Array,attribute:"slideshow-images-mobile",converter:g.arrayConverter},links:{type:Array,attribute:"slideshow-links",converter:g.arrayConverter},creativeNames:{type:Array,attribute:"slideshow-creative-names",converter:g.arrayConverter}
472,useSlottedSlidesAttr:{type:Boolean,attribute:"use-slotted-slides",converter:g.booleanConverter},speed:{type:Number},height:{type:String},showArrows:{type:Boolean,attribute:"show-arrows",converter:g.booleanConverter},showButtons:{type:Boolean,attribute:"show-buttons",converter:g.booleanConverter},showPlayPause:{type:Boolean,attribute:"show-play-pause",converter:g.booleanConverter},autoplay:{type:Boolean,converter:g.booleanConverter},currentIndex:{type:Number,state:!0},isPlaying:{type:Boolean,state:!0},hideSlot:{type:Boolean,state:!0},isMobile:{type:Boolean,state:!0},DlInfo:{type:Object},slottedSlides:{type:Array,state:!0},useSlottedSlides:{type:Boolean,state:!0}});let B=g;return customElements.define("slideshow-component-v2",B),_.SlideshowComponentV2=B,Object.defineProperty(_,Symbol.toStringTag,{value:"Module"}),_})({}); 473//# sourceMappingURL=/cdn/shop/t/1305/assets/slideshow.bundle.js.map?v=17653361503216470581774858268
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.