vviinn-widgets 2.4.1 → 2.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/dist/cjs/{app-globals-324e9cd0.js → app-globals-d999d944.js} +1 -1
  2. package/dist/cjs/cropper-handler_27.cjs.entry.js +5 -5
  3. package/dist/cjs/{customized-slots-703cd28d.js → customized-slots-90e8e849.js} +1 -1
  4. package/dist/cjs/{index-6078b9e5.js → index-53400160.js} +1 -1
  5. package/dist/cjs/{index-a00145c0.js → index-c0d08aca.js} +1 -1
  6. package/dist/cjs/{index-a821350a.js → index-e8cf5dc5.js} +1 -1
  7. package/dist/cjs/loader.cjs.js +2 -2
  8. package/dist/cjs/vviinn-carousel_2.cjs.entry.js +6 -6
  9. package/dist/cjs/vviinn-recommendations-sidebar.cjs.entry.js +2 -2
  10. package/dist/cjs/vviinn-vpr-button.cjs.entry.js +2 -2
  11. package/dist/cjs/vviinn-vps-button.cjs.entry.js +3 -3
  12. package/dist/cjs/vviinn-widgets.cjs.js +2 -2
  13. package/dist/collection/components/vviinn-carousel/vviinn-carousel.js +3 -3
  14. package/dist/collection/components/vviinn-example-images/vviinn-example-images.js +4 -4
  15. package/dist/esm/{app-globals-02b550a1.js → app-globals-f91c6f94.js} +1 -1
  16. package/dist/esm/cropper-handler_27.entry.js +5 -5
  17. package/dist/esm/{customized-slots-472f6e69.js → customized-slots-7be7f3b8.js} +1 -1
  18. package/dist/esm/{index-711602a5.js → index-00c7b7c2.js} +1 -1
  19. package/dist/esm/{index-26769494.js → index-840ec915.js} +1 -1
  20. package/dist/esm/{index-b908268d.js → index-d7147986.js} +1 -1
  21. package/dist/esm/loader.js +2 -2
  22. package/dist/esm/vviinn-carousel_2.entry.js +6 -6
  23. package/dist/esm/vviinn-recommendations-sidebar.entry.js +2 -2
  24. package/dist/esm/vviinn-vpr-button.entry.js +2 -2
  25. package/dist/esm/vviinn-vps-button.entry.js +3 -3
  26. package/dist/esm/vviinn-widgets.js +2 -2
  27. package/dist/vviinn-widgets/{p-4a7d9763.entry.js → p-07d8ba79.entry.js} +1 -1
  28. package/dist/vviinn-widgets/{p-817158df.js → p-196479f9.js} +1 -1
  29. package/dist/vviinn-widgets/{p-70f54b8b.entry.js → p-2d4cb17f.entry.js} +1 -1
  30. package/dist/vviinn-widgets/{p-e031c06c.js → p-7d5af04d.js} +1 -1
  31. package/dist/vviinn-widgets/{p-4fb28a11.entry.js → p-9c7297c8.entry.js} +1 -1
  32. package/dist/vviinn-widgets/{p-13842a39.js → p-a66512b2.js} +1 -1
  33. package/{www/build/p-19b7a59e.entry.js → dist/vviinn-widgets/p-ae524f97.entry.js} +1 -1
  34. package/{www/build/p-cd711bcd.js → dist/vviinn-widgets/p-ce96f232.js} +1 -1
  35. package/dist/vviinn-widgets/{p-ee679114.js → p-dc2da207.js} +1 -1
  36. package/dist/vviinn-widgets/p-fce4183d.entry.js +1 -0
  37. package/dist/vviinn-widgets/vviinn-widgets.esm.js +1 -1
  38. package/package.json +1 -1
  39. package/www/build/{p-4a7d9763.entry.js → p-07d8ba79.entry.js} +1 -1
  40. package/www/build/{p-817158df.js → p-196479f9.js} +1 -1
  41. package/www/build/{p-70f54b8b.entry.js → p-2d4cb17f.entry.js} +1 -1
  42. package/www/build/p-32bb0615.js +1 -0
  43. package/www/build/{p-e031c06c.js → p-7d5af04d.js} +1 -1
  44. package/www/build/{p-4fb28a11.entry.js → p-9c7297c8.entry.js} +1 -1
  45. package/www/build/{p-13842a39.js → p-a66512b2.js} +1 -1
  46. package/www/build/p-a67898be.css +1 -0
  47. package/{dist/vviinn-widgets/p-19b7a59e.entry.js → www/build/p-ae524f97.entry.js} +1 -1
  48. package/{dist/vviinn-widgets/p-cd711bcd.js → www/build/p-ce96f232.js} +1 -1
  49. package/www/build/{p-ee679114.js → p-dc2da207.js} +1 -1
  50. package/www/build/p-fce4183d.entry.js +1 -0
  51. package/www/build/vviinn-widgets.esm.js +1 -1
  52. package/www/index.html +1 -1
  53. package/dist/vviinn-widgets/p-6715be5d.entry.js +0 -1
  54. package/www/build/p-6715be5d.entry.js +0 -1
  55. package/www/build/p-92df8b33.js +0 -125
  56. package/www/build/p-e0153ae2.css +0 -6
@@ -1 +0,0 @@
1
- import{r as t,h as i,H as s,g as r,c as e}from"./p-ee679114.js";import{B as n,_ as o,p as h,C as a,D as c,F as l,G as d,H as u,I as p,J as v,u as m,K as g,y as f,z as b,L as y,T as w,E as x,i as C}from"./p-817158df.js";import{e as _}from"./p-13842a39.js";let S=class{constructor(i){t(this,i),this.moveDirection="right",this.contentGroups=[],this.activeContentGroup=0,this.mode="continuity",this.imageWidth=140,this.showScroll=!0,this.recommendations=[],this.columns=0,this.resizeObserver=new ResizeObserver((()=>this.handleResize())),this.mutationObserver=new MutationObserver((()=>this.cloneSlottedContent()))}connectedCallback(){this.setItemWidth()}disconnectedCallback(){this.resizeObserver.disconnect()}componentDidLoad(){this.setWidth(),this.processScrollbarWidth(),this.columns=this.getColumnsNumber();const t=this.el.querySelector(".content");this.mutationObserver.observe(t,{subtree:!0,childList:!0}),this.resizeObserver.observe(this.getHostParent())}getItemWidthFromDocument(){return parseInt(getComputedStyle(document.body).getPropertyValue("--vviinn-carousel-image-width"))}setItemWidth(){const t=this.getItemWidthFromDocument(),i=isNaN(t)?this.imageWidth:t;this.el.style.setProperty("--vviinn-carousel-image-width",`${i}px`)}getContentClassMap(){return{content:!0,[this.moveDirection]:!0,[this.mode]:!0,"show-scrollbar":this.showScroll}}handleResize(){this.setWidth(),this.processScrollbarWidth(),this.setItemWidth();const t=this.getColumnsNumber();t!==this.columns&&(this.columns=t)}calculateMoveStep(){const t=this.getContent().map((t=>t.getBoundingClientRect().width));return t.reduce(((t,i)=>t+i),0)/t.length}getHostParent(){return this.el.parentNode.host.parentElement}setWidth(){const t=this.getHostParent();if(!t)return;const i=getComputedStyle(t),s=t.getBoundingClientRect().width-(parseInt(i["padding-right"])+parseInt(i["padding-left"]));this.el.style.setProperty("--vviinn-carousel-content-width",`${s}px`)}getParent(){return this.el.parentNode.host.parentElement}cloneSlottedContent(){this.setWidth()}getActiveGroupIndex(){var t,i;if(!(null===(i=null===(t=this.getContentNode())||void 0===t?void 0:t.getBoundingClientRect())||void 0===i?void 0:i.left))return 0;const s=this.getContentGroups().map((t=>t.getBoundingClientRect().left)).map(((t,i)=>[t,i])).filter((t=>t[0]>=0));return s.length>0?s[0][1]:0}getContentNode(){return this.el.querySelector(".content")}getContent(){const t=this.getContentNode().children;return Array.from(t).map((t=>t))}getColumnsNumber(){const t=getComputedStyle(this.el).getPropertyValue("--vviinn-carousel-columns-internal");return parseInt(t)}getContentGroups(){return Array.from(this.el.querySelectorAll(".items-group"))}showNext(){this.moveDirection="right";const t=this.getContentNode();requestAnimationFrame((()=>{t.scrollTo({top:0,left:t.scrollLeft+this.calculateMoveStep(),behavior:"smooth"})}))}showPrev(){this.moveDirection="left";const t=this.getContentNode();requestAnimationFrame((()=>{t.scrollTo({top:0,left:t.scrollLeft-this.calculateMoveStep(),behavior:"smooth"})}))}scroll(t){const i=this.getContentNode();requestAnimationFrame((()=>{i.scrollTo({top:0,left:this.calculateMoveStep()*t,behavior:"smooth"})}))}processScrollbarWidth(){const t=this.getContentNode();this.el.style.setProperty("--vviinn-progressbar-width",t.clientWidth*((t.scrollLeft+t.clientWidth)/t.scrollWidth)+"px"),this.activeContentGroup=this.getActiveGroupIndex()}showBullets(){return"grid"===this.mode&&this.showScroll}showScrollbar(){return"continuity"===this.mode&&this.showScroll}getClassMap(){return{[this.mode]:!0,"show-scrollbar":this.showScrollbar()}}renderRecommendation(t){return i("vviinn-product-card",{part:"product-part",productId:t.productId,productTitle:t.title,deeplink:t.deeplink,image:t.image.thumbnail,brand:t.brand,imageWidth:this.imageWidth,imageRatio:1,price:t.price.actual,salePrice:t.price.sale,responsive:"grid"===this.mode,dimmedBackground:"continuity"===this.mode})}renderRecommendationGroup(t){return i("div",{class:"items-group"},t)}renderRecommendationGroups(t){return t.map((t=>this.renderRecommendationGroup(t)))}renderRecommendations(){return"grid"===this.mode?this.renderGrid():this.renderRecommendationsElements()}renderRecommendationsElements(){return this.recommendations.map((t=>this.renderRecommendation(t)))}renderGrid(){const t=this.renderRecommendationsElements(),i=n.chunksOf(this.getColumnsNumber())(t);return this.renderRecommendationGroups(i)}renderBullets(){const t=Math.ceil(this.recommendations.length/this.getColumnsNumber());return Array.from(Array(t).keys()).map((t=>i("div",{class:{bullet:!0,active:this.activeContentGroup===t},onClick:()=>this.scroll(t)})))}render(){return i(s,{class:this.getClassMap()},i("div",{class:Object.assign({body:!0},this.getClassMap())},i("button",{class:"prev",onClick:()=>this.showPrev(),part:"carousel-button"},i(_,null)),i("div",{class:this.getContentClassMap(),onScroll:()=>this.processScrollbarWidth()},this.renderRecommendations()),i("button",{class:"next",onClick:()=>this.showNext(),part:"carousel-button"},i(_,null))),this.showBullets()?i("div",{class:"bullets"},this.renderBullets()):"")}get el(){return r(this)}};S.style=":host{--vviinn-progressbar-width:0;--vviinn-carousel-item-width:150px;--vviinn-carousel-columns-internal:var(--vviinn-carousel-columns, 4);--vviinn-carousel-image-width-system:140px}.body{display:flex;position:relative;width:var(--vviinn-carousel-content-width);flex-direction:column}.content-wrapper *{box-sizing:border-box}.content-wrapper{overflow-y:hidden;overflow-x:auto;flex-grow:1}.bullets{margin-top:16px;display:flex;flex-direction:row;grid-gap:24px;justify-content:center}.bullet{width:10px;height:10px;background:#E0E0E0;border-radius:50%;cursor:pointer}.bullet.active{background:#161616}.content:not(.show-scrollbar),.content.grid{scrollbar-color:#fff0 #fff0}.content:not(.show-scrollbar)::-webkit-scrollbar,.content.grid::-webkit-scrollbar{opacity:0}.content{display:flex;flex-direction:row;grid-gap:8px;-ms-scroll-snap-type:x mandatory;scroll-snap-type:x mandatory;overflow-y:hidden;overflow-x:auto;flex-grow:1;padding-bottom:16px}.content.left>*{scroll-snap-align:start}.content.right>*{scroll-snap-align:end}:host(.continuity) button{border-radius:2px}:host(.grid) button{border-radius:50%}button{align-items:center;background-color:white;border:none;box-shadow:0px 2px 6px rgba(0, 0, 0, 0.15);cursor:pointer;display:grid;height:40px;justify-items:center;position:absolute;top:calc(50% - 20px);width:40px;z-index:1;padding:0;margin:0}button{fill:#525252}button.prev svg{transform:rotate(180deg);margin-left:-5px}.prev{left:0}.next{right:0}.items-group{display:grid;grid-gap:16px;grid-template-columns:repeat(var(--vviinn-carousel-columns-internal), 1fr);min-width:100%}vviinn-product-card::part(price-container){text-align:center}:host(.classic) vviinn-product-card::part(title),:host(.classic) vviinn-product-card::part(brand),:host(.classic) vviinn-product-card::part(type){text-align:center}@media (max-width: 480px){:host(.modern) button{display:none}.items-group{grid-template-columns:repeat(2, 1fr)}}";const k=o.flow((t=>`Bearer ${t}`),(t=>new Headers({Authorization:t})),(t=>({headers:t}))),R=p(v),E=(t,i={})=>h(R(d(),u),l,a(c(t,i))),P=t=>i=>E(`product/${t}/similar-products`,i),A=t=>i=>E(`product/${t}/cross-selling-products`,i);function I(t){return"function"==typeof t}function j(t){const i=t((t=>{Error.call(t),t.stack=(new Error).stack}));return i.prototype=Object.create(Error.prototype),i.prototype.constructor=i,i}const D=j((t=>function(i){t(this),this.message=i?`${i.length} errors occurred during unsubscription:\n${i.map(((t,i)=>`${i+1}) ${t.toString()}`)).join("\n ")}`:"",this.name="UnsubscriptionError",this.errors=i}));function O(t,i){if(t){const s=t.indexOf(i);0<=s&&t.splice(s,1)}}class T{constructor(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}unsubscribe(){let t;if(!this.closed){this.closed=!0;const{_parentage:i}=this;if(i)if(this._parentage=null,Array.isArray(i))for(const t of i)t.remove(this);else i.remove(this);const{initialTeardown:s}=this;if(I(s))try{s()}catch(i){t=i instanceof D?i.errors:[i]}const{_finalizers:r}=this;if(r){this._finalizers=null;for(const i of r)try{$(i)}catch(i){t=null!=t?t:[],i instanceof D?t=[...t,...i.errors]:t.push(i)}}if(t)throw new D(t)}}add(t){var i;if(t&&t!==this)if(this.closed)$(t);else{if(t instanceof T){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=null!==(i=this._finalizers)&&void 0!==i?i:[]).push(t)}}_hasParent(t){const{_parentage:i}=this;return i===t||Array.isArray(i)&&i.includes(t)}_addParent(t){const{_parentage:i}=this;this._parentage=Array.isArray(i)?(i.push(t),i):i?[i,t]:t}_removeParent(t){const{_parentage:i}=this;i===t?this._parentage=null:Array.isArray(i)&&O(i,t)}remove(t){const{_finalizers:i}=this;i&&O(i,t),t instanceof T&&t._removeParent(this)}}T.EMPTY=(()=>{const t=new T;return t.closed=!0,t})();const z=T.EMPTY;function N(t){return t instanceof T||t&&"closed"in t&&I(t.remove)&&I(t.add)&&I(t.unsubscribe)}function $(t){I(t)?t():t.unsubscribe()}const W={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},B={setTimeout(t,i,...s){const{delegate:r}=B;return(null==r?void 0:r.setTimeout)?r.setTimeout(t,i,...s):setTimeout(t,i,...s)},clearTimeout(t){const{delegate:i}=B;return((null==i?void 0:i.clearTimeout)||clearTimeout)(t)},delegate:void 0};function F(){}const V=G("C",void 0,void 0);function G(t,i,s){return{kind:t,value:i,error:s}}function L(t){t()}class H extends T{constructor(t){super(),this.isStopped=!1,t?(this.destination=t,N(t)&&t.add(this)):this.destination=X}static create(t,i,s){return new J(t,i,s)}next(t){this.isStopped?Q(function(t){return G("N",t,void 0)}(t),this):this._next(t)}error(t){this.isStopped?Q(G("E",void 0,t),this):(this.isStopped=!0,this._error(t))}complete(){this.isStopped?Q(V,this):(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe(),this.destination=null)}_next(t){this.destination.next(t)}_error(t){try{this.destination.error(t)}finally{this.unsubscribe()}}_complete(){try{this.destination.complete()}finally{this.unsubscribe()}}}const M=Function.prototype.bind;function U(t,i){return M.call(t,i)}class q{constructor(t){this.partialObserver=t}next(t){const{partialObserver:i}=this;if(i.next)try{i.next(t)}catch(t){K(t)}}error(t){const{partialObserver:i}=this;if(i.error)try{i.error(t)}catch(t){K(t)}else K(t)}complete(){const{partialObserver:t}=this;if(t.complete)try{t.complete()}catch(t){K(t)}}}class J extends H{constructor(t,i,s){let r;if(super(),I(t)||!t)r={next:null!=t?t:void 0,error:null!=i?i:void 0,complete:null!=s?s:void 0};else{let i;this&&W.useDeprecatedNextContext?(i=Object.create(t),i.unsubscribe=()=>this.unsubscribe(),r={next:t.next&&U(t.next,i),error:t.error&&U(t.error,i),complete:t.complete&&U(t.complete,i)}):r=t}this.destination=new q(r)}}function K(t){var i;i=t,B.setTimeout((()=>{const{onUnhandledError:t}=W;if(!t)throw i;t(i)}))}function Q(t,i){const{onStoppedNotification:s}=W;s&&B.setTimeout((()=>s(t,i)))}const X={closed:!0,next:F,error:function(t){throw t},complete:F},Y="function"==typeof Symbol&&Symbol.observable||"@@observable";function Z(t){return t}class tt{constructor(t){t&&(this._subscribe=t)}lift(t){const i=new tt;return i.source=this,i.operator=t,i}subscribe(t,i,s){const r=(e=t)&&e instanceof H||function(t){return t&&I(t.next)&&I(t.error)&&I(t.complete)}(e)&&N(e)?t:new J(t,i,s);var e;return L((()=>{const{operator:t,source:i}=this;r.add(t?t.call(r,i):i?this._subscribe(r):this._trySubscribe(r))})),r}_trySubscribe(t){try{return this._subscribe(t)}catch(i){t.error(i)}}forEach(t,i){return new(i=it(i))(((i,s)=>{const r=new J({next:i=>{try{t(i)}catch(t){s(t),r.unsubscribe()}},error:s,complete:i});this.subscribe(r)}))}_subscribe(t){var i;return null===(i=this.source)||void 0===i?void 0:i.subscribe(t)}[Y](){return this}pipe(...t){return(0===(i=t).length?Z:1===i.length?i[0]:function(t){return i.reduce(((t,i)=>i(t)),t)})(this);var i}toPromise(t){return new(t=it(t))(((t,i)=>{let s;this.subscribe((t=>s=t),(t=>i(t)),(()=>t(s)))}))}}function it(t){var i;return null!==(i=null!=t?t:W.Promise)&&void 0!==i?i:Promise}tt.create=t=>new tt(t);const st=j((t=>function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}));class rt extends tt{constructor(){super(),this.closed=!1,this.currentObservers=null,this.observers=[],this.isStopped=!1,this.hasError=!1,this.thrownError=null}lift(t){const i=new et(this,this);return i.operator=t,i}_throwIfClosed(){if(this.closed)throw new st}next(t){L((()=>{if(this._throwIfClosed(),!this.isStopped){this.currentObservers||(this.currentObservers=Array.from(this.observers));for(const i of this.currentObservers)i.next(t)}}))}error(t){L((()=>{if(this._throwIfClosed(),!this.isStopped){this.hasError=this.isStopped=!0,this.thrownError=t;const{observers:i}=this;for(;i.length;)i.shift().error(t)}}))}complete(){L((()=>{if(this._throwIfClosed(),!this.isStopped){this.isStopped=!0;const{observers:t}=this;for(;t.length;)t.shift().complete()}}))}unsubscribe(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null}get observed(){var t;return(null===(t=this.observers)||void 0===t?void 0:t.length)>0}_trySubscribe(t){return this._throwIfClosed(),super._trySubscribe(t)}_subscribe(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)}_innerSubscribe(t){const{hasError:i,isStopped:s,observers:r}=this;return i||s?z:(this.currentObservers=null,r.push(t),new T((()=>{this.currentObservers=null,O(r,t)})))}_checkFinalizedStatuses(t){const{hasError:i,thrownError:s,isStopped:r}=this;i?t.error(s):r&&t.complete()}asObservable(){const t=new tt;return t.source=this,t}}rt.create=(t,i)=>new et(t,i);class et extends rt{constructor(t,i){super(),this.destination=t,this.source=i}next(t){var i,s;null===(s=null===(i=this.destination)||void 0===i?void 0:i.next)||void 0===s||s.call(i,t)}error(t){var i,s;null===(s=null===(i=this.destination)||void 0===i?void 0:i.error)||void 0===s||s.call(i,t)}complete(){var t,i;null===(i=null===(t=this.destination)||void 0===t?void 0:t.complete)||void 0===i||i.call(t)}_subscribe(t){var i,s;return null!==(s=null===(i=this.source)||void 0===i?void 0:i.subscribe(t))&&void 0!==s?s:z}}let nt=class{constructor(i){t(this,i),this.recommendationsLoaded=e(this,"recommendationsLoaded",7),this.blockTitle="Recommended products",this.imageRatio=1,this.imageWidth=300,this.currencySign="€",this.mode="continuity",this.campaignType="VPR",this.locale="de-DE",this.apiPath="https://api.vviinn.com",this.useCarousel=!0,this.showScroll=!0,this.cssUrl=null,this.recommendations=[],this.loaded=!1,this.productImageLoadedSubject=new rt}handleProductIdChange(){this.getRecommendations()}handleCampaignTypeChange(){this.getRecommendations()}handleApiPathChange(t){m.apiPath=t,this.getRecommendations()}handleImageLoading({detail:t}){this.productImageLoadedSubject.next(t)}trackRecommendationView({detail:t}){const i=g(Object.assign({session_id:this.uiSessionId},t));this.trackingApi.trackEvent(i)}trackRecommendationClick({detail:t}){const i=g(Object.assign({session_id:this.uiSessionId},t));this.trackingApi.trackEvent(i)}connectedCallback(){m.apiPath=this.apiPath,m.currencySign=this.currencySign,m.locale=this.locale,this.uiSessionId=f(),this.trackingApi=b(this.apiPath,this.token);const t=y({action:"open",session_id:this.uiSessionId});this.trackingApi.trackEvent(t)}disconnectedCallback(){const t=y({action:"close",session_id:this.uiSessionId});this.trackingApi.trackEvent(t)}async componentWillLoad(){m.pricePrefix=this.pricePrefix,m.currencySign=this.currencySign,this.getRecommendations()}async getRecommendations(){if(void 0===this.productId||void 0===this.token)return;const t=this.campaignType.length>0?this.campaignType:"VPR",i=k(this.token),s=o.pipe(w.of((t=>{return o.pipe("VPR"===t?{_tag:"VPR"}:{_tag:"VCS"},(i=()=>P,s=()=>A,t=>(t=>"VPR"===t._tag)(t)?i():s()));var i,s})(t)),w.ap(w.of(this.productId)),w.ap(w.of(i)),w.flatten),r=await s();o.pipe(r,x.fold((t=>this.handleError(t)),(t=>this.handleRecommendationsSucces(t))))}handleError(t){console.log("ERROR:",t)}handleRecommendationsSucces(t){var i;this.recommendations=null!==(i=null==t?void 0:t.extended)&&void 0!==i?i:t,C.results=this.recommendations,this.loaded=!0,this.productIds=this.recommendations.map((t=>t.productId)),this.productImageLoadedSubject.subscribe((t=>{this.productIds=this.productIds.filter((i=>i!==t)),0===this.productIds.length&&this.recommendationsLoaded.emit()}))}isExternalCSS(){return this.cssUrl&&this.cssUrl.length>0}renderExternalCSS(){return this.isExternalCSS()?i("link",{href:this.cssUrl,rel:"stylesheet"}):""}render(){return i(s,{class:{loaded:this.loaded,empty:0==this.recommendations.length,[this.mode]:!0},"aria-hidden":this.loaded?"false":"true"},this.renderExternalCSS(),i("style",null,m.fallbackStyles),i("h2",{part:"recommendations-title"},this.blockTitle),this.useCarousel?this.renderCarousel():this.renderResults())}renderRecommendation(t,s){return i("vviinn-product-card",{part:"product-part",productId:t.productId,productTitle:t.title,deeplink:t.deeplink,image:t.image.thumbnail,brand:t.brand,imageWidth:this.imageWidth,imageRatio:1,price:t.price.actual,salePrice:t.price.sale,responsive:"grid"===this.mode,dimmedBackground:this.useDimmedBackgroundInCard(),index:s})}useDimmedBackgroundInCard(){return"continuity"===this.mode||!this.useCarousel}renderResults(){return i("div",{class:"recommendations-grid",part:"recommendations-grid"},this.recommendations.map(((t,i)=>this.renderRecommendation(t,i))))}renderCarousel(){return i("vviinn-carousel",{mode:this.mode,imageWidth:this.imageWidth,showScroll:this.showScroll,recommendations:this.recommendations})}get el(){return r(this)}static get watchers(){return{productId:["handleProductIdChange"],campaignType:["handleCampaignTypeChange"],apiPath:["handleApiPathChange"]}}};nt.style=":host{display:grid;grid-gap:1rem;width:100%}:host(:not(.loaded)){position:absolute;visibility:hidden}:host(.grid) vviinn-product-card::part(image){border:1px solid #DDDDDD;width:100%}h2{margin:0}vviinn-product-card::part(price-container){align-self:flex-start;text-align:left;display:flex}.results{display:grid;grid-gap:1rem}.visually-hidden{position:absolute;top:0;left:0;z-index:-1;height:0;width:0}h2{margin:0}:host(.grid) h2{justify-content:center}:host(.grid) vviinn-product-card::part(image){min-width:100%}:host(.grid) vviinn-product-card::part(image-link){width:100%}:host(.grid) vviinn-product-card::part(title),:host(.grid) vviinn-product-card::part(brand),:host(.grid) vviinn-product-card::part(type){text-align:center}:host(.grid) vviinn-product-card::part(price-container){align-self:center}:host(.continuity) vviinn-product-card::part(title),:host(.continuity) vviinn-product-card::part(brand),:host(.continuity) vviinn-product-card::part(type),:host(.continuity) vviinn-product-card::part(deeplink){text-align:left;max-width:unset;align-self:start}";export{S as vviinn_carousel,nt as vviinn_vpr_widget}
@@ -1,125 +0,0 @@
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-31217ecc.js';
2
- import { g as globalScripts } from './app-globals-2be16a3a.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],"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],"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"],"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"]}]]],["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],"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,6 +0,0 @@
1
- :host {
2
- --color-primary-system: #0F62FE;
3
- --color-primary-hover-system: #014CDA;
4
- --color-icons-system: #2F8EDF;
5
- --spacer: 8px;
6
- }