@azure/msal-browser 3.21.0 → 3.22.0

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 (109) hide show
  1. package/dist/app/IPublicClientApplication.mjs +1 -1
  2. package/dist/app/PublicClientApplication.mjs +1 -1
  3. package/dist/app/PublicClientNext.mjs +1 -1
  4. package/dist/broker/nativeBroker/NativeMessageHandler.mjs +1 -1
  5. package/dist/broker/nativeBroker/NativeStatusCodes.mjs +1 -1
  6. package/dist/cache/AccountManager.mjs +1 -1
  7. package/dist/cache/AsyncMemoryStorage.mjs +1 -1
  8. package/dist/cache/BrowserCacheManager.d.ts +0 -25
  9. package/dist/cache/BrowserCacheManager.d.ts.map +1 -1
  10. package/dist/cache/BrowserCacheManager.mjs +1 -71
  11. package/dist/cache/BrowserCacheManager.mjs.map +1 -1
  12. package/dist/cache/BrowserStorage.mjs +1 -1
  13. package/dist/cache/DatabaseStorage.mjs +1 -1
  14. package/dist/cache/MemoryStorage.mjs +1 -1
  15. package/dist/cache/TokenCache.mjs +1 -1
  16. package/dist/config/Configuration.mjs +1 -1
  17. package/dist/controllers/ControllerFactory.mjs +1 -1
  18. package/dist/controllers/NestedAppAuthController.mjs +1 -1
  19. package/dist/controllers/StandardController.mjs +1 -1
  20. package/dist/controllers/UnknownOperatingContextController.mjs +1 -1
  21. package/dist/crypto/BrowserCrypto.mjs +1 -1
  22. package/dist/crypto/CryptoOps.mjs +1 -1
  23. package/dist/crypto/PkceGenerator.mjs +1 -1
  24. package/dist/crypto/SignedHttpRequest.mjs +1 -1
  25. package/dist/encode/Base64Decode.mjs +1 -1
  26. package/dist/encode/Base64Encode.mjs +1 -1
  27. package/dist/error/BrowserAuthError.d.ts +0 -1
  28. package/dist/error/BrowserAuthError.d.ts.map +1 -1
  29. package/dist/error/BrowserAuthError.mjs +2 -3
  30. package/dist/error/BrowserAuthError.mjs.map +1 -1
  31. package/dist/error/BrowserAuthErrorCodes.d.ts +0 -1
  32. package/dist/error/BrowserAuthErrorCodes.d.ts.map +1 -1
  33. package/dist/error/BrowserAuthErrorCodes.mjs +3 -4
  34. package/dist/error/BrowserAuthErrorCodes.mjs.map +1 -1
  35. package/dist/error/BrowserConfigurationAuthError.mjs +1 -1
  36. package/dist/error/BrowserConfigurationAuthErrorCodes.mjs +1 -1
  37. package/dist/error/NativeAuthError.mjs +1 -1
  38. package/dist/error/NativeAuthErrorCodes.mjs +1 -1
  39. package/dist/error/NestedAppAuthError.mjs +1 -1
  40. package/dist/event/EventHandler.mjs +1 -1
  41. package/dist/event/EventMessage.mjs +1 -1
  42. package/dist/event/EventType.mjs +1 -1
  43. package/dist/index.mjs +1 -1
  44. package/dist/interaction_client/BaseInteractionClient.mjs +1 -1
  45. package/dist/interaction_client/HybridSpaAuthorizationCodeClient.mjs +1 -1
  46. package/dist/interaction_client/NativeInteractionClient.mjs +1 -1
  47. package/dist/interaction_client/PopupClient.d.ts +2 -15
  48. package/dist/interaction_client/PopupClient.d.ts.map +1 -1
  49. package/dist/interaction_client/PopupClient.mjs +55 -81
  50. package/dist/interaction_client/PopupClient.mjs.map +1 -1
  51. package/dist/interaction_client/RedirectClient.d.ts.map +1 -1
  52. package/dist/interaction_client/RedirectClient.mjs +5 -36
  53. package/dist/interaction_client/RedirectClient.mjs.map +1 -1
  54. package/dist/interaction_client/SilentAuthCodeClient.mjs +1 -1
  55. package/dist/interaction_client/SilentCacheClient.mjs +1 -1
  56. package/dist/interaction_client/SilentIframeClient.d.ts.map +1 -1
  57. package/dist/interaction_client/SilentIframeClient.mjs +3 -3
  58. package/dist/interaction_client/SilentIframeClient.mjs.map +1 -1
  59. package/dist/interaction_client/SilentRefreshClient.mjs +1 -1
  60. package/dist/interaction_client/StandardInteractionClient.mjs +1 -1
  61. package/dist/interaction_handler/InteractionHandler.mjs +1 -1
  62. package/dist/interaction_handler/RedirectHandler.d.ts.map +1 -1
  63. package/dist/interaction_handler/RedirectHandler.mjs +1 -2
  64. package/dist/interaction_handler/RedirectHandler.mjs.map +1 -1
  65. package/dist/interaction_handler/SilentHandler.mjs +1 -1
  66. package/dist/naa/BridgeError.mjs +1 -1
  67. package/dist/naa/BridgeProxy.d.ts.map +1 -1
  68. package/dist/naa/BridgeProxy.mjs +3 -8
  69. package/dist/naa/BridgeProxy.mjs.map +1 -1
  70. package/dist/naa/BridgeStatusCode.mjs +1 -1
  71. package/dist/naa/mapping/NestedAppAuthAdapter.mjs +1 -1
  72. package/dist/navigation/NavigationClient.mjs +1 -1
  73. package/dist/network/FetchClient.mjs +1 -1
  74. package/dist/operatingcontext/BaseOperatingContext.mjs +1 -1
  75. package/dist/operatingcontext/NestedAppOperatingContext.mjs +1 -1
  76. package/dist/operatingcontext/StandardOperatingContext.mjs +1 -1
  77. package/dist/operatingcontext/UnknownOperatingContext.mjs +1 -1
  78. package/dist/packageMetadata.d.ts +1 -1
  79. package/dist/packageMetadata.mjs +2 -2
  80. package/dist/request/RequestHelpers.mjs +1 -1
  81. package/dist/response/ResponseHandler.mjs +1 -1
  82. package/dist/telemetry/BrowserPerformanceClient.d.ts +0 -4
  83. package/dist/telemetry/BrowserPerformanceClient.d.ts.map +1 -1
  84. package/dist/telemetry/BrowserPerformanceClient.mjs +2 -2
  85. package/dist/telemetry/BrowserPerformanceClient.mjs.map +1 -1
  86. package/dist/telemetry/BrowserPerformanceMeasurement.mjs +1 -1
  87. package/dist/utils/BrowserConstants.d.ts +0 -2
  88. package/dist/utils/BrowserConstants.d.ts.map +1 -1
  89. package/dist/utils/BrowserConstants.mjs +1 -3
  90. package/dist/utils/BrowserConstants.mjs.map +1 -1
  91. package/dist/utils/BrowserProtocolUtils.mjs +1 -1
  92. package/dist/utils/BrowserUtils.mjs +1 -1
  93. package/lib/msal-browser.cjs +287 -428
  94. package/lib/msal-browser.cjs.map +1 -1
  95. package/lib/msal-browser.js +287 -428
  96. package/lib/msal-browser.js.map +1 -1
  97. package/lib/msal-browser.min.js +62 -62
  98. package/package.json +2 -2
  99. package/src/cache/BrowserCacheManager.ts +0 -95
  100. package/src/error/BrowserAuthError.ts +0 -2
  101. package/src/error/BrowserAuthErrorCodes.ts +0 -1
  102. package/src/interaction_client/PopupClient.ts +118 -202
  103. package/src/interaction_client/RedirectClient.ts +1 -58
  104. package/src/interaction_client/SilentIframeClient.ts +1 -2
  105. package/src/interaction_handler/RedirectHandler.ts +0 -1
  106. package/src/naa/BridgeProxy.ts +2 -7
  107. package/src/packageMetadata.ts +1 -1
  108. package/src/telemetry/BrowserPerformanceClient.ts +1 -1
  109. package/src/utils/BrowserConstants.ts +0 -2
@@ -1,8 +1,8 @@
1
- /*! @azure/msal-browser v3.21.0 2024-08-13 */
1
+ /*! @azure/msal-browser v3.22.0 2024-08-28 */
2
2
  'use strict';
3
3
  'use strict';
4
4
 
5
- /*! @azure/msal-common v14.14.1 2024-08-13 */
5
+ /*! @azure/msal-common v14.14.2 2024-08-28 */
6
6
  /*
7
7
  * Copyright (c) Microsoft Corporation. All rights reserved.
8
8
  * Licensed under the MIT License.
@@ -311,7 +311,7 @@ const JsonWebTokenTypes = {
311
311
  // Token renewal offset default in seconds
312
312
  const DEFAULT_TOKEN_RENEWAL_OFFSET_SEC = 300;
313
313
 
314
- /*! @azure/msal-common v14.14.1 2024-08-13 */
314
+ /*! @azure/msal-common v14.14.2 2024-08-28 */
315
315
  /*
316
316
  * Copyright (c) Microsoft Corporation. All rights reserved.
317
317
  * Licensed under the MIT License.
@@ -328,7 +328,7 @@ var AuthErrorCodes = /*#__PURE__*/Object.freeze({
328
328
  unexpectedError: unexpectedError
329
329
  });
330
330
 
331
- /*! @azure/msal-common v14.14.1 2024-08-13 */
331
+ /*! @azure/msal-common v14.14.2 2024-08-28 */
332
332
 
333
333
  /*
334
334
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -377,7 +377,7 @@ function createAuthError(code, additionalMessage) {
377
377
  : AuthErrorMessages[code]);
378
378
  }
379
379
 
380
- /*! @azure/msal-common v14.14.1 2024-08-13 */
380
+ /*! @azure/msal-common v14.14.2 2024-08-28 */
381
381
  /*
382
382
  * Copyright (c) Microsoft Corporation. All rights reserved.
383
383
  * Licensed under the MIT License.
@@ -475,7 +475,7 @@ var ClientAuthErrorCodes = /*#__PURE__*/Object.freeze({
475
475
  userTimeoutReached: userTimeoutReached
476
476
  });
477
477
 
478
- /*! @azure/msal-common v14.14.1 2024-08-13 */
478
+ /*! @azure/msal-common v14.14.2 2024-08-28 */
479
479
 
480
480
  /*
481
481
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -727,7 +727,7 @@ function createClientAuthError(errorCode, additionalMessage) {
727
727
  return new ClientAuthError(errorCode, additionalMessage);
728
728
  }
729
729
 
730
- /*! @azure/msal-common v14.14.1 2024-08-13 */
730
+ /*! @azure/msal-common v14.14.2 2024-08-28 */
731
731
 
732
732
  /*
733
733
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -788,7 +788,7 @@ function checkMaxAge(authTime, maxAge) {
788
788
  }
789
789
  }
790
790
 
791
- /*! @azure/msal-common v14.14.1 2024-08-13 */
791
+ /*! @azure/msal-common v14.14.2 2024-08-28 */
792
792
  /*
793
793
  * Copyright (c) Microsoft Corporation. All rights reserved.
794
794
  * Licensed under the MIT License.
@@ -803,7 +803,7 @@ const AuthorityType = {
803
803
  Ciam: 3,
804
804
  };
805
805
 
806
- /*! @azure/msal-common v14.14.1 2024-08-13 */
806
+ /*! @azure/msal-common v14.14.2 2024-08-28 */
807
807
  /*
808
808
  * Copyright (c) Microsoft Corporation. All rights reserved.
809
809
  * Licensed under the MIT License.
@@ -815,7 +815,7 @@ function isOpenIdConfigResponse(response) {
815
815
  response.hasOwnProperty("jwks_uri"));
816
816
  }
817
817
 
818
- /*! @azure/msal-common v14.14.1 2024-08-13 */
818
+ /*! @azure/msal-common v14.14.2 2024-08-28 */
819
819
  /*
820
820
  * Copyright (c) Microsoft Corporation. All rights reserved.
821
821
  * Licensed under the MIT License.
@@ -869,7 +869,7 @@ var ClientConfigurationErrorCodes = /*#__PURE__*/Object.freeze({
869
869
  urlParseError: urlParseError
870
870
  });
871
871
 
872
- /*! @azure/msal-common v14.14.1 2024-08-13 */
872
+ /*! @azure/msal-common v14.14.2 2024-08-28 */
873
873
 
874
874
  /*
875
875
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1007,7 +1007,7 @@ function createClientConfigurationError(errorCode) {
1007
1007
  return new ClientConfigurationError(errorCode);
1008
1008
  }
1009
1009
 
1010
- /*! @azure/msal-common v14.14.1 2024-08-13 */
1010
+ /*! @azure/msal-common v14.14.2 2024-08-28 */
1011
1011
  /*
1012
1012
  * Copyright (c) Microsoft Corporation. All rights reserved.
1013
1013
  * Licensed under the MIT License.
@@ -1104,7 +1104,7 @@ class StringUtils {
1104
1104
  }
1105
1105
  }
1106
1106
 
1107
- /*! @azure/msal-common v14.14.1 2024-08-13 */
1107
+ /*! @azure/msal-common v14.14.2 2024-08-28 */
1108
1108
 
1109
1109
  /*
1110
1110
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1151,7 +1151,7 @@ function getDeserializedResponse(responseString) {
1151
1151
  return null;
1152
1152
  }
1153
1153
 
1154
- /*! @azure/msal-common v14.14.1 2024-08-13 */
1154
+ /*! @azure/msal-common v14.14.2 2024-08-28 */
1155
1155
 
1156
1156
  /*
1157
1157
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1315,7 +1315,7 @@ class UrlString {
1315
1315
  }
1316
1316
  }
1317
1317
 
1318
- /*! @azure/msal-common v14.14.1 2024-08-13 */
1318
+ /*! @azure/msal-common v14.14.2 2024-08-28 */
1319
1319
 
1320
1320
  /*
1321
1321
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1455,7 +1455,7 @@ function getCloudDiscoveryMetadataFromNetworkResponse(response, authorityHost) {
1455
1455
  return null;
1456
1456
  }
1457
1457
 
1458
- /*! @azure/msal-common v14.14.1 2024-08-13 */
1458
+ /*! @azure/msal-common v14.14.2 2024-08-28 */
1459
1459
  /*
1460
1460
  * Copyright (c) Microsoft Corporation. All rights reserved.
1461
1461
  * Licensed under the MIT License.
@@ -1468,7 +1468,7 @@ const ProtocolMode = {
1468
1468
  OIDC: "OIDC",
1469
1469
  };
1470
1470
 
1471
- /*! @azure/msal-common v14.14.1 2024-08-13 */
1471
+ /*! @azure/msal-common v14.14.2 2024-08-28 */
1472
1472
  /*
1473
1473
  * Copyright (c) Microsoft Corporation. All rights reserved.
1474
1474
  * Licensed under the MIT License.
@@ -1488,7 +1488,7 @@ const AzureCloudInstance = {
1488
1488
  AzureUsGovernment: "https://login.microsoftonline.us",
1489
1489
  };
1490
1490
 
1491
- /*! @azure/msal-common v14.14.1 2024-08-13 */
1491
+ /*! @azure/msal-common v14.14.2 2024-08-28 */
1492
1492
  /*
1493
1493
  * Copyright (c) Microsoft Corporation. All rights reserved.
1494
1494
  * Licensed under the MIT License.
@@ -1498,7 +1498,7 @@ function isCloudInstanceDiscoveryResponse(response) {
1498
1498
  response.hasOwnProperty("metadata"));
1499
1499
  }
1500
1500
 
1501
- /*! @azure/msal-common v14.14.1 2024-08-13 */
1501
+ /*! @azure/msal-common v14.14.2 2024-08-28 */
1502
1502
  /*
1503
1503
  * Copyright (c) Microsoft Corporation. All rights reserved.
1504
1504
  * Licensed under the MIT License.
@@ -1508,7 +1508,7 @@ function isCloudInstanceDiscoveryErrorResponse(response) {
1508
1508
  response.hasOwnProperty("error_description"));
1509
1509
  }
1510
1510
 
1511
- /*! @azure/msal-common v14.14.1 2024-08-13 */
1511
+ /*! @azure/msal-common v14.14.2 2024-08-28 */
1512
1512
  /*
1513
1513
  * Copyright (c) Microsoft Corporation. All rights reserved.
1514
1514
  * Licensed under the MIT License.
@@ -1665,10 +1665,6 @@ const PerformanceEvents = {
1665
1665
  */
1666
1666
  InitializeSilentRequest: "initializeSilentRequest",
1667
1667
  InitializeClientApplication: "initializeClientApplication",
1668
- /**
1669
- * Helper function in PopupClient class (msal-browser).
1670
- */
1671
- PopupClientTokenHelper: "popupClientTokenHelper",
1672
1668
  /**
1673
1669
  * Helper function in SilentIframeClient class (msal-browser).
1674
1670
  */
@@ -1994,7 +1990,7 @@ const IntFields = new Set([
1994
1990
  "multiMatchedRT",
1995
1991
  ]);
1996
1992
 
1997
- /*! @azure/msal-common v14.14.1 2024-08-13 */
1993
+ /*! @azure/msal-common v14.14.2 2024-08-28 */
1998
1994
  /*
1999
1995
  * Copyright (c) Microsoft Corporation. All rights reserved.
2000
1996
  * Licensed under the MIT License.
@@ -2090,7 +2086,7 @@ const invokeAsync = (callback, eventName, logger, telemetryClient, correlationId
2090
2086
  };
2091
2087
  };
2092
2088
 
2093
- /*! @azure/msal-common v14.14.1 2024-08-13 */
2089
+ /*! @azure/msal-common v14.14.2 2024-08-28 */
2094
2090
 
2095
2091
  /*
2096
2092
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2199,7 +2195,7 @@ RegionDiscovery.IMDS_OPTIONS = {
2199
2195
  },
2200
2196
  };
2201
2197
 
2202
- /*! @azure/msal-common v14.14.1 2024-08-13 */
2198
+ /*! @azure/msal-common v14.14.2 2024-08-28 */
2203
2199
  /*
2204
2200
  * Copyright (c) Microsoft Corporation. All rights reserved.
2205
2201
  * Licensed under the MIT License.
@@ -2236,7 +2232,7 @@ function wasClockTurnedBack(cachedAt) {
2236
2232
  return cachedAtSec > nowSeconds();
2237
2233
  }
2238
2234
 
2239
- /*! @azure/msal-common v14.14.1 2024-08-13 */
2235
+ /*! @azure/msal-common v14.14.2 2024-08-28 */
2240
2236
 
2241
2237
  /*
2242
2238
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -2563,7 +2559,7 @@ function isAuthorityMetadataExpired(metadata) {
2563
2559
  return metadata.expiresAt <= nowSeconds();
2564
2560
  }
2565
2561
 
2566
- /*! @azure/msal-common v14.14.1 2024-08-13 */
2562
+ /*! @azure/msal-common v14.14.2 2024-08-28 */
2567
2563
 
2568
2564
  /*
2569
2565
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3402,7 +3398,7 @@ function buildStaticAuthorityOptions(authOptions) {
3402
3398
  };
3403
3399
  }
3404
3400
 
3405
- /*! @azure/msal-common v14.14.1 2024-08-13 */
3401
+ /*! @azure/msal-common v14.14.2 2024-08-28 */
3406
3402
 
3407
3403
  /*
3408
3404
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3433,7 +3429,7 @@ async function createDiscoveredInstance(authorityUri, networkClient, cacheManage
3433
3429
  }
3434
3430
  }
3435
3431
 
3436
- /*! @azure/msal-common v14.14.1 2024-08-13 */
3432
+ /*! @azure/msal-common v14.14.2 2024-08-28 */
3437
3433
  /*
3438
3434
  * Copyright (c) Microsoft Corporation. All rights reserved.
3439
3435
  * Licensed under the MIT License.
@@ -3451,7 +3447,7 @@ async function getClientAssertion(clientAssertion, clientId, tokenEndpoint) {
3451
3447
  }
3452
3448
  }
3453
3449
 
3454
- /*! @azure/msal-common v14.14.1 2024-08-13 */
3450
+ /*! @azure/msal-common v14.14.2 2024-08-28 */
3455
3451
  /*
3456
3452
  * Copyright (c) Microsoft Corporation. All rights reserved.
3457
3453
  * Licensed under the MIT License.
@@ -3499,7 +3495,7 @@ const LOGIN_HINT = "login_hint";
3499
3495
  const DOMAIN_HINT = "domain_hint";
3500
3496
  const X_CLIENT_EXTRA_SKU = "x-client-xtra-sku";
3501
3497
 
3502
- /*! @azure/msal-common v14.14.1 2024-08-13 */
3498
+ /*! @azure/msal-common v14.14.2 2024-08-28 */
3503
3499
 
3504
3500
  /*
3505
3501
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3538,7 +3534,7 @@ const DEFAULT_CRYPTO_IMPLEMENTATION = {
3538
3534
  },
3539
3535
  };
3540
3536
 
3541
- /*! @azure/msal-common v14.14.1 2024-08-13 */
3537
+ /*! @azure/msal-common v14.14.2 2024-08-28 */
3542
3538
 
3543
3539
  /*
3544
3540
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3729,12 +3725,12 @@ class Logger {
3729
3725
  }
3730
3726
  }
3731
3727
 
3732
- /*! @azure/msal-common v14.14.1 2024-08-13 */
3728
+ /*! @azure/msal-common v14.14.2 2024-08-28 */
3733
3729
  /* eslint-disable header/header */
3734
3730
  const name$1 = "@azure/msal-common";
3735
- const version$1 = "14.14.1";
3731
+ const version$1 = "14.14.2";
3736
3732
 
3737
- /*! @azure/msal-common v14.14.1 2024-08-13 */
3733
+ /*! @azure/msal-common v14.14.2 2024-08-28 */
3738
3734
 
3739
3735
  /*
3740
3736
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3934,7 +3930,7 @@ class ScopeSet {
3934
3930
  }
3935
3931
  }
3936
3932
 
3937
- /*! @azure/msal-common v14.14.1 2024-08-13 */
3933
+ /*! @azure/msal-common v14.14.2 2024-08-28 */
3938
3934
 
3939
3935
  /*
3940
3936
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -3974,7 +3970,7 @@ function buildClientInfoFromHomeAccountId(homeAccountId) {
3974
3970
  };
3975
3971
  }
3976
3972
 
3977
- /*! @azure/msal-common v14.14.1 2024-08-13 */
3973
+ /*! @azure/msal-common v14.14.2 2024-08-28 */
3978
3974
  /*
3979
3975
  * Copyright (c) Microsoft Corporation. All rights reserved.
3980
3976
  * Licensed under the MIT License.
@@ -4053,7 +4049,7 @@ function updateAccountTenantProfileData(baseAccountInfo, tenantProfile, idTokenC
4053
4049
  return updatedAccountInfo;
4054
4050
  }
4055
4051
 
4056
- /*! @azure/msal-common v14.14.1 2024-08-13 */
4052
+ /*! @azure/msal-common v14.14.2 2024-08-28 */
4057
4053
  /*
4058
4054
  * Copyright (c) Microsoft Corporation. All rights reserved.
4059
4055
  * Licensed under the MIT License.
@@ -4075,7 +4071,7 @@ function getTenantIdFromIdTokenClaims(idTokenClaims) {
4075
4071
  return null;
4076
4072
  }
4077
4073
 
4078
- /*! @azure/msal-common v14.14.1 2024-08-13 */
4074
+ /*! @azure/msal-common v14.14.2 2024-08-28 */
4079
4075
 
4080
4076
  /*
4081
4077
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4318,7 +4314,7 @@ class AccountEntity {
4318
4314
  }
4319
4315
  }
4320
4316
 
4321
- /*! @azure/msal-common v14.14.1 2024-08-13 */
4317
+ /*! @azure/msal-common v14.14.2 2024-08-28 */
4322
4318
  /*
4323
4319
  * Copyright (c) Microsoft Corporation. All rights reserved.
4324
4320
  * Licensed under the MIT License.
@@ -4326,7 +4322,7 @@ class AccountEntity {
4326
4322
  const cacheQuotaExceededErrorCode = "cache_quota_exceeded";
4327
4323
  const cacheUnknownErrorCode = "cache_error_unknown";
4328
4324
 
4329
- /*! @azure/msal-common v14.14.1 2024-08-13 */
4325
+ /*! @azure/msal-common v14.14.2 2024-08-28 */
4330
4326
 
4331
4327
  /*
4332
4328
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -4353,7 +4349,7 @@ class CacheError extends Error {
4353
4349
  }
4354
4350
  }
4355
4351
 
4356
- /*! @azure/msal-common v14.14.1 2024-08-13 */
4352
+ /*! @azure/msal-common v14.14.2 2024-08-28 */
4357
4353
 
4358
4354
  /*
4359
4355
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5605,7 +5601,7 @@ class DefaultStorageClass extends CacheManager {
5605
5601
  }
5606
5602
  }
5607
5603
 
5608
- /*! @azure/msal-common v14.14.1 2024-08-13 */
5604
+ /*! @azure/msal-common v14.14.2 2024-08-28 */
5609
5605
 
5610
5606
  /*
5611
5607
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5703,7 +5699,7 @@ function isOidcProtocolMode(config) {
5703
5699
  return (config.authOptions.authority.options.protocolMode === ProtocolMode.OIDC);
5704
5700
  }
5705
5701
 
5706
- /*! @azure/msal-common v14.14.1 2024-08-13 */
5702
+ /*! @azure/msal-common v14.14.2 2024-08-28 */
5707
5703
 
5708
5704
  /*
5709
5705
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5722,7 +5718,7 @@ class ServerError extends AuthError {
5722
5718
  }
5723
5719
  }
5724
5720
 
5725
- /*! @azure/msal-common v14.14.1 2024-08-13 */
5721
+ /*! @azure/msal-common v14.14.2 2024-08-28 */
5726
5722
 
5727
5723
  /*
5728
5724
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5820,7 +5816,7 @@ class ThrottlingUtils {
5820
5816
  }
5821
5817
  }
5822
5818
 
5823
- /*! @azure/msal-common v14.14.1 2024-08-13 */
5819
+ /*! @azure/msal-common v14.14.2 2024-08-28 */
5824
5820
 
5825
5821
  /*
5826
5822
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5857,7 +5853,7 @@ class NetworkManager {
5857
5853
  }
5858
5854
  }
5859
5855
 
5860
- /*! @azure/msal-common v14.14.1 2024-08-13 */
5856
+ /*! @azure/msal-common v14.14.2 2024-08-28 */
5861
5857
  /*
5862
5858
  * Copyright (c) Microsoft Corporation. All rights reserved.
5863
5859
  * Licensed under the MIT License.
@@ -5867,7 +5863,7 @@ const CcsCredentialType = {
5867
5863
  UPN: "UPN",
5868
5864
  };
5869
5865
 
5870
- /*! @azure/msal-common v14.14.1 2024-08-13 */
5866
+ /*! @azure/msal-common v14.14.2 2024-08-28 */
5871
5867
 
5872
5868
  /*
5873
5869
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -5934,7 +5930,7 @@ class RequestValidator {
5934
5930
  }
5935
5931
  }
5936
5932
 
5937
- /*! @azure/msal-common v14.14.1 2024-08-13 */
5933
+ /*! @azure/msal-common v14.14.2 2024-08-28 */
5938
5934
 
5939
5935
  /*
5940
5936
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6319,7 +6315,7 @@ class RequestParameterBuilder {
6319
6315
  }
6320
6316
  }
6321
6317
 
6322
- /*! @azure/msal-common v14.14.1 2024-08-13 */
6318
+ /*! @azure/msal-common v14.14.2 2024-08-28 */
6323
6319
 
6324
6320
  /*
6325
6321
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6422,7 +6418,7 @@ class BaseClient {
6422
6418
  }
6423
6419
  }
6424
6420
 
6425
- /*! @azure/msal-common v14.14.1 2024-08-13 */
6421
+ /*! @azure/msal-common v14.14.2 2024-08-28 */
6426
6422
  /*
6427
6423
  * Copyright (c) Microsoft Corporation. All rights reserved.
6428
6424
  * Licensed under the MIT License.
@@ -6448,7 +6444,7 @@ var InteractionRequiredAuthErrorCodes = /*#__PURE__*/Object.freeze({
6448
6444
  refreshTokenExpired: refreshTokenExpired
6449
6445
  });
6450
6446
 
6451
- /*! @azure/msal-common v14.14.1 2024-08-13 */
6447
+ /*! @azure/msal-common v14.14.2 2024-08-28 */
6452
6448
 
6453
6449
  /*
6454
6450
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6536,7 +6532,7 @@ function createInteractionRequiredAuthError(errorCode) {
6536
6532
  return new InteractionRequiredAuthError(errorCode, InteractionRequiredAuthErrorMessages[errorCode]);
6537
6533
  }
6538
6534
 
6539
- /*! @azure/msal-common v14.14.1 2024-08-13 */
6535
+ /*! @azure/msal-common v14.14.2 2024-08-28 */
6540
6536
 
6541
6537
  /*
6542
6538
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6608,7 +6604,7 @@ class ProtocolUtils {
6608
6604
  }
6609
6605
  }
6610
6606
 
6611
- /*! @azure/msal-common v14.14.1 2024-08-13 */
6607
+ /*! @azure/msal-common v14.14.2 2024-08-28 */
6612
6608
 
6613
6609
  /*
6614
6610
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -6692,7 +6688,7 @@ class PopTokenGenerator {
6692
6688
  }
6693
6689
  }
6694
6690
 
6695
- /*! @azure/msal-common v14.14.1 2024-08-13 */
6691
+ /*! @azure/msal-common v14.14.2 2024-08-28 */
6696
6692
  /*
6697
6693
  * Copyright (c) Microsoft Corporation. All rights reserved.
6698
6694
  * Licensed under the MIT License.
@@ -6719,7 +6715,7 @@ class PopTokenGenerator {
6719
6715
  }
6720
6716
  }
6721
6717
 
6722
- /*! @azure/msal-common v14.14.1 2024-08-13 */
6718
+ /*! @azure/msal-common v14.14.2 2024-08-28 */
6723
6719
 
6724
6720
  /*
6725
6721
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7096,7 +7092,7 @@ function buildAccountToCache(cacheStorage, authority, homeAccountId, base64Decod
7096
7092
  return baseAccount;
7097
7093
  }
7098
7094
 
7099
- /*! @azure/msal-common v14.14.1 2024-08-13 */
7095
+ /*! @azure/msal-common v14.14.2 2024-08-28 */
7100
7096
 
7101
7097
  /*
7102
7098
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7519,7 +7515,7 @@ class AuthorizationCodeClient extends BaseClient {
7519
7515
  }
7520
7516
  }
7521
7517
 
7522
- /*! @azure/msal-common v14.14.1 2024-08-13 */
7518
+ /*! @azure/msal-common v14.14.2 2024-08-28 */
7523
7519
 
7524
7520
  /*
7525
7521
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7733,7 +7729,7 @@ class RefreshTokenClient extends BaseClient {
7733
7729
  }
7734
7730
  }
7735
7731
 
7736
- /*! @azure/msal-common v14.14.1 2024-08-13 */
7732
+ /*! @azure/msal-common v14.14.2 2024-08-28 */
7737
7733
 
7738
7734
  /*
7739
7735
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7869,7 +7865,7 @@ class SilentFlowClient extends BaseClient {
7869
7865
  }
7870
7866
  }
7871
7867
 
7872
- /*! @azure/msal-common v14.14.1 2024-08-13 */
7868
+ /*! @azure/msal-common v14.14.2 2024-08-28 */
7873
7869
 
7874
7870
  /*
7875
7871
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7884,7 +7880,7 @@ const StubbedNetworkModule = {
7884
7880
  },
7885
7881
  };
7886
7882
 
7887
- /*! @azure/msal-common v14.14.1 2024-08-13 */
7883
+ /*! @azure/msal-common v14.14.2 2024-08-28 */
7888
7884
  /*
7889
7885
  * Copyright (c) Microsoft Corporation. All rights reserved.
7890
7886
  * Licensed under the MIT License.
@@ -7892,7 +7888,7 @@ const StubbedNetworkModule = {
7892
7888
  const missingKidError = "missing_kid_error";
7893
7889
  const missingAlgError = "missing_alg_error";
7894
7890
 
7895
- /*! @azure/msal-common v14.14.1 2024-08-13 */
7891
+ /*! @azure/msal-common v14.14.2 2024-08-28 */
7896
7892
 
7897
7893
  /*
7898
7894
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7917,7 +7913,7 @@ function createJoseHeaderError(code) {
7917
7913
  return new JoseHeaderError(code, JoseHeaderErrorMessages[code]);
7918
7914
  }
7919
7915
 
7920
- /*! @azure/msal-common v14.14.1 2024-08-13 */
7916
+ /*! @azure/msal-common v14.14.2 2024-08-28 */
7921
7917
 
7922
7918
  /*
7923
7919
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -7957,7 +7953,7 @@ class JoseHeader {
7957
7953
  }
7958
7954
  }
7959
7955
 
7960
- /*! @azure/msal-common v14.14.1 2024-08-13 */
7956
+ /*! @azure/msal-common v14.14.2 2024-08-28 */
7961
7957
 
7962
7958
  /*
7963
7959
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8015,7 +8011,7 @@ class AuthenticationHeaderParser {
8015
8011
  }
8016
8012
  }
8017
8013
 
8018
- /*! @azure/msal-common v14.14.1 2024-08-13 */
8014
+ /*! @azure/msal-common v14.14.2 2024-08-28 */
8019
8015
 
8020
8016
  /*
8021
8017
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8278,7 +8274,7 @@ class ServerTelemetryManager {
8278
8274
  }
8279
8275
  }
8280
8276
 
8281
- /*! @azure/msal-common v14.14.1 2024-08-13 */
8277
+ /*! @azure/msal-common v14.14.2 2024-08-28 */
8282
8278
 
8283
8279
  /*
8284
8280
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8357,7 +8353,7 @@ class StubPerformanceClient {
8357
8353
  }
8358
8354
  }
8359
8355
 
8360
- /*! @azure/msal-common v14.14.1 2024-08-13 */
8356
+ /*! @azure/msal-common v14.14.2 2024-08-28 */
8361
8357
 
8362
8358
  /*
8363
8359
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -8996,8 +8992,7 @@ const nativeConnectionNotEstablished = "native_connection_not_established";
8996
8992
  const uninitializedPublicClientApplication = "uninitialized_public_client_application";
8997
8993
  const nativePromptNotSupported = "native_prompt_not_supported";
8998
8994
  const invalidBase64String = "invalid_base64_string";
8999
- const invalidPopTokenRequest = "invalid_pop_token_request";
9000
- const failedToRetry = "failed_to_retry";
8995
+ const invalidPopTokenRequest = "invalid_pop_token_request";
9001
8996
 
9002
8997
  var BrowserAuthErrorCodes = /*#__PURE__*/Object.freeze({
9003
8998
  __proto__: null,
@@ -9013,7 +9008,6 @@ var BrowserAuthErrorCodes = /*#__PURE__*/Object.freeze({
9013
9008
  emptyNavigateUri: emptyNavigateUri,
9014
9009
  emptyWindowError: emptyWindowError,
9015
9010
  failedToParseResponse: failedToParseResponse,
9016
- failedToRetry: failedToRetry,
9017
9011
  getRequestFailed: getRequestFailed,
9018
9012
  hashDoesNotContainKnownProperties: hashDoesNotContainKnownProperties,
9019
9013
  hashEmptyError: hashEmptyError,
@@ -9105,7 +9099,6 @@ const BrowserAuthErrorMessages = {
9105
9099
  [nativePromptNotSupported]: "The provided prompt is not supported by the native platform. This request should be routed to the web based flow.",
9106
9100
  [invalidBase64String]: "Invalid base64 encoded string.",
9107
9101
  [invalidPopTokenRequest]: "Invalid PoP token request. The request should not have both a popKid value and signPopToken set to true.",
9108
- [failedToRetry]: "Unable to retry failed auth code redemption due to usage of the onRedirectNavigate request parameter. Please set onRedirectNavigate on the PublicClientApplication configuration instead or call loginRedirect again.",
9109
9102
  };
9110
9103
  /**
9111
9104
  * BrowserAuthErrorMessage class containing string constants used by error codes and messages.
@@ -9394,8 +9387,6 @@ const TemporaryCacheKeys = {
9394
9387
  CORRELATION_ID: "request.correlationId",
9395
9388
  NATIVE_REQUEST: "request.native",
9396
9389
  REDIRECT_CONTEXT: "request.redirect.context",
9397
- REDIRECT_REQUEST: "request.redirect",
9398
- REQUEST_RETRY: "request.retry",
9399
9390
  };
9400
9391
  const StaticCacheKeys = {
9401
9392
  ACCOUNT_KEYS: "msal.account.keys",
@@ -10233,7 +10224,7 @@ function buildConfiguration({ auth: userInputAuth, cache: userInputCache, system
10233
10224
 
10234
10225
  /* eslint-disable header/header */
10235
10226
  const name = "@azure/msal-browser";
10236
- const version = "3.21.0";
10227
+ const version = "3.22.0";
10237
10228
 
10238
10229
  /*
10239
10230
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -10345,169 +10336,6 @@ const BridgeStatusCode = {
10345
10336
  NestedAppAuthUnavailable: "NESTED_APP_AUTH_UNAVAILABLE", // NAA is unavailable in the current context, can retry with standard browser based auth
10346
10337
  };
10347
10338
 
10348
- /*
10349
- * Copyright (c) Microsoft Corporation. All rights reserved.
10350
- * Licensed under the MIT License.
10351
- */
10352
- /**
10353
- * Returns browser performance measurement module if session flag is enabled. Returns undefined otherwise.
10354
- */
10355
- function getPerfMeasurementModule() {
10356
- let sessionStorage;
10357
- try {
10358
- sessionStorage = window[BrowserCacheLocation.SessionStorage];
10359
- const perfEnabled = sessionStorage?.getItem(BROWSER_PERF_ENABLED_KEY);
10360
- if (Number(perfEnabled) === 1) {
10361
- return Promise.resolve().then(function () { return BrowserPerformanceMeasurement$1; });
10362
- }
10363
- // Mute errors if it's a non-browser environment or cookies are blocked.
10364
- }
10365
- catch (e) { }
10366
- return undefined;
10367
- }
10368
- /**
10369
- * Returns boolean, indicating whether browser supports window.performance.now() function.
10370
- */
10371
- function supportsBrowserPerformanceNow() {
10372
- return (typeof window !== "undefined" &&
10373
- typeof window.performance !== "undefined" &&
10374
- typeof window.performance.now === "function");
10375
- }
10376
- /**
10377
- * Returns event duration in milliseconds using window performance API if available. Returns undefined otherwise.
10378
- * @param startTime {DOMHighResTimeStamp | undefined}
10379
- * @returns {number | undefined}
10380
- */
10381
- function getPerfDurationMs(startTime) {
10382
- if (!startTime || !supportsBrowserPerformanceNow()) {
10383
- return undefined;
10384
- }
10385
- return Math.round(window.performance.now() - startTime);
10386
- }
10387
- class BrowserPerformanceClient extends PerformanceClient {
10388
- constructor(configuration, intFields, abbreviations) {
10389
- super(configuration.auth.clientId, configuration.auth.authority || `${Constants.DEFAULT_AUTHORITY}`, new Logger(configuration.system?.loggerOptions || {}, name, version), name, version, configuration.telemetry?.application || {
10390
- appName: "",
10391
- appVersion: "",
10392
- }, intFields, abbreviations);
10393
- }
10394
- generateId() {
10395
- return createNewGuid();
10396
- }
10397
- getPageVisibility() {
10398
- return document.visibilityState?.toString() || null;
10399
- }
10400
- deleteIncompleteSubMeasurements(inProgressEvent) {
10401
- void getPerfMeasurementModule()?.then((module) => {
10402
- const rootEvent = this.eventsByCorrelationId.get(inProgressEvent.event.correlationId);
10403
- const isRootEvent = rootEvent &&
10404
- rootEvent.eventId === inProgressEvent.event.eventId;
10405
- const incompleteMeasurements = [];
10406
- if (isRootEvent && rootEvent?.incompleteSubMeasurements) {
10407
- rootEvent.incompleteSubMeasurements.forEach((subMeasurement) => {
10408
- incompleteMeasurements.push({ ...subMeasurement });
10409
- });
10410
- }
10411
- // Clean up remaining marks for incomplete sub-measurements
10412
- module.BrowserPerformanceMeasurement.flushMeasurements(inProgressEvent.event.correlationId, incompleteMeasurements);
10413
- });
10414
- }
10415
- /**
10416
- * Starts measuring performance for a given operation. Returns a function that should be used to end the measurement.
10417
- * Also captures browser page visibilityState.
10418
- *
10419
- * @param {PerformanceEvents} measureName
10420
- * @param {?string} [correlationId]
10421
- * @returns {((event?: Partial<PerformanceEvent>) => PerformanceEvent| null)}
10422
- */
10423
- startMeasurement(measureName, correlationId) {
10424
- // Capture page visibilityState and then invoke start/end measurement
10425
- const startPageVisibility = this.getPageVisibility();
10426
- const inProgressEvent = super.startMeasurement(measureName, correlationId);
10427
- const startTime = supportsBrowserPerformanceNow()
10428
- ? window.performance.now()
10429
- : undefined;
10430
- const browserMeasurement = getPerfMeasurementModule()?.then((module) => {
10431
- return new module.BrowserPerformanceMeasurement(measureName, inProgressEvent.event.correlationId);
10432
- });
10433
- void browserMeasurement?.then((measurement) => measurement.startMeasurement());
10434
- return {
10435
- ...inProgressEvent,
10436
- end: (event, error) => {
10437
- const res = inProgressEvent.end({
10438
- ...event,
10439
- startPageVisibility,
10440
- endPageVisibility: this.getPageVisibility(),
10441
- durationMs: getPerfDurationMs(startTime),
10442
- }, error);
10443
- void browserMeasurement?.then((measurement) => measurement.endMeasurement());
10444
- this.deleteIncompleteSubMeasurements(inProgressEvent);
10445
- return res;
10446
- },
10447
- discard: () => {
10448
- inProgressEvent.discard();
10449
- void browserMeasurement?.then((measurement) => measurement.flushMeasurement());
10450
- this.deleteIncompleteSubMeasurements(inProgressEvent);
10451
- },
10452
- };
10453
- }
10454
- /**
10455
- * Adds pre-queue time to preQueueTimeByCorrelationId map.
10456
- * @param {PerformanceEvents} eventName
10457
- * @param {?string} correlationId
10458
- * @returns
10459
- */
10460
- setPreQueueTime(eventName, correlationId) {
10461
- if (!supportsBrowserPerformanceNow()) {
10462
- this.logger.trace(`BrowserPerformanceClient: window performance API not available, unable to set telemetry queue time for ${eventName}`);
10463
- return;
10464
- }
10465
- if (!correlationId) {
10466
- this.logger.trace(`BrowserPerformanceClient: correlationId for ${eventName} not provided, unable to set telemetry queue time`);
10467
- return;
10468
- }
10469
- const preQueueEvent = this.preQueueTimeByCorrelationId.get(correlationId);
10470
- /**
10471
- * Manually complete queue measurement if there is an incomplete pre-queue event.
10472
- * Incomplete pre-queue events are instrumentation bugs that should be fixed.
10473
- */
10474
- if (preQueueEvent) {
10475
- this.logger.trace(`BrowserPerformanceClient: Incomplete pre-queue ${preQueueEvent.name} found`, correlationId);
10476
- this.addQueueMeasurement(preQueueEvent.name, correlationId, undefined, true);
10477
- }
10478
- this.preQueueTimeByCorrelationId.set(correlationId, {
10479
- name: eventName,
10480
- time: window.performance.now(),
10481
- });
10482
- }
10483
- /**
10484
- * Calculates and adds queue time measurement for given performance event.
10485
- *
10486
- * @param {PerformanceEvents} eventName
10487
- * @param {?string} correlationId
10488
- * @param {?number} queueTime
10489
- * @param {?boolean} manuallyCompleted - indicator for manually completed queue measurements
10490
- * @returns
10491
- */
10492
- addQueueMeasurement(eventName, correlationId, queueTime, manuallyCompleted) {
10493
- if (!supportsBrowserPerformanceNow()) {
10494
- this.logger.trace(`BrowserPerformanceClient: window performance API not available, unable to add queue measurement for ${eventName}`);
10495
- return;
10496
- }
10497
- if (!correlationId) {
10498
- this.logger.trace(`BrowserPerformanceClient: correlationId for ${eventName} not provided, unable to add queue measurement`);
10499
- return;
10500
- }
10501
- const preQueueTime = super.getPreQueueTime(eventName, correlationId);
10502
- if (!preQueueTime) {
10503
- return;
10504
- }
10505
- const currentTime = window.performance.now();
10506
- const resQueueTime = queueTime || super.calculateQueuedTime(preQueueTime, currentTime);
10507
- return super.addQueueMeasurement(eventName, correlationId, resQueueTime, manuallyCompleted);
10508
- }
10509
- }
10510
-
10511
10339
  /*
10512
10340
  * Copyright (c) Microsoft Corporation. All rights reserved.
10513
10341
  * Licensed under the MIT License.
@@ -10551,9 +10379,7 @@ class BridgeProxy {
10551
10379
  messageType: "NestedAppAuthRequest",
10552
10380
  method: "GetInitContext",
10553
10381
  requestId: createNewGuid(),
10554
- sendTime: supportsBrowserPerformanceNow()
10555
- ? window.performance.now()
10556
- : Date.now(),
10382
+ sendTime: Date.now(),
10557
10383
  };
10558
10384
  const request = {
10559
10385
  requestId: message.requestId,
@@ -10612,9 +10438,7 @@ class BridgeProxy {
10612
10438
  messageType: "NestedAppAuthRequest",
10613
10439
  method: method,
10614
10440
  requestId: createNewGuid(),
10615
- sendTime: supportsBrowserPerformanceNow()
10616
- ? window.performance.now()
10617
- : Date.now(),
10441
+ sendTime: Date.now(),
10618
10442
  ...requestParams,
10619
10443
  };
10620
10444
  const promise = new Promise((resolve, reject) => {
@@ -12458,7 +12282,6 @@ class BrowserCacheManager extends CacheManager {
12458
12282
  this.removeTemporaryItem(this.generateCacheKey(TemporaryCacheKeys.CORRELATION_ID));
12459
12283
  this.removeTemporaryItem(this.generateCacheKey(TemporaryCacheKeys.CCS_CREDENTIAL));
12460
12284
  this.removeTemporaryItem(this.generateCacheKey(TemporaryCacheKeys.NATIVE_REQUEST));
12461
- this.removeTemporaryItem(this.generateCacheKey(TemporaryCacheKeys.REDIRECT_REQUEST));
12462
12285
  this.setInteractionInProgress(false);
12463
12286
  }
12464
12287
  /**
@@ -12505,75 +12328,6 @@ class BrowserCacheManager extends CacheManager {
12505
12328
  this.clearMsalCookies();
12506
12329
  this.setInteractionInProgress(false);
12507
12330
  }
12508
- /**
12509
- * Create request retry key to cache retry status
12510
- */
12511
- generateRequestRetriedKey() {
12512
- return `${Constants.CACHE_PREFIX}.${TemporaryCacheKeys.REQUEST_RETRY}.${this.clientId}`;
12513
- }
12514
- /**
12515
- * Gets the request retry value from the cache
12516
- */
12517
- getRequestRetried() {
12518
- const requestRetriedKey = this.generateRequestRetriedKey();
12519
- const cachedRetryNumber = this.getTemporaryCache(requestRetriedKey);
12520
- if (!cachedRetryNumber) {
12521
- return null;
12522
- }
12523
- return parseInt(cachedRetryNumber);
12524
- }
12525
- /**
12526
- * Sets the request retry value to "retried" in the cache
12527
- */
12528
- setRequestRetried() {
12529
- this.logger.trace("BrowserCacheManager.setRequestRetried called");
12530
- const requestRetriedKey = this.generateRequestRetriedKey();
12531
- this.setTemporaryCache(requestRetriedKey, "1", false);
12532
- }
12533
- /**
12534
- * Removes all request retry values in the cache
12535
- */
12536
- removeRequestRetried() {
12537
- const requestRetriedKey = this.generateRequestRetriedKey();
12538
- this.removeTemporaryItem(requestRetriedKey);
12539
- }
12540
- /**
12541
- * Caches the redirectRequest in the cache
12542
- * @param redirectRequest
12543
- */
12544
- cacheRedirectRequest(redirectRequest) {
12545
- this.logger.trace("BrowserCacheManager.cacheRedirectRequest called");
12546
- const { ...restParams } = redirectRequest;
12547
- delete restParams.onRedirectNavigate;
12548
- const encodedValue = JSON.stringify(restParams);
12549
- this.setTemporaryCache(TemporaryCacheKeys.REDIRECT_REQUEST, encodedValue, true);
12550
- }
12551
- /**
12552
- * Gets redirect request from the cache. Logs an error and returns undefined if nothing is found.
12553
- */
12554
- getCachedRedirectRequest() {
12555
- this.logger.trace("BrowserCacheManager.getCachedRedirectRequest called");
12556
- const cachedRedirectRequest = this.getTemporaryCache(TemporaryCacheKeys.REDIRECT_REQUEST, true);
12557
- if (!cachedRedirectRequest) {
12558
- this.logger.error(`No cached redirect request found.`);
12559
- }
12560
- else {
12561
- this.removeTemporaryItem(this.generateCacheKey(TemporaryCacheKeys.REDIRECT_REQUEST));
12562
- let parsedRequest;
12563
- try {
12564
- parsedRequest = JSON.parse(cachedRedirectRequest);
12565
- }
12566
- catch (e) {
12567
- this.logger.errorPii(`Attempted to parse: ${cachedRedirectRequest}`);
12568
- this.logger.error(`Parsing cached redirect request threw with error: ${e}`);
12569
- return;
12570
- }
12571
- if (parsedRequest) {
12572
- return parsedRequest;
12573
- }
12574
- }
12575
- return;
12576
- }
12577
12331
  cacheCodeRequest(authCodeRequest) {
12578
12332
  this.logger.trace("BrowserCacheManager.cacheCodeRequest called");
12579
12333
  const encodedValue = base64Encode(JSON.stringify(authCodeRequest));
@@ -14677,7 +14431,7 @@ class PopupClient extends StandardInteractionClient {
14677
14431
  }
14678
14432
  }
14679
14433
  /**
14680
- * Helper which initializes authorization clients and requests
14434
+ * Helper which obtains an access_token for your API via opening a popup window in the user's browser
14681
14435
  * @param validRequest
14682
14436
  * @param popupName
14683
14437
  * @param popup
@@ -14690,13 +14444,61 @@ class PopupClient extends StandardInteractionClient {
14690
14444
  const serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.acquireTokenPopup);
14691
14445
  const validRequest = await invokeAsync(this.initializeAuthorizationRequest.bind(this), PerformanceEvents.StandardInteractionClientInitializeAuthorizationRequest, this.logger, this.performanceClient, this.correlationId)(request, exports.InteractionType.Popup);
14692
14446
  preconnect(validRequest.authority);
14693
- let authClient;
14694
14447
  try {
14695
14448
  // Create auth code request and generate PKCE params
14696
14449
  const authCodeRequest = await invokeAsync(this.initializeAuthorizationCodeRequest.bind(this), PerformanceEvents.StandardInteractionClientInitializeAuthorizationCodeRequest, this.logger, this.performanceClient, this.correlationId)(validRequest);
14697
14450
  // Initialize the client
14698
- authClient = await invokeAsync(this.createAuthCodeClient.bind(this), PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, this.logger, this.performanceClient, this.correlationId)(serverTelemetryManager, validRequest.authority, validRequest.azureCloudOptions, validRequest.account);
14699
- return await invokeAsync(this.acquireTokenPopupAsyncHelper.bind(this), PerformanceEvents.PopupClientTokenHelper, this.logger, this.performanceClient, this.correlationId)(authClient, authCodeRequest, validRequest, request, popupName, popupWindowAttributes, popup);
14451
+ const authClient = await invokeAsync(this.createAuthCodeClient.bind(this), PerformanceEvents.StandardInteractionClientCreateAuthCodeClient, this.logger, this.performanceClient, this.correlationId)(serverTelemetryManager, validRequest.authority, validRequest.azureCloudOptions, validRequest.account);
14452
+ const isNativeBroker = NativeMessageHandler.isNativeAvailable(this.config, this.logger, this.nativeMessageHandler, request.authenticationScheme);
14453
+ // Start measurement for server calls with native brokering enabled
14454
+ let fetchNativeAccountIdMeasurement;
14455
+ if (isNativeBroker) {
14456
+ fetchNativeAccountIdMeasurement =
14457
+ this.performanceClient.startMeasurement(PerformanceEvents.FetchAccountIdWithNativeBroker, request.correlationId);
14458
+ }
14459
+ // Create acquire token url.
14460
+ const navigateUrl = await authClient.getAuthCodeUrl({
14461
+ ...validRequest,
14462
+ nativeBroker: isNativeBroker,
14463
+ });
14464
+ // Create popup interaction handler.
14465
+ const interactionHandler = new InteractionHandler(authClient, this.browserStorage, authCodeRequest, this.logger, this.performanceClient);
14466
+ // Show the UI once the url has been created. Get the window handle for the popup.
14467
+ const popupParameters = {
14468
+ popup,
14469
+ popupName,
14470
+ popupWindowAttributes,
14471
+ };
14472
+ const popupWindow = this.initiateAuthRequest(navigateUrl, popupParameters);
14473
+ this.eventHandler.emitEvent(EventType.POPUP_OPENED, exports.InteractionType.Popup, { popupWindow }, null);
14474
+ // Monitor the window for the hash. Return the string value and close the popup when the hash is received. Default timeout is 60 seconds.
14475
+ const responseString = await this.monitorPopupForHash(popupWindow);
14476
+ const serverParams = invoke(deserializeResponse, PerformanceEvents.DeserializeResponse, this.logger, this.performanceClient, this.correlationId)(responseString, this.config.auth.OIDCOptions.serverResponseType, this.logger);
14477
+ // Remove throttle if it exists
14478
+ ThrottlingUtils.removeThrottle(this.browserStorage, this.config.auth.clientId, authCodeRequest);
14479
+ if (serverParams.accountId) {
14480
+ this.logger.verbose("Account id found in hash, calling WAM for token");
14481
+ // end measurement for server call with native brokering enabled
14482
+ if (fetchNativeAccountIdMeasurement) {
14483
+ fetchNativeAccountIdMeasurement.end({
14484
+ success: true,
14485
+ isNativeBroker: true,
14486
+ });
14487
+ }
14488
+ if (!this.nativeMessageHandler) {
14489
+ throw createBrowserAuthError(nativeConnectionNotEstablished);
14490
+ }
14491
+ const nativeInteractionClient = new NativeInteractionClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, ApiId.acquireTokenPopup, this.performanceClient, this.nativeMessageHandler, serverParams.accountId, this.nativeStorage, validRequest.correlationId);
14492
+ const { userRequestState } = ProtocolUtils.parseRequestState(this.browserCrypto, validRequest.state);
14493
+ return await nativeInteractionClient.acquireToken({
14494
+ ...validRequest,
14495
+ state: userRequestState,
14496
+ prompt: undefined, // Server should handle the prompt, ideally native broker can do this part silently
14497
+ });
14498
+ }
14499
+ // Handle response from hash string.
14500
+ const result = await interactionHandler.handleCodeResponse(serverParams, validRequest);
14501
+ return result;
14700
14502
  }
14701
14503
  catch (e) {
14702
14504
  if (popup) {
@@ -14707,82 +14509,8 @@ class PopupClient extends StandardInteractionClient {
14707
14509
  e.setCorrelationId(this.correlationId);
14708
14510
  serverTelemetryManager.cacheFailedRequest(e);
14709
14511
  }
14710
- if (!authClient ||
14711
- !(e instanceof ServerError) ||
14712
- e.errorCode !== BrowserConstants.INVALID_GRANT_ERROR) {
14713
- throw e;
14714
- }
14715
- this.performanceClient.addFields({
14716
- retryError: e.errorCode,
14717
- }, this.correlationId);
14718
- const retryAuthCodeRequest = await invokeAsync(this.initializeAuthorizationCodeRequest.bind(this), PerformanceEvents.StandardInteractionClientInitializeAuthorizationCodeRequest, this.logger, this.performanceClient, this.correlationId)(validRequest);
14719
- return await invokeAsync(this.acquireTokenPopupAsyncHelper.bind(this), PerformanceEvents.PopupClientTokenHelper, this.logger, this.performanceClient, this.correlationId)(authClient, retryAuthCodeRequest, validRequest, request, popupName, popupWindowAttributes, popup);
14720
- }
14721
- }
14722
- /**
14723
- * Helper which obtains an access_token for your API via opening a popup window in the user's browser
14724
- * @param authClient
14725
- * @param authCodeRequest
14726
- * @param validRequest
14727
- * @param request
14728
- * @param popupName
14729
- * @param popupWindowAttributes
14730
- * @param popup
14731
- * @returns A promise that is fulfilled when this function has completed, or rejected if an error was raised.
14732
- */
14733
- async acquireTokenPopupAsyncHelper(authClient, authCodeRequest, validRequest, request, popupName, popupWindowAttributes, popup) {
14734
- const correlationId = validRequest.correlationId;
14735
- this.performanceClient.addQueueMeasurement(PerformanceEvents.PopupClientTokenHelper, correlationId);
14736
- const isNativeBroker = NativeMessageHandler.isNativeAvailable(this.config, this.logger, this.nativeMessageHandler, request.authenticationScheme);
14737
- // Start measurement for server calls with native brokering enabled
14738
- let fetchNativeAccountIdMeasurement;
14739
- if (isNativeBroker) {
14740
- fetchNativeAccountIdMeasurement =
14741
- this.performanceClient.startMeasurement(PerformanceEvents.FetchAccountIdWithNativeBroker, request.correlationId);
14742
- }
14743
- // Create acquire token url.
14744
- const navigateUrl = await authClient.getAuthCodeUrl({
14745
- ...validRequest,
14746
- nativeBroker: isNativeBroker,
14747
- });
14748
- // Create popup interaction handler.
14749
- const interactionHandler = new InteractionHandler(authClient, this.browserStorage, authCodeRequest, this.logger, this.performanceClient);
14750
- // Show the UI once the url has been created. Get the window handle for the popup.
14751
- const popupParameters = {
14752
- popup,
14753
- popupName,
14754
- popupWindowAttributes,
14755
- };
14756
- const popupWindow = this.initiateAuthRequest(navigateUrl, popupParameters);
14757
- this.eventHandler.emitEvent(EventType.POPUP_OPENED, exports.InteractionType.Popup, { popupWindow }, null);
14758
- // Monitor the window for the hash. Return the string value and close the popup when the hash is received. Default timeout is 60 seconds.
14759
- const responseString = await this.monitorPopupForHash(popupWindow);
14760
- const serverParams = invoke(deserializeResponse, PerformanceEvents.DeserializeResponse, this.logger, this.performanceClient, this.correlationId)(responseString, this.config.auth.OIDCOptions.serverResponseType, this.logger);
14761
- // Remove throttle if it exists
14762
- ThrottlingUtils.removeThrottle(this.browserStorage, this.config.auth.clientId, authCodeRequest);
14763
- if (serverParams.accountId) {
14764
- this.logger.verbose("Account id found in hash, calling WAM for token");
14765
- // end measurement for server call with native brokering enabled
14766
- if (fetchNativeAccountIdMeasurement) {
14767
- fetchNativeAccountIdMeasurement.end({
14768
- success: true,
14769
- isNativeBroker: true,
14770
- });
14771
- }
14772
- if (!this.nativeMessageHandler) {
14773
- throw createBrowserAuthError(nativeConnectionNotEstablished);
14774
- }
14775
- const nativeInteractionClient = new NativeInteractionClient(this.config, this.browserStorage, this.browserCrypto, this.logger, this.eventHandler, this.navigationClient, ApiId.acquireTokenPopup, this.performanceClient, this.nativeMessageHandler, serverParams.accountId, this.nativeStorage, validRequest.correlationId);
14776
- const { userRequestState } = ProtocolUtils.parseRequestState(this.browserCrypto, validRequest.state);
14777
- return nativeInteractionClient.acquireToken({
14778
- ...validRequest,
14779
- state: userRequestState,
14780
- prompt: undefined, // Server should handle the prompt, ideally native broker can do this part silently
14781
- });
14512
+ throw e;
14782
14513
  }
14783
- // Handle response from hash string.
14784
- const result = await interactionHandler.handleCodeResponse(serverParams, validRequest);
14785
- return result;
14786
14514
  }
14787
14515
  /**
14788
14516
  *
@@ -15184,7 +14912,6 @@ class RedirectHandler {
15184
14912
  // Acquire token with retrieved code.
15185
14913
  const tokenResponse = (await this.authModule.acquireToken(this.authCodeRequest, authCodeResponse));
15186
14914
  this.browserStorage.cleanRequestByState(state);
15187
- this.browserStorage.removeRequestRetried();
15188
14915
  return tokenResponse;
15189
14916
  }
15190
14917
  /**
@@ -15220,12 +14947,6 @@ class RedirectClient extends StandardInteractionClient {
15220
14947
  * @param request
15221
14948
  */
15222
14949
  async acquireToken(request) {
15223
- if (request.onRedirectNavigate) {
15224
- this.logger.warning("Unable to cache redirect request, onRedirectNavigate request option has been deprecated. Please set onRedirectNavigate on PublicClientApplication config instead.");
15225
- }
15226
- else {
15227
- this.browserStorage.cacheRedirectRequest(request);
15228
- }
15229
14950
  const validRequest = await invokeAsync(this.initializeAuthorizationRequest.bind(this), PerformanceEvents.StandardInteractionClientInitializeAuthorizationRequest, this.logger, this.performanceClient, this.correlationId)(request, exports.InteractionType.Redirect);
15230
14951
  this.browserStorage.updateCacheEntries(validRequest.state, validRequest.nonce, validRequest.authority, validRequest.loginHint || "", validRequest.account || null);
15231
14952
  const serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.acquireTokenRedirect);
@@ -15357,33 +15078,8 @@ class RedirectClient extends StandardInteractionClient {
15357
15078
  e.setCorrelationId(this.correlationId);
15358
15079
  serverTelemetryManager.cacheFailedRequest(e);
15359
15080
  }
15360
- if (e instanceof ServerError &&
15361
- e.errorCode === BrowserConstants.INVALID_GRANT_ERROR) {
15362
- this.performanceClient.addFields({
15363
- retryError: e.errorCode,
15364
- }, this.correlationId);
15365
- const requestRetried = this.browserStorage.getRequestRetried();
15366
- if (requestRetried) {
15367
- this.logger.error("Retried request already detected. Throwing error.");
15368
- this.browserStorage.removeRequestRetried();
15369
- throw e;
15370
- }
15371
- const redirectRequest = this.browserStorage.getCachedRedirectRequest();
15372
- if (!redirectRequest) {
15373
- this.logger.error("Unable to retry. Please retry with redirect request");
15374
- this.browserStorage.setRequestRetried();
15375
- throw createBrowserAuthError(failedToRetry);
15376
- }
15377
- this.browserStorage.setRequestRetried();
15378
- await this.acquireToken(redirectRequest);
15379
- return null;
15380
- }
15381
- this.browserStorage.removeTemporaryItem(this.browserStorage.generateCacheKey(TemporaryCacheKeys.REDIRECT_REQUEST));
15382
- this.browserStorage.removeRequestRetried();
15383
- throw e;
15384
- }
15385
- finally {
15386
15081
  this.browserStorage.cleanRequestByInteractionType(exports.InteractionType.Redirect);
15082
+ throw e;
15387
15083
  }
15388
15084
  }
15389
15085
  /**
@@ -15738,7 +15434,7 @@ class SilentIframeClient extends StandardInteractionClient {
15738
15434
  serverTelemetryManager.cacheFailedRequest(e);
15739
15435
  }
15740
15436
  if (!authClient ||
15741
- !(e instanceof ServerError) ||
15437
+ !(e instanceof AuthError) ||
15742
15438
  e.errorCode !== BrowserConstants.INVALID_GRANT_ERROR) {
15743
15439
  throw e;
15744
15440
  }
@@ -19393,6 +19089,169 @@ class SignedHttpRequest {
19393
19089
  }
19394
19090
  }
19395
19091
 
19092
+ /*
19093
+ * Copyright (c) Microsoft Corporation. All rights reserved.
19094
+ * Licensed under the MIT License.
19095
+ */
19096
+ /**
19097
+ * Returns browser performance measurement module if session flag is enabled. Returns undefined otherwise.
19098
+ */
19099
+ function getPerfMeasurementModule() {
19100
+ let sessionStorage;
19101
+ try {
19102
+ sessionStorage = window[BrowserCacheLocation.SessionStorage];
19103
+ const perfEnabled = sessionStorage?.getItem(BROWSER_PERF_ENABLED_KEY);
19104
+ if (Number(perfEnabled) === 1) {
19105
+ return Promise.resolve().then(function () { return BrowserPerformanceMeasurement$1; });
19106
+ }
19107
+ // Mute errors if it's a non-browser environment or cookies are blocked.
19108
+ }
19109
+ catch (e) { }
19110
+ return undefined;
19111
+ }
19112
+ /**
19113
+ * Returns boolean, indicating whether browser supports window.performance.now() function.
19114
+ */
19115
+ function supportsBrowserPerformanceNow() {
19116
+ return (typeof window !== "undefined" &&
19117
+ typeof window.performance !== "undefined" &&
19118
+ typeof window.performance.now === "function");
19119
+ }
19120
+ /**
19121
+ * Returns event duration in milliseconds using window performance API if available. Returns undefined otherwise.
19122
+ * @param startTime {DOMHighResTimeStamp | undefined}
19123
+ * @returns {number | undefined}
19124
+ */
19125
+ function getPerfDurationMs(startTime) {
19126
+ if (!startTime || !supportsBrowserPerformanceNow()) {
19127
+ return undefined;
19128
+ }
19129
+ return Math.round(window.performance.now() - startTime);
19130
+ }
19131
+ class BrowserPerformanceClient extends PerformanceClient {
19132
+ constructor(configuration, intFields, abbreviations) {
19133
+ super(configuration.auth.clientId, configuration.auth.authority || `${Constants.DEFAULT_AUTHORITY}`, new Logger(configuration.system?.loggerOptions || {}, name, version), name, version, configuration.telemetry?.application || {
19134
+ appName: "",
19135
+ appVersion: "",
19136
+ }, intFields, abbreviations);
19137
+ }
19138
+ generateId() {
19139
+ return createNewGuid();
19140
+ }
19141
+ getPageVisibility() {
19142
+ return document.visibilityState?.toString() || null;
19143
+ }
19144
+ deleteIncompleteSubMeasurements(inProgressEvent) {
19145
+ void getPerfMeasurementModule()?.then((module) => {
19146
+ const rootEvent = this.eventsByCorrelationId.get(inProgressEvent.event.correlationId);
19147
+ const isRootEvent = rootEvent &&
19148
+ rootEvent.eventId === inProgressEvent.event.eventId;
19149
+ const incompleteMeasurements = [];
19150
+ if (isRootEvent && rootEvent?.incompleteSubMeasurements) {
19151
+ rootEvent.incompleteSubMeasurements.forEach((subMeasurement) => {
19152
+ incompleteMeasurements.push({ ...subMeasurement });
19153
+ });
19154
+ }
19155
+ // Clean up remaining marks for incomplete sub-measurements
19156
+ module.BrowserPerformanceMeasurement.flushMeasurements(inProgressEvent.event.correlationId, incompleteMeasurements);
19157
+ });
19158
+ }
19159
+ /**
19160
+ * Starts measuring performance for a given operation. Returns a function that should be used to end the measurement.
19161
+ * Also captures browser page visibilityState.
19162
+ *
19163
+ * @param {PerformanceEvents} measureName
19164
+ * @param {?string} [correlationId]
19165
+ * @returns {((event?: Partial<PerformanceEvent>) => PerformanceEvent| null)}
19166
+ */
19167
+ startMeasurement(measureName, correlationId) {
19168
+ // Capture page visibilityState and then invoke start/end measurement
19169
+ const startPageVisibility = this.getPageVisibility();
19170
+ const inProgressEvent = super.startMeasurement(measureName, correlationId);
19171
+ const startTime = supportsBrowserPerformanceNow()
19172
+ ? window.performance.now()
19173
+ : undefined;
19174
+ const browserMeasurement = getPerfMeasurementModule()?.then((module) => {
19175
+ return new module.BrowserPerformanceMeasurement(measureName, inProgressEvent.event.correlationId);
19176
+ });
19177
+ void browserMeasurement?.then((measurement) => measurement.startMeasurement());
19178
+ return {
19179
+ ...inProgressEvent,
19180
+ end: (event, error) => {
19181
+ const res = inProgressEvent.end({
19182
+ ...event,
19183
+ startPageVisibility,
19184
+ endPageVisibility: this.getPageVisibility(),
19185
+ durationMs: getPerfDurationMs(startTime),
19186
+ }, error);
19187
+ void browserMeasurement?.then((measurement) => measurement.endMeasurement());
19188
+ this.deleteIncompleteSubMeasurements(inProgressEvent);
19189
+ return res;
19190
+ },
19191
+ discard: () => {
19192
+ inProgressEvent.discard();
19193
+ void browserMeasurement?.then((measurement) => measurement.flushMeasurement());
19194
+ this.deleteIncompleteSubMeasurements(inProgressEvent);
19195
+ },
19196
+ };
19197
+ }
19198
+ /**
19199
+ * Adds pre-queue time to preQueueTimeByCorrelationId map.
19200
+ * @param {PerformanceEvents} eventName
19201
+ * @param {?string} correlationId
19202
+ * @returns
19203
+ */
19204
+ setPreQueueTime(eventName, correlationId) {
19205
+ if (!supportsBrowserPerformanceNow()) {
19206
+ this.logger.trace(`BrowserPerformanceClient: window performance API not available, unable to set telemetry queue time for ${eventName}`);
19207
+ return;
19208
+ }
19209
+ if (!correlationId) {
19210
+ this.logger.trace(`BrowserPerformanceClient: correlationId for ${eventName} not provided, unable to set telemetry queue time`);
19211
+ return;
19212
+ }
19213
+ const preQueueEvent = this.preQueueTimeByCorrelationId.get(correlationId);
19214
+ /**
19215
+ * Manually complete queue measurement if there is an incomplete pre-queue event.
19216
+ * Incomplete pre-queue events are instrumentation bugs that should be fixed.
19217
+ */
19218
+ if (preQueueEvent) {
19219
+ this.logger.trace(`BrowserPerformanceClient: Incomplete pre-queue ${preQueueEvent.name} found`, correlationId);
19220
+ this.addQueueMeasurement(preQueueEvent.name, correlationId, undefined, true);
19221
+ }
19222
+ this.preQueueTimeByCorrelationId.set(correlationId, {
19223
+ name: eventName,
19224
+ time: window.performance.now(),
19225
+ });
19226
+ }
19227
+ /**
19228
+ * Calculates and adds queue time measurement for given performance event.
19229
+ *
19230
+ * @param {PerformanceEvents} eventName
19231
+ * @param {?string} correlationId
19232
+ * @param {?number} queueTime
19233
+ * @param {?boolean} manuallyCompleted - indicator for manually completed queue measurements
19234
+ * @returns
19235
+ */
19236
+ addQueueMeasurement(eventName, correlationId, queueTime, manuallyCompleted) {
19237
+ if (!supportsBrowserPerformanceNow()) {
19238
+ this.logger.trace(`BrowserPerformanceClient: window performance API not available, unable to add queue measurement for ${eventName}`);
19239
+ return;
19240
+ }
19241
+ if (!correlationId) {
19242
+ this.logger.trace(`BrowserPerformanceClient: correlationId for ${eventName} not provided, unable to add queue measurement`);
19243
+ return;
19244
+ }
19245
+ const preQueueTime = super.getPreQueueTime(eventName, correlationId);
19246
+ if (!preQueueTime) {
19247
+ return;
19248
+ }
19249
+ const currentTime = window.performance.now();
19250
+ const resQueueTime = queueTime || super.calculateQueuedTime(preQueueTime, currentTime);
19251
+ return super.addQueueMeasurement(eventName, correlationId, resQueueTime, manuallyCompleted);
19252
+ }
19253
+ }
19254
+
19396
19255
  /*
19397
19256
  * Copyright (c) Microsoft Corporation. All rights reserved.
19398
19257
  * Licensed under the MIT License.