vviinn-widgets 2.2.1 → 2.2.2
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-d0251be8.js → app-globals-30781f30.js} +1 -1
- package/dist/cjs/cropper-handler.cjs.entry.js +1 -1
- package/dist/cjs/{customized-slots-14b77e4a.js → customized-slots-5d904d8e.js} +1 -1
- package/dist/cjs/highlight-box_22.cjs.entry.js +4 -4
- package/dist/cjs/{imageSearch.store-d9ed1a5b.js → imageSearch.store-128957a4.js} +1 -1
- package/dist/cjs/{index-141137b2.js → index-741a970d.js} +1 -1
- package/dist/cjs/{index-a5e15a0c.js → index-c493804d.js} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/vviinn-carousel_5.cjs.entry.js +3 -3
- package/dist/cjs/vviinn-error.cjs.entry.js +1 -1
- package/dist/cjs/vviinn-preloader.cjs.entry.js +2 -2
- package/dist/cjs/vviinn-vps-button.cjs.entry.js +3 -3
- package/dist/cjs/vviinn-vps-widget.cjs.entry.js +3 -3
- package/dist/cjs/vviinn-widgets.cjs.js +2 -2
- package/dist/esm/{app-globals-b6113170.js → app-globals-345e497d.js} +1 -1
- package/dist/esm/cropper-handler.entry.js +1 -1
- package/dist/esm/{customized-slots-a952fb80.js → customized-slots-a76a8d41.js} +1 -1
- package/dist/esm/highlight-box_22.entry.js +4 -4
- package/dist/esm/{imageSearch.store-4ca31230.js → imageSearch.store-8eab0da1.js} +1 -1
- package/dist/esm/{index-3e85e294.js → index-6fa21e24.js} +1 -1
- package/dist/esm/{index-017f18de.js → index-8cb063df.js} +1 -1
- package/dist/esm/loader.js +2 -2
- package/dist/esm/vviinn-carousel_5.entry.js +3 -3
- package/dist/esm/vviinn-error.entry.js +1 -1
- package/dist/esm/vviinn-preloader.entry.js +2 -2
- package/dist/esm/vviinn-vps-button.entry.js +3 -3
- package/dist/esm/vviinn-vps-widget.entry.js +3 -3
- package/dist/esm/vviinn-widgets.js +2 -2
- package/{www/build/p-eb15116d.entry.js → dist/vviinn-widgets/p-04b06ea9.entry.js} +1 -1
- package/dist/vviinn-widgets/{p-9fee20e7.entry.js → p-400eb62f.entry.js} +1 -1
- package/dist/vviinn-widgets/{p-f00fddbb.js → p-56fc949a.js} +1 -1
- package/{www/build/p-3da18d7f.js → dist/vviinn-widgets/p-59edfbe2.js} +1 -1
- package/{www/build/p-16e49514.js → dist/vviinn-widgets/p-78ccc9eb.js} +1 -1
- package/dist/vviinn-widgets/{p-62a1b042.entry.js → p-9d24f51e.entry.js} +1 -1
- package/dist/vviinn-widgets/{p-68900093.entry.js → p-d085199d.entry.js} +1 -1
- package/dist/vviinn-widgets/{p-db0be4cd.js → p-e1ba8626.js} +1 -1
- package/dist/vviinn-widgets/{p-95e53d99.entry.js → p-e38f4aa2.entry.js} +1 -1
- package/dist/vviinn-widgets/{p-d7894eaf.js → p-e67cae57.js} +1 -1
- package/dist/vviinn-widgets/{p-6c4c240d.entry.js → p-f47e82b2.entry.js} +1 -1
- package/dist/vviinn-widgets/{p-0ed1ef7e.entry.js → p-fb14e3cc.entry.js} +1 -1
- package/dist/vviinn-widgets/vviinn-widgets.esm.js +1 -1
- package/package.json +1 -1
- package/{dist/vviinn-widgets/p-eb15116d.entry.js → www/build/p-04b06ea9.entry.js} +1 -1
- package/www/build/{p-9fee20e7.entry.js → p-400eb62f.entry.js} +1 -1
- package/www/build/{p-f00fddbb.js → p-56fc949a.js} +1 -1
- package/{dist/vviinn-widgets/p-3da18d7f.js → www/build/p-59edfbe2.js} +1 -1
- package/{dist/vviinn-widgets/p-16e49514.js → www/build/p-78ccc9eb.js} +1 -1
- package/www/build/{p-1cc0cdfd.js → p-7e4978d5.js} +1 -1
- package/www/build/{p-62a1b042.entry.js → p-9d24f51e.entry.js} +1 -1
- package/www/build/{p-68900093.entry.js → p-d085199d.entry.js} +1 -1
- package/www/build/{p-db0be4cd.js → p-e1ba8626.js} +1 -1
- package/www/build/{p-95e53d99.entry.js → p-e38f4aa2.entry.js} +1 -1
- package/www/build/{p-d7894eaf.js → p-e67cae57.js} +1 -1
- package/www/build/{p-6c4c240d.entry.js → p-f47e82b2.entry.js} +1 -1
- package/www/build/{p-0ed1ef7e.entry.js → p-fb14e3cc.entry.js} +1 -1
- package/www/build/vviinn-widgets.esm.js +1 -1
- package/www/index.html +1 -1
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-741a970d.js');
|
|
6
6
|
const Handler = require('./Handler-d1a8a86a.js');
|
|
7
7
|
|
|
8
8
|
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}";
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
6
|
-
const imageSearch_store = require('./imageSearch.store-
|
|
5
|
+
const index = require('./index-741a970d.js');
|
|
6
|
+
const imageSearch_store = require('./imageSearch.store-128957a4.js');
|
|
7
7
|
const Handler = require('./Handler-d1a8a86a.js');
|
|
8
|
-
const index$1 = require('./index-
|
|
9
|
-
const customizedSlots = require('./customized-slots-
|
|
8
|
+
const index$1 = require('./index-c493804d.js');
|
|
9
|
+
const customizedSlots = require('./customized-slots-5d904d8e.js');
|
|
10
10
|
|
|
11
11
|
// -------------------------------------------------------------------------------------
|
|
12
12
|
// -------------------------------------------------------------------------------------
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const index = require('./index-
|
|
3
|
+
const index = require('./index-741a970d.js');
|
|
4
4
|
const Handler = require('./Handler-d1a8a86a.js');
|
|
5
5
|
|
|
6
6
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
@@ -21,7 +21,7 @@ function _interopNamespace(e) {
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
const NAMESPACE = 'vviinn-widgets';
|
|
24
|
-
const Env = /* vviinn-widgets */ {"packageVersion":"2.2.
|
|
24
|
+
const Env = /* vviinn-widgets */ {"packageVersion":"2.2.2","packageName":"vviinn-widgets","environment":"local"};
|
|
25
25
|
|
|
26
26
|
let scopeId;
|
|
27
27
|
let hostTagName;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const index = require('./index-
|
|
3
|
+
const index = require('./index-741a970d.js');
|
|
4
4
|
|
|
5
5
|
const ArrowIcon = () => (index.h("svg", { width: "12", height: "20", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
6
6
|
index.h("path", { d: "M0 10 10 0l1.4 1.4L2.8 10l8.6 8.6L10 20 0 10Z" })));
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
6
|
-
const appGlobals = require('./app-globals-
|
|
5
|
+
const index = require('./index-741a970d.js');
|
|
6
|
+
const appGlobals = require('./app-globals-30781f30.js');
|
|
7
7
|
|
|
8
8
|
/*
|
|
9
9
|
Stencil Client Patch Esm v2.9.0 | MIT Licensed | https://stenciljs.com
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
6
|
-
const imageSearch_store = require('./imageSearch.store-
|
|
7
|
-
const index$1 = require('./index-
|
|
5
|
+
const index = require('./index-741a970d.js');
|
|
6
|
+
const imageSearch_store = require('./imageSearch.store-128957a4.js');
|
|
7
|
+
const index$1 = require('./index-c493804d.js');
|
|
8
8
|
const Handler = require('./Handler-d1a8a86a.js');
|
|
9
9
|
|
|
10
10
|
const vviinnCarouselCss = ":host{--vviinn-progressbar-width:0;--vviinn-carousel-item-width:150px;--vviinn-carousel-columns-internal:var(--vviinn-carousel-columns, 4);--vviinn-carousel-image-width-system:140px}.body{display:flex;position:relative;width:var(--vviinn-carousel-content-width);flex-direction:column}.content-wrapper *{box-sizing:border-box}.content-wrapper{overflow-y:hidden;overflow-x:auto;flex-grow:1}.bullets{margin-top:16px;display:flex;flex-direction:row;grid-gap:24px;justify-content:center}.bullet{width:10px;height:10px;background:#E0E0E0;border-radius:50%;cursor:pointer}.bullet.active{background:#161616}.content:not(.show-scrollbar),.content.grid{scrollbar-color:#fff0 #fff0}.content:not(.show-scrollbar)::-webkit-scrollbar,.content.grid::-webkit-scrollbar{opacity:0}.content{display:flex;flex-direction:row;grid-gap:8px;-ms-scroll-snap-type:x mandatory;scroll-snap-type:x mandatory;overflow-y:hidden;overflow-x:auto;flex-grow:1;padding-bottom:16px}.content.left>*{scroll-snap-align:start}.content.right>*{scroll-snap-align:end}:host(.continuity) button{border-radius:2px}:host(.grid) button{border-radius:50%}button{align-items:center;background-color:white;border:none;box-shadow:0px 2px 6px rgba(0, 0, 0, 0.15);cursor:pointer;display:grid;height:40px;justify-items:center;position:absolute;top:calc(50% - 20px);width:40px;z-index:1;padding:0;margin:0}button.prev svg{transform:rotate(180deg);margin-left:-5px}.prev{left:0}.next{right:0}.items-group{display:grid;grid-gap:16px;grid-template-columns:repeat(var(--vviinn-carousel-columns-internal), 1fr);min-width:100%}vviinn-product-card::part(price-container){text-align:center}:host(.classic) vviinn-product-card::part(title),:host(.classic) vviinn-product-card::part(brand),:host(.classic) vviinn-product-card::part(type){text-align:center}@media (max-width: 480px){:host(.modern) button{display:none}.items-group{grid-template-columns:repeat(2, 1fr)}}";
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
5
|
+
const index = require('./index-741a970d.js');
|
|
6
6
|
|
|
7
7
|
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}";
|
|
8
8
|
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
6
|
-
const imageSearch_store = require('./imageSearch.store-
|
|
5
|
+
const index = require('./index-741a970d.js');
|
|
6
|
+
const imageSearch_store = require('./imageSearch.store-128957a4.js');
|
|
7
7
|
require('./Handler-d1a8a86a.js');
|
|
8
8
|
|
|
9
9
|
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)}}";
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
6
|
-
const index$1 = require('./index-
|
|
7
|
-
const customizedSlots = require('./customized-slots-
|
|
5
|
+
const index = require('./index-741a970d.js');
|
|
6
|
+
const index$1 = require('./index-c493804d.js');
|
|
7
|
+
const customizedSlots = require('./customized-slots-5d904d8e.js');
|
|
8
8
|
|
|
9
9
|
const vviinnVpsButtonCss = "";
|
|
10
10
|
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
const index = require('./index-
|
|
6
|
-
const imageSearch_store = require('./imageSearch.store-
|
|
7
|
-
const customizedSlots = require('./customized-slots-
|
|
5
|
+
const index = require('./index-741a970d.js');
|
|
6
|
+
const imageSearch_store = require('./imageSearch.store-128957a4.js');
|
|
7
|
+
const customizedSlots = require('./customized-slots-5d904d8e.js');
|
|
8
8
|
require('./Handler-d1a8a86a.js');
|
|
9
9
|
|
|
10
10
|
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}";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const index = require('./index-
|
|
4
|
-
const appGlobals = require('./app-globals-
|
|
3
|
+
const index = require('./index-741a970d.js');
|
|
4
|
+
const appGlobals = require('./app-globals-30781f30.js');
|
|
5
5
|
|
|
6
6
|
/*
|
|
7
7
|
Stencil Client Patch Browser v2.9.0 | MIT Licensed | https://stenciljs.com
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance, h, H as Host } from './index-
|
|
1
|
+
import { r as registerInstance, h, H as Host } from './index-6fa21e24.js';
|
|
2
2
|
import { q as getCursorValue } from './Handler-639a4cb3.js';
|
|
3
3
|
|
|
4
4
|
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}";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { r as registerInstance, h, H as Host, g as getElement, c as createEvent } from './index-
|
|
2
|
-
import { O as Option, h as sequenceToOption, i as imageSearchState, a as _function, t as transform, j as move, k as makeRectangularSearchRequest, l as fromAlt, n as foldValueObject, o as scaleWithSized, p as center, q as detectedObjectEq, r as toFile, u as processSelectedFile, E as Either, v as match, w as fromImage, x as dimensionsFromImage, y as scaleByLargestSide, N as NonEmptyArray } from './imageSearch.store-
|
|
1
|
+
import { r as registerInstance, h, H as Host, g as getElement, c as createEvent } from './index-6fa21e24.js';
|
|
2
|
+
import { O as Option, h as sequenceToOption, i as imageSearchState, a as _function, t as transform, j as move, k as makeRectangularSearchRequest, l as fromAlt, n as foldValueObject, o as scaleWithSized, p as center, q as detectedObjectEq, r as toFile, u as processSelectedFile, E as Either, v as match, w as fromImage, x as dimensionsFromImage, y as scaleByLargestSide, N as NonEmptyArray } from './imageSearch.store-8eab0da1.js';
|
|
3
3
|
import { p as pipe, m as pointDiffSemigroup, o as fromMouseEvent } from './Handler-639a4cb3.js';
|
|
4
|
-
import { c as CheckIcon, O as OnboardingCard1Icon, d as OnboardingCard2Icon, e as OnboardingCard3Icon, A as ArrowIcon } from './index-
|
|
5
|
-
import { s as slotChangeListener } from './customized-slots-
|
|
4
|
+
import { c as CheckIcon, O as OnboardingCard1Icon, d as OnboardingCard2Icon, e as OnboardingCard3Icon, A as ArrowIcon } from './index-8cb063df.js';
|
|
5
|
+
import { s as slotChangeListener } from './customized-slots-a76a8d41.js';
|
|
6
6
|
|
|
7
7
|
// -------------------------------------------------------------------------------------
|
|
8
8
|
// -------------------------------------------------------------------------------------
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as getRenderingRef, f as forceUpdate } from './index-
|
|
1
|
+
import { a as getRenderingRef, f as forceUpdate } from './index-6fa21e24.js';
|
|
2
2
|
import { t as tuple, i as isNone$1, l as left$1, r as right$1, a as isLeft$1, b as identity, p as pipe, n as none$1, s as some$1, f as first, c as flow, d as struct, e as last, g as pointSumSemigroup, H as HandlerDirection, h as fromRectangle, j as isSome, k as fromRectangle$1 } from './Handler-639a4cb3.js';
|
|
3
3
|
|
|
4
4
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const NAMESPACE = 'vviinn-widgets';
|
|
2
|
-
const Env = /* vviinn-widgets */ {"packageVersion":"2.2.
|
|
2
|
+
const Env = /* vviinn-widgets */ {"packageVersion":"2.2.2","packageName":"vviinn-widgets","environment":"local"};
|
|
3
3
|
|
|
4
4
|
let scopeId;
|
|
5
5
|
let hostTagName;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { h } from './index-
|
|
1
|
+
import { h } from './index-6fa21e24.js';
|
|
2
2
|
|
|
3
3
|
const ArrowIcon = () => (h("svg", { width: "12", height: "20", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
4
4
|
h("path", { d: "M0 10 10 0l1.4 1.4L2.8 10l8.6 8.6L10 20 0 10Z" })));
|
package/dist/esm/loader.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { p as promiseResolve, b as bootstrapLazy } from './index-
|
|
2
|
-
import { g as globalScripts } from './app-globals-
|
|
1
|
+
import { p as promiseResolve, b as bootstrapLazy } from './index-6fa21e24.js';
|
|
2
|
+
import { g as globalScripts } from './app-globals-345e497d.js';
|
|
3
3
|
|
|
4
4
|
/*
|
|
5
5
|
Stencil Client Patch Esm v2.9.0 | MIT Licensed | https://stenciljs.com
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { r as registerInstance, h, H as Host, g as getElement, c as createEvent } from './index-
|
|
2
|
-
import { _ as _Array, O as Option, S as Semigroup, a as _function, E as Either, i as imageSearchState, s as state, c as chainW, m as makeRequest, f as fromEither, g as getApiPath, b as createInitGetRequest, d as sequenceT, A as Apply, e as state$1, T as TaskEither } from './imageSearch.store-
|
|
3
|
-
import { C as ChevronIcon, a as CrossIcon, V as VisualSearchIcon } from './index-
|
|
1
|
+
import { r as registerInstance, h, H as Host, g as getElement, c as createEvent } from './index-6fa21e24.js';
|
|
2
|
+
import { _ as _Array, O as Option, S as Semigroup, a as _function, E as Either, i as imageSearchState, s as state, c as chainW, m as makeRequest, f as fromEither, g as getApiPath, b as createInitGetRequest, d as sequenceT, A as Apply, e as state$1, T as TaskEither } from './imageSearch.store-8eab0da1.js';
|
|
3
|
+
import { C as ChevronIcon, a as CrossIcon, V as VisualSearchIcon } from './index-8cb063df.js';
|
|
4
4
|
import { p as pipe } from './Handler-639a4cb3.js';
|
|
5
5
|
|
|
6
6
|
const vviinnCarouselCss = ":host{--vviinn-progressbar-width:0;--vviinn-carousel-item-width:150px;--vviinn-carousel-columns-internal:var(--vviinn-carousel-columns, 4);--vviinn-carousel-image-width-system:140px}.body{display:flex;position:relative;width:var(--vviinn-carousel-content-width);flex-direction:column}.content-wrapper *{box-sizing:border-box}.content-wrapper{overflow-y:hidden;overflow-x:auto;flex-grow:1}.bullets{margin-top:16px;display:flex;flex-direction:row;grid-gap:24px;justify-content:center}.bullet{width:10px;height:10px;background:#E0E0E0;border-radius:50%;cursor:pointer}.bullet.active{background:#161616}.content:not(.show-scrollbar),.content.grid{scrollbar-color:#fff0 #fff0}.content:not(.show-scrollbar)::-webkit-scrollbar,.content.grid::-webkit-scrollbar{opacity:0}.content{display:flex;flex-direction:row;grid-gap:8px;-ms-scroll-snap-type:x mandatory;scroll-snap-type:x mandatory;overflow-y:hidden;overflow-x:auto;flex-grow:1;padding-bottom:16px}.content.left>*{scroll-snap-align:start}.content.right>*{scroll-snap-align:end}:host(.continuity) button{border-radius:2px}:host(.grid) button{border-radius:50%}button{align-items:center;background-color:white;border:none;box-shadow:0px 2px 6px rgba(0, 0, 0, 0.15);cursor:pointer;display:grid;height:40px;justify-items:center;position:absolute;top:calc(50% - 20px);width:40px;z-index:1;padding:0;margin:0}button.prev svg{transform:rotate(180deg);margin-left:-5px}.prev{left:0}.next{right:0}.items-group{display:grid;grid-gap:16px;grid-template-columns:repeat(var(--vviinn-carousel-columns-internal), 1fr);min-width:100%}vviinn-product-card::part(price-container){text-align:center}:host(.classic) vviinn-product-card::part(title),:host(.classic) vviinn-product-card::part(brand),:host(.classic) vviinn-product-card::part(type){text-align:center}@media (max-width: 480px){:host(.modern) button{display:none}.items-group{grid-template-columns:repeat(2, 1fr)}}";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance, h, H as Host } from './index-
|
|
1
|
+
import { r as registerInstance, h, H as Host } from './index-6fa21e24.js';
|
|
2
2
|
|
|
3
3
|
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}";
|
|
4
4
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { r as registerInstance, h, H as Host } from './index-
|
|
2
|
-
import { i as imageSearchState } from './imageSearch.store-
|
|
1
|
+
import { r as registerInstance, h, H as Host } from './index-6fa21e24.js';
|
|
2
|
+
import { i as imageSearchState } from './imageSearch.store-8eab0da1.js';
|
|
3
3
|
import './Handler-639a4cb3.js';
|
|
4
4
|
|
|
5
5
|
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)}}";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-
|
|
2
|
-
import { b as CameraIcon } from './index-
|
|
3
|
-
import { S as SlotSkeleton } from './customized-slots-
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-6fa21e24.js';
|
|
2
|
+
import { b as CameraIcon } from './index-8cb063df.js';
|
|
3
|
+
import { S as SlotSkeleton } from './customized-slots-a76a8d41.js';
|
|
4
4
|
|
|
5
5
|
const vviinnVpsButtonCss = "";
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { r as registerInstance, h, H as Host, g as getElement } from './index-
|
|
2
|
-
import { e as state, i as imageSearchState, O as Option } from './imageSearch.store-
|
|
3
|
-
import { s as slotChangeListener } from './customized-slots-
|
|
1
|
+
import { r as registerInstance, h, H as Host, g as getElement } from './index-6fa21e24.js';
|
|
2
|
+
import { e as state, i as imageSearchState, O as Option } from './imageSearch.store-8eab0da1.js';
|
|
3
|
+
import { s as slotChangeListener } from './customized-slots-a76a8d41.js';
|
|
4
4
|
import './Handler-639a4cb3.js';
|
|
5
5
|
|
|
6
6
|
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}";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { p as promiseResolve, b as bootstrapLazy } from './index-
|
|
2
|
-
import { g as globalScripts } from './app-globals-
|
|
1
|
+
import { p as promiseResolve, b as bootstrapLazy } from './index-6fa21e24.js';
|
|
2
|
+
import { g as globalScripts } from './app-globals-345e497d.js';
|
|
3
3
|
|
|
4
4
|
/*
|
|
5
5
|
Stencil Client Patch Browser v2.9.0 | MIT Licensed | https://stenciljs.com
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,h as i,H as e,g as r,c as n}from"./p-db0be4cd.js";import{_ as s,O as o,S as a,a as l,E as d,i as c,s as h,c as u,m as p,f as m,g,b as v,d as b,A as f,e as w,T as x}from"./p-3da18d7f.js";import{C as y,a as k,V as C}from"./p-f00fddbb.js";import{p as _}from"./p-f582db5c.js";let R=class{constructor(i){t(this,i),this.moveDirection="right",this.contentGroups=[],this.activeContentGroup=0,this.mode="continuity",this.imageWidth=140,this.showScroll=!0,this.recommendations=[],this.columns=0,this.resizeObserver=new ResizeObserver((()=>this.handleResize())),this.mutationObserver=new MutationObserver((()=>this.cloneSlottedContent()))}connectedCallback(){this.setItemWidth()}disconnectedCallback(){this.resizeObserver.disconnect()}componentDidLoad(){this.setWidth(),this.processScrollbarWidth(),this.columns=this.getColumnsNumber();const t=this.el.querySelector(".content");this.mutationObserver.observe(t,{subtree:!0,childList:!0}),this.resizeObserver.observe(this.getHostParent())}getItemWidthFromDocument(){return parseInt(getComputedStyle(document.body).getPropertyValue("--vviinn-carousel-image-width"))}setItemWidth(){const t=this.getItemWidthFromDocument(),i=isNaN(t)?this.imageWidth:t;this.el.style.setProperty("--vviinn-carousel-image-width",`${i}px`)}getContentClassMap(){return{content:!0,[this.moveDirection]:!0,[this.mode]:!0,"show-scrollbar":this.showScroll}}handleResize(){this.setWidth(),this.processScrollbarWidth(),this.setItemWidth();const t=this.getColumnsNumber();t!==this.columns&&(this.columns=t)}calculateMoveStep(){const t=this.getContent().map((t=>t.getBoundingClientRect().width));return t.reduce(((t,i)=>t+i),0)/t.length}getHostParent(){return this.el.parentNode.host.parentElement}setWidth(){const t=this.getHostParent();if(!t)return;const i=getComputedStyle(t),e=t.getBoundingClientRect().width-(parseInt(i["padding-right"])+parseInt(i["padding-left"]));this.el.style.setProperty("--vviinn-carousel-content-width",`${e}px`)}getParent(){return this.el.parentNode.host.parentElement}cloneSlottedContent(){this.setWidth()}getActiveGroupIndex(){var t,i;if(!(null===(i=null===(t=this.getContentNode())||void 0===t?void 0:t.getBoundingClientRect())||void 0===i?void 0:i.left))return 0;const e=this.getContentGroups().map((t=>t.getBoundingClientRect().left)).map(((t,i)=>[t,i])).filter((t=>t[0]>=0));return e.length>0?e[0][1]:0}getContentNode(){return this.el.querySelector(".content")}getContent(){const t=this.getContentNode().children;return Array.from(t).map((t=>t))}getColumnsNumber(){const t=getComputedStyle(this.el).getPropertyValue("--vviinn-carousel-columns-internal");return parseInt(t)}getContentGroups(){return Array.from(this.el.querySelectorAll(".items-group"))}showNext(){this.moveDirection="right";const t=this.getContentNode();requestAnimationFrame((()=>{t.scrollTo({top:0,left:t.scrollLeft+this.calculateMoveStep(),behavior:"smooth"})}))}showPrev(){this.moveDirection="left";const t=this.getContentNode();requestAnimationFrame((()=>{t.scrollTo({top:0,left:t.scrollLeft-this.calculateMoveStep(),behavior:"smooth"})}))}scroll(t){const i=this.getContentNode();requestAnimationFrame((()=>{i.scrollTo({top:0,left:this.calculateMoveStep()*t,behavior:"smooth"})}))}processScrollbarWidth(){const t=this.getContentNode();this.el.style.setProperty("--vviinn-progressbar-width",t.clientWidth*((t.scrollLeft+t.clientWidth)/t.scrollWidth)+"px"),this.activeContentGroup=this.getActiveGroupIndex()}showBullets(){return"grid"===this.mode&&this.showScroll}showScrollbar(){return"continuity"===this.mode&&this.showScroll}getClassMap(){return{[this.mode]:!0,"show-scrollbar":this.showScrollbar()}}renderRecommendation(t){return i("vviinn-product-card",{part:"product-part",productId:t.productId,productTitle:t.title,deeplink:t.deeplink,image:t.image.thumbnail,brand:t.brand,imageWidth:this.imageWidth,imageRatio:1,price:t.price.actual,salePrice:t.price.sale,responsive:"grid"===this.mode,dimmedBackground:"continuity"===this.mode})}renderRecommendationGroup(t){return i("div",{class:"items-group"},t)}renderRecommendationGroups(t){return t.map((t=>this.renderRecommendationGroup(t)))}renderRecommendations(){return"grid"===this.mode?this.renderGrid():this.renderRecommendationsElements()}renderRecommendationsElements(){return this.recommendations.map((t=>this.renderRecommendation(t)))}renderGrid(){const t=this.renderRecommendationsElements(),i=s.chunksOf(this.getColumnsNumber())(t);return this.renderRecommendationGroups(i)}renderBullets(){const t=Math.ceil(this.recommendations.length/this.getColumnsNumber());return Array.from(Array(t).keys()).map((t=>i("div",{class:{bullet:!0,active:this.activeContentGroup===t},onClick:()=>this.scroll(t)})))}render(){return i(e,{class:this.getClassMap()},i("div",{class:Object.assign({body:!0},this.getClassMap())},i("button",{class:"prev",onClick:()=>this.showPrev()},i(y,null)),i("div",{class:this.getContentClassMap(),onScroll:()=>this.processScrollbarWidth()},this.renderRecommendations()),i("button",{class:"next",onClick:()=>this.showNext()},i(y,null))),this.showBullets()?i("div",{class:"bullets"},this.renderBullets()):"")}get el(){return r(this)}};R.style=":host{--vviinn-progressbar-width:0;--vviinn-carousel-item-width:150px;--vviinn-carousel-columns-internal:var(--vviinn-carousel-columns, 4);--vviinn-carousel-image-width-system:140px}.body{display:flex;position:relative;width:var(--vviinn-carousel-content-width);flex-direction:column}.content-wrapper *{box-sizing:border-box}.content-wrapper{overflow-y:hidden;overflow-x:auto;flex-grow:1}.bullets{margin-top:16px;display:flex;flex-direction:row;grid-gap:24px;justify-content:center}.bullet{width:10px;height:10px;background:#E0E0E0;border-radius:50%;cursor:pointer}.bullet.active{background:#161616}.content:not(.show-scrollbar),.content.grid{scrollbar-color:#fff0 #fff0}.content:not(.show-scrollbar)::-webkit-scrollbar,.content.grid::-webkit-scrollbar{opacity:0}.content{display:flex;flex-direction:row;grid-gap:8px;-ms-scroll-snap-type:x mandatory;scroll-snap-type:x mandatory;overflow-y:hidden;overflow-x:auto;flex-grow:1;padding-bottom:16px}.content.left>*{scroll-snap-align:start}.content.right>*{scroll-snap-align:end}:host(.continuity) button{border-radius:2px}:host(.grid) button{border-radius:50%}button{align-items:center;background-color:white;border:none;box-shadow:0px 2px 6px rgba(0, 0, 0, 0.15);cursor:pointer;display:grid;height:40px;justify-items:center;position:absolute;top:calc(50% - 20px);width:40px;z-index:1;padding:0;margin:0}button.prev svg{transform:rotate(180deg);margin-left:-5px}.prev{left:0}.next{right:0}.items-group{display:grid;grid-gap:16px;grid-template-columns:repeat(var(--vviinn-carousel-columns-internal), 1fr);min-width:100%}vviinn-product-card::part(price-container){text-align:center}:host(.classic) vviinn-product-card::part(title),:host(.classic) vviinn-product-card::part(brand),:host(.classic) vviinn-product-card::part(type){text-align:center}@media (max-width: 480px){:host(.modern) button{display:none}.items-group{grid-template-columns:repeat(2, 1fr)}}";class I{sendImpression(t){var i,e,r;gtag("event","view_item_list",{items:[{id:t.productId,name:t.title,brand:null!==(i=t.brand)&&void 0!==i?i:"",category:null!==(e=t.productType)&&void 0!==e?e:"",list_name:"VI VPR View",price:Math.min(t.price.actual,null!==(r=t.price.sale)&&void 0!==r?r:1/0)}]})}sendClick(t){var i,e,r;gtag("event","select_content",{content_type:"product",items:[{id:t.productId,name:t.title,brand:null!==(i=t.brand)&&void 0!==i?i:"",category:null!==(e=t.productType)&&void 0!==e?e:"",list_name:"VI VPR View",price:Math.min(t.price.actual,null!==(r=t.price.sale)&&void 0!==r?r:1/0)}]})}}class S{constructor(){ga("require","ec")}convertProduct(t){var i,e,r;return{id:t.productId,name:t.title,brand:null!==(i=t.brand)&&void 0!==i?i:"",category:null!==(e=t.productType)&&void 0!==e?e:"",list:"VI VPR View",price:Math.min(t.price.actual,null!==(r=t.price.sale)&&void 0!==r?r:1/0)}}sendImpression(t){ga("ec:addImpression",this.convertProduct(t))}sendClick(t){var i,e,r;ga("ec:addProduct",{id:t.productId,name:t.title,brand:null!==(i=t.brand)&&void 0!==i?i:"",category:null!==(e=t.productType)&&void 0!==e?e:"",price:Math.min(t.price.actual,null!==(r=t.price.sale)&&void 0!==r?r:1/0)}),ga("ec:setAction","click",{list:"VI VPR View"})}}const P=o.getMonoid(a.first()).concat(l.pipe(o.fromNullable(window.gtag),o.map((()=>new I))),l.pipe(o.fromNullable(window.ga),o.map((()=>new S)))),F=/fit\/\d+\//,E=(t,i)=>l.pipe((t=>l.pipe(t.match(F),d.fromNullable(t),d.map((()=>t))))(t),d.map((t=>t.replace(F,`fit/${i}/`))),d.getOrElse((()=>t))),O=(t,e)=>t.deeplink?i("a",{class:t.part,part:t.part,href:t.deeplink},e):e,V=t=>{var e;const r=new Intl.NumberFormat(t.locale,{minimumFractionDigits:2}).format(t.price),n=`${null!==(e=t.prefix)&&void 0!==e?e:""} ${r} ${t.currency}`;return i("span",{class:"price-amount",part:"price-amount"},n)},z=t=>{const e=i(V,{prefix:t.prefix,currency:t.currency,price:t.price,locale:t.locale});return i("span",{class:"price-container",part:"price-container"},t.salePrice?[i("span",{class:"price-sale",part:"price-sale"},i(V,{prefix:t.prefix,currency:t.currency,price:t.salePrice,locale:t.locale})),i("span",{class:"price-outdated",part:"price-outdated"},e)]:i("span",{class:"price-regular",part:"price-regular"},e))};let j=class{constructor(i){t(this,i),this.recommendationLoad=n(this,"recommendationLoad",7),this.recommendationView=n(this,"recommendationView",7),this.recommendationClick=n(this,"recommendationClick",7),this.productImageLoaded=n(this,"productImageLoaded",7),this.currency=void 0,this.imageRatio=1,this.imageWidth=200,this.locale=void 0,this.pricePrefix=void 0,this.responsive=!1,this.dimmedBackground=!1,this.imageLoaded=!1,this.intersectionObserver=new IntersectionObserver(this.intersectionCallback.bind(this),{threshold:1})}intersectionCallback(t){t.some((t=>t.isIntersecting))&&(l.pipe(P,o.map((t=>t.sendImpression(this.getProduct())))),this.recommendationView.emit(this.productId),this.intersectionObserver.disconnect())}componentDidLoad(){this.recommendationLoad.emit(this.productId),this.intersectionObserver.observe(this.el),this.el.shadowRoot.querySelectorAll("a").forEach((t=>t.addEventListener("mousedown",(t=>{this.recommendationClick.emit(this.productId),window.ga&&t.preventDefault(),l.pipe(P,o.match((()=>null),(t=>t.sendClick(this.getProduct())))),window.ga&&ga("send","event","UX","click","Results",{hitCallback:function(){document.location.href=this.deeplink}})}))))}getProduct(){return c.results.find((t=>t.productId===this.productId))}renderImage(){const t={width:this.imageWidth,height:this.imageWidth*this.imageRatio,src:this.image,title:this.productTitle,lazy:!1};return this.responsive?((t,e=(()=>{}))=>i("picture",null,i("img",{loading:t.lazy?"lazy":"eager",part:"image",class:"image responsive",src:E(t.src,t.width),alt:t.title,onLoad:e})))(t,(()=>this.kek())):((t,e=(()=>{}))=>i("picture",null,i("img",{loading:t.lazy?"lazy":"eager",part:"image",class:"image",width:t.width,height:t.height,src:E(t.src,t.width),alt:t.title,onLoad:e})))(t,(()=>this.kek()))}kek(){this.productImageLoaded.emit(this.productId)}render(){var t,r,n;return i(e,{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"},i(O,{deeplink:this.deeplink,part:"image-link"},this.renderImage()),i(O,{deeplink:this.deeplink,part:"deeplink"},i("span",{class:"title",part:"title"},this.productTitle)),i("span",{class:"brand",part:"brand"},this.brand),i("span",{class:"type",part:"type"},this.productType),i(z,{prefix:null!==(t=this.pricePrefix)&&void 0!==t?t:h.pricePrefix,currency:null!==(r=this.currency)&&void 0!==r?r:h.currencySign,price:this.price,salePrice:this.salePrice,locale:null!==(n=this.locale)&&void 0!==n?n:h.locale}))}get el(){return r(this)}};j.style=':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}';let A=class{constructor(i){t(this,i),this.modalClosed=n(this,"modalClosed",7),this.position="bottom",this.sourceImage=null,this.widgetScrollbar=!1,this.state="idle"}bodyClickListener(t){const{clientX:i,clientY:e}=t,r=this.getSidebarRectangle();r&&(i>=r.left&&i<=r.right&&e>=r.top&&e<=r.bottom||(this.state="closed"))}getClassMap(){return{[this.position]:!0,[this.state]:!0}}getSidebarRectangle(){var t;return null===(t=this.el.shadowRoot.querySelector("aside"))||void 0===t?void 0:t.getBoundingClientRect()}render(){return i(e,{class:this.getClassMap()},i("aside",{class:"sidebar",part:"body",onAnimationEnd:t=>this.handleAnimationEnd(t)},i("header",{class:{"contains-source-img":this.isSourceImageValid()},part:"sidebar-header"},this.isSourceImageValid()?this.renderSourceImage():null,i("span",{class:"title",part:"title"},this.sidebarTitle),i("button",{class:"close-sidebar",onClick:()=>this.state="closed"},i(k,null))),i("main",{part:"sidebar-content"},i("vviinn-vpr-widget",{exportparts:"brand, currency, deeplink, image, image-link, price-amount, price-container, price-outdated, price-prefix, price-regular, price-sale, title: product-title",token:this.token,productId:this.productId,imageWidth:300,blockTitle:"",mode:"bottom"===this.position?"continuity":"grid",useCarousel:"bottom"===this.position,onRecommendationsLoaded:()=>this.state="open",showScroll:this.widgetScrollbar}))))}renderSourceImage(){return i("img",{class:"source-image",part:"source-image",src:this.sourceImage})}isSourceImageValid(){var t;return(null===(t=this.sourceImage)||void 0===t?void 0:t.length)>0}handleAnimationEnd({animationName:t}){t.includes("slideOut")&&this.modalClosed.emit()}get el(){return r(this)}};A.style=":host{--vviinn-carousel-columns:0;box-sizing:border-box;display:block;display:flex;height:100vh;left:0;position:fixed;top:0;transition:background 0.1s ease-in-out;width:100vw}:host(.open){background:rgba(0, 0, 0, 0.2)}:host(.bottom){flex-direction:column;justify-content:end}:host(.right){flex-direction:row;justify-content:flex-end}header{position:relative;text-align:center;padding:32px}header.contains-source-img{display:grid;justify-items:center;grid-gap:12px}img.source-image{width:64px;height:64px;border-radius:50%;box-shadow:0px 2px 4px rgba(0, 0, 0, 0.15);padding:8px}:host(.right) header{box-shadow:0px 2px 6px rgba(0, 0, 0, 0.1)}main{padding:0 24px}:host(.right) main{overflow:auto}.sidebar{background:white;box-sizing:border-box;display:flex;flex-direction:column}:host(.bottom.idle) .sidebar,:host(.bottom.closed) .sidebar{transform:translateY(100%)}:host(.bottom.closed) .sidebar{-webkit-animation-name:slideOutFromBottom;animation-name:slideOutFromBottom;-webkit-animation-duration:0.5s;animation-duration:0.5s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}:host(.bottom.open) .sidebar{-webkit-animation-name:slideInFromBottom;animation-name:slideInFromBottom;-webkit-animation-duration:0.5s;animation-duration:0.5s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}:host(.right.idle) .sidebar{transform:translateX(100%)}:host(.right.closed) .sidebar{-webkit-animation-name:slideOutFromRight;animation-name:slideOutFromRight;-webkit-animation-duration:0.5s;animation-duration:0.5s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}:host(.right.open) .sidebar{-webkit-animation-name:slideInFromRight;animation-name:slideInFromRight;-webkit-animation-duration:0.5s;animation-duration:0.5s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}:host(.right) .sidebar{max-width:480px}:host(.right) vviinn-vpr-widget::part(recommendations-grid){display:grid;grid-template-columns:repeat(2, 1fr);grid-gap:24px}:host(.right) vviinn-vpr-widget{overflow:auto}:host(.right) vviinn-vpr-widget::part(image){border:none}.title{font-style:normal;font-weight:500;font-size:28px;line-height:40px;text-align:center;color:#000000}vviinn-vpr-widget::part(title),vviinn-vpr-widget::part(brand),vviinn-vpr-widget::part(type){text-align:left}vviinn-vpr-widget::part(price-container){align-self:start}.close-sidebar{background:transparent;border:none;cursor:pointer;margin:0;padding:0;position:absolute;right:24px;top:24px}@-webkit-keyframes slideInFromBottom{from{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes slideInFromBottom{from{transform:translateY(100%)}to{transform:translateY(0)}}@-webkit-keyframes slideOutFromBottom{from{transform:translateY(0)}to{transform:translateY(100%)}}@keyframes slideOutFromBottom{from{transform:translateY(0)}to{transform:translateY(100%)}}@-webkit-keyframes slideInFromRight{from{transform:translateX(100%)}to{transform:translateX(0)}}@keyframes slideInFromRight{from{transform:translateX(100%)}to{transform:translateX(0)}}@-webkit-keyframes slideOutFromRight{from{transform:translateX(0)}to{transform:translateX(100%)}}@keyframes slideOutFromRight{from{transform:translateX(0)}to{transform:translateX(100%)}}";let B=class{constructor(i){t(this,i),this.position="bottom",this.sourceImage=null,this.sidebarTitle="Visually similar products",this.modalScrollbar=!1}render(){return i(e,null,i("button",{class:"open-button",part:"button",onClick:()=>this.handleClick()},i("slot",null,i(C,null))))}handleClick(){const t=document.createElement("vviinn-recommendations-sidebar");t.sidebarTitle=this.sidebarTitle,t.productId=this.productId,t.token=this.token,t.position=this.position,t.sourceImage=this.sourceImage,t.widgetScrollbar=this.modalScrollbar,t.addEventListener("modalClosed",(()=>{document.body.removeChild(t)})),document.body.append(t)}};B.style=":host{display:block}.open-button{align-items:center;background:rgba(255, 255, 255, 0.8);border-radius:50%;border:none;box-shadow:0px 2px 6px rgba(0, 0, 0, 0.15);box-sizing:border-box;cursor:pointer;display:grid;height:40px;justify-items:center;padding:0;width:40px;transition:all 0.25s ease-in-out}.open-button:hover{box-shadow:0px 2px 6px rgba(0, 0, 0, 0.25)}.open-button:focus{border:2px solid rgba(15, 98, 254, 0.5);outline:none}.open-button:active{background:#F4F4F4;outline:none}";const D=l.flow((t=>`Bearer ${t}`),(t=>new Headers({Authorization:t})),(t=>({headers:t}))),$=b(f),T=(t,i={})=>_($(g(),v),m,u(p(t,i))),L=t=>i=>T(`product/${t}/similar-products`,i),X=t=>i=>T(`product/${t}/cross-selling-products`,i);function M(t){return"function"==typeof t}function N(t){const i=t((t=>{Error.call(t),t.stack=(new Error).stack}));return i.prototype=Object.create(Error.prototype),i.prototype.constructor=i,i}const Y=N((t=>function(i){t(this),this.message=i?`${i.length} errors occurred during unsubscription:\n${i.map(((t,i)=>`${i+1}) ${t.toString()}`)).join("\n ")}`:"",this.name="UnsubscriptionError",this.errors=i}));function W(t,i){if(t){const e=t.indexOf(i);0<=e&&t.splice(e,1)}}class G{constructor(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}unsubscribe(){let t;if(!this.closed){this.closed=!0;const{_parentage:i}=this;if(i)if(this._parentage=null,Array.isArray(i))for(const t of i)t.remove(this);else i.remove(this);const{initialTeardown:e}=this;if(M(e))try{e()}catch(i){t=i instanceof Y?i.errors:[i]}const{_finalizers:r}=this;if(r){this._finalizers=null;for(const i of r)try{H(i)}catch(i){t=null!=t?t:[],i instanceof Y?t=[...t,...i.errors]:t.push(i)}}if(t)throw new Y(t)}}add(t){var i;if(t&&t!==this)if(this.closed)H(t);else{if(t instanceof G){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=null!==(i=this._finalizers)&&void 0!==i?i:[]).push(t)}}_hasParent(t){const{_parentage:i}=this;return i===t||Array.isArray(i)&&i.includes(t)}_addParent(t){const{_parentage:i}=this;this._parentage=Array.isArray(i)?(i.push(t),i):i?[i,t]:t}_removeParent(t){const{_parentage:i}=this;i===t?this._parentage=null:Array.isArray(i)&&W(i,t)}remove(t){const{_finalizers:i}=this;i&&W(i,t),t instanceof G&&t._removeParent(this)}}G.EMPTY=(()=>{const t=new G;return t.closed=!0,t})();const U=G.EMPTY;function q(t){return t instanceof G||t&&"closed"in t&&M(t.remove)&&M(t.add)&&M(t.unsubscribe)}function H(t){M(t)?t():t.unsubscribe()}const J={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},K={setTimeout(t,i,...e){const{delegate:r}=K;return(null==r?void 0:r.setTimeout)?r.setTimeout(t,i,...e):setTimeout(t,i,...e)},clearTimeout(t){const{delegate:i}=K;return((null==i?void 0:i.clearTimeout)||clearTimeout)(t)},delegate:void 0};function Q(){}const Z=tt("C",void 0,void 0);function tt(t,i,e){return{kind:t,value:i,error:e}}function it(t){t()}class et extends G{constructor(t){super(),this.isStopped=!1,t?(this.destination=t,q(t)&&t.add(this)):this.destination=dt}static create(t,i,e){return new ot(t,i,e)}next(t){this.isStopped?lt(function(t){return tt("N",t,void 0)}(t),this):this._next(t)}error(t){this.isStopped?lt(tt("E",void 0,t),this):(this.isStopped=!0,this._error(t))}complete(){this.isStopped?lt(Z,this):(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe(),this.destination=null)}_next(t){this.destination.next(t)}_error(t){try{this.destination.error(t)}finally{this.unsubscribe()}}_complete(){try{this.destination.complete()}finally{this.unsubscribe()}}}const rt=Function.prototype.bind;function nt(t,i){return rt.call(t,i)}class st{constructor(t){this.partialObserver=t}next(t){const{partialObserver:i}=this;if(i.next)try{i.next(t)}catch(t){at(t)}}error(t){const{partialObserver:i}=this;if(i.error)try{i.error(t)}catch(t){at(t)}else at(t)}complete(){const{partialObserver:t}=this;if(t.complete)try{t.complete()}catch(t){at(t)}}}class ot extends et{constructor(t,i,e){let r;if(super(),M(t)||!t)r={next:null!=t?t:void 0,error:null!=i?i:void 0,complete:null!=e?e:void 0};else{let i;this&&J.useDeprecatedNextContext?(i=Object.create(t),i.unsubscribe=()=>this.unsubscribe(),r={next:t.next&&nt(t.next,i),error:t.error&&nt(t.error,i),complete:t.complete&&nt(t.complete,i)}):r=t}this.destination=new st(r)}}function at(t){var i;i=t,K.setTimeout((()=>{const{onUnhandledError:t}=J;if(!t)throw i;t(i)}))}function lt(t,i){const{onStoppedNotification:e}=J;e&&K.setTimeout((()=>e(t,i)))}const dt={closed:!0,next:Q,error:function(t){throw t},complete:Q},ct="function"==typeof Symbol&&Symbol.observable||"@@observable";function ht(t){return t}class ut{constructor(t){t&&(this._subscribe=t)}lift(t){const i=new ut;return i.source=this,i.operator=t,i}subscribe(t,i,e){const r=(n=t)&&n instanceof et||function(t){return t&&M(t.next)&&M(t.error)&&M(t.complete)}(n)&&q(n)?t:new ot(t,i,e);var n;return it((()=>{const{operator:t,source:i}=this;r.add(t?t.call(r,i):i?this._subscribe(r):this._trySubscribe(r))})),r}_trySubscribe(t){try{return this._subscribe(t)}catch(i){t.error(i)}}forEach(t,i){return new(i=pt(i))(((i,e)=>{const r=new ot({next:i=>{try{t(i)}catch(t){e(t),r.unsubscribe()}},error:e,complete:i});this.subscribe(r)}))}_subscribe(t){var i;return null===(i=this.source)||void 0===i?void 0:i.subscribe(t)}[ct](){return this}pipe(...t){return(0===(i=t).length?ht:1===i.length?i[0]:function(t){return i.reduce(((t,i)=>i(t)),t)})(this);var i}toPromise(t){return new(t=pt(t))(((t,i)=>{let e;this.subscribe((t=>e=t),(t=>i(t)),(()=>t(e)))}))}}function pt(t){var i;return null!==(i=null!=t?t:J.Promise)&&void 0!==i?i:Promise}ut.create=t=>new ut(t);const mt=N((t=>function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}));class gt extends ut{constructor(){super(),this.closed=!1,this.currentObservers=null,this.observers=[],this.isStopped=!1,this.hasError=!1,this.thrownError=null}lift(t){const i=new vt(this,this);return i.operator=t,i}_throwIfClosed(){if(this.closed)throw new mt}next(t){it((()=>{if(this._throwIfClosed(),!this.isStopped){this.currentObservers||(this.currentObservers=Array.from(this.observers));for(const i of this.currentObservers)i.next(t)}}))}error(t){it((()=>{if(this._throwIfClosed(),!this.isStopped){this.hasError=this.isStopped=!0,this.thrownError=t;const{observers:i}=this;for(;i.length;)i.shift().error(t)}}))}complete(){it((()=>{if(this._throwIfClosed(),!this.isStopped){this.isStopped=!0;const{observers:t}=this;for(;t.length;)t.shift().complete()}}))}unsubscribe(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null}get observed(){var t;return(null===(t=this.observers)||void 0===t?void 0:t.length)>0}_trySubscribe(t){return this._throwIfClosed(),super._trySubscribe(t)}_subscribe(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)}_innerSubscribe(t){const{hasError:i,isStopped:e,observers:r}=this;return i||e?U:(this.currentObservers=null,r.push(t),new G((()=>{this.currentObservers=null,W(r,t)})))}_checkFinalizedStatuses(t){const{hasError:i,thrownError:e,isStopped:r}=this;i?t.error(e):r&&t.complete()}asObservable(){const t=new ut;return t.source=this,t}}gt.create=(t,i)=>new vt(t,i);class vt extends gt{constructor(t,i){super(),this.destination=t,this.source=i}next(t){var i,e;null===(e=null===(i=this.destination)||void 0===i?void 0:i.next)||void 0===e||e.call(i,t)}error(t){var i,e;null===(e=null===(i=this.destination)||void 0===i?void 0:i.error)||void 0===e||e.call(i,t)}complete(){var t,i;null===(i=null===(t=this.destination)||void 0===t?void 0:t.complete)||void 0===i||i.call(t)}_subscribe(t){var i,e;return null!==(e=null===(i=this.source)||void 0===i?void 0:i.subscribe(t))&&void 0!==e?e:U}}let bt=class{constructor(i){t(this,i),this.recommendationsLoaded=n(this,"recommendationsLoaded",7),this.blockTitle="Recommended products",this.imageRatio=1,this.imageWidth=300,this.currencySign="€",this.mode="continuity",this.campaignType="VPR",this.locale="de-DE",this.apiPath="https://api.vviinn.com",this.useCarousel=!0,this.showScroll=!0,this.cssUrl=null,this.recommendations=[],this.loaded=!1,this.productImageLoadedSubject=new gt}handleProductIdChange(){this.getRecommendations()}handleCampaignTypeChange(){this.getRecommendations()}handleApiPathChange(t){w.apiPath=t,this.getRecommendations()}lol({detail:t}){this.productImageLoadedSubject.next(t)}connectedCallback(){w.apiPath=this.apiPath,w.currencySign=this.currencySign,w.locale=this.locale}async componentWillLoad(){w.pricePrefix=this.pricePrefix,w.currencySign=this.currencySign,this.getRecommendations()}async getRecommendations(){if(void 0===this.productId||void 0===this.token)return;const t=this.campaignType.length>0?this.campaignType:"VPR",i=D(this.token),e=l.pipe(x.of((t=>{return l.pipe("VPR"===t?{_tag:"VPR"}:{_tag:"VCS"},(i=()=>L,e=()=>X,t=>(t=>"VPR"===t._tag)(t)?i():e()));var i,e})(t)),x.ap(x.of(this.productId)),x.ap(x.of(i)),x.flatten),r=await e();l.pipe(r,d.fold((t=>this.handleError(t)),(t=>this.handleRecommendationsSucces(t))))}handleError(t){console.log("ERROR:",t)}handleRecommendationsSucces(t){var i;this.recommendations=null!==(i=null==t?void 0:t.extended)&&void 0!==i?i:t,c.results=this.recommendations,this.loaded=!0,this.productIds=this.recommendations.map((t=>t.productId)),this.productImageLoadedSubject.subscribe((t=>{this.productIds=this.productIds.filter((i=>i!==t)),0===this.productIds.length&&this.recommendationsLoaded.emit()}))}isExternalCSS(){return this.cssUrl&&this.cssUrl.length>0}renderExternalCSS(){return this.isExternalCSS()?i("link",{href:this.cssUrl,rel:"stylesheet"}):""}render(){return i(e,{class:{loaded:this.loaded,empty:0==this.recommendations.length,[this.mode]:!0},"aria-hidden":this.loaded?"false":"true"},this.renderExternalCSS(),i("style",null,w.fallbackStyles),i("h2",{part:"recommendations-title"},this.blockTitle),this.useCarousel?this.renderCarousel():this.renderResults())}renderRecommendation(t){return i("vviinn-product-card",{part:"product-part",productId:t.productId,productTitle:t.title,deeplink:t.deeplink,image:t.image.thumbnail,brand:t.brand,imageWidth:this.imageWidth,imageRatio:1,price:t.price.actual,salePrice:t.price.sale,responsive:"grid"===this.mode,dimmedBackground:this.useDimmedBackgroundInCard()})}useDimmedBackgroundInCard(){return"continuity"===this.mode||!this.useCarousel}renderResults(){return i("div",{class:"recommendations-grid",part:"recommendations-grid"},this.recommendations.map((t=>this.renderRecommendation(t))))}renderCarousel(){return i("vviinn-carousel",{mode:this.mode,imageWidth:this.imageWidth,showScroll:this.showScroll,recommendations:this.recommendations})}get el(){return r(this)}static get watchers(){return{productId:["handleProductIdChange"],campaignType:["handleCampaignTypeChange"],apiPath:["handleApiPathChange"]}}};bt.style=":host{display:grid;grid-gap:1rem;width:100%}:host(:not(.loaded)){position:absolute;visibility:hidden}:host(.grid) vviinn-product-card::part(image){border:1px solid #DDDDDD;width:100%}h2{margin:0}vviinn-product-card::part(price-container){align-self:flex-start;text-align:left;display:flex}.results{display:grid;grid-gap:1rem}.visually-hidden{position:absolute;top:0;left:0;z-index:-1;height:0;width:0}h2{margin:0}:host(.grid) h2{justify-content:center}:host(.grid) vviinn-product-card::part(image){min-width:100%}:host(.grid) vviinn-product-card::part(image-link){width:100%}:host(.grid) vviinn-product-card::part(title),:host(.grid) vviinn-product-card::part(brand),:host(.grid) vviinn-product-card::part(type){text-align:center}:host(.grid) vviinn-product-card::part(price-container){align-self:center}:host(.continuity) vviinn-product-card::part(title),:host(.continuity) vviinn-product-card::part(brand),:host(.continuity) vviinn-product-card::part(type),:host(.continuity) vviinn-product-card::part(deeplink){text-align:left;max-width:unset;align-self:start}";export{R as vviinn_carousel,j as vviinn_product_card,A as vviinn_recommendations_sidebar,B as vviinn_vpr_button,bt as vviinn_vpr_widget}
|
|
1
|
+
import{r as t,h as i,H as e,g as r,c as n}from"./p-e1ba8626.js";import{_ as s,O as o,S as a,a as l,E as c,i as h,s as d,c as u,m as p,f as m,g,b as v,d as b,A as f,e as w,T as x}from"./p-59edfbe2.js";import{C as y,a as k,V as C}from"./p-56fc949a.js";import{p as _}from"./p-f582db5c.js";let R=class{constructor(i){t(this,i),this.moveDirection="right",this.contentGroups=[],this.activeContentGroup=0,this.mode="continuity",this.imageWidth=140,this.showScroll=!0,this.recommendations=[],this.columns=0,this.resizeObserver=new ResizeObserver((()=>this.handleResize())),this.mutationObserver=new MutationObserver((()=>this.cloneSlottedContent()))}connectedCallback(){this.setItemWidth()}disconnectedCallback(){this.resizeObserver.disconnect()}componentDidLoad(){this.setWidth(),this.processScrollbarWidth(),this.columns=this.getColumnsNumber();const t=this.el.querySelector(".content");this.mutationObserver.observe(t,{subtree:!0,childList:!0}),this.resizeObserver.observe(this.getHostParent())}getItemWidthFromDocument(){return parseInt(getComputedStyle(document.body).getPropertyValue("--vviinn-carousel-image-width"))}setItemWidth(){const t=this.getItemWidthFromDocument(),i=isNaN(t)?this.imageWidth:t;this.el.style.setProperty("--vviinn-carousel-image-width",`${i}px`)}getContentClassMap(){return{content:!0,[this.moveDirection]:!0,[this.mode]:!0,"show-scrollbar":this.showScroll}}handleResize(){this.setWidth(),this.processScrollbarWidth(),this.setItemWidth();const t=this.getColumnsNumber();t!==this.columns&&(this.columns=t)}calculateMoveStep(){const t=this.getContent().map((t=>t.getBoundingClientRect().width));return t.reduce(((t,i)=>t+i),0)/t.length}getHostParent(){return this.el.parentNode.host.parentElement}setWidth(){const t=this.getHostParent();if(!t)return;const i=getComputedStyle(t),e=t.getBoundingClientRect().width-(parseInt(i["padding-right"])+parseInt(i["padding-left"]));this.el.style.setProperty("--vviinn-carousel-content-width",`${e}px`)}getParent(){return this.el.parentNode.host.parentElement}cloneSlottedContent(){this.setWidth()}getActiveGroupIndex(){var t,i;if(!(null===(i=null===(t=this.getContentNode())||void 0===t?void 0:t.getBoundingClientRect())||void 0===i?void 0:i.left))return 0;const e=this.getContentGroups().map((t=>t.getBoundingClientRect().left)).map(((t,i)=>[t,i])).filter((t=>t[0]>=0));return e.length>0?e[0][1]:0}getContentNode(){return this.el.querySelector(".content")}getContent(){const t=this.getContentNode().children;return Array.from(t).map((t=>t))}getColumnsNumber(){const t=getComputedStyle(this.el).getPropertyValue("--vviinn-carousel-columns-internal");return parseInt(t)}getContentGroups(){return Array.from(this.el.querySelectorAll(".items-group"))}showNext(){this.moveDirection="right";const t=this.getContentNode();requestAnimationFrame((()=>{t.scrollTo({top:0,left:t.scrollLeft+this.calculateMoveStep(),behavior:"smooth"})}))}showPrev(){this.moveDirection="left";const t=this.getContentNode();requestAnimationFrame((()=>{t.scrollTo({top:0,left:t.scrollLeft-this.calculateMoveStep(),behavior:"smooth"})}))}scroll(t){const i=this.getContentNode();requestAnimationFrame((()=>{i.scrollTo({top:0,left:this.calculateMoveStep()*t,behavior:"smooth"})}))}processScrollbarWidth(){const t=this.getContentNode();this.el.style.setProperty("--vviinn-progressbar-width",t.clientWidth*((t.scrollLeft+t.clientWidth)/t.scrollWidth)+"px"),this.activeContentGroup=this.getActiveGroupIndex()}showBullets(){return"grid"===this.mode&&this.showScroll}showScrollbar(){return"continuity"===this.mode&&this.showScroll}getClassMap(){return{[this.mode]:!0,"show-scrollbar":this.showScrollbar()}}renderRecommendation(t){return i("vviinn-product-card",{part:"product-part",productId:t.productId,productTitle:t.title,deeplink:t.deeplink,image:t.image.thumbnail,brand:t.brand,imageWidth:this.imageWidth,imageRatio:1,price:t.price.actual,salePrice:t.price.sale,responsive:"grid"===this.mode,dimmedBackground:"continuity"===this.mode})}renderRecommendationGroup(t){return i("div",{class:"items-group"},t)}renderRecommendationGroups(t){return t.map((t=>this.renderRecommendationGroup(t)))}renderRecommendations(){return"grid"===this.mode?this.renderGrid():this.renderRecommendationsElements()}renderRecommendationsElements(){return this.recommendations.map((t=>this.renderRecommendation(t)))}renderGrid(){const t=this.renderRecommendationsElements(),i=s.chunksOf(this.getColumnsNumber())(t);return this.renderRecommendationGroups(i)}renderBullets(){const t=Math.ceil(this.recommendations.length/this.getColumnsNumber());return Array.from(Array(t).keys()).map((t=>i("div",{class:{bullet:!0,active:this.activeContentGroup===t},onClick:()=>this.scroll(t)})))}render(){return i(e,{class:this.getClassMap()},i("div",{class:Object.assign({body:!0},this.getClassMap())},i("button",{class:"prev",onClick:()=>this.showPrev()},i(y,null)),i("div",{class:this.getContentClassMap(),onScroll:()=>this.processScrollbarWidth()},this.renderRecommendations()),i("button",{class:"next",onClick:()=>this.showNext()},i(y,null))),this.showBullets()?i("div",{class:"bullets"},this.renderBullets()):"")}get el(){return r(this)}};R.style=":host{--vviinn-progressbar-width:0;--vviinn-carousel-item-width:150px;--vviinn-carousel-columns-internal:var(--vviinn-carousel-columns, 4);--vviinn-carousel-image-width-system:140px}.body{display:flex;position:relative;width:var(--vviinn-carousel-content-width);flex-direction:column}.content-wrapper *{box-sizing:border-box}.content-wrapper{overflow-y:hidden;overflow-x:auto;flex-grow:1}.bullets{margin-top:16px;display:flex;flex-direction:row;grid-gap:24px;justify-content:center}.bullet{width:10px;height:10px;background:#E0E0E0;border-radius:50%;cursor:pointer}.bullet.active{background:#161616}.content:not(.show-scrollbar),.content.grid{scrollbar-color:#fff0 #fff0}.content:not(.show-scrollbar)::-webkit-scrollbar,.content.grid::-webkit-scrollbar{opacity:0}.content{display:flex;flex-direction:row;grid-gap:8px;-ms-scroll-snap-type:x mandatory;scroll-snap-type:x mandatory;overflow-y:hidden;overflow-x:auto;flex-grow:1;padding-bottom:16px}.content.left>*{scroll-snap-align:start}.content.right>*{scroll-snap-align:end}:host(.continuity) button{border-radius:2px}:host(.grid) button{border-radius:50%}button{align-items:center;background-color:white;border:none;box-shadow:0px 2px 6px rgba(0, 0, 0, 0.15);cursor:pointer;display:grid;height:40px;justify-items:center;position:absolute;top:calc(50% - 20px);width:40px;z-index:1;padding:0;margin:0}button.prev svg{transform:rotate(180deg);margin-left:-5px}.prev{left:0}.next{right:0}.items-group{display:grid;grid-gap:16px;grid-template-columns:repeat(var(--vviinn-carousel-columns-internal), 1fr);min-width:100%}vviinn-product-card::part(price-container){text-align:center}:host(.classic) vviinn-product-card::part(title),:host(.classic) vviinn-product-card::part(brand),:host(.classic) vviinn-product-card::part(type){text-align:center}@media (max-width: 480px){:host(.modern) button{display:none}.items-group{grid-template-columns:repeat(2, 1fr)}}";class I{sendImpression(t){var i,e,r;gtag("event","view_item_list",{items:[{id:t.productId,name:t.title,brand:null!==(i=t.brand)&&void 0!==i?i:"",category:null!==(e=t.productType)&&void 0!==e?e:"",list_name:"VI VPR View",price:Math.min(t.price.actual,null!==(r=t.price.sale)&&void 0!==r?r:1/0)}]})}sendClick(t){var i,e,r;gtag("event","select_content",{content_type:"product",items:[{id:t.productId,name:t.title,brand:null!==(i=t.brand)&&void 0!==i?i:"",category:null!==(e=t.productType)&&void 0!==e?e:"",list_name:"VI VPR View",price:Math.min(t.price.actual,null!==(r=t.price.sale)&&void 0!==r?r:1/0)}]})}}class S{constructor(){ga("require","ec")}convertProduct(t){var i,e,r;return{id:t.productId,name:t.title,brand:null!==(i=t.brand)&&void 0!==i?i:"",category:null!==(e=t.productType)&&void 0!==e?e:"",list:"VI VPR View",price:Math.min(t.price.actual,null!==(r=t.price.sale)&&void 0!==r?r:1/0)}}sendImpression(t){ga("ec:addImpression",this.convertProduct(t))}sendClick(t){var i,e,r;ga("ec:addProduct",{id:t.productId,name:t.title,brand:null!==(i=t.brand)&&void 0!==i?i:"",category:null!==(e=t.productType)&&void 0!==e?e:"",price:Math.min(t.price.actual,null!==(r=t.price.sale)&&void 0!==r?r:1/0)}),ga("ec:setAction","click",{list:"VI VPR View"})}}const P=o.getMonoid(a.first()).concat(l.pipe(o.fromNullable(window.gtag),o.map((()=>new I))),l.pipe(o.fromNullable(window.ga),o.map((()=>new S)))),F=/fit\/\d+\//,E=(t,i)=>l.pipe((t=>l.pipe(t.match(F),c.fromNullable(t),c.map((()=>t))))(t),c.map((t=>t.replace(F,`fit/${i}/`))),c.getOrElse((()=>t))),O=(t,e)=>t.deeplink?i("a",{class:t.part,part:t.part,href:t.deeplink},e):e,V=t=>{var e;const r=new Intl.NumberFormat(t.locale,{minimumFractionDigits:2}).format(t.price),n=`${null!==(e=t.prefix)&&void 0!==e?e:""} ${r} ${t.currency}`;return i("span",{class:"price-amount",part:"price-amount"},n)},z=t=>{const e=i(V,{prefix:t.prefix,currency:t.currency,price:t.price,locale:t.locale});return i("span",{class:"price-container",part:"price-container"},t.salePrice?[i("span",{class:"price-sale",part:"price-sale"},i(V,{prefix:t.prefix,currency:t.currency,price:t.salePrice,locale:t.locale})),i("span",{class:"price-outdated",part:"price-outdated"},e)]:i("span",{class:"price-regular",part:"price-regular"},e))};let j=class{constructor(i){t(this,i),this.recommendationLoad=n(this,"recommendationLoad",7),this.recommendationView=n(this,"recommendationView",7),this.recommendationClick=n(this,"recommendationClick",7),this.productImageLoaded=n(this,"productImageLoaded",7),this.currency=void 0,this.imageRatio=1,this.imageWidth=200,this.locale=void 0,this.pricePrefix=void 0,this.responsive=!1,this.dimmedBackground=!1,this.imageLoaded=!1,this.intersectionObserver=new IntersectionObserver(this.intersectionCallback.bind(this),{threshold:1})}intersectionCallback(t){t.some((t=>t.isIntersecting))&&(l.pipe(P,o.map((t=>t.sendImpression(this.getProduct())))),this.recommendationView.emit(this.productId),this.intersectionObserver.disconnect())}componentDidLoad(){this.recommendationLoad.emit(this.productId),this.intersectionObserver.observe(this.el),this.el.shadowRoot.querySelectorAll("a").forEach((t=>t.addEventListener("mousedown",(t=>{this.recommendationClick.emit(this.productId),window.ga&&t.preventDefault(),l.pipe(P,o.match((()=>null),(t=>t.sendClick(this.getProduct())))),window.ga&&ga("send","event","UX","click","Results",{hitCallback:function(){document.location.href=this.deeplink}})}))))}getProduct(){return h.results.find((t=>t.productId===this.productId))}renderImage(){const t={width:this.imageWidth,height:this.imageWidth*this.imageRatio,src:this.image,title:this.productTitle,lazy:!1};return this.responsive?((t,e=(()=>{}))=>i("picture",null,i("img",{loading:t.lazy?"lazy":"eager",part:"image",class:"image responsive",src:E(t.src,t.width),alt:t.title,onLoad:e})))(t,(()=>this.kek())):((t,e=(()=>{}))=>i("picture",null,i("img",{loading:t.lazy?"lazy":"eager",part:"image",class:"image",width:t.width,height:t.height,src:E(t.src,t.width),alt:t.title,onLoad:e})))(t,(()=>this.kek()))}kek(){this.productImageLoaded.emit(this.productId)}render(){var t,r,n;return i(e,{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"},i(O,{deeplink:this.deeplink,part:"image-link"},this.renderImage()),i(O,{deeplink:this.deeplink,part:"deeplink"},i("span",{class:"title",part:"title"},this.productTitle)),i("span",{class:"brand",part:"brand"},this.brand),i("span",{class:"type",part:"type"},this.productType),i(z,{prefix:null!==(t=this.pricePrefix)&&void 0!==t?t:d.pricePrefix,currency:null!==(r=this.currency)&&void 0!==r?r:d.currencySign,price:this.price,salePrice:this.salePrice,locale:null!==(n=this.locale)&&void 0!==n?n:d.locale}))}get el(){return r(this)}};j.style=':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}';let A=class{constructor(i){t(this,i),this.modalClosed=n(this,"modalClosed",7),this.position="bottom",this.sourceImage=null,this.widgetScrollbar=!1,this.state="idle"}bodyClickListener(t){const{clientX:i,clientY:e}=t,r=this.getSidebarRectangle();r&&(i>=r.left&&i<=r.right&&e>=r.top&&e<=r.bottom||(this.state="closed"))}getClassMap(){return{[this.position]:!0,[this.state]:!0}}getSidebarRectangle(){var t;return null===(t=this.el.shadowRoot.querySelector("aside"))||void 0===t?void 0:t.getBoundingClientRect()}render(){return i(e,{class:this.getClassMap()},i("aside",{class:"sidebar",part:"body",onAnimationEnd:t=>this.handleAnimationEnd(t)},i("header",{class:{"contains-source-img":this.isSourceImageValid()},part:"sidebar-header"},this.isSourceImageValid()?this.renderSourceImage():null,i("span",{class:"title",part:"title"},this.sidebarTitle),i("button",{class:"close-sidebar",onClick:()=>this.state="closed"},i(k,null))),i("main",{part:"sidebar-content"},i("vviinn-vpr-widget",{exportparts:"brand, currency, deeplink, image, image-link, price-amount, price-container, price-outdated, price-prefix, price-regular, price-sale, title: product-title",token:this.token,productId:this.productId,imageWidth:300,blockTitle:"",mode:"bottom"===this.position?"continuity":"grid",useCarousel:"bottom"===this.position,onRecommendationsLoaded:()=>this.state="open",showScroll:this.widgetScrollbar}))))}renderSourceImage(){return i("img",{class:"source-image",part:"source-image",src:this.sourceImage})}isSourceImageValid(){var t;return(null===(t=this.sourceImage)||void 0===t?void 0:t.length)>0}handleAnimationEnd({animationName:t}){t.includes("slideOut")&&this.modalClosed.emit()}get el(){return r(this)}};A.style=":host{--vviinn-carousel-columns:0;box-sizing:border-box;display:block;display:flex;height:100vh;left:0;position:fixed;top:0;transition:background 0.1s ease-in-out;width:100vw}:host(.open){background:rgba(0, 0, 0, 0.2)}:host(.bottom){flex-direction:column;justify-content:end}:host(.right){flex-direction:row;justify-content:flex-end}header{position:relative;text-align:center;padding:32px}header.contains-source-img{display:grid;justify-items:center;grid-gap:12px}img.source-image{width:64px;height:64px;border-radius:50%;box-shadow:0px 2px 4px rgba(0, 0, 0, 0.15);padding:8px}:host(.right) header{box-shadow:0px 2px 6px rgba(0, 0, 0, 0.1)}main{padding:0 24px}:host(.right) main{overflow:auto}.sidebar{background:white;box-sizing:border-box;display:flex;flex-direction:column}:host(.bottom.idle) .sidebar,:host(.bottom.closed) .sidebar{transform:translateY(100%)}:host(.bottom.closed) .sidebar{-webkit-animation-name:slideOutFromBottom;animation-name:slideOutFromBottom;-webkit-animation-duration:0.5s;animation-duration:0.5s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}:host(.bottom.open) .sidebar{-webkit-animation-name:slideInFromBottom;animation-name:slideInFromBottom;-webkit-animation-duration:0.5s;animation-duration:0.5s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}:host(.right.idle) .sidebar{transform:translateX(100%)}:host(.right.closed) .sidebar{-webkit-animation-name:slideOutFromRight;animation-name:slideOutFromRight;-webkit-animation-duration:0.5s;animation-duration:0.5s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}:host(.right.open) .sidebar{-webkit-animation-name:slideInFromRight;animation-name:slideInFromRight;-webkit-animation-duration:0.5s;animation-duration:0.5s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}:host(.right) .sidebar{max-width:480px}:host(.right) vviinn-vpr-widget::part(recommendations-grid){display:grid;grid-template-columns:repeat(2, 1fr);grid-gap:24px}:host(.right) vviinn-vpr-widget{overflow:auto}:host(.right) vviinn-vpr-widget::part(image){border:none}.title{font-style:normal;font-weight:500;font-size:28px;line-height:40px;text-align:center;color:#000000}vviinn-vpr-widget::part(title),vviinn-vpr-widget::part(brand),vviinn-vpr-widget::part(type){text-align:left}vviinn-vpr-widget::part(price-container){align-self:start}.close-sidebar{background:transparent;border:none;cursor:pointer;margin:0;padding:0;position:absolute;right:24px;top:24px}@-webkit-keyframes slideInFromBottom{from{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes slideInFromBottom{from{transform:translateY(100%)}to{transform:translateY(0)}}@-webkit-keyframes slideOutFromBottom{from{transform:translateY(0)}to{transform:translateY(100%)}}@keyframes slideOutFromBottom{from{transform:translateY(0)}to{transform:translateY(100%)}}@-webkit-keyframes slideInFromRight{from{transform:translateX(100%)}to{transform:translateX(0)}}@keyframes slideInFromRight{from{transform:translateX(100%)}to{transform:translateX(0)}}@-webkit-keyframes slideOutFromRight{from{transform:translateX(0)}to{transform:translateX(100%)}}@keyframes slideOutFromRight{from{transform:translateX(0)}to{transform:translateX(100%)}}";let B=class{constructor(i){t(this,i),this.position="bottom",this.sourceImage=null,this.sidebarTitle="Visually similar products",this.modalScrollbar=!1}render(){return i(e,null,i("button",{class:"open-button",part:"button",onClick:()=>this.handleClick()},i("slot",null,i(C,null))))}handleClick(){const t=document.createElement("vviinn-recommendations-sidebar");t.sidebarTitle=this.sidebarTitle,t.productId=this.productId,t.token=this.token,t.position=this.position,t.sourceImage=this.sourceImage,t.widgetScrollbar=this.modalScrollbar,t.addEventListener("modalClosed",(()=>{document.body.removeChild(t)})),document.body.append(t)}};B.style=":host{display:block}.open-button{align-items:center;background:rgba(255, 255, 255, 0.8);border-radius:50%;border:none;box-shadow:0px 2px 6px rgba(0, 0, 0, 0.15);box-sizing:border-box;cursor:pointer;display:grid;height:40px;justify-items:center;padding:0;width:40px;transition:all 0.25s ease-in-out}.open-button:hover{box-shadow:0px 2px 6px rgba(0, 0, 0, 0.25)}.open-button:focus{border:2px solid rgba(15, 98, 254, 0.5);outline:none}.open-button:active{background:#F4F4F4;outline:none}";const D=l.flow((t=>`Bearer ${t}`),(t=>new Headers({Authorization:t})),(t=>({headers:t}))),$=b(f),T=(t,i={})=>_($(g(),v),m,u(p(t,i))),L=t=>i=>T(`product/${t}/similar-products`,i),X=t=>i=>T(`product/${t}/cross-selling-products`,i);function M(t){return"function"==typeof t}function N(t){const i=t((t=>{Error.call(t),t.stack=(new Error).stack}));return i.prototype=Object.create(Error.prototype),i.prototype.constructor=i,i}const Y=N((t=>function(i){t(this),this.message=i?`${i.length} errors occurred during unsubscription:\n${i.map(((t,i)=>`${i+1}) ${t.toString()}`)).join("\n ")}`:"",this.name="UnsubscriptionError",this.errors=i}));function W(t,i){if(t){const e=t.indexOf(i);0<=e&&t.splice(e,1)}}class G{constructor(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}unsubscribe(){let t;if(!this.closed){this.closed=!0;const{_parentage:i}=this;if(i)if(this._parentage=null,Array.isArray(i))for(const t of i)t.remove(this);else i.remove(this);const{initialTeardown:e}=this;if(M(e))try{e()}catch(i){t=i instanceof Y?i.errors:[i]}const{_finalizers:r}=this;if(r){this._finalizers=null;for(const i of r)try{H(i)}catch(i){t=null!=t?t:[],i instanceof Y?t=[...t,...i.errors]:t.push(i)}}if(t)throw new Y(t)}}add(t){var i;if(t&&t!==this)if(this.closed)H(t);else{if(t instanceof G){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=null!==(i=this._finalizers)&&void 0!==i?i:[]).push(t)}}_hasParent(t){const{_parentage:i}=this;return i===t||Array.isArray(i)&&i.includes(t)}_addParent(t){const{_parentage:i}=this;this._parentage=Array.isArray(i)?(i.push(t),i):i?[i,t]:t}_removeParent(t){const{_parentage:i}=this;i===t?this._parentage=null:Array.isArray(i)&&W(i,t)}remove(t){const{_finalizers:i}=this;i&&W(i,t),t instanceof G&&t._removeParent(this)}}G.EMPTY=(()=>{const t=new G;return t.closed=!0,t})();const U=G.EMPTY;function q(t){return t instanceof G||t&&"closed"in t&&M(t.remove)&&M(t.add)&&M(t.unsubscribe)}function H(t){M(t)?t():t.unsubscribe()}const J={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},K={setTimeout(t,i,...e){const{delegate:r}=K;return(null==r?void 0:r.setTimeout)?r.setTimeout(t,i,...e):setTimeout(t,i,...e)},clearTimeout(t){const{delegate:i}=K;return((null==i?void 0:i.clearTimeout)||clearTimeout)(t)},delegate:void 0};function Q(){}const Z=tt("C",void 0,void 0);function tt(t,i,e){return{kind:t,value:i,error:e}}function it(t){t()}class et extends G{constructor(t){super(),this.isStopped=!1,t?(this.destination=t,q(t)&&t.add(this)):this.destination=ct}static create(t,i,e){return new ot(t,i,e)}next(t){this.isStopped?lt(function(t){return tt("N",t,void 0)}(t),this):this._next(t)}error(t){this.isStopped?lt(tt("E",void 0,t),this):(this.isStopped=!0,this._error(t))}complete(){this.isStopped?lt(Z,this):(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe(),this.destination=null)}_next(t){this.destination.next(t)}_error(t){try{this.destination.error(t)}finally{this.unsubscribe()}}_complete(){try{this.destination.complete()}finally{this.unsubscribe()}}}const rt=Function.prototype.bind;function nt(t,i){return rt.call(t,i)}class st{constructor(t){this.partialObserver=t}next(t){const{partialObserver:i}=this;if(i.next)try{i.next(t)}catch(t){at(t)}}error(t){const{partialObserver:i}=this;if(i.error)try{i.error(t)}catch(t){at(t)}else at(t)}complete(){const{partialObserver:t}=this;if(t.complete)try{t.complete()}catch(t){at(t)}}}class ot extends et{constructor(t,i,e){let r;if(super(),M(t)||!t)r={next:null!=t?t:void 0,error:null!=i?i:void 0,complete:null!=e?e:void 0};else{let i;this&&J.useDeprecatedNextContext?(i=Object.create(t),i.unsubscribe=()=>this.unsubscribe(),r={next:t.next&&nt(t.next,i),error:t.error&&nt(t.error,i),complete:t.complete&&nt(t.complete,i)}):r=t}this.destination=new st(r)}}function at(t){var i;i=t,K.setTimeout((()=>{const{onUnhandledError:t}=J;if(!t)throw i;t(i)}))}function lt(t,i){const{onStoppedNotification:e}=J;e&&K.setTimeout((()=>e(t,i)))}const ct={closed:!0,next:Q,error:function(t){throw t},complete:Q},ht="function"==typeof Symbol&&Symbol.observable||"@@observable";function dt(t){return t}class ut{constructor(t){t&&(this._subscribe=t)}lift(t){const i=new ut;return i.source=this,i.operator=t,i}subscribe(t,i,e){const r=(n=t)&&n instanceof et||function(t){return t&&M(t.next)&&M(t.error)&&M(t.complete)}(n)&&q(n)?t:new ot(t,i,e);var n;return it((()=>{const{operator:t,source:i}=this;r.add(t?t.call(r,i):i?this._subscribe(r):this._trySubscribe(r))})),r}_trySubscribe(t){try{return this._subscribe(t)}catch(i){t.error(i)}}forEach(t,i){return new(i=pt(i))(((i,e)=>{const r=new ot({next:i=>{try{t(i)}catch(t){e(t),r.unsubscribe()}},error:e,complete:i});this.subscribe(r)}))}_subscribe(t){var i;return null===(i=this.source)||void 0===i?void 0:i.subscribe(t)}[ht](){return this}pipe(...t){return(0===(i=t).length?dt:1===i.length?i[0]:function(t){return i.reduce(((t,i)=>i(t)),t)})(this);var i}toPromise(t){return new(t=pt(t))(((t,i)=>{let e;this.subscribe((t=>e=t),(t=>i(t)),(()=>t(e)))}))}}function pt(t){var i;return null!==(i=null!=t?t:J.Promise)&&void 0!==i?i:Promise}ut.create=t=>new ut(t);const mt=N((t=>function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}));class gt extends ut{constructor(){super(),this.closed=!1,this.currentObservers=null,this.observers=[],this.isStopped=!1,this.hasError=!1,this.thrownError=null}lift(t){const i=new vt(this,this);return i.operator=t,i}_throwIfClosed(){if(this.closed)throw new mt}next(t){it((()=>{if(this._throwIfClosed(),!this.isStopped){this.currentObservers||(this.currentObservers=Array.from(this.observers));for(const i of this.currentObservers)i.next(t)}}))}error(t){it((()=>{if(this._throwIfClosed(),!this.isStopped){this.hasError=this.isStopped=!0,this.thrownError=t;const{observers:i}=this;for(;i.length;)i.shift().error(t)}}))}complete(){it((()=>{if(this._throwIfClosed(),!this.isStopped){this.isStopped=!0;const{observers:t}=this;for(;t.length;)t.shift().complete()}}))}unsubscribe(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null}get observed(){var t;return(null===(t=this.observers)||void 0===t?void 0:t.length)>0}_trySubscribe(t){return this._throwIfClosed(),super._trySubscribe(t)}_subscribe(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)}_innerSubscribe(t){const{hasError:i,isStopped:e,observers:r}=this;return i||e?U:(this.currentObservers=null,r.push(t),new G((()=>{this.currentObservers=null,W(r,t)})))}_checkFinalizedStatuses(t){const{hasError:i,thrownError:e,isStopped:r}=this;i?t.error(e):r&&t.complete()}asObservable(){const t=new ut;return t.source=this,t}}gt.create=(t,i)=>new vt(t,i);class vt extends gt{constructor(t,i){super(),this.destination=t,this.source=i}next(t){var i,e;null===(e=null===(i=this.destination)||void 0===i?void 0:i.next)||void 0===e||e.call(i,t)}error(t){var i,e;null===(e=null===(i=this.destination)||void 0===i?void 0:i.error)||void 0===e||e.call(i,t)}complete(){var t,i;null===(i=null===(t=this.destination)||void 0===t?void 0:t.complete)||void 0===i||i.call(t)}_subscribe(t){var i,e;return null!==(e=null===(i=this.source)||void 0===i?void 0:i.subscribe(t))&&void 0!==e?e:U}}let bt=class{constructor(i){t(this,i),this.recommendationsLoaded=n(this,"recommendationsLoaded",7),this.blockTitle="Recommended products",this.imageRatio=1,this.imageWidth=300,this.currencySign="€",this.mode="continuity",this.campaignType="VPR",this.locale="de-DE",this.apiPath="https://api.vviinn.com",this.useCarousel=!0,this.showScroll=!0,this.cssUrl=null,this.recommendations=[],this.loaded=!1,this.productImageLoadedSubject=new gt}handleProductIdChange(){this.getRecommendations()}handleCampaignTypeChange(){this.getRecommendations()}handleApiPathChange(t){w.apiPath=t,this.getRecommendations()}lol({detail:t}){this.productImageLoadedSubject.next(t)}connectedCallback(){w.apiPath=this.apiPath,w.currencySign=this.currencySign,w.locale=this.locale}async componentWillLoad(){w.pricePrefix=this.pricePrefix,w.currencySign=this.currencySign,this.getRecommendations()}async getRecommendations(){if(void 0===this.productId||void 0===this.token)return;const t=this.campaignType.length>0?this.campaignType:"VPR",i=D(this.token),e=l.pipe(x.of((t=>{return l.pipe("VPR"===t?{_tag:"VPR"}:{_tag:"VCS"},(i=()=>L,e=()=>X,t=>(t=>"VPR"===t._tag)(t)?i():e()));var i,e})(t)),x.ap(x.of(this.productId)),x.ap(x.of(i)),x.flatten),r=await e();l.pipe(r,c.fold((t=>this.handleError(t)),(t=>this.handleRecommendationsSucces(t))))}handleError(t){console.log("ERROR:",t)}handleRecommendationsSucces(t){var i;this.recommendations=null!==(i=null==t?void 0:t.extended)&&void 0!==i?i:t,h.results=this.recommendations,this.loaded=!0,this.productIds=this.recommendations.map((t=>t.productId)),this.productImageLoadedSubject.subscribe((t=>{this.productIds=this.productIds.filter((i=>i!==t)),0===this.productIds.length&&this.recommendationsLoaded.emit()}))}isExternalCSS(){return this.cssUrl&&this.cssUrl.length>0}renderExternalCSS(){return this.isExternalCSS()?i("link",{href:this.cssUrl,rel:"stylesheet"}):""}render(){return i(e,{class:{loaded:this.loaded,empty:0==this.recommendations.length,[this.mode]:!0},"aria-hidden":this.loaded?"false":"true"},this.renderExternalCSS(),i("style",null,w.fallbackStyles),i("h2",{part:"recommendations-title"},this.blockTitle),this.useCarousel?this.renderCarousel():this.renderResults())}renderRecommendation(t){return i("vviinn-product-card",{part:"product-part",productId:t.productId,productTitle:t.title,deeplink:t.deeplink,image:t.image.thumbnail,brand:t.brand,imageWidth:this.imageWidth,imageRatio:1,price:t.price.actual,salePrice:t.price.sale,responsive:"grid"===this.mode,dimmedBackground:this.useDimmedBackgroundInCard()})}useDimmedBackgroundInCard(){return"continuity"===this.mode||!this.useCarousel}renderResults(){return i("div",{class:"recommendations-grid",part:"recommendations-grid"},this.recommendations.map((t=>this.renderRecommendation(t))))}renderCarousel(){return i("vviinn-carousel",{mode:this.mode,imageWidth:this.imageWidth,showScroll:this.showScroll,recommendations:this.recommendations})}get el(){return r(this)}static get watchers(){return{productId:["handleProductIdChange"],campaignType:["handleCampaignTypeChange"],apiPath:["handleApiPathChange"]}}};bt.style=":host{display:grid;grid-gap:1rem;width:100%}:host(:not(.loaded)){position:absolute;visibility:hidden}:host(.grid) vviinn-product-card::part(image){border:1px solid #DDDDDD;width:100%}h2{margin:0}vviinn-product-card::part(price-container){align-self:flex-start;text-align:left;display:flex}.results{display:grid;grid-gap:1rem}.visually-hidden{position:absolute;top:0;left:0;z-index:-1;height:0;width:0}h2{margin:0}:host(.grid) h2{justify-content:center}:host(.grid) vviinn-product-card::part(image){min-width:100%}:host(.grid) vviinn-product-card::part(image-link){width:100%}:host(.grid) vviinn-product-card::part(title),:host(.grid) vviinn-product-card::part(brand),:host(.grid) vviinn-product-card::part(type){text-align:center}:host(.grid) vviinn-product-card::part(price-container){align-self:center}:host(.continuity) vviinn-product-card::part(title),:host(.continuity) vviinn-product-card::part(brand),:host(.continuity) vviinn-product-card::part(type),:host(.continuity) vviinn-product-card::part(deeplink){text-align:left;max-width:unset;align-self:start}";export{R as vviinn_carousel,j as vviinn_product_card,A as vviinn_recommendations_sidebar,B as vviinn_vpr_button,bt as vviinn_vpr_widget}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as e,h as i,H as s,g as r}from"./p-
|
|
1
|
+
import{r as t,c as e,h as i,H as s,g as r}from"./p-e1ba8626.js";import{b as n}from"./p-56fc949a.js";import{S as a}from"./p-e67cae57.js";let o=class{constructor(i){t(this,i),this.globalSlotsChanged=e(this,"globalSlotsChanged",7),this.currencySign="€",this.locale="de-DE",this.pressed=!1}handleModalClosed(){this.pressed=!1}componentDidLoad(){const t=this.el.querySelectorAll("[slot]");this.globalSlotsChanged.emit(Array.from(t))}handleKeyDown(t){"Enter"!==t.code&&"Space"!==t.code||(this.pressed=!0)}handleClick(){this.pressed=!0}render(){return i(s,{tabindex:"0",role:"button",pressed:this.pressed,onClick:()=>this.handleClick(),onKeyDown:t=>this.handleKeyDown(t)},i("slot",null,i(n,null)),i(a,null),i("vviinn-vps-widget",{active:this.pressed,"currency-sign":"€",token:this.token,locale:this.locale,apiPath:this.apiPath,exportparts:"brand, currency, deeplink, image, image-link, price-amount, price-container, price-outdated, price-prefix, price-regular, price-sale, title, product-card"}))}get el(){return r(this)}};o.style="";export{o as vviinn_vps_button}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as a}from"./p-
|
|
1
|
+
import{h as a}from"./p-e1ba8626.js";const l=()=>a("svg",{width:"12",height:"20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a("path",{d:"M0 10 10 0l1.4 1.4L2.8 10l8.6 8.6L10 20 0 10Z"})),h=()=>a("svg",{xmlns:"http://www.w3.org/2000/svg",width:"28",height:"28",fill:"none"},a("defs",null),a("path",{fill:"#525252","fill-rule":"evenodd",d:"M9.771 3.89a.875.875 0 01.728-.39h7c.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.25A2.625 2.625 0 012.625 21V8.75A2.625 2.625 0 015.25 6.125h3.031l1.49-2.235zm1.197 1.36l-1.49 2.235a.875.875 0 01-.729.39H5.25a.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"}),a("path",{fill:"#525252","fill-rule":"evenodd",d:"M14 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"})),t=()=>a("svg",{xmlns:"http://www.w3.org/2000/svg",width:"120",height:"120",fill:"none"},a("defs",null),a("path",{fill:"#393939",d:"M74.55 20a5.06 5.06 0 014.14 2l4.72 9.32.1.18.11.17A5.07 5.07 0 0087.93 34h13.87c5.07 0 9.2 3.59 9.2 8v50c0 4.41-4.13 8-9.2 8H18.2c-5.07 0-9.2-3.59-9.2-8V42c0-4.41 4.13-8 9.2-8h13.87a5.072 5.072 0 004.31-2.34l.11-.17.1-.18L41.31 22a5.06 5.06 0 014.14-2h29.1zm0-4h-29.1a9 9 0 00-7.6 4L33 29.5a1.13 1.13 0 01-1 .5H18.2C10.91 30 5 35.37 5 42v50c0 6.63 5.91 12 13.2 12h83.6c7.29 0 13.2-5.37 13.2-12V42c0-6.63-5.91-12-13.2-12H87.93a1.13 1.13 0 01-1-.5L82.15 20a9 9 0 00-7.6-4z"}),a("path",{fill:"#393939",d:"M96 46a4 4 0 110 8 4 4 0 010-8zm0-4a8 8 0 100 16.001A8 8 0 0096 42z"}),a("path",{class:"colored",d:"M60 42a24 24 0 100 48.001A24 24 0 0060 42zm12 26H62v10a2 2 0 01-4 0V68H48a2 2 0 010-4h10V54a2 2 0 014 0v10h10a2 2 0 110 4z"})),s=()=>a("svg",{xmlns:"http://www.w3.org/2000/svg",width:"120",height:"120",fill:"none"},a("defs",null),a("path",{fill:"#393939",d:"M110.35 96.52l-24.8-22.66a6.22 6.22 0 00-8.14-.27l-.09.07-10.57 8.93-18.33-17.88a6.001 6.001 0 00-8.51-.35L8.69 91.49a2 2 0 002.62 3l31.3-27.2a2 2 0 012.233-.359 2 2 0 01.637.479l.1.1 45 43.9a2.005 2.005 0 002.83-.03 2.003 2.003 0 00-.03-2.83L69.63 85.39l10.22-8.63a2.3 2.3 0 013 .07l24.77 22.65c.377.343.871.529 1.38.52a2 2 0 001.35-3.48zM75 31a10 10 0 110 20 10 10 0 010-20zm0-4a14 14 0 100 28 14 14 0 000-28z"}),a("path",{class:"colored",d:"M12 36H8V20A12 12 0 0120 8h16v4H20a8 8 0 00-8 8v16zM112 36h-4V20a8.001 8.001 0 00-8-8H84V8h16a11.998 11.998 0 0112 12v16zM36 112H20a11.998 11.998 0 01-12-12V84h4v16a8 8 0 008 8h16v4zM100 112H84v-4h16a8 8 0 008-8V84h4v16c0 3.183-1.264 6.235-3.515 8.485A11.996 11.996 0 01100 112z"})),v=()=>a("svg",{xmlns:"http://www.w3.org/2000/svg",width:"120",height:"120",fill:"none"},a("defs",null),a("path",{class:"colored",d:"M84.09 43.24a.53.53 0 00-.29-.48L60.28 29.4a.522.522 0 00-.27-.07.531.531 0 00-.28.07L36.2 42.76a.54.54 0 000 1l23.53 13.3a.54.54 0 00.55 0L83.8 43.72a.53.53 0 00.29-.48zM57.28 61.23L33.73 47.88a.569.569 0 00-.85.48V75a.54.54 0 00.29.48L56.72 88.8a.56.56 0 00.56 0 .53.53 0 00.28-.48V61.71a.56.56 0 00-.28-.48zM86.84 47.88a.63.63 0 00-.29-.08.55.55 0 00-.28.08L62.73 61.23a.56.56 0 00-.28.48v26.61a.53.53 0 00.28.48.56.56 0 00.56 0l23.54-13.29a.54.54 0 00.29-.48V48.36a.55.55 0 00-.28-.48z"}),a("path",{class:"colored",d:"M100 7.94H20a12 12 0 00-12 12v80a11.998 11.998 0 0012 12h80c3.183 0 6.235-1.264 8.485-3.515A11.996 11.996 0 00112 99.94v-80a11.998 11.998 0 00-12-12zm-8 69.24a1.69 1.69 0 01-.85 1.45l-30.31 17.1a1.77 1.77 0 01-1.67 0l-30.32-17.1a1.689 1.689 0 01-.85-1.45V42.82a1.66 1.66 0 01.85-1.45l30.32-17.21a1.71 1.71 0 011.67 0l30.31 17.21a1.67 1.67 0 01.85 1.45v34.36z"})),w=()=>a("svg",{width:"14",height:"11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a("path",{d:"M5 10.414 0 5.413 1.413 4 5 7.586 12.585 0 14 1.415l-9 8.999Z",fill:"var(--color-primary, var(--color-primary-system))"})),e=()=>a("svg",{width:"9",height:"16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a("path",{d:"m9 8-7.895 8L0 14.88 6.79 8 0 1.12 1.105 0 9 8Z",fill:"#525252"})),i=()=>a("svg",{width:"22",height:"22",xmlns:"http://www.w3.org/2000/svg"},a("path",{d:"M18 0h-3v2h3c1.103 0 2 .897 2 2v3h2V4c0-2.206-1.794-4-4-4Zm2 18c0 1.103-.897 2-2 2h-3v2h3c2.206 0 4-1.794 4-4v-3h-2v3ZM2 18v-3H0v3c0 2.206 1.794 4 4 4h3v-2H4c-1.103 0-2-.897-2-2ZM2 4c0-1.103.897-2 2-2h3V0H4C1.794 0 0 1.794 0 4v3h2V4Zm6 6.5C8 9.122 9.122 8 10.5 8S13 9.122 13 10.5 11.878 13 10.5 13A2.503 2.503 0 0 1 8 10.5Zm7.5 6.5a1.503 1.503 0 0 0 1.061-2.561l-2.012-2.011c.293-.6.448-1.26.451-1.928C15 8.019 12.981 6 10.5 6A4.505 4.505 0 0 0 6 10.5c0 2.481 2.019 4.5 4.5 4.5.693 0 1.341-.17 1.928-.451l2.011 2.012c.293.293.677.439 1.061.439Z"})),d=()=>a("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a("path",{d:"M16 1.4L14.6 0L8 6.6L1.4 0L0 1.4L6.6 8L0 14.6L1.4 16L8 9.4L14.6 16L16 14.6L9.4 8L16 1.4Z",fill:"#161616"}));export{l as A,e as C,t as O,i as V,d as a,h as b,w as c,s as d,v as e}
|