@canton-network/core-wallet-ui-components 1.15.0 → 1.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/activity-utils-CsiZsTG2.cjs +4 -0
- package/dist/activity-utils-CsiZsTG2.cjs.map +1 -0
- package/dist/activity-utils-glrdQSNU.js +1944 -0
- package/dist/activity-utils-glrdQSNU.js.map +1 -0
- package/dist/components/auth-editor.d.ts.map +1 -1
- package/dist/components/idp-form.d.ts.map +1 -1
- package/dist/components/message-detail.d.ts +30 -0
- package/dist/components/message-detail.d.ts.map +1 -0
- package/dist/components/transaction-detail.d.ts +1 -1
- package/dist/components/transaction-detail.d.ts.map +1 -1
- package/dist/components/wallet-card.d.ts +5 -0
- package/dist/components/wallet-card.d.ts.map +1 -1
- package/dist/components/wallet-create-form.d.ts +1 -1
- package/dist/components/wallet-create-form.d.ts.map +1 -1
- package/dist/components/wallet-edit-form.d.ts.map +1 -1
- package/dist/components/wallet-form.d.ts +4 -0
- package/dist/components/wallet-form.d.ts.map +1 -1
- package/dist/handle-errors.d.ts +2 -7
- package/dist/handle-errors.d.ts.map +1 -1
- package/dist/index.cjs +519 -584
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5456 -4774
- package/dist/index.js.map +1 -1
- package/dist/internal/activity-render.d.ts +2 -0
- package/dist/internal/activity-render.d.ts.map +1 -0
- package/dist/internal/activity-utils.d.ts +2 -0
- package/dist/internal/activity-utils.d.ts.map +1 -1
- package/dist/internal/error-toast.d.ts +12 -0
- package/dist/internal/error-toast.d.ts.map +1 -0
- package/dist/react/components/ApiKeyCard.d.ts +8 -0
- package/dist/react/components/ApiKeyCard.d.ts.map +1 -0
- package/dist/react/components/ApiKeyForm.d.ts +8 -0
- package/dist/react/components/ApiKeyForm.d.ts.map +1 -0
- package/dist/react/components/AppHeader.d.ts +30 -0
- package/dist/react/components/AppHeader.d.ts.map +1 -0
- package/dist/react/components/ApprovalActions.d.ts +20 -0
- package/dist/react/components/ApprovalActions.d.ts.map +1 -0
- package/dist/react/components/AuthEditor.d.ts +21 -0
- package/dist/react/components/AuthEditor.d.ts.map +1 -0
- package/dist/react/components/BackLink.d.ts +18 -0
- package/dist/react/components/BackLink.d.ts.map +1 -0
- package/dist/react/components/CardDetailRow.d.ts +15 -0
- package/dist/react/components/CardDetailRow.d.ts.map +1 -0
- package/dist/react/components/CopyButton.d.ts +8 -0
- package/dist/react/components/CopyButton.d.ts.map +1 -0
- package/dist/react/components/ErrorPage.d.ts +10 -0
- package/dist/react/components/ErrorPage.d.ts.map +1 -0
- package/dist/react/components/IdpCard.d.ts +9 -0
- package/dist/react/components/IdpCard.d.ts.map +1 -0
- package/dist/react/components/IdpForm.d.ts +19 -0
- package/dist/react/components/IdpForm.d.ts.map +1 -0
- package/dist/react/components/LoadingState.d.ts +7 -0
- package/dist/react/components/LoadingState.d.ts.map +1 -0
- package/dist/react/components/LoginForm.d.ts +30 -0
- package/dist/react/components/LoginForm.d.ts.map +1 -0
- package/dist/react/components/MessageDetail.d.ts +27 -0
- package/dist/react/components/MessageDetail.d.ts.map +1 -0
- package/dist/react/components/NetworkCard.d.ts +13 -0
- package/dist/react/components/NetworkCard.d.ts.map +1 -0
- package/dist/react/components/NetworkForm.d.ts +17 -0
- package/dist/react/components/NetworkForm.d.ts.map +1 -0
- package/dist/react/components/Pagination.d.ts +13 -0
- package/dist/react/components/Pagination.d.ts.map +1 -0
- package/dist/react/components/SigningProviderSelect.d.ts +15 -0
- package/dist/react/components/SigningProviderSelect.d.ts.map +1 -0
- package/dist/react/components/Toast.d.ts +20 -0
- package/dist/react/components/Toast.d.ts.map +1 -0
- package/dist/react/components/TransactionCard.d.ts +17 -0
- package/dist/react/components/TransactionCard.d.ts.map +1 -0
- package/dist/react/components/TransactionDetail.d.ts +29 -0
- package/dist/react/components/TransactionDetail.d.ts.map +1 -0
- package/dist/react/components/WalletCard.d.ts +21 -0
- package/dist/react/components/WalletCard.d.ts.map +1 -0
- package/dist/react/components/WalletCreateForm.d.ts +35 -0
- package/dist/react/components/WalletCreateForm.d.ts.map +1 -0
- package/dist/react/components/WalletEditForm.d.ts +35 -0
- package/dist/react/components/WalletEditForm.d.ts.map +1 -0
- package/dist/react/components/WalletForm.d.ts +25 -0
- package/dist/react/components/WalletForm.d.ts.map +1 -0
- package/dist/react/components/WalletsSync.d.ts +13 -0
- package/dist/react/components/WalletsSync.d.ts.map +1 -0
- package/dist/react/contexts/ToastContext.d.ts +14 -0
- package/dist/react/contexts/ToastContext.d.ts.map +1 -0
- package/dist/react/contexts/ToastProvider.d.ts +10 -0
- package/dist/react/contexts/ToastProvider.d.ts.map +1 -0
- package/dist/react/hooks/useErrorToast.d.ts +8 -0
- package/dist/react/hooks/useErrorToast.d.ts.map +1 -0
- package/dist/react/hooks/useToast.d.ts +4 -0
- package/dist/react/hooks/useToast.d.ts.map +1 -0
- package/dist/react/index.cjs +19 -0
- package/dist/react/index.cjs.map +1 -0
- package/dist/react/index.d.ts +31 -0
- package/dist/react/index.d.ts.map +1 -0
- package/dist/react/index.js +2488 -0
- package/dist/react/index.js.map +1 -0
- package/dist/react/logger.d.ts +2 -0
- package/dist/react/logger.d.ts.map +1 -0
- package/dist/routing.d.ts +1 -1
- package/dist/routing.d.ts.map +1 -1
- package/dist/windows/popup.d.ts.map +1 -1
- package/dist/windows/wallet-picker.d.ts.map +1 -1
- package/package.json +58 -25
- package/dist/components/api-key-card.test.d.ts +0 -1
- package/dist/components/api-key-card.test.d.ts.map +0 -1
- package/dist/components/api-key-form.test.d.ts +0 -1
- package/dist/components/api-key-form.test.d.ts.map +0 -1
- package/dist/components/app-header.test.d.ts +0 -1
- package/dist/components/app-header.test.d.ts.map +0 -1
- package/dist/components/app-layout.test.d.ts +0 -2
- package/dist/components/app-layout.test.d.ts.map +0 -1
- package/dist/components/auth-editor.test.d.ts +0 -1
- package/dist/components/auth-editor.test.d.ts.map +0 -1
- package/dist/components/back-link.test.d.ts +0 -2
- package/dist/components/back-link.test.d.ts.map +0 -1
- package/dist/components/copy-button.test.d.ts +0 -1
- package/dist/components/copy-button.test.d.ts.map +0 -1
- package/dist/components/custom-toast.test.d.ts +0 -1
- package/dist/components/custom-toast.test.d.ts.map +0 -1
- package/dist/components/error-page.test.d.ts +0 -2
- package/dist/components/error-page.test.d.ts.map +0 -1
- package/dist/components/fixtures.d.ts +0 -15
- package/dist/components/fixtures.d.ts.map +0 -1
- package/dist/components/form-input.test.d.ts +0 -1
- package/dist/components/form-input.test.d.ts.map +0 -1
- package/dist/components/idp-card.test.d.ts +0 -1
- package/dist/components/idp-card.test.d.ts.map +0 -1
- package/dist/components/idp-form.test.d.ts +0 -2
- package/dist/components/idp-form.test.d.ts.map +0 -1
- package/dist/components/loading-state.test.d.ts +0 -2
- package/dist/components/loading-state.test.d.ts.map +0 -1
- package/dist/components/login-form.test.d.ts +0 -2
- package/dist/components/login-form.test.d.ts.map +0 -1
- package/dist/components/network-card.test.d.ts +0 -1
- package/dist/components/network-card.test.d.ts.map +0 -1
- package/dist/components/network-form.test.d.ts +0 -1
- package/dist/components/network-form.test.d.ts.map +0 -1
- package/dist/components/network-table.d.ts +0 -10
- package/dist/components/network-table.d.ts.map +0 -1
- package/dist/components/network-table.test.d.ts +0 -1
- package/dist/components/network-table.test.d.ts.map +0 -1
- package/dist/components/networks.d.ts +0 -16
- package/dist/components/networks.d.ts.map +0 -1
- package/dist/components/networks.test.d.ts +0 -2
- package/dist/components/networks.test.d.ts.map +0 -1
- package/dist/components/not-found.test.d.ts +0 -2
- package/dist/components/not-found.test.d.ts.map +0 -1
- package/dist/components/pagination.test.d.ts +0 -1
- package/dist/components/pagination.test.d.ts.map +0 -1
- package/dist/components/sessions.d.ts +0 -8
- package/dist/components/sessions.d.ts.map +0 -1
- package/dist/components/sessions.test.d.ts +0 -1
- package/dist/components/sessions.test.d.ts.map +0 -1
- package/dist/components/transaction-card.test.d.ts +0 -1
- package/dist/components/transaction-card.test.d.ts.map +0 -1
- package/dist/components/transaction-detail.test.d.ts +0 -1
- package/dist/components/transaction-detail.test.d.ts.map +0 -1
- package/dist/components/wallet-card.test.d.ts +0 -1
- package/dist/components/wallet-card.test.d.ts.map +0 -1
- package/dist/components/wallet-create-form.test.d.ts +0 -1
- package/dist/components/wallet-create-form.test.d.ts.map +0 -1
- package/dist/components/wallet-edit-form.test.d.ts +0 -1
- package/dist/components/wallet-edit-form.test.d.ts.map +0 -1
- package/dist/components/wallet-picker.test.d.ts +0 -1
- package/dist/components/wallet-picker.test.d.ts.map +0 -1
- package/dist/components/wallets-sync.test.d.ts +0 -1
- package/dist/components/wallets-sync.test.d.ts.map +0 -1
- package/dist/handle-errors.test.d.ts +0 -1
- package/dist/handle-errors.test.d.ts.map +0 -1
- package/dist/routing.test.d.ts +0 -2
- package/dist/routing.test.d.ts.map +0 -1
- package/dist/utils.test.d.ts +0 -2
- package/dist/utils.test.d.ts.map +0 -1
- package/dist/windows/popup.test.d.ts +0 -2
- package/dist/windows/popup.test.d.ts.map +0 -1
- package/dist/windows/wallet-picker.test.d.ts +0 -2
- package/dist/windows/wallet-picker.test.d.ts.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"activity-utils-glrdQSNU.js","sources":["../images/logos/canton-logo.png","../../../node_modules/.pnpm/@metamask+superstruct@3.4.1/node_modules/@metamask/superstruct/dist/error.mjs","../../../node_modules/.pnpm/@metamask+superstruct@3.4.1/node_modules/@metamask/superstruct/dist/utils.mjs","../../../node_modules/.pnpm/@metamask+superstruct@3.4.1/node_modules/@metamask/superstruct/dist/struct.mjs","../../../node_modules/.pnpm/@metamask+superstruct@3.4.1/node_modules/@metamask/superstruct/dist/structs/sensitive.mjs","../../../node_modules/.pnpm/@metamask+superstruct@3.4.1/node_modules/@metamask/superstruct/dist/structs/utilities.mjs","../../../node_modules/.pnpm/@metamask+superstruct@3.4.1/node_modules/@metamask/superstruct/dist/structs/types.mjs","../../../node_modules/.pnpm/@metamask+superstruct@3.4.1/node_modules/@metamask/superstruct/dist/structs/coercions.mjs","../../../node_modules/.pnpm/@metamask+superstruct@3.4.1/node_modules/@metamask/superstruct/dist/structs/refinements.mjs","../../../node_modules/.pnpm/@metamask+utils@11.12.1_supports-color@10.2.2/node_modules/@metamask/utils/dist/misc.mjs","../../../node_modules/.pnpm/@metamask+utils@11.12.1_supports-color@10.2.2/node_modules/@metamask/utils/dist/json.mjs","../../../node_modules/.pnpm/fast-safe-stringify@2.1.1/node_modules/fast-safe-stringify/index.js","../../../node_modules/.pnpm/@metamask+rpc-errors@7.0.3_supports-color@10.2.2/node_modules/@metamask/rpc-errors/dist/error-constants.mjs","../../../node_modules/.pnpm/@metamask+rpc-errors@7.0.3_supports-color@10.2.2/node_modules/@metamask/rpc-errors/dist/utils.mjs","../../../node_modules/.pnpm/@metamask+rpc-errors@7.0.3_supports-color@10.2.2/node_modules/@metamask/rpc-errors/dist/classes.mjs","../../rpc-errors/dist/index.js","../../../node_modules/.pnpm/@logtape+logtape@2.4.2/node_modules/@logtape/logtape/dist/level.js","../../../node_modules/.pnpm/@logtape+logtape@2.4.2/node_modules/@logtape/logtape/dist/scoped-config.js","../../../node_modules/.pnpm/@logtape+logtape@2.4.2/node_modules/@logtape/logtape/dist/source-location.js","../../../node_modules/.pnpm/@logtape+logtape@2.4.2/node_modules/@logtape/logtape/dist/logger.js","../../../node_modules/.pnpm/@logtape+logtape@2.4.2/node_modules/@logtape/logtape/dist/context.js","../src/internal/error-toast.ts","../src/internal/activity-utils.ts"],"sourcesContent":["export default \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAboAAAG6CAYAAAB+94OFAAA8YklEQVR42u2dX2xc133nv4xqLMWHcFIuYD/Q5GiBsEENkxPADcxi6YzpBJWrCTLOigt56VJU9WBGQiHSD21JPZAOtLHYhUUJm4T0Q0vKqJcN0CwlrMwkQNaU4Up2kBYkrSqbOg8cKSxgB5BJWkAkIwHuPsycqzuXd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85J+QVMAuihqU9IlSbdysIvRJAiF6sfsc5JmRMIJoENaIbpDiCgOATqiO4QQURwCdCGJ7i5K2q/sujuEEFEcKkNkXfpbcbHuDqEg/DgdERmVvhXr6PytjB6su9ukORDylTZzgPsikPO3GLoMhq5K+r5IVkHIL7qk7Fzcj2gK/4uhy+ApLWlKDGciVA9lxMLvwImhy2D+kjyQu9kyNAdCNdGmssOUB4Bc8MTQZXC1ItbeIVQLXVB2mBLAIVRHxSXNSbIwxhUzGc8I+VBJSWt0UBiXDbgk3QlC/tYgwMN4114GcAgBPIzD6LXcvYIQAngYAziEEMDDGMAhhAAexqpPkgmAQyiCwFuiA8QRAFyS2x2haCsp1uFhAIdCKmpdIqfikiYkfVkslEXB1KaylUzmRIk8BOjQDsBLShoHeCggWlG2JN55saUVQmiXSophTczwJEIoIlHesMjWxPX3hrJD7DFuS4QQUR4OE9wWiN7QXsQcHSo3yktKOkoHhKqkq8rOvc2JuTcE6JAPoJeWdEoksKDy4fa2SCxBgA75WAllF6N/HeihEpWRdDEHuas0BwJ0KGjQS+egl6A5kEfkBtwQoEOhUVzM6QG37JzbJbGgGwE6FHLFcrBLi0osYdZmDmqXc5DbpEkQoENRVSIHPjPEGaNJAgu2FQfYVmgSBOgQ8lYyBzzAFxywrYi5NgToECobfF/O/TdOk9RFmRzMVonYEKBDqLqK54DnhB9RX+WjtauSbulBZuQmzYIAHUL1hV88F/11OWCIdhepZXKRWoZmQYAOoWAo4YBeVy7yi2IEuOmA2KojYgNoCNAhFFLFHFGgcbvr8SBBzIAsI2nL8e8Vx/MIATqEkCcMYw4bALbn/usEYtz12lKjxkwBcDkBdcv1twZkQAyhIvr/EHNYRo2EsUQAAAAASUVORK5CYII=\"","/**\n * A `StructFailure` represents a single specific failure in validation.\n */\n/**\n * `StructError` objects are thrown (or returned) when validation fails.\n *\n * Validation logic is design to exit early for maximum performance. The error\n * represents the first error encountered during validation. For more detail,\n * the `error.failures` property is a generator function that can be run to\n * continue validation and receive all the failures in the data.\n */\nexport class StructError extends TypeError {\n constructor(failure, failures) {\n let cached;\n const { message, explanation, ...rest } = failure;\n const { path } = failure;\n const cause = path.length === 0 ? message : `At path: ${path.join('.')} -- ${message}`;\n super(explanation ?? cause);\n if (explanation !== null && explanation !== undefined) {\n this.cause = cause;\n }\n Object.assign(this, rest);\n this.name = this.constructor.name;\n this.failures = () => {\n return (cached ?? (cached = [failure, ...failures()]));\n };\n }\n}\n//# sourceMappingURL=error.mjs.map","/**\n * Check if a value is an iterator.\n *\n * @param value - The value to check.\n * @returns Whether the value is an iterator.\n */\nfunction isIterable(value) {\n return isObject(value) && typeof value[Symbol.iterator] === 'function';\n}\n/**\n * Check if a value is a plain object.\n *\n * @param value - The value to check.\n * @returns Whether the value is a plain object.\n */\nexport function isObject(value) {\n return typeof value === 'object' && value !== null;\n}\n/**\n * Check if a value is a plain object.\n *\n * @param value - The value to check.\n * @returns Whether the value is a plain object.\n */\nexport function isPlainObject(value) {\n if (Object.prototype.toString.call(value) !== '[object Object]') {\n return false;\n }\n const prototype = Object.getPrototypeOf(value);\n return prototype === null || prototype === Object.prototype;\n}\n/**\n * Return a value as a printable string.\n *\n * @param value - The value to print.\n * @returns The value as a string.\n */\nexport function print(value) {\n if (typeof value === 'symbol') {\n return value.toString();\n }\n // eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n return typeof value === 'string' ? JSON.stringify(value) : `${value}`;\n}\n/**\n * Shift (remove and return) the first value from the `input` iterator.\n * Like `Array.prototype.shift()` but for an `Iterator`.\n *\n * @param input - The iterator to shift.\n * @returns The first value of the iterator, or `undefined` if the iterator is\n * empty.\n */\nexport function shiftIterator(input) {\n const { done, value } = input.next();\n return done ? undefined : value;\n}\n/**\n * Convert a single validation result to a failure.\n *\n * @param result - The result to convert.\n * @param context - The context of the validation.\n * @param struct - The struct being validated.\n * @param value - The value being validated.\n * @returns A failure if the result is a failure, or `undefined` if the result\n * is a success.\n */\nexport function toFailure(result, context, struct, value) {\n if (result === true) {\n return undefined;\n }\n else if (result === false) {\n // eslint-disable-next-line no-param-reassign\n result = {};\n }\n else if (typeof result === 'string') {\n // eslint-disable-next-line no-param-reassign\n result = { message: result };\n }\n const { path, branch } = context;\n const { type } = struct;\n const { refinement, message = `Expected a value of type \\`${type}\\`${refinement ? ` with refinement \\`${refinement}\\`` : ''}, but received: \\`${print(value)}\\``, } = result;\n return {\n value,\n type,\n refinement,\n key: path[path.length - 1],\n path,\n branch,\n ...result,\n message,\n };\n}\n/**\n * Convert a validation result to an iterable of failures.\n *\n * @param result - The result to convert.\n * @param context - The context of the validation.\n * @param struct - The struct being validated.\n * @param value - The value being validated.\n * @yields The failures.\n * @returns An iterable of failures.\n */\nexport function* toFailures(result, context, struct, value) {\n if (!isIterable(result)) {\n // eslint-disable-next-line no-param-reassign\n result = [result];\n }\n for (const validationResult of result) {\n const failure = toFailure(validationResult, context, struct, value);\n if (failure) {\n yield failure;\n }\n }\n}\n/**\n * Check a value against a struct, traversing deeply into nested values, and\n * returning an iterator of failures or success.\n *\n * @param value - The value to check.\n * @param struct - The struct to check against.\n * @param options - Optional settings.\n * @param options.path - The path to the value in the input data.\n * @param options.branch - The branch of the value in the input data.\n * @param options.coerce - Whether to coerce the value before validating it.\n * @param options.mask - Whether to mask the value before validating it.\n * @param options.message - An optional message to include in the error.\n * @yields An iterator of failures or success.\n * @returns An iterator of failures or success.\n */\nexport function* run(value, struct, options = {}) {\n const { path = [], branch = [value], coerce = false, mask = false } = options;\n const context = { path, branch };\n if (coerce) {\n // eslint-disable-next-line no-param-reassign\n value = struct.coercer(value, context);\n if (mask &&\n struct.type !== 'type' &&\n isObject(struct.schema) &&\n isObject(value) &&\n !Array.isArray(value)) {\n for (const key in value) {\n if (struct.schema[key] === undefined) {\n delete value[key];\n }\n }\n }\n }\n let status = 'valid';\n for (const failure of struct.validator(value, context)) {\n failure.explanation = options.message;\n status = 'not_valid';\n yield [failure, undefined];\n }\n // eslint-disable-next-line prefer-const\n for (let [innerKey, innerValue, innerStruct] of struct.entries(value, context)) {\n const iterable = run(innerValue, innerStruct, {\n path: innerKey === undefined ? path : [...path, innerKey],\n branch: innerKey === undefined ? branch : [...branch, innerValue],\n coerce,\n mask,\n message: options.message,\n });\n for (const result of iterable) {\n if (result[0]) {\n status =\n result[0].refinement === null || result[0].refinement === undefined\n ? 'not_valid'\n : 'not_refined';\n yield [result[0], undefined];\n }\n else if (coerce) {\n innerValue = result[1];\n if (innerKey === undefined) {\n // eslint-disable-next-line no-param-reassign\n value = innerValue;\n }\n else if (value instanceof Map) {\n value.set(innerKey, innerValue);\n }\n else if (value instanceof Set) {\n value.add(innerValue);\n }\n else if (isObject(value)) {\n if (innerValue !== undefined || innerKey in value) {\n value[innerKey] = innerValue;\n }\n }\n }\n }\n }\n if (status !== 'not_valid') {\n for (const failure of struct.refiner(value, context)) {\n failure.explanation = options.message;\n status = 'not_refined';\n yield [failure, undefined];\n }\n }\n if (status === 'valid') {\n yield [undefined, value];\n }\n}\n//# sourceMappingURL=utils.mjs.map","import { StructError } from \"./error.mjs\";\nimport { isObject, toFailures, shiftIterator, run } from \"./utils.mjs\";\n/**\n * `Struct` objects encapsulate the validation logic for a specific type of\n * values. Once constructed, you use the `assert`, `is` or `validate` helpers to\n * validate unknown input data against the struct.\n */\nexport class Struct {\n constructor(props) {\n const { type, schema, validator, refiner, coercer = (value) => value, entries = function* () {\n /* noop */\n }, } = props;\n this.type = type;\n this.schema = schema;\n this.entries = entries;\n this.coercer = coercer;\n if (validator) {\n this.validator = (value, context) => {\n const result = validator(value, context);\n return toFailures(result, context, this, value);\n };\n }\n else {\n this.validator = () => [];\n }\n if (refiner) {\n this.refiner = (value, context) => {\n const result = refiner(value, context);\n return toFailures(result, context, this, value);\n };\n }\n else {\n this.refiner = () => [];\n }\n // Copy Symbol-keyed properties from `props` so that brands set on an inner\n // struct (e.g. the sensitive marker) are automatically inherited by any\n // wrapper that spreads the struct into a new constructor call.\n for (const sym of Object.getOwnPropertySymbols(props)) {\n Object.defineProperty(this, sym, \n // No need to check for undefined, since we are iterating over\n // `Object.getOwnPropertySymbols`.\n Object.getOwnPropertyDescriptor(props, sym));\n }\n }\n /**\n * Assert that a value passes the struct's validation, throwing if it doesn't.\n */\n assert(value, message) {\n return assert(value, this, message);\n }\n /**\n * Create a value with the struct's coercion logic, then validate it.\n */\n create(value, message) {\n return create(value, this, message);\n }\n /**\n * Check if a value passes the struct's validation.\n */\n is(value) {\n return is(value, this);\n }\n /**\n * Mask a value, coercing and validating it, but returning only the subset of\n * properties defined by the struct's schema.\n */\n mask(value, message) {\n return mask(value, this, message);\n }\n /**\n * Validate a value with the struct's validation logic, returning a tuple\n * representing the result.\n *\n * You may optionally pass `true` for the `withCoercion` argument to coerce\n * the value before attempting to validate it. If you do, the result will\n * contain the coerced result when successful.\n */\n validate(value, options = {}) {\n return validate(value, this, options);\n }\n}\n// String instead of a Symbol in case of multiple different versions of this library.\nconst ExactOptionalBrand = 'EXACT_OPTIONAL';\n/**\n * An `ExactOptionalStruct` is a `Struct` that is used to create exactly optional\n * properties of `object()` structs.\n */\nexport class ExactOptionalStruct extends Struct {\n constructor(props) {\n super({\n ...props,\n type: `exact optional ${props.type}`,\n });\n this.brand = ExactOptionalBrand;\n }\n static isExactOptional(value) {\n return (isObject(value) && 'brand' in value && value.brand === ExactOptionalBrand);\n }\n}\n/**\n * Assert that a value passes a struct, throwing if it doesn't.\n *\n * @param value - The value to validate.\n * @param struct - The struct to validate against.\n * @param message - An optional message to include in the error.\n */\nexport function assert(value, struct, message) {\n const result = validate(value, struct, { message });\n if (result[0]) {\n throw result[0];\n }\n}\n/**\n * Create a value with the coercion logic of struct and validate it.\n *\n * @param value - The value to coerce and validate.\n * @param struct - The struct to validate against.\n * @param message - An optional message to include in the error.\n * @returns The coerced and validated value.\n */\nexport function create(value, struct, message) {\n const result = validate(value, struct, { coerce: true, message });\n if (result[0]) {\n throw result[0];\n }\n else {\n return result[1];\n }\n}\n/**\n * Mask a value, returning only the subset of properties defined by a struct.\n *\n * @param value - The value to mask.\n * @param struct - The struct to mask against.\n * @param message - An optional message to include in the error.\n * @returns The masked value.\n */\nexport function mask(value, struct, message) {\n const result = validate(value, struct, { coerce: true, mask: true, message });\n if (result[0]) {\n throw result[0];\n }\n else {\n return result[1];\n }\n}\n/**\n * Check if a value passes a struct.\n *\n * @param value - The value to validate.\n * @param struct - The struct to validate against.\n * @returns `true` if the value passes the struct, `false` otherwise.\n */\nexport function is(value, struct) {\n const result = validate(value, struct);\n return !result[0];\n}\n/**\n * Validate a value against a struct, returning an error if invalid, or the\n * value (with potential coercion) if valid.\n *\n * @param value - The value to validate.\n * @param struct - The struct to validate against.\n * @param options - Optional settings.\n * @param options.coerce - Whether to coerce the value before validating it.\n * @param options.mask - Whether to mask the value before validating it.\n * @param options.message - An optional message to include in the error.\n * @returns A tuple containing the error (if invalid) and the validated value.\n */\nexport function validate(value, struct, options = {}) {\n const tuples = run(value, struct, options);\n const tuple = shiftIterator(tuples);\n if (tuple[0]) {\n const error = new StructError(tuple[0], function* () {\n for (const innerTuple of tuples) {\n if (innerTuple[0]) {\n yield innerTuple[0];\n }\n }\n });\n return [error, undefined];\n }\n const validatedValue = tuple[1];\n return [undefined, validatedValue];\n}\n//# sourceMappingURL=struct.mjs.map","import { Struct } from \"../struct.mjs\";\nimport { isObject } from \"../utils.mjs\";\nconst SENSITIVE_REDACTED = '***';\n// Global-registry Symbol so the brand is shared across multiple instances of\n// this library loaded in the same runtime (e.g. npm dedup failure). Compare\n// with `ExactOptionalBrand`, which uses a plain string for the same reason.\n// Using Symbol.for() (not Symbol()) means isSensitiveStruct() works even when\n// `sensitive()` and `object()` come from different copies of this package.\nconst SENSITIVE_BRAND = Symbol.for('superstruct.sensitive');\n/**\n * Check whether a struct was created by `sensitive()`, or wraps one.\n *\n * @param struct - The struct to check.\n * @returns `true` if the struct carries the sensitive brand.\n */\nexport function isSensitiveStruct(struct) {\n return Object.prototype.hasOwnProperty.call(struct, SENSITIVE_BRAND);\n}\n/**\n * Return a shallow copy of `sourceObj` with each key in `keys` replaced by\n * the redaction placeholder.\n *\n * @param sourceObj - The source object to copy and redact.\n * @param keys - The property names to redact.\n * @returns A shallow copy with the specified keys replaced.\n */\nfunction redactKeys(sourceObj, keys) {\n const redacted = { ...sourceObj };\n for (const key of keys) {\n if (key in redacted) {\n redacted[key] = SENSITIVE_REDACTED;\n }\n }\n return redacted;\n}\n/**\n * Wrap a struct so that every failure it (and any of its entries) emits is\n * fully redacted: `value` and every item in `branch` are replaced with\n * `SENSITIVE_REDACTED`. Field structs yielded by `entries` are wrapped\n * recursively so that nested object failures are covered too.\n *\n * This is the internal workhorse for `sensitive()`. It deliberately does NOT\n * stamp the `SENSITIVE_BRAND` so that only the user-facing wrapper is\n * detectable via `isSensitiveStruct()`.\n *\n * @param struct - The struct to wrap.\n * @returns The wrapped struct with identical validation logic but fully\n * redacted failures.\n */\nfunction wrapWithRedaction(struct) {\n // eslint-disable-next-line jsdoc/require-jsdoc\n function* redact(failures) {\n for (const failure of failures) {\n yield {\n ...failure,\n value: SENSITIVE_REDACTED,\n // We cannot safely preserve `failure.message` even for refiner\n // failures: a refiner that returns `false` gets a default message from\n // `toFailure` that embeds the raw value. There is no field on `Failure`\n // that distinguishes a custom refiner string from that generated\n // default, so preserving the original message risks leaking the\n // sensitive value. We rebuild the template from scratch, mirroring\n // `toFailure`'s own default, and include the refinement name when\n // present so callers can still tell which constraint failed.\n message: `Expected a value of type \\`${struct.type}\\`${failure.refinement ? ` with refinement \\`${failure.refinement}\\`` : ''}, but received: \\`${SENSITIVE_REDACTED}\\``,\n branch: new Array(failure.branch.length).fill(SENSITIVE_REDACTED),\n };\n }\n }\n return new Struct({\n ...struct,\n validator(value, context) {\n return redact(struct.validator(value, context));\n },\n refiner(value, context) {\n return redact(struct.refiner(value, context));\n },\n *entries(value, context) {\n for (const [key, val, fieldStruct] of struct.entries(value, context)) {\n yield [key, val, wrapWithRedaction(fieldStruct)];\n }\n },\n });\n}\n/**\n * Wrap a struct so that every failure it emits has any occurrence of\n * `parentObj` in `failure.branch` replaced with a sanitised copy where\n * `sensitiveKeys` are redacted. This prevents the parent object (which holds\n * secret field values) from leaking through sibling-field failures.\n *\n * The wrapping propagates recursively through `entries` so that failures from\n * deeply nested sibling structs are covered too.\n *\n * @param struct - The struct whose failures should be patched.\n * @param parentObj - The parent-object reference to look for in branch arrays.\n * @param sensitiveKeys - Keys to redact from `parentObj` when it appears.\n * @returns The wrapped struct.\n */\nexport function withRedactedBranch(struct, parentObj, sensitiveKeys) {\n // eslint-disable-next-line jsdoc/require-jsdoc\n function* redactBranch(failures) {\n for (const failure of failures) {\n if (!isObject(parentObj)) {\n yield failure;\n continue;\n }\n // Locate this specific parent. If it isn't in the branch (e.g. the\n // failure came from a different scope), pass it through.\n const parentIndex = failure.branch.indexOf(parentObj);\n if (parentIndex === -1) {\n yield failure;\n continue;\n }\n // Sanitize the parent entry.\n const branch = [...failure.branch];\n branch[parentIndex] = redactKeys(parentObj, sensitiveKeys);\n // Walk backward through every ancestor in the branch. Each ancestor\n // holds a direct reference to the child below it - without this step,\n // outer objects would still expose the unredacted child through their\n // own properties (e.g. root.wrapper.secret would remain visible\n // even after wrapper was sanitised at branch[1]).\n //\n // For each level we use the original child reference to find which\n // property key points to it (via ===), then replace that entry with\n // the already-sanitised child from the patched branch.\n for (let ancestorIndex = parentIndex - 1; ancestorIndex >= 0; ancestorIndex--) {\n const ancestor = branch[ancestorIndex];\n // No reference to update in this case.\n if (!isObject(ancestor)) {\n break;\n }\n // Keep the original child reference, so we can detect it.\n const child = failure.branch[ancestorIndex + 1];\n // The already-sanitised child from the patched branch.\n const childSanitized = branch[ancestorIndex + 1];\n // If we find the (original) child (not redacted) in one of the ancestor's\n // properties/entries, we replace it with the redacted version (re-using the same\n // sanitized child from the patched branch).\n if (Array.isArray(ancestor)) {\n const childIndex = ancestor.indexOf(child);\n if (childIndex === -1) {\n break;\n }\n const copy = [...ancestor];\n copy[childIndex] = childSanitized;\n branch[ancestorIndex] = copy;\n }\n else if (ancestor instanceof Map) {\n // Use a flag instead of relying on `undefined` since that could be a valid key in a `Map`.\n let childFound = false;\n let childKey;\n for (const [entryKey, entryValue] of ancestor) {\n if (entryValue === child) {\n childKey = entryKey;\n childFound = true;\n break;\n }\n }\n if (!childFound) {\n break;\n }\n const copy = new Map(ancestor);\n copy.set(childKey, childSanitized);\n branch[ancestorIndex] = copy;\n }\n else {\n const childKey = Object.keys(ancestor).find((key) => ancestor[key] === child);\n if (childKey === undefined) {\n break;\n }\n branch[ancestorIndex] = { ...ancestor, [childKey]: childSanitized };\n }\n }\n yield { ...failure, branch };\n }\n }\n return new Struct({\n ...struct,\n validator(value, context) {\n return redactBranch(struct.validator(value, context));\n },\n refiner(value, context) {\n return redactBranch(struct.refiner(value, context));\n },\n // Propagate branch redaction recursively so that failures originating from\n // any depth inside a sibling struct are also sanitised.\n *entries(value, context) {\n for (const entry of struct.entries(value, context)) {\n const [fieldKey, fieldValue, fieldStruct] = entry;\n yield [\n fieldKey,\n fieldValue,\n // `AnyStruct` is `Struct<any, any>`, while the tuple narrows only to\n // `Struct<any> | Struct<never>` (second generic left as `unknown`).\n // The cast is safe because both forms represent untyped structs at runtime.\n withRedactedBranch(fieldStruct, parentObj, sensitiveKeys),\n ];\n }\n },\n });\n}\n/**\n * Wrap a struct so that any validation failure redacts the actual value from\n * the error message, `StructError.value`, and `StructError.branch`. Use this\n * for fields that hold secrets to prevent\n * sensitive material from leaking into error logs or external services.\n *\n * When composed with the `object()` or `type()` structs, sibling-field\n * failures will also have the parent object's sensitive keys redacted from\n * their branch.\n *\n * @example\n * ```ts\n * const MyStruct = object({ secret: sensitive(string()) });\n * assert({ secret: 123 }, MyStruct);\n * // throws: At path: secret -- Expected a value of type `string`,\n * // but received: `***`\n * ```\n * @param struct - The struct to wrap.\n * @returns The wrapped struct with identical validation logic but redacted\n * failures.\n */\nexport function sensitive(struct) {\n const wrapped = wrapWithRedaction(struct);\n // Brand the wrapped struct. The `Struct` constructor copies Symbol-keyed\n // properties on spread, so any wrapper (optional, nullable, exactOptional,\n // deprecated, ...) automatically inherits this brand without needing changes.\n Object.defineProperty(wrapped, SENSITIVE_BRAND, {\n value: true,\n enumerable: true,\n configurable: true,\n writable: false,\n });\n return wrapped;\n}\n//# sourceMappingURL=sensitive.mjs.map","import { Struct } from \"../struct.mjs\";\nimport { object, optional, type } from \"./types.mjs\";\n/**\n * Create a new struct that combines the properties from multiple object or type\n * structs. Its return type will match the first parameter's type.\n *\n * @param Structs - The structs to combine.\n * @returns A new struct that combines the properties of the input structs.\n */\nexport function assign(...Structs) {\n const isType = Structs[0]?.type === 'type';\n const schemas = Structs.map(({ schema }) => schema);\n const schema = Object.assign({}, ...schemas);\n return isType ? type(schema) : object(schema);\n}\n/**\n * Define a new struct type with a custom validation function.\n *\n * @param name - The name of the struct type.\n * @param validator - The validation function.\n * @returns A new struct type.\n */\nexport function define(name, validator) {\n return new Struct({ type: name, schema: null, validator });\n}\n/**\n * Create a new struct based on an existing struct, but the value is allowed to\n * be `undefined`. `log` will be called if the value is not `undefined`.\n *\n * @param struct - The struct to augment.\n * @param log - The function to call when the value is not `undefined`.\n * @returns A new struct that will only accept `undefined` or values that pass\n * the input struct.\n */\nexport function deprecated(struct, log) {\n return new Struct({\n ...struct,\n refiner: (value, ctx) => value === undefined || struct.refiner(value, ctx),\n validator(value, ctx) {\n if (value === undefined) {\n return true;\n }\n log(value, ctx);\n return struct.validator(value, ctx);\n },\n });\n}\n/**\n * Create a struct with dynamic validation logic.\n *\n * The callback will receive the value currently being validated, and must\n * return a struct object to validate it with. This can be useful to model\n * validation logic that changes based on its input.\n *\n * @param fn - The callback to create the struct.\n * @returns A new struct with dynamic validation logic.\n */\nexport function dynamic(fn) {\n return new Struct({\n type: 'dynamic',\n schema: null,\n *entries(value, ctx) {\n const struct = fn(value, ctx);\n yield* struct.entries(value, ctx);\n },\n validator(value, ctx) {\n const struct = fn(value, ctx);\n return struct.validator(value, ctx);\n },\n coercer(value, ctx) {\n const struct = fn(value, ctx);\n return struct.coercer(value, ctx);\n },\n refiner(value, ctx) {\n const struct = fn(value, ctx);\n return struct.refiner(value, ctx);\n },\n });\n}\n/**\n * Create a struct with lazily evaluated validation logic.\n *\n * The first time validation is run with the struct, the callback will be called\n * and must return a struct object to use. This is useful for cases where you\n * want to have self-referential structs for nested data structures to avoid a\n * circular definition problem.\n *\n * @param fn - The callback to create the struct.\n * @returns A new struct with lazily evaluated validation logic.\n */\nexport function lazy(fn) {\n let struct;\n return new Struct({\n type: 'lazy',\n schema: null,\n *entries(value, ctx) {\n struct ?? (struct = fn());\n yield* struct.entries(value, ctx);\n },\n validator(value, ctx) {\n struct ?? (struct = fn());\n return struct.validator(value, ctx);\n },\n coercer(value, ctx) {\n struct ?? (struct = fn());\n return struct.coercer(value, ctx);\n },\n refiner(value, ctx) {\n struct ?? (struct = fn());\n return struct.refiner(value, ctx);\n },\n });\n}\n/**\n * Create a new struct based on an existing object struct, but excluding\n * specific properties.\n *\n * Like TypeScript's `Omit` utility.\n *\n * @param struct - The struct to augment.\n * @param keys - The keys to omit.\n * @returns A new struct that will not accept the input keys.\n */\nexport function omit(struct, keys) {\n const { schema } = struct;\n const subschema = { ...schema };\n for (const key of keys) {\n delete subschema[key];\n }\n switch (struct.type) {\n case 'type':\n return type(subschema);\n default:\n return object(subschema);\n }\n}\n/**\n * Create a new struct based on an existing object struct, but with all of its\n * properties allowed to be `undefined`.\n *\n * Like TypeScript's `Partial` utility.\n *\n * @param struct - The struct to augment.\n * @returns A new struct that will accept the input keys as `undefined`.\n */\nexport function partial(struct) {\n const isStruct = struct instanceof Struct;\n const schema = isStruct ? { ...struct.schema } : { ...struct };\n // eslint-disable-next-line guard-for-in\n for (const key in schema) {\n schema[key] = optional(schema[key]);\n }\n if (isStruct && struct.type === 'type') {\n return type(schema);\n }\n return object(schema);\n}\n/**\n * Create a new struct based on an existing object struct, but only including\n * specific properties.\n *\n * Like TypeScript's `Pick` utility.\n *\n * @param struct - The struct to augment.\n * @param keys - The keys to pick.\n * @returns A new struct that will only accept the input keys.\n */\nexport function pick(struct, keys) {\n const { schema } = struct;\n const subschema = {};\n for (const key of keys) {\n subschema[key] = schema[key];\n }\n switch (struct.type) {\n case 'type':\n return type(subschema);\n default:\n return object(subschema);\n }\n}\n//# sourceMappingURL=utilities.mjs.map","import { ExactOptionalStruct, Struct } from \"../struct.mjs\";\nimport { print, run, isObject } from \"../utils.mjs\";\nimport { isSensitiveStruct, withRedactedBranch } from \"./sensitive.mjs\";\nimport { define } from \"./utilities.mjs\";\n/**\n * Wrap a base struct so that entry-level failures from sibling fields have the\n * parent object's sensitive keys redacted from their branch. If `schema`\n * contains no sensitive-marked fields, `base` is returned as-is to avoid the\n * overhead of wrapping every entry.\n *\n * Used by both `object()` and `type()` to share the sensitive-entry wrapping\n * logic without duplication.\n *\n * @param base - The base struct to potentially wrap.\n * @param schema - The object schema to inspect for sensitive fields.\n * @returns The wrapped struct, or `base` unchanged when no sensitive fields\n * are present.\n */\nfunction withSensitiveEntries(base, schema) {\n const sensitiveKeys = Object.keys(schema).filter(\n // `noUncheckedIndexedAccess` makes `schema[key]` return `AnyStruct |\n // undefined`. After the `!== undefined` guard, TypeScript still treats the\n // second `schema[key]` access as potentially undefined (it does not\n // re-narrow repeated index reads), so the cast to `AnyStruct` is required.\n (key) => schema[key] !== undefined && isSensitiveStruct(schema[key]));\n if (sensitiveKeys.length === 0) {\n return base;\n }\n return new Struct({\n ...base,\n *entries(value, context) {\n // `run` initialises `branch` before coercion runs, so `value` here may\n // be a freshly-created coerced copy (e.g. `object()`'s `{ ...value }`)\n // while `context.branch[last]` still holds the original reference that\n // ends up in failure branches. Using the branch reference ensures the\n // `===` check inside `withRedactedBranch` matches when coercion is active.\n // Falls back to `value` if branch is somehow empty (entries called outside\n // of `run`).\n const parentInBranch = context.branch[context.branch.length - 1] ?? value;\n for (const entry of base.entries(value, context)) {\n const [fieldKey, fieldValue, fieldStruct] = entry;\n // The entries tuple types the third element as `Struct<any> |\n // Struct<never>`. `AnyStruct` is `Struct<any, any>`, which differs\n // only in the second generic. The cast is safe because both forms\n // represent untyped structs at runtime.\n yield [\n fieldKey,\n fieldValue,\n withRedactedBranch(fieldStruct, parentInBranch, sensitiveKeys),\n ];\n }\n },\n });\n}\n/**\n * Ensure that any value passes validation.\n *\n * @returns A struct that will always pass validation.\n */\nexport function any() {\n return define('any', () => true);\n}\n/**\n * Ensure that a value is an array and that its elements are of a specific type.\n *\n * Note: If you omit the element struct, the arrays elements will not be\n * iterated at all. This can be helpful for cases where performance is critical,\n * and it is preferred to using `array(any())`.\n *\n * @param Element - The struct to validate each element in the array against.\n * @returns A new struct that will only accept arrays of the given type.\n */\nexport function array(Element) {\n return new Struct({\n type: 'array',\n schema: Element,\n *entries(value) {\n if (Element && Array.isArray(value)) {\n for (const [index, arrayValue] of value.entries()) {\n yield [index, arrayValue, Element];\n }\n }\n },\n coercer(value) {\n return Array.isArray(value) ? value.slice() : value;\n },\n validator(value) {\n return (Array.isArray(value) ||\n `Expected an array value, but received: ${print(value)}`);\n },\n });\n}\n/**\n * Ensure that a value is a bigint.\n *\n * @returns A new struct that will only accept bigints.\n */\nexport function bigint() {\n return define('bigint', (value) => {\n return typeof value === 'bigint';\n });\n}\n/**\n * Ensure that a value is a boolean.\n *\n * @returns A new struct that will only accept booleans.\n */\nexport function boolean() {\n return define('boolean', (value) => {\n return typeof value === 'boolean';\n });\n}\n/**\n * Ensure that a value is a valid `Date`.\n *\n * Note: this also ensures that the value is *not* an invalid `Date` object,\n * which can occur when parsing a date fails but still returns a `Date`.\n *\n * @returns A new struct that will only accept valid `Date` objects.\n */\nexport function date() {\n return define('date', (value) => {\n return ((value instanceof Date && !isNaN(value.getTime())) ||\n `Expected a valid \\`Date\\` object, but received: ${print(value)}`);\n });\n}\n/**\n * Ensure that a value is one of a set of potential values.\n *\n * Note: after creating the struct, you can access the definition of the\n * potential values as `struct.schema`.\n *\n * @param values - The potential values that the input can be.\n * @returns A new struct that will only accept the given values.\n */\nexport function enums(values) {\n const schema = {};\n const description = values.map((value) => print(value)).join();\n for (const key of values) {\n schema[key] = key;\n }\n return new Struct({\n type: 'enums',\n schema,\n validator(value) {\n return (values.includes(value) ||\n `Expected one of \\`${description}\\`, but received: ${print(value)}`);\n },\n });\n}\n/**\n * Ensure that a value is a function.\n *\n * @returns A new struct that will only accept functions.\n */\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport function func() {\n return define('func', (value) => {\n return (typeof value === 'function' ||\n `Expected a function, but received: ${print(value)}`);\n });\n}\n/**\n * Ensure that a value is an instance of a specific class.\n *\n * @param Class - The class that the value must be an instance of.\n * @returns A new struct that will only accept instances of the given class.\n */\nexport function instance(Class) {\n return define('instance', (value) => {\n return (value instanceof Class ||\n `Expected a \\`${Class.name}\\` instance, but received: ${print(value)}`);\n });\n}\n/**\n * Ensure that a value is an integer.\n *\n * @returns A new struct that will only accept integers.\n */\nexport function integer() {\n return define('integer', (value) => {\n return ((typeof value === 'number' && !isNaN(value) && Number.isInteger(value)) ||\n `Expected an integer, but received: ${print(value)}`);\n });\n}\n/**\n * Ensure that a value matches all of a set of types.\n *\n * @param Structs - The set of structs that the value must match.\n * @returns A new struct that will only accept values that match all of the\n * given structs.\n */\nexport function intersection(Structs) {\n return new Struct({\n type: 'intersection',\n schema: null,\n *entries(value, context) {\n for (const { entries } of Structs) {\n yield* entries(value, context);\n }\n },\n *validator(value, context) {\n for (const { validator } of Structs) {\n yield* validator(value, context);\n }\n },\n *refiner(value, context) {\n for (const { refiner } of Structs) {\n yield* refiner(value, context);\n }\n },\n });\n}\n/**\n * Ensure that a value is an exact value, using `===` for comparison.\n *\n * @param constant - The exact value that the input must be.\n * @returns A new struct that will only accept the exact given value.\n */\nexport function literal(constant) {\n const description = print(constant);\n const valueType = typeof constant;\n return new Struct({\n type: 'literal',\n schema: valueType === 'string' ||\n valueType === 'number' ||\n valueType === 'boolean'\n ? constant\n : null,\n validator(value) {\n return (value === constant ||\n `Expected the literal \\`${description}\\`, but received: ${print(value)}`);\n },\n });\n}\n/**\n * Ensure that a value is a `Map` object, and that its keys and values are of\n * specific types.\n *\n * @param Key - The struct to validate each key in the map against.\n * @param Value - The struct to validate each value in the map against.\n * @returns A new struct that will only accept `Map` objects.\n */\nexport function map(Key, Value) {\n return new Struct({\n type: 'map',\n schema: null,\n *entries(value) {\n if (Key && Value && value instanceof Map) {\n for (const [mapKey, mapValue] of value.entries()) {\n yield [mapKey, mapKey, Key];\n yield [mapKey, mapValue, Value];\n }\n }\n },\n coercer(value) {\n return value instanceof Map ? new Map(value) : value;\n },\n validator(value) {\n return (value instanceof Map ||\n `Expected a \\`Map\\` object, but received: ${print(value)}`);\n },\n });\n}\n/**\n * Ensure that no value ever passes validation.\n *\n * @returns A new struct that will never pass validation.\n */\nexport function never() {\n return define('never', () => false);\n}\n/**\n * Augment an existing struct to allow `null` values.\n *\n * @param struct - The struct to augment.\n * @returns A new struct that will accept `null` values.\n */\nexport function nullable(struct) {\n return new Struct({\n ...struct,\n validator: (value, ctx) => value === null || struct.validator(value, ctx),\n refiner: (value, ctx) => value === null || struct.refiner(value, ctx),\n });\n}\n/**\n * Ensure that a value is a number.\n *\n * @returns A new struct that will only accept numbers.\n */\nexport function number() {\n return define('number', (value) => {\n return ((typeof value === 'number' && !isNaN(value)) ||\n `Expected a number, but received: ${print(value)}`);\n });\n}\n/**\n * Ensure that a value is an object, that it has a known set of properties,\n * and that its properties are of specific types.\n *\n * Note: Unrecognized properties will fail validation.\n *\n * @param schema - An object that defines the structure of the object.\n * @returns A new struct that will only accept objects.\n */\nexport function object(schema) {\n const knowns = schema ? Object.keys(schema) : [];\n const Never = never();\n const base = new Struct({\n type: 'object',\n schema: schema ?? null,\n *entries(value) {\n if (schema && isObject(value)) {\n const unknowns = new Set(Object.keys(value));\n for (const key of knowns) {\n unknowns.delete(key);\n const propertySchema = schema[key];\n if (ExactOptionalStruct.isExactOptional(propertySchema) &&\n !Object.prototype.hasOwnProperty.call(value, key)) {\n continue;\n }\n yield [key, value[key], schema[key]];\n }\n for (const key of unknowns) {\n yield [key, value[key], Never];\n }\n }\n },\n validator(value) {\n return (isObject(value) || `Expected an object, but received: ${print(value)}`);\n },\n coercer(value) {\n return isObject(value) ? { ...value } : value;\n },\n });\n if (!schema) {\n return base;\n }\n // `base` is typed as `Struct<unknown, Schema | null>` because the `Struct`\n // constructor receives `schema ?? null`. At this point `schema` is defined,\n // so the schema slot is actually `Schema`. The cast strips the `| null` so\n // `withSensitiveEntries` can accept it.\n return withSensitiveEntries(base, schema);\n}\n/**\n * Augment a struct to allow `undefined` values.\n *\n * @param struct - The struct to augment.\n * @returns A new struct that will accept `undefined` values.\n */\nexport function optional(struct) {\n return new Struct({\n ...struct,\n validator: (value, ctx) => value === undefined || struct.validator(value, ctx),\n refiner: (value, ctx) => value === undefined || struct.refiner(value, ctx),\n });\n}\n/**\n * Augment a struct such that, if it is the property of an object, it is exactly optional.\n * In other words, it is either present with the correct type, or not present at all.\n *\n * NOTE: Only intended for use with `object()` structs.\n *\n * @param struct - The struct to augment.\n * @returns A new struct that can be used to create exactly optional properties of `object()`\n * structs.\n */\nexport function exactOptional(struct) {\n return new ExactOptionalStruct(struct);\n}\n/**\n * Ensure that a value is an object with keys and values of specific types, but\n * without ensuring any specific shape of properties.\n *\n * Like TypeScript's `Record` utility.\n */\n/**\n * Ensure that a value is an object with keys and values of specific types, but\n * without ensuring any specific shape of properties.\n *\n * @param Key - The struct to validate each key in the record against.\n * @param Value - The struct to validate each value in the record against.\n * @returns A new struct that will only accept objects.\n */\nexport function record(Key, Value) {\n return new Struct({\n type: 'record',\n schema: null,\n *entries(value) {\n if (isObject(value)) {\n // eslint-disable-next-line guard-for-in\n for (const objectKey in value) {\n const objectValue = value[objectKey];\n yield [objectKey, objectKey, Key];\n yield [objectKey, objectValue, Value];\n }\n }\n },\n validator(value) {\n return (isObject(value) || `Expected an object, but received: ${print(value)}`);\n },\n });\n}\n/**\n * Ensure that a value is a `RegExp`.\n *\n * Note: this does not test the value against the regular expression! For that\n * you need to use the `pattern()` refinement.\n *\n * @returns A new struct that will only accept `RegExp` objects.\n */\nexport function regexp() {\n return define('regexp', (value) => {\n return value instanceof RegExp;\n });\n}\n/**\n * Ensure that a value is a `Set` object, and that its elements are of a\n * specific type.\n *\n * @param Element - The struct to validate each element in the set against.\n * @returns A new struct that will only accept `Set` objects.\n */\nexport function set(Element) {\n return new Struct({\n type: 'set',\n schema: null,\n *entries(value) {\n if (Element && value instanceof Set) {\n for (const setValue of value) {\n yield [setValue, setValue, Element];\n }\n }\n },\n coercer(value) {\n return value instanceof Set ? new Set(value) : value;\n },\n validator(value) {\n return (value instanceof Set ||\n `Expected a \\`Set\\` object, but received: ${print(value)}`);\n },\n });\n}\n/**\n * Ensure that a value is a string.\n *\n * @returns A new struct that will only accept strings.\n */\nexport function string() {\n return define('string', (value) => {\n return (typeof value === 'string' ||\n `Expected a string, but received: ${print(value)}`);\n });\n}\n/**\n * Ensure that a value is a tuple of a specific length, and that each of its\n * elements is of a specific type.\n *\n * @param Structs - The set of structs that the value must match.\n * @returns A new struct that will only accept tuples of the given types.\n */\nexport function tuple(Structs) {\n const Never = never();\n return new Struct({\n type: 'tuple',\n schema: null,\n *entries(value) {\n if (Array.isArray(value)) {\n const length = Math.max(Structs.length, value.length);\n for (let i = 0; i < length; i++) {\n yield [i, value[i], Structs[i] || Never];\n }\n }\n },\n validator(value) {\n return (Array.isArray(value) ||\n `Expected an array, but received: ${print(value)}`);\n },\n });\n}\n/**\n * Ensure that a value has a set of known properties of specific types.\n *\n * Note: Unrecognized properties are allowed and untouched. This is similar to\n * how TypeScript's structural typing works.\n *\n * @param schema - An object that defines the structure of the object.\n * @returns A new struct that will only accept objects.\n */\nexport function type(schema) {\n const keys = Object.keys(schema);\n const base = new Struct({\n type: 'type',\n schema,\n *entries(value) {\n if (isObject(value)) {\n for (const k of keys) {\n if (ExactOptionalStruct.isExactOptional(schema[k]) &&\n !Object.prototype.hasOwnProperty.call(value, k)) {\n continue;\n }\n yield [k, value[k], schema[k]];\n }\n }\n },\n validator(value) {\n return (isObject(value) || `Expected an object, but received: ${print(value)}`);\n },\n coercer(value) {\n return isObject(value) ? { ...value } : value;\n },\n });\n return withSensitiveEntries(base, schema);\n}\n/**\n * Ensure that a value matches one of a set of types.\n *\n * @param Structs - The set of structs that the value must match.\n * @returns A new struct that will only accept values that match one of the\n * given structs.\n */\nexport function union(Structs) {\n const description = Structs.map((struct) => struct.type).join(' | ');\n return new Struct({\n type: 'union',\n schema: null,\n coercer(value) {\n for (const InnerStruct of Structs) {\n const [error, coerced] = InnerStruct.validate(value, { coerce: true });\n if (!error) {\n return coerced;\n }\n }\n return value;\n },\n validator(value, ctx) {\n const failures = [];\n for (const InnerStruct of Structs) {\n const [...tuples] = run(value, InnerStruct, ctx);\n const [first] = tuples;\n if (!first?.[0]) {\n return [];\n }\n for (const [failure] of tuples) {\n if (failure) {\n failures.push(failure);\n }\n }\n }\n return [\n `Expected the value to satisfy a union of \\`${description}\\`, but received: ${print(value)}`,\n ...failures,\n ];\n },\n });\n}\n/**\n * Ensure that any value passes validation, without widening its type to `any`.\n *\n * @returns A struct that will always pass validation.\n */\nexport function unknown() {\n return define('unknown', () => true);\n}\n//# sourceMappingURL=types.mjs.map","import { Struct, is } from \"../struct.mjs\";\nimport { isPlainObject } from \"../utils.mjs\";\nimport { string, unknown } from \"./types.mjs\";\n/**\n * Augment a `Struct` to add an additional coercion step to its input.\n *\n * This allows you to transform input data before validating it, to increase the\n * likelihood that it passes validation—for example for default values, parsing\n * different formats, etc.\n *\n * Note: You must use `create(value, Struct)` on the value to have the coercion\n * take effect! Using simply `assert()` or `is()` will not use coercion.\n *\n * @param struct - The struct to augment.\n * @param condition - A struct that the input must pass to be coerced.\n * @param coercer - A function that takes the input and returns the coerced\n * value.\n * @returns A new struct that will coerce its input before validating it.\n */\nexport function coerce(struct, condition, coercer) {\n return new Struct({\n ...struct,\n coercer: (value, ctx) => {\n return is(value, condition)\n ? struct.coercer(coercer(value, ctx), ctx)\n : struct.coercer(value, ctx);\n },\n });\n}\n/**\n * Augment a struct to replace `undefined` values with a default.\n *\n * Note: You must use `create(value, Struct)` on the value to have the coercion\n * take effect! Using simply `assert()` or `is()` will not use coercion.\n *\n * @param struct - The struct to augment.\n * @param fallback - The value to use when the input is `undefined`.\n * @param options - An optional options object.\n * @param options.strict - When `true`, the fallback will only be used when the\n * input is `undefined`. When `false`, the fallback will be used when the input\n * is `undefined` or when the input is a plain object and the fallback is a\n * plain object, and any keys in the fallback are missing from the input.\n * @returns A new struct that will replace `undefined` inputs with a default.\n */\nexport function defaulted(struct, fallback, options = {}) {\n return coerce(struct, unknown(), (value) => {\n const result = typeof fallback === 'function' ? fallback() : fallback;\n if (value === undefined) {\n return result;\n }\n if (!options.strict && isPlainObject(value) && isPlainObject(result)) {\n const ret = { ...value };\n let changed = false;\n for (const key in result) {\n if (ret[key] === undefined) {\n ret[key] = result[key];\n changed = true;\n }\n }\n if (changed) {\n return ret;\n }\n }\n return value;\n });\n}\n/**\n * Augment a struct to trim string inputs.\n *\n * Note: You must use `create(value, Struct)` on the value to have the coercion\n * take effect! Using simply `assert()` or `is()` will not use coercion.\n *\n * @param struct - The struct to augment.\n * @returns A new struct that will trim string inputs before validating them.\n */\nexport function trimmed(struct) {\n return coerce(struct, string(), (value) => value.trim());\n}\n//# sourceMappingURL=coercions.mjs.map","import { Struct } from \"../struct.mjs\";\nimport { toFailures } from \"../utils.mjs\";\n/**\n * Ensure that a string, array, map, or set is empty.\n *\n * @param struct - The struct to augment.\n * @returns A new struct that will only accept empty values.\n */\nexport function empty(struct) {\n return refine(struct, 'empty', (value) => {\n // eslint-disable-next-line @typescript-eslint/no-shadow\n const size = getSize(value);\n return (size === 0 ||\n `Expected an empty ${struct.type} but received one with a size of \\`${size}\\``);\n });\n}\n/**\n * Get the size of a string, array, map, or set.\n *\n * @param value - The value to measure.\n * @returns The size of the value.\n */\nfunction getSize(value) {\n if (value instanceof Map || value instanceof Set) {\n return value.size;\n }\n return value.length;\n}\n/**\n * Ensure that a number or date is below a threshold.\n *\n * @param struct - The struct to augment.\n * @param threshold - The maximum value that the input can be.\n * @param options - An optional options object.\n * @param options.exclusive - When `true`, the input must be strictly less than\n * the threshold. When `false`, the input must be less than or equal to the\n * threshold.\n * @returns A new struct that will only accept values below the threshold.\n */\nexport function max(struct, threshold, options = {}) {\n const { exclusive } = options;\n return refine(struct, 'max', (value) => {\n return exclusive\n ? value < threshold\n : value <= threshold ||\n `Expected a ${struct.type} less than ${exclusive ? '' : 'or equal to '\n // eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n }${threshold} but received \\`${value}\\``;\n });\n}\n/**\n * Ensure that a number or date is above a threshold.\n *\n * @param struct - The struct to augment.\n * @param threshold - The minimum value that the input can be.\n * @param options - An optional options object.\n * @param options.exclusive - When `true`, the input must be strictly greater\n * than the threshold. When `false`, the input must be greater than or equal to\n * the threshold.\n * @returns A new struct that will only accept values above the threshold.\n */\nexport function min(struct, threshold, options = {}) {\n const { exclusive } = options;\n return refine(struct, 'min', (value) => {\n return exclusive\n ? value > threshold\n : value >= threshold ||\n `Expected a ${struct.type} greater than ${exclusive ? '' : 'or equal to '\n // eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n }${threshold} but received \\`${value}\\``;\n });\n}\n/**\n * Ensure that a string, array, map or set is not empty.\n *\n * @param struct - The struct to augment.\n * @returns A new struct that will only accept non-empty values.\n */\nexport function nonempty(struct) {\n return refine(struct, 'nonempty', (value) => {\n // eslint-disable-next-line @typescript-eslint/no-shadow\n const size = getSize(value);\n return (size > 0 || `Expected a nonempty ${struct.type} but received an empty one`);\n });\n}\n/**\n * Ensure that a string matches a regular expression.\n *\n * @param struct - The struct to augment.\n * @param regexp - The regular expression to match against.\n * @returns A new struct that will only accept strings matching the regular\n * expression.\n */\nexport function pattern(struct, regexp) {\n return refine(struct, 'pattern', (value) => {\n return (regexp.test(value) ||\n `Expected a ${struct.type} matching \\`/${regexp.source}/\\` but received \"${value}\"`);\n });\n}\n/**\n * Ensure that a string, array, number, date, map, or set has a size (or length,\n * or time) between `min` and `max`.\n *\n * @param struct - The struct to augment.\n * @param minimum - The minimum size that the input can be.\n * @param maximum - The maximum size that the input can be.\n * @returns A new struct that will only accept values within the given size\n * range.\n */\nexport function size(struct, minimum, maximum = minimum) {\n const expected = `Expected a ${struct.type}`;\n const of = minimum === maximum\n ? `of \\`${minimum}\\``\n : `between \\`${minimum}\\` and \\`${maximum}\\``;\n return refine(struct, 'size', (value) => {\n if (typeof value === 'number' || value instanceof Date) {\n return ((minimum <= value && value <= maximum) ||\n // eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n `${expected} ${of} but received \\`${value}\\``);\n }\n else if (value instanceof Map || value instanceof Set) {\n // eslint-disable-next-line @typescript-eslint/no-shadow\n const { size } = value;\n return ((minimum <= size && size <= maximum) ||\n `${expected} with a size ${of} but received one with a size of \\`${size}\\``);\n }\n const { length } = value;\n return ((minimum <= length && length <= maximum) ||\n `${expected} with a length ${of} but received one with a length of \\`${length}\\``);\n });\n}\n/**\n * Augment a `Struct` to add an additional refinement to the validation.\n *\n * The refiner function is guaranteed to receive a value of the struct's type,\n * because the struct's existing validation will already have passed. This\n * allows you to layer additional validation on top of existing structs.\n *\n * @param struct - The struct to augment.\n * @param name - The name of the refinement.\n * @param refiner - The refiner function.\n * @returns A new struct that will run the refiner function after the existing\n * validation.\n */\nexport function refine(struct, name, refiner) {\n return new Struct({\n ...struct,\n *refiner(value, ctx) {\n yield* struct.refiner(value, ctx);\n const result = refiner(value, ctx);\n const failures = toFailures(result, ctx, struct, value);\n for (const failure of failures) {\n yield { ...failure, refinement: name };\n }\n },\n });\n}\n//# sourceMappingURL=refinements.mjs.map","//\n// Types\n//\n//\n// Type Guards\n//\n/**\n * A {@link NonEmptyArray} type guard.\n *\n * @template Element - The non-empty array member type.\n * @param value - The value to check.\n * @returns Whether the value is a non-empty array.\n */\nexport function isNonEmptyArray(value) {\n return Array.isArray(value) && value.length > 0;\n}\n/**\n * Type guard for \"nullishness\".\n *\n * @param value - Any value.\n * @returns `true` if the value is null or undefined, `false` otherwise.\n */\nexport function isNullOrUndefined(value) {\n return value === null || value === undefined;\n}\n/**\n * A type guard for {@link RuntimeObject}.\n *\n * @param value - The value to check.\n * @returns Whether the specified value has a runtime type of `object` and is\n * neither `null` nor an `Array`.\n */\nexport function isObject(value) {\n return Boolean(value) && typeof value === 'object' && !Array.isArray(value);\n}\n//\n// Other utility functions\n//\n/**\n * A type guard for ensuring an object has a property.\n *\n * @param objectToCheck - The object to check.\n * @param name - The property name to check for.\n * @returns Whether the specified object has an own property with the specified\n * name, regardless of whether it is enumerable or not.\n */\nexport const hasProperty = (objectToCheck, name) => Object.hasOwnProperty.call(objectToCheck, name);\n/**\n * `Object.getOwnPropertyNames()` is intentionally generic: it returns the\n * immediate property names of an object, but it cannot make guarantees about\n * the contents of that object, so the type of the property names is merely\n * `string[]`. While this is technically accurate, it is also unnecessary if we\n * have an object with a type that we own (such as an enum).\n *\n * @param object - The plain object.\n * @returns The own property names of the object which are assigned a type\n * derived from the object itself.\n */\nexport function getKnownPropertyNames(object) {\n return Object.getOwnPropertyNames(object);\n}\n/**\n * Predefined sizes (in Bytes) of specific parts of JSON structure.\n */\nexport var JsonSize;\n(function (JsonSize) {\n JsonSize[JsonSize[\"Null\"] = 4] = \"Null\";\n JsonSize[JsonSize[\"Comma\"] = 1] = \"Comma\";\n JsonSize[JsonSize[\"Wrapper\"] = 1] = \"Wrapper\";\n JsonSize[JsonSize[\"True\"] = 4] = \"True\";\n JsonSize[JsonSize[\"False\"] = 5] = \"False\";\n JsonSize[JsonSize[\"Quote\"] = 1] = \"Quote\";\n JsonSize[JsonSize[\"Colon\"] = 1] = \"Colon\";\n // eslint-disable-next-line @typescript-eslint/no-shadow\n JsonSize[JsonSize[\"Date\"] = 24] = \"Date\";\n})(JsonSize = JsonSize || (JsonSize = {}));\n/**\n * Regular expression with pattern matching for (special) escaped characters.\n */\nexport const ESCAPE_CHARACTERS_REGEXP = /\"|\\\\|\\n|\\r|\\t/gu;\n/**\n * Check if the value is plain object.\n *\n * @param value - Value to be checked.\n * @returns True if an object is the plain JavaScript object,\n * false if the object is not plain (e.g. function).\n */\nexport function isPlainObject(value) {\n if (typeof value !== 'object' || value === null) {\n return false;\n }\n try {\n let proto = value;\n while (Object.getPrototypeOf(proto) !== null) {\n proto = Object.getPrototypeOf(proto);\n }\n return Object.getPrototypeOf(value) === proto;\n }\n catch (_) {\n return false;\n }\n}\n/**\n * Check if character is ASCII.\n *\n * @param character - Character.\n * @returns True if a character code is ASCII, false if not.\n */\nexport function isASCII(character) {\n return character.charCodeAt(0) <= 127;\n}\n/**\n * Calculate string size.\n *\n * @param value - String value to calculate size.\n * @returns Number of bytes used to store whole string value.\n */\nexport function calculateStringSize(value) {\n const size = value.split('').reduce((total, character) => {\n if (isASCII(character)) {\n return total + 1;\n }\n return total + 2;\n }, 0);\n // Also detect characters that need backslash escape\n return size + (value.match(ESCAPE_CHARACTERS_REGEXP) ?? []).length;\n}\n/**\n * Calculate size of a number ofter JSON serialization.\n *\n * @param value - Number value to calculate size.\n * @returns Number of bytes used to store whole number in JSON.\n */\nexport function calculateNumberSize(value) {\n return value.toString().length;\n}\n//# sourceMappingURL=misc.mjs.map","import { any, array, coerce, create, define, integer, is, literal, nullable, number, object as superstructObject, optional, record, string, union, unknown, Struct, refine } from \"@metamask/superstruct\";\nimport { assertStruct } from \"./assert.mjs\";\nimport { hasProperty } from \"./misc.mjs\";\n/**\n * A struct to check if the given value is a valid object, with support for\n * {@link exactOptional} types.\n *\n * @deprecated Use `exactOptional` and `object` from `@metamask/superstruct@>=3.2.0` instead.\n * @param schema - The schema of the object.\n * @returns A struct to check if the given value is an object.\n */\nexport const object = (schema) => \n// The type is slightly different from a regular object struct, because we\n// want to make properties with `undefined` in their type optional, but not\n// `undefined` itself. This means that we need a type cast.\nsuperstructObject(schema);\n/**\n * Check the last field of a path is present.\n *\n * @param context - The context to check.\n * @param context.path - The path to check.\n * @param context.branch - The branch to check.\n * @returns Whether the last field of a path is present.\n */\nfunction hasOptional({ path, branch }) {\n const field = path[path.length - 1];\n return hasProperty(branch[branch.length - 2], field);\n}\n/**\n * A struct which allows the property of an object to be absent, or to be present\n * as long as it's valid and not set to `undefined`.\n *\n * This struct should be used in conjunction with the {@link object} from this\n * library, to get proper type inference.\n *\n * @deprecated Use `exactOptional` and `object` from `@metamask/superstruct@>=3.2.0` instead.\n * @param struct - The struct to check the value against, if present.\n * @returns A struct to check if the given value is valid, or not present.\n * @example\n * ```ts\n * const struct = object({\n * foo: exactOptional(string()),\n * bar: exactOptional(number()),\n * baz: optional(boolean()),\n * qux: unknown(),\n * });\n *\n * type Type = Infer<typeof struct>;\n * // Type is equivalent to:\n * // {\n * // foo?: string;\n * // bar?: number;\n * // baz?: boolean | undefined;\n * // qux: unknown;\n * // }\n * ```\n */\nexport function exactOptional(struct) {\n return new Struct({\n ...struct,\n type: `optional ${struct.type}`,\n validator: (value, context) => !hasOptional(context) || struct.validator(value, context),\n refiner: (value, context) => !hasOptional(context) || struct.refiner(value, context),\n });\n}\n/**\n * Validate an unknown input to be valid JSON.\n *\n * Useful for constructing JSON structs.\n *\n * @param json - An unknown value.\n * @returns True if the value is valid JSON, otherwise false.\n */\nfunction validateJson(json) {\n if (json === null || typeof json === 'boolean' || typeof json === 'string') {\n return true;\n }\n if (typeof json === 'number' && Number.isFinite(json)) {\n return true;\n }\n if (typeof json === 'object') {\n let every = true;\n if (Array.isArray(json)) {\n // Ignoring linting error since for-of is significantly slower than a normal for-loop\n // and performance is important in this specific function.\n // eslint-disable-next-line @typescript-eslint/prefer-for-of\n for (let i = 0; i < json.length; i++) {\n if (!validateJson(json[i])) {\n every = false;\n break;\n }\n }\n return every;\n }\n const entries = Object.entries(json);\n // Ignoring linting errors since for-of is significantly slower than a normal for-loop\n // and performance is important in this specific function.\n // eslint-disable-next-line @typescript-eslint/prefer-for-of\n for (let i = 0; i < entries.length; i++) {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n if (typeof entries[i][0] !== 'string' || !validateJson(entries[i][1])) {\n every = false;\n break;\n }\n }\n return every;\n }\n return false;\n}\n/**\n * A struct to check if the given value is a valid JSON-serializable value.\n *\n * Note that this struct is unsafe. For safe validation, use {@link JsonStruct}.\n */\nexport const UnsafeJsonStruct = define('JSON', (json) => validateJson(json));\n/**\n * A struct to check if the given value is a valid JSON-serializable value.\n *\n * This struct sanitizes the value before validating it, so that it is safe to\n * use with untrusted input.\n */\nexport const JsonStruct = coerce(UnsafeJsonStruct, refine(any(), 'JSON', (value) => is(value, UnsafeJsonStruct)), (value) => JSON.parse(JSON.stringify(value, (propKey, propValue) => {\n // Strip __proto__ and constructor properties to prevent prototype pollution.\n if (propKey === '__proto__' || propKey === 'constructor') {\n return undefined;\n }\n return propValue;\n})));\n/**\n * Check if the given value is a valid {@link Json} value, i.e., a value that is\n * serializable to JSON.\n *\n * @param value - The value to check.\n * @returns Whether the value is a valid {@link Json} value.\n */\nexport function isValidJson(value) {\n try {\n getSafeJson(value);\n return true;\n }\n catch {\n return false;\n }\n}\n/**\n * Validate and return sanitized JSON.\n *\n * Note:\n * This function uses sanitized JsonStruct for validation\n * that applies stringify and then parse of a value provided\n * to ensure that there are no getters which can have side effects\n * that can cause security issues.\n *\n * @param value - JSON structure to be processed.\n * @returns Sanitized JSON structure.\n */\nexport function getSafeJson(value) {\n return create(value, JsonStruct);\n}\n/**\n * Get the size of a JSON value in bytes. This also validates the value.\n *\n * @param value - The JSON value to get the size of.\n * @returns The size of the JSON value in bytes.\n */\nexport function getJsonSize(value) {\n assertStruct(value, JsonStruct, 'Invalid JSON value');\n const json = JSON.stringify(value);\n return new TextEncoder().encode(json).byteLength;\n}\n/**\n * The string '2.0'.\n */\nexport const jsonrpc2 = '2.0';\nexport const JsonRpcVersionStruct = literal(jsonrpc2);\nexport const JsonRpcIdStruct = nullable(union([number(), string()]));\nexport const JsonRpcErrorStruct = object({\n code: integer(),\n message: string(),\n data: exactOptional(JsonStruct),\n stack: exactOptional(string()),\n});\nexport const JsonRpcParamsStruct = union([record(string(), JsonStruct), array(JsonStruct)]);\nexport const JsonRpcRequestStruct = object({\n id: JsonRpcIdStruct,\n jsonrpc: JsonRpcVersionStruct,\n method: string(),\n params: exactOptional(JsonRpcParamsStruct),\n});\nexport const JsonRpcNotificationStruct = object({\n jsonrpc: JsonRpcVersionStruct,\n method: string(),\n params: exactOptional(JsonRpcParamsStruct),\n});\n/**\n * Check if the given value is a valid {@link JsonRpcNotification} object.\n *\n * @param value - The value to check.\n * @returns Whether the given value is a valid {@link JsonRpcNotification}\n * object.\n */\nexport function isJsonRpcNotification(value) {\n return is(value, JsonRpcNotificationStruct);\n}\n/**\n * Assert that the given value is a valid {@link JsonRpcNotification} object.\n *\n * @param value - The value to check.\n * @param ErrorWrapper - The error class to throw if the assertion fails.\n * Defaults to {@link AssertionError}.\n * @throws If the given value is not a valid {@link JsonRpcNotification} object.\n */\nexport function assertIsJsonRpcNotification(value, \n// eslint-disable-next-line @typescript-eslint/naming-convention\nErrorWrapper) {\n assertStruct(value, JsonRpcNotificationStruct, 'Invalid JSON-RPC notification', ErrorWrapper);\n}\n/**\n * Check if the given value is a valid {@link JsonRpcRequest} object.\n *\n * @param value - The value to check.\n * @returns Whether the given value is a valid {@link JsonRpcRequest} object.\n */\nexport function isJsonRpcRequest(value) {\n return is(value, JsonRpcRequestStruct);\n}\n/**\n * Assert that the given value is a valid {@link JsonRpcRequest} object.\n *\n * @param value - The JSON-RPC request or notification to check.\n * @param ErrorWrapper - The error class to throw if the assertion fails.\n * Defaults to {@link AssertionError}.\n * @throws If the given value is not a valid {@link JsonRpcRequest} object.\n */\nexport function assertIsJsonRpcRequest(value, \n// eslint-disable-next-line @typescript-eslint/naming-convention\nErrorWrapper) {\n assertStruct(value, JsonRpcRequestStruct, 'Invalid JSON-RPC request', ErrorWrapper);\n}\nexport const PendingJsonRpcResponseStruct = superstructObject({\n id: JsonRpcIdStruct,\n jsonrpc: JsonRpcVersionStruct,\n result: optional(unknown()),\n error: optional(JsonRpcErrorStruct),\n});\nexport const JsonRpcSuccessStruct = object({\n id: JsonRpcIdStruct,\n jsonrpc: JsonRpcVersionStruct,\n result: JsonStruct,\n});\nexport const JsonRpcFailureStruct = object({\n id: JsonRpcIdStruct,\n jsonrpc: JsonRpcVersionStruct,\n error: JsonRpcErrorStruct,\n});\nexport const JsonRpcResponseStruct = union([\n JsonRpcSuccessStruct,\n JsonRpcFailureStruct,\n]);\n/**\n * Type guard to check whether specified JSON-RPC response is a\n * {@link PendingJsonRpcResponse}.\n *\n * @param response - The JSON-RPC response to check.\n * @returns Whether the specified JSON-RPC response is pending.\n */\nexport function isPendingJsonRpcResponse(response) {\n return is(response, PendingJsonRpcResponseStruct);\n}\n/**\n * Assert that the given value is a valid {@link PendingJsonRpcResponse} object.\n *\n * @param response - The JSON-RPC response to check.\n * @param ErrorWrapper - The error class to throw if the assertion fails.\n * Defaults to {@link AssertionError}.\n * @throws If the given value is not a valid {@link PendingJsonRpcResponse}\n * object.\n */\nexport function assertIsPendingJsonRpcResponse(response, \n// eslint-disable-next-line @typescript-eslint/naming-convention\nErrorWrapper) {\n assertStruct(response, PendingJsonRpcResponseStruct, 'Invalid pending JSON-RPC response', ErrorWrapper);\n}\n/**\n * Type guard to check if a value is a {@link JsonRpcResponse}.\n *\n * @param response - The object to check.\n * @returns Whether the object is a JsonRpcResponse.\n */\nexport function isJsonRpcResponse(response) {\n return is(response, JsonRpcResponseStruct);\n}\n/**\n * Assert that the given value is a valid {@link JsonRpcResponse} object.\n *\n * @param value - The value to check.\n * @param ErrorWrapper - The error class to throw if the assertion fails.\n * Defaults to {@link AssertionError}.\n * @throws If the given value is not a valid {@link JsonRpcResponse} object.\n */\nexport function assertIsJsonRpcResponse(value, \n// eslint-disable-next-line @typescript-eslint/naming-convention\nErrorWrapper) {\n assertStruct(value, JsonRpcResponseStruct, 'Invalid JSON-RPC response', ErrorWrapper);\n}\n/**\n * Check if the given value is a valid {@link JsonRpcSuccess} object.\n *\n * @param value - The value to check.\n * @returns Whether the given value is a valid {@link JsonRpcSuccess} object.\n */\nexport function isJsonRpcSuccess(value) {\n return is(value, JsonRpcSuccessStruct);\n}\n/**\n * Assert that the given value is a valid {@link JsonRpcSuccess} object.\n *\n * @param value - The value to check.\n * @param ErrorWrapper - The error class to throw if the assertion fails.\n * Defaults to {@link AssertionError}.\n * @throws If the given value is not a valid {@link JsonRpcSuccess} object.\n */\nexport function assertIsJsonRpcSuccess(value, \n// eslint-disable-next-line @typescript-eslint/naming-convention\nErrorWrapper) {\n assertStruct(value, JsonRpcSuccessStruct, 'Invalid JSON-RPC success response', ErrorWrapper);\n}\n/**\n * Check if the given value is a valid {@link JsonRpcFailure} object.\n *\n * @param value - The value to check.\n * @returns Whether the given value is a valid {@link JsonRpcFailure} object.\n */\nexport function isJsonRpcFailure(value) {\n return is(value, JsonRpcFailureStruct);\n}\n/**\n * Assert that the given value is a valid {@link JsonRpcFailure} object.\n *\n * @param value - The value to check.\n * @param ErrorWrapper - The error class to throw if the assertion fails.\n * Defaults to {@link AssertionError}.\n * @throws If the given value is not a valid {@link JsonRpcFailure} object.\n */\nexport function assertIsJsonRpcFailure(value, \n// eslint-disable-next-line @typescript-eslint/naming-convention\nErrorWrapper) {\n assertStruct(value, JsonRpcFailureStruct, 'Invalid JSON-RPC failure response', ErrorWrapper);\n}\n/**\n * Check if the given value is a valid {@link JsonRpcError} object.\n *\n * @param value - The value to check.\n * @returns Whether the given value is a valid {@link JsonRpcError} object.\n */\nexport function isJsonRpcError(value) {\n return is(value, JsonRpcErrorStruct);\n}\n/**\n * Assert that the given value is a valid {@link JsonRpcError} object.\n *\n * @param value - The value to check.\n * @param ErrorWrapper - The error class to throw if the assertion fails.\n * Defaults to {@link AssertionError}.\n * @throws If the given value is not a valid {@link JsonRpcError} object.\n */\nexport function assertIsJsonRpcError(value, \n// eslint-disable-next-line @typescript-eslint/naming-convention\nErrorWrapper) {\n assertStruct(value, JsonRpcErrorStruct, 'Invalid JSON-RPC error', ErrorWrapper);\n}\n/**\n * Gets a function for validating JSON-RPC request / response `id` values.\n *\n * By manipulating the options of this factory, you can control the behavior\n * of the resulting validator for some edge cases. This is useful because e.g.\n * `null` should sometimes but not always be permitted.\n *\n * Note that the empty string (`''`) is always permitted by the JSON-RPC\n * specification, but that kind of sucks and you may want to forbid it in some\n * instances anyway.\n *\n * For more details, see the\n * [JSON-RPC Specification](https://www.jsonrpc.org/specification).\n *\n * @param options - An options object.\n * @param options.permitEmptyString - Whether the empty string (i.e. `''`)\n * should be treated as a valid ID. Default: `true`\n * @param options.permitFractions - Whether fractional numbers (e.g. `1.2`)\n * should be treated as valid IDs. Default: `false`\n * @param options.permitNull - Whether `null` should be treated as a valid ID.\n * Default: `true`\n * @returns The JSON-RPC ID validator function.\n */\nexport function getJsonRpcIdValidator(options) {\n const { permitEmptyString, permitFractions, permitNull } = {\n permitEmptyString: true,\n permitFractions: false,\n permitNull: true,\n ...options,\n };\n /**\n * Type guard for {@link JsonRpcId}.\n *\n * @param id - The JSON-RPC ID value to check.\n * @returns Whether the given ID is valid per the options given to the\n * factory.\n */\n const isValidJsonRpcId = (id) => {\n return Boolean((typeof id === 'number' && (permitFractions || Number.isInteger(id))) ||\n (typeof id === 'string' && (permitEmptyString || id.length > 0)) ||\n (permitNull && id === null));\n };\n return isValidJsonRpcId;\n}\n//# sourceMappingURL=json.mjs.map","module.exports = stringify\nstringify.default = stringify\nstringify.stable = deterministicStringify\nstringify.stableStringify = deterministicStringify\n\nvar LIMIT_REPLACE_NODE = '[...]'\nvar CIRCULAR_REPLACE_NODE = '[Circular]'\n\nvar arr = []\nvar replacerStack = []\n\nfunction defaultOptions () {\n return {\n depthLimit: Number.MAX_SAFE_INTEGER,\n edgesLimit: Number.MAX_SAFE_INTEGER\n }\n}\n\n// Regular stringify\nfunction stringify (obj, replacer, spacer, options) {\n if (typeof options === 'undefined') {\n options = defaultOptions()\n }\n\n decirc(obj, '', 0, [], undefined, 0, options)\n var res\n try {\n if (replacerStack.length === 0) {\n res = JSON.stringify(obj, replacer, spacer)\n } else {\n res = JSON.stringify(obj, replaceGetterValues(replacer), spacer)\n }\n } catch (_) {\n return JSON.stringify('[unable to serialize, circular reference is too complex to analyze]')\n } finally {\n while (arr.length !== 0) {\n var part = arr.pop()\n if (part.length === 4) {\n Object.defineProperty(part[0], part[1], part[3])\n } else {\n part[0][part[1]] = part[2]\n }\n }\n }\n return res\n}\n\nfunction setReplace (replace, val, k, parent) {\n var propertyDescriptor = Object.getOwnPropertyDescriptor(parent, k)\n if (propertyDescriptor.get !== undefined) {\n if (propertyDescriptor.configurable) {\n Object.defineProperty(parent, k, { value: replace })\n arr.push([parent, k, val, propertyDescriptor])\n } else {\n replacerStack.push([val, k, replace])\n }\n } else {\n parent[k] = replace\n arr.push([parent, k, val])\n }\n}\n\nfunction decirc (val, k, edgeIndex, stack, parent, depth, options) {\n depth += 1\n var i\n if (typeof val === 'object' && val !== null) {\n for (i = 0; i < stack.length; i++) {\n if (stack[i] === val) {\n setReplace(CIRCULAR_REPLACE_NODE, val, k, parent)\n return\n }\n }\n\n if (\n typeof options.depthLimit !== 'undefined' &&\n depth > options.depthLimit\n ) {\n setReplace(LIMIT_REPLACE_NODE, val, k, parent)\n return\n }\n\n if (\n typeof options.edgesLimit !== 'undefined' &&\n edgeIndex + 1 > options.edgesLimit\n ) {\n setReplace(LIMIT_REPLACE_NODE, val, k, parent)\n return\n }\n\n stack.push(val)\n // Optimize for Arrays. Big arrays could kill the performance otherwise!\n if (Array.isArray(val)) {\n for (i = 0; i < val.length; i++) {\n decirc(val[i], i, i, stack, val, depth, options)\n }\n } else {\n var keys = Object.keys(val)\n for (i = 0; i < keys.length; i++) {\n var key = keys[i]\n decirc(val[key], key, i, stack, val, depth, options)\n }\n }\n stack.pop()\n }\n}\n\n// Stable-stringify\nfunction compareFunction (a, b) {\n if (a < b) {\n return -1\n }\n if (a > b) {\n return 1\n }\n return 0\n}\n\nfunction deterministicStringify (obj, replacer, spacer, options) {\n if (typeof options === 'undefined') {\n options = defaultOptions()\n }\n\n var tmp = deterministicDecirc(obj, '', 0, [], undefined, 0, options) || obj\n var res\n try {\n if (replacerStack.length === 0) {\n res = JSON.stringify(tmp, replacer, spacer)\n } else {\n res = JSON.stringify(tmp, replaceGetterValues(replacer), spacer)\n }\n } catch (_) {\n return JSON.stringify('[unable to serialize, circular reference is too complex to analyze]')\n } finally {\n // Ensure that we restore the object as it was.\n while (arr.length !== 0) {\n var part = arr.pop()\n if (part.length === 4) {\n Object.defineProperty(part[0], part[1], part[3])\n } else {\n part[0][part[1]] = part[2]\n }\n }\n }\n return res\n}\n\nfunction deterministicDecirc (val, k, edgeIndex, stack, parent, depth, options) {\n depth += 1\n var i\n if (typeof val === 'object' && val !== null) {\n for (i = 0; i < stack.length; i++) {\n if (stack[i] === val) {\n setReplace(CIRCULAR_REPLACE_NODE, val, k, parent)\n return\n }\n }\n try {\n if (typeof val.toJSON === 'function') {\n return\n }\n } catch (_) {\n return\n }\n\n if (\n typeof options.depthLimit !== 'undefined' &&\n depth > options.depthLimit\n ) {\n setReplace(LIMIT_REPLACE_NODE, val, k, parent)\n return\n }\n\n if (\n typeof options.edgesLimit !== 'undefined' &&\n edgeIndex + 1 > options.edgesLimit\n ) {\n setReplace(LIMIT_REPLACE_NODE, val, k, parent)\n return\n }\n\n stack.push(val)\n // Optimize for Arrays. Big arrays could kill the performance otherwise!\n if (Array.isArray(val)) {\n for (i = 0; i < val.length; i++) {\n deterministicDecirc(val[i], i, i, stack, val, depth, options)\n }\n } else {\n // Create a temporary object in the required way\n var tmp = {}\n var keys = Object.keys(val).sort(compareFunction)\n for (i = 0; i < keys.length; i++) {\n var key = keys[i]\n deterministicDecirc(val[key], key, i, stack, val, depth, options)\n tmp[key] = val[key]\n }\n if (typeof parent !== 'undefined') {\n arr.push([parent, k, val])\n parent[k] = tmp\n } else {\n return tmp\n }\n }\n stack.pop()\n }\n}\n\n// wraps replacer function to handle values we couldn't replace\n// and mark them as replaced value\nfunction replaceGetterValues (replacer) {\n replacer =\n typeof replacer !== 'undefined'\n ? replacer\n : function (k, v) {\n return v\n }\n return function (key, val) {\n if (replacerStack.length > 0) {\n for (var i = 0; i < replacerStack.length; i++) {\n var part = replacerStack[i]\n if (part[1] === key && part[0] === val) {\n val = part[2]\n replacerStack.splice(i, 1)\n break\n }\n }\n }\n return replacer.call(this, key, val)\n }\n}\n","export const errorCodes = {\n rpc: {\n invalidInput: -32000,\n resourceNotFound: -32001,\n resourceUnavailable: -32002,\n transactionRejected: -32003,\n methodNotSupported: -32004,\n limitExceeded: -32005,\n parse: -32700,\n invalidRequest: -32600,\n methodNotFound: -32601,\n invalidParams: -32602,\n internal: -32603,\n },\n provider: {\n userRejectedRequest: 4001,\n unauthorized: 4100,\n unsupportedMethod: 4200,\n disconnected: 4900,\n chainDisconnected: 4901,\n },\n};\n/* eslint-disable @typescript-eslint/naming-convention */\nexport const errorValues = {\n '-32700': {\n standard: 'JSON RPC 2.0',\n message: 'Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text.',\n },\n '-32600': {\n standard: 'JSON RPC 2.0',\n message: 'The JSON sent is not a valid Request object.',\n },\n '-32601': {\n standard: 'JSON RPC 2.0',\n message: 'The method does not exist / is not available.',\n },\n '-32602': {\n standard: 'JSON RPC 2.0',\n message: 'Invalid method parameter(s).',\n },\n '-32603': {\n standard: 'JSON RPC 2.0',\n message: 'Internal JSON-RPC error.',\n },\n '-32000': {\n standard: 'EIP-1474',\n message: 'Invalid input.',\n },\n '-32001': {\n standard: 'EIP-1474',\n message: 'Resource not found.',\n },\n '-32002': {\n standard: 'EIP-1474',\n message: 'Resource unavailable.',\n },\n '-32003': {\n standard: 'EIP-1474',\n message: 'Transaction rejected.',\n },\n '-32004': {\n standard: 'EIP-1474',\n message: 'Method not supported.',\n },\n '-32005': {\n standard: 'EIP-1474',\n message: 'Request limit exceeded.',\n },\n '4001': {\n standard: 'EIP-1193',\n message: 'User rejected the request.',\n },\n '4100': {\n standard: 'EIP-1193',\n message: 'The requested account and/or method has not been authorized by the user.',\n },\n '4200': {\n standard: 'EIP-1193',\n message: 'The requested method is not supported by this Ethereum provider.',\n },\n '4900': {\n standard: 'EIP-1193',\n message: 'The provider is disconnected from all chains.',\n },\n '4901': {\n standard: 'EIP-1193',\n message: 'The provider is disconnected from the specified chain.',\n },\n};\n/* eslint-enable @typescript-eslint/naming-convention */\n//# sourceMappingURL=error-constants.mjs.map","import { hasProperty, isValidJson, isObject, isJsonRpcError } from \"@metamask/utils\";\nimport { errorCodes, errorValues } from \"./error-constants.mjs\";\nconst FALLBACK_ERROR_CODE = errorCodes.rpc.internal;\nconst FALLBACK_MESSAGE = 'Unspecified error message. This is a bug, please report it.';\nconst FALLBACK_ERROR = {\n code: FALLBACK_ERROR_CODE,\n message: getMessageFromCode(FALLBACK_ERROR_CODE),\n};\nexport const JSON_RPC_SERVER_ERROR_MESSAGE = 'Unspecified server error.';\n/**\n * Gets the message for a given code, or a fallback message if the code has\n * no corresponding message.\n *\n * @param code - The error code.\n * @param fallbackMessage - The fallback message to use if the code has no\n * corresponding message.\n * @returns The message for the given code, or the fallback message if the code\n * has no corresponding message.\n */\nexport function getMessageFromCode(code, fallbackMessage = FALLBACK_MESSAGE) {\n if (isValidCode(code)) {\n const codeString = code.toString();\n if (hasProperty(errorValues, codeString)) {\n return errorValues[codeString].message;\n }\n if (isJsonRpcServerError(code)) {\n return JSON_RPC_SERVER_ERROR_MESSAGE;\n }\n }\n return fallbackMessage;\n}\n/**\n * Returns whether the given code is valid.\n * A code is valid if it is an integer.\n *\n * @param code - The error code.\n * @returns Whether the given code is valid.\n */\nexport function isValidCode(code) {\n return Number.isInteger(code);\n}\n/**\n * Serializes the given error to an Ethereum JSON RPC-compatible error object.\n * If the given error is not fully compatible, it will be preserved on the\n * returned object's data.cause property.\n *\n * @param error - The error to serialize.\n * @param options - Options bag.\n * @param options.fallbackError - The error to return if the given error is\n * not compatible. Should be a JSON-serializable value.\n * @param options.shouldIncludeStack - Whether to include the error's stack\n * on the returned object.\n * @param options.shouldPreserveMessage - Whether to preserve the error's\n * message if the fallback error is used.\n * @returns The serialized error.\n */\nexport function serializeError(error, { fallbackError = FALLBACK_ERROR, shouldIncludeStack = true, shouldPreserveMessage = true, } = {}) {\n if (!isJsonRpcError(fallbackError)) {\n throw new Error('Must provide fallback error with integer number code and string message.');\n }\n const serialized = buildError(error, fallbackError, shouldPreserveMessage);\n if (!shouldIncludeStack) {\n delete serialized.stack;\n }\n return serialized;\n}\n/**\n * Construct a JSON-serializable object given an error and a JSON-serializable `fallbackError`\n *\n * @param error - The error in question.\n * @param fallbackError - A JSON-serializable fallback error.\n * @param shouldPreserveMessage - Whether to preserve the error's message if the fallback\n * error is used.\n * @returns A JSON-serializable error object.\n */\nfunction buildError(error, fallbackError, shouldPreserveMessage) {\n // If an error specifies a `serialize` function, we call it and return the result.\n if (error &&\n typeof error === 'object' &&\n 'serialize' in error &&\n typeof error.serialize === 'function') {\n return error.serialize();\n }\n if (isJsonRpcError(error)) {\n return error;\n }\n const originalMessage = getOriginalMessage(error);\n // If the error does not match the JsonRpcError type, use the fallback error, but try to include the original error as `cause`.\n const cause = serializeCause(error);\n const fallbackWithCause = {\n ...fallbackError,\n ...(shouldPreserveMessage &&\n originalMessage && { message: originalMessage }),\n data: { cause },\n };\n return fallbackWithCause;\n}\n/**\n * Attempts to extract the original `message` property from an error value of uncertain shape.\n *\n * @param error - The error in question.\n * @returns The original message, if it exists and is a non-empty string.\n */\nfunction getOriginalMessage(error) {\n if (isObject(error) &&\n hasProperty(error, 'message') &&\n typeof error.message === 'string' &&\n error.message.length > 0) {\n return error.message;\n }\n return undefined;\n}\n/**\n * Check if the given code is a valid JSON-RPC server error code.\n *\n * @param code - The error code.\n * @returns Whether the given code is a valid JSON-RPC server error code.\n */\nfunction isJsonRpcServerError(code) {\n return code >= -32099 && code <= -32000;\n}\n/**\n * Serializes an unknown error to be used as the `cause` in a fallback error.\n *\n * @param error - The unknown error.\n * @returns A JSON-serializable object containing as much information about the original error as possible.\n */\nexport function serializeCause(error) {\n if (Array.isArray(error)) {\n return error.map((entry) => {\n if (isValidJson(entry)) {\n return entry;\n }\n else if (isObject(entry)) {\n return serializeObject(entry);\n }\n return null;\n });\n }\n else if (isObject(error)) {\n return serializeObject(error);\n }\n if (isValidJson(error)) {\n return error;\n }\n return null;\n}\n/**\n * Extracts all JSON-serializable properties from an object.\n *\n * @param object - The object in question.\n * @returns An object containing all the JSON-serializable properties.\n */\nfunction serializeObject(object) {\n return Object.getOwnPropertyNames(object).reduce((acc, key) => {\n const value = object[key];\n if (isValidJson(value)) {\n acc[key] = value;\n }\n return acc;\n }, {});\n}\n/**\n * Returns true if supplied error data has a usable `cause` property; false otherwise.\n *\n * @param data - Optional data to validate.\n * @returns Whether cause property is present and an object.\n */\nexport function dataHasCause(data) {\n return isObject(data) && hasProperty(data, 'cause') && isObject(data.cause);\n}\n//# sourceMappingURL=utils.mjs.map","function $importDefault(module) {\n if (module?.__esModule) {\n return module.default;\n }\n return module;\n}\nimport { hasProperty, isPlainObject } from \"@metamask/utils\";\nimport $safeStringify from \"fast-safe-stringify\";\nconst safeStringify = $importDefault($safeStringify);\nimport { dataHasCause, serializeCause } from \"./utils.mjs\";\n/**\n * Error subclass implementing JSON RPC 2.0 errors and Ethereum RPC errors\n * per EIP-1474.\n *\n * Permits any integer error code.\n */\nexport class JsonRpcError extends Error {\n constructor(code, message, data) {\n if (!Number.isInteger(code)) {\n throw new Error('\"code\" must be an integer.');\n }\n if (!message || typeof message !== 'string') {\n throw new Error('\"message\" must be a non-empty string.');\n }\n if (dataHasCause(data)) {\n // @ts-expect-error - Error class does accept options argument depending on runtime, but types are mapping to oldest supported\n super(message, { cause: data.cause });\n // Browser backwards-compatibility fallback\n if (!hasProperty(this, 'cause')) {\n Object.assign(this, { cause: data.cause });\n }\n }\n else {\n super(message);\n }\n if (data !== undefined) {\n this.data = data;\n }\n this.code = code;\n }\n /**\n * Get the error as JSON-serializable object.\n *\n * @returns A plain object with all public class properties.\n */\n serialize() {\n const serialized = {\n code: this.code,\n message: this.message,\n };\n if (this.data !== undefined) {\n // `this.data` is not guaranteed to be a plain object, but this simplifies\n // the type guard below. We can safely cast it because we know it's a\n // JSON-serializable value.\n serialized.data = this.data;\n if (isPlainObject(this.data)) {\n serialized.data.cause = serializeCause(this.data.cause);\n }\n }\n if (this.stack) {\n serialized.stack = this.stack;\n }\n return serialized;\n }\n /**\n * Get a string representation of the serialized error, omitting any circular\n * references.\n *\n * @returns A string representation of the serialized error.\n */\n toString() {\n return safeStringify(this.serialize(), stringifyReplacer, 2);\n }\n}\n/**\n * Error subclass implementing Ethereum Provider errors per EIP-1193.\n * Permits integer error codes in the [ 1000 <= 4999 ] range.\n */\nexport class EthereumProviderError extends JsonRpcError {\n /**\n * Create an Ethereum Provider JSON-RPC error.\n *\n * @param code - The JSON-RPC error code. Must be an integer in the\n * `1000 <= n <= 4999` range.\n * @param message - The JSON-RPC error message.\n * @param data - Optional data to include in the error.\n */\n constructor(code, message, data) {\n if (!isValidEthProviderCode(code)) {\n throw new Error('\"code\" must be an integer such that: 1000 <= code <= 4999');\n }\n super(code, message, data);\n }\n}\n/**\n * Check if the given code is a valid JSON-RPC error code.\n *\n * @param code - The code to check.\n * @returns Whether the code is valid.\n */\nfunction isValidEthProviderCode(code) {\n return Number.isInteger(code) && code >= 1000 && code <= 4999;\n}\n/**\n * A JSON replacer function that omits circular references.\n *\n * @param _ - The key being replaced.\n * @param value - The value being replaced.\n * @returns The value to use in place of the original value.\n */\nfunction stringifyReplacer(_, value) {\n if (value === '[Circular]') {\n return undefined;\n }\n return value;\n}\n//# sourceMappingURL=classes.mjs.map","import { JsonRpcError, JsonRpcError as JsonRpcError$1, errorCodes, errorCodes as errorCodes$1, getMessageFromCode, getMessageFromCode as getMessageFromCode$1, providerErrors, rpcErrors, serializeError } from \"@metamask/rpc-errors\";\n//#region src/index.ts\n/** The EIP-1193 and EIP-1474 codes adopted by CIP-103, see https://github.com/canton-foundation/cips/blob/main/cip-0103/cip-0103.md */\nconst CIP103_ERROR_CODES = /* @__PURE__ */ new Set([...Object.values(errorCodes$1.rpc), ...Object.values(errorCodes$1.provider)]);\nfunction isCip103ErrorCode(code) {\n\treturn typeof code === \"number\" && CIP103_ERROR_CODES.has(code);\n}\n/** `serializeError` only keeps the code of objects without any extra key, so drop everything else first. */\nfunction pickErrorFields(error) {\n\tif (typeof error !== \"object\" || error === null || !(\"code\" in error)) return error;\n\tconst { code, message, data } = error;\n\treturn data === void 0 ? {\n\t\tcode,\n\t\tmessage\n\t} : {\n\t\tcode,\n\t\tmessage,\n\t\tdata\n\t};\n}\n/** Converts a JSON-RPC error object or any other thrown value into a `JsonRpcError`, keeping its code. */\nfunction toJsonRpcError(error) {\n\tif (error instanceof JsonRpcError$1) return error;\n\tconst { code, message, data } = serializeError(pickErrorFields(error));\n\treturn new JsonRpcError$1(code, message || getMessageFromCode$1(code), data);\n}\nconst toHttpErrorCode = (rpcCode) => {\n\treturn {\n\t\t[errorCodes$1.rpc.parse]: 400,\n\t\t[errorCodes$1.rpc.invalidRequest]: 400,\n\t\t[errorCodes$1.rpc.methodNotFound]: 404,\n\t\t[errorCodes$1.rpc.invalidParams]: 400,\n\t\t[errorCodes$1.rpc.invalidInput]: 400,\n\t\t[errorCodes$1.provider.unauthorized]: 401,\n\t\t[errorCodes$1.rpc.internal]: 500,\n\t\t[errorCodes$1.rpc.resourceUnavailable]: 503\n\t}[rpcCode] || 500;\n};\n//#endregion\nexport { JsonRpcError, errorCodes, getMessageFromCode, isCip103ErrorCode, providerErrors, rpcErrors, toHttpErrorCode, toJsonRpcError };\n\n//# sourceMappingURL=index.js.map","//#region src/level.ts\nconst logLevels = [\n\t\"trace\",\n\t\"debug\",\n\t\"info\",\n\t\"warning\",\n\t\"error\",\n\t\"fatal\"\n];\n/**\n* Lists all available log levels with the order of their severity.\n* The `\"trace\"` level goes first, and the `\"fatal\"` level goes last.\n* @returns A new copy of the array of log levels.\n* @since 1.0.0\n*/\nfunction getLogLevels() {\n\treturn [...logLevels];\n}\n/**\n* Parses a log level from a string.\n*\n* @param level The log level as a string. This is case-insensitive.\n* @returns The log level.\n* @throws {TypeError} If the log level is invalid.\n*/\nfunction parseLogLevel(level) {\n\tlevel = level.toLowerCase();\n\tswitch (level) {\n\t\tcase \"trace\":\n\t\tcase \"debug\":\n\t\tcase \"info\":\n\t\tcase \"warning\":\n\t\tcase \"error\":\n\t\tcase \"fatal\": return level;\n\t\tdefault: throw new TypeError(`Invalid log level: ${level}.`);\n\t}\n}\n/**\n* Checks if a string is a valid log level. This function can be used as\n* as a type guard to narrow the type of a string to a {@link LogLevel}.\n*\n* @param level The log level as a string. This is case-sensitive.\n* @returns `true` if the string is a valid log level.\n*/\nfunction isLogLevel(level) {\n\tswitch (level) {\n\t\tcase \"trace\":\n\t\tcase \"debug\":\n\t\tcase \"info\":\n\t\tcase \"warning\":\n\t\tcase \"error\":\n\t\tcase \"fatal\": return true;\n\t\tdefault: return false;\n\t}\n}\n/**\n* Compares two log levels.\n* @param a The first log level.\n* @param b The second log level.\n* @returns A negative number if `a` is less than `b`, a positive number if `a`\n* is greater than `b`, or zero if they are equal.\n* @since 0.8.0\n*/\nfunction compareLogLevel(a, b) {\n\tconst aIndex = logLevels.indexOf(a);\n\tif (aIndex < 0) throw new TypeError(`Invalid log level: ${JSON.stringify(a)}.`);\n\tconst bIndex = logLevels.indexOf(b);\n\tif (bIndex < 0) throw new TypeError(`Invalid log level: ${JSON.stringify(b)}.`);\n\treturn aIndex - bIndex;\n}\n\n//#endregion\nexport { compareLogLevel, getLogLevels, isLogLevel, parseLogLevel };\n//# sourceMappingURL=level.js.map","import { asyncDisposeSymbol, disposeSymbol } from \"./disposable.js\";\nimport { toFilter } from \"./filter.js\";\nimport { compareLogLevel, isLogLevel } from \"./level.js\";\n\n//#region src/scoped-config.ts\nconst scopedConfigSymbol = Symbol.for(\"logtape.scopedConfig\");\nconst defaultScopedLogger = {\n\tfilters: [],\n\tfilterIds: [],\n\tlowestLevel: \"trace\",\n\tparentSinks: \"inherit\",\n\tsinks: [],\n\tsinkIds: [],\n\tcaptureSourceLocation: void 0\n};\nconst noFilters = [];\nfunction compileScopedConfig(config, allowAsync, createError) {\n\tif (!isObjectLike(config)) throw createError(\"Configuration must be an object.\");\n\tif (!isObjectLike(config.sinks)) throw createError(\"Configuration must include a sinks object.\");\n\tif (!Array.isArray(config.loggers)) throw createError(\"Configuration must include a loggers array.\");\n\tif (config.filters !== void 0 && !isObjectLike(config.filters)) throw createError(\"Configuration filters must be an object.\");\n\tconst nodes = /* @__PURE__ */ new Map();\n\tconst configuredCategories = /* @__PURE__ */ new Set();\n\tlet capturesSourceLocation = false;\n\tfor (const logger of config.loggers) {\n\t\tif (!isObjectLike(logger)) throw createError(\"Logger configuration must be an object.\");\n\t\tconst loggerConfig = logger;\n\t\tconst category = normalizeCategory(loggerConfig.category, createError);\n\t\tif (loggerConfig.sinks !== void 0 && !Array.isArray(loggerConfig.sinks)) throw createError(\"Logger sinks must be an array.\");\n\t\tif (loggerConfig.filters !== void 0 && !Array.isArray(loggerConfig.filters)) throw createError(\"Logger filters must be an array.\");\n\t\tif (loggerConfig.parentSinks !== void 0 && loggerConfig.parentSinks !== \"inherit\" && loggerConfig.parentSinks !== \"override\" && loggerConfig.parentSinks !== \"forward\") throw createError(\"Logger parentSinks must be \\\"inherit\\\", \\\"override\\\", or \\\"forward\\\".\");\n\t\tif (loggerConfig.lowestLevel !== void 0 && loggerConfig.lowestLevel !== null && !isLogLevel(loggerConfig.lowestLevel)) throw createError(\"Logger lowestLevel must be a log level or null.\");\n\t\tif (loggerConfig.captureSourceLocation !== void 0 && typeof loggerConfig.captureSourceLocation !== \"boolean\") throw createError(\"Logger captureSourceLocation must be a boolean.\");\n\t\tconst key = categoryKey(category);\n\t\tif (configuredCategories.has(key)) throw createError(`Duplicate logger configuration for category: ${key}. Each category can only be configured once.`);\n\t\tconfiguredCategories.add(key);\n\t\tconst sinks$1 = [];\n\t\tconst sinkIds = loggerConfig.sinks ?? [];\n\t\tfor (const sinkId of sinkIds) {\n\t\t\tconst sink = config.sinks[sinkId];\n\t\t\tif (!sink) throw createError(`Sink not found: ${sinkId}.`);\n\t\t\tif (typeof sink !== \"function\") throw createError(`Sink must be a function: ${sinkId}.`);\n\t\t\tsinks$1.push(sink);\n\t\t}\n\t\tconst filters = [];\n\t\tconst filterIds = loggerConfig.filters ?? [];\n\t\tfor (const filterId of filterIds) {\n\t\t\tconst filter = config.filters?.[filterId];\n\t\t\tif (filter === void 0) throw createError(`Filter not found: ${filterId}.`);\n\t\t\tif (!isFilterLike(filter)) throw createError(`Filter must be a function, log level, or null: ${filterId}.`);\n\t\t\tfilters.push(toFilter(filter));\n\t\t}\n\t\tnodes.set(key, {\n\t\t\tfilters,\n\t\t\tfilterIds: [...filterIds],\n\t\t\tlowestLevel: loggerConfig.lowestLevel === void 0 ? \"trace\" : loggerConfig.lowestLevel,\n\t\t\tparentSinks: loggerConfig.parentSinks ?? \"inherit\",\n\t\t\tsinks: sinks$1,\n\t\t\tsinkIds: [...sinkIds],\n\t\t\tcaptureSourceLocation: loggerConfig.captureSourceLocation\n\t\t});\n\t\tif (loggerConfig.captureSourceLocation === true) capturesSourceLocation = true;\n\t}\n\tconst syncFilters = /* @__PURE__ */ new Set();\n\tconst asyncFilters = /* @__PURE__ */ new Set();\n\tconst syncSinks = /* @__PURE__ */ new Set();\n\tconst asyncSinks = /* @__PURE__ */ new Set();\n\tconst sinks = /* @__PURE__ */ new Set();\n\tfor (const sink of Object.values(config.sinks)) {\n\t\tif (!isObjectLike(sink)) continue;\n\t\tsinks.add(sink);\n\t\tif (asyncDisposeSymbol in sink) {\n\t\t\tif (!allowAsync) throw createError(\"Async disposables cannot be used with withConfigSync().\");\n\t\t\tasyncSinks.add(sink);\n\t\t} else if (disposeSymbol in sink) syncSinks.add(sink);\n\t}\n\tfor (const filter of Object.values(config.filters ?? {})) {\n\t\tif (!isObjectLike(filter)) continue;\n\t\tif (asyncDisposeSymbol in filter) {\n\t\t\tif (!allowAsync) throw createError(\"Async disposables cannot be used with withConfigSync().\");\n\t\t\tasyncFilters.add(filter);\n\t\t\tasyncSinks.delete(filter);\n\t\t} else if (disposeSymbol in filter) {\n\t\t\tsyncFilters.add(filter);\n\t\t\tsyncSinks.delete(filter);\n\t\t}\n\t}\n\treturn {\n\t\tasyncFilters,\n\t\tasyncSinks,\n\t\tcapturesSourceLocation,\n\t\tdispatchCache: /* @__PURE__ */ new Map(),\n\t\tdisposed: false,\n\t\tfilterCache: /* @__PURE__ */ new Map(),\n\t\tnodes,\n\t\tparent: void 0,\n\t\tsinks,\n\t\tsourceLocationCaptureCache: /* @__PURE__ */ new Map(),\n\t\tsyncFilters,\n\t\tsyncSinks\n\t};\n}\nfunction getCurrentScopedConfig(contextLocalStorage) {\n\tconst store = contextLocalStorage?.getStore();\n\tconst scopedConfig = store?.[scopedConfigSymbol];\n\treturn isCompiledScopedConfig(scopedConfig) ? getActiveScopedConfig(scopedConfig) : void 0;\n}\nfunction runWithScopedConfig(contextLocalStorage, scopedConfig, callback) {\n\tconst parentStore = contextLocalStorage.getStore() ?? {};\n\tscopedConfig.parent = getCurrentScopedConfig(contextLocalStorage);\n\treturn contextLocalStorage.run({\n\t\t...parentStore,\n\t\t[scopedConfigSymbol]: scopedConfig\n\t}, callback);\n}\n/**\n* Gets the compiled logger configured for exactly the given category in a\n* scoped configuration, without touching its dispatch or filter caches.\n*/\nfunction getScopedLogger(scopedConfig, category) {\n\treturn scopedConfig.nodes.get(categoryKey(category));\n}\nfunction scopedConfigHasSink(scopedConfig, category, level) {\n\treturn getScopedSinkDispatchPlan(scopedConfig, category, level).kind !== \"none\";\n}\n/**\n* Resolves whether source locations are captured for the given category\n* under the scoped configuration: the setting of the nearest configured\n* category, from the category itself up to the root, wins.\n*/\nfunction scopedConfigCapturesSourceLocation(scopedConfig, category) {\n\tif (!scopedConfig.capturesSourceLocation) return false;\n\tconst key = categoryKey(category);\n\tlet captures = scopedConfig.sourceLocationCaptureCache.get(key);\n\tif (captures == null) {\n\t\tcaptures = false;\n\t\tfor (let length = category.length; length >= 0; length--) {\n\t\t\tconst logger = scopedConfig.nodes.get(categoryKey(category.slice(0, length)));\n\t\t\tif (logger?.captureSourceLocation == null) continue;\n\t\t\tcaptures = logger.captureSourceLocation;\n\t\t\tbreak;\n\t\t}\n\t\tscopedConfig.sourceLocationCaptureCache.set(key, captures);\n\t}\n\treturn captures;\n}\nfunction emitWithScopedConfig(scopedConfig, record, bypassSinks, emitToSink) {\n\tconst plan = getScopedSinkDispatchPlan(scopedConfig, record.category, record.level);\n\tif (plan.kind === \"none\") return;\n\tif (!filterScopedRecord(scopedConfig, record.category, record)) return;\n\tif (plan.kind === \"one\") {\n\t\tif (!bypassSinks?.has(plan.sink)) emitToSink(plan.sink, bypassSinks);\n\t\treturn;\n\t}\n\tfor (const sink of plan.sinks) {\n\t\tif (bypassSinks?.has(sink)) continue;\n\t\temitToSink(sink, bypassSinks);\n\t}\n}\nasync function disposeScopedConfig(scopedConfig, retainedDisposables) {\n\tconst parentDisposables = getParentScopedDisposables(scopedConfig, retainedDisposables);\n\tscopedConfig.disposed = true;\n\tconst errors = [];\n\ttry {\n\t\tdisposeSyncDisposables(scopedConfig.syncFilters, parentDisposables);\n\t} catch (error) {\n\t\terrors.push(error);\n\t}\n\ttry {\n\t\tawait disposeAsyncDisposables(scopedConfig.asyncFilters, parentDisposables);\n\t} catch (error) {\n\t\terrors.push(error);\n\t}\n\ttry {\n\t\tdisposeSyncDisposables(scopedConfig.syncSinks, parentDisposables);\n\t} catch (error) {\n\t\terrors.push(error);\n\t}\n\ttry {\n\t\tawait disposeAsyncDisposables(scopedConfig.asyncSinks, parentDisposables);\n\t} catch (error) {\n\t\terrors.push(error);\n\t}\n\tthrowDisposeErrors(errors);\n}\nfunction disposeScopedConfigSync(scopedConfig, retainedDisposables) {\n\tconst parentDisposables = getParentScopedDisposables(scopedConfig, retainedDisposables);\n\tscopedConfig.disposed = true;\n\tconst errors = [];\n\ttry {\n\t\tdisposeSyncDisposables(scopedConfig.syncFilters, parentDisposables);\n\t} catch (error) {\n\t\terrors.push(error);\n\t}\n\ttry {\n\t\tdisposeSyncDisposables(scopedConfig.syncSinks, parentDisposables);\n\t} catch (error) {\n\t\terrors.push(error);\n\t}\n\tthrowDisposeErrors(errors);\n}\nfunction throwCombinedErrors(primary, secondary) {\n\tthrow new AggregateError(flattenErrors(primary, secondary), \"Multiple errors occurred while running LogTape scoped configuration.\");\n}\nfunction isCompiledScopedConfig(value) {\n\treturn value != null && typeof value === \"object\" && \"nodes\" in value;\n}\nfunction isObjectLike(value) {\n\treturn value != null && (typeof value === \"object\" || typeof value === \"function\");\n}\nfunction isFilterLike(value) {\n\treturn value == null || typeof value === \"function\" || typeof value === \"string\" && isLogLevel(value);\n}\nfunction getActiveScopedConfig(scopedConfig) {\n\tlet activeConfig = scopedConfig;\n\twhile (activeConfig?.disposed) activeConfig = activeConfig.parent;\n\treturn activeConfig;\n}\nfunction getParentScopedDisposables(scopedConfig, extraRetained) {\n\tconst disposables = new Set(extraRetained);\n\tlet parent = scopedConfig.parent;\n\twhile (parent != null) {\n\t\tconst activeParent = getActiveScopedConfig(parent);\n\t\tif (activeParent == null) break;\n\t\taddScopedDisposables(disposables, activeParent);\n\t\tparent = activeParent.parent;\n\t}\n\treturn disposables;\n}\nfunction addScopedDisposables(disposables, scopedConfig) {\n\tfor (const disposable of scopedConfig.syncFilters) disposables.add(disposable);\n\tfor (const disposable of scopedConfig.asyncFilters) disposables.add(disposable);\n\tfor (const disposable of scopedConfig.syncSinks) disposables.add(disposable);\n\tfor (const disposable of scopedConfig.asyncSinks) disposables.add(disposable);\n}\nfunction normalizeCategory(category, createError) {\n\tif (typeof category === \"string\") return [category];\n\tif (!Array.isArray(category)) throw createError(\"Logger category must be a string or array of strings.\");\n\tif (category.some((part) => typeof part !== \"string\")) throw createError(\"Logger category must only contain strings.\");\n\treturn [...category];\n}\nfunction categoryKey(category) {\n\treturn JSON.stringify(category);\n}\nfunction getScopedSinkDispatchPlan(scopedConfig, category, level) {\n\tconst cacheKey = `${categoryKey(category)}:${level}`;\n\tlet plan = scopedConfig.dispatchCache.get(cacheKey);\n\tif (plan == null) {\n\t\tplan = getScopedSinkDispatchPlanForPrefix(scopedConfig, category, category.length, level);\n\t\tscopedConfig.dispatchCache.set(cacheKey, plan);\n\t}\n\treturn plan;\n}\nfunction getScopedSinkDispatchPlanForPrefix(scopedConfig, category, length, level) {\n\tconst prefix = category.slice(0, length);\n\tconst logger = scopedConfig.nodes.get(categoryKey(prefix)) ?? defaultScopedLogger;\n\tif (logger.lowestLevel === null || compareLogLevel(level, logger.lowestLevel) < 0) return { kind: \"none\" };\n\tconst parentPlan = length > 0 && logger.parentSinks === \"inherit\" ? getScopedSinkDispatchPlanForPrefix(scopedConfig, category, length - 1, level) : length > 0 && logger.parentSinks === \"forward\" ? wrapScopedSinks(collectScopedForwardSinks(scopedConfig, category, length - 1)) : { kind: \"none\" };\n\tlet firstSink;\n\tlet sinks;\n\tconst appendSink = (sink) => {\n\t\tif (sinks != null) sinks.push(sink);\n\t\telse if (firstSink == null) firstSink = sink;\n\t\telse sinks = [firstSink, sink];\n\t};\n\tif (parentPlan.kind === \"one\") appendSink(parentPlan.sink);\n\telse if (parentPlan.kind === \"many\") for (const sink of parentPlan.sinks) appendSink(sink);\n\tfor (const sink of logger.sinks) appendSink(sink);\n\tif (sinks != null) return {\n\t\tkind: \"many\",\n\t\tsinks\n\t};\n\tif (firstSink != null) return {\n\t\tkind: \"one\",\n\t\tsink: firstSink\n\t};\n\treturn { kind: \"none\" };\n}\nfunction collectScopedForwardSinks(scopedConfig, category, length) {\n\tconst logger = scopedConfig.nodes.get(categoryKey(category.slice(0, length))) ?? defaultScopedLogger;\n\tconst parentSinks = length > 0 && logger.parentSinks !== \"override\" ? collectScopedForwardSinks(scopedConfig, category, length - 1) : [];\n\tif (logger.sinks.length < 1) return parentSinks;\n\tif (parentSinks.length < 1) return logger.sinks;\n\treturn [...parentSinks, ...logger.sinks];\n}\nfunction wrapScopedSinks(sinks) {\n\tif (sinks.length < 1) return { kind: \"none\" };\n\tif (sinks.length === 1) return {\n\t\tkind: \"one\",\n\t\tsink: sinks[0]\n\t};\n\treturn {\n\t\tkind: \"many\",\n\t\tsinks\n\t};\n}\nfunction filterScopedRecord(scopedConfig, category, record) {\n\tconst key = categoryKey(category);\n\tlet filters = scopedConfig.filterCache.get(key);\n\tif (filters == null) {\n\t\tfilters = getScopedFilters(scopedConfig, category);\n\t\tscopedConfig.filterCache.set(key, filters);\n\t}\n\treturn filters.every((filter) => filter(record));\n}\nfunction getScopedFilters(scopedConfig, category) {\n\tfor (let length = category.length; length >= 0; length--) {\n\t\tconst logger = scopedConfig.nodes.get(categoryKey(category.slice(0, length)));\n\t\tif (logger == null || logger.filters.length < 1) continue;\n\t\treturn logger.filters;\n\t}\n\treturn noFilters;\n}\nfunction disposeSyncDisposables(disposables, retainedDisposables) {\n\tconst disposableList = filterRetainedDisposables(disposables, retainedDisposables);\n\tconst errors = [];\n\ttry {\n\t\tfor (const disposable of disposableList) try {\n\t\t\tdisposable[disposeSymbol]();\n\t\t} catch (error) {\n\t\t\terrors.push(error);\n\t\t}\n\t} finally {\n\t\tdisposables.clear();\n\t}\n\tthrowDisposeErrors(errors);\n}\nasync function disposeAsyncDisposables(disposables, retainedDisposables) {\n\tconst disposableList = filterRetainedDisposables(disposables, retainedDisposables);\n\tfor (const disposable of disposableList) disposables.delete(disposable);\n\ttry {\n\t\tconst results = await Promise.allSettled(disposableList.map((disposable) => Promise.resolve().then(() => disposable[asyncDisposeSymbol]())));\n\t\tthrowDisposeErrors(results.filter((result) => result.status === \"rejected\").map((result) => result.reason));\n\t} finally {\n\t\tdisposables.clear();\n\t}\n}\nfunction filterRetainedDisposables(disposables, retainedDisposables) {\n\treturn Array.from(disposables).filter((disposable) => !retainedDisposables.has(disposable));\n}\nfunction throwDisposeErrors(errors) {\n\tif (errors.length < 1) return;\n\tif (errors.length === 1) throw errors[0];\n\tthrow new AggregateError(errors, \"Multiple errors occurred while disposing LogTape scoped resources.\");\n}\nfunction flattenErrors(...errors) {\n\tconst flattened = [];\n\tfor (const error of errors) if (error instanceof AggregateError) flattened.push(...error.errors);\n\telse flattened.push(error);\n\treturn flattened;\n}\n\n//#endregion\nexport { compileScopedConfig, disposeScopedConfig, disposeScopedConfigSync, emitWithScopedConfig, getCurrentScopedConfig, getScopedLogger, runWithScopedConfig, scopedConfigCapturesSourceLocation, scopedConfigHasSink, throwCombinedErrors };\n//# sourceMappingURL=scoped-config.js.map","//#region src/source-location.ts\n/**\n* The prefix of each frame in V8 and JavaScriptCore (Bun) stack traces.\n*/\nconst v8FramePrefix = \" at \";\n/**\n* Matches a file that starts with a URL scheme (e.g., `file:`, `http:`,\n* `node:`, or a Windows drive letter), a slash, or a UNC prefix.\n*/\nconst absoluteFilePattern = /^(?:[A-Za-z][A-Za-z0-9+.-]*:|\\/|\\\\\\\\)/;\n/**\n* Matches a `file:line:column` location.\n*/\nconst locationPattern = /^(.+):(\\d+):(\\d+)$/;\n/**\n* Marks a location that matched the grammar but must not be reported.\n*/\nconst rejected = Symbol(\"rejected\");\n/**\n* Parses the source location of a frame from the stack trace of an `Error`\n* that was constructed without a message.\n*\n* The parser is deliberately conservative: whenever the frame could be read\n* in more than one way, or it does not point to a position in a source file\n* (native code, `eval()`, bytecode offsets), it returns `undefined` rather\n* than a possibly wrong location. It never throws.\n*\n* @param stack The `stack` property of an `Error` constructed without\n* a message.\n* @param frameIndex The zero-based index of the frame to parse, where `0`\n* is the function that constructed the `Error`.\n* @returns The source location of the frame, or `undefined` if it could not\n* be determined unambiguously.\n*/\nfunction parseSourceLocation(stack, frameIndex) {\n\tif (typeof stack !== \"string\") return void 0;\n\tconst lines = stack.split(\"\\n\");\n\tif (lines[0].trim() === \"Error\") {\n\t\tif (lines.length < 2 || !lines[1].startsWith(v8FramePrefix)) return void 0;\n\t\treturn parseV8Frame(lines[frameIndex + 1]);\n\t}\n\tif (lines[0] === \"\" || /^\\s/.test(lines[0])) return void 0;\n\treturn parseSpiderMonkeyFrame(lines[frameIndex]);\n}\nfunction parseV8Frame(frame) {\n\tif (frame == null || !frame.startsWith(v8FramePrefix)) return void 0;\n\tconst body = frame.slice(v8FramePrefix.length);\n\tif (body.includes(\"eval at \")) return void 0;\n\tif (!body.endsWith(\")\")) return accept(parseLocation(body.startsWith(\"async \") ? body.slice(6) : body));\n\tlet found;\n\tfor (let i = body.indexOf(\" (\"); i >= 0; i = body.indexOf(\" (\", i + 1)) {\n\t\tconst location = parseLocation(body.slice(i + 2, -1));\n\t\tif (location === rejected) return void 0;\n\t\tif (location == null) continue;\n\t\tif (found != null) return void 0;\n\t\tfound = location;\n\t}\n\treturn found;\n}\nfunction parseSpiderMonkeyFrame(frame) {\n\tif (frame == null) return void 0;\n\tconst whole = parseLocation(frame);\n\tif (whole === rejected) return void 0;\n\tif (whole != null && absoluteFilePattern.test(whole.file)) return void 0;\n\tlet found;\n\tfor (let i = frame.indexOf(\"@\"); i >= 0; i = frame.indexOf(\"@\", i + 1)) {\n\t\tconst location = parseLocation(frame.slice(i + 1));\n\t\tif (location === rejected) return void 0;\n\t\tif (location == null || !absoluteFilePattern.test(location.file)) continue;\n\t\tif (found != null) return void 0;\n\t\tfound = location;\n\t}\n\treturn found;\n}\nfunction accept(location) {\n\treturn location === rejected ? void 0 : location;\n}\nfunction parseLocation(location) {\n\tconst match = locationPattern.exec(location);\n\tif (match == null) return void 0;\n\tconst file = match[1];\n\tconst line = Number(match[2]);\n\tconst column = Number(match[3]);\n\tif (file === \"native\" || file === \"<anonymous>\" || file === \"[native code]\" || file.includes(\"address at \") || file.includes(\"eval at \") || file.includes(\" > eval\") || file.includes(\" > Function\") || line < 1 || column < 1) return rejected;\n\treturn {\n\t\tfile,\n\t\tline,\n\t\tcolumn\n\t};\n}\n\n//#endregion\nexport { parseSourceLocation };\n//# sourceMappingURL=source-location.js.map","import { getCategoryPrefix, getImplicitContextIfAny } from \"./context.js\";\nimport { compareLogLevel } from \"./level.js\";\nimport { emitWithScopedConfig, getCurrentScopedConfig, scopedConfigCapturesSourceLocation, scopedConfigHasSink } from \"./scoped-config.js\";\nimport { parseSourceLocation } from \"./source-location.js\";\n\n//#region src/logger.ts\n/**\n* Symbol to identify lazy values.\n*/\nconst lazySymbol = Symbol.for(\"logtape.lazy\");\nconst throttlingSummaryRecordSymbol = Symbol.for(\"LogTape.throttlingSummaryRecord\");\nconst immediateSinkSymbol = Symbol.for(\"LogTape.sinkSnapshotPolicy.immediate\");\nconst internalStringLogRecords = /* @__PURE__ */ new WeakSet();\nconst resolvedStringLogRecords = /* @__PURE__ */ new WeakSet();\nlet globalSourceLocationCapture = false;\nlet scopedSourceLocationCaptures = 0;\nfunction isSourceLocationCaptureActive() {\n\treturn globalSourceLocationCapture || scopedSourceLocationCaptures > 0;\n}\nfunction attachSourceLocation(record, sourceLocation) {\n\tif (sourceLocation == null) return;\n\trecord.sourceLocation = sourceLocation;\n}\n/**\n* Checks if a value is a lazy value.\n*\n* @param value The value to check.\n* @returns `true` if the value is a lazy value, `false` otherwise.\n* @since 2.0.0\n*/\nfunction isLazy(value) {\n\treturn value != null && typeof value === \"object\" && lazySymbol in value && value[lazySymbol] === true;\n}\n/**\n* Creates a lazy value that is evaluated at logging time.\n*\n* This is useful for logging contextual properties that may change over time,\n* such as the current user or request context.\n*\n* @example\n* ```typescript\n* let currentUser: string | null = null;\n* const logger = getLogger(\"app\").with({ user: lazy(() => currentUser) });\n*\n* logger.info(\"User action\"); // logs with user: null\n* currentUser = \"alice\";\n* logger.info(\"User action\"); // logs with user: \"alice\"\n* ```\n*\n* @typeParam T The type of the value.\n* @param getter A function that returns the value.\n* @returns A lazy value.\n* @since 2.0.0\n*/\nfunction lazy(getter) {\n\treturn {\n\t\t[lazySymbol]: true,\n\t\tgetter\n\t};\n}\n/**\n* Resolves lazy values in a properties object.\n*\n* @param properties The properties object with potential lazy values.\n* @returns A new object with all lazy values resolved.\n*/\nfunction resolveProperties(properties) {\n\tconst resolved = {};\n\tfor (const key in properties) {\n\t\tconst value = properties[key];\n\t\tresolved[key] = isLazy(value) ? value.getter() : value;\n\t}\n\tconst symbolProperties = properties;\n\tconst symbolResolved = resolved;\n\tif (Object.prototype.propertyIsEnumerable.call(properties, throttlingSummaryRecordSymbol)) {\n\t\tconst value = symbolProperties[throttlingSummaryRecordSymbol];\n\t\tsymbolResolved[throttlingSummaryRecordSymbol] = isLazy(value) ? value.getter() : value;\n\t}\n\treturn resolved;\n}\nfunction isPromiseObject(value) {\n\tif (value instanceof Promise) return true;\n\treturn Object.prototype.toString.call(value) === \"[object Promise]\" && typeof value.then === \"function\";\n}\nfunction logStringMessage(logger, level, message, props, sourceLocation) {\n\tif (typeof props !== \"function\") {\n\t\tconst properties = props ?? {};\n\t\tlogger.log(level, message, properties, void 0, sourceLocation);\n\t\treturn;\n\t}\n\tif (!logger.isEnabledFor(level)) return Promise.resolve();\n\tconst result = props();\n\tif (isPromiseObject(result)) return Promise.resolve(result).then((resolvedProps) => {\n\t\tlogger.log(level, message, resolvedProps, void 0, sourceLocation);\n\t});\n\tlogger.log(level, message, result, void 0, sourceLocation);\n}\nfunction snapshotLogRecordProperties(record) {\n\tif (resolvedStringLogRecords.has(record)) return record;\n\tconst properties = resolveProperties(record.properties);\n\tif (internalStringLogRecords.has(record)) {\n\t\tconst snapshot = {\n\t\t\tcategory: record.category,\n\t\t\tlevel: record.level,\n\t\t\tget message() {\n\t\t\t\treturn record.message;\n\t\t\t},\n\t\t\trawMessage: record.rawMessage,\n\t\t\ttimestamp: record.timestamp,\n\t\t\tproperties\n\t\t};\n\t\tattachSourceLocation(snapshot, record.sourceLocation);\n\t\treturn snapshot;\n\t}\n\tconst descriptors = Object.getOwnPropertyDescriptors(record);\n\tdescriptors.properties = {\n\t\tvalue: properties,\n\t\tenumerable: true,\n\t\tconfigurable: true\n\t};\n\treturn Object.defineProperties({}, descriptors);\n}\nfunction hasEnumerableProperties(properties) {\n\tif (properties == null || typeof properties !== \"object\") return false;\n\treturn Object.keys(properties).length > 0 || Object.prototype.propertyIsEnumerable.call(properties, throttlingSummaryRecordSymbol);\n}\nfunction shouldSnapshotForSink(sink) {\n\treturn sink[immediateSinkSymbol] !== true;\n}\n/**\n* Get a logger with the given category.\n*\n* ```typescript\n* const logger = getLogger([\"my-app\"]);\n* ```\n*\n* @param category The category of the logger. It can be a string or an array\n* of strings. If it is a string, it is equivalent to an array\n* with a single element.\n* @returns The logger.\n*/\nfunction getLogger(category = []) {\n\treturn LoggerImpl.getLogger(category);\n}\n/**\n* Enumerate every logger in the category tree rooted at the given logger,\n* including the given logger itself, in depth-first pre-order.\n*\n* ```typescript\n* const all = getLoggers(); // the whole tree, from the root down\n* const mine = getLoggers(\"my-app\"); // \"my-app\" and its descendants only\n* ```\n*\n* This only reflects loggers that have actually been *materialized* by a\n* `getLogger()` call somewhere in the running program. A category that has\n* been configured via `configure()` but never reached by a `getLogger()`\n* call (e.g. inside an unexecuted code path) will not appear.\n*\n* @param logger The logger (or its category, as a string or array of\n* strings) to start from. Defaults to the root logger.\n* @returns Every logger in the subtree, starting with the resolved logger\n* itself, in depth-first pre-order.\n* @since 2.4.0\n*/\nfunction getLoggers(logger) {\n\tconst category = logger == null ? [] : isCategory(logger) ? logger : logger.category;\n\treturn collectDescendants(LoggerImpl.getLogger(category));\n}\nfunction isCategory(value) {\n\treturn typeof value === \"string\" || Array.isArray(value);\n}\nfunction collectDescendants(logger) {\n\tconst loggers = [logger];\n\tfor (const childRef of Object.values(logger.children)) {\n\t\tconst child = childRef instanceof LoggerImpl ? childRef : childRef.deref();\n\t\tif (child != null) loggers.push(...collectDescendants(child));\n\t}\n\treturn loggers;\n}\n/**\n* The symbol for the global root logger.\n*/\nconst globalRootLoggerSymbol = Symbol.for(\"logtape.rootLogger\");\n/**\n* Checks whether the given category is the meta logger's category or one of\n* its descendants, to which category prefixes do not apply.\n*/\nfunction isMetaLoggerCategory(category) {\n\treturn category.length >= 2 && category[0] === \"logtape\" && category[1] === \"meta\";\n}\n/**\n* Finds the logger with the given category without creating it or any of its\n* ancestors.\n* @param category The category of the logger to find.\n* @returns The logger, or `undefined` if it has not been created.\n*/\nfunction findLogger(category) {\n\tlet logger = globalThis[globalRootLoggerSymbol];\n\tfor (const name of category) {\n\t\tif (logger == null) return void 0;\n\t\tconst childRef = Object.prototype.hasOwnProperty.call(logger.children, name) ? logger.children[name] : void 0;\n\t\tlogger = childRef == null || typeof childRef.deref !== \"function\" ? childRef : childRef.deref();\n\t}\n\treturn logger;\n}\n/**\n* A logger implementation. Do not use this directly; use {@link getLogger}\n* instead. This class is exported for testing purposes.\n*/\nvar LoggerImpl = class LoggerImpl {\n\tparent;\n\tchildren;\n\tcategory;\n\tsinks;\n\tfilters;\n\tcontextLocalStorage;\n\t/**\n\t* Whether to capture source locations for this logger and its\n\t* descendants. `undefined` inherits the setting from the parent.\n\t*/\n\tsourceLocationCapture = void 0;\n\t#parentSinks = \"inherit\";\n\t#lowestLevel = \"trace\";\n\t#sinkPlanCache = {};\n\t#forwardPlanCache = void 0;\n\tstatic getLogger(category = []) {\n\t\tlet rootLogger = globalRootLoggerSymbol in globalThis ? globalThis[globalRootLoggerSymbol] ?? null : null;\n\t\tif (rootLogger == null) {\n\t\t\trootLogger = new LoggerImpl(null, []);\n\t\t\tglobalThis[globalRootLoggerSymbol] = rootLogger;\n\t\t}\n\t\tif (typeof category === \"string\") return rootLogger.getChild(category);\n\t\tif (category.length === 0) return rootLogger;\n\t\treturn rootLogger.getChild(category);\n\t}\n\tstatic getNearestExistingLogger(category) {\n\t\tlet logger = LoggerImpl.getLogger();\n\t\tfor (const name of category) {\n\t\t\tconst childRef = logger.children[name];\n\t\t\tconst child = childRef instanceof LoggerImpl ? childRef : childRef?.deref();\n\t\t\tif (child == null) break;\n\t\t\tlogger = child;\n\t\t}\n\t\treturn logger;\n\t}\n\tconstructor(parent, category) {\n\t\tthis.parent = parent;\n\t\tthis.children = {};\n\t\tthis.category = category;\n\t\tthis.sinks = [];\n\t\tthis.filters = [];\n\t}\n\tget parentSinks() {\n\t\treturn this.#parentSinks;\n\t}\n\tset parentSinks(value) {\n\t\tif (this.#parentSinks === value) return;\n\t\tthis.#parentSinks = value;\n\t}\n\tget lowestLevel() {\n\t\treturn this.#lowestLevel;\n\t}\n\tset lowestLevel(value) {\n\t\tif (this.#lowestLevel === value) return;\n\t\tthis.#lowestLevel = value;\n\t}\n\tgetChild(subcategory) {\n\t\tconst name = typeof subcategory === \"string\" ? subcategory : subcategory[0];\n\t\tconst childRef = this.children[name];\n\t\tlet child = childRef instanceof LoggerImpl ? childRef : childRef?.deref();\n\t\tif (child == null) {\n\t\t\tchild = new LoggerImpl(this, [...this.category, name]);\n\t\t\tthis.children[name] = \"WeakRef\" in globalThis ? new WeakRef(child) : child;\n\t\t}\n\t\tif (typeof subcategory === \"string\" || subcategory.length === 1) return child;\n\t\treturn child.getChild(subcategory.slice(1));\n\t}\n\t/**\n\t* Reset the logger. This removes all sinks and filters from the logger.\n\t*/\n\treset() {\n\t\twhile (this.sinks.length > 0) this.sinks.shift();\n\t\tthis.parentSinks = \"inherit\";\n\t\twhile (this.filters.length > 0) this.filters.shift();\n\t\tthis.lowestLevel = \"trace\";\n\t\tthis.sourceLocationCapture = void 0;\n\t}\n\t/**\n\t* Reset the logger and all its descendants. This removes all sinks and\n\t* filters from the logger and all its descendants.\n\t*/\n\tresetDescendants() {\n\t\tfor (const child of Object.values(this.children)) {\n\t\t\tconst logger = child instanceof LoggerImpl ? child : child.deref();\n\t\t\tif (logger != null) logger.resetDescendants();\n\t\t}\n\t\tthis.reset();\n\t}\n\twith(properties) {\n\t\treturn new LoggerCtx(this, { ...properties });\n\t}\n\t/**\n\t* Sets whether the global configuration enables source location capture\n\t* for any category. Call this on the root logger only.\n\t*/\n\tsetGlobalSourceLocationCapture(enabled) {\n\t\tglobalSourceLocationCapture = enabled;\n\t}\n\t/**\n\t* Records that a scoped configuration which enables source location\n\t* capture for some category became active. Call this on the root logger\n\t* only, and balance it with\n\t* {@link LoggerImpl.releaseScopedSourceLocationCapture}.\n\t*/\n\tretainScopedSourceLocationCapture() {\n\t\tscopedSourceLocationCaptures++;\n\t}\n\t/**\n\t* Records that a scoped configuration retained with\n\t* {@link LoggerImpl.retainScopedSourceLocationCapture} ended. Call this on\n\t* the root logger only.\n\t*/\n\treleaseScopedSourceLocationCapture() {\n\t\tif (scopedSourceLocationCaptures > 0) scopedSourceLocationCaptures--;\n\t}\n\t/**\n\t* Captures where user code called the public logging method that called\n\t* this method, if source location capture is enabled for this logger and\n\t* a record of the given level could be emitted.\n\t*\n\t* It must be called directly by the public logging method that user code\n\t* called (e.g., {@link LoggerImpl.info} or {@link LoggerCtx.info}), and\n\t* not in tail position, because the location is read from the third frame\n\t* of a stack trace constructed here: this method, the logging method, and\n\t* then its caller. JavaScriptCore implements proper tail calls, so a call\n\t* in tail position would remove the logging method's frame.\n\t* @param level The log level of the record to be made.\n\t* @returns The source location, or `undefined` if capture is disabled, the\n\t* record would certainly be dropped, or the stack trace could not\n\t* be parsed.\n\t*/\n\tcaptureSourceLocation(level) {\n\t\tif (isMetaLoggerCategory(this.category)) return void 0;\n\t\tconst categoryPrefix = getCategoryPrefix();\n\t\tconst scopedConfig = getCurrentScopedConfig(LoggerImpl.getLogger().contextLocalStorage);\n\t\tif (scopedConfig != null) {\n\t\t\tconst category = categoryPrefix.length > 0 ? [...categoryPrefix, ...this.category] : this.category;\n\t\t\tif (!scopedConfigHasSink(scopedConfig, category, level) || !scopedConfigCapturesSourceLocation(scopedConfig, category)) return void 0;\n\t\t} else {\n\t\t\tconst dispatcher = this.getDispatcher(categoryPrefix);\n\t\t\tif (dispatcher.isCertainlyDroppedResolved(level) || !dispatcher.capturesSourceLocation()) return void 0;\n\t\t}\n\t\ttry {\n\t\t\treturn parseSourceLocation(new Error().stack, 2);\n\t\t} catch {\n\t\t\treturn void 0;\n\t\t}\n\t}\n\t/**\n\t* Resolves whether this logger or the nearest ancestor that configures it\n\t* captures source locations.\n\t*/\n\tcapturesSourceLocation() {\n\t\tif (this.sourceLocationCapture != null) return this.sourceLocationCapture;\n\t\treturn this.parent?.capturesSourceLocation() ?? false;\n\t}\n\tfilter(record) {\n\t\tfor (const filter of this.filters) if (!filter(record)) return false;\n\t\tif (this.filters.length < 1) return this.parent?.filter(record) ?? true;\n\t\treturn true;\n\t}\n\t*getSinks(level) {\n\t\tconst plan = this.getSinkDispatchPlan(level);\n\t\tswitch (plan.kind) {\n\t\t\tcase \"none\": return;\n\t\t\tcase \"one\":\n\t\t\t\tyield plan.sink;\n\t\t\t\treturn;\n\t\t\tcase \"many\":\n\t\t\t\tyield* plan.sinks;\n\t\t\t\treturn;\n\t\t}\n\t}\n\tgetSinkDispatchPlan(level) {\n\t\tconst cached = this.#sinkPlanCache[level];\n\t\tif (cached != null && this.isSinkDispatchPlanFresh(level, cached)) return cached;\n\t\tconst plan = this.createSinkDispatchPlan(level, this.resolveParentPlan(level));\n\t\tthis.#sinkPlanCache[level] = plan;\n\t\treturn plan;\n\t}\n\tresolveParentPlan(level) {\n\t\tif (this.parent == null) return void 0;\n\t\tif (this.parentSinks === \"inherit\") return this.parent.getSinkDispatchPlan(level);\n\t\tif (this.parentSinks === \"forward\") return this.parent.getForwardSinkPlan();\n\t\treturn void 0;\n\t}\n\tisSinkDispatchPlanFresh(level, plan) {\n\t\tif (plan.lowestLevel !== this.lowestLevel || plan.parentSinks !== this.parentSinks || plan.localSinks.length !== this.sinks.length) return false;\n\t\tfor (let i = 0; i < plan.localSinks.length; i++) if (plan.localSinks[i] !== this.sinks[i]) return false;\n\t\treturn plan.parentPlan === this.resolveParentPlan(level);\n\t}\n\tgetForwardSinkPlan() {\n\t\tconst cached = this.#forwardPlanCache;\n\t\tif (cached != null && this.isForwardSinkPlanFresh(cached)) return cached;\n\t\tconst parentPlan = this.parent != null && this.parentSinks !== \"override\" ? this.parent.getForwardSinkPlan() : void 0;\n\t\tconst plan = this.createForwardSinkPlan(parentPlan);\n\t\tthis.#forwardPlanCache = plan;\n\t\treturn plan;\n\t}\n\tisForwardSinkPlanFresh(plan) {\n\t\tif (plan.parentSinks !== this.parentSinks || plan.localSinks.length !== this.sinks.length) return false;\n\t\tfor (let i = 0; i < plan.localSinks.length; i++) if (plan.localSinks[i] !== this.sinks[i]) return false;\n\t\tconst parentPlan = this.parent != null && this.parentSinks !== \"override\" ? this.parent.getForwardSinkPlan() : void 0;\n\t\treturn plan.parentPlan === parentPlan;\n\t}\n\tcreateForwardSinkPlan(parentPlan) {\n\t\tconst localSinks = [...this.sinks];\n\t\tconst sinks = parentPlan == null || parentPlan.sinks.length < 1 ? localSinks : [...parentPlan.sinks, ...localSinks];\n\t\treturn {\n\t\t\tkind: \"forward\",\n\t\t\tlocalSinks,\n\t\t\tparentSinks: this.parentSinks,\n\t\t\tparentPlan,\n\t\t\tsinks\n\t\t};\n\t}\n\tcreateSinkDispatchPlan(level, parentPlan) {\n\t\tconst state = {\n\t\t\tlocalSinks: [...this.sinks],\n\t\t\tparentSinks: this.parentSinks,\n\t\t\tlowestLevel: this.lowestLevel,\n\t\t\tparentPlan\n\t\t};\n\t\tif (state.lowestLevel === null) return {\n\t\t\t...state,\n\t\t\tkind: \"none\"\n\t\t};\n\t\tif (compareLogLevel(level, state.lowestLevel) < 0) return {\n\t\t\t...state,\n\t\t\tkind: \"none\"\n\t\t};\n\t\tlet firstSink;\n\t\tlet sinks;\n\t\tconst appendSink = (sink) => {\n\t\t\tif (sinks != null) sinks.push(sink);\n\t\t\telse if (firstSink == null) firstSink = sink;\n\t\t\telse sinks = [firstSink, sink];\n\t\t};\n\t\tif (parentPlan != null) {\n\t\t\tif (parentPlan.kind === \"one\") firstSink = parentPlan.sink;\n\t\t\telse if (parentPlan.kind === \"many\") sinks = [...parentPlan.sinks];\n\t\t\telse if (parentPlan.kind === \"forward\") {\n\t\t\t\tif (parentPlan.sinks.length === 1) firstSink = parentPlan.sinks[0];\n\t\t\t\telse if (parentPlan.sinks.length > 1) sinks = [...parentPlan.sinks];\n\t\t\t}\n\t\t}\n\t\tfor (const sink of state.localSinks) appendSink(sink);\n\t\tif (sinks != null) return {\n\t\t\t...state,\n\t\t\tkind: \"many\",\n\t\t\tsinks\n\t\t};\n\t\tif (firstSink != null) return {\n\t\t\t...state,\n\t\t\tkind: \"one\",\n\t\t\tsink: firstSink\n\t\t};\n\t\treturn {\n\t\t\t...state,\n\t\t\tkind: \"none\"\n\t\t};\n\t}\n\tisEnabledFor(level) {\n\t\tconst categoryPrefix = isMetaLoggerCategory(this.category) ? [] : getCategoryPrefix();\n\t\tconst scopedConfig = getCurrentScopedConfig(LoggerImpl.getLogger().contextLocalStorage);\n\t\tif (scopedConfig != null) return scopedConfigHasSink(scopedConfig, categoryPrefix.length > 0 ? [...categoryPrefix, ...this.category] : this.category, level);\n\t\treturn this.getDispatcher(categoryPrefix).isEnabledForResolved(level);\n\t}\n\t/**\n\t* Checks whether a record of the given level logged through this logger\n\t* would certainly be dropped without being seen by any filter or sink.\n\t* Logging methods use this to return before building a record.\n\t*\n\t* This assumes the context-local storage's store does not change between\n\t* synchronous reads within a single logging call, which holds for\n\t* `AsyncLocalStorage` and for the stores set up by `withContext()`,\n\t* `withCategoryPrefix()`, and `withConfig()`.\n\t* @param level The log level of the record.\n\t* @returns `true` if emitting such a record would have no observable\n\t* effect, `false` otherwise.\n\t*/\n\tisCertainlyDropped(level) {\n\t\tconst categoryPrefix = isMetaLoggerCategory(this.category) ? [] : getCategoryPrefix();\n\t\tconst scopedConfig = getCurrentScopedConfig(LoggerImpl.getLogger().contextLocalStorage);\n\t\tif (scopedConfig != null) return !scopedConfigHasSink(scopedConfig, categoryPrefix.length > 0 ? [...categoryPrefix, ...this.category] : this.category, level);\n\t\treturn this.getDispatcher(categoryPrefix).isCertainlyDroppedResolved(level);\n\t}\n\t/**\n\t* Checks whether a record of the given level dispatched by this logger,\n\t* without a scoped configuration, would certainly be dropped. See\n\t* {@link LoggerImpl.isCertainlyDropped}.\n\t*/\n\tisCertainlyDroppedResolved(level) {\n\t\tif (this.lowestLevel === null || compareLogLevel(level, this.lowestLevel) < 0) return true;\n\t\treturn !this.isEnabledForResolved(level) && !this.hasEffectiveFilters();\n\t}\n\t/**\n\t* Resolves the logger that actually dispatches records logged through this\n\t* logger under the given category prefix. It must stay in sync with\n\t* the dispatcher resolution in {@link LoggerImpl.emit}.\n\t*/\n\tgetDispatcher(categoryPrefix) {\n\t\treturn categoryPrefix.length > 0 ? LoggerImpl.getNearestExistingLogger([...categoryPrefix, ...this.category]) : this;\n\t}\n\t/**\n\t* Checks whether {@link LoggerImpl.filter} would run any filter, i.e.,\n\t* whether this logger or any of its ancestors has a filter.\n\t*/\n\thasEffectiveFilters() {\n\t\tif (this.filters.length > 0) return true;\n\t\treturn this.parent?.hasEffectiveFilters() ?? false;\n\t}\n\t/**\n\t* Checks whether {@link LoggerImpl.getSinks} would yield any sink for\n\t* the given level, without building or validating sink dispatch plans.\n\t* It must stay in sync with {@link LoggerImpl.createSinkDispatchPlan}.\n\t*/\n\tisEnabledForResolved(level) {\n\t\tif (this.lowestLevel === null || compareLogLevel(level, this.lowestLevel) < 0) return false;\n\t\tif (this.sinks.length > 0) return true;\n\t\tif (this.parent == null) return false;\n\t\tif (this.parentSinks === \"inherit\") return this.parent.isEnabledForResolved(level);\n\t\tif (this.parentSinks === \"forward\") return this.parent.hasForwardSinks();\n\t\treturn false;\n\t}\n\t/**\n\t* Checks whether {@link LoggerImpl.getForwardSinkPlan} would collect any\n\t* sink, i.e., whether this logger or an ancestor up to and including the\n\t* nearest one whose `parentSinks` is `\"override\"` has local sinks.\n\t*/\n\thasForwardSinks() {\n\t\tif (this.sinks.length > 0) return true;\n\t\treturn this.parent != null && this.parentSinks !== \"override\" && this.parent.hasForwardSinks();\n\t}\n\temit(record, bypassSinks) {\n\t\tconst hasCategory = \"category\" in record;\n\t\tconst baseCategory = hasCategory ? record.category : this.category;\n\t\tconst categoryPrefix = isMetaLoggerCategory(baseCategory) ? [] : getCategoryPrefix();\n\t\tconst fullCategory = categoryPrefix.length > 0 ? [...categoryPrefix, ...baseCategory] : baseCategory;\n\t\tif (categoryPrefix.length < 1 && Object.prototype.hasOwnProperty.call(record, \"category\")) {\n\t\t\tthis.emitResolved(record, bypassSinks);\n\t\t\treturn;\n\t\t}\n\t\tconst descriptors = Object.getOwnPropertyDescriptors(record);\n\t\tdescriptors.category = {\n\t\t\tvalue: fullCategory,\n\t\t\tenumerable: true,\n\t\t\tconfigurable: true\n\t\t};\n\t\tconst fullRecord = Object.defineProperties({}, descriptors);\n\t\tconst dispatcher = categoryPrefix.length > 0 ? LoggerImpl.getNearestExistingLogger(fullCategory) : this;\n\t\tdispatcher.emitResolved(fullRecord, bypassSinks);\n\t}\n\temitResolved(record, bypassSinks) {\n\t\tconst scopedConfig = getCurrentScopedConfig(LoggerImpl.getLogger().contextLocalStorage);\n\t\tif (scopedConfig != null) {\n\t\t\tlet snapshot$1;\n\t\t\tlet snapshotFailed$1 = false;\n\t\t\temitWithScopedConfig(scopedConfig, record, bypassSinks, (sink, activeBypassSinks) => {\n\t\t\t\ttry {\n\t\t\t\t\tif (shouldSnapshotForSink(sink)) try {\n\t\t\t\t\t\tsnapshot$1 ??= snapshotLogRecordProperties(record);\n\t\t\t\t\t} catch {\n\t\t\t\t\t\tsnapshotFailed$1 = true;\n\t\t\t\t\t\tsnapshot$1 = record;\n\t\t\t\t\t}\n\t\t\t\t\tsink(snapshot$1 ?? record);\n\t\t\t\t} catch (error) {\n\t\t\t\t\tconst bypassSinks2 = new Set(activeBypassSinks);\n\t\t\t\t\tbypassSinks2.add(sink);\n\t\t\t\t\tmetaLogger.log(\"fatal\", \"Failed to emit a log record to sink {sink}: {error}\", {\n\t\t\t\t\t\tsink,\n\t\t\t\t\t\terror,\n\t\t\t\t\t\trecord\n\t\t\t\t\t}, bypassSinks2);\n\t\t\t\t}\n\t\t\t\tif (snapshotFailed$1) snapshot$1 = record;\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tif (this.lowestLevel === null || compareLogLevel(record.level, this.lowestLevel) < 0 || !this.filter(record)) return;\n\t\tconst plan = this.getSinkDispatchPlan(record.level);\n\t\tif (plan.kind === \"none\") return;\n\t\tlet snapshot;\n\t\tlet snapshotFailed = false;\n\t\tif (plan.kind === \"one\") {\n\t\t\tconst sink = plan.sink;\n\t\t\tif (bypassSinks?.has(sink)) return;\n\t\t\ttry {\n\t\t\t\tif (shouldSnapshotForSink(sink)) try {\n\t\t\t\t\tsnapshot = snapshotLogRecordProperties(record);\n\t\t\t\t} catch {\n\t\t\t\t\tsnapshotFailed = true;\n\t\t\t\t\tsnapshot = record;\n\t\t\t\t}\n\t\t\t\tsink(snapshot ?? record);\n\t\t\t} catch (error) {\n\t\t\t\tconst bypassSinks2 = new Set(bypassSinks);\n\t\t\t\tbypassSinks2.add(sink);\n\t\t\t\tmetaLogger.log(\"fatal\", \"Failed to emit a log record to sink {sink}: {error}\", {\n\t\t\t\t\tsink,\n\t\t\t\t\terror,\n\t\t\t\t\trecord\n\t\t\t\t}, bypassSinks2);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tfor (const sink of plan.sinks) {\n\t\t\tif (bypassSinks?.has(sink)) continue;\n\t\t\ttry {\n\t\t\t\tif (snapshot == null && !snapshotFailed && shouldSnapshotForSink(sink)) try {\n\t\t\t\t\tsnapshot = snapshotLogRecordProperties(record);\n\t\t\t\t} catch {\n\t\t\t\t\tsnapshotFailed = true;\n\t\t\t\t\tsnapshot = record;\n\t\t\t\t}\n\t\t\t\tsink(snapshot ?? record);\n\t\t\t} catch (error) {\n\t\t\t\tconst bypassSinks2 = new Set(bypassSinks);\n\t\t\t\tbypassSinks2.add(sink);\n\t\t\t\tmetaLogger.log(\"fatal\", \"Failed to emit a log record to sink {sink}: {error}\", {\n\t\t\t\t\tsink,\n\t\t\t\t\terror,\n\t\t\t\t\trecord\n\t\t\t\t}, bypassSinks2);\n\t\t\t}\n\t\t}\n\t}\n\tlog(level, rawMessage, properties, bypassSinks, sourceLocation) {\n\t\tif (this.isCertainlyDropped(level)) return;\n\t\tconst implicitContext = getImplicitContextIfAny();\n\t\tif (typeof properties !== \"function\" && implicitContext == null && !rawMessage.includes(\"{\") && !hasEnumerableProperties(properties)) {\n\t\t\tconst record$1 = {\n\t\t\t\tcategory: this.category,\n\t\t\t\tlevel,\n\t\t\t\tmessage: [rawMessage],\n\t\t\t\trawMessage,\n\t\t\t\ttimestamp: Date.now(),\n\t\t\t\tproperties: {}\n\t\t\t};\n\t\t\tattachSourceLocation(record$1, sourceLocation);\n\t\t\tresolvedStringLogRecords.add(record$1);\n\t\t\tthis.emit(record$1, bypassSinks);\n\t\t\treturn;\n\t\t}\n\t\tlet cachedProps = void 0;\n\t\tlet cachedMessage = void 0;\n\t\tconst record = typeof properties === \"function\" ? {\n\t\t\tcategory: this.category,\n\t\t\tlevel,\n\t\t\ttimestamp: Date.now(),\n\t\t\tget message() {\n\t\t\t\tif (cachedMessage == null) cachedMessage = parseMessageTemplate(rawMessage, this.properties);\n\t\t\t\treturn cachedMessage;\n\t\t\t},\n\t\t\trawMessage,\n\t\t\tget properties() {\n\t\t\t\tif (cachedProps == null) cachedProps = resolveProperties({\n\t\t\t\t\t...implicitContext ?? {},\n\t\t\t\t\t...properties()\n\t\t\t\t});\n\t\t\t\treturn cachedProps;\n\t\t\t}\n\t\t} : {\n\t\t\tcategory: this.category,\n\t\t\tlevel,\n\t\t\ttimestamp: Date.now(),\n\t\t\tget message() {\n\t\t\t\tif (cachedMessage == null) cachedMessage = parseMessageTemplate(rawMessage, this.properties);\n\t\t\t\treturn cachedMessage;\n\t\t\t},\n\t\t\trawMessage,\n\t\t\tget properties() {\n\t\t\t\tif (cachedProps == null) cachedProps = resolveProperties({\n\t\t\t\t\t...implicitContext ?? {},\n\t\t\t\t\t...properties\n\t\t\t\t});\n\t\t\t\treturn cachedProps;\n\t\t\t}\n\t\t};\n\t\tattachSourceLocation(record, sourceLocation);\n\t\tinternalStringLogRecords.add(record);\n\t\tthis.emit(record, bypassSinks);\n\t}\n\tlogLazily(level, callback, properties = {}, sourceLocation) {\n\t\tif (this.isCertainlyDropped(level)) return;\n\t\tconst implicitContext = getImplicitContextIfAny();\n\t\tlet rawMessage = void 0;\n\t\tlet msg = void 0;\n\t\tfunction realizeMessage() {\n\t\t\tif (msg == null || rawMessage == null) {\n\t\t\t\tmsg = callback((tpl, ...values) => {\n\t\t\t\t\trawMessage = tpl;\n\t\t\t\t\treturn renderMessage(tpl, values);\n\t\t\t\t});\n\t\t\t\tif (rawMessage == null) throw new TypeError(\"No log record was made.\");\n\t\t\t}\n\t\t\treturn [msg, rawMessage];\n\t\t}\n\t\tconst record = {\n\t\t\tcategory: this.category,\n\t\t\tlevel,\n\t\t\tget message() {\n\t\t\t\treturn realizeMessage()[0];\n\t\t\t},\n\t\t\tget rawMessage() {\n\t\t\t\treturn realizeMessage()[1];\n\t\t\t},\n\t\t\ttimestamp: Date.now(),\n\t\t\tproperties: {\n\t\t\t\t...implicitContext ?? {},\n\t\t\t\t...properties\n\t\t\t}\n\t\t};\n\t\tattachSourceLocation(record, sourceLocation);\n\t\tthis.emit(record);\n\t}\n\tlogTemplate(level, messageTemplate, values, properties = {}, sourceLocation) {\n\t\tif (this.isCertainlyDropped(level)) return;\n\t\tconst implicitContext = getImplicitContextIfAny();\n\t\tconst record = {\n\t\t\tcategory: this.category,\n\t\t\tlevel,\n\t\t\tmessage: renderMessage(messageTemplate, values),\n\t\t\trawMessage: messageTemplate,\n\t\t\ttimestamp: Date.now(),\n\t\t\tproperties: {\n\t\t\t\t...implicitContext ?? {},\n\t\t\t\t...properties\n\t\t\t}\n\t\t};\n\t\tattachSourceLocation(record, sourceLocation);\n\t\tthis.emit(record);\n\t}\n\ttrace(message, ...values) {\n\t\tconst sourceLocation = isSourceLocationCaptureActive() ? this.captureSourceLocation(\"trace\") : void 0;\n\t\tif (typeof message === \"string\") return logStringMessage(this, \"trace\", message, values[0], sourceLocation);\n\t\telse if (typeof message === \"function\") this.logLazily(\"trace\", message, void 0, sourceLocation);\n\t\telse if (!Array.isArray(message)) this.log(\"trace\", \"{*}\", message, void 0, sourceLocation);\n\t\telse this.logTemplate(\"trace\", message, values, void 0, sourceLocation);\n\t}\n\tdebug(message, ...values) {\n\t\tconst sourceLocation = isSourceLocationCaptureActive() ? this.captureSourceLocation(\"debug\") : void 0;\n\t\tif (typeof message === \"string\") return logStringMessage(this, \"debug\", message, values[0], sourceLocation);\n\t\telse if (typeof message === \"function\") this.logLazily(\"debug\", message, void 0, sourceLocation);\n\t\telse if (!Array.isArray(message)) this.log(\"debug\", \"{*}\", message, void 0, sourceLocation);\n\t\telse this.logTemplate(\"debug\", message, values, void 0, sourceLocation);\n\t}\n\tinfo(message, ...values) {\n\t\tconst sourceLocation = isSourceLocationCaptureActive() ? this.captureSourceLocation(\"info\") : void 0;\n\t\tif (typeof message === \"string\") return logStringMessage(this, \"info\", message, values[0], sourceLocation);\n\t\telse if (typeof message === \"function\") this.logLazily(\"info\", message, void 0, sourceLocation);\n\t\telse if (!Array.isArray(message)) this.log(\"info\", \"{*}\", message, void 0, sourceLocation);\n\t\telse this.logTemplate(\"info\", message, values, void 0, sourceLocation);\n\t}\n\tlogError(level, error, props, sourceLocation) {\n\t\tif (typeof props !== \"function\") {\n\t\t\tthis.log(level, \"{error.message}\", {\n\t\t\t\t...props,\n\t\t\t\terror\n\t\t\t}, void 0, sourceLocation);\n\t\t\treturn;\n\t\t}\n\t\tif (!this.isEnabledFor(level)) return Promise.resolve();\n\t\tconst result = props();\n\t\tif (result instanceof Promise) return result.then((resolved) => {\n\t\t\tthis.log(level, \"{error.message}\", {\n\t\t\t\t...resolved,\n\t\t\t\terror\n\t\t\t}, void 0, sourceLocation);\n\t\t});\n\t\tthis.log(level, \"{error.message}\", {\n\t\t\t...result,\n\t\t\terror\n\t\t}, void 0, sourceLocation);\n\t}\n\twarn(message, ...values) {\n\t\tconst sourceLocation = isSourceLocationCaptureActive() ? this.captureSourceLocation(\"warning\") : void 0;\n\t\tif (message instanceof Error) return this.logError(\"warning\", message, values[0], sourceLocation);\n\t\telse if (typeof message === \"string\" && values[0] instanceof Error) this.log(\"warning\", message, { error: values[0] }, void 0, sourceLocation);\n\t\telse if (typeof message === \"string\") return logStringMessage(this, \"warning\", message, values[0], sourceLocation);\n\t\telse if (typeof message === \"function\") this.logLazily(\"warning\", message, void 0, sourceLocation);\n\t\telse if (!Array.isArray(message)) this.log(\"warning\", \"{*}\", message, void 0, sourceLocation);\n\t\telse this.logTemplate(\"warning\", message, values, void 0, sourceLocation);\n\t}\n\twarning(message, ...values) {\n\t\tconst sourceLocation = isSourceLocationCaptureActive() ? this.captureSourceLocation(\"warning\") : void 0;\n\t\tif (message instanceof Error) return this.logError(\"warning\", message, values[0], sourceLocation);\n\t\telse if (typeof message === \"string\" && values[0] instanceof Error) this.log(\"warning\", message, { error: values[0] }, void 0, sourceLocation);\n\t\telse if (typeof message === \"string\") return logStringMessage(this, \"warning\", message, values[0], sourceLocation);\n\t\telse if (typeof message === \"function\") this.logLazily(\"warning\", message, void 0, sourceLocation);\n\t\telse if (!Array.isArray(message)) this.log(\"warning\", \"{*}\", message, void 0, sourceLocation);\n\t\telse this.logTemplate(\"warning\", message, values, void 0, sourceLocation);\n\t}\n\terror(message, ...values) {\n\t\tconst sourceLocation = isSourceLocationCaptureActive() ? this.captureSourceLocation(\"error\") : void 0;\n\t\tif (message instanceof Error) return this.logError(\"error\", message, values[0], sourceLocation);\n\t\telse if (typeof message === \"string\" && values[0] instanceof Error) this.log(\"error\", message, { error: values[0] }, void 0, sourceLocation);\n\t\telse if (typeof message === \"string\") return logStringMessage(this, \"error\", message, values[0], sourceLocation);\n\t\telse if (typeof message === \"function\") this.logLazily(\"error\", message, void 0, sourceLocation);\n\t\telse if (!Array.isArray(message)) this.log(\"error\", \"{*}\", message, void 0, sourceLocation);\n\t\telse this.logTemplate(\"error\", message, values, void 0, sourceLocation);\n\t}\n\tfatal(message, ...values) {\n\t\tconst sourceLocation = isSourceLocationCaptureActive() ? this.captureSourceLocation(\"fatal\") : void 0;\n\t\tif (message instanceof Error) return this.logError(\"fatal\", message, values[0], sourceLocation);\n\t\telse if (typeof message === \"string\" && values[0] instanceof Error) this.log(\"fatal\", message, { error: values[0] }, void 0, sourceLocation);\n\t\telse if (typeof message === \"string\") return logStringMessage(this, \"fatal\", message, values[0], sourceLocation);\n\t\telse if (typeof message === \"function\") this.logLazily(\"fatal\", message, void 0, sourceLocation);\n\t\telse if (!Array.isArray(message)) this.log(\"fatal\", \"{*}\", message, void 0, sourceLocation);\n\t\telse this.logTemplate(\"fatal\", message, values, void 0, sourceLocation);\n\t}\n};\n/**\n* A logger implementation with contextual properties. Do not use this\n* directly; use {@link Logger.with} instead. This class is exported\n* for testing purposes.\n*/\nvar LoggerCtx = class LoggerCtx {\n\tlogger;\n\tproperties;\n\tconstructor(logger, properties) {\n\t\tthis.logger = logger;\n\t\tthis.properties = properties;\n\t}\n\tget category() {\n\t\treturn this.logger.category;\n\t}\n\tget parent() {\n\t\treturn this.logger.parent;\n\t}\n\tgetChild(subcategory) {\n\t\treturn this.logger.getChild(subcategory).with(this.properties);\n\t}\n\twith(properties) {\n\t\treturn new LoggerCtx(this.logger, {\n\t\t\t...this.properties,\n\t\t\t...properties\n\t\t});\n\t}\n\tlog(level, message, properties, bypassSinks, sourceLocation) {\n\t\tif (this.logger.isCertainlyDropped(level)) return;\n\t\tconst contextProps = this.properties;\n\t\tthis.logger.log(level, message, typeof properties === \"function\" ? () => resolveProperties({\n\t\t\t...contextProps,\n\t\t\t...properties()\n\t\t}) : () => resolveProperties({\n\t\t\t...contextProps,\n\t\t\t...properties\n\t\t}), bypassSinks, sourceLocation);\n\t}\n\tlogLazily(level, callback, sourceLocation) {\n\t\tif (this.logger.isCertainlyDropped(level)) return;\n\t\tthis.logger.logLazily(level, callback, resolveProperties(this.properties), sourceLocation);\n\t}\n\tlogTemplate(level, messageTemplate, values, sourceLocation) {\n\t\tif (this.logger.isCertainlyDropped(level)) return;\n\t\tthis.logger.logTemplate(level, messageTemplate, values, resolveProperties(this.properties), sourceLocation);\n\t}\n\temit(record) {\n\t\tconst recordWithContext = {\n\t\t\t...record,\n\t\t\tproperties: resolveProperties({\n\t\t\t\t...this.properties,\n\t\t\t\t...record.properties\n\t\t\t})\n\t\t};\n\t\tthis.logger.emit(recordWithContext);\n\t}\n\tisEnabledFor(level) {\n\t\treturn this.logger.isEnabledFor(level);\n\t}\n\ttrace(message, ...values) {\n\t\tconst sourceLocation = isSourceLocationCaptureActive() ? this.logger.captureSourceLocation(\"trace\") : void 0;\n\t\tif (typeof message === \"string\") return logStringMessage(this, \"trace\", message, values[0], sourceLocation);\n\t\telse if (typeof message === \"function\") this.logLazily(\"trace\", message, sourceLocation);\n\t\telse if (!Array.isArray(message)) this.log(\"trace\", \"{*}\", message, void 0, sourceLocation);\n\t\telse this.logTemplate(\"trace\", message, values, sourceLocation);\n\t}\n\tdebug(message, ...values) {\n\t\tconst sourceLocation = isSourceLocationCaptureActive() ? this.logger.captureSourceLocation(\"debug\") : void 0;\n\t\tif (typeof message === \"string\") return logStringMessage(this, \"debug\", message, values[0], sourceLocation);\n\t\telse if (typeof message === \"function\") this.logLazily(\"debug\", message, sourceLocation);\n\t\telse if (!Array.isArray(message)) this.log(\"debug\", \"{*}\", message, void 0, sourceLocation);\n\t\telse this.logTemplate(\"debug\", message, values, sourceLocation);\n\t}\n\tinfo(message, ...values) {\n\t\tconst sourceLocation = isSourceLocationCaptureActive() ? this.logger.captureSourceLocation(\"info\") : void 0;\n\t\tif (typeof message === \"string\") return logStringMessage(this, \"info\", message, values[0], sourceLocation);\n\t\telse if (typeof message === \"function\") this.logLazily(\"info\", message, sourceLocation);\n\t\telse if (!Array.isArray(message)) this.log(\"info\", \"{*}\", message, void 0, sourceLocation);\n\t\telse this.logTemplate(\"info\", message, values, sourceLocation);\n\t}\n\tlogError(level, error, props, sourceLocation) {\n\t\tif (typeof props !== \"function\") {\n\t\t\tthis.log(level, \"{error.message}\", {\n\t\t\t\t...props,\n\t\t\t\terror\n\t\t\t}, void 0, sourceLocation);\n\t\t\treturn;\n\t\t}\n\t\tif (!this.isEnabledFor(level)) return Promise.resolve();\n\t\tconst result = props();\n\t\tif (result instanceof Promise) return result.then((resolved) => {\n\t\t\tthis.log(level, \"{error.message}\", {\n\t\t\t\t...resolved,\n\t\t\t\terror\n\t\t\t}, void 0, sourceLocation);\n\t\t});\n\t\tthis.log(level, \"{error.message}\", {\n\t\t\t...result,\n\t\t\terror\n\t\t}, void 0, sourceLocation);\n\t}\n\twarn(message, ...values) {\n\t\tconst sourceLocation = isSourceLocationCaptureActive() ? this.logger.captureSourceLocation(\"warning\") : void 0;\n\t\tif (message instanceof Error) return this.logError(\"warning\", message, values[0], sourceLocation);\n\t\telse if (typeof message === \"string\" && values[0] instanceof Error) this.log(\"warning\", message, { error: values[0] }, void 0, sourceLocation);\n\t\telse if (typeof message === \"string\") return logStringMessage(this, \"warning\", message, values[0], sourceLocation);\n\t\telse if (typeof message === \"function\") this.logLazily(\"warning\", message, sourceLocation);\n\t\telse if (!Array.isArray(message)) this.log(\"warning\", \"{*}\", message, void 0, sourceLocation);\n\t\telse this.logTemplate(\"warning\", message, values, sourceLocation);\n\t}\n\twarning(message, ...values) {\n\t\tconst sourceLocation = isSourceLocationCaptureActive() ? this.logger.captureSourceLocation(\"warning\") : void 0;\n\t\tif (message instanceof Error) return this.logError(\"warning\", message, values[0], sourceLocation);\n\t\telse if (typeof message === \"string\" && values[0] instanceof Error) this.log(\"warning\", message, { error: values[0] }, void 0, sourceLocation);\n\t\telse if (typeof message === \"string\") return logStringMessage(this, \"warning\", message, values[0], sourceLocation);\n\t\telse if (typeof message === \"function\") this.logLazily(\"warning\", message, sourceLocation);\n\t\telse if (!Array.isArray(message)) this.log(\"warning\", \"{*}\", message, void 0, sourceLocation);\n\t\telse this.logTemplate(\"warning\", message, values, sourceLocation);\n\t}\n\terror(message, ...values) {\n\t\tconst sourceLocation = isSourceLocationCaptureActive() ? this.logger.captureSourceLocation(\"error\") : void 0;\n\t\tif (message instanceof Error) return this.logError(\"error\", message, values[0], sourceLocation);\n\t\telse if (typeof message === \"string\" && values[0] instanceof Error) this.log(\"error\", message, { error: values[0] }, void 0, sourceLocation);\n\t\telse if (typeof message === \"string\") return logStringMessage(this, \"error\", message, values[0], sourceLocation);\n\t\telse if (typeof message === \"function\") this.logLazily(\"error\", message, sourceLocation);\n\t\telse if (!Array.isArray(message)) this.log(\"error\", \"{*}\", message, void 0, sourceLocation);\n\t\telse this.logTemplate(\"error\", message, values, sourceLocation);\n\t}\n\tfatal(message, ...values) {\n\t\tconst sourceLocation = isSourceLocationCaptureActive() ? this.logger.captureSourceLocation(\"fatal\") : void 0;\n\t\tif (message instanceof Error) return this.logError(\"fatal\", message, values[0], sourceLocation);\n\t\telse if (typeof message === \"string\" && values[0] instanceof Error) this.log(\"fatal\", message, { error: values[0] }, void 0, sourceLocation);\n\t\telse if (typeof message === \"string\") return logStringMessage(this, \"fatal\", message, values[0], sourceLocation);\n\t\telse if (typeof message === \"function\") this.logLazily(\"fatal\", message, sourceLocation);\n\t\telse if (!Array.isArray(message)) this.log(\"fatal\", \"{*}\", message, void 0, sourceLocation);\n\t\telse this.logTemplate(\"fatal\", message, values, sourceLocation);\n\t}\n};\n/**\n* The meta logger. It is a logger with the category `[\"logtape\", \"meta\"]`.\n*/\nconst metaLogger = LoggerImpl.getLogger([\"logtape\", \"meta\"]);\n/**\n* Check if a property access key contains nested access patterns.\n* @param key The property key to check.\n* @returns True if the key contains nested access patterns.\n*/\nfunction isNestedAccess(key) {\n\treturn key.includes(\".\") || key.includes(\"[\") || key.includes(\"?.\");\n}\n/**\n* Safely access an own property from an object, blocking prototype pollution.\n*\n* @param obj The object to access the property from.\n* @param key The property key to access.\n* @returns The property value or undefined if not accessible.\n*/\nfunction getOwnProperty(obj, key) {\n\tif (key === \"__proto__\" || key === \"prototype\" || key === \"constructor\") return void 0;\n\tif ((typeof obj === \"object\" || typeof obj === \"function\") && obj !== null) return Object.prototype.hasOwnProperty.call(obj, key) ? obj[key] : void 0;\n\treturn void 0;\n}\n/**\n* Parse the next segment from a property path string.\n*\n* @param path The full property path string.\n* @param fromIndex The index to start parsing from.\n* @returns The parsed segment and next index, or null if parsing fails.\n*/\nfunction parseNextSegment(path, fromIndex) {\n\tconst len = path.length;\n\tlet i = fromIndex;\n\tif (i >= len) return null;\n\tlet segment;\n\tif (path[i] === \"[\") {\n\t\ti++;\n\t\tif (i >= len) return null;\n\t\tif (path[i] === \"\\\"\" || path[i] === \"'\") {\n\t\t\tconst quote = path[i];\n\t\t\ti++;\n\t\t\tlet segmentStr = \"\";\n\t\t\twhile (i < len && path[i] !== quote) if (path[i] === \"\\\\\") {\n\t\t\t\ti++;\n\t\t\t\tif (i < len) {\n\t\t\t\t\tconst escapeChar = path[i];\n\t\t\t\t\tswitch (escapeChar) {\n\t\t\t\t\t\tcase \"n\":\n\t\t\t\t\t\t\tsegmentStr += \"\\n\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"t\":\n\t\t\t\t\t\t\tsegmentStr += \"\t\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"r\":\n\t\t\t\t\t\t\tsegmentStr += \"\\r\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"b\":\n\t\t\t\t\t\t\tsegmentStr += \"\\b\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"f\":\n\t\t\t\t\t\t\tsegmentStr += \"\\f\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"v\":\n\t\t\t\t\t\t\tsegmentStr += \"\\v\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"0\":\n\t\t\t\t\t\t\tsegmentStr += \"\\0\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"\\\\\":\n\t\t\t\t\t\t\tsegmentStr += \"\\\\\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"\\\"\":\n\t\t\t\t\t\t\tsegmentStr += \"\\\"\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"'\":\n\t\t\t\t\t\t\tsegmentStr += \"'\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"u\":\n\t\t\t\t\t\t\tif (i + 4 < len) {\n\t\t\t\t\t\t\t\tconst hex = path.slice(i + 1, i + 5);\n\t\t\t\t\t\t\t\tconst codePoint = Number.parseInt(hex, 16);\n\t\t\t\t\t\t\t\tif (!Number.isNaN(codePoint)) {\n\t\t\t\t\t\t\t\t\tsegmentStr += String.fromCharCode(codePoint);\n\t\t\t\t\t\t\t\t\ti += 4;\n\t\t\t\t\t\t\t\t} else segmentStr += escapeChar;\n\t\t\t\t\t\t\t} else segmentStr += escapeChar;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault: segmentStr += escapeChar;\n\t\t\t\t\t}\n\t\t\t\t\ti++;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tsegmentStr += path[i];\n\t\t\t\ti++;\n\t\t\t}\n\t\t\tif (i >= len) return null;\n\t\t\tsegment = segmentStr;\n\t\t\ti++;\n\t\t} else {\n\t\t\tconst startIndex = i;\n\t\t\twhile (i < len && path[i] !== \"]\" && path[i] !== \"'\" && path[i] !== \"\\\"\") i++;\n\t\t\tif (i >= len) return null;\n\t\t\tconst indexStr = path.slice(startIndex, i);\n\t\t\tif (indexStr.length === 0) return null;\n\t\t\tconst indexNum = Number(indexStr);\n\t\t\tsegment = Number.isNaN(indexNum) ? indexStr : indexNum;\n\t\t}\n\t\twhile (i < len && path[i] !== \"]\") i++;\n\t\tif (i < len) i++;\n\t} else {\n\t\tconst startIndex = i;\n\t\twhile (i < len && path[i] !== \".\" && path[i] !== \"[\" && path[i] !== \"?\" && path[i] !== \"]\") i++;\n\t\tsegment = path.slice(startIndex, i);\n\t\tif (segment.length === 0) return null;\n\t}\n\tif (i < len && path[i] === \".\") i++;\n\treturn {\n\t\tsegment,\n\t\tnextIndex: i\n\t};\n}\n/**\n* Access a property or index on an object or array.\n*\n* @param obj The object or array to access.\n* @param segment The property key or array index.\n* @returns The accessed value or undefined if not accessible.\n*/\nfunction accessProperty(obj, segment) {\n\tif (typeof segment === \"string\") return getOwnProperty(obj, segment);\n\tif (Array.isArray(obj) && segment >= 0 && segment < obj.length) return obj[segment];\n\treturn void 0;\n}\n/**\n* Resolve a nested property path from an object.\n*\n* There are two types of property access patterns:\n* 1. Array/index access: [0] or [\"prop\"]\n* 2. Property access: prop or prop?.next\n*\n* @param obj The object to traverse.\n* @param path The property path (e.g., \"user.name\", \"users[0].email\", \"user['full-name']\").\n* @returns The resolved value or undefined if path doesn't exist.\n*/\nfunction resolvePropertyPath(obj, path) {\n\tif (obj == null) return void 0;\n\tif (path.length === 0 || path.endsWith(\".\")) return void 0;\n\tlet current = obj;\n\tlet i = 0;\n\tconst len = path.length;\n\twhile (i < len) {\n\t\tconst isOptional = path.slice(i, i + 2) === \"?.\";\n\t\tif (isOptional) {\n\t\t\ti += 2;\n\t\t\tif (current == null) return void 0;\n\t\t} else if (current == null) return void 0;\n\t\tconst result = parseNextSegment(path, i);\n\t\tif (result === null) return void 0;\n\t\tconst { segment, nextIndex } = result;\n\t\ti = nextIndex;\n\t\tcurrent = accessProperty(current, segment);\n\t\tif (current === void 0) return void 0;\n\t}\n\treturn current;\n}\n/**\n* Parse a message template into a message template array and a values array.\n*\n* Placeholders to be replaced with `values` are indicated by keys in curly braces\n* (e.g., `{value}`). The system supports both simple property access and nested\n* property access patterns:\n*\n* **Simple property access:**\n* ```ts\n* parseMessageTemplate(\"Hello, {user}!\", { user: \"foo\" })\n* // Returns: [\"Hello, \", \"foo\", \"!\"]\n* ```\n*\n* **Nested property access (dot notation):**\n* ```ts\n* parseMessageTemplate(\"Hello, {user.name}!\", {\n* user: { name: \"foo\", email: \"foo@example.com\" }\n* })\n* // Returns: [\"Hello, \", \"foo\", \"!\"]\n* ```\n*\n* **Array indexing:**\n* ```ts\n* parseMessageTemplate(\"First: {users[0]}\", {\n* users: [\"foo\", \"bar\", \"baz\"]\n* })\n* // Returns: [\"First: \", \"foo\", \"\"]\n* ```\n*\n* **Bracket notation for special property names:**\n* ```ts\n* parseMessageTemplate(\"Name: {user[\\\"full-name\\\"]}\", {\n* user: { \"full-name\": \"foo bar\" }\n* })\n* // Returns: [\"Name: \", \"foo bar\", \"\"]\n* ```\n*\n* **Optional chaining for safe navigation:**\n* ```ts\n* parseMessageTemplate(\"Email: {user?.profile?.email}\", {\n* user: { name: \"foo\" }\n* })\n* // Returns: [\"Email: \", undefined, \"\"]\n* ```\n*\n* **Wildcard patterns:**\n* - `{*}` - Replaced with the entire properties object\n* - `{ key-with-whitespace }` - Whitespace is trimmed when looking up keys\n*\n* **Escaping:**\n* - `{{` and `}}` are escaped literal braces\n*\n* **Error handling:**\n* - Non-existent paths return `undefined`\n* - Malformed expressions resolve to `undefined` without throwing errors\n* - Out of bounds array access returns `undefined`\n*\n* @param template The message template string containing placeholders.\n* @param properties The values to replace placeholders with.\n* @returns The message template array with values interleaved between text segments.\n*/\nfunction parseMessageTemplate(template, properties) {\n\tconst length = template.length;\n\tif (length === 0) return [\"\"];\n\tif (!template.includes(\"{\")) return [template];\n\tconst message = [];\n\tlet startIndex = 0;\n\tfor (let i = 0; i < length; i++) {\n\t\tconst char = template[i];\n\t\tif (char === \"{\") {\n\t\t\tconst nextChar = i + 1 < length ? template[i + 1] : \"\";\n\t\t\tif (nextChar === \"{\") {\n\t\t\t\ti++;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst closeIndex = template.indexOf(\"}\", i + 1);\n\t\t\tif (closeIndex === -1) continue;\n\t\t\tconst beforeText = template.slice(startIndex, i);\n\t\t\tmessage.push(beforeText.replace(/{{/g, \"{\").replace(/}}/g, \"}\"));\n\t\t\tconst key = template.slice(i + 1, closeIndex);\n\t\t\tlet prop;\n\t\t\tconst trimmedKey = key.trim();\n\t\t\tif (trimmedKey === \"*\") prop = key in properties ? properties[key] : \"*\" in properties ? properties[\"*\"] : properties;\n\t\t\telse {\n\t\t\t\tif (key !== trimmedKey) prop = key in properties ? properties[key] : properties[trimmedKey];\n\t\t\t\telse prop = properties[key];\n\t\t\t\tif (prop === void 0 && isNestedAccess(trimmedKey)) prop = resolvePropertyPath(properties, trimmedKey);\n\t\t\t}\n\t\t\tmessage.push(prop);\n\t\t\ti = closeIndex;\n\t\t\tstartIndex = i + 1;\n\t\t} else if (char === \"}\" && i + 1 < length && template[i + 1] === \"}\") i++;\n\t}\n\tconst remainingText = template.slice(startIndex);\n\tmessage.push(remainingText.replace(/{{/g, \"{\").replace(/}}/g, \"}\"));\n\treturn message;\n}\n/**\n* Render a message template with values.\n* @param template The message template.\n* @param values The message template values.\n* @returns The message template values interleaved between the substitution\n* values.\n*/\nfunction renderMessage(template, values) {\n\tconst args = [];\n\tfor (let i = 0; i < template.length; i++) {\n\t\targs.push(template[i]);\n\t\tif (i < values.length) args.push(values[i]);\n\t}\n\treturn args;\n}\n\n//#endregion\nexport { LoggerImpl, findLogger, getLogger, getLoggers, isLazy, isMetaLoggerCategory, lazy };\n//# sourceMappingURL=logger.js.map","import { LoggerImpl } from \"./logger.js\";\n\n//#region src/context.ts\n/**\n* Internal symbol for storing category prefix in context.\n*/\nconst categoryPrefixSymbol = Symbol.for(\"logtape.categoryPrefix\");\n/**\n* Runs a callback with the given implicit context. Every single log record\n* in the callback will have the given context.\n*\n* If no `contextLocalStorage` is configured, this function does nothing and\n* just returns the return value of the callback. It also logs a warning to\n* the `[\"logtape\", \"meta\"]` logger in this case.\n* @param context The context to inject.\n* @param callback The callback to run.\n* @returns The return value of the callback.\n* @since 0.7.0\n*/\nfunction withContext(context, callback) {\n\tconst rootLogger = LoggerImpl.getLogger();\n\tif (rootLogger.contextLocalStorage == null) {\n\t\tLoggerImpl.getLogger([\"logtape\", \"meta\"]).warn(\"Context-local storage is not configured. Specify contextLocalStorage option in the configure() function.\");\n\t\treturn callback();\n\t}\n\tconst parentContext = rootLogger.contextLocalStorage.getStore() ?? {};\n\treturn rootLogger.contextLocalStorage.run({\n\t\t...parentContext,\n\t\t...context\n\t}, callback);\n}\n/**\n* Gets the current category prefix from context local storage.\n* @returns The current category prefix, or an empty array if not set.\n* @since 1.3.0\n*/\nfunction getCategoryPrefix() {\n\tconst rootLogger = LoggerImpl.getLogger();\n\tconst store = rootLogger.contextLocalStorage?.getStore();\n\tif (store == null) return [];\n\tconst prefix = store[categoryPrefixSymbol];\n\treturn Array.isArray(prefix) ? prefix : [];\n}\n/**\n* Gets the current implicit context only when user-visible context keys exist.\n*\n* This is intentionally not exported from the public entry point. Hot logging\n* paths use it to avoid allocating a fresh `{}` when no implicit context is\n* active, while `getImplicitContext()` keeps its public return contract.\n* @returns The current implicit context without internal symbol keys, or\n* `undefined` if there is no user-visible implicit context.\n*/\nfunction getImplicitContextIfAny() {\n\tconst rootLogger = LoggerImpl.getLogger();\n\tconst store = rootLogger.contextLocalStorage?.getStore();\n\tif (store == null) return void 0;\n\tconst keys = Object.keys(store);\n\tif (keys.length < 1) return void 0;\n\tconst result = {};\n\tfor (const key of keys) result[key] = store[key];\n\treturn result;\n}\n/**\n* Runs a callback with the given category prefix prepended to all log\n* categories within the callback context.\n*\n* This is useful for SDKs or libraries that want to add their own category\n* as a prefix to logs from their internal dependencies.\n*\n* If no `contextLocalStorage` is configured, this function does nothing and\n* just returns the return value of the callback. It also logs a warning to\n* the `[\"logtape\", \"meta\"]` logger in this case.\n*\n* @example Basic usage\n* ```typescript\n* import { getLogger, withCategoryPrefix } from \"@logtape/logtape\";\n*\n* export function sdkFunction() {\n* return withCategoryPrefix([\"my-sdk\"], () => {\n* // Any logs from internal libraries within this context\n* // will have [\"my-sdk\"] prepended to their category\n* return internalLibraryFunction();\n* });\n* }\n* ```\n*\n* @param prefix The category prefix to prepend. Can be a string or an array\n* of strings.\n* @param callback The callback to run.\n* @returns The return value of the callback.\n* @since 1.3.0\n*/\nfunction withCategoryPrefix(prefix, callback) {\n\tconst rootLogger = LoggerImpl.getLogger();\n\tif (rootLogger.contextLocalStorage == null) {\n\t\tLoggerImpl.getLogger([\"logtape\", \"meta\"]).warn(\"Context-local storage is not configured. Specify contextLocalStorage option in the configure() function.\");\n\t\treturn callback();\n\t}\n\tconst parentContext = rootLogger.contextLocalStorage.getStore() ?? {};\n\tconst parentPrefix = getCategoryPrefix();\n\tconst newPrefix = typeof prefix === \"string\" ? [prefix] : [...prefix];\n\treturn rootLogger.contextLocalStorage.run({\n\t\t...parentContext,\n\t\t[categoryPrefixSymbol]: [...parentPrefix, ...newPrefix]\n\t}, callback);\n}\n\n//#endregion\nexport { getCategoryPrefix, getImplicitContextIfAny, withCategoryPrefix, withContext };\n//# sourceMappingURL=context.js.map","// Copyright (c) 2025-2026 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { errorCodes, JsonRpcError } from '@canton-network/core-rpc-errors'\n\nconst ERROR_TITLES: Partial<Record<number, string>> = {\n [errorCodes.provider.userRejectedRequest]: 'User Rejected Request',\n [errorCodes.provider.unauthorized]: 'Unauthorized',\n [errorCodes.provider.unsupportedMethod]: 'Unsupported Method',\n [errorCodes.provider.disconnected]: 'Disconnected',\n [errorCodes.provider.chainDisconnected]: 'Chain Disconnected',\n [errorCodes.rpc.parse]: 'Parse Error',\n [errorCodes.rpc.invalidRequest]: 'Invalid Request',\n [errorCodes.rpc.methodNotFound]: 'Method Not Found',\n [errorCodes.rpc.invalidParams]: 'Invalid Parameters',\n [errorCodes.rpc.internal]: 'Internal Error',\n [errorCodes.rpc.invalidInput]: 'Invalid Input',\n [errorCodes.rpc.resourceNotFound]: 'Resource Not Found',\n [errorCodes.rpc.resourceUnavailable]: 'Resource Unavailable',\n [errorCodes.rpc.transactionRejected]: 'Transaction Rejected',\n [errorCodes.rpc.methodNotSupported]: 'Method Not Supported',\n [errorCodes.rpc.limitExceeded]: 'Limit Exceeded',\n}\n\nexport type ErrorToastFallback = {\n message?: string\n buttonText?: string\n title?: string\n}\n\n/** Turns any thrown value into the text shown by an error toast */\nexport function getErrorToastContent(\n e: unknown,\n fallback?: ErrorToastFallback\n): { title: string; message: string; buttonText: string } {\n const message = e instanceof Error ? e.message : ''\n const title = e instanceof JsonRpcError ? ERROR_TITLES[e.code] : undefined\n\n return {\n title: title || fallback?.title || 'Unexpected Error',\n message:\n message ||\n fallback?.message ||\n 'Something went wrong. Please try again.',\n buttonText: fallback?.buttonText || 'Dismiss',\n }\n}\n","// Copyright (c) 2025-2026 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ParsedTransactionInfo } from '@canton-network/core-tx-visualizer'\n\nexport function getActivityStatusTone(\n status: string\n): 'success' | 'warning' | 'danger' | 'default' {\n const normalized = status.toLowerCase()\n\n if (normalized === 'executed' || normalized === 'signed') {\n return 'success'\n }\n if (normalized === 'pending' || normalized === 'awaiting-signature') {\n return 'warning'\n }\n if (normalized === 'failed' || normalized === 'rejected') {\n return 'danger'\n }\n\n return 'default'\n}\n\n/** The MUI colour for an activity's status badge */\nexport function getActivityStatusColor(\n status: string\n): 'success' | 'warning' | 'error' | 'default' {\n const tone = getActivityStatusTone(status)\n return tone === 'danger' ? 'error' : tone\n}\n\nexport function getActivityStatusLabel(status: string): string {\n return status ? status : 'Unknown'\n}\n\nexport function getActivityStatusBadgeClass(status: string): string {\n switch (getActivityStatusTone(status)) {\n case 'success':\n return 'wg-activity-status-success'\n case 'warning':\n return 'text-bg-warning'\n case 'danger':\n return 'text-bg-danger'\n default:\n return 'text-bg-secondary'\n }\n}\n\nexport function formatActivityDate(value: string | null | undefined): string {\n if (!value) {\n return 'N/A'\n }\n\n const normalized = value.replace('T', ' ')\n return normalized.length >= 16 ? normalized.slice(0, 16) : normalized\n}\n\nexport function getActivityType(parsed: ParsedTransactionInfo | null): string {\n const choiceId = parsed?.choiceId\n return choiceId ? choiceId : 'N/A'\n}\n\nexport function getActivityAmount(\n parsed: ParsedTransactionInfo | null\n): string {\n const amount = parsed?.amount\n if (!amount) {\n return 'N/A'\n }\n\n return amount\n}\n"],"names":["cantonLogo","StructError","failure","failures","cached","message","explanation","rest","path","cause","isIterable","value","isObject","print","shiftIterator","input","done","toFailure","result","context","struct","branch","type","refinement","toFailures","validationResult","run","options","coerce","mask","key","status","innerKey","innerValue","innerStruct","iterable","Struct","props","schema","validator","refiner","coercer","entries","sym","assert","create","is","validate","ExactOptionalBrand","ExactOptionalStruct","tuples","tuple","innerTuple","SENSITIVE_REDACTED","SENSITIVE_BRAND","isSensitiveStruct","redactKeys","sourceObj","keys","redacted","withRedactedBranch","parentObj","sensitiveKeys","redactBranch","parentIndex","ancestorIndex","ancestor","child","childSanitized","childIndex","copy","childFound","childKey","entryKey","entryValue","entry","fieldKey","fieldValue","fieldStruct","define","name","withSensitiveEntries","base","parentInBranch","any","array","Element","index","arrayValue","integer","literal","constant","description","never","nullable","ctx","number","object","knowns","Never","unknowns","propertySchema","optional","record","Key","Value","objectKey","objectValue","string","union","Structs","InnerStruct","error","coerced","first","unknown","condition","refine","hasProperty","objectToCheck","JsonSize","isPlainObject","proto","superstructObject","hasOptional","field","exactOptional","validateJson","json","every","i","UnsafeJsonStruct","JsonStruct","propKey","propValue","isValidJson","getSafeJson","jsonrpc2","JsonRpcVersionStruct","JsonRpcIdStruct","JsonRpcErrorStruct","JsonRpcParamsStruct","JsonRpcSuccessStruct","JsonRpcFailureStruct","fastSafeStringify","stringify","deterministicStringify","LIMIT_REPLACE_NODE","CIRCULAR_REPLACE_NODE","arr","replacerStack","defaultOptions","obj","replacer","spacer","decirc","res","replaceGetterValues","part","setReplace","replace","val","k","parent","propertyDescriptor","edgeIndex","stack","depth","compareFunction","a","b","tmp","deterministicDecirc","v","errorCodes","errorValues","FALLBACK_ERROR_CODE","FALLBACK_MESSAGE","getMessageFromCode","code","fallbackMessage","isValidCode","codeString","serializeCause","serializeObject","acc","dataHasCause","data","$importDefault","module","safeStringify","$safeStringify","JsonRpcError","serialized","stringifyReplacer","_","errorCodes$1","logLevels","compareLogLevel","aIndex","bIndex","scopedConfigSymbol","defaultScopedLogger","noFilters","getCurrentScopedConfig","contextLocalStorage","scopedConfig","isCompiledScopedConfig","getActiveScopedConfig","scopedConfigHasSink","category","level","getScopedSinkDispatchPlan","scopedConfigCapturesSourceLocation","categoryKey","captures","length","logger","emitWithScopedConfig","bypassSinks","emitToSink","plan","filterScopedRecord","sink","activeConfig","cacheKey","getScopedSinkDispatchPlanForPrefix","prefix","parentPlan","wrapScopedSinks","collectScopedForwardSinks","firstSink","sinks","appendSink","parentSinks","filters","getScopedFilters","filter","v8FramePrefix","absoluteFilePattern","locationPattern","rejected","parseSourceLocation","frameIndex","lines","parseV8Frame","parseSpiderMonkeyFrame","frame","body","accept","parseLocation","found","location","whole","match","file","line","column","lazySymbol","throttlingSummaryRecordSymbol","immediateSinkSymbol","internalStringLogRecords","resolvedStringLogRecords","globalSourceLocationCapture","scopedSourceLocationCaptures","isSourceLocationCaptureActive","attachSourceLocation","sourceLocation","isLazy","resolveProperties","properties","resolved","symbolProperties","symbolResolved","isPromiseObject","logStringMessage","resolvedProps","snapshotLogRecordProperties","snapshot","descriptors","hasEnumerableProperties","shouldSnapshotForSink","getLogger","LoggerImpl","globalRootLoggerSymbol","isMetaLoggerCategory","#parentSinks","#lowestLevel","#sinkPlanCache","#forwardPlanCache","rootLogger","childRef","subcategory","LoggerCtx","enabled","categoryPrefix","getCategoryPrefix","dispatcher","localSinks","state","baseCategory","fullCategory","fullRecord","snapshot$1","snapshotFailed$1","activeBypassSinks","bypassSinks2","metaLogger","snapshotFailed","rawMessage","implicitContext","getImplicitContextIfAny","record$1","cachedProps","cachedMessage","parseMessageTemplate","callback","msg","realizeMessage","tpl","values","renderMessage","messageTemplate","contextProps","recordWithContext","isNestedAccess","getOwnProperty","parseNextSegment","fromIndex","len","segment","quote","segmentStr","escapeChar","hex","codePoint","startIndex","indexStr","indexNum","accessProperty","resolvePropertyPath","current","nextIndex","template","char","closeIndex","beforeText","prop","trimmedKey","remainingText","args","categoryPrefixSymbol","store","ERROR_TITLES","getErrorToastContent","fallback","getActivityStatusTone","normalized","getActivityStatusColor","tone","getActivityStatusLabel","getActivityStatusBadgeClass","formatActivityDate","getActivityType","parsed","choiceId","getActivityAmount","amount"],"mappings":"AAAA,MAAAA,KAAe;ACWR,MAAMC,WAAoB,UAAU;AAAA,EACvC,YAAYC,GAASC,GAAU;AAC3B,QAAIC;AACJ,UAAM,EAAE,SAAAC,GAAS,aAAAC,GAAa,GAAGC,EAAI,IAAKL,GACpC,EAAE,MAAAM,EAAI,IAAKN,GACXO,IAAQD,EAAK,WAAW,IAAIH,IAAU,YAAYG,EAAK,KAAK,GAAG,CAAC,OAAOH,CAAO;AACpF,UAAMC,KAAeG,CAAK,GACtBH,KAAgB,SAChB,KAAK,QAAQG,IAEjB,OAAO,OAAO,MAAMF,CAAI,GACxB,KAAK,OAAO,KAAK,YAAY,MAC7B,KAAK,WAAW,MACJH,MAAWA,IAAS,CAACF,GAAS,GAAGC,EAAQ,CAAE;AAAA,EAE3D;AACJ;ACrBA,SAASO,GAAWC,GAAO;AACvB,SAAOC,EAASD,CAAK,KAAK,OAAOA,EAAM,OAAO,QAAQ,KAAM;AAChE;AAOO,SAASC,EAASD,GAAO;AAC5B,SAAO,OAAOA,KAAU,YAAYA,MAAU;AAClD;AAoBO,SAASE,EAAMF,GAAO;AACzB,SAAI,OAAOA,KAAU,WACVA,EAAM,SAAQ,IAGlB,OAAOA,KAAU,WAAW,KAAK,UAAUA,CAAK,IAAI,GAAGA,CAAK;AACvE;AASO,SAASG,GAAcC,GAAO;AACjC,QAAM,EAAE,MAAAC,GAAM,OAAAL,MAAUI,EAAM,KAAI;AAClC,SAAOC,IAAO,SAAYL;AAC9B;AAWO,SAASM,G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