@bitwarden/cli 2025.1.0 → 2025.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/bw.js CHANGED
@@ -2193,6 +2193,7 @@ class EditCommand {
2193
2193
  this.apiService = apiService;
2194
2194
  this.folderApiService = folderApiService;
2195
2195
  this.accountService = accountService;
2196
+ this.activeUserId$ = this.accountService.activeAccount$.pipe((0,rxjs__WEBPACK_IMPORTED_MODULE_0__.map)((a) => a === null || a === void 0 ? void 0 : a.id));
2196
2197
  }
2197
2198
  run(object, id, requestJson, cmdOptions) {
2198
2199
  return __awaiter(this, void 0, void 0, function* () {
@@ -2268,9 +2269,8 @@ class EditCommand {
2268
2269
  }
2269
2270
  cipher.collectionIds = req;
2270
2271
  try {
2271
- const activeUserId = yield (0,rxjs__WEBPACK_IMPORTED_MODULE_0__.firstValueFrom)(this.accountService.activeAccount$.pipe((0,rxjs__WEBPACK_IMPORTED_MODULE_0__.map)((a) => a === null || a === void 0 ? void 0 : a.id)));
2272
2272
  const updatedCipher = yield this.cipherService.saveCollectionsWithServer(cipher);
2273
- const decCipher = yield updatedCipher.decrypt(yield this.cipherService.getKeyForCipherKeyDecryption(updatedCipher, activeUserId));
2273
+ const decCipher = yield updatedCipher.decrypt(yield this.cipherService.getKeyForCipherKeyDecryption(updatedCipher, yield (0,rxjs__WEBPACK_IMPORTED_MODULE_0__.firstValueFrom)(this.activeUserId$)));
2274
2274
  const res = new _vault_models_cipher_response__WEBPACK_IMPORTED_MODULE_9__/* .CipherResponse */ .N(decCipher);
2275
2275
  return _models_response__WEBPACK_IMPORTED_MODULE_7__/* .Response */ .Y.success(res);
2276
2276
  }
@@ -2281,18 +2281,18 @@ class EditCommand {
2281
2281
  }
2282
2282
  editFolder(id, req) {
2283
2283
  return __awaiter(this, void 0, void 0, function* () {
2284
- const folder = yield this.folderService.getFromState(id);
2284
+ const activeUserId = yield (0,rxjs__WEBPACK_IMPORTED_MODULE_0__.firstValueFrom)(this.activeUserId$);
2285
+ const folder = yield this.folderService.getFromState(id, activeUserId);
2285
2286
  if (folder == null) {
2286
2287
  return _models_response__WEBPACK_IMPORTED_MODULE_7__/* .Response */ .Y.notFound();
2287
2288
  }
2288
2289
  let folderView = yield folder.decrypt();
2289
2290
  folderView = _bitwarden_common_models_export_folder_export__WEBPACK_IMPORTED_MODULE_4__/* .FolderExport */ .V.toView(req, folderView);
2290
- const activeUserId = yield (0,rxjs__WEBPACK_IMPORTED_MODULE_0__.firstValueFrom)(this.accountService.activeAccount$);
2291
- const userKey = yield this.keyService.getUserKeyWithLegacySupport(activeUserId.id);
2291
+ const userKey = yield this.keyService.getUserKeyWithLegacySupport(activeUserId);
2292
2292
  const encFolder = yield this.folderService.encrypt(folderView, userKey);
2293
2293
  try {
2294
- yield this.folderApiService.save(encFolder);
2295
- const updatedFolder = yield this.folderService.get(folder.id);
2294
+ yield this.folderApiService.save(encFolder, activeUserId);
2295
+ const updatedFolder = yield this.folderService.get(folder.id, activeUserId);
2296
2296
  const decFolder = yield updatedFolder.decrypt();
2297
2297
  const res = new _vault_models_folder_response__WEBPACK_IMPORTED_MODULE_10__/* .FolderResponse */ .s(decFolder);
2298
2298
  return _models_response__WEBPACK_IMPORTED_MODULE_7__/* .Response */ .Y.success(res);
@@ -2505,6 +2505,7 @@ class GetCommand extends download_command/* DownloadCommand */._ {
2505
2505
  this.eventCollectionService = eventCollectionService;
2506
2506
  this.accountProfileService = accountProfileService;
2507
2507
  this.accountService = accountService;
2508
+ this.activeUserId$ = this.accountService.activeAccount$.pipe((0,external_rxjs_.map)((a) => a === null || a === void 0 ? void 0 : a.id));
2508
2509
  }
2509
2510
  run(object, id, cmdOptions) {
2510
2511
  return __awaiter(this, void 0, void 0, function* () {
@@ -2551,8 +2552,8 @@ class GetCommand extends download_command/* DownloadCommand */._ {
2551
2552
  let decCipher = null;
2552
2553
  if (utils/* Utils */.A.isGuid(id)) {
2553
2554
  const cipher = yield this.cipherService.get(id);
2554
- const activeUserId = yield (0,external_rxjs_.firstValueFrom)(this.accountService.activeAccount$.pipe((0,external_rxjs_.map)((a) => a === null || a === void 0 ? void 0 : a.id)));
2555
2555
  if (cipher != null) {
2556
+ const activeUserId = yield (0,external_rxjs_.firstValueFrom)(this.activeUserId$);
2556
2557
  decCipher = yield cipher.decrypt(yield this.cipherService.getKeyForCipherKeyDecryption(cipher, activeUserId));
2557
2558
  }
2558
2559
  }
@@ -2586,9 +2587,7 @@ class GetCommand extends download_command/* DownloadCommand */._ {
2586
2587
  return models_response/* Response */.Y.multipleResults(decCipher.map((c) => c.id));
2587
2588
  }
2588
2589
  }
2589
- // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling.
2590
- // eslint-disable-next-line @typescript-eslint/no-floating-promises
2591
- this.eventCollectionService.collect(enums/* EventType */.Bx.Cipher_ClientViewed, id, true, decCipher.organizationId);
2590
+ yield this.eventCollectionService.collect(enums/* EventType */.Bx.Cipher_ClientViewed, decCipher.id, true, decCipher.organizationId);
2592
2591
  const res = new cipher_response/* CipherResponse */.N(decCipher);
2593
2592
  return models_response/* Response */.Y.success(res);
2594
2593
  });
@@ -2666,7 +2665,8 @@ class GetCommand extends download_command/* DownloadCommand */._ {
2666
2665
  if (totp == null) {
2667
2666
  return models_response/* Response */.Y.error("Couldn't generate TOTP code.");
2668
2667
  }
2669
- const canAccessPremium = yield (0,external_rxjs_.firstValueFrom)(this.accountProfileService.hasPremiumFromAnySource$);
2668
+ const account = yield (0,external_rxjs_.firstValueFrom)(this.accountService.activeAccount$);
2669
+ const canAccessPremium = yield (0,external_rxjs_.firstValueFrom)(this.accountProfileService.hasPremiumFromAnySource$(account.id));
2670
2670
  if (!canAccessPremium) {
2671
2671
  const originalCipher = yield this.cipherService.get(cipher.id);
2672
2672
  if (originalCipher == null ||
@@ -2733,7 +2733,8 @@ class GetCommand extends download_command/* DownloadCommand */._ {
2733
2733
  if (attachments.length > 1) {
2734
2734
  return models_response/* Response */.Y.multipleResults(attachments.map((a) => a.id));
2735
2735
  }
2736
- const canAccessPremium = yield (0,external_rxjs_.firstValueFrom)(this.accountProfileService.hasPremiumFromAnySource$);
2736
+ const account = yield (0,external_rxjs_.firstValueFrom)(this.accountService.activeAccount$);
2737
+ const canAccessPremium = yield (0,external_rxjs_.firstValueFrom)(this.accountProfileService.hasPremiumFromAnySource$(account.id));
2737
2738
  if (!canAccessPremium) {
2738
2739
  const originalCipher = yield this.cipherService.get(cipher.id);
2739
2740
  if (originalCipher == null || originalCipher.organizationId == null) {
@@ -2765,14 +2766,15 @@ class GetCommand extends download_command/* DownloadCommand */._ {
2765
2766
  getFolder(id) {
2766
2767
  return __awaiter(this, void 0, void 0, function* () {
2767
2768
  let decFolder = null;
2769
+ const activeUserId = yield (0,external_rxjs_.firstValueFrom)(this.activeUserId$);
2768
2770
  if (utils/* Utils */.A.isGuid(id)) {
2769
- const folder = yield this.folderService.getFromState(id);
2771
+ const folder = yield this.folderService.getFromState(id, activeUserId);
2770
2772
  if (folder != null) {
2771
2773
  decFolder = yield folder.decrypt();
2772
2774
  }
2773
2775
  }
2774
2776
  else if (id.trim() !== "") {
2775
- let folders = yield this.folderService.getAllDecryptedFromState();
2777
+ let folders = yield this.folderService.getAllDecryptedFromState(activeUserId);
2776
2778
  folders = src_utils/* CliUtils */.U.searchFolders(folders, id);
2777
2779
  if (folders.length > 1) {
2778
2780
  return models_response/* Response */.Y.multipleResults(folders.map((f) => f.id));
@@ -2925,7 +2927,7 @@ class GetCommand extends download_command/* DownloadCommand */._ {
2925
2927
  return __awaiter(this, void 0, void 0, function* () {
2926
2928
  let fingerprint = null;
2927
2929
  if (id === "me") {
2928
- const activeUserId = yield (0,external_rxjs_.firstValueFrom)(this.accountService.activeAccount$.pipe((0,external_rxjs_.map)((a) => a === null || a === void 0 ? void 0 : a.id)));
2930
+ const activeUserId = yield (0,external_rxjs_.firstValueFrom)(this.activeUserId$);
2929
2931
  const publicKey = yield (0,external_rxjs_.firstValueFrom)(this.keyService.userPublicKey$(activeUserId));
2930
2932
  fingerprint = yield this.keyService.getFingerprint(activeUserId, publicKey);
2931
2933
  }
@@ -3019,7 +3021,7 @@ var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _argume
3019
3021
 
3020
3022
 
3021
3023
  class ListCommand {
3022
- constructor(cipherService, folderService, collectionService, organizationService, searchService, organizationUserApiService, apiService, eventCollectionService) {
3024
+ constructor(cipherService, folderService, collectionService, organizationService, searchService, organizationUserApiService, apiService, eventCollectionService, accountService) {
3023
3025
  this.cipherService = cipherService;
3024
3026
  this.folderService = folderService;
3025
3027
  this.collectionService = collectionService;
@@ -3028,6 +3030,7 @@ class ListCommand {
3028
3030
  this.organizationUserApiService = organizationUserApiService;
3029
3031
  this.apiService = apiService;
3030
3032
  this.eventCollectionService = eventCollectionService;
3033
+ this.accountService = accountService;
3031
3034
  }
3032
3035
  run(object, cmdOptions) {
3033
3036
  return __awaiter(this, void 0, void 0, function* () {
@@ -3117,7 +3120,8 @@ class ListCommand {
3117
3120
  }
3118
3121
  listFolders(options) {
3119
3122
  return __awaiter(this, void 0, void 0, function* () {
3120
- let folders = yield this.folderService.getAllDecryptedFromState();
3123
+ const activeUserId = yield (0,external_rxjs_.firstValueFrom)(this.accountService.activeAccount$.pipe((0,external_rxjs_.map)((a) => a === null || a === void 0 ? void 0 : a.id)));
3124
+ let folders = yield this.folderService.getAllDecryptedFromState(activeUserId);
3121
3125
  if (options.search != null && options.search.trim() !== "") {
3122
3126
  folders = src_utils/* CliUtils */.U.searchFolders(folders, options.search);
3123
3127
  }
@@ -3367,6 +3371,57 @@ class StatusCommand {
3367
3371
  }
3368
3372
 
3369
3373
 
3374
+ /***/ }),
3375
+
3376
+ /***/ 9653:
3377
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
3378
+
3379
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
3380
+ /* harmony export */ F: () => (/* binding */ CliBiometricsService)
3381
+ /* harmony export */ });
3382
+ /* harmony import */ var _bitwarden_key_management__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5907);
3383
+ var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
3384
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3385
+ return new (P || (P = Promise))(function (resolve, reject) {
3386
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
3387
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
3388
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
3389
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
3390
+ });
3391
+ };
3392
+
3393
+ class CliBiometricsService extends _bitwarden_key_management__WEBPACK_IMPORTED_MODULE_0__/* .BiometricsService */ .Zm {
3394
+ authenticateWithBiometrics() {
3395
+ return __awaiter(this, void 0, void 0, function* () {
3396
+ return false;
3397
+ });
3398
+ }
3399
+ getBiometricsStatus() {
3400
+ return __awaiter(this, void 0, void 0, function* () {
3401
+ return _bitwarden_key_management__WEBPACK_IMPORTED_MODULE_0__/* .BiometricsStatus */ .cR.PlatformUnsupported;
3402
+ });
3403
+ }
3404
+ unlockWithBiometricsForUser(userId) {
3405
+ return __awaiter(this, void 0, void 0, function* () {
3406
+ return null;
3407
+ });
3408
+ }
3409
+ getBiometricsStatusForUser(userId) {
3410
+ return __awaiter(this, void 0, void 0, function* () {
3411
+ return _bitwarden_key_management__WEBPACK_IMPORTED_MODULE_0__/* .BiometricsStatus */ .cR.PlatformUnsupported;
3412
+ });
3413
+ }
3414
+ getShouldAutopromptNow() {
3415
+ return __awaiter(this, void 0, void 0, function* () {
3416
+ return false;
3417
+ });
3418
+ }
3419
+ setShouldAutopromptNow(value) {
3420
+ return __awaiter(this, void 0, void 0, function* () { });
3421
+ }
3422
+ }
3423
+
3424
+
3370
3425
  /***/ }),
3371
3426
 
3372
3427
  /***/ 7035:
@@ -8020,7 +8075,7 @@ class SendProgram extends base_program/* BaseProgram */.C {
8020
8075
  .action((encodedJson, options) => send_program_awaiter(this, void 0, void 0, function* () {
8021
8076
  yield this.exitIfLocked();
8022
8077
  const getCmd = new commands/* SendGetCommand */.MA(this.serviceContainer.sendService, this.serviceContainer.environmentService, this.serviceContainer.searchService, this.serviceContainer.encryptService, this.serviceContainer.apiService);
8023
- const cmd = new commands/* SendEditCommand */._s(this.serviceContainer.sendService, getCmd, this.serviceContainer.sendApiService, this.serviceContainer.billingAccountProfileStateService);
8078
+ const cmd = new commands/* SendEditCommand */._s(this.serviceContainer.sendService, getCmd, this.serviceContainer.sendApiService, this.serviceContainer.billingAccountProfileStateService, this.serviceContainer.accountService);
8024
8079
  const response = yield cmd.run(encodedJson, options);
8025
8080
  this.processResponse(response);
8026
8081
  }));
@@ -8077,7 +8132,7 @@ class SendProgram extends base_program/* BaseProgram */.C {
8077
8132
  runCreate(encodedJson, options) {
8078
8133
  return send_program_awaiter(this, void 0, void 0, function* () {
8079
8134
  yield this.exitIfLocked();
8080
- const cmd = new commands/* SendCreateCommand */.QR(this.serviceContainer.sendService, this.serviceContainer.environmentService, this.serviceContainer.sendApiService, this.serviceContainer.billingAccountProfileStateService);
8135
+ const cmd = new commands/* SendCreateCommand */.QR(this.serviceContainer.sendService, this.serviceContainer.environmentService, this.serviceContainer.sendApiService, this.serviceContainer.billingAccountProfileStateService, this.serviceContainer.accountService);
8081
8136
  return yield cmd.run(encodedJson, options);
8082
8137
  });
8083
8138
  }
@@ -8426,7 +8481,7 @@ class VaultProgram extends base_program/* BaseProgram */.C {
8426
8481
  return;
8427
8482
  }
8428
8483
  yield this.exitIfLocked();
8429
- const command = new list_command/* ListCommand */.S(this.serviceContainer.cipherService, this.serviceContainer.folderService, this.serviceContainer.collectionService, this.serviceContainer.organizationService, this.serviceContainer.searchService, this.serviceContainer.organizationUserApiService, this.serviceContainer.apiService, this.serviceContainer.eventCollectionService);
8484
+ const command = new list_command/* ListCommand */.S(this.serviceContainer.cipherService, this.serviceContainer.folderService, this.serviceContainer.collectionService, this.serviceContainer.organizationService, this.serviceContainer.searchService, this.serviceContainer.organizationUserApiService, this.serviceContainer.apiService, this.serviceContainer.eventCollectionService, this.serviceContainer.accountService);
8430
8485
  const response = yield command.run(object, cmd);
8431
8486
  this.processResponse(response);
8432
8487
  }));
@@ -8563,7 +8618,7 @@ class VaultProgram extends base_program/* BaseProgram */.C {
8563
8618
  return;
8564
8619
  }
8565
8620
  yield this.exitIfLocked();
8566
- const command = new delete_command/* DeleteCommand */.R(this.serviceContainer.cipherService, this.serviceContainer.folderService, this.serviceContainer.apiService, this.serviceContainer.folderApiService, this.serviceContainer.billingAccountProfileStateService, this.serviceContainer.cipherAuthorizationService);
8621
+ const command = new delete_command/* DeleteCommand */.R(this.serviceContainer.cipherService, this.serviceContainer.folderService, this.serviceContainer.apiService, this.serviceContainer.folderApiService, this.serviceContainer.billingAccountProfileStateService, this.serviceContainer.cipherAuthorizationService, this.serviceContainer.accountService);
8567
8622
  const response = yield command.run(object, id, cmd);
8568
8623
  this.processResponse(response);
8569
8624
  }));
@@ -8904,16 +8959,16 @@ __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __we
8904
8959
  /* harmony import */ var _bitwarden_common_autofill_services_domain_settings_service__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(3400);
8905
8960
  /* harmony import */ var _bitwarden_common_billing_services_account_billing_account_profile_state_service__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(9344);
8906
8961
  /* harmony import */ var _bitwarden_common_enums__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(832);
8907
- /* harmony import */ var _bitwarden_common_platform_enums__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(6425);
8908
- /* harmony import */ var _bitwarden_common_platform_factories_state_factory__WEBPACK_IMPORTED_MODULE_84__ = __webpack_require__(1737);
8962
+ /* harmony import */ var _bitwarden_common_platform_enums__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(5874);
8963
+ /* harmony import */ var _bitwarden_common_platform_factories_state_factory__WEBPACK_IMPORTED_MODULE_85__ = __webpack_require__(1737);
8909
8964
  /* harmony import */ var _bitwarden_common_platform_messaging__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(3083);
8910
8965
  /* harmony import */ var _bitwarden_common_platform_models_domain_account__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(1656);
8911
- /* harmony import */ var _bitwarden_common_platform_models_domain_global_state__WEBPACK_IMPORTED_MODULE_85__ = __webpack_require__(9464);
8966
+ /* harmony import */ var _bitwarden_common_platform_models_domain_global_state__WEBPACK_IMPORTED_MODULE_86__ = __webpack_require__(9464);
8912
8967
  /* harmony import */ var _bitwarden_common_platform_scheduling__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(7143);
8913
8968
  /* harmony import */ var _bitwarden_common_platform_services_app_id_service__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(5444);
8914
8969
  /* harmony import */ var _bitwarden_common_platform_services_config_config_api_service__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(178);
8915
8970
  /* harmony import */ var _bitwarden_common_platform_services_config_default_config_service__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(6497);
8916
- /* harmony import */ var _bitwarden_common_platform_services_container_service__WEBPACK_IMPORTED_MODULE_86__ = __webpack_require__(7634);
8971
+ /* harmony import */ var _bitwarden_common_platform_services_container_service__WEBPACK_IMPORTED_MODULE_87__ = __webpack_require__(7634);
8917
8972
  /* harmony import */ var _bitwarden_common_platform_services_cryptography_encrypt_service_implementation__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(2334);
8918
8973
  /* harmony import */ var _bitwarden_common_platform_services_cryptography_fallback_bulk_encrypt_service__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(8943);
8919
8974
  /* harmony import */ var _bitwarden_common_platform_services_default_environment_service__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(772);
@@ -8924,9 +8979,9 @@ __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __we
8924
8979
  /* harmony import */ var _bitwarden_common_platform_services_migration_runner__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(2539);
8925
8980
  /* harmony import */ var _bitwarden_common_platform_services_sdk_default_sdk_client_factory__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(4536);
8926
8981
  /* harmony import */ var _bitwarden_common_platform_services_sdk_default_sdk_service__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(3315);
8927
- /* harmony import */ var _bitwarden_common_platform_services_sdk_noop_sdk_client_factory__WEBPACK_IMPORTED_MODULE_88__ = __webpack_require__(2203);
8982
+ /* harmony import */ var _bitwarden_common_platform_services_sdk_noop_sdk_client_factory__WEBPACK_IMPORTED_MODULE_89__ = __webpack_require__(2203);
8928
8983
  /* harmony import */ var _bitwarden_common_platform_services_state_service__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(4640);
8929
- /* harmony import */ var _bitwarden_common_platform_services_storage_service_provider__WEBPACK_IMPORTED_MODULE_83__ = __webpack_require__(8216);
8984
+ /* harmony import */ var _bitwarden_common_platform_services_storage_service_provider__WEBPACK_IMPORTED_MODULE_84__ = __webpack_require__(8216);
8930
8985
  /* harmony import */ var _bitwarden_common_platform_services_user_auto_unlock_key_service__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(9429);
8931
8986
  /* harmony import */ var _bitwarden_common_platform_state__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(1068);
8932
8987
  /* harmony import */ var _bitwarden_common_platform_state_implementations_default_active_user_state_provider__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(5517);
@@ -8956,16 +9011,17 @@ __webpack_require__.a(module, async (__webpack_handle_async_dependencies__, __we
8956
9011
  /* harmony import */ var _bitwarden_common_vault_services_totp_service__WEBPACK_IMPORTED_MODULE_71__ = __webpack_require__(4809);
8957
9012
  /* harmony import */ var _bitwarden_generator_legacy__WEBPACK_IMPORTED_MODULE_72__ = __webpack_require__(2912);
8958
9013
  /* harmony import */ var _bitwarden_importer_core__WEBPACK_IMPORTED_MODULE_73__ = __webpack_require__(9711);
8959
- /* harmony import */ var _bitwarden_key_management__WEBPACK_IMPORTED_MODULE_74__ = __webpack_require__(8614);
8960
- /* harmony import */ var _bitwarden_node_services_node_crypto_function_service__WEBPACK_IMPORTED_MODULE_75__ = __webpack_require__(5696);
9014
+ /* harmony import */ var _bitwarden_key_management__WEBPACK_IMPORTED_MODULE_74__ = __webpack_require__(5907);
9015
+ /* harmony import */ var _bitwarden_node_services_node_crypto_function_service__WEBPACK_IMPORTED_MODULE_75__ = __webpack_require__(8248);
8961
9016
  /* harmony import */ var _bitwarden_vault_export_core__WEBPACK_IMPORTED_MODULE_76__ = __webpack_require__(1166);
8962
- /* harmony import */ var _platform_flags__WEBPACK_IMPORTED_MODULE_87__ = __webpack_require__(9308);
8963
- /* harmony import */ var _platform_services_cli_platform_utils_service__WEBPACK_IMPORTED_MODULE_77__ = __webpack_require__(6698);
8964
- /* harmony import */ var _platform_services_console_log_service__WEBPACK_IMPORTED_MODULE_78__ = __webpack_require__(5735);
8965
- /* harmony import */ var _platform_services_i18n_service__WEBPACK_IMPORTED_MODULE_79__ = __webpack_require__(5350);
8966
- /* harmony import */ var _platform_services_lowdb_storage_service__WEBPACK_IMPORTED_MODULE_80__ = __webpack_require__(1173);
8967
- /* harmony import */ var _platform_services_node_api_service__WEBPACK_IMPORTED_MODULE_81__ = __webpack_require__(1363);
8968
- /* harmony import */ var _platform_services_node_env_secure_storage_service__WEBPACK_IMPORTED_MODULE_82__ = __webpack_require__(9177);
9017
+ /* harmony import */ var _key_management_cli_biometrics_service__WEBPACK_IMPORTED_MODULE_77__ = __webpack_require__(9653);
9018
+ /* harmony import */ var _platform_flags__WEBPACK_IMPORTED_MODULE_88__ = __webpack_require__(9308);
9019
+ /* harmony import */ var _platform_services_cli_platform_utils_service__WEBPACK_IMPORTED_MODULE_78__ = __webpack_require__(6698);
9020
+ /* harmony import */ var _platform_services_console_log_service__WEBPACK_IMPORTED_MODULE_79__ = __webpack_require__(5735);
9021
+ /* harmony import */ var _platform_services_i18n_service__WEBPACK_IMPORTED_MODULE_80__ = __webpack_require__(5350);
9022
+ /* harmony import */ var _platform_services_lowdb_storage_service__WEBPACK_IMPORTED_MODULE_81__ = __webpack_require__(1173);
9023
+ /* harmony import */ var _platform_services_node_api_service__WEBPACK_IMPORTED_MODULE_82__ = __webpack_require__(1363);
9024
+ /* harmony import */ var _platform_services_node_env_secure_storage_service__WEBPACK_IMPORTED_MODULE_83__ = __webpack_require__(9177);
8969
9025
  var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_bitwarden_common_platform_services_sdk_default_sdk_client_factory__WEBPACK_IMPORTED_MODULE_42__]);
8970
9026
  _bitwarden_common_platform_services_sdk_default_sdk_client_factory__WEBPACK_IMPORTED_MODULE_42__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
8971
9027
  var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
@@ -9068,6 +9124,7 @@ var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _argume
9068
9124
 
9069
9125
 
9070
9126
 
9127
+
9071
9128
 
9072
9129
 
9073
9130
  // Polyfills
@@ -9103,12 +9160,12 @@ class ServiceContainer {
9103
9160
  p = path__WEBPACK_IMPORTED_MODULE_1__.join((_c = process.env.HOME) !== null && _c !== void 0 ? _c : "", ".config/Bitwarden CLI");
9104
9161
  }
9105
9162
  const logoutCallback = () => __awaiter(this, void 0, void 0, function* () { return yield this.logout(); });
9106
- this.platformUtilsService = new _platform_services_cli_platform_utils_service__WEBPACK_IMPORTED_MODULE_77__/* .CliPlatformUtilsService */ .w(_bitwarden_common_enums__WEBPACK_IMPORTED_MODULE_26__/* .ClientType */ .sK.Cli, packageJson);
9107
- this.logService = new _platform_services_console_log_service__WEBPACK_IMPORTED_MODULE_78__/* .ConsoleLogService */ .V(this.platformUtilsService.isDev(), (level) => process.env.BITWARDENCLI_DEBUG !== "true" && level <= _bitwarden_common_platform_enums__WEBPACK_IMPORTED_MODULE_27__/* .LogLevelType */ .xk.Info);
9163
+ this.platformUtilsService = new _platform_services_cli_platform_utils_service__WEBPACK_IMPORTED_MODULE_78__/* .CliPlatformUtilsService */ .w(_bitwarden_common_enums__WEBPACK_IMPORTED_MODULE_26__/* .ClientType */ .sK.Cli, packageJson);
9164
+ this.logService = new _platform_services_console_log_service__WEBPACK_IMPORTED_MODULE_79__/* .ConsoleLogService */ .V(this.platformUtilsService.isDev(), (level) => process.env.BITWARDENCLI_DEBUG !== "true" && level <= _bitwarden_common_platform_enums__WEBPACK_IMPORTED_MODULE_27__/* .LogLevelType */ .xk.Info);
9108
9165
  this.cryptoFunctionService = new _bitwarden_node_services_node_crypto_function_service__WEBPACK_IMPORTED_MODULE_75__/* .NodeCryptoFunctionService */ .h();
9109
9166
  this.encryptService = new _bitwarden_common_platform_services_cryptography_encrypt_service_implementation__WEBPACK_IMPORTED_MODULE_34__/* .EncryptServiceImplementation */ .H(this.cryptoFunctionService, this.logService, true);
9110
- this.storageService = new _platform_services_lowdb_storage_service__WEBPACK_IMPORTED_MODULE_80__/* .LowdbStorageService */ .N(this.logService, null, p, false, true);
9111
- this.secureStorageService = new _platform_services_node_env_secure_storage_service__WEBPACK_IMPORTED_MODULE_82__/* .NodeEnvSecureStorageService */ .H(this.storageService, this.logService,
9167
+ this.storageService = new _platform_services_lowdb_storage_service__WEBPACK_IMPORTED_MODULE_81__/* .LowdbStorageService */ .N(this.logService, null, p, false, true);
9168
+ this.secureStorageService = new _platform_services_node_env_secure_storage_service__WEBPACK_IMPORTED_MODULE_83__/* .NodeEnvSecureStorageService */ .H(this.storageService, this.logService,
9112
9169
  // MAC failures for secure storage are being logged for customers today and
9113
9170
  // they occur when users unlock / login and refresh a session key but don't
9114
9171
  // export it into their environment (e.g. BW_SESSION_KEY). This leaves a stale
@@ -9118,11 +9175,11 @@ class ServiceContainer {
9118
9175
  new _bitwarden_common_platform_services_cryptography_encrypt_service_implementation__WEBPACK_IMPORTED_MODULE_34__/* .EncryptServiceImplementation */ .H(this.cryptoFunctionService, this.logService, false));
9119
9176
  this.memoryStorageService = new _bitwarden_common_platform_services_memory_storage_service__WEBPACK_IMPORTED_MODULE_39__/* .MemoryStorageService */ .g();
9120
9177
  this.memoryStorageForStateProviders = new _bitwarden_common_platform_state_storage_memory_storage_service__WEBPACK_IMPORTED_MODULE_53__/* .MemoryStorageService */ .g();
9121
- const storageServiceProvider = new _bitwarden_common_platform_services_storage_service_provider__WEBPACK_IMPORTED_MODULE_83__/* .StorageServiceProvider */ .w(this.storageService, this.memoryStorageForStateProviders);
9178
+ const storageServiceProvider = new _bitwarden_common_platform_services_storage_service_provider__WEBPACK_IMPORTED_MODULE_84__/* .StorageServiceProvider */ .w(this.storageService, this.memoryStorageForStateProviders);
9122
9179
  this.globalStateProvider = new _bitwarden_common_platform_state_implementations_default_global_state_provider__WEBPACK_IMPORTED_MODULE_49__/* .DefaultGlobalStateProvider */ .d(storageServiceProvider, this.logService);
9123
9180
  const stateEventRegistrarService = new _bitwarden_common_platform_state_state_event_registrar_service__WEBPACK_IMPORTED_MODULE_52__/* .StateEventRegistrarService */ .iO(this.globalStateProvider, storageServiceProvider);
9124
9181
  this.stateEventRunnerService = new _bitwarden_common_platform_state__WEBPACK_IMPORTED_MODULE_46__/* .StateEventRunnerService */ .lR(this.globalStateProvider, storageServiceProvider);
9125
- this.i18nService = new _platform_services_i18n_service__WEBPACK_IMPORTED_MODULE_79__/* .I18nService */ .W("en", "./locales", this.globalStateProvider);
9182
+ this.i18nService = new _platform_services_i18n_service__WEBPACK_IMPORTED_MODULE_80__/* .I18nService */ .W("en", "./locales", this.globalStateProvider);
9126
9183
  this.singleUserStateProvider = new _bitwarden_common_platform_state_implementations_default_single_user_state_provider__WEBPACK_IMPORTED_MODULE_50__/* .DefaultSingleUserStateProvider */ .B(storageServiceProvider, stateEventRegistrarService, this.logService);
9127
9184
  this.messagingService = _bitwarden_common_platform_messaging__WEBPACK_IMPORTED_MODULE_28__/* .MessageSender */ .D$.EMPTY;
9128
9185
  this.accountService = new _bitwarden_common_auth_services_account_service__WEBPACK_IMPORTED_MODULE_12__/* .AccountServiceImplementation */ .xy(this.messagingService, this.logService, this.globalStateProvider);
@@ -9133,7 +9190,7 @@ class ServiceContainer {
9133
9190
  this.keyGenerationService = new _bitwarden_common_platform_services_key_generation_service__WEBPACK_IMPORTED_MODULE_38__/* .KeyGenerationService */ .$(this.cryptoFunctionService);
9134
9191
  this.tokenService = new _bitwarden_common_auth_services_token_service__WEBPACK_IMPORTED_MODULE_19__/* .TokenService */ .B(this.singleUserStateProvider, this.globalStateProvider, this.platformUtilsService.supportsSecureStorage(), this.secureStorageService, this.keyGenerationService, this.encryptService, this.logService, logoutCallback);
9135
9192
  const migrationRunner = new _bitwarden_common_platform_services_migration_runner__WEBPACK_IMPORTED_MODULE_41__/* .MigrationRunner */ .N(this.storageService, this.logService, new _bitwarden_common_platform_services_migration_builder_service__WEBPACK_IMPORTED_MODULE_40__/* .MigrationBuilderService */ .l(), _bitwarden_common_enums__WEBPACK_IMPORTED_MODULE_26__/* .ClientType */ .sK.Cli);
9136
- this.stateService = new _bitwarden_common_platform_services_state_service__WEBPACK_IMPORTED_MODULE_44__/* .StateService */ .d(this.storageService, this.secureStorageService, this.memoryStorageService, this.logService, new _bitwarden_common_platform_factories_state_factory__WEBPACK_IMPORTED_MODULE_84__/* .StateFactory */ .Y(_bitwarden_common_platform_models_domain_global_state__WEBPACK_IMPORTED_MODULE_85__/* .GlobalState */ .R, _bitwarden_common_platform_models_domain_account__WEBPACK_IMPORTED_MODULE_29__/* .Account */ .gD), this.accountService, this.environmentService, this.tokenService, migrationRunner);
9193
+ this.stateService = new _bitwarden_common_platform_services_state_service__WEBPACK_IMPORTED_MODULE_44__/* .StateService */ .d(this.storageService, this.secureStorageService, this.memoryStorageService, this.logService, new _bitwarden_common_platform_factories_state_factory__WEBPACK_IMPORTED_MODULE_85__/* .StateFactory */ .Y(_bitwarden_common_platform_models_domain_global_state__WEBPACK_IMPORTED_MODULE_86__/* .GlobalState */ .R, _bitwarden_common_platform_models_domain_account__WEBPACK_IMPORTED_MODULE_29__/* .Account */ .gD), this.accountService, this.environmentService, this.tokenService, migrationRunner);
9137
9194
  this.masterPasswordService = new _bitwarden_common_auth_services_master_password_master_password_service__WEBPACK_IMPORTED_MODULE_18__/* .MasterPasswordService */ .x(this.stateProvider, this.stateService, this.keyGenerationService, this.encryptService, this.logService);
9138
9195
  this.kdfConfigService = new _bitwarden_key_management__WEBPACK_IMPORTED_MODULE_74__/* .DefaultKdfConfigService */ .aT(this.stateProvider);
9139
9196
  this.pinService = new _bitwarden_auth_common__WEBPACK_IMPORTED_MODULE_5__/* .PinService */ .d7(this.accountService, this.cryptoFunctionService, this.encryptService, this.kdfConfigService, this.keyGenerationService, this.logService, this.masterPasswordService, this.stateProvider, this.stateService);
@@ -9152,9 +9209,12 @@ class ServiceContainer {
9152
9209
  const refreshAccessTokenErrorCallback = () => {
9153
9210
  throw new Error("Refresh Access token error");
9154
9211
  };
9155
- this.apiService = new _platform_services_node_api_service__WEBPACK_IMPORTED_MODULE_81__/* .NodeApiService */ .c(this.tokenService, this.platformUtilsService, this.environmentService, this.appIdService, refreshAccessTokenErrorCallback, this.logService, logoutCallback, this.vaultTimeoutSettingsService, customUserAgent);
9156
- this.containerService = new _bitwarden_common_platform_services_container_service__WEBPACK_IMPORTED_MODULE_86__/* .ContainerService */ .J(this.keyService, this.encryptService);
9157
- this.domainSettingsService = new _bitwarden_common_autofill_services_domain_settings_service__WEBPACK_IMPORTED_MODULE_24__/* .DefaultDomainSettingsService */ .G(this.stateProvider);
9212
+ this.apiService = new _platform_services_node_api_service__WEBPACK_IMPORTED_MODULE_82__/* .NodeApiService */ .c(this.tokenService, this.platformUtilsService, this.environmentService, this.appIdService, refreshAccessTokenErrorCallback, this.logService, logoutCallback, this.vaultTimeoutSettingsService, customUserAgent);
9213
+ this.containerService = new _bitwarden_common_platform_services_container_service__WEBPACK_IMPORTED_MODULE_87__/* .ContainerService */ .J(this.keyService, this.encryptService);
9214
+ this.configApiService = new _bitwarden_common_platform_services_config_config_api_service__WEBPACK_IMPORTED_MODULE_32__/* .ConfigApiService */ .s(this.apiService, this.tokenService);
9215
+ this.authService = new _bitwarden_common_auth_services_auth_service__WEBPACK_IMPORTED_MODULE_13__/* .AuthService */ .u(this.accountService, this.messagingService, this.keyService, this.apiService, this.stateService, this.tokenService);
9216
+ this.configService = new _bitwarden_common_platform_services_config_default_config_service__WEBPACK_IMPORTED_MODULE_33__/* .DefaultConfigService */ .vQ(this.configApiService, this.environmentService, this.logService, this.stateProvider, this.authService);
9217
+ this.domainSettingsService = new _bitwarden_common_autofill_services_domain_settings_service__WEBPACK_IMPORTED_MODULE_24__/* .DefaultDomainSettingsService */ .G(this.stateProvider, this.configService);
9158
9218
  this.fileUploadService = new _bitwarden_common_platform_services_file_upload_file_upload_service__WEBPACK_IMPORTED_MODULE_37__/* .FileUploadService */ .P(this.logService, this.apiService);
9159
9219
  this.sendStateProvider = new _bitwarden_common_tools_send_services_send_state_provider__WEBPACK_IMPORTED_MODULE_63__/* .SendStateProvider */ .T(this.stateProvider);
9160
9220
  this.sendService = new _bitwarden_common_tools_send_services_send_service__WEBPACK_IMPORTED_MODULE_64__/* .SendService */ .u(this.keyService, this.i18nService, this.keyGenerationService, this.sendStateProvider, this.encryptService);
@@ -9166,18 +9226,15 @@ class ServiceContainer {
9166
9226
  this.policyApiService = new _bitwarden_common_admin_console_services_policy_policy_api_service__WEBPACK_IMPORTED_MODULE_8__/* .PolicyApiService */ .S(this.policyService, this.apiService);
9167
9227
  this.keyConnectorService = new _bitwarden_common_auth_services_key_connector_service__WEBPACK_IMPORTED_MODULE_17__/* .KeyConnectorService */ .Kl(this.accountService, this.masterPasswordService, this.keyService, this.apiService, this.tokenService, this.logService, this.organizationService, this.keyGenerationService, logoutCallback, this.stateProvider);
9168
9228
  this.twoFactorService = new _bitwarden_common_auth_services_two_factor_service__WEBPACK_IMPORTED_MODULE_20__/* .TwoFactorService */ .fz(this.i18nService, this.platformUtilsService, this.globalStateProvider);
9169
- const sdkClientFactory = (0,_platform_flags__WEBPACK_IMPORTED_MODULE_87__/* .flagEnabled */ .U5)("sdk")
9229
+ const sdkClientFactory = (0,_platform_flags__WEBPACK_IMPORTED_MODULE_88__/* .flagEnabled */ .U5)("sdk")
9170
9230
  ? new _bitwarden_common_platform_services_sdk_default_sdk_client_factory__WEBPACK_IMPORTED_MODULE_42__/* .DefaultSdkClientFactory */ .N()
9171
- : new _bitwarden_common_platform_services_sdk_noop_sdk_client_factory__WEBPACK_IMPORTED_MODULE_88__/* .NoopSdkClientFactory */ .e();
9231
+ : new _bitwarden_common_platform_services_sdk_noop_sdk_client_factory__WEBPACK_IMPORTED_MODULE_89__/* .NoopSdkClientFactory */ .e();
9172
9232
  this.sdkService = new _bitwarden_common_platform_services_sdk_default_sdk_service__WEBPACK_IMPORTED_MODULE_43__/* .DefaultSdkService */ .$(sdkClientFactory, this.environmentService, this.platformUtilsService, this.accountService, this.kdfConfigService, this.keyService, customUserAgent);
9173
9233
  this.passwordStrengthService = new _bitwarden_common_tools_password_strength__WEBPACK_IMPORTED_MODULE_61__/* .PasswordStrengthService */ .y();
9174
9234
  this.passwordGenerationService = (0,_bitwarden_generator_legacy__WEBPACK_IMPORTED_MODULE_72__/* .legacyPasswordGenerationServiceFactory */ .Im)(this.encryptService, this.keyService, this.policyService, this.accountService, this.stateProvider);
9175
9235
  this.authRequestService = new _bitwarden_auth_common__WEBPACK_IMPORTED_MODULE_5__/* .AuthRequestService */ .H8(this.appIdService, this.accountService, this.masterPasswordService, this.keyService, this.encryptService, this.apiService, this.stateProvider);
9176
- this.billingAccountProfileStateService = new _bitwarden_common_billing_services_account_billing_account_profile_state_service__WEBPACK_IMPORTED_MODULE_25__/* .DefaultBillingAccountProfileStateService */ .x(this.stateProvider);
9236
+ this.billingAccountProfileStateService = new _bitwarden_common_billing_services_account_billing_account_profile_state_service__WEBPACK_IMPORTED_MODULE_25__/* .DefaultBillingAccountProfileStateService */ .x(this.stateProvider, this.platformUtilsService, this.apiService);
9177
9237
  this.taskSchedulerService = new _bitwarden_common_platform_scheduling__WEBPACK_IMPORTED_MODULE_30__/* .DefaultTaskSchedulerService */ .P8(this.logService);
9178
- this.authService = new _bitwarden_common_auth_services_auth_service__WEBPACK_IMPORTED_MODULE_13__/* .AuthService */ .u(this.accountService, this.messagingService, this.keyService, this.apiService, this.stateService, this.tokenService);
9179
- this.configApiService = new _bitwarden_common_platform_services_config_config_api_service__WEBPACK_IMPORTED_MODULE_32__/* .ConfigApiService */ .s(this.apiService, this.tokenService);
9180
- this.configService = new _bitwarden_common_platform_services_config_default_config_service__WEBPACK_IMPORTED_MODULE_33__/* .DefaultConfigService */ .vQ(this.configApiService, this.environmentService, this.logService, this.stateProvider, this.authService);
9181
9238
  this.devicesApiService = new _bitwarden_common_auth_services_devices_api_service_implementation__WEBPACK_IMPORTED_MODULE_16__/* .DevicesApiServiceImplementation */ .D(this.apiService);
9182
9239
  this.deviceTrustService = new _bitwarden_common_auth_services_device_trust_service_implementation__WEBPACK_IMPORTED_MODULE_15__/* .DeviceTrustService */ .Wn(this.keyGenerationService, this.cryptoFunctionService, this.keyService, this.encryptService, this.appIdService, this.devicesApiService, this.i18nService, this.platformUtilsService, this.stateProvider, this.secureStorageService, this.userDecryptionOptionsService, this.logService, this.configService);
9183
9240
  this.loginStrategyService = new _bitwarden_auth_common__WEBPACK_IMPORTED_MODULE_5__/* .LoginStrategyService */ .CL(this.accountService, this.masterPasswordService, this.keyService, this.apiService, this.tokenService, this.appIdService, this.platformUtilsService, this.messagingService, this.logService, this.keyConnectorService, this.environmentService, this.stateService, this.twoFactorService, this.i18nService, this.encryptService, this.passwordStrengthService, this.policyService, this.deviceTrustService, this.authRequestService, this.userDecryptionOptionsService, this.globalStateProvider, this.billingAccountProfileStateService, this.vaultTimeoutSettingsService, this.kdfConfigService, this.taskSchedulerService);
@@ -9188,8 +9245,9 @@ class ServiceContainer {
9188
9245
  this.folderApiService = new _bitwarden_common_vault_services_folder_folder_api_service__WEBPACK_IMPORTED_MODULE_69__/* .FolderApiService */ .U(this.folderService, this.apiService);
9189
9246
  const lockedCallback = (userId) => __awaiter(this, void 0, void 0, function* () { return yield this.keyService.clearStoredUserKey(_bitwarden_common_platform_enums__WEBPACK_IMPORTED_MODULE_27__/* .KeySuffixOptions */ .hq.Auto); });
9190
9247
  this.userVerificationApiService = new _bitwarden_common_auth_services_user_verification_user_verification_api_service__WEBPACK_IMPORTED_MODULE_21__/* .UserVerificationApiService */ .S(this.apiService);
9191
- this.userVerificationService = new _bitwarden_common_auth_services_user_verification_user_verification_service__WEBPACK_IMPORTED_MODULE_22__/* .UserVerificationService */ .i(this.keyService, this.accountService, this.masterPasswordService, this.i18nService, this.userVerificationApiService, this.userDecryptionOptionsService, this.pinService, this.logService, this.vaultTimeoutSettingsService, this.platformUtilsService, this.kdfConfigService);
9192
- this.vaultTimeoutService = new _bitwarden_common_services_vault_timeout_vault_timeout_service__WEBPACK_IMPORTED_MODULE_60__/* .VaultTimeoutService */ .n(this.accountService, this.masterPasswordService, this.cipherService, this.folderService, this.collectionService, this.platformUtilsService, this.messagingService, this.searchService, this.stateService, this.authService, this.vaultTimeoutSettingsService, this.stateEventRunnerService, this.taskSchedulerService, this.logService, lockedCallback, undefined);
9248
+ this.userVerificationService = new _bitwarden_common_auth_services_user_verification_user_verification_service__WEBPACK_IMPORTED_MODULE_22__/* .UserVerificationService */ .i(this.keyService, this.accountService, this.masterPasswordService, this.i18nService, this.userVerificationApiService, this.userDecryptionOptionsService, this.pinService, this.kdfConfigService, new _key_management_cli_biometrics_service__WEBPACK_IMPORTED_MODULE_77__/* .CliBiometricsService */ .F());
9249
+ const biometricService = new _key_management_cli_biometrics_service__WEBPACK_IMPORTED_MODULE_77__/* .CliBiometricsService */ .F();
9250
+ this.vaultTimeoutService = new _bitwarden_common_services_vault_timeout_vault_timeout_service__WEBPACK_IMPORTED_MODULE_60__/* .VaultTimeoutService */ .n(this.accountService, this.masterPasswordService, this.cipherService, this.folderService, this.collectionService, this.platformUtilsService, this.messagingService, this.searchService, this.stateService, this.authService, this.vaultTimeoutSettingsService, this.stateEventRunnerService, this.taskSchedulerService, this.logService, biometricService, lockedCallback, undefined);
9193
9251
  this.avatarService = new _bitwarden_common_auth_services_avatar_service__WEBPACK_IMPORTED_MODULE_14__/* .AvatarService */ .v(this.apiService, this.stateProvider);
9194
9252
  this.syncService = new _bitwarden_common_platform_sync_internal__WEBPACK_IMPORTED_MODULE_54__/* .DefaultSyncService */ .A(this.masterPasswordService, this.accountService, this.apiService, this.domainSettingsService, this.folderService, this.cipherService, this.keyService, this.collectionService, this.messagingService, this.policyService, this.sendService, this.logService, this.keyConnectorService, this.stateService, this.providerService, this.folderApiService, this.organizationService, this.sendApiService, this.userDecryptionOptionsService, this.avatarService, logoutCallback, this.billingAccountProfileStateService, this.tokenService, this.authService, this.stateProvider);
9195
9253
  this.totpService = new _bitwarden_common_vault_services_totp_service__WEBPACK_IMPORTED_MODULE_71__/* .TotpService */ .R(this.cryptoFunctionService, this.logService);
@@ -9407,11 +9465,12 @@ var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _argume
9407
9465
 
9408
9466
 
9409
9467
  class SendCreateCommand {
9410
- constructor(sendService, environmentService, sendApiService, accountProfileService) {
9468
+ constructor(sendService, environmentService, sendApiService, accountProfileService, accountService) {
9411
9469
  this.sendService = sendService;
9412
9470
  this.environmentService = environmentService;
9413
9471
  this.sendApiService = sendApiService;
9414
9472
  this.accountProfileService = accountProfileService;
9473
+ this.accountService = accountService;
9415
9474
  }
9416
9475
  run(requestJson, cmdOptions) {
9417
9476
  return __awaiter(this, void 0, void 0, function* () {
@@ -9461,12 +9520,13 @@ class SendCreateCommand {
9461
9520
  const maxAccessCount = (_h = req.maxAccessCount) !== null && _h !== void 0 ? _h : options.maxAccessCount;
9462
9521
  req.key = null;
9463
9522
  req.maxAccessCount = maxAccessCount;
9523
+ const hasPremium$ = this.accountService.activeAccount$.pipe((0,external_rxjs_.switchMap)(({ id }) => this.accountProfileService.hasPremiumFromAnySource$(id)));
9464
9524
  switch (req.type) {
9465
9525
  case send_type/* SendType */.N.File:
9466
9526
  if (process.env.BW_SERVE === "true") {
9467
9527
  return models_response/* Response */.Y.error("Creating a file-based Send is unsupported through the `serve` command at this time.");
9468
9528
  }
9469
- if (!(yield (0,external_rxjs_.firstValueFrom)(this.accountProfileService.hasPremiumFromAnySource$))) {
9529
+ if (!(yield (0,external_rxjs_.firstValueFrom)(hasPremium$))) {
9470
9530
  return models_response/* Response */.Y.error("Premium status is required to use this feature.");
9471
9531
  }
9472
9532
  if (filePath == null) {
@@ -9570,11 +9630,12 @@ var edit_command_awaiter = (undefined && undefined.__awaiter) || function (thisA
9570
9630
 
9571
9631
 
9572
9632
  class SendEditCommand {
9573
- constructor(sendService, getCommand, sendApiService, accountProfileService) {
9633
+ constructor(sendService, getCommand, sendApiService, accountProfileService, accountService) {
9574
9634
  this.sendService = sendService;
9575
9635
  this.getCommand = getCommand;
9576
9636
  this.sendApiService = sendApiService;
9577
9637
  this.accountProfileService = accountProfileService;
9638
+ this.accountService = accountService;
9578
9639
  }
9579
9640
  run(requestJson, cmdOptions) {
9580
9641
  return edit_command_awaiter(this, void 0, void 0, function* () {
@@ -9611,7 +9672,8 @@ class SendEditCommand {
9611
9672
  if (send.type !== req.type) {
9612
9673
  return models_response/* Response */.Y.badRequest("Cannot change a Send's type");
9613
9674
  }
9614
- const canAccessPremium = yield (0,external_rxjs_.firstValueFrom)(this.accountProfileService.hasPremiumFromAnySource$);
9675
+ const account = yield (0,external_rxjs_.firstValueFrom)(this.accountService.activeAccount$);
9676
+ const canAccessPremium = yield (0,external_rxjs_.firstValueFrom)(this.accountProfileService.hasPremiumFromAnySource$(account.id));
9615
9677
  if (send.type === send_type/* SendType */.N.File && !canAccessPremium) {
9616
9678
  return models_response/* Response */.Y.error("Premium status is required to use this feature.");
9617
9679
  }
@@ -10648,6 +10710,7 @@ class CreateCommand {
10648
10710
  this.accountProfileService = accountProfileService;
10649
10711
  this.organizationService = organizationService;
10650
10712
  this.accountService = accountService;
10713
+ this.activeUserId$ = this.accountService.activeAccount$.pipe((0,rxjs__WEBPACK_IMPORTED_MODULE_2__.map)((a) => a === null || a === void 0 ? void 0 : a.id));
10651
10714
  }
10652
10715
  run(object_1, requestJson_1, cmdOptions_1) {
10653
10716
  return __awaiter(this, arguments, void 0, function* (object, requestJson, cmdOptions, additionalData = null) {
@@ -10689,7 +10752,7 @@ class CreateCommand {
10689
10752
  }
10690
10753
  createCipher(req) {
10691
10754
  return __awaiter(this, void 0, void 0, function* () {
10692
- const activeUserId = yield (0,rxjs__WEBPACK_IMPORTED_MODULE_2__.firstValueFrom)(this.accountService.activeAccount$.pipe((0,rxjs__WEBPACK_IMPORTED_MODULE_2__.map)((a) => a === null || a === void 0 ? void 0 : a.id)));
10755
+ const activeUserId = yield (0,rxjs__WEBPACK_IMPORTED_MODULE_2__.firstValueFrom)(this.activeUserId$);
10693
10756
  const cipher = yield this.cipherService.encrypt(_bitwarden_common_models_export_cipher_export__WEBPACK_IMPORTED_MODULE_4__/* .CipherExport */ .q.toView(req), activeUserId);
10694
10757
  try {
10695
10758
  const newCipher = yield this.cipherService.createWithServer(cipher);
@@ -10735,8 +10798,9 @@ class CreateCommand {
10735
10798
  if (cipher == null) {
10736
10799
  return _models_response__WEBPACK_IMPORTED_MODULE_9__/* .Response */ .Y.notFound();
10737
10800
  }
10738
- if (cipher.organizationId == null &&
10739
- !(yield (0,rxjs__WEBPACK_IMPORTED_MODULE_2__.firstValueFrom)(this.accountProfileService.hasPremiumFromAnySource$))) {
10801
+ const activeUserId = yield (0,rxjs__WEBPACK_IMPORTED_MODULE_2__.firstValueFrom)(this.activeUserId$);
10802
+ const canAccessPremium = yield (0,rxjs__WEBPACK_IMPORTED_MODULE_2__.firstValueFrom)(this.accountProfileService.hasPremiumFromAnySource$(activeUserId));
10803
+ if (cipher.organizationId == null && !canAccessPremium) {
10740
10804
  return _models_response__WEBPACK_IMPORTED_MODULE_9__/* .Response */ .Y.error("Premium status is required to use this feature.");
10741
10805
  }
10742
10806
  const userKey = yield this.keyService.getUserKey();
@@ -10745,7 +10809,6 @@ class CreateCommand {
10745
10809
  "See https://help.bitwarden.com/article/update-encryption-key/");
10746
10810
  }
10747
10811
  try {
10748
- const activeUserId = yield (0,rxjs__WEBPACK_IMPORTED_MODULE_2__.firstValueFrom)(this.accountService.activeAccount$.pipe((0,rxjs__WEBPACK_IMPORTED_MODULE_2__.map)((a) => a === null || a === void 0 ? void 0 : a.id)));
10749
10812
  const updatedCipher = yield this.cipherService.saveAttachmentRawWithServer(cipher, fileName, new Uint8Array(fileBuf).buffer, activeUserId);
10750
10813
  const decCipher = yield updatedCipher.decrypt(yield this.cipherService.getKeyForCipherKeyDecryption(updatedCipher, activeUserId));
10751
10814
  return _models_response__WEBPACK_IMPORTED_MODULE_9__/* .Response */ .Y.success(new _models_cipher_response__WEBPACK_IMPORTED_MODULE_11__/* .CipherResponse */ .N(decCipher));
@@ -10757,12 +10820,12 @@ class CreateCommand {
10757
10820
  }
10758
10821
  createFolder(req) {
10759
10822
  return __awaiter(this, void 0, void 0, function* () {
10760
- const activeAccountId = yield (0,rxjs__WEBPACK_IMPORTED_MODULE_2__.firstValueFrom)(this.accountService.activeAccount$);
10761
- const userKey = yield this.keyService.getUserKeyWithLegacySupport(activeAccountId.id);
10823
+ const activeUserId = yield (0,rxjs__WEBPACK_IMPORTED_MODULE_2__.firstValueFrom)(this.activeUserId$);
10824
+ const userKey = yield this.keyService.getUserKeyWithLegacySupport(activeUserId);
10762
10825
  const folder = yield this.folderService.encrypt(_bitwarden_common_models_export_folder_export__WEBPACK_IMPORTED_MODULE_6__/* .FolderExport */ .V.toView(req), userKey);
10763
10826
  try {
10764
- yield this.folderApiService.save(folder);
10765
- const newFolder = yield this.folderService.get(folder.id);
10827
+ yield this.folderApiService.save(folder, activeUserId);
10828
+ const newFolder = yield this.folderService.get(folder.id, activeUserId);
10766
10829
  const decFolder = yield newFolder.decrypt();
10767
10830
  const res = new _models_folder_response__WEBPACK_IMPORTED_MODULE_12__/* .FolderResponse */ .s(decFolder);
10768
10831
  return _models_response__WEBPACK_IMPORTED_MODULE_9__/* .Response */ .Y.success(res);
@@ -10849,13 +10912,14 @@ var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _argume
10849
10912
 
10850
10913
 
10851
10914
  class DeleteCommand {
10852
- constructor(cipherService, folderService, apiService, folderApiService, accountProfileService, cipherAuthorizationService) {
10915
+ constructor(cipherService, folderService, apiService, folderApiService, accountProfileService, cipherAuthorizationService, accountService) {
10853
10916
  this.cipherService = cipherService;
10854
10917
  this.folderService = folderService;
10855
10918
  this.apiService = apiService;
10856
10919
  this.folderApiService = folderApiService;
10857
10920
  this.accountProfileService = accountProfileService;
10858
10921
  this.cipherAuthorizationService = cipherAuthorizationService;
10922
+ this.accountService = accountService;
10859
10923
  }
10860
10924
  run(object, id, cmdOptions) {
10861
10925
  return __awaiter(this, void 0, void 0, function* () {
@@ -10918,7 +10982,8 @@ class DeleteCommand {
10918
10982
  if (attachments.length === 0) {
10919
10983
  return _models_response__WEBPACK_IMPORTED_MODULE_2__/* .Response */ .Y.error("Attachment `" + id + "` was not found.");
10920
10984
  }
10921
- const canAccessPremium = yield (0,rxjs__WEBPACK_IMPORTED_MODULE_0__.firstValueFrom)(this.accountProfileService.hasPremiumFromAnySource$);
10985
+ const account = yield (0,rxjs__WEBPACK_IMPORTED_MODULE_0__.firstValueFrom)(this.accountService.activeAccount$);
10986
+ const canAccessPremium = yield (0,rxjs__WEBPACK_IMPORTED_MODULE_0__.firstValueFrom)(this.accountProfileService.hasPremiumFromAnySource$(account.id));
10922
10987
  if (cipher.organizationId == null && !canAccessPremium) {
10923
10988
  return _models_response__WEBPACK_IMPORTED_MODULE_2__/* .Response */ .Y.error("Premium status is required to use this feature.");
10924
10989
  }
@@ -10933,12 +10998,13 @@ class DeleteCommand {
10933
10998
  }
10934
10999
  deleteFolder(id) {
10935
11000
  return __awaiter(this, void 0, void 0, function* () {
10936
- const folder = yield this.folderService.getFromState(id);
11001
+ const activeUserId = yield (0,rxjs__WEBPACK_IMPORTED_MODULE_0__.firstValueFrom)(this.accountService.activeAccount$.pipe((0,rxjs__WEBPACK_IMPORTED_MODULE_0__.map)((a) => a === null || a === void 0 ? void 0 : a.id)));
11002
+ const folder = yield this.folderService.getFromState(id, activeUserId);
10937
11003
  if (folder == null) {
10938
11004
  return _models_response__WEBPACK_IMPORTED_MODULE_2__/* .Response */ .Y.notFound();
10939
11005
  }
10940
11006
  try {
10941
- yield this.folderApiService.delete(id);
11007
+ yield this.folderApiService.delete(id, activeUserId);
10942
11008
  return _models_response__WEBPACK_IMPORTED_MODULE_2__/* .Response */ .Y.success();
10943
11009
  }
10944
11010
  catch (e) {
@@ -11644,22 +11710,22 @@ class OssServeConfigurator {
11644
11710
  constructor(serviceContainer) {
11645
11711
  this.serviceContainer = serviceContainer;
11646
11712
  this.getCommand = new get_command/* GetCommand */.s(this.serviceContainer.cipherService, this.serviceContainer.folderService, this.serviceContainer.collectionService, this.serviceContainer.totpService, this.serviceContainer.auditService, this.serviceContainer.keyService, this.serviceContainer.encryptService, this.serviceContainer.searchService, this.serviceContainer.apiService, this.serviceContainer.organizationService, this.serviceContainer.eventCollectionService, this.serviceContainer.billingAccountProfileStateService, this.serviceContainer.accountService);
11647
- this.listCommand = new list_command/* ListCommand */.S(this.serviceContainer.cipherService, this.serviceContainer.folderService, this.serviceContainer.collectionService, this.serviceContainer.organizationService, this.serviceContainer.searchService, this.serviceContainer.organizationUserApiService, this.serviceContainer.apiService, this.serviceContainer.eventCollectionService);
11713
+ this.listCommand = new list_command/* ListCommand */.S(this.serviceContainer.cipherService, this.serviceContainer.folderService, this.serviceContainer.collectionService, this.serviceContainer.organizationService, this.serviceContainer.searchService, this.serviceContainer.organizationUserApiService, this.serviceContainer.apiService, this.serviceContainer.eventCollectionService, this.serviceContainer.accountService);
11648
11714
  this.createCommand = new create_command/* CreateCommand */.K(this.serviceContainer.cipherService, this.serviceContainer.folderService, this.serviceContainer.keyService, this.serviceContainer.encryptService, this.serviceContainer.apiService, this.serviceContainer.folderApiService, this.serviceContainer.billingAccountProfileStateService, this.serviceContainer.organizationService, this.serviceContainer.accountService);
11649
11715
  this.editCommand = new edit_command/* EditCommand */.s(this.serviceContainer.cipherService, this.serviceContainer.folderService, this.serviceContainer.keyService, this.serviceContainer.encryptService, this.serviceContainer.apiService, this.serviceContainer.folderApiService, this.serviceContainer.accountService);
11650
11716
  this.generateCommand = new generate_command/* GenerateCommand */.p(this.serviceContainer.passwordGenerationService, this.serviceContainer.stateService);
11651
11717
  this.syncCommand = new sync_command/* SyncCommand */.b(this.serviceContainer.syncService);
11652
11718
  this.statusCommand = new status_command/* StatusCommand */.y(this.serviceContainer.environmentService, this.serviceContainer.syncService, this.serviceContainer.accountService, this.serviceContainer.authService);
11653
- this.deleteCommand = new delete_command/* DeleteCommand */.R(this.serviceContainer.cipherService, this.serviceContainer.folderService, this.serviceContainer.apiService, this.serviceContainer.folderApiService, this.serviceContainer.billingAccountProfileStateService, this.serviceContainer.cipherAuthorizationService);
11719
+ this.deleteCommand = new delete_command/* DeleteCommand */.R(this.serviceContainer.cipherService, this.serviceContainer.folderService, this.serviceContainer.apiService, this.serviceContainer.folderApiService, this.serviceContainer.billingAccountProfileStateService, this.serviceContainer.cipherAuthorizationService, this.serviceContainer.accountService);
11654
11720
  this.confirmCommand = new confirm_command/* ConfirmCommand */.u(this.serviceContainer.apiService, this.serviceContainer.keyService, this.serviceContainer.encryptService, this.serviceContainer.organizationUserApiService);
11655
11721
  this.restoreCommand = new restore_command/* RestoreCommand */.G(this.serviceContainer.cipherService);
11656
11722
  this.shareCommand = new share_command/* ShareCommand */.j(this.serviceContainer.cipherService, this.serviceContainer.accountService);
11657
11723
  this.lockCommand = new lock_command/* LockCommand */.z(this.serviceContainer.vaultTimeoutService);
11658
11724
  this.unlockCommand = new unlock_command/* UnlockCommand */.o(this.serviceContainer.accountService, this.serviceContainer.masterPasswordService, this.serviceContainer.keyService, this.serviceContainer.userVerificationService, this.serviceContainer.cryptoFunctionService, this.serviceContainer.logService, this.serviceContainer.keyConnectorService, this.serviceContainer.environmentService, this.serviceContainer.syncService, this.serviceContainer.organizationApiService, () => __awaiter(this, void 0, void 0, function* () { return yield this.serviceContainer.logout(); }));
11659
- this.sendCreateCommand = new commands/* SendCreateCommand */.QR(this.serviceContainer.sendService, this.serviceContainer.environmentService, this.serviceContainer.sendApiService, this.serviceContainer.billingAccountProfileStateService);
11725
+ this.sendCreateCommand = new commands/* SendCreateCommand */.QR(this.serviceContainer.sendService, this.serviceContainer.environmentService, this.serviceContainer.sendApiService, this.serviceContainer.billingAccountProfileStateService, this.serviceContainer.accountService);
11660
11726
  this.sendDeleteCommand = new commands/* SendDeleteCommand */.Rg(this.serviceContainer.sendService, this.serviceContainer.sendApiService);
11661
11727
  this.sendGetCommand = new commands/* SendGetCommand */.MA(this.serviceContainer.sendService, this.serviceContainer.environmentService, this.serviceContainer.searchService, this.serviceContainer.encryptService, this.serviceContainer.apiService);
11662
- this.sendEditCommand = new commands/* SendEditCommand */._s(this.serviceContainer.sendService, this.sendGetCommand, this.serviceContainer.sendApiService, this.serviceContainer.billingAccountProfileStateService);
11728
+ this.sendEditCommand = new commands/* SendEditCommand */._s(this.serviceContainer.sendService, this.sendGetCommand, this.serviceContainer.sendApiService, this.serviceContainer.billingAccountProfileStateService, this.serviceContainer.accountService);
11663
11729
  this.sendListCommand = new commands/* SendListCommand */.eK(this.serviceContainer.sendService, this.serviceContainer.environmentService, this.serviceContainer.searchService);
11664
11730
  this.sendRemovePasswordCommand = new commands/* SendRemovePasswordCommand */.Vx(this.serviceContainer.sendService, this.serviceContainer.sendApiService, this.serviceContainer.environmentService);
11665
11731
  }
@@ -14007,6 +14073,8 @@ var login_email_service_awaiter = (undefined && undefined.__awaiter) || function
14007
14073
  // @ts-strict-ignore
14008
14074
 
14009
14075
 
14076
+ // FIXME: remove `src` and fix import
14077
+ // eslint-disable-next-line no-restricted-imports
14010
14078
 
14011
14079
  const LOGIN_EMAIL = new state/* KeyDefinition */.Zs(state/* LOGIN_EMAIL_MEMORY */.jB, "loginEmail", {
14012
14080
  deserializer: (value) => value,
@@ -14093,8 +14161,8 @@ class PreloginRequest {
14093
14161
  var error_response = __webpack_require__(6057);
14094
14162
  // EXTERNAL MODULE: ../../libs/common/src/platform/scheduling/index.ts + 2 modules
14095
14163
  var scheduling = __webpack_require__(7143);
14096
- // EXTERNAL MODULE: ../../libs/key-management/src/index.ts + 17 modules
14097
- var src = __webpack_require__(8614);
14164
+ // EXTERNAL MODULE: ../../libs/key-management/src/index.ts + 20 modules
14165
+ var src = __webpack_require__(5907);
14098
14166
  // EXTERNAL MODULE: ../../libs/common/src/auth/models/request/identity-token/device.request.ts
14099
14167
  var device_request = __webpack_require__(5961);
14100
14168
  // EXTERNAL MODULE: ../../libs/common/src/auth/models/request/identity-token/token.request.ts
@@ -14532,8 +14600,8 @@ class AuthRequestLoginStrategy extends LoginStrategy {
14532
14600
 
14533
14601
  // EXTERNAL MODULE: ../../libs/common/src/admin-console/models/domain/master-password-policy-options.ts
14534
14602
  var master_password_policy_options = __webpack_require__(9021);
14535
- // EXTERNAL MODULE: ../../libs/common/src/platform/enums/index.ts + 6 modules
14536
- var platform_enums = __webpack_require__(6425);
14603
+ // EXTERNAL MODULE: ../../libs/common/src/platform/enums/index.ts + 7 modules
14604
+ var platform_enums = __webpack_require__(5874);
14537
14605
  ;// ../../libs/auth/src/common/login-strategies/password-login.strategy.ts
14538
14606
  var password_login_strategy_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
14539
14607
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
@@ -16815,12 +16883,14 @@ class OrganizationApiService {
16815
16883
  }
16816
16884
  updatePasswordManagerSeats(id, request) {
16817
16885
  return __awaiter(this, void 0, void 0, function* () {
16818
- return this.apiService.send("POST", "/organizations/" + id + "/subscription", request, true, false);
16886
+ const r = yield this.apiService.send("POST", "/organizations/" + id + "/subscription", request, true, true);
16887
+ return new profile_organization_response/* ProfileOrganizationResponse */.C(r);
16819
16888
  });
16820
16889
  }
16821
16890
  updateSecretsManagerSubscription(id, request) {
16822
16891
  return __awaiter(this, void 0, void 0, function* () {
16823
- return this.apiService.send("POST", "/organizations/" + id + "/sm-subscription", request, true, false);
16892
+ const r = yield this.apiService.send("POST", "/organizations/" + id + "/sm-subscription", request, true, true);
16893
+ return new profile_organization_response/* ProfileOrganizationResponse */.C(r);
16824
16894
  });
16825
16895
  }
16826
16896
  updateSeats(id, request) {
@@ -18785,8 +18855,8 @@ __webpack_require__.d(__webpack_exports__, {
18785
18855
 
18786
18856
  // EXTERNAL MODULE: external "rxjs"
18787
18857
  var external_rxjs_ = __webpack_require__(573);
18788
- // EXTERNAL MODULE: ../../libs/common/src/platform/enums/index.ts + 6 modules
18789
- var enums = __webpack_require__(6425);
18858
+ // EXTERNAL MODULE: ../../libs/common/src/platform/enums/index.ts + 7 modules
18859
+ var enums = __webpack_require__(5874);
18790
18860
  // EXTERNAL MODULE: ../../libs/common/src/platform/models/domain/enc-string.ts
18791
18861
  var enc_string = __webpack_require__(6505);
18792
18862
  // EXTERNAL MODULE: ../../libs/common/src/platform/models/domain/symmetric-crypto-key.ts
@@ -19086,6 +19156,8 @@ class DeviceResponse extends base_response/* BaseResponse */.r {
19086
19156
  this.type = this.getResponseProperty("Type");
19087
19157
  this.creationDate = this.getResponseProperty("CreationDate");
19088
19158
  this.revisionDate = this.getResponseProperty("RevisionDate");
19159
+ this.isTrusted = this.getResponseProperty("IsTrusted");
19160
+ this.devicePendingAuthRequest = this.getResponseProperty("DevicePendingAuthRequest");
19089
19161
  }
19090
19162
  }
19091
19163
 
@@ -19191,6 +19263,11 @@ class DevicesApiServiceImplementation {
19191
19263
  });
19192
19264
  });
19193
19265
  }
19266
+ deactivateDevice(deviceId) {
19267
+ return __awaiter(this, void 0, void 0, function* () {
19268
+ yield this.apiService.send("POST", `/devices/${deviceId}/deactivate`, null, true, false);
19269
+ });
19270
+ }
19194
19271
  }
19195
19272
 
19196
19273
 
@@ -19209,8 +19286,8 @@ __webpack_require__.d(__webpack_exports__, {
19209
19286
 
19210
19287
  // EXTERNAL MODULE: external "rxjs"
19211
19288
  var external_rxjs_ = __webpack_require__(573);
19212
- // EXTERNAL MODULE: ../../libs/key-management/src/index.ts + 17 modules
19213
- var src = __webpack_require__(8614);
19289
+ // EXTERNAL MODULE: ../../libs/key-management/src/index.ts + 20 modules
19290
+ var src = __webpack_require__(5907);
19214
19291
  // EXTERNAL MODULE: ../../libs/common/src/admin-console/enums/index.ts + 10 modules
19215
19292
  var enums = __webpack_require__(2887);
19216
19293
  // EXTERNAL MODULE: ../../libs/common/src/models/request/keys.request.ts
@@ -19406,7 +19483,7 @@ class KeyConnectorService {
19406
19483
  /* harmony export */ });
19407
19484
  /* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(573);
19408
19485
  /* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(rxjs__WEBPACK_IMPORTED_MODULE_0__);
19409
- /* harmony import */ var _platform_enums__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6425);
19486
+ /* harmony import */ var _platform_enums__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5874);
19410
19487
  /* harmony import */ var _platform_models_domain_enc_string__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6505);
19411
19488
  /* harmony import */ var _platform_models_domain_symmetric_crypto_key__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(7310);
19412
19489
  /* harmony import */ var _platform_state__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1068);
@@ -19567,11 +19644,11 @@ class MasterPasswordService {
19567
19644
  }
19568
19645
  let decUserKey;
19569
19646
  if (userKey.encryptionType === _platform_enums__WEBPACK_IMPORTED_MODULE_1__/* .EncryptionType */ .Qd.AesCbc256_B64) {
19570
- decUserKey = yield this.encryptService.decryptToBytes(userKey, masterKey);
19647
+ decUserKey = yield this.encryptService.decryptToBytes(userKey, masterKey, "Content: User Key; Encrypting Key: Master Key");
19571
19648
  }
19572
19649
  else if (userKey.encryptionType === _platform_enums__WEBPACK_IMPORTED_MODULE_1__/* .EncryptionType */ .Qd.AesCbc256_HmacSha256_B64) {
19573
19650
  const newKey = yield this.keyGenerationService.stretchKey(masterKey);
19574
- decUserKey = yield this.encryptService.decryptToBytes(userKey, newKey);
19651
+ decUserKey = yield this.encryptService.decryptToBytes(userKey, newKey, "Content: User Key; Encrypting Key: Stretched Master Key");
19575
19652
  }
19576
19653
  else {
19577
19654
  throw new Error("Unsupported encryption type.");
@@ -19605,8 +19682,8 @@ var external_rxjs_ = __webpack_require__(573);
19605
19682
  var common = __webpack_require__(4025);
19606
19683
  // EXTERNAL MODULE: ../../libs/common/src/enums/vault-timeout-action.enum.ts
19607
19684
  var vault_timeout_action_enum = __webpack_require__(2572);
19608
- // EXTERNAL MODULE: ../../libs/common/src/platform/enums/index.ts + 6 modules
19609
- var enums = __webpack_require__(6425);
19685
+ // EXTERNAL MODULE: ../../libs/common/src/platform/enums/index.ts + 7 modules
19686
+ var enums = __webpack_require__(5874);
19610
19687
  // EXTERNAL MODULE: ../../libs/common/src/platform/misc/utils.ts + 2 modules
19611
19688
  var utils = __webpack_require__(6948);
19612
19689
  // EXTERNAL MODULE: ../../libs/common/src/platform/models/domain/enc-string.ts
@@ -20714,10 +20791,10 @@ __webpack_require__.d(__webpack_exports__, {
20714
20791
 
20715
20792
  // EXTERNAL MODULE: external "rxjs"
20716
20793
  var external_rxjs_ = __webpack_require__(573);
20717
- // EXTERNAL MODULE: ../../libs/common/src/platform/enums/index.ts + 6 modules
20718
- var enums = __webpack_require__(6425);
20719
- // EXTERNAL MODULE: ../../libs/common/src/platform/enums/key-suffix-options.enum.ts
20720
- var key_suffix_options_enum = __webpack_require__(9377);
20794
+ // EXTERNAL MODULE: ../../libs/key-management/src/index.ts + 20 modules
20795
+ var src = __webpack_require__(5907);
20796
+ // EXTERNAL MODULE: ../../libs/common/src/platform/enums/index.ts + 7 modules
20797
+ var enums = __webpack_require__(5874);
20721
20798
  // EXTERNAL MODULE: ../../libs/common/src/auth/enums/verification-type.ts
20722
20799
  var verification_type = __webpack_require__(6745);
20723
20800
  // EXTERNAL MODULE: ../../libs/common/src/auth/models/request/secret-verification.request.ts
@@ -20758,7 +20835,7 @@ var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _argume
20758
20835
  * Use it to verify the input collected by UserVerificationComponent.
20759
20836
  */
20760
20837
  class UserVerificationService {
20761
- constructor(keyService, accountService, masterPasswordService, i18nService, userVerificationApiService, userDecryptionOptionsService, pinService, logService, vaultTimeoutSettingsService, platformUtilsService, kdfConfigService) {
20838
+ constructor(keyService, accountService, masterPasswordService, i18nService, userVerificationApiService, userDecryptionOptionsService, pinService, kdfConfigService, biometricsService) {
20762
20839
  this.keyService = keyService;
20763
20840
  this.accountService = accountService;
20764
20841
  this.masterPasswordService = masterPasswordService;
@@ -20766,21 +20843,18 @@ class UserVerificationService {
20766
20843
  this.userVerificationApiService = userVerificationApiService;
20767
20844
  this.userDecryptionOptionsService = userDecryptionOptionsService;
20768
20845
  this.pinService = pinService;
20769
- this.logService = logService;
20770
- this.vaultTimeoutSettingsService = vaultTimeoutSettingsService;
20771
- this.platformUtilsService = platformUtilsService;
20772
20846
  this.kdfConfigService = kdfConfigService;
20847
+ this.biometricsService = biometricsService;
20773
20848
  }
20774
20849
  getAvailableVerificationOptions(verificationType) {
20775
20850
  return __awaiter(this, void 0, void 0, function* () {
20776
20851
  var _a;
20777
20852
  const userId = (_a = (yield (0,external_rxjs_.firstValueFrom)(this.accountService.activeAccount$))) === null || _a === void 0 ? void 0 : _a.id;
20778
20853
  if (verificationType === "client") {
20779
- const [userHasMasterPassword, isPinDecryptionAvailable, biometricsLockSet, biometricsUserKeyStored,] = yield Promise.all([
20854
+ const [userHasMasterPassword, isPinDecryptionAvailable, biometricsStatus] = yield Promise.all([
20780
20855
  this.hasMasterPasswordAndMasterKeyHash(userId),
20781
20856
  this.pinService.isPinDecryptionAvailable(userId),
20782
- this.vaultTimeoutSettingsService.isBiometricLockSet(userId),
20783
- this.keyService.hasUserKeyStored(key_suffix_options_enum/* KeySuffixOptions */.h.Biometric, userId),
20857
+ this.biometricsService.getBiometricsStatus(),
20784
20858
  ]);
20785
20859
  // note: we do not need to check this.platformUtilsService.supportsBiometric() because
20786
20860
  // we can just use the logic below which works for both desktop & the browser extension.
@@ -20788,8 +20862,7 @@ class UserVerificationService {
20788
20862
  client: {
20789
20863
  masterPassword: userHasMasterPassword,
20790
20864
  pin: isPinDecryptionAvailable,
20791
- biometrics: biometricsLockSet &&
20792
- (biometricsUserKeyStored || !this.platformUtilsService.supportsSecureStorage()),
20865
+ biometrics: biometricsStatus === src/* BiometricsStatus */.cR.Available,
20793
20866
  },
20794
20867
  server: {
20795
20868
  masterPassword: false,
@@ -20931,17 +21004,7 @@ class UserVerificationService {
20931
21004
  }
20932
21005
  verifyUserByBiometrics() {
20933
21006
  return __awaiter(this, void 0, void 0, function* () {
20934
- let userKey;
20935
- // Biometrics crashes and doesn't return a value if the user cancels the prompt
20936
- try {
20937
- userKey = yield this.keyService.getUserKeyFromStorage(key_suffix_options_enum/* KeySuffixOptions */.h.Biometric);
20938
- }
20939
- catch (e) {
20940
- this.logService.error(`Biometrics User Verification failed: ${e.message}`);
20941
- // So, any failures should be treated as a failed verification
20942
- return false;
20943
- }
20944
- return userKey != null;
21007
+ return this.biometricsService.authenticateWithBiometrics();
20945
21008
  });
20946
21009
  }
20947
21010
  requestOTP() {
@@ -21277,9 +21340,10 @@ class AutofillSettingsService {
21277
21340
  /* unused harmony export DomainSettingsService */
21278
21341
  /* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(573);
21279
21342
  /* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(rxjs__WEBPACK_IMPORTED_MODULE_0__);
21280
- /* harmony import */ var _models_domain_domain_service__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3037);
21281
- /* harmony import */ var _platform_misc_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6948);
21282
- /* harmony import */ var _platform_state__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(1068);
21343
+ /* harmony import */ var _bitwarden_common_enums_feature_flag_enum__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(3176);
21344
+ /* harmony import */ var _models_domain_domain_service__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(3037);
21345
+ /* harmony import */ var _platform_misc_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(6948);
21346
+ /* harmony import */ var _platform_state__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(1068);
21283
21347
  var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
21284
21348
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
21285
21349
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -21295,33 +21359,48 @@ var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _argume
21295
21359
 
21296
21360
 
21297
21361
 
21298
- const SHOW_FAVICONS = new _platform_state__WEBPACK_IMPORTED_MODULE_3__/* .KeyDefinition */ .Zs(_platform_state__WEBPACK_IMPORTED_MODULE_3__/* .DOMAIN_SETTINGS_DISK */ .XH, "showFavicons", {
21362
+
21363
+ const SHOW_FAVICONS = new _platform_state__WEBPACK_IMPORTED_MODULE_4__/* .KeyDefinition */ .Zs(_platform_state__WEBPACK_IMPORTED_MODULE_4__/* .DOMAIN_SETTINGS_DISK */ .XH, "showFavicons", {
21299
21364
  deserializer: (value) => value !== null && value !== void 0 ? value : true,
21300
21365
  });
21301
- const NEVER_DOMAINS = new _platform_state__WEBPACK_IMPORTED_MODULE_3__/* .KeyDefinition */ .Zs(_platform_state__WEBPACK_IMPORTED_MODULE_3__/* .DOMAIN_SETTINGS_DISK */ .XH, "neverDomains", {
21366
+ // Domain exclusion list for notifications
21367
+ const NEVER_DOMAINS = new _platform_state__WEBPACK_IMPORTED_MODULE_4__/* .KeyDefinition */ .Zs(_platform_state__WEBPACK_IMPORTED_MODULE_4__/* .DOMAIN_SETTINGS_DISK */ .XH, "neverDomains", {
21302
21368
  deserializer: (value) => value !== null && value !== void 0 ? value : null,
21303
21369
  });
21304
- const EQUIVALENT_DOMAINS = new _platform_state__WEBPACK_IMPORTED_MODULE_3__/* .UserKeyDefinition */ .Ok(_platform_state__WEBPACK_IMPORTED_MODULE_3__/* .DOMAIN_SETTINGS_DISK */ .XH, "equivalentDomains", {
21370
+ // Domain exclusion list for content script injections
21371
+ const BLOCKED_INTERACTIONS_URIS = new _platform_state__WEBPACK_IMPORTED_MODULE_4__/* .KeyDefinition */ .Zs(_platform_state__WEBPACK_IMPORTED_MODULE_4__/* .DOMAIN_SETTINGS_DISK */ .XH, "blockedInteractionsUris", {
21372
+ deserializer: (value) => value !== null && value !== void 0 ? value : {},
21373
+ });
21374
+ const EQUIVALENT_DOMAINS = new _platform_state__WEBPACK_IMPORTED_MODULE_4__/* .UserKeyDefinition */ .Ok(_platform_state__WEBPACK_IMPORTED_MODULE_4__/* .DOMAIN_SETTINGS_DISK */ .XH, "equivalentDomains", {
21305
21375
  deserializer: (value) => value !== null && value !== void 0 ? value : null,
21306
21376
  clearOn: ["logout"],
21307
21377
  });
21308
- const DEFAULT_URI_MATCH_STRATEGY = new _platform_state__WEBPACK_IMPORTED_MODULE_3__/* .UserKeyDefinition */ .Ok(_platform_state__WEBPACK_IMPORTED_MODULE_3__/* .DOMAIN_SETTINGS_DISK */ .XH, "defaultUriMatchStrategy", {
21309
- deserializer: (value) => value !== null && value !== void 0 ? value : _models_domain_domain_service__WEBPACK_IMPORTED_MODULE_1__/* .UriMatchStrategy */ .L.Domain,
21378
+ const DEFAULT_URI_MATCH_STRATEGY = new _platform_state__WEBPACK_IMPORTED_MODULE_4__/* .UserKeyDefinition */ .Ok(_platform_state__WEBPACK_IMPORTED_MODULE_4__/* .DOMAIN_SETTINGS_DISK */ .XH, "defaultUriMatchStrategy", {
21379
+ deserializer: (value) => value !== null && value !== void 0 ? value : _models_domain_domain_service__WEBPACK_IMPORTED_MODULE_2__/* .UriMatchStrategy */ .L.Domain,
21310
21380
  clearOn: [],
21311
21381
  });
21382
+ /**
21383
+ * The Domain Settings service; provides client settings state for "active client view" URI concerns
21384
+ */
21312
21385
  class DomainSettingsService {
21313
21386
  }
21314
21387
  class DefaultDomainSettingsService {
21315
- constructor(stateProvider) {
21388
+ constructor(stateProvider, configService) {
21316
21389
  this.stateProvider = stateProvider;
21390
+ this.configService = configService;
21317
21391
  this.showFaviconsState = this.stateProvider.getGlobal(SHOW_FAVICONS);
21318
21392
  this.showFavicons$ = this.showFaviconsState.state$.pipe((0,rxjs__WEBPACK_IMPORTED_MODULE_0__.map)((x) => x !== null && x !== void 0 ? x : true));
21319
21393
  this.neverDomainsState = this.stateProvider.getGlobal(NEVER_DOMAINS);
21320
21394
  this.neverDomains$ = this.neverDomainsState.state$.pipe((0,rxjs__WEBPACK_IMPORTED_MODULE_0__.map)((x) => x !== null && x !== void 0 ? x : null));
21395
+ // Needs to be global to prevent pre-login injections
21396
+ this.blockedInteractionsUrisState = this.stateProvider.getGlobal(BLOCKED_INTERACTIONS_URIS);
21397
+ this.blockedInteractionsUris$ = this.configService
21398
+ .getFeatureFlag$(_bitwarden_common_enums_feature_flag_enum__WEBPACK_IMPORTED_MODULE_1__/* .FeatureFlag */ .T.BlockBrowserInjectionsByDomain)
21399
+ .pipe((0,rxjs__WEBPACK_IMPORTED_MODULE_0__.switchMap)((featureIsEnabled) => featureIsEnabled ? this.blockedInteractionsUrisState.state$ : (0,rxjs__WEBPACK_IMPORTED_MODULE_0__.of)({})), (0,rxjs__WEBPACK_IMPORTED_MODULE_0__.map)((disabledUris) => (Object.keys(disabledUris).length ? disabledUris : {})));
21321
21400
  this.equivalentDomainsState = this.stateProvider.getActive(EQUIVALENT_DOMAINS);
21322
21401
  this.equivalentDomains$ = this.equivalentDomainsState.state$.pipe((0,rxjs__WEBPACK_IMPORTED_MODULE_0__.map)((x) => x !== null && x !== void 0 ? x : null));
21323
21402
  this.defaultUriMatchStrategyState = this.stateProvider.getActive(DEFAULT_URI_MATCH_STRATEGY);
21324
- this.defaultUriMatchStrategy$ = this.defaultUriMatchStrategyState.state$.pipe((0,rxjs__WEBPACK_IMPORTED_MODULE_0__.map)((x) => x !== null && x !== void 0 ? x : _models_domain_domain_service__WEBPACK_IMPORTED_MODULE_1__/* .UriMatchStrategy */ .L.Domain));
21403
+ this.defaultUriMatchStrategy$ = this.defaultUriMatchStrategyState.state$.pipe((0,rxjs__WEBPACK_IMPORTED_MODULE_0__.map)((x) => x !== null && x !== void 0 ? x : _models_domain_domain_service__WEBPACK_IMPORTED_MODULE_2__/* .UriMatchStrategy */ .L.Domain));
21325
21404
  }
21326
21405
  setShowFavicons(newValue) {
21327
21406
  return __awaiter(this, void 0, void 0, function* () {
@@ -21333,6 +21412,11 @@ class DefaultDomainSettingsService {
21333
21412
  yield this.neverDomainsState.update(() => newValue);
21334
21413
  });
21335
21414
  }
21415
+ setBlockedInteractionsUris(newValue) {
21416
+ return __awaiter(this, void 0, void 0, function* () {
21417
+ yield this.blockedInteractionsUrisState.update(() => newValue);
21418
+ });
21419
+ }
21336
21420
  setEquivalentDomains(newValue, userId) {
21337
21421
  return __awaiter(this, void 0, void 0, function* () {
21338
21422
  yield this.stateProvider.getUser(userId, EQUIVALENT_DOMAINS).update(() => newValue);
@@ -21345,7 +21429,7 @@ class DefaultDomainSettingsService {
21345
21429
  }
21346
21430
  getUrlEquivalentDomains(url) {
21347
21431
  const domains$ = this.equivalentDomains$.pipe((0,rxjs__WEBPACK_IMPORTED_MODULE_0__.map)((equivalentDomains) => {
21348
- const domain = _platform_misc_utils__WEBPACK_IMPORTED_MODULE_2__/* .Utils */ .A.getDomain(url);
21432
+ const domain = _platform_misc_utils__WEBPACK_IMPORTED_MODULE_3__/* .Utils */ .A.getDomain(url);
21349
21433
  if (domain == null || equivalentDomains == null) {
21350
21434
  return new Set();
21351
21435
  }
@@ -21367,8 +21451,6 @@ class DefaultDomainSettingsService {
21367
21451
  /* harmony export */ });
21368
21452
  /* unused harmony exports isCardExpired, parseYearMonthExpiry */
21369
21453
  /* harmony import */ var _bitwarden_common_autofill_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5396);
21370
- // FIXME: Update this file to be type safe and remove this and next line
21371
- // @ts-strict-ignore
21372
21454
 
21373
21455
  /**
21374
21456
  * Takes a string or number value and returns a string value formatted as a valid 4-digit year
@@ -21382,10 +21464,10 @@ function normalizeExpiryYearFormat(yearInput) {
21382
21464
  const yearInputIsEmpty = yearInput == null || yearInput === "";
21383
21465
  let expirationYear = yearInputIsEmpty ? null : `${yearInput}`;
21384
21466
  // Exit early if year is already formatted correctly or empty
21385
- if (yearInputIsEmpty || /^[1-9]{1}\d{3}$/.test(expirationYear)) {
21467
+ if (yearInputIsEmpty || (expirationYear && /^[1-9]{1}\d{3}$/.test(expirationYear))) {
21386
21468
  return expirationYear;
21387
21469
  }
21388
- expirationYear = expirationYear
21470
+ expirationYear = (expirationYear || "")
21389
21471
  // For safety, because even input[type="number"] will allow decimals
21390
21472
  .replace(/[^\d]/g, "")
21391
21473
  // remove any leading zero padding (leave the last leading zero if it ends the string)
@@ -21404,7 +21486,7 @@ function normalizeExpiryYearFormat(yearInput) {
21404
21486
  }
21405
21487
  /**
21406
21488
  * Takes a cipher card view and returns "true" if the month and year affirmativey indicate
21407
- * the card is expired.
21489
+ * the card is expired. Uncertain cases return "false".
21408
21490
  *
21409
21491
  * @param {CardView} cipherCard
21410
21492
  * @return {*} {boolean}
@@ -21412,21 +21494,31 @@ function normalizeExpiryYearFormat(yearInput) {
21412
21494
  function isCardExpired(cipherCard) {
21413
21495
  if (cipherCard) {
21414
21496
  const { expMonth = null, expYear = null } = cipherCard;
21497
+ if (!expYear) {
21498
+ return false;
21499
+ }
21415
21500
  const now = new Date();
21416
21501
  const normalizedYear = normalizeExpiryYearFormat(expYear);
21417
- // If the card year is before the current year, don't bother checking the month
21418
- if (normalizedYear && parseInt(normalizedYear, 10) < now.getFullYear()) {
21502
+ const parsedYear = normalizedYear ? parseInt(normalizedYear, 10) : NaN;
21503
+ const expiryYearIsBeforeCurrentYear = parsedYear < now.getFullYear();
21504
+ const expiryYearIsAfterCurrentYear = parsedYear > now.getFullYear();
21505
+ // If the expiry year is before the current year, skip checking the month, since it must be expired
21506
+ if (normalizedYear && expiryYearIsBeforeCurrentYear) {
21419
21507
  return true;
21420
21508
  }
21509
+ // If the expiry year is after the current year, skip checking the month, since it cannot be expired
21510
+ if (normalizedYear && expiryYearIsAfterCurrentYear) {
21511
+ return false;
21512
+ }
21421
21513
  if (normalizedYear && expMonth) {
21422
21514
  const parsedMonthInteger = parseInt(expMonth, 10);
21423
- const parsedMonth = isNaN(parsedMonthInteger)
21424
- ? 0
21425
- : // Add a month floor of 0 to protect against an invalid low month value of "0" or negative integers
21426
- Math.max(
21427
- // `Date` months are zero-indexed
21428
- parsedMonthInteger - 1, 0);
21429
- const parsedYear = parseInt(normalizedYear, 10);
21515
+ const parsedMonthIsValid = parsedMonthInteger && !isNaN(parsedMonthInteger);
21516
+ // If the parsed month value is 0, we don't know when the expiry passes this year, so do not treat it as expired
21517
+ if (!parsedMonthIsValid) {
21518
+ return false;
21519
+ }
21520
+ // `Date` months are zero-indexed
21521
+ const parsedMonth = parsedMonthInteger - 1;
21430
21522
  // First day of the next month
21431
21523
  const cardExpiry = new Date(parsedYear, parsedMonth + 1, 1);
21432
21524
  return cardExpiry <= now;
@@ -21561,9 +21653,14 @@ function parseNonDelimitedYearMonthExpiry(dateInput) {
21561
21653
  parsedYear = dateInput.slice(0, 2);
21562
21654
  parsedMonth = dateInput.slice(-1);
21563
21655
  const currentYear = new Date().getFullYear();
21564
- const normalizedParsedYear = parseInt(normalizeExpiryYearFormat(parsedYear), 10);
21565
- const normalizedParsedYearAlternative = parseInt(normalizeExpiryYearFormat(dateInput.slice(-2)), 10);
21566
- if (normalizedParsedYear < currentYear && normalizedParsedYearAlternative >= currentYear) {
21656
+ const normalizedYearFormat = normalizeExpiryYearFormat(parsedYear);
21657
+ const normalizedParsedYear = normalizedYearFormat && parseInt(normalizedYearFormat, 10);
21658
+ const normalizedExpiryYearFormat = normalizeExpiryYearFormat(dateInput.slice(-2));
21659
+ const normalizedParsedYearAlternative = normalizedExpiryYearFormat && parseInt(normalizedExpiryYearFormat, 10);
21660
+ if (normalizedParsedYear &&
21661
+ normalizedParsedYear < currentYear &&
21662
+ normalizedParsedYearAlternative &&
21663
+ normalizedParsedYearAlternative >= currentYear) {
21567
21664
  parsedYear = dateInput.slice(-2);
21568
21665
  parsedMonth = dateInput.slice(0, 1);
21569
21666
  }
@@ -21588,16 +21685,20 @@ function parseYearMonthExpiry(combinedExpiryValue) {
21588
21685
  const sanitizedSecondPart = ((_b = dateParts[1]) === null || _b === void 0 ? void 0 : _b.replace(IrrelevantExpiryCharactersPatternExpression, "")) || "";
21589
21686
  // If there is only one date part, no delimiter was found in the passed value
21590
21687
  if (dateParts.length === 1) {
21591
- [parsedYear, parsedMonth] = parseNonDelimitedYearMonthExpiry(sanitizedFirstPart);
21688
+ const [parsedNonDelimitedYear, parsedNonDelimitedMonth] = parseNonDelimitedYearMonthExpiry(sanitizedFirstPart);
21689
+ parsedYear = parsedNonDelimitedYear;
21690
+ parsedMonth = parsedNonDelimitedMonth;
21592
21691
  }
21593
21692
  // There are multiple date parts
21594
21693
  else {
21595
- [parsedYear, parsedMonth] = parseDelimitedYearMonthExpiry([
21694
+ const [parsedDelimitedYear, parsedDelimitedMonth] = parseDelimitedYearMonthExpiry([
21596
21695
  sanitizedFirstPart,
21597
21696
  sanitizedSecondPart,
21598
21697
  ]);
21698
+ parsedYear = parsedDelimitedYear;
21699
+ parsedMonth = parsedDelimitedMonth;
21599
21700
  }
21600
- const normalizedParsedYear = normalizeExpiryYearFormat(parsedYear);
21701
+ const normalizedParsedYear = parsedYear ? normalizeExpiryYearFormat(parsedYear) : null;
21601
21702
  const normalizedParsedMonth = parsedMonth === null || parsedMonth === void 0 ? void 0 : parsedMonth.replace(/^0+/, "").slice(0, 2);
21602
21703
  // Set "empty" values to null
21603
21704
  parsedYear = (normalizedParsedYear === null || normalizedParsedYear === void 0 ? void 0 : normalizedParsedYear.length) ? normalizedParsedYear : null;
@@ -21945,18 +22046,26 @@ const BILLING_ACCOUNT_PROFILE_KEY_DEFINITION = new _platform_state__WEBPACK_IMPO
21945
22046
  clearOn: ["logout"],
21946
22047
  });
21947
22048
  class DefaultBillingAccountProfileStateService {
21948
- constructor(stateProvider) {
22049
+ constructor(stateProvider, platformUtilsService, apiService) {
21949
22050
  this.stateProvider = stateProvider;
21950
- this.billingAccountProfileState = stateProvider.getActive(BILLING_ACCOUNT_PROFILE_KEY_DEFINITION);
21951
- // Setup an observable that will always track the currently active user
21952
- // but will fallback to emitting null when there is no active user.
21953
- const billingAccountProfileOrNull = stateProvider.activeUserId$.pipe((0,rxjs__WEBPACK_IMPORTED_MODULE_0__.switchMap)((userId) => userId != null
21954
- ? stateProvider.getUser(userId, BILLING_ACCOUNT_PROFILE_KEY_DEFINITION).state$
21955
- : (0,rxjs__WEBPACK_IMPORTED_MODULE_0__.of)(null)));
21956
- this.hasPremiumFromAnyOrganization$ = billingAccountProfileOrNull.pipe((0,rxjs__WEBPACK_IMPORTED_MODULE_0__.map)((billingAccountProfile) => !!(billingAccountProfile === null || billingAccountProfile === void 0 ? void 0 : billingAccountProfile.hasPremiumFromAnyOrganization)));
21957
- this.hasPremiumPersonally$ = billingAccountProfileOrNull.pipe((0,rxjs__WEBPACK_IMPORTED_MODULE_0__.map)((billingAccountProfile) => !!(billingAccountProfile === null || billingAccountProfile === void 0 ? void 0 : billingAccountProfile.hasPremiumPersonally)));
21958
- this.hasPremiumFromAnySource$ = billingAccountProfileOrNull.pipe((0,rxjs__WEBPACK_IMPORTED_MODULE_0__.map)((billingAccountProfile) => (billingAccountProfile === null || billingAccountProfile === void 0 ? void 0 : billingAccountProfile.hasPremiumFromAnyOrganization) === true ||
21959
- (billingAccountProfile === null || billingAccountProfile === void 0 ? void 0 : billingAccountProfile.hasPremiumPersonally) === true));
22051
+ this.platformUtilsService = platformUtilsService;
22052
+ this.apiService = apiService;
22053
+ }
22054
+ hasPremiumFromAnyOrganization$(userId) {
22055
+ return this.stateProvider
22056
+ .getUser(userId, BILLING_ACCOUNT_PROFILE_KEY_DEFINITION)
22057
+ .state$.pipe((0,rxjs__WEBPACK_IMPORTED_MODULE_0__.map)((profile) => !!(profile === null || profile === void 0 ? void 0 : profile.hasPremiumFromAnyOrganization)));
22058
+ }
22059
+ hasPremiumPersonally$(userId) {
22060
+ return this.stateProvider
22061
+ .getUser(userId, BILLING_ACCOUNT_PROFILE_KEY_DEFINITION)
22062
+ .state$.pipe((0,rxjs__WEBPACK_IMPORTED_MODULE_0__.map)((profile) => !!(profile === null || profile === void 0 ? void 0 : profile.hasPremiumPersonally)));
22063
+ }
22064
+ hasPremiumFromAnySource$(userId) {
22065
+ return this.stateProvider
22066
+ .getUser(userId, BILLING_ACCOUNT_PROFILE_KEY_DEFINITION)
22067
+ .state$.pipe((0,rxjs__WEBPACK_IMPORTED_MODULE_0__.map)((profile) => (profile === null || profile === void 0 ? void 0 : profile.hasPremiumFromAnyOrganization) === true ||
22068
+ (profile === null || profile === void 0 ? void 0 : profile.hasPremiumPersonally) === true));
21960
22069
  }
21961
22070
  setHasPremium(hasPremiumPersonally, hasPremiumFromAnyOrganization, userId) {
21962
22071
  return __awaiter(this, void 0, void 0, function* () {
@@ -21968,6 +22077,20 @@ class DefaultBillingAccountProfileStateService {
21968
22077
  });
21969
22078
  });
21970
22079
  }
22080
+ canViewSubscription$(userId) {
22081
+ return (0,rxjs__WEBPACK_IMPORTED_MODULE_0__.combineLatest)([
22082
+ this.hasPremiumPersonally$(userId),
22083
+ this.hasPremiumFromAnyOrganization$(userId),
22084
+ ]).pipe((0,rxjs__WEBPACK_IMPORTED_MODULE_0__.concatMap)((_a) => __awaiter(this, [_a], void 0, function* ([hasPremiumPersonally, hasPremiumFromOrg]) {
22085
+ const isCloud = !this.platformUtilsService.isSelfHost();
22086
+ let billing = null;
22087
+ if (isCloud) {
22088
+ billing = yield this.apiService.getUserBillingHistory();
22089
+ }
22090
+ const cloudAndBillingHistory = isCloud && !(billing === null || billing === void 0 ? void 0 : billing.hasNoHistory);
22091
+ return hasPremiumPersonally || !hasPremiumFromOrg || cloudAndBillingHistory;
22092
+ })));
22093
+ }
21971
22094
  }
21972
22095
 
21973
22096
 
@@ -21977,9 +22100,9 @@ class DefaultBillingAccountProfileStateService {
21977
22100
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
21978
22101
 
21979
22102
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
21980
- /* harmony export */ bq: () => (/* binding */ DeviceType)
22103
+ /* harmony export */ b: () => (/* binding */ DeviceType)
21981
22104
  /* harmony export */ });
21982
- /* unused harmony exports MobileDeviceTypes, DesktopDeviceTypes */
22105
+ /* unused harmony export DeviceTypeMetadata */
21983
22106
  var DeviceType;
21984
22107
  (function (DeviceType) {
21985
22108
  DeviceType[DeviceType["Android"] = 0] = "Android";
@@ -22009,20 +22132,34 @@ var DeviceType;
22009
22132
  DeviceType[DeviceType["MacOsCLI"] = 24] = "MacOsCLI";
22010
22133
  DeviceType[DeviceType["LinuxCLI"] = 25] = "LinuxCLI";
22011
22134
  })(DeviceType || (DeviceType = {}));
22012
- const MobileDeviceTypes = new Set([
22013
- DeviceType.Android,
22014
- DeviceType.iOS,
22015
- DeviceType.AndroidAmazon,
22016
- ]);
22017
- const DesktopDeviceTypes = new Set([
22018
- DeviceType.WindowsDesktop,
22019
- DeviceType.MacOsDesktop,
22020
- DeviceType.LinuxDesktop,
22021
- DeviceType.UWP,
22022
- DeviceType.WindowsCLI,
22023
- DeviceType.MacOsCLI,
22024
- DeviceType.LinuxCLI,
22025
- ]);
22135
+ const DeviceTypeMetadata = {
22136
+ [DeviceType.Android]: { category: "mobile", platform: "Android" },
22137
+ [DeviceType.iOS]: { category: "mobile", platform: "iOS" },
22138
+ [DeviceType.AndroidAmazon]: { category: "mobile", platform: "Amazon" },
22139
+ [DeviceType.ChromeExtension]: { category: "extension", platform: "Chrome" },
22140
+ [DeviceType.FirefoxExtension]: { category: "extension", platform: "Firefox" },
22141
+ [DeviceType.OperaExtension]: { category: "extension", platform: "Opera" },
22142
+ [DeviceType.EdgeExtension]: { category: "extension", platform: "Edge" },
22143
+ [DeviceType.VivaldiExtension]: { category: "extension", platform: "Vivaldi" },
22144
+ [DeviceType.SafariExtension]: { category: "extension", platform: "Safari" },
22145
+ [DeviceType.ChromeBrowser]: { category: "webVault", platform: "Chrome" },
22146
+ [DeviceType.FirefoxBrowser]: { category: "webVault", platform: "Firefox" },
22147
+ [DeviceType.OperaBrowser]: { category: "webVault", platform: "Opera" },
22148
+ [DeviceType.EdgeBrowser]: { category: "webVault", platform: "Edge" },
22149
+ [DeviceType.IEBrowser]: { category: "webVault", platform: "IE" },
22150
+ [DeviceType.SafariBrowser]: { category: "webVault", platform: "Safari" },
22151
+ [DeviceType.VivaldiBrowser]: { category: "webVault", platform: "Vivaldi" },
22152
+ [DeviceType.UnknownBrowser]: { category: "webVault", platform: "Unknown" },
22153
+ [DeviceType.WindowsDesktop]: { category: "desktop", platform: "Windows" },
22154
+ [DeviceType.MacOsDesktop]: { category: "desktop", platform: "macOS" },
22155
+ [DeviceType.LinuxDesktop]: { category: "desktop", platform: "Linux" },
22156
+ [DeviceType.UWP]: { category: "desktop", platform: "Windows UWP" },
22157
+ [DeviceType.WindowsCLI]: { category: "cli", platform: "Windows" },
22158
+ [DeviceType.MacOsCLI]: { category: "cli", platform: "macOS" },
22159
+ [DeviceType.LinuxCLI]: { category: "cli", platform: "Linux" },
22160
+ [DeviceType.SDK]: { category: "sdk", platform: "" },
22161
+ [DeviceType.Server]: { category: "server", platform: "" },
22162
+ };
22026
22163
 
22027
22164
 
22028
22165
  /***/ }),
@@ -22064,6 +22201,7 @@ var FeatureFlag;
22064
22201
  FeatureFlag["SSHKeyVaultItem"] = "ssh-key-vault-item";
22065
22202
  FeatureFlag["SSHAgent"] = "ssh-agent";
22066
22203
  FeatureFlag["NotificationBarAddLoginImprovements"] = "notification-bar-add-login-improvements";
22204
+ FeatureFlag["BlockBrowserInjectionsByDomain"] = "block-browser-injections-by-domain";
22067
22205
  FeatureFlag["AC2476_DeprecateStripeSourcesAPI"] = "AC-2476-deprecate-stripe-sources-api";
22068
22206
  FeatureFlag["CipherKeyEncryption"] = "cipher-key-encryption";
22069
22207
  FeatureFlag["VerifiedSsoDomainEndpoint"] = "pm-12337-refactor-sso-details-endpoint";
@@ -22080,6 +22218,7 @@ var FeatureFlag;
22080
22218
  FeatureFlag["PM11360RemoveProviderExportPermission"] = "pm-11360-remove-provider-export-permission";
22081
22219
  FeatureFlag["PM12443RemovePagingLogic"] = "pm-12443-remove-paging-logic";
22082
22220
  FeatureFlag["PrivateKeyRegeneration"] = "pm-12241-private-key-regeneration";
22221
+ FeatureFlag["ResellerManagedOrgAlert"] = "PM-15814-alert-owners-of-reseller-managed-orgs";
22083
22222
  })(FeatureFlag || (FeatureFlag = {}));
22084
22223
  // Helper to ensure the value is treated as a boolean.
22085
22224
  const FALSE = false;
@@ -22113,6 +22252,7 @@ const DefaultFeatureFlagValue = {
22113
22252
  [FeatureFlag.SSHKeyVaultItem]: FALSE,
22114
22253
  [FeatureFlag.SSHAgent]: FALSE,
22115
22254
  [FeatureFlag.NotificationBarAddLoginImprovements]: FALSE,
22255
+ [FeatureFlag.BlockBrowserInjectionsByDomain]: FALSE,
22116
22256
  [FeatureFlag.AC2476_DeprecateStripeSourcesAPI]: FALSE,
22117
22257
  [FeatureFlag.CipherKeyEncryption]: FALSE,
22118
22258
  [FeatureFlag.VerifiedSsoDomainEndpoint]: FALSE,
@@ -22129,6 +22269,7 @@ const DefaultFeatureFlagValue = {
22129
22269
  [FeatureFlag.PM11360RemoveProviderExportPermission]: FALSE,
22130
22270
  [FeatureFlag.PM12443RemovePagingLogic]: FALSE,
22131
22271
  [FeatureFlag.PrivateKeyRegeneration]: FALSE,
22272
+ [FeatureFlag.ResellerManagedOrgAlert]: FALSE,
22132
22273
  };
22133
22274
 
22134
22275
 
@@ -22141,12 +22282,12 @@ const DefaultFeatureFlagValue = {
22141
22282
  // EXPORTS
22142
22283
  __webpack_require__.d(__webpack_exports__, {
22143
22284
  sK: () => (/* reexport */ ClientType),
22144
- bq: () => (/* reexport */ device_type_enum/* DeviceType */.bq),
22285
+ bq: () => (/* reexport */ device_type_enum/* DeviceType */.b),
22145
22286
  Bx: () => (/* reexport */ EventType),
22146
22287
  kG: () => (/* reexport */ HttpStatusCode)
22147
22288
  });
22148
22289
 
22149
- // UNUSED EXPORTS: DesktopDeviceTypes, EventSystemUser, IntegrationType, MobileDeviceTypes, NativeMessagingVersion, NotificationType
22290
+ // UNUSED EXPORTS: DeviceTypeMetadata, EventSystemUser, IntegrationType, NativeMessagingVersion, NotificationType
22150
22291
 
22151
22292
  ;// ../../libs/common/src/enums/client-type.enum.ts
22152
22293
  var ClientType;
@@ -22630,6 +22771,7 @@ var NotificationType;
22630
22771
  NotificationType[NotificationType["AuthRequestResponse"] = 16] = "AuthRequestResponse";
22631
22772
  NotificationType[NotificationType["SyncOrganizations"] = 17] = "SyncOrganizations";
22632
22773
  NotificationType[NotificationType["SyncOrganizationStatusChanged"] = 18] = "SyncOrganizationStatusChanged";
22774
+ NotificationType[NotificationType["SyncOrganizationCollectionSettingChanged"] = 19] = "SyncOrganizationCollectionSettingChanged";
22633
22775
  })(NotificationType || (NotificationType = {}));
22634
22776
 
22635
22777
  ;// ../../libs/common/src/enums/index.ts
@@ -24007,7 +24149,7 @@ class AbstractStorageService {
24007
24149
 
24008
24150
  /***/ }),
24009
24151
 
24010
- /***/ 6425:
24152
+ /***/ 5874:
24011
24153
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
24012
24154
 
24013
24155
 
@@ -24018,7 +24160,7 @@ __webpack_require__.d(__webpack_exports__, {
24018
24160
  K9: () => (/* reexport */ FileUploadType),
24019
24161
  VK: () => (/* reexport */ HashPurpose),
24020
24162
  EO: () => (/* reexport */ HtmlStorageLocation),
24021
- hq: () => (/* reexport */ key_suffix_options_enum/* KeySuffixOptions */.h),
24163
+ hq: () => (/* reexport */ KeySuffixOptions),
24022
24164
  xk: () => (/* reexport */ log_level_type_enum/* LogLevelType */.x),
24023
24165
  $B: () => (/* reexport */ StorageLocation),
24024
24166
  QX: () => (/* reexport */ encryptionTypeToString)
@@ -24092,8 +24234,13 @@ var HtmlStorageLocation;
24092
24234
  HtmlStorageLocation["Session"] = "session";
24093
24235
  })(HtmlStorageLocation || (HtmlStorageLocation = {}));
24094
24236
 
24095
- // EXTERNAL MODULE: ../../libs/common/src/platform/enums/key-suffix-options.enum.ts
24096
- var key_suffix_options_enum = __webpack_require__(9377);
24237
+ ;// ../../libs/common/src/platform/enums/key-suffix-options.enum.ts
24238
+ var KeySuffixOptions;
24239
+ (function (KeySuffixOptions) {
24240
+ KeySuffixOptions["Auto"] = "auto";
24241
+ KeySuffixOptions["Pin"] = "pin";
24242
+ })(KeySuffixOptions || (KeySuffixOptions = {}));
24243
+
24097
24244
  // EXTERNAL MODULE: ../../libs/common/src/platform/enums/log-level-type.enum.ts
24098
24245
  var log_level_type_enum = __webpack_require__(8357);
24099
24246
  ;// ../../libs/common/src/platform/enums/storage-location.enum.ts
@@ -24135,22 +24282,6 @@ const ThemeTypes = {
24135
24282
 
24136
24283
 
24137
24284
 
24138
- /***/ }),
24139
-
24140
- /***/ 9377:
24141
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
24142
-
24143
- /* harmony export */ __webpack_require__.d(__webpack_exports__, {
24144
- /* harmony export */ h: () => (/* binding */ KeySuffixOptions)
24145
- /* harmony export */ });
24146
- var KeySuffixOptions;
24147
- (function (KeySuffixOptions) {
24148
- KeySuffixOptions["Auto"] = "auto";
24149
- KeySuffixOptions["Biometric"] = "biometric";
24150
- KeySuffixOptions["Pin"] = "pin";
24151
- })(KeySuffixOptions || (KeySuffixOptions = {}));
24152
-
24153
-
24154
24285
  /***/ }),
24155
24286
 
24156
24287
  /***/ 8357:
@@ -32932,7 +33063,7 @@ class Domain {
32932
33063
  }
32933
33064
  }
32934
33065
  decryptObj(viewModel_1, map_1, orgId_1) {
32935
- return __awaiter(this, arguments, void 0, function* (viewModel, map, orgId, key = null) {
33066
+ return __awaiter(this, arguments, void 0, function* (viewModel, map, orgId, key = null, objectContext = "No Domain Context") {
32936
33067
  const promises = [];
32937
33068
  const self = this;
32938
33069
  for (const prop in map) {
@@ -32945,7 +33076,7 @@ class Domain {
32945
33076
  .then(() => {
32946
33077
  const mapProp = map[theProp] || theProp;
32947
33078
  if (self[mapProp]) {
32948
- return self[mapProp].decrypt(orgId, key);
33079
+ return self[mapProp].decrypt(orgId, key, `Property: ${prop}; ObjectContext: ${objectContext}`);
32949
33080
  }
32950
33081
  return null;
32951
33082
  })
@@ -32972,11 +33103,11 @@ class Domain {
32972
33103
  * @returns An object with the requested properties decrypted and the rest of the domain object untouched.
32973
33104
  */
32974
33105
  decryptObjWithKey(encryptedProperties_1, key_1, encryptService_1) {
32975
- return __awaiter(this, arguments, void 0, function* (encryptedProperties, key, encryptService, _ = this.constructor) {
33106
+ return __awaiter(this, arguments, void 0, function* (encryptedProperties, key, encryptService, _ = this.constructor, objectContext = "No Domain Context") {
32976
33107
  const promises = [];
32977
33108
  for (const prop of encryptedProperties) {
32978
33109
  const value = this[prop];
32979
- promises.push(this.decryptProperty(prop, value, key, encryptService));
33110
+ promises.push(this.decryptProperty(prop, value, key, encryptService, `Property: ${prop.toString()}; ObjectContext: ${objectContext}`));
32980
33111
  }
32981
33112
  const decryptedObjects = yield Promise.all(promises);
32982
33113
  const decryptedObject = decryptedObjects.reduce((acc, obj) => {
@@ -32985,11 +33116,11 @@ class Domain {
32985
33116
  return decryptedObject;
32986
33117
  });
32987
33118
  }
32988
- decryptProperty(propertyKey, value, key, encryptService) {
33119
+ decryptProperty(propertyKey, value, key, encryptService, decryptTrace) {
32989
33120
  return __awaiter(this, void 0, void 0, function* () {
32990
33121
  let decrypted = null;
32991
33122
  if (value) {
32992
- decrypted = yield value.decryptWithKey(key, encryptService);
33123
+ decrypted = yield value.decryptWithKey(key, encryptService, decryptTrace);
32993
33124
  }
32994
33125
  else {
32995
33126
  decrypted = null;
@@ -33011,7 +33142,7 @@ class Domain {
33011
33142
  /* harmony export */ q: () => (/* binding */ EncArrayBuffer)
33012
33143
  /* harmony export */ });
33013
33144
  /* harmony import */ var _platform_misc_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6948);
33014
- /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6425);
33145
+ /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5874);
33015
33146
  var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
33016
33147
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
33017
33148
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -33092,7 +33223,7 @@ class EncArrayBuffer {
33092
33223
  /* harmony export */ k: () => (/* binding */ EncString)
33093
33224
  /* harmony export */ });
33094
33225
  /* unused harmony export DECRYPT_ERROR */
33095
- /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6425);
33226
+ /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5874);
33096
33227
  /* harmony import */ var _misc_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6948);
33097
33228
  var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
33098
33229
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
@@ -33219,21 +33350,21 @@ class EncString {
33219
33350
  return _enums__WEBPACK_IMPORTED_MODULE_0__/* .EXPECTED_NUM_PARTS_BY_ENCRYPTION_TYPE */ .iS[encType] === encPieces.length;
33220
33351
  }
33221
33352
  decrypt(orgId_1) {
33222
- return __awaiter(this, arguments, void 0, function* (orgId, key = null) {
33353
+ return __awaiter(this, arguments, void 0, function* (orgId, key = null, context) {
33223
33354
  if (this.decryptedValue != null) {
33224
33355
  return this.decryptedValue;
33225
33356
  }
33226
- let keyContext = "provided-key";
33357
+ let decryptTrace = "provided-key";
33227
33358
  try {
33228
33359
  if (key == null) {
33229
33360
  key = yield this.getKeyForDecryption(orgId);
33230
- keyContext = orgId == null ? `domain-orgkey-${orgId}` : "domain-userkey|masterkey";
33361
+ decryptTrace = orgId == null ? `domain-orgkey-${orgId}` : "domain-userkey|masterkey";
33231
33362
  if (orgId != null) {
33232
- keyContext = `domain-orgkey-${orgId}`;
33363
+ decryptTrace = `domain-orgkey-${orgId}`;
33233
33364
  }
33234
33365
  else {
33235
33366
  const cryptoService = _misc_utils__WEBPACK_IMPORTED_MODULE_1__/* .Utils */ .A.getContainerService().getKeyService();
33236
- keyContext =
33367
+ decryptTrace =
33237
33368
  (yield cryptoService.getUserKey()) == null
33238
33369
  ? "domain-withlegacysupport-masterkey"
33239
33370
  : "domain-withlegacysupport-userkey";
@@ -33243,7 +33374,7 @@ class EncString {
33243
33374
  throw new Error("No key to decrypt EncString with orgId " + orgId);
33244
33375
  }
33245
33376
  const encryptService = _misc_utils__WEBPACK_IMPORTED_MODULE_1__/* .Utils */ .A.getContainerService().getEncryptService();
33246
- this.decryptedValue = yield encryptService.decryptToUtf8(this, key, keyContext);
33377
+ this.decryptedValue = yield encryptService.decryptToUtf8(this, key, decryptTrace == null ? context : `${decryptTrace}${context || ""}`);
33247
33378
  }
33248
33379
  catch (e) {
33249
33380
  this.decryptedValue = DECRYPT_ERROR;
@@ -33251,13 +33382,13 @@ class EncString {
33251
33382
  return this.decryptedValue;
33252
33383
  });
33253
33384
  }
33254
- decryptWithKey(key, encryptService) {
33255
- return __awaiter(this, void 0, void 0, function* () {
33385
+ decryptWithKey(key_1, encryptService_1) {
33386
+ return __awaiter(this, arguments, void 0, function* (key, encryptService, decryptTrace = "domain-withkey") {
33256
33387
  try {
33257
33388
  if (key == null) {
33258
33389
  throw new Error("No key to decrypt EncString");
33259
33390
  }
33260
- this.decryptedValue = yield encryptService.decryptToUtf8(this, key, "domain-withkey");
33391
+ this.decryptedValue = yield encryptService.decryptToUtf8(this, key, decryptTrace);
33261
33392
  }
33262
33393
  catch (e) {
33263
33394
  this.decryptedValue = DECRYPT_ERROR;
@@ -33313,7 +33444,7 @@ class ServerSettings {
33313
33444
  /* harmony export */ e: () => (/* binding */ SymmetricCryptoKey)
33314
33445
  /* harmony export */ });
33315
33446
  /* harmony import */ var _platform_misc_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6948);
33316
- /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6425);
33447
+ /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(5874);
33317
33448
 
33318
33449
 
33319
33450
  class SymmetricCryptoKey {
@@ -33349,12 +33480,8 @@ class SymmetricCryptoKey {
33349
33480
  else {
33350
33481
  throw new Error("Unsupported encType/key length.");
33351
33482
  }
33352
- if (this.key != null) {
33353
- this.keyB64 = _platform_misc_utils__WEBPACK_IMPORTED_MODULE_0__/* .Utils */ .A.fromBufferToB64(this.key);
33354
- }
33355
- if (this.encKey != null) {
33356
- this.encKeyB64 = _platform_misc_utils__WEBPACK_IMPORTED_MODULE_0__/* .Utils */ .A.fromBufferToB64(this.encKey);
33357
- }
33483
+ this.keyB64 = _platform_misc_utils__WEBPACK_IMPORTED_MODULE_0__/* .Utils */ .A.fromBufferToB64(this.key);
33484
+ this.encKeyB64 = _platform_misc_utils__WEBPACK_IMPORTED_MODULE_0__/* .Utils */ .A.fromBufferToB64(this.encKey);
33358
33485
  if (this.macKey != null) {
33359
33486
  this.macKeyB64 = _platform_misc_utils__WEBPACK_IMPORTED_MODULE_0__/* .Utils */ .A.fromBufferToB64(this.macKey);
33360
33487
  }
@@ -33835,10 +33962,6 @@ class DefaultConfigService {
33835
33962
  return this.serverConfig$.pipe((0,external_rxjs_.map)((serverConfig) => this.getFeatureFlagValue(serverConfig, key)));
33836
33963
  }
33837
33964
  getFeatureFlagValue(serverConfig, flag) {
33838
- // bodge the extension refresh flag since it's only partially removed
33839
- if (flag === "extension-refresh") {
33840
- return true;
33841
- }
33842
33965
  if ((serverConfig === null || serverConfig === void 0 ? void 0 : serverConfig.featureStates) == null || serverConfig.featureStates[flag] == null) {
33843
33966
  return feature_flag_enum/* DefaultFeatureFlagValue */.z[flag];
33844
33967
  }
@@ -34034,8 +34157,8 @@ __webpack_require__.d(__webpack_exports__, {
34034
34157
 
34035
34158
  // EXTERNAL MODULE: ../../libs/common/src/platform/misc/utils.ts + 2 modules
34036
34159
  var utils = __webpack_require__(6948);
34037
- // EXTERNAL MODULE: ../../libs/common/src/platform/enums/index.ts + 6 modules
34038
- var enums = __webpack_require__(6425);
34160
+ // EXTERNAL MODULE: ../../libs/common/src/platform/enums/index.ts + 7 modules
34161
+ var enums = __webpack_require__(5874);
34039
34162
  // EXTERNAL MODULE: ../../libs/common/src/platform/models/domain/enc-array-buffer.ts
34040
34163
  var enc_array_buffer = __webpack_require__(9230);
34041
34164
  // EXTERNAL MODULE: ../../libs/common/src/platform/models/domain/enc-string.ts
@@ -34138,7 +34261,7 @@ class EncryptServiceImplementation {
34138
34261
  const computedMac = yield this.cryptoFunctionService.hmacFast(fastParams.macData, fastParams.macKey, "sha256");
34139
34262
  const macsEqual = yield this.cryptoFunctionService.compareFast(fastParams.mac, computedMac);
34140
34263
  if (!macsEqual) {
34141
- this.logMacFailed("[Encrypt service] MAC comparison failed. Key or payload has changed. Key type " +
34264
+ this.logMacFailed("[Encrypt service] decryptToUtf8 MAC comparison failed. Key or payload has changed. Key type " +
34142
34265
  (0,enums/* encryptionTypeToString */.QX)(key.encType) +
34143
34266
  "Payload type " +
34144
34267
  (0,enums/* encryptionTypeToString */.QX)(encString.encryptionType) +
@@ -34147,11 +34270,11 @@ class EncryptServiceImplementation {
34147
34270
  return null;
34148
34271
  }
34149
34272
  }
34150
- return yield this.cryptoFunctionService.aesDecryptFast(fastParams, "cbc");
34273
+ return yield this.cryptoFunctionService.aesDecryptFast({ mode: "cbc", parameters: fastParams });
34151
34274
  });
34152
34275
  }
34153
- decryptToBytes(encThing, key) {
34154
- return __awaiter(this, void 0, void 0, function* () {
34276
+ decryptToBytes(encThing_1, key_1) {
34277
+ return __awaiter(this, arguments, void 0, function* (encThing, key, decryptContext = "no context") {
34155
34278
  if (key == null) {
34156
34279
  throw new Error("No encryption key provided.");
34157
34280
  }
@@ -34164,14 +34287,18 @@ class EncryptServiceImplementation {
34164
34287
  this.logService.error("[Encrypt service] Key has mac key but payload is missing mac bytes. Key type " +
34165
34288
  (0,enums/* encryptionTypeToString */.QX)(key.encType) +
34166
34289
  " Payload type " +
34167
- (0,enums/* encryptionTypeToString */.QX)(encThing.encryptionType));
34290
+ (0,enums/* encryptionTypeToString */.QX)(encThing.encryptionType) +
34291
+ " Decrypt context: " +
34292
+ decryptContext);
34168
34293
  return null;
34169
34294
  }
34170
34295
  if (key.encType !== encThing.encryptionType) {
34171
34296
  this.logService.error("[Encrypt service] Key encryption type does not match payload encryption type. Key type " +
34172
34297
  (0,enums/* encryptionTypeToString */.QX)(key.encType) +
34173
34298
  " Payload type " +
34174
- (0,enums/* encryptionTypeToString */.QX)(encThing.encryptionType));
34299
+ (0,enums/* encryptionTypeToString */.QX)(encThing.encryptionType) +
34300
+ " Decrypt context: " +
34301
+ decryptContext);
34175
34302
  return null;
34176
34303
  }
34177
34304
  if (key.macKey != null && encThing.macBytes != null) {
@@ -34180,20 +34307,24 @@ class EncryptServiceImplementation {
34180
34307
  macData.set(new Uint8Array(encThing.dataBytes), encThing.ivBytes.byteLength);
34181
34308
  const computedMac = yield this.cryptoFunctionService.hmac(macData, key.macKey, "sha256");
34182
34309
  if (computedMac === null) {
34183
- this.logMacFailed("[Encrypt service] Failed to compute MAC." +
34310
+ this.logMacFailed("[Encrypt service#decryptToBytes] Failed to compute MAC." +
34184
34311
  " Key type " +
34185
34312
  (0,enums/* encryptionTypeToString */.QX)(key.encType) +
34186
34313
  " Payload type " +
34187
- (0,enums/* encryptionTypeToString */.QX)(encThing.encryptionType));
34314
+ (0,enums/* encryptionTypeToString */.QX)(encThing.encryptionType) +
34315
+ " Decrypt context: " +
34316
+ decryptContext);
34188
34317
  return null;
34189
34318
  }
34190
34319
  const macsMatch = yield this.cryptoFunctionService.compare(encThing.macBytes, computedMac);
34191
34320
  if (!macsMatch) {
34192
- this.logMacFailed("[Encrypt service] MAC comparison failed. Key or payload has changed." +
34321
+ this.logMacFailed("[Encrypt service#decryptToBytes]: MAC comparison failed. Key or payload has changed." +
34193
34322
  " Key type " +
34194
34323
  (0,enums/* encryptionTypeToString */.QX)(key.encType) +
34195
34324
  " Payload type " +
34196
- (0,enums/* encryptionTypeToString */.QX)(encThing.encryptionType));
34325
+ (0,enums/* encryptionTypeToString */.QX)(encThing.encryptionType) +
34326
+ " Decrypt context: " +
34327
+ decryptContext);
34197
34328
  return null;
34198
34329
  }
34199
34330
  }
@@ -34749,8 +34880,8 @@ __webpack_require__.d(__webpack_exports__, {
34749
34880
  P: () => (/* binding */ FileUploadService)
34750
34881
  });
34751
34882
 
34752
- // EXTERNAL MODULE: ../../libs/common/src/platform/enums/index.ts + 6 modules
34753
- var enums = __webpack_require__(6425);
34883
+ // EXTERNAL MODULE: ../../libs/common/src/platform/enums/index.ts + 7 modules
34884
+ var enums = __webpack_require__(5874);
34754
34885
  // EXTERNAL MODULE: ../../libs/common/src/platform/misc/utils.ts + 2 modules
34755
34886
  var utils = __webpack_require__(6948);
34756
34887
  ;// ../../libs/common/src/platform/services/file-upload/azure-file-upload.service.ts
@@ -35040,7 +35171,7 @@ class FileUploadService {
35040
35171
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
35041
35172
  /* harmony export */ $: () => (/* binding */ KeyGenerationService)
35042
35173
  /* harmony export */ });
35043
- /* harmony import */ var _bitwarden_key_management__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(8614);
35174
+ /* harmony import */ var _bitwarden_key_management__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5907);
35044
35175
  /* harmony import */ var _misc_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6948);
35045
35176
  /* harmony import */ var _models_domain_symmetric_crypto_key__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(7310);
35046
35177
  var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
@@ -35226,8 +35357,8 @@ __webpack_require__.d(__webpack_exports__, {
35226
35357
 
35227
35358
  // EXTERNAL MODULE: ../../libs/common/src/state-migrations/index.ts
35228
35359
  var state_migrations = __webpack_require__(1181);
35229
- // EXTERNAL MODULE: ../../libs/common/src/state-migrations/migrate.ts + 68 modules
35230
- var migrate = __webpack_require__(1617);
35360
+ // EXTERNAL MODULE: ../../libs/common/src/state-migrations/migrate.ts + 69 modules
35361
+ var migrate = __webpack_require__(9176);
35231
35362
  ;// ../../libs/common/src/state-migrations/migration-helper.ts
35232
35363
  var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
35233
35364
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
@@ -35550,8 +35681,8 @@ __webpack_require__.d(__webpack_exports__, {
35550
35681
 
35551
35682
  // EXTERNAL MODULE: external "rxjs"
35552
35683
  var external_rxjs_ = __webpack_require__(573);
35553
- // EXTERNAL MODULE: ../../libs/key-management/src/index.ts + 17 modules
35554
- var src = __webpack_require__(8614);
35684
+ // EXTERNAL MODULE: ../../libs/key-management/src/index.ts + 20 modules
35685
+ var src = __webpack_require__(5907);
35555
35686
  // EXTERNAL MODULE: ../../node_modules/@bitwarden/sdk-internal/bitwarden_wasm_internal_bg.js
35556
35687
  var bitwarden_wasm_internal_bg = __webpack_require__(6414);
35557
35688
  // EXTERNAL MODULE: ../../libs/common/src/enums/device-type.enum.ts
@@ -35702,55 +35833,55 @@ class DefaultSdkService {
35702
35833
  }
35703
35834
  toDevice(device) {
35704
35835
  switch (device) {
35705
- case device_type_enum/* DeviceType */.bq.Android:
35836
+ case device_type_enum/* DeviceType */.b.Android:
35706
35837
  return "Android";
35707
- case device_type_enum/* DeviceType */.bq.iOS:
35838
+ case device_type_enum/* DeviceType */.b.iOS:
35708
35839
  return "iOS";
35709
- case device_type_enum/* DeviceType */.bq.ChromeExtension:
35840
+ case device_type_enum/* DeviceType */.b.ChromeExtension:
35710
35841
  return "ChromeExtension";
35711
- case device_type_enum/* DeviceType */.bq.FirefoxExtension:
35842
+ case device_type_enum/* DeviceType */.b.FirefoxExtension:
35712
35843
  return "FirefoxExtension";
35713
- case device_type_enum/* DeviceType */.bq.OperaExtension:
35844
+ case device_type_enum/* DeviceType */.b.OperaExtension:
35714
35845
  return "OperaExtension";
35715
- case device_type_enum/* DeviceType */.bq.EdgeExtension:
35846
+ case device_type_enum/* DeviceType */.b.EdgeExtension:
35716
35847
  return "EdgeExtension";
35717
- case device_type_enum/* DeviceType */.bq.WindowsDesktop:
35848
+ case device_type_enum/* DeviceType */.b.WindowsDesktop:
35718
35849
  return "WindowsDesktop";
35719
- case device_type_enum/* DeviceType */.bq.MacOsDesktop:
35850
+ case device_type_enum/* DeviceType */.b.MacOsDesktop:
35720
35851
  return "MacOsDesktop";
35721
- case device_type_enum/* DeviceType */.bq.LinuxDesktop:
35852
+ case device_type_enum/* DeviceType */.b.LinuxDesktop:
35722
35853
  return "LinuxDesktop";
35723
- case device_type_enum/* DeviceType */.bq.ChromeBrowser:
35854
+ case device_type_enum/* DeviceType */.b.ChromeBrowser:
35724
35855
  return "ChromeBrowser";
35725
- case device_type_enum/* DeviceType */.bq.FirefoxBrowser:
35856
+ case device_type_enum/* DeviceType */.b.FirefoxBrowser:
35726
35857
  return "FirefoxBrowser";
35727
- case device_type_enum/* DeviceType */.bq.OperaBrowser:
35858
+ case device_type_enum/* DeviceType */.b.OperaBrowser:
35728
35859
  return "OperaBrowser";
35729
- case device_type_enum/* DeviceType */.bq.EdgeBrowser:
35860
+ case device_type_enum/* DeviceType */.b.EdgeBrowser:
35730
35861
  return "EdgeBrowser";
35731
- case device_type_enum/* DeviceType */.bq.IEBrowser:
35862
+ case device_type_enum/* DeviceType */.b.IEBrowser:
35732
35863
  return "IEBrowser";
35733
- case device_type_enum/* DeviceType */.bq.UnknownBrowser:
35864
+ case device_type_enum/* DeviceType */.b.UnknownBrowser:
35734
35865
  return "UnknownBrowser";
35735
- case device_type_enum/* DeviceType */.bq.AndroidAmazon:
35866
+ case device_type_enum/* DeviceType */.b.AndroidAmazon:
35736
35867
  return "AndroidAmazon";
35737
- case device_type_enum/* DeviceType */.bq.UWP:
35868
+ case device_type_enum/* DeviceType */.b.UWP:
35738
35869
  return "UWP";
35739
- case device_type_enum/* DeviceType */.bq.SafariBrowser:
35870
+ case device_type_enum/* DeviceType */.b.SafariBrowser:
35740
35871
  return "SafariBrowser";
35741
- case device_type_enum/* DeviceType */.bq.VivaldiBrowser:
35872
+ case device_type_enum/* DeviceType */.b.VivaldiBrowser:
35742
35873
  return "VivaldiBrowser";
35743
- case device_type_enum/* DeviceType */.bq.VivaldiExtension:
35874
+ case device_type_enum/* DeviceType */.b.VivaldiExtension:
35744
35875
  return "VivaldiExtension";
35745
- case device_type_enum/* DeviceType */.bq.SafariExtension:
35876
+ case device_type_enum/* DeviceType */.b.SafariExtension:
35746
35877
  return "SafariExtension";
35747
- case device_type_enum/* DeviceType */.bq.Server:
35878
+ case device_type_enum/* DeviceType */.b.Server:
35748
35879
  return "Server";
35749
- case device_type_enum/* DeviceType */.bq.WindowsCLI:
35880
+ case device_type_enum/* DeviceType */.b.WindowsCLI:
35750
35881
  return "WindowsCLI";
35751
- case device_type_enum/* DeviceType */.bq.MacOsCLI:
35882
+ case device_type_enum/* DeviceType */.b.MacOsCLI:
35752
35883
  return "MacOsCLI";
35753
- case device_type_enum/* DeviceType */.bq.LinuxCLI:
35884
+ case device_type_enum/* DeviceType */.b.LinuxCLI:
35754
35885
  return "LinuxCLI";
35755
35886
  default:
35756
35887
  return "SDK";
@@ -35792,8 +35923,8 @@ __webpack_require__.d(__webpack_exports__, {
35792
35923
 
35793
35924
  // EXTERNAL MODULE: external "rxjs"
35794
35925
  var external_rxjs_ = __webpack_require__(573);
35795
- // EXTERNAL MODULE: ../../libs/common/src/platform/enums/index.ts + 6 modules
35796
- var enums = __webpack_require__(6425);
35926
+ // EXTERNAL MODULE: ../../libs/common/src/platform/enums/index.ts + 7 modules
35927
+ var enums = __webpack_require__(5874);
35797
35928
  // EXTERNAL MODULE: ../../libs/common/src/platform/models/domain/account.ts
35798
35929
  var account = __webpack_require__(1656);
35799
35930
  ;// ../../libs/common/src/platform/models/domain/state.ts
@@ -36456,7 +36587,7 @@ class StorageServiceProvider {
36456
36587
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
36457
36588
  /* harmony export */ T: () => (/* binding */ UserAutoUnlockKeyService)
36458
36589
  /* harmony export */ });
36459
- /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(6425);
36590
+ /* harmony import */ var _enums__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(5874);
36460
36591
  var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
36461
36592
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
36462
36593
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -37062,6 +37193,7 @@ __webpack_require__.d(__webpack_exports__, {
37062
37193
  Wm: () => (/* reexport */ state_definitions/* ENVIRONMENT_MEMORY */.Wm),
37063
37194
  Qb: () => (/* reexport */ state_definitions/* EVENT_COLLECTION_DISK */.Qb),
37064
37195
  Rv: () => (/* reexport */ state_definitions/* FOLDER_DISK */.Rv),
37196
+ jx: () => (/* reexport */ state_definitions/* FOLDER_MEMORY */.jx),
37065
37197
  qd: () => (/* reexport */ state_definitions/* GENERATOR_DISK */.qd),
37066
37198
  kj: () => (/* reexport */ state_definitions/* GENERATOR_MEMORY */.kj),
37067
37199
  P7: () => (/* reexport */ state_definitions/* KDF_CONFIG_DISK */.P7),
@@ -37573,6 +37705,7 @@ class StateDefinition {
37573
37705
  /* harmony export */ ie: () => (/* binding */ ACCOUNT_DISK),
37574
37706
  /* harmony export */ jB: () => (/* binding */ LOGIN_EMAIL_MEMORY),
37575
37707
  /* harmony export */ jb: () => (/* binding */ POLICIES_DISK),
37708
+ /* harmony export */ jx: () => (/* binding */ FOLDER_MEMORY),
37576
37709
  /* harmony export */ kj: () => (/* binding */ GENERATOR_MEMORY),
37577
37710
  /* harmony export */ nr: () => (/* binding */ ORGANIZATIONS_DISK),
37578
37711
  /* harmony export */ oR: () => (/* binding */ TOKEN_MEMORY),
@@ -37707,6 +37840,9 @@ const COLLECTION_DATA = new _state_definition__WEBPACK_IMPORTED_MODULE_0__/* .St
37707
37840
  web: "memory",
37708
37841
  });
37709
37842
  const FOLDER_DISK = new _state_definition__WEBPACK_IMPORTED_MODULE_0__/* .StateDefinition */ .z("folder", "disk", { web: "memory" });
37843
+ const FOLDER_MEMORY = new _state_definition__WEBPACK_IMPORTED_MODULE_0__/* .StateDefinition */ .z("decryptedFolders", "memory", {
37844
+ browser: "memory-large-object",
37845
+ });
37710
37846
  const VAULT_FILTER_DISK = new _state_definition__WEBPACK_IMPORTED_MODULE_0__/* .StateDefinition */ .z("vaultFilter", "disk", {
37711
37847
  web: "disk-local",
37712
37848
  });
@@ -37734,7 +37870,9 @@ const PREMIUM_BANNER_DISK_LOCAL = new _state_definition__WEBPACK_IMPORTED_MODULE
37734
37870
  });
37735
37871
  const BANNERS_DISMISSED_DISK = new _state_definition__WEBPACK_IMPORTED_MODULE_0__/* .StateDefinition */ .z("bannersDismissed", "disk");
37736
37872
  const VAULT_BROWSER_UI_ONBOARDING = new _state_definition__WEBPACK_IMPORTED_MODULE_0__/* .StateDefinition */ .z("vaultBrowserUiOnboarding", "disk");
37737
- const NEW_DEVICE_VERIFICATION_NOTICE = new _state_definition__WEBPACK_IMPORTED_MODULE_0__/* .StateDefinition */ .z("newDeviceVerificationNotice", "disk");
37873
+ const NEW_DEVICE_VERIFICATION_NOTICE = new _state_definition__WEBPACK_IMPORTED_MODULE_0__/* .StateDefinition */ .z("newDeviceVerificationNotice", "disk", {
37874
+ web: "disk-local",
37875
+ });
37738
37876
  const VAULT_APPEARANCE = new _state_definition__WEBPACK_IMPORTED_MODULE_0__/* .StateDefinition */ .z("vaultAppearance", "disk");
37739
37877
 
37740
37878
 
@@ -37993,17 +38131,18 @@ class CoreSyncService {
37993
38131
  yield this.stateProvider.getUser(userId, LAST_SYNC_DATE).update(() => date);
37994
38132
  });
37995
38133
  }
37996
- syncUpsertFolder(notification, isEdit) {
38134
+ syncUpsertFolder(notification, isEdit, userId) {
37997
38135
  return __awaiter(this, void 0, void 0, function* () {
37998
38136
  this.syncStarted();
37999
- if (yield this.stateService.getIsAuthenticated()) {
38137
+ const authStatus = yield (0,external_rxjs_.firstValueFrom)(this.authService.authStatusFor$(userId));
38138
+ if (authStatus >= authentication_status/* AuthenticationStatus */.J.Locked) {
38000
38139
  try {
38001
- const localFolder = yield this.folderService.get(notification.id);
38140
+ const localFolder = yield this.folderService.get(notification.id, userId);
38002
38141
  if ((!isEdit && localFolder == null) ||
38003
38142
  (isEdit && localFolder != null && localFolder.revisionDate < notification.revisionDate)) {
38004
38143
  const remoteFolder = yield this.folderApiService.get(notification.id);
38005
38144
  if (remoteFolder != null) {
38006
- yield this.folderService.upsert(new folder_data/* FolderData */.p(remoteFolder));
38145
+ yield this.folderService.upsert(new folder_data/* FolderData */.p(remoteFolder), userId);
38007
38146
  this.messageSender.send("syncedUpsertedFolder", { folderId: notification.id });
38008
38147
  return this.syncCompleted(true);
38009
38148
  }
@@ -38016,11 +38155,12 @@ class CoreSyncService {
38016
38155
  return this.syncCompleted(false);
38017
38156
  });
38018
38157
  }
38019
- syncDeleteFolder(notification) {
38158
+ syncDeleteFolder(notification, userId) {
38020
38159
  return __awaiter(this, void 0, void 0, function* () {
38021
38160
  this.syncStarted();
38022
- if (yield this.stateService.getIsAuthenticated()) {
38023
- yield this.folderService.delete(notification.id);
38161
+ const authStatus = yield (0,external_rxjs_.firstValueFrom)(this.authService.authStatusFor$(userId));
38162
+ if (authStatus >= authentication_status/* AuthenticationStatus */.J.Locked) {
38163
+ yield this.folderService.delete(notification.id, userId);
38024
38164
  this.messageSender.send("syncedDeletedFolder", { folderId: notification.id });
38025
38165
  this.syncCompleted(true);
38026
38166
  return true;
@@ -39543,7 +39683,7 @@ var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _argume
39543
39683
 
39544
39684
 
39545
39685
  class VaultTimeoutService {
39546
- constructor(accountService, masterPasswordService, cipherService, folderService, collectionService, platformUtilsService, messagingService, searchService, stateService, authService, vaultTimeoutSettingsService, stateEventRunnerService, taskSchedulerService, logService, lockedCallback = null, loggedOutCallback = null) {
39686
+ constructor(accountService, masterPasswordService, cipherService, folderService, collectionService, platformUtilsService, messagingService, searchService, stateService, authService, vaultTimeoutSettingsService, stateEventRunnerService, taskSchedulerService, logService, biometricService, lockedCallback = null, loggedOutCallback = null) {
39547
39687
  this.accountService = accountService;
39548
39688
  this.masterPasswordService = masterPasswordService;
39549
39689
  this.cipherService = cipherService;
@@ -39558,6 +39698,7 @@ class VaultTimeoutService {
39558
39698
  this.stateEventRunnerService = stateEventRunnerService;
39559
39699
  this.taskSchedulerService = taskSchedulerService;
39560
39700
  this.logService = logService;
39701
+ this.biometricService = biometricService;
39561
39702
  this.lockedCallback = lockedCallback;
39562
39703
  this.loggedOutCallback = loggedOutCallback;
39563
39704
  this.inited = false;
@@ -39599,6 +39740,7 @@ class VaultTimeoutService {
39599
39740
  }
39600
39741
  lock(userId) {
39601
39742
  return __awaiter(this, void 0, void 0, function* () {
39743
+ yield this.biometricService.setShouldAutopromptNow(false);
39602
39744
  const authed = yield this.stateService.getIsAuthenticated({ userId: userId });
39603
39745
  if (!authed) {
39604
39746
  return;
@@ -39622,9 +39764,9 @@ class VaultTimeoutService {
39622
39764
  })));
39623
39765
  if (userId == null || userId === currentUserId) {
39624
39766
  yield this.searchService.clearIndex();
39625
- yield this.folderService.clearCache();
39626
39767
  yield this.collectionService.clearActiveUserCache();
39627
39768
  }
39769
+ yield this.folderService.clearDecryptedFolderState(lockingUserId);
39628
39770
  yield this.masterPasswordService.clearMasterKey(lockingUserId);
39629
39771
  yield this.stateService.setUserKeyAutoUnlock(null, { userId: lockingUserId });
39630
39772
  yield this.stateService.setCryptoMasterKeyAuto(null, { userId: lockingUserId });
@@ -39692,13 +39834,13 @@ class VaultTimeoutService {
39692
39834
  /* harmony export */ GR: () => (/* reexport safe */ _migrate__WEBPACK_IMPORTED_MODULE_0__.GR),
39693
39835
  /* harmony export */ yT: () => (/* reexport safe */ _migrate__WEBPACK_IMPORTED_MODULE_0__.yT)
39694
39836
  /* harmony export */ });
39695
- /* harmony import */ var _migrate__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(1617);
39837
+ /* harmony import */ var _migrate__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(9176);
39696
39838
 
39697
39839
 
39698
39840
 
39699
39841
  /***/ }),
39700
39842
 
39701
- /***/ 1617:
39843
+ /***/ 9176:
39702
39844
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
39703
39845
 
39704
39846
 
@@ -44183,6 +44325,62 @@ class MoveLastSyncDate extends Migrator {
44183
44325
  }
44184
44326
  }
44185
44327
 
44328
+ ;// ../../libs/common/src/state-migrations/migrations/69-migrate-incorrect-folder-key.ts
44329
+ var _69_migrate_incorrect_folder_key_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
44330
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
44331
+ return new (P || (P = Promise))(function (resolve, reject) {
44332
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
44333
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
44334
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
44335
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
44336
+ });
44337
+ };
44338
+
44339
+ const BAD_FOLDER_KEY = {
44340
+ key: "folder", // We inadvertently changed the key from "folders" to "folder"
44341
+ stateDefinition: {
44342
+ name: "folder",
44343
+ },
44344
+ };
44345
+ const GOOD_FOLDER_KEY = {
44346
+ key: "folders", // We should keep the key as "folders"
44347
+ stateDefinition: {
44348
+ name: "folder",
44349
+ },
44350
+ };
44351
+ class MigrateIncorrectFolderKey extends Migrator {
44352
+ migrate(helper) {
44353
+ return _69_migrate_incorrect_folder_key_awaiter(this, void 0, void 0, function* () {
44354
+ function migrateUser(userId) {
44355
+ return _69_migrate_incorrect_folder_key_awaiter(this, void 0, void 0, function* () {
44356
+ const value = yield helper.getFromUser(userId, BAD_FOLDER_KEY);
44357
+ if (value != null) {
44358
+ yield helper.setToUser(userId, GOOD_FOLDER_KEY, value);
44359
+ }
44360
+ yield helper.removeFromUser(userId, BAD_FOLDER_KEY);
44361
+ });
44362
+ }
44363
+ const users = yield helper.getKnownUserIds();
44364
+ yield Promise.all(users.map((userId) => migrateUser(userId)));
44365
+ });
44366
+ }
44367
+ rollback(helper) {
44368
+ return _69_migrate_incorrect_folder_key_awaiter(this, void 0, void 0, function* () {
44369
+ function rollbackUser(userId) {
44370
+ return _69_migrate_incorrect_folder_key_awaiter(this, void 0, void 0, function* () {
44371
+ const value = yield helper.getFromUser(userId, GOOD_FOLDER_KEY);
44372
+ if (value != null) {
44373
+ yield helper.setToUser(userId, BAD_FOLDER_KEY, value);
44374
+ }
44375
+ yield helper.removeFromUser(userId, GOOD_FOLDER_KEY);
44376
+ });
44377
+ }
44378
+ const users = yield helper.getKnownUserIds();
44379
+ yield Promise.all(users.map((userId) => rollbackUser(userId)));
44380
+ });
44381
+ }
44382
+ }
44383
+
44186
44384
  ;// ../../libs/common/src/state-migrations/migrations/7-move-biometric-auto-prompt-to-account.ts
44187
44385
  var _7_move_biometric_auto_prompt_to_account_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
44188
44386
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
@@ -44465,10 +44663,11 @@ var migrate_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _
44465
44663
 
44466
44664
 
44467
44665
 
44666
+
44468
44667
 
44469
44668
 
44470
44669
  const MIN_VERSION = 3;
44471
- const CURRENT_VERSION = 68;
44670
+ const CURRENT_VERSION = 69;
44472
44671
  function createMigrationBuilder() {
44473
44672
  return MigrationBuilder.create()
44474
44673
  .with(MinVersionMigrator)
@@ -44536,7 +44735,8 @@ function createMigrationBuilder() {
44536
44735
  .with(ForwarderOptionsMigrator, 64, 65)
44537
44736
  .with(MoveFinalDesktopSettingsMigrator, 65, 66)
44538
44737
  .with(RemoveUnassignedItemsBannerDismissed, 66, 67)
44539
- .with(MoveLastSyncDate, 67, CURRENT_VERSION);
44738
+ .with(MoveLastSyncDate, 67, 68)
44739
+ .with(MigrateIncorrectFolderKey, 68, CURRENT_VERSION);
44540
44740
  }
44541
44741
  function currentVersion(storageService, logService) {
44542
44742
  return migrate_awaiter(this, void 0, void 0, function* () {
@@ -46032,8 +46232,8 @@ __webpack_require__.d(__webpack_exports__, {
46032
46232
 
46033
46233
  // EXTERNAL MODULE: external "rxjs"
46034
46234
  var external_rxjs_ = __webpack_require__(573);
46035
- // EXTERNAL MODULE: ../../libs/key-management/src/index.ts + 17 modules
46036
- var src = __webpack_require__(8614);
46235
+ // EXTERNAL MODULE: ../../libs/key-management/src/index.ts + 20 modules
46236
+ var src = __webpack_require__(5907);
46037
46237
  // EXTERNAL MODULE: ../../libs/common/src/platform/misc/utils.ts + 2 modules
46038
46238
  var utils = __webpack_require__(6948);
46039
46239
  // EXTERNAL MODULE: ../../libs/common/src/tools/send/enums/send-type.ts
@@ -47663,11 +47863,11 @@ class Attachment extends _platform_models_domain_domain_base__WEBPACK_IMPORTED_M
47663
47863
  key: null,
47664
47864
  }, ["id", "url", "sizeName"]);
47665
47865
  }
47666
- decrypt(orgId, encKey) {
47667
- return __awaiter(this, void 0, void 0, function* () {
47866
+ decrypt(orgId_1) {
47867
+ return __awaiter(this, arguments, void 0, function* (orgId, context = "No Cipher Context", encKey) {
47668
47868
  const view = yield this.decryptObj(new _view_attachment_view__WEBPACK_IMPORTED_MODULE_4__/* .AttachmentView */ .$(this), {
47669
47869
  fileName: null,
47670
- }, orgId, encKey);
47870
+ }, orgId, encKey, "DomainType: Attachment; " + context);
47671
47871
  if (this.key != null) {
47672
47872
  view.key = yield this.decryptAttachmentKey(orgId, encKey);
47673
47873
  }
@@ -47735,6 +47935,15 @@ class Attachment extends _platform_models_domain_domain_base__WEBPACK_IMPORTED_M
47735
47935
  /* harmony import */ var _platform_models_domain_enc_string__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6505);
47736
47936
  /* harmony import */ var _data_card_data__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(3644);
47737
47937
  /* harmony import */ var _view_card_view__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(2780);
47938
+ var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
47939
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
47940
+ return new (P || (P = Promise))(function (resolve, reject) {
47941
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
47942
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
47943
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
47944
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
47945
+ });
47946
+ };
47738
47947
 
47739
47948
 
47740
47949
 
@@ -47754,15 +47963,17 @@ class Card extends _platform_models_domain_domain_base__WEBPACK_IMPORTED_MODULE_
47754
47963
  code: null,
47755
47964
  }, []);
47756
47965
  }
47757
- decrypt(orgId, encKey) {
47758
- return this.decryptObj(new _view_card_view__WEBPACK_IMPORTED_MODULE_2__/* .CardView */ .G(), {
47759
- cardholderName: null,
47760
- brand: null,
47761
- number: null,
47762
- expMonth: null,
47763
- expYear: null,
47764
- code: null,
47765
- }, orgId, encKey);
47966
+ decrypt(orgId_1) {
47967
+ return __awaiter(this, arguments, void 0, function* (orgId, context = "No Cipher Context", encKey) {
47968
+ return this.decryptObj(new _view_card_view__WEBPACK_IMPORTED_MODULE_2__/* .CardView */ .G(), {
47969
+ cardholderName: null,
47970
+ brand: null,
47971
+ number: null,
47972
+ expMonth: null,
47973
+ expYear: null,
47974
+ code: null,
47975
+ }, orgId, encKey, "DomainType: Card; " + context);
47976
+ });
47766
47977
  }
47767
47978
  toCardData() {
47768
47979
  const c = new _data_card_data__WEBPACK_IMPORTED_MODULE_3__/* .CardData */ .b();
@@ -47925,7 +48136,13 @@ class Cipher extends _platform_models_domain_domain_base__WEBPACK_IMPORTED_MODUL
47925
48136
  let bypassValidation = true;
47926
48137
  if (this.key != null) {
47927
48138
  const encryptService = _platform_misc_utils__WEBPACK_IMPORTED_MODULE_0__/* .Utils */ .A.getContainerService().getEncryptService();
47928
- encKey = new _platform_models_domain_symmetric_crypto_key__WEBPACK_IMPORTED_MODULE_3__/* .SymmetricCryptoKey */ .e(yield encryptService.decryptToBytes(this.key, encKey));
48139
+ const keyBytes = yield encryptService.decryptToBytes(this.key, encKey, `Cipher Id: ${this.id}; Content: CipherKey; IsEncryptedByOrgKey: ${this.organizationId != null}`);
48140
+ if (keyBytes == null) {
48141
+ model.name = "[error: cannot decrypt]";
48142
+ model.decryptionFailure = true;
48143
+ return model;
48144
+ }
48145
+ encKey = new _platform_models_domain_symmetric_crypto_key__WEBPACK_IMPORTED_MODULE_3__/* .SymmetricCryptoKey */ .e(keyBytes);
47929
48146
  bypassValidation = false;
47930
48147
  }
47931
48148
  yield this.decryptObj(model, {
@@ -47934,19 +48151,19 @@ class Cipher extends _platform_models_domain_domain_base__WEBPACK_IMPORTED_MODUL
47934
48151
  }, this.organizationId, encKey);
47935
48152
  switch (this.type) {
47936
48153
  case _enums_cipher_type__WEBPACK_IMPORTED_MODULE_5__/* .CipherType */ .g.Login:
47937
- model.login = yield this.login.decrypt(this.organizationId, bypassValidation, encKey);
48154
+ model.login = yield this.login.decrypt(this.organizationId, bypassValidation, `Cipher Id: ${this.id}`, encKey);
47938
48155
  break;
47939
48156
  case _enums_cipher_type__WEBPACK_IMPORTED_MODULE_5__/* .CipherType */ .g.SecureNote:
47940
- model.secureNote = yield this.secureNote.decrypt(this.organizationId, encKey);
48157
+ model.secureNote = yield this.secureNote.decrypt(this.organizationId, `Cipher Id: ${this.id}`, encKey);
47941
48158
  break;
47942
48159
  case _enums_cipher_type__WEBPACK_IMPORTED_MODULE_5__/* .CipherType */ .g.Card:
47943
- model.card = yield this.card.decrypt(this.organizationId, encKey);
48160
+ model.card = yield this.card.decrypt(this.organizationId, `Cipher Id: ${this.id}`, encKey);
47944
48161
  break;
47945
48162
  case _enums_cipher_type__WEBPACK_IMPORTED_MODULE_5__/* .CipherType */ .g.Identity:
47946
- model.identity = yield this.identity.decrypt(this.organizationId, encKey);
48163
+ model.identity = yield this.identity.decrypt(this.organizationId, `Cipher Id: ${this.id}`, encKey);
47947
48164
  break;
47948
48165
  case _enums_cipher_type__WEBPACK_IMPORTED_MODULE_5__/* .CipherType */ .g.SshKey:
47949
- model.sshKey = yield this.sshKey.decrypt(this.organizationId, encKey);
48166
+ model.sshKey = yield this.sshKey.decrypt(this.organizationId, `Cipher Id: ${this.id}`, encKey);
47950
48167
  break;
47951
48168
  default:
47952
48169
  break;
@@ -47956,7 +48173,7 @@ class Cipher extends _platform_models_domain_domain_base__WEBPACK_IMPORTED_MODUL
47956
48173
  yield this.attachments.reduce((promise, attachment) => {
47957
48174
  return promise
47958
48175
  .then(() => {
47959
- return attachment.decrypt(this.organizationId, encKey);
48176
+ return attachment.decrypt(this.organizationId, `Cipher Id: ${this.id}`, encKey);
47960
48177
  })
47961
48178
  .then((decAttachment) => {
47962
48179
  attachments.push(decAttachment);
@@ -48383,7 +48600,7 @@ class Identity extends _platform_models_domain_domain_base__WEBPACK_IMPORTED_MOD
48383
48600
  licenseNumber: null,
48384
48601
  }, []);
48385
48602
  }
48386
- decrypt(orgId, encKey) {
48603
+ decrypt(orgId, context = "No Cipher Context", encKey) {
48387
48604
  return this.decryptObj(new _view_identity_view__WEBPACK_IMPORTED_MODULE_2__/* .IdentityView */ .O(), {
48388
48605
  title: null,
48389
48606
  firstName: null,
@@ -48403,7 +48620,7 @@ class Identity extends _platform_models_domain_domain_base__WEBPACK_IMPORTED_MOD
48403
48620
  username: null,
48404
48621
  passportNumber: null,
48405
48622
  licenseNumber: null,
48406
- }, orgId, encKey);
48623
+ }, orgId, encKey, "DomainType: Identity; " + context);
48407
48624
  }
48408
48625
  toIdentityData() {
48409
48626
  const i = new _data_identity_data__WEBPACK_IMPORTED_MODULE_3__/* .IdentityData */ .j();
@@ -48514,10 +48731,10 @@ class LoginUri extends _platform_models_domain_domain_base__WEBPACK_IMPORTED_MOD
48514
48731
  uriChecksum: null,
48515
48732
  }, []);
48516
48733
  }
48517
- decrypt(orgId, encKey) {
48734
+ decrypt(orgId, context = "No Cipher Context", encKey) {
48518
48735
  return this.decryptObj(new _view_login_uri_view__WEBPACK_IMPORTED_MODULE_3__/* .LoginUriView */ .z(this), {
48519
48736
  uri: null,
48520
- }, orgId, encKey);
48737
+ }, orgId, encKey, context);
48521
48738
  }
48522
48739
  validateChecksum(clearTextUri, orgId, encKey) {
48523
48740
  return __awaiter(this, void 0, void 0, function* () {
@@ -48606,13 +48823,13 @@ class Login extends _platform_models_domain_domain_base__WEBPACK_IMPORTED_MODULE
48606
48823
  this.fido2Credentials = obj.fido2Credentials.map((key) => new _fido2_credential__WEBPACK_IMPORTED_MODULE_3__/* .Fido2Credential */ .U(key));
48607
48824
  }
48608
48825
  }
48609
- decrypt(orgId, bypassValidation, encKey) {
48610
- return __awaiter(this, void 0, void 0, function* () {
48826
+ decrypt(orgId_1, bypassValidation_1) {
48827
+ return __awaiter(this, arguments, void 0, function* (orgId, bypassValidation, context = "No Cipher Context", encKey) {
48611
48828
  const view = yield this.decryptObj(new _view_login_view__WEBPACK_IMPORTED_MODULE_2__/* .LoginView */ .r(this), {
48612
48829
  username: null,
48613
48830
  password: null,
48614
48831
  totp: null,
48615
- }, orgId, encKey);
48832
+ }, orgId, encKey, `DomainType: Login; ${context}`);
48616
48833
  if (this.uris != null) {
48617
48834
  view.uris = [];
48618
48835
  for (let i = 0; i < this.uris.length; i++) {
@@ -48620,7 +48837,7 @@ class Login extends _platform_models_domain_domain_base__WEBPACK_IMPORTED_MODULE
48620
48837
  if (this.uris[i].uri == null) {
48621
48838
  continue;
48622
48839
  }
48623
- const uri = yield this.uris[i].decrypt(orgId, encKey);
48840
+ const uri = yield this.uris[i].decrypt(orgId, context, encKey);
48624
48841
  // URIs are shared remotely after decryption
48625
48842
  // we need to validate that the string hasn't been changed by a compromised server
48626
48843
  // This validation is tied to the existence of cypher.key for backwards compatibility
@@ -48711,7 +48928,7 @@ class Password extends _platform_models_domain_domain_base__WEBPACK_IMPORTED_MOD
48711
48928
  decrypt(orgId, encKey) {
48712
48929
  return this.decryptObj(new _view_password_history_view__WEBPACK_IMPORTED_MODULE_2__/* .PasswordHistoryView */ .j(this), {
48713
48930
  password: null,
48714
- }, orgId, encKey);
48931
+ }, orgId, encKey, "DomainType: PasswordHistory");
48715
48932
  }
48716
48933
  toPasswordHistoryData() {
48717
48934
  const ph = new _data_password_history_data__WEBPACK_IMPORTED_MODULE_3__/* .PasswordHistoryData */ .k();
@@ -48746,6 +48963,15 @@ class Password extends _platform_models_domain_domain_base__WEBPACK_IMPORTED_MOD
48746
48963
  /* harmony import */ var _platform_models_domain_domain_base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(673);
48747
48964
  /* harmony import */ var _data_secure_note_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(8188);
48748
48965
  /* harmony import */ var _view_secure_note_view__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(2742);
48966
+ var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
48967
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
48968
+ return new (P || (P = Promise))(function (resolve, reject) {
48969
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
48970
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
48971
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
48972
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
48973
+ });
48974
+ };
48749
48975
 
48750
48976
 
48751
48977
 
@@ -48757,8 +48983,10 @@ class SecureNote extends _platform_models_domain_domain_base__WEBPACK_IMPORTED_M
48757
48983
  }
48758
48984
  this.type = obj.type;
48759
48985
  }
48760
- decrypt(orgId, encKey) {
48761
- return Promise.resolve(new _view_secure_note_view__WEBPACK_IMPORTED_MODULE_1__/* .SecureNoteView */ .Z(this));
48986
+ decrypt(orgId_1) {
48987
+ return __awaiter(this, arguments, void 0, function* (orgId, context = "No Cipher Context", encKey) {
48988
+ return new _view_secure_note_view__WEBPACK_IMPORTED_MODULE_1__/* .SecureNoteView */ .Z(this);
48989
+ });
48762
48990
  }
48763
48991
  toSecureNoteData() {
48764
48992
  const n = new _data_secure_note_data__WEBPACK_IMPORTED_MODULE_2__/* .SecureNoteData */ .e();
@@ -48802,12 +49030,12 @@ class SshKey extends _platform_models_domain_domain_base__WEBPACK_IMPORTED_MODUL
48802
49030
  keyFingerprint: null,
48803
49031
  }, []);
48804
49032
  }
48805
- decrypt(orgId, encKey) {
49033
+ decrypt(orgId, context = "No Cipher Context", encKey) {
48806
49034
  return this.decryptObj(new _view_ssh_key_view__WEBPACK_IMPORTED_MODULE_2__/* .SshKeyView */ .H(), {
48807
49035
  privateKey: null,
48808
49036
  publicKey: null,
48809
49037
  keyFingerprint: null,
48810
- }, orgId, encKey);
49038
+ }, orgId, encKey, "DomainType: SshKey; " + context);
48811
49039
  }
48812
49040
  toSshKeyData() {
48813
49041
  const c = new _data_ssh_key_data__WEBPACK_IMPORTED_MODULE_3__/* .SshKeyData */ .E();
@@ -49362,6 +49590,10 @@ class CipherView {
49362
49590
  this.creationDate = null;
49363
49591
  this.deletedDate = null;
49364
49592
  this.reprompt = _enums_cipher_reprompt_type__WEBPACK_IMPORTED_MODULE_2__/* .CipherRepromptType */ .b.None;
49593
+ /**
49594
+ * Flag to indicate if the cipher decryption failed.
49595
+ */
49596
+ this.decryptionFailure = false;
49365
49597
  if (!c) {
49366
49598
  return;
49367
49599
  }
@@ -50532,6 +50764,10 @@ const DECRYPTED_CIPHERS = state/* UserKeyDefinition */.Ok.record(state/* CIPHERS
50532
50764
  deserializer: (cipher) => cipher_view/* CipherView */.f.fromJSON(cipher),
50533
50765
  clearOn: ["logout", "lock"],
50534
50766
  });
50767
+ const FAILED_DECRYPTED_CIPHERS = state/* UserKeyDefinition */.Ok.array(state/* CIPHERS_MEMORY */.Xk, "failedDecryptedCiphers", {
50768
+ deserializer: (cipher) => cipher_view/* CipherView */.f.fromJSON(cipher),
50769
+ clearOn: ["logout", "lock"],
50770
+ });
50535
50771
  const LOCAL_DATA_KEY = new state/* UserKeyDefinition */.Ok(state/* CIPHERS_DISK_LOCAL */.HR, "localData", {
50536
50772
  deserializer: (localData) => localData,
50537
50773
  clearOn: ["logout"],
@@ -50631,12 +50867,14 @@ class CipherService {
50631
50867
  this.localDataState = this.stateProvider.getActive(LOCAL_DATA_KEY);
50632
50868
  this.encryptedCiphersState = this.stateProvider.getActive(ENCRYPTED_CIPHERS);
50633
50869
  this.decryptedCiphersState = this.stateProvider.getActive(DECRYPTED_CIPHERS);
50870
+ this.failedToDecryptCiphersState = this.stateProvider.getActive(FAILED_DECRYPTED_CIPHERS);
50634
50871
  this.addEditCipherInfoState = this.stateProvider.getActive(ADD_EDIT_CIPHER_INFO_KEY);
50635
50872
  this.localData$ = this.localDataState.state$.pipe((0,external_rxjs_.map)((data) => data !== null && data !== void 0 ? data : {}));
50636
50873
  this.ciphers$ = this.encryptedCiphersState.state$.pipe((0,external_rxjs_.map)((ciphers) => ciphers !== null && ciphers !== void 0 ? ciphers : {}));
50637
50874
  // Decrypted ciphers depend on both ciphers and local data and need to be updated when either changes
50638
50875
  this.cipherViews$ = (0,external_rxjs_.combineLatest)([this.encryptedCiphersState.state$, this.localData$]).pipe((0,external_rxjs_.filter)(([ciphers]) => ciphers != null), // Skip if ciphers haven't been loaded yor synced yet
50639
50876
  (0,external_rxjs_.switchMap)(() => (0,external_rxjs_.merge)(this.forceCipherViews$, this.getAllDecrypted())), (0,external_rxjs_.shareReplay)({ bufferSize: 1, refCount: true }));
50877
+ this.failedToDecryptCiphers$ = this.failedToDecryptCiphersState.state$.pipe((0,external_rxjs_.filter)((ciphers) => ciphers != null), (0,external_rxjs_.switchMap)((ciphers) => (0,external_rxjs_.merge)(this.forceCipherViews$, (0,external_rxjs_.of)(ciphers))), (0,external_rxjs_.shareReplay)({ bufferSize: 1, refCount: true }));
50640
50878
  this.addEditCipherInfo$ = this.addEditCipherInfoState.state$;
50641
50879
  }
50642
50880
  setDecryptedCipherCache(value, userId) {
@@ -50657,6 +50895,11 @@ class CipherService {
50657
50895
  }
50658
50896
  });
50659
50897
  }
50898
+ setFailedDecryptedCiphers(cipherViews, userId) {
50899
+ return __awaiter(this, void 0, void 0, function* () {
50900
+ yield this.stateProvider.setUserState(FAILED_DECRYPTED_CIPHERS, cipherViews, userId);
50901
+ });
50902
+ }
50660
50903
  setDecryptedCiphers(value, userId) {
50661
50904
  return __awaiter(this, void 0, void 0, function* () {
50662
50905
  const cipherViews = {};
@@ -50835,7 +51078,7 @@ class CipherService {
50835
51078
  */
50836
51079
  getAllDecrypted() {
50837
51080
  return __awaiter(this, void 0, void 0, function* () {
50838
- let decCiphers = yield this.getDecryptedCiphers();
51081
+ const decCiphers = yield this.getDecryptedCiphers();
50839
51082
  if (decCiphers != null && decCiphers.length !== 0) {
50840
51083
  yield this.reindexCiphers();
50841
51084
  return yield this.getDecryptedCiphers();
@@ -50844,9 +51087,10 @@ class CipherService {
50844
51087
  if (activeUserId == null) {
50845
51088
  return [];
50846
51089
  }
50847
- decCiphers = yield this.decryptCiphers(yield this.getAll(), activeUserId);
50848
- yield this.setDecryptedCipherCache(decCiphers, activeUserId);
50849
- return decCiphers;
51090
+ const [newDecCiphers, failedCiphers] = yield this.decryptCiphers(yield this.getAll(), activeUserId);
51091
+ yield this.setDecryptedCipherCache(newDecCiphers, activeUserId);
51092
+ yield this.setFailedDecryptedCiphers(failedCiphers, activeUserId);
51093
+ return newDecCiphers;
50850
51094
  });
50851
51095
  }
50852
51096
  getDecryptedCiphers() {
@@ -50854,6 +51098,13 @@ class CipherService {
50854
51098
  return Object.values(yield (0,external_rxjs_.firstValueFrom)(this.decryptedCiphersState.state$.pipe((0,external_rxjs_.map)((c) => c !== null && c !== void 0 ? c : {}))));
50855
51099
  });
50856
51100
  }
51101
+ /**
51102
+ * Decrypts the provided ciphers using the provided user's keys.
51103
+ * @param ciphers
51104
+ * @param userId
51105
+ * @returns Two cipher arrays, the first containing successfully decrypted ciphers and the second containing ciphers that failed to decrypt.
51106
+ * @private
51107
+ */
50857
51108
  decryptCiphers(ciphers, userId) {
50858
51109
  return __awaiter(this, void 0, void 0, function* () {
50859
51110
  const keys = yield (0,external_rxjs_.firstValueFrom)(this.keyService.cipherDecryptionKeys$(userId, true));
@@ -50869,7 +51120,7 @@ class CipherService {
50869
51120
  agg[c.organizationId].push(c);
50870
51121
  return agg;
50871
51122
  }, {});
50872
- const decCiphers = (yield Promise.all(Object.entries(grouped).map((_a) => __awaiter(this, [_a], void 0, function* ([orgId, groupedCiphers]) {
51123
+ const allCipherViews = (yield Promise.all(Object.entries(grouped).map((_a) => __awaiter(this, [_a], void 0, function* ([orgId, groupedCiphers]) {
50873
51124
  var _b, _c;
50874
51125
  if (yield this.configService.getFeatureFlag(feature_flag_enum/* FeatureFlag */.T.PM4154_BulkEncryptionService)) {
50875
51126
  return yield this.bulkEncryptService.decryptItems(groupedCiphers, (_b = keys.orgKeys[orgId]) !== null && _b !== void 0 ? _b : keys.userKey);
@@ -50880,7 +51131,16 @@ class CipherService {
50880
51131
  }))))
50881
51132
  .flat()
50882
51133
  .sort(this.getLocaleSortingFunction());
50883
- return decCiphers;
51134
+ // Split ciphers into two arrays, one for successfully decrypted ciphers and one for ciphers that failed to decrypt
51135
+ return allCipherViews.reduce((acc, c) => {
51136
+ if (c.decryptionFailure) {
51137
+ acc[1].push(c);
51138
+ }
51139
+ else {
51140
+ acc[0].push(c);
51141
+ }
51142
+ return acc;
51143
+ }, [[], []]);
50884
51144
  });
50885
51145
  }
50886
51146
  reindexCiphers() {
@@ -51611,9 +51871,13 @@ class CipherService {
51611
51871
  }
51612
51872
  let encryptedCiphers = [];
51613
51873
  const ciphers = yield (0,external_rxjs_.firstValueFrom)(this.cipherViews$);
51874
+ const failedCiphers = yield (0,external_rxjs_.firstValueFrom)(this.failedToDecryptCiphers$);
51614
51875
  if (!ciphers) {
51615
51876
  return encryptedCiphers;
51616
51877
  }
51878
+ if (failedCiphers.length > 0) {
51879
+ throw new Error("Cannot rotate ciphers when decryption failures are present");
51880
+ }
51617
51881
  const userCiphers = ciphers.filter((c) => c.organizationId == null);
51618
51882
  if (userCiphers.length === 0) {
51619
51883
  return encryptedCiphers;
@@ -51892,6 +52156,7 @@ class CipherService {
51892
52156
  clearDecryptedCiphersState(userId) {
51893
52157
  return __awaiter(this, void 0, void 0, function* () {
51894
52158
  yield this.setDecryptedCiphers(null, userId);
52159
+ yield this.setFailedDecryptedCiphers(null, userId);
51895
52160
  this.clearSortedCiphers();
51896
52161
  });
51897
52162
  }
@@ -52114,7 +52379,7 @@ class FolderApiService {
52114
52379
  this.folderService = folderService;
52115
52380
  this.apiService = apiService;
52116
52381
  }
52117
- save(folder) {
52382
+ save(folder, userId) {
52118
52383
  return __awaiter(this, void 0, void 0, function* () {
52119
52384
  const request = new _vault_models_request_folder_request__WEBPACK_IMPORTED_MODULE_1__/* .FolderRequest */ .O(folder);
52120
52385
  let response;
@@ -52126,19 +52391,19 @@ class FolderApiService {
52126
52391
  response = yield this.putFolder(folder.id, request);
52127
52392
  }
52128
52393
  const data = new _vault_models_data_folder_data__WEBPACK_IMPORTED_MODULE_2__/* .FolderData */ .p(response);
52129
- yield this.folderService.upsert(data);
52394
+ yield this.folderService.upsert(data, userId);
52130
52395
  });
52131
52396
  }
52132
- delete(id) {
52397
+ delete(id, userId) {
52133
52398
  return __awaiter(this, void 0, void 0, function* () {
52134
52399
  yield this.deleteFolder(id);
52135
- yield this.folderService.delete(id);
52400
+ yield this.folderService.delete(id, userId);
52136
52401
  });
52137
52402
  }
52138
- deleteAll() {
52403
+ deleteAll(userId) {
52139
52404
  return __awaiter(this, void 0, void 0, function* () {
52140
52405
  yield this.apiService.send("DELETE", "/folders/all", null, true, false);
52141
- yield this.folderService.clear();
52406
+ yield this.folderService.clear(userId);
52142
52407
  });
52143
52408
  }
52144
52409
  get(id) {
@@ -52191,16 +52456,6 @@ var folder_with_id_request = __webpack_require__(973);
52191
52456
  // EXTERNAL MODULE: ../../libs/common/src/platform/state/index.ts + 3 modules
52192
52457
  var state = __webpack_require__(1068);
52193
52458
  ;// ../../libs/common/src/vault/services/key-state/folder.state.ts
52194
- var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
52195
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
52196
- return new (P || (P = Promise))(function (resolve, reject) {
52197
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
52198
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
52199
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
52200
- step((generator = generator.apply(thisArg, _arguments || [])).next());
52201
- });
52202
- };
52203
-
52204
52459
 
52205
52460
 
52206
52461
 
@@ -52208,21 +52463,13 @@ const FOLDER_ENCRYPTED_FOLDERS = state/* UserKeyDefinition */.Ok.record(state/*
52208
52463
  deserializer: (obj) => folder_data/* FolderData */.p.fromJSON(obj),
52209
52464
  clearOn: ["logout"],
52210
52465
  });
52211
- const FOLDER_DECRYPTED_FOLDERS = state/* DeriveDefinition */.JV.from(FOLDER_ENCRYPTED_FOLDERS, {
52212
- deserializer: (obj) => obj.map((f) => folder_view/* FolderView */.u.fromJSON(f)),
52213
- derive: (from_1, _a) => __awaiter(void 0, [from_1, _a], void 0, function* (from, { folderService, keyService }) {
52214
- const folders = Object.values(from || {}).map((f) => new domain_folder/* Folder */.v(f));
52215
- if (yield keyService.hasUserKey()) {
52216
- return yield folderService.decryptFolders(folders);
52217
- }
52218
- else {
52219
- return [];
52220
- }
52221
- }),
52466
+ const FOLDER_DECRYPTED_FOLDERS = new state/* UserKeyDefinition */.Ok(state/* FOLDER_MEMORY */.jx, "decryptedFolders", {
52467
+ deserializer: (obj) => { var _a; return (_a = obj === null || obj === void 0 ? void 0 : obj.map((f) => folder_view/* FolderView */.u.fromJSON(f))) !== null && _a !== void 0 ? _a : []; },
52468
+ clearOn: ["logout", "lock"],
52222
52469
  });
52223
52470
 
52224
52471
  ;// ../../libs/common/src/vault/services/folder/folder.service.ts
52225
- var folder_service_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
52472
+ var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
52226
52473
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
52227
52474
  return new (P || (P = Promise))(function (resolve, reject) {
52228
52475
  function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
@@ -52247,46 +52494,73 @@ class FolderService {
52247
52494
  this.i18nService = i18nService;
52248
52495
  this.cipherService = cipherService;
52249
52496
  this.stateProvider = stateProvider;
52250
- this.encryptedFoldersState = this.stateProvider.getActive(FOLDER_ENCRYPTED_FOLDERS);
52251
- this.decryptedFoldersState = this.stateProvider.getDerived(this.encryptedFoldersState.state$, FOLDER_DECRYPTED_FOLDERS, { folderService: this, keyService: this.keyService });
52252
- this.folders$ = this.encryptedFoldersState.state$.pipe((0,external_rxjs_.map)((folderData) => Object.values(folderData).map((f) => new domain_folder/* Folder */.v(f))));
52253
- this.folderViews$ = this.decryptedFoldersState.state$;
52497
+ /**
52498
+ * Ensures we reuse the same observable stream for each userId rather than
52499
+ * creating a new one on each folderViews$ call.
52500
+ */
52501
+ this.folderViewCache = new Map();
52502
+ /**
52503
+ * Used to force the folderviews$ Observable to re-emit with a provided value.
52504
+ * Required because shareReplay with refCount: false maintains last emission.
52505
+ * Used during cleanup to force emit empty arrays, ensuring stale data isn't retained.
52506
+ */
52507
+ this.forceFolderViews = {};
52254
52508
  }
52255
- clearCache() {
52256
- return folder_service_awaiter(this, void 0, void 0, function* () {
52257
- yield this.decryptedFoldersState.forceValue([]);
52258
- });
52509
+ folders$(userId) {
52510
+ return this.encryptedFoldersState(userId).state$.pipe((0,external_rxjs_.map)((folders) => {
52511
+ if (folders == null) {
52512
+ return [];
52513
+ }
52514
+ return Object.values(folders).map((f) => new domain_folder/* Folder */.v(f));
52515
+ }));
52516
+ }
52517
+ /**
52518
+ * Returns an Observable of decrypted folder views for the given userId.
52519
+ * Uses folderViewCache to maintain a single Observable instance per user,
52520
+ * combining normal folder state updates with forced updates.
52521
+ */
52522
+ folderViews$(userId) {
52523
+ if (!this.folderViewCache.has(userId)) {
52524
+ if (!this.forceFolderViews[userId]) {
52525
+ this.forceFolderViews[userId] = new external_rxjs_.Subject();
52526
+ }
52527
+ const observable = (0,external_rxjs_.merge)(this.forceFolderViews[userId], this.encryptedFoldersState(userId).state$.pipe((0,external_rxjs_.switchMap)((folderData) => {
52528
+ return this.decryptFolders(userId, folderData);
52529
+ }))).pipe((0,external_rxjs_.shareReplay)({ refCount: false, bufferSize: 1 }));
52530
+ this.folderViewCache.set(userId, observable);
52531
+ }
52532
+ return this.folderViewCache.get(userId);
52259
52533
  }
52260
52534
  // TODO: This should be moved to EncryptService or something
52261
52535
  encrypt(model, key) {
52262
- return folder_service_awaiter(this, void 0, void 0, function* () {
52536
+ return __awaiter(this, void 0, void 0, function* () {
52263
52537
  const folder = new domain_folder/* Folder */.v();
52264
52538
  folder.id = model.id;
52265
52539
  folder.name = yield this.encryptService.encrypt(model.name, key);
52266
52540
  return folder;
52267
52541
  });
52268
52542
  }
52269
- get(id) {
52270
- return folder_service_awaiter(this, void 0, void 0, function* () {
52271
- const folders = yield (0,external_rxjs_.firstValueFrom)(this.folders$);
52543
+ get(id, userId) {
52544
+ return __awaiter(this, void 0, void 0, function* () {
52545
+ const folders = yield (0,external_rxjs_.firstValueFrom)(this.folders$(userId));
52272
52546
  return folders.find((folder) => folder.id === id);
52273
52547
  });
52274
52548
  }
52275
- getDecrypted$(id) {
52276
- return this.folderViews$.pipe((0,external_rxjs_.map)((folders) => folders.find((folder) => folder.id === id)), (0,external_rxjs_.shareReplay)({ refCount: true, bufferSize: 1 }));
52549
+ getDecrypted$(id, userId) {
52550
+ return this.folderViews$(userId).pipe((0,external_rxjs_.map)((folders) => folders.find((folder) => folder.id === id)), (0,external_rxjs_.shareReplay)({ refCount: true, bufferSize: 1 }));
52277
52551
  }
52278
- getAllFromState() {
52279
- return folder_service_awaiter(this, void 0, void 0, function* () {
52280
- return yield (0,external_rxjs_.firstValueFrom)(this.folders$);
52552
+ getAllFromState(userId) {
52553
+ return __awaiter(this, void 0, void 0, function* () {
52554
+ return yield (0,external_rxjs_.firstValueFrom)(this.folders$(userId));
52281
52555
  });
52282
52556
  }
52283
52557
  /**
52284
52558
  * @deprecated For the CLI only
52285
52559
  * @param id id of the folder
52286
52560
  */
52287
- getFromState(id) {
52288
- return folder_service_awaiter(this, void 0, void 0, function* () {
52289
- const folder = yield this.get(id);
52561
+ getFromState(id, userId) {
52562
+ return __awaiter(this, void 0, void 0, function* () {
52563
+ const folder = yield this.get(id, userId);
52290
52564
  if (!folder) {
52291
52565
  return null;
52292
52566
  }
@@ -52296,14 +52570,15 @@ class FolderService {
52296
52570
  /**
52297
52571
  * @deprecated Only use in CLI!
52298
52572
  */
52299
- getAllDecryptedFromState() {
52300
- return folder_service_awaiter(this, void 0, void 0, function* () {
52301
- return yield (0,external_rxjs_.firstValueFrom)(this.folderViews$);
52573
+ getAllDecryptedFromState(userId) {
52574
+ return __awaiter(this, void 0, void 0, function* () {
52575
+ return yield (0,external_rxjs_.firstValueFrom)(this.folderViews$(userId));
52302
52576
  });
52303
52577
  }
52304
- upsert(folderData) {
52305
- return folder_service_awaiter(this, void 0, void 0, function* () {
52306
- yield this.encryptedFoldersState.update((folders) => {
52578
+ upsert(folderData, userId) {
52579
+ return __awaiter(this, void 0, void 0, function* () {
52580
+ yield this.clearDecryptedFolderState(userId);
52581
+ yield this.encryptedFoldersState(userId).update((folders) => {
52307
52582
  if (folders == null) {
52308
52583
  folders = {};
52309
52584
  }
@@ -52321,30 +52596,37 @@ class FolderService {
52321
52596
  });
52322
52597
  }
52323
52598
  replace(folders, userId) {
52324
- return folder_service_awaiter(this, void 0, void 0, function* () {
52599
+ return __awaiter(this, void 0, void 0, function* () {
52325
52600
  if (!folders) {
52326
52601
  return;
52327
52602
  }
52603
+ yield this.clearDecryptedFolderState(userId);
52328
52604
  yield this.stateProvider.getUser(userId, FOLDER_ENCRYPTED_FOLDERS).update(() => {
52329
52605
  const newFolders = Object.assign({}, folders);
52330
52606
  return newFolders;
52331
52607
  });
52332
52608
  });
52333
52609
  }
52334
- clear(userId) {
52335
- return folder_service_awaiter(this, void 0, void 0, function* () {
52610
+ clearDecryptedFolderState(userId) {
52611
+ return __awaiter(this, void 0, void 0, function* () {
52336
52612
  if (userId == null) {
52337
- yield this.encryptedFoldersState.update(() => ({}));
52338
- yield this.decryptedFoldersState.forceValue([]);
52339
- }
52340
- else {
52341
- yield this.stateProvider.getUser(userId, FOLDER_ENCRYPTED_FOLDERS).update(() => ({}));
52613
+ throw new Error("User ID is required.");
52342
52614
  }
52615
+ yield this.setDecryptedFolders([], userId);
52343
52616
  });
52344
52617
  }
52345
- delete(id) {
52346
- return folder_service_awaiter(this, void 0, void 0, function* () {
52347
- yield this.encryptedFoldersState.update((folders) => {
52618
+ clear(userId) {
52619
+ return __awaiter(this, void 0, void 0, function* () {
52620
+ var _a;
52621
+ (_a = this.forceFolderViews[userId]) === null || _a === void 0 ? void 0 : _a.next([]);
52622
+ yield this.encryptedFoldersState(userId).update(() => ({}));
52623
+ yield this.clearDecryptedFolderState(userId);
52624
+ });
52625
+ }
52626
+ delete(id, userId) {
52627
+ return __awaiter(this, void 0, void 0, function* () {
52628
+ yield this.clearDecryptedFolderState(userId);
52629
+ yield this.encryptedFoldersState(userId).update((folders) => {
52348
52630
  if (folders == null) {
52349
52631
  return;
52350
52632
  }
@@ -52367,41 +52649,76 @@ class FolderService {
52367
52649
  }
52368
52650
  }
52369
52651
  if (updates.length > 0) {
52370
- // FIXME: Verify that this floating promise is intentional. If it is, add an explanatory comment and ensure there is proper error handling.
52371
- // eslint-disable-next-line @typescript-eslint/no-floating-promises
52372
- this.cipherService.upsert(updates.map((c) => c.toCipherData()));
52652
+ yield this.cipherService.upsert(updates.map((c) => c.toCipherData()));
52373
52653
  }
52374
52654
  }
52375
52655
  });
52376
52656
  }
52377
- decryptFolders(folders) {
52378
- return folder_service_awaiter(this, void 0, void 0, function* () {
52379
- const decryptFolderPromises = folders.map((f) => f.decrypt());
52380
- const decryptedFolders = yield Promise.all(decryptFolderPromises);
52381
- decryptedFolders.sort(utils/* Utils */.A.getSortFunction(this.i18nService, "name"));
52382
- const noneFolder = new folder_view/* FolderView */.u();
52383
- noneFolder.name = this.i18nService.t("noneFolder");
52384
- decryptedFolders.push(noneFolder);
52385
- return decryptedFolders;
52386
- });
52387
- }
52388
52657
  getRotatedData(originalUserKey, newUserKey, userId) {
52389
- return folder_service_awaiter(this, void 0, void 0, function* () {
52658
+ return __awaiter(this, void 0, void 0, function* () {
52390
52659
  if (newUserKey == null) {
52391
52660
  throw new Error("New user key is required for rotation.");
52392
52661
  }
52393
52662
  let encryptedFolders = [];
52394
- const folders = yield (0,external_rxjs_.firstValueFrom)(this.folderViews$);
52663
+ const folders = yield (0,external_rxjs_.firstValueFrom)(this.folderViews$(userId));
52395
52664
  if (!folders) {
52396
52665
  return encryptedFolders;
52397
52666
  }
52398
- encryptedFolders = yield Promise.all(folders.map((folder) => folder_service_awaiter(this, void 0, void 0, function* () {
52667
+ encryptedFolders = yield Promise.all(folders.map((folder) => __awaiter(this, void 0, void 0, function* () {
52399
52668
  const encryptedFolder = yield this.encrypt(folder, newUserKey);
52400
52669
  return new folder_with_id_request/* FolderWithIdRequest */.T(encryptedFolder);
52401
52670
  })));
52402
52671
  return encryptedFolders;
52403
52672
  });
52404
52673
  }
52674
+ /**
52675
+ * Decrypts the folders for a user.
52676
+ * @param userId the user id
52677
+ * @param folderData encrypted folders
52678
+ * @returns a list of decrypted folders
52679
+ */
52680
+ decryptFolders(userId, folderData) {
52681
+ return __awaiter(this, void 0, void 0, function* () {
52682
+ // Check if the decrypted folders are already cached
52683
+ const decrypted = yield (0,external_rxjs_.firstValueFrom)(this.stateProvider.getUser(userId, FOLDER_DECRYPTED_FOLDERS).state$);
52684
+ if (decrypted === null || decrypted === void 0 ? void 0 : decrypted.length) {
52685
+ return decrypted;
52686
+ }
52687
+ if (folderData == null) {
52688
+ return [];
52689
+ }
52690
+ const folders = Object.values(folderData).map((f) => new domain_folder/* Folder */.v(f));
52691
+ const userKey = yield (0,external_rxjs_.firstValueFrom)(this.keyService.userKey$(userId));
52692
+ if (!userKey) {
52693
+ return [];
52694
+ }
52695
+ const decryptFolderPromises = folders.map((f) => f.decryptWithKey(userKey, this.encryptService));
52696
+ const decryptedFolders = yield Promise.all(decryptFolderPromises);
52697
+ decryptedFolders.sort(utils/* Utils */.A.getSortFunction(this.i18nService, "name"));
52698
+ const noneFolder = new folder_view/* FolderView */.u();
52699
+ noneFolder.name = this.i18nService.t("noneFolder");
52700
+ decryptedFolders.push(noneFolder);
52701
+ // Cache the decrypted folders
52702
+ yield this.setDecryptedFolders(decryptedFolders, userId);
52703
+ return decryptedFolders;
52704
+ });
52705
+ }
52706
+ /**
52707
+ * @returns a SingleUserState for the encrypted folders.
52708
+ */
52709
+ encryptedFoldersState(userId) {
52710
+ return this.stateProvider.getUser(userId, FOLDER_ENCRYPTED_FOLDERS);
52711
+ }
52712
+ /**
52713
+ * Sets the decrypted folders state for a user.
52714
+ * @param folders the decrypted folders
52715
+ * @param userId the user id
52716
+ */
52717
+ setDecryptedFolders(folders, userId) {
52718
+ return __awaiter(this, void 0, void 0, function* () {
52719
+ yield this.stateProvider.setUserState(FOLDER_DECRYPTED_FOLDERS, folders, userId);
52720
+ });
52721
+ }
52405
52722
  }
52406
52723
 
52407
52724
 
@@ -53595,8 +53912,8 @@ class BitwardenJsonImporter extends base_importer_BaseImporter {
53595
53912
  }
53596
53913
  }
53597
53914
 
53598
- // EXTERNAL MODULE: ../../libs/key-management/src/index.ts + 17 modules
53599
- var src = __webpack_require__(8614);
53915
+ // EXTERNAL MODULE: ../../libs/key-management/src/index.ts + 20 modules
53916
+ var src = __webpack_require__(5907);
53600
53917
  ;// ../../libs/importer/src/importers/bitwarden/bitwarden-password-protected-importer.ts
53601
53918
  var bitwarden_password_protected_importer_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
53602
53919
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
@@ -59442,13 +59759,15 @@ class ImportService {
59442
59759
 
59443
59760
  /***/ }),
59444
59761
 
59445
- /***/ 8614:
59762
+ /***/ 5907:
59446
59763
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
59447
59764
 
59448
59765
 
59449
59766
  // EXPORTS
59450
59767
  __webpack_require__.d(__webpack_exports__, {
59451
59768
  hU: () => (/* reexport */ Argon2KdfConfig),
59769
+ Zm: () => (/* reexport */ BiometricsService),
59770
+ cR: () => (/* reexport */ BiometricsStatus),
59452
59771
  QH: () => (/* reexport */ DefaultBiometricStateService),
59453
59772
  aT: () => (/* reexport */ DefaultKdfConfigService),
59454
59773
  gX: () => (/* reexport */ DefaultKeyService),
@@ -59456,7 +59775,7 @@ __webpack_require__.d(__webpack_exports__, {
59456
59775
  n1: () => (/* reexport */ PBKDF2KdfConfig)
59457
59776
  });
59458
59777
 
59459
- // UNUSED EXPORTS: BIOMETRIC_UNLOCK_ENABLED, BiometricStateService, BiometricsService, DEFAULT_KDF_CONFIG, DISMISSED_REQUIRE_PASSWORD_ON_START_CALLOUT, DefaultUserAsymmetricKeysRegenerationApiService, DefaultUserAsymmetricKeysRegenerationService, ENCRYPTED_CLIENT_KEY_HALF, FINGERPRINT_VALIDATED, KdfConfigService, KeyService, PROMPT_AUTOMATICALLY, PROMPT_CANCELLED, REQUIRE_PASSWORD_ON_START, UserAsymmetricKeysRegenerationApiService, UserAsymmetricKeysRegenerationService
59778
+ // UNUSED EXPORTS: BIOMETRIC_UNLOCK_ENABLED, BiometricStateService, BiometricsCommands, DEFAULT_KDF_CONFIG, DISMISSED_REQUIRE_PASSWORD_ON_START_CALLOUT, DefaultUserAsymmetricKeysRegenerationApiService, DefaultUserAsymmetricKeysRegenerationService, ENCRYPTED_CLIENT_KEY_HALF, FINGERPRINT_VALIDATED, KdfConfigService, KeyService, LAST_PROCESS_RELOAD, PROMPT_AUTOMATICALLY, PROMPT_CANCELLED, REQUIRE_PASSWORD_ON_START, UserAsymmetricKeysRegenerationApiService, UserAsymmetricKeysRegenerationService
59460
59779
 
59461
59780
  // EXTERNAL MODULE: external "rxjs"
59462
59781
  var external_rxjs_ = __webpack_require__(573);
@@ -59465,6 +59784,8 @@ var enc_string = __webpack_require__(6505);
59465
59784
  // EXTERNAL MODULE: ../../libs/common/src/platform/state/index.ts + 3 modules
59466
59785
  var state = __webpack_require__(1068);
59467
59786
  ;// ../../libs/key-management/src/biometrics/biometric.state.ts
59787
+ // FIXME: remove `src` and fix import
59788
+ // eslint-disable-next-line no-restricted-imports
59468
59789
 
59469
59790
  /**
59470
59791
  * Indicates whether the user elected to store a biometric key to unlock their vault.
@@ -59521,6 +59842,12 @@ const PROMPT_AUTOMATICALLY = new state/* UserKeyDefinition */.Ok(state/* BIOMETR
59521
59842
  const FINGERPRINT_VALIDATED = new state/* KeyDefinition */.Zs(state/* BIOMETRIC_SETTINGS_DISK */.rB, "fingerprintValidated", {
59522
59843
  deserializer: (obj) => obj,
59523
59844
  });
59845
+ /**
59846
+ * Last process reload time
59847
+ */
59848
+ const LAST_PROCESS_RELOAD = new state/* KeyDefinition */.Zs(state/* BIOMETRIC_SETTINGS_DISK */.rB, "lastProcessReload", {
59849
+ deserializer: (obj) => new Date(obj),
59850
+ });
59524
59851
 
59525
59852
  ;// ../../libs/key-management/src/biometrics/biometric-state.service.ts
59526
59853
  var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
@@ -59535,6 +59862,8 @@ var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _argume
59535
59862
  // FIXME: Update this file to be type safe and remove this and next line
59536
59863
  // @ts-strict-ignore
59537
59864
 
59865
+ // FIXME: remove `src` and fix import
59866
+ // eslint-disable-next-line no-restricted-imports
59538
59867
 
59539
59868
 
59540
59869
  class BiometricStateService {
@@ -59563,6 +59892,8 @@ class DefaultBiometricStateService {
59563
59892
  this.promptAutomatically$ = this.promptAutomaticallyState.state$.pipe((0,external_rxjs_.map)(Boolean));
59564
59893
  this.fingerprintValidatedState = this.stateProvider.getGlobal(FINGERPRINT_VALIDATED);
59565
59894
  this.fingerprintValidated$ = this.fingerprintValidatedState.state$.pipe((0,external_rxjs_.map)(Boolean));
59895
+ this.lastProcessReloadState = this.stateProvider.getGlobal(LAST_PROCESS_RELOAD);
59896
+ this.lastProcessReload$ = this.lastProcessReloadState.state$;
59566
59897
  }
59567
59898
  setBiometricUnlockEnabled(enabled) {
59568
59899
  return __awaiter(this, void 0, void 0, function* () {
@@ -59673,11 +60004,72 @@ class DefaultBiometricStateService {
59673
60004
  yield this.fingerprintValidatedState.update(() => validated);
59674
60005
  });
59675
60006
  }
60007
+ updateLastProcessReload() {
60008
+ return __awaiter(this, void 0, void 0, function* () {
60009
+ yield this.lastProcessReloadState.update(() => new Date());
60010
+ });
60011
+ }
60012
+ getLastProcessReload() {
60013
+ return __awaiter(this, void 0, void 0, function* () {
60014
+ return yield (0,external_rxjs_.firstValueFrom)(this.lastProcessReload$);
60015
+ });
60016
+ }
59676
60017
  }
59677
60018
  function encryptedClientKeyHalfToEncString(encryptedKeyHalf) {
59678
60019
  return encryptedKeyHalf == null ? null : new enc_string/* EncString */.k(encryptedKeyHalf);
59679
60020
  }
59680
60021
 
60022
+ ;// ../../libs/key-management/src/biometrics/biometrics-status.ts
60023
+ var BiometricsStatus;
60024
+ (function (BiometricsStatus) {
60025
+ /** For the biometrics interface, this means that biometric unlock is available and can be used. Querying for the user specifically, this means that biometric can be used for to unlock this user */
60026
+ BiometricsStatus[BiometricsStatus["Available"] = 0] = "Available";
60027
+ /** Biometrics cannot be used, because the userkey needs to first be unlocked by the user's password, because unlock needs some volatile data that is not available on app-start */
60028
+ BiometricsStatus[BiometricsStatus["UnlockNeeded"] = 1] = "UnlockNeeded";
60029
+ /** Biometric hardware is not available (i.e laptop folded shut, sensor unplugged) */
60030
+ BiometricsStatus[BiometricsStatus["HardwareUnavailable"] = 2] = "HardwareUnavailable";
60031
+ /** Only relevant for linux, this means that polkit policies need to be set up and that can happen automatically */
60032
+ BiometricsStatus[BiometricsStatus["AutoSetupNeeded"] = 3] = "AutoSetupNeeded";
60033
+ /** Only relevant for linux, this means that polkit policies need to be set up but that needs to be done manually */
60034
+ BiometricsStatus[BiometricsStatus["ManualSetupNeeded"] = 4] = "ManualSetupNeeded";
60035
+ /** Biometrics is not implemented for this platform (i.e web) */
60036
+ BiometricsStatus[BiometricsStatus["PlatformUnsupported"] = 5] = "PlatformUnsupported";
60037
+ /** Browser extension cannot connect to the desktop app to use biometrics */
60038
+ BiometricsStatus[BiometricsStatus["DesktopDisconnected"] = 6] = "DesktopDisconnected";
60039
+ /** Biometrics is not enabled in the desktop app/extension (current app) */
60040
+ BiometricsStatus[BiometricsStatus["NotEnabledLocally"] = 7] = "NotEnabledLocally";
60041
+ /** Only on browser extension; Biometrics is not enabled in the desktop app */
60042
+ BiometricsStatus[BiometricsStatus["NotEnabledInConnectedDesktopApp"] = 8] = "NotEnabledInConnectedDesktopApp";
60043
+ /** Browser extension does not have the permission to talk to the desktop app */
60044
+ BiometricsStatus[BiometricsStatus["NativeMessagingPermissionMissing"] = 9] = "NativeMessagingPermissionMissing";
60045
+ })(BiometricsStatus || (BiometricsStatus = {}));
60046
+
60047
+ ;// ../../libs/key-management/src/biometrics/biometrics-commands.ts
60048
+ var BiometricsCommands;
60049
+ (function (BiometricsCommands) {
60050
+ /** Perform biometric authentication for the system's user. Does not require setup, and does not return cryptographic material, only yes or no. */
60051
+ BiometricsCommands["AuthenticateWithBiometrics"] = "authenticateWithBiometrics";
60052
+ /** Get biometric status of the system, and can be used before biometrics is set up. Only returns data about the biometrics system, not about availability of cryptographic material */
60053
+ BiometricsCommands["GetBiometricsStatus"] = "getBiometricsStatus";
60054
+ /** Perform biometric authentication for the system's user for the given bitwarden account's credentials. This returns cryptographic material that can be used to unlock the vault. */
60055
+ BiometricsCommands["UnlockWithBiometricsForUser"] = "unlockWithBiometricsForUser";
60056
+ /** Get biometric status for a specific user account. This includes both information about availability of cryptographic material (is the user configured for biometric unlock? is a masterpassword unlock needed? But also information about the biometric system's availability in a single status) */
60057
+ BiometricsCommands["GetBiometricsStatusForUser"] = "getBiometricsStatusForUser";
60058
+ // legacy
60059
+ BiometricsCommands["Unlock"] = "biometricUnlock";
60060
+ BiometricsCommands["IsAvailable"] = "biometricUnlockAvailable";
60061
+ })(BiometricsCommands || (BiometricsCommands = {}));
60062
+
60063
+ ;// ../../libs/key-management/src/biometrics/biometric.service.ts
60064
+ /**
60065
+ * The biometrics service is used to provide access to the status of and access to biometric functionality on the platforms.
60066
+ */
60067
+ class BiometricsService {
60068
+ supportsBiometric() {
60069
+ throw new Error("Method not implemented.");
60070
+ }
60071
+ }
60072
+
59681
60073
  ;// ../../libs/key-management/src/abstractions/key.service.ts
59682
60074
  class UserPrivateKeyDecryptionFailedError extends Error {
59683
60075
  constructor() {
@@ -59761,8 +60153,8 @@ class ProviderEncryptedOrganizationKey {
59761
60153
  }
59762
60154
  }
59763
60155
 
59764
- // EXTERNAL MODULE: ../../libs/common/src/platform/enums/index.ts + 6 modules
59765
- var enums = __webpack_require__(6425);
60156
+ // EXTERNAL MODULE: ../../libs/common/src/platform/enums/index.ts + 7 modules
60157
+ var enums = __webpack_require__(5874);
59766
60158
  ;// ../../libs/common/src/platform/misc/convert-values.ts
59767
60159
  // FIXME: Update this file to be type safe and remove this and next line
59768
60160
  // @ts-strict-ignore
@@ -59837,17 +60229,41 @@ var key_service_awaiter = (undefined && undefined.__awaiter) || function (thisAr
59837
60229
  // @ts-strict-ignore
59838
60230
 
59839
60231
 
60232
+ // FIXME: remove `src` and fix import
60233
+ // eslint-disable-next-line no-restricted-imports
59840
60234
 
60235
+ // FIXME: remove `src` and fix import
60236
+ // eslint-disable-next-line no-restricted-imports
59841
60237
 
60238
+ // FIXME: remove `src` and fix import
60239
+ // eslint-disable-next-line no-restricted-imports
59842
60240
 
60241
+ // FIXME: remove `src` and fix import
60242
+ // eslint-disable-next-line no-restricted-imports
59843
60243
 
60244
+ // FIXME: remove `src` and fix import
60245
+ // eslint-disable-next-line no-restricted-imports
59844
60246
 
60247
+ // FIXME: remove `src` and fix import
60248
+ // eslint-disable-next-line no-restricted-imports
59845
60249
 
60250
+ // FIXME: remove `src` and fix import
60251
+ // eslint-disable-next-line no-restricted-imports
59846
60252
 
60253
+ // FIXME: remove `src` and fix import
60254
+ // eslint-disable-next-line no-restricted-imports
59847
60255
 
60256
+ // FIXME: remove `src` and fix import
60257
+ // eslint-disable-next-line no-restricted-imports
59848
60258
 
60259
+ // FIXME: remove `src` and fix import
60260
+ // eslint-disable-next-line no-restricted-imports
59849
60261
 
60262
+ // FIXME: remove `src` and fix import
60263
+ // eslint-disable-next-line no-restricted-imports
59850
60264
 
60265
+ // FIXME: remove `src` and fix import
60266
+ // eslint-disable-next-line no-restricted-imports
59851
60267
 
59852
60268
 
59853
60269
  class DefaultKeyService {
@@ -60556,7 +60972,7 @@ class DefaultKeyService {
60556
60972
  if (encryptedPrivateKey == null) {
60557
60973
  return null;
60558
60974
  }
60559
- return (yield this.encryptService.decryptToBytes(new enc_string/* EncString */.k(encryptedPrivateKey), key));
60975
+ return (yield this.encryptService.decryptToBytes(new enc_string/* EncString */.k(encryptedPrivateKey), key, "Content: Encrypted Private Key"));
60560
60976
  });
60561
60977
  }
60562
60978
  providerKeys$(userId) {
@@ -60665,6 +61081,8 @@ var KdfType;
60665
61081
  })(KdfType || (KdfType = {}));
60666
61082
 
60667
61083
  ;// ../../libs/key-management/src/models/kdf-config.ts
61084
+ // FIXME: remove `src` and fix import
61085
+ // eslint-disable-next-line no-restricted-imports
60668
61086
 
60669
61087
 
60670
61088
  /**
@@ -60763,6 +61181,8 @@ var kdf_config_service_awaiter = (undefined && undefined.__awaiter) || function
60763
61181
  // FIXME: Update this file to be type safe and remove this and next line
60764
61182
  // @ts-strict-ignore
60765
61183
 
61184
+ // FIXME: remove `src` and fix import
61185
+ // eslint-disable-next-line no-restricted-imports
60766
61186
 
60767
61187
 
60768
61188
 
@@ -60852,11 +61272,21 @@ class DefaultUserAsymmetricKeysRegenerationService {
60852
61272
  }
60853
61273
  shouldRegenerate(userId) {
60854
61274
  return default_user_asymmetric_key_regeneration_service_awaiter(this, void 0, void 0, function* () {
60855
- const [userKey, userKeyEncryptedPrivateKey, publicKeyResponse] = yield firstValueFrom(combineLatest([
60856
- this.keyService.userKey$(userId),
61275
+ const userKey = yield firstValueFrom(this.keyService.userKey$(userId));
61276
+ // For SSO logins from untrusted devices, the userKey will not be available, and the private key regeneration process should be skipped.
61277
+ // In such cases, regeneration will occur on the following device login flow.
61278
+ if (!userKey) {
61279
+ this.logService.info("[UserAsymmetricKeyRegeneration] User symmetric key unavailable, skipping regeneration for the user.");
61280
+ return false;
61281
+ }
61282
+ const [userKeyEncryptedPrivateKey, publicKeyResponse] = yield firstValueFrom(combineLatest([
60857
61283
  this.keyService.userEncryptedPrivateKey$(userId),
60858
61284
  this.apiService.getUserPublicKey(userId),
60859
61285
  ]));
61286
+ if (!userKeyEncryptedPrivateKey || !publicKeyResponse) {
61287
+ this.logService.warning("[UserAsymmetricKeyRegeneration] User's asymmetric key initialization data is unavailable, skipping regeneration.");
61288
+ return false;
61289
+ }
60860
61290
  const verificationResponse = yield firstValueFrom(this.sdkService.client$.pipe(map((sdk) => {
60861
61291
  if (sdk === undefined) {
60862
61292
  throw new Error("SDK is undefined");
@@ -60977,6 +61407,8 @@ class DefaultUserAsymmetricKeysRegenerationApiService {
60977
61407
 
60978
61408
 
60979
61409
 
61410
+
61411
+
60980
61412
  /***/ }),
60981
61413
 
60982
61414
  /***/ 3582:
@@ -61033,7 +61465,7 @@ class NodeUtils {
61033
61465
 
61034
61466
  /***/ }),
61035
61467
 
61036
- /***/ 5696:
61468
+ /***/ 8248:
61037
61469
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
61038
61470
 
61039
61471
 
@@ -61048,12 +61480,6 @@ const external_crypto_namespaceObject = require("crypto");
61048
61480
  const external_node_forge_namespaceObject = require("node-forge");
61049
61481
  // EXTERNAL MODULE: ../../libs/common/src/platform/misc/utils.ts + 2 modules
61050
61482
  var utils = __webpack_require__(6948);
61051
- ;// ../../libs/common/src/platform/models/domain/decrypt-parameters.ts
61052
- // FIXME: Update this file to be type safe and remove this and next line
61053
- // @ts-strict-ignore
61054
- class DecryptParameters {
61055
- }
61056
-
61057
61483
  ;// ../../libs/node/src/services/node-crypto-function.service.ts
61058
61484
  var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
61059
61485
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
@@ -61064,9 +61490,6 @@ var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _argume
61064
61490
  step((generator = generator.apply(thisArg, _arguments || [])).next());
61065
61491
  });
61066
61492
  };
61067
- // FIXME: Update this file to be type safe and remove this and next line
61068
- // @ts-strict-ignore
61069
-
61070
61493
 
61071
61494
 
61072
61495
 
@@ -61189,7 +61612,7 @@ class NodeCryptoFunctionService {
61189
61612
  return Promise.resolve(this.toUint8Buffer(encBuf));
61190
61613
  }
61191
61614
  aesDecryptFastParameters(data, iv, mac, key) {
61192
- const p = new DecryptParameters();
61615
+ const p = {};
61193
61616
  p.encKey = key.encKey;
61194
61617
  p.data = utils/* Utils */.A.fromB64ToArray(data);
61195
61618
  p.iv = utils/* Utils */.A.fromB64ToArray(iv);
@@ -61205,15 +61628,16 @@ class NodeCryptoFunctionService {
61205
61628
  }
61206
61629
  return p;
61207
61630
  }
61208
- aesDecryptFast(parameters, mode) {
61209
- return __awaiter(this, void 0, void 0, function* () {
61210
- const decBuf = yield this.aesDecrypt(parameters.data, parameters.iv, parameters.encKey, mode);
61631
+ aesDecryptFast(_a) {
61632
+ return __awaiter(this, arguments, void 0, function* ({ mode, parameters, }) {
61633
+ const iv = mode === "cbc" ? parameters.iv : null;
61634
+ const decBuf = yield this.aesDecrypt(parameters.data, iv, parameters.encKey, mode);
61211
61635
  return utils/* Utils */.A.fromBufferToUtf8(decBuf);
61212
61636
  });
61213
61637
  }
61214
61638
  aesDecrypt(data, iv, key, mode) {
61215
61639
  const nodeData = this.toNodeBuffer(data);
61216
- const nodeIv = mode === "ecb" ? null : this.toNodeBuffer(iv);
61640
+ const nodeIv = this.toNodeBufferOrNull(iv);
61217
61641
  const nodeKey = this.toNodeBuffer(key);
61218
61642
  const decipher = external_crypto_namespaceObject.createDecipheriv(this.toNodeCryptoAesMode(mode), nodeKey, nodeIv);
61219
61643
  const decBuf = Buffer.concat([decipher.update(nodeData), decipher.final()]);
@@ -61297,6 +61721,12 @@ class NodeCryptoFunctionService {
61297
61721
  toNodeBuffer(value) {
61298
61722
  return Buffer.from(value);
61299
61723
  }
61724
+ toNodeBufferOrNull(value) {
61725
+ if (value == null) {
61726
+ return null;
61727
+ }
61728
+ return this.toNodeBuffer(value);
61729
+ }
61300
61730
  toUint8Buffer(value) {
61301
61731
  let buf;
61302
61732
  if (typeof value === "string") {
@@ -61437,8 +61867,8 @@ var enums = __webpack_require__(8713);
61437
61867
  var cipher_data = __webpack_require__(847);
61438
61868
  // EXTERNAL MODULE: ../../libs/common/src/vault/models/domain/cipher.ts
61439
61869
  var domain_cipher = __webpack_require__(3481);
61440
- // EXTERNAL MODULE: ../../libs/key-management/src/index.ts + 17 modules
61441
- var src = __webpack_require__(8614);
61870
+ // EXTERNAL MODULE: ../../libs/key-management/src/index.ts + 20 modules
61871
+ var src = __webpack_require__(5907);
61442
61872
  ;// ../../libs/tools/export/vault-export/vault-export-core/src/services/base-vault-export.service.ts
61443
61873
  var base_vault_export_service_awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
61444
61874
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
@@ -61779,6 +62209,7 @@ class IndividualVaultExportService extends BaseVaultExportService {
61779
62209
  this.cipherService = cipherService;
61780
62210
  this.keyService = keyService;
61781
62211
  this.accountService = accountService;
62212
+ this.activeUserId$ = this.accountService.activeAccount$.pipe((0,external_rxjs_.map)((a) => a === null || a === void 0 ? void 0 : a.id));
61782
62213
  }
61783
62214
  getExport() {
61784
62215
  return individual_vault_export_service_awaiter(this, arguments, void 0, function* (format = "csv") {
@@ -61799,7 +62230,8 @@ class IndividualVaultExportService extends BaseVaultExportService {
61799
62230
  let decFolders = [];
61800
62231
  let decCiphers = [];
61801
62232
  const promises = [];
61802
- promises.push(this.folderService.getAllDecryptedFromState().then((folders) => {
62233
+ const activeUserId = yield (0,external_rxjs_.firstValueFrom)(this.activeUserId$);
62234
+ promises.push((0,external_rxjs_.firstValueFrom)(this.folderService.folderViews$(activeUserId)).then((folders) => {
61803
62235
  decFolders = folders;
61804
62236
  }));
61805
62237
  promises.push(this.cipherService.getAllDecrypted().then((ciphers) => {
@@ -61817,15 +62249,15 @@ class IndividualVaultExportService extends BaseVaultExportService {
61817
62249
  let folders = [];
61818
62250
  let ciphers = [];
61819
62251
  const promises = [];
61820
- promises.push(this.folderService.getAllFromState().then((f) => {
62252
+ const activeUserId = yield (0,external_rxjs_.firstValueFrom)(this.activeUserId$);
62253
+ promises.push((0,external_rxjs_.firstValueFrom)(this.folderService.folders$(activeUserId)).then((f) => {
61821
62254
  folders = f;
61822
62255
  }));
61823
62256
  promises.push(this.cipherService.getAll().then((c) => {
61824
62257
  ciphers = c.filter((f) => f.deletedDate == null);
61825
62258
  }));
61826
62259
  yield Promise.all(promises);
61827
- const activeUserId = yield (0,external_rxjs_.firstValueFrom)(this.accountService.activeAccount$.pipe((0,external_rxjs_.map)((a) => a === null || a === void 0 ? void 0 : a.id)));
61828
- const userKey = yield this.keyService.getUserKeyWithLegacySupport(activeUserId);
62260
+ const userKey = yield this.keyService.getUserKeyWithLegacySupport(yield (0,external_rxjs_.firstValueFrom)(this.activeUserId$));
61829
62261
  const encKeyValidation = yield this.encryptService.encrypt(utils/* Utils */.A.newGuid(), userKey);
61830
62262
  const jsonDoc = {
61831
62263
  encrypted: true,
@@ -63592,6 +64024,7 @@ const PASSPHRASE = Object.freeze({
63592
64024
  generateKey: "generatePassphrase",
63593
64025
  generatedValueKey: "passphrase",
63594
64026
  copyKey: "copyPassphrase",
64027
+ useGeneratedValueKey: "useThisPassphrase",
63595
64028
  onlyOnRequest: false,
63596
64029
  request: [],
63597
64030
  engine: {
@@ -63646,6 +64079,7 @@ const PASSWORD = Object.freeze({
63646
64079
  generateKey: "generatePassword",
63647
64080
  generatedValueKey: "password",
63648
64081
  copyKey: "copyPassword",
64082
+ useGeneratedValueKey: "useThisPassword",
63649
64083
  onlyOnRequest: false,
63650
64084
  request: [],
63651
64085
  engine: {
@@ -63717,6 +64151,7 @@ const USERNAME = Object.freeze({
63717
64151
  generateKey: "generateUsername",
63718
64152
  generatedValueKey: "username",
63719
64153
  copyKey: "copyUsername",
64154
+ useGeneratedValueKey: "useThisUsername",
63720
64155
  onlyOnRequest: false,
63721
64156
  request: [],
63722
64157
  engine: {
@@ -63765,6 +64200,7 @@ const CATCHALL = Object.freeze({
63765
64200
  generateKey: "generateEmail",
63766
64201
  generatedValueKey: "email",
63767
64202
  copyKey: "copyEmail",
64203
+ useGeneratedValueKey: "useThisEmail",
63768
64204
  onlyOnRequest: false,
63769
64205
  request: [],
63770
64206
  engine: {
@@ -63816,6 +64252,7 @@ const SUBADDRESS = Object.freeze({
63816
64252
  generateKey: "generateEmail",
63817
64253
  generatedValueKey: "email",
63818
64254
  copyKey: "copyEmail",
64255
+ useGeneratedValueKey: "useThisEmail",
63819
64256
  onlyOnRequest: false,
63820
64257
  request: [],
63821
64258
  engine: {
@@ -63868,6 +64305,7 @@ function generators_toCredentialGeneratorConfiguration(configuration) {
63868
64305
  generateKey: "generateEmail",
63869
64306
  generatedValueKey: "email",
63870
64307
  copyKey: "copyEmail",
64308
+ useGeneratedValueKey: "useThisEmail",
63871
64309
  onlyOnRequest: true,
63872
64310
  request: configuration.forwarder.request,
63873
64311
  engine: {
@@ -65398,6 +65836,7 @@ class CredentialGeneratorService {
65398
65836
  generate: this.i18nService.t(generator.generateKey),
65399
65837
  generatedValue: this.i18nService.t(generator.generatedValueKey),
65400
65838
  copy: this.i18nService.t(generator.copyKey),
65839
+ useGeneratedValue: this.i18nService.t(generator.useGeneratedValueKey),
65401
65840
  onlyOnRequest: generator.onlyOnRequest,
65402
65841
  request: generator.request,
65403
65842
  };
@@ -67276,7 +67715,7 @@ module.exports = require("path");
67276
67715
  /***/ 8330:
67277
67716
  /***/ ((module) => {
67278
67717
 
67279
- module.exports = /*#__PURE__*/JSON.parse('{"name":"@bitwarden/cli","description":"A secure and free password manager for all of your devices.","version":"2025.1.0","keywords":["bitwarden","password","vault","password manager","cli"],"author":"Bitwarden Inc. <hello@bitwarden.com> (https://bitwarden.com)","homepage":"https://bitwarden.com","repository":{"type":"git","url":"https://github.com/bitwarden/clients"},"license":"SEE LICENSE IN LICENSE.txt","scripts":{"clean":"rimraf dist","build:oss":"cross-env NODE_OPTIONS=\\"--max-old-space-size=8192\\" webpack","build:oss:debug":"npm run build:oss && node --inspect ./build/bw.js","build:oss:watch":"webpack --watch","build:oss:prod":"cross-env NODE_ENV=production webpack","build:oss:prod:watch":"cross-env NODE_ENV=production webpack --watch","debug":"node --inspect ./build/bw.js","publish:npm":"npm run build:oss:prod && npm publish --access public","build:bit":"cross-env NODE_OPTIONS=\\"--max-old-space-size=8192\\" webpack -c ../../bitwarden_license/bit-cli/webpack.config.js","build:bit:debug":"npm run build:bit && node --inspect ./build/bw.js","build:bit:watch":"webpack --watch -c ../../bitwarden_license/bit-cli/webpack.config.js","build:bit:prod":"cross-env NODE_ENV=production npm run build:bit","build:bit:prod:watch":"cross-env NODE_ENV=production npm run build:bit:watch","dist:oss:win":"npm run build:oss:prod && npm run clean && npm run package:oss:win","dist:oss:mac":"npm run build:oss:prod && npm run clean && npm run package:oss:mac","dist:oss:lin":"npm run build:oss:prod && npm run clean && npm run package:oss:lin","dist:bit:win":"npm run build:bit:prod && npm run clean && npm run package:bit:win","dist:bit:mac":"npm run build:bit:prod && npm run clean && npm run package:bit:mac","dist:bit:lin":"npm run build:bit:prod && npm run clean && npm run package:bit:lin","package:oss:win":"pkg . --targets win-x64 --output ./dist/oss/windows/bw.exe","package:oss:mac":"pkg . --targets macos-x64 --output ./dist/oss/macos/bw","package:oss:lin":"pkg . --targets linux-x64 --output ./dist/oss/linux/bw","package:bit:win":"pkg . --targets win-x64 --output ./dist/bit/windows/bw.exe","package:bit:mac":"pkg . --targets macos-x64 --output ./dist/bit/macos/bw","package:bit:lin":"pkg . --targets linux-x64 --output ./dist/bit/linux/bw","test":"jest","test:watch":"jest --watch","test:watch:all":"jest --watchAll"},"bin":{"bw":"build/bw.js"},"pkg":{"assets":["./build/**/*","../../node_modules/argon2/**/*"]},"dependencies":{"@koa/multer":"3.0.2","@koa/router":"13.1.0","argon2":"0.41.1","big-integer":"1.6.52","browser-hrtime":"1.1.8","chalk":"4.1.2","commander":"11.1.0","form-data":"4.0.0","https-proxy-agent":"7.0.5","inquirer":"8.2.6","jsdom":"25.0.1","jszip":"3.10.1","koa":"2.15.3","koa-bodyparser":"4.4.1","koa-json":"2.0.2","lowdb":"1.0.0","lunr":"2.3.9","multer":"1.4.5-lts.1","node-fetch":"2.6.12","node-forge":"1.3.1","open":"8.4.2","papaparse":"5.4.1","proper-lockfile":"4.1.2","rxjs":"7.8.1","tldts":"6.1.69","zxcvbn":"4.4.2"}}');
67718
+ module.exports = /*#__PURE__*/JSON.parse('{"name":"@bitwarden/cli","description":"A secure and free password manager for all of your devices.","version":"2025.1.2","keywords":["bitwarden","password","vault","password manager","cli"],"author":"Bitwarden Inc. <hello@bitwarden.com> (https://bitwarden.com)","homepage":"https://bitwarden.com","repository":{"type":"git","url":"https://github.com/bitwarden/clients"},"license":"SEE LICENSE IN LICENSE.txt","scripts":{"clean":"rimraf dist","build:oss":"cross-env NODE_OPTIONS=\\"--max-old-space-size=8192\\" webpack","build:oss:debug":"npm run build:oss && node --inspect ./build/bw.js","build:oss:watch":"webpack --watch","build:oss:prod":"cross-env NODE_ENV=production webpack","build:oss:prod:watch":"cross-env NODE_ENV=production webpack --watch","debug":"node --inspect ./build/bw.js","publish:npm":"npm run build:oss:prod && npm publish --access public","build:bit":"cross-env NODE_OPTIONS=\\"--max-old-space-size=8192\\" webpack -c ../../bitwarden_license/bit-cli/webpack.config.js","build:bit:debug":"npm run build:bit && node --inspect ./build/bw.js","build:bit:watch":"webpack --watch -c ../../bitwarden_license/bit-cli/webpack.config.js","build:bit:prod":"cross-env NODE_ENV=production npm run build:bit","build:bit:prod:watch":"cross-env NODE_ENV=production npm run build:bit:watch","dist:oss:win":"npm run build:oss:prod && npm run clean && npm run package:oss:win","dist:oss:mac":"npm run build:oss:prod && npm run clean && npm run package:oss:mac","dist:oss:lin":"npm run build:oss:prod && npm run clean && npm run package:oss:lin","dist:bit:win":"npm run build:bit:prod && npm run clean && npm run package:bit:win","dist:bit:mac":"npm run build:bit:prod && npm run clean && npm run package:bit:mac","dist:bit:lin":"npm run build:bit:prod && npm run clean && npm run package:bit:lin","package:oss:win":"pkg . --targets win-x64 --output ./dist/oss/windows/bw.exe","package:oss:mac":"pkg . --targets macos-x64 --output ./dist/oss/macos/bw","package:oss:lin":"pkg . --targets linux-x64 --output ./dist/oss/linux/bw","package:bit:win":"pkg . --targets win-x64 --output ./dist/bit/windows/bw.exe","package:bit:mac":"pkg . --targets macos-x64 --output ./dist/bit/macos/bw","package:bit:lin":"pkg . --targets linux-x64 --output ./dist/bit/linux/bw","test":"jest","test:watch":"jest --watch","test:watch:all":"jest --watchAll"},"bin":{"bw":"build/bw.js"},"pkg":{"assets":["./build/**/*","../../node_modules/argon2/**/*"]},"dependencies":{"@koa/multer":"3.0.2","@koa/router":"13.1.0","argon2":"0.41.1","big-integer":"1.6.52","browser-hrtime":"1.1.8","chalk":"4.1.2","commander":"11.1.0","form-data":"4.0.0","https-proxy-agent":"7.0.5","inquirer":"8.2.6","jsdom":"25.0.1","jszip":"3.10.1","koa":"2.15.3","koa-bodyparser":"4.4.1","koa-json":"2.0.2","lowdb":"1.0.0","lunr":"2.3.9","multer":"1.4.5-lts.1","node-fetch":"2.6.12","node-forge":"1.3.1","open":"8.4.2","papaparse":"5.4.1","proper-lockfile":"4.1.2","rxjs":"7.8.1","tldts":"6.1.71","zxcvbn":"4.4.2"}}');
67280
67719
 
67281
67720
  /***/ }),
67282
67721