vviinn-widgets 2.220.0 → 2.222.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{SecondaryActionIcon-Ng84u7-b.js → SecondaryActionIcon-CuNEBTWD.js} +1 -1
- package/dist/cjs/{cssUrlHelper-BX9kngtZ.js → cssUrlHelper-B5A2BBm7.js} +1 -1
- package/dist/cjs/{index-CvMi8_tX.js → index-BF9aENF8.js} +6 -2
- package/dist/cjs/{index-D38ORu31.js → index-BU8FMTXn.js} +3 -0
- package/dist/cjs/{index-CBteD3gC.js → index-CP1QUrJT.js} +11 -1
- package/dist/cjs/{index-FE9nOqQo.js → index-RlbsyJJk.js} +2 -2
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/{search.store-C6QU_D02.js → search.store-D4WiAMcl.js} +8 -3
- package/dist/cjs/vviinn-button_6.cjs.entry.js +13 -13
- package/dist/cjs/vviinn-camera_12.cjs.entry.js +219 -115
- package/dist/cjs/vviinn-carousel_10.cjs.entry.js +9 -9
- package/dist/cjs/vviinn-detected-object_2.cjs.entry.js +2 -2
- package/dist/cjs/vviinn-shop-the-look.cjs.entry.js +6 -6
- package/dist/cjs/vviinn-text-search.cjs.entry.js +11 -9
- package/dist/cjs/vviinn-vps-button.cjs.entry.js +15 -6
- package/dist/cjs/vviinn-widgets.cjs.js +2 -2
- package/dist/collection/Image/error.js +6 -1
- package/dist/collection/components/customized-slots.js +2 -0
- package/dist/collection/components/vviinn-icons/icons/DragDropImageIcon.js +2 -0
- package/dist/collection/components/vviinn-icons/index.js +1 -0
- package/dist/collection/components/vviinn-image-selector/vviinn-image-selector.css +36 -1
- package/dist/collection/components/vviinn-image-selector/vviinn-image-selector.js +132 -21
- package/dist/collection/components/vviinn-modal/vviinn-modal.js +2 -2
- package/dist/collection/components/vviinn-overlay/vviinn-overlay.js +1 -1
- package/dist/collection/components/vviinn-overlayed-modal/vviinn-overlayed-modal.js +1 -1
- package/dist/collection/components/vviinn-preloader/vviinn-preloader.js +1 -1
- package/dist/collection/components/vviinn-privacy-badge/vviinn-privacy-badge.js +1 -1
- package/dist/collection/components/vviinn-product-card/vviinn-energy-label/vviinn-energy-label.js +2 -2
- package/dist/collection/components/vviinn-results/vviinn-results.js +3 -3
- package/dist/collection/components/vviinn-shop-the-look/vviinn-shop-the-look.js +1 -1
- package/dist/collection/components/vviinn-skeleton/vviinn-skeleton.js +1 -1
- package/dist/collection/components/vviinn-slider/vviinn-slide/vviinn-slide.js +1 -1
- package/dist/collection/components/vviinn-slider/vviinn-slider.js +1 -1
- package/dist/collection/components/vviinn-suggestions/helpers.js +27 -10
- package/dist/collection/components/vviinn-suggestions/render-helpers.js +42 -15
- package/dist/collection/components/vviinn-teaser/vviinn-teaser.js +1 -1
- package/dist/collection/components/vviinn-text-search/vviinn-text-search.js +27 -5
- package/dist/collection/components/vviinn-vpr-button/recommendations-sidebar/recommendations-sidebar.js +3 -3
- package/dist/collection/components/vviinn-vpr-button/vviinn-vpr-button.js +1 -1
- package/dist/collection/components/vviinn-vps-button/vviinn-vps-button.js +37 -4
- package/dist/collection/components/vviinn-vps-widget/vviinn-vps-widget.css +35 -1
- package/dist/collection/components/vviinn-vps-widget/vviinn-vps-widget.js +37 -14
- package/dist/collection/cssParts/index.js +2 -0
- package/dist/collection/dom/index.js +7 -0
- package/dist/collection/helpers/dragAndDrop/parseDroppedFile.js +2 -0
- package/dist/collection/locale/resources.js +4 -2
- package/dist/esm/{SecondaryActionIcon-FWFzrhba.js → SecondaryActionIcon-D4f3aMUD.js} +1 -1
- package/dist/esm/{cssUrlHelper-DsQD_dY6.js → cssUrlHelper-Byz4s-MD.js} +1 -1
- package/dist/esm/{index-RkvPN2Rk.js → index-B89nCb_F.js} +3 -0
- package/dist/esm/{index-BtnjaTty.js → index-BCrstDkj.js} +6 -2
- package/dist/esm/{index-OsoUj2Au.js → index-C1-PYhS4.js} +11 -2
- package/dist/esm/{index-ChtanA0O.js → index-CEzGPs5u.js} +2 -2
- package/dist/esm/loader.js +3 -3
- package/dist/esm/{search.store-BVRhMpHA.js → search.store-Cgs5icgA.js} +8 -3
- package/dist/esm/vviinn-button_6.entry.js +13 -13
- package/dist/esm/vviinn-camera_12.entry.js +219 -115
- package/dist/esm/vviinn-carousel_10.entry.js +9 -9
- package/dist/esm/vviinn-detected-object_2.entry.js +2 -2
- package/dist/esm/vviinn-shop-the-look.entry.js +6 -6
- package/dist/esm/vviinn-text-search.entry.js +11 -9
- package/dist/esm/vviinn-vps-button.entry.js +15 -6
- package/dist/esm/vviinn-widgets.js +3 -3
- package/dist/types/components/vviinn-icons/icons/DragDropImageIcon.d.ts +1 -0
- package/dist/types/components/vviinn-icons/index.d.ts +1 -0
- package/dist/types/components/vviinn-image-selector/vviinn-image-selector.d.ts +11 -0
- package/dist/types/components/vviinn-suggestions/helpers.d.ts +1 -0
- package/dist/types/components/vviinn-text-search/vviinn-text-search.d.ts +2 -0
- package/dist/types/components/vviinn-vps-button/vviinn-vps-button.d.ts +6 -0
- package/dist/types/components/vviinn-vps-widget/vviinn-vps-widget.d.ts +2 -0
- package/dist/types/components.d.ts +32 -0
- package/dist/types/dom/index.d.ts +1 -0
- package/dist/types/helpers/dragAndDrop/parseDroppedFile.d.ts +2 -0
- package/dist/vviinn-widgets/p-0b7e8e2e.entry.js +1 -0
- package/dist/vviinn-widgets/{p-a8d88d55.entry.js → p-27b41f88.entry.js} +1 -1
- package/dist/vviinn-widgets/p-7411202d.entry.js +1 -0
- package/dist/vviinn-widgets/p-818a1e53.entry.js +1 -0
- package/dist/vviinn-widgets/{p-CU3f7I7a.js → p-B246LK7U.js} +1 -1
- package/dist/vviinn-widgets/{p-RkvPN2Rk.js → p-B89nCb_F.js} +1 -1
- package/dist/vviinn-widgets/p-BadZr0hq.js +1 -0
- package/dist/vviinn-widgets/{p-D3wRLf2J.js → p-BfTXDLup.js} +1 -1
- package/dist/vviinn-widgets/p-Bq5Hj7Kz.js +1 -0
- package/{www/build/p-CZFFW_Cj.js → dist/vviinn-widgets/p-Cxd6yzhY.js} +1 -1
- package/dist/vviinn-widgets/{p-6vxKTHCE.js → p-DvD16Fp_.js} +1 -1
- package/{www/build/p-a145a231.entry.js → dist/vviinn-widgets/p-c1eac87b.entry.js} +1 -1
- package/dist/vviinn-widgets/p-df4365fb.entry.js +1 -0
- package/{www/build/p-1888506e.entry.js → dist/vviinn-widgets/p-df9a1d66.entry.js} +1 -1
- package/dist/vviinn-widgets/vviinn-widgets.esm.js +1 -1
- package/package.json +1 -2
- package/www/build/p-0b7e8e2e.entry.js +1 -0
- package/www/build/{p-a8d88d55.entry.js → p-27b41f88.entry.js} +1 -1
- package/www/build/p-7411202d.entry.js +1 -0
- package/www/build/p-818a1e53.entry.js +1 -0
- package/www/build/{p-CU3f7I7a.js → p-B246LK7U.js} +1 -1
- package/www/build/{p-RkvPN2Rk.js → p-B89nCb_F.js} +1 -1
- package/www/build/p-BadZr0hq.js +1 -0
- package/www/build/{p-D3wRLf2J.js → p-BfTXDLup.js} +1 -1
- package/www/build/p-Bq5Hj7Kz.js +1 -0
- package/{dist/vviinn-widgets/p-CZFFW_Cj.js → www/build/p-Cxd6yzhY.js} +1 -1
- package/www/build/{p-6vxKTHCE.js → p-DvD16Fp_.js} +1 -1
- package/{dist/vviinn-widgets/p-a145a231.entry.js → www/build/p-c1eac87b.entry.js} +1 -1
- package/www/build/p-df4365fb.entry.js +1 -0
- package/{dist/vviinn-widgets/p-1888506e.entry.js → www/build/p-df9a1d66.entry.js} +1 -1
- package/www/build/{p-1f41ab53.js → p-e969c76d.js} +1 -1
- package/www/build/vviinn-widgets.esm.js +1 -1
- package/www/index.html +1 -1
- package/dist/vviinn-widgets/p-55582bb6.entry.js +0 -1
- package/dist/vviinn-widgets/p-773cdbb0.entry.js +0 -1
- package/dist/vviinn-widgets/p-7f9e1cff.entry.js +0 -1
- package/dist/vviinn-widgets/p-CPTOq59a.js +0 -1
- package/dist/vviinn-widgets/p-DKHkeCw7.js +0 -1
- package/dist/vviinn-widgets/p-ffbd1062.entry.js +0 -1
- package/www/build/p-55582bb6.entry.js +0 -1
- package/www/build/p-773cdbb0.entry.js +0 -1
- package/www/build/p-7f9e1cff.entry.js +0 -1
- package/www/build/p-CPTOq59a.js +0 -1
- package/www/build/p-DKHkeCw7.js +0 -1
- package/www/build/p-ffbd1062.entry.js +0 -1
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { h, r as registerInstance, c as createEvent, H as Host, g as getElement, F as Fragment } from './index-
|
|
1
|
+
import { h, r as registerInstance, c as createEvent, H as Host, g as getElement, F as Fragment } from './index-B89nCb_F.js';
|
|
2
2
|
import { _ as _functionExports, E as EitherExports, f as fold, b as fromImage, a as divideOnSized, e as isLeft, m as match, O as OptionExports } from './Rectangle-dmgo4KMB.js';
|
|
3
|
-
import { t as toFile, c as makeUploadFileRequest, w as getImageSizes, v as version, f as campaignTypeNames, h as addIfNotEmpty, m as makeVisualSearchRequest, u as useSearchStore, x as checkImageType, g as getAcceptableFileFormats, d as setTextSearchQuery, y as resetStore, j as makeTextSearchRequest, z as makeProductListingPageRequest, A as checkDeviceType, p as parseStringToExcluded } from './search.store-
|
|
4
|
-
import { s as slotChangeListener, a as addEventListenersWithSignal, p as productCardSlotNames, v as vprIconSlotName, f as findSlotElements, g as getSlotNames, b as setElementInteractivity, S as SlotSkeleton } from './index-
|
|
5
|
-
import { g as getRemoveFilterAriaLabel, F as FilterIconClose, P as PlusIcon, R as RESULTS_CALCULATED_COLUMNS_CSS_VAR, c as createWidgetEvent, a as createFilterEvent, v as v4, b as createAddToBasketEvent, d as createAddToWishlistEvent, e as createResultEventByType, f as createProductEventByType, h as getCustomLabels, t as triggerFilter, i as triggerRemoveIntervalFilter, j as announceToScreenReader, s as syncRequestFilters, k as isSubFilterActive, l as RenderFilterButton, m as getIntervalLabel, n as createImageSearchEvent } from './index-
|
|
3
|
+
import { t as toFile, c as makeUploadFileRequest, w as getImageSizes, v as version, f as campaignTypeNames, h as addIfNotEmpty, m as makeVisualSearchRequest, u as useSearchStore, x as checkImageType, g as getAcceptableFileFormats, d as setTextSearchQuery, y as resetStore, j as makeTextSearchRequest, z as makeProductListingPageRequest, A as checkDeviceType, p as parseStringToExcluded } from './search.store-Cgs5icgA.js';
|
|
4
|
+
import { s as slotChangeListener, a as addEventListenersWithSignal, p as productCardSlotNames, v as vprIconSlotName, f as findSlotElements, g as getSlotNames, b as setElementInteractivity, S as SlotSkeleton } from './index-C1-PYhS4.js';
|
|
5
|
+
import { g as getRemoveFilterAriaLabel, F as FilterIconClose, P as PlusIcon, R as RESULTS_CALCULATED_COLUMNS_CSS_VAR, c as createWidgetEvent, a as createFilterEvent, v as v4, b as createAddToBasketEvent, d as createAddToWishlistEvent, e as createResultEventByType, f as createProductEventByType, h as getCustomLabels, t as triggerFilter, i as triggerRemoveIntervalFilter, j as announceToScreenReader, s as syncRequestFilters, k as isSubFilterActive, l as RenderFilterButton, m as getIntervalLabel, n as createImageSearchEvent } from './index-CEzGPs5u.js';
|
|
6
6
|
import { i as instance, t as trackEvent, a as isTrackingEnabled, d as defaultConfig } from './store-BJxQCbNV.js';
|
|
7
7
|
import { M as MIN_SEARCH_AREA_SIZE, S as SUPPORTED_ASPECT_RATIO, a as MIN_IMAGE_SIDE_FOR_CROPPER, C as Cropper, c as cropperOptions, g as getCropBoxData, i as isCropBoxChangeMinimal, D as DEFAULT_IMAGE_SIZE } from './cropperUtils-CkB6bG3L.js';
|
|
8
|
-
import { r as renderExternalCSS } from './cssUrlHelper-
|
|
9
|
-
import { i as initializeLocale, d as productCardsGridPart, p as productCardParts, l as listCardParts, e as contentCardParts, f as selectedFiltersParts, g as suggestionsParts, h as filtersParts, j as extendedFiltersParts, m as modalParts, b as searchBarParts, k as searchWidgetFilterParts, n as searchWidgetButtonParts } from './index-
|
|
8
|
+
import { r as renderExternalCSS } from './cssUrlHelper-Byz4s-MD.js';
|
|
9
|
+
import { i as initializeLocale, d as productCardsGridPart, p as productCardParts, l as listCardParts, e as contentCardParts, f as selectedFiltersParts, g as suggestionsParts, h as filtersParts, j as extendedFiltersParts, m as modalParts, b as searchBarParts, k as searchWidgetFilterParts, n as searchWidgetButtonParts } from './index-BCrstDkj.js';
|
|
10
10
|
import { i as isOnResultsPage, a as parseResultsPageParams, p as parseResultsPageParamNames, c as buildImageSearchRedirectUrl } from './resultsPageUrl-DbOxfJSz.js';
|
|
11
11
|
import { R as RESULTS_WIDGET_IMAGE_RESOLUTION_WIDTH, b as SCROLL_TO_DISCOVERY_DELAY, S as SEARCH_WIDGET_IMAGE_RESOLUTION_WIDTH } from './constants-rqiiCPBX.js';
|
|
12
12
|
import { o as openProductLink } from './openProductLink-C7_qzUNW.js';
|
|
@@ -29,6 +29,9 @@ const UploadActionIcon = () => (h("svg", { xmlns: "http://www.w3.org/2000/svg",
|
|
|
29
29
|
const PhotoFrameCorner = ({ className }) => (h("svg", { width: "34", height: "34", viewBox: "0 0 34 34", fill: "none", xmlns: "http://www.w3.org/2000/svg", class: className },
|
|
30
30
|
h("path", { d: "M31 3H15C8.37258 3 3 8.37258 3 15V31", stroke: "white", "stroke-width": "6", "stroke-linecap": "square" })));
|
|
31
31
|
|
|
32
|
+
const DragDropImageIcon = () => (h("svg", { width: "32", height: "32", viewBox: "0 0 32 32", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
33
|
+
h("path", { d: "M6.66667 28C5.93333 28 5.30556 27.7389 4.78333 27.2167C4.26111 26.6944 4 26.0667 4 25.3333V6.66667C4 5.93333 4.26111 5.30556 4.78333 4.78333C5.30556 4.26111 5.93333 4 6.66667 4H25.3333C26.0667 4 26.6944 4.26111 27.2167 4.78333C27.7389 5.30556 28 5.93333 28 6.66667V25.3333C28 26.0667 27.7389 26.6944 27.2167 27.2167C26.6944 27.7389 26.0667 28 25.3333 28H6.66667ZM6.66667 25.3333H25.3333V6.66667H6.66667V25.3333ZM9.33333 22.6667H22.6667C22.9333 22.6667 23.1333 22.5444 23.2667 22.3C23.4 22.0556 23.3778 21.8222 23.2 21.6L19.5333 16.7C19.4 16.5222 19.2222 16.4333 19 16.4333C18.7778 16.4333 18.6 16.5222 18.4667 16.7L15 21.3333L12.5333 18.0333C12.4 17.8556 12.2222 17.7667 12 17.7667C11.7778 17.7667 11.6 17.8556 11.4667 18.0333L8.8 21.6C8.62222 21.8222 8.6 22.0556 8.73333 22.3C8.86667 22.5444 9.06667 22.6667 9.33333 22.6667Z", fill: "currentColor" })));
|
|
34
|
+
|
|
32
35
|
const TextIcon = () => (h("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true" },
|
|
33
36
|
h("svg", { width: "25", height: "24", viewBox: "0 0 25 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
34
37
|
h("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M5.5 3C4.39543 3 3.5 3.89543 3.5 5V19C3.5 20.1046 4.39543 21 5.5 21H19.5C20.6046 21 21.5 20.1046 21.5 19V5C21.5 3.89543 20.6046 3 19.5 3H5.5ZM8.5 9C8.5 8.44772 8.94772 8 9.5 8H15.5C16.0523 8 16.5 8.44772 16.5 9C16.5 9.55228 16.0523 10 15.5 10H13.5V15C13.5 15.5523 13.0523 16 12.5 16C11.9477 16 11.5 15.5523 11.5 15V10H9.5C8.94772 10 8.5 9.55228 8.5 9Z", fill: "white" }))));
|
|
@@ -444,7 +447,10 @@ const VviinnCropper = class {
|
|
|
444
447
|
};
|
|
445
448
|
VviinnCropper.style = vviinnCropperCss;
|
|
446
449
|
|
|
447
|
-
|
|
450
|
+
/** Returns the first file from a drop's DataTransfer (no type validation). */
|
|
451
|
+
const parseDroppedFile = (dataTransfer) => { var _a, _b; return (_b = (_a = dataTransfer === null || dataTransfer === void 0 ? void 0 : dataTransfer.files) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : null; };
|
|
452
|
+
|
|
453
|
+
const vviinnImageSelectorCss = ".visually-hidden{clip:rect(0 0 0 0);clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}label{cursor:pointer;display:grid;place-items:center;width:100%;height:100%;transition:background 0.15s ease-in-out}label.loading{pointer-events:none;cursor:default}:host(.upload-drop-zone) label{height:48px;border-radius:var(--border-radius-100);background:var(--color-primary, var(--button-bg-color-primary));color:var(--color-text-on-color)}:host(.upload-drop-zone) label:hover{background:var(--color-primary-hover, var(--button-bg-color-primary-hover))}.drop-zone__hint{display:flex;flex-direction:column;align-items:center;gap:var(--spacing-50);width:100%}.drop-zone__text{font-size:var(--font-size-body);line-height:var(--line-height-body);text-align:center;color:var(--color-text-secondary)}";
|
|
448
454
|
|
|
449
455
|
const VviinnImageSelector = class {
|
|
450
456
|
constructor(hostRef) {
|
|
@@ -453,34 +459,86 @@ const VviinnImageSelector = class {
|
|
|
453
459
|
this.vviinnNoResult = createEvent(this, "vviinnNoResult");
|
|
454
460
|
this.vviinnImageUploadFinished = createEvent(this, "vviinnImageUploadFinished");
|
|
455
461
|
this.loading = false;
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
+
/** Accept image files dropped from the OS onto the selector */
|
|
463
|
+
this.useDragAndDrop = false;
|
|
464
|
+
this.isDragOver = false;
|
|
465
|
+
// Guards against a second drop / file-input change starting a concurrent
|
|
466
|
+
// upload while the first request is still in flight (racing two searches).
|
|
467
|
+
this.isProcessing = false;
|
|
468
|
+
}
|
|
469
|
+
async processFile(file) {
|
|
470
|
+
if (this.isProcessing)
|
|
462
471
|
return;
|
|
463
472
|
const validationResult = checkImageType(file);
|
|
464
473
|
if (isLeft(validationResult)) {
|
|
465
474
|
this.vviinnNoResult.emit(Object.assign(Object.assign({}, this.basicEventData), { reason: validationResult.left.kind, errorMessage: validationResult.left.inner, errorCode: validationResult.left.code }));
|
|
466
|
-
input.value = "";
|
|
467
475
|
return;
|
|
468
476
|
}
|
|
469
477
|
this.vviinnImageUploadStarted.emit(Object.assign(Object.assign({}, this.basicEventData), { isTriggeredByVpsWidget: this.storeName === "widget" }));
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
this.
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
478
|
+
this.isProcessing = true;
|
|
479
|
+
try {
|
|
480
|
+
const processingResult = await makeUploadFileRequest(this.storeName, this.token, this.apiPath)(file);
|
|
481
|
+
_functionExports.pipe(processingResult, match(({ kind, code }) => {
|
|
482
|
+
this.vviinnNoResult.emit(Object.assign(Object.assign({}, this.basicEventData), { reason: kind, errorCode: code }));
|
|
483
|
+
}, (response) => {
|
|
484
|
+
var _a;
|
|
485
|
+
if (!this.showInWidget)
|
|
486
|
+
setLocalStorageItems((_a = this.state.image) === null || _a === void 0 ? void 0 : _a.src, this.state.detectedObjects);
|
|
487
|
+
this.vviinnImageUploadFinished.emit({
|
|
488
|
+
searchId: response.requestId,
|
|
489
|
+
isTriggeredByVpsWidget: this.storeName === "widget",
|
|
490
|
+
});
|
|
491
|
+
}));
|
|
492
|
+
}
|
|
493
|
+
finally {
|
|
494
|
+
this.isProcessing = false;
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
async handleInputChange(event) {
|
|
498
|
+
var _a;
|
|
499
|
+
const input = event.target;
|
|
500
|
+
const file = (_a = input.files) === null || _a === void 0 ? void 0 : _a[0];
|
|
501
|
+
if (!file)
|
|
502
|
+
return;
|
|
503
|
+
await this.processFile(file);
|
|
482
504
|
input.value = "";
|
|
483
505
|
}
|
|
506
|
+
onDragOver(event) {
|
|
507
|
+
if (!this.useDragAndDrop)
|
|
508
|
+
return;
|
|
509
|
+
event.preventDefault();
|
|
510
|
+
if (event.dataTransfer)
|
|
511
|
+
event.dataTransfer.dropEffect = "copy";
|
|
512
|
+
clearTimeout(this.dragLeaveTimer);
|
|
513
|
+
this.isDragOver = true;
|
|
514
|
+
}
|
|
515
|
+
onDragLeave() {
|
|
516
|
+
if (!this.useDragAndDrop)
|
|
517
|
+
return;
|
|
518
|
+
clearTimeout(this.dragLeaveTimer);
|
|
519
|
+
this.dragLeaveTimer = setTimeout(() => (this.isDragOver = false), 50);
|
|
520
|
+
}
|
|
521
|
+
async onDrop(event) {
|
|
522
|
+
if (!this.useDragAndDrop)
|
|
523
|
+
return;
|
|
524
|
+
event.preventDefault();
|
|
525
|
+
clearTimeout(this.dragLeaveTimer);
|
|
526
|
+
this.isDragOver = false;
|
|
527
|
+
const file = parseDroppedFile(event.dataTransfer);
|
|
528
|
+
if (file)
|
|
529
|
+
await this.processFile(file);
|
|
530
|
+
}
|
|
531
|
+
// Safety net for a drag that ends without a dragleave reaching this host
|
|
532
|
+
// (dropped outside the element, or cancelled): clears a stuck highlight.
|
|
533
|
+
onGlobalDragEnd() {
|
|
534
|
+
if (!this.useDragAndDrop || !this.isDragOver)
|
|
535
|
+
return;
|
|
536
|
+
clearTimeout(this.dragLeaveTimer);
|
|
537
|
+
this.isDragOver = false;
|
|
538
|
+
}
|
|
539
|
+
disconnectedCallback() {
|
|
540
|
+
clearTimeout(this.dragLeaveTimer);
|
|
541
|
+
}
|
|
484
542
|
startUploadWatcher(upload) {
|
|
485
543
|
if (upload) {
|
|
486
544
|
this.fileInput.click();
|
|
@@ -488,13 +546,13 @@ const VviinnImageSelector = class {
|
|
|
488
546
|
}
|
|
489
547
|
}
|
|
490
548
|
render() {
|
|
491
|
-
return (h(Host, { key: '
|
|
549
|
+
return (h(Host, { key: '616c751da82243f02d9d9cbc4f908702c49b3889', exportparts: this.useDragAndDrop ? "button:upload-photo_button" : "button", class: { "drag-over": this.isDragOver } }, this.useDragAndDrop && (h("div", { key: 'b02ad9a11981be6f13bd1347279fe4dad3046887', class: "drop-zone__hint", "aria-hidden": "true" }, h("span", { key: '9f5ed13a34f05cd9dd13aeddf3bfe166b84ee6f6', class: "drop-zone__icon" }, h("slot", { key: 'ccbadd5393155b7e2222d89afad490f43e93b0bc', name: "drop-zone-icon" })), h("span", { key: '0cd1cbaaadb326ef8d53bd8c895c9d72af8571a0', class: "drop-zone__text" }, h("slot", { key: '659b6e91869f7fbb1d73df37d6e25a54ebd200a1', name: "drop-zone-text" })))), h("label", { key: '3684c5e7afefa0403b8d760db89390530834d16d', htmlFor: "fileInput", part: "button", class: { loading: this.loading }, tabindex: this.loading ? -1 : 0, onKeyDown: (e) => {
|
|
492
550
|
var _a;
|
|
493
|
-
if (e.key === "Enter" || e.key === " ") {
|
|
551
|
+
if (!this.loading && (e.key === "Enter" || e.key === " ")) {
|
|
494
552
|
e.preventDefault();
|
|
495
553
|
(_a = this.fileInput) === null || _a === void 0 ? void 0 : _a.click();
|
|
496
554
|
}
|
|
497
|
-
} }, h("slot", { name: "upload-button-text" }, "Upload image"))), h("input", { key: '
|
|
555
|
+
} }, this.loading ? (h("vviinn-preloader", null)) : (h("slot", { name: "upload-button-text" }, "Upload image"))), h("input", { key: '7d9cfd89c2d64cdf3c262e89f652da500dcc80ba', id: "fileInput", class: "visually-hidden", type: "file", tabindex: "-1", accept: getAcceptableFileFormats(), onChange: (event) => this.handleInputChange(event), ref: (el) => (this.fileInput = el) })));
|
|
498
556
|
}
|
|
499
557
|
static get watchers() { return {
|
|
500
558
|
"startUpload": ["startUploadWatcher"]
|
|
@@ -513,7 +571,7 @@ const VviinnOverlayedModal = class {
|
|
|
513
571
|
this.hideBackButton = false;
|
|
514
572
|
}
|
|
515
573
|
render() {
|
|
516
|
-
return (h(Host, { key: '
|
|
574
|
+
return (h(Host, { key: '32e8d4e925e77941445edaf5b403e1ae020e33fb' }, h("vviinn-overlay", { key: '584afbe6de3cc7d6670e0242fe5bdc1853efa787', active: this.active }, h("vviinn-modal", { key: '03993aaa1c481819cf6909ea1c83dd501a34b164', resetState: this.resetState, active: this.active, buttonElementId: this.buttonElementId, hideBackButton: this.hideBackButton, widgetVersion: this.widgetVersion, isFirstScreen: this.isFirstScreen }, h("slot", { key: '59ff72bd0569dd3a0cb1ecefcd94f7f22ded92bb' }, "CONTENT")))));
|
|
517
575
|
}
|
|
518
576
|
};
|
|
519
577
|
VviinnOverlayedModal.style = vviinnOverlayedModalCss;
|
|
@@ -541,7 +599,7 @@ const VviinnPrivacyBadge = class {
|
|
|
541
599
|
}
|
|
542
600
|
}
|
|
543
601
|
render() {
|
|
544
|
-
return (h(Host, { key: '
|
|
602
|
+
return (h(Host, { key: 'c1bd1ffac9b817b4bb8ca9b0b9f66b406abf6b69' }, h("slot", { key: 'a55744d30b8957f7eb1f2114361ac26cd670974f', name: "vviinn-privacy-badge-text" }, h("div", { key: '66ed59809f59942c3bbf00b1a26dddf17cfb31ce', innerHTML: this.privacyBadgeText }))));
|
|
545
603
|
}
|
|
546
604
|
get el() { return getElement(this); }
|
|
547
605
|
};
|
|
@@ -980,13 +1038,13 @@ const VviinnResults = class {
|
|
|
980
1038
|
render() {
|
|
981
1039
|
var _a;
|
|
982
1040
|
const resultsLength = this.getResults().length;
|
|
983
|
-
return (h(Host, { key: '
|
|
1041
|
+
return (h(Host, { key: '0767d0c21dee72b9a0f09a80dfe2ca7c375e4d50', id: "results-block", class: {
|
|
984
1042
|
"show-in-widget": this.showInWidget,
|
|
985
1043
|
"matching-discovery": this.oneClickDiscoveryMode === "append-slider",
|
|
986
|
-
}, exportparts: `${productCardParts}, ${listCardParts}, ${contentCardParts}, ${productCardsGridPart}` }, renderExternalCSS(this.cssUrl), h("div", { key: '
|
|
1044
|
+
}, exportparts: `${productCardParts}, ${listCardParts}, ${contentCardParts}, ${productCardsGridPart}` }, renderExternalCSS(this.cssUrl), h("div", { key: 'bfd01f2bf39be84501ce0cf42f5672acda3e500b', class: "nothing-found" }, this.getCurrentErrorType() && (h("vviinn-error", { key: 'ce077ad92253c7727a509567571d821ebda6dbd4', errorType: this.getCurrentErrorType(), handler: this.resetWidgetState, hasBackground: this.showInWidget, searchType: this.state.searchType }))), h("div", { key: 'dc63984664328f04abe6011aa0db856cb862f37c', class: {
|
|
987
1045
|
hidden: this.showAspectRatioError || resultsLength === 0,
|
|
988
1046
|
products: true,
|
|
989
|
-
}, part: productCardsGridPart, id: "vviinn-results-products" }, resultsLength > 0 && this.renderResults(), h("div", { key: '
|
|
1047
|
+
}, part: productCardsGridPart, id: "vviinn-results-products" }, resultsLength > 0 && this.renderResults(), h("div", { key: '2e39c5d65c5c7981c0b9a93dfe97ad62165a25b4', id: "one-click-discovery-append", style: {
|
|
990
1048
|
order: ((_a = this.oneClickDiscoveryAppendIndex) !== null && _a !== void 0 ? _a : resultsLength).toString(),
|
|
991
1049
|
} }))));
|
|
992
1050
|
}
|
|
@@ -1250,7 +1308,7 @@ const VviinnSlide = class {
|
|
|
1250
1308
|
registerInstance(this, hostRef);
|
|
1251
1309
|
}
|
|
1252
1310
|
render() {
|
|
1253
|
-
return (h(Host, { key: '
|
|
1311
|
+
return (h(Host, { key: '8740746256bbf7c374da17ff2bca8730108586c8' }, h("slot", { key: '2de442bb958c11b063b2d9d3a416e5a8df33d3cb' })));
|
|
1254
1312
|
}
|
|
1255
1313
|
};
|
|
1256
1314
|
VviinnSlide.style = vviinnSlideCss;
|
|
@@ -1295,7 +1353,7 @@ const VviinnSlider = class {
|
|
|
1295
1353
|
return this.isRTL ? position * -1 : position;
|
|
1296
1354
|
}
|
|
1297
1355
|
render() {
|
|
1298
|
-
return (h(Host, { key: '
|
|
1356
|
+
return (h(Host, { key: '6ee307d2510c452af6a730498f67fa26324f2990' }, h("div", { key: '1e721a9e0da711a893d318a3536668362da3c2b7', class: "items-wrapper" }, h("div", { key: 'd48b29eb243c35ac655e0b784b7303e239b416b0', class: "items" }, h("slot", { key: 'dc63e964c8def5b7202377c0c9f75681e7220ad9' })))));
|
|
1299
1357
|
}
|
|
1300
1358
|
get el() { return getElement(this); }
|
|
1301
1359
|
static get watchers() { return {
|
|
@@ -1384,6 +1442,72 @@ ${e}</tr>
|
|
|
1384
1442
|
`}strong({tokens:e}){return `<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return `<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return `<code>${O(e,true)}</code>`}br(e){return "<br>"}del({tokens:e}){return `<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){let r=this.parser.parseInline(n),i=J(e);if(i===null)return r;e=i;let s='<a href="'+e+'"';return t&&(s+=' title="'+O(t)+'"'),s+=">"+r+"</a>",s}image({href:e,title:t,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=J(e);if(i===null)return O(n);e=i;let s=`<img src="${e}" alt="${O(n)}"`;return t&&(s+=` title="${O(t)}"`),s+=">",s}text(e){return "tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:O(e.text)}};var $=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return ""+e}image({text:e}){return ""+e}br(){return ""}checkbox({raw:e}){return e}};var b=class u{options;renderer;textRenderer;constructor(e){this.options=e||T,this.options.renderer=this.options.renderer||new y,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new $;}static parse(e,t){return new u(t).parse(e)}static parseInline(e,t){return new u(t).parseInline(e)}parse(e){this.renderer.parser=this;let t="";for(let n=0;n<e.length;n++){let r=e[n];if(this.options.extensions?.renderers?.[r.type]){let s=r,a=this.options.extensions.renderers[s.type].call({parser:this},s);if(a!==false||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(s.type)){t+=a||"";continue}}let i=r;switch(i.type){case "space":{t+=this.renderer.space(i);break}case "hr":{t+=this.renderer.hr(i);break}case "heading":{t+=this.renderer.heading(i);break}case "code":{t+=this.renderer.code(i);break}case "table":{t+=this.renderer.table(i);break}case "blockquote":{t+=this.renderer.blockquote(i);break}case "list":{t+=this.renderer.list(i);break}case "checkbox":{t+=this.renderer.checkbox(i);break}case "html":{t+=this.renderer.html(i);break}case "def":{t+=this.renderer.def(i);break}case "paragraph":{t+=this.renderer.paragraph(i);break}case "text":{t+=this.renderer.text(i);break}default:{let s='Token with "'+i.type+'" type was not found.';if(this.options.silent)return console.error(s),"";throw new Error(s)}}}return t}parseInline(e,t=this.renderer){this.renderer.parser=this;let n="";for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let a=this.options.extensions.renderers[i.type].call({parser:this},i);if(a!==false||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(i.type)){n+=a||"";continue}}let s=i;switch(s.type){case "escape":{n+=t.text(s);break}case "html":{n+=t.html(s);break}case "link":{n+=t.link(s);break}case "image":{n+=t.image(s);break}case "checkbox":{n+=t.checkbox(s);break}case "strong":{n+=t.strong(s);break}case "em":{n+=t.em(s);break}case "codespan":{n+=t.codespan(s);break}case "br":{n+=t.br(s);break}case "del":{n+=t.del(s);break}case "text":{n+=t.text(s);break}default:{let a='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return n}};var P=class{options;block;constructor(e){this.options=e||T;}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(){return this.block?x.lex:x.lexInline}provideParser(){return this.block?b.parse:b.parseInline}};var D=class{defaults=M();options=this.setOptions;parse=this.parseMarkdown(true);parseInline=this.parseMarkdown(false);Parser=b;Renderer=y;TextRenderer=$;Lexer=x;Tokenizer=w;Hooks=P;constructor(...e){this.use(...e);}walkTokens(e,t){let n=[];for(let r of e)switch(n=n.concat(t.call(this,r)),r.type){case "table":{let i=r;for(let s of i.header)n=n.concat(this.walkTokens(s.tokens,t));for(let s of i.rows)for(let a of s)n=n.concat(this.walkTokens(a.tokens,t));break}case "list":{let i=r;n=n.concat(this.walkTokens(i.items,t));break}default:{let i=r;this.defaults.extensions?.childTokens?.[i.type]?this.defaults.extensions.childTokens[i.type].forEach(s=>{let a=i[s].flat(1/0);n=n.concat(this.walkTokens(a,t));}):i.tokens&&(n=n.concat(this.walkTokens(i.tokens,t)));}}return n}use(...e){let t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{let r={...n};if(r.async=this.defaults.async||r.async||false,n.extensions&&(n.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){let s=t.renderers[i.name];s?t.renderers[i.name]=function(...a){let o=i.renderer.apply(this,a);return o===false&&(o=s.apply(this,a)),o}:t.renderers[i.name]=i.renderer;}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let s=t[i.level];s?s.unshift(i.tokenizer):t[i.level]=[i.tokenizer],i.start&&(i.level==="block"?t.startBlock?t.startBlock.push(i.start):t.startBlock=[i.start]:i.level==="inline"&&(t.startInline?t.startInline.push(i.start):t.startInline=[i.start]));}"childTokens"in i&&i.childTokens&&(t.childTokens[i.name]=i.childTokens);}),r.extensions=t),n.renderer){let i=this.defaults.renderer||new y(this.defaults);for(let s in n.renderer){if(!(s in i))throw new Error(`renderer '${s}' does not exist`);if(["options","parser"].includes(s))continue;let a=s,o=n.renderer[a],l=i[a];i[a]=(...p)=>{let c=o.apply(i,p);return c===false&&(c=l.apply(i,p)),c||""};}r.renderer=i;}if(n.tokenizer){let i=this.defaults.tokenizer||new w(this.defaults);for(let s in n.tokenizer){if(!(s in i))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;let a=s,o=n.tokenizer[a],l=i[a];i[a]=(...p)=>{let c=o.apply(i,p);return c===false&&(c=l.apply(i,p)),c};}r.tokenizer=i;}if(n.hooks){let i=this.defaults.hooks||new P;for(let s in n.hooks){if(!(s in i))throw new Error(`hook '${s}' does not exist`);if(["options","block"].includes(s))continue;let a=s,o=n.hooks[a],l=i[a];P.passThroughHooks.has(s)?i[a]=p=>{if(this.defaults.async&&P.passThroughHooksRespectAsync.has(s))return (async()=>{let d=await o.call(i,p);return l.call(i,d)})();let c=o.call(i,p);return l.call(i,c)}:i[a]=(...p)=>{if(this.defaults.async)return (async()=>{let d=await o.apply(i,p);return d===false&&(d=await l.apply(i,p)),d})();let c=o.apply(i,p);return c===false&&(c=l.apply(i,p)),c};}r.hooks=i;}if(n.walkTokens){let i=this.defaults.walkTokens,s=n.walkTokens;r.walkTokens=function(a){let o=[];return o.push(s.call(this,a)),i&&(o=o.concat(i.call(this,a))),o};}this.defaults={...this.defaults,...r};}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return x.lex(e,t??this.defaults)}parser(e,t){return b.parse(e,t??this.defaults)}parseMarkdown(e){return (n,r)=>{let i={...r},s={...this.defaults,...i},a=this.onError(!!s.silent,!!s.async);if(this.defaults.async===true&&i.async===false)return a(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof n>"u"||n===null)return a(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return a(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));if(s.hooks&&(s.hooks.options=s,s.hooks.block=e),s.async)return (async()=>{let o=s.hooks?await s.hooks.preprocess(n):n,p=await(s.hooks?await s.hooks.provideLexer():e?x.lex:x.lexInline)(o,s),c=s.hooks?await s.hooks.processAllTokens(p):p;s.walkTokens&&await Promise.all(this.walkTokens(c,s.walkTokens));let h=await(s.hooks?await s.hooks.provideParser():e?b.parse:b.parseInline)(c,s);return s.hooks?await s.hooks.postprocess(h):h})().catch(a);try{s.hooks&&(n=s.hooks.preprocess(n));let l=(s.hooks?s.hooks.provideLexer():e?x.lex:x.lexInline)(n,s);s.hooks&&(l=s.hooks.processAllTokens(l)),s.walkTokens&&this.walkTokens(l,s.walkTokens);let c=(s.hooks?s.hooks.provideParser():e?b.parse:b.parseInline)(l,s);return s.hooks&&(c=s.hooks.postprocess(c)),c}catch(o){return a(o)}}}onError(e,t){return n=>{if(n.message+=`
|
|
1385
1443
|
Please report this to https://github.com/markedjs/marked.`,e){let r="<p>An error occurred:</p><pre>"+O(n.message+"",true)+"</pre>";return t?Promise.resolve(r):r}if(t)return Promise.reject(n);throw n}}};var L=new D;function g(u,e){return L.parse(u,e)}g.options=g.setOptions=function(u){return L.setOptions(u),g.defaults=L.defaults,G(g.defaults),g};g.getDefaults=M;g.defaults=T;g.use=function(...u){return L.use(...u),g.defaults=L.defaults,G(g.defaults),g};g.walkTokens=function(u,e){return L.walkTokens(u,e)};g.parseInline=L.parseInline;g.Parser=b;g.parser=b.parse;g.Renderer=y;g.TextRenderer=$;g.Lexer=x;g.lexer=x.lex;g.Tokenizer=w;g.Hooks=P;g.parse=g;
|
|
1386
1444
|
|
|
1445
|
+
const toggleFilterInSet = (appliedFilters, suggestionText) => {
|
|
1446
|
+
const newAppliedFilters = new Set(appliedFilters);
|
|
1447
|
+
if (newAppliedFilters.has(suggestionText)) {
|
|
1448
|
+
newAppliedFilters.delete(suggestionText);
|
|
1449
|
+
}
|
|
1450
|
+
else {
|
|
1451
|
+
newAppliedFilters.add(suggestionText);
|
|
1452
|
+
}
|
|
1453
|
+
return newAppliedFilters;
|
|
1454
|
+
};
|
|
1455
|
+
const formatIntervalKey = (column, start, end) => `${column}:${start}-${end}`;
|
|
1456
|
+
const extractActiveFilterValues = (activeFilters) => {
|
|
1457
|
+
const activeValues = new Set();
|
|
1458
|
+
activeFilters.forEach((filter) => {
|
|
1459
|
+
if (!Array.isArray(filter.values))
|
|
1460
|
+
return;
|
|
1461
|
+
filter.values.forEach((v) => {
|
|
1462
|
+
// Interval values are `{start, end}` objects; categorical values are strings.
|
|
1463
|
+
if (v !== null && typeof v === "object" && "start" in v) {
|
|
1464
|
+
activeValues.add(formatIntervalKey(filter.column, v.start, v.end));
|
|
1465
|
+
}
|
|
1466
|
+
else {
|
|
1467
|
+
activeValues.add(`${filter.column}:${String(v)}`);
|
|
1468
|
+
}
|
|
1469
|
+
});
|
|
1470
|
+
});
|
|
1471
|
+
return activeValues;
|
|
1472
|
+
};
|
|
1473
|
+
const syncSuggestionFilters = (activeFilters, stream) => {
|
|
1474
|
+
var _a, _b, _c;
|
|
1475
|
+
const activeValues = extractActiveFilterValues(activeFilters);
|
|
1476
|
+
const updatedAppliedFilters = new Set();
|
|
1477
|
+
if (!(stream === null || stream === void 0 ? void 0 : stream.items))
|
|
1478
|
+
return updatedAppliedFilters;
|
|
1479
|
+
for (const item of stream.items) {
|
|
1480
|
+
if (item.role !== "assistant" || !item.parts)
|
|
1481
|
+
continue;
|
|
1482
|
+
for (const part of item.parts) {
|
|
1483
|
+
if (!((_a = part.text) === null || _a === void 0 ? void 0 : _a.annotations))
|
|
1484
|
+
continue;
|
|
1485
|
+
for (const annotation of part.text.annotations) {
|
|
1486
|
+
if (!((_c = (_b = annotation.interactions) === null || _b === void 0 ? void 0 : _b.dynamicFilters) === null || _c === void 0 ? void 0 : _c.length))
|
|
1487
|
+
continue;
|
|
1488
|
+
for (const filter of annotation.interactions.dynamicFilters) {
|
|
1489
|
+
if (filter.type === "categorical" && "values" in filter) {
|
|
1490
|
+
filter.values.forEach((value) => {
|
|
1491
|
+
if (activeValues.has(`${filter.column}:${String(value.value)}`)) {
|
|
1492
|
+
updatedAppliedFilters.add(`${filter.column}:${value.value}`);
|
|
1493
|
+
}
|
|
1494
|
+
});
|
|
1495
|
+
}
|
|
1496
|
+
else if (filter.type === "interval" && "selectedValues" in filter) {
|
|
1497
|
+
filter.selectedValues.forEach((interval) => {
|
|
1498
|
+
const key = formatIntervalKey(filter.column, interval.start, interval.end);
|
|
1499
|
+
if (activeValues.has(key)) {
|
|
1500
|
+
updatedAppliedFilters.add(key);
|
|
1501
|
+
}
|
|
1502
|
+
});
|
|
1503
|
+
}
|
|
1504
|
+
}
|
|
1505
|
+
}
|
|
1506
|
+
}
|
|
1507
|
+
}
|
|
1508
|
+
return updatedAppliedFilters;
|
|
1509
|
+
};
|
|
1510
|
+
|
|
1387
1511
|
const extractDataItems = (annotation) => annotation.data.items;
|
|
1388
1512
|
const findMatchingFilterValue = (item, filter) => {
|
|
1389
1513
|
if (filter.type !== "categorical" ||
|
|
@@ -1404,18 +1528,38 @@ const applyFiltersForItems = (dataItems, interactions, currentRequestFilters, ha
|
|
|
1404
1528
|
let updatedFilters = currentRequestFilters;
|
|
1405
1529
|
if (dataItems.length === 0) {
|
|
1406
1530
|
for (const filter of filters) {
|
|
1407
|
-
if (filter.type
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
}
|
|
1531
|
+
if (filter.type === "categorical" && "values" in filter) {
|
|
1532
|
+
for (const filterValue of filter.values) {
|
|
1533
|
+
updatedFilters = triggerFilter({
|
|
1534
|
+
filterValue: filterValue,
|
|
1535
|
+
selectedFilter: filter,
|
|
1536
|
+
requestFilters: updatedFilters,
|
|
1537
|
+
vviinnFilterTriggered: handlers.vviinnFilterTriggered,
|
|
1538
|
+
vviinnFiltersChanged: handlers.vviinnFiltersChanged,
|
|
1539
|
+
el: handlers.el,
|
|
1540
|
+
isTriggeredByVpsWidget: handlers.isTriggeredByVpsWidget,
|
|
1541
|
+
});
|
|
1542
|
+
}
|
|
1543
|
+
}
|
|
1544
|
+
else if (filter.type === "interval" && "selectedValues" in filter) {
|
|
1545
|
+
// A suggestion chip represents one specific range to toggle, not a slider.
|
|
1546
|
+
// The backend emits `full === selectedValues[0]`, which would make
|
|
1547
|
+
// `isFullRangeInterval` read every click as "cleared to the full range"
|
|
1548
|
+
// (deselect-only). Neutralize `full` so the shared toggle logic selects /
|
|
1549
|
+
// deselects this exact interval by value match. Only the object passed to
|
|
1550
|
+
// `triggerFilter` is affected; `value` still carries the real interval.
|
|
1551
|
+
const chipFilter = Object.assign(Object.assign({}, filter), { full: { start: undefined, end: undefined } });
|
|
1552
|
+
for (const interval of filter.selectedValues) {
|
|
1553
|
+
updatedFilters = triggerFilter({
|
|
1554
|
+
filterValue: { interval },
|
|
1555
|
+
selectedFilter: chipFilter,
|
|
1556
|
+
requestFilters: updatedFilters,
|
|
1557
|
+
vviinnFilterTriggered: handlers.vviinnFilterTriggered,
|
|
1558
|
+
vviinnFiltersChanged: handlers.vviinnFiltersChanged,
|
|
1559
|
+
el: handlers.el,
|
|
1560
|
+
isTriggeredByVpsWidget: handlers.isTriggeredByVpsWidget,
|
|
1561
|
+
});
|
|
1562
|
+
}
|
|
1419
1563
|
}
|
|
1420
1564
|
}
|
|
1421
1565
|
return updatedFilters;
|
|
@@ -1464,9 +1608,15 @@ const splitContentByLocators = (content, annotations) => {
|
|
|
1464
1608
|
};
|
|
1465
1609
|
const getAnnotationFilterKeys = (annotation) => {
|
|
1466
1610
|
var _a, _b, _c;
|
|
1467
|
-
return (_c = (_b = (_a = annotation.interactions) === null || _a === void 0 ? void 0 : _a.dynamicFilters) === null || _b === void 0 ? void 0 : _b.flatMap((filter) =>
|
|
1468
|
-
|
|
1469
|
-
|
|
1611
|
+
return (_c = (_b = (_a = annotation.interactions) === null || _a === void 0 ? void 0 : _a.dynamicFilters) === null || _b === void 0 ? void 0 : _b.flatMap((filter) => {
|
|
1612
|
+
if (filter.type === "categorical" && "values" in filter) {
|
|
1613
|
+
return filter.values.map((v) => `${filter.column}:${v.value}`);
|
|
1614
|
+
}
|
|
1615
|
+
if (filter.type === "interval" && "selectedValues" in filter) {
|
|
1616
|
+
return filter.selectedValues.map((interval) => formatIntervalKey(filter.column, interval.start, interval.end));
|
|
1617
|
+
}
|
|
1618
|
+
return [];
|
|
1619
|
+
})) !== null && _c !== void 0 ? _c : [];
|
|
1470
1620
|
};
|
|
1471
1621
|
const getAnnotationDeeplink = (annotation) => {
|
|
1472
1622
|
for (const item of annotation.data.items) {
|
|
@@ -1493,55 +1643,6 @@ const renderAnnotatedContent = (content, annotations, onAnnotationClick, applied
|
|
|
1493
1643
|
};
|
|
1494
1644
|
const renderInfoText = (content, key) => (h("div", { class: "suggestion-info-text", part: "suggestion-info-text", key: key, innerHTML: g.parse(content) }));
|
|
1495
1645
|
|
|
1496
|
-
const toggleFilterInSet = (appliedFilters, suggestionText) => {
|
|
1497
|
-
const newAppliedFilters = new Set(appliedFilters);
|
|
1498
|
-
if (newAppliedFilters.has(suggestionText)) {
|
|
1499
|
-
newAppliedFilters.delete(suggestionText);
|
|
1500
|
-
}
|
|
1501
|
-
else {
|
|
1502
|
-
newAppliedFilters.add(suggestionText);
|
|
1503
|
-
}
|
|
1504
|
-
return newAppliedFilters;
|
|
1505
|
-
};
|
|
1506
|
-
const extractActiveFilterValues = (activeFilters) => {
|
|
1507
|
-
const activeValues = new Set();
|
|
1508
|
-
activeFilters.forEach((filter) => {
|
|
1509
|
-
if (Array.isArray(filter.values)) {
|
|
1510
|
-
filter.values.forEach((v) => activeValues.add(`${filter.column}:${String(v)}`));
|
|
1511
|
-
}
|
|
1512
|
-
});
|
|
1513
|
-
return activeValues;
|
|
1514
|
-
};
|
|
1515
|
-
const syncSuggestionFilters = (activeFilters, stream) => {
|
|
1516
|
-
var _a, _b, _c;
|
|
1517
|
-
const activeValues = extractActiveFilterValues(activeFilters);
|
|
1518
|
-
const updatedAppliedFilters = new Set();
|
|
1519
|
-
if (!(stream === null || stream === void 0 ? void 0 : stream.items))
|
|
1520
|
-
return updatedAppliedFilters;
|
|
1521
|
-
for (const item of stream.items) {
|
|
1522
|
-
if (item.role !== "assistant" || !item.parts)
|
|
1523
|
-
continue;
|
|
1524
|
-
for (const part of item.parts) {
|
|
1525
|
-
if (!((_a = part.text) === null || _a === void 0 ? void 0 : _a.annotations))
|
|
1526
|
-
continue;
|
|
1527
|
-
for (const annotation of part.text.annotations) {
|
|
1528
|
-
if (!((_c = (_b = annotation.interactions) === null || _b === void 0 ? void 0 : _b.dynamicFilters) === null || _c === void 0 ? void 0 : _c.length))
|
|
1529
|
-
continue;
|
|
1530
|
-
for (const filter of annotation.interactions.dynamicFilters) {
|
|
1531
|
-
if (filter.type !== "categorical" || !("values" in filter))
|
|
1532
|
-
continue;
|
|
1533
|
-
filter.values.forEach((value) => {
|
|
1534
|
-
if (activeValues.has(`${filter.column}:${String(value.value)}`)) {
|
|
1535
|
-
updatedAppliedFilters.add(`${filter.column}:${value.value}`);
|
|
1536
|
-
}
|
|
1537
|
-
});
|
|
1538
|
-
}
|
|
1539
|
-
}
|
|
1540
|
-
}
|
|
1541
|
-
}
|
|
1542
|
-
return updatedAppliedFilters;
|
|
1543
|
-
};
|
|
1544
|
-
|
|
1545
1646
|
const vviinnSuggestionsCss = ":host{--font-family-base:Inter, system-ui, sans-serif;--font-family-mono:monospace;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;--font-size-display:32px;--font-size-title:24px;--font-size-headline:18px;--font-size-label-large:16px;--font-size-label:14px;--font-size-body-large:16px;--font-size-body:14px;--font-size-caption:12px;--line-height-display:40px;--line-height-title:32px;--line-height-headline:24px;--line-height-label-large:24px;--line-height-label:20px;--line-height-body-large:24px;--line-height-body:20px;--line-height-caption:16px;--letter-spacing-title:0px;--letter-spacing-headline:0px;--letter-spacing-label-large:0px;--letter-spacing-label:0px;--letter-spacing-body-large:0px;--letter-spacing-body:0px;--letter-spacing-caption:0px;--font-weight-400:400;--font-weight-500:500;--font-weight-600:600;--font-weight-700:700;--spacing-none:0px;--spacing-25:2px;--spacing-50:4px;--spacing-75:6px;--spacing-100:8px;--spacing-125:10px;--spacing-150:12px;--spacing-200:16px;--spacing-250:20px;--spacing-300:24px;--spacing-400:32px;--spacing-500:40px;--spacing-600:48px;--border-radius-none:0px;--border-radius-25:2px;--border-radius-50:4px;--border-radius-100:8px;--border-radius-150:12px;--border-radius-200:16px;--border-radius-300:24px;--border-radius-400:32px;--border-radius-full:9999px;--stroke-width-none:0px;--stroke-width-25:1px;--stroke-width-50:2px;--stroke-width-75:3px;--stroke-width-100:4px;--stroke-width-150:6px;--stroke-width-200:8px;--stroke-width-300:12px;--product-card-widget-min-width:135px;--product-card-results-min-width:250px;--image-set-mode-min-width:155px;--source-card-set-mode-max-width:500px;--filter-blur-none:0px;--filter-blur-100:8px;--filter-blur-150:12px;--filter-blur-200:16px;--color-bg-base:#ffffff;--color-bg-inverse:#161616;--color-border-00:#ffffff;--color-border-01:#f4f4f4;--color-border-02:#e0e0e0;--color-border-03:#c6c6c6;--color-border-inverse-00:#161616;--color-border-inverse-01:#393939;--color-field-01:#ffffff;--color-field-02:#f4f4f4;--color-icon-primary:#161616;--color-icon-secondary:#525252;--color-icon-helper:#8d8d8d;--color-icon-on-color:#ffffff;--color-icon-inverse:#ffffff;--color-icon-disabled:#16161640;--color-text-primary:#161616;--color-text-secondary:#707070;--color-text-helper:#8d8d8d;--color-text-placeholder:#a8a8a8;--color-text-on-color:#ffffff;--color-text-inverse:#ffffff;--color-text-disabled:#16161640;--button-bg-color-primary:#000000;--button-bg-color-primary-hover:#161616;--button-bg-color-primary-active:#1e1e1e;--button-bg-color-secondary:#f4f4f4;--button-bg-color-secondary-hover:#e0e0e0;--button-bg-color-secondary-active:#c6c6c6;--button-bg-color-ghost-hover:#f4f4f4;--button-bg-color-ghost-active:#eaeaea;--button-bg-color-frosted:#6f6f6f66;--button-bg-color-frosted-hover:#6f6f6f80;--button-bg-color-frosted-active:#6f6f6f99;--button-bg-color-disabled:#e0e0e0;--button-bg-color-positive:#dcfce7;--surface-bg-color-01:#f4f4f4;--surface-bg-color-01-hover:#eaeaea;--surface-bg-color-01-active:#e0e0e0;--surface-bg-color-02:#ffffff;--surface-bg-color-inverse:#262626;--surface-bg-color-inverse-hover:#303030;--surface-bg-color-inverse-active:#393939;--surface-bg-color-disabled:#e0e0e0;--surface-bg-color-shadow-01:#dddddd;--surface-bg-color-shadow-02:#c6c6c6;--chip-bg-color-primary:#161616;--chip-bg-color-primary-hover:#1e1e1e;--chip-bg-color-primary-active:#262626;--chip-bg-color-subtle:#f4f4f4;--chip-bg-color-subtle-hover:#eaeaea;--chip-bg-color-subtle-active:#e0e0e0;--chip-bg-color-outline-hover:#f4f4f4;--chip-bg-color-outline-active:#eaeaea;--label-bg-color-accent:#ff3944;--sidebar-animation-duration-default:0.5s;--search-modal-animation-duration-default:0.25s;--search-modal-animation-duration-mobile-default:0.35s;}:host{display:contents}.container{display:flex;flex-direction:column;gap:var(--spacing-150);font-family:var(--font-family, var(--font-family-base));padding-right:var(--spacing-100);line-height:normal}.header{display:flex;align-items:center;gap:var(--spacing-100)}.icon{font-size:20px}.title{margin:0;font-size:var(--font-size-headline);line-height:var(--line-height-headline);font-weight:600;color:var(--color-text-primary)}.suggestions-wrapper{display:flex;flex-direction:column;gap:var(--spacing-100);width:100%}.suggestions-list{list-style:none;margin:0;padding:0;padding-right:var(--spacing-100);display:flex;align-items:center;gap:var(--spacing-100);flex-wrap:wrap;font-size:var(--font-size-label)}.suggestion-item{display:contents}.suggestion-link{background:none;border:none;color:var(--color-primary-500);text-decoration:underline;cursor:pointer;font-size:inherit;line-height:inherit;padding:0;margin:0}.suggestion-link:hover{color:var(--color-primary-600)}.suggestion-link:focus{outline:2px solid var(--color-primary-500);outline-offset:2px;border-radius:2px}.suggestion-filter-button{background:none;border:none;cursor:pointer;display:flex;align-items:center;height:36px;padding:var(--spacing-75);gap:var(--spacing-50);white-space:nowrap;border-radius:var(--border-radius-100);background-color:var(--surface-bg-color-01);transition:background-color 0.1s;font-family:var(--font-family, var(--font-family-base));font-size:var(--font-size-label);color:var(--color-text-primary)}.suggestion-filter-button:hover{background-color:var(--surface-bg-color-01-hover)}.suggestion-filter-button.active{background:var(--surface-bg-color-inverse);color:var(--color-text-inverse)}.suggestion-info-text{font-size:var(--font-size-label);color:var(--color-text-primary)}.suggestion-info-text *{font-size:var(--font-size-label);margin:0}";
|
|
1546
1647
|
|
|
1547
1648
|
const VviinnSuggestions = class {
|
|
@@ -1692,7 +1793,7 @@ const VviinnTeaser = class {
|
|
|
1692
1793
|
slotChangeListener(this, this.el);
|
|
1693
1794
|
}
|
|
1694
1795
|
render() {
|
|
1695
|
-
return (h(Host, { key: '
|
|
1796
|
+
return (h(Host, { key: 'fe777d0460b338bc11c372b2ae6d1c75120484cd' }, h("slot", { key: '85b8c8777d91d0fe48e955a601bf5742e50a3f12' }, h("span", { key: '2f4033a65dac4820a1236e52a470cc0523a31745', class: "vviinn-teaser-text" }, h("slot", { key: '75f5fbc11611d5b12d996dbf9267cc47c59f0269', name: "vviinn-teaser-text" }, instance.t("teaserText"))))));
|
|
1696
1797
|
}
|
|
1697
1798
|
get el() { return getElement(this); }
|
|
1698
1799
|
};
|
|
@@ -1705,7 +1806,7 @@ const videoStreamSettings = {
|
|
|
1705
1806
|
frameRate: { ideal: 30 },
|
|
1706
1807
|
};
|
|
1707
1808
|
|
|
1708
|
-
const vviinnVpsWidgetCss = ":host{--font-family-base:Inter, system-ui, sans-serif;--font-family-mono:monospace;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;--font-size-display:32px;--font-size-title:24px;--font-size-headline:18px;--font-size-label-large:16px;--font-size-label:14px;--font-size-body-large:16px;--font-size-body:14px;--font-size-caption:12px;--line-height-display:40px;--line-height-title:32px;--line-height-headline:24px;--line-height-label-large:24px;--line-height-label:20px;--line-height-body-large:24px;--line-height-body:20px;--line-height-caption:16px;--letter-spacing-title:0px;--letter-spacing-headline:0px;--letter-spacing-label-large:0px;--letter-spacing-label:0px;--letter-spacing-body-large:0px;--letter-spacing-body:0px;--letter-spacing-caption:0px;--font-weight-400:400;--font-weight-500:500;--font-weight-600:600;--font-weight-700:700;--spacing-none:0px;--spacing-25:2px;--spacing-50:4px;--spacing-75:6px;--spacing-100:8px;--spacing-125:10px;--spacing-150:12px;--spacing-200:16px;--spacing-250:20px;--spacing-300:24px;--spacing-400:32px;--spacing-500:40px;--spacing-600:48px;--border-radius-none:0px;--border-radius-25:2px;--border-radius-50:4px;--border-radius-100:8px;--border-radius-150:12px;--border-radius-200:16px;--border-radius-300:24px;--border-radius-400:32px;--border-radius-full:9999px;--stroke-width-none:0px;--stroke-width-25:1px;--stroke-width-50:2px;--stroke-width-75:3px;--stroke-width-100:4px;--stroke-width-150:6px;--stroke-width-200:8px;--stroke-width-300:12px;--product-card-widget-min-width:135px;--product-card-results-min-width:250px;--image-set-mode-min-width:155px;--source-card-set-mode-max-width:500px;--filter-blur-none:0px;--filter-blur-100:8px;--filter-blur-150:12px;--filter-blur-200:16px;--color-bg-base:#ffffff;--color-bg-inverse:#161616;--color-border-00:#ffffff;--color-border-01:#f4f4f4;--color-border-02:#e0e0e0;--color-border-03:#c6c6c6;--color-border-inverse-00:#161616;--color-border-inverse-01:#393939;--color-field-01:#ffffff;--color-field-02:#f4f4f4;--color-icon-primary:#161616;--color-icon-secondary:#525252;--color-icon-helper:#8d8d8d;--color-icon-on-color:#ffffff;--color-icon-inverse:#ffffff;--color-icon-disabled:#16161640;--color-text-primary:#161616;--color-text-secondary:#707070;--color-text-helper:#8d8d8d;--color-text-placeholder:#a8a8a8;--color-text-on-color:#ffffff;--color-text-inverse:#ffffff;--color-text-disabled:#16161640;--button-bg-color-primary:#000000;--button-bg-color-primary-hover:#161616;--button-bg-color-primary-active:#1e1e1e;--button-bg-color-secondary:#f4f4f4;--button-bg-color-secondary-hover:#e0e0e0;--button-bg-color-secondary-active:#c6c6c6;--button-bg-color-ghost-hover:#f4f4f4;--button-bg-color-ghost-active:#eaeaea;--button-bg-color-frosted:#6f6f6f66;--button-bg-color-frosted-hover:#6f6f6f80;--button-bg-color-frosted-active:#6f6f6f99;--button-bg-color-disabled:#e0e0e0;--button-bg-color-positive:#dcfce7;--surface-bg-color-01:#f4f4f4;--surface-bg-color-01-hover:#eaeaea;--surface-bg-color-01-active:#e0e0e0;--surface-bg-color-02:#ffffff;--surface-bg-color-inverse:#262626;--surface-bg-color-inverse-hover:#303030;--surface-bg-color-inverse-active:#393939;--surface-bg-color-disabled:#e0e0e0;--surface-bg-color-shadow-01:#dddddd;--surface-bg-color-shadow-02:#c6c6c6;--chip-bg-color-primary:#161616;--chip-bg-color-primary-hover:#1e1e1e;--chip-bg-color-primary-active:#262626;--chip-bg-color-subtle:#f4f4f4;--chip-bg-color-subtle-hover:#eaeaea;--chip-bg-color-subtle-active:#e0e0e0;--chip-bg-color-outline-hover:#f4f4f4;--chip-bg-color-outline-active:#eaeaea;--label-bg-color-accent:#ff3944;--sidebar-animation-duration-default:0.5s;--search-modal-animation-duration-default:0.25s;--search-modal-animation-duration-mobile-default:0.35s;}.visually-hidden{clip:rect(0 0 0 0);clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}:host{display:block}.hidden{visibility:hidden;height:1px}vviinn-overlayed-modal.first-screen::part(results-title),vviinn-overlayed-modal.first-screen::part(secondary-action){visibility:hidden}.start-page{display:grid;grid-template-columns:repeat(2, 1fr);height:640px}#start-page_block{width:100%;padding:40px 62px;box-sizing:border-box;display:flex;overflow-y:auto;flex-direction:column;justify-content:center}#start-page_block.error{align-content:center}#start-page_block vviinn-text-search{margin-top:var(--spacing-150)}.start-page_main-content{flex-grow:1;display:flex;flex-direction:column;justify-content:center}.start-page_errors-block{display:flex;flex-direction:column;justify-content:center;align-items:center;gap:var(--spacing-150)}.buttons-group{display:flex;flex-direction:column;gap:var(--spacing-150);margin-top:var(--spacing-300)}.action-button{display:grid;border:none;cursor:pointer;align-items:center;border-radius:var(--border-radius-100);font-weight:var(--font-weight-500);font-size:16px;height:48px;justify-items:center;font-family:var(--font-family, var(--font-family-base));transition:background 0.
|
|
1809
|
+
const vviinnVpsWidgetCss = ":host{--font-family-base:Inter, system-ui, sans-serif;--font-family-mono:monospace;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;--font-size-display:32px;--font-size-title:24px;--font-size-headline:18px;--font-size-label-large:16px;--font-size-label:14px;--font-size-body-large:16px;--font-size-body:14px;--font-size-caption:12px;--line-height-display:40px;--line-height-title:32px;--line-height-headline:24px;--line-height-label-large:24px;--line-height-label:20px;--line-height-body-large:24px;--line-height-body:20px;--line-height-caption:16px;--letter-spacing-title:0px;--letter-spacing-headline:0px;--letter-spacing-label-large:0px;--letter-spacing-label:0px;--letter-spacing-body-large:0px;--letter-spacing-body:0px;--letter-spacing-caption:0px;--font-weight-400:400;--font-weight-500:500;--font-weight-600:600;--font-weight-700:700;--spacing-none:0px;--spacing-25:2px;--spacing-50:4px;--spacing-75:6px;--spacing-100:8px;--spacing-125:10px;--spacing-150:12px;--spacing-200:16px;--spacing-250:20px;--spacing-300:24px;--spacing-400:32px;--spacing-500:40px;--spacing-600:48px;--border-radius-none:0px;--border-radius-25:2px;--border-radius-50:4px;--border-radius-100:8px;--border-radius-150:12px;--border-radius-200:16px;--border-radius-300:24px;--border-radius-400:32px;--border-radius-full:9999px;--stroke-width-none:0px;--stroke-width-25:1px;--stroke-width-50:2px;--stroke-width-75:3px;--stroke-width-100:4px;--stroke-width-150:6px;--stroke-width-200:8px;--stroke-width-300:12px;--product-card-widget-min-width:135px;--product-card-results-min-width:250px;--image-set-mode-min-width:155px;--source-card-set-mode-max-width:500px;--filter-blur-none:0px;--filter-blur-100:8px;--filter-blur-150:12px;--filter-blur-200:16px;--color-bg-base:#ffffff;--color-bg-inverse:#161616;--color-border-00:#ffffff;--color-border-01:#f4f4f4;--color-border-02:#e0e0e0;--color-border-03:#c6c6c6;--color-border-inverse-00:#161616;--color-border-inverse-01:#393939;--color-field-01:#ffffff;--color-field-02:#f4f4f4;--color-icon-primary:#161616;--color-icon-secondary:#525252;--color-icon-helper:#8d8d8d;--color-icon-on-color:#ffffff;--color-icon-inverse:#ffffff;--color-icon-disabled:#16161640;--color-text-primary:#161616;--color-text-secondary:#707070;--color-text-helper:#8d8d8d;--color-text-placeholder:#a8a8a8;--color-text-on-color:#ffffff;--color-text-inverse:#ffffff;--color-text-disabled:#16161640;--button-bg-color-primary:#000000;--button-bg-color-primary-hover:#161616;--button-bg-color-primary-active:#1e1e1e;--button-bg-color-secondary:#f4f4f4;--button-bg-color-secondary-hover:#e0e0e0;--button-bg-color-secondary-active:#c6c6c6;--button-bg-color-ghost-hover:#f4f4f4;--button-bg-color-ghost-active:#eaeaea;--button-bg-color-frosted:#6f6f6f66;--button-bg-color-frosted-hover:#6f6f6f80;--button-bg-color-frosted-active:#6f6f6f99;--button-bg-color-disabled:#e0e0e0;--button-bg-color-positive:#dcfce7;--surface-bg-color-01:#f4f4f4;--surface-bg-color-01-hover:#eaeaea;--surface-bg-color-01-active:#e0e0e0;--surface-bg-color-02:#ffffff;--surface-bg-color-inverse:#262626;--surface-bg-color-inverse-hover:#303030;--surface-bg-color-inverse-active:#393939;--surface-bg-color-disabled:#e0e0e0;--surface-bg-color-shadow-01:#dddddd;--surface-bg-color-shadow-02:#c6c6c6;--chip-bg-color-primary:#161616;--chip-bg-color-primary-hover:#1e1e1e;--chip-bg-color-primary-active:#262626;--chip-bg-color-subtle:#f4f4f4;--chip-bg-color-subtle-hover:#eaeaea;--chip-bg-color-subtle-active:#e0e0e0;--chip-bg-color-outline-hover:#f4f4f4;--chip-bg-color-outline-active:#eaeaea;--label-bg-color-accent:#ff3944;--sidebar-animation-duration-default:0.5s;--search-modal-animation-duration-default:0.25s;--search-modal-animation-duration-mobile-default:0.35s;}.visually-hidden{clip:rect(0 0 0 0);clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}:host{display:block}.hidden{visibility:hidden;height:1px}vviinn-overlayed-modal.first-screen::part(results-title),vviinn-overlayed-modal.first-screen::part(secondary-action){visibility:hidden}.start-page{display:grid;grid-template-columns:repeat(2, 1fr);height:640px}#start-page_block{width:100%;padding:40px 62px;box-sizing:border-box;display:flex;overflow-y:auto;flex-direction:column;justify-content:center}#start-page_block.error{align-content:center}#start-page_block vviinn-text-search{margin-top:var(--spacing-150)}.start-page_main-content{flex-grow:1;display:flex;flex-direction:column;justify-content:center}.start-page_errors-block{display:flex;flex-direction:column;justify-content:center;align-items:center;gap:var(--spacing-150)}.buttons-group{display:flex;flex-direction:column;gap:var(--spacing-150);margin-top:var(--spacing-300)}.action-button{display:grid;border:none;cursor:pointer;align-items:center;border-radius:var(--border-radius-100);font-weight:var(--font-weight-500);font-size:16px;height:48px;justify-items:center;font-family:var(--font-family, var(--font-family-base));transition:background 0.15s ease-in-out;color:var(--color-text-primary);background-color:#f4f4f4}.action-button:hover{background-color:#eaeaea}.action-button:first-child{background:var(--color-primary, var(--button-bg-color-primary));border-color:var(--color-primary, var(--button-bg-color-primary));color:white}.action-button:first-child:hover{background:var(--color-primary-hover, var(--button-bg-color-primary-hover));border-color:var(\n --color-primary-hover,\n var(--button-bg-color-primary-hover)\n )}.action-button:active{border-color:black}.action-button-content{display:grid;align-items:center;justify-items:start;justify-content:center;font-family:var(--font-family, var(--font-family-base));grid-template-columns:max-content auto;grid-gap:8px}.action-button .hidden{display:none}.upload-drop-zone{display:flex;flex-direction:column;align-items:center;gap:var(--spacing-150);padding:var(--spacing-200);box-sizing:border-box;cursor:pointer;background:var(--button-bg-color-secondary);border:1px dashed var(--color-border-02);border-radius:var(--border-radius-50);font-family:var(--font-family, var(--font-family-base));transition:border-color 0.1s ease-in-out,\n background 0.1s ease-in-out}.upload-drop-zone.drag-over{border-color:var(--color-primary, var(--button-bg-color-primary));background:color-mix(\n in srgb,\n var(--color-primary, var(--button-bg-color-primary)) 8%,\n transparent\n )}.upload-drop-zone [slot=\"drop-zone-icon\"] svg{display:block;width:32px;height:32px;color:var(--color-text-secondary)}.results-page{padding-top:64px;display:grid;grid-template-columns:336px auto;height:640px;box-sizing:border-box}.results-page>*{box-sizing:border-box}.source-wrapper{display:grid;position:relative;grid-auto-rows:min-content;padding:0 12px 12px 24px;width:100%;max-width:100%;overflow-y:auto;overflow-x:hidden;scrollbar-gutter:stable;gap:var(--spacing-300);padding:0 16px 12px 24px;scrollbar-width:thin}.filters-wrapper{transform:translateX(-24px);min-width:calc(100% + 24px)}@supports (scrollbar-color: unset){.source-wrapper{scrollbar-color:transparent transparent}.source-wrapper:hover{scrollbar-color:initial}}vviinn-filters,vviinn-extended-filters[mode=\"modal\"]{display:none}vviinn-extended-filters[mode=\"preview\"]{display:block;width:100%}vviinn-extended-filters[mode=\"preview\"]::part(extended-filters-row){padding-right:0}.extended-filters-button{display:none}search-filters span{display:none}.results-page:not(.active){display:none}vviinn-preloader{--preloader-size:24px;display:flex}@media (max-width: 1080px){#start-page_block{padding:24px 36px}}@media (max-width: 768px){.start-page{display:flex;flex-direction:column;height:100%}vviinn-overlayed-modal.first-screen::part(secondary-action){visibility:visible}.source-wrapper vviinn-text-search{width:calc(100% - 48px);transform:translateX(24px)}.start-page.active{height:calc(100vh - 64px);height:calc(100svh - 64px)}.start-page:not(.active){overflow:hidden;height:0}.results-page{height:auto;padding-top:0}.results-page>*{box-sizing:border-box;padding:var(--spacing-150) var(--spacing-300) var(--spacing-300)}.source-wrapper{scrollbar-gutter:initial;grid-template-rows:min-content auto;width:100%;padding:0}.filters-wrapper{min-width:100%;min-height:40px;padding-left:var(--spacing-300)}vviinn-filters{padding:0 var(--spacing-300)}vviinn-filters,vviinn-extended-filters[mode=\"modal\"]{display:block;overflow:hidden}vviinn-extended-filters[mode=\"preview\"]{display:none}vviinn-suggestions::part(suggestions-container){padding:0 var(--spacing-300)}vviinn-suggestions::part(suggestions-wrapper){width:calc(100% + 48px);transform:translateX(-24px)}vviinn-filters::part(filters-footer){min-width:calc(100% + 48px);transform:translateX(-24px)}vviinn-filters::part(filters-footer-list){padding:0 var(--spacing-300)}vviinn-suggestions::part(suggestion-info-text){padding:0 var(--spacing-300)}vviinn-suggestions::part(suggestions-list){padding:0 var(--spacing-300)}.extended-filters-button{display:block;position:absolute;left:48px;top:0}.extended-filters-button.has-primary-filters{left:unset;right:var(--spacing-300)}.results-page{grid-template-rows:min-content;grid-template-columns:unset}#start-page_block{overflow-y:unset;min-height:-moz-fit-content;min-height:fit-content;padding:24px 20px 20px}vviinn-text-search::part(suggestions-container){top:auto;bottom:100%;margin:0 0 var(--spacing-50)}}@media (max-width: 480px){.start-page{padding-top:0}.action-button-content{grid-gap:10px}}";
|
|
1709
1810
|
|
|
1710
1811
|
var __rest = (undefined && undefined.__rest) || function (s, e) {
|
|
1711
1812
|
var t = {};
|
|
@@ -1751,6 +1852,8 @@ const VviinnVpsWidget = class {
|
|
|
1751
1852
|
this.imageResolutionWidth = SEARCH_WIDGET_IMAGE_RESOLUTION_WIDTH;
|
|
1752
1853
|
/** Show multiple images: swiper on mobile, hover on desktop in product cards */
|
|
1753
1854
|
this.showMultipleImages = false;
|
|
1855
|
+
/** Accept image files dropped from the OS onto the upload button (desktop only) */
|
|
1856
|
+
this.useDragAndDrop = false;
|
|
1754
1857
|
/** Example image source */
|
|
1755
1858
|
this.exampleImageSource = DEFAULT_EXAMPLE_IMAGE;
|
|
1756
1859
|
/** Show the text search */
|
|
@@ -2105,9 +2208,10 @@ const VviinnVpsWidget = class {
|
|
|
2105
2208
|
this.state.searchType === "image" &&
|
|
2106
2209
|
this.uploadSource === "startCamera") ||
|
|
2107
2210
|
this.isCameraInitializing;
|
|
2211
|
+
const isDropZone = this.useDragAndDrop && this.isDesktop;
|
|
2108
2212
|
const buttons = [
|
|
2109
2213
|
this.cameraAvailable && (h("button", { class: "action-button", part: "start-camera_button", onClick: this.handleStartCameraClick, onKeyDown: (e) => this.handleButtonKeyDown(e, this.handleStartCameraClick) }, isLoading && h("vviinn-preloader", null), h("span", { class: { "action-button-content": true, hidden: isLoading } }, h("slot", { name: "vviinn-camera-icon" }, h(CameraActionIcon, null)), h("span", { class: { hidden: !this.isCameraEnabled } }, h("slot", { name: "vviinn-camera-button-text-stop" }, instance.t("cameraButtonTextStop"))), h("span", { class: { hidden: this.isCameraEnabled } }, h("slot", { name: "vviinn-camera-button-text-start" }, instance.t("cameraButtonTextStart")))))),
|
|
2110
|
-
h("vviinn-image-selector", { class: "action-button", onClick: () => {
|
|
2214
|
+
h("vviinn-image-selector", { class: isDropZone ? "upload-drop-zone" : "action-button", onClick: () => {
|
|
2111
2215
|
if (this.mode !== "upload")
|
|
2112
2216
|
this.uploadSource = "uploadPhoto";
|
|
2113
2217
|
}, onKeyDown: (e) => this.handleButtonKeyDown(e, () => {
|
|
@@ -2116,11 +2220,11 @@ const VviinnVpsWidget = class {
|
|
|
2116
2220
|
}), onVviinnImageUploadFinished: ({ detail }) => this.handleVviinnImageUploadFinished(detail), onVviinnImageUploadStarted: () => {
|
|
2117
2221
|
this.uploadDialogOpened = true;
|
|
2118
2222
|
this.handleVviinnImageUpload("uploadPhoto");
|
|
2119
|
-
}, token: this.token, apiPath: this.apiPath, storeName: this.storeName, state: this.state, onVviinnNoResult: ({ detail }) => this.handleVviinnNoResult(detail), resetVpsButton: this.resetVpsButton, basicEventData: this.getBasicEventData(), part: "upload-photo_button", startUpload: this.buttonPressed &&
|
|
2223
|
+
}, token: this.token, apiPath: this.apiPath, useDragAndDrop: isDropZone, storeName: this.storeName, state: this.state, onVviinnNoResult: ({ detail }) => this.handleVviinnNoResult(detail), resetVpsButton: this.resetVpsButton, basicEventData: this.getBasicEventData(), part: isDropZone ? "drop-zone" : "upload-photo_button", startUpload: this.buttonPressed &&
|
|
2120
2224
|
this.mode === "upload" &&
|
|
2121
2225
|
!this.uploadDialogOpened, showInWidget: this.showInWidget, loading: this.state.searchStatus === "loading" &&
|
|
2122
2226
|
this.state.searchType === "image" &&
|
|
2123
|
-
this.uploadSource === "uploadPhoto" }, h("span", { slot: "upload-button-text", class: "action-button-content" }, h("slot", { name: "vviinn-image-upload-icon" }, h(UploadActionIcon, null)), h("slot", { name: "vviinn-image-upload-button-text" }, h("span", null, instance.t("imageUploadButtonText"))))),
|
|
2227
|
+
this.uploadSource === "uploadPhoto" }, h("span", { slot: "drop-zone-icon" }, h("slot", { name: "vviinn-drag-drop-icon" }, h(DragDropImageIcon, null))), h("span", { slot: "drop-zone-text" }, h("slot", { name: "vviinn-drag-drop-text" }, instance.t("dragDropHintText"))), h("span", { slot: "upload-button-text", class: "action-button-content" }, !isDropZone && (h("slot", { name: "vviinn-image-upload-icon" }, h(UploadActionIcon, null))), h("slot", { name: "vviinn-image-upload-button-text" }, h("span", null, instance.t("imageUploadButtonText"))))),
|
|
2124
2228
|
];
|
|
2125
2229
|
return this.isDesktop ? buttons.reverse() : buttons;
|
|
2126
2230
|
}
|
|
@@ -2146,31 +2250,31 @@ const VviinnVpsWidget = class {
|
|
|
2146
2250
|
}
|
|
2147
2251
|
render() {
|
|
2148
2252
|
var _a, _b, _c;
|
|
2149
|
-
return (h(Host, { key: '
|
|
2253
|
+
return (h(Host, { key: '3d819edc5b1a3ce7fc05d343f80775a425077d26', exportparts: `${modalParts}, ${productCardParts}, ${searchBarParts}, ${searchWidgetFilterParts}, ${searchWidgetButtonParts}, ${productCardsGridPart}, ${suggestionsParts}` }, renderExternalCSS(this.cssUrl), !this.showingInButton && SlotSkeleton("search"), h("vviinn-overlayed-modal", { key: '48a8934f201007aacb83a1436ceee773bc4e64c1', class: { "first-screen": this.isOnboardingSlide() }, isFirstScreen: this.isOnboardingSlide(), active: this.active, resetState: this.resetState, onVviinnWidgetClose: ({ detail }) => {
|
|
2150
2254
|
if (detail.campaignTypeId !== "VPR")
|
|
2151
2255
|
this.handleModalClose();
|
|
2152
2256
|
}, buttonElementId: (_a = this.buttonElementId) !== null && _a !== void 0 ? _a : this.widgetElementId, widgetVersion: version, hideBackButton: this.mode === "upload" ||
|
|
2153
|
-
(!this.isCameraEnabled && this.isOnboardingSlide()) }, h("vviinn-slider", { key: '
|
|
2257
|
+
(!this.isCameraEnabled && this.isOnboardingSlide()) }, h("vviinn-slider", { key: '2e010cd695fe00d065766973467d1eb59771a803', position: this.slidePosition }, h("vviinn-slide", { key: '71b5c21bbc37d62500ae28f5070d4ab98ab08663', class: {
|
|
2154
2258
|
"start-page": true,
|
|
2155
2259
|
"camera-enabled": this.isCameraEnabled,
|
|
2156
|
-
} }, h("vviinn-camera", { key: '
|
|
2260
|
+
} }, h("vviinn-camera", { key: 'f26d9576c072b36cfbe7594deae56388dec592bb', token: this.token, onVviinnImageUploadFinished: ({ detail }) => this.handleVviinnImageUploadFinished(detail), onVviinnImageUploadStarted: () => {
|
|
2157
2261
|
this.handleVviinnImageUpload("startCamera");
|
|
2158
|
-
}, apiPath: this.apiPath, basicEventData: this.getBasicEventData(), srcObject: this.stream, cameraButtonClicked: this.isCameraButtonClicked, exampleImageSource: this.exampleImageSource, showInWidget: this.showInWidget, storeName: this.storeName, state: this.state }), h("div", { key: '
|
|
2262
|
+
}, apiPath: this.apiPath, basicEventData: this.getBasicEventData(), srcObject: this.stream, cameraButtonClicked: this.isCameraButtonClicked, exampleImageSource: this.exampleImageSource, showInWidget: this.showInWidget, storeName: this.storeName, state: this.state }), h("div", { key: '475765308993fd599a6064fde186793059eb9069', class: {
|
|
2159
2263
|
error: this.haveErrors(),
|
|
2160
|
-
}, id: "start-page_block" }, h("div", { key: '
|
|
2161
|
-
this.state.searchStatus === "error") && (h("div", { key: '
|
|
2264
|
+
}, id: "start-page_block" }, h("div", { key: '1c3e3a20caa40a360e7133a300f36a138e09cb4e', class: "start-page_main-content" }, (this.wrongImageFormat ||
|
|
2265
|
+
this.state.searchStatus === "error") && (h("div", { key: 'aed26307e98322b8355dc58f19f51079eb8f5939', class: "start-page_errors-block" }, this.getCurrentErrorType() && (h("vviinn-error", { key: 'af8b068c7ab554f66565e445a2562e5de1b1e70b', errorType: this.getCurrentErrorType(), handler: this.resetState, hasBackground: true, searchType: this.state.searchType })))), !this.haveErrors() && (h(Fragment, { key: 'ff464606d3447e0feab7690c4aaffa1389adea38' }, h("vviinn-teaser", { key: '91043f95623cae0f7f39902612ea8e4056361c44' }), h("div", { key: '83bf07377aabb98372a5688b51b8fd92328c9ba2', class: "buttons-group" }, this.renderButtons()), this.textSearchShow && !this.isResultSlide() && (h("vviinn-text-search", { key: 'e0a766d21276ecca7d075ff9fef2aa7ba0ebfc93', token: this.token, apiPath: this.apiPath, locale: this.locale, showInWidget: this.showInWidget, showOnFirstScreen: true, uiSessionId: this.uiSessionId, basicEventData: this.getBasicEventData(true), resultsPageUrl: this.resultsPageUrl, autoSuggestShow: this.autoSuggestShow, "save-image-mode": "never" }))))), h("vviinn-privacy-badge", { key: 'be525a2dc35924de5c73275939b61fc474fe0ce0', privacyBadgeText: instance.t("privacyBadgeText", {
|
|
2162
2266
|
interpolation: { escapeValue: false },
|
|
2163
|
-
}), class: { invisible: this.haveErrors() } }))), h("vviinn-slide", { key: '
|
|
2267
|
+
}), class: { invisible: this.haveErrors() } }))), h("vviinn-slide", { key: '73565ad9d70d0fa39bc7031a3cc0af988e70eb64', class: {
|
|
2164
2268
|
"results-page": true,
|
|
2165
2269
|
active: this.isResultSlide(),
|
|
2166
|
-
} }, this.isResultSlide() && (h("div", { key: '
|
|
2270
|
+
} }, this.isResultSlide() && (h("div", { key: '439495970eb510e757737be0b95b8e6431ec705a', class: "source-wrapper" }, this.isTextSearch() && (h("vviinn-text-search", { key: '8bc91e68349913cb9eda6e6166825f32d7afeb5f', token: this.token, showInWidget: this.showInWidget, apiPath: this.apiPath, locale: this.locale, uiSessionId: this.uiSessionId, basicEventData: this.getBasicEventData(true), resultsPageUrl: this.resultsPageUrl, autoSuggestShow: this.autoSuggestShow, "save-image-mode": "never" })), !this.isTextSearch() && (h("vviinn-cropper", { key: 'bdf8e645e389c39947ece8c0576adea23e40d80d', token: this.token, basicEventData: this.getBasicEventData(), showAspectRatioError: this.showAspectRatioError, apiPath: this.apiPath, showInWidget: this.showInWidget, "save-image-mode": "never" })), h("vviinn-suggestions", { key: '5088ac4c87e0351f39743484b717b2233d1cd6cc', showInWidget: this.showInWidget, token: this.token, apiPath: this.apiPath, locale: this.locale }), h("vviinn-selected-filters", { key: '64b97e027404482d52003d6fff076779d585f90e', locale: this.locale, currencySign: this.currencySign, showInWidget: this.showInWidget, exportparts: filtersParts }), ((_b = this.state.dynamicFilters) === null || _b === void 0 ? void 0 : _b.length) > 0 && (h("div", { key: '08dc0f036a9e27a62e688389118664ec6d38f5fe', class: {
|
|
2167
2271
|
"filters-wrapper": true,
|
|
2168
2272
|
hidden: this.showAspectRatioError,
|
|
2169
|
-
} }, h("vviinn-filters", { key: '
|
|
2273
|
+
} }, h("vviinn-filters", { key: '0e0634bc3963b7f87e19fa5ef9814d1206368e5f', showInWidget: this.showInWidget, showIntervalInputs: this.showIntervalInputs }), h("vviinn-extended-filters", { key: 'a12da4af4e2922904bc3acbaae517c5268385b61', mode: "preview", showHeader: false, showInWidget: this.showInWidget, locale: this.locale, currencySign: this.currencySign, showIntervalInputs: this.showIntervalInputs }), h("vviinn-extended-filters-button", { key: '63ed9c068918f1915a84ab90af1a0d2e6eccd596', class: {
|
|
2170
2274
|
"extended-filters-button": true,
|
|
2171
2275
|
"has-primary-filters": this.state.dynamicFilters.filter((f) => f.isPrimary)
|
|
2172
2276
|
.length > 0,
|
|
2173
|
-
}, showInWidget: this.showInWidget }))))), this.isResultSlide() && (h(Fragment, { key: '
|
|
2277
|
+
}, showInWidget: this.showInWidget }))))), this.isResultSlide() && (h(Fragment, { key: 'f82ea6c8e9009241f94f70ec9512ede273db9052' }, h("vviinn-results", { key: '422e0d0c3b7f93bab6f6581a7c352107774f6c87', token: this.token, locale: this.locale, numberLocale: this.numberLocale, pricePrefix: this.pricePrefix, "currency-sign": this.currencySign, apiPath: this.apiPath, campaignIdTextSearch: this.campaignIdTextSearch, campaignIdVisualSearch: this.campaignIdVisualSearch, uiSessionId: this.uiSessionId, widgetElementId: (_c = this.buttonElementId) !== null && _c !== void 0 ? _c : this.widgetElementId, showInWidget: this.showInWidget, buttonElementId: this.buttonElementId, imageResolutionWidth: this.imageResolutionWidth, showMultipleImages: this.showMultipleImages, productDetailsNewTab: this.productDetailsNewTab, productDetailsRedirect: this.productDetailsRedirect, addToBasketShow: this.addToBasketShow, favoriteShow: this.favoriteShow, showAspectRatioError: this.showAspectRatioError, resetWidgetState: this.resetState, replaceSlotsContentInWidget: this.replaceSlotsContent.bind(this), replaceSlotsContentInButton: this.replaceSlotsContentInButton, addPriceContainer: this.addPriceContainer, oneClickDiscoveryMode: this.oneClickDiscoveryMode, oneClickDiscoveryCampaigns: this.oneClickDiscoveryCampaigns, parentSlots: [...this.parentSlots, ...this.slots], scrollableModalBody: this.modalBody }))))), h("vviinn-extended-filters", { key: '203270237562c97f144ccce3ba364893a1ecafd5', class: "modal-extended-filters", mode: "modal", exportparts: extendedFiltersParts, showInWidget: this.showInWidget, locale: this.locale, currencySign: this.currencySign, showIntervalInputs: this.showIntervalInputs }))));
|
|
2174
2278
|
}
|
|
2175
2279
|
get el() { return getElement(this); }
|
|
2176
2280
|
static get watchers() { return {
|