vviinn-widgets 2.2.2 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (240) hide show
  1. package/dist/cjs/{app-globals-30781f30.js → app-globals-2bcc74df.js} +1 -1
  2. package/dist/cjs/cropper-handler.cjs.entry.js +1 -1
  3. package/dist/cjs/{customized-slots-5d904d8e.js → customized-slots-4202eaf5.js} +1 -1
  4. package/dist/cjs/highlight-box_22.cjs.entry.js +20 -10
  5. package/dist/cjs/{imageSearch.store-128957a4.js → imageSearch.store-cb2b2cc8.js} +14 -11
  6. package/dist/cjs/{index-c493804d.js → index-44fc16ad.js} +7 -9
  7. package/dist/cjs/{index-741a970d.js → index-6771ae25.js} +1 -1
  8. package/dist/cjs/index-e9439500.js +3943 -0
  9. package/dist/cjs/loader.cjs.js +3 -3
  10. package/dist/cjs/{vviinn-carousel_5.cjs.entry.js → vviinn-carousel_3.cjs.entry.js} +54 -108
  11. package/dist/cjs/vviinn-error.cjs.entry.js +1 -1
  12. package/dist/cjs/vviinn-preloader.cjs.entry.js +2 -2
  13. package/dist/cjs/vviinn-recommendations-sidebar.cjs.entry.js +63 -0
  14. package/dist/cjs/vviinn-vpr-button.cjs.entry.js +44 -0
  15. package/dist/cjs/vviinn-vps-button.cjs.entry.js +4 -4
  16. package/dist/cjs/vviinn-vps-widget.cjs.entry.js +74 -10
  17. package/dist/cjs/vviinn-widgets.cjs.js +3 -3
  18. package/dist/collection/components/image-search/image-view/image-cropper/image-cropper.js +27 -7
  19. package/dist/collection/components/image-search/search-filters/search-filters.js +24 -1
  20. package/dist/collection/components/vviinn-carousel/vviinn-carousel.css +4 -0
  21. package/dist/collection/components/vviinn-carousel/vviinn-carousel.js +6 -3
  22. package/dist/collection/components/vviinn-icons/index.js +6 -8
  23. package/dist/collection/components/vviinn-image-view/vviinn-detected-object/vviinn-detected-object.js +18 -1
  24. package/dist/collection/components/vviinn-product-card/stories/args.js +73 -0
  25. package/dist/collection/components/vviinn-product-card/stories/decorators.js +51 -0
  26. package/dist/collection/components/vviinn-product-card/stories/vviinn-product-card.stories.js +105 -0
  27. package/dist/collection/components/vviinn-product-card/vviinn-product-card.js +57 -12
  28. package/dist/collection/components/vviinn-vpr-button/stories/args.js +207 -0
  29. package/dist/collection/components/vviinn-vpr-button/stories/vviinn-vpr-button.stories.js +89 -0
  30. package/dist/collection/components/vviinn-vpr-button/vviinn-vpr-button.js +11 -4
  31. package/dist/collection/components/vviinn-vpr-widget/stories/args.js +190 -0
  32. package/dist/collection/components/vviinn-vpr-widget/stories/decorators.js +29 -0
  33. package/dist/collection/components/vviinn-vpr-widget/stories/vviinn-vpr-widget.stories.js +212 -0
  34. package/dist/collection/components/vviinn-vpr-widget/vviinn-vpr-vidget.js +47 -9
  35. package/dist/collection/components/vviinn-vpr-widget/vviinn-vpr-widget.css +5 -0
  36. package/dist/collection/components/vviinn-vps-button/stories/vviinn-vps-button.stories.js +31 -0
  37. package/dist/collection/components/vviinn-vps-button/vviinn-vps-button.css +3 -0
  38. package/dist/collection/components/vviinn-vps-widget/stories/vviinn-vps-widget.stories.js +33 -0
  39. package/dist/collection/components/vviinn-vps-widget/vviinn-vps-widget.js +108 -10
  40. package/dist/collection/network/utils.js +1 -1
  41. package/dist/collection/openApi/index.js +27 -0
  42. package/dist/collection/{components/vviinn-vpr-widget/GridMode.js → recommendation/events.js} +0 -0
  43. package/dist/collection/store/store.js +7 -9
  44. package/dist/collection/store/tracking.store.js +3 -0
  45. package/dist/collection/tracking/event.js +3 -0
  46. package/dist/collection/tracking/filter.js +5 -0
  47. package/dist/collection/tracking/index.js +13 -0
  48. package/dist/collection/tracking/models.js +6 -0
  49. package/dist/collection/tracking/product.js +18 -0
  50. package/dist/collection/tracking/search.js +5 -0
  51. package/dist/collection/tracking/widget.js +10 -0
  52. package/dist/esm/{app-globals-345e497d.js → app-globals-550daa9b.js} +1 -1
  53. package/dist/esm/cropper-handler.entry.js +1 -1
  54. package/dist/esm/{customized-slots-a76a8d41.js → customized-slots-80625933.js} +1 -1
  55. package/dist/esm/highlight-box_22.entry.js +20 -10
  56. package/dist/esm/{imageSearch.store-8eab0da1.js → imageSearch.store-1268786d.js} +12 -10
  57. package/dist/esm/{index-8cb063df.js → index-1cf740a8.js} +8 -10
  58. package/dist/esm/{index-6fa21e24.js → index-c09e56b6.js} +1 -1
  59. package/dist/esm/index-fa27f1df.js +3934 -0
  60. package/dist/esm/loader.js +3 -3
  61. package/dist/esm/{vviinn-carousel_5.entry.js → vviinn-carousel_3.entry.js} +55 -107
  62. package/dist/esm/vviinn-error.entry.js +1 -1
  63. package/dist/esm/vviinn-preloader.entry.js +2 -2
  64. package/dist/esm/vviinn-recommendations-sidebar.entry.js +59 -0
  65. package/dist/esm/vviinn-vpr-button.entry.js +40 -0
  66. package/dist/esm/vviinn-vps-button.entry.js +4 -4
  67. package/dist/esm/vviinn-vps-widget.entry.js +71 -7
  68. package/dist/esm/vviinn-widgets.js +3 -3
  69. package/dist/types/Image/error.d.ts +1 -0
  70. package/dist/types/Image/form.d.ts +1 -0
  71. package/dist/types/Image/fromFile.d.ts +1 -0
  72. package/dist/types/Image/imageToB64.d.ts +1 -0
  73. package/dist/types/Image/index.d.ts +1 -0
  74. package/dist/types/Image/renderPromise.d.ts +1 -0
  75. package/dist/types/Image/resizeImage.d.ts +1 -0
  76. package/dist/types/Image/sizing.d.ts +1 -0
  77. package/dist/types/Image/toFile.d.ts +1 -0
  78. package/dist/types/analytics/GAnalytics.d.ts +1 -0
  79. package/dist/types/analytics/GeneralAnalytics.d.ts +1 -0
  80. package/dist/types/analytics/GtagAnalytics.d.ts +1 -0
  81. package/dist/types/analytics/ProductAnalytics.d.ts +1 -0
  82. package/dist/types/campaign/Campaign.d.ts +1 -0
  83. package/dist/types/campaign/CampaignService.d.ts +1 -0
  84. package/dist/types/campaign/VCSCampaign.d.ts +1 -0
  85. package/dist/types/campaign/VCSCampaignResponse.d.ts +1 -0
  86. package/dist/types/campaign/VCSCampaignService.d.ts +1 -0
  87. package/dist/types/campaign/VPRCampaignResponse.d.ts +1 -0
  88. package/dist/types/campaign/VPRCampaignService.d.ts +1 -0
  89. package/dist/types/components/customized-slots.d.ts +1 -0
  90. package/dist/types/components/image-search/image-view/highlight-box/highlight-box.d.ts +1 -0
  91. package/dist/types/components/image-search/image-view/image-cropper/cropper-handler/cropper-handler.d.ts +1 -0
  92. package/dist/types/components/image-search/image-view/image-cropper/image-cropper.d.ts +4 -0
  93. package/dist/types/components/image-search/search-filters/search-filters.d.ts +4 -0
  94. package/dist/types/components/vviinn-carousel/vviinn-carousel.d.ts +4 -0
  95. package/dist/types/components/vviinn-error/vviinn-empty-results/vviinn-empty-results.d.ts +1 -0
  96. package/dist/types/components/vviinn-error/vviinn-error.d.ts +1 -0
  97. package/dist/types/components/vviinn-error/vviinn-server-error/vviinn-server-error.d.ts +1 -0
  98. package/dist/types/components/vviinn-error/vviinn-wrong-format/vviinn-wrong-format.d.ts +1 -0
  99. package/dist/types/components/vviinn-example-images/vviinn-example-image/vviinn-example-image.d.ts +1 -0
  100. package/dist/types/components/vviinn-example-images/vviinn-example-images.d.ts +1 -0
  101. package/dist/types/components/vviinn-icons/index.d.ts +1 -0
  102. package/dist/types/components/vviinn-image-selector/vviinn-image-selector.d.ts +1 -0
  103. package/dist/types/components/vviinn-image-view/vviinn-detected-object/vviinn-detected-object.d.ts +3 -0
  104. package/dist/types/components/vviinn-image-view/vviinn-image-view.d.ts +1 -0
  105. package/dist/types/components/vviinn-modal/vviinn-modal.d.ts +1 -0
  106. package/dist/types/components/vviinn-onboarding/onboarding-cards/vviinn-onboarding-card-1/vviinn-onboarding-card-1.d.ts +1 -0
  107. package/dist/types/components/vviinn-onboarding/onboarding-cards/vviinn-onboarding-card-2/vviinn-onboarding-card-2.d.ts +1 -0
  108. package/dist/types/components/vviinn-onboarding/onboarding-cards/vviinn-onboarding-card-3/vviinn-onboarding-card-3.d.ts +1 -0
  109. package/dist/types/components/vviinn-onboarding/vviinn-onboarding.d.ts +1 -0
  110. package/dist/types/components/vviinn-overlay/vviinn-overlay.d.ts +1 -0
  111. package/dist/types/components/vviinn-overlayed-modal/vviinn-overlayed-modal.d.ts +1 -0
  112. package/dist/types/components/vviinn-preloader/vviinn-preloader.d.ts +1 -0
  113. package/dist/types/components/vviinn-privacy-badge/vviinn-privacy-badge.d.ts +1 -0
  114. package/dist/types/components/vviinn-product-card/render-helpers.d.ts +1 -0
  115. package/dist/types/components/vviinn-product-card/stories/args.d.ts +74 -0
  116. package/dist/types/components/vviinn-product-card/stories/decorators.d.ts +2 -0
  117. package/dist/types/components/vviinn-product-card/stories/vviinn-product-card.stories.d.ts +81 -0
  118. package/dist/types/components/vviinn-product-card/vviinn-product-card.d.ts +9 -3
  119. package/dist/types/components/vviinn-slider/arrow.d.ts +1 -0
  120. package/dist/types/components/vviinn-slider/vviinn-slide/vviinn-slide.d.ts +1 -0
  121. package/dist/types/components/vviinn-slider/vviinn-slider.d.ts +1 -0
  122. package/dist/types/components/vviinn-teaser/vviinn-teaser.d.ts +1 -0
  123. package/dist/types/components/vviinn-vpr-button/recommendations-sidebar/recommendations-sidebar.d.ts +1 -0
  124. package/dist/types/components/vviinn-vpr-button/stories/args.d.ts +208 -0
  125. package/dist/types/components/vviinn-vpr-button/stories/vviinn-vpr-button.stories.d.ts +215 -0
  126. package/dist/types/components/vviinn-vpr-button/vviinn-vpr-button.d.ts +4 -0
  127. package/dist/types/components/vviinn-vpr-widget/stories/args.d.ts +199 -0
  128. package/dist/types/components/vviinn-vpr-widget/stories/decorators.d.ts +3 -0
  129. package/dist/types/components/vviinn-vpr-widget/stories/vviinn-vpr-widget.stories.d.ts +142 -0
  130. package/dist/types/components/vviinn-vpr-widget/token-helpers.d.ts +1 -0
  131. package/dist/types/components/vviinn-vpr-widget/vviinn-vpr-vidget.d.ts +10 -1
  132. package/dist/types/components/vviinn-vps-button/stories/vviinn-vps-button.stories.d.ts +13 -0
  133. package/dist/types/components/vviinn-vps-button/vviinn-vps-button.d.ts +1 -0
  134. package/dist/types/components/vviinn-vps-widget/stories/vviinn-vps-widget.stories.d.ts +11 -0
  135. package/dist/types/components/vviinn-vps-widget/vviinn-vps-widget.d.ts +14 -1
  136. package/dist/types/components.d.ts +10 -4
  137. package/dist/types/cropper/Cropper.d.ts +1 -0
  138. package/dist/types/cropper/Handler.d.ts +1 -0
  139. package/dist/types/dom/index.d.ts +1 -0
  140. package/dist/types/error.d.ts +1 -0
  141. package/dist/types/file/index.d.ts +1 -0
  142. package/dist/types/geometry/Clip.d.ts +1 -0
  143. package/dist/types/geometry/Point.d.ts +1 -0
  144. package/dist/types/geometry/Rectangle.d.ts +1 -0
  145. package/dist/types/geometry/RectangleAlt.d.ts +1 -0
  146. package/dist/types/geometry/Sized.d.ts +1 -0
  147. package/dist/types/global.d.ts +1 -0
  148. package/dist/types/index.d.ts +1 -0
  149. package/dist/types/interfaces/generated.d.ts +1 -0
  150. package/dist/types/interfaces/recommendation.d.ts +1 -0
  151. package/dist/types/network/apiClient.d.ts +1 -0
  152. package/dist/types/network/ion/File.d.ts +1 -0
  153. package/dist/types/network/ion/Form.d.ts +1 -0
  154. package/dist/types/network/ion/Link.d.ts +1 -0
  155. package/dist/types/network/ion/ValueObject.d.ts +1 -0
  156. package/dist/types/network/request.d.ts +1 -0
  157. package/dist/types/network/utils.d.ts +1 -0
  158. package/dist/types/openApi/index.d.ts +6 -0
  159. package/dist/types/recommendation/events.d.ts +6 -0
  160. package/dist/types/recommendation/recommendation.d.ts +1 -0
  161. package/dist/types/searchSession/searchSession.d.ts +1 -0
  162. package/dist/types/sentry.d.ts +1 -0
  163. package/dist/types/slider/GridMode.d.ts +1 -0
  164. package/dist/types/store/file-processing.d.ts +1 -0
  165. package/dist/types/store/imageSearch.store.d.ts +1 -0
  166. package/dist/types/store/store.d.ts +8 -6
  167. package/dist/types/store/tracking.store.d.ts +4 -0
  168. package/dist/types/stories/image-selector.stories.d.ts +1 -0
  169. package/dist/types/stories/image-view.stories.d.ts +1 -0
  170. package/dist/types/stories/modal.stories.d.ts +1 -0
  171. package/dist/types/stories/onboarding.stories.d.ts +1 -0
  172. package/dist/types/stories/overlay.stories.d.ts +1 -0
  173. package/dist/types/stories/overlayedModal.stories.d.ts +1 -0
  174. package/dist/types/stories/privacy-badge.stories.d.ts +1 -0
  175. package/dist/types/stories/slider.stories.d.ts +1 -0
  176. package/dist/types/stories/teaser.stories.d.ts +1 -0
  177. package/dist/types/stories/vps-widget.stories.d.ts +1 -0
  178. package/dist/types/stories/vviinn-product.stories.d.ts +1 -0
  179. package/dist/types/tracking/event.d.ts +4 -0
  180. package/dist/types/tracking/filter.d.ts +3 -0
  181. package/dist/types/tracking/index.d.ts +9 -0
  182. package/dist/types/tracking/models.d.ts +13 -0
  183. package/dist/types/tracking/product.d.ts +7 -0
  184. package/dist/types/tracking/search.d.ts +3 -0
  185. package/dist/types/tracking/widget.d.ts +5 -0
  186. package/dist/types/utils/collections/collectionsUtils.d.ts +1 -0
  187. package/dist/types/utils/either.d.ts +1 -0
  188. package/dist/types/utils/enum/enumUtils.d.ts +1 -0
  189. package/dist/types/utils/event/Events.d.ts +1 -0
  190. package/dist/types/utils/number/index.d.ts +1 -0
  191. package/dist/types/utils/option/option.d.ts +1 -0
  192. package/dist/types/utils/semigroup/semigroupDiff.d.ts +1 -0
  193. package/dist/types/utils/token/tokenUtils.d.ts +1 -0
  194. package/dist/vviinn-widgets/{p-78ccc9eb.js → p-07125f64.js} +1 -1
  195. package/dist/vviinn-widgets/{p-f47e82b2.entry.js → p-27ede517.entry.js} +1 -1
  196. package/dist/vviinn-widgets/{p-9d24f51e.entry.js → p-314e40b3.entry.js} +1 -1
  197. package/dist/vviinn-widgets/p-316abc01.js +1 -0
  198. package/dist/vviinn-widgets/{p-fb14e3cc.entry.js → p-4bdb3027.entry.js} +1 -1
  199. package/dist/vviinn-widgets/p-5535163a.entry.js +1 -0
  200. package/dist/vviinn-widgets/{p-59edfbe2.js → p-78b65f70.js} +1 -1
  201. package/dist/vviinn-widgets/{p-400eb62f.entry.js → p-86ae782f.entry.js} +1 -1
  202. package/dist/vviinn-widgets/p-89f2c19a.entry.js +1 -0
  203. package/dist/vviinn-widgets/{p-e1ba8626.js → p-8e25b838.js} +1 -1
  204. package/dist/vviinn-widgets/p-94aa8705.entry.js +1 -0
  205. package/dist/vviinn-widgets/{p-e67cae57.js → p-97af45f0.js} +1 -1
  206. package/dist/vviinn-widgets/p-c5e6ec4f.js +1 -0
  207. package/dist/vviinn-widgets/p-c63fb46b.entry.js +1 -0
  208. package/{www/build/p-d085199d.entry.js → dist/vviinn-widgets/p-dd7cac6e.entry.js} +1 -1
  209. package/dist/vviinn-widgets/vviinn-widgets.esm.js +1 -1
  210. package/package.json +11 -3
  211. package/www/build/{p-78ccc9eb.js → p-07125f64.js} +1 -1
  212. package/www/build/{p-f47e82b2.entry.js → p-27ede517.entry.js} +1 -1
  213. package/www/build/{p-9d24f51e.entry.js → p-314e40b3.entry.js} +1 -1
  214. package/www/build/p-316abc01.js +1 -0
  215. package/www/build/{p-fb14e3cc.entry.js → p-4bdb3027.entry.js} +1 -1
  216. package/www/build/p-5535163a.entry.js +1 -0
  217. package/www/build/{p-59edfbe2.js → p-78b65f70.js} +1 -1
  218. package/www/build/{p-400eb62f.entry.js → p-86ae782f.entry.js} +1 -1
  219. package/www/build/p-89f2c19a.entry.js +1 -0
  220. package/www/build/{p-e1ba8626.js → p-8e25b838.js} +1 -1
  221. package/www/build/p-94aa8705.entry.js +1 -0
  222. package/www/build/p-961822d3.js +125 -0
  223. package/www/build/{p-e67cae57.js → p-97af45f0.js} +1 -1
  224. package/www/build/p-c5e6ec4f.js +1 -0
  225. package/www/build/p-c63fb46b.entry.js +1 -0
  226. package/{dist/vviinn-widgets/p-d085199d.entry.js → www/build/p-dd7cac6e.entry.js} +1 -1
  227. package/www/build/p-e0153ae2.css +6 -0
  228. package/www/build/vviinn-widgets.esm.js +1 -1
  229. package/www/index.html +1 -177
  230. package/dist/collection/components/vviinn-vpr-button/stories/kek.stories.js +0 -18
  231. package/dist/types/components/vviinn-vpr-button/stories/kek.stories.d.ts +0 -7
  232. package/dist/types/components/vviinn-vpr-widget/GridMode.d.ts +0 -1
  233. package/dist/vviinn-widgets/p-04b06ea9.entry.js +0 -1
  234. package/dist/vviinn-widgets/p-56fc949a.js +0 -1
  235. package/dist/vviinn-widgets/p-e38f4aa2.entry.js +0 -1
  236. package/www/build/p-04b06ea9.entry.js +0 -1
  237. package/www/build/p-56fc949a.js +0 -1
  238. package/www/build/p-7e4978d5.js +0 -1
  239. package/www/build/p-a67898be.css +0 -1
  240. package/www/build/p-e38f4aa2.entry.js +0 -1
@@ -1,5 +1,5 @@
1
- import { p as promiseResolve, b as bootstrapLazy } from './index-6fa21e24.js';
2
- import { g as globalScripts } from './app-globals-345e497d.js';
1
+ import { p as promiseResolve, b as bootstrapLazy } from './index-c09e56b6.js';
2
+ import { g as globalScripts } from './app-globals-550daa9b.js';
3
3
 
4
4
  /*
5
5
  Stencil Client Patch Esm v2.9.0 | MIT Licensed | https://stenciljs.com
@@ -12,7 +12,7 @@ const defineCustomElements = (win, options) => {
12
12
  if (typeof window === 'undefined') return Promise.resolve();
13
13
  return patchEsm().then(() => {
14
14
  globalScripts();
15
- return bootstrapLazy([["cropper-handler",[[1,"cropper-handler",{"handler":[16],"disabled":[4]}]]],["vviinn-error",[[1,"vviinn-error"]]],["vviinn-preloader",[[1,"vviinn-preloader"]]],["vviinn-carousel_5",[[1,"vviinn-vpr-button",{"token":[1],"productId":[1,"product-id"],"position":[1],"sourceImage":[1,"source-image"],"sidebarTitle":[1,"sidebar-title"],"modalScrollbar":[4,"modal-scrollbar"]}],[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"]]],[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","lol"]]],[0,"vviinn-carousel",{"mode":[1],"imageWidth":[2,"image-width"],"showScroll":[4,"show-scroll"],"recommendations":[16],"moveDirection":[32],"contentGroups":[32],"activeContentGroup":[32]}],[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"],"imageLoaded":[32]}]]],["highlight-box_22",[[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]}]]],["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]}]]],["vviinn-vps-button",[[1,"vviinn-vps-button",{"token":[1],"currencySign":[1,"currency-sign"],"locale":[1],"apiPath":[1,"api-path"],"pressed":[32]},[[0,"modalClosed","handleModalClosed"]]]]]], options);
15
+ return bootstrapLazy([["cropper-handler",[[1,"cropper-handler",{"handler":[16],"disabled":[4]}]]],["vviinn-error",[[1,"vviinn-error"]]],["vviinn-preloader",[[1,"vviinn-preloader"]]],["vviinn-carousel_3",[[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"]]],[0,"vviinn-carousel",{"mode":[1],"imageWidth":[2,"image-width"],"showScroll":[4,"show-scroll"],"recommendations":[16],"moveDirection":[32],"contentGroups":[32],"activeContentGroup":[32]}],[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]}]]],["highlight-box_22",[[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]}]]],["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"]}]]]], options);
16
16
  });
17
17
  };
18
18
 
@@ -1,9 +1,10 @@
1
- import { r as registerInstance, h, H as Host, g as getElement, c as createEvent } from './index-6fa21e24.js';
2
- import { _ as _Array, O as Option, S as Semigroup, a as _function, E as Either, i as imageSearchState, s as state, c as chainW, m as makeRequest, f as fromEither, g as getApiPath, b as createInitGetRequest, d as sequenceT, A as Apply, e as state$1, T as TaskEither } from './imageSearch.store-8eab0da1.js';
3
- import { C as ChevronIcon, a as CrossIcon, V as VisualSearchIcon } from './index-8cb063df.js';
1
+ import { r as registerInstance, h, H as Host, g as getElement, c as createEvent } from './index-c09e56b6.js';
2
+ import { _ as _Array, O as Option, S as Semigroup, a as _function, E as Either, i as imageSearchState, s as state, c as chainW, m as makeRequest, f as fromEither, g as getApiPath, b as createInitGetRequest, d as sequenceT, A as Apply, T as TaskEither } from './imageSearch.store-1268786d.js';
3
+ import { C as ChevronIcon } from './index-1cf740a8.js';
4
4
  import { p as pipe } from './Handler-639a4cb3.js';
5
+ import { c as createProductViewVprEvent, v as v4, a as createTrackingApi, b as createWidgetVprEvent } from './index-fa27f1df.js';
5
6
 
6
- const vviinnCarouselCss = ":host{--vviinn-progressbar-width:0;--vviinn-carousel-item-width:150px;--vviinn-carousel-columns-internal:var(--vviinn-carousel-columns, 4);--vviinn-carousel-image-width-system:140px}.body{display:flex;position:relative;width:var(--vviinn-carousel-content-width);flex-direction:column}.content-wrapper *{box-sizing:border-box}.content-wrapper{overflow-y:hidden;overflow-x:auto;flex-grow:1}.bullets{margin-top:16px;display:flex;flex-direction:row;grid-gap:24px;justify-content:center}.bullet{width:10px;height:10px;background:#E0E0E0;border-radius:50%;cursor:pointer}.bullet.active{background:#161616}.content:not(.show-scrollbar),.content.grid{scrollbar-color:#fff0 #fff0}.content:not(.show-scrollbar)::-webkit-scrollbar,.content.grid::-webkit-scrollbar{opacity:0}.content{display:flex;flex-direction:row;grid-gap:8px;-ms-scroll-snap-type:x mandatory;scroll-snap-type:x mandatory;overflow-y:hidden;overflow-x:auto;flex-grow:1;padding-bottom:16px}.content.left>*{scroll-snap-align:start}.content.right>*{scroll-snap-align:end}:host(.continuity) button{border-radius:2px}:host(.grid) button{border-radius:50%}button{align-items:center;background-color:white;border:none;box-shadow:0px 2px 6px rgba(0, 0, 0, 0.15);cursor:pointer;display:grid;height:40px;justify-items:center;position:absolute;top:calc(50% - 20px);width:40px;z-index:1;padding:0;margin:0}button.prev svg{transform:rotate(180deg);margin-left:-5px}.prev{left:0}.next{right:0}.items-group{display:grid;grid-gap:16px;grid-template-columns:repeat(var(--vviinn-carousel-columns-internal), 1fr);min-width:100%}vviinn-product-card::part(price-container){text-align:center}:host(.classic) vviinn-product-card::part(title),:host(.classic) vviinn-product-card::part(brand),:host(.classic) vviinn-product-card::part(type){text-align:center}@media (max-width: 480px){:host(.modern) button{display:none}.items-group{grid-template-columns:repeat(2, 1fr)}}";
7
+ const vviinnCarouselCss = ":host{--vviinn-progressbar-width:0;--vviinn-carousel-item-width:150px;--vviinn-carousel-columns-internal:var(--vviinn-carousel-columns, 4);--vviinn-carousel-image-width-system:140px}.body{display:flex;position:relative;width:var(--vviinn-carousel-content-width);flex-direction:column}.content-wrapper *{box-sizing:border-box}.content-wrapper{overflow-y:hidden;overflow-x:auto;flex-grow:1}.bullets{margin-top:16px;display:flex;flex-direction:row;grid-gap:24px;justify-content:center}.bullet{width:10px;height:10px;background:#E0E0E0;border-radius:50%;cursor:pointer}.bullet.active{background:#161616}.content:not(.show-scrollbar),.content.grid{scrollbar-color:#fff0 #fff0}.content:not(.show-scrollbar)::-webkit-scrollbar,.content.grid::-webkit-scrollbar{opacity:0}.content{display:flex;flex-direction:row;grid-gap:8px;-ms-scroll-snap-type:x mandatory;scroll-snap-type:x mandatory;overflow-y:hidden;overflow-x:auto;flex-grow:1;padding-bottom:16px}.content.left>*{scroll-snap-align:start}.content.right>*{scroll-snap-align:end}:host(.continuity) button{border-radius:2px}:host(.grid) button{border-radius:50%}button{align-items:center;background-color:white;border:none;box-shadow:0px 2px 6px rgba(0, 0, 0, 0.15);cursor:pointer;display:grid;height:40px;justify-items:center;position:absolute;top:calc(50% - 20px);width:40px;z-index:1;padding:0;margin:0}button{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)}}";
7
8
 
8
9
  const COLUMNS_NUMBER_CSS_VAR = "--vviinn-carousel-columns-internal";
9
10
  const CAROUSEL_WIDTH_CSS_VAR = "--vviinn-carousel-content-width";
@@ -52,7 +53,7 @@ let VviinnCarousel = class {
52
53
  content: true,
53
54
  [this.moveDirection]: true,
54
55
  [this.mode]: true,
55
- "show-scrollbar": this.showScroll
56
+ "show-scrollbar": this.showScroll,
56
57
  };
57
58
  }
58
59
  handleResize() {
@@ -201,7 +202,7 @@ let VviinnCarousel = class {
201
202
  }, onClick: () => this.scroll(index) })));
202
203
  }
203
204
  render() {
204
- return (h(Host, { class: this.getClassMap() }, h("div", { class: Object.assign({ body: true }, this.getClassMap()) }, h("button", { class: "prev", onClick: () => this.showPrev() }, h(ChevronIcon, null)), h("div", { class: this.getContentClassMap(), onScroll: () => this.processScrollbarWidth() }, this.renderRecommendations()), h("button", { class: "next", onClick: () => this.showNext() }, h(ChevronIcon, null))), this.showBullets() ? (h("div", { class: "bullets" }, this.renderBullets())) : ("")));
205
+ return (h(Host, { class: this.getClassMap() }, h("div", { class: Object.assign({ body: true }, this.getClassMap()) }, h("button", { class: "prev", onClick: () => this.showPrev(), part: "carousel-button" }, h(ChevronIcon, null)), h("div", { class: this.getContentClassMap(), onScroll: () => this.processScrollbarWidth() }, this.renderRecommendations()), h("button", { class: "next", onClick: () => this.showNext(), part: "carousel-button" }, h(ChevronIcon, null))), this.showBullets() ? (h("div", { class: "bullets" }, this.renderBullets())) : ("")));
205
206
  }
206
207
  get el() { return getElement(this); }
207
208
  };
@@ -327,22 +328,31 @@ let VviinnProductCard = class {
327
328
  this.pricePrefix = undefined;
328
329
  this.responsive = false;
329
330
  this.dimmedBackground = false;
331
+ /** @internal */
332
+ this.index = 0;
330
333
  this.imageLoaded = false;
334
+ this.productData = null;
331
335
  this.intersectionObserver = new IntersectionObserver(this.intersectionCallback.bind(this), { threshold: 1.0 });
332
336
  }
337
+ connectedCallback() {
338
+ this.productData = {
339
+ product: this.productId,
340
+ rank: this.index
341
+ };
342
+ }
333
343
  intersectionCallback(data) {
334
344
  if (data.some((entry) => entry.isIntersecting)) {
335
345
  _function.pipe(getAnalyticsModule, Option.map((analytics) => analytics.sendImpression(this.getProduct())));
336
- this.recommendationView.emit(this.productId);
346
+ this.recommendationView.emit(this.productData);
337
347
  this.intersectionObserver.disconnect();
338
348
  }
339
349
  }
340
350
  componentDidLoad() {
341
- this.recommendationLoad.emit(this.productId);
351
+ this.recommendationLoad.emit(this.productData);
342
352
  this.intersectionObserver.observe(this.el);
343
353
  const links = this.el.shadowRoot.querySelectorAll("a");
344
354
  links.forEach((link) => link.addEventListener("mousedown", (event) => {
345
- this.recommendationClick.emit(this.productId);
355
+ this.recommendationClick.emit(this.productData);
346
356
  if (window.ga) {
347
357
  event.preventDefault();
348
358
  }
@@ -382,90 +392,6 @@ let VviinnProductCard = class {
382
392
  };
383
393
  VviinnProductCard.style = vviinnProductCardCss;
384
394
 
385
- const recommendationsSidebarCss = ":host{--vviinn-carousel-columns:0;box-sizing:border-box;display:block;display:flex;height:100vh;left:0;position:fixed;top:0;transition:background 0.1s ease-in-out;width:100vw}:host(.open){background:rgba(0, 0, 0, 0.2)}:host(.bottom){flex-direction:column;justify-content:end}:host(.right){flex-direction:row;justify-content:flex-end}header{position:relative;text-align:center;padding:32px}header.contains-source-img{display:grid;justify-items:center;grid-gap:12px}img.source-image{width:64px;height:64px;border-radius:50%;box-shadow:0px 2px 4px rgba(0, 0, 0, 0.15);padding:8px}:host(.right) header{box-shadow:0px 2px 6px rgba(0, 0, 0, 0.1)}main{padding:0 24px}:host(.right) main{overflow:auto}.sidebar{background:white;box-sizing:border-box;display:flex;flex-direction:column}:host(.bottom.idle) .sidebar,:host(.bottom.closed) .sidebar{transform:translateY(100%)}:host(.bottom.closed) .sidebar{-webkit-animation-name:slideOutFromBottom;animation-name:slideOutFromBottom;-webkit-animation-duration:0.5s;animation-duration:0.5s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}:host(.bottom.open) .sidebar{-webkit-animation-name:slideInFromBottom;animation-name:slideInFromBottom;-webkit-animation-duration:0.5s;animation-duration:0.5s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}:host(.right.idle) .sidebar{transform:translateX(100%)}:host(.right.closed) .sidebar{-webkit-animation-name:slideOutFromRight;animation-name:slideOutFromRight;-webkit-animation-duration:0.5s;animation-duration:0.5s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}:host(.right.open) .sidebar{-webkit-animation-name:slideInFromRight;animation-name:slideInFromRight;-webkit-animation-duration:0.5s;animation-duration:0.5s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}:host(.right) .sidebar{max-width:480px}:host(.right) vviinn-vpr-widget::part(recommendations-grid){display:grid;grid-template-columns:repeat(2, 1fr);grid-gap:24px}:host(.right) vviinn-vpr-widget{overflow:auto}:host(.right) vviinn-vpr-widget::part(image){border:none}.title{font-style:normal;font-weight:500;font-size:28px;line-height:40px;text-align:center;color:#000000}vviinn-vpr-widget::part(title),vviinn-vpr-widget::part(brand),vviinn-vpr-widget::part(type){text-align:left}vviinn-vpr-widget::part(price-container){align-self:start}.close-sidebar{background:transparent;border:none;cursor:pointer;margin:0;padding:0;position:absolute;right:24px;top:24px}@-webkit-keyframes slideInFromBottom{from{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes slideInFromBottom{from{transform:translateY(100%)}to{transform:translateY(0)}}@-webkit-keyframes slideOutFromBottom{from{transform:translateY(0)}to{transform:translateY(100%)}}@keyframes slideOutFromBottom{from{transform:translateY(0)}to{transform:translateY(100%)}}@-webkit-keyframes slideInFromRight{from{transform:translateX(100%)}to{transform:translateX(0)}}@keyframes slideInFromRight{from{transform:translateX(100%)}to{transform:translateX(0)}}@-webkit-keyframes slideOutFromRight{from{transform:translateX(0)}to{transform:translateX(100%)}}@keyframes slideOutFromRight{from{transform:translateX(0)}to{transform:translateX(100%)}}";
386
-
387
- let RecommendationsSidebar = class {
388
- constructor(hostRef) {
389
- registerInstance(this, hostRef);
390
- this.modalClosed = createEvent(this, "modalClosed", 7);
391
- this.position = "bottom";
392
- this.sourceImage = null;
393
- this.widgetScrollbar = false;
394
- this.state = "idle";
395
- }
396
- bodyClickListener(event) {
397
- const { clientX, clientY } = event;
398
- const sidebarRect = this.getSidebarRectangle();
399
- if (!sidebarRect)
400
- return;
401
- const inLeftBound = clientX >= sidebarRect.left;
402
- const inRightBound = clientX <= sidebarRect.right;
403
- const inTopBound = clientY >= sidebarRect.top;
404
- const inBottomBound = clientY <= sidebarRect.bottom;
405
- const inBound = inLeftBound && inRightBound && inTopBound && inBottomBound;
406
- if (!inBound) {
407
- this.state = "closed";
408
- }
409
- }
410
- getClassMap() {
411
- return {
412
- [this.position]: true,
413
- [this.state]: true,
414
- };
415
- }
416
- getSidebarRectangle() {
417
- var _a;
418
- return (_a = this.el.shadowRoot.querySelector("aside")) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
419
- }
420
- render() {
421
- return (h(Host, { class: this.getClassMap() }, h("aside", { class: "sidebar", part: "body", onAnimationEnd: (e) => this.handleAnimationEnd(e) }, h("header", { class: { "contains-source-img": this.isSourceImageValid() }, part: "sidebar-header" }, this.isSourceImageValid() ? this.renderSourceImage() : null, h("span", { class: "title", part: "title" }, this.sidebarTitle), h("button", { class: "close-sidebar", onClick: () => (this.state = "closed") }, h(CrossIcon, null))), h("main", { part: "sidebar-content" }, h("vviinn-vpr-widget", { exportparts: "brand, currency, deeplink, image, image-link, price-amount, price-container, price-outdated, price-prefix, price-regular, price-sale, title: product-title", token: this.token, productId: this.productId, imageWidth: 300, blockTitle: "", mode: this.position === "bottom" ? "continuity" : "grid", useCarousel: this.position === "bottom", onRecommendationsLoaded: () => (this.state = "open"), showScroll: this.widgetScrollbar })))));
422
- }
423
- renderSourceImage() {
424
- return (h("img", { class: "source-image", part: "source-image", src: this.sourceImage }));
425
- }
426
- isSourceImageValid() {
427
- var _a;
428
- return ((_a = this.sourceImage) === null || _a === void 0 ? void 0 : _a.length) > 0;
429
- }
430
- handleAnimationEnd({ animationName }) {
431
- const isClosingAnimation = animationName.includes("slideOut");
432
- if (!isClosingAnimation)
433
- return;
434
- this.modalClosed.emit();
435
- }
436
- get el() { return getElement(this); }
437
- };
438
- RecommendationsSidebar.style = recommendationsSidebarCss;
439
-
440
- const vviinnVprButtonCss = ":host{display:block}.open-button{align-items:center;background:rgba(255, 255, 255, 0.8);border-radius:50%;border:none;box-shadow:0px 2px 6px rgba(0, 0, 0, 0.15);box-sizing:border-box;cursor:pointer;display:grid;height:40px;justify-items:center;padding:0;width:40px;transition:all 0.25s ease-in-out}.open-button:hover{box-shadow:0px 2px 6px rgba(0, 0, 0, 0.25)}.open-button:focus{border:2px solid rgba(15, 98, 254, 0.5);outline:none}.open-button:active{background:#F4F4F4;outline:none}";
441
-
442
- let VviinnVprButton = class {
443
- constructor(hostRef) {
444
- registerInstance(this, hostRef);
445
- this.position = "bottom";
446
- this.sourceImage = null;
447
- this.sidebarTitle = "Visually similar products";
448
- this.modalScrollbar = false;
449
- }
450
- render() {
451
- return (h(Host, null, h("button", { class: "open-button", part: "button", onClick: () => this.handleClick() }, h("slot", null, h(VisualSearchIcon, null)))));
452
- }
453
- handleClick() {
454
- const sidebar = document.createElement("vviinn-recommendations-sidebar");
455
- sidebar.sidebarTitle = this.sidebarTitle;
456
- sidebar.productId = this.productId;
457
- sidebar.token = this.token;
458
- sidebar.position = this.position;
459
- sidebar.sourceImage = this.sourceImage;
460
- sidebar.widgetScrollbar = this.modalScrollbar;
461
- sidebar.addEventListener("modalClosed", () => {
462
- document.body.removeChild(sidebar);
463
- });
464
- document.body.append(sidebar);
465
- }
466
- };
467
- VviinnVprButton.style = vviinnVprButtonCss;
468
-
469
395
  const createBearerString = (x) => `Bearer ${x}`;
470
396
  const createAuthedHeader = (x) => new Headers({
471
397
  Authorization: x,
@@ -1145,20 +1071,42 @@ let VviinnVprWidget = class {
1145
1071
  this.getRecommendations();
1146
1072
  }
1147
1073
  handleApiPathChange(newPath) {
1148
- state$1.apiPath = newPath;
1074
+ state.apiPath = newPath;
1149
1075
  this.getRecommendations();
1150
1076
  }
1151
- lol({ detail }) {
1077
+ handleImageLoading({ detail }) {
1152
1078
  this.productImageLoadedSubject.next(detail);
1153
1079
  }
1080
+ trackRecommendationView({ detail }) {
1081
+ const recommendationViewEvent = createProductViewVprEvent(Object.assign({ session_id: this.uiSessionId }, detail));
1082
+ this.trackingApi.trackEvent(recommendationViewEvent);
1083
+ }
1084
+ trackRecommendationClick({ detail }) {
1085
+ const recommendationClickEvent = createProductViewVprEvent(Object.assign({ session_id: this.uiSessionId }, detail));
1086
+ this.trackingApi.trackEvent(recommendationClickEvent);
1087
+ }
1154
1088
  connectedCallback() {
1155
- state$1.apiPath = this.apiPath;
1156
- state$1.currencySign = this.currencySign;
1157
- state$1.locale = this.locale;
1089
+ state.apiPath = this.apiPath;
1090
+ state.currencySign = this.currencySign;
1091
+ state.locale = this.locale;
1092
+ this.uiSessionId = v4();
1093
+ this.trackingApi = createTrackingApi(this.apiPath, this.token);
1094
+ const widgetOpenEvent = createWidgetVprEvent({
1095
+ action: "open",
1096
+ sessionId: this.uiSessionId,
1097
+ });
1098
+ this.trackingApi.trackEvent(widgetOpenEvent);
1099
+ }
1100
+ disconnectedCallback() {
1101
+ const widgetCloseEvent = createWidgetVprEvent({
1102
+ action: "close",
1103
+ sessionId: this.uiSessionId,
1104
+ });
1105
+ this.trackingApi.trackEvent(widgetCloseEvent);
1158
1106
  }
1159
1107
  async componentWillLoad() {
1160
- state$1.pricePrefix = this.pricePrefix;
1161
- state$1.currencySign = this.currencySign;
1108
+ state.pricePrefix = this.pricePrefix;
1109
+ state.currencySign = this.currencySign;
1162
1110
  this.getRecommendations();
1163
1111
  }
1164
1112
  async getRecommendations() {
@@ -1179,9 +1127,9 @@ let VviinnVprWidget = class {
1179
1127
  imageSearchState.results = this.recommendations;
1180
1128
  this.loaded = true;
1181
1129
  //this.recommendationsLoaded.emit();
1182
- this.productIds = this.recommendations.map(r => r.productId);
1130
+ this.productIds = this.recommendations.map((r) => r.productId);
1183
1131
  this.productImageLoadedSubject.subscribe((id) => {
1184
- this.productIds = this.productIds.filter(x => x !== id);
1132
+ this.productIds = this.productIds.filter((x) => x !== id);
1185
1133
  if (this.productIds.length === 0) {
1186
1134
  this.recommendationsLoaded.emit();
1187
1135
  }
@@ -1198,16 +1146,16 @@ let VviinnVprWidget = class {
1198
1146
  loaded: this.loaded,
1199
1147
  empty: this.recommendations.length == 0,
1200
1148
  [this.mode]: true,
1201
- }, "aria-hidden": this.loaded ? "false" : "true" }, this.renderExternalCSS(), h("style", null, state$1.fallbackStyles), h("h2", { part: "recommendations-title" }, this.blockTitle), this.useCarousel ? this.renderCarousel() : this.renderResults()));
1149
+ }, "aria-hidden": this.loaded ? "false" : "true" }, this.renderExternalCSS(), h("style", null, state.fallbackStyles), h("h2", { part: "recommendations-title" }, this.blockTitle), this.useCarousel ? this.renderCarousel() : this.renderResults()));
1202
1150
  }
1203
- renderRecommendation(recommendation) {
1204
- return (h("vviinn-product-card", { part: "product-part", productId: recommendation.productId, productTitle: recommendation.title, deeplink: recommendation.deeplink, image: recommendation.image.thumbnail, brand: recommendation.brand, imageWidth: this.imageWidth, imageRatio: 1, price: recommendation.price.actual, salePrice: recommendation.price.sale, responsive: this.mode === "grid", dimmedBackground: this.useDimmedBackgroundInCard() }));
1151
+ renderRecommendation(recommendation, index) {
1152
+ return (h("vviinn-product-card", { part: "product-part", productId: recommendation.productId, productTitle: recommendation.title, deeplink: recommendation.deeplink, image: recommendation.image.thumbnail, brand: recommendation.brand, imageWidth: this.imageWidth, imageRatio: 1, price: recommendation.price.actual, salePrice: recommendation.price.sale, responsive: this.mode === "grid", dimmedBackground: this.useDimmedBackgroundInCard(), index: index }));
1205
1153
  }
1206
1154
  useDimmedBackgroundInCard() {
1207
1155
  return this.mode === "continuity" || !this.useCarousel;
1208
1156
  }
1209
1157
  renderResults() {
1210
- return (h("div", { class: "recommendations-grid", part: "recommendations-grid" }, this.recommendations.map((r) => this.renderRecommendation(r))));
1158
+ return (h("div", { class: "recommendations-grid", part: "recommendations-grid" }, this.recommendations.map((r, i) => this.renderRecommendation(r, i))));
1211
1159
  }
1212
1160
  renderCarousel() {
1213
1161
  return (h("vviinn-carousel", { mode: this.mode, imageWidth: this.imageWidth, showScroll: this.showScroll, recommendations: this.recommendations }));
@@ -1221,4 +1169,4 @@ let VviinnVprWidget = class {
1221
1169
  };
1222
1170
  VviinnVprWidget.style = vviinnVprWidgetCss;
1223
1171
 
1224
- export { VviinnCarousel as vviinn_carousel, VviinnProductCard as vviinn_product_card, RecommendationsSidebar as vviinn_recommendations_sidebar, VviinnVprButton as vviinn_vpr_button, VviinnVprWidget as vviinn_vpr_widget };
1172
+ export { VviinnCarousel as vviinn_carousel, VviinnProductCard as vviinn_product_card, VviinnVprWidget as vviinn_vpr_widget };
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, h, H as Host } from './index-6fa21e24.js';
1
+ import { r as registerInstance, h, H as Host } from './index-c09e56b6.js';
2
2
 
3
3
  const vviinnErrorCss = ":host{background:#F4F4F4;border-radius:8px;display:grid;grid-gap:20px;padding:24px;text-align:center}::slotted(svg){display:grid;align-self:center}::slotted(h4){margin:unset;font-weight:600;font-size:18px;line-height:24px}::slotted(span){font-size:14px;line-height:20px}::slotted(button){-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;background:transparent;color:var(--color-primary, var(--color-primary-system));font-weight:600;font-size:16px;line-height:20px;cursor:pointer}";
4
4
 
@@ -1,5 +1,5 @@
1
- import { r as registerInstance, h, H as Host } from './index-6fa21e24.js';
2
- import { i as imageSearchState } from './imageSearch.store-8eab0da1.js';
1
+ import { r as registerInstance, h, H as Host } from './index-c09e56b6.js';
2
+ import { i as imageSearchState } from './imageSearch.store-1268786d.js';
3
3
  import './Handler-639a4cb3.js';
4
4
 
5
5
  const vviinnPreloaderCss = ":host{--preloader-size:24px;--preloader-width:calc(var(--preloader-size) / 6);transform-origin:center;-webkit-animation:rotate 3s linear infinite;animation:rotate 3s linear infinite;border:var(--preloader-width) solid white;border-radius:50%;border-top-color:transparent;display:none;outline:0;width:var(--preloader-size);height:var(--preloader-size);box-sizing:border-box}:host(.active){display:flex}@-webkit-keyframes rotate{from{transform:rotate(-360deg)}to{transform:rotate(360deg)}}@keyframes rotate{from{transform:rotate(-360deg)}to{transform:rotate(360deg)}}";
@@ -0,0 +1,59 @@
1
+ import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-c09e56b6.js';
2
+ import { b as CrossIcon } from './index-1cf740a8.js';
3
+
4
+ const recommendationsSidebarCss = ":host{--vviinn-carousel-columns:0;box-sizing:border-box;display:block;display:flex;height:100vh;left:0;position:fixed;top:0;transition:background 0.1s ease-in-out;width:100vw}:host(.open){background:rgba(0, 0, 0, 0.2)}:host(.bottom){flex-direction:column;justify-content:end}:host(.right){flex-direction:row;justify-content:flex-end}header{position:relative;text-align:center;padding:32px}header.contains-source-img{display:grid;justify-items:center;grid-gap:12px}img.source-image{width:64px;height:64px;border-radius:50%;box-shadow:0px 2px 4px rgba(0, 0, 0, 0.15);padding:8px}:host(.right) header{box-shadow:0px 2px 6px rgba(0, 0, 0, 0.1)}main{padding:0 24px}:host(.right) main{overflow:auto}.sidebar{background:white;box-sizing:border-box;display:flex;flex-direction:column}:host(.bottom.idle) .sidebar,:host(.bottom.closed) .sidebar{transform:translateY(100%)}:host(.bottom.closed) .sidebar{-webkit-animation-name:slideOutFromBottom;animation-name:slideOutFromBottom;-webkit-animation-duration:0.5s;animation-duration:0.5s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}:host(.bottom.open) .sidebar{-webkit-animation-name:slideInFromBottom;animation-name:slideInFromBottom;-webkit-animation-duration:0.5s;animation-duration:0.5s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}:host(.right.idle) .sidebar{transform:translateX(100%)}:host(.right.closed) .sidebar{-webkit-animation-name:slideOutFromRight;animation-name:slideOutFromRight;-webkit-animation-duration:0.5s;animation-duration:0.5s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}:host(.right.open) .sidebar{-webkit-animation-name:slideInFromRight;animation-name:slideInFromRight;-webkit-animation-duration:0.5s;animation-duration:0.5s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}:host(.right) .sidebar{max-width:480px}:host(.right) vviinn-vpr-widget::part(recommendations-grid){display:grid;grid-template-columns:repeat(2, 1fr);grid-gap:24px}:host(.right) vviinn-vpr-widget{overflow:auto}:host(.right) vviinn-vpr-widget::part(image){border:none}.title{font-style:normal;font-weight:500;font-size:28px;line-height:40px;text-align:center;color:#000000}vviinn-vpr-widget::part(title),vviinn-vpr-widget::part(brand),vviinn-vpr-widget::part(type){text-align:left}vviinn-vpr-widget::part(price-container){align-self:start}.close-sidebar{background:transparent;border:none;cursor:pointer;margin:0;padding:0;position:absolute;right:24px;top:24px}@-webkit-keyframes slideInFromBottom{from{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes slideInFromBottom{from{transform:translateY(100%)}to{transform:translateY(0)}}@-webkit-keyframes slideOutFromBottom{from{transform:translateY(0)}to{transform:translateY(100%)}}@keyframes slideOutFromBottom{from{transform:translateY(0)}to{transform:translateY(100%)}}@-webkit-keyframes slideInFromRight{from{transform:translateX(100%)}to{transform:translateX(0)}}@keyframes slideInFromRight{from{transform:translateX(100%)}to{transform:translateX(0)}}@-webkit-keyframes slideOutFromRight{from{transform:translateX(0)}to{transform:translateX(100%)}}@keyframes slideOutFromRight{from{transform:translateX(0)}to{transform:translateX(100%)}}";
5
+
6
+ let RecommendationsSidebar = class {
7
+ constructor(hostRef) {
8
+ registerInstance(this, hostRef);
9
+ this.modalClosed = createEvent(this, "modalClosed", 7);
10
+ this.position = "bottom";
11
+ this.sourceImage = null;
12
+ this.widgetScrollbar = false;
13
+ this.state = "idle";
14
+ }
15
+ bodyClickListener(event) {
16
+ const { clientX, clientY } = event;
17
+ const sidebarRect = this.getSidebarRectangle();
18
+ if (!sidebarRect)
19
+ return;
20
+ const inLeftBound = clientX >= sidebarRect.left;
21
+ const inRightBound = clientX <= sidebarRect.right;
22
+ const inTopBound = clientY >= sidebarRect.top;
23
+ const inBottomBound = clientY <= sidebarRect.bottom;
24
+ const inBound = inLeftBound && inRightBound && inTopBound && inBottomBound;
25
+ if (!inBound) {
26
+ this.state = "closed";
27
+ }
28
+ }
29
+ getClassMap() {
30
+ return {
31
+ [this.position]: true,
32
+ [this.state]: true,
33
+ };
34
+ }
35
+ getSidebarRectangle() {
36
+ var _a;
37
+ return (_a = this.el.shadowRoot.querySelector("aside")) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
38
+ }
39
+ render() {
40
+ return (h(Host, { class: this.getClassMap() }, h("aside", { class: "sidebar", part: "body", onAnimationEnd: (e) => this.handleAnimationEnd(e) }, h("header", { class: { "contains-source-img": this.isSourceImageValid() }, part: "sidebar-header" }, this.isSourceImageValid() ? this.renderSourceImage() : null, h("span", { class: "title", part: "title" }, this.sidebarTitle), h("button", { class: "close-sidebar", onClick: () => (this.state = "closed") }, h(CrossIcon, null))), h("main", { part: "sidebar-content" }, h("vviinn-vpr-widget", { exportparts: "brand, currency, deeplink, image, image-link, price-amount, price-container, price-outdated, price-prefix, price-regular, price-sale, title: product-title", token: this.token, productId: this.productId, imageWidth: 300, blockTitle: "", mode: this.position === "bottom" ? "continuity" : "grid", useCarousel: this.position === "bottom", onRecommendationsLoaded: () => (this.state = "open"), showScroll: this.widgetScrollbar })))));
41
+ }
42
+ renderSourceImage() {
43
+ return (h("img", { class: "source-image", part: "source-image", src: this.sourceImage }));
44
+ }
45
+ isSourceImageValid() {
46
+ var _a;
47
+ return ((_a = this.sourceImage) === null || _a === void 0 ? void 0 : _a.length) > 0;
48
+ }
49
+ handleAnimationEnd({ animationName }) {
50
+ const isClosingAnimation = animationName.includes("slideOut");
51
+ if (!isClosingAnimation)
52
+ return;
53
+ this.modalClosed.emit();
54
+ }
55
+ get el() { return getElement(this); }
56
+ };
57
+ RecommendationsSidebar.style = recommendationsSidebarCss;
58
+
59
+ export { RecommendationsSidebar as vviinn_recommendations_sidebar };
@@ -0,0 +1,40 @@
1
+ import { r as registerInstance, h, H as Host } from './index-c09e56b6.js';
2
+ import { V as VisualSearchIcon } from './index-1cf740a8.js';
3
+
4
+ const vviinnVprButtonCss = ":host{display:block}.open-button{align-items:center;background:rgba(255, 255, 255, 0.8);border-radius:50%;border:none;box-shadow:0px 2px 6px rgba(0, 0, 0, 0.15);box-sizing:border-box;cursor:pointer;display:grid;height:40px;justify-items:center;padding:0;width:40px;transition:all 0.25s ease-in-out}.open-button:hover{box-shadow:0px 2px 6px rgba(0, 0, 0, 0.25)}.open-button:focus{border:2px solid rgba(15, 98, 254, 0.5);outline:none}.open-button:active{background:#F4F4F4;outline:none}";
5
+
6
+ let VviinnVprButton = class {
7
+ constructor(hostRef) {
8
+ registerInstance(this, hostRef);
9
+ this.position = "bottom";
10
+ this.sourceImage = null;
11
+ this.sidebarTitle = "Visually similar products";
12
+ this.modalScrollbar = false;
13
+ this.sidebar = null;
14
+ this.sidebarCloseListener = () => {
15
+ document.body.removeChild(this.sidebar);
16
+ };
17
+ }
18
+ render() {
19
+ return (h(Host, null, h("button", { class: "open-button", part: "button", onClick: () => this.handleClick() }, h("slot", null, h(VisualSearchIcon, null)))));
20
+ }
21
+ handleClick() {
22
+ const sidebar = document.createElement("vviinn-recommendations-sidebar");
23
+ sidebar.sidebarTitle = this.sidebarTitle;
24
+ sidebar.productId = this.productId;
25
+ sidebar.token = this.token;
26
+ sidebar.position = this.position;
27
+ sidebar.sourceImage = this.sourceImage;
28
+ sidebar.widgetScrollbar = this.modalScrollbar;
29
+ this.sidebar = sidebar;
30
+ sidebar.addEventListener("modalClosed", this.sidebarCloseListener);
31
+ document.body.append(this.sidebar);
32
+ }
33
+ disconnectedCallback() {
34
+ this.sidebar.removeEventListener("modalCLosed", this.sidebarCloseListener);
35
+ document.body.removeChild(this.sidebar);
36
+ }
37
+ };
38
+ VviinnVprButton.style = vviinnVprButtonCss;
39
+
40
+ export { VviinnVprButton as vviinn_vpr_button };
@@ -1,8 +1,8 @@
1
- import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-6fa21e24.js';
2
- import { b as CameraIcon } from './index-8cb063df.js';
3
- import { S as SlotSkeleton } from './customized-slots-a76a8d41.js';
1
+ import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-c09e56b6.js';
2
+ import { a as CameraIcon } from './index-1cf740a8.js';
3
+ import { S as SlotSkeleton } from './customized-slots-80625933.js';
4
4
 
5
- const vviinnVpsButtonCss = "";
5
+ const vviinnVpsButtonCss = ":host{cursor:pointer}";
6
6
 
7
7
  let VviinnVpsButton = class {
8
8
  constructor(hostRef) {
@@ -1,6 +1,7 @@
1
- import { r as registerInstance, h, H as Host, g as getElement } from './index-6fa21e24.js';
2
- import { e as state, i as imageSearchState, O as Option } from './imageSearch.store-8eab0da1.js';
3
- import { s as slotChangeListener } from './customized-slots-a76a8d41.js';
1
+ import { r as registerInstance, h, H as Host, g as getElement } from './index-c09e56b6.js';
2
+ import { s as state, i as imageSearchState, O as Option } from './imageSearch.store-1268786d.js';
3
+ import { s as slotChangeListener } from './customized-slots-80625933.js';
4
+ import { d as createProductViewVpsEvent, e as createSearchEvent, f as createFilterEvent, v as v4, a as createTrackingApi, g as createWidgetVpsEvent } from './index-fa27f1df.js';
4
5
  import './Handler-639a4cb3.js';
5
6
 
6
7
  const vviinnVpsWidgetCss = ":host{--color-primary-system:#0F62FE;--color-primary-hover-system:#014CDA;--color-icons-system:#2F8EDF;--spacer:8px}:host{display:block}.hidden{visibility:hidden;height:1px}vviinn-overlayed-modal.first-screen::part(title),vviinn-overlayed-modal.first-screen::part(secondary-action){visibility:hidden}.start-page{display:grid;grid-template-columns:repeat(2, 1fr);min-height:580px}.start-page_block{align-content:start;border-right:1px solid #F4F4F4;display:grid;padding:48px}.start-page_block.error{align-content:center}#onboarding-block{border-right:unset;box-sizing:border-box;grid-gap:24px;overflow-y:auto;position:relative;width:100%}vviinn-teaser{margin-bottom:32px;margin-top:-24px}vviinn-image-selector{align-items:center;background:var(--color-primary, var(--color-primary-system));border-color:var(--color-primary, var(--color-primary-system));border-radius:2px;color:white;display:grid;font-size:16px;font-weight:600;height:56px;justify-items:center;margin-bottom:16px;transition:background 0.1s ease-in-out}vviinn-image-selector:hover{background:var(--color-primary-hover, var(--color-primary-hover-system));border-color:var(--color-primary-hover, var(--color-primary-hover-system))}vviinn-image-selector:active{border-color:black}.upload-button-content{display:grid;align-items:center;justify-items:start;justify-content:center;grid-template-columns:-webkit-max-content auto;grid-template-columns:max-content auto;grid-gap:16px}.results-page{display:grid;grid-template-columns:336px auto;box-sizing:border-box}.results-page>*{padding:24px;box-sizing:border-box}.products{align-content:center;align-items:start;box-sizing:border-box;display:grid;grid-gap:32px 16px;grid-template-columns:repeat(auto-fill, minmax(152px, 1fr));justify-items:center;padding:24px;padding-right:0;position:absolute;width:calc(100% - 16px)}.products.hidden{display:none}vviinn-empty-results{width:280px;align-self:center;justify-self:center}.products-wrapper{display:grid;overflow-y:auto;overflow-x:hidden;padding:unset;position:relative;width:100%}.image-wrapper{border-right:1px solid #F4F4F4;display:grid;grid-template-rows:-webkit-min-content 170px;grid-template-rows:min-content 170px;grid-gap:24px;min-width:100%}.onboarding-wrapper{position:absolute;width:100%;padding:48px;box-sizing:border-box;display:grid;grid-gap:64px;padding-bottom:24px}vviinn-product-card{gap:0;width:100%}vviinn-product-card::part(image){border:1px solid #eaeaea;margin-bottom:8px}vviinn-product-card::part(price-container),vviinn-product-card::part(deeplink),vviinn-product-card::part(title){align-self:start}search-filters span{display:none}search-filters::part(filter){background:#F4F4F4;border-radius:4px;border:1px solid #F4F4F4;box-sizing:border-box;color:#161616;font-size:14px;font-weight:600;line-height:20px}search-filters::part(show-more-filters){border:1px solid #f4f4f4;border-radius:4px;box-sizing:border-box;color:#161616;font-size:14px;font-weight:600;line-height:20px;padding:6px 16px}search-filters::part(show-more-filters):hover{background:#EAEAEA}search-filters::part(filter):hover{background:#EAEAEA}search-filters::part(filter):focus{outline:none;border:1px solid var(--color-primary, var(--color-primary-system))}search-filters::part(filter active){background:rgba(15, 98, 254, 0.15);color:var(--color-primary, var(--color-primary-system))}.filters-wrapper{overflow:auto}.results-page:not(.active){display:none}.nothing-found{display:grid;grid-gap:64px;justify-self:center;padding-top:64px;padding-bottom:16px;position:absolute;width:60%}@media (max-width: 768px){.start-page_block{padding:24px}.onboarding-wrapper{padding:24px}}@media (max-width: 640px){.start-page{grid-template-rows:-webkit-min-content;grid-template-rows:min-content;grid-template-columns:unset;grid-gap:48px;padding:24px 0 48px 0}}@media (max-width: 640px) and (min-width: 415px){.onboarding-wrapper{position:unset}#onboarding-block{overflow:unset}.start-page.active{height:1px;overflow:auto}}@media (max-width: 415px){.results-page>*{box-sizing:border-box;padding:24px}vviinn-slide{padding-bottom:48px}.start-page_block:last-of-type{border-right:unset;overflow-y:unset;position:static;box-sizing:border-box;width:unset}.start-page_block{padding:0 24px}vviinn-teaser{margin-top:24px}.onboarding-wrapper{position:static;width:unset;padding:unset;box-sizing:border-box}.results-page{grid-template-columns:unset;grid-template-rows:-webkit-min-content auto;grid-template-rows:min-content auto}.image{margin-bottom:8px}.image-wrapper{grid-template-rows:-webkit-min-content auto;grid-template-rows:min-content auto;width:100%}.products-wrapper{align-content:start;position:static;overflow-y:unset;width:100%;padding-top:0}.products{position:static;padding:0;width:unset;grid-gap:32px 16px;justify-content:center}.nothing-found{position:static;grid-gap:64px;padding:unset;align-content:start;width:unset}}@media (max-width: 320px){.products{grid-template-columns:unset}}vviinn-wrong-format,vviinn-server-error{width:280px;align-self:center;justify-self:center}";
@@ -8,6 +9,8 @@ const vviinnVpsWidgetCss = ":host{--color-primary-system:#0F62FE;--color-primary
8
9
  let VviinnVpsWidget = class {
9
10
  constructor(hostRef) {
10
11
  registerInstance(this, hostRef);
12
+ /** @internal */
13
+ this.apiPath = "https://api.vviinn.com";
11
14
  /** When true modal window with widget will be shown */
12
15
  this.active = false;
13
16
  /** Currency sign will shown after price */
@@ -17,6 +20,7 @@ let VviinnVpsWidget = class {
17
20
  this.slidePosition = 0;
18
21
  this.width = 0;
19
22
  this.wrongImageFormat = false;
23
+ this.imageSource = null;
20
24
  }
21
25
  activeWatcher(value) {
22
26
  if (value) {
@@ -27,6 +31,39 @@ let VviinnVpsWidget = class {
27
31
  document.body.style.overflow = this.overflow;
28
32
  }
29
33
  }
34
+ trackRecommendationView({ detail }) {
35
+ const recommendationViewEvent = createProductViewVpsEvent(Object.assign({ sessionId: this.uiSessionId }, detail));
36
+ this.trackingApi.trackEvent(recommendationViewEvent);
37
+ }
38
+ trackRecommendationClick({ detail }) {
39
+ const recommendationClickEvent = createProductViewVpsEvent(Object.assign({ sessionId: this.uiSessionId }, detail));
40
+ this.trackingApi.trackEvent(recommendationClickEvent);
41
+ }
42
+ trachSearchAreaChanges() {
43
+ const searchEvent = createSearchEvent({
44
+ sessionId: this.uiSessionId,
45
+ source: this.imageSource,
46
+ searchArea: "manual-selection",
47
+ });
48
+ this.trackingApi.trackEvent(searchEvent);
49
+ }
50
+ trackDetectedObject() {
51
+ const searchEvent = createSearchEvent({
52
+ sessionId: this.uiSessionId,
53
+ source: this.imageSource,
54
+ searchArea: "attention-point",
55
+ });
56
+ this.trackingApi.trackEvent(searchEvent);
57
+ }
58
+ trackFilter({ detail }) {
59
+ const searchEvent = createFilterEvent({
60
+ sessionId: this.uiSessionId,
61
+ source: this.imageSource,
62
+ kind: "category",
63
+ action: detail,
64
+ });
65
+ this.trackingApi.trackEvent(searchEvent);
66
+ }
30
67
  componentWillLoad() {
31
68
  slotChangeListener(this, this.el);
32
69
  }
@@ -35,14 +72,38 @@ let VviinnVpsWidget = class {
35
72
  state.currencySign = this.currencySign;
36
73
  state.locale = this.locale;
37
74
  imageSearchState.token = this.token;
75
+ this.uiSessionId = v4();
76
+ this.trackingApi = createTrackingApi(this.apiPath, this.token);
77
+ const widgetOpenEvent = createWidgetVpsEvent({
78
+ action: "open",
79
+ sessionId: this.uiSessionId,
80
+ });
81
+ this.trackingApi.trackEvent(widgetOpenEvent);
82
+ }
83
+ disconnectedCallback() {
84
+ const widgetOpenEvent = createWidgetVpsEvent({
85
+ action: "close",
86
+ sessionId: this.uiSessionId,
87
+ });
88
+ this.trackingApi.trackEvent(widgetOpenEvent);
38
89
  }
39
- handleImageSelection() {
90
+ handleImageSelection(source) {
91
+ this.imageSource = source;
40
92
  this.slidePosition = 1;
41
93
  const root = this.el.shadowRoot.querySelector("vviinn-overlayed-modal");
42
94
  const overlay = root.shadowRoot.querySelector("vviinn-overlay");
43
95
  const modal = overlay.querySelector("vviinn-modal");
44
96
  const modalBody = modal.shadowRoot.querySelector(".body");
45
97
  modalBody.scrollTop = 0;
98
+ this.trackInitialSearch();
99
+ }
100
+ trackInitialSearch() {
101
+ const searchEvent = createSearchEvent({
102
+ sessionId: this.uiSessionId,
103
+ source: this.imageSource,
104
+ searchArea: "full",
105
+ });
106
+ this.trackingApi.trackEvent(searchEvent);
46
107
  }
47
108
  resetState() {
48
109
  this.resetScroll("onboarding-block");
@@ -75,12 +136,15 @@ let VviinnVpsWidget = class {
75
136
  return (h(Host, null, h("vviinn-overlayed-modal", { class: { "first-screen": this.slidePosition === 0 }, active: this.active, onSecondaryActionClicked: () => this.resetState(), onModalClosed: () => this.handleModalClose(), exportparts: "secondary-action, title, close-button" }, h("vviinn-slider", { showBullets: false, position: this.slidePosition }, h("vviinn-slide", { class: { "start-page": true } }, h("div", { class: {
76
137
  error: this.haveErrors(),
77
138
  "start-page_block": true,
78
- } }, h("vviinn-wrong-format", { class: { hidden: !this.wrongImageFormat }, onActionClick: () => (this.wrongImageFormat = false) }), h("vviinn-server-error", { class: { hidden: !imageSearchState.serverError }, onActionClick: () => (imageSearchState.serverError = false) }), h("vviinn-teaser", { class: { hidden: this.haveErrors() } }), h("vviinn-image-selector", { class: { hidden: this.haveErrors() }, onImageSelected: () => this.handleImageSelection(), onImageSelectedError: () => (this.wrongImageFormat = true), part: "select-image_button" }, h("span", { slot: "upload-button-text", class: "upload-button-content" }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "29", height: "28", fill: "none" }, h("defs", null), h("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" }), h("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" })), h("slot", { name: "vviinn-image-upload-button-text" }, h("span", null, "Kamera oder Bild ausw\u00E4hlen")))), h("vviinn-privacy-badge", { class: { hidden: this.haveErrors() } })), h("div", { id: "onboarding-block", class: "start-page_block" }, h("div", { class: "onboarding-wrapper" }, h("vviinn-onboarding", null), h("vviinn-example-images", { onImageSelected: () => this.handleImageSelection(), onImageSelectedError: () => this.resetScroll("onboarding-block", "smooth") })))), h("vviinn-slide", { class: { "results-page": true, active: this.slidePosition == 1 } }, h("div", { class: "image-wrapper" }, h("vviinn-image-view", null), h("div", { class: "filters-wrapper" }, h("div", { class: "filters" }, imageSearchState.filters.map((filter) => (h("search-filters", { filter: filter })))))), h("div", { id: "results-block", class: "products-wrapper" }, h("div", { class: { "nothing-found": true, hidden: imageSearchState.results.length > 0 } }, h("vviinn-empty-results", null), h("vviinn-onboarding", null)), h("div", { class: {
139
+ } }, h("vviinn-wrong-format", { class: { hidden: !this.wrongImageFormat }, onActionClick: () => (this.wrongImageFormat = false) }), h("vviinn-server-error", { class: { hidden: !imageSearchState.serverError }, onActionClick: () => (imageSearchState.serverError = false) }), h("vviinn-teaser", { class: { hidden: this.haveErrors() } }), h("vviinn-image-selector", { class: { hidden: this.haveErrors() }, onImageSelected: () => this.handleImageSelection("upload"), onImageSelectedError: () => (this.wrongImageFormat = true), part: "select-image_button" }, h("span", { slot: "upload-button-text", class: "upload-button-content" }, h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "29", height: "28", fill: "none" }, h("defs", null), h("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" }), h("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" })), h("slot", { name: "vviinn-image-upload-button-text" }, h("span", null, "Kamera oder Bild ausw\u00E4hlen")))), h("vviinn-privacy-badge", { class: { hidden: this.haveErrors() } })), h("div", { id: "onboarding-block", class: "start-page_block" }, h("div", { class: "onboarding-wrapper" }, h("vviinn-onboarding", null), h("vviinn-example-images", { onImageSelected: () => this.handleImageSelection("example"), onImageSelectedError: () => this.resetScroll("onboarding-block", "smooth") })))), h("vviinn-slide", { class: { "results-page": true, active: this.slidePosition == 1 } }, h("div", { class: "image-wrapper" }, h("vviinn-image-view", null), h("div", { class: "filters-wrapper" }, h("div", { class: "filters" }, imageSearchState.filters.map((filter) => (h("search-filters", { filter: filter })))))), h("div", { id: "results-block", class: "products-wrapper" }, h("div", { class: {
140
+ "nothing-found": true,
141
+ hidden: imageSearchState.results.length > 0,
142
+ } }, h("vviinn-empty-results", null), h("vviinn-onboarding", null)), h("div", { class: {
79
143
  hidden: imageSearchState.results.length <= 0,
80
144
  products: true,
81
- } }, imageSearchState.results.map((p) => {
145
+ } }, imageSearchState.results.map((p, i) => {
82
146
  var _a;
83
- return (h("vviinn-product-card", { hidden: true, productTitle: p.title, productId: p.productId, brand: p.brand, deeplink: p.deeplink, price: p.price.actual, salePrice: p.price.sale, imageWidth: 160, image: (_a = p.image.thumbnail) !== null && _a !== void 0 ? _a : p.image.original, part: "product-card" }));
147
+ return (h("vviinn-product-card", { hidden: true, productTitle: p.title, productId: p.productId, brand: p.brand, deeplink: p.deeplink, price: p.price.actual, salePrice: p.price.sale, imageWidth: 160, image: (_a = p.image.thumbnail) !== null && _a !== void 0 ? _a : p.image.original, part: "product-card", index: i }));
84
148
  }))))))));
85
149
  }
86
150
  get el() { return getElement(this); }
@@ -1,5 +1,5 @@
1
- import { p as promiseResolve, b as bootstrapLazy } from './index-6fa21e24.js';
2
- import { g as globalScripts } from './app-globals-345e497d.js';
1
+ import { p as promiseResolve, b as bootstrapLazy } from './index-c09e56b6.js';
2
+ import { g as globalScripts } from './app-globals-550daa9b.js';
3
3
 
4
4
  /*
5
5
  Stencil Client Patch Browser v2.9.0 | MIT Licensed | https://stenciljs.com
@@ -15,5 +15,5 @@ const patchBrowser = () => {
15
15
 
16
16
  patchBrowser().then(options => {
17
17
  globalScripts();
18
- return bootstrapLazy([["cropper-handler",[[1,"cropper-handler",{"handler":[16],"disabled":[4]}]]],["vviinn-error",[[1,"vviinn-error"]]],["vviinn-preloader",[[1,"vviinn-preloader"]]],["vviinn-carousel_5",[[1,"vviinn-vpr-button",{"token":[1],"productId":[1,"product-id"],"position":[1],"sourceImage":[1,"source-image"],"sidebarTitle":[1,"sidebar-title"],"modalScrollbar":[4,"modal-scrollbar"]}],[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"]]],[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","lol"]]],[0,"vviinn-carousel",{"mode":[1],"imageWidth":[2,"image-width"],"showScroll":[4,"show-scroll"],"recommendations":[16],"moveDirection":[32],"contentGroups":[32],"activeContentGroup":[32]}],[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"],"imageLoaded":[32]}]]],["highlight-box_22",[[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]}]]],["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]}]]],["vviinn-vps-button",[[1,"vviinn-vps-button",{"token":[1],"currencySign":[1,"currency-sign"],"locale":[1],"apiPath":[1,"api-path"],"pressed":[32]},[[0,"modalClosed","handleModalClosed"]]]]]], options);
18
+ return bootstrapLazy([["cropper-handler",[[1,"cropper-handler",{"handler":[16],"disabled":[4]}]]],["vviinn-error",[[1,"vviinn-error"]]],["vviinn-preloader",[[1,"vviinn-preloader"]]],["vviinn-carousel_3",[[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"]]],[0,"vviinn-carousel",{"mode":[1],"imageWidth":[2,"image-width"],"showScroll":[4,"show-scroll"],"recommendations":[16],"moveDirection":[32],"contentGroups":[32],"activeContentGroup":[32]}],[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]}]]],["highlight-box_22",[[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]}]]],["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"]}]]]], options);
19
19
  });
@@ -1,3 +1,4 @@
1
1
  import { Either } from "fp-ts/lib/Either";
2
2
  import { BasicError } from "../error";
3
3
  export declare const checkImageType: (file: File) => Either<BasicError<string>, File>;
4
+ //# sourceMappingURL=error.d.ts.map
@@ -1 +1,2 @@
1
1
  export declare const imageFormFromFile: (file: File) => FormData;
2
+ //# sourceMappingURL=form.d.ts.map