@crystaldesign/diva-core 24.10.0-beta.2 → 24.10.0-beta.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/esm/{ModalsWrapper-f943415a.js → ModalsWrapper-34dd87a3.js} +4 -2
- package/build/esm/{index-f4cfab96.js → index-1101f33e.js} +1289 -538
- package/build/esm/{index-ddb787b2.js → index-f1da0fd1.js} +4 -2
- package/build/esm/index.js +3 -1
- package/build/types/core/src/Content.d.ts +3 -3
- package/build/types/core/src/Content.d.ts.map +1 -1
- package/build/types/core/src/DivaCore.d.ts +1 -1
- package/build/types/core/src/DivaCore.d.ts.map +1 -1
- package/build/types/core/src/externalTypes.d.ts +3 -3
- package/build/types/core/src/externalTypes.d.ts.map +1 -1
- package/build/types/core/src/handler/AdminHandler/index.d.ts +2 -2
- package/build/types/core/src/handler/AdminHandler/index.d.ts.map +1 -1
- package/build/types/core/src/handler/AnalyticsHandler/index.d.ts +2 -2
- package/build/types/core/src/handler/AnalyticsHandler/index.d.ts.map +1 -1
- package/build/types/core/src/handler/AuthorizationHandler/index.d.ts +4 -3
- package/build/types/core/src/handler/AuthorizationHandler/index.d.ts.map +1 -1
- package/build/types/core/src/handler/ClientArticleHandler/index.d.ts +2 -2
- package/build/types/core/src/handler/ClientArticleHandler/index.d.ts.map +1 -1
- package/build/types/core/src/handler/ContentItemHandler/index.d.ts +3 -3
- package/build/types/core/src/handler/ContentItemHandler/index.d.ts.map +1 -1
- package/build/types/core/src/handler/InternalApiHandler.d.ts +3 -3
- package/build/types/core/src/handler/InternalApiHandler.d.ts.map +1 -1
- package/build/types/core/src/handler/MediaHandler/index.d.ts +3 -3
- package/build/types/core/src/handler/MediaHandler/index.d.ts.map +1 -1
- package/build/types/core/src/handler/OrganizationHandler/index.d.ts +2 -2
- package/build/types/core/src/handler/OrganizationHandler/index.d.ts.map +1 -1
- package/build/types/core/src/handler/ProductHandler/index.d.ts +5 -4
- package/build/types/core/src/handler/ProductHandler/index.d.ts.map +1 -1
- package/build/types/core/src/handler/ReportHandler/index.d.ts +3 -2
- package/build/types/core/src/handler/ReportHandler/index.d.ts.map +1 -1
- package/build/types/core/src/handler/SupportHandler/index.d.ts +2 -2
- package/build/types/core/src/handler/SupportHandler/index.d.ts.map +1 -1
- package/build/types/core/src/index.d.ts +2 -1
- package/build/types/core/src/index.d.ts.map +1 -1
- package/build/types/core/src/store/ConfigurationStore.d.ts +0 -4
- package/build/types/core/src/store/ConfigurationStore.d.ts.map +1 -1
- package/build/types/core/src/store/ContentStore.d.ts +1 -3
- package/build/types/core/src/store/ContentStore.d.ts.map +1 -1
- package/build/types/core/src/store/RootStore.d.ts +54 -15
- package/build/types/core/src/store/RootStore.d.ts.map +1 -1
- package/build/types/core/src/store/index.d.ts +5 -1
- package/build/types/core/src/store/index.d.ts.map +1 -1
- package/build/types/core/src/store/mock/divaCoreMockProvider.d.ts +15 -0
- package/build/types/core/src/store/mock/divaCoreMockProvider.d.ts.map +1 -0
- package/build/types/core/src/store/mock/index.d.ts +19 -0
- package/build/types/core/src/store/mock/index.d.ts.map +1 -0
- package/build/types/core/src/types.d.ts +0 -4
- package/build/types/core/src/types.d.ts.map +1 -1
- package/build/types/core/src/utils/ApplicationLogger/index.d.ts.map +1 -1
- package/build/types/core/src/utils/defaultTheme.d.ts +25 -0
- package/build/types/core/src/utils/defaultTheme.d.ts.map +1 -0
- package/build/types/core/src/utils/dimensionsFunctions.d.ts +10 -0
- package/build/types/core/src/utils/dimensionsFunctions.d.ts.map +1 -0
- package/build/types/core/src/utils/parseApiConfig.d.ts +4 -0
- package/build/types/core/src/utils/parseApiConfig.d.ts.map +1 -0
- package/build/types/core/src/utils/updateCssThemeVariables.d.ts +3 -0
- package/build/types/core/src/utils/updateCssThemeVariables.d.ts.map +1 -0
- package/build/umd/15.diva-core.umd.min.js +1 -1
- package/build/umd/311.diva-core.umd.min.js +1 -1
- package/build/umd/319.diva-core.umd.min.js +1 -1
- package/build/umd/397.diva-core.umd.min.js +1 -1
- package/build/umd/40.diva-core.umd.min.js +1 -1
- package/build/umd/455.diva-core.umd.min.js +1 -1
- package/build/umd/82.diva-core.umd.min.js +1 -1
- package/build/umd/84.diva-core.umd.min.js +1 -1
- package/build/umd/89.diva-core.umd.min.js +1 -1
- package/build/umd/diva-core.umd.min.js +1 -1
- package/build/umd/diva-core.umd.min.js.LICENSE.txt +9 -0
- package/build/umd/report.html +1 -1
- package/package.json +10 -10
|
@@ -10,7 +10,7 @@ import _getPrototypeOf from '@babel/runtime/helpers/getPrototypeOf';
|
|
|
10
10
|
import _inherits from '@babel/runtime/helpers/inherits';
|
|
11
11
|
import _wrapNativeSuper from '@babel/runtime/helpers/wrapNativeSuper';
|
|
12
12
|
import ReactDOM from 'react-dom';
|
|
13
|
-
import React, { forwardRef, useState, useEffect, createContext, useMemo, useImperativeHandle, useRef
|
|
13
|
+
import React, { forwardRef, useState, useEffect, useCallback, Suspense, createContext, useMemo, useImperativeHandle, useRef } from 'react';
|
|
14
14
|
import { observer } from 'mobx-react-lite';
|
|
15
15
|
import _asyncToGenerator from '@babel/runtime/helpers/asyncToGenerator';
|
|
16
16
|
import _regeneratorRuntime from '@babel/runtime/regenerator';
|
|
@@ -20,13 +20,15 @@ import MobileDetect from 'mobile-detect';
|
|
|
20
20
|
import i18n from 'i18next';
|
|
21
21
|
import HttpApi from 'i18next-http-backend';
|
|
22
22
|
import * as CoreStyles from '@material-ui/core/styles';
|
|
23
|
-
import {
|
|
23
|
+
import { StylesProvider, MuiThemeProvider, createMuiTheme } from '@material-ui/core/styles';
|
|
24
24
|
import { enUS, itIT, frFR, deDE } from '@material-ui/core/locale';
|
|
25
25
|
import { withTransaction } from '@elastic/apm-rum-react';
|
|
26
26
|
import Typography from '@material-ui/core/Typography';
|
|
27
27
|
import { useTranslation, Trans, I18nextProvider } from 'react-i18next';
|
|
28
28
|
import classnames from 'classnames';
|
|
29
29
|
import { jsx, Fragment, jsxs } from 'react/jsx-runtime';
|
|
30
|
+
import '@crystaldesign/basket-model';
|
|
31
|
+
import { debounce } from 'lodash';
|
|
30
32
|
import axios from 'axios';
|
|
31
33
|
import { ProductHandlerAbstract } from '@crystaldesign/product-handler';
|
|
32
34
|
import { useSwipeable } from 'react-swipeable';
|
|
@@ -35,13 +37,13 @@ import { Button as Button$1, Snackbar, SnackbarContent, IconButton, Card, CardHe
|
|
|
35
37
|
import { useTranslation as useTranslation$1, useDivaCore as useDivaCore$1 } from '@crystaldesign/diva-core';
|
|
36
38
|
import QRCode from 'react-qr-code';
|
|
37
39
|
import CloseIcon from '@material-ui/icons/Close';
|
|
38
|
-
import '@crystaldesign/basket-model';
|
|
39
40
|
import IconButton$1 from '@material-ui/core/IconButton';
|
|
40
41
|
import HelpOutline from '@material-ui/icons/HelpOutline';
|
|
42
|
+
import { actions } from '@storybook/addon-actions';
|
|
41
43
|
import * as Styles from '@material-ui/styles';
|
|
42
44
|
|
|
43
45
|
(function() {
|
|
44
|
-
const env = {"STAGE":"production","VERSION":"24.10.0-beta.
|
|
46
|
+
const env = {"STAGE":"production","VERSION":"24.10.0-beta.21"};
|
|
45
47
|
try {
|
|
46
48
|
if (process) {
|
|
47
49
|
process.env = Object.assign({}, process.env);
|
|
@@ -118,8 +120,8 @@ function baseUrl() {
|
|
|
118
120
|
return urlParts[urlParts.length - 2] + '.' + urlParts[urlParts.length - 1];
|
|
119
121
|
}
|
|
120
122
|
|
|
121
|
-
function ownKeys$
|
|
122
|
-
function _objectSpread$
|
|
123
|
+
function ownKeys$h(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; }
|
|
124
|
+
function _objectSpread$h(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$h(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$h(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
123
125
|
var _existingLogger = new Map();
|
|
124
126
|
var _apmInitialized = false;
|
|
125
127
|
var _onErrorEvent = function _onErrorEvent() {};
|
|
@@ -200,9 +202,9 @@ var ApplicationLogger = /*#__PURE__*/function () {
|
|
|
200
202
|
this.transactions["delete"](eventId);
|
|
201
203
|
event.end = end;
|
|
202
204
|
var cleanLabels = this.cleanLabels(labels);
|
|
203
|
-
event.event.labels = _objectSpread$
|
|
205
|
+
event.event.labels = _objectSpread$h(_objectSpread$h({}, event.event.labels), cleanLabels);
|
|
204
206
|
if (event.event.span) {
|
|
205
|
-
event.event.span.addLabels(_objectSpread$
|
|
207
|
+
event.event.span.addLabels(_objectSpread$h(_objectSpread$h(_objectSpread$h({}, event.event.labels), cleanLabels), {}, {
|
|
206
208
|
eventId: eventId
|
|
207
209
|
}));
|
|
208
210
|
event.event.span.end();
|
|
@@ -210,7 +212,7 @@ var ApplicationLogger = /*#__PURE__*/function () {
|
|
|
210
212
|
clearTimeout(event.event.warningTimeout);
|
|
211
213
|
clearTimeout(event.event.errorTimeout);
|
|
212
214
|
this.debug("Transaction ".concat(event.event.type, " (").concat(event.event.message, ") took ").concat(Math.floor(end - event.start), "ms"));
|
|
213
|
-
DivaUtils.businessMetrics.logEvent(event.event.type, this.module, event.event.message, _objectSpread$
|
|
215
|
+
DivaUtils.businessMetrics.logEvent(event.event.type, this.module, event.event.message, _objectSpread$h(_objectSpread$h(_objectSpread$h({}, event.event.labels), cleanLabels), {}, {
|
|
214
216
|
eventId: eventId,
|
|
215
217
|
status: event.event.timeout ? 'TIMEOUT' : 'SUCCESS',
|
|
216
218
|
eventDuration: Math.floor(end - event.start),
|
|
@@ -245,9 +247,9 @@ var ApplicationLogger = /*#__PURE__*/function () {
|
|
|
245
247
|
}
|
|
246
248
|
event.end = end;
|
|
247
249
|
var cleanLabels = this.cleanLabels(labels);
|
|
248
|
-
event.event.labels = _objectSpread$
|
|
250
|
+
event.event.labels = _objectSpread$h(_objectSpread$h({}, event.event.labels), cleanLabels);
|
|
249
251
|
if (event.event.span) {
|
|
250
|
-
event.event.span.addLabels(_objectSpread$
|
|
252
|
+
event.event.span.addLabels(_objectSpread$h(_objectSpread$h(_objectSpread$h({}, event.event.labels), cleanLabels), {}, {
|
|
251
253
|
eventId: eventId
|
|
252
254
|
}));
|
|
253
255
|
event.event.span.end();
|
|
@@ -255,7 +257,7 @@ var ApplicationLogger = /*#__PURE__*/function () {
|
|
|
255
257
|
clearTimeout(event.event.warningTimeout);
|
|
256
258
|
clearTimeout(event.event.errorTimeout);
|
|
257
259
|
this.debug("Transaction ".concat(event.event.type, " (").concat(event.event.message, ") failed after ").concat(Math.floor(end - event.start), "ms"));
|
|
258
|
-
DivaUtils.businessMetrics.logEvent(event.event.type, this.module, event.event.message, _objectSpread$
|
|
260
|
+
DivaUtils.businessMetrics.logEvent(event.event.type, this.module, event.event.message, _objectSpread$h(_objectSpread$h(_objectSpread$h({}, event.event.labels), cleanLabels), {}, {
|
|
259
261
|
error: code,
|
|
260
262
|
errorMessage: message,
|
|
261
263
|
eventId: eventId,
|
|
@@ -348,13 +350,13 @@ var ApplicationLogger = /*#__PURE__*/function () {
|
|
|
348
350
|
}, {
|
|
349
351
|
key: "error",
|
|
350
352
|
value: function error(_error) {
|
|
351
|
-
var _error$
|
|
353
|
+
var _error$custom, _getApmInstance;
|
|
352
354
|
if (!this.isValidLogLevel(3)) return;
|
|
353
|
-
console.error("".concat(this.getPrefix('ERROR', _error.name)).concat(this.getApmTransationIdFormatted())
|
|
355
|
+
console.error("".concat(this.getPrefix('ERROR', _error.name)).concat(this.getApmTransationIdFormatted()), _error, (_error$custom = _error.custom) !== null && _error$custom !== void 0 ? _error$custom : ' ');
|
|
354
356
|
_onErrorEvent(_error.message, _error.name);
|
|
355
357
|
|
|
356
358
|
//for apm we spread the custom object directly on the error object, so that the are added to APM as custom attributes
|
|
357
|
-
var forApm = _objectSpread$
|
|
359
|
+
var forApm = _objectSpread$h(_objectSpread$h({}, _error), _error.custom);
|
|
358
360
|
(_getApmInstance = getApmInstance()) === null || _getApmInstance === void 0 || _getApmInstance.captureError(forApm);
|
|
359
361
|
}
|
|
360
362
|
}, {
|
|
@@ -429,8 +431,8 @@ if (typeof __webpack_public_path__ !== 'undefined') {
|
|
|
429
431
|
}
|
|
430
432
|
|
|
431
433
|
var _excluded$7 = ["children"];
|
|
432
|
-
function ownKeys$
|
|
433
|
-
function _objectSpread$
|
|
434
|
+
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; }
|
|
435
|
+
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; }
|
|
434
436
|
function _callSuper$2(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$2() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
435
437
|
function _isNativeReflectConstruct$2() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct$2 = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
436
438
|
var LOG$e = getLogger('Framework', 'webcomponent');
|
|
@@ -656,14 +658,14 @@ var CoreWrapper = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
656
658
|
if (!components) {
|
|
657
659
|
return /*#__PURE__*/jsx(Fragment, {});
|
|
658
660
|
}
|
|
659
|
-
return /*#__PURE__*/jsx(DivaCore, _objectSpread$
|
|
661
|
+
return /*#__PURE__*/jsx(DivaCore, _objectSpread$g(_objectSpread$g({}, props), {}, {
|
|
660
662
|
components: components,
|
|
661
663
|
ref: ref
|
|
662
664
|
}));
|
|
663
665
|
});
|
|
664
666
|
|
|
665
667
|
//we have to externalize the materialUI styling here, so that also in UMD the same instance is used
|
|
666
|
-
window.MaterialUIStyles = _objectSpread$
|
|
668
|
+
window.MaterialUIStyles = _objectSpread$g(_objectSpread$g({}, Styles), CoreStyles);
|
|
667
669
|
if (!window.customElements.get('diva-framework')) {
|
|
668
670
|
window.customElements.define('diva-framework', DivaFramework);
|
|
669
671
|
}
|
|
@@ -693,8 +695,69 @@ function parseUrl(service, baseUrl) {
|
|
|
693
695
|
}
|
|
694
696
|
}
|
|
695
697
|
|
|
696
|
-
function
|
|
697
|
-
|
|
698
|
+
function parseApiConfig (config, defaultApiConfig, organization) {
|
|
699
|
+
var _ref, _config$baseUrl, _DIVA_GLOBAL_ENV, _window, _GLOBAL_ENV$analytics, _GLOBAL_ENV$authServi, _GLOBAL_ENV$adminServ, _GLOBAL_ENV$messageSe, _GLOBAL_ENV$catalogSe, _GLOBAL_ENV$supportSe, _GLOBAL_ENV$basketSer, _GLOBAL_ENV$mediaServ, _GLOBAL_ENV$construct, _GLOBAL_ENV$reportSer, _GLOBAL_ENV$clientArt, _GLOBAL_ENV$idmServic, _GLOBAL_ENV$enricherS, _config$useDebugUrl, _ref2, _organization$api2Loc, _organization$api2Loc2, _ref3, _ref4, _organization$api2Loc3, _organization$api2Loc4, _organization$api2Loc5, _ref5, _ref6, _organization$api2Loc6, _organization$api2Loc7, _organization$api2Loc8;
|
|
700
|
+
var baseUrl = (_ref = (_config$baseUrl = config === null || config === void 0 ? void 0 : config.baseUrl) !== null && _config$baseUrl !== void 0 ? _config$baseUrl : defaultApiConfig === null || defaultApiConfig === void 0 ? void 0 : defaultApiConfig.baseUrl) !== null && _ref !== void 0 ? _ref : 'https://api.diva-portal.com';
|
|
701
|
+
var GLOBAL_ENV = (_DIVA_GLOBAL_ENV = (_window = window) === null || _window === void 0 ? void 0 : _window.DIVA_GLOBAL_ENV) !== null && _DIVA_GLOBAL_ENV !== void 0 ? _DIVA_GLOBAL_ENV : {};
|
|
702
|
+
var c = {
|
|
703
|
+
analyticsService: (_GLOBAL_ENV$analytics = GLOBAL_ENV.analyticsService) !== null && _GLOBAL_ENV$analytics !== void 0 ? _GLOBAL_ENV$analytics : getUrl('analytics', config === null || config === void 0 ? void 0 : config.analyticsService, defaultApiConfig === null || defaultApiConfig === void 0 ? void 0 : defaultApiConfig.analyticsService, baseUrl),
|
|
704
|
+
authService: (_GLOBAL_ENV$authServi = GLOBAL_ENV.authService) !== null && _GLOBAL_ENV$authServi !== void 0 ? _GLOBAL_ENV$authServi : getUrl('auth', config === null || config === void 0 ? void 0 : config.authService, defaultApiConfig === null || defaultApiConfig === void 0 ? void 0 : defaultApiConfig.authService, baseUrl),
|
|
705
|
+
adminService: (_GLOBAL_ENV$adminServ = GLOBAL_ENV.adminService) !== null && _GLOBAL_ENV$adminServ !== void 0 ? _GLOBAL_ENV$adminServ : getUrl('admin', config === null || config === void 0 ? void 0 : config.adminService, defaultApiConfig === null || defaultApiConfig === void 0 ? void 0 : defaultApiConfig.adminService, baseUrl),
|
|
706
|
+
messageService: (_GLOBAL_ENV$messageSe = GLOBAL_ENV.messageService) !== null && _GLOBAL_ENV$messageSe !== void 0 ? _GLOBAL_ENV$messageSe : getUrl('messages', config === null || config === void 0 ? void 0 : config.messageService, defaultApiConfig === null || defaultApiConfig === void 0 ? void 0 : defaultApiConfig.messageService, baseUrl),
|
|
707
|
+
catalogService: (_GLOBAL_ENV$catalogSe = GLOBAL_ENV.catalogService) !== null && _GLOBAL_ENV$catalogSe !== void 0 ? _GLOBAL_ENV$catalogSe : getUrl('catalog', config === null || config === void 0 ? void 0 : config.catalogService, defaultApiConfig === null || defaultApiConfig === void 0 ? void 0 : defaultApiConfig.catalogService, baseUrl),
|
|
708
|
+
supportService: (_GLOBAL_ENV$supportSe = GLOBAL_ENV.supportService) !== null && _GLOBAL_ENV$supportSe !== void 0 ? _GLOBAL_ENV$supportSe : getUrl('support', config === null || config === void 0 ? void 0 : config.supportService, defaultApiConfig === null || defaultApiConfig === void 0 ? void 0 : defaultApiConfig.supportService, baseUrl),
|
|
709
|
+
basketService: (_GLOBAL_ENV$basketSer = GLOBAL_ENV.basketService) !== null && _GLOBAL_ENV$basketSer !== void 0 ? _GLOBAL_ENV$basketSer : getUrl('basket', config === null || config === void 0 ? void 0 : config.basketService, defaultApiConfig === null || defaultApiConfig === void 0 ? void 0 : defaultApiConfig.basketService, baseUrl),
|
|
710
|
+
mediaService: (_GLOBAL_ENV$mediaServ = GLOBAL_ENV.mediaService) !== null && _GLOBAL_ENV$mediaServ !== void 0 ? _GLOBAL_ENV$mediaServ : getUrl('media', config === null || config === void 0 ? void 0 : config.mediaService, defaultApiConfig === null || defaultApiConfig === void 0 ? void 0 : defaultApiConfig.mediaService, baseUrl),
|
|
711
|
+
constructorService: (_GLOBAL_ENV$construct = GLOBAL_ENV.constructorService) !== null && _GLOBAL_ENV$construct !== void 0 ? _GLOBAL_ENV$construct : getUrl('constructor', config === null || config === void 0 ? void 0 : config.constructorService, defaultApiConfig === null || defaultApiConfig === void 0 ? void 0 : defaultApiConfig.constructorService, baseUrl),
|
|
712
|
+
reportService: (_GLOBAL_ENV$reportSer = GLOBAL_ENV.reportService) !== null && _GLOBAL_ENV$reportSer !== void 0 ? _GLOBAL_ENV$reportSer : getUrl('report', config === null || config === void 0 ? void 0 : config.reportService, defaultApiConfig === null || defaultApiConfig === void 0 ? void 0 : defaultApiConfig.reportService, baseUrl),
|
|
713
|
+
clientArticleService: (_GLOBAL_ENV$clientArt = GLOBAL_ENV.clientArticleService) !== null && _GLOBAL_ENV$clientArt !== void 0 ? _GLOBAL_ENV$clientArt : getUrl('pfister-article', config === null || config === void 0 ? void 0 : config.clientArticleService, defaultApiConfig === null || defaultApiConfig === void 0 ? void 0 : defaultApiConfig.clientArticleService, baseUrl),
|
|
714
|
+
idmService: (_GLOBAL_ENV$idmServic = GLOBAL_ENV.idmService) !== null && _GLOBAL_ENV$idmServic !== void 0 ? _GLOBAL_ENV$idmServic : getUrl('idm', config === null || config === void 0 ? void 0 : config.idmService, defaultApiConfig === null || defaultApiConfig === void 0 ? void 0 : defaultApiConfig.idmService, baseUrl),
|
|
715
|
+
enricherService: (_GLOBAL_ENV$enricherS = GLOBAL_ENV.enricherService) !== null && _GLOBAL_ENV$enricherS !== void 0 ? _GLOBAL_ENV$enricherS : getUrl('enricher', config === null || config === void 0 ? void 0 : config.enricherService, defaultApiConfig === null || defaultApiConfig === void 0 ? void 0 : defaultApiConfig.enricherService, baseUrl),
|
|
716
|
+
baseUrl: baseUrl,
|
|
717
|
+
baseSirvUrls: config === null || config === void 0 ? void 0 : config.baseSirvUrls,
|
|
718
|
+
baseCdnUrl: getUrl('https://cdn.diva-portal.com', config === null || config === void 0 ? void 0 : config.baseCdnUrl, defaultApiConfig === null || defaultApiConfig === void 0 ? void 0 : defaultApiConfig.baseCdnUrl),
|
|
719
|
+
host3d: getUrl('https://diva3dhost.diva-portal.com/diva3d/diva3dhost2', config === null || config === void 0 ? void 0 : config.host3d, defaultApiConfig === null || defaultApiConfig === void 0 ? void 0 : defaultApiConfig.host3d),
|
|
720
|
+
diva3darchive: getUrl('https://diva3dhost.diva-portal.com/diva3d/diva3darchive', config === null || config === void 0 ? void 0 : config.diva3darchive, defaultApiConfig === null || defaultApiConfig === void 0 ? void 0 : defaultApiConfig.diva3darchive),
|
|
721
|
+
useDebugUrl: (_config$useDebugUrl = config === null || config === void 0 ? void 0 : config.useDebugUrl) !== null && _config$useDebugUrl !== void 0 ? _config$useDebugUrl : false,
|
|
722
|
+
arViewerBaseUrl: config === null || config === void 0 ? void 0 : config.arViewerBaseUrl,
|
|
723
|
+
api2: {
|
|
724
|
+
"default": getUrl('https://retail.diva-portal.de/api2_retail/api.aspx', (_ref2 = (_organization$api2Loc = organization === null || organization === void 0 || (_organization$api2Loc2 = organization.api2Location) === null || _organization$api2Loc2 === void 0 || (_organization$api2Loc2 = _organization$api2Loc2.vk) === null || _organization$api2Loc2 === void 0 ? void 0 : _organization$api2Loc2.url) !== null && _organization$api2Loc !== void 0 ? _organization$api2Loc : config === null || config === void 0 ? void 0 : config.api2) !== null && _ref2 !== void 0 ? _ref2 : organization === null || organization === void 0 ? void 0 : organization.originEnvironmentUrl, //deprecated
|
|
725
|
+
defaultApiConfig === null || defaultApiConfig === void 0 ? void 0 : defaultApiConfig.api2),
|
|
726
|
+
ek: getUrl('https://retail.diva-portal.de/api2_retail/api.aspx', (_ref3 = (_ref4 = (_organization$api2Loc3 = organization === null || organization === void 0 || (_organization$api2Loc4 = organization.api2Location) === null || _organization$api2Loc4 === void 0 || (_organization$api2Loc4 = _organization$api2Loc4.ek) === null || _organization$api2Loc4 === void 0 ? void 0 : _organization$api2Loc4.url) !== null && _organization$api2Loc3 !== void 0 ? _organization$api2Loc3 : organization === null || organization === void 0 || (_organization$api2Loc5 = organization.api2Location) === null || _organization$api2Loc5 === void 0 || (_organization$api2Loc5 = _organization$api2Loc5.vk) === null || _organization$api2Loc5 === void 0 ? void 0 : _organization$api2Loc5.url) !== null && _ref4 !== void 0 ? _ref4 : config === null || config === void 0 ? void 0 : config.api2) !== null && _ref3 !== void 0 ? _ref3 : organization === null || organization === void 0 ? void 0 : organization.originEnvironmentUrl, //deprecated
|
|
727
|
+
defaultApiConfig === null || defaultApiConfig === void 0 ? void 0 : defaultApiConfig.api2),
|
|
728
|
+
web: getUrl('https://retail.diva-portal.de/api2_retail/api.aspx', (_ref5 = (_ref6 = (_organization$api2Loc6 = organization === null || organization === void 0 || (_organization$api2Loc7 = organization.api2Location) === null || _organization$api2Loc7 === void 0 || (_organization$api2Loc7 = _organization$api2Loc7.web) === null || _organization$api2Loc7 === void 0 ? void 0 : _organization$api2Loc7.url) !== null && _organization$api2Loc6 !== void 0 ? _organization$api2Loc6 : organization === null || organization === void 0 || (_organization$api2Loc8 = organization.api2Location) === null || _organization$api2Loc8 === void 0 || (_organization$api2Loc8 = _organization$api2Loc8.vk) === null || _organization$api2Loc8 === void 0 ? void 0 : _organization$api2Loc8.url) !== null && _ref6 !== void 0 ? _ref6 : config === null || config === void 0 ? void 0 : config.api2) !== null && _ref5 !== void 0 ? _ref5 : organization === null || organization === void 0 ? void 0 : organization.originEnvironmentUrl, //deprecated
|
|
729
|
+
defaultApiConfig === null || defaultApiConfig === void 0 ? void 0 : defaultApiConfig.api2)
|
|
730
|
+
}
|
|
731
|
+
};
|
|
732
|
+
return c;
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
var defaultTheme = {
|
|
736
|
+
palette: {
|
|
737
|
+
primary: {
|
|
738
|
+
main: '#713434',
|
|
739
|
+
light: '#e4b9b8',
|
|
740
|
+
dark: '#42090e',
|
|
741
|
+
contrastText: '#fff'
|
|
742
|
+
},
|
|
743
|
+
secondary: {
|
|
744
|
+
main: '#474747',
|
|
745
|
+
light: '##c3c3c3',
|
|
746
|
+
dark: '#252525',
|
|
747
|
+
contrastText: '#fff'
|
|
748
|
+
},
|
|
749
|
+
text: {
|
|
750
|
+
primary: 'rgba(0, 0, 0, 0.87)',
|
|
751
|
+
secondary: 'rgba(0, 0, 0, 0.54)'
|
|
752
|
+
}
|
|
753
|
+
},
|
|
754
|
+
typography: {
|
|
755
|
+
fontFamily: 'Roboto'
|
|
756
|
+
}
|
|
757
|
+
};
|
|
758
|
+
|
|
759
|
+
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; }
|
|
760
|
+
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; }
|
|
698
761
|
var LOG$d = getLogger('Framework', 'ConfigurationStore');
|
|
699
762
|
var ConfigurationStore = /*#__PURE__*/function () {
|
|
700
763
|
function ConfigurationStore(root, identifier, defaultApiConfig, domain) {
|
|
@@ -773,29 +836,29 @@ var ConfigurationStore = /*#__PURE__*/function () {
|
|
|
773
836
|
}, {
|
|
774
837
|
key: "theme",
|
|
775
838
|
get: function get() {
|
|
776
|
-
var _this$_configuration8, _theme$palette, _theme$palette2, _theme$palette3, _theme$palette4, _theme$palette5, _theme$palette6, _theme$palette7, _theme$palette8, _theme$palette9, _theme$palette10, _theme$palette11, _theme$palette12, _theme$palette13, _theme$palette14, _theme$typography;
|
|
839
|
+
var _this$_configuration8, _theme$palette$primar, _theme$palette, _theme$palette$primar2, _theme$palette2, _theme$palette$primar3, _theme$palette3, _theme$palette$primar4, _theme$palette4, _ref, _theme$palette$second, _theme$palette5, _theme$palette6, _ref2, _theme$palette$second2, _theme$palette7, _theme$palette8, _ref3, _theme$palette$second3, _theme$palette9, _theme$palette10, _ref4, _theme$palette$second4, _theme$palette11, _theme$palette12, _theme$palette$text$p, _theme$palette13, _theme$palette$text$s, _theme$palette14, _theme$typography$fon, _theme$typography;
|
|
777
840
|
var theme = (_this$_configuration8 = this._configuration) === null || _this$_configuration8 === void 0 ? void 0 : _this$_configuration8.theme;
|
|
778
841
|
return {
|
|
779
842
|
palette: {
|
|
780
843
|
primary: {
|
|
781
|
-
main: (theme === null || theme === void 0 || (_theme$palette = theme.palette) === null || _theme$palette === void 0 || (_theme$palette = _theme$palette.primary) === null || _theme$palette === void 0 ? void 0 : _theme$palette.main)
|
|
782
|
-
light: (theme === null || theme === void 0 || (_theme$palette2 = theme.palette) === null || _theme$palette2 === void 0 || (_theme$palette2 = _theme$palette2.primary) === null || _theme$palette2 === void 0 ? void 0 : _theme$palette2.light)
|
|
783
|
-
dark: (theme === null || theme === void 0 || (_theme$palette3 = theme.palette) === null || _theme$palette3 === void 0 || (_theme$palette3 = _theme$palette3.primary) === null || _theme$palette3 === void 0 ? void 0 : _theme$palette3.dark)
|
|
784
|
-
contrastText: (theme === null || theme === void 0 || (_theme$palette4 = theme.palette) === null || _theme$palette4 === void 0 || (_theme$palette4 = _theme$palette4.primary) === null || _theme$palette4 === void 0 ? void 0 : _theme$palette4.contrastText)
|
|
844
|
+
main: (_theme$palette$primar = theme === null || theme === void 0 || (_theme$palette = theme.palette) === null || _theme$palette === void 0 || (_theme$palette = _theme$palette.primary) === null || _theme$palette === void 0 ? void 0 : _theme$palette.main) !== null && _theme$palette$primar !== void 0 ? _theme$palette$primar : defaultTheme.palette.primary.main,
|
|
845
|
+
light: (_theme$palette$primar2 = theme === null || theme === void 0 || (_theme$palette2 = theme.palette) === null || _theme$palette2 === void 0 || (_theme$palette2 = _theme$palette2.primary) === null || _theme$palette2 === void 0 ? void 0 : _theme$palette2.light) !== null && _theme$palette$primar2 !== void 0 ? _theme$palette$primar2 : defaultTheme.palette.primary.light,
|
|
846
|
+
dark: (_theme$palette$primar3 = theme === null || theme === void 0 || (_theme$palette3 = theme.palette) === null || _theme$palette3 === void 0 || (_theme$palette3 = _theme$palette3.primary) === null || _theme$palette3 === void 0 ? void 0 : _theme$palette3.dark) !== null && _theme$palette$primar3 !== void 0 ? _theme$palette$primar3 : defaultTheme.palette.primary.dark,
|
|
847
|
+
contrastText: (_theme$palette$primar4 = theme === null || theme === void 0 || (_theme$palette4 = theme.palette) === null || _theme$palette4 === void 0 || (_theme$palette4 = _theme$palette4.primary) === null || _theme$palette4 === void 0 ? void 0 : _theme$palette4.contrastText) !== null && _theme$palette$primar4 !== void 0 ? _theme$palette$primar4 : defaultTheme.palette.primary.contrastText
|
|
785
848
|
},
|
|
786
849
|
secondary: {
|
|
787
|
-
main: (theme === null || theme === void 0 || (_theme$palette5 = theme.palette) === null || _theme$palette5 === void 0 || (_theme$palette5 = _theme$palette5.secondary) === null || _theme$palette5 === void 0 ? void 0 : _theme$palette5.main)
|
|
788
|
-
light: (theme === null || theme === void 0 || (_theme$palette7 = theme.palette) === null || _theme$palette7 === void 0 || (_theme$palette7 = _theme$palette7.secondary) === null || _theme$palette7 === void 0 ? void 0 : _theme$palette7.light)
|
|
789
|
-
dark: (theme === null || theme === void 0 || (_theme$palette9 = theme.palette) === null || _theme$palette9 === void 0 || (_theme$palette9 = _theme$palette9.secondary) === null || _theme$palette9 === void 0 ? void 0 : _theme$palette9.dark)
|
|
790
|
-
contrastText: (theme === null || theme === void 0 || (_theme$palette11 = theme.palette) === null || _theme$palette11 === void 0 || (_theme$palette11 = _theme$palette11.secondary) === null || _theme$palette11 === void 0 ? void 0 : _theme$palette11.contrastText)
|
|
850
|
+
main: (_ref = (_theme$palette$second = theme === null || theme === void 0 || (_theme$palette5 = theme.palette) === null || _theme$palette5 === void 0 || (_theme$palette5 = _theme$palette5.secondary) === null || _theme$palette5 === void 0 ? void 0 : _theme$palette5.main) !== null && _theme$palette$second !== void 0 ? _theme$palette$second : theme === null || theme === void 0 || (_theme$palette6 = theme.palette) === null || _theme$palette6 === void 0 || (_theme$palette6 = _theme$palette6.primary) === null || _theme$palette6 === void 0 ? void 0 : _theme$palette6.main) !== null && _ref !== void 0 ? _ref : defaultTheme.palette.secondary.main,
|
|
851
|
+
light: (_ref2 = (_theme$palette$second2 = theme === null || theme === void 0 || (_theme$palette7 = theme.palette) === null || _theme$palette7 === void 0 || (_theme$palette7 = _theme$palette7.secondary) === null || _theme$palette7 === void 0 ? void 0 : _theme$palette7.light) !== null && _theme$palette$second2 !== void 0 ? _theme$palette$second2 : theme === null || theme === void 0 || (_theme$palette8 = theme.palette) === null || _theme$palette8 === void 0 || (_theme$palette8 = _theme$palette8.primary) === null || _theme$palette8 === void 0 ? void 0 : _theme$palette8.light) !== null && _ref2 !== void 0 ? _ref2 : defaultTheme.palette.secondary.light,
|
|
852
|
+
dark: (_ref3 = (_theme$palette$second3 = theme === null || theme === void 0 || (_theme$palette9 = theme.palette) === null || _theme$palette9 === void 0 || (_theme$palette9 = _theme$palette9.secondary) === null || _theme$palette9 === void 0 ? void 0 : _theme$palette9.dark) !== null && _theme$palette$second3 !== void 0 ? _theme$palette$second3 : theme === null || theme === void 0 || (_theme$palette10 = theme.palette) === null || _theme$palette10 === void 0 || (_theme$palette10 = _theme$palette10.primary) === null || _theme$palette10 === void 0 ? void 0 : _theme$palette10.dark) !== null && _ref3 !== void 0 ? _ref3 : defaultTheme.palette.secondary.dark,
|
|
853
|
+
contrastText: (_ref4 = (_theme$palette$second4 = theme === null || theme === void 0 || (_theme$palette11 = theme.palette) === null || _theme$palette11 === void 0 || (_theme$palette11 = _theme$palette11.secondary) === null || _theme$palette11 === void 0 ? void 0 : _theme$palette11.contrastText) !== null && _theme$palette$second4 !== void 0 ? _theme$palette$second4 : theme === null || theme === void 0 || (_theme$palette12 = theme.palette) === null || _theme$palette12 === void 0 || (_theme$palette12 = _theme$palette12.primary) === null || _theme$palette12 === void 0 ? void 0 : _theme$palette12.contrastText) !== null && _ref4 !== void 0 ? _ref4 : defaultTheme.palette.secondary.contrastText
|
|
791
854
|
},
|
|
792
855
|
text: {
|
|
793
|
-
primary: (theme === null || theme === void 0 || (_theme$palette13 = theme.palette) === null || _theme$palette13 === void 0 || (_theme$palette13 = _theme$palette13.text) === null || _theme$palette13 === void 0 ? void 0 : _theme$palette13.primary)
|
|
794
|
-
secondary: (theme === null || theme === void 0 || (_theme$palette14 = theme.palette) === null || _theme$palette14 === void 0 || (_theme$palette14 = _theme$palette14.text) === null || _theme$palette14 === void 0 ? void 0 : _theme$palette14.secondary)
|
|
856
|
+
primary: (_theme$palette$text$p = theme === null || theme === void 0 || (_theme$palette13 = theme.palette) === null || _theme$palette13 === void 0 || (_theme$palette13 = _theme$palette13.text) === null || _theme$palette13 === void 0 ? void 0 : _theme$palette13.primary) !== null && _theme$palette$text$p !== void 0 ? _theme$palette$text$p : defaultTheme.palette.text.primary,
|
|
857
|
+
secondary: (_theme$palette$text$s = theme === null || theme === void 0 || (_theme$palette14 = theme.palette) === null || _theme$palette14 === void 0 || (_theme$palette14 = _theme$palette14.text) === null || _theme$palette14 === void 0 ? void 0 : _theme$palette14.secondary) !== null && _theme$palette$text$s !== void 0 ? _theme$palette$text$s : defaultTheme.palette.text.secondary
|
|
795
858
|
}
|
|
796
859
|
},
|
|
797
860
|
typography: {
|
|
798
|
-
fontFamily: (theme === null || theme === void 0 || (_theme$typography = theme.typography) === null || _theme$typography === void 0 ? void 0 : _theme$typography.fontFamily)
|
|
861
|
+
fontFamily: (_theme$typography$fon = theme === null || theme === void 0 || (_theme$typography = theme.typography) === null || _theme$typography === void 0 ? void 0 : _theme$typography.fontFamily) !== null && _theme$typography$fon !== void 0 ? _theme$typography$fon : defaultTheme.typography.fontFamily
|
|
799
862
|
}
|
|
800
863
|
};
|
|
801
864
|
}
|
|
@@ -852,7 +915,7 @@ var ConfigurationStore = /*#__PURE__*/function () {
|
|
|
852
915
|
key: "authentication",
|
|
853
916
|
get: function get() {
|
|
854
917
|
var _this$_configuration$, _this$_configuration32, _this$_configuration33, _this$_configuration34, _this$_configuration35, _this$_configuration36, _this$_configuration37, _this$_configuration38, _this$_configuration39, _this$_configuration40, _this$_configuration$2, _this$_configuration41;
|
|
855
|
-
return _objectSpread$
|
|
918
|
+
return _objectSpread$f(_objectSpread$f({}, (_this$_configuration$ = (_this$_configuration32 = this._configuration) === null || _this$_configuration32 === void 0 ? void 0 : _this$_configuration32.authentication) !== null && _this$_configuration$ !== void 0 ? _this$_configuration$ : {}), {}, {
|
|
856
919
|
loginMethods: {
|
|
857
920
|
google: (_this$_configuration33 = this._configuration) !== null && _this$_configuration33 !== void 0 && (_this$_configuration33 = _this$_configuration33.authentication) !== null && _this$_configuration33 !== void 0 && _this$_configuration33.loginMethods ? (_this$_configuration34 = this._configuration) === null || _this$_configuration34 === void 0 || (_this$_configuration34 = _this$_configuration34.authentication) === null || _this$_configuration34 === void 0 ? void 0 : _this$_configuration34.loginMethods.google : true,
|
|
858
921
|
microsoft: (_this$_configuration35 = this._configuration) !== null && _this$_configuration35 !== void 0 && (_this$_configuration35 = _this$_configuration35.authentication) !== null && _this$_configuration35 !== void 0 && _this$_configuration35.loginMethods ? (_this$_configuration36 = this._configuration) === null || _this$_configuration36 === void 0 || (_this$_configuration36 = _this$_configuration36.authentication) === null || _this$_configuration36 === void 0 ? void 0 : _this$_configuration36.loginMethods.microsoft : true,
|
|
@@ -883,107 +946,69 @@ var ConfigurationStore = /*#__PURE__*/function () {
|
|
|
883
946
|
var _this$_configuration44;
|
|
884
947
|
return (_this$_configuration44 = this._configuration) === null || _this$_configuration44 === void 0 ? void 0 : _this$_configuration44.telemetry;
|
|
885
948
|
}
|
|
886
|
-
}, {
|
|
887
|
-
key: "cacheSettings",
|
|
888
|
-
get: function get() {
|
|
889
|
-
var _this$_configuration45;
|
|
890
|
-
return (_this$_configuration45 = this._configuration) === null || _this$_configuration45 === void 0 ? void 0 : _this$_configuration45.enableCache;
|
|
891
|
-
}
|
|
892
949
|
}, {
|
|
893
950
|
key: "enableModals",
|
|
894
951
|
get: function get() {
|
|
895
|
-
var _this$
|
|
896
|
-
return !((_this$
|
|
952
|
+
var _this$_configuration45;
|
|
953
|
+
return !((_this$_configuration45 = this._configuration) !== null && _this$_configuration45 !== void 0 && _this$_configuration45.disableModals);
|
|
897
954
|
}
|
|
898
955
|
}, {
|
|
899
956
|
key: "enableSupport",
|
|
900
957
|
get: function get() {
|
|
901
|
-
var _this$
|
|
902
|
-
return (_this$
|
|
958
|
+
var _this$_configuration46;
|
|
959
|
+
return (_this$_configuration46 = this._configuration) === null || _this$_configuration46 === void 0 ? void 0 : _this$_configuration46.enableSupport;
|
|
903
960
|
}
|
|
904
961
|
}, {
|
|
905
962
|
key: "showInitWarnBanner",
|
|
906
963
|
get: function get() {
|
|
907
|
-
var _this$defaultApiConfi, _this$defaultApiConfi2, _this$defaultApiConfi3, _this$
|
|
964
|
+
var _this$defaultApiConfi, _this$defaultApiConfi2, _this$defaultApiConfi3, _this$_configuration47;
|
|
908
965
|
if (!((_this$defaultApiConfi = this.defaultApiConfig) !== null && _this$defaultApiConfi !== void 0 && _this$defaultApiConfi.showInitWarnBanner) || ((_this$defaultApiConfi2 = this.defaultApiConfig) === null || _this$defaultApiConfi2 === void 0 ? void 0 : _this$defaultApiConfi2.showInitWarnBanner) === 'false') {
|
|
909
966
|
localStorage.removeItem('bannerViews');
|
|
910
967
|
}
|
|
911
|
-
return ((_this$defaultApiConfi3 = this.defaultApiConfig) === null || _this$defaultApiConfi3 === void 0 ? void 0 : _this$defaultApiConfi3.showInitWarnBanner) === 'true' && ((_this$
|
|
968
|
+
return ((_this$defaultApiConfi3 = this.defaultApiConfig) === null || _this$defaultApiConfi3 === void 0 ? void 0 : _this$defaultApiConfi3.showInitWarnBanner) === 'true' && ((_this$_configuration47 = this._configuration) === null || _this$_configuration47 === void 0 ? void 0 : _this$_configuration47.showInitWarnBanner);
|
|
912
969
|
}
|
|
913
970
|
}, {
|
|
914
971
|
key: "apiConfig",
|
|
915
972
|
get: function get() {
|
|
916
|
-
var
|
|
917
|
-
|
|
918
|
-
var GLOBAL_ENV = (_DIVA_GLOBAL_ENV = window.DIVA_GLOBAL_ENV) !== null && _DIVA_GLOBAL_ENV !== void 0 ? _DIVA_GLOBAL_ENV : {};
|
|
919
|
-
var c = {
|
|
920
|
-
analyticsService: (_GLOBAL_ENV$analytics = GLOBAL_ENV.analyticsService) !== null && _GLOBAL_ENV$analytics !== void 0 ? _GLOBAL_ENV$analytics : getUrl('analytics', (_this$_configuration50 = this._configuration) === null || _this$_configuration50 === void 0 || (_this$_configuration50 = _this$_configuration50.api) === null || _this$_configuration50 === void 0 ? void 0 : _this$_configuration50.analyticsService, (_this$defaultApiConfi5 = this.defaultApiConfig) === null || _this$defaultApiConfi5 === void 0 ? void 0 : _this$defaultApiConfi5.analyticsService, baseUrl),
|
|
921
|
-
authService: (_GLOBAL_ENV$authServi = GLOBAL_ENV.authService) !== null && _GLOBAL_ENV$authServi !== void 0 ? _GLOBAL_ENV$authServi : getUrl('auth', (_this$_configuration51 = this._configuration) === null || _this$_configuration51 === void 0 || (_this$_configuration51 = _this$_configuration51.api) === null || _this$_configuration51 === void 0 ? void 0 : _this$_configuration51.authService, (_this$defaultApiConfi6 = this.defaultApiConfig) === null || _this$defaultApiConfi6 === void 0 ? void 0 : _this$defaultApiConfi6.authService, baseUrl),
|
|
922
|
-
adminService: (_GLOBAL_ENV$adminServ = GLOBAL_ENV.adminService) !== null && _GLOBAL_ENV$adminServ !== void 0 ? _GLOBAL_ENV$adminServ : getUrl('admin', (_this$_configuration52 = this._configuration) === null || _this$_configuration52 === void 0 || (_this$_configuration52 = _this$_configuration52.api) === null || _this$_configuration52 === void 0 ? void 0 : _this$_configuration52.adminService, (_this$defaultApiConfi7 = this.defaultApiConfig) === null || _this$defaultApiConfi7 === void 0 ? void 0 : _this$defaultApiConfi7.adminService, baseUrl),
|
|
923
|
-
messageService: (_GLOBAL_ENV$messageSe = GLOBAL_ENV.messageService) !== null && _GLOBAL_ENV$messageSe !== void 0 ? _GLOBAL_ENV$messageSe : getUrl('messages', (_this$_configuration53 = this._configuration) === null || _this$_configuration53 === void 0 || (_this$_configuration53 = _this$_configuration53.api) === null || _this$_configuration53 === void 0 ? void 0 : _this$_configuration53.messageService, (_this$defaultApiConfi8 = this.defaultApiConfig) === null || _this$defaultApiConfi8 === void 0 ? void 0 : _this$defaultApiConfi8.messageService, baseUrl),
|
|
924
|
-
catalogService: (_GLOBAL_ENV$catalogSe = GLOBAL_ENV.catalogService) !== null && _GLOBAL_ENV$catalogSe !== void 0 ? _GLOBAL_ENV$catalogSe : getUrl('catalog', (_this$_configuration54 = this._configuration) === null || _this$_configuration54 === void 0 || (_this$_configuration54 = _this$_configuration54.api) === null || _this$_configuration54 === void 0 ? void 0 : _this$_configuration54.catalogService, (_this$defaultApiConfi9 = this.defaultApiConfig) === null || _this$defaultApiConfi9 === void 0 ? void 0 : _this$defaultApiConfi9.catalogService, baseUrl),
|
|
925
|
-
supportService: (_GLOBAL_ENV$supportSe = GLOBAL_ENV.supportService) !== null && _GLOBAL_ENV$supportSe !== void 0 ? _GLOBAL_ENV$supportSe : getUrl('support', (_this$_configuration55 = this._configuration) === null || _this$_configuration55 === void 0 || (_this$_configuration55 = _this$_configuration55.api) === null || _this$_configuration55 === void 0 ? void 0 : _this$_configuration55.supportService, (_this$defaultApiConfi10 = this.defaultApiConfig) === null || _this$defaultApiConfi10 === void 0 ? void 0 : _this$defaultApiConfi10.supportService, baseUrl),
|
|
926
|
-
basketService: (_GLOBAL_ENV$basketSer = GLOBAL_ENV.basketService) !== null && _GLOBAL_ENV$basketSer !== void 0 ? _GLOBAL_ENV$basketSer : getUrl('basket', (_this$_configuration56 = this._configuration) === null || _this$_configuration56 === void 0 || (_this$_configuration56 = _this$_configuration56.api) === null || _this$_configuration56 === void 0 ? void 0 : _this$_configuration56.basketService, (_this$defaultApiConfi11 = this.defaultApiConfig) === null || _this$defaultApiConfi11 === void 0 ? void 0 : _this$defaultApiConfi11.basketService, baseUrl),
|
|
927
|
-
mediaService: (_GLOBAL_ENV$mediaServ = GLOBAL_ENV.mediaService) !== null && _GLOBAL_ENV$mediaServ !== void 0 ? _GLOBAL_ENV$mediaServ : getUrl('media', (_this$_configuration57 = this._configuration) === null || _this$_configuration57 === void 0 || (_this$_configuration57 = _this$_configuration57.api) === null || _this$_configuration57 === void 0 ? void 0 : _this$_configuration57.mediaService, (_this$defaultApiConfi12 = this.defaultApiConfig) === null || _this$defaultApiConfi12 === void 0 ? void 0 : _this$defaultApiConfi12.mediaService, baseUrl),
|
|
928
|
-
constructorService: (_GLOBAL_ENV$construct = GLOBAL_ENV.constructorService) !== null && _GLOBAL_ENV$construct !== void 0 ? _GLOBAL_ENV$construct : getUrl('constructor', (_this$_configuration58 = this._configuration) === null || _this$_configuration58 === void 0 || (_this$_configuration58 = _this$_configuration58.api) === null || _this$_configuration58 === void 0 ? void 0 : _this$_configuration58.constructorService, (_this$defaultApiConfi13 = this.defaultApiConfig) === null || _this$defaultApiConfi13 === void 0 ? void 0 : _this$defaultApiConfi13.constructorService, baseUrl),
|
|
929
|
-
reportService: (_GLOBAL_ENV$reportSer = GLOBAL_ENV.reportService) !== null && _GLOBAL_ENV$reportSer !== void 0 ? _GLOBAL_ENV$reportSer : getUrl('report', (_this$_configuration59 = this._configuration) === null || _this$_configuration59 === void 0 || (_this$_configuration59 = _this$_configuration59.api) === null || _this$_configuration59 === void 0 ? void 0 : _this$_configuration59.reportService, (_this$defaultApiConfi14 = this.defaultApiConfig) === null || _this$defaultApiConfi14 === void 0 ? void 0 : _this$defaultApiConfi14.reportService, baseUrl),
|
|
930
|
-
clientArticleService: (_GLOBAL_ENV$clientArt = GLOBAL_ENV.clientArticleService) !== null && _GLOBAL_ENV$clientArt !== void 0 ? _GLOBAL_ENV$clientArt : getUrl('pfister-article', (_this$_configuration60 = this._configuration) === null || _this$_configuration60 === void 0 || (_this$_configuration60 = _this$_configuration60.api) === null || _this$_configuration60 === void 0 ? void 0 : _this$_configuration60.clientArticleService, (_this$defaultApiConfi15 = this.defaultApiConfig) === null || _this$defaultApiConfi15 === void 0 ? void 0 : _this$defaultApiConfi15.clientArticleService, baseUrl),
|
|
931
|
-
idmService: (_GLOBAL_ENV$idmServic = GLOBAL_ENV.idmService) !== null && _GLOBAL_ENV$idmServic !== void 0 ? _GLOBAL_ENV$idmServic : getUrl('idm', (_this$_configuration61 = this._configuration) === null || _this$_configuration61 === void 0 || (_this$_configuration61 = _this$_configuration61.api) === null || _this$_configuration61 === void 0 ? void 0 : _this$_configuration61.idmService, (_this$defaultApiConfi16 = this.defaultApiConfig) === null || _this$defaultApiConfi16 === void 0 ? void 0 : _this$defaultApiConfi16.idmService, baseUrl),
|
|
932
|
-
enricherService: (_GLOBAL_ENV$enricherS = GLOBAL_ENV.enricherService) !== null && _GLOBAL_ENV$enricherS !== void 0 ? _GLOBAL_ENV$enricherS : getUrl('enricher', (_this$_configuration62 = this._configuration) === null || _this$_configuration62 === void 0 || (_this$_configuration62 = _this$_configuration62.api) === null || _this$_configuration62 === void 0 ? void 0 : _this$_configuration62.enricherService, (_this$defaultApiConfi17 = this.defaultApiConfig) === null || _this$defaultApiConfi17 === void 0 ? void 0 : _this$defaultApiConfi17.enricherService, baseUrl),
|
|
933
|
-
baseUrl: baseUrl,
|
|
934
|
-
baseCdnUrl: getUrl('https://cdn.diva-portal.com', (_this$_configuration63 = this._configuration) === null || _this$_configuration63 === void 0 || (_this$_configuration63 = _this$_configuration63.api) === null || _this$_configuration63 === void 0 ? void 0 : _this$_configuration63.baseCdnUrl, (_this$defaultApiConfi18 = this.defaultApiConfig) === null || _this$defaultApiConfi18 === void 0 ? void 0 : _this$defaultApiConfi18.baseCdnUrl),
|
|
935
|
-
baseSirvUrls: (_this$_configuration64 = this._configuration) === null || _this$_configuration64 === void 0 || (_this$_configuration64 = _this$_configuration64.api) === null || _this$_configuration64 === void 0 ? void 0 : _this$_configuration64.baseSirvUrls,
|
|
936
|
-
host3d: getUrl('https://diva3dhost.diva-portal.com/diva3d/diva3dhost2', (_this$_configuration65 = this._configuration) === null || _this$_configuration65 === void 0 || (_this$_configuration65 = _this$_configuration65.api) === null || _this$_configuration65 === void 0 ? void 0 : _this$_configuration65.host3d, (_this$defaultApiConfi19 = this.defaultApiConfig) === null || _this$defaultApiConfi19 === void 0 ? void 0 : _this$defaultApiConfi19.host3d),
|
|
937
|
-
diva3darchive: getUrl('https://diva3dhost.diva-portal.com/diva3d/diva3darchive', (_this$_configuration66 = this._configuration) === null || _this$_configuration66 === void 0 || (_this$_configuration66 = _this$_configuration66.api) === null || _this$_configuration66 === void 0 ? void 0 : _this$_configuration66.diva3darchive, (_this$defaultApiConfi20 = this.defaultApiConfig) === null || _this$defaultApiConfi20 === void 0 ? void 0 : _this$defaultApiConfi20.diva3darchive),
|
|
938
|
-
useDebugUrl: (_this$_configuration$4 = (_this$_configuration67 = this._configuration) === null || _this$_configuration67 === void 0 || (_this$_configuration67 = _this$_configuration67.api) === null || _this$_configuration67 === void 0 ? void 0 : _this$_configuration67.useDebugUrl) !== null && _this$_configuration$4 !== void 0 ? _this$_configuration$4 : false,
|
|
939
|
-
arViewerBaseUrl: (_this$_configuration68 = this._configuration) === null || _this$_configuration68 === void 0 || (_this$_configuration68 = _this$_configuration68.api) === null || _this$_configuration68 === void 0 ? void 0 : _this$_configuration68.arViewerBaseUrl,
|
|
940
|
-
api2: {
|
|
941
|
-
"default": getUrl('https://retail.diva-portal.de/api2_retail/api.aspx', (_ref2 = (_this$root$dataStore$ = (_this$root$dataStore$2 = this.root.dataStore.organization) === null || _this$root$dataStore$2 === void 0 || (_this$root$dataStore$2 = _this$root$dataStore$2.api2Location) === null || _this$root$dataStore$2 === void 0 || (_this$root$dataStore$2 = _this$root$dataStore$2.vk) === null || _this$root$dataStore$2 === void 0 ? void 0 : _this$root$dataStore$2.url) !== null && _this$root$dataStore$ !== void 0 ? _this$root$dataStore$ : (_this$_configuration69 = this._configuration) === null || _this$_configuration69 === void 0 || (_this$_configuration69 = _this$_configuration69.api) === null || _this$_configuration69 === void 0 ? void 0 : _this$_configuration69.api2) !== null && _ref2 !== void 0 ? _ref2 : (_this$root$dataStore$3 = this.root.dataStore.organization) === null || _this$root$dataStore$3 === void 0 ? void 0 : _this$root$dataStore$3.originEnvironmentUrl, //deprecated
|
|
942
|
-
(_this$defaultApiConfi21 = this.defaultApiConfig) === null || _this$defaultApiConfi21 === void 0 ? void 0 : _this$defaultApiConfi21.api2),
|
|
943
|
-
ek: getUrl('https://retail.diva-portal.de/api2_retail/api.aspx', (_ref3 = (_ref4 = (_this$root$dataStore$4 = (_this$root$dataStore$5 = this.root.dataStore.organization) === null || _this$root$dataStore$5 === void 0 || (_this$root$dataStore$5 = _this$root$dataStore$5.api2Location) === null || _this$root$dataStore$5 === void 0 || (_this$root$dataStore$5 = _this$root$dataStore$5.ek) === null || _this$root$dataStore$5 === void 0 ? void 0 : _this$root$dataStore$5.url) !== null && _this$root$dataStore$4 !== void 0 ? _this$root$dataStore$4 : (_this$root$dataStore$6 = this.root.dataStore.organization) === null || _this$root$dataStore$6 === void 0 || (_this$root$dataStore$6 = _this$root$dataStore$6.api2Location) === null || _this$root$dataStore$6 === void 0 || (_this$root$dataStore$6 = _this$root$dataStore$6.vk) === null || _this$root$dataStore$6 === void 0 ? void 0 : _this$root$dataStore$6.url) !== null && _ref4 !== void 0 ? _ref4 : (_this$_configuration70 = this._configuration) === null || _this$_configuration70 === void 0 || (_this$_configuration70 = _this$_configuration70.api) === null || _this$_configuration70 === void 0 ? void 0 : _this$_configuration70.api2) !== null && _ref3 !== void 0 ? _ref3 : (_this$root$dataStore$7 = this.root.dataStore.organization) === null || _this$root$dataStore$7 === void 0 ? void 0 : _this$root$dataStore$7.originEnvironmentUrl, //deprecated
|
|
944
|
-
(_this$defaultApiConfi22 = this.defaultApiConfig) === null || _this$defaultApiConfi22 === void 0 ? void 0 : _this$defaultApiConfi22.api2),
|
|
945
|
-
web: getUrl('https://retail.diva-portal.de/api2_retail/api.aspx', (_ref5 = (_ref6 = (_this$root$dataStore$8 = (_this$root$dataStore$9 = this.root.dataStore.organization) === null || _this$root$dataStore$9 === void 0 || (_this$root$dataStore$9 = _this$root$dataStore$9.api2Location) === null || _this$root$dataStore$9 === void 0 || (_this$root$dataStore$9 = _this$root$dataStore$9.web) === null || _this$root$dataStore$9 === void 0 ? void 0 : _this$root$dataStore$9.url) !== null && _this$root$dataStore$8 !== void 0 ? _this$root$dataStore$8 : (_this$root$dataStore$10 = this.root.dataStore.organization) === null || _this$root$dataStore$10 === void 0 || (_this$root$dataStore$10 = _this$root$dataStore$10.api2Location) === null || _this$root$dataStore$10 === void 0 || (_this$root$dataStore$10 = _this$root$dataStore$10.vk) === null || _this$root$dataStore$10 === void 0 ? void 0 : _this$root$dataStore$10.url) !== null && _ref6 !== void 0 ? _ref6 : (_this$_configuration71 = this._configuration) === null || _this$_configuration71 === void 0 || (_this$_configuration71 = _this$_configuration71.api) === null || _this$_configuration71 === void 0 ? void 0 : _this$_configuration71.api2) !== null && _ref5 !== void 0 ? _ref5 : (_this$root$dataStore$11 = this.root.dataStore.organization) === null || _this$root$dataStore$11 === void 0 ? void 0 : _this$root$dataStore$11.originEnvironmentUrl, //deprecated
|
|
946
|
-
(_this$defaultApiConfi23 = this.defaultApiConfig) === null || _this$defaultApiConfi23 === void 0 ? void 0 : _this$defaultApiConfi23.api2)
|
|
947
|
-
}
|
|
948
|
-
};
|
|
949
|
-
return c;
|
|
973
|
+
var _this$_configuration48;
|
|
974
|
+
return parseApiConfig((_this$_configuration48 = this._configuration) === null || _this$_configuration48 === void 0 ? void 0 : _this$_configuration48.api, this.defaultApiConfig, this.root.dataStore.organization);
|
|
950
975
|
}
|
|
951
976
|
}, {
|
|
952
977
|
key: "applicationEnvironment",
|
|
953
978
|
get: function get() {
|
|
954
|
-
var _this$_configuration$
|
|
955
|
-
return (_this$_configuration$
|
|
979
|
+
var _this$_configuration$3, _this$_configuration49;
|
|
980
|
+
return (_this$_configuration$3 = (_this$_configuration49 = this._configuration) === null || _this$_configuration49 === void 0 ? void 0 : _this$_configuration49.applicationEnvironment) !== null && _this$_configuration$3 !== void 0 ? _this$_configuration$3 : 'SELLER';
|
|
956
981
|
}
|
|
957
982
|
}, {
|
|
958
983
|
key: "priceFormat",
|
|
959
984
|
get: function get() {
|
|
960
|
-
var _this$
|
|
961
|
-
if ((_this$
|
|
962
|
-
var _this$
|
|
963
|
-
return _objectSpread$
|
|
964
|
-
currency: (_this$root$dataStore$
|
|
985
|
+
var _this$_configuration50;
|
|
986
|
+
if ((_this$_configuration50 = this._configuration) !== null && _this$_configuration50 !== void 0 && _this$_configuration50.priceFormat) {
|
|
987
|
+
var _this$_configuration51, _this$root$dataStore$, _this$root$dataStore$2, _this$_configuration52;
|
|
988
|
+
return _objectSpread$f(_objectSpread$f({}, (_this$_configuration51 = this._configuration) === null || _this$_configuration51 === void 0 ? void 0 : _this$_configuration51.priceFormat), {}, {
|
|
989
|
+
currency: (_this$root$dataStore$ = (_this$root$dataStore$2 = this.root.dataStore.organization) === null || _this$root$dataStore$2 === void 0 ? void 0 : _this$root$dataStore$2.settings.defaultCurrency) !== null && _this$root$dataStore$ !== void 0 ? _this$root$dataStore$ : (_this$_configuration52 = this._configuration) === null || _this$_configuration52 === void 0 ? void 0 : _this$_configuration52.priceFormat.currency
|
|
965
990
|
});
|
|
966
991
|
} else {
|
|
967
|
-
var _this$root$dataStore$
|
|
968
|
-
return _objectSpread$
|
|
969
|
-
currency: (_this$root$dataStore$
|
|
992
|
+
var _this$root$dataStore$3, _this$root$dataStore$4;
|
|
993
|
+
return _objectSpread$f(_objectSpread$f({}, DivaUtils.defaultPriceFormat), {}, {
|
|
994
|
+
currency: (_this$root$dataStore$3 = (_this$root$dataStore$4 = this.root.dataStore.organization) === null || _this$root$dataStore$4 === void 0 ? void 0 : _this$root$dataStore$4.settings.defaultCurrency) !== null && _this$root$dataStore$3 !== void 0 ? _this$root$dataStore$3 : DivaUtils.defaultPriceFormat.currency
|
|
970
995
|
});
|
|
971
996
|
}
|
|
972
997
|
}
|
|
973
998
|
}, {
|
|
974
999
|
key: "countryCodesFile",
|
|
975
1000
|
get: function get() {
|
|
976
|
-
var _this$
|
|
977
|
-
return (_this$
|
|
1001
|
+
var _this$_configuration53;
|
|
1002
|
+
return (_this$_configuration53 = this._configuration) === null || _this$_configuration53 === void 0 ? void 0 : _this$_configuration53.countryCodesFile;
|
|
978
1003
|
}
|
|
979
1004
|
}, {
|
|
980
1005
|
key: "allowedOrganizationTypes",
|
|
981
1006
|
get: function get() {
|
|
982
|
-
var _this$
|
|
983
|
-
if (!((_this$
|
|
1007
|
+
var _this$_configuration54, _this$_configuration55, _this$_configuration56, _this$_configuration57;
|
|
1008
|
+
if (!((_this$_configuration54 = this._configuration) !== null && _this$_configuration54 !== void 0 && _this$_configuration54.allowedOrganizationTypes)) {
|
|
984
1009
|
return ['RETAILER'];
|
|
985
1010
|
}
|
|
986
|
-
return Array.isArray((_this$
|
|
1011
|
+
return Array.isArray((_this$_configuration55 = this._configuration) === null || _this$_configuration55 === void 0 ? void 0 : _this$_configuration55.allowedOrganizationTypes) ? (_this$_configuration56 = this._configuration) === null || _this$_configuration56 === void 0 ? void 0 : _this$_configuration56.allowedOrganizationTypes : [(_this$_configuration57 = this._configuration) === null || _this$_configuration57 === void 0 ? void 0 : _this$_configuration57.allowedOrganizationTypes];
|
|
987
1012
|
}
|
|
988
1013
|
}, {
|
|
989
1014
|
key: "resetConfigurationCache",
|
|
@@ -993,12 +1018,12 @@ var ConfigurationStore = /*#__PURE__*/function () {
|
|
|
993
1018
|
}, {
|
|
994
1019
|
key: "fetchConfiguration",
|
|
995
1020
|
value: function () {
|
|
996
|
-
var _fetchConfiguration = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(
|
|
997
|
-
var identifier, type, domain,
|
|
1021
|
+
var _fetchConfiguration = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref5) {
|
|
1022
|
+
var identifier, type, domain, _ref5$organizationId, organizationId, configuration, types, settingsKeys, _i, _types, subType;
|
|
998
1023
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
999
1024
|
while (1) switch (_context.prev = _context.next) {
|
|
1000
1025
|
case 0:
|
|
1001
|
-
identifier =
|
|
1026
|
+
identifier = _ref5.identifier, type = _ref5.type, domain = _ref5.domain, _ref5$organizationId = _ref5.organizationId, organizationId = _ref5$organizationId === void 0 ? this.root.dataStore.organizationId : _ref5$organizationId;
|
|
1002
1027
|
LOG$d.debug("Fetching configuration for ".concat(type, " ").concat(identifier !== null && identifier !== void 0 ? identifier : '', " ").concat(domain !== null && domain !== void 0 ? domain : '', " ").concat(organizationId));
|
|
1003
1028
|
configuration = this.configurationCache.get(type + identifier + organizationId);
|
|
1004
1029
|
if (!configuration) {
|
|
@@ -1193,8 +1218,8 @@ function userAgentIsMobile() {
|
|
|
1193
1218
|
return !!md.mobile();
|
|
1194
1219
|
}
|
|
1195
1220
|
|
|
1196
|
-
function ownKeys$
|
|
1197
|
-
function _objectSpread$
|
|
1221
|
+
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; }
|
|
1222
|
+
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; }
|
|
1198
1223
|
var LOG$c = getLogger('Framework', 'DataStore');
|
|
1199
1224
|
var DataStore = /*#__PURE__*/function () {
|
|
1200
1225
|
function DataStore(root) {
|
|
@@ -1223,8 +1248,8 @@ var DataStore = /*#__PURE__*/function () {
|
|
|
1223
1248
|
key: "organization",
|
|
1224
1249
|
get: function get() {
|
|
1225
1250
|
var _settings$defaultCurr, _settings;
|
|
1226
|
-
return this._organization ? _objectSpread$
|
|
1227
|
-
settings: _objectSpread$
|
|
1251
|
+
return this._organization ? _objectSpread$e(_objectSpread$e({}, this._organization), {}, {
|
|
1252
|
+
settings: _objectSpread$e(_objectSpread$e({}, this._organization.settings), {}, {
|
|
1228
1253
|
defaultCurrency: (_settings$defaultCurr = (_settings = this._organization.settings) === null || _settings === void 0 ? void 0 : _settings.defaultCurrency) !== null && _settings$defaultCurr !== void 0 ? _settings$defaultCurr : '€'
|
|
1229
1254
|
})
|
|
1230
1255
|
}) : this._organization;
|
|
@@ -1265,7 +1290,7 @@ var DataStore = /*#__PURE__*/function () {
|
|
|
1265
1290
|
return [].concat(_toConsumableArray(((_this$_organization$p = (_this$_organization$p2 = this._organization.parentOrganizations) === null || _this$_organization$p2 === void 0 ? void 0 : _this$_organization$p2.filter(function (org) {
|
|
1266
1291
|
return _this._parentOrganizations.includes(org._id);
|
|
1267
1292
|
})) !== null && _this$_organization$p !== void 0 ? _this$_organization$p : []).map(function (org) {
|
|
1268
|
-
return _objectSpread$
|
|
1293
|
+
return _objectSpread$e(_objectSpread$e({}, org), {}, {
|
|
1269
1294
|
type: org.type != 'SUPPLIER' ? org.parentType : undefined //supplier should not be accessed directly, only its children, so the simpliest solution is to remove here the type
|
|
1270
1295
|
});
|
|
1271
1296
|
}).reverse()), [{
|
|
@@ -1707,14 +1732,14 @@ var css_248z$6 = ".auth-y9j9- {\n height: 100%;\n width: 100%;\n display: fle
|
|
|
1707
1732
|
styleInject(css_248z$6);
|
|
1708
1733
|
|
|
1709
1734
|
var _excluded$6 = ["className", "disabled", "children"];
|
|
1710
|
-
function ownKeys$
|
|
1711
|
-
function _objectSpread$
|
|
1735
|
+
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; }
|
|
1736
|
+
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; }
|
|
1712
1737
|
function Button (_ref) {
|
|
1713
1738
|
var className = _ref.className,
|
|
1714
1739
|
disabled = _ref.disabled,
|
|
1715
1740
|
children = _ref.children,
|
|
1716
1741
|
props = _objectWithoutProperties(_ref, _excluded$6);
|
|
1717
|
-
return /*#__PURE__*/jsx("div", _objectSpread$
|
|
1742
|
+
return /*#__PURE__*/jsx("div", _objectSpread$d(_objectSpread$d({
|
|
1718
1743
|
className: classnames(authButton, className, disabled ? buttonDisabled : undefined)
|
|
1719
1744
|
}, props), {}, {
|
|
1720
1745
|
children: children
|
|
@@ -1722,13 +1747,13 @@ function Button (_ref) {
|
|
|
1722
1747
|
}
|
|
1723
1748
|
|
|
1724
1749
|
var _excluded$5 = ["className", "readOnly"];
|
|
1725
|
-
function ownKeys$
|
|
1726
|
-
function _objectSpread$
|
|
1750
|
+
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; }
|
|
1751
|
+
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; }
|
|
1727
1752
|
var Input = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
1728
1753
|
var className = _ref.className,
|
|
1729
1754
|
readOnly = _ref.readOnly,
|
|
1730
1755
|
props = _objectWithoutProperties(_ref, _excluded$5);
|
|
1731
|
-
return /*#__PURE__*/jsx("input", _objectSpread$
|
|
1756
|
+
return /*#__PURE__*/jsx("input", _objectSpread$c({
|
|
1732
1757
|
ref: ref,
|
|
1733
1758
|
className: classnames(input, readOnly ? readonly : undefined, className),
|
|
1734
1759
|
readOnly: readOnly
|
|
@@ -1845,15 +1870,198 @@ function Barrier (_ref) {
|
|
|
1845
1870
|
});
|
|
1846
1871
|
}
|
|
1847
1872
|
|
|
1848
|
-
|
|
1873
|
+
function _callSuper$1(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$1() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
1874
|
+
function _isNativeReflectConstruct$1() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct$1 = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
1875
|
+
var LOG$b = getLogger('Framework', 'root');
|
|
1876
|
+
var ErrorBoundary = /*#__PURE__*/function (_React$Component) {
|
|
1877
|
+
function ErrorBoundary(props) {
|
|
1878
|
+
var _this;
|
|
1879
|
+
_classCallCheck(this, ErrorBoundary);
|
|
1880
|
+
_this = _callSuper$1(this, ErrorBoundary, [props]);
|
|
1881
|
+
_defineProperty(_this, "root", void 0);
|
|
1882
|
+
_this.root = props.root;
|
|
1883
|
+
return _this;
|
|
1884
|
+
}
|
|
1885
|
+
_inherits(ErrorBoundary, _React$Component);
|
|
1886
|
+
return _createClass(ErrorBoundary, [{
|
|
1887
|
+
key: "componentDidCatch",
|
|
1888
|
+
value: function componentDidCatch(error) {
|
|
1889
|
+
LOG$b.error(new DivaError('Error while rendring in Core', {
|
|
1890
|
+
cause: error,
|
|
1891
|
+
custom: {
|
|
1892
|
+
code: 'CORE_0000'
|
|
1893
|
+
}
|
|
1894
|
+
}));
|
|
1895
|
+
this.root.loadingAndErrorStore.setError(error.message);
|
|
1896
|
+
}
|
|
1897
|
+
}, {
|
|
1898
|
+
key: "render",
|
|
1899
|
+
value: function render() {
|
|
1900
|
+
return this.props.children;
|
|
1901
|
+
}
|
|
1902
|
+
}], [{
|
|
1903
|
+
key: "getDerivedStateFromError",
|
|
1904
|
+
value: function getDerivedStateFromError() {
|
|
1905
|
+
// just to prevent warning
|
|
1906
|
+
return {};
|
|
1907
|
+
}
|
|
1908
|
+
}]);
|
|
1909
|
+
}(React.Component);
|
|
1910
|
+
|
|
1911
|
+
function Fallback () {
|
|
1912
|
+
var _useDivaCoreContext = useDivaCoreContext(),
|
|
1913
|
+
loadingAndErrorStore = _useDivaCoreContext.loadingAndErrorStore;
|
|
1914
|
+
useEffect(function () {
|
|
1915
|
+
loadingAndErrorStore.toggleLoading('Fallback');
|
|
1916
|
+
return function () {
|
|
1917
|
+
return loadingAndErrorStore.toggleLoading('Fallback');
|
|
1918
|
+
};
|
|
1919
|
+
}, []);
|
|
1920
|
+
return /*#__PURE__*/jsx(Fragment, {});
|
|
1921
|
+
}
|
|
1922
|
+
|
|
1923
|
+
var _excluded$4 = ["children"];
|
|
1924
|
+
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; }
|
|
1925
|
+
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; }
|
|
1926
|
+
var LOG$a = getLogger('Framework', 'root');
|
|
1927
|
+
var DivaCore = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
1928
|
+
var children = _ref.children,
|
|
1929
|
+
props = _objectWithoutProperties(_ref, _excluded$4);
|
|
1930
|
+
useEffect(function () {
|
|
1931
|
+
LOG$a.successTransaction('UNTIL_RENDER');
|
|
1932
|
+
}, []);
|
|
1933
|
+
return /*#__PURE__*/jsx(DivaCoreProvider, _objectSpread$b(_objectSpread$b({}, props), {}, {
|
|
1934
|
+
ref: ref,
|
|
1935
|
+
children: /*#__PURE__*/jsx(ContentWrapper, {
|
|
1936
|
+
children: /*#__PURE__*/jsx(Fragment, {
|
|
1937
|
+
children: children !== null && children !== void 0 ? children : /*#__PURE__*/jsx(Content, {})
|
|
1938
|
+
})
|
|
1939
|
+
})
|
|
1940
|
+
}));
|
|
1941
|
+
});
|
|
1942
|
+
var ContentWrapper = observer(function (_ref2) {
|
|
1943
|
+
var children = _ref2.children;
|
|
1944
|
+
var context = useDivaCoreContext();
|
|
1945
|
+
var _context$contentStore = context.contentStore.containerDimensions,
|
|
1946
|
+
isMobile = _context$contentStore.isMobile,
|
|
1947
|
+
isPortrait = _context$contentStore.isPortrait;
|
|
1948
|
+
var ref = useCallback(function (node) {
|
|
1949
|
+
if (node !== null) {
|
|
1950
|
+
context.contentStore.setContainer(node);
|
|
1951
|
+
}
|
|
1952
|
+
}, []);
|
|
1953
|
+
return /*#__PURE__*/jsx(StylesProvider, {
|
|
1954
|
+
injectFirst: true,
|
|
1955
|
+
children: /*#__PURE__*/jsx("div", {
|
|
1956
|
+
ref: ref,
|
|
1957
|
+
id: "DivaCore",
|
|
1958
|
+
style: {
|
|
1959
|
+
position: 'relative',
|
|
1960
|
+
height: '100%',
|
|
1961
|
+
overflow: 'hidden'
|
|
1962
|
+
},
|
|
1963
|
+
className: (isPortrait ? ' portrait' : '') + (isMobile ? ' mobile' : '') + (isMobile && !isPortrait ? ' landscape' : ''),
|
|
1964
|
+
children: /*#__PURE__*/jsx(I18nextProvider, {
|
|
1965
|
+
i18n: instance,
|
|
1966
|
+
children: /*#__PURE__*/jsx(ErrorBoundary, {
|
|
1967
|
+
root: context,
|
|
1968
|
+
children: /*#__PURE__*/jsx(MuiThemeProvider, {
|
|
1969
|
+
theme: context.contentStore.materialUiTheme,
|
|
1970
|
+
children: /*#__PURE__*/jsx(Suspense, {
|
|
1971
|
+
fallback: /*#__PURE__*/jsx(Fallback, {}),
|
|
1972
|
+
children: children
|
|
1973
|
+
})
|
|
1974
|
+
})
|
|
1975
|
+
})
|
|
1976
|
+
})
|
|
1977
|
+
})
|
|
1978
|
+
});
|
|
1979
|
+
});
|
|
1980
|
+
|
|
1981
|
+
function calculateDimensions(width, height) {
|
|
1982
|
+
var isPortrait = false;
|
|
1983
|
+
var isMobile = false;
|
|
1984
|
+
var isTablet = false;
|
|
1985
|
+
if (width < height) {
|
|
1986
|
+
isPortrait = true;
|
|
1987
|
+
}
|
|
1988
|
+
if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) || width < 900) {
|
|
1989
|
+
isMobile = true;
|
|
1990
|
+
}
|
|
1991
|
+
if (/(tablet|ipad|playbook|silk)|(android(?!.*mobi))/i.test(navigator.userAgent) || navigator.userAgent.match(/Mac/) && navigator.maxTouchPoints && navigator.maxTouchPoints > 2) {
|
|
1992
|
+
isTablet = true;
|
|
1993
|
+
}
|
|
1994
|
+
return {
|
|
1995
|
+
isPortrait: isPortrait,
|
|
1996
|
+
isMobile: isMobile,
|
|
1997
|
+
isTablet: isTablet,
|
|
1998
|
+
width: Math.round(width),
|
|
1999
|
+
height: Math.round(height)
|
|
2000
|
+
};
|
|
2001
|
+
}
|
|
2002
|
+
function registerResizeObserver(_x, _x2) {
|
|
2003
|
+
return _registerResizeObserver.apply(this, arguments);
|
|
2004
|
+
}
|
|
2005
|
+
function _registerResizeObserver() {
|
|
2006
|
+
_registerResizeObserver = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(ref, onResize) {
|
|
2007
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
2008
|
+
while (1) switch (_context.prev = _context.next) {
|
|
2009
|
+
case 0:
|
|
2010
|
+
return _context.abrupt("return", new Promise(function (resolve) {
|
|
2011
|
+
if ('ResizeObserver' in self) {
|
|
2012
|
+
resolve(buildResizeObserver(ref, onResize));
|
|
2013
|
+
} else {
|
|
2014
|
+
DivaUtils.loadScript('https://cdn.jsdelivr.net/npm/resize-observer-polyfill@1.5.1/dist/ResizeObserver.min.js', function () {
|
|
2015
|
+
return resolve(buildResizeObserver(ref, onResize));
|
|
2016
|
+
});
|
|
2017
|
+
}
|
|
2018
|
+
}));
|
|
2019
|
+
case 1:
|
|
2020
|
+
case "end":
|
|
2021
|
+
return _context.stop();
|
|
2022
|
+
}
|
|
2023
|
+
}, _callee);
|
|
2024
|
+
}));
|
|
2025
|
+
return _registerResizeObserver.apply(this, arguments);
|
|
2026
|
+
}
|
|
2027
|
+
function unregisterResizeObserver(observer) {
|
|
2028
|
+
observer.disconnect();
|
|
2029
|
+
}
|
|
2030
|
+
function buildResizeObserver(ref, onResize) {
|
|
2031
|
+
var resizeObserver = new ResizeObserver(debounce(function (entries) {
|
|
2032
|
+
if (entries.length === 0) return;
|
|
2033
|
+
var _entries$0$contentRec = entries[0].contentRect,
|
|
2034
|
+
width = _entries$0$contentRec.width,
|
|
2035
|
+
height = _entries$0$contentRec.height;
|
|
2036
|
+
onResize(width, height);
|
|
2037
|
+
}, 150));
|
|
2038
|
+
resizeObserver.observe(ref);
|
|
2039
|
+
return resizeObserver;
|
|
2040
|
+
}
|
|
2041
|
+
|
|
2042
|
+
function updateCssThemeVariables (ref, theme) {
|
|
2043
|
+
ref.style.setProperty('--diva-theme-palette-primary-main', theme.palette.primary.main);
|
|
2044
|
+
ref.style.setProperty('--diva-theme-palette-primary-dark', theme.palette.primary.dark);
|
|
2045
|
+
ref.style.setProperty('--diva-theme-palette-primary-light', theme.palette.primary.light);
|
|
2046
|
+
ref.style.setProperty('--diva-theme-palette-primary-contrast-text', theme.palette.primary.contrastText);
|
|
2047
|
+
ref.style.setProperty('--diva-theme-palette-secondary-main', theme.palette.secondary.main);
|
|
2048
|
+
ref.style.setProperty('--diva-theme-palette-secondary-dark', theme.palette.secondary.dark);
|
|
2049
|
+
ref.style.setProperty('--diva-theme-palette-secondary-light', theme.palette.secondary.light);
|
|
2050
|
+
ref.style.setProperty('--diva-theme-palette-secondary-contrast-text', theme.palette.secondary.contrastText);
|
|
2051
|
+
ref.style.setProperty('--diva-theme-palette-text-primary', theme.palette.text.primary);
|
|
2052
|
+
ref.style.setProperty('--diva-theme-palette-text-secondary', theme.palette.text.secondary);
|
|
2053
|
+
ref.style.setProperty('--diva-typography-font-family', theme.typography.fontFamily);
|
|
2054
|
+
ref.style.setProperty('font-family', theme.typography.fontFamily);
|
|
2055
|
+
}
|
|
2056
|
+
|
|
2057
|
+
var _excluded$3 = ["openFrom"],
|
|
1849
2058
|
_excluded2$1 = ["onClose"];
|
|
1850
2059
|
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t["return"] || t["return"](); } finally { if (u) throw o; } } }; }
|
|
1851
2060
|
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
1852
2061
|
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
1853
|
-
function ownKeys$
|
|
1854
|
-
function _objectSpread$
|
|
1855
|
-
var LOG$
|
|
1856
|
-
var debounce = require('lodash.debounce');
|
|
2062
|
+
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; }
|
|
2063
|
+
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; }
|
|
2064
|
+
var LOG$9 = getLogger('Framework', 'ContentStore');
|
|
1857
2065
|
var ContentStore = /*#__PURE__*/function () {
|
|
1858
2066
|
function ContentStore(components, root) {
|
|
1859
2067
|
var _this = this;
|
|
@@ -1924,7 +2132,7 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
1924
2132
|
});
|
|
1925
2133
|
this.root = root;
|
|
1926
2134
|
this.configuration = components;
|
|
1927
|
-
LOG$
|
|
2135
|
+
LOG$9.debug("Available Components: ".concat(components.map(function (c) {
|
|
1928
2136
|
return c.name;
|
|
1929
2137
|
})));
|
|
1930
2138
|
makeAutoObservable(this, {
|
|
@@ -2025,12 +2233,12 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
2025
2233
|
return _context.abrupt("return");
|
|
2026
2234
|
case 3:
|
|
2027
2235
|
this.root.loadingAndErrorStore.toggleLoading('openComponent');
|
|
2028
|
-
LOG$
|
|
2236
|
+
LOG$9.debug('openComponent', toJS(action));
|
|
2029
2237
|
if (!action.url) {
|
|
2030
2238
|
_context.next = 10;
|
|
2031
2239
|
break;
|
|
2032
2240
|
}
|
|
2033
|
-
LOG$
|
|
2241
|
+
LOG$9.businessEvent('onOpenModule', action.openInNewTab ? 'OpenUrlNewTab' : 'OpenUrl', "Open link ".concat(action.url), {
|
|
2034
2242
|
url: action.url
|
|
2035
2243
|
});
|
|
2036
2244
|
if (action.openInNewTab) {
|
|
@@ -2074,7 +2282,7 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
2074
2282
|
_context.next = 28;
|
|
2075
2283
|
break;
|
|
2076
2284
|
}
|
|
2077
|
-
LOG$
|
|
2285
|
+
LOG$9.debug("Component is restricted, open login form");
|
|
2078
2286
|
this._restrictedComponent = action;
|
|
2079
2287
|
this.root.authorizationStore.showLogin();
|
|
2080
2288
|
this.root.loadingAndErrorStore.toggleLoading('openComponent');
|
|
@@ -2113,19 +2321,19 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
2113
2321
|
case 41:
|
|
2114
2322
|
openModuleLables = undefined;
|
|
2115
2323
|
if (parameters) {
|
|
2116
|
-
_parameters = parameters, _parameters.openFrom, otherPrams = _objectWithoutProperties(_parameters, _excluded$
|
|
2324
|
+
_parameters = parameters, _parameters.openFrom, otherPrams = _objectWithoutProperties(_parameters, _excluded$3);
|
|
2117
2325
|
openModuleLables = parameters;
|
|
2118
2326
|
parameters = otherPrams;
|
|
2119
2327
|
}
|
|
2120
2328
|
module = this.mapTypeToModule((_config4 = config) === null || _config4 === void 0 ? void 0 : _config4.type);
|
|
2121
|
-
LOG$
|
|
2329
|
+
LOG$9.businessEvent('onOpenModule', module, "Open module ".concat((_config5 = config) === null || _config5 === void 0 ? void 0 : _config5.type), openModuleLables);
|
|
2122
2330
|
prevType = this.visible;
|
|
2123
2331
|
prevState = this.state.get(this.visible || '');
|
|
2124
2332
|
currentState = this.state.get(config.type);
|
|
2125
2333
|
componentState = {};
|
|
2126
2334
|
componentState.settings = toJS(settings);
|
|
2127
|
-
componentState.parameters = _objectSpread$
|
|
2128
|
-
componentState.internal = _objectSpread$
|
|
2335
|
+
componentState.parameters = _objectSpread$a(_objectSpread$a({}, keepOldState && currentState ? currentState.parameters : {}), parameters);
|
|
2336
|
+
componentState.internal = _objectSpread$a(_objectSpread$a({}, keepOldState && currentState ? currentState.internal : {}), internal);
|
|
2129
2337
|
componentState.path = route;
|
|
2130
2338
|
this.state.set(config.type, componentState);
|
|
2131
2339
|
this.visible = config.type;
|
|
@@ -2176,7 +2384,7 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
2176
2384
|
return _regeneratorRuntime.wrap(function openComponentInFullscreen$(_context2) {
|
|
2177
2385
|
while (1) switch (_context2.prev = _context2.next) {
|
|
2178
2386
|
case 0:
|
|
2179
|
-
LOG$
|
|
2387
|
+
LOG$9.debug('openComponentInFullscreen', toJS(component));
|
|
2180
2388
|
this.root.loadingAndErrorStore.setError(undefined);
|
|
2181
2389
|
type = component.type, parameters = component.parameters, internal = component.internal, route = component.route;
|
|
2182
2390
|
config = undefined;
|
|
@@ -2222,7 +2430,7 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
2222
2430
|
settings = _context2.sent;
|
|
2223
2431
|
case 18:
|
|
2224
2432
|
module = this.mapTypeToModule((_config6 = config) === null || _config6 === void 0 ? void 0 : _config6.type);
|
|
2225
|
-
LOG$
|
|
2433
|
+
LOG$9.businessEvent('onOpenModule', module, "Open module ".concat((_config7 = config) === null || _config7 === void 0 ? void 0 : _config7.type));
|
|
2226
2434
|
componentState = {
|
|
2227
2435
|
key: config.type,
|
|
2228
2436
|
parameters: parameters,
|
|
@@ -2278,7 +2486,7 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
2278
2486
|
if (settings !== null && settings !== void 0 && settings.skipVerify) {
|
|
2279
2487
|
return;
|
|
2280
2488
|
}
|
|
2281
|
-
LOG$
|
|
2489
|
+
LOG$9.debug("Request email verification for ".concat(email));
|
|
2282
2490
|
_this2.root.apiHandler.sendVerificationEmail({
|
|
2283
2491
|
email: email,
|
|
2284
2492
|
emailVariant: (_settings$emailVarian = settings === null || settings === void 0 ? void 0 : settings.emailVariant) !== null && _settings$emailVarian !== void 0 ? _settings$emailVarian : 'DEMO'
|
|
@@ -2677,7 +2885,7 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
2677
2885
|
onClose = _ref3$onClose === void 0 ? this.closeSideMenu.bind(this) : _ref3$onClose,
|
|
2678
2886
|
sideMenu = _objectWithoutProperties(_ref3, _excluded2$1);
|
|
2679
2887
|
if (sideMenu.open === undefined) sideMenu.open = (_this$_sideMenu$open = (_this$_sideMenu = this._sideMenu) === null || _this$_sideMenu === void 0 ? void 0 : _this$_sideMenu.open) !== null && _this$_sideMenu$open !== void 0 ? _this$_sideMenu$open : false;
|
|
2680
|
-
this._sideMenu = _objectSpread$
|
|
2888
|
+
this._sideMenu = _objectSpread$a(_objectSpread$a({}, sideMenu), {}, {
|
|
2681
2889
|
onClose: onClose
|
|
2682
2890
|
});
|
|
2683
2891
|
}
|
|
@@ -2688,7 +2896,7 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
2688
2896
|
}, {
|
|
2689
2897
|
key: "closeSideMenu",
|
|
2690
2898
|
value: function closeSideMenu() {
|
|
2691
|
-
if (this._sideMenu) this._sideMenu = _objectSpread$
|
|
2899
|
+
if (this._sideMenu) this._sideMenu = _objectSpread$a(_objectSpread$a({}, this._sideMenu), {}, {
|
|
2692
2900
|
open: false
|
|
2693
2901
|
});
|
|
2694
2902
|
}
|
|
@@ -2729,7 +2937,7 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
2729
2937
|
_barrier$actions,
|
|
2730
2938
|
_this7 = this;
|
|
2731
2939
|
if (barrier.anonOnly && (_this$root$dataStore$4 = this.root.dataStore.user) !== null && _this$root$dataStore$4 !== void 0 && _this$root$dataStore$4.mainEmail) {
|
|
2732
|
-
LOG$
|
|
2940
|
+
LOG$9.debug('Skip barrier because user is logged in');
|
|
2733
2941
|
return;
|
|
2734
2942
|
}
|
|
2735
2943
|
this._modal = {
|
|
@@ -2745,7 +2953,7 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
2745
2953
|
type: barrier.type,
|
|
2746
2954
|
currentEmail: (_this$root$dataStore$5 = this.root.dataStore.user) === null || _this$root$dataStore$5 === void 0 ? void 0 : _this$root$dataStore$5.mainEmail,
|
|
2747
2955
|
actions: (_barrier$actions = barrier.actions) === null || _barrier$actions === void 0 ? void 0 : _barrier$actions.map(function (a) {
|
|
2748
|
-
return _objectSpread$
|
|
2956
|
+
return _objectSpread$a(_objectSpread$a({}, a), {}, {
|
|
2749
2957
|
onClick: function () {
|
|
2750
2958
|
var _onClick = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(email) {
|
|
2751
2959
|
var _this7$root$dataStore;
|
|
@@ -2768,7 +2976,7 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
2768
2976
|
case 8:
|
|
2769
2977
|
_context3.prev = 8;
|
|
2770
2978
|
_context3.t0 = _context3["catch"](3);
|
|
2771
|
-
LOG$
|
|
2979
|
+
LOG$9.error(new DivaError('Error while logging in', {
|
|
2772
2980
|
cause: _context3.t0
|
|
2773
2981
|
}));
|
|
2774
2982
|
case 11:
|
|
@@ -2895,7 +3103,7 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
2895
3103
|
key: "getState",
|
|
2896
3104
|
value: function getState(type) {
|
|
2897
3105
|
var state = this.state.get(type);
|
|
2898
|
-
return state ? _objectSpread$
|
|
3106
|
+
return state ? _objectSpread$a(_objectSpread$a({}, state), {}, {
|
|
2899
3107
|
isVisible: this.isVisible(type)
|
|
2900
3108
|
}) : {
|
|
2901
3109
|
settings: {}
|
|
@@ -2918,36 +3126,36 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
2918
3126
|
*/
|
|
2919
3127
|
}, {
|
|
2920
3128
|
key: "setContainer",
|
|
2921
|
-
value: function
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
_this9.onResize([{
|
|
2936
|
-
contentRect: {
|
|
2937
|
-
height: window.innerHeight,
|
|
2938
|
-
width: window.innerWidth
|
|
3129
|
+
value: (function () {
|
|
3130
|
+
var _setContainer = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee3(ref) {
|
|
3131
|
+
return _regeneratorRuntime.wrap(function _callee3$(_context5) {
|
|
3132
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
3133
|
+
case 0:
|
|
3134
|
+
if (!(ref === this.ref)) {
|
|
3135
|
+
_context5.next = 2;
|
|
3136
|
+
break;
|
|
3137
|
+
}
|
|
3138
|
+
return _context5.abrupt("return");
|
|
3139
|
+
case 2:
|
|
3140
|
+
this.ref = ref;
|
|
3141
|
+
if (this.resizeObserver) {
|
|
3142
|
+
unregisterResizeObserver(this.resizeObserver);
|
|
2939
3143
|
}
|
|
2940
|
-
|
|
3144
|
+
_context5.next = 6;
|
|
3145
|
+
return registerResizeObserver(ref, this.onResize.bind(this));
|
|
3146
|
+
case 6:
|
|
3147
|
+
this.resizeObserver = _context5.sent;
|
|
3148
|
+
case 7:
|
|
3149
|
+
case "end":
|
|
3150
|
+
return _context5.stop();
|
|
2941
3151
|
}
|
|
2942
|
-
});
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
this.resizeObserver.unobserve(this.ref);
|
|
3152
|
+
}, _callee3, this);
|
|
3153
|
+
}));
|
|
3154
|
+
function setContainer(_x2) {
|
|
3155
|
+
return _setContainer.apply(this, arguments);
|
|
2947
3156
|
}
|
|
2948
|
-
|
|
2949
|
-
|
|
2950
|
-
}
|
|
3157
|
+
return setContainer;
|
|
3158
|
+
}())
|
|
2951
3159
|
}, {
|
|
2952
3160
|
key: "isPublic",
|
|
2953
3161
|
value: function isPublic(component) {
|
|
@@ -2973,10 +3181,10 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
2973
3181
|
key: "availableComponents",
|
|
2974
3182
|
get: function get() {
|
|
2975
3183
|
var _this$root,
|
|
2976
|
-
|
|
3184
|
+
_this9 = this;
|
|
2977
3185
|
return (_this$root = this.root) === null || _this$root === void 0 ? void 0 : _this$root.configurationStore.components.filter(function (component) {
|
|
2978
3186
|
//the component must be passed to diva core
|
|
2979
|
-
if (!
|
|
3187
|
+
if (!_this9.configuration.find(function (config) {
|
|
2980
3188
|
return config.name == component.type;
|
|
2981
3189
|
})) {
|
|
2982
3190
|
return false;
|
|
@@ -2987,11 +3195,11 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
2987
3195
|
return true;
|
|
2988
3196
|
}
|
|
2989
3197
|
//if the user is not logged in the component must be public
|
|
2990
|
-
if (!
|
|
3198
|
+
if (!_this9.root.dataStore.user) {
|
|
2991
3199
|
return false;
|
|
2992
3200
|
}
|
|
2993
3201
|
//if there is a permission specified, the user must have it
|
|
2994
|
-
return component.permission ?
|
|
3202
|
+
return component.permission ? _this9.root.dataStore.userHasPermission(component.permission) : true;
|
|
2995
3203
|
});
|
|
2996
3204
|
}
|
|
2997
3205
|
|
|
@@ -3001,14 +3209,14 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
3001
3209
|
}, {
|
|
3002
3210
|
key: "components",
|
|
3003
3211
|
get: function get() {
|
|
3004
|
-
var
|
|
3212
|
+
var _this10 = this;
|
|
3005
3213
|
var componentDefinitionToRender = this.configuration.filter(function (config) {
|
|
3006
3214
|
//there must be a state present in order for the component to be rendered
|
|
3007
|
-
if (!
|
|
3215
|
+
if (!_this10.state.has(config.name)) {
|
|
3008
3216
|
return false;
|
|
3009
3217
|
}
|
|
3010
3218
|
//the component must be contained in the available components list in order to be rendered
|
|
3011
|
-
return
|
|
3219
|
+
return _this10.availableComponents.find(function (component) {
|
|
3012
3220
|
return component.type == config.name;
|
|
3013
3221
|
});
|
|
3014
3222
|
});
|
|
@@ -3016,7 +3224,7 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
3016
3224
|
//when a new component is added we have to make sure that for the currently open components the existing instance is reused
|
|
3017
3225
|
//withTransaction creates a new instance if APM is active, so we would loose the state of currently open components
|
|
3018
3226
|
componentDefinitionToRender.forEach(function (cmp) {
|
|
3019
|
-
var toRender =
|
|
3227
|
+
var toRender = _this10._currentlyRendered.find(function (c) {
|
|
3020
3228
|
return c.name == cmp.name;
|
|
3021
3229
|
});
|
|
3022
3230
|
if (!toRender) {
|
|
@@ -3037,10 +3245,10 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
3037
3245
|
}, {
|
|
3038
3246
|
key: "fullscreenComponent",
|
|
3039
3247
|
get: function get() {
|
|
3040
|
-
var
|
|
3248
|
+
var _this11 = this;
|
|
3041
3249
|
var component = this.availableComponents.find(function (component) {
|
|
3042
|
-
var
|
|
3043
|
-
return component.type == ((
|
|
3250
|
+
var _this11$_fullscreenCo;
|
|
3251
|
+
return component.type == ((_this11$_fullscreenCo = _this11._fullscreenComponent) === null || _this11$_fullscreenCo === void 0 ? void 0 : _this11$_fullscreenCo.key);
|
|
3044
3252
|
});
|
|
3045
3253
|
var cmp = this.configuration.find(function (config) {
|
|
3046
3254
|
return (component === null || component === void 0 ? void 0 : component.type) == config.name;
|
|
@@ -3087,24 +3295,24 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
3087
3295
|
key: "availableButtons",
|
|
3088
3296
|
get: function get() {
|
|
3089
3297
|
var _this$root$configurat,
|
|
3090
|
-
|
|
3298
|
+
_this12 = this;
|
|
3091
3299
|
return (_this$root$configurat = this.root.configurationStore.navigation) === null || _this$root$configurat === void 0 ? void 0 : _this$root$configurat.buttons.filter(function (button) {
|
|
3092
3300
|
//if component is public it can be displayed
|
|
3093
3301
|
if (button.isPublic) {
|
|
3094
3302
|
return true;
|
|
3095
3303
|
}
|
|
3096
3304
|
//if the user is not logged in the component must be public
|
|
3097
|
-
if (!
|
|
3305
|
+
if (!_this12.root.dataStore.user) {
|
|
3098
3306
|
return false;
|
|
3099
3307
|
}
|
|
3100
3308
|
|
|
3101
3309
|
//if the button is opening a component, the component must be availalbe
|
|
3102
|
-
if (button.action.type && !
|
|
3310
|
+
if (button.action.type && !_this12.availableComponentList.includes(button.action.type)) {
|
|
3103
3311
|
return false;
|
|
3104
3312
|
}
|
|
3105
3313
|
|
|
3106
3314
|
//if there is a permission specified, the user must have it
|
|
3107
|
-
return button.permission ?
|
|
3315
|
+
return button.permission ? _this12.root.dataStore.userHasPermission(button.permission) : true;
|
|
3108
3316
|
});
|
|
3109
3317
|
}
|
|
3110
3318
|
|
|
@@ -3132,9 +3340,9 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
3132
3340
|
height: 0
|
|
3133
3341
|
};
|
|
3134
3342
|
if (this.isAbsoluteFullscreenComponent) {
|
|
3135
|
-
dimensions =
|
|
3343
|
+
dimensions = calculateDimensions(window.innerWidth, window.innerHeight);
|
|
3136
3344
|
}
|
|
3137
|
-
LOG$
|
|
3345
|
+
LOG$9.debug("Detected dimensions: ".concat(JSON.stringify(dimensions, null, 2), " "));
|
|
3138
3346
|
return dimensions;
|
|
3139
3347
|
}
|
|
3140
3348
|
|
|
@@ -3145,7 +3353,7 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
3145
3353
|
}, {
|
|
3146
3354
|
key: "resetState",
|
|
3147
3355
|
value: function resetState() {
|
|
3148
|
-
LOG$
|
|
3356
|
+
LOG$9.debug('Reset page state');
|
|
3149
3357
|
var prevType = this.visible;
|
|
3150
3358
|
var prevState = this.state.get(this.visible || '');
|
|
3151
3359
|
this.root.dataStore.clearSessionGuids();
|
|
@@ -3174,23 +3382,12 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
3174
3382
|
*/
|
|
3175
3383
|
}, {
|
|
3176
3384
|
key: "updateCssThemeVariables",
|
|
3177
|
-
value: function updateCssThemeVariables() {
|
|
3385
|
+
value: function updateCssThemeVariables$1() {
|
|
3178
3386
|
if (!this.ref) {
|
|
3179
3387
|
return;
|
|
3180
3388
|
}
|
|
3181
3389
|
var theme = this.root.configurationStore.theme;
|
|
3182
|
-
this.ref
|
|
3183
|
-
this.ref.style.setProperty('--diva-theme-palette-primary-dark', theme.palette.primary.dark);
|
|
3184
|
-
this.ref.style.setProperty('--diva-theme-palette-primary-light', theme.palette.primary.light);
|
|
3185
|
-
this.ref.style.setProperty('--diva-theme-palette-primary-contrast-text', theme.palette.primary.contrastText);
|
|
3186
|
-
this.ref.style.setProperty('--diva-theme-palette-secondary-main', theme.palette.secondary.main);
|
|
3187
|
-
this.ref.style.setProperty('--diva-theme-palette-secondary-dark', theme.palette.secondary.dark);
|
|
3188
|
-
this.ref.style.setProperty('--diva-theme-palette-secondary-light', theme.palette.secondary.light);
|
|
3189
|
-
this.ref.style.setProperty('--diva-theme-palette-secondary-contrast-text', theme.palette.secondary.contrastText);
|
|
3190
|
-
this.ref.style.setProperty('--diva-theme-palette-text-primary', theme.palette.text.primary);
|
|
3191
|
-
this.ref.style.setProperty('--diva-theme-palette-text-secondary', theme.palette.text.secondary);
|
|
3192
|
-
this.ref.style.setProperty('--diva-typography-font-family', theme.typography.fontFamily);
|
|
3193
|
-
this.ref.style.setProperty('font-family', theme.typography.fontFamily);
|
|
3390
|
+
updateCssThemeVariables(this.ref, theme);
|
|
3194
3391
|
}
|
|
3195
3392
|
|
|
3196
3393
|
/**
|
|
@@ -3200,7 +3397,7 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
3200
3397
|
}, {
|
|
3201
3398
|
key: "updateStateAfterLogout",
|
|
3202
3399
|
value: function updateStateAfterLogout() {
|
|
3203
|
-
var
|
|
3400
|
+
var _this13 = this;
|
|
3204
3401
|
var _iterator2 = _createForOfIteratorHelper(this.state.entries()),
|
|
3205
3402
|
_step2;
|
|
3206
3403
|
try {
|
|
@@ -3208,19 +3405,19 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
3208
3405
|
var _step2$value = _slicedToArray(_step2.value, 2),
|
|
3209
3406
|
type = _step2$value[0],
|
|
3210
3407
|
component = _step2$value[1];
|
|
3211
|
-
var config =
|
|
3408
|
+
var config = _this13.root.configurationStore.components.find(function (c) {
|
|
3212
3409
|
return c.type == type;
|
|
3213
3410
|
});
|
|
3214
3411
|
if (!(config !== null && config !== void 0 && config.isPublic)) {
|
|
3215
|
-
|
|
3216
|
-
if (
|
|
3217
|
-
|
|
3218
|
-
|
|
3412
|
+
_this13.state["delete"](type);
|
|
3413
|
+
if (_this13.visible == type) {
|
|
3414
|
+
_this13.visible = undefined;
|
|
3415
|
+
_this13._restrictedComponent = {
|
|
3219
3416
|
type: type,
|
|
3220
3417
|
parameters: component.parameters,
|
|
3221
3418
|
internal: component.internal
|
|
3222
3419
|
};
|
|
3223
|
-
|
|
3420
|
+
_this13.root.authorizationStore.showLogin();
|
|
3224
3421
|
}
|
|
3225
3422
|
}
|
|
3226
3423
|
};
|
|
@@ -3316,38 +3513,11 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
3316
3513
|
*/
|
|
3317
3514
|
}, {
|
|
3318
3515
|
key: "onResize",
|
|
3319
|
-
value: function onResize(
|
|
3320
|
-
if (!(entries !== null && entries !== void 0 && entries.length)) {
|
|
3321
|
-
return;
|
|
3322
|
-
}
|
|
3323
|
-
var rect = entries[0].contentRect;
|
|
3516
|
+
value: function onResize(width, height) {
|
|
3324
3517
|
if (/iPhone|iPad|iPod/i.test(navigator.userAgent)) {
|
|
3325
|
-
this.ref.style.height = "".concat(
|
|
3326
|
-
}
|
|
3327
|
-
this._dimensions = this.calculateDimensions(rect.width, rect.height);
|
|
3328
|
-
}
|
|
3329
|
-
}, {
|
|
3330
|
-
key: "calculateDimensions",
|
|
3331
|
-
value: function calculateDimensions(width, height) {
|
|
3332
|
-
var isPortrait = false;
|
|
3333
|
-
var isMobile = false;
|
|
3334
|
-
var isTablet = false;
|
|
3335
|
-
if (width < height) {
|
|
3336
|
-
isPortrait = true;
|
|
3337
|
-
}
|
|
3338
|
-
if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) || width < 900) {
|
|
3339
|
-
isMobile = true;
|
|
3340
|
-
}
|
|
3341
|
-
if (/(tablet|ipad|playbook|silk)|(android(?!.*mobi))/i.test(navigator.userAgent) || navigator.userAgent.match(/Mac/) && navigator.maxTouchPoints && navigator.maxTouchPoints > 2) {
|
|
3342
|
-
isTablet = true;
|
|
3518
|
+
this.ref.style.height = "".concat(width, " px");
|
|
3343
3519
|
}
|
|
3344
|
-
|
|
3345
|
-
isPortrait: isPortrait,
|
|
3346
|
-
isMobile: isMobile,
|
|
3347
|
-
isTablet: isTablet,
|
|
3348
|
-
width: Math.round(width),
|
|
3349
|
-
height: Math.round(height)
|
|
3350
|
-
};
|
|
3520
|
+
this._dimensions = calculateDimensions(width, height);
|
|
3351
3521
|
}
|
|
3352
3522
|
}, {
|
|
3353
3523
|
key: "setGlobalClass",
|
|
@@ -3374,8 +3544,8 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
3374
3544
|
}]);
|
|
3375
3545
|
}();
|
|
3376
3546
|
|
|
3377
|
-
var LOG$
|
|
3378
|
-
var _default
|
|
3547
|
+
var LOG$8 = getLogger('Framework', 'LoadingAndErrorStore');
|
|
3548
|
+
var _default = /*#__PURE__*/function () {
|
|
3379
3549
|
function _default(root, spinnerClass) {
|
|
3380
3550
|
var _this = this;
|
|
3381
3551
|
_classCallCheck(this, _default);
|
|
@@ -3480,21 +3650,21 @@ var _default$1 = /*#__PURE__*/function () {
|
|
|
3480
3650
|
this._errorMsg = undefined;
|
|
3481
3651
|
} else if (typeof error == 'string') {
|
|
3482
3652
|
this._errorMsg = error;
|
|
3483
|
-
LOG$
|
|
3653
|
+
LOG$8.error(new DivaError(error));
|
|
3484
3654
|
} else if (error.name == 'CORE_0005') {
|
|
3485
|
-
LOG$
|
|
3655
|
+
LOG$8.error(error);
|
|
3486
3656
|
this._errorMsg = this.root.t('core.error.page_not_found', {
|
|
3487
3657
|
defaultValue: 'Die Seite existiert nicht oder Sie haben nicht die benötigten Berechtigungen. Bei Fragen wenden Sie sich bitte an den Support.'
|
|
3488
3658
|
});
|
|
3489
3659
|
var conf = this.root.configurationStore.components;
|
|
3490
3660
|
console.log(conf);
|
|
3491
3661
|
} else if (error.name == 'CORE_0002') {
|
|
3492
|
-
LOG$
|
|
3662
|
+
LOG$8.error(error);
|
|
3493
3663
|
this._errorMsg = this.root.t('core.error.resource_not_found', {
|
|
3494
3664
|
defaultValue: 'Eine oder mehrere der benötigten Resource existiert nicht oder konnte nicht gefunden werden. Bei Fragen wenden Sie sich bitte an den Support.'
|
|
3495
3665
|
});
|
|
3496
3666
|
} else {
|
|
3497
|
-
LOG$
|
|
3667
|
+
LOG$8.error(error);
|
|
3498
3668
|
this._errorMsg = error.message;
|
|
3499
3669
|
}
|
|
3500
3670
|
if (this._errorMsg) {
|
|
@@ -3556,16 +3726,16 @@ var _default$1 = /*#__PURE__*/function () {
|
|
|
3556
3726
|
value: function toggleLoading(id, hidden, toggle) {
|
|
3557
3727
|
if (this.loading.has(id) && toggle !== true) {
|
|
3558
3728
|
this.loading["delete"](id);
|
|
3559
|
-
LOG$
|
|
3729
|
+
LOG$8.debug("End loading: ".concat(id, " [").concat(Array.from(this.loading.keys()), "]"));
|
|
3560
3730
|
} else if (!this.loading.has(id) && toggle !== false) {
|
|
3561
|
-
LOG$
|
|
3731
|
+
LOG$8.debug("Start loading: ".concat(id));
|
|
3562
3732
|
this.loading.set(id, hidden == undefined ? false : hidden);
|
|
3563
3733
|
}
|
|
3564
3734
|
}
|
|
3565
3735
|
}]);
|
|
3566
3736
|
}();
|
|
3567
3737
|
|
|
3568
|
-
var LOG$
|
|
3738
|
+
var LOG$7 = getLogger('Framework', 'BrowserStateStore');
|
|
3569
3739
|
var BANNER_STATE_LOCALSTORAGE_KEY = 'diva-banner-state';
|
|
3570
3740
|
var NTOKEN_LOCALSTORAGE_KEY = 'diva-ntoken';
|
|
3571
3741
|
var LANGUAGE_LOCALSTORAGE_KEY = 'diva-language';
|
|
@@ -3891,7 +4061,7 @@ var BrowserStateStore = /*#__PURE__*/function () {
|
|
|
3891
4061
|
var _componentState$path;
|
|
3892
4062
|
var componentConfig = _this2.root.contentStore.currentComponent;
|
|
3893
4063
|
if (!componentConfig) {
|
|
3894
|
-
LOG$
|
|
4064
|
+
LOG$7.debug('No current component found, while updating url, do nothing');
|
|
3895
4065
|
return;
|
|
3896
4066
|
}
|
|
3897
4067
|
var componentState = _this2.root.contentStore.getState(componentConfig === null || componentConfig === void 0 ? void 0 : componentConfig.type);
|
|
@@ -3963,9 +4133,9 @@ var BrowserStateStore = /*#__PURE__*/function () {
|
|
|
3963
4133
|
}]);
|
|
3964
4134
|
}();
|
|
3965
4135
|
|
|
3966
|
-
function ownKeys$
|
|
3967
|
-
function _objectSpread$
|
|
3968
|
-
var LOG$
|
|
4136
|
+
function ownKeys$9(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; }
|
|
4137
|
+
function _objectSpread$9(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$9(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$9(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4138
|
+
var LOG$6 = getLogger('Framework', 'AuthorizationStore');
|
|
3969
4139
|
var AuthorizationStore = /*#__PURE__*/function () {
|
|
3970
4140
|
function AuthorizationStore(root) {
|
|
3971
4141
|
_classCallCheck(this, AuthorizationStore);
|
|
@@ -4022,7 +4192,7 @@ var AuthorizationStore = /*#__PURE__*/function () {
|
|
|
4022
4192
|
if (debug) {
|
|
4023
4193
|
this._state = {
|
|
4024
4194
|
type: 'LOGIN',
|
|
4025
|
-
loginMethods: _objectSpread$
|
|
4195
|
+
loginMethods: _objectSpread$9(_objectSpread$9({}, loginMethods), {}, {
|
|
4026
4196
|
standard: true
|
|
4027
4197
|
}),
|
|
4028
4198
|
organizationId: organizationId
|
|
@@ -4155,14 +4325,14 @@ var AuthorizationStore = /*#__PURE__*/function () {
|
|
|
4155
4325
|
_context2.next = 6;
|
|
4156
4326
|
break;
|
|
4157
4327
|
}
|
|
4158
|
-
LOG$
|
|
4328
|
+
LOG$6.debug('NToken removed');
|
|
4159
4329
|
_context2.next = 4;
|
|
4160
4330
|
return this.root.authorizationStore.logout();
|
|
4161
4331
|
case 4:
|
|
4162
4332
|
_context2.next = 15;
|
|
4163
4333
|
break;
|
|
4164
4334
|
case 6:
|
|
4165
|
-
LOG$
|
|
4335
|
+
LOG$6.debug('NToken change detected, login');
|
|
4166
4336
|
_context2.next = 9;
|
|
4167
4337
|
return this.root.authorizationStore.autorize(this.root.dataStore.organizationId, this.root.browserStateStore.getStoredNToken());
|
|
4168
4338
|
case 9:
|
|
@@ -4210,7 +4380,7 @@ var AuthorizationStore = /*#__PURE__*/function () {
|
|
|
4210
4380
|
_context3.next = 20;
|
|
4211
4381
|
break;
|
|
4212
4382
|
}
|
|
4213
|
-
LOG$
|
|
4383
|
+
LOG$6.log('The stored organization is no longer valid, fallback to default organization');
|
|
4214
4384
|
//for anonymous users, we fallback to the 'default' organization for ohter users we let the backend determine the right organization
|
|
4215
4385
|
_context3.next = 17;
|
|
4216
4386
|
return this.autorize(nToken ? undefined : this.root.configurationStore.organizations[0], nToken);
|
|
@@ -4221,7 +4391,7 @@ var AuthorizationStore = /*#__PURE__*/function () {
|
|
|
4221
4391
|
_context3.next = 25;
|
|
4222
4392
|
break;
|
|
4223
4393
|
}
|
|
4224
|
-
LOG$
|
|
4394
|
+
LOG$6.log('Authentication expired or invalid, logging out.');
|
|
4225
4395
|
_context3.next = 24;
|
|
4226
4396
|
return this.logout(true, true, organizationId);
|
|
4227
4397
|
case 24:
|
|
@@ -4319,7 +4489,7 @@ var AuthorizationStore = /*#__PURE__*/function () {
|
|
|
4319
4489
|
_context5.next = 19;
|
|
4320
4490
|
break;
|
|
4321
4491
|
}
|
|
4322
|
-
LOG$
|
|
4492
|
+
LOG$6.log('The stored organization is no longer valid, fallback to default organization');
|
|
4323
4493
|
_context5.next = 18;
|
|
4324
4494
|
return this.login(email, password, loginSimple, undefined);
|
|
4325
4495
|
case 18:
|
|
@@ -4371,7 +4541,7 @@ var AuthorizationStore = /*#__PURE__*/function () {
|
|
|
4371
4541
|
this._timeout = undefined;
|
|
4372
4542
|
}
|
|
4373
4543
|
refreshTokenIn = zExpireBy - 1000 * 60 * 5 - Date.now(); //refresh 5 minutes before expire
|
|
4374
|
-
LOG$
|
|
4544
|
+
LOG$6.debug("Set token refresh interval to ".concat(refreshTokenIn, " ms. Refresh at ").concat(new Date(Date.now() + refreshTokenIn)));
|
|
4375
4545
|
|
|
4376
4546
|
//set the timout to refresh token
|
|
4377
4547
|
this._timeout = setTimeout(function () {
|
|
@@ -4449,7 +4619,7 @@ var AuthorizationStore = /*#__PURE__*/function () {
|
|
|
4449
4619
|
}]);
|
|
4450
4620
|
}();
|
|
4451
4621
|
|
|
4452
|
-
var _excluded$
|
|
4622
|
+
var _excluded$2 = ["kind", "type"],
|
|
4453
4623
|
_excluded2 = ["type"];
|
|
4454
4624
|
var ApiHandler = /*#__PURE__*/function () {
|
|
4455
4625
|
function ApiHandler(root) {
|
|
@@ -4459,32 +4629,32 @@ var ApiHandler = /*#__PURE__*/function () {
|
|
|
4459
4629
|
return _createClass(ApiHandler, [{
|
|
4460
4630
|
key: "adminService",
|
|
4461
4631
|
get: function get() {
|
|
4462
|
-
return this.root.
|
|
4632
|
+
return this.root.apiConfig.adminService;
|
|
4463
4633
|
}
|
|
4464
4634
|
}, {
|
|
4465
4635
|
key: "messageService",
|
|
4466
4636
|
get: function get() {
|
|
4467
|
-
return this.root.
|
|
4637
|
+
return this.root.apiConfig.messageService;
|
|
4468
4638
|
}
|
|
4469
4639
|
}, {
|
|
4470
4640
|
key: "authService",
|
|
4471
4641
|
get: function get() {
|
|
4472
|
-
return this.root.
|
|
4642
|
+
return this.root.apiConfig.authService;
|
|
4473
4643
|
}
|
|
4474
4644
|
}, {
|
|
4475
4645
|
key: "catalogService",
|
|
4476
4646
|
get: function get() {
|
|
4477
|
-
return this.root.
|
|
4647
|
+
return this.root.apiConfig.catalogService;
|
|
4478
4648
|
}
|
|
4479
4649
|
}, {
|
|
4480
|
-
key: "
|
|
4650
|
+
key: "jwt",
|
|
4481
4651
|
get: function get() {
|
|
4482
|
-
return this.root.
|
|
4652
|
+
return this.root.jwt;
|
|
4483
4653
|
}
|
|
4484
4654
|
}, {
|
|
4485
|
-
key: "
|
|
4655
|
+
key: "organizationId",
|
|
4486
4656
|
get: function get() {
|
|
4487
|
-
return this.root.
|
|
4657
|
+
return this.root.organization._id;
|
|
4488
4658
|
}
|
|
4489
4659
|
}, {
|
|
4490
4660
|
key: "fetchConfiguration",
|
|
@@ -4582,7 +4752,7 @@ var ApiHandler = /*#__PURE__*/function () {
|
|
|
4582
4752
|
content = _ref2.content, organizationIds = _ref2.organizationIds;
|
|
4583
4753
|
url = "".concat(this.messageService, "/mail/");
|
|
4584
4754
|
if (content.type == 'other') {
|
|
4585
|
-
kind = content.kind, content.type, rest = _objectWithoutProperties(content, _excluded$
|
|
4755
|
+
kind = content.kind, content.type, rest = _objectWithoutProperties(content, _excluded$2);
|
|
4586
4756
|
url += kind;
|
|
4587
4757
|
body = rest;
|
|
4588
4758
|
} else {
|
|
@@ -4971,7 +5141,7 @@ var ApiHandler = /*#__PURE__*/function () {
|
|
|
4971
5141
|
key: "fetchProduct",
|
|
4972
5142
|
value: function () {
|
|
4973
5143
|
var _fetchProduct = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee8(_ref5) {
|
|
4974
|
-
var divaNr, variantId, variantStart, filter, response, result;
|
|
5144
|
+
var divaNr, _this$root$organizati, variantId, variantStart, filter, response, result;
|
|
4975
5145
|
return _regeneratorRuntime.wrap(function _callee8$(_context8) {
|
|
4976
5146
|
while (1) switch (_context8.prev = _context8.next) {
|
|
4977
5147
|
case 0:
|
|
@@ -4983,13 +5153,13 @@ var ApiHandler = /*#__PURE__*/function () {
|
|
|
4983
5153
|
variantId = divaNr.substring(variantStart + 1);
|
|
4984
5154
|
divaNr = divaNr.substring(0, variantStart);
|
|
4985
5155
|
}
|
|
4986
|
-
filter =
|
|
5156
|
+
filter = "{availableForOrganizations,eq,".concat((_this$root$organizati = this.root.organization) === null || _this$root$organizati === void 0 ? void 0 : _this$root$organizati._id, "},{divaNr,eq,") + divaNr.substring(1) + '}';
|
|
4987
5157
|
if (variantId) {
|
|
4988
5158
|
filter += ',{variantId,eq,' + variantId + '}';
|
|
4989
5159
|
}
|
|
4990
5160
|
_context8.next = 9;
|
|
4991
5161
|
return this.fetch({
|
|
4992
|
-
url: this.catalogService + '/v1/products' + '?organizationIds=' + this.
|
|
5162
|
+
url: this.catalogService + '/v1/products' + '?organizationIds=' + this.organizationId + '&limit=1' + '&sort=' + encodeURIComponent('{-created}') + '&fields=' + encodeURIComponent('{_id,organizationId,modelName}') + '&search=' + encodeURIComponent('[' + filter + ']')
|
|
4993
5163
|
});
|
|
4994
5164
|
case 9:
|
|
4995
5165
|
response = _context8.sent;
|
|
@@ -5574,22 +5744,22 @@ var OrganizationHandler = /*#__PURE__*/function () {
|
|
|
5574
5744
|
}, {
|
|
5575
5745
|
key: "organization",
|
|
5576
5746
|
get: function get() {
|
|
5577
|
-
return this.root.
|
|
5747
|
+
return this.root.organization;
|
|
5578
5748
|
}
|
|
5579
5749
|
}, {
|
|
5580
5750
|
key: "user",
|
|
5581
5751
|
get: function get() {
|
|
5582
|
-
return this.root.
|
|
5752
|
+
return this.root.user;
|
|
5583
5753
|
}
|
|
5584
5754
|
}, {
|
|
5585
5755
|
key: "allowedOrganizationTypes",
|
|
5586
5756
|
get: function get() {
|
|
5587
|
-
return this.root.
|
|
5757
|
+
return this.root.allowedOrganizationTypes;
|
|
5588
5758
|
}
|
|
5589
5759
|
}, {
|
|
5590
5760
|
key: "validOrganizations",
|
|
5591
5761
|
get: function get() {
|
|
5592
|
-
return this.root.
|
|
5762
|
+
return this.root.validOrganizations;
|
|
5593
5763
|
}
|
|
5594
5764
|
}, {
|
|
5595
5765
|
key: "getOrganizationHirachy",
|
|
@@ -5804,12 +5974,12 @@ var MediaHandler = /*#__PURE__*/function () {
|
|
|
5804
5974
|
return _createClass(MediaHandler, [{
|
|
5805
5975
|
key: "mediaService",
|
|
5806
5976
|
get: function get() {
|
|
5807
|
-
return this.root.
|
|
5977
|
+
return this.root.apiConfig.mediaService;
|
|
5808
5978
|
}
|
|
5809
5979
|
}, {
|
|
5810
5980
|
key: "jwt",
|
|
5811
5981
|
get: function get() {
|
|
5812
|
-
return this.root.
|
|
5982
|
+
return this.root.jwt;
|
|
5813
5983
|
}
|
|
5814
5984
|
}, {
|
|
5815
5985
|
key: "getMediaByIds",
|
|
@@ -6249,47 +6419,49 @@ var MediaHandler = /*#__PURE__*/function () {
|
|
|
6249
6419
|
}, {
|
|
6250
6420
|
key: "getRenderPackages",
|
|
6251
6421
|
value: function () {
|
|
6252
|
-
var _getRenderPackages = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9() {
|
|
6422
|
+
var _getRenderPackages = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee9(organizationId) {
|
|
6253
6423
|
var fullUrl, res, resData;
|
|
6254
6424
|
return _regeneratorRuntime.wrap(function _callee9$(_context9) {
|
|
6255
6425
|
while (1) switch (_context9.prev = _context9.next) {
|
|
6256
6426
|
case 0:
|
|
6257
|
-
fullUrl = this.mediaService + '/renderpackages';
|
|
6258
|
-
|
|
6259
|
-
|
|
6427
|
+
fullUrl = new URL(this.mediaService + '/renderpackages');
|
|
6428
|
+
if (organizationId) fullUrl.searchParams.append('organizationId', organizationId);
|
|
6429
|
+
fullUrl.searchParams.append('sort', encodeURIComponent('{position}'));
|
|
6430
|
+
_context9.prev = 3;
|
|
6431
|
+
_context9.next = 6;
|
|
6260
6432
|
return fetch(fullUrl, {
|
|
6261
6433
|
headers: {
|
|
6262
6434
|
Authorization: 'Bearer ' + this.jwt,
|
|
6263
6435
|
'Content-Type': 'application/json'
|
|
6264
6436
|
}
|
|
6265
6437
|
});
|
|
6266
|
-
case
|
|
6438
|
+
case 6:
|
|
6267
6439
|
res = _context9.sent;
|
|
6268
|
-
_context9.next =
|
|
6440
|
+
_context9.next = 9;
|
|
6269
6441
|
return res.json();
|
|
6270
|
-
case
|
|
6442
|
+
case 9:
|
|
6271
6443
|
resData = _context9.sent;
|
|
6272
|
-
_context9.next =
|
|
6444
|
+
_context9.next = 15;
|
|
6273
6445
|
break;
|
|
6274
|
-
case
|
|
6275
|
-
_context9.prev =
|
|
6276
|
-
_context9.t0 = _context9["catch"](
|
|
6446
|
+
case 12:
|
|
6447
|
+
_context9.prev = 12;
|
|
6448
|
+
_context9.t0 = _context9["catch"](3);
|
|
6277
6449
|
throw new Error('Could not get render packages');
|
|
6278
|
-
case
|
|
6450
|
+
case 15:
|
|
6279
6451
|
if (!res.ok) {
|
|
6280
|
-
_context9.next =
|
|
6452
|
+
_context9.next = 17;
|
|
6281
6453
|
break;
|
|
6282
6454
|
}
|
|
6283
6455
|
return _context9.abrupt("return", resData);
|
|
6284
|
-
case
|
|
6456
|
+
case 17:
|
|
6285
6457
|
throw new Error(resData.error);
|
|
6286
|
-
case
|
|
6458
|
+
case 18:
|
|
6287
6459
|
case "end":
|
|
6288
6460
|
return _context9.stop();
|
|
6289
6461
|
}
|
|
6290
|
-
}, _callee9, this, [[
|
|
6462
|
+
}, _callee9, this, [[3, 12]]);
|
|
6291
6463
|
}));
|
|
6292
|
-
function getRenderPackages() {
|
|
6464
|
+
function getRenderPackages(_x19) {
|
|
6293
6465
|
return _getRenderPackages.apply(this, arguments);
|
|
6294
6466
|
}
|
|
6295
6467
|
return getRenderPackages;
|
|
@@ -6305,12 +6477,12 @@ var AdminHandler = /*#__PURE__*/function () {
|
|
|
6305
6477
|
return _createClass(AdminHandler, [{
|
|
6306
6478
|
key: "adminService",
|
|
6307
6479
|
get: function get() {
|
|
6308
|
-
return this.root.
|
|
6480
|
+
return this.root.apiConfig.adminService;
|
|
6309
6481
|
}
|
|
6310
6482
|
}, {
|
|
6311
6483
|
key: "jwt",
|
|
6312
6484
|
get: function get() {
|
|
6313
|
-
return this.root.
|
|
6485
|
+
return this.root.jwt;
|
|
6314
6486
|
}
|
|
6315
6487
|
}, {
|
|
6316
6488
|
key: "getViewConfigsLoad",
|
|
@@ -6364,7 +6536,7 @@ var AdminHandler = /*#__PURE__*/function () {
|
|
|
6364
6536
|
}]);
|
|
6365
6537
|
}();
|
|
6366
6538
|
|
|
6367
|
-
var _excluded$
|
|
6539
|
+
var _excluded$1 = ["path"];
|
|
6368
6540
|
var ONE_DAY_UNIX = 86400000;
|
|
6369
6541
|
var AnalyticsHandler = /*#__PURE__*/function () {
|
|
6370
6542
|
function AnalyticsHandler(root) {
|
|
@@ -6374,12 +6546,12 @@ var AnalyticsHandler = /*#__PURE__*/function () {
|
|
|
6374
6546
|
return _createClass(AnalyticsHandler, [{
|
|
6375
6547
|
key: "analyticsService",
|
|
6376
6548
|
get: function get() {
|
|
6377
|
-
return this.root.
|
|
6549
|
+
return this.root.apiConfig.analyticsService;
|
|
6378
6550
|
}
|
|
6379
6551
|
}, {
|
|
6380
6552
|
key: "jwt",
|
|
6381
6553
|
get: function get() {
|
|
6382
|
-
return this.root.
|
|
6554
|
+
return this.root.jwt;
|
|
6383
6555
|
}
|
|
6384
6556
|
}, {
|
|
6385
6557
|
key: "getAnalyticsData",
|
|
@@ -6389,7 +6561,7 @@ var AnalyticsHandler = /*#__PURE__*/function () {
|
|
|
6389
6561
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
6390
6562
|
while (1) switch (_context.prev = _context.next) {
|
|
6391
6563
|
case 0:
|
|
6392
|
-
path = _ref.path, props = _objectWithoutProperties(_ref, _excluded$
|
|
6564
|
+
path = _ref.path, props = _objectWithoutProperties(_ref, _excluded$1);
|
|
6393
6565
|
url = new URL(this.analyticsService + path);
|
|
6394
6566
|
this.addBaseParamsToUrl(url, props);
|
|
6395
6567
|
_context.prev = 3;
|
|
@@ -6569,12 +6741,17 @@ var ReportHandler = /*#__PURE__*/function () {
|
|
|
6569
6741
|
return _createClass(ReportHandler, [{
|
|
6570
6742
|
key: "reportService",
|
|
6571
6743
|
get: function get() {
|
|
6572
|
-
return this.root.
|
|
6744
|
+
return this.root.apiConfig.reportService;
|
|
6745
|
+
}
|
|
6746
|
+
}, {
|
|
6747
|
+
key: "basketService",
|
|
6748
|
+
get: function get() {
|
|
6749
|
+
return this.root.apiConfig.basketService;
|
|
6573
6750
|
}
|
|
6574
6751
|
}, {
|
|
6575
6752
|
key: "jwt",
|
|
6576
6753
|
get: function get() {
|
|
6577
|
-
return this.root.
|
|
6754
|
+
return this.root.jwt;
|
|
6578
6755
|
}
|
|
6579
6756
|
}, {
|
|
6580
6757
|
key: "createReport",
|
|
@@ -6623,7 +6800,7 @@ var ReportHandler = /*#__PURE__*/function () {
|
|
|
6623
6800
|
op: 'replace'
|
|
6624
6801
|
}];
|
|
6625
6802
|
}
|
|
6626
|
-
fetch("".concat(this.
|
|
6803
|
+
fetch("".concat(this.basketService, "/baskets/").concat(basketId), {
|
|
6627
6804
|
method: 'PATCH',
|
|
6628
6805
|
body: JSON.stringify({
|
|
6629
6806
|
patch: patch
|
|
@@ -6712,8 +6889,8 @@ var RequestStatus = /*#__PURE__*/function (RequestStatus) {
|
|
|
6712
6889
|
return RequestStatus;
|
|
6713
6890
|
}({});
|
|
6714
6891
|
|
|
6715
|
-
function ownKeys$
|
|
6716
|
-
function _objectSpread$
|
|
6892
|
+
function ownKeys$8(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; }
|
|
6893
|
+
function _objectSpread$8(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$8(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$8(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6717
6894
|
var SupportHandler = /*#__PURE__*/function () {
|
|
6718
6895
|
function SupportHandler(root) {
|
|
6719
6896
|
_classCallCheck(this, SupportHandler);
|
|
@@ -6722,12 +6899,12 @@ var SupportHandler = /*#__PURE__*/function () {
|
|
|
6722
6899
|
return _createClass(SupportHandler, [{
|
|
6723
6900
|
key: "supportService",
|
|
6724
6901
|
get: function get() {
|
|
6725
|
-
return this.root.
|
|
6902
|
+
return this.root.apiConfig.supportService;
|
|
6726
6903
|
}
|
|
6727
6904
|
}, {
|
|
6728
6905
|
key: "jwt",
|
|
6729
6906
|
get: function get() {
|
|
6730
|
-
return this.root.
|
|
6907
|
+
return this.root.jwt;
|
|
6731
6908
|
}
|
|
6732
6909
|
}, {
|
|
6733
6910
|
key: "getCometChatApiToken",
|
|
@@ -6796,7 +6973,7 @@ var SupportHandler = /*#__PURE__*/function () {
|
|
|
6796
6973
|
Authorization: 'Bearer ' + this.jwt,
|
|
6797
6974
|
'Content-Type': 'application/json'
|
|
6798
6975
|
},
|
|
6799
|
-
body: JSON.stringify(_objectSpread$
|
|
6976
|
+
body: JSON.stringify(_objectSpread$8({
|
|
6800
6977
|
divaNr: divaNr
|
|
6801
6978
|
}, participantEmail && {
|
|
6802
6979
|
participantEmail: participantEmail
|
|
@@ -7238,23 +7415,27 @@ var SupportHandler = /*#__PURE__*/function () {
|
|
|
7238
7415
|
}]);
|
|
7239
7416
|
}();
|
|
7240
7417
|
|
|
7241
|
-
var LOG$
|
|
7418
|
+
var LOG$5 = getLogger('Framework', 'AuthorizationHandler');
|
|
7242
7419
|
var AuthorizationHandler = /*#__PURE__*/function () {
|
|
7243
7420
|
function AuthorizationHandler(root) {
|
|
7244
7421
|
_classCallCheck(this, AuthorizationHandler);
|
|
7245
|
-
|
|
7246
|
-
this._root = root;
|
|
7422
|
+
this.root = root;
|
|
7247
7423
|
}
|
|
7248
7424
|
return _createClass(AuthorizationHandler, [{
|
|
7249
7425
|
key: "jwt",
|
|
7250
7426
|
get: function get() {
|
|
7251
|
-
return this.
|
|
7427
|
+
return this.root.jwt;
|
|
7252
7428
|
}
|
|
7253
7429
|
}, {
|
|
7254
7430
|
key: "userID",
|
|
7255
7431
|
get: function get() {
|
|
7256
|
-
var _this$
|
|
7257
|
-
return (_this$
|
|
7432
|
+
var _this$root$user;
|
|
7433
|
+
return (_this$root$user = this.root.user) === null || _this$root$user === void 0 ? void 0 : _this$root$user._id;
|
|
7434
|
+
}
|
|
7435
|
+
}, {
|
|
7436
|
+
key: "authService",
|
|
7437
|
+
get: function get() {
|
|
7438
|
+
return this.root.apiConfig.authService;
|
|
7258
7439
|
}
|
|
7259
7440
|
}, {
|
|
7260
7441
|
key: "setOnlineState",
|
|
@@ -7268,7 +7449,7 @@ var AuthorizationHandler = /*#__PURE__*/function () {
|
|
|
7268
7449
|
_context.next = 12;
|
|
7269
7450
|
break;
|
|
7270
7451
|
}
|
|
7271
|
-
url = this.
|
|
7452
|
+
url = this.authService + '/users/online/' + this.userID;
|
|
7272
7453
|
requestBody = {
|
|
7273
7454
|
interval: interval
|
|
7274
7455
|
};
|
|
@@ -7285,7 +7466,7 @@ var AuthorizationHandler = /*#__PURE__*/function () {
|
|
|
7285
7466
|
if (res.status !== 200) {
|
|
7286
7467
|
throw new Error('Error updating online state');
|
|
7287
7468
|
}
|
|
7288
|
-
LOG$
|
|
7469
|
+
LOG$5.debug('Updating online state.');
|
|
7289
7470
|
});
|
|
7290
7471
|
case 6:
|
|
7291
7472
|
_context.sent;
|
|
@@ -7294,7 +7475,7 @@ var AuthorizationHandler = /*#__PURE__*/function () {
|
|
|
7294
7475
|
case 9:
|
|
7295
7476
|
_context.prev = 9;
|
|
7296
7477
|
_context.t0 = _context["catch"](3);
|
|
7297
|
-
LOG$
|
|
7478
|
+
LOG$5.error(new DivaError('Error updating online state', {
|
|
7298
7479
|
cause: _context.t0
|
|
7299
7480
|
}));
|
|
7300
7481
|
case 12:
|
|
@@ -7318,7 +7499,7 @@ var AuthorizationHandler = /*#__PURE__*/function () {
|
|
|
7318
7499
|
case 0:
|
|
7319
7500
|
_context2.prev = 0;
|
|
7320
7501
|
userIdString = userIds.join(',');
|
|
7321
|
-
url = "".concat(this.
|
|
7502
|
+
url = "".concat(this.authService, "/users/online/").concat(userIdString);
|
|
7322
7503
|
_context2.next = 5;
|
|
7323
7504
|
return fetch(url, {
|
|
7324
7505
|
method: 'GET',
|
|
@@ -7368,7 +7549,7 @@ var AuthorizationHandler = /*#__PURE__*/function () {
|
|
|
7368
7549
|
while (1) switch (_context3.prev = _context3.next) {
|
|
7369
7550
|
case 0:
|
|
7370
7551
|
organizationId = _ref.organizationId, nToken = _ref.nToken, validParents = _ref.validParents, validOrganizationTypes = _ref.validOrganizationTypes, force = _ref.force;
|
|
7371
|
-
url = new URL("".concat(this.
|
|
7552
|
+
url = new URL("".concat(this.authService, "/v2/authorization/users"));
|
|
7372
7553
|
if (organizationId) {
|
|
7373
7554
|
url.searchParams.append('organizationId', organizationId);
|
|
7374
7555
|
}
|
|
@@ -7459,7 +7640,7 @@ var AuthorizationHandler = /*#__PURE__*/function () {
|
|
|
7459
7640
|
while (1) switch (_context4.prev = _context4.next) {
|
|
7460
7641
|
case 0:
|
|
7461
7642
|
email = _ref2.email, password = _ref2.password, name = _ref2.name, familyName = _ref2.familyName, invitationId = _ref2.invitationId, validParents = _ref2.validParents, validOrganizationTypes = _ref2.validOrganizationTypes, otp = _ref2.otp;
|
|
7462
|
-
url = "".concat(this.
|
|
7643
|
+
url = "".concat(this.authService, "/v2/authorization/users/register?invitationId=").concat(encodeURIComponent(invitationId));
|
|
7463
7644
|
_context4.next = 4;
|
|
7464
7645
|
return this.fetch({
|
|
7465
7646
|
url: url,
|
|
@@ -7538,7 +7719,7 @@ var AuthorizationHandler = /*#__PURE__*/function () {
|
|
|
7538
7719
|
while (1) switch (_context5.prev = _context5.next) {
|
|
7539
7720
|
case 0:
|
|
7540
7721
|
organizationId = _ref3.organizationId, email = _ref3.email, password = _ref3.password, simple = _ref3.simple, validParents = _ref3.validParents, validOrganizationTypes = _ref3.validOrganizationTypes, invitationId = _ref3.invitationId, otp = _ref3.otp;
|
|
7541
|
-
url = "".concat(this.
|
|
7722
|
+
url = "".concat(this.authService, "/v2/authorization/users/login");
|
|
7542
7723
|
queryParams = [];
|
|
7543
7724
|
if (organizationId && !otp) {
|
|
7544
7725
|
queryParams.push("organizationId=".concat(organizationId));
|
|
@@ -7646,9 +7827,9 @@ var AuthorizationHandler = /*#__PURE__*/function () {
|
|
|
7646
7827
|
_context6.prev = 1;
|
|
7647
7828
|
_context6.next = 4;
|
|
7648
7829
|
return this.fetch({
|
|
7649
|
-
url: "".concat(this.
|
|
7830
|
+
url: "".concat(this.authService, "/v2/authorization/users/logout?callbackUri=").concat(encodeURIComponent(callbackUri)),
|
|
7650
7831
|
method: 'POST',
|
|
7651
|
-
jwt: this.
|
|
7832
|
+
jwt: this.root.storedNToken
|
|
7652
7833
|
});
|
|
7653
7834
|
case 4:
|
|
7654
7835
|
response = _context6.sent;
|
|
@@ -7700,7 +7881,7 @@ var AuthorizationHandler = /*#__PURE__*/function () {
|
|
|
7700
7881
|
_context7.prev = 1;
|
|
7701
7882
|
_context7.next = 4;
|
|
7702
7883
|
return this.fetch({
|
|
7703
|
-
url: "".concat(this.
|
|
7884
|
+
url: "".concat(this.authService, "/v2/provider?email=").concat(encodeURIComponent(email)),
|
|
7704
7885
|
method: 'GET',
|
|
7705
7886
|
jwt: this.jwt
|
|
7706
7887
|
});
|
|
@@ -7793,7 +7974,7 @@ var AuthorizationHandler = /*#__PURE__*/function () {
|
|
|
7793
7974
|
while (1) switch (_context9.prev = _context9.next) {
|
|
7794
7975
|
case 0:
|
|
7795
7976
|
_context9.prev = 0;
|
|
7796
|
-
url = "".concat(this.
|
|
7977
|
+
url = "".concat(this.authService, "/invitations/").concat(value, "/").concat(what);
|
|
7797
7978
|
_context9.next = 4;
|
|
7798
7979
|
return fetch(url, {
|
|
7799
7980
|
method: 'GET',
|
|
@@ -7850,12 +8031,12 @@ var ClientArticleHandler = /*#__PURE__*/function () {
|
|
|
7850
8031
|
return _createClass(ClientArticleHandler, [{
|
|
7851
8032
|
key: "clientArticleService",
|
|
7852
8033
|
get: function get() {
|
|
7853
|
-
return this.root.
|
|
8034
|
+
return this.root.apiConfig.clientArticleService;
|
|
7854
8035
|
}
|
|
7855
8036
|
}, {
|
|
7856
8037
|
key: "jwt",
|
|
7857
8038
|
get: function get() {
|
|
7858
|
-
return this.root.
|
|
8039
|
+
return this.root.jwt;
|
|
7859
8040
|
}
|
|
7860
8041
|
}, {
|
|
7861
8042
|
key: "saveBasketProductsSMArticles",
|
|
@@ -7908,45 +8089,43 @@ var ClientArticleHandler = /*#__PURE__*/function () {
|
|
|
7908
8089
|
}]);
|
|
7909
8090
|
}();
|
|
7910
8091
|
|
|
7911
|
-
function ownKeys$
|
|
7912
|
-
function _objectSpread$
|
|
8092
|
+
function ownKeys$7(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; }
|
|
8093
|
+
function _objectSpread$7(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$7(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$7(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
7913
8094
|
getLogger('Framework', 'ConetentItemHandler');
|
|
7914
8095
|
var ContentItemHandler = /*#__PURE__*/function () {
|
|
7915
8096
|
function ContentItemHandler(root) {
|
|
7916
8097
|
_classCallCheck(this, ContentItemHandler);
|
|
7917
|
-
_defineProperty(this, "root", void 0);
|
|
7918
8098
|
this.root = root;
|
|
7919
8099
|
}
|
|
7920
8100
|
return _createClass(ContentItemHandler, [{
|
|
7921
8101
|
key: "catalogService",
|
|
7922
8102
|
get: function get() {
|
|
7923
|
-
return this.root.
|
|
8103
|
+
return this.root.apiConfig.catalogService;
|
|
7924
8104
|
}
|
|
7925
8105
|
}, {
|
|
7926
8106
|
key: "mediaService",
|
|
7927
8107
|
get: function get() {
|
|
7928
|
-
return this.root.
|
|
8108
|
+
return this.root.apiConfig.mediaService;
|
|
7929
8109
|
}
|
|
7930
8110
|
}, {
|
|
7931
8111
|
key: "organization",
|
|
7932
8112
|
get: function get() {
|
|
7933
|
-
return this.root.
|
|
8113
|
+
return this.root.organization;
|
|
7934
8114
|
}
|
|
7935
8115
|
}, {
|
|
7936
8116
|
key: "user",
|
|
7937
8117
|
get: function get() {
|
|
7938
|
-
return this.root.
|
|
8118
|
+
return this.root.user;
|
|
7939
8119
|
}
|
|
7940
8120
|
}, {
|
|
7941
8121
|
key: "langs",
|
|
7942
8122
|
get: function get() {
|
|
7943
|
-
|
|
7944
|
-
return (_this$root$configurat = (_this$root$configurat2 = this.root.configurationStore.locales) === null || _this$root$configurat2 === void 0 ? void 0 : _this$root$configurat2.available) !== null && _this$root$configurat !== void 0 ? _this$root$configurat : ['de'];
|
|
8123
|
+
return this.root.languages;
|
|
7945
8124
|
}
|
|
7946
8125
|
}, {
|
|
7947
8126
|
key: "jwt",
|
|
7948
8127
|
get: function get() {
|
|
7949
|
-
return this.root.
|
|
8128
|
+
return this.root.jwt;
|
|
7950
8129
|
}
|
|
7951
8130
|
}, {
|
|
7952
8131
|
key: "getContentItem",
|
|
@@ -7957,11 +8136,11 @@ var ContentItemHandler = /*#__PURE__*/function () {
|
|
|
7957
8136
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
7958
8137
|
while (1) switch (_context.prev = _context.next) {
|
|
7959
8138
|
case 0:
|
|
7960
|
-
fullUrl = this.
|
|
8139
|
+
fullUrl = this.catalogService + '/contentItems/' + id + '?language=' + lang;
|
|
7961
8140
|
_context.prev = 1;
|
|
7962
8141
|
_context.next = 4;
|
|
7963
8142
|
return axios.get(fullUrl, {
|
|
7964
|
-
headers: _objectSpread$
|
|
8143
|
+
headers: _objectSpread$7({}, this.getHeaders())
|
|
7965
8144
|
});
|
|
7966
8145
|
case 4:
|
|
7967
8146
|
res = _context.sent;
|
|
@@ -8010,12 +8189,12 @@ var ContentItemHandler = /*#__PURE__*/function () {
|
|
|
8010
8189
|
}]);
|
|
8011
8190
|
}();
|
|
8012
8191
|
|
|
8013
|
-
function ownKeys$
|
|
8014
|
-
function _objectSpread$
|
|
8192
|
+
function ownKeys$6(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; }
|
|
8193
|
+
function _objectSpread$6(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$6(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$6(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
8015
8194
|
var LOGINMODE_LOCALSTORAGE_KEY = 'diva-login-mode';
|
|
8016
|
-
var LOG$
|
|
8017
|
-
var
|
|
8018
|
-
function
|
|
8195
|
+
var LOG$4 = getLogger('Framework', 'root');
|
|
8196
|
+
var RootStore = /*#__PURE__*/function () {
|
|
8197
|
+
function RootStore(_ref) {
|
|
8019
8198
|
var _ref2,
|
|
8020
8199
|
_this = this;
|
|
8021
8200
|
var components = _ref.components,
|
|
@@ -8031,7 +8210,7 @@ var _default = /*#__PURE__*/function () {
|
|
|
8031
8210
|
_ref$telemetry = _ref.telemetry,
|
|
8032
8211
|
telemetry = _ref$telemetry === void 0 ? true : _ref$telemetry,
|
|
8033
8212
|
onEvent = _ref.onEvent;
|
|
8034
|
-
_classCallCheck(this,
|
|
8213
|
+
_classCallCheck(this, RootStore);
|
|
8035
8214
|
_defineProperty(this, "contentStore", void 0);
|
|
8036
8215
|
_defineProperty(this, "configurationStore", void 0);
|
|
8037
8216
|
_defineProperty(this, "dataStore", void 0);
|
|
@@ -8043,7 +8222,7 @@ var _default = /*#__PURE__*/function () {
|
|
|
8043
8222
|
_defineProperty(this, "_initializing", true);
|
|
8044
8223
|
_defineProperty(this, "_language", 'de');
|
|
8045
8224
|
_defineProperty(this, "_loginMode", (_ref2 = localStorage.getItem(LOGINMODE_LOCALSTORAGE_KEY)) !== null && _ref2 !== void 0 ? _ref2 : 'offline');
|
|
8046
|
-
_defineProperty(this, "_apiHandler",
|
|
8225
|
+
_defineProperty(this, "_apiHandler", void 0);
|
|
8047
8226
|
_defineProperty(this, "_productHandler", void 0);
|
|
8048
8227
|
_defineProperty(this, "_reportHandler", void 0);
|
|
8049
8228
|
_defineProperty(this, "_organizationHandler", void 0);
|
|
@@ -8066,16 +8245,16 @@ var _default = /*#__PURE__*/function () {
|
|
|
8066
8245
|
});
|
|
8067
8246
|
this._onEvent = onEvent;
|
|
8068
8247
|
//be compatible with the deprecated configProvider setting
|
|
8069
|
-
var apiConfig = defaultApiConfig ? _objectSpread$
|
|
8248
|
+
var apiConfig = defaultApiConfig ? _objectSpread$6({}, defaultApiConfig) : {};
|
|
8070
8249
|
!apiConfig.adminService && configProvider ? apiConfig.adminService = configProvider : false;
|
|
8071
8250
|
this.dataStore = new DataStore(this);
|
|
8072
8251
|
this.authorizationStore = new AuthorizationStore(this);
|
|
8073
8252
|
this.configurationStore = new ConfigurationStore(this, identifier, apiConfig, domain);
|
|
8074
8253
|
this.browserStateStore = new BrowserStateStore(this);
|
|
8075
|
-
this.loadingAndErrorStore = new _default
|
|
8254
|
+
this.loadingAndErrorStore = new _default(this, spinnerClass);
|
|
8076
8255
|
this.contentStore = new ContentStore(components, this);
|
|
8077
8256
|
this._apiHandler = new ApiHandler(this);
|
|
8078
|
-
this._productHandler = new ProductHandler(this);
|
|
8257
|
+
this._productHandler = new ProductHandler(this, this.contentStore.openModal.bind(this.contentStore), this.contentStore.closeModal.bind(this.contentStore));
|
|
8079
8258
|
this._reportHandler = new ReportHandler(this);
|
|
8080
8259
|
this._organizationHandler = new OrganizationHandler(this);
|
|
8081
8260
|
this._contentItemHandler = new ContentItemHandler(this);
|
|
@@ -8090,31 +8269,9 @@ var _default = /*#__PURE__*/function () {
|
|
|
8090
8269
|
//no idea what it does
|
|
8091
8270
|
DivaUtils.loginMode = this._loginMode;
|
|
8092
8271
|
reaction(function () {
|
|
8093
|
-
var _this$
|
|
8094
|
-
return {
|
|
8095
|
-
organizationId: _this.dataStore.organizationId,
|
|
8096
|
-
type: (_this$contentStore$cu = _this.contentStore.currentComponent) === null || _this$contentStore$cu === void 0 ? void 0 : _this$contentStore$cu.type
|
|
8097
|
-
};
|
|
8098
|
-
}, function (_ref3) {
|
|
8099
|
-
var organizationId = _ref3.organizationId,
|
|
8100
|
-
type = _ref3.type;
|
|
8101
|
-
if (_this.configurationStore.cacheSettings && type) {
|
|
8102
|
-
var _this$configurationSt, _state$parameters, _state$parameters2, _state$parameters3;
|
|
8103
|
-
var state = _this.contentStore.getState(type);
|
|
8104
|
-
LOG$6.debug('InitCache', toJS(_this.configurationStore.cacheSettings), organizationId, state);
|
|
8105
|
-
DivaUtils.initCache({
|
|
8106
|
-
cacheCDNUrl: (_this$configurationSt = _this.configurationStore.cacheSettings) === null || _this$configurationSt === void 0 ? void 0 : _this$configurationSt.cacheUrl,
|
|
8107
|
-
organisationId: organizationId,
|
|
8108
|
-
accountGuid: state === null || state === void 0 || (_state$parameters = state.parameters) === null || _state$parameters === void 0 ? void 0 : _state$parameters.accountId,
|
|
8109
|
-
catalogCodex: state === null || state === void 0 || (_state$parameters2 = state.parameters) === null || _state$parameters2 === void 0 ? void 0 : _state$parameters2.catalogCodex,
|
|
8110
|
-
articleCodex: state === null || state === void 0 || (_state$parameters3 = state.parameters) === null || _state$parameters3 === void 0 ? void 0 : _state$parameters3.articleCodexes
|
|
8111
|
-
});
|
|
8112
|
-
}
|
|
8113
|
-
});
|
|
8114
|
-
reaction(function () {
|
|
8115
|
-
var _this$configurationSt2;
|
|
8272
|
+
var _this$configurationSt;
|
|
8116
8273
|
return {
|
|
8117
|
-
namespace: (_this$
|
|
8274
|
+
namespace: (_this$configurationSt = _this.configurationStore.locales) === null || _this$configurationSt === void 0 ? void 0 : _this$configurationSt.namespace
|
|
8118
8275
|
};
|
|
8119
8276
|
}, function (value, prev) {
|
|
8120
8277
|
if (!instance.isInitialized || value.namespace == prev.namespace) return;
|
|
@@ -8138,14 +8295,14 @@ var _default = /*#__PURE__*/function () {
|
|
|
8138
8295
|
* Changes the current language of the application
|
|
8139
8296
|
* @param lang the new language
|
|
8140
8297
|
*/
|
|
8141
|
-
return _createClass(
|
|
8298
|
+
return _createClass(RootStore, [{
|
|
8142
8299
|
key: "changeLanguage",
|
|
8143
8300
|
value: function changeLanguage(lang) {
|
|
8144
8301
|
var _this2 = this;
|
|
8145
8302
|
this.loadingAndErrorStore.toggleLoading('language');
|
|
8146
8303
|
instance.changeLanguage(lang, function (err) {
|
|
8147
8304
|
if (err) {
|
|
8148
|
-
LOG$
|
|
8305
|
+
LOG$4.error(new DivaError('Could not change language', {
|
|
8149
8306
|
cause: err,
|
|
8150
8307
|
code: 'CORE_0007'
|
|
8151
8308
|
}));
|
|
@@ -8208,8 +8365,8 @@ var _default = /*#__PURE__*/function () {
|
|
|
8208
8365
|
}, {
|
|
8209
8366
|
key: "languages",
|
|
8210
8367
|
get: function get() {
|
|
8211
|
-
var _this$
|
|
8212
|
-
return (_this$
|
|
8368
|
+
var _this$configurationSt2, _this$configurationSt3;
|
|
8369
|
+
return (_this$configurationSt2 = (_this$configurationSt3 = this.configurationStore.locales) === null || _this$configurationSt3 === void 0 ? void 0 : _this$configurationSt3.available) !== null && _this$configurationSt2 !== void 0 ? _this$configurationSt2 : ['de'];
|
|
8213
8370
|
}
|
|
8214
8371
|
|
|
8215
8372
|
/**
|
|
@@ -8348,14 +8505,50 @@ var _default = /*#__PURE__*/function () {
|
|
|
8348
8505
|
}, {
|
|
8349
8506
|
key: "doShowInitWarnBanner",
|
|
8350
8507
|
get: function get() {
|
|
8351
|
-
return this.configurationStore.showInitWarnBanner;
|
|
8508
|
+
return !!this.configurationStore.showInitWarnBanner;
|
|
8352
8509
|
}
|
|
8353
|
-
|
|
8354
|
-
|
|
8355
|
-
|
|
8356
|
-
|
|
8357
|
-
|
|
8358
|
-
|
|
8510
|
+
}, {
|
|
8511
|
+
key: "apiConfig",
|
|
8512
|
+
get: function get() {
|
|
8513
|
+
return this.configurationStore.apiConfig;
|
|
8514
|
+
}
|
|
8515
|
+
}, {
|
|
8516
|
+
key: "jwt",
|
|
8517
|
+
get: function get() {
|
|
8518
|
+
return this.authorizationStore.zToken;
|
|
8519
|
+
}
|
|
8520
|
+
}, {
|
|
8521
|
+
key: "storedNToken",
|
|
8522
|
+
get: function get() {
|
|
8523
|
+
return this.browserStateStore.getStoredNToken();
|
|
8524
|
+
}
|
|
8525
|
+
}, {
|
|
8526
|
+
key: "user",
|
|
8527
|
+
get: function get() {
|
|
8528
|
+
return this.dataStore.user;
|
|
8529
|
+
}
|
|
8530
|
+
}, {
|
|
8531
|
+
key: "organization",
|
|
8532
|
+
get: function get() {
|
|
8533
|
+
return this.dataStore.organization;
|
|
8534
|
+
}
|
|
8535
|
+
}, {
|
|
8536
|
+
key: "allowedOrganizationTypes",
|
|
8537
|
+
get: function get() {
|
|
8538
|
+
return this.configurationStore.allowedOrganizationTypes;
|
|
8539
|
+
}
|
|
8540
|
+
}, {
|
|
8541
|
+
key: "validOrganizations",
|
|
8542
|
+
get: function get() {
|
|
8543
|
+
return this.configurationStore.validOrganizations;
|
|
8544
|
+
}
|
|
8545
|
+
|
|
8546
|
+
/**
|
|
8547
|
+
* Initalizes the application
|
|
8548
|
+
*
|
|
8549
|
+
* @param organizationId the organizationId set via component property
|
|
8550
|
+
* @param domain the domain set via component property
|
|
8551
|
+
* @param identifier the identifier set via component property
|
|
8359
8552
|
* @param language the language set via component property
|
|
8360
8553
|
* @param component the inital component set via component property
|
|
8361
8554
|
* @param telemetry the telemetry setting via component property
|
|
@@ -8365,11 +8558,11 @@ var _default = /*#__PURE__*/function () {
|
|
|
8365
8558
|
value: (function () {
|
|
8366
8559
|
var _initialize = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(telemetry, identifier, organizationId, domain, language, component) {
|
|
8367
8560
|
var _this4 = this;
|
|
8368
|
-
var _this$_initalComponen, _this$_initalComponen2, _configuration$pwa, _this$contentStore$
|
|
8561
|
+
var _this$_initalComponen, _this$_initalComponen2, _configuration$pwa, _this$contentStore$cu, urlState, storedLanguage, storedOrganization, initialOrganization, initalLanguage, configuration, initLocalesResult, telemetrySettings, enableApm, disableDivaAnalyticsLocalStorage, disableDivaAnalytics, enableBusinessMetrics, _configuration$enviro3, _configuration$enviro4, myUserAgentInfo, header, manifest, result, warningText, _this$contentStore, verifyEmailToken, authObject, _urlState$component, _initialOrganization, email, _this$contentStore$cu2;
|
|
8369
8562
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
8370
8563
|
while (1) switch (_context.prev = _context.next) {
|
|
8371
8564
|
case 0:
|
|
8372
|
-
LOG$
|
|
8565
|
+
LOG$4.startTransaction({
|
|
8373
8566
|
event: 'initCore',
|
|
8374
8567
|
message: 'Initalizing Core',
|
|
8375
8568
|
labels: {
|
|
@@ -8388,7 +8581,7 @@ var _default = /*#__PURE__*/function () {
|
|
|
8388
8581
|
_this4._initializing = true;
|
|
8389
8582
|
});
|
|
8390
8583
|
this.loadingAndErrorStore.toggleLoading('initalize', true);
|
|
8391
|
-
LOG$
|
|
8584
|
+
LOG$4.successTransaction('UNTIL_INIT');
|
|
8392
8585
|
_context.next = 7;
|
|
8393
8586
|
return this.browserStateStore.loadUrlState();
|
|
8394
8587
|
case 7:
|
|
@@ -8397,7 +8590,7 @@ var _default = /*#__PURE__*/function () {
|
|
|
8397
8590
|
storedOrganization = this.browserStateStore.getStoredOrganization(); //the inital state is derived in the fallowing order: component params > url > browserstore > configuration
|
|
8398
8591
|
initialOrganization = organizationId || urlState.organization || storedOrganization;
|
|
8399
8592
|
initalLanguage = language || urlState.language || storedLanguage;
|
|
8400
|
-
LOG$
|
|
8593
|
+
LOG$4.startTransaction({
|
|
8401
8594
|
event: 'onLoadConfig',
|
|
8402
8595
|
message: 'loading Config',
|
|
8403
8596
|
eventId: 'LOAD_CONFIG'
|
|
@@ -8419,15 +8612,15 @@ var _default = /*#__PURE__*/function () {
|
|
|
8419
8612
|
//open default route
|
|
8420
8613
|
this._initalComponent = this.configurationStore.defaultComponent;
|
|
8421
8614
|
}
|
|
8422
|
-
LOG$
|
|
8423
|
-
LOG$
|
|
8615
|
+
LOG$4.successTransaction('LOAD_CONFIG');
|
|
8616
|
+
LOG$4.startTransaction({
|
|
8424
8617
|
event: 'onLoadServerData',
|
|
8425
8618
|
message: 'load server data',
|
|
8426
8619
|
eventId: 'LOAD_SERVER_DATA'
|
|
8427
8620
|
});
|
|
8428
8621
|
|
|
8429
8622
|
//async load locales data
|
|
8430
|
-
initLocalesResult = init(_objectSpread$
|
|
8623
|
+
initLocalesResult = init(_objectSpread$6(_objectSpread$6({}, this.configurationStore.locales), {}, {
|
|
8431
8624
|
defaultLng: initalLanguage,
|
|
8432
8625
|
apiConfig: this.configurationStore.apiConfig
|
|
8433
8626
|
}));
|
|
@@ -8497,8 +8690,8 @@ var _default = /*#__PURE__*/function () {
|
|
|
8497
8690
|
useLocalStorage: true
|
|
8498
8691
|
});
|
|
8499
8692
|
}
|
|
8500
|
-
LOG$
|
|
8501
|
-
LOG$
|
|
8693
|
+
LOG$4.successTransaction('LOAD_SERVER_DATA');
|
|
8694
|
+
LOG$4.startTransaction({
|
|
8502
8695
|
event: 'onLoadUserData',
|
|
8503
8696
|
message: 'load user data',
|
|
8504
8697
|
eventId: 'LOAD_USER_DATA'
|
|
@@ -8516,7 +8709,7 @@ var _default = /*#__PURE__*/function () {
|
|
|
8516
8709
|
break;
|
|
8517
8710
|
case 46:
|
|
8518
8711
|
if (authObject.error) {
|
|
8519
|
-
LOG$
|
|
8712
|
+
LOG$4.errorTransaction('LOAD_USER_DATA', 'CORE_0006', authObject.error);
|
|
8520
8713
|
this.authorizationStore.showLogin(false, true);
|
|
8521
8714
|
} else {
|
|
8522
8715
|
initialOrganization = authObject.organizationId;
|
|
@@ -8528,7 +8721,7 @@ var _default = /*#__PURE__*/function () {
|
|
|
8528
8721
|
return _context.abrupt("break", 63);
|
|
8529
8722
|
case 48:
|
|
8530
8723
|
if (authObject.error) {
|
|
8531
|
-
LOG$
|
|
8724
|
+
LOG$4.errorTransaction('LOAD_USER_DATA', authObject.code, authObject.error);
|
|
8532
8725
|
this.loadingAndErrorStore.setError(authObject.error);
|
|
8533
8726
|
} else {
|
|
8534
8727
|
this.authorizationStore.showChangePassword(authObject.token);
|
|
@@ -8536,7 +8729,7 @@ var _default = /*#__PURE__*/function () {
|
|
|
8536
8729
|
return _context.abrupt("break", 63);
|
|
8537
8730
|
case 50:
|
|
8538
8731
|
if (authObject.error) {
|
|
8539
|
-
LOG$
|
|
8732
|
+
LOG$4.errorTransaction('LOAD_USER_DATA', authObject.code, authObject.error);
|
|
8540
8733
|
this.loadingAndErrorStore.setError(authObject.error);
|
|
8541
8734
|
} else {
|
|
8542
8735
|
verifyEmailToken = authObject.token;
|
|
@@ -8547,7 +8740,7 @@ var _default = /*#__PURE__*/function () {
|
|
|
8547
8740
|
_context.next = 57;
|
|
8548
8741
|
break;
|
|
8549
8742
|
}
|
|
8550
|
-
LOG$
|
|
8743
|
+
LOG$4.errorTransaction('LOAD_INVITATION', authObject.code, authObject.error);
|
|
8551
8744
|
this.loadingAndErrorStore.setError(authObject.error);
|
|
8552
8745
|
_context.next = 61;
|
|
8553
8746
|
break;
|
|
@@ -8568,7 +8761,7 @@ var _default = /*#__PURE__*/function () {
|
|
|
8568
8761
|
_context.next = 65;
|
|
8569
8762
|
break;
|
|
8570
8763
|
case 65:
|
|
8571
|
-
LOG$
|
|
8764
|
+
LOG$4.successTransaction('LOAD_USER_DATA');
|
|
8572
8765
|
if (!(!this.browserStateStore.getStoredNToken() && this.configurationStore.hasAuthentication)) {
|
|
8573
8766
|
_context.next = 80;
|
|
8574
8767
|
break;
|
|
@@ -8583,7 +8776,7 @@ var _default = /*#__PURE__*/function () {
|
|
|
8583
8776
|
_context.prev = 72;
|
|
8584
8777
|
_context.t1 = _context["catch"](67);
|
|
8585
8778
|
this.loadingAndErrorStore.setError(_context.t1);
|
|
8586
|
-
LOG$
|
|
8779
|
+
LOG$4.errorTransaction('INITIALIZE_CORE', _context.t1.code, 'Organization Error');
|
|
8587
8780
|
return _context.abrupt("return");
|
|
8588
8781
|
case 77:
|
|
8589
8782
|
//now Login Page opens. The overwritten initComponent params get saved in restrictedComponent. this will later be evaluated in getRedirectUrl
|
|
@@ -8606,7 +8799,7 @@ var _default = /*#__PURE__*/function () {
|
|
|
8606
8799
|
case 87:
|
|
8607
8800
|
_context.prev = 87;
|
|
8608
8801
|
_context.t2 = _context["catch"](81);
|
|
8609
|
-
LOG$
|
|
8802
|
+
LOG$4.errorTransaction('INITIALIZE_CORE', 'CORE_0002', 'Error initializing Organization');
|
|
8610
8803
|
this.loadingAndErrorStore.setError(_context.t2, 'CORE_0002', true);
|
|
8611
8804
|
return _context.abrupt("return");
|
|
8612
8805
|
case 92:
|
|
@@ -8619,7 +8812,7 @@ var _default = /*#__PURE__*/function () {
|
|
|
8619
8812
|
case 97:
|
|
8620
8813
|
_context.prev = 97;
|
|
8621
8814
|
_context.t3 = _context["catch"](92);
|
|
8622
|
-
LOG$
|
|
8815
|
+
LOG$4.errorTransaction('INITIALIZE_CORE', 'CORE_0002', 'Error updating Organization');
|
|
8623
8816
|
this.loadingAndErrorStore.setError(_context.t3);
|
|
8624
8817
|
return _context.abrupt("return");
|
|
8625
8818
|
case 102:
|
|
@@ -8642,18 +8835,18 @@ var _default = /*#__PURE__*/function () {
|
|
|
8642
8835
|
_context.prev = 110;
|
|
8643
8836
|
_context.t4 = _context["catch"](40);
|
|
8644
8837
|
if (_context.t4 instanceof DivaError && _context.t4.name == 'AUTH_0006') {
|
|
8645
|
-
LOG$
|
|
8838
|
+
LOG$4.errorTransaction('INITIALIZE_CORE', 'AUTH_0006', 'Existing verification token not valid.');
|
|
8646
8839
|
} else {
|
|
8647
|
-
LOG$
|
|
8840
|
+
LOG$4.errorTransaction('INITIALIZE_CORE', 'CORE_0006', 'An error occured during initialization.');
|
|
8648
8841
|
}
|
|
8649
8842
|
case 113:
|
|
8650
8843
|
this.initalizeView();
|
|
8651
|
-
LOG$
|
|
8844
|
+
LOG$4.successTransaction('INITIALIZE_CORE', {
|
|
8652
8845
|
identifier: identifier,
|
|
8653
8846
|
organizationId: this.dataStore.organizationId,
|
|
8654
8847
|
domain: domain,
|
|
8655
8848
|
language: this._language,
|
|
8656
|
-
component: (_this$contentStore$
|
|
8849
|
+
component: (_this$contentStore$cu = this.contentStore.currentComponent) === null || _this$contentStore$cu === void 0 ? void 0 : _this$contentStore$cu.type
|
|
8657
8850
|
});
|
|
8658
8851
|
_context.next = 122;
|
|
8659
8852
|
break;
|
|
@@ -8662,12 +8855,12 @@ var _default = /*#__PURE__*/function () {
|
|
|
8662
8855
|
_context.t5 = _context["catch"](1);
|
|
8663
8856
|
this.loadingAndErrorStore.toggleLoading('initalize', false);
|
|
8664
8857
|
this.loadingAndErrorStore.setError(_context.t5);
|
|
8665
|
-
LOG$
|
|
8858
|
+
LOG$4.errorTransaction('INITIALIZE_CORE', 'CORE_0000', _context.t5.message, {
|
|
8666
8859
|
identifier: identifier,
|
|
8667
8860
|
organizationId: this.dataStore.organizationId,
|
|
8668
8861
|
domain: domain,
|
|
8669
8862
|
language: this._language,
|
|
8670
|
-
component: (_this$contentStore$
|
|
8863
|
+
component: (_this$contentStore$cu2 = this.contentStore.currentComponent) === null || _this$contentStore$cu2 === void 0 ? void 0 : _this$contentStore$cu2.type
|
|
8671
8864
|
});
|
|
8672
8865
|
case 122:
|
|
8673
8866
|
_context.prev = 122;
|
|
@@ -8691,11 +8884,11 @@ var _default = /*#__PURE__*/function () {
|
|
|
8691
8884
|
key: "initalizeView",
|
|
8692
8885
|
value: function initalizeView() {
|
|
8693
8886
|
if (this.contentStore.currentComponent) {
|
|
8694
|
-
LOG$
|
|
8887
|
+
LOG$4.debug('View is already initialized');
|
|
8695
8888
|
return;
|
|
8696
8889
|
}
|
|
8697
8890
|
if (this._initalComponent) {
|
|
8698
|
-
LOG$
|
|
8891
|
+
LOG$4.debug("Inital component", JSON.stringify(this._initalComponent, null, 2));
|
|
8699
8892
|
this.contentStore.openComponent(this._initalComponent);
|
|
8700
8893
|
} else {
|
|
8701
8894
|
this.loadingAndErrorStore.setError(new DivaError('No inital component available', {
|
|
@@ -8714,16 +8907,16 @@ var _default = /*#__PURE__*/function () {
|
|
|
8714
8907
|
}]);
|
|
8715
8908
|
}();
|
|
8716
8909
|
|
|
8717
|
-
var _excluded
|
|
8718
|
-
function ownKeys$
|
|
8719
|
-
function _objectSpread$
|
|
8910
|
+
var _excluded = ["children"];
|
|
8911
|
+
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; }
|
|
8912
|
+
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; }
|
|
8720
8913
|
var coreContext = /*#__PURE__*/createContext(null);
|
|
8721
8914
|
var DivaCoreProvider = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
8722
8915
|
var _store$configurationS;
|
|
8723
8916
|
var children = _ref.children,
|
|
8724
|
-
props = _objectWithoutProperties(_ref, _excluded
|
|
8917
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
8725
8918
|
var store = useMemo(function () {
|
|
8726
|
-
return new
|
|
8919
|
+
return new RootStore(props);
|
|
8727
8920
|
}, []);
|
|
8728
8921
|
useImperativeHandle(ref, function () {
|
|
8729
8922
|
return {
|
|
@@ -8779,7 +8972,7 @@ var DivaCoreProvider = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
8779
8972
|
user: store.dataStore.user,
|
|
8780
8973
|
jwt: store.authorizationStore.zToken,
|
|
8781
8974
|
nToken: store.authorizationStore.nToken,
|
|
8782
|
-
navigationConfiguration: _objectSpread$
|
|
8975
|
+
navigationConfiguration: _objectSpread$5(_objectSpread$5({}, store.configurationStore.navigation), {}, {
|
|
8783
8976
|
buttons: store.contentStore.availableButtons || [],
|
|
8784
8977
|
customHeaderElement: store.contentStore.customHeaderComponent,
|
|
8785
8978
|
customLogo: store.contentStore.customLogo,
|
|
@@ -8873,7 +9066,7 @@ var DivaCoreProvider = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
8873
9066
|
isMobile: store.dataStore.isMobile,
|
|
8874
9067
|
googleMapsConfig: store.configurationStore.googleMapsconfig,
|
|
8875
9068
|
cometChatConfig: store.configurationStore.cometchatConfig,
|
|
8876
|
-
navigationConfiguration: _objectSpread$
|
|
9069
|
+
navigationConfiguration: _objectSpread$5(_objectSpread$5({}, store.configurationStore.navigation), {}, {
|
|
8877
9070
|
buttons: store.contentStore.availableButtons || [],
|
|
8878
9071
|
customLogo: store.contentStore.customLogo,
|
|
8879
9072
|
customHeaderElement: store.contentStore.customHeaderComponent,
|
|
@@ -9015,7 +9208,7 @@ var DivaCoreProvider = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
9015
9208
|
});
|
|
9016
9209
|
var useDivaCoreContext = function useDivaCoreContext() {
|
|
9017
9210
|
var context = React.useContext(coreContext);
|
|
9018
|
-
if (!context) {
|
|
9211
|
+
if (!(context !== null && context !== void 0 && context.store)) {
|
|
9019
9212
|
throw new Error('useDivaCoreContext must be used within a DivaCoreProvider.');
|
|
9020
9213
|
}
|
|
9021
9214
|
return context.store;
|
|
@@ -9033,7 +9226,7 @@ var loading = "loading-kAuhm";
|
|
|
9033
9226
|
var css_248z$5 = ".overlay-X3zhH {\n height: 100%;\n width: 100%;\n display: flex;\n background-color: rgba(255, 255, 255, 0.6);\n z-index: 1000;\n justify-content: center;\n align-items: center;\n position: absolute;\n}\n\n.loading-kAuhm {\n margin: 0 auto;\n display: inline-block;\n position: relative;\n width: 80px;\n height: 80px;\n}\n.loading-kAuhm div {\n box-sizing: border-box;\n display: block;\n position: absolute;\n width: 64px;\n height: 64px;\n margin: 8px;\n border: 8px solid #b6b6b6;\n border-radius: 50%;\n animation: loading-kAuhm 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;\n border-color: #b6b6b6 transparent transparent transparent;\n}\n.loading-kAuhm div:nth-child(1) {\n animation-delay: -0.45s;\n}\n.loading-kAuhm div:nth-child(2) {\n animation-delay: -0.3s;\n}\n.loading-kAuhm div:nth-child(3) {\n animation-delay: -0.15s;\n}\n@keyframes loading-kAuhm {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n}\n";
|
|
9034
9227
|
styleInject(css_248z$5);
|
|
9035
9228
|
|
|
9036
|
-
var LOG$
|
|
9229
|
+
var LOG$3 = getLogger('Framework', 'loadDependency');
|
|
9037
9230
|
function loadDependency(_x) {
|
|
9038
9231
|
return _loadDependency.apply(this, arguments);
|
|
9039
9232
|
}
|
|
@@ -9074,7 +9267,7 @@ function _loadDependency() {
|
|
|
9074
9267
|
resolve(id);
|
|
9075
9268
|
};
|
|
9076
9269
|
elem.onerror = function (e) {
|
|
9077
|
-
LOG$
|
|
9270
|
+
LOG$3.error(new DivaError('Failed to load dependency: ' + type, {
|
|
9078
9271
|
cause: e
|
|
9079
9272
|
}));
|
|
9080
9273
|
resolve(id);
|
|
@@ -9148,22 +9341,10 @@ function Spinner() {
|
|
|
9148
9341
|
}
|
|
9149
9342
|
var Spinner$1 = observer(Spinner);
|
|
9150
9343
|
|
|
9151
|
-
function Fallback () {
|
|
9152
|
-
var _useDivaCoreContext = useDivaCoreContext(),
|
|
9153
|
-
loadingAndErrorStore = _useDivaCoreContext.loadingAndErrorStore;
|
|
9154
|
-
useEffect(function () {
|
|
9155
|
-
loadingAndErrorStore.toggleLoading('Fallback');
|
|
9156
|
-
return function () {
|
|
9157
|
-
return loadingAndErrorStore.toggleLoading('Fallback');
|
|
9158
|
-
};
|
|
9159
|
-
}, []);
|
|
9160
|
-
return /*#__PURE__*/jsx(Fragment, {});
|
|
9161
|
-
}
|
|
9162
|
-
|
|
9163
9344
|
var overlay = "overlay-34l68";
|
|
9164
9345
|
var absoluteOverlay = "absolute-overlay-cG7uO";
|
|
9165
9346
|
var closeIcon$1 = "close-icon-1kDyU";
|
|
9166
|
-
var css_248z$4 = ".overlay-34l68 {\n height: 100%;\n width: 100%;\n display: flex;\n background-color: #fff;\n z-index: 999;\n justify-content: center;\n align-items: center;\n position: absolute;\n}\n\n.absolute-overlay-cG7uO {\n background-color: #fff;\n position: fixed;\n top: 0px;\n right: 0px;\n bottom: 0px;\n left: 0px;\n overflow: hidden;\n z-index: 1000000;\n display: block;\n width: 100vw;\n
|
|
9347
|
+
var css_248z$4 = ".overlay-34l68 {\n height: 100%;\n width: 100%;\n display: flex;\n background-color: #fff;\n z-index: 999;\n justify-content: center;\n align-items: center;\n position: absolute;\n}\n\n#DivaCore.absolute-overlay-cG7uO {\n height: 100% !important;\n}\n\n#DivaCore.absolute-overlay-cG7uO {\n background-color: #fff;\n position: fixed;\n top: 0px;\n right: 0px;\n bottom: 0px;\n left: 0px;\n overflow: hidden;\n z-index: 1000000;\n display: block;\n width: 100vw;\n}\n\n.diva-pseudo-fullscreen body {\n height: auto !important;\n}\n.diva-pseudo-fullscreen, .diva-pseudo-fullscreen body {\n overflow: hidden !important;\n}\n\n.close-icon-1kDyU {\n position: absolute;\n right: 32px;\n top: 32px;\n width: 50px;\n height: 40px;\n opacity: 0.3;\n z-index: 700;\n cursor: pointer;\n}\n\n.close-icon-1kDyU:before {\n transform: rotate(45deg);\n}\n\n.close-icon-1kDyU:after {\n transform: rotate(-45deg);\n}\n\n.close-icon-1kDyU:before,\n.close-icon-1kDyU:after {\n position: absolute;\n left: 23px;\n top: 5px;\n content: ' ';\n height: 33px;\n width: 3px;\n background-color: #4b4b4b;\n}\n\n.close-icon-1kDyU:hover {\n opacity: 0.8;\n transition: opacity 0.2s ease-in-out;\n}\n";
|
|
9167
9348
|
styleInject(css_248z$4);
|
|
9168
9349
|
|
|
9169
9350
|
var sideMenu = "side-menu-2Fgdm";
|
|
@@ -9180,8 +9361,8 @@ var mobileBcGroup = "mobile-bc-group-6v8wI";
|
|
|
9180
9361
|
var css_248z$3 = ".side-menu-2Fgdm {\n width: 100%;\n max-width: 400px;\n height: 100%;\n background-color: #f2f2f2;\n position: absolute;\n bottom: 0;\n transition: transform 0.3s cubic-bezier(0, 0.52, 0, 1);\n box-sizing: border-box;\n}\n\n.left-side-menu-L42L3 {\n left: 0px;\n}\n\n.right-side-menu-Akk-Y {\n right: 0px;\n}\n\n.wrapper-jJaXo {\n height: 100%;\n display: flex;\n flex-direction: column;\n}\n\n.scroller-ZnoJy {\n height: 100%;\n}\n\n.title-WOjYJ {\n font-size: 22px;\n margin: 20px;\n}\n\n.hide-left-4bzTL {\n transform: translate(-960px, 0);\n}\n.hide-right-IOmlC {\n transform: translate(960px, 0);\n}\n\n.show-Z8M2h {\n transform: translate(0, 0);\n overflow: hidden;\n}\n\n.close-icon-NJkeP {\n position: absolute;\n top: 16px;\n right: 16px;\n opacity: 0.3;\n width: 32px;\n height: 32px;\n z-index: 300;\n width: 50px;\n height: 40px;\n cursor: pointer;\n}\n\n.close-icon-NJkeP:before {\n transform: rotate(45deg);\n}\n\n.close-icon-NJkeP:after {\n transform: rotate(-45deg);\n}\n\n.close-icon-NJkeP:before,\n.close-icon-NJkeP:after {\n position: absolute;\n right: 15px;\n content: ' ';\n height: 33px;\n width: 3px;\n background-color: #4b4b4b;\n}\n\n.close-icon-NJkeP:hover {\n opacity: 0.8;\n transition: opacity 0.2s ease-in-out;\n}\n\n.mobile-bc-group-6v8wI {\n display: flex;\n border-top: 0.8px solid #b6b6b7;\n padding: 12px 16px;\n border-bottom: 0.8px solid #b6b6b7;\n margin-top: 40px;\n overflow: auto;\n -ms-overflow-style: none; /* IE and Edge */\n scrollbar-width: none; /* Firefox */\n}\n\n.mobile-bc-group-6v8wI::-webkit-scrollbar {\n display: none;\n}\n";
|
|
9181
9362
|
styleInject(css_248z$3);
|
|
9182
9363
|
|
|
9183
|
-
function ownKeys$
|
|
9184
|
-
function _objectSpread$
|
|
9364
|
+
function ownKeys$4(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; }
|
|
9365
|
+
function _objectSpread$4(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$4(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$4(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
9185
9366
|
var SideMenu = function SideMenu() {
|
|
9186
9367
|
var _contentStore$sideMen, _contentStore$sideMen5, _contentStore$sideMen6, _contentStore$headerI, _contentStore$headerI2, _contentStore$sideMen7, _contentStore$sideMen8, _contentStore$sideMen9, _contentStore$sideMen10;
|
|
9187
9368
|
var _useDivaCoreContext = useDivaCoreContext(),
|
|
@@ -9215,8 +9396,8 @@ var SideMenu = function SideMenu() {
|
|
|
9215
9396
|
var hide = ((_contentStore$sideMen6 = contentStore.sideMenu) === null || _contentStore$sideMen6 === void 0 ? void 0 : _contentStore$sideMen6.side) == 'right' ? hideRight : hideLeft;
|
|
9216
9397
|
if (!contentStore.sideMenu) return /*#__PURE__*/jsx(Fragment, {});
|
|
9217
9398
|
var height = (_contentStore$headerI = (_contentStore$headerI2 = contentStore.headerInfos.HeaderElement) === null || _contentStore$headerI2 === void 0 ? void 0 : _contentStore$headerI2.getBoundingClientRect().height) !== null && _contentStore$headerI !== void 0 ? _contentStore$headerI : 0;
|
|
9218
|
-
return /*#__PURE__*/jsxs("div", _objectSpread$
|
|
9219
|
-
style: _objectSpread$
|
|
9399
|
+
return /*#__PURE__*/jsxs("div", _objectSpread$4(_objectSpread$4({}, swipeHandler), {}, {
|
|
9400
|
+
style: _objectSpread$4(_objectSpread$4({}, contentStore.sideMenu.style), {}, {
|
|
9220
9401
|
width: hiddenDelayed ? '0px' : undefined,
|
|
9221
9402
|
backgroundColor: contentStore.sideMenu.backgroundColor,
|
|
9222
9403
|
height: (_contentStore$sideMen7 = contentStore.sideMenu) !== null && _contentStore$sideMen7 !== void 0 && _contentStore$sideMen7.showCoreHeader ? 'calc(100% - ' + height + 'px)' : undefined,
|
|
@@ -9241,10 +9422,10 @@ var SideMenu = function SideMenu() {
|
|
|
9241
9422
|
};
|
|
9242
9423
|
var SideMenu$1 = observer(SideMenu);
|
|
9243
9424
|
|
|
9244
|
-
function ownKeys$
|
|
9245
|
-
function _objectSpread$
|
|
9425
|
+
function ownKeys$3(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; }
|
|
9426
|
+
function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
9246
9427
|
var LazyModals$1 = /*#__PURE__*/React.lazy(function () {
|
|
9247
|
-
return import('./ModalsWrapper-
|
|
9428
|
+
return import('./ModalsWrapper-34dd87a3.js');
|
|
9248
9429
|
});
|
|
9249
9430
|
function Fullscreen() {
|
|
9250
9431
|
var _useDivaCoreContext = useDivaCoreContext(),
|
|
@@ -9339,7 +9520,7 @@ function Fullscreen() {
|
|
|
9339
9520
|
style: isMobile ? (_c$state$absoluteFull = c.state.absoluteFullscreenStyle) === null || _c$state$absoluteFull === void 0 ? void 0 : _c$state$absoluteFull.mobile : (_c$state$absoluteFull2 = c.state.absoluteFullscreenStyle) === null || _c$state$absoluteFull2 === void 0 ? void 0 : _c$state$absoluteFull2.desktop,
|
|
9340
9521
|
children: [/*#__PURE__*/jsx(Spinner$1, {}), /*#__PURE__*/jsx(SideMenu$1, {}), configurationStore.enableModals && /*#__PURE__*/jsx(LazyModals$1, {}), /*#__PURE__*/jsx(Suspense, {
|
|
9341
9522
|
fallback: /*#__PURE__*/jsx(Fallback, {}),
|
|
9342
|
-
children: /*#__PURE__*/jsx(C, _objectSpread$
|
|
9523
|
+
children: /*#__PURE__*/jsx(C, _objectSpread$3({}, c.state))
|
|
9343
9524
|
})]
|
|
9344
9525
|
});
|
|
9345
9526
|
}
|
|
@@ -9687,19 +9868,19 @@ function BigSnackBarComponent(_ref2) {
|
|
|
9687
9868
|
}
|
|
9688
9869
|
var SnackBar = observer(DivaSnackBar);
|
|
9689
9870
|
|
|
9690
|
-
function ownKeys$
|
|
9691
|
-
function _objectSpread$
|
|
9692
|
-
var LOG$
|
|
9871
|
+
function ownKeys$2(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; }
|
|
9872
|
+
function _objectSpread$2(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$2(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
9873
|
+
var LOG$2 = getLogger('Framework', 'Root');
|
|
9693
9874
|
var LazyAuth = /*#__PURE__*/React.lazy(function () {
|
|
9694
|
-
return import('./index-
|
|
9875
|
+
return import('./index-f1da0fd1.js');
|
|
9695
9876
|
});
|
|
9696
9877
|
var LazyModals = /*#__PURE__*/React.lazy(function () {
|
|
9697
|
-
return import('./ModalsWrapper-
|
|
9878
|
+
return import('./ModalsWrapper-34dd87a3.js');
|
|
9698
9879
|
});
|
|
9699
|
-
function
|
|
9880
|
+
function ContentComponent() {
|
|
9700
9881
|
var context = useDivaCoreContext();
|
|
9701
9882
|
useEffect(function () {
|
|
9702
|
-
LOG$
|
|
9883
|
+
LOG$2.debug('Initial render of content wrapper');
|
|
9703
9884
|
}, []);
|
|
9704
9885
|
return /*#__PURE__*/jsxs(Fragment, {
|
|
9705
9886
|
children: [/*#__PURE__*/jsxs(Suspense, {
|
|
@@ -9726,114 +9907,23 @@ function Content() {
|
|
|
9726
9907
|
},
|
|
9727
9908
|
children: /*#__PURE__*/jsx(Suspense, {
|
|
9728
9909
|
fallback: /*#__PURE__*/jsx(Fallback, {}),
|
|
9729
|
-
children: /*#__PURE__*/jsx(C, _objectSpread$
|
|
9910
|
+
children: /*#__PURE__*/jsx(C, _objectSpread$2({}, context.contentStore.getState(c.name)))
|
|
9730
9911
|
})
|
|
9731
9912
|
}, c.name);
|
|
9732
9913
|
})]
|
|
9733
9914
|
})]
|
|
9734
9915
|
});
|
|
9735
9916
|
}
|
|
9736
|
-
var Content
|
|
9737
|
-
|
|
9738
|
-
function _callSuper$1(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$1() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
9739
|
-
function _isNativeReflectConstruct$1() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct$1 = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
9740
|
-
var LOG$3 = getLogger('Framework', 'root');
|
|
9741
|
-
var ErrorBoundary = /*#__PURE__*/function (_React$Component) {
|
|
9742
|
-
function ErrorBoundary(props) {
|
|
9743
|
-
var _this;
|
|
9744
|
-
_classCallCheck(this, ErrorBoundary);
|
|
9745
|
-
_this = _callSuper$1(this, ErrorBoundary, [props]);
|
|
9746
|
-
_defineProperty(_this, "root", void 0);
|
|
9747
|
-
_this.root = props.root;
|
|
9748
|
-
return _this;
|
|
9749
|
-
}
|
|
9750
|
-
_inherits(ErrorBoundary, _React$Component);
|
|
9751
|
-
return _createClass(ErrorBoundary, [{
|
|
9752
|
-
key: "componentDidCatch",
|
|
9753
|
-
value: function componentDidCatch(error) {
|
|
9754
|
-
LOG$3.error(new DivaError('Error while rendring in Core', {
|
|
9755
|
-
cause: error,
|
|
9756
|
-
custom: {
|
|
9757
|
-
code: 'CORE_0000'
|
|
9758
|
-
}
|
|
9759
|
-
}));
|
|
9760
|
-
this.root.loadingAndErrorStore.setError(error.message);
|
|
9761
|
-
}
|
|
9762
|
-
}, {
|
|
9763
|
-
key: "render",
|
|
9764
|
-
value: function render() {
|
|
9765
|
-
return this.props.children;
|
|
9766
|
-
}
|
|
9767
|
-
}], [{
|
|
9768
|
-
key: "getDerivedStateFromError",
|
|
9769
|
-
value: function getDerivedStateFromError() {
|
|
9770
|
-
// just to prevent warning
|
|
9771
|
-
return {};
|
|
9772
|
-
}
|
|
9773
|
-
}]);
|
|
9774
|
-
}(React.Component);
|
|
9775
|
-
|
|
9776
|
-
var _excluded = ["children"];
|
|
9777
|
-
function ownKeys(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; }
|
|
9778
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
9779
|
-
var LOG$2 = getLogger('Framework', 'root');
|
|
9780
|
-
var DivaCore = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
9781
|
-
var children = _ref.children,
|
|
9782
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
9783
|
-
useEffect(function () {
|
|
9784
|
-
LOG$2.successTransaction('UNTIL_RENDER');
|
|
9785
|
-
}, []);
|
|
9786
|
-
return /*#__PURE__*/jsx(DivaCoreProvider, _objectSpread(_objectSpread({}, props), {}, {
|
|
9787
|
-
ref: ref,
|
|
9788
|
-
children: /*#__PURE__*/jsx(ContentWrapper, {
|
|
9789
|
-
children: /*#__PURE__*/jsx(Fragment, {
|
|
9790
|
-
children: children !== null && children !== void 0 ? children : /*#__PURE__*/jsx(Content$1, {})
|
|
9791
|
-
})
|
|
9792
|
-
})
|
|
9793
|
-
}));
|
|
9794
|
-
});
|
|
9795
|
-
var ContentWrapper = observer(function (_ref2) {
|
|
9796
|
-
var children = _ref2.children;
|
|
9797
|
-
var ref = useRef(null);
|
|
9798
|
-
var context = useDivaCoreContext();
|
|
9799
|
-
useEffect(function () {
|
|
9800
|
-
if (ref.current) context.contentStore.setContainer(ref.current);
|
|
9801
|
-
}, [ref.current]);
|
|
9802
|
-
return /*#__PURE__*/jsx(StylesProvider, {
|
|
9803
|
-
injectFirst: true,
|
|
9804
|
-
children: /*#__PURE__*/jsx("div", {
|
|
9805
|
-
ref: ref,
|
|
9806
|
-
id: "DivaCore",
|
|
9807
|
-
style: {
|
|
9808
|
-
position: 'relative',
|
|
9809
|
-
height: '100%',
|
|
9810
|
-
overflow: 'hidden'
|
|
9811
|
-
},
|
|
9812
|
-
children: /*#__PURE__*/jsx(I18nextProvider, {
|
|
9813
|
-
i18n: instance,
|
|
9814
|
-
children: /*#__PURE__*/jsx(ErrorBoundary, {
|
|
9815
|
-
root: context,
|
|
9816
|
-
children: /*#__PURE__*/jsx(MuiThemeProvider, {
|
|
9817
|
-
theme: context.contentStore.materialUiTheme,
|
|
9818
|
-
children: /*#__PURE__*/jsx(Suspense, {
|
|
9819
|
-
fallback: /*#__PURE__*/jsx(Fallback, {}),
|
|
9820
|
-
children: children
|
|
9821
|
-
})
|
|
9822
|
-
})
|
|
9823
|
-
})
|
|
9824
|
-
})
|
|
9825
|
-
})
|
|
9826
|
-
});
|
|
9827
|
-
});
|
|
9917
|
+
var Content = observer(ContentComponent);
|
|
9828
9918
|
|
|
9829
9919
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
9830
9920
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
9831
9921
|
var LOG$1 = getLogger('Framework', 'ProductHandler');
|
|
9832
9922
|
var ProductHandler = /*#__PURE__*/function (_ProductHandlerAbstra) {
|
|
9833
|
-
function ProductHandler(root) {
|
|
9923
|
+
function ProductHandler(root, openModal, closeModal) {
|
|
9834
9924
|
var _this;
|
|
9835
9925
|
_classCallCheck(this, ProductHandler);
|
|
9836
|
-
_this = _callSuper(this, ProductHandler, [LOG$1, root.t,
|
|
9926
|
+
_this = _callSuper(this, ProductHandler, [LOG$1, root.t, openModal, closeModal]);
|
|
9837
9927
|
_this.root = root;
|
|
9838
9928
|
return _this;
|
|
9839
9929
|
}
|
|
@@ -9841,33 +9931,32 @@ var ProductHandler = /*#__PURE__*/function (_ProductHandlerAbstra) {
|
|
|
9841
9931
|
return _createClass(ProductHandler, [{
|
|
9842
9932
|
key: "catalogService",
|
|
9843
9933
|
get: function get() {
|
|
9844
|
-
return this.root.
|
|
9934
|
+
return this.root.apiConfig.catalogService;
|
|
9845
9935
|
}
|
|
9846
9936
|
}, {
|
|
9847
9937
|
key: "mediaService",
|
|
9848
9938
|
get: function get() {
|
|
9849
|
-
return this.root.
|
|
9939
|
+
return this.root.apiConfig.mediaService;
|
|
9850
9940
|
}
|
|
9851
9941
|
}, {
|
|
9852
9942
|
key: "organization",
|
|
9853
9943
|
get: function get() {
|
|
9854
|
-
return this.root.
|
|
9944
|
+
return this.root.organization;
|
|
9855
9945
|
}
|
|
9856
9946
|
}, {
|
|
9857
9947
|
key: "user",
|
|
9858
9948
|
get: function get() {
|
|
9859
|
-
return this.root.
|
|
9949
|
+
return this.root.user;
|
|
9860
9950
|
}
|
|
9861
9951
|
}, {
|
|
9862
9952
|
key: "langs",
|
|
9863
9953
|
get: function get() {
|
|
9864
|
-
|
|
9865
|
-
return (_this$root$configurat = (_this$root$configurat2 = this.root.configurationStore.locales) === null || _this$root$configurat2 === void 0 ? void 0 : _this$root$configurat2.available) !== null && _this$root$configurat !== void 0 ? _this$root$configurat : ['de'];
|
|
9954
|
+
return this.root.languages;
|
|
9866
9955
|
}
|
|
9867
9956
|
}, {
|
|
9868
9957
|
key: "jwt",
|
|
9869
9958
|
get: function get() {
|
|
9870
|
-
return this.root.
|
|
9959
|
+
return this.root.jwt;
|
|
9871
9960
|
}
|
|
9872
9961
|
}, {
|
|
9873
9962
|
key: "saveProductMedia",
|
|
@@ -9939,6 +10028,668 @@ function HelpButton(_ref) {
|
|
|
9939
10028
|
});
|
|
9940
10029
|
}
|
|
9941
10030
|
|
|
10031
|
+
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; }
|
|
10032
|
+
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; }
|
|
10033
|
+
var actionFunctions = ['openComponent', 'closeComponentInFullscreen', 'setAbsoluteFullScreen', 'updateBreadcrumbs', 'openModal', 'closeModal', 'sendEmail', 'updateCustomLogo', 'updateCustomHeaderElement', 'toggleHidePrices', 'toggleLoading', 'changeLanguage', 'changeLoginMode', 'onEvent', 'subscribeEvents', 'unSubscribeEvents', 'setOrganization', 'getSessionGuid', 'getApi2AuthLoginData', 'logout', 'showLoginWindow', 'userHasPermission', 'openFullscreen', 'closeFullscreen', 'openSideMenu', 'closeSideMenu', 'openBarrier', 'updateHeaderInfos', 'openBanner', 'closeBanner', 'resolveComponent', 'openSnackBar', 'setComponentChange'];
|
|
10034
|
+
function getRender(C) {
|
|
10035
|
+
return function (args) {
|
|
10036
|
+
return /*#__PURE__*/jsx(DivaMockProvider, {
|
|
10037
|
+
state: args.state,
|
|
10038
|
+
actions: actions.apply(void 0, actionFunctions),
|
|
10039
|
+
children: /*#__PURE__*/jsx(C, _objectSpread$1({}, args))
|
|
10040
|
+
});
|
|
10041
|
+
};
|
|
10042
|
+
}
|
|
10043
|
+
var argTypes = {
|
|
10044
|
+
divaParams: {
|
|
10045
|
+
control: {
|
|
10046
|
+
name: 'Overwrite Diva State',
|
|
10047
|
+
control: 'object'
|
|
10048
|
+
}
|
|
10049
|
+
}
|
|
10050
|
+
};
|
|
10051
|
+
var storyBookCoreMock = {
|
|
10052
|
+
getRender: getRender,
|
|
10053
|
+
argTypes: argTypes
|
|
10054
|
+
};
|
|
10055
|
+
|
|
10056
|
+
function ownKeys(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; }
|
|
10057
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
10058
|
+
var DivaMockProvider = observer(function (_ref) {
|
|
10059
|
+
var children = _ref.children,
|
|
10060
|
+
state = _ref.state,
|
|
10061
|
+
actions = _ref.actions;
|
|
10062
|
+
var _React$useState = React.useState(false),
|
|
10063
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
10064
|
+
initalized = _React$useState2[0],
|
|
10065
|
+
setInitalized = _React$useState2[1];
|
|
10066
|
+
var _useState = useState(null),
|
|
10067
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
10068
|
+
store = _useState2[0],
|
|
10069
|
+
setStore = _useState2[1];
|
|
10070
|
+
var _useState3 = useState(null),
|
|
10071
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
10072
|
+
resizeObserver = _useState4[0],
|
|
10073
|
+
setResizeObserver = _useState4[1];
|
|
10074
|
+
var ref = useCallback(function (node) {
|
|
10075
|
+
if (node !== null) {
|
|
10076
|
+
var newStore = new MockedRootStore(state, actions, node, function () {
|
|
10077
|
+
return setInitalized(true);
|
|
10078
|
+
});
|
|
10079
|
+
setStore(newStore);
|
|
10080
|
+
if (resizeObserver) {
|
|
10081
|
+
resizeObserver.disconnect();
|
|
10082
|
+
}
|
|
10083
|
+
registerResizeObserver(node, newStore.onResize.bind(newStore)).then(function (observer) {
|
|
10084
|
+
setResizeObserver(observer);
|
|
10085
|
+
});
|
|
10086
|
+
}
|
|
10087
|
+
}, [state, actions]);
|
|
10088
|
+
var isMobile = !!(store !== null && store !== void 0 && store.dimensions.isMobile);
|
|
10089
|
+
var isPortrait = !!(store !== null && store !== void 0 && store.dimensions.isPortrait);
|
|
10090
|
+
return /*#__PURE__*/jsxs("div", {
|
|
10091
|
+
ref: ref,
|
|
10092
|
+
id: "DivaCore",
|
|
10093
|
+
style: {
|
|
10094
|
+
position: 'relative',
|
|
10095
|
+
height: '100%',
|
|
10096
|
+
overflow: 'hidden'
|
|
10097
|
+
},
|
|
10098
|
+
className: (isPortrait ? ' portrait' : '') + (isMobile ? ' mobile' : '') + (isMobile && !isPortrait ? ' landscape' : ''),
|
|
10099
|
+
children: [initalized && !!store && /*#__PURE__*/jsx(coreContext.Provider, {
|
|
10100
|
+
value: {
|
|
10101
|
+
context: store.state
|
|
10102
|
+
},
|
|
10103
|
+
children: /*#__PURE__*/jsx(I18nextProvider, {
|
|
10104
|
+
i18n: instance,
|
|
10105
|
+
children: /*#__PURE__*/jsx(Suspense, {
|
|
10106
|
+
fallback: /*#__PURE__*/jsx("div", {
|
|
10107
|
+
children: "Loading..."
|
|
10108
|
+
}),
|
|
10109
|
+
children: children
|
|
10110
|
+
})
|
|
10111
|
+
})
|
|
10112
|
+
}), (!initalized || !store) && /*#__PURE__*/jsx("div", {
|
|
10113
|
+
children: "Loading..."
|
|
10114
|
+
})]
|
|
10115
|
+
});
|
|
10116
|
+
});
|
|
10117
|
+
var MockedRootStore = /*#__PURE__*/function () {
|
|
10118
|
+
function MockedRootStore() {
|
|
10119
|
+
var data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
10120
|
+
var actions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
10121
|
+
var container = arguments.length > 2 ? arguments[2] : undefined;
|
|
10122
|
+
var initalized = arguments.length > 3 ? arguments[3] : undefined;
|
|
10123
|
+
_classCallCheck(this, MockedRootStore);
|
|
10124
|
+
this.data = data;
|
|
10125
|
+
this.actions = actions;
|
|
10126
|
+
this.container = container;
|
|
10127
|
+
this.initalized = initalized;
|
|
10128
|
+
_defineProperty(this, "handlers", void 0);
|
|
10129
|
+
_defineProperty(this, "_apiHandler", void 0);
|
|
10130
|
+
_defineProperty(this, "_dimensions", {
|
|
10131
|
+
isMobile: false,
|
|
10132
|
+
isPortrait: false,
|
|
10133
|
+
isTablet: false,
|
|
10134
|
+
width: 0,
|
|
10135
|
+
height: 0
|
|
10136
|
+
});
|
|
10137
|
+
_defineProperty(this, "_language", 'de');
|
|
10138
|
+
_defineProperty(this, "t", instance.t.bind(instance));
|
|
10139
|
+
this._apiHandler = new ApiHandler(this);
|
|
10140
|
+
this.handlers = mockCoreHandlers(this);
|
|
10141
|
+
this.initialize();
|
|
10142
|
+
makeObservable(this, {
|
|
10143
|
+
dimensions: computed,
|
|
10144
|
+
_dimensions: observable.shallow,
|
|
10145
|
+
onResize: action
|
|
10146
|
+
});
|
|
10147
|
+
}
|
|
10148
|
+
return _createClass(MockedRootStore, [{
|
|
10149
|
+
key: "onResize",
|
|
10150
|
+
value: function onResize(width, height) {
|
|
10151
|
+
this._dimensions = calculateDimensions(width, height);
|
|
10152
|
+
console.log('new dimensions', this._dimensions);
|
|
10153
|
+
}
|
|
10154
|
+
}, {
|
|
10155
|
+
key: "initialize",
|
|
10156
|
+
value: function () {
|
|
10157
|
+
var _initialize = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
10158
|
+
var _this$data$language;
|
|
10159
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
10160
|
+
while (1) switch (_context.prev = _context.next) {
|
|
10161
|
+
case 0:
|
|
10162
|
+
if (this.data.priceFormat) DivaUtils.initPriceFormat(this.data.priceFormat);
|
|
10163
|
+
updateCssThemeVariables(this.container, this.theme);
|
|
10164
|
+
_context.next = 4;
|
|
10165
|
+
return init(_objectSpread(_objectSpread({}, this.data.locales), {}, {
|
|
10166
|
+
apiConfig: this.apiConfig,
|
|
10167
|
+
defaultLng: (_this$data$language = this.data.language) !== null && _this$data$language !== void 0 ? _this$data$language : this.language
|
|
10168
|
+
}));
|
|
10169
|
+
case 4:
|
|
10170
|
+
this._language = _context.sent;
|
|
10171
|
+
this.initalized();
|
|
10172
|
+
case 6:
|
|
10173
|
+
case "end":
|
|
10174
|
+
return _context.stop();
|
|
10175
|
+
}
|
|
10176
|
+
}, _callee, this);
|
|
10177
|
+
}));
|
|
10178
|
+
function initialize() {
|
|
10179
|
+
return _initialize.apply(this, arguments);
|
|
10180
|
+
}
|
|
10181
|
+
return initialize;
|
|
10182
|
+
}()
|
|
10183
|
+
}, {
|
|
10184
|
+
key: "changeLanguage",
|
|
10185
|
+
value: function changeLanguage(lang) {
|
|
10186
|
+
var _this = this;
|
|
10187
|
+
instance.changeLanguage(lang, function (err) {
|
|
10188
|
+
if (err) {
|
|
10189
|
+
throw new Error('Could not change language', {
|
|
10190
|
+
cause: err
|
|
10191
|
+
});
|
|
10192
|
+
} else {
|
|
10193
|
+
_this._language = lang;
|
|
10194
|
+
}
|
|
10195
|
+
});
|
|
10196
|
+
}
|
|
10197
|
+
}, {
|
|
10198
|
+
key: "changeLoginMode",
|
|
10199
|
+
value: function changeLoginMode(loginMode) {
|
|
10200
|
+
if (this.actions.changeLoginMode) {
|
|
10201
|
+
this.actions.changeLoginMode(loginMode);
|
|
10202
|
+
} else {
|
|
10203
|
+
throw new Error('Method not implemented.');
|
|
10204
|
+
}
|
|
10205
|
+
}
|
|
10206
|
+
}, {
|
|
10207
|
+
key: "onExternalEvent",
|
|
10208
|
+
value: function onExternalEvent(event) {
|
|
10209
|
+
if (this.actions.onEvent) {
|
|
10210
|
+
this.actions.onEvent(event);
|
|
10211
|
+
} else {
|
|
10212
|
+
throw new Error('Method not implemented.');
|
|
10213
|
+
}
|
|
10214
|
+
}
|
|
10215
|
+
}, {
|
|
10216
|
+
key: "subscribeEvents",
|
|
10217
|
+
value: function subscribeEvents(fn) {
|
|
10218
|
+
if (this.actions.subscribeEvents) {
|
|
10219
|
+
this.actions.subscribeEvents(fn);
|
|
10220
|
+
} else {
|
|
10221
|
+
throw new Error('Method not implemented.');
|
|
10222
|
+
}
|
|
10223
|
+
}
|
|
10224
|
+
}, {
|
|
10225
|
+
key: "unSubscribeEvents",
|
|
10226
|
+
value: function unSubscribeEvents(fn) {
|
|
10227
|
+
if (this.actions.unSubscribeEvents) {
|
|
10228
|
+
this.actions.unSubscribeEvents(fn);
|
|
10229
|
+
} else {
|
|
10230
|
+
throw new Error('Method not implemented.');
|
|
10231
|
+
}
|
|
10232
|
+
}
|
|
10233
|
+
}, {
|
|
10234
|
+
key: "onEvent",
|
|
10235
|
+
value: function onEvent(event) {
|
|
10236
|
+
if (this.actions.onEvent) {
|
|
10237
|
+
this.actions.onEvent(event);
|
|
10238
|
+
} else {
|
|
10239
|
+
throw new Error('Method not implemented.');
|
|
10240
|
+
}
|
|
10241
|
+
}
|
|
10242
|
+
}, {
|
|
10243
|
+
key: "language",
|
|
10244
|
+
get: function get() {
|
|
10245
|
+
return this._language;
|
|
10246
|
+
}
|
|
10247
|
+
}, {
|
|
10248
|
+
key: "loginMode",
|
|
10249
|
+
get: function get() {
|
|
10250
|
+
var _this$data$loginMode;
|
|
10251
|
+
return (_this$data$loginMode = this.data.loginMode) !== null && _this$data$loginMode !== void 0 ? _this$data$loginMode : 'offline';
|
|
10252
|
+
}
|
|
10253
|
+
}, {
|
|
10254
|
+
key: "languages",
|
|
10255
|
+
get: function get() {
|
|
10256
|
+
var _this$data$availableL;
|
|
10257
|
+
return (_this$data$availableL = this.data.availableLanguages) !== null && _this$data$availableL !== void 0 ? _this$data$availableL : ['de', 'en', 'fr', 'it'];
|
|
10258
|
+
}
|
|
10259
|
+
}, {
|
|
10260
|
+
key: "initializing",
|
|
10261
|
+
get: function get() {
|
|
10262
|
+
var _this$data$initializi;
|
|
10263
|
+
return (_this$data$initializi = this.data.initializing) !== null && _this$data$initializi !== void 0 ? _this$data$initializi : false;
|
|
10264
|
+
}
|
|
10265
|
+
}, {
|
|
10266
|
+
key: "aviailableComponents",
|
|
10267
|
+
get: function get() {
|
|
10268
|
+
var _this$data$availableC;
|
|
10269
|
+
return (_this$data$availableC = this.data.availableComponents) !== null && _this$data$availableC !== void 0 ? _this$data$availableC : [];
|
|
10270
|
+
}
|
|
10271
|
+
}, {
|
|
10272
|
+
key: "apiConfig",
|
|
10273
|
+
get: function get() {
|
|
10274
|
+
return parseApiConfig(this.data.apiConfig, {
|
|
10275
|
+
baseUrl: 'https://api-dev.diva-portal.com'
|
|
10276
|
+
}, this.organization);
|
|
10277
|
+
}
|
|
10278
|
+
}, {
|
|
10279
|
+
key: "navigationConfiguration",
|
|
10280
|
+
get: function get() {
|
|
10281
|
+
var _this$data$navigation;
|
|
10282
|
+
return (_this$data$navigation = this.data.navigationConfiguration) !== null && _this$data$navigation !== void 0 ? _this$data$navigation : {
|
|
10283
|
+
showFooter: true,
|
|
10284
|
+
allowHidePrices: true,
|
|
10285
|
+
showLogin: true,
|
|
10286
|
+
buttons: []
|
|
10287
|
+
};
|
|
10288
|
+
}
|
|
10289
|
+
}, {
|
|
10290
|
+
key: "apiHandler",
|
|
10291
|
+
get: function get() {
|
|
10292
|
+
return this._apiHandler;
|
|
10293
|
+
}
|
|
10294
|
+
}, {
|
|
10295
|
+
key: "productHandler",
|
|
10296
|
+
get: function get() {
|
|
10297
|
+
return this.handlers.productHandler;
|
|
10298
|
+
}
|
|
10299
|
+
}, {
|
|
10300
|
+
key: "contentItemHandler",
|
|
10301
|
+
get: function get() {
|
|
10302
|
+
return this.handlers.contentItemHandler;
|
|
10303
|
+
}
|
|
10304
|
+
}, {
|
|
10305
|
+
key: "organizationHandler",
|
|
10306
|
+
get: function get() {
|
|
10307
|
+
return this.handlers.organizationHandler;
|
|
10308
|
+
}
|
|
10309
|
+
}, {
|
|
10310
|
+
key: "mediaHandler",
|
|
10311
|
+
get: function get() {
|
|
10312
|
+
return this.handlers.mediaHandler;
|
|
10313
|
+
}
|
|
10314
|
+
}, {
|
|
10315
|
+
key: "adminHandler",
|
|
10316
|
+
get: function get() {
|
|
10317
|
+
return this.handlers.adminHandler;
|
|
10318
|
+
}
|
|
10319
|
+
}, {
|
|
10320
|
+
key: "authorizationHandler",
|
|
10321
|
+
get: function get() {
|
|
10322
|
+
return this.handlers.authorizationHandler;
|
|
10323
|
+
}
|
|
10324
|
+
}, {
|
|
10325
|
+
key: "analyticsHandler",
|
|
10326
|
+
get: function get() {
|
|
10327
|
+
return this.handlers.analyticsHandler;
|
|
10328
|
+
}
|
|
10329
|
+
}, {
|
|
10330
|
+
key: "reportHandler",
|
|
10331
|
+
get: function get() {
|
|
10332
|
+
return this.handlers.reportHandler;
|
|
10333
|
+
}
|
|
10334
|
+
}, {
|
|
10335
|
+
key: "supportHandler",
|
|
10336
|
+
get: function get() {
|
|
10337
|
+
return this.handlers.supportHandler;
|
|
10338
|
+
}
|
|
10339
|
+
}, {
|
|
10340
|
+
key: "clientArticleHandler",
|
|
10341
|
+
get: function get() {
|
|
10342
|
+
return this.handlers.clientArticleHandler;
|
|
10343
|
+
}
|
|
10344
|
+
}, {
|
|
10345
|
+
key: "doShowInitWarnBanner",
|
|
10346
|
+
get: function get() {
|
|
10347
|
+
return false;
|
|
10348
|
+
}
|
|
10349
|
+
}, {
|
|
10350
|
+
key: "jwt",
|
|
10351
|
+
get: function get() {
|
|
10352
|
+
return this.data.jwt;
|
|
10353
|
+
}
|
|
10354
|
+
}, {
|
|
10355
|
+
key: "storedNToken",
|
|
10356
|
+
get: function get() {
|
|
10357
|
+
return this.data.nToken;
|
|
10358
|
+
}
|
|
10359
|
+
}, {
|
|
10360
|
+
key: "user",
|
|
10361
|
+
get: function get() {
|
|
10362
|
+
return this.data.user;
|
|
10363
|
+
}
|
|
10364
|
+
}, {
|
|
10365
|
+
key: "organization",
|
|
10366
|
+
get: function get() {
|
|
10367
|
+
var _this$data$organizati;
|
|
10368
|
+
return (_this$data$organizati = this.data.organization) !== null && _this$data$organizati !== void 0 ? _this$data$organizati : {
|
|
10369
|
+
_id: 'test',
|
|
10370
|
+
street: 'Teststreet',
|
|
10371
|
+
city: 'Testcity',
|
|
10372
|
+
region: 'Testregion',
|
|
10373
|
+
zipCode: '1234',
|
|
10374
|
+
countryCode: 'IT',
|
|
10375
|
+
phone: '000',
|
|
10376
|
+
email: 'test@example.com',
|
|
10377
|
+
settings: {
|
|
10378
|
+
defaultCurrency: 'EUR',
|
|
10379
|
+
useCatalogTranslations: 'DEFAULT'
|
|
10380
|
+
}
|
|
10381
|
+
};
|
|
10382
|
+
}
|
|
10383
|
+
}, {
|
|
10384
|
+
key: "organizationHierarchy",
|
|
10385
|
+
get: function get() {
|
|
10386
|
+
var _this$data$organizati2;
|
|
10387
|
+
return (_this$data$organizati2 = this.data.organizationHierarchy) !== null && _this$data$organizati2 !== void 0 ? _this$data$organizati2 : [];
|
|
10388
|
+
}
|
|
10389
|
+
}, {
|
|
10390
|
+
key: "allowedOrganizationTypes",
|
|
10391
|
+
get: function get() {
|
|
10392
|
+
return ['RETAILER'];
|
|
10393
|
+
}
|
|
10394
|
+
}, {
|
|
10395
|
+
key: "validOrganizations",
|
|
10396
|
+
get: function get() {
|
|
10397
|
+
return undefined;
|
|
10398
|
+
}
|
|
10399
|
+
}, {
|
|
10400
|
+
key: "dimensions",
|
|
10401
|
+
get: function get() {
|
|
10402
|
+
var _this$data$dimensions;
|
|
10403
|
+
return (_this$data$dimensions = this.data.dimensions) !== null && _this$data$dimensions !== void 0 ? _this$data$dimensions : this._dimensions;
|
|
10404
|
+
}
|
|
10405
|
+
}, {
|
|
10406
|
+
key: "headerInfos",
|
|
10407
|
+
get: function get() {
|
|
10408
|
+
var _this$data$headerInfo;
|
|
10409
|
+
return (_this$data$headerInfo = this.data.headerInfos) !== null && _this$data$headerInfo !== void 0 ? _this$data$headerInfo : {
|
|
10410
|
+
visible: false
|
|
10411
|
+
};
|
|
10412
|
+
}
|
|
10413
|
+
}, {
|
|
10414
|
+
key: "theme",
|
|
10415
|
+
get: function get() {
|
|
10416
|
+
var _this$data$theme$pale, _this$data$theme, _this$data$theme$pale2, _this$data$theme2, _this$data$theme$pale3, _this$data$theme3, _this$data$theme$pale4, _this$data$theme4, _ref2, _this$data$theme$pale5, _this$data$theme5, _this$data$theme6, _ref3, _this$data$theme$pale6, _this$data$theme7, _this$data$theme8, _ref4, _this$data$theme$pale7, _this$data$theme9, _this$data$theme10, _ref5, _this$data$theme$pale8, _this$data$theme11, _this$data$theme12, _this$data$theme$pale9, _this$data$theme13, _this$data$theme$pale10, _this$data$theme14, _this$data$theme$typo, _this$data$theme15;
|
|
10417
|
+
return {
|
|
10418
|
+
palette: {
|
|
10419
|
+
primary: {
|
|
10420
|
+
main: (_this$data$theme$pale = (_this$data$theme = this.data.theme) === null || _this$data$theme === void 0 || (_this$data$theme = _this$data$theme.palette) === null || _this$data$theme === void 0 || (_this$data$theme = _this$data$theme.primary) === null || _this$data$theme === void 0 ? void 0 : _this$data$theme.main) !== null && _this$data$theme$pale !== void 0 ? _this$data$theme$pale : defaultTheme.palette.primary.main,
|
|
10421
|
+
light: (_this$data$theme$pale2 = (_this$data$theme2 = this.data.theme) === null || _this$data$theme2 === void 0 || (_this$data$theme2 = _this$data$theme2.palette) === null || _this$data$theme2 === void 0 || (_this$data$theme2 = _this$data$theme2.primary) === null || _this$data$theme2 === void 0 ? void 0 : _this$data$theme2.light) !== null && _this$data$theme$pale2 !== void 0 ? _this$data$theme$pale2 : defaultTheme.palette.primary.light,
|
|
10422
|
+
dark: (_this$data$theme$pale3 = (_this$data$theme3 = this.data.theme) === null || _this$data$theme3 === void 0 || (_this$data$theme3 = _this$data$theme3.palette) === null || _this$data$theme3 === void 0 || (_this$data$theme3 = _this$data$theme3.primary) === null || _this$data$theme3 === void 0 ? void 0 : _this$data$theme3.dark) !== null && _this$data$theme$pale3 !== void 0 ? _this$data$theme$pale3 : defaultTheme.palette.primary.dark,
|
|
10423
|
+
contrastText: (_this$data$theme$pale4 = (_this$data$theme4 = this.data.theme) === null || _this$data$theme4 === void 0 || (_this$data$theme4 = _this$data$theme4.palette) === null || _this$data$theme4 === void 0 || (_this$data$theme4 = _this$data$theme4.primary) === null || _this$data$theme4 === void 0 ? void 0 : _this$data$theme4.contrastText) !== null && _this$data$theme$pale4 !== void 0 ? _this$data$theme$pale4 : defaultTheme.palette.primary.contrastText
|
|
10424
|
+
},
|
|
10425
|
+
secondary: {
|
|
10426
|
+
main: (_ref2 = (_this$data$theme$pale5 = (_this$data$theme5 = this.data.theme) === null || _this$data$theme5 === void 0 || (_this$data$theme5 = _this$data$theme5.palette) === null || _this$data$theme5 === void 0 || (_this$data$theme5 = _this$data$theme5.secondary) === null || _this$data$theme5 === void 0 ? void 0 : _this$data$theme5.main) !== null && _this$data$theme$pale5 !== void 0 ? _this$data$theme$pale5 : (_this$data$theme6 = this.data.theme) === null || _this$data$theme6 === void 0 || (_this$data$theme6 = _this$data$theme6.palette) === null || _this$data$theme6 === void 0 || (_this$data$theme6 = _this$data$theme6.primary) === null || _this$data$theme6 === void 0 ? void 0 : _this$data$theme6.main) !== null && _ref2 !== void 0 ? _ref2 : defaultTheme.palette.secondary.main,
|
|
10427
|
+
light: (_ref3 = (_this$data$theme$pale6 = (_this$data$theme7 = this.data.theme) === null || _this$data$theme7 === void 0 || (_this$data$theme7 = _this$data$theme7.palette) === null || _this$data$theme7 === void 0 || (_this$data$theme7 = _this$data$theme7.secondary) === null || _this$data$theme7 === void 0 ? void 0 : _this$data$theme7.light) !== null && _this$data$theme$pale6 !== void 0 ? _this$data$theme$pale6 : (_this$data$theme8 = this.data.theme) === null || _this$data$theme8 === void 0 || (_this$data$theme8 = _this$data$theme8.palette) === null || _this$data$theme8 === void 0 || (_this$data$theme8 = _this$data$theme8.primary) === null || _this$data$theme8 === void 0 ? void 0 : _this$data$theme8.light) !== null && _ref3 !== void 0 ? _ref3 : defaultTheme.palette.secondary.light,
|
|
10428
|
+
dark: (_ref4 = (_this$data$theme$pale7 = (_this$data$theme9 = this.data.theme) === null || _this$data$theme9 === void 0 || (_this$data$theme9 = _this$data$theme9.palette) === null || _this$data$theme9 === void 0 || (_this$data$theme9 = _this$data$theme9.secondary) === null || _this$data$theme9 === void 0 ? void 0 : _this$data$theme9.dark) !== null && _this$data$theme$pale7 !== void 0 ? _this$data$theme$pale7 : (_this$data$theme10 = this.data.theme) === null || _this$data$theme10 === void 0 || (_this$data$theme10 = _this$data$theme10.palette) === null || _this$data$theme10 === void 0 || (_this$data$theme10 = _this$data$theme10.primary) === null || _this$data$theme10 === void 0 ? void 0 : _this$data$theme10.dark) !== null && _ref4 !== void 0 ? _ref4 : defaultTheme.palette.secondary.dark,
|
|
10429
|
+
contrastText: (_ref5 = (_this$data$theme$pale8 = (_this$data$theme11 = this.data.theme) === null || _this$data$theme11 === void 0 || (_this$data$theme11 = _this$data$theme11.palette) === null || _this$data$theme11 === void 0 || (_this$data$theme11 = _this$data$theme11.secondary) === null || _this$data$theme11 === void 0 ? void 0 : _this$data$theme11.contrastText) !== null && _this$data$theme$pale8 !== void 0 ? _this$data$theme$pale8 : (_this$data$theme12 = this.data.theme) === null || _this$data$theme12 === void 0 || (_this$data$theme12 = _this$data$theme12.palette) === null || _this$data$theme12 === void 0 || (_this$data$theme12 = _this$data$theme12.primary) === null || _this$data$theme12 === void 0 ? void 0 : _this$data$theme12.contrastText) !== null && _ref5 !== void 0 ? _ref5 : defaultTheme.palette.secondary.contrastText
|
|
10430
|
+
},
|
|
10431
|
+
text: {
|
|
10432
|
+
primary: (_this$data$theme$pale9 = (_this$data$theme13 = this.data.theme) === null || _this$data$theme13 === void 0 || (_this$data$theme13 = _this$data$theme13.palette) === null || _this$data$theme13 === void 0 || (_this$data$theme13 = _this$data$theme13.text) === null || _this$data$theme13 === void 0 ? void 0 : _this$data$theme13.primary) !== null && _this$data$theme$pale9 !== void 0 ? _this$data$theme$pale9 : defaultTheme.palette.text.primary,
|
|
10433
|
+
secondary: (_this$data$theme$pale10 = (_this$data$theme14 = this.data.theme) === null || _this$data$theme14 === void 0 || (_this$data$theme14 = _this$data$theme14.palette) === null || _this$data$theme14 === void 0 || (_this$data$theme14 = _this$data$theme14.text) === null || _this$data$theme14 === void 0 ? void 0 : _this$data$theme14.secondary) !== null && _this$data$theme$pale10 !== void 0 ? _this$data$theme$pale10 : defaultTheme.palette.text.secondary
|
|
10434
|
+
}
|
|
10435
|
+
},
|
|
10436
|
+
typography: {
|
|
10437
|
+
fontFamily: (_this$data$theme$typo = (_this$data$theme15 = this.data.theme) === null || _this$data$theme15 === void 0 || (_this$data$theme15 = _this$data$theme15.typography) === null || _this$data$theme15 === void 0 ? void 0 : _this$data$theme15.fontFamily) !== null && _this$data$theme$typo !== void 0 ? _this$data$theme$typo : defaultTheme.typography.fontFamily
|
|
10438
|
+
}
|
|
10439
|
+
};
|
|
10440
|
+
}
|
|
10441
|
+
}, {
|
|
10442
|
+
key: "state",
|
|
10443
|
+
get: function get() {
|
|
10444
|
+
var _this2 = this,
|
|
10445
|
+
_this$data$loading,
|
|
10446
|
+
_this$data$hidePrices,
|
|
10447
|
+
_this$data$applicatio,
|
|
10448
|
+
_this$data$isFullscre,
|
|
10449
|
+
_this$data$enableSupp;
|
|
10450
|
+
return {
|
|
10451
|
+
actions: {
|
|
10452
|
+
changeLanguage: this.changeLanguage.bind(this),
|
|
10453
|
+
changeLoginMode: this.changeLoginMode.bind(this),
|
|
10454
|
+
subscribeEvents: this.subscribeEvents.bind(this),
|
|
10455
|
+
unSubscribeEvents: this.unSubscribeEvents.bind(this),
|
|
10456
|
+
onEvent: this.onEvent.bind(this),
|
|
10457
|
+
openComponent: function openComponent(data) {
|
|
10458
|
+
if (_this2.actions.openComponent) {
|
|
10459
|
+
return _this2.actions.openComponent(data);
|
|
10460
|
+
} else {
|
|
10461
|
+
throw new Error('Method not implemented.');
|
|
10462
|
+
}
|
|
10463
|
+
},
|
|
10464
|
+
closeComponentInFullscreen: function closeComponentInFullscreen() {
|
|
10465
|
+
if (_this2.actions.closeComponentInFullscreen) {
|
|
10466
|
+
_this2.actions.closeComponentInFullscreen();
|
|
10467
|
+
} else {
|
|
10468
|
+
throw new Error('Method not implemented.');
|
|
10469
|
+
}
|
|
10470
|
+
},
|
|
10471
|
+
setAbsoluteFullScreen: function setAbsoluteFullScreen(val) {
|
|
10472
|
+
if (_this2.actions.setAbsoluteFullScreen) {
|
|
10473
|
+
_this2.actions.setAbsoluteFullScreen(val);
|
|
10474
|
+
} else {
|
|
10475
|
+
throw new Error('Method not implemented.');
|
|
10476
|
+
}
|
|
10477
|
+
},
|
|
10478
|
+
updateBreadcrumbs: function updateBreadcrumbs(params) {
|
|
10479
|
+
if (_this2.actions.updateBreadcrumbs) {
|
|
10480
|
+
_this2.actions.updateBreadcrumbs(params);
|
|
10481
|
+
} else {
|
|
10482
|
+
throw new Error('Method not implemented.');
|
|
10483
|
+
}
|
|
10484
|
+
},
|
|
10485
|
+
openModal: function openModal(data) {
|
|
10486
|
+
if (_this2.actions.openModal) {
|
|
10487
|
+
_this2.actions.openModal(data);
|
|
10488
|
+
} else {
|
|
10489
|
+
throw new Error('Method not implemented.');
|
|
10490
|
+
}
|
|
10491
|
+
},
|
|
10492
|
+
closeModal: function closeModal() {
|
|
10493
|
+
if (_this2.actions.closeModal) {
|
|
10494
|
+
_this2.actions.closeModal();
|
|
10495
|
+
} else {
|
|
10496
|
+
throw new Error('Method not implemented.');
|
|
10497
|
+
}
|
|
10498
|
+
},
|
|
10499
|
+
sendEmail: function sendEmail(data) {
|
|
10500
|
+
if (_this2.actions.sendEmail) {
|
|
10501
|
+
_this2.actions.sendEmail(data);
|
|
10502
|
+
} else {
|
|
10503
|
+
throw new Error('Method not implemented.');
|
|
10504
|
+
}
|
|
10505
|
+
},
|
|
10506
|
+
updateCustomLogo: function updateCustomLogo(components, logo) {
|
|
10507
|
+
if (_this2.actions.updateCustomLogo) {
|
|
10508
|
+
_this2.actions.updateCustomLogo(components, logo);
|
|
10509
|
+
} else {
|
|
10510
|
+
throw new Error('Method not implemented.');
|
|
10511
|
+
}
|
|
10512
|
+
},
|
|
10513
|
+
updateCustomHeaderElement: function updateCustomHeaderElement(components, element) {
|
|
10514
|
+
if (_this2.actions.updateCustomHeaderElement) {
|
|
10515
|
+
_this2.actions.updateCustomHeaderElement(components, element);
|
|
10516
|
+
} else {
|
|
10517
|
+
throw new Error('Method not implemented.');
|
|
10518
|
+
}
|
|
10519
|
+
},
|
|
10520
|
+
toggleHidePrices: function toggleHidePrices() {
|
|
10521
|
+
if (_this2.actions.toggleHidePrices) {
|
|
10522
|
+
_this2.actions.toggleHidePrices();
|
|
10523
|
+
} else {
|
|
10524
|
+
throw new Error('Method not implemented.');
|
|
10525
|
+
}
|
|
10526
|
+
},
|
|
10527
|
+
toggleLoading: function toggleLoading(id, hidden, toggle) {
|
|
10528
|
+
if (_this2.actions.toggleLoading) {
|
|
10529
|
+
_this2.actions.toggleLoading(id, hidden, toggle);
|
|
10530
|
+
} else {
|
|
10531
|
+
throw new Error('Method not implemented.');
|
|
10532
|
+
}
|
|
10533
|
+
},
|
|
10534
|
+
setOrganization: function setOrganization(organizationId) {
|
|
10535
|
+
if (_this2.actions.setOrganization) {
|
|
10536
|
+
_this2.actions.setOrganization(organizationId);
|
|
10537
|
+
} else {
|
|
10538
|
+
throw new Error('Method not implemented.');
|
|
10539
|
+
}
|
|
10540
|
+
},
|
|
10541
|
+
getSessionGuid: function getSessionGuid(userRole, loginMode, organizationId, api2Location) {
|
|
10542
|
+
if (_this2.actions.getSessionGuid) {
|
|
10543
|
+
return _this2.actions.getSessionGuid(userRole, loginMode, organizationId, api2Location);
|
|
10544
|
+
} else {
|
|
10545
|
+
throw new Error('Method not implemented.');
|
|
10546
|
+
}
|
|
10547
|
+
},
|
|
10548
|
+
getApi2AuthLoginData: function getApi2AuthLoginData(userRole, loginMode, organizationId, api2Location) {
|
|
10549
|
+
if (_this2.actions.getApi2AuthLoginData) {
|
|
10550
|
+
return _this2.actions.getApi2AuthLoginData(userRole, loginMode, organizationId, api2Location);
|
|
10551
|
+
} else {
|
|
10552
|
+
throw new Error('Method not implemented.');
|
|
10553
|
+
}
|
|
10554
|
+
},
|
|
10555
|
+
logout: function logout() {
|
|
10556
|
+
if (_this2.actions.logout) {
|
|
10557
|
+
_this2.actions.logout();
|
|
10558
|
+
} else {
|
|
10559
|
+
throw new Error('Method not implemented.');
|
|
10560
|
+
}
|
|
10561
|
+
},
|
|
10562
|
+
showLoginWindow: function showLoginWindow() {
|
|
10563
|
+
if (_this2.actions.showLoginWindow) {
|
|
10564
|
+
_this2.actions.showLoginWindow();
|
|
10565
|
+
} else {
|
|
10566
|
+
throw new Error('Method not implemented.');
|
|
10567
|
+
}
|
|
10568
|
+
},
|
|
10569
|
+
userHasPermission: function userHasPermission(permission) {
|
|
10570
|
+
if (_this2.actions.userHasPermission) {
|
|
10571
|
+
return _this2.actions.userHasPermission(permission);
|
|
10572
|
+
} else {
|
|
10573
|
+
throw new Error('Method not implemented.');
|
|
10574
|
+
}
|
|
10575
|
+
},
|
|
10576
|
+
openFullscreen: function openFullscreen(fullscreen) {
|
|
10577
|
+
if (_this2.actions.openFullscreen) {
|
|
10578
|
+
_this2.actions.openFullscreen(fullscreen);
|
|
10579
|
+
} else {
|
|
10580
|
+
throw new Error('Method not implemented.');
|
|
10581
|
+
}
|
|
10582
|
+
},
|
|
10583
|
+
closeFullscreen: function closeFullscreen() {
|
|
10584
|
+
if (_this2.actions.closeFullscreen) {
|
|
10585
|
+
_this2.actions.closeFullscreen();
|
|
10586
|
+
} else {
|
|
10587
|
+
throw new Error('Method not implemented.');
|
|
10588
|
+
}
|
|
10589
|
+
},
|
|
10590
|
+
openSideMenu: function openSideMenu(sideMenu) {
|
|
10591
|
+
if (_this2.actions.openSideMenu) {
|
|
10592
|
+
_this2.actions.openSideMenu(sideMenu);
|
|
10593
|
+
} else {
|
|
10594
|
+
throw new Error('Method not implemented.');
|
|
10595
|
+
}
|
|
10596
|
+
},
|
|
10597
|
+
closeSideMenu: function closeSideMenu() {
|
|
10598
|
+
if (_this2.actions.closeSideMenu) {
|
|
10599
|
+
_this2.actions.closeSideMenu();
|
|
10600
|
+
} else {
|
|
10601
|
+
throw new Error('Method not implemented.');
|
|
10602
|
+
}
|
|
10603
|
+
},
|
|
10604
|
+
openBarrier: function openBarrier(barrier) {
|
|
10605
|
+
if (_this2.actions.openBarrier) {
|
|
10606
|
+
_this2.actions.openBarrier(barrier);
|
|
10607
|
+
} else {
|
|
10608
|
+
throw new Error('Method not implemented.');
|
|
10609
|
+
}
|
|
10610
|
+
},
|
|
10611
|
+
updateHeaderInfos: function updateHeaderInfos(headerInfos) {
|
|
10612
|
+
if (_this2.actions.updateHeaderInfos) {
|
|
10613
|
+
_this2.actions.updateHeaderInfos(headerInfos);
|
|
10614
|
+
} else {
|
|
10615
|
+
throw new Error('Method not implemented.');
|
|
10616
|
+
}
|
|
10617
|
+
},
|
|
10618
|
+
openBanner: function openBanner(banner) {
|
|
10619
|
+
if (_this2.actions.openBanner) {
|
|
10620
|
+
_this2.actions.openBanner(banner);
|
|
10621
|
+
} else {
|
|
10622
|
+
throw new Error('Method not implemented.');
|
|
10623
|
+
}
|
|
10624
|
+
},
|
|
10625
|
+
closeBanner: function closeBanner() {
|
|
10626
|
+
if (_this2.actions.closeBanner) {
|
|
10627
|
+
_this2.actions.closeBanner();
|
|
10628
|
+
} else {
|
|
10629
|
+
throw new Error('Method not implemented.');
|
|
10630
|
+
}
|
|
10631
|
+
},
|
|
10632
|
+
resolveComponent: function resolveComponent(action) {
|
|
10633
|
+
if (_this2.actions.resolveComponent) {
|
|
10634
|
+
return _this2.actions.resolveComponent(action);
|
|
10635
|
+
} else {
|
|
10636
|
+
throw new Error('Method not implemented.');
|
|
10637
|
+
}
|
|
10638
|
+
},
|
|
10639
|
+
openSnackBar: function openSnackBar(data) {
|
|
10640
|
+
if (_this2.actions.openSnackBar) {
|
|
10641
|
+
_this2.actions.openSnackBar(data);
|
|
10642
|
+
} else {
|
|
10643
|
+
throw new Error('Method not implemented.');
|
|
10644
|
+
}
|
|
10645
|
+
},
|
|
10646
|
+
setComponentChange: function setComponentChange(value) {
|
|
10647
|
+
if (_this2.actions.setComponentChange) {
|
|
10648
|
+
_this2.actions.setComponentChange(value);
|
|
10649
|
+
} else {
|
|
10650
|
+
throw new Error('Method not implemented.');
|
|
10651
|
+
}
|
|
10652
|
+
}
|
|
10653
|
+
},
|
|
10654
|
+
state: _objectSpread(_objectSpread({}, this.data), {}, {
|
|
10655
|
+
apiConfig: this.apiConfig,
|
|
10656
|
+
availableLanguages: this.languages,
|
|
10657
|
+
loginMode: this.loginMode,
|
|
10658
|
+
availableComponents: this.aviailableComponents,
|
|
10659
|
+
initializing: this.initializing,
|
|
10660
|
+
organization: this.organization,
|
|
10661
|
+
organizationHierarchy: this.organizationHierarchy,
|
|
10662
|
+
navigationConfiguration: this.navigationConfiguration,
|
|
10663
|
+
loading: (_this$data$loading = this.data.loading) !== null && _this$data$loading !== void 0 ? _this$data$loading : false,
|
|
10664
|
+
hidePrices: (_this$data$hidePrices = this.data.hidePrices) !== null && _this$data$hidePrices !== void 0 ? _this$data$hidePrices : false,
|
|
10665
|
+
dimensions: this.dimensions,
|
|
10666
|
+
isMobile: this.dimensions.isMobile,
|
|
10667
|
+
headerInfos: this.headerInfos,
|
|
10668
|
+
theme: this.theme,
|
|
10669
|
+
applicationEnvironment: (_this$data$applicatio = this.data.applicationEnvironment) !== null && _this$data$applicatio !== void 0 ? _this$data$applicatio : 'WEB',
|
|
10670
|
+
isFullscreenComponent: (_this$data$isFullscre = this.data.isFullscreenComponent) !== null && _this$data$isFullscre !== void 0 ? _this$data$isFullscre : false,
|
|
10671
|
+
enableSupport: (_this$data$enableSupp = this.data.enableSupport) !== null && _this$data$enableSupp !== void 0 ? _this$data$enableSupp : false
|
|
10672
|
+
}),
|
|
10673
|
+
handler: this.handlers
|
|
10674
|
+
};
|
|
10675
|
+
}
|
|
10676
|
+
}]);
|
|
10677
|
+
}();
|
|
10678
|
+
function mockCoreHandlers(root) {
|
|
10679
|
+
return {
|
|
10680
|
+
productHandler: new ProductHandler(root),
|
|
10681
|
+
contentItemHandler: new ContentItemHandler(root),
|
|
10682
|
+
organizationHandler: new OrganizationHandler(root),
|
|
10683
|
+
mediaHandler: new MediaHandler(root),
|
|
10684
|
+
adminHandler: new AdminHandler(root),
|
|
10685
|
+
authorizationHandler: new AuthorizationHandler(root),
|
|
10686
|
+
analyticsHandler: new AnalyticsHandler(root),
|
|
10687
|
+
reportHandler: new ReportHandler(root),
|
|
10688
|
+
supportHandler: new SupportHandler(root),
|
|
10689
|
+
clientArticleHandler: new ClientArticleHandler(root)
|
|
10690
|
+
};
|
|
10691
|
+
}
|
|
10692
|
+
|
|
9942
10693
|
var LOG = getLogger('Framework', 'root');
|
|
9943
10694
|
LOG.startTransaction({
|
|
9944
10695
|
event: 'unitInit',
|
|
@@ -9956,4 +10707,4 @@ LOG.startTransaction({
|
|
|
9956
10707
|
});
|
|
9957
10708
|
window.DIVA_VERSION = "v".concat(process.env.VERSION);
|
|
9958
10709
|
|
|
9959
|
-
export { AuthorizationHandler as A, Button as B, Content
|
|
10710
|
+
export { AuthorizationHandler as A, Button as B, Content as C, DivaCore as D, HelpButton as H, Input as I, ONE_DAY_UNIX as O, ProductHandler as P, RequestStatus as R, SupportHandler as S, getLogger as a, separator as b, success as c, auth as d, error as e, loginBox as f, google as g, logoContainer as h, styleInject as i, useDivaCore as j, AnalyticsHandler as k, link as l, microsoft as m, OrganizationHandler as n, ClientArticleHandler as o, DivaMockProvider as p, storyBookCoreMock as q, resetInput as r, socialButton as s, useDivaCoreContext as u };
|