@securitydept/client 0.3.0-beta.9 → 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"handle-DwMgqe7R.mjs","names":["UserRecoveryValue","ClientErrorKindValue","defineType"],"sources":["../src/span/attributes.ts","../src/errors/presentation-descriptor.ts","../src/signals/signal.ts","../src/popup/errors.ts","../src/protocol/json-rpc/types.ts","../src/protocol/json-rpc/create.ts","../src/popup/session.ts","../src/popup/handle.ts"],"sourcesContent":["export const SpanSharedAttributeName = {\n\tClientName: \"client.name\",\n\tClientId: \"client.id\",\n\tOperationName: \"operation.name\",\n} as const;\n\nexport type SpanSharedAttributeName =\n\t(typeof SpanSharedAttributeName)[keyof typeof SpanSharedAttributeName];\n","import { SpanSharedAttributeName } from \"../span/attributes\";\nimport { ClientError } from \"./client-error\";\nimport {\n\ttype ClientErrorContextFormatter,\n\ttype ClientErrorKind,\n\tClientErrorKind as ClientErrorKindValue,\n\ttype ErrorPresentationDescriptor,\n\tErrorPresentationTone,\n\ttype ErrorRecoveryActionDescriptor,\n\ttype ReadErrorPresentationDescriptorOptions,\n\ttype UserRecovery,\n\tUserRecovery as UserRecoveryValue,\n} from \"./types\";\n\nconst DEFAULT_RECOVERY_LABELS: Record<UserRecovery, string> = {\n\t[UserRecoveryValue.None]: \"\",\n\t[UserRecoveryValue.Retry]: \"Try again\",\n\t[UserRecoveryValue.RestartFlow]: \"Restart flow\",\n\t[UserRecoveryValue.Reauthenticate]: \"Sign in again\",\n\t[UserRecoveryValue.ContactSupport]: \"Contact support\",\n};\n\nexport const formatClientErrorContext: ClientErrorContextFormatter = (\n\tcontext,\n) => {\n\tlet clientName: string | undefined;\n\tlet clientId: string | undefined;\n\tlet operationName: string | undefined;\n\tfor (const frame of context) {\n\t\tconst frameClientName =\n\t\t\tframe.attributes[SpanSharedAttributeName.ClientName];\n\t\tconst frameClientId = frame.attributes[SpanSharedAttributeName.ClientId];\n\t\tconst frameOperationName =\n\t\t\tframe.attributes[SpanSharedAttributeName.OperationName];\n\t\tif (typeof frameClientName === \"string\") {\n\t\t\tclientName = frameClientName;\n\t\t}\n\t\tif (typeof frameClientId === \"string\") {\n\t\t\tclientId = frameClientId;\n\t\t}\n\t\tif (typeof frameOperationName === \"string\") {\n\t\t\toperationName = frameOperationName;\n\t\t}\n\t}\n\tconst contextLabel = [clientName ?? clientId, operationName]\n\t\t.filter((value): value is string => Boolean(value))\n\t\t.join(\" · \");\n\treturn contextLabel || undefined;\n};\n\nexport function readErrorPresentationDescriptor(\n\terror: unknown,\n\toptions: ReadErrorPresentationDescriptorOptions = {},\n): ErrorPresentationDescriptor {\n\tif (!(error instanceof ClientError)) {\n\t\treturn {\n\t\t\tcode: null,\n\t\t\ttitle: options.fallbackTitle ?? \"Operation failed\",\n\t\t\tdescription:\n\t\t\t\toptions.fallbackDescription ??\n\t\t\t\t\"An unexpected error prevented the operation from completing.\",\n\t\t\trecovery: UserRecoveryValue.None,\n\t\t\ttone: ErrorPresentationTone.Danger,\n\t\t\tprimaryAction: null,\n\t\t};\n\t}\n\tconst clientError = error;\n\n\tconst code = clientError.presentation?.code ?? clientError.code;\n\tconst codePresentation = code ? options.codePresentations?.[code] : undefined;\n\tconst recovery =\n\t\tclientError.presentation?.recovery ??\n\t\tcodePresentation?.recovery ??\n\t\tclientError.recovery;\n\tconst generic = readGenericPresentation(clientError.kind);\n\n\tconst descriptor: ErrorPresentationDescriptor = {\n\t\tcode,\n\t\ttitle: codePresentation?.title ?? generic.title,\n\t\tdescription:\n\t\t\tclientError.presentation?.message ??\n\t\t\tcodePresentation?.description ??\n\t\t\tgeneric.description,\n\t\trecovery,\n\t\ttone:\n\t\t\tcodePresentation?.tone ?? readClientErrorTone(clientError.kind, recovery),\n\t\tprimaryAction: readPrimaryAction(recovery, options),\n\t};\n\tif (!clientError.spanContext || options.contextFormatter === null) {\n\t\treturn descriptor;\n\t}\n\tconst contextLabel = (options.contextFormatter ?? formatClientErrorContext)(\n\t\tclientError.spanContext,\n\t);\n\treturn contextLabel\n\t\t? { ...descriptor, title: `${contextLabel}: ${descriptor.title}` }\n\t\t: descriptor;\n}\n\nfunction readGenericPresentation(kind: ClientErrorKind | null): {\n\ttitle: string;\n\tdescription: string;\n} {\n\tswitch (kind) {\n\t\tcase ClientErrorKindValue.Unauthenticated:\n\t\t\treturn {\n\t\t\t\ttitle: \"Authentication required\",\n\t\t\t\tdescription: \"Sign in again to continue.\",\n\t\t\t};\n\t\tcase ClientErrorKindValue.Unauthorized:\n\t\t\treturn {\n\t\t\t\ttitle: \"Access denied\",\n\t\t\t\tdescription: \"You do not have permission to complete this operation.\",\n\t\t\t};\n\t\tcase ClientErrorKindValue.Cancelled:\n\t\t\treturn {\n\t\t\t\ttitle: \"Operation cancelled\",\n\t\t\t\tdescription: \"The operation was cancelled before it completed.\",\n\t\t\t};\n\t\tcase ClientErrorKindValue.Timeout:\n\t\t\treturn {\n\t\t\t\ttitle: \"Request timed out\",\n\t\t\t\tdescription: \"The operation did not complete in time.\",\n\t\t\t};\n\t\tcase ClientErrorKindValue.Configuration:\n\t\t\treturn {\n\t\t\t\ttitle: \"Configuration error\",\n\t\t\t\tdescription: \"The client is not configured to complete this operation.\",\n\t\t\t};\n\t\tcase ClientErrorKindValue.Storage:\n\t\t\treturn {\n\t\t\t\ttitle: \"Storage failed\",\n\t\t\t\tdescription: \"The client could not access required stored data.\",\n\t\t\t};\n\t\tcase ClientErrorKindValue.Transport:\n\t\t\treturn {\n\t\t\t\ttitle: \"Network request failed\",\n\t\t\t\tdescription: \"The client could not reach the service.\",\n\t\t\t};\n\t\tcase ClientErrorKindValue.Server:\n\t\t\treturn {\n\t\t\t\ttitle: \"Server request failed\",\n\t\t\t\tdescription: \"The service could not complete the request.\",\n\t\t\t};\n\t\tcase ClientErrorKindValue.Protocol:\n\t\t\treturn {\n\t\t\t\ttitle: \"Invalid response\",\n\t\t\t\tdescription:\n\t\t\t\t\t\"The service response did not satisfy the expected protocol.\",\n\t\t\t};\n\t\tcase ClientErrorKindValue.Authorization:\n\t\t\treturn {\n\t\t\t\ttitle: \"Authorization failed\",\n\t\t\t\tdescription: \"The authorization flow could not be completed.\",\n\t\t\t};\n\t\tdefault:\n\t\t\treturn {\n\t\t\t\ttitle: \"Operation failed\",\n\t\t\t\tdescription: \"The operation could not be completed.\",\n\t\t\t};\n\t}\n}\n\nfunction readClientErrorTone(\n\tkind: ClientErrorKind | null,\n\trecovery: UserRecovery,\n) {\n\tif (kind === ClientErrorKindValue.Cancelled) {\n\t\treturn ErrorPresentationTone.Neutral;\n\t}\n\tif (\n\t\tkind === ClientErrorKindValue.Unauthenticated ||\n\t\tkind === ClientErrorKindValue.Timeout ||\n\t\tkind === ClientErrorKindValue.Transport ||\n\t\tkind === ClientErrorKindValue.Server ||\n\t\trecovery === UserRecoveryValue.Retry ||\n\t\trecovery === UserRecoveryValue.RestartFlow ||\n\t\trecovery === UserRecoveryValue.Reauthenticate\n\t) {\n\t\treturn ErrorPresentationTone.Warning;\n\t}\n\treturn ErrorPresentationTone.Danger;\n}\n\nfunction readPrimaryAction(\n\trecovery: UserRecovery,\n\toptions: ReadErrorPresentationDescriptorOptions,\n): ErrorRecoveryActionDescriptor | null {\n\tif (recovery === UserRecoveryValue.None) {\n\t\treturn null;\n\t}\n\tconst label =\n\t\toptions.recoveryLabels?.[recovery] ?? DEFAULT_RECOVERY_LABELS[recovery];\n\tif (!label) {\n\t\treturn null;\n\t}\n\treturn {\n\t\trecovery,\n\t\tlabel,\n\t\thref: options.recoveryLinks?.[recovery] ?? null,\n\t};\n}\n","import { SYMBOL_OBSERVABLE } from \"../compat\";\nimport { RxStateSignal } from \"../rx/signal\";\nimport {\n\ttype ReadableSignalTrait,\n\ttype SignalOptions,\n\ttype WritableSignalTrait,\n} from \"./types\";\n\n/**\n * Minimal writable signal implementation.\n * `set()` always publishes a write. Equality-based value-version suppression is\n * handled by the underlying Rx signal for computed dependency validation.\n */\nexport function createSignal<T>(\n\tinitial: T,\n\toptions?: SignalOptions<T>,\n): WritableSignalTrait<T> {\n\treturn RxStateSignal.fromInitialValue(initial, options);\n}\n\n/**\n * Create a read-only view of a writable signal.\n */\nexport function readonlySignal<T>(\n\tsignal: WritableSignalTrait<T>,\n): ReadableSignalTrait<T> {\n\treturn signal;\n}\n\nexport function isSignalTrait<T>(obj: unknown): obj is ReadableSignalTrait<T> {\n\treturn (\n\t\ttypeof obj === \"object\" &&\n\t\tobj !== null &&\n\t\ttypeof (obj as ReadableSignalTrait<T>).equals === \"function\" &&\n\t\ttypeof (obj as ReadableSignalTrait<T>).get === \"function\" &&\n\t\ttypeof (obj as ReadableSignalTrait<T>).watchStream === \"function\" &&\n\t\ttypeof (obj as ReadableSignalTrait<T>)[SYMBOL_OBSERVABLE] === \"function\"\n\t);\n}\n","export const PopupErrorCode = {\n\tBlocked: \"popup.blocked\",\n\tClosed: \"popup.closed_by_user\",\n} as const;\n\nexport type PopupErrorCode =\n\t(typeof PopupErrorCode)[keyof typeof PopupErrorCode];\n\nexport function readPopupErrorPresentationDescriptor(\n\terror: unknown,\n\toptions: ReadErrorPresentationDescriptorOptions = {},\n): ErrorPresentationDescriptor {\n\treturn readErrorPresentationDescriptor(error, {\n\t\t...options,\n\t\tcodePresentations: {\n\t\t\t[PopupErrorCode.Blocked]: {\n\t\t\t\ttitle: \"Popup was blocked\",\n\t\t\t\tdescription:\n\t\t\t\t\t\"The browser blocked the popup window. Allow popups for this site, then try again.\",\n\t\t\t\trecovery: UserRecovery.Retry,\n\t\t\t\ttone: ErrorPresentationTone.Warning,\n\t\t\t},\n\t\t\t[PopupErrorCode.Closed]: {\n\t\t\t\ttitle: \"Popup was closed\",\n\t\t\t\tdescription:\n\t\t\t\t\t\"The popup window was closed before the operation completed. Start the flow again.\",\n\t\t\t\trecovery: UserRecovery.RestartFlow,\n\t\t\t\ttone: ErrorPresentationTone.Warning,\n\t\t\t},\n\t\t\t...options.codePresentations,\n\t\t},\n\t});\n}\n\nimport {\n\ttype ErrorPresentationDescriptor,\n\tErrorPresentationTone,\n\ttype ReadErrorPresentationDescriptorOptions,\n\treadErrorPresentationDescriptor,\n\tUserRecovery,\n} from \"../errors\";\n","import { type as defineType } from \"arktype\";\nimport { type DisposableTrait } from \"../../compat\";\nimport { type EventStreamTrait } from \"../../events\";\nimport { type TimeTrait } from \"../../scheduling/types\";\n\nexport const JsonRpcIdSchema = defineType(\"string | number\");\n\nexport type JsonRpcId = typeof JsonRpcIdSchema.infer;\n\nexport const JsonRpcErrorPayloadSchema = defineType({\n\tcode: \"number\",\n\tmessage: \"string\",\n\tdata: \"unknown?\",\n});\n\nexport type JsonRpcErrorPayload = typeof JsonRpcErrorPayloadSchema.infer;\n\nexport const JsonRpcRequestMessageSchema = defineType({\n\tjsonrpc: '\"2.0\"',\n\tid: JsonRpcIdSchema,\n\tmethod: \"string\",\n\tparams: \"unknown?\",\n});\n\nexport type JsonRpcRequestMessage = typeof JsonRpcRequestMessageSchema.infer;\n\nexport const JsonRpcNotificationMessageSchema = defineType({\n\tjsonrpc: '\"2.0\"',\n\tmethod: \"string\",\n\tparams: \"unknown?\",\n});\n\nexport type JsonRpcNotificationMessage =\n\ttypeof JsonRpcNotificationMessageSchema.infer;\n\nexport const JsonRpcSuccessResponseMessageSchema = defineType({\n\tjsonrpc: '\"2.0\"',\n\tid: JsonRpcIdSchema,\n\tresult: \"unknown\",\n});\n\nexport type JsonRpcSuccessResponseMessage =\n\ttypeof JsonRpcSuccessResponseMessageSchema.infer;\n\nexport const JsonRpcErrorResponseMessageSchema = defineType({\n\tjsonrpc: '\"2.0\"',\n\tid: JsonRpcIdSchema,\n\terror: JsonRpcErrorPayloadSchema,\n});\n\nexport type JsonRpcErrorResponseMessage =\n\ttypeof JsonRpcErrorResponseMessageSchema.infer;\n\nexport const JsonRpcMessageSchema = JsonRpcRequestMessageSchema.or(\n\tJsonRpcNotificationMessageSchema,\n)\n\t.or(JsonRpcSuccessResponseMessageSchema)\n\t.or(JsonRpcErrorResponseMessageSchema);\n\nexport type JsonRpcMessage = typeof JsonRpcMessageSchema.infer;\n\nexport interface JsonRpcRequestEvent {\n\tid: JsonRpcId;\n\tmethod: string;\n\tparams?: unknown;\n}\n\nexport interface JsonRpcNotificationEvent {\n\tmethod: string;\n\tparams?: unknown;\n}\n\nexport interface JsonRpcRequestOptions {\n\ttimeoutMs?: number;\n}\n\nexport interface JsonRpcSendOptions {\n\tsend(message: JsonRpcMessage): void;\n}\n\nexport interface CreateJsonRpcClientOptions extends JsonRpcSendOptions {\n\ttime: TimeTrait;\n\tdefaultRequestTimeoutMs?: number;\n}\n\nexport interface CreateJsonRpcServerOptions extends JsonRpcSendOptions {}\n\nexport interface CreateJsonRpcServerAndClientOptions\n\textends JsonRpcSendOptions {\n\ttime: TimeTrait;\n\tdefaultRequestTimeoutMs?: number;\n}\n\nexport interface JsonRpcClientTrait extends DisposableTrait {\n\treadonly onNotification: EventStreamTrait<JsonRpcNotificationEvent>;\n\trequest<TResult = unknown>(\n\t\tmethod: string,\n\t\tparams?: unknown,\n\t\toptions?: JsonRpcRequestOptions,\n\t): Promise<TResult>;\n\tnotify(method: string, params?: unknown): void;\n\treceive(message: unknown): void;\n\trejectAllPendingRequests(reason: unknown): void;\n}\n\nexport interface JsonRpcServerTrait extends DisposableTrait {\n\treadonly onRequest: EventStreamTrait<JsonRpcRequestEvent>;\n\treadonly onNotification: EventStreamTrait<JsonRpcNotificationEvent>;\n\tnotify(method: string, params?: unknown): void;\n\treceive(message: unknown): void;\n\trespondSuccess(id: JsonRpcId, result: unknown): void;\n\trespondError(id: JsonRpcId, error: JsonRpcErrorPayload): void;\n}\n\nexport interface JsonRpcServerAndClientTrait\n\textends JsonRpcClientTrait,\n\t\tJsonRpcServerTrait {}\n","import { SYMBOL_DISPOSE } from \"../../compat\";\nimport { type EventStreamTrait } from \"../../events\";\nimport { RxEventSubject } from \"../../rx/event\";\nimport { validateWithSchemaSync } from \"../../validation\";\nimport {\n\ttype CreateJsonRpcClientOptions,\n\ttype CreateJsonRpcServerAndClientOptions,\n\ttype CreateJsonRpcServerOptions,\n\ttype JsonRpcClientTrait,\n\ttype JsonRpcErrorPayload,\n\ttype JsonRpcErrorResponseMessage,\n\ttype JsonRpcId,\n\ttype JsonRpcMessage,\n\tJsonRpcMessageSchema,\n\ttype JsonRpcNotificationEvent,\n\ttype JsonRpcNotificationMessage,\n\ttype JsonRpcRequestEvent,\n\ttype JsonRpcRequestMessage,\n\ttype JsonRpcRequestOptions,\n\ttype JsonRpcServerAndClientTrait,\n\ttype JsonRpcServerTrait,\n\ttype JsonRpcSuccessResponseMessage,\n} from \"./types\";\n\ntype JsonRpcResponseMessage =\n\t| JsonRpcSuccessResponseMessage\n\t| JsonRpcErrorResponseMessage;\n\ninterface PendingRequest {\n\tmethod: string;\n\treject(reason: unknown): void;\n\tresolve(value: unknown): void;\n\ttimeoutHandle?: unknown;\n}\n\nexport function createJsonRpcClient(\n\toptions: CreateJsonRpcClientOptions,\n): JsonRpcClientTrait {\n\treturn new JsonRpcClient(options);\n}\n\nexport function createJsonRpcServer(\n\toptions: CreateJsonRpcServerOptions,\n): JsonRpcServerTrait {\n\treturn new JsonRpcServer(options);\n}\n\nexport function createJsonRpcServerAndClient(\n\toptions: CreateJsonRpcServerAndClientOptions,\n): JsonRpcServerAndClientTrait {\n\treturn new JsonRpcServerAndClient(options);\n}\n\nclass JsonRpcClient implements JsonRpcClientTrait {\n\treadonly onNotification: EventStreamTrait<JsonRpcNotificationEvent>;\n\n\tprivate readonly notificationSubject =\n\t\tnew RxEventSubject<JsonRpcNotificationEvent>();\n\tprivate readonly pendingRequests = new Map<JsonRpcId, PendingRequest>();\n\tprivate disposed = false;\n\tprivate nextRequestId = 1;\n\n\tconstructor(private readonly options: CreateJsonRpcClientOptions) {\n\t\tthis.onNotification = this.notificationSubject;\n\t}\n\n\trequest<TResult = unknown>(\n\t\tmethod: string,\n\t\tparams?: unknown,\n\t\trequestOptions: JsonRpcRequestOptions = {},\n\t): Promise<TResult> {\n\t\tif (this.disposed) {\n\t\t\treturn Promise.reject(createJsonRpcDisposedError(\"client\"));\n\t\t}\n\n\t\tconst id = this.nextRequestId++;\n\t\tconst timeoutMs =\n\t\t\trequestOptions.timeoutMs ?? this.options.defaultRequestTimeoutMs;\n\n\t\treturn new Promise<TResult>((resolve, reject) => {\n\t\t\tconst pendingRequest: PendingRequest = {\n\t\t\t\tmethod,\n\t\t\t\treject,\n\t\t\t\tresolve,\n\t\t\t};\n\n\t\t\tif (timeoutMs !== undefined) {\n\t\t\t\tpendingRequest.timeoutHandle = this.options.time.setTimeout(() => {\n\t\t\t\t\tthis.pendingRequests.delete(id);\n\t\t\t\t\treject(new Error(`JSON-RPC request timed out for ${method}.`));\n\t\t\t\t}, timeoutMs);\n\t\t\t}\n\n\t\t\tthis.pendingRequests.set(id, pendingRequest);\n\n\t\t\ttry {\n\t\t\t\tthis.options.send({\n\t\t\t\t\tjsonrpc: \"2.0\",\n\t\t\t\t\tid,\n\t\t\t\t\tmethod,\n\t\t\t\t\tparams,\n\t\t\t\t} satisfies JsonRpcRequestMessage);\n\t\t\t} catch (error) {\n\t\t\t\tthis.clearPendingRequest(id);\n\t\t\t\treject(error);\n\t\t\t}\n\t\t});\n\t}\n\n\tnotify(method: string, params?: unknown): void {\n\t\tif (this.disposed) {\n\t\t\treturn;\n\t\t}\n\t\tthis.options.send({\n\t\t\tjsonrpc: \"2.0\",\n\t\t\tmethod,\n\t\t\tparams,\n\t\t} satisfies JsonRpcNotificationMessage);\n\t}\n\n\treceive(message: unknown): void {\n\t\tif (this.disposed) {\n\t\t\treturn;\n\t\t}\n\n\t\tfor (const parsedMessage of parseIncomingMessages(message)) {\n\t\t\tif (isJsonRpcResponseMessage(parsedMessage)) {\n\t\t\t\tthis.resolvePendingRequest(parsedMessage);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (isJsonRpcNotificationMessage(parsedMessage)) {\n\t\t\t\tthis.notificationSubject.next({\n\t\t\t\t\tmethod: parsedMessage.method,\n\t\t\t\t\tparams: parsedMessage.params,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\trejectAllPendingRequests(reason: unknown): void {\n\t\tfor (const [id, pendingRequest] of this.pendingRequests) {\n\t\t\tthis.clearPendingRequest(id);\n\t\t\tpendingRequest.reject(reason);\n\t\t}\n\t}\n\n\tdispose(): void {\n\t\tif (this.disposed) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.disposed = true;\n\t\tthis.rejectAllPendingRequests(new Error(\"JSON-RPC client disposed.\"));\n\t\tthis.notificationSubject.complete();\n\t}\n\n\t[SYMBOL_DISPOSE](): void {\n\t\tthis.dispose();\n\t}\n\n\tprivate resolvePendingRequest(message: JsonRpcResponseMessage): void {\n\t\tconst pendingRequest = this.pendingRequests.get(message.id);\n\t\tif (!pendingRequest) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.clearPendingRequest(message.id);\n\n\t\tif (\"error\" in message) {\n\t\t\tpendingRequest.reject(\n\t\t\t\tnew Error(\n\t\t\t\t\t`JSON-RPC request failed for ${pendingRequest.method}: ${message.error.message}`,\n\t\t\t\t),\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\tpendingRequest.resolve(message.result);\n\t}\n\n\tprivate clearPendingRequest(id: JsonRpcId): void {\n\t\tconst pendingRequest = this.pendingRequests.get(id);\n\t\tif (!pendingRequest) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (pendingRequest.timeoutHandle !== undefined) {\n\t\t\tthis.options.time.clearTimeout(pendingRequest.timeoutHandle);\n\t\t}\n\n\t\tthis.pendingRequests.delete(id);\n\t}\n}\n\nclass JsonRpcServer implements JsonRpcServerTrait {\n\treadonly onRequest: EventStreamTrait<JsonRpcRequestEvent>;\n\treadonly onNotification: EventStreamTrait<JsonRpcNotificationEvent>;\n\n\tprivate readonly requestSubject = new RxEventSubject<JsonRpcRequestEvent>();\n\tprivate readonly notificationSubject =\n\t\tnew RxEventSubject<JsonRpcNotificationEvent>();\n\tprivate disposed = false;\n\n\tconstructor(private readonly options: CreateJsonRpcServerOptions) {\n\t\tthis.onRequest = this.requestSubject;\n\t\tthis.onNotification = this.notificationSubject;\n\t}\n\n\tnotify(method: string, params?: unknown): void {\n\t\tif (this.disposed) {\n\t\t\treturn;\n\t\t}\n\t\tthis.options.send({\n\t\t\tjsonrpc: \"2.0\",\n\t\t\tmethod,\n\t\t\tparams,\n\t\t} satisfies JsonRpcNotificationMessage);\n\t}\n\n\treceive(message: unknown): void {\n\t\tif (this.disposed) {\n\t\t\treturn;\n\t\t}\n\n\t\tfor (const parsedMessage of parseIncomingMessages(message)) {\n\t\t\tif (isJsonRpcRequestMessage(parsedMessage)) {\n\t\t\t\tthis.requestSubject.next({\n\t\t\t\t\tid: parsedMessage.id,\n\t\t\t\t\tmethod: parsedMessage.method,\n\t\t\t\t\tparams: parsedMessage.params,\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (isJsonRpcNotificationMessage(parsedMessage)) {\n\t\t\t\tthis.notificationSubject.next({\n\t\t\t\t\tmethod: parsedMessage.method,\n\t\t\t\t\tparams: parsedMessage.params,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\trespondSuccess(id: JsonRpcId, result: unknown): void {\n\t\tif (this.disposed) {\n\t\t\treturn;\n\t\t}\n\t\tthis.options.send({\n\t\t\tjsonrpc: \"2.0\",\n\t\t\tid,\n\t\t\tresult,\n\t\t} satisfies JsonRpcSuccessResponseMessage);\n\t}\n\n\trespondError(id: JsonRpcId, error: JsonRpcErrorPayload): void {\n\t\tif (this.disposed) {\n\t\t\treturn;\n\t\t}\n\t\tthis.options.send({\n\t\t\tjsonrpc: \"2.0\",\n\t\t\tid,\n\t\t\terror,\n\t\t} satisfies JsonRpcErrorResponseMessage);\n\t}\n\n\tdispose(): void {\n\t\tif (this.disposed) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.disposed = true;\n\t\tthis.requestSubject.complete();\n\t\tthis.notificationSubject.complete();\n\t}\n\n\t[SYMBOL_DISPOSE](): void {\n\t\tthis.dispose();\n\t}\n}\n\nclass JsonRpcServerAndClient implements JsonRpcServerAndClientTrait {\n\treadonly onNotification: EventStreamTrait<JsonRpcNotificationEvent>;\n\treadonly onRequest: EventStreamTrait<JsonRpcRequestEvent>;\n\n\tprivate readonly client: JsonRpcClient;\n\tprivate readonly server: JsonRpcServer;\n\tprivate disposed = false;\n\n\tconstructor(options: CreateJsonRpcServerAndClientOptions) {\n\t\tthis.client = new JsonRpcClient(options);\n\t\tthis.server = new JsonRpcServer(options);\n\t\tthis.onNotification = this.server.onNotification;\n\t\tthis.onRequest = this.server.onRequest;\n\t}\n\n\trequest<TResult = unknown>(\n\t\tmethod: string,\n\t\tparams?: unknown,\n\t\toptions?: JsonRpcRequestOptions,\n\t): Promise<TResult> {\n\t\treturn this.client.request<TResult>(method, params, options);\n\t}\n\n\tnotify(method: string, params?: unknown): void {\n\t\tthis.client.notify(method, params);\n\t}\n\n\treceive(message: unknown): void {\n\t\tfor (const parsedMessage of parseIncomingMessages(message)) {\n\t\t\tif (isJsonRpcResponseMessage(parsedMessage)) {\n\t\t\t\tthis.client.receive(parsedMessage);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tthis.server.receive(parsedMessage);\n\t\t}\n\t}\n\n\trejectAllPendingRequests(reason: unknown): void {\n\t\tthis.client.rejectAllPendingRequests(reason);\n\t}\n\n\trespondSuccess(id: JsonRpcId, result: unknown): void {\n\t\tthis.server.respondSuccess(id, result);\n\t}\n\n\trespondError(id: JsonRpcId, error: JsonRpcErrorPayload): void {\n\t\tthis.server.respondError(id, error);\n\t}\n\n\tdispose(): void {\n\t\tif (this.disposed) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.disposed = true;\n\t\tthis.client.dispose();\n\t\tthis.server.dispose();\n\t}\n\n\t[SYMBOL_DISPOSE](): void {\n\t\tthis.dispose();\n\t}\n}\n\nfunction parseIncomingMessages(message: unknown): JsonRpcMessage[] {\n\tif (!Array.isArray(message)) {\n\t\treturn parseJsonRpcMessage(message);\n\t}\n\n\tconst parsedMessages: JsonRpcMessage[] = [];\n\tfor (const entry of message) {\n\t\tparsedMessages.push(...parseJsonRpcMessage(entry));\n\t}\n\treturn parsedMessages;\n}\n\nfunction parseJsonRpcMessage(message: unknown): JsonRpcMessage[] {\n\tconst result = validateWithSchemaSync(JsonRpcMessageSchema, message);\n\treturn result.success ? [result.value] : [];\n}\n\nfunction isJsonRpcRequestMessage(\n\tmessage: JsonRpcMessage,\n): message is JsonRpcRequestMessage {\n\treturn \"method\" in message && \"id\" in message;\n}\n\nfunction isJsonRpcResponseMessage(\n\tmessage: JsonRpcMessage,\n): message is JsonRpcResponseMessage {\n\treturn \"id\" in message && !(\"method\" in message);\n}\n\nfunction isJsonRpcNotificationMessage(\n\tmessage: JsonRpcMessage,\n): message is JsonRpcNotificationMessage {\n\treturn \"method\" in message && !(\"id\" in message);\n}\n\nfunction createJsonRpcDisposedError(role: \"client\" | \"server\"): Error {\n\treturn new Error(`JSON-RPC ${role} disposed.`);\n}\n","import {\n\tBehaviorSubject,\n\tcatchError,\n\tdelayWhen,\n\tdistinctUntilChanged,\n\texhaustMap,\n\tfilter,\n\tfrom,\n\tmap,\n\tmerge,\n\tof,\n\tReplaySubject,\n\tSubject,\n\tshareReplay,\n\ttake,\n\ttakeUntil,\n\ttimeout,\n\ttimer,\n} from \"rxjs\";\nimport { SYMBOL_DISPOSE } from \"../compat\";\nimport { ClientError, ClientErrorKind, UserRecovery } from \"../errors\";\nimport { type EventStreamTrait } from \"../events\";\nimport {\n\ttype JsonRpcClientTrait,\n\ttype JsonRpcNotificationEvent,\n\ttype JsonRpcServerTrait,\n} from \"../protocol/json-rpc\";\nimport { createAsyncSchedulerWithTimestampProvider } from \"../rx\";\nimport { type TimeTrait } from \"../scheduling/types\";\nimport { createSignal } from \"../signals\";\nimport { PopupErrorCode } from \"./errors\";\n\nexport const PopupSessionControlMethod = {\n\tReady: \"securitydept.popup.session.ready\",\n\tPing: \"securitydept.popup.session.ping\",\n\tPong: \"securitydept.popup.session.pong\",\n} as const;\n\nconst DEFAULT_READY_TIMEOUT_MS = 10_000;\nconst DEFAULT_HEARTBEAT_INTERVAL_MS = 5_000;\nconst DEFAULT_HEARTBEAT_TIMEOUT_MS = 15_000;\n\nexport interface CreatePopupClientSessionOptions {\n\tjsonRpc: JsonRpcClientTrait;\n\ttime: TimeTrait;\n\tclosedStream: EventStreamTrait<boolean>;\n\treadyTimeoutMs?: number;\n\theartbeatIntervalMs?: number;\n\theartbeatTimeoutMs?: number;\n}\n\nexport interface CreatePopupServerSessionOptions {\n\tjsonRpc: JsonRpcServerTrait;\n}\n\nexport class PopupClientSession {\n\treadonly failure = createSignal<ClientError | null>(null);\n\treadonly isActive = createSignal(false);\n\n\tprivate readonly init$ = new ReplaySubject<true>();\n\tprivate readonly destroyed = createSignal<boolean>(false);\n\tprivate readonly destroyed$ = from(this.destroyed).pipe(\n\t\tdistinctUntilChanged(),\n\t\tfilter(Boolean),\n\t\tshareReplay(1),\n\t);\n\n\tconstructor(options: CreatePopupClientSessionOptions) {\n\t\tconst timestampScheduler = createAsyncSchedulerWithTimestampProvider(\n\t\t\toptions.time,\n\t\t);\n\t\tconst ready$ = new Subject<boolean>();\n\t\tconst pong$ = new Subject<boolean>();\n\t\tconst closed$ = from(options.closedStream).pipe(filter(Boolean));\n\n\t\tconst ping$ = merge(\n\t\t\tready$.pipe(filter(Boolean)),\n\t\t\tpong$.pipe(filter(Boolean)),\n\t\t).pipe(\n\t\t\tdelayWhen(() =>\n\t\t\t\ttimer(\n\t\t\t\t\toptions.heartbeatIntervalMs ?? DEFAULT_HEARTBEAT_INTERVAL_MS,\n\t\t\t\t\ttimestampScheduler,\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\tfrom(this.init$)\n\t\t\t.pipe(\n\t\t\t\texhaustMap(() =>\n\t\t\t\t\tfrom(options.jsonRpc.onNotification).pipe(\n\t\t\t\t\t\tfilter(function isReadyNotification(event): event is {\n\t\t\t\t\t\t\tmethod: typeof PopupSessionControlMethod.Ready;\n\t\t\t\t\t\t} {\n\t\t\t\t\t\t\treturn event.method === PopupSessionControlMethod.Ready;\n\t\t\t\t\t\t}),\n\t\t\t\t\t\ttake(1),\n\t\t\t\t\t\ttimeout({\n\t\t\t\t\t\t\teach: options.readyTimeoutMs ?? DEFAULT_READY_TIMEOUT_MS,\n\t\t\t\t\t\t\tscheduler: timestampScheduler,\n\t\t\t\t\t\t}),\n\t\t\t\t\t\tmap(() => true),\n\t\t\t\t\t\tcatchError(() => of(false)),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\ttakeUntil(this.destroyed$),\n\t\t\t)\n\t\t\t.subscribe(ready$);\n\n\t\tping$\n\t\t\t.pipe(\n\t\t\t\texhaustMap(() =>\n\t\t\t\t\tfrom(options.jsonRpc.onNotification).pipe(\n\t\t\t\t\t\tfilter(function isPongNotification(event): event is {\n\t\t\t\t\t\t\tmethod: typeof PopupSessionControlMethod.Pong;\n\t\t\t\t\t\t} {\n\t\t\t\t\t\t\treturn event.method === PopupSessionControlMethod.Pong;\n\t\t\t\t\t\t}),\n\t\t\t\t\t\ttake(1),\n\t\t\t\t\t\ttimeout({\n\t\t\t\t\t\t\tfirst: options.heartbeatTimeoutMs ?? DEFAULT_HEARTBEAT_TIMEOUT_MS,\n\t\t\t\t\t\t\tscheduler: timestampScheduler,\n\t\t\t\t\t\t}),\n\t\t\t\t\t\tmap(() => true),\n\t\t\t\t\t\tcatchError(() => of(false)),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\ttakeUntil(this.destroyed$),\n\t\t\t)\n\t\t\t.subscribe(pong$);\n\n\t\tmerge(\n\t\t\tclosed$.pipe(\n\t\t\t\tmap(\n\t\t\t\t\t() =>\n\t\t\t\t\t\tnew ClientError({\n\t\t\t\t\t\t\tkind: ClientErrorKind.Authorization,\n\t\t\t\t\t\t\tcode: PopupErrorCode.Closed,\n\t\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t\t\"Popup window was closed before completing the login flow.\",\n\t\t\t\t\t\t\trecovery: UserRecovery.RestartFlow,\n\t\t\t\t\t\t\tsource: \"popup\",\n\t\t\t\t\t\t}),\n\t\t\t\t),\n\t\t\t),\n\t\t\tready$.pipe(\n\t\t\t\tmap((success) =>\n\t\t\t\t\t!success\n\t\t\t\t\t\t? new ClientError({\n\t\t\t\t\t\t\t\tkind: ClientErrorKind.Protocol,\n\t\t\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t\t\t\"Did not receive ready notification from popup within the expected time.\",\n\t\t\t\t\t\t\t\trecovery: UserRecovery.RestartFlow,\n\t\t\t\t\t\t\t\tsource: \"popup\",\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t: null,\n\t\t\t\t),\n\t\t\t),\n\t\t\tpong$.pipe(\n\t\t\t\tmap((success) =>\n\t\t\t\t\t!success\n\t\t\t\t\t\t? new ClientError({\n\t\t\t\t\t\t\t\tkind: ClientErrorKind.Protocol,\n\t\t\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t\t\t\"Did not receive pong notification from popup within the expected time.\",\n\t\t\t\t\t\t\t\trecovery: UserRecovery.RestartFlow,\n\t\t\t\t\t\t\t\tsource: \"popup\",\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t: null,\n\t\t\t\t),\n\t\t\t),\n\t\t)\n\t\t\t.pipe(\n\t\t\t\ttakeUntil(this.destroyed$),\n\t\t\t\tshareReplay({\n\t\t\t\t\tbufferSize: 1,\n\t\t\t\t\trefCount: false,\n\t\t\t\t}),\n\t\t\t)\n\t\t\t.subscribe((error) => this.failure.set(error));\n\n\t\tmerge(\n\t\t\tclosed$.pipe(map(() => false)),\n\t\t\tready$.pipe(map(Boolean)),\n\t\t\tpong$.pipe(map(Boolean)),\n\t\t)\n\t\t\t.pipe(takeUntil(this.destroyed$))\n\t\t\t.subscribe((nextIsActive) => {\n\t\t\t\tthis.isActive.set(nextIsActive);\n\t\t\t});\n\t}\n\n\tinit(): void {\n\t\tthis.init$.next(true);\n\t}\n\n\tdispose(): void {\n\t\tthis.destroyed.set(true);\n\t}\n\n\t[SYMBOL_DISPOSE](): void {\n\t\tthis.dispose();\n\t}\n}\n\nexport class PopupServerSession {\n\tprivate readonly init$ = new ReplaySubject<true>();\n\tprivate readonly destroyed$$ = new BehaviorSubject<boolean>(false);\n\tprivate readonly destroyed$ = this.destroyed$$.pipe(\n\t\tdistinctUntilChanged(),\n\t\tfilter(Boolean),\n\t\tshareReplay(1),\n\t);\n\n\tconstructor(options: CreatePopupServerSessionOptions) {\n\t\tconst ready$ = from(this.init$);\n\t\tconst ping$ = from(options.jsonRpc.onNotification).pipe(\n\t\t\tfilter(function isPing(event) {\n\t\t\t\treturn event.method === PopupSessionControlMethod.Ping;\n\t\t\t}),\n\t\t);\n\t\tconst pong$ = ping$;\n\n\t\tmerge(\n\t\t\tready$.pipe(\n\t\t\t\tmap(function createReadyNotify(): JsonRpcNotificationEvent {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tmethod: PopupSessionControlMethod.Ready,\n\t\t\t\t\t};\n\t\t\t\t}),\n\t\t\t),\n\t\t\tpong$.pipe(\n\t\t\t\tmap(function createPongNotify(): JsonRpcNotificationEvent {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tmethod: PopupSessionControlMethod.Pong,\n\t\t\t\t\t};\n\t\t\t\t}),\n\t\t\t),\n\t\t)\n\t\t\t.pipe(takeUntil(this.destroyed$))\n\t\t\t.subscribe((event) => {\n\t\t\t\toptions.jsonRpc.notify(event.method, event.params);\n\t\t\t});\n\t}\n\n\tinit(): void {\n\t\tthis.init$.next(true);\n\t}\n\n\tdispose(): void {\n\t\tthis.destroyed$$.next(true);\n\t}\n\n\t[SYMBOL_DISPOSE](): void {\n\t\tthis.dispose();\n\t}\n}\n","import { type DisposableTrait, SYMBOL_DISPOSE } from \"../compat\";\nimport { type ClientError } from \"../errors\";\nimport {\n\ttype EventStreamTrait,\n\ttype EventSubjectTrait,\n\ttype EventSubscriptionTrait,\n} from \"../events\";\nimport {\n\tcreateJsonRpcClient,\n\tcreateJsonRpcServer,\n\ttype JsonRpcClientTrait,\n\ttype JsonRpcMessage,\n\ttype JsonRpcNotificationEvent,\n\ttype JsonRpcRequestEvent,\n\ttype JsonRpcRequestOptions,\n\ttype JsonRpcServerTrait,\n} from \"../protocol/json-rpc\";\nimport { type TimeTrait } from \"../scheduling/types\";\nimport { type ReadableSignalTrait } from \"../signals\";\nimport { PopupClientSession, PopupServerSession } from \"./session\";\n\nexport interface PopupMessageChannelTrait<\n\tTOutgoing = unknown,\n\tTIncoming = unknown,\n> {\n\toutgoing: EventSubjectTrait<TOutgoing>;\n\tincoming: EventStreamTrait<TIncoming>;\n}\n\nexport interface PopupWindowHandleTrait extends DisposableTrait {\n\tmessaging: PopupMessageChannelTrait;\n\treadonly onNotification: EventStreamTrait<JsonRpcNotificationEvent>;\n\tclose(): void;\n\tdispose(): void;\n\tnotify(method: string, params?: unknown): Promise<void>;\n}\n\nexport interface PopupClientWindowHandleTrait extends PopupWindowHandleTrait {\n\treadonly failure: ReadableSignalTrait<ClientError | null>;\n\treadonly isActive: ReadableSignalTrait<boolean>;\n\trequest<TResult = unknown>(\n\t\tmethod: string,\n\t\tparams?: unknown,\n\t\toptions?: JsonRpcRequestOptions,\n\t): Promise<TResult>;\n}\n\nexport interface PopupServerWindowHandleTrait extends PopupWindowHandleTrait {}\n\nexport interface PopupClientWindowHandleOptions {\n\tclose(): void;\n\tmessaging: PopupMessageChannelTrait<JsonRpcMessage, unknown>;\n\ttime: TimeTrait;\n\tclosedStream: EventStreamTrait<boolean>;\n}\n\nexport interface PopupServerWindowHandleOptions {\n\tclose(): void;\n\tmessaging: PopupMessageChannelTrait<JsonRpcMessage, unknown>;\n}\n\n/**\n * popup opener\n */\nexport class PopupClientWindowHandle implements PopupClientWindowHandleTrait {\n\treadonly messaging: PopupMessageChannelTrait<JsonRpcMessage, unknown>;\n\tprivate disposed = false;\n\tprivate readonly jsonRpc: JsonRpcClientTrait;\n\tprivate readonly session: PopupClientSession;\n\tprivate readonly incomingSubscription: EventSubscriptionTrait;\n\tprivate readonly closePopup: () => void;\n\n\tconstructor(options: PopupClientWindowHandleOptions) {\n\t\tthis.messaging = options.messaging;\n\t\tthis.closePopup = options.close;\n\t\tthis.jsonRpc = createJsonRpcClient({\n\t\t\tsend: (message) => {\n\t\t\t\toptions.messaging.outgoing.next(message);\n\t\t\t},\n\t\t\ttime: options.time,\n\t\t});\n\t\tthis.session = new PopupClientSession({\n\t\t\tjsonRpc: this.jsonRpc,\n\t\t\ttime: options.time,\n\t\t\tclosedStream: options.closedStream,\n\t\t});\n\t\tthis.incomingSubscription = options.messaging.incoming.subscribe({\n\t\t\tnext: (message) => {\n\t\t\t\tthis.jsonRpc.receive(message);\n\t\t\t},\n\t\t});\n\t\tthis.session.init();\n\t}\n\n\tget onNotification(): EventStreamTrait<JsonRpcNotificationEvent> {\n\t\treturn this.jsonRpc.onNotification;\n\t}\n\n\tget failure(): ReadableSignalTrait<ClientError | null> {\n\t\treturn this.session.failure;\n\t}\n\n\tget isActive(): ReadableSignalTrait<boolean> {\n\t\treturn this.session.isActive;\n\t}\n\n\tasync notify(method: string, params?: unknown): Promise<void> {\n\t\tthis.jsonRpc.notify(method, params);\n\t}\n\n\trequest<TResult = unknown>(\n\t\tmethod: string,\n\t\tparams?: unknown,\n\t\toptions?: JsonRpcRequestOptions,\n\t): Promise<TResult> {\n\t\treturn this.jsonRpc.request(method, params, options);\n\t}\n\n\tclose(): void {\n\t\tthis.closePopup();\n\t}\n\n\tdispose(): void {\n\t\tif (this.disposed) {\n\t\t\treturn;\n\t\t}\n\t\tthis.disposed = true;\n\t\tthis.session.dispose();\n\t\tthis.jsonRpc.dispose();\n\t\tthis.incomingSubscription.unsubscribe();\n\t\tthis.messaging.outgoing.complete();\n\t}\n\n\t[SYMBOL_DISPOSE](): void {\n\t\tthis.dispose();\n\t}\n}\n\n/**\n * popup target\n */\nexport class PopupServerWindowHandle implements PopupServerWindowHandleTrait {\n\treadonly messaging: PopupMessageChannelTrait<JsonRpcMessage, unknown>;\n\tprivate disposed = false;\n\tprivate readonly jsonRpc: JsonRpcServerTrait;\n\tprivate readonly session: PopupServerSession;\n\tprivate readonly incomingSubscription: EventSubscriptionTrait;\n\tprivate readonly closePopup: () => void;\n\n\tconstructor(options: PopupServerWindowHandleOptions) {\n\t\tthis.messaging = options.messaging;\n\t\tthis.closePopup = options.close;\n\t\tthis.jsonRpc = createJsonRpcServer({\n\t\t\tsend: (message) => {\n\t\t\t\toptions.messaging.outgoing.next(message);\n\t\t\t},\n\t\t});\n\t\tthis.session = new PopupServerSession({ jsonRpc: this.jsonRpc });\n\t\tthis.incomingSubscription = options.messaging.incoming.subscribe({\n\t\t\tnext: (message) => {\n\t\t\t\tthis.jsonRpc.receive(message);\n\t\t\t},\n\t\t});\n\t\tthis.session.init();\n\t}\n\n\tget onNotification(): EventStreamTrait<JsonRpcNotificationEvent> {\n\t\treturn this.jsonRpc.onNotification;\n\t}\n\n\tget onRequest(): EventStreamTrait<JsonRpcRequestEvent> {\n\t\treturn this.jsonRpc.onRequest;\n\t}\n\n\tnotify(method: string, params?: unknown): Promise<void> {\n\t\tthis.jsonRpc.notify(method, params);\n\t\treturn Promise.resolve();\n\t}\n\n\tclose(): void {\n\t\tthis.closePopup();\n\t}\n\n\tdispose(): void {\n\t\tif (this.disposed) {\n\t\t\treturn;\n\t\t}\n\t\tthis.disposed = true;\n\t\tthis.session.dispose();\n\t\tthis.jsonRpc.dispose();\n\t\tthis.incomingSubscription.unsubscribe();\n\t\tthis.messaging.outgoing.complete();\n\t}\n\n\t[SYMBOL_DISPOSE](): void {\n\t\tthis.dispose();\n\t}\n}\n"],"mappings":";;;;;AAAA,MAAa,0BAA0B;CACtC,YAAY;CACZ,UAAU;CACV,eAAe;AAChB;;;ACUA,MAAM,0BAAwD;EAC5DA,aAAkB,OA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{"version":3,"file":"handle-DCHUG9HI.mjs","names":["UserRecoveryValue","ClientErrorKindValue","defineType"],"sources":["../src/span/attributes.ts","../src/errors/presentation-descriptor.ts","../src/signals/signal.ts","../src/popup/errors.ts","../src/protocol/json-rpc/types.ts","../src/protocol/json-rpc/create.ts","../src/popup/session.ts","../src/popup/handle.ts"],"sourcesContent":["export const SpanSharedAttributeName = {\n\tClientName: \"client.name\",\n\tClientId: \"client.id\",\n\tOperationName: \"operation.name\",\n} as const;\n\nexport type SpanSharedAttributeName =\n\t(typeof SpanSharedAttributeName)[keyof typeof SpanSharedAttributeName];\n","import { SpanSharedAttributeName } from \"../span/attributes\";\nimport { ClientError } from \"./client-error\";\nimport {\n\ttype ClientErrorContextFormatter,\n\ttype ClientErrorKind,\n\tClientErrorKind as ClientErrorKindValue,\n\ttype ErrorPresentationDescriptor,\n\tErrorPresentationTone,\n\ttype ErrorRecoveryActionDescriptor,\n\ttype ReadErrorPresentationDescriptorOptions,\n\ttype UserRecovery,\n\tUserRecovery as UserRecoveryValue,\n} from \"./types\";\n\nconst DEFAULT_RECOVERY_LABELS: Record<UserRecovery, string> = {\n\t[UserRecoveryValue.None]: \"\",\n\t[UserRecoveryValue.Retry]: \"Try again\",\n\t[UserRecoveryValue.RestartFlow]: \"Restart flow\",\n\t[UserRecoveryValue.Reauthenticate]: \"Sign in again\",\n\t[UserRecoveryValue.ContactSupport]: \"Contact support\",\n};\n\nexport const formatClientErrorContext: ClientErrorContextFormatter = (\n\tcontext,\n) => {\n\tlet clientName: string | undefined;\n\tlet clientId: string | undefined;\n\tlet operationName: string | undefined;\n\tfor (const frame of context) {\n\t\tconst frameClientName =\n\t\t\tframe.attributes[SpanSharedAttributeName.ClientName];\n\t\tconst frameClientId = frame.attributes[SpanSharedAttributeName.ClientId];\n\t\tconst frameOperationName =\n\t\t\tframe.attributes[SpanSharedAttributeName.OperationName];\n\t\tif (typeof frameClientName === \"string\") {\n\t\t\tclientName = frameClientName;\n\t\t}\n\t\tif (typeof frameClientId === \"string\") {\n\t\t\tclientId = frameClientId;\n\t\t}\n\t\tif (typeof frameOperationName === \"string\") {\n\t\t\toperationName = frameOperationName;\n\t\t}\n\t}\n\tconst contextLabel = [clientName ?? clientId, operationName]\n\t\t.filter((value): value is string => Boolean(value))\n\t\t.join(\" · \");\n\treturn contextLabel || undefined;\n};\n\nexport function readErrorPresentationDescriptor(\n\terror: unknown,\n\toptions: ReadErrorPresentationDescriptorOptions = {},\n): ErrorPresentationDescriptor {\n\tif (!(error instanceof ClientError)) {\n\t\treturn {\n\t\t\tcode: null,\n\t\t\ttitle: options.fallbackTitle ?? \"Operation failed\",\n\t\t\tdescription:\n\t\t\t\toptions.fallbackDescription ??\n\t\t\t\t\"An unexpected error prevented the operation from completing.\",\n\t\t\trecovery: UserRecoveryValue.None,\n\t\t\ttone: ErrorPresentationTone.Danger,\n\t\t\tprimaryAction: null,\n\t\t};\n\t}\n\tconst clientError = error;\n\n\tconst code = clientError.presentation?.code ?? clientError.code;\n\tconst codePresentation = code ? options.codePresentations?.[code] : undefined;\n\tconst recovery =\n\t\tclientError.presentation?.recovery ??\n\t\tcodePresentation?.recovery ??\n\t\tclientError.recovery;\n\tconst generic = readGenericPresentation(clientError.kind);\n\n\tconst descriptor: ErrorPresentationDescriptor = {\n\t\tcode,\n\t\ttitle: codePresentation?.title ?? generic.title,\n\t\tdescription:\n\t\t\tclientError.presentation?.message ??\n\t\t\tcodePresentation?.description ??\n\t\t\tgeneric.description,\n\t\trecovery,\n\t\ttone:\n\t\t\tcodePresentation?.tone ?? readClientErrorTone(clientError.kind, recovery),\n\t\tprimaryAction: readPrimaryAction(recovery, options),\n\t};\n\tif (!clientError.spanContext || options.contextFormatter === null) {\n\t\treturn descriptor;\n\t}\n\tconst contextLabel = (options.contextFormatter ?? formatClientErrorContext)(\n\t\tclientError.spanContext,\n\t);\n\treturn contextLabel\n\t\t? { ...descriptor, title: `${contextLabel}: ${descriptor.title}` }\n\t\t: descriptor;\n}\n\nfunction readGenericPresentation(kind: ClientErrorKind | null): {\n\ttitle: string;\n\tdescription: string;\n} {\n\tswitch (kind) {\n\t\tcase ClientErrorKindValue.Unauthenticated:\n\t\t\treturn {\n\t\t\t\ttitle: \"Authentication required\",\n\t\t\t\tdescription: \"Sign in again to continue.\",\n\t\t\t};\n\t\tcase ClientErrorKindValue.Unauthorized:\n\t\t\treturn {\n\t\t\t\ttitle: \"Access denied\",\n\t\t\t\tdescription: \"You do not have permission to complete this operation.\",\n\t\t\t};\n\t\tcase ClientErrorKindValue.Cancelled:\n\t\t\treturn {\n\t\t\t\ttitle: \"Operation cancelled\",\n\t\t\t\tdescription: \"The operation was cancelled before it completed.\",\n\t\t\t};\n\t\tcase ClientErrorKindValue.Timeout:\n\t\t\treturn {\n\t\t\t\ttitle: \"Request timed out\",\n\t\t\t\tdescription: \"The operation did not complete in time.\",\n\t\t\t};\n\t\tcase ClientErrorKindValue.Configuration:\n\t\t\treturn {\n\t\t\t\ttitle: \"Configuration error\",\n\t\t\t\tdescription: \"The client is not configured to complete this operation.\",\n\t\t\t};\n\t\tcase ClientErrorKindValue.Storage:\n\t\t\treturn {\n\t\t\t\ttitle: \"Storage failed\",\n\t\t\t\tdescription: \"The client could not access required stored data.\",\n\t\t\t};\n\t\tcase ClientErrorKindValue.Transport:\n\t\t\treturn {\n\t\t\t\ttitle: \"Network request failed\",\n\t\t\t\tdescription: \"The client could not reach the service.\",\n\t\t\t};\n\t\tcase ClientErrorKindValue.Server:\n\t\t\treturn {\n\t\t\t\ttitle: \"Server request failed\",\n\t\t\t\tdescription: \"The service could not complete the request.\",\n\t\t\t};\n\t\tcase ClientErrorKindValue.Protocol:\n\t\t\treturn {\n\t\t\t\ttitle: \"Invalid response\",\n\t\t\t\tdescription:\n\t\t\t\t\t\"The service response did not satisfy the expected protocol.\",\n\t\t\t};\n\t\tcase ClientErrorKindValue.Authorization:\n\t\t\treturn {\n\t\t\t\ttitle: \"Authorization failed\",\n\t\t\t\tdescription: \"The authorization flow could not be completed.\",\n\t\t\t};\n\t\tdefault:\n\t\t\treturn {\n\t\t\t\ttitle: \"Operation failed\",\n\t\t\t\tdescription: \"The operation could not be completed.\",\n\t\t\t};\n\t}\n}\n\nfunction readClientErrorTone(\n\tkind: ClientErrorKind | null,\n\trecovery: UserRecovery,\n) {\n\tif (kind === ClientErrorKindValue.Cancelled) {\n\t\treturn ErrorPresentationTone.Neutral;\n\t}\n\tif (\n\t\tkind === ClientErrorKindValue.Unauthenticated ||\n\t\tkind === ClientErrorKindValue.Timeout ||\n\t\tkind === ClientErrorKindValue.Transport ||\n\t\tkind === ClientErrorKindValue.Server ||\n\t\trecovery === UserRecoveryValue.Retry ||\n\t\trecovery === UserRecoveryValue.RestartFlow ||\n\t\trecovery === UserRecoveryValue.Reauthenticate\n\t) {\n\t\treturn ErrorPresentationTone.Warning;\n\t}\n\treturn ErrorPresentationTone.Danger;\n}\n\nfunction readPrimaryAction(\n\trecovery: UserRecovery,\n\toptions: ReadErrorPresentationDescriptorOptions,\n): ErrorRecoveryActionDescriptor | null {\n\tif (recovery === UserRecoveryValue.None) {\n\t\treturn null;\n\t}\n\tconst label =\n\t\toptions.recoveryLabels?.[recovery] ?? DEFAULT_RECOVERY_LABELS[recovery];\n\tif (!label) {\n\t\treturn null;\n\t}\n\treturn {\n\t\trecovery,\n\t\tlabel,\n\t\thref: options.recoveryLinks?.[recovery] ?? null,\n\t};\n}\n","import { SYMBOL_OBSERVABLE } from \"../compat\";\nimport { RxStateSignal } from \"../rx/signal\";\nimport {\n\ttype ReadableSignalTrait,\n\ttype SignalOptions,\n\ttype WritableSignalTrait,\n} from \"./types\";\n\n/**\n * Minimal writable signal implementation.\n * `set()` always publishes a write. Equality-based value-version suppression is\n * handled by the underlying Rx signal for computed dependency validation.\n */\nexport function createSignal<T>(\n\tinitial: T,\n\toptions?: SignalOptions<T>,\n): WritableSignalTrait<T> {\n\treturn RxStateSignal.fromInitialValue(initial, options);\n}\n\n/**\n * Create a read-only view of a writable signal.\n */\nexport function readonlySignal<T>(\n\tsignal: WritableSignalTrait<T>,\n): ReadableSignalTrait<T> {\n\treturn signal;\n}\n\nexport function isSignalTrait<T>(obj: unknown): obj is ReadableSignalTrait<T> {\n\treturn (\n\t\ttypeof obj === \"object\" &&\n\t\tobj !== null &&\n\t\ttypeof (obj as ReadableSignalTrait<T>).equals === \"function\" &&\n\t\ttypeof (obj as ReadableSignalTrait<T>).get === \"function\" &&\n\t\ttypeof (obj as ReadableSignalTrait<T>).watchStream === \"function\" &&\n\t\ttypeof (obj as ReadableSignalTrait<T>)[SYMBOL_OBSERVABLE] === \"function\"\n\t);\n}\n","export const PopupErrorCode = {\n\tBlocked: \"popup.blocked\",\n\tClosed: \"popup.closed_by_user\",\n} as const;\n\nexport type PopupErrorCode =\n\t(typeof PopupErrorCode)[keyof typeof PopupErrorCode];\n\nexport function readPopupErrorPresentationDescriptor(\n\terror: unknown,\n\toptions: ReadErrorPresentationDescriptorOptions = {},\n): ErrorPresentationDescriptor {\n\treturn readErrorPresentationDescriptor(error, {\n\t\t...options,\n\t\tcodePresentations: {\n\t\t\t[PopupErrorCode.Blocked]: {\n\t\t\t\ttitle: \"Popup was blocked\",\n\t\t\t\tdescription:\n\t\t\t\t\t\"The browser blocked the popup window. Allow popups for this site, then try again.\",\n\t\t\t\trecovery: UserRecovery.Retry,\n\t\t\t\ttone: ErrorPresentationTone.Warning,\n\t\t\t},\n\t\t\t[PopupErrorCode.Closed]: {\n\t\t\t\ttitle: \"Popup was closed\",\n\t\t\t\tdescription:\n\t\t\t\t\t\"The popup window was closed before the operation completed. Start the flow again.\",\n\t\t\t\trecovery: UserRecovery.RestartFlow,\n\t\t\t\ttone: ErrorPresentationTone.Warning,\n\t\t\t},\n\t\t\t...options.codePresentations,\n\t\t},\n\t});\n}\n\nimport {\n\ttype ErrorPresentationDescriptor,\n\tErrorPresentationTone,\n\ttype ReadErrorPresentationDescriptorOptions,\n\treadErrorPresentationDescriptor,\n\tUserRecovery,\n} from \"../errors\";\n","import { type as defineType } from \"arktype\";\nimport { type DisposableTrait } from \"../../compat\";\nimport { type EventStreamTrait } from \"../../events\";\nimport { type TimeTrait } from \"../../scheduling/types\";\n\nexport const JsonRpcIdSchema = defineType(\"string | number\");\n\nexport type JsonRpcId = typeof JsonRpcIdSchema.infer;\n\nexport const JsonRpcErrorPayloadSchema = defineType({\n\tcode: \"number\",\n\tmessage: \"string\",\n\tdata: \"unknown?\",\n});\n\nexport type JsonRpcErrorPayload = typeof JsonRpcErrorPayloadSchema.infer;\n\nexport const JsonRpcRequestMessageSchema = defineType({\n\tjsonrpc: '\"2.0\"',\n\tid: JsonRpcIdSchema,\n\tmethod: \"string\",\n\tparams: \"unknown?\",\n});\n\nexport type JsonRpcRequestMessage = typeof JsonRpcRequestMessageSchema.infer;\n\nexport const JsonRpcNotificationMessageSchema = defineType({\n\tjsonrpc: '\"2.0\"',\n\tmethod: \"string\",\n\tparams: \"unknown?\",\n});\n\nexport type JsonRpcNotificationMessage =\n\ttypeof JsonRpcNotificationMessageSchema.infer;\n\nexport const JsonRpcSuccessResponseMessageSchema = defineType({\n\tjsonrpc: '\"2.0\"',\n\tid: JsonRpcIdSchema,\n\tresult: \"unknown\",\n});\n\nexport type JsonRpcSuccessResponseMessage =\n\ttypeof JsonRpcSuccessResponseMessageSchema.infer;\n\nexport const JsonRpcErrorResponseMessageSchema = defineType({\n\tjsonrpc: '\"2.0\"',\n\tid: JsonRpcIdSchema,\n\terror: JsonRpcErrorPayloadSchema,\n});\n\nexport type JsonRpcErrorResponseMessage =\n\ttypeof JsonRpcErrorResponseMessageSchema.infer;\n\nexport const JsonRpcMessageSchema = JsonRpcRequestMessageSchema.or(\n\tJsonRpcNotificationMessageSchema,\n)\n\t.or(JsonRpcSuccessResponseMessageSchema)\n\t.or(JsonRpcErrorResponseMessageSchema);\n\nexport type JsonRpcMessage = typeof JsonRpcMessageSchema.infer;\n\nexport interface JsonRpcRequestEvent {\n\tid: JsonRpcId;\n\tmethod: string;\n\tparams?: unknown;\n}\n\nexport interface JsonRpcNotificationEvent {\n\tmethod: string;\n\tparams?: unknown;\n}\n\nexport interface JsonRpcRequestOptions {\n\ttimeoutMs?: number;\n}\n\nexport interface JsonRpcSendOptions {\n\tsend(message: JsonRpcMessage): void;\n}\n\nexport interface CreateJsonRpcClientOptions extends JsonRpcSendOptions {\n\ttime: TimeTrait;\n\tdefaultRequestTimeoutMs?: number;\n}\n\nexport interface CreateJsonRpcServerOptions extends JsonRpcSendOptions {}\n\nexport interface CreateJsonRpcServerAndClientOptions\n\textends JsonRpcSendOptions {\n\ttime: TimeTrait;\n\tdefaultRequestTimeoutMs?: number;\n}\n\nexport interface JsonRpcClientTrait extends DisposableTrait {\n\treadonly onNotification: EventStreamTrait<JsonRpcNotificationEvent>;\n\trequest<TResult = unknown>(\n\t\tmethod: string,\n\t\tparams?: unknown,\n\t\toptions?: JsonRpcRequestOptions,\n\t): Promise<TResult>;\n\tnotify(method: string, params?: unknown): void;\n\treceive(message: unknown): void;\n\trejectAllPendingRequests(reason: unknown): void;\n}\n\nexport interface JsonRpcServerTrait extends DisposableTrait {\n\treadonly onRequest: EventStreamTrait<JsonRpcRequestEvent>;\n\treadonly onNotification: EventStreamTrait<JsonRpcNotificationEvent>;\n\tnotify(method: string, params?: unknown): void;\n\treceive(message: unknown): void;\n\trespondSuccess(id: JsonRpcId, result: unknown): void;\n\trespondError(id: JsonRpcId, error: JsonRpcErrorPayload): void;\n}\n\nexport interface JsonRpcServerAndClientTrait\n\textends JsonRpcClientTrait,\n\t\tJsonRpcServerTrait {}\n","import { SYMBOL_DISPOSE } from \"../../compat\";\nimport { type EventStreamTrait } from \"../../events\";\nimport { RxEventSubject } from \"../../rx/event\";\nimport { validateWithSchemaSync } from \"../../validation\";\nimport {\n\ttype CreateJsonRpcClientOptions,\n\ttype CreateJsonRpcServerAndClientOptions,\n\ttype CreateJsonRpcServerOptions,\n\ttype JsonRpcClientTrait,\n\ttype JsonRpcErrorPayload,\n\ttype JsonRpcErrorResponseMessage,\n\ttype JsonRpcId,\n\ttype JsonRpcMessage,\n\tJsonRpcMessageSchema,\n\ttype JsonRpcNotificationEvent,\n\ttype JsonRpcNotificationMessage,\n\ttype JsonRpcRequestEvent,\n\ttype JsonRpcRequestMessage,\n\ttype JsonRpcRequestOptions,\n\ttype JsonRpcServerAndClientTrait,\n\ttype JsonRpcServerTrait,\n\ttype JsonRpcSuccessResponseMessage,\n} from \"./types\";\n\ntype JsonRpcResponseMessage =\n\t| JsonRpcSuccessResponseMessage\n\t| JsonRpcErrorResponseMessage;\n\ninterface PendingRequest {\n\tmethod: string;\n\treject(reason: unknown): void;\n\tresolve(value: unknown): void;\n\ttimeoutHandle?: unknown;\n}\n\nexport function createJsonRpcClient(\n\toptions: CreateJsonRpcClientOptions,\n): JsonRpcClientTrait {\n\treturn new JsonRpcClient(options);\n}\n\nexport function createJsonRpcServer(\n\toptions: CreateJsonRpcServerOptions,\n): JsonRpcServerTrait {\n\treturn new JsonRpcServer(options);\n}\n\nexport function createJsonRpcServerAndClient(\n\toptions: CreateJsonRpcServerAndClientOptions,\n): JsonRpcServerAndClientTrait {\n\treturn new JsonRpcServerAndClient(options);\n}\n\nclass JsonRpcClient implements JsonRpcClientTrait {\n\treadonly onNotification: EventStreamTrait<JsonRpcNotificationEvent>;\n\n\tprivate readonly notificationSubject =\n\t\tnew RxEventSubject<JsonRpcNotificationEvent>();\n\tprivate readonly pendingRequests = new Map<JsonRpcId, PendingRequest>();\n\tprivate disposed = false;\n\tprivate nextRequestId = 1;\n\n\tconstructor(private readonly options: CreateJsonRpcClientOptions) {\n\t\tthis.onNotification = this.notificationSubject;\n\t}\n\n\trequest<TResult = unknown>(\n\t\tmethod: string,\n\t\tparams?: unknown,\n\t\trequestOptions: JsonRpcRequestOptions = {},\n\t): Promise<TResult> {\n\t\tif (this.disposed) {\n\t\t\treturn Promise.reject(createJsonRpcDisposedError(\"client\"));\n\t\t}\n\n\t\tconst id = this.nextRequestId++;\n\t\tconst timeoutMs =\n\t\t\trequestOptions.timeoutMs ?? this.options.defaultRequestTimeoutMs;\n\n\t\treturn new Promise<TResult>((resolve, reject) => {\n\t\t\tconst pendingRequest: PendingRequest = {\n\t\t\t\tmethod,\n\t\t\t\treject,\n\t\t\t\tresolve,\n\t\t\t};\n\n\t\t\tif (timeoutMs !== undefined) {\n\t\t\t\tpendingRequest.timeoutHandle = this.options.time.setTimeout(() => {\n\t\t\t\t\tthis.pendingRequests.delete(id);\n\t\t\t\t\treject(new Error(`JSON-RPC request timed out for ${method}.`));\n\t\t\t\t}, timeoutMs);\n\t\t\t}\n\n\t\t\tthis.pendingRequests.set(id, pendingRequest);\n\n\t\t\ttry {\n\t\t\t\tthis.options.send({\n\t\t\t\t\tjsonrpc: \"2.0\",\n\t\t\t\t\tid,\n\t\t\t\t\tmethod,\n\t\t\t\t\tparams,\n\t\t\t\t} satisfies JsonRpcRequestMessage);\n\t\t\t} catch (error) {\n\t\t\t\tthis.clearPendingRequest(id);\n\t\t\t\treject(error);\n\t\t\t}\n\t\t});\n\t}\n\n\tnotify(method: string, params?: unknown): void {\n\t\tif (this.disposed) {\n\t\t\treturn;\n\t\t}\n\t\tthis.options.send({\n\t\t\tjsonrpc: \"2.0\",\n\t\t\tmethod,\n\t\t\tparams,\n\t\t} satisfies JsonRpcNotificationMessage);\n\t}\n\n\treceive(message: unknown): void {\n\t\tif (this.disposed) {\n\t\t\treturn;\n\t\t}\n\n\t\tfor (const parsedMessage of parseIncomingMessages(message)) {\n\t\t\tif (isJsonRpcResponseMessage(parsedMessage)) {\n\t\t\t\tthis.resolvePendingRequest(parsedMessage);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (isJsonRpcNotificationMessage(parsedMessage)) {\n\t\t\t\tthis.notificationSubject.next({\n\t\t\t\t\tmethod: parsedMessage.method,\n\t\t\t\t\tparams: parsedMessage.params,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\trejectAllPendingRequests(reason: unknown): void {\n\t\tfor (const [id, pendingRequest] of this.pendingRequests) {\n\t\t\tthis.clearPendingRequest(id);\n\t\t\tpendingRequest.reject(reason);\n\t\t}\n\t}\n\n\tdispose(): void {\n\t\tif (this.disposed) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.disposed = true;\n\t\tthis.rejectAllPendingRequests(new Error(\"JSON-RPC client disposed.\"));\n\t\tthis.notificationSubject.complete();\n\t}\n\n\t[SYMBOL_DISPOSE](): void {\n\t\tthis.dispose();\n\t}\n\n\tprivate resolvePendingRequest(message: JsonRpcResponseMessage): void {\n\t\tconst pendingRequest = this.pendingRequests.get(message.id);\n\t\tif (!pendingRequest) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.clearPendingRequest(message.id);\n\n\t\tif (\"error\" in message) {\n\t\t\tpendingRequest.reject(\n\t\t\t\tnew Error(\n\t\t\t\t\t`JSON-RPC request failed for ${pendingRequest.method}: ${message.error.message}`,\n\t\t\t\t),\n\t\t\t);\n\t\t\treturn;\n\t\t}\n\n\t\tpendingRequest.resolve(message.result);\n\t}\n\n\tprivate clearPendingRequest(id: JsonRpcId): void {\n\t\tconst pendingRequest = this.pendingRequests.get(id);\n\t\tif (!pendingRequest) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (pendingRequest.timeoutHandle !== undefined) {\n\t\t\tthis.options.time.clearTimeout(pendingRequest.timeoutHandle);\n\t\t}\n\n\t\tthis.pendingRequests.delete(id);\n\t}\n}\n\nclass JsonRpcServer implements JsonRpcServerTrait {\n\treadonly onRequest: EventStreamTrait<JsonRpcRequestEvent>;\n\treadonly onNotification: EventStreamTrait<JsonRpcNotificationEvent>;\n\n\tprivate readonly requestSubject = new RxEventSubject<JsonRpcRequestEvent>();\n\tprivate readonly notificationSubject =\n\t\tnew RxEventSubject<JsonRpcNotificationEvent>();\n\tprivate disposed = false;\n\n\tconstructor(private readonly options: CreateJsonRpcServerOptions) {\n\t\tthis.onRequest = this.requestSubject;\n\t\tthis.onNotification = this.notificationSubject;\n\t}\n\n\tnotify(method: string, params?: unknown): void {\n\t\tif (this.disposed) {\n\t\t\treturn;\n\t\t}\n\t\tthis.options.send({\n\t\t\tjsonrpc: \"2.0\",\n\t\t\tmethod,\n\t\t\tparams,\n\t\t} satisfies JsonRpcNotificationMessage);\n\t}\n\n\treceive(message: unknown): void {\n\t\tif (this.disposed) {\n\t\t\treturn;\n\t\t}\n\n\t\tfor (const parsedMessage of parseIncomingMessages(message)) {\n\t\t\tif (isJsonRpcRequestMessage(parsedMessage)) {\n\t\t\t\tthis.requestSubject.next({\n\t\t\t\t\tid: parsedMessage.id,\n\t\t\t\t\tmethod: parsedMessage.method,\n\t\t\t\t\tparams: parsedMessage.params,\n\t\t\t\t});\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (isJsonRpcNotificationMessage(parsedMessage)) {\n\t\t\t\tthis.notificationSubject.next({\n\t\t\t\t\tmethod: parsedMessage.method,\n\t\t\t\t\tparams: parsedMessage.params,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n\n\trespondSuccess(id: JsonRpcId, result: unknown): void {\n\t\tif (this.disposed) {\n\t\t\treturn;\n\t\t}\n\t\tthis.options.send({\n\t\t\tjsonrpc: \"2.0\",\n\t\t\tid,\n\t\t\tresult,\n\t\t} satisfies JsonRpcSuccessResponseMessage);\n\t}\n\n\trespondError(id: JsonRpcId, error: JsonRpcErrorPayload): void {\n\t\tif (this.disposed) {\n\t\t\treturn;\n\t\t}\n\t\tthis.options.send({\n\t\t\tjsonrpc: \"2.0\",\n\t\t\tid,\n\t\t\terror,\n\t\t} satisfies JsonRpcErrorResponseMessage);\n\t}\n\n\tdispose(): void {\n\t\tif (this.disposed) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.disposed = true;\n\t\tthis.requestSubject.complete();\n\t\tthis.notificationSubject.complete();\n\t}\n\n\t[SYMBOL_DISPOSE](): void {\n\t\tthis.dispose();\n\t}\n}\n\nclass JsonRpcServerAndClient implements JsonRpcServerAndClientTrait {\n\treadonly onNotification: EventStreamTrait<JsonRpcNotificationEvent>;\n\treadonly onRequest: EventStreamTrait<JsonRpcRequestEvent>;\n\n\tprivate readonly client: JsonRpcClient;\n\tprivate readonly server: JsonRpcServer;\n\tprivate disposed = false;\n\n\tconstructor(options: CreateJsonRpcServerAndClientOptions) {\n\t\tthis.client = new JsonRpcClient(options);\n\t\tthis.server = new JsonRpcServer(options);\n\t\tthis.onNotification = this.server.onNotification;\n\t\tthis.onRequest = this.server.onRequest;\n\t}\n\n\trequest<TResult = unknown>(\n\t\tmethod: string,\n\t\tparams?: unknown,\n\t\toptions?: JsonRpcRequestOptions,\n\t): Promise<TResult> {\n\t\treturn this.client.request<TResult>(method, params, options);\n\t}\n\n\tnotify(method: string, params?: unknown): void {\n\t\tthis.client.notify(method, params);\n\t}\n\n\treceive(message: unknown): void {\n\t\tfor (const parsedMessage of parseIncomingMessages(message)) {\n\t\t\tif (isJsonRpcResponseMessage(parsedMessage)) {\n\t\t\t\tthis.client.receive(parsedMessage);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tthis.server.receive(parsedMessage);\n\t\t}\n\t}\n\n\trejectAllPendingRequests(reason: unknown): void {\n\t\tthis.client.rejectAllPendingRequests(reason);\n\t}\n\n\trespondSuccess(id: JsonRpcId, result: unknown): void {\n\t\tthis.server.respondSuccess(id, result);\n\t}\n\n\trespondError(id: JsonRpcId, error: JsonRpcErrorPayload): void {\n\t\tthis.server.respondError(id, error);\n\t}\n\n\tdispose(): void {\n\t\tif (this.disposed) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.disposed = true;\n\t\tthis.client.dispose();\n\t\tthis.server.dispose();\n\t}\n\n\t[SYMBOL_DISPOSE](): void {\n\t\tthis.dispose();\n\t}\n}\n\nfunction parseIncomingMessages(message: unknown): JsonRpcMessage[] {\n\tif (!Array.isArray(message)) {\n\t\treturn parseJsonRpcMessage(message);\n\t}\n\n\tconst parsedMessages: JsonRpcMessage[] = [];\n\tfor (const entry of message) {\n\t\tparsedMessages.push(...parseJsonRpcMessage(entry));\n\t}\n\treturn parsedMessages;\n}\n\nfunction parseJsonRpcMessage(message: unknown): JsonRpcMessage[] {\n\tconst result = validateWithSchemaSync(JsonRpcMessageSchema, message);\n\treturn result.success ? [result.value] : [];\n}\n\nfunction isJsonRpcRequestMessage(\n\tmessage: JsonRpcMessage,\n): message is JsonRpcRequestMessage {\n\treturn \"method\" in message && \"id\" in message;\n}\n\nfunction isJsonRpcResponseMessage(\n\tmessage: JsonRpcMessage,\n): message is JsonRpcResponseMessage {\n\treturn \"id\" in message && !(\"method\" in message);\n}\n\nfunction isJsonRpcNotificationMessage(\n\tmessage: JsonRpcMessage,\n): message is JsonRpcNotificationMessage {\n\treturn \"method\" in message && !(\"id\" in message);\n}\n\nfunction createJsonRpcDisposedError(role: \"client\" | \"server\"): Error {\n\treturn new Error(`JSON-RPC ${role} disposed.`);\n}\n","import {\n\tBehaviorSubject,\n\tcatchError,\n\tdelayWhen,\n\tdistinctUntilChanged,\n\texhaustMap,\n\tfilter,\n\tfrom,\n\tmap,\n\tmerge,\n\tof,\n\tReplaySubject,\n\tSubject,\n\tshareReplay,\n\ttake,\n\ttakeUntil,\n\ttimeout,\n\ttimer,\n} from \"rxjs\";\nimport { SYMBOL_DISPOSE } from \"../compat\";\nimport { ClientError, ClientErrorKind, UserRecovery } from \"../errors\";\nimport { type EventStreamTrait } from \"../events\";\nimport {\n\ttype JsonRpcClientTrait,\n\ttype JsonRpcNotificationEvent,\n\ttype JsonRpcServerTrait,\n} from \"../protocol/json-rpc\";\nimport { createAsyncSchedulerWithTimestampProvider } from \"../rx\";\nimport { type TimeTrait } from \"../scheduling/types\";\nimport { createSignal } from \"../signals\";\nimport { PopupErrorCode } from \"./errors\";\n\nexport const PopupSessionControlMethod = {\n\tReady: \"securitydept.popup.session.ready\",\n\tPing: \"securitydept.popup.session.ping\",\n\tPong: \"securitydept.popup.session.pong\",\n} as const;\n\nconst DEFAULT_READY_TIMEOUT_MS = 10_000;\nconst DEFAULT_HEARTBEAT_INTERVAL_MS = 5_000;\nconst DEFAULT_HEARTBEAT_TIMEOUT_MS = 15_000;\n\nexport interface CreatePopupClientSessionOptions {\n\tjsonRpc: JsonRpcClientTrait;\n\ttime: TimeTrait;\n\tclosedStream: EventStreamTrait<boolean>;\n\treadyTimeoutMs?: number;\n\theartbeatIntervalMs?: number;\n\theartbeatTimeoutMs?: number;\n}\n\nexport interface CreatePopupServerSessionOptions {\n\tjsonRpc: JsonRpcServerTrait;\n}\n\nexport class PopupClientSession {\n\treadonly failure = createSignal<ClientError | null>(null);\n\treadonly isActive = createSignal(false);\n\n\tprivate readonly init$ = new ReplaySubject<true>();\n\tprivate readonly destroyed = createSignal<boolean>(false);\n\tprivate readonly destroyed$ = from(this.destroyed).pipe(\n\t\tdistinctUntilChanged(),\n\t\tfilter(Boolean),\n\t\tshareReplay(1),\n\t);\n\n\tconstructor(options: CreatePopupClientSessionOptions) {\n\t\tconst timestampScheduler = createAsyncSchedulerWithTimestampProvider(\n\t\t\toptions.time,\n\t\t);\n\t\tconst ready$ = new Subject<boolean>();\n\t\tconst pong$ = new Subject<boolean>();\n\t\tconst closed$ = from(options.closedStream).pipe(filter(Boolean));\n\n\t\tconst ping$ = merge(\n\t\t\tready$.pipe(filter(Boolean)),\n\t\t\tpong$.pipe(filter(Boolean)),\n\t\t).pipe(\n\t\t\tdelayWhen(() =>\n\t\t\t\ttimer(\n\t\t\t\t\toptions.heartbeatIntervalMs ?? DEFAULT_HEARTBEAT_INTERVAL_MS,\n\t\t\t\t\ttimestampScheduler,\n\t\t\t\t),\n\t\t\t),\n\t\t);\n\n\t\tfrom(this.init$)\n\t\t\t.pipe(\n\t\t\t\texhaustMap(() =>\n\t\t\t\t\tfrom(options.jsonRpc.onNotification).pipe(\n\t\t\t\t\t\tfilter(function isReadyNotification(event): event is {\n\t\t\t\t\t\t\tmethod: typeof PopupSessionControlMethod.Ready;\n\t\t\t\t\t\t} {\n\t\t\t\t\t\t\treturn event.method === PopupSessionControlMethod.Ready;\n\t\t\t\t\t\t}),\n\t\t\t\t\t\ttake(1),\n\t\t\t\t\t\ttimeout({\n\t\t\t\t\t\t\teach: options.readyTimeoutMs ?? DEFAULT_READY_TIMEOUT_MS,\n\t\t\t\t\t\t\tscheduler: timestampScheduler,\n\t\t\t\t\t\t}),\n\t\t\t\t\t\tmap(() => true),\n\t\t\t\t\t\tcatchError(() => of(false)),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\ttakeUntil(this.destroyed$),\n\t\t\t)\n\t\t\t.subscribe(ready$);\n\n\t\tping$\n\t\t\t.pipe(\n\t\t\t\texhaustMap(() =>\n\t\t\t\t\tfrom(options.jsonRpc.onNotification).pipe(\n\t\t\t\t\t\tfilter(function isPongNotification(event): event is {\n\t\t\t\t\t\t\tmethod: typeof PopupSessionControlMethod.Pong;\n\t\t\t\t\t\t} {\n\t\t\t\t\t\t\treturn event.method === PopupSessionControlMethod.Pong;\n\t\t\t\t\t\t}),\n\t\t\t\t\t\ttake(1),\n\t\t\t\t\t\ttimeout({\n\t\t\t\t\t\t\tfirst: options.heartbeatTimeoutMs ?? DEFAULT_HEARTBEAT_TIMEOUT_MS,\n\t\t\t\t\t\t\tscheduler: timestampScheduler,\n\t\t\t\t\t\t}),\n\t\t\t\t\t\tmap(() => true),\n\t\t\t\t\t\tcatchError(() => of(false)),\n\t\t\t\t\t),\n\t\t\t\t),\n\t\t\t\ttakeUntil(this.destroyed$),\n\t\t\t)\n\t\t\t.subscribe(pong$);\n\n\t\tmerge(\n\t\t\tclosed$.pipe(\n\t\t\t\tmap(\n\t\t\t\t\t() =>\n\t\t\t\t\t\tnew ClientError({\n\t\t\t\t\t\t\tkind: ClientErrorKind.Authorization,\n\t\t\t\t\t\t\tcode: PopupErrorCode.Closed,\n\t\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t\t\"Popup window was closed before completing the login flow.\",\n\t\t\t\t\t\t\trecovery: UserRecovery.RestartFlow,\n\t\t\t\t\t\t\tsource: \"popup\",\n\t\t\t\t\t\t}),\n\t\t\t\t),\n\t\t\t),\n\t\t\tready$.pipe(\n\t\t\t\tmap((success) =>\n\t\t\t\t\t!success\n\t\t\t\t\t\t? new ClientError({\n\t\t\t\t\t\t\t\tkind: ClientErrorKind.Protocol,\n\t\t\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t\t\t\"Did not receive ready notification from popup within the expected time.\",\n\t\t\t\t\t\t\t\trecovery: UserRecovery.RestartFlow,\n\t\t\t\t\t\t\t\tsource: \"popup\",\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t: null,\n\t\t\t\t),\n\t\t\t),\n\t\t\tpong$.pipe(\n\t\t\t\tmap((success) =>\n\t\t\t\t\t!success\n\t\t\t\t\t\t? new ClientError({\n\t\t\t\t\t\t\t\tkind: ClientErrorKind.Protocol,\n\t\t\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t\t\t\"Did not receive pong notification from popup within the expected time.\",\n\t\t\t\t\t\t\t\trecovery: UserRecovery.RestartFlow,\n\t\t\t\t\t\t\t\tsource: \"popup\",\n\t\t\t\t\t\t\t})\n\t\t\t\t\t\t: null,\n\t\t\t\t),\n\t\t\t),\n\t\t)\n\t\t\t.pipe(\n\t\t\t\ttakeUntil(this.destroyed$),\n\t\t\t\tshareReplay({\n\t\t\t\t\tbufferSize: 1,\n\t\t\t\t\trefCount: false,\n\t\t\t\t}),\n\t\t\t)\n\t\t\t.subscribe((error) => this.failure.set(error));\n\n\t\tmerge(\n\t\t\tclosed$.pipe(map(() => false)),\n\t\t\tready$.pipe(map(Boolean)),\n\t\t\tpong$.pipe(map(Boolean)),\n\t\t)\n\t\t\t.pipe(takeUntil(this.destroyed$))\n\t\t\t.subscribe((nextIsActive) => {\n\t\t\t\tthis.isActive.set(nextIsActive);\n\t\t\t});\n\t}\n\n\tinit(): void {\n\t\tthis.init$.next(true);\n\t}\n\n\tdispose(): void {\n\t\tthis.destroyed.set(true);\n\t}\n\n\t[SYMBOL_DISPOSE](): void {\n\t\tthis.dispose();\n\t}\n}\n\nexport class PopupServerSession {\n\tprivate readonly init$ = new ReplaySubject<true>();\n\tprivate readonly destroyed$$ = new BehaviorSubject<boolean>(false);\n\tprivate readonly destroyed$ = this.destroyed$$.pipe(\n\t\tdistinctUntilChanged(),\n\t\tfilter(Boolean),\n\t\tshareReplay(1),\n\t);\n\n\tconstructor(options: CreatePopupServerSessionOptions) {\n\t\tconst ready$ = from(this.init$);\n\t\tconst ping$ = from(options.jsonRpc.onNotification).pipe(\n\t\t\tfilter(function isPing(event) {\n\t\t\t\treturn event.method === PopupSessionControlMethod.Ping;\n\t\t\t}),\n\t\t);\n\t\tconst pong$ = ping$;\n\n\t\tmerge(\n\t\t\tready$.pipe(\n\t\t\t\tmap(function createReadyNotify(): JsonRpcNotificationEvent {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tmethod: PopupSessionControlMethod.Ready,\n\t\t\t\t\t};\n\t\t\t\t}),\n\t\t\t),\n\t\t\tpong$.pipe(\n\t\t\t\tmap(function createPongNotify(): JsonRpcNotificationEvent {\n\t\t\t\t\treturn {\n\t\t\t\t\t\tmethod: PopupSessionControlMethod.Pong,\n\t\t\t\t\t};\n\t\t\t\t}),\n\t\t\t),\n\t\t)\n\t\t\t.pipe(takeUntil(this.destroyed$))\n\t\t\t.subscribe((event) => {\n\t\t\t\toptions.jsonRpc.notify(event.method, event.params);\n\t\t\t});\n\t}\n\n\tinit(): void {\n\t\tthis.init$.next(true);\n\t}\n\n\tdispose(): void {\n\t\tthis.destroyed$$.next(true);\n\t}\n\n\t[SYMBOL_DISPOSE](): void {\n\t\tthis.dispose();\n\t}\n}\n","import { type DisposableTrait, SYMBOL_DISPOSE } from \"../compat\";\nimport { type ClientError } from \"../errors\";\nimport {\n\ttype EventStreamTrait,\n\ttype EventSubjectTrait,\n\ttype EventSubscriptionTrait,\n} from \"../events\";\nimport {\n\tcreateJsonRpcClient,\n\tcreateJsonRpcServer,\n\ttype JsonRpcClientTrait,\n\ttype JsonRpcMessage,\n\ttype JsonRpcNotificationEvent,\n\ttype JsonRpcRequestEvent,\n\ttype JsonRpcRequestOptions,\n\ttype JsonRpcServerTrait,\n} from \"../protocol/json-rpc\";\nimport { type TimeTrait } from \"../scheduling/types\";\nimport { type ReadableSignalTrait } from \"../signals\";\nimport { PopupClientSession, PopupServerSession } from \"./session\";\n\nexport interface PopupMessageChannelTrait<\n\tTOutgoing = unknown,\n\tTIncoming = unknown,\n> {\n\toutgoing: EventSubjectTrait<TOutgoing>;\n\tincoming: EventStreamTrait<TIncoming>;\n}\n\nexport interface PopupWindowHandleTrait extends DisposableTrait {\n\tmessaging: PopupMessageChannelTrait;\n\treadonly onNotification: EventStreamTrait<JsonRpcNotificationEvent>;\n\tclose(): void;\n\tdispose(): void;\n\tnotify(method: string, params?: unknown): Promise<void>;\n}\n\nexport interface PopupClientWindowHandleTrait extends PopupWindowHandleTrait {\n\treadonly failure: ReadableSignalTrait<ClientError | null>;\n\treadonly isActive: ReadableSignalTrait<boolean>;\n\trequest<TResult = unknown>(\n\t\tmethod: string,\n\t\tparams?: unknown,\n\t\toptions?: JsonRpcRequestOptions,\n\t): Promise<TResult>;\n}\n\nexport interface PopupServerWindowHandleTrait extends PopupWindowHandleTrait {}\n\nexport interface PopupClientWindowHandleOptions {\n\tclose(): void;\n\tmessaging: PopupMessageChannelTrait<JsonRpcMessage, unknown>;\n\ttime: TimeTrait;\n\tclosedStream: EventStreamTrait<boolean>;\n}\n\nexport interface PopupServerWindowHandleOptions {\n\tclose(): void;\n\tmessaging: PopupMessageChannelTrait<JsonRpcMessage, unknown>;\n}\n\n/**\n * popup opener\n */\nexport class PopupClientWindowHandle implements PopupClientWindowHandleTrait {\n\treadonly messaging: PopupMessageChannelTrait<JsonRpcMessage, unknown>;\n\tprivate disposed = false;\n\tprivate readonly jsonRpc: JsonRpcClientTrait;\n\tprivate readonly session: PopupClientSession;\n\tprivate readonly incomingSubscription: EventSubscriptionTrait;\n\tprivate readonly closePopup: () => void;\n\n\tconstructor(options: PopupClientWindowHandleOptions) {\n\t\tthis.messaging = options.messaging;\n\t\tthis.closePopup = options.close;\n\t\tthis.jsonRpc = createJsonRpcClient({\n\t\t\tsend: (message) => {\n\t\t\t\toptions.messaging.outgoing.next(message);\n\t\t\t},\n\t\t\ttime: options.time,\n\t\t});\n\t\tthis.session = new PopupClientSession({\n\t\t\tjsonRpc: this.jsonRpc,\n\t\t\ttime: options.time,\n\t\t\tclosedStream: options.closedStream,\n\t\t});\n\t\tthis.incomingSubscription = options.messaging.incoming.subscribe({\n\t\t\tnext: (message) => {\n\t\t\t\tthis.jsonRpc.receive(message);\n\t\t\t},\n\t\t});\n\t\tthis.session.init();\n\t}\n\n\tget onNotification(): EventStreamTrait<JsonRpcNotificationEvent> {\n\t\treturn this.jsonRpc.onNotification;\n\t}\n\n\tget failure(): ReadableSignalTrait<ClientError | null> {\n\t\treturn this.session.failure;\n\t}\n\n\tget isActive(): ReadableSignalTrait<boolean> {\n\t\treturn this.session.isActive;\n\t}\n\n\tasync notify(method: string, params?: unknown): Promise<void> {\n\t\tthis.jsonRpc.notify(method, params);\n\t}\n\n\trequest<TResult = unknown>(\n\t\tmethod: string,\n\t\tparams?: unknown,\n\t\toptions?: JsonRpcRequestOptions,\n\t): Promise<TResult> {\n\t\treturn this.jsonRpc.request(method, params, options);\n\t}\n\n\tclose(): void {\n\t\tthis.closePopup();\n\t}\n\n\tdispose(): void {\n\t\tif (this.disposed) {\n\t\t\treturn;\n\t\t}\n\t\tthis.disposed = true;\n\t\tthis.session.dispose();\n\t\tthis.jsonRpc.dispose();\n\t\tthis.incomingSubscription.unsubscribe();\n\t\tthis.messaging.outgoing.complete();\n\t}\n\n\t[SYMBOL_DISPOSE](): void {\n\t\tthis.dispose();\n\t}\n}\n\n/**\n * popup target\n */\nexport class PopupServerWindowHandle implements PopupServerWindowHandleTrait {\n\treadonly messaging: PopupMessageChannelTrait<JsonRpcMessage, unknown>;\n\tprivate disposed = false;\n\tprivate readonly jsonRpc: JsonRpcServerTrait;\n\tprivate readonly session: PopupServerSession;\n\tprivate readonly incomingSubscription: EventSubscriptionTrait;\n\tprivate readonly closePopup: () => void;\n\n\tconstructor(options: PopupServerWindowHandleOptions) {\n\t\tthis.messaging = options.messaging;\n\t\tthis.closePopup = options.close;\n\t\tthis.jsonRpc = createJsonRpcServer({\n\t\t\tsend: (message) => {\n\t\t\t\toptions.messaging.outgoing.next(message);\n\t\t\t},\n\t\t});\n\t\tthis.session = new PopupServerSession({ jsonRpc: this.jsonRpc });\n\t\tthis.incomingSubscription = options.messaging.incoming.subscribe({\n\t\t\tnext: (message) => {\n\t\t\t\tthis.jsonRpc.receive(message);\n\t\t\t},\n\t\t});\n\t\tthis.session.init();\n\t}\n\n\tget onNotification(): EventStreamTrait<JsonRpcNotificationEvent> {\n\t\treturn this.jsonRpc.onNotification;\n\t}\n\n\tget onRequest(): EventStreamTrait<JsonRpcRequestEvent> {\n\t\treturn this.jsonRpc.onRequest;\n\t}\n\n\tnotify(method: string, params?: unknown): Promise<void> {\n\t\tthis.jsonRpc.notify(method, params);\n\t\treturn Promise.resolve();\n\t}\n\n\tclose(): void {\n\t\tthis.closePopup();\n\t}\n\n\tdispose(): void {\n\t\tif (this.disposed) {\n\t\t\treturn;\n\t\t}\n\t\tthis.disposed = true;\n\t\tthis.session.dispose();\n\t\tthis.jsonRpc.dispose();\n\t\tthis.incomingSubscription.unsubscribe();\n\t\tthis.messaging.outgoing.complete();\n\t}\n\n\t[SYMBOL_DISPOSE](): void {\n\t\tthis.dispose();\n\t}\n}\n"],"mappings":";;;;;AAAA,MAAa,0BAA0B;CACtC,YAAY;CACZ,UAAU;CACV,eAAe;AAChB;;;ACUA,MAAM,0BAAwD;EAC5DA,aAAkB,OAAO;EACzBA,aAAkB,QAAQ;EAC1BA,aAAkB,cAAc;EAChCA,aAAkB,iBAAiB;EACnCA,aAAkB,iBAAiB;AACrC;AAEA,MAAa,4BACZ,YACI;CACJ,IAAI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KAAK,UACR;EAED,KAAK,WAAW;EAChB,KAAK,QAAQ,QAAQ;EACrB,KAAK,QAAQ,QAAQ;EACrB,KAAK,qBAAqB,YAAY;EACtC,KAAK,UAAU,SAAS,SAAS;CAClC;CAEA,CAAC,kBAAwB;EACxB,KAAK,QAAQ;CACd;AACD;;;;AAKA,IAAa,0BAAb,MAA6E;CAC5E;CACA,WAAmB;CACnB;CACA;CACA;CACA;CAEA,YAAY,SAAyC;EACpD,KAAK,YAAY,QAAQ;EACzB,KAAK,aAAa,QAAQ;EAC1B,KAAK,UAAU,oBAAoB,EAClC,OAAO,YAAY;GAClB,QAAQ,UAAU,SAAS,KAAK,OAAO;EACxC,EACD,CAAC;EACD,KAAK,UAAU,IAAI,mBAAmB,EAAE,SAAS,KAAK,QAAQ,CAAC;EAC/D,KAAK,uBAAuB,QAAQ,UAAU,SAAS,UAAU,EAChE,OAAO,YAAY;GAClB,KAAK,QAAQ,QAAQ,OAAO;EAC7B,EACD,CAAC;EACD,KAAK,QAAQ,KAAK;CACnB;CAEA,IAAI,iBAA6D;EAChE,OAAO,KAAK,QAAQ;CACrB;CAEA,IAAI,YAAmD;EACtD,OAAO,KAAK,QAAQ;CACrB;CAEA,OAAO,QAAgB,QAAiC;EACvD,KAAK,QAAQ,OAAO,QAAQ,MAAM;EAClC,OAAO,QAAQ,QAAQ;CACxB;CAEA,QAAc;EACb,KAAK,WAAW;CACjB;CAEA,UAAgB;EACf,IAAI,KAAK,UACR;EAED,KAAK,WAAW;EAChB,KAAK,QAAQ,QAAQ;EACrB,KAAK,QAAQ,QAAQ;EACrB,KAAK,qBAAqB,YAAY;EACtC,KAAK,UAAU,SAAS,SAAS;CAClC;CAEA,CAAC,kBAAwB;EACxB,KAAK,QAAQ;CACd;AACD"}
@@ -1,4 +1,4 @@
1
- import { B as WritableSignalTrait, C as IdleCallbackTrait, Ct as EventStreamTrait, D as ComputedSignalTrait, Dt as InteropObservableTrait, E as TimestampProviderTrait, F as ResourceSnapshot, Ft as SecuritydeptInjector, L as ResourceTrait, O as ReadableSignalTrait, R as ResourceWhenValueOptions, Rt as DisposableTrait, T as TimeTrait, Vt as SYMBOL_DISPOSE, W as CancellationTokenTrait, X as ClientError, an as SecuritydeptInjectorTrait, gt as SpanNodeAttributes, ht as SpanCreateOptions, in as SecuritydeptInjectionToken, it as ErrorPresentationDescriptor, mt as SpanAttributes, on as SecuritydeptProvider, st as ReadErrorPresentationDescriptorOptions, ut as MutableSpanTrait, v as RxEventSubject, vt as SpanTrait, wt as EventSubjectTrait, yt as EventObserverTrait, z as SignalOptions } from "./index-CFAJ969E.mjs";
1
+ import { B as WritableSignalTrait, C as IdleCallbackTrait, Ct as EventStreamTrait, D as ComputedSignalTrait, Dt as InteropObservableTrait, E as TimestampProviderTrait, F as ResourceSnapshot, Ft as SecuritydeptInjector, L as ResourceTrait, O as ReadableSignalTrait, R as ResourceWhenValueOptions, Rt as DisposableTrait, T as TimeTrait, Vt as SYMBOL_DISPOSE, W as CancellationTokenTrait, X as ClientError, an as SecuritydeptInjectorTrait, gt as SpanNodeAttributes, ht as SpanCreateOptions, in as SecuritydeptInjectionToken, it as ErrorPresentationDescriptor, mt as SpanAttributes, on as SecuritydeptProvider, st as ReadErrorPresentationDescriptorOptions, ut as MutableSpanTrait, v as RxEventSubject, vt as SpanTrait, wt as EventSubjectTrait, yt as EventObserverTrait, z as SignalOptions } from "./index-_1lhMnf9.mjs";
2
2
  import { StandardSchemaV1 } from "@standard-schema/spec";
3
3
  //#region src/injection/destroy.d.ts
4
4
  declare abstract class SecuritydeptDestroyRef implements DisposableTrait {
@@ -1677,4 +1677,4 @@ declare function createTraceTimelineStore(limit?: number): TraceTimelineStore;
1677
1677
  declare function isLoopbackHttpUrl(url: URL): boolean;
1678
1678
  //#endregion
1679
1679
  export { RequirementPlan as $, appendOrReplaceCompatFragment as $n, createJsonRpcServerAndClient as $r, Codec as $t, abortSignalToCancellationToken as A, Base64CompatErrorCode as Ai, ValidationResult as An, readPopupErrorPresentationDescriptor as Ar, SelectCandidate as At, JwtAudienceClaim as B, RouterNavigationMode as Bn, ResourceSnapshotUpdateKind as Br, EnvironmentValidators as Bt, OnceAsyncLockState as C, createEventStream as Ci, CreateAuthorizationInterceptedFetchOptions as Cn, PopupAttachResult as Cr, RequirementResolution as Ct, createJsonCodec as D, PAGE_LIFECYCLE_TRAIT_TOKEN as Di, TraitInputValidator as Dn, CreatePopupClientSessionOptions as Dr, RouteRequirementsDeclaration as Dt, createInMemoryRecordStore as E, abortSignalToEventStream as Ei, createTimeForStd as En, PopupTrait as Er, RouteBehaviourContextExtra as Et, parseDurationToMs as F, validateTraitInput as Fn, PopupServerWindowHandleTrait as Fr, isRouteStateSnapshotTrait as Ft, parseIdentityPrincipalWire as G, AppendOrReplaceCompatFragmentOptions as Gn, ResourceStreamContext as Gr, TracingSubscriberTrait as Gt, IdentityPrincipalSchema as H, RouterTrait as Hn, reduceResourceSnapshot as Hr, ServiceWorkerEnvironment as Ht, JwtDecodeError as I, validateWithSchema as In, PopupWindowHandleTrait as Ir, resolveEffectiveRequirements as It, ProjectIdentityPrincipalOptions as J, CompatFragmentParameters as Jn, ResourceErrorCode as Jr, TRACING_SPAN_ATTRIBUTE_PROVIDER_ID as Jt, projectIdentityPrincipal as K, AppendOrReplaceCompatFragmentResult as Kn, createResource as Kr, OperationSpanTrait as Kt, JwtDecodeErrorCode as L, validateWithSchemaSync as Ln, createSignal as Lr, CreateFoundationEnvironmentOptions as Lt, normalizeAbortError as M, encodeUint8ArrayToBase64 as Mi, WithTraitInputValidator as Mn, PopupClientWindowHandleTrait as Mr, StaticAttrsAuthRequirementInput as Mt, createRootSpan as N, SecuritydeptDestroyRef as Ni, formatValidationFailure as Nn, PopupMessageChannelTrait as Nr, UnauthenticatedAction as Nt, createEphemeralFlowStore as O, PageLifecycleTrait as Oi, ValidateTraitInputOptions as On, CreatePopupServerSessionOptions as Or, RouteStateSnapshotTrait as Ot, SpanSharedAttributeName as P, createSecuritydeptDestroyRef as Pi, throwValidationClientError as Pn, PopupServerWindowHandle as Pr, isRouteBehaviourContextExtra as Pt, BaseRequirementPlanner as Q, UpdateUriFragmentHash as Qn, createJsonRpcServer as Qr, TracingTrait as Qt, decodeJwtPayload as R, ROUTER_TRAIT_TOKEN as Rn, readonlySignal as Rr, createFoundationEnvironment as Rt, OnceAsyncLockRunning as S, createEventReplaySubject as Si, AuthorizationSignal as Sn, PopupAttachFailureReason as Sr, RequirementPlannerError as St, createOnceAsyncLockCallable as T, createNeverEventStream as Ti, TimeForStdCreateOptions as Tn, PopupOpenOptions as Tr, ResolutionStatus as Tt, IdentityPrincipalWireSchema as U, TakeCompatFragmentFromRouterOptions as Un, whenResourceSnapshotValue as Ur, TracingCreateOptions as Ut, JwtClaimsSet as V, RouterNavigationRequest as Vn, flattenResourceSnapshot as Vr, FoundationEnvironment as Vt, parseIdentityPrincipal as W, takeCompatFragmentFromRouter as Wn, CreateResourceOptions as Wr, createTracing as Wt, RouteCompositionRequirementPlanner as X, TakeCompatFragmentOptions as Xn, createComputed as Xr, TracingEvent as Xt, StaticRequirementPlanner as Y, SECURITYDEPT_COMPAT_FRAGMENT_VERSION as Yn, ResourceValueUnavailableErrorOptions as Yr, TRACING_TRAIT_TOKEN as Yt, MergeRequirementPlanner as Z, TakeCompatFragmentResult as Zn, createJsonRpcClient as Zr, TracingLevel as Zt, runOperation as _, toEventStream as _i, HttpResponse as _n, UriReferenceStringSchema as _r, RequirementBehaviour as _t, ConsoleTracingSubscriber as a, JsonRpcErrorResponseMessage as ai, RecoverableStateStore as an, UriReferenceString as ar, RequirementPlannerHostOptions as at, OnceAsyncLockError as b, isClientErrorEvent as bi, TransportErrorCode as bn, POPUP_TRAIT_TOKEN as br, RequirementCandidateGenerator as bt, DefineInstrumentMethodDecoratorFactory as c, JsonRpcNotificationEvent as ci, StorageChangeEventOrigin as cn, UriRelativeParts as cr, provideRequirementPlannerHost as ct, InstrumentMethodThisResolver as d, JsonRpcRequestMessage as di, SyncStorageTrait as dn, UriString as dr, CheckAuthenticated as dt, CreateJsonRpcClientOptions as ei, EphemeralFlowStore as en, isCompatFragmentBlock as er, InjectRequirementPlannerHostOptions as et, defineInstrumentMethodDecorator as f, JsonRpcRequestOptions as fi, BaseTransportForStdFetchCreateOptions as fn, SECURITYDEPT_ROUTE_METADATA_KEY as fr, OnUnauthenticated as ft, RunOperationOptionsBase as g, ToEventStreamInput as gi, HttpRequest as gn, BaseURIStringSchema as gr, PlanStatus as gt, RunOperationOptions as h, JsonRpcSuccessResponseMessage as hi, BaseTransportTrait as hn, writeSecuritydeptRouteMetadata as hr, PipelineStepResult as ht, createTraceTimelineStore as i, JsonRpcErrorPayload as ii, REALM_STORAGE_TRAIT_TOKEN as in, UriParseError as ir, RequirementPlannerHostBehaviour as it, cancellationTokenToAbortSignal as j, decodeBase64ToUint8Array as ji, ValidationSuccess as jn, PopupClientWindowHandle as jr, StaticAttrsAuthRequirement as jt, createKeyedEphemeralFlowStore as k, promisesToRacedAsyncGenerator as ki, ValidationFailure as kn, PopupErrorCode as kr, RouteTreeSegment as kt, InstrumentMethodResolvedOptions as l, JsonRpcNotificationMessage as li, StorageTrait as ln, UriRelativeString as lr, AuthRequirement as lt, RunOperationEnvironment as m, JsonRpcServerTrait as mi, createBaseTransportForStdFetch as mn, readSecuritydeptRouteMetadata as mr, PipelineRunResult as mt, TraceTimelineEntry as n, CreateJsonRpcServerOptions as ni, PERSISTENT_STORAGE_TRAIT_TOKEN as nn, takeCompatFragment as nr, REQUIREMENT_PLANNER_HOST as nt, createConsoleTracingSubscriber as o, JsonRpcId as oi, SESSION_STORAGE_TRAIT_TOKEN as on, UriReferenceStringInput as or, defaultSelectCandidate as ot, OperationSpan as p, JsonRpcServerAndClientTrait as pi, FetchTransportRedirectKind as pn, SecuritydeptRouteMetadata as pr, PipelineOutcome as pt, IdentityPrincipal as q, CompatFragment as qn, ResourceError as qr, OperationTraceEventType as qt, TraceTimelineStore as r, JsonRpcClientTrait as ri, PersistentAuthStore as rn, UriFragmentPart as rr, RequirementPlannerHost as rt, DefineInstrumentMethodDecoratorContext as s, JsonRpcMessage as si, StorageChangeEvent as sn, UriReferenceStringLike as sr, injectRequirementPlannerHost as st, isLoopbackHttpUrl as t, CreateJsonRpcServerAndClientOptions as ti, KeyedEphemeralFlowStore as tn, parseCompatFragment as tr, ProvideRequirementPlannerHostOptions as tt, InstrumentMethodThisContext as u, JsonRpcRequestEvent as ui, StoredEnvelope as un, UriSearchParamsInit as ur, AuthenticatedCheck as ut, OnceAsyncLock as v, ClientErrorEvent as vi, HttpResponseJsonBody as vn, UriRelativeStringSchema as vr, RequirementBehaviourContext as vt, OnceAsyncLockSuccess as w, createEventSubject as wi, createAuthorizationInterceptedFetch as wn, PopupAttachSuccess as wr, RequirementsComposition as wt, OnceAsyncLockInit as x, createEmptyEventStream as xi, AuthorizationInterceptedFetchPredicate as xn, PopupAttachFailure as xr, RequirementCandidateSelectionContext as xt, OnceAsyncLockCallable as y, ExtractClientErrorEvent as yi, TRANSPORT_TRAIT_TOKEN as yn, UriStringSchema as yr, RequirementBehaviourWithRouteContext as yt, DecodeJwtPayloadOptions as z, RouterNavigationIntent as zn, ResourceSnapshotUpdate as zr, ENVIRONMENT_TOKEN as zt };
1680
- //# sourceMappingURL=index-CbeZ3AfB.d.mts.map
1680
+ //# sourceMappingURL=index-1mOA_4l_.d.mts.map
@@ -1,5 +1,5 @@
1
1
  import { InjectionToken, Injector } from "injection-js";
2
- import { BehaviorSubject, Observable, ObservableInput, OperatorFunction, ReplaySubject, Subject } from "rxjs";
2
+ import { Observable, ObservableInput, Observer, OperatorFunction, ReplaySubject, Subject } from "rxjs";
3
3
  //#region src/injection/types.d.ts
4
4
  declare class SecuritydeptInjectionToken<T> extends InjectionToken<T> {}
5
5
  type SecuritydeptAbstractType<T> = abstract new (...args: never[]) => T;
@@ -566,11 +566,12 @@ declare class RxEventReplaySubject<T> extends ReplaySubject<T> implements EventS
566
566
  asObservable(): RxEventStream<T>;
567
567
  }
568
568
  //#endregion
569
- //#region src/rx/signal.d.ts
569
+ //#region src/rx/internal/reactive-system/base.d.ts
570
570
  interface RxSignalDirtyEvent<T> {
571
571
  epoch: number;
572
572
  signal: ReadableSignalTrait<T>;
573
573
  }
574
+ type RxSignalDirtyObserver<T> = Pick<Observer<RxSignalDirtyEvent<T>>, "next" | "error">;
574
575
  type RxSignalOptions<T> = SignalOptions<T>;
575
576
  type RxSignalWatchScheduler<THandle = unknown> = (flush: () => void) => THandle;
576
577
  type RxSignalWatchCanceller<THandle = unknown> = (handle: THandle) => void;
@@ -580,7 +581,10 @@ interface RxSignalWatchOptions {
580
581
  }
581
582
  declare abstract class RxSignal<T> implements ReadableSignalTrait<T>, InteropObservableTrait<T> {
582
583
  protected static globalEpoch: number;
583
- protected static currentContext: RxComputedSignal<any> | null;
584
+ protected static currentContext: {
585
+ markDependency(signal: RxSignal<any>): void;
586
+ } | null;
587
+ private static dirtyFrame;
584
588
  protected valueEqVersion: number;
585
589
  readonly equals: (a: unknown, b: unknown) => boolean;
586
590
  abstract get(): T;
@@ -588,17 +592,27 @@ declare abstract class RxSignal<T> implements ReadableSignalTrait<T>, InteropObs
588
592
  protected constructor(options: RxSignalOptions<T> | undefined);
589
593
  watchStream(options?: RxSignalWatchOptions): RxEventStream<void>;
590
594
  [SYMBOL_OBSERVABLE](): RxEventStream<T>;
595
+ protected static dispatchDirty(epoch: number, publish: () => void): void;
596
+ protected acceptDirtyEpoch(epoch: number): boolean;
597
+ protected listenDirty(listener: RxSignalDirtyObserver<T>): () => void;
598
+ protected static listenToDirty<T>(signal: RxSignal<T>, listener: RxSignalDirtyObserver<T>, native: boolean): () => void;
591
599
  abstract validateForEpoch(epoch: number): void;
592
600
  }
601
+ //#endregion
602
+ //#region src/rx/signal.d.ts
593
603
  declare class RxStateSignal<T> extends RxSignal<T> implements InteropObservableTrait<T>, WritableSignalTrait<T> {
594
- protected dirtySubject: Subject<RxSignalDirtyEvent<T>>;
595
- protected value: BehaviorSubject<T>;
604
+ protected dirtyListeners: Set<RxSignalDirtyObserver<T>> | undefined;
605
+ private dirtySnapshot;
606
+ private dirty$;
607
+ protected value: T;
608
+ private valueSubject;
596
609
  protected constructor(initialValue: T, options: RxSignalOptions<T> | undefined);
597
610
  set(input: T): void;
598
611
  static fromInitialValue<T>(initialValue: T, options?: RxSignalOptions<T>): RxStateSignalCompat<T>;
599
612
  get(): T;
600
613
  validateForEpoch(): void;
601
614
  dirtyObservable(): Observable<RxSignalDirtyEvent<T>>;
615
+ protected listenDirty(listener: RxSignalDirtyObserver<T>): () => void;
602
616
  [SYMBOL_OBSERVABLE](): RxEventStream<T>;
603
617
  }
604
618
  type RxStateSignalCompat<T> = WithInteropObservableTraitCompat<RxStateSignal<T>, T>;
@@ -618,7 +632,10 @@ declare class RxComputedSignal<T> extends RxSignal<T> {
618
632
  protected readonly computeFn: () => T;
619
633
  protected cacheState: ComputedCacheState<T>;
620
634
  protected sources: ReadonlyMap<AnyRxSignal, number>;
621
- protected sourcesSubject: BehaviorSubject<ReadonlyMap<AnyRxSignal, number>>;
635
+ private dirtyListeners;
636
+ private dirtySnapshot;
637
+ private dirtyStops;
638
+ private dirtyConnection;
622
639
  private validatedEpoch;
623
640
  private isComputing;
624
641
  private collectingSources;
@@ -630,6 +647,10 @@ declare class RxComputedSignal<T> extends RxSignal<T> {
630
647
  validateForEpoch(epoch: number): void;
631
648
  get(): T;
632
649
  dirtyObservable(): Observable<RxSignalDirtyEvent<T>>;
650
+ protected listenDirty(listener: RxSignalDirtyObserver<T>): () => void;
651
+ private disconnectDirtySources;
652
+ private failDirtySources;
653
+ private syncDirtySources;
633
654
  static computed<T>(fn: () => T, options?: RxSignalOptions<T>): RxComputedSignalCompat<T>;
634
655
  }
635
656
  type RxComputedSignalCompat<T> = WithInteropObservableTraitCompat<RxComputedSignal<T>, T>;
@@ -670,5 +691,5 @@ declare function resourceFromSnapshots<T>(source: () => ResourceSnapshot<T>): Wi
670
691
  declare function mapResource<T, U>(source: ResourceTrait<T>, mapValue: (value: T) => U): WithInteropObservableTraitCompat<ResourceTrait<U>, ResourceSnapshot<U>>;
671
692
  declare function rxResource<T, R = undefined>(options: RxResourceOptions<T, R>): WithInteropObservableTraitCompat<ResourceTrait<T>, ResourceSnapshot<T>>;
672
693
  //#endregion
673
- export { ClientErrorContextFormatter as $, SecuritydeptClassProvider as $t, ResourceIdleSnapshot as A, SubscribableTrait as At, WritableSignalTrait as B, SYMBOL_DISPOSABLE_STACK as Bt, IdleCallbackTrait as C, EventStreamTrait as Ct, ComputedSignalTrait as D, InteropObservableTrait as Dt, TimestampProviderTrait as E, RuntimeEventEnvelope as Et, ResourceSnapshot as F, SecuritydeptInjector as Ft, formatClientErrorContext as G, injectDisposableStackFrom as Gt, CancellationTokenOptions as H, SimpleDisposableStack as Ht, ResourceStatus as I, AsyncDisposableTrait as It, describeError as J, inject$1 as Jt, readErrorPresentationDescriptor as K, withDisposableStack as Kt, ResourceTrait as L, DisposableStackTrait as Lt, ResourceLoadingSnapshot as M, WithInteropObservableTraitCompat as Mt, ResourceReloadingSnapshot as N, isInteropObservableTrait as Nt, ReadableSignalTrait as O, ObserverTrait as Ot, ResourceResolvedSnapshot as P, INJECTOR_TOKEN as Pt, ClientErrorFromUnknownOptions as Q, SecuritydeptAbstractType as Qt, ResourceWhenValueOptions as R, DisposableTrait as Rt, IDLE_CALLBACK_TRAIT_TOKEN as S, EventSourceKind as St, TimeTrait as T, EventSubscriptionTrait as Tt, CancellationTokenSourceTrait as U, StdDisposableStack as Ut, CancelableHandle as V, SYMBOL_DISPOSE as Vt, CancellationTokenTrait as W, createDisposableStack as Wt, ClientError as X, tryInjectInInjectionContext as Xt, CLIENT_ERROR_SPAN_ATTRIBUTE_PROVIDER_ID as Y, runInInjectionContext$1 as Yt, ClientErrorFromHttpResponseOptions as Z, SecurityDeptOptional as Zt, RxEventStream as _, SpanPathOptions as _t, resourceFromSnapshots as a, SecuritydeptInjectorTrait as an, ErrorPresentationTone as at, createCancellationTokenSource as b, EventOperatorFunction as bt, RxComputedSignalCompat as c, SecuritydeptValueProvider as cn, ServerErrorPresentation as ct, RxSignalWatchCanceller as d, getSecuritydeptProviderToken as dn, SPAN_TRAIT_TOKEN as dt, SecuritydeptDependencyDescriptor as en, ClientErrorKind as et, RxSignalWatchOptions as f, notMissingProvider as fn, SpanAttributeReadOptions as ft, RxEventReplaySubject as g, SpanNodeAttributes as gt, RxStateSignalCompat as h, SpanCreateOptions as ht, mapResource as i, SecuritydeptInjectionToken as in, ErrorPresentationDescriptor as it, ResourceLoadingErrorSnapshot as j, SubscriptionTrait as jt, ResourceErrorSnapshot as k, SYMBOL_OBSERVABLE as kt, RxSignalDirtyEvent as l, WithTraitDeps as ln, UserRecovery as lt, RxStateSignal as m, SpanAttributes as mt, RxResourceOptions as n, SecuritydeptExistingProvider as nn, ClientErrorSpanContext as nt, rxResource as o, SecuritydeptProvider as on, ErrorRecoveryActionDescriptor as ot, RxSignalWatchScheduler as p, SpanAttributeValue as pt, ErrorSummary as q, SecuritydeptInjectOptions as qt, RxResourceStreamContext as r, SecuritydeptFactoryProvider as rn, ErrorCodePresentation as rt, RxComputedSignal as s, SecuritydeptTypeProvider as sn, ReadErrorPresentationDescriptorOptions as st, RxResource as t, SecuritydeptDependencyToken as tn, ClientErrorSource as tt, RxSignalOptions as u, createProviderIfTokenMissing as un, MutableSpanTrait as ut, RxEventSubject as v, SpanTrait as vt, TIME_TRAIT_TOKEN as w, EventSubjectTrait as wt, isCancellationTokenTrait as x, EventSource as xt, createLinkedCancellationToken as y, EventObserverTrait as yt, SignalOptions as z, SYMBOL_ASYNC_DISPOSE as zt };
674
- //# sourceMappingURL=index-CFAJ969E.d.mts.map
694
+ export { ClientErrorContextFormatter as $, SecuritydeptClassProvider as $t, ResourceIdleSnapshot as A, SubscribableTrait as At, WritableSignalTrait as B, SYMBOL_DISPOSABLE_STACK as Bt, IdleCallbackTrait as C, EventStreamTrait as Ct, ComputedSignalTrait as D, InteropObservableTrait as Dt, TimestampProviderTrait as E, RuntimeEventEnvelope as Et, ResourceSnapshot as F, SecuritydeptInjector as Ft, formatClientErrorContext as G, injectDisposableStackFrom as Gt, CancellationTokenOptions as H, SimpleDisposableStack as Ht, ResourceStatus as I, AsyncDisposableTrait as It, describeError as J, inject$1 as Jt, readErrorPresentationDescriptor as K, withDisposableStack as Kt, ResourceTrait as L, DisposableStackTrait as Lt, ResourceLoadingSnapshot as M, WithInteropObservableTraitCompat as Mt, ResourceReloadingSnapshot as N, isInteropObservableTrait as Nt, ReadableSignalTrait as O, ObserverTrait as Ot, ResourceResolvedSnapshot as P, INJECTOR_TOKEN as Pt, ClientErrorFromUnknownOptions as Q, SecuritydeptAbstractType as Qt, ResourceWhenValueOptions as R, DisposableTrait as Rt, IDLE_CALLBACK_TRAIT_TOKEN as S, EventSourceKind as St, TimeTrait as T, EventSubscriptionTrait as Tt, CancellationTokenSourceTrait as U, StdDisposableStack as Ut, CancelableHandle as V, SYMBOL_DISPOSE as Vt, CancellationTokenTrait as W, createDisposableStack as Wt, ClientError as X, tryInjectInInjectionContext as Xt, CLIENT_ERROR_SPAN_ATTRIBUTE_PROVIDER_ID as Y, runInInjectionContext$1 as Yt, ClientErrorFromHttpResponseOptions as Z, SecurityDeptOptional as Zt, RxEventStream as _, SpanPathOptions as _t, resourceFromSnapshots as a, SecuritydeptInjectorTrait as an, ErrorPresentationTone as at, createCancellationTokenSource as b, EventOperatorFunction as bt, RxComputedSignalCompat as c, SecuritydeptValueProvider as cn, ServerErrorPresentation as ct, RxSignalDirtyEvent as d, getSecuritydeptProviderToken as dn, SPAN_TRAIT_TOKEN as dt, SecuritydeptDependencyDescriptor as en, ClientErrorKind as et, RxSignalOptions as f, notMissingProvider as fn, SpanAttributeReadOptions as ft, RxEventReplaySubject as g, SpanNodeAttributes as gt, RxSignalWatchScheduler as h, SpanCreateOptions as ht, mapResource as i, SecuritydeptInjectionToken as in, ErrorPresentationDescriptor as it, ResourceLoadingErrorSnapshot as j, SubscriptionTrait as jt, ResourceErrorSnapshot as k, SYMBOL_OBSERVABLE as kt, RxStateSignal as l, WithTraitDeps as ln, UserRecovery as lt, RxSignalWatchOptions as m, SpanAttributes as mt, RxResourceOptions as n, SecuritydeptExistingProvider as nn, ClientErrorSpanContext as nt, rxResource as o, SecuritydeptProvider as on, ErrorRecoveryActionDescriptor as ot, RxSignalWatchCanceller as p, SpanAttributeValue as pt, ErrorSummary as q, SecuritydeptInjectOptions as qt, RxResourceStreamContext as r, SecuritydeptFactoryProvider as rn, ErrorCodePresentation as rt, RxComputedSignal as s, SecuritydeptTypeProvider as sn, ReadErrorPresentationDescriptorOptions as st, RxResource as t, SecuritydeptDependencyToken as tn, ClientErrorSource as tt, RxStateSignalCompat as u, createProviderIfTokenMissing as un, MutableSpanTrait as ut, RxEventSubject as v, SpanTrait as vt, TIME_TRAIT_TOKEN as w, EventSubjectTrait as wt, isCancellationTokenTrait as x, EventSource as xt, createLinkedCancellationToken as y, EventObserverTrait as yt, SignalOptions as z, SYMBOL_ASYNC_DISPOSE as zt };
695
+ //# sourceMappingURL=index-_1lhMnf9.d.mts.map
@@ -1,5 +1,5 @@
1
- import { Ct as EventStreamTrait } from "./index-CFAJ969E.mjs";
2
- import { Bt as EnvironmentValidators, Hn as RouterTrait, Mn as WithTraitInputValidator, Oi as PageLifecycleTrait, Vn as RouterNavigationRequest, ar as UriReferenceString } from "./index-CbeZ3AfB.mjs";
1
+ import { Ct as EventStreamTrait } from "./index-_1lhMnf9.mjs";
2
+ import { Bt as EnvironmentValidators, Hn as RouterTrait, Mn as WithTraitInputValidator, Oi as PageLifecycleTrait, Vn as RouterNavigationRequest, ar as UriReferenceString } from "./index-1mOA_4l_.mjs";
3
3
  //#region src/web/events/from-storage.d.ts
4
4
  interface StorageEventTarget {
5
5
  addEventListener(type: "storage", listener: EventListener): void;
@@ -129,4 +129,4 @@ declare class WebLegacyRouter extends NativeWebRouterBase {
129
129
  }
130
130
  //#endregion
131
131
  export { createPageResumeSource as _, NativeWebWindowLike as a, fromStorageEvent as b, WebNavigationRouter as c, createPageLifecycleForNativeWeb as d, CreatePageResumeSourceOptions as f, PageResumeWindowTarget as g, PageResumeTriggerKind as h, NativeWebRouter as i, createRouterForNativeWeb as l, PageResumeEvent as m, NativeWebLocationLike as n, RouterForNativeWebCreateOptions as o, PageResumeDocumentTarget as p, NativeWebNavigationLike as r, WebLegacyRouter as s, NativeWebHistoryLike as t, PageLifecycleForNativeWebCreateOptions as u, FromStorageEventOptions as v, StorageEventTarget as y };
132
- //# sourceMappingURL=index-Bo1BtjZH.d.mts.map
132
+ //# sourceMappingURL=index-kvxJ3X0n.d.mts.map
package/dist/index.d.mts CHANGED
@@ -1,3 +1,3 @@
1
- import { $ as ClientErrorContextFormatter, $t as SecuritydeptClassProvider, A as ResourceIdleSnapshot, At as SubscribableTrait, B as WritableSignalTrait, Bt as SYMBOL_DISPOSABLE_STACK, C as IdleCallbackTrait, Ct as EventStreamTrait, D as ComputedSignalTrait, Dt as InteropObservableTrait, E as TimestampProviderTrait, Et as RuntimeEventEnvelope, F as ResourceSnapshot, Ft as SecuritydeptInjector, G as formatClientErrorContext, Gt as injectDisposableStackFrom, H as CancellationTokenOptions, Ht as SimpleDisposableStack, I as ResourceStatus, It as AsyncDisposableTrait, J as describeError, Jt as inject, K as readErrorPresentationDescriptor, Kt as withDisposableStack, L as ResourceTrait, Lt as DisposableStackTrait, M as ResourceLoadingSnapshot, Mt as WithInteropObservableTraitCompat, N as ResourceReloadingSnapshot, Nt as isInteropObservableTrait, O as ReadableSignalTrait, Ot as ObserverTrait, P as ResourceResolvedSnapshot, Pt as INJECTOR_TOKEN, Q as ClientErrorFromUnknownOptions, Qt as SecuritydeptAbstractType, R as ResourceWhenValueOptions, Rt as DisposableTrait, S as IDLE_CALLBACK_TRAIT_TOKEN, St as EventSourceKind, T as TimeTrait, Tt as EventSubscriptionTrait, U as CancellationTokenSourceTrait, Ut as StdDisposableStack, V as CancelableHandle, Vt as SYMBOL_DISPOSE, W as CancellationTokenTrait, Wt as createDisposableStack, X as ClientError, Xt as tryInjectInInjectionContext, Y as CLIENT_ERROR_SPAN_ATTRIBUTE_PROVIDER_ID, Yt as runInInjectionContext, Z as ClientErrorFromHttpResponseOptions, Zt as SecurityDeptOptional, _t as SpanPathOptions, a as resourceFromSnapshots, an as SecuritydeptInjectorTrait, at as ErrorPresentationTone, b as createCancellationTokenSource, bt as EventOperatorFunction, cn as SecuritydeptValueProvider, ct as ServerErrorPresentation, dn as getSecuritydeptProviderToken, dt as SPAN_TRAIT_TOKEN, en as SecuritydeptDependencyDescriptor, et as ClientErrorKind, fn as notMissingProvider, ft as SpanAttributeReadOptions, gt as SpanNodeAttributes, ht as SpanCreateOptions, i as mapResource, in as SecuritydeptInjectionToken, it as ErrorPresentationDescriptor, j as ResourceLoadingErrorSnapshot, jt as SubscriptionTrait, k as ResourceErrorSnapshot, kt as SYMBOL_OBSERVABLE, ln as WithTraitDeps, lt as UserRecovery, mt as SpanAttributes, nn as SecuritydeptExistingProvider, nt as ClientErrorSpanContext, on as SecuritydeptProvider, ot as ErrorRecoveryActionDescriptor, pt as SpanAttributeValue, q as ErrorSummary, qt as SecuritydeptInjectOptions, rn as SecuritydeptFactoryProvider, rt as ErrorCodePresentation, sn as SecuritydeptTypeProvider, st as ReadErrorPresentationDescriptorOptions, tn as SecuritydeptDependencyToken, tt as ClientErrorSource, un as createProviderIfTokenMissing, ut as MutableSpanTrait, vt as SpanTrait, w as TIME_TRAIT_TOKEN, wt as EventSubjectTrait, x as isCancellationTokenTrait, xt as EventSource, y as createLinkedCancellationToken, yt as EventObserverTrait, zt as SYMBOL_ASYNC_DISPOSE } from "./index-CFAJ969E.mjs";
2
- import { $ as RequirementPlan, $n as appendOrReplaceCompatFragment, $r as createJsonRpcServerAndClient, $t as Codec, A as abortSignalToCancellationToken, Ai as Base64CompatErrorCode, An as ValidationResult, Ar as readPopupErrorPresentationDescriptor, At as SelectCandidate, B as JwtAudienceClaim, Bn as RouterNavigationMode, Br as ResourceSnapshotUpdateKind, Bt as EnvironmentValidators, C as OnceAsyncLockState, Ci as createEventStream, Cn as CreateAuthorizationInterceptedFetchOptions, Cr as PopupAttachResult, Ct as RequirementResolution, D as createJsonCodec, Di as PAGE_LIFECYCLE_TRAIT_TOKEN, Dn as TraitInputValidator, Dr as CreatePopupClientSessionOptions, Dt as RouteRequirementsDeclaration, E as createInMemoryRecordStore, Ei as abortSignalToEventStream, En as createTimeForStd, Er as PopupTrait, Et as RouteBehaviourContextExtra, F as parseDurationToMs, Fn as validateTraitInput, Fr as PopupServerWindowHandleTrait, Ft as isRouteStateSnapshotTrait, G as parseIdentityPrincipalWire, Gn as AppendOrReplaceCompatFragmentOptions, Gr as ResourceStreamContext, Gt as TracingSubscriberTrait, H as IdentityPrincipalSchema, Hn as RouterTrait, Hr as reduceResourceSnapshot, Ht as ServiceWorkerEnvironment, I as JwtDecodeError, In as validateWithSchema, Ir as PopupWindowHandleTrait, It as resolveEffectiveRequirements, J as ProjectIdentityPrincipalOptions, Jn as CompatFragmentParameters, Jr as ResourceErrorCode, Jt as TRACING_SPAN_ATTRIBUTE_PROVIDER_ID, K as projectIdentityPrincipal, Kn as AppendOrReplaceCompatFragmentResult, Kr as createResource, Kt as OperationSpanTrait, L as JwtDecodeErrorCode, Ln as validateWithSchemaSync, Lr as createSignal, Lt as CreateFoundationEnvironmentOptions, M as normalizeAbortError, Mi as encodeUint8ArrayToBase64, Mn as WithTraitInputValidator, Mr as PopupClientWindowHandleTrait, Mt as StaticAttrsAuthRequirementInput, N as createRootSpan, Ni as SecuritydeptDestroyRef, Nn as formatValidationFailure, Nr as PopupMessageChannelTrait, Nt as UnauthenticatedAction, O as createEphemeralFlowStore, Oi as PageLifecycleTrait, On as ValidateTraitInputOptions, Or as CreatePopupServerSessionOptions, Ot as RouteStateSnapshotTrait, P as SpanSharedAttributeName, Pi as createSecuritydeptDestroyRef, Pn as throwValidationClientError, Pr as PopupServerWindowHandle, Pt as isRouteBehaviourContextExtra, Q as BaseRequirementPlanner, Qn as UpdateUriFragmentHash, Qr as createJsonRpcServer, Qt as TracingTrait, R as decodeJwtPayload, Rn as ROUTER_TRAIT_TOKEN, Rr as readonlySignal, Rt as createFoundationEnvironment, S as OnceAsyncLockRunning, Si as createEventReplaySubject, Sn as AuthorizationSignal, Sr as PopupAttachFailureReason, St as RequirementPlannerError, T as createOnceAsyncLockCallable, Ti as createNeverEventStream, Tn as TimeForStdCreateOptions, Tr as PopupOpenOptions, Tt as ResolutionStatus, U as IdentityPrincipalWireSchema, Un as TakeCompatFragmentFromRouterOptions, Ur as whenResourceSnapshotValue, Ut as TracingCreateOptions, V as JwtClaimsSet, Vn as RouterNavigationRequest, Vr as flattenResourceSnapshot, Vt as FoundationEnvironment, W as parseIdentityPrincipal, Wn as takeCompatFragmentFromRouter, Wr as CreateResourceOptions, Wt as createTracing, X as RouteCompositionRequirementPlanner, Xn as TakeCompatFragmentOptions, Xr as createComputed, Xt as TracingEvent, Y as StaticRequirementPlanner, Yn as SECURITYDEPT_COMPAT_FRAGMENT_VERSION, Yr as ResourceValueUnavailableErrorOptions, Yt as TRACING_TRAIT_TOKEN, Z as MergeRequirementPlanner, Zn as TakeCompatFragmentResult, Zr as createJsonRpcClient, Zt as TracingLevel, _ as runOperation, _i as toEventStream, _n as HttpResponse, _r as UriReferenceStringSchema, _t as RequirementBehaviour, a as ConsoleTracingSubscriber, ai as JsonRpcErrorResponseMessage, an as RecoverableStateStore, ar as UriReferenceString, at as RequirementPlannerHostOptions, b as OnceAsyncLockError, bi as isClientErrorEvent, bn as TransportErrorCode, br as POPUP_TRAIT_TOKEN, bt as RequirementCandidateGenerator, c as DefineInstrumentMethodDecoratorFactory, ci as JsonRpcNotificationEvent, cn as StorageChangeEventOrigin, cr as UriRelativeParts, ct as provideRequirementPlannerHost, d as InstrumentMethodThisResolver, di as JsonRpcRequestMessage, dn as SyncStorageTrait, dr as UriString, dt as CheckAuthenticated, ei as CreateJsonRpcClientOptions, en as EphemeralFlowStore, er as isCompatFragmentBlock, et as InjectRequirementPlannerHostOptions, f as defineInstrumentMethodDecorator, fi as JsonRpcRequestOptions, fn as BaseTransportForStdFetchCreateOptions, fr as SECURITYDEPT_ROUTE_METADATA_KEY, ft as OnUnauthenticated, g as RunOperationOptionsBase, gi as ToEventStreamInput, gn as HttpRequest, gr as BaseURIStringSchema, gt as PlanStatus, h as RunOperationOptions, hi as JsonRpcSuccessResponseMessage, hn as BaseTransportTrait, hr as writeSecuritydeptRouteMetadata, ht as PipelineStepResult, i as createTraceTimelineStore, ii as JsonRpcErrorPayload, in as REALM_STORAGE_TRAIT_TOKEN, ir as UriParseError, it as RequirementPlannerHostBehaviour, j as cancellationTokenToAbortSignal, ji as decodeBase64ToUint8Array, jn as ValidationSuccess, jr as PopupClientWindowHandle, jt as StaticAttrsAuthRequirement, k as createKeyedEphemeralFlowStore, ki as promisesToRacedAsyncGenerator, kn as ValidationFailure, kr as PopupErrorCode, kt as RouteTreeSegment, l as InstrumentMethodResolvedOptions, li as JsonRpcNotificationMessage, ln as StorageTrait, lr as UriRelativeString, lt as AuthRequirement, m as RunOperationEnvironment, mi as JsonRpcServerTrait, mn as createBaseTransportForStdFetch, mr as readSecuritydeptRouteMetadata, mt as PipelineRunResult, n as TraceTimelineEntry, ni as CreateJsonRpcServerOptions, nn as PERSISTENT_STORAGE_TRAIT_TOKEN, nr as takeCompatFragment, nt as REQUIREMENT_PLANNER_HOST, o as createConsoleTracingSubscriber, oi as JsonRpcId, on as SESSION_STORAGE_TRAIT_TOKEN, or as UriReferenceStringInput, ot as defaultSelectCandidate, p as OperationSpan, pi as JsonRpcServerAndClientTrait, pn as FetchTransportRedirectKind, pr as SecuritydeptRouteMetadata, pt as PipelineOutcome, q as IdentityPrincipal, qn as CompatFragment, qr as ResourceError, qt as OperationTraceEventType, r as TraceTimelineStore, ri as JsonRpcClientTrait, rn as PersistentAuthStore, rr as UriFragmentPart, rt as RequirementPlannerHost, s as DefineInstrumentMethodDecoratorContext, si as JsonRpcMessage, sn as StorageChangeEvent, sr as UriReferenceStringLike, st as injectRequirementPlannerHost, t as isLoopbackHttpUrl, ti as CreateJsonRpcServerAndClientOptions, tn as KeyedEphemeralFlowStore, tr as parseCompatFragment, tt as ProvideRequirementPlannerHostOptions, u as InstrumentMethodThisContext, ui as JsonRpcRequestEvent, un as StoredEnvelope, ur as UriSearchParamsInit, ut as AuthenticatedCheck, v as OnceAsyncLock, vi as ClientErrorEvent, vn as HttpResponseJsonBody, vr as UriRelativeStringSchema, vt as RequirementBehaviourContext, w as OnceAsyncLockSuccess, wi as createEventSubject, wn as createAuthorizationInterceptedFetch, wr as PopupAttachSuccess, wt as RequirementsComposition, x as OnceAsyncLockInit, xi as createEmptyEventStream, xn as AuthorizationInterceptedFetchPredicate, xr as PopupAttachFailure, xt as RequirementCandidateSelectionContext, y as OnceAsyncLockCallable, yi as ExtractClientErrorEvent, yn as TRANSPORT_TRAIT_TOKEN, yr as UriStringSchema, yt as RequirementBehaviourWithRouteContext, z as DecodeJwtPayloadOptions, zn as RouterNavigationIntent, zr as ResourceSnapshotUpdate, zt as ENVIRONMENT_TOKEN } from "./index-CbeZ3AfB.mjs";
1
+ import { $ as ClientErrorContextFormatter, $t as SecuritydeptClassProvider, A as ResourceIdleSnapshot, At as SubscribableTrait, B as WritableSignalTrait, Bt as SYMBOL_DISPOSABLE_STACK, C as IdleCallbackTrait, Ct as EventStreamTrait, D as ComputedSignalTrait, Dt as InteropObservableTrait, E as TimestampProviderTrait, Et as RuntimeEventEnvelope, F as ResourceSnapshot, Ft as SecuritydeptInjector, G as formatClientErrorContext, Gt as injectDisposableStackFrom, H as CancellationTokenOptions, Ht as SimpleDisposableStack, I as ResourceStatus, It as AsyncDisposableTrait, J as describeError, Jt as inject, K as readErrorPresentationDescriptor, Kt as withDisposableStack, L as ResourceTrait, Lt as DisposableStackTrait, M as ResourceLoadingSnapshot, Mt as WithInteropObservableTraitCompat, N as ResourceReloadingSnapshot, Nt as isInteropObservableTrait, O as ReadableSignalTrait, Ot as ObserverTrait, P as ResourceResolvedSnapshot, Pt as INJECTOR_TOKEN, Q as ClientErrorFromUnknownOptions, Qt as SecuritydeptAbstractType, R as ResourceWhenValueOptions, Rt as DisposableTrait, S as IDLE_CALLBACK_TRAIT_TOKEN, St as EventSourceKind, T as TimeTrait, Tt as EventSubscriptionTrait, U as CancellationTokenSourceTrait, Ut as StdDisposableStack, V as CancelableHandle, Vt as SYMBOL_DISPOSE, W as CancellationTokenTrait, Wt as createDisposableStack, X as ClientError, Xt as tryInjectInInjectionContext, Y as CLIENT_ERROR_SPAN_ATTRIBUTE_PROVIDER_ID, Yt as runInInjectionContext, Z as ClientErrorFromHttpResponseOptions, Zt as SecurityDeptOptional, _t as SpanPathOptions, a as resourceFromSnapshots, an as SecuritydeptInjectorTrait, at as ErrorPresentationTone, b as createCancellationTokenSource, bt as EventOperatorFunction, cn as SecuritydeptValueProvider, ct as ServerErrorPresentation, dn as getSecuritydeptProviderToken, dt as SPAN_TRAIT_TOKEN, en as SecuritydeptDependencyDescriptor, et as ClientErrorKind, fn as notMissingProvider, ft as SpanAttributeReadOptions, gt as SpanNodeAttributes, ht as SpanCreateOptions, i as mapResource, in as SecuritydeptInjectionToken, it as ErrorPresentationDescriptor, j as ResourceLoadingErrorSnapshot, jt as SubscriptionTrait, k as ResourceErrorSnapshot, kt as SYMBOL_OBSERVABLE, ln as WithTraitDeps, lt as UserRecovery, mt as SpanAttributes, nn as SecuritydeptExistingProvider, nt as ClientErrorSpanContext, on as SecuritydeptProvider, ot as ErrorRecoveryActionDescriptor, pt as SpanAttributeValue, q as ErrorSummary, qt as SecuritydeptInjectOptions, rn as SecuritydeptFactoryProvider, rt as ErrorCodePresentation, sn as SecuritydeptTypeProvider, st as ReadErrorPresentationDescriptorOptions, tn as SecuritydeptDependencyToken, tt as ClientErrorSource, un as createProviderIfTokenMissing, ut as MutableSpanTrait, vt as SpanTrait, w as TIME_TRAIT_TOKEN, wt as EventSubjectTrait, x as isCancellationTokenTrait, xt as EventSource, y as createLinkedCancellationToken, yt as EventObserverTrait, zt as SYMBOL_ASYNC_DISPOSE } from "./index-_1lhMnf9.mjs";
2
+ import { $ as RequirementPlan, $n as appendOrReplaceCompatFragment, $r as createJsonRpcServerAndClient, $t as Codec, A as abortSignalToCancellationToken, Ai as Base64CompatErrorCode, An as ValidationResult, Ar as readPopupErrorPresentationDescriptor, At as SelectCandidate, B as JwtAudienceClaim, Bn as RouterNavigationMode, Br as ResourceSnapshotUpdateKind, Bt as EnvironmentValidators, C as OnceAsyncLockState, Ci as createEventStream, Cn as CreateAuthorizationInterceptedFetchOptions, Cr as PopupAttachResult, Ct as RequirementResolution, D as createJsonCodec, Di as PAGE_LIFECYCLE_TRAIT_TOKEN, Dn as TraitInputValidator, Dr as CreatePopupClientSessionOptions, Dt as RouteRequirementsDeclaration, E as createInMemoryRecordStore, Ei as abortSignalToEventStream, En as createTimeForStd, Er as PopupTrait, Et as RouteBehaviourContextExtra, F as parseDurationToMs, Fn as validateTraitInput, Fr as PopupServerWindowHandleTrait, Ft as isRouteStateSnapshotTrait, G as parseIdentityPrincipalWire, Gn as AppendOrReplaceCompatFragmentOptions, Gr as ResourceStreamContext, Gt as TracingSubscriberTrait, H as IdentityPrincipalSchema, Hn as RouterTrait, Hr as reduceResourceSnapshot, Ht as ServiceWorkerEnvironment, I as JwtDecodeError, In as validateWithSchema, Ir as PopupWindowHandleTrait, It as resolveEffectiveRequirements, J as ProjectIdentityPrincipalOptions, Jn as CompatFragmentParameters, Jr as ResourceErrorCode, Jt as TRACING_SPAN_ATTRIBUTE_PROVIDER_ID, K as projectIdentityPrincipal, Kn as AppendOrReplaceCompatFragmentResult, Kr as createResource, Kt as OperationSpanTrait, L as JwtDecodeErrorCode, Ln as validateWithSchemaSync, Lr as createSignal, Lt as CreateFoundationEnvironmentOptions, M as normalizeAbortError, Mi as encodeUint8ArrayToBase64, Mn as WithTraitInputValidator, Mr as PopupClientWindowHandleTrait, Mt as StaticAttrsAuthRequirementInput, N as createRootSpan, Ni as SecuritydeptDestroyRef, Nn as formatValidationFailure, Nr as PopupMessageChannelTrait, Nt as UnauthenticatedAction, O as createEphemeralFlowStore, Oi as PageLifecycleTrait, On as ValidateTraitInputOptions, Or as CreatePopupServerSessionOptions, Ot as RouteStateSnapshotTrait, P as SpanSharedAttributeName, Pi as createSecuritydeptDestroyRef, Pn as throwValidationClientError, Pr as PopupServerWindowHandle, Pt as isRouteBehaviourContextExtra, Q as BaseRequirementPlanner, Qn as UpdateUriFragmentHash, Qr as createJsonRpcServer, Qt as TracingTrait, R as decodeJwtPayload, Rn as ROUTER_TRAIT_TOKEN, Rr as readonlySignal, Rt as createFoundationEnvironment, S as OnceAsyncLockRunning, Si as createEventReplaySubject, Sn as AuthorizationSignal, Sr as PopupAttachFailureReason, St as RequirementPlannerError, T as createOnceAsyncLockCallable, Ti as createNeverEventStream, Tn as TimeForStdCreateOptions, Tr as PopupOpenOptions, Tt as ResolutionStatus, U as IdentityPrincipalWireSchema, Un as TakeCompatFragmentFromRouterOptions, Ur as whenResourceSnapshotValue, Ut as TracingCreateOptions, V as JwtClaimsSet, Vn as RouterNavigationRequest, Vr as flattenResourceSnapshot, Vt as FoundationEnvironment, W as parseIdentityPrincipal, Wn as takeCompatFragmentFromRouter, Wr as CreateResourceOptions, Wt as createTracing, X as RouteCompositionRequirementPlanner, Xn as TakeCompatFragmentOptions, Xr as createComputed, Xt as TracingEvent, Y as StaticRequirementPlanner, Yn as SECURITYDEPT_COMPAT_FRAGMENT_VERSION, Yr as ResourceValueUnavailableErrorOptions, Yt as TRACING_TRAIT_TOKEN, Z as MergeRequirementPlanner, Zn as TakeCompatFragmentResult, Zr as createJsonRpcClient, Zt as TracingLevel, _ as runOperation, _i as toEventStream, _n as HttpResponse, _r as UriReferenceStringSchema, _t as RequirementBehaviour, a as ConsoleTracingSubscriber, ai as JsonRpcErrorResponseMessage, an as RecoverableStateStore, ar as UriReferenceString, at as RequirementPlannerHostOptions, b as OnceAsyncLockError, bi as isClientErrorEvent, bn as TransportErrorCode, br as POPUP_TRAIT_TOKEN, bt as RequirementCandidateGenerator, c as DefineInstrumentMethodDecoratorFactory, ci as JsonRpcNotificationEvent, cn as StorageChangeEventOrigin, cr as UriRelativeParts, ct as provideRequirementPlannerHost, d as InstrumentMethodThisResolver, di as JsonRpcRequestMessage, dn as SyncStorageTrait, dr as UriString, dt as CheckAuthenticated, ei as CreateJsonRpcClientOptions, en as EphemeralFlowStore, er as isCompatFragmentBlock, et as InjectRequirementPlannerHostOptions, f as defineInstrumentMethodDecorator, fi as JsonRpcRequestOptions, fn as BaseTransportForStdFetchCreateOptions, fr as SECURITYDEPT_ROUTE_METADATA_KEY, ft as OnUnauthenticated, g as RunOperationOptionsBase, gi as ToEventStreamInput, gn as HttpRequest, gr as BaseURIStringSchema, gt as PlanStatus, h as RunOperationOptions, hi as JsonRpcSuccessResponseMessage, hn as BaseTransportTrait, hr as writeSecuritydeptRouteMetadata, ht as PipelineStepResult, i as createTraceTimelineStore, ii as JsonRpcErrorPayload, in as REALM_STORAGE_TRAIT_TOKEN, ir as UriParseError, it as RequirementPlannerHostBehaviour, j as cancellationTokenToAbortSignal, ji as decodeBase64ToUint8Array, jn as ValidationSuccess, jr as PopupClientWindowHandle, jt as StaticAttrsAuthRequirement, k as createKeyedEphemeralFlowStore, ki as promisesToRacedAsyncGenerator, kn as ValidationFailure, kr as PopupErrorCode, kt as RouteTreeSegment, l as InstrumentMethodResolvedOptions, li as JsonRpcNotificationMessage, ln as StorageTrait, lr as UriRelativeString, lt as AuthRequirement, m as RunOperationEnvironment, mi as JsonRpcServerTrait, mn as createBaseTransportForStdFetch, mr as readSecuritydeptRouteMetadata, mt as PipelineRunResult, n as TraceTimelineEntry, ni as CreateJsonRpcServerOptions, nn as PERSISTENT_STORAGE_TRAIT_TOKEN, nr as takeCompatFragment, nt as REQUIREMENT_PLANNER_HOST, o as createConsoleTracingSubscriber, oi as JsonRpcId, on as SESSION_STORAGE_TRAIT_TOKEN, or as UriReferenceStringInput, ot as defaultSelectCandidate, p as OperationSpan, pi as JsonRpcServerAndClientTrait, pn as FetchTransportRedirectKind, pr as SecuritydeptRouteMetadata, pt as PipelineOutcome, q as IdentityPrincipal, qn as CompatFragment, qr as ResourceError, qt as OperationTraceEventType, r as TraceTimelineStore, ri as JsonRpcClientTrait, rn as PersistentAuthStore, rr as UriFragmentPart, rt as RequirementPlannerHost, s as DefineInstrumentMethodDecoratorContext, si as JsonRpcMessage, sn as StorageChangeEvent, sr as UriReferenceStringLike, st as injectRequirementPlannerHost, t as isLoopbackHttpUrl, ti as CreateJsonRpcServerAndClientOptions, tn as KeyedEphemeralFlowStore, tr as parseCompatFragment, tt as ProvideRequirementPlannerHostOptions, u as InstrumentMethodThisContext, ui as JsonRpcRequestEvent, un as StoredEnvelope, ur as UriSearchParamsInit, ut as AuthenticatedCheck, v as OnceAsyncLock, vi as ClientErrorEvent, vn as HttpResponseJsonBody, vr as UriRelativeStringSchema, vt as RequirementBehaviourContext, w as OnceAsyncLockSuccess, wi as createEventSubject, wn as createAuthorizationInterceptedFetch, wr as PopupAttachSuccess, wt as RequirementsComposition, x as OnceAsyncLockInit, xi as createEmptyEventStream, xn as AuthorizationInterceptedFetchPredicate, xr as PopupAttachFailure, xt as RequirementCandidateSelectionContext, y as OnceAsyncLockCallable, yi as ExtractClientErrorEvent, yn as TRANSPORT_TRAIT_TOKEN, yr as UriStringSchema, yt as RequirementBehaviourWithRouteContext, z as DecodeJwtPayloadOptions, zn as RouterNavigationIntent, zr as ResourceSnapshotUpdate, zt as ENVIRONMENT_TOKEN } from "./index-1mOA_4l_.mjs";
3
3
  export { type AppendOrReplaceCompatFragmentOptions, type AppendOrReplaceCompatFragmentResult, type AsyncDisposableTrait, type AuthRequirement, type AuthenticatedCheck, type AuthorizationInterceptedFetchPredicate, type AuthorizationSignal, Base64CompatErrorCode, BaseRequirementPlanner, type BaseTransportForStdFetchCreateOptions, type BaseTransportTrait, BaseURIStringSchema, CLIENT_ERROR_SPAN_ATTRIBUTE_PROVIDER_ID, type CancelableHandle, type CancellationTokenOptions, type CancellationTokenSourceTrait, type CancellationTokenTrait, type CheckAuthenticated, ClientError, type ClientErrorContextFormatter, type ClientErrorEvent, type ClientErrorFromHttpResponseOptions, type ClientErrorFromUnknownOptions, ClientErrorKind, ClientErrorSource, type ClientErrorSpanContext, type Codec, type CompatFragment, type CompatFragmentParameters, type ComputedSignalTrait, ConsoleTracingSubscriber, type CreateAuthorizationInterceptedFetchOptions, type CreateFoundationEnvironmentOptions, type CreateJsonRpcClientOptions, type CreateJsonRpcServerAndClientOptions, type CreateJsonRpcServerOptions, type CreatePopupClientSessionOptions, type CreatePopupServerSessionOptions, type CreateResourceOptions, type DecodeJwtPayloadOptions, type DefineInstrumentMethodDecoratorContext, type DefineInstrumentMethodDecoratorFactory, type DisposableStackTrait, type DisposableTrait, ENVIRONMENT_TOKEN, type EnvironmentValidators, type EphemeralFlowStore, type ErrorCodePresentation, type ErrorPresentationDescriptor, ErrorPresentationTone, type ErrorRecoveryActionDescriptor, type ErrorSummary, type EventObserverTrait, type EventOperatorFunction, type EventSource, EventSourceKind, type EventStreamTrait, type EventSubjectTrait, type EventSubscriptionTrait, type ExtractClientErrorEvent, FetchTransportRedirectKind, type FoundationEnvironment, type HttpRequest, type HttpResponse, type HttpResponseJsonBody, IDLE_CALLBACK_TRAIT_TOKEN, INJECTOR_TOKEN, type IdentityPrincipal, IdentityPrincipalSchema, IdentityPrincipalWireSchema, type IdleCallbackTrait, type InjectRequirementPlannerHostOptions, type InstrumentMethodResolvedOptions, type InstrumentMethodThisContext, type InstrumentMethodThisResolver, type InteropObservableTrait, type JsonRpcClientTrait, type JsonRpcErrorPayload, type JsonRpcErrorResponseMessage, type JsonRpcId, type JsonRpcMessage, type JsonRpcNotificationEvent, type JsonRpcNotificationMessage, type JsonRpcRequestEvent, type JsonRpcRequestMessage, type JsonRpcRequestOptions, type JsonRpcServerAndClientTrait, type JsonRpcServerTrait, type JsonRpcSuccessResponseMessage, type JwtAudienceClaim, type JwtClaimsSet, JwtDecodeError, JwtDecodeErrorCode, type KeyedEphemeralFlowStore, MergeRequirementPlanner, type MutableSpanTrait, type ObserverTrait, type OnUnauthenticated, type OnceAsyncLock, type OnceAsyncLockCallable, type OnceAsyncLockError, type OnceAsyncLockInit, type OnceAsyncLockRunning, OnceAsyncLockState, type OnceAsyncLockSuccess, OperationSpan, type OperationSpanTrait, OperationTraceEventType, PAGE_LIFECYCLE_TRAIT_TOKEN, PERSISTENT_STORAGE_TRAIT_TOKEN, POPUP_TRAIT_TOKEN, type PageLifecycleTrait, type PersistentAuthStore, PipelineOutcome, type PipelineRunResult, type PipelineStepResult, PlanStatus, type PopupAttachFailure, PopupAttachFailureReason, type PopupAttachResult, type PopupAttachSuccess, PopupClientWindowHandle, type PopupClientWindowHandleTrait, PopupErrorCode, type PopupMessageChannelTrait, type PopupOpenOptions, PopupServerWindowHandle, type PopupServerWindowHandleTrait, type PopupTrait, type PopupWindowHandleTrait, type ProjectIdentityPrincipalOptions, type ProvideRequirementPlannerHostOptions, REALM_STORAGE_TRAIT_TOKEN, REQUIREMENT_PLANNER_HOST, ROUTER_TRAIT_TOKEN, type ReadErrorPresentationDescriptorOptions, type ReadableSignalTrait, type RecoverableStateStore, type RequirementBehaviour, type RequirementBehaviourContext, type RequirementBehaviourWithRouteContext, type RequirementCandidateGenerator, type RequirementCandidateSelectionContext, type RequirementPlan, RequirementPlannerError, RequirementPlannerHost, type RequirementPlannerHostBehaviour, type RequirementPlannerHostOptions, type RequirementResolution, RequirementsComposition, ResolutionStatus, ResourceError, ResourceErrorCode, type ResourceErrorSnapshot, type ResourceIdleSnapshot, type ResourceLoadingErrorSnapshot, type ResourceLoadingSnapshot, type ResourceReloadingSnapshot, type ResourceResolvedSnapshot, type ResourceSnapshot, type ResourceSnapshotUpdate, ResourceSnapshotUpdateKind, ResourceStatus, type ResourceStreamContext, type ResourceTrait, type ResourceValueUnavailableErrorOptions, type ResourceWhenValueOptions, type RouteBehaviourContextExtra, RouteCompositionRequirementPlanner, type RouteRequirementsDeclaration, type RouteStateSnapshotTrait, type RouteTreeSegment, RouterNavigationIntent, RouterNavigationMode, type RouterNavigationRequest, type RouterTrait, type RunOperationEnvironment, type RunOperationOptions, type RunOperationOptionsBase, type RuntimeEventEnvelope, SECURITYDEPT_COMPAT_FRAGMENT_VERSION, SECURITYDEPT_ROUTE_METADATA_KEY, SESSION_STORAGE_TRAIT_TOKEN, SPAN_TRAIT_TOKEN, SYMBOL_ASYNC_DISPOSE, SYMBOL_DISPOSABLE_STACK, SYMBOL_DISPOSE, SYMBOL_OBSERVABLE, SecurityDeptOptional, type SecuritydeptAbstractType, type SecuritydeptClassProvider, type SecuritydeptDependencyDescriptor, type SecuritydeptDependencyToken, SecuritydeptDestroyRef, type SecuritydeptExistingProvider, type SecuritydeptFactoryProvider, type SecuritydeptInjectOptions, SecuritydeptInjectionToken, SecuritydeptInjector, type SecuritydeptInjectorTrait, type SecuritydeptProvider, type SecuritydeptRouteMetadata, type SecuritydeptTypeProvider, type SecuritydeptValueProvider, type SelectCandidate, type ServerErrorPresentation, type ServiceWorkerEnvironment, SimpleDisposableStack, type SpanAttributeReadOptions, type SpanAttributeValue, type SpanAttributes, type SpanCreateOptions, type SpanNodeAttributes, type SpanPathOptions, SpanSharedAttributeName, type SpanTrait, StaticAttrsAuthRequirement, type StaticAttrsAuthRequirementInput, StaticRequirementPlanner, StdDisposableStack, type StorageChangeEvent, StorageChangeEventOrigin, type StorageTrait, type StoredEnvelope, type SubscribableTrait, type SubscriptionTrait, type SyncStorageTrait, TIME_TRAIT_TOKEN, TRACING_SPAN_ATTRIBUTE_PROVIDER_ID, TRACING_TRAIT_TOKEN, TRANSPORT_TRAIT_TOKEN, type TakeCompatFragmentFromRouterOptions, type TakeCompatFragmentOptions, type TakeCompatFragmentResult, type TimeForStdCreateOptions, type TimeTrait, type TimestampProviderTrait, type ToEventStreamInput, type TraceTimelineEntry, TraceTimelineStore, type TracingCreateOptions, type TracingEvent, TracingLevel, type TracingSubscriberTrait, type TracingTrait, type TraitInputValidator, TransportErrorCode, type UnauthenticatedAction, type UpdateUriFragmentHash, type UriFragmentPart, UriParseError, UriReferenceString, type UriReferenceStringInput, type UriReferenceStringLike, UriReferenceStringSchema, type UriRelativeParts, UriRelativeString, UriRelativeStringSchema, type UriSearchParamsInit, UriString, UriStringSchema, UserRecovery, type ValidateTraitInputOptions, type ValidationFailure, type ValidationResult, type ValidationSuccess, type WithInteropObservableTraitCompat, type WithTraitDeps, type WithTraitInputValidator, type WritableSignalTrait, abortSignalToCancellationToken, abortSignalToEventStream, appendOrReplaceCompatFragment, cancellationTokenToAbortSignal, createAuthorizationInterceptedFetch, createBaseTransportForStdFetch, createCancellationTokenSource, createComputed, createConsoleTracingSubscriber, createDisposableStack, createEmptyEventStream, createEphemeralFlowStore, createEventReplaySubject, createEventStream, createEventSubject, createFoundationEnvironment, createInMemoryRecordStore, createJsonCodec, createJsonRpcClient, createJsonRpcServer, createJsonRpcServerAndClient, createKeyedEphemeralFlowStore, createLinkedCancellationToken, createNeverEventStream, createOnceAsyncLockCallable, createProviderIfTokenMissing, createResource, createRootSpan, createSecuritydeptDestroyRef, createSignal, createTimeForStd, createTraceTimelineStore, createTracing, decodeBase64ToUint8Array, decodeJwtPayload, defaultSelectCandidate, defineInstrumentMethodDecorator, describeError, encodeUint8ArrayToBase64, flattenResourceSnapshot, formatClientErrorContext, formatValidationFailure, getSecuritydeptProviderToken, inject, injectDisposableStackFrom, injectRequirementPlannerHost, isCancellationTokenTrait, isClientErrorEvent, isCompatFragmentBlock, isInteropObservableTrait, isLoopbackHttpUrl, isRouteBehaviourContextExtra, isRouteStateSnapshotTrait, mapResource, normalizeAbortError, notMissingProvider, parseCompatFragment, parseDurationToMs, parseIdentityPrincipal, parseIdentityPrincipalWire, projectIdentityPrincipal, promisesToRacedAsyncGenerator, provideRequirementPlannerHost, readErrorPresentationDescriptor, readPopupErrorPresentationDescriptor, readSecuritydeptRouteMetadata, readonlySignal, reduceResourceSnapshot, resolveEffectiveRequirements, resourceFromSnapshots, runInInjectionContext, runOperation, takeCompatFragment, takeCompatFragmentFromRouter, throwValidationClientError, toEventStream, tryInjectInInjectionContext, validateTraitInput, validateWithSchema, validateWithSchemaSync, whenResourceSnapshotValue, withDisposableStack, writeSecuritydeptRouteMetadata };
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
- import { A as RxEventSubject, B as withDisposableStack, E as RxComputedSignal, F as SYMBOL_DISPOSE, G as ErrorPresentationTone, H as ClientError, I as SimpleDisposableStack, K as UserRecovery, L as StdDisposableStack, M as isInteropObservableTrait, N as SYMBOL_ASYNC_DISPOSE, O as RxEventReplaySubject, P as SYMBOL_DISPOSABLE_STACK, R as createDisposableStack, U as ClientErrorKind, V as CLIENT_ERROR_SPAN_ATTRIBUTE_PROVIDER_ID, W as ClientErrorSource, a as ResourceSnapshotUpdateKind, c as whenResourceSnapshotValue, d as ResourceErrorCode, f as CancellationToken, i as rxResource, j as SYMBOL_OBSERVABLE, k as RxEventStream, l as ResourceStatus, m as isCancellationTokenTrait, n as mapResource, o as flattenResourceSnapshot, p as createCancellationTokenSource, r as resourceFromSnapshots, s as reduceResourceSnapshot, u as ResourceError, z as injectDisposableStackFrom } from "./rx-DM6Ouv-m.mjs";
2
- import { a as createJsonRpcServerAndClient, c as createSignal, d as readErrorPresentationDescriptor, f as SpanSharedAttributeName, i as createJsonRpcServer, l as readonlySignal, n as PopupServerWindowHandle, o as PopupErrorCode, r as createJsonRpcClient, s as readPopupErrorPresentationDescriptor, t as PopupClientWindowHandle, u as formatClientErrorContext } from "./handle-DwMgqe7R.mjs";
3
- import { $ as notMissingProvider, A as SECURITYDEPT_COMPAT_FRAGMENT_VERSION, B as validateWithSchema, C as SPAN_TRAIT_TOKEN, D as RouterNavigationIntent, E as ROUTER_TRAIT_TOKEN, F as POPUP_TRAIT_TOKEN, G as INJECTOR_TOKEN, H as PAGE_LIFECYCLE_TRAIT_TOKEN, I as PopupAttachFailureReason, J as toRuntimeInjector, K as PARENT_INJECTOR_TOKEN, L as formatValidationFailure, M as isCompatFragmentBlock, N as parseCompatFragment, O as RouterNavigationMode, P as takeCompatFragment, Q as getSecuritydeptProviderToken, R as throwValidationClientError, S as createRootSpan, T as TIME_TRAIT_TOKEN, U as EventSourceKind, V as validateWithSchemaSync, W as isEventStreamTrait, X as SecuritydeptInjectionToken, Y as SecurityDeptOptional, Z as createProviderIfTokenMissing, _ as createTimeForStd, a as TRACING_TRAIT_TOKEN, b as normalizeAbortError, c as createInMemoryRecordStore, d as SESSION_STORAGE_TRAIT_TOKEN, f as StorageChangeEventOrigin, g as TransportErrorCode, h as TRANSPORT_TRAIT_TOKEN, i as TRACING_SPAN_ATTRIBUTE_PROVIDER_ID, j as appendOrReplaceCompatFragment, k as takeCompatFragmentFromRouter, l as PERSISTENT_STORAGE_TRAIT_TOKEN, m as createBaseTransportForStdFetch, n as ENVIRONMENT_TOKEN, o as TracingLevel, p as FetchTransportRedirectKind, q as SecuritydeptInjector, r as OperationTraceEventType, s as createTracing, t as createFoundationEnvironment, u as REALM_STORAGE_TRAIT_TOKEN, v as abortSignalToCancellationToken, w as IDLE_CALLBACK_TRAIT_TOKEN, x as abortSignalToEventStream, y as cancellationTokenToAbortSignal, z as validateTraitInput } from "./create-i5VyYgN6.mjs";
1
+ import { A as RxEventSubject, B as withDisposableStack, E as RxComputedSignal, F as SYMBOL_DISPOSE, G as ErrorPresentationTone, H as ClientError, I as SimpleDisposableStack, K as UserRecovery, L as StdDisposableStack, M as isInteropObservableTrait, N as SYMBOL_ASYNC_DISPOSE, O as RxEventReplaySubject, P as SYMBOL_DISPOSABLE_STACK, R as createDisposableStack, U as ClientErrorKind, V as CLIENT_ERROR_SPAN_ATTRIBUTE_PROVIDER_ID, W as ClientErrorSource, a as ResourceSnapshotUpdateKind, c as whenResourceSnapshotValue, d as ResourceErrorCode, f as CancellationToken, i as rxResource, j as SYMBOL_OBSERVABLE, k as RxEventStream, l as ResourceStatus, m as isCancellationTokenTrait, n as mapResource, o as flattenResourceSnapshot, p as createCancellationTokenSource, r as resourceFromSnapshots, s as reduceResourceSnapshot, u as ResourceError, z as injectDisposableStackFrom } from "./rx-82t7QNQL.mjs";
2
+ import { a as createJsonRpcServerAndClient, c as createSignal, d as readErrorPresentationDescriptor, f as SpanSharedAttributeName, i as createJsonRpcServer, l as readonlySignal, n as PopupServerWindowHandle, o as PopupErrorCode, r as createJsonRpcClient, s as readPopupErrorPresentationDescriptor, t as PopupClientWindowHandle, u as formatClientErrorContext } from "./handle-DCHUG9HI.mjs";
3
+ import { $ as notMissingProvider, A as SECURITYDEPT_COMPAT_FRAGMENT_VERSION, B as validateWithSchema, C as SPAN_TRAIT_TOKEN, D as RouterNavigationIntent, E as ROUTER_TRAIT_TOKEN, F as POPUP_TRAIT_TOKEN, G as INJECTOR_TOKEN, H as PAGE_LIFECYCLE_TRAIT_TOKEN, I as PopupAttachFailureReason, J as toRuntimeInjector, K as PARENT_INJECTOR_TOKEN, L as formatValidationFailure, M as isCompatFragmentBlock, N as parseCompatFragment, O as RouterNavigationMode, P as takeCompatFragment, Q as getSecuritydeptProviderToken, R as throwValidationClientError, S as createRootSpan, T as TIME_TRAIT_TOKEN, U as EventSourceKind, V as validateWithSchemaSync, W as isEventStreamTrait, X as SecuritydeptInjectionToken, Y as SecurityDeptOptional, Z as createProviderIfTokenMissing, _ as createTimeForStd, a as TRACING_TRAIT_TOKEN, b as normalizeAbortError, c as createInMemoryRecordStore, d as SESSION_STORAGE_TRAIT_TOKEN, f as StorageChangeEventOrigin, g as TransportErrorCode, h as TRANSPORT_TRAIT_TOKEN, i as TRACING_SPAN_ATTRIBUTE_PROVIDER_ID, j as appendOrReplaceCompatFragment, k as takeCompatFragmentFromRouter, l as PERSISTENT_STORAGE_TRAIT_TOKEN, m as createBaseTransportForStdFetch, n as ENVIRONMENT_TOKEN, o as TracingLevel, p as FetchTransportRedirectKind, q as SecuritydeptInjector, r as OperationTraceEventType, s as createTracing, t as createFoundationEnvironment, u as REALM_STORAGE_TRAIT_TOKEN, v as abortSignalToCancellationToken, w as IDLE_CALLBACK_TRAIT_TOKEN, x as abortSignalToEventStream, y as cancellationTokenToAbortSignal, z as validateTraitInput } from "./create-BBdGfVCt.mjs";
4
4
  import { i as UriString, n as UriReferenceString, r as UriRelativeString, t as UriParseError } from "./uri-string-BPNbIMgv.mjs";
5
5
  import { v7 } from "uuid";
6
6
  import { inject as inject$1, runInInjectionContext as runInInjectionContext$1 } from "injection-js";
@@ -1,5 +1,5 @@
1
- import { H as ClientError, U as ClientErrorKind, k as RxEventStream } from "./rx-DM6Ouv-m.mjs";
2
- import { O as RouterNavigationMode, R as throwValidationClientError, V as validateWithSchemaSync, z as validateTraitInput } from "./create-i5VyYgN6.mjs";
1
+ import { H as ClientError, U as ClientErrorKind, k as RxEventStream } from "./rx-82t7QNQL.mjs";
2
+ import { O as RouterNavigationMode, R as throwValidationClientError, V as validateWithSchemaSync, z as validateTraitInput } from "./create-BBdGfVCt.mjs";
3
3
  import { n as UriReferenceString } from "./uri-string-BPNbIMgv.mjs";
4
4
  import { defer, distinctUntilChanged, filter, fromEventPattern, map, merge } from "rxjs";
5
5
  import { type } from "arktype";
@@ -242,4 +242,4 @@ function resolveRouterForNativeWebCreateOptions(options = {}) {
242
242
  //#endregion
243
243
  export { createPageLifecycleForNativeWeb as a, createRouterForNativeWeb as i, WebLegacyRouter as n, PageResumeTriggerKind as o, WebNavigationRouter as r, createPageResumeSource as s, NativeWebRouter as t };
244
244
 
245
- //# sourceMappingURL=router-at5bTdJQ.mjs.map
245
+ //# sourceMappingURL=router-BawAJQ1s.mjs.map