@vtex/ads-stories 0.5.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/README.md +29 -297
  3. package/dist/cdn/vtex-ads-stories.js +438 -113
  4. package/dist/cdn/vtex-ads-stories.js.map +1 -1
  5. package/dist/cjs/index.cjs +909 -186
  6. package/dist/cjs/index.cjs.map +1 -1
  7. package/dist/cjs/index.d.cts +42 -196
  8. package/dist/cjs/react.cjs.map +1 -1
  9. package/dist/cjs/react.d.cts +7 -1
  10. package/dist/cjs/story-DAiAN9v-.d.cts +260 -0
  11. package/dist/esm/index.d.ts +42 -196
  12. package/dist/esm/index.js +933 -209
  13. package/dist/esm/index.js.map +1 -1
  14. package/dist/esm/react.d.ts +7 -1
  15. package/dist/esm/story-DAiAN9v-.d.ts +260 -0
  16. package/package.json +1 -1
  17. package/src/commerce-events.ts +93 -0
  18. package/src/components/card/card.ts +16 -3
  19. package/src/components/carousel/carousel-skeleton.ts +113 -0
  20. package/src/components/carousel/carousel.ts +53 -8
  21. package/src/components/carousel/index.ts +7 -0
  22. package/src/components/events/events-controller.ts +23 -13
  23. package/src/components/icons/assets/minus.svg +1 -0
  24. package/src/components/icons/assets/plus.svg +1 -0
  25. package/src/components/icons/assets/trash.svg +1 -0
  26. package/src/components/icons/assets/warning-circle-fill.svg +1 -0
  27. package/src/components/icons/index.ts +8 -0
  28. package/src/components/media/index.ts +7 -1
  29. package/src/components/media/media.styles.ts +113 -0
  30. package/src/components/media/media.ts +108 -11
  31. package/src/components/media/video-controller.ts +80 -6
  32. package/src/components/player/player.ts +42 -17
  33. package/src/components/product/cta.ts +3 -3
  34. package/src/components/product/index.ts +2 -0
  35. package/src/components/product/product.styles.ts +63 -6
  36. package/src/components/product/product.ts +130 -29
  37. package/src/index.ts +8 -0
  38. package/src/locales/en.ts +13 -3
  39. package/src/locales/es.ts +13 -3
  40. package/src/locales/pt.ts +13 -3
  41. package/src/locales/types.ts +22 -2
  42. package/src/react.ts +6 -0
  43. package/src/story/story.ts +188 -16
  44. package/src/utils/hydrate-products.ts +30 -6
  45. package/src/utils/media-ready.ts +58 -0
  46. package/src/utils/safe-url.ts +36 -0
  47. package/src/utils/send-event.ts +1 -1
  48. package/src/utils/http-url.ts +0 -12
@@ -1,74 +1,246 @@
1
- "use strict";var VtexAdsStories=(()=>{var Oe=Object.defineProperty;var Ir=Object.getOwnPropertyDescriptor;var Nr=Object.getOwnPropertyNames;var Hr=Object.prototype.hasOwnProperty;var Vr=(o,e)=>{for(var t in e)Oe(o,t,{get:e[t],enumerable:!0})},Dr=(o,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Nr(e))!Hr.call(o,i)&&i!==t&&Oe(o,i,{get:()=>e[i],enumerable:!(r=Ir(e,i))||r.enumerable});return o};var Ur=o=>Dr(Oe({},"__esModule",{value:!0}),o);var li={};Vr(li,{TAG_NAME:()=>$,VtexAdsStoryCarouselElement:()=>R,defineVtexAdsStoryCarousel:()=>ce});var pe=globalThis,ue=pe.ShadowRoot&&(pe.ShadyCSS===void 0||pe.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,Me=Symbol(),lt=new WeakMap,Z=class{constructor(e,t,r){if(this._$cssResult$=!0,r!==Me)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(ue&&e===void 0){let r=t!==void 0&&t.length===1;r&&(e=lt.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&lt.set(t,e))}return e}toString(){return this.cssText}},ct=o=>new Z(typeof o=="string"?o:o+"",void 0,Me),g=(o,...e)=>{let t=o.length===1?o[0]:e.reduce((r,i,s)=>r+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+o[s+1],o[0]);return new Z(t,o,Me)},pt=(o,e)=>{if(ue)o.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of e){let r=document.createElement("style"),i=pe.litNonce;i!==void 0&&r.setAttribute("nonce",i),r.textContent=t.cssText,o.appendChild(r)}},Re=ue?o=>o:o=>o instanceof CSSStyleSheet?(e=>{let t="";for(let r of e.cssRules)t+=r.cssText;return ct(t)})(o):o;var{is:Br,defineProperty:Fr,getOwnPropertyDescriptor:zr,getOwnPropertyNames:qr,getOwnPropertySymbols:jr,getPrototypeOf:Wr}=Object,T=globalThis,ut=T.trustedTypes,Gr=ut?ut.emptyScript:"",Le=T.reactiveElementPolyfillSupport,X=(o,e)=>o,Ie={toAttribute(o,e){switch(e){case Boolean:o=o?Gr:null;break;case Object:case Array:o=o==null?o:JSON.stringify(o)}return o},fromAttribute(o,e){let t=o;switch(e){case Boolean:t=o!==null;break;case Number:t=o===null?null:Number(o);break;case Object:case Array:try{t=JSON.parse(o)}catch(r){t=null}}return t}},vt=(o,e)=>!Br(o,e),ht={attribute:!0,type:String,converter:Ie,reflect:!1,useDefault:!1,hasChanged:vt},ft,mt;(ft=Symbol.metadata)!=null||(Symbol.metadata=Symbol("metadata")),(mt=T.litPropertyMetadata)!=null||(T.litPropertyMetadata=new WeakMap);var _=class extends HTMLElement{static addInitializer(e){var t;this._$Ei(),((t=this.l)!=null?t:this.l=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=ht){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){let r=Symbol(),i=this.getPropertyDescriptor(e,r,t);i!==void 0&&Fr(this.prototype,e,i)}}static getPropertyDescriptor(e,t,r){var n;let{get:i,set:s}=(n=zr(this.prototype,e))!=null?n:{get(){return this[t]},set(a){this[t]=a}};return{get:i,set(a){let d=i==null?void 0:i.call(this);s==null||s.call(this,a),this.requestUpdate(e,d,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){var t;return(t=this.elementProperties.get(e))!=null?t:ht}static _$Ei(){if(this.hasOwnProperty(X("elementProperties")))return;let e=Wr(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(X("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(X("properties"))){let t=this.properties,r=[...qr(t),...jr(t)];for(let i of r)this.createProperty(i,t[i])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[r,i]of t)this.elementProperties.set(r,i)}this._$Eh=new Map;for(let[t,r]of this.elementProperties){let i=this._$Eu(t,r);i!==void 0&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let r=new Set(e.flat(1/0).reverse());for(let i of r)t.unshift(Re(i))}else e!==void 0&&t.push(Re(e));return t}static _$Eu(e,t){let r=t.attribute;return r===!1?void 0:typeof r=="string"?r:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var e;this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),(e=this.constructor.l)==null||e.forEach(t=>t(this))}addController(e){var t,r;((t=this._$EO)!=null?t:this._$EO=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&((r=e.hostConnected)==null||r.call(e))}removeController(e){var t;(t=this._$EO)==null||t.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let r of t.keys())this.hasOwnProperty(r)&&(e.set(r,this[r]),delete this[r]);e.size>0&&(this._$Ep=e)}createRenderRoot(){var t;let e=(t=this.shadowRoot)!=null?t:this.attachShadow(this.constructor.shadowRootOptions);return pt(e,this.constructor.elementStyles),e}connectedCallback(){var e,t;(e=this.renderRoot)!=null||(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$EO)==null||t.forEach(r=>{var i;return(i=r.hostConnected)==null?void 0:i.call(r)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach(t=>{var r;return(r=t.hostDisconnected)==null?void 0:r.call(t)})}attributeChangedCallback(e,t,r){this._$AK(e,r)}_$ET(e,t){var s;let r=this.constructor.elementProperties.get(e),i=this.constructor._$Eu(e,r);if(i!==void 0&&r.reflect===!0){let n=(((s=r.converter)==null?void 0:s.toAttribute)!==void 0?r.converter:Ie).toAttribute(t,r.type);this._$Em=e,n==null?this.removeAttribute(i):this.setAttribute(i,n),this._$Em=null}}_$AK(e,t){var s,n,a;let r=this.constructor,i=r._$Eh.get(e);if(i!==void 0&&this._$Em!==i){let d=r.getPropertyOptions(i),l=typeof d.converter=="function"?{fromAttribute:d.converter}:((s=d.converter)==null?void 0:s.fromAttribute)!==void 0?d.converter:Ie;this._$Em=i;let p=l.fromAttribute(t,d.type);this[i]=(a=p!=null?p:(n=this._$Ej)==null?void 0:n.get(i))!=null?a:p,this._$Em=null}}requestUpdate(e,t,r,i=!1,s){var n,a;if(e!==void 0){let d=this.constructor;if(i===!1&&(s=this[e]),r!=null||(r=d.getPropertyOptions(e)),!(((n=r.hasChanged)!=null?n:vt)(s,t)||r.useDefault&&r.reflect&&s===((a=this._$Ej)==null?void 0:a.get(e))&&!this.hasAttribute(d._$Eu(e,r))))return;this.C(e,t,r)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,t,{useDefault:r,reflect:i,wrapped:s},n){var a,d,l;r&&!((a=this._$Ej)!=null?a:this._$Ej=new Map).has(e)&&(this._$Ej.set(e,(d=n!=null?n:t)!=null?d:this[e]),s!==!0||n!==void 0)||(this._$AL.has(e)||(this.hasUpdated||r||(t=void 0),this._$AL.set(e,t)),i===!0&&this._$Em!==e&&((l=this._$Eq)!=null?l:this._$Eq=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var r,i;if(!this.isUpdatePending)return;if(!this.hasUpdated){if((r=this.renderRoot)!=null||(this.renderRoot=this.createRenderRoot()),this._$Ep){for(let[n,a]of this._$Ep)this[n]=a;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[n,a]of s){let{wrapped:d}=a,l=this[n];d!==!0||this._$AL.has(n)||l===void 0||this.C(n,void 0,a,l)}}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),(i=this._$EO)==null||i.forEach(s=>{var n;return(n=s.hostUpdate)==null?void 0:n.call(s)}),this.update(t)):this._$EM()}catch(s){throw e=!1,this._$EM(),s}e&&this._$AE(t)}willUpdate(e){}_$AE(e){var t;(t=this._$EO)==null||t.forEach(r=>{var i;return(i=r.hostUpdated)==null?void 0:i.call(r)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&(this._$Eq=this._$Eq.forEach(t=>this._$ET(t,this[t]))),this._$EM()}updated(e){}firstUpdated(e){}},yt;_.elementStyles=[],_.shadowRootOptions={mode:"open"},_[X("elementProperties")]=new Map,_[X("finalized")]=new Map,Le==null||Le({ReactiveElement:_}),((yt=T.reactiveElementVersions)!=null?yt:T.reactiveElementVersions=[]).push("2.1.2");var Q=globalThis,gt=o=>o,he=Q.trustedTypes,bt=he?he.createPolicy("lit-html",{createHTML:o=>o}):void 0,Ve="$lit$",C=`lit$${Math.random().toFixed(9).slice(2)}$`,De="?"+C,Kr=`<${De}>`,H=document,J=()=>H.createComment(""),ee=o=>o===null||typeof o!="object"&&typeof o!="function",Ue=Array.isArray,Ct=o=>Ue(o)||typeof(o==null?void 0:o[Symbol.iterator])=="function",Ne=`[
2
- \f\r]`,Y=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,xt=/-->/g,wt=/>/g,I=RegExp(`>|${Ne}(?:([^\\s"'>=/]+)(${Ne}*=${Ne}*(?:[^
3
- \f\r"'\`<>=]|("|')|))|$)`,"g"),$t=/'/g,St=/"/g,Et=/^(?:script|style|textarea|title)$/i,Be=o=>(e,...t)=>({_$litType$:o,strings:e,values:t}),m=Be(1),mi=Be(2),yi=Be(3),b=Symbol.for("lit-noChange"),f=Symbol.for("lit-nothing"),At=new WeakMap,N=H.createTreeWalker(H,129);function Pt(o,e){if(!Ue(o)||!o.hasOwnProperty("raw"))throw Error("invalid template strings array");return bt!==void 0?bt.createHTML(e):e}var Tt=(o,e)=>{let t=o.length-1,r=[],i,s=e===2?"<svg>":e===3?"<math>":"",n=Y;for(let a=0;a<t;a++){let d=o[a],l,p,c=-1,h=0;for(;h<d.length&&(n.lastIndex=h,p=n.exec(d),p!==null);)h=n.lastIndex,n===Y?p[1]==="!--"?n=xt:p[1]!==void 0?n=wt:p[2]!==void 0?(Et.test(p[2])&&(i=RegExp("</"+p[2],"g")),n=I):p[3]!==void 0&&(n=I):n===I?p[0]===">"?(n=i!=null?i:Y,c=-1):p[1]===void 0?c=-2:(c=n.lastIndex-p[2].length,l=p[1],n=p[3]===void 0?I:p[3]==='"'?St:$t):n===St||n===$t?n=I:n===xt||n===wt?n=Y:(n=I,i=void 0);let u=n===I&&o[a+1].startsWith("/>")?" ":"";s+=n===Y?d+Kr:c>=0?(r.push(l),d.slice(0,c)+Ve+d.slice(c)+C+u):d+C+(c===-2?a:u)}return[Pt(o,s+(o[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),r]},te=class o{constructor({strings:e,_$litType$:t},r){let i;this.parts=[];let s=0,n=0,a=e.length-1,d=this.parts,[l,p]=Tt(e,t);if(this.el=o.createElement(l,r),N.currentNode=this.el.content,t===2||t===3){let c=this.el.content.firstChild;c.replaceWith(...c.childNodes)}for(;(i=N.nextNode())!==null&&d.length<a;){if(i.nodeType===1){if(i.hasAttributes())for(let c of i.getAttributeNames())if(c.endsWith(Ve)){let h=p[n++],u=i.getAttribute(c).split(C),y=/([.?@])?(.*)/.exec(h);d.push({type:1,index:s,name:y[2],strings:u,ctor:y[1]==="."?me:y[1]==="?"?ye:y[1]==="@"?ve:D}),i.removeAttribute(c)}else c.startsWith(C)&&(d.push({type:6,index:s}),i.removeAttribute(c));if(Et.test(i.tagName)){let c=i.textContent.split(C),h=c.length-1;if(h>0){i.textContent=he?he.emptyScript:"";for(let u=0;u<h;u++)i.append(c[u],J()),N.nextNode(),d.push({type:2,index:++s});i.append(c[h],J())}}}else if(i.nodeType===8)if(i.data===De)d.push({type:2,index:s});else{let c=-1;for(;(c=i.data.indexOf(C,c+1))!==-1;)d.push({type:7,index:s}),c+=C.length-1}s++}}static createElement(e,t){let r=H.createElement("template");return r.innerHTML=e,r}};function V(o,e,t=o,r){var n,a,d;if(e===b)return e;let i=r!==void 0?(n=t._$Co)==null?void 0:n[r]:t._$Cl,s=ee(e)?void 0:e._$litDirective$;return(i==null?void 0:i.constructor)!==s&&((a=i==null?void 0:i._$AO)==null||a.call(i,!1),s===void 0?i=void 0:(i=new s(o),i._$AT(o,t,r)),r!==void 0?((d=t._$Co)!=null?d:t._$Co=[])[r]=i:t._$Cl=i),i!==void 0&&(e=V(o,i._$AS(o,e.values),i,r)),e}var fe=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){var l;let{el:{content:t},parts:r}=this._$AD,i=((l=e==null?void 0:e.creationScope)!=null?l:H).importNode(t,!0);N.currentNode=i;let s=N.nextNode(),n=0,a=0,d=r[0];for(;d!==void 0;){if(n===d.index){let p;d.type===2?p=new F(s,s.nextSibling,this,e):d.type===1?p=new d.ctor(s,d.name,d.strings,this,e):d.type===6&&(p=new ge(s,this,e)),this._$AV.push(p),d=r[++a]}n!==(d==null?void 0:d.index)&&(s=N.nextNode(),n++)}return N.currentNode=H,i}p(e){let t=0;for(let r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(e,r,t),t+=r.strings.length-2):r._$AI(e[t])),t++}},F=class o{get _$AU(){var e,t;return(t=(e=this._$AM)==null?void 0:e._$AU)!=null?t:this._$Cv}constructor(e,t,r,i){var s;this.type=2,this._$AH=f,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=r,this.options=i,this._$Cv=(s=i==null?void 0:i.isConnected)!=null?s:!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&(e==null?void 0:e.nodeType)===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=V(this,e,t),ee(e)?e===f||e==null||e===""?(this._$AH!==f&&this._$AR(),this._$AH=f):e!==this._$AH&&e!==b&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Ct(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==f&&ee(this._$AH)?this._$AA.nextSibling.data=e:this.T(H.createTextNode(e)),this._$AH=e}$(e){var s;let{values:t,_$litType$:r}=e,i=typeof r=="number"?this._$AC(e):(r.el===void 0&&(r.el=te.createElement(Pt(r.h,r.h[0]),this.options)),r);if(((s=this._$AH)==null?void 0:s._$AD)===i)this._$AH.p(t);else{let n=new fe(i,this),a=n.u(this.options);n.p(t),this.T(a),this._$AH=n}}_$AC(e){let t=At.get(e.strings);return t===void 0&&At.set(e.strings,t=new te(e)),t}k(e){Ue(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,r,i=0;for(let s of e)i===t.length?t.push(r=new o(this.O(J()),this.O(J()),this,this.options)):r=t[i],r._$AI(s),i++;i<t.length&&(this._$AR(r&&r._$AB.nextSibling,i),t.length=i)}_$AR(e=this._$AA.nextSibling,t){var r;for((r=this._$AP)==null?void 0:r.call(this,!1,!0,t);e!==this._$AB;){let i=gt(e).nextSibling;gt(e).remove(),e=i}}setConnected(e){var t;this._$AM===void 0&&(this._$Cv=e,(t=this._$AP)==null||t.call(this,e))}},D=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,r,i,s){this.type=1,this._$AH=f,this._$AN=void 0,this.element=e,this.name=t,this._$AM=i,this.options=s,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=f}_$AI(e,t=this,r,i){let s=this.strings,n=!1;if(s===void 0)e=V(this,e,t,0),n=!ee(e)||e!==this._$AH&&e!==b,n&&(this._$AH=e);else{let a=e,d,l;for(e=s[0],d=0;d<s.length-1;d++)l=V(this,a[r+d],t,d),l===b&&(l=this._$AH[d]),n||(n=!ee(l)||l!==this._$AH[d]),l===f?e=f:e!==f&&(e+=(l!=null?l:"")+s[d+1]),this._$AH[d]=l}n&&!i&&this.j(e)}j(e){e===f?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e!=null?e:"")}},me=class extends D{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===f?void 0:e}},ye=class extends D{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==f)}},ve=class extends D{constructor(e,t,r,i,s){super(e,t,r,i,s),this.type=5}_$AI(e,t=this){var n;if((e=(n=V(this,e,t,0))!=null?n:f)===b)return;let r=this._$AH,i=e===f&&r!==f||e.capture!==r.capture||e.once!==r.once||e.passive!==r.passive,s=e!==f&&(r===f||i);i&&this.element.removeEventListener(this.name,this,r),s&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var t,r;typeof this._$AH=="function"?this._$AH.call((r=(t=this.options)==null?void 0:t.host)!=null?r:this.element,e):this._$AH.handleEvent(e)}},ge=class{constructor(e,t,r){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(e){V(this,e)}},kt={M:Ve,P:C,A:De,C:1,L:Tt,R:fe,D:Ct,V,I:F,H:D,N:ye,U:ve,B:me,F:ge},He=Q.litHtmlPolyfillSupport,_t;He==null||He(te,F),((_t=Q.litHtmlVersions)!=null?_t:Q.litHtmlVersions=[]).push("3.3.3");var Ot=(o,e,t)=>{var s,n;let r=(s=t==null?void 0:t.renderBefore)!=null?s:e,i=r._$litPart$;if(i===void 0){let a=(n=t==null?void 0:t.renderBefore)!=null?n:null;r._$litPart$=i=new F(e.insertBefore(J(),a),a,void 0,t!=null?t:{})}return i._$AI(o),i};var U=globalThis,k=class extends _{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t,r;let e=super.createRenderRoot();return(r=(t=this.renderOptions).renderBefore)!=null||(t.renderBefore=e.firstChild),e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Ot(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)==null||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)==null||e.setConnected(!1)}render(){return b}},Mt;k._$litElement$=!0,k.finalized=!0,(Mt=U.litElementHydrateSupport)==null||Mt.call(U,{LitElement:k});var Fe=U.litElementPolyfillSupport;Fe==null||Fe({LitElement:k});var Rt;((Rt=U.litElementVersions)!=null?Rt:U.litElementVersions=[]).push("4.2.2");var{I:Zr}=kt,Lt=o=>o;var Nt=o=>o.strings===void 0,It=()=>document.createComment(""),z=(o,e,t)=>{var s;let r=o._$AA.parentNode,i=e===void 0?o._$AB:e._$AA;if(t===void 0){let n=r.insertBefore(It(),i),a=r.insertBefore(It(),i);t=new Zr(n,a,o,o.options)}else{let n=t._$AB.nextSibling,a=t._$AM,d=a!==o;if(d){let l;(s=t._$AQ)==null||s.call(t,o),t._$AM=o,t._$AP!==void 0&&(l=o._$AU)!==a._$AU&&t._$AP(l)}if(n!==i||d){let l=t._$AA;for(;l!==n;){let p=Lt(l).nextSibling;Lt(r).insertBefore(l,i),l=p}}}return t},O=(o,e,t=o)=>(o._$AI(e,t),o),Xr={},Ht=(o,e=Xr)=>o._$AH=e,Vt=o=>o._$AH,be=o=>{o._$AR(),o._$AA.remove()};var M={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},E=o=>(...e)=>({_$litDirective$:o,values:e}),S=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,r){this._$Ct=e,this._$AM=t,this._$Ci=r}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}};var re=(o,e)=>{var r;let t=o._$AN;if(t===void 0)return!1;for(let i of t)(r=i._$AO)==null||r.call(i,e,!1),re(i,e);return!0},xe=o=>{let e,t;do{if((e=o._$AM)===void 0)break;t=e._$AN,t.delete(o),o=e}while((t==null?void 0:t.size)===0)},Dt=o=>{for(let e;e=o._$AM;o=e){let t=e._$AN;if(t===void 0)e._$AN=t=new Set;else if(t.has(o))break;t.add(o),Jr(e)}};function Yr(o){this._$AN!==void 0?(xe(this),this._$AM=o,Dt(this)):this._$AM=o}function Qr(o,e=!1,t=0){let r=this._$AH,i=this._$AN;if(i!==void 0&&i.size!==0)if(e)if(Array.isArray(r))for(let s=t;s<r.length;s++)re(r[s],!1),xe(r[s]);else r!=null&&(re(r,!1),xe(r));else re(this,o)}var Jr=o=>{var e,t;o.type==M.CHILD&&((e=o._$AP)!=null||(o._$AP=Qr),(t=o._$AQ)!=null||(o._$AQ=Yr))},we=class extends S{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,t,r){super._$AT(e,t,r),Dt(this),this.isConnected=e._$AU}_$AO(e,t=!0){var r,i;e!==this.isConnected&&(this.isConnected=e,e?(r=this.reconnected)==null||r.call(this):(i=this.disconnected)==null||i.call(this)),t&&(re(this,e),xe(this))}setValue(e){if(Nt(this._$Ct))this._$Ct._$AI(e,this);else{let t=[...this._$Ct._$AH];t[this._$Ci]=e,this._$Ct._$AI(t,this,0)}}disconnected(){}reconnected(){}};var P=()=>new qe,qe=class{},ze=new WeakMap,x=E(class extends we{render(o){return f}update(o,[e]){var r;let t=e!==this.G;return t&&this.rt(void 0),(t||this.lt!==this.ct)&&(this.G=e,this.ht=(r=o.options)==null?void 0:r.host,this.rt(this.ct=o.element)),f}rt(o){var e;if(this.G!==void 0)if(this.isConnected||(o=void 0),typeof this.G=="function"){let t=(e=this.ht)!=null?e:globalThis,r=ze.get(t);r===void 0&&(r=new WeakMap,ze.set(t,r)),r.get(this.G)!==void 0&&this.G.call(this.ht,void 0),r.set(this.G,o),o!==void 0&&this.G.call(this.ht,o)}else this.G.value=o}get lt(){var o,e,t;return typeof this.G=="function"?(e=ze.get((o=this.ht)!=null?o:globalThis))==null?void 0:e.get(this.G):(t=this.G)==null?void 0:t.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});var oe=class extends S{constructor(e){if(super(e),this.it=f,e.type!==M.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===f||e==null)return this._t=void 0,this.it=e;if(e===b)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;let t=[e];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}};oe.directiveName="unsafeHTML",oe.resultType=1;var Ut=E(oe);var Bt=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M168.49,199.51a12,12,0,0,1-17,17l-80-80a12,12,0,0,1,0-17l80-80a12,12,0,0,1,17,17L97,128Z"/></svg>
4
- `;var Ft=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M184.49,136.49l-80,80a12,12,0,0,1-17-17L159,128,87.51,56.49a12,12,0,1,1,17-17l80,80A12,12,0,0,1,184.49,136.49Z"/></svg>
5
- `;var zt=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"/></svg>
6
- `;var qt='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M216.49,168.49a12,12,0,0,1-17,0L128,97,56.49,168.49a12,12,0,0,1-17-17l80-80a12,12,0,0,1,17,0l80,80A12,12,0,0,1,216.49,168.49Z"/></svg>';var jt=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M152,96V48a8,8,0,0,1,16,0V88h40a8,8,0,0,1,0,16H160A8,8,0,0,1,152,96ZM96,152H48a8,8,0,0,0,0,16H88v40a8,8,0,0,0,16,0V160A8,8,0,0,0,96,152Zm112,0H160a8,8,0,0,0-8,8v48a8,8,0,0,0,16,0V168h40a8,8,0,0,0,0-16ZM96,40a8,8,0,0,0-8,8V88H48a8,8,0,0,0,0,16H96a8,8,0,0,0,8-8V48A8,8,0,0,0,96,40Z"/></svg>
7
- `;var Wt=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M216,48V88a8,8,0,0,1-16,0V56H168a8,8,0,0,1,0-16h40A8,8,0,0,1,216,48ZM88,200H56V168a8,8,0,0,0-16,0v40a8,8,0,0,0,8,8H88a8,8,0,0,0,0-16Zm120-40a8,8,0,0,0-8,8v32H168a8,8,0,0,0,0,16h40a8,8,0,0,0,8-8V168A8,8,0,0,0,208,160ZM88,40H48a8,8,0,0,0-8,8V88a8,8,0,0,0,16,0V56H88a8,8,0,0,0,0-16Z"/></svg>
8
- `;var Gt=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M216,48V208a16,16,0,0,1-16,16H160a16,16,0,0,1-16-16V48a16,16,0,0,1,16-16h40A16,16,0,0,1,216,48ZM96,32H56A16,16,0,0,0,40,48V208a16,16,0,0,0,16,16H96a16,16,0,0,0,16-16V48A16,16,0,0,0,96,32Z"/></svg>
9
- `;var Kt=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M240,128a15.74,15.74,0,0,1-7.6,13.51L88.32,229.65a16,16,0,0,1-16.2.3A15.86,15.86,0,0,1,64,216.13V39.87a15.86,15.86,0,0,1,8.12-13.82,16,16,0,0,1,16.2.3L232.4,114.49A15.74,15.74,0,0,1,240,128Z"/></svg>
10
- `;var Zt=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M245.66,146.34a8,8,0,0,1-11.32,11.32L216,139.31l-18.34,18.35a8,8,0,0,1-11.32-11.32L204.69,128l-18.35-18.34a8,8,0,0,1,11.32-11.32L216,116.69l18.34-18.35a8,8,0,0,1,11.32,11.32L227.31,128ZM60,80H32A16,16,0,0,0,16,96v64a16,16,0,0,0,16,16H60a4,4,0,0,0,4-4V84A4,4,0,0,0,60,80Zm97.15-54.15a8,8,0,0,0-10-.16l-65.57,51A4,4,0,0,0,80,79.84v96.32a4,4,0,0,0,1.55,3.15l65.57,51a8,8,0,0,0,9,.56,8.29,8.29,0,0,0,3.91-7.18V32.25A8.27,8.27,0,0,0,157.12,25.85Z"/></svg>
11
- `;var Xt=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M160,32.25V223.69a8.29,8.29,0,0,1-3.91,7.18,8,8,0,0,1-9-.56l-65.57-51A4,4,0,0,1,80,176.16V79.84a4,4,0,0,1,1.55-3.15l65.57-51a8,8,0,0,1,10,.16A8.27,8.27,0,0,1,160,32.25ZM60,80H32A16,16,0,0,0,16,96v64a16,16,0,0,0,16,16H60a4,4,0,0,0,4-4V84A4,4,0,0,0,60,80Zm126.77,20.84a8,8,0,0,0-.72,11.3,24,24,0,0,1,0,31.72,8,8,0,1,0,12,10.58,40,40,0,0,0,0-52.88A8,8,0,0,0,186.74,100.84Zm40.89-26.17a8,8,0,1,0-11.92,10.66,64,64,0,0,1,0,85.34,8,8,0,1,0,11.92,10.66,80,80,0,0,0,0-106.66Z"/></svg>
12
- `;var po={caretUp:qt,close:zt,collapse:jt,expand:Wt,next:Ft,pause:Gt,play:Kt,previous:Bt,soundOff:Zt,soundOn:Xt},uo=Object.fromEntries(Object.entries(po).map(([o,e])=>[o,e.replace("<svg",'<svg class="icon" aria-hidden="true" focusable="false"')]));function v(o){return Ut(uo[o])}function w(o){if(!o)return null;try{let{protocol:e}=new URL(o);return e==="https:"||e==="http:"?o:null}catch(e){return null}}function $e(){var o,e;return(e=(o=globalThis.matchMedia)==null?void 0:o.call(globalThis,"(prefers-reduced-motion: reduce)").matches)!=null?e:!1}function q(o,e){return!e.failed&&w(o.media_url)!==null}function ie(o,e,{withVideo:t=!0,loop:r=!0,onEnded:i}={}){let s=w(o.poster_url),n=t?w(o.media_url):null;return m`
13
- ${s?m`<img class="poster" alt="" src=${s} />`:f}
14
- ${n&&!e.failed?m`
1
+ "use strict";var VtexAdsStories=(()=>{var Le=Object.defineProperty;var oo=Object.getOwnPropertyDescriptor;var io=Object.getOwnPropertyNames;var so=Object.prototype.hasOwnProperty;var no=(o,e)=>{for(var t in e)Le(o,t,{get:e[t],enumerable:!0})},ao=(o,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of io(e))!so.call(o,i)&&i!==t&&Le(o,i,{get:()=>e[i],enumerable:!(r=oo(e,i))||r.enumerable});return o};var lo=o=>ao(Le({},"__esModule",{value:!0}),o);var ji={};no(ji,{TAG_NAME:()=>x,VtexAdsStoryCarouselElement:()=>D,defineVtexAdsStoryCarousel:()=>ye});var ve=globalThis,ge=ve.ShadowRoot&&(ve.ShadyCSS===void 0||ve.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,De=Symbol(),ft=new WeakMap,te=class{constructor(e,t,r){if(this._$cssResult$=!0,r!==De)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(ge&&e===void 0){let r=t!==void 0&&t.length===1;r&&(e=ft.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&ft.set(t,e))}return e}toString(){return this.cssText}},mt=o=>new te(typeof o=="string"?o:o+"",void 0,De),g=(o,...e)=>{let t=o.length===1?o[0]:e.reduce((r,i,s)=>r+(n=>{if(n._$cssResult$===!0)return n.cssText;if(typeof n=="number")return n;throw Error("Value passed to 'css' function must be a 'css' function result: "+n+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(i)+o[s+1],o[0]);return new te(t,o,De)},yt=(o,e)=>{if(ge)o.adoptedStyleSheets=e.map(t=>t instanceof CSSStyleSheet?t:t.styleSheet);else for(let t of e){let r=document.createElement("style"),i=ve.litNonce;i!==void 0&&r.setAttribute("nonce",i),r.textContent=t.cssText,o.appendChild(r)}},Ve=ge?o=>o:o=>o instanceof CSSStyleSheet?(e=>{let t="";for(let r of e.cssRules)t+=r.cssText;return mt(t)})(o):o;var{is:co,defineProperty:po,getOwnPropertyDescriptor:uo,getOwnPropertyNames:ho,getOwnPropertySymbols:fo,getPrototypeOf:mo}=Object,M=globalThis,vt=M.trustedTypes,yo=vt?vt.emptyScript:"",Ne=M.reactiveElementPolyfillSupport,re=(o,e)=>o,He={toAttribute(o,e){switch(e){case Boolean:o=o?yo:null;break;case Object:case Array:o=o==null?o:JSON.stringify(o)}return o},fromAttribute(o,e){let t=o;switch(e){case Boolean:t=o!==null;break;case Number:t=o===null?null:Number(o);break;case Object:case Array:try{t=JSON.parse(o)}catch(r){t=null}}return t}},$t=(o,e)=>!co(o,e),gt={attribute:!0,type:String,converter:He,reflect:!1,useDefault:!1,hasChanged:$t},bt,xt;(bt=Symbol.metadata)!=null||(Symbol.metadata=Symbol("metadata")),(xt=M.litPropertyMetadata)!=null||(M.litPropertyMetadata=new WeakMap);var E=class extends HTMLElement{static addInitializer(e){var t;this._$Ei(),((t=this.l)!=null?t:this.l=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=gt){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){let r=Symbol(),i=this.getPropertyDescriptor(e,r,t);i!==void 0&&po(this.prototype,e,i)}}static getPropertyDescriptor(e,t,r){var n;let{get:i,set:s}=(n=uo(this.prototype,e))!=null?n:{get(){return this[t]},set(a){this[t]=a}};return{get:i,set(a){let d=i==null?void 0:i.call(this);s==null||s.call(this,a),this.requestUpdate(e,d,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){var t;return(t=this.elementProperties.get(e))!=null?t:gt}static _$Ei(){if(this.hasOwnProperty(re("elementProperties")))return;let e=mo(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(re("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(re("properties"))){let t=this.properties,r=[...ho(t),...fo(t)];for(let i of r)this.createProperty(i,t[i])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[r,i]of t)this.elementProperties.set(r,i)}this._$Eh=new Map;for(let[t,r]of this.elementProperties){let i=this._$Eu(t,r);i!==void 0&&this._$Eh.set(i,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let r=new Set(e.flat(1/0).reverse());for(let i of r)t.unshift(Ve(i))}else e!==void 0&&t.push(Ve(e));return t}static _$Eu(e,t){let r=t.attribute;return r===!1?void 0:typeof r=="string"?r:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var e;this._$ES=new Promise(t=>this.enableUpdating=t),this._$AL=new Map,this._$E_(),this.requestUpdate(),(e=this.constructor.l)==null||e.forEach(t=>t(this))}addController(e){var t,r;((t=this._$EO)!=null?t:this._$EO=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&((r=e.hostConnected)==null||r.call(e))}removeController(e){var t;(t=this._$EO)==null||t.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let r of t.keys())this.hasOwnProperty(r)&&(e.set(r,this[r]),delete this[r]);e.size>0&&(this._$Ep=e)}createRenderRoot(){var t;let e=(t=this.shadowRoot)!=null?t:this.attachShadow(this.constructor.shadowRootOptions);return yt(e,this.constructor.elementStyles),e}connectedCallback(){var e,t;(e=this.renderRoot)!=null||(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$EO)==null||t.forEach(r=>{var i;return(i=r.hostConnected)==null?void 0:i.call(r)})}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach(t=>{var r;return(r=t.hostDisconnected)==null?void 0:r.call(t)})}attributeChangedCallback(e,t,r){this._$AK(e,r)}_$ET(e,t){var s;let r=this.constructor.elementProperties.get(e),i=this.constructor._$Eu(e,r);if(i!==void 0&&r.reflect===!0){let n=(((s=r.converter)==null?void 0:s.toAttribute)!==void 0?r.converter:He).toAttribute(t,r.type);this._$Em=e,n==null?this.removeAttribute(i):this.setAttribute(i,n),this._$Em=null}}_$AK(e,t){var s,n,a;let r=this.constructor,i=r._$Eh.get(e);if(i!==void 0&&this._$Em!==i){let d=r.getPropertyOptions(i),l=typeof d.converter=="function"?{fromAttribute:d.converter}:((s=d.converter)==null?void 0:s.fromAttribute)!==void 0?d.converter:He;this._$Em=i;let p=l.fromAttribute(t,d.type);this[i]=(a=p!=null?p:(n=this._$Ej)==null?void 0:n.get(i))!=null?a:p,this._$Em=null}}requestUpdate(e,t,r,i=!1,s){var n,a;if(e!==void 0){let d=this.constructor;if(i===!1&&(s=this[e]),r!=null||(r=d.getPropertyOptions(e)),!(((n=r.hasChanged)!=null?n:$t)(s,t)||r.useDefault&&r.reflect&&s===((a=this._$Ej)==null?void 0:a.get(e))&&!this.hasAttribute(d._$Eu(e,r))))return;this.C(e,t,r)}this.isUpdatePending===!1&&(this._$ES=this._$EP())}C(e,t,{useDefault:r,reflect:i,wrapped:s},n){var a,d,l;r&&!((a=this._$Ej)!=null?a:this._$Ej=new Map).has(e)&&(this._$Ej.set(e,(d=n!=null?n:t)!=null?d:this[e]),s!==!0||n!==void 0)||(this._$AL.has(e)||(this.hasUpdated||r||(t=void 0),this._$AL.set(e,t)),i===!0&&this._$Em!==e&&((l=this._$Eq)!=null?l:this._$Eq=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var r,i;if(!this.isUpdatePending)return;if(!this.hasUpdated){if((r=this.renderRoot)!=null||(this.renderRoot=this.createRenderRoot()),this._$Ep){for(let[n,a]of this._$Ep)this[n]=a;this._$Ep=void 0}let s=this.constructor.elementProperties;if(s.size>0)for(let[n,a]of s){let{wrapped:d}=a,l=this[n];d!==!0||this._$AL.has(n)||l===void 0||this.C(n,void 0,a,l)}}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),(i=this._$EO)==null||i.forEach(s=>{var n;return(n=s.hostUpdate)==null?void 0:n.call(s)}),this.update(t)):this._$EM()}catch(s){throw e=!1,this._$EM(),s}e&&this._$AE(t)}willUpdate(e){}_$AE(e){var t;(t=this._$EO)==null||t.forEach(r=>{var i;return(i=r.hostUpdated)==null?void 0:i.call(r)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&(this._$Eq=this._$Eq.forEach(t=>this._$ET(t,this[t]))),this._$EM()}updated(e){}firstUpdated(e){}},wt;E.elementStyles=[],E.shadowRootOptions={mode:"open"},E[re("elementProperties")]=new Map,E[re("finalized")]=new Map,Ne==null||Ne({ReactiveElement:E}),((wt=M.reactiveElementVersions)!=null?wt:M.reactiveElementVersions=[]).push("2.1.2");var ie=globalThis,St=o=>o,be=ie.trustedTypes,At=be?be.createPolicy("lit-html",{createHTML:o=>o}):void 0,Be="$lit$",T=`lit$${Math.random().toFixed(9).slice(2)}$`,qe="?"+T,vo=`<${qe}>`,U=document,se=()=>U.createComment(""),ne=o=>o===null||typeof o!="object"&&typeof o!="function",ze=Array.isArray,Mt=o=>ze(o)||typeof(o==null?void 0:o[Symbol.iterator])=="function",Ue=`[
2
+ \f\r]`,oe=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,_t=/-->/g,Ct=/>/g,N=RegExp(`>|${Ue}(?:([^\\s"'>=/]+)(${Ue}*=${Ue}*(?:[^
3
+ \f\r"'\`<>=]|("|')|))|$)`,"g"),Et=/'/g,Tt=/"/g,Rt=/^(?:script|style|textarea|title)$/i,We=o=>(e,...t)=>({_$litType$:o,strings:e,values:t}),f=We(1),Yi=We(2),Ji=We(3),w=Symbol.for("lit-noChange"),u=Symbol.for("lit-nothing"),Pt=new WeakMap,H=U.createTreeWalker(U,129);function Ot(o,e){if(!ze(o)||!o.hasOwnProperty("raw"))throw Error("invalid template strings array");return At!==void 0?At.createHTML(e):e}var It=(o,e)=>{let t=o.length-1,r=[],i,s=e===2?"<svg>":e===3?"<math>":"",n=oe;for(let a=0;a<t;a++){let d=o[a],l,p,c=-1,h=0;for(;h<d.length&&(n.lastIndex=h,p=n.exec(d),p!==null);)h=n.lastIndex,n===oe?p[1]==="!--"?n=_t:p[1]!==void 0?n=Ct:p[2]!==void 0?(Rt.test(p[2])&&(i=RegExp("</"+p[2],"g")),n=N):p[3]!==void 0&&(n=N):n===N?p[0]===">"?(n=i!=null?i:oe,c=-1):p[1]===void 0?c=-2:(c=n.lastIndex-p[2].length,l=p[1],n=p[3]===void 0?N:p[3]==='"'?Tt:Et):n===Tt||n===Et?n=N:n===_t||n===Ct?n=oe:(n=N,i=void 0);let m=n===N&&o[a+1].startsWith("/>")?" ":"";s+=n===oe?d+vo:c>=0?(r.push(l),d.slice(0,c)+Be+d.slice(c)+T+m):d+T+(c===-2?a:m)}return[Ot(o,s+(o[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),r]},ae=class o{constructor({strings:e,_$litType$:t},r){let i;this.parts=[];let s=0,n=0,a=e.length-1,d=this.parts,[l,p]=It(e,t);if(this.el=o.createElement(l,r),H.currentNode=this.el.content,t===2||t===3){let c=this.el.content.firstChild;c.replaceWith(...c.childNodes)}for(;(i=H.nextNode())!==null&&d.length<a;){if(i.nodeType===1){if(i.hasAttributes())for(let c of i.getAttributeNames())if(c.endsWith(Be)){let h=p[n++],m=i.getAttribute(c).split(T),y=/([.?@])?(.*)/.exec(h);d.push({type:1,index:s,name:y[2],strings:m,ctor:y[1]==="."?we:y[1]==="?"?$e:y[1]==="@"?Se:B}),i.removeAttribute(c)}else c.startsWith(T)&&(d.push({type:6,index:s}),i.removeAttribute(c));if(Rt.test(i.tagName)){let c=i.textContent.split(T),h=c.length-1;if(h>0){i.textContent=be?be.emptyScript:"";for(let m=0;m<h;m++)i.append(c[m],se()),H.nextNode(),d.push({type:2,index:++s});i.append(c[h],se())}}}else if(i.nodeType===8)if(i.data===qe)d.push({type:2,index:s});else{let c=-1;for(;(c=i.data.indexOf(T,c+1))!==-1;)d.push({type:7,index:s}),c+=T.length-1}s++}}static createElement(e,t){let r=U.createElement("template");return r.innerHTML=e,r}};function F(o,e,t=o,r){var n,a,d;if(e===w)return e;let i=r!==void 0?(n=t._$Co)==null?void 0:n[r]:t._$Cl,s=ne(e)?void 0:e._$litDirective$;return(i==null?void 0:i.constructor)!==s&&((a=i==null?void 0:i._$AO)==null||a.call(i,!1),s===void 0?i=void 0:(i=new s(o),i._$AT(o,t,r)),r!==void 0?((d=t._$Co)!=null?d:t._$Co=[])[r]=i:t._$Cl=i),i!==void 0&&(e=F(o,i._$AS(o,e.values),i,r)),e}var xe=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){var l;let{el:{content:t},parts:r}=this._$AD,i=((l=e==null?void 0:e.creationScope)!=null?l:U).importNode(t,!0);H.currentNode=i;let s=H.nextNode(),n=0,a=0,d=r[0];for(;d!==void 0;){if(n===d.index){let p;d.type===2?p=new j(s,s.nextSibling,this,e):d.type===1?p=new d.ctor(s,d.name,d.strings,this,e):d.type===6&&(p=new Ae(s,this,e)),this._$AV.push(p),d=r[++a]}n!==(d==null?void 0:d.index)&&(s=H.nextNode(),n++)}return H.currentNode=U,i}p(e){let t=0;for(let r of this._$AV)r!==void 0&&(r.strings!==void 0?(r._$AI(e,r,t),t+=r.strings.length-2):r._$AI(e[t])),t++}},j=class o{get _$AU(){var e,t;return(t=(e=this._$AM)==null?void 0:e._$AU)!=null?t:this._$Cv}constructor(e,t,r,i){var s;this.type=2,this._$AH=u,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=r,this.options=i,this._$Cv=(s=i==null?void 0:i.isConnected)!=null?s:!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&(e==null?void 0:e.nodeType)===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=F(this,e,t),ne(e)?e===u||e==null||e===""?(this._$AH!==u&&this._$AR(),this._$AH=u):e!==this._$AH&&e!==w&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Mt(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==u&&ne(this._$AH)?this._$AA.nextSibling.data=e:this.T(U.createTextNode(e)),this._$AH=e}$(e){var s;let{values:t,_$litType$:r}=e,i=typeof r=="number"?this._$AC(e):(r.el===void 0&&(r.el=ae.createElement(Ot(r.h,r.h[0]),this.options)),r);if(((s=this._$AH)==null?void 0:s._$AD)===i)this._$AH.p(t);else{let n=new xe(i,this),a=n.u(this.options);n.p(t),this.T(a),this._$AH=n}}_$AC(e){let t=Pt.get(e.strings);return t===void 0&&Pt.set(e.strings,t=new ae(e)),t}k(e){ze(this._$AH)||(this._$AH=[],this._$AR());let t=this._$AH,r,i=0;for(let s of e)i===t.length?t.push(r=new o(this.O(se()),this.O(se()),this,this.options)):r=t[i],r._$AI(s),i++;i<t.length&&(this._$AR(r&&r._$AB.nextSibling,i),t.length=i)}_$AR(e=this._$AA.nextSibling,t){var r;for((r=this._$AP)==null?void 0:r.call(this,!1,!0,t);e!==this._$AB;){let i=St(e).nextSibling;St(e).remove(),e=i}}setConnected(e){var t;this._$AM===void 0&&(this._$Cv=e,(t=this._$AP)==null||t.call(this,e))}},B=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,r,i,s){this.type=1,this._$AH=u,this._$AN=void 0,this.element=e,this.name=t,this._$AM=i,this.options=s,r.length>2||r[0]!==""||r[1]!==""?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=u}_$AI(e,t=this,r,i){let s=this.strings,n=!1;if(s===void 0)e=F(this,e,t,0),n=!ne(e)||e!==this._$AH&&e!==w,n&&(this._$AH=e);else{let a=e,d,l;for(e=s[0],d=0;d<s.length-1;d++)l=F(this,a[r+d],t,d),l===w&&(l=this._$AH[d]),n||(n=!ne(l)||l!==this._$AH[d]),l===u?e=u:e!==u&&(e+=(l!=null?l:"")+s[d+1]),this._$AH[d]=l}n&&!i&&this.j(e)}j(e){e===u?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e!=null?e:"")}},we=class extends B{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===u?void 0:e}},$e=class extends B{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==u)}},Se=class extends B{constructor(e,t,r,i,s){super(e,t,r,i,s),this.type=5}_$AI(e,t=this){var n;if((e=(n=F(this,e,t,0))!=null?n:u)===w)return;let r=this._$AH,i=e===u&&r!==u||e.capture!==r.capture||e.once!==r.once||e.passive!==r.passive,s=e!==u&&(r===u||i);i&&this.element.removeEventListener(this.name,this,r),s&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var t,r;typeof this._$AH=="function"?this._$AH.call((r=(t=this.options)==null?void 0:t.host)!=null?r:this.element,e):this._$AH.handleEvent(e)}},Ae=class{constructor(e,t,r){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=r}get _$AU(){return this._$AM._$AU}_$AI(e){F(this,e)}},Lt={M:Be,P:T,A:qe,C:1,L:It,R:xe,D:Mt,V:F,I:j,H:B,N:$e,U:Se,B:we,F:Ae},Fe=ie.litHtmlPolyfillSupport,kt;Fe==null||Fe(ae,j),((kt=ie.litHtmlVersions)!=null?kt:ie.litHtmlVersions=[]).push("3.3.3");var Dt=(o,e,t)=>{var s,n;let r=(s=t==null?void 0:t.renderBefore)!=null?s:e,i=r._$litPart$;if(i===void 0){let a=(n=t==null?void 0:t.renderBefore)!=null?n:null;r._$litPart$=i=new j(e.insertBefore(se(),a),a,void 0,t!=null?t:{})}return i._$AI(o),i};var q=globalThis,R=class extends E{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var t,r;let e=super.createRenderRoot();return(r=(t=this.renderOptions).renderBefore)!=null||(t.renderBefore=e.firstChild),e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Dt(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)==null||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)==null||e.setConnected(!1)}render(){return w}},Vt;R._$litElement$=!0,R.finalized=!0,(Vt=q.litElementHydrateSupport)==null||Vt.call(q,{LitElement:R});var je=q.litElementPolyfillSupport;je==null||je({LitElement:R});var Nt;((Nt=q.litElementVersions)!=null?Nt:q.litElementVersions=[]).push("4.2.2");var{I:go}=Lt,Ht=o=>o;var Ft=o=>o.strings===void 0,Ut=()=>document.createComment(""),G=(o,e,t)=>{var s;let r=o._$AA.parentNode,i=e===void 0?o._$AB:e._$AA;if(t===void 0){let n=r.insertBefore(Ut(),i),a=r.insertBefore(Ut(),i);t=new go(n,a,o,o.options)}else{let n=t._$AB.nextSibling,a=t._$AM,d=a!==o;if(d){let l;(s=t._$AQ)==null||s.call(t,o),t._$AM=o,t._$AP!==void 0&&(l=o._$AU)!==a._$AU&&t._$AP(l)}if(n!==i||d){let l=t._$AA;for(;l!==n;){let p=Ht(l).nextSibling;Ht(r).insertBefore(l,i),l=p}}}return t},O=(o,e,t=o)=>(o._$AI(e,t),o),bo={},Bt=(o,e=bo)=>o._$AH=e,qt=o=>o._$AH,_e=o=>{o._$AR(),o._$AA.remove()};var I={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},P=o=>(...e)=>({_$litDirective$:o,values:e}),_=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,r){this._$Ct=e,this._$AM=t,this._$Ci=r}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}};var de=(o,e)=>{var r;let t=o._$AN;if(t===void 0)return!1;for(let i of t)(r=i._$AO)==null||r.call(i,e,!1),de(i,e);return!0},Ce=o=>{let e,t;do{if((e=o._$AM)===void 0)break;t=e._$AN,t.delete(o),o=e}while((t==null?void 0:t.size)===0)},zt=o=>{for(let e;e=o._$AM;o=e){let t=e._$AN;if(t===void 0)e._$AN=t=new Set;else if(t.has(o))break;t.add(o),$o(e)}};function xo(o){this._$AN!==void 0?(Ce(this),this._$AM=o,zt(this)):this._$AM=o}function wo(o,e=!1,t=0){let r=this._$AH,i=this._$AN;if(i!==void 0&&i.size!==0)if(e)if(Array.isArray(r))for(let s=t;s<r.length;s++)de(r[s],!1),Ce(r[s]);else r!=null&&(de(r,!1),Ce(r));else de(this,o)}var $o=o=>{var e,t;o.type==I.CHILD&&((e=o._$AP)!=null||(o._$AP=wo),(t=o._$AQ)!=null||(o._$AQ=xo))},Ee=class extends _{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,t,r){super._$AT(e,t,r),zt(this),this.isConnected=e._$AU}_$AO(e,t=!0){var r,i;e!==this.isConnected&&(this.isConnected=e,e?(r=this.reconnected)==null||r.call(this):(i=this.disconnected)==null||i.call(this)),t&&(de(this,e),Ce(this))}setValue(e){if(Ft(this._$Ct))this._$Ct._$AI(e,this);else{let t=[...this._$Ct._$AH];t[this._$Ci]=e,this._$Ct._$AI(t,this,0)}}disconnected(){}reconnected(){}};var k=()=>new Ze,Ze=class{},Ge=new WeakMap,$=P(class extends Ee{render(o){return u}update(o,[e]){var r;let t=e!==this.G;return t&&this.rt(void 0),(t||this.lt!==this.ct)&&(this.G=e,this.ht=(r=o.options)==null?void 0:r.host,this.rt(this.ct=o.element)),u}rt(o){var e;if(this.G!==void 0)if(this.isConnected||(o=void 0),typeof this.G=="function"){let t=(e=this.ht)!=null?e:globalThis,r=Ge.get(t);r===void 0&&(r=new WeakMap,Ge.set(t,r)),r.get(this.G)!==void 0&&this.G.call(this.ht,void 0),r.set(this.G,o),o!==void 0&&this.G.call(this.ht,o)}else this.G.value=o}get lt(){var o,e,t;return typeof this.G=="function"?(e=Ge.get((o=this.ht)!=null?o:globalThis))==null?void 0:e.get(this.G):(t=this.G)==null?void 0:t.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});var le=class extends _{constructor(e){if(super(e),this.it=u,e.type!==I.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===u||e==null)return this._t=void 0,this.it=e;if(e===w)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;let t=[e];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}};le.directiveName="unsafeHTML",le.resultType=1;var Wt=P(le);var jt=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M168.49,199.51a12,12,0,0,1-17,17l-80-80a12,12,0,0,1,0-17l80-80a12,12,0,0,1,17,17L97,128Z"/></svg>
4
+ `;var Gt=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M184.49,136.49l-80,80a12,12,0,0,1-17-17L159,128,87.51,56.49a12,12,0,1,1,17-17l80,80A12,12,0,0,1,184.49,136.49Z"/></svg>
5
+ `;var Zt=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"/></svg>
6
+ `;var Qt='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M216.49,168.49a12,12,0,0,1-17,0L128,97,56.49,168.49a12,12,0,0,1-17-17l80-80a12,12,0,0,1,17,0l80,80A12,12,0,0,1,216.49,168.49Z"/></svg>';var Kt=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M152,96V48a8,8,0,0,1,16,0V88h40a8,8,0,0,1,0,16H160A8,8,0,0,1,152,96ZM96,152H48a8,8,0,0,0,0,16H88v40a8,8,0,0,0,16,0V160A8,8,0,0,0,96,152Zm112,0H160a8,8,0,0,0-8,8v48a8,8,0,0,0,16,0V168h40a8,8,0,0,0,0-16ZM96,40a8,8,0,0,0-8,8V88H48a8,8,0,0,0,0,16H96a8,8,0,0,0,8-8V48A8,8,0,0,0,96,40Z"/></svg>
7
+ `;var Xt=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M216,48V88a8,8,0,0,1-16,0V56H168a8,8,0,0,1,0-16h40A8,8,0,0,1,216,48ZM88,200H56V168a8,8,0,0,0-16,0v40a8,8,0,0,0,8,8H88a8,8,0,0,0,0-16Zm120-40a8,8,0,0,0-8,8v32H168a8,8,0,0,0,0,16h40a8,8,0,0,0,8-8V168A8,8,0,0,0,208,160ZM88,40H48a8,8,0,0,0-8,8V88a8,8,0,0,0,16,0V56H88a8,8,0,0,0,0-16Z"/></svg>
8
+ `;var Yt='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M224,128a8,8,0,0,1-8,8H40a8,8,0,0,1,0-16H216A8,8,0,0,1,224,128Z"/></svg>';var Jt=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M216,48V208a16,16,0,0,1-16,16H160a16,16,0,0,1-16-16V48a16,16,0,0,1,16-16h40A16,16,0,0,1,216,48ZM96,32H56A16,16,0,0,0,40,48V208a16,16,0,0,0,16,16H96a16,16,0,0,0,16-16V48A16,16,0,0,0,96,32Z"/></svg>
9
+ `;var er=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M240,128a15.74,15.74,0,0,1-7.6,13.51L88.32,229.65a16,16,0,0,1-16.2.3A15.86,15.86,0,0,1,64,216.13V39.87a15.86,15.86,0,0,1,8.12-13.82,16,16,0,0,1,16.2.3L232.4,114.49A15.74,15.74,0,0,1,240,128Z"/></svg>
10
+ `;var tr='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M224,128a8,8,0,0,1-8,8H136v80a8,8,0,0,1-16,0V136H40a8,8,0,0,1,0-16h80V40a8,8,0,0,1,16,0v80h80A8,8,0,0,1,224,128Z"/></svg>';var rr=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M245.66,146.34a8,8,0,0,1-11.32,11.32L216,139.31l-18.34,18.35a8,8,0,0,1-11.32-11.32L204.69,128l-18.35-18.34a8,8,0,0,1,11.32-11.32L216,116.69l18.34-18.35a8,8,0,0,1,11.32,11.32L227.31,128ZM60,80H32A16,16,0,0,0,16,96v64a16,16,0,0,0,16,16H60a4,4,0,0,0,4-4V84A4,4,0,0,0,60,80Zm97.15-54.15a8,8,0,0,0-10-.16l-65.57,51A4,4,0,0,0,80,79.84v96.32a4,4,0,0,0,1.55,3.15l65.57,51a8,8,0,0,0,9,.56,8.29,8.29,0,0,0,3.91-7.18V32.25A8.27,8.27,0,0,0,157.12,25.85Z"/></svg>
11
+ `;var or=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M160,32.25V223.69a8.29,8.29,0,0,1-3.91,7.18,8,8,0,0,1-9-.56l-65.57-51A4,4,0,0,1,80,176.16V79.84a4,4,0,0,1,1.55-3.15l65.57-51a8,8,0,0,1,10,.16A8.27,8.27,0,0,1,160,32.25ZM60,80H32A16,16,0,0,0,16,96v64a16,16,0,0,0,16,16H60a4,4,0,0,0,4-4V84A4,4,0,0,0,60,80Zm126.77,20.84a8,8,0,0,0-.72,11.3,24,24,0,0,1,0,31.72,8,8,0,1,0,12,10.58,40,40,0,0,0,0-52.88A8,8,0,0,0,186.74,100.84Zm40.89-26.17a8,8,0,1,0-11.92,10.66,64,64,0,0,1,0,85.34,8,8,0,1,0,11.92,10.66,80,80,0,0,0,0-106.66Z"/></svg>
12
+ `;var ir='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M216,48H176V40a24,24,0,0,0-24-24H104A24,24,0,0,0,80,40v8H40a8,8,0,0,0,0,16h8V208a16,16,0,0,0,16,16H192a16,16,0,0,0,16-16V64h8a8,8,0,0,0,0-16ZM96,40a8,8,0,0,1,8-8h48a8,8,0,0,1,8,8v8H96Zm96,168H64V64H192ZM112,104v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Zm48,0v64a8,8,0,0,1-16,0V104a8,8,0,0,1,16,0Z"/></svg>';var sr=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256" fill="currentColor"><path d="M128,24A104,104,0,1,0,232,128,104.11,104.11,0,0,0,128,24Zm-8,56a8,8,0,0,1,16,0v56a8,8,0,0,1-16,0Zm8,104a12,12,0,1,1,12-12A12,12,0,0,1,128,184Z"/></svg>
13
+ `;var Vo={caretUp:Qt,close:Zt,collapse:Kt,expand:Xt,minus:Yt,next:Gt,pause:Jt,play:er,plus:tr,previous:jt,soundOff:rr,soundOn:or,trash:ir,warning:sr},No=Object.fromEntries(Object.entries(Vo).map(([o,e])=>[o,e.replace("<svg",'<svg class="icon" aria-hidden="true" focusable="false"')]));function v(o){return Wt(No[o])}var nr={watch:"Watch video",show:"Show video",carousel:"Videos",carouselRole:"carousel",previous:"Previous video",next:"Next video",player:"Video",expand:"Expand video",collapse:"Collapse video",close:"Close video",play:"Play video",pause:"Pause video",soundOn:"Turn sound on",soundOff:"Turn sound off",addToCart:"Add to cart",cartQuantity:"Quantity in cart",decreaseQuantity:"Decrease quantity",removeFromCart:"Remove from cart",increaseQuantity:"Increase quantity",unavailable:"Product unavailable",soldOut:"Sold out",viewProduct:"View product",videoUnavailable:"Video unavailable",videoFailed:"Couldn't load the video",retry:"Try again",videoLoading:"Loading video",product:(o,e,t,r)=>{let i=o;return e&&t?i=`${o}, was ${t}, now ${e}`:e&&(i=`${o}, ${e}`),r?`${i}, ${r}`:i},position:(o,e,t)=>t>1?`${o} ${e+1} of ${t}`:o};var ar={watch:"Ver video",show:"Mostrar video",carousel:"Videos",carouselRole:"carrusel",previous:"Video anterior",next:"Video siguiente",player:"Video",expand:"Ampliar video",collapse:"Reducir video",close:"Cerrar video",play:"Reproducir video",pause:"Pausar video",soundOn:"Activar sonido",soundOff:"Desactivar sonido",addToCart:"Agregar al carrito",cartQuantity:"Cantidad en el carrito",decreaseQuantity:"Disminuir cantidad",removeFromCart:"Quitar del carrito",increaseQuantity:"Aumentar cantidad",unavailable:"Producto no disponible",soldOut:"Agotado",viewProduct:"Ver producto",videoUnavailable:"Video no disponible",videoFailed:"No se pudo cargar el video",retry:"Intentar de nuevo",videoLoading:"Cargando video",product:(o,e,t,r)=>{let i=o;return e&&t?i=`${o}, antes ${t}, ahora ${e}`:e&&(i=`${o}, ${e}`),r?`${i}, ${r}`:i},position:(o,e,t)=>t>1?`${o} ${e+1} de ${t}`:o};var Z={watch:"Assistir v\xEDdeo",show:"Mostrar v\xEDdeo",carousel:"V\xEDdeos",carouselRole:"carrossel",previous:"V\xEDdeo anterior",next:"Pr\xF3ximo v\xEDdeo",player:"V\xEDdeo",expand:"Expandir v\xEDdeo",collapse:"Reduzir v\xEDdeo",close:"Fechar v\xEDdeo",play:"Reproduzir v\xEDdeo",pause:"Pausar v\xEDdeo",soundOn:"Ativar som",soundOff:"Desativar som",addToCart:"Adicionar ao carrinho",cartQuantity:"Quantidade no carrinho",decreaseQuantity:"Diminuir quantidade",removeFromCart:"Remover do carrinho",increaseQuantity:"Aumentar quantidade",unavailable:"Produto indispon\xEDvel",soldOut:"Esgotado",viewProduct:"Ver produto",videoUnavailable:"V\xEDdeo indispon\xEDvel",videoFailed:"N\xE3o foi poss\xEDvel carregar o v\xEDdeo",retry:"Tentar de novo",videoLoading:"Carregando v\xEDdeo",product:(o,e,t,r)=>{let i=o;return e&&t?i=`${o}, de ${t} por ${e}`:e&&(i=`${o}, ${e}`),r?`${i}, ${r}`:i},position:(o,e,t)=>t>1?`${o} ${e+1} de ${t}`:o};var Ho=new Map([["pt",Z],["es",ar],["en",nr]]);function dr(o,e={}){var n,a,d;let t=o.split("-")[0].toLowerCase(),r=(n=Ho.get(t))!=null?n:Z,i=(a=e.addToCart)==null?void 0:a.trim(),s=(d=e.viewProduct)==null?void 0:d.trim();return{...r,...i&&{addToCart:i},...s&&{viewProduct:s}}}function b(o){if(!o)return null;try{let{protocol:e}=new URL(o);return e==="https:"||e==="http:"?o:null}catch(e){return null}}var lr="https://store.invalid";function Uo(o){try{let e=new URL(o,lr);return e.origin!==lr||e.pathname.startsWith("//")?null:`${e.pathname}${e.search}${e.hash}`}catch(e){return null}}function Te(o){return o?o.startsWith("/")?Uo(o):b(o):null}var cr="(prefers-reduced-motion: reduce)";function Q(){var o,e;return(e=(o=globalThis.matchMedia)==null?void 0:o.call(globalThis,cr).matches)!=null?e:!1}function K(o,e){return!e.failed&&!e.retrying&&b(o.media_url)!==null}function Fo(o,e){let t=r=>{r.stopPropagation(),e==null||e()};return f`
14
+ <div class="media-status" ?data-retry=${!!e}>
15
+ <span class="media-status-text">
16
+ ${v("warning")}
17
+ ${e?o.videoFailed:o.videoUnavailable}
18
+ </span>
19
+ ${e?f`
20
+ <button type="button" class="media-retry" @click=${t}>
21
+ ${o.retry}
22
+ </button>
23
+ `:u}
24
+ </div>
25
+ `}function Bo(o){return f`
26
+ <div class="media-status">
27
+ <span class="media-status-text">
28
+ <span class="media-spinner" aria-hidden="true"></span>
29
+ ${o.videoLoading}
30
+ </span>
31
+ </div>
32
+ `}function qo(o,e,t){return o.failed?Fo(e,t):o.retrying?Bo(e):u}function zo(o,{labels:e=Z,onRetry:t,announce:r=!0}){return f`
33
+ <div
34
+ class="media-notice"
35
+ role=${r?"status":u}
36
+ aria-hidden=${r?u:"true"}
37
+ >
38
+ ${qo(o,e,t)}
39
+ </div>
40
+ `}function ce(o,e,t={}){let{withVideo:r=!0,loop:i=!0,onEnded:s,autoplay:n=!0}=t,a=b(o.poster_url),d=r?b(o.media_url):null,l=n?"metadata":"auto";return f`
41
+ ${a?f`<img class="poster" alt="" src=${a} />`:u}
42
+ ${d&&!e.failed?f`
15
43
  <video
16
44
  class="video"
17
45
  muted
18
46
  playsinline
19
- ?loop=${r}
20
- preload="metadata"
47
+ ?loop=${i}
48
+ preload=${l}
21
49
  .muted=${!0}
22
- ?autoplay=${!$e()}
23
- poster=${s!=null?s:f}
24
- src=${n}
25
- ${x(e.ref)}
50
+ ?autoplay=${n&&!Q()}
51
+ poster=${a!=null?a:u}
52
+ src=${d}
53
+ ${$(e.ref)}
26
54
  @play=${e.sync}
27
55
  @pause=${e.sync}
28
56
  @volumechange=${e.sync}
57
+ @loadeddata=${e.loaded}
29
58
  @error=${e.fail}
30
- @ended=${i}
59
+ @ended=${s}
31
60
  ></video>
32
- `:f}
33
- `}function j(o){var e;(e=o.play())==null||e.catch(()=>{})}var B=class{constructor(e){this.host=e;this.ref=P();this.paused=!0;this.muted=!0;this.failed=!1;this.sync=()=>{let e=this.ref.value;e&&(this.paused=e.paused,this.muted=e.muted,this.host.requestUpdate())};this.fail=()=>{this.failed=!0,this.host.requestUpdate()}}get playing(){let e=this.ref.value;return!!e&&e.isConnected&&!e.paused}reset(){this.paused=!0,this.muted=!0,this.failed=!1}play(){let e=this.ref.value;e&&j(e)}pause(){var e;(e=this.ref.value)==null||e.pause()}resume(){let e=this.ref.value;e!=null&&e.autoplay&&j(e)}togglePlayback(){let e=this.ref.value;e&&(e.paused?j(e):e.pause())}mute(){let e=this.ref.value;e&&(e.muted=!0)}restart({withSound:e=!1}={}){let t=this.ref.value;t&&(t.currentTime=0,e?this.playWithSound():j(t))}playWithSound(){var t;let e=this.ref.value;e&&(e.muted=!1,(t=e.play())==null||t.catch(r=>{!(r instanceof DOMException&&r.name==="NotAllowedError")||this.ref.value!==e||!e.isConnected||(e.muted=!0,j(e))}))}toggleMuted(){let e=this.ref.value;e&&(e.muted=!e.muted)}};var Se="pt-BR";function Yt(o){let e=Number.NaN;return typeof o=="number"?e=o:typeof o=="string"&&o.trim()!==""&&(e=Number(o)),Number.isFinite(e)&&e>0?e:void 0}function We(o){let e=Yt(o==null?void 0:o.price),t=Yt(o==null?void 0:o.promotional_price);return t!==void 0&&(e===void 0||t<e)?e===void 0?{price:t}:{price:t,listPrice:e}:e===void 0?void 0:{price:e}}function ho(o){try{return Intl.NumberFormat.supportedLocalesOf(o).length>0}catch(e){return!1}}var je=Intl;function fo(o){var t;if(!/^[a-z]{3}$/i.test(o))return!1;let e=(t=je.supportedValuesOf)==null?void 0:t.call(je,"currency");return e?e.includes(o.toUpperCase()):!0}function Ge(o,e){let t=new Intl.NumberFormat(o&&ho(o)?o:Se,{style:"currency",currency:e&&fo(e)?e:"BRL"});return r=>t.format(r)}function Ke(o,e,t,r){var p,c,h,u;let i=o.product,s=(p=i==null?void 0:i.product_name)==null?void 0:p.trim();if(!i||!s)return;let n={name:s,imageUrl:(c=w(i.image_url))!=null?c:void 0,url:(h=w(o.destination_url))!=null?h:void 0};if(r==="loading")return{...n,label:t.product(s),isLoading:!0};if((r==null?void 0:r.available)===!1)return{...n,label:t.product(s,t.soldOut),soldOut:t.soldOut};let a=(u=r==null?void 0:r.price)!=null?u:We(i.product_metadata),d=a&&e(a.price),l=(a==null?void 0:a.listPrice)===void 0?void 0:e(a.listPrice);return{...n,price:d,listPrice:l,label:t.product(s,d,l)}}var mo=m`
61
+ `:u}
62
+ ${d?zo(e,t):u}
63
+ `}var Qe=g`
64
+ /* The live region the notice shows in, over the cover. Empty until the
65
+ video can't load or is loading again. Clicks go through to the card. */
66
+ .media-notice {
67
+ position: absolute;
68
+ inset: 0;
69
+ pointer-events: none;
70
+ }
71
+
72
+ /* The notice: a dimmed layer with the text in the middle. */
73
+ .media-status {
74
+ position: absolute;
75
+ inset: 0;
76
+ display: flex;
77
+ flex-direction: column;
78
+ gap: 12px;
79
+ align-items: center;
80
+ justify-content: center;
81
+ box-sizing: border-box;
82
+ padding: 16px;
83
+ background: rgba(0, 0, 0, 0.45);
84
+ color: #fff;
85
+ text-align: center;
86
+ pointer-events: none;
87
+ }
88
+
89
+ .media-status > * {
90
+ animation: media-status-in 0.4s ease-out both;
91
+ }
92
+
93
+ .media-status-text {
94
+ display: flex;
95
+ flex-direction: column;
96
+ gap: 8px;
97
+ align-items: center;
98
+ max-width: 100%;
99
+ font-size: 14px;
100
+ font-weight: 600;
101
+ line-height: 1.3;
102
+ text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
103
+ }
104
+
105
+ .media-status-text .icon {
106
+ width: 18px;
107
+ height: 18px;
108
+ }
109
+
110
+ .media-status[data-retry] .media-status-text .icon {
111
+ width: 24px;
112
+ height: 24px;
113
+ }
114
+
115
+ .media-retry {
116
+ min-height: 36px;
117
+ padding: 0 16px;
118
+ border: 0;
119
+ border-radius: var(--_button-radius);
120
+ background: rgba(255, 255, 255, 0.15);
121
+ backdrop-filter: blur(4px);
122
+ box-shadow: inset 0 0 3px rgba(255, 255, 255, 0.42);
123
+ color: #fff;
124
+ font: inherit;
125
+ font-size: 14px;
126
+ font-weight: 600;
127
+ cursor: pointer;
128
+ pointer-events: auto;
129
+ animation-delay: 0.06s;
130
+ }
131
+
132
+ .media-retry:focus-visible {
133
+ outline: 2px solid #fff;
134
+ outline-offset: 2px;
135
+ }
136
+
137
+ @media (hover: hover) and (pointer: fine) {
138
+ .media-retry:hover {
139
+ background: rgba(255, 255, 255, 0.25);
140
+ }
141
+ }
142
+
143
+ /* It spins with reduced motion too: a still ring wouldn't read as
144
+ loading. */
145
+ .media-spinner {
146
+ width: 24px;
147
+ height: 24px;
148
+ box-sizing: border-box;
149
+ border: 2px solid rgba(255, 255, 255, 0.35);
150
+ border-top-color: #fff;
151
+ border-radius: 50%;
152
+ animation: media-spin 0.8s linear infinite;
153
+ }
154
+
155
+ @keyframes media-status-in {
156
+ from {
157
+ opacity: 0;
158
+ transform: translateY(4px);
159
+ }
160
+ }
161
+
162
+ @keyframes media-spin {
163
+ to {
164
+ transform: rotate(360deg);
165
+ }
166
+ }
167
+
168
+ @media (prefers-reduced-motion: reduce) {
169
+ .media-status > :not(.media-spinner) {
170
+ animation: none;
171
+ }
172
+ }
173
+ `;function X(o){var e;(e=o.play())==null||e.catch(()=>{})}var z=class{constructor(e){this.host=e;this.ref=k();this.paused=!0;this.muted=!0;this.status="playable";this.sync=()=>{let e=this.ref.value;e&&(this.paused=e.paused,this.muted=e.muted,this.host.requestUpdate())};this.loaded=()=>{this.settleReady(!0),this.retrying&&(this.status="playable",this.host.requestUpdate())};this.fail=()=>{this.status="failed",this.settleReady(!1),this.host.requestUpdate()};this.waitForReady()}get ready(){return this.readyState}get failed(){return this.status==="failed"}get retrying(){return this.status==="retrying"}get playing(){let e=this.ref.value;return!!e&&e.isConnected&&!e.paused}reset(){this.cancelRetry(),this.paused=!0,this.muted=!0,this.status="playable",this.waitForReady()}clearFailure(){this.retrying&&(this.cancelRetry(),this.waitForReady()),this.status="playable",this.host.requestUpdate()}retry(){return this.retrying?this.ready:this.failed?(this.reset(),this.status="retrying",this.host.requestUpdate(),this.ready):Promise.resolve(!1)}play(){let e=this.ref.value;e&&X(e)}pause(){var e;(e=this.ref.value)==null||e.pause()}resume(){let e=this.ref.value;e!=null&&e.autoplay&&X(e)}togglePlayback(){let e=this.ref.value;e&&(e.paused?X(e):e.pause())}mute(){let e=this.ref.value;e&&(e.muted=!0)}restart({withSound:e=!1}={}){let t=this.ref.value;t&&(t.currentTime=0,e?this.playWithSound():X(t))}playWithSound(){var t;let e=this.ref.value;e&&(e.muted=!1,(t=e.play())==null||t.catch(r=>{!(r instanceof DOMException&&r.name==="NotAllowedError")||this.ref.value!==e||!e.isConnected||(e.muted=!0,X(e))}))}toggleMuted(){let e=this.ref.value;e&&(e.muted=!e.muted)}cancelRetry(){this.retrying&&this.settleReady(!1)}waitForReady(){this.readyState=new Promise(e=>this.settleReady=e)}};var Pe="pt-BR";function pr(o){let e=Number.NaN;return typeof o=="number"?e=o:typeof o=="string"&&o.trim()!==""&&(e=Number(o)),Number.isFinite(e)&&e>0?e:void 0}function Xe(o){let e=pr(o==null?void 0:o.price),t=pr(o==null?void 0:o.promotional_price);return t!==void 0&&(e===void 0||t<e)?e===void 0?{price:t}:{price:t,listPrice:e}:e===void 0?void 0:{price:e}}function Wo(o){try{return Intl.NumberFormat.supportedLocalesOf(o).length>0}catch(e){return!1}}var Ke=Intl;function jo(o){var t;if(!/^[a-z]{3}$/i.test(o))return!1;let e=(t=Ke.supportedValuesOf)==null?void 0:t.call(Ke,"currency");return e?e.includes(o.toUpperCase()):!0}function Ye(o,e){let t=new Intl.NumberFormat(o&&Wo(o)?o:Pe,{style:"currency",currency:e&&jo(e)?e:"BRL"});return r=>t.format(r)}function Je(o,e,t,r){var h,m,y,A,S,W;let i=o.product,s=(h=i==null?void 0:i.product_name)==null?void 0:h.trim();if(!i||!s)return;let n={name:s,imageUrl:(m=b(i.image_url))!=null?m:void 0,url:(y=Te(o.destination_url))!=null?y:void 0,sku:((A=i.product_sku)==null?void 0:A.trim())||void 0,seller:((S=i.seller_id)==null?void 0:S.trim())||void 0};if(r==="loading")return{...n,label:t.product(s),isLoading:!0};let a=(r==null?void 0:r.available)===!1?t.soldOut:void 0,d=V=>a&&(V==null?void 0:V.price)===0?void 0:V,l=(W=d(r==null?void 0:r.price))!=null?W:d(Xe(i.product_metadata)),p=l&&e(l.price),c=(l==null?void 0:l.listPrice)===void 0?void 0:e(l.listPrice);return{...n,price:p,listPrice:c,soldOut:a,label:t.product(s,p,c,a)}}var Go=f`
34
174
  <span
35
175
  class="product-price product-loading product-price-loading"
36
176
  aria-hidden="true"
37
177
  ></span>
38
- `,yo=m`
178
+ `,Zo=f`
39
179
  <span
40
180
  class="product-loading product-add-to-cart-loading"
41
181
  aria-hidden="true"
42
182
  ></span>
43
- `;function vo({isLoading:o,soldOut:e,price:t,listPrice:r}){return o?mo:e?m`<span class="product-price product-sold-out">${e}</span>`:t?m`
183
+ `;function Qo({isLoading:o,soldOut:e,price:t,listPrice:r}){return o?Go:t?f`
44
184
  <span class="product-price">
45
185
  <span>${t}</span>
46
- ${r?m`<s class="product-list-price">${r}</s>`:f}
186
+ ${r?f`<s class="product-list-price">${r}</s>`:u}
47
187
  </span>
48
- `:f}function Qt(o){return m`
49
- ${o.imageUrl?m`<img class="product-image" alt="" src=${o.imageUrl} />`:f}
188
+ `:e?f`<span class="product-price product-sold-out">${e}</span>`:u}function ur(o){return f`
189
+ ${o.imageUrl?f`<img class="product-image" alt="" src=${o.imageUrl} />`:u}
50
190
  <span class="product-info">
51
191
  <span class="product-name">${o.name}</span>
52
- ${vo(o)}
192
+ ${Qo(o)}
53
193
  </span>
54
- `}function Ze(o,e){return m`
194
+ `}function et(o,e){return f`
55
195
  <button
56
196
  type="button"
57
197
  class="card-product"
58
198
  aria-label=${o.label}
59
199
  @click=${e}
60
200
  >
61
- ${Qt(o)}
201
+ ${ur(o)}
62
202
  </button>
63
- `}function go({isLoading:o,soldOut:e},{labels:t}){return o?yo:e?m`
203
+ `}var hr="product-stepper-add",fr="product-add-to-cart";function tt(o,e){var r;let t=e==="stepper"?hr:fr;(r=o.querySelector(`.${t}`))==null||r.focus()}function Ko(o,{labels:e,onAddToCart:t,onRemoveFromCart:r}){let i=o===1;return f`
204
+ <div
205
+ class="product-action product-stepper"
206
+ role="group"
207
+ aria-label=${e.cartQuantity}
208
+ >
209
+ <button
210
+ type="button"
211
+ class="product-stepper-button product-stepper-remove"
212
+ aria-label=${i?e.removeFromCart:e.decreaseQuantity}
213
+ @click=${r}
214
+ >
215
+ ${v(i?"trash":"minus")}
216
+ </button>
217
+ <span class="product-quantity">${o}</span>
218
+ <button
219
+ type="button"
220
+ class="product-stepper-button ${hr}"
221
+ aria-label=${e.increaseQuantity}
222
+ @click=${t}
223
+ >
224
+ ${v("plus")}
225
+ </button>
226
+ </div>
227
+ `}function Xo({isLoading:o,soldOut:e,sku:t},r){let{labels:i,onAddToCart:s,cartQuantity:n=0}=r;return!t||!s?u:o?Zo:e?f`
64
228
  <button type="button" class="product-action product-unavailable" disabled>
65
- ${t.unavailable}
229
+ ${i.unavailable}
66
230
  </button>
67
- `:m`
68
- <button type="button" class="product-action product-add-to-cart">
69
- ${t.addToCart}
231
+ `:n>0?Ko(n,r):f`
232
+ <button
233
+ type="button"
234
+ class="product-action ${fr}"
235
+ @click=${s}
236
+ >
237
+ ${i.addToCart}
70
238
  </button>
71
- `}function Xe(o,e){let{open:t}=e;return m`
239
+ `}function Yo({sku:o},{labels:e,cartQuantity:t=0,onAddToCart:r}){return!o||!r?u:f`
240
+ <span class="product-cart-status" role="status">
241
+ ${t>0?`${e.cartQuantity}: ${t}`:""}
242
+ </span>
243
+ `}function rt(o,e){let{open:t}=e;return f`
72
244
  <div class="card-product product-expandable" ?data-open=${t}>
73
245
  <button
74
246
  type="button"
@@ -78,13 +250,14 @@
78
250
  aria-controls=${e.panelId}
79
251
  @click=${e.onToggle}
80
252
  >
81
- ${Qt(o)}
253
+ ${ur(o)}
82
254
  <span class="product-toggle">${v("caretUp")}</span>
83
255
  </button>
84
256
  <div id=${e.panelId} class="product-panel" ?inert=${!t}>
85
257
  <div class="product-actions">
86
- ${go(o,e)}
87
- ${o.url?m`
258
+ ${Yo(o,e)}
259
+ ${Xo(o,e)}
260
+ ${o.url?f`
88
261
  <a
89
262
  class="product-action product-view"
90
263
  href=${o.url}
@@ -93,11 +266,11 @@
93
266
  >
94
267
  ${e.labels.viewProduct}
95
268
  </a>
96
- `:f}
269
+ `:u}
97
270
  </div>
98
271
  </div>
99
272
  </div>
100
- `}function Ae(o){var r;if(o.product)return;let e=(r=o.call_to_action)==null?void 0:r.trim(),t=w(o.destination_url);return e&&t?{label:e,url:t}:void 0}function se(o,e){let t=e?r=>{r.preventDefault(),e()}:void 0;return m`
273
+ `}function ke(o){var r;if(o.product)return;let e=(r=o.call_to_action)==null?void 0:r.trim(),t=Te(o.destination_url);return e&&t?{label:e,url:t}:void 0}function pe(o,e){let t=e?r=>{r.preventDefault(),e()}:void 0;return f`
101
274
  <a
102
275
  class="card-cta"
103
276
  href=${o.url}
@@ -108,7 +281,7 @@
108
281
  <span class="cta-label">${o.label}</span>
109
282
  ${v("next")}
110
283
  </a>
111
- `}var Ye=g`
284
+ `}var ot=g`
112
285
  /* A glass pill at the bottom of the card, above its button: the product or
113
286
  the call to action. */
114
287
  .card-product,
@@ -122,9 +295,9 @@
122
295
  gap: 8px;
123
296
  align-items: center;
124
297
  box-sizing: border-box;
125
- padding: 8px;
298
+ padding: var(--_pill-inset);
126
299
  border: 0;
127
- border-radius: 16px;
300
+ border-radius: var(--_pill-radius);
128
301
  background: rgba(255, 255, 255, 0.15);
129
302
  backdrop-filter: blur(5px);
130
303
  color: #fff;
@@ -219,7 +392,7 @@
219
392
  align-items: center;
220
393
  box-sizing: border-box;
221
394
  width: 100%;
222
- padding: 8px;
395
+ padding: var(--_pill-inset);
223
396
  border: 0;
224
397
  border-radius: inherit;
225
398
  background: transparent;
@@ -282,7 +455,7 @@
282
455
  height: 48px;
283
456
  padding: 0 16px;
284
457
  border: 1px solid var(--vtex-ads-story-color-accent, #1b75a8);
285
- border-radius: 50px;
458
+ border-radius: var(--_button-radius);
286
459
  font: inherit;
287
460
  font-size: 14px;
288
461
  font-weight: 700;
@@ -309,6 +482,62 @@
309
482
  );
310
483
  }
311
484
 
485
+ /* In the cart: the add to cart button's pill, with minus and plus at its
486
+ ends and the quantity between them. */
487
+ .product-stepper {
488
+ justify-content: space-between;
489
+ padding: 0;
490
+ background: var(--vtex-ads-story-color-accent, #1b75a8);
491
+ color: var(--vtex-ads-story-color-accent-contrast, #fff);
492
+ cursor: auto;
493
+ }
494
+
495
+ .product-stepper-button {
496
+ display: grid;
497
+ flex: none;
498
+ place-items: center;
499
+ width: 46px;
500
+ height: 46px;
501
+ padding: 0;
502
+ border: 0;
503
+ border-radius: var(--_button-radius);
504
+ background: transparent;
505
+ color: inherit;
506
+ cursor: pointer;
507
+ transition: background-color 0.2s ease;
508
+ }
509
+
510
+ .product-stepper-button .icon {
511
+ width: 18px;
512
+ height: 18px;
513
+ }
514
+
515
+ .product-stepper-button:hover {
516
+ background: rgba(0, 0, 0, 0.15);
517
+ }
518
+
519
+ .product-stepper-button:focus-visible {
520
+ outline: 2px solid var(--vtex-ads-story-color-accent-contrast, #fff);
521
+ outline-offset: -4px;
522
+ }
523
+
524
+ .product-quantity {
525
+ flex: 1;
526
+ min-width: 0;
527
+ font-size: 16px;
528
+ text-align: center;
529
+ }
530
+
531
+ .product-cart-status {
532
+ position: absolute;
533
+ width: 1px;
534
+ height: 1px;
535
+ margin: -1px;
536
+ overflow: hidden;
537
+ clip-path: inset(50%);
538
+ white-space: nowrap;
539
+ }
540
+
312
541
  /* Sold out: add to cart, disabled and grayed. */
313
542
  .product-unavailable {
314
543
  border-color: transparent;
@@ -398,11 +627,12 @@
398
627
  }
399
628
  }
400
629
 
630
+ /* Its corners follow the pill's, one inset in from them: 8px by default. */
401
631
  .product-image {
402
632
  flex: none;
403
633
  width: 60px;
404
634
  height: 60px;
405
- border-radius: 8px;
635
+ border-radius: max(0px, var(--_pill-radius) - var(--_pill-inset));
406
636
  background: #fff;
407
637
  object-fit: contain;
408
638
  }
@@ -466,7 +696,7 @@
466
696
  .product-add-to-cart-loading {
467
697
  display: block;
468
698
  height: 48px;
469
- border-radius: 50px;
699
+ border-radius: var(--_button-radius);
470
700
  }
471
701
 
472
702
  @media (prefers-reduced-motion: reduce) {
@@ -474,7 +704,7 @@
474
704
  animation: none;
475
705
  }
476
706
  }
477
- `;var Qe=g`
707
+ `;var it=g`
478
708
  /* 9:16 at the height its container gives it (--card-height, default
479
709
  500px). */
480
710
  .card {
@@ -582,7 +812,7 @@
582
812
  transform: translate(-50%, -50%);
583
813
  }
584
814
  }
585
- `;function bo(o,e){return m`
815
+ `;function Jo(o,e){return f`
586
816
  <button
587
817
  type="button"
588
818
  class="card-sound"
@@ -591,42 +821,42 @@
591
821
  >
592
822
  ${v(o.muted?"soundOff":"soundOn")}
593
823
  </button>
594
- `}function Je(o,e,t){var i,s;let r=(i=t.withVideo)!=null?i:!0;return m`
824
+ `}function st(o,e,t){var i,s;let r=(i=t.withVideo)!=null?i:!0;return f`
595
825
  <div
596
826
  class="card"
597
- ${x(t.ref)}
827
+ ${$(t.ref)}
598
828
  @click=${{handleEvent:()=>{var n;return(n=t.onPress)==null?void 0:n.call(t)},capture:!0}}
599
829
  >
600
- ${ie(o,e,{withVideo:r})}
830
+ ${ce(o,e,{withVideo:r,autoplay:t.autoplay,labels:t.labels,announce:!1})}
601
831
  <button
602
832
  type="button"
603
833
  class="card-open"
604
- ${x(t.openRef)}
834
+ ${$(t.openRef)}
605
835
  aria-label=${t.label}
606
836
  @click=${t.onSelect}
607
837
  >
608
- <span class="play" aria-hidden="true">${v("play")}</span>
838
+ ${r&&e.failed?u:f`<span class="play" aria-hidden="true">${v("play")}</span>`}
609
839
  </button>
610
- ${r&&q(o,e)&&!e.paused?bo(e,t):f}
611
- ${t.product?Ze(t.product,(s=t.onProductSelect)!=null?s:t.onSelect):f}
612
- ${t.cta?se(t.cta,t.onCtaSelect):f}
840
+ ${r&&K(o,e)&&!e.paused?Jo(e,t):u}
841
+ ${t.product?et(t.product,(s=t.onProductSelect)!=null?s:t.onSelect):u}
842
+ ${t.cta?pe(t.cta,t.onCtaSelect):u}
613
843
  </div>
614
- `}var Jt=(o,e,t)=>{let r=new Map;for(let i=e;i<=t;i++)r.set(o[i],i);return r},_e=E(class extends S{constructor(o){if(super(o),o.type!==M.CHILD)throw Error("repeat() can only be used in text expressions")}dt(o,e,t){let r;t===void 0?t=e:e!==void 0&&(r=e);let i=[],s=[],n=0;for(let a of o)i[n]=r?r(a,n):n,s[n]=t(a,n),n++;return{values:s,keys:i}}render(o,e,t){return this.dt(o,e,t).values}update(o,[e,t,r]){var L;let i=Vt(o),{values:s,keys:n}=this.dt(e,t,r);if(!Array.isArray(i))return this.ut=n,s;let a=(L=this.ut)!=null?L:this.ut=[],d=[],l,p,c=0,h=i.length-1,u=0,y=s.length-1;for(;c<=h&&u<=y;)if(i[c]===null)c++;else if(i[h]===null)h--;else if(a[c]===n[u])d[u]=O(i[c],s[u]),c++,u++;else if(a[h]===n[y])d[y]=O(i[h],s[y]),h--,y--;else if(a[c]===n[y])d[y]=O(i[c],s[y]),z(o,d[y+1],i[c]),c++,y--;else if(a[h]===n[u])d[u]=O(i[h],s[u]),z(o,i[c],i[h]),h--,u++;else if(l===void 0&&(l=Jt(n,u,y),p=Jt(a,c,h)),l.has(a[c]))if(l.has(a[h])){let A=p.get(n[u]),ke=A!==void 0?i[A]:null;if(ke===null){let dt=z(o,i[c]);O(dt,s[u]),d[u]=dt}else d[u]=O(ke,s[u]),z(o,i[c],ke),i[A]=null;u++}else be(i[h]),h--;else be(i[c]),c++;for(;u<=y;){let A=z(o,d[y+1]);O(A,s[u]),d[u++]=A}for(;c<=h;){let A=i[c++];A!==null&&be(A)}return this.ut=n,Ht(o,d),b}});var er="important",xo=" !"+er,W=E(class extends S{constructor(o){var e;if(super(o),o.type!==M.ATTRIBUTE||o.name!=="style"||((e=o.strings)==null?void 0:e.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(o){return Object.keys(o).reduce((e,t)=>{let r=o[t];return r==null?e:e+`${t=t.includes("-")?t:t.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${r};`},"")}update(o,[e]){let{style:t}=o.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(e)),this.render(e);for(let r of this.ft)e[r]==null&&(this.ft.delete(r),r.includes("-")?t.removeProperty(r):t[r]=null);for(let r in e){let i=e[r];if(i!=null){this.ft.add(r);let s=typeof i=="string"&&i.endsWith(xo);r.includes("-")||s?t.setProperty(r,s?i.slice(0,-11):i,s?er:""):t[r]=i}}return b}});var G=g`500px`,tr=g`24px`,ir=5e3,sr=40,et=g`(max-width: 576px)`,tt=2,ne=tt+3,rt=g`
844
+ `}var mr=(o,e,t)=>{let r=new Map;for(let i=e;i<=t;i++)r.set(o[i],i);return r},Me=P(class extends _{constructor(o){if(super(o),o.type!==I.CHILD)throw Error("repeat() can only be used in text expressions")}dt(o,e,t){let r;t===void 0?t=e:e!==void 0&&(r=e);let i=[],s=[],n=0;for(let a of o)i[n]=r?r(a,n):n,s[n]=t(a,n),n++;return{values:s,keys:i}}render(o,e,t){return this.dt(o,e,t).values}update(o,[e,t,r]){var A;let i=qt(o),{values:s,keys:n}=this.dt(e,t,r);if(!Array.isArray(i))return this.ut=n,s;let a=(A=this.ut)!=null?A:this.ut=[],d=[],l,p,c=0,h=i.length-1,m=0,y=s.length-1;for(;c<=h&&m<=y;)if(i[c]===null)c++;else if(i[h]===null)h--;else if(a[c]===n[m])d[m]=O(i[c],s[m]),c++,m++;else if(a[h]===n[y])d[y]=O(i[h],s[y]),h--,y--;else if(a[c]===n[y])d[y]=O(i[c],s[y]),G(o,d[y+1],i[c]),c++,y--;else if(a[h]===n[m])d[m]=O(i[h],s[m]),G(o,i[c],i[h]),h--,m++;else if(l===void 0&&(l=mr(n,m,y),p=mr(a,c,h)),l.has(a[c]))if(l.has(a[h])){let S=p.get(n[m]),W=S!==void 0?i[S]:null;if(W===null){let V=G(o,i[c]);O(V,s[m]),d[m]=V}else d[m]=O(W,s[m]),G(o,i[c],W),i[S]=null;m++}else _e(i[h]),h--;else _e(i[c]),c++;for(;m<=y;){let S=G(o,d[y+1]);O(S,s[m]),d[m++]=S}for(;c<=h;){let S=i[c++];S!==null&&_e(S)}return this.ut=n,Bt(o,d),w}});var yr="important",ei=" !"+yr,L=P(class extends _{constructor(o){var e;if(super(o),o.type!==I.ATTRIBUTE||o.name!=="style"||((e=o.strings)==null?void 0:e.length)>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(o){return Object.keys(o).reduce((e,t)=>{let r=o[t];return r==null?e:e+`${t=t.includes("-")?t:t.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${r};`},"")}update(o,[e]){let{style:t}=o.element;if(this.ft===void 0)return this.ft=new Set(Object.keys(e)),this.render(e);for(let r of this.ft)e[r]==null&&(this.ft.delete(r),r.includes("-")?t.removeProperty(r):t[r]=null);for(let r in e){let i=e[r];if(i!=null){this.ft.add(r);let s=typeof i=="string"&&i.endsWith(ei);r.includes("-")||s?t.setProperty(r,s?i.slice(0,-11):i,s?yr:""):t[r]=i}}return w}});var C=g`500px`,vr=g`24px`,xr=5e3,wr=2e3,$r=12e4,Sr=o=>o===void 0||!Number.isFinite(o)||o<0?xr:o===0?0:Math.min(Math.max(o,wr),$r),Ar=40,nt=g`(max-width: 576px)`,Y=2,ue=Y+3,at=g`
615
845
  .carousel {
616
846
  position: relative;
617
847
  box-sizing: border-box;
618
848
  display: grid;
619
- height: ${G};
849
+ height: ${C};
620
850
  place-items: center;
621
- --card-height: ${G};
851
+ --card-height: ${C};
622
852
  user-select: none;
623
853
  }
624
854
 
625
855
  .carousel[data-layout="solo"] {
626
- padding: ${tr};
856
+ padding: ${vr};
627
857
  border-radius: var(--vtex-ads-story-radius, 20px);
628
858
  background: var(--vtex-ads-story-color-surface, #fafafa);
629
- --card-height: calc(${G} - 2 * ${tr});
859
+ --card-height: calc(${C} - 2 * ${vr});
630
860
  }
631
861
 
632
862
  .carousel[data-layout="solo"] .card {
@@ -647,9 +877,9 @@
647
877
  position: absolute;
648
878
  top: 0;
649
879
  left: 50%;
650
- width: calc(${G} * 9 / 16);
880
+ width: calc(${C} * 9 / 16);
651
881
  height: 100%;
652
- margin-left: calc(${G} * 9 / -32);
882
+ margin-left: calc(${C} * 9 / -32);
653
883
  opacity: 0.5;
654
884
  transition:
655
885
  transform var(--duration) var(--ease),
@@ -748,11 +978,11 @@
748
978
  right: 3px;
749
979
  }
750
980
 
751
- @media ${et} {
981
+ @media ${nt} {
752
982
  .carousel[data-layout="solo"] {
753
983
  padding: 0;
754
984
  background: none;
755
- --card-height: ${G};
985
+ --card-height: ${C};
756
986
  }
757
987
 
758
988
  .carousel[data-layout="solo"] .card {
@@ -766,22 +996,22 @@
766
996
  transition: none;
767
997
  }
768
998
  }
769
- `,rr=(o,e)=>(o%e+e)%e;function or(o,e){let t;return r=>{t&&o.delete(t),t=r,r&&o.set(r,e)}}var ae=class{constructor(e,t){this.host=e;this.options=t;this.position=0;this.distance=1;this.count=0;this.narrow=!1;this.connected=!1;this.hovered=!1;this.focused=!1;this.cards=new Map;this.focusTargets=new Map;this.onMediaChange=e=>{var r,i;let t=this.layout;this.narrow=e.matches,this.layout!==t&&((i=(r=this.options).onLayoutChange)==null||i.call(r),this.host.requestUpdate())};this.onPointerEnter=()=>{this.hovered=!0,this.syncTimer()};this.onPointerLeave=()=>{this.hovered=!1,this.syncTimer()};this.onFocusIn=e=>{this.focused=e.target.matches(":focus-visible"),this.syncTimer()};this.onFocusOut=e=>{let t=e.currentTarget,r=e.relatedTarget;(!r||!t.contains(r))&&(this.focused=!1),this.syncTimer()};this.onPointerDown=e=>{this.endSwipe(),this.swipe={x:e.clientX,moved:!1},globalThis.addEventListener("pointerup",this.onPointerUp),globalThis.addEventListener("pointercancel",this.onPointerCancel)};this.onPointerUp=e=>{let{swipe:t}=this;if(this.removeSwipeListeners(),!t)return;let r=e.clientX-t.x;Math.abs(r)>sr&&(t.moved=!0,this.step(r<0?1:-1))};this.onPointerCancel=()=>this.endSwipe();this.onClickCapture={handleEvent:e=>{var t;(t=this.swipe)!=null&&t.moved&&(e.stopPropagation(),e.preventDefault()),this.swipe=void 0},capture:!0};e.addController(this)}get active(){return this.count?rr(this.position,this.count):0}get layout(){return this.count<2?"solo":this.count===2&&!this.narrow?"pair":"rolling"}get activeKey(){return this.layout==="rolling"?this.position:this.active}*visibleCards(){for(let[e,t]of this.cards)t.hidden||(yield[e,t])}focusActive(){for(let[e,t]of this.focusTargets)if(t.active&&e instanceof HTMLElement){e.focus();return}}hostConnected(){var e,t,r,i;this.connected=!0,this.media=(e=globalThis.matchMedia)==null?void 0:e.call(globalThis,et.toString()),(t=this.media)==null||t.addEventListener("change",this.onMediaChange),this.narrow=(i=(r=this.media)==null?void 0:r.matches)!=null?i:!1,this.syncTimer()}hostDisconnected(){var e;this.connected=!1,(e=this.media)==null||e.removeEventListener("change",this.onMediaChange),this.media=void 0,this.endSwipe(),this.syncTimer()}hostUpdated(){this.syncTimer()}reset(e){this.count=e,this.position=0,this.distance=1,this.hovered=!1,this.focused=!1,this.restartTimer()}step(e,{evenIfLocked:t=!1}={}){var i,s,n,a;if(this.count<2||e===0||(s=(i=this.options).locked)!=null&&s.call(i)&&!t)return;let r=this.activeKey;this.position+=e,this.distance=Math.abs(e),this.host.requestUpdate(),(a=(n=this.options).onStep)==null||a.call(n,r,this.activeKey),this.restartTimer()}get shouldAdvance(){var e,t;return this.connected&&this.count>1&&!this.hovered&&!this.focused&&!((t=(e=this.options).locked)!=null&&t.call(e))}syncTimer(){this.shouldAdvance&&!this.timer?this.timer=setInterval(()=>this.step(1),ir):!this.shouldAdvance&&this.timer&&this.stopTimer()}stopTimer(){clearInterval(this.timer),this.timer=void 0}restartTimer(){this.stopTimer(),this.syncTimer()}endSwipe(){this.removeSwipeListeners(),this.swipe=void 0}removeSwipeListeners(){globalThis.removeEventListener("pointerup",this.onPointerUp),globalThis.removeEventListener("pointercancel",this.onPointerCancel)}slide(e){let t={...e,cardRef:s=>r(s),focusRef:s=>i(s)},r=or(this.cards,t),i=or(this.focusTargets,t);return t}pairSlides(){let{active:e}=this;return[0,1].map(t=>this.slide({key:t,index:t,offset:t-e,active:t===e,hidden:!1}))}rollingSlides(){let{count:e}=this,t=e===2||e===4,r=t?e/2:Math.floor((e-1)/2),i=t?e/2:e-1-r,s=[];for(let n=-ne;n<=ne;n+=1)s.push(this.slide({key:this.position+n,index:rr(this.position+n,e),offset:n,active:n===0,hidden:Math.abs(n)>tt||n<-r||n>i}));return s}renderSlides(e,t){let{layout:r}=this,i=r==="pair"?this.pairSlides():this.rollingSlides();return _e(i,s=>`${r}:${s.key}`,s=>{let{index:n}=s;return m`
999
+ `,gr=(o,e)=>(o%e+e)%e;function br(o,e){let t;return r=>{t&&o.delete(t),t=r,r&&o.set(r,e)}}var he=class{constructor(e,t){this.host=e;this.options=t;this.position=0;this.distance=1;this.count=0;this.narrow=!1;this.reducedMotion=!1;this.connected=!1;this.hovered=!1;this.focused=!1;this.timerMs=0;this.cards=new Map;this.focusTargets=new Map;this.onMediaChange=e=>{var r,i;let t=this.layout;this.narrow=e.matches,this.layout!==t&&((i=(r=this.options).onLayoutChange)==null||i.call(r),this.host.requestUpdate())};this.onPointerEnter=()=>{this.hovered=!0,this.syncTimer()};this.onPointerLeave=()=>{this.hovered=!1,this.syncTimer()};this.onFocusIn=e=>{this.focused=e.target.matches(":focus-visible"),this.syncTimer()};this.onFocusOut=e=>{let t=e.currentTarget,r=e.relatedTarget;(!r||!t.contains(r))&&(this.focused=!1),this.syncTimer()};this.onPointerDown=e=>{this.endSwipe(),this.swipe={x:e.clientX,moved:!1},globalThis.addEventListener("pointerup",this.onPointerUp),globalThis.addEventListener("pointercancel",this.onPointerCancel)};this.onPointerUp=e=>{let{swipe:t}=this;if(this.removeSwipeListeners(),!t)return;let r=e.clientX-t.x;Math.abs(r)>Ar&&(t.moved=!0,this.step(r<0?1:-1))};this.onPointerCancel=()=>this.endSwipe();this.onClickCapture={handleEvent:e=>{var t;(t=this.swipe)!=null&&t.moved&&(e.stopPropagation(),e.preventDefault()),this.swipe=void 0},capture:!0};e.addController(this)}get active(){return this.count?gr(this.position,this.count):0}get layout(){return this.count<2?"solo":this.count===2&&!this.narrow?"pair":"rolling"}get activeKey(){return this.layout==="rolling"?this.position:this.active}*visibleCards(){for(let[e,t]of this.cards)t.hidden||(yield[e,t])}focusActive(){for(let[e,t]of this.focusTargets)if(t.active&&e instanceof HTMLElement){e.focus();return}}hostConnected(){var e,t,r,i,s,n,a;this.connected=!0,this.media=(e=globalThis.matchMedia)==null?void 0:e.call(globalThis,nt.toString()),(t=this.media)==null||t.addEventListener("change",this.onMediaChange),this.narrow=(i=(r=this.media)==null?void 0:r.matches)!=null?i:!1,this.reducedMotion=(a=(n=(s=this.options).reducedMotion)==null?void 0:n.call(s))!=null?a:!1,this.syncTimer()}hostDisconnected(){var e;this.connected=!1,(e=this.media)==null||e.removeEventListener("change",this.onMediaChange),this.media=void 0,this.endSwipe(),this.syncTimer()}hostUpdated(){this.syncTimer()}reset(e){this.count=e,this.position=0,this.distance=1,this.hovered=!1,this.focused=!1,this.restartTimer()}step(e,{evenIfLocked:t=!1}={}){var i,s,n,a;if(this.count<2||e===0||(s=(i=this.options).locked)!=null&&s.call(i)&&!t)return;let r=this.activeKey;this.position+=e,this.distance=Math.abs(e),this.host.requestUpdate(),(a=(n=this.options).onStep)==null||a.call(n,r,this.activeKey),this.restartTimer()}get slideDuration(){var e,t;return Sr((t=(e=this.options).slideDuration)==null?void 0:t.call(e))}get shouldAdvance(){var e,t;return this.slideDuration>0&&!this.reducedMotion&&this.connected&&this.count>1&&!this.hovered&&!this.focused&&!((t=(e=this.options).locked)!=null&&t.call(e))}syncTimer(){let e=this.slideDuration;this.timer&&this.timerMs!==e&&this.stopTimer(),this.shouldAdvance&&!this.timer?(this.timerMs=e,this.timer=setInterval(()=>this.step(1),e)):!this.shouldAdvance&&this.timer&&this.stopTimer()}stopTimer(){clearInterval(this.timer),this.timer=void 0,this.timerMs=0}restartTimer(){this.stopTimer(),this.syncTimer()}endSwipe(){this.removeSwipeListeners(),this.swipe=void 0}removeSwipeListeners(){globalThis.removeEventListener("pointerup",this.onPointerUp),globalThis.removeEventListener("pointercancel",this.onPointerCancel)}slide(e){let t={...e,cardRef:s=>r(s),focusRef:s=>i(s)},r=br(this.cards,t),i=br(this.focusTargets,t);return t}pairSlides(){let{active:e}=this;return[0,1].map(t=>this.slide({key:t,index:t,offset:t-e,active:t===e,hidden:!1}))}rollingSlides(){let{count:e}=this,t=e===2||e===4,r=t?e/2:Math.floor((e-1)/2),i=t?e/2:e-1-r,s=[];for(let n=-ue;n<=ue;n+=1)s.push(this.slide({key:this.position+n,index:gr(this.position+n,e),offset:n,active:n===0,hidden:Math.abs(n)>Y||n<-r||n>i}));return s}renderSlides(e,t){let{layout:r}=this,i=r==="pair"?this.pairSlides():this.rollingSlides();return Me(i,s=>`${r}:${s.key}`,s=>{let{index:n}=s;return f`
770
1000
  <div
771
1001
  class="slide"
772
1002
  data-index=${n}
773
1003
  ?data-active=${s.active}
774
1004
  ?data-hidden=${s.hidden}
775
1005
  ?inert=${s.hidden}
776
- style=${W({"--place":String(s.offset)})}
1006
+ style=${L({"--place":String(s.offset)})}
777
1007
  >
778
1008
  ${t(e[n],s)}
779
1009
  </div>
780
- `})}render(e,t,r){var s,n,a;if(this.layout==="solo")return m`
1010
+ `})}render(e,t,r){var s,n,a;if(this.layout==="solo")return f`
781
1011
  <div class="carousel" data-layout="solo">
782
1012
  ${t(e[0],this.slide({key:0,index:0,offset:0,active:!0,hidden:!1}))}
783
1013
  </div>
784
- `;let i=(a=(n=(s=this.options).locked)==null?void 0:n.call(s))!=null?a:!1;return m`
1014
+ `;let i=(a=(n=(s=this.options).locked)==null?void 0:n.call(s))!=null?a:!1;return f`
785
1015
  <div
786
1016
  class="carousel"
787
1017
  data-layout=${this.layout}
@@ -795,7 +1025,7 @@
795
1025
  >
796
1026
  <div
797
1027
  class="track"
798
- style=${W({"--slide-duration":this.distance>1?"0.52s":"0.4s"})}
1028
+ style=${L({"--slide-duration":this.distance>1?"0.52s":"0.4s"})}
799
1029
  @pointerdown=${this.onPointerDown}
800
1030
  @click=${this.onClickCapture}
801
1031
  >
@@ -820,7 +1050,94 @@
820
1050
  ${v("next")}
821
1051
  </button>
822
1052
  </div>
823
- `}};var $="vtex-ads-story-carousel";var nr="text/plain;charset=utf-8";function ar(o,{sessionId:e,userId:t}){var s,n;let r=w(o);if(!r||globalThis.window===void 0)return!1;let i=JSON.stringify(t?{session_id:e,user_id:t}:{session_id:e});try{if((n=(s=globalThis.navigator)==null?void 0:s.sendBeacon)==null?void 0:n.call(s,r,new Blob([i],{type:nr})))return!0}catch(a){}return typeof globalThis.fetch!="function"?!1:(globalThis.fetch(r,{method:"POST",headers:{"Content-Type":nr},body:i,keepalive:!0,credentials:"omit"}).catch(a=>{console.error(`[${$}] Event request failed`,{url:r,error:a})}),!0)}var ot=.5,dr=2e3,wo={impression:"impression_url",view:"view_url",click:"click_url"},de=class{constructor(e,t){this.host=e;this.options=t;this.sent={impression:new Set,view:new Set,click:new Set};this.pendingImpressions=[];this.watched=new Map;this.onIntersect=e=>{for(let t of e){let r=this.watched.get(t.target);r&&(r.visible=t.isIntersecting&&t.intersectionRatio>=ot,r.visible?this.startTimer(r):this.stopTimer(r))}};this.onVisibilityChange=()=>{for(let e of this.watched.values())document.hidden?this.stopTimer(e):e.visible&&this.startTimer(e)};e.addController(this)}hostConnected(){var e;typeof IntersectionObserver=="function"&&(this.observer=new IntersectionObserver(this.onIntersect,{threshold:ot})),(e=globalThis.document)==null||e.addEventListener("visibilitychange",this.onVisibilityChange),this.host.updateComplete.then(()=>this.syncViewTargets())}hostDisconnected(){var e,t;(e=globalThis.document)==null||e.removeEventListener("visibilitychange",this.onVisibilityChange),(t=this.observer)==null||t.disconnect(),this.observer=void 0;for(let r of this.watched.values())clearTimeout(r.timer);this.watched.clear(),this.pendingImpressions=[]}hostUpdated(){let e=this.pendingImpressions;if(e.length&&this.options.identity().sessionId){this.pendingImpressions=[];for(let t of e)this.send("impression",t)}this.syncViewTargets()}impress(e){this.pendingImpressions=e}click(e){this.send("click",e)}key(e,t){return`${e}|${t.ad_id}`}wasSent(e,t){let{sessionId:r}=this.options.identity();return!!r&&this.sent[e].has(this.key(r,t))}send(e,t){let{sessionId:r,userId:i}=this.options.identity();if(!r||this.wasSent(e,t))return;ar(t[wo[e]],{sessionId:r,userId:i})&&this.sent[e].add(this.key(r,t))}syncViewTargets(){let{observer:e}=this;if(!e)return;let t=new Map;for(let[r,i]of this.options.viewTargets())this.wasSent("view",i)||t.set(r,i);for(let[r,i]of this.watched)t.get(r)!==i.story&&this.unwatch(r,i);for(let[r,i]of t)this.watched.has(r)||(this.watched.set(r,{story:i,visible:!1}),e.observe(r))}startTimer(e){var t;e.timer||(t=globalThis.document)!=null&&t.hidden||(e.timer=setTimeout(()=>{e.timer=void 0,this.send("view",e.story),this.wasSent("view",e.story)&&this.unwatchStory(e.story)},dr))}stopTimer(e){clearTimeout(e.timer),e.timer=void 0}unwatch(e,t){var r;this.stopTimer(t),(r=this.observer)==null||r.unobserve(e),this.watched.delete(e)}unwatchStory(e){for(let[t,r]of this.watched)r.story.ad_id===e.ad_id&&this.unwatch(t,r)}};var Ce=72,cr=48,it=g`
1053
+ `}};var dt=g`
1054
+ .root {
1055
+ position: relative;
1056
+ }
1057
+
1058
+ .root[data-requesting] {
1059
+ height: ${C};
1060
+ }
1061
+
1062
+ .root[data-loading] .carousel {
1063
+ visibility: hidden;
1064
+ }
1065
+
1066
+ .skeleton {
1067
+ position: absolute;
1068
+ inset: 0;
1069
+ z-index: 2;
1070
+ box-sizing: border-box;
1071
+ overflow: hidden;
1072
+ pointer-events: none;
1073
+ transition:
1074
+ opacity 0.3s ease,
1075
+ visibility 0s;
1076
+ }
1077
+
1078
+ .skeleton[data-done] {
1079
+ opacity: 0;
1080
+ visibility: hidden;
1081
+ transition:
1082
+ opacity 0.3s ease,
1083
+ visibility 0s 0.3s;
1084
+ }
1085
+
1086
+ .skeleton-slide {
1087
+ position: absolute;
1088
+ top: 0;
1089
+ left: 50%;
1090
+ width: calc(${C} * 9 / 16);
1091
+ height: 100%;
1092
+ margin-left: calc(${C} * 9 / -32);
1093
+ transform: translateX(calc(var(--place) * (100% + 8px))) scale(0.9);
1094
+ }
1095
+
1096
+ .skeleton-slide[data-active] {
1097
+ transform: none;
1098
+ }
1099
+
1100
+ .skeleton-card {
1101
+ width: 100%;
1102
+ height: 100%;
1103
+ border-radius: var(--vtex-ads-story-radius, 20px);
1104
+ background: #ececec;
1105
+ animation: skeleton-pulse 1.2s ease-in-out infinite alternate;
1106
+ }
1107
+
1108
+ .skeleton[data-done] .skeleton-card {
1109
+ animation: none;
1110
+ }
1111
+
1112
+ @keyframes skeleton-pulse {
1113
+ to {
1114
+ background-color: #f6f6f6;
1115
+ }
1116
+ }
1117
+
1118
+ @media (prefers-reduced-motion: reduce) {
1119
+ .skeleton,
1120
+ .skeleton[data-done] {
1121
+ transition: none;
1122
+ }
1123
+
1124
+ .skeleton-card {
1125
+ animation: none;
1126
+ }
1127
+ }
1128
+ `;function lt({done:o}){let e=Array.from({length:Y*2+1},(t,r)=>r-Y);return f`
1129
+ <div class="skeleton" aria-hidden="true" ?data-done=${o}>
1130
+ ${e.map(t=>f`
1131
+ <div
1132
+ class="skeleton-slide"
1133
+ ?data-active=${t===0}
1134
+ style=${L({"--place":String(t)})}
1135
+ >
1136
+ <div class="skeleton-card"></div>
1137
+ </div>
1138
+ `)}
1139
+ </div>
1140
+ `}var x="vtex-ads-story-carousel";var _r="text/plain;charset=utf-8";function Cr(o,{sessionId:e,userId:t}){var s,n;let r=b(o);if(!r||globalThis.window===void 0)return!1;let i=JSON.stringify(t?{session_id:e,user_id:t}:{session_id:e});try{if((n=(s=globalThis.navigator)==null?void 0:s.sendBeacon)==null?void 0:n.call(s,r,new Blob([i],{type:_r})))return!0}catch(a){}return typeof globalThis.fetch!="function"?!1:(globalThis.fetch(r,{method:"POST",headers:{"Content-Type":_r},body:i,keepalive:!0,credentials:"omit"}).catch(a=>{console.error(`[${x}] Event request failed`,{url:r,error:a})}),!0)}var ct=.5,Er=2e3,ti={impression:"impression_url",view:"view_url",click:"click_url"},fe=class{constructor(e,t){this.host=e;this.options=t;this.sent={impression:new Set,view:new Set,click:new Set};this.pendingImpressions=[];this.connected=!1;this.watched=new Map;this.onIntersect=e=>{for(let t of e){let r=this.watched.get(t.target);r&&(r.visible=t.isIntersecting&&t.intersectionRatio>=ct,r.visible?this.startTimer(r):this.stopTimer(r))}};this.onVisibilityChange=()=>{for(let e of this.watched.values())document.hidden?this.stopTimer(e):e.visible&&this.startTimer(e)};e.addController(this)}hostConnected(){var e;this.connected=!0,typeof IntersectionObserver=="function"&&(this.observer=new IntersectionObserver(this.onIntersect,{threshold:ct})),(e=globalThis.document)==null||e.addEventListener("visibilitychange",this.onVisibilityChange),this.host.updateComplete.then(()=>{this.connected&&(this.sendImpressions(),this.syncViewTargets())})}hostDisconnected(){var e,t;this.connected=!1,(e=globalThis.document)==null||e.removeEventListener("visibilitychange",this.onVisibilityChange),(t=this.observer)==null||t.disconnect(),this.observer=void 0;for(let r of this.watched.values())clearTimeout(r.timer);this.watched.clear()}hostUpdated(){this.connected&&(this.sendImpressions(),this.syncViewTargets())}impress(e){this.pendingImpressions=e}sendImpressions(){let e=this.pendingImpressions;if(!(!e.length||!this.options.identity().sessionId)){this.pendingImpressions=[];for(let t of e)this.send("impression",t)}}click(e){this.send("click",e)}key(e,t){return`${e}|${t.ad_id}`}wasSent(e,t){let{sessionId:r}=this.options.identity();return!!r&&this.sent[e].has(this.key(r,t))}send(e,t){let{sessionId:r,userId:i}=this.options.identity();if(!r||this.wasSent(e,t))return;Cr(t[ti[e]],{sessionId:r,userId:i})&&this.sent[e].add(this.key(r,t))}syncViewTargets(){let{observer:e}=this;if(!e)return;let t=new Map;for(let[r,i]of this.options.viewTargets())this.wasSent("view",i)||t.set(r,i);for(let[r,i]of this.watched)t.get(r)!==i.story&&this.unwatch(r,i);for(let[r,i]of t)this.watched.has(r)||(this.watched.set(r,{story:i,visible:!1}),e.observe(r))}startTimer(e){var t;e.timer||(t=globalThis.document)!=null&&t.hidden||(e.timer=setTimeout(()=>{e.timer=void 0,this.send("view",e.story),this.wasSent("view",e.story)&&this.unwatchStory(e.story)},Er))}stopTimer(e){clearTimeout(e.timer),e.timer=void 0}unwatch(e,t){var r;this.stopTimer(t),(r=this.observer)==null||r.unobserve(e),this.watched.delete(e)}unwatchStory(e){for(let[t,r]of this.watched)r.story.ad_id===e.ad_id&&this.unwatch(t,r)}};var Re=72,Pr=48,pt=g`
824
1141
  .player {
825
1142
  position: fixed;
826
1143
  inset: auto 16px 16px auto;
@@ -1018,8 +1335,8 @@
1018
1335
  --side-height: min(38vh, 320px);
1019
1336
  --side-width: calc(var(--side-height) * 9 / 16);
1020
1337
  --center-half: calc(var(--center-height) * 9 / 32);
1021
- --near-gap: ${Ce}px;
1022
- --far-gap: ${cr}px;
1338
+ --near-gap: ${Re}px;
1339
+ --far-gap: ${Pr}px;
1023
1340
  --near: calc(var(--center-half) + var(--near-gap) + var(--side-width) / 2);
1024
1341
  --pitch: calc(var(--side-width) + var(--far-gap));
1025
1342
  }
@@ -1033,7 +1350,7 @@
1033
1350
  padding: 0;
1034
1351
  overflow: hidden;
1035
1352
  border: 0;
1036
- border-radius: 16px;
1353
+ border-radius: var(--vtex-ads-story-radius, 16px);
1037
1354
  background: #111;
1038
1355
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
1039
1356
  cursor: pointer;
@@ -1197,14 +1514,14 @@
1197
1514
  animation: none;
1198
1515
  }
1199
1516
  }
1200
- `;function st(o,e){if(o<2)return[];if(o===2)return[e===0?1:-1];let t=[],r=new Set([0]);for(let i of[-1,1,-2,2]){let s=(i%o+o)%o;r.has(s)||(r.add(s),t.push(i))}return t}var K={duration:560,easing:"cubic-bezier(0.32, 0.72, 0, 1)"},Ee=(o,e=1)=>`translate(-50%, -50%) translateX(${o}px) scale(${e})`,pr=o=>o.animate([{opacity:0},{opacity:1}],{...K,pseudoElement:"::after"});function $o(o,e,t,{frameWidth:r,sideWidth:i}){let s=d=>{if(d===0)return 0;let l=Math.sign(d),p=r/2+Ce+i/2;return l*p+(d-l)*(i+cr)},n=i/r,a=[o.animate([{transform:`translateX(${s(e)}px) scale(${n})`},{transform:"none"}],K)];for(let{element:d,offset:l,from:p}of t){let c=p===0;a.push(d.animate([{transform:Ee(s(p),c?1/n:1)},{transform:Ee(s(l))}],K)),c&&a.push(pr(d))}return a}function So(o,e,t,{frameWidth:r,sideWidth:i}){let s=d=>d*(Ce+i)/2,n=d=>-d*(r+Ce)/2,a=i/r;return[o.animate([{transform:`translateX(${n(-t)}px) scale(${a})`},{transform:`translateX(${s(t)}px)`}],K),e.animate([{transform:Ee(s(-t),1/a)},{transform:Ee(n(t))}],K),pr(e)]}var Ao={ArrowLeft:-1,ArrowRight:1},_o=o=>!o.defaultPrevented&&!o.altKey&&!o.ctrlKey&&!o.metaKey&&!o.shiftKey;function lr(o){return typeof o.showPopover=="function"}var le=class{constructor(e,t){this.host=e;this.options=t;this.isOpen=!1;this.expanded=!1;this.productOpen=!1;this.switched=!1;this.shown=!1;this.dialog=P();this.expandButton=P();this.closeButton=P();this.stage=P();this.stageCardRef=P();this.dim=P();this.neighborElements=new Map;this.neighborRefs=new Map;this.navigation=!1;this.pairDirection=0;this.animations=[];this.toggleExpanded=async()=>{var t;let e=this.dialog.value;e&&(this.cancelAnimations(),this.hide(e),this.expanded=!this.expanded,this.switched=!0,this.host.requestUpdate(),await this.host.updateComplete,this.isOpen&&(this.show(e),(t=this.expandButton.value)==null||t.focus()))};this.onKeyDown=e=>{e.key==="Escape"&&this.options.onClose()};this.onPlayerKeyDown=e=>{var r,i;let t=Ao[e.key];!t||!this.navigation||!_o(e)||(e.preventDefault(),(i=(r=this.options).onStep)==null||i.call(r,t))};this.onDialogClick=e=>{this.expanded&&e.target===e.currentTarget&&this.options.onClose()};this.onCancel=e=>{e.preventDefault(),this.options.onClose()};this.toggleProduct=()=>{this.productOpen=!this.productOpen,this.host.requestUpdate()};this.onVideoClick=()=>{this.productOpen?this.toggleProduct():this.video.togglePlayback()};e.addController(this),this.video=new B(e)}get isExpanded(){return this.isOpen&&this.expanded}get stageCard(){return this.isOpen?this.stageCardRef.value:void 0}hostDisconnected(){this.close()}async open({productOpen:e=!1}={}){var r;if(this.isOpen)return;document.addEventListener("keydown",this.onKeyDown),this.isOpen=!0,this.expanded=!1,this.productOpen=e,this.switched=!1,this.rendered=void 0,this.beforeStep=void 0,this.video.reset(),this.host.requestUpdate(),await this.host.updateComplete;let t=this.dialog.value;!this.isOpen||!t||(this.show(t),this.video.play(),(r=this.closeButton.value)==null||r.focus())}close(){if(!this.isOpen)return;document.removeEventListener("keydown",this.onKeyDown),this.cancelAnimations();let e=this.dialog.value;e&&this.hide(e),this.isOpen=!1,this.host.requestUpdate()}async showNext(e=0){if(!this.isOpen)return;let t=!this.video.muted;this.video.failed=!1,this.productOpen=!1,this.host.requestUpdate(),await this.host.updateComplete,this.isOpen&&(this.video.restart({withSound:t}),this.animateStep(e))}cancelAnimations(){for(let e of this.animations)e.cancel();this.animations=[]}animateStep(e){var l,p;if(!this.expanded||e===0||$e())return;let t=this.stage.value,r=this.dim.value;if(!t||!r||typeof t.animate!="function")return;let{rendered:i,beforeStep:s}=this,n=(c,h)=>{var y;if(!c||!s)return h;if(c===s.story)return 0;let u=s.neighbors.find(L=>L.story===c);return(y=u==null?void 0:u.offset)!=null?y:h},a=[...this.neighborElements].map(([c,h])=>{var u;return{offset:c,element:h,from:n((u=i==null?void 0:i.neighbors.find(y=>y.offset===c))==null?void 0:u.story,c+e)}}),d={frameWidth:t.offsetWidth,sideWidth:(p=(l=a[0])==null?void 0:l.element.offsetWidth)!=null?p:0};!d.frameWidth||!d.sideWidth||(this.cancelAnimations(),this.animations=[r.animate([{opacity:1},{opacity:0}],K),...this.pairDirection?So(t,a[0].element,this.pairDirection,d):$o(t,n(i==null?void 0:i.story,e),a,d)])}neighborRef(e){let t=this.neighborRefs.get(e);return t||(t=r=>{r?this.neighborElements.set(e,r):this.neighborElements.delete(e)},this.neighborRefs.set(e,t)),t}show(e){this.shown||(this.expanded?e.showModal():lr(e)?e.showPopover():e.show(),this.shown=!0)}hide(e){this.shown&&(!this.expanded&&lr(e)?e.hidePopover():e.close(),this.shown=!1)}renderDestination({product:e,cta:t,labels:r}){let i;if(e)i=Xe(e,{open:this.productOpen,onToggle:this.toggleProduct,panelId:"player-product-panel",labels:r});else if(t)i=se(t);else return f;return m`
1517
+ `;function ut(o,e){if(o<2)return[];if(o===2)return[e===0?1:-1];let t=[],r=new Set([0]);for(let i of[-1,1,-2,2]){let s=(i%o+o)%o;r.has(s)||(r.add(s),t.push(i))}return t}var J={duration:560,easing:"cubic-bezier(0.32, 0.72, 0, 1)"},Oe=(o,e=1)=>`translate(-50%, -50%) translateX(${o}px) scale(${e})`,kr=o=>o.animate([{opacity:0},{opacity:1}],{...J,pseudoElement:"::after"});function ri(o,e,t,{frameWidth:r,sideWidth:i}){let s=d=>{if(d===0)return 0;let l=Math.sign(d),p=r/2+Re+i/2;return l*p+(d-l)*(i+Pr)},n=i/r,a=[o.animate([{transform:`translateX(${s(e)}px) scale(${n})`},{transform:"none"}],J)];for(let{element:d,offset:l,from:p}of t){let c=p===0;a.push(d.animate([{transform:Oe(s(p),c?1/n:1)},{transform:Oe(s(l))}],J)),c&&a.push(kr(d))}return a}function oi(o,e,t,{frameWidth:r,sideWidth:i}){let s=d=>d*(Re+i)/2,n=d=>-d*(r+Re)/2,a=i/r;return[o.animate([{transform:`translateX(${n(-t)}px) scale(${a})`},{transform:`translateX(${s(t)}px)`}],J),e.animate([{transform:Oe(s(-t),1/a)},{transform:Oe(n(t))}],J),kr(e)]}var ii={ArrowLeft:-1,ArrowRight:1},si=o=>!o.defaultPrevented&&!o.altKey&&!o.ctrlKey&&!o.metaKey&&!o.shiftKey;function Tr(o){return typeof o.showPopover=="function"}var me=class{constructor(e,t){this.host=e;this.options=t;this.isOpen=!1;this.expanded=!1;this.productOpen=!1;this.switched=!1;this.shown=!1;this.dialog=k();this.expandButton=k();this.closeButton=k();this.stage=k();this.stageCardRef=k();this.dim=k();this.neighborElements=new Map;this.neighborRefs=new Map;this.navigation=!1;this.pairDirection=0;this.animations=[];this.toggleExpanded=async()=>{var t;let e=this.dialog.value;e&&(this.cancelAnimations(),this.hide(e),this.expanded=!this.expanded,this.switched=!0,this.host.requestUpdate(),await this.host.updateComplete,this.isOpen&&(this.show(e),(t=this.expandButton.value)==null||t.focus()))};this.onKeyDown=e=>{e.key==="Escape"&&this.options.onClose()};this.onPlayerKeyDown=e=>{var r,i;let t=ii[e.key];!t||!this.navigation||!si(e)||(e.preventDefault(),(i=(r=this.options).onStep)==null||i.call(r,t))};this.onDialogClick=e=>{this.expanded&&e.target===e.currentTarget&&this.options.onClose()};this.onCancel=e=>{e.preventDefault(),this.options.onClose()};this.toggleProduct=()=>{this.productOpen=!this.productOpen,this.host.requestUpdate()};this.retryVideo=()=>{var e;(e=this.dialog.value)==null||e.focus(),this.video.retry().then(t=>{t&&this.video.playWithSound()})};this.onVideoClick=()=>{this.productOpen?this.toggleProduct():this.video.togglePlayback()};e.addController(this),this.video=new z(e)}get isExpanded(){return this.isOpen&&this.expanded}get stageCard(){return this.isOpen?this.stageCardRef.value:void 0}hostDisconnected(){this.close()}async open({productOpen:e=!1}={}){var r;if(this.isOpen)return;document.addEventListener("keydown",this.onKeyDown),this.isOpen=!0,this.expanded=!1,this.productOpen=e,this.switched=!1,this.rendered=void 0,this.beforeStep=void 0,this.video.reset(),this.host.requestUpdate(),await this.host.updateComplete;let t=this.dialog.value;!this.isOpen||!t||(this.show(t),this.video.playWithSound(),(r=this.closeButton.value)==null||r.focus())}close(){if(!this.isOpen)return;document.removeEventListener("keydown",this.onKeyDown),this.cancelAnimations();let e=this.dialog.value;e&&this.hide(e),this.isOpen=!1,this.host.requestUpdate()}async showNext(e=0){if(!this.isOpen)return;let t=!this.video.muted;this.video.clearFailure(),this.productOpen=!1,this.host.requestUpdate(),await this.host.updateComplete,this.isOpen&&(this.video.restart({withSound:t}),this.animateStep(e))}cancelAnimations(){for(let e of this.animations)e.cancel();this.animations=[]}animateStep(e){var l,p;if(!this.expanded||e===0||Q())return;let t=this.stage.value,r=this.dim.value;if(!t||!r||typeof t.animate!="function")return;let{rendered:i,beforeStep:s}=this,n=(c,h)=>{var y;if(!c||!s)return h;if(c===s.story)return 0;let m=s.neighbors.find(A=>A.story===c);return(y=m==null?void 0:m.offset)!=null?y:h},a=[...this.neighborElements].map(([c,h])=>{var m;return{offset:c,element:h,from:n((m=i==null?void 0:i.neighbors.find(y=>y.offset===c))==null?void 0:m.story,c+e)}}),d={frameWidth:t.offsetWidth,sideWidth:(p=(l=a[0])==null?void 0:l.element.offsetWidth)!=null?p:0};!d.frameWidth||!d.sideWidth||(this.cancelAnimations(),this.animations=[r.animate([{opacity:1},{opacity:0}],J),...this.pairDirection?oi(t,a[0].element,this.pairDirection,d):ri(t,n(i==null?void 0:i.story,e),a,d)])}neighborRef(e){let t=this.neighborRefs.get(e);return t||(t=r=>{r?this.neighborElements.set(e,r):this.neighborElements.delete(e)},this.neighborRefs.set(e,t)),t}show(e){this.shown||(this.expanded?e.showModal():Tr(e)?e.showPopover():e.show(),this.shown=!0)}hide(e){this.shown&&(!this.expanded&&Tr(e)?e.hidePopover():e.close(),this.shown=!1)}renderDestination({product:e,cta:t,labels:r,productActions:i}){let s;if(e)s=rt(e,{...i,labels:r,open:this.productOpen,onToggle:this.toggleProduct,panelId:"player-product-panel"});else if(t)s=pe(t);else return u;return f`
1201
1518
  <div
1202
1519
  class="player-destination"
1203
- @click=${s=>s.stopPropagation()}
1520
+ @click=${n=>n.stopPropagation()}
1204
1521
  >
1205
- ${i}
1522
+ ${s}
1206
1523
  </div>
1207
- `}renderVideoControls(e){let{video:t}=this,r=s=>{s.stopPropagation(),t.togglePlayback()},i=s=>{s.stopPropagation(),t.toggleMuted()};return m`
1524
+ `}renderVideoControls(e){let{video:t}=this,r=s=>{s.stopPropagation(),t.togglePlayback()},i=s=>{s.stopPropagation(),t.toggleMuted()};return f`
1208
1525
  <button
1209
1526
  type="button"
1210
1527
  class="play player-toggle"
@@ -1221,7 +1538,7 @@
1221
1538
  >
1222
1539
  ${v(t.muted?"soundOff":"soundOn")}
1223
1540
  </button>
1224
- `}renderNavigation(e){let{options:t}=this,r=i=>()=>{var s;return(s=t.onStep)==null?void 0:s.call(t,i)};return m`
1541
+ `}renderNavigation(e){let{options:t}=this,r=i=>()=>{var s;return(s=t.onStep)==null?void 0:s.call(t,i)};return f`
1225
1542
  <div class="player-controls player-nav">
1226
1543
  <button
1227
1544
  type="button"
@@ -1240,24 +1557,24 @@
1240
1557
  ${v("next")}
1241
1558
  </button>
1242
1559
  </div>
1243
- `}renderNeighbors(e,t){let{options:r}=this;return _e(e,({offset:i})=>e.length===1?"single":i,({offset:i,story:s,label:n})=>{let a=w(s.poster_url),d=Math.sign(i);return m`
1560
+ `}renderNeighbors(e,t){let{options:r}=this;return Me(e,({offset:i})=>e.length===1?"single":i,({offset:i,story:s,label:n})=>{let a=b(s.poster_url),d=Math.sign(i);return f`
1244
1561
  <button
1245
1562
  type="button"
1246
1563
  class="player-neighbor"
1247
1564
  aria-label=${n!=null?n:t.show}
1248
- style=${W({"--side":String(d),"--beyond":String(i-d)})}
1249
- ${x(this.neighborRef(i))}
1565
+ style=${L({"--side":String(d),"--beyond":String(i-d)})}
1566
+ ${$(this.neighborRef(i))}
1250
1567
  @click=${()=>{var l;return(l=r.onStep)==null?void 0:l.call(r,i)}}
1251
1568
  >
1252
- ${a?m`<img alt="" src=${a} />`:f}
1569
+ ${a?f`<img alt="" src=${a} />`:u}
1253
1570
  </button>
1254
- `})}renderWindowControls(e){let{options:t,expanded:r}=this;return m`
1571
+ `})}renderWindowControls(e){let{options:t,expanded:r}=this;return f`
1255
1572
  <div class="player-controls">
1256
1573
  <button
1257
1574
  type="button"
1258
1575
  class="player-button player-expand"
1259
1576
  aria-label=${r?e.collapse:e.expand}
1260
- ${x(this.expandButton)}
1577
+ ${$(this.expandButton)}
1261
1578
  @click=${this.toggleExpanded}
1262
1579
  >
1263
1580
  ${v(r?"collapse":"expand")}
@@ -1266,60 +1583,68 @@
1266
1583
  type="button"
1267
1584
  class="player-button player-close"
1268
1585
  aria-label=${e.close}
1269
- ${x(this.closeButton)}
1586
+ ${$(this.closeButton)}
1270
1587
  @click=${t.onClose}
1271
1588
  >
1272
1589
  ${v("close")}
1273
1590
  </button>
1274
1591
  </div>
1275
- `}renderVideo(e,t,r){let{video:i,options:s}=this;return m`
1276
- <div class="card" ${x(this.stageCardRef)} @click=${this.onVideoClick}>
1277
- ${ie(e,i,{loop:!t,onEnded:t?()=>{var n;return(n=s.onStep)==null?void 0:n.call(s,1)}:void 0})}
1278
- ${q(e,i)?this.renderVideoControls(r.labels):f}
1592
+ `}renderVideo(e,t,r){let{video:i,options:s}=this;return f`
1593
+ <div class="card" ${$(this.stageCardRef)} @click=${this.onVideoClick}>
1594
+ ${ce(e,i,{loop:!t,onEnded:t?()=>{var n;return(n=s.onStep)==null?void 0:n.call(s,1)}:void 0,labels:r.labels,onRetry:this.retryVideo})}
1595
+ ${K(e,i)?this.renderVideoControls(r.labels):u}
1279
1596
  ${this.renderDestination(r)}
1280
1597
  </div>
1281
- `}track(e,t){let r=this.expanded?t:[];return this.pairDirection=r.length===1?-Math.sign(r[0].offset):0,this.rendered&&e!==this.rendered.story&&(this.beforeStep=this.rendered),this.rendered={story:e,neighbors:r},r}render(e,{labels:t,navigation:r=!1,neighbors:i=[],product:s,cta:n,onPress:a}){if(!this.isOpen)return f;let{video:d,expanded:l}=this,p=this.track(e,i),c=this.pairDirection!==0;return this.navigation=r,m`
1598
+ `}track(e,t){let r=this.expanded?t:[];return this.pairDirection=r.length===1?-Math.sign(r[0].offset):0,this.rendered&&e!==this.rendered.story&&(this.beforeStep=this.rendered),this.rendered={story:e,neighbors:r},r}render(e,{navigation:t=!1,neighbors:r=[],onPress:i,...s}){let{labels:n}=s;if(!this.isOpen)return u;let{video:a,expanded:d}=this,l=this.track(e,r),p=this.pairDirection!==0;return this.navigation=t,f`
1282
1599
  <dialog
1283
1600
  class="player"
1284
1601
  popover="manual"
1285
- aria-label=${t.player}
1286
- ?data-expanded=${l}
1287
- ?data-pair=${c}
1288
- style=${W({"--pair-dir":c?String(this.pairDirection):void 0})}
1602
+ aria-label=${n.player}
1603
+ ?data-expanded=${d}
1604
+ ?data-pair=${p}
1605
+ style=${L({"--pair-dir":p?String(this.pairDirection):void 0})}
1289
1606
  ?data-switched=${this.switched}
1290
- ?data-paused=${q(e,d)&&d.paused}
1607
+ ?data-paused=${K(e,a)&&a.paused}
1291
1608
  tabindex="-1"
1292
- ${x(this.dialog)}
1609
+ ${$(this.dialog)}
1293
1610
  @click=${this.onDialogClick}
1294
1611
  @cancel=${this.onCancel}
1295
1612
  @keydown=${this.onPlayerKeyDown}
1296
1613
  >
1297
- ${this.renderNeighbors(p,t)}
1614
+ ${this.renderNeighbors(l,n)}
1298
1615
  <div class="player-frame">
1299
- ${this.renderWindowControls(t)}
1616
+ ${this.renderWindowControls(n)}
1300
1617
  <div
1301
1618
  class="player-stage"
1302
- ${x(this.stage)}
1303
- @click=${{handleEvent:h=>{let u=this.stageCardRef.value;u!=null&&u.contains(h.target)&&(a==null||a())},capture:!0}}
1619
+ ${$(this.stage)}
1620
+ @click=${{handleEvent:c=>{let h=this.stageCardRef.value;h!=null&&h.contains(c.target)&&(i==null||i())},capture:!0}}
1304
1621
  >
1305
- ${r?this.renderNavigation(t):f}
1306
- ${this.renderVideo(e,r&&l,{product:s,cta:n,labels:t})}
1307
- <span class="player-dim" aria-hidden="true" ${x(this.dim)}></span>
1622
+ ${t?this.renderNavigation(n):u}
1623
+ ${this.renderVideo(e,t&&d,s)}
1624
+ <span class="player-dim" aria-hidden="true" ${$(this.dim)}></span>
1308
1625
  </div>
1309
1626
  </div>
1310
1627
  </dialog>
1311
- `}};var ur=(o,e)=>globalThis.fetch(o,e);var Co=()=>{let o=async(s,n,a,d,l)=>{let p=new URL(n,s).toString(),c=d?{"content-type":"application/json"}:void 0;return ur(p,{body:d?JSON.stringify(d):void 0,method:a,signal:l==null?void 0:l.signal,headers:{accept:"application/json",...c}}).then(h=>{if(!h.ok)throw console.error({description:"HTTP error",response:h}),new Error(`HTTP error! status: ${h.status}`);return h.json()})};return{get:async(s,n,a)=>o(s,n,"GET",void 0,a),post:async(s,n,a,d)=>o(s,n,"POST",a,d),put:async(s,n,a)=>o(s,n,"PUT",a),delete:async(s,n)=>o(s,n,"DELETE")}},nt=Co(),Eo="https://newtail-media.newtail.com.br/v1/rma/",Po=async(o,e,t)=>nt.post(Eo,o,e,{signal:t==null?void 0:t.signal}).then(r=>{if(r.validations&&r.validations.length>0)throw console.error(JSON.stringify({description:"Ads validation error",response:r},null,2)),new Error("Ads validation error");return r}),To=o=>Object.entries(o).filter(([,e])=>Array.isArray(e)).map(([e,t])=>[e,t.filter(r=>"product_sku"in r)]).filter(([e,t])=>t.length>0),ko=o=>Object.entries(o).filter(([,e])=>Array.isArray(e)).map(([e,t])=>[e,t.filter(r=>"type"in r&&r.type==="story")]).filter(([e,t])=>t.length>0),vr=o=>{var e;return{skuId:o.product_sku,sellerId:(e=o.seller_id)!=null?e:"1",productId:o.product_metadata.productId}},gr=o=>{var e,t,r;let{product:i}=o;if(!i)return;let s=(e=i.product_metadata)==null?void 0:e.productId;return{skuId:i.product_sku,sellerId:(r=(t=i.seller_id)!=null?t:o.seller_id)!=null?r:"1",productId:typeof s=="string"?s:""}},hr=o=>{let e={};for(let[t,r]of o)e[t]=r;return e},Oo=(o,e)=>{let t={};for(let[r,i]of Object.entries(o))t[r]=i.map(s=>e(s));return t},Mo=(o,e)=>e?new Promise((t,r)=>{let i=()=>r(e.reason);if(e.aborted){i();return}e.addEventListener("abort",i,{once:!0}),o.then(t,r).finally(()=>e.removeEventListener("abort",i))}):o,br=(o,e)=>({eventUrls:{click:o.click_url,impression:o.impression_url,view:o.view_url},eventParameters:btoa(o.impression_url),sponsoredBySellerId:e}),Ro=(o,e,t)=>({product:o,advertisement:br(e,t.sellerId)}),Lo=(o,e)=>{var t;let r=gr(o);return{story:o,product:e(r),offer:r,advertisement:br(o,(t=r==null?void 0:r.sellerId)!=null?t:o.seller_id)}},fr=(o,e)=>Object.values(o).flatMap(t=>t.map(r=>e(r))).filter(t=>t!==void 0),Io=(o,e)=>t=>t&&o.find(r=>e(r,t)),No=(o,e)=>{var t;let r={},i=[];for(let[s,n]of Object.entries(o))for(let a of n){let d=vr(a),l=e(d);l?((t=r[s])!=null||(r[s]=[]),r[s].push(Ro(l,a,d))):i.push(a)}return{byPlacement:r,failed:i}},xr=async({sponsoredProducts:o={},stories:e={}},t,r,i,s)=>{let n=[...fr(o,vr),...fr(e,gr)],a=n.length>0?await Mo(t(n,i,{signal:s==null?void 0:s.signal}),s==null?void 0:s.signal):[],d=Io(a,r);return{sponsoredProducts:No(o,d),stories:Oo(e,l=>Lo(l,d))}},wr=(o,e)=>o.items.some(t=>t.itemId===e.skuId&&t.sellers.some(r=>r.sellerId===e.sellerId)),$r=o=>`https://${o}.vtexcommercestable.com.br/api/intelligent-search/`,Sr="product_search",Ho=async(o,e,t)=>{let r=$r(o),i=`product:${e.map(encodeURIComponent).join(";")}`,s=`${Sr}?q=${i}`;return nt.get(r,s,t)},Vo=24,Do=async(o,e,t)=>{let r=$r(o),i=`sku:${e.map(encodeURIComponent).join(";")}`,s=`${Sr}?q=${i}`;return nt.get(r,s,t)},Uo=o=>{let e=new Map;for(let{skuId:t,sellerId:r}of o){let i=e.get(t);i?i.push(r):e.set(t,[r])}return e},Bo=(o,e)=>o.map(t=>{let r=e.get(t.itemId);if(!r)return null;let i=t.sellers.filter(s=>r.includes(s.sellerId));return i.length===0?null:{...t,sellers:i}}).filter(t=>t!==null),Fo=(o,e)=>{let t=Uo(e);return o.map(r=>{let i=Bo(r.items,t);return i.length===0?null:{...r,items:i}}).filter(r=>r!==null)},zo=(o,e)=>{let t=[];for(let r=0;r<o.length;r+=e)t.push(o.slice(r,r+e));return t},mr=(o,e,t,r)=>zo(t,Vo).map(i=>o(e,i,r)),qo=o=>[...new Map(o.map(e=>[e.productId,e])).values()],Ar=async(o,{accountName:e},t)=>{let r=new Set,i=new Set;for(let{productId:d,skuId:l}of o)d?r.add(d):i.add(l);let s={signal:t==null?void 0:t.signal},n=await Promise.all([...mr(Ho,e,[...r],s),...mr(Do,e,[...i],s)]),a=qo(n.flatMap(d=>d.products));return Fo(a,o)},_r=(o,{skuId:e,sellerId:t})=>{var r,i;return(i=(r=o.items.find(s=>s.itemId===e))==null?void 0:r.sellers.find(s=>s.sellerId===t))==null?void 0:i.commertialOffer},yr=o=>typeof o=="number"&&Number.isFinite(o)?o:void 0,Cr=(o,e)=>{let t=_r(o,e),r=yr(t==null?void 0:t.Price);if(r===void 0)return;let i=yr(t==null?void 0:t.ListPrice);return i!==void 0&&i>r?{price:r,listPrice:i}:{price:r}},Er=(o,e)=>{var t;let r=(t=_r(o,e))==null?void 0:t.AvailableQuantity;return typeof r=="number"&&!Number.isNaN(r)?r>0:void 0},Pe=({selectedFacets:o,attributeSynonyms:e,attributePrefix:t})=>{if(!(o!=null&&o.length))return;let r=e==null?void 0:e.map(n=>n.toLowerCase()),i=t==null?void 0:t.toLowerCase(),s=o.filter(n=>{let a=n.key.toLowerCase();return(r==null?void 0:r.includes(a))||i&&a.startsWith(i)});if(s.length>0)return s},jo=o=>{var e;return(e=Pe({selectedFacets:o,attributeSynonyms:["categoria","c"],attributePrefix:"category"}))==null?void 0:e.map(t=>t.value).join(" > ")},Wo=o=>{var e;return(e=Pe({selectedFacets:o,attributeSynonyms:["brand","b"]}))==null?void 0:e.map(t=>t.value)[0]},Go=o=>{var e;return(e=Pe({selectedFacets:o,attributeSynonyms:["productClusterIds","productClusterNames"]}))==null?void 0:e.map(t=>`product_cluster/${t.value}`)},Ko=o=>{var e;return(e=Pe({selectedFacets:o,attributeSynonyms:["sellerName","seller"]}))==null?void 0:e.map(t=>t.value)[0]},Zo=o=>({category:jo(o),brand:Wo(o),tags:Go(o),seller:Ko(o)}),Xo=({term:o,category:e,brand:t,skuId:r})=>o?"search":e?"category":t?"brand_page":r?"product_page":"home",Yo=o=>{var e;let{category:t,brand:r,tags:i,seller:s}=Zo(o.search.selectedFacets),n=(e=o.search.term)!=null?e:!t&&!r?s:void 0,a=Xo({term:n,category:t,brand:r,skuId:o.search.skuId});return{brand_name:r,category_name:t,tags:i,context:a,placements:o.placements,channel:o.identity.channel,term:n,session_id:o.identity.sessionId,user_id:o.identity.userId,product_sku:o.search.skuId}},Pr=async(o,e)=>{let t=Yo(o),r=await Po(o.identity.publisherId,t,e);return{sponsoredProducts:hr(To(r)),stories:hr(ko(r)),banners:void 0,sponsoredBrands:void 0}};var Te=(o,e,t)=>{let r=o!==void 0&&Number.isFinite(o)&&o>0?o:e,i=new AbortController,s=setTimeout(()=>i.abort(new DOMException(`Timed out after ${r} ms`,"TimeoutError")),r),n=()=>i.abort(t==null?void 0:t.reason);return t!=null&&t.aborted?n():t==null||t.addEventListener("abort",n,{once:!0}),{signal:i.signal,clear:()=>{clearTimeout(s),t==null||t.removeEventListener("abort",n)}}};var Qo=5e3,Tr={fetcher:Ar,matcher:wr,price:Cr,available:Er};async function kr(o,e,t,r,{signal:i,timeout:s}={}){var d,l;let n=new Map,a=Te(s,Qo,i);try{let p=await xr({stories:{[o]:e}},t.fetcher,(c,h)=>t.matcher(c,h),r,{signal:a.signal});for(let{story:c,product:h,offer:u}of(d=p.stories[o])!=null?d:[]){if(!h||!u)continue;let y=t.price(h,u),L=(l=t.available)==null?void 0:l.call(t,h,u);n.set(c.ad_id,{...y&&{price:y},...L!==void 0&&{available:L}})}}catch(p){a.signal.aborted||console.error(`[${$}] Product request failed`,p)}finally{a.clear()}return n}var Jo=2e3,ei=8,ti=o=>o!==void 0&&Number.isFinite(o)&&o>=1?Math.floor(o):ei;async function Or({publisherId:o,sessionId:e,placement:t,userId:r,accountName:i,channel:s,quantity:n},{signal:a,timeout:d}={}){var h;if(globalThis.window===void 0||!o||!e||!t)return[];let p=Te(d,Jo,a),c=ti(n);try{let{stories:u}=await Pr({identity:{accountName:i!=null?i:"",publisherId:o,sessionId:e,userId:r,channel:s},search:{},placements:{[t]:{quantity:c,types:["story"]}}},{signal:p.signal});return((h=u[t])!=null?h:[]).slice(0,c)}catch(u){return p.signal.aborted||console.error(`[${$}] Story request failed`,{placement:t,publisherId:o,error:u}),[]}finally{p.clear()}}var Mr={watch:"Watch video",show:"Show video",carousel:"Videos",carouselRole:"carousel",previous:"Previous video",next:"Next video",player:"Video",expand:"Expand video",collapse:"Collapse video",close:"Close video",play:"Play video",pause:"Pause video",soundOn:"Turn sound on",soundOff:"Turn sound off",addToCart:"Add to cart",unavailable:"Product unavailable",soldOut:"Sold out",viewProduct:"View product",product:(o,e,t)=>e&&t?`${o}, was ${t}, now ${e}`:e?`${o}, ${e}`:o,position:(o,e,t)=>t>1?`${o} ${e+1} of ${t}`:o};var Rr={watch:"Ver video",show:"Mostrar video",carousel:"Videos",carouselRole:"carrusel",previous:"Video anterior",next:"Video siguiente",player:"Video",expand:"Ampliar video",collapse:"Reducir video",close:"Cerrar video",play:"Reproducir video",pause:"Pausar video",soundOn:"Activar sonido",soundOff:"Desactivar sonido",addToCart:"Agregar al carrito",unavailable:"Producto no disponible",soldOut:"Agotado",viewProduct:"Ver producto",product:(o,e,t)=>e&&t?`${o}, antes ${t}, ahora ${e}`:e?`${o}, ${e}`:o,position:(o,e,t)=>t>1?`${o} ${e+1} de ${t}`:o};var at={watch:"Assistir v\xEDdeo",show:"Mostrar v\xEDdeo",carousel:"V\xEDdeos",carouselRole:"carrossel",previous:"V\xEDdeo anterior",next:"Pr\xF3ximo v\xEDdeo",player:"V\xEDdeo",expand:"Expandir v\xEDdeo",collapse:"Reduzir v\xEDdeo",close:"Fechar v\xEDdeo",play:"Reproduzir v\xEDdeo",pause:"Pausar v\xEDdeo",soundOn:"Ativar som",soundOff:"Desativar som",addToCart:"Adicionar ao carrinho",unavailable:"Produto indispon\xEDvel",soldOut:"Esgotado",viewProduct:"Ver produto",product:(o,e,t)=>e&&t?`${o}, de ${t} por ${e}`:e?`${o}, ${e}`:o,position:(o,e,t)=>t>1?`${o} ${e+1} de ${t}`:o};var ri=new Map([["pt",at],["es",Rr],["en",Mr]]);function Lr(o,e={}){var n,a,d;let t=o.split("-")[0].toLowerCase(),r=(n=ri.get(t))!=null?n:at,i=(a=e.addToCart)==null?void 0:a.trim(),s=(d=e.viewProduct)==null?void 0:d.trim();return{...r,...i&&{addToCart:i},...s&&{viewProduct:s}}}var oi=["publisherId","sessionId","placement","userId","accountName","channel","quantity","hydration"],ii=new Set(["site","app"]),si=o=>ii.has(o),ni={fromAttribute:o=>typeof o=="string"&&(o===""||o.toLowerCase()==="true")},ai={fromAttribute:o=>si(o)?o:void 0},di={fromAttribute:o=>o==="none"?"none":void 0},R=class extends k{constructor(){super();this.cardVideos=new Map;this.soundPending=!1;this.carousel=new ae(this,{onStep:(t,r)=>this.leaveHighlight(t,r),onLayoutChange:()=>{this.cardVideos.clear(),this.player.isOpen&&(this.afterRender=()=>{var t;return(t=this.activeVideo)==null?void 0:t.pause()})},locked:()=>this.player.isOpen});this.player=new le(this,{onStep:t=>this.stepInPlayer(t),onClose:()=>this.closePlayer()});this.events=new de(this,{identity:()=>({sessionId:this.sessionId,userId:this.userId}),viewTargets:()=>this.viewTargets()});this.renderSlide=(t,{key:r,index:i,offset:s,active:n,hidden:a,cardRef:d,focusRef:l})=>Je(t,this.videoFor(r),{label:this.labels.position(n?this.labels.watch:this.labels.show,i,this.stories.length),labels:this.labels,withVideo:n||this.inactiveAutoplay&&!a,product:this.productOf(t),onSelect:n?()=>this.openPlayer():()=>this.carousel.step(s),onProductSelect:n?()=>this.openPlayer({productOpen:!0}):void 0,cta:Ae(t),onCtaSelect:n?void 0:()=>this.carousel.step(s),onPress:()=>this.events.click(t),ref:d,openRef:l});this.inactiveAutoplay=!1,this.stories=[]}connectedCallback(){var t;super.connectedCallback();for(let r of this.cardVideos.values())r.resume();(t=this.request)!=null&&t.signal.aborted&&this.loadStory()}disconnectedCallback(){var t;super.disconnectedCallback(),(t=this.request)==null||t.abort()}willUpdate(t){oi.some(r=>t.has(r))&&this.loadStory()}updated(){let t=this.afterRender;this.afterRender=void 0,t==null||t()}get activeHydration(){if(this.hydration!=="none")return this.hydration?this.hydration:this.accountName?Tr:void 0}async loadStory(){var n,a,d,l,p;(n=this.request)==null||n.abort();let t=new AbortController;if(this.request=t,this.player.close(),this.showStories([]),!this.isConnected){t.abort();return}let r=await Or(this,{signal:t.signal,timeout:this.timeout});if(t.signal.aborted)return;let i=this.activeHydration;if(!i||!r.some(c=>c.product)){this.request=void 0,this.showStories(r);return}this.showStories(r,"loading");let s=await kr((a=this.placement)!=null?a:"",r,i,{accountName:(d=this.accountName)!=null?d:"",publisherId:(l=this.publisherId)!=null?l:"",sessionId:(p=this.sessionId)!=null?p:"",userId:this.userId,channel:this.channel},{signal:t.signal,timeout:this.hydrationTimeout});t.signal.aborted||(this.request=void 0,this.products=s)}showStories(t,r){this.products=r,this.cardVideos.clear(),this.soundPending=!1,this.afterRender=void 0,this.carousel.reset(t.length),this.stories=t,this.events.impress(t)}*viewTargets(){var s;let{stories:t}=this;if(!this.player.isExpanded)for(let[n,{key:a,index:d}]of this.carousel.visibleCards()){let l=t[d];l&&((s=this.cardVideos.get(a))!=null&&s.playing)&&(yield[n,l])}let r=this.player.stageCard,i=t[this.carousel.active];r&&i&&this.player.video.playing&&(yield[r,i])}videoFor(t){let r=this.cardVideos.get(t);return r||(r=new B(this),this.cardVideos.set(t,r)),r}get activeVideo(){return this.cardVideos.get(this.carousel.activeKey)}leaveHighlight(t,r){let i=this.cardVideos.get(t);this.soundPending||(this.soundPending=i!==void 0&&!i.muted),this.inactiveAutoplay?i==null||i.mute():i==null||i.reset(),this.player.isOpen?(this.soundPending=!1,this.afterRender=()=>this.videoFor(r).pause()):this.soundPending&&(this.afterRender=()=>{this.soundPending=!1,this.videoFor(r).playWithSound()});for(let s of this.cardVideos.keys())Math.abs(s-r)>ne&&this.cardVideos.delete(s)}stepInPlayer(t){this.carousel.step(t,{evenIfLocked:!0}),this.player.showNext(t)}openPlayer({productOpen:t=!1}={}){var r;this.player.isOpen||((r=this.activeVideo)==null||r.pause(),this.player.open({productOpen:t}))}closePlayer(){if(this.player.isOpen){this.player.close();for(let t of this.cardVideos.values())t.resume();this.carousel.focusActive()}}get locale(){var t,r;return(r=(t=this.closest('[lang]:not([lang=""])'))==null?void 0:t.lang)!=null?r:Se}get labels(){var n;let{locale:t,labelAddToCart:r="",labelViewProduct:i=""}=this,s=JSON.stringify([t,r,i]);return((n=this.labelSet)==null?void 0:n.key)!==s&&(this.labelSet={key:s,labels:Lr(t,{addToCart:r,viewProduct:i})}),this.labelSet.labels}get formatPrice(){var i,s;let{locale:t}=this,r=`${t}|${(i=this.currency)!=null?i:""}`;return((s=this.formatter)==null?void 0:s.key)!==r&&(this.formatter={key:r,format:Ge(t,this.currency)}),this.formatter.format}productOf(t){var i;let r=this.products==="loading"?"loading":(i=this.products)==null?void 0:i.get(t.ad_id);return Ke(t,this.formatPrice,this.labels,r)}render(){let{stories:t}=this,r=this.carousel.active,i=t[r];if(!i)return f;let s=st(t.length,r).map(n=>{let a=(r+n+t.length)%t.length;return{offset:n,story:t[a],label:this.labels.position(this.labels.show,a,t.length)}});return m`
1312
- <div class="root">
1313
- ${this.carousel.render(t,this.renderSlide,this.labels)}
1628
+ `}};var Mr=(o,e)=>globalThis.fetch(o,e);var ni=()=>{let o=async(s,n,a,d,l)=>{let p=new URL(n,s).toString(),c=d?{"content-type":"application/json"}:void 0;return Mr(p,{body:d?JSON.stringify(d):void 0,method:a,signal:l==null?void 0:l.signal,headers:{accept:"application/json",...c}}).then(h=>{if(!h.ok)throw console.error({description:"HTTP error",response:h}),new Error(`HTTP error! status: ${h.status}`);return h.json()})};return{get:async(s,n,a)=>o(s,n,"GET",void 0,a),post:async(s,n,a,d)=>o(s,n,"POST",a,d),put:async(s,n,a)=>o(s,n,"PUT",a),delete:async(s,n)=>o(s,n,"DELETE")}},ht=ni(),ai="https://newtail-media.newtail.com.br/v1/rma/",di=async(o,e,t)=>ht.post(ai,o,e,{signal:t==null?void 0:t.signal}).then(r=>{if(r.validations&&r.validations.length>0)throw console.error(JSON.stringify({description:"Ads validation error",response:r},null,2)),new Error("Ads validation error");return r}),li=o=>Object.entries(o).filter(([,e])=>Array.isArray(e)).map(([e,t])=>[e,t.filter(r=>"product_sku"in r)]).filter(([e,t])=>t.length>0),ci=o=>Object.entries(o).filter(([,e])=>Array.isArray(e)).map(([e,t])=>[e,t.filter(r=>"type"in r&&r.type==="story")]).filter(([e,t])=>t.length>0),Dr=o=>{var e;return{skuId:o.product_sku,sellerId:(e=o.seller_id)!=null?e:"1",productId:o.product_metadata.productId}},Vr=o=>{var e,t,r;let{product:i}=o;if(!i)return;let s=(e=i.product_metadata)==null?void 0:e.productId;return{skuId:i.product_sku,sellerId:(r=(t=i.seller_id)!=null?t:o.seller_id)!=null?r:"1",productId:typeof s=="string"?s:""}},Rr=o=>{let e={};for(let[t,r]of o)e[t]=r;return e},pi=(o,e)=>{let t={};for(let[r,i]of Object.entries(o))t[r]=i.map(s=>e(s));return t},ui=(o,e)=>e?new Promise((t,r)=>{let i=()=>r(e.reason);if(e.aborted){i();return}e.addEventListener("abort",i,{once:!0}),o.then(t,r).finally(()=>e.removeEventListener("abort",i))}):o,Nr=(o,e)=>({eventUrls:{click:o.click_url,impression:o.impression_url,view:o.view_url},eventParameters:btoa(o.impression_url),sponsoredBySellerId:e}),hi=(o,e,t)=>({product:o,advertisement:Nr(e,t.sellerId)}),fi=(o,e)=>{var t;let r=Vr(o);return{story:o,product:e(r),offer:r,advertisement:Nr(o,(t=r==null?void 0:r.sellerId)!=null?t:o.seller_id)}},Or=(o,e)=>Object.values(o).flatMap(t=>t.map(r=>e(r))).filter(t=>t!==void 0),mi=(o,e)=>t=>t&&o.find(r=>e(r,t)),yi=(o,e)=>{var t;let r={},i=[];for(let[s,n]of Object.entries(o))for(let a of n){let d=Dr(a),l=e(d);l?((t=r[s])!=null||(r[s]=[]),r[s].push(hi(l,a,d))):i.push(a)}return{byPlacement:r,failed:i}},Hr=async({sponsoredProducts:o={},stories:e={}},t,r,i,s)=>{let n=[...Or(o,Dr),...Or(e,Vr)],a=n.length>0?await ui(t(n,i,{signal:s==null?void 0:s.signal}),s==null?void 0:s.signal):[],d=mi(a,r);return{sponsoredProducts:yi(o,d),stories:pi(e,l=>fi(l,d))}},Ur=(o,e)=>o.items.some(t=>t.itemId===e.skuId&&t.sellers.some(r=>r.sellerId===e.sellerId)),Fr=o=>`https://${o}.vtexcommercestable.com.br/api/intelligent-search/`,Br="product_search",vi=async(o,e,t)=>{let r=Fr(o),i=`product:${e.map(encodeURIComponent).join(";")}`,s=`${Br}?q=${i}`;return ht.get(r,s,t)},gi=24,bi=async(o,e,t)=>{let r=Fr(o),i=`sku:${e.map(encodeURIComponent).join(";")}`,s=`${Br}?q=${i}`;return ht.get(r,s,t)},xi=o=>{let e=new Map;for(let{skuId:t,sellerId:r}of o){let i=e.get(t);i?i.push(r):e.set(t,[r])}return e},wi=(o,e)=>o.map(t=>{let r=e.get(t.itemId);if(!r)return null;let i=t.sellers.filter(s=>r.includes(s.sellerId));return i.length===0?null:{...t,sellers:i}}).filter(t=>t!==null),$i=(o,e)=>{let t=xi(e);return o.map(r=>{let i=wi(r.items,t);return i.length===0?null:{...r,items:i}}).filter(r=>r!==null)},Si=(o,e)=>{let t=[];for(let r=0;r<o.length;r+=e)t.push(o.slice(r,r+e));return t},Ir=(o,e,t,r)=>Si(t,gi).map(i=>o(e,i,r)),Ai=o=>[...new Map(o.map(e=>[e.productId,e])).values()],qr=async(o,{accountName:e},t)=>{let r=new Set,i=new Set;for(let{productId:d,skuId:l}of o)d?r.add(d):i.add(l);let s={signal:t==null?void 0:t.signal},n=await Promise.all([...Ir(vi,e,[...r],s),...Ir(bi,e,[...i],s)]),a=Ai(n.flatMap(d=>d.products));return $i(a,o)},zr=(o,{skuId:e,sellerId:t})=>{var r,i;return(i=(r=o.items.find(s=>s.itemId===e))==null?void 0:r.sellers.find(s=>s.sellerId===t))==null?void 0:i.commertialOffer},Lr=o=>typeof o=="number"&&Number.isFinite(o)?o:void 0,Wr=(o,e)=>{let t=zr(o,e),r=Lr(t==null?void 0:t.Price);if(r===void 0)return;let i=Lr(t==null?void 0:t.ListPrice);return i!==void 0&&i>r?{price:r,listPrice:i}:{price:r}},jr=(o,e)=>{var t;let r=(t=zr(o,e))==null?void 0:t.AvailableQuantity;return typeof r=="number"&&!Number.isNaN(r)?r>0:void 0},Ie=({selectedFacets:o,attributeSynonyms:e,attributePrefix:t})=>{if(!(o!=null&&o.length))return;let r=e==null?void 0:e.map(n=>n.toLowerCase()),i=t==null?void 0:t.toLowerCase(),s=o.filter(n=>{let a=n.key.toLowerCase();return(r==null?void 0:r.includes(a))||i&&a.startsWith(i)});if(s.length>0)return s},_i=o=>{var e;return(e=Ie({selectedFacets:o,attributeSynonyms:["categoria","c"],attributePrefix:"category"}))==null?void 0:e.map(t=>t.value).join(" > ")},Ci=o=>{var e;return(e=Ie({selectedFacets:o,attributeSynonyms:["brand","b"]}))==null?void 0:e.map(t=>t.value)[0]},Ei=o=>{var e;return(e=Ie({selectedFacets:o,attributeSynonyms:["productClusterIds","productClusterNames"]}))==null?void 0:e.map(t=>`product_cluster/${t.value}`)},Ti=o=>{var e;return(e=Ie({selectedFacets:o,attributeSynonyms:["sellerName","seller"]}))==null?void 0:e.map(t=>t.value)[0]},Pi=o=>({category:_i(o),brand:Ci(o),tags:Ei(o),seller:Ti(o)}),ki=({term:o,category:e,brand:t,skuId:r})=>o?"search":e?"category":t?"brand_page":r?"product_page":"home",Mi=o=>{var e;let{category:t,brand:r,tags:i,seller:s}=Pi(o.search.selectedFacets),n=(e=o.search.term)!=null?e:!t&&!r?s:void 0,a=ki({term:n,category:t,brand:r,skuId:o.search.skuId});return{brand_name:r,category_name:t,tags:i,context:a,placements:o.placements,channel:o.identity.channel,term:n,session_id:o.identity.sessionId,user_id:o.identity.userId,product_sku:o.search.skuId}},Gr=async(o,e)=>{let t=Mi(o),r=await di(o.identity.publisherId,t,e);return{sponsoredProducts:Rr(li(r)),stories:Rr(ci(r)),banners:void 0,sponsoredBrands:void 0}};var ee=(o,e,t)=>{let r=o!==void 0&&Number.isFinite(o)&&o>0?o:e,i=new AbortController,s=setTimeout(()=>i.abort(new DOMException(`Timed out after ${r} ms`,"TimeoutError")),r),n=()=>i.abort(t==null?void 0:t.reason);return t!=null&&t.aborted?n():t==null||t.addEventListener("abort",n,{once:!0}),{signal:i.signal,clear:()=>{clearTimeout(s),t==null||t.removeEventListener("abort",n)}}};var Ri=5e3,Zr={fetcher:qr,matcher:Ur,price:Wr,available:jr};function Oi(o){let e=i=>typeof i=="number"&&Number.isFinite(i)&&i>=0;if(!e(o==null?void 0:o.price))return;let{price:t,listPrice:r}=o;return e(r)&&r>t?{price:t,listPrice:r}:{price:t}}async function Qr(o,e,t,r,{signal:i,timeout:s}={}){var d,l;let n=new Map,a=ee(s,Ri,i);try{let p=await Hr({stories:{[o]:e}},t.fetcher,(c,h)=>t.matcher(c,h),r,{signal:a.signal});for(let{story:c,product:h,offer:m}of(d=p.stories[o])!=null?d:[])if(!(!h||!m))try{let y=Oi(t.price(h,m)),A=(l=t.available)==null?void 0:l.call(t,h,m);n.set(c.ad_id,{...y&&{price:y},...A!==void 0&&{available:A}})}catch(y){console.error(`[${x}] Product details failed for ad ${c.ad_id}`,y)}}catch(p){a.signal.aborted||console.error(`[${x}] Product request failed`,p)}finally{a.clear()}return n}var Ii=2e3,Li=8,Di=o=>o!==void 0&&Number.isFinite(o)&&o>=1?Math.floor(o):Li;async function Kr({publisherId:o,sessionId:e,placement:t,userId:r,accountName:i,channel:s,quantity:n},{signal:a,timeout:d}={}){var h;if(globalThis.window===void 0||!o||!e||!t)return[];let p=ee(d,Ii,a),c=Di(n);try{let{stories:m}=await Gr({identity:{accountName:i!=null?i:"",publisherId:o,sessionId:e,userId:r,channel:s},search:{},placements:{[t]:{quantity:c,types:["story"]}}},{signal:p.signal});return((h=m[t])!=null?h:[]).slice(0,c)}catch(m){return p.signal.aborted||console.error(`[${x}] Story request failed`,{placement:t,publisherId:o,error:m}),[]}finally{p.clear()}}var Vi=3e3;function Xr(o){if(typeof Image=="undefined")return Promise.resolve(!0);let e=new Image;return e.src=o,e.decode?e.decode().then(()=>!0,()=>!1):Promise.resolve(!0)}function Yr(o,e){if(!o.length)return Promise.resolve();let t=ee(void 0,Vi,e);return new Promise(r=>{let i=()=>{t.clear(),r()};if(t.signal.aborted)return i();t.signal.addEventListener("abort",i,{once:!0});let s=0;for(let n of o)n.then(a=>{(a||++s===o.length)&&i()},()=>{++s===o.length&&i()})})}var Ni="vtex-ads-story:add-to-cart",Hi="vtex-ads-story:remove-from-cart";function Jr(o,{sku:e,seller:t},r){return new CustomEvent(o,{detail:{sku:e,...t&&{seller:t},quantity:r},bubbles:!0,composed:!0})}function eo(o,e=1){return Jr(Ni,o,e)}function to(o,e=1){return Jr(Hi,o,e)}var Ui=["publisherId","sessionId","placement","userId","accountName","channel","quantity","hydration"],Fi=new Set(["site","app"]),Bi=o=>Fi.has(o),qi={fromAttribute:o=>typeof o=="string"&&(o===""||o.toLowerCase()==="true")},zi={fromAttribute:o=>Bi(o)?o:void 0},Wi={fromAttribute:o=>o==="none"?"none":void 0},ro=({sku:o,seller:e})=>JSON.stringify([o,e!=null?e:""]),D=class extends R{constructor(){super();this.cartQuantities=new Map;this.cardVideos=new Map;this.soundPending=!1;this.carousel=new he(this,{onStep:(t,r)=>this.leaveHighlight(t,r),onLayoutChange:()=>{this.cardVideos.clear(),this.player.isOpen&&(this.afterRender=()=>{var t;return(t=this.activeVideo)==null?void 0:t.pause()})},locked:()=>this.player.isOpen||this.mediaLoading,slideDuration:()=>this.slideDuration,reducedMotion:Q});this.player=new me(this,{onStep:t=>this.stepInPlayer(t),onClose:()=>this.closePlayer()});this.events=new fe(this,{identity:()=>({sessionId:this.sessionId,userId:this.userId}),viewTargets:()=>this.viewTargets()});this.renderSlide=(t,{key:r,index:i,offset:s,active:n,hidden:a,cardRef:d,focusRef:l})=>st(t,this.videoFor(r),{label:this.labels.position(n?this.labels.watch:this.labels.show,i,this.stories.length),labels:this.labels,withVideo:n||this.inactiveAutoplay&&!a,autoplay:!this.mediaLoading,product:this.productOf(t),onSelect:n?()=>this.openPlayer():()=>this.carousel.step(s),onProductSelect:n?()=>this.openPlayer({productOpen:!0}):void 0,cta:ke(t),onCtaSelect:n?void 0:()=>this.carousel.step(s),onPress:()=>this.events.click(t),ref:d,openRef:l});this.inactiveAutoplay=!1,this.stories=[],this.requesting=!1,this.mediaLoading=!1}connectedCallback(){var t;super.connectedCallback();for(let r of this.cardVideos.values())r.resume();(t=this.request)!=null&&t.signal.aborted&&this.loadStory()}disconnectedCallback(){var t,r;super.disconnectedCallback(),(t=this.request)==null||t.abort(),(r=this.mediaWait)==null||r.abort()}willUpdate(t){Ui.some(r=>t.has(r))&&this.loadStory()}updated(){let t=this.afterRender;this.afterRender=void 0,t==null||t()}get activeHydration(){if(this.hydration!=="none")return this.hydration?this.hydration:this.accountName?Zr:void 0}async loadStory(){var n,a,d,l,p;(n=this.request)==null||n.abort();let t=new AbortController;if(this.request=t,this.player.close(),this.requesting=!1,this.showStories([]),!this.isConnected){t.abort();return}this.requesting=!!(this.publisherId&&this.sessionId&&this.placement);let r=await Kr(this,{signal:t.signal,timeout:this.timeout});if(t.signal.aborted)return;this.requesting=!1;let i=this.activeHydration;if(!i||!r.some(c=>c.product)){this.request=void 0,this.showStories(r);return}this.showStories(r,"loading");let s=await Qr((a=this.placement)!=null?a:"",r,i,{accountName:(d=this.accountName)!=null?d:"",publisherId:(l=this.publisherId)!=null?l:"",sessionId:(p=this.sessionId)!=null?p:"",userId:this.userId,channel:this.channel},{signal:t.signal,timeout:this.hydrationTimeout});t.signal.aborted||(this.request=void 0,this.products=s)}showStories(t,r){this.products=r,this.cardVideos.clear(),this.soundPending=!1,this.afterRender=void 0,this.carousel.reset(t.length),this.stories=t,this.waitForFirstMedia(t)}async waitForFirstMedia(t){var a,d,l;(a=this.mediaWait)==null||a.abort();let r=new AbortController;this.mediaWait=r;let i=b((d=t[0])==null?void 0:d.poster_url),s=b((l=t[0])==null?void 0:l.media_url),n=[];i&&n.push(Xr(i)),s&&n.push(this.videoFor(this.carousel.activeKey).ready),this.mediaLoading=n.length>0,await Yr(n,r.signal),this.mediaWait===r&&(this.mediaWait=void 0,this.mediaLoading=!1,this.events.impress(t),this.afterRender=()=>{if(this.isConnected)for(let p of this.cardVideos.values())p.resume()},this.requestUpdate())}*viewTargets(){var s;let{stories:t}=this;if(this.mediaLoading)return;if(!this.player.isExpanded)for(let[n,{key:a,index:d}]of this.carousel.visibleCards()){let l=t[d];l&&((s=this.cardVideos.get(a))!=null&&s.playing)&&(yield[n,l])}let r=this.player.stageCard,i=t[this.carousel.active];r&&i&&this.player.video.playing&&(yield[r,i])}videoFor(t){let r=this.cardVideos.get(t);return r||(r=new z(this),this.cardVideos.set(t,r)),r}get activeVideo(){return this.cardVideos.get(this.carousel.activeKey)}leaveHighlight(t,r){let i=this.cardVideos.get(t);this.soundPending||(this.soundPending=i!==void 0&&!i.muted),this.inactiveAutoplay?i==null||i.mute():i==null||i.reset(),this.player.isOpen?(this.soundPending=!1,this.afterRender=()=>this.videoFor(r).pause()):this.soundPending&&(this.afterRender=()=>{this.soundPending=!1,this.videoFor(r).playWithSound()});for(let s of this.cardVideos.keys())Math.abs(s-r)>ue&&this.cardVideos.delete(s)}stepInPlayer(t){this.carousel.step(t,{evenIfLocked:!0}),this.player.showNext(t)}openPlayer({productOpen:t=!1}={}){var r;this.player.isOpen||(this.cartQuantities.clear(),(r=this.activeVideo)==null||r.pause(),this.player.open({productOpen:t}))}closePlayer(){if(this.player.isOpen){this.player.close();for(let t of this.cardVideos.values())t.resume();this.carousel.focusActive()}}get locale(){var t,r;return(r=(t=this.closest('[lang]:not([lang=""])'))==null?void 0:t.lang)!=null?r:Pe}get labels(){var n;let{locale:t,labelAddToCart:r="",labelViewProduct:i=""}=this,s=JSON.stringify([t,r,i]);return((n=this.labelSet)==null?void 0:n.key)!==s&&(this.labelSet={key:s,labels:dr(t,{addToCart:r,viewProduct:i})}),this.labelSet.labels}get formatPrice(){var i,s;let{locale:t}=this,r=`${t}|${(i=this.currency)!=null?i:""}`;return((s=this.formatter)==null?void 0:s.key)!==r&&(this.formatter={key:r,format:Ye(t,this.currency)}),this.formatter.format}productOf(t){var i;let r=this.products==="loading"?"loading":(i=this.products)==null?void 0:i.get(t.ad_id);return Je(t,this.formatPrice,this.labels,r)}render(){let{stories:t}=this,r=this.carousel.active,i=t[r];if(!i&&!this.requesting)return u;let s=this.requesting||this.mediaLoading;return f`
1629
+ <div
1630
+ class="root"
1631
+ ?data-loading=${s}
1632
+ ?data-requesting=${this.requesting}
1633
+ >
1634
+ ${i?this.carousel.render(t,this.renderSlide,this.labels):u}
1635
+ ${lt({done:!s})}
1314
1636
  </div>
1315
- ${this.player.render(i,{labels:this.labels,navigation:t.length>1,neighbors:s,product:this.productOf(i),cta:Ae(i),onPress:()=>this.events.click(i)})}
1316
- `}};R.properties={publisherId:{attribute:"publisher-id"},sessionId:{attribute:"session-id"},placement:{},userId:{attribute:"user-id"},accountName:{attribute:"account-name"},channel:{converter:ai},timeout:{type:Number},quantity:{type:Number},currency:{},labelAddToCart:{attribute:"label-add-to-cart"},labelViewProduct:{attribute:"label-view-product"},hydration:{converter:di},hydrationTimeout:{type:Number,attribute:"hydration-timeout"},inactiveAutoplay:{type:Boolean,attribute:"inactive-autoplay",converter:ni},stories:{state:!0},products:{state:!0}},R.styles=[g`
1637
+ ${i?this.renderPlayer(i):u}
1638
+ `}renderPlayer(t){let{stories:r}=this,i=this.carousel.active,s=ut(r.length,i).map(a=>{let d=(i+a+r.length)%r.length;return{offset:a,story:r[d],label:this.labels.position(this.labels.show,d,r.length)}}),n=this.productOf(t);return this.player.render(t,{labels:this.labels,navigation:r.length>1,neighbors:s,product:n,cta:ke(t),productActions:this.cartActionsFor(n),onPress:()=>this.events.click(t)})}cartActionsFor(t){let r=t==null?void 0:t.sku;if(!r)return;let i={sku:r,seller:t.seller};return{cartQuantity:this.cartQuantities.get(ro(i)),onAddToCart:()=>this.changeCart(i,1),onRemoveFromCart:()=>this.changeCart(i,-1)}}changeCart(t,r){var l;let i=ro(t),s=(l=this.cartQuantities.get(i))!=null?l:0,n=Math.max(0,s+r);if(n===s)return;n>0?this.cartQuantities.set(i,n):this.cartQuantities.delete(i),this.requestUpdate(),this.dispatchEvent(r>0?eo(t):to(t));let a;if(s===0?a="stepper":n===0&&(a="add"),!a)return;let d=a;this.updateComplete.then(()=>this.shadowRoot&&tt(this.shadowRoot,d))}};D.properties={publisherId:{attribute:"publisher-id"},sessionId:{attribute:"session-id"},placement:{},userId:{attribute:"user-id"},accountName:{attribute:"account-name"},channel:{converter:zi},timeout:{type:Number},quantity:{type:Number},currency:{},labelAddToCart:{attribute:"label-add-to-cart"},labelViewProduct:{attribute:"label-view-product"},hydration:{converter:Wi},hydrationTimeout:{type:Number,attribute:"hydration-timeout"},slideDuration:{type:Number,attribute:"slide-duration"},inactiveAutoplay:{type:Boolean,attribute:"inactive-autoplay",converter:qi},stories:{state:!0},products:{state:!0},requesting:{state:!0},mediaLoading:{state:!0}},D.styles=[g`
1317
1639
  :host {
1318
1640
  display: block;
1319
1641
  font-family: var(--vtex-ads-story-font-family, inherit);
1320
1642
  color: var(--vtex-ads-story-color-text, inherit);
1643
+ --_pill-radius: var(--vtex-ads-story-radius, 16px);
1644
+ --_pill-inset: 8px;
1645
+ --_button-radius: var(--vtex-ads-story-radius, 999px);
1321
1646
  }
1322
- `,Qe,Ye,rt,it];function ce(){typeof customElements!="undefined"&&(customElements.get($)||customElements.define($,R))}ce();return Ur(li);})();
1647
+ `,it,Qe,ot,at,dt,pt];function ye(){typeof customElements!="undefined"&&(customElements.get(x)||customElements.define(x,D))}ye();return lo(ji);})();
1323
1648
  /*! Icons from Phosphor Icons (https://phosphoricons.com), MIT License, Copyright (c) 2023 Phosphor Icons */
1324
1649
  /*! Bundled license information:
1325
1650