vviinn-widgets 2.16.2 → 2.16.3

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 (304) hide show
  1. package/dist/cjs/cropper-handler_27.cjs.entry.js +1185 -0
  2. package/dist/{vviinn-widgets/customized-slots-9c14bb69.js → cjs/customized-slots-6b38279f.js} +6 -3
  3. package/dist/cjs/index-0bda22ec.js +1367 -0
  4. package/dist/cjs/index-5ce4918b.js +39 -0
  5. package/{www/build/imageSearch.store-77991a45.js → dist/cjs/index-8e47383c.js} +12205 -8847
  6. package/dist/cjs/index.cjs.js +2 -0
  7. package/dist/cjs/loader.cjs.js +21 -0
  8. package/dist/{vviinn-widgets/vviinn-button.entry.js → cjs/vviinn-button.cjs.entry.js} +9 -5
  9. package/dist/cjs/vviinn-carousel_2.cjs.entry.js +1025 -0
  10. package/{www/build/vviinn-recommendations-sidebar.entry.js → dist/cjs/vviinn-recommendations-sidebar.cjs.entry.js} +12 -8
  11. package/dist/{vviinn-widgets/vviinn-vpr-button.entry.js → cjs/vviinn-vpr-button.cjs.entry.js} +9 -5
  12. package/dist/cjs/vviinn-vps-button.cjs.entry.js +45 -0
  13. package/dist/cjs/vviinn-widgets.cjs.js +19 -0
  14. package/dist/collection/Image/error.js +14 -0
  15. package/dist/collection/Image/form.js +5 -0
  16. package/dist/collection/Image/fromFile.js +20 -0
  17. package/dist/collection/Image/imageToB64.js +9 -0
  18. package/dist/collection/Image/index.js +0 -0
  19. package/dist/collection/Image/renderPromise.js +6 -0
  20. package/dist/collection/Image/resizeImage.js +28 -0
  21. package/dist/collection/Image/sizing.js +39 -0
  22. package/dist/collection/Image/toFile.js +17 -0
  23. package/dist/collection/analytics/GAnalytics.js +32 -0
  24. package/dist/collection/analytics/GeneralAnalytics.js +9 -0
  25. package/dist/collection/analytics/GtagAnalytics.js +35 -0
  26. package/dist/collection/analytics/ProductAnalytics.js +1 -0
  27. package/dist/collection/campaign/Campaign.js +8 -0
  28. package/dist/collection/campaign/CampaignService.js +5 -0
  29. package/dist/collection/campaign/VCSCampaign.js +1 -0
  30. package/dist/collection/campaign/VCSCampaignResponse.js +1 -0
  31. package/dist/collection/campaign/VCSCampaignService.js +7 -0
  32. package/dist/collection/campaign/VPRCampaignResponse.js +1 -0
  33. package/dist/collection/campaign/VPRCampaignService.js +7 -0
  34. package/dist/collection/collection-manifest.json +44 -0
  35. package/dist/collection/components/customized-slots.js +47 -0
  36. package/dist/collection/components/image-search/image-view/highlight-box/highlight-box.css +71 -0
  37. package/dist/collection/components/image-search/image-view/highlight-box/highlight-box.js +25 -0
  38. package/dist/collection/components/image-search/image-view/image-cropper/cropper-handler/cropper-handler.css +49 -0
  39. package/dist/collection/components/image-search/image-view/image-cropper/cropper-handler/cropper-handler.js +60 -0
  40. package/dist/collection/components/image-search/image-view/image-cropper/image-cropper.css +33 -0
  41. package/{www/build/image-cropper.entry.js → dist/collection/components/image-search/image-view/image-cropper/image-cropper.js} +66 -33
  42. package/dist/collection/components/image-search/search-filters/search-filters.css +120 -0
  43. package/dist/collection/components/image-search/search-filters/search-filters.js +125 -0
  44. package/dist/collection/components/vviinn-button/vviinn-button.css +44 -0
  45. package/dist/collection/components/vviinn-button/vviinn-button.js +45 -0
  46. package/dist/collection/components/vviinn-carousel/vviinn-carousel.css +142 -0
  47. package/{www/build/vviinn-carousel.entry.js → dist/collection/components/vviinn-carousel/vviinn-carousel.js} +117 -19
  48. package/dist/collection/components/vviinn-error/vviinn-empty-results/vviinn-empty-results.css +7 -0
  49. package/dist/collection/components/vviinn-error/vviinn-empty-results/vviinn-empty-results.js +36 -0
  50. package/dist/collection/components/vviinn-error/vviinn-error.css +38 -0
  51. package/dist/collection/components/vviinn-error/vviinn-error.js +18 -0
  52. package/dist/collection/components/vviinn-error/vviinn-server-error/vviinn-server-error.css +3 -0
  53. package/dist/collection/components/vviinn-error/vviinn-server-error/vviinn-server-error.js +34 -0
  54. package/dist/collection/components/vviinn-error/vviinn-wrong-format/vviinn-wrong-format.css +3 -0
  55. package/dist/collection/components/vviinn-error/vviinn-wrong-format/vviinn-wrong-format.js +34 -0
  56. package/dist/collection/components/vviinn-example-images/vviinn-example-image/vviinn-example-image.css +37 -0
  57. package/dist/collection/components/vviinn-example-images/vviinn-example-image/vviinn-example-image.js +134 -0
  58. package/dist/collection/components/vviinn-example-images/vviinn-example-images.css +19 -0
  59. package/dist/collection/components/vviinn-example-images/vviinn-example-images.js +85 -0
  60. package/dist/{vviinn-widgets/index-34d88ba6.js → collection/components/vviinn-icons/index.js} +11 -14
  61. package/dist/collection/components/vviinn-image-selector/vviinn-image-selector.css +26 -0
  62. package/dist/collection/components/vviinn-image-selector/vviinn-image-selector.js +64 -0
  63. package/dist/collection/components/vviinn-image-view/vviinn-detected-object/vviinn-detected-object.css +47 -0
  64. package/dist/collection/components/vviinn-image-view/vviinn-detected-object/vviinn-detected-object.js +100 -0
  65. package/dist/collection/components/vviinn-image-view/vviinn-image-view.css +31 -0
  66. package/dist/collection/components/vviinn-image-view/vviinn-image-view.js +57 -0
  67. package/dist/collection/components/vviinn-modal/vviinn-modal.css +106 -0
  68. package/dist/collection/components/vviinn-modal/vviinn-modal.js +98 -0
  69. package/dist/collection/components/vviinn-onboarding/onboarding-cards/onboarding-card.css +41 -0
  70. package/dist/collection/components/vviinn-onboarding/onboarding-cards/vviinn-onboarding-card-1/vviinn-onboarding-card-1.js +26 -0
  71. package/dist/collection/components/vviinn-onboarding/onboarding-cards/vviinn-onboarding-card-2/vviinn-onboarding-card-2.js +26 -0
  72. package/dist/collection/components/vviinn-onboarding/onboarding-cards/vviinn-onboarding-card-3/vviinn-onboarding-card-3.js +26 -0
  73. package/dist/collection/components/vviinn-onboarding/vviinn-onboarding.css +58 -0
  74. package/dist/collection/components/vviinn-onboarding/vviinn-onboarding.js +28 -0
  75. package/dist/collection/components/vviinn-overlay/vviinn-overlay.css +33 -0
  76. package/dist/collection/components/vviinn-overlay/vviinn-overlay.js +15 -0
  77. package/dist/collection/components/vviinn-overlayed-modal/vviinn-overlayed-modal.css +30 -0
  78. package/dist/collection/components/vviinn-overlayed-modal/vviinn-overlayed-modal.js +71 -0
  79. package/dist/collection/components/vviinn-preloader/vviinn-preloader.css +37 -0
  80. package/dist/collection/components/vviinn-preloader/vviinn-preloader.js +20 -0
  81. package/dist/collection/components/vviinn-privacy-badge/vviinn-privacy-badge.css +19 -0
  82. package/dist/collection/components/vviinn-privacy-badge/vviinn-privacy-badge.js +27 -0
  83. package/dist/collection/components/vviinn-product-card/render-helpers.js +34 -0
  84. package/dist/collection/components/vviinn-product-card/stories/args.js +73 -0
  85. package/dist/collection/components/vviinn-product-card/stories/decorators.js +51 -0
  86. package/dist/collection/components/vviinn-product-card/stories/vviinn-product-card.stories.js +105 -0
  87. package/dist/collection/components/vviinn-product-card/vviinn-product-card.css +95 -0
  88. package/dist/collection/components/vviinn-product-card/vviinn-product-card.js +463 -0
  89. package/dist/collection/components/vviinn-slider/arrow.js +11 -0
  90. package/dist/collection/components/vviinn-slider/vviinn-slide/vviinn-slide.css +4 -0
  91. package/dist/collection/components/vviinn-slider/vviinn-slide/vviinn-slide.js +15 -0
  92. package/dist/collection/components/vviinn-slider/vviinn-slider.css +110 -0
  93. package/dist/collection/components/vviinn-slider/vviinn-slider.js +181 -0
  94. package/dist/collection/components/vviinn-teaser/vviinn-teaser.css +14 -0
  95. package/dist/collection/components/vviinn-teaser/vviinn-teaser.js +29 -0
  96. package/dist/collection/components/vviinn-vpr-button/recommendations-sidebar/recommendations-sidebar.css +244 -0
  97. package/dist/collection/components/vviinn-vpr-button/recommendations-sidebar/recommendations-sidebar.js +263 -0
  98. package/dist/collection/components/vviinn-vpr-button/stories/args.js +217 -0
  99. package/dist/collection/components/vviinn-vpr-button/stories/vviinn-vpr-button.stories.js +90 -0
  100. package/dist/collection/components/vviinn-vpr-button/vviinn-vpr-button.css +8 -0
  101. package/dist/collection/components/vviinn-vpr-button/vviinn-vpr-button.js +243 -0
  102. package/dist/collection/components/vviinn-vpr-widget/stories/args.js +197 -0
  103. package/dist/collection/components/vviinn-vpr-widget/stories/decorators.js +29 -0
  104. package/dist/collection/components/vviinn-vpr-widget/stories/vviinn-vpr-widget.stories.js +210 -0
  105. package/dist/collection/components/vviinn-vpr-widget/token-helpers.js +11 -0
  106. package/dist/collection/components/vviinn-vpr-widget/vviinn-vpr-vidget.js +534 -0
  107. package/dist/collection/components/vviinn-vpr-widget/vviinn-vpr-widget.css +79 -0
  108. package/dist/collection/components/vviinn-vps-button/stories/vviinn-vps-button.stories.js +36 -0
  109. package/dist/collection/components/vviinn-vps-button/vviinn-vps-button.css +9 -0
  110. package/dist/collection/components/vviinn-vps-button/vviinn-vps-button.js +218 -0
  111. package/dist/collection/components/vviinn-vps-widget/stories/vviinn-vps-widget.stories.js +38 -0
  112. package/dist/collection/components/vviinn-vps-widget/vviinn-vps-widget.css +355 -0
  113. package/dist/collection/components/vviinn-vps-widget/vviinn-vps-widget.js +424 -0
  114. package/dist/collection/cropper/Cropper.js +1 -0
  115. package/dist/collection/cropper/Handler.js +61 -0
  116. package/dist/collection/dom/index.js +3 -0
  117. package/dist/collection/error.js +14 -0
  118. package/dist/collection/file/index.js +4 -0
  119. package/dist/collection/geometry/Clip.js +14 -0
  120. package/dist/collection/geometry/Point.js +32 -0
  121. package/dist/collection/geometry/Rectangle.js +95 -0
  122. package/dist/collection/geometry/RectangleAlt.js +1 -0
  123. package/dist/collection/geometry/Sized.js +8 -0
  124. package/dist/collection/global.js +4 -0
  125. package/dist/collection/index.js +1 -0
  126. package/dist/collection/interfaces/generated.js +5 -0
  127. package/dist/collection/interfaces/recommendation.js +1 -0
  128. package/dist/collection/network/apiClient.js +9 -0
  129. package/dist/collection/network/ion/File.js +14 -0
  130. package/dist/collection/network/ion/Form.js +64 -0
  131. package/dist/collection/network/ion/Link.js +8 -0
  132. package/dist/collection/network/ion/ValueObject.js +23 -0
  133. package/dist/collection/network/request.js +19 -0
  134. package/dist/collection/network/utils.js +37 -0
  135. package/dist/collection/openApi/index.js +27 -0
  136. package/dist/collection/recommendation/events.js +1 -0
  137. package/dist/collection/recommendation/recommendation.js +1 -0
  138. package/dist/collection/searchSession/searchSession.js +31 -0
  139. package/dist/collection/sentry.js +14 -0
  140. package/dist/collection/slider/GridMode.js +1 -0
  141. package/dist/collection/store/file-processing.js +13 -0
  142. package/dist/collection/store/imageSearch.store.js +133 -0
  143. package/dist/collection/store/store.js +3 -0
  144. package/dist/collection/store/tracking.store.js +3 -0
  145. package/dist/collection/stories/image-selector.stories.js +6 -0
  146. package/dist/collection/stories/image-view.stories.js +6 -0
  147. package/dist/collection/stories/modal.stories.js +12 -0
  148. package/dist/collection/stories/onboarding.stories.js +11 -0
  149. package/dist/collection/stories/overlay.stories.js +5 -0
  150. package/dist/collection/stories/overlayedModal.stories.js +8 -0
  151. package/dist/collection/stories/privacy-badge.stories.js +11 -0
  152. package/dist/collection/stories/slider.stories.js +17 -0
  153. package/dist/collection/stories/teaser.stories.js +5 -0
  154. package/dist/collection/stories/vps-widget.stories.js +47 -0
  155. package/dist/collection/stories/vviinn-product.stories.js +19 -0
  156. package/dist/collection/tracking/event.js +3 -0
  157. package/dist/collection/tracking/filter.js +5 -0
  158. package/dist/collection/tracking/index.js +13 -0
  159. package/dist/collection/tracking/models.js +6 -0
  160. package/dist/collection/tracking/product.js +18 -0
  161. package/dist/collection/tracking/search.js +5 -0
  162. package/dist/collection/tracking/widget.js +10 -0
  163. package/dist/collection/utils/collections/collectionsUtils.js +5 -0
  164. package/dist/collection/utils/either.js +3 -0
  165. package/dist/collection/utils/enum/enumUtils.js +3 -0
  166. package/dist/collection/utils/event/Events.js +1 -0
  167. package/dist/collection/utils/number/index.js +4 -0
  168. package/dist/collection/utils/option/option.js +4 -0
  169. package/dist/collection/utils/semigroup/semigroupDiff.js +6 -0
  170. package/dist/collection/utils/token/tokenUtils.js +9 -0
  171. package/dist/esm/cropper-handler_27.entry.js +1155 -0
  172. package/{www/build/customized-slots-9c14bb69.js → dist/esm/customized-slots-aa123817.js} +1 -1
  173. package/dist/esm/index-769ffb3c.js +1336 -0
  174. package/dist/{vviinn-widgets/imageSearch.store-77991a45.js → esm/index-8de7d584.js} +12231 -8923
  175. package/{www/build/index-34d88ba6.js → dist/esm/index-dfe874ac.js} +2 -4
  176. package/dist/esm/index.js +1 -0
  177. package/dist/esm/loader.js +17 -0
  178. package/dist/esm/polyfills/core-js.js +11 -0
  179. package/dist/esm/polyfills/css-shim.js +1 -0
  180. package/dist/esm/polyfills/dom.js +79 -0
  181. package/dist/esm/polyfills/es5-html-element.js +1 -0
  182. package/dist/esm/polyfills/index.js +34 -0
  183. package/dist/esm/polyfills/system.js +6 -0
  184. package/{www/build → dist/esm}/vviinn-button.entry.js +2 -2
  185. package/dist/esm/vviinn-carousel_2.entry.js +1020 -0
  186. package/dist/{vviinn-widgets → esm}/vviinn-recommendations-sidebar.entry.js +2 -2
  187. package/{www/build → dist/esm}/vviinn-vpr-button.entry.js +2 -2
  188. package/dist/{vviinn-widgets → esm}/vviinn-vps-button.entry.js +3 -3
  189. package/dist/esm/vviinn-widgets.js +17 -0
  190. package/dist/index.cjs.js +1 -0
  191. package/dist/index.js +1 -0
  192. package/dist/loader/cdn.js +3 -0
  193. package/dist/loader/index.cjs.js +3 -0
  194. package/dist/loader/index.d.ts +12 -0
  195. package/dist/loader/index.es2017.js +3 -0
  196. package/dist/loader/index.js +4 -0
  197. package/dist/loader/package.json +10 -0
  198. package/dist/vviinn-widgets/index.esm.js +0 -1
  199. package/dist/vviinn-widgets/p-10226f87.entry.js +1 -0
  200. package/dist/vviinn-widgets/p-1c4b1a2b.entry.js +1 -0
  201. package/dist/vviinn-widgets/p-24be993d.js +1 -0
  202. package/dist/vviinn-widgets/p-294c56c4.entry.js +1 -0
  203. package/dist/vviinn-widgets/p-312fcfe7.js +1 -0
  204. package/dist/vviinn-widgets/p-7a773bb6.js +1 -0
  205. package/dist/vviinn-widgets/p-9b99c7b7.entry.js +1 -0
  206. package/dist/vviinn-widgets/p-c4a15f15.entry.js +1 -0
  207. package/dist/vviinn-widgets/p-e441f87f.entry.js +1 -0
  208. package/dist/vviinn-widgets/p-fa5b5f3e.js +1 -0
  209. package/dist/vviinn-widgets/vviinn-widgets.css +1 -6
  210. package/dist/vviinn-widgets/vviinn-widgets.esm.js +1 -125
  211. package/package.json +1 -1
  212. package/www/build/index.esm.js +0 -1
  213. package/www/build/p-10226f87.entry.js +1 -0
  214. package/www/build/p-1c4b1a2b.entry.js +1 -0
  215. package/www/build/p-24be993d.js +1 -0
  216. package/www/build/p-294c56c4.entry.js +1 -0
  217. package/www/build/p-312fcfe7.js +1 -0
  218. package/www/build/p-7a773bb6.js +1 -0
  219. package/www/build/p-9b99c7b7.entry.js +1 -0
  220. package/www/build/p-bc12e9c4.js +125 -0
  221. package/www/build/p-c4a15f15.entry.js +1 -0
  222. package/www/build/p-e0153ae2.css +6 -0
  223. package/www/build/p-e441f87f.entry.js +1 -0
  224. package/www/build/p-fa5b5f3e.js +1 -0
  225. package/www/build/vviinn-widgets.css +1 -6
  226. package/www/build/vviinn-widgets.esm.js +1 -125
  227. package/www/index.html +1 -10
  228. package/dist/vviinn-widgets/Array-bdfc75db.js +0 -4870
  229. package/dist/vviinn-widgets/Handler-edcb46f4.js +0 -1422
  230. package/dist/vviinn-widgets/NonEmptyArray-947ab7b3.js +0 -4411
  231. package/dist/vviinn-widgets/app-globals-76b20e61.js +0 -8
  232. package/dist/vviinn-widgets/cropper-handler.entry.js +0 -23
  233. package/dist/vviinn-widgets/css-shim-f0027935.js +0 -4
  234. package/dist/vviinn-widgets/dom-db0073f0.js +0 -73
  235. package/dist/vviinn-widgets/highlight-box.entry.js +0 -41
  236. package/dist/vviinn-widgets/image-cropper.entry.js +0 -124
  237. package/dist/vviinn-widgets/index-6c6de682.js +0 -3857
  238. package/dist/vviinn-widgets/index-e80ee507.js +0 -3010
  239. package/dist/vviinn-widgets/number-171db649.js +0 -1499
  240. package/dist/vviinn-widgets/search-filters.entry.js +0 -76
  241. package/dist/vviinn-widgets/shadow-css-c1fdfa9f.js +0 -389
  242. package/dist/vviinn-widgets/vviinn-carousel.entry.js +0 -210
  243. package/dist/vviinn-widgets/vviinn-detected-object.entry.js +0 -54
  244. package/dist/vviinn-widgets/vviinn-empty-results.entry.js +0 -16
  245. package/dist/vviinn-widgets/vviinn-error.entry.js +0 -15
  246. package/dist/vviinn-widgets/vviinn-example-image.entry.js +0 -43
  247. package/dist/vviinn-widgets/vviinn-example-images.entry.js +0 -33
  248. package/dist/vviinn-widgets/vviinn-image-selector.entry.js +0 -31
  249. package/dist/vviinn-widgets/vviinn-image-view.entry.js +0 -55
  250. package/dist/vviinn-widgets/vviinn-modal.entry.js +0 -30
  251. package/dist/vviinn-widgets/vviinn-onboarding-card-1.entry.js +0 -21
  252. package/dist/vviinn-widgets/vviinn-onboarding-card-2.entry.js +0 -21
  253. package/dist/vviinn-widgets/vviinn-onboarding-card-3.entry.js +0 -21
  254. package/dist/vviinn-widgets/vviinn-onboarding.entry.js +0 -20
  255. package/dist/vviinn-widgets/vviinn-overlay.entry.js +0 -15
  256. package/dist/vviinn-widgets/vviinn-overlayed-modal.entry.js +0 -18
  257. package/dist/vviinn-widgets/vviinn-preloader.entry.js +0 -25
  258. package/dist/vviinn-widgets/vviinn-privacy-badge.entry.js +0 -20
  259. package/dist/vviinn-widgets/vviinn-product-card.entry.js +0 -189
  260. package/dist/vviinn-widgets/vviinn-server-error.entry.js +0 -16
  261. package/dist/vviinn-widgets/vviinn-slide.entry.js +0 -15
  262. package/dist/vviinn-widgets/vviinn-slider.entry.js +0 -120
  263. package/dist/vviinn-widgets/vviinn-teaser.entry.js +0 -20
  264. package/dist/vviinn-widgets/vviinn-vpr-widget.entry.js +0 -4609
  265. package/dist/vviinn-widgets/vviinn-vps-widget.entry.js +0 -199
  266. package/dist/vviinn-widgets/vviinn-wrong-format.entry.js +0 -16
  267. package/www/build/Array-bdfc75db.js +0 -4870
  268. package/www/build/Handler-edcb46f4.js +0 -1422
  269. package/www/build/NonEmptyArray-947ab7b3.js +0 -4411
  270. package/www/build/app-globals-76b20e61.js +0 -8
  271. package/www/build/cropper-handler.entry.js +0 -23
  272. package/www/build/css-shim-f0027935.js +0 -4
  273. package/www/build/dom-db0073f0.js +0 -73
  274. package/www/build/highlight-box.entry.js +0 -41
  275. package/www/build/index-6c6de682.js +0 -3857
  276. package/www/build/index-e80ee507.js +0 -3010
  277. package/www/build/number-171db649.js +0 -1499
  278. package/www/build/search-filters.entry.js +0 -76
  279. package/www/build/shadow-css-c1fdfa9f.js +0 -389
  280. package/www/build/vviinn-detected-object.entry.js +0 -54
  281. package/www/build/vviinn-empty-results.entry.js +0 -16
  282. package/www/build/vviinn-error.entry.js +0 -15
  283. package/www/build/vviinn-example-image.entry.js +0 -43
  284. package/www/build/vviinn-example-images.entry.js +0 -33
  285. package/www/build/vviinn-image-selector.entry.js +0 -31
  286. package/www/build/vviinn-image-view.entry.js +0 -55
  287. package/www/build/vviinn-modal.entry.js +0 -30
  288. package/www/build/vviinn-onboarding-card-1.entry.js +0 -21
  289. package/www/build/vviinn-onboarding-card-2.entry.js +0 -21
  290. package/www/build/vviinn-onboarding-card-3.entry.js +0 -21
  291. package/www/build/vviinn-onboarding.entry.js +0 -20
  292. package/www/build/vviinn-overlay.entry.js +0 -15
  293. package/www/build/vviinn-overlayed-modal.entry.js +0 -18
  294. package/www/build/vviinn-preloader.entry.js +0 -25
  295. package/www/build/vviinn-privacy-badge.entry.js +0 -20
  296. package/www/build/vviinn-product-card.entry.js +0 -189
  297. package/www/build/vviinn-server-error.entry.js +0 -16
  298. package/www/build/vviinn-slide.entry.js +0 -15
  299. package/www/build/vviinn-slider.entry.js +0 -120
  300. package/www/build/vviinn-teaser.entry.js +0 -20
  301. package/www/build/vviinn-vpr-widget.entry.js +0 -4609
  302. package/www/build/vviinn-vps-button.entry.js +0 -41
  303. package/www/build/vviinn-vps-widget.entry.js +0 -199
  304. package/www/build/vviinn-wrong-format.entry.js +0 -16
@@ -0,0 +1,1185 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-0bda22ec.js');
6
+ const index$1 = require('./index-8e47383c.js');
7
+ const index$2 = require('./index-5ce4918b.js');
8
+ const customizedSlots = require('./customized-slots-6b38279f.js');
9
+
10
+ const cropperHandlerCss = ":host{--size:20px;background:transparent;border:4px solid white;box-sizing:content-box;display:block;height:var(--size);touch-action:none;position:absolute;width:var(--size);z-index:4;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}:host(.disabled){opacity:0.25}:host(.nw-resize){border-bottom:none;border-right:none;top:0;left:0}:host(.ne-resize){border-left:none;border-bottom:none;right:0;top:0}:host(.sw-resize){border-right:none;border-top:none;left:0;bottom:0}:host(.se-resize){border-left:none;border-top:none;bottom:0;right:0}";
11
+
12
+ let CropperHandler = class {
13
+ constructor(hostRef) {
14
+ index.registerInstance(this, hostRef);
15
+ this.disabled = false;
16
+ }
17
+ render() {
18
+ return (index.h(index.Host, { part: `handle ${index$1.getCursorValue(this.handler.direction)}`, class: {
19
+ disabled: this.disabled,
20
+ [index$1.getCursorValue(this.handler.direction)]: true,
21
+ }, style: {
22
+ "--size": "20px",
23
+ cursor: index$1.getCursorValue(this.handler.direction),
24
+ }, draggable: false }));
25
+ }
26
+ };
27
+ CropperHandler.style = cropperHandlerCss;
28
+
29
+ const fromRectangle = (shape, target) => {
30
+ const top = `${shape.y}px`;
31
+ const left = `${shape.x}px`;
32
+ const right = `${target.width - (shape.x + shape.width)}px`;
33
+ const bottom = `${target.height - (shape.y + shape.height)}px`;
34
+ return {
35
+ top,
36
+ right,
37
+ bottom,
38
+ left,
39
+ };
40
+ };
41
+ const printClip = (clip) => `inset(${clip.top} ${clip.right} ${clip.bottom} ${clip.left})`;
42
+ const getClipValue = (shape, target) => printClip(fromRectangle(shape, target));
43
+
44
+ // -------------------------------------------------------------------------------------
45
+ // -------------------------------------------------------------------------------------
46
+ // instances
47
+ // -------------------------------------------------------------------------------------
48
+ /**
49
+ * @category instances
50
+ * @since 2.10.0
51
+ */
52
+ var Eq = {
53
+ equals: function (first, second) { return first === second; }
54
+ };
55
+ /**
56
+ * @category instances
57
+ * @since 2.10.0
58
+ */
59
+ var Ord = {
60
+ equals: Eq.equals,
61
+ compare: function (first, second) { return (first < second ? -1 : first > second ? 1 : 0); }
62
+ };
63
+
64
+ const highlightBoxCss = ":host{display:grid;position:absolute;box-sizing:border-box;border:none;width:100%;height:100%;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;--size:10px;--x-position:0;--y-position:0}img{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.pointer{position:absolute;width:var(--size);height:var(--size);background:black;border-radius:50%;z-index:2;cursor:pointer;transform:translate(var(--x-position), var(--y-position)) scale(0);-webkit-animation:0.25s linear fadein;animation:0.25s linear fadein;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}.pointer::after{content:\"\";cursor:pointer;border:5px solid black;border-radius:50%;width:var(--size);height:var(--size);display:block;transform:translate(calc(-50% + var(--size) * 0.5), calc(-50% + var(--size) * 0.5));padding:calc(var(--size) * 0.5);opacity:.75}@-webkit-keyframes fadein{from{transform:translate(var(--x-position), var(--y-position)) scale(0)}to{transform:translate(var(--x-position), var(--y-position)) scale(1)}}@keyframes fadein{from{transform:translate(var(--x-position), var(--y-position)) scale(0)}to{transform:translate(var(--x-position), var(--y-position)) scale(1)}}";
65
+
66
+ let HighlightBox = class {
67
+ constructor(hostRef) {
68
+ index.registerInstance(this, hostRef);
69
+ }
70
+ getInsetValue() {
71
+ return index$1.pipe(index$1.sequenceToOption(index$1.imageSearchState.searchArea, index$1.imageSearchState.imageBounds), index$1.Option.map(([selection, image]) => getClipValue(selection, image)), index$1.Option.getOrElse(() => ""));
72
+ }
73
+ renderImage() {
74
+ return index$1.pipe(index$1.sequenceToOption(index$1.imageSearchState.imageUrl, index$1.imageSearchState.imageBounds), index$1.Option.map(([url, bounds]) => (index.h("img", { src: url, width: bounds.width, height: bounds.height, style: { "clip-path": `${this.getInsetValue()}` } }))), index$1.Option.getOrElse(() => ""));
75
+ }
76
+ render() {
77
+ return index.h(index.Host, null, this.renderImage());
78
+ }
79
+ };
80
+ HighlightBox.style = highlightBoxCss;
81
+
82
+ const findTarget = (ev) => {
83
+ return ev.target;
84
+ };
85
+
86
+ const imageCropperCss = ":host{display:block;height:100%;left:0;position:absolute;top:0;width:100%}:host(.hidden){visibility:hidden}.crop-area{border:1px solid white;box-sizing:border-box;position:absolute;touch-action:none;transition-property:border-color, opacity;transition-duration:.25s;transition-timing-function:ease-in-out;z-index:2;position:relative;will-change:transform}.crop-area.active{border-color:whitesmoke}.crop-area.disabled{opacity:0.25}";
87
+
88
+ const MIN_SEARCHAREA_SIZE = 40;
89
+ let ImageCropper = class {
90
+ constructor(hostRef) {
91
+ index.registerInstance(this, hostRef);
92
+ this.cropperChanged = index.createEvent(this, "cropperChanged", 7);
93
+ this.disabled = false;
94
+ this.handleMove = false;
95
+ this.mouseStartPoint = undefined;
96
+ this.bounds = undefined;
97
+ this.resizeObserver = new ResizeObserver(() => {
98
+ this.bounds = this.el.getBoundingClientRect();
99
+ });
100
+ }
101
+ componentDidLoad() {
102
+ this.resizeObserver.observe(this.el);
103
+ }
104
+ disconnectedCallback() {
105
+ this.resizeObserver.disconnect();
106
+ }
107
+ handleHandlerMove(event) {
108
+ event.preventDefault();
109
+ event.stopPropagation();
110
+ const destination = index$1.fromMouseEvent(event);
111
+ const distance = index$1.pointDiffSemigroup.concat(destination, this.mouseStartPoint);
112
+ const transformedHandler = {
113
+ position: distance,
114
+ direction: this.handlerMoveDirection,
115
+ };
116
+ index$1._function.pipe(index$1.imageSearchState.searchArea, index$1.Option.map((area) => {
117
+ const newSearchArea = index$1.transform(area, transformedHandler);
118
+ if (this.outOfBounds(newSearchArea))
119
+ return;
120
+ index$1.imageSearchState.searchArea = index$1.Option.some(newSearchArea);
121
+ this.mouseStartPoint = destination;
122
+ index$1.imageSearchState.detectedObject = undefined;
123
+ }));
124
+ }
125
+ outOfBounds(area) {
126
+ return (area.width < MIN_SEARCHAREA_SIZE ||
127
+ area.height < MIN_SEARCHAREA_SIZE ||
128
+ area.x < 0 ||
129
+ area.y < 0 ||
130
+ this.bounds.height - (area.y + area.height) < 0 ||
131
+ this.bounds.width - (area.x + area.width) < 0);
132
+ }
133
+ handleCropperMove(ev) {
134
+ ev.preventDefault();
135
+ ev.stopPropagation();
136
+ const destination = index$1.fromMouseEvent(ev);
137
+ const distance = index$1.pointDiffSemigroup.concat(destination, this.mouseStartPoint);
138
+ index$1._function.pipe(index$1.imageSearchState.searchArea, index$1.Option.map((searchArea) => {
139
+ const newSearchArea = index$1.move(searchArea, distance);
140
+ if (newSearchArea.x < 0 ||
141
+ newSearchArea.y < 0 ||
142
+ this.bounds.height - (newSearchArea.y + newSearchArea.height) < 0 ||
143
+ this.bounds.width - (newSearchArea.x + newSearchArea.width) < 0)
144
+ return;
145
+ index$1.imageSearchState.detectedObject = undefined;
146
+ index$1.imageSearchState.searchArea = index$1.Option.some(newSearchArea);
147
+ this.mouseStartPoint = destination;
148
+ }));
149
+ }
150
+ handlePointerDown(event) {
151
+ event.stopPropagation();
152
+ this.mouseStartPoint = index$1.fromMouseEvent(event);
153
+ // should be htmlelement or handler
154
+ const target = findTarget(event);
155
+ if (target.localName === "cropper-handler") {
156
+ this.handlerMoveDirection = target.handler.direction;
157
+ this.pointerMoveListener = this.handleHandlerMove.bind(this);
158
+ }
159
+ else {
160
+ this.pointerMoveListener = this.handleCropperMove.bind(this);
161
+ }
162
+ this.pointerReleaseListener = this.handleSearchAreaRelease.bind(this);
163
+ this.el.addEventListener("pointermove", this.pointerMoveListener);
164
+ window.addEventListener("pointerup", this.pointerReleaseListener, {
165
+ once: true,
166
+ });
167
+ }
168
+ handleSearchAreaRelease() {
169
+ this.el.removeEventListener("pointermove", this.pointerMoveListener);
170
+ document.removeEventListener("pointerup", this.pointerReleaseListener);
171
+ this.mouseStartPoint = undefined;
172
+ index$1.makeRectangularSearchRequest();
173
+ this.cropperChanged.emit();
174
+ }
175
+ getStyleMap() {
176
+ return index$1._function.pipe(index$1.imageSearchState.searchArea, index$1.Option.map((rectangle) => {
177
+ return {
178
+ width: `${rectangle.width}px`,
179
+ height: `${rectangle.height}px`,
180
+ transform: `translate3d(${rectangle.x}px, ${rectangle.y}px, 0)`,
181
+ cursor: this.handleMove ? "move" : "default",
182
+ };
183
+ }), index$1.Option.getOrElse(() => {
184
+ return {};
185
+ }));
186
+ }
187
+ render() {
188
+ return (index.h(index.Host, { exportparts: "handle, e-resize, n-resize, ne-resize, nw-resize, s-resize, se-resize, sw-resize, w-resize" }, index.h("div", { class: {
189
+ "crop-area": true,
190
+ active: this.handleMove,
191
+ disabled: this.disabled,
192
+ }, draggable: false, style: this.getStyleMap(), onContextMenu: () => false, onPointerDown: (ev) => this.handlePointerDown(ev) }, index$1.imageSearchState.cropperHandlers.map((handler) => (index.h("cropper-handler", { disabled: this.disabled, handler: handler, onPointerDown: (ev) => this.handlePointerDown(ev) }))))));
193
+ }
194
+ get el() { return index.getElement(this); }
195
+ };
196
+ ImageCropper.style = imageCropperCss;
197
+
198
+ const searchFiltersCss = ":host{display:grid;grid-gap:1rem}.filters{display:flex;flex-direction:row;flex-wrap:wrap;gap:0.5rem}.filter{align-items:center;-webkit-animation-duration:0.25s;animation-duration:0.25s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;-webkit-animation-name:scalein;animation-name:scalein;border:1px solid lightgray;cursor:pointer;display:flex;flex-direction:row;grid-gap:8px;height:-webkit-max-content;height:-moz-max-content;height:max-content;min-width:-webkit-max-content;min-width:-moz-max-content;min-width:max-content;padding:0.1rem;transform:scale(0);transition-property:background;transition-duration:0.25s;transition-timing-function:ease-in-out;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;padding:6px 16px}.filter.active{border:1px solid black;padding:6px 8px}.filter:hover{border:1px solid gray}.show-more{display:flex}.show-more.hidden{display:none}.show-more::after{content:url(\"data:image/svg+xml,%3Csvg width='16' height='16' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M8 12.2l-6-6L3.2 5 8 9.8 12.8 5 14 6.2l-6 6z' fill='%23525252'/%3E%3C/svg%3E\");display:block;height:16px;margin-top:1px;margin-left:8px}.show-more.active::after{transform:rotateX(180deg)}@-webkit-keyframes scalein{from{opacity:0;transform:scale(0.5)}to{opacity:1;transform:scale(1)}}@keyframes scalein{from{opacity:0;transform:scale(0.5)}to{opacity:1;transform:scale(1)}}@media (max-width: 415px){.show-more::after{transform:rotate(-90deg)}.show-more.active::after{transform:rotate(90deg)}}@media (max-width: 800px){.filters{flex-wrap:nowrap;overflow-x:scroll;-ms-scroll-snap-type:x mandatory;scroll-snap-type:x mandatory;grid-gap:unset}.filter{scroll-snap-align:end;margin-right:0.5rem}}";
199
+
200
+ const FILTERS_COUNT = 5;
201
+ const ACTIVE_FILTER_CLASSNAME = ".filter.active";
202
+ const getFilterId = (filter) => filter.href.split("/").reverse()[0];
203
+ let SearchFilters = class {
204
+ constructor(hostRef) {
205
+ index.registerInstance(this, hostRef);
206
+ this.filterSelected = index.createEvent(this, "filterSelected", 7);
207
+ this.filter = null;
208
+ this.selectedCategoryId = null;
209
+ this.hideFilters = true;
210
+ }
211
+ handleFilterSelection(filter) {
212
+ return this.isFilterSelected(filter)
213
+ ? this.clearSelectedFilter()
214
+ : this.selectFilter(filter);
215
+ }
216
+ selectFilter(filter) {
217
+ this.selectedCategoryId = getFilterId(filter);
218
+ index$1.imageSearchState.activeIonLink = filter;
219
+ this.filterSelected.emit("select");
220
+ }
221
+ clearSelectedFilter() {
222
+ this.selectedCategoryId = null;
223
+ index$1.imageSearchState.activeIonLink = undefined;
224
+ this.findSelectedFilter().blur();
225
+ this.filterSelected.emit("deselect");
226
+ }
227
+ findSelectedFilter() {
228
+ return this.el.shadowRoot.querySelector(ACTIVE_FILTER_CLASSNAME);
229
+ }
230
+ toggleFilters() {
231
+ this.hideFilters = !this.hideFilters;
232
+ }
233
+ handleEnter(ev, f) {
234
+ if (ev.key !== "Enter")
235
+ return;
236
+ this.handleFilterSelection(f);
237
+ }
238
+ isFilterSelected(filterLink) {
239
+ return this.selectedCategoryId === getFilterId(filterLink);
240
+ }
241
+ render() {
242
+ return (index.h(index.Host, { exportparts: "filter, show-more-filters" }, index.h("div", { class: "filters" }, this.filter.filters
243
+ .filter((_, i) => (this.hideFilters ? i < FILTERS_COUNT : true))
244
+ .map((f, n) => (index.h("div", { role: "button", tabindex: "0", part: this.isFilterSelected(f) ? "filter active" : "filter", class: {
245
+ filter: true,
246
+ active: this.selectedCategoryId === getFilterId(f),
247
+ }, style: { "animation-delay": `${n * 10}ms` }, onPointerUp: (ev) => {
248
+ ev.stopPropagation();
249
+ this.handleFilterSelection(f);
250
+ }, onKeyPress: (ev) => this.handleEnter(ev, f) }, this.isFilterSelected(f) ? index.h(index$2.CheckIcon, null) : null, f.name))), index.h("div", { class: {
251
+ filter: true,
252
+ "show-more": true,
253
+ hidden: this.filter.filters.length <= FILTERS_COUNT,
254
+ active: !this.hideFilters,
255
+ }, role: "button", tabindex: "0", "aria-role": "button", onClick: () => this.toggleFilters(), onKeyPress: (ev) => {
256
+ if (ev.key === "Enter") {
257
+ this.toggleFilters();
258
+ }
259
+ }, part: "show-more-filters" }, this.hideFilters ? "Zeige mehr" : "Zeige weniger"))));
260
+ }
261
+ get el() { return index.getElement(this); }
262
+ };
263
+ SearchFilters.style = searchFiltersCss;
264
+
265
+ const vviinnDetectedObjectCss = ":host{--color-primary-system:#0F62FE;--color-primary-hover-system:#014CDA;--color-icons-system:#2F8EDF;--spacer:8px}:host{--size:32px;--x-position:0;--y-position:0;background:rgba(22, 22, 22, 0.5);border-radius:50%;border:none;cursor:pointer;display:block;height:var(--size);position:absolute;transition:opacity 0.25s;width:var(--size);z-index:2;transform:translate(calc(var(--x-position) - (var(--size) * 0.5)), calc(var(--y-position) - (var(--size) * 0.5)));transition:background 0.1 ease-in-out}:host(:hover){background:rgba(22, 22, 22, 0.75)}:host(.active){background:var(--color-primary, var(--color-primary-system))!important;border:2px solid white}:host::after{--size:32px;border-radius:50%;content:\"\";cursor:pointer;display:block;height:calc(var(--size) * 0.25);transform:translate(calc(-50% + var(--size) * 0.5), calc(-50% + var(--size) * 0.5));width:calc(var(--size) * 0.25);background:white}";
266
+
267
+ let VviinnDetectedObject = class {
268
+ constructor(hostRef) {
269
+ index.registerInstance(this, hostRef);
270
+ this.detectedObjectClicked = index.createEvent(this, "detectedObjectClicked", 7);
271
+ this.position = ["0", "0"];
272
+ }
273
+ getObjectPosition() {
274
+ return index$1._function.pipe(index$1.imageSearchState.imageBounds, index$1.Option.map((bounds) => {
275
+ const objectRectangle = index$1.fromAlt(index$1.foldValueObject(this.detectedObject).rectangle);
276
+ const { x, y } = index$1._function.pipe(objectRectangle, index$1.scaleWithSized(bounds), index$1.center);
277
+ return [`${x}px`, `${y}px`];
278
+ }), index$1.Option.getOrElse(() => ["0", "0"]));
279
+ }
280
+ selectDetectedObject() {
281
+ index$1._function.pipe(index$1.imageSearchState.imageBounds, index$1.Option.map((bounds) => {
282
+ const rectangle = index$1.foldValueObject(this.detectedObject).rectangle;
283
+ const transformedRect = index$1.fromAlt(rectangle);
284
+ const scaledRect = index$1.scaleWithSized(bounds)(transformedRect);
285
+ index$1.imageSearchState.detectedObject = this.detectedObject;
286
+ index$1.imageSearchState.searchArea = index$1.Option.some(scaledRect);
287
+ }));
288
+ index$1.makeRectangularSearchRequest();
289
+ this.detectedObjectClicked.emit();
290
+ }
291
+ isActive() {
292
+ if (!this.detectedObject)
293
+ return false;
294
+ if (!index$1.imageSearchState.detectedObject)
295
+ return false;
296
+ const thisObject = index$1.foldValueObject(this.detectedObject);
297
+ const savedObject = index$1.foldValueObject(index$1.imageSearchState.detectedObject);
298
+ return index$1.detectedObjectEq.equals(thisObject, savedObject);
299
+ }
300
+ render() {
301
+ return (index.h(index.Host, { class: {
302
+ active: this.isActive(),
303
+ }, onClick: () => this.selectDetectedObject(), style: {
304
+ "--x-position": this.getObjectPosition()[0],
305
+ "--y-position": this.getObjectPosition()[1],
306
+ } }));
307
+ }
308
+ };
309
+ VviinnDetectedObject.style = vviinnDetectedObjectCss;
310
+
311
+ const vviinnEmptyResultsCss = ":host{display:grid}vviinn-error{justify-items:center}";
312
+
313
+ let VviinnEmptyResults = class {
314
+ constructor(hostRef) {
315
+ index.registerInstance(this, hostRef);
316
+ this.actionClick = index.createEvent(this, "actionClick", 7);
317
+ }
318
+ render() {
319
+ return (index.h(index.Host, null, index.h("vviinn-error", null, index.h("svg", { slot: "icon", class: "icon", width: "32", height: "32", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, index.h("path", { d: "M16 2a14 14 0 1 0 0 28 14 14 0 0 0 0-28Zm0 26a12 12 0 1 1 0-24 12 12 0 0 1 0 24Z", fill: "#525252" }), index.h("path", { d: "M17 8h-2v11h2V8Zm-1 14a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3Z", fill: "#525252" })), index.h("h4", { slot: "title" }, "Leider nichts gefunden"), index.h("span", { slot: "text" }, "Leider konnten wir keine passenden Produkte finden. Bitte versuche es mit einem anderen Bildausschnitt noch einmal."))));
320
+ }
321
+ };
322
+ VviinnEmptyResults.style = vviinnEmptyResultsCss;
323
+
324
+ 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}";
325
+
326
+ let VviinnError = class {
327
+ constructor(hostRef) {
328
+ index.registerInstance(this, hostRef);
329
+ }
330
+ render() {
331
+ return (index.h(index.Host, null, index.h("slot", { name: "icon" }), index.h("slot", { name: "title" }), index.h("slot", { name: "text" }), index.h("slot", { name: "action" })));
332
+ }
333
+ };
334
+ VviinnError.style = vviinnErrorCss;
335
+
336
+ const vviinnExampleImageCss = ":host{display:block;margin-bottom:8px;position:relative}:host(:focus){border:2px solid var(--color-primary)}img{width:100%;height:auto;cursor:pointer}.image-preloader{background:rgba(0, 0, 0, 0.25);border-radius:4px;bottom:12px;display:none;padding:4px 6px;position:absolute;right:12px;z-index:4}vviinn-preloader{--preloader-size:12px}@media (max-width: 640px){.image-preloader{display:block}}";
337
+
338
+ let VviinnExampleImage = class {
339
+ constructor(hostRef) {
340
+ index.registerInstance(this, hostRef);
341
+ this.exampleImageSelected = index.createEvent(this, "exampleImageSelected", 7);
342
+ this.exampleImageError = index.createEvent(this, "exampleImageError", 7);
343
+ this.src = "";
344
+ this.width = 0;
345
+ this.height = 0;
346
+ this.selected = false;
347
+ }
348
+ async selectImage() {
349
+ this.selected = true;
350
+ const file = await index$1.toFile(this.src);
351
+ const processResult = await index$1.processSelectedFile(file);
352
+ index$1._function.pipe(processResult, index$1.Either.match(() => this.exampleImageError.emit(), () => this.exampleImageSelected.emit()));
353
+ this.selected = false;
354
+ }
355
+ handleKeyPress({ key }) {
356
+ if (key !== "Enter" && key !== " ")
357
+ return;
358
+ this.selectImage();
359
+ }
360
+ showPreloader() {
361
+ return ((index$1.imageSearchState.objectDetectionInProgress ||
362
+ index$1.imageSearchState.loading) &&
363
+ this.selected);
364
+ }
365
+ render() {
366
+ return (index.h(index.Host, { onClick: () => this.selectImage(), onKeyUp: (ev) => this.handleKeyPress(ev) }, this.showPreloader() ? (index.h("div", { class: "image-preloader" }, index.h("vviinn-preloader", null))) : null, index.h("img", { src: this.src, width: this.width, height: this.height, tabindex: 1 })));
367
+ }
368
+ };
369
+ VviinnExampleImage.style = vviinnExampleImageCss;
370
+
371
+ const vviinnExampleImagesCss = "h3{font-size:22px;font-weight:600;line-height:32px;margin:0;margin-bottom:16px;text-align:center}.images{display:block;-moz-column-count:2;column-count:2;-moz-column-gap:16px;column-gap:16px}";
372
+
373
+ let VviinnExampleImages = class {
374
+ constructor(hostRef) {
375
+ index.registerInstance(this, hostRef);
376
+ this.imageSelected = index.createEvent(this, "imageSelected", 7);
377
+ this.imageSelectedError = index.createEvent(this, "imageSelectedError", 7);
378
+ }
379
+ handleImageSelection() {
380
+ this.imageSelected.emit();
381
+ }
382
+ handleImageSelectionError() {
383
+ this.imageSelectedError.emit();
384
+ }
385
+ componentWillLoad() {
386
+ customizedSlots.slotChangeListener(this, this.el);
387
+ }
388
+ delegateFocus() {
389
+ const firstSlot = this.imagesBlock.childNodes[0];
390
+ const firstExampleImage = firstSlot.childNodes[0];
391
+ firstExampleImage.focus();
392
+ }
393
+ render() {
394
+ return (index.h(index.Host, { onFocus: () => this.delegateFocus() }, index.h("slot", { name: "vviinn-example-images-title" }, index.h("h3", null, "Mit den Beispielbildern die Suche direkt ausprobieren")), index.h("div", { class: "images", ref: (el) => (this.imagesBlock = el) }, index.h("slot", { name: "vviinn-example-images-1" }, index.h("vviinn-example-image", { width: 480, height: 640, src: "https://cdn.vviinn.com/0/fit/480/0/ce/0/Z3M6Ly9haWFhcy1pbWdwcm94eS9leGFtcGxlcy9pbWctaW5zcGlyYXRpb24tMDEtTC5qcGc=" })), index.h("slot", { name: "vviinn-example-images-2" }, index.h("vviinn-example-image", { width: 280, height: 480, src: "https://cdn.vviinn.com/0/fit/480/0/ce/0/Z3M6Ly9haWFhcy1pbWdwcm94eS9leGFtcGxlcy9pbWctaW5zcGlyYXRpb24tMDItTS5qcGc=" })), index.h("slot", { name: "vviinn-example-images-3" }, index.h("vviinn-example-image", { width: 280, height: 480, src: "https://cdn.vviinn.com/0/fit/480/0/ce/0/Z3M6Ly9haWFhcy1pbWdwcm94eS9leGFtcGxlcy9pbWctaW5zcGlyYXRpb24tMDMtTS5qcGc=" })), index.h("slot", { name: "vviinn-example-images-4" }, index.h("vviinn-example-image", { width: 480, height: 640, src: "https://cdn.vviinn.com/0/fit/480/0/ce/0/Z3M6Ly9haWFhcy1pbWdwcm94eS9leGFtcGxlcy9pbWctaW5zcGlyYXRpb24tMDQtTC5qcGc=" })))));
395
+ }
396
+ get el() { return index.getElement(this); }
397
+ };
398
+ VviinnExampleImages.style = vviinnExampleImagesCss;
399
+
400
+ const vviinnImageSelectorCss = ":host{display:block}:host(::hover){background:whitesmoke}.visually-hidden{clip:rect(0 0 0 0);-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}label{cursor:pointer;display:grid;width:100%;height:100%;transition:background 0.1s ease-in-out}";
401
+
402
+ let VviinnImageSelector = class {
403
+ constructor(hostRef) {
404
+ index.registerInstance(this, hostRef);
405
+ this.imageSelected = index.createEvent(this, "imageSelected", 7);
406
+ this.imageSelectedError = index.createEvent(this, "imageSelectedError", 7);
407
+ }
408
+ async handleInputChange(event) {
409
+ const input = event.target;
410
+ const processingResult = await index$1.processSelectedFile(input.files[0]);
411
+ index$1._function.pipe(processingResult, index$1.match(() => this.imageSelectedError.emit(), () => this.imageSelected.emit()));
412
+ input.value = null;
413
+ }
414
+ isLoading() {
415
+ return (index$1.imageSearchState.loading || index$1.imageSearchState.objectDetectionInProgress);
416
+ }
417
+ render() {
418
+ return (index.h(index.Host, { exportparts: "button" }, this.isLoading() ? index.h("vviinn-preloader", null) : null, this.isLoading() ? null : (index.h("label", { htmlFor: "fileInput", part: "button" }, index.h("slot", { name: "upload-button-text" }, "Upload image"))), index.h("input", { id: "fileInput", class: "visually-hidden", type: "file", accept: "image/*", onChange: (event) => this.handleInputChange(event) })));
419
+ }
420
+ };
421
+ VviinnImageSelector.style = vviinnImageSelectorCss;
422
+
423
+ const vviinnImageViewCss = ":host{display:grid;position:relative;justify-self:center}img{box-sizing:border-box;filter:brightness(60%);position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;z-index:-1}.image-preloader{background:rgba(0, 0, 0, 0.25);border-radius:4px;bottom:18px;padding:4px 6px;pointer-events:none;position:absolute;right:18px;z-index:4}vviinn-preloader{--preloader-size:12px}";
424
+
425
+ const getImageSizes = (i) => {
426
+ const dimensions = index$1.dimensionsFromImage(i);
427
+ const resize = index$1.scaleByLargestSide(288);
428
+ const newDimensions = resize(dimensions);
429
+ const sizes = newDimensions.map((d) => d.size);
430
+ return [sizes[0], sizes[1]];
431
+ };
432
+ let VviinnImageView = class {
433
+ constructor(hostRef) {
434
+ index.registerInstance(this, hostRef);
435
+ }
436
+ handleInitialImageLoad(ev) {
437
+ const target = ev.target;
438
+ const imageBounds = index$1.fromImage(target);
439
+ const padding = 12;
440
+ const { x, y } = index$1.move(imageBounds, { x: padding, y: padding });
441
+ const searchArea = {
442
+ x,
443
+ y,
444
+ width: imageBounds.width - padding * 2,
445
+ height: imageBounds.height - padding * 2,
446
+ };
447
+ index$1.imageSearchState.imageBounds = index$1.Option.some(imageBounds);
448
+ index$1.imageSearchState.searchArea = index$1.Option.some(searchArea);
449
+ }
450
+ renderDetectedObject(object) {
451
+ return index.h("vviinn-detected-object", { detectedObject: object });
452
+ }
453
+ renderImage() {
454
+ return index$1._function.pipe(index$1.sequenceToOption(index$1.imageSearchState.imageUrl, index$1.imageSearchState.image), index$1.Option.map(([url, refImage]) => {
455
+ const [width, height] = getImageSizes(refImage);
456
+ const image = (index.h("img", { decoding: "async", width: width, height: height, src: url, onLoad: (el) => this.handleInitialImageLoad(el), draggable: false }));
457
+ return image;
458
+ }), index$1.Option.getOrElse(() => null));
459
+ }
460
+ renderCropper() {
461
+ return index$1._function.pipe(index$1.imageSearchState.imageUrl, index$1.Option.map(() => index.h("image-cropper", null)), index$1.Option.getOrElse(() => null));
462
+ }
463
+ render() {
464
+ return (index.h(index.Host, null, index$1.imageSearchState.loading ||
465
+ index$1.imageSearchState.objectDetectionInProgress ? (index.h("div", { class: "image-preloader" }, index.h("vviinn-preloader", null))) : null, index.h("highlight-box", null), this.renderImage(), this.renderCropper(), index$1.imageSearchState.detectedObjects.map((o) => this.renderDetectedObject(o))));
466
+ }
467
+ };
468
+ VviinnImageView.style = vviinnImageViewCss;
469
+
470
+ const vviinnModalCss = ":host{background:white;border-radius:4px;box-sizing:border-box;display:grid;grid-template-rows:-webkit-min-content auto;grid-template-rows:min-content auto;max-width:960px;overflow:auto}@media (max-width: 415px){:host{-webkit-animation-name:fade-in;animation-name:fade-in;-webkit-animation-duration:0.5s;animation-duration:0.5s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}:host(.closed){-webkit-animation-name:fade-out;animation-name:fade-out;-webkit-animation-fill-mode:none;animation-fill-mode:none}.body{overflow-y:auto}}@media (max-width: 640px) and (min-width: 415px){:host{max-width:80%}}.head{align-items:center;border-bottom:1px solid #f4f4f4;display:grid;grid-gap:16px;grid-template-columns:-webkit-min-content auto -webkit-min-content;grid-template-columns:min-content auto min-content;justify-items:center;padding:16px}.title{font-weight:600;font-size:18px;line-height:24px}button{-webkit-appearance:none;-moz-appearance:none;appearance:none;background:none;border:none;cursor:pointer;display:grid;padding:unset}@-webkit-keyframes fade-in{from{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes fade-in{from{transform:translateY(100%)}to{transform:translateY(0)}}@-webkit-keyframes fade-out{from{transform:translateY(0)}to{transform:translateY(100%)}}@keyframes fade-out{from{transform:translateY(0)}to{transform:translateY(100%)}}";
471
+
472
+ let VviinnModal = class {
473
+ constructor(hostRef) {
474
+ index.registerInstance(this, hostRef);
475
+ this.modalClosed = index.createEvent(this, "modalClosed", 7);
476
+ this.secondaryActionClicked = index.createEvent(this, "secondaryActionClicked", 7);
477
+ this.active = false;
478
+ this.slider = false;
479
+ }
480
+ close() {
481
+ this.active = false;
482
+ setTimeout(() => {
483
+ this.modalClosed.emit();
484
+ }, this.slider ? 500 : 0);
485
+ }
486
+ handleAnimationEnd(ev) {
487
+ if (ev.animationName !== "fade-in")
488
+ return;
489
+ this.slider = true;
490
+ }
491
+ render() {
492
+ return (index.h(index.Host, { exportparts: "secondary-action, title, close-button", class: { closed: !this.active }, onAnimationEnd: (ev) => this.handleAnimationEnd(ev) }, index.h("div", { class: "head" }, index.h("button", { part: "secondary-action", onClick: () => this.secondaryActionClicked.emit() }, index.h("svg", { width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, index.h("path", { d: "M20.25 12H3.75", stroke: "#161616", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }), index.h("path", { d: "M10.5 5.25L3.75 12L10.5 18.75", stroke: "#161616", "stroke-width": "2", "stroke-linecap": "round", "stroke-linejoin": "round" }))), index.h("div", { class: "title", part: "title" }, "Bildsuche"), index.h("button", { onClick: () => this.close(), class: "close-button", part: "close-button" }, index.h("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, index.h("path", { d: "M16 1.4L14.6 0L8 6.6L1.4 0L0 1.4L6.6 8L0 14.6L1.4 16L8 9.4L14.6 16L16 14.6L9.4 8L16 1.4Z", fill: "#333333" })))), index.h("div", { class: "body" }, index.h("slot", null))));
493
+ }
494
+ };
495
+ VviinnModal.style = vviinnModalCss;
496
+
497
+ const vviinnOnboardingCss = ":host{--color-primary-system:#0F62FE;--color-primary-hover-system:#014CDA;--color-icons-system:#2F8EDF;--spacer:8px}::host{display:block}h3{font-size:22px;font-weight:600;line-height:32px;margin:0;margin-bottom:16px;text-align:center}vviinn-slide{background:#f4f4f4;padding:24px}svg{padding:16px 0}.text{display:grid;grid-gap:8px}.text>h4{color:#161616;font-size:18px;font-weight:600;line-height:24px;margin:unset;text-align:center}.text>p{color:#525252;font-size:14px;font-style:normal;font-weight:normal;line-height:20px;margin:unset;text-align:center}.colored{fill:var(--color-icons, var(--color-icons-system))}";
498
+
499
+ let VviinnOnboarding = class {
500
+ constructor(hostRef) {
501
+ index.registerInstance(this, hostRef);
502
+ }
503
+ componentWillLoad() {
504
+ customizedSlots.slotChangeListener(this, this.el);
505
+ }
506
+ render() {
507
+ return (index.h(index.Host, null, index.h("slot", { name: "vviinn-onboarding-title" }, index.h("h3", null, "So funktioniert es")), index.h("vviinn-slider", { showArrows: true }, index.h("vviinn-slide", null, index.h("vviinn-onboarding-card-1", null)), index.h("vviinn-slide", null, index.h("vviinn-onboarding-card-2", null)), index.h("vviinn-slide", null, index.h("vviinn-onboarding-card-3", null)))));
508
+ }
509
+ get el() { return index.getElement(this); }
510
+ };
511
+ VviinnOnboarding.style = vviinnOnboardingCss;
512
+
513
+ const onboardingCardCss$2 = ":host{align-items:center;background:#f4f4f4;display:grid;grid-template-rows:repeat(2, 1fr);justify-items:center;padding:24px;width:100%}h4{color:#161616;font-size:18px;font-weight:600;line-height:24px;margin:unset;text-align:center}svg{padding:16px 0}p{color:#525252;font-size:14px;font-style:normal;font-weight:normal;line-height:20px;margin:unset;text-align:center}.colored{fill:var(--color-icons, var(--color-icons-system))}.text{display:grid;grid-gap:8px}";
514
+
515
+ let VviinnOnboardingCard1 = class {
516
+ constructor(hostRef) {
517
+ index.registerInstance(this, hostRef);
518
+ }
519
+ componentWillLoad() {
520
+ customizedSlots.slotChangeListener(this, this.el);
521
+ }
522
+ render() {
523
+ return (index.h(index.Host, null, index.h("slot", { name: "onboarding-card-1-icon" }, index.h(index$2.OnboardingCard1Icon, null)), index.h("slot", { name: "onboarding-card-1-text" }, index.h("div", { class: "text" }, index.h("h4", null, "Starte die Bildsuche"), index.h("p", null, "Lade ein Bild aus Deiner Galerie hoch oder fotografiere ein Produkt mit Deiner Kamera.")))));
524
+ }
525
+ get el() { return index.getElement(this); }
526
+ };
527
+ VviinnOnboardingCard1.style = onboardingCardCss$2;
528
+
529
+ const onboardingCardCss$1 = ":host{align-items:center;background:#f4f4f4;display:grid;grid-template-rows:repeat(2, 1fr);justify-items:center;padding:24px;width:100%}h4{color:#161616;font-size:18px;font-weight:600;line-height:24px;margin:unset;text-align:center}svg{padding:16px 0}p{color:#525252;font-size:14px;font-style:normal;font-weight:normal;line-height:20px;margin:unset;text-align:center}.colored{fill:var(--color-icons, var(--color-icons-system))}.text{display:grid;grid-gap:8px}";
530
+
531
+ let VviinnOnboardingCard2 = class {
532
+ constructor(hostRef) {
533
+ index.registerInstance(this, hostRef);
534
+ }
535
+ componentWillLoad() {
536
+ customizedSlots.slotChangeListener(this, this.el);
537
+ }
538
+ render() {
539
+ return (index.h(index.Host, null, index.h("slot", { name: "onboarding-card-2-icon" }, index.h(index$2.OnboardingCard2Icon, null)), index.h("slot", { name: "onboarding-card-2-text" }, index.h("div", { class: "text" }, index.h("h4", null, "Verfeiner deine Suche"), index.h("p", null, "Du kannst den Bildrahmen selber festlegen und so die Produkte genau ausw\u00E4hlen.")))));
540
+ }
541
+ get el() { return index.getElement(this); }
542
+ };
543
+ VviinnOnboardingCard2.style = onboardingCardCss$1;
544
+
545
+ const onboardingCardCss = ":host{align-items:center;background:#f4f4f4;display:grid;grid-template-rows:repeat(2, 1fr);justify-items:center;padding:24px;width:100%}h4{color:#161616;font-size:18px;font-weight:600;line-height:24px;margin:unset;text-align:center}svg{padding:16px 0}p{color:#525252;font-size:14px;font-style:normal;font-weight:normal;line-height:20px;margin:unset;text-align:center}.colored{fill:var(--color-icons, var(--color-icons-system))}.text{display:grid;grid-gap:8px}";
546
+
547
+ let VviinnOnboardingCard3 = class {
548
+ constructor(hostRef) {
549
+ index.registerInstance(this, hostRef);
550
+ }
551
+ componentWillLoad() {
552
+ customizedSlots.slotChangeListener(this, this.el);
553
+ }
554
+ render() {
555
+ return (index.h(index.Host, null, index.h("slot", { name: "onboarding-card-3-icon" }, index.h(index$2.OnboardingCard3Icon, null)), index.h("slot", { name: "onboarding-card-3-text" }, index.h("div", { class: "text" }, index.h("h4", null, "Ohne Hintergrund"), index.h("p", null, "Die besten Ergebnisse erh\u00E4ltst Du, wenn das gesuchte Objekt mit einfarbigem und hellem Hintergrund zu sehen ist.")))));
556
+ }
557
+ get el() { return index.getElement(this); }
558
+ };
559
+ VviinnOnboardingCard3.style = onboardingCardCss;
560
+
561
+ const vviinnOverlayCss = ":host{-webkit-animation:fade-in 0.5s ease-in-out;animation:fade-in 0.5s ease-in-out;background:rgba(0, 0, 0, 0.5);display:block;height:100vh;left:0;overflow:hidden;position:fixed;top:0;width:100vw;z-index:9999}@-webkit-keyframes fade-in{from{opacity:0.1}to{opacity:1}}@keyframes fade-in{from{opacity:0.1}to{opacity:1}}";
562
+
563
+ let VviinnOverlay = class {
564
+ constructor(hostRef) {
565
+ index.registerInstance(this, hostRef);
566
+ }
567
+ render() {
568
+ return (index.h(index.Host, null, index.h("slot", null)));
569
+ }
570
+ };
571
+ VviinnOverlay.style = vviinnOverlayCss;
572
+
573
+ const vviinnOverlayedModalCss = ":host{display:none}:host(.active){display:block}vviinn-overlay{align-items:center;display:grid;justify-items:center;cursor:default}@media (max-width: 415px){vviinn-modal{border-radius:4px 4px 0 0;height:100vh;margin-top:32px;transform:translateY(100%);width:100vw}vviinn-overlay{align-items:end;display:grid;justify-items:center}}";
574
+
575
+ let VviinnOverlayedModal = class {
576
+ constructor(hostRef) {
577
+ index.registerInstance(this, hostRef);
578
+ this.secondaryActionClicked = index.createEvent(this, "secondaryActionClicked", 7);
579
+ this.modalClosed = index.createEvent(this, "modalClosed", 7);
580
+ this.active = false;
581
+ }
582
+ render() {
583
+ return (index.h(index.Host, { class: { active: this.active } }, index.h("vviinn-overlay", null, index.h("vviinn-modal", { onSecondaryActionClicked: () => this.secondaryActionClicked.emit(), active: this.active }, index.h("slot", null, "CONTENT")))));
584
+ }
585
+ };
586
+ VviinnOverlayedModal.style = vviinnOverlayedModalCss;
587
+
588
+ 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)}}";
589
+
590
+ let VviinnPreloader = class {
591
+ constructor(hostRef) {
592
+ index.registerInstance(this, hostRef);
593
+ }
594
+ isActive() {
595
+ return (index$1.imageSearchState.loading || index$1.imageSearchState.objectDetectionInProgress);
596
+ }
597
+ render() {
598
+ return (index.h(index.Host, { class: {
599
+ active: this.isActive(),
600
+ } }));
601
+ }
602
+ };
603
+ VviinnPreloader.style = vviinnPreloaderCss;
604
+
605
+ const vviinnPrivacyBadgeCss = ":host{display:block;background:#F4F4F4;padding:17px}.content{display:grid;grid-template-columns:-webkit-min-content auto;grid-template-columns:min-content auto;grid-gap:9px}.content p{color:#525252;font-size:12px;line-height:16px;margin:unset}";
606
+
607
+ let VviinnPrivacyBadge = class {
608
+ constructor(hostRef) {
609
+ index.registerInstance(this, hostRef);
610
+ }
611
+ componentWillLoad() {
612
+ customizedSlots.slotChangeListener(this, this.el);
613
+ }
614
+ render() {
615
+ return (index.h(index.Host, null, index.h("slot", null, index.h("div", { class: "content" }, index.h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", fill: "none" }, index.h("defs", null), index.h("path", { fill: "#525252", d: "M8.5 11V7h-2v1h1v3H6v1h4v-1H8.5zM8 4a.75.75 0 100 1.5A.75.75 0 008 4z" }), index.h("path", { fill: "#525252", d: "M8 15A7 7 0 118 1a7 7 0 010 14zM8 2a6 6 0 100 12A6 6 0 008 2z" })), index.h("slot", { name: "vviinn-privacy-badge-text" }, index.h("p", null, "Wir gehen sorgf\u00E4ltig mit Deinen Daten um. Deine Bilder werden nur zum Zweck der Bildsuche gespeichert."))))));
616
+ }
617
+ get el() { return index.getElement(this); }
618
+ };
619
+ VviinnPrivacyBadge.style = vviinnPrivacyBadgeCss;
620
+
621
+ class GtagAnalytics {
622
+ sendImpression(product) {
623
+ var _a, _b, _c;
624
+ gtag('event', 'view_item_list', {
625
+ items: [
626
+ {
627
+ id: product.productId,
628
+ name: product.title,
629
+ brand: (_a = product.brand) !== null && _a !== void 0 ? _a : '',
630
+ category: (_b = product.productType) !== null && _b !== void 0 ? _b : '',
631
+ list_name: 'VI VPR View',
632
+ price: Math.min(...[product.price.actual, (_c = product.price.sale) !== null && _c !== void 0 ? _c : Infinity])
633
+ }
634
+ ]
635
+ });
636
+ return undefined;
637
+ }
638
+ sendClick(product) {
639
+ var _a, _b, _c;
640
+ gtag('event', 'select_content', {
641
+ content_type: 'product',
642
+ items: [
643
+ {
644
+ id: product.productId,
645
+ name: product.title,
646
+ brand: (_a = product.brand) !== null && _a !== void 0 ? _a : '',
647
+ category: (_b = product.productType) !== null && _b !== void 0 ? _b : '',
648
+ list_name: 'VI VPR View',
649
+ price: Math.min(...[product.price.actual, (_c = product.price.sale) !== null && _c !== void 0 ? _c : Infinity])
650
+ }
651
+ ]
652
+ });
653
+ return undefined;
654
+ }
655
+ }
656
+
657
+ class GAnalytics {
658
+ constructor() {
659
+ ga('require', 'ec');
660
+ }
661
+ convertProduct(product) {
662
+ var _a, _b, _c;
663
+ return {
664
+ id: product.productId,
665
+ name: product.title,
666
+ brand: (_a = product.brand) !== null && _a !== void 0 ? _a : '',
667
+ category: (_b = product.productType) !== null && _b !== void 0 ? _b : '',
668
+ list: 'VI VPR View',
669
+ price: Math.min(...[product.price.actual, (_c = product.price.sale) !== null && _c !== void 0 ? _c : Infinity])
670
+ };
671
+ }
672
+ sendImpression(product) {
673
+ ga('ec:addImpression', this.convertProduct(product));
674
+ return undefined;
675
+ }
676
+ sendClick(product) {
677
+ var _a, _b, _c;
678
+ ga('ec:addProduct', {
679
+ id: product.productId,
680
+ name: product.title,
681
+ brand: (_a = product.brand) !== null && _a !== void 0 ? _a : '',
682
+ category: (_b = product.productType) !== null && _b !== void 0 ? _b : '',
683
+ price: Math.min(...[product.price.actual, (_c = product.price.sale) !== null && _c !== void 0 ? _c : Infinity])
684
+ });
685
+ ga('ec:setAction', 'click', { list: 'VI VPR View' });
686
+ return undefined;
687
+ }
688
+ }
689
+
690
+ const getGtagAnalytics = () => index$1._function.pipe(index$1.Option.fromNullable(window.gtag), index$1.Option.map(() => new GtagAnalytics()));
691
+ const getCommonAnalytics = () => index$1._function.pipe(index$1.Option.fromNullable(window.ga), index$1.Option.map(() => new GAnalytics()));
692
+ const analyticsMonoid = index$1.Option.getMonoid(index$1.Semigroup.first());
693
+ const getAnalyticsModule = analyticsMonoid.concat(getGtagAnalytics(), getCommonAnalytics());
694
+
695
+ const FIT_EXPR = /fit\/\d+\//;
696
+ const containsFit = (url) => {
697
+ return index$1._function.pipe(url.match(FIT_EXPR), index$1.Either.fromNullable(url), index$1.Either.map(() => url));
698
+ };
699
+ const processWidth = (url, size) => {
700
+ return index$1._function.pipe(containsFit(url), index$1.Either.map((url) => url.replace(FIT_EXPR, `fit/${size}/`)), index$1.Either.getOrElse(() => url));
701
+ };
702
+ const Linked = (props, child) => props.deeplink ? (index.h("a", { class: props.part, part: props.part, href: props.deeplink }, child)) : (child);
703
+ const FormattedPrice = (props) => {
704
+ var _a;
705
+ const locale = props.locale;
706
+ const priceType = props.priceType;
707
+ const formattedPrice = new Intl.NumberFormat(locale, {
708
+ minimumFractionDigits: 2,
709
+ }).format(props.price);
710
+ const fullPrice = `${(_a = props.prefix) !== null && _a !== void 0 ? _a : ""} ${formattedPrice} ${props.currency}`;
711
+ return (index.h("span", { class: "price-amount", part: `price-amount${priceType ? "-" + priceType : ""}` }, fullPrice));
712
+ };
713
+ const Price = (props) => {
714
+ return (index.h("span", { class: "price-container", part: "price-container" }, props.salePrice ? ([
715
+ index.h("span", { class: "price-sale", part: "price-sale" },
716
+ index.h(FormattedPrice, { prefix: props.prefix, currency: props.currency, price: props.salePrice, locale: props.locale, priceType: "sale" })),
717
+ index.h("span", { class: "price-outdated", part: "price-outdated" },
718
+ index.h(FormattedPrice, { prefix: props.prefix, currency: props.currency, price: props.price, locale: props.locale, priceType: "outdated" })),
719
+ ]) : (index.h("span", { class: "price-regular", part: "price-regular" },
720
+ index.h(FormattedPrice, { prefix: props.prefix, currency: props.currency, price: props.price, locale: props.locale, priceType: "regular" })))));
721
+ };
722
+ const Image = (props, onLoadEnd = () => undefined) => (index.h("picture", null,
723
+ index.h("img", { loading: props.lazy ? "lazy" : "eager", part: "image", class: "image", width: props.width, height: props.height, src: processWidth(props.src, props.width), alt: props.title, onLoad: onLoadEnd })));
724
+ const ResponsiveImage = (props, onLoadEnd = () => undefined) => (index.h("picture", null,
725
+ index.h("img", { loading: props.lazy ? "lazy" : "eager", part: "image", class: "image responsive", src: processWidth(props.src, props.width), alt: props.title, onLoad: onLoadEnd })));
726
+
727
+ const vviinnProductCardCss = ":host{align-items:center;display:flex;flex-direction:column;gap:8px;height:100%}.price-container{display:flex;flex-direction:column}.price-sale,.price-regular{font-style:normal;font-weight:normal;font-size:16px;line-height:24px;color:#161616}.price-outdated{font-style:normal;font-weight:normal;font-size:16px;line-height:24px;color:#757575;text-decoration:line-through}.product-type{word-wrap:anywhere}.image{display:grid;align-content:center;-o-object-position:50% 50%;object-position:50% 50%;-o-object-fit:contain;object-fit:contain;text-align:center;box-sizing:border-box}img.responsive{width:100%;height:auto;aspect-ratio:1}.brand,.type{display:none}.title{-webkit-box-orient:vertical;-webkit-line-clamp:2;color:#161616;display:-webkit-box;font-size:16px;font-style:normal;font-weight:500;line-height:24px;margin-bottom:8px;overflow:hidden}.deeplink{text-decoration:none}.image-link{display:contents}picture{position:relative;width:100%}:host(.dimmed) picture::before{content:\"\";width:100%;height:100%;box-sizing:border-box;background:#f7f7f7;display:block;top:0;left:0;position:absolute;mix-blend-mode:multiply}";
728
+
729
+ let VviinnProductCard = class {
730
+ constructor(hostRef) {
731
+ index.registerInstance(this, hostRef);
732
+ this.recommendationLoad = index.createEvent(this, "recommendationLoad", 7);
733
+ this.recommendationView = index.createEvent(this, "recommendationView", 7);
734
+ this.recommendationClick = index.createEvent(this, "recommendationClick", 7);
735
+ this.productImageLoaded = index.createEvent(this, "productImageLoaded", 7);
736
+ this.currency = undefined;
737
+ this.imageRatio = 1;
738
+ this.imageWidth = 200;
739
+ this.locale = undefined;
740
+ this.pricePrefix = undefined;
741
+ this.responsive = false;
742
+ this.dimmedBackground = false;
743
+ /** @internal */
744
+ this.index = 0;
745
+ this.imageLoaded = false;
746
+ this.productData = null;
747
+ this.intersectionObserver = new IntersectionObserver(this.intersectionCallback.bind(this), { threshold: 1.0 });
748
+ }
749
+ connectedCallback() {
750
+ this.productData = this.getProductData();
751
+ }
752
+ getProductData() {
753
+ return {
754
+ product: this.productId,
755
+ rank: this.index,
756
+ };
757
+ }
758
+ intersectionCallback(data) {
759
+ if (data.some((entry) => entry.isIntersecting)) {
760
+ index$1._function.pipe(getAnalyticsModule, index$1.Option.map((analytics) => analytics.sendImpression(this.getProduct())));
761
+ this.recommendationView.emit(this.productData);
762
+ this.intersectionObserver.disconnect();
763
+ }
764
+ }
765
+ componentDidLoad() {
766
+ this.recommendationLoad.emit(this.productData);
767
+ this.intersectionObserver.observe(this.el);
768
+ const links = this.el.shadowRoot.querySelectorAll("a");
769
+ links.forEach((link) => link.addEventListener("click", (event) => {
770
+ event.preventDefault();
771
+ event.stopImmediatePropagation();
772
+ this.recommendationClick.emit(this.getProductData());
773
+ index$1._function.pipe(getAnalyticsModule, index$1.Option.match(() => null, (analytics) => analytics.sendClick(this.getProduct())));
774
+ }));
775
+ }
776
+ getProduct() {
777
+ return index$1.imageSearchState.results.find((r) => r.productId === this.productId);
778
+ }
779
+ renderImage() {
780
+ const props = {
781
+ width: this.imageWidth,
782
+ height: this.imageWidth * this.imageRatio,
783
+ src: this.image,
784
+ title: this.productTitle,
785
+ lazy: false,
786
+ };
787
+ return this.responsive
788
+ ? ResponsiveImage(props, () => this.kek())
789
+ : Image(props, () => this.kek());
790
+ }
791
+ kek() {
792
+ this.productImageLoaded.emit(this.productId);
793
+ }
794
+ render() {
795
+ var _a, _b, _c;
796
+ return (index.h(index.Host, { part: "product-card", class: { dimmed: this.dimmedBackground }, exportparts: "brand, currency, deeplink, image, image-link, price-amount-sale, price-amount-outdated, price-amount-regular, price-container, price-outdated, price-prefix, price-regular, price-sale, title" }, index.h(Linked, { deeplink: this.deeplink, part: "image-link" }, this.renderImage()), index.h(Linked, { deeplink: this.deeplink, part: "deeplink" }, index.h("span", { class: "title", part: "title" }, this.productTitle)), index.h("span", { class: "brand", part: "brand" }, this.brand), index.h("span", { class: "type", part: "type" }, this.productType), index.h(Price, { prefix: (_a = this.pricePrefix) !== null && _a !== void 0 ? _a : index$1.state.pricePrefix, currency: (_b = this.currency) !== null && _b !== void 0 ? _b : index$1.state.currencySign, price: this.price, salePrice: this.salePrice, locale: (_c = this.locale) !== null && _c !== void 0 ? _c : index$1.state.locale })));
797
+ }
798
+ get el() { return index.getElement(this); }
799
+ };
800
+ VviinnProductCard.style = vviinnProductCardCss;
801
+
802
+ const vviinnServerErrorCss = ":host{display:block}";
803
+
804
+ let VviinnServerError = class {
805
+ constructor(hostRef) {
806
+ index.registerInstance(this, hostRef);
807
+ this.actionClick = index.createEvent(this, "actionClick", 7);
808
+ }
809
+ render() {
810
+ return (index.h(index.Host, null, index.h("vviinn-error", null, index.h("h4", { slot: "title" }, "Keine Verbindung"), index.h("span", { slot: "text" }, "Etwas hat leider nicht funktioniert. Bitte pr\u00FCfen Sie Ihre Internetverbindung und laden Sie das Bild noch einmal hoch."), index.h("button", { slot: "action", onClick: () => this.actionClick.emit() }, "Erneut versuchen"))));
811
+ }
812
+ };
813
+ VviinnServerError.style = vviinnServerErrorCss;
814
+
815
+ const vviinnSlideCss = ":host{display:grid;justify-items:center}";
816
+
817
+ let VviinnSlide = class {
818
+ constructor(hostRef) {
819
+ index.registerInstance(this, hostRef);
820
+ }
821
+ render() {
822
+ return (index.h(index.Host, null, index.h("slot", null)));
823
+ }
824
+ };
825
+ VviinnSlide.style = vviinnSlideCss;
826
+
827
+ const getStyleMap = (data) => {
828
+ return {
829
+ "arrow-wrapper": true,
830
+ [data.kind]: true,
831
+ disabled: data.disabled,
832
+ };
833
+ };
834
+ const Arrow = ({ kind, tabindex, disabled, onClick, onKeyDown, }) => (index.h("div", { class: getStyleMap({ kind, disabled }), onClick: onClick, tabindex: tabindex, onKeyDown: onKeyDown },
835
+ index.h(index$2.ArrowIcon, null)));
836
+
837
+ const vviinnSliderCss = ":host{--color-primary-system:#0F62FE;--color-primary-hover-system:#014CDA;--color-icons-system:#2F8EDF;--spacer:8px}:host{--num-items:0;--position:0;display:grid;grid-gap:20px;justify-items:center;position:relative}.items-wrapper{overflow:hidden;width:100%}.items{box-sizing:border-box;display:grid;grid-auto-flow:column;grid-template-columns:repeat(var(--num-items), 100%);transform:translateX(calc(-100% * var(--position)));transition:transform 0.33s ease-in-out}.controls{display:grid;grid-gap:16px;grid-template-columns:repeat(var(--num-items), -webkit-min-content);grid-template-columns:repeat(var(--num-items), min-content)}.bullet{background:#e0e0e0;border-radius:50%;box-sizing:border-box;cursor:pointer;height:8px;width:8px;transition:background 0.1s ease-in-out}.bullet:hover{background:#c6c6c6}.bullet.active{background:var(--color-primary, var(--color-primary-system))}.bullet:active{background:transparent;border:2px solid var(--color-primary, var(--color-primary-system))}.arrow-wrapper{align-items:center;cursor:pointer;background:white;border:2px solid white;bottom:0;box-sizing:border-box;display:grid;height:calc(var(--spacer) * 6);justify-items:center;margin:auto;position:absolute;top:0;transform:translate3d(0, -50%, 0);transition:border 0.25ms ease-in-out;width:calc(var(--spacer) * 4)}.arrow-wrapper:active{border-color:var(--color-primary, var(--color-primary-system));opacity:0.75}.arrow-wrapper:focus{border-color:var(--color-primary, var(--color-primary-system));opacity:0.5;outline:none}.prev{left:0}.next{right:0}.next>svg{transform:rotate3d(0, 1, 0, 180deg)}.arrow-wrapper>svg{transition:fill 0.25ms ease-in-out;fill:#a8a8a8}.arrow-wrapper:hover>svg{fill:#8d8d8d}";
838
+
839
+ let VviinnSlider = class {
840
+ constructor(hostRef) {
841
+ index.registerInstance(this, hostRef);
842
+ this.elementsCount = 0;
843
+ this.internalPosition = 0;
844
+ this.swipeStartPosition = index$1.Option.none;
845
+ this.showBullets = true;
846
+ this.position = 0;
847
+ this.showArrows = false;
848
+ }
849
+ positionWatchHandler(newValue) {
850
+ this.internalPosition = newValue;
851
+ this.el.style.setProperty("--position", `${newValue}`);
852
+ this.setActiveCssClassToSlide(newValue);
853
+ }
854
+ connectedCallback() {
855
+ this.handleDomContentChanges();
856
+ }
857
+ handleDomContentChanges() {
858
+ const items = this.el.querySelectorAll("vviinn-slide");
859
+ this.elementsCount = items.length;
860
+ this.el.style.setProperty("--num-items", `${this.elementsCount}`);
861
+ this.setActiveCssClassToSlide(0);
862
+ }
863
+ setActiveCssClassToSlide(index) {
864
+ const items = this.el.querySelectorAll("vviinn-slide");
865
+ items.forEach((i) => i.classList.remove("active"));
866
+ items[index].classList.add("active");
867
+ }
868
+ goToSlide(index) {
869
+ this.internalPosition = index;
870
+ this.el.style.setProperty("--position", `${index}`);
871
+ this.setActiveCssClassToSlide(index);
872
+ }
873
+ renderBullets() {
874
+ return this.showBullets ? (index.h("div", { class: "controls" }, index$1.NonEmptyArray.range(0, this.elementsCount - 1).map((i) => (index.h("div", { class: {
875
+ bullet: true,
876
+ active: i == this.internalPosition % this.elementsCount,
877
+ }, onClick: () => this.goToSlide(i) }))))) : null;
878
+ }
879
+ nextSlide() {
880
+ this.internalPosition++;
881
+ this.renderSlidePosition();
882
+ }
883
+ prevSlide() {
884
+ const nextPostion = this.internalPosition - 1;
885
+ this.internalPosition =
886
+ nextPostion > -1 ? nextPostion : this.elementsCount - 1;
887
+ this.renderSlidePosition();
888
+ }
889
+ renderSlidePosition() {
890
+ requestAnimationFrame(() => {
891
+ this.el.style.setProperty("--position", `${this.internalPosition % this.elementsCount}`);
892
+ });
893
+ }
894
+ handleKeyDown(event) {
895
+ if (event.key !== "Space" && event.key !== "Enter")
896
+ return;
897
+ const target = event.target;
898
+ const direction = target.className.includes("prev") ? "prev" : "next";
899
+ switch (direction) {
900
+ case "prev":
901
+ this.prevSlide();
902
+ break;
903
+ case "next":
904
+ this.nextSlide();
905
+ break;
906
+ }
907
+ }
908
+ handleTouchStart(event) {
909
+ if (!this.showBullets)
910
+ return;
911
+ this.swipeStartPosition = index$1._function.pipe(event.touches[0], index$1.Option.fromNullable, index$1.Option.map((t) => t.clientX));
912
+ }
913
+ handleTouchEnd(event) {
914
+ if (!this.showBullets)
915
+ return;
916
+ const swipeEndPosition = index$1._function.pipe(event.changedTouches[0], index$1.Option.fromNullable, index$1.Option.map((t) => t.clientX));
917
+ index$1._function.pipe(index$1.sequenceToOption(this.swipeStartPosition, swipeEndPosition), index$1.Option.map(([start, end]) => Ord.compare(start, end)), index$1.Option.map((swipeDirection) => {
918
+ switch (swipeDirection) {
919
+ case 1:
920
+ return this.nextSlide();
921
+ case -1:
922
+ return this.prevSlide();
923
+ }
924
+ }));
925
+ }
926
+ render() {
927
+ return (index.h(index.Host, null, index.h("div", { class: "items-wrapper" }, index.h("div", { class: "items", onTouchStart: (e) => this.handleTouchStart(e), onTouchEnd: (e) => this.handleTouchEnd(e) }, index.h("slot", null))), this.showArrows
928
+ ? [
929
+ index.h(Arrow, { kind: "prev", onClick: () => this.prevSlide(), onKeyDown: (ev) => this.handleKeyDown(ev), tabindex: 1, disabled: false }),
930
+ index.h(Arrow, { kind: "next", onClick: () => this.nextSlide(), onKeyDown: (ev) => this.handleKeyDown(ev), tabindex: 0, disabled: false }),
931
+ ]
932
+ : null, this.renderBullets()));
933
+ }
934
+ get el() { return index.getElement(this); }
935
+ static get watchers() { return {
936
+ "position": ["positionWatchHandler"]
937
+ }; }
938
+ };
939
+ VviinnSlider.style = vviinnSliderCss;
940
+
941
+ const vviinnTeaserCss = ":host{align-items:center;display:grid;justify-items:center;grid-gap:16px}.vviinn-teaser-text{font-size:28px;font-weight:600;line-height:40px;size:28px;text-align:center}";
942
+
943
+ let VviinnTeaser = class {
944
+ constructor(hostRef) {
945
+ index.registerInstance(this, hostRef);
946
+ }
947
+ componentWillLoad() {
948
+ customizedSlots.slotChangeListener(this, this.el);
949
+ }
950
+ render() {
951
+ return (index.h(index.Host, null, index.h("slot", null, index.h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "64", height: "64", fill: "none" }, index.h("defs", null), index.h("path", { fill: "#C6C6C6", d: "M48 28a11.98 11.98 0 00-9.77 18.942L28 57.172 30.828 60l10.23-10.23A11.994 11.994 0 1048 28zm0 20a8 8 0 118-8 8.009 8.009 0 01-8 8zM34 24a6 6 0 10-6-6 6.006 6.006 0 006 6zm0-8a2 2 0 110 4 2 2 0 010-4z" }), index.h("path", { fill: "#C6C6C6", d: "M24 48H8V35.993L18 26l11.172 11.172L32 34.336 20.828 23.165a4 4 0 00-5.656 0L8 30.336V8h40v12h4V8a4.004 4.004 0 00-4-4H8a4.004 4.004 0 00-4 4v40a4.005 4.005 0 004 4h16v-4z" })), index.h("span", { class: "vviinn-teaser-text" }, index.h("slot", { name: "vviinn-teaser-text" }, "Finde Produkte auf ", index.h("br", null), " einem Foto")))));
952
+ }
953
+ get el() { return index.getElement(this); }
954
+ };
955
+ VviinnTeaser.style = vviinnTeaserCss;
956
+
957
+ 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}";
958
+
959
+ const filterInt = (value) => /^[-+]?(\d+|Infinity)$/.test(value) ? Number(value) : NaN;
960
+ const notEmptyString = (s) => !index$1.isEmpty(s);
961
+ const notNan = (n) => !isNaN(n);
962
+ let VviinnVpsWidget = class {
963
+ constructor(hostRef) {
964
+ index.registerInstance(this, hostRef);
965
+ /** @internal */
966
+ this.apiPath = "https://api.vviinn.com";
967
+ /** When true modal window with widget will be shown */
968
+ this.active = false;
969
+ /** Currency sign will shown after price */
970
+ this.currencySign = "€";
971
+ /** Locale for currency formatting */
972
+ this.locale = "de-DE";
973
+ this.slidePosition = 0;
974
+ this.width = 0;
975
+ this.wrongImageFormat = false;
976
+ this.trackingDeactivated = false;
977
+ this.imageSource = null;
978
+ this.setTrackingDeactivated = (result) => {
979
+ if (result.status === "rejected") {
980
+ this.trackingDeactivated = true;
981
+ }
982
+ };
983
+ }
984
+ activeWatcher(value) {
985
+ if (value) {
986
+ this.overflow = document.body.style.overflow;
987
+ document.body.style.overflow = "hidden";
988
+ this.trackOpenEvent();
989
+ }
990
+ else {
991
+ document.body.style.overflow = this.overflow;
992
+ }
993
+ }
994
+ trackRecommendationView({ detail }) {
995
+ if (this.trackingDeactivated)
996
+ return;
997
+ const recommendationViewEvent = index$1.createProductViewVpsEvent(Object.assign({ session_id: this.uiSessionId }, detail));
998
+ this.trackingApi
999
+ .trackEvent(recommendationViewEvent)
1000
+ .then(this.setTrackingDeactivated);
1001
+ }
1002
+ async trackRecommendationClick({ detail }) {
1003
+ const recommendationClickEvent = index$1.createProductClickVpsEvent(Object.assign({ session_id: this.uiSessionId }, detail));
1004
+ if (!this.trackingDeactivated) {
1005
+ await this.trackingApi
1006
+ .trackEvent(this.trackingDeactivated ? null : recommendationClickEvent)
1007
+ .then(this.setTrackingDeactivated);
1008
+ }
1009
+ const product = index$1.imageSearchState.results.find((r) => r.productId === detail.product);
1010
+ if (!product || !product.deeplink)
1011
+ return;
1012
+ window.location.href = product.deeplink;
1013
+ }
1014
+ trachSearchAreaChanges() {
1015
+ if (this.trackingDeactivated)
1016
+ return;
1017
+ const searchEvent = index$1.createSearchEvent({
1018
+ session_id: this.uiSessionId,
1019
+ source: this.imageSource,
1020
+ search_area: "manual-selection",
1021
+ });
1022
+ this.trackingApi.trackEvent(searchEvent).then(this.setTrackingDeactivated);
1023
+ }
1024
+ trackDetectedObject() {
1025
+ if (this.trackingDeactivated)
1026
+ return;
1027
+ const searchEvent = index$1.createSearchEvent({
1028
+ session_id: this.uiSessionId,
1029
+ source: this.imageSource,
1030
+ search_area: "attention-point",
1031
+ });
1032
+ this.trackingApi.trackEvent(searchEvent).then(this.setTrackingDeactivated);
1033
+ }
1034
+ trackFilter({ detail }) {
1035
+ if (this.trackingDeactivated)
1036
+ return;
1037
+ const searchEvent = index$1.createFilterEvent({
1038
+ session_id: this.uiSessionId,
1039
+ source: this.imageSource,
1040
+ kind: "category",
1041
+ action: detail,
1042
+ });
1043
+ this.trackingApi.trackEvent(searchEvent).then(this.setTrackingDeactivated);
1044
+ }
1045
+ componentWillLoad() {
1046
+ customizedSlots.slotChangeListener(this, this.el);
1047
+ }
1048
+ connectedCallback() {
1049
+ index$1.state.apiPath = this.apiPath;
1050
+ index$1.state.currencySign = this.currencySign;
1051
+ index$1.state.locale = this.locale;
1052
+ index$1.imageSearchState.token = this.token;
1053
+ index$1.imageSearchState.campaignId = index$1._function.pipe(this.campaignId, index$1.Option.fromNullable, index$1.Option.chain(index$1.Option.fromPredicate(notEmptyString)), index$1.Option.map(filterInt), index$1.Option.chain(index$1.Option.fromPredicate(notNan)), index$1.Option.map((s) => `${s}`));
1054
+ this.uiSessionId = index$1.v4();
1055
+ this.trackingApi = index$1.createTrackingApi(this.apiPath, this.token);
1056
+ }
1057
+ trackOpenEvent() {
1058
+ if (this.trackingDeactivated)
1059
+ return;
1060
+ const widgetOpenEvent = index$1.createWidgetVpsEvent({
1061
+ action: "open",
1062
+ session_id: this.uiSessionId,
1063
+ });
1064
+ this.trackingApi
1065
+ .trackEvent(widgetOpenEvent)
1066
+ .then(this.setTrackingDeactivated);
1067
+ }
1068
+ handleImageSelection(source) {
1069
+ this.imageSource = source;
1070
+ this.slidePosition = 1;
1071
+ const root = this.el.shadowRoot.querySelector("vviinn-overlayed-modal");
1072
+ const overlay = root.shadowRoot.querySelector("vviinn-overlay");
1073
+ const modal = overlay.querySelector("vviinn-modal");
1074
+ const modalBody = modal.shadowRoot.querySelector(".body");
1075
+ modalBody.scrollTop = 0;
1076
+ this.trackInitialSearch();
1077
+ }
1078
+ trackInitialSearch() {
1079
+ if (this.trackingDeactivated)
1080
+ return;
1081
+ const searchEvent = index$1.createSearchEvent({
1082
+ session_id: this.uiSessionId,
1083
+ source: this.imageSource,
1084
+ search_area: "full",
1085
+ });
1086
+ this.trackingApi.trackEvent(searchEvent).then(this.setTrackingDeactivated);
1087
+ }
1088
+ resetState() {
1089
+ this.resetScroll("onboarding-block");
1090
+ this.slidePosition = 0;
1091
+ index$1.imageSearchState.image = index$1.Option.none;
1092
+ index$1.imageSearchState.imageUrl = index$1.Option.none;
1093
+ index$1.imageSearchState.imageBounds = index$1.Option.none;
1094
+ index$1.imageSearchState.searchArea = index$1.Option.none;
1095
+ index$1.imageSearchState.results = [];
1096
+ index$1.imageSearchState.filters = [];
1097
+ index$1.imageSearchState.detectedObjects = [];
1098
+ index$1.imageSearchState.activeIonLink = undefined;
1099
+ index$1.imageSearchState.rectangleSearchForm = undefined;
1100
+ this.resetScroll("results-block");
1101
+ }
1102
+ haveErrors() {
1103
+ return this.wrongImageFormat || index$1.imageSearchState.serverError;
1104
+ }
1105
+ resetScroll(elementId, behavior = "auto") {
1106
+ const element = this.el.shadowRoot.getElementById(elementId);
1107
+ element.scroll({ top: 0, left: 0, behavior });
1108
+ }
1109
+ handleModalClose() {
1110
+ this.active = false;
1111
+ this.resetState();
1112
+ const elementsToReset = ["onboarding-block", "results-block"];
1113
+ elementsToReset.forEach((name) => this.resetScroll(name));
1114
+ if (this.trackingDeactivated)
1115
+ return;
1116
+ const widgetOpenEvent = index$1.createWidgetVpsEvent({
1117
+ action: "close",
1118
+ session_id: this.uiSessionId,
1119
+ });
1120
+ this.trackingApi
1121
+ .trackEvent(widgetOpenEvent)
1122
+ .then(this.setTrackingDeactivated);
1123
+ }
1124
+ render() {
1125
+ return (index.h(index.Host, null, index.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, example-images" }, index.h("vviinn-slider", { showBullets: false, position: this.slidePosition }, index.h("vviinn-slide", { class: { "start-page": true } }, index.h("div", { class: {
1126
+ error: this.haveErrors(),
1127
+ "start-page_block": true,
1128
+ } }, index.h("vviinn-wrong-format", { class: { hidden: !this.wrongImageFormat }, onActionClick: () => (this.wrongImageFormat = false) }), index.h("vviinn-server-error", { class: { hidden: !index$1.imageSearchState.serverError }, onActionClick: () => (index$1.imageSearchState.serverError = false) }), index.h("vviinn-teaser", { class: { hidden: this.haveErrors() } }), index.h("vviinn-image-selector", { class: { hidden: this.haveErrors() }, onImageSelected: () => this.handleImageSelection("upload"), onImageSelectedError: () => (this.wrongImageFormat = true), part: "select-image_button" }, index.h("span", { slot: "upload-button-text", class: "upload-button-content" }, index.h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "29", height: "28", fill: "none" }, index.h("defs", null), index.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" }), index.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" })), index.h("slot", { name: "vviinn-image-upload-button-text" }, index.h("span", null, "Kamera oder Bild ausw\u00E4hlen")))), index.h("vviinn-privacy-badge", { class: { hidden: this.haveErrors() } })), index.h("div", { id: "onboarding-block", class: "start-page_block" }, index.h("div", { class: "onboarding-wrapper" }, index.h("vviinn-onboarding", null), index.h("vviinn-example-images", { part: "example-images", onImageSelected: () => this.handleImageSelection("example"), onImageSelectedError: () => this.resetScroll("onboarding-block", "smooth") })))), index.h("vviinn-slide", { class: { "results-page": true, active: this.slidePosition == 1 } }, index.h("div", { class: "image-wrapper" }, index.h("vviinn-image-view", null), index.h("div", { class: "filters-wrapper" }, index.h("div", { class: "filters" }, index$1.imageSearchState.filters.map((filter) => (index.h("search-filters", { filter: filter })))))), index.h("div", { id: "results-block", class: "products-wrapper" }, index.h("div", { class: {
1129
+ "nothing-found": true,
1130
+ hidden: index$1.imageSearchState.results.length > 0,
1131
+ } }, index.h("vviinn-empty-results", null), index.h("vviinn-onboarding", null)), index.h("div", { class: {
1132
+ hidden: index$1.imageSearchState.results.length <= 0,
1133
+ products: true,
1134
+ } }, index$1.imageSearchState.results.map((p, i) => {
1135
+ var _a;
1136
+ return (index.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 }));
1137
+ }))))))));
1138
+ }
1139
+ get el() { return index.getElement(this); }
1140
+ static get watchers() { return {
1141
+ "active": ["activeWatcher"]
1142
+ }; }
1143
+ };
1144
+ VviinnVpsWidget.style = vviinnVpsWidgetCss;
1145
+
1146
+ const vviinnWrongFormatCss = ":host{display:block}";
1147
+
1148
+ let VviinnWrongFormat = class {
1149
+ constructor(hostRef) {
1150
+ index.registerInstance(this, hostRef);
1151
+ this.actionClick = index.createEvent(this, "actionClick", 7);
1152
+ }
1153
+ render() {
1154
+ return (index.h(index.Host, null, index.h("vviinn-error", null, index.h("h4", { slot: "title" }, "Dateityp wird nicht unterst\u00FCtzt"), index.h("span", { slot: "text" }, "Leider unterst\u00FCtzen wir dieses Format nicht. Bitte laden Sie eine .jpg, .png oder .webp Bilddatei hoch."), index.h("button", { slot: "action", onClick: () => this.actionClick.emit() }, "Neues Bild hochladen"))));
1155
+ }
1156
+ };
1157
+ VviinnWrongFormat.style = vviinnWrongFormatCss;
1158
+
1159
+ exports.cropper_handler = CropperHandler;
1160
+ exports.highlight_box = HighlightBox;
1161
+ exports.image_cropper = ImageCropper;
1162
+ exports.search_filters = SearchFilters;
1163
+ exports.vviinn_detected_object = VviinnDetectedObject;
1164
+ exports.vviinn_empty_results = VviinnEmptyResults;
1165
+ exports.vviinn_error = VviinnError;
1166
+ exports.vviinn_example_image = VviinnExampleImage;
1167
+ exports.vviinn_example_images = VviinnExampleImages;
1168
+ exports.vviinn_image_selector = VviinnImageSelector;
1169
+ exports.vviinn_image_view = VviinnImageView;
1170
+ exports.vviinn_modal = VviinnModal;
1171
+ exports.vviinn_onboarding = VviinnOnboarding;
1172
+ exports.vviinn_onboarding_card_1 = VviinnOnboardingCard1;
1173
+ exports.vviinn_onboarding_card_2 = VviinnOnboardingCard2;
1174
+ exports.vviinn_onboarding_card_3 = VviinnOnboardingCard3;
1175
+ exports.vviinn_overlay = VviinnOverlay;
1176
+ exports.vviinn_overlayed_modal = VviinnOverlayedModal;
1177
+ exports.vviinn_preloader = VviinnPreloader;
1178
+ exports.vviinn_privacy_badge = VviinnPrivacyBadge;
1179
+ exports.vviinn_product_card = VviinnProductCard;
1180
+ exports.vviinn_server_error = VviinnServerError;
1181
+ exports.vviinn_slide = VviinnSlide;
1182
+ exports.vviinn_slider = VviinnSlider;
1183
+ exports.vviinn_teaser = VviinnTeaser;
1184
+ exports.vviinn_vps_widget = VviinnVpsWidget;
1185
+ exports.vviinn_wrong_format = VviinnWrongFormat;