@liquidcommercedev/rmn-sdk 1.4.6-beta.4 → 1.4.6-beta.6

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.esm.js CHANGED
@@ -54,6 +54,8 @@ var RMN_FILTER_PROPERTIES;
54
54
  })(RMN_FILTER_PROPERTIES || (RMN_FILTER_PROPERTIES = {}));
55
55
  var RMN_SPOT_EVENT;
56
56
  (function (RMN_SPOT_EVENT) {
57
+ RMN_SPOT_EVENT["MOUNTED"] = "MOUNTED";
58
+ RMN_SPOT_EVENT["UNMOUNTED"] = "UNMOUNTED";
57
59
  RMN_SPOT_EVENT["IMPRESSION"] = "IMPRESSION";
58
60
  RMN_SPOT_EVENT["CLICK"] = "CLICK";
59
61
  RMN_SPOT_EVENT["PURCHASE"] = "PURCHASE";
@@ -15162,6 +15164,46 @@ const GFONT_CORMORANT = `
15162
15164
  <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Cormorant:ital,wght@0,300..700;1,300..700&family=Source+Sans+3:ital,wght@0,200..900;1,200..900&display=swap">
15163
15165
  `;
15164
15166
 
15167
+ class IntersectionObserverService {
15168
+ constructor(defaultOptions = {}) {
15169
+ this.observers = new Map();
15170
+ this.defaultOptions = {
15171
+ root: null,
15172
+ rootMargin: '0px',
15173
+ threshold: 0.5,
15174
+ ...defaultOptions,
15175
+ };
15176
+ }
15177
+ observe(element, callback, options = {}) {
15178
+ const mergedOptions = { ...this.defaultOptions, ...options };
15179
+ const ioCallback = (entries) => {
15180
+ entries.forEach((entry) => {
15181
+ if (entry.isIntersecting) {
15182
+ callback(entry);
15183
+ }
15184
+ });
15185
+ };
15186
+ const observer = new IntersectionObserver(ioCallback, mergedOptions);
15187
+ this.observers.set(element, observer);
15188
+ observer.observe(element);
15189
+ }
15190
+ unobserve(element) {
15191
+ const observer = this.observers.get(element);
15192
+ if (observer) {
15193
+ observer.unobserve(element);
15194
+ observer.disconnect();
15195
+ this.observers.delete(element);
15196
+ }
15197
+ }
15198
+ unobserveAll() {
15199
+ this.observers.forEach((observer, element) => {
15200
+ observer.unobserve(element);
15201
+ observer.disconnect();
15202
+ });
15203
+ this.observers.clear();
15204
+ }
15205
+ }
15206
+
15165
15207
  class ResizeObserverService {
15166
15208
  constructor({ element, maxSize, minScale }) {
15167
15209
  this.element = element;
@@ -15201,9 +15243,9 @@ class ResizeObserverService {
15201
15243
  newWidth = Math.min(containerWidth, this.maxSize.width);
15202
15244
  newHeight = newWidth / this.aspectRatio;
15203
15245
  // If the height exceeds the container, adjust based on height
15204
- if (newHeight > containerHeight) {
15205
- newHeight = containerHeight;
15206
- newWidth = newHeight * this.aspectRatio;
15246
+ if (newWidth > containerWidth) {
15247
+ newWidth = containerWidth;
15248
+ newHeight = containerHeight * this.aspectRatio;
15207
15249
  }
15208
15250
  // Ensure we're not going below minimum dimensions
15209
15251
  newWidth = Math.max(newWidth, this.minSize.width);
@@ -15230,6 +15272,36 @@ class ResizeObserverService {
15230
15272
  }
15231
15273
  }
15232
15274
 
15275
+ function calculateScaleFactor(elementScale) {
15276
+ // Step 1: Apply square root for non-linear scaling
15277
+ // This creates a more gradual scaling effect, especially for larger changes
15278
+ // For example:
15279
+ // - elementScale of 0.25 (1/4 size) becomes 0.5
15280
+ // - elementScale of 1 (unchanged) remains 1
15281
+ // - elementScale of 4 (4x size) becomes 2
15282
+ const baseFactor = Math.sqrt(elementScale);
15283
+ // Step 2: Apply additional dampening to further soften the scaling effect
15284
+ // The dampening factor (0.5) can be adjusted:
15285
+ // - Lower values (closer to 0) make scaling more subtle
15286
+ // - Higher values (closer to 1) make scaling more pronounced
15287
+ const dampening = 0.35;
15288
+ // Calculate the scaleFactor:
15289
+ // 1. (baseFactor - 1) represents the change from the original size
15290
+ // 2. Multiply by dampening to reduce the effect
15291
+ // 3. Add 1 to center the scaling around the original size
15292
+ // For example, if baseFactor is 2:
15293
+ // scaleFactor = 1 + (2 - 1) * 0.5 = 1.5
15294
+ const scaleFactor = 1 + (baseFactor - 1) * dampening;
15295
+ // Step 3: Define the allowed range for the scale factor
15296
+ // This ensures that the font size never changes too drastically
15297
+ const minScale = 0.35; // Font will never be smaller than 50% of original
15298
+ const maxScale = 1.5; // Font will never be larger than 150% of original
15299
+ // Step 4: Clamp the scale factor to the defined range
15300
+ // Math.min ensures the value doesn't exceed maxScale
15301
+ // Math.max ensures the value isn't less than minScale
15302
+ return Math.max(minScale, Math.min(maxScale, scaleFactor));
15303
+ }
15304
+
15233
15305
  const CAROUSEL_COMPONENT_STYLE = ({ width, height, fluid }) => `
15234
15306
  :host {
15235
15307
  position: relative;
@@ -15417,6 +15489,7 @@ if (typeof window !== 'undefined' && typeof window.customElements !== 'undefined
15417
15489
  this.autoplayInterval = null;
15418
15490
  this.useDots = false;
15419
15491
  this.useButtons = false;
15492
+ this.originalFontSizes = new Map();
15420
15493
  this.attachShadow({ mode: 'open' });
15421
15494
  }
15422
15495
  connectedCallback() {
@@ -15455,7 +15528,7 @@ if (typeof window !== 'undefined' && typeof window.customElements !== 'undefined
15455
15528
  this.validateOptions();
15456
15529
  }
15457
15530
  setupResizeObserver() {
15458
- if (this.data) {
15531
+ if (this.data && !this.data.fluid) {
15459
15532
  this.resizeObserver = new ResizeObserverService({
15460
15533
  element: this,
15461
15534
  maxSize: {
@@ -15468,7 +15541,28 @@ if (typeof window !== 'undefined' && typeof window.customElements !== 'undefined
15468
15541
  }
15469
15542
  }
15470
15543
  handleCarouselSizeChanged(event) {
15471
- console.info('Carousel Size Changed', event);
15544
+ const isRBSpot = 'rbHeroadaksda'.startsWith('rb');
15545
+ if (!isRBSpot) {
15546
+ // Adjust text elements font size based on the scale factor
15547
+ this.adjustFontSize(event.detail.scale);
15548
+ }
15549
+ }
15550
+ adjustFontSize(elementScale) {
15551
+ var _a;
15552
+ const scaleFactor = calculateScaleFactor(elementScale);
15553
+ // Find all text elements within the shadow root
15554
+ const elements = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelectorAll('h1, h2, h3, h4, p, span');
15555
+ elements === null || elements === void 0 ? void 0 : elements.forEach((element) => {
15556
+ if (element instanceof HTMLElement) {
15557
+ if (!this.originalFontSizes.has(element)) {
15558
+ const originalSize = parseFloat(window.getComputedStyle(element).fontSize);
15559
+ this.originalFontSizes.set(element, originalSize);
15560
+ }
15561
+ const originalSize = this.originalFontSizes.get(element);
15562
+ const newFontSize = originalSize * scaleFactor;
15563
+ element.style.fontSize = `${newFontSize}px`;
15564
+ }
15565
+ });
15472
15566
  }
15473
15567
  render() {
15474
15568
  var _a;
@@ -15677,7 +15771,7 @@ if (typeof window !== 'undefined' && typeof window.customElements !== 'undefined
15677
15771
  * #########################################################
15678
15772
  */
15679
15773
  setupResizeObserver() {
15680
- if (this.data) {
15774
+ if (this.data && !this.data.fluid) {
15681
15775
  this.resizeObserver = new ResizeObserverService({
15682
15776
  element: this,
15683
15777
  maxSize: {
@@ -15694,20 +15788,23 @@ if (typeof window !== 'undefined' && typeof window.customElements !== 'undefined
15694
15788
  * #########################################################
15695
15789
  */
15696
15790
  handleSpotSizeChanged(event) {
15697
- console.info('Spot Size Changed', event);
15698
- // Adjust text elements font size based on the scale factor
15699
- this.adjustFontSize(event.detail.scale);
15791
+ var _a, _b, _c;
15792
+ const isRBSpot = (_c = (_b = (_a = this.data) === null || _a === void 0 ? void 0 : _a.spot) === null || _b === void 0 ? void 0 : _b.startsWith('rb')) !== null && _c !== void 0 ? _c : false;
15793
+ if (!isRBSpot) {
15794
+ // Adjust text elements font size based on the scale factor
15795
+ this.adjustFontSize(event.detail.scale);
15796
+ }
15700
15797
  }
15701
15798
  adjustFontSize(elementScale) {
15702
15799
  var _a;
15703
- const scaleFactor = this.calculateScaleFactor(elementScale);
15800
+ const scaleFactor = calculateScaleFactor(elementScale);
15704
15801
  // Find all text elements within the shadow root
15705
15802
  const elements = (_a = this.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelectorAll('h1, h2, h3, h4, p, span');
15706
15803
  elements === null || elements === void 0 ? void 0 : elements.forEach((element) => {
15707
15804
  if (element instanceof HTMLElement) {
15708
15805
  if (!this.originalFontSizes.has(element)) {
15709
- const orignalSize = parseFloat(window.getComputedStyle(element).fontSize);
15710
- this.originalFontSizes.set(element, orignalSize);
15806
+ const originalSize = parseFloat(window.getComputedStyle(element).fontSize);
15807
+ this.originalFontSizes.set(element, originalSize);
15711
15808
  }
15712
15809
  const originalSize = this.originalFontSizes.get(element);
15713
15810
  const newFontSize = originalSize * scaleFactor;
@@ -15715,35 +15812,6 @@ if (typeof window !== 'undefined' && typeof window.customElements !== 'undefined
15715
15812
  }
15716
15813
  });
15717
15814
  }
15718
- calculateScaleFactor(elementScale) {
15719
- // Step 1: Apply square root for non-linear scaling
15720
- // This creates a more gradual scaling effect, especially for larger changes
15721
- // For example:
15722
- // - elementScale of 0.25 (1/4 size) becomes 0.5
15723
- // - elementScale of 1 (unchanged) remains 1
15724
- // - elementScale of 4 (4x size) becomes 2
15725
- const baseFactor = Math.sqrt(elementScale);
15726
- // Step 2: Apply additional dampening to further soften the scaling effect
15727
- // The dampening factor (0.5) can be adjusted:
15728
- // - Lower values (closer to 0) make scaling more subtle
15729
- // - Higher values (closer to 1) make scaling more pronounced
15730
- const dampening = 0.5;
15731
- // Calculate the scaleFactor:
15732
- // 1. (baseFactor - 1) represents the change from the original size
15733
- // 2. Multiply by dampening to reduce the effect
15734
- // 3. Add 1 to center the scaling around the original size
15735
- // For example, if baseFactor is 2:
15736
- // scaleFactor = 1 + (2 - 1) * 0.5 = 1.5
15737
- const scaleFactor = 1 + (baseFactor - 1) * dampening;
15738
- // Step 3: Define the allowed range for the scale factor
15739
- // This ensures that the font size never changes too drastically
15740
- const minScale = 0.5; // Font will never be smaller than 90% of original
15741
- const maxScale = 1.5; // Font will never be larger than 110% of original
15742
- // Step 4: Clamp the scale factor to the defined range
15743
- // Math.min ensures the value doesn't exceed maxScale
15744
- // Math.max ensures the value isn't less than minScale
15745
- return Math.max(minScale, Math.min(maxScale, scaleFactor));
15746
- }
15747
15815
  /**
15748
15816
  * Spot element rendering
15749
15817
  * #########################################################
@@ -15794,6 +15862,7 @@ class ElementService {
15794
15862
  }
15795
15863
  const spot = document.createElement(SPOT_ELEMENT_TAG);
15796
15864
  spot.data = {
15865
+ spot: config === null || config === void 0 ? void 0 : config.spot,
15797
15866
  fluid: (_a = config === null || config === void 0 ? void 0 : config.fluid) !== null && _a !== void 0 ? _a : false,
15798
15867
  ...config,
15799
15868
  };
@@ -15815,6 +15884,7 @@ class ElementService {
15815
15884
  }
15816
15885
  const carousel = document.createElement(CAROUSEL_ELEMENT_TAG);
15817
15886
  carousel.data = {
15887
+ spot: config === null || config === void 0 ? void 0 : config.spot,
15818
15888
  fluid: false,
15819
15889
  ...config,
15820
15890
  };
@@ -16699,12 +16769,7 @@ function wideSkyscraperV1Template(spot) {
16699
16769
 
16700
16770
  const STYLES$7 = ({ primaryImage, mobilePrimaryImage = primaryImage }, { prefix }) => `
16701
16771
  <style>
16702
- :host {
16703
- min-width: 320px;
16704
- min-height: 223px;
16705
- }
16706
-
16707
- .${prefix}__content {
16772
+ .${prefix} {
16708
16773
  display: block;
16709
16774
  width: 100%;
16710
16775
  height: 100%;
@@ -16713,10 +16778,11 @@ const STYLES$7 = ({ primaryImage, mobilePrimaryImage = primaryImage }, { prefix
16713
16778
  background-repeat: no-repeat;
16714
16779
  background-position: center;
16715
16780
  cursor: pointer;
16781
+ container-type: inline-size;
16716
16782
  }
16717
16783
 
16718
- @media (min-width: 640px) {
16719
- .${prefix}__content {
16784
+ @container (min-width: 640px) {
16785
+ .${prefix} {
16720
16786
  background-image: url("${primaryImage}");
16721
16787
  }
16722
16788
  }
@@ -16726,7 +16792,7 @@ function rbCollectionBannerWithoutTextBlockTemplate(spot, config) {
16726
16792
  const { prefix = '' } = config;
16727
16793
  return `
16728
16794
  ${STYLES$7(spot, config)}
16729
- <div class="${prefix}__content"></div>
16795
+ <div class="${prefix}"></div>
16730
16796
  `;
16731
16797
  }
16732
16798
 
@@ -16735,16 +16801,6 @@ const STYLES$6 = ({ textColor = '#ffffff', ctaTextColor = textColor, ctaBorderCo
16735
16801
  return `
16736
16802
  <style>
16737
16803
  .${prefix} {
16738
- min-width: 320px;
16739
- min-height: 388px;
16740
- width: 100%;
16741
- height: 100%;
16742
- display: block;
16743
- position: relative;
16744
- container-type: inline-size;
16745
- }
16746
-
16747
- .${prefix}__content {
16748
16804
  display: flex;
16749
16805
  flex-direction: column;
16750
16806
  justify-content: flex-end;
@@ -16759,6 +16815,7 @@ const STYLES$6 = ({ textColor = '#ffffff', ctaTextColor = textColor, ctaBorderCo
16759
16815
  box-sizing: border-box;
16760
16816
  color: ${textColor};
16761
16817
  cursor: pointer;
16818
+ container-type: inline-size;
16762
16819
  }
16763
16820
 
16764
16821
  .${prefix}__text {
@@ -16803,17 +16860,17 @@ const STYLES$6 = ({ textColor = '#ffffff', ctaTextColor = textColor, ctaBorderCo
16803
16860
  transition: background-color 0.3s ease;
16804
16861
  }
16805
16862
 
16806
- .${prefix}__content:hover .cta-button {
16863
+ .${prefix}:hover .cta-button {
16807
16864
  background-color: ${ctaBorderColor.length === 7 ? `${ctaBorderColor}15` : `${ctaBorderColor}`};
16808
16865
  }
16809
16866
 
16810
- @media (min-width: 640px) {
16811
- .${prefix}__content {
16867
+ @container (min-width: 640px) {
16868
+ .${prefix} {
16812
16869
  background-image: linear-gradient(to top, ${linearGradient}), url("${primaryImage}");
16813
16870
  }
16814
16871
  }
16815
16872
 
16816
- @media (min-width: 768px) {
16873
+ @container (min-width: 768px) {
16817
16874
  .${prefix}__primary-image {
16818
16875
  width: 66.66666%;
16819
16876
  height: 100%;
@@ -16824,7 +16881,7 @@ const STYLES$6 = ({ textColor = '#ffffff', ctaTextColor = textColor, ctaBorderCo
16824
16881
  height: 100%;
16825
16882
  width: 33.33333%;
16826
16883
  }
16827
-
16884
+
16828
16885
  .${prefix}__secondary-image {
16829
16886
  width: 100%;
16830
16887
  height: 50%;
@@ -16833,7 +16890,7 @@ const STYLES$6 = ({ textColor = '#ffffff', ctaTextColor = textColor, ctaBorderCo
16833
16890
  .${prefix}__header {
16834
16891
  font-size: 22px;
16835
16892
  }
16836
-
16893
+
16837
16894
  .${prefix}__description {
16838
16895
  font-size: 12px;
16839
16896
  }
@@ -16843,7 +16900,7 @@ const STYLES$6 = ({ textColor = '#ffffff', ctaTextColor = textColor, ctaBorderCo
16843
16900
  }
16844
16901
  }
16845
16902
 
16846
- @media (min-width: 1024px) {
16903
+ @container (min-width: 1024px) {
16847
16904
  .${prefix}__header {
16848
16905
  font-size: 24px;
16849
16906
  }
@@ -16857,11 +16914,11 @@ const STYLES$6 = ({ textColor = '#ffffff', ctaTextColor = textColor, ctaBorderCo
16857
16914
  }
16858
16915
  }
16859
16916
 
16860
- @media (min-width: 1280px) {
16917
+ @container (min-width: 1280px) {
16861
16918
  .${prefix}__header {
16862
16919
  font-size: 28px;
16863
16920
  }
16864
-
16921
+
16865
16922
  .${prefix}__description {
16866
16923
  font-size: 14px;
16867
16924
  }
@@ -16881,13 +16938,11 @@ function rbHomepageHeroFullImageTemplate(spot, config) {
16881
16938
  ${GFONT_CORMORANT}
16882
16939
  ${STYLES$6(spot, config)}
16883
16940
  <div class="${prefix}">
16884
- <div class="${prefix}__content">
16885
- <div class="${prefix}__text">
16886
- ${spot.header ? `<h2 class="${prefix}__header">${spot.header}</h2>` : ''}
16887
- ${spot.description ? `<p class="${prefix}__description">${spot.description}</p>` : ''}
16888
- ${spot.ctaText ? `<span class="${prefix}__cta-button">${spot.ctaText}</span>` : ''}
16889
- </div>
16890
- </div>
16941
+ <div class="${prefix}__text">
16942
+ ${spot.header ? `<h2 class="${prefix}__header">${spot.header}</h2>` : ''}
16943
+ ${spot.description ? `<p class="${prefix}__description">${spot.description}</p>` : ''}
16944
+ ${spot.ctaText ? `<span class="${prefix}__cta-button">${spot.ctaText}</span>` : ''}
16945
+ </div>
16891
16946
  </div>
16892
16947
  `;
16893
16948
  }
@@ -16895,8 +16950,6 @@ function rbHomepageHeroFullImageTemplate(spot, config) {
16895
16950
  const STYLES$5 = ({ textColor = '#212121', backgroundColor = '#e8e6de', ctaTextColor = textColor, primaryImage, mobilePrimaryImage = primaryImage, secondaryImage, mobileSecondaryImage = secondaryImage, }, { prefix }) => `
16896
16951
  <style>
16897
16952
  .${prefix} {
16898
- min-width: 320px;
16899
- min-height: 388px;
16900
16953
  width: 100%;
16901
16954
  height: 100%;
16902
16955
  display: block;
@@ -16908,7 +16961,7 @@ const STYLES$5 = ({ textColor = '#212121', backgroundColor = '#e8e6de', ctaTextC
16908
16961
  width: 100%;
16909
16962
  height: 100%;
16910
16963
  display: flex;
16911
- flex-direction: column;
16964
+ flex-direction: column;
16912
16965
  background-color: transparent;
16913
16966
  gap: 5px;
16914
16967
  color: inherit;
@@ -16995,7 +17048,7 @@ const STYLES$5 = ({ textColor = '#212121', backgroundColor = '#e8e6de', ctaTextC
16995
17048
  opacity: 0.8;
16996
17049
  }
16997
17050
 
16998
- @media (min-width: 640px) {
17051
+ @container (min-width: 640px) {
16999
17052
  .${prefix}__primary-image {
17000
17053
  background-image: url("${primaryImage}");
17001
17054
  }
@@ -17005,7 +17058,7 @@ const STYLES$5 = ({ textColor = '#212121', backgroundColor = '#e8e6de', ctaTextC
17005
17058
  }
17006
17059
  }
17007
17060
 
17008
- @media (min-width: 768px) {
17061
+ @container (min-width: 768px) {
17009
17062
  .${prefix}__content {
17010
17063
  flex-direction: row;
17011
17064
  }
@@ -17030,6 +17083,39 @@ const STYLES$5 = ({ textColor = '#212121', backgroundColor = '#e8e6de', ctaTextC
17030
17083
  width: 100%;
17031
17084
  height: 50%;
17032
17085
  }
17086
+ .${prefix}__header {
17087
+ font-size: 22px;
17088
+ }
17089
+ .${prefix}__description {
17090
+ font-size: 12px;
17091
+ }
17092
+ .${prefix}__cta-button {
17093
+ font-size: 12px;
17094
+ }
17095
+ }
17096
+
17097
+ @container (min-width: 1024px) {
17098
+ .${prefix}__header {
17099
+ font-size: 24px;
17100
+ }
17101
+ .${prefix}__description {
17102
+ font-size: 13px;
17103
+ }
17104
+ .${prefix}__cta-button {
17105
+ font-size: 13px;
17106
+ }
17107
+ }
17108
+
17109
+ @container (min-width: 1280px) {
17110
+ .${prefix}__header {
17111
+ font-size: 28px;
17112
+ }
17113
+ .${prefix}__description {
17114
+ font-size: 14px;
17115
+ }
17116
+ .${prefix}__cta-button {
17117
+ font-size: 14px;
17118
+ }
17033
17119
  }
17034
17120
  </style>
17035
17121
  `;
@@ -17059,23 +17145,15 @@ function rbHomepageHeroThreeTileTemplate(spot, config) {
17059
17145
  const STYLES$4 = ({ textColor = '#212121', backgroundColor = '#e8e6de', ctaTextColor = textColor, primaryImage, mobilePrimaryImage = primaryImage, }, { prefix }) => `
17060
17146
  <style>
17061
17147
  .${prefix} {
17062
- min-width: 320px;
17063
- min-height: 388px;
17064
- width: 100%;
17065
- height: 100%;
17066
- display: block;
17067
- position: relative;
17068
- container-type: inline-size;
17069
- }
17070
-
17071
- .${prefix}__content {
17072
17148
  width: 100%;
17073
17149
  height: 100%;
17074
17150
  display: flex;
17075
- flex-direction: column-reverse;
17151
+ flex-direction: column-reverse;
17076
17152
  background-color: transparent;
17077
17153
  gap: 5px;
17078
17154
  cursor: pointer;
17155
+ container-type: inline-size;
17156
+ position: relative;
17079
17157
  }
17080
17158
 
17081
17159
  .${prefix}__image {
@@ -17120,7 +17198,7 @@ const STYLES$4 = ({ textColor = '#212121', backgroundColor = '#e8e6de', ctaTextC
17120
17198
  font-style: normal;
17121
17199
  font-weight: 400;
17122
17200
  }
17123
-
17201
+
17124
17202
  .${prefix}__cta-button {
17125
17203
  color: ${ctaTextColor};
17126
17204
  background-color: transparent;
@@ -17141,25 +17219,57 @@ const STYLES$4 = ({ textColor = '#212121', backgroundColor = '#e8e6de', ctaTextC
17141
17219
  opacity: 0.8;
17142
17220
  }
17143
17221
 
17144
- @media (min-width: 640px) {
17222
+ @container (min-width: 640px) {
17145
17223
  .${prefix}__image {
17146
17224
  background-image: url("${primaryImage}");
17147
17225
  }
17148
17226
  }
17149
- @media (min-width: 768px) {
17150
- .${prefix}__content {
17227
+
17228
+ @container (min-width: 768px) {
17229
+ .${prefix} {
17151
17230
  flex-direction: row;
17152
17231
  }
17153
-
17154
17232
  .${prefix}__image {
17155
17233
  width: 66.66666%;
17156
17234
  height: 100%;
17157
17235
  }
17158
-
17159
17236
  .${prefix}__text {
17160
17237
  width: 33.33333%;
17161
17238
  height: 100%;
17162
17239
  }
17240
+ .${prefix}__header {
17241
+ font-size: 22px;
17242
+ }
17243
+ .${prefix}__description {
17244
+ font-size: 12px;
17245
+ }
17246
+ .${prefix}__cta-button {
17247
+ font-size: 12px;
17248
+ }
17249
+ }
17250
+
17251
+ @container (min-width: 1024px) {
17252
+ .${prefix}__header {
17253
+ font-size: 24px;
17254
+ }
17255
+ .${prefix}__description {
17256
+ font-size: 13px;
17257
+ }
17258
+ .${prefix}__cta-button {
17259
+ font-size: 13px;
17260
+ }
17261
+ }
17262
+
17263
+ @container (min-width: 1280px) {
17264
+ .${prefix}__header {
17265
+ font-size: 28px;
17266
+ }
17267
+ .${prefix}__description {
17268
+ font-size: 14px;
17269
+ }
17270
+ .${prefix}__cta-button {
17271
+ font-size: 14px;
17272
+ }
17163
17273
  }
17164
17274
  </style>
17165
17275
  `;
@@ -17171,14 +17281,12 @@ function rbHomepageHeroTwoTileTemplate(spot, config) {
17171
17281
  ${GFONT_CORMORANT}
17172
17282
  ${STYLES$4(spot, config)}
17173
17283
  <div class="${prefix}">
17174
- <div class="${prefix}__content">
17175
- <div class="${prefix}__text">
17176
- ${spot.header ? `<h2 class="${prefix}__header">${spot.header}</h2>` : ''}
17177
- ${spot.description ? `<p class="${prefix}__description">${spot.description}</p>` : ''}
17178
- ${spot.ctaText ? `<span class="${prefix}__cta-button">${spot.ctaText}</span>` : ''}
17179
- </div>
17180
- <div class="${prefix}__image"></div>
17284
+ <div class="${prefix}__text">
17285
+ ${spot.header ? `<h2 class="${prefix}__header">${spot.header}</h2>` : ''}
17286
+ ${spot.description ? `<p class="${prefix}__description">${spot.description}</p>` : ''}
17287
+ ${spot.ctaText ? `<span class="${prefix}__cta-button">${spot.ctaText}</span>` : ''}
17181
17288
  </div>
17289
+ <div class="${prefix}__image"></div>
17182
17290
  </div>
17183
17291
  `;
17184
17292
  }
@@ -17187,12 +17295,7 @@ const STYLES$3 = ({ textColor = '#ffffff', ctaTextColor = textColor, ctaBorderCo
17187
17295
  const linearGradient = linearGradientColorStop(overlay || [], 'rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0) 30%');
17188
17296
  return `
17189
17297
  <style>
17190
- :host {
17191
- min-width: 320px;
17192
- min-height: 334px;
17193
- }
17194
-
17195
- .${prefix}__content {
17298
+ .${prefix} {
17196
17299
  width: 100%;
17197
17300
  height: 100%;
17198
17301
  display: flex;
@@ -17206,6 +17309,7 @@ const STYLES$3 = ({ textColor = '#ffffff', ctaTextColor = textColor, ctaBorderCo
17206
17309
  overflow: hidden;
17207
17310
  cursor: pointer;
17208
17311
  color: ${textColor};
17312
+ container-type: inline-size;
17209
17313
  }
17210
17314
 
17211
17315
  .${prefix}__text {
@@ -17252,17 +17356,17 @@ const STYLES$3 = ({ textColor = '#ffffff', ctaTextColor = textColor, ctaBorderCo
17252
17356
  font-weight: 400;
17253
17357
  }
17254
17358
 
17255
- .${prefix}__content:hover .${prefix}__cta-button {
17359
+ .${prefix}:hover .${prefix}__cta-button {
17256
17360
  background-color: ${ctaBorderColor.length === 7 ? `${ctaBorderColor}15` : `${ctaBorderColor}`};
17257
17361
  }
17258
17362
 
17259
- @media (min-width: 640px) {
17260
- .${prefix}__content {
17363
+ @container (min-width: 640px) {
17364
+ .${prefix} {
17261
17365
  background-image: linear-gradient(to top, ${linearGradient}), url("${primaryImage}");
17262
17366
  }
17263
17367
  }
17264
17368
 
17265
- @media (min-width: 768px) {
17369
+ @container (min-width: 768px) {
17266
17370
  .${prefix}__text {
17267
17371
  padding: 25px;
17268
17372
  }
@@ -17281,7 +17385,7 @@ const STYLES$3 = ({ textColor = '#ffffff', ctaTextColor = textColor, ctaBorderCo
17281
17385
  }
17282
17386
  }
17283
17387
 
17284
- @media (min-width: 1024px) {
17388
+ @container (min-width: 1024px) {
17285
17389
  .${prefix}__text {
17286
17390
  padding: 30px;
17287
17391
  }
@@ -17299,7 +17403,7 @@ const STYLES$3 = ({ textColor = '#ffffff', ctaTextColor = textColor, ctaBorderCo
17299
17403
  }
17300
17404
  }
17301
17405
 
17302
- @media (min-width: 1280px) {
17406
+ @container (min-width: 1280px) {
17303
17407
  .${prefix}__cta-button {
17304
17408
  font-size: 14px;
17305
17409
  }
@@ -17314,7 +17418,7 @@ function rbLargeCategoryImageToutTemplate(spot, config) {
17314
17418
  ${GFONT_SOURCE_SANS_3}
17315
17419
  ${GFONT_CORMORANT}
17316
17420
  ${STYLES$3(spot, config)}
17317
- <div class="${prefix}__content">
17421
+ <div class="${prefix}">
17318
17422
  <div class="${prefix}__text">
17319
17423
  ${spot.header ? `<h2 class="${prefix}__header">${spot.header}</h2>` : ''}
17320
17424
  ${spot.description ? `<p class="${prefix}__description">${spot.description}</p>` : ''}
@@ -17328,12 +17432,7 @@ const STYLES$2 = ({ textColor = '#ffffff', primaryImage, mobilePrimaryImage = pr
17328
17432
  const linearGradient = linearGradientColorStop(overlay || [], 'rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0) 30%');
17329
17433
  return `
17330
17434
  <style>
17331
- :host {
17332
- min-width: 320px;
17333
- min-height: 150px;
17334
- }
17335
-
17336
- .${prefix}__content {
17435
+ .${prefix} {
17337
17436
  width: 100%;
17338
17437
  height: 100%;
17339
17438
  display: flex;
@@ -17346,6 +17445,7 @@ const STYLES$2 = ({ textColor = '#ffffff', primaryImage, mobilePrimaryImage = pr
17346
17445
  background-size: cover;
17347
17446
  background-position: center;
17348
17447
  background-repeat: no-repeat;
17448
+ container-type: inline-size;
17349
17449
  }
17350
17450
 
17351
17451
  .${prefix}__text {
@@ -17363,25 +17463,25 @@ const STYLES$2 = ({ textColor = '#ffffff', primaryImage, mobilePrimaryImage = pr
17363
17463
  margin: 0;
17364
17464
  }
17365
17465
 
17366
- @media (min-width: 640px) {
17367
- .${prefix}__content {
17466
+ @container (min-width: 640px) {
17467
+ .${prefix} {
17368
17468
  background-image: linear-gradient(to top, ${linearGradient}), url("${primaryImage}");
17369
17469
  }
17370
17470
  }
17371
17471
 
17372
- @media (min-width: 768px) {
17472
+ @container (min-width: 768px) {
17373
17473
  .${prefix}__header {
17374
17474
  font-size: 22px;
17375
17475
  }
17376
17476
  }
17377
17477
 
17378
- @media (min-width: 1024px) {
17478
+ @container (min-width: 1024px) {
17379
17479
  .${prefix}__header {
17380
17480
  font-size: 24px;
17381
17481
  }
17382
17482
  }
17383
17483
 
17384
- @media (min-width: 1280px) {
17484
+ @container (min-width: 1280px) {
17385
17485
  .${prefix}__header {
17386
17486
  font-size: 28px;
17387
17487
  }
@@ -17395,7 +17495,7 @@ function rbNavigationBannerTemplate(spot, config) {
17395
17495
  ${GFONT_PRECONNECT}
17396
17496
  ${GFONT_SOURCE_SANS_3}
17397
17497
  ${STYLES$2(spot, config)}
17398
- <div class="${prefix}__content">
17498
+ <div class="${prefix}">
17399
17499
  <div class="${prefix}__text">
17400
17500
  ${spot.header ? `<h2 class="${prefix}__header">${spot.header}</h2>` : ''}
17401
17501
  </div>
@@ -17407,12 +17507,7 @@ const STYLES$1 = ({ textColor = '#ffffff', primaryImage, mobilePrimaryImage = pr
17407
17507
  const linearGradient = linearGradientColorStop(overlay || [], 'rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0) 30%');
17408
17508
  return `
17409
17509
  <style>
17410
- :host {
17411
- min-width: 165px;
17412
- min-height: 300px;
17413
- }
17414
-
17415
- .${prefix}__content {
17510
+ .${prefix} {
17416
17511
  width: 100%;
17417
17512
  height: 100%;
17418
17513
  display: flex;
@@ -17425,6 +17520,7 @@ const STYLES$1 = ({ textColor = '#ffffff', primaryImage, mobilePrimaryImage = pr
17425
17520
  border-radius: 5px;
17426
17521
  overflow: hidden;
17427
17522
  cursor: pointer;
17523
+ container-type: inline-size;
17428
17524
  }
17429
17525
 
17430
17526
  .${prefix}__text {
@@ -17439,12 +17535,11 @@ const STYLES$1 = ({ textColor = '#ffffff', primaryImage, mobilePrimaryImage = pr
17439
17535
  font-family: "Source Sans 3", system-ui;
17440
17536
  font-style: normal;
17441
17537
  font-weight: 400;
17442
- line-height: normal;
17443
17538
  margin: 0;
17444
17539
  }
17445
17540
 
17446
- @media (min-width: 640px) {
17447
- .${prefix}__content {
17541
+ @container (min-width: 640px) {
17542
+ .${prefix} {
17448
17543
  background-image: linear-gradient(to top, ${linearGradient}), url("${primaryImage}");
17449
17544
  }
17450
17545
  }
@@ -17457,7 +17552,7 @@ function rbSmallCategoryImageToutTemplate(spot, config) {
17457
17552
  ${GFONT_PRECONNECT}
17458
17553
  ${GFONT_CORMORANT}
17459
17554
  ${STYLES$1(spot, config)}
17460
- <div class="${prefix}__content">
17555
+ <div class="${prefix}">
17461
17556
  <div class="${prefix}__text">
17462
17557
  ${spot.header ? `<h2 class="${prefix}__header">${spot.header}</h2>` : ''}
17463
17558
  </div>
@@ -17467,12 +17562,7 @@ function rbSmallCategoryImageToutTemplate(spot, config) {
17467
17562
 
17468
17563
  const STYLES = ({ textColor = '#000000', backgroundColor = 'transparent', primaryImage, mobilePrimaryImage = primaryImage, }, { prefix }) => `
17469
17564
  <style>
17470
- :host {
17471
- min-width: 165px;
17472
- min-height: 250px;
17473
- }
17474
-
17475
- .${prefix}__content {
17565
+ .${prefix} {
17476
17566
  width: 100%;
17477
17567
  height: 100%;
17478
17568
  background-color: ${backgroundColor};
@@ -17480,6 +17570,7 @@ const STYLES = ({ textColor = '#000000', backgroundColor = 'transparent', primar
17480
17570
  display: flex;
17481
17571
  flex-direction: column;
17482
17572
  border-radius: 5px;
17573
+ container-type: inline-size;
17483
17574
  }
17484
17575
 
17485
17576
  .${prefix}__image {
@@ -17511,11 +17602,10 @@ const STYLES = ({ textColor = '#000000', backgroundColor = 'transparent', primar
17511
17602
  font-family: "Source Sans 3", system-ui;
17512
17603
  font-style: normal;
17513
17604
  font-weight: 400;
17514
- line-height: normal;
17515
17605
  margin: 0;
17516
17606
  }
17517
17607
 
17518
- @media (min-width: 640px) {
17608
+ @container (min-width: 640px) {
17519
17609
  .${prefix}__image {
17520
17610
  background-image: url("${primaryImage}");
17521
17611
  }
@@ -17528,7 +17618,7 @@ function rbSmallDiscoverToutTemplate(spot, config) {
17528
17618
  ${GFONT_PRECONNECT}
17529
17619
  ${GFONT_CORMORANT}
17530
17620
  ${STYLES(spot, config)}
17531
- <div class="${prefix}__content">
17621
+ <div class="${prefix}">
17532
17622
  <div class="${prefix}__image"></div>
17533
17623
  <div class="${prefix}__text">
17534
17624
  ${spot.header ? `<h2 class="${prefix}__header">${spot.header}</h2>` : ''}
@@ -17538,11 +17628,12 @@ function rbSmallDiscoverToutTemplate(spot, config) {
17538
17628
  }
17539
17629
 
17540
17630
  /**
17541
- * Creates the spot html string based on the provided spot data.
17631
+ * Returns the HTML element for the given spot.
17542
17632
  *
17543
- * @param {ISpot} spot - The spot data.
17633
+ * @param {ISpot} spot - The spot object.
17634
+ * @param {ISpotTemplateConfig} config - The spot template configuration.
17544
17635
  *
17545
- * @return {string} - The spot html string.
17636
+ * @return {HTMLElement | null} - The HTML element for the given spot or null if the spot template is not found.
17546
17637
  */
17547
17638
  const SPOT_TEMPLATE_HTML_ELEMENT = (spot, config) => {
17548
17639
  const templates = {
@@ -17615,6 +17706,197 @@ const SPOT_TEMPLATE_HTML_ELEMENT = (spot, config) => {
17615
17706
  return spotHtmlStringToElement(spotHtmlString);
17616
17707
  };
17617
17708
 
17709
+ /**
17710
+ * PubSub class
17711
+ * Manages event subscriptions and publications
17712
+ * @template IEventMap A record type defining the structure of events and their data
17713
+ */
17714
+ class PubSub {
17715
+ constructor() {
17716
+ /**
17717
+ * Object to store subscribers for each event type
17718
+ */
17719
+ this.subscribers = {};
17720
+ }
17721
+ /**
17722
+ * Subscribe to an event
17723
+ * @param eventType - The type of event to subscribe to
17724
+ * @param callback - The function to be called when the event is published
17725
+ * @returns A function to unsubscribe from the event
17726
+ *
17727
+ * @Example:
17728
+ * const unsubscribe = pubSub.subscribe('userLogin', (data) => {
17729
+ * console.log(`User ${data.username} logged in`);
17730
+ * });
17731
+ */
17732
+ subscribe(eventType, callback) {
17733
+ if (!this.subscribers[eventType]) {
17734
+ this.subscribers[eventType] = [];
17735
+ }
17736
+ this.subscribers[eventType].push(callback);
17737
+ // Return an unsubscribe function
17738
+ return () => {
17739
+ this.subscribers[eventType] = this.subscribers[eventType].filter((cb) => cb !== callback);
17740
+ };
17741
+ }
17742
+ /**
17743
+ * Publish an event
17744
+ * @param eventType - The type of event to publish
17745
+ * @param data - The data to be passed to the event subscribers
17746
+ *
17747
+ * @Example:
17748
+ * pubSub.publish('userLogin', { username: 'john_doe', timestamp: Date.now() });
17749
+ */
17750
+ publish(eventType, data) {
17751
+ if (!this.subscribers[eventType]) {
17752
+ return;
17753
+ }
17754
+ this.subscribers[eventType].forEach((callback) => callback(data));
17755
+ }
17756
+ }
17757
+ /**
17758
+ * Usage Example:
17759
+ *
17760
+ * interface IEventMap {
17761
+ * userLogin: { username: string; timestamp: number };
17762
+ * pageView: { url: string; timestamp: number };
17763
+ * }
17764
+ *
17765
+ * const pubSub = new PubSub<IEventMap>();
17766
+ *
17767
+ * // Subscribe to events
17768
+ * const unsubscribeLogin = pubSub.subscribe('userLogin', (data) => {
17769
+ * console.log(`User ${data.username} logged in at ${new Date(data.timestamp)}`);
17770
+ * });
17771
+ *
17772
+ * pubSub.subscribe('pageView', (data) => {
17773
+ * console.log(`Page ${data.url} viewed at ${new Date(data.timestamp)}`);
17774
+ * });
17775
+ *
17776
+ * // Publish events
17777
+ * pubSub.publish('userLogin', { username: 'john_doe', timestamp: Date.now() });
17778
+ * pubSub.publish('pageView', { url: '/home', timestamp: Date.now() });
17779
+ *
17780
+ * // Unsubscribe from an event
17781
+ * unsubscribeLogin();
17782
+ */
17783
+
17784
+ class EventService {
17785
+ constructor() {
17786
+ this.pubSub = new PubSub();
17787
+ this.activeSpots = new Map();
17788
+ this.intersectionObserver = new IntersectionObserverService();
17789
+ }
17790
+ static getInstance() {
17791
+ if (!EventService.instance) {
17792
+ EventService.instance = new EventService();
17793
+ }
17794
+ return EventService.instance;
17795
+ }
17796
+ registerSpot({ placementId, element, spot }) {
17797
+ this.activeSpots.set(spot.id, {
17798
+ placementId,
17799
+ element,
17800
+ impressionTracked: false,
17801
+ });
17802
+ // Handle intersection observer
17803
+ this.handleIntersectionObserver(placementId, spot, element);
17804
+ // Attach click event listener
17805
+ element.addEventListener('click', async () => {
17806
+ var _a, _b;
17807
+ this.pubSub.publish(RMN_SPOT_EVENT.CLICK, {
17808
+ placementId,
17809
+ spotId: spot.id,
17810
+ element,
17811
+ });
17812
+ // Fire click event
17813
+ await this.fireEvent({
17814
+ event: RMN_SPOT_EVENT.CLICK,
17815
+ eventUrl: (_b = (_a = spot.events.find((event) => event.event === RMN_SPOT_EVENT.CLICK)) === null || _a === void 0 ? void 0 : _a.url) !== null && _b !== void 0 ? _b : '',
17816
+ });
17817
+ });
17818
+ // Publish spot created event
17819
+ this.pubSub.publish(RMN_SPOT_EVENT.MOUNTED, {
17820
+ placementId,
17821
+ spotId: spot.id,
17822
+ spotType: spot.spot,
17823
+ spotVariant: spot.variant,
17824
+ element,
17825
+ });
17826
+ }
17827
+ unregisterSpot(spotId) {
17828
+ const spotData = this.activeSpots.get(spotId);
17829
+ if (spotData) {
17830
+ this.intersectionObserver.unobserve(spotData.element);
17831
+ // this.resizeObserver?.disconnect();
17832
+ this.pubSub.publish(RMN_SPOT_EVENT.UNMOUNTED, {
17833
+ placementId: spotData.placementId,
17834
+ spotId,
17835
+ });
17836
+ this.activeSpots.delete(spotId);
17837
+ }
17838
+ }
17839
+ handleIntersectionObserver(placementId, spot, element) {
17840
+ const spotIsVisibleCb = async () => {
17841
+ var _a, _b;
17842
+ this.pubSub.publish(RMN_SPOT_EVENT.IMPRESSION, {
17843
+ placementId,
17844
+ spotId: spot.id,
17845
+ element,
17846
+ });
17847
+ this.intersectionObserver.unobserve(element);
17848
+ this.activeSpots.set(spot.id, {
17849
+ placementId,
17850
+ element,
17851
+ impressionTracked: true,
17852
+ });
17853
+ // Fire impression event
17854
+ await this.fireEvent({
17855
+ event: RMN_SPOT_EVENT.IMPRESSION,
17856
+ eventUrl: (_b = (_a = spot.events.find((event) => event.event === RMN_SPOT_EVENT.IMPRESSION)) === null || _a === void 0 ? void 0 : _a.url) !== null && _b !== void 0 ? _b : '',
17857
+ });
17858
+ };
17859
+ this.intersectionObserver.observe(element, spotIsVisibleCb);
17860
+ }
17861
+ subscribe(eventType, callback) {
17862
+ return this.pubSub.subscribe(eventType, callback);
17863
+ }
17864
+ publish(eventType, data) {
17865
+ this.pubSub.publish(eventType, data);
17866
+ }
17867
+ /**
17868
+ * Fires an event using the navigator.sendBeacon method and redirects the user if the event is a click event.
17869
+ *
17870
+ * @param {IFireEventParams} params - The parameters for firing the event.
17871
+ * @param {RMN_SPOT_EVENT} params.event - The event type.
17872
+ * @param {string} params.eventUrl - The URL to which the event is sent.
17873
+ * @returns {Promise<void>} - A promise that resolves when the event is fired.
17874
+ */
17875
+ async fireEvent({ event, eventUrl }) {
17876
+ const didFireEvent = navigator.sendBeacon(eventUrl);
17877
+ if (didFireEvent && event === RMN_SPOT_EVENT.CLICK) {
17878
+ window.location.href = this.getRedirectUrlFromPayload(eventUrl);
17879
+ }
17880
+ }
17881
+ /**
17882
+ * Extracts and decodes a URL from a base64-encoded query parameter.
17883
+ *
17884
+ * @param {string} url - The URL containing the base64-encoded query parameter.
17885
+ * @returns {string} - The decoded URL or an empty string if decoding fails.
17886
+ */
17887
+ getRedirectUrlFromPayload(url) {
17888
+ var _a, _b;
17889
+ const base64String = (_a = new URL(url).searchParams.get('e')) !== null && _a !== void 0 ? _a : '';
17890
+ try {
17891
+ const data = JSON.parse(atob(base64String));
17892
+ return (_b = data.ur) !== null && _b !== void 0 ? _b : '';
17893
+ }
17894
+ catch (_c) {
17895
+ return '';
17896
+ }
17897
+ }
17898
+ }
17899
+
17618
17900
  const SELECTION_API_PATH = '/spots/selection';
17619
17901
 
17620
17902
  class SelectionService extends BaseApi {
@@ -17649,6 +17931,7 @@ class LiquidCommerceRmnClient {
17649
17931
  constructor(auth) {
17650
17932
  this.selectionService = SelectionService.getInstance(auth);
17651
17933
  this.elementService = ElementService.getInstance();
17934
+ this.eventService = EventService.getInstance();
17652
17935
  }
17653
17936
  /**
17654
17937
  * Makes a selection request on our server based on the provided data.
@@ -17699,6 +17982,14 @@ class LiquidCommerceRmnClient {
17699
17982
  }
17700
17983
  }
17701
17984
  }
17985
+ /**
17986
+ * Returns the event manager instance.
17987
+ *
17988
+ * @return {EventService} - The event manager instance.
17989
+ */
17990
+ eventManager() {
17991
+ return this.eventService;
17992
+ }
17702
17993
  /**
17703
17994
  * Makes a selection request on our server based on the provided data.
17704
17995
  *
@@ -17739,6 +18030,11 @@ class LiquidCommerceRmnClient {
17739
18030
  console.warn(`RmnSdk: Failed to inject carousel spot element. Could not create element for type "${spot.spot}".`);
17740
18031
  return;
17741
18032
  }
18033
+ this.eventSpotElement({
18034
+ spot,
18035
+ placementId: placement.id,
18036
+ element: content,
18037
+ });
17742
18038
  carouselSlides.push(content);
17743
18039
  }
17744
18040
  const { maxWidth, maxHeight } = spots.reduce((max, spot) => ({
@@ -17748,6 +18044,7 @@ class LiquidCommerceRmnClient {
17748
18044
  const carouselElement = this.elementService.createCarouselElement({
17749
18045
  slides: carouselSlides,
17750
18046
  config: {
18047
+ fluid: config === null || config === void 0 ? void 0 : config.fluid,
17751
18048
  width: maxWidth,
17752
18049
  height: maxHeight,
17753
18050
  minScale: (_a = config === null || config === void 0 ? void 0 : config.minScale) !== null && _a !== void 0 ? _a : 0.25, // Scale down to 25% of the original size
@@ -17781,6 +18078,8 @@ class LiquidCommerceRmnClient {
17781
18078
  const spotElement = this.elementService.createSpotElement({
17782
18079
  content,
17783
18080
  config: {
18081
+ fluid: config === null || config === void 0 ? void 0 : config.fluid,
18082
+ spot: spot.spot,
17784
18083
  width: spot.width,
17785
18084
  height: spot.height,
17786
18085
  minScale: (_a = config === null || config === void 0 ? void 0 : config.minScale) !== null && _a !== void 0 ? _a : 0.25, // Scale down to 25% of the original size
@@ -17790,8 +18089,20 @@ class LiquidCommerceRmnClient {
17790
18089
  console.warn(`RmnSdk: Failed to inject spot element. Could not create element for type "${injectItem.spotType}".`);
17791
18090
  return;
17792
18091
  }
18092
+ this.eventSpotElement({
18093
+ spot,
18094
+ placementId: injectItem.placementId,
18095
+ element: spotElement,
18096
+ });
17793
18097
  placement.replaceChildren(spotElement);
17794
18098
  }
18099
+ eventSpotElement({ spot, placementId, element, }) {
18100
+ this.eventService.registerSpot({
18101
+ placementId,
18102
+ element,
18103
+ spot,
18104
+ });
18105
+ }
17795
18106
  /**
17796
18107
  * Prevents duplicate placement ids in the inject data.
17797
18108
  *