@itwin/core-i18n 4.8.0-dev.16 → 4.8.0-dev.17

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.
@@ -17,13 +17,13 @@
17
17
  /** @packageDocumentation
18
18
  * @module Localization
19
19
  */
20
- function cov_1eybhj3ook() {
21
- var path = "E:\\vsts_b\\3\\s\\core\\i18n\\lib\\cjs\\ITwinLocalization.js";
22
- var hash = "c405eb2c424f15a90b6256cc54a8a13769b68efd";
20
+ function cov_tvwe4w9la() {
21
+ var path = "D:\\vsts_a\\14\\s\\core\\i18n\\lib\\cjs\\ITwinLocalization.js";
22
+ var hash = "c04023a7e49598df272b879c56b382a1f86bbe80";
23
23
  var global = new Function("return this")();
24
24
  var gcv = "__coverage__";
25
25
  var coverageData = {
26
- path: "E:\\vsts_b\\3\\s\\core\\i18n\\lib\\cjs\\ITwinLocalization.js",
26
+ path: "D:\\vsts_a\\14\\s\\core\\i18n\\lib\\cjs\\ITwinLocalization.js",
27
27
  statementMap: {
28
28
  "0": {
29
29
  start: {
@@ -2270,13 +2270,13 @@ function cov_1eybhj3ook() {
2270
2270
  inputSourceMap: {
2271
2271
  version: 3,
2272
2272
  file: "ITwinLocalization.js",
2273
- sources: ["E:\\vsts_b\\3\\s\\core\\i18n\\src\\ITwinLocalization.ts"],
2273
+ sources: ["D:\\vsts_a\\14\\s\\core\\i18n\\src\\ITwinLocalization.ts"],
2274
2274
  names: [],
2275
2275
  mappings: "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",
2276
2276
  sourcesContent: ["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Localization\r\n */\r\n\r\nimport i18next, { i18n, InitOptions, Module, TOptionsBase } from \"i18next\";\r\nimport i18nextBrowserLanguageDetector, { DetectorOptions } from \"i18next-browser-languagedetector\";\r\nimport Backend, { BackendOptions } from \"i18next-http-backend\";\r\nimport { Logger } from \"@itwin/core-bentley\";\r\nimport type { Localization } from \"@itwin/core-common\";\r\n\r\nconst DEFAULT_MAX_RETRIES: number = 1; // a low number prevents wasted time and potential timeouts when requesting localization files throws an error\r\n\r\n/** Options for ITwinLocalization\r\n * @public\r\n */\r\nexport interface LocalizationOptions {\r\n urlTemplate?: string;\r\n backendPlugin?: Module;\r\n detectorPlugin?: Module;\r\n initOptions?: InitOptions;\r\n backendHttpOptions?: BackendOptions;\r\n detectorOptions?: DetectorOptions;\r\n}\r\n\r\n/** Supplies localizations for iTwin.js\r\n * @note this class uses the [i18next](https://www.i18next.com/) package.\r\n * @public\r\n */\r\nexport class ITwinLocalization implements Localization {\r\n public i18next: i18n;\r\n private readonly _initOptions: InitOptions;\r\n private readonly _backendOptions: BackendOptions;\r\n private readonly _detectionOptions: DetectorOptions;\r\n private readonly _namespaces = new Map<string, Promise<void>>();\r\n\r\n public constructor(options?: LocalizationOptions) {\r\n this.i18next = i18next.createInstance();\r\n\r\n this._backendOptions = {\r\n loadPath: options?.urlTemplate ?? \"locales/{{lng}}/{{ns}}.json\",\r\n crossDomain: true,\r\n ...options?.backendHttpOptions,\r\n };\r\n\r\n this._detectionOptions = {\r\n order: [\"querystring\", \"navigator\", \"htmlTag\"],\r\n lookupQuerystring: \"lng\",\r\n caches: [],\r\n ...options?.detectorOptions,\r\n };\r\n\r\n this._initOptions = {\r\n interpolation: { escapeValue: true },\r\n fallbackLng: \"en\",\r\n maxRetries: DEFAULT_MAX_RETRIES,\r\n backend: this._backendOptions,\r\n detection: this._detectionOptions,\r\n ...options?.initOptions,\r\n };\r\n\r\n this.i18next\r\n .use(options?.detectorPlugin ?? i18nextBrowserLanguageDetector)\r\n .use(options?.backendPlugin ?? Backend)\r\n .use(TranslationLogger);\r\n }\r\n\r\n public async initialize(namespaces: string[]): Promise<void> {\r\n\r\n // Also consider namespaces passed into constructor\r\n const initNamespaces: string[] = [this._initOptions.ns || []].flat();\r\n const combinedNamespaces: Set<string> = new Set([...namespaces, ...initNamespaces]); // without duplicates\r\n\r\n const defaultNamespace: string | false | readonly string[] = this._initOptions.defaultNS ?? namespaces[0];\r\n if (defaultNamespace)\r\n combinedNamespaces.add(defaultNamespace as string); // Make sure default namespace is in namespaces list\r\n\r\n const initOptions: InitOptions = {\r\n ...this._initOptions,\r\n defaultNS: defaultNamespace,\r\n ns: [...combinedNamespaces],\r\n };\r\n\r\n // if in a development environment, set debugging\r\n if (process.env.NODE_ENV === \"development\")\r\n initOptions.debug = true;\r\n\r\n const initPromise = this.i18next.init(initOptions) as unknown as Promise<void>;\r\n\r\n for (const ns of namespaces)\r\n this._namespaces.set(ns, initPromise);\r\n\r\n return initPromise;\r\n }\r\n\r\n /** Replace all instances of `%{key}` within a string with the translations of those keys.\r\n * For example:\r\n * ``` ts\r\n * \"MyKeys\": {\r\n * \"Key1\": \"First value\",\r\n * \"Key2\": \"Second value\"\r\n * }\r\n * ```\r\n *\r\n * ``` ts\r\n * i18.translateKeys(\"string with %{MyKeys.Key1} followed by %{MyKeys.Key2}!\"\") // returns \"string with First Value followed by Second Value!\"\r\n * ```\r\n * @param line The input line, potentially containing %{keys}.\r\n * @returns The line with all %{keys} translated\r\n * @public\r\n */\r\n public getLocalizedKeys(line: string): string {\r\n return line.replace(/\\%\\{(.+?)\\}/g, (_match, tag) => this.getLocalizedString(tag));\r\n }\r\n\r\n /** Return the translated value of a key.\r\n * @param key - the key that matches a property in the JSON localization file.\r\n * @note The key includes the namespace, which identifies the particular localization file that contains the property,\r\n * followed by a colon, followed by the property in the JSON file.\r\n * For example:\r\n * ``` ts\r\n * const dataString: string = IModelApp.localization.getLocalizedString(\"iModelJs:BackgroundMap.BingDataAttribution\");\r\n * ```\r\n * assigns to dataString the string with property BackgroundMap.BingDataAttribution from the iModelJs.json localization file.\r\n * @returns The string corresponding to the first key that resolves.\r\n * @throws Error if no keys resolve to a string.\r\n * @public\r\n */\r\n public getLocalizedString(key: string | string[], options?: TOptionsBase): string {\r\n if (options?.returnDetails || options?.returnObjects) {\r\n throw new Error(\"Translation key must map to a string, but the given options will result in an object\");\r\n }\r\n\r\n const value = this.i18next.t(key, options);\r\n\r\n if (typeof value !== \"string\") {\r\n throw new Error(\"Translation key(s) string not found\");\r\n }\r\n\r\n return value;\r\n }\r\n\r\n /** Similar to `getLocalizedString` but the default namespace is a separate parameter and the key does not need\r\n * to include a namespace. If a key includes a namespace, that namespace will be used for interpolating that key.\r\n * @param namespace - the namespace that identifies the particular localization file that contains the property.\r\n * @param key - the key that matches a property in the JSON localization file.\r\n * @returns The string corresponding to the first key that resolves.\r\n * @throws Error if no keys resolve to a string.\r\n * @internal\r\n */\r\n public getLocalizedStringWithNamespace(namespace: string, key: string | string[], options?: TOptionsBase): string {\r\n let fullKey: string | string[] = \"\";\r\n\r\n if (typeof key === \"string\") {\r\n fullKey = `${namespace}:${key}`;\r\n } else {\r\n fullKey = key.map((subKey: string) => {\r\n return `${namespace}:${subKey}`;\r\n });\r\n }\r\n\r\n return this.getLocalizedString(fullKey, options);\r\n }\r\n\r\n /** Gets the English translation.\r\n * @param namespace - the namespace that identifies the particular localization file that contains the property.\r\n * @param key - the key that matches a property in the JSON localization file.\r\n * @returns The string corresponding to the first key that resolves.\r\n * @throws Error if no keys resolve to a string.\r\n * @internal\r\n */\r\n public getEnglishString(namespace: string, key: string | string[], options?: TOptionsBase): string {\r\n if (options?.returnDetails || options?.returnObjects) {\r\n throw new Error(\"Translation key must map to a string, but the given options will result in an object\");\r\n }\r\n\r\n options = {\r\n ...options,\r\n ns: namespace, // ensure namespace argument is used\r\n };\r\n\r\n const en = this.i18next.getFixedT(\"en\", namespace);\r\n const str = en(key, options);\r\n if (typeof str !== \"string\")\r\n throw new Error(\"Translation key(s) not found\");\r\n\r\n return str;\r\n }\r\n\r\n /** Get the promise for an already registered Namespace.\r\n * @param name - the name of the namespace\r\n * @public\r\n */\r\n public getNamespacePromise(name: string): Promise<void> | undefined {\r\n return this._namespaces.get(name);\r\n }\r\n\r\n /** @internal */\r\n public getLanguageList(): readonly string[] {\r\n return this.i18next.languages;\r\n }\r\n\r\n /** override the language detected in the browser */\r\n public async changeLanguage(language: string) {\r\n return this.i18next.changeLanguage(language) as unknown as Promise<void>;\r\n }\r\n\r\n /** Register a new Namespace and return it. If the namespace is already registered, it will be returned.\r\n * @param name - the name of the namespace, which is the base name of the JSON file that contains the localization properties.\r\n * @note - The registerNamespace method starts fetching the appropriate version of the JSON localization file from the server,\r\n * based on the current locale. To make sure that fetch is complete before performing translations from this namespace, await\r\n * fulfillment of the readPromise Promise property of the returned LocalizationNamespace.\r\n * @see [Localization in iTwin.js]($docs/learning/frontend/Localization.md)\r\n * @public\r\n */\r\n public async registerNamespace(name: string): Promise<void> {\r\n const existing = this._namespaces.get(name);\r\n if (existing !== undefined)\r\n return existing;\r\n\r\n const theReadPromise = new Promise<void>((resolve) => {\r\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\r\n this.i18next.loadNamespaces(name, (err) => {\r\n if (!err)\r\n return resolve();\r\n\r\n // Here we got a non-null err object.\r\n // This method is called when the system has attempted to load the resources for the namespaces for each possible locale.\r\n // For example 'fr-ca' might be the most specific locale, in which case 'fr' and 'en' are fallback locales.\r\n // Using Backend from i18next-http-backend, err will be an array of strings of each namespace it tried to read and its locale.\r\n // There might be errs for some other namespaces as well as this one. We resolve the promise unless there's an error for each possible locale.\r\n let locales = this.getLanguageList().map((thisLocale: any) => `/${thisLocale}/`);\r\n\r\n try {\r\n for (const thisError of err) {\r\n if (typeof thisError === \"string\")\r\n locales = locales.filter((thisLocale) => !thisError.includes(thisLocale));\r\n }\r\n } catch (e) {\r\n locales = [];\r\n }\r\n // if we removed every locale from the array, it wasn't loaded.\r\n if (locales.length === 0)\r\n Logger.logError(\"i18n\", `No resources for namespace ${name} could be loaded`);\r\n\r\n resolve();\r\n });\r\n });\r\n this._namespaces.set(name, theReadPromise);\r\n return theReadPromise;\r\n }\r\n\r\n /** @internal */\r\n public unregisterNamespace(name: string): void {\r\n this._namespaces.delete(name);\r\n }\r\n}\r\n\r\nclass TranslationLogger {\r\n public static readonly type = \"logger\";\r\n public log(args: string[]) { Logger.logInfo(\"i18n\", this.createLogMessage(args)); }\r\n public warn(args: string[]) { Logger.logWarning(\"i18n\", this.createLogMessage(args)); }\r\n public error(args: string[]) { Logger.logError(\"i18n\", this.createLogMessage(args)); }\r\n private createLogMessage(args: string[]) {\r\n let message = args[0];\r\n for (let i = 1; i < args.length; ++i) {\r\n if (typeof args[i] === \"string\")\r\n message += `\\n ${args[i]}`;\r\n }\r\n return message;\r\n }\r\n}\r\n"]
2277
2277
  },
2278
2278
  _coverageSchema: "1a1c01bbd47fc00a2c39e90264f33305004495a9",
2279
- hash: "c405eb2c424f15a90b6256cc54a8a13769b68efd"
2279
+ hash: "c04023a7e49598df272b879c56b382a1f86bbe80"
2280
2280
  };
2281
2281
  var coverage = global[gcv] || (global[gcv] = {});
2282
2282
  if (!coverage[path] || coverage[path].hash !== hash) {
@@ -2285,56 +2285,56 @@ function cov_1eybhj3ook() {
2285
2285
  var actualCoverage = coverage[path];
2286
2286
  {
2287
2287
  // @ts-ignore
2288
- cov_1eybhj3ook = function () {
2288
+ cov_tvwe4w9la = function () {
2289
2289
  return actualCoverage;
2290
2290
  };
2291
2291
  }
2292
2292
  return actualCoverage;
2293
2293
  }
2294
- cov_1eybhj3ook();
2295
- var __importDefault = (cov_1eybhj3ook().s[0]++, (cov_1eybhj3ook().b[0][0]++, this) && (cov_1eybhj3ook().b[0][1]++, this.__importDefault) || (cov_1eybhj3ook().b[0][2]++, function (mod) {
2296
- cov_1eybhj3ook().f[0]++;
2297
- cov_1eybhj3ook().s[1]++;
2298
- return (cov_1eybhj3ook().b[2][0]++, mod) && (cov_1eybhj3ook().b[2][1]++, mod.__esModule) ? (cov_1eybhj3ook().b[1][0]++, mod) : (cov_1eybhj3ook().b[1][1]++, {
2294
+ cov_tvwe4w9la();
2295
+ var __importDefault = (cov_tvwe4w9la().s[0]++, (cov_tvwe4w9la().b[0][0]++, this) && (cov_tvwe4w9la().b[0][1]++, this.__importDefault) || (cov_tvwe4w9la().b[0][2]++, function (mod) {
2296
+ cov_tvwe4w9la().f[0]++;
2297
+ cov_tvwe4w9la().s[1]++;
2298
+ return (cov_tvwe4w9la().b[2][0]++, mod) && (cov_tvwe4w9la().b[2][1]++, mod.__esModule) ? (cov_tvwe4w9la().b[1][0]++, mod) : (cov_tvwe4w9la().b[1][1]++, {
2299
2299
  "default": mod
2300
2300
  });
2301
2301
  }));
2302
- cov_1eybhj3ook().s[2]++;
2302
+ cov_tvwe4w9la().s[2]++;
2303
2303
  Object.defineProperty(exports, "__esModule", ({
2304
2304
  value: true
2305
2305
  }));
2306
- cov_1eybhj3ook().s[3]++;
2306
+ cov_tvwe4w9la().s[3]++;
2307
2307
  exports.ITwinLocalization = void 0;
2308
- const i18next_1 = (cov_1eybhj3ook().s[4]++, __importDefault(__webpack_require__(/*! i18next */ "../../common/temp/node_modules/.pnpm/i18next@21.9.1/node_modules/i18next/dist/cjs/i18next.js")));
2309
- const i18next_browser_languagedetector_1 = (cov_1eybhj3ook().s[5]++, __importDefault(__webpack_require__(/*! i18next-browser-languagedetector */ "../../common/temp/node_modules/.pnpm/i18next-browser-languagedetector@6.1.2/node_modules/i18next-browser-languagedetector/dist/esm/i18nextBrowserLanguageDetector.js")));
2310
- const i18next_http_backend_1 = (cov_1eybhj3ook().s[6]++, __importDefault(__webpack_require__(/*! i18next-http-backend */ "../../common/temp/node_modules/.pnpm/i18next-http-backend@1.4.4/node_modules/i18next-http-backend/cjs/index.js")));
2311
- const core_bentley_1 = (cov_1eybhj3ook().s[7]++, __webpack_require__(/*! @itwin/core-bentley */ "../bentley/lib/esm/core-bentley.js"));
2312
- const DEFAULT_MAX_RETRIES = (cov_1eybhj3ook().s[8]++, 1); // a low number prevents wasted time and potential timeouts when requesting localization files throws an error
2308
+ const i18next_1 = (cov_tvwe4w9la().s[4]++, __importDefault(__webpack_require__(/*! i18next */ "../../common/temp/node_modules/.pnpm/i18next@21.9.1/node_modules/i18next/dist/cjs/i18next.js")));
2309
+ const i18next_browser_languagedetector_1 = (cov_tvwe4w9la().s[5]++, __importDefault(__webpack_require__(/*! i18next-browser-languagedetector */ "../../common/temp/node_modules/.pnpm/i18next-browser-languagedetector@6.1.2/node_modules/i18next-browser-languagedetector/dist/esm/i18nextBrowserLanguageDetector.js")));
2310
+ const i18next_http_backend_1 = (cov_tvwe4w9la().s[6]++, __importDefault(__webpack_require__(/*! i18next-http-backend */ "../../common/temp/node_modules/.pnpm/i18next-http-backend@1.4.4/node_modules/i18next-http-backend/cjs/index.js")));
2311
+ const core_bentley_1 = (cov_tvwe4w9la().s[7]++, __webpack_require__(/*! @itwin/core-bentley */ "../bentley/lib/esm/core-bentley.js"));
2312
+ const DEFAULT_MAX_RETRIES = (cov_tvwe4w9la().s[8]++, 1); // a low number prevents wasted time and potential timeouts when requesting localization files throws an error
2313
2313
  /** Supplies localizations for iTwin.js
2314
2314
  * @note this class uses the [i18next](https://www.i18next.com/) package.
2315
2315
  * @public
2316
2316
  */
2317
2317
  class ITwinLocalization {
2318
2318
  constructor(options) {
2319
- cov_1eybhj3ook().f[1]++;
2320
- cov_1eybhj3ook().s[9]++;
2319
+ cov_tvwe4w9la().f[1]++;
2320
+ cov_tvwe4w9la().s[9]++;
2321
2321
  this._namespaces = new Map();
2322
- cov_1eybhj3ook().s[10]++;
2322
+ cov_tvwe4w9la().s[10]++;
2323
2323
  this.i18next = i18next_1.default.createInstance();
2324
- cov_1eybhj3ook().s[11]++;
2324
+ cov_tvwe4w9la().s[11]++;
2325
2325
  this._backendOptions = {
2326
- loadPath: (cov_1eybhj3ook().b[3][0]++, options?.urlTemplate) ?? (cov_1eybhj3ook().b[3][1]++, "locales/{{lng}}/{{ns}}.json"),
2326
+ loadPath: (cov_tvwe4w9la().b[3][0]++, options?.urlTemplate) ?? (cov_tvwe4w9la().b[3][1]++, "locales/{{lng}}/{{ns}}.json"),
2327
2327
  crossDomain: true,
2328
2328
  ...options?.backendHttpOptions
2329
2329
  };
2330
- cov_1eybhj3ook().s[12]++;
2330
+ cov_tvwe4w9la().s[12]++;
2331
2331
  this._detectionOptions = {
2332
2332
  order: ["querystring", "navigator", "htmlTag"],
2333
2333
  lookupQuerystring: "lng",
2334
2334
  caches: [],
2335
2335
  ...options?.detectorOptions
2336
2336
  };
2337
- cov_1eybhj3ook().s[13]++;
2337
+ cov_tvwe4w9la().s[13]++;
2338
2338
  this._initOptions = {
2339
2339
  interpolation: {
2340
2340
  escapeValue: true
@@ -2345,40 +2345,40 @@ class ITwinLocalization {
2345
2345
  detection: this._detectionOptions,
2346
2346
  ...options?.initOptions
2347
2347
  };
2348
- cov_1eybhj3ook().s[14]++;
2349
- this.i18next.use((cov_1eybhj3ook().b[4][0]++, options?.detectorPlugin) ?? (cov_1eybhj3ook().b[4][1]++, i18next_browser_languagedetector_1.default)).use((cov_1eybhj3ook().b[5][0]++, options?.backendPlugin) ?? (cov_1eybhj3ook().b[5][1]++, i18next_http_backend_1.default)).use(TranslationLogger);
2348
+ cov_tvwe4w9la().s[14]++;
2349
+ this.i18next.use((cov_tvwe4w9la().b[4][0]++, options?.detectorPlugin) ?? (cov_tvwe4w9la().b[4][1]++, i18next_browser_languagedetector_1.default)).use((cov_tvwe4w9la().b[5][0]++, options?.backendPlugin) ?? (cov_tvwe4w9la().b[5][1]++, i18next_http_backend_1.default)).use(TranslationLogger);
2350
2350
  }
2351
2351
  async initialize(namespaces) {
2352
- cov_1eybhj3ook().f[2]++;
2352
+ cov_tvwe4w9la().f[2]++;
2353
2353
  // Also consider namespaces passed into constructor
2354
- const initNamespaces = (cov_1eybhj3ook().s[15]++, [(cov_1eybhj3ook().b[6][0]++, this._initOptions.ns) || (cov_1eybhj3ook().b[6][1]++, [])].flat());
2355
- const combinedNamespaces = (cov_1eybhj3ook().s[16]++, new Set([...namespaces, ...initNamespaces])); // without duplicates
2356
- const defaultNamespace = (cov_1eybhj3ook().s[17]++, (cov_1eybhj3ook().b[7][0]++, this._initOptions.defaultNS) ?? (cov_1eybhj3ook().b[7][1]++, namespaces[0]));
2357
- cov_1eybhj3ook().s[18]++;
2354
+ const initNamespaces = (cov_tvwe4w9la().s[15]++, [(cov_tvwe4w9la().b[6][0]++, this._initOptions.ns) || (cov_tvwe4w9la().b[6][1]++, [])].flat());
2355
+ const combinedNamespaces = (cov_tvwe4w9la().s[16]++, new Set([...namespaces, ...initNamespaces])); // without duplicates
2356
+ const defaultNamespace = (cov_tvwe4w9la().s[17]++, (cov_tvwe4w9la().b[7][0]++, this._initOptions.defaultNS) ?? (cov_tvwe4w9la().b[7][1]++, namespaces[0]));
2357
+ cov_tvwe4w9la().s[18]++;
2358
2358
  if (defaultNamespace) {
2359
- cov_1eybhj3ook().b[8][0]++;
2360
- cov_1eybhj3ook().s[19]++;
2359
+ cov_tvwe4w9la().b[8][0]++;
2360
+ cov_tvwe4w9la().s[19]++;
2361
2361
  combinedNamespaces.add(defaultNamespace);
2362
2362
  } else {
2363
- cov_1eybhj3ook().b[8][1]++;
2363
+ cov_tvwe4w9la().b[8][1]++;
2364
2364
  } // Make sure default namespace is in namespaces list
2365
- const initOptions = (cov_1eybhj3ook().s[20]++, {
2365
+ const initOptions = (cov_tvwe4w9la().s[20]++, {
2366
2366
  ...this._initOptions,
2367
2367
  defaultNS: defaultNamespace,
2368
2368
  ns: [...combinedNamespaces]
2369
2369
  });
2370
2370
  // if in a development environment, set debugging
2371
- cov_1eybhj3ook().s[21]++;
2371
+ cov_tvwe4w9la().s[21]++;
2372
2372
  if (false) {} else {
2373
- cov_1eybhj3ook().b[9][1]++;
2373
+ cov_tvwe4w9la().b[9][1]++;
2374
2374
  }
2375
- const initPromise = (cov_1eybhj3ook().s[23]++, this.i18next.init(initOptions));
2376
- cov_1eybhj3ook().s[24]++;
2375
+ const initPromise = (cov_tvwe4w9la().s[23]++, this.i18next.init(initOptions));
2376
+ cov_tvwe4w9la().s[24]++;
2377
2377
  for (const ns of namespaces) {
2378
- cov_1eybhj3ook().s[25]++;
2378
+ cov_tvwe4w9la().s[25]++;
2379
2379
  this._namespaces.set(ns, initPromise);
2380
2380
  }
2381
- cov_1eybhj3ook().s[26]++;
2381
+ cov_tvwe4w9la().s[26]++;
2382
2382
  return initPromise;
2383
2383
  }
2384
2384
  /** Replace all instances of `%{key}` within a string with the translations of those keys.
@@ -2398,11 +2398,11 @@ class ITwinLocalization {
2398
2398
  * @public
2399
2399
  */
2400
2400
  getLocalizedKeys(line) {
2401
- cov_1eybhj3ook().f[3]++;
2402
- cov_1eybhj3ook().s[27]++;
2401
+ cov_tvwe4w9la().f[3]++;
2402
+ cov_tvwe4w9la().s[27]++;
2403
2403
  return line.replace(/\%\{(.+?)\}/g, (_match, tag) => {
2404
- cov_1eybhj3ook().f[4]++;
2405
- cov_1eybhj3ook().s[28]++;
2404
+ cov_tvwe4w9la().f[4]++;
2405
+ cov_tvwe4w9la().s[28]++;
2406
2406
  return this.getLocalizedString(tag);
2407
2407
  });
2408
2408
  }
@@ -2420,25 +2420,25 @@ class ITwinLocalization {
2420
2420
  * @public
2421
2421
  */
2422
2422
  getLocalizedString(key, options) {
2423
- cov_1eybhj3ook().f[5]++;
2424
- cov_1eybhj3ook().s[29]++;
2425
- if ((cov_1eybhj3ook().b[11][0]++, options?.returnDetails) || (cov_1eybhj3ook().b[11][1]++, options?.returnObjects)) {
2426
- cov_1eybhj3ook().b[10][0]++;
2427
- cov_1eybhj3ook().s[30]++;
2423
+ cov_tvwe4w9la().f[5]++;
2424
+ cov_tvwe4w9la().s[29]++;
2425
+ if ((cov_tvwe4w9la().b[11][0]++, options?.returnDetails) || (cov_tvwe4w9la().b[11][1]++, options?.returnObjects)) {
2426
+ cov_tvwe4w9la().b[10][0]++;
2427
+ cov_tvwe4w9la().s[30]++;
2428
2428
  throw new Error("Translation key must map to a string, but the given options will result in an object");
2429
2429
  } else {
2430
- cov_1eybhj3ook().b[10][1]++;
2430
+ cov_tvwe4w9la().b[10][1]++;
2431
2431
  }
2432
- const value = (cov_1eybhj3ook().s[31]++, this.i18next.t(key, options));
2433
- cov_1eybhj3ook().s[32]++;
2432
+ const value = (cov_tvwe4w9la().s[31]++, this.i18next.t(key, options));
2433
+ cov_tvwe4w9la().s[32]++;
2434
2434
  if (typeof value !== "string") {
2435
- cov_1eybhj3ook().b[12][0]++;
2436
- cov_1eybhj3ook().s[33]++;
2435
+ cov_tvwe4w9la().b[12][0]++;
2436
+ cov_tvwe4w9la().s[33]++;
2437
2437
  throw new Error("Translation key(s) string not found");
2438
2438
  } else {
2439
- cov_1eybhj3ook().b[12][1]++;
2439
+ cov_tvwe4w9la().b[12][1]++;
2440
2440
  }
2441
- cov_1eybhj3ook().s[34]++;
2441
+ cov_tvwe4w9la().s[34]++;
2442
2442
  return value;
2443
2443
  }
2444
2444
  /** Similar to `getLocalizedString` but the default namespace is a separate parameter and the key does not need
@@ -2450,23 +2450,23 @@ class ITwinLocalization {
2450
2450
  * @internal
2451
2451
  */
2452
2452
  getLocalizedStringWithNamespace(namespace, key, options) {
2453
- cov_1eybhj3ook().f[6]++;
2454
- let fullKey = (cov_1eybhj3ook().s[35]++, "");
2455
- cov_1eybhj3ook().s[36]++;
2453
+ cov_tvwe4w9la().f[6]++;
2454
+ let fullKey = (cov_tvwe4w9la().s[35]++, "");
2455
+ cov_tvwe4w9la().s[36]++;
2456
2456
  if (typeof key === "string") {
2457
- cov_1eybhj3ook().b[13][0]++;
2458
- cov_1eybhj3ook().s[37]++;
2457
+ cov_tvwe4w9la().b[13][0]++;
2458
+ cov_tvwe4w9la().s[37]++;
2459
2459
  fullKey = `${namespace}:${key}`;
2460
2460
  } else {
2461
- cov_1eybhj3ook().b[13][1]++;
2462
- cov_1eybhj3ook().s[38]++;
2461
+ cov_tvwe4w9la().b[13][1]++;
2462
+ cov_tvwe4w9la().s[38]++;
2463
2463
  fullKey = key.map(subKey => {
2464
- cov_1eybhj3ook().f[7]++;
2465
- cov_1eybhj3ook().s[39]++;
2464
+ cov_tvwe4w9la().f[7]++;
2465
+ cov_tvwe4w9la().s[39]++;
2466
2466
  return `${namespace}:${subKey}`;
2467
2467
  });
2468
2468
  }
2469
- cov_1eybhj3ook().s[40]++;
2469
+ cov_tvwe4w9la().s[40]++;
2470
2470
  return this.getLocalizedString(fullKey, options);
2471
2471
  }
2472
2472
  /** Gets the English translation.
@@ -2477,31 +2477,31 @@ class ITwinLocalization {
2477
2477
  * @internal
2478
2478
  */
2479
2479
  getEnglishString(namespace, key, options) {
2480
- cov_1eybhj3ook().f[8]++;
2481
- cov_1eybhj3ook().s[41]++;
2482
- if ((cov_1eybhj3ook().b[15][0]++, options?.returnDetails) || (cov_1eybhj3ook().b[15][1]++, options?.returnObjects)) {
2483
- cov_1eybhj3ook().b[14][0]++;
2484
- cov_1eybhj3ook().s[42]++;
2480
+ cov_tvwe4w9la().f[8]++;
2481
+ cov_tvwe4w9la().s[41]++;
2482
+ if ((cov_tvwe4w9la().b[15][0]++, options?.returnDetails) || (cov_tvwe4w9la().b[15][1]++, options?.returnObjects)) {
2483
+ cov_tvwe4w9la().b[14][0]++;
2484
+ cov_tvwe4w9la().s[42]++;
2485
2485
  throw new Error("Translation key must map to a string, but the given options will result in an object");
2486
2486
  } else {
2487
- cov_1eybhj3ook().b[14][1]++;
2487
+ cov_tvwe4w9la().b[14][1]++;
2488
2488
  }
2489
- cov_1eybhj3ook().s[43]++;
2489
+ cov_tvwe4w9la().s[43]++;
2490
2490
  options = {
2491
2491
  ...options,
2492
2492
  ns: namespace // ensure namespace argument is used
2493
2493
  };
2494
- const en = (cov_1eybhj3ook().s[44]++, this.i18next.getFixedT("en", namespace));
2495
- const str = (cov_1eybhj3ook().s[45]++, en(key, options));
2496
- cov_1eybhj3ook().s[46]++;
2494
+ const en = (cov_tvwe4w9la().s[44]++, this.i18next.getFixedT("en", namespace));
2495
+ const str = (cov_tvwe4w9la().s[45]++, en(key, options));
2496
+ cov_tvwe4w9la().s[46]++;
2497
2497
  if (typeof str !== "string") {
2498
- cov_1eybhj3ook().b[16][0]++;
2499
- cov_1eybhj3ook().s[47]++;
2498
+ cov_tvwe4w9la().b[16][0]++;
2499
+ cov_tvwe4w9la().s[47]++;
2500
2500
  throw new Error("Translation key(s) not found");
2501
2501
  } else {
2502
- cov_1eybhj3ook().b[16][1]++;
2502
+ cov_tvwe4w9la().b[16][1]++;
2503
2503
  }
2504
- cov_1eybhj3ook().s[48]++;
2504
+ cov_tvwe4w9la().s[48]++;
2505
2505
  return str;
2506
2506
  }
2507
2507
  /** Get the promise for an already registered Namespace.
@@ -2509,20 +2509,20 @@ class ITwinLocalization {
2509
2509
  * @public
2510
2510
  */
2511
2511
  getNamespacePromise(name) {
2512
- cov_1eybhj3ook().f[9]++;
2513
- cov_1eybhj3ook().s[49]++;
2512
+ cov_tvwe4w9la().f[9]++;
2513
+ cov_tvwe4w9la().s[49]++;
2514
2514
  return this._namespaces.get(name);
2515
2515
  }
2516
2516
  /** @internal */
2517
2517
  getLanguageList() {
2518
- cov_1eybhj3ook().f[10]++;
2519
- cov_1eybhj3ook().s[50]++;
2518
+ cov_tvwe4w9la().f[10]++;
2519
+ cov_tvwe4w9la().s[50]++;
2520
2520
  return this.i18next.languages;
2521
2521
  }
2522
2522
  /** override the language detected in the browser */
2523
2523
  async changeLanguage(language) {
2524
- cov_1eybhj3ook().f[11]++;
2525
- cov_1eybhj3ook().s[51]++;
2524
+ cov_tvwe4w9la().f[11]++;
2525
+ cov_tvwe4w9la().s[51]++;
2526
2526
  return this.i18next.changeLanguage(language);
2527
2527
  }
2528
2528
  /** Register a new Namespace and return it. If the namespace is already registered, it will be returned.
@@ -2534,123 +2534,123 @@ class ITwinLocalization {
2534
2534
  * @public
2535
2535
  */
2536
2536
  async registerNamespace(name) {
2537
- cov_1eybhj3ook().f[12]++;
2538
- const existing = (cov_1eybhj3ook().s[52]++, this._namespaces.get(name));
2539
- cov_1eybhj3ook().s[53]++;
2537
+ cov_tvwe4w9la().f[12]++;
2538
+ const existing = (cov_tvwe4w9la().s[52]++, this._namespaces.get(name));
2539
+ cov_tvwe4w9la().s[53]++;
2540
2540
  if (existing !== undefined) {
2541
- cov_1eybhj3ook().b[17][0]++;
2542
- cov_1eybhj3ook().s[54]++;
2541
+ cov_tvwe4w9la().b[17][0]++;
2542
+ cov_tvwe4w9la().s[54]++;
2543
2543
  return existing;
2544
2544
  } else {
2545
- cov_1eybhj3ook().b[17][1]++;
2545
+ cov_tvwe4w9la().b[17][1]++;
2546
2546
  }
2547
- const theReadPromise = (cov_1eybhj3ook().s[55]++, new Promise(resolve => {
2548
- cov_1eybhj3ook().f[13]++;
2549
- cov_1eybhj3ook().s[56]++;
2547
+ const theReadPromise = (cov_tvwe4w9la().s[55]++, new Promise(resolve => {
2548
+ cov_tvwe4w9la().f[13]++;
2549
+ cov_tvwe4w9la().s[56]++;
2550
2550
  // eslint-disable-next-line @typescript-eslint/no-floating-promises
2551
2551
  this.i18next.loadNamespaces(name, err => {
2552
- cov_1eybhj3ook().f[14]++;
2553
- cov_1eybhj3ook().s[57]++;
2552
+ cov_tvwe4w9la().f[14]++;
2553
+ cov_tvwe4w9la().s[57]++;
2554
2554
  if (!err) {
2555
- cov_1eybhj3ook().b[18][0]++;
2556
- cov_1eybhj3ook().s[58]++;
2555
+ cov_tvwe4w9la().b[18][0]++;
2556
+ cov_tvwe4w9la().s[58]++;
2557
2557
  return resolve();
2558
2558
  } else {
2559
- cov_1eybhj3ook().b[18][1]++;
2559
+ cov_tvwe4w9la().b[18][1]++;
2560
2560
  }
2561
2561
  // Here we got a non-null err object.
2562
2562
  // This method is called when the system has attempted to load the resources for the namespaces for each possible locale.
2563
2563
  // For example 'fr-ca' might be the most specific locale, in which case 'fr' and 'en' are fallback locales.
2564
2564
  // Using Backend from i18next-http-backend, err will be an array of strings of each namespace it tried to read and its locale.
2565
2565
  // There might be errs for some other namespaces as well as this one. We resolve the promise unless there's an error for each possible locale.
2566
- let locales = (cov_1eybhj3ook().s[59]++, this.getLanguageList().map(thisLocale => {
2567
- cov_1eybhj3ook().f[15]++;
2568
- cov_1eybhj3ook().s[60]++;
2566
+ let locales = (cov_tvwe4w9la().s[59]++, this.getLanguageList().map(thisLocale => {
2567
+ cov_tvwe4w9la().f[15]++;
2568
+ cov_tvwe4w9la().s[60]++;
2569
2569
  return `/${thisLocale}/`;
2570
2570
  }));
2571
- cov_1eybhj3ook().s[61]++;
2571
+ cov_tvwe4w9la().s[61]++;
2572
2572
  try {
2573
- cov_1eybhj3ook().s[62]++;
2573
+ cov_tvwe4w9la().s[62]++;
2574
2574
  for (const thisError of err) {
2575
- cov_1eybhj3ook().s[63]++;
2575
+ cov_tvwe4w9la().s[63]++;
2576
2576
  if (typeof thisError === "string") {
2577
- cov_1eybhj3ook().b[19][0]++;
2578
- cov_1eybhj3ook().s[64]++;
2577
+ cov_tvwe4w9la().b[19][0]++;
2578
+ cov_tvwe4w9la().s[64]++;
2579
2579
  locales = locales.filter(thisLocale => {
2580
- cov_1eybhj3ook().f[16]++;
2581
- cov_1eybhj3ook().s[65]++;
2580
+ cov_tvwe4w9la().f[16]++;
2581
+ cov_tvwe4w9la().s[65]++;
2582
2582
  return !thisError.includes(thisLocale);
2583
2583
  });
2584
2584
  } else {
2585
- cov_1eybhj3ook().b[19][1]++;
2585
+ cov_tvwe4w9la().b[19][1]++;
2586
2586
  }
2587
2587
  }
2588
2588
  } catch (e) {
2589
- cov_1eybhj3ook().s[66]++;
2589
+ cov_tvwe4w9la().s[66]++;
2590
2590
  locales = [];
2591
2591
  }
2592
2592
  // if we removed every locale from the array, it wasn't loaded.
2593
- cov_1eybhj3ook().s[67]++;
2593
+ cov_tvwe4w9la().s[67]++;
2594
2594
  if (locales.length === 0) {
2595
- cov_1eybhj3ook().b[20][0]++;
2596
- cov_1eybhj3ook().s[68]++;
2595
+ cov_tvwe4w9la().b[20][0]++;
2596
+ cov_tvwe4w9la().s[68]++;
2597
2597
  core_bentley_1.Logger.logError("i18n", `No resources for namespace ${name} could be loaded`);
2598
2598
  } else {
2599
- cov_1eybhj3ook().b[20][1]++;
2599
+ cov_tvwe4w9la().b[20][1]++;
2600
2600
  }
2601
- cov_1eybhj3ook().s[69]++;
2601
+ cov_tvwe4w9la().s[69]++;
2602
2602
  resolve();
2603
2603
  });
2604
2604
  }));
2605
- cov_1eybhj3ook().s[70]++;
2605
+ cov_tvwe4w9la().s[70]++;
2606
2606
  this._namespaces.set(name, theReadPromise);
2607
- cov_1eybhj3ook().s[71]++;
2607
+ cov_tvwe4w9la().s[71]++;
2608
2608
  return theReadPromise;
2609
2609
  }
2610
2610
  /** @internal */
2611
2611
  unregisterNamespace(name) {
2612
- cov_1eybhj3ook().f[17]++;
2613
- cov_1eybhj3ook().s[72]++;
2612
+ cov_tvwe4w9la().f[17]++;
2613
+ cov_tvwe4w9la().s[72]++;
2614
2614
  this._namespaces.delete(name);
2615
2615
  }
2616
2616
  }
2617
- cov_1eybhj3ook().s[73]++;
2617
+ cov_tvwe4w9la().s[73]++;
2618
2618
  exports.ITwinLocalization = ITwinLocalization;
2619
2619
  class TranslationLogger {
2620
2620
  log(args) {
2621
- cov_1eybhj3ook().f[18]++;
2622
- cov_1eybhj3ook().s[74]++;
2621
+ cov_tvwe4w9la().f[18]++;
2622
+ cov_tvwe4w9la().s[74]++;
2623
2623
  core_bentley_1.Logger.logInfo("i18n", this.createLogMessage(args));
2624
2624
  }
2625
2625
  warn(args) {
2626
- cov_1eybhj3ook().f[19]++;
2627
- cov_1eybhj3ook().s[75]++;
2626
+ cov_tvwe4w9la().f[19]++;
2627
+ cov_tvwe4w9la().s[75]++;
2628
2628
  core_bentley_1.Logger.logWarning("i18n", this.createLogMessage(args));
2629
2629
  }
2630
2630
  error(args) {
2631
- cov_1eybhj3ook().f[20]++;
2632
- cov_1eybhj3ook().s[76]++;
2631
+ cov_tvwe4w9la().f[20]++;
2632
+ cov_tvwe4w9la().s[76]++;
2633
2633
  core_bentley_1.Logger.logError("i18n", this.createLogMessage(args));
2634
2634
  }
2635
2635
  createLogMessage(args) {
2636
- cov_1eybhj3ook().f[21]++;
2637
- let message = (cov_1eybhj3ook().s[77]++, args[0]);
2638
- cov_1eybhj3ook().s[78]++;
2639
- for (let i = (cov_1eybhj3ook().s[79]++, 1); i < args.length; ++i) {
2640
- cov_1eybhj3ook().s[80]++;
2636
+ cov_tvwe4w9la().f[21]++;
2637
+ let message = (cov_tvwe4w9la().s[77]++, args[0]);
2638
+ cov_tvwe4w9la().s[78]++;
2639
+ for (let i = (cov_tvwe4w9la().s[79]++, 1); i < args.length; ++i) {
2640
+ cov_tvwe4w9la().s[80]++;
2641
2641
  if (typeof args[i] === "string") {
2642
- cov_1eybhj3ook().b[21][0]++;
2643
- cov_1eybhj3ook().s[81]++;
2642
+ cov_tvwe4w9la().b[21][0]++;
2643
+ cov_tvwe4w9la().s[81]++;
2644
2644
  message += `\n ${args[i]}`;
2645
2645
  } else {
2646
- cov_1eybhj3ook().b[21][1]++;
2646
+ cov_tvwe4w9la().b[21][1]++;
2647
2647
  }
2648
2648
  }
2649
- cov_1eybhj3ook().s[82]++;
2649
+ cov_tvwe4w9la().s[82]++;
2650
2650
  return message;
2651
2651
  }
2652
2652
  }
2653
- cov_1eybhj3ook().s[83]++;
2653
+ cov_tvwe4w9la().s[83]++;
2654
2654
  TranslationLogger.type = "logger";
2655
2655
 
2656
2656
  /***/ }),
@@ -18561,12 +18561,8 @@ class BeEventList {
18561
18561
  "use strict";
18562
18562
  __webpack_require__.r(__webpack_exports__);
18563
18563
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
18564
- /* harmony export */ "DbChangeStage": () => (/* binding */ DbChangeStage),
18565
- /* harmony export */ "DbConflictCause": () => (/* binding */ DbConflictCause),
18566
- /* harmony export */ "DbConflictResolution": () => (/* binding */ DbConflictResolution),
18567
18564
  /* harmony export */ "DbOpcode": () => (/* binding */ DbOpcode),
18568
18565
  /* harmony export */ "DbResult": () => (/* binding */ DbResult),
18569
- /* harmony export */ "DbValueType": () => (/* binding */ DbValueType),
18570
18566
  /* harmony export */ "OpenMode": () => (/* binding */ OpenMode)
18571
18567
  /* harmony export */ });
18572
18568
  /*---------------------------------------------------------------------------------------------
@@ -18596,48 +18592,6 @@ var DbOpcode;
18596
18592
  /** Some columns of an existing row were updated. */
18597
18593
  DbOpcode[DbOpcode["Update"] = 23] = "Update";
18598
18594
  })(DbOpcode || (DbOpcode = {}));
18599
- /** Change value stage.
18600
- * @internal
18601
- */
18602
- var DbChangeStage;
18603
- (function (DbChangeStage) {
18604
- DbChangeStage[DbChangeStage["Old"] = 0] = "Old";
18605
- DbChangeStage[DbChangeStage["New"] = 1] = "New";
18606
- })(DbChangeStage || (DbChangeStage = {}));
18607
- /** Change value type.
18608
- * @internal
18609
- */
18610
- var DbValueType;
18611
- (function (DbValueType) {
18612
- DbValueType[DbValueType["IntegerVal"] = 1] = "IntegerVal";
18613
- DbValueType[DbValueType["FloatVal"] = 2] = "FloatVal";
18614
- DbValueType[DbValueType["TextVal"] = 3] = "TextVal";
18615
- DbValueType[DbValueType["BlobVal"] = 4] = "BlobVal";
18616
- DbValueType[DbValueType["NullVal"] = 5] = "NullVal";
18617
- })(DbValueType || (DbValueType = {}));
18618
- /** Cause of conflict when applying a changeset
18619
- * @internal
18620
- */
18621
- var DbConflictCause;
18622
- (function (DbConflictCause) {
18623
- DbConflictCause[DbConflictCause["Data"] = 1] = "Data";
18624
- DbConflictCause[DbConflictCause["NotFound"] = 2] = "NotFound";
18625
- DbConflictCause[DbConflictCause["Conflict"] = 3] = "Conflict";
18626
- DbConflictCause[DbConflictCause["Constraint"] = 4] = "Constraint";
18627
- DbConflictCause[DbConflictCause["ForeignKey"] = 5] = "ForeignKey";
18628
- })(DbConflictCause || (DbConflictCause = {}));
18629
- /** Conflict resolution strategy
18630
- * @internal
18631
- */
18632
- var DbConflictResolution;
18633
- (function (DbConflictResolution) {
18634
- /** Skip incoming change */
18635
- DbConflictResolution[DbConflictResolution["Skip"] = 0] = "Skip";
18636
- /** Replace local row with incoming changed row */
18637
- DbConflictResolution[DbConflictResolution["Replace"] = 1] = "Replace";
18638
- /** Abort apply changeset */
18639
- DbConflictResolution[DbConflictResolution["Abort"] = 2] = "Abort";
18640
- })(DbConflictResolution || (DbConflictResolution = {}));
18641
18595
  /** Values for return codes from BeSQLite functions. Consult SQLite documentation for further explanations.
18642
18596
  * @public
18643
18597
  */
@@ -18815,10 +18769,10 @@ __webpack_require__.r(__webpack_exports__);
18815
18769
  /* harmony export */ "IModelHubStatus": () => (/* binding */ IModelHubStatus),
18816
18770
  /* harmony export */ "IModelStatus": () => (/* binding */ IModelStatus),
18817
18771
  /* harmony export */ "RealityDataStatus": () => (/* binding */ RealityDataStatus),
18818
- /* harmony export */ "RepositoryStatus": () => (/* binding */ RepositoryStatus),
18819
18772
  /* harmony export */ "RpcInterfaceStatus": () => (/* binding */ RpcInterfaceStatus)
18820
18773
  /* harmony export */ });
18821
18774
  /* harmony import */ var _BeSQLite__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./BeSQLite */ "../bentley/lib/esm/BeSQLite.js");
18775
+ /* harmony import */ var _internal_RepositoryStatus__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./internal/RepositoryStatus */ "../bentley/lib/esm/internal/RepositoryStatus.js");
18822
18776
  /*---------------------------------------------------------------------------------------------
18823
18777
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
18824
18778
  * See LICENSE.md in the project root for license terms and full copyright notice.
@@ -18827,6 +18781,7 @@ __webpack_require__.r(__webpack_exports__);
18827
18781
  * @module Errors
18828
18782
  */
18829
18783
 
18784
+
18830
18785
  /** Standard status code.
18831
18786
  * This status code should be rarely used.
18832
18787
  * Prefer to throw an exception to indicate an error, rather than returning a special status code.
@@ -19004,43 +18959,6 @@ var ChangeSetStatus;
19004
18959
  /** ChangeSet(s) download was cancelled. */
19005
18960
  ChangeSetStatus[ChangeSetStatus["DownloadCancelled"] = 90138] = "DownloadCancelled";
19006
18961
  })(ChangeSetStatus || (ChangeSetStatus = {}));
19007
- /** Return codes for methods which perform repository management operations
19008
- * @internal
19009
- */
19010
- var RepositoryStatus;
19011
- (function (RepositoryStatus) {
19012
- RepositoryStatus[RepositoryStatus["Success"] = 0] = "Success";
19013
- /** The repository server did not respond to a request */
19014
- RepositoryStatus[RepositoryStatus["ServerUnavailable"] = 86017] = "ServerUnavailable";
19015
- /** A requested lock was already held by another briefcase */
19016
- RepositoryStatus[RepositoryStatus["LockAlreadyHeld"] = 86018] = "LockAlreadyHeld";
19017
- /** Failed to sync briefcase manager with server */
19018
- RepositoryStatus[RepositoryStatus["SyncError"] = 86019] = "SyncError";
19019
- /** Response from server not understood */
19020
- RepositoryStatus[RepositoryStatus["InvalidResponse"] = 86020] = "InvalidResponse";
19021
- /** An operation requires local changes to be committed or abandoned */
19022
- RepositoryStatus[RepositoryStatus["PendingTransactions"] = 86021] = "PendingTransactions";
19023
- /** A lock cannot be relinquished because the associated object has been modified */
19024
- RepositoryStatus[RepositoryStatus["LockUsed"] = 86022] = "LockUsed";
19025
- /** An operation required creation of a ChangeSet, which failed */
19026
- RepositoryStatus[RepositoryStatus["CannotCreateChangeSet"] = 86023] = "CannotCreateChangeSet";
19027
- /** Request to server not understood */
19028
- RepositoryStatus[RepositoryStatus["InvalidRequest"] = 86024] = "InvalidRequest";
19029
- /** A change set committed to the server must be integrated into the briefcase before the operation can be completed */
19030
- RepositoryStatus[RepositoryStatus["ChangeSetRequired"] = 86025] = "ChangeSetRequired";
19031
- /** A requested DgnCode is reserved by another briefcase or in use */
19032
- RepositoryStatus[RepositoryStatus["CodeUnavailable"] = 86026] = "CodeUnavailable";
19033
- /** A DgnCode cannot be released because it has not been reserved by the requesting briefcase */
19034
- RepositoryStatus[RepositoryStatus["CodeNotReserved"] = 86027] = "CodeNotReserved";
19035
- /** A DgnCode cannot be relinquished because it has been used locally */
19036
- RepositoryStatus[RepositoryStatus["CodeUsed"] = 86028] = "CodeUsed";
19037
- /** A required lock is not held by this briefcase */
19038
- RepositoryStatus[RepositoryStatus["LockNotHeld"] = 86029] = "LockNotHeld";
19039
- /** Repository is currently locked, no changes allowed */
19040
- RepositoryStatus[RepositoryStatus["RepositoryIsLocked"] = 86030] = "RepositoryIsLocked";
19041
- /** Channel write constraint violation, such as an attempt to write outside the designated channel. */
19042
- RepositoryStatus[RepositoryStatus["ChannelConstraintViolation"] = 86031] = "ChannelConstraintViolation";
19043
- })(RepositoryStatus || (RepositoryStatus = {}));
19044
18962
  /** Status from returned HTTP status code
19045
18963
  * @beta
19046
18964
  */
@@ -19370,21 +19288,21 @@ class BentleyError extends Error {
19370
19288
  case ChangeSetStatus.CannotMergeIntoMaster: return "Cannot merge changes into a Master DgnDb";
19371
19289
  case ChangeSetStatus.CannotMergeIntoReversed: return "Cannot merge changes into a DgnDb that has reversed change sets";
19372
19290
  case ChangeSetStatus.DownloadCancelled: return "ChangeSet(s) download was cancelled.";
19373
- case RepositoryStatus.ServerUnavailable: return "ServerUnavailable";
19374
- case RepositoryStatus.LockAlreadyHeld: return "LockAlreadyHeld";
19375
- case RepositoryStatus.SyncError: return "SyncError";
19376
- case RepositoryStatus.InvalidResponse: return "InvalidResponse";
19377
- case RepositoryStatus.PendingTransactions: return "PendingTransactions";
19378
- case RepositoryStatus.LockUsed: return "LockUsed";
19379
- case RepositoryStatus.CannotCreateChangeSet: return "CannotCreateChangeSet";
19380
- case RepositoryStatus.InvalidRequest: return "InvalidRequest";
19381
- case RepositoryStatus.ChangeSetRequired: return "ChangeSetRequired";
19382
- case RepositoryStatus.CodeUnavailable: return "CodeUnavailable";
19383
- case RepositoryStatus.CodeNotReserved: return "CodeNotReserved";
19384
- case RepositoryStatus.CodeUsed: return "CodeUsed";
19385
- case RepositoryStatus.LockNotHeld: return "LockNotHeld";
19386
- case RepositoryStatus.RepositoryIsLocked: return "RepositoryIsLocked";
19387
- case RepositoryStatus.ChannelConstraintViolation: return "ChannelConstraintViolation";
19291
+ case _internal_RepositoryStatus__WEBPACK_IMPORTED_MODULE_1__.RepositoryStatus.ServerUnavailable: return "ServerUnavailable";
19292
+ case _internal_RepositoryStatus__WEBPACK_IMPORTED_MODULE_1__.RepositoryStatus.LockAlreadyHeld: return "LockAlreadyHeld";
19293
+ case _internal_RepositoryStatus__WEBPACK_IMPORTED_MODULE_1__.RepositoryStatus.SyncError: return "SyncError";
19294
+ case _internal_RepositoryStatus__WEBPACK_IMPORTED_MODULE_1__.RepositoryStatus.InvalidResponse: return "InvalidResponse";
19295
+ case _internal_RepositoryStatus__WEBPACK_IMPORTED_MODULE_1__.RepositoryStatus.PendingTransactions: return "PendingTransactions";
19296
+ case _internal_RepositoryStatus__WEBPACK_IMPORTED_MODULE_1__.RepositoryStatus.LockUsed: return "LockUsed";
19297
+ case _internal_RepositoryStatus__WEBPACK_IMPORTED_MODULE_1__.RepositoryStatus.CannotCreateChangeSet: return "CannotCreateChangeSet";
19298
+ case _internal_RepositoryStatus__WEBPACK_IMPORTED_MODULE_1__.RepositoryStatus.InvalidRequest: return "InvalidRequest";
19299
+ case _internal_RepositoryStatus__WEBPACK_IMPORTED_MODULE_1__.RepositoryStatus.ChangeSetRequired: return "ChangeSetRequired";
19300
+ case _internal_RepositoryStatus__WEBPACK_IMPORTED_MODULE_1__.RepositoryStatus.CodeUnavailable: return "CodeUnavailable";
19301
+ case _internal_RepositoryStatus__WEBPACK_IMPORTED_MODULE_1__.RepositoryStatus.CodeNotReserved: return "CodeNotReserved";
19302
+ case _internal_RepositoryStatus__WEBPACK_IMPORTED_MODULE_1__.RepositoryStatus.CodeUsed: return "CodeUsed";
19303
+ case _internal_RepositoryStatus__WEBPACK_IMPORTED_MODULE_1__.RepositoryStatus.LockNotHeld: return "LockNotHeld";
19304
+ case _internal_RepositoryStatus__WEBPACK_IMPORTED_MODULE_1__.RepositoryStatus.RepositoryIsLocked: return "RepositoryIsLocked";
19305
+ case _internal_RepositoryStatus__WEBPACK_IMPORTED_MODULE_1__.RepositoryStatus.ChannelConstraintViolation: return "ChannelConstraintViolation";
19388
19306
  case HttpStatus.Info: return "HTTP Info";
19389
19307
  case HttpStatus.Redirection: return "HTTP Redirection";
19390
19308
  case HttpStatus.ClientError: return "HTTP Client error";
@@ -21945,8 +21863,10 @@ __webpack_require__.r(__webpack_exports__);
21945
21863
  /* harmony export */ "Logger": () => (/* binding */ Logger),
21946
21864
  /* harmony export */ "PerfLogger": () => (/* binding */ PerfLogger)
21947
21865
  /* harmony export */ });
21948
- /* harmony import */ var _BentleyError__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./BentleyError */ "../bentley/lib/esm/BentleyError.js");
21949
- /* harmony import */ var _BentleyLoggerCategory__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./BentleyLoggerCategory */ "../bentley/lib/esm/BentleyLoggerCategory.js");
21866
+ /* harmony import */ var _BeEvent__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./BeEvent */ "../bentley/lib/esm/BeEvent.js");
21867
+ /* harmony import */ var _BentleyError__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./BentleyError */ "../bentley/lib/esm/BentleyError.js");
21868
+ /* harmony import */ var _BentleyLoggerCategory__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./BentleyLoggerCategory */ "../bentley/lib/esm/BentleyLoggerCategory.js");
21869
+ /* harmony import */ var _internal_staticLoggerMetadata__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./internal/staticLoggerMetadata */ "../bentley/lib/esm/internal/staticLoggerMetadata.js");
21950
21870
  /*---------------------------------------------------------------------------------------------
21951
21871
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
21952
21872
  * See LICENSE.md in the project root for license terms and full copyright notice.
@@ -21956,6 +21876,8 @@ __webpack_require__.r(__webpack_exports__);
21956
21876
  */
21957
21877
 
21958
21878
 
21879
+
21880
+
21959
21881
  /** Use to categorize logging messages by severity.
21960
21882
  * @public
21961
21883
  */
@@ -21977,13 +21899,29 @@ var LogLevel;
21977
21899
  * @public
21978
21900
  */
21979
21901
  class Logger {
21980
- /** @internal */
21902
+ /** An event raised whenever [[setLevel]] or [[setLevelDefault]] is called. */
21903
+ static get onLogLevelChanged() {
21904
+ // We have to lazily initialize because it's static and BeEvent imports UnexpectedErrors which imports Logger which wants to instantiate BeEvent.
21905
+ if (undefined === Logger._onLogLevelChanged) {
21906
+ Logger._onLogLevelChanged = new _BeEvent__WEBPACK_IMPORTED_MODULE_0__.BeEvent();
21907
+ }
21908
+ return Logger._onLogLevelChanged;
21909
+ }
21910
+ /** Maps category names to the least severe level at which messages in that category should be displayed,
21911
+ * or `undefined` if a minimum has not been defined.
21912
+ * @see [[setLevel]] to change the minimum logging level for a category.
21913
+ */
21981
21914
  static get categoryFilter() {
21982
- return { ...Logger._categoryFilter };
21915
+ // NOTE: this property is accessed by native code.
21916
+ return this._categoryFilter;
21983
21917
  }
21984
- /** @internal */
21918
+ /** The least severe level at which messages should be displayed by default.
21919
+ * @see [[setLevelDefault]] to change this default.
21920
+ * @see [[setLevel]] to override this default for specific categories.
21921
+ */
21985
21922
  static get minLevel() {
21986
- return Logger._minLevel;
21923
+ // NOTE: this property is accessed by native code. */
21924
+ return this._minLevel;
21987
21925
  }
21988
21926
  /** Initialize the logger streams. Should be called at application initialization time. */
21989
21927
  static initialize(logError, logWarning, logInfo, logTrace) {
@@ -22002,12 +21940,12 @@ class Logger {
22002
21940
  /** merge the supplied metadata with all static metadata into one object */
22003
21941
  static getMetaData(metaData) {
22004
21942
  const metaObj = {};
22005
- for (const meta of Logger.staticMetaData) {
22006
- const val = _BentleyError__WEBPACK_IMPORTED_MODULE_0__.BentleyError.getMetaData(meta[1]);
21943
+ for (const meta of _internal_staticLoggerMetadata__WEBPACK_IMPORTED_MODULE_3__.staticLoggerMetadata) {
21944
+ const val = _BentleyError__WEBPACK_IMPORTED_MODULE_1__.BentleyError.getMetaData(meta[1]);
22007
21945
  if (val)
22008
21946
  Object.assign(metaObj, val);
22009
21947
  }
22010
- Object.assign(metaObj, _BentleyError__WEBPACK_IMPORTED_MODULE_0__.BentleyError.getMetaData(metaData)); // do this last so user supplied values take precedence
21948
+ Object.assign(metaObj, _BentleyError__WEBPACK_IMPORTED_MODULE_1__.BentleyError.getMetaData(metaData)); // do this last so user supplied values take precedence
22011
21949
  return metaObj;
22012
21950
  }
22013
21951
  /** stringify the metadata for a log message by merging the supplied metadata with all static metadata into one object that is then `JSON.stringify`ed. */
@@ -22018,14 +21956,14 @@ class Logger {
22018
21956
  /** Set the least severe level at which messages should be displayed by default. Call setLevel to override this default setting for specific categories. */
22019
21957
  static setLevelDefault(minLevel) {
22020
21958
  this._minLevel = minLevel;
22021
- this.logLevelChangedFn?.();
21959
+ this.onLogLevelChanged.raiseEvent();
22022
21960
  }
22023
21961
  /** Set the minimum logging level for the specified category. The minimum level is least severe level at which messages in the
22024
21962
  * specified category should be displayed.
22025
21963
  */
22026
21964
  static setLevel(category, minLevel) {
22027
21965
  Logger._categoryFilter[category] = minLevel;
22028
- this.logLevelChangedFn?.();
21966
+ this.onLogLevelChanged.raiseEvent();
22029
21967
  }
22030
21968
  /** Interpret a string as the name of a LogLevel */
22031
21969
  static parseLogLevel(str) {
@@ -22060,20 +21998,20 @@ class Logger {
22060
21998
  const validProps = ["defaultLevel", "categoryLevels"];
22061
21999
  for (const prop of Object.keys(config)) {
22062
22000
  if (!validProps.includes(prop))
22063
- throw new _BentleyError__WEBPACK_IMPORTED_MODULE_0__.BentleyError(_BentleyError__WEBPACK_IMPORTED_MODULE_0__.IModelStatus.BadArg, `LoggerLevelsConfig - unrecognized property: ${prop}`);
22001
+ throw new _BentleyError__WEBPACK_IMPORTED_MODULE_1__.BentleyError(_BentleyError__WEBPACK_IMPORTED_MODULE_1__.IModelStatus.BadArg, `LoggerLevelsConfig - unrecognized property: ${prop}`);
22064
22002
  if (prop === "defaultLevel") {
22065
22003
  if (!Logger.isLogLevel(config.defaultLevel))
22066
- throw new _BentleyError__WEBPACK_IMPORTED_MODULE_0__.BentleyError(_BentleyError__WEBPACK_IMPORTED_MODULE_0__.IModelStatus.BadArg, `LoggerLevelsConfig.defaultLevel must be a LogLevel. Invalid value: ${JSON.stringify(config.defaultLevel)}`);
22004
+ throw new _BentleyError__WEBPACK_IMPORTED_MODULE_1__.BentleyError(_BentleyError__WEBPACK_IMPORTED_MODULE_1__.IModelStatus.BadArg, `LoggerLevelsConfig.defaultLevel must be a LogLevel. Invalid value: ${JSON.stringify(config.defaultLevel)}`);
22067
22005
  }
22068
22006
  else if (prop === "categoryLevels") {
22069
22007
  const value = config[prop];
22070
22008
  if (!Array.isArray(value))
22071
- throw new _BentleyError__WEBPACK_IMPORTED_MODULE_0__.BentleyError(_BentleyError__WEBPACK_IMPORTED_MODULE_0__.IModelStatus.BadArg, `LoggerLevelsConfig.categoryLevels must be an array. Invalid value: ${JSON.stringify(value)}`);
22009
+ throw new _BentleyError__WEBPACK_IMPORTED_MODULE_1__.BentleyError(_BentleyError__WEBPACK_IMPORTED_MODULE_1__.IModelStatus.BadArg, `LoggerLevelsConfig.categoryLevels must be an array. Invalid value: ${JSON.stringify(value)}`);
22072
22010
  for (const item of config[prop]) {
22073
22011
  if (!item.hasOwnProperty("category") || !item.hasOwnProperty("logLevel"))
22074
- throw new _BentleyError__WEBPACK_IMPORTED_MODULE_0__.BentleyError(_BentleyError__WEBPACK_IMPORTED_MODULE_0__.IModelStatus.BadArg, `LoggerLevelsConfig.categoryLevels - each item must be a LoggerCategoryAndLevel {category: logLevel:}. Invalid value: ${JSON.stringify(item)}`);
22012
+ throw new _BentleyError__WEBPACK_IMPORTED_MODULE_1__.BentleyError(_BentleyError__WEBPACK_IMPORTED_MODULE_1__.IModelStatus.BadArg, `LoggerLevelsConfig.categoryLevels - each item must be a LoggerCategoryAndLevel {category: logLevel:}. Invalid value: ${JSON.stringify(item)}`);
22075
22013
  if (!Logger.isLogLevel(item.logLevel))
22076
- throw new _BentleyError__WEBPACK_IMPORTED_MODULE_0__.BentleyError(_BentleyError__WEBPACK_IMPORTED_MODULE_0__.IModelStatus.BadArg, `LoggerLevelsConfig.categoryLevels - each item's logLevel property must be a LogLevel. Invalid value: ${JSON.stringify(item.logLevel)}`);
22014
+ throw new _BentleyError__WEBPACK_IMPORTED_MODULE_1__.BentleyError(_BentleyError__WEBPACK_IMPORTED_MODULE_1__.IModelStatus.BadArg, `LoggerLevelsConfig.categoryLevels - each item's logLevel property must be a LogLevel. Invalid value: ${JSON.stringify(item.logLevel)}`);
22077
22015
  }
22078
22016
  }
22079
22017
  }
@@ -22081,7 +22019,7 @@ class Logger {
22081
22019
  /** Get the minimum logging level for the specified category. */
22082
22020
  static getLevel(category) {
22083
22021
  // Prefer the level set for this category specifically
22084
- const minLevelForThisCategory = Logger._categoryFilter[category];
22022
+ const minLevelForThisCategory = Logger.categoryFilter[category];
22085
22023
  if (minLevelForThisCategory !== undefined)
22086
22024
  return minLevelForThisCategory;
22087
22025
  // Fall back on the level set for the parent of this category.
@@ -22089,7 +22027,7 @@ class Logger {
22089
22027
  if (parent !== -1)
22090
22028
  return Logger.getLevel(category.slice(0, parent));
22091
22029
  // Fall back on the default level.
22092
- return Logger._minLevel;
22030
+ return Logger.minLevel;
22093
22031
  }
22094
22032
  /** Turns off the least severe level at which messages should be displayed by default.
22095
22033
  * This turns off logging for all messages for which no category minimum level is defined.
@@ -22117,8 +22055,8 @@ class Logger {
22117
22055
  Logger._logError(category, message, metaData);
22118
22056
  }
22119
22057
  static getExceptionMessage(err) {
22120
- const stack = Logger.logExceptionCallstacks ? `\n${_BentleyError__WEBPACK_IMPORTED_MODULE_0__.BentleyError.getErrorStack(err)}` : "";
22121
- return _BentleyError__WEBPACK_IMPORTED_MODULE_0__.BentleyError.getErrorMessage(err) + stack;
22058
+ const stack = Logger.logExceptionCallstacks ? `\n${_BentleyError__WEBPACK_IMPORTED_MODULE_1__.BentleyError.getErrorStack(err)}` : "";
22059
+ return _BentleyError__WEBPACK_IMPORTED_MODULE_1__.BentleyError.getErrorMessage(err) + stack;
22122
22060
  }
22123
22061
  /** Log the specified exception. The special "ExceptionType" property will be added as metadata.
22124
22062
  * @param category The category of the message.
@@ -22127,7 +22065,7 @@ class Logger {
22127
22065
  */
22128
22066
  static logException(category, err, log = (_category, message, metaData) => Logger.logError(_category, message, metaData)) {
22129
22067
  log(category, Logger.getExceptionMessage(err), () => {
22130
- return { ..._BentleyError__WEBPACK_IMPORTED_MODULE_0__.BentleyError.getErrorMetadata(err), exceptionType: err.constructor.name };
22068
+ return { ..._BentleyError__WEBPACK_IMPORTED_MODULE_1__.BentleyError.getErrorMetadata(err), exceptionType: err.constructor.name };
22131
22069
  });
22132
22070
  }
22133
22071
  /** Log the specified message to the **warning** stream.
@@ -22161,11 +22099,6 @@ class Logger {
22161
22099
  Logger._categoryFilter = {};
22162
22100
  /** Should the call stack be included when an exception is logged? */
22163
22101
  Logger.logExceptionCallstacks = false;
22164
- /** All static metadata is combined with per-call metadata and stringified in every log message.
22165
- * Static metadata can either be an object or a function that returns an object.
22166
- * Use a key to identify entries in the map so the can be removed individually.
22167
- * @internal */
22168
- Logger.staticMetaData = new Map();
22169
22102
  /** Simple performance diagnostics utility.
22170
22103
  * It measures the time from construction to disposal. On disposal it logs the routine name along with
22171
22104
  * the duration in milliseconds.
@@ -22179,19 +22112,19 @@ class PerfLogger {
22179
22112
  constructor(operation, metaData) {
22180
22113
  this._operation = operation;
22181
22114
  this._metaData = metaData;
22182
- if (!Logger.isEnabled(_BentleyLoggerCategory__WEBPACK_IMPORTED_MODULE_1__.BentleyLoggerCategory.Performance, PerfLogger._severity)) {
22115
+ if (!Logger.isEnabled(_BentleyLoggerCategory__WEBPACK_IMPORTED_MODULE_2__.BentleyLoggerCategory.Performance, PerfLogger._severity)) {
22183
22116
  this._startTimeStamp = 0;
22184
22117
  return;
22185
22118
  }
22186
- Logger.logInfo(_BentleyLoggerCategory__WEBPACK_IMPORTED_MODULE_1__.BentleyLoggerCategory.Performance, `${this._operation},START`, this._metaData);
22119
+ Logger.logInfo(_BentleyLoggerCategory__WEBPACK_IMPORTED_MODULE_2__.BentleyLoggerCategory.Performance, `${this._operation},START`, this._metaData);
22187
22120
  this._startTimeStamp = new Date().getTime(); // take timestamp
22188
22121
  }
22189
22122
  logMessage() {
22190
22123
  const endTimeStamp = new Date().getTime();
22191
- if (!Logger.isEnabled(_BentleyLoggerCategory__WEBPACK_IMPORTED_MODULE_1__.BentleyLoggerCategory.Performance, PerfLogger._severity))
22124
+ if (!Logger.isEnabled(_BentleyLoggerCategory__WEBPACK_IMPORTED_MODULE_2__.BentleyLoggerCategory.Performance, PerfLogger._severity))
22192
22125
  return;
22193
- Logger.logInfo(_BentleyLoggerCategory__WEBPACK_IMPORTED_MODULE_1__.BentleyLoggerCategory.Performance, `${this._operation},END`, () => {
22194
- const mdata = this._metaData ? _BentleyError__WEBPACK_IMPORTED_MODULE_0__.BentleyError.getMetaData(this._metaData) : {};
22126
+ Logger.logInfo(_BentleyLoggerCategory__WEBPACK_IMPORTED_MODULE_2__.BentleyLoggerCategory.Performance, `${this._operation},END`, () => {
22127
+ const mdata = this._metaData ? _BentleyError__WEBPACK_IMPORTED_MODULE_1__.BentleyError.getMetaData(this._metaData) : {};
22195
22128
  return {
22196
22129
  ...mdata, TimeElapsed: endTimeStamp - this._startTimeStamp, // eslint-disable-line @typescript-eslint/naming-convention
22197
22130
  };
@@ -22250,14 +22183,18 @@ class ObservableSet extends Set {
22250
22183
  return ret;
22251
22184
  };
22252
22185
  }
22253
- /** @internal */
22186
+ /** Invokes [Set.delete](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/delete), raising
22187
+ * the [[onDeleted]] event if the item was removed from the set.
22188
+ */
22254
22189
  delete(item) {
22255
22190
  const ret = super.delete(item);
22256
22191
  if (ret)
22257
22192
  this.onDeleted.raiseEvent(item);
22258
22193
  return ret;
22259
22194
  }
22260
- /** @internal */
22195
+ /** If this set is not already empty, invokes [Set.clear](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set/clear)
22196
+ * and raises the [[onCleared]] event.
22197
+ */
22261
22198
  clear() {
22262
22199
  if (0 !== this.size) {
22263
22200
  super.clear();
@@ -23274,6 +23211,7 @@ __webpack_require__.r(__webpack_exports__);
23274
23211
  /* harmony export */ "SuccessCategory": () => (/* binding */ SuccessCategory)
23275
23212
  /* harmony export */ });
23276
23213
  /* harmony import */ var _BentleyError__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./BentleyError */ "../bentley/lib/esm/BentleyError.js");
23214
+ /* harmony import */ var _internal_RepositoryStatus__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./internal/RepositoryStatus */ "../bentley/lib/esm/internal/RepositoryStatus.js");
23277
23215
  /*---------------------------------------------------------------------------------------------
23278
23216
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
23279
23217
  * See LICENSE.md in the project root for license terms and full copyright notice.
@@ -23282,6 +23220,7 @@ __webpack_require__.r(__webpack_exports__);
23282
23220
  * @module Errors
23283
23221
  */
23284
23222
 
23223
+
23285
23224
  /** A group of related statuses for aggregate reporting purposes.
23286
23225
  * @alpha
23287
23226
  */
@@ -23646,22 +23585,22 @@ function lookupHttpStatusCategory(statusCode) {
23646
23585
  case _BentleyError__WEBPACK_IMPORTED_MODULE_0__.ChangeSetStatus.CannotMergeIntoReadonly: return new ValidationError();
23647
23586
  case _BentleyError__WEBPACK_IMPORTED_MODULE_0__.ChangeSetStatus.CannotMergeIntoMaster: return new ValidationError();
23648
23587
  case _BentleyError__WEBPACK_IMPORTED_MODULE_0__.ChangeSetStatus.CannotMergeIntoReversed: return new ValidationError();
23649
- case _BentleyError__WEBPACK_IMPORTED_MODULE_0__.RepositoryStatus.Success: return new Success();
23650
- case _BentleyError__WEBPACK_IMPORTED_MODULE_0__.RepositoryStatus.ServerUnavailable: return new NetworkError();
23651
- case _BentleyError__WEBPACK_IMPORTED_MODULE_0__.RepositoryStatus.LockAlreadyHeld: return new Conflict();
23652
- case _BentleyError__WEBPACK_IMPORTED_MODULE_0__.RepositoryStatus.SyncError: return new NetworkError();
23653
- case _BentleyError__WEBPACK_IMPORTED_MODULE_0__.RepositoryStatus.InvalidResponse: return new NetworkError();
23654
- case _BentleyError__WEBPACK_IMPORTED_MODULE_0__.RepositoryStatus.PendingTransactions: return new StateViolation();
23655
- case _BentleyError__WEBPACK_IMPORTED_MODULE_0__.RepositoryStatus.LockUsed: return new StateViolation();
23656
- case _BentleyError__WEBPACK_IMPORTED_MODULE_0__.RepositoryStatus.CannotCreateChangeSet: return new InternalError();
23657
- case _BentleyError__WEBPACK_IMPORTED_MODULE_0__.RepositoryStatus.InvalidRequest: return new NetworkError();
23658
- case _BentleyError__WEBPACK_IMPORTED_MODULE_0__.RepositoryStatus.ChangeSetRequired: return new StateViolation();
23659
- case _BentleyError__WEBPACK_IMPORTED_MODULE_0__.RepositoryStatus.CodeUnavailable: return new Conflict();
23660
- case _BentleyError__WEBPACK_IMPORTED_MODULE_0__.RepositoryStatus.CodeNotReserved: return new StateViolation();
23661
- case _BentleyError__WEBPACK_IMPORTED_MODULE_0__.RepositoryStatus.CodeUsed: return new StateViolation();
23662
- case _BentleyError__WEBPACK_IMPORTED_MODULE_0__.RepositoryStatus.LockNotHeld: return new Forbidden();
23663
- case _BentleyError__WEBPACK_IMPORTED_MODULE_0__.RepositoryStatus.RepositoryIsLocked: return new Locked();
23664
- case _BentleyError__WEBPACK_IMPORTED_MODULE_0__.RepositoryStatus.ChannelConstraintViolation: return new ConstraintViolation();
23588
+ case _internal_RepositoryStatus__WEBPACK_IMPORTED_MODULE_1__.RepositoryStatus.Success: return new Success();
23589
+ case _internal_RepositoryStatus__WEBPACK_IMPORTED_MODULE_1__.RepositoryStatus.ServerUnavailable: return new NetworkError();
23590
+ case _internal_RepositoryStatus__WEBPACK_IMPORTED_MODULE_1__.RepositoryStatus.LockAlreadyHeld: return new Conflict();
23591
+ case _internal_RepositoryStatus__WEBPACK_IMPORTED_MODULE_1__.RepositoryStatus.SyncError: return new NetworkError();
23592
+ case _internal_RepositoryStatus__WEBPACK_IMPORTED_MODULE_1__.RepositoryStatus.InvalidResponse: return new NetworkError();
23593
+ case _internal_RepositoryStatus__WEBPACK_IMPORTED_MODULE_1__.RepositoryStatus.PendingTransactions: return new StateViolation();
23594
+ case _internal_RepositoryStatus__WEBPACK_IMPORTED_MODULE_1__.RepositoryStatus.LockUsed: return new StateViolation();
23595
+ case _internal_RepositoryStatus__WEBPACK_IMPORTED_MODULE_1__.RepositoryStatus.CannotCreateChangeSet: return new InternalError();
23596
+ case _internal_RepositoryStatus__WEBPACK_IMPORTED_MODULE_1__.RepositoryStatus.InvalidRequest: return new NetworkError();
23597
+ case _internal_RepositoryStatus__WEBPACK_IMPORTED_MODULE_1__.RepositoryStatus.ChangeSetRequired: return new StateViolation();
23598
+ case _internal_RepositoryStatus__WEBPACK_IMPORTED_MODULE_1__.RepositoryStatus.CodeUnavailable: return new Conflict();
23599
+ case _internal_RepositoryStatus__WEBPACK_IMPORTED_MODULE_1__.RepositoryStatus.CodeNotReserved: return new StateViolation();
23600
+ case _internal_RepositoryStatus__WEBPACK_IMPORTED_MODULE_1__.RepositoryStatus.CodeUsed: return new StateViolation();
23601
+ case _internal_RepositoryStatus__WEBPACK_IMPORTED_MODULE_1__.RepositoryStatus.LockNotHeld: return new Forbidden();
23602
+ case _internal_RepositoryStatus__WEBPACK_IMPORTED_MODULE_1__.RepositoryStatus.RepositoryIsLocked: return new Locked();
23603
+ case _internal_RepositoryStatus__WEBPACK_IMPORTED_MODULE_1__.RepositoryStatus.ChannelConstraintViolation: return new ConstraintViolation();
23665
23604
  case _BentleyError__WEBPACK_IMPORTED_MODULE_0__.HttpStatus.Success: return new Success();
23666
23605
  case _BentleyError__WEBPACK_IMPORTED_MODULE_0__.IModelHubStatus.Success: return new Success();
23667
23606
  case _BentleyError__WEBPACK_IMPORTED_MODULE_0__.IModelHubStatus.Unknown: return new UnknownError();
@@ -23748,8 +23687,7 @@ function lookupHttpStatusCategory(statusCode) {
23748
23687
  __webpack_require__.r(__webpack_exports__);
23749
23688
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
23750
23689
  /* harmony export */ "base64StringToUint8Array": () => (/* binding */ base64StringToUint8Array),
23751
- /* harmony export */ "utf8ToString": () => (/* binding */ utf8ToString),
23752
- /* harmony export */ "utf8ToStringPolyfill": () => (/* binding */ utf8ToStringPolyfill)
23690
+ /* harmony export */ "utf8ToString": () => (/* binding */ utf8ToString)
23753
23691
  /* harmony export */ });
23754
23692
  /*---------------------------------------------------------------------------------------------
23755
23693
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
@@ -23758,110 +23696,6 @@ __webpack_require__.r(__webpack_exports__);
23758
23696
  /** @packageDocumentation
23759
23697
  * @module Utils
23760
23698
  */
23761
- // TextDecoder is not supported on all platforms - this is an alternative for utf-8.
23762
- // From https://github.com/AnalyticalGraphicsInc/cesium/blob/master/Source/Core/getStringFromTypedArray.js
23763
- // which is itself inspired by https://github.com/inexorabletash/text-encoding
23764
- /** @internal */
23765
- var Utf8ToString;
23766
- (function (Utf8ToString) {
23767
- function inRange(a, min, max) {
23768
- return min <= a && a <= max;
23769
- }
23770
- function utf8Handler(bytes) {
23771
- let codePoint = 0;
23772
- let bytesSeen = 0;
23773
- let bytesNeeded = 0;
23774
- let lowerBoundary = 0x80;
23775
- let upperBoundary = 0xbf;
23776
- const codePoints = [];
23777
- const length = bytes.length;
23778
- for (let i = 0; i < length; i++) {
23779
- const currentByte = bytes[i];
23780
- // If bytesNeeded = 0, then we are starting a new character
23781
- if (0 === bytesNeeded) {
23782
- // 1 byte ascii character
23783
- if (inRange(currentByte, 0x00, 0x7f)) {
23784
- // return a code point whose value is byte.
23785
- codePoints.push(currentByte);
23786
- continue;
23787
- }
23788
- // 2 byte character
23789
- if (inRange(currentByte, 0xc2, 0xdf)) {
23790
- bytesNeeded = 1;
23791
- codePoint = currentByte & 0x1f;
23792
- continue;
23793
- }
23794
- // 3 byte character
23795
- if (inRange(currentByte, 0xe0, 0xef)) {
23796
- if (0xe0 === currentByte)
23797
- lowerBoundary = 0xa0;
23798
- else if (0xed === currentByte)
23799
- upperBoundary = 0x9f;
23800
- bytesNeeded = 2;
23801
- codePoint = currentByte & 0xf;
23802
- continue;
23803
- }
23804
- // 4 byte character
23805
- if (inRange(currentByte, 0xf0, 0xf4)) {
23806
- if (0xf0 === currentByte)
23807
- lowerBoundary = 0x90;
23808
- else if (0xf4 === currentByte)
23809
- upperBoundary = 0x8f;
23810
- bytesNeeded = 3;
23811
- codePoint = currentByte & 0x7;
23812
- continue;
23813
- }
23814
- // invalid utf-8
23815
- return undefined;
23816
- }
23817
- // out of range so ignore the first part(s) of the character and continue with this byte on its own
23818
- if (!inRange(currentByte, lowerBoundary, upperBoundary)) {
23819
- codePoint = bytesNeeded = bytesSeen = 0;
23820
- lowerBoundary = 0x80;
23821
- upperBoundary = 0xbf;
23822
- --i;
23823
- continue;
23824
- }
23825
- // set appropriate boundaries since we've now checked byte 2 of a potential longer character
23826
- lowerBoundary = 0x80;
23827
- upperBoundary = 0xbf;
23828
- // add byte to code point
23829
- codePoint = (codePoint << 6) | (currentByte & 0x3f);
23830
- // We have the correct number of bytes, so push and reset for next character
23831
- ++bytesSeen;
23832
- if (bytesSeen === bytesNeeded) {
23833
- codePoints.push(codePoint);
23834
- codePoint = bytesNeeded = bytesSeen = 0;
23835
- }
23836
- }
23837
- return codePoints;
23838
- }
23839
- function decodeWithFromCharCode(view) {
23840
- let result = "";
23841
- const codePoints = utf8Handler(view);
23842
- if (undefined === codePoints)
23843
- return undefined;
23844
- for (let cp of codePoints) {
23845
- if (cp <= 0xffff) {
23846
- result += String.fromCharCode(cp);
23847
- }
23848
- else {
23849
- cp -= 0x10000;
23850
- result += String.fromCharCode((cp >> 10) + 0xd800, (cp & 0x3ff) + 0xdc00);
23851
- }
23852
- }
23853
- return result;
23854
- }
23855
- Utf8ToString.decodeWithFromCharCode = decodeWithFromCharCode;
23856
- })(Utf8ToString || (Utf8ToString = {}));
23857
- /** Exposed only for testing the fall-back used when TextDecoder is unsupported.
23858
- * @internal
23859
- */
23860
- function utf8ToStringPolyfill(utf8) {
23861
- return Utf8ToString.decodeWithFromCharCode(utf8);
23862
- }
23863
- // TextDecoder unsupported in Edge at time of writing.
23864
- let textDecoderSupported = true;
23865
23699
  /** Given an array of bytes containing a utf-8 string, convert to a string.
23866
23700
  * @param utf8: An array of utf-8 characters as a byte array
23867
23701
  * @returns An equivalent string, or undefined if the array does not contain a valid utf-8 string.
@@ -23870,19 +23704,8 @@ let textDecoderSupported = true;
23870
23704
  * @public
23871
23705
  */
23872
23706
  function utf8ToString(utf8) {
23873
- let decoder;
23874
- if (textDecoderSupported) {
23875
- try {
23876
- decoder = new TextDecoder("utf-8");
23877
- }
23878
- catch (_ex) {
23879
- textDecoderSupported = false;
23880
- }
23881
- }
23882
- if (undefined !== decoder)
23883
- return decoder.decode(utf8);
23884
- else
23885
- return utf8ToStringPolyfill(utf8);
23707
+ const decoder = new TextDecoder("utf-8");
23708
+ return decoder.decode(utf8);
23886
23709
  }
23887
23710
  /** Given a base-64-encoded string, decode it into an array of bytes.
23888
23711
  * @param base64 The base-64-encoded string.
@@ -24180,7 +24003,6 @@ class Tracing {
24180
24003
  /**
24181
24004
  * Adds a span event describing a runtime exception, as advised in OpenTelemetry documentation
24182
24005
  * @param e error (exception) object
24183
- * @internal
24184
24006
  */
24185
24007
  static recordException(e) {
24186
24008
  Tracing._openTelemetry?.trace.getSpan(Tracing._openTelemetry.context.active())?.recordException(e);
@@ -24745,7 +24567,6 @@ class YieldManager {
24745
24567
  await this.actualYield();
24746
24568
  }
24747
24569
  }
24748
- /** @internal */
24749
24570
  async actualYield() {
24750
24571
  await new Promise((r) => setTimeout(r, 0));
24751
24572
  }
@@ -24776,12 +24597,12 @@ __webpack_require__.r(__webpack_exports__);
24776
24597
  /* harmony export */ "ByteStream": () => (/* reexport safe */ _ByteStream__WEBPACK_IMPORTED_MODULE_7__.ByteStream),
24777
24598
  /* harmony export */ "ChangeSetStatus": () => (/* reexport safe */ _BentleyError__WEBPACK_IMPORTED_MODULE_3__.ChangeSetStatus),
24778
24599
  /* harmony export */ "CompressedId64Set": () => (/* reexport safe */ _CompressedId64Set__WEBPACK_IMPORTED_MODULE_10__.CompressedId64Set),
24779
- /* harmony export */ "DbChangeStage": () => (/* reexport safe */ _BeSQLite__WEBPACK_IMPORTED_MODULE_6__.DbChangeStage),
24780
- /* harmony export */ "DbConflictCause": () => (/* reexport safe */ _BeSQLite__WEBPACK_IMPORTED_MODULE_6__.DbConflictCause),
24781
- /* harmony export */ "DbConflictResolution": () => (/* reexport safe */ _BeSQLite__WEBPACK_IMPORTED_MODULE_6__.DbConflictResolution),
24600
+ /* harmony export */ "DbChangeStage": () => (/* reexport safe */ _internal_cross_package__WEBPACK_IMPORTED_MODULE_35__.DbChangeStage),
24601
+ /* harmony export */ "DbConflictCause": () => (/* reexport safe */ _internal_cross_package__WEBPACK_IMPORTED_MODULE_35__.DbConflictCause),
24602
+ /* harmony export */ "DbConflictResolution": () => (/* reexport safe */ _internal_cross_package__WEBPACK_IMPORTED_MODULE_35__.DbConflictResolution),
24782
24603
  /* harmony export */ "DbOpcode": () => (/* reexport safe */ _BeSQLite__WEBPACK_IMPORTED_MODULE_6__.DbOpcode),
24783
24604
  /* harmony export */ "DbResult": () => (/* reexport safe */ _BeSQLite__WEBPACK_IMPORTED_MODULE_6__.DbResult),
24784
- /* harmony export */ "DbValueType": () => (/* reexport safe */ _BeSQLite__WEBPACK_IMPORTED_MODULE_6__.DbValueType),
24605
+ /* harmony export */ "DbValueType": () => (/* reexport safe */ _internal_cross_package__WEBPACK_IMPORTED_MODULE_35__.DbValueType),
24785
24606
  /* harmony export */ "Dictionary": () => (/* reexport safe */ _Dictionary__WEBPACK_IMPORTED_MODULE_11__.Dictionary),
24786
24607
  /* harmony export */ "DisposableList": () => (/* reexport safe */ _Disposable__WEBPACK_IMPORTED_MODULE_12__.DisposableList),
24787
24608
  /* harmony export */ "DuplicatePolicy": () => (/* reexport safe */ _SortedArray__WEBPACK_IMPORTED_MODULE_26__.DuplicatePolicy),
@@ -24814,7 +24635,7 @@ __webpack_require__.r(__webpack_exports__);
24814
24635
  /* harmony export */ "ReadonlyOrderedSet": () => (/* reexport safe */ _OrderedSet__WEBPACK_IMPORTED_MODULE_22__.ReadonlyOrderedSet),
24815
24636
  /* harmony export */ "ReadonlySortedArray": () => (/* reexport safe */ _SortedArray__WEBPACK_IMPORTED_MODULE_26__.ReadonlySortedArray),
24816
24637
  /* harmony export */ "RealityDataStatus": () => (/* reexport safe */ _BentleyError__WEBPACK_IMPORTED_MODULE_3__.RealityDataStatus),
24817
- /* harmony export */ "RepositoryStatus": () => (/* reexport safe */ _BentleyError__WEBPACK_IMPORTED_MODULE_3__.RepositoryStatus),
24638
+ /* harmony export */ "RepositoryStatus": () => (/* reexport safe */ _internal_cross_package__WEBPACK_IMPORTED_MODULE_35__.RepositoryStatus),
24818
24639
  /* harmony export */ "RpcInterfaceStatus": () => (/* reexport safe */ _BentleyError__WEBPACK_IMPORTED_MODULE_3__.RpcInterfaceStatus),
24819
24640
  /* harmony export */ "SortedArray": () => (/* reexport safe */ _SortedArray__WEBPACK_IMPORTED_MODULE_26__.SortedArray),
24820
24641
  /* harmony export */ "SpanKind": () => (/* reexport safe */ _Tracing__WEBPACK_IMPORTED_MODULE_29__.SpanKind),
@@ -24853,9 +24674,9 @@ __webpack_require__.r(__webpack_exports__);
24853
24674
  /* harmony export */ "omit": () => (/* reexport safe */ _UtilityTypes__WEBPACK_IMPORTED_MODULE_33__.omit),
24854
24675
  /* harmony export */ "partitionArray": () => (/* reexport safe */ _partitionArray__WEBPACK_IMPORTED_MODULE_23__.partitionArray),
24855
24676
  /* harmony export */ "shallowClone": () => (/* reexport safe */ _SortedArray__WEBPACK_IMPORTED_MODULE_26__.shallowClone),
24677
+ /* harmony export */ "staticLoggerMetadata": () => (/* reexport safe */ _internal_cross_package__WEBPACK_IMPORTED_MODULE_35__.staticLoggerMetadata),
24856
24678
  /* harmony export */ "using": () => (/* reexport safe */ _Disposable__WEBPACK_IMPORTED_MODULE_12__.using),
24857
- /* harmony export */ "utf8ToString": () => (/* reexport safe */ _StringUtils__WEBPACK_IMPORTED_MODULE_27__.utf8ToString),
24858
- /* harmony export */ "utf8ToStringPolyfill": () => (/* reexport safe */ _StringUtils__WEBPACK_IMPORTED_MODULE_27__.utf8ToStringPolyfill)
24679
+ /* harmony export */ "utf8ToString": () => (/* reexport safe */ _StringUtils__WEBPACK_IMPORTED_MODULE_27__.utf8ToString)
24859
24680
  /* harmony export */ });
24860
24681
  /* harmony import */ var _AccessToken__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AccessToken */ "../bentley/lib/esm/AccessToken.js");
24861
24682
  /* harmony import */ var _Assert__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Assert */ "../bentley/lib/esm/Assert.js");
@@ -24892,6 +24713,7 @@ __webpack_require__.r(__webpack_exports__);
24892
24713
  /* harmony import */ var _UnexpectedErrors__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./UnexpectedErrors */ "../bentley/lib/esm/UnexpectedErrors.js");
24893
24714
  /* harmony import */ var _UtilityTypes__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./UtilityTypes */ "../bentley/lib/esm/UtilityTypes.js");
24894
24715
  /* harmony import */ var _YieldManager__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./YieldManager */ "../bentley/lib/esm/YieldManager.js");
24716
+ /* harmony import */ var _internal_cross_package__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./internal/cross-package */ "../bentley/lib/esm/internal/cross-package.js");
24895
24717
  /*---------------------------------------------------------------------------------------------
24896
24718
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
24897
24719
  * See LICENSE.md in the project root for license terms and full copyright notice.
@@ -24930,6 +24752,8 @@ __webpack_require__.r(__webpack_exports__);
24930
24752
 
24931
24753
 
24932
24754
 
24755
+
24756
+ // Temporarily (until 5.0) export top-level internal APIs to avoid breaking callers.
24933
24757
 
24934
24758
  /** @docs-package-description
24935
24759
  * The core-bentley package contains classes to solve problems that are common for both client and server use cases.
@@ -24972,6 +24796,184 @@ __webpack_require__.r(__webpack_exports__);
24972
24796
  */
24973
24797
 
24974
24798
 
24799
+ /***/ }),
24800
+
24801
+ /***/ "../bentley/lib/esm/internal/BeSQLiteInternal.js":
24802
+ /*!*******************************************************!*\
24803
+ !*** ../bentley/lib/esm/internal/BeSQLiteInternal.js ***!
24804
+ \*******************************************************/
24805
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
24806
+
24807
+ "use strict";
24808
+ __webpack_require__.r(__webpack_exports__);
24809
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
24810
+ /* harmony export */ "DbChangeStage": () => (/* binding */ DbChangeStage),
24811
+ /* harmony export */ "DbConflictCause": () => (/* binding */ DbConflictCause),
24812
+ /* harmony export */ "DbConflictResolution": () => (/* binding */ DbConflictResolution),
24813
+ /* harmony export */ "DbValueType": () => (/* binding */ DbValueType)
24814
+ /* harmony export */ });
24815
+ /*---------------------------------------------------------------------------------------------
24816
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
24817
+ * See LICENSE.md in the project root for license terms and full copyright notice.
24818
+ *--------------------------------------------------------------------------------------------*/
24819
+ /** @packageDocumentation
24820
+ * @module BeSQLite
24821
+ */
24822
+ /** @internal */
24823
+ var DbChangeStage;
24824
+ (function (DbChangeStage) {
24825
+ DbChangeStage[DbChangeStage["Old"] = 0] = "Old";
24826
+ DbChangeStage[DbChangeStage["New"] = 1] = "New";
24827
+ })(DbChangeStage || (DbChangeStage = {}));
24828
+ /** @internal */
24829
+ var DbValueType;
24830
+ (function (DbValueType) {
24831
+ DbValueType[DbValueType["IntegerVal"] = 1] = "IntegerVal";
24832
+ DbValueType[DbValueType["FloatVal"] = 2] = "FloatVal";
24833
+ DbValueType[DbValueType["TextVal"] = 3] = "TextVal";
24834
+ DbValueType[DbValueType["BlobVal"] = 4] = "BlobVal";
24835
+ DbValueType[DbValueType["NullVal"] = 5] = "NullVal";
24836
+ })(DbValueType || (DbValueType = {}));
24837
+ /** Cause of conflict when applying a changeset.
24838
+ * @internal
24839
+ */
24840
+ var DbConflictCause;
24841
+ (function (DbConflictCause) {
24842
+ DbConflictCause[DbConflictCause["Data"] = 1] = "Data";
24843
+ DbConflictCause[DbConflictCause["NotFound"] = 2] = "NotFound";
24844
+ DbConflictCause[DbConflictCause["Conflict"] = 3] = "Conflict";
24845
+ DbConflictCause[DbConflictCause["Constraint"] = 4] = "Constraint";
24846
+ DbConflictCause[DbConflictCause["ForeignKey"] = 5] = "ForeignKey";
24847
+ })(DbConflictCause || (DbConflictCause = {}));
24848
+ /** @internal */
24849
+ var DbConflictResolution;
24850
+ (function (DbConflictResolution) {
24851
+ /** Skip incoming change */
24852
+ DbConflictResolution[DbConflictResolution["Skip"] = 0] = "Skip";
24853
+ /** Replace local row with incoming changed row */
24854
+ DbConflictResolution[DbConflictResolution["Replace"] = 1] = "Replace";
24855
+ /** Abort apply changeset */
24856
+ DbConflictResolution[DbConflictResolution["Abort"] = 2] = "Abort";
24857
+ })(DbConflictResolution || (DbConflictResolution = {}));
24858
+
24859
+
24860
+ /***/ }),
24861
+
24862
+ /***/ "../bentley/lib/esm/internal/RepositoryStatus.js":
24863
+ /*!*******************************************************!*\
24864
+ !*** ../bentley/lib/esm/internal/RepositoryStatus.js ***!
24865
+ \*******************************************************/
24866
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
24867
+
24868
+ "use strict";
24869
+ __webpack_require__.r(__webpack_exports__);
24870
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
24871
+ /* harmony export */ "RepositoryStatus": () => (/* binding */ RepositoryStatus)
24872
+ /* harmony export */ });
24873
+ /*---------------------------------------------------------------------------------------------
24874
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
24875
+ * See LICENSE.md in the project root for license terms and full copyright notice.
24876
+ *--------------------------------------------------------------------------------------------*/
24877
+ /** @packageDocumentation
24878
+ * @module Errors
24879
+ */
24880
+ /** Return codes for methods which perform repository management operations.
24881
+ * @internal
24882
+ */
24883
+ var RepositoryStatus;
24884
+ (function (RepositoryStatus) {
24885
+ RepositoryStatus[RepositoryStatus["Success"] = 0] = "Success";
24886
+ /** The repository server did not respond to a request */
24887
+ RepositoryStatus[RepositoryStatus["ServerUnavailable"] = 86017] = "ServerUnavailable";
24888
+ /** A requested lock was already held by another briefcase */
24889
+ RepositoryStatus[RepositoryStatus["LockAlreadyHeld"] = 86018] = "LockAlreadyHeld";
24890
+ /** Failed to sync briefcase manager with server */
24891
+ RepositoryStatus[RepositoryStatus["SyncError"] = 86019] = "SyncError";
24892
+ /** Response from server not understood */
24893
+ RepositoryStatus[RepositoryStatus["InvalidResponse"] = 86020] = "InvalidResponse";
24894
+ /** An operation requires local changes to be committed or abandoned */
24895
+ RepositoryStatus[RepositoryStatus["PendingTransactions"] = 86021] = "PendingTransactions";
24896
+ /** A lock cannot be relinquished because the associated object has been modified */
24897
+ RepositoryStatus[RepositoryStatus["LockUsed"] = 86022] = "LockUsed";
24898
+ /** An operation required creation of a ChangeSet, which failed */
24899
+ RepositoryStatus[RepositoryStatus["CannotCreateChangeSet"] = 86023] = "CannotCreateChangeSet";
24900
+ /** Request to server not understood */
24901
+ RepositoryStatus[RepositoryStatus["InvalidRequest"] = 86024] = "InvalidRequest";
24902
+ /** A change set committed to the server must be integrated into the briefcase before the operation can be completed */
24903
+ RepositoryStatus[RepositoryStatus["ChangeSetRequired"] = 86025] = "ChangeSetRequired";
24904
+ /** A requested DgnCode is reserved by another briefcase or in use */
24905
+ RepositoryStatus[RepositoryStatus["CodeUnavailable"] = 86026] = "CodeUnavailable";
24906
+ /** A DgnCode cannot be released because it has not been reserved by the requesting briefcase */
24907
+ RepositoryStatus[RepositoryStatus["CodeNotReserved"] = 86027] = "CodeNotReserved";
24908
+ /** A DgnCode cannot be relinquished because it has been used locally */
24909
+ RepositoryStatus[RepositoryStatus["CodeUsed"] = 86028] = "CodeUsed";
24910
+ /** A required lock is not held by this briefcase */
24911
+ RepositoryStatus[RepositoryStatus["LockNotHeld"] = 86029] = "LockNotHeld";
24912
+ /** Repository is currently locked, no changes allowed */
24913
+ RepositoryStatus[RepositoryStatus["RepositoryIsLocked"] = 86030] = "RepositoryIsLocked";
24914
+ /** Channel write constraint violation, such as an attempt to write outside the designated channel. */
24915
+ RepositoryStatus[RepositoryStatus["ChannelConstraintViolation"] = 86031] = "ChannelConstraintViolation";
24916
+ })(RepositoryStatus || (RepositoryStatus = {}));
24917
+
24918
+
24919
+ /***/ }),
24920
+
24921
+ /***/ "../bentley/lib/esm/internal/cross-package.js":
24922
+ /*!****************************************************!*\
24923
+ !*** ../bentley/lib/esm/internal/cross-package.js ***!
24924
+ \****************************************************/
24925
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
24926
+
24927
+ "use strict";
24928
+ __webpack_require__.r(__webpack_exports__);
24929
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
24930
+ /* harmony export */ "DbChangeStage": () => (/* reexport safe */ _BeSQLiteInternal__WEBPACK_IMPORTED_MODULE_2__.DbChangeStage),
24931
+ /* harmony export */ "DbConflictCause": () => (/* reexport safe */ _BeSQLiteInternal__WEBPACK_IMPORTED_MODULE_2__.DbConflictCause),
24932
+ /* harmony export */ "DbConflictResolution": () => (/* reexport safe */ _BeSQLiteInternal__WEBPACK_IMPORTED_MODULE_2__.DbConflictResolution),
24933
+ /* harmony export */ "DbValueType": () => (/* reexport safe */ _BeSQLiteInternal__WEBPACK_IMPORTED_MODULE_2__.DbValueType),
24934
+ /* harmony export */ "RepositoryStatus": () => (/* reexport safe */ _RepositoryStatus__WEBPACK_IMPORTED_MODULE_1__.RepositoryStatus),
24935
+ /* harmony export */ "staticLoggerMetadata": () => (/* reexport safe */ _staticLoggerMetadata__WEBPACK_IMPORTED_MODULE_0__.staticLoggerMetadata)
24936
+ /* harmony export */ });
24937
+ /* harmony import */ var _staticLoggerMetadata__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./staticLoggerMetadata */ "../bentley/lib/esm/internal/staticLoggerMetadata.js");
24938
+ /* harmony import */ var _RepositoryStatus__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./RepositoryStatus */ "../bentley/lib/esm/internal/RepositoryStatus.js");
24939
+ /* harmony import */ var _BeSQLiteInternal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./BeSQLiteInternal */ "../bentley/lib/esm/internal/BeSQLiteInternal.js");
24940
+ /*---------------------------------------------------------------------------------------------
24941
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
24942
+ * See LICENSE.md in the project root for license terms and full copyright notice.
24943
+ *--------------------------------------------------------------------------------------------*/
24944
+
24945
+
24946
+
24947
+
24948
+
24949
+ /***/ }),
24950
+
24951
+ /***/ "../bentley/lib/esm/internal/staticLoggerMetadata.js":
24952
+ /*!***********************************************************!*\
24953
+ !*** ../bentley/lib/esm/internal/staticLoggerMetadata.js ***!
24954
+ \***********************************************************/
24955
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
24956
+
24957
+ "use strict";
24958
+ __webpack_require__.r(__webpack_exports__);
24959
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
24960
+ /* harmony export */ "staticLoggerMetadata": () => (/* binding */ staticLoggerMetadata)
24961
+ /* harmony export */ });
24962
+ /*---------------------------------------------------------------------------------------------
24963
+ * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
24964
+ * See LICENSE.md in the project root for license terms and full copyright notice.
24965
+ *--------------------------------------------------------------------------------------------*/
24966
+ /** @packageDocumentation
24967
+ * @module Logging
24968
+ */
24969
+ /** All static metadata is combined with per-call metadata and stringified in every log message.
24970
+ * Static metadata can either be an object or a function that returns an object.
24971
+ * Use a key to identify entries in the map so the can be removed individually.
24972
+ * @internal
24973
+ */
24974
+ const staticLoggerMetadata = new Map();
24975
+
24976
+
24975
24977
  /***/ }),
24976
24978
 
24977
24979
  /***/ "../bentley/lib/esm/partitionArray.js":