vviinn-widgets 2.177.2 → 2.177.3

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.
@@ -14,7 +14,7 @@ function fromString(s) {
14
14
  return s === "VPR" ? { _tag: "VPR" } : { _tag: "VCS" };
15
15
  }
16
16
 
17
- const version = "2.177.2";
17
+ const version = "2.177.3";
18
18
 
19
19
  exports.campaignTypeNames = campaignTypeNames;
20
20
  exports.fold = fold;
@@ -9,7 +9,7 @@ var i18next = require('./i18next-DkN_8H9H.js');
9
9
  var store = require('./store-CrCuJC55.js');
10
10
  var Rectangle = require('./Rectangle-Dki6rXFf.js');
11
11
  var index$3 = require('./index-CtHOBs61.js');
12
- var _package = require('./package-CKGzJ_m8.js');
12
+ var _package = require('./package--2FJyLrO.js');
13
13
  var resources = require('./resources-DWfxrCA4.js');
14
14
  var index$4 = require('./index-Dob37WH6.js');
15
15
  var constants = require('./constants-DWmt_aSp.js');
@@ -3,7 +3,7 @@
3
3
  var index = require('./index-OrE9ITel.js');
4
4
  var search_store = require('./search.store-CuafCQTE.js');
5
5
  var i18next = require('./i18next-DkN_8H9H.js');
6
- var _package = require('./package-CKGzJ_m8.js');
6
+ var _package = require('./package--2FJyLrO.js');
7
7
  var index$1 = require('./index-C9e2G0zC.js');
8
8
  var constants = require('./constants-DWmt_aSp.js');
9
9
  var customizedSlots = require('./customized-slots-7egKJD19.js');
@@ -251,6 +251,7 @@ const VviinnCarousel = class {
251
251
  this.updateColumnsNumber();
252
252
  }
253
253
  componentDidLoad() {
254
+ var _a;
254
255
  this.setWidth();
255
256
  const slot = this.el.querySelector(".content");
256
257
  this.mutationObserver.observe(slot, { subtree: true, childList: true });
@@ -267,6 +268,11 @@ const VviinnCarousel = class {
267
268
  };
268
269
  contentNode.addEventListener("scroll", this.scrollHandler);
269
270
  }
271
+ if (((_a = this.recommendations) === null || _a === void 0 ? void 0 : _a.length) > 0 &&
272
+ !this.showContent &&
273
+ !this.loading) {
274
+ this.showContent = true;
275
+ }
270
276
  }
271
277
  recommendationsWatcher() {
272
278
  if (this.isSetMode) {
@@ -539,11 +545,11 @@ const VviinnCarousel = class {
539
545
  }
540
546
  render() {
541
547
  var _a, _b;
542
- return (index.h(index.Host, { key: 'bfe691207003f78bea4e635aa5683c0720e91dd0', class: this.getClassMap() }, index.h("div", { key: 'd25e944e2f0ba1e310b8a0766c2dd24c2458a295', class: Object.assign(Object.assign({}, this.getClassMap()), this.getBodyClassMap()) }, this.isSetMode && this.crossSellingRecommendations.length > 0 && (index.h("vviinn-product-card", { key: 'a627a6b1b0d4beea38356de7f941c8d4a4d4e0c1', class: "set-mode product-card--source", productTitle: this.sourceProduct.title, image: this.sourceProduct.image.thumbnail ||
543
- this.sourceProduct.image.original, price: this.sourceProduct.price.actual, salePrice: this.sourceProduct.price.sale, basePrice: (_a = this.sourceProduct.basePrice) === null || _a === void 0 ? void 0 : _a.actual, baseSalePrice: (_b = this.sourceProduct.basePrice) === null || _b === void 0 ? void 0 : _b.sale, addPriceContainer: this.addPriceContainer, imageRatio: 1, imageWidth: 300, imageResolutionWidth: this.imageResolutionWidth, isSourceProduct: true, currency: this.currencySign, pricePrefix: this.pricePrefix, setMode: this.isSetMode, locale: this.locale, favoriteShow: this.favoriteShow })), index.h("div", { key: 'f5bb56759d44460ce3d9c58c59a6b425e618b964', class: this.getContentClassMap() }, this.renderRecommendations(), this.showArrowButtons() && (index.h(index.Fragment, { key: 'd41e8aa3a2dcddb2c3412dd73c8460152a7ad718' }, index.h("button", { key: '80e93327c0fc741d8f10476d88b320c666793d6c', class: {
548
+ return (index.h(index.Host, { key: '2c5b301edc4d0d5b66223649eda40a27fc4f1d4b', class: this.getClassMap() }, index.h("div", { key: '61c5c955590924135d6df2db538d15fe915390fc', class: Object.assign(Object.assign({}, this.getClassMap()), this.getBodyClassMap()) }, this.isSetMode && this.crossSellingRecommendations.length > 0 && (index.h("vviinn-product-card", { key: '2f91e8a5c1dea87bd41f311b946ff623f363dd4d', class: "set-mode product-card--source", productTitle: this.sourceProduct.title, image: this.sourceProduct.image.thumbnail ||
549
+ this.sourceProduct.image.original, price: this.sourceProduct.price.actual, salePrice: this.sourceProduct.price.sale, basePrice: (_a = this.sourceProduct.basePrice) === null || _a === void 0 ? void 0 : _a.actual, baseSalePrice: (_b = this.sourceProduct.basePrice) === null || _b === void 0 ? void 0 : _b.sale, addPriceContainer: this.addPriceContainer, imageRatio: 1, imageWidth: 300, imageResolutionWidth: this.imageResolutionWidth, isSourceProduct: true, currency: this.currencySign, pricePrefix: this.pricePrefix, setMode: this.isSetMode, locale: this.locale, favoriteShow: this.favoriteShow })), index.h("div", { key: 'c1aa3e4e32f9e7f220330540f4a0a2ec0825afa4', class: this.getContentClassMap() }, this.renderRecommendations(), this.showArrowButtons() && (index.h(index.Fragment, { key: '0740aff361b9e0fd0057276dd9330c4486a74d00' }, index.h("button", { key: '9924f373f01bf63961b1ed150144b93d78b3bbb0', class: {
544
550
  prev: true,
545
551
  "grid-arrows-dynamic": this.gridArrowsDynamic && this.isGridMode,
546
- }, onClick: () => this.handleCarouselButtonClick("left"), part: "carousel-button", disabled: this.isFirst(), "aria-label": i18next.instance.t("buttons.previous") }, index.h(ChevronIcon, { key: '0aeb93bb3fa0a9c2bc07bddf46ea22ae389ba3b6' })), index.h("button", { key: '135fb287a5ae003f6733a36cb0e306bbc4ab724d', class: "next", onClick: () => this.handleCarouselButtonClick("right"), part: "carousel-button", disabled: this.isLast(), "aria-label": i18next.instance.t("buttons.next") }, index.h(ChevronIcon, { key: 'd50b5f807700bb150ad2565fce006ba9d6f7835f' })))))), this.showBullets() && (index.h("div", { key: 'f33ecca5e4f8f3bccbab95562b5d919e87ad3338', class: "bullets" }, this.renderBullets()))));
552
+ }, onClick: () => this.handleCarouselButtonClick("left"), part: "carousel-button", disabled: this.isFirst(), "aria-label": i18next.instance.t("buttons.previous") }, index.h(ChevronIcon, { key: '3ab6bd9d6bb3d73f5a5d5695fb379d73e83c98eb' })), index.h("button", { key: '040a5d29c421cc2545e1f4c68b1c5231ae30f22e', class: "next", onClick: () => this.handleCarouselButtonClick("right"), part: "carousel-button", disabled: this.isLast(), "aria-label": i18next.instance.t("buttons.next") }, index.h(ChevronIcon, { key: 'db2db4237ad1ab23227882d5935a075b62297656' })))))), this.showBullets() && (index.h("div", { key: 'a66832f07867fc42768c30d84d15801ef608584b', class: "bullets" }, this.renderBullets()))));
547
553
  }
548
554
  get el() { return index.getElement(this); }
549
555
  static get watchers() { return {
@@ -5,7 +5,7 @@ var search_store = require('./search.store-CuafCQTE.js');
5
5
  var i18next = require('./i18next-DkN_8H9H.js');
6
6
  var Rectangle = require('./Rectangle-Dki6rXFf.js');
7
7
  var customizedSlots = require('./customized-slots-7egKJD19.js');
8
- var _package = require('./package-CKGzJ_m8.js');
8
+ var _package = require('./package--2FJyLrO.js');
9
9
  var index$1 = require('./index-Dob37WH6.js');
10
10
  var constants = require('./constants-DWmt_aSp.js');
11
11
  var index$2 = require('./index-CtHOBs61.js');
@@ -124,6 +124,7 @@ export class VviinnCarousel {
124
124
  this.updateColumnsNumber();
125
125
  }
126
126
  componentDidLoad() {
127
+ var _a;
127
128
  this.setWidth();
128
129
  const slot = this.el.querySelector(".content");
129
130
  this.mutationObserver.observe(slot, { subtree: true, childList: true });
@@ -140,6 +141,11 @@ export class VviinnCarousel {
140
141
  };
141
142
  contentNode.addEventListener("scroll", this.scrollHandler);
142
143
  }
144
+ if (((_a = this.recommendations) === null || _a === void 0 ? void 0 : _a.length) > 0 &&
145
+ !this.showContent &&
146
+ !this.loading) {
147
+ this.showContent = true;
148
+ }
143
149
  }
144
150
  recommendationsWatcher() {
145
151
  if (this.isSetMode) {
@@ -412,11 +418,11 @@ export class VviinnCarousel {
412
418
  }
413
419
  render() {
414
420
  var _a, _b;
415
- return (h(Host, { key: 'bfe691207003f78bea4e635aa5683c0720e91dd0', class: this.getClassMap() }, h("div", { key: 'd25e944e2f0ba1e310b8a0766c2dd24c2458a295', class: Object.assign(Object.assign({}, this.getClassMap()), this.getBodyClassMap()) }, this.isSetMode && this.crossSellingRecommendations.length > 0 && (h("vviinn-product-card", { key: 'a627a6b1b0d4beea38356de7f941c8d4a4d4e0c1', class: "set-mode product-card--source", productTitle: this.sourceProduct.title, image: this.sourceProduct.image.thumbnail ||
416
- this.sourceProduct.image.original, price: this.sourceProduct.price.actual, salePrice: this.sourceProduct.price.sale, basePrice: (_a = this.sourceProduct.basePrice) === null || _a === void 0 ? void 0 : _a.actual, baseSalePrice: (_b = this.sourceProduct.basePrice) === null || _b === void 0 ? void 0 : _b.sale, addPriceContainer: this.addPriceContainer, imageRatio: 1, imageWidth: 300, imageResolutionWidth: this.imageResolutionWidth, isSourceProduct: true, currency: this.currencySign, pricePrefix: this.pricePrefix, setMode: this.isSetMode, locale: this.locale, favoriteShow: this.favoriteShow })), h("div", { key: 'f5bb56759d44460ce3d9c58c59a6b425e618b964', class: this.getContentClassMap() }, this.renderRecommendations(), this.showArrowButtons() && (h(Fragment, { key: 'd41e8aa3a2dcddb2c3412dd73c8460152a7ad718' }, h("button", { key: '80e93327c0fc741d8f10476d88b320c666793d6c', class: {
421
+ return (h(Host, { key: '2c5b301edc4d0d5b66223649eda40a27fc4f1d4b', class: this.getClassMap() }, h("div", { key: '61c5c955590924135d6df2db538d15fe915390fc', class: Object.assign(Object.assign({}, this.getClassMap()), this.getBodyClassMap()) }, this.isSetMode && this.crossSellingRecommendations.length > 0 && (h("vviinn-product-card", { key: '2f91e8a5c1dea87bd41f311b946ff623f363dd4d', class: "set-mode product-card--source", productTitle: this.sourceProduct.title, image: this.sourceProduct.image.thumbnail ||
422
+ this.sourceProduct.image.original, price: this.sourceProduct.price.actual, salePrice: this.sourceProduct.price.sale, basePrice: (_a = this.sourceProduct.basePrice) === null || _a === void 0 ? void 0 : _a.actual, baseSalePrice: (_b = this.sourceProduct.basePrice) === null || _b === void 0 ? void 0 : _b.sale, addPriceContainer: this.addPriceContainer, imageRatio: 1, imageWidth: 300, imageResolutionWidth: this.imageResolutionWidth, isSourceProduct: true, currency: this.currencySign, pricePrefix: this.pricePrefix, setMode: this.isSetMode, locale: this.locale, favoriteShow: this.favoriteShow })), h("div", { key: 'c1aa3e4e32f9e7f220330540f4a0a2ec0825afa4', class: this.getContentClassMap() }, this.renderRecommendations(), this.showArrowButtons() && (h(Fragment, { key: '0740aff361b9e0fd0057276dd9330c4486a74d00' }, h("button", { key: '9924f373f01bf63961b1ed150144b93d78b3bbb0', class: {
417
423
  prev: true,
418
424
  "grid-arrows-dynamic": this.gridArrowsDynamic && this.isGridMode,
419
- }, onClick: () => this.handleCarouselButtonClick("left"), part: "carousel-button", disabled: this.isFirst(), "aria-label": i18next.t("buttons.previous") }, h(ChevronIcon, { key: '0aeb93bb3fa0a9c2bc07bddf46ea22ae389ba3b6' })), h("button", { key: '135fb287a5ae003f6733a36cb0e306bbc4ab724d', class: "next", onClick: () => this.handleCarouselButtonClick("right"), part: "carousel-button", disabled: this.isLast(), "aria-label": i18next.t("buttons.next") }, h(ChevronIcon, { key: 'd50b5f807700bb150ad2565fce006ba9d6f7835f' })))))), this.showBullets() && (h("div", { key: 'f33ecca5e4f8f3bccbab95562b5d919e87ad3338', class: "bullets" }, this.renderBullets()))));
425
+ }, onClick: () => this.handleCarouselButtonClick("left"), part: "carousel-button", disabled: this.isFirst(), "aria-label": i18next.t("buttons.previous") }, h(ChevronIcon, { key: '3ab6bd9d6bb3d73f5a5d5695fb379d73e83c98eb' })), h("button", { key: '040a5d29c421cc2545e1f4c68b1c5231ae30f22e', class: "next", onClick: () => this.handleCarouselButtonClick("right"), part: "carousel-button", disabled: this.isLast(), "aria-label": i18next.t("buttons.next") }, h(ChevronIcon, { key: 'db2db4237ad1ab23227882d5935a075b62297656' })))))), this.showBullets() && (h("div", { key: 'a66832f07867fc42768c30d84d15801ef608584b', class: "bullets" }, this.renderBullets()))));
420
426
  }
421
427
  static get is() { return "vviinn-carousel"; }
422
428
  static get originalStyleUrls() {
@@ -12,6 +12,6 @@ function fromString(s) {
12
12
  return s === "VPR" ? { _tag: "VPR" } : { _tag: "VCS" };
13
13
  }
14
14
 
15
- const version = "2.177.2";
15
+ const version = "2.177.3";
16
16
 
17
17
  export { fold as a, campaignTypeNames as c, fromString as f, version as v };
@@ -7,7 +7,7 @@ import { i as instance } from './i18next-C7V-mvcq.js';
7
7
  import { a as getDefaultExportFromCjs, u as updateGlobalState, t as trackEvent, g as globalState } from './store-CMhsm-nf.js';
8
8
  import { f as fromImage } from './Rectangle-zsZBqb9v.js';
9
9
  import { a as addEventListenersWithSignal, f as findSlotElements, g as getSlotNames, s as setElementInteractivity } from './index-B80MfONa.js';
10
- import { v as version, c as campaignTypeNames } from './package-Dh3c__RM.js';
10
+ import { v as version, c as campaignTypeNames } from './package-BmI1Vf_E.js';
11
11
  import { r as resources } from './resources-B0QvmME2.js';
12
12
  import { a as productCardsGridPart, p as productCardParts, m as modalParts, e as extendedFiltersParts, f as filtersParts, s as searchBarParts, b as searchWidgetFilterParts, d as searchWidgetButtonParts } from './index-Btzdx1Bw.js';
13
13
  import { R as RESULTS_WIDGET_IMAGE_RESOLUTION_WIDTH, S as SEARCH_WIDGET_IMAGE_RESOLUTION_WIDTH } from './constants-CKMCQSbG.js';
@@ -1,7 +1,7 @@
1
1
  import { h, r as registerInstance, c as createEvent, F as Fragment, H as Host, g as getElement } from './index-C5qrIvmr.js';
2
2
  import { j as has, k as tuple, a as addIfNotEmpty, _ as _functionExports, l as _ArrayExports, u as useSearchStore, n as requireSemigroup, O as OptionExports, E as EitherExports, b as searchState, o as pipe$1, q as chainW, v as makeRequest, w as fromEither, x as getApiPath, y as createInitPostRequest, A as Apply, T as TaskEitherExports } from './search.store-CdDgllEd.js';
3
3
  import { i as instance } from './i18next-C7V-mvcq.js';
4
- import { c as campaignTypeNames, f as fromString, a as fold, v as version } from './package-Dh3c__RM.js';
4
+ import { c as campaignTypeNames, f as fromString, a as fold, v as version } from './package-BmI1Vf_E.js';
5
5
  import { C as CONTENT_GROUP_CSS_CLASS, i as CAROUSEL_IMAGE_WIDTH_CSS_VAR, S as SET_MODE_IMAGE_WIDTH_CSS_VAR, j as CAROUSEL_CONTENT_WIDTH_CSS_VAR, R as RESULTS_CALCULATED_COLUMNS_CSS_VAR, D as DEFAULT_COLUMNS_NUMBER, g as getCustomLabels, k as SCROLL_POSITION_TOLERANCE, P as PlusIcon, v as v4, c as createWidgetEvent, e as createResultEventByType, b as createAddToBasketEvent, d as createAddToWishlistEvent, f as createProductEventByType, l as getRecommendationsBody } from './index-DaAFwTVd.js';
6
6
  import { P as PRODUCT_CARD_IMAGE_WIDTH, D as DISCOVERY_WIDGET_IMAGE_RESOLUTION_WIDTH } from './constants-CKMCQSbG.js';
7
7
  import { s as slotChangeListener, S as SlotSkeleton } from './customized-slots-R6SaZo4w.js';
@@ -249,6 +249,7 @@ const VviinnCarousel = class {
249
249
  this.updateColumnsNumber();
250
250
  }
251
251
  componentDidLoad() {
252
+ var _a;
252
253
  this.setWidth();
253
254
  const slot = this.el.querySelector(".content");
254
255
  this.mutationObserver.observe(slot, { subtree: true, childList: true });
@@ -265,6 +266,11 @@ const VviinnCarousel = class {
265
266
  };
266
267
  contentNode.addEventListener("scroll", this.scrollHandler);
267
268
  }
269
+ if (((_a = this.recommendations) === null || _a === void 0 ? void 0 : _a.length) > 0 &&
270
+ !this.showContent &&
271
+ !this.loading) {
272
+ this.showContent = true;
273
+ }
268
274
  }
269
275
  recommendationsWatcher() {
270
276
  if (this.isSetMode) {
@@ -537,11 +543,11 @@ const VviinnCarousel = class {
537
543
  }
538
544
  render() {
539
545
  var _a, _b;
540
- return (h(Host, { key: 'bfe691207003f78bea4e635aa5683c0720e91dd0', class: this.getClassMap() }, h("div", { key: 'd25e944e2f0ba1e310b8a0766c2dd24c2458a295', class: Object.assign(Object.assign({}, this.getClassMap()), this.getBodyClassMap()) }, this.isSetMode && this.crossSellingRecommendations.length > 0 && (h("vviinn-product-card", { key: 'a627a6b1b0d4beea38356de7f941c8d4a4d4e0c1', class: "set-mode product-card--source", productTitle: this.sourceProduct.title, image: this.sourceProduct.image.thumbnail ||
541
- this.sourceProduct.image.original, price: this.sourceProduct.price.actual, salePrice: this.sourceProduct.price.sale, basePrice: (_a = this.sourceProduct.basePrice) === null || _a === void 0 ? void 0 : _a.actual, baseSalePrice: (_b = this.sourceProduct.basePrice) === null || _b === void 0 ? void 0 : _b.sale, addPriceContainer: this.addPriceContainer, imageRatio: 1, imageWidth: 300, imageResolutionWidth: this.imageResolutionWidth, isSourceProduct: true, currency: this.currencySign, pricePrefix: this.pricePrefix, setMode: this.isSetMode, locale: this.locale, favoriteShow: this.favoriteShow })), h("div", { key: 'f5bb56759d44460ce3d9c58c59a6b425e618b964', class: this.getContentClassMap() }, this.renderRecommendations(), this.showArrowButtons() && (h(Fragment, { key: 'd41e8aa3a2dcddb2c3412dd73c8460152a7ad718' }, h("button", { key: '80e93327c0fc741d8f10476d88b320c666793d6c', class: {
546
+ return (h(Host, { key: '2c5b301edc4d0d5b66223649eda40a27fc4f1d4b', class: this.getClassMap() }, h("div", { key: '61c5c955590924135d6df2db538d15fe915390fc', class: Object.assign(Object.assign({}, this.getClassMap()), this.getBodyClassMap()) }, this.isSetMode && this.crossSellingRecommendations.length > 0 && (h("vviinn-product-card", { key: '2f91e8a5c1dea87bd41f311b946ff623f363dd4d', class: "set-mode product-card--source", productTitle: this.sourceProduct.title, image: this.sourceProduct.image.thumbnail ||
547
+ this.sourceProduct.image.original, price: this.sourceProduct.price.actual, salePrice: this.sourceProduct.price.sale, basePrice: (_a = this.sourceProduct.basePrice) === null || _a === void 0 ? void 0 : _a.actual, baseSalePrice: (_b = this.sourceProduct.basePrice) === null || _b === void 0 ? void 0 : _b.sale, addPriceContainer: this.addPriceContainer, imageRatio: 1, imageWidth: 300, imageResolutionWidth: this.imageResolutionWidth, isSourceProduct: true, currency: this.currencySign, pricePrefix: this.pricePrefix, setMode: this.isSetMode, locale: this.locale, favoriteShow: this.favoriteShow })), h("div", { key: 'c1aa3e4e32f9e7f220330540f4a0a2ec0825afa4', class: this.getContentClassMap() }, this.renderRecommendations(), this.showArrowButtons() && (h(Fragment, { key: '0740aff361b9e0fd0057276dd9330c4486a74d00' }, h("button", { key: '9924f373f01bf63961b1ed150144b93d78b3bbb0', class: {
542
548
  prev: true,
543
549
  "grid-arrows-dynamic": this.gridArrowsDynamic && this.isGridMode,
544
- }, onClick: () => this.handleCarouselButtonClick("left"), part: "carousel-button", disabled: this.isFirst(), "aria-label": instance.t("buttons.previous") }, h(ChevronIcon, { key: '0aeb93bb3fa0a9c2bc07bddf46ea22ae389ba3b6' })), h("button", { key: '135fb287a5ae003f6733a36cb0e306bbc4ab724d', class: "next", onClick: () => this.handleCarouselButtonClick("right"), part: "carousel-button", disabled: this.isLast(), "aria-label": instance.t("buttons.next") }, h(ChevronIcon, { key: 'd50b5f807700bb150ad2565fce006ba9d6f7835f' })))))), this.showBullets() && (h("div", { key: 'f33ecca5e4f8f3bccbab95562b5d919e87ad3338', class: "bullets" }, this.renderBullets()))));
550
+ }, onClick: () => this.handleCarouselButtonClick("left"), part: "carousel-button", disabled: this.isFirst(), "aria-label": instance.t("buttons.previous") }, h(ChevronIcon, { key: '3ab6bd9d6bb3d73f5a5d5695fb379d73e83c98eb' })), h("button", { key: '040a5d29c421cc2545e1f4c68b1c5231ae30f22e', class: "next", onClick: () => this.handleCarouselButtonClick("right"), part: "carousel-button", disabled: this.isLast(), "aria-label": instance.t("buttons.next") }, h(ChevronIcon, { key: 'db2db4237ad1ab23227882d5935a075b62297656' })))))), this.showBullets() && (h("div", { key: 'a66832f07867fc42768c30d84d15801ef608584b', class: "bullets" }, this.renderBullets()))));
545
551
  }
546
552
  get el() { return getElement(this); }
547
553
  static get watchers() { return {
@@ -3,7 +3,7 @@ import { _ as _functionExports, O as OptionExports, d as detectedObjectEq, a as
3
3
  import { i as instance } from './i18next-C7V-mvcq.js';
4
4
  import { s as scaleWithSized, c as center } from './Rectangle-zsZBqb9v.js';
5
5
  import { s as slotChangeListener } from './customized-slots-R6SaZo4w.js';
6
- import { c as campaignTypeNames, v as version } from './package-Dh3c__RM.js';
6
+ import { c as campaignTypeNames, v as version } from './package-BmI1Vf_E.js';
7
7
  import { m as modalParts } from './index-Btzdx1Bw.js';
8
8
  import { a as SIDEBAR_ANIMATION_DURATION, P as PRODUCT_CARD_IMAGE_WIDTH, D as DISCOVERY_WIDGET_IMAGE_RESOLUTION_WIDTH } from './constants-CKMCQSbG.js';
9
9
  import { a as addEventListenersWithSignal } from './index-B80MfONa.js';
@@ -1 +1 @@
1
- import{h as e,r as t,c as o,H as i,g as r}from"./p-C5qrIvmr.js";import{_ as a,O as s,d as n,a as c,b as l,u as d}from"./p-DehFpKKv.js";import{i as h}from"./p-C7V-mvcq.js";import{s as p,c as f}from"./p-zsZBqb9v.js";import{s as b}from"./p-Z6kWax5f.js";import{c as g,v as u}from"./p-Dh3c__RM.js";import{m as x}from"./p-Btzdx1Bw.js";import{a as v,P as m,D as y}from"./p-CKMCQSbG.js";import{a as w}from"./p-B80MfONa.js";import"./p-BFKAtFxd.js";const C=()=>e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},e("path",{d:"M7.82499 13L12.725 17.9C12.925 18.1 13.0208 18.3333 13.0125 18.6C13.0042 18.8667 12.9 19.1 12.7 19.3C12.5 19.4833 12.2667 19.5792 12 19.5875C11.7333 19.5958 11.5 19.5 11.3 19.3L4.69999 12.7C4.59999 12.6 4.52915 12.4917 4.48749 12.375C4.44582 12.2583 4.42499 12.1333 4.42499 12C4.42499 11.8667 4.44582 11.7417 4.48749 11.625C4.52915 11.5083 4.59999 11.4 4.69999 11.3L11.3 4.69999C11.4833 4.51665 11.7125 4.42499 11.9875 4.42499C12.2625 4.42499 12.5 4.51665 12.7 4.69999C12.9 4.89999 13 5.13749 13 5.41249C13 5.68749 12.9 5.92499 12.7 6.12499L7.82499 11H19C19.2833 11 19.5208 11.0958 19.7125 11.2875C19.9042 11.4792 20 11.7167 20 12C20 12.2833 19.9042 12.5208 19.7125 12.7125C19.5208 12.9042 19.2833 13 19 13H7.82499Z",fill:"currentColor"})),k=()=>e("svg",{width:"48",height:"48",slot:"icon",class:"icon",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("path",{d:"M24 34C24.5667 34 25.0417 33.8083 25.425 33.425C25.8083 33.0417 26 32.5667 26 32C26 31.4333 25.8083 30.9583 25.425 30.575C25.0417 30.1917 24.5667 30 24 30C23.4333 30 22.9583 30.1917 22.575 30.575C22.1917 30.9583 22 31.4333 22 32C22 32.5667 22.1917 33.0417 22.575 33.425C22.9583 33.8083 23.4333 34 24 34ZM24 26C24.5667 26 25.0417 25.8083 25.425 25.425C25.8083 25.0417 26 24.5667 26 24V16C26 15.4333 25.8083 14.9583 25.425 14.575C25.0417 14.1917 24.5667 14 24 14C23.4333 14 22.9583 14.1917 22.575 14.575C22.1917 14.9583 22 15.4333 22 16V24C22 24.5667 22.1917 25.0417 22.575 25.425C22.9583 25.8083 23.4333 26 24 26ZM24 44C21.2333 44 18.6333 43.475 16.2 42.425C13.7667 41.375 11.65 39.95 9.85 38.15C8.05 36.35 6.625 34.2333 5.575 31.8C4.525 29.3667 4 26.7667 4 24C4 21.2333 4.525 18.6333 5.575 16.2C6.625 13.7667 8.05 11.65 9.85 9.85C11.65 8.05 13.7667 6.625 16.2 5.575C18.6333 4.525 21.2333 4 24 4C26.7667 4 29.3667 4.525 31.8 5.575C34.2333 6.625 36.35 8.05 38.15 9.85C39.95 11.65 41.375 13.7667 42.425 16.2C43.475 18.6333 44 21.2333 44 24C44 26.7667 43.475 29.3667 42.425 31.8C41.375 34.2333 39.95 36.35 38.15 38.15C36.35 39.95 34.2333 41.375 31.8 42.425C29.3667 43.475 26.7667 44 24 44Z",fill:"#161616"})),z=({width:t=24,height:o=24})=>e("svg",{xmlns:"http://www.w3.org/2000/svg",width:t,height:o,viewBox:"0 0 24 24",fill:"currentColor"},e("path",{d:"M4 16V15H2V16C2 19.31 4.69 22 8 22H9V20H8C5.79 20 4 18.21 4 16Z"}),e("path",{d:"M4 8C4 5.79 5.79 4 8 4H9V2H8C4.69 2 2 4.69 2 8V9H4V8Z"}),e("path",{d:"M20 8C20 5.79 18.21 4 16 4H15V2H16C19.31 2 22 4.69 22 8V9H20V8Z"}),e("path",{d:"M20 16C20 18.21 18.21 20 16 20H15V22H16C19.31 22 22 19.31 22 16V15H20V16Z"}),e("path",{d:"M9 8H7C6.45 8 6 8.45 6 9C6 9.55 6.45 10 7 10H9V11C9 11.55 9.45 12 10 12C10.55 12 11 11.55 11 11V7C11 6.45 10.55 6 10 6C9.45 6 9 6.45 9 7V8Z"}),e("path",{d:"M15 16H17C17.55 16 18 15.55 18 15C18 14.45 17.55 14 17 14H15V13C15 12.45 14.55 12 14 12C13.45 12 13 12.45 13 13V17C13 17.55 13.45 18 14 18C14.55 18 15 17.55 15 17V16Z"}),e("path",{d:"M16 9C16 8.45 15.55 8 15 8H12V10H15C15.55 10 16 9.55 16 9Z"}),e("path",{d:"M6 15C6 15.55 6.45 16 7 16H12V14H7C6.45 14 6 14.45 6 15Z"})),V=({width:t=24,height:o=24})=>e("svg",{xmlns:"http://www.w3.org/2000/svg",width:t,height:o,viewBox:"0 0 24 24",fill:"currentColor"},e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M20 13C20 13.55 20.45 14 21 14C21.55 14 22 13.55 22 13V5C22 3.35 20.65 2 19 2H11C10.45 2 10 2.45 10 3C10 3.55 10.45 4 11 4H19C19.55 4 20 4.45 20 5V13ZM2 19C2 20.65 3.35 22 5 22H13C13.55 22 14 21.55 14 21C14 20.45 13.55 20 13 20H5C4.45 20 4 19.55 4 19V11C4 10.45 3.55 10 3 10C2.45 10 2 10.45 2 11V19ZM12 16C11.45 16 11 15.55 11 15V13H9C8.45 13 8 12.55 8 12C8 11.45 8.45 11 9 11H11V9C11 8.45 11.45 8 12 8C12.55 8 13 8.45 13 9V11H15C15.55 11 16 11.45 16 12C16 12.55 15.55 13 15 13H13V15C13 15.55 12.55 16 12 16Z"})),H=class{constructor(e){t(this,e),this.vviinnSelectObject=o(this,"vviinnSelectObject"),this.handleKeyDown=e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this.selectDetectedObject())},this.position=["0","0"]}getObjectPosition(){return a.pipe(s.fromNullable(this.imageBounds),s.map((e=>{const{left:t,top:o}=a.pipe(this.detectedObject,p(e),f);return[`${t}px`,`${o}px`]})),s.getOrElse((()=>["0","0"])))}selectDetectedObject(){const e=a.pipe(s.fromNullable(this.imageBounds),s.map((e=>p(e)(this.detectedObject))),s.toNullable);this.vviinnSelectObject.emit(Object.assign(Object.assign({},this.basicEventData),{detectedObject:this.detectedObject,searchArea:e}))}isActive(){return!(!this.detectedObject||!this.selectedDetectedObject)&&n.equals(this.detectedObject,this.selectedDetectedObject)}render(){const t=this.isActive();return e(i,{key:"ce432569b8cb46945f879b52c9ebb4baadf34dcd",class:{active:t},style:{"--x-position":this.getObjectPosition()[0],"--y-position":this.getObjectPosition()[1]}},e("button",{key:"543ddb7ceafd505a4a584764319fbb26ce489e4c",class:"detected-object-button","aria-label":h.t("a11y.detectedObject"),"aria-pressed":t,onClick:()=>this.selectDetectedObject(),onKeyDown:this.handleKeyDown}))}};H.style=':host{--font-family-base:Inter, system-ui, sans-serif;--font-family-mono:monospace;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;--font-size-title:24px;--font-size-headline:18px;--font-size-label-large:16px;--font-size-label:14px;--font-size-body-large:16px;--font-size-body:14px;--font-size-caption:12px;--line-height-title:32px;--line-height-headline:24px;--line-height-label-large:24px;--line-height-label:20px;--line-height-body-large:24px;--line-height-body:20px;--line-height-caption:16px;--letter-spacing-title:0px;--letter-spacing-headline:0px;--letter-spacing-label-large:0px;--letter-spacing-label:0px;--letter-spacing-body-large:0px;--letter-spacing-body:0px;--letter-spacing-caption:0px;--font-weight-400:400;--font-weight-500:500;--font-weight-600:600;--font-weight-700:700;--spacing-none:0px;--spacing-25:2px;--spacing-50:4px;--spacing-75:6px;--spacing-100:8px;--spacing-125:10px;--spacing-150:12px;--spacing-200:16px;--spacing-250:20px;--spacing-300:24px;--spacing-400:32px;--spacing-500:40px;--spacing-600:48px;--border-radius-none:0px;--border-radius-25:2px;--border-radius-50:4px;--border-radius-100:8px;--border-radius-150:12px;--border-radius-200:16px;--border-radius-300:24px;--border-radius-400:32px;--border-radius-full:9999px;--stroke-width-none:0px;--stroke-width-25:1px;--stroke-width-50:2px;--stroke-width-75:3px;--stroke-width-100:4px;--stroke-width-150:6px;--stroke-width-200:8px;--stroke-width-300:12px;--product-card-widget-min-width:135px;--product-card-results-min-width:250px;--image-set-mode-min-width:155px;--product-card-set-mode-max-width:300px;--source-card-set-mode-max-width:500px;--filter-blur-none:0px;--filter-blur-100:8px;--filter-blur-150:12px;--filter-blur-200:16px;--color-bg-base:#ffffff;--color-bg-inverse:#161616;--color-border-00:#ffffff;--color-border-01:#f4f4f4;--color-border-02:#e0e0e0;--color-border-03:#c6c6c6;--color-border-inverse-00:#161616;--color-border-inverse-01:#393939;--color-field-01:#ffffff;--color-field-02:#f4f4f4;--color-icon-primary:#161616;--color-icon-secondary:#525252;--color-icon-helper:#8d8d8d;--color-icon-on-color:#ffffff;--color-icon-inverse:#ffffff;--color-icon-disabled:#16161640;--color-text-primary:#161616;--color-text-secondary:#707070;--color-text-helper:#8d8d8d;--color-text-placeholder:#a8a8a8;--color-text-on-color:#ffffff;--color-text-inverse:#ffffff;--color-text-disabled:#16161640;--button-bg-color-primary:#000000;--button-bg-color-primary-hover:#161616;--button-bg-color-primary-active:#1e1e1e;--button-bg-color-secondary:#f4f4f4;--button-bg-color-secondary-hover:#e0e0e0;--button-bg-color-secondary-active:#c6c6c6;--button-bg-color-ghost-hover:#f4f4f4;--button-bg-color-ghost-active:#eaeaea;--button-bg-color-frosted:#6f6f6f66;--button-bg-color-frosted-hover:#6f6f6f80;--button-bg-color-frosted-active:#6f6f6f99;--button-bg-color-disabled:#e0e0e0;--button-bg-color-positive:#dcfce7;--surface-bg-color-01:#f4f4f4;--surface-bg-color-01-hover:#eaeaea;--surface-bg-color-01-active:#e0e0e0;--surface-bg-color-02:#ffffff;--surface-bg-color-inverse:#262626;--surface-bg-color-inverse-hover:#303030;--surface-bg-color-inverse-active:#393939;--surface-bg-color-disabled:#e0e0e0;--chip-bg-color-primary:#161616;--chip-bg-color-primary-hover:#1e1e1e;--chip-bg-color-primary-active:#262626;--chip-bg-color-subtle:#f4f4f4;--chip-bg-color-subtle-hover:#eaeaea;--chip-bg-color-subtle-active:#e0e0e0;--chip-bg-color-outline-hover:#f4f4f4;--chip-bg-color-outline-active:#eaeaea;--label-bg-color-accent:#ff3944;--sidebar-animation-duration:0.5s;}:host{--button-size:36px;display:block;position:absolute;left:calc(var(--x-position));top:calc(var(--y-position));z-index:2}.detected-object-button{background:transparent;border:none;padding:0;margin:0;font:inherit;color:inherit;position:absolute;left:calc(-1 * var(--button-size) / 2);top:calc(-1 * var(--button-size) / 2);width:var(--button-size);height:var(--button-size);border-radius:50%;cursor:pointer;z-index:3}:host::before,:host::after{content:"";cursor:pointer;position:absolute;height:var(--size);width:var(--size);left:calc(-1 * var(--size) / 2);top:calc(-1 * var(--size) / 2)}:host::before{--size:var(--button-size);border-radius:50%;z-index:0;background:rgba(0, 0, 0, 0.16);-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);transition:transform 0.07s ease-in-out}:host::after{--size:13px;border-radius:50%;z-index:1;background:white;box-shadow:0px 2px 2px 0px rgba(0, 0, 0, 0.15);transition:transform 0.07s ease-in-out}:host(.active)::before{transform:scale(0.88);background:rgba(0, 0, 0, 0.4)}:host(.active)::after{transform:scale(0.67)}@media (min-width: 768px){:host(:not(.active):hover)::before{transform:scale(1.08);background:rgba(0, 0, 0, 0.32)}}';const j={"empty-results":{i18nKey:"emptyResultsBlock",hasTopMargin:!0,hasText:!1,hasButton:!1},"server-error":{i18nKey:"serverErrorBlock",hasTopMargin:!1,hasText:!1,hasButton:!0},"wrong-aspect-ratio":{i18nKey:"wrongAspectRatioBlock",hasTopMargin:!0,hasText:!1,hasButton:!0},"wrong-format":{i18nKey:"wrongFormatBlock",hasTopMargin:!1,hasText:!0,hasButton:!0}},M=class{constructor(e){t(this,e),this.hasBackground=!0,this.hasTopMargin=!1}getErrorContent(){if(!this.errorType)return null;const e=j[this.errorType];return{title:h.t(`${e.i18nKey}.title`),text:e.hasText?h.t(`${e.i18nKey}.text`):null,buttonText:this.hasButton()?h.t(`${e.i18nKey}.button`):null}}hasButton(){return!!this.errorType&&(!!j[this.errorType].hasButton||"empty-results"===this.errorType&&"image"===this.searchType)}render(){var t;const o=this.getErrorContent(),r={"add-top-margin":this.hasTopMargin||this.errorType&&(null===(t=j[this.errorType])||void 0===t?void 0:t.hasTopMargin)},a={"error-content":!0,"add-background":this.hasBackground},s=this.errorType?[e(k,null),e("h4",null,null==o?void 0:o.title),(null==o?void 0:o.text)&&e("span",null,o.text),(null==o?void 0:o.buttonText)&&e("button",{onClick:this.handler},o.buttonText)]:[e("slot",{name:"icon"}),e("slot",{name:"title"}),e("slot",{name:"text"}),e("slot",{name:"action"})];return e(i,{key:"bbb411a22626197b25a8630b67aa618099330bff",class:r},e("div",{key:"ae22222ddd6ff1a146c39c6d8742f7e5e8de43ae",class:a},s))}};M.style=":host{--font-family-base:Inter, system-ui, sans-serif;--font-family-mono:monospace;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;--font-size-title:24px;--font-size-headline:18px;--font-size-label-large:16px;--font-size-label:14px;--font-size-body-large:16px;--font-size-body:14px;--font-size-caption:12px;--line-height-title:32px;--line-height-headline:24px;--line-height-label-large:24px;--line-height-label:20px;--line-height-body-large:24px;--line-height-body:20px;--line-height-caption:16px;--letter-spacing-title:0px;--letter-spacing-headline:0px;--letter-spacing-label-large:0px;--letter-spacing-label:0px;--letter-spacing-body-large:0px;--letter-spacing-body:0px;--letter-spacing-caption:0px;--font-weight-400:400;--font-weight-500:500;--font-weight-600:600;--font-weight-700:700;--spacing-none:0px;--spacing-25:2px;--spacing-50:4px;--spacing-75:6px;--spacing-100:8px;--spacing-125:10px;--spacing-150:12px;--spacing-200:16px;--spacing-250:20px;--spacing-300:24px;--spacing-400:32px;--spacing-500:40px;--spacing-600:48px;--border-radius-none:0px;--border-radius-25:2px;--border-radius-50:4px;--border-radius-100:8px;--border-radius-150:12px;--border-radius-200:16px;--border-radius-300:24px;--border-radius-400:32px;--border-radius-full:9999px;--stroke-width-none:0px;--stroke-width-25:1px;--stroke-width-50:2px;--stroke-width-75:3px;--stroke-width-100:4px;--stroke-width-150:6px;--stroke-width-200:8px;--stroke-width-300:12px;--product-card-widget-min-width:135px;--product-card-results-min-width:250px;--image-set-mode-min-width:155px;--product-card-set-mode-max-width:300px;--source-card-set-mode-max-width:500px;--filter-blur-none:0px;--filter-blur-100:8px;--filter-blur-150:12px;--filter-blur-200:16px;--color-bg-base:#ffffff;--color-bg-inverse:#161616;--color-border-00:#ffffff;--color-border-01:#f4f4f4;--color-border-02:#e0e0e0;--color-border-03:#c6c6c6;--color-border-inverse-00:#161616;--color-border-inverse-01:#393939;--color-field-01:#ffffff;--color-field-02:#f4f4f4;--color-icon-primary:#161616;--color-icon-secondary:#525252;--color-icon-helper:#8d8d8d;--color-icon-on-color:#ffffff;--color-icon-inverse:#ffffff;--color-icon-disabled:#16161640;--color-text-primary:#161616;--color-text-secondary:#707070;--color-text-helper:#8d8d8d;--color-text-placeholder:#a8a8a8;--color-text-on-color:#ffffff;--color-text-inverse:#ffffff;--color-text-disabled:#16161640;--button-bg-color-primary:#000000;--button-bg-color-primary-hover:#161616;--button-bg-color-primary-active:#1e1e1e;--button-bg-color-secondary:#f4f4f4;--button-bg-color-secondary-hover:#e0e0e0;--button-bg-color-secondary-active:#c6c6c6;--button-bg-color-ghost-hover:#f4f4f4;--button-bg-color-ghost-active:#eaeaea;--button-bg-color-frosted:#6f6f6f66;--button-bg-color-frosted-hover:#6f6f6f80;--button-bg-color-frosted-active:#6f6f6f99;--button-bg-color-disabled:#e0e0e0;--button-bg-color-positive:#dcfce7;--surface-bg-color-01:#f4f4f4;--surface-bg-color-01-hover:#eaeaea;--surface-bg-color-01-active:#e0e0e0;--surface-bg-color-02:#ffffff;--surface-bg-color-inverse:#262626;--surface-bg-color-inverse-hover:#303030;--surface-bg-color-inverse-active:#393939;--surface-bg-color-disabled:#e0e0e0;--chip-bg-color-primary:#161616;--chip-bg-color-primary-hover:#1e1e1e;--chip-bg-color-primary-active:#262626;--chip-bg-color-subtle:#f4f4f4;--chip-bg-color-subtle-hover:#eaeaea;--chip-bg-color-subtle-active:#e0e0e0;--chip-bg-color-outline-hover:#f4f4f4;--chip-bg-color-outline-active:#eaeaea;--label-bg-color-accent:#ff3944;--sidebar-animation-duration:0.5s;}:host{display:block;font-family:var(--font-family, var(--font-family-base))}:host(.add-background){background:var(--surface-bg-color-01)}:host(.add-top-margin){margin-top:var(--spacing-400)}.error-content{display:grid;grid-gap:var(--spacing-150);text-align:center;justify-items:center;width:356px;padding:var(--spacing-200);max-width:calc(100vw - 2 * var(--spacing-300));border-radius:var(--border-radius-200);box-sizing:border-box;margin:0 auto}.error-content.add-background{background:var(--surface-bg-color-01)}svg,::slotted(svg){display:grid;align-self:center}h4,::slotted(h4){margin:unset;font-weight:var(--font-weight-600);font-size:var(--font-size-headline);line-height:var(--line-height-headline)}span,::slotted(span){font-size:14px;line-height:20px}button,::slotted(button){-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;cursor:pointer;font-size:var(--font-size-label);font-weight:var(--font-weight-500);background:var(--color-primary, var(--button-bg-color-primary));border-radius:var(--border-radius-100);padding:var(--spacing-100);font-size:var(--font-size-body);color:var(--color-text-inverse);font-family:var(--font-family, var(--font-family-base))}button:hover,::slotted(button:hover){background:var(--button-bg-color-primary-hover)}";const B=class{constructor(e){t(this,e),this.vviinnWidgetClose=o(this,"vviinnWidgetClose"),this.active=!1,this.hideBackButton=!1,this.slider=!1,this.handleEscapeKey=e=>{"Escape"===e.key&&this.active&&(e.preventDefault(),this.close())},this.handleCloseButtonKeyDown=e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this.close())}}handleActiveChange(e){e?document.addEventListener("keydown",this.handleEscapeKey):document.removeEventListener("keydown",this.handleEscapeKey)}componentWillLoad(){b(this,this.el)}disconnectedCallback(){document.removeEventListener("keydown",this.handleEscapeKey)}resetTopScroll(){const e=this.el.shadowRoot.querySelector(".body");null==e||e.scroll({top:0})}close(){this.active=!1,setTimeout((()=>{this.vviinnWidgetClose.emit(Object.assign({campaignTypeId:"VPS",campaignTypeName:g.VPS,widgetVersion:this.widgetVersion},c("widgetId",this.buttonElementId)))}),this.slider?v:0)}handleAnimationEnd(e){"fade-in"===e.animationName&&(this.slider=!0)}render(){return e(i,{key:"752070b1c38d109c23843fdaec5b1998cbe52351",exportparts:x,class:{closed:!this.active,"first-screen":this.isFirstScreen},onAnimationEnd:e=>this.handleAnimationEnd(e),role:"dialog","aria-modal":this.active?"true":"false","aria-label":h.t("imageSearchModalTitle"),inert:!this.active||void 0},e("div",{key:"482da46a8ad5f3990154a531bbe01aaa9fee17ab",class:"head"},!this.hideBackButton&&e("button",{key:"5599ecf87bd418dd99d99255b2487188a74a052b",part:"secondary-action",onClick:()=>{this.resetState(),this.resetTopScroll()},"aria-label":h.t("a11y.backButton")},e(C,{key:"adb1ac95fddf4e1d03a72b9b421dcd528063d2c3"})),e("div",{key:"be069cf76dc695755960c7dda9507f0d2bd62295",class:"title",part:"results-title"},(t=l.image)?e("img",{width:"28",height:"28",src:t.src,class:"title-image",alt:h.t("a11y.uploadedImage")}):null,e("slot",{key:"4e53037b5ac82d762678d2099b550c72e1efa16f",name:"vviinn-image-search-modal-title"},h.t("imageSearchModalTitle"))),e("button",{key:"acad522368a559d4434a81af274b1e977daea2c7",onClick:()=>this.close(),onKeyDown:this.handleCloseButtonKeyDown,class:"close-button",part:"close-button","aria-label":h.t("a11y.closeButton")},e("svg",{key:"1915aaf93a2da40e945ea0623ce48aed332727c6",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true"},e("path",{key:"b69c6b6b1764aa6c8e233b566659a44ebdb1f163",d:"M12 13.3892L6.91958 18.4696C6.72248 18.6667 6.49095 18.7653 6.225 18.7653C5.95905 18.7653 5.72753 18.6667 5.53043 18.4696C5.33333 18.2725 5.23478 18.041 5.23478 17.775C5.23478 17.5091 5.33333 17.2776 5.53043 17.0805L10.6109 12L5.53043 6.9196C5.33333 6.7225 5.23478 6.49098 5.23478 6.22503C5.23478 5.95908 5.33333 5.72755 5.53043 5.53045C5.72753 5.33335 5.95905 5.2348 6.225 5.2348C6.49095 5.2348 6.72248 5.33335 6.91958 5.53045L12 10.6109L17.0804 5.53045C17.2775 5.33335 17.5091 5.2348 17.775 5.2348C18.041 5.2348 18.2725 5.33335 18.4696 5.53045C18.6667 5.72755 18.7652 5.95908 18.7652 6.22503C18.7652 6.49098 18.6667 6.7225 18.4696 6.9196L13.3892 12L18.4696 17.0805C18.6667 17.2776 18.7652 17.5091 18.7652 17.775C18.7652 18.041 18.6667 18.2725 18.4696 18.4696C18.2725 18.6667 18.041 18.7653 17.775 18.7653C17.5091 18.7653 17.2775 18.6667 17.0804 18.4696L12 13.3892Z",fill:"currentColor"})))),e("div",{key:"c82a45fe136c5199a71a8732ca713d80884f24c9",class:"body"},e("slot",{key:"5bb01de9ac615478ce5ea811759d44fa5e84c434"})));var t}get el(){return r(this)}static get watchers(){return{active:["handleActiveChange"]}}};B.style=":host{--font-family-base:Inter, system-ui, sans-serif;--font-family-mono:monospace;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;--font-size-title:24px;--font-size-headline:18px;--font-size-label-large:16px;--font-size-label:14px;--font-size-body-large:16px;--font-size-body:14px;--font-size-caption:12px;--line-height-title:32px;--line-height-headline:24px;--line-height-label-large:24px;--line-height-label:20px;--line-height-body-large:24px;--line-height-body:20px;--line-height-caption:16px;--letter-spacing-title:0px;--letter-spacing-headline:0px;--letter-spacing-label-large:0px;--letter-spacing-label:0px;--letter-spacing-body-large:0px;--letter-spacing-body:0px;--letter-spacing-caption:0px;--font-weight-400:400;--font-weight-500:500;--font-weight-600:600;--font-weight-700:700;--spacing-none:0px;--spacing-25:2px;--spacing-50:4px;--spacing-75:6px;--spacing-100:8px;--spacing-125:10px;--spacing-150:12px;--spacing-200:16px;--spacing-250:20px;--spacing-300:24px;--spacing-400:32px;--spacing-500:40px;--spacing-600:48px;--border-radius-none:0px;--border-radius-25:2px;--border-radius-50:4px;--border-radius-100:8px;--border-radius-150:12px;--border-radius-200:16px;--border-radius-300:24px;--border-radius-400:32px;--border-radius-full:9999px;--stroke-width-none:0px;--stroke-width-25:1px;--stroke-width-50:2px;--stroke-width-75:3px;--stroke-width-100:4px;--stroke-width-150:6px;--stroke-width-200:8px;--stroke-width-300:12px;--product-card-widget-min-width:135px;--product-card-results-min-width:250px;--image-set-mode-min-width:155px;--product-card-set-mode-max-width:300px;--source-card-set-mode-max-width:500px;--filter-blur-none:0px;--filter-blur-100:8px;--filter-blur-150:12px;--filter-blur-200:16px;--color-bg-base:#ffffff;--color-bg-inverse:#161616;--color-border-00:#ffffff;--color-border-01:#f4f4f4;--color-border-02:#e0e0e0;--color-border-03:#c6c6c6;--color-border-inverse-00:#161616;--color-border-inverse-01:#393939;--color-field-01:#ffffff;--color-field-02:#f4f4f4;--color-icon-primary:#161616;--color-icon-secondary:#525252;--color-icon-helper:#8d8d8d;--color-icon-on-color:#ffffff;--color-icon-inverse:#ffffff;--color-icon-disabled:#16161640;--color-text-primary:#161616;--color-text-secondary:#707070;--color-text-helper:#8d8d8d;--color-text-placeholder:#a8a8a8;--color-text-on-color:#ffffff;--color-text-inverse:#ffffff;--color-text-disabled:#16161640;--button-bg-color-primary:#000000;--button-bg-color-primary-hover:#161616;--button-bg-color-primary-active:#1e1e1e;--button-bg-color-secondary:#f4f4f4;--button-bg-color-secondary-hover:#e0e0e0;--button-bg-color-secondary-active:#c6c6c6;--button-bg-color-ghost-hover:#f4f4f4;--button-bg-color-ghost-active:#eaeaea;--button-bg-color-frosted:#6f6f6f66;--button-bg-color-frosted-hover:#6f6f6f80;--button-bg-color-frosted-active:#6f6f6f99;--button-bg-color-disabled:#e0e0e0;--button-bg-color-positive:#dcfce7;--surface-bg-color-01:#f4f4f4;--surface-bg-color-01-hover:#eaeaea;--surface-bg-color-01-active:#e0e0e0;--surface-bg-color-02:#ffffff;--surface-bg-color-inverse:#262626;--surface-bg-color-inverse-hover:#303030;--surface-bg-color-inverse-active:#393939;--surface-bg-color-disabled:#e0e0e0;--chip-bg-color-primary:#161616;--chip-bg-color-primary-hover:#1e1e1e;--chip-bg-color-primary-active:#262626;--chip-bg-color-subtle:#f4f4f4;--chip-bg-color-subtle-hover:#eaeaea;--chip-bg-color-subtle-active:#e0e0e0;--chip-bg-color-outline-hover:#f4f4f4;--chip-bg-color-outline-active:#eaeaea;--label-bg-color-accent:#ff3944;--sidebar-animation-duration:0.5s;}:host{background:white;border-radius:var(--modal-border-radius, var(--border-radius-300));box-sizing:border-box;display:grid;grid-template-rows:min-content auto;max-width:960px;overflow:auto;position:relative}.head{height:64px;font-family:var(--font-family, var(--font-family-base));position:absolute;width:100%;box-sizing:border-box;display:flex;align-items:center;z-index:1;padding:16px}.title{display:flex;align-items:center;transform:translateX(-6px);font-weight:var(--font-weight-600);font-size:18px;line-height:24px;margin:0 auto}.title-image{border-radius:50%;border:1px solid rgb(244, 244, 244);-o-object-fit:cover;object-fit:cover;-o-object-position:center;object-position:center;margin-right:8px}button{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:none;cursor:pointer;display:grid;padding:6px;color:#8d8d8d}button:hover{color:#000}@media (max-width: 768px){:host{animation-name:fade-in;animation-duration:0.5s;animation-fill-mode:forwards;border-radius:24px 24px 0 0}:host(.closed){animation-name:fade-out;animation-fill-mode:none}.head{z-index:1}:host(:not(.first-screen)) .head{position:sticky;background:#ffffff}.body{overflow-y:auto}:host(:not(.first-screen)) .body{padding-bottom:160px}.title{color:#161616;display:flex;align-items:center;font-weight:500;font-size:16px;line-height:24px;margin:0 auto}.title-image{border-radius:50%;border:1px solid rgb(244, 244, 244);-o-object-fit:cover;object-fit:cover;-o-object-position:center;object-position:center;margin-right:8px}button{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:none;cursor:pointer;display:grid;color:#6f6f6f;padding:0}button:hover{color:#000}:host(.first-screen) button,:host(.first-screen) button:hover{color:white}}@keyframes fade-in{from{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes fade-out{from{transform:translateY(0)}to{transform:translateY(100%)}}";const T=class{constructor(e){t(this,e)}render(){return e(i,{key:"c963c02fcebbaf9cf02952db281a51a17299d4b4"},e("slot",{key:"d83a92b01bd2a41e8ceea08ed6a383d2ad9a3c13"}))}};T.style=":host{animation:fade-in 0.5s ease-in-out;background:rgba(0, 0, 0, 0.5);display:block;height:100vh;left:0;overflow:hidden;position:fixed;top:0;width:100vw;z-index:9999}@keyframes fade-in{from{opacity:0.1}to{opacity:1}}";const L=class{constructor(e){t(this,e)}render(){return e(i,{key:"482118d266deebe0f9eac9e46b4d5399dfb7d32f"})}};L.style=":host{--preloader-size:24px;--preloader-width:calc(var(--preloader-size) / 6);transform-origin:center;animation:rotate 3s linear infinite;border:var(--preloader-width) solid currentColor;border-radius:50%;border-top-color:transparent;display:flex;outline:0;width:var(--preloader-size);height:var(--preloader-size);box-sizing:border-box}@keyframes rotate{from{transform:rotate(-360deg)}to{transform:rotate(360deg)}}";const Z=class{constructor(e){t(this,e),this.vviinnWidgetLoad=o(this,"vviinnWidgetLoad"),this.vviinnWidgetOpen=o(this,"vviinnWidgetOpen"),this.vviinnWidgetClose=o(this,"vviinnWidgetClose"),this.vviinnProductLoad=o(this,"vviinnProductLoad"),this.vviinnProductClick=o(this,"vviinnProductClick"),this.vviinnProductView=o(this,"vviinnProductView"),this.vviinnResultLoad=o(this,"vviinnResultLoad"),this.vviinnResultView=o(this,"vviinnResultView"),this.vviinnNoResult=o(this,"vviinnNoResult"),this.vviinnAddToBasket=o(this,"vviinnAddToBasket"),this.vviinnVprButtonActivated=o(this,"vviinnVprButtonActivated"),this.mode="continuity",this.campaigns="",this.excluded="",this.campaignType="set"===this.mode?"VCS":"VPR",this.color="",this.imageWidth=m,this.imageResolutionWidth=y,this.imageRatio=1,this.setItemsAmount=4,this.cssUrl=null,this.noResultText="",this.noResultShow=!0,this.gridArrowsDynamic=!1,this.productDetailsNewTab=!1,this.productDetailsRedirect=!0,this.addToBasketShow=!1,this.showFilters=!1,this.addPriceContainer=!1,this.oneClickDiscoveryMode="modal",this.setModeDiscounts="set"===this.mode?"5, 10, 15":"",this.updateButtonLocation="topAndItem",this.modalScrollbar=!1,this.position="bottom",this.addStyle=!0,this.favoriteShow=!1,this.isStandalone=!0,this.showInWidget=!1,this.sidebar=null,this.removeSidebarFromDOM=()=>{var e;this.sidebar&&((null===(e=this.targetAppendSidebarTo)||void 0===e?void 0:e.contains(this.sidebar))?this.targetAppendSidebarTo.removeChild(this.sidebar):document.body.contains(this.sidebar)&&document.body.removeChild(this.sidebar),this.sidebar=null)},this.sidebarCloseListener=(e=!1)=>{this.sidebar&&(e?this.removeSidebarFromDOM():(this.sidebar.sidebarState="closed",setTimeout((()=>this.removeSidebarFromDOM()),v)))},this.handleButtonClick=()=>{this.vviinnVprButtonActivated.emit(),this.appendSidebarToId&&!this.targetAppendSidebarTo?setTimeout((()=>{this.handleClick()}),250):this.handleClick()},this.handleKeyDown=e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this.handleButtonClick())}}connectedCallback(){this.iconSideSize=this.isStandalone?24:14;const{onChange:e}=d(this.showInWidget);this.disposeStoreListener=e("searchStatus",(e=>{"loading"===e&&this.sidebarCloseListener()}))}componentWillLoad(){this.appendSidebarToElement?this.targetAppendSidebarTo=this.appendSidebarToElement:this.appendSidebarToId&&(this.targetAppendSidebarTo=document.getElementById(this.appendSidebarToId))}appendSidebarToElementWatcher(){this.appendSidebarToElement&&(this.targetAppendSidebarTo=this.appendSidebarToElement)}getAriaLabel(){try{return h.t("a11y.findSimilarProducts")||"Find similar products"}catch(e){return"Find similar products"}}render(){return e(i,{key:"d9c112803e608ad0bde949cd970d6a44c3083a93",role:"button",tabindex:"0","aria-label":this.getAriaLabel(),onClick:this.handleButtonClick,onKeyDown:this.handleKeyDown},e("vviinn-button",{key:"9499af3129320717d46fd4afdae2a6649648ba21",addStyle:this.addStyle,part:"vviinn-button"},e("slot",{key:"7fe19321eec6bb08ae938507f1c70ade679d61e1"},e("VCS"===this.campaignType?V:z,{width:this.iconSideSize,height:this.iconSideSize}))))}handleClick(){const e=document.createElement("vviinn-recommendations-sidebar");e.token=this.token,e.locale=this.locale,e.currencySign=this.currencySign,e.pricePrefix=this.pricePrefix,e.apiPath=this.apiPath,e.sidebarTitle=this.sidebarTitle,e.productId=this.productId,e.position=this.position,e.widgetScrollbar=this.modalScrollbar,e.campaigns=this.campaigns,e.campaignType=this.campaignType,e.color=this.color,e.imageWidth=this.imageWidth,e.buttonElementId=this.el.id,e.noResultText=this.noResultText,e.noResultShow=this.noResultShow,e.gridArrowsDynamic=this.gridArrowsDynamic,e.productDetailsNewTab=this.productDetailsNewTab,e.productDetailsRedirect=this.productDetailsRedirect,e.widgetVersion=u,e.showingInButton=!0,e.excluded=this.excluded,e.addToBasketShow=this.addToBasketShow,e.buttonChildren=this.el.children,e.showFilters=this.showFilters,e.cssUrl=this.cssUrl,e.imageRatio=this.imageRatio,e.setItemsAmount=this.setItemsAmount,e.setModeDiscounts=this.setModeDiscounts,e.updateButtonLocation=this.updateButtonLocation,e.addPriceContainer=this.addPriceContainer,e.favoriteShow=this.favoriteShow,e.showInModal="modal"===this.oneClickDiscoveryMode,e.isAppended=!!this.targetAppendSidebarTo||!!this.appendSidebarToElement,e.showInWidget=this.showInWidget,e.uiSessionId=this.uiSessionId,e.triggerElement=this.el,this.targetAppendSidebarTo?(e.mode="grid",e.useCarousel="append-slider"===this.oneClickDiscoveryMode):(e.mode="right"===this.position?"grid":this.mode,e.useCarousel="bottom"===this.position),this.sidebar=e,this.eventAbortController=new AbortController;const{signal:t}=this.eventAbortController;if(w(document,[["vviinnWidgetClose",()=>this.sidebarCloseListener(!1)],["vviinnStorybookStoryChanged",()=>this.sidebarCloseListener(!0)]],t),this.targetAppendSidebarTo)return this.sidebar.showInCustomContainer=!0,this.targetAppendSidebarTo.innerHTML="",void this.targetAppendSidebarTo.append(this.sidebar);document.body.append(this.sidebar)}disconnectedCallback(){var e,t;null===(e=this.eventAbortController)||void 0===e||e.abort(),null===(t=this.disposeStoreListener)||void 0===t||t.call(this)}get el(){return r(this)}static get watchers(){return{appendSidebarToElement:["appendSidebarToElementWatcher"]}}};Z.style=":host{display:inline-block}";export{H as vviinn_detected_object,M as vviinn_error,B as vviinn_modal,T as vviinn_overlay,L as vviinn_preloader,Z as vviinn_vpr_button}
1
+ import{h as e,r as t,c as o,H as i,g as r}from"./p-C5qrIvmr.js";import{_ as a,O as s,d as n,a as c,b as l,u as d}from"./p-DehFpKKv.js";import{i as h}from"./p-C7V-mvcq.js";import{s as p,c as f}from"./p-zsZBqb9v.js";import{s as b}from"./p-Z6kWax5f.js";import{c as g,v as u}from"./p-BmI1Vf_E.js";import{m as x}from"./p-Btzdx1Bw.js";import{a as v,P as m,D as y}from"./p-CKMCQSbG.js";import{a as w}from"./p-B80MfONa.js";import"./p-BFKAtFxd.js";const C=()=>e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},e("path",{d:"M7.82499 13L12.725 17.9C12.925 18.1 13.0208 18.3333 13.0125 18.6C13.0042 18.8667 12.9 19.1 12.7 19.3C12.5 19.4833 12.2667 19.5792 12 19.5875C11.7333 19.5958 11.5 19.5 11.3 19.3L4.69999 12.7C4.59999 12.6 4.52915 12.4917 4.48749 12.375C4.44582 12.2583 4.42499 12.1333 4.42499 12C4.42499 11.8667 4.44582 11.7417 4.48749 11.625C4.52915 11.5083 4.59999 11.4 4.69999 11.3L11.3 4.69999C11.4833 4.51665 11.7125 4.42499 11.9875 4.42499C12.2625 4.42499 12.5 4.51665 12.7 4.69999C12.9 4.89999 13 5.13749 13 5.41249C13 5.68749 12.9 5.92499 12.7 6.12499L7.82499 11H19C19.2833 11 19.5208 11.0958 19.7125 11.2875C19.9042 11.4792 20 11.7167 20 12C20 12.2833 19.9042 12.5208 19.7125 12.7125C19.5208 12.9042 19.2833 13 19 13H7.82499Z",fill:"currentColor"})),k=()=>e("svg",{width:"48",height:"48",slot:"icon",class:"icon",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("path",{d:"M24 34C24.5667 34 25.0417 33.8083 25.425 33.425C25.8083 33.0417 26 32.5667 26 32C26 31.4333 25.8083 30.9583 25.425 30.575C25.0417 30.1917 24.5667 30 24 30C23.4333 30 22.9583 30.1917 22.575 30.575C22.1917 30.9583 22 31.4333 22 32C22 32.5667 22.1917 33.0417 22.575 33.425C22.9583 33.8083 23.4333 34 24 34ZM24 26C24.5667 26 25.0417 25.8083 25.425 25.425C25.8083 25.0417 26 24.5667 26 24V16C26 15.4333 25.8083 14.9583 25.425 14.575C25.0417 14.1917 24.5667 14 24 14C23.4333 14 22.9583 14.1917 22.575 14.575C22.1917 14.9583 22 15.4333 22 16V24C22 24.5667 22.1917 25.0417 22.575 25.425C22.9583 25.8083 23.4333 26 24 26ZM24 44C21.2333 44 18.6333 43.475 16.2 42.425C13.7667 41.375 11.65 39.95 9.85 38.15C8.05 36.35 6.625 34.2333 5.575 31.8C4.525 29.3667 4 26.7667 4 24C4 21.2333 4.525 18.6333 5.575 16.2C6.625 13.7667 8.05 11.65 9.85 9.85C11.65 8.05 13.7667 6.625 16.2 5.575C18.6333 4.525 21.2333 4 24 4C26.7667 4 29.3667 4.525 31.8 5.575C34.2333 6.625 36.35 8.05 38.15 9.85C39.95 11.65 41.375 13.7667 42.425 16.2C43.475 18.6333 44 21.2333 44 24C44 26.7667 43.475 29.3667 42.425 31.8C41.375 34.2333 39.95 36.35 38.15 38.15C36.35 39.95 34.2333 41.375 31.8 42.425C29.3667 43.475 26.7667 44 24 44Z",fill:"#161616"})),z=({width:t=24,height:o=24})=>e("svg",{xmlns:"http://www.w3.org/2000/svg",width:t,height:o,viewBox:"0 0 24 24",fill:"currentColor"},e("path",{d:"M4 16V15H2V16C2 19.31 4.69 22 8 22H9V20H8C5.79 20 4 18.21 4 16Z"}),e("path",{d:"M4 8C4 5.79 5.79 4 8 4H9V2H8C4.69 2 2 4.69 2 8V9H4V8Z"}),e("path",{d:"M20 8C20 5.79 18.21 4 16 4H15V2H16C19.31 2 22 4.69 22 8V9H20V8Z"}),e("path",{d:"M20 16C20 18.21 18.21 20 16 20H15V22H16C19.31 22 22 19.31 22 16V15H20V16Z"}),e("path",{d:"M9 8H7C6.45 8 6 8.45 6 9C6 9.55 6.45 10 7 10H9V11C9 11.55 9.45 12 10 12C10.55 12 11 11.55 11 11V7C11 6.45 10.55 6 10 6C9.45 6 9 6.45 9 7V8Z"}),e("path",{d:"M15 16H17C17.55 16 18 15.55 18 15C18 14.45 17.55 14 17 14H15V13C15 12.45 14.55 12 14 12C13.45 12 13 12.45 13 13V17C13 17.55 13.45 18 14 18C14.55 18 15 17.55 15 17V16Z"}),e("path",{d:"M16 9C16 8.45 15.55 8 15 8H12V10H15C15.55 10 16 9.55 16 9Z"}),e("path",{d:"M6 15C6 15.55 6.45 16 7 16H12V14H7C6.45 14 6 14.45 6 15Z"})),V=({width:t=24,height:o=24})=>e("svg",{xmlns:"http://www.w3.org/2000/svg",width:t,height:o,viewBox:"0 0 24 24",fill:"currentColor"},e("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M20 13C20 13.55 20.45 14 21 14C21.55 14 22 13.55 22 13V5C22 3.35 20.65 2 19 2H11C10.45 2 10 2.45 10 3C10 3.55 10.45 4 11 4H19C19.55 4 20 4.45 20 5V13ZM2 19C2 20.65 3.35 22 5 22H13C13.55 22 14 21.55 14 21C14 20.45 13.55 20 13 20H5C4.45 20 4 19.55 4 19V11C4 10.45 3.55 10 3 10C2.45 10 2 10.45 2 11V19ZM12 16C11.45 16 11 15.55 11 15V13H9C8.45 13 8 12.55 8 12C8 11.45 8.45 11 9 11H11V9C11 8.45 11.45 8 12 8C12.55 8 13 8.45 13 9V11H15C15.55 11 16 11.45 16 12C16 12.55 15.55 13 15 13H13V15C13 15.55 12.55 16 12 16Z"})),H=class{constructor(e){t(this,e),this.vviinnSelectObject=o(this,"vviinnSelectObject"),this.handleKeyDown=e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this.selectDetectedObject())},this.position=["0","0"]}getObjectPosition(){return a.pipe(s.fromNullable(this.imageBounds),s.map((e=>{const{left:t,top:o}=a.pipe(this.detectedObject,p(e),f);return[`${t}px`,`${o}px`]})),s.getOrElse((()=>["0","0"])))}selectDetectedObject(){const e=a.pipe(s.fromNullable(this.imageBounds),s.map((e=>p(e)(this.detectedObject))),s.toNullable);this.vviinnSelectObject.emit(Object.assign(Object.assign({},this.basicEventData),{detectedObject:this.detectedObject,searchArea:e}))}isActive(){return!(!this.detectedObject||!this.selectedDetectedObject)&&n.equals(this.detectedObject,this.selectedDetectedObject)}render(){const t=this.isActive();return e(i,{key:"ce432569b8cb46945f879b52c9ebb4baadf34dcd",class:{active:t},style:{"--x-position":this.getObjectPosition()[0],"--y-position":this.getObjectPosition()[1]}},e("button",{key:"543ddb7ceafd505a4a584764319fbb26ce489e4c",class:"detected-object-button","aria-label":h.t("a11y.detectedObject"),"aria-pressed":t,onClick:()=>this.selectDetectedObject(),onKeyDown:this.handleKeyDown}))}};H.style=':host{--font-family-base:Inter, system-ui, sans-serif;--font-family-mono:monospace;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;--font-size-title:24px;--font-size-headline:18px;--font-size-label-large:16px;--font-size-label:14px;--font-size-body-large:16px;--font-size-body:14px;--font-size-caption:12px;--line-height-title:32px;--line-height-headline:24px;--line-height-label-large:24px;--line-height-label:20px;--line-height-body-large:24px;--line-height-body:20px;--line-height-caption:16px;--letter-spacing-title:0px;--letter-spacing-headline:0px;--letter-spacing-label-large:0px;--letter-spacing-label:0px;--letter-spacing-body-large:0px;--letter-spacing-body:0px;--letter-spacing-caption:0px;--font-weight-400:400;--font-weight-500:500;--font-weight-600:600;--font-weight-700:700;--spacing-none:0px;--spacing-25:2px;--spacing-50:4px;--spacing-75:6px;--spacing-100:8px;--spacing-125:10px;--spacing-150:12px;--spacing-200:16px;--spacing-250:20px;--spacing-300:24px;--spacing-400:32px;--spacing-500:40px;--spacing-600:48px;--border-radius-none:0px;--border-radius-25:2px;--border-radius-50:4px;--border-radius-100:8px;--border-radius-150:12px;--border-radius-200:16px;--border-radius-300:24px;--border-radius-400:32px;--border-radius-full:9999px;--stroke-width-none:0px;--stroke-width-25:1px;--stroke-width-50:2px;--stroke-width-75:3px;--stroke-width-100:4px;--stroke-width-150:6px;--stroke-width-200:8px;--stroke-width-300:12px;--product-card-widget-min-width:135px;--product-card-results-min-width:250px;--image-set-mode-min-width:155px;--product-card-set-mode-max-width:300px;--source-card-set-mode-max-width:500px;--filter-blur-none:0px;--filter-blur-100:8px;--filter-blur-150:12px;--filter-blur-200:16px;--color-bg-base:#ffffff;--color-bg-inverse:#161616;--color-border-00:#ffffff;--color-border-01:#f4f4f4;--color-border-02:#e0e0e0;--color-border-03:#c6c6c6;--color-border-inverse-00:#161616;--color-border-inverse-01:#393939;--color-field-01:#ffffff;--color-field-02:#f4f4f4;--color-icon-primary:#161616;--color-icon-secondary:#525252;--color-icon-helper:#8d8d8d;--color-icon-on-color:#ffffff;--color-icon-inverse:#ffffff;--color-icon-disabled:#16161640;--color-text-primary:#161616;--color-text-secondary:#707070;--color-text-helper:#8d8d8d;--color-text-placeholder:#a8a8a8;--color-text-on-color:#ffffff;--color-text-inverse:#ffffff;--color-text-disabled:#16161640;--button-bg-color-primary:#000000;--button-bg-color-primary-hover:#161616;--button-bg-color-primary-active:#1e1e1e;--button-bg-color-secondary:#f4f4f4;--button-bg-color-secondary-hover:#e0e0e0;--button-bg-color-secondary-active:#c6c6c6;--button-bg-color-ghost-hover:#f4f4f4;--button-bg-color-ghost-active:#eaeaea;--button-bg-color-frosted:#6f6f6f66;--button-bg-color-frosted-hover:#6f6f6f80;--button-bg-color-frosted-active:#6f6f6f99;--button-bg-color-disabled:#e0e0e0;--button-bg-color-positive:#dcfce7;--surface-bg-color-01:#f4f4f4;--surface-bg-color-01-hover:#eaeaea;--surface-bg-color-01-active:#e0e0e0;--surface-bg-color-02:#ffffff;--surface-bg-color-inverse:#262626;--surface-bg-color-inverse-hover:#303030;--surface-bg-color-inverse-active:#393939;--surface-bg-color-disabled:#e0e0e0;--chip-bg-color-primary:#161616;--chip-bg-color-primary-hover:#1e1e1e;--chip-bg-color-primary-active:#262626;--chip-bg-color-subtle:#f4f4f4;--chip-bg-color-subtle-hover:#eaeaea;--chip-bg-color-subtle-active:#e0e0e0;--chip-bg-color-outline-hover:#f4f4f4;--chip-bg-color-outline-active:#eaeaea;--label-bg-color-accent:#ff3944;--sidebar-animation-duration:0.5s;}:host{--button-size:36px;display:block;position:absolute;left:calc(var(--x-position));top:calc(var(--y-position));z-index:2}.detected-object-button{background:transparent;border:none;padding:0;margin:0;font:inherit;color:inherit;position:absolute;left:calc(-1 * var(--button-size) / 2);top:calc(-1 * var(--button-size) / 2);width:var(--button-size);height:var(--button-size);border-radius:50%;cursor:pointer;z-index:3}:host::before,:host::after{content:"";cursor:pointer;position:absolute;height:var(--size);width:var(--size);left:calc(-1 * var(--size) / 2);top:calc(-1 * var(--size) / 2)}:host::before{--size:var(--button-size);border-radius:50%;z-index:0;background:rgba(0, 0, 0, 0.16);-webkit-backdrop-filter:blur(4px);backdrop-filter:blur(4px);transition:transform 0.07s ease-in-out}:host::after{--size:13px;border-radius:50%;z-index:1;background:white;box-shadow:0px 2px 2px 0px rgba(0, 0, 0, 0.15);transition:transform 0.07s ease-in-out}:host(.active)::before{transform:scale(0.88);background:rgba(0, 0, 0, 0.4)}:host(.active)::after{transform:scale(0.67)}@media (min-width: 768px){:host(:not(.active):hover)::before{transform:scale(1.08);background:rgba(0, 0, 0, 0.32)}}';const j={"empty-results":{i18nKey:"emptyResultsBlock",hasTopMargin:!0,hasText:!1,hasButton:!1},"server-error":{i18nKey:"serverErrorBlock",hasTopMargin:!1,hasText:!1,hasButton:!0},"wrong-aspect-ratio":{i18nKey:"wrongAspectRatioBlock",hasTopMargin:!0,hasText:!1,hasButton:!0},"wrong-format":{i18nKey:"wrongFormatBlock",hasTopMargin:!1,hasText:!0,hasButton:!0}},B=class{constructor(e){t(this,e),this.hasBackground=!0,this.hasTopMargin=!1}getErrorContent(){if(!this.errorType)return null;const e=j[this.errorType];return{title:h.t(`${e.i18nKey}.title`),text:e.hasText?h.t(`${e.i18nKey}.text`):null,buttonText:this.hasButton()?h.t(`${e.i18nKey}.button`):null}}hasButton(){return!!this.errorType&&(!!j[this.errorType].hasButton||"empty-results"===this.errorType&&"image"===this.searchType)}render(){var t;const o=this.getErrorContent(),r={"add-top-margin":this.hasTopMargin||this.errorType&&(null===(t=j[this.errorType])||void 0===t?void 0:t.hasTopMargin)},a={"error-content":!0,"add-background":this.hasBackground},s=this.errorType?[e(k,null),e("h4",null,null==o?void 0:o.title),(null==o?void 0:o.text)&&e("span",null,o.text),(null==o?void 0:o.buttonText)&&e("button",{onClick:this.handler},o.buttonText)]:[e("slot",{name:"icon"}),e("slot",{name:"title"}),e("slot",{name:"text"}),e("slot",{name:"action"})];return e(i,{key:"bbb411a22626197b25a8630b67aa618099330bff",class:r},e("div",{key:"ae22222ddd6ff1a146c39c6d8742f7e5e8de43ae",class:a},s))}};B.style=":host{--font-family-base:Inter, system-ui, sans-serif;--font-family-mono:monospace;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;--font-size-title:24px;--font-size-headline:18px;--font-size-label-large:16px;--font-size-label:14px;--font-size-body-large:16px;--font-size-body:14px;--font-size-caption:12px;--line-height-title:32px;--line-height-headline:24px;--line-height-label-large:24px;--line-height-label:20px;--line-height-body-large:24px;--line-height-body:20px;--line-height-caption:16px;--letter-spacing-title:0px;--letter-spacing-headline:0px;--letter-spacing-label-large:0px;--letter-spacing-label:0px;--letter-spacing-body-large:0px;--letter-spacing-body:0px;--letter-spacing-caption:0px;--font-weight-400:400;--font-weight-500:500;--font-weight-600:600;--font-weight-700:700;--spacing-none:0px;--spacing-25:2px;--spacing-50:4px;--spacing-75:6px;--spacing-100:8px;--spacing-125:10px;--spacing-150:12px;--spacing-200:16px;--spacing-250:20px;--spacing-300:24px;--spacing-400:32px;--spacing-500:40px;--spacing-600:48px;--border-radius-none:0px;--border-radius-25:2px;--border-radius-50:4px;--border-radius-100:8px;--border-radius-150:12px;--border-radius-200:16px;--border-radius-300:24px;--border-radius-400:32px;--border-radius-full:9999px;--stroke-width-none:0px;--stroke-width-25:1px;--stroke-width-50:2px;--stroke-width-75:3px;--stroke-width-100:4px;--stroke-width-150:6px;--stroke-width-200:8px;--stroke-width-300:12px;--product-card-widget-min-width:135px;--product-card-results-min-width:250px;--image-set-mode-min-width:155px;--product-card-set-mode-max-width:300px;--source-card-set-mode-max-width:500px;--filter-blur-none:0px;--filter-blur-100:8px;--filter-blur-150:12px;--filter-blur-200:16px;--color-bg-base:#ffffff;--color-bg-inverse:#161616;--color-border-00:#ffffff;--color-border-01:#f4f4f4;--color-border-02:#e0e0e0;--color-border-03:#c6c6c6;--color-border-inverse-00:#161616;--color-border-inverse-01:#393939;--color-field-01:#ffffff;--color-field-02:#f4f4f4;--color-icon-primary:#161616;--color-icon-secondary:#525252;--color-icon-helper:#8d8d8d;--color-icon-on-color:#ffffff;--color-icon-inverse:#ffffff;--color-icon-disabled:#16161640;--color-text-primary:#161616;--color-text-secondary:#707070;--color-text-helper:#8d8d8d;--color-text-placeholder:#a8a8a8;--color-text-on-color:#ffffff;--color-text-inverse:#ffffff;--color-text-disabled:#16161640;--button-bg-color-primary:#000000;--button-bg-color-primary-hover:#161616;--button-bg-color-primary-active:#1e1e1e;--button-bg-color-secondary:#f4f4f4;--button-bg-color-secondary-hover:#e0e0e0;--button-bg-color-secondary-active:#c6c6c6;--button-bg-color-ghost-hover:#f4f4f4;--button-bg-color-ghost-active:#eaeaea;--button-bg-color-frosted:#6f6f6f66;--button-bg-color-frosted-hover:#6f6f6f80;--button-bg-color-frosted-active:#6f6f6f99;--button-bg-color-disabled:#e0e0e0;--button-bg-color-positive:#dcfce7;--surface-bg-color-01:#f4f4f4;--surface-bg-color-01-hover:#eaeaea;--surface-bg-color-01-active:#e0e0e0;--surface-bg-color-02:#ffffff;--surface-bg-color-inverse:#262626;--surface-bg-color-inverse-hover:#303030;--surface-bg-color-inverse-active:#393939;--surface-bg-color-disabled:#e0e0e0;--chip-bg-color-primary:#161616;--chip-bg-color-primary-hover:#1e1e1e;--chip-bg-color-primary-active:#262626;--chip-bg-color-subtle:#f4f4f4;--chip-bg-color-subtle-hover:#eaeaea;--chip-bg-color-subtle-active:#e0e0e0;--chip-bg-color-outline-hover:#f4f4f4;--chip-bg-color-outline-active:#eaeaea;--label-bg-color-accent:#ff3944;--sidebar-animation-duration:0.5s;}:host{display:block;font-family:var(--font-family, var(--font-family-base))}:host(.add-background){background:var(--surface-bg-color-01)}:host(.add-top-margin){margin-top:var(--spacing-400)}.error-content{display:grid;grid-gap:var(--spacing-150);text-align:center;justify-items:center;width:356px;padding:var(--spacing-200);max-width:calc(100vw - 2 * var(--spacing-300));border-radius:var(--border-radius-200);box-sizing:border-box;margin:0 auto}.error-content.add-background{background:var(--surface-bg-color-01)}svg,::slotted(svg){display:grid;align-self:center}h4,::slotted(h4){margin:unset;font-weight:var(--font-weight-600);font-size:var(--font-size-headline);line-height:var(--line-height-headline)}span,::slotted(span){font-size:14px;line-height:20px}button,::slotted(button){-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;cursor:pointer;font-size:var(--font-size-label);font-weight:var(--font-weight-500);background:var(--color-primary, var(--button-bg-color-primary));border-radius:var(--border-radius-100);padding:var(--spacing-100);font-size:var(--font-size-body);color:var(--color-text-inverse);font-family:var(--font-family, var(--font-family-base))}button:hover,::slotted(button:hover){background:var(--button-bg-color-primary-hover)}";const M=class{constructor(e){t(this,e),this.vviinnWidgetClose=o(this,"vviinnWidgetClose"),this.active=!1,this.hideBackButton=!1,this.slider=!1,this.handleEscapeKey=e=>{"Escape"===e.key&&this.active&&(e.preventDefault(),this.close())},this.handleCloseButtonKeyDown=e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this.close())}}handleActiveChange(e){e?document.addEventListener("keydown",this.handleEscapeKey):document.removeEventListener("keydown",this.handleEscapeKey)}componentWillLoad(){b(this,this.el)}disconnectedCallback(){document.removeEventListener("keydown",this.handleEscapeKey)}resetTopScroll(){const e=this.el.shadowRoot.querySelector(".body");null==e||e.scroll({top:0})}close(){this.active=!1,setTimeout((()=>{this.vviinnWidgetClose.emit(Object.assign({campaignTypeId:"VPS",campaignTypeName:g.VPS,widgetVersion:this.widgetVersion},c("widgetId",this.buttonElementId)))}),this.slider?v:0)}handleAnimationEnd(e){"fade-in"===e.animationName&&(this.slider=!0)}render(){return e(i,{key:"752070b1c38d109c23843fdaec5b1998cbe52351",exportparts:x,class:{closed:!this.active,"first-screen":this.isFirstScreen},onAnimationEnd:e=>this.handleAnimationEnd(e),role:"dialog","aria-modal":this.active?"true":"false","aria-label":h.t("imageSearchModalTitle"),inert:!this.active||void 0},e("div",{key:"482da46a8ad5f3990154a531bbe01aaa9fee17ab",class:"head"},!this.hideBackButton&&e("button",{key:"5599ecf87bd418dd99d99255b2487188a74a052b",part:"secondary-action",onClick:()=>{this.resetState(),this.resetTopScroll()},"aria-label":h.t("a11y.backButton")},e(C,{key:"adb1ac95fddf4e1d03a72b9b421dcd528063d2c3"})),e("div",{key:"be069cf76dc695755960c7dda9507f0d2bd62295",class:"title",part:"results-title"},(t=l.image)?e("img",{width:"28",height:"28",src:t.src,class:"title-image",alt:h.t("a11y.uploadedImage")}):null,e("slot",{key:"4e53037b5ac82d762678d2099b550c72e1efa16f",name:"vviinn-image-search-modal-title"},h.t("imageSearchModalTitle"))),e("button",{key:"acad522368a559d4434a81af274b1e977daea2c7",onClick:()=>this.close(),onKeyDown:this.handleCloseButtonKeyDown,class:"close-button",part:"close-button","aria-label":h.t("a11y.closeButton")},e("svg",{key:"1915aaf93a2da40e945ea0623ce48aed332727c6",xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true"},e("path",{key:"b69c6b6b1764aa6c8e233b566659a44ebdb1f163",d:"M12 13.3892L6.91958 18.4696C6.72248 18.6667 6.49095 18.7653 6.225 18.7653C5.95905 18.7653 5.72753 18.6667 5.53043 18.4696C5.33333 18.2725 5.23478 18.041 5.23478 17.775C5.23478 17.5091 5.33333 17.2776 5.53043 17.0805L10.6109 12L5.53043 6.9196C5.33333 6.7225 5.23478 6.49098 5.23478 6.22503C5.23478 5.95908 5.33333 5.72755 5.53043 5.53045C5.72753 5.33335 5.95905 5.2348 6.225 5.2348C6.49095 5.2348 6.72248 5.33335 6.91958 5.53045L12 10.6109L17.0804 5.53045C17.2775 5.33335 17.5091 5.2348 17.775 5.2348C18.041 5.2348 18.2725 5.33335 18.4696 5.53045C18.6667 5.72755 18.7652 5.95908 18.7652 6.22503C18.7652 6.49098 18.6667 6.7225 18.4696 6.9196L13.3892 12L18.4696 17.0805C18.6667 17.2776 18.7652 17.5091 18.7652 17.775C18.7652 18.041 18.6667 18.2725 18.4696 18.4696C18.2725 18.6667 18.041 18.7653 17.775 18.7653C17.5091 18.7653 17.2775 18.6667 17.0804 18.4696L12 13.3892Z",fill:"currentColor"})))),e("div",{key:"c82a45fe136c5199a71a8732ca713d80884f24c9",class:"body"},e("slot",{key:"5bb01de9ac615478ce5ea811759d44fa5e84c434"})));var t}get el(){return r(this)}static get watchers(){return{active:["handleActiveChange"]}}};M.style=":host{--font-family-base:Inter, system-ui, sans-serif;--font-family-mono:monospace;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;--font-size-title:24px;--font-size-headline:18px;--font-size-label-large:16px;--font-size-label:14px;--font-size-body-large:16px;--font-size-body:14px;--font-size-caption:12px;--line-height-title:32px;--line-height-headline:24px;--line-height-label-large:24px;--line-height-label:20px;--line-height-body-large:24px;--line-height-body:20px;--line-height-caption:16px;--letter-spacing-title:0px;--letter-spacing-headline:0px;--letter-spacing-label-large:0px;--letter-spacing-label:0px;--letter-spacing-body-large:0px;--letter-spacing-body:0px;--letter-spacing-caption:0px;--font-weight-400:400;--font-weight-500:500;--font-weight-600:600;--font-weight-700:700;--spacing-none:0px;--spacing-25:2px;--spacing-50:4px;--spacing-75:6px;--spacing-100:8px;--spacing-125:10px;--spacing-150:12px;--spacing-200:16px;--spacing-250:20px;--spacing-300:24px;--spacing-400:32px;--spacing-500:40px;--spacing-600:48px;--border-radius-none:0px;--border-radius-25:2px;--border-radius-50:4px;--border-radius-100:8px;--border-radius-150:12px;--border-radius-200:16px;--border-radius-300:24px;--border-radius-400:32px;--border-radius-full:9999px;--stroke-width-none:0px;--stroke-width-25:1px;--stroke-width-50:2px;--stroke-width-75:3px;--stroke-width-100:4px;--stroke-width-150:6px;--stroke-width-200:8px;--stroke-width-300:12px;--product-card-widget-min-width:135px;--product-card-results-min-width:250px;--image-set-mode-min-width:155px;--product-card-set-mode-max-width:300px;--source-card-set-mode-max-width:500px;--filter-blur-none:0px;--filter-blur-100:8px;--filter-blur-150:12px;--filter-blur-200:16px;--color-bg-base:#ffffff;--color-bg-inverse:#161616;--color-border-00:#ffffff;--color-border-01:#f4f4f4;--color-border-02:#e0e0e0;--color-border-03:#c6c6c6;--color-border-inverse-00:#161616;--color-border-inverse-01:#393939;--color-field-01:#ffffff;--color-field-02:#f4f4f4;--color-icon-primary:#161616;--color-icon-secondary:#525252;--color-icon-helper:#8d8d8d;--color-icon-on-color:#ffffff;--color-icon-inverse:#ffffff;--color-icon-disabled:#16161640;--color-text-primary:#161616;--color-text-secondary:#707070;--color-text-helper:#8d8d8d;--color-text-placeholder:#a8a8a8;--color-text-on-color:#ffffff;--color-text-inverse:#ffffff;--color-text-disabled:#16161640;--button-bg-color-primary:#000000;--button-bg-color-primary-hover:#161616;--button-bg-color-primary-active:#1e1e1e;--button-bg-color-secondary:#f4f4f4;--button-bg-color-secondary-hover:#e0e0e0;--button-bg-color-secondary-active:#c6c6c6;--button-bg-color-ghost-hover:#f4f4f4;--button-bg-color-ghost-active:#eaeaea;--button-bg-color-frosted:#6f6f6f66;--button-bg-color-frosted-hover:#6f6f6f80;--button-bg-color-frosted-active:#6f6f6f99;--button-bg-color-disabled:#e0e0e0;--button-bg-color-positive:#dcfce7;--surface-bg-color-01:#f4f4f4;--surface-bg-color-01-hover:#eaeaea;--surface-bg-color-01-active:#e0e0e0;--surface-bg-color-02:#ffffff;--surface-bg-color-inverse:#262626;--surface-bg-color-inverse-hover:#303030;--surface-bg-color-inverse-active:#393939;--surface-bg-color-disabled:#e0e0e0;--chip-bg-color-primary:#161616;--chip-bg-color-primary-hover:#1e1e1e;--chip-bg-color-primary-active:#262626;--chip-bg-color-subtle:#f4f4f4;--chip-bg-color-subtle-hover:#eaeaea;--chip-bg-color-subtle-active:#e0e0e0;--chip-bg-color-outline-hover:#f4f4f4;--chip-bg-color-outline-active:#eaeaea;--label-bg-color-accent:#ff3944;--sidebar-animation-duration:0.5s;}:host{background:white;border-radius:var(--modal-border-radius, var(--border-radius-300));box-sizing:border-box;display:grid;grid-template-rows:min-content auto;max-width:960px;overflow:auto;position:relative}.head{height:64px;font-family:var(--font-family, var(--font-family-base));position:absolute;width:100%;box-sizing:border-box;display:flex;align-items:center;z-index:1;padding:16px}.title{display:flex;align-items:center;transform:translateX(-6px);font-weight:var(--font-weight-600);font-size:18px;line-height:24px;margin:0 auto}.title-image{border-radius:50%;border:1px solid rgb(244, 244, 244);-o-object-fit:cover;object-fit:cover;-o-object-position:center;object-position:center;margin-right:8px}button{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:none;cursor:pointer;display:grid;padding:6px;color:#8d8d8d}button:hover{color:#000}@media (max-width: 768px){:host{animation-name:fade-in;animation-duration:0.5s;animation-fill-mode:forwards;border-radius:24px 24px 0 0}:host(.closed){animation-name:fade-out;animation-fill-mode:none}.head{z-index:1}:host(:not(.first-screen)) .head{position:sticky;background:#ffffff}.body{overflow-y:auto}:host(:not(.first-screen)) .body{padding-bottom:160px}.title{color:#161616;display:flex;align-items:center;font-weight:500;font-size:16px;line-height:24px;margin:0 auto}.title-image{border-radius:50%;border:1px solid rgb(244, 244, 244);-o-object-fit:cover;object-fit:cover;-o-object-position:center;object-position:center;margin-right:8px}button{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:none;cursor:pointer;display:grid;color:#6f6f6f;padding:0}button:hover{color:#000}:host(.first-screen) button,:host(.first-screen) button:hover{color:white}}@keyframes fade-in{from{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes fade-out{from{transform:translateY(0)}to{transform:translateY(100%)}}";const T=class{constructor(e){t(this,e)}render(){return e(i,{key:"c963c02fcebbaf9cf02952db281a51a17299d4b4"},e("slot",{key:"d83a92b01bd2a41e8ceea08ed6a383d2ad9a3c13"}))}};T.style=":host{animation:fade-in 0.5s ease-in-out;background:rgba(0, 0, 0, 0.5);display:block;height:100vh;left:0;overflow:hidden;position:fixed;top:0;width:100vw;z-index:9999}@keyframes fade-in{from{opacity:0.1}to{opacity:1}}";const L=class{constructor(e){t(this,e)}render(){return e(i,{key:"482118d266deebe0f9eac9e46b4d5399dfb7d32f"})}};L.style=":host{--preloader-size:24px;--preloader-width:calc(var(--preloader-size) / 6);transform-origin:center;animation:rotate 3s linear infinite;border:var(--preloader-width) solid currentColor;border-radius:50%;border-top-color:transparent;display:flex;outline:0;width:var(--preloader-size);height:var(--preloader-size);box-sizing:border-box}@keyframes rotate{from{transform:rotate(-360deg)}to{transform:rotate(360deg)}}";const Z=class{constructor(e){t(this,e),this.vviinnWidgetLoad=o(this,"vviinnWidgetLoad"),this.vviinnWidgetOpen=o(this,"vviinnWidgetOpen"),this.vviinnWidgetClose=o(this,"vviinnWidgetClose"),this.vviinnProductLoad=o(this,"vviinnProductLoad"),this.vviinnProductClick=o(this,"vviinnProductClick"),this.vviinnProductView=o(this,"vviinnProductView"),this.vviinnResultLoad=o(this,"vviinnResultLoad"),this.vviinnResultView=o(this,"vviinnResultView"),this.vviinnNoResult=o(this,"vviinnNoResult"),this.vviinnAddToBasket=o(this,"vviinnAddToBasket"),this.vviinnVprButtonActivated=o(this,"vviinnVprButtonActivated"),this.mode="continuity",this.campaigns="",this.excluded="",this.campaignType="set"===this.mode?"VCS":"VPR",this.color="",this.imageWidth=m,this.imageResolutionWidth=y,this.imageRatio=1,this.setItemsAmount=4,this.cssUrl=null,this.noResultText="",this.noResultShow=!0,this.gridArrowsDynamic=!1,this.productDetailsNewTab=!1,this.productDetailsRedirect=!0,this.addToBasketShow=!1,this.showFilters=!1,this.addPriceContainer=!1,this.oneClickDiscoveryMode="modal",this.setModeDiscounts="set"===this.mode?"5, 10, 15":"",this.updateButtonLocation="topAndItem",this.modalScrollbar=!1,this.position="bottom",this.addStyle=!0,this.favoriteShow=!1,this.isStandalone=!0,this.showInWidget=!1,this.sidebar=null,this.removeSidebarFromDOM=()=>{var e;this.sidebar&&((null===(e=this.targetAppendSidebarTo)||void 0===e?void 0:e.contains(this.sidebar))?this.targetAppendSidebarTo.removeChild(this.sidebar):document.body.contains(this.sidebar)&&document.body.removeChild(this.sidebar),this.sidebar=null)},this.sidebarCloseListener=(e=!1)=>{this.sidebar&&(e?this.removeSidebarFromDOM():(this.sidebar.sidebarState="closed",setTimeout((()=>this.removeSidebarFromDOM()),v)))},this.handleButtonClick=()=>{this.vviinnVprButtonActivated.emit(),this.appendSidebarToId&&!this.targetAppendSidebarTo?setTimeout((()=>{this.handleClick()}),250):this.handleClick()},this.handleKeyDown=e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this.handleButtonClick())}}connectedCallback(){this.iconSideSize=this.isStandalone?24:14;const{onChange:e}=d(this.showInWidget);this.disposeStoreListener=e("searchStatus",(e=>{"loading"===e&&this.sidebarCloseListener()}))}componentWillLoad(){this.appendSidebarToElement?this.targetAppendSidebarTo=this.appendSidebarToElement:this.appendSidebarToId&&(this.targetAppendSidebarTo=document.getElementById(this.appendSidebarToId))}appendSidebarToElementWatcher(){this.appendSidebarToElement&&(this.targetAppendSidebarTo=this.appendSidebarToElement)}getAriaLabel(){try{return h.t("a11y.findSimilarProducts")||"Find similar products"}catch(e){return"Find similar products"}}render(){return e(i,{key:"d9c112803e608ad0bde949cd970d6a44c3083a93",role:"button",tabindex:"0","aria-label":this.getAriaLabel(),onClick:this.handleButtonClick,onKeyDown:this.handleKeyDown},e("vviinn-button",{key:"9499af3129320717d46fd4afdae2a6649648ba21",addStyle:this.addStyle,part:"vviinn-button"},e("slot",{key:"7fe19321eec6bb08ae938507f1c70ade679d61e1"},e("VCS"===this.campaignType?V:z,{width:this.iconSideSize,height:this.iconSideSize}))))}handleClick(){const e=document.createElement("vviinn-recommendations-sidebar");e.token=this.token,e.locale=this.locale,e.currencySign=this.currencySign,e.pricePrefix=this.pricePrefix,e.apiPath=this.apiPath,e.sidebarTitle=this.sidebarTitle,e.productId=this.productId,e.position=this.position,e.widgetScrollbar=this.modalScrollbar,e.campaigns=this.campaigns,e.campaignType=this.campaignType,e.color=this.color,e.imageWidth=this.imageWidth,e.buttonElementId=this.el.id,e.noResultText=this.noResultText,e.noResultShow=this.noResultShow,e.gridArrowsDynamic=this.gridArrowsDynamic,e.productDetailsNewTab=this.productDetailsNewTab,e.productDetailsRedirect=this.productDetailsRedirect,e.widgetVersion=u,e.showingInButton=!0,e.excluded=this.excluded,e.addToBasketShow=this.addToBasketShow,e.buttonChildren=this.el.children,e.showFilters=this.showFilters,e.cssUrl=this.cssUrl,e.imageRatio=this.imageRatio,e.setItemsAmount=this.setItemsAmount,e.setModeDiscounts=this.setModeDiscounts,e.updateButtonLocation=this.updateButtonLocation,e.addPriceContainer=this.addPriceContainer,e.favoriteShow=this.favoriteShow,e.showInModal="modal"===this.oneClickDiscoveryMode,e.isAppended=!!this.targetAppendSidebarTo||!!this.appendSidebarToElement,e.showInWidget=this.showInWidget,e.uiSessionId=this.uiSessionId,e.triggerElement=this.el,this.targetAppendSidebarTo?(e.mode="grid",e.useCarousel="append-slider"===this.oneClickDiscoveryMode):(e.mode="right"===this.position?"grid":this.mode,e.useCarousel="bottom"===this.position),this.sidebar=e,this.eventAbortController=new AbortController;const{signal:t}=this.eventAbortController;if(w(document,[["vviinnWidgetClose",()=>this.sidebarCloseListener(!1)],["vviinnStorybookStoryChanged",()=>this.sidebarCloseListener(!0)]],t),this.targetAppendSidebarTo)return this.sidebar.showInCustomContainer=!0,this.targetAppendSidebarTo.innerHTML="",void this.targetAppendSidebarTo.append(this.sidebar);document.body.append(this.sidebar)}disconnectedCallback(){var e,t;null===(e=this.eventAbortController)||void 0===e||e.abort(),null===(t=this.disposeStoreListener)||void 0===t||t.call(this)}get el(){return r(this)}static get watchers(){return{appendSidebarToElement:["appendSidebarToElementWatcher"]}}};Z.style=":host{display:inline-block}";export{H as vviinn_detected_object,B as vviinn_error,M as vviinn_modal,T as vviinn_overlay,L as vviinn_preloader,Z as vviinn_vpr_button}
@@ -1 +1 @@
1
- const t={VPR:"Similar Products",VPS:"Visual Search",VCS:"Cross-Selling",TPS:"Text Product Search"};function a(t,a){return r=>(t=>"VPR"===t._tag)(r)?t():a()}function r(t){return"VPR"===t?{_tag:"VPR"}:{_tag:"VCS"}}const s="2.177.2";export{a,t as c,r as f,s as v}
1
+ const t={VPR:"Similar Products",VPS:"Visual Search",VCS:"Cross-Selling",TPS:"Text Product Search"};function a(t,a){return r=>(t=>"VPR"===t._tag)(r)?t():a()}function r(t){return"VPR"===t?{_tag:"VPR"}:{_tag:"VCS"}}const s="2.177.3";export{a,t as c,r as f,s as v}