@crystaldesign/content-box 25.5.0-beta.3 → 25.5.0-beta.30

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 (62) hide show
  1. package/build/esm/{index-3c27633d.js → index-16f04a6e.js} +29 -1354
  2. package/build/esm/{index-6620fc12.js → index-6da1a514.js} +4 -10
  3. package/build/esm/{index-1b7e0d4d.js → index-912ae569.js} +130 -10
  4. package/build/esm/{index-fe38fbad.js → index-aa006b31.js} +2 -10
  5. package/build/esm/index.js +3 -11
  6. package/build/esm/{zoom.module-adbbceb5.js → zoom.module-aa601a75.js} +3 -11
  7. package/build/types/content-box/src/types/index.d.ts +1 -28
  8. package/build/types/content-box/src/types/index.d.ts.map +1 -1
  9. package/build/types/content-box/src/ui/ContentBox/index.d.ts.map +1 -1
  10. package/build/umd/215.content-box.umd.min.js +1 -1
  11. package/build/umd/215.content-box.umd.min.js.LICENSE.txt +2 -0
  12. package/build/umd/654.content-box.umd.min.js +2 -0
  13. package/build/umd/654.content-box.umd.min.js.LICENSE.txt +39 -0
  14. package/build/umd/705.content-box.umd.min.js +2 -0
  15. package/build/umd/705.content-box.umd.min.js.LICENSE.txt +1 -0
  16. package/build/umd/content-box.umd.min.js +1 -1
  17. package/build/umd/content-box.umd.min.js.LICENSE.txt +0 -30
  18. package/build/umd/report.html +1 -1
  19. package/package.json +2 -2
  20. package/build/esm/index-65df1e5b.js +0 -60
  21. package/build/esm/index-6fcb1b64.js +0 -102
  22. package/build/esm/index-8aa3289b.js +0 -55
  23. package/build/types/content-box/src/Context/PdpContext.d.ts +0 -12
  24. package/build/types/content-box/src/Context/PdpContext.d.ts.map +0 -1
  25. package/build/types/content-box/src/ui/PDP/Footer/index.d.ts +0 -8
  26. package/build/types/content-box/src/ui/PDP/Footer/index.d.ts.map +0 -1
  27. package/build/types/content-box/src/ui/PDP/Header/index.d.ts +0 -11
  28. package/build/types/content-box/src/ui/PDP/Header/index.d.ts.map +0 -1
  29. package/build/types/content-box/src/ui/PDP/InfoSlider/Checkpoint/CheckpointFooter/index.d.ts +0 -9
  30. package/build/types/content-box/src/ui/PDP/InfoSlider/Checkpoint/CheckpointFooter/index.d.ts.map +0 -1
  31. package/build/types/content-box/src/ui/PDP/InfoSlider/Checkpoint/History/index.d.ts +0 -5
  32. package/build/types/content-box/src/ui/PDP/InfoSlider/Checkpoint/History/index.d.ts.map +0 -1
  33. package/build/types/content-box/src/ui/PDP/InfoSlider/Checkpoint/index.d.ts +0 -10
  34. package/build/types/content-box/src/ui/PDP/InfoSlider/Checkpoint/index.d.ts.map +0 -1
  35. package/build/types/content-box/src/ui/PDP/InfoSlider/Functions/FunctionsFooter/index.d.ts +0 -9
  36. package/build/types/content-box/src/ui/PDP/InfoSlider/Functions/FunctionsFooter/index.d.ts.map +0 -1
  37. package/build/types/content-box/src/ui/PDP/InfoSlider/Functions/index.d.ts +0 -10
  38. package/build/types/content-box/src/ui/PDP/InfoSlider/Functions/index.d.ts.map +0 -1
  39. package/build/types/content-box/src/ui/PDP/InfoSlider/PDFIcons/index.d.ts +0 -10
  40. package/build/types/content-box/src/ui/PDP/InfoSlider/PDFIcons/index.d.ts.map +0 -1
  41. package/build/types/content-box/src/ui/PDP/InfoSlider/index.d.ts +0 -8
  42. package/build/types/content-box/src/ui/PDP/InfoSlider/index.d.ts.map +0 -1
  43. package/build/types/content-box/src/ui/PDP/Product/RotateIcon/index.d.ts +0 -6
  44. package/build/types/content-box/src/ui/PDP/Product/RotateIcon/index.d.ts.map +0 -1
  45. package/build/types/content-box/src/ui/PDP/Product/index.d.ts +0 -12
  46. package/build/types/content-box/src/ui/PDP/Product/index.d.ts.map +0 -1
  47. package/build/types/content-box/src/ui/PDP/index.d.ts +0 -6
  48. package/build/types/content-box/src/ui/PDP/index.d.ts.map +0 -1
  49. package/build/types/content-box/src/ui/PDP/state/index.d.ts +0 -70
  50. package/build/types/content-box/src/ui/PDP/state/index.d.ts.map +0 -1
  51. package/build/types/content-box/src/ui/PDP/utils.d.ts +0 -4
  52. package/build/types/content-box/src/ui/PDP/utils.d.ts.map +0 -1
  53. package/build/umd/122.content-box.umd.min.js +0 -2
  54. package/build/umd/122.content-box.umd.min.js.LICENSE.txt +0 -19
  55. package/build/umd/135.content-box.umd.min.js +0 -2
  56. package/build/umd/135.content-box.umd.min.js.LICENSE.txt +0 -1
  57. package/build/umd/263.content-box.umd.min.js +0 -2
  58. package/build/umd/263.content-box.umd.min.js.LICENSE.txt +0 -1
  59. package/build/umd/700.content-box.umd.min.js +0 -2
  60. package/build/umd/700.content-box.umd.min.js.LICENSE.txt +0 -1
  61. package/build/umd/800.content-box.umd.min.js +0 -2
  62. package/build/umd/800.content-box.umd.min.js.LICENSE.txt +0 -1
@@ -1,19 +1,11 @@
1
1
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
2
2
  import React, { useState, useEffect, Suspense, useMemo, useContext } from 'react';
3
3
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
4
- import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
5
4
  import { useTranslation, useDivaCore, DivaUtils, getLogger, DivaError } from '@crystaldesign/diva-core';
5
+ import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
6
+ import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
6
7
  import classNames from 'classnames';
7
- import { observer } from 'mobx-react-lite';
8
8
  import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
9
- import _asyncToGenerator from '@babel/runtime/helpers/asyncToGenerator';
10
- import _regeneratorRuntime from '@babel/runtime/regenerator';
11
- import { md5 } from '@crystaldesign/diva-utils';
12
- import _classCallCheck from '@babel/runtime/helpers/classCallCheck';
13
- import _createClass from '@babel/runtime/helpers/createClass';
14
- import { toJS, makeObservable, observable, action, computed } from 'mobx';
15
- import _objectDestructuringEmpty from '@babel/runtime/helpers/objectDestructuringEmpty';
16
- import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
17
9
  import ReactDOMServer from 'react-dom/server';
18
10
  import { Swiper, SwiperSlide } from 'swiper/react';
19
11
  import { FreeMode, Pagination, Navigation, Autoplay, Thumbs, Mousewheel } from 'swiper/modules';
@@ -72,10 +64,10 @@ function styleInject(css, ref) {
72
64
  }
73
65
  }
74
66
 
75
- var wrapper$3 = "wrapper-664fl";
76
- var icon$1 = "icon-esCB2";
77
- var css_248z$i = ".wrapper-664fl {\n display: flex;\n align-items: center;\n margin: 6px 12px;\n gap: 6px;\n}\n\n.icon-esCB2 {\n background-image: url(\"data:image/svg+xml,%3Csvg version%3D%221.1%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22 x%3D%220px%22 y%3D%220px%22%09 width%3D%22334.371px%22 height%3D%22380.563px%22 viewBox%3D%220 0 334.371 380.563%22 enable-background%3D%22new 0 0 334.371 380.563%22%09 xml%3Aspace%3D%22preserve%22%3E%3Cg id%3D%22icon_PDF_file%22%3E%09%3Cg id%3D%22contour_1%22%3E%09%09%3Cpolygon fill%3D%22%23FFFFFF%22 points%3D%2251.791%2C356.646 51.791%2C23.99 204.497%2C23.99 282.646%2C102.066 282.646%2C356.646 %09%09%22%2F%3E%09%09%3Cpath d%3D%22M201.186%2C31.99l73.46%2C73.393v243.264H59.791V31.99H201.186 M207.809%2C15.99H43.791v348.657h246.854V98.75L207.809%2C15.99%09%09%09L207.809%2C15.99z%22%2F%3E%09%3C%2Fg%3E%09%3Cg id%3D%22contour_2%22%3E%09%09%3Cpolygon fill%3D%22%23FFFFFF%22 points%3D%2251.791%2C356.646 51.791%2C23.99 204.497%2C23.99 206.309%2C25.8 206.309%2C100.327 280.904%2C100.327 %09%09%09282.646%2C102.066 282.646%2C356.646 %09%09%22%2F%3E%09%09%3Cpath d%3D%22M198.309%2C31.99v60.337v16h16h60.337v240.32H59.791V31.99H198.309 M207.809%2C15.99H43.791v348.657h246.854V98.75%09%09%09l-6.43-6.424h-69.907V22.484L207.809%2C15.99L207.809%2C15.99z%22%2F%3E%09%3C%2Fg%3E%09%3Cg id%3D%22triangle%22%3E%09%09%3Cpolygon points%3D%22219.643%2C87.75 219.643%2C48.667 258.309%2C86.38 258.309%2C87.75 %09%09%22%2F%3E%09%09%3Cpath d%3D%22M227.643%2C67.646l12.41%2C12.104h-12.41V67.646 M222.641%2C40.417h-10.998V95.75h54.666V83.008L222.641%2C40.417L222.641%2C40.417z%09%09%09%22%2F%3E%09%3C%2Fg%3E%09%3Cg id%3D%22red_square%22%3E%09%09%3Cpolygon fill%3D%22%23ED1C24%22 points%3D%2222.544%2C284.49 22.544%2C167.682 37.291%2C152.935 37.291%2C171.489 297.146%2C171.489 297.146%2C152.935 %09%09%09311.893%2C167.682 311.893%2C284.49 %09%09%22%2F%3E%09%09%3Cpath fill%3D%22%23ED1C24%22 d%3D%22M303.646%2C168.627l1.747%2C1.747V277.99H29.044V170.374l1.747-1.747v9.362h13h246.854h13V168.627%09%09%09 M290.646%2C137.242v27.747H43.791v-27.747l-27.747%2C27.747V290.99h302.349V164.989L290.646%2C137.242L290.646%2C137.242z%22%2F%3E%09%3C%2Fg%3E%09%3Crect x%3D%2252.096%22 y%3D%22189.324%22 fill%3D%22none%22 width%3D%22232.826%22 height%3D%2287.834%22%2F%3E%09%3Ctext transform%3D%22matrix(1 0 0 1 52.0957 271.6621)%22 fill%3D%22%23FFFFFF%22 font-family%3D%22DejaVu Sans%22 font-weight%3D%22bold%22 font-size%3D%22105%22%3EPDF%3C%2Ftext%3E%3C%2Fg%3E%3C%2Fsvg%3E\");\n background-size: contain;\n background-repeat: no-repeat;\n}\n";
78
- styleInject(css_248z$i);
67
+ var wrapper$1 = "wrapper-664fl";
68
+ var icon = "icon-esCB2";
69
+ var css_248z$a = ".wrapper-664fl {\n display: flex;\n align-items: center;\n margin: 6px 12px;\n gap: 6px;\n}\n\n.icon-esCB2 {\n background-image: url(\"data:image/svg+xml,%3Csvg version%3D%221.1%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22 x%3D%220px%22 y%3D%220px%22%09 width%3D%22334.371px%22 height%3D%22380.563px%22 viewBox%3D%220 0 334.371 380.563%22 enable-background%3D%22new 0 0 334.371 380.563%22%09 xml%3Aspace%3D%22preserve%22%3E%3Cg id%3D%22icon_PDF_file%22%3E%09%3Cg id%3D%22contour_1%22%3E%09%09%3Cpolygon fill%3D%22%23FFFFFF%22 points%3D%2251.791%2C356.646 51.791%2C23.99 204.497%2C23.99 282.646%2C102.066 282.646%2C356.646 %09%09%22%2F%3E%09%09%3Cpath d%3D%22M201.186%2C31.99l73.46%2C73.393v243.264H59.791V31.99H201.186 M207.809%2C15.99H43.791v348.657h246.854V98.75L207.809%2C15.99%09%09%09L207.809%2C15.99z%22%2F%3E%09%3C%2Fg%3E%09%3Cg id%3D%22contour_2%22%3E%09%09%3Cpolygon fill%3D%22%23FFFFFF%22 points%3D%2251.791%2C356.646 51.791%2C23.99 204.497%2C23.99 206.309%2C25.8 206.309%2C100.327 280.904%2C100.327 %09%09%09282.646%2C102.066 282.646%2C356.646 %09%09%22%2F%3E%09%09%3Cpath d%3D%22M198.309%2C31.99v60.337v16h16h60.337v240.32H59.791V31.99H198.309 M207.809%2C15.99H43.791v348.657h246.854V98.75%09%09%09l-6.43-6.424h-69.907V22.484L207.809%2C15.99L207.809%2C15.99z%22%2F%3E%09%3C%2Fg%3E%09%3Cg id%3D%22triangle%22%3E%09%09%3Cpolygon points%3D%22219.643%2C87.75 219.643%2C48.667 258.309%2C86.38 258.309%2C87.75 %09%09%22%2F%3E%09%09%3Cpath d%3D%22M227.643%2C67.646l12.41%2C12.104h-12.41V67.646 M222.641%2C40.417h-10.998V95.75h54.666V83.008L222.641%2C40.417L222.641%2C40.417z%09%09%09%22%2F%3E%09%3C%2Fg%3E%09%3Cg id%3D%22red_square%22%3E%09%09%3Cpolygon fill%3D%22%23ED1C24%22 points%3D%2222.544%2C284.49 22.544%2C167.682 37.291%2C152.935 37.291%2C171.489 297.146%2C171.489 297.146%2C152.935 %09%09%09311.893%2C167.682 311.893%2C284.49 %09%09%22%2F%3E%09%09%3Cpath fill%3D%22%23ED1C24%22 d%3D%22M303.646%2C168.627l1.747%2C1.747V277.99H29.044V170.374l1.747-1.747v9.362h13h246.854h13V168.627%09%09%09 M290.646%2C137.242v27.747H43.791v-27.747l-27.747%2C27.747V290.99h302.349V164.989L290.646%2C137.242L290.646%2C137.242z%22%2F%3E%09%3C%2Fg%3E%09%3Crect x%3D%2252.096%22 y%3D%22189.324%22 fill%3D%22none%22 width%3D%22232.826%22 height%3D%2287.834%22%2F%3E%09%3Ctext transform%3D%22matrix(1 0 0 1 52.0957 271.6621)%22 fill%3D%22%23FFFFFF%22 font-family%3D%22DejaVu Sans%22 font-weight%3D%22bold%22 font-size%3D%22105%22%3EPDF%3C%2Ftext%3E%3C%2Fg%3E%3C%2Fsvg%3E\");\n background-size: contain;\n background-repeat: no-repeat;\n}\n";
70
+ styleInject(css_248z$a);
79
71
 
80
72
  var PDF = function PDF(_ref) {
81
73
  var description = _ref.description,
@@ -84,13 +76,13 @@ var PDF = function PDF(_ref) {
84
76
  openInNewTab = _ref.openInNewTab,
85
77
  iconsize = _ref.iconsize;
86
78
  return /*#__PURE__*/jsxs("div", {
87
- className: wrapper$3,
79
+ className: wrapper$1,
88
80
  style: style,
89
81
  children: [/*#__PURE__*/jsx("a", {
90
82
  href: url,
91
83
  target: !openInNewTab ? undefined : '_blank',
92
84
  children: /*#__PURE__*/jsx("div", {
93
- className: icon$1,
85
+ className: icon,
94
86
  style: {
95
87
  height: iconsize,
96
88
  width: iconsize
@@ -104,1333 +96,6 @@ var PDF = function PDF(_ref) {
104
96
  });
105
97
  };
106
98
 
107
- var pdpWrapper = "pdp-wrapper-qWbzb";
108
- var pdpScroller = "pdp-scroller-SBMN1";
109
- var pdpSplitter$1 = "pdp-splitter-qTYDV";
110
- var inFunction = "in-function-gR9tP";
111
- var desktopInfoWrapper = "desktop-info-wrapper-Kw2XW";
112
- var variantsWrapper$1 = "variants-wrapper-jFu0Y";
113
- var right = "right-4TZwV";
114
- var left$1 = "left-5ViYX";
115
- var variantsInInfoWrapper = "variants-in-info-wrapper-4vTcs";
116
- var css_248z$h = ".pdp-wrapper-qWbzb {\n width: 100%;\n height: 100%;\n position: relative;\n font-family: var(--diva-typography-font-family);\n}\n\n.pdp-scroller-SBMN1 {\n width: 100%;\n height: 100%;\n overflow-y: auto;\n}\n\n.pdp-splitter-qTYDV {\n width: 100%;\n height: 100%;\n display: flex;\n}\n\n.pdp-splitter-qTYDV > div:nth-child(1) {\n width: calc(60% - 16px);\n margin-right: 16px;\n transition: width 0.3s ease;\n}\n.pdp-splitter-qTYDV > div:nth-child(2) {\n width: 40%;\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n transition: width 0.3s ease;\n}\n\n.in-function-gR9tP .pdp-splitter-qTYDV > div:nth-child(1) {\n width: calc(30% - 16px);\n margin-right: 16px;\n}\n.in-function-gR9tP .pdp-splitter-qTYDV > div:nth-child(2) {\n width: 70%;\n display: flex;\n flex-direction: column;\n justify-content: flex-start;\n}\n\n.desktop-info-wrapper-Kw2XW {\n position: relative;\n padding-bottom: 70px;\n}\n\n.variants-wrapper-jFu0Y {\n width: 100%;\n position: absolute;\n}\n\n.variants-wrapper-jFu0Y > div {\n position: absolute;\n z-index: 100;\n display: flex;\n flex-direction: row;\n gap: 5px;\n top: 20px;\n}\n\n.variants-wrapper-jFu0Y.right-4TZwV > div {\n right: 16px;\n top: 70px;\n}\n\n.variants-wrapper-jFu0Y.left-5ViYX > div {\n left: 16px;\n}\n\n.variants-in-info-wrapper-4vTcs {\n overflow: auto;\n}\n\n.variants-in-info-wrapper-4vTcs span {\n width: 42px;\n height: 42px;\n margin-bottom: 12px;\n}\n";
117
- styleInject(css_248z$h);
118
-
119
- var headerWrapper = "header-wrapper-3U1SO";
120
- var infoIcon = "info-icon-JiM5P";
121
- var css_248z$g = ".diva-product-wrapper {\n height: 100%;\n width: 100%;\n position: relative;\n}\n.header-wrapper-3U1SO {\n display: flex;\n justify-content: flex-end;\n position: absolute;\n top: 0;\n width: calc(100% - 58px);\n margin-top: 15px;\n margin-left: 8px;\n z-index: 100;\n}\n.header-wrapper-3U1SO > div:first-child {\n flex-basis: 100%;\n}\n\n.info-icon-JiM5P {\n width: 32px;\n height: 32px;\n margin-right: 16px;\n background: center / contain no-repeat url(\"data:image/svg+xml,%3Csvg width%3D%2220%22 height%3D%2220%22 viewBox%3D%220 0 20 20%22 fill%3D%22none%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath d%3D%22M9.25 15C9.25 15.4142 9.58579 15.75 10 15.75C10.4142 15.75 10.75 15.4142 10.75 15H9.25ZM10.75 8C10.75 7.58579 10.4142 7.25 10 7.25C9.58579 7.25 9.25 7.58579 9.25 8H10.75ZM9.25 5.00996C9.25 5.42418 9.58579 5.75996 10 5.75996C10.4142 5.75996 10.75 5.42418 10.75 5.00996H9.25ZM10.75 4.99997C10.75 4.58576 10.4142 4.24997 10 4.24997C9.58579 4.24997 9.25 4.58576 9.25 4.99997H10.75ZM10.75 15L10.75 8H9.25L9.25 15H10.75ZM10.75 5.00996V4.99997H9.25V5.00996H10.75ZM18.25 10C18.25 14.5563 14.5563 18.25 10 18.25V19.75C15.3848 19.75 19.75 15.3848 19.75 10H18.25ZM10 18.25C5.44365 18.25 1.75 14.5563 1.75 10H0.25C0.25 15.3848 4.61522 19.75 10 19.75V18.25ZM1.75 10C1.75 5.44365 5.44365 1.75 10 1.75V0.25C4.61522 0.25 0.25 4.61522 0.25 10H1.75ZM10 1.75C14.5563 1.75 18.25 5.44365 18.25 10H19.75C19.75 4.61522 15.3848 0.25 10 0.25V1.75Z%22 fill%3D%22%234F4F4F%22%2F%3E%3C%2Fsvg%3E\");\n}\n";
122
- styleInject(css_248z$g);
123
-
124
- var headerContainer = "header-container-Z01So";
125
- var marginLeft = "margin-left-G-1uJ";
126
- var price$1 = "price-4kAy0";
127
- var css_248z$f = ".header-container-Z01So {\n z-index: 10;\n color: #4b4b4b;\n margin-bottom: 32px;\n width: calc(100% - 60px);\n}\n.header-container-Z01So.margin-left-G-1uJ {\n margin-left: 54px;\n width: calc(100% - 114px);\n}\n.header-container-Z01So h2 {\n line-height: 26px;\n margin-top: 0px;\n margin-bottom: 8px;\n}\n\n.price-4kAy0 {\n font-weight: normal;\n font-size: 18px;\n line-height: 28px;\n}\n";
128
- styleInject(css_248z$f);
129
-
130
- var _excluded$4 = ["product", "marginLeftHeader"];
131
- function ownKeys$g(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
132
- function _objectSpread$g(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$g(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$g(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
133
- var Header = function Header(_ref) {
134
- var _product$discountedPr;
135
- var product = _ref.product,
136
- marginLeftHeader = _ref.marginLeftHeader,
137
- props = _objectWithoutProperties(_ref, _excluded$4);
138
- var _useTranslation = useTranslation(),
139
- t = _useTranslation.t;
140
- var _useDivaCore = useDivaCore(),
141
- hidePrices = _useDivaCore.state.hidePrices;
142
- if (!product) return /*#__PURE__*/jsx(Fragment, {});
143
- return /*#__PURE__*/jsxs("div", _objectSpread$g(_objectSpread$g({}, props), {}, {
144
- className: classNames(headerContainer, marginLeftHeader ? marginLeft : undefined),
145
- children: [/*#__PURE__*/jsx("h2", {
146
- children: product.shortDescription
147
- }), !hidePrices && /*#__PURE__*/jsx("div", {
148
- className: price$1,
149
- children: DivaUtils.formatPrice((_product$discountedPr = product.discountedPrice) !== null && _product$discountedPr !== void 0 ? _product$discountedPr : product.addedPrice) + ' ' + t('pdp.price_ending')
150
- })]
151
- }));
152
- };
153
- var Header$1 = observer(Header);
154
-
155
- var infoWrapper = "info-wrapper-UDcc4";
156
- var technicalDesc = "technical-desc-p1WXF";
157
- var pContainer = "p-container-Lwhnp";
158
- var css_248z$e = ".info-wrapper-UDcc4 {\n width: 100%;\n position: relative;\n flex-basis: 100%;\n overflow: hidden;\n}\n\n.technical-desc-p1WXF {\n font-weight: normal;\n font-size: 14px;\n color: #8f8f8f;\n}\n\n.p-container-Lwhnp {\n width: 100%;\n height: -moz-fit-content;\n height: fit-content;\n max-height: calc(100% - 40px);\n overflow: auto;\n}\n\np.p-container-Lwhnp p:first-child {\n margin-top: 0;\n}\n";
159
- styleInject(css_248z$e);
160
-
161
- var wrapper$2 = "wrapper-032sJ";
162
- var row = "row-f-nQk";
163
- var colum = "colum-9xbAO";
164
- var textWrapper = "text-wrapper-WvpyS";
165
- var css_248z$d = ".wrapper-032sJ {\n width: 100%;\n padding: 12px;\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n overflow: auto;\n font-size: 12px;\n position: relative;\n height: 100%;\n}\n\n.row-f-nQk {\n display: flex;\n flex-direction: row;\n gap: 0px;\n align-items: center;\n border-bottom: 1px solid lightgrey;\n justify-content: space-between;\n padding: 10px;\n max-width: 100%;\n}\n\n.row-f-nQk img {\n margin-left: 12px;\n width: 120px;\n height: auto;\n}\n.colum-9xbAO {\n display: flex;\n align-items: center;\n gap: 10px;\n}\n.colum-9xbAO img {\n width: 50px;\n height: 50px;\n}\n\n.text-wrapper-WvpyS {\n display: flex;\n flex-direction: column;\n gap: 5px;\n width: 150px;\n}\n";
166
- styleInject(css_248z$d);
167
-
168
- var Functions = function Functions(_ref) {
169
- var pdpState = _ref.pdpState;
170
- var _useState = useState([]),
171
- _useState2 = _slicedToArray(_useState, 2),
172
- table = _useState2[0],
173
- setTable = _useState2[1];
174
- useEffect(function () {
175
- pdpState.loadVariants().then(function (table) {
176
- return setTable(table);
177
- });
178
- }, [pdpState.product, pdpState.variants]);
179
- return /*#__PURE__*/jsx("div", {
180
- className: wrapper$2,
181
- children: table.map(function (r) {
182
- return /*#__PURE__*/jsxs("div", {
183
- className: row,
184
- children: [/*#__PURE__*/jsx("div", {
185
- children: r.variantId
186
- }), /*#__PURE__*/jsx("img", {
187
- src: r.image
188
- }), r.colums.map(function (c) {
189
- return /*#__PURE__*/jsxs("div", {
190
- className: colum,
191
- children: [!!c.image && /*#__PURE__*/jsx("img", {
192
- src: c.image
193
- }), /*#__PURE__*/jsxs("div", {
194
- className: textWrapper,
195
- children: [/*#__PURE__*/jsx("div", {
196
- children: c.optName
197
- }), /*#__PURE__*/jsx("div", {
198
- children: c.name
199
- })]
200
- })]
201
- });
202
- })]
203
- });
204
- })
205
- });
206
- };
207
- var Functions$1 = observer(Functions);
208
-
209
- var _excluded$3 = ["pdpState"];
210
- function ownKeys$f(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
211
- function _objectSpread$f(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$f(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$f(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
212
- var Checkpoint = /*#__PURE__*/React.lazy(function () {
213
- return import('./index-6fcb1b64.js');
214
- });
215
- var InfoSlider = function InfoSlider(_ref) {
216
- var _pdpState$infoTabs$ma, _pdpState$infoTabs;
217
- var pdpState = _ref.pdpState,
218
- porps = _objectWithoutProperties(_ref, _excluded$3);
219
- var _useState = useState(null),
220
- _useState2 = _slicedToArray(_useState, 2),
221
- swiperRef = _useState2[0],
222
- setSwiperRef = _useState2[1];
223
- var _useTranslation = useTranslation(),
224
- i18n = _useTranslation.i18n,
225
- t = _useTranslation.t;
226
- var _useDivaCore = useDivaCore(),
227
- _useDivaCore$state$di = _useDivaCore.state.dimensions,
228
- height = _useDivaCore$state$di.height,
229
- width = _useDivaCore$state$di.width;
230
- var infoSliderContent = (_pdpState$infoTabs$ma = pdpState === null || pdpState === void 0 || (_pdpState$infoTabs = pdpState.infoTabs) === null || _pdpState$infoTabs === void 0 ? void 0 : _pdpState$infoTabs.map(function (tab) {
231
- var _pdpState$product$inf, _pdpState$product, _pdpState$product2;
232
- switch (tab) {
233
- case 'cp1':
234
- case 'cp2':
235
- case 'cp':
236
- return {
237
- title: t('pdp.' + tab),
238
- content: /*#__PURE__*/jsx(Suspense, {
239
- fallback: /*#__PURE__*/jsx(Fragment, {}),
240
- children: /*#__PURE__*/jsx(Checkpoint, {
241
- pdpState: pdpState
242
- })
243
- })
244
- };
245
- case 'functions':
246
- return {
247
- title: t('pdp.function'),
248
- content: /*#__PURE__*/jsx(Suspense, {
249
- fallback: /*#__PURE__*/jsx(Fragment, {}),
250
- children: /*#__PURE__*/jsx(Functions$1, {
251
- pdpState: pdpState
252
- })
253
- })
254
- };
255
- case 'info':
256
- return {
257
- title: t('pdp.info'),
258
- content: /*#__PURE__*/jsx("p", {
259
- className: classNames(pContainer, technicalDesc),
260
- dangerouslySetInnerHTML: {
261
- __html: (_pdpState$product$inf = (_pdpState$product = pdpState.product) === null || _pdpState$product === void 0 ? void 0 : _pdpState$product.info) !== null && _pdpState$product$inf !== void 0 ? _pdpState$product$inf : ''
262
- }
263
- })
264
- };
265
- case 'tech':
266
- return {
267
- title: t('pdp.technical_description'),
268
- content: /*#__PURE__*/jsx("p", {
269
- className: classNames(pContainer, technicalDesc),
270
- dangerouslySetInnerHTML: {
271
- __html: DivaUtils.sizeFormatter(pdpState.product, i18n) + '<br/>' + ((_pdpState$product2 = pdpState.product) === null || _pdpState$product2 === void 0 || (_pdpState$product2 = _pdpState$product2.technicalDescription) === null || _pdpState$product2 === void 0 ? void 0 : _pdpState$product2.replace(/,\n/g, '<br/>').replace(/\n,/g, '<br/>'))
272
- }
273
- })
274
- };
275
- }
276
- })) !== null && _pdpState$infoTabs$ma !== void 0 ? _pdpState$infoTabs$ma : [];
277
- if (!infoSliderContent.length) return /*#__PURE__*/jsx(Fragment, {});
278
- return /*#__PURE__*/jsx("div", _objectSpread$f(_objectSpread$f({}, porps), {}, {
279
- className: infoWrapper,
280
- children: /*#__PURE__*/jsx(ContentBox$1, {
281
- type: "SliderContainer",
282
- sliderType: "Tabs",
283
- allowTouchMove: false,
284
- contents: infoSliderContent,
285
- swipeRef: [swiperRef, setSwiperRef]
286
- }, 'id_' + height + width)
287
- }));
288
- };
289
-
290
- var rotationWrapper = "rotation-wrapper-MryZM";
291
- var rotationIcon = "rotation-icon-10luP";
292
- var rotationText = "rotation-text-N7GQl";
293
- var hide = "hide-39OOm";
294
- var css_248z$c = ".rotation-wrapper-MryZM {\n right: 0;\n position: absolute;\n margin-right: 24px;\n margin-top: 24px;\n display: flex;\n z-index: 100;\n}\n\n.rotation-icon-10luP {\n width: 30px;\n height: 30px;\n background: center / contain no-repeat url(\"data:image/svg+xml,%3Csvg width%3D%2220%22 height%3D%2221%22 viewBox%3D%220 0 20 21%22 fill%3D%22none%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Crect x%3D%221%22 y%3D%2220%22 width%3D%2210.1704%22 height%3D%2215.6467%22 rx%3D%223%22 transform%3D%22rotate(-90 1 20)%22 stroke%3D%22%234F4F4F%22 stroke-width%3D%221.2%22%2F%3E%3Cpath d%3D%22M18.9985 16.9904L18.9985 4.34375C18.9985 2.6869 17.6553 1.34375 15.9985 1.34375L11.8281 1.34375C10.1713 1.34375 8.82813 2.68689 8.82813 4.34375L8.82813 9.1671%22 stroke%3D%22%234F4F4F%22 stroke-width%3D%221.2%22 stroke-linecap%3D%22round%22%2F%3E%3Cpath d%3D%22M6 4C3.79086 4 2 5.79086 2 8%22 stroke%3D%22%234F4F4F%22 stroke-linecap%3D%22round%22%2F%3E%3Cpath d%3D%22M5.2909 5.64514L6.62891 4.26953L5.2909 2.89392%22 stroke%3D%22%234F4F4F%22 stroke-linecap%3D%22round%22 stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E\");\n z-index: 100;\n}\n\n.rotation-text-N7GQl {\n transition: opacity 0.4s ease;\n opacity: 1;\n margin-right: 16px;\n line-height: 32px;\n}\n\n.hide-39OOm {\n opacity: 0;\n}\n";
295
- styleInject(css_248z$c);
296
-
297
- var RotationIcon = function RotationIcon(props) {
298
- var _useState = useState(false),
299
- _useState2 = _slicedToArray(_useState, 2),
300
- rotationClicked = _useState2[0],
301
- setRotationClicked = _useState2[1];
302
- var _useDivaCore = useDivaCore(),
303
- isMobile = _useDivaCore.state.dimensions.isMobile;
304
- var _useState3 = useState(null),
305
- _useState4 = _slicedToArray(_useState3, 2),
306
- closingTimeout = _useState4[0],
307
- setClosingTimeout = _useState4[1];
308
- var _useTranslation = useTranslation(),
309
- t = _useTranslation.t;
310
- var onClick = /*#__PURE__*/function () {
311
- var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
312
- return _regeneratorRuntime.wrap(function _callee$(_context) {
313
- while (1) switch (_context.prev = _context.next) {
314
- case 0:
315
- if (closingTimeout) clearTimeout(closingTimeout);
316
- setRotationClicked(!rotationClicked);
317
- setClosingTimeout(setTimeout(function () {
318
- setRotationClicked(false);
319
- }, 5000));
320
- case 3:
321
- case "end":
322
- return _context.stop();
323
- }
324
- }, _callee);
325
- }));
326
- return function onClick() {
327
- return _ref.apply(this, arguments);
328
- };
329
- }();
330
- if (!isMobile) return /*#__PURE__*/jsx(Fragment, {});
331
- return /*#__PURE__*/jsxs("div", {
332
- onClick: onClick,
333
- className: rotationWrapper,
334
- children: [/*#__PURE__*/jsx("div", {
335
- className: classNames(rotationText, rotationClicked ? undefined : hide),
336
- children: t('pdp.rotate_to_leave_fullscreen')
337
- }), /*#__PURE__*/jsx("div", {
338
- className: rotationIcon
339
- })]
340
- });
341
- };
342
-
343
- var wrapper$1 = "wrapper-WJVhP";
344
- var icon = "icon-xPuPu";
345
- var css_248z$b = ".wrapper-WJVhP {\n display: flex;\n /* justify-content: center; */\n align-items: center;\n width: 100%;\n margin: 6px 12px;\n gap: 12px;\n}\n\n.icon-xPuPu {\n background-image: url(\"data:image/svg+xml,%3Csvg version%3D%221.1%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22 x%3D%220px%22 y%3D%220px%22%09 width%3D%22334.371px%22 height%3D%22380.563px%22 viewBox%3D%220 0 334.371 380.563%22 enable-background%3D%22new 0 0 334.371 380.563%22%09 xml%3Aspace%3D%22preserve%22%3E%3Cg id%3D%22icon_PDF_file%22%3E%09%3Cg id%3D%22contour_1%22%3E%09%09%3Cpolygon fill%3D%22%23FFFFFF%22 points%3D%2251.791%2C356.646 51.791%2C23.99 204.497%2C23.99 282.646%2C102.066 282.646%2C356.646 %09%09%22%2F%3E%09%09%3Cpath d%3D%22M201.186%2C31.99l73.46%2C73.393v243.264H59.791V31.99H201.186 M207.809%2C15.99H43.791v348.657h246.854V98.75L207.809%2C15.99%09%09%09L207.809%2C15.99z%22%2F%3E%09%3C%2Fg%3E%09%3Cg id%3D%22contour_2%22%3E%09%09%3Cpolygon fill%3D%22%23FFFFFF%22 points%3D%2251.791%2C356.646 51.791%2C23.99 204.497%2C23.99 206.309%2C25.8 206.309%2C100.327 280.904%2C100.327 %09%09%09282.646%2C102.066 282.646%2C356.646 %09%09%22%2F%3E%09%09%3Cpath d%3D%22M198.309%2C31.99v60.337v16h16h60.337v240.32H59.791V31.99H198.309 M207.809%2C15.99H43.791v348.657h246.854V98.75%09%09%09l-6.43-6.424h-69.907V22.484L207.809%2C15.99L207.809%2C15.99z%22%2F%3E%09%3C%2Fg%3E%09%3Cg id%3D%22triangle%22%3E%09%09%3Cpolygon points%3D%22219.643%2C87.75 219.643%2C48.667 258.309%2C86.38 258.309%2C87.75 %09%09%22%2F%3E%09%09%3Cpath d%3D%22M227.643%2C67.646l12.41%2C12.104h-12.41V67.646 M222.641%2C40.417h-10.998V95.75h54.666V83.008L222.641%2C40.417L222.641%2C40.417z%09%09%09%22%2F%3E%09%3C%2Fg%3E%09%3Cg id%3D%22red_square%22%3E%09%09%3Cpolygon fill%3D%22%23ED1C24%22 points%3D%2222.544%2C284.49 22.544%2C167.682 37.291%2C152.935 37.291%2C171.489 297.146%2C171.489 297.146%2C152.935 %09%09%09311.893%2C167.682 311.893%2C284.49 %09%09%22%2F%3E%09%09%3Cpath fill%3D%22%23ED1C24%22 d%3D%22M303.646%2C168.627l1.747%2C1.747V277.99H29.044V170.374l1.747-1.747v9.362h13h246.854h13V168.627%09%09%09 M290.646%2C137.242v27.747H43.791v-27.747l-27.747%2C27.747V290.99h302.349V164.989L290.646%2C137.242L290.646%2C137.242z%22%2F%3E%09%3C%2Fg%3E%09%3Crect x%3D%2252.096%22 y%3D%22189.324%22 fill%3D%22none%22 width%3D%22232.826%22 height%3D%2287.834%22%2F%3E%09%3Ctext transform%3D%22matrix(1 0 0 1 52.0957 271.6621)%22 fill%3D%22%23FFFFFF%22 font-family%3D%22DejaVu Sans%22 font-weight%3D%22bold%22 font-size%3D%22105%22%3EPDF%3C%2Ftext%3E%3C%2Fg%3E%3C%2Fsvg%3E\");\n background-position: center center;\n background-size: contain;\n background-repeat: no-repeat;\n display: block;\n width: 26px;\n height: 26px;\n}\n";
346
- styleInject(css_248z$b);
347
-
348
- var pdfIcon = "data:image/svg+xml,%3Csvg%20version%3D%221.1%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22%20x%3D%220px%22%20y%3D%220px%22%20%20width%3D%22334.371px%22%20height%3D%22380.563px%22%20viewBox%3D%220%200%20334.371%20380.563%22%20enable-background%3D%22new%200%200%20334.371%20380.563%22%20%20xml%3Aspace%3D%22preserve%22%3E%3Cg%20id%3D%22icon_PDF_file%22%3E%20%3Cg%20id%3D%22contour_1%22%3E%20%20%3Cpolygon%20fill%3D%22%23FFFFFF%22%20points%3D%2251.791%2C356.646%2051.791%2C23.99%20204.497%2C23.99%20282.646%2C102.066%20282.646%2C356.646%20%20%20%22%2F%3E%20%20%3Cpath%20d%3D%22M201.186%2C31.99l73.46%2C73.393v243.264H59.791V31.99H201.186%20M207.809%2C15.99H43.791v348.657h246.854V98.75L207.809%2C15.99%20%20%20L207.809%2C15.99z%22%2F%3E%20%3C%2Fg%3E%20%3Cg%20id%3D%22contour_2%22%3E%20%20%3Cpolygon%20fill%3D%22%23FFFFFF%22%20points%3D%2251.791%2C356.646%2051.791%2C23.99%20204.497%2C23.99%20206.309%2C25.8%20206.309%2C100.327%20280.904%2C100.327%20%20%20%20282.646%2C102.066%20282.646%2C356.646%20%20%20%22%2F%3E%20%20%3Cpath%20d%3D%22M198.309%2C31.99v60.337v16h16h60.337v240.32H59.791V31.99H198.309%20M207.809%2C15.99H43.791v348.657h246.854V98.75%20%20%20l-6.43-6.424h-69.907V22.484L207.809%2C15.99L207.809%2C15.99z%22%2F%3E%20%3C%2Fg%3E%20%3Cg%20id%3D%22triangle%22%3E%20%20%3Cpolygon%20points%3D%22219.643%2C87.75%20219.643%2C48.667%20258.309%2C86.38%20258.309%2C87.75%20%20%20%22%2F%3E%20%20%3Cpath%20d%3D%22M227.643%2C67.646l12.41%2C12.104h-12.41V67.646%20M222.641%2C40.417h-10.998V95.75h54.666V83.008L222.641%2C40.417L222.641%2C40.417z%20%20%20%22%2F%3E%20%3C%2Fg%3E%20%3Cg%20id%3D%22red_square%22%3E%20%20%3Cpolygon%20fill%3D%22%23ED1C24%22%20points%3D%2222.544%2C284.49%2022.544%2C167.682%2037.291%2C152.935%2037.291%2C171.489%20297.146%2C171.489%20297.146%2C152.935%20%20%20%20311.893%2C167.682%20311.893%2C284.49%20%20%20%22%2F%3E%20%20%3Cpath%20fill%3D%22%23ED1C24%22%20d%3D%22M303.646%2C168.627l1.747%2C1.747V277.99H29.044V170.374l1.747-1.747v9.362h13h246.854h13V168.627%20%20%20%20M290.646%2C137.242v27.747H43.791v-27.747l-27.747%2C27.747V290.99h302.349V164.989L290.646%2C137.242L290.646%2C137.242z%22%2F%3E%20%3C%2Fg%3E%20%3Crect%20x%3D%2252.096%22%20y%3D%22189.324%22%20fill%3D%22none%22%20width%3D%22232.826%22%20height%3D%2287.834%22%2F%3E%20%3Ctext%20transform%3D%22matrix%281%200%200%201%2052.0957%20271.6621%29%22%20fill%3D%22%23FFFFFF%22%20font-family%3D%22DejaVu%20Sans%22%20font-weight%3D%22bold%22%20font-size%3D%22105%22%3EPDF%3C%2Ftext%3E%3C%2Fg%3E%3C%2Fsvg%3E";
349
-
350
- var PDFs = function PDFs(_ref) {
351
- var _product$media;
352
- var product = _ref.product;
353
- var pdfs = product === null || product === void 0 || (_product$media = product.media) === null || _product$media === void 0 ? void 0 : _product$media.filter(function (media) {
354
- return media.mediaType == 'PDF';
355
- });
356
- if (!(pdfs !== null && pdfs !== void 0 && pdfs.length)) return /*#__PURE__*/jsx(Fragment, {});
357
- return /*#__PURE__*/jsx("div", {
358
- className: wrapper$1,
359
- children: pdfs.map(function (pdf, i) {
360
- return /*#__PURE__*/jsx("a", {
361
- href: pdf.url,
362
- target: "_blank",
363
- title: pdf.description,
364
- children: /*#__PURE__*/jsx("img", {
365
- className: icon,
366
- src: pdfIcon
367
- })
368
- }, i);
369
- })
370
- });
371
- };
372
- var PDFs$1 = observer(PDFs);
373
-
374
- var getMedias = function getMedias(product) {
375
- var medias = [];
376
- if (product.media) {
377
- medias = product.media.filter(function (item) {
378
- return item.functionType === 'ART';
379
- });
380
- }
381
- if (product.image && medias.length === 0) {
382
- medias.push({
383
- url: product.image,
384
- mediaType: 'PCT'
385
- });
386
- }
387
- if (product.media) {
388
- for (var i = 0; i < product.media.length; i++) {
389
- var media = product.media[i];
390
- if (media.functionType === 'SHO' || media.functionType === 'PROD') {
391
- medias.push(media);
392
- }
393
- }
394
- }
395
- if (product.image2D) {
396
- medias.push({
397
- url: product.image2D,
398
- mediaType: 'PCT',
399
- functionType: '2D'
400
- });
401
- }
402
- return medias;
403
- };
404
-
405
- function ownKeys$e(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
406
- function _objectSpread$e(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$e(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$e(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
407
- function useApiInterface() {
408
- //LOG cannot be loaded globally because it will cause a circular dependency with core
409
- var LOG = useMemo(function () {
410
- return getLogger('ContentBox', 'UseApiInterface');
411
- }, []);
412
- var _useState = useState({}),
413
- _useState2 = _slicedToArray(_useState, 2),
414
- jsonDataCache = _useState2[0],
415
- setJsonDataCache = _useState2[1];
416
- var _useDivaCore = useDivaCore(),
417
- _useDivaCore$state = _useDivaCore.state,
418
- _useDivaCore$state$ap = _useDivaCore$state.apiConfig,
419
- catalogService = _useDivaCore$state$ap.catalogService,
420
- basketService = _useDivaCore$state$ap.basketService,
421
- jwt = _useDivaCore$state.jwt;
422
- var getDataCache = /*#__PURE__*/function () {
423
- var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(queryString, useWebServiceApi) {
424
- var myQS, data;
425
- return _regeneratorRuntime.wrap(function _callee$(_context) {
426
- while (1) switch (_context.prev = _context.next) {
427
- case 0:
428
- myQS = md5(queryString.toLowerCase()).toUpperCase();
429
- if (!jsonDataCache[myQS]) {
430
- _context.next = 3;
431
- break;
432
- }
433
- return _context.abrupt("return", jsonDataCache[myQS]);
434
- case 3:
435
- _context.next = 5;
436
- return fetchData(queryString, useWebServiceApi);
437
- case 5:
438
- data = _context.sent;
439
- addJsonDataCache(_defineProperty({}, myQS, data));
440
- return _context.abrupt("return", data);
441
- case 8:
442
- case "end":
443
- return _context.stop();
444
- }
445
- }, _callee);
446
- }));
447
- return function getDataCache(_x, _x2) {
448
- return _ref.apply(this, arguments);
449
- };
450
- }();
451
- var fetchData = /*#__PURE__*/function () {
452
- var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(queryString, useWebServiceApi) {
453
- var method,
454
- body,
455
- url,
456
- response,
457
- data,
458
- _args2 = arguments;
459
- return _regeneratorRuntime.wrap(function _callee2$(_context2) {
460
- while (1) switch (_context2.prev = _context2.next) {
461
- case 0:
462
- method = _args2.length > 2 && _args2[2] !== undefined ? _args2[2] : 'GET';
463
- body = _args2.length > 3 ? _args2[3] : undefined;
464
- _context2.t0 = useWebServiceApi;
465
- _context2.next = _context2.t0 === 'catalog' ? 5 : _context2.t0 === 'basket' ? 7 : 9;
466
- break;
467
- case 5:
468
- url = catalogService + queryString;
469
- return _context2.abrupt("break", 9);
470
- case 7:
471
- url = basketService + queryString;
472
- return _context2.abrupt("break", 9);
473
- case 9:
474
- _context2.next = 11;
475
- return fetch(url, _objectSpread$e({
476
- method: method,
477
- headers: {
478
- Authorization: 'Bearer ' + jwt,
479
- 'content-type': 'application/json'
480
- }
481
- }, body ? {
482
- body: JSON.stringify(body)
483
- } : {}));
484
- case 11:
485
- response = _context2.sent;
486
- _context2.next = 14;
487
- return response.json();
488
- case 14:
489
- data = _context2.sent;
490
- if (data !== null && data !== void 0 && data.Error) {
491
- LOG.error(new DivaError(data.Error, {
492
- code: 'WC_0001',
493
- custom: {
494
- url: url
495
- }
496
- }));
497
- }
498
- if (!(data.status > 204)) {
499
- _context2.next = 18;
500
- break;
501
- }
502
- throw new Error(JSON.parse(data.body).error);
503
- case 18:
504
- return _context2.abrupt("return", data);
505
- case 19:
506
- case "end":
507
- return _context2.stop();
508
- }
509
- }, _callee2);
510
- }));
511
- return function fetchData(_x3, _x4) {
512
- return _ref2.apply(this, arguments);
513
- };
514
- }();
515
- var addJsonDataCache = function addJsonDataCache(data) {
516
- for (var hash in data) {
517
- setJsonDataCache(_objectSpread$e(_objectSpread$e({}, jsonDataCache), {}, _defineProperty({}, hash, data[hash])));
518
- }
519
- };
520
- var clearCache = function clearCache() {
521
- setJsonDataCache({});
522
- };
523
- return {
524
- getDataCache: getDataCache,
525
- fetchData: fetchData,
526
- clearCache: clearCache
527
- };
528
- }
529
-
530
- var STATES = {
531
- 10: {
532
- title: 'cp',
533
- denyStatus: undefined,
534
- acceptStatus: 30
535
- },
536
- 20: {
537
- title: 'cp',
538
- denyStatus: undefined,
539
- acceptStatus: 60
540
- },
541
- 30: {
542
- title: 'cp',
543
- denyStatus: undefined,
544
- acceptStatus: 40
545
- },
546
- 40: {
547
- title: 'cp1',
548
- permissions: ['statecheck1'],
549
- denyStatus: 10,
550
- acceptStatus: 50,
551
- displayFront: true
552
- },
553
- 50: {
554
- title: 'cp',
555
- denyStatus: undefined,
556
- acceptStatus: 60
557
- },
558
- 60: {
559
- title: 'cp',
560
- denyStatus: undefined,
561
- acceptStatus: 70
562
- },
563
- 70: {
564
- title: 'cp2',
565
- permissions: ['statecheck2'],
566
- denyStatus: 20,
567
- acceptStatus: 80,
568
- displayFront: true
569
- },
570
- 80: {
571
- title: 'cp',
572
- denyStatus: undefined,
573
- acceptStatus: undefined
574
- }
575
- };
576
- var STATUSCONFIG = {
577
- states: STATES,
578
- generalPermissions: ['allstate'],
579
- defaultState: 30
580
- };
581
- var PdpState = /*#__PURE__*/function () {
582
- function PdpState(_ref) {
583
- var _this = this;
584
- var _productId = _ref.productId,
585
- divaCoreState = _ref.divaCoreState,
586
- t = _ref.t,
587
- getDataCache = _ref.getDataCache,
588
- validateIsActive = _ref.validateIsActive,
589
- fetchData = _ref.fetchData,
590
- _ref$loadVariants = _ref.loadVariants,
591
- loadVariants = _ref$loadVariants === void 0 ? true : _ref$loadVariants;
592
- _classCallCheck(this, PdpState);
593
- _defineProperty(this, "_pdpLoaded", false);
594
- _defineProperty(this, "product", undefined);
595
- _defineProperty(this, "setProductFirstTime", true);
596
- _defineProperty(this, "setProduct", function (product) {
597
- _this.product = product;
598
- if (_this.setProductFirstTime) {
599
- _this.setProductFirstTime = false;
600
- _this.infoTabs = _this.calcInfoTabs;
601
- }
602
- });
603
- _defineProperty(this, "selectVariant", function (product) {
604
- _this.divaCoreState.actions.onEvent({
605
- type: 'onVariantSelected',
606
- data: toJS(product)
607
- });
608
- _this.setProduct(product);
609
- });
610
- _defineProperty(this, "variants", undefined);
611
- _defineProperty(this, "setVariants", function (variants) {
612
- _this.variants = variants;
613
- });
614
- //images
615
- _defineProperty(this, "currentMediaItem", 0);
616
- _defineProperty(this, "setCurrentMediaItem", function (index) {
617
- _this.currentMediaItem = index;
618
- });
619
- //inbox area
620
- _defineProperty(this, "infoSwiperIndex", 0);
621
- _defineProperty(this, "doLoadVariants", void 0);
622
- _defineProperty(this, "setInfoSwiperIndex", function (index) {
623
- _this.infoSwiperIndex = index;
624
- });
625
- _defineProperty(this, "infoTabs", []);
626
- _defineProperty(this, "divaCoreState", void 0);
627
- _defineProperty(this, "t", void 0);
628
- _defineProperty(this, "getDataCache", void 0);
629
- _defineProperty(this, "fetchData", void 0);
630
- _defineProperty(this, "validateIsActive", false);
631
- _defineProperty(this, "getProductById", /*#__PURE__*/function () {
632
- var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(productId, dontUseCache) {
633
- var _productData$;
634
- var query, productData, parentId, queryVariants, variants;
635
- return _regeneratorRuntime.wrap(function _callee$(_context) {
636
- while (1) switch (_context.prev = _context.next) {
637
- case 0:
638
- query = '/v1/products/' + productId + '/list';
639
- _context.next = 3;
640
- return !dontUseCache ? _this.getDataCache(query, 'catalog') : _this.fetchData(query, 'catalog');
641
- case 3:
642
- productData = _context.sent;
643
- if (!(productData.length === 0)) {
644
- _context.next = 6;
645
- break;
646
- }
647
- throw new Error('no product found with id: ' + productId);
648
- case 6:
649
- _this.setProduct(productData[0]);
650
- parentId = (_productData$ = productData[0]) === null || _productData$ === void 0 ? void 0 : _productData$.parent;
651
- if (!(parentId && _this.doLoadVariants)) {
652
- _context.next = 14;
653
- break;
654
- }
655
- queryVariants = '/v1/products/' + productData[0].divaNr + '/list?baseProduct=false';
656
- _context.next = 12;
657
- return !dontUseCache ? _this.getDataCache(queryVariants, 'catalog') : _this.fetchData(queryVariants, 'catalog');
658
- case 12:
659
- variants = _context.sent;
660
- _this.setVariants(variants);
661
- case 14:
662
- case "end":
663
- return _context.stop();
664
- }
665
- }, _callee);
666
- }));
667
- return function (_x, _x2) {
668
- return _ref2.apply(this, arguments);
669
- };
670
- }());
671
- _defineProperty(this, "logBussinesEvent", function () {
672
- var _this$product$catCode, _this$product$supplie;
673
- if (!_this.product) return;
674
- //LOG cannot be loaded globally because it will cause a circular dependency with core
675
- getLogger('PDP', 'Catalogs').businessEvent(_this._pdpLoaded ? 'onSelectProductVariant' : 'onOpenPDP', 'PDP', "Select Product Variant '".concat(_this.product.shortDescription, "'"), {
676
- catName: _this.product.modelName,
677
- productName: _this.product.shortDescription,
678
- productId: _this.product._id,
679
- origDivaNr: _this.product.divaNr,
680
- variantId: _this.product.variantId,
681
- cat: (_this$product$catCode = _this.product.catCodex) === null || _this$product$catCode === void 0 ? void 0 : _this$product$catCode[0],
682
- bv: _this.product.discountedPrice ? _this.product.discountedPrice / 1000 : _this.product.addedPrice / 1000,
683
- sup: (_this$product$supplie = _this.product.supplierId) === null || _this$product$supplie === void 0 ? void 0 : _this$product$supplie[0]
684
- });
685
- _this._pdpLoaded = true;
686
- });
687
- _defineProperty(this, "onEventCalled", function (event) {
688
- if (event.type == 'openConfiguratorOverlay' && _this.product) {
689
- _this.divaCoreState.actions.openComponent({
690
- type: 'DIVA_WEBPLANNER',
691
- parameters: {
692
- productId: _this.product._id
693
- },
694
- openInFullscreen: true,
695
- absoluteFullscreen: true
696
- });
697
- }
698
- if (event.type == 'closeConfiguratorOverlay' && _this.product) {
699
- _this.divaCoreState.actions.closeComponentInFullscreen();
700
- }
701
- });
702
- //status and history stuff
703
- _defineProperty(this, "messages", {});
704
- _defineProperty(this, "updateMessages", function (productId, message) {
705
- if (message) _this.messages[productId] = message;else delete _this.messages[productId];
706
- });
707
- _defineProperty(this, "acceptCheckpoint", function () {
708
- var oldState = _this.getCurrentState;
709
- var newIndex = STATES[oldState].acceptStatus;
710
- if (!newIndex) return;
711
- _this.updateProductsState(STATES[oldState], 'accept');
712
- });
713
- _defineProperty(this, "denyCheckpoint", function () {
714
- var oldState = _this.getCurrentState;
715
- var newIndex = STATES[oldState].denyStatus;
716
- if (!newIndex) return;
717
- _this.updateProductsState(STATES[oldState], 'deny');
718
- });
719
- _defineProperty(this, "updateProductsState", /*#__PURE__*/function () {
720
- var _ref3 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(statusConfig, type) {
721
- var _statusConfig$permiss, _STATUSCONFIG$general;
722
- var newIndex, permissions, permitted, promises;
723
- return _regeneratorRuntime.wrap(function _callee2$(_context2) {
724
- while (1) switch (_context2.prev = _context2.next) {
725
- case 0:
726
- if (_this.variants) {
727
- _context2.next = 2;
728
- break;
729
- }
730
- return _context2.abrupt("return");
731
- case 2:
732
- newIndex = type == 'deny' ? statusConfig.denyStatus : statusConfig.acceptStatus;
733
- if (newIndex) {
734
- _context2.next = 5;
735
- break;
736
- }
737
- return _context2.abrupt("return");
738
- case 5:
739
- permissions = ((_statusConfig$permiss = statusConfig.permissions) !== null && _statusConfig$permiss !== void 0 ? _statusConfig$permiss : []).concat((_STATUSCONFIG$general = STATUSCONFIG.generalPermissions) !== null && _STATUSCONFIG$general !== void 0 ? _STATUSCONFIG$general : []);
740
- permitted = _this.checkPermissionArray(permissions);
741
- if (permitted) {
742
- _context2.next = 9;
743
- break;
744
- }
745
- return _context2.abrupt("return");
746
- case 9:
747
- _this.divaCoreState.actions.toggleLoading('productUpdateState');
748
- promises = _this.variants.map(function (product) {
749
- var message = _this.messages[product._id];
750
- return _this.fetchData('/v1/products/' + product._id + '/updateState', 'catalog', 'PATCH', {
751
- state: newIndex,
752
- message: message
753
- });
754
- });
755
- _context2.next = 13;
756
- return Promise.all(promises);
757
- case 13:
758
- _this.messages = {};
759
- _this.getProductById(_this.product._id, true).then(function () {
760
- return _this.divaCoreState.actions.toggleLoading('productUpdateState');
761
- });
762
- case 15:
763
- case "end":
764
- return _context2.stop();
765
- }
766
- }, _callee2);
767
- }));
768
- return function (_x3, _x4) {
769
- return _ref3.apply(this, arguments);
770
- };
771
- }());
772
- _defineProperty(this, "checkPermissionArray", function (permissions) {
773
- return permissions.length ? !!permissions.find(function (permission) {
774
- return _this.divaCoreState.actions.userHasPermission(permission);
775
- }) : true;
776
- });
777
- //classification stuff
778
- _defineProperty(this, "creatBaseconfiguration", function () {
779
- if (!_this.product) return;
780
- _this.divaCoreState.actions.openComponent({
781
- type: 'SELLER',
782
- parameters: {
783
- module: _this.divaCoreState.state.organization.parentType == 'SUPPLIER' ? 'Catalogs' : 'Collections',
784
- toProductsGallery: '1',
785
- originProductId: _this.product._id
786
- }
787
- });
788
- });
789
- _defineProperty(this, "editBaseconfiguration", function () {
790
- var _this$product;
791
- if (!_this.product) throw new Error('no Product loaded');
792
- _this.divaCoreState.actions.openComponent({
793
- type: 'SELLER',
794
- parameters: {
795
- module: 'PCreator',
796
- divaNr: (_this$product = _this.product) === null || _this$product === void 0 ? void 0 : _this$product.divaNr,
797
- toProductsGallery: '1'
798
- }
799
- });
800
- });
801
- _defineProperty(this, "openClassification", function () {
802
- if (!_this.product) throw new Error('no Product loaded');
803
- _this.divaCoreState.actions.openComponent({
804
- type: 'CLASSIFICATION',
805
- parameters: {
806
- id: _this.product._id
807
- },
808
- internal: {
809
- products: [{
810
- variants: toJS(_this.variants),
811
- baseProduct: toJS(_this.product)
812
- }],
813
- onClose: function onClose() {
814
- var _this$product2;
815
- return _this.divaCoreState.actions.openComponent({
816
- type: 'PRODUCT_GALLERY',
817
- parameters: {
818
- id: (_this$product2 = _this.product) === null || _this$product2 === void 0 ? void 0 : _this$product2._id
819
- }
820
- });
821
- }
822
- }
823
- });
824
- });
825
- if (!divaCoreState) throw Error('no divaCoreState defined');
826
- this.getDataCache = getDataCache;
827
- this.fetchData = fetchData;
828
- this.divaCoreState = divaCoreState;
829
- this.t = t;
830
- this.validateIsActive = validateIsActive;
831
- this.doLoadVariants = loadVariants;
832
- makeObservable(this, {
833
- product: observable,
834
- setProduct: action,
835
- variants: observable,
836
- setVariants: action,
837
- currentMediaItem: observable,
838
- setCurrentMediaItem: action,
839
- infoSwiperIndex: observable,
840
- setInfoSwiperIndex: action,
841
- getCurrentInfoTabType: computed,
842
- messages: observable,
843
- updateMessages: action,
844
- getCurrentState: computed
845
- });
846
- if (_productId) {
847
- //throw new Error('Cannot open PDP without product ID');
848
- this.getProductById(_productId);
849
- }
850
- }
851
-
852
- //just calculate once a session otherwise the tab position jumps during status change
853
- return _createClass(PdpState, [{
854
- key: "calcInfoTabs",
855
- get: function get() {
856
- var _curStateConfig$permi, _STATUSCONFIG$general2, _this$product3, _this$product4, _STATUSCONFIG$general3;
857
- var infoTabs = [];
858
- //cp === Checkpoint
859
- var cpAdded = false;
860
- var curStateConfig = STATES[this.getCurrentState];
861
- if (this.checkPermissionArray(((_curStateConfig$permi = curStateConfig.permissions) !== null && _curStateConfig$permi !== void 0 ? _curStateConfig$permi : []).concat((_STATUSCONFIG$general2 = STATUSCONFIG.generalPermissions) !== null && _STATUSCONFIG$general2 !== void 0 ? _STATUSCONFIG$general2 : [])) && curStateConfig.displayFront) {
862
- infoTabs.push(curStateConfig.title);
863
- cpAdded = true;
864
- }
865
- if ((_this$product3 = this.product) !== null && _this$product3 !== void 0 && _this$product3.info) infoTabs.push('info');
866
- if ((_this$product4 = this.product) !== null && _this$product4 !== void 0 && _this$product4.technicalDescription) {
867
- infoTabs.push('tech');
868
- }
869
- if (!cpAdded && this.checkPermissionArray((_STATUSCONFIG$general3 = STATUSCONFIG.generalPermissions) !== null && _STATUSCONFIG$general3 !== void 0 ? _STATUSCONFIG$general3 : [])) {
870
- infoTabs.push(curStateConfig.title);
871
- cpAdded = true;
872
- }
873
- if (this.divaCoreState.actions.userHasPermission('classification')) {
874
- infoTabs.push('functions');
875
- }
876
- return infoTabs;
877
- }
878
- }, {
879
- key: "getCurrentState",
880
- get: function get() {
881
- var _this$product$state, _this$product5;
882
- return (_this$product$state = (_this$product5 = this.product) === null || _this$product5 === void 0 ? void 0 : _this$product5.state) !== null && _this$product$state !== void 0 ? _this$product$state : STATUSCONFIG.defaultState;
883
- }
884
- }, {
885
- key: "getCurrentInfoTabType",
886
- get: function get() {
887
- return this.infoTabs[this.infoSwiperIndex];
888
- }
889
- }, {
890
- key: "isFlatProduct",
891
- get: function get() {
892
- var _this$product6;
893
- return !((_this$product6 = this.product) !== null && _this$product6 !== void 0 && _this$product6.divaNr);
894
- }
895
- }, {
896
- key: "isForcedFlat",
897
- get: function get() {
898
- return false;
899
- //TODO Alex PLAN 004 or something
900
- }
901
- }, {
902
- key: "loadVariants",
903
- value: function () {
904
- var _loadVariants = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
905
- var _this$product7,
906
- _orderSet$Favorites,
907
- _this2 = this;
908
- var divaNr, basket, orderSet, favorites, configVariants, table, _loop, i, _loop2, key;
909
- return _regeneratorRuntime.wrap(function _callee3$(_context5) {
910
- while (1) switch (_context5.prev = _context5.next) {
911
- case 0:
912
- divaNr = (_this$product7 = this.product) === null || _this$product7 === void 0 ? void 0 : _this$product7.divaNr;
913
- if (!(!divaNr || !this.variants)) {
914
- _context5.next = 3;
915
- break;
916
- }
917
- return _context5.abrupt("return", []);
918
- case 3:
919
- _context5.next = 5;
920
- return this.fetchData('/baskets/' + divaNr, 'basket', 'GET');
921
- case 5:
922
- basket = _context5.sent;
923
- orderSet = basket.OrderSets[0];
924
- favorites = (_orderSet$Favorites = orderSet.Favorites) === null || _orderSet$Favorites === void 0 ? void 0 : _orderSet$Favorites.VariantValues;
925
- configVariants = orderSet.ConfigVariants;
926
- if (!(!configVariants || !favorites)) {
927
- _context5.next = 11;
928
- break;
929
- }
930
- return _context5.abrupt("return", []);
931
- case 11:
932
- //no variants
933
- table = [];
934
- _loop = /*#__PURE__*/_regeneratorRuntime.mark(function _loop() {
935
- var _this2$variants, _ref4, _product$image;
936
- var variant, product;
937
- return _regeneratorRuntime.wrap(function _loop$(_context3) {
938
- while (1) switch (_context3.prev = _context3.next) {
939
- case 0:
940
- variant = configVariants[i];
941
- product = (_this2$variants = _this2.variants) === null || _this2$variants === void 0 ? void 0 : _this2$variants.find(function (v) {
942
- return v.variantId === variant.VariantID;
943
- });
944
- table.push({
945
- variantId: variant.VariantID,
946
- image: (_ref4 = (_product$image = product === null || product === void 0 ? void 0 : product.image) !== null && _product$image !== void 0 ? _product$image : variant.SetImage) !== null && _ref4 !== void 0 ? _ref4 : variant.Set2DImage,
947
- colums: []
948
- });
949
- case 3:
950
- case "end":
951
- return _context3.stop();
952
- }
953
- }, _loop);
954
- });
955
- i = 0;
956
- case 14:
957
- if (!(i < configVariants.length)) {
958
- _context5.next = 19;
959
- break;
960
- }
961
- return _context5.delegateYield(_loop(), "t0", 16);
962
- case 16:
963
- i++;
964
- _context5.next = 14;
965
- break;
966
- case 19:
967
- _loop2 = /*#__PURE__*/_regeneratorRuntime.mark(function _loop2() {
968
- var option, j, row, variant, variantValue;
969
- return _regeneratorRuntime.wrap(function _loop2$(_context4) {
970
- while (1) switch (_context4.prev = _context4.next) {
971
- case 0:
972
- option = favorites[key][Object.keys(favorites[key])[0]];
973
- for (j = 0; j < table.length; j++) {
974
- row = table[j];
975
- variant = configVariants[row.variantId];
976
- variantValue = variant.VariantBasketDatas.find(function (vd) {
977
- return 'OPT' + vd.OPT === option.optionCodex || vd.OptionOCD === option.optionCodex;
978
- });
979
- if (!variantValue) row.colums.push({
980
- opv: 'NOT_FOUNT',
981
- optName: option.optionName,
982
- opt: option.optionCodex,
983
- name: 'nicht gefunden'
984
- });else row.colums.push({
985
- opv: variantValue.OPV,
986
- name: variantValue.OPVName,
987
- image: variantValue.OPVImage,
988
- optName: option.optionName,
989
- opt: option.optionCodex
990
- });
991
- }
992
- case 2:
993
- case "end":
994
- return _context4.stop();
995
- }
996
- }, _loop2);
997
- });
998
- _context5.t1 = _regeneratorRuntime.keys(favorites);
999
- case 21:
1000
- if ((_context5.t2 = _context5.t1()).done) {
1001
- _context5.next = 26;
1002
- break;
1003
- }
1004
- key = _context5.t2.value;
1005
- return _context5.delegateYield(_loop2(), "t3", 24);
1006
- case 24:
1007
- _context5.next = 21;
1008
- break;
1009
- case 26:
1010
- return _context5.abrupt("return", table);
1011
- case 27:
1012
- case "end":
1013
- return _context5.stop();
1014
- }
1015
- }, _callee3, this);
1016
- }));
1017
- function loadVariants() {
1018
- return _loadVariants.apply(this, arguments);
1019
- }
1020
- return loadVariants;
1021
- }()
1022
- }]);
1023
- }();
1024
-
1025
- var _excluded$2 = ["children"];
1026
- function ownKeys$d(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
1027
- function _objectSpread$d(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$d(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$d(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
1028
- var PdpContext = /*#__PURE__*/React.createContext({
1029
- parameters: {},
1030
- pdpState: {},
1031
- type: 'PDP'
1032
- });
1033
- function ContextProvider$1(_ref) {
1034
- var children = _ref.children,
1035
- props = _objectWithoutProperties(_ref, _excluded$2);
1036
- var divaCoreState = useDivaCore();
1037
- var _useTranslation = useTranslation(),
1038
- t = _useTranslation.t;
1039
- var _useApiInterface = useApiInterface(),
1040
- getDataCache = _useApiInterface.getDataCache,
1041
- fetchData = _useApiInterface.fetchData;
1042
- var _useState = useState(function () {
1043
- var _props$parameters$pro, _props$parameters;
1044
- return new PdpState({
1045
- loadVariants: props.loadVariants,
1046
- productId: (_props$parameters$pro = (_props$parameters = props.parameters) === null || _props$parameters === void 0 ? void 0 : _props$parameters.productId) !== null && _props$parameters$pro !== void 0 ? _props$parameters$pro : props.productId,
1047
- validateIsActive: props.validateIsActive,
1048
- divaCoreState: divaCoreState,
1049
- t: t,
1050
- getDataCache: getDataCache,
1051
- fetchData: fetchData
1052
- });
1053
- }),
1054
- _useState2 = _slicedToArray(_useState, 1),
1055
- pdpState = _useState2[0];
1056
- if (!pdpState) return /*#__PURE__*/jsx(Fragment, {});
1057
- return /*#__PURE__*/jsx(PdpContext.Provider, {
1058
- value: _objectSpread$d({
1059
- pdpState: pdpState
1060
- }, props),
1061
- children: children
1062
- });
1063
- }
1064
- var usePdpState = function usePdpState() {
1065
- return useContext(PdpContext);
1066
- };
1067
-
1068
- function ownKeys$c(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
1069
- function _objectSpread$c(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$c(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$c(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
1070
- var ProductWrapper = function ProductWrapper(_ref) {
1071
- var variantFields = _ref.variantFields,
1072
- wrapperHeight = _ref.wrapperHeight,
1073
- marginLeftHeader = _ref.marginLeftHeader,
1074
- isMobileLandscape = _ref.isMobileLandscape;
1075
- var _useDivaCore = useDivaCore(),
1076
- _useDivaCore$state = _useDivaCore.state,
1077
- headerInfos = _useDivaCore$state.headerInfos,
1078
- _useDivaCore$state$di = _useDivaCore$state.dimensions,
1079
- isMobile = _useDivaCore$state$di.isMobile,
1080
- portrait = _useDivaCore$state$di.isPortrait,
1081
- height = _useDivaCore$state$di.height,
1082
- openSideMenu = _useDivaCore.actions.openSideMenu;
1083
- var isPortrait = portrait && isMobile;
1084
- var showHeader = isPortrait;
1085
- var showInfoIcon = isPortrait;
1086
- var showRotationInfo = isMobileLandscape;
1087
- var _usePdpState = usePdpState(),
1088
- pdpState = _usePdpState.pdpState,
1089
- mediaViewerProps = _usePdpState.mediaViewerProps;
1090
- var product = pdpState.product;
1091
- useEffect(function () {
1092
- openSideMenu({
1093
- content: infoSlider,
1094
- open: false,
1095
- side: 'left',
1096
- showCoreHeader: headerInfos.visible,
1097
- style: {
1098
- overflow: 'auto',
1099
- height: '100%',
1100
- padding: ' 0px 20px'
1101
- },
1102
- backgroundColor: 'rgba(242, 242, 242, 0.95)'
1103
- });
1104
- }, []);
1105
- var openInfo = function openInfo() {
1106
- openSideMenu({
1107
- content: infoSlider,
1108
- open: true,
1109
- side: 'left',
1110
- style: {
1111
- overflow: 'auto',
1112
- height: '100%',
1113
- padding: ' 0px 20px'
1114
- },
1115
- showCoreHeader: headerInfos.visible,
1116
- backgroundColor: 'rgba(242, 242, 242, 0.95)'
1117
- });
1118
- };
1119
- var infoSlider = /*#__PURE__*/jsxs("div", {
1120
- style: {
1121
- display: 'flex',
1122
- flexDirection: 'column',
1123
- height: '100%'
1124
- },
1125
- children: [/*#__PURE__*/jsx(Header$1, {
1126
- product: product,
1127
- style: {
1128
- marginTop: 15,
1129
- marginLeft: 8,
1130
- marginBottom: 12
1131
- }
1132
- }), /*#__PURE__*/jsx(PDFs$1, {
1133
- product: product
1134
- }), /*#__PURE__*/jsx(InfoSlider, {
1135
- pdpState: pdpState,
1136
- style: {
1137
- margin: '8px',
1138
- width: 'calc(100% - 16px)'
1139
- }
1140
- })]
1141
- });
1142
- return /*#__PURE__*/jsxs("div", {
1143
- style: {
1144
- height: wrapperHeight
1145
- },
1146
- className: "diva-product-wrapper",
1147
- children: [(showHeader || showInfoIcon) && /*#__PURE__*/jsxs("div", {
1148
- className: headerWrapper,
1149
- children: [showHeader && /*#__PURE__*/jsx(Header$1, {
1150
- marginLeftHeader: marginLeftHeader,
1151
- product: product
1152
- }), showInfoIcon && /*#__PURE__*/jsx("div", {
1153
- className: infoIcon,
1154
- onClick: openInfo
1155
- })]
1156
- }), showRotationInfo && /*#__PURE__*/jsx(RotationIcon, {}), !!variantFields && !isMobileLandscape && variantFields, /*#__PURE__*/jsx(ContentBox$1, _objectSpread$c({
1157
- type: "MediaViewer",
1158
- defaultDataOptions: 'arrows:false',
1159
- onLandscapeOptions: ';thumbnails.position:left;fullscreen.enable:false;arrows:true',
1160
- itemKey: 'id_' + product._id + isMobile.toString() + isPortrait.toString() + height + (pdpState.getCurrentInfoTabType === 'functions'),
1161
- medias: getMedias(product),
1162
- currentItem: pdpState.currentMediaItem,
1163
- setCurrentItem: pdpState.setCurrentMediaItem,
1164
- showRotationIconInFullscreen: true
1165
- }, mediaViewerProps))]
1166
- });
1167
- };
1168
- var ProductWrapper$1 = observer(ProductWrapper);
1169
-
1170
- var footerWrapper = "footer-wrapper-7owll";
1171
- var posFixed = "pos-fixed-4hcrc";
1172
- var posAbsolute = "pos-absolute-mEI9N";
1173
- var button = "button-WyDJL";
1174
- var buttonLeft = "button-left-PGx9m";
1175
- var buttonRight = "button-right-Sf-so";
1176
- var buttonCenter = "button-center-k0uzz";
1177
- var css_248z$a = ".footer-wrapper-7owll {\n --spacer: 4px;\n display: flex;\n gap: var(--spacer);\n height: 60px;\n width: 100%;\n align-self: flex-end;\n}\n\n.footer-wrapper-7owll > div:last-child {\n margin-right: 0;\n margin-right: initial;\n}\n.pos-fixed-4hcrc {\n position: fixed;\n bottom: 0;\n left: 0;\n width: calc(100% - 2 * var(--spacer));\n margin: var(--spacer);\n}\n\n.pos-absolute-mEI9N {\n position: absolute;\n bottom: 0;\n left: 0;\n width: calc(100% - 2 * var(--spacer));\n margin: var(--spacer);\n}\n\n.button-WyDJL {\n box-sizing: border-box;\n height: 60px;\n border-radius: 2px;\n border-style: solid;\n border-width: 2px;\n border-color: var(--diva-theme-palette-primary-main);\n white-space: nowrap;\n overflow: hidden;\n transition: box-shadow 0.3s;\n}\n.button-WyDJL:hover {\n box-shadow: 0px 1px 4px #707070;\n cursor: pointer;\n}\n\n.button-left-PGx9m,\n.button-right-Sf-so {\n min-width: 60px;\n}\n\n.button-left-PGx9m {\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.button-center-k0uzz {\n background: var(--diva-theme-palette-primary-main);\n flex-basis: 100%;\n color: #ffffff;\n font-size: 16px;\n line-height: 55px;\n text-align: center;\n}\n\n.button-right-Sf-so {\n background: center / 33% no-repeat var(--diva-theme-palette-primary-main) url(\"data:image/svg+xml,%3Csvg width%3D%2220%22 height%3D%2224%22 viewBox%3D%220 0 20 24%22 fill%3D%22none%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath d%3D%22M2.07398 23.25H2.07373C1.97324 23.25 1.88541 23.2041 1.82941 23.1238C1.7568 23.0195 1.69531 22.8631 1.69531 22.6367V2.0373C1.69531 1.38277 2.31882 0.75 3.0752 0.75H17.0003C17.7212 0.75 18.3047 1.34824 18.3047 2.0373V22.6368C18.3047 22.9664 18.2135 23.1135 18.1634 23.169C18.1142 23.2235 18.0521 23.2501 17.9756 23.2501C17.8884 23.2501 17.734 23.2133 17.4991 23.0128L17.4985 23.0123L11.29 17.7245C11.2899 17.7245 11.2899 17.7245 11.2898 17.7244C10.9425 17.4279 10.4866 17.2859 10.0469 17.2859C9.60792 17.2859 9.15139 17.4274 8.80421 17.7236C8.804 17.7238 8.80379 17.7239 8.80358 17.7241L2.57518 23.0123L2.57347 23.0138C2.35255 23.2025 2.17431 23.25 2.07398 23.25Z%22 stroke%3D%22%23fff%22 stroke-width%3D%221.5%22%2F%3E%3C%2Fsvg%3E\");\n}\n";
1178
- styleInject(css_248z$a);
1179
-
1180
- var ContentBoxContext = /*#__PURE__*/React.createContext({});
1181
- function ContextProvider(_ref) {
1182
- var children = _ref.children,
1183
- onClose = _ref.onClose,
1184
- parameters = _ref.parameters;
1185
- return /*#__PURE__*/jsx(ContentBoxContext.Provider, {
1186
- value: {
1187
- onClose: onClose,
1188
- parameters: parameters
1189
- },
1190
- children: children
1191
- });
1192
- }
1193
- var useContentBoxState = function useContentBoxState() {
1194
- return useContext(ContentBoxContext);
1195
- };
1196
-
1197
- function ownKeys$b(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
1198
- function _objectSpread$b(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$b(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$b(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
1199
- var CheckpointFooter = /*#__PURE__*/React.lazy(function () {
1200
- return import('./index-8aa3289b.js');
1201
- });
1202
- var FunctionsFooter = /*#__PURE__*/React.lazy(function () {
1203
- return import('./index-65df1e5b.js');
1204
- });
1205
- var Footer = function Footer(_ref) {
1206
- _objectDestructuringEmpty(_ref);
1207
- var _usePdpState = usePdpState(),
1208
- pdpState = _usePdpState.pdpState,
1209
- breadcrumb = _usePdpState.breadcrumb,
1210
- cta1Text = _usePdpState.cta1Text,
1211
- cta1Params = _usePdpState.cta1Params,
1212
- cta2Params = _usePdpState.cta2Params,
1213
- hideCat2 = _usePdpState.hideCat2,
1214
- ctaOpenInFullscreen = _usePdpState.ctaOpenInFullscreen,
1215
- absoluteFullscreen = _usePdpState.absoluteFullscreen,
1216
- isMobileFullscreen = _usePdpState.isMobileFullscreen;
1217
- var _useContentBoxState = useContentBoxState(),
1218
- onClose = _useContentBoxState.onClose;
1219
- var _useDivaCore = useDivaCore(),
1220
- openComponent = _useDivaCore.actions.openComponent,
1221
- _useDivaCore$state$di = _useDivaCore.state.dimensions,
1222
- isPortrait = _useDivaCore$state$di.isPortrait,
1223
- isMobile = _useDivaCore$state$di.isMobile;
1224
- var footerFixed = isPortrait && isMobile && isMobileFullscreen;
1225
- var _useTranslation = useTranslation(),
1226
- t = _useTranslation.t;
1227
- var hideClose = !isPortrait;
1228
- var onClickCta1 = function onClickCta1() {
1229
- if (typeof cta1Params === 'function') {
1230
- var _pdpState$product;
1231
- cta1Params((_pdpState$product = pdpState.product) === null || _pdpState$product === void 0 ? void 0 : _pdpState$product._id);
1232
- } else {
1233
- var _pdpState$product2;
1234
- openComponent({
1235
- type: 'DIVA_WEBPLANNER',
1236
- parameters: _objectSpread$b(_objectSpread$b({}, cta1Params), {}, {
1237
- productId: (_pdpState$product2 = pdpState.product) === null || _pdpState$product2 === void 0 ? void 0 : _pdpState$product2._id
1238
- }),
1239
- breadcrumb: breadcrumb,
1240
- openInFullscreen: ctaOpenInFullscreen,
1241
- absoluteFullscreen: absoluteFullscreen
1242
- });
1243
- }
1244
- };
1245
- var onClickCta2 = function onClickCta2() {
1246
- if (typeof cta2Params === 'function') {
1247
- var _pdpState$product3;
1248
- cta2Params((_pdpState$product3 = pdpState.product) === null || _pdpState$product3 === void 0 ? void 0 : _pdpState$product3._id);
1249
- } else {
1250
- var _pdpState$product4;
1251
- openComponent({
1252
- type: 'DIVA_WEBPLANNER',
1253
- parameters: _objectSpread$b(_objectSpread$b({
1254
- initMode: 'SHOW_PDF'
1255
- }, cta2Params), {}, {
1256
- productId: (_pdpState$product4 = pdpState.product) === null || _pdpState$product4 === void 0 ? void 0 : _pdpState$product4._id
1257
- }),
1258
- breadcrumb: breadcrumb,
1259
- openInFullscreen: ctaOpenInFullscreen,
1260
- absoluteFullscreen: absoluteFullscreen
1261
- });
1262
- }
1263
- };
1264
- if (Object.values(STATES).map(function (config) {
1265
- return config.title;
1266
- }).includes(pdpState.getCurrentInfoTabType)) {
1267
- return /*#__PURE__*/jsx(Suspense, {
1268
- fallback: /*#__PURE__*/jsx(Fragment, {}),
1269
- children: /*#__PURE__*/jsx(CheckpointFooter, {
1270
- footerFixed: !!footerFixed
1271
- })
1272
- });
1273
- }
1274
- if (pdpState.getCurrentInfoTabType === 'functions') {
1275
- return /*#__PURE__*/jsx(Suspense, {
1276
- fallback: /*#__PURE__*/jsx(Fragment, {}),
1277
- children: /*#__PURE__*/jsx(FunctionsFooter, {
1278
- footerFixed: !!footerFixed
1279
- })
1280
- });
1281
- }
1282
- return /*#__PURE__*/jsxs("div", {
1283
- className: classNames(footerWrapper, footerFixed ? posFixed : posAbsolute),
1284
- children: [!hideClose && /*#__PURE__*/jsx("div", {
1285
- onClick: onClose,
1286
- className: classNames(button, buttonLeft),
1287
- children: /*#__PURE__*/jsx("svg", {
1288
- width: "16",
1289
- height: "36",
1290
- viewBox: "0 0 11 19",
1291
- fill: "none",
1292
- children: /*#__PURE__*/jsx("path", {
1293
- d: "M9 1L1 9L9 17",
1294
- stroke: "var(--diva-theme-palette-primary-main)",
1295
- strokeWidth: "1.5",
1296
- strokeLinecap: "round",
1297
- strokeLinejoin: "round"
1298
- })
1299
- })
1300
- }), /*#__PURE__*/jsx("div", {
1301
- "data-test-id": "to-configurator",
1302
- onClick: onClickCta1,
1303
- className: classNames(button, buttonCenter),
1304
- children: cta1Text !== null && cta1Text !== void 0 ? cta1Text : t('pdp.jump_to_configurator')
1305
- }), !hideCat2 && /*#__PURE__*/jsx("div", {
1306
- onClick: onClickCta2,
1307
- className: classNames(button, buttonRight)
1308
- })]
1309
- });
1310
- };
1311
- var Footer$1 = observer(Footer);
1312
-
1313
- function ownKeys$a(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
1314
- function _objectSpread$a(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$a(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$a(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
1315
- var PDP = function PDP() {
1316
- var _pdpState$variants;
1317
- var _useState = useState(false),
1318
- _useState2 = _slicedToArray(_useState, 2),
1319
- firstTimeRendered = _useState2[0],
1320
- setFirstTimeRendered = _useState2[1];
1321
- var _usePdpState = usePdpState(),
1322
- pdpState = _usePdpState.pdpState,
1323
- onlyShowHQViewer = _usePdpState.onlyShowHQViewer,
1324
- hideInfoSlider = _usePdpState.hideInfoSlider,
1325
- setCategoryFilter = _usePdpState.setCategoryFilter,
1326
- mediaViewerProps = _usePdpState.mediaViewerProps,
1327
- marginLeftHeader = _usePdpState.marginLeftHeader,
1328
- style = _usePdpState.style;
1329
- var _useDivaCore = useDivaCore(),
1330
- _useDivaCore$actions = _useDivaCore.actions,
1331
- openFullscreen = _useDivaCore$actions.openFullscreen,
1332
- closeFullscreen = _useDivaCore$actions.closeFullscreen,
1333
- subscribeEvents = _useDivaCore$actions.subscribeEvents,
1334
- unSubscribeEvents = _useDivaCore$actions.unSubscribeEvents,
1335
- _useDivaCore$state$di = _useDivaCore.state.dimensions,
1336
- isMobile = _useDivaCore$state$di.isMobile,
1337
- portrait = _useDivaCore$state$di.isPortrait,
1338
- height = _useDivaCore$state$di.height;
1339
- useEffect(function () {
1340
- if (pdpState.product) {
1341
- pdpState.logBussinesEvent();
1342
- setCategoryFilter === null || setCategoryFilter === void 0 || setCategoryFilter({
1343
- mainCategory: pdpState.product.mainCategory,
1344
- livingArea: pdpState.product.livingArea
1345
- });
1346
- }
1347
- }, [pdpState.product]);
1348
- var isPortrait = portrait && isMobile;
1349
- useEffect(function () {
1350
- subscribeEvents(pdpState.onEventCalled);
1351
- return function () {
1352
- return unSubscribeEvents(pdpState.onEventCalled);
1353
- };
1354
- }, [pdpState.product]);
1355
- useEffect(function () {
1356
- if (pdpState.product === undefined || !(mediaViewerProps !== null && mediaViewerProps !== void 0 && mediaViewerProps.showRotationIconInFullscreen)) return;
1357
- if (isMobileLandscape) {
1358
- openFullscreen({
1359
- content: productuctWrapper,
1360
- hideClose: true
1361
- });
1362
- } else {
1363
- closeFullscreen();
1364
- }
1365
- }, [isMobile, isPortrait, height, firstTimeRendered]);
1366
- if (pdpState.product === undefined) return /*#__PURE__*/jsx(Fragment, {});
1367
- var isDesktopLandscape = !isPortrait && height >= 500;
1368
- var isMobileLandscape = isMobile && !isPortrait && height < 500;
1369
- if (!firstTimeRendered) setFirstTimeRendered(true);
1370
- var variantFields = undefined;
1371
- if ((_pdpState$variants = pdpState.variants) !== null && _pdpState$variants !== void 0 && _pdpState$variants.length && pdpState.variants.length > 1) {
1372
- variantFields = /*#__PURE__*/jsx(ContentBox$1, {
1373
- type: "VariantFields",
1374
- currentProuduct: pdpState.product,
1375
- variants: pdpState.variants,
1376
- style: style,
1377
- setCurProduct: function setCurProduct(e, product, variants) {
1378
- pdpState.selectVariant(product);
1379
- if (variants) pdpState.setVariants(variants);
1380
- }
1381
- });
1382
- }
1383
- var productuctWrapper = /*#__PURE__*/jsx(ProductWrapper$1, {
1384
- wrapperHeight: isPortrait ? 'calc(100% - 68px)' : '100%',
1385
- isMobileLandscape: isMobileLandscape,
1386
- variantFields: !hideInfoSlider ? /*#__PURE__*/jsx("div", {
1387
- className: classNames(variantsWrapper$1, isPortrait ? right : left$1),
1388
- children: variantFields
1389
- }) : /*#__PURE__*/jsx(Fragment, {}),
1390
- marginLeftHeader: marginLeftHeader
1391
- }, pdpState.product._id);
1392
- if (onlyShowHQViewer) {
1393
- return /*#__PURE__*/jsxs(Fragment, {
1394
- children: [/*#__PURE__*/jsx("div", {
1395
- className: classNames(variantsWrapper$1, left$1),
1396
- children: variantFields
1397
- }), /*#__PURE__*/jsx(ContentBox$1, _objectSpread$a({
1398
- type: "MediaViewer",
1399
- defaultDataOptions: 'arrows:false',
1400
- onLandscapeOptions: ';thumbnails.position:left;fullscreen.enable:false;arrows:true',
1401
- itemKey: 'id_' + pdpState.product._id + isMobile.toString() + isPortrait.toString() + height,
1402
- medias: getMedias(pdpState.product),
1403
- currentItem: pdpState.currentMediaItem,
1404
- setCurrentItem: pdpState.setCurrentMediaItem,
1405
- showRotationIconInFullscreen: true
1406
- }, mediaViewerProps))]
1407
- });
1408
- }
1409
- return /*#__PURE__*/jsxs("div", {
1410
- className: classNames(pdpWrapper, pdpState.getCurrentInfoTabType === 'functions' ? inFunction : undefined),
1411
- children: [/*#__PURE__*/jsxs("div", {
1412
- className: classNames(isDesktopLandscape ? pdpSplitter$1 : pdpScroller),
1413
- children: [productuctWrapper, isDesktopLandscape && /*#__PURE__*/jsxs("div", {
1414
- className: desktopInfoWrapper,
1415
- children: [/*#__PURE__*/jsx(Header$1, {
1416
- product: pdpState.product,
1417
- style: {
1418
- paddingTop: 14
1419
- }
1420
- }), !hideInfoSlider ? /*#__PURE__*/jsx(InfoSlider, {
1421
- pdpState: pdpState
1422
- }) : !!variantFields && /*#__PURE__*/jsx("div", {
1423
- className: variantsInInfoWrapper,
1424
- children: variantFields
1425
- }), /*#__PURE__*/jsx(PDFs$1, {
1426
- product: pdpState.product
1427
- }), /*#__PURE__*/jsx(Footer$1, {})]
1428
- })]
1429
- }), isPortrait && /*#__PURE__*/jsx(Footer$1, {})]
1430
- });
1431
- };
1432
- var PDP$1 = observer(PDP);
1433
-
1434
99
  var Text = function Text(_ref) {
1435
100
  var text = _ref.text,
1436
101
  style = _ref.style;
@@ -1685,7 +350,7 @@ var OptionHeader = function OptionHeader(_ref) {
1685
350
  function ownKeys$5(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
1686
351
  function _objectSpread$5(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$5(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$5(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
1687
352
  var DragAndDrop = /*#__PURE__*/React.lazy(function () {
1688
- return import('./index-1b7e0d4d.js');
353
+ return import('./index-912ae569.js');
1689
354
  });
1690
355
  var VariantFields = function VariantFields(_ref) {
1691
356
  var variants = _ref.variants,
@@ -2116,6 +781,23 @@ var SliderContainer = function SliderContainer(_ref) {
2116
781
  }));
2117
782
  };
2118
783
 
784
+ var ContentBoxContext = /*#__PURE__*/React.createContext({});
785
+ function ContextProvider(_ref) {
786
+ var children = _ref.children,
787
+ onClose = _ref.onClose,
788
+ parameters = _ref.parameters;
789
+ return /*#__PURE__*/jsx(ContentBoxContext.Provider, {
790
+ value: {
791
+ onClose: onClose,
792
+ parameters: parameters
793
+ },
794
+ children: children
795
+ });
796
+ }
797
+ var useContentBoxState = function useContentBoxState() {
798
+ return useContext(ContentBoxContext);
799
+ };
800
+
2119
801
  var container = "container-o1Fzx";
2120
802
  var isMobileClass = "is-mobile-class-DmX9a";
2121
803
  var closeIcon = "closeIcon-PF5Nn";
@@ -2160,20 +842,13 @@ var CloseButtonContainer = function CloseButtonContainer(_ref) {
2160
842
  function ownKeys$1(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
2161
843
  function _objectSpread$1(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$1(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
2162
844
  var ArViewer = /*#__PURE__*/React.lazy(function () {
2163
- return import('./index-fe38fbad.js');
845
+ return import('./index-aa006b31.js');
2164
846
  });
2165
847
  var MediaViewer = /*#__PURE__*/React.lazy(function () {
2166
- return import('./index-6620fc12.js');
848
+ return import('./index-6da1a514.js');
2167
849
  });
2168
850
  var ContentBox$1 = function ContentBox(props) {
2169
- var _useContentBoxState = useContentBoxState(),
2170
- parameters = _useContentBoxState.parameters;
2171
851
  switch (props.type) {
2172
- case 'PDP':
2173
- return /*#__PURE__*/jsx(ContextProvider$1, _objectSpread$1(_objectSpread$1({}, props), {}, {
2174
- parameters: parameters,
2175
- children: /*#__PURE__*/jsx(PDP$1, {})
2176
- }));
2177
852
  case 'MediaViewer':
2178
853
  return /*#__PURE__*/jsx(Suspense, {
2179
854
  fallback: /*#__PURE__*/jsx(Fragment, {}),
@@ -2235,4 +910,4 @@ var ContentBox = {
2235
910
  renderFunction: Main
2236
911
  };
2237
912
 
2238
- export { ContentBoxComponent as C, Group as G, STATES as S, usePdpState as a, posAbsolute as b, button as c, buttonCenter as d, buttonLeft as e, footerWrapper as f, ContentBox as g, posFixed as p, styleInject as s, useApiInterface as u };
913
+ export { ContentBoxComponent as C, Group as G, ContentBox as a, styleInject as s };