@crystaldesign/diva-core 25.13.0-beta.5 → 25.13.0-beta.50
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-d1c0b21b.js → ModalsWrapper-595326fc.js} +2 -2
- package/build/esm/{index-dd83cfdd.js → index-7769aab3.js} +18 -34
- package/build/esm/{index-4e661d87.js → index-f9d098d2.js} +286 -113
- package/build/esm/index.js +1 -1
- package/build/types/core/src/elements/Auth/Register/index.d.ts.map +1 -1
- package/build/types/core/src/elements/Auth/WelcomeScreen/index.d.ts.map +1 -1
- package/build/types/core/src/elements/Auth/index.d.ts.map +1 -1
- package/build/types/core/src/elements/Banner/index.d.ts.map +1 -1
- package/build/types/core/src/externalTypes.d.ts +10 -1
- package/build/types/core/src/externalTypes.d.ts.map +1 -1
- package/build/types/core/src/store/ConfigurationStore.d.ts +3 -1
- package/build/types/core/src/store/ConfigurationStore.d.ts.map +1 -1
- package/build/types/core/src/store/ContentStore.d.ts +1 -0
- package/build/types/core/src/store/ContentStore.d.ts.map +1 -1
- package/build/types/core/src/store/DataStore.d.ts +2 -1
- package/build/types/core/src/store/DataStore.d.ts.map +1 -1
- package/build/types/core/src/store/RootStore.d.ts.map +1 -1
- package/build/types/core/src/types.d.ts +2 -1
- package/build/types/core/src/types.d.ts.map +1 -1
- package/build/types/core/src/utils/dimensionsFunctions.d.ts.map +1 -1
- package/build/types/core/src/utils/i18n.d.ts +7 -1
- package/build/types/core/src/utils/i18n.d.ts.map +1 -1
- package/build/types/core/src/utils/parseApiConfig.d.ts.map +1 -1
- package/build/types/core/src/utils/swissGermanProcessor.d.ts +45 -0
- package/build/types/core/src/utils/swissGermanProcessor.d.ts.map +1 -0
- package/build/umd/124.diva-core.umd.min.js +2 -0
- package/build/umd/124.diva-core.umd.min.js.LICENSE.txt +1 -0
- package/build/umd/145.diva-core.umd.min.js +1 -1
- package/build/umd/272.diva-core.umd.min.js +2 -0
- package/build/umd/272.diva-core.umd.min.js.LICENSE.txt +1 -0
- package/build/umd/486.diva-core.umd.min.js +2 -0
- package/build/umd/486.diva-core.umd.min.js.LICENSE.txt +1 -0
- package/build/umd/{703.diva-core.umd.min.js → 558.diva-core.umd.min.js} +2 -2
- package/build/umd/558.diva-core.umd.min.js.LICENSE.txt +1 -0
- package/build/umd/803.diva-core.umd.min.js +2 -0
- package/build/umd/803.diva-core.umd.min.js.LICENSE.txt +1 -0
- package/build/umd/914.diva-core.umd.min.js +2 -0
- package/build/umd/914.diva-core.umd.min.js.LICENSE.txt +1 -0
- package/build/umd/diva-core.umd.min.js +1 -1
- package/build/umd/report.html +1 -1
- package/package.json +10 -10
- package/build/umd/373.diva-core.umd.min.js +0 -2
- package/build/umd/373.diva-core.umd.min.js.LICENSE.txt +0 -1
- package/build/umd/64.diva-core.umd.min.js +0 -2
- package/build/umd/64.diva-core.umd.min.js.LICENSE.txt +0 -1
- package/build/umd/703.diva-core.umd.min.js.LICENSE.txt +0 -1
- package/build/umd/759.diva-core.umd.min.js +0 -2
- package/build/umd/759.diva-core.umd.min.js.LICENSE.txt +0 -1
- package/build/umd/860.diva-core.umd.min.js +0 -2
- package/build/umd/860.diva-core.umd.min.js.LICENSE.txt +0 -1
- package/build/umd/940.diva-core.umd.min.js +0 -2
- package/build/umd/940.diva-core.umd.min.js.LICENSE.txt +0 -1
|
@@ -46,7 +46,7 @@ import { actions } from '@storybook/addon-actions';
|
|
|
46
46
|
import * as Styles from '@mui/styles';
|
|
47
47
|
|
|
48
48
|
(function() {
|
|
49
|
-
const env = {"STAGE":"production","VERSION":"25.13.0-beta.
|
|
49
|
+
const env = {"STAGE":"production","VERSION":"25.13.0-beta.50"};
|
|
50
50
|
try {
|
|
51
51
|
if (process) {
|
|
52
52
|
process.env = Object.assign({}, process.env);
|
|
@@ -711,7 +711,7 @@ function parseUrl(service, baseUrl) {
|
|
|
711
711
|
}
|
|
712
712
|
|
|
713
713
|
function parseApiConfig (config, defaultApiConfig, organization) {
|
|
714
|
-
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;
|
|
714
|
+
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$aiService, _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;
|
|
715
715
|
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';
|
|
716
716
|
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 : {};
|
|
717
717
|
var c = {
|
|
@@ -723,6 +723,7 @@ function parseApiConfig (config, defaultApiConfig, organization) {
|
|
|
723
723
|
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),
|
|
724
724
|
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),
|
|
725
725
|
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),
|
|
726
|
+
aiService: (_GLOBAL_ENV$aiService = GLOBAL_ENV.aiService) !== null && _GLOBAL_ENV$aiService !== void 0 ? _GLOBAL_ENV$aiService : getUrl('ai', config === null || config === void 0 ? void 0 : config.aiService, defaultApiConfig === null || defaultApiConfig === void 0 ? void 0 : defaultApiConfig.aiService, baseUrl),
|
|
726
727
|
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),
|
|
727
728
|
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),
|
|
728
729
|
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),
|
|
@@ -869,37 +870,68 @@ var ConfigurationStore = /*#__PURE__*/function () {
|
|
|
869
870
|
}, {
|
|
870
871
|
key: "theme",
|
|
871
872
|
get: function get() {
|
|
872
|
-
var _this$_configuration9,
|
|
873
|
+
var _this$_configuration9, _this$root$dataStore$, _ref, _orgTheme$main, _theme$palette, _ref2, _orgTheme$light, _theme$palette2, _ref3, _orgTheme$dark, _theme$palette3, _theme$palette$primar, _theme$palette4, _ref4, _ref5, _theme$palette$second, _theme$palette5, _theme$palette6, _ref6, _ref7, _theme$palette$second2, _theme$palette7, _theme$palette8, _ref8, _ref9, _theme$palette$second3, _theme$palette9, _theme$palette10, _ref10, _theme$palette$second4, _theme$palette11, _theme$palette12, _theme$palette$text$p, _theme$palette13, _theme$palette$text$s, _theme$palette14, _theme$typography$fon, _theme$typography, _theme$components;
|
|
873
874
|
var theme = (_this$_configuration9 = this._configuration) === null || _this$_configuration9 === void 0 ? void 0 : _this$_configuration9.theme;
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
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,
|
|
884
|
-
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,
|
|
885
|
-
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,
|
|
886
|
-
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
|
|
887
|
-
},
|
|
888
|
-
text: {
|
|
889
|
-
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,
|
|
890
|
-
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
|
|
891
|
-
}
|
|
875
|
+
var orgTheme = (_this$root$dataStore$ = this.root.dataStore.organization) === null || _this$root$dataStore$ === void 0 || (_this$root$dataStore$ = _this$root$dataStore$.settings) === null || _this$root$dataStore$ === void 0 ? void 0 : _this$root$dataStore$.theme;
|
|
876
|
+
|
|
877
|
+
// Apply organization theme overrides if they exist
|
|
878
|
+
var palette = {
|
|
879
|
+
primary: {
|
|
880
|
+
main: (_ref = (_orgTheme$main = orgTheme === null || orgTheme === void 0 ? void 0 : orgTheme.main) !== null && _orgTheme$main !== void 0 ? _orgTheme$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) !== null && _ref !== void 0 ? _ref : defaultTheme.palette.primary.main,
|
|
881
|
+
light: (_ref2 = (_orgTheme$light = orgTheme === null || orgTheme === void 0 ? void 0 : orgTheme.light) !== null && _orgTheme$light !== void 0 ? _orgTheme$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) !== null && _ref2 !== void 0 ? _ref2 : defaultTheme.palette.primary.light,
|
|
882
|
+
dark: (_ref3 = (_orgTheme$dark = orgTheme === null || orgTheme === void 0 ? void 0 : orgTheme.dark) !== null && _orgTheme$dark !== void 0 ? _orgTheme$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) !== null && _ref3 !== void 0 ? _ref3 : defaultTheme.palette.primary.dark,
|
|
883
|
+
contrastText: (_theme$palette$primar = 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$primar !== void 0 ? _theme$palette$primar : defaultTheme.palette.primary.contrastText
|
|
892
884
|
},
|
|
893
|
-
|
|
894
|
-
|
|
885
|
+
secondary: {
|
|
886
|
+
main: (_ref4 = (_ref5 = (_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 : orgTheme === null || orgTheme === void 0 ? void 0 : orgTheme.main) !== null && _ref5 !== void 0 ? _ref5 : 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 && _ref4 !== void 0 ? _ref4 : defaultTheme.palette.secondary.main,
|
|
887
|
+
light: (_ref6 = (_ref7 = (_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 : orgTheme === null || orgTheme === void 0 ? void 0 : orgTheme.light) !== null && _ref7 !== void 0 ? _ref7 : 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 && _ref6 !== void 0 ? _ref6 : defaultTheme.palette.secondary.light,
|
|
888
|
+
dark: (_ref8 = (_ref9 = (_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 : orgTheme === null || orgTheme === void 0 ? void 0 : orgTheme.dark) !== null && _ref9 !== void 0 ? _ref9 : 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 && _ref8 !== void 0 ? _ref8 : defaultTheme.palette.secondary.dark,
|
|
889
|
+
contrastText: (_ref10 = (_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 && _ref10 !== void 0 ? _ref10 : defaultTheme.palette.secondary.contrastText
|
|
895
890
|
},
|
|
896
|
-
|
|
891
|
+
text: {
|
|
892
|
+
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,
|
|
893
|
+
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
|
|
894
|
+
}
|
|
895
|
+
};
|
|
896
|
+
var typography = {
|
|
897
|
+
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
|
|
898
|
+
};
|
|
899
|
+
var components = (_theme$components = theme === null || theme === void 0 ? void 0 : theme.components) !== null && _theme$components !== void 0 ? _theme$components : defaultTheme.components;
|
|
900
|
+
|
|
901
|
+
// Apply custom CSS variables if they exist
|
|
902
|
+
// Note: This is applied separately from the standard theme CSS variables
|
|
903
|
+
// which are handled by updateCssThemeVariables() in ContentStore
|
|
904
|
+
if (orgTheme !== null && orgTheme !== void 0 && orgTheme.customCssVariables && typeof document !== 'undefined') {
|
|
905
|
+
this.applyCustomCssVariables(orgTheme.customCssVariables);
|
|
906
|
+
}
|
|
907
|
+
return {
|
|
908
|
+
palette: palette,
|
|
909
|
+
typography: typography,
|
|
910
|
+
components: components
|
|
897
911
|
};
|
|
898
912
|
}
|
|
913
|
+
}, {
|
|
914
|
+
key: "applyCustomCssVariables",
|
|
915
|
+
value: function applyCustomCssVariables(customCssVariables) {
|
|
916
|
+
// Apply custom CSS variables to document root (already parsed in backend)
|
|
917
|
+
var root = document.documentElement;
|
|
918
|
+
|
|
919
|
+
// Apply custom variables without prefix
|
|
920
|
+
Object.entries(customCssVariables).forEach(function (_ref11) {
|
|
921
|
+
var _ref12 = _slicedToArray(_ref11, 2),
|
|
922
|
+
key = _ref12[0],
|
|
923
|
+
value = _ref12[1];
|
|
924
|
+
if (key && value) {
|
|
925
|
+
// Ensure variable name starts with --
|
|
926
|
+
var varName = key.startsWith('--') ? key : "--".concat(key);
|
|
927
|
+
root.style.setProperty(varName, value.trim());
|
|
928
|
+
}
|
|
929
|
+
});
|
|
930
|
+
}
|
|
899
931
|
}, {
|
|
900
932
|
key: "navigation",
|
|
901
933
|
get: function get() {
|
|
902
|
-
var _this$_configuration10, _this$_configuration11, _this$_configuration$, _this$_configuration12, _this$_configuration$2, _this$_configuration13, _this$_configuration14, _this$_configuration15, _this$_configuration16, _this$_configuration17, _this$_configuration18, _this$_configuration19, _this$_configuration20, _this$_configuration21, _this$_configuration22, _this$_configuration23, _this$_configuration24, _this$_configuration25, _this$_configuration26, _this$_configuration27, _this$root$dataStore
|
|
934
|
+
var _this$_configuration10, _this$_configuration11, _this$_configuration$, _this$_configuration12, _this$_configuration$2, _this$_configuration13, _this$_configuration14, _this$_configuration15, _this$_configuration16, _this$_configuration17, _this$_configuration18, _this$_configuration19, _this$_configuration20, _this$_configuration21, _this$_configuration22, _this$_configuration23, _this$_configuration24, _this$_configuration25, _this$_configuration26, _this$_configuration27, _this$root$dataStore$2, _this$_configuration28;
|
|
903
935
|
return {
|
|
904
936
|
buttons: ((_this$_configuration10 = this._configuration) === null || _this$_configuration10 === void 0 || (_this$_configuration10 = _this$_configuration10.navigation) === null || _this$_configuration10 === void 0 ? void 0 : _this$_configuration10.buttons) || [],
|
|
905
937
|
imprintUrl: (_this$_configuration11 = this._configuration) === null || _this$_configuration11 === void 0 || (_this$_configuration11 = _this$_configuration11.navigation) === null || _this$_configuration11 === void 0 ? void 0 : _this$_configuration11.imprintUrl,
|
|
@@ -919,7 +951,7 @@ var ConfigurationStore = /*#__PURE__*/function () {
|
|
|
919
951
|
qrCodeScanner: (_this$_configuration25 = this._configuration) === null || _this$_configuration25 === void 0 || (_this$_configuration25 = _this$_configuration25.navigation) === null || _this$_configuration25 === void 0 ? void 0 : _this$_configuration25.qrCodeScanner,
|
|
920
952
|
greetingsText: (_this$_configuration26 = this._configuration) === null || _this$_configuration26 === void 0 || (_this$_configuration26 = _this$_configuration26.navigation) === null || _this$_configuration26 === void 0 ? void 0 : _this$_configuration26.greetingsText,
|
|
921
953
|
showSnow: (_this$_configuration27 = this._configuration) === null || _this$_configuration27 === void 0 || (_this$_configuration27 = _this$_configuration27.navigation) === null || _this$_configuration27 === void 0 ? void 0 : _this$_configuration27.showSnow,
|
|
922
|
-
pricePreviewActive: ((_this$root$dataStore$ = this.root.dataStore.organization) === null || _this$root$dataStore$ === void 0 || (_this$root$dataStore$ = _this$root$dataStore
|
|
954
|
+
pricePreviewActive: ((_this$root$dataStore$2 = this.root.dataStore.organization) === null || _this$root$dataStore$2 === void 0 || (_this$root$dataStore$2 = _this$root$dataStore$2.settings) === null || _this$root$dataStore$2 === void 0 ? void 0 : _this$root$dataStore$2.pricePreview) && this.root.dataStore.organization.settings.pricePreview !== 'off' || ((_this$_configuration28 = this._configuration) === null || _this$_configuration28 === void 0 || (_this$_configuration28 = _this$_configuration28.components.available) === null || _this$_configuration28 === void 0 || (_this$_configuration28 = _this$_configuration28.find(function (c) {
|
|
923
955
|
return c.type === 'DIVA_WEBPLANNER';
|
|
924
956
|
})) === null || _this$_configuration28 === void 0 || (_this$_configuration28 = _this$_configuration28.settings) === null || _this$_configuration28 === void 0 || (_this$_configuration28 = _this$_configuration28.ViewConfig) === null || _this$_configuration28 === void 0 ? void 0 : _this$_configuration28.pricePreview)
|
|
925
957
|
};
|
|
@@ -1022,33 +1054,55 @@ var ConfigurationStore = /*#__PURE__*/function () {
|
|
|
1022
1054
|
}, {
|
|
1023
1055
|
key: "priceFormat",
|
|
1024
1056
|
get: function get() {
|
|
1025
|
-
var _this$
|
|
1057
|
+
var _this$root$dataStore$3,
|
|
1058
|
+
_this$_configuration55,
|
|
1059
|
+
_this = this;
|
|
1060
|
+
var fallbackPriceFormat = {
|
|
1061
|
+
currency: '€',
|
|
1062
|
+
spacing: true,
|
|
1063
|
+
currencyPosition: 'RIGHT',
|
|
1064
|
+
showDecimals: 'ALWAYS',
|
|
1065
|
+
thousandSeparator: '.',
|
|
1066
|
+
decimalSeparator: ',',
|
|
1067
|
+
decimalsDigits: 2
|
|
1068
|
+
};
|
|
1069
|
+
(_this$root$dataStore$3 = this.root.dataStore.organization) === null || _this$root$dataStore$3 === void 0 || (_this$root$dataStore$3 = _this$root$dataStore$3.settings) === null || _this$root$dataStore$3 === void 0 ? void 0 : _this$root$dataStore$3.defaultCurrency;
|
|
1026
1070
|
if ((_this$_configuration55 = this._configuration) !== null && _this$_configuration55 !== void 0 && _this$_configuration55.priceFormat) {
|
|
1027
|
-
var _this$_configuration56
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1071
|
+
var _this$_configuration56;
|
|
1072
|
+
if (Array.isArray((_this$_configuration56 = this._configuration) === null || _this$_configuration56 === void 0 ? void 0 : _this$_configuration56.priceFormat)) {
|
|
1073
|
+
var _this$_configuration$6, _this$_configuration57;
|
|
1074
|
+
return (_this$_configuration$6 = (_this$_configuration57 = this._configuration) === null || _this$_configuration57 === void 0 ? void 0 : _this$_configuration57.priceFormat.find(function (pf) {
|
|
1075
|
+
var _this$root$dataStore$4;
|
|
1076
|
+
return pf.currency === ((_this$root$dataStore$4 = _this.root.dataStore.organization) === null || _this$root$dataStore$4 === void 0 ? void 0 : _this$root$dataStore$4.settings.defaultCurrency);
|
|
1077
|
+
})) !== null && _this$_configuration$6 !== void 0 ? _this$_configuration$6 : _objectSpread$d(_objectSpread$d({}, fallbackPriceFormat), {}, {
|
|
1078
|
+
currency: this.root.dataStore.organization.settings.defaultCurrency
|
|
1079
|
+
});
|
|
1080
|
+
} else {
|
|
1081
|
+
var _this$_configuration58, _this$root$dataStore$5, _this$_configuration59;
|
|
1082
|
+
return _objectSpread$d(_objectSpread$d({}, (_this$_configuration58 = this._configuration) === null || _this$_configuration58 === void 0 ? void 0 : _this$_configuration58.priceFormat), {}, {
|
|
1083
|
+
currency: (_this$root$dataStore$5 = this.root.dataStore.organization.settings.defaultCurrency) !== null && _this$root$dataStore$5 !== void 0 ? _this$root$dataStore$5 : (_this$_configuration59 = this._configuration) === null || _this$_configuration59 === void 0 ? void 0 : _this$_configuration59.priceFormat.currency
|
|
1084
|
+
});
|
|
1085
|
+
}
|
|
1031
1086
|
} else {
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
currency: (_this$root$dataStore$4 = (_this$root$dataStore$5 = this.root.dataStore.organization) === null || _this$root$dataStore$5 === void 0 ? void 0 : _this$root$dataStore$5.settings.defaultCurrency) !== null && _this$root$dataStore$4 !== void 0 ? _this$root$dataStore$4 : DivaUtils.defaultPriceFormat.currency
|
|
1087
|
+
return _objectSpread$d(_objectSpread$d({}, fallbackPriceFormat), {}, {
|
|
1088
|
+
currency: this.root.dataStore.organization.settings.defaultCurrency
|
|
1035
1089
|
});
|
|
1036
1090
|
}
|
|
1037
1091
|
}
|
|
1038
1092
|
}, {
|
|
1039
1093
|
key: "countryCodesFile",
|
|
1040
1094
|
get: function get() {
|
|
1041
|
-
var _this$
|
|
1042
|
-
return (_this$
|
|
1095
|
+
var _this$_configuration60;
|
|
1096
|
+
return (_this$_configuration60 = this._configuration) === null || _this$_configuration60 === void 0 ? void 0 : _this$_configuration60.countryCodesFile;
|
|
1043
1097
|
}
|
|
1044
1098
|
}, {
|
|
1045
1099
|
key: "allowedOrganizationTypes",
|
|
1046
1100
|
get: function get() {
|
|
1047
|
-
var _this$
|
|
1048
|
-
if (!((_this$
|
|
1101
|
+
var _this$_configuration61, _this$_configuration62, _this$_configuration63, _this$_configuration64;
|
|
1102
|
+
if (!((_this$_configuration61 = this._configuration) !== null && _this$_configuration61 !== void 0 && _this$_configuration61.allowedOrganizationTypes)) {
|
|
1049
1103
|
return ['RETAILER'];
|
|
1050
1104
|
}
|
|
1051
|
-
return Array.isArray((_this$
|
|
1105
|
+
return Array.isArray((_this$_configuration62 = this._configuration) === null || _this$_configuration62 === void 0 ? void 0 : _this$_configuration62.allowedOrganizationTypes) ? (_this$_configuration63 = this._configuration) === null || _this$_configuration63 === void 0 ? void 0 : _this$_configuration63.allowedOrganizationTypes : [(_this$_configuration64 = this._configuration) === null || _this$_configuration64 === void 0 ? void 0 : _this$_configuration64.allowedOrganizationTypes];
|
|
1052
1106
|
}
|
|
1053
1107
|
}, {
|
|
1054
1108
|
key: "resetConfigurationCache",
|
|
@@ -1058,12 +1112,12 @@ var ConfigurationStore = /*#__PURE__*/function () {
|
|
|
1058
1112
|
}, {
|
|
1059
1113
|
key: "fetchConfiguration",
|
|
1060
1114
|
value: function () {
|
|
1061
|
-
var _fetchConfiguration = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(
|
|
1062
|
-
var identifier, type, domain,
|
|
1115
|
+
var _fetchConfiguration = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref13) {
|
|
1116
|
+
var identifier, type, domain, _ref13$organizationId, organizationId, configuration, types, settingsKeys, _i, _types, subType;
|
|
1063
1117
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
1064
1118
|
while (1) switch (_context.prev = _context.next) {
|
|
1065
1119
|
case 0:
|
|
1066
|
-
identifier =
|
|
1120
|
+
identifier = _ref13.identifier, type = _ref13.type, domain = _ref13.domain, _ref13$organizationId = _ref13.organizationId, organizationId = _ref13$organizationId === void 0 ? this.root.dataStore.organizationId : _ref13$organizationId;
|
|
1067
1121
|
LOG$d.debug("Fetching configuration for ".concat(type, " ").concat(identifier !== null && identifier !== void 0 ? identifier : '', " ").concat(domain !== null && domain !== void 0 ? domain : '', " ").concat(organizationId));
|
|
1068
1122
|
configuration = this.configurationCache.get(type + identifier + organizationId);
|
|
1069
1123
|
if (!configuration) {
|
|
@@ -1279,13 +1333,22 @@ var DataStore = /*#__PURE__*/function () {
|
|
|
1279
1333
|
}, {
|
|
1280
1334
|
key: "organization",
|
|
1281
1335
|
get: function get() {
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1336
|
+
return this._organization;
|
|
1337
|
+
},
|
|
1338
|
+
set: function set(organization) {
|
|
1339
|
+
var _organization$setting, _organization$setting2;
|
|
1340
|
+
this._organization = _objectSpread$c(_objectSpread$c({}, organization), {}, {
|
|
1341
|
+
settings: _objectSpread$c(_objectSpread$c({}, organization.settings), {}, {
|
|
1342
|
+
defaultCurrency: (_organization$setting = (_organization$setting2 = organization.settings) === null || _organization$setting2 === void 0 ? void 0 : _organization$setting2.defaultCurrency) !== null && _organization$setting !== void 0 ? _organization$setting : '€'
|
|
1286
1343
|
})
|
|
1287
|
-
})
|
|
1344
|
+
});
|
|
1288
1345
|
}
|
|
1346
|
+
|
|
1347
|
+
/**
|
|
1348
|
+
* Checks if the user has a certain permissions
|
|
1349
|
+
* @param permission the permission
|
|
1350
|
+
* @returns true if the user has the permission
|
|
1351
|
+
*/
|
|
1289
1352
|
}, {
|
|
1290
1353
|
key: "organizationId",
|
|
1291
1354
|
get: function get() {
|
|
@@ -1359,12 +1422,6 @@ var DataStore = /*#__PURE__*/function () {
|
|
|
1359
1422
|
set: function set(organizations) {
|
|
1360
1423
|
this._parentOrganizations = organizations;
|
|
1361
1424
|
}
|
|
1362
|
-
|
|
1363
|
-
/**
|
|
1364
|
-
* Checks if the user has a certain permissions
|
|
1365
|
-
* @param permission the permission
|
|
1366
|
-
* @returns true if the user has the permission
|
|
1367
|
-
*/
|
|
1368
1425
|
}, {
|
|
1369
1426
|
key: "userHasPermission",
|
|
1370
1427
|
value: function userHasPermission(permission) {
|
|
@@ -1577,7 +1634,7 @@ var DataStore = /*#__PURE__*/function () {
|
|
|
1577
1634
|
};
|
|
1578
1635
|
})) !== null && _organizationData$par !== void 0 ? _organizationData$par : []);
|
|
1579
1636
|
this._currentOrganizationId = organizationId;
|
|
1580
|
-
this.
|
|
1637
|
+
this.organization = organizationData;
|
|
1581
1638
|
this.root.authorizationStore.zToken ? DivaUtils.businessMetrics.jwtSetter = this.root.authorizationStore.zToken : undefined;
|
|
1582
1639
|
if (this.root.authorizationStore.loginState == 'user') {
|
|
1583
1640
|
this.root.browserStateStore.setStoredOrganization(organizationId);
|
|
@@ -1610,7 +1667,87 @@ var DataStore = /*#__PURE__*/function () {
|
|
|
1610
1667
|
}]);
|
|
1611
1668
|
}();
|
|
1612
1669
|
|
|
1613
|
-
|
|
1670
|
+
/**
|
|
1671
|
+
* Swiss German Post-Processor for i18next
|
|
1672
|
+
*
|
|
1673
|
+
* Transforms German text to Swiss German by replacing ß (eszett) with SS
|
|
1674
|
+
* when the organization's country code is 'CH' (Switzerland).
|
|
1675
|
+
*
|
|
1676
|
+
* This is necessary because Swiss German doesn't use the ß character
|
|
1677
|
+
* and instead uses SS in all cases.
|
|
1678
|
+
*/
|
|
1679
|
+
var SwissGermanProcessor = /*#__PURE__*/function () {
|
|
1680
|
+
function SwissGermanProcessor() {
|
|
1681
|
+
_classCallCheck(this, SwissGermanProcessor);
|
|
1682
|
+
_defineProperty(this, "type", 'postProcessor');
|
|
1683
|
+
_defineProperty(this, "name", 'swissGerman');
|
|
1684
|
+
_defineProperty(this, "organizationGetter", void 0);
|
|
1685
|
+
}
|
|
1686
|
+
return _createClass(SwissGermanProcessor, [{
|
|
1687
|
+
key: "setOrganizationGetter",
|
|
1688
|
+
value:
|
|
1689
|
+
/**
|
|
1690
|
+
* Sets the organization getter function
|
|
1691
|
+
* @param getter Function that returns the current organization data
|
|
1692
|
+
*/
|
|
1693
|
+
function setOrganizationGetter(getter) {
|
|
1694
|
+
this.organizationGetter = getter;
|
|
1695
|
+
}
|
|
1696
|
+
|
|
1697
|
+
/**
|
|
1698
|
+
* Checks if Swiss German transformation should be applied
|
|
1699
|
+
* @param lng The current language code
|
|
1700
|
+
* @returns true if transformation should be applied
|
|
1701
|
+
*/
|
|
1702
|
+
}, {
|
|
1703
|
+
key: "shouldApplySwissGerman",
|
|
1704
|
+
value: function shouldApplySwissGerman(lng) {
|
|
1705
|
+
var _this$organizationGet;
|
|
1706
|
+
// Only apply for German language
|
|
1707
|
+
if (lng !== 'de') {
|
|
1708
|
+
return false;
|
|
1709
|
+
}
|
|
1710
|
+
|
|
1711
|
+
// Check if organization has Swiss country code
|
|
1712
|
+
var organization = (_this$organizationGet = this.organizationGetter) === null || _this$organizationGet === void 0 ? void 0 : _this$organizationGet.call(this);
|
|
1713
|
+
return (organization === null || organization === void 0 ? void 0 : organization.countryCode) === 'CH';
|
|
1714
|
+
}
|
|
1715
|
+
|
|
1716
|
+
/**
|
|
1717
|
+
* Transforms German text to Swiss German by replacing ß with SS
|
|
1718
|
+
* @param text The text to transform
|
|
1719
|
+
* @returns The transformed text
|
|
1720
|
+
*/
|
|
1721
|
+
}, {
|
|
1722
|
+
key: "transformToSwissGerman",
|
|
1723
|
+
value: function transformToSwissGerman(text) {
|
|
1724
|
+
// Replace all occurrences of ß (lowercase eszett) with SS
|
|
1725
|
+
// Note: We use uppercase SS to maintain proper Swiss German convention
|
|
1726
|
+
return text.replace(/ß/g, 'ss');
|
|
1727
|
+
}
|
|
1728
|
+
|
|
1729
|
+
/**
|
|
1730
|
+
* Post-processor function called by i18next
|
|
1731
|
+
* @param value The translated value
|
|
1732
|
+
* @param key The translation key
|
|
1733
|
+
* @param options Options including language
|
|
1734
|
+
* @returns The processed value
|
|
1735
|
+
*/
|
|
1736
|
+
}, {
|
|
1737
|
+
key: "process",
|
|
1738
|
+
value: function process(value, key, options) {
|
|
1739
|
+
var lng = options.lng || 'de';
|
|
1740
|
+
if (this.shouldApplySwissGerman(lng)) {
|
|
1741
|
+
return this.transformToSwissGerman(value);
|
|
1742
|
+
}
|
|
1743
|
+
return value;
|
|
1744
|
+
}
|
|
1745
|
+
}]);
|
|
1746
|
+
}();
|
|
1747
|
+
_defineProperty(SwissGermanProcessor, "type", 'postProcessor');
|
|
1748
|
+
var swissGermanProcessor = new SwissGermanProcessor();
|
|
1749
|
+
|
|
1750
|
+
var instance = i18n.createInstance().use(HttpApi).use(swissGermanProcessor);
|
|
1614
1751
|
function init(_ref) {
|
|
1615
1752
|
var apiConfig = _ref.apiConfig,
|
|
1616
1753
|
language = _ref.language;
|
|
@@ -1645,6 +1782,7 @@ function init(_ref) {
|
|
|
1645
1782
|
ns: ['default'],
|
|
1646
1783
|
fallbackLng: false,
|
|
1647
1784
|
supportedLngs: ['de', 'en', 'it', 'fr'],
|
|
1785
|
+
postProcess: ['swissGerman'],
|
|
1648
1786
|
interpolation: {
|
|
1649
1787
|
escapeValue: false // not needed for react as it escapes by default
|
|
1650
1788
|
},
|
|
@@ -1664,6 +1802,12 @@ function init(_ref) {
|
|
|
1664
1802
|
function changeNamespace(_x) {
|
|
1665
1803
|
return _changeNamespace.apply(this, arguments);
|
|
1666
1804
|
}
|
|
1805
|
+
|
|
1806
|
+
/**
|
|
1807
|
+
* Sets the organization getter for the Swiss German processor
|
|
1808
|
+
* This should be called when the organization data is available or changes
|
|
1809
|
+
* @param getter Function that returns the current organization data
|
|
1810
|
+
*/
|
|
1667
1811
|
function _changeNamespace() {
|
|
1668
1812
|
_changeNamespace = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(namespace) {
|
|
1669
1813
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
@@ -1685,6 +1829,9 @@ function _changeNamespace() {
|
|
|
1685
1829
|
}));
|
|
1686
1830
|
return _changeNamespace.apply(this, arguments);
|
|
1687
1831
|
}
|
|
1832
|
+
function setOrganizationForSwissGerman(getter) {
|
|
1833
|
+
swissGermanProcessor.setOrganizationGetter(getter);
|
|
1834
|
+
}
|
|
1688
1835
|
|
|
1689
1836
|
function componentsEqual(c1, c2) {
|
|
1690
1837
|
if (!c1 && !c2) {
|
|
@@ -1830,12 +1977,19 @@ var ContentWrapper = observer(function (_ref2) {
|
|
|
1830
1977
|
});
|
|
1831
1978
|
});
|
|
1832
1979
|
|
|
1980
|
+
function getOrientation(width, height) {
|
|
1981
|
+
//current problem on iPad the orientation.type updates not instantly
|
|
1982
|
+
|
|
1983
|
+
if (screen.orientation && screen.orientation.type) return screen.orientation.type.startsWith('portrait') ? 'portrait' : 'landscape';
|
|
1984
|
+
// Fallback if screen.orientation not supported
|
|
1985
|
+
return height >= width ? 'portrait' : 'landscape';
|
|
1986
|
+
}
|
|
1833
1987
|
function calculateDimensions(width, height) {
|
|
1834
1988
|
var isPortrait = false;
|
|
1835
1989
|
var isMobile = false;
|
|
1836
1990
|
var isTablet = false;
|
|
1837
1991
|
if (width < height) {
|
|
1838
|
-
isPortrait =
|
|
1992
|
+
isPortrait = getOrientation(width, height) === 'portrait';
|
|
1839
1993
|
}
|
|
1840
1994
|
if (/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) || width < 900) {
|
|
1841
1995
|
isMobile = true;
|
|
@@ -2086,6 +2240,12 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
2086
2240
|
return _ref2.apply(this, arguments);
|
|
2087
2241
|
};
|
|
2088
2242
|
}());
|
|
2243
|
+
_defineProperty(this, "onResizeFunc", function (width, height) {
|
|
2244
|
+
if (/iPhone|iPad|iPod/i.test(navigator.userAgent)) {
|
|
2245
|
+
_this.ref.style.height = "".concat(width, " px");
|
|
2246
|
+
}
|
|
2247
|
+
_this._dimensions = calculateDimensions(width, height);
|
|
2248
|
+
});
|
|
2089
2249
|
this.root = root;
|
|
2090
2250
|
this.configuration = components;
|
|
2091
2251
|
if (window.customElements.get('model-viewer')) this._modelViewerHasLoaded = true;
|
|
@@ -3385,10 +3545,11 @@ var ContentStore = /*#__PURE__*/function () {
|
|
|
3385
3545
|
}, {
|
|
3386
3546
|
key: "onResize",
|
|
3387
3547
|
value: function onResize(width, height) {
|
|
3388
|
-
|
|
3389
|
-
|
|
3390
|
-
|
|
3391
|
-
|
|
3548
|
+
var _this12 = this;
|
|
3549
|
+
this.onResizeFunc(width, height);
|
|
3550
|
+
setTimeout(function () {
|
|
3551
|
+
_this12.onResizeFunc(width, height);
|
|
3552
|
+
}, 500);
|
|
3392
3553
|
}
|
|
3393
3554
|
}, {
|
|
3394
3555
|
key: "setGlobalClass",
|
|
@@ -8109,11 +8270,20 @@ var RootStore = /*#__PURE__*/function () {
|
|
|
8109
8270
|
}
|
|
8110
8271
|
});
|
|
8111
8272
|
autorun(function () {
|
|
8112
|
-
DivaUtils.initPriceFormat(_this.configurationStore.priceFormat);
|
|
8113
8273
|
if (_this.configurationStore.countryCodesFile) {
|
|
8114
8274
|
DivaUtils.countryCodeLocation = _this.configurationStore.countryCodesFile;
|
|
8115
8275
|
}
|
|
8116
8276
|
});
|
|
8277
|
+
autorun(function () {
|
|
8278
|
+
var organization = _this.dataStore.organization;
|
|
8279
|
+
var priceFormat = _this.configurationStore.priceFormat;
|
|
8280
|
+
setOrganizationForSwissGerman(function () {
|
|
8281
|
+
return organization;
|
|
8282
|
+
});
|
|
8283
|
+
if (priceFormat) {
|
|
8284
|
+
DivaUtils.initPriceFormat(priceFormat);
|
|
8285
|
+
}
|
|
8286
|
+
});
|
|
8117
8287
|
DivaUtils.businessMetrics.onOpen();
|
|
8118
8288
|
window.addEventListener('beforeunload', function () {
|
|
8119
8289
|
DivaUtils.businessMetrics.onClose();
|
|
@@ -8478,20 +8648,6 @@ var RootStore = /*#__PURE__*/function () {
|
|
|
8478
8648
|
}
|
|
8479
8649
|
});
|
|
8480
8650
|
});
|
|
8481
|
-
afterInitPromise.then(function () {
|
|
8482
|
-
_this4.initializingLocalization = false;
|
|
8483
|
-
var warningText = _this4.t('init.deploymentwarntext', '');
|
|
8484
|
-
if (warningText.trim() !== '' && _this4.doShowInitWarnBanner) {
|
|
8485
|
-
var _this4$contentStore;
|
|
8486
|
-
(_this4$contentStore = _this4.contentStore) === null || _this4$contentStore === void 0 || _this4$contentStore.openBanner({
|
|
8487
|
-
key: 'InitialWarningBanner',
|
|
8488
|
-
type: 'WARNING',
|
|
8489
|
-
title: _this4.t('modals.warning', 'Warnung'),
|
|
8490
|
-
text: warningText,
|
|
8491
|
-
useLocalStorage: true
|
|
8492
|
-
});
|
|
8493
|
-
}
|
|
8494
|
-
});
|
|
8495
8651
|
LOG$4.successTransaction('LOAD_SERVER_DATA');
|
|
8496
8652
|
LOG$4.startTransaction({
|
|
8497
8653
|
event: 'onLoadUserData',
|
|
@@ -8500,16 +8656,16 @@ var RootStore = /*#__PURE__*/function () {
|
|
|
8500
8656
|
});
|
|
8501
8657
|
|
|
8502
8658
|
//load userdata
|
|
8503
|
-
_context.prev =
|
|
8659
|
+
_context.prev = 27;
|
|
8504
8660
|
if (!urlState.authdata) {
|
|
8505
|
-
_context.next =
|
|
8661
|
+
_context.next = 52;
|
|
8506
8662
|
break;
|
|
8507
8663
|
}
|
|
8508
8664
|
authObject = urlState.authdata;
|
|
8509
8665
|
_context.t0 = authObject === null || authObject === void 0 ? void 0 : authObject.path;
|
|
8510
|
-
_context.next = _context.t0 === 'openIdCallback' ?
|
|
8666
|
+
_context.next = _context.t0 === 'openIdCallback' ? 33 : _context.t0 === 'resetPassword' ? 35 : _context.t0 === 'confirmEmail' ? 37 : _context.t0 === 'acceptInvitation' ? 39 : 49;
|
|
8511
8667
|
break;
|
|
8512
|
-
case
|
|
8668
|
+
case 33:
|
|
8513
8669
|
if (authObject.error) {
|
|
8514
8670
|
LOG$4.errorTransaction('LOAD_USER_DATA', (_authObject$code = authObject.code) !== null && _authObject$code !== void 0 ? _authObject$code : 'CORE_0006', authObject.error);
|
|
8515
8671
|
this.authorizationStore.showLogin(false, true);
|
|
@@ -8519,66 +8675,81 @@ var RootStore = /*#__PURE__*/function () {
|
|
|
8519
8675
|
}
|
|
8520
8676
|
this.browserStateStore.setStoredNToken(authObject.token, authObject.expiresBy);
|
|
8521
8677
|
}
|
|
8522
|
-
return _context.abrupt("break",
|
|
8523
|
-
case
|
|
8678
|
+
return _context.abrupt("break", 50);
|
|
8679
|
+
case 35:
|
|
8524
8680
|
if (authObject.error) {
|
|
8525
8681
|
LOG$4.errorTransaction('LOAD_USER_DATA', (_authObject$code2 = authObject.code) !== null && _authObject$code2 !== void 0 ? _authObject$code2 : 'CORE_0006', authObject.error);
|
|
8526
8682
|
this.loadingAndErrorStore.setError(authObject.error);
|
|
8527
8683
|
} else {
|
|
8528
8684
|
this.authorizationStore.showChangePassword(authObject.token);
|
|
8529
8685
|
}
|
|
8530
|
-
return _context.abrupt("break",
|
|
8531
|
-
case
|
|
8686
|
+
return _context.abrupt("break", 50);
|
|
8687
|
+
case 37:
|
|
8532
8688
|
if (authObject.error) {
|
|
8533
8689
|
LOG$4.errorTransaction('LOAD_USER_DATA', (_authObject$code3 = authObject.code) !== null && _authObject$code3 !== void 0 ? _authObject$code3 : 'CORE_0006', authObject.error);
|
|
8534
8690
|
this.loadingAndErrorStore.setError(authObject.error);
|
|
8535
8691
|
} else {
|
|
8536
8692
|
verifyEmailToken = authObject.token;
|
|
8537
8693
|
}
|
|
8538
|
-
return _context.abrupt("break",
|
|
8539
|
-
case
|
|
8694
|
+
return _context.abrupt("break", 50);
|
|
8695
|
+
case 39:
|
|
8540
8696
|
if (!authObject.error) {
|
|
8541
|
-
_context.next =
|
|
8697
|
+
_context.next = 44;
|
|
8542
8698
|
break;
|
|
8543
8699
|
}
|
|
8544
8700
|
LOG$4.errorTransaction('LOAD_INVITATION', (_authObject$code4 = authObject.code) !== null && _authObject$code4 !== void 0 ? _authObject$code4 : 'CORE_0006', authObject.error);
|
|
8545
8701
|
this.loadingAndErrorStore.setError(authObject.error);
|
|
8546
|
-
_context.next =
|
|
8702
|
+
_context.next = 48;
|
|
8547
8703
|
break;
|
|
8548
|
-
case
|
|
8704
|
+
case 44:
|
|
8549
8705
|
if (!this.browserStateStore.getStoredNToken()) {
|
|
8550
|
-
_context.next =
|
|
8706
|
+
_context.next = 47;
|
|
8551
8707
|
break;
|
|
8552
8708
|
}
|
|
8553
|
-
_context.next =
|
|
8709
|
+
_context.next = 47;
|
|
8554
8710
|
return this.authorizationStore.logout(undefined, undefined, undefined, true);
|
|
8555
|
-
case
|
|
8711
|
+
case 47:
|
|
8556
8712
|
this.authorizationStore.showWelcomeScreen((_authObject$additiona = authObject.additionalParams) === null || _authObject$additiona === void 0 ? void 0 : _authObject$additiona.isNewUser, authObject.token, (_authObject$additiona2 = authObject.additionalParams) === null || _authObject$additiona2 === void 0 ? void 0 : _authObject$additiona2.invitationOrgId);
|
|
8713
|
+
case 48:
|
|
8714
|
+
return _context.abrupt("break", 50);
|
|
8557
8715
|
case 49:
|
|
8558
|
-
return _context.abrupt("break",
|
|
8716
|
+
return _context.abrupt("break", 50);
|
|
8559
8717
|
case 50:
|
|
8560
|
-
|
|
8561
|
-
case 51:
|
|
8562
|
-
_context.next = 53;
|
|
8718
|
+
_context.next = 52;
|
|
8563
8719
|
break;
|
|
8564
|
-
case
|
|
8720
|
+
case 52:
|
|
8565
8721
|
LOG$4.successTransaction('LOAD_USER_DATA');
|
|
8566
8722
|
if (!initAuthPromise) {
|
|
8567
|
-
_context.next =
|
|
8723
|
+
_context.next = 59;
|
|
8568
8724
|
break;
|
|
8569
8725
|
}
|
|
8570
|
-
_context.next =
|
|
8726
|
+
_context.next = 56;
|
|
8571
8727
|
return initAuthPromise;
|
|
8572
|
-
case
|
|
8728
|
+
case 56:
|
|
8573
8729
|
loadedOrganization = _context.sent;
|
|
8574
|
-
_context.next = 63;
|
|
8575
|
-
break;
|
|
8576
|
-
case 60:
|
|
8577
8730
|
_context.next = 62;
|
|
8731
|
+
break;
|
|
8732
|
+
case 59:
|
|
8733
|
+
_context.next = 61;
|
|
8578
8734
|
return this.initializeAuthorization(initialOrganization);
|
|
8579
|
-
case
|
|
8735
|
+
case 61:
|
|
8580
8736
|
loadedOrganization = _context.sent;
|
|
8581
|
-
case
|
|
8737
|
+
case 62:
|
|
8738
|
+
//open banner after auth is initialized
|
|
8739
|
+
afterInitPromise.then(function () {
|
|
8740
|
+
_this4.initializingLocalization = false;
|
|
8741
|
+
var warningText = _this4.t('init.deploymentwarntext', '');
|
|
8742
|
+
if (warningText.trim() !== '' && _this4.doShowInitWarnBanner) {
|
|
8743
|
+
var _this4$contentStore;
|
|
8744
|
+
(_this4$contentStore = _this4.contentStore) === null || _this4$contentStore === void 0 || _this4$contentStore.openBanner({
|
|
8745
|
+
key: 'InitialWarningBanner',
|
|
8746
|
+
type: 'WARNING',
|
|
8747
|
+
title: 'modals.warning',
|
|
8748
|
+
text: 'init.deploymentwarntext',
|
|
8749
|
+
useLocalStorage: true
|
|
8750
|
+
});
|
|
8751
|
+
}
|
|
8752
|
+
});
|
|
8582
8753
|
if (!(loadedOrganization == undefined)) {
|
|
8583
8754
|
_context.next = 66;
|
|
8584
8755
|
break;
|
|
@@ -8622,7 +8793,7 @@ var RootStore = /*#__PURE__*/function () {
|
|
|
8622
8793
|
break;
|
|
8623
8794
|
case 78:
|
|
8624
8795
|
_context.prev = 78;
|
|
8625
|
-
_context.t1 = _context["catch"](
|
|
8796
|
+
_context.t1 = _context["catch"](27);
|
|
8626
8797
|
if (_context.t1 instanceof DivaError && _context.t1.name == 'AUTH_0006') {
|
|
8627
8798
|
LOG$4.errorTransaction('INITIALIZE_CORE', 'AUTH_0006', 'Existing verification token not valid.');
|
|
8628
8799
|
} else {
|
|
@@ -8667,7 +8838,7 @@ var RootStore = /*#__PURE__*/function () {
|
|
|
8667
8838
|
case "end":
|
|
8668
8839
|
return _context.stop();
|
|
8669
8840
|
}
|
|
8670
|
-
}, _callee, this, [[1, 86, 91, 95], [
|
|
8841
|
+
}, _callee, this, [[1, 86, 91, 95], [27, 78]]);
|
|
8671
8842
|
}));
|
|
8672
8843
|
function initialize(_x, _x2, _x3, _x4, _x5, _x6, _x7) {
|
|
8673
8844
|
return _initialize.apply(this, arguments);
|
|
@@ -9202,7 +9373,7 @@ function styleInject(css, ref) {
|
|
|
9202
9373
|
|
|
9203
9374
|
var overlay$2 = "overlay-X3zhH";
|
|
9204
9375
|
var loading = "loading-kAuhm";
|
|
9205
|
-
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:
|
|
9376
|
+
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: 15000;\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";
|
|
9206
9377
|
styleInject(css_248z$5);
|
|
9207
9378
|
|
|
9208
9379
|
var LOG$3 = getLogger('Framework', 'loadDependency');
|
|
@@ -9488,7 +9659,7 @@ var DrawerMenu = observer(MobileDrawer);
|
|
|
9488
9659
|
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; }
|
|
9489
9660
|
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; }
|
|
9490
9661
|
var LazyModals$1 = /*#__PURE__*/React.lazy(function () {
|
|
9491
|
-
return import('./ModalsWrapper-
|
|
9662
|
+
return import('./ModalsWrapper-595326fc.js');
|
|
9492
9663
|
});
|
|
9493
9664
|
function Fullscreen(_ref) {
|
|
9494
9665
|
var inAbsoluteFullscreen = _ref.inAbsoluteFullscreen;
|
|
@@ -9623,9 +9794,11 @@ var InfoCircleOutlined = "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fww
|
|
|
9623
9794
|
var ExclamationCircleOutlined = "data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20aria-hidden%3D%22true%22%20role%3D%22img%22%20width%3D%221em%22%20height%3D%221em%22%20preserveAspectRatio%3D%22xMidYMid%20meet%22%20viewBox%3D%220%200%201024%201024%22%3E%3Cpath%20fill%3D%22currentColor%22%20d%3D%22M512%2064C264.6%2064%2064%20264.6%2064%20512s200.6%20448%20448%20448s448-200.6%20448-448S759.4%2064%20512%2064zm0%20820c-205.4%200-372-166.6-372-372s166.6-372%20372-372s372%20166.6%20372%20372s-166.6%20372-372%20372z%22%2F%3E%3Cpath%20fill%3D%22currentColor%22%20d%3D%22M464%20688a48%2048%200%201%200%2096%200a48%2048%200%201%200-96%200zm24-112h48c4.4%200%208-3.6%208-8V296c0-4.4-3.6-8-8-8h-48c-4.4%200-8%203.6-8%208v272c0%204.4%203.6%208%208%208z%22%2F%3E%3C%2Fsvg%3E";
|
|
9624
9795
|
|
|
9625
9796
|
function Banner() {
|
|
9626
|
-
var _contentStore$banner2
|
|
9797
|
+
var _contentStore$banner2, _contentStore$banner$;
|
|
9627
9798
|
var _useDivaCoreContext = useDivaCoreContext(),
|
|
9628
9799
|
contentStore = _useDivaCoreContext.contentStore;
|
|
9800
|
+
var _useTranslation = useTranslation(),
|
|
9801
|
+
t = _useTranslation.t;
|
|
9629
9802
|
var onClose = function onClose() {
|
|
9630
9803
|
var _contentStore$banner;
|
|
9631
9804
|
contentStore.closeBanner();
|
|
@@ -9671,9 +9844,9 @@ function Banner() {
|
|
|
9671
9844
|
className: textWrapper,
|
|
9672
9845
|
children: [/*#__PURE__*/jsx("p", {
|
|
9673
9846
|
className: title,
|
|
9674
|
-
children: contentStore.banner.title
|
|
9847
|
+
children: t(contentStore.banner.title)
|
|
9675
9848
|
}), /*#__PURE__*/jsx("span", {
|
|
9676
|
-
children: contentStore.banner.text
|
|
9849
|
+
children: t((_contentStore$banner$ = contentStore.banner.text) !== null && _contentStore$banner$ !== void 0 ? _contentStore$banner$ : '')
|
|
9677
9850
|
})]
|
|
9678
9851
|
})]
|
|
9679
9852
|
});
|
|
@@ -9946,10 +10119,10 @@ function ownKeys$3(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymb
|
|
|
9946
10119
|
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; }
|
|
9947
10120
|
var LOG$2 = getLogger('Framework', 'Root');
|
|
9948
10121
|
var LazyAuth = /*#__PURE__*/React.lazy(function () {
|
|
9949
|
-
return import('./index-
|
|
10122
|
+
return import('./index-7769aab3.js');
|
|
9950
10123
|
});
|
|
9951
10124
|
var LazyModals = /*#__PURE__*/React.lazy(function () {
|
|
9952
|
-
return import('./ModalsWrapper-
|
|
10125
|
+
return import('./ModalsWrapper-595326fc.js');
|
|
9953
10126
|
});
|
|
9954
10127
|
function ContentComponent() {
|
|
9955
10128
|
var context = useDivaCoreContext();
|