vviinn-widgets 2.5.2 → 2.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{app-globals-d15b4c2c.js → app-globals-047a582c.js} +1 -1
- package/dist/cjs/{highlight-box_22.cjs.entry.js → cropper-handler_27.cjs.entry.js} +473 -85
- package/dist/cjs/{customized-slots-0c0d0665.js → customized-slots-cb722e68.js} +1 -1
- package/dist/cjs/{index-0f5516a6.js → index-bd771524.js} +1 -1
- package/dist/cjs/{imageSearch.store-865c23f4.js → index-d07466b9.js} +14707 -11093
- package/dist/cjs/{index-31b9cb7a.js → index-fcafbfe5.js} +1 -1
- package/dist/cjs/loader.cjs.js +3 -3
- package/dist/cjs/{vviinn-carousel_3.cjs.entry.js → vviinn-carousel_2.cjs.entry.js} +35 -208
- package/dist/cjs/vviinn-recommendations-sidebar.cjs.entry.js +5 -3
- package/dist/cjs/vviinn-vpr-button.cjs.entry.js +7 -2
- package/dist/cjs/vviinn-vps-button.cjs.entry.js +4 -4
- package/dist/cjs/vviinn-widgets.cjs.js +3 -3
- package/dist/collection/campaign/VCSCampaignService.js +4 -2
- package/dist/collection/campaign/VPRCampaignService.js +4 -2
- package/dist/collection/components/vviinn-vpr-button/recommendations-sidebar/recommendations-sidebar.js +21 -1
- package/dist/collection/components/vviinn-vpr-button/stories/args.js +6 -0
- package/dist/collection/components/vviinn-vpr-button/stories/vviinn-vpr-button.stories.js +2 -0
- package/dist/collection/components/vviinn-vpr-button/vviinn-vpr-button.js +23 -0
- package/dist/collection/components/vviinn-vpr-widget/stories/args.js +7 -0
- package/dist/collection/components/vviinn-vpr-widget/stories/vviinn-vpr-widget.stories.js +12 -13
- package/dist/collection/components/vviinn-vpr-widget/vviinn-vpr-vidget.js +28 -1
- package/dist/collection/components/vviinn-vps-button/stories/vviinn-vps-button.stories.js +9 -5
- package/dist/collection/components/vviinn-vps-button/vviinn-vps-button.js +18 -1
- package/dist/collection/components/vviinn-vps-widget/stories/vviinn-vps-widget.stories.js +11 -7
- package/dist/collection/components/vviinn-vps-widget/vviinn-vps-widget.js +23 -0
- package/dist/collection/searchSession/searchSession.js +6 -1
- package/dist/collection/store/imageSearch.store.js +2 -7
- package/dist/esm/{app-globals-6f6aa89e.js → app-globals-68b1d848.js} +1 -1
- package/dist/esm/{highlight-box_22.entry.js → cropper-handler_27.entry.js} +404 -21
- package/dist/esm/{customized-slots-6b427dda.js → customized-slots-95a05ceb.js} +1 -1
- package/dist/esm/{imageSearch.store-0ae87235.js → index-33fe5a25.js} +14832 -11234
- package/dist/esm/{index-59f44eaa.js → index-75a1f589.js} +1 -1
- package/dist/esm/{index-ac05c460.js → index-f9df412f.js} +2 -2
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{vviinn-carousel_3.entry.js → vviinn-carousel_2.entry.js} +15 -187
- package/dist/esm/vviinn-recommendations-sidebar.entry.js +5 -3
- package/dist/esm/vviinn-vpr-button.entry.js +7 -2
- package/dist/esm/vviinn-vps-button.entry.js +4 -4
- package/dist/esm/vviinn-widgets.js +3 -3
- package/dist/types/campaign/CampaignService.d.ts +1 -1
- package/dist/types/campaign/VCSCampaignService.d.ts +2 -1
- package/dist/types/campaign/VPRCampaignService.d.ts +2 -1
- package/dist/types/components/vviinn-vpr-button/recommendations-sidebar/recommendations-sidebar.d.ts +2 -0
- package/dist/types/components/vviinn-vpr-button/stories/args.d.ts +6 -0
- package/dist/types/components/vviinn-vpr-button/stories/vviinn-vpr-button.stories.d.ts +6 -0
- package/dist/types/components/vviinn-vpr-button/vviinn-vpr-button.d.ts +2 -0
- package/dist/types/components/vviinn-vpr-widget/stories/args.d.ts +6 -0
- package/dist/types/components/vviinn-vpr-widget/stories/vviinn-vpr-widget.stories.d.ts +6 -0
- package/dist/types/components/vviinn-vpr-widget/vviinn-vpr-vidget.d.ts +3 -0
- package/dist/types/components/vviinn-vps-button/vviinn-vps-button.d.ts +2 -0
- package/dist/types/components/vviinn-vps-widget/vviinn-vps-widget.d.ts +2 -0
- package/dist/types/components.d.ts +40 -0
- package/dist/types/searchSession/searchSession.d.ts +2 -1
- package/dist/types/store/imageSearch.store.d.ts +7 -6
- package/dist/vviinn-widgets/{p-bad1809f.js → p-4e55513e.js} +1 -1
- package/dist/vviinn-widgets/p-5358970c.entry.js +1 -0
- package/{www/build/p-c36546fa.js → dist/vviinn-widgets/p-66015ad7.js} +1 -1
- package/dist/vviinn-widgets/p-669a156c.entry.js +1 -0
- package/dist/vviinn-widgets/p-8080679b.entry.js +1 -0
- package/dist/vviinn-widgets/p-9de1b0e7.js +1 -0
- package/dist/vviinn-widgets/{p-ee46fc83.js → p-b254eee7.js} +1 -1
- package/dist/vviinn-widgets/p-c1cd51ef.entry.js +1 -0
- package/dist/vviinn-widgets/p-e32c30d4.entry.js +1 -0
- package/dist/vviinn-widgets/{p-118ac907.js → p-f6e59cb2.js} +1 -1
- package/dist/vviinn-widgets/vviinn-widgets.esm.js +1 -1
- package/package.json +3 -3
- package/www/build/{p-bad1809f.js → p-4e55513e.js} +1 -1
- package/www/build/p-5358970c.entry.js +1 -0
- package/{dist/vviinn-widgets/p-c36546fa.js → www/build/p-66015ad7.js} +1 -1
- package/www/build/p-669a156c.entry.js +1 -0
- package/www/build/p-8080679b.entry.js +1 -0
- package/www/build/p-9de1b0e7.js +1 -0
- package/www/build/{p-ee46fc83.js → p-b254eee7.js} +1 -1
- package/www/build/p-c1cd51ef.entry.js +1 -0
- package/www/build/p-e32c30d4.entry.js +1 -0
- package/www/build/p-eb8f77e4.js +1 -0
- package/www/build/{p-118ac907.js → p-f6e59cb2.js} +1 -1
- package/www/build/vviinn-widgets.esm.js +1 -1
- package/www/index.html +1 -1
- package/dist/cjs/Handler-176539c8.js +0 -331
- package/dist/cjs/cropper-handler.cjs.entry.js +0 -27
- package/dist/cjs/index-0eb3036a.js +0 -3235
- package/dist/cjs/vviinn-error.cjs.entry.js +0 -19
- package/dist/cjs/vviinn-preloader.cjs.entry.js +0 -26
- package/dist/cjs/vviinn-vps-widget.cjs.entry.js +0 -167
- package/dist/esm/Handler-f9b8735c.js +0 -309
- package/dist/esm/cropper-handler.entry.js +0 -23
- package/dist/esm/index-2e296af4.js +0 -3224
- package/dist/esm/vviinn-error.entry.js +0 -15
- package/dist/esm/vviinn-preloader.entry.js +0 -22
- package/dist/esm/vviinn-vps-widget.entry.js +0 -163
- package/dist/vviinn-widgets/p-11f61564.js +0 -1
- package/dist/vviinn-widgets/p-39fdc5c9.entry.js +0 -1
- package/dist/vviinn-widgets/p-762dc067.entry.js +0 -1
- package/dist/vviinn-widgets/p-7e2f542c.js +0 -1
- package/dist/vviinn-widgets/p-8d56e795.entry.js +0 -1
- package/dist/vviinn-widgets/p-8f955b15.entry.js +0 -1
- package/dist/vviinn-widgets/p-9654fe35.entry.js +0 -1
- package/dist/vviinn-widgets/p-9e5adc42.js +0 -1
- package/dist/vviinn-widgets/p-b3731705.entry.js +0 -1
- package/dist/vviinn-widgets/p-d991330b.entry.js +0 -1
- package/dist/vviinn-widgets/p-da9c933b.entry.js +0 -1
- package/dist/vviinn-widgets/p-f41e25f0.entry.js +0 -1
- package/www/build/p-11f61564.js +0 -1
- package/www/build/p-39fdc5c9.entry.js +0 -1
- package/www/build/p-762dc067.entry.js +0 -1
- package/www/build/p-7e2f542c.js +0 -1
- package/www/build/p-8d56e795.entry.js +0 -1
- package/www/build/p-8f955b15.entry.js +0 -1
- package/www/build/p-9654fe35.entry.js +0 -1
- package/www/build/p-9e5adc42.js +0 -1
- package/www/build/p-b3731705.entry.js +0 -1
- package/www/build/p-cfd998c1.js +0 -1
- package/www/build/p-d991330b.entry.js +0 -1
- package/www/build/p-da9c933b.entry.js +0 -1
- package/www/build/p-f41e25f0.entry.js +0 -1
|
@@ -1,8 +1,41 @@
|
|
|
1
|
-
import { r as registerInstance, h, H as Host, c as createEvent, g as getElement } from './index-
|
|
2
|
-
import { O as Option,
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
1
|
+
import { r as registerInstance, h, H as Host, c as createEvent, g as getElement } from './index-75a1f589.js';
|
|
2
|
+
import { g as getCursorValue, p as pipe, O as Option, s as sequenceToOption, i as imageSearchState, a as pointDiffSemigroup, _ as _function, t as transform, m as move, f as fromMouseEvent, b as makeRectangularSearchRequest, c as fromAlt, d as foldValueObject, e as scaleWithSized, h as center, j as detectedObjectEq, k as toFile, l as processSelectedFile, E as Either, n as match, o as fromImage, q as dimensionsFromImage, r as scaleByLargestSide, S as Semigroup, u as state, N as NonEmptyArray, v as createProductViewVpsEvent, w as createProductClickVpsEvent, x as createSearchEvent, y as createFilterEvent, z as v4, A as createTrackingApi, B as createWidgetVpsEvent, C as isEmpty } from './index-33fe5a25.js';
|
|
3
|
+
import { C as CheckIcon, O as OnboardingCard1Icon, a as OnboardingCard2Icon, b as OnboardingCard3Icon, A as ArrowIcon } from './index-f9df412f.js';
|
|
4
|
+
import { s as slotChangeListener } from './customized-slots-95a05ceb.js';
|
|
5
|
+
|
|
6
|
+
const cropperHandlerCss = ":host{--size:20px;background:transparent;border:4px solid white;box-sizing:content-box;display:block;height:var(--size);touch-action:none;position:absolute;width:var(--size);z-index:4;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}:host(.disabled){opacity:0.25}:host(.nw-resize){border-bottom:none;border-right:none;top:0;left:0}:host(.ne-resize){border-left:none;border-bottom:none;right:0;top:0}:host(.sw-resize){border-right:none;border-top:none;left:0;bottom:0}:host(.se-resize){border-left:none;border-top:none;bottom:0;right:0}";
|
|
7
|
+
|
|
8
|
+
let CropperHandler = class {
|
|
9
|
+
constructor(hostRef) {
|
|
10
|
+
registerInstance(this, hostRef);
|
|
11
|
+
this.disabled = false;
|
|
12
|
+
}
|
|
13
|
+
render() {
|
|
14
|
+
return (h(Host, { part: `handle ${getCursorValue(this.handler.direction)}`, class: {
|
|
15
|
+
disabled: this.disabled,
|
|
16
|
+
[getCursorValue(this.handler.direction)]: true,
|
|
17
|
+
}, style: {
|
|
18
|
+
"--size": "20px",
|
|
19
|
+
cursor: getCursorValue(this.handler.direction),
|
|
20
|
+
}, draggable: false }));
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
CropperHandler.style = cropperHandlerCss;
|
|
24
|
+
|
|
25
|
+
const fromRectangle = (shape, target) => {
|
|
26
|
+
const top = `${shape.y}px`;
|
|
27
|
+
const left = `${shape.x}px`;
|
|
28
|
+
const right = `${target.width - (shape.x + shape.width)}px`;
|
|
29
|
+
const bottom = `${target.height - (shape.y + shape.height)}px`;
|
|
30
|
+
return {
|
|
31
|
+
top,
|
|
32
|
+
right,
|
|
33
|
+
bottom,
|
|
34
|
+
left,
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
const printClip = (clip) => `inset(${clip.top} ${clip.right} ${clip.bottom} ${clip.left})`;
|
|
38
|
+
const getClipValue = (shape, target) => printClip(fromRectangle(shape, target));
|
|
6
39
|
|
|
7
40
|
// -------------------------------------------------------------------------------------
|
|
8
41
|
// -------------------------------------------------------------------------------------
|
|
@@ -24,21 +57,6 @@ var Ord = {
|
|
|
24
57
|
compare: function (first, second) { return (first < second ? -1 : first > second ? 1 : 0); }
|
|
25
58
|
};
|
|
26
59
|
|
|
27
|
-
const fromRectangle = (shape, target) => {
|
|
28
|
-
const top = `${shape.y}px`;
|
|
29
|
-
const left = `${shape.x}px`;
|
|
30
|
-
const right = `${target.width - (shape.x + shape.width)}px`;
|
|
31
|
-
const bottom = `${target.height - (shape.y + shape.height)}px`;
|
|
32
|
-
return {
|
|
33
|
-
top,
|
|
34
|
-
right,
|
|
35
|
-
bottom,
|
|
36
|
-
left,
|
|
37
|
-
};
|
|
38
|
-
};
|
|
39
|
-
const printClip = (clip) => `inset(${clip.top} ${clip.right} ${clip.bottom} ${clip.left})`;
|
|
40
|
-
const getClipValue = (shape, target) => printClip(fromRectangle(shape, target));
|
|
41
|
-
|
|
42
60
|
const highlightBoxCss = ":host{display:grid;position:absolute;box-sizing:border-box;border:none;width:100%;height:100%;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;--size:10px;--x-position:0;--y-position:0}img{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.pointer{position:absolute;width:var(--size);height:var(--size);background:black;border-radius:50%;z-index:2;cursor:pointer;transform:translate(var(--x-position), var(--y-position)) scale(0);-webkit-animation:0.25s linear fadein;animation:0.25s linear fadein;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}.pointer::after{content:\"\";cursor:pointer;border:5px solid black;border-radius:50%;width:var(--size);height:var(--size);display:block;transform:translate(calc(-50% + var(--size) * 0.5), calc(-50% + var(--size) * 0.5));padding:calc(var(--size) * 0.5);opacity:.75}@-webkit-keyframes fadein{from{transform:translate(var(--x-position), var(--y-position)) scale(0)}to{transform:translate(var(--x-position), var(--y-position)) scale(1)}}@keyframes fadein{from{transform:translate(var(--x-position), var(--y-position)) scale(0)}to{transform:translate(var(--x-position), var(--y-position)) scale(1)}}";
|
|
43
61
|
|
|
44
62
|
let HighlightBox = class {
|
|
@@ -293,6 +311,18 @@ let VviinnEmptyResults = class {
|
|
|
293
311
|
};
|
|
294
312
|
VviinnEmptyResults.style = vviinnEmptyResultsCss;
|
|
295
313
|
|
|
314
|
+
const vviinnErrorCss = ":host{background:#F4F4F4;border-radius:8px;display:grid;grid-gap:20px;padding:24px;text-align:center}::slotted(svg){display:grid;align-self:center}::slotted(h4){margin:unset;font-weight:600;font-size:18px;line-height:24px}::slotted(span){font-size:14px;line-height:20px}::slotted(button){-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;background:transparent;color:var(--color-primary, var(--color-primary-system));font-weight:600;font-size:16px;line-height:20px;cursor:pointer}";
|
|
315
|
+
|
|
316
|
+
let VviinnError = class {
|
|
317
|
+
constructor(hostRef) {
|
|
318
|
+
registerInstance(this, hostRef);
|
|
319
|
+
}
|
|
320
|
+
render() {
|
|
321
|
+
return (h(Host, null, h("slot", { name: "icon" }), h("slot", { name: "title" }), h("slot", { name: "text" }), h("slot", { name: "action" })));
|
|
322
|
+
}
|
|
323
|
+
};
|
|
324
|
+
VviinnError.style = vviinnErrorCss;
|
|
325
|
+
|
|
296
326
|
const vviinnExampleImageCss = ":host{display:block;margin-bottom:8px;position:relative}img{width:100%;height:auto;cursor:pointer}.image-preloader{background:rgba(0, 0, 0, 0.25);border-radius:4px;bottom:12px;display:none;padding:4px 6px;pointer-events:none;position:absolute;right:12px;z-index:4}vviinn-preloader{--preloader-size:12px}@media (max-width: 640px){.image-preloader{display:block}}";
|
|
297
327
|
|
|
298
328
|
let VviinnExampleImage = class {
|
|
@@ -535,6 +565,23 @@ let VviinnOverlayedModal = class {
|
|
|
535
565
|
};
|
|
536
566
|
VviinnOverlayedModal.style = vviinnOverlayedModalCss;
|
|
537
567
|
|
|
568
|
+
const vviinnPreloaderCss = ":host{--preloader-size:24px;--preloader-width:calc(var(--preloader-size) / 6);transform-origin:center;-webkit-animation:rotate 3s linear infinite;animation:rotate 3s linear infinite;border:var(--preloader-width) solid white;border-radius:50%;border-top-color:transparent;display:none;outline:0;width:var(--preloader-size);height:var(--preloader-size);box-sizing:border-box}:host(.active){display:flex}@-webkit-keyframes rotate{from{transform:rotate(-360deg)}to{transform:rotate(360deg)}}@keyframes rotate{from{transform:rotate(-360deg)}to{transform:rotate(360deg)}}";
|
|
569
|
+
|
|
570
|
+
let VviinnPreloader = class {
|
|
571
|
+
constructor(hostRef) {
|
|
572
|
+
registerInstance(this, hostRef);
|
|
573
|
+
}
|
|
574
|
+
isActive() {
|
|
575
|
+
return (imageSearchState.loading || imageSearchState.objectDetectionInProgress);
|
|
576
|
+
}
|
|
577
|
+
render() {
|
|
578
|
+
return (h(Host, { class: {
|
|
579
|
+
active: this.isActive(),
|
|
580
|
+
} }));
|
|
581
|
+
}
|
|
582
|
+
};
|
|
583
|
+
VviinnPreloader.style = vviinnPreloaderCss;
|
|
584
|
+
|
|
538
585
|
const vviinnPrivacyBadgeCss = ":host{display:block;background:#F4F4F4;padding:17px}.content{display:grid;grid-template-columns:-webkit-min-content auto;grid-template-columns:min-content auto;grid-gap:9px}.content p{color:#525252;font-size:12px;line-height:16px;margin:unset}";
|
|
539
586
|
|
|
540
587
|
let VviinnPrivacyBadge = class {
|
|
@@ -551,6 +598,182 @@ let VviinnPrivacyBadge = class {
|
|
|
551
598
|
};
|
|
552
599
|
VviinnPrivacyBadge.style = vviinnPrivacyBadgeCss;
|
|
553
600
|
|
|
601
|
+
class GtagAnalytics {
|
|
602
|
+
sendImpression(product) {
|
|
603
|
+
var _a, _b, _c;
|
|
604
|
+
gtag('event', 'view_item_list', {
|
|
605
|
+
items: [
|
|
606
|
+
{
|
|
607
|
+
id: product.productId,
|
|
608
|
+
name: product.title,
|
|
609
|
+
brand: (_a = product.brand) !== null && _a !== void 0 ? _a : '',
|
|
610
|
+
category: (_b = product.productType) !== null && _b !== void 0 ? _b : '',
|
|
611
|
+
list_name: 'VI VPR View',
|
|
612
|
+
price: Math.min(...[product.price.actual, (_c = product.price.sale) !== null && _c !== void 0 ? _c : Infinity])
|
|
613
|
+
}
|
|
614
|
+
]
|
|
615
|
+
});
|
|
616
|
+
return undefined;
|
|
617
|
+
}
|
|
618
|
+
sendClick(product) {
|
|
619
|
+
var _a, _b, _c;
|
|
620
|
+
gtag('event', 'select_content', {
|
|
621
|
+
content_type: 'product',
|
|
622
|
+
items: [
|
|
623
|
+
{
|
|
624
|
+
id: product.productId,
|
|
625
|
+
name: product.title,
|
|
626
|
+
brand: (_a = product.brand) !== null && _a !== void 0 ? _a : '',
|
|
627
|
+
category: (_b = product.productType) !== null && _b !== void 0 ? _b : '',
|
|
628
|
+
list_name: 'VI VPR View',
|
|
629
|
+
price: Math.min(...[product.price.actual, (_c = product.price.sale) !== null && _c !== void 0 ? _c : Infinity])
|
|
630
|
+
}
|
|
631
|
+
]
|
|
632
|
+
});
|
|
633
|
+
return undefined;
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
class GAnalytics {
|
|
638
|
+
constructor() {
|
|
639
|
+
ga('require', 'ec');
|
|
640
|
+
}
|
|
641
|
+
convertProduct(product) {
|
|
642
|
+
var _a, _b, _c;
|
|
643
|
+
return {
|
|
644
|
+
id: product.productId,
|
|
645
|
+
name: product.title,
|
|
646
|
+
brand: (_a = product.brand) !== null && _a !== void 0 ? _a : '',
|
|
647
|
+
category: (_b = product.productType) !== null && _b !== void 0 ? _b : '',
|
|
648
|
+
list: 'VI VPR View',
|
|
649
|
+
price: Math.min(...[product.price.actual, (_c = product.price.sale) !== null && _c !== void 0 ? _c : Infinity])
|
|
650
|
+
};
|
|
651
|
+
}
|
|
652
|
+
sendImpression(product) {
|
|
653
|
+
ga('ec:addImpression', this.convertProduct(product));
|
|
654
|
+
return undefined;
|
|
655
|
+
}
|
|
656
|
+
sendClick(product) {
|
|
657
|
+
var _a, _b, _c;
|
|
658
|
+
ga('ec:addProduct', {
|
|
659
|
+
id: product.productId,
|
|
660
|
+
name: product.title,
|
|
661
|
+
brand: (_a = product.brand) !== null && _a !== void 0 ? _a : '',
|
|
662
|
+
category: (_b = product.productType) !== null && _b !== void 0 ? _b : '',
|
|
663
|
+
price: Math.min(...[product.price.actual, (_c = product.price.sale) !== null && _c !== void 0 ? _c : Infinity])
|
|
664
|
+
});
|
|
665
|
+
ga('ec:setAction', 'click', { list: 'VI VPR View' });
|
|
666
|
+
return undefined;
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
const getGtagAnalytics = () => _function.pipe(Option.fromNullable(window.gtag), Option.map(() => new GtagAnalytics()));
|
|
671
|
+
const getCommonAnalytics = () => _function.pipe(Option.fromNullable(window.ga), Option.map(() => new GAnalytics()));
|
|
672
|
+
const analyticsMonoid = Option.getMonoid(Semigroup.first());
|
|
673
|
+
const getAnalyticsModule = analyticsMonoid.concat(getGtagAnalytics(), getCommonAnalytics());
|
|
674
|
+
|
|
675
|
+
const FIT_EXPR = /fit\/\d+\//;
|
|
676
|
+
const containsFit = (url) => {
|
|
677
|
+
return _function.pipe(url.match(FIT_EXPR), Either.fromNullable(url), Either.map(() => url));
|
|
678
|
+
};
|
|
679
|
+
const processWidth = (url, size) => {
|
|
680
|
+
return _function.pipe(containsFit(url), Either.map((url) => url.replace(FIT_EXPR, `fit/${size}/`)), Either.getOrElse(() => url));
|
|
681
|
+
};
|
|
682
|
+
const Linked = (props, child) => props.deeplink ? (h("a", { class: props.part, part: props.part, href: props.deeplink }, child)) : (child);
|
|
683
|
+
const FormattedPrice = (props) => {
|
|
684
|
+
var _a;
|
|
685
|
+
const locale = props.locale;
|
|
686
|
+
const formattedPrice = new Intl.NumberFormat(locale, {
|
|
687
|
+
minimumFractionDigits: 2,
|
|
688
|
+
}).format(props.price);
|
|
689
|
+
const fullPrice = `${(_a = props.prefix) !== null && _a !== void 0 ? _a : ""} ${formattedPrice} ${props.currency}`;
|
|
690
|
+
return (h("span", { class: "price-amount", part: "price-amount" }, fullPrice));
|
|
691
|
+
};
|
|
692
|
+
const Price = (props) => {
|
|
693
|
+
const priceEl = (h(FormattedPrice, { prefix: props.prefix, currency: props.currency, price: props.price, locale: props.locale }));
|
|
694
|
+
return (h("span", { class: "price-container", part: "price-container" }, props.salePrice ? ([
|
|
695
|
+
h("span", { class: "price-sale", part: "price-sale" },
|
|
696
|
+
h(FormattedPrice, { prefix: props.prefix, currency: props.currency, price: props.salePrice, locale: props.locale })),
|
|
697
|
+
h("span", { class: "price-outdated", part: "price-outdated" }, priceEl),
|
|
698
|
+
]) : (h("span", { class: "price-regular", part: "price-regular" }, priceEl))));
|
|
699
|
+
};
|
|
700
|
+
const Image = (props, onLoadEnd = () => undefined) => (h("picture", null,
|
|
701
|
+
h("img", { loading: props.lazy ? "lazy" : "eager", part: "image", class: "image", width: props.width, height: props.height, src: processWidth(props.src, props.width), alt: props.title, onLoad: onLoadEnd })));
|
|
702
|
+
const ResponsiveImage = (props, onLoadEnd = () => undefined) => (h("picture", null,
|
|
703
|
+
h("img", { loading: props.lazy ? "lazy" : "eager", part: "image", class: "image responsive", src: processWidth(props.src, props.width), alt: props.title, onLoad: onLoadEnd })));
|
|
704
|
+
|
|
705
|
+
const vviinnProductCardCss = ":host{align-items:center;display:flex;flex-direction:column;gap:8px;height:100%}.price-container{display:flex;flex-direction:column}.price-sale,.price-regular{font-style:normal;font-weight:normal;font-size:16px;line-height:24px;color:#161616}.price-outdated{font-style:normal;font-weight:normal;font-size:16px;line-height:24px;color:#757575;text-decoration:line-through}.product-type{word-wrap:anywhere}.image{display:grid;align-content:center;-o-object-position:50% 50%;object-position:50% 50%;-o-object-fit:contain;object-fit:contain;text-align:center;box-sizing:border-box}img.responsive{width:100%;height:auto;aspect-ratio:1}.brand,.type{display:none}.title{-webkit-box-orient:vertical;-webkit-line-clamp:2;color:#161616;display:-webkit-box;font-size:16px;font-style:normal;font-weight:500;line-height:24px;margin-bottom:8px;overflow:hidden}.deeplink{text-decoration:none}.image-link{display:contents}picture{position:relative;width:100%}:host(.dimmed) picture::before{content:\"\";width:100%;height:100%;box-sizing:border-box;background:#f7f7f7;display:block;top:0;left:0;position:absolute;mix-blend-mode:multiply}";
|
|
706
|
+
|
|
707
|
+
let VviinnProductCard = class {
|
|
708
|
+
constructor(hostRef) {
|
|
709
|
+
registerInstance(this, hostRef);
|
|
710
|
+
this.recommendationLoad = createEvent(this, "recommendationLoad", 7);
|
|
711
|
+
this.recommendationView = createEvent(this, "recommendationView", 7);
|
|
712
|
+
this.recommendationClick = createEvent(this, "recommendationClick", 7);
|
|
713
|
+
this.productImageLoaded = createEvent(this, "productImageLoaded", 7);
|
|
714
|
+
this.currency = undefined;
|
|
715
|
+
this.imageRatio = 1;
|
|
716
|
+
this.imageWidth = 200;
|
|
717
|
+
this.locale = undefined;
|
|
718
|
+
this.pricePrefix = undefined;
|
|
719
|
+
this.responsive = false;
|
|
720
|
+
this.dimmedBackground = false;
|
|
721
|
+
/** @internal */
|
|
722
|
+
this.index = 0;
|
|
723
|
+
this.imageLoaded = false;
|
|
724
|
+
this.productData = null;
|
|
725
|
+
this.intersectionObserver = new IntersectionObserver(this.intersectionCallback.bind(this), { threshold: 1.0 });
|
|
726
|
+
}
|
|
727
|
+
connectedCallback() {
|
|
728
|
+
this.productData = {
|
|
729
|
+
product: this.productId,
|
|
730
|
+
rank: this.index,
|
|
731
|
+
};
|
|
732
|
+
}
|
|
733
|
+
intersectionCallback(data) {
|
|
734
|
+
if (data.some((entry) => entry.isIntersecting)) {
|
|
735
|
+
_function.pipe(getAnalyticsModule, Option.map((analytics) => analytics.sendImpression(this.getProduct())));
|
|
736
|
+
this.recommendationView.emit(this.productData);
|
|
737
|
+
this.intersectionObserver.disconnect();
|
|
738
|
+
}
|
|
739
|
+
}
|
|
740
|
+
componentDidLoad() {
|
|
741
|
+
this.recommendationLoad.emit(this.productData);
|
|
742
|
+
this.intersectionObserver.observe(this.el);
|
|
743
|
+
const links = this.el.shadowRoot.querySelectorAll("a");
|
|
744
|
+
links.forEach((link) => link.addEventListener("click", (event) => {
|
|
745
|
+
event.preventDefault();
|
|
746
|
+
event.stopImmediatePropagation();
|
|
747
|
+
this.recommendationClick.emit(this.productData);
|
|
748
|
+
_function.pipe(getAnalyticsModule, Option.match(() => null, (analytics) => analytics.sendClick(this.getProduct())));
|
|
749
|
+
}));
|
|
750
|
+
}
|
|
751
|
+
getProduct() {
|
|
752
|
+
return imageSearchState.results.find((r) => r.productId === this.productId);
|
|
753
|
+
}
|
|
754
|
+
renderImage() {
|
|
755
|
+
const props = {
|
|
756
|
+
width: this.imageWidth,
|
|
757
|
+
height: this.imageWidth * this.imageRatio,
|
|
758
|
+
src: this.image,
|
|
759
|
+
title: this.productTitle,
|
|
760
|
+
lazy: false,
|
|
761
|
+
};
|
|
762
|
+
return this.responsive
|
|
763
|
+
? ResponsiveImage(props, () => this.kek())
|
|
764
|
+
: Image(props, () => this.kek());
|
|
765
|
+
}
|
|
766
|
+
kek() {
|
|
767
|
+
this.productImageLoaded.emit(this.productId);
|
|
768
|
+
}
|
|
769
|
+
render() {
|
|
770
|
+
var _a, _b, _c;
|
|
771
|
+
return (h(Host, { part: "product-card", class: { dimmed: this.dimmedBackground }, exportparts: "brand, currency, deeplink, image, image-link, price-amount, price-container, price-outdated, price-prefix, price-regular, price-sale, title" }, h(Linked, { deeplink: this.deeplink, part: "image-link" }, this.renderImage()), h(Linked, { deeplink: this.deeplink, part: "deeplink" }, h("span", { class: "title", part: "title" }, this.productTitle)), h("span", { class: "brand", part: "brand" }, this.brand), h("span", { class: "type", part: "type" }, this.productType), h(Price, { prefix: (_a = this.pricePrefix) !== null && _a !== void 0 ? _a : state.pricePrefix, currency: (_b = this.currency) !== null && _b !== void 0 ? _b : state.currencySign, price: this.price, salePrice: this.salePrice, locale: (_c = this.locale) !== null && _c !== void 0 ? _c : state.locale })));
|
|
772
|
+
}
|
|
773
|
+
get el() { return getElement(this); }
|
|
774
|
+
};
|
|
775
|
+
VviinnProductCard.style = vviinnProductCardCss;
|
|
776
|
+
|
|
554
777
|
const vviinnServerErrorCss = ":host{display:block}";
|
|
555
778
|
|
|
556
779
|
let VviinnServerError = class {
|
|
@@ -706,6 +929,166 @@ let VviinnTeaser = class {
|
|
|
706
929
|
};
|
|
707
930
|
VviinnTeaser.style = vviinnTeaserCss;
|
|
708
931
|
|
|
932
|
+
const vviinnVpsWidgetCss = ":host{--color-primary-system:#0F62FE;--color-primary-hover-system:#014CDA;--color-icons-system:#2F8EDF;--spacer:8px}: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);min-height:580px}.start-page_block{align-content:start;border-right:1px solid #F4F4F4;display:grid;padding:48px}.start-page_block.error{align-content:center}#onboarding-block{border-right:unset;box-sizing:border-box;grid-gap:24px;overflow-y:auto;position:relative;width:100%}vviinn-teaser{margin-bottom:32px;margin-top:-24px}vviinn-image-selector{align-items:center;background:var(--color-primary, var(--color-primary-system));border-color:var(--color-primary, var(--color-primary-system));border-radius:2px;color:white;display:grid;font-size:16px;font-weight:600;height:56px;justify-items:center;margin-bottom:16px;transition:background 0.1s ease-in-out}vviinn-image-selector:hover{background:var(--color-primary-hover, var(--color-primary-hover-system));border-color:var(--color-primary-hover, var(--color-primary-hover-system))}vviinn-image-selector:active{border-color:black}.upload-button-content{display:grid;align-items:center;justify-items:start;justify-content:center;grid-template-columns:-webkit-max-content auto;grid-template-columns:max-content auto;grid-gap:16px}.results-page{display:grid;grid-template-columns:336px auto;box-sizing:border-box}.results-page>*{padding:24px;box-sizing:border-box}.products{align-content:center;align-items:start;box-sizing:border-box;display:grid;grid-gap:32px 16px;grid-template-columns:repeat(auto-fill, minmax(152px, 1fr));justify-items:center;padding:24px;padding-right:0;position:absolute;width:calc(100% - 16px)}.products.hidden{display:none}vviinn-empty-results{width:280px;align-self:center;justify-self:center}.products-wrapper{display:grid;overflow-y:auto;overflow-x:hidden;padding:unset;position:relative;width:100%}.image-wrapper{border-right:1px solid #F4F4F4;display:grid;grid-template-rows:-webkit-min-content 170px;grid-template-rows:min-content 170px;grid-gap:24px;min-width:100%}.onboarding-wrapper{position:absolute;width:100%;padding:48px;box-sizing:border-box;display:grid;grid-gap:64px;padding-bottom:24px}vviinn-product-card{gap:0;width:100%}vviinn-product-card::part(image){border:1px solid #eaeaea;margin-bottom:8px}vviinn-product-card::part(price-container),vviinn-product-card::part(deeplink),vviinn-product-card::part(title){align-self:start}search-filters span{display:none}search-filters::part(filter){background:#F4F4F4;border-radius:4px;border:1px solid #F4F4F4;box-sizing:border-box;color:#161616;font-size:14px;font-weight:600;line-height:20px}search-filters::part(show-more-filters){border:1px solid #f4f4f4;border-radius:4px;box-sizing:border-box;color:#161616;font-size:14px;font-weight:600;line-height:20px;padding:6px 16px}search-filters::part(show-more-filters):hover{background:#EAEAEA}search-filters::part(filter):hover{background:#EAEAEA}search-filters::part(filter):focus{outline:none;border:1px solid var(--color-primary, var(--color-primary-system))}search-filters::part(filter active){background:rgba(15, 98, 254, 0.15);color:var(--color-primary, var(--color-primary-system))}.filters-wrapper{overflow:auto}.results-page:not(.active){display:none}.nothing-found{display:grid;grid-gap:64px;justify-self:center;padding-top:64px;padding-bottom:16px;position:absolute;width:60%}@media (max-width: 768px){.start-page_block{padding:24px}.onboarding-wrapper{padding:24px}}@media (max-width: 640px){.start-page{grid-template-rows:-webkit-min-content;grid-template-rows:min-content;grid-template-columns:unset;grid-gap:48px;padding:24px 0 48px 0}}@media (max-width: 640px) and (min-width: 415px){.onboarding-wrapper{position:unset}#onboarding-block{overflow:unset}.start-page.active{height:1px;overflow:auto}}@media (max-width: 415px){.results-page>*{box-sizing:border-box;padding:24px}vviinn-slide{padding-bottom:48px}.start-page_block:last-of-type{border-right:unset;overflow-y:unset;position:static;box-sizing:border-box;width:unset}.start-page_block{padding:0 24px}vviinn-teaser{margin-top:24px}.onboarding-wrapper{position:static;width:unset;padding:unset;box-sizing:border-box}.results-page{grid-template-columns:unset;grid-template-rows:-webkit-min-content auto;grid-template-rows:min-content auto}.image{margin-bottom:8px}.image-wrapper{grid-template-rows:-webkit-min-content auto;grid-template-rows:min-content auto;width:100%}.products-wrapper{align-content:start;position:static;overflow-y:unset;width:100%;padding-top:0}.products{position:static;padding:0;width:unset;grid-gap:32px 16px;justify-content:center}.nothing-found{position:static;grid-gap:64px;padding:unset;align-content:start;width:unset}}@media (max-width: 320px){.products{grid-template-columns:unset}}vviinn-wrong-format,vviinn-server-error{width:280px;align-self:center;justify-self:center}";
|
|
933
|
+
|
|
934
|
+
const filterInt = (value) => /^[-+]?(\d+|Infinity)$/.test(value) ? Number(value) : NaN;
|
|
935
|
+
const notEmptyString = (s) => !isEmpty(s);
|
|
936
|
+
const notNan = (n) => !isNaN(n);
|
|
937
|
+
let VviinnVpsWidget = class {
|
|
938
|
+
constructor(hostRef) {
|
|
939
|
+
registerInstance(this, hostRef);
|
|
940
|
+
/** @internal */
|
|
941
|
+
this.apiPath = "https://api.vviinn.com";
|
|
942
|
+
/** When true modal window with widget will be shown */
|
|
943
|
+
this.active = false;
|
|
944
|
+
/** Currency sign will shown after price */
|
|
945
|
+
this.currencySign = "€";
|
|
946
|
+
/** Locale for currency formatting */
|
|
947
|
+
this.locale = "de-DE";
|
|
948
|
+
this.slidePosition = 0;
|
|
949
|
+
this.width = 0;
|
|
950
|
+
this.wrongImageFormat = false;
|
|
951
|
+
this.imageSource = null;
|
|
952
|
+
}
|
|
953
|
+
activeWatcher(value) {
|
|
954
|
+
if (value) {
|
|
955
|
+
this.overflow = document.body.style.overflow;
|
|
956
|
+
document.body.style.overflow = "hidden";
|
|
957
|
+
this.trackOpenEvent();
|
|
958
|
+
}
|
|
959
|
+
else {
|
|
960
|
+
document.body.style.overflow = this.overflow;
|
|
961
|
+
}
|
|
962
|
+
}
|
|
963
|
+
trackRecommendationView({ detail }) {
|
|
964
|
+
const recommendationViewEvent = createProductViewVpsEvent(Object.assign({ session_id: this.uiSessionId }, detail));
|
|
965
|
+
this.trackingApi.trackEvent(recommendationViewEvent);
|
|
966
|
+
}
|
|
967
|
+
trackRecommendationClick({ detail }) {
|
|
968
|
+
const recommendationClickEvent = createProductClickVpsEvent(Object.assign({ sessionId: this.uiSessionId }, detail));
|
|
969
|
+
this.trackingApi.trackEvent(recommendationClickEvent).finally(() => {
|
|
970
|
+
const product = imageSearchState.results.find((r) => r.productId === detail.product);
|
|
971
|
+
if (!product || !product.deeplink)
|
|
972
|
+
return;
|
|
973
|
+
window.location.href = product.deeplink;
|
|
974
|
+
});
|
|
975
|
+
}
|
|
976
|
+
trachSearchAreaChanges() {
|
|
977
|
+
const searchEvent = createSearchEvent({
|
|
978
|
+
session_id: this.uiSessionId,
|
|
979
|
+
source: this.imageSource,
|
|
980
|
+
search_area: "manual-selection",
|
|
981
|
+
});
|
|
982
|
+
this.trackingApi.trackEvent(searchEvent);
|
|
983
|
+
}
|
|
984
|
+
trackDetectedObject() {
|
|
985
|
+
const searchEvent = createSearchEvent({
|
|
986
|
+
session_id: this.uiSessionId,
|
|
987
|
+
source: this.imageSource,
|
|
988
|
+
search_area: "attention-point",
|
|
989
|
+
});
|
|
990
|
+
this.trackingApi.trackEvent(searchEvent);
|
|
991
|
+
}
|
|
992
|
+
trackFilter({ detail }) {
|
|
993
|
+
const searchEvent = createFilterEvent({
|
|
994
|
+
session_id: this.uiSessionId,
|
|
995
|
+
source: this.imageSource,
|
|
996
|
+
kind: "category",
|
|
997
|
+
action: detail,
|
|
998
|
+
});
|
|
999
|
+
this.trackingApi.trackEvent(searchEvent);
|
|
1000
|
+
}
|
|
1001
|
+
componentWillLoad() {
|
|
1002
|
+
slotChangeListener(this, this.el);
|
|
1003
|
+
}
|
|
1004
|
+
connectedCallback() {
|
|
1005
|
+
state.apiPath = this.apiPath;
|
|
1006
|
+
state.currencySign = this.currencySign;
|
|
1007
|
+
state.locale = this.locale;
|
|
1008
|
+
imageSearchState.token = this.token;
|
|
1009
|
+
imageSearchState.campaignId = _function.pipe(this.campaignId, Option.fromNullable, Option.chain(Option.fromPredicate(notEmptyString)), Option.map(filterInt), Option.chain(Option.fromPredicate(notNan)), Option.map((s) => `${s}`));
|
|
1010
|
+
this.uiSessionId = v4();
|
|
1011
|
+
}
|
|
1012
|
+
trackOpenEvent() {
|
|
1013
|
+
this.trackingApi = createTrackingApi(this.apiPath, this.token);
|
|
1014
|
+
const widgetOpenEvent = createWidgetVpsEvent({
|
|
1015
|
+
action: "open",
|
|
1016
|
+
session_id: this.uiSessionId,
|
|
1017
|
+
});
|
|
1018
|
+
this.trackingApi.trackEvent(widgetOpenEvent);
|
|
1019
|
+
}
|
|
1020
|
+
handleImageSelection(source) {
|
|
1021
|
+
this.imageSource = source;
|
|
1022
|
+
this.slidePosition = 1;
|
|
1023
|
+
const root = this.el.shadowRoot.querySelector("vviinn-overlayed-modal");
|
|
1024
|
+
const overlay = root.shadowRoot.querySelector("vviinn-overlay");
|
|
1025
|
+
const modal = overlay.querySelector("vviinn-modal");
|
|
1026
|
+
const modalBody = modal.shadowRoot.querySelector(".body");
|
|
1027
|
+
modalBody.scrollTop = 0;
|
|
1028
|
+
this.trackInitialSearch();
|
|
1029
|
+
}
|
|
1030
|
+
trackInitialSearch() {
|
|
1031
|
+
const searchEvent = createSearchEvent({
|
|
1032
|
+
session_id: this.uiSessionId,
|
|
1033
|
+
source: this.imageSource,
|
|
1034
|
+
search_area: "full",
|
|
1035
|
+
});
|
|
1036
|
+
this.trackingApi.trackEvent(searchEvent);
|
|
1037
|
+
}
|
|
1038
|
+
resetState() {
|
|
1039
|
+
this.resetScroll("onboarding-block");
|
|
1040
|
+
this.slidePosition = 0;
|
|
1041
|
+
imageSearchState.image = Option.none;
|
|
1042
|
+
imageSearchState.imageUrl = Option.none;
|
|
1043
|
+
imageSearchState.imageBounds = Option.none;
|
|
1044
|
+
imageSearchState.searchArea = Option.none;
|
|
1045
|
+
imageSearchState.results = [];
|
|
1046
|
+
imageSearchState.filters = [];
|
|
1047
|
+
imageSearchState.detectedObjects = [];
|
|
1048
|
+
imageSearchState.activeIonLink = undefined;
|
|
1049
|
+
imageSearchState.rectangleSearchForm = undefined;
|
|
1050
|
+
this.resetScroll("results-block");
|
|
1051
|
+
}
|
|
1052
|
+
haveErrors() {
|
|
1053
|
+
return this.wrongImageFormat || imageSearchState.serverError;
|
|
1054
|
+
}
|
|
1055
|
+
resetScroll(elementId, behavior = "auto") {
|
|
1056
|
+
const element = this.el.shadowRoot.getElementById(elementId);
|
|
1057
|
+
element.scroll({ top: 0, left: 0, behavior });
|
|
1058
|
+
}
|
|
1059
|
+
handleModalClose() {
|
|
1060
|
+
this.active = false;
|
|
1061
|
+
this.resetState();
|
|
1062
|
+
const elementsToReset = ["onboarding-block", "results-block"];
|
|
1063
|
+
elementsToReset.forEach((name) => this.resetScroll(name));
|
|
1064
|
+
const widgetOpenEvent = createWidgetVpsEvent({
|
|
1065
|
+
action: "close",
|
|
1066
|
+
session_id: this.uiSessionId,
|
|
1067
|
+
});
|
|
1068
|
+
this.trackingApi.trackEvent(widgetOpenEvent);
|
|
1069
|
+
}
|
|
1070
|
+
render() {
|
|
1071
|
+
return (h(Host, null, h("vviinn-overlayed-modal", { class: { "first-screen": this.slidePosition === 0 }, active: this.active, onSecondaryActionClicked: () => this.resetState(), onModalClosed: () => this.handleModalClose(), exportparts: "secondary-action, title, close-button, example-images" }, h("vviinn-slider", { showBullets: false, position: this.slidePosition }, h("vviinn-slide", { class: { "start-page": true } }, h("div", { class: {
|
|
1072
|
+
error: this.haveErrors(),
|
|
1073
|
+
"start-page_block": true,
|
|
1074
|
+
} }, h("vviinn-wrong-format", { class: { hidden: !this.wrongImageFormat }, onActionClick: () => (this.wrongImageFormat = false) }), h("vviinn-server-error", { class: { hidden: !imageSearchState.serverError }, onActionClick: () => (imageSearchState.serverError = false) }), h("vviinn-teaser", { class: { hidden: this.haveErrors() } }), h("vviinn-image-selector", { class: { hidden: this.haveErrors() }, onImageSelected: () => this.handleImageSelection("upload"), onImageSelectedError: () => (this.wrongImageFormat = true), part: "select-image_button" }, h("span", { slot: "upload-button-text", class: "upload-button-content" }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "29", height: "28", fill: "none" }, h("defs", null), h("path", { fill: "#fff", "fill-rule": "evenodd", d: "M10.271 3.89A.875.875 0 0111 3.5h7c.293 0 .566.146.728.39l1.49 2.235h3.033a2.625 2.625 0 012.625 2.625V21a2.625 2.625 0 01-2.625 2.625H5.75A2.625 2.625 0 013.125 21V8.75A2.625 2.625 0 015.75 6.125h3.031l1.49-2.235zm1.197 1.36l-1.49 2.235a.875.875 0 01-.729.39H5.75a.875.875 0 00-.875.875V21a.875.875 0 00.875.875h17.5a.875.875 0 00.875-.875V8.75a.875.875 0 00-.875-.875h-3.5a.875.875 0 01-.729-.39l-1.49-2.235h-6.063z", "clip-rule": "evenodd" }), h("path", { fill: "#fff", "fill-rule": "evenodd", d: "M14.5 11.375a3.062 3.062 0 100 6.125 3.062 3.062 0 000-6.125zm-4.813 3.063a4.812 4.812 0 119.625 0 4.812 4.812 0 01-9.625 0z", "clip-rule": "evenodd" })), h("slot", { name: "vviinn-image-upload-button-text" }, h("span", null, "Kamera oder Bild ausw\u00E4hlen")))), h("vviinn-privacy-badge", { class: { hidden: this.haveErrors() } })), h("div", { id: "onboarding-block", class: "start-page_block" }, h("div", { class: "onboarding-wrapper" }, h("vviinn-onboarding", null), h("vviinn-example-images", { part: "example-images", onImageSelected: () => this.handleImageSelection("example"), onImageSelectedError: () => this.resetScroll("onboarding-block", "smooth") })))), h("vviinn-slide", { class: { "results-page": true, active: this.slidePosition == 1 } }, h("div", { class: "image-wrapper" }, h("vviinn-image-view", null), h("div", { class: "filters-wrapper" }, h("div", { class: "filters" }, imageSearchState.filters.map((filter) => (h("search-filters", { filter: filter })))))), h("div", { id: "results-block", class: "products-wrapper" }, h("div", { class: {
|
|
1075
|
+
"nothing-found": true,
|
|
1076
|
+
hidden: imageSearchState.results.length > 0,
|
|
1077
|
+
} }, h("vviinn-empty-results", null), h("vviinn-onboarding", null)), h("div", { class: {
|
|
1078
|
+
hidden: imageSearchState.results.length <= 0,
|
|
1079
|
+
products: true,
|
|
1080
|
+
} }, imageSearchState.results.map((p, i) => {
|
|
1081
|
+
var _a;
|
|
1082
|
+
return (h("vviinn-product-card", { hidden: true, productTitle: p.title, productId: p.productId, brand: p.brand, deeplink: p.deeplink, price: p.price.actual, salePrice: p.price.sale, imageWidth: 160, image: (_a = p.image.thumbnail) !== null && _a !== void 0 ? _a : p.image.original, part: "product-card", index: i }));
|
|
1083
|
+
}))))))));
|
|
1084
|
+
}
|
|
1085
|
+
get el() { return getElement(this); }
|
|
1086
|
+
static get watchers() { return {
|
|
1087
|
+
"active": ["activeWatcher"]
|
|
1088
|
+
}; }
|
|
1089
|
+
};
|
|
1090
|
+
VviinnVpsWidget.style = vviinnVpsWidgetCss;
|
|
1091
|
+
|
|
709
1092
|
const vviinnWrongFormatCss = ":host{display:block}";
|
|
710
1093
|
|
|
711
1094
|
let VviinnWrongFormat = class {
|
|
@@ -719,4 +1102,4 @@ let VviinnWrongFormat = class {
|
|
|
719
1102
|
};
|
|
720
1103
|
VviinnWrongFormat.style = vviinnWrongFormatCss;
|
|
721
1104
|
|
|
722
|
-
export { HighlightBox as highlight_box, ImageCropper as image_cropper, SearchFilters as search_filters, VviinnDetectedObject as vviinn_detected_object, VviinnEmptyResults as vviinn_empty_results, VviinnExampleImage as vviinn_example_image, VviinnExampleImages as vviinn_example_images, VviinnImageSelector as vviinn_image_selector, VviinnImageView as vviinn_image_view, VviinnModal as vviinn_modal, VviinnOnboarding as vviinn_onboarding, VviinnOnboardingCard1 as vviinn_onboarding_card_1, VviinnOnboardingCard2 as vviinn_onboarding_card_2, VviinnOnboardingCard3 as vviinn_onboarding_card_3, VviinnOverlay as vviinn_overlay, VviinnOverlayedModal as vviinn_overlayed_modal, VviinnPrivacyBadge as vviinn_privacy_badge, VviinnServerError as vviinn_server_error, VviinnSlide as vviinn_slide, VviinnSlider as vviinn_slider, VviinnTeaser as vviinn_teaser, VviinnWrongFormat as vviinn_wrong_format };
|
|
1105
|
+
export { CropperHandler as cropper_handler, HighlightBox as highlight_box, ImageCropper as image_cropper, SearchFilters as search_filters, VviinnDetectedObject as vviinn_detected_object, VviinnEmptyResults as vviinn_empty_results, VviinnError as vviinn_error, VviinnExampleImage as vviinn_example_image, VviinnExampleImages as vviinn_example_images, VviinnImageSelector as vviinn_image_selector, VviinnImageView as vviinn_image_view, VviinnModal as vviinn_modal, VviinnOnboarding as vviinn_onboarding, VviinnOnboardingCard1 as vviinn_onboarding_card_1, VviinnOnboardingCard2 as vviinn_onboarding_card_2, VviinnOnboardingCard3 as vviinn_onboarding_card_3, VviinnOverlay as vviinn_overlay, VviinnOverlayedModal as vviinn_overlayed_modal, VviinnPreloader as vviinn_preloader, VviinnPrivacyBadge as vviinn_privacy_badge, VviinnProductCard as vviinn_product_card, VviinnServerError as vviinn_server_error, VviinnSlide as vviinn_slide, VviinnSlider as vviinn_slider, VviinnTeaser as vviinn_teaser, VviinnVpsWidget as vviinn_vps_widget, VviinnWrongFormat as vviinn_wrong_format };
|