vviinn-widgets 2.212.2 → 2.212.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.
- package/dist/cjs/{index-CuEyZlCU.js → index-BDdEUdp7.js} +4 -2
- package/dist/cjs/{search.store-DONgsZoB.js → search.store-DE7qNAii.js} +1 -1
- package/dist/cjs/vviinn-button_6.cjs.entry.js +1 -1
- package/dist/cjs/vviinn-camera_12.cjs.entry.js +2 -2
- package/dist/cjs/vviinn-carousel_10.cjs.entry.js +4 -4
- package/dist/cjs/vviinn-shop-the-look.cjs.entry.js +1 -1
- package/dist/cjs/vviinn-text-search.cjs.entry.js +1 -1
- package/dist/collection/components/vviinn-product-card/vviinn-product-card.js +3 -2
- package/dist/collection/recommendation/index.js +2 -1
- package/dist/esm/{index-BMIjtG2f.js → index-xjr2oo4y.js} +4 -3
- package/dist/esm/{search.store-D6GBV7af.js → search.store-BLpTgYU6.js} +1 -1
- package/dist/esm/vviinn-button_6.entry.js +1 -1
- package/dist/esm/vviinn-camera_12.entry.js +2 -2
- package/dist/esm/vviinn-carousel_10.entry.js +4 -4
- package/dist/esm/vviinn-shop-the-look.entry.js +1 -1
- package/dist/esm/vviinn-text-search.entry.js +1 -1
- package/dist/types/recommendation/index.d.ts +1 -0
- package/dist/vviinn-widgets/{p-a38fa5e0.entry.js → p-2e0f95fa.entry.js} +1 -1
- package/dist/vviinn-widgets/{p-427659f7.entry.js → p-7a90de41.entry.js} +1 -1
- package/dist/vviinn-widgets/{p-3009f50c.entry.js → p-945248e4.entry.js} +1 -1
- package/dist/vviinn-widgets/{p-B0fYM6b6.js → p-C3fQHoXf.js} +1 -1
- package/dist/vviinn-widgets/p-D1DrXwEU.js +1 -0
- package/dist/vviinn-widgets/p-c7f32831.entry.js +1 -0
- package/dist/vviinn-widgets/{p-e6d25c9e.entry.js → p-f19c3bea.entry.js} +1 -1
- package/dist/vviinn-widgets/vviinn-widgets.esm.js +1 -1
- package/package.json +1 -1
- package/www/build/{p-a38fa5e0.entry.js → p-2e0f95fa.entry.js} +1 -1
- package/www/build/{p-9eddab00.js → p-692e5e49.js} +1 -1
- package/www/build/{p-427659f7.entry.js → p-7a90de41.entry.js} +1 -1
- package/www/build/{p-3009f50c.entry.js → p-945248e4.entry.js} +1 -1
- package/www/build/{p-B0fYM6b6.js → p-C3fQHoXf.js} +1 -1
- package/www/build/p-D1DrXwEU.js +1 -0
- package/www/build/p-c7f32831.entry.js +1 -0
- package/www/build/{p-e6d25c9e.entry.js → p-f19c3bea.entry.js} +1 -1
- package/www/build/vviinn-widgets.esm.js +1 -1
- package/www/index.html +1 -1
- package/dist/vviinn-widgets/p-3Gd2O2eN.js +0 -1
- package/dist/vviinn-widgets/p-3cbb3938.entry.js +0 -1
- package/www/build/p-3Gd2O2eN.js +0 -1
- package/www/build/p-3cbb3938.entry.js +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var index = require('./index-OrE9ITel.js');
|
|
4
|
-
var search_store = require('./search.store-
|
|
4
|
+
var search_store = require('./search.store-DE7qNAii.js');
|
|
5
5
|
var store = require('./store-jPZ4ROqV.js');
|
|
6
6
|
|
|
7
7
|
const PlusIcon = () => (index.h("svg", { width: "32", height: "32", viewBox: "0 0 32 32", fill: "none", xmlns: "http://www.w3.org/2000/svg", class: "plus-icon", "aria-hidden": "true" },
|
|
@@ -33,6 +33,7 @@ const getRecommendationsBody = ({ productId, campaigns, color, excluded, dynamic
|
|
|
33
33
|
const staticFilters = Object.assign(Object.assign({}, search_store.addIfNotEmpty("color", color)), search_store.addIfNotEmpty("excluded", search_store.parseStringToExcluded(excluded)));
|
|
34
34
|
return Object.assign(Object.assign(Object.assign({ productId }, search_store.addIfNotEmpty("dynamicFilters", dynamicFilters)), search_store.addIfNotEmpty("campaigns", parseCampaigns(campaigns))), search_store.addIfNotEmpty("staticFilters", staticFilters));
|
|
35
35
|
};
|
|
36
|
+
const CUSTOM_LABELS_DELIMITER = "|";
|
|
36
37
|
const getCustomLabels = (recommendation) => {
|
|
37
38
|
const { custom_label_0, custom_label_1, custom_label_2, custom_label_3, custom_label_4, } = recommendation;
|
|
38
39
|
return [
|
|
@@ -43,7 +44,7 @@ const getCustomLabels = (recommendation) => {
|
|
|
43
44
|
custom_label_4,
|
|
44
45
|
]
|
|
45
46
|
.map((label) => label !== null && label !== void 0 ? label : "")
|
|
46
|
-
.join(
|
|
47
|
+
.join(CUSTOM_LABELS_DELIMITER);
|
|
47
48
|
};
|
|
48
49
|
|
|
49
50
|
/**
|
|
@@ -371,6 +372,7 @@ const createImageSearchEvent = createTrackingEvent({
|
|
|
371
372
|
exports.CAROUSEL_CONTENT_WIDTH_CSS_VAR = CAROUSEL_CONTENT_WIDTH_CSS_VAR;
|
|
372
373
|
exports.CAROUSEL_IMAGE_WIDTH_CSS_VAR = CAROUSEL_IMAGE_WIDTH_CSS_VAR;
|
|
373
374
|
exports.CONTENT_GROUP_CSS_CLASS = CONTENT_GROUP_CSS_CLASS;
|
|
375
|
+
exports.CUSTOM_LABELS_DELIMITER = CUSTOM_LABELS_DELIMITER;
|
|
374
376
|
exports.DEFAULT_COLUMNS_NUMBER = DEFAULT_COLUMNS_NUMBER;
|
|
375
377
|
exports.FilterIconClose = FilterIconClose;
|
|
376
378
|
exports.PlusIcon = PlusIcon;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var index = require('./index-OrE9ITel.js');
|
|
4
4
|
var store = require('./store-jPZ4ROqV.js');
|
|
5
|
-
var search_store = require('./search.store-
|
|
5
|
+
var search_store = require('./search.store-DE7qNAii.js');
|
|
6
6
|
var customizedSlots = require('./customized-slots-CqOPLiML.js');
|
|
7
7
|
var SecondaryActionIcon = require('./SecondaryActionIcon-BZg-ADIW.js');
|
|
8
8
|
var index$1 = require('./index-DLEDOlRe.js');
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
var index = require('./index-OrE9ITel.js');
|
|
4
4
|
var Rectangle = require('./Rectangle-7dF6_xf3.js');
|
|
5
|
-
var search_store = require('./search.store-
|
|
5
|
+
var search_store = require('./search.store-DE7qNAii.js');
|
|
6
6
|
var customizedSlots = require('./customized-slots-CqOPLiML.js');
|
|
7
|
-
var index$1 = require('./index-
|
|
7
|
+
var index$1 = require('./index-BDdEUdp7.js');
|
|
8
8
|
var store = require('./store-jPZ4ROqV.js');
|
|
9
9
|
var cropperUtils = require('./cropperUtils-DCDOLeBS.js');
|
|
10
10
|
var index$2 = require('./index-DLEDOlRe.js');
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var index = require('./index-OrE9ITel.js');
|
|
4
|
-
var search_store = require('./search.store-
|
|
4
|
+
var search_store = require('./search.store-DE7qNAii.js');
|
|
5
5
|
var Rectangle = require('./Rectangle-7dF6_xf3.js');
|
|
6
6
|
var store = require('./store-jPZ4ROqV.js');
|
|
7
|
-
var index$2 = require('./index-
|
|
7
|
+
var index$2 = require('./index-BDdEUdp7.js');
|
|
8
8
|
var index$1 = require('./index-DLEDOlRe.js');
|
|
9
9
|
var customizedSlots = require('./customized-slots-CqOPLiML.js');
|
|
10
10
|
var index$3 = require('./index-CzqCGUTk.js');
|
|
@@ -1877,7 +1877,7 @@ const VviinnProductCard = class {
|
|
|
1877
1877
|
animated: this.isTransitioning,
|
|
1878
1878
|
"product-card--source": this.isSourceProduct,
|
|
1879
1879
|
"set-mode": this.isSetMode,
|
|
1880
|
-
}, exportparts: search_store.productCardParts, "data-id": this.productId }, openProductLink.renderExternalCSS(this.cssUrl), index.h("div", { class: "content-container", part: "content-container" }, this.showSkeleton() ? (index.h(index.Fragment, null, index.h("vviinn-skeleton", { height: 40 }), index.h("vviinn-skeleton", { height: 20, halfWidth: true }), index.h("vviinn-skeleton", { height: 40 }))) : (index.h(index.Fragment, null, index.h(Linked, { deeplink: this.deeplink, part: "deeplink", tabindex: 0 }, index.h("span", { class: "title", part: "title" }, this.productTitle)), ((_a = this.brand) === null || _a === void 0 ? void 0 : _a.length) > 0 && (index.h("span", { class: "brand", part: "brand" }, this.brand)), ((_b = this.productType) === null || _b === void 0 ? void 0 : _b.length) > 0 && (index.h("span", { class: "product-type", part: "product-type" }, this.productType)), ((_c = this === null || this === void 0 ? void 0 : this.energyCertifications) !== null && _c !== void 0 ? _c : []).map((energyCertification) => (index.h("vviinn-energy-label", { classIconUrls: energyCertification === null || energyCertification === void 0 ? void 0 : energyCertification.classIconUrls, classDataSheetUrl: energyCertification === null || energyCertification === void 0 ? void 0 : energyCertification.classDataSheetUrl, productType: energyCertification === null || energyCertification === void 0 ? void 0 : energyCertification.productType, certificationClass: energyCertification === null || energyCertification === void 0 ? void 0 : energyCertification.certificationClass, classRange: energyCertification === null || energyCertification === void 0 ? void 0 : energyCertification.classRange }))), index.h(Price, { prefix: this.pricePrefix, currency: this.effectiveCurrencySign, numberLocale: this.effectiveNumberLocale, price: this.price, basePrice: parseBasePrice(this.basePrice), salePrice: this.salePrice, baseSalePrice: parseBasePrice(this.baseSalePrice), showInContainer: this.addPriceContainer }), renderCustomLabels(this.customLabels.split(
|
|
1880
|
+
}, exportparts: search_store.productCardParts, "data-id": this.productId }, openProductLink.renderExternalCSS(this.cssUrl), index.h("div", { class: "content-container", part: "content-container" }, this.showSkeleton() ? (index.h(index.Fragment, null, index.h("vviinn-skeleton", { height: 40 }), index.h("vviinn-skeleton", { height: 20, halfWidth: true }), index.h("vviinn-skeleton", { height: 40 }))) : (index.h(index.Fragment, null, index.h(Linked, { deeplink: this.deeplink, part: "deeplink", tabindex: 0 }, index.h("span", { class: "title", part: "title" }, this.productTitle)), ((_a = this.brand) === null || _a === void 0 ? void 0 : _a.length) > 0 && (index.h("span", { class: "brand", part: "brand" }, this.brand)), ((_b = this.productType) === null || _b === void 0 ? void 0 : _b.length) > 0 && (index.h("span", { class: "product-type", part: "product-type" }, this.productType)), ((_c = this === null || this === void 0 ? void 0 : this.energyCertifications) !== null && _c !== void 0 ? _c : []).map((energyCertification) => (index.h("vviinn-energy-label", { classIconUrls: energyCertification === null || energyCertification === void 0 ? void 0 : energyCertification.classIconUrls, classDataSheetUrl: energyCertification === null || energyCertification === void 0 ? void 0 : energyCertification.classDataSheetUrl, productType: energyCertification === null || energyCertification === void 0 ? void 0 : energyCertification.productType, certificationClass: energyCertification === null || energyCertification === void 0 ? void 0 : energyCertification.certificationClass, classRange: energyCertification === null || energyCertification === void 0 ? void 0 : energyCertification.classRange }))), index.h(Price, { prefix: this.pricePrefix, currency: this.effectiveCurrencySign, numberLocale: this.effectiveNumberLocale, price: this.price, basePrice: parseBasePrice(this.basePrice), salePrice: this.salePrice, baseSalePrice: parseBasePrice(this.baseSalePrice), showInContainer: this.addPriceContainer }), renderCustomLabels(this.customLabels.split(index$2.CUSTOM_LABELS_DELIMITER), "content")))), index.h("div", { class: {
|
|
1881
1881
|
"basket-button-container": true,
|
|
1882
1882
|
hidden: !this.isShowBasketButton() || this.showSkeleton(),
|
|
1883
1883
|
}, part: "basket-button-container" }, index.h("button", { class: {
|
|
@@ -1925,7 +1925,7 @@ const VviinnProductCard = class {
|
|
|
1925
1925
|
animationInterval: generateRandomNumber(800, 1400),
|
|
1926
1926
|
productData: this.productData,
|
|
1927
1927
|
});
|
|
1928
|
-
}, "aria-label": store.instance.t("a11y.findSimilarProducts") }, index.h("div", null, index.h("slot", { name: "vviinn-update-button-icon" }, index.h(UpdateIcon, { width: 14, height: 14 }))))), index.h("div", { class: "product-card-actions", part: "product-card-actions" }, index.h("slot", { name: "vviinn-product-card-actions" })), renderCustomLabels(this.customLabels.split(
|
|
1928
|
+
}, "aria-label": store.instance.t("a11y.findSimilarProducts") }, index.h("div", null, index.h("slot", { name: "vviinn-update-button-icon" }, index.h(UpdateIcon, { width: 14, height: 14 }))))), index.h("div", { class: "product-card-actions", part: "product-card-actions" }, index.h("slot", { name: "vviinn-product-card-actions" })), renderCustomLabels(this.customLabels.split(index$2.CUSTOM_LABELS_DELIMITER), "image")), this.showFooterArrow && index.h("div", { class: "footer-arrow" })));
|
|
1929
1929
|
}
|
|
1930
1930
|
get el() { return index.getElement(this); }
|
|
1931
1931
|
static get watchers() { return {
|
|
@@ -4,7 +4,7 @@ var index = require('./index-OrE9ITel.js');
|
|
|
4
4
|
var Rectangle = require('./Rectangle-7dF6_xf3.js');
|
|
5
5
|
var cropperUtils = require('./cropperUtils-DCDOLeBS.js');
|
|
6
6
|
var swiperElement = require('./swiper-element-DjtzojCR.js');
|
|
7
|
-
var search_store = require('./search.store-
|
|
7
|
+
var search_store = require('./search.store-DE7qNAii.js');
|
|
8
8
|
var SecondaryActionIcon = require('./SecondaryActionIcon-BZg-ADIW.js');
|
|
9
9
|
var index$1 = require('./index-CzqCGUTk.js');
|
|
10
10
|
var store = require('./store-jPZ4ROqV.js');
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var index = require('./index-OrE9ITel.js');
|
|
4
4
|
var Rectangle = require('./Rectangle-7dF6_xf3.js');
|
|
5
|
-
var search_store = require('./search.store-
|
|
5
|
+
var search_store = require('./search.store-DE7qNAii.js');
|
|
6
6
|
var customizedSlots = require('./customized-slots-CqOPLiML.js');
|
|
7
7
|
var store = require('./store-jPZ4ROqV.js');
|
|
8
8
|
var index$1 = require('./index-CzqCGUTk.js');
|
|
@@ -6,6 +6,7 @@ import i18next from "i18next";
|
|
|
6
6
|
import { setupIntersectionObserver, } from "../../dom";
|
|
7
7
|
import { Linked, Price, parseBasePrice, renderCustomLabels, ContentCardContent, ListCardContent, renderProductCardImage, } from "./render-helpers";
|
|
8
8
|
import { HOVER_DELAY_MS, shouldShowMultipleImages, getCurrentImage, createHoverTimerManager, } from "./helpers";
|
|
9
|
+
import { CUSTOM_LABELS_DELIMITER } from "../../recommendation";
|
|
9
10
|
import styles from "./vviinn-product-card.css";
|
|
10
11
|
import { campaignTypeNames } from "../../campaign/Campaign";
|
|
11
12
|
import { slotChangeListener } from "../customized-slots";
|
|
@@ -337,7 +338,7 @@ export class VviinnProductCard {
|
|
|
337
338
|
animated: this.isTransitioning,
|
|
338
339
|
"product-card--source": this.isSourceProduct,
|
|
339
340
|
"set-mode": this.isSetMode,
|
|
340
|
-
}, exportparts: productCardParts, "data-id": this.productId }, renderExternalCSS(this.cssUrl), h("div", { class: "content-container", part: "content-container" }, this.showSkeleton() ? (h(Fragment, null, h("vviinn-skeleton", { height: 40 }), h("vviinn-skeleton", { height: 20, halfWidth: true }), h("vviinn-skeleton", { height: 40 }))) : (h(Fragment, null, h(Linked, { deeplink: this.deeplink, part: "deeplink", tabindex: 0 }, h("span", { class: "title", part: "title" }, this.productTitle)), ((_a = this.brand) === null || _a === void 0 ? void 0 : _a.length) > 0 && (h("span", { class: "brand", part: "brand" }, this.brand)), ((_b = this.productType) === null || _b === void 0 ? void 0 : _b.length) > 0 && (h("span", { class: "product-type", part: "product-type" }, this.productType)), ((_c = this === null || this === void 0 ? void 0 : this.energyCertifications) !== null && _c !== void 0 ? _c : []).map((energyCertification) => (h("vviinn-energy-label", { classIconUrls: energyCertification === null || energyCertification === void 0 ? void 0 : energyCertification.classIconUrls, classDataSheetUrl: energyCertification === null || energyCertification === void 0 ? void 0 : energyCertification.classDataSheetUrl, productType: energyCertification === null || energyCertification === void 0 ? void 0 : energyCertification.productType, certificationClass: energyCertification === null || energyCertification === void 0 ? void 0 : energyCertification.certificationClass, classRange: energyCertification === null || energyCertification === void 0 ? void 0 : energyCertification.classRange }))), h(Price, { prefix: this.pricePrefix, currency: this.effectiveCurrencySign, numberLocale: this.effectiveNumberLocale, price: this.price, basePrice: parseBasePrice(this.basePrice), salePrice: this.salePrice, baseSalePrice: parseBasePrice(this.baseSalePrice), showInContainer: this.addPriceContainer }), renderCustomLabels(this.customLabels.split(
|
|
341
|
+
}, exportparts: productCardParts, "data-id": this.productId }, renderExternalCSS(this.cssUrl), h("div", { class: "content-container", part: "content-container" }, this.showSkeleton() ? (h(Fragment, null, h("vviinn-skeleton", { height: 40 }), h("vviinn-skeleton", { height: 20, halfWidth: true }), h("vviinn-skeleton", { height: 40 }))) : (h(Fragment, null, h(Linked, { deeplink: this.deeplink, part: "deeplink", tabindex: 0 }, h("span", { class: "title", part: "title" }, this.productTitle)), ((_a = this.brand) === null || _a === void 0 ? void 0 : _a.length) > 0 && (h("span", { class: "brand", part: "brand" }, this.brand)), ((_b = this.productType) === null || _b === void 0 ? void 0 : _b.length) > 0 && (h("span", { class: "product-type", part: "product-type" }, this.productType)), ((_c = this === null || this === void 0 ? void 0 : this.energyCertifications) !== null && _c !== void 0 ? _c : []).map((energyCertification) => (h("vviinn-energy-label", { classIconUrls: energyCertification === null || energyCertification === void 0 ? void 0 : energyCertification.classIconUrls, classDataSheetUrl: energyCertification === null || energyCertification === void 0 ? void 0 : energyCertification.classDataSheetUrl, productType: energyCertification === null || energyCertification === void 0 ? void 0 : energyCertification.productType, certificationClass: energyCertification === null || energyCertification === void 0 ? void 0 : energyCertification.certificationClass, classRange: energyCertification === null || energyCertification === void 0 ? void 0 : energyCertification.classRange }))), h(Price, { prefix: this.pricePrefix, currency: this.effectiveCurrencySign, numberLocale: this.effectiveNumberLocale, price: this.price, basePrice: parseBasePrice(this.basePrice), salePrice: this.salePrice, baseSalePrice: parseBasePrice(this.baseSalePrice), showInContainer: this.addPriceContainer }), renderCustomLabels(this.customLabels.split(CUSTOM_LABELS_DELIMITER), "content")))), h("div", { class: {
|
|
341
342
|
"basket-button-container": true,
|
|
342
343
|
hidden: !this.isShowBasketButton() || this.showSkeleton(),
|
|
343
344
|
}, part: "basket-button-container" }, h("button", { class: {
|
|
@@ -385,7 +386,7 @@ export class VviinnProductCard {
|
|
|
385
386
|
animationInterval: generateRandomNumber(800, 1400),
|
|
386
387
|
productData: this.productData,
|
|
387
388
|
});
|
|
388
|
-
}, "aria-label": i18next.t("a11y.findSimilarProducts") }, h("div", null, h("slot", { name: "vviinn-update-button-icon" }, h(UpdateIcon, { width: 14, height: 14 }))))), h("div", { class: "product-card-actions", part: "product-card-actions" }, h("slot", { name: "vviinn-product-card-actions" })), renderCustomLabels(this.customLabels.split(
|
|
389
|
+
}, "aria-label": i18next.t("a11y.findSimilarProducts") }, h("div", null, h("slot", { name: "vviinn-update-button-icon" }, h(UpdateIcon, { width: 14, height: 14 }))))), h("div", { class: "product-card-actions", part: "product-card-actions" }, h("slot", { name: "vviinn-product-card-actions" })), renderCustomLabels(this.customLabels.split(CUSTOM_LABELS_DELIMITER), "image")), this.showFooterArrow && h("div", { class: "footer-arrow" })));
|
|
389
390
|
}
|
|
390
391
|
static get is() { return "vviinn-product-card"; }
|
|
391
392
|
static get encapsulation() { return "shadow"; }
|
|
@@ -11,6 +11,7 @@ export const getRecommendationsBody = ({ productId, campaigns, color, excluded,
|
|
|
11
11
|
const staticFilters = Object.assign(Object.assign({}, addIfNotEmpty("color", color)), addIfNotEmpty("excluded", parseStringToExcluded(excluded)));
|
|
12
12
|
return Object.assign(Object.assign(Object.assign({ productId }, addIfNotEmpty("dynamicFilters", dynamicFilters)), addIfNotEmpty("campaigns", parseCampaigns(campaigns))), addIfNotEmpty("staticFilters", staticFilters));
|
|
13
13
|
};
|
|
14
|
+
export const CUSTOM_LABELS_DELIMITER = "|";
|
|
14
15
|
export const getCustomLabels = (recommendation) => {
|
|
15
16
|
const { custom_label_0, custom_label_1, custom_label_2, custom_label_3, custom_label_4, } = recommendation;
|
|
16
17
|
return [
|
|
@@ -21,5 +22,5 @@ export const getCustomLabels = (recommendation) => {
|
|
|
21
22
|
custom_label_4,
|
|
22
23
|
]
|
|
23
24
|
.map((label) => label !== null && label !== void 0 ? label : "")
|
|
24
|
-
.join(
|
|
25
|
+
.join(CUSTOM_LABELS_DELIMITER);
|
|
25
26
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { h } from './index-C5qrIvmr.js';
|
|
2
|
-
import { a as addIfNotEmpty, t as parseStringToExcluded, w as isValueMatch, x as isIntervalMatch, y as valueToString, z as extractFilterValue } from './search.store-
|
|
2
|
+
import { a as addIfNotEmpty, t as parseStringToExcluded, w as isValueMatch, x as isIntervalMatch, y as valueToString, z as extractFilterValue } from './search.store-BLpTgYU6.js';
|
|
3
3
|
import { i as instance } from './store-BJxQCbNV.js';
|
|
4
4
|
|
|
5
5
|
const PlusIcon = () => (h("svg", { width: "32", height: "32", viewBox: "0 0 32 32", fill: "none", xmlns: "http://www.w3.org/2000/svg", class: "plus-icon", "aria-hidden": "true" },
|
|
@@ -31,6 +31,7 @@ const getRecommendationsBody = ({ productId, campaigns, color, excluded, dynamic
|
|
|
31
31
|
const staticFilters = Object.assign(Object.assign({}, addIfNotEmpty("color", color)), addIfNotEmpty("excluded", parseStringToExcluded(excluded)));
|
|
32
32
|
return Object.assign(Object.assign(Object.assign({ productId }, addIfNotEmpty("dynamicFilters", dynamicFilters)), addIfNotEmpty("campaigns", parseCampaigns(campaigns))), addIfNotEmpty("staticFilters", staticFilters));
|
|
33
33
|
};
|
|
34
|
+
const CUSTOM_LABELS_DELIMITER = "|";
|
|
34
35
|
const getCustomLabels = (recommendation) => {
|
|
35
36
|
const { custom_label_0, custom_label_1, custom_label_2, custom_label_3, custom_label_4, } = recommendation;
|
|
36
37
|
return [
|
|
@@ -41,7 +42,7 @@ const getCustomLabels = (recommendation) => {
|
|
|
41
42
|
custom_label_4,
|
|
42
43
|
]
|
|
43
44
|
.map((label) => label !== null && label !== void 0 ? label : "")
|
|
44
|
-
.join(
|
|
45
|
+
.join(CUSTOM_LABELS_DELIMITER);
|
|
45
46
|
};
|
|
46
47
|
|
|
47
48
|
/**
|
|
@@ -366,4 +367,4 @@ const createImageSearchEvent = createTrackingEvent({
|
|
|
366
367
|
typ: SEARCH_EVENT_TYPE,
|
|
367
368
|
});
|
|
368
369
|
|
|
369
|
-
export { CONTENT_GROUP_CSS_CLASS as C, DEFAULT_COLUMNS_NUMBER as D, FilterIconClose as F, PlusIcon as P, RESULTS_CALCULATED_COLUMNS_CSS_VAR as R, SET_MODE_IMAGE_WIDTH_CSS_VAR as S, createFilterEvent as a, createAddToBasketEvent as b, createWidgetEvent as c, createAddToWishlistEvent as d, createResultEventByType as e, createProductEventByType as f, getRemoveFilterAriaLabel as g, getCustomLabels as h, getIntervalLabel as i, triggerRemoveIntervalFilter as j, announceToScreenReader as k, isSubFilterActive as l, RenderFilterButton as m, createImageSearchEvent as n, CAROUSEL_IMAGE_WIDTH_CSS_VAR as o, CAROUSEL_CONTENT_WIDTH_CSS_VAR as p, SCROLL_POSITION_TOLERANCE as q, triggerResetFilters as r, syncRequestFilters as s, triggerFilter as t, isPriceFilter as u, v4 as v,
|
|
370
|
+
export { CONTENT_GROUP_CSS_CLASS as C, DEFAULT_COLUMNS_NUMBER as D, FilterIconClose as F, PlusIcon as P, RESULTS_CALCULATED_COLUMNS_CSS_VAR as R, SET_MODE_IMAGE_WIDTH_CSS_VAR as S, createFilterEvent as a, createAddToBasketEvent as b, createWidgetEvent as c, createAddToWishlistEvent as d, createResultEventByType as e, createProductEventByType as f, getRemoveFilterAriaLabel as g, getCustomLabels as h, getIntervalLabel as i, triggerRemoveIntervalFilter as j, announceToScreenReader as k, isSubFilterActive as l, RenderFilterButton as m, createImageSearchEvent as n, CAROUSEL_IMAGE_WIDTH_CSS_VAR as o, CAROUSEL_CONTENT_WIDTH_CSS_VAR as p, SCROLL_POSITION_TOLERANCE as q, triggerResetFilters as r, syncRequestFilters as s, triggerFilter as t, isPriceFilter as u, v4 as v, CUSTOM_LABELS_DELIMITER as w, getRecommendationsBody as x };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { h, r as registerInstance, H as Host, c as createEvent, g as getElement, F as Fragment } from './index-C5qrIvmr.js';
|
|
2
2
|
import { i as instance } from './store-BJxQCbNV.js';
|
|
3
|
-
import { l as getAcceptableFileFormatsForDisplay, c as campaignTypeNames, a as addIfNotEmpty, n as modalParts, o as searchState, p as carouselParts, q as productCardParts, r as recommendationsParts, u as useSearchStore, v as version } from './search.store-
|
|
3
|
+
import { l as getAcceptableFileFormatsForDisplay, c as campaignTypeNames, a as addIfNotEmpty, n as modalParts, o as searchState, p as carouselParts, q as productCardParts, r as recommendationsParts, u as useSearchStore, v as version } from './search.store-BLpTgYU6.js';
|
|
4
4
|
import { s as slotChangeListener } from './customized-slots-5-oNsq_M.js';
|
|
5
5
|
import { S as SecondaryActionIcon } from './SecondaryActionIcon-Co8n0aty.js';
|
|
6
6
|
import { a as SIDEBAR_ANIMATION_DURATION, P as PRODUCT_CARD_IMAGE_WIDTH, D as DISCOVERY_WIDGET_IMAGE_RESOLUTION_WIDTH, L as LOADING_CLASS_DELAY, b as addEventListenersWithSignal } from './index-DlCdKcyY.js';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { h, r as registerInstance, c as createEvent, H as Host, g as getElement, F as Fragment } from './index-C5qrIvmr.js';
|
|
2
2
|
import { _ as _functionExports, E as EitherExports, f as fold, b as fromImage, a as divideOnSized, e as isLeft, m as match, O as OptionExports } from './Rectangle-dmgo4KMB.js';
|
|
3
|
-
import { A as toFile, g as makeUploadFileRequest, B as getImageSizes, v as version, c as campaignTypeNames, a as addIfNotEmpty, f as makeVisualSearchRequest, u as useSearchStore, C as checkImageType, j as getAcceptableFileFormats, s as setTextSearchQuery, D as resetStore, m as makeTextSearchRequest, E as makeProductListingPageRequest, F as productCardsGridPart, q as productCardParts, G as listCardParts, H as contentCardParts, I as selectedFiltersParts, J as suggestionsParts, K as checkDeviceType, t as parseStringToExcluded, L as filtersParts, M as extendedFiltersParts, n as modalParts, d as searchBarParts, N as searchWidgetFilterParts, O as searchWidgetButtonParts } from './search.store-
|
|
3
|
+
import { A as toFile, g as makeUploadFileRequest, B as getImageSizes, v as version, c as campaignTypeNames, a as addIfNotEmpty, f as makeVisualSearchRequest, u as useSearchStore, C as checkImageType, j as getAcceptableFileFormats, s as setTextSearchQuery, D as resetStore, m as makeTextSearchRequest, E as makeProductListingPageRequest, F as productCardsGridPart, q as productCardParts, G as listCardParts, H as contentCardParts, I as selectedFiltersParts, J as suggestionsParts, K as checkDeviceType, t as parseStringToExcluded, L as filtersParts, M as extendedFiltersParts, n as modalParts, d as searchBarParts, N as searchWidgetFilterParts, O as searchWidgetButtonParts } from './search.store-BLpTgYU6.js';
|
|
4
4
|
import { s as slotChangeListener, p as productCardSlotNames, v as vprIconSlotName, S as SlotSkeleton } from './customized-slots-5-oNsq_M.js';
|
|
5
|
-
import { g as getRemoveFilterAriaLabel, F as FilterIconClose, P as PlusIcon, R as RESULTS_CALCULATED_COLUMNS_CSS_VAR, c as createWidgetEvent, a as createFilterEvent, v as v4, b as createAddToBasketEvent, d as createAddToWishlistEvent, e as createResultEventByType, f as createProductEventByType, h as getCustomLabels, t as triggerFilter, i as getIntervalLabel, j as triggerRemoveIntervalFilter, k as announceToScreenReader, s as syncRequestFilters, l as isSubFilterActive, m as RenderFilterButton, n as createImageSearchEvent } from './index-
|
|
5
|
+
import { g as getRemoveFilterAriaLabel, F as FilterIconClose, P as PlusIcon, R as RESULTS_CALCULATED_COLUMNS_CSS_VAR, c as createWidgetEvent, a as createFilterEvent, v as v4, b as createAddToBasketEvent, d as createAddToWishlistEvent, e as createResultEventByType, f as createProductEventByType, h as getCustomLabels, t as triggerFilter, i as getIntervalLabel, j as triggerRemoveIntervalFilter, k as announceToScreenReader, s as syncRequestFilters, l as isSubFilterActive, m as RenderFilterButton, n as createImageSearchEvent } from './index-xjr2oo4y.js';
|
|
6
6
|
import { i as instance, t as trackEvent, a as isTrackingEnabled, d as defaultConfig } from './store-BJxQCbNV.js';
|
|
7
7
|
import { M as MIN_SEARCH_AREA_SIZE, S as SUPPORTED_ASPECT_RATIO, a as MIN_IMAGE_SIDE_FOR_CROPPER, C as Cropper, c as cropperOptions, g as getCropBoxData, i as isCropBoxChangeMinimal, D as DEFAULT_IMAGE_SIZE } from './cropperUtils-CkB6bG3L.js';
|
|
8
8
|
import { b as addEventListenersWithSignal, R as RESULTS_WIDGET_IMAGE_RESOLUTION_WIDTH, f as findSlotElements, g as getSlotNames, c as SCROLL_TO_DISCOVERY_DELAY, s as setElementInteractivity, S as SEARCH_WIDGET_IMAGE_RESOLUTION_WIDTH } from './index-DlCdKcyY.js';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { h, r as registerInstance, c as createEvent, F as Fragment, H as Host, g as getElement } from './index-C5qrIvmr.js';
|
|
2
|
-
import { c as campaignTypeNames, a as addIfNotEmpty, _ as _ArrayExports, P as energyLabelParts, u as useSearchStore, M as extendedFiltersParts, L as filtersParts, Q as imageParts, R as isMobile, H as contentCardParts, G as listCardParts, q as productCardParts, S as priceRangeParts, T as fromString, U as fold, v as version } from './search.store-
|
|
2
|
+
import { c as campaignTypeNames, a as addIfNotEmpty, _ as _ArrayExports, P as energyLabelParts, u as useSearchStore, M as extendedFiltersParts, L as filtersParts, Q as imageParts, R as isMobile, H as contentCardParts, G as listCardParts, q as productCardParts, S as priceRangeParts, T as fromString, U as fold, v as version } from './search.store-BLpTgYU6.js';
|
|
3
3
|
import { X as has, Y as tuple, _ as _functionExports, g as requireSemigroup, O as OptionExports, v as pipe$1, N as chainW, Z as makeRequest, L as fromEither, $ as resolveApiPath, a0 as createInitPostRequest, a1 as Apply, a2 as TaskEitherExports, E as EitherExports } from './Rectangle-dmgo4KMB.js';
|
|
4
4
|
import { i as instance, d as defaultConfig, t as trackEvent, a as isTrackingEnabled } from './store-BJxQCbNV.js';
|
|
5
|
-
import { S as SET_MODE_IMAGE_WIDTH_CSS_VAR, C as CONTENT_GROUP_CSS_CLASS, o as CAROUSEL_IMAGE_WIDTH_CSS_VAR, p as CAROUSEL_CONTENT_WIDTH_CSS_VAR, R as RESULTS_CALCULATED_COLUMNS_CSS_VAR, D as DEFAULT_COLUMNS_NUMBER, h as getCustomLabels, q as SCROLL_POSITION_TOLERANCE, r as triggerResetFilters, t as triggerFilter, k as announceToScreenReader, i as getIntervalLabel, u as isPriceFilter, l as isSubFilterActive, m as RenderFilterButton, s as syncRequestFilters, P as PlusIcon, v as v4, c as createWidgetEvent, e as createResultEventByType, b as createAddToBasketEvent, d as createAddToWishlistEvent, f as createProductEventByType,
|
|
5
|
+
import { S as SET_MODE_IMAGE_WIDTH_CSS_VAR, C as CONTENT_GROUP_CSS_CLASS, o as CAROUSEL_IMAGE_WIDTH_CSS_VAR, p as CAROUSEL_CONTENT_WIDTH_CSS_VAR, R as RESULTS_CALCULATED_COLUMNS_CSS_VAR, D as DEFAULT_COLUMNS_NUMBER, h as getCustomLabels, q as SCROLL_POSITION_TOLERANCE, r as triggerResetFilters, t as triggerFilter, k as announceToScreenReader, i as getIntervalLabel, u as isPriceFilter, l as isSubFilterActive, m as RenderFilterButton, s as syncRequestFilters, P as PlusIcon, w as CUSTOM_LABELS_DELIMITER, v as v4, c as createWidgetEvent, e as createResultEventByType, b as createAddToBasketEvent, d as createAddToWishlistEvent, f as createProductEventByType, x as getRecommendationsBody } from './index-xjr2oo4y.js';
|
|
6
6
|
import { P as PRODUCT_CARD_IMAGE_WIDTH, D as DISCOVERY_WIDGET_IMAGE_RESOLUTION_WIDTH, b as addEventListenersWithSignal, i as isElementInSelector, d as PRODUCT_CARD_IMAGE_RESOLUTION_WIDTH } from './index-DlCdKcyY.js';
|
|
7
7
|
import { s as slotChangeListener, S as SlotSkeleton } from './customized-slots-5-oNsq_M.js';
|
|
8
8
|
import { i as initializeLocale } from './index-T4QhG8cc.js';
|
|
@@ -1875,7 +1875,7 @@ const VviinnProductCard = class {
|
|
|
1875
1875
|
animated: this.isTransitioning,
|
|
1876
1876
|
"product-card--source": this.isSourceProduct,
|
|
1877
1877
|
"set-mode": this.isSetMode,
|
|
1878
|
-
}, exportparts: productCardParts, "data-id": this.productId }, renderExternalCSS(this.cssUrl), h("div", { class: "content-container", part: "content-container" }, this.showSkeleton() ? (h(Fragment, null, h("vviinn-skeleton", { height: 40 }), h("vviinn-skeleton", { height: 20, halfWidth: true }), h("vviinn-skeleton", { height: 40 }))) : (h(Fragment, null, h(Linked, { deeplink: this.deeplink, part: "deeplink", tabindex: 0 }, h("span", { class: "title", part: "title" }, this.productTitle)), ((_a = this.brand) === null || _a === void 0 ? void 0 : _a.length) > 0 && (h("span", { class: "brand", part: "brand" }, this.brand)), ((_b = this.productType) === null || _b === void 0 ? void 0 : _b.length) > 0 && (h("span", { class: "product-type", part: "product-type" }, this.productType)), ((_c = this === null || this === void 0 ? void 0 : this.energyCertifications) !== null && _c !== void 0 ? _c : []).map((energyCertification) => (h("vviinn-energy-label", { classIconUrls: energyCertification === null || energyCertification === void 0 ? void 0 : energyCertification.classIconUrls, classDataSheetUrl: energyCertification === null || energyCertification === void 0 ? void 0 : energyCertification.classDataSheetUrl, productType: energyCertification === null || energyCertification === void 0 ? void 0 : energyCertification.productType, certificationClass: energyCertification === null || energyCertification === void 0 ? void 0 : energyCertification.certificationClass, classRange: energyCertification === null || energyCertification === void 0 ? void 0 : energyCertification.classRange }))), h(Price, { prefix: this.pricePrefix, currency: this.effectiveCurrencySign, numberLocale: this.effectiveNumberLocale, price: this.price, basePrice: parseBasePrice(this.basePrice), salePrice: this.salePrice, baseSalePrice: parseBasePrice(this.baseSalePrice), showInContainer: this.addPriceContainer }), renderCustomLabels(this.customLabels.split(
|
|
1878
|
+
}, exportparts: productCardParts, "data-id": this.productId }, renderExternalCSS(this.cssUrl), h("div", { class: "content-container", part: "content-container" }, this.showSkeleton() ? (h(Fragment, null, h("vviinn-skeleton", { height: 40 }), h("vviinn-skeleton", { height: 20, halfWidth: true }), h("vviinn-skeleton", { height: 40 }))) : (h(Fragment, null, h(Linked, { deeplink: this.deeplink, part: "deeplink", tabindex: 0 }, h("span", { class: "title", part: "title" }, this.productTitle)), ((_a = this.brand) === null || _a === void 0 ? void 0 : _a.length) > 0 && (h("span", { class: "brand", part: "brand" }, this.brand)), ((_b = this.productType) === null || _b === void 0 ? void 0 : _b.length) > 0 && (h("span", { class: "product-type", part: "product-type" }, this.productType)), ((_c = this === null || this === void 0 ? void 0 : this.energyCertifications) !== null && _c !== void 0 ? _c : []).map((energyCertification) => (h("vviinn-energy-label", { classIconUrls: energyCertification === null || energyCertification === void 0 ? void 0 : energyCertification.classIconUrls, classDataSheetUrl: energyCertification === null || energyCertification === void 0 ? void 0 : energyCertification.classDataSheetUrl, productType: energyCertification === null || energyCertification === void 0 ? void 0 : energyCertification.productType, certificationClass: energyCertification === null || energyCertification === void 0 ? void 0 : energyCertification.certificationClass, classRange: energyCertification === null || energyCertification === void 0 ? void 0 : energyCertification.classRange }))), h(Price, { prefix: this.pricePrefix, currency: this.effectiveCurrencySign, numberLocale: this.effectiveNumberLocale, price: this.price, basePrice: parseBasePrice(this.basePrice), salePrice: this.salePrice, baseSalePrice: parseBasePrice(this.baseSalePrice), showInContainer: this.addPriceContainer }), renderCustomLabels(this.customLabels.split(CUSTOM_LABELS_DELIMITER), "content")))), h("div", { class: {
|
|
1879
1879
|
"basket-button-container": true,
|
|
1880
1880
|
hidden: !this.isShowBasketButton() || this.showSkeleton(),
|
|
1881
1881
|
}, part: "basket-button-container" }, h("button", { class: {
|
|
@@ -1923,7 +1923,7 @@ const VviinnProductCard = class {
|
|
|
1923
1923
|
animationInterval: generateRandomNumber(800, 1400),
|
|
1924
1924
|
productData: this.productData,
|
|
1925
1925
|
});
|
|
1926
|
-
}, "aria-label": instance.t("a11y.findSimilarProducts") }, h("div", null, h("slot", { name: "vviinn-update-button-icon" }, h(UpdateIcon, { width: 14, height: 14 }))))), h("div", { class: "product-card-actions", part: "product-card-actions" }, h("slot", { name: "vviinn-product-card-actions" })), renderCustomLabels(this.customLabels.split(
|
|
1926
|
+
}, "aria-label": instance.t("a11y.findSimilarProducts") }, h("div", null, h("slot", { name: "vviinn-update-button-icon" }, h(UpdateIcon, { width: 14, height: 14 }))))), h("div", { class: "product-card-actions", part: "product-card-actions" }, h("slot", { name: "vviinn-product-card-actions" })), renderCustomLabels(this.customLabels.split(CUSTOM_LABELS_DELIMITER), "image")), this.showFooterArrow && h("div", { class: "footer-arrow" })));
|
|
1927
1927
|
}
|
|
1928
1928
|
get el() { return getElement(this); }
|
|
1929
1929
|
static get watchers() { return {
|
|
@@ -2,7 +2,7 @@ import { h, r as registerInstance, c as createEvent, H as Host, g as getElement
|
|
|
2
2
|
import { a as divideOnSized, E as EitherExports } from './Rectangle-dmgo4KMB.js';
|
|
3
3
|
import { C as Cropper, c as cropperOptions, g as getCropBoxData, i as isCropBoxChangeMinimal } from './cropperUtils-CkB6bG3L.js';
|
|
4
4
|
import { g as getSwiperStyles, c as configureSwiperElement, r as register, e as extractSlideIndex, s as setupIntersectionObserver } from './swiper-element-Er2KrWw1.js';
|
|
5
|
-
import { i as isDesktop$1, e as shopTheLookState, f as makeVisualSearchRequest, g as makeUploadFileRequest, h as imageFromFileTask, j as getAcceptableFileFormats, k as shopTheLookParts } from './search.store-
|
|
5
|
+
import { i as isDesktop$1, e as shopTheLookState, f as makeVisualSearchRequest, g as makeUploadFileRequest, h as imageFromFileTask, j as getAcceptableFileFormats, k as shopTheLookParts } from './search.store-BLpTgYU6.js';
|
|
6
6
|
import { S as SecondaryActionIcon } from './SecondaryActionIcon-Co8n0aty.js';
|
|
7
7
|
import { i as initializeLocale } from './index-T4QhG8cc.js';
|
|
8
8
|
import { d as defaultConfig } from './store-BJxQCbNV.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { h, r as registerInstance, c as createEvent, H as Host, g as getElement } from './index-C5qrIvmr.js';
|
|
2
2
|
import { _ as _functionExports, f as fold } from './Rectangle-dmgo4KMB.js';
|
|
3
|
-
import { v as version, c as campaignTypeNames, a as addIfNotEmpty, s as setTextSearchQuery, m as makeTextSearchRequest, b as makeAutoSuggestRequest, u as useSearchStore, d as searchBarParts } from './search.store-
|
|
3
|
+
import { v as version, c as campaignTypeNames, a as addIfNotEmpty, s as setTextSearchQuery, m as makeTextSearchRequest, b as makeAutoSuggestRequest, u as useSearchStore, d as searchBarParts } from './search.store-BLpTgYU6.js';
|
|
4
4
|
import { s as slotChangeListener } from './customized-slots-5-oNsq_M.js';
|
|
5
5
|
import { i as instance, d as defaultConfig } from './store-BJxQCbNV.js';
|
|
6
6
|
import { i as initializeLocale } from './index-T4QhG8cc.js';
|
|
@@ -8,5 +8,6 @@ type GetRecommendationsBodyProps = {
|
|
|
8
8
|
dynamicFilters?: RequestDynamicFilterItem[];
|
|
9
9
|
};
|
|
10
10
|
export declare const getRecommendationsBody: ({ productId, campaigns, color, excluded, dynamicFilters, }: GetRecommendationsBodyProps) => SimilarProductsRequest | CrossSellingRequest;
|
|
11
|
+
export declare const CUSTOM_LABELS_DELIMITER = "|";
|
|
11
12
|
export declare const getCustomLabels: (recommendation: Recommendation) => string;
|
|
12
13
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as t,r as e,c as i,H as o,g as s}from"./p-C5qrIvmr.js";import{_ as r,f as a}from"./p-CrEgr0jU.js";import{v as n,c,a as h,s as l,m as d,b as p,u as f,d as b}from"./p-B0fYM6b6.js";import{s as g}from"./p-COO7WxAu.js";import{i as u,d as x}from"./p-BJxQCbNV.js";import{i as v}from"./p-DDpGHPMT.js";import{i as m,b as y}from"./p-niHq9WT6.js";const w=()=>t("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t("path",{d:"M20.6 4.57C17.39 4.19 16.88 3.68 16.42 0.37C16.38 0.15 16.22 0 16.01 0C15.8 0 15.63 0.15 15.59 0.37C15.12 3.66 14.63 4.13 11.41 4.57C11.17 4.61 11.01 4.77 11.01 5C11.01 5.23 11.17 5.39 11.41 5.42C14.63 5.81 15.14 6.31 15.59 9.62C15.63 9.84 15.8 10 16.01 10C16.22 10 16.39 9.84 16.42 9.62C16.89 6.31 17.39 5.81 20.6 5.42C20.84 5.38 21 5.22 21 5C21 4.78 20.83 4.6 20.6 4.57Z",fill:"#525252"}),t("path",{d:"M14 12C14 9.24 11.76 7 9 7C6.24 7 4 9.24 4 12C4 14.76 6.24 17 9 17C10.02 17 10.96 16.69 11.75 16.17L16.29 20.71L17.7 19.3L13.16 14.76C13.68 13.97 13.99 13.02 13.99 12.01L14 12ZM9 15C7.35 15 6 13.65 6 12C6 10.35 7.35 9 9 9C10.65 9 12 10.35 12 12C12 13.65 10.65 15 9 15Z",fill:"#525252"})),C=()=>t("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",width:"24",height:"24","aria-hidden":"true"},t("path",{d:"M12 14C11.1667 14 10.4583 13.7083 9.87501 13.125C9.29168 12.5417 9.00001 11.8333 9.00001 11V5C9.00001 4.16667 9.29168 3.45833 9.87501 2.875C10.4583 2.29167 11.1667 2 12 2C12.8333 2 13.5417 2.29167 14.125 2.875C14.7083 3.45833 15 4.16667 15 5V11C15 11.8333 14.7083 12.5417 14.125 13.125C13.5417 13.7083 12.8333 14 12 14ZM11 20V17.925C9.46668 17.7083 8.15418 17.0583 7.06251 15.975C5.97085 14.8917 5.30835 13.575 5.07501 12.025C5.04168 11.7417 5.11668 11.5 5.30001 11.3C5.48335 11.1 5.71668 11 6.00001 11C6.28335 11 6.52085 11.0958 6.71251 11.2875C6.90418 11.4792 7.03335 11.7167 7.10001 12C7.33335 13.1667 7.91251 14.125 8.83751 14.875C9.76251 15.625 10.8167 16 12 16C13.2 16 14.2583 15.6208 15.175 14.8625C16.0917 14.1042 16.6667 13.15 16.9 12C16.9667 11.7167 17.0958 11.4792 17.2875 11.2875C17.4792 11.0958 17.7167 11 18 11C18.2833 11 18.5167 11.1 18.7 11.3C18.8833 11.5 18.9583 11.7417 18.925 12.025C18.6917 13.5417 18.0333 14.85 16.95 15.95C15.8667 17.05 14.55 17.7083 13 17.925V20C13 20.2833 12.9042 20.5208 12.7125 20.7125C12.5208 20.9042 12.2833 21 12 21C11.7167 21 11.4792 20.9042 11.2875 20.7125C11.0958 20.5208 11 20.2833 11 20Z",fill:"#161616"})),k=()=>{var t;const e=window,i=window.navigator,o=i.vendor,s=[void 0!==e.opr,i.userAgent.indexOf("Firefox")>-1,i.userAgent.indexOf("Edg")>-1].some((t=>!0===t)),r=void 0!==i.userAgentData?"Google Chrome"===(null===(t=i.userAgentData.brands[0])||void 0===t?void 0:t.brand):"Google Inc."===o;return{forbiddenBrowser:s,isChrome:r,isSafari:i.userAgent.indexOf("Safari")>-1&&!r}},T=class{constructor(t){e(this,t),this.vviinnImageUploadFinished=i(this,"vviinnImageUploadFinished"),this.vviinnFilterTriggered=i(this,"vviinnFilterTriggered"),this.vviinnTextSearchStarted=i(this,"vviinnTextSearchStarted"),this.widgetTextSearchFinished=i(this,"widgetTextSearchFinished"),this.vviinnSelectedFiltersReset=i(this,"vviinnSelectedFiltersReset"),this.vviinnNoResult=i(this,"vviinnNoResult"),this.vviinnRedirect=i(this,"vviinnRedirect"),this.mode="basic",this.placeholder="",this.showInWidget=!1,this.showOnFirstScreen=!1,this.isRecording=!1,this.showTooltip=!1,this.isShowPreloader=()=>"loading"===this.state.searchStatus&&"text"===this.state.searchType,this.isShowRecording=()=>this.isRecording,this.showRecording=()=>this.isRecording=!0,this.hideRecording=()=>this.isRecording=!1,this.setShowTooltip=t=>{this.showTooltip=t},this.tooltipText=(()=>{const{isSafari:t}=k();return t?"speechRecognition.tooltip.siri":"speechRecognition.tooltip.general"})(),this.getPlaceholderText=()=>this.isShowRecording()?u.t("speechRecognition.placeholder"):this.placeholder.length?this.placeholder:u.t("textSearchPlaceholder"),this.recognition=null,this.trackTextSearch=()=>this.vviinnFilterTriggered.emit({kind:this.state.textSearchQuery,action:"select",customTrigger:"TPS",isTriggeredByVpsWidget:this.showInWidget}),this.getBasicEventData=()=>this.showInWidget&&this.basicEventData?this.basicEventData:Object.assign({campaignTypeId:"TPS",campaignTypeName:c.TPS,widgetVersion:n},h("widgetId",this.el.id)),this.handleSpeech=async()=>{this.recognition&&(this.isRecording?(this.recognition.stop(),this.hideRecording(),this.setShowTooltip(!1)):(this.recognition.start(),l(this.storeName,null),this.triggerTooltipStart=setTimeout((()=>{this.isRecording||(this.setShowTooltip(!0),this.triggerTooltipEnd=setTimeout((()=>{this.setShowTooltip(!1)}),5e3))}),1e3)))},this.handleTextSearch=async()=>{const t=this.state.textSearchQuery;if(!t)return;await this.checkAutoSuggest(t),this.trackTextSearch();const e=this.state.redirect;if((null==e?void 0:e.url)&&e.query===t)this.handleTextSearchRedirect(e.url,"auto-suggest",t);else if(!this.resultsPageUrl||this.showInWidget||m(this.resultsPageUrl))this.vviinnTextSearchStarted.emit({query:t,isTriggeredByVpsWidget:this.showInWidget}),this.showInWidget&&this.showOnFirstScreen&&r.pipe(await d(this.storeName,t,this.token,this.apiPath),a((()=>{this.vviinnNoResult.emit(this.getBasicEventData())}),(e=>{this.widgetTextSearchFinished.emit({query:t,requestId:e.requestId}),this.vviinnSelectedFiltersReset.emit({isTriggeredByVpsWidget:this.showInWidget})})));else{const e=y(this.resultsPageUrl,t);this.handleTextSearchRedirect(e,"text-search",t)}},this.checkAutoSuggest=async t=>{r.pipe(await p(this.storeName,t,this.token,this.apiPath),a((()=>{}),(()=>{})))},this.handleButtonKeyDown=(t,e)=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),e())}}connectedCallback(){const{state:t,storeName:e}=f(this.showInWidget);this.state=t,this.storeName=e}disconnectedCallback(){clearTimeout(this.triggerTooltipStart),clearTimeout(this.triggerTooltipEnd)}async componentWillLoad(){var t,e,i;await v(this.locale),g(this,this.el),this.recognition=((t,e,i,o)=>{const s=(()=>{const t=window,e=t.webkitSpeechRecognition||t.SpeechRecognition;if(!e)return;const{forbiddenBrowser:i,isChrome:o,isSafari:s}=k();return i?void 0:o||s?e:void 0})();if(!s)return;const r=new s;let a;return r.interimResults=!1,r.maxAlternatives=1,r.continuous=!1,r.lang=t,r.onstart=()=>{e(),a=setTimeout((()=>{r.stop()}),1e4)},r.onspeechend=()=>{r.stop(),i(),clearTimeout(a)},r.onend=i,r.onresult=t=>{o(t.results[0][0].transcript)},r})(null!==(t=this.locale)&&void 0!==t?t:x.locale,(()=>{this.showRecording(),this.setShowTooltip(!1),clearTimeout(this.triggerTooltipStart)}),this.hideRecording,(t=>{l(this.storeName,t),this.handleTextSearch()})),(null===(e=this.searchQuery)||void 0===e?void 0:e.length)>0&&l(this.storeName,this.searchQuery),!this.showInWidget&&(null===(i=this.searchQuery)||void 0===i?void 0:i.length)>0&&(this.vviinnTextSearchStarted.emit({query:this.searchQuery,isTriggeredByVpsWidget:this.showInWidget}),this.trackTextSearch())}handleInputChange(t){l(this.storeName,t.target.value)}handleKeyPress(t){"Enter"===t.key&&this.handleTextSearch()}handleTextSearchRedirect(t,e,i){const o=Object.assign(Object.assign({},this.getBasicEventData()),{url:t,source:e,query:i});this.vviinnRedirect.emit(o).defaultPrevented?this.state.redirect=null:window.location.href=t}render(){return t(o,{key:"925f686141e91d79f50c6f50fc01f269fa9794ea",exportparts:b},t("div",{key:"f8366e365052d169ee3ee9599537d6698a550218",class:"text-search-container",part:"text-search-container"},t("input",{key:"0fd7f448a977b1c9d07efb1d88e428ea7d6ed76c",class:"text-search-input",part:"text-search-input",type:"text",placeholder:this.getPlaceholderText(),value:this.state.textSearchQuery||"",onInput:t=>this.handleInputChange(t),onKeyUp:t=>this.handleKeyPress(t)}),"extended"===this.mode&&t("vviinn-vps-button",{key:"5a2b19817a9c0a06f8abc958fbfe43497558fe63",token:this.token,locale:this.locale,apiPath:this.apiPath,addStyle:!1,showResultsInModal:!1,resultsPageUrl:this.resultsPageUrl,exportparts:"vviinn-button"}),"basic"===this.mode&&t("slot",{key:"e635be79c1b2a9a239fb343155f9139ce9bc7007",name:"vviinn-text-search-actions"}),("extended"===this.mode||this.showInWidget)&&this.recognition&&t("button",{key:"f75dd90d5ffc0a6427ce6484b03f35837732bc42",class:"speech-button",part:"speech-button","aria-label":u.t("a11y.speechButton"),onClick:this.handleSpeech,onKeyDown:t=>this.handleButtonKeyDown(t,this.handleSpeech)},t(C,{key:"302080bbb0c525e4fa34a76573f58ba0280fa6d6"}),this.isShowRecording()&&t("span",{key:"384e2cc0c93e41351da1448456d3a8364273a4a3",class:"recording-indicator"})),t("button",{key:"5f5401aae46c66d4ac668eec41bb97dbe3d7942a",class:"text-search-button",part:"text-search-button",onClick:this.handleTextSearch,onKeyDown:t=>this.handleButtonKeyDown(t,this.handleTextSearch),disabled:"loading"===this.state.searchStatus,"aria-label":u.t("a11y.textSearchButton")},this.isShowPreloader()?t("vviinn-preloader",null):t("slot",{name:"vviinn-text-search-icon"},t(w,null)))),this.showTooltip&&t("p",{key:"1293f7a7f5f4c3315cfe3aa71712f368c58adb63",class:"text-search-tooltip",part:"text-search-tooltip"},u.t(this.tooltipText)))}get el(){return s(this)}};T.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-display:32px;--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-display:40px;--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;--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;--surface-bg-color-shadow-01:#dddddd;--surface-bg-color-shadow-02:#c6c6c6;--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-default:0.5s;--search-modal-animation-duration-default:0.25s;--search-modal-animation-duration-mobile-default:0.35s;}:host{display:block;position:relative;width:100%;}.text-search-container{display:flex;align-items:center;gap:var(--spacing-50);width:100%;height:46px;border:1px solid var(--color-border-02);border-radius:8px;transition:border-color 0.2s;overflow:hidden;box-sizing:border-box}.text-search-container:focus-within{border-color:#8d8d8d}.text-search-input,.text-search-tooltip{font-size:16px;font-style:normal;font-weight:400;font-family:var(--font-family, var(--font-family-base))}.text-search-input{height:100%;padding-left:16px;box-sizing:border-box;border:none;outline:none;overflow:hidden;text-overflow:ellipsis;flex-grow:2;width:150px}.text-search-input::-moz-placeholder{color:#a8a8a8}.text-search-input::placeholder{color:#a8a8a8}.text-search-input:focus,.text-search-input:active{border-color:#8d8d8d}vviinn-vps-button{height:100%}.text-search-button,.speech-button,vviinn-vps-button::part(vviinn-button){border:none;height:100%;display:flex;justify-content:center;align-items:center;cursor:pointer}.speech-button,vviinn-vps-button::part(vviinn-button){padding:0 8px}.upload-button-text{display:contents}.text-search-button{background-color:#f4f4f4;transition:background-color 0.2s;aspect-ratio:1 / 1;border-radius:0 7px 7px 0}.speech-button{background-color:transparent;position:relative}@keyframes recordingSpeech{0%{background-color:#ff0000;scale:1}100%{background-color:#ff8888;scale:1.5}}.recording-indicator{border-radius:50%;width:8px;height:8px;left:24px;top:24px;background-color:#ff0000;position:absolute;animation:recordingSpeech 1s infinite alternate ease-in-out}@keyframes fade-out{0%{opacity:0}20%{opacity:1}80%{opacity:1}100%{opacity:0;display:none}}.text-search-tooltip{position:absolute;right:0;top:80%;background:#f4f4f4;animation:fade-out 5s forwards;width:-moz-fit-content;width:fit-content;padding:24px;border-radius:8px;border:1px solid #8d8d8d;box-sizing:border-box}.text-search-button:not(:disabled):hover{background-color:#e0e0e0}.text-search-button:disabled{cursor:unset}vviinn-image-selector,::slotted([slot="vviinn-text-search-actions"]){margin:auto 8px}vviinn-preloader{--preloader-size:16px;display:flex;color:#525252}';export{T as vviinn_text_search}
|
|
1
|
+
import{h as t,r as e,c as i,H as o,g as s}from"./p-C5qrIvmr.js";import{_ as r,f as a}from"./p-CrEgr0jU.js";import{v as n,c,a as h,s as l,m as d,b as p,u as f,d as b}from"./p-C3fQHoXf.js";import{s as g}from"./p-COO7WxAu.js";import{i as u,d as x}from"./p-BJxQCbNV.js";import{i as v}from"./p-DDpGHPMT.js";import{i as m,b as y}from"./p-niHq9WT6.js";const w=()=>t("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t("path",{d:"M20.6 4.57C17.39 4.19 16.88 3.68 16.42 0.37C16.38 0.15 16.22 0 16.01 0C15.8 0 15.63 0.15 15.59 0.37C15.12 3.66 14.63 4.13 11.41 4.57C11.17 4.61 11.01 4.77 11.01 5C11.01 5.23 11.17 5.39 11.41 5.42C14.63 5.81 15.14 6.31 15.59 9.62C15.63 9.84 15.8 10 16.01 10C16.22 10 16.39 9.84 16.42 9.62C16.89 6.31 17.39 5.81 20.6 5.42C20.84 5.38 21 5.22 21 5C21 4.78 20.83 4.6 20.6 4.57Z",fill:"#525252"}),t("path",{d:"M14 12C14 9.24 11.76 7 9 7C6.24 7 4 9.24 4 12C4 14.76 6.24 17 9 17C10.02 17 10.96 16.69 11.75 16.17L16.29 20.71L17.7 19.3L13.16 14.76C13.68 13.97 13.99 13.02 13.99 12.01L14 12ZM9 15C7.35 15 6 13.65 6 12C6 10.35 7.35 9 9 9C10.65 9 12 10.35 12 12C12 13.65 10.65 15 9 15Z",fill:"#525252"})),C=()=>t("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",width:"24",height:"24","aria-hidden":"true"},t("path",{d:"M12 14C11.1667 14 10.4583 13.7083 9.87501 13.125C9.29168 12.5417 9.00001 11.8333 9.00001 11V5C9.00001 4.16667 9.29168 3.45833 9.87501 2.875C10.4583 2.29167 11.1667 2 12 2C12.8333 2 13.5417 2.29167 14.125 2.875C14.7083 3.45833 15 4.16667 15 5V11C15 11.8333 14.7083 12.5417 14.125 13.125C13.5417 13.7083 12.8333 14 12 14ZM11 20V17.925C9.46668 17.7083 8.15418 17.0583 7.06251 15.975C5.97085 14.8917 5.30835 13.575 5.07501 12.025C5.04168 11.7417 5.11668 11.5 5.30001 11.3C5.48335 11.1 5.71668 11 6.00001 11C6.28335 11 6.52085 11.0958 6.71251 11.2875C6.90418 11.4792 7.03335 11.7167 7.10001 12C7.33335 13.1667 7.91251 14.125 8.83751 14.875C9.76251 15.625 10.8167 16 12 16C13.2 16 14.2583 15.6208 15.175 14.8625C16.0917 14.1042 16.6667 13.15 16.9 12C16.9667 11.7167 17.0958 11.4792 17.2875 11.2875C17.4792 11.0958 17.7167 11 18 11C18.2833 11 18.5167 11.1 18.7 11.3C18.8833 11.5 18.9583 11.7417 18.925 12.025C18.6917 13.5417 18.0333 14.85 16.95 15.95C15.8667 17.05 14.55 17.7083 13 17.925V20C13 20.2833 12.9042 20.5208 12.7125 20.7125C12.5208 20.9042 12.2833 21 12 21C11.7167 21 11.4792 20.9042 11.2875 20.7125C11.0958 20.5208 11 20.2833 11 20Z",fill:"#161616"})),k=()=>{var t;const e=window,i=window.navigator,o=i.vendor,s=[void 0!==e.opr,i.userAgent.indexOf("Firefox")>-1,i.userAgent.indexOf("Edg")>-1].some((t=>!0===t)),r=void 0!==i.userAgentData?"Google Chrome"===(null===(t=i.userAgentData.brands[0])||void 0===t?void 0:t.brand):"Google Inc."===o;return{forbiddenBrowser:s,isChrome:r,isSafari:i.userAgent.indexOf("Safari")>-1&&!r}},T=class{constructor(t){e(this,t),this.vviinnImageUploadFinished=i(this,"vviinnImageUploadFinished"),this.vviinnFilterTriggered=i(this,"vviinnFilterTriggered"),this.vviinnTextSearchStarted=i(this,"vviinnTextSearchStarted"),this.widgetTextSearchFinished=i(this,"widgetTextSearchFinished"),this.vviinnSelectedFiltersReset=i(this,"vviinnSelectedFiltersReset"),this.vviinnNoResult=i(this,"vviinnNoResult"),this.vviinnRedirect=i(this,"vviinnRedirect"),this.mode="basic",this.placeholder="",this.showInWidget=!1,this.showOnFirstScreen=!1,this.isRecording=!1,this.showTooltip=!1,this.isShowPreloader=()=>"loading"===this.state.searchStatus&&"text"===this.state.searchType,this.isShowRecording=()=>this.isRecording,this.showRecording=()=>this.isRecording=!0,this.hideRecording=()=>this.isRecording=!1,this.setShowTooltip=t=>{this.showTooltip=t},this.tooltipText=(()=>{const{isSafari:t}=k();return t?"speechRecognition.tooltip.siri":"speechRecognition.tooltip.general"})(),this.getPlaceholderText=()=>this.isShowRecording()?u.t("speechRecognition.placeholder"):this.placeholder.length?this.placeholder:u.t("textSearchPlaceholder"),this.recognition=null,this.trackTextSearch=()=>this.vviinnFilterTriggered.emit({kind:this.state.textSearchQuery,action:"select",customTrigger:"TPS",isTriggeredByVpsWidget:this.showInWidget}),this.getBasicEventData=()=>this.showInWidget&&this.basicEventData?this.basicEventData:Object.assign({campaignTypeId:"TPS",campaignTypeName:c.TPS,widgetVersion:n},h("widgetId",this.el.id)),this.handleSpeech=async()=>{this.recognition&&(this.isRecording?(this.recognition.stop(),this.hideRecording(),this.setShowTooltip(!1)):(this.recognition.start(),l(this.storeName,null),this.triggerTooltipStart=setTimeout((()=>{this.isRecording||(this.setShowTooltip(!0),this.triggerTooltipEnd=setTimeout((()=>{this.setShowTooltip(!1)}),5e3))}),1e3)))},this.handleTextSearch=async()=>{const t=this.state.textSearchQuery;if(!t)return;await this.checkAutoSuggest(t),this.trackTextSearch();const e=this.state.redirect;if((null==e?void 0:e.url)&&e.query===t)this.handleTextSearchRedirect(e.url,"auto-suggest",t);else if(!this.resultsPageUrl||this.showInWidget||m(this.resultsPageUrl))this.vviinnTextSearchStarted.emit({query:t,isTriggeredByVpsWidget:this.showInWidget}),this.showInWidget&&this.showOnFirstScreen&&r.pipe(await d(this.storeName,t,this.token,this.apiPath),a((()=>{this.vviinnNoResult.emit(this.getBasicEventData())}),(e=>{this.widgetTextSearchFinished.emit({query:t,requestId:e.requestId}),this.vviinnSelectedFiltersReset.emit({isTriggeredByVpsWidget:this.showInWidget})})));else{const e=y(this.resultsPageUrl,t);this.handleTextSearchRedirect(e,"text-search",t)}},this.checkAutoSuggest=async t=>{r.pipe(await p(this.storeName,t,this.token,this.apiPath),a((()=>{}),(()=>{})))},this.handleButtonKeyDown=(t,e)=>{"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),e())}}connectedCallback(){const{state:t,storeName:e}=f(this.showInWidget);this.state=t,this.storeName=e}disconnectedCallback(){clearTimeout(this.triggerTooltipStart),clearTimeout(this.triggerTooltipEnd)}async componentWillLoad(){var t,e,i;await v(this.locale),g(this,this.el),this.recognition=((t,e,i,o)=>{const s=(()=>{const t=window,e=t.webkitSpeechRecognition||t.SpeechRecognition;if(!e)return;const{forbiddenBrowser:i,isChrome:o,isSafari:s}=k();return i?void 0:o||s?e:void 0})();if(!s)return;const r=new s;let a;return r.interimResults=!1,r.maxAlternatives=1,r.continuous=!1,r.lang=t,r.onstart=()=>{e(),a=setTimeout((()=>{r.stop()}),1e4)},r.onspeechend=()=>{r.stop(),i(),clearTimeout(a)},r.onend=i,r.onresult=t=>{o(t.results[0][0].transcript)},r})(null!==(t=this.locale)&&void 0!==t?t:x.locale,(()=>{this.showRecording(),this.setShowTooltip(!1),clearTimeout(this.triggerTooltipStart)}),this.hideRecording,(t=>{l(this.storeName,t),this.handleTextSearch()})),(null===(e=this.searchQuery)||void 0===e?void 0:e.length)>0&&l(this.storeName,this.searchQuery),!this.showInWidget&&(null===(i=this.searchQuery)||void 0===i?void 0:i.length)>0&&(this.vviinnTextSearchStarted.emit({query:this.searchQuery,isTriggeredByVpsWidget:this.showInWidget}),this.trackTextSearch())}handleInputChange(t){l(this.storeName,t.target.value)}handleKeyPress(t){"Enter"===t.key&&this.handleTextSearch()}handleTextSearchRedirect(t,e,i){const o=Object.assign(Object.assign({},this.getBasicEventData()),{url:t,source:e,query:i});this.vviinnRedirect.emit(o).defaultPrevented?this.state.redirect=null:window.location.href=t}render(){return t(o,{key:"925f686141e91d79f50c6f50fc01f269fa9794ea",exportparts:b},t("div",{key:"f8366e365052d169ee3ee9599537d6698a550218",class:"text-search-container",part:"text-search-container"},t("input",{key:"0fd7f448a977b1c9d07efb1d88e428ea7d6ed76c",class:"text-search-input",part:"text-search-input",type:"text",placeholder:this.getPlaceholderText(),value:this.state.textSearchQuery||"",onInput:t=>this.handleInputChange(t),onKeyUp:t=>this.handleKeyPress(t)}),"extended"===this.mode&&t("vviinn-vps-button",{key:"5a2b19817a9c0a06f8abc958fbfe43497558fe63",token:this.token,locale:this.locale,apiPath:this.apiPath,addStyle:!1,showResultsInModal:!1,resultsPageUrl:this.resultsPageUrl,exportparts:"vviinn-button"}),"basic"===this.mode&&t("slot",{key:"e635be79c1b2a9a239fb343155f9139ce9bc7007",name:"vviinn-text-search-actions"}),("extended"===this.mode||this.showInWidget)&&this.recognition&&t("button",{key:"f75dd90d5ffc0a6427ce6484b03f35837732bc42",class:"speech-button",part:"speech-button","aria-label":u.t("a11y.speechButton"),onClick:this.handleSpeech,onKeyDown:t=>this.handleButtonKeyDown(t,this.handleSpeech)},t(C,{key:"302080bbb0c525e4fa34a76573f58ba0280fa6d6"}),this.isShowRecording()&&t("span",{key:"384e2cc0c93e41351da1448456d3a8364273a4a3",class:"recording-indicator"})),t("button",{key:"5f5401aae46c66d4ac668eec41bb97dbe3d7942a",class:"text-search-button",part:"text-search-button",onClick:this.handleTextSearch,onKeyDown:t=>this.handleButtonKeyDown(t,this.handleTextSearch),disabled:"loading"===this.state.searchStatus,"aria-label":u.t("a11y.textSearchButton")},this.isShowPreloader()?t("vviinn-preloader",null):t("slot",{name:"vviinn-text-search-icon"},t(w,null)))),this.showTooltip&&t("p",{key:"1293f7a7f5f4c3315cfe3aa71712f368c58adb63",class:"text-search-tooltip",part:"text-search-tooltip"},u.t(this.tooltipText)))}get el(){return s(this)}};T.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-display:32px;--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-display:40px;--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;--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;--surface-bg-color-shadow-01:#dddddd;--surface-bg-color-shadow-02:#c6c6c6;--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-default:0.5s;--search-modal-animation-duration-default:0.25s;--search-modal-animation-duration-mobile-default:0.35s;}:host{display:block;position:relative;width:100%;}.text-search-container{display:flex;align-items:center;gap:var(--spacing-50);width:100%;height:46px;border:1px solid var(--color-border-02);border-radius:8px;transition:border-color 0.2s;overflow:hidden;box-sizing:border-box}.text-search-container:focus-within{border-color:#8d8d8d}.text-search-input,.text-search-tooltip{font-size:16px;font-style:normal;font-weight:400;font-family:var(--font-family, var(--font-family-base))}.text-search-input{height:100%;padding-left:16px;box-sizing:border-box;border:none;outline:none;overflow:hidden;text-overflow:ellipsis;flex-grow:2;width:150px}.text-search-input::-moz-placeholder{color:#a8a8a8}.text-search-input::placeholder{color:#a8a8a8}.text-search-input:focus,.text-search-input:active{border-color:#8d8d8d}vviinn-vps-button{height:100%}.text-search-button,.speech-button,vviinn-vps-button::part(vviinn-button){border:none;height:100%;display:flex;justify-content:center;align-items:center;cursor:pointer}.speech-button,vviinn-vps-button::part(vviinn-button){padding:0 8px}.upload-button-text{display:contents}.text-search-button{background-color:#f4f4f4;transition:background-color 0.2s;aspect-ratio:1 / 1;border-radius:0 7px 7px 0}.speech-button{background-color:transparent;position:relative}@keyframes recordingSpeech{0%{background-color:#ff0000;scale:1}100%{background-color:#ff8888;scale:1.5}}.recording-indicator{border-radius:50%;width:8px;height:8px;left:24px;top:24px;background-color:#ff0000;position:absolute;animation:recordingSpeech 1s infinite alternate ease-in-out}@keyframes fade-out{0%{opacity:0}20%{opacity:1}80%{opacity:1}100%{opacity:0;display:none}}.text-search-tooltip{position:absolute;right:0;top:80%;background:#f4f4f4;animation:fade-out 5s forwards;width:-moz-fit-content;width:fit-content;padding:24px;border-radius:8px;border:1px solid #8d8d8d;box-sizing:border-box}.text-search-button:not(:disabled):hover{background-color:#e0e0e0}.text-search-button:disabled{cursor:unset}vviinn-image-selector,::slotted([slot="vviinn-text-search-actions"]){margin:auto 8px}vviinn-preloader{--preloader-size:16px;display:flex;color:#525252}';export{T as vviinn_text_search}
|