vviinn-widgets 2.89.0 → 2.89.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/{package-6117f4e4.js → package-fdeeca23.js} +1 -1
- package/dist/cjs/search-filters_19.cjs.entry.js +2 -2
- package/dist/cjs/vviinn-carousel_8.cjs.entry.js +1 -1
- package/dist/cjs/vviinn-vpr-button.cjs.entry.js +1 -1
- package/dist/cjs/vviinn-vps-button.cjs.entry.js +1 -1
- package/dist/cjs/vviinn-vps-widget.cjs.entry.js +1 -1
- package/dist/collection/components/vviinn-results/vviinn-results.js +1 -1
- package/dist/esm/{package-921509ab.js → package-317e4435.js} +1 -1
- package/dist/esm/search-filters_19.entry.js +2 -2
- package/dist/esm/vviinn-carousel_8.entry.js +1 -1
- package/dist/esm/vviinn-vpr-button.entry.js +1 -1
- package/dist/esm/vviinn-vps-button.entry.js +1 -1
- package/dist/esm/vviinn-vps-widget.entry.js +1 -1
- package/{www/build/p-14f184a9.entry.js → dist/vviinn-widgets/p-54789d13.entry.js} +1 -1
- package/{www/build/p-16373b75.entry.js → dist/vviinn-widgets/p-62f6608e.entry.js} +1 -1
- package/dist/vviinn-widgets/{p-f97f72af.entry.js → p-8e3531b6.entry.js} +1 -1
- package/dist/vviinn-widgets/{p-e0914a27.entry.js → p-8e8c7b7c.entry.js} +1 -1
- package/dist/vviinn-widgets/{p-ea8ae0a0.entry.js → p-ab18d2e3.entry.js} +2 -2
- package/dist/vviinn-widgets/p-d6cb79c1.js +1 -0
- package/dist/vviinn-widgets/vviinn-widgets.esm.js +1 -1
- package/package.json +1 -1
- package/{dist/vviinn-widgets/p-14f184a9.entry.js → www/build/p-54789d13.entry.js} +1 -1
- package/{dist/vviinn-widgets/p-16373b75.entry.js → www/build/p-62f6608e.entry.js} +1 -1
- package/www/build/{p-f97f72af.entry.js → p-8e3531b6.entry.js} +1 -1
- package/www/build/{p-e0914a27.entry.js → p-8e8c7b7c.entry.js} +1 -1
- package/www/build/{p-ea8ae0a0.entry.js → p-ab18d2e3.entry.js} +2 -2
- package/www/build/p-d6cb79c1.js +1 -0
- package/www/build/vviinn-widgets.esm.js +1 -1
- package/dist/vviinn-widgets/p-1be72f1f.js +0 -1
- package/www/build/p-1be72f1f.js +0 -1
|
@@ -7,7 +7,7 @@ const search_store = require('./search.store-d2b420fd.js');
|
|
|
7
7
|
const index$1 = require('./index-105aee62.js');
|
|
8
8
|
const customizedSlots = require('./customized-slots-ee9418c1.js');
|
|
9
9
|
const emitRequestFiltersMore = require('./emitRequestFiltersMore-dd0b6262.js');
|
|
10
|
-
const _package = require('./package-
|
|
10
|
+
const _package = require('./package-fdeeca23.js');
|
|
11
11
|
const CameraIcon = require('./CameraIcon-5b8efacb.js');
|
|
12
12
|
|
|
13
13
|
const ArrowIcon = () => (index.h("svg", { width: "12", height: "20", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
@@ -4127,7 +4127,7 @@ const VviinnResults = class {
|
|
|
4127
4127
|
this.trackingApi.trackEvent(resultEvent).then(this.setTrackingDeactivated);
|
|
4128
4128
|
}
|
|
4129
4129
|
findProductById(id) {
|
|
4130
|
-
return this.recommendations.find((r) => r.productId === id);
|
|
4130
|
+
return (this.recommendations.length ? this.recommendations : search_store.searchState.results).find((r) => r.productId === id);
|
|
4131
4131
|
}
|
|
4132
4132
|
handleOpenLink(deeplink, event) {
|
|
4133
4133
|
if (!this.productDetailsRedirect)
|
|
@@ -7,7 +7,7 @@ const search_store = require('./search.store-d2b420fd.js');
|
|
|
7
7
|
const customizedSlots = require('./customized-slots-ee9418c1.js');
|
|
8
8
|
const emitRequestFiltersMore = require('./emitRequestFiltersMore-dd0b6262.js');
|
|
9
9
|
const index$1 = require('./index-105aee62.js');
|
|
10
|
-
const _package = require('./package-
|
|
10
|
+
const _package = require('./package-fdeeca23.js');
|
|
11
11
|
|
|
12
12
|
const BasketIcon = () => (index.h("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
13
13
|
index.h("g", { id: "shopping-bag" },
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-4474431a.js');
|
|
6
|
-
const _package = require('./package-
|
|
6
|
+
const _package = require('./package-fdeeca23.js');
|
|
7
7
|
|
|
8
8
|
const SimilarProductsIcon = () => (index.h("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
9
9
|
index.h("path", { d: "M20.8 2H11.2C10.54 2 10 2.54 10 3.2C10 3.86 10.54 4.4 11.2 4.4H19.6V12.8C19.6 13.46 20.14 14 20.8 14C21.46 14 22 13.46 22 12.8V3.2C22 2.54 21.46 2 20.8 2Z", fill: "#161616" }),
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
const index = require('./index-4474431a.js');
|
|
6
|
-
const _package = require('./package-
|
|
6
|
+
const _package = require('./package-fdeeca23.js');
|
|
7
7
|
const CameraIcon = require('./CameraIcon-5b8efacb.js');
|
|
8
8
|
const customizedSlots = require('./customized-slots-ee9418c1.js');
|
|
9
9
|
const constants = require('./constants-7684cbfc.js');
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
const index = require('./index-4474431a.js');
|
|
6
6
|
const search_store = require('./search.store-d2b420fd.js');
|
|
7
7
|
const index$1 = require('./index-105aee62.js');
|
|
8
|
-
const _package = require('./package-
|
|
8
|
+
const _package = require('./package-fdeeca23.js');
|
|
9
9
|
const customizedSlots = require('./customized-slots-ee9418c1.js');
|
|
10
10
|
const constants = require('./constants-7684cbfc.js');
|
|
11
11
|
|
|
@@ -234,7 +234,7 @@ export class VviinnResults {
|
|
|
234
234
|
this.trackingApi.trackEvent(resultEvent).then(this.setTrackingDeactivated);
|
|
235
235
|
}
|
|
236
236
|
findProductById(id) {
|
|
237
|
-
return this.recommendations.find((r) => r.productId === id);
|
|
237
|
+
return (this.recommendations.length ? this.recommendations : searchState.results).find((r) => r.productId === id);
|
|
238
238
|
}
|
|
239
239
|
handleOpenLink(deeplink, event) {
|
|
240
240
|
if (!this.productDetailsRedirect)
|
|
@@ -3,7 +3,7 @@ import { s as searchState, _ as _function, O as Option, k as fromAlt, l as foldV
|
|
|
3
3
|
import { i as instance, r as resources, c as createTrackingApi, v as v4, n as createResultVpsEventByType, o as createProductVpsEventByType } from './index-279b5fe1.js';
|
|
4
4
|
import { s as slotChangeListener, c as campaignTypeNames } from './customized-slots-7fa3856f.js';
|
|
5
5
|
import { d as PlusIcon, c as calculatePriceLabel, s as subFilterSelection, e as emitRequestFiltersMore, a as showActiveOnSubButton, R as RenderButton } from './emitRequestFiltersMore-35557c91.js';
|
|
6
|
-
import { v as version } from './package-
|
|
6
|
+
import { v as version } from './package-317e4435.js';
|
|
7
7
|
import { C as CameraIcon } from './CameraIcon-785208d2.js';
|
|
8
8
|
|
|
9
9
|
const ArrowIcon = () => (h("svg", { width: "12", height: "20", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
@@ -4123,7 +4123,7 @@ const VviinnResults = class {
|
|
|
4123
4123
|
this.trackingApi.trackEvent(resultEvent).then(this.setTrackingDeactivated);
|
|
4124
4124
|
}
|
|
4125
4125
|
findProductById(id) {
|
|
4126
|
-
return this.recommendations.find((r) => r.productId === id);
|
|
4126
|
+
return (this.recommendations.length ? this.recommendations : searchState.results).find((r) => r.productId === id);
|
|
4127
4127
|
}
|
|
4128
4128
|
handleOpenLink(deeplink, event) {
|
|
4129
4129
|
if (!this.productDetailsRedirect)
|
|
@@ -3,7 +3,7 @@ import { h as has, t as tuple, s as searchState, _ as _function, a as _Array, O
|
|
|
3
3
|
import { c as campaignTypeNames, s as slotChangeListener, S as SlotSkeleton, f as fromString, a as fold } from './customized-slots-7fa3856f.js';
|
|
4
4
|
import { c as calculatePriceLabel, s as subFilterSelection, e as emitRequestFiltersMore, C as CheckFilterIcon, S as SquareFilterIcon, a as showActiveOnSubButton, R as RenderButton, b as ResponsiveImage, I as Image, L as Linked, P as Price } from './emitRequestFiltersMore-35557c91.js';
|
|
5
5
|
import { i as instance, r as resources, v as v4, c as createTrackingApi, a as createAddToBasketVpcEvent, b as createAddToBasketVprEvent, d as createWidgetVpcEvent, e as createWidgetVprEvent, f as createResultVpcEventByType, g as createResultVprEventByType, h as createProductVpcEventByType, j as createProductVprEventByType } from './index-279b5fe1.js';
|
|
6
|
-
import { v as version } from './package-
|
|
6
|
+
import { v as version } from './package-317e4435.js';
|
|
7
7
|
|
|
8
8
|
const BasketIcon = () => (h("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
9
9
|
h("g", { id: "shopping-bag" },
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { h, r as registerInstance, c as createEvent, H as Host, g as getElement } from './index-abf408d8.js';
|
|
2
|
-
import { v as version } from './package-
|
|
2
|
+
import { v as version } from './package-317e4435.js';
|
|
3
3
|
|
|
4
4
|
const SimilarProductsIcon = () => (h("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" },
|
|
5
5
|
h("path", { d: "M20.8 2H11.2C10.54 2 10 2.54 10 3.2C10 3.86 10.54 4.4 11.2 4.4H19.6V12.8C19.6 13.46 20.14 14 20.8 14C21.46 14 22 13.46 22 12.8V3.2C22 2.54 21.46 2 20.8 2Z", fill: "#161616" }),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-abf408d8.js';
|
|
2
|
-
import { v as version } from './package-
|
|
2
|
+
import { v as version } from './package-317e4435.js';
|
|
3
3
|
import { C as CameraIcon } from './CameraIcon-785208d2.js';
|
|
4
4
|
import { c as campaignTypeNames, S as SlotSkeleton } from './customized-slots-7fa3856f.js';
|
|
5
5
|
import { D as DEFAULT_EXAMPLE_IMAGE } from './constants-8bf233a9.js';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { h, r as registerInstance, c as createEvent, F as Fragment, H as Host, g as getElement } from './index-abf408d8.js';
|
|
2
2
|
import { s as searchState, d as state, j as parseExcludedToParams, O as Option } from './search.store-24896fcf.js';
|
|
3
3
|
import { i as instance, r as resources, k as createSearchEvent, l as createFilterEvent, v as v4, c as createTrackingApi, m as createWidgetVpsEvent } from './index-279b5fe1.js';
|
|
4
|
-
import { v as version } from './package-
|
|
4
|
+
import { v as version } from './package-317e4435.js';
|
|
5
5
|
import { c as campaignTypeNames, s as slotChangeListener, S as SlotSkeleton } from './customized-slots-7fa3856f.js';
|
|
6
6
|
import { D as DEFAULT_EXAMPLE_IMAGE } from './constants-8bf233a9.js';
|
|
7
7
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,c as i,h as s,H as h,g as e}from"./p-1c863deb.js";import{v as n}from"./p-
|
|
1
|
+
import{r as t,c as i,h as s,H as h,g as e}from"./p-1c863deb.js";import{v as n}from"./p-d6cb79c1.js";import{C as o}from"./p-171fa6da.js";import{c as a,S as d}from"./p-499b1c72.js";import{D as l}from"./p-cc013cd2.js";const r=class{constructor(s){t(this,s),this.vviinnWidgetLoad=i(this,"vviinnWidgetLoad",7),this.vviinnWidgetOpen=i(this,"vviinnWidgetOpen",7),this.vviinnWidgetClose=i(this,"vviinnWidgetClose",7),this.vviinnImageUpload=i(this,"vviinnImageUpload",7),this.vviinnProductLoad=i(this,"vviinnProductLoad",7),this.vviinnProductClick=i(this,"vviinnProductClick",7),this.vviinnProductView=i(this,"vviinnProductView",7),this.vviinnResultLoad=i(this,"vviinnResultLoad",7),this.vviinnResultView=i(this,"vviinnResultView",7),this.vviinnNoResult=i(this,"vviinnNoResult",7),this.vviinnImageCrop=i(this,"vviinnImageCrop",7),this.vviinnSelectObject=i(this,"vviinnSelectObject",7),this.vviinnSelectFilter=i(this,"vviinnSelectFilter",7),this.globalSlotsChanged=i(this,"globalSlotsChanged",7),this.getBasicEventData=()=>({widgetType:"VPS",campaignTypeId:"VPS",campaignTypeName:a.VPS,widgetId:this.el.id,widgetVersion:n}),this.token=void 0,this.currencySign="€",this.locale="de-DE",this.campaignId="",this.addStyle=!1,this.mode="modal",this.excluded="",this.productDetailsNewTab=!0,this.productDetailsRedirect=!0,this.imageResolutionWidth=250,this.exampleImageSource=l,this.textSearchShow=!1,this.apiPath=void 0,this.buttonPressed=!1}handleModalClosed(){this.buttonPressed=!1}componentDidLoad(){this.replaceSlotsContent()}replaceSlotsContent(){const t=this.el.querySelectorAll("[slot]");this.globalSlotsChanged.emit({slots:Array.from(t),element:this.el})}handleClick(){this.buttonPressed=!0}resetButton(){this.buttonPressed=!1}render(){return s(h,{tabindex:"0",role:"button"},s("vviinn-button",{onClick:()=>{this.handleClick()},addStyle:this.addStyle,part:"vviinn-button"},s("slot",null,s(o,null))),d("vps"),s("vviinn-vps-widget",{mode:this.mode,"currency-sign":this.currencySign,token:this.token,locale:this.locale,apiPath:this.apiPath,campaignId:this.campaignId,showingInButton:!0,buttonPressed:this.buttonPressed,resetVpsButton:this.resetButton.bind(this),buttonElementId:this.el.id,active:this.buttonPressed&&("modal"===this.mode||"camera"===this.mode),excluded:this.excluded,productDetailsNewTab:this.productDetailsNewTab,productDetailsRedirect:this.productDetailsRedirect,imageResolutionWidth:this.imageResolutionWidth,exampleImageSource:this.exampleImageSource,textSearchShow:this.textSearchShow,replaceSlotsContentInButton:this.replaceSlotsContent.bind(this)}))}get el(){return e(this)}};r.style=":host{display:block;line-height:0}";export{r as vviinn_vps_button}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as t,r as i,c as e,F as s,H as o,g as r}from"./p-1c863deb.js";import{s as a,d as n,j as l,O as c}from"./p-042b091b.js";import{i as h,r as d,k as p,l as g,v as u,c as v,m as f}from"./p-707f4189.js";import{v as b}from"./p-1be72f1f.js";import{c as m,s as x,S as y}from"./p-499b1c72.js";import{D as w}from"./p-cc013cd2.js";const C=()=>t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},t("path",{d:"M12 17.5C13.25 17.5 14.3125 17.0625 15.1875 16.1875C16.0625 15.3125 16.5 14.25 16.5 13C16.5 11.75 16.0625 10.6875 15.1875 9.8125C14.3125 8.9375 13.25 8.5 12 8.5C10.75 8.5 9.6875 8.9375 8.8125 9.8125C7.9375 10.6875 7.5 11.75 7.5 13C7.5 14.25 7.9375 15.3125 8.8125 16.1875C9.6875 17.0625 10.75 17.5 12 17.5ZM12 15.5C11.3 15.5 10.7083 15.2583 10.225 14.775C9.74167 14.2917 9.5 13.7 9.5 13C9.5 12.3 9.74167 11.7083 10.225 11.225C10.7083 10.7417 11.3 10.5 12 10.5C12.7 10.5 13.2917 10.7417 13.775 11.225C14.2583 11.7083 14.5 12.3 14.5 13C14.5 13.7 14.2583 14.2917 13.775 14.775C13.2917 15.2583 12.7 15.5 12 15.5ZM4 21C3.45 21 2.97917 20.8042 2.5875 20.4125C2.19583 20.0208 2 19.55 2 19V7C2 6.45 2.19583 5.97917 2.5875 5.5875C2.97917 5.19583 3.45 5 4 5H7.15L8.4 3.65C8.58333 3.45 8.80417 3.29167 9.0625 3.175C9.32083 3.05833 9.59167 3 9.875 3H14.125C14.4083 3 14.6792 3.05833 14.9375 3.175C15.1958 3.29167 15.4167 3.45 15.6 3.65L16.85 5H20C20.55 5 21.0208 5.19583 21.4125 5.5875C21.8042 5.97917 22 6.45 22 7V19C22 19.55 21.8042 20.0208 21.4125 20.4125C21.0208 20.8042 20.55 21 20 21H4Z",fill:"currentColor"})),k=()=>t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},t("path",{d:"M4.5 21C4.1 21 3.75 20.85 3.45 20.55C3.15 20.25 3 19.9 3 19.5V4.5C3 4.1 3.15 3.75 3.45 3.45C3.75 3.15 4.1 3 4.5 3H19.5C19.9 3 20.25 3.15 20.55 3.45C20.85 3.75 21 4.1 21 4.5V19.5C21 19.9 20.85 20.25 20.55 20.55C20.25 20.85 19.9 21 19.5 21H4.5ZM6.65 17.075H17.375C17.525 17.075 17.6333 17.0083 17.7 16.875C17.7667 16.7417 17.7583 16.6083 17.675 16.475L14.75 12.575C14.6667 12.475 14.5667 12.425 14.45 12.425C14.3333 12.425 14.2333 12.475 14.15 12.575L11.15 16.45L9.125 13.675C9.04167 13.575 8.94167 13.525 8.825 13.525C8.70833 13.525 8.60833 13.575 8.525 13.675L6.375 16.475C6.275 16.6083 6.25833 16.7417 6.325 16.875C6.39167 17.0083 6.5 17.075 6.65 17.075Z",fill:"currentColor"})),S={facingMode:"environment",width:{ideal:1920},height:{ideal:1080},frameRate:{ideal:30}};var I=function(t,i){var e={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&i.indexOf(s)<0&&(e[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(s=Object.getOwnPropertySymbols(t);o<s.length;o++)i.indexOf(s[o])<0&&Object.prototype.propertyIsEnumerable.call(t,s[o])&&(e[s[o]]=t[s[o]])}return e};const j=class{constructor(s){i(this,s),this.globalSlotsChanged=e(this,"globalSlotsChanged",7),this.vviinnWidgetLoad=e(this,"vviinnWidgetLoad",7),this.vviinnWidgetOpen=e(this,"vviinnWidgetOpen",7),this.vviinnWidgetClose=e(this,"vviinnWidgetClose",7),this.vviinnImageCrop=e(this,"vviinnImageCrop",7),this.vviinnSelectObject=e(this,"vviinnSelectObject",7),this.vviinnSelectFilter=e(this,"vviinnSelectFilter",7),this.vviinnImageUpload=e(this,"vviinnImageUpload",7),this.vviinnNoResult=e(this,"vviinnNoResult",7),this.imageSource=null,this.cameraAvailable=!1,this.isDesktop=!1,this.videoTrack=null,this.handleVviinnImageUpload=t=>{this.trackInitialSearch(),this.uploadSource=t},this.handleVviinnImageUploadFinished=()=>{this.handleImageSelection(),"upload"===this.mode&&this.showingInButton&&(this.active=!0)},this.handleVviinnNoResult=t=>{"client"===t.reason&&(this.wrongImageFormat=!0)},this.adjustCameraSettings=async()=>{var t;if(!this.videoTrack)return;const i=(null===(t=this.videoTrack)||void 0===t?void 0:t.getCapabilities)?this.videoTrack.getCapabilities():{};if("focusMode"in i)try{await this.videoTrack.applyConstraints({advanced:[{focusMode:"continuous"}]})}catch(t){console.error("Failed to apply focus mode constraints",t)}if("exposureMode"in i)try{await this.videoTrack.applyConstraints({advanced:[{exposureMode:"continuous"}]})}catch(t){console.error("Failed to apply exposure mode constraints",t)}if("whiteBalanceMode"in i)try{await this.videoTrack.applyConstraints({advanced:[{whiteBalanceMode:"continuous"}]})}catch(t){console.error("Failed to apply white balance mode constraints",t)}},this.handleStartCameraClick=async()=>{this.stream?this.resetState():(this.cameraInitializing=!0,setTimeout((async()=>{this.cameraButtonClicked=!0;try{const t=await navigator.mediaDevices.getUserMedia({video:S});this.videoTrack=t.getVideoTracks()[0],this.adjustCameraSettings(),this.stream=t,this.uploadSource="startCamera"}catch(t){console.log("Error accessing camera: ",t.message),this.resetState(),this.cameraInitializing=!1}}),500))},this.setShowAspectRatioError=t=>{this.showAspectRatioError=t},this.setTrackingDeactivated=t=>{"rejected"===t.status&&(this.trackingDeactivated=!0)},this.getBasicEventData=()=>{var t;return{widgetType:"VPS",campaignTypeId:"VPS",campaignTypeName:m.VPS,widgetId:null!==(t=this.buttonElementId)&&void 0!==t?t:this.widgetElementId,widgetVersion:b}},this.LinkText=({href:i,children:e})=>t("a",{href:i||""},e),this.token=void 0,this.active=!0,this.currencySign="€",this.locale="de-DE",this.campaignId="",this.excluded="",this.productDetailsNewTab=!0,this.productDetailsRedirect=!0,this.imageResolutionWidth=250,this.exampleImageSource=w,this.textSearchShow=!1,this.apiPath="https://api.vviinn.com",this.showingInButton=!1,this.buttonElementId=void 0,this.buttonPressed=void 0,this.mode="modal",this.resetVpsButton=void 0,this.replaceSlotsContentInButton=void 0,this.slidePosition=0,this.width=0,this.wrongImageFormat=!1,this.trackingDeactivated=!1,this.stream=null,this.cameraInitializing=!1,this.cameraEnabled=!1,this.cameraButtonClicked=!1,this.uploadSource=void 0,this.showAspectRatioError=!1,this.products=[],this.searchQuery=""}initResultEvents(){a.resultLoaded=!1,a.resultViewed=!1}replaceSlotsContent(){const t=this.el.querySelectorAll("[slot]");this.globalSlotsChanged.emit({slots:Array.from(t),element:this.el})}stopStreamTracks(){var t;null===(t=this.stream)||void 0===t||t.getTracks().forEach((t=>{t.stop()}))}isOnboardingSlide(){return 0===this.slidePosition}isResultSlide(){return 1===this.slidePosition}async componentWillLoad(){await h.init({lng:this.locale,fallbackLng:"en",resources:d}),x(this,this.el),this.vviinnWidgetLoad.emit(this.getBasicEventData()),this.trackWidgetEvent("load")}componentDidLoad(){this.replaceSlotsContent()}activeWatcher(t){t?(this.overflow=document.body.style.overflow,document.body.style.overflow="hidden",this.vviinnWidgetOpen.emit(this.getBasicEventData()),"camera"===this.mode&&this.handleStartCameraClick(),this.trackWidgetEvent("open")):(document.body.style.overflow=this.overflow,this.initResultEvents())}textSearchFinishedHandler({detail:t}){this.searchQuery=t.query,this.slidePosition=1}resultLoadHandler(){a.resultLoaded=!0}resultViewHandler(){a.resultViewed=!0}trackCameraEnabled({detail:t}){this.cameraEnabled=t,this.cameraInitializing=!1}trachSearchAreaChanges(){if(this.initResultEvents(),this.trackingDeactivated)return;const t=this.getBasicEventData(),i=I(t,["campaignTypeId"]),e=p(Object.assign({session_id:this.uiSessionId,source:this.imageSource,search_area:"manual-selection"},i));this.trackingApi.trackEvent(e).then(this.setTrackingDeactivated)}trackDetectedObject(){if(this.initResultEvents(),this.trackingDeactivated)return;const t=this.getBasicEventData(),i=I(t,["campaignTypeId"]),e=p(Object.assign({session_id:this.uiSessionId,source:this.imageSource,search_area:"attention-point"},i));this.trackingApi.trackEvent(e).then(this.setTrackingDeactivated)}trackFilterSelected({detail:t}){if(this.initResultEvents(),this.trackingDeactivated)return;const i=this.getBasicEventData(),e=I(i,["campaignTypeId"]),s=g(Object.assign({session_id:this.uiSessionId,source:this.imageSource,kind:t.kind,action:t.action},e));this.trackingApi.trackEvent(s).then(this.setTrackingDeactivated)}connectedCallback(){this.isDesktop="desktop"===(()=>{const t=navigator.userAgent;return/(tablet|ipad|playbook|silk)|(android(?!.*mobi))/i.test(t)?"tablet":/Mobile|Android|iP(hone|od)|IEMobile|BlackBerry|Kindle|Silk-Accelerated|(hpw|web)OS|Opera M(obi|ini)/.test(t)?"mobile":"desktop"})(),n.apiPath=this.apiPath,n.currencySign=this.currencySign,n.locale=this.locale,this.cameraAvailable=!!navigator.mediaDevices&&!!navigator.mediaDevices.getUserMedia,this.excluded&&(this.excluded=l(this.excluded)),a.token=this.token,a.campaignId=this.campaignId,a.excluded=this.excluded,this.uiSessionId=u(),this.trackingApi=v(this.apiPath,this.token),this.widgetElementId=this.el.id}trackWidgetEvent(t){if(this.trackingDeactivated)return;const i=this.getBasicEventData(),e=I(i,["campaignTypeId","widgetType"]),s=Object.assign({action:t,session_id:this.uiSessionId},e),o=f(s);this.trackingApi.trackEvent(o).then(this.setTrackingDeactivated)}trackInitialSearch(){if(this.trackingDeactivated)return;const t=this.getBasicEventData(),i=I(t,["campaignTypeId","widgetType"]),e=p(Object.assign({session_id:this.uiSessionId,search_area:"full",source:"upload"},i));this.trackingApi.trackEvent(e).then(this.setTrackingDeactivated)}handleImageSelection(){this.imageSource="upload",this.slidePosition=1,this.el.shadowRoot.querySelector("vviinn-overlayed-modal").shadowRoot.querySelector("vviinn-overlay").querySelector("vviinn-modal").shadowRoot.querySelector(".body").scrollTop=0,this.stopStreamTracks()}renderButtons(){const i=a.loading&&"image"===a.searchType&&"startCamera"===this.uploadSource||this.cameraInitializing,e=[this.cameraAvailable&&t("button",{class:"action-button",part:"start-camera_button",onClick:()=>{this.handleStartCameraClick()}},t("vviinn-preloader",{class:{hidden:!i}}),t("span",{class:{"action-button-content":!0,hidden:i}},t("slot",{name:"vviinn-camera-icon"},t(C,null)),t("span",{class:{hidden:!this.cameraEnabled}},t("slot",{name:"vviinn-camera-button-text-stop"},h.t("cameraButtonTextStop"))),t("span",{class:{hidden:this.cameraEnabled}},t("slot",{name:"vviinn-camera-button-text-start"},h.t("cameraButtonTextStart"))))),t("vviinn-image-selector",{class:"action-button",onClick:()=>this.uploadSource="uploadPhoto",onVviinnImageUploadFinished:this.handleVviinnImageUploadFinished,onVviinnImageUpload:()=>{this.handleVviinnImageUpload("uploadPhoto")},onVviinnNoResult:({detail:t})=>this.handleVviinnNoResult(t),resetVpsButton:this.resetVpsButton,basicEventData:this.getBasicEventData(),part:"upload-photo_button",startUpload:this.buttonPressed&&this.showingInButton&&"upload"===this.mode,loading:a.loading&&"image"===a.searchType&&"uploadPhoto"===this.uploadSource},t("span",{slot:"upload-button-text",class:"action-button-content"},t("slot",{name:"vviinn-image-upload-icon"},t(k,null)),t("slot",{name:"vviinn-image-upload-button-text"},t("span",null,h.t("imageUploadButtonText")))))];return this.isDesktop?e.reverse():e}resetState(){this.resetScroll("start-page_block"),this.slidePosition=0,a.resetCategoryLink=void 0,a.activeIonLink=void 0,a.image=c.none,a.imageUrl=c.none,a.imageBounds=c.none,a.searchArea=c.none,a.results=[],a.filters=[],a.textSearchFilters=[],a.detectedObjects=[],a.rectangleSearchForm=void 0,a.loading=!1,a.serverError=!1,a.searchType=void 0,this.searchQuery="",this.wrongImageFormat=!1,this.resetScroll("results-block"),this.stopStreamTracks(),this.initResultEvents(),this.stream=null,this.cameraEnabled=!1,this.cameraButtonClicked=!1,this.cameraInitializing=!1,this.setShowAspectRatioError(!1)}haveErrors(){return this.wrongImageFormat||a.serverError}resetScroll(t,i="auto"){const e=this.el.shadowRoot.getElementById(t);null==e||e.scroll({top:0,left:0,behavior:i})}handleModalClose(){this.active=!1,this.resetState(),["start-page_block","results-block"].forEach((t=>this.resetScroll(t))),this.trackWidgetEvent("close")}render(){var i,e;return t(o,{exportparts:"brand, deeplink, currency, image, image-link, price-amount-sale, price-amount-outdated, price-amount-regular, price-container, price-outdated, price-regular, price-sale, price-prefix, title, product-card, upload-photo_button, show-files_button, start-camera_button, text-search-input, close-button, secondary-action, close-button"},!this.showingInButton&&y("vps"),t("vviinn-overlayed-modal",{class:{"first-screen":this.isOnboardingSlide()},isFirstScreen:this.isOnboardingSlide(),active:this.active,resetState:this.resetState.bind(this),onVviinnWidgetClose:()=>this.handleModalClose(),buttonElementId:null!==(i=this.buttonElementId)&&void 0!==i?i:this.widgetElementId,widgetVersion:b,hideBackButton:"upload"===this.mode&&this.showingInButton||!this.cameraEnabled&&this.isOnboardingSlide(),exportparts:"secondary-action, title, close-button"},t("vviinn-slider",{showBullets:!1,position:this.slidePosition},t("vviinn-slide",{class:{"start-page":!0,"camera-enabled":this.cameraEnabled}},t("vviinn-example-image",{onVviinnImageUploadFinished:this.handleVviinnImageUploadFinished,onVviinnImageUpload:()=>{this.handleVviinnImageUpload("startCamera")},basicEventData:this.getBasicEventData(),srcObject:this.stream,cameraButtonClicked:this.cameraButtonClicked,exampleImageSource:this.exampleImageSource}),t("div",{class:{error:this.haveErrors()},id:"start-page_block"},t("div",{class:"start-page_main-content"},t("div",{class:{"start-page_errors-block":!0,hidden:!this.wrongImageFormat&&!a.serverError}},t("vviinn-wrong-format",{class:{hidden:!this.wrongImageFormat},handler:()=>this.resetState()}),t("vviinn-server-error",{class:{hidden:!a.serverError},handler:()=>this.resetState()})),!this.haveErrors()&&t(s,null,t("vviinn-teaser",null),t("div",{class:"buttons-group"},this.renderButtons()),this.textSearchShow&&t("vviinn-text-search",{token:this.token,showInWidget:!0,searchQuery:this.searchQuery,apiPath:this.apiPath,locale:this.locale}))),t("vviinn-privacy-badge",{privacyBadgeText:h.t("privacyBadgeText",{interpolation:{escapeValue:!1}}),class:{invisible:this.haveErrors()}}))),t("vviinn-slide",{class:{"results-page":!0,active:this.isResultSlide()}},this.isResultSlide()&&"image"===a.searchType&&t("div",{class:"source-wrapper image-wrapper"},t("vviinn-image-view",{basicEventData:this.getBasicEventData(),setShowAspectRatioError:this.setShowAspectRatioError,showAspectRatioError:this.showAspectRatioError}),t("div",{class:{"filters-wrapper":!0,hidden:this.showAspectRatioError}},t("div",{class:"filters"},a.filters.map((i=>t("search-filters",{filter:i,basicEventData:this.getBasicEventData()})))))),this.isResultSlide()&&"text"===a.searchType&&t("div",{class:"source-wrapper text-search-wrapper"},t("vviinn-text-search",{token:this.token,showInWidget:!0,searchQuery:this.searchQuery,apiPath:this.apiPath,locale:this.locale}),t("div",{class:{"filters-wrapper":!0,hidden:this.showAspectRatioError}},t("div",{class:"vviinn-filters-container"},t("vviinn-filters",{filters:a.textSearchFilters,showInWidget:!0}),t("vviinn-selected-filters",{showInWidget:!0})))),this.isResultSlide()&&t("vviinn-results",{token:this.token,uiSessionId:this.uiSessionId,apiPath:this.apiPath,widgetElementId:null!==(e=this.buttonElementId)&&void 0!==e?e:this.widgetElementId,showInWidget:!0,buttonElementId:this.buttonElementId,imageResolutionWidth:this.imageResolutionWidth,"currency-sign":this.currencySign,locale:this.locale,productDetailsNewTab:this.productDetailsNewTab,productDetailsRedirect:this.productDetailsRedirect,showAspectRatioError:this.showAspectRatioError,trackingDeactivated:this.trackingDeactivated,resetState:this.resetState.bind(this),replaceSlotsContentInWidget:this.replaceSlotsContent.bind(this),replaceSlotsContentInButton:this.replaceSlotsContentInButton,textSearchQuery:this.searchQuery})))))}get el(){return r(this)}static get watchers(){return{active:["activeWatcher"]}}};j.style=":host{--font-family-base:Inter, system-ui, sans-serif;--font-family-mono:monospace;--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-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:130px;--product-card-results-min-width:250px;--image-set-mode-min-size:155px;--product-card-set-mode-max-width:300px;--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:#525252;--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;--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;--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;}:host{display:block}.hidden{visibility:hidden;height:1px}vviinn-overlayed-modal.first-screen::part(title),vviinn-overlayed-modal.first-screen::part(secondary-action){visibility:hidden}.start-page{display:grid;grid-template-columns:repeat(2, 1fr);height:640px}#start-page_block{box-sizing:border-box;display:flex;overflow-y:auto;flex-direction:column;justify-content:center;padding:40px 62px}#start-page_block.error{align-content:center}#start-page_block vviinn-text-search{margin-top:12px}.start-page_main-content{flex-grow:1;display:flex;flex-direction:column;justify-content:center}.start-page_errors-block{display:flex;flex-direction:column;justify-content:center;align-items:center;gap:12px}.buttons-group{display:flex;flex-direction:column;gap:12px;margin-top:24px}.action-button{font-family:inherit;display:grid;border:none;cursor:pointer;align-items:center;border-radius:8px;font-size:16px;height:48px;justify-items:center;transition:background 0.1s ease-in-out;color:#525252;background-color:#f4f4f4}.action-button:hover{background-color:#eaeaea}.action-button:first-child{background:var(--color-primary, var(--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;grid-template-columns:max-content auto;grid-gap:8px}.action-button .hidden{display:none}.results-page{margin-top:64px;display:grid;grid-template-columns:336px auto;box-sizing:border-box}.results-page>*{padding:24px;box-sizing:border-box}.source-wrapper{display:grid;grid-template-rows:min-content 1fr;min-width:100%}.source-wrapper.text-search-wrapper{padding:24px 24px 0 24px}.filters-wrapper{margin-top:24px;overflow-x:auto;transform:translateX(-24px);min-width:calc(100% + 48px)}search-filters span{display:none}search-filters::part(filter){background:#f4f4f4;border-radius:8px;box-sizing:border-box;color:#161616;font-size:14px;font-weight:400;line-height:20px}search-filters::part(show-more-filters){display:flex;align-items:center;justify-content:center;cursor:pointer;border:1px solid #f4f4f4;min-width:40px;height:40px;border-radius:100px;box-sizing:border-box;color:#161616}search-filters::part(show-more-filters):hover{background:#eaeaea}search-filters::part(filter active){background:var(--color-primary, var(--button-bg-color-primary));color:white}.results-page:not(.active){display:none}.results-page vviinn-text-search{width:calc(100% + 24px)}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}.results-page vviinn-text-search{width:auto}.start-page.active{height:calc(100vh - 64px);height:calc(100svh - 64px)}.start-page:not(.active){overflow:hidden}.results-page{margin-top:0}.results-page>*{box-sizing:border-box;padding:12px 24px 24px}.source-wrapper{grid-template-rows:min-content auto;width:100%;padding:0}.source-wrapper.image-wrapper .filters-wrapper{padding-left:24px;min-width:100%}.results-page{grid-template-rows:min-content;grid-template-columns:unset}#start-page_block{overflow-y:unset;min-height:-moz-fit-content;min-height:fit-content;padding:24px 20px 20px}}@media (max-width: 480px){.start-page{padding-top:0}.action-button-content{grid-gap:10px}}.visually-hidden{clip:rect(0 0 0 0);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}";export{j as vviinn_vps_widget}
|
|
1
|
+
import{h as t,r as i,c as e,F as s,H as o,g as r}from"./p-1c863deb.js";import{s as a,d as n,j as c,O as l}from"./p-042b091b.js";import{i as h,r as d,k as p,l as g,v as u,c as v,m as f}from"./p-707f4189.js";import{v as b}from"./p-d6cb79c1.js";import{c as m,s as x,S as y}from"./p-499b1c72.js";import{D as w}from"./p-cc013cd2.js";const C=()=>t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},t("path",{d:"M12 17.5C13.25 17.5 14.3125 17.0625 15.1875 16.1875C16.0625 15.3125 16.5 14.25 16.5 13C16.5 11.75 16.0625 10.6875 15.1875 9.8125C14.3125 8.9375 13.25 8.5 12 8.5C10.75 8.5 9.6875 8.9375 8.8125 9.8125C7.9375 10.6875 7.5 11.75 7.5 13C7.5 14.25 7.9375 15.3125 8.8125 16.1875C9.6875 17.0625 10.75 17.5 12 17.5ZM12 15.5C11.3 15.5 10.7083 15.2583 10.225 14.775C9.74167 14.2917 9.5 13.7 9.5 13C9.5 12.3 9.74167 11.7083 10.225 11.225C10.7083 10.7417 11.3 10.5 12 10.5C12.7 10.5 13.2917 10.7417 13.775 11.225C14.2583 11.7083 14.5 12.3 14.5 13C14.5 13.7 14.2583 14.2917 13.775 14.775C13.2917 15.2583 12.7 15.5 12 15.5ZM4 21C3.45 21 2.97917 20.8042 2.5875 20.4125C2.19583 20.0208 2 19.55 2 19V7C2 6.45 2.19583 5.97917 2.5875 5.5875C2.97917 5.19583 3.45 5 4 5H7.15L8.4 3.65C8.58333 3.45 8.80417 3.29167 9.0625 3.175C9.32083 3.05833 9.59167 3 9.875 3H14.125C14.4083 3 14.6792 3.05833 14.9375 3.175C15.1958 3.29167 15.4167 3.45 15.6 3.65L16.85 5H20C20.55 5 21.0208 5.19583 21.4125 5.5875C21.8042 5.97917 22 6.45 22 7V19C22 19.55 21.8042 20.0208 21.4125 20.4125C21.0208 20.8042 20.55 21 20 21H4Z",fill:"currentColor"})),k=()=>t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none"},t("path",{d:"M4.5 21C4.1 21 3.75 20.85 3.45 20.55C3.15 20.25 3 19.9 3 19.5V4.5C3 4.1 3.15 3.75 3.45 3.45C3.75 3.15 4.1 3 4.5 3H19.5C19.9 3 20.25 3.15 20.55 3.45C20.85 3.75 21 4.1 21 4.5V19.5C21 19.9 20.85 20.25 20.55 20.55C20.25 20.85 19.9 21 19.5 21H4.5ZM6.65 17.075H17.375C17.525 17.075 17.6333 17.0083 17.7 16.875C17.7667 16.7417 17.7583 16.6083 17.675 16.475L14.75 12.575C14.6667 12.475 14.5667 12.425 14.45 12.425C14.3333 12.425 14.2333 12.475 14.15 12.575L11.15 16.45L9.125 13.675C9.04167 13.575 8.94167 13.525 8.825 13.525C8.70833 13.525 8.60833 13.575 8.525 13.675L6.375 16.475C6.275 16.6083 6.25833 16.7417 6.325 16.875C6.39167 17.0083 6.5 17.075 6.65 17.075Z",fill:"currentColor"})),S={facingMode:"environment",width:{ideal:1920},height:{ideal:1080},frameRate:{ideal:30}};var I=function(t,i){var e={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&i.indexOf(s)<0&&(e[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(s=Object.getOwnPropertySymbols(t);o<s.length;o++)i.indexOf(s[o])<0&&Object.prototype.propertyIsEnumerable.call(t,s[o])&&(e[s[o]]=t[s[o]])}return e};const j=class{constructor(s){i(this,s),this.globalSlotsChanged=e(this,"globalSlotsChanged",7),this.vviinnWidgetLoad=e(this,"vviinnWidgetLoad",7),this.vviinnWidgetOpen=e(this,"vviinnWidgetOpen",7),this.vviinnWidgetClose=e(this,"vviinnWidgetClose",7),this.vviinnImageCrop=e(this,"vviinnImageCrop",7),this.vviinnSelectObject=e(this,"vviinnSelectObject",7),this.vviinnSelectFilter=e(this,"vviinnSelectFilter",7),this.vviinnImageUpload=e(this,"vviinnImageUpload",7),this.vviinnNoResult=e(this,"vviinnNoResult",7),this.imageSource=null,this.cameraAvailable=!1,this.isDesktop=!1,this.videoTrack=null,this.handleVviinnImageUpload=t=>{this.trackInitialSearch(),this.uploadSource=t},this.handleVviinnImageUploadFinished=()=>{this.handleImageSelection(),"upload"===this.mode&&this.showingInButton&&(this.active=!0)},this.handleVviinnNoResult=t=>{"client"===t.reason&&(this.wrongImageFormat=!0)},this.adjustCameraSettings=async()=>{var t;if(!this.videoTrack)return;const i=(null===(t=this.videoTrack)||void 0===t?void 0:t.getCapabilities)?this.videoTrack.getCapabilities():{};if("focusMode"in i)try{await this.videoTrack.applyConstraints({advanced:[{focusMode:"continuous"}]})}catch(t){console.error("Failed to apply focus mode constraints",t)}if("exposureMode"in i)try{await this.videoTrack.applyConstraints({advanced:[{exposureMode:"continuous"}]})}catch(t){console.error("Failed to apply exposure mode constraints",t)}if("whiteBalanceMode"in i)try{await this.videoTrack.applyConstraints({advanced:[{whiteBalanceMode:"continuous"}]})}catch(t){console.error("Failed to apply white balance mode constraints",t)}},this.handleStartCameraClick=async()=>{this.stream?this.resetState():(this.cameraInitializing=!0,setTimeout((async()=>{this.cameraButtonClicked=!0;try{const t=await navigator.mediaDevices.getUserMedia({video:S});this.videoTrack=t.getVideoTracks()[0],this.adjustCameraSettings(),this.stream=t,this.uploadSource="startCamera"}catch(t){console.log("Error accessing camera: ",t.message),this.resetState(),this.cameraInitializing=!1}}),500))},this.setShowAspectRatioError=t=>{this.showAspectRatioError=t},this.setTrackingDeactivated=t=>{"rejected"===t.status&&(this.trackingDeactivated=!0)},this.getBasicEventData=()=>{var t;return{widgetType:"VPS",campaignTypeId:"VPS",campaignTypeName:m.VPS,widgetId:null!==(t=this.buttonElementId)&&void 0!==t?t:this.widgetElementId,widgetVersion:b}},this.LinkText=({href:i,children:e})=>t("a",{href:i||""},e),this.token=void 0,this.active=!0,this.currencySign="€",this.locale="de-DE",this.campaignId="",this.excluded="",this.productDetailsNewTab=!0,this.productDetailsRedirect=!0,this.imageResolutionWidth=250,this.exampleImageSource=w,this.textSearchShow=!1,this.apiPath="https://api.vviinn.com",this.showingInButton=!1,this.buttonElementId=void 0,this.buttonPressed=void 0,this.mode="modal",this.resetVpsButton=void 0,this.replaceSlotsContentInButton=void 0,this.slidePosition=0,this.width=0,this.wrongImageFormat=!1,this.trackingDeactivated=!1,this.stream=null,this.cameraInitializing=!1,this.cameraEnabled=!1,this.cameraButtonClicked=!1,this.uploadSource=void 0,this.showAspectRatioError=!1,this.products=[],this.searchQuery=""}initResultEvents(){a.resultLoaded=!1,a.resultViewed=!1}replaceSlotsContent(){const t=this.el.querySelectorAll("[slot]");this.globalSlotsChanged.emit({slots:Array.from(t),element:this.el})}stopStreamTracks(){var t;null===(t=this.stream)||void 0===t||t.getTracks().forEach((t=>{t.stop()}))}isOnboardingSlide(){return 0===this.slidePosition}isResultSlide(){return 1===this.slidePosition}async componentWillLoad(){await h.init({lng:this.locale,fallbackLng:"en",resources:d}),x(this,this.el),this.vviinnWidgetLoad.emit(this.getBasicEventData()),this.trackWidgetEvent("load")}componentDidLoad(){this.replaceSlotsContent()}activeWatcher(t){t?(this.overflow=document.body.style.overflow,document.body.style.overflow="hidden",this.vviinnWidgetOpen.emit(this.getBasicEventData()),"camera"===this.mode&&this.handleStartCameraClick(),this.trackWidgetEvent("open")):(document.body.style.overflow=this.overflow,this.initResultEvents())}textSearchFinishedHandler({detail:t}){this.searchQuery=t.query,this.slidePosition=1}resultLoadHandler(){a.resultLoaded=!0}resultViewHandler(){a.resultViewed=!0}trackCameraEnabled({detail:t}){this.cameraEnabled=t,this.cameraInitializing=!1}trachSearchAreaChanges(){if(this.initResultEvents(),this.trackingDeactivated)return;const t=this.getBasicEventData(),i=I(t,["campaignTypeId"]),e=p(Object.assign({session_id:this.uiSessionId,source:this.imageSource,search_area:"manual-selection"},i));this.trackingApi.trackEvent(e).then(this.setTrackingDeactivated)}trackDetectedObject(){if(this.initResultEvents(),this.trackingDeactivated)return;const t=this.getBasicEventData(),i=I(t,["campaignTypeId"]),e=p(Object.assign({session_id:this.uiSessionId,source:this.imageSource,search_area:"attention-point"},i));this.trackingApi.trackEvent(e).then(this.setTrackingDeactivated)}trackFilterSelected({detail:t}){if(this.initResultEvents(),this.trackingDeactivated)return;const i=this.getBasicEventData(),e=I(i,["campaignTypeId"]),s=g(Object.assign({session_id:this.uiSessionId,source:this.imageSource,kind:t.kind,action:t.action},e));this.trackingApi.trackEvent(s).then(this.setTrackingDeactivated)}connectedCallback(){this.isDesktop="desktop"===(()=>{const t=navigator.userAgent;return/(tablet|ipad|playbook|silk)|(android(?!.*mobi))/i.test(t)?"tablet":/Mobile|Android|iP(hone|od)|IEMobile|BlackBerry|Kindle|Silk-Accelerated|(hpw|web)OS|Opera M(obi|ini)/.test(t)?"mobile":"desktop"})(),n.apiPath=this.apiPath,n.currencySign=this.currencySign,n.locale=this.locale,this.cameraAvailable=!!navigator.mediaDevices&&!!navigator.mediaDevices.getUserMedia,this.excluded&&(this.excluded=c(this.excluded)),a.token=this.token,a.campaignId=this.campaignId,a.excluded=this.excluded,this.uiSessionId=u(),this.trackingApi=v(this.apiPath,this.token),this.widgetElementId=this.el.id}trackWidgetEvent(t){if(this.trackingDeactivated)return;const i=this.getBasicEventData(),e=I(i,["campaignTypeId","widgetType"]),s=Object.assign({action:t,session_id:this.uiSessionId},e),o=f(s);this.trackingApi.trackEvent(o).then(this.setTrackingDeactivated)}trackInitialSearch(){if(this.trackingDeactivated)return;const t=this.getBasicEventData(),i=I(t,["campaignTypeId","widgetType"]),e=p(Object.assign({session_id:this.uiSessionId,search_area:"full",source:"upload"},i));this.trackingApi.trackEvent(e).then(this.setTrackingDeactivated)}handleImageSelection(){this.imageSource="upload",this.slidePosition=1,this.el.shadowRoot.querySelector("vviinn-overlayed-modal").shadowRoot.querySelector("vviinn-overlay").querySelector("vviinn-modal").shadowRoot.querySelector(".body").scrollTop=0,this.stopStreamTracks()}renderButtons(){const i=a.loading&&"image"===a.searchType&&"startCamera"===this.uploadSource||this.cameraInitializing,e=[this.cameraAvailable&&t("button",{class:"action-button",part:"start-camera_button",onClick:()=>{this.handleStartCameraClick()}},t("vviinn-preloader",{class:{hidden:!i}}),t("span",{class:{"action-button-content":!0,hidden:i}},t("slot",{name:"vviinn-camera-icon"},t(C,null)),t("span",{class:{hidden:!this.cameraEnabled}},t("slot",{name:"vviinn-camera-button-text-stop"},h.t("cameraButtonTextStop"))),t("span",{class:{hidden:this.cameraEnabled}},t("slot",{name:"vviinn-camera-button-text-start"},h.t("cameraButtonTextStart"))))),t("vviinn-image-selector",{class:"action-button",onClick:()=>this.uploadSource="uploadPhoto",onVviinnImageUploadFinished:this.handleVviinnImageUploadFinished,onVviinnImageUpload:()=>{this.handleVviinnImageUpload("uploadPhoto")},onVviinnNoResult:({detail:t})=>this.handleVviinnNoResult(t),resetVpsButton:this.resetVpsButton,basicEventData:this.getBasicEventData(),part:"upload-photo_button",startUpload:this.buttonPressed&&this.showingInButton&&"upload"===this.mode,loading:a.loading&&"image"===a.searchType&&"uploadPhoto"===this.uploadSource},t("span",{slot:"upload-button-text",class:"action-button-content"},t("slot",{name:"vviinn-image-upload-icon"},t(k,null)),t("slot",{name:"vviinn-image-upload-button-text"},t("span",null,h.t("imageUploadButtonText")))))];return this.isDesktop?e.reverse():e}resetState(){this.resetScroll("start-page_block"),this.slidePosition=0,a.resetCategoryLink=void 0,a.activeIonLink=void 0,a.image=l.none,a.imageUrl=l.none,a.imageBounds=l.none,a.searchArea=l.none,a.results=[],a.filters=[],a.textSearchFilters=[],a.detectedObjects=[],a.rectangleSearchForm=void 0,a.loading=!1,a.serverError=!1,a.searchType=void 0,this.searchQuery="",this.wrongImageFormat=!1,this.resetScroll("results-block"),this.stopStreamTracks(),this.initResultEvents(),this.stream=null,this.cameraEnabled=!1,this.cameraButtonClicked=!1,this.cameraInitializing=!1,this.setShowAspectRatioError(!1)}haveErrors(){return this.wrongImageFormat||a.serverError}resetScroll(t,i="auto"){const e=this.el.shadowRoot.getElementById(t);null==e||e.scroll({top:0,left:0,behavior:i})}handleModalClose(){this.active=!1,this.resetState(),["start-page_block","results-block"].forEach((t=>this.resetScroll(t))),this.trackWidgetEvent("close")}render(){var i,e;return t(o,{exportparts:"brand, deeplink, currency, image, image-link, price-amount-sale, price-amount-outdated, price-amount-regular, price-container, price-outdated, price-regular, price-sale, price-prefix, title, product-card, upload-photo_button, show-files_button, start-camera_button, text-search-input, close-button, secondary-action, close-button"},!this.showingInButton&&y("vps"),t("vviinn-overlayed-modal",{class:{"first-screen":this.isOnboardingSlide()},isFirstScreen:this.isOnboardingSlide(),active:this.active,resetState:this.resetState.bind(this),onVviinnWidgetClose:()=>this.handleModalClose(),buttonElementId:null!==(i=this.buttonElementId)&&void 0!==i?i:this.widgetElementId,widgetVersion:b,hideBackButton:"upload"===this.mode&&this.showingInButton||!this.cameraEnabled&&this.isOnboardingSlide(),exportparts:"secondary-action, title, close-button"},t("vviinn-slider",{showBullets:!1,position:this.slidePosition},t("vviinn-slide",{class:{"start-page":!0,"camera-enabled":this.cameraEnabled}},t("vviinn-example-image",{onVviinnImageUploadFinished:this.handleVviinnImageUploadFinished,onVviinnImageUpload:()=>{this.handleVviinnImageUpload("startCamera")},basicEventData:this.getBasicEventData(),srcObject:this.stream,cameraButtonClicked:this.cameraButtonClicked,exampleImageSource:this.exampleImageSource}),t("div",{class:{error:this.haveErrors()},id:"start-page_block"},t("div",{class:"start-page_main-content"},t("div",{class:{"start-page_errors-block":!0,hidden:!this.wrongImageFormat&&!a.serverError}},t("vviinn-wrong-format",{class:{hidden:!this.wrongImageFormat},handler:()=>this.resetState()}),t("vviinn-server-error",{class:{hidden:!a.serverError},handler:()=>this.resetState()})),!this.haveErrors()&&t(s,null,t("vviinn-teaser",null),t("div",{class:"buttons-group"},this.renderButtons()),this.textSearchShow&&t("vviinn-text-search",{token:this.token,showInWidget:!0,searchQuery:this.searchQuery,apiPath:this.apiPath,locale:this.locale}))),t("vviinn-privacy-badge",{privacyBadgeText:h.t("privacyBadgeText",{interpolation:{escapeValue:!1}}),class:{invisible:this.haveErrors()}}))),t("vviinn-slide",{class:{"results-page":!0,active:this.isResultSlide()}},this.isResultSlide()&&"image"===a.searchType&&t("div",{class:"source-wrapper image-wrapper"},t("vviinn-image-view",{basicEventData:this.getBasicEventData(),setShowAspectRatioError:this.setShowAspectRatioError,showAspectRatioError:this.showAspectRatioError}),t("div",{class:{"filters-wrapper":!0,hidden:this.showAspectRatioError}},t("div",{class:"filters"},a.filters.map((i=>t("search-filters",{filter:i,basicEventData:this.getBasicEventData()})))))),this.isResultSlide()&&"text"===a.searchType&&t("div",{class:"source-wrapper text-search-wrapper"},t("vviinn-text-search",{token:this.token,showInWidget:!0,searchQuery:this.searchQuery,apiPath:this.apiPath,locale:this.locale}),t("div",{class:{"filters-wrapper":!0,hidden:this.showAspectRatioError}},t("div",{class:"vviinn-filters-container"},t("vviinn-filters",{filters:a.textSearchFilters,showInWidget:!0}),t("vviinn-selected-filters",{showInWidget:!0})))),this.isResultSlide()&&t("vviinn-results",{token:this.token,uiSessionId:this.uiSessionId,apiPath:this.apiPath,widgetElementId:null!==(e=this.buttonElementId)&&void 0!==e?e:this.widgetElementId,showInWidget:!0,buttonElementId:this.buttonElementId,imageResolutionWidth:this.imageResolutionWidth,"currency-sign":this.currencySign,locale:this.locale,productDetailsNewTab:this.productDetailsNewTab,productDetailsRedirect:this.productDetailsRedirect,showAspectRatioError:this.showAspectRatioError,trackingDeactivated:this.trackingDeactivated,resetState:this.resetState.bind(this),replaceSlotsContentInWidget:this.replaceSlotsContent.bind(this),replaceSlotsContentInButton:this.replaceSlotsContentInButton,textSearchQuery:this.searchQuery})))))}get el(){return r(this)}static get watchers(){return{active:["activeWatcher"]}}};j.style=":host{--font-family-base:Inter, system-ui, sans-serif;--font-family-mono:monospace;--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-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:130px;--product-card-results-min-width:250px;--image-set-mode-min-size:155px;--product-card-set-mode-max-width:300px;--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:#525252;--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;--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;--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;}:host{display:block}.hidden{visibility:hidden;height:1px}vviinn-overlayed-modal.first-screen::part(title),vviinn-overlayed-modal.first-screen::part(secondary-action){visibility:hidden}.start-page{display:grid;grid-template-columns:repeat(2, 1fr);height:640px}#start-page_block{box-sizing:border-box;display:flex;overflow-y:auto;flex-direction:column;justify-content:center;padding:40px 62px}#start-page_block.error{align-content:center}#start-page_block vviinn-text-search{margin-top:12px}.start-page_main-content{flex-grow:1;display:flex;flex-direction:column;justify-content:center}.start-page_errors-block{display:flex;flex-direction:column;justify-content:center;align-items:center;gap:12px}.buttons-group{display:flex;flex-direction:column;gap:12px;margin-top:24px}.action-button{font-family:inherit;display:grid;border:none;cursor:pointer;align-items:center;border-radius:8px;font-size:16px;height:48px;justify-items:center;transition:background 0.1s ease-in-out;color:#525252;background-color:#f4f4f4}.action-button:hover{background-color:#eaeaea}.action-button:first-child{background:var(--color-primary, var(--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;grid-template-columns:max-content auto;grid-gap:8px}.action-button .hidden{display:none}.results-page{margin-top:64px;display:grid;grid-template-columns:336px auto;box-sizing:border-box}.results-page>*{padding:24px;box-sizing:border-box}.source-wrapper{display:grid;grid-template-rows:min-content 1fr;min-width:100%}.source-wrapper.text-search-wrapper{padding:24px 24px 0 24px}.filters-wrapper{margin-top:24px;overflow-x:auto;transform:translateX(-24px);min-width:calc(100% + 48px)}search-filters span{display:none}search-filters::part(filter){background:#f4f4f4;border-radius:8px;box-sizing:border-box;color:#161616;font-size:14px;font-weight:400;line-height:20px}search-filters::part(show-more-filters){display:flex;align-items:center;justify-content:center;cursor:pointer;border:1px solid #f4f4f4;min-width:40px;height:40px;border-radius:100px;box-sizing:border-box;color:#161616}search-filters::part(show-more-filters):hover{background:#eaeaea}search-filters::part(filter active){background:var(--color-primary, var(--button-bg-color-primary));color:white}.results-page:not(.active){display:none}.results-page vviinn-text-search{width:calc(100% + 24px)}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}.results-page vviinn-text-search{width:auto}.start-page.active{height:calc(100vh - 64px);height:calc(100svh - 64px)}.start-page:not(.active){overflow:hidden}.results-page{margin-top:0}.results-page>*{box-sizing:border-box;padding:12px 24px 24px}.source-wrapper{grid-template-rows:min-content auto;width:100%;padding:0}.source-wrapper.image-wrapper .filters-wrapper{padding-left:24px;min-width:100%}.results-page{grid-template-rows:min-content;grid-template-columns:unset}#start-page_block{overflow-y:unset;min-height:-moz-fit-content;min-height:fit-content;padding:24px 20px 20px}}@media (max-width: 480px){.start-page{padding-top:0}.action-button-content{grid-gap:10px}}.visually-hidden{clip:rect(0 0 0 0);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}";export{j as vviinn_vps_widget}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as i,r as t,c as s,H as h,g as n}from"./p-1c863deb.js";import{v as o}from"./p-
|
|
1
|
+
import{h as i,r as t,c as s,H as h,g as n}from"./p-1c863deb.js";import{v as o}from"./p-d6cb79c1.js";const e=()=>i("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i("path",{d:"M20.8 2H11.2C10.54 2 10 2.54 10 3.2C10 3.86 10.54 4.4 11.2 4.4H19.6V12.8C19.6 13.46 20.14 14 20.8 14C21.46 14 22 13.46 22 12.8V3.2C22 2.54 21.46 2 20.8 2Z",fill:"#161616"}),i("path",{d:"M12.8 19.6H4.4V11.2C4.4 10.54 3.86 10 3.2 10C2.54 10 2 10.54 2 11.2V20.8C2 21.46 2.54 22 3.2 22H12.8C13.46 22 14 21.46 14 20.8C14 20.14 13.46 19.6 12.8 19.6Z",fill:"#161616"}),i("path",{d:"M14.8571 10.8571H13.1429V9.14286C13.1429 8.51429 12.6286 8 12 8C11.3714 8 10.8571 8.51429 10.8571 9.14286V10.8571H9.14286C8.51429 10.8571 8 11.3714 8 12C8 12.6286 8.51429 13.1429 9.14286 13.1429H10.8571V14.8571C10.8571 15.4857 11.3714 16 12 16C12.6286 16 13.1429 15.4857 13.1429 14.8571V13.1429H14.8571C15.4857 13.1429 16 12.6286 16 12C16 11.3714 15.4857 10.8571 14.8571 10.8571Z",fill:"#161616"})),l=()=>i("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},i("path",{d:"M18.25 2H10.75C8.6875 2 7 3.6875 7 5.75V7H5.75C3.6875 7 2 8.6875 2 10.75V18.25C2 20.3125 3.6875 22 5.75 22H13.25C15.3125 22 17 20.3125 17 18.25H14.5C14.5 18.9375 13.9375 19.5 13.25 19.5H5.75C5.0625 19.5 4.5 18.9375 4.5 18.25V10.75C4.5 10.0625 5.0625 9.5 5.75 9.5H7V13.25C7 15.3125 8.6875 17 10.75 17H18.25C20.3125 17 22 15.3125 22 13.25V5.75C22 3.6875 20.3125 2 18.25 2ZM10.75 14.5C10.0625 14.5 9.5 13.9375 9.5 13.25V9.5H13.25C13.9375 9.5 14.5 10.0625 14.5 10.75V14.5H10.75ZM19.5 13.25C19.5 13.9375 18.9375 14.5 18.25 14.5H17V10.75C17 8.6875 15.3125 7 13.25 7H9.5V5.75C9.5 5.0625 10.0625 4.5 10.75 4.5H18.25C18.9375 4.5 19.5 5.0625 19.5 5.75V13.25Z",fill:"#161616"})),v=class{constructor(i){t(this,i),this.vviinnWidgetLoad=s(this,"vviinnWidgetLoad",7),this.vviinnWidgetOpen=s(this,"vviinnWidgetOpen",7),this.vviinnWidgetClose=s(this,"vviinnWidgetClose",7),this.vviinnProductLoad=s(this,"vviinnProductLoad",7),this.vviinnProductClick=s(this,"vviinnProductClick",7),this.vviinnProductView=s(this,"vviinnProductView",7),this.vviinnResultLoad=s(this,"vviinnResultLoad",7),this.vviinnResultView=s(this,"vviinnResultView",7),this.vviinnNoResult=s(this,"vviinnNoResult",7),this.vviinnAddToBasket=s(this,"vviinnAddToBasket",7),this.sidebar=null,this.sidebarCloseListener=()=>{document.body.removeChild(this.sidebar)},this.token=void 0,this.productId=void 0,this.mode="continuity",this.campaigns="",this.excluded="",this.campaignType="VPR",this.locale="de-DE",this.color="",this.imageWidth=300,this.imageRatio=1,this.cssUrl=null,this.currencySign="€",this.pricePrefix="",this.noResultText="",this.noResultShow=!0,this.gridArrowsDynamic=!1,this.productDetailsNewTab=!1,this.productDetailsRedirect=!0,this.addToBasketShow=!1,this.showFilters=!1,this.setModeDiscounts="set"===this.mode?"5, 10, 15":"",this.updateButtonLocation="topAndItem",this.sidebarTitle="set"===this.mode?"":"Visually similar products",this.modalScrollbar=!1,this.position="bottom",this.addStyle=!0,this.apiPath="https://api.vviinn.com"}render(){return i(h,{onClick:()=>{this.handleClick()},role:"button",tabindex:"0"},i("vviinn-button",{addStyle:this.addStyle,part:"vviinn-button"},i("slot",null,i("VCS"===this.campaignType?l:e,null))))}handleClick(){const i=document.createElement("vviinn-recommendations-sidebar");i.sidebarTitle=this.sidebarTitle,i.productId=this.productId,i.token=this.token,i.position=this.position,i.widgetScrollbar=this.modalScrollbar,i.campaigns=this.campaigns,i.campaignType=this.campaignType,i.color=this.color,i.locale=this.locale,i.mode="right"===this.position?"grid":this.mode,i.imageWidth=this.imageWidth,i.currencySign=this.currencySign,i.pricePrefix=this.pricePrefix,i.apiPath=this.apiPath,i.buttonElementId=this.el.id,i.noResultText=this.noResultText,i.noResultShow=this.noResultShow,i.gridArrowsDynamic=this.gridArrowsDynamic,i.productDetailsNewTab=this.productDetailsNewTab,i.productDetailsRedirect=this.productDetailsRedirect,i.widgetVersion=o,i.showingInButton=!0,i.excluded=this.excluded,i.addToBasketShow=this.addToBasketShow,i.buttonChildren=this.el.children,i.showFilters=this.showFilters,i.cssUrl=this.cssUrl,i.imageRatio=this.imageRatio,i.setModeDiscounts=this.setModeDiscounts,i.updateButtonLocation=this.updateButtonLocation,this.sidebar=i,i.addEventListener("vviinnWidgetClose",this.sidebarCloseListener),document.body.append(this.sidebar)}disconnectedCallback(){this.sidebar&&this.sidebar.removeEventListener("vviinnWidgetClose",this.sidebarCloseListener)}get el(){return n(this)}};v.style=":host{display:block}";export{v as vviinn_vpr_button}
|