@commercetools-frontend/application-shell 20.12.0 → 20.12.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/dist/{application-entry-point-ae4c00f2.cjs.dev.js → application-entry-point-140f92f2.cjs.dev.js} +11 -5
  2. package/dist/{application-entry-point-a7199847.esm.js → application-entry-point-21cef8e6.esm.js} +11 -6
  3. package/dist/{application-entry-point-52f79266.cjs.prod.js → application-entry-point-aa870890.cjs.prod.js} +11 -5
  4. package/dist/commercetools-frontend-application-shell.cjs.dev.js +3 -3
  5. package/dist/commercetools-frontend-application-shell.cjs.prod.js +3 -3
  6. package/dist/commercetools-frontend-application-shell.esm.js +3 -3
  7. package/dist/declarations/src/apollo-links/utils.d.ts +1 -1
  8. package/dist/declarations/src/components/application-shell/helpers.d.ts +1 -0
  9. package/dist/declarations/src/hooks/use-is-served-by-proxy/index.d.ts +1 -0
  10. package/dist/declarations/src/hooks/use-is-served-by-proxy/use-is-served-by-proxy.d.ts +2 -0
  11. package/dist/{index-b2a644f6.cjs.prod.js → index-473958c5.cjs.prod.js} +59 -15
  12. package/dist/{index-fd0e0765.cjs.dev.js → index-91dc2ebb.cjs.dev.js} +60 -16
  13. package/dist/{index-1d2a788a.esm.js → index-eebc40b6.esm.js} +60 -16
  14. package/dist/{project-expired-b312aef3.esm.js → project-expired-9d8377ce.esm.js} +3 -3
  15. package/dist/{project-expired-6f5d474a.cjs.prod.js → project-expired-a0163148.cjs.prod.js} +3 -3
  16. package/dist/{project-expired-8a630330.cjs.dev.js → project-expired-d0c9a419.cjs.dev.js} +3 -3
  17. package/dist/{project-not-found-7bdc583e.cjs.dev.js → project-not-found-4f1e5015.cjs.dev.js} +3 -3
  18. package/dist/{project-not-found-19312707.cjs.prod.js → project-not-found-6bdfc28d.cjs.prod.js} +3 -3
  19. package/dist/{project-not-found-1c1a349f.esm.js → project-not-found-a48ca67b.esm.js} +3 -3
  20. package/dist/{project-not-initialized-8179abd1.esm.js → project-not-initialized-746e3f1c.esm.js} +3 -3
  21. package/dist/{project-not-initialized-2f2ee69f.cjs.dev.js → project-not-initialized-84372c36.cjs.dev.js} +3 -3
  22. package/dist/{project-not-initialized-10a1ce69.cjs.prod.js → project-not-initialized-e07d2b6b.cjs.prod.js} +3 -3
  23. package/dist/{project-suspended-da1d5c10.cjs.prod.js → project-suspended-08625b77.cjs.prod.js} +3 -3
  24. package/dist/{project-suspended-3e5b8d4f.esm.js → project-suspended-1a678884.esm.js} +3 -3
  25. package/dist/{project-suspended-f541ad12.cjs.dev.js → project-suspended-bee672c3.cjs.dev.js} +3 -3
  26. package/dist/{quick-access-592bdd5b.cjs.prod.js → quick-access-0a31b56f.cjs.prod.js} +2 -2
  27. package/dist/{quick-access-8e4582e8.cjs.dev.js → quick-access-a50256b3.cjs.dev.js} +2 -2
  28. package/dist/{quick-access-52ee94fa.esm.js → quick-access-de902fa0.esm.js} +2 -2
  29. package/dist/{service-page-project-switcher-283ce683.esm.js → service-page-project-switcher-454e6146.esm.js} +1 -1
  30. package/dist/{service-page-project-switcher-8ccd2f3c.cjs.dev.js → service-page-project-switcher-ab78eb6d.cjs.dev.js} +1 -1
  31. package/dist/{service-page-project-switcher-c5ba651f.cjs.prod.js → service-page-project-switcher-bf6bb20a.cjs.prod.js} +1 -1
  32. package/package.json +33 -33
  33. package/test-utils/dist/commercetools-frontend-application-shell-test-utils.cjs.dev.js +1 -1
  34. package/test-utils/dist/commercetools-frontend-application-shell-test-utils.cjs.prod.js +1 -1
  35. package/test-utils/dist/commercetools-frontend-application-shell-test-utils.esm.js +1 -1
@@ -55,8 +55,8 @@ var _pt = require('prop-types');
55
55
  var react = require('react');
56
56
  var reactRouterDom = require('react-router-dom');
57
57
  var invariant = require('tiny-invariant');
58
- var applicationShellConnectors = require('@commercetools-frontend/application-shell-connectors');
59
58
  var applicationComponents = require('@commercetools-frontend/application-components');
59
+ var applicationShellConnectors = require('@commercetools-frontend/application-shell-connectors');
60
60
 
61
61
  function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
62
62
 
@@ -98,7 +98,7 @@ var _pt__default = /*#__PURE__*/_interopDefault(_pt);
98
98
  var invariant__default = /*#__PURE__*/_interopDefault(invariant);
99
99
 
100
100
  // NOTE: This string will be replaced on build time with the package version.
101
- var version = "20.12.0";
101
+ var version = "20.12.1";
102
102
 
103
103
  var SUPPORTED_HEADERS = {
104
104
  ACCEPT_VERSION: 'Accept-version',
@@ -932,6 +932,13 @@ var location = {
932
932
  reload: reload
933
933
  };
934
934
 
935
+ var useIsServedByProxy = function useIsServedByProxy() {
936
+ var servedByProxy = applicationShellConnectors.useApplicationContext(function (context) {
937
+ return context.environment.servedByProxy;
938
+ });
939
+ return servedByProxy;
940
+ };
941
+
935
942
  var ForcePageReload = function ForcePageReload() {
936
943
  react.useEffect(function () {
937
944
  location.reload();
@@ -941,9 +948,7 @@ var ForcePageReload = function ForcePageReload() {
941
948
 
942
949
  var RouteCatchAll = function RouteCatchAll() {
943
950
  // NOTE: it's important that the return value is a `Route` component!
944
- var servedByProxy = applicationShellConnectors.useApplicationContext(function (context) {
945
- return context.environment.servedByProxy;
946
- }); // In case the application is served by a proxy server, we assume that
951
+ var servedByProxy = useIsServedByProxy(); // In case the application is served by a proxy server, we assume that
947
952
  // the reverse proxy router handles requests forwarding to the specified
948
953
  // service.
949
954
  // For example, if the current "loaded" app is products and I click
@@ -1033,4 +1038,5 @@ exports.setActiveSession = setActiveSession;
1033
1038
  exports.setCachedApolloClient = setCachedApolloClient;
1034
1039
  exports.setSessionScope = setSessionScope;
1035
1040
  exports.setSessionState = setSessionState;
1041
+ exports.useIsServedByProxy = useIsServedByProxy;
1036
1042
  exports.version = version;
@@ -53,11 +53,11 @@ import _pt from 'prop-types';
53
53
  import { useEffect, Children } from 'react';
54
54
  import { Route, Switch, Redirect } from 'react-router-dom';
55
55
  import invariant from 'tiny-invariant';
56
- import { useApplicationContext } from '@commercetools-frontend/application-shell-connectors';
57
56
  import { PageNotFound } from '@commercetools-frontend/application-components';
57
+ import { useApplicationContext } from '@commercetools-frontend/application-shell-connectors';
58
58
 
59
59
  // NOTE: This string will be replaced on build time with the package version.
60
- var version = "20.12.0";
60
+ var version = "20.12.1";
61
61
 
62
62
  var SUPPORTED_HEADERS = {
63
63
  ACCEPT_VERSION: 'Accept-version',
@@ -891,6 +891,13 @@ var location = {
891
891
  reload: reload
892
892
  };
893
893
 
894
+ var useIsServedByProxy = function useIsServedByProxy() {
895
+ var servedByProxy = useApplicationContext(function (context) {
896
+ return context.environment.servedByProxy;
897
+ });
898
+ return servedByProxy;
899
+ };
900
+
894
901
  var ForcePageReload = function ForcePageReload() {
895
902
  useEffect(function () {
896
903
  location.reload();
@@ -900,9 +907,7 @@ var ForcePageReload = function ForcePageReload() {
900
907
 
901
908
  var RouteCatchAll = function RouteCatchAll() {
902
909
  // NOTE: it's important that the return value is a `Route` component!
903
- var servedByProxy = useApplicationContext(function (context) {
904
- return context.environment.servedByProxy;
905
- }); // In case the application is served by a proxy server, we assume that
910
+ var servedByProxy = useIsServedByProxy(); // In case the application is served by a proxy server, we assume that
906
911
  // the reverse proxy router handles requests forwarding to the specified
907
912
  // service.
908
913
  // For example, if the current "loaded" app is products and I click
@@ -964,4 +969,4 @@ ApplicationEntryPoint.propTypes = process.env.NODE_ENV !== "production" ? {
964
969
  children: _pt.node
965
970
  } : {};
966
971
 
967
- export { ApplicationEntryPoint as A, CONTAINERS as C, OIDC_CLAIMS as O, REQUESTS_IN_FLIGHT_LOADER_DOM_ID as R, STORAGE_KEYS as S, getActiveProjectKey as a, getSessionScope as b, location as c, getSessionState as d, setActiveSession as e, createApolloClient as f, getMcApiUrl as g, setCachedApolloClient as h, internalReduxStore as i, SUSPENSION_REASONS as j, setSessionScope as k, logger as l, OIDC_RESPONSE_TYPES as m, setSessionState as n, clearSession as o, selectProjectKeyFromUrl as p, RequestsInFlightLoader as q, removeActiveProjectKey as r, setActiveProjectKey as s, RouteCatchAll as t, applyDefaultMiddlewares as u, version as v, selectUserId as w, createReduxStore as x };
972
+ export { ApplicationEntryPoint as A, CONTAINERS as C, OIDC_CLAIMS as O, REQUESTS_IN_FLIGHT_LOADER_DOM_ID as R, STORAGE_KEYS as S, getActiveProjectKey as a, getSessionScope as b, location as c, getSessionState as d, setActiveSession as e, createApolloClient as f, getMcApiUrl as g, setCachedApolloClient as h, internalReduxStore as i, SUSPENSION_REASONS as j, setSessionScope as k, logger as l, OIDC_RESPONSE_TYPES as m, setSessionState as n, clearSession as o, selectProjectKeyFromUrl as p, RequestsInFlightLoader as q, removeActiveProjectKey as r, setActiveProjectKey as s, RouteCatchAll as t, useIsServedByProxy as u, version as v, applyDefaultMiddlewares as w, selectUserId as x, createReduxStore as y };
@@ -55,8 +55,8 @@ require('prop-types');
55
55
  var react = require('react');
56
56
  var reactRouterDom = require('react-router-dom');
57
57
  var invariant = require('tiny-invariant');
58
- var applicationShellConnectors = require('@commercetools-frontend/application-shell-connectors');
59
58
  var applicationComponents = require('@commercetools-frontend/application-components');
59
+ var applicationShellConnectors = require('@commercetools-frontend/application-shell-connectors');
60
60
 
61
61
  function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }
62
62
 
@@ -97,7 +97,7 @@ var _JSON$stringify__default = /*#__PURE__*/_interopDefault(_JSON$stringify);
97
97
  var invariant__default = /*#__PURE__*/_interopDefault(invariant);
98
98
 
99
99
  // NOTE: This string will be replaced on build time with the package version.
100
- var version = "20.12.0";
100
+ var version = "20.12.1";
101
101
 
102
102
  var SUPPORTED_HEADERS = {
103
103
  ACCEPT_VERSION: 'Accept-version',
@@ -923,6 +923,13 @@ var location = {
923
923
  reload: reload
924
924
  };
925
925
 
926
+ var useIsServedByProxy = function useIsServedByProxy() {
927
+ var servedByProxy = applicationShellConnectors.useApplicationContext(function (context) {
928
+ return context.environment.servedByProxy;
929
+ });
930
+ return servedByProxy;
931
+ };
932
+
926
933
  var ForcePageReload = function ForcePageReload() {
927
934
  react.useEffect(function () {
928
935
  location.reload();
@@ -932,9 +939,7 @@ var ForcePageReload = function ForcePageReload() {
932
939
 
933
940
  var RouteCatchAll = function RouteCatchAll() {
934
941
  // NOTE: it's important that the return value is a `Route` component!
935
- var servedByProxy = applicationShellConnectors.useApplicationContext(function (context) {
936
- return context.environment.servedByProxy;
937
- }); // In case the application is served by a proxy server, we assume that
942
+ var servedByProxy = useIsServedByProxy(); // In case the application is served by a proxy server, we assume that
938
943
  // the reverse proxy router handles requests forwarding to the specified
939
944
  // service.
940
945
  // For example, if the current "loaded" app is products and I click
@@ -1017,4 +1022,5 @@ exports.setActiveSession = setActiveSession;
1017
1022
  exports.setCachedApolloClient = setCachedApolloClient;
1018
1023
  exports.setSessionScope = setSessionScope;
1019
1024
  exports.setSessionState = setSessionState;
1025
+ exports.useIsServedByProxy = useIsServedByProxy;
1020
1026
  exports.version = version;
@@ -2,8 +2,8 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var applicationEntryPoint = require('./application-entry-point-ae4c00f2.cjs.dev.js');
6
- var dist_commercetoolsFrontendApplicationShell = require('./index-fd0e0765.cjs.dev.js');
5
+ var applicationEntryPoint = require('./application-entry-point-140f92f2.cjs.dev.js');
6
+ var dist_commercetoolsFrontendApplicationShell = require('./index-91dc2ebb.cjs.dev.js');
7
7
  require('@babel/runtime-corejs3/core-js-stable/instance/filter');
8
8
  require('uuid');
9
9
  require('@babel/runtime-corejs3/core-js-stable/url');
@@ -61,8 +61,8 @@ require('prop-types');
61
61
  require('react');
62
62
  require('react-router-dom');
63
63
  require('tiny-invariant');
64
- require('@commercetools-frontend/application-shell-connectors');
65
64
  require('@commercetools-frontend/application-components');
65
+ require('@commercetools-frontend/application-shell-connectors');
66
66
  require('@emotion/styled/base');
67
67
  require('@emotion/react');
68
68
  require('@commercetools-frontend/i18n');
@@ -2,8 +2,8 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var applicationEntryPoint = require('./application-entry-point-52f79266.cjs.prod.js');
6
- var dist_commercetoolsFrontendApplicationShell = require('./index-b2a644f6.cjs.prod.js');
5
+ var applicationEntryPoint = require('./application-entry-point-aa870890.cjs.prod.js');
6
+ var dist_commercetoolsFrontendApplicationShell = require('./index-473958c5.cjs.prod.js');
7
7
  require('@babel/runtime-corejs3/core-js-stable/instance/filter');
8
8
  require('uuid');
9
9
  require('@babel/runtime-corejs3/core-js-stable/url');
@@ -61,8 +61,8 @@ require('prop-types');
61
61
  require('react');
62
62
  require('react-router-dom');
63
63
  require('tiny-invariant');
64
- require('@commercetools-frontend/application-shell-connectors');
65
64
  require('@commercetools-frontend/application-components');
65
+ require('@commercetools-frontend/application-shell-connectors');
66
66
  require('@emotion/styled/base');
67
67
  require('@emotion/react');
68
68
  require('@commercetools-frontend/i18n');
@@ -1,5 +1,5 @@
1
- export { t as RouteCatchAll, u as applyDefaultMiddlewares, f as createApolloClient, p as selectProjectKeyFromUrl, w as selectUserId, v as version } from './application-entry-point-a7199847.esm.js';
2
- export { A as ApplicationShell, a as ApplicationShellProvider, C as ConfigureIntlProvider, G as GtmContext, b as GtmUserLogoutTracker, I as InjectReducers, S as SetupFlopFlipProvider, c as createApolloContextForProxyForwardTo, s as setupGlobalErrorListener, d as useMcLazyQuery, e as useMcMutation, u as useMcQuery } from './index-1d2a788a.esm.js';
1
+ export { t as RouteCatchAll, w as applyDefaultMiddlewares, f as createApolloClient, p as selectProjectKeyFromUrl, x as selectUserId, v as version } from './application-entry-point-21cef8e6.esm.js';
2
+ export { A as ApplicationShell, a as ApplicationShellProvider, C as ConfigureIntlProvider, G as GtmContext, b as GtmUserLogoutTracker, I as InjectReducers, S as SetupFlopFlipProvider, c as createApolloContextForProxyForwardTo, s as setupGlobalErrorListener, d as useMcLazyQuery, e as useMcMutation, u as useMcQuery } from './index-eebc40b6.esm.js';
3
3
  import '@babel/runtime-corejs3/core-js-stable/instance/filter';
4
4
  import 'uuid';
5
5
  import '@babel/runtime-corejs3/core-js-stable/url';
@@ -57,8 +57,8 @@ import 'prop-types';
57
57
  import 'react';
58
58
  import 'react-router-dom';
59
59
  import 'tiny-invariant';
60
- import '@commercetools-frontend/application-shell-connectors';
61
60
  import '@commercetools-frontend/application-components';
61
+ import '@commercetools-frontend/application-shell-connectors';
62
62
  import '@emotion/styled/base';
63
63
  import '@emotion/react';
64
64
  import '@commercetools-frontend/i18n';
@@ -5,6 +5,6 @@ import type { TApolloContext } from '../utils/apollo-context';
5
5
  declare const getSkipTokenRetry: (context: TApolloContext) => boolean;
6
6
  declare const forwardTokenRetryHeader: (headers: TApolloContext['headers']) => TApolloContext['headers'];
7
7
  declare const getDoesGraphQLTargetSupportTokenRetry: (context: TApolloContext) => boolean;
8
- declare const isHttpError: (error: ErrorResponse['networkError']) => error is ServerError | ServerParseError;
8
+ declare const isHttpError: (error: ErrorResponse['networkError']) => error is ServerParseError | ServerError;
9
9
  declare const isGraphQLError: (error: ErrorResponse['graphQLErrors']) => error is GraphQLError[];
10
10
  export { getSkipTokenRetry, forwardTokenRetryHeader, getDoesGraphQLTargetSupportTokenRetry, isHttpError, isGraphQLError, };
@@ -0,0 +1 @@
1
+ export declare function getMcOrigin(mcApiUrl: string, actualWindow?: Window & typeof globalThis): string;
@@ -0,0 +1 @@
1
+ export { default } from './use-is-served-by-proxy';
@@ -0,0 +1,2 @@
1
+ declare const useIsServedByProxy: () => boolean;
2
+ export default useIsServedByProxy;
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var applicationEntryPoint = require('./application-entry-point-52f79266.cjs.prod.js');
3
+ var applicationEntryPoint = require('./application-entry-point-aa870890.cjs.prod.js');
4
4
  var _defineProperty = require('@babel/runtime-corejs3/helpers/defineProperty');
5
5
  var _styled = require('@emotion/styled/base');
6
6
  var _pt = require('prop-types');
@@ -2435,27 +2435,25 @@ var LocaleSwitcher = function LocaleSwitcher(props) {
2435
2435
  LocaleSwitcher.propTypes = {};
2436
2436
 
2437
2437
  var ProjectNotFound = /*#__PURE__*/react.lazy(function () {
2438
- return Promise.resolve().then(function () { return require('./project-not-found-19312707.cjs.prod.js'
2438
+ return Promise.resolve().then(function () { return require('./project-not-found-6bdfc28d.cjs.prod.js'
2439
2439
  /* webpackChunkName: "project-not-found" */
2440
2440
  ); });
2441
2441
  });
2442
2442
 
2443
2443
  var ProjectExpired = /*#__PURE__*/react.lazy(function () {
2444
- return Promise.resolve().then(function () { return require('./project-expired-6f5d474a.cjs.prod.js'
2444
+ return Promise.resolve().then(function () { return require('./project-expired-a0163148.cjs.prod.js'
2445
2445
  /* webpackChunkName: "project-expired" */
2446
2446
  ); });
2447
2447
  });
2448
2448
 
2449
2449
  var ProjectNotInitialized = /*#__PURE__*/react.lazy(function () {
2450
- return Promise.resolve().then(function () { return require('./project-not-initialized-10a1ce69.cjs.prod.js'
2450
+ return Promise.resolve().then(function () { return require('./project-not-initialized-e07d2b6b.cjs.prod.js'
2451
2451
  /* webpackChunkName: "project-not-initialized" */
2452
2452
  ); });
2453
2453
  });
2454
2454
 
2455
2455
  var RedirectToProjectCreate = function RedirectToProjectCreate() {
2456
- var servedByProxy = applicationShellConnectors.useApplicationContext(function (context) {
2457
- return context.environment.servedByProxy;
2458
- });
2456
+ var servedByProxy = applicationEntryPoint.useIsServedByProxy();
2459
2457
  /**
2460
2458
  * NOTE:
2461
2459
  * This looks a bit unusual: redirecting in render.
@@ -2496,7 +2494,7 @@ var RedirectToProjectCreate = function RedirectToProjectCreate() {
2496
2494
  RedirectToProjectCreate.displayName = 'RedirectToProjectCreate';
2497
2495
 
2498
2496
  var ProjectSuspended = /*#__PURE__*/react.lazy(function () {
2499
- return Promise.resolve().then(function () { return require('./project-suspended-da1d5c10.cjs.prod.js'
2497
+ return Promise.resolve().then(function () { return require('./project-suspended-08625b77.cjs.prod.js'
2500
2498
  /* webpackChunkName: "project-suspended" */
2501
2499
  ); });
2502
2500
  });
@@ -2652,9 +2650,7 @@ var getDefaultedFeatureToggles = function getDefaultedFeatureToggles(allFeatureT
2652
2650
  };
2653
2651
 
2654
2652
  var useAllMenuFeatureToggles = function useAllMenuFeatureToggles() {
2655
- var servedByProxy = applicationShellConnectors.useApplicationContext(function (applicationContext) {
2656
- return applicationContext.environment.servedByProxy;
2657
- });
2653
+ var servedByProxy = applicationEntryPoint.useIsServedByProxy();
2658
2654
  var mcProxyApiUrl = applicationShellConnectors.useApplicationContext(function (applicationContext) {
2659
2655
  return applicationContext.environment.mcProxyApiUrl;
2660
2656
  });
@@ -3712,7 +3708,7 @@ var pimIndexerStates = {
3712
3708
  };
3713
3709
 
3714
3710
  var QuickAccess = /*#__PURE__*/react.lazy(function () {
3715
- return Promise.resolve().then(function () { return require('./quick-access-592bdd5b.cjs.prod.js'
3711
+ return Promise.resolve().then(function () { return require('./quick-access-0a31b56f.cjs.prod.js'
3716
3712
  /* webpackChunkName: "quick-access" */
3717
3713
  ); });
3718
3714
  });
@@ -3809,6 +3805,51 @@ var QuickAccessTrigger = function QuickAccessTrigger(props) {
3809
3805
  QuickAccessTrigger.propTypes = {};
3810
3806
  QuickAccessTrigger.displayName = 'QuickAccessTrigger';
3811
3807
 
3808
+ /**
3809
+ * Get the "real" Merchant Center frontend URL to redirect the user
3810
+ * to the login page.
3811
+ * We use an explicit full URL so that if a user tries to access the
3812
+ * Custom Applications directly to its domain, it will always redirect
3813
+ * the user to the login page.
3814
+ *
3815
+ * To determine the "real" URL, we need to check if the current location
3816
+ * is a Merchant Center domain, or if it's a custom user domain.
3817
+ * For the latter, we can derive the URL from the Merchant Center API URL.
3818
+ *
3819
+ * A Merchant Center hostname is composed by the following parts:
3820
+ * https://<mc-prefix>.<region>.<provider>.<ct-domain>.<tld>
3821
+ * We neeed to check if at least the first 4 parts (right-to-left) are
3822
+ * the same.
3823
+ */
3824
+ function getMcOrigin(mcApiUrl) {
3825
+ var _context, _context2;
3826
+
3827
+ var actualWindow = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : window;
3828
+ var mcApiUrlObject = new _URL__default["default"](mcApiUrl);
3829
+
3830
+ var _mcApiUrlObject$hostn = _reverseInstanceProperty__default["default"](_context = mcApiUrlObject.hostname.split('.')).call(_context),
3831
+ _mcApiUrlObject$hostn2 = _slicedToArray(_mcApiUrlObject$hostn, 4),
3832
+ tldMcApi = _mcApiUrlObject$hostn2[0],
3833
+ ctDomainMcApi = _mcApiUrlObject$hostn2[1],
3834
+ providerMcApi = _mcApiUrlObject$hostn2[2],
3835
+ regionMcApi = _mcApiUrlObject$hostn2[3];
3836
+
3837
+ var _actualWindow$locatio = _reverseInstanceProperty__default["default"](_context2 = actualWindow.location.hostname.split('.')).call(_context2),
3838
+ _actualWindow$locatio2 = _slicedToArray(_actualWindow$locatio, 4),
3839
+ tldMc = _actualWindow$locatio2[0],
3840
+ ctDomainMc = _actualWindow$locatio2[1],
3841
+ providerMc = _actualWindow$locatio2[2],
3842
+ regionMc = _actualWindow$locatio2[3];
3843
+
3844
+ var isMatching = tldMcApi === tldMc && ctDomainMcApi === ctDomainMc && providerMcApi === providerMc && regionMcApi === regionMc;
3845
+
3846
+ if (isMatching) {
3847
+ return actualWindow.location.origin;
3848
+ }
3849
+
3850
+ return mcApiUrlObject.origin.replace('mc-api', 'mc');
3851
+ }
3852
+
3812
3853
  var generateAndCacheNonceWithState = function generateAndCacheNonceWithState(state) {
3813
3854
  var nonce = uuid.v4(); // We store additional information within the given `nonce`
3814
3855
  // to then retrieve it later when the IdP redirects back
@@ -3825,6 +3866,7 @@ var RedirectToLogin = function RedirectToLogin() {
3825
3866
  var _window$app$__DEVELOP, _window$app$__DEVELOP2;
3826
3867
 
3827
3868
  var location = reactRouterDom.useLocation();
3869
+ var servedByProxy = applicationEntryPoint.useIsServedByProxy();
3828
3870
 
3829
3871
  if ((_window$app$__DEVELOP = window.app.__DEVELOPMENT__) !== null && _window$app$__DEVELOP !== void 0 && (_window$app$__DEVELOP2 = _window$app$__DEVELOP.oidc) !== null && _window$app$__DEVELOP2 !== void 0 && _window$app$__DEVELOP2.authorizeUrl) {
3830
3872
  var _window$app$__DEVELOP3, _window$app$__DEVELOP4, _window$app$__DEVELOP5, _window$app$__DEVELOP6, _window$app$__DEVELOP7, _window$app$__DEVELOP8;
@@ -3875,8 +3917,10 @@ var RedirectToLogin = function RedirectToLogin() {
3875
3917
  });
3876
3918
  }
3877
3919
 
3920
+ var mcOrigin = servedByProxy ? getMcOrigin(window.app.mcApiUrl) : undefined;
3878
3921
  return jsxRuntime.jsx(Redirector, {
3879
3922
  to: "login",
3923
+ origin: mcOrigin,
3880
3924
  location: location,
3881
3925
  queryParams: {
3882
3926
  reason: constants.LOGOUT_REASONS.UNAUTHORIZED,
@@ -3897,9 +3941,7 @@ var RedirectToLogout = function RedirectToLogout(props) {
3897
3941
  var _window$app$__DEVELOP, _window$app$__DEVELOP2, _props$reason;
3898
3942
 
3899
3943
  var location = reactRouterDom.useLocation();
3900
- var servedByProxy = applicationShellConnectors.useApplicationContext(function (context) {
3901
- return context.environment.servedByProxy;
3902
- });
3944
+ var servedByProxy = applicationEntryPoint.useIsServedByProxy();
3903
3945
 
3904
3946
  if ((_window$app$__DEVELOP = window.app.__DEVELOPMENT__) !== null && _window$app$__DEVELOP !== void 0 && (_window$app$__DEVELOP2 = _window$app$__DEVELOP.oidc) !== null && _window$app$__DEVELOP2 !== void 0 && _window$app$__DEVELOP2.authorizeUrl) {
3905
3947
  // Remove the `sessionToken` from storage, so that the AppShell can initiate
@@ -3908,8 +3950,10 @@ var RedirectToLogout = function RedirectToLogout(props) {
3908
3950
  return jsxRuntime.jsx(RedirectToLogin, {});
3909
3951
  }
3910
3952
 
3953
+ var mcOrigin = servedByProxy ? getMcOrigin(window.app.mcApiUrl) : undefined;
3911
3954
  return jsxRuntime.jsx(Redirector, {
3912
3955
  to: "logout",
3956
+ origin: mcOrigin,
3913
3957
  location: location,
3914
3958
  queryParams: _objectSpread$1({
3915
3959
  reason: (_props$reason = props.reason) !== null && _props$reason !== void 0 ? _props$reason : constants.LOGOUT_REASONS.USER
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var applicationEntryPoint = require('./application-entry-point-ae4c00f2.cjs.dev.js');
3
+ var applicationEntryPoint = require('./application-entry-point-140f92f2.cjs.dev.js');
4
4
  var _defineProperty = require('@babel/runtime-corejs3/helpers/defineProperty');
5
5
  var _styled = require('@emotion/styled/base');
6
6
  var _pt = require('prop-types');
@@ -2532,27 +2532,25 @@ LocaleSwitcher.propTypes = process.env.NODE_ENV !== "production" ? {
2532
2532
  } : {};
2533
2533
 
2534
2534
  var ProjectNotFound = /*#__PURE__*/react.lazy(function () {
2535
- return Promise.resolve().then(function () { return require('./project-not-found-7bdc583e.cjs.dev.js'
2535
+ return Promise.resolve().then(function () { return require('./project-not-found-4f1e5015.cjs.dev.js'
2536
2536
  /* webpackChunkName: "project-not-found" */
2537
2537
  ); });
2538
2538
  });
2539
2539
 
2540
2540
  var ProjectExpired = /*#__PURE__*/react.lazy(function () {
2541
- return Promise.resolve().then(function () { return require('./project-expired-8a630330.cjs.dev.js'
2541
+ return Promise.resolve().then(function () { return require('./project-expired-d0c9a419.cjs.dev.js'
2542
2542
  /* webpackChunkName: "project-expired" */
2543
2543
  ); });
2544
2544
  });
2545
2545
 
2546
2546
  var ProjectNotInitialized = /*#__PURE__*/react.lazy(function () {
2547
- return Promise.resolve().then(function () { return require('./project-not-initialized-2f2ee69f.cjs.dev.js'
2547
+ return Promise.resolve().then(function () { return require('./project-not-initialized-84372c36.cjs.dev.js'
2548
2548
  /* webpackChunkName: "project-not-initialized" */
2549
2549
  ); });
2550
2550
  });
2551
2551
 
2552
2552
  var RedirectToProjectCreate = function RedirectToProjectCreate() {
2553
- var servedByProxy = applicationShellConnectors.useApplicationContext(function (context) {
2554
- return context.environment.servedByProxy;
2555
- });
2553
+ var servedByProxy = applicationEntryPoint.useIsServedByProxy();
2556
2554
  /**
2557
2555
  * NOTE:
2558
2556
  * This looks a bit unusual: redirecting in render.
@@ -2570,7 +2568,7 @@ var RedirectToProjectCreate = function RedirectToProjectCreate() {
2570
2568
  }
2571
2569
 
2572
2570
  return jsxRuntime.jsx("div", {
2573
- css: /*#__PURE__*/react$2.css("align-self:center;margin-top:", designSystem.customProperties.spacingXl, ";max-width:", designSystem.customProperties.constraint10, ";" + (process.env.NODE_ENV === "production" ? "" : ";label:RedirectToProjectCreate;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInJlZGlyZWN0LXRvLXByb2plY3QtY3JlYXRlLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUErQmMiLCJmaWxlIjoicmVkaXJlY3QtdG8tcHJvamVjdC1jcmVhdGUudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgY3NzIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xuaW1wb3J0IFNwYWNpbmdzIGZyb20gJ0Bjb21tZXJjZXRvb2xzLXVpa2l0L3NwYWNpbmdzJztcbmltcG9ydCB7IENvbnRlbnROb3RpZmljYXRpb24gfSBmcm9tICdAY29tbWVyY2V0b29scy11aWtpdC9ub3RpZmljYXRpb25zJztcbmltcG9ydCBUZXh0IGZyb20gJ0Bjb21tZXJjZXRvb2xzLXVpa2l0L3RleHQnO1xuaW1wb3J0IENhcmQgZnJvbSAnQGNvbW1lcmNldG9vbHMtdWlraXQvY2FyZCc7XG5pbXBvcnQgeyBjdXN0b21Qcm9wZXJ0aWVzIH0gZnJvbSAnQGNvbW1lcmNldG9vbHMtdWlraXQvZGVzaWduLXN5c3RlbSc7XG5pbXBvcnQgeyB1c2VBcHBsaWNhdGlvbkNvbnRleHQgfSBmcm9tICdAY29tbWVyY2V0b29scy1mcm9udGVuZC9hcHBsaWNhdGlvbi1zaGVsbC1jb25uZWN0b3JzJztcbmltcG9ydCB7IGxvY2F0aW9uIH0gZnJvbSAnLi4vLi4vdXRpbHMvbG9jYXRpb24nO1xuXG5leHBvcnQgY29uc3Q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52aXJvbm1lbnQuXG4gICAgICAgICAgPC9UZXh0LkJvZHk+XG4gICAgICAgIDwvU3BhY2luZ3MuU3RhY2s+XG4gICAgICA8L0NhcmQ+XG4gICAgPC9kaXY+XG4gICk7XG59O1xuUmVkaXJlY3RUb1Byb2plY3RDcmVhdGUuZGlzcGxheU5hbWUgPSAnUmVkaXJlY3RUb1Byb2plY3RDcmVhdGUnO1xuXG5leHBvcnQgZGVmYXVsdCBSZWRpcmVjdFRvUHJvamVjdENyZWF0ZTtcbiJdfQ== */"),
2571
+ css: /*#__PURE__*/react$2.css("align-self:center;margin-top:", designSystem.customProperties.spacingXl, ";max-width:", designSystem.customProperties.constraint10, ";" + (process.env.NODE_ENV === "production" ? "" : ";label:RedirectToProjectCreate;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInJlZGlyZWN0LXRvLXByb2plY3QtY3JlYXRlLnRzeCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUE2QmMiLCJmaWxlIjoicmVkaXJlY3QtdG8tcHJvamVjdC1jcmVhdGUudHN4Iiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgY3NzIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QnO1xuaW1wb3J0IFNwYWNpbmdzIGZyb20gJ0Bjb21tZXJjZXRvb2xzLXVpa2l0L3NwYWNpbmdzJztcbmltcG9ydCB7IENvbnRlbnROb3RpZmljYXRpb24gfSBmcm9tICdAY29tbWVyY2V0b29scy11aWtpdC9ub3RpZmljYXRpb25zJztcbmltcG9ydCBUZXh0IGZyb20gJ0Bjb21tZXJjZXRvb2xzLXVpa2l0L3RleHQnO1xuaW1wb3J0IENhcmQgZnJvbSAnQGNvbW1lcmNldG9vbHMtdWlraXQvY2FyZCc7XG5pbXBvcnQgeyBjdXN0b21Qcm9wZXJ0aWVzIH0gZnJvbSAnQGNvbW1lcmNldG9vbH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FuZCBjcmVhdGUgYSBwcm9qZWN0IHRoZXJlLiBBZnRlclxuICAgICAgICAgICAgdGhhdCwgeW91IGNhbiBhY2Nlc3MgeW91ciBuZXcgcHJvamVjdCBmcm9tIHlvdXIgbG9jYWwgZW52aXJvbm1lbnQuXG4gICAgICAgICAgPC9UZXh0LkJvZHk+XG4gICAgICAgIDwvU3BhY2luZ3MuU3RhY2s+XG4gICAgICA8L0NhcmQ+XG4gICAgPC9kaXY+XG4gICk7XG59O1xuUmVkaXJlY3RUb1Byb2plY3RDcmVhdGUuZGlzcGxheU5hbWUgPSAnUmVkaXJlY3RUb1Byb2plY3RDcmVhdGUnO1xuXG5leHBvcnQgZGVmYXVsdCBSZWRpcmVjdFRvUHJvamVjdENyZWF0ZTtcbiJdfQ== */"),
2574
2572
  children: jsxRuntime.jsx(Card__default["default"], {
2575
2573
  type: "flat",
2576
2574
  theme: "dark",
@@ -2593,7 +2591,7 @@ var RedirectToProjectCreate = function RedirectToProjectCreate() {
2593
2591
  RedirectToProjectCreate.displayName = 'RedirectToProjectCreate';
2594
2592
 
2595
2593
  var ProjectSuspended = /*#__PURE__*/react.lazy(function () {
2596
- return Promise.resolve().then(function () { return require('./project-suspended-f541ad12.cjs.dev.js'
2594
+ return Promise.resolve().then(function () { return require('./project-suspended-bee672c3.cjs.dev.js'
2597
2595
  /* webpackChunkName: "project-suspended" */
2598
2596
  ); });
2599
2597
  });
@@ -2752,9 +2750,7 @@ var getDefaultedFeatureToggles = function getDefaultedFeatureToggles(allFeatureT
2752
2750
  };
2753
2751
 
2754
2752
  var useAllMenuFeatureToggles = function useAllMenuFeatureToggles() {
2755
- var servedByProxy = applicationShellConnectors.useApplicationContext(function (applicationContext) {
2756
- return applicationContext.environment.servedByProxy;
2757
- });
2753
+ var servedByProxy = applicationEntryPoint.useIsServedByProxy();
2758
2754
  var mcProxyApiUrl = applicationShellConnectors.useApplicationContext(function (applicationContext) {
2759
2755
  return applicationContext.environment.mcProxyApiUrl;
2760
2756
  });
@@ -3909,7 +3905,7 @@ var pimIndexerStates = {
3909
3905
  };
3910
3906
 
3911
3907
  var QuickAccess = /*#__PURE__*/react.lazy(function () {
3912
- return Promise.resolve().then(function () { return require('./quick-access-8e4582e8.cjs.dev.js'
3908
+ return Promise.resolve().then(function () { return require('./quick-access-a50256b3.cjs.dev.js'
3913
3909
  /* webpackChunkName: "quick-access" */
3914
3910
  ); });
3915
3911
  });
@@ -4008,6 +4004,51 @@ QuickAccessTrigger.propTypes = process.env.NODE_ENV !== "production" ? {
4008
4004
  } : {};
4009
4005
  QuickAccessTrigger.displayName = 'QuickAccessTrigger';
4010
4006
 
4007
+ /**
4008
+ * Get the "real" Merchant Center frontend URL to redirect the user
4009
+ * to the login page.
4010
+ * We use an explicit full URL so that if a user tries to access the
4011
+ * Custom Applications directly to its domain, it will always redirect
4012
+ * the user to the login page.
4013
+ *
4014
+ * To determine the "real" URL, we need to check if the current location
4015
+ * is a Merchant Center domain, or if it's a custom user domain.
4016
+ * For the latter, we can derive the URL from the Merchant Center API URL.
4017
+ *
4018
+ * A Merchant Center hostname is composed by the following parts:
4019
+ * https://<mc-prefix>.<region>.<provider>.<ct-domain>.<tld>
4020
+ * We neeed to check if at least the first 4 parts (right-to-left) are
4021
+ * the same.
4022
+ */
4023
+ function getMcOrigin(mcApiUrl) {
4024
+ var _context, _context2;
4025
+
4026
+ var actualWindow = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : window;
4027
+ var mcApiUrlObject = new _URL__default["default"](mcApiUrl);
4028
+
4029
+ var _mcApiUrlObject$hostn = _reverseInstanceProperty__default["default"](_context = mcApiUrlObject.hostname.split('.')).call(_context),
4030
+ _mcApiUrlObject$hostn2 = _slicedToArray(_mcApiUrlObject$hostn, 4),
4031
+ tldMcApi = _mcApiUrlObject$hostn2[0],
4032
+ ctDomainMcApi = _mcApiUrlObject$hostn2[1],
4033
+ providerMcApi = _mcApiUrlObject$hostn2[2],
4034
+ regionMcApi = _mcApiUrlObject$hostn2[3];
4035
+
4036
+ var _actualWindow$locatio = _reverseInstanceProperty__default["default"](_context2 = actualWindow.location.hostname.split('.')).call(_context2),
4037
+ _actualWindow$locatio2 = _slicedToArray(_actualWindow$locatio, 4),
4038
+ tldMc = _actualWindow$locatio2[0],
4039
+ ctDomainMc = _actualWindow$locatio2[1],
4040
+ providerMc = _actualWindow$locatio2[2],
4041
+ regionMc = _actualWindow$locatio2[3];
4042
+
4043
+ var isMatching = tldMcApi === tldMc && ctDomainMcApi === ctDomainMc && providerMcApi === providerMc && regionMcApi === regionMc;
4044
+
4045
+ if (isMatching) {
4046
+ return actualWindow.location.origin;
4047
+ }
4048
+
4049
+ return mcApiUrlObject.origin.replace('mc-api', 'mc');
4050
+ }
4051
+
4011
4052
  var generateAndCacheNonceWithState = function generateAndCacheNonceWithState(state) {
4012
4053
  var nonce = uuid.v4(); // We store additional information within the given `nonce`
4013
4054
  // to then retrieve it later when the IdP redirects back
@@ -4024,6 +4065,7 @@ var RedirectToLogin = function RedirectToLogin() {
4024
4065
  var _window$app$__DEVELOP, _window$app$__DEVELOP2;
4025
4066
 
4026
4067
  var location = reactRouterDom.useLocation();
4068
+ var servedByProxy = applicationEntryPoint.useIsServedByProxy();
4027
4069
 
4028
4070
  if ((_window$app$__DEVELOP = window.app.__DEVELOPMENT__) !== null && _window$app$__DEVELOP !== void 0 && (_window$app$__DEVELOP2 = _window$app$__DEVELOP.oidc) !== null && _window$app$__DEVELOP2 !== void 0 && _window$app$__DEVELOP2.authorizeUrl) {
4029
4071
  var _window$app$__DEVELOP3, _window$app$__DEVELOP4, _window$app$__DEVELOP5, _window$app$__DEVELOP6, _window$app$__DEVELOP7, _window$app$__DEVELOP8;
@@ -4074,8 +4116,10 @@ var RedirectToLogin = function RedirectToLogin() {
4074
4116
  });
4075
4117
  }
4076
4118
 
4119
+ var mcOrigin = servedByProxy ? getMcOrigin(window.app.mcApiUrl) : undefined;
4077
4120
  return jsxRuntime.jsx(Redirector, {
4078
4121
  to: "login",
4122
+ origin: mcOrigin,
4079
4123
  location: location,
4080
4124
  queryParams: {
4081
4125
  reason: constants.LOGOUT_REASONS.UNAUTHORIZED,
@@ -4096,9 +4140,7 @@ var RedirectToLogout = function RedirectToLogout(props) {
4096
4140
  var _window$app$__DEVELOP, _window$app$__DEVELOP2, _props$reason;
4097
4141
 
4098
4142
  var location = reactRouterDom.useLocation();
4099
- var servedByProxy = applicationShellConnectors.useApplicationContext(function (context) {
4100
- return context.environment.servedByProxy;
4101
- });
4143
+ var servedByProxy = applicationEntryPoint.useIsServedByProxy();
4102
4144
 
4103
4145
  if ((_window$app$__DEVELOP = window.app.__DEVELOPMENT__) !== null && _window$app$__DEVELOP !== void 0 && (_window$app$__DEVELOP2 = _window$app$__DEVELOP.oidc) !== null && _window$app$__DEVELOP2 !== void 0 && _window$app$__DEVELOP2.authorizeUrl) {
4104
4146
  // Remove the `sessionToken` from storage, so that the AppShell can initiate
@@ -4107,8 +4149,10 @@ var RedirectToLogout = function RedirectToLogout(props) {
4107
4149
  return jsxRuntime.jsx(RedirectToLogin, {});
4108
4150
  }
4109
4151
 
4152
+ var mcOrigin = servedByProxy ? getMcOrigin(window.app.mcApiUrl) : undefined;
4110
4153
  return jsxRuntime.jsx(Redirector, {
4111
4154
  to: "logout",
4155
+ origin: mcOrigin,
4112
4156
  location: location,
4113
4157
  queryParams: _objectSpread$1({
4114
4158
  reason: (_props$reason = props.reason) !== null && _props$reason !== void 0 ? _props$reason : constants.LOGOUT_REASONS.USER