vviinn-widgets 2.72.0 → 2.72.1
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/{package-64700f59.js → package-afaf1d60.js} +1 -1
- package/dist/cjs/search-filters_18.cjs.entry.js +1 -1
- package/dist/cjs/vviinn-carousel_7.cjs.entry.js +5 -3
- package/dist/cjs/vviinn-vpr-button.cjs.entry.js +1 -1
- package/dist/cjs/vviinn-vps-button.cjs.entry.js +1 -1
- package/dist/cjs/vviinn-vps-widget.cjs.entry.js +1 -1
- package/dist/collection/components/vviinn-filters/vviinn-extended-filters.js +3 -1
- package/dist/collection/components/vviinn-filters/vviinn-filters.js +1 -1
- package/dist/esm/{package-72d02c8d.js → package-b85f9cc8.js} +1 -1
- package/dist/esm/search-filters_18.entry.js +1 -1
- package/dist/esm/vviinn-carousel_7.entry.js +5 -3
- package/dist/esm/vviinn-vpr-button.entry.js +1 -1
- package/dist/esm/vviinn-vps-button.entry.js +1 -1
- package/dist/esm/vviinn-vps-widget.entry.js +1 -1
- package/dist/types/interfaces/generated.d.ts +0 -3
- package/dist/vviinn-widgets/{p-8d8ff607.entry.js → p-019dd392.entry.js} +1 -1
- package/{www/build/p-6e975b12.entry.js → dist/vviinn-widgets/p-232449b4.entry.js} +1 -1
- package/dist/vviinn-widgets/p-685b9114.js +1 -0
- package/dist/vviinn-widgets/{p-735b3b3d.entry.js → p-7cdf4df0.entry.js} +1 -1
- package/{www/build/p-237a604f.entry.js → dist/vviinn-widgets/p-b3526785.entry.js} +1 -1
- package/dist/vviinn-widgets/p-f046e31c.entry.js +1 -0
- package/dist/vviinn-widgets/vviinn-widgets.esm.js +1 -1
- package/package.json +1 -1
- package/www/build/{p-8d8ff607.entry.js → p-019dd392.entry.js} +1 -1
- package/{dist/vviinn-widgets/p-6e975b12.entry.js → www/build/p-232449b4.entry.js} +1 -1
- package/www/build/p-685b9114.js +1 -0
- package/www/build/{p-735b3b3d.entry.js → p-7cdf4df0.entry.js} +1 -1
- package/{dist/vviinn-widgets/p-237a604f.entry.js → www/build/p-b3526785.entry.js} +1 -1
- package/www/build/p-f046e31c.entry.js +1 -0
- package/www/build/vviinn-widgets.esm.js +1 -1
- package/dist/vviinn-widgets/p-931e39b2.js +0 -1
- package/dist/vviinn-widgets/p-ad7c1b34.entry.js +0 -1
- package/www/build/p-931e39b2.js +0 -1
- package/www/build/p-ad7c1b34.entry.js +0 -1
|
@@ -7,7 +7,7 @@ const search_store = require('./search.store-9404d56a.js');
|
|
|
7
7
|
const index$1 = require('./index-6c94ecb5.js');
|
|
8
8
|
const customizedSlots = require('./customized-slots-dacb282b.js');
|
|
9
9
|
const PlusIcon = require('./PlusIcon-835a5dcc.js');
|
|
10
|
-
const _package = require('./package-
|
|
10
|
+
const _package = require('./package-afaf1d60.js');
|
|
11
11
|
const CameraIcon = require('./CameraIcon-5b8efacb.js');
|
|
12
12
|
|
|
13
13
|
const ArrowIcon = () => (index.h("svg", { width: "12", height: "20", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
@@ -7,7 +7,7 @@ const search_store = require('./search.store-9404d56a.js');
|
|
|
7
7
|
const customizedSlots = require('./customized-slots-dacb282b.js');
|
|
8
8
|
const index$1 = require('./index-6c94ecb5.js');
|
|
9
9
|
const PlusIcon = require('./PlusIcon-835a5dcc.js');
|
|
10
|
-
const _package = require('./package-
|
|
10
|
+
const _package = require('./package-afaf1d60.js');
|
|
11
11
|
|
|
12
12
|
const BasketIcon = () => (index.h("svg", { width: "25", height: "24", viewBox: "0 0 25 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
13
13
|
index.h("path", { d: "M7.5 22C6.95 22 6.47917 21.8042 6.0875 21.4125C5.69583 21.0208 5.5 20.55 5.5 20C5.5 19.45 5.69583 18.9792 6.0875 18.5875C6.47917 18.1958 6.95 18 7.5 18C8.05 18 8.52083 18.1958 8.9125 18.5875C9.30417 18.9792 9.5 19.45 9.5 20C9.5 20.55 9.30417 21.0208 8.9125 21.4125C8.52083 21.8042 8.05 22 7.5 22ZM17.5 22C16.95 22 16.4792 21.8042 16.0875 21.4125C15.6958 21.0208 15.5 20.55 15.5 20C15.5 19.45 15.6958 18.9792 16.0875 18.5875C16.4792 18.1958 16.95 18 17.5 18C18.05 18 18.5208 18.1958 18.9125 18.5875C19.3042 18.9792 19.5 19.45 19.5 20C19.5 20.55 19.3042 21.0208 18.9125 21.4125C18.5208 21.8042 18.05 22 17.5 22ZM6.65 6L9.05 11H16.05L18.8 6H6.65ZM5.7 4H20.45C20.8333 4 21.125 4.17083 21.325 4.5125C21.525 4.85417 21.5333 5.2 21.35 5.55L17.8 11.95C17.6167 12.2833 17.3708 12.5417 17.0625 12.725C16.7542 12.9083 16.4167 13 16.05 13H8.6L7.5 15H18.5C18.7833 15 19.0208 15.0958 19.2125 15.2875C19.4042 15.4792 19.5 15.7167 19.5 16C19.5 16.2833 19.4042 16.5208 19.2125 16.7125C19.0208 16.9042 18.7833 17 18.5 17H7.5C6.75 17 6.18333 16.6708 5.8 16.0125C5.41667 15.3542 5.4 14.7 5.75 14.05L7.1 11.6L3.5 4H2.5C2.21667 4 1.97917 3.90417 1.7875 3.7125C1.59583 3.52083 1.5 3.28333 1.5 3C1.5 2.71667 1.59583 2.47917 1.7875 2.2875C1.97917 2.09583 2.21667 2 2.5 2H4.125C4.30833 2 4.48333 2.05 4.65 2.15C4.81667 2.25 4.94167 2.39167 5.025 2.575L5.7 4Z", fill: "#525252" })));
|
|
@@ -587,7 +587,9 @@ const VviinnExtendedFilters = class {
|
|
|
587
587
|
return (index.h(index.Host, { part: "filters" }, customizedSlots.SlotSkeleton("filters"), this.filters.length > 0 && (index.h("button", { class: "filters-more-button", onClick: () => (this.showMore = true) }, index.h(FiltersIcon, null))), index.h("div", { class: `filters-modal ${this.showMore ? "open" : ""}` }, index.h("div", { class: "filters-modal-wrapper" }, index.h("div", { class: "filters-modal-header" }, index.h("slot", { name: "vviinn-extended-filters-title" }, index.h("span", null, index$1.instance.t("filters.modal.title"))), moreFiltersOptionCount > 0 ? `(${moreFiltersOptionCount})` : "", index.h("button", { class: "filters-modal-close", onClick: () => {
|
|
588
588
|
this.showMore = false;
|
|
589
589
|
this.requestFilters = [];
|
|
590
|
-
} }, index.h(NewCloseIcon, null))), index.h("ul", { class: "filters-modal-list" }, this.filters
|
|
590
|
+
} }, index.h(NewCloseIcon, null))), index.h("ul", { class: "filters-modal-list" }, this.filters
|
|
591
|
+
.filter((filter) => filter.column !== "color")
|
|
592
|
+
.map((mainFilter) => {
|
|
591
593
|
const column = mainFilter.column;
|
|
592
594
|
const filterOptions = getFilterOptions(mainFilter);
|
|
593
595
|
return (index.h("li", null, index.h("button", { onClick: () => this.handleMoreOptionsMainClick(mainFilter.column), class: "filters-modal-main-button" }, mainFilter.label, filterOptions.length > 0
|
|
@@ -694,7 +696,7 @@ const VviinnFilters = class {
|
|
|
694
696
|
var _a;
|
|
695
697
|
const { column } = (_a = this.selectedFilter) !== null && _a !== void 0 ? _a : {};
|
|
696
698
|
const selectedFilterOptions = getFilterOptions(this.selectedFilter);
|
|
697
|
-
const filters = this.filters.filter((filter) => filter.isPrimary);
|
|
699
|
+
const filters = this.filters.filter((filter) => filter.isPrimary && filter.column !== "color");
|
|
698
700
|
if (filters.length === 0)
|
|
699
701
|
return index.h(index.Host, null);
|
|
700
702
|
return (index.h(index.Host, { part: "filters" }, index.h("div", { class: "main-filters-wrapper" }, index.h("ul", { class: "main-filters-list" }, filters.map((filter) => {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-4474431a.js');
|
|
6
|
-
const _package = require('./package-
|
|
6
|
+
const _package = require('./package-afaf1d60.js');
|
|
7
7
|
const VisualSearchIcon = require('./VisualSearchIcon-f435f5b0.js');
|
|
8
8
|
|
|
9
9
|
const vviinnVprButtonCss = ":host{display:block}";
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-4474431a.js');
|
|
6
|
-
const _package = require('./package-
|
|
6
|
+
const _package = require('./package-afaf1d60.js');
|
|
7
7
|
const CameraIcon = require('./CameraIcon-5b8efacb.js');
|
|
8
8
|
const customizedSlots = require('./customized-slots-dacb282b.js');
|
|
9
9
|
const constants = require('./constants-7684cbfc.js');
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
const index = require('./index-4474431a.js');
|
|
6
6
|
const search_store = require('./search.store-9404d56a.js');
|
|
7
7
|
const index$1 = require('./index-6c94ecb5.js');
|
|
8
|
-
const _package = require('./package-
|
|
8
|
+
const _package = require('./package-afaf1d60.js');
|
|
9
9
|
const customizedSlots = require('./customized-slots-dacb282b.js');
|
|
10
10
|
const constants = require('./constants-7684cbfc.js');
|
|
11
11
|
|
|
@@ -112,7 +112,9 @@ export class VviinnExtendedFilters {
|
|
|
112
112
|
return (h(Host, { part: "filters" }, SlotSkeleton("filters"), this.filters.length > 0 && (h("button", { class: "filters-more-button", onClick: () => (this.showMore = true) }, h(FiltersIcon, null))), h("div", { class: `filters-modal ${this.showMore ? "open" : ""}` }, h("div", { class: "filters-modal-wrapper" }, h("div", { class: "filters-modal-header" }, h("slot", { name: "vviinn-extended-filters-title" }, h("span", null, i18next.t("filters.modal.title"))), moreFiltersOptionCount > 0 ? `(${moreFiltersOptionCount})` : "", h("button", { class: "filters-modal-close", onClick: () => {
|
|
113
113
|
this.showMore = false;
|
|
114
114
|
this.requestFilters = [];
|
|
115
|
-
} }, h(NewCloseIcon, null))), h("ul", { class: "filters-modal-list" }, this.filters
|
|
115
|
+
} }, h(NewCloseIcon, null))), h("ul", { class: "filters-modal-list" }, this.filters
|
|
116
|
+
.filter((filter) => filter.column !== "color")
|
|
117
|
+
.map((mainFilter) => {
|
|
116
118
|
const column = mainFilter.column;
|
|
117
119
|
const filterOptions = getFilterOptions(mainFilter);
|
|
118
120
|
return (h("li", null, h("button", { onClick: () => this.handleMoreOptionsMainClick(mainFilter.column), class: "filters-modal-main-button" }, mainFilter.label, filterOptions.length > 0
|
|
@@ -80,7 +80,7 @@ export class VviinnFilters {
|
|
|
80
80
|
var _a;
|
|
81
81
|
const { column } = (_a = this.selectedFilter) !== null && _a !== void 0 ? _a : {};
|
|
82
82
|
const selectedFilterOptions = getFilterOptions(this.selectedFilter);
|
|
83
|
-
const filters = this.filters.filter((filter) => filter.isPrimary);
|
|
83
|
+
const filters = this.filters.filter((filter) => filter.isPrimary && filter.column !== "color");
|
|
84
84
|
if (filters.length === 0)
|
|
85
85
|
return h(Host, null);
|
|
86
86
|
return (h(Host, { part: "filters" }, h("div", { class: "main-filters-wrapper" }, h("ul", { class: "main-filters-list" }, filters.map((filter) => {
|
|
@@ -3,7 +3,7 @@ import { s as searchState, _ as _function, O as Option, l as fromAlt, n as foldV
|
|
|
3
3
|
import { i as instance, c as createTrackingApi, v as v4, n as createResultVpsEventByType, o as createProductVpsEventByType, r as resources } from './index-ae9090ed.js';
|
|
4
4
|
import { s as slotChangeListener, c as campaignTypeNames } from './customized-slots-299054d1.js';
|
|
5
5
|
import { P as PlusIcon } from './PlusIcon-8f8206c3.js';
|
|
6
|
-
import { v as version } from './package-
|
|
6
|
+
import { v as version } from './package-b85f9cc8.js';
|
|
7
7
|
import { C as CameraIcon } from './CameraIcon-785208d2.js';
|
|
8
8
|
|
|
9
9
|
const ArrowIcon = () => (h("svg", { width: "12", height: "20", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
@@ -3,7 +3,7 @@ import { h as has, t as tuple, s as searchState, _ as _function, a as _Array, O
|
|
|
3
3
|
import { c as campaignTypeNames, s as slotChangeListener, S as SlotSkeleton, f as fromString, a as fold } from './customized-slots-299054d1.js';
|
|
4
4
|
import { i as instance, r as resources, v as v4, c as createTrackingApi, a as createAddToBasketVpcEvent, b as createAddToBasketVprEvent, d as createWidgetVpcEvent, e as createWidgetVprEvent, f as createResultVpcEventByType, g as createResultVprEventByType, h as createProductVpcEventByType, j as createProductVprEventByType } from './index-ae9090ed.js';
|
|
5
5
|
import { P as PlusIcon } from './PlusIcon-8f8206c3.js';
|
|
6
|
-
import { v as version } from './package-
|
|
6
|
+
import { v as version } from './package-b85f9cc8.js';
|
|
7
7
|
|
|
8
8
|
const BasketIcon = () => (h("svg", { width: "25", height: "24", viewBox: "0 0 25 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
9
9
|
h("path", { d: "M7.5 22C6.95 22 6.47917 21.8042 6.0875 21.4125C5.69583 21.0208 5.5 20.55 5.5 20C5.5 19.45 5.69583 18.9792 6.0875 18.5875C6.47917 18.1958 6.95 18 7.5 18C8.05 18 8.52083 18.1958 8.9125 18.5875C9.30417 18.9792 9.5 19.45 9.5 20C9.5 20.55 9.30417 21.0208 8.9125 21.4125C8.52083 21.8042 8.05 22 7.5 22ZM17.5 22C16.95 22 16.4792 21.8042 16.0875 21.4125C15.6958 21.0208 15.5 20.55 15.5 20C15.5 19.45 15.6958 18.9792 16.0875 18.5875C16.4792 18.1958 16.95 18 17.5 18C18.05 18 18.5208 18.1958 18.9125 18.5875C19.3042 18.9792 19.5 19.45 19.5 20C19.5 20.55 19.3042 21.0208 18.9125 21.4125C18.5208 21.8042 18.05 22 17.5 22ZM6.65 6L9.05 11H16.05L18.8 6H6.65ZM5.7 4H20.45C20.8333 4 21.125 4.17083 21.325 4.5125C21.525 4.85417 21.5333 5.2 21.35 5.55L17.8 11.95C17.6167 12.2833 17.3708 12.5417 17.0625 12.725C16.7542 12.9083 16.4167 13 16.05 13H8.6L7.5 15H18.5C18.7833 15 19.0208 15.0958 19.2125 15.2875C19.4042 15.4792 19.5 15.7167 19.5 16C19.5 16.2833 19.4042 16.5208 19.2125 16.7125C19.0208 16.9042 18.7833 17 18.5 17H7.5C6.75 17 6.18333 16.6708 5.8 16.0125C5.41667 15.3542 5.4 14.7 5.75 14.05L7.1 11.6L3.5 4H2.5C2.21667 4 1.97917 3.90417 1.7875 3.7125C1.59583 3.52083 1.5 3.28333 1.5 3C1.5 2.71667 1.59583 2.47917 1.7875 2.2875C1.97917 2.09583 2.21667 2 2.5 2H4.125C4.30833 2 4.48333 2.05 4.65 2.15C4.81667 2.25 4.94167 2.39167 5.025 2.575L5.7 4Z", fill: "#525252" })));
|
|
@@ -583,7 +583,9 @@ const VviinnExtendedFilters = class {
|
|
|
583
583
|
return (h(Host, { part: "filters" }, SlotSkeleton("filters"), this.filters.length > 0 && (h("button", { class: "filters-more-button", onClick: () => (this.showMore = true) }, h(FiltersIcon, null))), h("div", { class: `filters-modal ${this.showMore ? "open" : ""}` }, h("div", { class: "filters-modal-wrapper" }, h("div", { class: "filters-modal-header" }, h("slot", { name: "vviinn-extended-filters-title" }, h("span", null, instance.t("filters.modal.title"))), moreFiltersOptionCount > 0 ? `(${moreFiltersOptionCount})` : "", h("button", { class: "filters-modal-close", onClick: () => {
|
|
584
584
|
this.showMore = false;
|
|
585
585
|
this.requestFilters = [];
|
|
586
|
-
} }, h(NewCloseIcon, null))), h("ul", { class: "filters-modal-list" }, this.filters
|
|
586
|
+
} }, h(NewCloseIcon, null))), h("ul", { class: "filters-modal-list" }, this.filters
|
|
587
|
+
.filter((filter) => filter.column !== "color")
|
|
588
|
+
.map((mainFilter) => {
|
|
587
589
|
const column = mainFilter.column;
|
|
588
590
|
const filterOptions = getFilterOptions(mainFilter);
|
|
589
591
|
return (h("li", null, h("button", { onClick: () => this.handleMoreOptionsMainClick(mainFilter.column), class: "filters-modal-main-button" }, mainFilter.label, filterOptions.length > 0
|
|
@@ -690,7 +692,7 @@ const VviinnFilters = class {
|
|
|
690
692
|
var _a;
|
|
691
693
|
const { column } = (_a = this.selectedFilter) !== null && _a !== void 0 ? _a : {};
|
|
692
694
|
const selectedFilterOptions = getFilterOptions(this.selectedFilter);
|
|
693
|
-
const filters = this.filters.filter((filter) => filter.isPrimary);
|
|
695
|
+
const filters = this.filters.filter((filter) => filter.isPrimary && filter.column !== "color");
|
|
694
696
|
if (filters.length === 0)
|
|
695
697
|
return h(Host, null);
|
|
696
698
|
return (h(Host, { part: "filters" }, h("div", { class: "main-filters-wrapper" }, h("ul", { class: "main-filters-list" }, filters.map((filter) => {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-abf408d8.js';
|
|
2
|
-
import { v as version } from './package-
|
|
2
|
+
import { v as version } from './package-b85f9cc8.js';
|
|
3
3
|
import { V as VisualSearchIcon } from './VisualSearchIcon-b301a1d4.js';
|
|
4
4
|
|
|
5
5
|
const vviinnVprButtonCss = ":host{display:block}";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-abf408d8.js';
|
|
2
|
-
import { v as version } from './package-
|
|
2
|
+
import { v as version } from './package-b85f9cc8.js';
|
|
3
3
|
import { C as CameraIcon } from './CameraIcon-785208d2.js';
|
|
4
4
|
import { c as campaignTypeNames, S as SlotSkeleton } from './customized-slots-299054d1.js';
|
|
5
5
|
import { D as DEFAULT_EXAMPLE_IMAGE } from './constants-8bf233a9.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-abf408d8.js';
|
|
2
2
|
import { s as searchState, j as makeTextSearchRequest, d as state, k as parseExcludedToParams, O as Option } from './search.store-16e165ba.js';
|
|
3
3
|
import { i as instance, r as resources, k as createSearchEvent, l as createFilterEvent, v as v4, c as createTrackingApi, m as createWidgetVpsEvent } from './index-ae9090ed.js';
|
|
4
|
-
import { v as version } from './package-
|
|
4
|
+
import { v as version } from './package-b85f9cc8.js';
|
|
5
5
|
import { c as campaignTypeNames, s as slotChangeListener, S as SlotSkeleton } from './customized-slots-299054d1.js';
|
|
6
6
|
import { D as DEFAULT_EXAMPLE_IMAGE } from './constants-8bf233a9.js';
|
|
7
7
|
|
|
@@ -413,9 +413,6 @@ export interface components {
|
|
|
413
413
|
"product-listing-page-request": {
|
|
414
414
|
resultsCount?: components["schemas"]["resultsCount"];
|
|
415
415
|
staticFilters?: components["schemas"]["request-static-filters"];
|
|
416
|
-
} & {
|
|
417
|
-
type: unknown;
|
|
418
|
-
paths: unknown;
|
|
419
416
|
};
|
|
420
417
|
"text-search-response": {
|
|
421
418
|
requestId?: components["schemas"]["request-id"];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{h as t,r as i,c as e,H as n,g as s}from"./p-1c863deb.js";import{s as r,_ as o,O as a,l as h,n as c,o as l,q as d,r as p,u,v,w as f,E as m,x as g,i as b,e as w,y as x,z as y,B as k,C,d as M,D as j,F as z,G as O,N as S,j as T}from"./p-20f795e5.js";import{i as E,c as I,v as L,n as N,o as P,r as B}from"./p-4f7d5500.js";import{s as R,c as _}from"./p-55c453ab.js";import{P as A}from"./p-2da7f425.js";import{v as D}from"./p-931e39b2.js";import{C as H}from"./p-171fa6da.js";const W=()=>t("svg",{width:"12",height:"20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t("path",{d:"M0 10 10 0l1.4 1.4L2.8 10l8.6 8.6L10 20 0 10Z"})),F=()=>t("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t("path",{d:"M8.00001 17.3333C7.62223 17.3333 7.30556 17.2056 7.05001 16.95C6.79445 16.6944 6.66667 16.3778 6.66667 16C6.66667 15.6222 6.79445 15.3056 7.05001 15.05C7.30556 14.7944 7.62223 14.6667 8.00001 14.6667H24C24.3778 14.6667 24.6944 14.7944 24.95 15.05C25.2056 15.3056 25.3333 15.6222 25.3333 16C25.3333 16.3778 25.2056 16.6944 24.95 16.95C24.6944 17.2056 24.3778 17.3333 24 17.3333H8.00001Z",fill:"currentColor"})),V=()=>t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"80",height:"80",viewBox:"0 0 80 80",fill:"none"},t("circle",{cx:"40",cy:"40",r:"36",fill:"white"}),t("circle",{cx:"40",cy:"40",r:"39",fill:"white","fill-opacity":"0.16",stroke:"white","stroke-width":"2"}),t("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M48 29.3333H50.6667C53.6133 29.3333 56 31.72 56 34.6667V45.3333H53.3333V34.6667C53.3333 33.2 52.1333 32 50.6667 32H46.5733L45.7867 30.8133L43.9067 28H36.0933L34.2133 30.8133L33.4267 32H29.3333C27.8667 32 26.6667 33.2 26.6667 34.6667V48C26.6667 49.4667 27.8667 50.6667 29.3333 50.6667H36V53.3333H29.3333C26.3867 53.3333 24 50.9467 24 48V34.6667C24 31.72 26.3867 29.3333 29.3333 29.3333H32L34.6667 25.3333H45.3333L48 29.3333ZM40 34.6667C43.68 34.6667 46.6667 37.6533 46.6667 41.3333L46.6533 41.3467C46.6533 42.6933 46.24 43.96 45.5467 45.0133L51.6 51.0667L49.72 52.9467L43.6667 46.8933C42.6133 47.5867 41.36 48 40 48C36.32 48 33.3333 45.0133 33.3333 41.3333C33.3333 37.6533 36.32 34.6667 40 34.6667ZM36 41.3333C36 43.5333 37.8 45.3333 40 45.3333C42.2 45.3333 44 43.5333 44 41.3333C44 39.1333 42.2 37.3333 40 37.3333C37.8 37.3333 36 39.1333 36 41.3333Z",fill:"#161616"})),Y=()=>t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},t("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"})),U=()=>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"})),X=()=>t("svg",{slot:"icon",class:"icon",width:"32",height:"32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t("path",{d:"M16 2a14 14 0 1 0 0 28 14 14 0 0 0 0-28Zm0 26a12 12 0 1 1 0-24 12 12 0 0 1 0 24Z",fill:"#525252"}),t("path",{d:"M17 8h-2v11h2V8Zm-1 14a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3Z",fill:"#525252"})),Z=({className:i})=>t("svg",{width:"34",height:"34",viewBox:"0 0 34 34",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:i},t("path",{d:"M31 3H15C8.37258 3 3 8.37258 3 15V31",stroke:"white","stroke-width":"6","stroke-linecap":"square"}));const K=(t,i)=>{var e;if(!t)return"";const n={};return t.href.split("?")[1].split("included[]=").join("").split("&").forEach((t=>{const[i,e]=t.split("%3A");n[i]=e})),"categories"===i?null!==(e=n.product_type)&&void 0!==e?e:n.google_product_category:n[i]},$=class{constructor(t){var n,s,o;i(this,t),this.vviinnSelectFilter=e(this,"vviinnSelectFilter",7),this.vviinnTextSearchFilterSelected=e(this,"vviinnTextSearchFilterSelected",7),this.filterType=null!==(s=null===(n=this.filter)||void 0===n?void 0:n.name)&&void 0!==s?s:null===(o=this.textSearchFiltersGroup)||void 0===o?void 0:o.column,this.getSelectedTextSearchFilters=()=>r.textSearchFilters.filter((({values:t})=>null==t?void 0:t.find((({selected:t})=>t)))).map((({column:t,values:i})=>({column:t,values:i.filter((t=>t.selected)).map((t=>t.value))}))),this.getTextSearchFilterRequestValue=t=>({column:this.textSearchFiltersGroup.column,values:[t.value.toString()]}),this.filter=null,this.textSearchFiltersGroup=null,this.basicEventData=void 0,this.selectedFilter="",this.hideFilters=!0}isCategoriesFilterType(){return"categories"===this.filterType}getFilterKind(){return this.isCategoriesFilterType()?"category":this.filterType}handleFilterSelection(t){return this.isFilterSelected(t)?this.clearSelectedFilter(t):this.selectFilter(t)}selectFilter(t){r.activeIonLink=t,this.selectedFilter=K(t,this.filterType),this.vviinnSelectFilter.emit(Object.assign(Object.assign({},this.basicEventData),{action:"select",kind:this.getFilterKind()}))}clearSelectedFilter(t){r.activeIonLink=t.clear,this.selectedFilter=K(t.clear,this.filterType),this.vviinnSelectFilter.emit(Object.assign(Object.assign({},this.basicEventData),{action:"deselect",kind:this.getFilterKind()}))}toggleFilters(){this.hideFilters=!this.hideFilters}handleEnter(t,i){"Enter"===t.key&&this.handleFilterSelection(i)}isFilterSelected(t){return this.isCategoriesFilterType()?this.selectedFilter===K(t,"categories"):this.selectedFilter===t.name}handleTextSearchEnter(t,i){"Enter"===t.key&&this.handleTextSearchFilterSelection(i)}handleTextSearchFilterSelection(t){let i;const e=this.getSelectedTextSearchFilters(),n=this.getTextSearchFilterRequestValue(t),s=t.selected,r=e.some((({column:t})=>t===n.column));i=s?e.filter((({column:t})=>t!==n.column)):r?e.map((t=>t.column===n.column?n:t)):[...e,n],this.vviinnTextSearchFilterSelected.emit(i)}render(){var i,e;const s=(null===(i=this.textSearchFiltersGroup)||void 0===i?void 0:i.values)||[],o=(null===(e=this.filter)||void 0===e?void 0:e.filters)||[];return t(n,{exportparts:"filter, show-more-filters"},t("div",{class:{filters:!0,"no-scrollbar-mobile":this.isCategoriesFilterType()||null!==this.textSearchFiltersGroup,"no-scrollbar":!this.isCategoriesFilterType()&&null===this.textSearchFiltersGroup}},!!o.length&&o.filter(((t,i)=>!this.hideFilters||i<4)).map(((i,e)=>{const n="categories"===this.filter.name?this.selectedFilter===K(i,"categories"):this.selectedFilter===i.name;return t("div",{role:"button",tabindex:"0",key:e,part:n?"filter active":"filter",class:{filter:!0,active:n},style:{"animation-delay":10*e+"ms"},onPointerUp:t=>{r.loading||(t.stopPropagation(),this.handleFilterSelection(i))},onKeyPress:t=>{r.loading||this.handleEnter(t,i)}},i.name)})),!!s.length&&s.filter(((t,i)=>!this.hideFilters||i<4)).map(((i,e)=>{const{label:n,selected:s}=i;return t("div",{role:"button",tabindex:"0",key:e,part:s?"filter active":"filter",class:{filter:!0,active:s},style:{"animation-delay":10*e+"ms"},onPointerUp:t=>{r.loading||(t.stopPropagation(),this.handleTextSearchFilterSelection(i))},onKeyPress:t=>{r.loading||this.handleTextSearchEnter(t,i)}},n)})),this.hideFilters&&t("div",{class:{"show-more":!0,hidden:o.length<=4&&s.length<=4,active:!this.hideFilters},role:"button",tabindex:"0","aria-role":"button",onClick:()=>{setTimeout((()=>this.toggleFilters()),300)},onKeyPress:t=>{"Enter"===t.key&&this.toggleFilters()},part:"show-more-filters"})))}get el(){return s(this)}};$.style=".filters{display:flex;flex-direction:row;overflow-x:auto;padding:0 12px 6px 24px;padding-left:24px;padding-bottom:6px;scrollbar-width:thin}:host(:not(:first-child)) .filters{margin-top:6px}.filter{align-items:center;color:#525252;cursor:pointer;display:flex;margin-right:12px;height:-moz-max-content;height:max-content;min-width:-moz-max-content;min-width:max-content;transition-property:background;transition-duration:0.5s;transition-timing-function:ease-in-out;-webkit-user-select:none;-moz-user-select:none;user-select:none;padding:10px 12px}.show-more{display:flex}.show-more.hidden{display:none !important}.show-more::after{position:relative;content:url(\"data:image/svg+xml,%3Csvg width='16' height='16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M8 12.2l-6-6L3.2 5 8 9.8 12.8 5 14 6.2l-6 6z' fill='%23525252'/%3E%3C/svg%3E\");display:block;transform:rotate(-90deg);left:2px}.no-scrollbar::-webkit-scrollbar{display:none}.no-scrollbar{-ms-overflow-style:none;scrollbar-width:none}@media (max-width: 640px){.no-scrollbar-mobile{-ms-overflow-style:none;scrollbar-width:none}.no-scrollbar-mobile::-webkit-scrollbar{display:none}}";const q=class{constructor(t){i(this,t),this.vviinnSelectObject=e(this,"vviinnSelectObject",7),this.detectedObject=void 0,this.basicEventData=void 0,this.position=["0","0"]}getObjectPosition(){return o.pipe(r.imageBounds,a.map((t=>{const i=h(c(this.detectedObject).rectangle),{x:e,y:n}=o.pipe(i,l(t),d);return[`${e}px`,`${n}px`]})),a.getOrElse((()=>["0","0"])))}selectDetectedObject(){o.pipe(r.imageBounds,a.map((t=>{const i=c(this.detectedObject).rectangle,e=h(i),n=l(t)(e);r.detectedObject=this.detectedObject,r.searchArea=a.some(n)}))),p(),this.vviinnSelectObject.emit(Object.assign(Object.assign({},this.basicEventData),{detectedObject:this.detectedObject}))}isActive(){if(!this.detectedObject)return!1;if(!r.detectedObject)return!1;const t=c(this.detectedObject),i=c(r.detectedObject);return u.equals(t,i)}render(){return t(n,{class:{active:this.isActive()},onClick:()=>this.selectDetectedObject(),style:{"--x-position":this.getObjectPosition()[0],"--y-position":this.getObjectPosition()[1]}})}};q.style=':host{--color-primary-system:#0f62fe;--color-primary-hover-system:#014cda;--color-icons-system:#2f8edf;--product-card-width-system:130px;--spacer:8px;--surface-color-surface-01:#f4f4f4;--text-color-text-primary:#161616;--font-family:Inter, system-ui, sans-serif;--font-size-body:14px;--font-weight-regular:400;--line-height-body:20px;--letter-spacing-default:0px;--background-color-background:#fff;--border-color-border-01:#f4f4f4;--gray-100:#161616;--gray-10:#f4f4f4;--gray-70:#525252;--radius-radius-md:8px;--button-color-button-primary:#000;--text-color-text-inverse:#fff;--text-color-text-secondary:#525252;--button-color-button-disabled:#e0e0e0;--text-color-text-disabled:rgba(22, 22, 22, 0.25);--surface-color-surface-accent:#e0e0e0;--border-color-border-02:#c6c6c6;--surface-color-surface-active:#161616;--surface-color-surface-inactive:#e0e0e0;--stroke-color-stroke-01:#f4f4f4}:host{display:block;position:absolute;left:calc(var(--x-position));top:calc(var(--y-position));z-index:2}: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:36px;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 Q=class{constructor(t){i(this,t),this.handler=void 0}render(){return t(n,null,t("vviinn-error",null,t(X,null),t("h4",{slot:"title"},E.t("emptyResultsBlock.title")),"image"===r.searchType&&t("button",{slot:"action",onClick:this.handler},E.t("emptyResultsBlock.button"))))}},G=class{constructor(t){i(this,t),this.vviinnImageUpload=e(this,"vviinnImageUpload",7),this.vviinnNoResult=e(this,"vviinnNoResult",7),this.vviinnImageUploadFinished=e(this,"vviinnImageUploadFinished",7),this.vviinnCameraEnabled=e(this,"vviinnCameraEnabled",7),this.videoTrack=null,this.initializeZoom=async()=>{var t;if(!this.videoTrack)return;const i=(null===(t=this.videoTrack)||void 0===t?void 0:t.getCapabilities)?this.videoTrack.getCapabilities():{};"zoom"in i&&(this.zoomCapabilities=i.zoom,await this.videoTrack.applyConstraints({advanced:[{zoom:this.zoomCapabilities.min}]}))},this.onZoom=async t=>{var i;if(!this.videoTrack||!this.zoomCapabilities)return;const{max:e,min:n}=this.zoomCapabilities,s=null!==(i=this.videoTrack.getSettings().zoom)&&void 0!==i?i:n,r=Math.round((e-n)/3*10)/10;let o;o="in"===t?s+r:s-r,o<n&&(o=n),o>e&&(o=e),await this.videoTrack.applyConstraints({advanced:[{zoom:o}]})},this.exampleImageSource=void 0,this.width=0,this.height=0,this.basicEventData=void 0,this.srcObject=void 0,this.cameraButtonClicked=!1,this.selected=!1,this.videoInitialized=!1,this.zoomCapabilities=null}componentWillLoad(){R(this,this.el)}componentDidLoad(){this.videoElement=this.el.shadowRoot.getElementById("camera-preview")}createPlaceholderImageCanvas(){const t=this.el.shadowRoot.getElementById("captured-image-placeholder"),i=this.videoElement,{videoWidth:e,videoHeight:n}=i,s=document.createElement("canvas");s.width=e,s.height=n,s.getContext("2d").drawImage(i,0,0,s.width,s.height);const r=s.toDataURL("image/jpeg");t.src=r}async selectImage(){if(!this.srcObject)return;let t;this.vviinnImageUpload.emit(this.basicEventData);const i=this.el.shadowRoot.getElementById("photo-frame"),e=this.videoElement,n=i.getBoundingClientRect(),s=e.getBoundingClientRect(),{videoWidth:r,videoHeight:a}=e,h=document.createElement("canvas");this.selected=!0,this.videoElement.pause(),this.createPlaceholderImageCanvas();const c=r/s.width,l=a/s.height,d=Math.min(n.width*c,n.height*l);h.width=d,h.height=d;const p=(n.left-s.left+(n.width-d/c)/2)*c,u=(n.top-s.top+(n.height-d/l)/2)*l;h.getContext("2d").drawImage(e,p,u,d,d,0,0,h.width,h.height);const g=h.toDataURL("image/jpeg");t=await v(g),o.pipe(await f(t),m.match((()=>this.vviinnNoResult.emit(this.basicEventData)),(()=>this.vviinnImageUploadFinished.emit()))),this.selected=!1,this.videoInitialized=!1,this.vviinnCameraEnabled.emit(!1)}handleKeyPress({key:t}){"Enter"!==t&&" "!==t||this.selectImage()}handleSrcObjectChange(){this.srcObject?(this.videoElement.srcObject=this.srcObject,this.videoTrack=this.srcObject.getVideoTracks()[0],this.initializeZoom(),this.videoElement.onloadedmetadata=()=>{this.vviinnCameraEnabled.emit(!0),this.videoInitialized=!0}):this.videoInitialized=!1}render(){return t(n,{onKeyUp:t=>this.handleKeyPress(t),class:{"video-expanded":this.cameraButtonClicked}},t("video",{id:"camera-preview",class:{hidden:!this.videoInitialized||this.selected},autoplay:!0,playsinline:!0,muted:!0}),t("img",{src:this.exampleImageSource,width:this.width,height:this.height,tabindex:1,class:{hidden:this.videoInitialized||this.selected}}),t("img",{id:"captured-image-placeholder",class:{hidden:!this.selected}}),t("div",{class:{container:!0,hidden:!this.videoInitialized}},t("div",{class:"photo-frame-container"},t("div",{id:"photo-frame"},t(Z,{className:"photo-frame-corner top-left"}),t(Z,{className:"photo-frame-corner top-right"}),t(Z,{className:"photo-frame-corner bottom-left"}),t(Z,{className:"photo-frame-corner bottom-right"})),t("div",{class:{"zoom-buttons":!0,hidden:!this.zoomCapabilities}},t("button",{onClick:()=>this.onZoom("out")},t(F,null)),t("button",{onClick:()=>this.onZoom("in")},t(A,null)))),t("div",{class:"photo-button-container"},t("button",{class:"photo-button",onClick:()=>this.selectImage()},t(V,null)))))}get el(){return s(this)}static get watchers(){return{srcObject:["handleSrcObjectChange"]}}};G.style=":host{display:block;width:100%;height:100%;min-height:0;position:relative;overflow:hidden;flex-grow:1;transition:min-height 1s}:host(.video-expanded){min-height:100%;transition:min-height 0.8s}img{width:100%;height:100%;min-height:100%;-o-object-fit:cover;object-fit:cover;-o-object-position:center;object-position:center}#camera-preview{width:100%;min-height:100%;-o-object-fit:cover;object-fit:cover;-o-object-position:center;object-position:center;position:relative}#captured-image-placeholder{height:auto}.container{position:absolute;width:100%;height:100%;left:0;top:0;display:flex;flex-direction:column;gap:12px;padding:68px 0 48px;justify-content:space-around;align-content:center;box-sizing:border-box}.photo-frame-container{width:100%;height:100%;display:flex;flex-direction:column;gap:12px}#photo-frame{position:relative;aspect-ratio:1/1;border-radius:16px;box-shadow:0 0 0 100vmax rgba(0, 0, 0, 0.32);width:100%;height:auto;max-width:80%;margin:0 auto}@media (max-width: 960px){.photo-frame-container{width:auto;height:auto}}@media (max-width: 380px){#photo-frame{max-width:70%}}.photo-frame-corner{position:absolute;--delta:-3px}.photo-frame-corner.top-left{top:var(--delta);left:var(--delta)}.photo-frame-corner.top-right{top:var(--delta);right:var(--delta);transform:rotate(90deg)}.photo-frame-corner.bottom-left{bottom:var(--delta);left:var(--delta);transform:rotate(-90deg)}.photo-frame-corner.bottom-right{bottom:var(--delta);right:var(--delta);transform:rotate(180deg)}.photo-button-container{display:flex;width:100%;align-items:center;justify-self:flex-end}.photo-button{cursor:pointer;border:none;position:relative;z-index:1;padding:0;color:#6f6f6f;background-color:transparent;-webkit-tap-highlight-color:transparent;line-height:0;margin:0 auto}.zoom-buttons{display:flex;position:relative;justify-content:center;gap:12px}.zoom-buttons button{color:white;display:flex;width:48px;height:48px;justify-content:center;align-items:center;border-radius:var(--radius-radius-md, 8px);background-color:rgba(0, 0, 0, 0.48);border:none;cursor:pointer}.hidden{display:none}";const J=class{constructor(t){i(this,t),this.vviinnImageUpload=e(this,"vviinnImageUpload",7),this.vviinnNoResult=e(this,"vviinnNoResult",7),this.vviinnImageUploadFinished=e(this,"vviinnImageUploadFinished",7),this.basicEventData=void 0,this.startUpload=void 0,this.loading=!1,this.accept="image",this.resetVpsButton=void 0,this.token=void 0,this.apiPath=void 0,this.showInTextSearch=!1}async handleInputChange(t){this.vviinnImageUpload.emit(this.basicEventData);const i=t.target,e=await f(i.files[0],this.showInTextSearch,this.token,this.apiPath);o.pipe(e,g((({kind:t})=>{this.vviinnNoResult.emit(Object.assign(Object.assign({},this.basicEventData),{reason:t}))}),(({links:t})=>{this.vviinnImageUploadFinished.emit({searchId:t.self.href})}))),i.value=null}startUploadWatcher(t){t&&(this.fileInput.click(),this.resetVpsButton())}render(){return t(n,{exportparts:"button"},this.loading?t("vviinn-preloader",null):t("label",{htmlFor:"fileInput",part:"button"},t("slot",{name:"upload-button-text"},"Upload image")),t("input",{id:"fileInput",class:"visually-hidden",type:"file",accept:"image"===this.accept?"image/*":"application/octet-stream",onChange:t=>this.handleInputChange(t),ref:t=>this.fileInput=t}))}static get watchers(){return{startUpload:["startUploadWatcher"]}}};J.style=".visually-hidden{clip:rect(0 0 0 0);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}label{cursor:pointer;display:grid;width:100%;height:100%;transition:background 0.1s ease-in-out}";var tt=b((function(t){
|
|
1
|
+
import{h as t,r as i,c as e,H as n,g as s}from"./p-1c863deb.js";import{s as r,_ as o,O as a,l as h,n as c,o as l,q as d,r as p,u,v,w as f,E as m,x as g,i as b,e as w,y as x,z as y,B as k,C,d as M,D as j,F as z,G as O,N as S,j as T}from"./p-20f795e5.js";import{i as E,c as I,v as L,n as N,o as P,r as B}from"./p-4f7d5500.js";import{s as R,c as _}from"./p-55c453ab.js";import{P as A}from"./p-2da7f425.js";import{v as D}from"./p-685b9114.js";import{C as H}from"./p-171fa6da.js";const W=()=>t("svg",{width:"12",height:"20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t("path",{d:"M0 10 10 0l1.4 1.4L2.8 10l8.6 8.6L10 20 0 10Z"})),F=()=>t("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t("path",{d:"M8.00001 17.3333C7.62223 17.3333 7.30556 17.2056 7.05001 16.95C6.79445 16.6944 6.66667 16.3778 6.66667 16C6.66667 15.6222 6.79445 15.3056 7.05001 15.05C7.30556 14.7944 7.62223 14.6667 8.00001 14.6667H24C24.3778 14.6667 24.6944 14.7944 24.95 15.05C25.2056 15.3056 25.3333 15.6222 25.3333 16C25.3333 16.3778 25.2056 16.6944 24.95 16.95C24.6944 17.2056 24.3778 17.3333 24 17.3333H8.00001Z",fill:"currentColor"})),V=()=>t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"80",height:"80",viewBox:"0 0 80 80",fill:"none"},t("circle",{cx:"40",cy:"40",r:"36",fill:"white"}),t("circle",{cx:"40",cy:"40",r:"39",fill:"white","fill-opacity":"0.16",stroke:"white","stroke-width":"2"}),t("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M48 29.3333H50.6667C53.6133 29.3333 56 31.72 56 34.6667V45.3333H53.3333V34.6667C53.3333 33.2 52.1333 32 50.6667 32H46.5733L45.7867 30.8133L43.9067 28H36.0933L34.2133 30.8133L33.4267 32H29.3333C27.8667 32 26.6667 33.2 26.6667 34.6667V48C26.6667 49.4667 27.8667 50.6667 29.3333 50.6667H36V53.3333H29.3333C26.3867 53.3333 24 50.9467 24 48V34.6667C24 31.72 26.3867 29.3333 29.3333 29.3333H32L34.6667 25.3333H45.3333L48 29.3333ZM40 34.6667C43.68 34.6667 46.6667 37.6533 46.6667 41.3333L46.6533 41.3467C46.6533 42.6933 46.24 43.96 45.5467 45.0133L51.6 51.0667L49.72 52.9467L43.6667 46.8933C42.6133 47.5867 41.36 48 40 48C36.32 48 33.3333 45.0133 33.3333 41.3333C33.3333 37.6533 36.32 34.6667 40 34.6667ZM36 41.3333C36 43.5333 37.8 45.3333 40 45.3333C42.2 45.3333 44 43.5333 44 41.3333C44 39.1333 42.2 37.3333 40 37.3333C37.8 37.3333 36 39.1333 36 41.3333Z",fill:"#161616"})),Y=()=>t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},t("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"})),U=()=>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"})),X=()=>t("svg",{slot:"icon",class:"icon",width:"32",height:"32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},t("path",{d:"M16 2a14 14 0 1 0 0 28 14 14 0 0 0 0-28Zm0 26a12 12 0 1 1 0-24 12 12 0 0 1 0 24Z",fill:"#525252"}),t("path",{d:"M17 8h-2v11h2V8Zm-1 14a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3Z",fill:"#525252"})),Z=({className:i})=>t("svg",{width:"34",height:"34",viewBox:"0 0 34 34",fill:"none",xmlns:"http://www.w3.org/2000/svg",class:i},t("path",{d:"M31 3H15C8.37258 3 3 8.37258 3 15V31",stroke:"white","stroke-width":"6","stroke-linecap":"square"}));const K=(t,i)=>{var e;if(!t)return"";const n={};return t.href.split("?")[1].split("included[]=").join("").split("&").forEach((t=>{const[i,e]=t.split("%3A");n[i]=e})),"categories"===i?null!==(e=n.product_type)&&void 0!==e?e:n.google_product_category:n[i]},$=class{constructor(t){var n,s,o;i(this,t),this.vviinnSelectFilter=e(this,"vviinnSelectFilter",7),this.vviinnTextSearchFilterSelected=e(this,"vviinnTextSearchFilterSelected",7),this.filterType=null!==(s=null===(n=this.filter)||void 0===n?void 0:n.name)&&void 0!==s?s:null===(o=this.textSearchFiltersGroup)||void 0===o?void 0:o.column,this.getSelectedTextSearchFilters=()=>r.textSearchFilters.filter((({values:t})=>null==t?void 0:t.find((({selected:t})=>t)))).map((({column:t,values:i})=>({column:t,values:i.filter((t=>t.selected)).map((t=>t.value))}))),this.getTextSearchFilterRequestValue=t=>({column:this.textSearchFiltersGroup.column,values:[t.value.toString()]}),this.filter=null,this.textSearchFiltersGroup=null,this.basicEventData=void 0,this.selectedFilter="",this.hideFilters=!0}isCategoriesFilterType(){return"categories"===this.filterType}getFilterKind(){return this.isCategoriesFilterType()?"category":this.filterType}handleFilterSelection(t){return this.isFilterSelected(t)?this.clearSelectedFilter(t):this.selectFilter(t)}selectFilter(t){r.activeIonLink=t,this.selectedFilter=K(t,this.filterType),this.vviinnSelectFilter.emit(Object.assign(Object.assign({},this.basicEventData),{action:"select",kind:this.getFilterKind()}))}clearSelectedFilter(t){r.activeIonLink=t.clear,this.selectedFilter=K(t.clear,this.filterType),this.vviinnSelectFilter.emit(Object.assign(Object.assign({},this.basicEventData),{action:"deselect",kind:this.getFilterKind()}))}toggleFilters(){this.hideFilters=!this.hideFilters}handleEnter(t,i){"Enter"===t.key&&this.handleFilterSelection(i)}isFilterSelected(t){return this.isCategoriesFilterType()?this.selectedFilter===K(t,"categories"):this.selectedFilter===t.name}handleTextSearchEnter(t,i){"Enter"===t.key&&this.handleTextSearchFilterSelection(i)}handleTextSearchFilterSelection(t){let i;const e=this.getSelectedTextSearchFilters(),n=this.getTextSearchFilterRequestValue(t),s=t.selected,r=e.some((({column:t})=>t===n.column));i=s?e.filter((({column:t})=>t!==n.column)):r?e.map((t=>t.column===n.column?n:t)):[...e,n],this.vviinnTextSearchFilterSelected.emit(i)}render(){var i,e;const s=(null===(i=this.textSearchFiltersGroup)||void 0===i?void 0:i.values)||[],o=(null===(e=this.filter)||void 0===e?void 0:e.filters)||[];return t(n,{exportparts:"filter, show-more-filters"},t("div",{class:{filters:!0,"no-scrollbar-mobile":this.isCategoriesFilterType()||null!==this.textSearchFiltersGroup,"no-scrollbar":!this.isCategoriesFilterType()&&null===this.textSearchFiltersGroup}},!!o.length&&o.filter(((t,i)=>!this.hideFilters||i<4)).map(((i,e)=>{const n="categories"===this.filter.name?this.selectedFilter===K(i,"categories"):this.selectedFilter===i.name;return t("div",{role:"button",tabindex:"0",key:e,part:n?"filter active":"filter",class:{filter:!0,active:n},style:{"animation-delay":10*e+"ms"},onPointerUp:t=>{r.loading||(t.stopPropagation(),this.handleFilterSelection(i))},onKeyPress:t=>{r.loading||this.handleEnter(t,i)}},i.name)})),!!s.length&&s.filter(((t,i)=>!this.hideFilters||i<4)).map(((i,e)=>{const{label:n,selected:s}=i;return t("div",{role:"button",tabindex:"0",key:e,part:s?"filter active":"filter",class:{filter:!0,active:s},style:{"animation-delay":10*e+"ms"},onPointerUp:t=>{r.loading||(t.stopPropagation(),this.handleTextSearchFilterSelection(i))},onKeyPress:t=>{r.loading||this.handleTextSearchEnter(t,i)}},n)})),this.hideFilters&&t("div",{class:{"show-more":!0,hidden:o.length<=4&&s.length<=4,active:!this.hideFilters},role:"button",tabindex:"0","aria-role":"button",onClick:()=>{setTimeout((()=>this.toggleFilters()),300)},onKeyPress:t=>{"Enter"===t.key&&this.toggleFilters()},part:"show-more-filters"})))}get el(){return s(this)}};$.style=".filters{display:flex;flex-direction:row;overflow-x:auto;padding:0 12px 6px 24px;padding-left:24px;padding-bottom:6px;scrollbar-width:thin}:host(:not(:first-child)) .filters{margin-top:6px}.filter{align-items:center;color:#525252;cursor:pointer;display:flex;margin-right:12px;height:-moz-max-content;height:max-content;min-width:-moz-max-content;min-width:max-content;transition-property:background;transition-duration:0.5s;transition-timing-function:ease-in-out;-webkit-user-select:none;-moz-user-select:none;user-select:none;padding:10px 12px}.show-more{display:flex}.show-more.hidden{display:none !important}.show-more::after{position:relative;content:url(\"data:image/svg+xml,%3Csvg width='16' height='16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M8 12.2l-6-6L3.2 5 8 9.8 12.8 5 14 6.2l-6 6z' fill='%23525252'/%3E%3C/svg%3E\");display:block;transform:rotate(-90deg);left:2px}.no-scrollbar::-webkit-scrollbar{display:none}.no-scrollbar{-ms-overflow-style:none;scrollbar-width:none}@media (max-width: 640px){.no-scrollbar-mobile{-ms-overflow-style:none;scrollbar-width:none}.no-scrollbar-mobile::-webkit-scrollbar{display:none}}";const q=class{constructor(t){i(this,t),this.vviinnSelectObject=e(this,"vviinnSelectObject",7),this.detectedObject=void 0,this.basicEventData=void 0,this.position=["0","0"]}getObjectPosition(){return o.pipe(r.imageBounds,a.map((t=>{const i=h(c(this.detectedObject).rectangle),{x:e,y:n}=o.pipe(i,l(t),d);return[`${e}px`,`${n}px`]})),a.getOrElse((()=>["0","0"])))}selectDetectedObject(){o.pipe(r.imageBounds,a.map((t=>{const i=c(this.detectedObject).rectangle,e=h(i),n=l(t)(e);r.detectedObject=this.detectedObject,r.searchArea=a.some(n)}))),p(),this.vviinnSelectObject.emit(Object.assign(Object.assign({},this.basicEventData),{detectedObject:this.detectedObject}))}isActive(){if(!this.detectedObject)return!1;if(!r.detectedObject)return!1;const t=c(this.detectedObject),i=c(r.detectedObject);return u.equals(t,i)}render(){return t(n,{class:{active:this.isActive()},onClick:()=>this.selectDetectedObject(),style:{"--x-position":this.getObjectPosition()[0],"--y-position":this.getObjectPosition()[1]}})}};q.style=':host{--color-primary-system:#0f62fe;--color-primary-hover-system:#014cda;--color-icons-system:#2f8edf;--product-card-width-system:130px;--spacer:8px;--surface-color-surface-01:#f4f4f4;--text-color-text-primary:#161616;--font-family:Inter, system-ui, sans-serif;--font-size-body:14px;--font-weight-regular:400;--line-height-body:20px;--letter-spacing-default:0px;--background-color-background:#fff;--border-color-border-01:#f4f4f4;--gray-100:#161616;--gray-10:#f4f4f4;--gray-70:#525252;--radius-radius-md:8px;--button-color-button-primary:#000;--text-color-text-inverse:#fff;--text-color-text-secondary:#525252;--button-color-button-disabled:#e0e0e0;--text-color-text-disabled:rgba(22, 22, 22, 0.25);--surface-color-surface-accent:#e0e0e0;--border-color-border-02:#c6c6c6;--surface-color-surface-active:#161616;--surface-color-surface-inactive:#e0e0e0;--stroke-color-stroke-01:#f4f4f4}:host{display:block;position:absolute;left:calc(var(--x-position));top:calc(var(--y-position));z-index:2}: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:36px;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 Q=class{constructor(t){i(this,t),this.handler=void 0}render(){return t(n,null,t("vviinn-error",null,t(X,null),t("h4",{slot:"title"},E.t("emptyResultsBlock.title")),"image"===r.searchType&&t("button",{slot:"action",onClick:this.handler},E.t("emptyResultsBlock.button"))))}},G=class{constructor(t){i(this,t),this.vviinnImageUpload=e(this,"vviinnImageUpload",7),this.vviinnNoResult=e(this,"vviinnNoResult",7),this.vviinnImageUploadFinished=e(this,"vviinnImageUploadFinished",7),this.vviinnCameraEnabled=e(this,"vviinnCameraEnabled",7),this.videoTrack=null,this.initializeZoom=async()=>{var t;if(!this.videoTrack)return;const i=(null===(t=this.videoTrack)||void 0===t?void 0:t.getCapabilities)?this.videoTrack.getCapabilities():{};"zoom"in i&&(this.zoomCapabilities=i.zoom,await this.videoTrack.applyConstraints({advanced:[{zoom:this.zoomCapabilities.min}]}))},this.onZoom=async t=>{var i;if(!this.videoTrack||!this.zoomCapabilities)return;const{max:e,min:n}=this.zoomCapabilities,s=null!==(i=this.videoTrack.getSettings().zoom)&&void 0!==i?i:n,r=Math.round((e-n)/3*10)/10;let o;o="in"===t?s+r:s-r,o<n&&(o=n),o>e&&(o=e),await this.videoTrack.applyConstraints({advanced:[{zoom:o}]})},this.exampleImageSource=void 0,this.width=0,this.height=0,this.basicEventData=void 0,this.srcObject=void 0,this.cameraButtonClicked=!1,this.selected=!1,this.videoInitialized=!1,this.zoomCapabilities=null}componentWillLoad(){R(this,this.el)}componentDidLoad(){this.videoElement=this.el.shadowRoot.getElementById("camera-preview")}createPlaceholderImageCanvas(){const t=this.el.shadowRoot.getElementById("captured-image-placeholder"),i=this.videoElement,{videoWidth:e,videoHeight:n}=i,s=document.createElement("canvas");s.width=e,s.height=n,s.getContext("2d").drawImage(i,0,0,s.width,s.height);const r=s.toDataURL("image/jpeg");t.src=r}async selectImage(){if(!this.srcObject)return;let t;this.vviinnImageUpload.emit(this.basicEventData);const i=this.el.shadowRoot.getElementById("photo-frame"),e=this.videoElement,n=i.getBoundingClientRect(),s=e.getBoundingClientRect(),{videoWidth:r,videoHeight:a}=e,h=document.createElement("canvas");this.selected=!0,this.videoElement.pause(),this.createPlaceholderImageCanvas();const c=r/s.width,l=a/s.height,d=Math.min(n.width*c,n.height*l);h.width=d,h.height=d;const p=(n.left-s.left+(n.width-d/c)/2)*c,u=(n.top-s.top+(n.height-d/l)/2)*l;h.getContext("2d").drawImage(e,p,u,d,d,0,0,h.width,h.height);const g=h.toDataURL("image/jpeg");t=await v(g),o.pipe(await f(t),m.match((()=>this.vviinnNoResult.emit(this.basicEventData)),(()=>this.vviinnImageUploadFinished.emit()))),this.selected=!1,this.videoInitialized=!1,this.vviinnCameraEnabled.emit(!1)}handleKeyPress({key:t}){"Enter"!==t&&" "!==t||this.selectImage()}handleSrcObjectChange(){this.srcObject?(this.videoElement.srcObject=this.srcObject,this.videoTrack=this.srcObject.getVideoTracks()[0],this.initializeZoom(),this.videoElement.onloadedmetadata=()=>{this.vviinnCameraEnabled.emit(!0),this.videoInitialized=!0}):this.videoInitialized=!1}render(){return t(n,{onKeyUp:t=>this.handleKeyPress(t),class:{"video-expanded":this.cameraButtonClicked}},t("video",{id:"camera-preview",class:{hidden:!this.videoInitialized||this.selected},autoplay:!0,playsinline:!0,muted:!0}),t("img",{src:this.exampleImageSource,width:this.width,height:this.height,tabindex:1,class:{hidden:this.videoInitialized||this.selected}}),t("img",{id:"captured-image-placeholder",class:{hidden:!this.selected}}),t("div",{class:{container:!0,hidden:!this.videoInitialized}},t("div",{class:"photo-frame-container"},t("div",{id:"photo-frame"},t(Z,{className:"photo-frame-corner top-left"}),t(Z,{className:"photo-frame-corner top-right"}),t(Z,{className:"photo-frame-corner bottom-left"}),t(Z,{className:"photo-frame-corner bottom-right"})),t("div",{class:{"zoom-buttons":!0,hidden:!this.zoomCapabilities}},t("button",{onClick:()=>this.onZoom("out")},t(F,null)),t("button",{onClick:()=>this.onZoom("in")},t(A,null)))),t("div",{class:"photo-button-container"},t("button",{class:"photo-button",onClick:()=>this.selectImage()},t(V,null)))))}get el(){return s(this)}static get watchers(){return{srcObject:["handleSrcObjectChange"]}}};G.style=":host{display:block;width:100%;height:100%;min-height:0;position:relative;overflow:hidden;flex-grow:1;transition:min-height 1s}:host(.video-expanded){min-height:100%;transition:min-height 0.8s}img{width:100%;height:100%;min-height:100%;-o-object-fit:cover;object-fit:cover;-o-object-position:center;object-position:center}#camera-preview{width:100%;min-height:100%;-o-object-fit:cover;object-fit:cover;-o-object-position:center;object-position:center;position:relative}#captured-image-placeholder{height:auto}.container{position:absolute;width:100%;height:100%;left:0;top:0;display:flex;flex-direction:column;gap:12px;padding:68px 0 48px;justify-content:space-around;align-content:center;box-sizing:border-box}.photo-frame-container{width:100%;height:100%;display:flex;flex-direction:column;gap:12px}#photo-frame{position:relative;aspect-ratio:1/1;border-radius:16px;box-shadow:0 0 0 100vmax rgba(0, 0, 0, 0.32);width:100%;height:auto;max-width:80%;margin:0 auto}@media (max-width: 960px){.photo-frame-container{width:auto;height:auto}}@media (max-width: 380px){#photo-frame{max-width:70%}}.photo-frame-corner{position:absolute;--delta:-3px}.photo-frame-corner.top-left{top:var(--delta);left:var(--delta)}.photo-frame-corner.top-right{top:var(--delta);right:var(--delta);transform:rotate(90deg)}.photo-frame-corner.bottom-left{bottom:var(--delta);left:var(--delta);transform:rotate(-90deg)}.photo-frame-corner.bottom-right{bottom:var(--delta);right:var(--delta);transform:rotate(180deg)}.photo-button-container{display:flex;width:100%;align-items:center;justify-self:flex-end}.photo-button{cursor:pointer;border:none;position:relative;z-index:1;padding:0;color:#6f6f6f;background-color:transparent;-webkit-tap-highlight-color:transparent;line-height:0;margin:0 auto}.zoom-buttons{display:flex;position:relative;justify-content:center;gap:12px}.zoom-buttons button{color:white;display:flex;width:48px;height:48px;justify-content:center;align-items:center;border-radius:var(--radius-radius-md, 8px);background-color:rgba(0, 0, 0, 0.48);border:none;cursor:pointer}.hidden{display:none}";const J=class{constructor(t){i(this,t),this.vviinnImageUpload=e(this,"vviinnImageUpload",7),this.vviinnNoResult=e(this,"vviinnNoResult",7),this.vviinnImageUploadFinished=e(this,"vviinnImageUploadFinished",7),this.basicEventData=void 0,this.startUpload=void 0,this.loading=!1,this.accept="image",this.resetVpsButton=void 0,this.token=void 0,this.apiPath=void 0,this.showInTextSearch=!1}async handleInputChange(t){this.vviinnImageUpload.emit(this.basicEventData);const i=t.target,e=await f(i.files[0],this.showInTextSearch,this.token,this.apiPath);o.pipe(e,g((({kind:t})=>{this.vviinnNoResult.emit(Object.assign(Object.assign({},this.basicEventData),{reason:t}))}),(({links:t})=>{this.vviinnImageUploadFinished.emit({searchId:t.self.href})}))),i.value=null}startUploadWatcher(t){t&&(this.fileInput.click(),this.resetVpsButton())}render(){return t(n,{exportparts:"button"},this.loading?t("vviinn-preloader",null):t("label",{htmlFor:"fileInput",part:"button"},t("slot",{name:"upload-button-text"},"Upload image")),t("input",{id:"fileInput",class:"visually-hidden",type:"file",accept:"image"===this.accept?"image/*":"application/octet-stream",onChange:t=>this.handleInputChange(t),ref:t=>this.fileInput=t}))}static get watchers(){return{startUpload:["startUploadWatcher"]}}};J.style=".visually-hidden{clip:rect(0 0 0 0);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}label{cursor:pointer;display:grid;width:100%;height:100%;transition:background 0.1s ease-in-out}";var tt=b((function(t){
|
|
2
2
|
/*!
|
|
3
3
|
* Cropper.js v1.5.13
|
|
4
4
|
* https://fengyuanchen.github.io/cropperjs
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as i,h as s,H as h,g as e}from"./p-1c863deb.js";import{v as n}from"./p-
|
|
1
|
+
import{r as t,c as i,h as s,H as h,g as e}from"./p-1c863deb.js";import{v as n}from"./p-685b9114.js";import{C as o}from"./p-171fa6da.js";import{c as a,S as d}from"./p-55c453ab.js";import{D as l}from"./p-cc013cd2.js";const r=class{constructor(s){t(this,s),this.vviinnWidgetLoad=i(this,"vviinnWidgetLoad",7),this.vviinnWidgetOpen=i(this,"vviinnWidgetOpen",7),this.vviinnWidgetClose=i(this,"vviinnWidgetClose",7),this.vviinnImageUpload=i(this,"vviinnImageUpload",7),this.vviinnProductLoad=i(this,"vviinnProductLoad",7),this.vviinnProductClick=i(this,"vviinnProductClick",7),this.vviinnProductView=i(this,"vviinnProductView",7),this.vviinnResultLoad=i(this,"vviinnResultLoad",7),this.vviinnResultView=i(this,"vviinnResultView",7),this.vviinnNoResult=i(this,"vviinnNoResult",7),this.vviinnImageCrop=i(this,"vviinnImageCrop",7),this.vviinnSelectObject=i(this,"vviinnSelectObject",7),this.vviinnSelectFilter=i(this,"vviinnSelectFilter",7),this.globalSlotsChanged=i(this,"globalSlotsChanged",7),this.getBasicEventData=()=>({widgetType:"VPS",campaignTypeId:"VPS",campaignTypeName:a.VPS,widgetId:this.el.id,widgetVersion:n}),this.token=void 0,this.currencySign="€",this.locale="de-DE",this.campaignId="",this.addStyle=!1,this.mode="modal",this.excluded="",this.productDetailsNewTab=!0,this.productDetailsRedirect=!0,this.imageResolutionWidth=250,this.exampleImageSource=l,this.textSearchShow=!1,this.apiPath=void 0,this.buttonPressed=!1}handleModalClosed(){this.buttonPressed=!1}componentDidLoad(){const t=this.el.querySelectorAll("[slot]");this.globalSlotsChanged.emit({slots:Array.from(t),element:this.el})}handleClick(){this.buttonPressed=!0}resetButton(){this.buttonPressed=!1}render(){return s(h,{tabindex:"0",role:"button"},s("vviinn-button",{onClick:()=>{this.handleClick()},addStyle:this.addStyle,part:"vviinn-button"},s("slot",null,s(o,null))),d("vps"),s("vviinn-vps-widget",{mode:this.mode,"currency-sign":this.currencySign,token:this.token,locale:this.locale,apiPath:this.apiPath,campaignId:this.campaignId,showingInButton:!0,buttonPressed:this.buttonPressed,resetVpsButton:this.resetButton.bind(this),buttonElementId:this.el.id,active:this.buttonPressed&&("modal"===this.mode||"camera"===this.mode),excluded:this.excluded,productDetailsNewTab:this.productDetailsNewTab,productDetailsRedirect:this.productDetailsRedirect,imageResolutionWidth:this.imageResolutionWidth,exampleImageSource:this.exampleImageSource,textSearchShow:this.textSearchShow}))}get el(){return e(this)}};r.style=":host{display:block}";export{r as vviinn_vps_button}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const o="2.72.1";export{o as v}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as t,r as i,c as e,F as s,H as a,g as r}from"./p-1c863deb.js";import{s as o,j as n,d as h,k as c,O as l}from"./p-20f795e5.js";import{i as d,r as p,k as u,l as v,v as g,c as m,m as f}from"./p-4f7d5500.js";import{v as b}from"./p-931e39b2.js";import{c as x,s as y,S as w}from"./p-55c453ab.js";import{D as C}from"./p-cc013cd2.js";const k=()=>t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},t("path",{d:"M12 17.5C13.25 17.5 14.3125 17.0625 15.1875 16.1875C16.0625 15.3125 16.5 14.25 16.5 13C16.5 11.75 16.0625 10.6875 15.1875 9.8125C14.3125 8.9375 13.25 8.5 12 8.5C10.75 8.5 9.6875 8.9375 8.8125 9.8125C7.9375 10.6875 7.5 11.75 7.5 13C7.5 14.25 7.9375 15.3125 8.8125 16.1875C9.6875 17.0625 10.75 17.5 12 17.5ZM12 15.5C11.3 15.5 10.7083 15.2583 10.225 14.775C9.74167 14.2917 9.5 13.7 9.5 13C9.5 12.3 9.74167 11.7083 10.225 11.225C10.7083 10.7417 11.3 10.5 12 10.5C12.7 10.5 13.2917 10.7417 13.775 11.225C14.2583 11.7083 14.5 12.3 14.5 13C14.5 13.7 14.2583 14.2917 13.775 14.775C13.2917 15.2583 12.7 15.5 12 15.5ZM4 21C3.45 21 2.97917 20.8042 2.5875 20.4125C2.19583 20.0208 2 19.55 2 19V7C2 6.45 2.19583 5.97917 2.5875 5.5875C2.97917 5.19583 3.45 5 4 5H7.15L8.4 3.65C8.58333 3.45 8.80417 3.29167 9.0625 3.175C9.32083 3.05833 9.59167 3 9.875 3H14.125C14.4083 3 14.6792 3.05833 14.9375 3.175C15.1958 3.29167 15.4167 3.45 15.6 3.65L16.85 5H20C20.55 5 21.0208 5.19583 21.4125 5.5875C21.8042 5.97917 22 6.45 22 7V19C22 19.55 21.8042 20.0208 21.4125 20.4125C21.0208 20.8042 20.55 21 20 21H4Z",fill:"currentColor"})),S=()=>t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},t("path",{d:"M4.5 21C4.1 21 3.75 20.85 3.45 20.55C3.15 20.25 3 19.9 3 19.5V4.5C3 4.1 3.15 3.75 3.45 3.45C3.75 3.15 4.1 3 4.5 3H19.5C19.9 3 20.25 3.15 20.55 3.45C20.85 3.75 21 4.1 21 4.5V19.5C21 19.9 20.85 20.25 20.55 20.55C20.25 20.85 19.9 21 19.5 21H4.5ZM6.65 17.075H17.375C17.525 17.075 17.6333 17.0083 17.7 16.875C17.7667 16.7417 17.7583 16.6083 17.675 16.475L14.75 12.575C14.6667 12.475 14.5667 12.425 14.45 12.425C14.3333 12.425 14.2333 12.475 14.15 12.575L11.15 16.45L9.125 13.675C9.04167 13.575 8.94167 13.525 8.825 13.525C8.70833 13.525 8.60833 13.575 8.525 13.675L6.375 16.475C6.275 16.6083 6.25833 16.7417 6.325 16.875C6.39167 17.0083 6.5 17.075 6.65 17.075Z",fill:"currentColor"})),j={facingMode:"environment",width:{ideal:1920},height:{ideal:1080},frameRate:{ideal:30}};var _=function(t,i){var e={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&i.indexOf(s)<0&&(e[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(s=Object.getOwnPropertySymbols(t);a<s.length;a++)i.indexOf(s[a])<0&&Object.prototype.propertyIsEnumerable.call(t,s[a])&&(e[s[a]]=t[s[a]])}return e};const I=class{constructor(s){i(this,s),this.globalSlotsChanged=e(this,"globalSlotsChanged",7),this.vviinnWidgetLoad=e(this,"vviinnWidgetLoad",7),this.vviinnWidgetOpen=e(this,"vviinnWidgetOpen",7),this.vviinnWidgetClose=e(this,"vviinnWidgetClose",7),this.vviinnImageCrop=e(this,"vviinnImageCrop",7),this.vviinnSelectObject=e(this,"vviinnSelectObject",7),this.vviinnSelectFilter=e(this,"vviinnSelectFilter",7),this.vviinnImageUpload=e(this,"vviinnImageUpload",7),this.vviinnNoResult=e(this,"vviinnNoResult",7),this.imageSource=null,this.cameraAvailable=!1,this.isDesktop=!1,this.videoTrack=null,this.handleVviinnImageUpload=t=>{this.trackInitialSearch(),this.uploadSource=t},this.handleVviinnImageUploadFinished=()=>{this.handleImageSelection(),"upload"===this.mode&&this.showingInButton&&(this.active=!0)},this.handleVviinnNoResult=t=>{"client"===t.reason&&(this.wrongImageFormat=!0)},this.adjustCameraSettings=async()=>{var t;if(!this.videoTrack)return;const i=(null===(t=this.videoTrack)||void 0===t?void 0:t.getCapabilities)?this.videoTrack.getCapabilities():{};if("focusMode"in i)try{await this.videoTrack.applyConstraints({advanced:[{focusMode:"continuous"}]})}catch(t){console.error("Failed to apply focus mode constraints",t)}if("exposureMode"in i)try{await this.videoTrack.applyConstraints({advanced:[{exposureMode:"continuous"}]})}catch(t){console.error("Failed to apply exposure mode constraints",t)}if("whiteBalanceMode"in i)try{await this.videoTrack.applyConstraints({advanced:[{whiteBalanceMode:"continuous"}]})}catch(t){console.error("Failed to apply white balance mode constraints",t)}},this.handleStartCameraClick=async()=>{this.stream?this.resetState():(this.cameraInitializing=!0,setTimeout((async()=>{this.cameraButtonClicked=!0;try{const t=await navigator.mediaDevices.getUserMedia({video:j});this.videoTrack=t.getVideoTracks()[0],this.adjustCameraSettings(),this.stream=t,this.uploadSource="startCamera"}catch(t){console.log("Error accessing camera: ",t.message),this.resetState(),this.cameraInitializing=!1}}),500))},this.setShowAspectRatioError=t=>{this.showAspectRatioError=t},this.setTrackingDeactivated=t=>{"rejected"===t.status&&(this.trackingDeactivated=!0)},this.getBasicEventData=()=>{var t;return{widgetType:"VPS",campaignTypeId:"VPS",campaignTypeName:x.VPS,widgetId:null!==(t=this.buttonElementId)&&void 0!==t?t:this.widgetElementId,widgetVersion:b}},this.LinkText=({href:i,children:e})=>t("a",{href:i||""},e),this.token=void 0,this.active=!0,this.currencySign="€",this.locale="de-DE",this.campaignId="",this.excluded="",this.productDetailsNewTab=!0,this.productDetailsRedirect=!0,this.imageResolutionWidth=250,this.exampleImageSource=C,this.textSearchShow=!1,this.apiPath="https://api.vviinn.com",this.showingInButton=!1,this.buttonElementId=void 0,this.buttonPressed=void 0,this.mode="modal",this.resetVpsButton=void 0,this.slidePosition=0,this.width=0,this.wrongImageFormat=!1,this.trackingDeactivated=!1,this.stream=null,this.cameraInitializing=!1,this.cameraEnabled=!1,this.cameraButtonClicked=!1,this.uploadSource=void 0,this.showAspectRatioError=!1,this.products=[],this.searchQuery=""}initResultEvents(){o.resultLoaded=!1,o.resultViewed=!1}stopStreamTracks(){var t;null===(t=this.stream)||void 0===t||t.getTracks().forEach((t=>{t.stop()}))}isOnboardingSlide(){return 0===this.slidePosition}isResultSlide(){return 1===this.slidePosition}async componentWillLoad(){await d.init({lng:this.locale,fallbackLng:"en",resources:p}),y(this,this.el),this.vviinnWidgetLoad.emit(this.getBasicEventData()),this.trackWidgetEvent("load")}componentDidLoad(){const t=this.el.querySelectorAll("[slot]");this.globalSlotsChanged.emit({slots:Array.from(t),element:this.el})}activeWatcher(t){t?(this.overflow=document.body.style.overflow,document.body.style.overflow="hidden",this.vviinnWidgetOpen.emit(this.getBasicEventData()),"camera"===this.mode&&this.handleStartCameraClick(),this.trackWidgetEvent("open")):(document.body.style.overflow=this.overflow,this.initResultEvents())}textSearchFinishedHandler({detail:t}){this.searchQuery=t.query,this.slidePosition=1}resultLoadHandler(){o.resultLoaded=!0}resultViewHandler(){o.resultViewed=!0}trackCameraEnabled({detail:t}){this.cameraEnabled=t,this.cameraInitializing=!1}trachSearchAreaChanges(){if(this.initResultEvents(),this.trackingDeactivated)return;const t=this.getBasicEventData(),i=_(t,["campaignTypeId"]),e=u(Object.assign({session_id:this.uiSessionId,source:this.imageSource,search_area:"manual-selection"},i));this.trackingApi.trackEvent(e).then(this.setTrackingDeactivated)}trackDetectedObject(){if(this.initResultEvents(),this.trackingDeactivated)return;const t=this.getBasicEventData(),i=_(t,["campaignTypeId"]),e=u(Object.assign({session_id:this.uiSessionId,source:this.imageSource,search_area:"attention-point"},i));this.trackingApi.trackEvent(e).then(this.setTrackingDeactivated)}trackFilter({detail:t}){if(this.initResultEvents(),this.trackingDeactivated)return;const i=this.getBasicEventData(),e=_(i,["campaignTypeId"]),s=v(Object.assign({session_id:this.uiSessionId,source:this.imageSource,kind:t.kind,action:t.action},e));this.trackingApi.trackEvent(s).then(this.setTrackingDeactivated)}trackTextSearchFilterSelected({detail:t}){n(this.searchQuery,this.token,t)}connectedCallback(){this.isDesktop="desktop"===(()=>{const t=navigator.userAgent;return/(tablet|ipad|playbook|silk)|(android(?!.*mobi))/i.test(t)?"tablet":/Mobile|Android|iP(hone|od)|IEMobile|BlackBerry|Kindle|Silk-Accelerated|(hpw|web)OS|Opera M(obi|ini)/.test(t)?"mobile":"desktop"})(),h.apiPath=this.apiPath,h.currencySign=this.currencySign,h.locale=this.locale,this.cameraAvailable=!!navigator.mediaDevices&&!!navigator.mediaDevices.getUserMedia,this.excluded&&(this.excluded=c(this.excluded)),o.token=this.token,o.campaignId=this.campaignId,o.excluded=this.excluded,this.uiSessionId=g(),this.trackingApi=m(this.apiPath,this.token),this.widgetElementId=this.el.id}trackWidgetEvent(t){if(this.trackingDeactivated)return;const i=this.getBasicEventData(),e=_(i,["campaignTypeId","widgetType"]),s=Object.assign({action:t,session_id:this.uiSessionId},e),a=f(s);this.trackingApi.trackEvent(a).then(this.setTrackingDeactivated)}trackInitialSearch(){if(this.trackingDeactivated)return;const t=this.getBasicEventData(),i=_(t,["campaignTypeId","widgetType"]),e=u(Object.assign({session_id:this.uiSessionId,search_area:"full",source:"upload"},i));this.trackingApi.trackEvent(e).then(this.setTrackingDeactivated)}handleImageSelection(){this.imageSource="upload",this.slidePosition=1,this.el.shadowRoot.querySelector("vviinn-overlayed-modal").shadowRoot.querySelector("vviinn-overlay").querySelector("vviinn-modal").shadowRoot.querySelector(".body").scrollTop=0,this.stopStreamTracks()}renderButtons(){const i=o.loading&&"image"===o.searchType&&"startCamera"===this.uploadSource||this.cameraInitializing,e=[this.cameraAvailable&&t("button",{class:"action-button",part:"start-camera_button",onClick:()=>{this.handleStartCameraClick()}},t("vviinn-preloader",{class:{hidden:!i}}),t("span",{class:{"action-button-content":!0,hidden:i}},t("slot",{name:"vviinn-camera-icon"},t(k,null)),t("span",{class:{hidden:!this.cameraEnabled}},t("slot",{name:"vviinn-camera-button-text-stop"},d.t("cameraButtonTextStop"))),t("span",{class:{hidden:this.cameraEnabled}},t("slot",{name:"vviinn-camera-button-text-start"},d.t("cameraButtonTextStart"))))),t("vviinn-image-selector",{class:"action-button",onClick:()=>this.uploadSource="uploadPhoto",onVviinnImageUploadFinished:this.handleVviinnImageUploadFinished,onVviinnImageUpload:()=>{this.handleVviinnImageUpload("uploadPhoto")},onVviinnNoResult:({detail:t})=>this.handleVviinnNoResult(t),resetVpsButton:this.resetVpsButton,basicEventData:this.getBasicEventData(),part:"upload-photo_button",startUpload:this.buttonPressed&&this.showingInButton&&"upload"===this.mode,loading:o.loading&&"image"===o.searchType&&"uploadPhoto"===this.uploadSource},t("span",{slot:"upload-button-text",class:"action-button-content"},t("slot",{name:"vviinn-image-upload-icon"},t(S,null)),t("slot",{name:"vviinn-image-upload-button-text"},t("span",null,d.t("imageUploadButtonText")))))];return this.isDesktop?e.reverse():e}resetState(){this.resetScroll("start-page_block"),this.slidePosition=0,o.resetCategoryLink=void 0,o.activeIonLink=void 0,o.image=l.none,o.imageUrl=l.none,o.imageBounds=l.none,o.searchArea=l.none,o.results=[],o.filters=[],o.textSearchFilters=[],o.detectedObjects=[],o.rectangleSearchForm=void 0,o.loading=!1,o.serverError=!1,o.searchType=void 0,this.searchQuery="",this.wrongImageFormat=!1,this.resetScroll("results-block"),this.stopStreamTracks(),this.initResultEvents(),this.stream=null,this.cameraEnabled=!1,this.cameraButtonClicked=!1,this.cameraInitializing=!1,this.setShowAspectRatioError(!1)}haveErrors(){return this.wrongImageFormat||o.serverError}resetScroll(t,i="auto"){const e=this.el.shadowRoot.getElementById(t);null==e||e.scroll({top:0,left:0,behavior:i})}handleModalClose(){this.active=!1,this.resetState(),["start-page_block","results-block"].forEach((t=>this.resetScroll(t))),this.trackWidgetEvent("close")}render(){var i,e;return t(a,{exportparts:"brand, deeplink, currency, image, image-link, price-amount-sale, price-amount-outdated, price-amount-regular, price-container, price-outdated, price-regular, price-sale, price-prefix, title, product-card, upload-photo_button, show-files_button, start-camera_button, text-search-input, close-button, secondary-action, close-button"},!this.showingInButton&&w("vps"),t("vviinn-overlayed-modal",{class:{"first-screen":this.isOnboardingSlide()},isFirstScreen:this.isOnboardingSlide(),active:this.active,resetState:this.resetState.bind(this),onVviinnWidgetClose:()=>this.handleModalClose(),buttonElementId:null!==(i=this.buttonElementId)&&void 0!==i?i:this.widgetElementId,widgetVersion:b,hideBackButton:"upload"===this.mode&&this.showingInButton||!this.cameraEnabled&&this.isOnboardingSlide(),exportparts:"secondary-action, title, close-button"},t("vviinn-slider",{showBullets:!1,position:this.slidePosition},t("vviinn-slide",{class:{"start-page":!0,"camera-enabled":this.cameraEnabled}},t("vviinn-example-image",{onVviinnImageUploadFinished:this.handleVviinnImageUploadFinished,onVviinnImageUpload:()=>{this.handleVviinnImageUpload("startCamera")},basicEventData:this.getBasicEventData(),srcObject:this.stream,cameraButtonClicked:this.cameraButtonClicked,exampleImageSource:this.exampleImageSource}),t("div",{class:{error:this.haveErrors()},id:"start-page_block"},t("div",{class:"start-page_main-content"},t("div",{class:{"start-page_errors-block":!0,hidden:!this.wrongImageFormat&&!o.serverError}},t("vviinn-wrong-format",{class:{hidden:!this.wrongImageFormat},handler:()=>this.resetState()}),t("vviinn-server-error",{class:{hidden:!o.serverError},handler:()=>this.resetState()})),!this.haveErrors()&&t(s,null,t("vviinn-teaser",null),t("div",{class:"buttons-group"},this.renderButtons()),this.textSearchShow&&t("vviinn-text-search",{token:this.token,showInWidget:!0,searchQuery:this.searchQuery,apiPath:this.apiPath}))),t("vviinn-privacy-badge",{privacyBadgeText:d.t("privacyBadgeText",{interpolation:{escapeValue:!1}}),class:{invisible:this.haveErrors()}}))),t("vviinn-slide",{class:{"results-page":!0,active:this.isResultSlide()}},this.isResultSlide()&&"image"===o.searchType&&t("div",{class:"source-wrapper image-wrapper"},t("vviinn-image-view",{basicEventData:this.getBasicEventData(),setShowAspectRatioError:this.setShowAspectRatioError,showAspectRatioError:this.showAspectRatioError}),t("div",{class:{"filters-wrapper":!0,hidden:this.showAspectRatioError}},t("div",{class:"filters"},o.filters.map((i=>t("search-filters",{filter:i,basicEventData:this.getBasicEventData()})))))),this.isResultSlide()&&"text"===o.searchType&&t("div",{class:"source-wrapper text-search-wrapper"},t("vviinn-text-search",{token:this.token,showInWidget:!0,searchQuery:this.searchQuery,apiPath:this.apiPath}),t("div",{class:{"filters-wrapper":!0,hidden:this.showAspectRatioError}},t("div",{class:"filters"},o.textSearchFilters.map((i=>t("search-filters",{textSearchFiltersGroup:i,basicEventData:this.getBasicEventData()})))))),this.isResultSlide()&&t("vviinn-results",{token:this.token,uiSessionId:this.uiSessionId,apiPath:this.apiPath,widgetElementId:null!==(e=this.buttonElementId)&&void 0!==e?e:this.widgetElementId,showingInWidget:!0,buttonElementId:this.buttonElementId,imageResolutionWidth:this.imageResolutionWidth,"currency-sign":this.currencySign,locale:this.locale,productDetailsNewTab:this.productDetailsNewTab,productDetailsRedirect:this.productDetailsRedirect,showAspectRatioError:this.showAspectRatioError,trackingDeactivated:this.trackingDeactivated,resetState:this.resetState.bind(this),textSearchQuery:this.searchQuery})))))}get el(){return r(this)}static get watchers(){return{active:["activeWatcher"]}}};I.style=":host{--color-primary-system:#0f62fe;--color-primary-hover-system:#014cda;--color-icons-system:#2f8edf;--product-card-width-system:130px;--spacer:8px;--surface-color-surface-01:#f4f4f4;--text-color-text-primary:#161616;--font-family:Inter, system-ui, sans-serif;--font-size-body:14px;--font-weight-regular:400;--line-height-body:20px;--letter-spacing-default:0px;--background-color-background:#fff;--border-color-border-01:#f4f4f4;--gray-100:#161616;--gray-10:#f4f4f4;--gray-70:#525252;--radius-radius-md:8px;--button-color-button-primary:#000;--text-color-text-inverse:#fff;--text-color-text-secondary:#525252;--button-color-button-disabled:#e0e0e0;--text-color-text-disabled:rgba(22, 22, 22, 0.25);--surface-color-surface-accent:#e0e0e0;--border-color-border-02:#c6c6c6;--surface-color-surface-active:#161616;--surface-color-surface-inactive:#e0e0e0;--stroke-color-stroke-01:#f4f4f4}:host{display:block}.hidden{visibility:hidden;height:1px}vviinn-overlayed-modal.first-screen::part(title),vviinn-overlayed-modal.first-screen::part(secondary-action){visibility:hidden}.start-page{display:grid;grid-template-columns:repeat(2, 1fr);height:640px}#start-page_block{box-sizing:border-box;display:flex;overflow-y:auto;flex-direction:column;justify-content:center;padding:40px 62px}#start-page_block.error{align-content:center}#start-page_block vviinn-text-search{margin-top:12px}.start-page_main-content{flex-grow:1;display:flex;flex-direction:column;justify-content:center}.start-page_errors-block{display:flex;flex-direction:column;justify-content:center;align-items:center;gap:12px}.buttons-group{display:flex;flex-direction:column;gap:12px;margin-top:24px}.action-button{font-family:inherit;display:grid;border:none;cursor:pointer;align-items:center;border-radius:8px;font-size:16px;height:48px;justify-items:center;transition:background 0.1s ease-in-out;color:#525252;background-color:#f4f4f4}.action-button:hover{background-color:#eaeaea}.action-button:first-child{background:var(--color-primary, var(--color-primary-system));border-color:var(--color-primary, var(--color-primary-system));color:white}.action-button:first-child:hover{background:var(--color-primary-hover, var(--color-primary-hover-system));border-color:var(--color-primary-hover, var(--color-primary-hover-system))}.action-button:active{border-color:black}.action-button-content{display:grid;align-items:center;justify-items:start;justify-content:center;grid-template-columns:max-content auto;grid-gap:8px}.action-button .hidden{display:none}.results-page{margin-top:64px;display:grid;grid-template-columns:336px auto;box-sizing:border-box}.results-page>*{padding:24px;box-sizing:border-box}.source-wrapper{display:grid;grid-template-rows:min-content 1fr;min-width:100%}.results-page .source-wrapper.text-search-wrapper{padding:24px 24px 0 24px}.filters-wrapper{margin-top:24px;overflow-x:auto;transform:translateX(-24px);min-width:calc(100% + 48px)}search-filters span{display:none}search-filters::part(filter){background:#f4f4f4;border-radius:8px;box-sizing:border-box;color:#161616;font-size:14px;font-weight:400;line-height:20px}search-filters::part(show-more-filters){display:flex;align-items:center;justify-content:center;cursor:pointer;border:1px solid #f4f4f4;min-width:40px;height:40px;border-radius:100px;box-sizing:border-box;color:#161616}search-filters::part(show-more-filters):hover{background:#eaeaea}search-filters::part(filter active){background:var(--color-primary, var(--color-primary-system));color:white}.results-page:not(.active){display:none}vviinn-preloader{--preloader-size:24px;display:flex}@media (max-width: 1080px){#start-page_block{padding:24px 36px}}@media (max-width: 768px){.start-page{display:flex;flex-direction:column;height:100%}vviinn-overlayed-modal.first-screen::part(secondary-action){visibility:visible}.start-page.active{height:calc(100vh - 64px);height:calc(100svh - 64px)}.start-page:not(.active){overflow:hidden}.results-page{margin-top:0}.results-page>*{box-sizing:border-box;padding:12px 24px 24px}.source-wrapper{grid-template-rows:min-content auto;width:100%;padding:0}.source-wrapper.image-wrapper .filters-wrapper{padding-left:24px;min-width:100%}.image{margin-bottom:8px}.results-page{grid-template-rows:min-content;grid-template-columns:unset}#start-page_block{overflow-y:unset;min-height:-moz-fit-content;min-height:fit-content;padding:24px 20px 20px}}@media (max-width: 480px){.start-page{padding-top:0}.action-button-content{grid-gap:10px}}.visually-hidden{clip:rect(0 0 0 0);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}";export{I as vviinn_vps_widget}
|
|
1
|
+
import{h as t,r as i,c as e,F as s,H as a,g as r}from"./p-1c863deb.js";import{s as o,j as n,d as h,k as c,O as l}from"./p-20f795e5.js";import{i as d,r as p,k as u,l as v,v as g,c as m,m as f}from"./p-4f7d5500.js";import{v as b}from"./p-685b9114.js";import{c as x,s as y,S as w}from"./p-55c453ab.js";import{D as C}from"./p-cc013cd2.js";const k=()=>t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},t("path",{d:"M12 17.5C13.25 17.5 14.3125 17.0625 15.1875 16.1875C16.0625 15.3125 16.5 14.25 16.5 13C16.5 11.75 16.0625 10.6875 15.1875 9.8125C14.3125 8.9375 13.25 8.5 12 8.5C10.75 8.5 9.6875 8.9375 8.8125 9.8125C7.9375 10.6875 7.5 11.75 7.5 13C7.5 14.25 7.9375 15.3125 8.8125 16.1875C9.6875 17.0625 10.75 17.5 12 17.5ZM12 15.5C11.3 15.5 10.7083 15.2583 10.225 14.775C9.74167 14.2917 9.5 13.7 9.5 13C9.5 12.3 9.74167 11.7083 10.225 11.225C10.7083 10.7417 11.3 10.5 12 10.5C12.7 10.5 13.2917 10.7417 13.775 11.225C14.2583 11.7083 14.5 12.3 14.5 13C14.5 13.7 14.2583 14.2917 13.775 14.775C13.2917 15.2583 12.7 15.5 12 15.5ZM4 21C3.45 21 2.97917 20.8042 2.5875 20.4125C2.19583 20.0208 2 19.55 2 19V7C2 6.45 2.19583 5.97917 2.5875 5.5875C2.97917 5.19583 3.45 5 4 5H7.15L8.4 3.65C8.58333 3.45 8.80417 3.29167 9.0625 3.175C9.32083 3.05833 9.59167 3 9.875 3H14.125C14.4083 3 14.6792 3.05833 14.9375 3.175C15.1958 3.29167 15.4167 3.45 15.6 3.65L16.85 5H20C20.55 5 21.0208 5.19583 21.4125 5.5875C21.8042 5.97917 22 6.45 22 7V19C22 19.55 21.8042 20.0208 21.4125 20.4125C21.0208 20.8042 20.55 21 20 21H4Z",fill:"currentColor"})),S=()=>t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},t("path",{d:"M4.5 21C4.1 21 3.75 20.85 3.45 20.55C3.15 20.25 3 19.9 3 19.5V4.5C3 4.1 3.15 3.75 3.45 3.45C3.75 3.15 4.1 3 4.5 3H19.5C19.9 3 20.25 3.15 20.55 3.45C20.85 3.75 21 4.1 21 4.5V19.5C21 19.9 20.85 20.25 20.55 20.55C20.25 20.85 19.9 21 19.5 21H4.5ZM6.65 17.075H17.375C17.525 17.075 17.6333 17.0083 17.7 16.875C17.7667 16.7417 17.7583 16.6083 17.675 16.475L14.75 12.575C14.6667 12.475 14.5667 12.425 14.45 12.425C14.3333 12.425 14.2333 12.475 14.15 12.575L11.15 16.45L9.125 13.675C9.04167 13.575 8.94167 13.525 8.825 13.525C8.70833 13.525 8.60833 13.575 8.525 13.675L6.375 16.475C6.275 16.6083 6.25833 16.7417 6.325 16.875C6.39167 17.0083 6.5 17.075 6.65 17.075Z",fill:"currentColor"})),j={facingMode:"environment",width:{ideal:1920},height:{ideal:1080},frameRate:{ideal:30}};var _=function(t,i){var e={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&i.indexOf(s)<0&&(e[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var a=0;for(s=Object.getOwnPropertySymbols(t);a<s.length;a++)i.indexOf(s[a])<0&&Object.prototype.propertyIsEnumerable.call(t,s[a])&&(e[s[a]]=t[s[a]])}return e};const I=class{constructor(s){i(this,s),this.globalSlotsChanged=e(this,"globalSlotsChanged",7),this.vviinnWidgetLoad=e(this,"vviinnWidgetLoad",7),this.vviinnWidgetOpen=e(this,"vviinnWidgetOpen",7),this.vviinnWidgetClose=e(this,"vviinnWidgetClose",7),this.vviinnImageCrop=e(this,"vviinnImageCrop",7),this.vviinnSelectObject=e(this,"vviinnSelectObject",7),this.vviinnSelectFilter=e(this,"vviinnSelectFilter",7),this.vviinnImageUpload=e(this,"vviinnImageUpload",7),this.vviinnNoResult=e(this,"vviinnNoResult",7),this.imageSource=null,this.cameraAvailable=!1,this.isDesktop=!1,this.videoTrack=null,this.handleVviinnImageUpload=t=>{this.trackInitialSearch(),this.uploadSource=t},this.handleVviinnImageUploadFinished=()=>{this.handleImageSelection(),"upload"===this.mode&&this.showingInButton&&(this.active=!0)},this.handleVviinnNoResult=t=>{"client"===t.reason&&(this.wrongImageFormat=!0)},this.adjustCameraSettings=async()=>{var t;if(!this.videoTrack)return;const i=(null===(t=this.videoTrack)||void 0===t?void 0:t.getCapabilities)?this.videoTrack.getCapabilities():{};if("focusMode"in i)try{await this.videoTrack.applyConstraints({advanced:[{focusMode:"continuous"}]})}catch(t){console.error("Failed to apply focus mode constraints",t)}if("exposureMode"in i)try{await this.videoTrack.applyConstraints({advanced:[{exposureMode:"continuous"}]})}catch(t){console.error("Failed to apply exposure mode constraints",t)}if("whiteBalanceMode"in i)try{await this.videoTrack.applyConstraints({advanced:[{whiteBalanceMode:"continuous"}]})}catch(t){console.error("Failed to apply white balance mode constraints",t)}},this.handleStartCameraClick=async()=>{this.stream?this.resetState():(this.cameraInitializing=!0,setTimeout((async()=>{this.cameraButtonClicked=!0;try{const t=await navigator.mediaDevices.getUserMedia({video:j});this.videoTrack=t.getVideoTracks()[0],this.adjustCameraSettings(),this.stream=t,this.uploadSource="startCamera"}catch(t){console.log("Error accessing camera: ",t.message),this.resetState(),this.cameraInitializing=!1}}),500))},this.setShowAspectRatioError=t=>{this.showAspectRatioError=t},this.setTrackingDeactivated=t=>{"rejected"===t.status&&(this.trackingDeactivated=!0)},this.getBasicEventData=()=>{var t;return{widgetType:"VPS",campaignTypeId:"VPS",campaignTypeName:x.VPS,widgetId:null!==(t=this.buttonElementId)&&void 0!==t?t:this.widgetElementId,widgetVersion:b}},this.LinkText=({href:i,children:e})=>t("a",{href:i||""},e),this.token=void 0,this.active=!0,this.currencySign="€",this.locale="de-DE",this.campaignId="",this.excluded="",this.productDetailsNewTab=!0,this.productDetailsRedirect=!0,this.imageResolutionWidth=250,this.exampleImageSource=C,this.textSearchShow=!1,this.apiPath="https://api.vviinn.com",this.showingInButton=!1,this.buttonElementId=void 0,this.buttonPressed=void 0,this.mode="modal",this.resetVpsButton=void 0,this.slidePosition=0,this.width=0,this.wrongImageFormat=!1,this.trackingDeactivated=!1,this.stream=null,this.cameraInitializing=!1,this.cameraEnabled=!1,this.cameraButtonClicked=!1,this.uploadSource=void 0,this.showAspectRatioError=!1,this.products=[],this.searchQuery=""}initResultEvents(){o.resultLoaded=!1,o.resultViewed=!1}stopStreamTracks(){var t;null===(t=this.stream)||void 0===t||t.getTracks().forEach((t=>{t.stop()}))}isOnboardingSlide(){return 0===this.slidePosition}isResultSlide(){return 1===this.slidePosition}async componentWillLoad(){await d.init({lng:this.locale,fallbackLng:"en",resources:p}),y(this,this.el),this.vviinnWidgetLoad.emit(this.getBasicEventData()),this.trackWidgetEvent("load")}componentDidLoad(){const t=this.el.querySelectorAll("[slot]");this.globalSlotsChanged.emit({slots:Array.from(t),element:this.el})}activeWatcher(t){t?(this.overflow=document.body.style.overflow,document.body.style.overflow="hidden",this.vviinnWidgetOpen.emit(this.getBasicEventData()),"camera"===this.mode&&this.handleStartCameraClick(),this.trackWidgetEvent("open")):(document.body.style.overflow=this.overflow,this.initResultEvents())}textSearchFinishedHandler({detail:t}){this.searchQuery=t.query,this.slidePosition=1}resultLoadHandler(){o.resultLoaded=!0}resultViewHandler(){o.resultViewed=!0}trackCameraEnabled({detail:t}){this.cameraEnabled=t,this.cameraInitializing=!1}trachSearchAreaChanges(){if(this.initResultEvents(),this.trackingDeactivated)return;const t=this.getBasicEventData(),i=_(t,["campaignTypeId"]),e=u(Object.assign({session_id:this.uiSessionId,source:this.imageSource,search_area:"manual-selection"},i));this.trackingApi.trackEvent(e).then(this.setTrackingDeactivated)}trackDetectedObject(){if(this.initResultEvents(),this.trackingDeactivated)return;const t=this.getBasicEventData(),i=_(t,["campaignTypeId"]),e=u(Object.assign({session_id:this.uiSessionId,source:this.imageSource,search_area:"attention-point"},i));this.trackingApi.trackEvent(e).then(this.setTrackingDeactivated)}trackFilter({detail:t}){if(this.initResultEvents(),this.trackingDeactivated)return;const i=this.getBasicEventData(),e=_(i,["campaignTypeId"]),s=v(Object.assign({session_id:this.uiSessionId,source:this.imageSource,kind:t.kind,action:t.action},e));this.trackingApi.trackEvent(s).then(this.setTrackingDeactivated)}trackTextSearchFilterSelected({detail:t}){n(this.searchQuery,this.token,t)}connectedCallback(){this.isDesktop="desktop"===(()=>{const t=navigator.userAgent;return/(tablet|ipad|playbook|silk)|(android(?!.*mobi))/i.test(t)?"tablet":/Mobile|Android|iP(hone|od)|IEMobile|BlackBerry|Kindle|Silk-Accelerated|(hpw|web)OS|Opera M(obi|ini)/.test(t)?"mobile":"desktop"})(),h.apiPath=this.apiPath,h.currencySign=this.currencySign,h.locale=this.locale,this.cameraAvailable=!!navigator.mediaDevices&&!!navigator.mediaDevices.getUserMedia,this.excluded&&(this.excluded=c(this.excluded)),o.token=this.token,o.campaignId=this.campaignId,o.excluded=this.excluded,this.uiSessionId=g(),this.trackingApi=m(this.apiPath,this.token),this.widgetElementId=this.el.id}trackWidgetEvent(t){if(this.trackingDeactivated)return;const i=this.getBasicEventData(),e=_(i,["campaignTypeId","widgetType"]),s=Object.assign({action:t,session_id:this.uiSessionId},e),a=f(s);this.trackingApi.trackEvent(a).then(this.setTrackingDeactivated)}trackInitialSearch(){if(this.trackingDeactivated)return;const t=this.getBasicEventData(),i=_(t,["campaignTypeId","widgetType"]),e=u(Object.assign({session_id:this.uiSessionId,search_area:"full",source:"upload"},i));this.trackingApi.trackEvent(e).then(this.setTrackingDeactivated)}handleImageSelection(){this.imageSource="upload",this.slidePosition=1,this.el.shadowRoot.querySelector("vviinn-overlayed-modal").shadowRoot.querySelector("vviinn-overlay").querySelector("vviinn-modal").shadowRoot.querySelector(".body").scrollTop=0,this.stopStreamTracks()}renderButtons(){const i=o.loading&&"image"===o.searchType&&"startCamera"===this.uploadSource||this.cameraInitializing,e=[this.cameraAvailable&&t("button",{class:"action-button",part:"start-camera_button",onClick:()=>{this.handleStartCameraClick()}},t("vviinn-preloader",{class:{hidden:!i}}),t("span",{class:{"action-button-content":!0,hidden:i}},t("slot",{name:"vviinn-camera-icon"},t(k,null)),t("span",{class:{hidden:!this.cameraEnabled}},t("slot",{name:"vviinn-camera-button-text-stop"},d.t("cameraButtonTextStop"))),t("span",{class:{hidden:this.cameraEnabled}},t("slot",{name:"vviinn-camera-button-text-start"},d.t("cameraButtonTextStart"))))),t("vviinn-image-selector",{class:"action-button",onClick:()=>this.uploadSource="uploadPhoto",onVviinnImageUploadFinished:this.handleVviinnImageUploadFinished,onVviinnImageUpload:()=>{this.handleVviinnImageUpload("uploadPhoto")},onVviinnNoResult:({detail:t})=>this.handleVviinnNoResult(t),resetVpsButton:this.resetVpsButton,basicEventData:this.getBasicEventData(),part:"upload-photo_button",startUpload:this.buttonPressed&&this.showingInButton&&"upload"===this.mode,loading:o.loading&&"image"===o.searchType&&"uploadPhoto"===this.uploadSource},t("span",{slot:"upload-button-text",class:"action-button-content"},t("slot",{name:"vviinn-image-upload-icon"},t(S,null)),t("slot",{name:"vviinn-image-upload-button-text"},t("span",null,d.t("imageUploadButtonText")))))];return this.isDesktop?e.reverse():e}resetState(){this.resetScroll("start-page_block"),this.slidePosition=0,o.resetCategoryLink=void 0,o.activeIonLink=void 0,o.image=l.none,o.imageUrl=l.none,o.imageBounds=l.none,o.searchArea=l.none,o.results=[],o.filters=[],o.textSearchFilters=[],o.detectedObjects=[],o.rectangleSearchForm=void 0,o.loading=!1,o.serverError=!1,o.searchType=void 0,this.searchQuery="",this.wrongImageFormat=!1,this.resetScroll("results-block"),this.stopStreamTracks(),this.initResultEvents(),this.stream=null,this.cameraEnabled=!1,this.cameraButtonClicked=!1,this.cameraInitializing=!1,this.setShowAspectRatioError(!1)}haveErrors(){return this.wrongImageFormat||o.serverError}resetScroll(t,i="auto"){const e=this.el.shadowRoot.getElementById(t);null==e||e.scroll({top:0,left:0,behavior:i})}handleModalClose(){this.active=!1,this.resetState(),["start-page_block","results-block"].forEach((t=>this.resetScroll(t))),this.trackWidgetEvent("close")}render(){var i,e;return t(a,{exportparts:"brand, deeplink, currency, image, image-link, price-amount-sale, price-amount-outdated, price-amount-regular, price-container, price-outdated, price-regular, price-sale, price-prefix, title, product-card, upload-photo_button, show-files_button, start-camera_button, text-search-input, close-button, secondary-action, close-button"},!this.showingInButton&&w("vps"),t("vviinn-overlayed-modal",{class:{"first-screen":this.isOnboardingSlide()},isFirstScreen:this.isOnboardingSlide(),active:this.active,resetState:this.resetState.bind(this),onVviinnWidgetClose:()=>this.handleModalClose(),buttonElementId:null!==(i=this.buttonElementId)&&void 0!==i?i:this.widgetElementId,widgetVersion:b,hideBackButton:"upload"===this.mode&&this.showingInButton||!this.cameraEnabled&&this.isOnboardingSlide(),exportparts:"secondary-action, title, close-button"},t("vviinn-slider",{showBullets:!1,position:this.slidePosition},t("vviinn-slide",{class:{"start-page":!0,"camera-enabled":this.cameraEnabled}},t("vviinn-example-image",{onVviinnImageUploadFinished:this.handleVviinnImageUploadFinished,onVviinnImageUpload:()=>{this.handleVviinnImageUpload("startCamera")},basicEventData:this.getBasicEventData(),srcObject:this.stream,cameraButtonClicked:this.cameraButtonClicked,exampleImageSource:this.exampleImageSource}),t("div",{class:{error:this.haveErrors()},id:"start-page_block"},t("div",{class:"start-page_main-content"},t("div",{class:{"start-page_errors-block":!0,hidden:!this.wrongImageFormat&&!o.serverError}},t("vviinn-wrong-format",{class:{hidden:!this.wrongImageFormat},handler:()=>this.resetState()}),t("vviinn-server-error",{class:{hidden:!o.serverError},handler:()=>this.resetState()})),!this.haveErrors()&&t(s,null,t("vviinn-teaser",null),t("div",{class:"buttons-group"},this.renderButtons()),this.textSearchShow&&t("vviinn-text-search",{token:this.token,showInWidget:!0,searchQuery:this.searchQuery,apiPath:this.apiPath}))),t("vviinn-privacy-badge",{privacyBadgeText:d.t("privacyBadgeText",{interpolation:{escapeValue:!1}}),class:{invisible:this.haveErrors()}}))),t("vviinn-slide",{class:{"results-page":!0,active:this.isResultSlide()}},this.isResultSlide()&&"image"===o.searchType&&t("div",{class:"source-wrapper image-wrapper"},t("vviinn-image-view",{basicEventData:this.getBasicEventData(),setShowAspectRatioError:this.setShowAspectRatioError,showAspectRatioError:this.showAspectRatioError}),t("div",{class:{"filters-wrapper":!0,hidden:this.showAspectRatioError}},t("div",{class:"filters"},o.filters.map((i=>t("search-filters",{filter:i,basicEventData:this.getBasicEventData()})))))),this.isResultSlide()&&"text"===o.searchType&&t("div",{class:"source-wrapper text-search-wrapper"},t("vviinn-text-search",{token:this.token,showInWidget:!0,searchQuery:this.searchQuery,apiPath:this.apiPath}),t("div",{class:{"filters-wrapper":!0,hidden:this.showAspectRatioError}},t("div",{class:"filters"},o.textSearchFilters.map((i=>t("search-filters",{textSearchFiltersGroup:i,basicEventData:this.getBasicEventData()})))))),this.isResultSlide()&&t("vviinn-results",{token:this.token,uiSessionId:this.uiSessionId,apiPath:this.apiPath,widgetElementId:null!==(e=this.buttonElementId)&&void 0!==e?e:this.widgetElementId,showingInWidget:!0,buttonElementId:this.buttonElementId,imageResolutionWidth:this.imageResolutionWidth,"currency-sign":this.currencySign,locale:this.locale,productDetailsNewTab:this.productDetailsNewTab,productDetailsRedirect:this.productDetailsRedirect,showAspectRatioError:this.showAspectRatioError,trackingDeactivated:this.trackingDeactivated,resetState:this.resetState.bind(this),textSearchQuery:this.searchQuery})))))}get el(){return r(this)}static get watchers(){return{active:["activeWatcher"]}}};I.style=":host{--color-primary-system:#0f62fe;--color-primary-hover-system:#014cda;--color-icons-system:#2f8edf;--product-card-width-system:130px;--spacer:8px;--surface-color-surface-01:#f4f4f4;--text-color-text-primary:#161616;--font-family:Inter, system-ui, sans-serif;--font-size-body:14px;--font-weight-regular:400;--line-height-body:20px;--letter-spacing-default:0px;--background-color-background:#fff;--border-color-border-01:#f4f4f4;--gray-100:#161616;--gray-10:#f4f4f4;--gray-70:#525252;--radius-radius-md:8px;--button-color-button-primary:#000;--text-color-text-inverse:#fff;--text-color-text-secondary:#525252;--button-color-button-disabled:#e0e0e0;--text-color-text-disabled:rgba(22, 22, 22, 0.25);--surface-color-surface-accent:#e0e0e0;--border-color-border-02:#c6c6c6;--surface-color-surface-active:#161616;--surface-color-surface-inactive:#e0e0e0;--stroke-color-stroke-01:#f4f4f4}:host{display:block}.hidden{visibility:hidden;height:1px}vviinn-overlayed-modal.first-screen::part(title),vviinn-overlayed-modal.first-screen::part(secondary-action){visibility:hidden}.start-page{display:grid;grid-template-columns:repeat(2, 1fr);height:640px}#start-page_block{box-sizing:border-box;display:flex;overflow-y:auto;flex-direction:column;justify-content:center;padding:40px 62px}#start-page_block.error{align-content:center}#start-page_block vviinn-text-search{margin-top:12px}.start-page_main-content{flex-grow:1;display:flex;flex-direction:column;justify-content:center}.start-page_errors-block{display:flex;flex-direction:column;justify-content:center;align-items:center;gap:12px}.buttons-group{display:flex;flex-direction:column;gap:12px;margin-top:24px}.action-button{font-family:inherit;display:grid;border:none;cursor:pointer;align-items:center;border-radius:8px;font-size:16px;height:48px;justify-items:center;transition:background 0.1s ease-in-out;color:#525252;background-color:#f4f4f4}.action-button:hover{background-color:#eaeaea}.action-button:first-child{background:var(--color-primary, var(--color-primary-system));border-color:var(--color-primary, var(--color-primary-system));color:white}.action-button:first-child:hover{background:var(--color-primary-hover, var(--color-primary-hover-system));border-color:var(--color-primary-hover, var(--color-primary-hover-system))}.action-button:active{border-color:black}.action-button-content{display:grid;align-items:center;justify-items:start;justify-content:center;grid-template-columns:max-content auto;grid-gap:8px}.action-button .hidden{display:none}.results-page{margin-top:64px;display:grid;grid-template-columns:336px auto;box-sizing:border-box}.results-page>*{padding:24px;box-sizing:border-box}.source-wrapper{display:grid;grid-template-rows:min-content 1fr;min-width:100%}.results-page .source-wrapper.text-search-wrapper{padding:24px 24px 0 24px}.filters-wrapper{margin-top:24px;overflow-x:auto;transform:translateX(-24px);min-width:calc(100% + 48px)}search-filters span{display:none}search-filters::part(filter){background:#f4f4f4;border-radius:8px;box-sizing:border-box;color:#161616;font-size:14px;font-weight:400;line-height:20px}search-filters::part(show-more-filters){display:flex;align-items:center;justify-content:center;cursor:pointer;border:1px solid #f4f4f4;min-width:40px;height:40px;border-radius:100px;box-sizing:border-box;color:#161616}search-filters::part(show-more-filters):hover{background:#eaeaea}search-filters::part(filter active){background:var(--color-primary, var(--color-primary-system));color:white}.results-page:not(.active){display:none}vviinn-preloader{--preloader-size:24px;display:flex}@media (max-width: 1080px){#start-page_block{padding:24px 36px}}@media (max-width: 768px){.start-page{display:flex;flex-direction:column;height:100%}vviinn-overlayed-modal.first-screen::part(secondary-action){visibility:visible}.start-page.active{height:calc(100vh - 64px);height:calc(100svh - 64px)}.start-page:not(.active){overflow:hidden}.results-page{margin-top:0}.results-page>*{box-sizing:border-box;padding:12px 24px 24px}.source-wrapper{grid-template-rows:min-content auto;width:100%;padding:0}.source-wrapper.image-wrapper .filters-wrapper{padding-left:24px;min-width:100%}.image{margin-bottom:8px}.results-page{grid-template-rows:min-content;grid-template-columns:unset}#start-page_block{overflow-y:unset;min-height:-moz-fit-content;min-height:fit-content;padding:24px 20px 20px}}@media (max-width: 480px){.start-page{padding-top:0}.action-button-content{grid-gap:10px}}.visually-hidden{clip:rect(0 0 0 0);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}";export{I as vviinn_vps_widget}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as i,c as t,h as s,H as h,g as n}from"./p-1c863deb.js";import{v as o}from"./p-
|
|
1
|
+
import{r as i,c as t,h as s,H as h,g as n}from"./p-1c863deb.js";import{v as o}from"./p-685b9114.js";import{V as e}from"./p-256fddfd.js";const v=class{constructor(s){i(this,s),this.vviinnWidgetLoad=t(this,"vviinnWidgetLoad",7),this.vviinnWidgetOpen=t(this,"vviinnWidgetOpen",7),this.vviinnWidgetClose=t(this,"vviinnWidgetClose",7),this.vviinnProductLoad=t(this,"vviinnProductLoad",7),this.vviinnProductClick=t(this,"vviinnProductClick",7),this.vviinnProductView=t(this,"vviinnProductView",7),this.vviinnResultLoad=t(this,"vviinnResultLoad",7),this.vviinnResultView=t(this,"vviinnResultView",7),this.vviinnNoResult=t(this,"vviinnNoResult",7),this.vviinnAddToBasket=t(this,"vviinnAddToBasket",7),this.sidebar=null,this.sidebarCloseListener=()=>{document.body.removeChild(this.sidebar)},this.token=void 0,this.productId=void 0,this.mode="continuity",this.campaigns="",this.excluded="",this.campaignType="VPR",this.locale="de-DE",this.color="",this.imageWidth=300,this.imageRatio=1,this.cssUrl=null,this.currencySign="€",this.pricePrefix="",this.noResultText="",this.noResultShow=!0,this.gridArrowsDynamic=!1,this.productDetailsNewTab=!1,this.productDetailsRedirect=!0,this.addToBasketShow=!1,this.showFilters=!1,this.setModeDiscounts="set"===this.mode?"5, 10, 15":"",this.updateButtonLocation="topAndItem",this.sidebarTitle="set"===this.mode?"":"Visually similar products",this.modalScrollbar=!1,this.position="bottom",this.sourceImage=null,this.addStyle=!0,this.apiPath="https://api.vviinn.com"}render(){return s(h,{onClick:()=>{this.handleClick()},role:"button",tabindex:"0"},s("vviinn-button",{addStyle:this.addStyle,part:"vviinn-button"},s("slot",null,s(e,null))))}handleClick(){const i=document.createElement("vviinn-recommendations-sidebar");i.sidebarTitle=this.sidebarTitle,i.productId=this.productId,i.token=this.token,i.position=this.position,i.sourceImage=this.sourceImage,i.widgetScrollbar=this.modalScrollbar,i.campaigns=this.campaigns,i.campaignType=this.campaignType,i.color=this.color,i.locale=this.locale,i.mode="right"===this.position?"grid":this.mode,i.imageWidth=this.imageWidth,i.currencySign=this.currencySign,i.pricePrefix=this.pricePrefix,i.apiPath=this.apiPath,i.buttonElementId=this.el.id,i.noResultText=this.noResultText,i.noResultShow=this.noResultShow,i.gridArrowsDynamic=this.gridArrowsDynamic,i.productDetailsNewTab=this.productDetailsNewTab,i.productDetailsRedirect=this.productDetailsRedirect,i.widgetVersion=o,i.showingInButton=!0,i.excluded=this.excluded,i.addToBasketShow=this.addToBasketShow,i.buttonChildren=this.el.children,i.showFilters=this.showFilters,i.cssUrl=this.cssUrl,i.imageRatio=this.imageRatio,i.setModeDiscounts=this.setModeDiscounts,i.updateButtonLocation=this.updateButtonLocation,this.sidebar=i,i.addEventListener("vviinnWidgetClose",this.sidebarCloseListener),document.body.append(this.sidebar)}disconnectedCallback(){this.sidebar&&this.sidebar.removeEventListener("vviinnWidgetClose",this.sidebarCloseListener)}get el(){return n(this)}};v.style=":host{display:block}";export{v as vviinn_vpr_button}
|