vviinn-widgets 2.7.0 → 2.7.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/cropper-handler_27.cjs.entry.js +1 -1
- package/dist/collection/components/vviinn-vps-widget/vviinn-vps-widget.js +1 -1
- package/dist/esm/cropper-handler_27.entry.js +1 -1
- package/dist/vviinn-widgets/{p-669a156c.entry.js → p-5aca8be2.entry.js} +1 -1
- package/dist/vviinn-widgets/vviinn-widgets.esm.js +1 -1
- package/package.json +1 -1
- package/www/build/{p-669a156c.entry.js → p-5aca8be2.entry.js} +1 -1
- package/www/build/p-e0153ae2.css +6 -0
- package/www/build/p-f6566a1f.js +125 -0
- package/www/build/vviinn-widgets.esm.js +1 -1
- package/www/index.html +1 -1
- package/www/build/p-a67898be.css +0 -1
- package/www/build/p-eb8f77e4.js +0 -1
|
@@ -1012,9 +1012,9 @@ let VviinnVpsWidget = class {
|
|
|
1012
1012
|
index$1.imageSearchState.token = this.token;
|
|
1013
1013
|
index$1.imageSearchState.campaignId = index$1._function.pipe(this.campaignId, index$1.Option.fromNullable, index$1.Option.chain(index$1.Option.fromPredicate(notEmptyString)), index$1.Option.map(filterInt), index$1.Option.chain(index$1.Option.fromPredicate(notNan)), index$1.Option.map((s) => `${s}`));
|
|
1014
1014
|
this.uiSessionId = index$1.v4();
|
|
1015
|
+
this.trackingApi = index$1.createTrackingApi(this.apiPath, this.token);
|
|
1015
1016
|
}
|
|
1016
1017
|
trackOpenEvent() {
|
|
1017
|
-
this.trackingApi = index$1.createTrackingApi(this.apiPath, this.token);
|
|
1018
1018
|
const widgetOpenEvent = index$1.createWidgetVpsEvent({
|
|
1019
1019
|
action: "open",
|
|
1020
1020
|
session_id: this.uiSessionId,
|
|
@@ -108,9 +108,9 @@ export class VviinnVpsWidget {
|
|
|
108
108
|
imageSearchState.token = this.token;
|
|
109
109
|
imageSearchState.campaignId = pipe(this.campaignId, O.fromNullable, O.chain(O.fromPredicate(notEmptyString)), O.map(filterInt), O.chain(O.fromPredicate(notNan)), O.map((s) => `${s}`));
|
|
110
110
|
this.uiSessionId = uuidv4();
|
|
111
|
+
this.trackingApi = createTrackingApi(this.apiPath, this.token);
|
|
111
112
|
}
|
|
112
113
|
trackOpenEvent() {
|
|
113
|
-
this.trackingApi = createTrackingApi(this.apiPath, this.token);
|
|
114
114
|
const widgetOpenEvent = createWidgetVpsEvent({
|
|
115
115
|
action: "open",
|
|
116
116
|
session_id: this.uiSessionId,
|
|
@@ -1008,9 +1008,9 @@ let VviinnVpsWidget = class {
|
|
|
1008
1008
|
imageSearchState.token = this.token;
|
|
1009
1009
|
imageSearchState.campaignId = _function.pipe(this.campaignId, Option.fromNullable, Option.chain(Option.fromPredicate(notEmptyString)), Option.map(filterInt), Option.chain(Option.fromPredicate(notNan)), Option.map((s) => `${s}`));
|
|
1010
1010
|
this.uiSessionId = v4();
|
|
1011
|
+
this.trackingApi = createTrackingApi(this.apiPath, this.token);
|
|
1011
1012
|
}
|
|
1012
1013
|
trackOpenEvent() {
|
|
1013
|
-
this.trackingApi = createTrackingApi(this.apiPath, this.token);
|
|
1014
1014
|
const widgetOpenEvent = createWidgetVpsEvent({
|
|
1015
1015
|
action: "open",
|
|
1016
1016
|
session_id: this.uiSessionId,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,h as e,H as i,c as n,g as r}from"./p-4e55513e.js";import{g as s,p as o,O as a,s as l,i as d,a as c,_ as h,t as p,m,f as g,b as u,c as v,d as b,e as x,h as f,j as w,k as y,l as k,E as z,n as _,o as C,q as F,r as S,S as L,u as j,N as E,v as D,w as A,x as I,y as M,z as W,A as V,B as $,C as P}from"./p-9de1b0e7.js";import{C as B,O as G,a as O,b as T,A as H}from"./p-f6e59cb2.js";import{s as Y}from"./p-b254eee7.js";let Z=class{constructor(e){t(this,e),this.disabled=!1}render(){return e(i,{part:`handle ${s(this.handler.direction)}`,class:{disabled:this.disabled,[s(this.handler.direction)]:!0},style:{"--size":"20px",cursor:s(this.handler.direction)},draggable:!1})}};Z.style=":host{--size:20px;background:transparent;border:4px solid white;box-sizing:content-box;display:block;height:var(--size);touch-action:none;position:absolute;width:var(--size);z-index:4;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}:host(.disabled){opacity:0.25}:host(.nw-resize){border-bottom:none;border-right:none;top:0;left:0}:host(.ne-resize){border-left:none;border-bottom:none;right:0;top:0}:host(.sw-resize){border-right:none;border-top:none;left:0;bottom:0}:host(.se-resize){border-left:none;border-top:none;bottom:0;right:0}";let R=class{constructor(e){t(this,e)}getInsetValue(){return o(l(d.searchArea,d.imageBounds),a.map((([t,e])=>{return`inset(${(i=t,n=e,r={top:`${i.y}px`,right:n.width-(i.x+i.width)+"px",bottom:n.height-(i.y+i.height)+"px",left:`${i.x}px`}).top} ${r.right} ${r.bottom} ${r.left})`;var i,n,r})),a.getOrElse((()=>"")))}renderImage(){return o(l(d.imageUrl,d.imageBounds),a.map((([t,i])=>e("img",{src:t,width:i.width,height:i.height,style:{"clip-path":`${this.getInsetValue()}`}}))),a.getOrElse((()=>"")))}render(){return e(i,null,this.renderImage())}};R.style=':host{display:grid;position:absolute;box-sizing:border-box;border:none;width:100%;height:100%;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;--size:10px;--x-position:0;--y-position:0}img{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.pointer{position:absolute;width:var(--size);height:var(--size);background:black;border-radius:50%;z-index:2;cursor:pointer;transform:translate(var(--x-position), var(--y-position)) scale(0);-webkit-animation:0.25s linear fadein;animation:0.25s linear fadein;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}.pointer::after{content:"";cursor:pointer;border:5px solid black;border-radius:50%;width:var(--size);height:var(--size);display:block;transform:translate(calc(-50% + var(--size) * 0.5), calc(-50% + var(--size) * 0.5));padding:calc(var(--size) * 0.5);opacity:.75}@-webkit-keyframes fadein{from{transform:translate(var(--x-position), var(--y-position)) scale(0)}to{transform:translate(var(--x-position), var(--y-position)) scale(1)}}@keyframes fadein{from{transform:translate(var(--x-position), var(--y-position)) scale(0)}to{transform:translate(var(--x-position), var(--y-position)) scale(1)}}';let K=class{constructor(e){t(this,e),this.cropperChanged=n(this,"cropperChanged",7),this.disabled=!1,this.handleMove=!1,this.mouseStartPoint=void 0,this.bounds=void 0}componentDidLoad(){this.bounds=this.el.getBoundingClientRect()}handleHandlerMove(t){t.preventDefault(),t.stopPropagation();const e=g(t),i={position:c.concat(e,this.mouseStartPoint),direction:this.handlerMoveDirection};h.pipe(d.searchArea,a.map((t=>{const n=p(t,i);this.outOfBounds(n)||(d.searchArea=a.some(n),this.mouseStartPoint=e,d.detectedObject=void 0)})))}outOfBounds(t){return t.width<40||t.height<40||t.x<0||t.y<0||this.bounds.height-(t.y+t.height)<0||this.bounds.width-(t.x+t.width)<0}handleCropperMove(t){t.preventDefault(),t.stopPropagation();const e=g(t),i=c.concat(e,this.mouseStartPoint);h.pipe(d.searchArea,a.map((t=>{const n=m(t,i);n.x<0||n.y<0||this.bounds.height-(n.y+n.height)<0||this.bounds.width-(n.x+n.width)<0||(d.detectedObject=void 0,d.searchArea=a.some(n),this.mouseStartPoint=e)})))}handlePointerDown(t){t.stopPropagation(),this.mouseStartPoint=g(t);const e=t.target;"cropper-handler"===e.localName?(this.handlerMoveDirection=e.handler.direction,this.pointerMoveListener=this.handleHandlerMove.bind(this)):this.pointerMoveListener=this.handleCropperMove.bind(this),this.pointerReleaseListener=this.handleSearchAreaRelease.bind(this),this.el.addEventListener("pointermove",this.pointerMoveListener),window.addEventListener("pointerup",this.pointerReleaseListener,{once:!0})}handleSearchAreaRelease(){this.el.removeEventListener("pointermove",this.pointerMoveListener),document.removeEventListener("pointerup",this.pointerReleaseListener),this.mouseStartPoint=void 0,u(),this.cropperChanged.emit()}getStyleMap(){return h.pipe(d.searchArea,a.map((t=>({width:`${t.width}px`,height:`${t.height}px`,transform:`translate3d(${t.x}px, ${t.y}px, 0)`,cursor:this.handleMove?"move":"default"}))),a.getOrElse((()=>({}))))}render(){return e(i,{exportparts:"handle, e-resize, n-resize, ne-resize, nw-resize, s-resize, se-resize, sw-resize, w-resize"},e("div",{class:{"crop-area":!0,active:this.handleMove,disabled:this.disabled},draggable:!1,style:this.getStyleMap(),onContextMenu:()=>!1,onPointerDown:t=>this.handlePointerDown(t)},d.cropperHandlers.map((t=>e("cropper-handler",{disabled:this.disabled,handler:t,onPointerDown:t=>this.handlePointerDown(t)})))))}get el(){return r(this)}};K.style=":host{display:block;height:100%;left:0;position:absolute;top:0;width:100%}:host(.hidden){visibility:hidden}.crop-area{border:1px solid white;box-sizing:border-box;position:absolute;touch-action:none;transition-property:border-color, opacity;transition-duration:.25s;transition-timing-function:ease-in-out;z-index:2;position:relative;will-change:transform}.crop-area.active{border-color:whitesmoke}.crop-area.disabled{opacity:0.25}";const N=t=>t.href.split("/").reverse()[0];let q=class{constructor(e){t(this,e),this.filterSelected=n(this,"filterSelected",7),this.filter=null,this.selectedCategoryId=null,this.hideFilters=!0}handleFilterSelection(t){return this.isFilterSelected(t)?this.clearSelectedFilter():this.selectFilter(t)}selectFilter(t){this.selectedCategoryId=N(t),d.activeIonLink=t,this.filterSelected.emit("select")}clearSelectedFilter(){this.selectedCategoryId=null,d.activeIonLink=void 0,this.findSelectedFilter().blur(),this.filterSelected.emit("deselect")}findSelectedFilter(){return this.el.shadowRoot.querySelector(".filter.active")}toggleFilters(){this.hideFilters=!this.hideFilters}handleEnter(t,e){"Enter"===t.key&&this.handleFilterSelection(e)}isFilterSelected(t){return this.selectedCategoryId===N(t)}render(){return e(i,{exportparts:"filter, show-more-filters"},e("div",{class:"filters"},this.filter.filters.filter(((t,e)=>!this.hideFilters||e<5)).map(((t,i)=>e("div",{role:"button",tabindex:"0",part:this.isFilterSelected(t)?"filter active":"filter",class:{filter:!0,active:this.selectedCategoryId===N(t)},style:{"animation-delay":10*i+"ms"},onPointerUp:e=>{e.stopPropagation(),this.handleFilterSelection(t)},onKeyPress:e=>this.handleEnter(e,t)},this.isFilterSelected(t)?e(B,null):null,t.name))),e("div",{class:{filter:!0,"show-more":!0,hidden:this.filter.filters.length<=5,active:!this.hideFilters},role:"button",tabindex:"0","aria-role":"button",onClick:()=>this.toggleFilters(),onKeyPress:t=>{"Enter"===t.key&&this.toggleFilters()},part:"show-more-filters"},this.hideFilters?"Zeige mehr":"Zeige weniger")))}get el(){return r(this)}};q.style=":host{display:grid;grid-gap:1rem}.filters{display:flex;flex-direction:row;flex-wrap:wrap;gap:0.5rem}.filter{align-items:center;-webkit-animation-duration:0.25s;animation-duration:0.25s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;-webkit-animation-name:scalein;animation-name:scalein;border:1px solid lightgray;cursor:pointer;display:flex;flex-direction:row;grid-gap:8px;height:-webkit-max-content;height:-moz-max-content;height:max-content;min-width:-webkit-max-content;min-width:-moz-max-content;min-width:max-content;padding:0.1rem;transform:scale(0);transition-property:background;transition-duration:0.25s;transition-timing-function:ease-in-out;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;padding:6px 16px}.filter.active{border:1px solid black;padding:6px 8px}.filter:hover{border:1px solid gray}.show-more{display:flex}.show-more.hidden{display:none}.show-more::after{content:url(\"data:image/svg+xml,%3Csvg width='16' height='16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M8 12.2l-6-6L3.2 5 8 9.8 12.8 5 14 6.2l-6 6z' fill='%23525252'/%3E%3C/svg%3E\");display:block;height:16px;margin-top:1px;margin-left:8px}.show-more.active::after{transform:rotateX(180deg)}@-webkit-keyframes scalein{from{opacity:0;transform:scale(0.5)}to{opacity:1;transform:scale(1)}}@keyframes scalein{from{opacity:0;transform:scale(0.5)}to{opacity:1;transform:scale(1)}}@media (max-width: 415px){.show-more::after{transform:rotate(-90deg)}.show-more.active::after{transform:rotate(90deg)}}@media (max-width: 800px){.filters{flex-wrap:nowrap;overflow-x:scroll;-ms-scroll-snap-type:x mandatory;scroll-snap-type:x mandatory;grid-gap:unset}.filter{scroll-snap-align:end;margin-right:0.5rem}}";let X=class{constructor(e){t(this,e),this.detectedObjectClicked=n(this,"detectedObjectClicked",7),this.position=["0","0"]}getObjectPosition(){return h.pipe(d.imageBounds,a.map((t=>{const e=v(b(this.detectedObject).rectangle),{x:i,y:n}=h.pipe(e,x(t),f);return[`${i}px`,`${n}px`]})),a.getOrElse((()=>["0","0"])))}selectDetectedObject(){h.pipe(d.imageBounds,a.map((t=>{const e=b(this.detectedObject).rectangle,i=v(e),n=x(t)(i);d.detectedObject=this.detectedObject,d.searchArea=a.some(n)}))),u(),this.detectedObjectClicked.emit()}isActive(){if(!this.detectedObject)return!1;if(!d.detectedObject)return!1;const t=b(this.detectedObject),e=b(d.detectedObject);return w.equals(t,e)}render(){return e(i,{class:{active:this.isActive()},onClick:()=>this.selectDetectedObject(),style:{"--x-position":this.getObjectPosition()[0],"--y-position":this.getObjectPosition()[1]}})}};X.style=':host{--color-primary-system:#0F62FE;--color-primary-hover-system:#014CDA;--color-icons-system:#2F8EDF;--spacer:8px}:host{--size:32px;--x-position:0;--y-position:0;background:rgba(22, 22, 22, 0.5);border-radius:50%;border:none;cursor:pointer;display:block;height:var(--size);position:absolute;transition:opacity 0.25s;width:var(--size);z-index:2;transform:translate(calc(var(--x-position) - (var(--size) * 0.5)), calc(var(--y-position) - (var(--size) * 0.5)));transition:background 0.1 ease-in-out}:host(:hover){background:rgba(22, 22, 22, 0.75)}:host(.active){background:var(--color-primary, var(--color-primary-system))!important;border:2px solid white}:host::after{--size:32px;border-radius:50%;content:"";cursor:pointer;display:block;height:calc(var(--size) * 0.25);transform:translate(calc(-50% + var(--size) * 0.5), calc(-50% + var(--size) * 0.5));width:calc(var(--size) * 0.25);background:white}';let U=class{constructor(e){t(this,e),this.actionClick=n(this,"actionClick",7)}render(){return e(i,null,e("vviinn-error",null,e("svg",{slot:"icon",class:"icon",width:"32",height:"32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("path",{d:"M16 2a14 14 0 1 0 0 28 14 14 0 0 0 0-28Zm0 26a12 12 0 1 1 0-24 12 12 0 0 1 0 24Z",fill:"#525252"}),e("path",{d:"M17 8h-2v11h2V8Zm-1 14a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3Z",fill:"#525252"})),e("h4",{slot:"title"},"Leider nichts gefunden"),e("span",{slot:"text"},"Leider konnten wir keine passenden Produkte finden. Bitte versuche es mit einem anderen Bildausschnitt noch einmal.")))}};U.style=":host{display:grid}vviinn-error{justify-items:center}";let Q=class{constructor(e){t(this,e)}render(){return e(i,null,e("slot",{name:"icon"}),e("slot",{name:"title"}),e("slot",{name:"text"}),e("slot",{name:"action"}))}};Q.style=":host{background:#F4F4F4;border-radius:8px;display:grid;grid-gap:20px;padding:24px;text-align:center}::slotted(svg){display:grid;align-self:center}::slotted(h4){margin:unset;font-weight:600;font-size:18px;line-height:24px}::slotted(span){font-size:14px;line-height:20px}::slotted(button){-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;background:transparent;color:var(--color-primary, var(--color-primary-system));font-weight:600;font-size:16px;line-height:20px;cursor:pointer}";let J=class{constructor(e){t(this,e),this.exampleImageSelected=n(this,"exampleImageSelected",7),this.exampleImageError=n(this,"exampleImageError",7),this.src="",this.width=0,this.height=0,this.selected=!1}async selectImage(t){this.selected=!0;const e=await y(this.src),i=await k(e);h.pipe(i,z.match((()=>this.exampleImageError.emit()),(()=>this.exampleImageSelected.emit()))),this.selected=!1}showPreloader(){return(d.objectDetectionInProgress||d.loading)&&this.selected}render(){return e(i,null,this.showPreloader()?e("div",{class:"image-preloader"},e("vviinn-preloader",null)):null,e("img",{onClick:t=>this.selectImage(t),src:this.src,width:this.width,height:this.height}))}};J.style=":host{display:block;margin-bottom:8px;position:relative}img{width:100%;height:auto;cursor:pointer}.image-preloader{background:rgba(0, 0, 0, 0.25);border-radius:4px;bottom:12px;display:none;padding:4px 6px;pointer-events:none;position:absolute;right:12px;z-index:4}vviinn-preloader{--preloader-size:12px}@media (max-width: 640px){.image-preloader{display:block}}";let tt=class{constructor(e){t(this,e),this.imageSelected=n(this,"imageSelected",7),this.imageSelectedError=n(this,"imageSelectedError",7)}handleImageSelection(){this.imageSelected.emit()}handleImageSelectionError(){this.imageSelectedError.emit()}componentWillLoad(){Y(this,this.el)}render(){return e(i,null,e("slot",{name:"vviinn-example-images-title"},e("h3",null,"Mit den Beispielbildern die Suche direkt ausprobieren")),e("div",{class:"images"},e("slot",{name:"vviinn-example-images-1"},e("vviinn-example-image",{width:480,height:640,src:"https://cdn.vviinn.com/0/fit/480/0/ce/0/Z3M6Ly9haWFhcy1pbWdwcm94eS9leGFtcGxlcy9pbWctaW5zcGlyYXRpb24tMDEtTC5qcGc="})),e("slot",{name:"vviinn-example-images-2"},e("vviinn-example-image",{width:280,height:480,src:"https://cdn.vviinn.com/0/fit/480/0/ce/0/Z3M6Ly9haWFhcy1pbWdwcm94eS9leGFtcGxlcy9pbWctaW5zcGlyYXRpb24tMDItTS5qcGc="})),e("slot",{name:"vviinn-example-images-3"},e("vviinn-example-image",{width:280,height:480,src:"https://cdn.vviinn.com/0/fit/480/0/ce/0/Z3M6Ly9haWFhcy1pbWdwcm94eS9leGFtcGxlcy9pbWctaW5zcGlyYXRpb24tMDMtTS5qcGc="})),e("slot",{name:"vviinn-example-images-4"},e("vviinn-example-image",{width:480,height:640,src:"https://cdn.vviinn.com/0/fit/480/0/ce/0/Z3M6Ly9haWFhcy1pbWdwcm94eS9leGFtcGxlcy9pbWctaW5zcGlyYXRpb24tMDQtTC5qcGc="}))))}get el(){return r(this)}};tt.style="h3{font-size:22px;font-weight:600;line-height:32px;margin:0;margin-bottom:16px;text-align:center}.images{display:block;-moz-column-count:2;column-count:2;-moz-column-gap:16px;column-gap:16px}";let et=class{constructor(e){t(this,e),this.imageSelected=n(this,"imageSelected",7),this.imageSelectedError=n(this,"imageSelectedError",7)}async handleInputChange(t){const e=t.target,i=await k(e.files[0]);h.pipe(i,_((()=>this.imageSelectedError.emit()),(()=>this.imageSelected.emit()))),e.value=null}isLoading(){return d.loading||d.objectDetectionInProgress}render(){return e(i,{exportparts:"button"},this.isLoading()?e("vviinn-preloader",null):null,this.isLoading()?null:e("label",{htmlFor:"fileInput",part:"button"},e("slot",{name:"upload-button-text"},"Upload image")),e("input",{id:"fileInput",class:"visually-hidden",type:"file",accept:"image/*",onChange:t=>this.handleInputChange(t)}))}};et.style=":host{display:block}:host(::hover){background:whitesmoke}.visually-hidden{clip:rect(0 0 0 0);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}label{cursor:pointer;display:grid;padding:0.5rem;transition:background 0.1s ease-in-out}";let it=class{constructor(e){t(this,e)}handleInitialImageLoad(t){const e=C(t.target),{x:i,y:n}=m(e,{x:12,y:12}),r={x:i,y:n,width:e.width-24,height:e.height-24};d.imageBounds=a.some(e),d.searchArea=a.some(r)}renderDetectedObject(t){return e("vviinn-detected-object",{detectedObject:t})}renderImage(){return h.pipe(l(d.imageUrl,d.image),a.map((([t,i])=>{const[n,r]=(t=>{const e=F(t),i=S(288)(e).map((t=>t.size));return[i[0],i[1]]})(i);return e("img",{decoding:"async",width:n,height:r,src:t,onLoad:t=>this.handleInitialImageLoad(t),draggable:!1})})),a.getOrElse((()=>null)))}renderCropper(){return h.pipe(d.imageUrl,a.map((()=>e("image-cropper",null))),a.getOrElse((()=>null)))}render(){return e(i,null,d.loading||d.objectDetectionInProgress?e("div",{class:"image-preloader"},e("vviinn-preloader",null)):null,e("highlight-box",null),this.renderImage(),this.renderCropper(),d.detectedObjects.map((t=>this.renderDetectedObject(t))))}};it.style=":host{display:grid;position:relative;justify-self:center}img{box-sizing:border-box;filter:brightness(60%);position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:-1}.image-preloader{background:rgba(0, 0, 0, 0.25);border-radius:4px;bottom:18px;padding:4px 6px;pointer-events:none;position:absolute;right:18px;z-index:4}vviinn-preloader{--preloader-size:12px}";let nt=class{constructor(e){t(this,e),this.modalClosed=n(this,"modalClosed",7),this.secondaryActionClicked=n(this,"secondaryActionClicked",7),this.active=!1,this.slider=!1}close(){this.active=!1,setTimeout((()=>{this.modalClosed.emit()}),this.slider?500:0)}handleAnimationEnd(t){"fade-in"===t.animationName&&(this.slider=!0)}render(){return e(i,{exportparts:"secondary-action, title, close-button",class:{closed:!this.active},onAnimationEnd:t=>this.handleAnimationEnd(t)},e("div",{class:"head"},e("button",{part:"secondary-action",onClick:()=>this.secondaryActionClicked.emit()},e("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("path",{d:"M20.25 12H3.75",stroke:"#161616","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}),e("path",{d:"M10.5 5.25L3.75 12L10.5 18.75",stroke:"#161616","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}))),e("div",{class:"title",part:"title"},"Bildsuche"),e("button",{onClick:()=>this.close(),class:"close-button",part:"close-button"},e("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("path",{d:"M16 1.4L14.6 0L8 6.6L1.4 0L0 1.4L6.6 8L0 14.6L1.4 16L8 9.4L14.6 16L16 14.6L9.4 8L16 1.4Z",fill:"#333333"})))),e("div",{class:"body"},e("slot",null)))}};nt.style=":host{background:white;border-radius:4px;box-sizing:border-box;display:grid;grid-template-rows:-webkit-min-content auto;grid-template-rows:min-content auto;max-width:960px}@media (max-width: 415px){:host{-webkit-animation-name:fade-in;animation-name:fade-in;-webkit-animation-duration:0.5s;animation-duration:0.5s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}:host(.closed){-webkit-animation-name:fade-out;animation-name:fade-out;-webkit-animation-fill-mode:none;animation-fill-mode:none}.body{overflow-y:auto}}@media (max-width: 640px) and (min-width: 415px){:host{max-width:80%}}.head{align-items:center;border-bottom:1px solid #F4F4F4;display:grid;grid-gap:16px;grid-template-columns:-webkit-min-content auto -webkit-min-content;grid-template-columns:min-content auto min-content;justify-items:center;padding:16px}.title{font-weight:600;font-size:18px;line-height:24px}button{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:none;cursor:pointer;display:grid;padding:unset}@-webkit-keyframes fade-in{from{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes fade-in{from{transform:translateY(100%)}to{transform:translateY(0)}}@-webkit-keyframes fade-out{from{transform:translateY(0)}to{transform:translateY(100%)}}@keyframes fade-out{from{transform:translateY(0)}to{transform:translateY(100%)}}";let rt=class{constructor(e){t(this,e)}componentWillLoad(){Y(this,this.el)}render(){return e(i,null,e("slot",{name:"vviinn-onboarding-title"},e("h3",null,"So funktioniert es")),e("vviinn-slider",{showArrows:!0},e("vviinn-slide",null,e("vviinn-onboarding-card-1",null)),e("vviinn-slide",null,e("vviinn-onboarding-card-2",null)),e("vviinn-slide",null,e("vviinn-onboarding-card-3",null))))}get el(){return r(this)}};rt.style=":host{--color-primary-system:#0F62FE;--color-primary-hover-system:#014CDA;--color-icons-system:#2F8EDF;--spacer:8px}::host{display:block}h3{font-size:22px;font-weight:600;line-height:32px;margin:0;margin-bottom:16px;text-align:center}vviinn-slide{background:#f4f4f4;padding:24px}svg{padding:16px 0}.text{display:grid;grid-gap:8px}.text>h4{color:#161616;font-size:18px;font-weight:600;line-height:24px;margin:unset;text-align:center}.text>p{color:#525252;font-size:14px;font-style:normal;font-weight:normal;line-height:20px;margin:unset;text-align:center}.colored{fill:var(--color-icons, var(--color-icons-system))}";let st=class{constructor(e){t(this,e)}componentWillLoad(){Y(this,this.el)}render(){return e(i,null,e("slot",{name:"onboarding-card-1-icon"},e(G,null)),e("slot",{name:"onboarding-card-1-text"},e("div",{class:"text"},e("h4",null,"Starte die Bildsuche"),e("p",null,"Lade ein Bild aus Deiner Galerie hoch oder fotografiere ein Produkt mit Deiner Kamera."))))}get el(){return r(this)}};st.style=":host{align-items:center;background:#f4f4f4;display:grid;grid-template-rows:repeat(2, 1fr);justify-items:center;padding:24px;width:100%}h4{color:#161616;font-size:18px;font-weight:600;line-height:24px;margin:unset;text-align:center}svg{padding:16px 0}p{color:#525252;font-size:14px;font-style:normal;font-weight:normal;line-height:20px;margin:unset;text-align:center}.colored{fill:var(--color-icons, var(--color-icons-system))}.text{display:grid;grid-gap:8px}";let ot=class{constructor(e){t(this,e)}componentWillLoad(){Y(this,this.el)}render(){return e(i,null,e("slot",{name:"onboarding-card-2-icon"},e(O,null)),e("slot",{name:"onboarding-card-2-text"},e("div",{class:"text"},e("h4",null,"Verfeiner deine Suche"),e("p",null,"Du kannst den Bildrahmen selber festlegen und so die Produkte genau auswählen."))))}get el(){return r(this)}};ot.style=":host{align-items:center;background:#f4f4f4;display:grid;grid-template-rows:repeat(2, 1fr);justify-items:center;padding:24px;width:100%}h4{color:#161616;font-size:18px;font-weight:600;line-height:24px;margin:unset;text-align:center}svg{padding:16px 0}p{color:#525252;font-size:14px;font-style:normal;font-weight:normal;line-height:20px;margin:unset;text-align:center}.colored{fill:var(--color-icons, var(--color-icons-system))}.text{display:grid;grid-gap:8px}";let at=class{constructor(e){t(this,e)}componentWillLoad(){Y(this,this.el)}render(){return e(i,null,e("slot",{name:"onboarding-card-3-icon"},e(T,null)),e("slot",{name:"onboarding-card-3-text"},e("div",{class:"text"},e("h4",null,"Ohne Hintergrund"),e("p",null,"Die besten Ergebnisse erhältst Du, wenn das gesuchte Objekt mit einfarbigem und hellem Hintergrund zu sehen ist."))))}get el(){return r(this)}};at.style=":host{align-items:center;background:#f4f4f4;display:grid;grid-template-rows:repeat(2, 1fr);justify-items:center;padding:24px;width:100%}h4{color:#161616;font-size:18px;font-weight:600;line-height:24px;margin:unset;text-align:center}svg{padding:16px 0}p{color:#525252;font-size:14px;font-style:normal;font-weight:normal;line-height:20px;margin:unset;text-align:center}.colored{fill:var(--color-icons, var(--color-icons-system))}.text{display:grid;grid-gap:8px}";let lt=class{constructor(e){t(this,e)}render(){return e(i,null,e("slot",null))}};lt.style=":host{-webkit-animation:fade-in 0.5s ease-in-out;animation:fade-in 0.5s ease-in-out;background:rgba(0, 0, 0, 0.5);display:block;height:100vh;left:0;overflow:hidden;position:fixed;top:0;width:100vw;z-index:9999}@-webkit-keyframes fade-in{from{opacity:0.1}to{opacity:1}}@keyframes fade-in{from{opacity:0.1}to{opacity:1}}";let dt=class{constructor(e){t(this,e),this.secondaryActionClicked=n(this,"secondaryActionClicked",7),this.modalClosed=n(this,"modalClosed",7),this.active=!1}render(){return e(i,{class:{active:this.active}},e("vviinn-overlay",null,e("vviinn-modal",{onSecondaryActionClicked:()=>this.secondaryActionClicked.emit(),active:this.active},e("slot",null,"CONTENT"))))}};dt.style=":host{display:none}:host(.active){display:block}vviinn-overlay{align-items:center;display:grid;justify-items:center}@media (max-width: 415px){vviinn-modal{border-radius:4px 4px 0 0;height:100vh;margin-top:32px;transform:translateY(100%);width:100vw}vviinn-overlay{align-items:end;display:grid;justify-items:center}}";let ct=class{constructor(e){t(this,e)}isActive(){return d.loading||d.objectDetectionInProgress}render(){return e(i,{class:{active:this.isActive()}})}};ct.style=":host{--preloader-size:24px;--preloader-width:calc(var(--preloader-size) / 6);transform-origin:center;-webkit-animation:rotate 3s linear infinite;animation:rotate 3s linear infinite;border:var(--preloader-width) solid white;border-radius:50%;border-top-color:transparent;display:none;outline:0;width:var(--preloader-size);height:var(--preloader-size);box-sizing:border-box}:host(.active){display:flex}@-webkit-keyframes rotate{from{transform:rotate(-360deg)}to{transform:rotate(360deg)}}@keyframes rotate{from{transform:rotate(-360deg)}to{transform:rotate(360deg)}}";let ht=class{constructor(e){t(this,e)}componentWillLoad(){Y(this,this.el)}render(){return e(i,null,e("slot",null,e("div",{class:"content"},e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"none"},e("defs",null),e("path",{fill:"#525252",d:"M8.5 11V7h-2v1h1v3H6v1h4v-1H8.5zM8 4a.75.75 0 100 1.5A.75.75 0 008 4z"}),e("path",{fill:"#525252",d:"M8 15A7 7 0 118 1a7 7 0 010 14zM8 2a6 6 0 100 12A6 6 0 008 2z"})),e("slot",{name:"vviinn-privacy-badge-text"},e("p",null,"Wir gehen sorgfältig mit Deinen Daten um. Deine Bilder werden nur zum Zweck der Bildsuche gespeichert.")))))}get el(){return r(this)}};ht.style=":host{display:block;background:#F4F4F4;padding:17px}.content{display:grid;grid-template-columns:-webkit-min-content auto;grid-template-columns:min-content auto;grid-gap:9px}.content p{color:#525252;font-size:12px;line-height:16px;margin:unset}";class pt{sendImpression(t){var e,i,n;gtag("event","view_item_list",{items:[{id:t.productId,name:t.title,brand:null!==(e=t.brand)&&void 0!==e?e:"",category:null!==(i=t.productType)&&void 0!==i?i:"",list_name:"VI VPR View",price:Math.min(t.price.actual,null!==(n=t.price.sale)&&void 0!==n?n:1/0)}]})}sendClick(t){var e,i,n;gtag("event","select_content",{content_type:"product",items:[{id:t.productId,name:t.title,brand:null!==(e=t.brand)&&void 0!==e?e:"",category:null!==(i=t.productType)&&void 0!==i?i:"",list_name:"VI VPR View",price:Math.min(t.price.actual,null!==(n=t.price.sale)&&void 0!==n?n:1/0)}]})}}class mt{constructor(){ga("require","ec")}convertProduct(t){var e,i,n;return{id:t.productId,name:t.title,brand:null!==(e=t.brand)&&void 0!==e?e:"",category:null!==(i=t.productType)&&void 0!==i?i:"",list:"VI VPR View",price:Math.min(t.price.actual,null!==(n=t.price.sale)&&void 0!==n?n:1/0)}}sendImpression(t){ga("ec:addImpression",this.convertProduct(t))}sendClick(t){var e,i,n;ga("ec:addProduct",{id:t.productId,name:t.title,brand:null!==(e=t.brand)&&void 0!==e?e:"",category:null!==(i=t.productType)&&void 0!==i?i:"",price:Math.min(t.price.actual,null!==(n=t.price.sale)&&void 0!==n?n:1/0)}),ga("ec:setAction","click",{list:"VI VPR View"})}}const gt=a.getMonoid(L.first()).concat(h.pipe(a.fromNullable(window.gtag),a.map((()=>new pt))),h.pipe(a.fromNullable(window.ga),a.map((()=>new mt)))),ut=/fit\/\d+\//,vt=(t,e)=>h.pipe((t=>h.pipe(t.match(ut),z.fromNullable(t),z.map((()=>t))))(t),z.map((t=>t.replace(ut,`fit/${e}/`))),z.getOrElse((()=>t))),bt=(t,i)=>t.deeplink?e("a",{class:t.part,part:t.part,href:t.deeplink},i):i,xt=t=>{var i;const n=new Intl.NumberFormat(t.locale,{minimumFractionDigits:2}).format(t.price),r=`${null!==(i=t.prefix)&&void 0!==i?i:""} ${n} ${t.currency}`;return e("span",{class:"price-amount",part:"price-amount"},r)},ft=t=>{const i=e(xt,{prefix:t.prefix,currency:t.currency,price:t.price,locale:t.locale});return e("span",{class:"price-container",part:"price-container"},t.salePrice?[e("span",{class:"price-sale",part:"price-sale"},e(xt,{prefix:t.prefix,currency:t.currency,price:t.salePrice,locale:t.locale})),e("span",{class:"price-outdated",part:"price-outdated"},i)]:e("span",{class:"price-regular",part:"price-regular"},i))};let wt=class{constructor(e){t(this,e),this.recommendationLoad=n(this,"recommendationLoad",7),this.recommendationView=n(this,"recommendationView",7),this.recommendationClick=n(this,"recommendationClick",7),this.productImageLoaded=n(this,"productImageLoaded",7),this.currency=void 0,this.imageRatio=1,this.imageWidth=200,this.locale=void 0,this.pricePrefix=void 0,this.responsive=!1,this.dimmedBackground=!1,this.index=0,this.imageLoaded=!1,this.productData=null,this.intersectionObserver=new IntersectionObserver(this.intersectionCallback.bind(this),{threshold:1})}connectedCallback(){this.productData={product:this.productId,rank:this.index}}intersectionCallback(t){t.some((t=>t.isIntersecting))&&(h.pipe(gt,a.map((t=>t.sendImpression(this.getProduct())))),this.recommendationView.emit(this.productData),this.intersectionObserver.disconnect())}componentDidLoad(){this.recommendationLoad.emit(this.productData),this.intersectionObserver.observe(this.el),this.el.shadowRoot.querySelectorAll("a").forEach((t=>t.addEventListener("click",(t=>{t.preventDefault(),t.stopImmediatePropagation(),this.recommendationClick.emit(this.productData),h.pipe(gt,a.match((()=>null),(t=>t.sendClick(this.getProduct()))))}))))}getProduct(){return d.results.find((t=>t.productId===this.productId))}renderImage(){const t={width:this.imageWidth,height:this.imageWidth*this.imageRatio,src:this.image,title:this.productTitle,lazy:!1};return this.responsive?((t,i=(()=>{}))=>e("picture",null,e("img",{loading:t.lazy?"lazy":"eager",part:"image",class:"image responsive",src:vt(t.src,t.width),alt:t.title,onLoad:i})))(t,(()=>this.kek())):((t,i=(()=>{}))=>e("picture",null,e("img",{loading:t.lazy?"lazy":"eager",part:"image",class:"image",width:t.width,height:t.height,src:vt(t.src,t.width),alt:t.title,onLoad:i})))(t,(()=>this.kek()))}kek(){this.productImageLoaded.emit(this.productId)}render(){var t,n,r;return e(i,{part:"product-card",class:{dimmed:this.dimmedBackground},exportparts:"brand, currency, deeplink, image, image-link, price-amount, price-container, price-outdated, price-prefix, price-regular, price-sale, title"},e(bt,{deeplink:this.deeplink,part:"image-link"},this.renderImage()),e(bt,{deeplink:this.deeplink,part:"deeplink"},e("span",{class:"title",part:"title"},this.productTitle)),e("span",{class:"brand",part:"brand"},this.brand),e("span",{class:"type",part:"type"},this.productType),e(ft,{prefix:null!==(t=this.pricePrefix)&&void 0!==t?t:j.pricePrefix,currency:null!==(n=this.currency)&&void 0!==n?n:j.currencySign,price:this.price,salePrice:this.salePrice,locale:null!==(r=this.locale)&&void 0!==r?r:j.locale}))}get el(){return r(this)}};wt.style=':host{align-items:center;display:flex;flex-direction:column;gap:8px;height:100%}.price-container{display:flex;flex-direction:column}.price-sale,.price-regular{font-style:normal;font-weight:normal;font-size:16px;line-height:24px;color:#161616}.price-outdated{font-style:normal;font-weight:normal;font-size:16px;line-height:24px;color:#757575;text-decoration:line-through}.product-type{word-wrap:anywhere}.image{display:grid;align-content:center;-o-object-position:50% 50%;object-position:50% 50%;-o-object-fit:contain;object-fit:contain;text-align:center;box-sizing:border-box}img.responsive{width:100%;height:auto;aspect-ratio:1}.brand,.type{display:none}.title{-webkit-box-orient:vertical;-webkit-line-clamp:2;color:#161616;display:-webkit-box;font-size:16px;font-style:normal;font-weight:500;line-height:24px;margin-bottom:8px;overflow:hidden}.deeplink{text-decoration:none}.image-link{display:contents}picture{position:relative;width:100%}:host(.dimmed) picture::before{content:"";width:100%;height:100%;box-sizing:border-box;background:#f7f7f7;display:block;top:0;left:0;position:absolute;mix-blend-mode:multiply}';let yt=class{constructor(e){t(this,e),this.actionClick=n(this,"actionClick",7)}render(){return e(i,null,e("vviinn-error",null,e("h4",{slot:"title"},"Keine Verbindung"),e("span",{slot:"text"},"Etwas hat leider nicht funktioniert. Bitte prüfen Sie Ihre Internetverbindung und laden Sie das Bild noch einmal hoch."),e("button",{slot:"action",onClick:()=>this.actionClick.emit()},"Erneut versuchen")))}};yt.style=":host{display:block}";let kt=class{constructor(e){t(this,e)}render(){return e(i,null,e("slot",null))}};kt.style=":host{display:grid;justify-items:center}";const zt=({kind:t,tabindex:i,disabled:n,onClick:r,onKeyDown:s})=>{return e("div",{class:(o={kind:t,disabled:n},{"arrow-wrapper":!0,[o.kind]:!0,disabled:o.disabled}),onClick:r,tabindex:i,onKeyDown:s},e(H,null));var o};let _t=class{constructor(e){t(this,e),this.elementsCount=0,this.internalPosition=0,this.swipeStartPosition=a.none,this.showBullets=!0,this.position=0,this.showArrows=!1}positionWatchHandler(t){this.internalPosition=t,this.el.style.setProperty("--position",`${t}`),this.setActiveCssClassToSlide(t)}connectedCallback(){this.handleDomContentChanges()}handleDomContentChanges(){const t=this.el.querySelectorAll("vviinn-slide");this.elementsCount=t.length,this.el.style.setProperty("--num-items",`${this.elementsCount}`),this.setActiveCssClassToSlide(0)}setActiveCssClassToSlide(t){const e=this.el.querySelectorAll("vviinn-slide");e.forEach((t=>t.classList.remove("active"))),e[t].classList.add("active")}goToSlide(t){this.internalPosition=t,this.el.style.setProperty("--position",`${t}`),this.setActiveCssClassToSlide(t)}renderBullets(){return this.showBullets?e("div",{class:"controls"},E.range(0,this.elementsCount-1).map((t=>e("div",{class:{bullet:!0,active:t==this.internalPosition%this.elementsCount},onClick:()=>this.goToSlide(t)})))):null}nextSlide(){this.internalPosition++,this.renderSlidePosition()}prevSlide(){const t=this.internalPosition-1;this.internalPosition=t>-1?t:this.elementsCount-1,this.renderSlidePosition()}renderSlidePosition(){requestAnimationFrame((()=>{this.el.style.setProperty("--position",""+this.internalPosition%this.elementsCount)}))}handleKeyDown(t){if("Space"===t.key||"Enter"===t.key)switch(t.target.className.includes("prev")?"prev":"next"){case"prev":this.prevSlide();break;case"next":this.nextSlide()}}handleTouchStart(t){this.showBullets&&(this.swipeStartPosition=h.pipe(t.touches[0],a.fromNullable,a.map((t=>t.clientX))))}handleTouchEnd(t){if(!this.showBullets)return;const e=h.pipe(t.changedTouches[0],a.fromNullable,a.map((t=>t.clientX)));h.pipe(l(this.swipeStartPosition,e),a.map((([t,e])=>{return(i=t)<(n=e)?-1:i>n?1:0;var i,n})),a.map((t=>{switch(t){case 1:return this.nextSlide();case-1:return this.prevSlide()}})))}render(){return e(i,null,e("div",{class:"items-wrapper"},e("div",{class:"items",onTouchStart:t=>this.handleTouchStart(t),onTouchEnd:t=>this.handleTouchEnd(t)},e("slot",null))),this.showArrows?[e(zt,{kind:"prev",onClick:()=>this.prevSlide(),onKeyDown:t=>this.handleKeyDown(t),tabindex:1,disabled:!1}),e(zt,{kind:"next",onClick:()=>this.nextSlide(),onKeyDown:t=>this.handleKeyDown(t),tabindex:0,disabled:!1})]:null,this.renderBullets())}get el(){return r(this)}static get watchers(){return{position:["positionWatchHandler"]}}};_t.style=":host{--color-primary-system:#0F62FE;--color-primary-hover-system:#014CDA;--color-icons-system:#2F8EDF;--spacer:8px}:host{--num-items:0;--position:0;display:grid;grid-gap:20px;justify-items:center;position:relative}.items-wrapper{overflow:hidden;width:100%}.items{box-sizing:border-box;display:grid;grid-auto-flow:column;grid-template-columns:repeat(var(--num-items), 100%);transform:translateX(calc(-100% * var(--position)));transition:transform 0.33s ease-in-out}.controls{display:grid;grid-gap:16px;grid-template-columns:repeat(var(--num-items), -webkit-min-content);grid-template-columns:repeat(var(--num-items), min-content)}.bullet{background:#E0E0E0;border-radius:50%;box-sizing:border-box;cursor:pointer;height:8px;width:8px;transition:background 0.1s ease-in-out}.bullet:hover{background:#C6C6C6}.bullet.active{background:var(--color-primary, var(--color-primary-system))}.bullet:active{background:transparent;border:2px solid var(--color-primary, var(--color-primary-system))}.arrow-wrapper{align-items:center;background:white;border:2px solid white;bottom:0;box-sizing:border-box;display:grid;height:calc(var(--spacer) * 6);justify-items:center;margin:auto;position:absolute;top:0;transform:translate3d(0, -50%, 0);transition:border 0.25ms ease-in-out;width:calc(var(--spacer) * 4)}.arrow-wrapper:active{border-color:var(--color-primary, var(--color-primary-system));opacity:0.75}.arrow-wrapper:focus{border-color:var(--color-primary, var(--color-primary-system));opacity:0.5;outline:none}.prev{left:0}.next{right:0}.next>svg{transform:rotate3d(0, 1, 0, 180deg)}.arrow-wrapper>svg{transition:fill 0.25ms ease-in-out;fill:#A8A8A8}.arrow-wrapper:hover>svg{fill:#8D8D8D}";let Ct=class{constructor(e){t(this,e)}componentWillLoad(){Y(this,this.el)}render(){return e(i,null,e("slot",null,e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"64",height:"64",fill:"none"},e("defs",null),e("path",{fill:"#C6C6C6",d:"M48 28a11.98 11.98 0 00-9.77 18.942L28 57.172 30.828 60l10.23-10.23A11.994 11.994 0 1048 28zm0 20a8 8 0 118-8 8.009 8.009 0 01-8 8zM34 24a6 6 0 10-6-6 6.006 6.006 0 006 6zm0-8a2 2 0 110 4 2 2 0 010-4z"}),e("path",{fill:"#C6C6C6",d:"M24 48H8V35.993L18 26l11.172 11.172L32 34.336 20.828 23.165a4 4 0 00-5.656 0L8 30.336V8h40v12h4V8a4.004 4.004 0 00-4-4H8a4.004 4.004 0 00-4 4v40a4.005 4.005 0 004 4h16v-4z"})),e("span",{class:"vviinn-teaser-text"},e("slot",{name:"vviinn-teaser-text"},"Finde Produkte auf ",e("br",null)," einem Foto"))))}get el(){return r(this)}};Ct.style=":host{align-items:center;display:grid;justify-items:center;grid-gap:16px}.vviinn-teaser-text{font-size:28px;font-weight:600;line-height:40px;size:28px;text-align:center}";const Ft=t=>/^[-+]?(\d+|Infinity)$/.test(t)?Number(t):NaN,St=t=>!P(t),Lt=t=>!isNaN(t);let jt=class{constructor(e){t(this,e),this.apiPath="https://api.vviinn.com",this.active=!1,this.currencySign="€",this.locale="de-DE",this.slidePosition=0,this.width=0,this.wrongImageFormat=!1,this.imageSource=null}activeWatcher(t){t?(this.overflow=document.body.style.overflow,document.body.style.overflow="hidden",this.trackOpenEvent()):document.body.style.overflow=this.overflow}trackRecommendationView({detail:t}){const e=D(Object.assign({session_id:this.uiSessionId},t));this.trackingApi.trackEvent(e)}trackRecommendationClick({detail:t}){const e=A(Object.assign({sessionId:this.uiSessionId},t));this.trackingApi.trackEvent(e).finally((()=>{const e=d.results.find((e=>e.productId===t.product));e&&e.deeplink&&(window.location.href=e.deeplink)}))}trachSearchAreaChanges(){const t=I({session_id:this.uiSessionId,source:this.imageSource,search_area:"manual-selection"});this.trackingApi.trackEvent(t)}trackDetectedObject(){const t=I({session_id:this.uiSessionId,source:this.imageSource,search_area:"attention-point"});this.trackingApi.trackEvent(t)}trackFilter({detail:t}){const e=M({session_id:this.uiSessionId,source:this.imageSource,kind:"category",action:t});this.trackingApi.trackEvent(e)}componentWillLoad(){Y(this,this.el)}connectedCallback(){j.apiPath=this.apiPath,j.currencySign=this.currencySign,j.locale=this.locale,d.token=this.token,d.campaignId=h.pipe(this.campaignId,a.fromNullable,a.chain(a.fromPredicate(St)),a.map(Ft),a.chain(a.fromPredicate(Lt)),a.map((t=>`${t}`))),this.uiSessionId=W()}trackOpenEvent(){this.trackingApi=V(this.apiPath,this.token);const t=$({action:"open",session_id:this.uiSessionId});this.trackingApi.trackEvent(t)}handleImageSelection(t){this.imageSource=t,this.slidePosition=1,this.el.shadowRoot.querySelector("vviinn-overlayed-modal").shadowRoot.querySelector("vviinn-overlay").querySelector("vviinn-modal").shadowRoot.querySelector(".body").scrollTop=0,this.trackInitialSearch()}trackInitialSearch(){const t=I({session_id:this.uiSessionId,source:this.imageSource,search_area:"full"});this.trackingApi.trackEvent(t)}resetState(){this.resetScroll("onboarding-block"),this.slidePosition=0,d.image=a.none,d.imageUrl=a.none,d.imageBounds=a.none,d.searchArea=a.none,d.results=[],d.filters=[],d.detectedObjects=[],d.activeIonLink=void 0,d.rectangleSearchForm=void 0,this.resetScroll("results-block")}haveErrors(){return this.wrongImageFormat||d.serverError}resetScroll(t,e="auto"){this.el.shadowRoot.getElementById(t).scroll({top:0,left:0,behavior:e})}handleModalClose(){this.active=!1,this.resetState(),["onboarding-block","results-block"].forEach((t=>this.resetScroll(t)));const t=$({action:"close",session_id:this.uiSessionId});this.trackingApi.trackEvent(t)}render(){return e(i,null,e("vviinn-overlayed-modal",{class:{"first-screen":0===this.slidePosition},active:this.active,onSecondaryActionClicked:()=>this.resetState(),onModalClosed:()=>this.handleModalClose(),exportparts:"secondary-action, title, close-button, example-images"},e("vviinn-slider",{showBullets:!1,position:this.slidePosition},e("vviinn-slide",{class:{"start-page":!0}},e("div",{class:{error:this.haveErrors(),"start-page_block":!0}},e("vviinn-wrong-format",{class:{hidden:!this.wrongImageFormat},onActionClick:()=>this.wrongImageFormat=!1}),e("vviinn-server-error",{class:{hidden:!d.serverError},onActionClick:()=>d.serverError=!1}),e("vviinn-teaser",{class:{hidden:this.haveErrors()}}),e("vviinn-image-selector",{class:{hidden:this.haveErrors()},onImageSelected:()=>this.handleImageSelection("upload"),onImageSelectedError:()=>this.wrongImageFormat=!0,part:"select-image_button"},e("span",{slot:"upload-button-text",class:"upload-button-content"},e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"29",height:"28",fill:"none"},e("defs",null),e("path",{fill:"#fff","fill-rule":"evenodd",d:"M10.271 3.89A.875.875 0 0111 3.5h7c.293 0 .566.146.728.39l1.49 2.235h3.033a2.625 2.625 0 012.625 2.625V21a2.625 2.625 0 01-2.625 2.625H5.75A2.625 2.625 0 013.125 21V8.75A2.625 2.625 0 015.75 6.125h3.031l1.49-2.235zm1.197 1.36l-1.49 2.235a.875.875 0 01-.729.39H5.75a.875.875 0 00-.875.875V21a.875.875 0 00.875.875h17.5a.875.875 0 00.875-.875V8.75a.875.875 0 00-.875-.875h-3.5a.875.875 0 01-.729-.39l-1.49-2.235h-6.063z","clip-rule":"evenodd"}),e("path",{fill:"#fff","fill-rule":"evenodd",d:"M14.5 11.375a3.062 3.062 0 100 6.125 3.062 3.062 0 000-6.125zm-4.813 3.063a4.812 4.812 0 119.625 0 4.812 4.812 0 01-9.625 0z","clip-rule":"evenodd"})),e("slot",{name:"vviinn-image-upload-button-text"},e("span",null,"Kamera oder Bild auswählen")))),e("vviinn-privacy-badge",{class:{hidden:this.haveErrors()}})),e("div",{id:"onboarding-block",class:"start-page_block"},e("div",{class:"onboarding-wrapper"},e("vviinn-onboarding",null),e("vviinn-example-images",{part:"example-images",onImageSelected:()=>this.handleImageSelection("example"),onImageSelectedError:()=>this.resetScroll("onboarding-block","smooth")})))),e("vviinn-slide",{class:{"results-page":!0,active:1==this.slidePosition}},e("div",{class:"image-wrapper"},e("vviinn-image-view",null),e("div",{class:"filters-wrapper"},e("div",{class:"filters"},d.filters.map((t=>e("search-filters",{filter:t})))))),e("div",{id:"results-block",class:"products-wrapper"},e("div",{class:{"nothing-found":!0,hidden:d.results.length>0}},e("vviinn-empty-results",null),e("vviinn-onboarding",null)),e("div",{class:{hidden:d.results.length<=0,products:!0}},d.results.map(((t,i)=>{var n;return e("vviinn-product-card",{hidden:!0,productTitle:t.title,productId:t.productId,brand:t.brand,deeplink:t.deeplink,price:t.price.actual,salePrice:t.price.sale,imageWidth:160,image:null!==(n=t.image.thumbnail)&&void 0!==n?n:t.image.original,part:"product-card",index:i})}))))))))}get el(){return r(this)}static get watchers(){return{active:["activeWatcher"]}}};jt.style=":host{--color-primary-system:#0F62FE;--color-primary-hover-system:#014CDA;--color-icons-system:#2F8EDF;--spacer:8px}:host{display:block}.hidden{visibility:hidden;height:1px}vviinn-overlayed-modal.first-screen::part(title),vviinn-overlayed-modal.first-screen::part(secondary-action){visibility:hidden}.start-page{display:grid;grid-template-columns:repeat(2, 1fr);min-height:580px}.start-page_block{align-content:start;border-right:1px solid #F4F4F4;display:grid;padding:48px}.start-page_block.error{align-content:center}#onboarding-block{border-right:unset;box-sizing:border-box;grid-gap:24px;overflow-y:auto;position:relative;width:100%}vviinn-teaser{margin-bottom:32px;margin-top:-24px}vviinn-image-selector{align-items:center;background:var(--color-primary, var(--color-primary-system));border-color:var(--color-primary, var(--color-primary-system));border-radius:2px;color:white;display:grid;font-size:16px;font-weight:600;height:56px;justify-items:center;margin-bottom:16px;transition:background 0.1s ease-in-out}vviinn-image-selector:hover{background:var(--color-primary-hover, var(--color-primary-hover-system));border-color:var(--color-primary-hover, var(--color-primary-hover-system))}vviinn-image-selector:active{border-color:black}.upload-button-content{display:grid;align-items:center;justify-items:start;justify-content:center;grid-template-columns:-webkit-max-content auto;grid-template-columns:max-content auto;grid-gap:16px}.results-page{display:grid;grid-template-columns:336px auto;box-sizing:border-box}.results-page>*{padding:24px;box-sizing:border-box}.products{align-content:center;align-items:start;box-sizing:border-box;display:grid;grid-gap:32px 16px;grid-template-columns:repeat(auto-fill, minmax(152px, 1fr));justify-items:center;padding:24px;padding-right:0;position:absolute;width:calc(100% - 16px)}.products.hidden{display:none}vviinn-empty-results{width:280px;align-self:center;justify-self:center}.products-wrapper{display:grid;overflow-y:auto;overflow-x:hidden;padding:unset;position:relative;width:100%}.image-wrapper{border-right:1px solid #F4F4F4;display:grid;grid-template-rows:-webkit-min-content 170px;grid-template-rows:min-content 170px;grid-gap:24px;min-width:100%}.onboarding-wrapper{position:absolute;width:100%;padding:48px;box-sizing:border-box;display:grid;grid-gap:64px;padding-bottom:24px}vviinn-product-card{gap:0;width:100%}vviinn-product-card::part(image){border:1px solid #eaeaea;margin-bottom:8px}vviinn-product-card::part(price-container),vviinn-product-card::part(deeplink),vviinn-product-card::part(title){align-self:start}search-filters span{display:none}search-filters::part(filter){background:#F4F4F4;border-radius:4px;border:1px solid #F4F4F4;box-sizing:border-box;color:#161616;font-size:14px;font-weight:600;line-height:20px}search-filters::part(show-more-filters){border:1px solid #f4f4f4;border-radius:4px;box-sizing:border-box;color:#161616;font-size:14px;font-weight:600;line-height:20px;padding:6px 16px}search-filters::part(show-more-filters):hover{background:#EAEAEA}search-filters::part(filter):hover{background:#EAEAEA}search-filters::part(filter):focus{outline:none;border:1px solid var(--color-primary, var(--color-primary-system))}search-filters::part(filter active){background:rgba(15, 98, 254, 0.15);color:var(--color-primary, var(--color-primary-system))}.filters-wrapper{overflow:auto}.results-page:not(.active){display:none}.nothing-found{display:grid;grid-gap:64px;justify-self:center;padding-top:64px;padding-bottom:16px;position:absolute;width:60%}@media (max-width: 768px){.start-page_block{padding:24px}.onboarding-wrapper{padding:24px}}@media (max-width: 640px){.start-page{grid-template-rows:-webkit-min-content;grid-template-rows:min-content;grid-template-columns:unset;grid-gap:48px;padding:24px 0 48px 0}}@media (max-width: 640px) and (min-width: 415px){.onboarding-wrapper{position:unset}#onboarding-block{overflow:unset}.start-page.active{height:1px;overflow:auto}}@media (max-width: 415px){.results-page>*{box-sizing:border-box;padding:24px}vviinn-slide{padding-bottom:48px}.start-page_block:last-of-type{border-right:unset;overflow-y:unset;position:static;box-sizing:border-box;width:unset}.start-page_block{padding:0 24px}vviinn-teaser{margin-top:24px}.onboarding-wrapper{position:static;width:unset;padding:unset;box-sizing:border-box}.results-page{grid-template-columns:unset;grid-template-rows:-webkit-min-content auto;grid-template-rows:min-content auto}.image{margin-bottom:8px}.image-wrapper{grid-template-rows:-webkit-min-content auto;grid-template-rows:min-content auto;width:100%}.products-wrapper{align-content:start;position:static;overflow-y:unset;width:100%;padding-top:0}.products{position:static;padding:0;width:unset;grid-gap:32px 16px;justify-content:center}.nothing-found{position:static;grid-gap:64px;padding:unset;align-content:start;width:unset}}@media (max-width: 320px){.products{grid-template-columns:unset}}vviinn-wrong-format,vviinn-server-error{width:280px;align-self:center;justify-self:center}";let Et=class{constructor(e){t(this,e),this.actionClick=n(this,"actionClick",7)}render(){return e(i,null,e("vviinn-error",null,e("h4",{slot:"title"},"Dateityp wird nicht unterstützt"),e("span",{slot:"text"},"Leider unterstützen wir dieses Format nicht. Bitte laden Sie eine .jpg, .png oder .webp Bilddatei hoch."),e("button",{slot:"action",onClick:()=>this.actionClick.emit()},"Neues Bild hochladen")))}};Et.style=":host{display:block}";export{Z as cropper_handler,R as highlight_box,K as image_cropper,q as search_filters,X as vviinn_detected_object,U as vviinn_empty_results,Q as vviinn_error,J as vviinn_example_image,tt as vviinn_example_images,et as vviinn_image_selector,it as vviinn_image_view,nt as vviinn_modal,rt as vviinn_onboarding,st as vviinn_onboarding_card_1,ot as vviinn_onboarding_card_2,at as vviinn_onboarding_card_3,lt as vviinn_overlay,dt as vviinn_overlayed_modal,ct as vviinn_preloader,ht as vviinn_privacy_badge,wt as vviinn_product_card,yt as vviinn_server_error,kt as vviinn_slide,_t as vviinn_slider,Ct as vviinn_teaser,jt as vviinn_vps_widget,Et as vviinn_wrong_format}
|
|
1
|
+
import{r as t,h as e,H as i,c as n,g as r}from"./p-4e55513e.js";import{g as s,p as o,O as a,s as l,i as d,a as c,_ as h,t as p,m,f as g,b as u,c as v,d as b,e as x,h as f,j as w,k as y,l as k,E as z,n as _,o as C,q as F,r as S,S as L,u as j,N as E,v as D,w as A,x as I,y as M,z as W,A as V,B as $,C as P}from"./p-9de1b0e7.js";import{C as B,O as G,a as O,b as T,A as H}from"./p-f6e59cb2.js";import{s as Y}from"./p-b254eee7.js";let Z=class{constructor(e){t(this,e),this.disabled=!1}render(){return e(i,{part:`handle ${s(this.handler.direction)}`,class:{disabled:this.disabled,[s(this.handler.direction)]:!0},style:{"--size":"20px",cursor:s(this.handler.direction)},draggable:!1})}};Z.style=":host{--size:20px;background:transparent;border:4px solid white;box-sizing:content-box;display:block;height:var(--size);touch-action:none;position:absolute;width:var(--size);z-index:4;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}:host(.disabled){opacity:0.25}:host(.nw-resize){border-bottom:none;border-right:none;top:0;left:0}:host(.ne-resize){border-left:none;border-bottom:none;right:0;top:0}:host(.sw-resize){border-right:none;border-top:none;left:0;bottom:0}:host(.se-resize){border-left:none;border-top:none;bottom:0;right:0}";let R=class{constructor(e){t(this,e)}getInsetValue(){return o(l(d.searchArea,d.imageBounds),a.map((([t,e])=>{return`inset(${(i=t,n=e,r={top:`${i.y}px`,right:n.width-(i.x+i.width)+"px",bottom:n.height-(i.y+i.height)+"px",left:`${i.x}px`}).top} ${r.right} ${r.bottom} ${r.left})`;var i,n,r})),a.getOrElse((()=>"")))}renderImage(){return o(l(d.imageUrl,d.imageBounds),a.map((([t,i])=>e("img",{src:t,width:i.width,height:i.height,style:{"clip-path":`${this.getInsetValue()}`}}))),a.getOrElse((()=>"")))}render(){return e(i,null,this.renderImage())}};R.style=':host{display:grid;position:absolute;box-sizing:border-box;border:none;width:100%;height:100%;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;--size:10px;--x-position:0;--y-position:0}img{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.pointer{position:absolute;width:var(--size);height:var(--size);background:black;border-radius:50%;z-index:2;cursor:pointer;transform:translate(var(--x-position), var(--y-position)) scale(0);-webkit-animation:0.25s linear fadein;animation:0.25s linear fadein;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}.pointer::after{content:"";cursor:pointer;border:5px solid black;border-radius:50%;width:var(--size);height:var(--size);display:block;transform:translate(calc(-50% + var(--size) * 0.5), calc(-50% + var(--size) * 0.5));padding:calc(var(--size) * 0.5);opacity:.75}@-webkit-keyframes fadein{from{transform:translate(var(--x-position), var(--y-position)) scale(0)}to{transform:translate(var(--x-position), var(--y-position)) scale(1)}}@keyframes fadein{from{transform:translate(var(--x-position), var(--y-position)) scale(0)}to{transform:translate(var(--x-position), var(--y-position)) scale(1)}}';let K=class{constructor(e){t(this,e),this.cropperChanged=n(this,"cropperChanged",7),this.disabled=!1,this.handleMove=!1,this.mouseStartPoint=void 0,this.bounds=void 0}componentDidLoad(){this.bounds=this.el.getBoundingClientRect()}handleHandlerMove(t){t.preventDefault(),t.stopPropagation();const e=g(t),i={position:c.concat(e,this.mouseStartPoint),direction:this.handlerMoveDirection};h.pipe(d.searchArea,a.map((t=>{const n=p(t,i);this.outOfBounds(n)||(d.searchArea=a.some(n),this.mouseStartPoint=e,d.detectedObject=void 0)})))}outOfBounds(t){return t.width<40||t.height<40||t.x<0||t.y<0||this.bounds.height-(t.y+t.height)<0||this.bounds.width-(t.x+t.width)<0}handleCropperMove(t){t.preventDefault(),t.stopPropagation();const e=g(t),i=c.concat(e,this.mouseStartPoint);h.pipe(d.searchArea,a.map((t=>{const n=m(t,i);n.x<0||n.y<0||this.bounds.height-(n.y+n.height)<0||this.bounds.width-(n.x+n.width)<0||(d.detectedObject=void 0,d.searchArea=a.some(n),this.mouseStartPoint=e)})))}handlePointerDown(t){t.stopPropagation(),this.mouseStartPoint=g(t);const e=t.target;"cropper-handler"===e.localName?(this.handlerMoveDirection=e.handler.direction,this.pointerMoveListener=this.handleHandlerMove.bind(this)):this.pointerMoveListener=this.handleCropperMove.bind(this),this.pointerReleaseListener=this.handleSearchAreaRelease.bind(this),this.el.addEventListener("pointermove",this.pointerMoveListener),window.addEventListener("pointerup",this.pointerReleaseListener,{once:!0})}handleSearchAreaRelease(){this.el.removeEventListener("pointermove",this.pointerMoveListener),document.removeEventListener("pointerup",this.pointerReleaseListener),this.mouseStartPoint=void 0,u(),this.cropperChanged.emit()}getStyleMap(){return h.pipe(d.searchArea,a.map((t=>({width:`${t.width}px`,height:`${t.height}px`,transform:`translate3d(${t.x}px, ${t.y}px, 0)`,cursor:this.handleMove?"move":"default"}))),a.getOrElse((()=>({}))))}render(){return e(i,{exportparts:"handle, e-resize, n-resize, ne-resize, nw-resize, s-resize, se-resize, sw-resize, w-resize"},e("div",{class:{"crop-area":!0,active:this.handleMove,disabled:this.disabled},draggable:!1,style:this.getStyleMap(),onContextMenu:()=>!1,onPointerDown:t=>this.handlePointerDown(t)},d.cropperHandlers.map((t=>e("cropper-handler",{disabled:this.disabled,handler:t,onPointerDown:t=>this.handlePointerDown(t)})))))}get el(){return r(this)}};K.style=":host{display:block;height:100%;left:0;position:absolute;top:0;width:100%}:host(.hidden){visibility:hidden}.crop-area{border:1px solid white;box-sizing:border-box;position:absolute;touch-action:none;transition-property:border-color, opacity;transition-duration:.25s;transition-timing-function:ease-in-out;z-index:2;position:relative;will-change:transform}.crop-area.active{border-color:whitesmoke}.crop-area.disabled{opacity:0.25}";const N=t=>t.href.split("/").reverse()[0];let q=class{constructor(e){t(this,e),this.filterSelected=n(this,"filterSelected",7),this.filter=null,this.selectedCategoryId=null,this.hideFilters=!0}handleFilterSelection(t){return this.isFilterSelected(t)?this.clearSelectedFilter():this.selectFilter(t)}selectFilter(t){this.selectedCategoryId=N(t),d.activeIonLink=t,this.filterSelected.emit("select")}clearSelectedFilter(){this.selectedCategoryId=null,d.activeIonLink=void 0,this.findSelectedFilter().blur(),this.filterSelected.emit("deselect")}findSelectedFilter(){return this.el.shadowRoot.querySelector(".filter.active")}toggleFilters(){this.hideFilters=!this.hideFilters}handleEnter(t,e){"Enter"===t.key&&this.handleFilterSelection(e)}isFilterSelected(t){return this.selectedCategoryId===N(t)}render(){return e(i,{exportparts:"filter, show-more-filters"},e("div",{class:"filters"},this.filter.filters.filter(((t,e)=>!this.hideFilters||e<5)).map(((t,i)=>e("div",{role:"button",tabindex:"0",part:this.isFilterSelected(t)?"filter active":"filter",class:{filter:!0,active:this.selectedCategoryId===N(t)},style:{"animation-delay":10*i+"ms"},onPointerUp:e=>{e.stopPropagation(),this.handleFilterSelection(t)},onKeyPress:e=>this.handleEnter(e,t)},this.isFilterSelected(t)?e(B,null):null,t.name))),e("div",{class:{filter:!0,"show-more":!0,hidden:this.filter.filters.length<=5,active:!this.hideFilters},role:"button",tabindex:"0","aria-role":"button",onClick:()=>this.toggleFilters(),onKeyPress:t=>{"Enter"===t.key&&this.toggleFilters()},part:"show-more-filters"},this.hideFilters?"Zeige mehr":"Zeige weniger")))}get el(){return r(this)}};q.style=":host{display:grid;grid-gap:1rem}.filters{display:flex;flex-direction:row;flex-wrap:wrap;gap:0.5rem}.filter{align-items:center;-webkit-animation-duration:0.25s;animation-duration:0.25s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;-webkit-animation-name:scalein;animation-name:scalein;border:1px solid lightgray;cursor:pointer;display:flex;flex-direction:row;grid-gap:8px;height:-webkit-max-content;height:-moz-max-content;height:max-content;min-width:-webkit-max-content;min-width:-moz-max-content;min-width:max-content;padding:0.1rem;transform:scale(0);transition-property:background;transition-duration:0.25s;transition-timing-function:ease-in-out;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;padding:6px 16px}.filter.active{border:1px solid black;padding:6px 8px}.filter:hover{border:1px solid gray}.show-more{display:flex}.show-more.hidden{display:none}.show-more::after{content:url(\"data:image/svg+xml,%3Csvg width='16' height='16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M8 12.2l-6-6L3.2 5 8 9.8 12.8 5 14 6.2l-6 6z' fill='%23525252'/%3E%3C/svg%3E\");display:block;height:16px;margin-top:1px;margin-left:8px}.show-more.active::after{transform:rotateX(180deg)}@-webkit-keyframes scalein{from{opacity:0;transform:scale(0.5)}to{opacity:1;transform:scale(1)}}@keyframes scalein{from{opacity:0;transform:scale(0.5)}to{opacity:1;transform:scale(1)}}@media (max-width: 415px){.show-more::after{transform:rotate(-90deg)}.show-more.active::after{transform:rotate(90deg)}}@media (max-width: 800px){.filters{flex-wrap:nowrap;overflow-x:scroll;-ms-scroll-snap-type:x mandatory;scroll-snap-type:x mandatory;grid-gap:unset}.filter{scroll-snap-align:end;margin-right:0.5rem}}";let X=class{constructor(e){t(this,e),this.detectedObjectClicked=n(this,"detectedObjectClicked",7),this.position=["0","0"]}getObjectPosition(){return h.pipe(d.imageBounds,a.map((t=>{const e=v(b(this.detectedObject).rectangle),{x:i,y:n}=h.pipe(e,x(t),f);return[`${i}px`,`${n}px`]})),a.getOrElse((()=>["0","0"])))}selectDetectedObject(){h.pipe(d.imageBounds,a.map((t=>{const e=b(this.detectedObject).rectangle,i=v(e),n=x(t)(i);d.detectedObject=this.detectedObject,d.searchArea=a.some(n)}))),u(),this.detectedObjectClicked.emit()}isActive(){if(!this.detectedObject)return!1;if(!d.detectedObject)return!1;const t=b(this.detectedObject),e=b(d.detectedObject);return w.equals(t,e)}render(){return e(i,{class:{active:this.isActive()},onClick:()=>this.selectDetectedObject(),style:{"--x-position":this.getObjectPosition()[0],"--y-position":this.getObjectPosition()[1]}})}};X.style=':host{--color-primary-system:#0F62FE;--color-primary-hover-system:#014CDA;--color-icons-system:#2F8EDF;--spacer:8px}:host{--size:32px;--x-position:0;--y-position:0;background:rgba(22, 22, 22, 0.5);border-radius:50%;border:none;cursor:pointer;display:block;height:var(--size);position:absolute;transition:opacity 0.25s;width:var(--size);z-index:2;transform:translate(calc(var(--x-position) - (var(--size) * 0.5)), calc(var(--y-position) - (var(--size) * 0.5)));transition:background 0.1 ease-in-out}:host(:hover){background:rgba(22, 22, 22, 0.75)}:host(.active){background:var(--color-primary, var(--color-primary-system))!important;border:2px solid white}:host::after{--size:32px;border-radius:50%;content:"";cursor:pointer;display:block;height:calc(var(--size) * 0.25);transform:translate(calc(-50% + var(--size) * 0.5), calc(-50% + var(--size) * 0.5));width:calc(var(--size) * 0.25);background:white}';let U=class{constructor(e){t(this,e),this.actionClick=n(this,"actionClick",7)}render(){return e(i,null,e("vviinn-error",null,e("svg",{slot:"icon",class:"icon",width:"32",height:"32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("path",{d:"M16 2a14 14 0 1 0 0 28 14 14 0 0 0 0-28Zm0 26a12 12 0 1 1 0-24 12 12 0 0 1 0 24Z",fill:"#525252"}),e("path",{d:"M17 8h-2v11h2V8Zm-1 14a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3Z",fill:"#525252"})),e("h4",{slot:"title"},"Leider nichts gefunden"),e("span",{slot:"text"},"Leider konnten wir keine passenden Produkte finden. Bitte versuche es mit einem anderen Bildausschnitt noch einmal.")))}};U.style=":host{display:grid}vviinn-error{justify-items:center}";let Q=class{constructor(e){t(this,e)}render(){return e(i,null,e("slot",{name:"icon"}),e("slot",{name:"title"}),e("slot",{name:"text"}),e("slot",{name:"action"}))}};Q.style=":host{background:#F4F4F4;border-radius:8px;display:grid;grid-gap:20px;padding:24px;text-align:center}::slotted(svg){display:grid;align-self:center}::slotted(h4){margin:unset;font-weight:600;font-size:18px;line-height:24px}::slotted(span){font-size:14px;line-height:20px}::slotted(button){-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;background:transparent;color:var(--color-primary, var(--color-primary-system));font-weight:600;font-size:16px;line-height:20px;cursor:pointer}";let J=class{constructor(e){t(this,e),this.exampleImageSelected=n(this,"exampleImageSelected",7),this.exampleImageError=n(this,"exampleImageError",7),this.src="",this.width=0,this.height=0,this.selected=!1}async selectImage(t){this.selected=!0;const e=await y(this.src),i=await k(e);h.pipe(i,z.match((()=>this.exampleImageError.emit()),(()=>this.exampleImageSelected.emit()))),this.selected=!1}showPreloader(){return(d.objectDetectionInProgress||d.loading)&&this.selected}render(){return e(i,null,this.showPreloader()?e("div",{class:"image-preloader"},e("vviinn-preloader",null)):null,e("img",{onClick:t=>this.selectImage(t),src:this.src,width:this.width,height:this.height}))}};J.style=":host{display:block;margin-bottom:8px;position:relative}img{width:100%;height:auto;cursor:pointer}.image-preloader{background:rgba(0, 0, 0, 0.25);border-radius:4px;bottom:12px;display:none;padding:4px 6px;pointer-events:none;position:absolute;right:12px;z-index:4}vviinn-preloader{--preloader-size:12px}@media (max-width: 640px){.image-preloader{display:block}}";let tt=class{constructor(e){t(this,e),this.imageSelected=n(this,"imageSelected",7),this.imageSelectedError=n(this,"imageSelectedError",7)}handleImageSelection(){this.imageSelected.emit()}handleImageSelectionError(){this.imageSelectedError.emit()}componentWillLoad(){Y(this,this.el)}render(){return e(i,null,e("slot",{name:"vviinn-example-images-title"},e("h3",null,"Mit den Beispielbildern die Suche direkt ausprobieren")),e("div",{class:"images"},e("slot",{name:"vviinn-example-images-1"},e("vviinn-example-image",{width:480,height:640,src:"https://cdn.vviinn.com/0/fit/480/0/ce/0/Z3M6Ly9haWFhcy1pbWdwcm94eS9leGFtcGxlcy9pbWctaW5zcGlyYXRpb24tMDEtTC5qcGc="})),e("slot",{name:"vviinn-example-images-2"},e("vviinn-example-image",{width:280,height:480,src:"https://cdn.vviinn.com/0/fit/480/0/ce/0/Z3M6Ly9haWFhcy1pbWdwcm94eS9leGFtcGxlcy9pbWctaW5zcGlyYXRpb24tMDItTS5qcGc="})),e("slot",{name:"vviinn-example-images-3"},e("vviinn-example-image",{width:280,height:480,src:"https://cdn.vviinn.com/0/fit/480/0/ce/0/Z3M6Ly9haWFhcy1pbWdwcm94eS9leGFtcGxlcy9pbWctaW5zcGlyYXRpb24tMDMtTS5qcGc="})),e("slot",{name:"vviinn-example-images-4"},e("vviinn-example-image",{width:480,height:640,src:"https://cdn.vviinn.com/0/fit/480/0/ce/0/Z3M6Ly9haWFhcy1pbWdwcm94eS9leGFtcGxlcy9pbWctaW5zcGlyYXRpb24tMDQtTC5qcGc="}))))}get el(){return r(this)}};tt.style="h3{font-size:22px;font-weight:600;line-height:32px;margin:0;margin-bottom:16px;text-align:center}.images{display:block;-moz-column-count:2;column-count:2;-moz-column-gap:16px;column-gap:16px}";let et=class{constructor(e){t(this,e),this.imageSelected=n(this,"imageSelected",7),this.imageSelectedError=n(this,"imageSelectedError",7)}async handleInputChange(t){const e=t.target,i=await k(e.files[0]);h.pipe(i,_((()=>this.imageSelectedError.emit()),(()=>this.imageSelected.emit()))),e.value=null}isLoading(){return d.loading||d.objectDetectionInProgress}render(){return e(i,{exportparts:"button"},this.isLoading()?e("vviinn-preloader",null):null,this.isLoading()?null:e("label",{htmlFor:"fileInput",part:"button"},e("slot",{name:"upload-button-text"},"Upload image")),e("input",{id:"fileInput",class:"visually-hidden",type:"file",accept:"image/*",onChange:t=>this.handleInputChange(t)}))}};et.style=":host{display:block}:host(::hover){background:whitesmoke}.visually-hidden{clip:rect(0 0 0 0);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}label{cursor:pointer;display:grid;padding:0.5rem;transition:background 0.1s ease-in-out}";let it=class{constructor(e){t(this,e)}handleInitialImageLoad(t){const e=C(t.target),{x:i,y:n}=m(e,{x:12,y:12}),r={x:i,y:n,width:e.width-24,height:e.height-24};d.imageBounds=a.some(e),d.searchArea=a.some(r)}renderDetectedObject(t){return e("vviinn-detected-object",{detectedObject:t})}renderImage(){return h.pipe(l(d.imageUrl,d.image),a.map((([t,i])=>{const[n,r]=(t=>{const e=F(t),i=S(288)(e).map((t=>t.size));return[i[0],i[1]]})(i);return e("img",{decoding:"async",width:n,height:r,src:t,onLoad:t=>this.handleInitialImageLoad(t),draggable:!1})})),a.getOrElse((()=>null)))}renderCropper(){return h.pipe(d.imageUrl,a.map((()=>e("image-cropper",null))),a.getOrElse((()=>null)))}render(){return e(i,null,d.loading||d.objectDetectionInProgress?e("div",{class:"image-preloader"},e("vviinn-preloader",null)):null,e("highlight-box",null),this.renderImage(),this.renderCropper(),d.detectedObjects.map((t=>this.renderDetectedObject(t))))}};it.style=":host{display:grid;position:relative;justify-self:center}img{box-sizing:border-box;filter:brightness(60%);position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:-1}.image-preloader{background:rgba(0, 0, 0, 0.25);border-radius:4px;bottom:18px;padding:4px 6px;pointer-events:none;position:absolute;right:18px;z-index:4}vviinn-preloader{--preloader-size:12px}";let nt=class{constructor(e){t(this,e),this.modalClosed=n(this,"modalClosed",7),this.secondaryActionClicked=n(this,"secondaryActionClicked",7),this.active=!1,this.slider=!1}close(){this.active=!1,setTimeout((()=>{this.modalClosed.emit()}),this.slider?500:0)}handleAnimationEnd(t){"fade-in"===t.animationName&&(this.slider=!0)}render(){return e(i,{exportparts:"secondary-action, title, close-button",class:{closed:!this.active},onAnimationEnd:t=>this.handleAnimationEnd(t)},e("div",{class:"head"},e("button",{part:"secondary-action",onClick:()=>this.secondaryActionClicked.emit()},e("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("path",{d:"M20.25 12H3.75",stroke:"#161616","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}),e("path",{d:"M10.5 5.25L3.75 12L10.5 18.75",stroke:"#161616","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}))),e("div",{class:"title",part:"title"},"Bildsuche"),e("button",{onClick:()=>this.close(),class:"close-button",part:"close-button"},e("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("path",{d:"M16 1.4L14.6 0L8 6.6L1.4 0L0 1.4L6.6 8L0 14.6L1.4 16L8 9.4L14.6 16L16 14.6L9.4 8L16 1.4Z",fill:"#333333"})))),e("div",{class:"body"},e("slot",null)))}};nt.style=":host{background:white;border-radius:4px;box-sizing:border-box;display:grid;grid-template-rows:-webkit-min-content auto;grid-template-rows:min-content auto;max-width:960px}@media (max-width: 415px){:host{-webkit-animation-name:fade-in;animation-name:fade-in;-webkit-animation-duration:0.5s;animation-duration:0.5s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}:host(.closed){-webkit-animation-name:fade-out;animation-name:fade-out;-webkit-animation-fill-mode:none;animation-fill-mode:none}.body{overflow-y:auto}}@media (max-width: 640px) and (min-width: 415px){:host{max-width:80%}}.head{align-items:center;border-bottom:1px solid #F4F4F4;display:grid;grid-gap:16px;grid-template-columns:-webkit-min-content auto -webkit-min-content;grid-template-columns:min-content auto min-content;justify-items:center;padding:16px}.title{font-weight:600;font-size:18px;line-height:24px}button{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:none;cursor:pointer;display:grid;padding:unset}@-webkit-keyframes fade-in{from{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes fade-in{from{transform:translateY(100%)}to{transform:translateY(0)}}@-webkit-keyframes fade-out{from{transform:translateY(0)}to{transform:translateY(100%)}}@keyframes fade-out{from{transform:translateY(0)}to{transform:translateY(100%)}}";let rt=class{constructor(e){t(this,e)}componentWillLoad(){Y(this,this.el)}render(){return e(i,null,e("slot",{name:"vviinn-onboarding-title"},e("h3",null,"So funktioniert es")),e("vviinn-slider",{showArrows:!0},e("vviinn-slide",null,e("vviinn-onboarding-card-1",null)),e("vviinn-slide",null,e("vviinn-onboarding-card-2",null)),e("vviinn-slide",null,e("vviinn-onboarding-card-3",null))))}get el(){return r(this)}};rt.style=":host{--color-primary-system:#0F62FE;--color-primary-hover-system:#014CDA;--color-icons-system:#2F8EDF;--spacer:8px}::host{display:block}h3{font-size:22px;font-weight:600;line-height:32px;margin:0;margin-bottom:16px;text-align:center}vviinn-slide{background:#f4f4f4;padding:24px}svg{padding:16px 0}.text{display:grid;grid-gap:8px}.text>h4{color:#161616;font-size:18px;font-weight:600;line-height:24px;margin:unset;text-align:center}.text>p{color:#525252;font-size:14px;font-style:normal;font-weight:normal;line-height:20px;margin:unset;text-align:center}.colored{fill:var(--color-icons, var(--color-icons-system))}";let st=class{constructor(e){t(this,e)}componentWillLoad(){Y(this,this.el)}render(){return e(i,null,e("slot",{name:"onboarding-card-1-icon"},e(G,null)),e("slot",{name:"onboarding-card-1-text"},e("div",{class:"text"},e("h4",null,"Starte die Bildsuche"),e("p",null,"Lade ein Bild aus Deiner Galerie hoch oder fotografiere ein Produkt mit Deiner Kamera."))))}get el(){return r(this)}};st.style=":host{align-items:center;background:#f4f4f4;display:grid;grid-template-rows:repeat(2, 1fr);justify-items:center;padding:24px;width:100%}h4{color:#161616;font-size:18px;font-weight:600;line-height:24px;margin:unset;text-align:center}svg{padding:16px 0}p{color:#525252;font-size:14px;font-style:normal;font-weight:normal;line-height:20px;margin:unset;text-align:center}.colored{fill:var(--color-icons, var(--color-icons-system))}.text{display:grid;grid-gap:8px}";let ot=class{constructor(e){t(this,e)}componentWillLoad(){Y(this,this.el)}render(){return e(i,null,e("slot",{name:"onboarding-card-2-icon"},e(O,null)),e("slot",{name:"onboarding-card-2-text"},e("div",{class:"text"},e("h4",null,"Verfeiner deine Suche"),e("p",null,"Du kannst den Bildrahmen selber festlegen und so die Produkte genau auswählen."))))}get el(){return r(this)}};ot.style=":host{align-items:center;background:#f4f4f4;display:grid;grid-template-rows:repeat(2, 1fr);justify-items:center;padding:24px;width:100%}h4{color:#161616;font-size:18px;font-weight:600;line-height:24px;margin:unset;text-align:center}svg{padding:16px 0}p{color:#525252;font-size:14px;font-style:normal;font-weight:normal;line-height:20px;margin:unset;text-align:center}.colored{fill:var(--color-icons, var(--color-icons-system))}.text{display:grid;grid-gap:8px}";let at=class{constructor(e){t(this,e)}componentWillLoad(){Y(this,this.el)}render(){return e(i,null,e("slot",{name:"onboarding-card-3-icon"},e(T,null)),e("slot",{name:"onboarding-card-3-text"},e("div",{class:"text"},e("h4",null,"Ohne Hintergrund"),e("p",null,"Die besten Ergebnisse erhältst Du, wenn das gesuchte Objekt mit einfarbigem und hellem Hintergrund zu sehen ist."))))}get el(){return r(this)}};at.style=":host{align-items:center;background:#f4f4f4;display:grid;grid-template-rows:repeat(2, 1fr);justify-items:center;padding:24px;width:100%}h4{color:#161616;font-size:18px;font-weight:600;line-height:24px;margin:unset;text-align:center}svg{padding:16px 0}p{color:#525252;font-size:14px;font-style:normal;font-weight:normal;line-height:20px;margin:unset;text-align:center}.colored{fill:var(--color-icons, var(--color-icons-system))}.text{display:grid;grid-gap:8px}";let lt=class{constructor(e){t(this,e)}render(){return e(i,null,e("slot",null))}};lt.style=":host{-webkit-animation:fade-in 0.5s ease-in-out;animation:fade-in 0.5s ease-in-out;background:rgba(0, 0, 0, 0.5);display:block;height:100vh;left:0;overflow:hidden;position:fixed;top:0;width:100vw;z-index:9999}@-webkit-keyframes fade-in{from{opacity:0.1}to{opacity:1}}@keyframes fade-in{from{opacity:0.1}to{opacity:1}}";let dt=class{constructor(e){t(this,e),this.secondaryActionClicked=n(this,"secondaryActionClicked",7),this.modalClosed=n(this,"modalClosed",7),this.active=!1}render(){return e(i,{class:{active:this.active}},e("vviinn-overlay",null,e("vviinn-modal",{onSecondaryActionClicked:()=>this.secondaryActionClicked.emit(),active:this.active},e("slot",null,"CONTENT"))))}};dt.style=":host{display:none}:host(.active){display:block}vviinn-overlay{align-items:center;display:grid;justify-items:center}@media (max-width: 415px){vviinn-modal{border-radius:4px 4px 0 0;height:100vh;margin-top:32px;transform:translateY(100%);width:100vw}vviinn-overlay{align-items:end;display:grid;justify-items:center}}";let ct=class{constructor(e){t(this,e)}isActive(){return d.loading||d.objectDetectionInProgress}render(){return e(i,{class:{active:this.isActive()}})}};ct.style=":host{--preloader-size:24px;--preloader-width:calc(var(--preloader-size) / 6);transform-origin:center;-webkit-animation:rotate 3s linear infinite;animation:rotate 3s linear infinite;border:var(--preloader-width) solid white;border-radius:50%;border-top-color:transparent;display:none;outline:0;width:var(--preloader-size);height:var(--preloader-size);box-sizing:border-box}:host(.active){display:flex}@-webkit-keyframes rotate{from{transform:rotate(-360deg)}to{transform:rotate(360deg)}}@keyframes rotate{from{transform:rotate(-360deg)}to{transform:rotate(360deg)}}";let ht=class{constructor(e){t(this,e)}componentWillLoad(){Y(this,this.el)}render(){return e(i,null,e("slot",null,e("div",{class:"content"},e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"none"},e("defs",null),e("path",{fill:"#525252",d:"M8.5 11V7h-2v1h1v3H6v1h4v-1H8.5zM8 4a.75.75 0 100 1.5A.75.75 0 008 4z"}),e("path",{fill:"#525252",d:"M8 15A7 7 0 118 1a7 7 0 010 14zM8 2a6 6 0 100 12A6 6 0 008 2z"})),e("slot",{name:"vviinn-privacy-badge-text"},e("p",null,"Wir gehen sorgfältig mit Deinen Daten um. Deine Bilder werden nur zum Zweck der Bildsuche gespeichert.")))))}get el(){return r(this)}};ht.style=":host{display:block;background:#F4F4F4;padding:17px}.content{display:grid;grid-template-columns:-webkit-min-content auto;grid-template-columns:min-content auto;grid-gap:9px}.content p{color:#525252;font-size:12px;line-height:16px;margin:unset}";class pt{sendImpression(t){var e,i,n;gtag("event","view_item_list",{items:[{id:t.productId,name:t.title,brand:null!==(e=t.brand)&&void 0!==e?e:"",category:null!==(i=t.productType)&&void 0!==i?i:"",list_name:"VI VPR View",price:Math.min(t.price.actual,null!==(n=t.price.sale)&&void 0!==n?n:1/0)}]})}sendClick(t){var e,i,n;gtag("event","select_content",{content_type:"product",items:[{id:t.productId,name:t.title,brand:null!==(e=t.brand)&&void 0!==e?e:"",category:null!==(i=t.productType)&&void 0!==i?i:"",list_name:"VI VPR View",price:Math.min(t.price.actual,null!==(n=t.price.sale)&&void 0!==n?n:1/0)}]})}}class mt{constructor(){ga("require","ec")}convertProduct(t){var e,i,n;return{id:t.productId,name:t.title,brand:null!==(e=t.brand)&&void 0!==e?e:"",category:null!==(i=t.productType)&&void 0!==i?i:"",list:"VI VPR View",price:Math.min(t.price.actual,null!==(n=t.price.sale)&&void 0!==n?n:1/0)}}sendImpression(t){ga("ec:addImpression",this.convertProduct(t))}sendClick(t){var e,i,n;ga("ec:addProduct",{id:t.productId,name:t.title,brand:null!==(e=t.brand)&&void 0!==e?e:"",category:null!==(i=t.productType)&&void 0!==i?i:"",price:Math.min(t.price.actual,null!==(n=t.price.sale)&&void 0!==n?n:1/0)}),ga("ec:setAction","click",{list:"VI VPR View"})}}const gt=a.getMonoid(L.first()).concat(h.pipe(a.fromNullable(window.gtag),a.map((()=>new pt))),h.pipe(a.fromNullable(window.ga),a.map((()=>new mt)))),ut=/fit\/\d+\//,vt=(t,e)=>h.pipe((t=>h.pipe(t.match(ut),z.fromNullable(t),z.map((()=>t))))(t),z.map((t=>t.replace(ut,`fit/${e}/`))),z.getOrElse((()=>t))),bt=(t,i)=>t.deeplink?e("a",{class:t.part,part:t.part,href:t.deeplink},i):i,xt=t=>{var i;const n=new Intl.NumberFormat(t.locale,{minimumFractionDigits:2}).format(t.price),r=`${null!==(i=t.prefix)&&void 0!==i?i:""} ${n} ${t.currency}`;return e("span",{class:"price-amount",part:"price-amount"},r)},ft=t=>{const i=e(xt,{prefix:t.prefix,currency:t.currency,price:t.price,locale:t.locale});return e("span",{class:"price-container",part:"price-container"},t.salePrice?[e("span",{class:"price-sale",part:"price-sale"},e(xt,{prefix:t.prefix,currency:t.currency,price:t.salePrice,locale:t.locale})),e("span",{class:"price-outdated",part:"price-outdated"},i)]:e("span",{class:"price-regular",part:"price-regular"},i))};let wt=class{constructor(e){t(this,e),this.recommendationLoad=n(this,"recommendationLoad",7),this.recommendationView=n(this,"recommendationView",7),this.recommendationClick=n(this,"recommendationClick",7),this.productImageLoaded=n(this,"productImageLoaded",7),this.currency=void 0,this.imageRatio=1,this.imageWidth=200,this.locale=void 0,this.pricePrefix=void 0,this.responsive=!1,this.dimmedBackground=!1,this.index=0,this.imageLoaded=!1,this.productData=null,this.intersectionObserver=new IntersectionObserver(this.intersectionCallback.bind(this),{threshold:1})}connectedCallback(){this.productData={product:this.productId,rank:this.index}}intersectionCallback(t){t.some((t=>t.isIntersecting))&&(h.pipe(gt,a.map((t=>t.sendImpression(this.getProduct())))),this.recommendationView.emit(this.productData),this.intersectionObserver.disconnect())}componentDidLoad(){this.recommendationLoad.emit(this.productData),this.intersectionObserver.observe(this.el),this.el.shadowRoot.querySelectorAll("a").forEach((t=>t.addEventListener("click",(t=>{t.preventDefault(),t.stopImmediatePropagation(),this.recommendationClick.emit(this.productData),h.pipe(gt,a.match((()=>null),(t=>t.sendClick(this.getProduct()))))}))))}getProduct(){return d.results.find((t=>t.productId===this.productId))}renderImage(){const t={width:this.imageWidth,height:this.imageWidth*this.imageRatio,src:this.image,title:this.productTitle,lazy:!1};return this.responsive?((t,i=(()=>{}))=>e("picture",null,e("img",{loading:t.lazy?"lazy":"eager",part:"image",class:"image responsive",src:vt(t.src,t.width),alt:t.title,onLoad:i})))(t,(()=>this.kek())):((t,i=(()=>{}))=>e("picture",null,e("img",{loading:t.lazy?"lazy":"eager",part:"image",class:"image",width:t.width,height:t.height,src:vt(t.src,t.width),alt:t.title,onLoad:i})))(t,(()=>this.kek()))}kek(){this.productImageLoaded.emit(this.productId)}render(){var t,n,r;return e(i,{part:"product-card",class:{dimmed:this.dimmedBackground},exportparts:"brand, currency, deeplink, image, image-link, price-amount, price-container, price-outdated, price-prefix, price-regular, price-sale, title"},e(bt,{deeplink:this.deeplink,part:"image-link"},this.renderImage()),e(bt,{deeplink:this.deeplink,part:"deeplink"},e("span",{class:"title",part:"title"},this.productTitle)),e("span",{class:"brand",part:"brand"},this.brand),e("span",{class:"type",part:"type"},this.productType),e(ft,{prefix:null!==(t=this.pricePrefix)&&void 0!==t?t:j.pricePrefix,currency:null!==(n=this.currency)&&void 0!==n?n:j.currencySign,price:this.price,salePrice:this.salePrice,locale:null!==(r=this.locale)&&void 0!==r?r:j.locale}))}get el(){return r(this)}};wt.style=':host{align-items:center;display:flex;flex-direction:column;gap:8px;height:100%}.price-container{display:flex;flex-direction:column}.price-sale,.price-regular{font-style:normal;font-weight:normal;font-size:16px;line-height:24px;color:#161616}.price-outdated{font-style:normal;font-weight:normal;font-size:16px;line-height:24px;color:#757575;text-decoration:line-through}.product-type{word-wrap:anywhere}.image{display:grid;align-content:center;-o-object-position:50% 50%;object-position:50% 50%;-o-object-fit:contain;object-fit:contain;text-align:center;box-sizing:border-box}img.responsive{width:100%;height:auto;aspect-ratio:1}.brand,.type{display:none}.title{-webkit-box-orient:vertical;-webkit-line-clamp:2;color:#161616;display:-webkit-box;font-size:16px;font-style:normal;font-weight:500;line-height:24px;margin-bottom:8px;overflow:hidden}.deeplink{text-decoration:none}.image-link{display:contents}picture{position:relative;width:100%}:host(.dimmed) picture::before{content:"";width:100%;height:100%;box-sizing:border-box;background:#f7f7f7;display:block;top:0;left:0;position:absolute;mix-blend-mode:multiply}';let yt=class{constructor(e){t(this,e),this.actionClick=n(this,"actionClick",7)}render(){return e(i,null,e("vviinn-error",null,e("h4",{slot:"title"},"Keine Verbindung"),e("span",{slot:"text"},"Etwas hat leider nicht funktioniert. Bitte prüfen Sie Ihre Internetverbindung und laden Sie das Bild noch einmal hoch."),e("button",{slot:"action",onClick:()=>this.actionClick.emit()},"Erneut versuchen")))}};yt.style=":host{display:block}";let kt=class{constructor(e){t(this,e)}render(){return e(i,null,e("slot",null))}};kt.style=":host{display:grid;justify-items:center}";const zt=({kind:t,tabindex:i,disabled:n,onClick:r,onKeyDown:s})=>{return e("div",{class:(o={kind:t,disabled:n},{"arrow-wrapper":!0,[o.kind]:!0,disabled:o.disabled}),onClick:r,tabindex:i,onKeyDown:s},e(H,null));var o};let _t=class{constructor(e){t(this,e),this.elementsCount=0,this.internalPosition=0,this.swipeStartPosition=a.none,this.showBullets=!0,this.position=0,this.showArrows=!1}positionWatchHandler(t){this.internalPosition=t,this.el.style.setProperty("--position",`${t}`),this.setActiveCssClassToSlide(t)}connectedCallback(){this.handleDomContentChanges()}handleDomContentChanges(){const t=this.el.querySelectorAll("vviinn-slide");this.elementsCount=t.length,this.el.style.setProperty("--num-items",`${this.elementsCount}`),this.setActiveCssClassToSlide(0)}setActiveCssClassToSlide(t){const e=this.el.querySelectorAll("vviinn-slide");e.forEach((t=>t.classList.remove("active"))),e[t].classList.add("active")}goToSlide(t){this.internalPosition=t,this.el.style.setProperty("--position",`${t}`),this.setActiveCssClassToSlide(t)}renderBullets(){return this.showBullets?e("div",{class:"controls"},E.range(0,this.elementsCount-1).map((t=>e("div",{class:{bullet:!0,active:t==this.internalPosition%this.elementsCount},onClick:()=>this.goToSlide(t)})))):null}nextSlide(){this.internalPosition++,this.renderSlidePosition()}prevSlide(){const t=this.internalPosition-1;this.internalPosition=t>-1?t:this.elementsCount-1,this.renderSlidePosition()}renderSlidePosition(){requestAnimationFrame((()=>{this.el.style.setProperty("--position",""+this.internalPosition%this.elementsCount)}))}handleKeyDown(t){if("Space"===t.key||"Enter"===t.key)switch(t.target.className.includes("prev")?"prev":"next"){case"prev":this.prevSlide();break;case"next":this.nextSlide()}}handleTouchStart(t){this.showBullets&&(this.swipeStartPosition=h.pipe(t.touches[0],a.fromNullable,a.map((t=>t.clientX))))}handleTouchEnd(t){if(!this.showBullets)return;const e=h.pipe(t.changedTouches[0],a.fromNullable,a.map((t=>t.clientX)));h.pipe(l(this.swipeStartPosition,e),a.map((([t,e])=>{return(i=t)<(n=e)?-1:i>n?1:0;var i,n})),a.map((t=>{switch(t){case 1:return this.nextSlide();case-1:return this.prevSlide()}})))}render(){return e(i,null,e("div",{class:"items-wrapper"},e("div",{class:"items",onTouchStart:t=>this.handleTouchStart(t),onTouchEnd:t=>this.handleTouchEnd(t)},e("slot",null))),this.showArrows?[e(zt,{kind:"prev",onClick:()=>this.prevSlide(),onKeyDown:t=>this.handleKeyDown(t),tabindex:1,disabled:!1}),e(zt,{kind:"next",onClick:()=>this.nextSlide(),onKeyDown:t=>this.handleKeyDown(t),tabindex:0,disabled:!1})]:null,this.renderBullets())}get el(){return r(this)}static get watchers(){return{position:["positionWatchHandler"]}}};_t.style=":host{--color-primary-system:#0F62FE;--color-primary-hover-system:#014CDA;--color-icons-system:#2F8EDF;--spacer:8px}:host{--num-items:0;--position:0;display:grid;grid-gap:20px;justify-items:center;position:relative}.items-wrapper{overflow:hidden;width:100%}.items{box-sizing:border-box;display:grid;grid-auto-flow:column;grid-template-columns:repeat(var(--num-items), 100%);transform:translateX(calc(-100% * var(--position)));transition:transform 0.33s ease-in-out}.controls{display:grid;grid-gap:16px;grid-template-columns:repeat(var(--num-items), -webkit-min-content);grid-template-columns:repeat(var(--num-items), min-content)}.bullet{background:#E0E0E0;border-radius:50%;box-sizing:border-box;cursor:pointer;height:8px;width:8px;transition:background 0.1s ease-in-out}.bullet:hover{background:#C6C6C6}.bullet.active{background:var(--color-primary, var(--color-primary-system))}.bullet:active{background:transparent;border:2px solid var(--color-primary, var(--color-primary-system))}.arrow-wrapper{align-items:center;background:white;border:2px solid white;bottom:0;box-sizing:border-box;display:grid;height:calc(var(--spacer) * 6);justify-items:center;margin:auto;position:absolute;top:0;transform:translate3d(0, -50%, 0);transition:border 0.25ms ease-in-out;width:calc(var(--spacer) * 4)}.arrow-wrapper:active{border-color:var(--color-primary, var(--color-primary-system));opacity:0.75}.arrow-wrapper:focus{border-color:var(--color-primary, var(--color-primary-system));opacity:0.5;outline:none}.prev{left:0}.next{right:0}.next>svg{transform:rotate3d(0, 1, 0, 180deg)}.arrow-wrapper>svg{transition:fill 0.25ms ease-in-out;fill:#A8A8A8}.arrow-wrapper:hover>svg{fill:#8D8D8D}";let Ct=class{constructor(e){t(this,e)}componentWillLoad(){Y(this,this.el)}render(){return e(i,null,e("slot",null,e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"64",height:"64",fill:"none"},e("defs",null),e("path",{fill:"#C6C6C6",d:"M48 28a11.98 11.98 0 00-9.77 18.942L28 57.172 30.828 60l10.23-10.23A11.994 11.994 0 1048 28zm0 20a8 8 0 118-8 8.009 8.009 0 01-8 8zM34 24a6 6 0 10-6-6 6.006 6.006 0 006 6zm0-8a2 2 0 110 4 2 2 0 010-4z"}),e("path",{fill:"#C6C6C6",d:"M24 48H8V35.993L18 26l11.172 11.172L32 34.336 20.828 23.165a4 4 0 00-5.656 0L8 30.336V8h40v12h4V8a4.004 4.004 0 00-4-4H8a4.004 4.004 0 00-4 4v40a4.005 4.005 0 004 4h16v-4z"})),e("span",{class:"vviinn-teaser-text"},e("slot",{name:"vviinn-teaser-text"},"Finde Produkte auf ",e("br",null)," einem Foto"))))}get el(){return r(this)}};Ct.style=":host{align-items:center;display:grid;justify-items:center;grid-gap:16px}.vviinn-teaser-text{font-size:28px;font-weight:600;line-height:40px;size:28px;text-align:center}";const Ft=t=>/^[-+]?(\d+|Infinity)$/.test(t)?Number(t):NaN,St=t=>!P(t),Lt=t=>!isNaN(t);let jt=class{constructor(e){t(this,e),this.apiPath="https://api.vviinn.com",this.active=!1,this.currencySign="€",this.locale="de-DE",this.slidePosition=0,this.width=0,this.wrongImageFormat=!1,this.imageSource=null}activeWatcher(t){t?(this.overflow=document.body.style.overflow,document.body.style.overflow="hidden",this.trackOpenEvent()):document.body.style.overflow=this.overflow}trackRecommendationView({detail:t}){const e=D(Object.assign({session_id:this.uiSessionId},t));this.trackingApi.trackEvent(e)}trackRecommendationClick({detail:t}){const e=A(Object.assign({sessionId:this.uiSessionId},t));this.trackingApi.trackEvent(e).finally((()=>{const e=d.results.find((e=>e.productId===t.product));e&&e.deeplink&&(window.location.href=e.deeplink)}))}trachSearchAreaChanges(){const t=I({session_id:this.uiSessionId,source:this.imageSource,search_area:"manual-selection"});this.trackingApi.trackEvent(t)}trackDetectedObject(){const t=I({session_id:this.uiSessionId,source:this.imageSource,search_area:"attention-point"});this.trackingApi.trackEvent(t)}trackFilter({detail:t}){const e=M({session_id:this.uiSessionId,source:this.imageSource,kind:"category",action:t});this.trackingApi.trackEvent(e)}componentWillLoad(){Y(this,this.el)}connectedCallback(){j.apiPath=this.apiPath,j.currencySign=this.currencySign,j.locale=this.locale,d.token=this.token,d.campaignId=h.pipe(this.campaignId,a.fromNullable,a.chain(a.fromPredicate(St)),a.map(Ft),a.chain(a.fromPredicate(Lt)),a.map((t=>`${t}`))),this.uiSessionId=W(),this.trackingApi=V(this.apiPath,this.token)}trackOpenEvent(){const t=$({action:"open",session_id:this.uiSessionId});this.trackingApi.trackEvent(t)}handleImageSelection(t){this.imageSource=t,this.slidePosition=1,this.el.shadowRoot.querySelector("vviinn-overlayed-modal").shadowRoot.querySelector("vviinn-overlay").querySelector("vviinn-modal").shadowRoot.querySelector(".body").scrollTop=0,this.trackInitialSearch()}trackInitialSearch(){const t=I({session_id:this.uiSessionId,source:this.imageSource,search_area:"full"});this.trackingApi.trackEvent(t)}resetState(){this.resetScroll("onboarding-block"),this.slidePosition=0,d.image=a.none,d.imageUrl=a.none,d.imageBounds=a.none,d.searchArea=a.none,d.results=[],d.filters=[],d.detectedObjects=[],d.activeIonLink=void 0,d.rectangleSearchForm=void 0,this.resetScroll("results-block")}haveErrors(){return this.wrongImageFormat||d.serverError}resetScroll(t,e="auto"){this.el.shadowRoot.getElementById(t).scroll({top:0,left:0,behavior:e})}handleModalClose(){this.active=!1,this.resetState(),["onboarding-block","results-block"].forEach((t=>this.resetScroll(t)));const t=$({action:"close",session_id:this.uiSessionId});this.trackingApi.trackEvent(t)}render(){return e(i,null,e("vviinn-overlayed-modal",{class:{"first-screen":0===this.slidePosition},active:this.active,onSecondaryActionClicked:()=>this.resetState(),onModalClosed:()=>this.handleModalClose(),exportparts:"secondary-action, title, close-button, example-images"},e("vviinn-slider",{showBullets:!1,position:this.slidePosition},e("vviinn-slide",{class:{"start-page":!0}},e("div",{class:{error:this.haveErrors(),"start-page_block":!0}},e("vviinn-wrong-format",{class:{hidden:!this.wrongImageFormat},onActionClick:()=>this.wrongImageFormat=!1}),e("vviinn-server-error",{class:{hidden:!d.serverError},onActionClick:()=>d.serverError=!1}),e("vviinn-teaser",{class:{hidden:this.haveErrors()}}),e("vviinn-image-selector",{class:{hidden:this.haveErrors()},onImageSelected:()=>this.handleImageSelection("upload"),onImageSelectedError:()=>this.wrongImageFormat=!0,part:"select-image_button"},e("span",{slot:"upload-button-text",class:"upload-button-content"},e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"29",height:"28",fill:"none"},e("defs",null),e("path",{fill:"#fff","fill-rule":"evenodd",d:"M10.271 3.89A.875.875 0 0111 3.5h7c.293 0 .566.146.728.39l1.49 2.235h3.033a2.625 2.625 0 012.625 2.625V21a2.625 2.625 0 01-2.625 2.625H5.75A2.625 2.625 0 013.125 21V8.75A2.625 2.625 0 015.75 6.125h3.031l1.49-2.235zm1.197 1.36l-1.49 2.235a.875.875 0 01-.729.39H5.75a.875.875 0 00-.875.875V21a.875.875 0 00.875.875h17.5a.875.875 0 00.875-.875V8.75a.875.875 0 00-.875-.875h-3.5a.875.875 0 01-.729-.39l-1.49-2.235h-6.063z","clip-rule":"evenodd"}),e("path",{fill:"#fff","fill-rule":"evenodd",d:"M14.5 11.375a3.062 3.062 0 100 6.125 3.062 3.062 0 000-6.125zm-4.813 3.063a4.812 4.812 0 119.625 0 4.812 4.812 0 01-9.625 0z","clip-rule":"evenodd"})),e("slot",{name:"vviinn-image-upload-button-text"},e("span",null,"Kamera oder Bild auswählen")))),e("vviinn-privacy-badge",{class:{hidden:this.haveErrors()}})),e("div",{id:"onboarding-block",class:"start-page_block"},e("div",{class:"onboarding-wrapper"},e("vviinn-onboarding",null),e("vviinn-example-images",{part:"example-images",onImageSelected:()=>this.handleImageSelection("example"),onImageSelectedError:()=>this.resetScroll("onboarding-block","smooth")})))),e("vviinn-slide",{class:{"results-page":!0,active:1==this.slidePosition}},e("div",{class:"image-wrapper"},e("vviinn-image-view",null),e("div",{class:"filters-wrapper"},e("div",{class:"filters"},d.filters.map((t=>e("search-filters",{filter:t})))))),e("div",{id:"results-block",class:"products-wrapper"},e("div",{class:{"nothing-found":!0,hidden:d.results.length>0}},e("vviinn-empty-results",null),e("vviinn-onboarding",null)),e("div",{class:{hidden:d.results.length<=0,products:!0}},d.results.map(((t,i)=>{var n;return e("vviinn-product-card",{hidden:!0,productTitle:t.title,productId:t.productId,brand:t.brand,deeplink:t.deeplink,price:t.price.actual,salePrice:t.price.sale,imageWidth:160,image:null!==(n=t.image.thumbnail)&&void 0!==n?n:t.image.original,part:"product-card",index:i})}))))))))}get el(){return r(this)}static get watchers(){return{active:["activeWatcher"]}}};jt.style=":host{--color-primary-system:#0F62FE;--color-primary-hover-system:#014CDA;--color-icons-system:#2F8EDF;--spacer:8px}:host{display:block}.hidden{visibility:hidden;height:1px}vviinn-overlayed-modal.first-screen::part(title),vviinn-overlayed-modal.first-screen::part(secondary-action){visibility:hidden}.start-page{display:grid;grid-template-columns:repeat(2, 1fr);min-height:580px}.start-page_block{align-content:start;border-right:1px solid #F4F4F4;display:grid;padding:48px}.start-page_block.error{align-content:center}#onboarding-block{border-right:unset;box-sizing:border-box;grid-gap:24px;overflow-y:auto;position:relative;width:100%}vviinn-teaser{margin-bottom:32px;margin-top:-24px}vviinn-image-selector{align-items:center;background:var(--color-primary, var(--color-primary-system));border-color:var(--color-primary, var(--color-primary-system));border-radius:2px;color:white;display:grid;font-size:16px;font-weight:600;height:56px;justify-items:center;margin-bottom:16px;transition:background 0.1s ease-in-out}vviinn-image-selector:hover{background:var(--color-primary-hover, var(--color-primary-hover-system));border-color:var(--color-primary-hover, var(--color-primary-hover-system))}vviinn-image-selector:active{border-color:black}.upload-button-content{display:grid;align-items:center;justify-items:start;justify-content:center;grid-template-columns:-webkit-max-content auto;grid-template-columns:max-content auto;grid-gap:16px}.results-page{display:grid;grid-template-columns:336px auto;box-sizing:border-box}.results-page>*{padding:24px;box-sizing:border-box}.products{align-content:center;align-items:start;box-sizing:border-box;display:grid;grid-gap:32px 16px;grid-template-columns:repeat(auto-fill, minmax(152px, 1fr));justify-items:center;padding:24px;padding-right:0;position:absolute;width:calc(100% - 16px)}.products.hidden{display:none}vviinn-empty-results{width:280px;align-self:center;justify-self:center}.products-wrapper{display:grid;overflow-y:auto;overflow-x:hidden;padding:unset;position:relative;width:100%}.image-wrapper{border-right:1px solid #F4F4F4;display:grid;grid-template-rows:-webkit-min-content 170px;grid-template-rows:min-content 170px;grid-gap:24px;min-width:100%}.onboarding-wrapper{position:absolute;width:100%;padding:48px;box-sizing:border-box;display:grid;grid-gap:64px;padding-bottom:24px}vviinn-product-card{gap:0;width:100%}vviinn-product-card::part(image){border:1px solid #eaeaea;margin-bottom:8px}vviinn-product-card::part(price-container),vviinn-product-card::part(deeplink),vviinn-product-card::part(title){align-self:start}search-filters span{display:none}search-filters::part(filter){background:#F4F4F4;border-radius:4px;border:1px solid #F4F4F4;box-sizing:border-box;color:#161616;font-size:14px;font-weight:600;line-height:20px}search-filters::part(show-more-filters){border:1px solid #f4f4f4;border-radius:4px;box-sizing:border-box;color:#161616;font-size:14px;font-weight:600;line-height:20px;padding:6px 16px}search-filters::part(show-more-filters):hover{background:#EAEAEA}search-filters::part(filter):hover{background:#EAEAEA}search-filters::part(filter):focus{outline:none;border:1px solid var(--color-primary, var(--color-primary-system))}search-filters::part(filter active){background:rgba(15, 98, 254, 0.15);color:var(--color-primary, var(--color-primary-system))}.filters-wrapper{overflow:auto}.results-page:not(.active){display:none}.nothing-found{display:grid;grid-gap:64px;justify-self:center;padding-top:64px;padding-bottom:16px;position:absolute;width:60%}@media (max-width: 768px){.start-page_block{padding:24px}.onboarding-wrapper{padding:24px}}@media (max-width: 640px){.start-page{grid-template-rows:-webkit-min-content;grid-template-rows:min-content;grid-template-columns:unset;grid-gap:48px;padding:24px 0 48px 0}}@media (max-width: 640px) and (min-width: 415px){.onboarding-wrapper{position:unset}#onboarding-block{overflow:unset}.start-page.active{height:1px;overflow:auto}}@media (max-width: 415px){.results-page>*{box-sizing:border-box;padding:24px}vviinn-slide{padding-bottom:48px}.start-page_block:last-of-type{border-right:unset;overflow-y:unset;position:static;box-sizing:border-box;width:unset}.start-page_block{padding:0 24px}vviinn-teaser{margin-top:24px}.onboarding-wrapper{position:static;width:unset;padding:unset;box-sizing:border-box}.results-page{grid-template-columns:unset;grid-template-rows:-webkit-min-content auto;grid-template-rows:min-content auto}.image{margin-bottom:8px}.image-wrapper{grid-template-rows:-webkit-min-content auto;grid-template-rows:min-content auto;width:100%}.products-wrapper{align-content:start;position:static;overflow-y:unset;width:100%;padding-top:0}.products{position:static;padding:0;width:unset;grid-gap:32px 16px;justify-content:center}.nothing-found{position:static;grid-gap:64px;padding:unset;align-content:start;width:unset}}@media (max-width: 320px){.products{grid-template-columns:unset}}vviinn-wrong-format,vviinn-server-error{width:280px;align-self:center;justify-self:center}";let Et=class{constructor(e){t(this,e),this.actionClick=n(this,"actionClick",7)}render(){return e(i,null,e("vviinn-error",null,e("h4",{slot:"title"},"Dateityp wird nicht unterstützt"),e("span",{slot:"text"},"Leider unterstützen wir dieses Format nicht. Bitte laden Sie eine .jpg, .png oder .webp Bilddatei hoch."),e("button",{slot:"action",onClick:()=>this.actionClick.emit()},"Neues Bild hochladen")))}};Et.style=":host{display:block}";export{Z as cropper_handler,R as highlight_box,K as image_cropper,q as search_filters,X as vviinn_detected_object,U as vviinn_empty_results,Q as vviinn_error,J as vviinn_example_image,tt as vviinn_example_images,et as vviinn_image_selector,it as vviinn_image_view,nt as vviinn_modal,rt as vviinn_onboarding,st as vviinn_onboarding_card_1,ot as vviinn_onboarding_card_2,at as vviinn_onboarding_card_3,lt as vviinn_overlay,dt as vviinn_overlayed_modal,ct as vviinn_preloader,ht as vviinn_privacy_badge,wt as vviinn_product_card,yt as vviinn_server_error,kt as vviinn_slide,_t as vviinn_slider,Ct as vviinn_teaser,jt as vviinn_vps_widget,Et as vviinn_wrong_format}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,b as i}from"./p-4e55513e.js";import{g as a}from"./p-66015ad7.js";(()=>{const i=import.meta.url,a={};return""!==i&&(a.resourcesUrl=new URL(".",i).href),e(a)})().then((e=>(a(),i([["p-
|
|
1
|
+
import{p as e,b as i}from"./p-4e55513e.js";import{g as a}from"./p-66015ad7.js";(()=>{const i=import.meta.url,a={};return""!==i&&(a.resourcesUrl=new URL(".",i).href),e(a)})().then((e=>(a(),i([["p-5aca8be2",[[1,"vviinn-vps-widget",{token:[1],apiPath:[1,"api-path"],active:[1028],currencySign:[1,"currency-sign"],locale:[1],campaignId:[1,"campaign-id"],slidePosition:[32],width:[32],wrongImageFormat:[32]},[[0,"recommendationView","trackRecommendationView"],[0,"recommendationClick","trackRecommendationClick"],[0,"cropperChanged","trachSearchAreaChanges"],[0,"detectedObjectClicked","trackDetectedObject"],[0,"filterSelected","trackFilter"]]],[1,"vviinn-image-view"],[1,"vviinn-onboarding"],[1,"vviinn-example-images",null,[[0,"exampleImageSelected","handleImageSelection"],[0,"exampleImageError","handleImageSelectionError"]]],[1,"vviinn-overlayed-modal",{active:[4]}],[1,"vviinn-empty-results"],[1,"vviinn-image-selector"],[1,"vviinn-server-error"],[1,"vviinn-wrong-format"],[1,"search-filters",{filter:[16],selectedCategoryId:[32],hideFilters:[32]}],[1,"vviinn-privacy-badge"],[1,"vviinn-teaser"],[1,"image-cropper",{disabled:[4],handleMove:[32]}],[1,"vviinn-example-image",{src:[1],width:[2],height:[2],selected:[32]}],[1,"highlight-box"],[1,"vviinn-detected-object",{detectedObject:[16],position:[32]}],[1,"vviinn-modal",{active:[1540],slider:[32]}],[1,"vviinn-onboarding-card-1"],[1,"vviinn-onboarding-card-2"],[1,"vviinn-onboarding-card-3"],[1,"vviinn-overlay"],[1,"vviinn-slide"],[1,"vviinn-slider",{showBullets:[4,"show-bullets"],position:[514],showArrows:[4,"show-arrows"],elementsCount:[32],internalPosition:[32],swipeStartPosition:[32]}],[1,"cropper-handler",{handler:[16],disabled:[4]}],[1,"vviinn-error"],[1,"vviinn-preloader"],[1,"vviinn-product-card",{brand:[1],currency:[1],deeplink:[1],image:[1],imageRatio:[2,"image-ratio"],imageWidth:[2,"image-width"],locale:[1],price:[2],pricePrefix:[1,"price-prefix"],productId:[1,"product-id"],productTitle:[1,"product-title"],productType:[1,"product-type"],salePrice:[2,"sale-price"],responsive:[4],dimmedBackground:[4,"dimmed-background"],index:[2],imageLoaded:[32]}]]],["p-e32c30d4",[[1,"vviinn-vps-button",{token:[1],currencySign:[1,"currency-sign"],locale:[1],campaignId:[1,"campaign-id"],apiPath:[1,"api-path"],pressed:[32]},[[0,"modalClosed","handleModalClosed"]]]]],["p-c1cd51ef",[[1,"vviinn-vpr-widget",{blockTitle:[1,"block-title"],imageRatio:[2,"image-ratio"],imageWidth:[2,"image-width"],productId:[1,"product-id"],token:[1],currencySign:[1,"currency-sign"],pricePrefix:[1,"price-prefix"],mode:[1],campaignType:[1,"campaign-type"],locale:[1],campaigns:[1],apiPath:[1,"api-path"],useCarousel:[4,"use-carousel"],showScroll:[4,"show-scroll"],cssUrl:[1,"css-url"],recommendations:[32],loaded:[32]},[[0,"productImageLoaded","handleImageLoading"],[0,"recommendationView","trackRecommendationView"],[0,"recommendationClick","trackRecommendationClick"]]],[0,"vviinn-carousel",{mode:[1],imageWidth:[2,"image-width"],showScroll:[4,"show-scroll"],recommendations:[16],moveDirection:[32],contentGroups:[32],activeContentGroup:[32]}]]],["p-5358970c",[[1,"vviinn-recommendations-sidebar",{sidebarTitle:[1,"sidebar-title"],token:[1],productId:[1,"product-id"],position:[1],sourceImage:[1,"source-image"],widgetScrollbar:[4,"widget-scrollbar"],campaigns:[1],state:[32]},[[16,"click","bodyClickListener"]]]]],["p-8080679b",[[1,"vviinn-vpr-button",{token:[1],productId:[1,"product-id"],position:[1],sourceImage:[1,"source-image"],sidebarTitle:[1,"sidebar-title"],modalScrollbar:[4,"modal-scrollbar"],campaigns:[1]}]]]],e))));
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as t,h as e,H as i,c as n,g as r}from"./p-4e55513e.js";import{g as s,p as o,O as a,s as l,i as d,a as c,_ as h,t as p,m,f as g,b as u,c as v,d as b,e as x,h as f,j as w,k as y,l as k,E as z,n as _,o as C,q as F,r as S,S as L,u as j,N as E,v as D,w as A,x as I,y as M,z as W,A as V,B as $,C as P}from"./p-9de1b0e7.js";import{C as B,O as G,a as O,b as T,A as H}from"./p-f6e59cb2.js";import{s as Y}from"./p-b254eee7.js";let Z=class{constructor(e){t(this,e),this.disabled=!1}render(){return e(i,{part:`handle ${s(this.handler.direction)}`,class:{disabled:this.disabled,[s(this.handler.direction)]:!0},style:{"--size":"20px",cursor:s(this.handler.direction)},draggable:!1})}};Z.style=":host{--size:20px;background:transparent;border:4px solid white;box-sizing:content-box;display:block;height:var(--size);touch-action:none;position:absolute;width:var(--size);z-index:4;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}:host(.disabled){opacity:0.25}:host(.nw-resize){border-bottom:none;border-right:none;top:0;left:0}:host(.ne-resize){border-left:none;border-bottom:none;right:0;top:0}:host(.sw-resize){border-right:none;border-top:none;left:0;bottom:0}:host(.se-resize){border-left:none;border-top:none;bottom:0;right:0}";let R=class{constructor(e){t(this,e)}getInsetValue(){return o(l(d.searchArea,d.imageBounds),a.map((([t,e])=>{return`inset(${(i=t,n=e,r={top:`${i.y}px`,right:n.width-(i.x+i.width)+"px",bottom:n.height-(i.y+i.height)+"px",left:`${i.x}px`}).top} ${r.right} ${r.bottom} ${r.left})`;var i,n,r})),a.getOrElse((()=>"")))}renderImage(){return o(l(d.imageUrl,d.imageBounds),a.map((([t,i])=>e("img",{src:t,width:i.width,height:i.height,style:{"clip-path":`${this.getInsetValue()}`}}))),a.getOrElse((()=>"")))}render(){return e(i,null,this.renderImage())}};R.style=':host{display:grid;position:absolute;box-sizing:border-box;border:none;width:100%;height:100%;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;--size:10px;--x-position:0;--y-position:0}img{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.pointer{position:absolute;width:var(--size);height:var(--size);background:black;border-radius:50%;z-index:2;cursor:pointer;transform:translate(var(--x-position), var(--y-position)) scale(0);-webkit-animation:0.25s linear fadein;animation:0.25s linear fadein;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}.pointer::after{content:"";cursor:pointer;border:5px solid black;border-radius:50%;width:var(--size);height:var(--size);display:block;transform:translate(calc(-50% + var(--size) * 0.5), calc(-50% + var(--size) * 0.5));padding:calc(var(--size) * 0.5);opacity:.75}@-webkit-keyframes fadein{from{transform:translate(var(--x-position), var(--y-position)) scale(0)}to{transform:translate(var(--x-position), var(--y-position)) scale(1)}}@keyframes fadein{from{transform:translate(var(--x-position), var(--y-position)) scale(0)}to{transform:translate(var(--x-position), var(--y-position)) scale(1)}}';let K=class{constructor(e){t(this,e),this.cropperChanged=n(this,"cropperChanged",7),this.disabled=!1,this.handleMove=!1,this.mouseStartPoint=void 0,this.bounds=void 0}componentDidLoad(){this.bounds=this.el.getBoundingClientRect()}handleHandlerMove(t){t.preventDefault(),t.stopPropagation();const e=g(t),i={position:c.concat(e,this.mouseStartPoint),direction:this.handlerMoveDirection};h.pipe(d.searchArea,a.map((t=>{const n=p(t,i);this.outOfBounds(n)||(d.searchArea=a.some(n),this.mouseStartPoint=e,d.detectedObject=void 0)})))}outOfBounds(t){return t.width<40||t.height<40||t.x<0||t.y<0||this.bounds.height-(t.y+t.height)<0||this.bounds.width-(t.x+t.width)<0}handleCropperMove(t){t.preventDefault(),t.stopPropagation();const e=g(t),i=c.concat(e,this.mouseStartPoint);h.pipe(d.searchArea,a.map((t=>{const n=m(t,i);n.x<0||n.y<0||this.bounds.height-(n.y+n.height)<0||this.bounds.width-(n.x+n.width)<0||(d.detectedObject=void 0,d.searchArea=a.some(n),this.mouseStartPoint=e)})))}handlePointerDown(t){t.stopPropagation(),this.mouseStartPoint=g(t);const e=t.target;"cropper-handler"===e.localName?(this.handlerMoveDirection=e.handler.direction,this.pointerMoveListener=this.handleHandlerMove.bind(this)):this.pointerMoveListener=this.handleCropperMove.bind(this),this.pointerReleaseListener=this.handleSearchAreaRelease.bind(this),this.el.addEventListener("pointermove",this.pointerMoveListener),window.addEventListener("pointerup",this.pointerReleaseListener,{once:!0})}handleSearchAreaRelease(){this.el.removeEventListener("pointermove",this.pointerMoveListener),document.removeEventListener("pointerup",this.pointerReleaseListener),this.mouseStartPoint=void 0,u(),this.cropperChanged.emit()}getStyleMap(){return h.pipe(d.searchArea,a.map((t=>({width:`${t.width}px`,height:`${t.height}px`,transform:`translate3d(${t.x}px, ${t.y}px, 0)`,cursor:this.handleMove?"move":"default"}))),a.getOrElse((()=>({}))))}render(){return e(i,{exportparts:"handle, e-resize, n-resize, ne-resize, nw-resize, s-resize, se-resize, sw-resize, w-resize"},e("div",{class:{"crop-area":!0,active:this.handleMove,disabled:this.disabled},draggable:!1,style:this.getStyleMap(),onContextMenu:()=>!1,onPointerDown:t=>this.handlePointerDown(t)},d.cropperHandlers.map((t=>e("cropper-handler",{disabled:this.disabled,handler:t,onPointerDown:t=>this.handlePointerDown(t)})))))}get el(){return r(this)}};K.style=":host{display:block;height:100%;left:0;position:absolute;top:0;width:100%}:host(.hidden){visibility:hidden}.crop-area{border:1px solid white;box-sizing:border-box;position:absolute;touch-action:none;transition-property:border-color, opacity;transition-duration:.25s;transition-timing-function:ease-in-out;z-index:2;position:relative;will-change:transform}.crop-area.active{border-color:whitesmoke}.crop-area.disabled{opacity:0.25}";const N=t=>t.href.split("/").reverse()[0];let q=class{constructor(e){t(this,e),this.filterSelected=n(this,"filterSelected",7),this.filter=null,this.selectedCategoryId=null,this.hideFilters=!0}handleFilterSelection(t){return this.isFilterSelected(t)?this.clearSelectedFilter():this.selectFilter(t)}selectFilter(t){this.selectedCategoryId=N(t),d.activeIonLink=t,this.filterSelected.emit("select")}clearSelectedFilter(){this.selectedCategoryId=null,d.activeIonLink=void 0,this.findSelectedFilter().blur(),this.filterSelected.emit("deselect")}findSelectedFilter(){return this.el.shadowRoot.querySelector(".filter.active")}toggleFilters(){this.hideFilters=!this.hideFilters}handleEnter(t,e){"Enter"===t.key&&this.handleFilterSelection(e)}isFilterSelected(t){return this.selectedCategoryId===N(t)}render(){return e(i,{exportparts:"filter, show-more-filters"},e("div",{class:"filters"},this.filter.filters.filter(((t,e)=>!this.hideFilters||e<5)).map(((t,i)=>e("div",{role:"button",tabindex:"0",part:this.isFilterSelected(t)?"filter active":"filter",class:{filter:!0,active:this.selectedCategoryId===N(t)},style:{"animation-delay":10*i+"ms"},onPointerUp:e=>{e.stopPropagation(),this.handleFilterSelection(t)},onKeyPress:e=>this.handleEnter(e,t)},this.isFilterSelected(t)?e(B,null):null,t.name))),e("div",{class:{filter:!0,"show-more":!0,hidden:this.filter.filters.length<=5,active:!this.hideFilters},role:"button",tabindex:"0","aria-role":"button",onClick:()=>this.toggleFilters(),onKeyPress:t=>{"Enter"===t.key&&this.toggleFilters()},part:"show-more-filters"},this.hideFilters?"Zeige mehr":"Zeige weniger")))}get el(){return r(this)}};q.style=":host{display:grid;grid-gap:1rem}.filters{display:flex;flex-direction:row;flex-wrap:wrap;gap:0.5rem}.filter{align-items:center;-webkit-animation-duration:0.25s;animation-duration:0.25s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;-webkit-animation-name:scalein;animation-name:scalein;border:1px solid lightgray;cursor:pointer;display:flex;flex-direction:row;grid-gap:8px;height:-webkit-max-content;height:-moz-max-content;height:max-content;min-width:-webkit-max-content;min-width:-moz-max-content;min-width:max-content;padding:0.1rem;transform:scale(0);transition-property:background;transition-duration:0.25s;transition-timing-function:ease-in-out;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;padding:6px 16px}.filter.active{border:1px solid black;padding:6px 8px}.filter:hover{border:1px solid gray}.show-more{display:flex}.show-more.hidden{display:none}.show-more::after{content:url(\"data:image/svg+xml,%3Csvg width='16' height='16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M8 12.2l-6-6L3.2 5 8 9.8 12.8 5 14 6.2l-6 6z' fill='%23525252'/%3E%3C/svg%3E\");display:block;height:16px;margin-top:1px;margin-left:8px}.show-more.active::after{transform:rotateX(180deg)}@-webkit-keyframes scalein{from{opacity:0;transform:scale(0.5)}to{opacity:1;transform:scale(1)}}@keyframes scalein{from{opacity:0;transform:scale(0.5)}to{opacity:1;transform:scale(1)}}@media (max-width: 415px){.show-more::after{transform:rotate(-90deg)}.show-more.active::after{transform:rotate(90deg)}}@media (max-width: 800px){.filters{flex-wrap:nowrap;overflow-x:scroll;-ms-scroll-snap-type:x mandatory;scroll-snap-type:x mandatory;grid-gap:unset}.filter{scroll-snap-align:end;margin-right:0.5rem}}";let X=class{constructor(e){t(this,e),this.detectedObjectClicked=n(this,"detectedObjectClicked",7),this.position=["0","0"]}getObjectPosition(){return h.pipe(d.imageBounds,a.map((t=>{const e=v(b(this.detectedObject).rectangle),{x:i,y:n}=h.pipe(e,x(t),f);return[`${i}px`,`${n}px`]})),a.getOrElse((()=>["0","0"])))}selectDetectedObject(){h.pipe(d.imageBounds,a.map((t=>{const e=b(this.detectedObject).rectangle,i=v(e),n=x(t)(i);d.detectedObject=this.detectedObject,d.searchArea=a.some(n)}))),u(),this.detectedObjectClicked.emit()}isActive(){if(!this.detectedObject)return!1;if(!d.detectedObject)return!1;const t=b(this.detectedObject),e=b(d.detectedObject);return w.equals(t,e)}render(){return e(i,{class:{active:this.isActive()},onClick:()=>this.selectDetectedObject(),style:{"--x-position":this.getObjectPosition()[0],"--y-position":this.getObjectPosition()[1]}})}};X.style=':host{--color-primary-system:#0F62FE;--color-primary-hover-system:#014CDA;--color-icons-system:#2F8EDF;--spacer:8px}:host{--size:32px;--x-position:0;--y-position:0;background:rgba(22, 22, 22, 0.5);border-radius:50%;border:none;cursor:pointer;display:block;height:var(--size);position:absolute;transition:opacity 0.25s;width:var(--size);z-index:2;transform:translate(calc(var(--x-position) - (var(--size) * 0.5)), calc(var(--y-position) - (var(--size) * 0.5)));transition:background 0.1 ease-in-out}:host(:hover){background:rgba(22, 22, 22, 0.75)}:host(.active){background:var(--color-primary, var(--color-primary-system))!important;border:2px solid white}:host::after{--size:32px;border-radius:50%;content:"";cursor:pointer;display:block;height:calc(var(--size) * 0.25);transform:translate(calc(-50% + var(--size) * 0.5), calc(-50% + var(--size) * 0.5));width:calc(var(--size) * 0.25);background:white}';let U=class{constructor(e){t(this,e),this.actionClick=n(this,"actionClick",7)}render(){return e(i,null,e("vviinn-error",null,e("svg",{slot:"icon",class:"icon",width:"32",height:"32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("path",{d:"M16 2a14 14 0 1 0 0 28 14 14 0 0 0 0-28Zm0 26a12 12 0 1 1 0-24 12 12 0 0 1 0 24Z",fill:"#525252"}),e("path",{d:"M17 8h-2v11h2V8Zm-1 14a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3Z",fill:"#525252"})),e("h4",{slot:"title"},"Leider nichts gefunden"),e("span",{slot:"text"},"Leider konnten wir keine passenden Produkte finden. Bitte versuche es mit einem anderen Bildausschnitt noch einmal.")))}};U.style=":host{display:grid}vviinn-error{justify-items:center}";let Q=class{constructor(e){t(this,e)}render(){return e(i,null,e("slot",{name:"icon"}),e("slot",{name:"title"}),e("slot",{name:"text"}),e("slot",{name:"action"}))}};Q.style=":host{background:#F4F4F4;border-radius:8px;display:grid;grid-gap:20px;padding:24px;text-align:center}::slotted(svg){display:grid;align-self:center}::slotted(h4){margin:unset;font-weight:600;font-size:18px;line-height:24px}::slotted(span){font-size:14px;line-height:20px}::slotted(button){-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;background:transparent;color:var(--color-primary, var(--color-primary-system));font-weight:600;font-size:16px;line-height:20px;cursor:pointer}";let J=class{constructor(e){t(this,e),this.exampleImageSelected=n(this,"exampleImageSelected",7),this.exampleImageError=n(this,"exampleImageError",7),this.src="",this.width=0,this.height=0,this.selected=!1}async selectImage(t){this.selected=!0;const e=await y(this.src),i=await k(e);h.pipe(i,z.match((()=>this.exampleImageError.emit()),(()=>this.exampleImageSelected.emit()))),this.selected=!1}showPreloader(){return(d.objectDetectionInProgress||d.loading)&&this.selected}render(){return e(i,null,this.showPreloader()?e("div",{class:"image-preloader"},e("vviinn-preloader",null)):null,e("img",{onClick:t=>this.selectImage(t),src:this.src,width:this.width,height:this.height}))}};J.style=":host{display:block;margin-bottom:8px;position:relative}img{width:100%;height:auto;cursor:pointer}.image-preloader{background:rgba(0, 0, 0, 0.25);border-radius:4px;bottom:12px;display:none;padding:4px 6px;pointer-events:none;position:absolute;right:12px;z-index:4}vviinn-preloader{--preloader-size:12px}@media (max-width: 640px){.image-preloader{display:block}}";let tt=class{constructor(e){t(this,e),this.imageSelected=n(this,"imageSelected",7),this.imageSelectedError=n(this,"imageSelectedError",7)}handleImageSelection(){this.imageSelected.emit()}handleImageSelectionError(){this.imageSelectedError.emit()}componentWillLoad(){Y(this,this.el)}render(){return e(i,null,e("slot",{name:"vviinn-example-images-title"},e("h3",null,"Mit den Beispielbildern die Suche direkt ausprobieren")),e("div",{class:"images"},e("slot",{name:"vviinn-example-images-1"},e("vviinn-example-image",{width:480,height:640,src:"https://cdn.vviinn.com/0/fit/480/0/ce/0/Z3M6Ly9haWFhcy1pbWdwcm94eS9leGFtcGxlcy9pbWctaW5zcGlyYXRpb24tMDEtTC5qcGc="})),e("slot",{name:"vviinn-example-images-2"},e("vviinn-example-image",{width:280,height:480,src:"https://cdn.vviinn.com/0/fit/480/0/ce/0/Z3M6Ly9haWFhcy1pbWdwcm94eS9leGFtcGxlcy9pbWctaW5zcGlyYXRpb24tMDItTS5qcGc="})),e("slot",{name:"vviinn-example-images-3"},e("vviinn-example-image",{width:280,height:480,src:"https://cdn.vviinn.com/0/fit/480/0/ce/0/Z3M6Ly9haWFhcy1pbWdwcm94eS9leGFtcGxlcy9pbWctaW5zcGlyYXRpb24tMDMtTS5qcGc="})),e("slot",{name:"vviinn-example-images-4"},e("vviinn-example-image",{width:480,height:640,src:"https://cdn.vviinn.com/0/fit/480/0/ce/0/Z3M6Ly9haWFhcy1pbWdwcm94eS9leGFtcGxlcy9pbWctaW5zcGlyYXRpb24tMDQtTC5qcGc="}))))}get el(){return r(this)}};tt.style="h3{font-size:22px;font-weight:600;line-height:32px;margin:0;margin-bottom:16px;text-align:center}.images{display:block;-moz-column-count:2;column-count:2;-moz-column-gap:16px;column-gap:16px}";let et=class{constructor(e){t(this,e),this.imageSelected=n(this,"imageSelected",7),this.imageSelectedError=n(this,"imageSelectedError",7)}async handleInputChange(t){const e=t.target,i=await k(e.files[0]);h.pipe(i,_((()=>this.imageSelectedError.emit()),(()=>this.imageSelected.emit()))),e.value=null}isLoading(){return d.loading||d.objectDetectionInProgress}render(){return e(i,{exportparts:"button"},this.isLoading()?e("vviinn-preloader",null):null,this.isLoading()?null:e("label",{htmlFor:"fileInput",part:"button"},e("slot",{name:"upload-button-text"},"Upload image")),e("input",{id:"fileInput",class:"visually-hidden",type:"file",accept:"image/*",onChange:t=>this.handleInputChange(t)}))}};et.style=":host{display:block}:host(::hover){background:whitesmoke}.visually-hidden{clip:rect(0 0 0 0);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}label{cursor:pointer;display:grid;padding:0.5rem;transition:background 0.1s ease-in-out}";let it=class{constructor(e){t(this,e)}handleInitialImageLoad(t){const e=C(t.target),{x:i,y:n}=m(e,{x:12,y:12}),r={x:i,y:n,width:e.width-24,height:e.height-24};d.imageBounds=a.some(e),d.searchArea=a.some(r)}renderDetectedObject(t){return e("vviinn-detected-object",{detectedObject:t})}renderImage(){return h.pipe(l(d.imageUrl,d.image),a.map((([t,i])=>{const[n,r]=(t=>{const e=F(t),i=S(288)(e).map((t=>t.size));return[i[0],i[1]]})(i);return e("img",{decoding:"async",width:n,height:r,src:t,onLoad:t=>this.handleInitialImageLoad(t),draggable:!1})})),a.getOrElse((()=>null)))}renderCropper(){return h.pipe(d.imageUrl,a.map((()=>e("image-cropper",null))),a.getOrElse((()=>null)))}render(){return e(i,null,d.loading||d.objectDetectionInProgress?e("div",{class:"image-preloader"},e("vviinn-preloader",null)):null,e("highlight-box",null),this.renderImage(),this.renderCropper(),d.detectedObjects.map((t=>this.renderDetectedObject(t))))}};it.style=":host{display:grid;position:relative;justify-self:center}img{box-sizing:border-box;filter:brightness(60%);position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:-1}.image-preloader{background:rgba(0, 0, 0, 0.25);border-radius:4px;bottom:18px;padding:4px 6px;pointer-events:none;position:absolute;right:18px;z-index:4}vviinn-preloader{--preloader-size:12px}";let nt=class{constructor(e){t(this,e),this.modalClosed=n(this,"modalClosed",7),this.secondaryActionClicked=n(this,"secondaryActionClicked",7),this.active=!1,this.slider=!1}close(){this.active=!1,setTimeout((()=>{this.modalClosed.emit()}),this.slider?500:0)}handleAnimationEnd(t){"fade-in"===t.animationName&&(this.slider=!0)}render(){return e(i,{exportparts:"secondary-action, title, close-button",class:{closed:!this.active},onAnimationEnd:t=>this.handleAnimationEnd(t)},e("div",{class:"head"},e("button",{part:"secondary-action",onClick:()=>this.secondaryActionClicked.emit()},e("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("path",{d:"M20.25 12H3.75",stroke:"#161616","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}),e("path",{d:"M10.5 5.25L3.75 12L10.5 18.75",stroke:"#161616","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}))),e("div",{class:"title",part:"title"},"Bildsuche"),e("button",{onClick:()=>this.close(),class:"close-button",part:"close-button"},e("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("path",{d:"M16 1.4L14.6 0L8 6.6L1.4 0L0 1.4L6.6 8L0 14.6L1.4 16L8 9.4L14.6 16L16 14.6L9.4 8L16 1.4Z",fill:"#333333"})))),e("div",{class:"body"},e("slot",null)))}};nt.style=":host{background:white;border-radius:4px;box-sizing:border-box;display:grid;grid-template-rows:-webkit-min-content auto;grid-template-rows:min-content auto;max-width:960px}@media (max-width: 415px){:host{-webkit-animation-name:fade-in;animation-name:fade-in;-webkit-animation-duration:0.5s;animation-duration:0.5s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}:host(.closed){-webkit-animation-name:fade-out;animation-name:fade-out;-webkit-animation-fill-mode:none;animation-fill-mode:none}.body{overflow-y:auto}}@media (max-width: 640px) and (min-width: 415px){:host{max-width:80%}}.head{align-items:center;border-bottom:1px solid #F4F4F4;display:grid;grid-gap:16px;grid-template-columns:-webkit-min-content auto -webkit-min-content;grid-template-columns:min-content auto min-content;justify-items:center;padding:16px}.title{font-weight:600;font-size:18px;line-height:24px}button{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:none;cursor:pointer;display:grid;padding:unset}@-webkit-keyframes fade-in{from{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes fade-in{from{transform:translateY(100%)}to{transform:translateY(0)}}@-webkit-keyframes fade-out{from{transform:translateY(0)}to{transform:translateY(100%)}}@keyframes fade-out{from{transform:translateY(0)}to{transform:translateY(100%)}}";let rt=class{constructor(e){t(this,e)}componentWillLoad(){Y(this,this.el)}render(){return e(i,null,e("slot",{name:"vviinn-onboarding-title"},e("h3",null,"So funktioniert es")),e("vviinn-slider",{showArrows:!0},e("vviinn-slide",null,e("vviinn-onboarding-card-1",null)),e("vviinn-slide",null,e("vviinn-onboarding-card-2",null)),e("vviinn-slide",null,e("vviinn-onboarding-card-3",null))))}get el(){return r(this)}};rt.style=":host{--color-primary-system:#0F62FE;--color-primary-hover-system:#014CDA;--color-icons-system:#2F8EDF;--spacer:8px}::host{display:block}h3{font-size:22px;font-weight:600;line-height:32px;margin:0;margin-bottom:16px;text-align:center}vviinn-slide{background:#f4f4f4;padding:24px}svg{padding:16px 0}.text{display:grid;grid-gap:8px}.text>h4{color:#161616;font-size:18px;font-weight:600;line-height:24px;margin:unset;text-align:center}.text>p{color:#525252;font-size:14px;font-style:normal;font-weight:normal;line-height:20px;margin:unset;text-align:center}.colored{fill:var(--color-icons, var(--color-icons-system))}";let st=class{constructor(e){t(this,e)}componentWillLoad(){Y(this,this.el)}render(){return e(i,null,e("slot",{name:"onboarding-card-1-icon"},e(G,null)),e("slot",{name:"onboarding-card-1-text"},e("div",{class:"text"},e("h4",null,"Starte die Bildsuche"),e("p",null,"Lade ein Bild aus Deiner Galerie hoch oder fotografiere ein Produkt mit Deiner Kamera."))))}get el(){return r(this)}};st.style=":host{align-items:center;background:#f4f4f4;display:grid;grid-template-rows:repeat(2, 1fr);justify-items:center;padding:24px;width:100%}h4{color:#161616;font-size:18px;font-weight:600;line-height:24px;margin:unset;text-align:center}svg{padding:16px 0}p{color:#525252;font-size:14px;font-style:normal;font-weight:normal;line-height:20px;margin:unset;text-align:center}.colored{fill:var(--color-icons, var(--color-icons-system))}.text{display:grid;grid-gap:8px}";let ot=class{constructor(e){t(this,e)}componentWillLoad(){Y(this,this.el)}render(){return e(i,null,e("slot",{name:"onboarding-card-2-icon"},e(O,null)),e("slot",{name:"onboarding-card-2-text"},e("div",{class:"text"},e("h4",null,"Verfeiner deine Suche"),e("p",null,"Du kannst den Bildrahmen selber festlegen und so die Produkte genau auswählen."))))}get el(){return r(this)}};ot.style=":host{align-items:center;background:#f4f4f4;display:grid;grid-template-rows:repeat(2, 1fr);justify-items:center;padding:24px;width:100%}h4{color:#161616;font-size:18px;font-weight:600;line-height:24px;margin:unset;text-align:center}svg{padding:16px 0}p{color:#525252;font-size:14px;font-style:normal;font-weight:normal;line-height:20px;margin:unset;text-align:center}.colored{fill:var(--color-icons, var(--color-icons-system))}.text{display:grid;grid-gap:8px}";let at=class{constructor(e){t(this,e)}componentWillLoad(){Y(this,this.el)}render(){return e(i,null,e("slot",{name:"onboarding-card-3-icon"},e(T,null)),e("slot",{name:"onboarding-card-3-text"},e("div",{class:"text"},e("h4",null,"Ohne Hintergrund"),e("p",null,"Die besten Ergebnisse erhältst Du, wenn das gesuchte Objekt mit einfarbigem und hellem Hintergrund zu sehen ist."))))}get el(){return r(this)}};at.style=":host{align-items:center;background:#f4f4f4;display:grid;grid-template-rows:repeat(2, 1fr);justify-items:center;padding:24px;width:100%}h4{color:#161616;font-size:18px;font-weight:600;line-height:24px;margin:unset;text-align:center}svg{padding:16px 0}p{color:#525252;font-size:14px;font-style:normal;font-weight:normal;line-height:20px;margin:unset;text-align:center}.colored{fill:var(--color-icons, var(--color-icons-system))}.text{display:grid;grid-gap:8px}";let lt=class{constructor(e){t(this,e)}render(){return e(i,null,e("slot",null))}};lt.style=":host{-webkit-animation:fade-in 0.5s ease-in-out;animation:fade-in 0.5s ease-in-out;background:rgba(0, 0, 0, 0.5);display:block;height:100vh;left:0;overflow:hidden;position:fixed;top:0;width:100vw;z-index:9999}@-webkit-keyframes fade-in{from{opacity:0.1}to{opacity:1}}@keyframes fade-in{from{opacity:0.1}to{opacity:1}}";let dt=class{constructor(e){t(this,e),this.secondaryActionClicked=n(this,"secondaryActionClicked",7),this.modalClosed=n(this,"modalClosed",7),this.active=!1}render(){return e(i,{class:{active:this.active}},e("vviinn-overlay",null,e("vviinn-modal",{onSecondaryActionClicked:()=>this.secondaryActionClicked.emit(),active:this.active},e("slot",null,"CONTENT"))))}};dt.style=":host{display:none}:host(.active){display:block}vviinn-overlay{align-items:center;display:grid;justify-items:center}@media (max-width: 415px){vviinn-modal{border-radius:4px 4px 0 0;height:100vh;margin-top:32px;transform:translateY(100%);width:100vw}vviinn-overlay{align-items:end;display:grid;justify-items:center}}";let ct=class{constructor(e){t(this,e)}isActive(){return d.loading||d.objectDetectionInProgress}render(){return e(i,{class:{active:this.isActive()}})}};ct.style=":host{--preloader-size:24px;--preloader-width:calc(var(--preloader-size) / 6);transform-origin:center;-webkit-animation:rotate 3s linear infinite;animation:rotate 3s linear infinite;border:var(--preloader-width) solid white;border-radius:50%;border-top-color:transparent;display:none;outline:0;width:var(--preloader-size);height:var(--preloader-size);box-sizing:border-box}:host(.active){display:flex}@-webkit-keyframes rotate{from{transform:rotate(-360deg)}to{transform:rotate(360deg)}}@keyframes rotate{from{transform:rotate(-360deg)}to{transform:rotate(360deg)}}";let ht=class{constructor(e){t(this,e)}componentWillLoad(){Y(this,this.el)}render(){return e(i,null,e("slot",null,e("div",{class:"content"},e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"none"},e("defs",null),e("path",{fill:"#525252",d:"M8.5 11V7h-2v1h1v3H6v1h4v-1H8.5zM8 4a.75.75 0 100 1.5A.75.75 0 008 4z"}),e("path",{fill:"#525252",d:"M8 15A7 7 0 118 1a7 7 0 010 14zM8 2a6 6 0 100 12A6 6 0 008 2z"})),e("slot",{name:"vviinn-privacy-badge-text"},e("p",null,"Wir gehen sorgfältig mit Deinen Daten um. Deine Bilder werden nur zum Zweck der Bildsuche gespeichert.")))))}get el(){return r(this)}};ht.style=":host{display:block;background:#F4F4F4;padding:17px}.content{display:grid;grid-template-columns:-webkit-min-content auto;grid-template-columns:min-content auto;grid-gap:9px}.content p{color:#525252;font-size:12px;line-height:16px;margin:unset}";class pt{sendImpression(t){var e,i,n;gtag("event","view_item_list",{items:[{id:t.productId,name:t.title,brand:null!==(e=t.brand)&&void 0!==e?e:"",category:null!==(i=t.productType)&&void 0!==i?i:"",list_name:"VI VPR View",price:Math.min(t.price.actual,null!==(n=t.price.sale)&&void 0!==n?n:1/0)}]})}sendClick(t){var e,i,n;gtag("event","select_content",{content_type:"product",items:[{id:t.productId,name:t.title,brand:null!==(e=t.brand)&&void 0!==e?e:"",category:null!==(i=t.productType)&&void 0!==i?i:"",list_name:"VI VPR View",price:Math.min(t.price.actual,null!==(n=t.price.sale)&&void 0!==n?n:1/0)}]})}}class mt{constructor(){ga("require","ec")}convertProduct(t){var e,i,n;return{id:t.productId,name:t.title,brand:null!==(e=t.brand)&&void 0!==e?e:"",category:null!==(i=t.productType)&&void 0!==i?i:"",list:"VI VPR View",price:Math.min(t.price.actual,null!==(n=t.price.sale)&&void 0!==n?n:1/0)}}sendImpression(t){ga("ec:addImpression",this.convertProduct(t))}sendClick(t){var e,i,n;ga("ec:addProduct",{id:t.productId,name:t.title,brand:null!==(e=t.brand)&&void 0!==e?e:"",category:null!==(i=t.productType)&&void 0!==i?i:"",price:Math.min(t.price.actual,null!==(n=t.price.sale)&&void 0!==n?n:1/0)}),ga("ec:setAction","click",{list:"VI VPR View"})}}const gt=a.getMonoid(L.first()).concat(h.pipe(a.fromNullable(window.gtag),a.map((()=>new pt))),h.pipe(a.fromNullable(window.ga),a.map((()=>new mt)))),ut=/fit\/\d+\//,vt=(t,e)=>h.pipe((t=>h.pipe(t.match(ut),z.fromNullable(t),z.map((()=>t))))(t),z.map((t=>t.replace(ut,`fit/${e}/`))),z.getOrElse((()=>t))),bt=(t,i)=>t.deeplink?e("a",{class:t.part,part:t.part,href:t.deeplink},i):i,xt=t=>{var i;const n=new Intl.NumberFormat(t.locale,{minimumFractionDigits:2}).format(t.price),r=`${null!==(i=t.prefix)&&void 0!==i?i:""} ${n} ${t.currency}`;return e("span",{class:"price-amount",part:"price-amount"},r)},ft=t=>{const i=e(xt,{prefix:t.prefix,currency:t.currency,price:t.price,locale:t.locale});return e("span",{class:"price-container",part:"price-container"},t.salePrice?[e("span",{class:"price-sale",part:"price-sale"},e(xt,{prefix:t.prefix,currency:t.currency,price:t.salePrice,locale:t.locale})),e("span",{class:"price-outdated",part:"price-outdated"},i)]:e("span",{class:"price-regular",part:"price-regular"},i))};let wt=class{constructor(e){t(this,e),this.recommendationLoad=n(this,"recommendationLoad",7),this.recommendationView=n(this,"recommendationView",7),this.recommendationClick=n(this,"recommendationClick",7),this.productImageLoaded=n(this,"productImageLoaded",7),this.currency=void 0,this.imageRatio=1,this.imageWidth=200,this.locale=void 0,this.pricePrefix=void 0,this.responsive=!1,this.dimmedBackground=!1,this.index=0,this.imageLoaded=!1,this.productData=null,this.intersectionObserver=new IntersectionObserver(this.intersectionCallback.bind(this),{threshold:1})}connectedCallback(){this.productData={product:this.productId,rank:this.index}}intersectionCallback(t){t.some((t=>t.isIntersecting))&&(h.pipe(gt,a.map((t=>t.sendImpression(this.getProduct())))),this.recommendationView.emit(this.productData),this.intersectionObserver.disconnect())}componentDidLoad(){this.recommendationLoad.emit(this.productData),this.intersectionObserver.observe(this.el),this.el.shadowRoot.querySelectorAll("a").forEach((t=>t.addEventListener("click",(t=>{t.preventDefault(),t.stopImmediatePropagation(),this.recommendationClick.emit(this.productData),h.pipe(gt,a.match((()=>null),(t=>t.sendClick(this.getProduct()))))}))))}getProduct(){return d.results.find((t=>t.productId===this.productId))}renderImage(){const t={width:this.imageWidth,height:this.imageWidth*this.imageRatio,src:this.image,title:this.productTitle,lazy:!1};return this.responsive?((t,i=(()=>{}))=>e("picture",null,e("img",{loading:t.lazy?"lazy":"eager",part:"image",class:"image responsive",src:vt(t.src,t.width),alt:t.title,onLoad:i})))(t,(()=>this.kek())):((t,i=(()=>{}))=>e("picture",null,e("img",{loading:t.lazy?"lazy":"eager",part:"image",class:"image",width:t.width,height:t.height,src:vt(t.src,t.width),alt:t.title,onLoad:i})))(t,(()=>this.kek()))}kek(){this.productImageLoaded.emit(this.productId)}render(){var t,n,r;return e(i,{part:"product-card",class:{dimmed:this.dimmedBackground},exportparts:"brand, currency, deeplink, image, image-link, price-amount, price-container, price-outdated, price-prefix, price-regular, price-sale, title"},e(bt,{deeplink:this.deeplink,part:"image-link"},this.renderImage()),e(bt,{deeplink:this.deeplink,part:"deeplink"},e("span",{class:"title",part:"title"},this.productTitle)),e("span",{class:"brand",part:"brand"},this.brand),e("span",{class:"type",part:"type"},this.productType),e(ft,{prefix:null!==(t=this.pricePrefix)&&void 0!==t?t:j.pricePrefix,currency:null!==(n=this.currency)&&void 0!==n?n:j.currencySign,price:this.price,salePrice:this.salePrice,locale:null!==(r=this.locale)&&void 0!==r?r:j.locale}))}get el(){return r(this)}};wt.style=':host{align-items:center;display:flex;flex-direction:column;gap:8px;height:100%}.price-container{display:flex;flex-direction:column}.price-sale,.price-regular{font-style:normal;font-weight:normal;font-size:16px;line-height:24px;color:#161616}.price-outdated{font-style:normal;font-weight:normal;font-size:16px;line-height:24px;color:#757575;text-decoration:line-through}.product-type{word-wrap:anywhere}.image{display:grid;align-content:center;-o-object-position:50% 50%;object-position:50% 50%;-o-object-fit:contain;object-fit:contain;text-align:center;box-sizing:border-box}img.responsive{width:100%;height:auto;aspect-ratio:1}.brand,.type{display:none}.title{-webkit-box-orient:vertical;-webkit-line-clamp:2;color:#161616;display:-webkit-box;font-size:16px;font-style:normal;font-weight:500;line-height:24px;margin-bottom:8px;overflow:hidden}.deeplink{text-decoration:none}.image-link{display:contents}picture{position:relative;width:100%}:host(.dimmed) picture::before{content:"";width:100%;height:100%;box-sizing:border-box;background:#f7f7f7;display:block;top:0;left:0;position:absolute;mix-blend-mode:multiply}';let yt=class{constructor(e){t(this,e),this.actionClick=n(this,"actionClick",7)}render(){return e(i,null,e("vviinn-error",null,e("h4",{slot:"title"},"Keine Verbindung"),e("span",{slot:"text"},"Etwas hat leider nicht funktioniert. Bitte prüfen Sie Ihre Internetverbindung und laden Sie das Bild noch einmal hoch."),e("button",{slot:"action",onClick:()=>this.actionClick.emit()},"Erneut versuchen")))}};yt.style=":host{display:block}";let kt=class{constructor(e){t(this,e)}render(){return e(i,null,e("slot",null))}};kt.style=":host{display:grid;justify-items:center}";const zt=({kind:t,tabindex:i,disabled:n,onClick:r,onKeyDown:s})=>{return e("div",{class:(o={kind:t,disabled:n},{"arrow-wrapper":!0,[o.kind]:!0,disabled:o.disabled}),onClick:r,tabindex:i,onKeyDown:s},e(H,null));var o};let _t=class{constructor(e){t(this,e),this.elementsCount=0,this.internalPosition=0,this.swipeStartPosition=a.none,this.showBullets=!0,this.position=0,this.showArrows=!1}positionWatchHandler(t){this.internalPosition=t,this.el.style.setProperty("--position",`${t}`),this.setActiveCssClassToSlide(t)}connectedCallback(){this.handleDomContentChanges()}handleDomContentChanges(){const t=this.el.querySelectorAll("vviinn-slide");this.elementsCount=t.length,this.el.style.setProperty("--num-items",`${this.elementsCount}`),this.setActiveCssClassToSlide(0)}setActiveCssClassToSlide(t){const e=this.el.querySelectorAll("vviinn-slide");e.forEach((t=>t.classList.remove("active"))),e[t].classList.add("active")}goToSlide(t){this.internalPosition=t,this.el.style.setProperty("--position",`${t}`),this.setActiveCssClassToSlide(t)}renderBullets(){return this.showBullets?e("div",{class:"controls"},E.range(0,this.elementsCount-1).map((t=>e("div",{class:{bullet:!0,active:t==this.internalPosition%this.elementsCount},onClick:()=>this.goToSlide(t)})))):null}nextSlide(){this.internalPosition++,this.renderSlidePosition()}prevSlide(){const t=this.internalPosition-1;this.internalPosition=t>-1?t:this.elementsCount-1,this.renderSlidePosition()}renderSlidePosition(){requestAnimationFrame((()=>{this.el.style.setProperty("--position",""+this.internalPosition%this.elementsCount)}))}handleKeyDown(t){if("Space"===t.key||"Enter"===t.key)switch(t.target.className.includes("prev")?"prev":"next"){case"prev":this.prevSlide();break;case"next":this.nextSlide()}}handleTouchStart(t){this.showBullets&&(this.swipeStartPosition=h.pipe(t.touches[0],a.fromNullable,a.map((t=>t.clientX))))}handleTouchEnd(t){if(!this.showBullets)return;const e=h.pipe(t.changedTouches[0],a.fromNullable,a.map((t=>t.clientX)));h.pipe(l(this.swipeStartPosition,e),a.map((([t,e])=>{return(i=t)<(n=e)?-1:i>n?1:0;var i,n})),a.map((t=>{switch(t){case 1:return this.nextSlide();case-1:return this.prevSlide()}})))}render(){return e(i,null,e("div",{class:"items-wrapper"},e("div",{class:"items",onTouchStart:t=>this.handleTouchStart(t),onTouchEnd:t=>this.handleTouchEnd(t)},e("slot",null))),this.showArrows?[e(zt,{kind:"prev",onClick:()=>this.prevSlide(),onKeyDown:t=>this.handleKeyDown(t),tabindex:1,disabled:!1}),e(zt,{kind:"next",onClick:()=>this.nextSlide(),onKeyDown:t=>this.handleKeyDown(t),tabindex:0,disabled:!1})]:null,this.renderBullets())}get el(){return r(this)}static get watchers(){return{position:["positionWatchHandler"]}}};_t.style=":host{--color-primary-system:#0F62FE;--color-primary-hover-system:#014CDA;--color-icons-system:#2F8EDF;--spacer:8px}:host{--num-items:0;--position:0;display:grid;grid-gap:20px;justify-items:center;position:relative}.items-wrapper{overflow:hidden;width:100%}.items{box-sizing:border-box;display:grid;grid-auto-flow:column;grid-template-columns:repeat(var(--num-items), 100%);transform:translateX(calc(-100% * var(--position)));transition:transform 0.33s ease-in-out}.controls{display:grid;grid-gap:16px;grid-template-columns:repeat(var(--num-items), -webkit-min-content);grid-template-columns:repeat(var(--num-items), min-content)}.bullet{background:#E0E0E0;border-radius:50%;box-sizing:border-box;cursor:pointer;height:8px;width:8px;transition:background 0.1s ease-in-out}.bullet:hover{background:#C6C6C6}.bullet.active{background:var(--color-primary, var(--color-primary-system))}.bullet:active{background:transparent;border:2px solid var(--color-primary, var(--color-primary-system))}.arrow-wrapper{align-items:center;background:white;border:2px solid white;bottom:0;box-sizing:border-box;display:grid;height:calc(var(--spacer) * 6);justify-items:center;margin:auto;position:absolute;top:0;transform:translate3d(0, -50%, 0);transition:border 0.25ms ease-in-out;width:calc(var(--spacer) * 4)}.arrow-wrapper:active{border-color:var(--color-primary, var(--color-primary-system));opacity:0.75}.arrow-wrapper:focus{border-color:var(--color-primary, var(--color-primary-system));opacity:0.5;outline:none}.prev{left:0}.next{right:0}.next>svg{transform:rotate3d(0, 1, 0, 180deg)}.arrow-wrapper>svg{transition:fill 0.25ms ease-in-out;fill:#A8A8A8}.arrow-wrapper:hover>svg{fill:#8D8D8D}";let Ct=class{constructor(e){t(this,e)}componentWillLoad(){Y(this,this.el)}render(){return e(i,null,e("slot",null,e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"64",height:"64",fill:"none"},e("defs",null),e("path",{fill:"#C6C6C6",d:"M48 28a11.98 11.98 0 00-9.77 18.942L28 57.172 30.828 60l10.23-10.23A11.994 11.994 0 1048 28zm0 20a8 8 0 118-8 8.009 8.009 0 01-8 8zM34 24a6 6 0 10-6-6 6.006 6.006 0 006 6zm0-8a2 2 0 110 4 2 2 0 010-4z"}),e("path",{fill:"#C6C6C6",d:"M24 48H8V35.993L18 26l11.172 11.172L32 34.336 20.828 23.165a4 4 0 00-5.656 0L8 30.336V8h40v12h4V8a4.004 4.004 0 00-4-4H8a4.004 4.004 0 00-4 4v40a4.005 4.005 0 004 4h16v-4z"})),e("span",{class:"vviinn-teaser-text"},e("slot",{name:"vviinn-teaser-text"},"Finde Produkte auf ",e("br",null)," einem Foto"))))}get el(){return r(this)}};Ct.style=":host{align-items:center;display:grid;justify-items:center;grid-gap:16px}.vviinn-teaser-text{font-size:28px;font-weight:600;line-height:40px;size:28px;text-align:center}";const Ft=t=>/^[-+]?(\d+|Infinity)$/.test(t)?Number(t):NaN,St=t=>!P(t),Lt=t=>!isNaN(t);let jt=class{constructor(e){t(this,e),this.apiPath="https://api.vviinn.com",this.active=!1,this.currencySign="€",this.locale="de-DE",this.slidePosition=0,this.width=0,this.wrongImageFormat=!1,this.imageSource=null}activeWatcher(t){t?(this.overflow=document.body.style.overflow,document.body.style.overflow="hidden",this.trackOpenEvent()):document.body.style.overflow=this.overflow}trackRecommendationView({detail:t}){const e=D(Object.assign({session_id:this.uiSessionId},t));this.trackingApi.trackEvent(e)}trackRecommendationClick({detail:t}){const e=A(Object.assign({sessionId:this.uiSessionId},t));this.trackingApi.trackEvent(e).finally((()=>{const e=d.results.find((e=>e.productId===t.product));e&&e.deeplink&&(window.location.href=e.deeplink)}))}trachSearchAreaChanges(){const t=I({session_id:this.uiSessionId,source:this.imageSource,search_area:"manual-selection"});this.trackingApi.trackEvent(t)}trackDetectedObject(){const t=I({session_id:this.uiSessionId,source:this.imageSource,search_area:"attention-point"});this.trackingApi.trackEvent(t)}trackFilter({detail:t}){const e=M({session_id:this.uiSessionId,source:this.imageSource,kind:"category",action:t});this.trackingApi.trackEvent(e)}componentWillLoad(){Y(this,this.el)}connectedCallback(){j.apiPath=this.apiPath,j.currencySign=this.currencySign,j.locale=this.locale,d.token=this.token,d.campaignId=h.pipe(this.campaignId,a.fromNullable,a.chain(a.fromPredicate(St)),a.map(Ft),a.chain(a.fromPredicate(Lt)),a.map((t=>`${t}`))),this.uiSessionId=W()}trackOpenEvent(){this.trackingApi=V(this.apiPath,this.token);const t=$({action:"open",session_id:this.uiSessionId});this.trackingApi.trackEvent(t)}handleImageSelection(t){this.imageSource=t,this.slidePosition=1,this.el.shadowRoot.querySelector("vviinn-overlayed-modal").shadowRoot.querySelector("vviinn-overlay").querySelector("vviinn-modal").shadowRoot.querySelector(".body").scrollTop=0,this.trackInitialSearch()}trackInitialSearch(){const t=I({session_id:this.uiSessionId,source:this.imageSource,search_area:"full"});this.trackingApi.trackEvent(t)}resetState(){this.resetScroll("onboarding-block"),this.slidePosition=0,d.image=a.none,d.imageUrl=a.none,d.imageBounds=a.none,d.searchArea=a.none,d.results=[],d.filters=[],d.detectedObjects=[],d.activeIonLink=void 0,d.rectangleSearchForm=void 0,this.resetScroll("results-block")}haveErrors(){return this.wrongImageFormat||d.serverError}resetScroll(t,e="auto"){this.el.shadowRoot.getElementById(t).scroll({top:0,left:0,behavior:e})}handleModalClose(){this.active=!1,this.resetState(),["onboarding-block","results-block"].forEach((t=>this.resetScroll(t)));const t=$({action:"close",session_id:this.uiSessionId});this.trackingApi.trackEvent(t)}render(){return e(i,null,e("vviinn-overlayed-modal",{class:{"first-screen":0===this.slidePosition},active:this.active,onSecondaryActionClicked:()=>this.resetState(),onModalClosed:()=>this.handleModalClose(),exportparts:"secondary-action, title, close-button, example-images"},e("vviinn-slider",{showBullets:!1,position:this.slidePosition},e("vviinn-slide",{class:{"start-page":!0}},e("div",{class:{error:this.haveErrors(),"start-page_block":!0}},e("vviinn-wrong-format",{class:{hidden:!this.wrongImageFormat},onActionClick:()=>this.wrongImageFormat=!1}),e("vviinn-server-error",{class:{hidden:!d.serverError},onActionClick:()=>d.serverError=!1}),e("vviinn-teaser",{class:{hidden:this.haveErrors()}}),e("vviinn-image-selector",{class:{hidden:this.haveErrors()},onImageSelected:()=>this.handleImageSelection("upload"),onImageSelectedError:()=>this.wrongImageFormat=!0,part:"select-image_button"},e("span",{slot:"upload-button-text",class:"upload-button-content"},e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"29",height:"28",fill:"none"},e("defs",null),e("path",{fill:"#fff","fill-rule":"evenodd",d:"M10.271 3.89A.875.875 0 0111 3.5h7c.293 0 .566.146.728.39l1.49 2.235h3.033a2.625 2.625 0 012.625 2.625V21a2.625 2.625 0 01-2.625 2.625H5.75A2.625 2.625 0 013.125 21V8.75A2.625 2.625 0 015.75 6.125h3.031l1.49-2.235zm1.197 1.36l-1.49 2.235a.875.875 0 01-.729.39H5.75a.875.875 0 00-.875.875V21a.875.875 0 00.875.875h17.5a.875.875 0 00.875-.875V8.75a.875.875 0 00-.875-.875h-3.5a.875.875 0 01-.729-.39l-1.49-2.235h-6.063z","clip-rule":"evenodd"}),e("path",{fill:"#fff","fill-rule":"evenodd",d:"M14.5 11.375a3.062 3.062 0 100 6.125 3.062 3.062 0 000-6.125zm-4.813 3.063a4.812 4.812 0 119.625 0 4.812 4.812 0 01-9.625 0z","clip-rule":"evenodd"})),e("slot",{name:"vviinn-image-upload-button-text"},e("span",null,"Kamera oder Bild auswählen")))),e("vviinn-privacy-badge",{class:{hidden:this.haveErrors()}})),e("div",{id:"onboarding-block",class:"start-page_block"},e("div",{class:"onboarding-wrapper"},e("vviinn-onboarding",null),e("vviinn-example-images",{part:"example-images",onImageSelected:()=>this.handleImageSelection("example"),onImageSelectedError:()=>this.resetScroll("onboarding-block","smooth")})))),e("vviinn-slide",{class:{"results-page":!0,active:1==this.slidePosition}},e("div",{class:"image-wrapper"},e("vviinn-image-view",null),e("div",{class:"filters-wrapper"},e("div",{class:"filters"},d.filters.map((t=>e("search-filters",{filter:t})))))),e("div",{id:"results-block",class:"products-wrapper"},e("div",{class:{"nothing-found":!0,hidden:d.results.length>0}},e("vviinn-empty-results",null),e("vviinn-onboarding",null)),e("div",{class:{hidden:d.results.length<=0,products:!0}},d.results.map(((t,i)=>{var n;return e("vviinn-product-card",{hidden:!0,productTitle:t.title,productId:t.productId,brand:t.brand,deeplink:t.deeplink,price:t.price.actual,salePrice:t.price.sale,imageWidth:160,image:null!==(n=t.image.thumbnail)&&void 0!==n?n:t.image.original,part:"product-card",index:i})}))))))))}get el(){return r(this)}static get watchers(){return{active:["activeWatcher"]}}};jt.style=":host{--color-primary-system:#0F62FE;--color-primary-hover-system:#014CDA;--color-icons-system:#2F8EDF;--spacer:8px}:host{display:block}.hidden{visibility:hidden;height:1px}vviinn-overlayed-modal.first-screen::part(title),vviinn-overlayed-modal.first-screen::part(secondary-action){visibility:hidden}.start-page{display:grid;grid-template-columns:repeat(2, 1fr);min-height:580px}.start-page_block{align-content:start;border-right:1px solid #F4F4F4;display:grid;padding:48px}.start-page_block.error{align-content:center}#onboarding-block{border-right:unset;box-sizing:border-box;grid-gap:24px;overflow-y:auto;position:relative;width:100%}vviinn-teaser{margin-bottom:32px;margin-top:-24px}vviinn-image-selector{align-items:center;background:var(--color-primary, var(--color-primary-system));border-color:var(--color-primary, var(--color-primary-system));border-radius:2px;color:white;display:grid;font-size:16px;font-weight:600;height:56px;justify-items:center;margin-bottom:16px;transition:background 0.1s ease-in-out}vviinn-image-selector:hover{background:var(--color-primary-hover, var(--color-primary-hover-system));border-color:var(--color-primary-hover, var(--color-primary-hover-system))}vviinn-image-selector:active{border-color:black}.upload-button-content{display:grid;align-items:center;justify-items:start;justify-content:center;grid-template-columns:-webkit-max-content auto;grid-template-columns:max-content auto;grid-gap:16px}.results-page{display:grid;grid-template-columns:336px auto;box-sizing:border-box}.results-page>*{padding:24px;box-sizing:border-box}.products{align-content:center;align-items:start;box-sizing:border-box;display:grid;grid-gap:32px 16px;grid-template-columns:repeat(auto-fill, minmax(152px, 1fr));justify-items:center;padding:24px;padding-right:0;position:absolute;width:calc(100% - 16px)}.products.hidden{display:none}vviinn-empty-results{width:280px;align-self:center;justify-self:center}.products-wrapper{display:grid;overflow-y:auto;overflow-x:hidden;padding:unset;position:relative;width:100%}.image-wrapper{border-right:1px solid #F4F4F4;display:grid;grid-template-rows:-webkit-min-content 170px;grid-template-rows:min-content 170px;grid-gap:24px;min-width:100%}.onboarding-wrapper{position:absolute;width:100%;padding:48px;box-sizing:border-box;display:grid;grid-gap:64px;padding-bottom:24px}vviinn-product-card{gap:0;width:100%}vviinn-product-card::part(image){border:1px solid #eaeaea;margin-bottom:8px}vviinn-product-card::part(price-container),vviinn-product-card::part(deeplink),vviinn-product-card::part(title){align-self:start}search-filters span{display:none}search-filters::part(filter){background:#F4F4F4;border-radius:4px;border:1px solid #F4F4F4;box-sizing:border-box;color:#161616;font-size:14px;font-weight:600;line-height:20px}search-filters::part(show-more-filters){border:1px solid #f4f4f4;border-radius:4px;box-sizing:border-box;color:#161616;font-size:14px;font-weight:600;line-height:20px;padding:6px 16px}search-filters::part(show-more-filters):hover{background:#EAEAEA}search-filters::part(filter):hover{background:#EAEAEA}search-filters::part(filter):focus{outline:none;border:1px solid var(--color-primary, var(--color-primary-system))}search-filters::part(filter active){background:rgba(15, 98, 254, 0.15);color:var(--color-primary, var(--color-primary-system))}.filters-wrapper{overflow:auto}.results-page:not(.active){display:none}.nothing-found{display:grid;grid-gap:64px;justify-self:center;padding-top:64px;padding-bottom:16px;position:absolute;width:60%}@media (max-width: 768px){.start-page_block{padding:24px}.onboarding-wrapper{padding:24px}}@media (max-width: 640px){.start-page{grid-template-rows:-webkit-min-content;grid-template-rows:min-content;grid-template-columns:unset;grid-gap:48px;padding:24px 0 48px 0}}@media (max-width: 640px) and (min-width: 415px){.onboarding-wrapper{position:unset}#onboarding-block{overflow:unset}.start-page.active{height:1px;overflow:auto}}@media (max-width: 415px){.results-page>*{box-sizing:border-box;padding:24px}vviinn-slide{padding-bottom:48px}.start-page_block:last-of-type{border-right:unset;overflow-y:unset;position:static;box-sizing:border-box;width:unset}.start-page_block{padding:0 24px}vviinn-teaser{margin-top:24px}.onboarding-wrapper{position:static;width:unset;padding:unset;box-sizing:border-box}.results-page{grid-template-columns:unset;grid-template-rows:-webkit-min-content auto;grid-template-rows:min-content auto}.image{margin-bottom:8px}.image-wrapper{grid-template-rows:-webkit-min-content auto;grid-template-rows:min-content auto;width:100%}.products-wrapper{align-content:start;position:static;overflow-y:unset;width:100%;padding-top:0}.products{position:static;padding:0;width:unset;grid-gap:32px 16px;justify-content:center}.nothing-found{position:static;grid-gap:64px;padding:unset;align-content:start;width:unset}}@media (max-width: 320px){.products{grid-template-columns:unset}}vviinn-wrong-format,vviinn-server-error{width:280px;align-self:center;justify-self:center}";let Et=class{constructor(e){t(this,e),this.actionClick=n(this,"actionClick",7)}render(){return e(i,null,e("vviinn-error",null,e("h4",{slot:"title"},"Dateityp wird nicht unterstützt"),e("span",{slot:"text"},"Leider unterstützen wir dieses Format nicht. Bitte laden Sie eine .jpg, .png oder .webp Bilddatei hoch."),e("button",{slot:"action",onClick:()=>this.actionClick.emit()},"Neues Bild hochladen")))}};Et.style=":host{display:block}";export{Z as cropper_handler,R as highlight_box,K as image_cropper,q as search_filters,X as vviinn_detected_object,U as vviinn_empty_results,Q as vviinn_error,J as vviinn_example_image,tt as vviinn_example_images,et as vviinn_image_selector,it as vviinn_image_view,nt as vviinn_modal,rt as vviinn_onboarding,st as vviinn_onboarding_card_1,ot as vviinn_onboarding_card_2,at as vviinn_onboarding_card_3,lt as vviinn_overlay,dt as vviinn_overlayed_modal,ct as vviinn_preloader,ht as vviinn_privacy_badge,wt as vviinn_product_card,yt as vviinn_server_error,kt as vviinn_slide,_t as vviinn_slider,Ct as vviinn_teaser,jt as vviinn_vps_widget,Et as vviinn_wrong_format}
|
|
1
|
+
import{r as t,h as e,H as i,c as n,g as r}from"./p-4e55513e.js";import{g as s,p as o,O as a,s as l,i as d,a as c,_ as h,t as p,m,f as g,b as u,c as v,d as b,e as x,h as f,j as w,k as y,l as k,E as z,n as _,o as C,q as F,r as S,S as L,u as j,N as E,v as D,w as A,x as I,y as M,z as W,A as V,B as $,C as P}from"./p-9de1b0e7.js";import{C as B,O as G,a as O,b as T,A as H}from"./p-f6e59cb2.js";import{s as Y}from"./p-b254eee7.js";let Z=class{constructor(e){t(this,e),this.disabled=!1}render(){return e(i,{part:`handle ${s(this.handler.direction)}`,class:{disabled:this.disabled,[s(this.handler.direction)]:!0},style:{"--size":"20px",cursor:s(this.handler.direction)},draggable:!1})}};Z.style=":host{--size:20px;background:transparent;border:4px solid white;box-sizing:content-box;display:block;height:var(--size);touch-action:none;position:absolute;width:var(--size);z-index:4;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}:host(.disabled){opacity:0.25}:host(.nw-resize){border-bottom:none;border-right:none;top:0;left:0}:host(.ne-resize){border-left:none;border-bottom:none;right:0;top:0}:host(.sw-resize){border-right:none;border-top:none;left:0;bottom:0}:host(.se-resize){border-left:none;border-top:none;bottom:0;right:0}";let R=class{constructor(e){t(this,e)}getInsetValue(){return o(l(d.searchArea,d.imageBounds),a.map((([t,e])=>{return`inset(${(i=t,n=e,r={top:`${i.y}px`,right:n.width-(i.x+i.width)+"px",bottom:n.height-(i.y+i.height)+"px",left:`${i.x}px`}).top} ${r.right} ${r.bottom} ${r.left})`;var i,n,r})),a.getOrElse((()=>"")))}renderImage(){return o(l(d.imageUrl,d.imageBounds),a.map((([t,i])=>e("img",{src:t,width:i.width,height:i.height,style:{"clip-path":`${this.getInsetValue()}`}}))),a.getOrElse((()=>"")))}render(){return e(i,null,this.renderImage())}};R.style=':host{display:grid;position:absolute;box-sizing:border-box;border:none;width:100%;height:100%;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;--size:10px;--x-position:0;--y-position:0}img{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.pointer{position:absolute;width:var(--size);height:var(--size);background:black;border-radius:50%;z-index:2;cursor:pointer;transform:translate(var(--x-position), var(--y-position)) scale(0);-webkit-animation:0.25s linear fadein;animation:0.25s linear fadein;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}.pointer::after{content:"";cursor:pointer;border:5px solid black;border-radius:50%;width:var(--size);height:var(--size);display:block;transform:translate(calc(-50% + var(--size) * 0.5), calc(-50% + var(--size) * 0.5));padding:calc(var(--size) * 0.5);opacity:.75}@-webkit-keyframes fadein{from{transform:translate(var(--x-position), var(--y-position)) scale(0)}to{transform:translate(var(--x-position), var(--y-position)) scale(1)}}@keyframes fadein{from{transform:translate(var(--x-position), var(--y-position)) scale(0)}to{transform:translate(var(--x-position), var(--y-position)) scale(1)}}';let K=class{constructor(e){t(this,e),this.cropperChanged=n(this,"cropperChanged",7),this.disabled=!1,this.handleMove=!1,this.mouseStartPoint=void 0,this.bounds=void 0}componentDidLoad(){this.bounds=this.el.getBoundingClientRect()}handleHandlerMove(t){t.preventDefault(),t.stopPropagation();const e=g(t),i={position:c.concat(e,this.mouseStartPoint),direction:this.handlerMoveDirection};h.pipe(d.searchArea,a.map((t=>{const n=p(t,i);this.outOfBounds(n)||(d.searchArea=a.some(n),this.mouseStartPoint=e,d.detectedObject=void 0)})))}outOfBounds(t){return t.width<40||t.height<40||t.x<0||t.y<0||this.bounds.height-(t.y+t.height)<0||this.bounds.width-(t.x+t.width)<0}handleCropperMove(t){t.preventDefault(),t.stopPropagation();const e=g(t),i=c.concat(e,this.mouseStartPoint);h.pipe(d.searchArea,a.map((t=>{const n=m(t,i);n.x<0||n.y<0||this.bounds.height-(n.y+n.height)<0||this.bounds.width-(n.x+n.width)<0||(d.detectedObject=void 0,d.searchArea=a.some(n),this.mouseStartPoint=e)})))}handlePointerDown(t){t.stopPropagation(),this.mouseStartPoint=g(t);const e=t.target;"cropper-handler"===e.localName?(this.handlerMoveDirection=e.handler.direction,this.pointerMoveListener=this.handleHandlerMove.bind(this)):this.pointerMoveListener=this.handleCropperMove.bind(this),this.pointerReleaseListener=this.handleSearchAreaRelease.bind(this),this.el.addEventListener("pointermove",this.pointerMoveListener),window.addEventListener("pointerup",this.pointerReleaseListener,{once:!0})}handleSearchAreaRelease(){this.el.removeEventListener("pointermove",this.pointerMoveListener),document.removeEventListener("pointerup",this.pointerReleaseListener),this.mouseStartPoint=void 0,u(),this.cropperChanged.emit()}getStyleMap(){return h.pipe(d.searchArea,a.map((t=>({width:`${t.width}px`,height:`${t.height}px`,transform:`translate3d(${t.x}px, ${t.y}px, 0)`,cursor:this.handleMove?"move":"default"}))),a.getOrElse((()=>({}))))}render(){return e(i,{exportparts:"handle, e-resize, n-resize, ne-resize, nw-resize, s-resize, se-resize, sw-resize, w-resize"},e("div",{class:{"crop-area":!0,active:this.handleMove,disabled:this.disabled},draggable:!1,style:this.getStyleMap(),onContextMenu:()=>!1,onPointerDown:t=>this.handlePointerDown(t)},d.cropperHandlers.map((t=>e("cropper-handler",{disabled:this.disabled,handler:t,onPointerDown:t=>this.handlePointerDown(t)})))))}get el(){return r(this)}};K.style=":host{display:block;height:100%;left:0;position:absolute;top:0;width:100%}:host(.hidden){visibility:hidden}.crop-area{border:1px solid white;box-sizing:border-box;position:absolute;touch-action:none;transition-property:border-color, opacity;transition-duration:.25s;transition-timing-function:ease-in-out;z-index:2;position:relative;will-change:transform}.crop-area.active{border-color:whitesmoke}.crop-area.disabled{opacity:0.25}";const N=t=>t.href.split("/").reverse()[0];let q=class{constructor(e){t(this,e),this.filterSelected=n(this,"filterSelected",7),this.filter=null,this.selectedCategoryId=null,this.hideFilters=!0}handleFilterSelection(t){return this.isFilterSelected(t)?this.clearSelectedFilter():this.selectFilter(t)}selectFilter(t){this.selectedCategoryId=N(t),d.activeIonLink=t,this.filterSelected.emit("select")}clearSelectedFilter(){this.selectedCategoryId=null,d.activeIonLink=void 0,this.findSelectedFilter().blur(),this.filterSelected.emit("deselect")}findSelectedFilter(){return this.el.shadowRoot.querySelector(".filter.active")}toggleFilters(){this.hideFilters=!this.hideFilters}handleEnter(t,e){"Enter"===t.key&&this.handleFilterSelection(e)}isFilterSelected(t){return this.selectedCategoryId===N(t)}render(){return e(i,{exportparts:"filter, show-more-filters"},e("div",{class:"filters"},this.filter.filters.filter(((t,e)=>!this.hideFilters||e<5)).map(((t,i)=>e("div",{role:"button",tabindex:"0",part:this.isFilterSelected(t)?"filter active":"filter",class:{filter:!0,active:this.selectedCategoryId===N(t)},style:{"animation-delay":10*i+"ms"},onPointerUp:e=>{e.stopPropagation(),this.handleFilterSelection(t)},onKeyPress:e=>this.handleEnter(e,t)},this.isFilterSelected(t)?e(B,null):null,t.name))),e("div",{class:{filter:!0,"show-more":!0,hidden:this.filter.filters.length<=5,active:!this.hideFilters},role:"button",tabindex:"0","aria-role":"button",onClick:()=>this.toggleFilters(),onKeyPress:t=>{"Enter"===t.key&&this.toggleFilters()},part:"show-more-filters"},this.hideFilters?"Zeige mehr":"Zeige weniger")))}get el(){return r(this)}};q.style=":host{display:grid;grid-gap:1rem}.filters{display:flex;flex-direction:row;flex-wrap:wrap;gap:0.5rem}.filter{align-items:center;-webkit-animation-duration:0.25s;animation-duration:0.25s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;-webkit-animation-name:scalein;animation-name:scalein;border:1px solid lightgray;cursor:pointer;display:flex;flex-direction:row;grid-gap:8px;height:-webkit-max-content;height:-moz-max-content;height:max-content;min-width:-webkit-max-content;min-width:-moz-max-content;min-width:max-content;padding:0.1rem;transform:scale(0);transition-property:background;transition-duration:0.25s;transition-timing-function:ease-in-out;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;padding:6px 16px}.filter.active{border:1px solid black;padding:6px 8px}.filter:hover{border:1px solid gray}.show-more{display:flex}.show-more.hidden{display:none}.show-more::after{content:url(\"data:image/svg+xml,%3Csvg width='16' height='16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M8 12.2l-6-6L3.2 5 8 9.8 12.8 5 14 6.2l-6 6z' fill='%23525252'/%3E%3C/svg%3E\");display:block;height:16px;margin-top:1px;margin-left:8px}.show-more.active::after{transform:rotateX(180deg)}@-webkit-keyframes scalein{from{opacity:0;transform:scale(0.5)}to{opacity:1;transform:scale(1)}}@keyframes scalein{from{opacity:0;transform:scale(0.5)}to{opacity:1;transform:scale(1)}}@media (max-width: 415px){.show-more::after{transform:rotate(-90deg)}.show-more.active::after{transform:rotate(90deg)}}@media (max-width: 800px){.filters{flex-wrap:nowrap;overflow-x:scroll;-ms-scroll-snap-type:x mandatory;scroll-snap-type:x mandatory;grid-gap:unset}.filter{scroll-snap-align:end;margin-right:0.5rem}}";let X=class{constructor(e){t(this,e),this.detectedObjectClicked=n(this,"detectedObjectClicked",7),this.position=["0","0"]}getObjectPosition(){return h.pipe(d.imageBounds,a.map((t=>{const e=v(b(this.detectedObject).rectangle),{x:i,y:n}=h.pipe(e,x(t),f);return[`${i}px`,`${n}px`]})),a.getOrElse((()=>["0","0"])))}selectDetectedObject(){h.pipe(d.imageBounds,a.map((t=>{const e=b(this.detectedObject).rectangle,i=v(e),n=x(t)(i);d.detectedObject=this.detectedObject,d.searchArea=a.some(n)}))),u(),this.detectedObjectClicked.emit()}isActive(){if(!this.detectedObject)return!1;if(!d.detectedObject)return!1;const t=b(this.detectedObject),e=b(d.detectedObject);return w.equals(t,e)}render(){return e(i,{class:{active:this.isActive()},onClick:()=>this.selectDetectedObject(),style:{"--x-position":this.getObjectPosition()[0],"--y-position":this.getObjectPosition()[1]}})}};X.style=':host{--color-primary-system:#0F62FE;--color-primary-hover-system:#014CDA;--color-icons-system:#2F8EDF;--spacer:8px}:host{--size:32px;--x-position:0;--y-position:0;background:rgba(22, 22, 22, 0.5);border-radius:50%;border:none;cursor:pointer;display:block;height:var(--size);position:absolute;transition:opacity 0.25s;width:var(--size);z-index:2;transform:translate(calc(var(--x-position) - (var(--size) * 0.5)), calc(var(--y-position) - (var(--size) * 0.5)));transition:background 0.1 ease-in-out}:host(:hover){background:rgba(22, 22, 22, 0.75)}:host(.active){background:var(--color-primary, var(--color-primary-system))!important;border:2px solid white}:host::after{--size:32px;border-radius:50%;content:"";cursor:pointer;display:block;height:calc(var(--size) * 0.25);transform:translate(calc(-50% + var(--size) * 0.5), calc(-50% + var(--size) * 0.5));width:calc(var(--size) * 0.25);background:white}';let U=class{constructor(e){t(this,e),this.actionClick=n(this,"actionClick",7)}render(){return e(i,null,e("vviinn-error",null,e("svg",{slot:"icon",class:"icon",width:"32",height:"32",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("path",{d:"M16 2a14 14 0 1 0 0 28 14 14 0 0 0 0-28Zm0 26a12 12 0 1 1 0-24 12 12 0 0 1 0 24Z",fill:"#525252"}),e("path",{d:"M17 8h-2v11h2V8Zm-1 14a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3Z",fill:"#525252"})),e("h4",{slot:"title"},"Leider nichts gefunden"),e("span",{slot:"text"},"Leider konnten wir keine passenden Produkte finden. Bitte versuche es mit einem anderen Bildausschnitt noch einmal.")))}};U.style=":host{display:grid}vviinn-error{justify-items:center}";let Q=class{constructor(e){t(this,e)}render(){return e(i,null,e("slot",{name:"icon"}),e("slot",{name:"title"}),e("slot",{name:"text"}),e("slot",{name:"action"}))}};Q.style=":host{background:#F4F4F4;border-radius:8px;display:grid;grid-gap:20px;padding:24px;text-align:center}::slotted(svg){display:grid;align-self:center}::slotted(h4){margin:unset;font-weight:600;font-size:18px;line-height:24px}::slotted(span){font-size:14px;line-height:20px}::slotted(button){-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;background:transparent;color:var(--color-primary, var(--color-primary-system));font-weight:600;font-size:16px;line-height:20px;cursor:pointer}";let J=class{constructor(e){t(this,e),this.exampleImageSelected=n(this,"exampleImageSelected",7),this.exampleImageError=n(this,"exampleImageError",7),this.src="",this.width=0,this.height=0,this.selected=!1}async selectImage(t){this.selected=!0;const e=await y(this.src),i=await k(e);h.pipe(i,z.match((()=>this.exampleImageError.emit()),(()=>this.exampleImageSelected.emit()))),this.selected=!1}showPreloader(){return(d.objectDetectionInProgress||d.loading)&&this.selected}render(){return e(i,null,this.showPreloader()?e("div",{class:"image-preloader"},e("vviinn-preloader",null)):null,e("img",{onClick:t=>this.selectImage(t),src:this.src,width:this.width,height:this.height}))}};J.style=":host{display:block;margin-bottom:8px;position:relative}img{width:100%;height:auto;cursor:pointer}.image-preloader{background:rgba(0, 0, 0, 0.25);border-radius:4px;bottom:12px;display:none;padding:4px 6px;pointer-events:none;position:absolute;right:12px;z-index:4}vviinn-preloader{--preloader-size:12px}@media (max-width: 640px){.image-preloader{display:block}}";let tt=class{constructor(e){t(this,e),this.imageSelected=n(this,"imageSelected",7),this.imageSelectedError=n(this,"imageSelectedError",7)}handleImageSelection(){this.imageSelected.emit()}handleImageSelectionError(){this.imageSelectedError.emit()}componentWillLoad(){Y(this,this.el)}render(){return e(i,null,e("slot",{name:"vviinn-example-images-title"},e("h3",null,"Mit den Beispielbildern die Suche direkt ausprobieren")),e("div",{class:"images"},e("slot",{name:"vviinn-example-images-1"},e("vviinn-example-image",{width:480,height:640,src:"https://cdn.vviinn.com/0/fit/480/0/ce/0/Z3M6Ly9haWFhcy1pbWdwcm94eS9leGFtcGxlcy9pbWctaW5zcGlyYXRpb24tMDEtTC5qcGc="})),e("slot",{name:"vviinn-example-images-2"},e("vviinn-example-image",{width:280,height:480,src:"https://cdn.vviinn.com/0/fit/480/0/ce/0/Z3M6Ly9haWFhcy1pbWdwcm94eS9leGFtcGxlcy9pbWctaW5zcGlyYXRpb24tMDItTS5qcGc="})),e("slot",{name:"vviinn-example-images-3"},e("vviinn-example-image",{width:280,height:480,src:"https://cdn.vviinn.com/0/fit/480/0/ce/0/Z3M6Ly9haWFhcy1pbWdwcm94eS9leGFtcGxlcy9pbWctaW5zcGlyYXRpb24tMDMtTS5qcGc="})),e("slot",{name:"vviinn-example-images-4"},e("vviinn-example-image",{width:480,height:640,src:"https://cdn.vviinn.com/0/fit/480/0/ce/0/Z3M6Ly9haWFhcy1pbWdwcm94eS9leGFtcGxlcy9pbWctaW5zcGlyYXRpb24tMDQtTC5qcGc="}))))}get el(){return r(this)}};tt.style="h3{font-size:22px;font-weight:600;line-height:32px;margin:0;margin-bottom:16px;text-align:center}.images{display:block;-moz-column-count:2;column-count:2;-moz-column-gap:16px;column-gap:16px}";let et=class{constructor(e){t(this,e),this.imageSelected=n(this,"imageSelected",7),this.imageSelectedError=n(this,"imageSelectedError",7)}async handleInputChange(t){const e=t.target,i=await k(e.files[0]);h.pipe(i,_((()=>this.imageSelectedError.emit()),(()=>this.imageSelected.emit()))),e.value=null}isLoading(){return d.loading||d.objectDetectionInProgress}render(){return e(i,{exportparts:"button"},this.isLoading()?e("vviinn-preloader",null):null,this.isLoading()?null:e("label",{htmlFor:"fileInput",part:"button"},e("slot",{name:"upload-button-text"},"Upload image")),e("input",{id:"fileInput",class:"visually-hidden",type:"file",accept:"image/*",onChange:t=>this.handleInputChange(t)}))}};et.style=":host{display:block}:host(::hover){background:whitesmoke}.visually-hidden{clip:rect(0 0 0 0);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}label{cursor:pointer;display:grid;padding:0.5rem;transition:background 0.1s ease-in-out}";let it=class{constructor(e){t(this,e)}handleInitialImageLoad(t){const e=C(t.target),{x:i,y:n}=m(e,{x:12,y:12}),r={x:i,y:n,width:e.width-24,height:e.height-24};d.imageBounds=a.some(e),d.searchArea=a.some(r)}renderDetectedObject(t){return e("vviinn-detected-object",{detectedObject:t})}renderImage(){return h.pipe(l(d.imageUrl,d.image),a.map((([t,i])=>{const[n,r]=(t=>{const e=F(t),i=S(288)(e).map((t=>t.size));return[i[0],i[1]]})(i);return e("img",{decoding:"async",width:n,height:r,src:t,onLoad:t=>this.handleInitialImageLoad(t),draggable:!1})})),a.getOrElse((()=>null)))}renderCropper(){return h.pipe(d.imageUrl,a.map((()=>e("image-cropper",null))),a.getOrElse((()=>null)))}render(){return e(i,null,d.loading||d.objectDetectionInProgress?e("div",{class:"image-preloader"},e("vviinn-preloader",null)):null,e("highlight-box",null),this.renderImage(),this.renderCropper(),d.detectedObjects.map((t=>this.renderDetectedObject(t))))}};it.style=":host{display:grid;position:relative;justify-self:center}img{box-sizing:border-box;filter:brightness(60%);position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:-1}.image-preloader{background:rgba(0, 0, 0, 0.25);border-radius:4px;bottom:18px;padding:4px 6px;pointer-events:none;position:absolute;right:18px;z-index:4}vviinn-preloader{--preloader-size:12px}";let nt=class{constructor(e){t(this,e),this.modalClosed=n(this,"modalClosed",7),this.secondaryActionClicked=n(this,"secondaryActionClicked",7),this.active=!1,this.slider=!1}close(){this.active=!1,setTimeout((()=>{this.modalClosed.emit()}),this.slider?500:0)}handleAnimationEnd(t){"fade-in"===t.animationName&&(this.slider=!0)}render(){return e(i,{exportparts:"secondary-action, title, close-button",class:{closed:!this.active},onAnimationEnd:t=>this.handleAnimationEnd(t)},e("div",{class:"head"},e("button",{part:"secondary-action",onClick:()=>this.secondaryActionClicked.emit()},e("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("path",{d:"M20.25 12H3.75",stroke:"#161616","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}),e("path",{d:"M10.5 5.25L3.75 12L10.5 18.75",stroke:"#161616","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}))),e("div",{class:"title",part:"title"},"Bildsuche"),e("button",{onClick:()=>this.close(),class:"close-button",part:"close-button"},e("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e("path",{d:"M16 1.4L14.6 0L8 6.6L1.4 0L0 1.4L6.6 8L0 14.6L1.4 16L8 9.4L14.6 16L16 14.6L9.4 8L16 1.4Z",fill:"#333333"})))),e("div",{class:"body"},e("slot",null)))}};nt.style=":host{background:white;border-radius:4px;box-sizing:border-box;display:grid;grid-template-rows:-webkit-min-content auto;grid-template-rows:min-content auto;max-width:960px}@media (max-width: 415px){:host{-webkit-animation-name:fade-in;animation-name:fade-in;-webkit-animation-duration:0.5s;animation-duration:0.5s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}:host(.closed){-webkit-animation-name:fade-out;animation-name:fade-out;-webkit-animation-fill-mode:none;animation-fill-mode:none}.body{overflow-y:auto}}@media (max-width: 640px) and (min-width: 415px){:host{max-width:80%}}.head{align-items:center;border-bottom:1px solid #F4F4F4;display:grid;grid-gap:16px;grid-template-columns:-webkit-min-content auto -webkit-min-content;grid-template-columns:min-content auto min-content;justify-items:center;padding:16px}.title{font-weight:600;font-size:18px;line-height:24px}button{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:none;cursor:pointer;display:grid;padding:unset}@-webkit-keyframes fade-in{from{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes fade-in{from{transform:translateY(100%)}to{transform:translateY(0)}}@-webkit-keyframes fade-out{from{transform:translateY(0)}to{transform:translateY(100%)}}@keyframes fade-out{from{transform:translateY(0)}to{transform:translateY(100%)}}";let rt=class{constructor(e){t(this,e)}componentWillLoad(){Y(this,this.el)}render(){return e(i,null,e("slot",{name:"vviinn-onboarding-title"},e("h3",null,"So funktioniert es")),e("vviinn-slider",{showArrows:!0},e("vviinn-slide",null,e("vviinn-onboarding-card-1",null)),e("vviinn-slide",null,e("vviinn-onboarding-card-2",null)),e("vviinn-slide",null,e("vviinn-onboarding-card-3",null))))}get el(){return r(this)}};rt.style=":host{--color-primary-system:#0F62FE;--color-primary-hover-system:#014CDA;--color-icons-system:#2F8EDF;--spacer:8px}::host{display:block}h3{font-size:22px;font-weight:600;line-height:32px;margin:0;margin-bottom:16px;text-align:center}vviinn-slide{background:#f4f4f4;padding:24px}svg{padding:16px 0}.text{display:grid;grid-gap:8px}.text>h4{color:#161616;font-size:18px;font-weight:600;line-height:24px;margin:unset;text-align:center}.text>p{color:#525252;font-size:14px;font-style:normal;font-weight:normal;line-height:20px;margin:unset;text-align:center}.colored{fill:var(--color-icons, var(--color-icons-system))}";let st=class{constructor(e){t(this,e)}componentWillLoad(){Y(this,this.el)}render(){return e(i,null,e("slot",{name:"onboarding-card-1-icon"},e(G,null)),e("slot",{name:"onboarding-card-1-text"},e("div",{class:"text"},e("h4",null,"Starte die Bildsuche"),e("p",null,"Lade ein Bild aus Deiner Galerie hoch oder fotografiere ein Produkt mit Deiner Kamera."))))}get el(){return r(this)}};st.style=":host{align-items:center;background:#f4f4f4;display:grid;grid-template-rows:repeat(2, 1fr);justify-items:center;padding:24px;width:100%}h4{color:#161616;font-size:18px;font-weight:600;line-height:24px;margin:unset;text-align:center}svg{padding:16px 0}p{color:#525252;font-size:14px;font-style:normal;font-weight:normal;line-height:20px;margin:unset;text-align:center}.colored{fill:var(--color-icons, var(--color-icons-system))}.text{display:grid;grid-gap:8px}";let ot=class{constructor(e){t(this,e)}componentWillLoad(){Y(this,this.el)}render(){return e(i,null,e("slot",{name:"onboarding-card-2-icon"},e(O,null)),e("slot",{name:"onboarding-card-2-text"},e("div",{class:"text"},e("h4",null,"Verfeiner deine Suche"),e("p",null,"Du kannst den Bildrahmen selber festlegen und so die Produkte genau auswählen."))))}get el(){return r(this)}};ot.style=":host{align-items:center;background:#f4f4f4;display:grid;grid-template-rows:repeat(2, 1fr);justify-items:center;padding:24px;width:100%}h4{color:#161616;font-size:18px;font-weight:600;line-height:24px;margin:unset;text-align:center}svg{padding:16px 0}p{color:#525252;font-size:14px;font-style:normal;font-weight:normal;line-height:20px;margin:unset;text-align:center}.colored{fill:var(--color-icons, var(--color-icons-system))}.text{display:grid;grid-gap:8px}";let at=class{constructor(e){t(this,e)}componentWillLoad(){Y(this,this.el)}render(){return e(i,null,e("slot",{name:"onboarding-card-3-icon"},e(T,null)),e("slot",{name:"onboarding-card-3-text"},e("div",{class:"text"},e("h4",null,"Ohne Hintergrund"),e("p",null,"Die besten Ergebnisse erhältst Du, wenn das gesuchte Objekt mit einfarbigem und hellem Hintergrund zu sehen ist."))))}get el(){return r(this)}};at.style=":host{align-items:center;background:#f4f4f4;display:grid;grid-template-rows:repeat(2, 1fr);justify-items:center;padding:24px;width:100%}h4{color:#161616;font-size:18px;font-weight:600;line-height:24px;margin:unset;text-align:center}svg{padding:16px 0}p{color:#525252;font-size:14px;font-style:normal;font-weight:normal;line-height:20px;margin:unset;text-align:center}.colored{fill:var(--color-icons, var(--color-icons-system))}.text{display:grid;grid-gap:8px}";let lt=class{constructor(e){t(this,e)}render(){return e(i,null,e("slot",null))}};lt.style=":host{-webkit-animation:fade-in 0.5s ease-in-out;animation:fade-in 0.5s ease-in-out;background:rgba(0, 0, 0, 0.5);display:block;height:100vh;left:0;overflow:hidden;position:fixed;top:0;width:100vw;z-index:9999}@-webkit-keyframes fade-in{from{opacity:0.1}to{opacity:1}}@keyframes fade-in{from{opacity:0.1}to{opacity:1}}";let dt=class{constructor(e){t(this,e),this.secondaryActionClicked=n(this,"secondaryActionClicked",7),this.modalClosed=n(this,"modalClosed",7),this.active=!1}render(){return e(i,{class:{active:this.active}},e("vviinn-overlay",null,e("vviinn-modal",{onSecondaryActionClicked:()=>this.secondaryActionClicked.emit(),active:this.active},e("slot",null,"CONTENT"))))}};dt.style=":host{display:none}:host(.active){display:block}vviinn-overlay{align-items:center;display:grid;justify-items:center}@media (max-width: 415px){vviinn-modal{border-radius:4px 4px 0 0;height:100vh;margin-top:32px;transform:translateY(100%);width:100vw}vviinn-overlay{align-items:end;display:grid;justify-items:center}}";let ct=class{constructor(e){t(this,e)}isActive(){return d.loading||d.objectDetectionInProgress}render(){return e(i,{class:{active:this.isActive()}})}};ct.style=":host{--preloader-size:24px;--preloader-width:calc(var(--preloader-size) / 6);transform-origin:center;-webkit-animation:rotate 3s linear infinite;animation:rotate 3s linear infinite;border:var(--preloader-width) solid white;border-radius:50%;border-top-color:transparent;display:none;outline:0;width:var(--preloader-size);height:var(--preloader-size);box-sizing:border-box}:host(.active){display:flex}@-webkit-keyframes rotate{from{transform:rotate(-360deg)}to{transform:rotate(360deg)}}@keyframes rotate{from{transform:rotate(-360deg)}to{transform:rotate(360deg)}}";let ht=class{constructor(e){t(this,e)}componentWillLoad(){Y(this,this.el)}render(){return e(i,null,e("slot",null,e("div",{class:"content"},e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"none"},e("defs",null),e("path",{fill:"#525252",d:"M8.5 11V7h-2v1h1v3H6v1h4v-1H8.5zM8 4a.75.75 0 100 1.5A.75.75 0 008 4z"}),e("path",{fill:"#525252",d:"M8 15A7 7 0 118 1a7 7 0 010 14zM8 2a6 6 0 100 12A6 6 0 008 2z"})),e("slot",{name:"vviinn-privacy-badge-text"},e("p",null,"Wir gehen sorgfältig mit Deinen Daten um. Deine Bilder werden nur zum Zweck der Bildsuche gespeichert.")))))}get el(){return r(this)}};ht.style=":host{display:block;background:#F4F4F4;padding:17px}.content{display:grid;grid-template-columns:-webkit-min-content auto;grid-template-columns:min-content auto;grid-gap:9px}.content p{color:#525252;font-size:12px;line-height:16px;margin:unset}";class pt{sendImpression(t){var e,i,n;gtag("event","view_item_list",{items:[{id:t.productId,name:t.title,brand:null!==(e=t.brand)&&void 0!==e?e:"",category:null!==(i=t.productType)&&void 0!==i?i:"",list_name:"VI VPR View",price:Math.min(t.price.actual,null!==(n=t.price.sale)&&void 0!==n?n:1/0)}]})}sendClick(t){var e,i,n;gtag("event","select_content",{content_type:"product",items:[{id:t.productId,name:t.title,brand:null!==(e=t.brand)&&void 0!==e?e:"",category:null!==(i=t.productType)&&void 0!==i?i:"",list_name:"VI VPR View",price:Math.min(t.price.actual,null!==(n=t.price.sale)&&void 0!==n?n:1/0)}]})}}class mt{constructor(){ga("require","ec")}convertProduct(t){var e,i,n;return{id:t.productId,name:t.title,brand:null!==(e=t.brand)&&void 0!==e?e:"",category:null!==(i=t.productType)&&void 0!==i?i:"",list:"VI VPR View",price:Math.min(t.price.actual,null!==(n=t.price.sale)&&void 0!==n?n:1/0)}}sendImpression(t){ga("ec:addImpression",this.convertProduct(t))}sendClick(t){var e,i,n;ga("ec:addProduct",{id:t.productId,name:t.title,brand:null!==(e=t.brand)&&void 0!==e?e:"",category:null!==(i=t.productType)&&void 0!==i?i:"",price:Math.min(t.price.actual,null!==(n=t.price.sale)&&void 0!==n?n:1/0)}),ga("ec:setAction","click",{list:"VI VPR View"})}}const gt=a.getMonoid(L.first()).concat(h.pipe(a.fromNullable(window.gtag),a.map((()=>new pt))),h.pipe(a.fromNullable(window.ga),a.map((()=>new mt)))),ut=/fit\/\d+\//,vt=(t,e)=>h.pipe((t=>h.pipe(t.match(ut),z.fromNullable(t),z.map((()=>t))))(t),z.map((t=>t.replace(ut,`fit/${e}/`))),z.getOrElse((()=>t))),bt=(t,i)=>t.deeplink?e("a",{class:t.part,part:t.part,href:t.deeplink},i):i,xt=t=>{var i;const n=new Intl.NumberFormat(t.locale,{minimumFractionDigits:2}).format(t.price),r=`${null!==(i=t.prefix)&&void 0!==i?i:""} ${n} ${t.currency}`;return e("span",{class:"price-amount",part:"price-amount"},r)},ft=t=>{const i=e(xt,{prefix:t.prefix,currency:t.currency,price:t.price,locale:t.locale});return e("span",{class:"price-container",part:"price-container"},t.salePrice?[e("span",{class:"price-sale",part:"price-sale"},e(xt,{prefix:t.prefix,currency:t.currency,price:t.salePrice,locale:t.locale})),e("span",{class:"price-outdated",part:"price-outdated"},i)]:e("span",{class:"price-regular",part:"price-regular"},i))};let wt=class{constructor(e){t(this,e),this.recommendationLoad=n(this,"recommendationLoad",7),this.recommendationView=n(this,"recommendationView",7),this.recommendationClick=n(this,"recommendationClick",7),this.productImageLoaded=n(this,"productImageLoaded",7),this.currency=void 0,this.imageRatio=1,this.imageWidth=200,this.locale=void 0,this.pricePrefix=void 0,this.responsive=!1,this.dimmedBackground=!1,this.index=0,this.imageLoaded=!1,this.productData=null,this.intersectionObserver=new IntersectionObserver(this.intersectionCallback.bind(this),{threshold:1})}connectedCallback(){this.productData={product:this.productId,rank:this.index}}intersectionCallback(t){t.some((t=>t.isIntersecting))&&(h.pipe(gt,a.map((t=>t.sendImpression(this.getProduct())))),this.recommendationView.emit(this.productData),this.intersectionObserver.disconnect())}componentDidLoad(){this.recommendationLoad.emit(this.productData),this.intersectionObserver.observe(this.el),this.el.shadowRoot.querySelectorAll("a").forEach((t=>t.addEventListener("click",(t=>{t.preventDefault(),t.stopImmediatePropagation(),this.recommendationClick.emit(this.productData),h.pipe(gt,a.match((()=>null),(t=>t.sendClick(this.getProduct()))))}))))}getProduct(){return d.results.find((t=>t.productId===this.productId))}renderImage(){const t={width:this.imageWidth,height:this.imageWidth*this.imageRatio,src:this.image,title:this.productTitle,lazy:!1};return this.responsive?((t,i=(()=>{}))=>e("picture",null,e("img",{loading:t.lazy?"lazy":"eager",part:"image",class:"image responsive",src:vt(t.src,t.width),alt:t.title,onLoad:i})))(t,(()=>this.kek())):((t,i=(()=>{}))=>e("picture",null,e("img",{loading:t.lazy?"lazy":"eager",part:"image",class:"image",width:t.width,height:t.height,src:vt(t.src,t.width),alt:t.title,onLoad:i})))(t,(()=>this.kek()))}kek(){this.productImageLoaded.emit(this.productId)}render(){var t,n,r;return e(i,{part:"product-card",class:{dimmed:this.dimmedBackground},exportparts:"brand, currency, deeplink, image, image-link, price-amount, price-container, price-outdated, price-prefix, price-regular, price-sale, title"},e(bt,{deeplink:this.deeplink,part:"image-link"},this.renderImage()),e(bt,{deeplink:this.deeplink,part:"deeplink"},e("span",{class:"title",part:"title"},this.productTitle)),e("span",{class:"brand",part:"brand"},this.brand),e("span",{class:"type",part:"type"},this.productType),e(ft,{prefix:null!==(t=this.pricePrefix)&&void 0!==t?t:j.pricePrefix,currency:null!==(n=this.currency)&&void 0!==n?n:j.currencySign,price:this.price,salePrice:this.salePrice,locale:null!==(r=this.locale)&&void 0!==r?r:j.locale}))}get el(){return r(this)}};wt.style=':host{align-items:center;display:flex;flex-direction:column;gap:8px;height:100%}.price-container{display:flex;flex-direction:column}.price-sale,.price-regular{font-style:normal;font-weight:normal;font-size:16px;line-height:24px;color:#161616}.price-outdated{font-style:normal;font-weight:normal;font-size:16px;line-height:24px;color:#757575;text-decoration:line-through}.product-type{word-wrap:anywhere}.image{display:grid;align-content:center;-o-object-position:50% 50%;object-position:50% 50%;-o-object-fit:contain;object-fit:contain;text-align:center;box-sizing:border-box}img.responsive{width:100%;height:auto;aspect-ratio:1}.brand,.type{display:none}.title{-webkit-box-orient:vertical;-webkit-line-clamp:2;color:#161616;display:-webkit-box;font-size:16px;font-style:normal;font-weight:500;line-height:24px;margin-bottom:8px;overflow:hidden}.deeplink{text-decoration:none}.image-link{display:contents}picture{position:relative;width:100%}:host(.dimmed) picture::before{content:"";width:100%;height:100%;box-sizing:border-box;background:#f7f7f7;display:block;top:0;left:0;position:absolute;mix-blend-mode:multiply}';let yt=class{constructor(e){t(this,e),this.actionClick=n(this,"actionClick",7)}render(){return e(i,null,e("vviinn-error",null,e("h4",{slot:"title"},"Keine Verbindung"),e("span",{slot:"text"},"Etwas hat leider nicht funktioniert. Bitte prüfen Sie Ihre Internetverbindung und laden Sie das Bild noch einmal hoch."),e("button",{slot:"action",onClick:()=>this.actionClick.emit()},"Erneut versuchen")))}};yt.style=":host{display:block}";let kt=class{constructor(e){t(this,e)}render(){return e(i,null,e("slot",null))}};kt.style=":host{display:grid;justify-items:center}";const zt=({kind:t,tabindex:i,disabled:n,onClick:r,onKeyDown:s})=>{return e("div",{class:(o={kind:t,disabled:n},{"arrow-wrapper":!0,[o.kind]:!0,disabled:o.disabled}),onClick:r,tabindex:i,onKeyDown:s},e(H,null));var o};let _t=class{constructor(e){t(this,e),this.elementsCount=0,this.internalPosition=0,this.swipeStartPosition=a.none,this.showBullets=!0,this.position=0,this.showArrows=!1}positionWatchHandler(t){this.internalPosition=t,this.el.style.setProperty("--position",`${t}`),this.setActiveCssClassToSlide(t)}connectedCallback(){this.handleDomContentChanges()}handleDomContentChanges(){const t=this.el.querySelectorAll("vviinn-slide");this.elementsCount=t.length,this.el.style.setProperty("--num-items",`${this.elementsCount}`),this.setActiveCssClassToSlide(0)}setActiveCssClassToSlide(t){const e=this.el.querySelectorAll("vviinn-slide");e.forEach((t=>t.classList.remove("active"))),e[t].classList.add("active")}goToSlide(t){this.internalPosition=t,this.el.style.setProperty("--position",`${t}`),this.setActiveCssClassToSlide(t)}renderBullets(){return this.showBullets?e("div",{class:"controls"},E.range(0,this.elementsCount-1).map((t=>e("div",{class:{bullet:!0,active:t==this.internalPosition%this.elementsCount},onClick:()=>this.goToSlide(t)})))):null}nextSlide(){this.internalPosition++,this.renderSlidePosition()}prevSlide(){const t=this.internalPosition-1;this.internalPosition=t>-1?t:this.elementsCount-1,this.renderSlidePosition()}renderSlidePosition(){requestAnimationFrame((()=>{this.el.style.setProperty("--position",""+this.internalPosition%this.elementsCount)}))}handleKeyDown(t){if("Space"===t.key||"Enter"===t.key)switch(t.target.className.includes("prev")?"prev":"next"){case"prev":this.prevSlide();break;case"next":this.nextSlide()}}handleTouchStart(t){this.showBullets&&(this.swipeStartPosition=h.pipe(t.touches[0],a.fromNullable,a.map((t=>t.clientX))))}handleTouchEnd(t){if(!this.showBullets)return;const e=h.pipe(t.changedTouches[0],a.fromNullable,a.map((t=>t.clientX)));h.pipe(l(this.swipeStartPosition,e),a.map((([t,e])=>{return(i=t)<(n=e)?-1:i>n?1:0;var i,n})),a.map((t=>{switch(t){case 1:return this.nextSlide();case-1:return this.prevSlide()}})))}render(){return e(i,null,e("div",{class:"items-wrapper"},e("div",{class:"items",onTouchStart:t=>this.handleTouchStart(t),onTouchEnd:t=>this.handleTouchEnd(t)},e("slot",null))),this.showArrows?[e(zt,{kind:"prev",onClick:()=>this.prevSlide(),onKeyDown:t=>this.handleKeyDown(t),tabindex:1,disabled:!1}),e(zt,{kind:"next",onClick:()=>this.nextSlide(),onKeyDown:t=>this.handleKeyDown(t),tabindex:0,disabled:!1})]:null,this.renderBullets())}get el(){return r(this)}static get watchers(){return{position:["positionWatchHandler"]}}};_t.style=":host{--color-primary-system:#0F62FE;--color-primary-hover-system:#014CDA;--color-icons-system:#2F8EDF;--spacer:8px}:host{--num-items:0;--position:0;display:grid;grid-gap:20px;justify-items:center;position:relative}.items-wrapper{overflow:hidden;width:100%}.items{box-sizing:border-box;display:grid;grid-auto-flow:column;grid-template-columns:repeat(var(--num-items), 100%);transform:translateX(calc(-100% * var(--position)));transition:transform 0.33s ease-in-out}.controls{display:grid;grid-gap:16px;grid-template-columns:repeat(var(--num-items), -webkit-min-content);grid-template-columns:repeat(var(--num-items), min-content)}.bullet{background:#E0E0E0;border-radius:50%;box-sizing:border-box;cursor:pointer;height:8px;width:8px;transition:background 0.1s ease-in-out}.bullet:hover{background:#C6C6C6}.bullet.active{background:var(--color-primary, var(--color-primary-system))}.bullet:active{background:transparent;border:2px solid var(--color-primary, var(--color-primary-system))}.arrow-wrapper{align-items:center;background:white;border:2px solid white;bottom:0;box-sizing:border-box;display:grid;height:calc(var(--spacer) * 6);justify-items:center;margin:auto;position:absolute;top:0;transform:translate3d(0, -50%, 0);transition:border 0.25ms ease-in-out;width:calc(var(--spacer) * 4)}.arrow-wrapper:active{border-color:var(--color-primary, var(--color-primary-system));opacity:0.75}.arrow-wrapper:focus{border-color:var(--color-primary, var(--color-primary-system));opacity:0.5;outline:none}.prev{left:0}.next{right:0}.next>svg{transform:rotate3d(0, 1, 0, 180deg)}.arrow-wrapper>svg{transition:fill 0.25ms ease-in-out;fill:#A8A8A8}.arrow-wrapper:hover>svg{fill:#8D8D8D}";let Ct=class{constructor(e){t(this,e)}componentWillLoad(){Y(this,this.el)}render(){return e(i,null,e("slot",null,e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"64",height:"64",fill:"none"},e("defs",null),e("path",{fill:"#C6C6C6",d:"M48 28a11.98 11.98 0 00-9.77 18.942L28 57.172 30.828 60l10.23-10.23A11.994 11.994 0 1048 28zm0 20a8 8 0 118-8 8.009 8.009 0 01-8 8zM34 24a6 6 0 10-6-6 6.006 6.006 0 006 6zm0-8a2 2 0 110 4 2 2 0 010-4z"}),e("path",{fill:"#C6C6C6",d:"M24 48H8V35.993L18 26l11.172 11.172L32 34.336 20.828 23.165a4 4 0 00-5.656 0L8 30.336V8h40v12h4V8a4.004 4.004 0 00-4-4H8a4.004 4.004 0 00-4 4v40a4.005 4.005 0 004 4h16v-4z"})),e("span",{class:"vviinn-teaser-text"},e("slot",{name:"vviinn-teaser-text"},"Finde Produkte auf ",e("br",null)," einem Foto"))))}get el(){return r(this)}};Ct.style=":host{align-items:center;display:grid;justify-items:center;grid-gap:16px}.vviinn-teaser-text{font-size:28px;font-weight:600;line-height:40px;size:28px;text-align:center}";const Ft=t=>/^[-+]?(\d+|Infinity)$/.test(t)?Number(t):NaN,St=t=>!P(t),Lt=t=>!isNaN(t);let jt=class{constructor(e){t(this,e),this.apiPath="https://api.vviinn.com",this.active=!1,this.currencySign="€",this.locale="de-DE",this.slidePosition=0,this.width=0,this.wrongImageFormat=!1,this.imageSource=null}activeWatcher(t){t?(this.overflow=document.body.style.overflow,document.body.style.overflow="hidden",this.trackOpenEvent()):document.body.style.overflow=this.overflow}trackRecommendationView({detail:t}){const e=D(Object.assign({session_id:this.uiSessionId},t));this.trackingApi.trackEvent(e)}trackRecommendationClick({detail:t}){const e=A(Object.assign({sessionId:this.uiSessionId},t));this.trackingApi.trackEvent(e).finally((()=>{const e=d.results.find((e=>e.productId===t.product));e&&e.deeplink&&(window.location.href=e.deeplink)}))}trachSearchAreaChanges(){const t=I({session_id:this.uiSessionId,source:this.imageSource,search_area:"manual-selection"});this.trackingApi.trackEvent(t)}trackDetectedObject(){const t=I({session_id:this.uiSessionId,source:this.imageSource,search_area:"attention-point"});this.trackingApi.trackEvent(t)}trackFilter({detail:t}){const e=M({session_id:this.uiSessionId,source:this.imageSource,kind:"category",action:t});this.trackingApi.trackEvent(e)}componentWillLoad(){Y(this,this.el)}connectedCallback(){j.apiPath=this.apiPath,j.currencySign=this.currencySign,j.locale=this.locale,d.token=this.token,d.campaignId=h.pipe(this.campaignId,a.fromNullable,a.chain(a.fromPredicate(St)),a.map(Ft),a.chain(a.fromPredicate(Lt)),a.map((t=>`${t}`))),this.uiSessionId=W(),this.trackingApi=V(this.apiPath,this.token)}trackOpenEvent(){const t=$({action:"open",session_id:this.uiSessionId});this.trackingApi.trackEvent(t)}handleImageSelection(t){this.imageSource=t,this.slidePosition=1,this.el.shadowRoot.querySelector("vviinn-overlayed-modal").shadowRoot.querySelector("vviinn-overlay").querySelector("vviinn-modal").shadowRoot.querySelector(".body").scrollTop=0,this.trackInitialSearch()}trackInitialSearch(){const t=I({session_id:this.uiSessionId,source:this.imageSource,search_area:"full"});this.trackingApi.trackEvent(t)}resetState(){this.resetScroll("onboarding-block"),this.slidePosition=0,d.image=a.none,d.imageUrl=a.none,d.imageBounds=a.none,d.searchArea=a.none,d.results=[],d.filters=[],d.detectedObjects=[],d.activeIonLink=void 0,d.rectangleSearchForm=void 0,this.resetScroll("results-block")}haveErrors(){return this.wrongImageFormat||d.serverError}resetScroll(t,e="auto"){this.el.shadowRoot.getElementById(t).scroll({top:0,left:0,behavior:e})}handleModalClose(){this.active=!1,this.resetState(),["onboarding-block","results-block"].forEach((t=>this.resetScroll(t)));const t=$({action:"close",session_id:this.uiSessionId});this.trackingApi.trackEvent(t)}render(){return e(i,null,e("vviinn-overlayed-modal",{class:{"first-screen":0===this.slidePosition},active:this.active,onSecondaryActionClicked:()=>this.resetState(),onModalClosed:()=>this.handleModalClose(),exportparts:"secondary-action, title, close-button, example-images"},e("vviinn-slider",{showBullets:!1,position:this.slidePosition},e("vviinn-slide",{class:{"start-page":!0}},e("div",{class:{error:this.haveErrors(),"start-page_block":!0}},e("vviinn-wrong-format",{class:{hidden:!this.wrongImageFormat},onActionClick:()=>this.wrongImageFormat=!1}),e("vviinn-server-error",{class:{hidden:!d.serverError},onActionClick:()=>d.serverError=!1}),e("vviinn-teaser",{class:{hidden:this.haveErrors()}}),e("vviinn-image-selector",{class:{hidden:this.haveErrors()},onImageSelected:()=>this.handleImageSelection("upload"),onImageSelectedError:()=>this.wrongImageFormat=!0,part:"select-image_button"},e("span",{slot:"upload-button-text",class:"upload-button-content"},e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"29",height:"28",fill:"none"},e("defs",null),e("path",{fill:"#fff","fill-rule":"evenodd",d:"M10.271 3.89A.875.875 0 0111 3.5h7c.293 0 .566.146.728.39l1.49 2.235h3.033a2.625 2.625 0 012.625 2.625V21a2.625 2.625 0 01-2.625 2.625H5.75A2.625 2.625 0 013.125 21V8.75A2.625 2.625 0 015.75 6.125h3.031l1.49-2.235zm1.197 1.36l-1.49 2.235a.875.875 0 01-.729.39H5.75a.875.875 0 00-.875.875V21a.875.875 0 00.875.875h17.5a.875.875 0 00.875-.875V8.75a.875.875 0 00-.875-.875h-3.5a.875.875 0 01-.729-.39l-1.49-2.235h-6.063z","clip-rule":"evenodd"}),e("path",{fill:"#fff","fill-rule":"evenodd",d:"M14.5 11.375a3.062 3.062 0 100 6.125 3.062 3.062 0 000-6.125zm-4.813 3.063a4.812 4.812 0 119.625 0 4.812 4.812 0 01-9.625 0z","clip-rule":"evenodd"})),e("slot",{name:"vviinn-image-upload-button-text"},e("span",null,"Kamera oder Bild auswählen")))),e("vviinn-privacy-badge",{class:{hidden:this.haveErrors()}})),e("div",{id:"onboarding-block",class:"start-page_block"},e("div",{class:"onboarding-wrapper"},e("vviinn-onboarding",null),e("vviinn-example-images",{part:"example-images",onImageSelected:()=>this.handleImageSelection("example"),onImageSelectedError:()=>this.resetScroll("onboarding-block","smooth")})))),e("vviinn-slide",{class:{"results-page":!0,active:1==this.slidePosition}},e("div",{class:"image-wrapper"},e("vviinn-image-view",null),e("div",{class:"filters-wrapper"},e("div",{class:"filters"},d.filters.map((t=>e("search-filters",{filter:t})))))),e("div",{id:"results-block",class:"products-wrapper"},e("div",{class:{"nothing-found":!0,hidden:d.results.length>0}},e("vviinn-empty-results",null),e("vviinn-onboarding",null)),e("div",{class:{hidden:d.results.length<=0,products:!0}},d.results.map(((t,i)=>{var n;return e("vviinn-product-card",{hidden:!0,productTitle:t.title,productId:t.productId,brand:t.brand,deeplink:t.deeplink,price:t.price.actual,salePrice:t.price.sale,imageWidth:160,image:null!==(n=t.image.thumbnail)&&void 0!==n?n:t.image.original,part:"product-card",index:i})}))))))))}get el(){return r(this)}static get watchers(){return{active:["activeWatcher"]}}};jt.style=":host{--color-primary-system:#0F62FE;--color-primary-hover-system:#014CDA;--color-icons-system:#2F8EDF;--spacer:8px}:host{display:block}.hidden{visibility:hidden;height:1px}vviinn-overlayed-modal.first-screen::part(title),vviinn-overlayed-modal.first-screen::part(secondary-action){visibility:hidden}.start-page{display:grid;grid-template-columns:repeat(2, 1fr);min-height:580px}.start-page_block{align-content:start;border-right:1px solid #F4F4F4;display:grid;padding:48px}.start-page_block.error{align-content:center}#onboarding-block{border-right:unset;box-sizing:border-box;grid-gap:24px;overflow-y:auto;position:relative;width:100%}vviinn-teaser{margin-bottom:32px;margin-top:-24px}vviinn-image-selector{align-items:center;background:var(--color-primary, var(--color-primary-system));border-color:var(--color-primary, var(--color-primary-system));border-radius:2px;color:white;display:grid;font-size:16px;font-weight:600;height:56px;justify-items:center;margin-bottom:16px;transition:background 0.1s ease-in-out}vviinn-image-selector:hover{background:var(--color-primary-hover, var(--color-primary-hover-system));border-color:var(--color-primary-hover, var(--color-primary-hover-system))}vviinn-image-selector:active{border-color:black}.upload-button-content{display:grid;align-items:center;justify-items:start;justify-content:center;grid-template-columns:-webkit-max-content auto;grid-template-columns:max-content auto;grid-gap:16px}.results-page{display:grid;grid-template-columns:336px auto;box-sizing:border-box}.results-page>*{padding:24px;box-sizing:border-box}.products{align-content:center;align-items:start;box-sizing:border-box;display:grid;grid-gap:32px 16px;grid-template-columns:repeat(auto-fill, minmax(152px, 1fr));justify-items:center;padding:24px;padding-right:0;position:absolute;width:calc(100% - 16px)}.products.hidden{display:none}vviinn-empty-results{width:280px;align-self:center;justify-self:center}.products-wrapper{display:grid;overflow-y:auto;overflow-x:hidden;padding:unset;position:relative;width:100%}.image-wrapper{border-right:1px solid #F4F4F4;display:grid;grid-template-rows:-webkit-min-content 170px;grid-template-rows:min-content 170px;grid-gap:24px;min-width:100%}.onboarding-wrapper{position:absolute;width:100%;padding:48px;box-sizing:border-box;display:grid;grid-gap:64px;padding-bottom:24px}vviinn-product-card{gap:0;width:100%}vviinn-product-card::part(image){border:1px solid #eaeaea;margin-bottom:8px}vviinn-product-card::part(price-container),vviinn-product-card::part(deeplink),vviinn-product-card::part(title){align-self:start}search-filters span{display:none}search-filters::part(filter){background:#F4F4F4;border-radius:4px;border:1px solid #F4F4F4;box-sizing:border-box;color:#161616;font-size:14px;font-weight:600;line-height:20px}search-filters::part(show-more-filters){border:1px solid #f4f4f4;border-radius:4px;box-sizing:border-box;color:#161616;font-size:14px;font-weight:600;line-height:20px;padding:6px 16px}search-filters::part(show-more-filters):hover{background:#EAEAEA}search-filters::part(filter):hover{background:#EAEAEA}search-filters::part(filter):focus{outline:none;border:1px solid var(--color-primary, var(--color-primary-system))}search-filters::part(filter active){background:rgba(15, 98, 254, 0.15);color:var(--color-primary, var(--color-primary-system))}.filters-wrapper{overflow:auto}.results-page:not(.active){display:none}.nothing-found{display:grid;grid-gap:64px;justify-self:center;padding-top:64px;padding-bottom:16px;position:absolute;width:60%}@media (max-width: 768px){.start-page_block{padding:24px}.onboarding-wrapper{padding:24px}}@media (max-width: 640px){.start-page{grid-template-rows:-webkit-min-content;grid-template-rows:min-content;grid-template-columns:unset;grid-gap:48px;padding:24px 0 48px 0}}@media (max-width: 640px) and (min-width: 415px){.onboarding-wrapper{position:unset}#onboarding-block{overflow:unset}.start-page.active{height:1px;overflow:auto}}@media (max-width: 415px){.results-page>*{box-sizing:border-box;padding:24px}vviinn-slide{padding-bottom:48px}.start-page_block:last-of-type{border-right:unset;overflow-y:unset;position:static;box-sizing:border-box;width:unset}.start-page_block{padding:0 24px}vviinn-teaser{margin-top:24px}.onboarding-wrapper{position:static;width:unset;padding:unset;box-sizing:border-box}.results-page{grid-template-columns:unset;grid-template-rows:-webkit-min-content auto;grid-template-rows:min-content auto}.image{margin-bottom:8px}.image-wrapper{grid-template-rows:-webkit-min-content auto;grid-template-rows:min-content auto;width:100%}.products-wrapper{align-content:start;position:static;overflow-y:unset;width:100%;padding-top:0}.products{position:static;padding:0;width:unset;grid-gap:32px 16px;justify-content:center}.nothing-found{position:static;grid-gap:64px;padding:unset;align-content:start;width:unset}}@media (max-width: 320px){.products{grid-template-columns:unset}}vviinn-wrong-format,vviinn-server-error{width:280px;align-self:center;justify-self:center}";let Et=class{constructor(e){t(this,e),this.actionClick=n(this,"actionClick",7)}render(){return e(i,null,e("vviinn-error",null,e("h4",{slot:"title"},"Dateityp wird nicht unterstützt"),e("span",{slot:"text"},"Leider unterstützen wir dieses Format nicht. Bitte laden Sie eine .jpg, .png oder .webp Bilddatei hoch."),e("button",{slot:"action",onClick:()=>this.actionClick.emit()},"Neues Bild hochladen")))}};Et.style=":host{display:block}";export{Z as cropper_handler,R as highlight_box,K as image_cropper,q as search_filters,X as vviinn_detected_object,U as vviinn_empty_results,Q as vviinn_error,J as vviinn_example_image,tt as vviinn_example_images,et as vviinn_image_selector,it as vviinn_image_view,nt as vviinn_modal,rt as vviinn_onboarding,st as vviinn_onboarding_card_1,ot as vviinn_onboarding_card_2,at as vviinn_onboarding_card_3,lt as vviinn_overlay,dt as vviinn_overlayed_modal,ct as vviinn_preloader,ht as vviinn_privacy_badge,wt as vviinn_product_card,yt as vviinn_server_error,kt as vviinn_slide,_t as vviinn_slider,Ct as vviinn_teaser,jt as vviinn_vps_widget,Et as vviinn_wrong_format}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { B as BUILD, c as consoleDevInfo, p as plt, w as win, H, d as doc, N as NAMESPACE, a as promiseResolve, b as bootstrapLazy } from './index-007af453.js';
|
|
2
|
+
import { g as globalScripts } from './app-globals-61fc820b.js';
|
|
3
|
+
|
|
4
|
+
/*
|
|
5
|
+
Stencil Client Patch Browser v2.9.0 | MIT Licensed | https://stenciljs.com
|
|
6
|
+
*/
|
|
7
|
+
const getDynamicImportFunction = (namespace) => `__sc_import_${namespace.replace(/\s|-/g, '_')}`;
|
|
8
|
+
const patchBrowser = () => {
|
|
9
|
+
// NOTE!! This fn cannot use async/await!
|
|
10
|
+
if (BUILD.isDev && !BUILD.isTesting) {
|
|
11
|
+
consoleDevInfo('Running in development mode.');
|
|
12
|
+
}
|
|
13
|
+
if (BUILD.cssVarShim) {
|
|
14
|
+
// shim css vars
|
|
15
|
+
plt.$cssShim$ = win.__cssshim;
|
|
16
|
+
}
|
|
17
|
+
if (BUILD.cloneNodeFix) {
|
|
18
|
+
// opted-in to polyfill cloneNode() for slot polyfilled components
|
|
19
|
+
patchCloneNodeFix(H.prototype);
|
|
20
|
+
}
|
|
21
|
+
if (BUILD.profile && !performance.mark) {
|
|
22
|
+
// not all browsers support performance.mark/measure (Safari 10)
|
|
23
|
+
performance.mark = performance.measure = () => {
|
|
24
|
+
/*noop*/
|
|
25
|
+
};
|
|
26
|
+
performance.getEntriesByName = () => [];
|
|
27
|
+
}
|
|
28
|
+
// @ts-ignore
|
|
29
|
+
const scriptElm = BUILD.scriptDataOpts || BUILD.safari10 || BUILD.dynamicImportShim
|
|
30
|
+
? Array.from(doc.querySelectorAll('script')).find((s) => new RegExp(`\/${NAMESPACE}(\\.esm)?\\.js($|\\?|#)`).test(s.src) ||
|
|
31
|
+
s.getAttribute('data-stencil-namespace') === NAMESPACE)
|
|
32
|
+
: null;
|
|
33
|
+
const importMeta = import.meta.url;
|
|
34
|
+
const opts = BUILD.scriptDataOpts ? scriptElm['data-opts'] || {} : {};
|
|
35
|
+
if (BUILD.safari10 && 'onbeforeload' in scriptElm && !history.scrollRestoration /* IS_ESM_BUILD */) {
|
|
36
|
+
// Safari < v11 support: This IF is true if it's Safari below v11.
|
|
37
|
+
// This fn cannot use async/await since Safari didn't support it until v11,
|
|
38
|
+
// however, Safari 10 did support modules. Safari 10 also didn't support "nomodule",
|
|
39
|
+
// so both the ESM file and nomodule file would get downloaded. Only Safari
|
|
40
|
+
// has 'onbeforeload' in the script, and "history.scrollRestoration" was added
|
|
41
|
+
// to Safari in v11. Return a noop then() so the async/await ESM code doesn't continue.
|
|
42
|
+
// IS_ESM_BUILD is replaced at build time so this check doesn't happen in systemjs builds.
|
|
43
|
+
return {
|
|
44
|
+
then() {
|
|
45
|
+
/* promise noop */
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
if (!BUILD.safari10 && importMeta !== '') {
|
|
50
|
+
opts.resourcesUrl = new URL('.', importMeta).href;
|
|
51
|
+
}
|
|
52
|
+
else if (BUILD.dynamicImportShim || BUILD.safari10) {
|
|
53
|
+
opts.resourcesUrl = new URL('.', new URL(scriptElm.getAttribute('data-resources-url') || scriptElm.src, win.location.href)).href;
|
|
54
|
+
if (BUILD.dynamicImportShim) {
|
|
55
|
+
patchDynamicImport(opts.resourcesUrl, scriptElm);
|
|
56
|
+
}
|
|
57
|
+
if (BUILD.dynamicImportShim && !win.customElements) {
|
|
58
|
+
// module support, but no custom elements support (Old Edge)
|
|
59
|
+
// @ts-ignore
|
|
60
|
+
return import(/* webpackChunkName: "polyfills-dom" */ './dom-db0073f0.js').then(() => opts);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return promiseResolve(opts);
|
|
64
|
+
};
|
|
65
|
+
const patchDynamicImport = (base, orgScriptElm) => {
|
|
66
|
+
const importFunctionName = getDynamicImportFunction(NAMESPACE);
|
|
67
|
+
try {
|
|
68
|
+
// test if this browser supports dynamic imports
|
|
69
|
+
// There is a caching issue in V8, that breaks using import() in Function
|
|
70
|
+
// By generating a random string, we can workaround it
|
|
71
|
+
// Check https://bugs.chromium.org/p/chromium/issues/detail?id=990810 for more info
|
|
72
|
+
win[importFunctionName] = new Function('w', `return import(w);//${Math.random()}`);
|
|
73
|
+
}
|
|
74
|
+
catch (e) {
|
|
75
|
+
// this shim is specifically for browsers that do support "esm" imports
|
|
76
|
+
// however, they do NOT support "dynamic" imports
|
|
77
|
+
// basically this code is for old Edge, v18 and below
|
|
78
|
+
const moduleMap = new Map();
|
|
79
|
+
win[importFunctionName] = (src) => {
|
|
80
|
+
const url = new URL(src, base).href;
|
|
81
|
+
let mod = moduleMap.get(url);
|
|
82
|
+
if (!mod) {
|
|
83
|
+
const script = doc.createElement('script');
|
|
84
|
+
script.type = 'module';
|
|
85
|
+
script.crossOrigin = orgScriptElm.crossOrigin;
|
|
86
|
+
script.src = URL.createObjectURL(new Blob([`import * as m from '${url}'; window.${importFunctionName}.m = m;`], {
|
|
87
|
+
type: 'application/javascript',
|
|
88
|
+
}));
|
|
89
|
+
mod = new Promise((resolve) => {
|
|
90
|
+
script.onload = () => {
|
|
91
|
+
resolve(win[importFunctionName].m);
|
|
92
|
+
script.remove();
|
|
93
|
+
};
|
|
94
|
+
});
|
|
95
|
+
moduleMap.set(url, mod);
|
|
96
|
+
doc.head.appendChild(script);
|
|
97
|
+
}
|
|
98
|
+
return mod;
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
const patchCloneNodeFix = (HTMLElementPrototype) => {
|
|
103
|
+
const nativeCloneNodeFn = HTMLElementPrototype.cloneNode;
|
|
104
|
+
HTMLElementPrototype.cloneNode = function (deep) {
|
|
105
|
+
if (this.nodeName === 'TEMPLATE') {
|
|
106
|
+
return nativeCloneNodeFn.call(this, deep);
|
|
107
|
+
}
|
|
108
|
+
const clonedNode = nativeCloneNodeFn.call(this, false);
|
|
109
|
+
const srcChildNodes = this.childNodes;
|
|
110
|
+
if (deep) {
|
|
111
|
+
for (let i = 0; i < srcChildNodes.length; i++) {
|
|
112
|
+
// Node.ATTRIBUTE_NODE === 2, and checking because IE11
|
|
113
|
+
if (srcChildNodes[i].nodeType !== 2) {
|
|
114
|
+
clonedNode.appendChild(srcChildNodes[i].cloneNode(true));
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
return clonedNode;
|
|
119
|
+
};
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
patchBrowser().then(options => {
|
|
123
|
+
globalScripts();
|
|
124
|
+
return bootstrapLazy([["vviinn-vps-widget",[[1,"vviinn-vps-widget",{"token":[1],"apiPath":[1,"api-path"],"active":[1028],"currencySign":[1,"currency-sign"],"locale":[1],"campaignId":[1,"campaign-id"],"slidePosition":[32],"width":[32],"wrongImageFormat":[32]},[[0,"recommendationView","trackRecommendationView"],[0,"recommendationClick","trackRecommendationClick"],[0,"cropperChanged","trachSearchAreaChanges"],[0,"detectedObjectClicked","trackDetectedObject"],[0,"filterSelected","trackFilter"]]]]],["vviinn-vps-button",[[1,"vviinn-vps-button",{"token":[1],"currencySign":[1,"currency-sign"],"locale":[1],"campaignId":[1,"campaign-id"],"apiPath":[1,"api-path"],"pressed":[32]},[[0,"modalClosed","handleModalClosed"]]]]],["vviinn-recommendations-sidebar",[[1,"vviinn-recommendations-sidebar",{"sidebarTitle":[1,"sidebar-title"],"token":[1],"productId":[1,"product-id"],"position":[1],"sourceImage":[1,"source-image"],"widgetScrollbar":[4,"widget-scrollbar"],"campaigns":[1],"state":[32]},[[16,"click","bodyClickListener"]]]]],["vviinn-vpr-button",[[1,"vviinn-vpr-button",{"token":[1],"productId":[1,"product-id"],"position":[1],"sourceImage":[1,"source-image"],"sidebarTitle":[1,"sidebar-title"],"modalScrollbar":[4,"modal-scrollbar"],"campaigns":[1]}]]],["vviinn-image-view",[[1,"vviinn-image-view"]]],["vviinn-onboarding",[[1,"vviinn-onboarding"]]],["vviinn-example-images",[[1,"vviinn-example-images",null,[[0,"exampleImageSelected","handleImageSelection"],[0,"exampleImageError","handleImageSelectionError"]]]]],["vviinn-overlayed-modal",[[1,"vviinn-overlayed-modal",{"active":[4]}]]],["vviinn-vpr-widget",[[1,"vviinn-vpr-widget",{"blockTitle":[1,"block-title"],"imageRatio":[2,"image-ratio"],"imageWidth":[2,"image-width"],"productId":[1,"product-id"],"token":[1],"currencySign":[1,"currency-sign"],"pricePrefix":[1,"price-prefix"],"mode":[1],"campaignType":[1,"campaign-type"],"locale":[1],"campaigns":[1],"apiPath":[1,"api-path"],"useCarousel":[4,"use-carousel"],"showScroll":[4,"show-scroll"],"cssUrl":[1,"css-url"],"recommendations":[32],"loaded":[32]},[[0,"productImageLoaded","handleImageLoading"],[0,"recommendationView","trackRecommendationView"],[0,"recommendationClick","trackRecommendationClick"]]]]],["vviinn-empty-results",[[1,"vviinn-empty-results"]]],["vviinn-image-selector",[[1,"vviinn-image-selector"]]],["vviinn-server-error",[[1,"vviinn-server-error"]]],["vviinn-wrong-format",[[1,"vviinn-wrong-format"]]],["search-filters",[[1,"search-filters",{"filter":[16],"selectedCategoryId":[32],"hideFilters":[32]}]]],["vviinn-privacy-badge",[[1,"vviinn-privacy-badge"]]],["vviinn-teaser",[[1,"vviinn-teaser"]]],["image-cropper",[[1,"image-cropper",{"disabled":[4],"handleMove":[32]}]]],["vviinn-carousel",[[0,"vviinn-carousel",{"mode":[1],"imageWidth":[2,"image-width"],"showScroll":[4,"show-scroll"],"recommendations":[16],"moveDirection":[32],"contentGroups":[32],"activeContentGroup":[32]}]]],["vviinn-example-image",[[1,"vviinn-example-image",{"src":[1],"width":[2],"height":[2],"selected":[32]}]]],["highlight-box",[[1,"highlight-box"]]],["vviinn-detected-object",[[1,"vviinn-detected-object",{"detectedObject":[16],"position":[32]}]]],["vviinn-modal",[[1,"vviinn-modal",{"active":[1540],"slider":[32]}]]],["vviinn-onboarding-card-1",[[1,"vviinn-onboarding-card-1"]]],["vviinn-onboarding-card-2",[[1,"vviinn-onboarding-card-2"]]],["vviinn-onboarding-card-3",[[1,"vviinn-onboarding-card-3"]]],["vviinn-overlay",[[1,"vviinn-overlay"]]],["vviinn-slide",[[1,"vviinn-slide"]]],["vviinn-slider",[[1,"vviinn-slider",{"showBullets":[4,"show-bullets"],"position":[514],"showArrows":[4,"show-arrows"],"elementsCount":[32],"internalPosition":[32],"swipeStartPosition":[32]}]]],["cropper-handler",[[1,"cropper-handler",{"handler":[16],"disabled":[4]}]]],["vviinn-error",[[1,"vviinn-error"]]],["vviinn-preloader",[[1,"vviinn-preloader"]]],["vviinn-product-card",[[1,"vviinn-product-card",{"brand":[1],"currency":[1],"deeplink":[1],"image":[1],"imageRatio":[2,"image-ratio"],"imageWidth":[2,"image-width"],"locale":[1],"price":[2],"pricePrefix":[1,"price-prefix"],"productId":[1,"product-id"],"productTitle":[1,"product-title"],"productType":[1,"product-type"],"salePrice":[2,"sale-price"],"responsive":[4],"dimmedBackground":[4,"dimmed-background"],"index":[2],"imageLoaded":[32]}]]]], options);
|
|
125
|
+
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,b as i}from"./p-4e55513e.js";import{g as a}from"./p-66015ad7.js";(()=>{const i=import.meta.url,a={};return""!==i&&(a.resourcesUrl=new URL(".",i).href),e(a)})().then((e=>(a(),i([["p-
|
|
1
|
+
import{p as e,b as i}from"./p-4e55513e.js";import{g as a}from"./p-66015ad7.js";(()=>{const i=import.meta.url,a={};return""!==i&&(a.resourcesUrl=new URL(".",i).href),e(a)})().then((e=>(a(),i([["p-5aca8be2",[[1,"vviinn-vps-widget",{token:[1],apiPath:[1,"api-path"],active:[1028],currencySign:[1,"currency-sign"],locale:[1],campaignId:[1,"campaign-id"],slidePosition:[32],width:[32],wrongImageFormat:[32]},[[0,"recommendationView","trackRecommendationView"],[0,"recommendationClick","trackRecommendationClick"],[0,"cropperChanged","trachSearchAreaChanges"],[0,"detectedObjectClicked","trackDetectedObject"],[0,"filterSelected","trackFilter"]]],[1,"vviinn-image-view"],[1,"vviinn-onboarding"],[1,"vviinn-example-images",null,[[0,"exampleImageSelected","handleImageSelection"],[0,"exampleImageError","handleImageSelectionError"]]],[1,"vviinn-overlayed-modal",{active:[4]}],[1,"vviinn-empty-results"],[1,"vviinn-image-selector"],[1,"vviinn-server-error"],[1,"vviinn-wrong-format"],[1,"search-filters",{filter:[16],selectedCategoryId:[32],hideFilters:[32]}],[1,"vviinn-privacy-badge"],[1,"vviinn-teaser"],[1,"image-cropper",{disabled:[4],handleMove:[32]}],[1,"vviinn-example-image",{src:[1],width:[2],height:[2],selected:[32]}],[1,"highlight-box"],[1,"vviinn-detected-object",{detectedObject:[16],position:[32]}],[1,"vviinn-modal",{active:[1540],slider:[32]}],[1,"vviinn-onboarding-card-1"],[1,"vviinn-onboarding-card-2"],[1,"vviinn-onboarding-card-3"],[1,"vviinn-overlay"],[1,"vviinn-slide"],[1,"vviinn-slider",{showBullets:[4,"show-bullets"],position:[514],showArrows:[4,"show-arrows"],elementsCount:[32],internalPosition:[32],swipeStartPosition:[32]}],[1,"cropper-handler",{handler:[16],disabled:[4]}],[1,"vviinn-error"],[1,"vviinn-preloader"],[1,"vviinn-product-card",{brand:[1],currency:[1],deeplink:[1],image:[1],imageRatio:[2,"image-ratio"],imageWidth:[2,"image-width"],locale:[1],price:[2],pricePrefix:[1,"price-prefix"],productId:[1,"product-id"],productTitle:[1,"product-title"],productType:[1,"product-type"],salePrice:[2,"sale-price"],responsive:[4],dimmedBackground:[4,"dimmed-background"],index:[2],imageLoaded:[32]}]]],["p-e32c30d4",[[1,"vviinn-vps-button",{token:[1],currencySign:[1,"currency-sign"],locale:[1],campaignId:[1,"campaign-id"],apiPath:[1,"api-path"],pressed:[32]},[[0,"modalClosed","handleModalClosed"]]]]],["p-c1cd51ef",[[1,"vviinn-vpr-widget",{blockTitle:[1,"block-title"],imageRatio:[2,"image-ratio"],imageWidth:[2,"image-width"],productId:[1,"product-id"],token:[1],currencySign:[1,"currency-sign"],pricePrefix:[1,"price-prefix"],mode:[1],campaignType:[1,"campaign-type"],locale:[1],campaigns:[1],apiPath:[1,"api-path"],useCarousel:[4,"use-carousel"],showScroll:[4,"show-scroll"],cssUrl:[1,"css-url"],recommendations:[32],loaded:[32]},[[0,"productImageLoaded","handleImageLoading"],[0,"recommendationView","trackRecommendationView"],[0,"recommendationClick","trackRecommendationClick"]]],[0,"vviinn-carousel",{mode:[1],imageWidth:[2,"image-width"],showScroll:[4,"show-scroll"],recommendations:[16],moveDirection:[32],contentGroups:[32],activeContentGroup:[32]}]]],["p-5358970c",[[1,"vviinn-recommendations-sidebar",{sidebarTitle:[1,"sidebar-title"],token:[1],productId:[1,"product-id"],position:[1],sourceImage:[1,"source-image"],widgetScrollbar:[4,"widget-scrollbar"],campaigns:[1],state:[32]},[[16,"click","bodyClickListener"]]]]],["p-8080679b",[[1,"vviinn-vpr-button",{token:[1],productId:[1,"product-id"],position:[1],sourceImage:[1,"source-image"],sidebarTitle:[1,"sidebar-title"],modalScrollbar:[4,"modal-scrollbar"],campaigns:[1]}]]]],e))));
|
package/www/index.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!doctype html><html dir="ltr" lang="en"><head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0"> <title>Stencil Component Starter</title> <link rel="preconnect" href="https://cdn.vviinn.com"> <link rel="preconnect" href="https://d1rgjmn2wmqeif.cloudfront.net"> <link rel="modulepreload" href="/build/p-
|
|
1
|
+
<!doctype html><html dir="ltr" lang="en"><head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=5.0"> <title>Stencil Component Starter</title> <link rel="preconnect" href="https://cdn.vviinn.com"> <link rel="preconnect" href="https://d1rgjmn2wmqeif.cloudfront.net"> <link rel="modulepreload" href="/build/p-f6566a1f.js"><script type="module" src="/build/p-f6566a1f.js" data-stencil data-resources-url="/build/" data-stencil-namespace="vviinn-widgets"></script> <script nomodule="" src="/build/vviinn-widgets.js" data-stencil></script> <link rel="preconnect" href="https://fonts.googleapis.com"> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin=""> <link href="https://fonts.googleapis.com/css2?family=Lato:wght@300;400&display=swap" rel="stylesheet"> </head> <body> <vviinn-vps-widget active="true" token="eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOjgzLCJqdGkiOiI3ZTg2Y2I1YS00ZTFjLTRhYjctYjU2My1lN2FjMTYzZTYyZDIiLCJzY29wZXMiOlsidnByIiwidnBzIiwidnBjIl19.SbaQnBkvoXer3GPCWUthFQStFKLHZNMBfj4Qu44WHM8nzaIt48I74yVy4gVbX29vtd6jIkDPdakqEXRXmAxOCtv7_nsd4iBs1yMegfOWW5g8f10PKfZqmWJcfhwKIEElnUMFmP6rXpogntZ7iFfeTBbiRNzQPhkaa7jUjgQkCC4" product-id="FEX1005" block-title="" mode="grid" show-scroll="false" css-url="https://storage.googleapis.com/aiaas-merchant-assets/production/105/css/1169b48d-6f9f-4304-b452-c223a9bacaac.css"></vviinn-vps-widget> </body></html>
|
package/www/build/p-a67898be.css
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
:host{--color-primary-system:#0F62FE;--color-primary-hover-system:#014CDA;--color-icons-system:#2F8EDF;--spacer:8px}
|
package/www/build/p-eb8f77e4.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{p as e,b as i}from"./p-08554796.js";import{g as a}from"./p-5ba70c0e.js";(()=>{const i=import.meta.url,a={};return""!==i&&(a.resourcesUrl=new URL(".",i).href),e(a)})().then((e=>(a(),i([["p-d6406d31",[[1,"vviinn-vps-widget",{token:[1],apiPath:[1,"api-path"],active:[1028],currencySign:[1,"currency-sign"],locale:[1],campaignId:[1,"campaign-id"],slidePosition:[32],width:[32],wrongImageFormat:[32]},[[0,"recommendationView","trackRecommendationView"],[0,"recommendationClick","trackRecommendationClick"],[0,"cropperChanged","trachSearchAreaChanges"],[0,"detectedObjectClicked","trackDetectedObject"],[0,"filterSelected","trackFilter"]]],[1,"vviinn-image-view"],[1,"vviinn-onboarding"],[1,"vviinn-example-images",null,[[0,"exampleImageSelected","handleImageSelection"],[0,"exampleImageError","handleImageSelectionError"]]],[1,"vviinn-overlayed-modal",{active:[4]}],[1,"vviinn-empty-results"],[1,"vviinn-image-selector"],[1,"vviinn-server-error"],[1,"vviinn-wrong-format"],[1,"search-filters",{filter:[16],selectedCategoryId:[32],hideFilters:[32]}],[1,"vviinn-privacy-badge"],[1,"vviinn-teaser"],[1,"image-cropper",{disabled:[4],handleMove:[32]}],[1,"vviinn-example-image",{src:[1],width:[2],height:[2],selected:[32]}],[1,"highlight-box"],[1,"vviinn-detected-object",{detectedObject:[16],position:[32]}],[1,"vviinn-modal",{active:[1540],slider:[32]}],[1,"vviinn-onboarding-card-1"],[1,"vviinn-onboarding-card-2"],[1,"vviinn-onboarding-card-3"],[1,"vviinn-overlay"],[1,"vviinn-slide"],[1,"vviinn-slider",{showBullets:[4,"show-bullets"],position:[514],showArrows:[4,"show-arrows"],elementsCount:[32],internalPosition:[32],swipeStartPosition:[32]}],[1,"cropper-handler",{handler:[16],disabled:[4]}],[1,"vviinn-error"],[1,"vviinn-preloader"],[1,"vviinn-product-card",{brand:[1],currency:[1],deeplink:[1],image:[1],imageRatio:[2,"image-ratio"],imageWidth:[2,"image-width"],locale:[1],price:[2],pricePrefix:[1,"price-prefix"],productId:[1,"product-id"],productTitle:[1,"product-title"],productType:[1,"product-type"],salePrice:[2,"sale-price"],responsive:[4],dimmedBackground:[4,"dimmed-background"],index:[2],imageLoaded:[32]}]]],["p-fef6d9f8",[[1,"vviinn-vps-button",{token:[1],currencySign:[1,"currency-sign"],locale:[1],campaignId:[1,"campaign-id"],apiPath:[1,"api-path"],pressed:[32]},[[0,"modalClosed","handleModalClosed"]]]]],["p-8df4a2e6",[[1,"vviinn-vpr-widget",{blockTitle:[1,"block-title"],imageRatio:[2,"image-ratio"],imageWidth:[2,"image-width"],productId:[1,"product-id"],token:[1],currencySign:[1,"currency-sign"],pricePrefix:[1,"price-prefix"],mode:[1],campaignType:[1,"campaign-type"],locale:[1],campaigns:[1],apiPath:[1,"api-path"],useCarousel:[4,"use-carousel"],showScroll:[4,"show-scroll"],cssUrl:[1,"css-url"],recommendations:[32],loaded:[32]},[[0,"productImageLoaded","handleImageLoading"],[0,"recommendationView","trackRecommendationView"],[0,"recommendationClick","trackRecommendationClick"]]],[0,"vviinn-carousel",{mode:[1],imageWidth:[2,"image-width"],showScroll:[4,"show-scroll"],recommendations:[16],moveDirection:[32],contentGroups:[32],activeContentGroup:[32]}]]],["p-97a86126",[[1,"vviinn-recommendations-sidebar",{sidebarTitle:[1,"sidebar-title"],token:[1],productId:[1,"product-id"],position:[1],sourceImage:[1,"source-image"],widgetScrollbar:[4,"widget-scrollbar"],campaigns:[1],state:[32]},[[16,"click","bodyClickListener"]]]]],["p-6f5f6232",[[1,"vviinn-vpr-button",{token:[1],productId:[1,"product-id"],position:[1],sourceImage:[1,"source-image"],sidebarTitle:[1,"sidebar-title"],modalScrollbar:[4,"modal-scrollbar"],campaigns:[1]}]]]],e))));
|