{"version":3,"file":"index.mjs","names":["_inject","sym","sym","storeToRefs","_useTranslation","_useTranslationsForField","_useTranslationsForComposable","fa6Solid","fa6Brands","isObject","_a","_zodDesc","util.jsonStringifyReplacer","initializer","core.$ZodAsyncError","util.finalizeIssue","core.config","errors.$ZodError","safeParse","errors.$ZodRealError","safeParseAsync","_emoji","string","boolean","util.nullish","util.codePointLength","util.getLengthableOrigin","regexes.lowercase","regexes.uppercase","util.escapeRegex","util.aborted","util.explicitlyAborted","core.$ZodAsyncError","util.hide","safeParse","safeParseAsync","regexes.string","regexes.guid","regexes.uuid","regexes.email","regexes.emoji","regexes.nanoid","regexes.nanoidOfLength","regexes.cuid","regexes.cuid2","regexes.ulid","regexes.xid","regexes.ksuid","regexes.datetime","regexes.date","regexes.time","regexes.duration","regexes.ipv4","regexes.ipv6","regexes.cidrv4","regexes.cidrv6","regexes.base64","regexes.base64url","regexes.e164","regexes.boolean","util.prefixIssues","util.finalizeIssue","core.config","util.cleanRegex","util.isPlainObject","core.$ZodEncodeError","util.issue","util.parsedType","util.stringifyPrimitive","util.joinValues","util.normalizeParams","checks.$ZodCheckMaxLength","checks.$ZodCheckMinLength","checks.$ZodCheckLengthEquals","checks.$ZodCheckRegex","checks.$ZodCheckLowerCase","checks.$ZodCheckUpperCase","checks.$ZodCheckIncludes","checks.$ZodCheckStartsWith","checks.$ZodCheckEndsWith","checks.$ZodCheckOverwrite","util.slugify","issue","util.issue","checks.$ZodCheck","core.formatError","core.flattenError","util.jsonStringifyReplacer","en","core.memoizer","util.mergeDefs","core.clone","checks.overwrite","util.hide","core.standardProps","parse.parse","parse.parseAsync","parse.safeParse","parse.safeParseAsync","parse.encode","parse.decode","parse.encodeAsync","parse.decodeAsync","parse.safeEncode","parse.safeDecode","parse.safeEncodeAsync","parse.safeDecodeAsync","processors.stringProcessor","checks.regex","checks.includes","checks.startsWith","checks.endsWith","checks.minLength","checks.maxLength","checks.length","checks.lowercase","checks.uppercase","checks.trim","checks.normalize","checks.toLowerCase","checks.toUpperCase","checks.slugify","core._email","core._url","core._jwt","core._emoji","core._guid","core._uuid","core._uuidv4","core._uuidv6","core._uuidv7","core._nanoid","core._cuid","core._cuid2","core._ulid","core._base64","core._base64url","core._xid","core._ksuid","core._ipv4","core._ipv6","core._cidrv4","core._cidrv6","core._e164","core._isoDateTime","core._isoDate","core._isoTime","core._isoDuration","core._string","processors.booleanProcessor","core._boolean","processors.arrayProcessor","core._array","processors.unionProcessor","util.normalizeParams","processors.intersectionProcessor","processors.transformProcessor","core.$ZodEncodeError","issue","util.issue","processors.optionalProcessor","processors.nullableProcessor","processors.defaultProcessor","util.shallowClone","processors.prefaultProcessor","processors.nonoptionalProcessor","processors.catchProcessor","core.util.constantCatch","processors.pipeProcessor","processors.readonlyProcessor","processors.customProcessor","core._refine","core._superRefine","create","create","isObject","isObject","APolicyInlineInfo","APolicySummary","elements","components"],"sources":["../src/core/cookie.ts","../src/core/color-mode.ts","../src/core/constants.ts","../src/core/error/module.ts","../src/core/inject.ts","../src/core/provide.ts","../src/core/http-client/authentication-hook/singleton.ts","../src/core/store/constants.ts","../src/core/store/dispatcher/constants.ts","../src/core/store/dispatcher/module.ts","../src/core/store/dispatcher/singleton.ts","../src/core/store/create.ts","../src/core/store/singleton.ts","../src/core/store/install.ts","../src/core/store/utils.ts","../src/core/http-client/authentication-hook/install.ts","../src/core/http-client/singleton.ts","../src/core/http-client/install.ts","../src/core/translator/error.ts","../src/core/hydration/singleton.ts","../src/core/hydration/value.ts","../src/core/translator/singleton.ts","../src/core/translator/helpers.ts","../src/core/translator/install.ts","../src/core/translator/locale.ts","../src/core/form/defaults.ts","../src/core/form/properties.ts","../src/core/query/build.ts","../src/core/query/sort.ts","../src/core/busy.ts","../src/core/oauth2/pkce.ts","../src/core/oauth2/authorization-request.ts","../src/core/permission-check/module.ts","../src/core/socket-manager/singleton.ts","../src/core/socket-manager/install.ts","../src/core/slot.ts","../src/core/validup.ts","../src/core/vuecs/module.ts","../src/components/utility/content-action/AContentAction.vue","../src/components/utility/content-action/AContentAction.vue","../../../node_modules/zod/v4/core/util.js","../../../node_modules/zod/v4/core/core.js","../../../node_modules/zod/v4/core/errors.js","../../../node_modules/zod/v4/core/parse.js","../../../node_modules/zod/v4/core/regexes.js","../../../node_modules/zod/v4/core/checks.js","../../../node_modules/zod/v4/core/versions.js","../../../node_modules/zod/v4/core/schemas.js","../../../node_modules/zod/v4/core/memoizer.js","../../../node_modules/zod/v4/locales/en.js","../../../node_modules/zod/v4/core/registries.js","../../../node_modules/zod/v4/core/api.js","../../../node_modules/zod/v4/core/to-json-schema.js","../../../node_modules/zod/v4/core/json-schema-processors.js","../../../node_modules/zod/v4/classic/errors.js","../../../node_modules/zod/v4/classic/parse.js","../../../node_modules/zod/v4/classic/schemas.js","../src/components/utility/form-input-list/AFormInputListItem.vue","../src/components/utility/form-input-list/AFormInputListItem.vue","../src/components/utility/form-input-list/AFormInputList.vue","../src/components/utility/form-input-list/AFormInputList.vue","../src/components/utility/pagination/APagination.ts","../src/components/utility/entity/collection/utils/component.ts","../src/components/utility/entity/collection/utils/options.ts","../src/components/utility/entity/collection/utils/handlers.ts","../src/components/utility/entity/collection/constants.ts","../src/components/utility/entity/collection/utils/search.ts","../src/utils/boolable-to-object.ts","../src/components/utility/entity/socket/module.ts","../src/components/utility/entity/collection/module.ts","../src/components/utility/entity/record/error.ts","../src/components/utility/entity/record/helpers.ts","../src/components/utility/entity/record/module.ts","../src/components/utility/toggle-button/AToggleButton.vue","../src/components/utility/toggle-button/AToggleButton.vue","../src/components/utility/toggle-button/module.ts","../src/components/utility/search/module.ts","../src/components/utility/search/ASearch.ts","../src/components/utility/entity/picker/module.ts","../src/components/utility/entity/AEntityDelete.ts","../src/components/utility/title/module.ts","../src/components/utility/title/ATitle.ts","../src/components/utility/ALanguageSwitcherDropdown.ts","../src/components/utility/AFormSubmit.ts","../src/components/utility/AAccountShell.vue","../src/components/utility/AAccountShell.vue","../src/components/utility/AColorModeSwitcher.vue","../src/components/utility/AColorModeSwitcher.vue","../src/components/utility/AAuthGadgets.vue","../src/components/utility/AAuthGadgets.vue","../src/components/utility/AAuthApp.vue","../src/components/utility/AAuthApp.vue","../src/components/utility/AAuthShell.vue","../src/components/utility/AAuthShell.vue","../src/components/utility/AAuthBackLink.vue","../src/components/utility/AAuthBackLink.vue","../src/components/utility/ANameInput.vue","../src/components/utility/ANameInput.vue","../src/components/utility/ASecretInput.vue","../src/components/utility/ASecretInput.vue","../src/components/entities/client/AClient.ts","../src/components/entities/realm/ARealm.ts","../src/composables/is-editing.ts","../src/composables/on-change.ts","../src/composables/updated-at.ts","../src/composables/use-permission-check.ts","../src/components/entities/realm/ARealmForm.vue","../src/components/entities/realm/ARealmForm.vue","../src/components/entities/realm/ARealmGrid.vue","../src/components/entities/realm/ARealmGrid.vue","../src/components/entities/realm/ARealms.ts","../src/components/entities/realm/ARealmPicker.ts","../src/components/entities/policy/APolicies.ts","../src/components/entities/policy/APolicyParentAssignment.ts","../src/components/entities/policy/APolicyPicker.vue","../src/components/entities/policy/APolicyPicker.vue","../src/components/entities/client/AClientSecretRotate.vue","../src/components/entities/client/AClientSecretRotate.vue","../src/components/entities/client/AClientForm.vue","../src/components/entities/client/AClientForm.vue","../src/components/entities/client/AClients.ts","../src/components/entities/client/AClientPicker.ts","../src/components/entities/permission/APermission.ts","../src/components/entities/permission/APermissionCheck.ts","../src/components/entities/permission/APermissionForm.vue","../src/components/entities/permission/APermissionForm.vue","../src/components/entities/permission/APermissions.ts","../src/components/entities/policy/policy-type.ts","../src/components/entities/policy/APolicyTypeBadge.vue","../src/components/entities/policy/APolicyTypeBadge.vue","../src/components/entities/policy/APolicyDetailNav.vue","../src/components/entities/policy/APolicyDetailNav.vue","../src/components/entities/policy/APolicyInlineInfo.vue","../src/components/entities/policy/APolicyInlineInfo.vue","../src/components/entities/policy/APolicySummary.vue","../src/components/entities/policy/APolicySummary.vue","../src/components/entities/permission-policy-binding/APermissionPolicyBindingButton.ts","../src/components/entities/client-permission/AClientPermissionAssignment.vue","../src/components/entities/client-permission/AClientPermissionAssignment.vue","../src/components/entities/client-permission/AClientPermissionAssignments.vue","../src/components/entities/client-permission/AClientPermissionAssignments.vue","../src/components/entities/role/ARoleForm.vue","../src/components/entities/role/ARoleForm.vue","../src/components/entities/role/ARoles.ts","../src/components/entities/role/ARole.ts","../src/components/entities/client-role/AClientRoleAssignment.vue","../src/components/entities/client-role/AClientRoleAssignment.vue","../src/components/entities/client-role/AClientRoleAssignments.vue","../src/components/entities/client-role/AClientRoleAssignments.vue","../src/components/entities/client-scope/AClientScope.ts","../src/components/entities/client-scope/AClientScopes.ts","../src/components/entities/scope/AScopeForm.vue","../src/components/entities/scope/AScopeForm.vue","../src/components/entities/scope/AScopes.ts","../src/components/entities/scope/AScope.ts","../src/components/entities/client-scope/AClientScopeAssignment.vue","../src/components/entities/client-scope/AClientScopeAssignment.vue","../src/components/entities/client-scope/AClientScopeAssignments.vue","../src/components/entities/client-scope/AClientScopeAssignments.vue","../src/components/entities/consent/AConsents.ts","../src/components/entities/event/AEvents.ts","../src/components/entities/identity-provider/AIdentityProvider.ts","../src/components/entities/identity-provider/AIdentityProviderBasicFields.vue","../src/components/entities/identity-provider/AIdentityProviderBasicFields.vue","../src/components/entities/identity-provider/AIdentityProviderLdapConnectionFields.vue","../src/components/entities/identity-provider/AIdentityProviderLdapConnectionFields.vue","../src/components/entities/identity-provider/AIdentityProviderLdapCredentialsFields.vue","../src/components/entities/identity-provider/AIdentityProviderLdapCredentialsFields.vue","../src/components/entities/identity-provider/AIdentityProviderLdapGroupFields.vue","../src/components/entities/identity-provider/AIdentityProviderLdapGroupFields.vue","../src/components/entities/identity-provider/AIdentityProviderLdapUserFields.vue","../src/components/entities/identity-provider/AIdentityProviderLdapUserFields.vue","../src/components/entities/identity-provider/protocol/utils.ts","../src/components/entities/identity-provider/AIdentityProviderProtocol.ts","../src/components/entities/identity-provider/AIdentityProviderLdapForm.vue","../src/components/entities/identity-provider/AIdentityProviderLdapForm.vue","../src/components/entities/identity-provider/preset/utils.ts","../src/components/entities/identity-provider/AIdentityProviderPreset.ts","../src/components/entities/identity-provider/AIdentityProviderPicker.vue","../src/components/entities/identity-provider/AIdentityProviderPicker.vue","../src/components/entities/identity-provider/AIdentityProviderOAuth2ClientFields.vue","../src/components/entities/identity-provider/AIdentityProviderOAuth2ClientFields.vue","../src/components/entities/identity-provider/AIdentityProviderOAuth2Discovery.vue","../src/components/entities/identity-provider/AIdentityProviderOAuth2Discovery.vue","../src/components/entities/identity-provider/AIdentityProviderOAuth2EndpointFields.vue","../src/components/entities/identity-provider/AIdentityProviderOAuth2EndpointFields.vue","../src/components/entities/identity-provider/AIdentityProviderOAuth2Form.vue","../src/components/entities/identity-provider/AIdentityProviderOAuth2Form.vue","../src/components/entities/identity-provider/AIdentityProviderForm.vue","../src/components/entities/identity-provider/AIdentityProviderForm.vue","../src/components/entities/identity-provider/AIdentityProviders.ts","../src/components/entities/identity-provider/AIdentityProviderIcon.vue","../src/components/entities/identity-provider/AIdentityProviderIcon.vue","../src/components/entities/identity-provider-account/AIdentityProviderAccounts.ts","../src/components/entities/identity-provider-role/AIdentityProviderRoleAssignment.vue","../src/components/entities/identity-provider-role/AIdentityProviderRoleAssignment.vue","../src/components/entities/identity-provider-role/AIdentityProviderRoleAssignments.vue","../src/components/entities/identity-provider-role/AIdentityProviderRoleAssignments.vue","../src/components/entities/key/AKey.ts","../src/components/entities/key/AKeys.ts","../src/components/entities/key/AKeyForm.vue","../src/components/entities/key/AKeyForm.vue","../src/components/entities/policy/attribute-names/AAttributeNamesPolicyForm.vue","../src/components/entities/policy/attribute-names/AAttributeNamesPolicyForm.vue","../src/components/entities/policy/composite/ACompositePolicyForm.vue","../src/components/entities/policy/composite/ACompositePolicyForm.vue","../src/components/entities/policy/date/ADatePolicyForm.vue","../src/components/entities/policy/date/ADatePolicyForm.vue","../src/components/entities/policy/identity/AIdentityPolicyForm.vue","../src/components/entities/policy/identity/AIdentityPolicyForm.vue","../src/components/entities/policy/realm-match/ARealmMatchPolicyForm.vue","../src/components/entities/policy/realm-match/ARealmMatchPolicyForm.vue","../src/components/entities/policy/time/ATimePolicyForm.vue","../src/components/entities/policy/time/ATimePolicyForm.vue","../src/components/entities/policy/APolicy.ts","../src/components/entities/policy/APolicyTypePicker.vue","../src/components/entities/policy/APolicyTypePicker.vue","../src/components/entities/policy/APolicyBasicForm.vue","../src/components/entities/policy/APolicyBasicForm.vue","../src/components/entities/policy/APolicyForm.vue","../src/components/entities/policy/APolicyForm.vue","../src/components/entities/permission-client/APermissionClientAssignments.vue","../src/components/entities/permission-client/APermissionClientAssignments.vue","../src/components/entities/permission-policy/APermissionPolicyAssignment.vue","../src/components/entities/permission-policy/APermissionPolicyAssignment.vue","../src/components/entities/permission-policy/APermissionPolicyAssignments.vue","../src/components/entities/permission-policy/APermissionPolicyAssignments.vue","../src/components/entities/role-permission/ARolePermissionAssignment.vue","../src/components/entities/role-permission/ARolePermissionAssignment.vue","../src/components/entities/role-permission/ARolePermissionAssignments.vue","../src/components/entities/role-permission/ARolePermissionAssignments.vue","../src/components/entities/permission-role/APermissionRoleAssignments.vue","../src/components/entities/permission-role/APermissionRoleAssignments.vue","../src/components/entities/user-permission/AUserPermissionAssignment.vue","../src/components/entities/user-permission/AUserPermissionAssignment.vue","../src/components/entities/user-permission/AUserPermissionAssignments.vue","../src/components/entities/user-permission/AUserPermissionAssignments.vue","../src/components/entities/user/AUser.ts","../src/components/entities/user/AUserForm.vue","../src/components/entities/user/AUserForm.vue","../src/components/entities/user/AUsers.ts","../src/components/entities/user/AUserPasswordForm.vue","../src/components/entities/user/AUserPasswordForm.vue","../src/components/entities/permission-user/APermissionUserAssignments.vue","../src/components/entities/permission-user/APermissionUserAssignments.vue","../src/components/entities/role-client/ARoleClientAssignments.vue","../src/components/entities/role-client/ARoleClientAssignments.vue","../src/components/entities/user-role/AUserRoleAssignment.vue","../src/components/entities/user-role/AUserRoleAssignment.vue","../src/components/entities/user-role/AUserRoleAssignments.vue","../src/components/entities/user-role/AUserRoleAssignments.vue","../src/components/entities/role-user/ARoleUserAssignments.vue","../src/components/entities/role-user/ARoleUserAssignments.vue","../src/components/entities/scope-client/AScopeClientAssignments.vue","../src/components/entities/scope-client/AScopeClientAssignments.vue","../src/components/entities/session/ASessions.ts","../src/components/entities/session-token/ASessionTokens.ts","../src/components/entities/trust-anchor/ATrustAnchor.ts","../src/components/entities/trust-anchor/ATrustAnchors.ts","../src/components/entities/trust-anchor/ATrustAnchorForm.vue","../src/components/entities/trust-anchor/ATrustAnchorForm.vue","../src/components/entities/user-authenticator/constants.ts","../src/components/entities/user-authenticator/AUserAuthenticatorEnroll.vue","../src/components/entities/user-authenticator/AUserAuthenticatorEnroll.vue","../src/components/entities/user-authenticator/AUserAuthenticators.vue","../src/components/entities/user-authenticator/AUserAuthenticators.vue","../src/components/entities/index.ts","../src/module.ts","../src/components/workflows/mfa/AMfaChallengeForm.vue","../src/components/workflows/mfa/AMfaChallengeForm.vue","../src/components/workflows/login/LoginForm.vue","../src/components/workflows/login/LoginForm.vue","../src/components/workflows/authorize/AAccountPrompt.vue","../src/components/workflows/authorize/AAccountPrompt.vue","../src/components/workflows/authorize/AuthorizeScope.vue","../src/components/workflows/authorize/AuthorizeScope.vue","../src/components/workflows/authorize/AuthorizeScopes.vue","../src/components/workflows/authorize/AuthorizeScopes.vue","../src/components/workflows/authorize/AuthorizeText.vue","../src/components/workflows/authorize/AuthorizeText.vue","../src/components/workflows/authorize/AuthorizeForm.vue","../src/components/workflows/authorize/AuthorizeForm.vue","../src/components/workflows/authorize/AuthorizeRealmMismatch.vue","../src/components/workflows/authorize/AuthorizeRealmMismatch.vue","../src/components/workflows/authorize/AuthorizeSilentRedirect.vue","../src/components/workflows/authorize/AuthorizeSilentRedirect.vue","../src/components/workflows/authorize/Authorize.vue","../src/components/workflows/authorize/Authorize.vue","../src/components/workflows/end-session/AEndSessionForm.vue","../src/components/workflows/end-session/AEndSessionForm.vue","../src/components/workflows/password/PasswordForgotForm.vue","../src/components/workflows/password/PasswordForgotForm.vue","../src/components/workflows/password/PasswordResetForm.vue","../src/components/workflows/password/PasswordResetForm.vue","../src/components/workflows/register/ActivateForm.vue","../src/components/workflows/register/ActivateForm.vue","../src/components/workflows/register/RegisterForm.vue","../src/components/workflows/register/RegisterForm.vue","../src/components/workflows/AWorkflowDisabledNotice.vue","../src/components/workflows/AWorkflowDisabledNotice.vue","../src/index.ts"],"sourcesContent":["/*\n * Copyright (c) 2026.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport type { Ref } from 'vue';\nimport { ref, watch } from 'vue';\n\nfunction escapeRegExp(input: string): string {\n    return input.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&');\n}\n\nexport function readCookie(name: string) : string | undefined {\n    if (typeof document === 'undefined') {\n        return undefined;\n    }\n\n    const match = document.cookie.match(new RegExp(`(?:^|;\\\\s*)${escapeRegExp(name)}=([^;]+)`));\n    const value = match?.[1];\n    if (!value) {\n        return undefined;\n    }\n\n    // A malformed percent escape must degrade to the fallback value, not\n    // throw a URIError out of the app bootstrap.\n    try {\n        return decodeURIComponent(value);\n    } catch {\n        return undefined;\n    }\n}\n\n/**\n * Cookie-backed ref for non-Nuxt consumers, the counterpart of\n * `useCookie()` in client-admin-console. Client-side writes persist back\n * to the cookie; server-side there is no `document`, so the caller seeds\n * the value through `initial` (the auth console reads the cookie in\n * `renderAuthConsolePage` and hands it over via the hydration payload).\n */\nexport function createCookieRef(name: string, initial?: string, fallback = '') : Ref<string> {\n    const source = ref(initial || readCookie(name) || fallback);\n\n    if (typeof document !== 'undefined') {\n        watch(source, (value) => {\n            document.cookie = `${name}=${encodeURIComponent(value)}; path=/; max-age=31536000; SameSite=Lax`;\n        });\n    }\n\n    return source;\n}\n","/*\n * Copyright (c) 2026.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport type { ColorMode } from '@vuecs/design';\nimport { bindColorMode, isColorMode } from '@vuecs/design';\nimport { computed } from 'vue';\nimport { createCookieRef } from './cookie';\n\nconst COOKIE_NAME = 'vc-color-mode';\n\n/**\n * Non-Nuxt counterpart of `@vuecs/nuxt`'s `useColorMode()`: the shared\n * `vc-color-mode` cookie feeding `bindColorMode` from `@vuecs/design`.\n * One cookie name across every authup console, so the mode carries over\n * between surfaces served from a common origin.\n *\n * Where a server stamps the `.dark`/`.light` class onto the HTML shell\n * from the same cookie, pass its value as `initial` so this ref agrees\n * with the markup and nothing flashes before it takes over.\n */\nexport function createColorMode(initial?: string) {\n    const source = createCookieRef(COOKIE_NAME, initial, 'system');\n    const mode = computed<ColorMode>({\n        get: () => (isColorMode(source.value) ? source.value : 'system'),\n        set(value) {\n            source.value = value;\n        },\n    });\n\n    return bindColorMode(mode);\n}\n","/*\n * Copyright (c) 2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport type { ButtonSize } from '@vuecs/button';\n\n/**\n * Shared default size for buttons rendered by kit components.\n *\n * Every kit component that renders a `<VCButton>` exposes a `size` prop\n * defaulting to this constant, so sibling components render at the same\n * height by default. Change this single value to re-scale every kit button.\n */\nexport const DEFAULT_BUTTON_SIZE: ButtonSize = 'sm';\n","/*\n * Copyright (c) 2026.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { isObject } from '@authup/kit';\nimport type { ErrorContext } from './types';\n\n/**\n * Pull the structured `{ code, data, message, issues, status }` out of whatever\n * the caller caught. An authup server error arrives as a hapic `ClientError`\n * whose `response.data` is the serialized error body (`AuthupError.toJSON`\n * flattens `code` + `data` onto the top level and carries the validup\n * `issues`); a directly-thrown `AuthupError` or plain `Error` exposes the\n * same fields on itself. Duck-typed on purpose — no hapic import (it is not a\n * declared dependency, and its `isClientError` guard is `instanceof`-based, so\n * it would miss a non-hapic-instance error), works for both transports.\n */\nexport function extractErrorContext(error: unknown): ErrorContext {\n    if (!isObject(error)) {\n        return { message: typeof error === 'string' ? error : undefined };\n    }\n\n    const self = error as Record<string, any>;\n    const { response } = self;\n    const body: Record<string, any> = isObject(response) && isObject(response.data) ?\n        response.data :\n        self;\n\n    const status = isObject(response) && typeof response.status === 'number' ?\n        response.status :\n        undefined;\n\n    // The server-side body `message` is the most specific human string; the\n    // transport error's own `message` (e.g. hapic's \"Request failed\") is only\n    // the last resort.\n    let message: string | undefined;\n    if (typeof body.message === 'string') {\n        message = body.message;\n    } else if (typeof self.message === 'string') {\n        message = self.message;\n    }\n\n    return {\n        code: typeof body.code === 'string' ? body.code : undefined,\n        data: body,\n        message,\n        // Only validation (`BAD_REQUEST`) errors carry issues; a coded\n        // business error serializes an empty array.\n        issues: Array.isArray(body.issues) && body.issues.length > 0 ? body.issues : undefined,\n        status,\n    };\n}\n","/*\n * Copyright (c) 2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport type { App } from 'vue';\nimport { inject as _inject, hasInjectionContext } from 'vue';\n\nexport function inject<T = any>(\n    key: string | symbol,\n    instance?: App,\n) : T | undefined {\n    if (\n        instance &&\n        instance._context &&\n        instance._context.provides &&\n        instance._context.provides[key]\n    ) {\n        return instance._context.provides[key];\n    }\n\n    if (hasInjectionContext()) {\n        return _inject(key, undefined);\n    }\n\n    return undefined;\n}\n","/*\n * Copyright (c) 2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport type { App } from 'vue';\nimport { provide as _provide } from 'vue';\nimport { inject } from './inject';\n\nexport function provide(\n    key: string | symbol,\n    value: unknown,\n    app?: App,\n) {\n    if (typeof app === 'undefined') {\n        const val = inject(key);\n        if (typeof val !== 'undefined') {\n            return;\n        }\n\n        _provide(key, value);\n\n        return;\n    }\n\n    if (\n        app &&\n        app._context &&\n        app._context.provides &&\n        app._context.provides[key]\n    ) {\n        return;\n    }\n\n    app.provide(key, value);\n}\n","/*\n * Copyright (c) 2023.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport type { App } from 'vue';\nimport type { ClientAuthenticationHook } from '@authup/core-http-kit';\nimport { inject } from '../../inject';\nimport { provide } from '../../provide';\n\nconst sym = Symbol.for('AuthupHTTPClientAuthenticationHook');\n\nexport function injectHTTPClientAuthenticationHook(app?: App) : ClientAuthenticationHook {\n    const instance = inject<ClientAuthenticationHook>(sym, app);\n    if (!instance) {\n        throw new Error('The http client authentication hook has not been injected in the app context.');\n    }\n\n    return instance;\n}\n\nexport function hasHTTPClientAuthenticationHook(app?: App) : boolean {\n    try {\n        return !!injectHTTPClientAuthenticationHook(app);\n    } catch {\n        return false;\n    }\n}\n\nexport function provideHTTPClientAuthenticationHook(\n    refresher: ClientAuthenticationHook,\n    app?: App,\n) {\n    provide(sym, refresher, app);\n}\n","/*\n * Copyright (c) 2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nexport const STORE_ID = 'authup';\n\n/**\n * Path store cookies default to: the only one every surface on an origin is\n * guaranteed to read back. Narrow it per host via `cookiePath`.\n */\nexport const COOKIE_PATH = '/';\n\n/**\n * The store's auth phase, derived from state PRESENCE\n * (access/refresh token / realm / user) plus an in-flight interaction\n * marker.\n *\n * AUTHENTICATED means token + realm + user are present; validating\n * them against the server remains resolve()'s job. UNAUTHENTICATED means\n * no session artifact at all — a refresh-token-only store (the\n * access-token cookie expired, the refresh-token session cookie\n * survived) reads RESTORING.\n *\n * RESTORING is presence-derived, not progress-derived: it does NOT imply\n * a restore is in flight — an RT-only store reads RESTORING until some\n * caller runs resolve() (which either completes the session or clears\n * the artifacts). Consumers rendering on status should await resolve()\n * rather than treating RESTORING as a transient spinner state.\n */\nexport enum StoreAuthStatus {\n    UNAUTHENTICATED = 'unauthenticated',\n    AUTHENTICATING = 'authenticating',\n    RESTORING = 'restoring',\n    AUTHENTICATED = 'authenticated',\n}\n\n/**\n * How the current session became authenticated in this app instance:\n * an interactive password login, an authorization-code exchange, or a\n * cookie restore validated by resolve(). Stamped at the END of the\n * settled interaction and cleared by cleanup() — it is NOT derived from\n * status: a raw-seeded store can read `authenticated` with a null\n * origin, and a stamped origin survives artifact expiry until the next\n * cleanup().\n */\nexport enum StoreAuthOrigin {\n    LOGIN = 'login',\n    EXCHANGE = 'exchange',\n    RESTORE = 'restore',\n}\n","/*\n * Copyright (c) 2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\n/**\n * The store's event bus is a DERIVED layer over its state — every lifecycle\n * emission happens at a documented state transition, never as a parallel\n * source of truth. Emission semantics are frozen for backward compatibility\n * (plan 045): read the store's `status` / `lastAuthOrigin` state for new code.\n */\nexport enum StoreDispatcherEventName {\n    /** @deprecated Read the store's `status` (=== 'authenticating') instead. */\n    LOGGING_IN = 'loggingIn',\n    /** @deprecated Read the store's `lastAuthOrigin` (=== 'login') / `status` instead. */\n    LOGGED_IN = 'loggedIn',\n\n    /** @deprecated Read the store's `status` instead. */\n    LOGGING_OUT = 'loggingOut',\n    /** @deprecated Read the store's `status` (=== 'unauthenticated') instead. */\n    LOGGED_OUT = 'loggedOut',\n\n    // Emitted when a background token refresh fails and the session is torn\n    // down involuntarily (distinct from a user-initiated LOGGED_OUT, which\n    // already drives its own navigation).\n    SESSION_EXPIRED = 'sessionExpired',\n\n    /** @deprecated Read the store's `status` instead. */\n    RESOLVING = 'resolving',\n    /**\n     * @deprecated Read the store's `status` / `lastAuthOrigin` instead.\n     * Fires at the end of every resolve() that does not REJECT — including the\n     * unauthenticated no-op — so it means \"resolution completed\", not \"a\n     * session exists\" (a failed resolve() rejects without emitting it).\n     */\n    RESOLVED = 'resolved',\n\n    ACCESS_TOKEN_UPDATED = 'accessTokenUpdated',\n    ACCESS_TOKEN_EXPIRE_DATE_UPDATED = 'accessTokenExpireDateUpdated',\n\n    REFRESH_TOKEN_UPDATED = 'refreshTokenUpdated',\n\n    ID_TOKEN_UPDATED = 'idTokenUpdated',\n\n    USER_UPDATED = 'userUpdated',\n\n    REALM_UPDATED = 'realmUpdated',\n    REALM_MANAGEMENT_UPDATED = 'realmManagementUpdated',\n}\n","/*\n * Copyright (c) 2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { EventEmitter } from '@posva/event-emitter';\nimport type { StoreDispatcher, StoreDispatcherEvents } from './types';\n\nexport function createStoreDispatcher() : StoreDispatcher {\n    return new EventEmitter<StoreDispatcherEvents>();\n}\n","/*\n * Copyright (c) 2023.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport type { App } from 'vue';\nimport { inject } from '../../inject';\nimport { provide } from '../../provide';\nimport type { StoreDispatcher } from './types';\n\nconst sym = Symbol.for('AuthupStoreEventBus');\n\nexport function injectStoreDispatcher(app?: App) : StoreDispatcher {\n    const instance = inject<StoreDispatcher>(sym, app);\n    if (!instance) {\n        throw new Error('The store dispatcher has not been injected in the app context.');\n    }\n\n    return instance;\n}\n\nexport function provideStoreDispatcher(eventBus: StoreDispatcher, app?: App) {\n    provide(sym, eventBus, app);\n}\n","/*\n * Copyright (c) 2023.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport {\n    PermissionEvaluator,\n    PermissionMemoryProvider,\n    PolicyEngine,\n} from '@authup/access';\nimport { OAuth2Error, OAuth2SubKind } from '@authup/specs';\nimport type { IClient } from '@authup/core-http-kit';\nimport { computed, ref } from 'vue';\nimport type {\n    OAuth2TokenGrantResponse,\n    OAuth2TokenIntrospectionResponse,\n} from '@authup/specs';\nimport { REALM_MASTER_NAME } from '@authup/core-kit';\nimport { Client } from '@authup/core-http-kit';\nimport { extractErrorContext } from '../error';\nimport { StoreAuthOrigin, StoreAuthStatus } from './constants';\nimport { StoreDispatcherEventName } from './dispatcher';\nimport type {\n    RealmMinimal,\n    StoreCreateContext,\n    StoreLoginContext,\n    StoreLogoutOptions,\n    UserMinimal,\n} from './types';\n\ntype InputFn = (...args: any[]) => Promise<any>;\ntype OutputFn<F extends InputFn> = (...args: Parameters<F>) => Promise<Awaited<ReturnType<F>>>;\n\nfunction createPromiseShareWrapperFn<F extends InputFn>(\n    fn: F,\n) : OutputFn<F> {\n    let promise : Promise<Awaited<ReturnType<F>>> | undefined;\n\n    return (...args: Parameters<F>) => {\n        if (promise) {\n            return promise;\n        }\n\n        promise = new Promise<Awaited<ReturnType<F>>>(\n            (resolve, reject) => {\n                fn(...args)\n                    .then((r) => resolve(r))\n                    .catch((e) => reject(e));\n            },\n        );\n\n        // not .finally(): the derived promise it returns would reject\n        // unobserved whenever the shared promise rejects (unhandledrejection\n        // on every failed refresh/resolve).\n        const clear = () => {\n            setTimeout(() => {\n                promise = undefined;\n            }, 0);\n        };\n        promise.then(clear, clear);\n\n        return promise;\n    };\n}\n\nexport function createStore(context: StoreCreateContext) {\n    const client : IClient = context.httpClient ?? new Client({ baseURL: context.baseURL });\n\n    const cookiesRead = ref<boolean>(false);\n    /**\n     * @deprecated Kit-internal hydration bookkeeping — not part of the supported surface.\n     * Kept as a working shim (kit cookie hydration + downstream seeding);\n     * slated for removal in a future major.\n     */\n    const setCookiesRead = (value: boolean) => {\n        cookiesRead.value = value;\n    };\n\n    // --------------------------------------------------------------------\n\n    const accessToken = ref<string | null>(null);\n    /**\n     * @deprecated Raw token mutation — use login()/logout()/resolve() (or applyTokenGrantResponse for a grant response) instead.\n     * Kept as a working shim (kit cookie hydration + downstream seeding);\n     * slated for removal in a future major.\n     */\n    const setAccessToken = (input: string | null) => {\n        accessToken.value = input;\n\n        context.dispatcher.emit(\n            StoreDispatcherEventName.ACCESS_TOKEN_UPDATED,\n            input,\n        );\n    };\n\n    // --------------------------------------------------------------------\n\n    const accessTokenExpireDate = ref<Date | null>(null);\n    /**\n     * @deprecated Raw token mutation — the expire date is derived from grant/introspection responses.\n     * Kept as a working shim (kit cookie hydration + downstream seeding);\n     * slated for removal in a future major.\n     */\n    const setAccessTokenExpireDate = (input: Date | number | string | null) => {\n        if (typeof input === 'number' || typeof input === 'string') {\n            accessTokenExpireDate.value = new Date(input); // verify microseconds or seconds\n        } else {\n            accessTokenExpireDate.value = input;\n        }\n\n        context.dispatcher.emit(\n            StoreDispatcherEventName.ACCESS_TOKEN_EXPIRE_DATE_UPDATED,\n            accessTokenExpireDate.value,\n        );\n    };\n\n    // --------------------------------------------------------------------\n\n    const refreshToken = ref<string | null>(null);\n    /**\n     * @deprecated Raw token mutation — use login()/logout()/resolve() (or applyTokenGrantResponse for a grant response) instead.\n     * Kept as a working shim (kit cookie hydration + downstream seeding);\n     * slated for removal in a future major.\n     */\n    const setRefreshToken = (input: string | null) => {\n        refreshToken.value = input;\n\n        context.dispatcher.emit(\n            StoreDispatcherEventName.REFRESH_TOKEN_UPDATED,\n            input,\n        );\n    };\n\n    // --------------------------------------------------------------------\n\n    // The OIDC id_token from the last grant response. Retained (+ cookie\n    // persisted) so a downstream RP logout can pass it as `id_token_hint` to\n    // the authup `end_session_endpoint` — otherwise every kit RP degrades to\n    // the click-gated confirm page.\n    const idToken = ref<string | null>(null);\n    /**\n     * @deprecated Raw token mutation — the id_token rides the grant response (applyTokenGrantResponse retains it across refreshes).\n     * Kept as a working shim (kit cookie hydration + downstream seeding);\n     * slated for removal in a future major.\n     */\n    const setIdToken = (input: string | null) => {\n        idToken.value = input;\n\n        context.dispatcher.emit(\n            StoreDispatcherEventName.ID_TOKEN_UPDATED,\n            input,\n        );\n    };\n\n    // --------------------------------------------------------------------\n\n    /**\n     * The token's subject, narrowed to what a consumer renders: the id every\n     * owner-scoped query filters on, the name / display name the account chip\n     * and the authorize page's \"continue as\" label read, and the address an\n     * avatar hash is derived from. A full `User` was held here once, at the\n     * cost of a `/userinfo` round-trip per restore.\n     */\n    const user = ref<UserMinimal | null>(null);\n    const userId = computed<string | null>(() => (user.value ? user.value.id : null));\n\n    // Narrowed at the sink like `setRealmManagement`: callers hand over whole\n    // entity rows (the account console re-seeds it from the profile form's\n    // response), and the ref is what the SSR payload carries.\n    const setUser = (input: UserMinimal | null) => {\n        user.value = input ? {\n            id: input.id,\n            name: input.name,\n            displayName: input.displayName,\n            email: input.email,\n        } : null;\n\n        context.dispatcher.emit(StoreDispatcherEventName.USER_UPDATED, user.value);\n    };\n\n    // --------------------------------------------------------------------\n\n    // The id of the session backing the current access token. Sourced from the\n    // token introspection response so the UI can mark \"this device\" and avoid a\n    // confusing silent self-logout on the current row.\n    const sessionId = ref<string | null>(null);\n\n    // The achieved OIDC acr of the current session's token (urn:authup:pwd |\n    // urn:authup:mfa), sourced from introspection. Lets the hosted authorize\n    // ladder skip a redundant second-factor prompt right after a login whose\n    // grant already verified the factor (otp param / MFA-pending ticket).\n    const acr = ref<string | null>(null);\n\n\n    // --------------------------------------------------------------------\n\n    const realm = ref<RealmMinimal | null>(null);\n    const realmId = computed<string | undefined>(() => (realm.value ? realm.value.id : undefined));\n    const realmName = computed<string | undefined>(() => (realm.value ? realm.value.name : undefined));\n    const realmIsRoot = computed<boolean>(() => {\n        if (realm.value) {\n            return realm.value.name === REALM_MASTER_NAME;\n        }\n\n        return false;\n    });\n\n    /**\n     * @deprecated Raw identity mutation — the realm is derived from token introspection during resolve()/login().\n     * Kept as a working shim (kit cookie hydration + downstream seeding);\n     * slated for removal in a future major.\n     */\n    // Narrowed at the sink, not at the call sites: both realm refs are\n    // cookie-persisted, and callers hand over whole entity rows (the realm\n    // switcher passes the table row straight through), so the free-text\n    // `description` column would ride the header of every request. The\n    // display name is the one label the chrome renders, so it stays.\n    const pickRealm = (input: RealmMinimal) : RealmMinimal => ({\n        id: input.id,\n        name: input.name,\n        ...(typeof input.displayName !== 'undefined' ? { displayName: input.displayName } : {}),\n    });\n\n    const setRealm = (input: RealmMinimal | null) => {\n        realm.value = input ? pickRealm(input) : null;\n\n        context.dispatcher.emit(StoreDispatcherEventName.REALM_UPDATED, realm.value);\n    };\n\n    const realmManagement = ref<RealmMinimal | null>(null);\n    const realmManagementId = computed<string | undefined>(() => (realmManagement.value ? realmManagement.value.id : realmId.value));\n    const realmManagementName = computed<string | undefined>(() => (realmManagement.value ? realmManagement.value.name : realmName.value));\n\n    const setRealmManagement = (input: RealmMinimal | null) => {\n        realmManagement.value = input ? pickRealm(input) : null;\n\n        context.dispatcher.emit(\n            StoreDispatcherEventName.REALM_MANAGEMENT_UPDATED,\n            realmManagement.value,\n        );\n    };\n\n    // --------------------------------------------------------------------\n\n    const permissionProvider = new PermissionMemoryProvider();\n    const permissionEvaluator = new PermissionEvaluator({\n        provider: permissionProvider,\n        policyEngine: new PolicyEngine(),\n    });\n\n    // --------------------------------------------------------------------\n\n    // Marks an interactive login()/exchangeAuthorizationCode() in flight —\n    // status reads AUTHENTICATING for its whole duration, so consumers never\n    // have to interpret the intermediate token/realm/user writes.\n    const interactionInFlight = ref<StoreAuthOrigin.LOGIN | StoreAuthOrigin.EXCHANGE | null>(null);\n\n    // How the current session became authenticated in THIS app instance.\n    // Stamped by login()/exchangeAuthorizationCode() on success and by a\n    // resolve() that finds a session while no origin is set (cookie restore);\n    // a later resolve() never overwrites an interactive origin.\n    const lastAuthOrigin = ref<`${StoreAuthOrigin}` | null>(null);\n\n    // Presence-derived on purpose: reachable from the raw setter surface and\n    // from @pinia/nuxt payload hydration alike (an internal \"resolved\" flag\n    // would desync from the transferred refs). AUTHENTICATED = the state is\n    // complete, not \"server-validated\" — validation is resolve()'s job.\n    const status = computed<StoreAuthStatus>(() => {\n        if (interactionInFlight.value) {\n            return StoreAuthStatus.AUTHENTICATING;\n        }\n\n        if (context.cookieSession) {\n            // There is no token to derive presence from — the credential is an\n            // opaque `HttpOnly` cookie this code cannot read, so the session is\n            // exactly what the last resolve() brought back. RESTORING is\n            // therefore unreachable, which is load-bearing: a consumer that\n            // treats a settled RESTORING as a failed resolve (the account\n            // console's router guard does) would sign every cookie session out.\n            return realm.value && user.value ?\n                StoreAuthStatus.AUTHENTICATED :\n                StoreAuthStatus.UNAUTHENTICATED;\n        }\n\n        if (!accessToken.value) {\n            // A surviving refresh token is session presence too: the\n            // access-token cookie expires via maxAge while the refresh-token\n            // cookie is a session cookie, so an RT-only hydration is a normal\n            // restorable state — it must read RESTORING for the whole restore\n            // instead of flapping unauthenticated → restoring mid-resolve().\n            return refreshToken.value ?\n                StoreAuthStatus.RESTORING :\n                StoreAuthStatus.UNAUTHENTICATED;\n        }\n\n        return realm.value && user.value ?\n            StoreAuthStatus.AUTHENTICATED :\n            StoreAuthStatus.RESTORING;\n    });\n\n    // Bumped by cleanup(). An interaction/revalidation captures the value when\n    // it starts staging and its commit aborts when it changed — a logout that\n    // interleaved with the staged network round-trips must not be undone by a\n    // late commit (zombie-commit guard).\n    const tokenGeneration = ref(0);\n\n    // The current session has been validated (introspected) once in this app\n    // instance. Not returned: per-instance bookkeeping, deliberately NOT part\n    // of the hydration payload — a fresh instance always revalidates.\n    const validated = ref(false);\n\n    // A token refresh landed since the last commit: status stays\n    // authenticated, but the next resolve() runs an AWAITED revalidation\n    // (failure keeps routing into the navigation guards' catch).\n    const resolutionStale = ref(false);\n\n    // --------------------------------------------------------------------\n\n    // Returns the generation it bumped to: a caller staging a session MUST use\n    // that value (not a later tokenGeneration read) — the bump happens before\n    // the awaited revoke round-trips, so a concurrent interaction's cleanup()\n    // may bump again before this one resumes, and reading the ref afterwards\n    // would let both commits pass the guard (the loser's committed tokens\n    // would be clobbered without revocation).\n    const cleanup = async () : Promise<number> => {\n        const tempAccessToken = accessToken.value;\n        const tempRefreshToken = refreshToken.value;\n\n        setAccessToken(null);\n        setAccessTokenExpireDate(null);\n        setRefreshToken(null);\n        setIdToken(null);\n        setUser(null);\n        sessionId.value = null;\n        acr.value = null;\n        setRealm(null);\n        setRealmManagement(null);\n\n        lastAuthOrigin.value = null;\n\n        permissionProvider.setMany([]);\n\n        validated.value = false;\n        resolutionStale.value = false;\n        tokenGeneration.value += 1;\n        const generation = tokenGeneration.value;\n\n        try {\n            if (tempAccessToken) {\n                await client.token.revoke({ token: tempAccessToken });\n            }\n        } catch {\n            // ...\n        }\n\n        try {\n            if (tempRefreshToken) {\n                await client.token.revoke({ token: tempRefreshToken });\n            }\n        } catch {\n            // ...\n        }\n\n        return generation;\n    };\n\n    // --------------------------------------------------------------------\n\n    // Pure fetchers — they take the token explicitly and mutate nothing, so a\n    // session can be STAGED across multiple round-trips and committed in one\n    // synchronous block (no consumer ever observes a half-built store).\n\n    /**\n     * The `active` check is the point of the wrapper. The endpoint answers 200\n     * with the full payload for a token it will not honour - revoked, or past\n     * its expiry - so reading the claims alone commits a dead token as a live\n     * session: identity set, permissions set, validated true, right up until\n     * the next protected call 401s.\n     *\n     * Rejecting instead of returning a flag hands both staging sites the path\n     * they already have for an introspection that failed outright: a stale\n     * restore falls through to `refreshSession()`, and a fresh grant reverts\n     * and revokes what it staged.\n     */\n    const fetchTokenIntrospection = async (\n        token: string,\n    ) : Promise<OAuth2TokenIntrospectionResponse> => {\n        const response = await client.token.introspect<OAuth2TokenIntrospectionResponse>(\n            { token },\n            {\n                authorizationHeader: {\n                    type: 'Bearer',\n                    token,\n                },\n            },\n        );\n\n        if (!response.active) {\n            throw new OAuth2Error('The access token is not active.');\n        }\n\n        return response;\n    };\n\n    /**\n     * The introspected token's subject, built from the response itself: the\n     * introspection endpoint resolves the identity server-side and answers\n     * with its OpenID claims (`name`, `email`, and `displayName` under\n     * `nickname`), so a second `/userinfo` round-trip fetched a whole entity\n     * to restate fields the store already had in hand.\n     *\n     * Deriving it also settles the identity question the predecessor had to ask\n     * separately: the held user cannot drift from the token, because it IS the\n     * token's subject on every commit. A non-user subject yields null rather\n     * than a failed lookup — `/userinfo` resolves `@me` through the user\n     * service, which throws for a client actor and took the whole `resolve()`\n     * down with it.\n     */\n    const buildUser = (\n        introspection: OAuth2TokenIntrospectionResponse,\n    ) : UserMinimal | null => {\n        if (\n            introspection.sub_kind !== OAuth2SubKind.USER ||\n            !introspection.sub\n        ) {\n            return null;\n        }\n\n        const {\n            name,\n            nickname,\n            email,\n        } = introspection;\n\n        return {\n            id: introspection.sub,\n            name: name || '',\n            displayName: nickname || null,\n            email: email || '',\n        };\n    };\n\n    type SessionCommitContextBase = {\n        // tokenGeneration captured when staging started\n        generation: number,\n        // tokens to apply — absent for a revalidation of the current token\n        grant?: OAuth2TokenGrantResponse,\n        introspection: OAuth2TokenIntrospectionResponse,\n        // login/exchange stamp explicitly; a restore stamps only when unset\n        origin?: StoreAuthOrigin.LOGIN | StoreAuthOrigin.EXCHANGE,\n    };\n\n    /**\n     * `tokenless` is an EXPLICIT discriminator, not a derived one. Cookie mode\n     * commits a session that has no token at all, and the guards below ask\n     * \"is this still the current token\" — left to `ctx.token ===\n     * accessToken.value` that comparison would be decided by an\n     * `undefined === null` accident and answer false forever, permanently\n     * skipping the `resolutionStale` clear.\n     */\n    type SessionCommitContext = SessionCommitContextBase & (\n        {\n            tokenless?: false,\n            // the token introspection ran against\n            token: string,\n        } | {\n            tokenless: true,\n            token?: undefined,\n        }\n    );\n\n    // The single synchronous write path for a staged session. The write order\n    // is load-bearing (expire date before access token — the cookie listener\n    // derives the token cookie's maxAge from the already-written expire date)\n    // and nothing in here may await. Atomicity holds for the reactive layer;\n    // dispatcher subscribers (cookie sync, auth hook) still observe the\n    // individual setter events synchronously, exactly as before.\n    const commitSession = (ctx: SessionCommitContext) : boolean => {\n        if (ctx.generation !== tokenGeneration.value) {\n            return false;\n        }\n\n        if (ctx.grant) {\n            applyTokenGrantResponse(ctx.grant);\n        }\n\n        // A tokenless commit is always current: nothing can rotate a token\n        // that does not exist.\n        const tokenIsCurrent = ctx.tokenless ?\n            true :\n            ctx.token === accessToken.value;\n\n        // A background hook refresh may have rotated the token while a\n        // revalidation's introspection was in flight — never re-arm the\n        // expire date (and thus the refresh timer) from a superseded token.\n        // Cookie mode never arms it at all: an expire date would start a\n        // refresh timer with no refresh token behind it.\n        if (tokenIsCurrent && !ctx.tokenless && ctx.introspection.exp) {\n            setAccessTokenExpireDate(new Date(ctx.introspection.exp * 1000));\n        }\n\n        if (ctx.introspection.session_id) {\n            sessionId.value = ctx.introspection.session_id;\n        }\n\n        acr.value = ctx.introspection.acr ?? null;\n\n        if (\n            ctx.introspection.realm_id &&\n            ctx.introspection.realm_name\n        ) {\n            // deliberate direct write (not setRealm): a REALM_UPDATED emit\n            // would start persisting a realm cookie for the first time and\n            // open a pre-resolve staleness surface (plan 045 review).\n            realm.value = {\n                id: ctx.introspection.realm_id,\n                name: ctx.introspection.realm_name,\n            };\n\n            if (!realmManagement.value) {\n                setRealmManagement(realm.value);\n            }\n        }\n\n        // Only the subject IDENTITY is authoritative here. A held user with the\n        // same id is at least as fresh as these claims — the account console\n        // re-seeds it from its own profile-form response — and a commit staged\n        // before such a save would otherwise revert the name it just wrote. The\n        // predecessor kept it for the same reason: `isTokenSubject` skipped the\n        // fetch on an id match.\n        const subject = buildUser(ctx.introspection);\n        if (!user.value || user.value.id !== subject?.id) {\n            setUser(subject);\n        }\n\n        if (ctx.introspection.permissions) {\n            permissionProvider.setMany(ctx.introspection.permissions.map((permission) => ({\n                permission: {\n                    name: permission.name,\n                    realmId: permission.realm_id,\n                    clientId: permission.client_id,\n                },\n            })));\n        }\n\n        validated.value = true;\n\n        // A background hook refresh that rotated the token mid-staging set the\n        // flag for the NEW token — clearing it for a superseded commit would\n        // skip the promised awaited revalidation on the next resolve().\n        if (tokenIsCurrent) {\n            resolutionStale.value = false;\n        }\n\n        if (ctx.origin) {\n            lastAuthOrigin.value = ctx.origin;\n        } else if (!lastAuthOrigin.value) {\n            lastAuthOrigin.value = StoreAuthOrigin.RESTORE;\n        }\n\n        return true;\n    };\n\n    // A staged grant that will never be committed (failure or abort) must be\n    // revoked best-effort: the tokens were never written to any ref or cookie,\n    // so no later logout() could reach them — without this, a transient\n    // introspection failure orphans a live server session.\n    const revokeStagedGrant = async (response: OAuth2TokenGrantResponse) => {\n        try {\n            await client.token.revoke({ token: response.access_token });\n        } catch {\n            // best-effort\n        }\n\n        if (response.refresh_token) {\n            try {\n                await client.token.revoke({ token: response.refresh_token });\n            } catch {\n                // best-effort\n            }\n        }\n    };\n\n    // --------------------------------------------------------------------\n\n    const applyTokenGrantResponse = (\n        response: OAuth2TokenGrantResponse,\n    ) => {\n        const expireDate = new Date(Date.now() + response.expires_in * 1000);\n\n        setAccessTokenExpireDate(expireDate);\n        setAccessToken(response.access_token);\n\n        if (response.refresh_token) {\n            setRefreshToken(response.refresh_token);\n        } else {\n            setRefreshToken(null);\n        }\n\n        // A refresh grant response carries no id_token — keep the retained one\n        // rather than clearing it (the session is unchanged).\n        if (response.id_token) {\n            setIdToken(response.id_token);\n        }\n\n        // A bare token apply leaves the identity data (realm/user/permissions)\n        // unrefreshed — the next resolve() runs an awaited revalidation.\n        // commitSession() clears the flag again right after it applies a\n        // grant, so only token-only updates (refresh grants) stay stale.\n        resolutionStale.value = true;\n    };\n\n    // --------------------------------------------------------------------\n\n    const refreshSession = createPromiseShareWrapperFn(\n        async (): Promise<void> => {\n            if (!refreshToken.value) {\n                throw new OAuth2Error('The access token can not be renewed.');\n            }\n\n            const generation = tokenGeneration.value;\n\n            let response : OAuth2TokenGrantResponse;\n            try {\n                response = await client.token.createWithRefreshToken({ refresh_token: refreshToken.value });\n            } catch (e) {\n                // a cleanup() that interleaved with the round-trip already\n                // tore the state down — don't tear it down a second time.\n                if (generation === tokenGeneration.value) {\n                    await cleanup();\n                }\n\n                throw e;\n            }\n\n            // Zombie-commit guard (same contract as commitSession): a logout\n            // that landed while the refresh round-trip was in flight stays\n            // final — the late grant is dropped and revoked best-effort (it\n            // was never written, so no later logout() could reach it).\n            if (generation !== tokenGeneration.value) {\n                await revokeStagedGrant(response);\n\n                throw new OAuth2Error('The session was torn down before the token could be refreshed.');\n            }\n\n            // marks the resolution stale: status stays authenticated,\n            // the next resolve() revalidates (awaited).\n            applyTokenGrantResponse(response);\n        },\n    );\n\n    // --------------------------------------------------------------------\n\n    // Stage the introspection for the current token and commit. Returns\n    // silently when the commit was aborted\n    // by an interleaved cleanup() — the caller's post-state (unauthenticated) is\n    // already what the user asked for.\n    const revalidate = async () : Promise<void> => {\n        const generation = tokenGeneration.value;\n        const token = accessToken.value;\n        if (!token) {\n            return;\n        }\n\n        const introspection = await fetchTokenIntrospection(token);\n\n        commitSession({\n            generation,\n            token,\n            introspection,\n        });\n    };\n\n    /**\n     * Cookie mode's counterpart to `revalidate()`. The session context comes\n     * from `GET /sessions/@me/introspect`, which answers the same projection the\n     * introspection endpoint builds for a bearer — so `commitSession` needs no\n     * shape of its own.\n     *\n     * There is nothing to renew here: the credential either still names a live\n     * session or it does not. A 401 means the session is gone and clears stale\n     * identity state; other failures still propagate to the caller.\n     */\n    const revalidateCookieSession = async () : Promise<void> => {\n        const generation = tokenGeneration.value;\n\n        let introspection : OAuth2TokenIntrospectionResponse;\n        try {\n            introspection = await client.account.getSession();\n        } catch (e) {\n            if (extractErrorContext(e).status !== 401) {\n                throw e;\n            }\n\n            if (generation === tokenGeneration.value && (user.value || realm.value)) {\n                await cleanup();\n            }\n\n            return;\n        }\n\n        if (generation !== tokenGeneration.value) {\n            return;\n        }\n\n        if (!introspection.active) {\n            // The credential is gone, or its session ended server-side. Drop\n            // whatever this instance still holds so the app renders signed out\n            // rather than a stale identity.\n            if (user.value || realm.value) {\n                await cleanup();\n            }\n\n            return;\n        }\n\n        commitSession({\n            generation,\n            tokenless: true,\n            introspection,\n        });\n    };\n\n    // todo: rename to reload() ?\n    const resolveInternal = async () : Promise<void> => {\n        context.dispatcher.emit(StoreDispatcherEventName.RESOLVING);\n\n        if (context.cookieSession) {\n            // Unconditional, unlike the bearer branch below: the credential is\n            // an opaque cookie this code cannot inspect, the authentication\n            // hook is inert here and nothing pushes a revocation, so a\n            // `validated` short-circuit would leave a session that ended\n            // elsewhere (another tab's sign-out, an admin force-logout, a\n            // lapsed row) rendering as signed in until a reload. One small\n            // GET /sessions/@me/introspect per navigation is the price of\n            // noticing that on the next one.\n            await revalidateCookieSession();\n\n            if (user.value && !lastAuthOrigin.value) {\n                lastAuthOrigin.value = StoreAuthOrigin.RESTORE;\n            }\n\n            context.dispatcher.emit(StoreDispatcherEventName.RESOLVED);\n\n            return;\n        }\n\n        if (\n            !accessToken.value &&\n            refreshToken.value\n        ) {\n            await refreshSession();\n        }\n\n        if (\n            accessToken.value &&\n            (!validated.value || resolutionStale.value)\n        ) {\n            try {\n                await revalidate();\n            } catch (e) {\n                // a still-valid refresh token may recover the session\n                if (refreshToken.value) {\n                    await refreshSession();\n                    await revalidate();\n                } else {\n                    throw e;\n                }\n            }\n        }\n\n        // A session found by resolve() with no origin set is a restore\n        // (cookie hydration / raw seeding); never overwrite an interactive\n        // origin — a later resolve() on a logged-in session is a no-op here.\n        if (accessToken.value && !lastAuthOrigin.value) {\n            lastAuthOrigin.value = StoreAuthOrigin.RESTORE;\n        }\n\n        context.dispatcher.emit(StoreDispatcherEventName.RESOLVED);\n    };\n\n    const resolve = createPromiseShareWrapperFn(resolveInternal);\n\n    /**\n     * @deprecated Coarse \"a token exists\" flag — read {@link status} instead\n     * (AUTHENTICATED additionally implies realm + user are present).\n     */\n    const loggedIn = computed<boolean>(() => !!accessToken.value);\n    // Stage the introspection for a fresh grant, then commit\n    // atomically. On failure or an aborted commit the staged tokens are\n    // revoked best-effort — nothing was written, so nothing else could.\n    // `generation` is captured by the caller BEFORE its first round-trip, so\n    // a logout anywhere in the staged window aborts the commit.\n    const establishSession = async (\n        response: OAuth2TokenGrantResponse,\n        origin: StoreAuthOrigin.LOGIN | StoreAuthOrigin.EXCHANGE,\n        generation: number,\n    ) : Promise<void> => {\n        let committed = false;\n\n        try {\n            const introspection = await fetchTokenIntrospection(response.access_token);\n\n            committed = commitSession({\n                generation,\n                token: response.access_token,\n                grant: response,\n                introspection,\n                origin,\n            });\n        } finally {\n            if (!committed) {\n                await revokeStagedGrant(response);\n            }\n        }\n\n        if (!committed) {\n            throw new OAuth2Error('The session was torn down before the login could be established.');\n        }\n    };\n\n    const login = async (ctx: StoreLoginContext) => {\n        context.dispatcher.emit(StoreDispatcherEventName.LOGGING_IN);\n\n        interactionInFlight.value = StoreAuthOrigin.LOGIN;\n\n        try {\n            const response = await client.token.createWithPassword({\n                username: ctx.name,\n                password: ctx.password,\n                ...(ctx.realmId ? { realm_id: ctx.realmId } : {}),\n                ...(ctx.otp ? { otp: ctx.otp } : {}),\n            });\n\n            // Clear any previous identity's state (notably a retained id_token —\n            // a password response carries none, and the atomic commit would\n            // keep the stale one) and best-effort revoke its tokens before\n            // establishing the fresh session (plan 047.3). The staged window's\n            // snapshot is the generation cleanup() itself bumped to — never a\n            // later ref read, which a concurrent interaction may have bumped.\n            const generation = await cleanup();\n\n            await establishSession(response, StoreAuthOrigin.LOGIN, generation);\n        } finally {\n            interactionInFlight.value = null;\n        }\n\n        context.dispatcher.emit(StoreDispatcherEventName.LOGGED_IN);\n    };\n\n    // Establish a session from an out-of-band grant response — the MFA-pending\n    // ticket completion (issue #3242): the challenge verify returns the full\n    // grant, and applying it here keeps login semantics (LOGGING_IN/LOGGED_IN\n    // events, AUTHENTICATING status, lastAuthOrigin = login) identical to a\n    // password-grant login.\n    const loginWithTokenGrant = async (response: OAuth2TokenGrantResponse) => {\n        context.dispatcher.emit(StoreDispatcherEventName.LOGGING_IN);\n\n        interactionInFlight.value = StoreAuthOrigin.LOGIN;\n\n        try {\n            const generation = await cleanup();\n\n            await establishSession(response, StoreAuthOrigin.LOGIN, generation);\n        } finally {\n            interactionInFlight.value = null;\n        }\n\n        context.dispatcher.emit(StoreDispatcherEventName.LOGGED_IN);\n    };\n\n    const exchangeAuthorizationCode = async (\n        code: string,\n        params: {\n            code_verifier?: string,\n            redirect_uri?: string,\n            client_id?: string,\n            realm_id?: string\n        } = {},\n    ) => {\n        interactionInFlight.value = StoreAuthOrigin.EXCHANGE;\n\n        try {\n            const response = await client.token.createWithAuthorizationCode({\n                code,\n                ...params,\n            });\n\n            // wipe + revoke the previous identity before establishing the new\n            // one (a failed GRANT above leaves prior state intact — pinned).\n            const generation = await cleanup();\n\n            await establishSession(response, StoreAuthOrigin.EXCHANGE, generation);\n        } finally {\n            interactionInFlight.value = null;\n        }\n    };\n\n    /**\n     * `revoke` (default true) decides whether a cookie-mode logout ENDS the\n     * server-side session or merely tears down this instance.\n     *\n     * It exists because the two are no longer the same act. With a bearer the\n     * teardown was always local, so a caller that logged out on a failed\n     * `resolve()` — the account console's router guard does — lost nothing a\n     * reload could not restore. In cookie mode the same call revokes the\n     * `auth_sessions` row, so a transient failure (a 5xx, an aborted request,\n     * a proxy hiccup) would DESTROY a healthy session rather than re-read it.\n     * A failed resolve is not an intent to sign out; pass `revoke: false`\n     * there and keep the default for a real sign-out.\n     */\n    const logout = async (options: StoreLogoutOptions = {}) => {\n        const revoke = options.revoke ?? true;\n\n        context.dispatcher.emit(StoreDispatcherEventName.LOGGING_OUT);\n\n        if (revoke && context.cookieSession) {\n            // The credential lives server-side, so the local teardown below\n            // cannot reach it: the session has to be ended over the wire.\n            // Best effort — a failed call must still leave this instance\n            // signed out, and the cookie stops resolving the moment the\n            // server drops the handle.\n            try {\n                await client.account.deleteSession();\n            } catch {\n                // ...\n            }\n        }\n\n        await cleanup();\n\n        context.dispatcher.emit(StoreDispatcherEventName.LOGGED_OUT);\n    };\n\n    return {\n        cookiesRead,\n        setCookiesRead,\n\n        permissionEvaluator,\n\n        login,\n        loginWithTokenGrant,\n        logout,\n        loggedIn,\n        status,\n        lastAuthOrigin,\n        resolve,\n        exchangeAuthorizationCode,\n\n        applyTokenGrantResponse,\n        accessToken,\n        setAccessToken,\n        accessTokenExpireDate,\n        setAccessTokenExpireDate,\n        refreshToken,\n        setRefreshToken,\n\n        idToken,\n        setIdToken,\n\n        realm,\n        realmId,\n        realmIsRoot,\n        realmName,\n        setRealm,\n\n        realmManagement,\n        realmManagementId,\n        realmManagementName,\n        setRealmManagement,\n\n        user,\n        userId,\n        setUser,\n\n        sessionId,\n        acr,\n    };\n}\n","/*\n * Copyright (c) 2023.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport type { Pinia } from 'pinia';\nimport type { App } from 'vue';\nimport { inject } from '../inject';\nimport { provide } from '../provide';\nimport type { Store, StoreDefinition } from './types';\n\nconst sym = Symbol.for('AuthupStore');\n\nexport function injectStore(pinia?: Pinia, app?: App) : Store {\n    const instance = injectStoreFactory(app);\n    if (!instance) {\n        throw new Error('The store has not been injected in the app context.');\n    }\n\n    return instance(pinia);\n}\n\nexport function injectStoreFactory(app?: App) : StoreDefinition {\n    const instance = inject<StoreDefinition>(sym, app);\n    if (!instance) {\n        throw new Error('The store factory has not been injected in the app context.');\n    }\n\n    return instance;\n}\n\nexport function hasStoreFactory(app?: App) : boolean {\n    return !!inject(sym, app);\n}\n\nexport function provideStoreFactory(store: StoreDefinition, app?: App) {\n    provide(sym, store, app);\n}\n","/*\n * Copyright (c) 2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { CookieName } from '@authup/core-http-kit';\nimport { useCookies } from '@vueuse/integrations/useCookies';\nimport { defineStore } from 'pinia';\nimport type { App } from 'vue';\nimport type {\n    CookieGetFn, \n    CookieOptions, \n    CookieSetFn, \n    CookieUnsetFn,\n} from '../../types';\nimport { COOKIE_PATH, STORE_ID } from './constants';\nimport { createStore } from './create';\nimport { StoreDispatcherEventName, createStoreDispatcher, provideStoreDispatcher } from './dispatcher';\nimport { hasStoreFactory, provideStoreFactory } from './singleton';\nimport type { StoreInstallOptions } from './types';\n\nexport function installStore(app: App, options: StoreInstallOptions = {}) {\n    if (hasStoreFactory(app)) {\n        return;\n    }\n\n    const storeDispatcher = createStoreDispatcher();\n    provideStoreDispatcher(storeDispatcher, app);\n\n    const storeFactory = defineStore(\n        STORE_ID,\n        () => createStore({\n            baseURL: options.baseURL,\n            httpClient: options.httpClient,\n            dispatcher: storeDispatcher,\n            cookieSession: options.cookieSession,\n        }),\n    );\n    const store = storeFactory(options.pinia);\n\n    let cookieGet : CookieGetFn;\n    if (options.cookieGet) {\n        cookieGet = options.cookieGet;\n    } else {\n        const cookies = useCookies();\n        cookieGet = cookies.get;\n    }\n\n    let cookieSet: CookieSetFn;\n    if (options.cookieSet) {\n        cookieSet = options.cookieSet;\n    } else {\n        const cookies = useCookies();\n        cookieSet = cookies.set;\n    }\n\n    let cookieUnset : CookieUnsetFn;\n    if (options.cookieUnset) {\n        cookieUnset = options.cookieUnset;\n    } else if (options.cookieSet) {\n        cookieUnset = (key: string, opts: CookieOptions) => {\n            (options.cookieSet as CookieSetFn)(key, null, opts);\n        };\n    } else {\n        const cookies = useCookies();\n        cookieUnset = cookies.remove;\n    }\n\n    // Written explicitly, because a cookie stored without a `Path` takes the\n    // browser's default-path: the directory of the writing document. The\n    // account console at `/console/account` and the hosted auth pages at `/` are one\n    // origin sharing one session under one set of cookie names, so the\n    // implicit paths gave them two shadowing sets that expire independently.\n    const cookiePath = options.cookiePath || COOKIE_PATH;\n\n    /**\n     * Drop the copies written before the path was pinned.\n     *\n     * Those sit on the browser's default-path for the writing document\n     * (RFC 6265 5.1.4): `/console/account` for the account console. A pinned write\n     * does not overwrite them, and they WIN the read, because\n     * `document.cookie` lists the longer path first and the parser keeps the\n     * first match. Hydration would then persist what they hold back onto the\n     * pinned path, replacing a live refresh token with a stale one, which the\n     * next refresh replays into family revocation. So they are cleared once,\n     * before reading, and the browser falls back to the pinned session (or to\n     * signed out, if that one already lapsed).\n     *\n     * Cleared is every path a cookie could sit on and still reach this\n     * document, which by the RFC 6265 5.2.4 path-match is each `/`-boundary\n     * prefix of the current path PLUS that path itself. The last part is not\n     * redundant: `/console/account` serves the console too, and a copy written\n     * from `/console/account/password` sits on exactly `/console/account`,\n     * matching it. Only the store's own names are touched, and never on the\n     * pinned path.\n     */\n    const dropShadowingCookies = () => {\n        const pathname = typeof window === 'undefined' ?\n            undefined :\n            window.location?.pathname;\n\n        if (typeof pathname !== 'string') {\n            return;\n        }\n\n        let path = '';\n        for (const segment of pathname.split('/')) {\n            if (!segment) {\n                continue;\n            }\n\n            path += `/${segment}`;\n            if (path === cookiePath) {\n                continue;\n            }\n\n            for (const key of Object.values(CookieName)) {\n                cookieUnset(key, { path });\n            }\n        }\n    };\n\n    /**\n     * The cookies holding a token pair. Cookie mode (plan 088) neither reads\n     * nor writes them.\n     *\n     * NOT reading them is the whole of finding 1: the hosted auth pages write\n     * these names at the same path on the same origin, so seeding them gave\n     * the console a bearer, and header-wins precedence meant the session\n     * cookie was never consulted — the cookie path would have been unreachable\n     * on its own happy path. The authentication hook stays installed (it is\n     * inert without an access token, and `installHTTPClient` throws when it\n     * was never provided).\n     *\n     * NOT writing them matters just as much: those cookies are the hosted auth\n     * console's lingering SSO session, which `prompt=none` and\n     * `prompt=select_account` depend on for every other RP on the origin. A\n     * console `logout()` clears every token ref, so with the listeners\n     * attached it would clear those cookies as a side effect. The console does\n     * not write them.\n     *\n     * Scoped precisely, because the wider claim would be wrong: this is about\n     * the COOKIES, not the session behind them. A deliberate sign-out does end\n     * the session row, and since the authorize flow reuses the bearer session\n     * (#3191 session continuity) that row IS the hosted page's session, so\n     * signing out of the account console signs the browser out of the IdP.\n     * That is the intended semantic on the IdP's own origin. What it leaves\n     * behind is stale token cookies naming a deleted row: they fail at the API\n     * (the middleware checks the session), so the state self-heals, and\n     * `/token/introspect` reporting them `active` in the meantime is its\n     * documented jti+exp contract rather than a session check.\n     */\n    const TOKEN_COOKIE_NAMES : string[] = [\n        CookieName.ACCESS_TOKEN,\n        CookieName.ACCESS_TOKEN_EXPIRE_DATE,\n        CookieName.REFRESH_TOKEN,\n        CookieName.ID_TOKEN,\n    ];\n\n    const isTokenCookie = (key: string) => options.cookieSession &&\n        TOKEN_COOKIE_NAMES.includes(key);\n\n    const readCookies = () => {\n        if (store.cookiesRead) {\n            return;\n        }\n\n        store.setCookiesRead(true);\n\n        // The expire date must hydrate BEFORE the access token: the cookie\n        // listener's write-back echo derives the token cookie's maxAge from\n        // the already-written expire date (the same pinned order\n        // applyTokenGrantResponse follows) — enum order would re-persist the\n        // token as a session cookie.\n        const keys : string[] = [\n            CookieName.ACCESS_TOKEN_EXPIRE_DATE,\n            ...Object.values(CookieName).filter(\n                (key) => key !== CookieName.ACCESS_TOKEN_EXPIRE_DATE,\n            ),\n        ];\n\n        let value : any;\n        for (const key of keys) {\n            if (isTokenCookie(key)) {\n                continue;\n            }\n\n            value = cookieGet(key);\n            if (!value) {\n                continue;\n            }\n\n            switch (key) {\n                case CookieName.ACCESS_TOKEN:\n                    if (!store.accessToken) {\n                        store.setAccessToken(value);\n                    }\n                    break;\n                case CookieName.ACCESS_TOKEN_EXPIRE_DATE:\n                    if (!store.accessTokenExpireDate) {\n                        store.setAccessTokenExpireDate(value);\n                    }\n                    break;\n                case CookieName.REFRESH_TOKEN:\n                    if (!store.refreshToken) {\n                        store.setRefreshToken(value);\n                    }\n                    break;\n                case CookieName.ID_TOKEN:\n                    if (!store.idToken) {\n                        store.setIdToken(value);\n                    }\n                    break;\n                case CookieName.REALM:\n                    if (!store.realm) {\n                        store.setRealm(value);\n                    }\n                    break;\n                case CookieName.REALM_MANAGEMENT:\n                    if (!store.realmManagement) {\n                        store.setRealmManagement(value);\n                    }\n                    break;\n            }\n        }\n    };\n\n    const maxAgeFn = () => {\n        if (!store.accessTokenExpireDate) {\n            return undefined;\n        }\n\n        return Math.floor(\n            Math.max(1000, new Date(`${store.accessTokenExpireDate}`).getTime() - Date.now()) /\n            1000,\n        );\n    };\n\n    // Skipped entirely in cookie mode — see TOKEN_COOKIE_NAMES above.\n    if (!options.cookieSession) {\n        storeDispatcher.on(\n            StoreDispatcherEventName.ACCESS_TOKEN_EXPIRE_DATE_UPDATED,\n            (input) => {\n                if (input) {\n                    cookieSet(CookieName.ACCESS_TOKEN_EXPIRE_DATE, input, {\n                        maxAge: maxAgeFn(),\n                        path: cookiePath,\n                    });\n                } else {\n                    cookieUnset(CookieName.ACCESS_TOKEN_EXPIRE_DATE, { path: cookiePath });\n                }\n            },\n        );\n\n        storeDispatcher.on(\n            StoreDispatcherEventName.ACCESS_TOKEN_UPDATED,\n            (input) => {\n                if (input) {\n                    const maxAge = maxAgeFn();\n                    cookieSet(CookieName.ACCESS_TOKEN, input, {\n                        maxAge,\n                        path: cookiePath,\n                    });\n                } else {\n                    cookieUnset(CookieName.ACCESS_TOKEN, { path: cookiePath });\n                }\n            },\n        );\n\n        storeDispatcher.on(\n            StoreDispatcherEventName.REFRESH_TOKEN_UPDATED,\n            (input) => {\n                if (input) {\n                    cookieSet(CookieName.REFRESH_TOKEN, input, { path: cookiePath });\n                } else {\n                    cookieUnset(CookieName.REFRESH_TOKEN, { path: cookiePath });\n                }\n            },\n        );\n\n        storeDispatcher.on(\n            StoreDispatcherEventName.ID_TOKEN_UPDATED,\n            (input) => {\n                if (input) {\n                    cookieSet(CookieName.ID_TOKEN, input, { path: cookiePath });\n                } else {\n                    cookieUnset(CookieName.ID_TOKEN, { path: cookiePath });\n                }\n            },\n        );\n    }\n\n    storeDispatcher.on(\n        StoreDispatcherEventName.REALM_UPDATED,\n        (input) => {\n            if (input) {\n                cookieSet(CookieName.REALM, input, { path: cookiePath });\n            } else {\n                cookieUnset(CookieName.REALM, { path: cookiePath });\n            }\n        },\n    );\n\n    storeDispatcher.on(\n        StoreDispatcherEventName.REALM_MANAGEMENT_UPDATED,\n        (input) => {\n            if (input) {\n                cookieSet(CookieName.REALM_MANAGEMENT, input, { path: cookiePath });\n            } else {\n                cookieUnset(CookieName.REALM_MANAGEMENT, { path: cookiePath });\n            }\n        },\n    );\n\n    dropShadowingCookies();\n\n    /**\n     * The user record is deliberately NOT persisted.\n     *\n     * Its value was the verbatim `/userinfo` body, and extra attributes are\n     * flattened onto that response AFTER the query projection, so nothing\n     * bounded its size: one operator-defined attribute is enough to push the\n     * cookie past the 4096 byte limit, where the browser drops it silently.\n     * It also carried the email and both names into the header of every\n     * request on the origin, static assets included. The store now builds the\n     * subject from the introspection response `resolve()` already awaits, so\n     * there is nothing to persist and nothing to restore.\n     *\n     * Copies written by earlier versions are swept here rather than left to\n     * expire: they carry no `maxAge`, so an open browser would keep sending one\n     * until it closes. The sweep is conditional because the name is a bare\n     * `user` on the pinned path — an unconditional delete would reach a\n     * same-named cookie belonging to another app on the origin on every single\n     * install, rather than once for a browser carrying the kit's own leftover.\n     */\n    if (cookieGet(CookieName.USER)) {\n        cookieUnset(CookieName.USER, { path: cookiePath });\n    }\n\n    readCookies();\n\n    provideStoreFactory(storeFactory, app);\n}\n","/*\n * Copyright (c) 2023.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport type { StoreGeneric, storeToRefs as _storeToRefs } from 'pinia';\nimport {\n    isReactive, \n    isRef, \n    toRaw, \n    toRef,\n} from 'vue';\n\nexport type StoreToRefs<T extends StoreGeneric> = ReturnType<typeof _storeToRefs<T>>;\n\nexport function storeToRefs<SS extends StoreGeneric>(\n    store: SS,\n): StoreToRefs<SS> {\n    store = toRaw(store);\n\n    const refs = {} as StoreToRefs<SS>;\n    const keys = Object.keys(store);\n    for (const key of keys) {\n        const value = store[key];\n        if (isRef(value) || isReactive(value)) {\n            refs[key as (keyof StoreToRefs<SS>)] = toRef(store, key) as any;\n        }\n    }\n\n    return refs;\n}\n","/*\n * Copyright (c) 2025.\n *  Author Peter Placzek (tada5hi)\n *  For the full copyright and license information,\n *  view the LICENSE file that was distributed with this source code.\n */\n\nimport { Client, ClientAuthenticationHook, ClientAuthenticationHookEventName } from '@authup/core-http-kit';\nimport type { IClient } from '@authup/core-http-kit';\nimport type { App } from 'vue';\nimport { storeToRefs } from 'pinia';\nimport { hasHTTPClientAuthenticationHook, provideHTTPClientAuthenticationHook } from './singleton';\nimport { StoreDispatcherEventName, injectStoreDispatcher, injectStoreFactory } from '../../store';\nimport type { HTTPClientAuthenticationHookInstallOptions } from './types';\n\nexport function installHTTPClientAuthenticationHook(\n    app: App,\n    options: HTTPClientAuthenticationHookInstallOptions = {},\n) {\n    if (hasHTTPClientAuthenticationHook(app)) {\n        return;\n    }\n\n    const storeFactory = injectStoreFactory(app);\n    const store = storeFactory(options.pinia);\n\n    const { refreshToken } = storeToRefs(store);\n\n    let refreshTokenInUse : string | null = null;\n\n    const hook = new ClientAuthenticationHook({\n        baseURL: options.baseURL,\n        tokenCreator: () => {\n            if (!refreshToken.value) {\n                throw new Error('No refresh token available.');\n            }\n\n            refreshTokenInUse = refreshToken.value;\n\n            const client : IClient = options.httpClient ?? new Client({ baseURL: options.baseURL });\n            return client.token.createWithRefreshToken({ refresh_token: refreshTokenInUse });\n        },\n        timer: !options.isServer,\n    });\n\n    const storeDispatcher = injectStoreDispatcher(app);\n\n    hook.on(ClientAuthenticationHookEventName.REFRESH_FINISHED, (response) => {\n        // Drop a stale refresh: when the store's refresh token changed while\n        // the grant was in flight (a logout tore the session down, or an\n        // interactive login/exchange replaced it), applying the response\n        // would resurrect torn-down state or overwrite the new session's\n        // tokens with the old session's.\n        if (\n            refreshTokenInUse === null ||\n            store.refreshToken !== refreshTokenInUse\n        ) {\n            // The hook already applied the stale response to itself (header +\n            // timer) — re-sync it from the store's current state so attached\n            // clients never keep the dropped session's bearer.\n            handleAccessTokenEvent();\n            handleAccessTokenExpireDateEvent();\n\n            // The dropped grant's tokens were never written to the store, so\n            // no later logout() could reach them — revoke them best-effort\n            // instead of orphaning a live server session.\n            const client : IClient = options.httpClient ?? new Client({ baseURL: options.baseURL });\n            Promise.resolve()\n                .then(() => client.token.revoke({ token: response.access_token }))\n                .catch(() => { /* best-effort */ });\n            if (response.refresh_token) {\n                const refresh = response.refresh_token;\n                Promise.resolve()\n                    .then(() => client.token.revoke({ token: refresh }))\n                    .catch(() => { /* best-effort */ });\n            }\n\n            return;\n        }\n\n        store.applyTokenGrantResponse(response);\n    });\n\n    let isSelfCallee = false;\n\n    hook.on(ClientAuthenticationHookEventName.HEADER_UNSET, () => {\n        if (!isSelfCallee) {\n            // A background refresh failed (not a store-driven token clear):\n            // tear the session down and signal an involuntary expiry so the\n            // host app can redirect an idle user off an auth-only page. The\n            // emit runs even if logout() rejects (session is dead regardless),\n            // and the catch keeps a logout failure from surfacing as an\n            // unhandled rejection.\n            Promise.resolve()\n                .then(() => store.logout())\n                .catch(() => { /* best-effort cleanup */ })\n                .finally(() => {\n                    storeDispatcher.emit(StoreDispatcherEventName.SESSION_EXPIRED);\n                });\n        }\n    });\n\n    const handleAccessTokenEvent = () => {\n        isSelfCallee = true;\n\n        if (store.accessToken) {\n            hook.enable();\n            hook.setAuthorizationHeader({\n                type: 'Bearer',\n                token: store.accessToken as string,\n            });\n        } else {\n            hook.disable();\n            hook.unsetAuthorizationHeader();\n        }\n\n        isSelfCallee = false;\n    };\n\n    const handleAccessTokenExpireDateEvent = () => {\n        if (store.accessTokenExpireDate) {\n            const expiresIn = Math.floor((store.accessTokenExpireDate.getTime() - Date.now()) / 1000);\n            hook.setTimer(expiresIn);\n        } else {\n            // no expire date -> nothing to refresh against: a stale armed\n            // timer (e.g. re-armed by a dropped background refresh) would\n            // fire a doomed refresh after logout.\n            hook.clearTimer();\n        }\n    };\n\n    storeDispatcher.on(\n        StoreDispatcherEventName.ACCESS_TOKEN_UPDATED,\n        () => handleAccessTokenEvent(),\n    );\n\n    storeDispatcher.on(\n        StoreDispatcherEventName.ACCESS_TOKEN_EXPIRE_DATE_UPDATED,\n        () => handleAccessTokenExpireDateEvent(),\n    );\n\n    handleAccessTokenEvent();\n    handleAccessTokenExpireDateEvent();\n\n    provideHTTPClientAuthenticationHook(hook, app);\n}\n","/*\n * Copyright (c) 2022-2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport type { IClient } from '@authup/core-http-kit';\nimport type { App } from 'vue';\nimport { inject } from '../inject';\nimport { provide } from '../provide';\n\nexport const HTTPClientSymbol = Symbol.for('AuthupHTTPClient');\n\nexport function provideHTTPClient(client: IClient, app?: App) {\n    provide(HTTPClientSymbol, client, app);\n}\n\nexport function hasHTTPClient(app?: App) : boolean {\n    try {\n        return !!injectHTTPClient(app);\n    } catch {\n        return false;\n    }\n}\n\nexport function injectHTTPClient(app?: App) {\n    const instance = inject<IClient>(HTTPClientSymbol, app);\n    if (!instance) {\n        throw new Error('The api client has not been injected.');\n    }\n\n    return instance;\n}\n","/*\n * Copyright (c) 2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { Client } from '@authup/core-http-kit';\nimport type { IClient } from '@authup/core-http-kit';\nimport type { App } from 'vue';\nimport { hasHTTPClient, provideHTTPClient } from './singleton';\nimport type { HTTPClientInstallOptions } from './types';\nimport { injectHTTPClientAuthenticationHook } from './authentication-hook';\n\nexport function installHTTPClient(app: App, options: HTTPClientInstallOptions = {}) {\n    if (hasHTTPClient(app)) {\n        return;\n    }\n\n    const client : IClient = options.httpClient ?? new Client({ baseURL: options.baseURL });\n\n    const authenticationHook = injectHTTPClientAuthenticationHook(app);\n    authenticationHook.attach(client);\n\n    provideHTTPClient(client, app);\n}\n","/*\n * Copyright (c) 2026.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { TranslatorTranslationNamespace } from '@authup/i18n';\nimport { injectIlingo, injectLocale } from '@ilingo/vue';\nimport { translateIssues } from '@ilingo/validup';\nimport { extractErrorContext } from '../error';\n\n/**\n * Resolve a caught error to a localized, user-facing message.\n *\n * Capture the active translator at call site (run this in `setup()`, before\n * any `await`), then use the returned async resolver. Lookup order:\n *\n * 1. **Field-level validup `issues`** (a validation failure) — translated\n *    via `@ilingo/validup`'s `translateIssues` (the same machinery that\n *    renders inline form-field errors), so the toast is both localized and\n *    field-specific instead of a generic \"bad request\" line.\n * 2. **Top-level `code`** — resolved against the `authupError` namespace\n *    (e.g. `permission_denied`, `entity_conflict`).\n * 3. **Raw server message** — last resort for non-HTTP / uncoded errors.\n */\nexport function useErrorTranslator(): (error: unknown) => Promise<string> {\n    const ilingo = injectIlingo();\n    const locale = injectLocale();\n\n    return async (error) => {\n        const ctx = extractErrorContext(error);\n\n        if (ctx.issues) {\n            const translated = await translateIssues(ctx.issues, ilingo, { locale: locale.value });\n            const joined = translated\n                .map((entry) => entry.message)\n                .filter(Boolean)\n                .join('\\n');\n            if (joined) {\n                return joined;\n            }\n        }\n\n        if (ctx.code) {\n            const message = await ilingo.get({\n                namespace: TranslatorTranslationNamespace.ERROR,\n                key: ctx.code,\n                data: ctx.data,\n                locale: locale.value,\n            });\n            if (message) {\n                return message;\n            }\n        }\n\n        return ctx.message ?? 'An unexpected error occurred.';\n    };\n}\n","/*\n * Copyright (c) 2026.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport type { App } from 'vue';\nimport { inject } from '../inject';\nimport { provide } from '../provide';\nimport type { HydrationStore } from './types';\n\nexport const HydrationStoreSymbol = Symbol.for('AuthupHydrationStore');\n\nexport function provideHydrationStore(store: HydrationStore, app?: App) {\n    provide(HydrationStoreSymbol, store, app);\n}\n\n/**\n * The host's hydration bucket, or undefined when the host provides none.\n * Optional by design: a consumer without server rendering never installs one.\n */\nexport function injectHydrationStore(app?: App) : HydrationStore | undefined {\n    return inject<HydrationStore>(HydrationStoreSymbol, app);\n}\n","/*\n * Copyright (c) 2026.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { getCurrentInstance, onServerPrefetch } from 'vue';\nimport { injectHydrationStore } from './singleton';\nimport type { HydratedValueContext } from './types';\n\nexport function isServerRuntime() : boolean {\n    return typeof window === 'undefined';\n}\n\n/**\n * Carry an asynchronously resolved value across the SSR boundary.\n *\n * A value the server resolved before rendering (a translation, a permission\n * verdict) is only available in the browser one microtask after hydration,\n * so the first client render would emit a placeholder where the markup\n * already holds the real thing. The server render resolves and records it,\n * the hydrating client applies it up front, and both first renders agree.\n *\n * Entries are deliberately NOT consumed on read: unlike a collection's rows,\n * the same key is shared by every component asking the same question, and the\n * answer does not go stale within the app instance (the locale is part of the\n * translation key). Values only ever seed the first render. Whatever the\n * component does afterwards stays in charge.\n */\nexport function useHydratedValue<T>(ctx: HydratedValueContext<T>) : void {\n    const store = injectHydrationStore();\n    if (!store) {\n        return;\n    }\n\n    if (isServerRuntime()) {\n        // no component instance means no render to precede, so nothing to hand over\n        if (!getCurrentInstance()) {\n            return;\n        }\n\n        onServerPrefetch(async () => {\n            // The handoff is an optimization, so a failed lookup degrades to\n            // the non-hydrated path (the client resolves for itself) instead\n            // of rejecting. An unhandled rejection here would reach the\n            // renderer, and Node terminates the process over it.\n            try {\n                const value = await ctx.resolve();\n                if (typeof value === 'undefined') {\n                    return;\n                }\n\n                ctx.apply(value);\n                store.set(ctx.key, value);\n            } catch {\n                // nothing to hand over\n            }\n        });\n\n        return;\n    }\n\n    const value = store.get<T>(ctx.key);\n    if (typeof value !== 'undefined') {\n        ctx.apply(value);\n    }\n}\n","/*\n * Copyright (c) 2022-2026.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport type { Composable, FieldState } from '@validup/vue';\nimport {\n    useTranslation as _useTranslation,\n    injectIlingo,\n    injectLocale,\n} from '@ilingo/vue';\nimport {\n    useTranslationsForComposable as _useTranslationsForComposable,\n    useTranslationsForField as _useTranslationsForField,\n} from '@ilingo/validup-vue';\nimport type { FieldTranslations } from '@ilingo/validup-vue';\nimport type { DataMaybeRef, GetContextReactive } from '@ilingo/vue';\nimport type { GetContext, IIlingo } from 'ilingo';\nimport type { ObjectLiteral } from 'validup';\nimport type { Ref } from 'vue';\nimport { computed, ref, unref } from 'vue';\nimport { injectHydrationStore, useHydratedValue } from '../hydration';\n\nexport function injectTranslatorLocale(): Ref<string> {\n    return injectLocale();\n}\n\nfunction unwrapTranslationData(input: DataMaybeRef) : Record<string, string | number> {\n    const output : Record<string, string | number> = {};\n    const entries = Object.entries(input);\n    for (const [key, value] of entries) {\n        output[key] = unref(value);\n    }\n\n    return output;\n}\n\nfunction buildTranslationHydrationKey(ctx: GetContext) : string {\n    return `authup:translation:${ctx.locale}:${ctx.namespace}:${ctx.key}:${ctx.count ?? ''}:${ctx.data ? JSON.stringify(ctx.data) : ''}`;\n}\n\n/**\n * Whether the instance refused this lookup instead of answering it.\n *\n * ilingo signals a store that cannot read without I/O by throwing\n * `SyncUnavailableError` out of `getSync`, deliberately not by returning\n * `undefined` (which means the key is genuinely missing). Only the refusal is\n * worth a handoff: a missing key misses in the async pass too, so there would\n * be nothing to record. Any other fault counts as refused, so the async pass\n * still gets its chance at a value.\n */\nfunction isSyncUnavailable(instance: IIlingo, ctx: GetContext) : boolean {\n    try {\n        instance.getSync(ctx);\n\n        return false;\n    } catch {\n        return true;\n    }\n}\n\n/**\n * Reactive translation lookup.\n *\n * `@ilingo/vue` resolves through ilingo's async `get()`, seeding the ref\n * with what the synchronous `getSync()` can answer (tada5hi/ilingo#988).\n * Authup's catalogs are a `MemoryStore`, so that seed IS the translation and\n * both the server-rendered markup and the render the client hydrates it\n * against hold the real string.\n *\n * A store that needs I/O (a cold `FSStore`/`LoaderStore`, a remote adapter a\n * consumer registers ahead of the kit's own) declines the synchronous read,\n * and the seed stays the `<namespace>.<key>` placeholder until the async\n * lookup settles a microtask later. That is a mismatch for every translated\n * string in a server-rendered subtree, so for those the server records what\n * it resolved and the hydrating client shows it until its own lookup\n * settles. Nothing is recorded when the seed already answered, which is\n * every authup key.\n */\nexport function useTranslation(input: GetContextReactive): Ref<string> {\n    const source = _useTranslation(input);\n\n    const store = injectHydrationStore();\n    if (!store) {\n        return source;\n    }\n\n    // `@ilingo/vue` falls back to this for a refused read AND for a missing\n    // key, so it only rules the seed out, it does not say which happened\n    const placeholder = `${input.namespace}.${input.key}`;\n    if (source.value !== placeholder) {\n        return source;\n    }\n\n    const ilingo = injectIlingo();\n    const locale = injectLocale();\n\n    const context = () : GetContext => ({\n        locale: input.locale ? input.locale : locale.value,\n        namespace: input.namespace,\n        key: input.key,\n        count: unref(input.count),\n        data: input.data ? unwrapTranslationData(input.data) : undefined,\n    });\n\n    if (!isSyncUnavailable(ilingo, context())) {\n        return source;\n    }\n\n    const recorded = ref<string>();\n\n    useHydratedValue<string>({\n        key: buildTranslationHydrationKey(context()),\n        resolve: () => ilingo.get(context()),\n        apply: (value) => {\n            recorded.value = value;\n        },\n    });\n\n    return computed(() => {\n        if (source.value === placeholder && recorded.value) {\n            return recorded.value;\n        }\n\n        return source.value;\n    });\n}\n\n/**\n * Imperative counterpart to {@see useTranslation} for non-reactive,\n * event-time lookups — toast bodies built when a mutation resolves, or\n * nav-label resolution inside the async `Navigation.reduce()` pipeline,\n * where a render-time `Ref` is the wrong shape. Captures the injected\n * ilingo instance + locale `Ref` at call site (so it must run in\n * `setup()`), then returns a translate function that reads the current\n * `locale.value` on each invocation. Missing keys resolve to the bare\n * key value rather than `undefined`.\n */\nexport function useTranslator(): (ctx: GetContext) => Promise<string> {\n    const ilingo = injectIlingo();\n    const locale = injectLocale();\n\n    return async (ctx) => (await ilingo.get({ ...ctx, locale: locale.value })) ?? ctx.key;\n}\n\n/**\n * Translate the visible errors of a `@validup/vue` `FieldState` to\n * localized messages. Successor to the previous\n * `useTranslationsForBaseValidation` — reads `fieldState.$errors`\n * (already dirty-gated by `@validup/vue`), so the returned\n * `Ref<IssueTranslation[]>` only carries entries the user should see.\n */\nexport function useTranslationsForField<V = unknown>(\n    fieldState: FieldState<V>,\n): FieldTranslations {\n    return _useTranslationsForField(fieldState);\n}\n\n/**\n * Translate the form-level `$errors` of a `@validup/vue` `Composable<T>`.\n * Successor to the previous `useTranslationsForNestedValidation` — sugar\n * for the common \"render all dirty-gated field errors\" pattern.\n */\nexport function useTranslationsForComposable<T extends ObjectLiteral = ObjectLiteral>(\n    composable: Composable<T>,\n): FieldTranslations {\n    return _useTranslationsForComposable(composable);\n}\n","/*\n * Copyright (c) 2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport type { GetContextReactive } from '@ilingo/vue';\nimport type { Ref } from 'vue';\nimport { reactive } from 'vue';\nimport { useTranslation } from './singleton';\n\n/**\n * One entry of a {@see useTranslations} batch. Carries a full ilingo\n * lookup context: `namespace` + `key`, plus optional `count` for plural\n * selection (`count: 1` → singular, any other → plural) and `data` for\n * interpolation. The output map is keyed by `key`, so a single batch must\n * not list the same `key` twice.\n */\nexport type TranslationsInput = GetContextReactive;\n\ntype TranslationsInputNamespaced = Omit<TranslationsInput, 'namespace'>;\n\ntype OutputKey<T extends TranslationsInput> = T['key'] extends string ?\n    T['key'] :\n    string;\n\n/**\n * Resolve a batch of translations spanning any number of namespaces.\n * Each element supplies its own `namespace`; the result is a reactive\n * keyed map of unwrapped strings — access as `map.key` (no `.value`) in\n * script, interpolation, and attribute bindings alike. The output key is\n * the element's `key`.\n */\nexport function useTranslations<const T extends readonly TranslationsInput[]>(\n    elements: T,\n): Record<OutputKey<T[number]>, string> {\n    const output = {} as Record<string, Ref<string>>;\n    for (const element of elements) {\n        output[element.key] = useTranslation(element);\n    }\n\n    return reactive(output) as unknown as Record<OutputKey<T[number]>, string>;\n}\n\n/**\n * Single-namespace sugar over {@see useTranslations}: applies one shared\n * `namespace` to every element. Retained for batches that live entirely\n * in one namespace (e.g. the `authupApp` chrome labels).\n */\nexport function useTranslationsForNamespace<const T extends readonly TranslationsInputNamespaced[]>(\n    namespace: string,\n    elements: T,\n): Record<OutputKey<T[number] & { namespace: string }>, string> {\n    return useTranslations(\n        elements.map((element) => ({ ...element, namespace })),\n    ) as Record<OutputKey<T[number] & { namespace: string }>, string>;\n}\n","/*\n * Copyright (c) 2024-2026.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { CATALOGS } from '@authup/i18n';\nimport { MemoryStore } from 'ilingo';\nimport { install as installIlingoVue } from '@ilingo/vue';\nimport { install as installIlingoValidup } from '@ilingo/validup-vue';\nimport type { App } from 'vue';\nimport type { TranslatorInstallOptions } from './types';\n\n/**\n * Three-stage install:\n *\n * 1. `@ilingo/vue` first (provides the `Ilingo` instance + locale `Ref`\n *    and registers the authup catalogs).\n * 2. `@ilingo/validup-vue` next (looks up the instance via inject and\n *    registers its built-in EN/DE/FR/ES validup validation-message\n *    catalogs onto it).\n *\n * `<IFieldValidation>` is imported and registered per-form locally\n * rather than globally — keeps the form's `components: {}` registry as\n * the single source of truth for what's used in its template.\n *\n * Authup-specific catalogs (`authupEntity`, `authupField`,\n * `authupAction`, `authupCommon`, `authupClient`, `authupApp`,\n * `vuecs`, `authupError`) ship through the same `MemoryStore`. The authored\n * translations live in the framework-agnostic `@authup/i18n` package,\n * which already exports them as an ilingo `CatalogNode` (`CATALOGS`) —\n * the canonical ingestion format — so this install just hands it to the\n * store directly with no per-consumer reconstruction.\n *\n * Zod-driven validators flow through `@validup/zod`'s\n * `createValidator()`, which maps each `ZodIssue` to a specific validup\n * `IssueCode` (`too_small` → `MIN_LENGTH` / `MIN_VALUE` based on\n * origin, `too_big` → `MAX_LENGTH` / `MAX_VALUE`, `invalid_format` →\n * `EMAIL` / `URL` / `UUID` / `DATE` / `IP_ADDRESS` / `BASE64` / `JSON`\n * / `PATTERN` per zod's `format` discriminator, `invalid_type` with\n * undefined input → `REQUIRED`, `invalid_value` → `ONE_OF_FAILED`).\n * Specific constraints surface as parameterized catalog templates\n * (`'The minimum length allowed is {{min}}'`, etc.), localized via\n * `@ilingo/validup`'s EN / DE / FR / ES translations.\n *\n * Migrated from the previous `@ilingo/vuelidate`-based install when\n * authup's frontend moved off `vuelidate` to `@validup/vue`.\n */\nexport function installTranslator(app: App, options: TranslatorInstallOptions = {}) {\n    installIlingoVue(app, {\n        store: new MemoryStore({ data: CATALOGS }),\n        locale: options.locale,\n    });\n    installIlingoValidup(app);\n}\n","/*\n * Copyright (c) 2026.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { matchLocale } from '@authup/i18n';\nimport { injectLocale } from '@ilingo/vue';\nimport { useLocaleManager } from '@vuecs/locale';\nimport type { App, ComputedRef } from 'vue';\nimport { computed, watch } from 'vue';\n\nfunction tryUseLocaleManager() {\n    // useLocaleManager() throws when @vuecs/locale is not installed. Authup's\n    // apps install it (so vuecs owns the locale, cookie-backed — same as\n    // color-mode owns vc-color-mode), but a downstream consumer that embeds\n    // the kit without it should still get a working switcher.\n    try {\n        return useLocaleManager();\n    } catch {\n        return undefined;\n    }\n}\n\nexport type LocaleControl = {\n    /** Active locale narrowed to a supported catalog code. */\n    code: ComputedRef<string>,\n    /** Apply a locale; persistence is owned by vuecs when present. */\n    set: (input: string) => void,\n};\n\n/**\n * Single control surface for the active UI locale. Prefers `@vuecs/locale`'s\n * manager (the source of truth — cookie persistence, `auto`/browser\n * resolution, `<html lang>` sync, `Config['locale']`), and falls back to the\n * ilingo locale ref when vuecs-locale is absent.\n */\nexport function useLocaleControl(): LocaleControl {\n    const manager = tryUseLocaleManager();\n    const ilingo = injectLocale();\n\n    const code = computed<string>(() => {\n        const source = manager ? manager.resolved.value : ilingo.value;\n        return matchLocale(source) ?? ilingo.value;\n    });\n\n    return {\n        code,\n        set: (input) => {\n            if (manager) {\n                manager.set(input);\n            } else {\n                ilingo.value = input;\n            }\n        },\n    };\n}\n\n/**\n * One-way bridge that keeps the ilingo locale (driving authup's catalogs) in\n * sync with vuecs's resolved locale (the source of truth). No-op when\n * vuecs-locale is not installed — there ilingo is the source directly.\n */\nexport function syncTranslatorLocaleFromManager(app: App): void {\n    const manager = app.runWithContext(() => tryUseLocaleManager());\n    if (!manager) {\n        return;\n    }\n\n    const ilingo = app.runWithContext(() => injectLocale());\n    watch(\n        manager.resolved,\n        (value) => {\n            const mapped = matchLocale(value);\n            if (mapped && mapped !== ilingo.value) {\n                ilingo.value = mapped;\n            }\n        },\n        { immediate: true },\n    );\n}\n","/*\n * Copyright (c) 2026.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport type { ComponentDefaultValues } from '@vuecs/core';\nimport type { SubmitButtonDefaults } from '@vuecs/forms';\nimport { TranslatorTranslationActionKey, TranslatorTranslationNamespace } from '@authup/i18n';\nimport { useTranslation } from '../translator';\n\n/**\n * Build the `submitButton` defaults for @vuecs/forms's\n * `useSubmitButton()` composable, wired to authup's translator. Pass into\n * `app.use(vuecs, { defaults: { submitButton: ... } })` once at app\n * bootstrap so `useSubmitButton()` picks up locale-reactive labels\n * without per-call work.\n *\n * MUST be called within an injection context (component setup or a Nuxt\n * plugin's `setup()`) — `useTranslation` reads the live locale provider\n * via `inject()`. The translator must be installed first.\n */\nexport function buildSubmitButtonDefaults(): ComponentDefaultValues<SubmitButtonDefaults> {\n    return {\n        createText: useTranslation({\n            namespace: TranslatorTranslationNamespace.ACTION,\n            key: TranslatorTranslationActionKey.CREATE,\n        }),\n        updateText: useTranslation({\n            namespace: TranslatorTranslationNamespace.ACTION,\n            key: TranslatorTranslationActionKey.UPDATE,\n        }),\n        createIcon: 'fa6-solid:plus',\n        updateIcon: 'fa6-solid:floppy-disk',\n        createColor: 'primary',\n        updateColor: 'primary',\n    };\n}\n","/*\n * Copyright (c) 2022.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { isEqual } from 'smob';\nimport type { AssignFormPropertiesOptions, PartialRecordWithNull } from './types';\n\n/**\n * Hydrate form state from a data source (e.g. a loaded entity):\n * assign `data`'s values onto `form`. 'null' values are transformed to an\n * empty string so they bind cleanly to form inputs.\n *\n * Only keys already declared in `form` are assigned — the form state owns\n * its shape. Copying every data key would leak unrelated entity properties\n * (id, timestamps, sibling sub-form fields, ...) into the form state and\n * from there into submit payloads, where a stale copy from one sub-form\n * can clobber an edited value from another.\n *\n * When `options.fields` is provided (the validup `fields` accessor bound\n * to `form`), hydration preserves unsaved user edits — see\n * {@link AssignFormPropertiesOptions}.\n *\n * @param form the form state to hydrate (mutated in place)\n * @param data the data source to read values from\n * @param options optional edit-preserving behavior\n */\nexport function assignFormProperties<T extends Record<string, any>>(\n    form: T,\n    data: PartialRecordWithNull<T> = {},\n    options: AssignFormPropertiesOptions = {},\n) : T {\n    const keys : (keyof T)[] = Object.keys(form);\n    for (const key of keys) {\n        if (!Object.prototype.hasOwnProperty.call(data, key)) {\n            continue;\n        }\n\n        const value = data[key];\n        const next = (value === null ? '' : value) as T[keyof T];\n\n        if (options.fields) {\n            const field = options.fields.at(key as string);\n            if (field.$dirty.value) {\n                if (!isEqual(form[key], next)) {\n                    continue;\n                }\n\n                field.$reset();\n            }\n        }\n\n        form[key] = next;\n    }\n\n    return form;\n}\n","/*\n * Copyright (c) 2026.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport type {\n    FieldsBuildInput,\n    FiltersBuildInput,\n    ICondition,\n    IQuery,\n    ObjectLiteral,\n    QueryBuildInput,\n    RelationsBuildInput,\n    SortsBuildInput,\n} from '@rapiq/core';\nimport {\n    defineQuery, \n    isFilter, \n    isFilters, \n    isQuery,\n} from '@rapiq/core';\n\n/**\n * Depth-bounded rapiq build inputs for component props. The library\n * defaults (depth 5) explode TypeScript's inferred-type serialization\n * for self-recursive entities (e.g. Policy.children); UI queries never\n * address more than three relation segments.\n */\nexport type QueryFiltersInput<\n    T extends ObjectLiteral = ObjectLiteral,\n> = FiltersBuildInput<T, 3>;\n\nexport type QueryFieldsInput<\n    T extends ObjectLiteral = ObjectLiteral,\n> = FieldsBuildInput<T, 3>;\n\nexport type QueryRelationsInput<\n    T extends ObjectLiteral = ObjectLiteral,\n> = RelationsBuildInput<T, 3>;\n\nexport type QuerySortInput<\n    T extends ObjectLiteral = ObjectLiteral,\n> = SortsBuildInput<T, 3>;\n\n/**\n * Typed authoring input for component props and manager contexts:\n * rapiq's QueryBuildInput (each parameter also accepts an\n * already-built AST fragment, so condition helpers like or()/eq()\n * assign without casts) at the depth bound above. Desugared into the\n * IR via defineQuery at the consuming boundary.\n */\nexport type QueryInput<\n    T extends ObjectLiteral = ObjectLiteral,\n> = QueryBuildInput<T, 3>;\n\n/**\n * Accepted query shape wherever the kit takes a query from the outside:\n * typed build input or the assembled rapiq IR.\n */\nexport type EntityListQueryInput<\n    T extends ObjectLiteral = ObjectLiteral,\n> = QueryInput<T> | IQuery;\n\n/**\n * A condition is either a leaf filter or a compound filters node —\n * rapiq ships guards for both, but none for the union (and isFilters\n * narrows within ICondition rather than from unknown).\n */\nexport function isCondition(input: unknown) : input is ICondition {\n    return isFilter(input) || isFilters(input as ICondition);\n}\n\n/**\n * Normalize accepted query input to the IR: an assembled query passes\n * through untouched, typed build input is desugared via defineQuery.\n */\nexport function normalizeQueryInput<T extends ObjectLiteral>(\n    input?: EntityListQueryInput<T>,\n) : IQuery {\n    if (isQuery(input)) {\n        return input;\n    }\n\n    return defineQuery(input as Parameters<typeof defineQuery>[0]);\n}\n","/*\n * Copyright (c) 2023-2023.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport type { ISorts } from '@rapiq/core';\nimport { SortDirection } from '@rapiq/core';\n\nexport function isQuerySortedDescByDate(input: ISorts) : boolean {\n    return input.value.some(\n        (sort) => (sort.name === 'createdAt' || sort.name === 'updatedAt') &&\n            sort.operator === SortDirection.DESC,\n    );\n}\n","/*\n * Copyright (c) 2023.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport type { Ref } from 'vue';\n\ntype Fn = (...args: any[]) => Promise<void>;\ntype OutputFn<ARGS extends unknown[]> = (...args: ARGS) => Promise<void>;\n\nexport function wrapFnWithBusyState<T extends Fn = Fn>(\n    busy: Ref<boolean>,\n    fn: T,\n): OutputFn<Parameters<T>> {\n    return async (...args: Parameters<T>) => {\n        if (busy.value) {\n            return Promise.resolve();\n        }\n\n        busy.value = true;\n\n        return fn(...args)\n            .finally(() => {\n                busy.value = false;\n            });\n    };\n}\n","/*\n * Copyright (c) 2026.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { base64URLEncode } from '@authup/kit';\n\nexport type PKCE = {\n    code_verifier: string,\n    code_challenge: string,\n    code_challenge_method: 'S256'\n};\n\nfunction strFromBytes(bytes: Uint8Array) : string {\n    let str = '';\n    for (const byte of bytes) {\n        str += String.fromCharCode(byte);\n    }\n\n    return str;\n}\n\nfunction randomString(length = 64): string {\n    const bytes = new Uint8Array(length);\n    crypto.getRandomValues(bytes);\n\n    return base64URLEncode(\n        strFromBytes(bytes),\n    );\n}\n\nexport function createState(): string {\n    return randomString(32);\n}\n\nexport async function createPKCE(): Promise<PKCE> {\n    const codeVerifier = randomString(64);\n\n    const digest = await crypto.subtle.digest(\n        'SHA-256',\n        new TextEncoder().encode(codeVerifier),\n    );\n\n    return {\n        code_verifier: codeVerifier,\n        code_challenge: base64URLEncode(\n            strFromBytes(\n                new Uint8Array(digest),\n            ),\n        ),\n        code_challenge_method: 'S256',\n    };\n}\n","/*\n * Copyright (c) 2026.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { OAuth2AuthorizationPrompt } from '@authup/specs';\n\nconst STORAGE_KEY = 'authup.authorization-request';\n\n/**\n * The state persisted between the `/authorize` redirect and the callback.\n * `state` guards against CSRF and `code_verifier` is the PKCE secret, so both\n * have to stay in the browser that started the flow. `redirect_uri` is here\n * because it must be replayed byte-for-byte at the `/token` exchange\n * (RFC 6749 §4.1.3) — take it from here, never rebuild it from\n * `window.location`, which by then carries the appended `code` and `state`\n * and a re-serialized query.\n *\n * The post-login destination is deliberately NOT stored here. It rides in the\n * `redirect_uri`'s own query (`<origin>/login/callback?redirect=%2Fusers`), so\n * the authorization server carries it back and any client can use the same\n * mechanism without agreeing on a storage convention.\n */\nexport type AuthorizationRequest = {\n    state: string,\n    code_verifier: string,\n    redirect_uri: string,\n    client_id: string,\n    realm_id?: string\n};\n\nexport function saveAuthorizationRequest(request: AuthorizationRequest): void {\n    if (typeof sessionStorage === 'undefined') {\n        return;\n    }\n\n    sessionStorage.setItem(STORAGE_KEY, JSON.stringify(request));\n}\n\nexport function loadAuthorizationRequest(): AuthorizationRequest | undefined {\n    if (typeof sessionStorage === 'undefined') {\n        return undefined;\n    }\n\n    const raw = sessionStorage.getItem(STORAGE_KEY);\n    if (!raw) {\n        return undefined;\n    }\n\n    try {\n        return JSON.parse(raw) as AuthorizationRequest;\n    } catch {\n        return undefined;\n    }\n}\n\nexport function clearAuthorizationRequest(): void {\n    if (typeof sessionStorage === 'undefined') {\n        return;\n    }\n\n    sessionStorage.removeItem(STORAGE_KEY);\n}\n\nexport type BuildAuthorizeURLContext = {\n    baseURL: string,\n    clientId: string,\n    realmId?: string,\n    redirectUri: string,\n    scope?: string,\n    state: string,\n    codeChallenge: string,\n    codeChallengeMethod: string,\n    /**\n     * OIDC `prompt`. Defaults to `select_account` so a lingering session offers\n     * \"continue as / use another account\" instead of silently continuing. Pass\n     * `''` to opt out, or `none`/`login` for silent-auth / forced re-auth.\n     */\n    prompt?: string,\n    maxAge?: number,\n    loginHint?: string\n};\n\nexport function buildAuthorizeURL(ctx: BuildAuthorizeURLContext): string {\n    const base = ctx.baseURL.replace(/\\/+$/, '');\n\n    const params = new URLSearchParams();\n    params.set('response_type', 'code');\n    params.set('client_id', ctx.clientId);\n    if (ctx.realmId) {\n        params.set('realm_id', ctx.realmId);\n    }\n    params.set('scope', ctx.scope ?? 'global openid');\n    params.set('redirect_uri', ctx.redirectUri);\n    params.set('state', ctx.state);\n    params.set('code_challenge', ctx.codeChallenge);\n    params.set('code_challenge_method', ctx.codeChallengeMethod);\n\n    const prompt = ctx.prompt ?? OAuth2AuthorizationPrompt.SELECT_ACCOUNT;\n    if (prompt) {\n        params.set('prompt', prompt);\n    }\n    if (typeof ctx.maxAge !== 'undefined') {\n        params.set('max_age', String(ctx.maxAge));\n    }\n    if (ctx.loginHint) {\n        params.set('login_hint', ctx.loginHint);\n    }\n\n    return `${base}/authorize?${params.toString()}`;\n}\n\nexport type BuildEndSessionURLContext = {\n    baseURL: string,\n    idTokenHint?: string,\n    clientId?: string,\n    postLogoutRedirectUri?: string,\n    state?: string,\n    realmId?: string\n};\n\n/**\n * Build an OIDC RP-Initiated Logout URL for the `end_session_endpoint`.\n */\nexport function buildEndSessionURL(ctx: BuildEndSessionURLContext): string {\n    const base = ctx.baseURL.replace(/\\/+$/, '');\n\n    const params = new URLSearchParams();\n    if (ctx.idTokenHint) {\n        params.set('id_token_hint', ctx.idTokenHint);\n    }\n    if (ctx.clientId) {\n        params.set('client_id', ctx.clientId);\n    }\n    if (ctx.postLogoutRedirectUri) {\n        params.set('post_logout_redirect_uri', ctx.postLogoutRedirectUri);\n    }\n    if (ctx.state) {\n        params.set('state', ctx.state);\n    }\n    if (ctx.realmId) {\n        params.set('realm_id', ctx.realmId);\n    }\n\n    const qs = params.toString();\n    return `${base}/logout${qs ? `?${qs}` : ''}`;\n}\n\nexport type BuildConsoleLoginURLContext = {\n    baseURL: string,\n    /**\n     * The console whose login is being started. Its OAuth2 client and its\n     * return target are what differ per console, which is why this half of the\n     * flow is per-console while the session it produces is not (plan 088).\n     */\n    console?: string,\n    realmId?: string\n};\n\n/**\n * Build the URL of a console's server-side login kick.\n *\n * A NAVIGATION target rather than a request, like `buildAuthorizeURL` and\n * `buildEndSessionURL` beside it: the whole point of the server-side flow is\n * that the PKCE verifier is minted where JavaScript cannot see it, so the\n * browser is handed to the server rather than calling it. Hand-assembling the\n * string at the call site is what this replaces.\n *\n * Every served console sits under the shared `/console/<name>` mount, and its\n * kick is that mount's `/login/start` route. A path of its own rather than\n * `/login`, because `/login` is the console's OWN page: it is where the\n * routing guard sends a signed-out visitor and where a refused callback\n * lands with its `?error=` marker. One URL used to mean both, discriminated\n * by whether a `realmId` was present (098 C1); since the console left\n * server-core the kick can no longer fall back to serving that page, so the\n * two are separate routes.\n */\nexport function buildConsoleLoginURL(ctx: BuildConsoleLoginURLContext): string {\n    const base = ctx.baseURL.replace(/\\/+$/, '');\n    const target = ctx.console || 'account';\n\n    const params = new URLSearchParams();\n    if (ctx.realmId) {\n        params.set('realmId', ctx.realmId);\n    }\n\n    const qs = params.toString();\n    return `${base}/console/${target}/login/start${qs ? `?${qs}` : ''}`;\n}\n","/*\n * Copyright (c) 2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport type { IdentityPolicyData, PermissionEvaluationContext } from '@authup/access';\nimport { BuiltInPolicyType, PolicyData } from '@authup/access';\nimport type { Ref } from 'vue';\nimport {\n    onMounted,\n    onUnmounted,\n    ref,\n    watch,\n} from 'vue';\nimport { useHydratedValue } from '../hydration';\nimport type { Store } from '../store';\nimport { injectStore, storeToRefs } from '../store';\nimport type {\n    PermissionCheckerReactiveFn,\n    PermissionCheckerReactiveFnContext,\n    PermissionCheckerReactiveFnCreateContext,\n} from './types';\n\n/**\n * Identity of a permission question, or undefined when it cannot be keyed.\n *\n * The actor is part of the key. A verdict is only ever a seed for the first\n * render, and keying it to the identity that produced it keeps an account\n * switch from adopting the previous actor's answer. A `PolicyData` bag is\n * per-call resource state rather than a stable identity, so those checks opt\n * out and keep evaluating from their fail-closed default.\n */\nfunction buildPermissionHydrationKey(\n    ctx: PermissionEvaluationContext,\n    identity: { userId?: string | null, realmId?: string | null },\n) : string | undefined {\n    if (ctx.data) {\n        return undefined;\n    }\n\n    const name = Array.isArray(ctx.name) ?\n        [...ctx.name].sort().join(',') :\n        ctx.name;\n\n    return [\n        'authup:permission',\n        identity.userId || '',\n        identity.realmId || '',\n        name,\n        ctx.realmId || '',\n        ctx.clientId || '',\n    ].join(':');\n}\n\nexport function createPermissionCheckerReactiveFn(\n    ctx: PermissionCheckerReactiveFnCreateContext = {},\n) : PermissionCheckerReactiveFn {\n    let store : Store;\n    if (ctx.store) {\n        store = ctx.store;\n    } else {\n        store = injectStore(ctx.pinia, ctx.app);\n    }\n\n    const storeRefs = storeToRefs(store);\n\n    // The returned fn registers lifecycle hooks — call it ONCE during setup.\n    // Pass a GETTER to make the evaluation context reactive: the checker\n    // re-evaluates whenever the getter's dependencies (e.g. component props)\n    // change, in addition to the login-state changes it always tracks.\n    return (ctx: PermissionCheckerReactiveFnContext) : Ref<boolean> => {\n        const resolveContext : () => PermissionEvaluationContext = typeof ctx === 'function' ?\n            ctx :\n            () => ctx;\n\n        const data = ref(false);\n\n        // guards a recompute triggered while an earlier evaluation is still\n        // in flight — only the latest evaluation may write the outcome (the\n        // stale one ran against a superseded context or login state).\n        let sequence = 0;\n\n        const compute = async () => {\n            let identity: IdentityPolicyData | undefined;\n            if (storeRefs.userId.value) {\n                identity = {\n                    type: 'user',\n                    id: storeRefs.userId.value,\n                };\n\n                if (storeRefs.realmId.value) {\n                    identity.realmId = storeRefs.realmId.value;\n                }\n\n                if (storeRefs.realmName.value) {\n                    identity.realmName = storeRefs.realmName.value;\n                }\n            }\n\n            const evaluationContext = resolveContext();\n\n            const input = evaluationContext.data || new PolicyData();\n            input.set(BuiltInPolicyType.IDENTITY, identity);\n\n            try {\n                return await store.permissionEvaluator\n                    .preEvaluateOneOf({\n                        ...evaluationContext,\n                        data: input,\n                    })\n                    .then(() => true)\n                    .catch(() => false);\n            } catch {\n                return false;\n            }\n        };\n\n        const recompute = () => {\n            sequence++;\n            const current = sequence;\n\n            // fail closed while the replacement evaluation is pending — a\n            // previously allowed outcome must not keep authorizing across a\n            // context/login change.\n            data.value = false;\n\n            return Promise.resolve()\n                .then(() => compute())\n                .then((outcome) => {\n                    if (current === sequence) {\n                        data.value = outcome;\n                    }\n\n                    return outcome;\n                });\n        };\n\n        const pending = recompute();\n\n        // The evaluation is async, so a server-rendered subtree shows the\n        // verdict while the hydrating client is still at its fail-closed\n        // default: a mismatch on everything gated by a permission. Seed the\n        // first client render with what the render decided; `recompute` above\n        // is already in flight and stays authoritative.\n        const hydrationKey = buildPermissionHydrationKey(resolveContext(), {\n            userId: storeRefs.userId.value,\n            realmId: storeRefs.realmId.value,\n        });\n        if (hydrationKey) {\n            useHydratedValue<boolean>({\n                key: hydrationKey,\n                resolve: () => pending,\n                apply: (value) => {\n                    data.value = value;\n                },\n            });\n        }\n\n        let removeListener: undefined | CallableFunction;\n        onMounted(() => {\n            // `status`, not the token-derived `loggedIn`: a cookie session\n            // (plan 088) never holds an access token, so that flag never flips\n            // and the verdict would latch at its fail-closed default. Both\n            // flip in the same synchronous commit as the permissions, so bearer\n            // mode re-evaluates at the same instant it did before.\n            removeListener = watch(\n                [storeRefs.status, resolveContext],\n                () => recompute(),\n            );\n        });\n\n        onUnmounted(() => {\n            if (typeof removeListener !== 'undefined') {\n                removeListener();\n            }\n        });\n\n        return data;\n    };\n}\n","/*\n * Copyright (c) 2022-2023.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport type { App } from 'vue';\nimport type { ClientManager } from '@authup/core-realtime-kit';\nimport { inject } from '../inject';\nimport { provide } from '../provide';\n\nexport const SocketClientSymbol = Symbol.for('AuthupSocketManager');\n\nexport function isSocketManagerUsable() {\n    return !!inject(SocketClientSymbol);\n}\n\nexport function provideSocketManager(manager: ClientManager, app?: App) {\n    provide(SocketClientSymbol, manager, app);\n}\n\nexport function injectSocketManager(app?: App) : ClientManager {\n    const manager = inject<ClientManager>(SocketClientSymbol, app);\n    if (!manager) {\n        throw new Error('The socket manager has not been injected in the app context.');\n    }\n\n    return manager;\n}\n","/*\n * Copyright (c) 2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { ClientManager } from '@authup/core-realtime-kit';\nimport type { Pinia } from 'pinia';\nimport type { App } from 'vue';\nimport { ref } from 'vue';\nimport { injectStoreFactory, storeToRefs } from '../store';\nimport { provideSocketManager } from './singleton';\n\nexport type SocketManagerInstallOptions = {\n    pinia?: Pinia,\n    baseURL: string\n};\n\nexport function installSocketManager(app: App, options: SocketManagerInstallOptions) {\n    const storeCreator = injectStoreFactory(app);\n    const store = storeCreator(options.pinia);\n    const { accessToken } = storeToRefs(store);\n\n    const manager = new ClientManager({\n        url: options.baseURL,\n        token: () => accessToken.value ?? undefined,\n    });\n\n    const oldValue = ref<string | undefined>();\n\n    store.$subscribe((\n        mutation,\n        state,\n    ) => {\n        const normalizedToken = state.accessToken ?? undefined;\n        if (normalizedToken !== oldValue.value) {\n            oldValue.value = normalizedToken;\n\n            Promise.resolve()\n                .then(() => manager.reconnect());\n        }\n    });\n\n    provideSocketManager(manager, app);\n}\n","/*\n * Copyright (c) 2023.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { hasOwnProperty } from '@authup/kit';\nimport type { Slot, Slots, VNode } from 'vue';\n\n/**\n * Slot-name vocabulary previously exported by `@vuecs/list-controls`.\n * `@vuecs/list` 1.0 (plan 027 compound rewrite) removed the enum;\n * authup keeps the string literals locally so existing collection\n * components and the `EntityCollectionSlotName` re-export keep\n * compiling. New code should prefer the compound `<VCList*>` parts\n * over slot-name dispatch.\n */\nexport enum SlotName {\n    DEFAULT = 'default',\n    FOOTER = 'footer',\n    HEADER = 'header',\n    BODY = 'body',\n    LOADING = 'loading',\n    NO_MORE = 'noMore',\n    ITEM = 'item',\n    ITEM_ACTIONS = 'itemActions',\n    ITEM_ACTIONS_EXTRA = 'itemActionsExtra',\n}\n\n/**\n * Returns true if either scoped or unscoped named slot exists\n *\n * @returns boolean\n *\n * @param name\n * @param $slots\n */\nexport function hasNormalizedSlot(\n    name : string,\n    $slots : Slots = {},\n) {\n    return hasOwnProperty($slots, name);\n}\n\n/**\n * Returns VNodes for named slot either scoped or unscoped\n *\n * @param name\n * @param scope\n * @param $slots\n *\n * @returns {Array} VNodes\n */\nexport function normalizeSlot(\n    name : string,\n    scope: Record<string, any> = {},\n    $slots : Slots = {},\n) : VNode[] | VNode {\n    if (hasOwnProperty($slots, name)) {\n        return ($slots[name] as Slot)(scope);\n    }\n\n    return [];\n}\n","/*\n * Copyright (c) 2022-2026.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport type { Composable } from '@validup/vue';\nimport { getSeverity } from '@validup/vue';\nimport type { ObjectLiteral } from 'validup';\n\n/**\n * Re-export of `@validup/vue`'s `getSeverity()`: `'error'` when the field is\n * `$invalid && $dirty`, `'warning'` for pending-but-dirty, `undefined` for\n * pristine.\n */\nexport { getSeverity };\n\n/**\n * Snapshot the `$model` values of every top-level field in a registered\n * child composable. Successor to the legacy\n * `extractVuelidateResultsFromChild` — replaces vuelidate's\n * `$getResultsForChild` walk with `@validup/vue`'s typed equivalent.\n *\n * Returns a plain `Record<string, any>` for ergonomic spreading into a\n * parent submit body (`{ ...extract(v, 'basic'), ...extract(v, 'type') }`).\n * Returns an empty object when the named child is not registered (mirrors\n * the legacy permissive contract — composing forms that conditionally\n * mount sub-composables should stay graceful).\n */\nexport function extractValidupResultsFromChild<C extends ObjectLiteral = ObjectLiteral>(\n    composable: Composable<any>,\n    name: string,\n    keys?: string[],\n): Record<string, any> {\n    const child = composable.$getResultsForChild<C>(name);\n    if (!child) {\n        return {};\n    }\n\n    const fieldKeys = keys ?? (Object.keys(child.fields) as string[]);\n\n    const output: Record<string, any> = {};\n    for (const key of fieldKeys) {\n        const field = (child.fields as Record<string, { $model: { value: unknown } } | undefined>)[key];\n        if (field) {\n            output[key] = field.$model.value;\n        }\n    }\n    return output;\n}\n","/*\n * Copyright (c) 2026.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { icons as fa6Brands } from '@iconify-json/fa6-brands';\nimport { icons as fa6Solid } from '@iconify-json/fa6-solid';\nimport { addCollection } from '@iconify/vue';\nimport fontAwesome from '@vuecs/icons-font-awesome';\nimport { buildSubmitButtonDefaults } from '../form';\nimport type { VuecsInstallOptions, VuecsInstallOptionsInput } from './types';\n\n/**\n * Register the Iconify icon collections authup's UI renders from\n * (Font Awesome 6 solid + brands). Call once at app bootstrap, before\n * the first `<VCIcon>` render.\n *\n * This registers BOTH collections in full: 1,902 icons, roughly 429 KB\n * gzip, where an app renders a few dozen. Prefer bundling only what is\n * rendered, which authup's own two apps do via `@nuxt/icon`'s standalone\n * vite plugin:\n *\n * ```ts\n * // vite.config.ts (or nuxt.config.ts under `vite.plugins`)\n * import { NuxtIconBundle } from '@nuxt/icon/vite';\n *\n * NuxtIconBundle({\n *     scan: {\n *         globInclude: [\n *             'src/**\\/*.{vue,ts}',\n *             'node_modules/@authup/client-web-kit/dist/**\\/*.mjs',\n *             'node_modules/@vuecs/icons-font-awesome/dist/*.mjs',\n *         ],\n *         globExclude: [],\n *     },\n * })\n * ```\n *\n * ```ts\n * // app entry, instead of calling this function\n * import 'virtual:nuxt-icon-bundle/register';\n * ```\n *\n * The plugin registers through `addIcon` from `@iconify/vue`, the same\n * global store `<VCIcon>` resolves against, so no component changes are\n * needed. Scanning this package and `@vuecs/icons-font-awesome` is\n * required: kit components and the identity-provider preset tables hold\n * roughly half the icon names, and the vuecs preset's behavioral defaults\n * (pagination arrows, submit-button icons, alert icons, collapse chevrons)\n * exist only inside that package.\n *\n * Kept for consumers that cannot run a build-time scan.\n *\n * @deprecated prefer the build-time icon bundle described above.\n */\nexport function registerIconCollections() : void {\n    addCollection(fa6Solid);\n    addCollection(fa6Brands);\n}\n\n/**\n * Build the `app.use(vuecs, ...)` install options shared by authup's UI\n * consumers (apps/client-admin-console's vuecs plugin + the embedded SSR app in\n * apps/client-auth-console): the Font Awesome icon preset and the\n * translator-wired submit-button defaults. Themes stay a caller concern —\n * the kit must not depend on the theme packages (the kit theme peers the\n * kit) — and are passed through in the given order (kit theme first, app\n * theme layers on top).\n *\n * MUST be called within an injection context (a component setup, a Nuxt\n * plugin's `setup()`, or `app.runWithContext(...)`) AFTER the kit's\n * `install()` ran — `buildSubmitButtonDefaults()` reads the ilingo locale\n * provider via `inject()`.\n *\n * Defaults for components the kit does not depend on stay with their\n * consumer: a `@vuecs/navigation` key (the breadcrumb landmark label) would\n * only type-check here if the kit declared that package, and it uses none\n * of its components.\n */\nexport function buildVuecsInstallOptions(input: VuecsInstallOptionsInput = {}) : VuecsInstallOptions {\n    return {\n        themes: input.themes,\n        icons: [fontAwesome()],\n        defaults: { submitButton: buildSubmitButtonDefaults() },\n    };\n}\n","<!--\n  - Copyright (c) 2026.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\nimport { TranslatorTranslationActionKey, TranslatorTranslationNamespace } from '@authup/i18n';\nimport { VCButton } from '@vuecs/button';\nimport { VCIcon } from '@vuecs/icon';\nimport { VCLink } from '@vuecs/link';\nimport { computed, defineComponent } from 'vue';\nimport { useRoute } from 'vue-router';\nimport { DEFAULT_BUTTON_SIZE, useTranslations } from '../../../core';\nimport type { ContentActionMode } from './types';\n\n// Route-aware action for a page title row: \"Add\" while the overview route is\n// active, \"Back\" while the add route is active. Any other route renders\n// nothing, so a section carrying a second list route (an approval queue, a\n// nested lens) does not inherit the button.\nexport default defineComponent({\n    components: { VCButton, VCIcon },\n    props: {\n        overviewUrl: {\n            type: String,\n            required: true,\n        },\n        addUrl: {\n            type: String,\n            required: true,\n        },\n        addDisabled: {\n            type: Boolean,\n            default: false,\n        },\n    },\n    setup(props) {\n        const route = useRoute();\n\n        const normalize = (value: string) => (\n            value.length > 1 && value.endsWith('/') ?\n                value.slice(0, -1) :\n                value\n        );\n\n        const mode = computed<ContentActionMode | undefined>(() => {\n            const path = normalize(route.path);\n\n            if (path === normalize(props.addUrl)) {\n                return 'back';\n            }\n\n            if (path === normalize(props.overviewUrl)) {\n                return 'add';\n            }\n\n            return undefined;\n        });\n\n        const translations = useTranslations([\n            {\n                namespace: TranslatorTranslationNamespace.ACTION,\n                key: TranslatorTranslationActionKey.ADD,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.ACTION,\n                key: TranslatorTranslationActionKey.BACK,\n            },\n        ]);\n\n        return {\n            buttonSize: DEFAULT_BUTTON_SIZE,\n            mode,\n            translations,\n            VCLink,\n        };\n    },\n});\n</script>\n<template>\n    <VCButton\n        v-if=\"mode === 'back'\"\n        :as=\"VCLink\"\n        :to=\"overviewUrl\"\n        :size=\"buttonSize\"\n        color=\"neutral\"\n        variant=\"outline\"\n    >\n        <template #leading>\n            <VCIcon name=\"fa6-solid:arrow-left\" />\n        </template>\n        {{ translations.back }}\n    </VCButton>\n    <VCButton\n        v-else-if=\"mode === 'add'\"\n        :as=\"VCLink\"\n        :to=\"addUrl\"\n        :size=\"buttonSize\"\n        color=\"primary\"\n        :disabled=\"addDisabled\"\n    >\n        <template #leading>\n            <VCIcon name=\"fa6-solid:plus\" />\n        </template>\n        {{ translations.add }}\n    </VCButton>\n</template>\n","<!--\n  - Copyright (c) 2026.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\nimport { TranslatorTranslationActionKey, TranslatorTranslationNamespace } from '@authup/i18n';\nimport { VCButton } from '@vuecs/button';\nimport { VCIcon } from '@vuecs/icon';\nimport { VCLink } from '@vuecs/link';\nimport { computed, defineComponent } from 'vue';\nimport { useRoute } from 'vue-router';\nimport { DEFAULT_BUTTON_SIZE, useTranslations } from '../../../core';\nimport type { ContentActionMode } from './types';\n\n// Route-aware action for a page title row: \"Add\" while the overview route is\n// active, \"Back\" while the add route is active. Any other route renders\n// nothing, so a section carrying a second list route (an approval queue, a\n// nested lens) does not inherit the button.\nexport default defineComponent({\n    components: { VCButton, VCIcon },\n    props: {\n        overviewUrl: {\n            type: String,\n            required: true,\n        },\n        addUrl: {\n            type: String,\n            required: true,\n        },\n        addDisabled: {\n            type: Boolean,\n            default: false,\n        },\n    },\n    setup(props) {\n        const route = useRoute();\n\n        const normalize = (value: string) => (\n            value.length > 1 && value.endsWith('/') ?\n                value.slice(0, -1) :\n                value\n        );\n\n        const mode = computed<ContentActionMode | undefined>(() => {\n            const path = normalize(route.path);\n\n            if (path === normalize(props.addUrl)) {\n                return 'back';\n            }\n\n            if (path === normalize(props.overviewUrl)) {\n                return 'add';\n            }\n\n            return undefined;\n        });\n\n        const translations = useTranslations([\n            {\n                namespace: TranslatorTranslationNamespace.ACTION,\n                key: TranslatorTranslationActionKey.ADD,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.ACTION,\n                key: TranslatorTranslationActionKey.BACK,\n            },\n        ]);\n\n        return {\n            buttonSize: DEFAULT_BUTTON_SIZE,\n            mode,\n            translations,\n            VCLink,\n        };\n    },\n});\n</script>\n<template>\n    <VCButton\n        v-if=\"mode === 'back'\"\n        :as=\"VCLink\"\n        :to=\"overviewUrl\"\n        :size=\"buttonSize\"\n        color=\"neutral\"\n        variant=\"outline\"\n    >\n        <template #leading>\n            <VCIcon name=\"fa6-solid:arrow-left\" />\n        </template>\n        {{ translations.back }}\n    </VCButton>\n    <VCButton\n        v-else-if=\"mode === 'add'\"\n        :as=\"VCLink\"\n        :to=\"addUrl\"\n        :size=\"buttonSize\"\n        color=\"primary\"\n        :disabled=\"addDisabled\"\n    >\n        <template #leading>\n            <VCIcon name=\"fa6-solid:plus\" />\n        </template>\n        {{ translations.add }}\n    </VCButton>\n</template>\n","import { globalConfig } from \"./core.js\";\n// functions\nexport function assertEqual(val) {\n    return val;\n}\nexport function assertNotEqual(val) {\n    return val;\n}\nexport function toZod() {\n    return (schema) => schema;\n}\nexport function assertIs(_arg) { }\nexport function assertNever(_x) {\n    throw new Error(\"Unexpected value in exhaustive check\");\n}\nexport function assert(_) { }\nexport function getEnumValues(entries) {\n    const numericValues = Object.values(entries).filter((v) => typeof v === \"number\");\n    const values = Object.entries(entries)\n        .filter(([k, _]) => numericValues.indexOf(+k) === -1)\n        .map(([_, v]) => v);\n    return values;\n}\nexport function joinValues(array, separator = \"|\") {\n    return array.map((val) => stringifyPrimitive(val)).join(separator);\n}\nexport function jsonStringifyReplacer(_, value) {\n    if (typeof value === \"bigint\")\n        return value.toString();\n    return value;\n}\nexport function cached(getter) {\n    const set = false;\n    return {\n        get value() {\n            if (!set) {\n                const value = getter();\n                Object.defineProperty(this, \"value\", { value });\n                return value;\n            }\n            throw new Error(\"cached value already set\");\n        },\n    };\n}\nexport function nullish(input) {\n    return input === null || input === undefined;\n}\nexport function cleanRegex(source) {\n    const start = source.startsWith(\"^\") ? 1 : 0;\n    const end = source.endsWith(\"$\") ? source.length - 1 : source.length;\n    return source.slice(start, end);\n}\nexport function floatSafeRemainder(val, step) {\n    const ratio = val / step;\n    const roundedRatio = Math.round(ratio);\n    // `val` and `step` each round to a double before the division rounds again, so a true decimal multiple's quotient can sit up to 1.5 of these scaled epsilons from the integer. A 1x tolerance therefore rejected 2.03 as a multiple of 0.07; 4x covers the worst case with margin.\n    const tolerance = 4 * Number.EPSILON * Math.max(Math.abs(ratio), 1);\n    if (Math.abs(ratio - roundedRatio) < tolerance)\n        return 0;\n    return ratio - roundedRatio;\n}\nconst EVALUATING = /* @__PURE__*/ Symbol(\"evaluating\");\nexport function defineLazy(object, key, getter) {\n    let value = undefined;\n    Object.defineProperty(object, key, {\n        get() {\n            if (value === EVALUATING) {\n                // Circular reference detected, return undefined to break the cycle\n                return undefined;\n            }\n            if (value === undefined) {\n                value = EVALUATING;\n                value = getter();\n            }\n            return value;\n        },\n        set(v) {\n            Object.defineProperty(object, key, {\n                value: v,\n                // configurable: true,\n            });\n            // object[key] = v;\n        },\n        configurable: true,\n    });\n}\nexport function objectClone(obj) {\n    return Object.create(Object.getPrototypeOf(obj), Object.getOwnPropertyDescriptors(obj));\n}\nexport function assignProp(target, prop, value) {\n    Object.defineProperty(target, prop, {\n        value,\n        writable: true,\n        enumerable: true,\n        configurable: true,\n    });\n}\nexport function mergeDefs(...defs) {\n    const mergedDescriptors = {};\n    for (const def of defs) {\n        const descriptors = Object.getOwnPropertyDescriptors(def);\n        Object.assign(mergedDescriptors, descriptors);\n    }\n    return Object.defineProperties({}, mergedDescriptors);\n}\nexport function cloneDef(schema) {\n    return mergeDefs(schema._zod.def);\n}\nexport function getElementAtPath(obj, path) {\n    if (!path)\n        return obj;\n    return path.reduce((acc, key) => acc?.[key], obj);\n}\nexport function promiseAllObject(promisesObj) {\n    const keys = Object.keys(promisesObj);\n    const promises = keys.map((key) => promisesObj[key]);\n    return Promise.all(promises).then((results) => {\n        const resolvedObj = {};\n        for (let i = 0; i < keys.length; i++) {\n            resolvedObj[keys[i]] = results[i];\n        }\n        return resolvedObj;\n    });\n}\nexport function randomString(length = 10) {\n    const chars = \"abcdefghijklmnopqrstuvwxyz\";\n    let str = \"\";\n    for (let i = 0; i < length; i++) {\n        str += chars[Math.floor(Math.random() * chars.length)];\n    }\n    return str;\n}\nexport function esc(str) {\n    return JSON.stringify(str);\n}\nexport function slugify(input) {\n    return input\n        .toLowerCase()\n        .trim()\n        .replace(/[^\\w\\s-]/g, \"\")\n        .replace(/[\\s_-]+/g, \"-\")\n        .replace(/^-+|-+$/g, \"\");\n}\nexport const captureStackTrace = (\"captureStackTrace\" in Error ? Error.captureStackTrace : (..._args) => { });\nexport function isObject(data) {\n    return typeof data === \"object\" && data !== null && !Array.isArray(data);\n}\nexport const allowsEval = /* @__PURE__*/ cached(() => {\n    // Skip the probe under `jitless`: strict CSPs report the caught `new Function` as a `securitypolicyviolation` even though the throw is swallowed.\n    if (globalConfig.jitless) {\n        return false;\n    }\n    // @ts-ignore\n    if (typeof navigator !== \"undefined\" && navigator?.userAgent?.includes(\"Cloudflare\")) {\n        return false;\n    }\n    try {\n        const F = Function;\n        new F(\"\");\n        return true;\n    }\n    catch (_) {\n        return false;\n    }\n});\nexport function isPlainObject(o) {\n    if (isObject(o) === false)\n        return false;\n    // modified constructor\n    const ctor = o.constructor;\n    if (ctor === undefined)\n        return true;\n    if (typeof ctor !== \"function\")\n        return true;\n    // modified prototype\n    const prot = ctor.prototype;\n    if (isObject(prot) === false)\n        return false;\n    // ctor doesn't have static `isPrototypeOf`\n    if (Object.prototype.hasOwnProperty.call(prot, \"isPrototypeOf\") === false) {\n        return false;\n    }\n    return true;\n}\nexport function shallowClone(o) {\n    if (isPlainObject(o))\n        return { ...o };\n    if (Array.isArray(o))\n        return [...o];\n    if (o instanceof Map)\n        return new Map(o);\n    if (o instanceof Set)\n        return new Set(o);\n    return o;\n}\nexport function numKeys(data) {\n    let keyCount = 0;\n    for (const key in data) {\n        if (Object.prototype.hasOwnProperty.call(data, key)) {\n            keyCount++;\n        }\n    }\n    return keyCount;\n}\nexport const getParsedType = (data) => {\n    const t = typeof data;\n    switch (t) {\n        case \"undefined\":\n            return \"undefined\";\n        case \"string\":\n            return \"string\";\n        case \"number\":\n            return Number.isNaN(data) ? \"nan\" : \"number\";\n        case \"boolean\":\n            return \"boolean\";\n        case \"function\":\n            return \"function\";\n        case \"bigint\":\n            return \"bigint\";\n        case \"symbol\":\n            return \"symbol\";\n        case \"object\":\n            if (Array.isArray(data)) {\n                return \"array\";\n            }\n            if (data === null) {\n                return \"null\";\n            }\n            if (data.then && typeof data.then === \"function\" && data.catch && typeof data.catch === \"function\") {\n                return \"promise\";\n            }\n            if (typeof Map !== \"undefined\" && data instanceof Map) {\n                return \"map\";\n            }\n            if (typeof Set !== \"undefined\" && data instanceof Set) {\n                return \"set\";\n            }\n            if (typeof Date !== \"undefined\" && data instanceof Date) {\n                return \"date\";\n            }\n            // @ts-ignore\n            if (typeof File !== \"undefined\" && data instanceof File) {\n                return \"file\";\n            }\n            return \"object\";\n        default:\n            throw new Error(`Unknown data type: ${t}`);\n    }\n};\nexport const propertyKeyTypes = /* @__PURE__*/ new Set([\"string\", \"number\", \"symbol\"]);\nexport const primitiveTypes = /* @__PURE__*/ new Set([\n    \"string\",\n    \"number\",\n    \"bigint\",\n    \"boolean\",\n    \"symbol\",\n    \"undefined\",\n]);\nexport function escapeRegex(str) {\n    return str.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n}\n// zod-specific utils\nexport function clone(inst, def, params) {\n    const cl = new inst._zod.constr(def ?? inst._zod.def);\n    if (!def || params?.parent)\n        cl._zod.parent = inst;\n    return cl;\n}\nexport function normalizeParams(_params) {\n    const params = _params;\n    if (!params)\n        return {};\n    if (typeof params === \"string\")\n        return { error: () => params };\n    if (params?.message !== undefined) {\n        if (params?.error !== undefined)\n            throw new Error(\"Cannot specify both `message` and `error` params\");\n        params.error = params.message;\n    }\n    delete params.message;\n    if (typeof params.error === \"string\")\n        return { ...params, error: () => params.error };\n    return params;\n}\nexport function createTransparentProxy(getter) {\n    let target;\n    return new Proxy({}, {\n        get(_, prop, receiver) {\n            target ?? (target = getter());\n            return Reflect.get(target, prop, receiver);\n        },\n        set(_, prop, value, receiver) {\n            target ?? (target = getter());\n            return Reflect.set(target, prop, value, receiver);\n        },\n        has(_, prop) {\n            target ?? (target = getter());\n            return Reflect.has(target, prop);\n        },\n        deleteProperty(_, prop) {\n            target ?? (target = getter());\n            return Reflect.deleteProperty(target, prop);\n        },\n        ownKeys(_) {\n            target ?? (target = getter());\n            return Reflect.ownKeys(target);\n        },\n        getOwnPropertyDescriptor(_, prop) {\n            target ?? (target = getter());\n            return Reflect.getOwnPropertyDescriptor(target, prop);\n        },\n        defineProperty(_, prop, descriptor) {\n            target ?? (target = getter());\n            return Reflect.defineProperty(target, prop, descriptor);\n        },\n    });\n}\nexport function stringifyPrimitive(value) {\n    if (typeof value === \"bigint\")\n        return value.toString() + \"n\";\n    if (typeof value === \"string\")\n        return `\"${value}\"`;\n    return `${value}`;\n}\nexport function optionalKeys(shape) {\n    return Object.keys(shape).filter((k) => {\n        return shape[k]._zod.optin !== undefined && shape[k]._zod.optout === \"optional\";\n    });\n}\n// Wrapped in a `@__PURE__` IIFE: esbuild never tree-shakes a top-level initializer that contains a member access on `Number`, so the bare object literal survived into every bundle.\nexport const NUMBER_FORMAT_RANGES = /*@__PURE__*/ (() => ({\n    safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],\n    int32: [-2147483648, 2147483647],\n    uint32: [0, 4294967295],\n    float32: [-3.4028234663852886e38, 3.4028234663852886e38],\n    float64: [-Number.MAX_VALUE, Number.MAX_VALUE],\n}))();\nexport const BIGINT_FORMAT_RANGES = {\n    int64: [/* @__PURE__*/ BigInt(\"-9223372036854775808\"), /* @__PURE__*/ BigInt(\"9223372036854775807\")],\n    uint64: [/* @__PURE__*/ BigInt(0), /* @__PURE__*/ BigInt(\"18446744073709551615\")],\n};\nexport function pick(schema, mask) {\n    const currDef = schema._zod.def;\n    const checks = currDef.checks;\n    const hasChecks = checks && checks.length > 0;\n    if (hasChecks) {\n        throw new Error(\".pick() cannot be used on object schemas containing refinements\");\n    }\n    const def = mergeDefs(schema._zod.def, {\n        get shape() {\n            const newShape = {};\n            // `for...in` skips symbols, so a symbol in the mask would select nothing\n            for (const key of Reflect.ownKeys(mask)) {\n                if (!Object.prototype.hasOwnProperty.call(currDef.shape, key)) {\n                    throw new Error(`Unrecognized key: \"${String(key)}\"`);\n                }\n                if (!mask[key])\n                    continue;\n                assignProp(newShape, key, currDef.shape[key]);\n            }\n            assignProp(this, \"shape\", newShape); // self-caching\n            return newShape;\n        },\n        checks: [],\n    });\n    return clone(schema, def);\n}\nexport function omit(schema, mask) {\n    const currDef = schema._zod.def;\n    const checks = currDef.checks;\n    const hasChecks = checks && checks.length > 0;\n    if (hasChecks) {\n        throw new Error(\".omit() cannot be used on object schemas containing refinements\");\n    }\n    const def = mergeDefs(schema._zod.def, {\n        get shape() {\n            const newShape = { ...schema._zod.def.shape };\n            for (const key of Reflect.ownKeys(mask)) {\n                if (!Object.prototype.hasOwnProperty.call(currDef.shape, key)) {\n                    throw new Error(`Unrecognized key: \"${String(key)}\"`);\n                }\n                if (!mask[key])\n                    continue;\n                delete newShape[key];\n            }\n            assignProp(this, \"shape\", newShape); // self-caching\n            return newShape;\n        },\n        checks: [],\n    });\n    return clone(schema, def);\n}\nexport function extend(schema, shape) {\n    if (!isPlainObject(shape)) {\n        throw new Error(\"Invalid input to extend: expected a plain object\");\n    }\n    const checks = schema._zod.def.checks;\n    const hasChecks = checks && checks.length > 0;\n    if (hasChecks) {\n        // Only throw if new shape overlaps with existing shape. Use getOwnPropertyDescriptor to check key existence without accessing values\n        const existingShape = schema._zod.def.shape;\n        for (const key of Reflect.ownKeys(shape)) {\n            if (Object.getOwnPropertyDescriptor(existingShape, key) !== undefined) {\n                throw new Error(\"Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.\");\n            }\n        }\n    }\n    const def = mergeDefs(schema._zod.def, {\n        get shape() {\n            const _shape = { ...schema._zod.def.shape, ...shape };\n            assignProp(this, \"shape\", _shape); // self-caching\n            return _shape;\n        },\n    });\n    return clone(schema, def);\n}\nexport function safeExtend(schema, shape) {\n    if (!isPlainObject(shape)) {\n        throw new Error(\"Invalid input to safeExtend: expected a plain object\");\n    }\n    const def = mergeDefs(schema._zod.def, {\n        get shape() {\n            const _shape = { ...schema._zod.def.shape, ...shape };\n            assignProp(this, \"shape\", _shape); // self-caching\n            return _shape;\n        },\n    });\n    return clone(schema, def);\n}\nexport function merge(a, b) {\n    if (!b?._zod?.def) {\n        throw new Error(\"Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.\");\n    }\n    if (a._zod.def.checks?.length) {\n        throw new Error(\".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.\");\n    }\n    const def = mergeDefs(a._zod.def, {\n        get shape() {\n            const _shape = { ...a._zod.def.shape, ...b._zod.def.shape };\n            assignProp(this, \"shape\", _shape); // self-caching\n            return _shape;\n        },\n        get catchall() {\n            return b._zod.def.catchall;\n        },\n        checks: b._zod.def.checks ?? [],\n    });\n    return clone(a, def);\n}\nexport function partial(Class, schema, mask, name = \"partial\") {\n    const currDef = schema._zod.def;\n    const checks = currDef.checks;\n    const hasChecks = checks && checks.length > 0;\n    if (hasChecks) {\n        throw new Error(`.${name}() cannot be used on object schemas containing refinements`);\n    }\n    const def = mergeDefs(schema._zod.def, {\n        get shape() {\n            const oldShape = schema._zod.def.shape;\n            const shape = { ...oldShape };\n            if (mask) {\n                for (const key of Reflect.ownKeys(mask)) {\n                    if (!Object.prototype.hasOwnProperty.call(oldShape, key)) {\n                        throw new Error(`Unrecognized key: \"${String(key)}\"`);\n                    }\n                    if (!mask[key])\n                        continue;\n                    // if (oldShape[key]!._zod.optin === \"optional\") continue;\n                    shape[key] = Class\n                        ? new Class({\n                            type: \"optional\",\n                            innerType: oldShape[key],\n                        })\n                        : oldShape[key];\n                }\n            }\n            else {\n                // the spread copies symbol keys; `for...in` would not reach them\n                for (const key of Reflect.ownKeys(oldShape)) {\n                    // if (oldShape[key]!._zod.optin === \"optional\") continue;\n                    shape[key] = Class\n                        ? new Class({\n                            type: \"optional\",\n                            innerType: oldShape[key],\n                        })\n                        : oldShape[key];\n                }\n            }\n            assignProp(this, \"shape\", shape); // self-caching\n            return shape;\n        },\n        checks: [],\n    });\n    return clone(schema, def);\n}\nexport function required(Class, schema, mask) {\n    const def = mergeDefs(schema._zod.def, {\n        get shape() {\n            const oldShape = schema._zod.def.shape;\n            const shape = { ...oldShape };\n            if (mask) {\n                for (const key of Reflect.ownKeys(mask)) {\n                    if (!Object.prototype.hasOwnProperty.call(shape, key)) {\n                        throw new Error(`Unrecognized key: \"${String(key)}\"`);\n                    }\n                    if (!mask[key])\n                        continue;\n                    // overwrite with non-optional\n                    shape[key] = new Class({\n                        type: \"nonoptional\",\n                        innerType: oldShape[key],\n                    });\n                }\n            }\n            else {\n                for (const key of Reflect.ownKeys(oldShape)) {\n                    // overwrite with non-optional\n                    shape[key] = new Class({\n                        type: \"nonoptional\",\n                        innerType: oldShape[key],\n                    });\n                }\n            }\n            assignProp(this, \"shape\", shape); // self-caching\n            return shape;\n        },\n    });\n    return clone(schema, def);\n}\n// invalid_type | too_big | too_small | invalid_format | not_multiple_of | unrecognized_keys | invalid_union | invalid_key | invalid_element | invalid_value | custom\nexport function aborted(x, startIndex = 0) {\n    if (x.aborted === true)\n        return true;\n    for (let i = startIndex; i < x.issues.length; i++) {\n        if (x.issues[i]?.continue !== true) {\n            return true;\n        }\n    }\n    return false;\n}\n// Checks for explicit abort (continue === false), as opposed to implicit abort (continue === undefined). Used to respect `abort: true` in .refine() even for checks that have a `when` function.\nexport function explicitlyAborted(x, startIndex = 0) {\n    if (x.aborted === true)\n        return true;\n    for (let i = startIndex; i < x.issues.length; i++) {\n        if (x.issues[i]?.continue === false) {\n            return true;\n        }\n    }\n    return false;\n}\nexport function prefixIssues(path, issues) {\n    return issues.map((iss) => {\n        var _a;\n        (_a = iss).path ?? (_a.path = []);\n        iss.path.unshift(path);\n        return iss;\n    });\n}\nexport function unwrapMessage(message) {\n    return typeof message === \"string\" ? message : message?.message;\n}\n/* A check holds no link back to the schema it is attached to — the same check instance is shared by every clone of that schema — so the owner is stamped onto the issues a check just raised, at the only point where both are in scope. Runs on the failure path only; `start` is the issue count from before the check ran. */\nexport function attachSchema(issues, start, inst) {\n    var _a;\n    for (let i = start; i < issues.length; i++) {\n        (_a = issues[i]).schema ?? (_a.schema = inst);\n    }\n}\nexport function finalizeIssue(iss, ctx, config) {\n    var _a;\n    // A schema that raised an issue itself owns it outright, and outranks any stamp an enclosing check left in `attachSchema`. String formats and z.custom() are schema and check at once, so when they act as a check they defer to that stamp instead.\n    const traits = iss.inst?._zod?.traits;\n    if (traits?.has(\"$ZodType\")) {\n        if (traits.has(\"$ZodCheck\"))\n            (_a = iss).schema ?? (_a.schema = iss.inst);\n        else\n            iss.schema = iss.inst;\n    }\n    // Decreasing specificity, first map to return a message wins. `inst` is whatever raised the issue, so a check's own map outranks the owning schema's.\n    const schemaError = iss.schema !== iss.inst ? iss.schema?._zod.def?.error : undefined;\n    const message = iss.message\n        ? iss.message\n        : (unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ??\n            unwrapMessage(schemaError?.(iss)) ??\n            unwrapMessage(ctx?.error?.(iss)) ??\n            unwrapMessage(config.customError?.(iss)) ??\n            unwrapMessage(config.localeError?.(iss)) ??\n            \"Invalid input\");\n    const { inst: _inst, schema: _schema, continue: _continue, input: _input, ...rest } = iss;\n    rest.path ?? (rest.path = []);\n    rest.message = message;\n    if (ctx?.reportInput) {\n        rest.input = _input;\n    }\n    return rest;\n}\nexport function getSizableOrigin(input) {\n    if (input instanceof Set)\n        return \"set\";\n    if (input instanceof Map)\n        return \"map\";\n    // @ts-ignore\n    if (input instanceof File)\n        return \"file\";\n    return \"unknown\";\n}\nconst highSurrogate = /[\\uD800-\\uDBFF]/;\n// Code points in `str`: a surrogate pair counts once, a lone surrogate as itself. Hand-rolled because the string iterator allocates and runs ~250x slower on this path; the regex probe exits ~50x quicker for a string with no astral characters.\nexport function codePointLength(str) {\n    const units = str.length;\n    if (!highSurrogate.test(str))\n        return units;\n    let count = units;\n    for (let i = 0; i < units - 1; i++) {\n        if ((str.charCodeAt(i) & 0xfc00) === 0xd800 && (str.charCodeAt(i + 1) & 0xfc00) === 0xdc00) {\n            count--;\n            i++;\n        }\n    }\n    return count;\n}\nexport function getLengthableOrigin(input) {\n    if (Array.isArray(input))\n        return \"array\";\n    if (typeof input === \"string\")\n        return \"string\";\n    return \"unknown\";\n}\nexport function parsedType(data) {\n    const t = typeof data;\n    switch (t) {\n        case \"number\": {\n            return Number.isNaN(data) ? \"nan\" : \"number\";\n        }\n        case \"object\": {\n            if (data === null) {\n                return \"null\";\n            }\n            if (Array.isArray(data)) {\n                return \"array\";\n            }\n            const obj = data;\n            if (obj && Object.getPrototypeOf(obj) !== Object.prototype && \"constructor\" in obj && obj.constructor) {\n                return obj.constructor.name;\n            }\n        }\n    }\n    return t;\n}\nexport function issue(...args) {\n    const [iss, input, inst] = args;\n    if (typeof iss === \"string\") {\n        return {\n            message: iss,\n            code: \"custom\",\n            input,\n            inst,\n        };\n    }\n    return { ...iss };\n}\nexport function cleanEnum(obj) {\n    return Object.entries(obj)\n        .filter(([k, _]) => {\n        // return true if NaN, meaning it's not a number, thus a string key\n        return Number.isNaN(Number.parseInt(k, 10));\n    })\n        .map((el) => el[1]);\n}\n// Codec utility functions\nexport function base64ToUint8Array(base64) {\n    const binaryString = atob(base64);\n    const bytes = new Uint8Array(binaryString.length);\n    for (let i = 0; i < binaryString.length; i++) {\n        bytes[i] = binaryString.charCodeAt(i);\n    }\n    return bytes;\n}\nexport function uint8ArrayToBase64(bytes) {\n    let binaryString = \"\";\n    for (let i = 0; i < bytes.length; i++) {\n        binaryString += String.fromCharCode(bytes[i]);\n    }\n    return btoa(binaryString);\n}\nexport function base64urlToUint8Array(base64url) {\n    const base64 = base64url.replace(/-/g, \"+\").replace(/_/g, \"/\");\n    const padding = \"=\".repeat((4 - (base64.length % 4)) % 4);\n    return base64ToUint8Array(base64 + padding);\n}\nexport function uint8ArrayToBase64url(bytes) {\n    return uint8ArrayToBase64(bytes).replace(/\\+/g, \"-\").replace(/\\//g, \"_\").replace(/=/g, \"\");\n}\nexport function hexToUint8Array(hex) {\n    const cleanHex = hex.replace(/^0x/, \"\");\n    if (cleanHex.length % 2 !== 0) {\n        throw new Error(\"Invalid hex string length\");\n    }\n    const bytes = new Uint8Array(cleanHex.length / 2);\n    for (let i = 0; i < cleanHex.length; i += 2) {\n        bytes[i / 2] = Number.parseInt(cleanHex.slice(i, i + 2), 16);\n    }\n    return bytes;\n}\nexport function uint8ArrayToHex(bytes) {\n    return Array.from(bytes)\n        .map((b) => b.toString(16).padStart(2, \"0\"))\n        .join(\"\");\n}\n// instanceof\nexport class Class {\n    constructor(..._args) { }\n}\n//////////    PROTOTYPE INSTALLERS     //////////\n//\n// Members live on the prototype and materialize per instance on first read, which keeps own-property count under the step where V8 stops using inline slots. Changing anything here means re-measuring runtime, memory and bundle size together — see \"The three axes\" in AGENTS.md.\n/**\n * Installs a trait's members on its prototype. Each value builds that member for the instance on first read; the built value shadows the accessor as an own property, so a detached `const { parse } = schema` keeps working.\n *\n * Call this from a `proto` initializer, which runs once per prototype — never per instance.\n */\nexport function members(proto, table) {\n    for (const key in table) {\n        const desc = Object.getOwnPropertyDescriptor(table, key);\n        // a getter installs as written, so it stays live: `description` reads through to the registry on every access. not enumerable: an object literal's is, and a prototype member never was\n        if (desc.get)\n            Object.defineProperty(proto, key, { ...desc, enumerable: false });\n        // a method materializes bound on first read, which is what keeps a detached member working: `const opt = schema.optional; opt()`\n        else\n            defineBound(proto, key, desc.value);\n    }\n}\n/** Shadows a prototype member with an own value, so a getter that builds from the instance runs once. */\nexport function own(inst, key, value, enumerable = true) {\n    Object.defineProperty(inst, key, { configurable: true, writable: true, enumerable, value });\n    return value;\n}\n/** Like {@link own}, for a member that was never an own data property and has to stay out of `Object.keys`. */\nexport function hide(inst, key, value) {\n    return own(inst, key, value, false);\n}\nfunction defineBound(proto, key, fn) {\n    Object.defineProperty(proto, key, {\n        configurable: true,\n        get() {\n            // vitest's spyOn calls a prototype getter bare to find the function it wraps, so a nullish receiver answers the raw method\n            return this == null ? fn : own(this, key, fn.bind(this));\n        },\n        set(value) {\n            own(this, key, value);\n        },\n    });\n}\n/** Returns the prototype to install on, or `undefined` if this group is already installed on it. */\nfunction claim(inst, sentinel) {\n    const proto = Object.getPrototypeOf(inst);\n    // Runs on every construction, so `in` rather than the costlier `hasOwnProperty.call`. Sentinels are keys the group itself defines.\n    return sentinel in proto ? undefined : proto;\n}\n// The internals whose init chain is installing. A second call for the same one is a derived constructor overriding its base, so it must not construct another schema in between or the override is dropped.\nlet installing;\n// Set while a getter is running, so a value that resolved through a recursion break is not memoized. One shared descriptor shadows the key for the duration, which costs no per-key allocation.\nlet broke = false;\nconst breaker = {\n    configurable: true,\n    get() {\n        broke = true;\n        return undefined;\n    },\n};\n/**\n * Installs a lazily-derived internal on the `_zod` prototype of `inst`'s\n * constructor, computed from the internals object itself and cached there on\n * first read. One accessor per constructor rather than one per instance.\n */\nexport function defineLazyInternal(inst, key, compute) {\n    const proto = Object.getPrototypeOf(inst._zod);\n    if (key in proto && installing !== inst._zod) {\n        // A repeat construction: everything is installed already. Cleared here so the reference is not held past the first construction of every type.\n        installing = undefined;\n        return;\n    }\n    installing = inst._zod;\n    Object.defineProperty(proto, key, {\n        configurable: true,\n        get() {\n            // Shadowed before computing so a re-entrant read from a recursive schema resolves to undefined instead of running the getter again.\n            Object.defineProperty(this, key, breaker);\n            const outer = broke;\n            broke = false;\n            try {\n                const value = compute(this);\n                // A result that resolved through a recursion break is recomputed once the graph is complete; everything else memoizes, undefined included.\n                if (broke)\n                    delete this[key];\n                else\n                    Object.defineProperty(this, key, { configurable: true, writable: true, value });\n                broke = broke || outer;\n                return value;\n            }\n            catch (err) {\n                // A compute that threw memoizes nothing, so a later read runs it again and fails the same way. The shadow goes with it, since leaving it installed would answer undefined for every later read.\n                delete this[key];\n                broke = broke || outer;\n                throw err;\n            }\n        },\n        set(value) {\n            Object.defineProperty(this, key, { configurable: true, writable: true, value });\n        },\n    });\n}\n/**\n * Installs `key` on `inst`'s prototype, computed by `make` on first read and cached there as an own\n * data property. One accessor per constructor rather than one per instance, because an own accessor\n * puts every instance after the first into v8 dictionary mode. The key doubles as the sentinel.\n */\nexport function installLazyProp(inst, key, make, enumerable) {\n    const proto = claim(inst, key);\n    if (!proto)\n        return;\n    Object.defineProperty(proto, key, {\n        configurable: true,\n        get() {\n            // Shadowed before computing, so a re-entrant read from a self-referential shape resolves to undefined instead of running the getter again. A data property rather than an accessor: an own accessor is the dictionary-mode transition this exists to avoid.\n            const desc = { configurable: true, writable: true, enumerable, value: undefined };\n            Object.defineProperty(this, key, desc);\n            // a compute that throws leaves the shadow behind, so later reads answer undefined instead of re-throwing; `defineLazy` did the same, and `defineLazyInternal`'s delete-on-catch would cost bytes in every bundle for a case only a throwing user getter reaches\n            desc.value = make(this);\n            Object.defineProperty(this, key, desc);\n            return desc.value;\n        },\n        set(value) {\n            Object.defineProperty(this, key, { configurable: true, writable: true, enumerable, value });\n        },\n    });\n}\n/** Marks the thunk `_catch` synthesises for a constant catch value. `Function.length` cannot tell that thunk from a user callback — rest and defaulted parameters both report arity 0 — and a user callback reads `ctx.error`, whose issues only finalize correctly against the caller's per-parse error map. Provenance can say what arity cannot. A plain string key rather than `Symbol.for`, whose call at module scope no bundler can prove pure — the same shape that anchored `urlCanParse` into every build. */\nexport const CONSTANT_CATCH = \"~constantCatch\";\n/** Wraps a constant catch value in a thunk tagged with {@link CONSTANT_CATCH}. */\nexport function constantCatch(value) {\n    const fn = () => value;\n    fn[CONSTANT_CATCH] = true;\n    return fn;\n}\n","var _a;\nimport { members as installMembers } from \"./util.js\";\n/** A special constant with type `never` */\nexport const NEVER = /*@__PURE__*/ Object.freeze({\n    status: \"aborted\",\n});\n/* Shared descriptor for installing `_zod`; defineProperty reads it\n * synchronously, so reusing one object avoids a per-instance allocation. */\nconst _zodDesc = { value: undefined, enumerable: false };\n// null where suppressing the capture would be unrecoverable: `parse()` puts the frames back with `captureStackTrace`, so without it the throw would lose its stack. also latched to null once `stackTraceLimit` proves unassignable, which a realm can do at any point by hardening Error\nlet _E = \"captureStackTrace\" in Error ? Error : null;\n// v8 captures a stack trace inside the Error constructor, which dominates a failed parse; costs only the frames, and parse() restores those. the constructor must RUN: Object.create is cheaper and passes instanceof, but Error.isError and util.types.isNativeError check an internal slot\nfunction newError(Definition) {\n    const E = _E;\n    if (E) {\n        const saved = E.stackTraceLimit;\n        if (typeof saved === \"number\") {\n            try {\n                E.stackTraceLimit = 0;\n            }\n            catch {\n                _E = null;\n                return new Definition();\n            }\n            try {\n                return new Definition();\n            }\n            finally {\n                E.stackTraceLimit = saved;\n            }\n        }\n    }\n    return new Definition();\n}\nexport /*@__NO_SIDE_EFFECTS__*/ function $constructor(name, initializer, \n/** This trait's members, installed once on every prototype that composes it. They cannot be declared in the initializer above: that runs per instance, and the prototype is shared. */\nproto, params) {\n    // Prototype for this constructor's `_zod` internals. Lazily-derived fields (`values`, `pattern`, `optin`, …) install here once rather than as an accessor on every instance.\n    const zodProto = {};\n    // Assigning the fields in the constructor body is what gives instances in-object slots; building the object literally and reparenting it costs a second allocation and a generic property copy.\n    function Internals(def) {\n        this.def = def;\n        this.constr = _;\n        this.traits = new Set();\n    }\n    Internals.prototype = zodProto;\n    const protoMembers = proto;\n    // One trait's members land on every prototype whose chain composes it, so the answer is per prototype rather than per trait.\n    const initialized = protoMembers && new WeakSet();\n    function init(inst, def) {\n        if (!inst._zod) {\n            _zodDesc.value = new Internals(def);\n            try {\n                Object.defineProperty(inst, \"_zod\", _zodDesc);\n            }\n            finally {\n                // Cleared even on throw, so the shared descriptor never leaks one instance's internals into the next.\n                _zodDesc.value = undefined;\n            }\n        }\n        if (inst._zod.traits.has(name)) {\n            return;\n        }\n        inst._zod.traits.add(name);\n        initializer(inst, def);\n        if (initialized) {\n            // `super(def)` from a user subclass gives `this` a prototype the subclass owns, and installing there would overwrite whatever the subclass declared. `constr` built the instance, so its prototype is the one below the subclass's that should carry the members. A receiver whose chain never reaches that prototype installs on its own, which for a plain object handed straight to `init` means `Object.prototype` — unchanged from before.\n            const own = Object.getPrototypeOf(inst);\n            const ctorProto = inst._zod.constr.prototype;\n            let up = own;\n            while (up && up !== ctorProto)\n                up = Object.getPrototypeOf(up);\n            const target = up ?? own;\n            if (!initialized.has(target)) {\n                initialized.add(target);\n                installMembers(target, protoMembers);\n            }\n        }\n        // support prototype modifications; for-in avoids the array allocation of Object.keys on the (usually empty) prototype\n        const proto = _.prototype;\n        for (const k in proto) {\n            if (!Object.prototype.hasOwnProperty.call(proto, k))\n                continue;\n            if (!(k in inst)) {\n                inst[k] = proto[k].bind(inst);\n            }\n        }\n    }\n    // doesn't work if Parent has a constructor with arguments\n    const Parent = params?.Parent ?? Object;\n    class Definition extends Parent {\n    }\n    Object.defineProperty(Definition, \"name\", { value: name });\n    function _(def) {\n        const inst = params?.Parent ? newError(Definition) : this;\n        init(inst, def);\n        const deferred = inst._zod.deferred;\n        if (deferred) {\n            for (const fn of deferred) {\n                fn();\n            }\n            // Released: initializers run once, and the list would otherwise be retained for the schema's lifetime.\n            inst._zod.deferred = undefined;\n        }\n        // Global post-processor hook. Internal: installed by `import \"zod/compile\"` to enable AOT compilation for every constructed schema. Runs last, once the instance is fully built, because it hands the instance to compile(). The post-processor is expected to be reentrancy-guarded by its own implementation.\n        const pp = globalThis.__zod_globalConfig?.postProcessor;\n        if (pp)\n            pp(inst);\n        return inst;\n    }\n    Object.defineProperty(_, \"init\", { value: init });\n    Object.defineProperty(_, Symbol.hasInstance, {\n        value: (inst) => {\n            if (params?.Parent && inst instanceof params.Parent)\n                return true;\n            return inst?._zod?.traits?.has(name);\n        },\n    });\n    Object.defineProperty(_, \"name\", { value: name });\n    return _;\n}\n//////////////////////////////   UTILITIES   ///////////////////////////////////////\nexport const $brand = /*@__PURE__*/ Symbol(\"zod_brand\");\nexport class $ZodAsyncError extends Error {\n    constructor() {\n        super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`);\n    }\n}\nexport class $ZodEncodeError extends Error {\n    constructor(name) {\n        super(`Encountered unidirectional transform during encode: ${name}`);\n        this.name = \"ZodEncodeError\";\n    }\n}\n(_a = globalThis).__zod_globalConfig ?? (_a.__zod_globalConfig = {});\nexport const globalConfig = globalThis.__zod_globalConfig;\nexport function config(newConfig) {\n    if (newConfig)\n        Object.assign(globalConfig, newConfig);\n    return globalConfig;\n}\n","import { $constructor } from \"./core.js\";\nimport * as util from \"./util.js\";\n/* Computing the message eagerly is expensive (pretty-printed JSON of all\n * issues), so defer it until first read. The accessor functions and\n * descriptors are shared across instances to keep error construction\n * cheap; the computed message is cached on the internals object. The\n * setter preserves plain assignment semantics for consumers that\n * overwrite `message`. */\nfunction _getMessage() {\n    const internals = this._zod;\n    internals.message ?? (internals.message = JSON.stringify(internals.def, util.jsonStringifyReplacer, 2));\n    return internals.message;\n}\nfunction _setMessage(value) {\n    this._zod.message = value;\n}\nconst _messageDesc = {\n    get: _getMessage,\n    set: _setMessage,\n    enumerable: true,\n    configurable: true,\n};\nconst _zodDesc = { value: undefined, enumerable: false };\nconst _issuesDesc = { value: undefined, enumerable: false };\n/* Prototypes that already carry the lazy `toString`. Seeded with the\n * intrinsics so that `init` on a foreign object — it accepts any object —\n * can never install an accessor onto a prototype we do not own. */\nconst _installedToString = /* @__PURE__ */ new WeakSet([Object.prototype, Error.prototype]);\nconst initializer = (inst, def) => {\n    inst.name = \"$ZodError\";\n    _zodDesc.value = inst._zod;\n    Object.defineProperty(inst, \"_zod\", _zodDesc);\n    _issuesDesc.value = def;\n    Object.defineProperty(inst, \"issues\", _issuesDesc);\n    // Clear the shared slots; a retained `value` pins the last error's issues.\n    _zodDesc.value = undefined;\n    _issuesDesc.value = undefined;\n    Object.defineProperty(inst, \"message\", _messageDesc);\n    /* `toString` lives as a non-enumerable lazy getter on the shared\n     * prototype; on first access it caches a per-instance closure so\n     * detached usage still works. */\n    const proto = Object.getPrototypeOf(inst);\n    if (!_installedToString.has(proto)) {\n        _installedToString.add(proto);\n        Object.defineProperty(proto, \"toString\", {\n            configurable: true,\n            enumerable: false,\n            get() {\n                const value = () => this.message;\n                Object.defineProperty(this, \"toString\", { value, configurable: true, writable: true });\n                return value;\n            },\n            set(value) {\n                Object.defineProperty(this, \"toString\", { value, configurable: true, writable: true });\n            },\n        });\n    }\n};\nexport const $ZodError = $constructor(\"$ZodError\", initializer);\nexport const $ZodRealError = $constructor(\"$ZodError\", initializer, undefined, {\n    Parent: Error,\n});\n/** Get-or-create `obj[key]` as an own data property. A path segment naming an inherited member\n * (\"toString\", \"constructor\") would otherwise read through to the prototype, and assigning\n * \"__proto__\" would hit the setter instead of creating a key. */\nfunction node(obj, key, make) {\n    if (!Object.prototype.hasOwnProperty.call(obj, key)) {\n        if (key === \"__proto__\") {\n            Object.defineProperty(obj, key, { value: make(), writable: true, enumerable: true, configurable: true });\n        }\n        else {\n            obj[key] = make();\n        }\n    }\n    return obj[key];\n}\nexport function flattenError(error, mapper = (issue) => issue.message) {\n    const fieldErrors = {};\n    const formErrors = [];\n    for (const sub of error.issues) {\n        if (sub.path.length > 0) {\n            node(fieldErrors, sub.path[0], () => []).push(mapper(sub));\n        }\n        else {\n            formErrors.push(mapper(sub));\n        }\n    }\n    return { formErrors, fieldErrors };\n}\nexport function formatError(error, mapper = (issue) => issue.message) {\n    const fieldErrors = { _errors: [] };\n    const processError = (error, path = []) => {\n        for (const issue of error.issues) {\n            if (issue.code === \"invalid_union\" && issue.errors.length) {\n                issue.errors.map((issues) => processError({ issues }, [...path, ...issue.path]));\n            }\n            else if (issue.code === \"invalid_key\") {\n                processError({ issues: issue.issues }, [...path, ...issue.path]);\n            }\n            else if (issue.code === \"invalid_element\") {\n                processError({ issues: issue.issues }, [...path, ...issue.path]);\n            }\n            else {\n                const fullpath = [...path, ...issue.path];\n                if (fullpath.length === 0) {\n                    fieldErrors._errors.push(mapper(issue));\n                }\n                else {\n                    let curr = fieldErrors;\n                    let i = 0;\n                    while (i < fullpath.length) {\n                        const el = fullpath[i];\n                        const terminal = i === fullpath.length - 1;\n                        // `_errors` is reserved by this legacy format, so merge a matching path segment into the current node instead of treating its array as a child.\n                        if (el === \"_errors\") {\n                            if (terminal)\n                                curr._errors.push(mapper(issue));\n                            i++;\n                            continue;\n                        }\n                        // A path element may collide with an inherited property name such as\n                        // \"__proto__\" or \"constructor\". Truthiness checks read the prototype\n                        // (so no node is created, then ._errors.push throws), and bracket\n                        // assignment of \"__proto__\" hits the setter instead of creating an\n                        // own key. Guard the read with hasOwnProperty and create the node\n                        // with defineProperty so any path element becomes a real own key.\n                        if (!Object.prototype.hasOwnProperty.call(curr, el)) {\n                            Object.defineProperty(curr, el, {\n                                value: { _errors: [] },\n                                enumerable: true,\n                                writable: true,\n                                configurable: true,\n                            });\n                        }\n                        const node = curr[el];\n                        if (terminal) {\n                            node._errors.push(mapper(issue));\n                        }\n                        curr = node;\n                        i++;\n                    }\n                }\n            }\n        }\n    };\n    processError(error);\n    return fieldErrors;\n}\nexport function treeifyError(error, mapper = (issue) => issue.message) {\n    const result = { errors: [] };\n    const processError = (error, path = []) => {\n        var _a;\n        for (const issue of error.issues) {\n            if (issue.code === \"invalid_union\" && issue.errors.length) {\n                // regular union error\n                issue.errors.map((issues) => processError({ issues }, [...path, ...issue.path]));\n            }\n            else if (issue.code === \"invalid_key\") {\n                processError({ issues: issue.issues }, [...path, ...issue.path]);\n            }\n            else if (issue.code === \"invalid_element\") {\n                processError({ issues: issue.issues }, [...path, ...issue.path]);\n            }\n            else {\n                const fullpath = [...path, ...issue.path];\n                if (fullpath.length === 0) {\n                    result.errors.push(mapper(issue));\n                    continue;\n                }\n                let curr = result;\n                let i = 0;\n                while (i < fullpath.length) {\n                    const el = fullpath[i];\n                    const terminal = i === fullpath.length - 1;\n                    if (typeof el === \"string\") {\n                        curr.properties ?? (curr.properties = {});\n                        // el may collide with an inherited property name (\"__proto__\",\n                        // \"constructor\", ...); ??= reads the prototype so the node is never\n                        // created and curr.errors.push throws. Guard with hasOwnProperty and\n                        // create the node with defineProperty so \"__proto__\" becomes a real\n                        // own key rather than invoking the prototype setter.\n                        if (!Object.prototype.hasOwnProperty.call(curr.properties, el)) {\n                            Object.defineProperty(curr.properties, el, {\n                                value: { errors: [] },\n                                enumerable: true,\n                                writable: true,\n                                configurable: true,\n                            });\n                        }\n                        curr = curr.properties[el];\n                    }\n                    else {\n                        curr.items ?? (curr.items = []);\n                        (_a = curr.items)[el] ?? (_a[el] = { errors: [] });\n                        curr = curr.items[el];\n                    }\n                    if (terminal) {\n                        curr.errors.push(mapper(issue));\n                    }\n                    i++;\n                }\n            }\n        }\n    };\n    processError(error);\n    return result;\n}\n/** Format a ZodError as a human-readable string in the following form.\n *\n * From\n *\n * ```ts\n * ZodError {\n *   issues: [\n *     {\n *       expected: 'string',\n *       code: 'invalid_type',\n *       path: [ 'username' ],\n *       message: 'Invalid input: expected string'\n *     },\n *     {\n *       expected: 'number',\n *       code: 'invalid_type',\n *       path: [ 'favoriteNumbers', 1 ],\n *       message: 'Invalid input: expected number'\n *     }\n *   ];\n * }\n * ```\n *\n * to\n *\n * ```\n * username\n *   ✖ Expected number, received string at \"username\n * favoriteNumbers[0]\n *   ✖ Invalid input: expected number\n * ```\n */\nexport function toDotPath(_path) {\n    const segs = [];\n    const path = _path.map((seg) => (typeof seg === \"object\" ? seg.key : seg));\n    for (const seg of path) {\n        if (typeof seg === \"number\")\n            segs.push(`[${seg}]`);\n        else if (typeof seg === \"symbol\")\n            segs.push(`[${JSON.stringify(String(seg))}]`);\n        else if (/[^\\w$]/.test(seg))\n            segs.push(`[${JSON.stringify(seg)}]`);\n        else {\n            if (segs.length)\n                segs.push(\".\");\n            segs.push(seg);\n        }\n    }\n    return segs.join(\"\");\n}\nexport function prettifyError(error) {\n    const lines = [];\n    // sort by path length\n    const issues = [...error.issues].sort((a, b) => (a.path ?? []).length - (b.path ?? []).length);\n    // Process each issue\n    for (const issue of issues) {\n        lines.push(`✖ ${issue.message}`);\n        if (issue.path?.length)\n            lines.push(`  → at ${toDotPath(issue.path)}`);\n    }\n    // Convert Map to formatted string\n    return lines.join(\"\\n\");\n}\n","import * as core from \"./core.js\";\nimport * as errors from \"./errors.js\";\nimport * as util from \"./util.js\";\n// Always both keys, so the `_params` read site in `_parse` sees one object shape rather than two.\nfunction finalizeParams(callee, params) {\n    return { callee: params?.callee ?? callee, Err: params?.Err };\n}\nexport const _parse = (_Err) => {\n    const fn = (schema, value, _ctx, _params) => {\n        const ctx = _ctx ? { ..._ctx, async: false } : { async: false };\n        const result = schema._zod.run({ value, issues: [] }, ctx);\n        if (result instanceof Promise) {\n            throw new core.$ZodAsyncError();\n        }\n        if (result.issues.length) {\n            const e = new (_params?.Err ?? _Err)(result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())));\n            util.captureStackTrace(e, _params?.callee ?? fn);\n            throw e;\n        }\n        return result.value;\n    };\n    return fn;\n};\nexport const parse = /* @__PURE__*/ _parse(errors.$ZodRealError);\nexport const _parseAsync = (_Err) => {\n    const fn = async (schema, value, _ctx, params) => {\n        const ctx = _ctx ? { ..._ctx, async: true } : { async: true };\n        let result = schema._zod.run({ value, issues: [] }, ctx);\n        if (result instanceof Promise)\n            result = await result;\n        if (result.issues.length) {\n            const e = new (params?.Err ?? _Err)(result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())));\n            util.captureStackTrace(e, params?.callee ?? fn);\n            throw e;\n        }\n        return result.value;\n    };\n    return fn;\n};\nexport const parseAsync = /* @__PURE__*/ _parseAsync(errors.$ZodRealError);\nexport const _safeParse = (_Err) => (schema, value, _ctx) => {\n    const ctx = _ctx ? { ..._ctx, async: false } : { async: false };\n    const result = schema._zod.run({ value, issues: [] }, ctx);\n    if (result instanceof Promise) {\n        throw new core.$ZodAsyncError();\n    }\n    return result.issues.length\n        ? {\n            success: false,\n            error: new (_Err ?? errors.$ZodError)(result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config()))),\n        }\n        : { success: true, data: result.value };\n};\nexport const safeParse = /* @__PURE__*/ _safeParse(errors.$ZodRealError);\nexport const _safeParseAsync = (_Err) => async (schema, value, _ctx) => {\n    const ctx = _ctx ? { ..._ctx, async: true } : { async: true };\n    let result = schema._zod.run({ value, issues: [] }, ctx);\n    if (result instanceof Promise)\n        result = await result;\n    return result.issues.length\n        ? {\n            success: false,\n            error: new _Err(result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config()))),\n        }\n        : { success: true, data: result.value };\n};\nexport const safeParseAsync = /* @__PURE__*/ _safeParseAsync(errors.$ZodRealError);\n// registry mirrors of the compiler's sentinels, so this module never imports the compiler\nconst COMPILE_INVALID = /* @__PURE__ */ Symbol.for(\"zod.compile.invalid\");\nconst COMPILE_FALLBACK = /* @__PURE__ */ Symbol.for(\"zod.compile.fallback\");\n// Deliberately tiny, because v8 will not inline a body carrying the fallback's object literals and throw. Everything that is not the compiled happy path lives in validateFallback, and that split is worth ~35% on a compiled schema.\nexport const validate = ((schema, value, _ctx) => {\n    const validator = schema._zod.bag.validator;\n    if (validator !== undefined && validator(value) !== COMPILE_INVALID)\n        return true;\n    return validateFallback(schema, value, _ctx);\n});\nfunction validateFallback(schema, value, _ctx) {\n    const ctx = _ctx ? { ..._ctx, async: false } : { async: false };\n    const fallbackRun = schema._zod.bag.fallbackRun;\n    let result;\n    if (fallbackRun) {\n        // skip nested fast paths on the fallback, so user callbacks keep the at-most-twice bound\n        ctx[COMPILE_FALLBACK] = true;\n        result = fallbackRun({ value, issues: [] }, ctx);\n    }\n    else {\n        result = schema._zod.run({ value, issues: [] }, ctx);\n    }\n    if (result instanceof Promise) {\n        throw new core.$ZodAsyncError();\n    }\n    return result.issues.length === 0;\n}\n// no fast path: the compiler keeps async parses on the runtime, because a promise-returning callback that is not declared async compiles to a throw\nexport const validateAsync = async (schema, value, _ctx) => {\n    const ctx = _ctx ? { ..._ctx, async: true } : { async: true };\n    let result = schema._zod.run({ value, issues: [] }, ctx);\n    if (result instanceof Promise)\n        result = await result;\n    return result.issues.length === 0;\n};\nexport const _encode = (_Err) => {\n    const parse = _parse(_Err);\n    const fn = (schema, value, _ctx, _params) => {\n        const ctx = _ctx ? { ..._ctx, direction: \"backward\" } : { direction: \"backward\" };\n        return parse(schema, value, ctx, finalizeParams(fn, _params));\n    };\n    return fn;\n};\nexport const encode = /* @__PURE__*/ _encode(errors.$ZodRealError);\nexport const _decode = (_Err) => {\n    const parse = _parse(_Err);\n    const fn = (schema, value, _ctx, _params) => {\n        return parse(schema, value, _ctx, finalizeParams(fn, _params));\n    };\n    return fn;\n};\nexport const decode = /* @__PURE__*/ _decode(errors.$ZodRealError);\nexport const _encodeAsync = (_Err) => {\n    const parseAsync = _parseAsync(_Err);\n    const fn = async (schema, value, _ctx, _params) => {\n        const ctx = _ctx ? { ..._ctx, direction: \"backward\" } : { direction: \"backward\" };\n        return (await parseAsync(schema, value, ctx, finalizeParams(fn, _params)));\n    };\n    return fn;\n};\nexport const encodeAsync = /* @__PURE__*/ _encodeAsync(errors.$ZodRealError);\nexport const _decodeAsync = (_Err) => {\n    const parseAsync = _parseAsync(_Err);\n    const fn = async (schema, value, _ctx, _params) => {\n        return await parseAsync(schema, value, _ctx, finalizeParams(fn, _params));\n    };\n    return fn;\n};\nexport const decodeAsync = /* @__PURE__*/ _decodeAsync(errors.$ZodRealError);\nexport const _safeEncode = (_Err) => (schema, value, _ctx) => {\n    const ctx = _ctx ? { ..._ctx, direction: \"backward\" } : { direction: \"backward\" };\n    return _safeParse(_Err)(schema, value, ctx);\n};\nexport const safeEncode = /* @__PURE__*/ _safeEncode(errors.$ZodRealError);\nexport const _safeDecode = (_Err) => (schema, value, _ctx) => {\n    return _safeParse(_Err)(schema, value, _ctx);\n};\nexport const safeDecode = /* @__PURE__*/ _safeDecode(errors.$ZodRealError);\nexport const _safeEncodeAsync = (_Err) => async (schema, value, _ctx) => {\n    const ctx = _ctx ? { ..._ctx, direction: \"backward\" } : { direction: \"backward\" };\n    return _safeParseAsync(_Err)(schema, value, ctx);\n};\nexport const safeEncodeAsync = /* @__PURE__*/ _safeEncodeAsync(errors.$ZodRealError);\nexport const _safeDecodeAsync = (_Err) => async (schema, value, _ctx) => {\n    return _safeParseAsync(_Err)(schema, value, _ctx);\n};\nexport const safeDecodeAsync = /* @__PURE__*/ _safeDecodeAsync(errors.$ZodRealError);\n","import * as util from \"./util.js\";\n/**\n * @deprecated CUID v1 is deprecated by its authors due to information leakage\n * (timestamps embedded in the id). Use {@link cuid2} instead.\n * See https://github.com/paralleldrive/cuid.\n */\nexport const cuid = /^[cC][0-9a-z]{6,}$/;\nexport const cuid2 = /^[0-9a-z]+$/;\nexport const ulid = /^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/;\nexport const xid = /^[0-9a-vA-V]{20}$/;\nexport const ksuid = /^[A-Za-z0-9]{27}$/;\nexport const nanoid = /^[a-zA-Z0-9_-]{21}$/;\nexport function nanoidOfLength(length) {\n    return new RegExp(`^[a-zA-Z0-9_-]{${length}}$`);\n}\n/** ISO 8601-1 duration regex. Does not support the 8601-2 extensions like negative durations or fractional/negative components. */\nexport const duration = /^P(?:(\\d+W)|(?!.*W)(?=\\d|T\\d)(\\d+Y)?(\\d+M)?(\\d+D)?(T(?=\\d)(\\d+H)?(\\d+M)?(\\d+([.,]\\d+)?S)?)?)$/;\n/** Implements ISO 8601-2 extensions like explicit +- prefixes, mixing weeks with other units, and fractional/negative components. */\nexport const extendedDuration = /^[-+]?P(?!$)(?:(?:[-+]?\\d+Y)|(?:[-+]?\\d+[.,]\\d+Y$))?(?:(?:[-+]?\\d+M)|(?:[-+]?\\d+[.,]\\d+M$))?(?:(?:[-+]?\\d+W)|(?:[-+]?\\d+[.,]\\d+W$))?(?:(?:[-+]?\\d+D)|(?:[-+]?\\d+[.,]\\d+D$))?(?:T(?=[\\d+-])(?:(?:[-+]?\\d+H)|(?:[-+]?\\d+[.,]\\d+H$))?(?:(?:[-+]?\\d+M)|(?:[-+]?\\d+[.,]\\d+M$))?(?:[-+]?\\d+(?:[.,]\\d+)?S)?)??$/;\n/** A regex for any UUID-like identifier: 8-4-4-4-12 hex pattern */\nexport const guid = /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/;\n/** Returns a regex for validating an RFC 9562/4122 UUID.\n *\n * @param version Optionally specify a version 1-8. If no version is specified, all versions are supported. */\nexport const uuid = (version) => {\n    if (!version)\n        return /^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/;\n    return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${version}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`);\n};\nexport const uuid4 = /*@__PURE__*/ uuid(4);\nexport const uuid6 = /*@__PURE__*/ uuid(6);\nexport const uuid7 = /*@__PURE__*/ uuid(7);\n/** Practical email validation */\nexport const email = /^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$/;\n/** Equivalent to the HTML5 input[type=email] validation implemented by browsers. Source: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/email */\nexport const html5Email = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;\n/** The classic emailregex.com regex for RFC 5322-compliant emails */\nexport const rfc5322Email = /^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\n/** A loose regex that allows Unicode characters, enforces length limits, and that's about it. */\nexport const unicodeEmail = /^[^\\s@\"]{1,64}@[^\\s@]{1,255}$/u;\nexport const idnEmail = unicodeEmail;\nexport const browserEmail = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;\n// from https://thekevinscott.com/emojis-in-javascript/#writing-a-regular-expression\n// Single character class, not an alternation: the two properties overlap (U+1F9B0-U+1F9B3), so `(A|B)+` backtracks exponentially on a failed match.\nconst _emoji = `^[\\\\p{Extended_Pictographic}\\\\p{Emoji_Component}]+$`;\nexport function emoji() {\n    return new RegExp(_emoji, \"u\");\n}\nexport const ipv4 = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/;\nexport const ipv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/;\nexport const mac = (delimiter) => {\n    const escapedDelim = util.escapeRegex(delimiter ?? \":\");\n    return new RegExp(`^(?:[0-9A-F]{2}${escapedDelim}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${escapedDelim}){5}[0-9a-f]{2}$`);\n};\nexport const cidrv4 = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\\/([0-9]|[1-2][0-9]|3[0-2])$/;\nexport const cidrv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/;\n// https://stackoverflow.com/questions/7860392/determine-if-string-is-in-base64-using-javascript\nexport const base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/;\nexport const base64url = /^[A-Za-z0-9_-]*$/;\n// based on https://stackoverflow.com/questions/106179/regular-expression-to-match-dns-hostname-or-ip-address\n// export const hostname: RegExp = /^([a-zA-Z0-9-]+\\.)*[a-zA-Z0-9-]+$/;\nexport const hostname = /^(?=.{1,253}\\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\\.?$/;\nexport const domain = /^(?=.{1,253}$)([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\\.)+[a-zA-Z]{2,63}$/;\nexport const httpProtocol = /^https?$/;\n// https://blog.stevenlevithan.com/archives/validate-phone-number#r4-3 (regex sans spaces) E.164: leading digit must be 1-9; total digits (excluding '+') between 7-15\nexport const e164 = /^\\+[1-9]\\d{6,14}$/;\n// Credit card shape: 12–19 digits, optionally separated by single spaces or single hyphens. ISO/IEC 7812 caps the PAN at 19 digits; 12 is the shortest issued length (Maestro).\nexport const creditCard = /^\\d(?:[ -]?\\d){11,18}$/;\nconst dateSource = `(?:(?:\\\\d\\\\d[2468][048]|\\\\d\\\\d[13579][26]|\\\\d\\\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\\\d|30)|(?:02)-(?:0[1-9]|1\\\\d|2[0-8])))`;\n/** Anchors a pattern source. The interpolation lives here rather than at the call site because\n * esbuild will not drop a `@__PURE__` call whose own argument interpolates a variable, but it\n * will drop `anchor(dateSource)`. Keeping it inline pinned `date` into every bundle. */\nfunction anchor(source) {\n    return new RegExp(`^${source}$`);\n}\nexport const date = /*@__PURE__*/ anchor(dateSource);\nfunction timeSource(args) {\n    const hhmm = `(?:[01]\\\\d|2[0-3]):[0-5]\\\\d`;\n    const regex = typeof args.precision === \"number\"\n        ? args.precision === -1\n            ? `${hhmm}`\n            : args.precision === 0\n                ? `${hhmm}:[0-5]\\\\d`\n                : `${hhmm}:[0-5]\\\\d\\\\.\\\\d{${args.precision}}`\n        : args.seconds\n            ? `${hhmm}:[0-5]\\\\d(?:\\\\.\\\\d+)?`\n            : `${hhmm}(?::[0-5]\\\\d(?:\\\\.\\\\d+)?)?`;\n    return regex;\n}\nexport function time(args) {\n    return new RegExp(`^${timeSource(args)}$`);\n}\n// Adapted from https://stackoverflow.com/a/3143231\nexport function datetime(args) {\n    const opts = [\"Z\"];\n    // if (args.offset) opts.push(`([+-]\\\\d{2}:\\\\d{2})`);\n    if (args.offset)\n        opts.push(`([+-](?:[01]\\\\d|2[0-3]):[0-5]\\\\d)`);\n    // RFC 3339 mandates seconds wherever the time carries a `Z` or an offset, so only the unqualified form `local` adds may omit them\n    const qualified = `${timeSource({ precision: args.precision, seconds: true })}(?:${opts.join(\"|\")})`;\n    const timeRegex = args.local ? `${qualified}|${timeSource({ precision: args.precision })}` : qualified;\n    return new RegExp(`^${dateSource}T(?:${timeRegex})$`);\n}\nexport const string = (params) => {\n    const regex = params ? `[\\\\s\\\\S]{${params?.minimum ?? 0},${params?.maximum ?? \"\"}}` : `[\\\\s\\\\S]*`;\n    return new RegExp(`^${regex}$`);\n};\nexport const bigint = /^-?\\d+n?$/;\nexport const integer = /^-?\\d+$/;\nexport const number = /^-?\\d+(?:\\.\\d+)?$/;\nexport const boolean = /^(?:true|false)$/i;\nconst _null = /^null$/i;\nexport { _null as null };\nconst _undefined = /^undefined$/i;\nexport { _undefined as undefined };\n// regex for string with no uppercase letters\nexport const lowercase = /^[^A-Z]*$/;\n// regex for string with no lowercase letters\nexport const uppercase = /^[^a-z]*$/;\n// regex for hexadecimal strings (any length)\nexport const hex = /^[0-9a-fA-F]*$/;\n// Hash regexes for different algorithms and encodings\n// Helper function to create base64 regex with exact length and padding\nfunction fixedBase64(bodyLength, padding) {\n    return new RegExp(`^[A-Za-z0-9+/]{${bodyLength}}${padding}$`);\n}\n// Helper function to create base64url regex with exact length (no padding)\nfunction fixedBase64url(length) {\n    return new RegExp(`^[A-Za-z0-9_-]{${length}}$`);\n}\n// MD5 (16 bytes): base64 = 24 chars total (22 + \"==\")\nexport const md5_hex = /^[0-9a-fA-F]{32}$/;\nexport const md5_base64 = /*@__PURE__*/ fixedBase64(22, \"==\");\nexport const md5_base64url = /*@__PURE__*/ fixedBase64url(22);\n// SHA1 (20 bytes): base64 = 28 chars total (27 + \"=\")\nexport const sha1_hex = /^[0-9a-fA-F]{40}$/;\nexport const sha1_base64 = /*@__PURE__*/ fixedBase64(27, \"=\");\nexport const sha1_base64url = /*@__PURE__*/ fixedBase64url(27);\n// SHA256 (32 bytes): base64 = 44 chars total (43 + \"=\")\nexport const sha256_hex = /^[0-9a-fA-F]{64}$/;\nexport const sha256_base64 = /*@__PURE__*/ fixedBase64(43, \"=\");\nexport const sha256_base64url = /*@__PURE__*/ fixedBase64url(43);\n// SHA384 (48 bytes): base64 = 64 chars total (no padding)\nexport const sha384_hex = /^[0-9a-fA-F]{96}$/;\nexport const sha384_base64 = /*@__PURE__*/ fixedBase64(64, \"\");\nexport const sha384_base64url = /*@__PURE__*/ fixedBase64url(64);\n// SHA512 (64 bytes): base64 = 88 chars total (86 + \"==\")\nexport const sha512_hex = /^[0-9a-fA-F]{128}$/;\nexport const sha512_base64 = /*@__PURE__*/ fixedBase64(86, \"==\");\nexport const sha512_base64url = /*@__PURE__*/ fixedBase64url(86);\n","// import { $ZodType } from \"./schemas.js\";\nimport * as core from \"./core.js\";\nimport * as regexes from \"./regexes.js\";\nimport * as util from \"./util.js\";\nexport const $ZodCheck = /*@__PURE__*/ core.$constructor(\"$ZodCheck\", (inst, def) => {\n    var _a;\n    inst._zod ?? (inst._zod = {});\n    inst._zod.def = def;\n    (_a = inst._zod).onattach ?? (_a.onattach = []);\n});\n/** Default `when` for size-based checks: run only on non-nullish values with a `size`. */\nconst _whenHasSize = (payload) => {\n    const val = payload.value;\n    return !util.nullish(val) && val.size !== undefined;\n};\n/** Default `when` for length-based checks: run only on non-nullish values with a `length`. */\nconst _whenHasLength = (payload) => {\n    const val = payload.value;\n    return !util.nullish(val) && val.length !== undefined;\n};\nconst numericOriginMap = {\n    number: \"number\",\n    bigint: \"bigint\",\n    object: \"date\",\n};\nexport const $ZodCheckLessThan = /*@__PURE__*/ core.$constructor(\"$ZodCheckLessThan\", (inst, def) => {\n    $ZodCheck.init(inst, def);\n    const origin = numericOriginMap[typeof def.value];\n    inst._zod.onattach.push((inst) => {\n        const bag = inst._zod.bag;\n        const curr = (def.inclusive ? bag.maximum : bag.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;\n        if (def.value < curr) {\n            if (def.inclusive)\n                bag.maximum = def.value;\n            else\n                bag.exclusiveMaximum = def.value;\n        }\n    });\n    inst._zod.check = (payload) => {\n        if (def.inclusive ? payload.value <= def.value : payload.value < def.value) {\n            return;\n        }\n        payload.issues.push({\n            origin: numericOriginMap[typeof payload.value] ?? origin,\n            code: \"too_big\",\n            maximum: typeof def.value === \"object\" ? def.value.getTime() : def.value,\n            input: payload.value,\n            inclusive: def.inclusive,\n            inst,\n            continue: !def.abort,\n        });\n    };\n});\nexport const $ZodCheckGreaterThan = /*@__PURE__*/ core.$constructor(\"$ZodCheckGreaterThan\", (inst, def) => {\n    $ZodCheck.init(inst, def);\n    const origin = numericOriginMap[typeof def.value];\n    inst._zod.onattach.push((inst) => {\n        const bag = inst._zod.bag;\n        const curr = (def.inclusive ? bag.minimum : bag.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;\n        if (def.value > curr) {\n            if (def.inclusive)\n                bag.minimum = def.value;\n            else\n                bag.exclusiveMinimum = def.value;\n        }\n    });\n    inst._zod.check = (payload) => {\n        if (def.inclusive ? payload.value >= def.value : payload.value > def.value) {\n            return;\n        }\n        payload.issues.push({\n            origin: numericOriginMap[typeof payload.value] ?? origin,\n            code: \"too_small\",\n            minimum: typeof def.value === \"object\" ? def.value.getTime() : def.value,\n            input: payload.value,\n            inclusive: def.inclusive,\n            inst,\n            continue: !def.abort,\n        });\n    };\n});\nexport const $ZodCheckMultipleOf = \n/*@__PURE__*/ core.$constructor(\"$ZodCheckMultipleOf\", (inst, def) => {\n    $ZodCheck.init(inst, def);\n    inst._zod.onattach.push((inst) => {\n        var _a;\n        (_a = inst._zod.bag).multipleOf ?? (_a.multipleOf = def.value);\n    });\n    inst._zod.check = (payload) => {\n        if (typeof payload.value !== typeof def.value)\n            throw new Error(\"Cannot mix number and bigint in multiple_of check.\");\n        const isMultiple = typeof payload.value === \"bigint\"\n            ? // `value % 0n` throws, and nothing is a multiple of zero — the number branch already fails this way via NaN\n                def.value !== BigInt(0) && payload.value % def.value === BigInt(0)\n            : util.floatSafeRemainder(payload.value, def.value) === 0;\n        if (isMultiple)\n            return;\n        payload.issues.push({\n            origin: typeof payload.value,\n            code: \"not_multiple_of\",\n            divisor: def.value,\n            input: payload.value,\n            inst,\n            continue: !def.abort,\n        });\n    };\n});\nexport const $ZodCheckNumberFormat = /*@__PURE__*/ core.$constructor(\"$ZodCheckNumberFormat\", (inst, def) => {\n    $ZodCheck.init(inst, def); // no format checks\n    def.format = def.format || \"float64\";\n    const isInt = def.format?.includes(\"int\");\n    const origin = isInt ? \"int\" : \"number\";\n    const [minimum, maximum] = util.NUMBER_FORMAT_RANGES[def.format];\n    inst._zod.onattach.push((inst) => {\n        const bag = inst._zod.bag;\n        bag.format = def.format;\n        bag.minimum = minimum;\n        bag.maximum = maximum;\n        if (isInt)\n            bag.pattern = regexes.integer;\n    });\n    inst._zod.check = (payload) => {\n        const input = payload.value;\n        if (isInt) {\n            if (!Number.isInteger(input)) {\n                // invalid_format issue\n                // payload.issues.push({\n                //   expected: def.format,\n                //   format: def.format,\n                //   code: \"invalid_format\",\n                //   input,\n                //   inst,\n                // });\n                // invalid_type issue\n                payload.issues.push({\n                    expected: origin,\n                    format: def.format,\n                    code: \"invalid_type\",\n                    continue: false,\n                    input,\n                    inst,\n                });\n                return;\n                // not_multiple_of issue\n                // payload.issues.push({\n                //   code: \"not_multiple_of\",\n                //   origin: \"number\",\n                //   input,\n                //   inst,\n                //   divisor: 1,\n                // });\n            }\n            if (!Number.isSafeInteger(input)) {\n                if (input > 0) {\n                    // too_big\n                    payload.issues.push({\n                        input,\n                        code: \"too_big\",\n                        maximum: Number.MAX_SAFE_INTEGER,\n                        note: \"Integers must be within the safe integer range.\",\n                        inst,\n                        origin,\n                        inclusive: true,\n                        continue: !def.abort,\n                    });\n                }\n                else {\n                    // too_small\n                    payload.issues.push({\n                        input,\n                        code: \"too_small\",\n                        minimum: Number.MIN_SAFE_INTEGER,\n                        note: \"Integers must be within the safe integer range.\",\n                        inst,\n                        origin,\n                        inclusive: true,\n                        continue: !def.abort,\n                    });\n                }\n                return;\n            }\n        }\n        if (input < minimum) {\n            payload.issues.push({\n                origin: \"number\",\n                input,\n                code: \"too_small\",\n                minimum,\n                inclusive: true,\n                inst,\n                continue: !def.abort,\n            });\n        }\n        if (input > maximum) {\n            payload.issues.push({\n                origin: \"number\",\n                input,\n                code: \"too_big\",\n                maximum,\n                inclusive: true,\n                inst,\n                continue: !def.abort,\n            });\n        }\n    };\n});\nexport const $ZodCheckBigIntFormat = /*@__PURE__*/ core.$constructor(\"$ZodCheckBigIntFormat\", (inst, def) => {\n    $ZodCheck.init(inst, def); // no format checks\n    const [minimum, maximum] = util.BIGINT_FORMAT_RANGES[def.format];\n    inst._zod.onattach.push((inst) => {\n        const bag = inst._zod.bag;\n        bag.format = def.format;\n        bag.minimum = minimum;\n        bag.maximum = maximum;\n    });\n    inst._zod.check = (payload) => {\n        const input = payload.value;\n        if (input < minimum) {\n            payload.issues.push({\n                origin: \"bigint\",\n                input,\n                code: \"too_small\",\n                minimum: minimum,\n                inclusive: true,\n                inst,\n                continue: !def.abort,\n            });\n        }\n        if (input > maximum) {\n            payload.issues.push({\n                origin: \"bigint\",\n                input,\n                code: \"too_big\",\n                maximum,\n                inclusive: true,\n                inst,\n                continue: !def.abort,\n            });\n        }\n    };\n});\nexport const $ZodCheckMaxSize = /*@__PURE__*/ core.$constructor(\"$ZodCheckMaxSize\", (inst, def) => {\n    var _a;\n    $ZodCheck.init(inst, def);\n    (_a = inst._zod.def).when ?? (_a.when = _whenHasSize);\n    inst._zod.onattach.push((inst) => {\n        const curr = (inst._zod.bag.maximum ?? Number.POSITIVE_INFINITY);\n        if (def.maximum < curr)\n            inst._zod.bag.maximum = def.maximum;\n    });\n    inst._zod.check = (payload) => {\n        const input = payload.value;\n        const size = input.size;\n        if (size <= def.maximum)\n            return;\n        payload.issues.push({\n            origin: util.getSizableOrigin(input),\n            code: \"too_big\",\n            maximum: def.maximum,\n            inclusive: true,\n            input,\n            inst,\n            continue: !def.abort,\n        });\n    };\n});\nexport const $ZodCheckMinSize = /*@__PURE__*/ core.$constructor(\"$ZodCheckMinSize\", (inst, def) => {\n    var _a;\n    $ZodCheck.init(inst, def);\n    (_a = inst._zod.def).when ?? (_a.when = _whenHasSize);\n    inst._zod.onattach.push((inst) => {\n        const curr = (inst._zod.bag.minimum ?? Number.NEGATIVE_INFINITY);\n        if (def.minimum > curr)\n            inst._zod.bag.minimum = def.minimum;\n    });\n    inst._zod.check = (payload) => {\n        const input = payload.value;\n        const size = input.size;\n        if (size >= def.minimum)\n            return;\n        payload.issues.push({\n            origin: util.getSizableOrigin(input),\n            code: \"too_small\",\n            minimum: def.minimum,\n            inclusive: true,\n            input,\n            inst,\n            continue: !def.abort,\n        });\n    };\n});\nexport const $ZodCheckSizeEquals = /*@__PURE__*/ core.$constructor(\"$ZodCheckSizeEquals\", (inst, def) => {\n    var _a;\n    $ZodCheck.init(inst, def);\n    (_a = inst._zod.def).when ?? (_a.when = _whenHasSize);\n    inst._zod.onattach.push((inst) => {\n        const bag = inst._zod.bag;\n        bag.minimum = def.size;\n        bag.maximum = def.size;\n        bag.size = def.size;\n    });\n    inst._zod.check = (payload) => {\n        const input = payload.value;\n        const size = input.size;\n        if (size === def.size)\n            return;\n        const tooBig = size > def.size;\n        payload.issues.push({\n            origin: util.getSizableOrigin(input),\n            ...(tooBig ? { code: \"too_big\", maximum: def.size } : { code: \"too_small\", minimum: def.size }),\n            inclusive: true,\n            exact: true,\n            input: payload.value,\n            inst,\n            continue: !def.abort,\n        });\n    };\n});\nexport const $ZodCheckMaxLength = /*@__PURE__*/ core.$constructor(\"$ZodCheckMaxLength\", (inst, def) => {\n    var _a;\n    $ZodCheck.init(inst, def);\n    (_a = inst._zod.def).when ?? (_a.when = _whenHasLength);\n    inst._zod.onattach.push((inst) => {\n        const curr = (inst._zod.bag.maximum ?? Number.POSITIVE_INFINITY);\n        if (def.maximum < curr)\n            inst._zod.bag.maximum = def.maximum;\n    });\n    inst._zod.check = (payload) => {\n        const input = payload.value;\n        const units = input.length;\n        // Strings are measured in Unicode code points, not UTF-16 units. A code point is at most two units, so a string that already fits in units fits in code points; only an overflow has to be counted.\n        const length = typeof input === \"string\" && units > def.maximum ? util.codePointLength(input) : units;\n        if (length <= def.maximum)\n            return;\n        const origin = util.getLengthableOrigin(input);\n        payload.issues.push({\n            origin,\n            code: \"too_big\",\n            maximum: def.maximum,\n            inclusive: true,\n            input,\n            inst,\n            continue: !def.abort,\n        });\n    };\n});\nexport const $ZodCheckMinLength = /*@__PURE__*/ core.$constructor(\"$ZodCheckMinLength\", (inst, def) => {\n    var _a;\n    $ZodCheck.init(inst, def);\n    (_a = inst._zod.def).when ?? (_a.when = _whenHasLength);\n    inst._zod.onattach.push((inst) => {\n        const curr = (inst._zod.bag.minimum ?? Number.NEGATIVE_INFINITY);\n        if (def.minimum > curr)\n            inst._zod.bag.minimum = def.minimum;\n    });\n    inst._zod.check = (payload) => {\n        const input = payload.value;\n        const units = input.length;\n        // A code point is one or two UTF-16 units, so fewer units than the floor can never reach it and twice the floor always clears it. Only in between is the exact count in doubt.\n        const length = typeof input === \"string\" && units >= def.minimum && units < def.minimum * 2\n            ? util.codePointLength(input)\n            : units;\n        if (length >= def.minimum)\n            return;\n        const origin = util.getLengthableOrigin(input);\n        payload.issues.push({\n            origin,\n            code: \"too_small\",\n            minimum: def.minimum,\n            inclusive: true,\n            input,\n            inst,\n            continue: !def.abort,\n        });\n    };\n});\nexport const $ZodCheckLengthEquals = /*@__PURE__*/ core.$constructor(\"$ZodCheckLengthEquals\", (inst, def) => {\n    var _a;\n    $ZodCheck.init(inst, def);\n    (_a = inst._zod.def).when ?? (_a.when = _whenHasLength);\n    inst._zod.onattach.push((inst) => {\n        const bag = inst._zod.bag;\n        bag.minimum = def.length;\n        bag.maximum = def.length;\n        bag.length = def.length;\n    });\n    inst._zod.check = (payload) => {\n        const input = payload.value;\n        const units = input.length;\n        // A code point is one or two UTF-16 units, so outside `[length, length * 2]` units the target is missed either way — and missed in the same direction in both measures.\n        const length = typeof input === \"string\" && units >= def.length && units <= def.length * 2\n            ? util.codePointLength(input)\n            : units;\n        if (length === def.length)\n            return;\n        const origin = util.getLengthableOrigin(input);\n        const tooBig = length > def.length;\n        payload.issues.push({\n            origin,\n            ...(tooBig ? { code: \"too_big\", maximum: def.length } : { code: \"too_small\", minimum: def.length }),\n            inclusive: true,\n            exact: true,\n            input: payload.value,\n            inst,\n            continue: !def.abort,\n        });\n    };\n});\nexport const $ZodCheckStringFormat = /*@__PURE__*/ core.$constructor(\"$ZodCheckStringFormat\", (inst, def) => {\n    var _a, _b;\n    $ZodCheck.init(inst, def);\n    inst._zod.onattach.push((inst) => {\n        const bag = inst._zod.bag;\n        bag.format = def.format;\n        if (def.pattern) {\n            bag.patterns ?? (bag.patterns = new Set());\n            bag.patterns.add(def.pattern);\n        }\n    });\n    if (def.pattern)\n        (_a = inst._zod).check ?? (_a.check = (payload) => {\n            def.pattern.lastIndex = 0;\n            if (def.pattern.test(payload.value))\n                return;\n            payload.issues.push({\n                origin: \"string\",\n                code: \"invalid_format\",\n                format: def.format,\n                input: payload.value,\n                ...(def.pattern ? { pattern: def.pattern.toString() } : {}),\n                inst,\n                continue: !def.abort,\n            });\n        });\n    else\n        (_b = inst._zod).check ?? (_b.check = () => { });\n});\nexport const $ZodCheckRegex = /*@__PURE__*/ core.$constructor(\"$ZodCheckRegex\", (inst, def) => {\n    $ZodCheckStringFormat.init(inst, def);\n    inst._zod.check = (payload) => {\n        def.pattern.lastIndex = 0;\n        if (def.pattern.test(payload.value))\n            return;\n        payload.issues.push({\n            origin: \"string\",\n            code: \"invalid_format\",\n            format: \"regex\",\n            input: payload.value,\n            pattern: def.pattern.toString(),\n            inst,\n            continue: !def.abort,\n        });\n    };\n});\nexport const $ZodCheckLowerCase = /*@__PURE__*/ core.$constructor(\"$ZodCheckLowerCase\", (inst, def) => {\n    def.pattern ?? (def.pattern = regexes.lowercase);\n    $ZodCheckStringFormat.init(inst, def);\n});\nexport const $ZodCheckUpperCase = /*@__PURE__*/ core.$constructor(\"$ZodCheckUpperCase\", (inst, def) => {\n    def.pattern ?? (def.pattern = regexes.uppercase);\n    $ZodCheckStringFormat.init(inst, def);\n});\nexport const $ZodCheckIncludes = /*@__PURE__*/ core.$constructor(\"$ZodCheckIncludes\", (inst, def) => {\n    $ZodCheck.init(inst, def);\n    const escapedRegex = util.escapeRegex(def.includes);\n    // `String.prototype.includes(sub, position)` matches `sub` at `position`\n    // OR LATER, so the pattern must allow at least `position` leading chars\n    // (`{N,}`), not exactly `position` chars (`{N}`).\n    const pattern = new RegExp(typeof def.position === \"number\" ? `^.{${def.position},}${escapedRegex}` : escapedRegex);\n    def.pattern = pattern;\n    inst._zod.onattach.push((inst) => {\n        const bag = inst._zod.bag;\n        bag.patterns ?? (bag.patterns = new Set());\n        bag.patterns.add(pattern);\n    });\n    inst._zod.check = (payload) => {\n        if (payload.value.includes(def.includes, def.position))\n            return;\n        payload.issues.push({\n            origin: \"string\",\n            code: \"invalid_format\",\n            format: \"includes\",\n            includes: def.includes,\n            input: payload.value,\n            inst,\n            continue: !def.abort,\n        });\n    };\n});\nexport const $ZodCheckStartsWith = /*@__PURE__*/ core.$constructor(\"$ZodCheckStartsWith\", (inst, def) => {\n    $ZodCheck.init(inst, def);\n    const pattern = new RegExp(`^${util.escapeRegex(def.prefix)}.*`);\n    def.pattern ?? (def.pattern = pattern);\n    inst._zod.onattach.push((inst) => {\n        const bag = inst._zod.bag;\n        bag.patterns ?? (bag.patterns = new Set());\n        bag.patterns.add(pattern);\n    });\n    inst._zod.check = (payload) => {\n        if (payload.value.startsWith(def.prefix))\n            return;\n        payload.issues.push({\n            origin: \"string\",\n            code: \"invalid_format\",\n            format: \"starts_with\",\n            prefix: def.prefix,\n            input: payload.value,\n            inst,\n            continue: !def.abort,\n        });\n    };\n});\nexport const $ZodCheckEndsWith = /*@__PURE__*/ core.$constructor(\"$ZodCheckEndsWith\", (inst, def) => {\n    $ZodCheck.init(inst, def);\n    const pattern = new RegExp(`.*${util.escapeRegex(def.suffix)}$`);\n    def.pattern ?? (def.pattern = pattern);\n    inst._zod.onattach.push((inst) => {\n        const bag = inst._zod.bag;\n        bag.patterns ?? (bag.patterns = new Set());\n        bag.patterns.add(pattern);\n    });\n    inst._zod.check = (payload) => {\n        if (payload.value.endsWith(def.suffix))\n            return;\n        payload.issues.push({\n            origin: \"string\",\n            code: \"invalid_format\",\n            format: \"ends_with\",\n            suffix: def.suffix,\n            input: payload.value,\n            inst,\n            continue: !def.abort,\n        });\n    };\n});\n///////////////////////////////////\n/////    $ZodCheckProperty    /////\n///////////////////////////////////\nfunction handleCheckPropertyResult(result, payload, property) {\n    if (result.issues.length) {\n        payload.issues.push(...util.prefixIssues(property, result.issues));\n    }\n}\nexport const $ZodCheckProperty = /*@__PURE__*/ core.$constructor(\"$ZodCheckProperty\", (inst, def) => {\n    $ZodCheck.init(inst, def);\n    inst._zod.check = (payload) => {\n        const result = def.schema._zod.run({\n            value: payload.value[def.property],\n            issues: [],\n        }, {});\n        if (result instanceof Promise) {\n            return result.then((result) => handleCheckPropertyResult(result, payload, def.property));\n        }\n        handleCheckPropertyResult(result, payload, def.property);\n        return;\n    };\n});\nexport const $ZodCheckMimeType = /*@__PURE__*/ core.$constructor(\"$ZodCheckMimeType\", (inst, def) => {\n    $ZodCheck.init(inst, def);\n    const mimeSet = new Set(def.mime);\n    inst._zod.onattach.push((inst) => {\n        inst._zod.bag.mime = def.mime;\n    });\n    inst._zod.check = (payload) => {\n        if (mimeSet.has(payload.value.type))\n            return;\n        payload.issues.push({\n            code: \"invalid_value\",\n            values: def.mime,\n            input: payload.value.type,\n            inst,\n            continue: !def.abort,\n        });\n    };\n});\nexport const $ZodCheckOverwrite = /*@__PURE__*/ core.$constructor(\"$ZodCheckOverwrite\", (inst, def) => {\n    $ZodCheck.init(inst, def);\n    inst._zod.check = (payload) => {\n        payload.value = def.tx(payload.value);\n    };\n});\n","export const version = {\n    major: 4,\n    minor: 5,\n    patch: 4,\n};\n","import * as checks from \"./checks.js\";\nimport * as core from \"./core.js\";\nimport { Doc } from \"./doc.js\";\nimport { parse, parseAsync, safeParse, safeParseAsync } from \"./parse.js\";\nimport * as regexes from \"./regexes.js\";\nimport * as util from \"./util.js\";\nimport { version } from \"./versions.js\";\nexport const $ZodType = /*@__PURE__*/ core.$constructor(\"$ZodType\", (inst, def) => {\n    var _a;\n    inst ?? (inst = {});\n    inst._zod.def = def; // set _def property\n    inst._zod.bag = inst._zod.bag || {}; // initialize _bag object\n    inst._zod.version = version;\n    const defChecks = inst._zod.def.checks;\n    // if inst is itself a checks.$ZodCheck, run it as a check\n    const checks = inst._zod.traits.has(\"$ZodCheck\")\n        ? [inst, ...(defChecks ?? [])]\n        : defChecks?.length\n            ? [...defChecks]\n            : [];\n    for (const ch of checks) {\n        for (const fn of ch._zod.onattach) {\n            fn(inst);\n        }\n    }\n    if (checks.length === 0) {\n        // deferred initializer inst._zod.parse is not yet defined\n        (_a = inst._zod).deferred ?? (_a.deferred = []);\n        inst._zod.deferred?.push(() => {\n            inst._zod.run = inst._zod.parse;\n        });\n    }\n    else {\n        const runChecks = (payload, checks, ctx) => {\n            if (payload.memo)\n                return payload;\n            let isAborted = util.aborted(payload);\n            let asyncResult;\n            for (const ch of checks) {\n                if (ch._zod.def.when) {\n                    if (util.explicitlyAborted(payload))\n                        continue;\n                    const shouldRun = ch._zod.def.when(payload);\n                    if (!shouldRun)\n                        continue;\n                }\n                else if (isAborted) {\n                    continue;\n                }\n                const currLen = payload.issues.length;\n                const _ = ch._zod.check(payload);\n                if (_ instanceof Promise && ctx?.async === false) {\n                    throw new core.$ZodAsyncError();\n                }\n                if (asyncResult || _ instanceof Promise) {\n                    asyncResult = (asyncResult ?? Promise.resolve()).then(async () => {\n                        await _;\n                        const nextLen = payload.issues.length;\n                        if (nextLen === currLen)\n                            return;\n                        util.attachSchema(payload.issues, currLen, inst);\n                        if (!isAborted)\n                            isAborted = util.aborted(payload, currLen);\n                    });\n                }\n                else {\n                    const nextLen = payload.issues.length;\n                    if (nextLen === currLen)\n                        continue;\n                    util.attachSchema(payload.issues, currLen, inst);\n                    if (!isAborted)\n                        isAborted = util.aborted(payload, currLen);\n                }\n            }\n            if (asyncResult) {\n                return asyncResult.then(() => {\n                    return payload;\n                });\n            }\n            return payload;\n        };\n        const handleCanaryResult = (canary, payload, ctx) => {\n            // abort if the canary is aborted\n            if (util.aborted(canary)) {\n                canary.aborted = true;\n                return canary;\n            }\n            // run checks first, then\n            const checkResult = runChecks(payload, checks, ctx);\n            if (checkResult instanceof Promise) {\n                if (ctx.async === false)\n                    throw new core.$ZodAsyncError();\n                return checkResult.then((checkResult) => inst._zod.parse(checkResult, ctx));\n            }\n            return inst._zod.parse(checkResult, ctx);\n        };\n        inst._zod.run = (payload, ctx) => {\n            if (ctx.skipChecks) {\n                return inst._zod.parse(payload, ctx);\n            }\n            if (ctx.direction === \"backward\") {\n                // run canary initial pass (no checks)\n                const canary = inst._zod.parse({ value: payload.value, issues: [] }, { ...ctx, skipChecks: true });\n                if (canary instanceof Promise) {\n                    return canary.then((canary) => {\n                        return handleCanaryResult(canary, payload, ctx);\n                    });\n                }\n                return handleCanaryResult(canary, payload, ctx);\n            }\n            // forward\n            const result = inst._zod.parse(payload, ctx);\n            if (result instanceof Promise) {\n                if (ctx.async === false)\n                    throw new core.$ZodAsyncError();\n                return result.then((result) => runChecks(result, checks, ctx));\n            }\n            return runChecks(result, checks, ctx);\n        };\n    }\n}, {\n    // Wrappers extend this by installing a richer factory over it; reading it eagerly would defeat the laziness.\n    get \"~standard\"() {\n        return util.hide(this, \"~standard\", standardProps(this));\n    },\n    set \"~standard\"(value) {\n        util.own(this, \"~standard\", value);\n    },\n});\n/** The Standard Schema surface for `inst`. Shared so wrappers can extend it without forcing it. */\nconst toStandardResult = (r) => r.success ? { value: r.data } : { issues: r.error?.issues };\nexport function standardProps(inst) {\n    return {\n        validate: (value) => {\n            try {\n                return toStandardResult(safeParse(inst, value));\n            }\n            catch (_) {\n                return safeParseAsync(inst, value).then(toStandardResult);\n            }\n        },\n        vendor: \"zod\",\n        version: 1,\n    };\n}\nexport { clone } from \"./util.js\";\nexport const $ZodString = /*@__PURE__*/ core.$constructor(\"$ZodString\", (inst, def) => {\n    $ZodType.init(inst, def);\n    inst._zod.pattern = [...(inst?._zod.bag?.patterns ?? [])].pop() ?? regexes.string(inst._zod.bag);\n    inst._zod.parse = (payload, _) => {\n        if (def.coerce)\n            try {\n                payload.value = String(payload.value);\n            }\n            catch (_) { }\n        if (typeof payload.value === \"string\")\n            return payload;\n        payload.issues.push({\n            expected: \"string\",\n            code: \"invalid_type\",\n            input: payload.value,\n            inst,\n        });\n        return payload;\n    };\n});\nexport const $ZodStringFormat = /*@__PURE__*/ core.$constructor(\"$ZodStringFormat\", (inst, def) => {\n    // check initialization must come first\n    checks.$ZodCheckStringFormat.init(inst, def);\n    $ZodString.init(inst, def);\n});\nexport const $ZodGUID = /*@__PURE__*/ core.$constructor(\"$ZodGUID\", (inst, def) => {\n    def.pattern ?? (def.pattern = regexes.guid);\n    $ZodStringFormat.init(inst, def);\n});\nexport const $ZodUUID = /*@__PURE__*/ core.$constructor(\"$ZodUUID\", (inst, def) => {\n    if (def.version) {\n        const versionMap = {\n            v1: 1,\n            v2: 2,\n            v3: 3,\n            v4: 4,\n            v5: 5,\n            v6: 6,\n            v7: 7,\n            v8: 8,\n        };\n        const v = versionMap[def.version];\n        if (v === undefined)\n            throw new Error(`Invalid UUID version: \"${def.version}\"`);\n        def.pattern ?? (def.pattern = regexes.uuid(v));\n    }\n    else\n        def.pattern ?? (def.pattern = regexes.uuid());\n    $ZodStringFormat.init(inst, def);\n});\nexport const $ZodEmail = /*@__PURE__*/ core.$constructor(\"$ZodEmail\", (inst, def) => {\n    def.pattern ?? (def.pattern = regexes.email);\n    $ZodStringFormat.init(inst, def);\n});\n/** The `://` guard rejected the input before the URL constructor saw it. */\nexport const URL_BAD_FORMAT = 1;\n/** The URL constructor rejected the input. */\nexport const URL_UNPARSEABLE = 2;\n/** Parses a URL for `$ZodURL`, applying the one guard the URL constructor cannot express. Returns the parsed URL, or a code naming the stage that rejected it — the runtime needs that distinction to pick an issue note, and compiled code only needs to know it is not a URL. */\nexport function parseURLObject(trimmed, def) {\n    // When normalize is off, require :// for http/https URLs. This prevents strings like \"http:example.com\" or \"https:/path\" from being silently accepted\n    if (!def.normalize && def.protocol?.source === regexes.httpProtocol.source && !/^https?:\\/\\//i.test(trimmed)) {\n        return URL_BAD_FORMAT;\n    }\n    try {\n        // @ts-ignore\n        return new URL(trimmed);\n    }\n    catch {\n        return URL_UNPARSEABLE;\n    }\n}\nconst asciiTabOrNewline = /[\\t\\n\\r]/g;\n/** The URL parser deletes every ASCII tab, LF and CR from its input before it parses, so `new URL(\"https://exa\\nmple.com\")` reports on `example.com`. Applying the same deletion to the returned value closes the half of that divergence which can move the host; the parser's other rewrite, stripping C0 controls at the edges, cannot. */\nexport function stripTabAndNewline(value) {\n    return value.replace(asciiTabOrNewline, \"\");\n}\nexport function urlHostnameOk(url, hostname) {\n    hostname.lastIndex = 0;\n    return hostname.test(url.hostname);\n}\nexport function urlProtocolOk(url, protocol) {\n    protocol.lastIndex = 0;\n    return protocol.test(url.protocol.endsWith(\":\") ? url.protocol.slice(0, -1) : url.protocol);\n}\nexport const $ZodURL = /*@__PURE__*/ core.$constructor(\"$ZodURL\", (inst, def) => {\n    $ZodStringFormat.init(inst, def);\n    inst._zod.check = (payload) => {\n        try {\n            // Trim whitespace from input\n            const trimmed = payload.value.trim();\n            const url = parseURLObject(trimmed, def);\n            if (url === URL_BAD_FORMAT) {\n                payload.issues.push({\n                    code: \"invalid_format\",\n                    format: \"url\",\n                    note: \"Invalid URL format\",\n                    input: payload.value,\n                    inst,\n                    continue: !def.abort,\n                });\n                return;\n            }\n            if (url === URL_UNPARSEABLE) {\n                payload.issues.push({\n                    code: \"invalid_format\",\n                    format: \"url\",\n                    input: payload.value,\n                    inst,\n                    continue: !def.abort,\n                });\n                return;\n            }\n            if (def.hostname && !urlHostnameOk(url, def.hostname)) {\n                payload.issues.push({\n                    code: \"invalid_format\",\n                    format: \"url\",\n                    note: \"Invalid hostname\",\n                    pattern: def.hostname.source,\n                    input: payload.value,\n                    inst,\n                    continue: !def.abort,\n                });\n            }\n            if (def.protocol && !urlProtocolOk(url, def.protocol)) {\n                payload.issues.push({\n                    code: \"invalid_format\",\n                    format: \"url\",\n                    note: \"Invalid protocol\",\n                    pattern: def.protocol.source,\n                    input: payload.value,\n                    inst,\n                    continue: !def.abort,\n                });\n            }\n            // Set the output value based on normalize flag\n            payload.value = def.normalize ? url.href : stripTabAndNewline(trimmed);\n            return;\n        }\n        catch (_) {\n            payload.issues.push({\n                code: \"invalid_format\",\n                format: \"url\",\n                input: payload.value,\n                inst,\n                continue: !def.abort,\n            });\n        }\n    };\n});\nexport const $ZodEmoji = /*@__PURE__*/ core.$constructor(\"$ZodEmoji\", (inst, def) => {\n    def.pattern ?? (def.pattern = regexes.emoji());\n    $ZodStringFormat.init(inst, def);\n});\nexport const $ZodNanoID = /*@__PURE__*/ core.$constructor(\"$ZodNanoID\", (inst, def) => {\n    if (def.length !== undefined && (!Number.isInteger(def.length) || def.length < 1))\n        throw new Error(`Invalid nanoid length: ${def.length}`);\n    def.pattern ?? (def.pattern = def.length === undefined ? regexes.nanoid : regexes.nanoidOfLength(def.length));\n    $ZodStringFormat.init(inst, def);\n});\n/**\n * @deprecated CUID v1 is deprecated by its authors due to information leakage\n * (timestamps embedded in the id). Use {@link $ZodCUID2} instead.\n * See https://github.com/paralleldrive/cuid.\n */\nexport const $ZodCUID = /*@__PURE__*/ core.$constructor(\"$ZodCUID\", (inst, def) => {\n    def.pattern ?? (def.pattern = regexes.cuid);\n    $ZodStringFormat.init(inst, def);\n});\nexport const $ZodCUID2 = /*@__PURE__*/ core.$constructor(\"$ZodCUID2\", (inst, def) => {\n    def.pattern ?? (def.pattern = regexes.cuid2);\n    $ZodStringFormat.init(inst, def);\n});\nexport const $ZodULID = /*@__PURE__*/ core.$constructor(\"$ZodULID\", (inst, def) => {\n    def.pattern ?? (def.pattern = regexes.ulid);\n    $ZodStringFormat.init(inst, def);\n});\nexport const $ZodXID = /*@__PURE__*/ core.$constructor(\"$ZodXID\", (inst, def) => {\n    def.pattern ?? (def.pattern = regexes.xid);\n    $ZodStringFormat.init(inst, def);\n});\nexport const $ZodKSUID = /*@__PURE__*/ core.$constructor(\"$ZodKSUID\", (inst, def) => {\n    def.pattern ?? (def.pattern = regexes.ksuid);\n    $ZodStringFormat.init(inst, def);\n});\nexport const $ZodISODateTime = /*@__PURE__*/ core.$constructor(\"$ZodISODateTime\", (inst, def) => {\n    def.pattern ?? (def.pattern = regexes.datetime(def));\n    $ZodStringFormat.init(inst, def);\n    // these two drop the offset or seconds `date-time` requires — on the bag not the def, since `z.string().check(...)` lands the format on a different schema\n    if (def.local || def.precision === -1) {\n        inst._zod.bag.laxFormat = true;\n        inst._zod.onattach.push((s) => {\n            s._zod.bag.laxFormat = true;\n        });\n    }\n});\nexport const $ZodISODate = /*@__PURE__*/ core.$constructor(\"$ZodISODate\", (inst, def) => {\n    def.pattern ?? (def.pattern = regexes.date);\n    $ZodStringFormat.init(inst, def);\n});\nexport const $ZodISOTime = /*@__PURE__*/ core.$constructor(\"$ZodISOTime\", (inst, def) => {\n    def.pattern ?? (def.pattern = regexes.time(def));\n    $ZodStringFormat.init(inst, def);\n});\nexport const $ZodISODuration = /*@__PURE__*/ core.$constructor(\"$ZodISODuration\", (inst, def) => {\n    def.pattern ?? (def.pattern = regexes.duration);\n    $ZodStringFormat.init(inst, def);\n});\nexport const $ZodIPv4 = /*@__PURE__*/ core.$constructor(\"$ZodIPv4\", (inst, def) => {\n    def.pattern ?? (def.pattern = regexes.ipv4);\n    $ZodStringFormat.init(inst, def);\n    inst._zod.bag.format = `ipv4`;\n});\n/** An IPv6 address is written with hex digits, colons and dots, and nothing else. The guard is what makes the check below an IPv6 check: `new URL(\"http://[...]\")` parses an authority, not an address, so `@` and `\\` re-delimit it and `\"::@1\\\\\"` validates against the host `0.0.0.1`. The URL parser also deletes ASCII tab, LF and CR rather than failing, which is how `\"::1\\n\"` validated as `::1`. */\nconst ipv6Alphabet = /^[0-9a-fA-F:.]+$/;\nexport function isValidIPv6(value) {\n    if (!ipv6Alphabet.test(value))\n        return false;\n    try {\n        // @ts-ignore\n        new URL(`http://[${value}]`);\n        return true;\n    }\n    catch {\n        return false;\n    }\n}\nexport const $ZodIPv6 = /*@__PURE__*/ core.$constructor(\"$ZodIPv6\", (inst, def) => {\n    def.pattern ?? (def.pattern = regexes.ipv6);\n    $ZodStringFormat.init(inst, def);\n    inst._zod.bag.format = `ipv6`;\n    inst._zod.check = (payload) => {\n        if (!isValidIPv6(payload.value)) {\n            payload.issues.push({\n                code: \"invalid_format\",\n                format: \"ipv6\",\n                input: payload.value,\n                inst,\n                continue: !def.abort,\n            });\n        }\n    };\n});\nexport const $ZodMAC = /*@__PURE__*/ core.$constructor(\"$ZodMAC\", (inst, def) => {\n    def.pattern ?? (def.pattern = regexes.mac(def.delimiter));\n    $ZodStringFormat.init(inst, def);\n    inst._zod.bag.format = `mac`;\n});\nexport const $ZodCIDRv4 = /*@__PURE__*/ core.$constructor(\"$ZodCIDRv4\", (inst, def) => {\n    def.pattern ?? (def.pattern = regexes.cidrv4);\n    $ZodStringFormat.init(inst, def);\n});\nexport function isValidCIDRv6(value) {\n    const parts = value.split(\"/\");\n    if (parts.length !== 2)\n        return false;\n    const [address, prefix] = parts;\n    if (!prefix)\n        return false;\n    const prefixNum = Number(prefix);\n    if (`${prefixNum}` !== prefix)\n        return false;\n    if (prefixNum < 0 || prefixNum > 128)\n        return false;\n    return isValidIPv6(address);\n}\nexport const $ZodCIDRv6 = /*@__PURE__*/ core.$constructor(\"$ZodCIDRv6\", (inst, def) => {\n    def.pattern ?? (def.pattern = regexes.cidrv6); // not used for validation\n    $ZodStringFormat.init(inst, def);\n    inst._zod.check = (payload) => {\n        if (!isValidCIDRv6(payload.value)) {\n            payload.issues.push({\n                code: \"invalid_format\",\n                format: \"cidrv6\",\n                input: payload.value,\n                inst,\n                continue: !def.abort,\n            });\n        }\n    };\n});\n//////////////////////////////   ZodBase64   //////////////////////////////\nexport function isValidBase64(data) {\n    if (data === \"\")\n        return true;\n    // atob ignores whitespace, so reject it up front.\n    if (/\\s/.test(data))\n        return false;\n    if (data.length % 4 !== 0)\n        return false;\n    try {\n        // @ts-ignore\n        atob(data);\n        return true;\n    }\n    catch {\n        return false;\n    }\n}\nexport const $ZodBase64 = /*@__PURE__*/ core.$constructor(\"$ZodBase64\", (inst, def) => {\n    def.pattern ?? (def.pattern = regexes.base64);\n    $ZodStringFormat.init(inst, def);\n    inst._zod.bag.contentEncoding = \"base64\";\n    inst._zod.check = (payload) => {\n        if (isValidBase64(payload.value))\n            return;\n        payload.issues.push({\n            code: \"invalid_format\",\n            format: \"base64\",\n            input: payload.value,\n            inst,\n            continue: !def.abort,\n        });\n    };\n});\n//////////////////////////////   ZodBase64   //////////////////////////////\nexport function isValidBase64URL(data) {\n    if (!regexes.base64url.test(data))\n        return false;\n    const base64 = data.replace(/[-_]/g, (c) => (c === \"-\" ? \"+\" : \"/\"));\n    const padded = base64.padEnd(Math.ceil(base64.length / 4) * 4, \"=\");\n    return isValidBase64(padded);\n}\nexport const $ZodBase64URL = /*@__PURE__*/ core.$constructor(\"$ZodBase64URL\", (inst, def) => {\n    def.pattern ?? (def.pattern = regexes.base64url);\n    $ZodStringFormat.init(inst, def);\n    inst._zod.bag.contentEncoding = \"base64url\";\n    inst._zod.check = (payload) => {\n        if (isValidBase64URL(payload.value))\n            return;\n        payload.issues.push({\n            code: \"invalid_format\",\n            format: \"base64url\",\n            input: payload.value,\n            inst,\n            continue: !def.abort,\n        });\n    };\n});\nexport const $ZodE164 = /*@__PURE__*/ core.$constructor(\"$ZodE164\", (inst, def) => {\n    def.pattern ?? (def.pattern = regexes.e164);\n    $ZodStringFormat.init(inst, def);\n});\n//////////////////////////////   ZodCreditCard   //////////////////////////////\nconst CC_SANITIZE = /[- ]/g;\n/** Luhn checksum on a digit-only string. Adapted from valibot (MIT). */\nfunction isLuhnAlgo(digits) {\n    let length = digits.length;\n    let bit = 1;\n    let sum = 0;\n    while (length) {\n        const value = +digits[--length];\n        bit ^= 1;\n        sum += bit ? [0, 2, 4, 6, 8, 1, 3, 5, 7, 9][value] : value;\n    }\n    return sum % 10 === 0;\n}\nexport function isValidCreditCard(input) {\n    if (!regexes.creditCard.test(input))\n        return false;\n    return isLuhnAlgo(input.replace(CC_SANITIZE, \"\"));\n}\nexport const $ZodCreditCard = /*@__PURE__*/ core.$constructor(\"$ZodCreditCard\", (inst, def) => {\n    // Shape only — the Luhn check below is not expressible as a pattern, so consumers of `pattern` (JSON Schema, template literals) get the length and separator rules alone.\n    def.pattern ?? (def.pattern = regexes.creditCard);\n    $ZodStringFormat.init(inst, def);\n    inst._zod.check = (payload) => {\n        if (isValidCreditCard(payload.value))\n            return;\n        payload.issues.push({\n            code: \"invalid_format\",\n            format: \"credit_card\",\n            input: payload.value,\n            inst,\n            continue: !def.abort,\n        });\n    };\n});\n//////////////////////////////   ZodJWT   //////////////////////////////\nexport function isValidJWT(token, algorithm = null) {\n    try {\n        const tokensParts = token.split(\".\");\n        if (tokensParts.length !== 3)\n            return false;\n        const [header] = tokensParts;\n        if (!header)\n            return false;\n        // @ts-ignore\n        const parsedHeader = JSON.parse(atob(header));\n        if (\"typ\" in parsedHeader && parsedHeader?.typ !== \"JWT\")\n            return false;\n        if (!parsedHeader.alg)\n            return false;\n        if (algorithm && (!(\"alg\" in parsedHeader) || parsedHeader.alg !== algorithm))\n            return false;\n        return true;\n    }\n    catch {\n        return false;\n    }\n}\nexport const $ZodJWT = /*@__PURE__*/ core.$constructor(\"$ZodJWT\", (inst, def) => {\n    $ZodStringFormat.init(inst, def);\n    inst._zod.check = (payload) => {\n        if (isValidJWT(payload.value, def.alg))\n            return;\n        payload.issues.push({\n            code: \"invalid_format\",\n            format: \"jwt\",\n            input: payload.value,\n            inst,\n            continue: !def.abort,\n        });\n    };\n});\nexport const $ZodCustomStringFormat = /*@__PURE__*/ core.$constructor(\"$ZodCustomStringFormat\", (inst, def) => {\n    $ZodStringFormat.init(inst, def);\n    inst._zod.check = (payload) => {\n        if (def.fn(payload.value))\n            return;\n        payload.issues.push({\n            code: \"invalid_format\",\n            format: def.format,\n            input: payload.value,\n            inst,\n            continue: !def.abort,\n        });\n    };\n});\nexport const $ZodNumber = /*@__PURE__*/ core.$constructor(\"$ZodNumber\", (inst, def) => {\n    $ZodType.init(inst, def);\n    inst._zod.pattern = inst._zod.bag.pattern ?? regexes.number;\n    inst._zod.parse = (payload, _ctx) => {\n        if (def.coerce)\n            try {\n                payload.value = Number(payload.value);\n            }\n            catch (_) { }\n        const input = payload.value;\n        if (typeof input === \"number\" && !Number.isNaN(input) && Number.isFinite(input)) {\n            return payload;\n        }\n        const received = typeof input === \"number\"\n            ? Number.isNaN(input)\n                ? \"NaN\"\n                : !Number.isFinite(input)\n                    ? String(input)\n                    : undefined\n            : undefined;\n        payload.issues.push({\n            expected: \"number\",\n            code: \"invalid_type\",\n            input,\n            inst,\n            ...(received ? { received } : {}),\n        });\n        return payload;\n    };\n});\nexport const $ZodNumberFormat = /*@__PURE__*/ core.$constructor(\"$ZodNumberFormat\", (inst, def) => {\n    checks.$ZodCheckNumberFormat.init(inst, def);\n    $ZodNumber.init(inst, def); // no format checks\n});\nexport const $ZodBoolean = /*@__PURE__*/ core.$constructor(\"$ZodBoolean\", (inst, def) => {\n    $ZodType.init(inst, def);\n    inst._zod.pattern = regexes.boolean;\n    inst._zod.parse = (payload, _ctx) => {\n        if (def.coerce)\n            try {\n                payload.value = Boolean(payload.value);\n            }\n            catch (_) { }\n        const input = payload.value;\n        if (typeof input === \"boolean\")\n            return payload;\n        payload.issues.push({\n            expected: \"boolean\",\n            code: \"invalid_type\",\n            input,\n            inst,\n        });\n        return payload;\n    };\n});\nexport const $ZodBigInt = /*@__PURE__*/ core.$constructor(\"$ZodBigInt\", (inst, def) => {\n    $ZodType.init(inst, def);\n    inst._zod.pattern = regexes.bigint;\n    inst._zod.parse = (payload, _ctx) => {\n        if (def.coerce)\n            try {\n                payload.value = BigInt(payload.value);\n            }\n            catch (_) { }\n        if (typeof payload.value === \"bigint\")\n            return payload;\n        payload.issues.push({\n            expected: \"bigint\",\n            code: \"invalid_type\",\n            input: payload.value,\n            inst,\n        });\n        return payload;\n    };\n});\nexport const $ZodBigIntFormat = /*@__PURE__*/ core.$constructor(\"$ZodBigIntFormat\", (inst, def) => {\n    checks.$ZodCheckBigIntFormat.init(inst, def);\n    $ZodBigInt.init(inst, def); // no format checks\n});\nexport const $ZodSymbol = /*@__PURE__*/ core.$constructor(\"$ZodSymbol\", (inst, def) => {\n    $ZodType.init(inst, def);\n    inst._zod.parse = (payload, _ctx) => {\n        const input = payload.value;\n        if (typeof input === \"symbol\")\n            return payload;\n        payload.issues.push({\n            expected: \"symbol\",\n            code: \"invalid_type\",\n            input,\n            inst,\n        });\n        return payload;\n    };\n});\nexport const $ZodUndefined = /*@__PURE__*/ core.$constructor(\"$ZodUndefined\", (inst, def) => {\n    $ZodType.init(inst, def);\n    inst._zod.pattern = regexes.undefined;\n    inst._zod.values = new Set([undefined]);\n    inst._zod.parse = (payload, _ctx) => {\n        const input = payload.value;\n        if (typeof input === \"undefined\")\n            return payload;\n        payload.issues.push({\n            expected: \"undefined\",\n            code: \"invalid_type\",\n            input,\n            inst,\n        });\n        return payload;\n    };\n});\nexport const $ZodNull = /*@__PURE__*/ core.$constructor(\"$ZodNull\", (inst, def) => {\n    $ZodType.init(inst, def);\n    inst._zod.pattern = regexes.null;\n    inst._zod.values = new Set([null]);\n    inst._zod.parse = (payload, _ctx) => {\n        const input = payload.value;\n        if (input === null)\n            return payload;\n        payload.issues.push({\n            expected: \"null\",\n            code: \"invalid_type\",\n            input,\n            inst,\n        });\n        return payload;\n    };\n});\nexport const $ZodAny = /*@__PURE__*/ core.$constructor(\"$ZodAny\", (inst, def) => {\n    $ZodType.init(inst, def);\n    inst._zod.parse = (payload) => payload;\n});\nexport const $ZodUnknown = /*@__PURE__*/ core.$constructor(\"$ZodUnknown\", (inst, def) => {\n    $ZodType.init(inst, def);\n    inst._zod.parse = (payload) => payload;\n});\nexport const $ZodNever = /*@__PURE__*/ core.$constructor(\"$ZodNever\", (inst, def) => {\n    $ZodType.init(inst, def);\n    inst._zod.parse = (payload, _ctx) => {\n        payload.issues.push({\n            expected: \"never\",\n            code: \"invalid_type\",\n            input: payload.value,\n            inst,\n        });\n        return payload;\n    };\n});\nexport const $ZodVoid = /*@__PURE__*/ core.$constructor(\"$ZodVoid\", (inst, def) => {\n    $ZodType.init(inst, def);\n    inst._zod.parse = (payload, _ctx) => {\n        const input = payload.value;\n        if (typeof input === \"undefined\")\n            return payload;\n        payload.issues.push({\n            expected: \"void\",\n            code: \"invalid_type\",\n            input,\n            inst,\n        });\n        return payload;\n    };\n});\nexport const $ZodDate = /*@__PURE__*/ core.$constructor(\"$ZodDate\", (inst, def) => {\n    $ZodType.init(inst, def);\n    inst._zod.parse = (payload, _ctx) => {\n        if (def.coerce) {\n            try {\n                payload.value = new Date(payload.value);\n            }\n            catch (_err) { }\n        }\n        const input = payload.value;\n        const isDate = input instanceof Date;\n        const isValidDate = isDate && !Number.isNaN(input.getTime());\n        if (isValidDate)\n            return payload;\n        payload.issues.push({\n            expected: \"date\",\n            code: \"invalid_type\",\n            input,\n            ...(isDate ? { received: \"Invalid Date\" } : {}),\n            inst,\n        });\n        return payload;\n    };\n});\nfunction handleArrayResult(result, final, index) {\n    if (result.issues.length) {\n        final.issues.push(...util.prefixIssues(index, result.issues));\n    }\n    final.value[index] = result.value;\n}\nexport const $ZodArray = /*@__PURE__*/ core.$constructor(\"$ZodArray\", (inst, def) => {\n    $ZodType.init(inst, def);\n    const memo = core.globalConfig.memoizer;\n    memo?.attach(inst);\n    inst._zod.parse = (payload, ctx) => {\n        const input = payload.value;\n        if (!Array.isArray(input)) {\n            payload.issues.push({\n                expected: \"array\",\n                code: \"invalid_type\",\n                input,\n                inst,\n            });\n            return payload;\n        }\n        payload.value = memo ? memo.alloc(inst, payload, Array(input.length), ctx) : Array(input.length);\n        const proms = [];\n        for (let i = 0; i < input.length; i++) {\n            const item = input[i];\n            const result = def.element._zod.run({\n                value: item,\n                issues: [],\n            }, ctx);\n            if (result instanceof Promise) {\n                proms.push(result.then((result) => handleArrayResult(result, payload, i)));\n            }\n            else {\n                handleArrayResult(result, payload, i);\n            }\n        }\n        if (proms.length) {\n            return Promise.all(proms).then(() => payload);\n        }\n        return payload; //handleArrayResultsAsync(parseResults, final);\n    };\n});\nfunction handlePropertyResult(result, final, key, input, optin, optout) {\n    const isPresent = key in input;\n    const isOptionalOut = optout === \"optional\";\n    // The middle rung means \"absence permitted, nothing supplied in its place\", so an absent key contributes nothing — whatever the schema made of `undefined` is invented, not substituted. Only `optional` reaches this with a value: `defaulted` substitutes, and a schema that isn't optional-out has to keep the key.\n    if (!isPresent && isOptionalOut && optin === \"optional\") {\n        return;\n    }\n    if (result.issues.length) {\n        // For optional-in/out schemas, ignore errors on absent keys.\n        if (optin !== undefined && isOptionalOut && !isPresent) {\n            return;\n        }\n        final.issues.push(...util.prefixIssues(key, result.issues));\n    }\n    if (!isPresent && optin === undefined) {\n        if (!result.issues.length) {\n            final.issues.push({\n                code: \"invalid_type\",\n                expected: \"nonoptional\",\n                input: undefined,\n                path: [key],\n            });\n        }\n        return;\n    }\n    if (result.value === undefined) {\n        if (isPresent) {\n            final.value[key] = undefined;\n        }\n    }\n    else {\n        final.value[key] = result.value;\n    }\n}\n// one shared instance; a fresh [] per schema cost 56 bytes retained\nconst NO_SYMBOL_KEYS = [];\nfunction normalizeDef(def) {\n    const keys = Object.keys(def.shape);\n    const ownSymbols = Object.getOwnPropertySymbols(def.shape);\n    const symbolKeys = ownSymbols.length ? ownSymbols : NO_SYMBOL_KEYS;\n    // aliases `keys` when there are no symbols, so a string-only shape keeps one array\n    const allKeys = symbolKeys.length ? [...keys, ...symbolKeys] : keys;\n    for (const k of allKeys) {\n        if (!def.shape?.[k]?._zod?.traits?.has(\"$ZodType\")) {\n            throw new Error(`Invalid element at key \"${String(k)}\": expected a Zod schema`);\n        }\n    }\n    const okeys = util.optionalKeys(def.shape);\n    return {\n        ...def,\n        allKeys,\n        symbolKeys,\n        // string-only: handleCatchall matches it against `for...in`, which never yields a symbol\n        keySet: new Set(keys),\n        numKeys: keys.length,\n        optionalKeys: new Set(okeys),\n    };\n}\nfunction handleCatchall(proms, input, payload, ctx, def, inst) {\n    const unrecognized = [];\n    const keySet = def.keySet;\n    const _catchall = def.catchall._zod;\n    const t = _catchall.def.type;\n    const optin = _catchall.optin;\n    const optout = _catchall.optout;\n    for (const key in input) {\n        // Must precede the __proto__ branch: a declared key is not unrecognized, even though the shape loop deliberately strips __proto__ from the parsed output.\n        if (keySet.has(key))\n            continue;\n        // Don't copy an undeclared __proto__ into the result; assignment to a plain {} would replace the result prototype. But in strict mode it is still an unknown key, so report it before skipping.\n        if (key === \"__proto__\") {\n            if (t === \"never\")\n                unrecognized.push(key);\n            continue;\n        }\n        if (t === \"never\") {\n            unrecognized.push(key);\n            continue;\n        }\n        const r = _catchall.run({ value: input[key], issues: [] }, ctx);\n        if (r instanceof Promise) {\n            proms.push(r.then((r) => handlePropertyResult(r, payload, key, input, optin, optout)));\n        }\n        else {\n            handlePropertyResult(r, payload, key, input, optin, optout);\n        }\n    }\n    if (unrecognized.length) {\n        payload.issues.push({\n            code: \"unrecognized_keys\",\n            keys: unrecognized,\n            input,\n            inst,\n            // Describes the shape of the input, not the validity of the parsed value, so it never aborts. The parse still fails; the schema's own checks just get to run first, and an enclosing intersection can reconcile the key against a sibling operand.\n            continue: true,\n        });\n    }\n    if (!proms.length)\n        return payload;\n    return Promise.all(proms).then(() => {\n        return payload;\n    });\n}\n// Whichever object a def's `shape` currently answers from: the one the caller passed until the first read, the frozen copy after it. Keyed by def, so a def rebuilt by a builder is simply absent rather than inheriting the source's. Read its keys with `Object.keys`, which does not invoke them — that is what lets a discriminated union check its discriminator without resolving an option whose getters reference the union being constructed.\nconst propShapes = new WeakMap();\nexport const $ZodObject = /*@__PURE__*/ core.$constructor(\"$ZodObject\", (inst, def) => {\n    // requires cast because technically $ZodObject doesn't extend\n    $ZodType.init(inst, def);\n    // const sh = def.shape;\n    const desc = Object.getOwnPropertyDescriptor(def, \"shape\");\n    if (!desc?.get) {\n        const sh = def.shape;\n        propShapes.set(def, sh);\n        Object.defineProperty(def, \"shape\", {\n            get: () => {\n                const newSh = { ...sh };\n                Object.defineProperty(def, \"shape\", {\n                    value: newSh,\n                });\n                propShapes.set(def, newSh);\n                return newSh;\n            },\n        });\n    }\n    const _normalized = util.cached(() => normalizeDef(def));\n    util.defineLazyInternal(inst, \"propValues\", (zod) => {\n        const shape = zod.def.shape;\n        const propValues = {};\n        for (const key in shape) {\n            const field = shape[key]._zod;\n            if (field.values) {\n                if (!Object.prototype.hasOwnProperty.call(propValues, key)) {\n                    util.assignProp(propValues, key, new Set());\n                }\n                for (const v of field.values)\n                    propValues[key].add(v);\n                // An omittable slot reads back as undefined at a discriminator lookup, so it has to claim undefined: two options that can both omit the key are not discriminable on it.\n                if (field.optin !== undefined)\n                    propValues[key].add(undefined);\n            }\n        }\n        return propValues;\n    });\n    const isObject = util.isObject;\n    const catchall = def.catchall;\n    let value;\n    const memo = core.globalConfig.memoizer;\n    memo?.attach(inst);\n    inst._zod.parse = (payload, ctx) => {\n        value ?? (value = _normalized.value);\n        const input = payload.value;\n        if (!isObject(input)) {\n            payload.issues.push({\n                expected: \"object\",\n                code: \"invalid_type\",\n                input,\n                inst,\n            });\n            return payload;\n        }\n        payload.value = memo ? memo.alloc(inst, payload, {}, ctx) : {};\n        const proms = [];\n        const shape = value.shape;\n        for (const key of value.allKeys) {\n            if (key === \"__proto__\")\n                continue;\n            const el = shape[key];\n            const optin = el._zod.optin;\n            const optout = el._zod.optout;\n            const r = el._zod.run({ value: input[key], issues: [] }, ctx);\n            if (r instanceof Promise) {\n                proms.push(r.then((r) => handlePropertyResult(r, payload, key, input, optin, optout)));\n            }\n            else {\n                handlePropertyResult(r, payload, key, input, optin, optout);\n            }\n        }\n        if (!catchall) {\n            return proms.length ? Promise.all(proms).then(() => payload) : payload;\n        }\n        return handleCatchall(proms, input, payload, ctx, _normalized.value, inst);\n    };\n});\nexport const $ZodObjectJIT = /*@__PURE__*/ core.$constructor(\"$ZodObjectJIT\", (inst, def) => {\n    // requires cast because technically $ZodObject doesn't extend\n    $ZodObject.init(inst, def);\n    const superParse = inst._zod.parse;\n    const _normalized = util.cached(() => normalizeDef(def));\n    const memo = core.globalConfig.memoizer;\n    const generateFastpass = (shape) => {\n        const normalized = _normalized.value;\n        const syms = normalized.symbolKeys;\n        // a symbol has no source literal, so it is read as `syms[i]` off the closed-over scope\n        const doc = new Doc([\"payload\", \"ctx\"], { shape, inst, memo, syms });\n        const parseStr = (k) => `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;\n        // Prefixes in place, like util.prefixIssues does for every interpreted path.\n        const prefixStr = (id, k) => `\n          for (let i = 0; i < ${id}.issues.length; i++) {\n            const iss = ${id}.issues[i];\n            iss.path = iss.path ? [${k}, ...iss.path] : [${k}];\n            payload.issues.push(iss);\n          }`;\n        doc.write(`const input = payload.value;`);\n        const ids = Object.create(null);\n        let counter = 0;\n        for (const key of normalized.allKeys) {\n            ids[key] = `key_${counter++}`;\n        }\n        // A: preserve key order {\n        doc.write(memo ? `const newResult = memo.alloc(inst, payload, {}, ctx);` : `const newResult = {};`);\n        for (const key of normalized.allKeys) {\n            if (key === \"__proto__\")\n                continue;\n            const id = ids[key];\n            const k = typeof key === \"symbol\" ? `syms[${syms.indexOf(key)}]` : util.esc(key);\n            const isPresent = `${k} in input`;\n            const schema = shape[key];\n            const optin = schema?._zod?.optin;\n            const isOptionalIn = optin !== undefined;\n            const isOptionalOut = schema?._zod?.optout === \"optional\";\n            doc.write(`const ${id} = ${parseStr(k)};`);\n            if (isOptionalIn && isOptionalOut) {\n                // For optional-in/out schemas, ignore errors on absent keys — and, like the interpreted path, drop the value produced alongside them. The middle rung goes further: it permits absence without supplying anything in its place, so an absent key contributes nothing at all.\n                const assign = optin === \"optional\" ? `${id}_present` : `${id}.value !== undefined || ${id}_present`;\n                doc.write(`\n        const ${id}_present = ${isPresent};\n        if (!${id}.issues.length || ${id}_present) {\n          if (${id}.issues.length) {${prefixStr(id, k)}\n          }\n\n          if (${assign}) {\n            newResult[${k}] = ${id}.value;\n          }\n        }\n\n      `);\n            }\n            else if (!isOptionalIn) {\n                doc.write(`\n        const ${id}_present = ${isPresent};\n        if (${id}.issues.length) {${prefixStr(id, k)}\n        }\n        if (!${id}_present && !${id}.issues.length) {\n          payload.issues.push({\n            code: \"invalid_type\",\n            expected: \"nonoptional\",\n            input: undefined,\n            path: [${k}]\n          });\n        }\n\n        if (${id}_present) {\n          newResult[${k}] = ${id}.value;\n        }\n\n      `);\n            }\n            else {\n                doc.write(`\n        if (${id}.issues.length) {${prefixStr(id, k)}\n        }\n        \n        if (${id}.value === undefined) {\n          if (${isPresent}) {\n            newResult[${k}] = undefined;\n          }\n        } else {\n          newResult[${k}] = ${id}.value;\n        }\n\n      `);\n            }\n        }\n        doc.write(`payload.value = newResult;`);\n        doc.write(`return payload;`);\n        // closing `shape` in is what pays: turbofan specializes the parser against that one shape object, so every `shape[k]._zod.run` folds to a known callee. as a parameter it stays a generic load and measures 13% slower even with the forwarding frame gone\n        return doc.compile();\n    };\n    let fastpass;\n    const isObject = util.isObject;\n    const jit = !core.globalConfig.jitless;\n    const allowsEval = util.allowsEval;\n    const fastEnabled = jit && allowsEval.value; // && !def.catchall;\n    const catchall = def.catchall;\n    let value;\n    inst._zod.parse = (payload, ctx) => {\n        value ?? (value = _normalized.value);\n        const input = payload.value;\n        if (!isObject(input)) {\n            payload.issues.push({\n                expected: \"object\",\n                code: \"invalid_type\",\n                input,\n                inst,\n            });\n            return payload;\n        }\n        if (jit && fastEnabled && ctx?.async === false && ctx.jitless !== true) {\n            // always synchronous\n            if (!fastpass)\n                fastpass = generateFastpass(def.shape);\n            payload = fastpass(payload, ctx);\n            if (!catchall)\n                return payload;\n            return handleCatchall([], input, payload, ctx, value, inst);\n        }\n        return superParse(payload, ctx);\n    };\n});\nfunction handleUnionResults(results, final, inst, ctx) {\n    for (const result of results) {\n        if (result.issues.length === 0) {\n            final.value = result.value;\n            return final;\n        }\n    }\n    const nonaborted = results.filter((r) => !util.aborted(r));\n    if (nonaborted.length === 1) {\n        final.value = nonaborted[0].value;\n        return nonaborted[0];\n    }\n    final.issues.push({\n        code: \"invalid_union\",\n        input: final.value,\n        inst,\n        errors: results.map((result) => result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config()))),\n    });\n    return final;\n}\nexport const $ZodUnion = /*@__PURE__*/ core.$constructor(\"$ZodUnion\", (inst, def) => {\n    $ZodType.init(inst, def);\n    util.defineLazyInternal(inst, \"optin\", (zod) => zod.def.options.some((o) => o._zod.optin === \"defaulted\")\n        ? \"defaulted\"\n        : zod.def.options.some((o) => o._zod.optin !== undefined)\n            ? \"optional\"\n            : undefined);\n    util.defineLazyInternal(inst, \"optout\", (zod) => zod.def.options.some((o) => o._zod.optout === \"optional\") ? \"optional\" : undefined);\n    util.defineLazyInternal(inst, \"values\", (zod) => {\n        if (zod.def.options.every((o) => o._zod.values)) {\n            return new Set(zod.def.options.flatMap((option) => Array.from(option._zod.values)));\n        }\n        return undefined;\n    });\n    util.defineLazyInternal(inst, \"pattern\", (zod) => {\n        if (zod.def.options.every((o) => o._zod.pattern)) {\n            const patterns = zod.def.options.map((o) => o._zod.pattern);\n            return new RegExp(`^(${patterns.map((p) => util.cleanRegex(p.source)).join(\"|\")})$`);\n        }\n        return undefined;\n    });\n    const first = def.options.length === 1 ? def.options[0]._zod.run : null;\n    inst._zod.parse = (payload, ctx) => {\n        if (first) {\n            return first(payload, ctx);\n        }\n        let async = false;\n        const results = [];\n        for (const option of def.options) {\n            const result = option._zod.run({\n                value: payload.value,\n                issues: [],\n            }, ctx);\n            if (result instanceof Promise) {\n                results.push(result);\n                async = true;\n            }\n            else {\n                if (result.issues.length === 0)\n                    return result;\n                results.push(result);\n            }\n        }\n        if (!async)\n            return handleUnionResults(results, payload, inst, ctx);\n        return Promise.all(results).then((results) => {\n            return handleUnionResults(results, payload, inst, ctx);\n        });\n    };\n});\nfunction handleExclusiveUnionResults(results, final, inst, ctx) {\n    const matches = [];\n    for (let i = 0; i < results.length; i++) {\n        if (results[i].issues.length === 0)\n            matches.push(i);\n    }\n    if (matches.length === 1) {\n        final.value = results[matches[0]].value;\n        return final;\n    }\n    if (matches.length === 0) {\n        // No matches - same as regular union\n        final.issues.push({\n            code: \"invalid_union\",\n            input: final.value,\n            inst,\n            errors: results.map((result) => result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config()))),\n        });\n    }\n    else {\n        // Multiple matches - exclusive union failure\n        final.issues.push({\n            code: \"invalid_union\",\n            input: final.value,\n            inst,\n            errors: [],\n            inclusive: false,\n            matches,\n        });\n    }\n    return final;\n}\nexport const $ZodXor = /*@__PURE__*/ core.$constructor(\"$ZodXor\", (inst, def) => {\n    $ZodUnion.init(inst, def);\n    def.inclusive = false;\n    const first = def.options.length === 1 ? def.options[0]._zod.run : null;\n    inst._zod.parse = (payload, ctx) => {\n        if (first) {\n            return first(payload, ctx);\n        }\n        let async = false;\n        const results = [];\n        for (const option of def.options) {\n            const result = option._zod.run({\n                value: payload.value,\n                issues: [],\n            }, ctx);\n            if (result instanceof Promise) {\n                results.push(result);\n                async = true;\n            }\n            else {\n                results.push(result);\n            }\n        }\n        if (!async)\n            return handleExclusiveUnionResults(results, payload, inst, ctx);\n        return Promise.all(results).then((results) => {\n            return handleExclusiveUnionResults(results, payload, inst, ctx);\n        });\n    };\n});\n/** Returns the option of `union` whose discriminator claims `value`. */\nexport function getDiscriminatedOption(union, value) {\n    const internals = union._zod;\n    let map = internals.bag.optionsMap;\n    if (!map) {\n        map = new Map();\n        const { options, discriminator } = internals.def;\n        for (const option of options) {\n            // First declaration wins, matching the order the parse path resolves a duplicate in.\n            for (const v of option._zod.propValues?.[discriminator] ?? [])\n                if (!map.has(v))\n                    map.set(v, option);\n        }\n        internals.bag.optionsMap = map;\n    }\n    return map.get(value);\n}\nexport const $ZodDiscriminatedUnion = \n/*@__PURE__*/\ncore.$constructor(\"$ZodDiscriminatedUnion\", (inst, def) => {\n    def.inclusive = false;\n    $ZodUnion.init(inst, def);\n    const _super = inst._zod.parse;\n    util.defineLazyInternal(inst, \"propValues\", (zod) => {\n        const propValues = {};\n        for (const option of zod.def.options) {\n            const pv = option._zod.propValues;\n            if (!pv || Object.keys(pv).length === 0)\n                throw new Error(`Invalid discriminated union option at index \"${zod.def.options.indexOf(option)}\"`);\n            for (const [k, v] of Object.entries(pv)) {\n                if (!Object.prototype.hasOwnProperty.call(propValues, k)) {\n                    util.assignProp(propValues, k, new Set());\n                }\n                for (const val of v) {\n                    propValues[k].add(val);\n                }\n            }\n        }\n        return propValues;\n    });\n    // Checked now rather than in the lookup map below, so an option that lacks the discriminator fails at the `discriminatedUnion` call instead of on the first object parsed. Options whose shape cannot be enumerated without resolving it — pipes, lazies, and objects rebuilt by a builder such as `.extend()` — are left to the map.\n    def.options.forEach((option, i) => {\n        const propShape = propShapes.get(option._zod.def);\n        if (propShape && !Object.prototype.hasOwnProperty.call(propShape, def.discriminator)) {\n            throw new Error(`Invalid discriminated union option at index \"${i}\"`);\n        }\n    });\n    const disc = util.cached(() => {\n        const opts = def.options;\n        const map = new Map();\n        for (const o of opts) {\n            const values = o._zod.propValues?.[def.discriminator];\n            if (!values || values.size === 0)\n                throw new Error(`Invalid discriminated union option at index \"${def.options.indexOf(o)}\"`);\n            for (const v of values) {\n                if (map.has(v)) {\n                    throw new Error(`Duplicate discriminator value \"${String(v)}\"`);\n                }\n                map.set(v, o);\n            }\n        }\n        return map;\n    });\n    inst._zod.parse = (payload, ctx) => {\n        const input = payload.value;\n        if (!util.isObject(input)) {\n            payload.issues.push({\n                code: \"invalid_type\",\n                expected: \"object\",\n                input,\n                inst,\n            });\n            return payload;\n        }\n        const opt = disc.value.get(input?.[def.discriminator]);\n        if (opt) {\n            return opt._zod.run(payload, ctx);\n        }\n        // Fall back to union matching when the fast discriminator path fails:\n        // - explicitly enabled via unionFallback, or\n        // - during backward direction (encode), since codec-based discriminators have different values in forward vs backward directions\n        if (def.unionFallback || ctx.direction === \"backward\") {\n            return _super(payload, ctx);\n        }\n        // no matching discriminator\n        payload.issues.push({\n            code: \"invalid_union\",\n            errors: [],\n            note: \"No matching discriminator\",\n            discriminator: def.discriminator,\n            options: Array.from(disc.value.keys()),\n            input,\n            path: [def.discriminator],\n            inst,\n        });\n        return payload;\n    };\n});\nexport const $ZodIntersection = /*@__PURE__*/ core.$constructor(\"$ZodIntersection\", (inst, def) => {\n    $ZodType.init(inst, def);\n    inst._zod.parse = (payload, ctx) => {\n        const input = payload.value;\n        const left = def.left._zod.run({ value: input, issues: [] }, ctx);\n        const right = def.right._zod.run({ value: input, issues: [] }, ctx);\n        const async = left instanceof Promise || right instanceof Promise;\n        if (async) {\n            return Promise.all([left, right]).then(([left, right]) => {\n                return handleIntersectionResults(payload, left, right);\n            });\n        }\n        return handleIntersectionResults(payload, left, right);\n    };\n});\nexport function mergeValues(a, b) {\n    // const aType = parse.t(a);\n    // const bType = parse.t(b);\n    if (a === b) {\n        return { valid: true, data: a };\n    }\n    if (a instanceof Date && b instanceof Date && +a === +b) {\n        return { valid: true, data: a };\n    }\n    if (util.isPlainObject(a) && util.isPlainObject(b)) {\n        const bKeys = Object.keys(b);\n        const sharedKeys = Object.keys(a).filter((key) => bKeys.indexOf(key) !== -1);\n        const newObj = { ...a, ...b };\n        if (Object.prototype.hasOwnProperty.call(newObj, \"__proto__\"))\n            delete newObj.__proto__;\n        for (const key of sharedKeys) {\n            if (key === \"__proto__\")\n                continue;\n            const sharedValue = mergeValues(a[key], b[key]);\n            if (!sharedValue.valid) {\n                return {\n                    valid: false,\n                    mergeErrorPath: [key, ...sharedValue.mergeErrorPath],\n                };\n            }\n            newObj[key] = sharedValue.data;\n        }\n        return { valid: true, data: newObj };\n    }\n    if (Array.isArray(a) && Array.isArray(b)) {\n        if (a.length !== b.length) {\n            return { valid: false, mergeErrorPath: [] };\n        }\n        const newArray = [];\n        for (let index = 0; index < a.length; index++) {\n            const itemA = a[index];\n            const itemB = b[index];\n            const sharedValue = mergeValues(itemA, itemB);\n            if (!sharedValue.valid) {\n                return {\n                    valid: false,\n                    mergeErrorPath: [index, ...sharedValue.mergeErrorPath],\n                };\n            }\n            newArray.push(sharedValue.data);\n        }\n        return { valid: true, data: newArray };\n    }\n    return { valid: false, mergeErrorPath: [] };\n}\nfunction handleIntersectionResults(result, left, right) {\n    // Track which side(s) reject each key. A key rejection is reported only when BOTH sides reject it, so a key owned by one branch survives the other's key schema. strictObject reports these as unrecognized_keys; a record with an open key schema reports one invalid_key per key.\n    const unrecKeys = new Map();\n    let unrecIssue;\n    const keyIssues = new Map();\n    const collect = (iss, side) => {\n        let keys;\n        if (iss.code === \"unrecognized_keys\" && !iss.path?.length) {\n            unrecIssue ?? (unrecIssue = iss);\n            keys = iss.keys;\n        }\n        else if (iss.code === \"invalid_key\" && iss.origin === \"record\" && iss.path?.length === 1) {\n            const k = String(iss.path[0]);\n            if (!keyIssues.has(k))\n                keyIssues.set(k, iss);\n            keys = [k];\n        }\n        else {\n            return false;\n        }\n        for (const k of keys) {\n            if (!unrecKeys.has(k))\n                unrecKeys.set(k, {});\n            unrecKeys.get(k)[side] = true;\n        }\n        return true;\n    };\n    for (const iss of left.issues) {\n        if (!collect(iss, \"l\"))\n            result.issues.push(iss);\n    }\n    for (const iss of right.issues) {\n        if (!collect(iss, \"r\"))\n            result.issues.push(iss);\n    }\n    // Report only keys rejected by BOTH sides\n    const bothKeys = [...unrecKeys].filter(([, f]) => f.l && f.r).map(([k]) => k);\n    if (bothKeys.length) {\n        const aggregated = unrecIssue ? bothKeys.filter((k) => unrecIssue.keys.includes(k)) : [];\n        if (aggregated.length)\n            result.issues.push({ ...unrecIssue, keys: aggregated });\n        for (const k of bothKeys) {\n            if (!aggregated.includes(k) && keyIssues.has(k))\n                result.issues.push(keyIssues.get(k));\n        }\n    }\n    const merged = mergeValues(left.value, right.value);\n    if (!merged.valid) {\n        if (util.aborted(result))\n            return result;\n        throw new Error(`Unmergable intersection. Error path: ` + `${JSON.stringify(merged.mergeErrorPath)}`);\n    }\n    result.value = merged.data;\n    return result;\n}\nexport const $ZodTuple = /*@__PURE__*/ core.$constructor(\"$ZodTuple\", (inst, def) => {\n    $ZodType.init(inst, def);\n    const items = def.items;\n    const memo = core.globalConfig.memoizer;\n    memo?.attach(inst);\n    inst._zod.parse = (payload, ctx) => {\n        const input = payload.value;\n        if (!Array.isArray(input)) {\n            payload.issues.push({\n                input,\n                inst,\n                expected: \"tuple\",\n                code: \"invalid_type\",\n            });\n            return payload;\n        }\n        payload.value = memo ? memo.alloc(inst, payload, [], ctx) : [];\n        const proms = [];\n        const optinStart = getTupleOptStart(items, \"optin\");\n        const optoutStart = getTupleOptStart(items, \"optout\");\n        if (!def.rest) {\n            if (input.length < optinStart) {\n                payload.issues.push({\n                    code: \"too_small\",\n                    minimum: optinStart,\n                    inclusive: true,\n                    input,\n                    inst,\n                    origin: \"array\",\n                });\n                return payload;\n            }\n            if (input.length > items.length) {\n                payload.issues.push({\n                    code: \"too_big\",\n                    maximum: items.length,\n                    inclusive: true,\n                    input,\n                    inst,\n                    origin: \"array\",\n                });\n            }\n        }\n        // Run every item in parallel, collecting results into an indexed array. The post-processing in `handleTupleResults` walks them in order so it can decide whether an absent optional-output error can truncate the tail or must be reported to preserve required output.\n        const itemResults = new Array(items.length);\n        for (let i = 0; i < items.length; i++) {\n            const r = items[i]._zod.run({ value: input[i], issues: [] }, ctx);\n            if (r instanceof Promise) {\n                proms.push(r.then((rr) => {\n                    itemResults[i] = rr;\n                }));\n            }\n            else {\n                itemResults[i] = r;\n            }\n        }\n        if (def.rest) {\n            let i = items.length - 1;\n            const rest = input.slice(items.length);\n            for (const el of rest) {\n                i++;\n                const result = def.rest._zod.run({ value: el, issues: [] }, ctx);\n                if (result instanceof Promise) {\n                    proms.push(result.then((r) => handleTupleResult(r, payload, i)));\n                }\n                else {\n                    handleTupleResult(result, payload, i);\n                }\n            }\n        }\n        if (proms.length) {\n            return Promise.all(proms).then(() => handleTupleResults(itemResults, payload, items, input, optoutStart));\n        }\n        return handleTupleResults(itemResults, payload, items, input, optoutStart);\n    };\n});\nfunction getTupleOptStart(items, key) {\n    for (let i = items.length - 1; i >= 0; i--) {\n        // optin is a three-rung ladder so any rung above `undefined` permits an absent slot; optout stays two-valued.\n        const omittable = key === \"optin\" ? items[i]._zod.optin !== undefined : items[i]._zod.optout === \"optional\";\n        if (!omittable)\n            return i + 1;\n    }\n    return 0;\n}\nfunction handleTupleResult(result, final, index) {\n    if (result.issues.length) {\n        final.issues.push(...util.prefixIssues(index, result.issues));\n    }\n    final.value[index] = result.value;\n}\nfunction handleTupleResults(itemResults, final, items, input, optoutStart) {\n    // Walk results in order. Mirror $ZodObject's swallow-on-absent-optional rule, but only after `optoutStart`: the first index where the output tuple tail can be absent.\n    for (let i = 0; i < items.length; i++) {\n        const r = itemResults[i];\n        const isPresent = i < input.length;\n        // The array analog of `handlePropertyResult`'s absent-key early return: the middle rung permits absence without supplying anything in its place, so the tail truncates here instead of materializing whatever the item made of `undefined`.\n        if (!isPresent && i >= optoutStart && items[i]._zod.optin === \"optional\") {\n            final.value.length = i;\n            break;\n        }\n        if (r.issues.length) {\n            if (!isPresent && i >= optoutStart) {\n                final.value.length = i;\n                break;\n            }\n            final.issues.push(...util.prefixIssues(i, r.issues));\n        }\n        final.value[i] = r.value;\n    }\n    // Drop trailing slots that produced `undefined` for absent input\n    // (the array analog of an absent optional key on an object). The\n    // `i >= input.length` floor is critical: an explicit `undefined`\n    // *inside* the input must be preserved even when the schema is\n    // optional-out (e.g. `z.string().or(z.undefined())` accepting an\n    // explicit undefined value).\n    for (let i = final.value.length - 1; i >= input.length; i--) {\n        if (items[i]._zod.optout === \"optional\" && final.value[i] === undefined) {\n            final.value.length = i;\n        }\n        else {\n            break;\n        }\n    }\n    return final;\n}\nexport const $ZodRecord = /*@__PURE__*/ core.$constructor(\"$ZodRecord\", (inst, def) => {\n    $ZodType.init(inst, def);\n    const memo = core.globalConfig.memoizer;\n    memo?.attach(inst);\n    inst._zod.parse = (payload, ctx) => {\n        const input = payload.value;\n        if (!util.isPlainObject(input)) {\n            payload.issues.push({\n                expected: \"record\",\n                code: \"invalid_type\",\n                input,\n                inst,\n            });\n            return payload;\n        }\n        const proms = [];\n        const values = def.keyType._zod.values;\n        if (values && !def.partial) {\n            payload.value = memo ? memo.alloc(inst, payload, {}, ctx) : {};\n            const recordKeys = new Set();\n            for (const key of values) {\n                if (typeof key === \"string\" || typeof key === \"number\" || typeof key === \"symbol\") {\n                    recordKeys.add(typeof key === \"number\" ? key.toString() : key);\n                    // A declared __proto__ is stripped but is not an unrecognized key.\n                    if (key === \"__proto__\")\n                        continue;\n                    const keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);\n                    if (keyResult instanceof Promise) {\n                        throw new Error(\"Async schemas not supported in object keys currently\");\n                    }\n                    if (keyResult.issues.length) {\n                        payload.issues.push({\n                            code: \"invalid_key\",\n                            origin: \"record\",\n                            issues: keyResult.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),\n                            input: key,\n                            path: [key],\n                            inst,\n                        });\n                        continue;\n                    }\n                    const outKey = keyResult.value;\n                    if (outKey === \"__proto__\")\n                        continue;\n                    const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx);\n                    if (result instanceof Promise) {\n                        proms.push(result.then((result) => {\n                            if (result.issues.length) {\n                                payload.issues.push(...util.prefixIssues(key, result.issues));\n                            }\n                            payload.value[outKey] = result.value;\n                        }));\n                    }\n                    else {\n                        if (result.issues.length) {\n                            payload.issues.push(...util.prefixIssues(key, result.issues));\n                        }\n                        payload.value[outKey] = result.value;\n                    }\n                }\n            }\n            let unrecognized;\n            for (const key in input) {\n                if (!recordKeys.has(key)) {\n                    if (def.mode === \"loose\") {\n                        // skip __proto__ so it can't replace the result prototype via the assignment setter on the plain {} we build into\n                        if (key === \"__proto__\")\n                            continue;\n                        payload.value[key] = input[key];\n                    }\n                    else {\n                        unrecognized = unrecognized ?? [];\n                        unrecognized.push(key);\n                    }\n                }\n            }\n            if (unrecognized && unrecognized.length > 0) {\n                payload.issues.push({\n                    code: \"unrecognized_keys\",\n                    input,\n                    inst,\n                    keys: unrecognized,\n                    continue: true,\n                });\n            }\n        }\n        else {\n            payload.value = memo ? memo.alloc(inst, payload, {}, ctx) : {};\n            // An enumerable key schema declares which keys the record owns, so a key outside the set is unrecognized. A non-enumerable one (regex, refine) is a constraint every key must satisfy, so a failing key is invalid. Only the former is reconcilable against the other side of an intersection.\n            let unrecognized;\n            // Reflect.ownKeys for Symbol-key support; filter non-enumerable to match z.object()\n            for (const key of Reflect.ownKeys(input)) {\n                if (key === \"__proto__\")\n                    continue;\n                if (!Object.prototype.propertyIsEnumerable.call(input, key))\n                    continue;\n                let keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);\n                if (keyResult instanceof Promise) {\n                    throw new Error(\"Async schemas not supported in object keys currently\");\n                }\n                // Numeric string fallback: if key is a numeric string and failed, retry with Number(key). This handles z.number(), z.literal([1, 2, 3]), and unions containing numeric literals\n                const checkNumericKey = typeof key === \"string\" && regexes.number.test(key) && keyResult.issues.length;\n                if (checkNumericKey) {\n                    const retryResult = def.keyType._zod.run({ value: Number(key), issues: [] }, ctx);\n                    if (retryResult instanceof Promise) {\n                        throw new Error(\"Async schemas not supported in object keys currently\");\n                    }\n                    if (retryResult.issues.length === 0) {\n                        keyResult = retryResult;\n                    }\n                }\n                if (keyResult.issues.length) {\n                    if (def.mode === \"loose\") {\n                        // Pass through unchanged\n                        payload.value[key] = input[key];\n                    }\n                    else if (values) {\n                        unrecognized = unrecognized ?? [];\n                        unrecognized.push(key);\n                    }\n                    else {\n                        // Default \"strict\" behavior: error on invalid key\n                        payload.issues.push({\n                            code: \"invalid_key\",\n                            origin: \"record\",\n                            issues: keyResult.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),\n                            input: key,\n                            path: [key],\n                            inst,\n                        });\n                    }\n                    continue;\n                }\n                // the guard above tests the raw input key, but the key schema can normalize an ordinary key into __proto__; re-check the key we actually write under\n                const outKey = keyResult.value;\n                if (outKey === \"__proto__\")\n                    continue;\n                const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx);\n                if (result instanceof Promise) {\n                    proms.push(result.then((result) => {\n                        if (result.issues.length) {\n                            payload.issues.push(...util.prefixIssues(key, result.issues));\n                        }\n                        payload.value[outKey] = result.value;\n                    }));\n                }\n                else {\n                    if (result.issues.length) {\n                        payload.issues.push(...util.prefixIssues(key, result.issues));\n                    }\n                    payload.value[outKey] = result.value;\n                }\n            }\n            if (unrecognized && unrecognized.length > 0) {\n                payload.issues.push({\n                    code: \"unrecognized_keys\",\n                    input,\n                    inst,\n                    keys: unrecognized,\n                    continue: true,\n                });\n            }\n        }\n        if (proms.length) {\n            return Promise.all(proms).then(() => payload);\n        }\n        return payload;\n    };\n});\nexport const $ZodMap = /*@__PURE__*/ core.$constructor(\"$ZodMap\", (inst, def) => {\n    $ZodType.init(inst, def);\n    const memo = core.globalConfig.memoizer;\n    memo?.attach(inst);\n    inst._zod.parse = (payload, ctx) => {\n        const input = payload.value;\n        if (!(input instanceof Map)) {\n            payload.issues.push({\n                expected: \"map\",\n                code: \"invalid_type\",\n                input,\n                inst,\n            });\n            return payload;\n        }\n        const proms = [];\n        payload.value = memo ? memo.alloc(inst, payload, new Map(), ctx) : new Map();\n        for (const [key, value] of input) {\n            const keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);\n            const valueResult = def.valueType._zod.run({ value: value, issues: [] }, ctx);\n            if (keyResult instanceof Promise || valueResult instanceof Promise) {\n                proms.push(Promise.all([keyResult, valueResult]).then(([keyResult, valueResult]) => {\n                    handleMapResult(keyResult, valueResult, payload, key, input, inst, ctx);\n                }));\n            }\n            else {\n                handleMapResult(keyResult, valueResult, payload, key, input, inst, ctx);\n            }\n        }\n        if (proms.length)\n            return Promise.all(proms).then(() => payload);\n        return payload;\n    };\n});\nfunction handleMapResult(keyResult, valueResult, final, key, input, inst, ctx) {\n    if (keyResult.issues.length) {\n        if (util.propertyKeyTypes.has(typeof key)) {\n            final.issues.push(...util.prefixIssues(key, keyResult.issues));\n        }\n        else {\n            final.issues.push({\n                code: \"invalid_key\",\n                origin: \"map\",\n                input,\n                inst,\n                issues: keyResult.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),\n            });\n        }\n    }\n    if (valueResult.issues.length) {\n        if (util.propertyKeyTypes.has(typeof key)) {\n            final.issues.push(...util.prefixIssues(key, valueResult.issues));\n        }\n        else {\n            final.issues.push({\n                origin: \"map\",\n                code: \"invalid_element\",\n                input,\n                inst,\n                key: key,\n                issues: valueResult.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),\n            });\n        }\n    }\n    final.value.set(keyResult.value, valueResult.value);\n}\nexport const $ZodSet = /*@__PURE__*/ core.$constructor(\"$ZodSet\", (inst, def) => {\n    $ZodType.init(inst, def);\n    const memo = core.globalConfig.memoizer;\n    memo?.attach(inst);\n    inst._zod.parse = (payload, ctx) => {\n        const input = payload.value;\n        if (!(input instanceof Set)) {\n            payload.issues.push({\n                input,\n                inst,\n                expected: \"set\",\n                code: \"invalid_type\",\n            });\n            return payload;\n        }\n        const proms = [];\n        payload.value = memo ? memo.alloc(inst, payload, new Set(), ctx) : new Set();\n        for (const item of input) {\n            const result = def.valueType._zod.run({ value: item, issues: [] }, ctx);\n            if (result instanceof Promise) {\n                proms.push(result.then((result) => handleSetResult(result, payload)));\n            }\n            else\n                handleSetResult(result, payload);\n        }\n        if (proms.length)\n            return Promise.all(proms).then(() => payload);\n        return payload;\n    };\n});\nfunction handleSetResult(result, final) {\n    if (result.issues.length) {\n        final.issues.push(...result.issues);\n    }\n    final.value.add(result.value);\n}\nexport const $ZodEnum = /*@__PURE__*/ core.$constructor(\"$ZodEnum\", (inst, def) => {\n    $ZodType.init(inst, def);\n    const values = util.getEnumValues(def.entries);\n    const valuesSet = new Set(values);\n    inst._zod.values = valuesSet;\n    const patternValues = values.filter((k) => util.propertyKeyTypes.has(typeof k));\n    // unmatchable fallback, RE2-safe: an empty alternation would compile to /^()$/, which matches \"\"\n    inst._zod.pattern = new RegExp(patternValues.length ? `^(${patternValues.map((o) => util.escapeRegex(o.toString())).join(\"|\")})$` : \"^[^\\\\s\\\\S]$\");\n    inst._zod.parse = (payload, _ctx) => {\n        const input = payload.value;\n        if (valuesSet.has(input)) {\n            return payload;\n        }\n        payload.issues.push({\n            code: \"invalid_value\",\n            values,\n            input,\n            inst,\n        });\n        return payload;\n    };\n});\nexport const $ZodLiteral = /*@__PURE__*/ core.$constructor(\"$ZodLiteral\", (inst, def) => {\n    $ZodType.init(inst, def);\n    const values = new Set(def.values);\n    inst._zod.values = values;\n    // unmatchable fallback, RE2-safe: an empty alternation would compile to /^()$/, which matches \"\"\n    inst._zod.pattern = new RegExp(def.values.length\n        ? `^(${def.values\n            .map((o) => (typeof o === \"string\" ? util.escapeRegex(o) : o ? util.escapeRegex(o.toString()) : String(o)))\n            .join(\"|\")})$`\n        : \"^[^\\\\s\\\\S]$\");\n    inst._zod.parse = (payload, _ctx) => {\n        const input = payload.value;\n        if (values.has(input)) {\n            return payload;\n        }\n        payload.issues.push({\n            code: \"invalid_value\",\n            values: def.values,\n            input,\n            inst,\n        });\n        return payload;\n    };\n});\nexport const $ZodFile = /*@__PURE__*/ core.$constructor(\"$ZodFile\", (inst, def) => {\n    $ZodType.init(inst, def);\n    inst._zod.parse = (payload, _ctx) => {\n        const input = payload.value;\n        // @ts-ignore\n        if (input instanceof File)\n            return payload;\n        payload.issues.push({\n            expected: \"file\",\n            code: \"invalid_type\",\n            input,\n            inst,\n        });\n        return payload;\n    };\n});\nexport const $ZodTransform = /*@__PURE__*/ core.$constructor(\"$ZodTransform\", (inst, def) => {\n    $ZodType.init(inst, def);\n    inst._zod.optin = \"optional\";\n    core.globalConfig.memoizer?.guard(inst);\n    inst._zod.parse = (payload, ctx) => {\n        if (ctx.direction === \"backward\") {\n            throw new core.$ZodEncodeError(inst.constructor.name);\n        }\n        const _out = def.transform(payload.value, payload);\n        if (ctx.async) {\n            const output = _out instanceof Promise ? _out : Promise.resolve(_out);\n            return output.then((output) => {\n                payload.value = output;\n                return payload;\n            });\n        }\n        if (_out instanceof Promise) {\n            throw new core.$ZodAsyncError();\n        }\n        payload.value = _out;\n        return payload;\n    };\n});\nfunction handleOptionalResult(payload, result) {\n    // A substituting schema that still failed has no usable answer; yield undefined. Its issues are simply dropped: it ran on a payload of its own, so there is no shared array to truncate and nothing of the caller's to lose with it.\n    payload.value = result.issues.length ? undefined : result.value;\n    return payload;\n}\nexport const $ZodOptional = /*@__PURE__*/ core.$constructor(\"$ZodOptional\", (inst, def) => {\n    $ZodType.init(inst, def);\n    // .optional() propagates absence rather than substituting for it, so a defaulted inner keeps its rung.\n    util.defineLazyInternal(inst, \"optin\", (zod) => zod.def.innerType._zod.optin === \"defaulted\" ? \"defaulted\" : \"optional\");\n    inst._zod.optout = \"optional\";\n    util.defineLazyInternal(inst, \"values\", (zod) => {\n        const values = zod.def.innerType._zod.values;\n        return values ? new Set([...values, undefined]) : undefined;\n    });\n    util.defineLazyInternal(inst, \"pattern\", (zod) => {\n        const pattern = zod.def.innerType._zod.pattern;\n        return pattern ? new RegExp(`^(${util.cleanRegex(pattern.source)})?$`) : undefined;\n    });\n    inst._zod.parse = (payload, ctx) => {\n        if (payload.value === undefined) {\n            // Only the top rung substitutes a value for absence; everything else leaves it intact, which is what .optional() means.\n            if (def.innerType._zod.optin !== \"defaulted\")\n                return payload;\n            // Its own payload, for the same reason $ZodCatch gets one: a pipe forwards an unrecognized key through the caller's issues array, and this must not read that as the substituting schema failing and drop it.\n            const result = def.innerType._zod.run({ value: payload.value, issues: [] }, ctx);\n            if (result instanceof Promise)\n                return result.then((result) => handleOptionalResult(payload, result));\n            return handleOptionalResult(payload, result);\n        }\n        return def.innerType._zod.run(payload, ctx);\n    };\n});\nexport const $ZodExactOptional = /*@__PURE__*/ core.$constructor(\"$ZodExactOptional\", (inst, def) => {\n    // Call parent init - inherits optin/optout = \"optional\"\n    $ZodOptional.init(inst, def);\n    // Override values/pattern to NOT add undefined\n    util.defineLazyInternal(inst, \"values\", (zod) => zod.def.innerType._zod.values);\n    util.defineLazyInternal(inst, \"pattern\", (zod) => zod.def.innerType._zod.pattern);\n    // Override parse to just delegate (no undefined handling)\n    inst._zod.parse = (payload, ctx) => {\n        return def.innerType._zod.run(payload, ctx);\n    };\n});\nexport const $ZodNullable = /*@__PURE__*/ core.$constructor(\"$ZodNullable\", (inst, def) => {\n    $ZodType.init(inst, def);\n    util.defineLazyInternal(inst, \"optin\", (zod) => zod.def.innerType._zod.optin);\n    util.defineLazyInternal(inst, \"optout\", (zod) => zod.def.innerType._zod.optout);\n    util.defineLazyInternal(inst, \"pattern\", (zod) => {\n        const pattern = zod.def.innerType._zod.pattern;\n        return pattern ? new RegExp(`^(${util.cleanRegex(pattern.source)}|null)$`) : undefined;\n    });\n    util.defineLazyInternal(inst, \"values\", (zod) => {\n        return zod.def.innerType._zod.values ? new Set([...zod.def.innerType._zod.values, null]) : undefined;\n    });\n    inst._zod.parse = (payload, ctx) => {\n        // Forward direction (decode): allow null to pass through\n        if (payload.value === null)\n            return payload;\n        return def.innerType._zod.run(payload, ctx);\n    };\n});\nexport const $ZodDefault = /*@__PURE__*/ core.$constructor(\"$ZodDefault\", (inst, def) => {\n    $ZodType.init(inst, def);\n    // inst._zod.qin = \"true\";\n    inst._zod.optin = \"defaulted\";\n    util.defineLazyInternal(inst, \"values\", (zod) => zod.def.innerType._zod.values);\n    inst._zod.parse = (payload, ctx) => {\n        if (ctx.direction === \"backward\") {\n            return def.innerType._zod.run(payload, ctx);\n        }\n        // Forward direction (decode): apply defaults for undefined input\n        if (payload.value === undefined) {\n            payload.value = def.defaultValue;\n            /**\n             * $ZodDefault returns the default value immediately in forward direction.\n             * It doesn't pass the default value into the validator (\"prefault\"). There's no reason to pass the default value through validation. The validity of the default is enforced by TypeScript statically. Otherwise, it's the responsibility of the user to ensure the default is valid. In the case of pipes with divergent in/out types, you can specify the default on the `in` schema of your ZodPipe to set a \"prefault\" for the pipe.   */\n            return payload;\n        }\n        // Forward direction: continue with default handling\n        const result = def.innerType._zod.run(payload, ctx);\n        if (result instanceof Promise) {\n            return result.then((result) => handleDefaultResult(result, def));\n        }\n        return handleDefaultResult(result, def);\n    };\n});\nfunction handleDefaultResult(payload, def) {\n    if (payload.value === undefined) {\n        payload.value = def.defaultValue;\n    }\n    return payload;\n}\nexport const $ZodPrefault = /*@__PURE__*/ core.$constructor(\"$ZodPrefault\", (inst, def) => {\n    $ZodType.init(inst, def);\n    inst._zod.optin = \"defaulted\";\n    util.defineLazyInternal(inst, \"values\", (zod) => zod.def.innerType._zod.values);\n    inst._zod.parse = (payload, ctx) => {\n        if (ctx.direction === \"backward\") {\n            return def.innerType._zod.run(payload, ctx);\n        }\n        // Forward direction (decode): apply prefault for undefined input\n        if (payload.value === undefined) {\n            payload.value = def.defaultValue;\n        }\n        return def.innerType._zod.run(payload, ctx);\n    };\n});\nexport const $ZodNonOptional = /*@__PURE__*/ core.$constructor(\"$ZodNonOptional\", (inst, def) => {\n    $ZodType.init(inst, def);\n    util.defineLazyInternal(inst, \"values\", (zod) => {\n        const v = zod.def.innerType._zod.values;\n        return v ? new Set([...v].filter((x) => x !== undefined)) : undefined;\n    });\n    inst._zod.parse = (payload, ctx) => {\n        const result = def.innerType._zod.run(payload, ctx);\n        if (result instanceof Promise) {\n            return result.then((result) => handleNonOptionalResult(result, inst));\n        }\n        return handleNonOptionalResult(result, inst);\n    };\n});\nfunction handleNonOptionalResult(payload, inst) {\n    if (!payload.issues.length && payload.value === undefined) {\n        payload.issues.push({\n            code: \"invalid_type\",\n            expected: \"nonoptional\",\n            input: payload.value,\n            inst,\n        });\n    }\n    return payload;\n}\nexport const $ZodSuccess = /*@__PURE__*/ core.$constructor(\"$ZodSuccess\", (inst, def) => {\n    $ZodType.init(inst, def);\n    inst._zod.parse = (payload, ctx) => {\n        if (ctx.direction === \"backward\") {\n            throw new core.$ZodEncodeError(\"ZodSuccess\");\n        }\n        const result = def.innerType._zod.run(payload, ctx);\n        if (result instanceof Promise) {\n            return result.then((result) => {\n                payload.value = result.issues.length === 0;\n                return payload;\n            });\n        }\n        payload.value = result.issues.length === 0;\n        return payload;\n    };\n});\nfunction handleCatchResult(payload, result, def, ctx) {\n    if (!result.issues.length) {\n        payload.value = result.value;\n        // The value carries up, so the flag describing it has to carry with it: a back-edge into a node still being parsed must not be frozen by an enclosing readonly, and its checks belong to the node itself. Guarded so the ordinary case adds no own property.\n        if (result.memo)\n            payload.memo = true;\n        return payload;\n    }\n    // Spread the inner's own payload, not ours: `value` has to stay the input the catch was handed, and the inner ran on a payload of its own so its issues are already private to this call.\n    payload.value = def.catchValue({\n        ...result,\n        value: payload.value,\n        error: {\n            issues: result.issues.map((iss) => util.finalizeIssue(iss, ctx, core.config())),\n        },\n        input: payload.value,\n    });\n    return payload;\n}\nexport const $ZodCatch = /*@__PURE__*/ core.$constructor(\"$ZodCatch\", (inst, def) => {\n    $ZodType.init(inst, def);\n    util.defineLazyInternal(inst, \"optin\", (zod) => zod.def.innerType._zod.optin === \"defaulted\" ? \"defaulted\" : \"optional\");\n    util.defineLazyInternal(inst, \"optout\", (zod) => zod.def.innerType._zod.optout);\n    util.defineLazyInternal(inst, \"values\", (zod) => zod.def.innerType._zod.values);\n    inst._zod.parse = (payload, ctx) => {\n        if (ctx.direction === \"backward\") {\n            return def.innerType._zod.run(payload, ctx);\n        }\n        // Forward direction (decode): apply catch logic\n        const result = def.innerType._zod.run({ value: payload.value, issues: [] }, ctx);\n        if (result instanceof Promise) {\n            return result.then((result) => handleCatchResult(payload, result, def, ctx));\n        }\n        return handleCatchResult(payload, result, def, ctx);\n    };\n});\nexport const $ZodNaN = /*@__PURE__*/ core.$constructor(\"$ZodNaN\", (inst, def) => {\n    $ZodType.init(inst, def);\n    inst._zod.parse = (payload, _ctx) => {\n        if (typeof payload.value !== \"number\" || !Number.isNaN(payload.value)) {\n            payload.issues.push({\n                input: payload.value,\n                inst,\n                expected: \"nan\",\n                code: \"invalid_type\",\n            });\n            return payload;\n        }\n        return payload;\n    };\n});\nexport const $ZodPipe = /*@__PURE__*/ core.$constructor(\"$ZodPipe\", (inst, def) => {\n    $ZodType.init(inst, def);\n    util.defineLazyInternal(inst, \"values\", (zod) => zod.def.in._zod.values);\n    util.defineLazyInternal(inst, \"optin\", (zod) => zod.def.in._zod.optin);\n    util.defineLazyInternal(inst, \"optout\", (zod) => zod.def.out._zod.optout);\n    util.defineLazyInternal(inst, \"propValues\", (zod) => zod.def.in._zod.propValues);\n    inst._zod.parse = (payload, ctx) => {\n        if (ctx.direction === \"backward\") {\n            const right = def.out._zod.run(payload, ctx);\n            if (right instanceof Promise) {\n                return right.then((right) => handlePipeResult(right, def.in, ctx));\n            }\n            return handlePipeResult(right, def.in, ctx);\n        }\n        const left = def.in._zod.run(payload, ctx);\n        if (left instanceof Promise) {\n            return left.then((left) => handlePipeResult(left, def.out, ctx));\n        }\n        return handlePipeResult(left, def.out, ctx);\n    };\n});\nfunction handlePipeResult(left, next, ctx) {\n    // Any issue stops the pipe, so a failing refinement never feeds its transform. An unrecognized key is the exception: it describes the input's extra properties, not the value being piped, and an enclosing intersection may yet reconcile it.\n    if (left.issues.some((iss) => iss.code !== \"unrecognized_keys\")) {\n        // prevent further checks\n        left.aborted = true;\n        return left;\n    }\n    return next._zod.run({ value: left.value, issues: left.issues }, ctx);\n}\nexport const $ZodCodec = /*@__PURE__*/ core.$constructor(\"$ZodCodec\", (inst, def) => {\n    $ZodType.init(inst, def);\n    util.defineLazyInternal(inst, \"values\", (zod) => zod.def.in._zod.values);\n    util.defineLazyInternal(inst, \"optin\", (zod) => zod.def.in._zod.optin);\n    util.defineLazyInternal(inst, \"optout\", (zod) => zod.def.out._zod.optout);\n    util.defineLazyInternal(inst, \"propValues\", (zod) => zod.def.in._zod.propValues);\n    inst._zod.parse = (payload, ctx) => {\n        const direction = ctx.direction || \"forward\";\n        if (direction === \"forward\") {\n            const left = def.in._zod.run(payload, ctx);\n            if (left instanceof Promise) {\n                return left.then((left) => handleCodecAResult(left, def, ctx));\n            }\n            return handleCodecAResult(left, def, ctx);\n        }\n        else {\n            const right = def.out._zod.run(payload, ctx);\n            if (right instanceof Promise) {\n                return right.then((right) => handleCodecAResult(right, def, ctx));\n            }\n            return handleCodecAResult(right, def, ctx);\n        }\n    };\n});\nfunction handleCodecAResult(result, def, ctx) {\n    if (result.issues.length) {\n        // prevent further checks\n        result.aborted = true;\n        return result;\n    }\n    const direction = ctx.direction || \"forward\";\n    if (direction === \"forward\") {\n        const transformed = def.transform(result.value, result);\n        if (transformed instanceof Promise) {\n            return transformed.then((value) => handleCodecTxResult(result, value, def.out, ctx));\n        }\n        return handleCodecTxResult(result, transformed, def.out, ctx);\n    }\n    else {\n        const transformed = def.reverseTransform(result.value, result);\n        if (transformed instanceof Promise) {\n            return transformed.then((value) => handleCodecTxResult(result, value, def.in, ctx));\n        }\n        return handleCodecTxResult(result, transformed, def.in, ctx);\n    }\n}\nfunction handleCodecTxResult(left, value, nextSchema, ctx) {\n    // Check if transform added any issues\n    if (left.issues.length) {\n        left.aborted = true;\n        return left;\n    }\n    return nextSchema._zod.run({ value, issues: left.issues }, ctx);\n}\nexport const $ZodPreprocess = /*@__PURE__*/ core.$constructor(\"$ZodPreprocess\", (inst, def) => {\n    $ZodPipe.init(inst, def);\n});\nexport const $ZodReadonly = /*@__PURE__*/ core.$constructor(\"$ZodReadonly\", (inst, def) => {\n    $ZodType.init(inst, def);\n    util.defineLazyInternal(inst, \"propValues\", (zod) => zod.def.innerType._zod.propValues);\n    util.defineLazyInternal(inst, \"values\", (zod) => zod.def.innerType._zod.values);\n    util.defineLazyInternal(inst, \"optin\", (zod) => zod.def.innerType?._zod?.optin);\n    util.defineLazyInternal(inst, \"optout\", (zod) => zod.def.innerType?._zod?.optout);\n    inst._zod.parse = (payload, ctx) => {\n        if (ctx.direction === \"backward\") {\n            return def.innerType._zod.run(payload, ctx);\n        }\n        const result = def.innerType._zod.run(payload, ctx);\n        if (result instanceof Promise) {\n            return result.then(handleReadonlyResult);\n        }\n        return handleReadonlyResult(result);\n    };\n});\nfunction handleReadonlyResult(payload) {\n    // A repeat visit hands back a node that is still being built; freezing it here would make the rest of its keys fail to assign.\n    if (!payload.memo)\n        payload.value = Object.freeze(payload.value);\n    return payload;\n}\nexport const $ZodTemplateLiteral = /*@__PURE__*/ core.$constructor(\"$ZodTemplateLiteral\", (inst, def) => {\n    $ZodType.init(inst, def);\n    const regexParts = [];\n    for (const part of def.parts) {\n        if (typeof part === \"object\" && part !== null) {\n            // is Zod schema\n            if (!part._zod.pattern) {\n                // if (!source)\n                throw new Error(`Invalid template literal part, no pattern found: ${[...part._zod.traits].shift()}`);\n            }\n            const source = part._zod.pattern instanceof RegExp ? part._zod.pattern.source : part._zod.pattern;\n            if (!source)\n                throw new Error(`Invalid template literal part: ${part._zod.traits}`);\n            const start = source.startsWith(\"^\") ? 1 : 0;\n            const end = source.endsWith(\"$\") ? source.length - 1 : source.length;\n            regexParts.push(source.slice(start, end));\n        }\n        else if (part === null || util.primitiveTypes.has(typeof part)) {\n            regexParts.push(util.escapeRegex(`${part}`));\n        }\n        else {\n            throw new Error(`Invalid template literal part: ${part}`);\n        }\n    }\n    inst._zod.pattern = new RegExp(`^${regexParts.join(\"\")}$`);\n    inst._zod.parse = (payload, _ctx) => {\n        if (typeof payload.value !== \"string\") {\n            payload.issues.push({\n                input: payload.value,\n                inst,\n                expected: \"string\",\n                code: \"invalid_type\",\n            });\n            return payload;\n        }\n        inst._zod.pattern.lastIndex = 0;\n        if (!inst._zod.pattern.test(payload.value)) {\n            payload.issues.push({\n                input: payload.value,\n                inst,\n                code: \"invalid_format\",\n                format: def.format ?? \"template_literal\",\n                pattern: inst._zod.pattern.source,\n            });\n            return payload;\n        }\n        return payload;\n    };\n});\nexport const $ZodFunction = /*@__PURE__*/ core.$constructor(\"$ZodFunction\", (inst, def) => {\n    $ZodType.init(inst, def);\n    // Defined, not assigned: the classic prototype exposes `_def` as a getter with no setter.\n    Object.defineProperty(inst, \"_def\", { value: def });\n    inst._zod.def = def;\n    inst.implement = (func) => {\n        if (typeof func !== \"function\") {\n            throw new Error(\"implement() must be called with a function\");\n        }\n        // Defined inline so the closure stays anonymous: binding it to a `const` first names it, which costs 256 bytes per implemented function.\n        return Object.defineProperty(function (...args) {\n            const parsedArgs = inst._def.input ? parse(inst._def.input, args) : args;\n            const result = Reflect.apply(func, this, parsedArgs);\n            if (inst._def.output) {\n                return parse(inst._def.output, result);\n            }\n            return result;\n        }, \"_zod\", { value: inst._zod, enumerable: false });\n    };\n    inst.implementAsync = (func) => {\n        if (typeof func !== \"function\") {\n            throw new Error(\"implementAsync() must be called with a function\");\n        }\n        return Object.defineProperty(async function (...args) {\n            const parsedArgs = inst._def.input ? await parseAsync(inst._def.input, args) : args;\n            const result = await Reflect.apply(func, this, parsedArgs);\n            if (inst._def.output) {\n                return await parseAsync(inst._def.output, result);\n            }\n            return result;\n        }, \"_zod\", { value: inst._zod, enumerable: false });\n    };\n    inst._zod.parse = (payload, _ctx) => {\n        if (typeof payload.value !== \"function\") {\n            payload.issues.push({\n                code: \"invalid_type\",\n                expected: \"function\",\n                input: payload.value,\n                inst,\n            });\n            return payload;\n        }\n        // Check if output is a promise type to determine if we should use async implementation\n        const hasPromiseOutput = inst._def.output && inst._def.output._zod.def.type === \"promise\";\n        if (hasPromiseOutput) {\n            payload.value = inst.implementAsync(payload.value);\n        }\n        else {\n            payload.value = inst.implement(payload.value);\n        }\n        return payload;\n    };\n    inst.input = (...args) => {\n        const F = inst.constructor;\n        if (Array.isArray(args[0])) {\n            return new F({\n                type: \"function\",\n                input: new $ZodTuple({\n                    type: \"tuple\",\n                    items: args[0],\n                    rest: args[1],\n                }),\n                output: inst._def.output,\n            });\n        }\n        return new F({\n            type: \"function\",\n            input: args[0],\n            output: inst._def.output,\n        });\n    };\n    inst.output = (output) => {\n        const F = inst.constructor;\n        return new F({\n            type: \"function\",\n            input: inst._def.input,\n            output,\n        });\n    };\n    return inst;\n});\nexport const $ZodPromise = /*@__PURE__*/ core.$constructor(\"$ZodPromise\", (inst, def) => {\n    $ZodType.init(inst, def);\n    inst._zod.parse = (payload, ctx) => {\n        return Promise.resolve(payload.value).then((inner) => def.innerType._zod.run({ value: inner, issues: [] }, ctx));\n    };\n});\nexport const $ZodLazy = /*@__PURE__*/ core.$constructor(\"$ZodLazy\", (inst, def) => {\n    $ZodType.init(inst, def);\n    // Cache the resolved inner type on the shared `def` so all clones of this lazy (e.g. via `.describe()`/`.meta()`) share the same inner instance, preserving identity for cycle detection on recursive schemas.\n    util.defineLazy(inst._zod, \"innerType\", () => {\n        const d = def;\n        if (!d._cachedInner)\n            d._cachedInner = def.getter();\n        return d._cachedInner;\n    });\n    util.defineLazyInternal(inst, \"pattern\", (zod) => zod.innerType?._zod?.pattern);\n    util.defineLazyInternal(inst, \"propValues\", (zod) => zod.innerType?._zod?.propValues);\n    util.defineLazyInternal(inst, \"optin\", (zod) => zod.innerType?._zod?.optin ?? undefined);\n    util.defineLazyInternal(inst, \"optout\", (zod) => zod.innerType?._zod?.optout ?? undefined);\n    inst._zod.parse = (payload, ctx) => {\n        const inner = inst._zod.innerType;\n        return inner._zod.run(payload, ctx);\n    };\n});\nexport const $ZodCustom = /*@__PURE__*/ core.$constructor(\"$ZodCustom\", (inst, def) => {\n    checks.$ZodCheck.init(inst, def);\n    $ZodType.init(inst, def);\n    inst._zod.parse = (payload, _) => {\n        return payload;\n    };\n    inst._zod.check = (payload) => {\n        const input = payload.value;\n        const r = def.fn(input);\n        if (r instanceof Promise) {\n            return r.then((r) => handleRefineResult(r, payload, input, inst));\n        }\n        handleRefineResult(r, payload, input, inst);\n        return;\n    };\n});\nfunction handleRefineResult(result, payload, input, inst) {\n    if (!result) {\n        const _iss = {\n            code: \"custom\",\n            input,\n            inst, // incorporates params.error into issue reporting\n            path: [...(inst._zod.def.path ?? [])], // incorporates params.error into issue reporting\n            continue: !inst._zod.def.abort,\n            // params: inst._zod.def.params,\n        };\n        if (inst._zod.def.params)\n            _iss.params = inst._zod.def.params;\n        payload.issues.push(util.issue(_iss));\n    }\n}\n","export class $ZodCyclicError extends Error {\n    constructor() {\n        super(`Cannot parse a reference cycle that closes through a transform`);\n        this.name = \"ZodCyclicError\";\n    }\n}\n/** Keyed off the context object every schema in one parse call already shares. */\nconst STATE = \"~memo\";\nconst NO_ISSUES = [];\n// Receivers prefix paths in place, so the cache and every hand-out need their own copies.\nfunction cloneIssues(issues) {\n    return issues.map((iss) => (iss.path ? { ...iss, path: iss.path.slice() } : { ...iss }));\n}\nconst recursive = /*@__PURE__*/ new WeakMap();\n/** Whether this schema's subtree contains a cycle, so one parse can re-enter it. */\nfunction isRecursive(inst, stack) {\n    const cached = recursive.get(inst);\n    if (cached !== undefined)\n        return cached;\n    // Relative to the walk in progress, so not cached.\n    if (stack.has(inst))\n        return true;\n    stack.add(inst);\n    let result = false;\n    const check = (child) => {\n        if (!result && child?._zod && isRecursive(child, stack))\n            result = true;\n    };\n    const def = inst._zod.def;\n    const kind = def.type;\n    switch (kind) {\n        case \"object\": {\n            // `Reflect.ownKeys` rather than `Object.keys`, so a cycle through a declared symbol key is still seen\n            for (const key of Reflect.ownKeys(def.shape))\n                check(def.shape[key]);\n            check(def.catchall);\n            break;\n        }\n        case \"array\":\n            check(def.element);\n            break;\n        case \"tuple\":\n            for (const el of def.items)\n                check(el);\n            check(def.rest);\n            break;\n        case \"record\":\n        case \"map\":\n            check(def.keyType);\n            check(def.valueType);\n            break;\n        case \"set\":\n            check(def.valueType);\n            break;\n        case \"union\":\n            for (const el of def.options)\n                check(el);\n            break;\n        case \"intersection\":\n            check(def.left);\n            check(def.right);\n            break;\n        case \"optional\":\n        case \"nullable\":\n        case \"default\":\n        case \"prefault\":\n        case \"catch\":\n        case \"readonly\":\n        case \"nonoptional\":\n        case \"promise\":\n        case \"success\":\n            check(def.innerType);\n            break;\n        case \"pipe\":\n            check(def.in);\n            check(def.out);\n            break;\n        case \"function\":\n            check(def.input);\n            check(def.output);\n            break;\n        // reading `_zod.innerType` resolves the getter once and caches it\n        case \"lazy\":\n            check(inst._zod.innerType);\n            break;\n        // a leaf by choice: `parts` are regex fragments, not data positions\n        case \"template_literal\":\n        // leaves\n        case \"string\":\n        case \"number\":\n        case \"int\":\n        case \"boolean\":\n        case \"bigint\":\n        case \"symbol\":\n        case \"undefined\":\n        case \"null\":\n        case \"void\":\n        case \"never\":\n        case \"any\":\n        case \"unknown\":\n        case \"date\":\n        case \"nan\":\n        case \"enum\":\n        case \"literal\":\n        case \"file\":\n        case \"transform\":\n        case \"custom\":\n            break;\n        default: {\n            // a new built-in kind becomes a compile error here\n            kind;\n            // a user-defined kind can still hold children, and only its author knows where, so fall back to scanning the def — skipping accessors, since reading one can run user code\n            for (const key in def) {\n                const desc = Object.getOwnPropertyDescriptor(def, key);\n                if (!desc || desc.get)\n                    continue;\n                const value = desc.value;\n                if (!value || typeof value !== \"object\")\n                    continue;\n                if (value._zod)\n                    check(value);\n                else if (Array.isArray(value))\n                    for (const el of value)\n                        check(el);\n            }\n        }\n    }\n    stack.delete(inst);\n    recursive.set(inst, result);\n    return result;\n}\n/**\n * Whether one parse can re-enter this schema, i.e. its subtree contains a cycle.\n * Exported for `z.compile`, which refuses to compile such a schema: cycle\n * breaking is driven from here off state keyed on the parse context, and a\n * generated fast path has no context to key on.\n */\nexport function isRecursiveSchema(inst) {\n    return isRecursive(inst, new Set());\n}\nfunction bucketFor(state, inst) {\n    let bucket = state.buckets.get(inst);\n    if (!bucket) {\n        bucket = new Map();\n        state.buckets.set(inst, bucket);\n    }\n    return bucket;\n}\n// Set immediately before delegating to core and cleared immediately after, so `alloc` registers only for a visit this module is driving.\nlet handoff;\n// Allocated but unfinished entries. `alloc` and the matching pop both happen in the synchronous part of a parse, so they nest even when children are async, and one stack serves every schema.\nconst open = [];\nconst memo = {\n    alloc(_inst, payload, empty) {\n        const bucket = handoff;\n        if (!bucket)\n            return empty;\n        handoff = undefined;\n        const entry = { value: empty, issues: null };\n        bucket.set(payload.value, entry);\n        open.push(entry);\n        return empty;\n    },\n    guard(inst) {\n        var _a;\n        (_a = inst._zod).deferred ?? (_a.deferred = []);\n        inst._zod.deferred.push(() => {\n            const base = inst._zod.parse;\n            const wrapped = (payload, ctx) => {\n                // The value is a placeholder a back-edge is still waiting on, so the cycle closes through this transform. Its output can't exist in time to bind.\n                if (ctx.direction !== \"backward\" && isBackEdge(ctx, payload.value))\n                    throw new $ZodCyclicError();\n                return base(payload, ctx);\n            };\n            inst._zod.parse = wrapped;\n            if (inst._zod.run === base)\n                inst._zod.run = wrapped;\n        });\n    },\n    attach(inst) {\n        var _a;\n        let isRecursiveInst;\n        // `bucket` memoized for one parse; a recursive schema is re-entered many times and its bucket never changes\n        let lastCtx;\n        let lastBucket;\n        // Wraps `parse` in a deferred so it sees the container's final parse. Core's own deferred copies `parse` into `run` when there are no checks, and it ran first, so `run` is patched to match; with checks, `run` reads `parse` dynamically.\n        (_a = inst._zod).deferred ?? (_a.deferred = []);\n        inst._zod.deferred.push(() => {\n            const base = inst._zod.parse;\n            const wrapped = (payload, ctx) => {\n                if (isRecursiveInst === undefined) {\n                    isRecursiveInst = isRecursive(inst, new Set());\n                    if (!isRecursiveInst) {\n                        // Nothing here can ever fire, so take it back out.\n                        inst._zod.parse = base;\n                        if (inst._zod.run === wrapped)\n                            inst._zod.run = base;\n                        return base(payload, ctx);\n                    }\n                }\n                const input = payload.value;\n                if (input === null || typeof input !== \"object\")\n                    return base(payload, ctx);\n                let state = ctx[STATE];\n                if (!state) {\n                    state = { buckets: new Map(), backEdges: undefined };\n                    ctx[STATE] = state;\n                }\n                let bucket;\n                if (lastCtx === ctx) {\n                    bucket = lastBucket;\n                }\n                else {\n                    bucket = bucketFor(state, inst);\n                    lastCtx = ctx;\n                    lastBucket = bucket;\n                }\n                const hit = bucket.get(input);\n                if (hit) {\n                    payload.value = hit.value;\n                    if (hit.issues) {\n                        if (hit.issues.length)\n                            payload.issues.push(...cloneIssues(hit.issues));\n                    }\n                    else {\n                        // Still being parsed: its own checks cover it, so skip them here.\n                        payload.memo = true;\n                        state.backEdges ?? (state.backEdges = new Set());\n                        state.backEdges.add(hit.value);\n                    }\n                    return payload;\n                }\n                handoff = bucket;\n                const depth = open.length;\n                const result = base(payload, ctx);\n                handoff = undefined;\n                // A container that rejected its input outright allocated nothing.\n                const entry = open.length > depth ? open.pop() : undefined;\n                // Both paths written out so the sync one allocates no closure. It runs once per node, and capturing here cost more than everything else combined.\n                if (result instanceof Promise) {\n                    return result.then((r) => {\n                        if (entry)\n                            entry.issues = r.issues.length ? cloneIssues(r.issues) : NO_ISSUES;\n                        return r;\n                    });\n                }\n                if (entry)\n                    entry.issues = result.issues.length ? cloneIssues(result.issues) : NO_ISSUES;\n                return result;\n            };\n            inst._zod.parse = wrapped;\n            if (inst._zod.run === base)\n                inst._zod.run = wrapped;\n        });\n    },\n};\n/** The memoizer that gives containers cycle support. `zod` installs it by default; `zod/mini` opts in with `config({ memoizer: memoizer() })`. */\nexport function memoizer() {\n    return memo;\n}\n/** Whether this value is a node a back-edge resolved to before it finished. */\nexport function isBackEdge(ctx, value) {\n    const backEdges = ctx[STATE]?.backEdges;\n    return backEdges !== undefined && value !== null && typeof value === \"object\" && backEdges.has(value);\n}\n","import * as util from \"../core/util.js\";\nconst error = () => {\n    const Sizable = {\n        string: { unit: \"characters\", verb: \"to have\" },\n        file: { unit: \"bytes\", verb: \"to have\" },\n        array: { unit: \"items\", verb: \"to have\" },\n        set: { unit: \"items\", verb: \"to have\" },\n        map: { unit: \"entries\", verb: \"to have\" },\n    };\n    function getSizing(origin) {\n        return Sizable[origin] ?? null;\n    }\n    const FormatDictionary = {\n        regex: \"input\",\n        email: \"email address\",\n        url: \"URL\",\n        emoji: \"emoji\",\n        uuid: \"UUID\",\n        uuidv4: \"UUIDv4\",\n        uuidv6: \"UUIDv6\",\n        nanoid: \"nanoid\",\n        guid: \"GUID\",\n        cuid: \"cuid\",\n        cuid2: \"cuid2\",\n        ulid: \"ULID\",\n        xid: \"XID\",\n        ksuid: \"KSUID\",\n        datetime: \"ISO datetime\",\n        date: \"ISO date\",\n        time: \"ISO time\",\n        duration: \"ISO duration\",\n        ipv4: \"IPv4 address\",\n        ipv6: \"IPv6 address\",\n        mac: \"MAC address\",\n        cidrv4: \"IPv4 range\",\n        cidrv6: \"IPv6 range\",\n        base64: \"base64-encoded string\",\n        base64url: \"base64url-encoded string\",\n        json_string: \"JSON string\",\n        e164: \"E.164 number\",\n        credit_card: \"credit card number\",\n        jwt: \"JWT\",\n        template_literal: \"input\",\n    };\n    // type names: missing keys = do not translate (use raw value via ?? fallback)\n    const TypeDictionary = {\n        // Compatibility: \"nan\" -> \"NaN\" for display\n        nan: \"NaN\",\n        // All other type names omitted - they fall back to raw values via ?? operator\n    };\n    function getTypeName(type, input) {\n        if (type === \"number\" && typeof input === \"number\" && !Number.isFinite(input)) {\n            return String(input);\n        }\n        return TypeDictionary[type] ?? type;\n    }\n    return (issue) => {\n        switch (issue.code) {\n            case \"invalid_type\": {\n                const expected = getTypeName(issue.expected);\n                const receivedType = util.parsedType(issue.input);\n                const received = getTypeName(receivedType, issue.input);\n                return `Invalid input: expected ${expected}, received ${received}`;\n            }\n            case \"invalid_value\":\n                if (issue.values.length === 1)\n                    return `Invalid input: expected ${util.stringifyPrimitive(issue.values[0])}`;\n                return `Invalid option: expected one of ${util.joinValues(issue.values, \"|\")}`;\n            case \"too_big\": {\n                const adj = issue.exact ? \"exactly \" : issue.inclusive ? \"<=\" : \"<\";\n                const sizing = getSizing(issue.origin);\n                if (sizing)\n                    return `Too big: expected ${issue.origin ?? \"value\"} to have ${adj}${issue.maximum.toString()} ${sizing.unit ?? \"elements\"}`;\n                return `Too big: expected ${issue.origin ?? \"value\"} to be ${adj}${issue.maximum.toString()}`;\n            }\n            case \"too_small\": {\n                const adj = issue.exact ? \"exactly \" : issue.inclusive ? \">=\" : \">\";\n                const sizing = getSizing(issue.origin);\n                if (sizing) {\n                    return `Too small: expected ${issue.origin} to have ${adj}${issue.minimum.toString()} ${sizing.unit}`;\n                }\n                return `Too small: expected ${issue.origin} to be ${adj}${issue.minimum.toString()}`;\n            }\n            case \"invalid_format\": {\n                const _issue = issue;\n                if (_issue.format === \"starts_with\") {\n                    return `Invalid string: must start with \"${_issue.prefix}\"`;\n                }\n                if (_issue.format === \"ends_with\")\n                    return `Invalid string: must end with \"${_issue.suffix}\"`;\n                if (_issue.format === \"includes\")\n                    return `Invalid string: must include \"${_issue.includes}\"`;\n                if (_issue.format === \"regex\")\n                    return `Invalid string: must match pattern ${_issue.pattern}`;\n                return `Invalid ${FormatDictionary[_issue.format] ?? issue.format}`;\n            }\n            case \"not_multiple_of\":\n                return `Invalid number: must be a multiple of ${issue.divisor}`;\n            case \"unrecognized_keys\":\n                return `Unrecognized key${issue.keys.length > 1 ? \"s\" : \"\"}: ${util.joinValues(issue.keys, \", \")}`;\n            case \"invalid_key\":\n                return `Invalid key in ${issue.origin}`;\n            case \"invalid_union\":\n                if (issue.options && Array.isArray(issue.options) && issue.options.length > 0) {\n                    const opts = issue.options.map((o) => `'${o}'`).join(\" | \");\n                    return `Invalid discriminator value. Expected ${opts}`;\n                }\n                if (issue.inclusive === false) {\n                    return \"Invalid input: more than one option matched\";\n                }\n                return \"Invalid input\";\n            case \"invalid_element\":\n                return `Invalid value in ${issue.origin}`;\n            default:\n                return `Invalid input`;\n        }\n    };\n};\nexport default function () {\n    return {\n        localeError: error(),\n    };\n}\n","var _a;\nexport const $output = /*@__PURE__*/ Symbol(\"ZodOutput\");\nexport const $input = /*@__PURE__*/ Symbol(\"ZodInput\");\nexport class $ZodRegistry {\n    constructor() {\n        this._map = new WeakMap();\n        this._idmap = new Map();\n    }\n    add(schema, ..._meta) {\n        const meta = _meta[0];\n        this._map.set(schema, meta);\n        if (meta && typeof meta === \"object\" && \"id\" in meta) {\n            this._idmap.set(meta.id, schema);\n        }\n        return this;\n    }\n    clear() {\n        this._map = new WeakMap();\n        this._idmap = new Map();\n        return this;\n    }\n    remove(schema) {\n        const meta = this._map.get(schema);\n        if (meta && typeof meta === \"object\" && \"id\" in meta) {\n            this._idmap.delete(meta.id);\n        }\n        this._map.delete(schema);\n        return this;\n    }\n    get(schema) {\n        // return this._map.get(schema) as any;\n        // inherit metadata\n        const p = schema._zod.parent;\n        if (p) {\n            const pm = { ...(this.get(p) ?? {}) };\n            delete pm.id; // do not inherit id\n            const f = { ...pm, ...this._map.get(schema) };\n            return Object.keys(f).length ? f : undefined;\n        }\n        return this._map.get(schema);\n    }\n    has(schema) {\n        return this._map.has(schema);\n    }\n}\n// registries\nexport function registry() {\n    return new $ZodRegistry();\n}\n(_a = globalThis).__zod_globalRegistry ?? (_a.__zod_globalRegistry = registry());\nexport const globalRegistry = globalThis.__zod_globalRegistry;\n","import * as checks from \"./checks.js\";\nimport * as registries from \"./registries.js\";\nimport * as schemas from \"./schemas.js\";\nimport * as util from \"./util.js\";\n// @__NO_SIDE_EFFECTS__\nexport function _string(Class, params) {\n    return new Class({\n        type: \"string\",\n        ...util.normalizeParams(params),\n    });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _coercedString(Class, params) {\n    return new Class({\n        type: \"string\",\n        coerce: true,\n        ...util.normalizeParams(params),\n    });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _email(Class, params) {\n    return new Class({\n        type: \"string\",\n        format: \"email\",\n        check: \"string_format\",\n        abort: false,\n        ...util.normalizeParams(params),\n    });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _guid(Class, params) {\n    return new Class({\n        type: \"string\",\n        format: \"guid\",\n        check: \"string_format\",\n        abort: false,\n        ...util.normalizeParams(params),\n    });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _uuid(Class, params) {\n    return new Class({\n        type: \"string\",\n        format: \"uuid\",\n        check: \"string_format\",\n        abort: false,\n        ...util.normalizeParams(params),\n    });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _uuidv4(Class, params) {\n    return new Class({\n        type: \"string\",\n        format: \"uuid\",\n        check: \"string_format\",\n        abort: false,\n        version: \"v4\",\n        ...util.normalizeParams(params),\n    });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _uuidv6(Class, params) {\n    return new Class({\n        type: \"string\",\n        format: \"uuid\",\n        check: \"string_format\",\n        abort: false,\n        version: \"v6\",\n        ...util.normalizeParams(params),\n    });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _uuidv7(Class, params) {\n    return new Class({\n        type: \"string\",\n        format: \"uuid\",\n        check: \"string_format\",\n        abort: false,\n        version: \"v7\",\n        ...util.normalizeParams(params),\n    });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _url(Class, params) {\n    return new Class({\n        type: \"string\",\n        format: \"url\",\n        check: \"string_format\",\n        abort: false,\n        ...util.normalizeParams(params),\n    });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _emoji(Class, params) {\n    return new Class({\n        type: \"string\",\n        format: \"emoji\",\n        check: \"string_format\",\n        abort: false,\n        ...util.normalizeParams(params),\n    });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _nanoid(Class, params) {\n    return new Class({\n        type: \"string\",\n        format: \"nanoid\",\n        check: \"string_format\",\n        abort: false,\n        ...util.normalizeParams(params),\n    });\n}\n/**\n * @deprecated CUID v1 is deprecated by its authors due to information leakage\n * (timestamps embedded in the id). Use {@link _cuid2} instead.\n * See https://github.com/paralleldrive/cuid.\n */\n// @__NO_SIDE_EFFECTS__\nexport function _cuid(Class, params) {\n    return new Class({\n        type: \"string\",\n        format: \"cuid\",\n        check: \"string_format\",\n        abort: false,\n        ...util.normalizeParams(params),\n    });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _cuid2(Class, params) {\n    return new Class({\n        type: \"string\",\n        format: \"cuid2\",\n        check: \"string_format\",\n        abort: false,\n        ...util.normalizeParams(params),\n    });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _ulid(Class, params) {\n    return new Class({\n        type: \"string\",\n        format: \"ulid\",\n        check: \"string_format\",\n        abort: false,\n        ...util.normalizeParams(params),\n    });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _xid(Class, params) {\n    return new Class({\n        type: \"string\",\n        format: \"xid\",\n        check: \"string_format\",\n        abort: false,\n        ...util.normalizeParams(params),\n    });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _ksuid(Class, params) {\n    return new Class({\n        type: \"string\",\n        format: \"ksuid\",\n        check: \"string_format\",\n        abort: false,\n        ...util.normalizeParams(params),\n    });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _ipv4(Class, params) {\n    return new Class({\n        type: \"string\",\n        format: \"ipv4\",\n        check: \"string_format\",\n        abort: false,\n        ...util.normalizeParams(params),\n    });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _ipv6(Class, params) {\n    return new Class({\n        type: \"string\",\n        format: \"ipv6\",\n        check: \"string_format\",\n        abort: false,\n        ...util.normalizeParams(params),\n    });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _mac(Class, params) {\n    return new Class({\n        type: \"string\",\n        format: \"mac\",\n        check: \"string_format\",\n        abort: false,\n        ...util.normalizeParams(params),\n    });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _cidrv4(Class, params) {\n    return new Class({\n        type: \"string\",\n        format: \"cidrv4\",\n        check: \"string_format\",\n        abort: false,\n        ...util.normalizeParams(params),\n    });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _cidrv6(Class, params) {\n    return new Class({\n        type: \"string\",\n        format: \"cidrv6\",\n        check: \"string_format\",\n        abort: false,\n        ...util.normalizeParams(params),\n    });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _base64(Class, params) {\n    return new Class({\n        type: \"string\",\n        format: \"base64\",\n        check: \"string_format\",\n        abort: false,\n        ...util.normalizeParams(params),\n    });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _base64url(Class, params) {\n    return new Class({\n        type: \"string\",\n        format: \"base64url\",\n        check: \"string_format\",\n        abort: false,\n        ...util.normalizeParams(params),\n    });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _e164(Class, params) {\n    return new Class({\n        type: \"string\",\n        format: \"e164\",\n        check: \"string_format\",\n        abort: false,\n        ...util.normalizeParams(params),\n    });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _creditCard(Class, params) {\n    return new Class({\n        type: \"string\",\n        format: \"credit_card\",\n        check: \"string_format\",\n        abort: false,\n        ...util.normalizeParams(params),\n    });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _jwt(Class, params) {\n    return new Class({\n        type: \"string\",\n        format: \"jwt\",\n        check: \"string_format\",\n        abort: false,\n        ...util.normalizeParams(params),\n    });\n}\nexport const TimePrecision = {\n    Any: null,\n    Minute: -1,\n    Second: 0,\n    Millisecond: 3,\n    Microsecond: 6,\n};\n// @__NO_SIDE_EFFECTS__\nexport function _isoDateTime(Class, params) {\n    return new Class({\n        type: \"string\",\n        format: \"datetime\",\n        check: \"string_format\",\n        offset: false,\n        local: false,\n        precision: null,\n        ...util.normalizeParams(params),\n    });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _isoDate(Class, params) {\n    return new Class({\n        type: \"string\",\n        format: \"date\",\n        check: \"string_format\",\n        ...util.normalizeParams(params),\n    });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _isoTime(Class, params) {\n    return new Class({\n        type: \"string\",\n        format: \"time\",\n        check: \"string_format\",\n        precision: null,\n        ...util.normalizeParams(params),\n    });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _isoDuration(Class, params) {\n    return new Class({\n        type: \"string\",\n        format: \"duration\",\n        check: \"string_format\",\n        ...util.normalizeParams(params),\n    });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _number(Class, params) {\n    return new Class({\n        type: \"number\",\n        checks: [],\n        ...util.normalizeParams(params),\n    });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _coercedNumber(Class, params) {\n    return new Class({\n        type: \"number\",\n        coerce: true,\n        checks: [],\n        ...util.normalizeParams(params),\n    });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _int(Class, params) {\n    return new Class({\n        type: \"number\",\n        check: \"number_format\",\n        abort: false,\n        format: \"safeint\",\n        ...util.normalizeParams(params),\n    });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _float32(Class, params) {\n    return new Class({\n        type: \"number\",\n        check: \"number_format\",\n        abort: false,\n        format: \"float32\",\n        ...util.normalizeParams(params),\n    });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _float64(Class, params) {\n    return new Class({\n        type: \"number\",\n        check: \"number_format\",\n        abort: false,\n        format: \"float64\",\n        ...util.normalizeParams(params),\n    });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _int32(Class, params) {\n    return new Class({\n        type: \"number\",\n        check: \"number_format\",\n        abort: false,\n        format: \"int32\",\n        ...util.normalizeParams(params),\n    });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _uint32(Class, params) {\n    return new Class({\n        type: \"number\",\n        check: \"number_format\",\n        abort: false,\n        format: \"uint32\",\n        ...util.normalizeParams(params),\n    });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _boolean(Class, params) {\n    return new Class({\n        type: \"boolean\",\n        ...util.normalizeParams(params),\n    });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _coercedBoolean(Class, params) {\n    return new Class({\n        type: \"boolean\",\n        coerce: true,\n        ...util.normalizeParams(params),\n    });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _bigint(Class, params) {\n    return new Class({\n        type: \"bigint\",\n        ...util.normalizeParams(params),\n    });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _coercedBigint(Class, params) {\n    return new Class({\n        type: \"bigint\",\n        coerce: true,\n        ...util.normalizeParams(params),\n    });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _int64(Class, params) {\n    return new Class({\n        type: \"bigint\",\n        check: \"bigint_format\",\n        abort: false,\n        format: \"int64\",\n        ...util.normalizeParams(params),\n    });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _uint64(Class, params) {\n    return new Class({\n        type: \"bigint\",\n        check: \"bigint_format\",\n        abort: false,\n        format: \"uint64\",\n        ...util.normalizeParams(params),\n    });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _symbol(Class, params) {\n    return new Class({\n        type: \"symbol\",\n        ...util.normalizeParams(params),\n    });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _undefined(Class, params) {\n    return new Class({\n        type: \"undefined\",\n        ...util.normalizeParams(params),\n    });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _null(Class, params) {\n    return new Class({\n        type: \"null\",\n        ...util.normalizeParams(params),\n    });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _any(Class) {\n    return new Class({\n        type: \"any\",\n    });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _unknown(Class) {\n    return new Class({\n        type: \"unknown\",\n    });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _never(Class, params) {\n    return new Class({\n        type: \"never\",\n        ...util.normalizeParams(params),\n    });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _void(Class, params) {\n    return new Class({\n        type: \"void\",\n        ...util.normalizeParams(params),\n    });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _date(Class, params) {\n    return new Class({\n        type: \"date\",\n        ...util.normalizeParams(params),\n    });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _coercedDate(Class, params) {\n    return new Class({\n        type: \"date\",\n        coerce: true,\n        ...util.normalizeParams(params),\n    });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _nan(Class, params) {\n    return new Class({\n        type: \"nan\",\n        ...util.normalizeParams(params),\n    });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _lt(value, params) {\n    return new checks.$ZodCheckLessThan({\n        check: \"less_than\",\n        ...util.normalizeParams(params),\n        value,\n        inclusive: false,\n    });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _lte(value, params) {\n    return new checks.$ZodCheckLessThan({\n        check: \"less_than\",\n        ...util.normalizeParams(params),\n        value,\n        inclusive: true,\n    });\n}\nexport { \n/** @deprecated Use `z.lte()` instead. */\n_lte as _max, };\n// @__NO_SIDE_EFFECTS__\nexport function _gt(value, params) {\n    return new checks.$ZodCheckGreaterThan({\n        check: \"greater_than\",\n        ...util.normalizeParams(params),\n        value,\n        inclusive: false,\n    });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _gte(value, params) {\n    return new checks.$ZodCheckGreaterThan({\n        check: \"greater_than\",\n        ...util.normalizeParams(params),\n        value,\n        inclusive: true,\n    });\n}\nexport { \n/** @deprecated Use `z.gte()` instead. */\n_gte as _min, };\n// @__NO_SIDE_EFFECTS__\nexport function _positive(params) {\n    return _gt(0, params);\n}\n// negative\n// @__NO_SIDE_EFFECTS__\nexport function _negative(params) {\n    return _lt(0, params);\n}\n// nonpositive\n// @__NO_SIDE_EFFECTS__\nexport function _nonpositive(params) {\n    return _lte(0, params);\n}\n// nonnegative\n// @__NO_SIDE_EFFECTS__\nexport function _nonnegative(params) {\n    return _gte(0, params);\n}\n// @__NO_SIDE_EFFECTS__\nexport function _multipleOf(value, params) {\n    return new checks.$ZodCheckMultipleOf({\n        check: \"multiple_of\",\n        ...util.normalizeParams(params),\n        value,\n    });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _maxSize(maximum, params) {\n    return new checks.$ZodCheckMaxSize({\n        check: \"max_size\",\n        ...util.normalizeParams(params),\n        maximum,\n    });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _minSize(minimum, params) {\n    return new checks.$ZodCheckMinSize({\n        check: \"min_size\",\n        ...util.normalizeParams(params),\n        minimum,\n    });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _size(size, params) {\n    return new checks.$ZodCheckSizeEquals({\n        check: \"size_equals\",\n        ...util.normalizeParams(params),\n        size,\n    });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _maxLength(maximum, params) {\n    const ch = new checks.$ZodCheckMaxLength({\n        check: \"max_length\",\n        ...util.normalizeParams(params),\n        maximum,\n    });\n    return ch;\n}\n// @__NO_SIDE_EFFECTS__\nexport function _minLength(minimum, params) {\n    return new checks.$ZodCheckMinLength({\n        check: \"min_length\",\n        ...util.normalizeParams(params),\n        minimum,\n    });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _length(length, params) {\n    return new checks.$ZodCheckLengthEquals({\n        check: \"length_equals\",\n        ...util.normalizeParams(params),\n        length,\n    });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _regex(pattern, params) {\n    return new checks.$ZodCheckRegex({\n        check: \"string_format\",\n        format: \"regex\",\n        ...util.normalizeParams(params),\n        pattern,\n    });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _lowercase(params) {\n    return new checks.$ZodCheckLowerCase({\n        check: \"string_format\",\n        format: \"lowercase\",\n        ...util.normalizeParams(params),\n    });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _uppercase(params) {\n    return new checks.$ZodCheckUpperCase({\n        check: \"string_format\",\n        format: \"uppercase\",\n        ...util.normalizeParams(params),\n    });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _includes(includes, params) {\n    return new checks.$ZodCheckIncludes({\n        check: \"string_format\",\n        format: \"includes\",\n        ...util.normalizeParams(params),\n        includes,\n    });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _startsWith(prefix, params) {\n    return new checks.$ZodCheckStartsWith({\n        check: \"string_format\",\n        format: \"starts_with\",\n        ...util.normalizeParams(params),\n        prefix,\n    });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _endsWith(suffix, params) {\n    return new checks.$ZodCheckEndsWith({\n        check: \"string_format\",\n        format: \"ends_with\",\n        ...util.normalizeParams(params),\n        suffix,\n    });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _property(property, schema, params) {\n    return new checks.$ZodCheckProperty({\n        check: \"property\",\n        property,\n        schema,\n        ...util.normalizeParams(params),\n    });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _properties(shape) {\n    return Object.entries(shape).map(([property, schema]) => new checks.$ZodCheckProperty({ check: \"property\", property, schema }));\n}\n// @__NO_SIDE_EFFECTS__\nexport function _mime(types, params) {\n    return new checks.$ZodCheckMimeType({\n        check: \"mime_type\",\n        mime: types,\n        ...util.normalizeParams(params),\n    });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _overwrite(tx) {\n    return new checks.$ZodCheckOverwrite({\n        check: \"overwrite\",\n        tx,\n    });\n}\n// normalize\n// @__NO_SIDE_EFFECTS__\nexport function _normalize(form) {\n    return _overwrite((input) => input.normalize(form));\n}\n// trim\n// @__NO_SIDE_EFFECTS__\nexport function _trim() {\n    return _overwrite((input) => input.trim());\n}\n// toLowerCase\n// @__NO_SIDE_EFFECTS__\nexport function _toLowerCase() {\n    return _overwrite((input) => input.toLowerCase());\n}\n// toUpperCase\n// @__NO_SIDE_EFFECTS__\nexport function _toUpperCase() {\n    return _overwrite((input) => input.toUpperCase());\n}\n// slugify\n// @__NO_SIDE_EFFECTS__\nexport function _slugify() {\n    return _overwrite((input) => util.slugify(input));\n}\n// @__NO_SIDE_EFFECTS__\nexport function _array(Class, element, params) {\n    return new Class({\n        type: \"array\",\n        element,\n        // get element() {\n        //   return element;\n        // },\n        ...util.normalizeParams(params),\n    });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _union(Class, options, params) {\n    return new Class({\n        type: \"union\",\n        options,\n        ...util.normalizeParams(params),\n    });\n}\nexport function _xor(Class, options, params) {\n    return new Class({\n        type: \"union\",\n        options,\n        inclusive: false,\n        ...util.normalizeParams(params),\n    });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _discriminatedUnion(Class, discriminator, options, params) {\n    return new Class({\n        type: \"union\",\n        options: options,\n        discriminator,\n        ...util.normalizeParams(params),\n    });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _intersection(Class, left, right) {\n    return new Class({\n        type: \"intersection\",\n        left,\n        right,\n    });\n}\n// export function _tuple(\n//   Class: util.SchemaClass<schemas.$ZodTuple>,\n//   items: [],\n//   params?: string | $ZodTupleParams\n// ): schemas.$ZodTuple<[], null>;\n// @__NO_SIDE_EFFECTS__\nexport function _tuple(Class, items, _paramsOrRest, _params) {\n    const hasRest = _paramsOrRest instanceof schemas.$ZodType;\n    const params = hasRest ? _params : _paramsOrRest;\n    const rest = hasRest ? _paramsOrRest : null;\n    return new Class({\n        type: \"tuple\",\n        items,\n        rest,\n        ...util.normalizeParams(params),\n    });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _record(Class, keyType, valueType, params) {\n    return new Class({\n        type: \"record\",\n        keyType,\n        valueType,\n        ...util.normalizeParams(params),\n    });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _map(Class, keyType, valueType, params) {\n    return new Class({\n        type: \"map\",\n        keyType,\n        valueType,\n        ...util.normalizeParams(params),\n    });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _set(Class, valueType, params) {\n    return new Class({\n        type: \"set\",\n        valueType,\n        ...util.normalizeParams(params),\n    });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _enum(Class, values, params) {\n    const entries = Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values;\n    // if (Array.isArray(values)) {\n    //   for (const value of values) {\n    //     entries[value] = value;\n    //   }\n    // } else {\n    //   Object.assign(entries, values);\n    // }\n    // const entries: util.EnumLike = {};\n    // for (const val of values) {\n    //   entries[val] = val;\n    // }\n    return new Class({\n        type: \"enum\",\n        entries,\n        ...util.normalizeParams(params),\n    });\n}\n// @__NO_SIDE_EFFECTS__\n/** @deprecated This API has been merged into `z.enum()`. Use `z.enum()` instead.\n *\n * ```ts\n * enum Colors { red, green, blue }\n * z.enum(Colors);\n * ```\n */\nexport function _nativeEnum(Class, entries, params) {\n    return new Class({\n        type: \"enum\",\n        entries,\n        ...util.normalizeParams(params),\n    });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _literal(Class, value, params) {\n    return new Class({\n        type: \"literal\",\n        values: Array.isArray(value) ? value : [value],\n        ...util.normalizeParams(params),\n    });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _file(Class, params) {\n    return new Class({\n        type: \"file\",\n        ...util.normalizeParams(params),\n    });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _transform(Class, fn) {\n    return new Class({\n        type: \"transform\",\n        transform: fn,\n    });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _optional(Class, innerType) {\n    return new Class({\n        type: \"optional\",\n        innerType,\n    });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _nullable(Class, innerType) {\n    return new Class({\n        type: \"nullable\",\n        innerType,\n    });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _default(Class, innerType, defaultValue) {\n    return new Class({\n        type: \"default\",\n        innerType,\n        get defaultValue() {\n            return typeof defaultValue === \"function\" ? defaultValue() : util.shallowClone(defaultValue);\n        },\n    });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _nonoptional(Class, innerType, params) {\n    return new Class({\n        type: \"nonoptional\",\n        innerType,\n        ...util.normalizeParams(params),\n    });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _success(Class, innerType) {\n    return new Class({\n        type: \"success\",\n        innerType,\n    });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _catch(Class, innerType, catchValue) {\n    return new Class({\n        type: \"catch\",\n        innerType,\n        catchValue: (typeof catchValue === \"function\" ? catchValue : util.constantCatch(catchValue)),\n    });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _pipe(Class, in_, out) {\n    return new Class({\n        type: \"pipe\",\n        in: in_,\n        out,\n    });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _readonly(Class, innerType) {\n    return new Class({\n        type: \"readonly\",\n        innerType,\n    });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _templateLiteral(Class, parts, params) {\n    return new Class({\n        type: \"template_literal\",\n        parts,\n        ...util.normalizeParams(params),\n    });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _lazy(Class, getter) {\n    return new Class({\n        type: \"lazy\",\n        getter,\n    });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _promise(Class, innerType) {\n    return new Class({\n        type: \"promise\",\n        innerType,\n    });\n}\n// @__NO_SIDE_EFFECTS__\nexport function _custom(Class, fn, _params) {\n    const norm = util.normalizeParams(_params);\n    norm.abort ?? (norm.abort = true); // default to abort:false\n    const schema = new Class({\n        type: \"custom\",\n        check: \"custom\",\n        fn: fn,\n        ...norm,\n    });\n    return schema;\n}\n// same as _custom but defaults to abort:false\n// @__NO_SIDE_EFFECTS__\nexport function _refine(Class, fn, _params) {\n    const schema = new Class({\n        type: \"custom\",\n        check: \"custom\",\n        fn: fn,\n        ...util.normalizeParams(_params),\n    });\n    return schema;\n}\n// @__NO_SIDE_EFFECTS__\nexport function _superRefine(fn, params) {\n    const ch = _check((payload) => {\n        payload.addIssue = (issue) => {\n            if (typeof issue === \"string\") {\n                payload.issues.push(util.issue(issue, payload.value, ch._zod.def));\n            }\n            else {\n                // for Zod 3 backwards compatibility\n                const _issue = issue;\n                if (_issue.fatal)\n                    _issue.continue = false;\n                _issue.code ?? (_issue.code = \"custom\");\n                if (!(\"input\" in _issue))\n                    _issue.input = payload.value;\n                _issue.inst ?? (_issue.inst = ch);\n                _issue.continue ?? (_issue.continue = !ch._zod.def.abort); // abort is always undefined, so this is always true...\n                payload.issues.push(util.issue(_issue));\n            }\n        };\n        return fn(payload.value, payload);\n    }, params);\n    return ch;\n}\n// @__NO_SIDE_EFFECTS__\nexport function _check(fn, params) {\n    const ch = new checks.$ZodCheck({\n        check: \"custom\",\n        ...util.normalizeParams(params),\n    });\n    ch._zod.check = fn;\n    return ch;\n}\n// @__NO_SIDE_EFFECTS__\nexport function describe(description) {\n    const ch = new checks.$ZodCheck({ check: \"describe\" });\n    ch._zod.onattach = [\n        (inst) => {\n            const existing = registries.globalRegistry.get(inst) ?? {};\n            registries.globalRegistry.add(inst, { ...existing, description });\n        },\n    ];\n    ch._zod.check = () => { }; // no-op check\n    return ch;\n}\n// @__NO_SIDE_EFFECTS__\nexport function meta(metadata) {\n    const ch = new checks.$ZodCheck({ check: \"meta\" });\n    ch._zod.onattach = [\n        (inst) => {\n            const existing = registries.globalRegistry.get(inst) ?? {};\n            registries.globalRegistry.add(inst, { ...existing, ...metadata });\n        },\n    ];\n    ch._zod.check = () => { }; // no-op check\n    return ch;\n}\n// @__NO_SIDE_EFFECTS__\nexport function _stringbool(Classes, _params) {\n    const params = util.normalizeParams(_params);\n    let truthyArray = params.truthy ?? [\"true\", \"1\", \"yes\", \"on\", \"y\", \"enabled\"];\n    let falsyArray = params.falsy ?? [\"false\", \"0\", \"no\", \"off\", \"n\", \"disabled\"];\n    if (params.case !== \"sensitive\") {\n        truthyArray = truthyArray.map((v) => (typeof v === \"string\" ? v.toLowerCase() : v));\n        falsyArray = falsyArray.map((v) => (typeof v === \"string\" ? v.toLowerCase() : v));\n    }\n    const truthySet = new Set(truthyArray);\n    const falsySet = new Set(falsyArray);\n    const _Codec = Classes.Codec ?? schemas.$ZodCodec;\n    const _Boolean = Classes.Boolean ?? schemas.$ZodBoolean;\n    const _String = Classes.String ?? schemas.$ZodString;\n    const stringSchema = new _String({ type: \"string\", error: params.error });\n    const booleanSchema = new _Boolean({ type: \"boolean\", error: params.error });\n    const codec = new _Codec({\n        type: \"pipe\",\n        in: stringSchema,\n        out: booleanSchema,\n        transform: ((input, payload) => {\n            let data = input;\n            if (params.case !== \"sensitive\")\n                data = data.toLowerCase();\n            if (truthySet.has(data)) {\n                return true;\n            }\n            else if (falsySet.has(data)) {\n                return false;\n            }\n            else {\n                payload.issues.push({\n                    code: \"invalid_value\",\n                    expected: \"stringbool\",\n                    values: [...truthySet, ...falsySet],\n                    input: payload.value,\n                    inst: codec,\n                    continue: false,\n                });\n                return {};\n            }\n        }),\n        reverseTransform: ((input, _payload) => {\n            if (input === true) {\n                return truthyArray[0] || \"true\";\n            }\n            else {\n                return falsyArray[0] || \"false\";\n            }\n        }),\n        error: params.error,\n    });\n    codec._zod.bag.truthy = truthyArray;\n    codec._zod.bag.falsy = falsyArray;\n    codec._zod.bag.case = params.case ?? \"insensitive\";\n    return codec;\n}\n// @__NO_SIDE_EFFECTS__\nexport function _stringFormat(Class, format, fnOrRegex, _params = {}) {\n    const params = util.normalizeParams(_params);\n    const def = {\n        check: \"string_format\",\n        type: \"string\",\n        format,\n        fn: typeof fnOrRegex === \"function\" ? fnOrRegex : (val) => fnOrRegex.test(val),\n        ...params,\n    };\n    if (fnOrRegex instanceof RegExp) {\n        def.pattern = fnOrRegex;\n    }\n    const inst = new Class(def);\n    return inst;\n}\n","import { globalRegistry } from \"./registries.js\";\nimport { assignProp } from \"./util.js\";\nfunction assignProps(target, ...sources) {\n    for (const source of sources) {\n        for (const key of Reflect.ownKeys(source)) {\n            if (Object.prototype.propertyIsEnumerable.call(source, key)) {\n                assignProp(target, key, source[key]);\n            }\n        }\n    }\n    return target;\n}\n// function initializeContext<T extends schemas.$ZodType>(inputs: JSONSchemaGeneratorParams<T>): ToJSONSchemaContext<T> {\n//   return {\n//     processor: inputs.processor,\n//     metadataRegistry: inputs.metadata ?? globalRegistry,\n//     target: inputs.target ?? \"draft-2020-12\",\n//     unrepresentable: inputs.unrepresentable ?? \"throw\",\n//   };\n// }\nexport function initializeContext(params) {\n    // Normalize target: convert old non-hyphenated versions to hyphenated versions\n    let target = params?.target ?? \"draft-2020-12\";\n    if (target === \"draft-4\")\n        target = \"draft-04\";\n    if (target === \"draft-7\")\n        target = \"draft-07\";\n    return {\n        processors: params.processors ?? {},\n        metadataRegistry: params?.metadata ?? globalRegistry,\n        target,\n        unrepresentable: params?.unrepresentable ?? \"throw\",\n        override: params?.override ?? (() => { }),\n        io: params?.io ?? \"output\",\n        counter: 0,\n        seen: new Map(),\n        sharedDefsExtractedFor: undefined,\n        sharedEmitDoneFor: undefined,\n        cycles: params?.cycles ?? \"ref\",\n        reused: params?.reused ?? \"inline\",\n        intersections: [],\n        deferred: [],\n        external: params?.external ?? undefined,\n    };\n}\n/**\n * Applies the `unrepresentable` setting at a site that has no JSON Schema equivalent. Throws\n * `message` unless the setting (or the handler's return value) says otherwise. Returns `true` if a\n * custom JSON Schema was written into `json`, in which case the caller must not write its own.\n */\nexport function handleUnrepresentable(schema, ctx, json, params, message) {\n    const result = typeof ctx.unrepresentable === \"function\"\n        ? ctx.unrepresentable({ zodSchema: schema, path: params.path, message })\n        : ctx.unrepresentable;\n    if (result === \"any\")\n        return false;\n    if (result === undefined || result === \"throw\")\n        throw new Error(message);\n    Object.assign(json, result);\n    return true;\n}\nexport function process(schema, ctx, _params = { path: [], schemaPath: [] }) {\n    var _a;\n    const def = schema._zod.def;\n    // check for schema in seens\n    const seen = ctx.seen.get(schema);\n    if (seen) {\n        seen.count++;\n        // check if cycle\n        const isCycle = _params.schemaPath.includes(schema);\n        if (isCycle) {\n            seen.cycle = _params.path;\n        }\n        return seen.schema;\n    }\n    // initialize\n    const result = { schema: {}, count: 1, cycle: undefined, path: _params.path };\n    ctx.seen.set(schema, result);\n    ctx.sharedDefsExtractedFor = undefined;\n    ctx.sharedEmitDoneFor = undefined;\n    // custom method overrides default behavior\n    const overrideSchema = schema._zod.toJSONSchema?.();\n    if (overrideSchema) {\n        result.schema = overrideSchema;\n    }\n    else {\n        const params = {\n            ..._params,\n            schemaPath: [..._params.schemaPath, schema],\n            path: _params.path,\n        };\n        if (schema._zod.processJSONSchema) {\n            schema._zod.processJSONSchema(ctx, result.schema, params);\n        }\n        else {\n            const _json = result.schema;\n            const processor = ctx.processors[def.type];\n            if (!processor) {\n                throw new Error(`[toJSONSchema]: Non-representable type encountered: ${def.type}`);\n            }\n            processor(schema, ctx, _json, params);\n        }\n        const parent = schema._zod.parent;\n        if (parent) {\n            // Also set ref if processor didn't (for inheritance)\n            if (!result.ref)\n                result.ref = parent;\n            process(parent, ctx, params);\n            ctx.seen.get(parent).isParent = true;\n        }\n    }\n    // metadata\n    const meta = ctx.metadataRegistry.get(schema);\n    if (meta)\n        assignProps(result.schema, meta);\n    if (ctx.io === \"input\" && isTransforming(schema)) {\n        // examples/defaults only apply to output type of pipe\n        delete result.schema.examples;\n        delete result.schema.default;\n    }\n    // set prefault as default\n    if (ctx.io === \"input\" && \"_prefault\" in result.schema)\n        (_a = result.schema).default ?? (_a.default = result.schema._prefault);\n    delete result.schema._prefault;\n    // pulling fresh from ctx.seen in case it was overwritten\n    const _result = ctx.seen.get(schema);\n    return _result.schema;\n}\n// Escape a reference token for use in a JSON Pointer fragment (RFC 6901): `~` becomes `~0` and `/` becomes `~1`. The `~` replacement must run first.\nfunction encodeJSONPointerSegment(segment) {\n    return segment.replace(/~/g, \"~0\").replace(/\\//g, \"~1\");\n}\nexport function extractDefs(ctx, schema\n// params: EmitParams\n) {\n    // iterate over seen map;\n    const root = ctx.seen.get(schema);\n    if (!root)\n        throw new Error(\"Unprocessed schema. This is a bug in Zod.\");\n    // With `external` set, every registered schema resolves through the external branch of `makeURI`, so the root branch below produces the same ref the external branch would — this pass is identical whichever schema it is called with, and only needs to run once.\n    if (ctx.external && ctx.sharedDefsExtractedFor === ctx.external)\n        return;\n    // Track ids to detect duplicates across different schemas\n    const idToSchema = new Map();\n    for (const entry of ctx.seen.entries()) {\n        const id = ctx.metadataRegistry.get(entry[0])?.id;\n        if (id) {\n            const existing = idToSchema.get(id);\n            if (existing && existing !== entry[0]) {\n                throw new Error(`Duplicate schema id \"${id}\" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);\n            }\n            idToSchema.set(id, entry[0]);\n        }\n    }\n    // returns a ref to the schema defId will be empty if the ref points to an external schema (or #)\n    const makeURI = (entry) => {\n        // comparing the seen objects because sometimes multiple schemas map to the same seen object. e.g. lazy\n        // external is configured\n        const defsSegment = ctx.target === \"draft-2020-12\" ? \"$defs\" : \"definitions\";\n        if (ctx.external) {\n            const externalId = ctx.external.registry.get(entry[0])?.id; // ?? \"__shared\";// `__schema${ctx.counter++}`;\n            // check if schema is in the external registry\n            const uriGenerator = ctx.external.uri ?? ((id) => id);\n            if (externalId) {\n                return { ref: uriGenerator(externalId) };\n            }\n            // otherwise, add to __shared\n            const id = entry[1].defId ?? entry[1].schema.id ?? `schema${ctx.counter++}`;\n            entry[1].defId = id; // set defId so it will be reused if needed\n            return { defId: id, ref: `${uriGenerator(\"__shared\")}#/${defsSegment}/${encodeJSONPointerSegment(id)}` };\n        }\n        const uriPrefix = `#`;\n        const defUriPrefix = `${uriPrefix}/${defsSegment}/`;\n        // an id-less root has nowhere to be extracted to, so it stays inline and self-references as `#`\n        if (entry[1] === root && !entry[1].schema.id) {\n            return { ref: uriPrefix };\n        }\n        // self-contained schema\n        const defId = entry[1].schema.id ?? `__schema${ctx.counter++}`;\n        return { defId, ref: defUriPrefix + encodeJSONPointerSegment(defId) };\n    };\n    // stored cached version in `def` property remove all properties, set $ref\n    const extractToDef = (entry) => {\n        // if the schema is already a reference, do not extract it\n        if (entry[1].schema.$ref) {\n            return;\n        }\n        const seen = entry[1];\n        const { ref, defId } = makeURI(entry);\n        seen.def = { ...seen.schema };\n        // defId won't be set if the schema is a reference to an external schema or if the schema is the root schema\n        if (defId)\n            seen.defId = defId;\n        // wipe away all properties except $ref\n        const schema = seen.schema;\n        for (const key in schema) {\n            delete schema[key];\n        }\n        schema.$ref = ref;\n    };\n    // throw on cycles\n    // break cycles\n    if (ctx.cycles === \"throw\") {\n        for (const entry of ctx.seen.entries()) {\n            const seen = entry[1];\n            if (seen.cycle) {\n                throw new Error(\"Cycle detected: \" +\n                    `#/${seen.cycle?.join(\"/\")}/<root>` +\n                    '\\n\\nSet the `cycles` parameter to `\"ref\"` to resolve cyclical schemas with defs.');\n            }\n        }\n    }\n    // extract schemas into $defs\n    for (const entry of ctx.seen.entries()) {\n        const seen = entry[1];\n        // convert root schema to # $ref\n        if (schema === entry[0]) {\n            extractToDef(entry); // this has special handling for the root schema\n            continue;\n        }\n        // extract schemas that are in the external registry\n        if (ctx.external) {\n            const ext = ctx.external.registry.get(entry[0])?.id;\n            if (schema !== entry[0] && ext) {\n                extractToDef(entry);\n                continue;\n            }\n        }\n        // extract schemas with `id` meta\n        const id = ctx.metadataRegistry.get(entry[0])?.id;\n        if (id) {\n            extractToDef(entry);\n            continue;\n        }\n        // break cycles\n        if (seen.cycle) {\n            // any\n            extractToDef(entry);\n            continue;\n        }\n        // extract reused schemas\n        if (seen.count > 1) {\n            if (ctx.reused === \"ref\") {\n                extractToDef(entry);\n                // biome-ignore lint:\n                continue;\n            }\n        }\n    }\n    if (ctx.external)\n        ctx.sharedDefsExtractedFor = ctx.external;\n}\n/** Rewrites `anyOf: [{type: \"a\"}, {type: \"b\"}]` to `type: [\"a\", \"b\"]`, which every JSON Schema draft treats as equivalent and most consumers render far better for the nullable case. Only branches that are a bare type assertion qualify — anything carrying a constraint, `$ref`, `const` or metadata is left alone. Runs after `flattenRef`, so a branch an override decorated or `$defs` extraction turned into a `$ref` is no longer bare and correctly stays in `anyOf`. `oneOf` is excluded: `integer` and `number` overlap, so \"exactly one\" and \"at least one\" are not the same there. OpenAPI 3.0 is excluded: its `type` must be a single string. */\nfunction compactTypeUnion(schema) {\n    const options = schema.anyOf;\n    if (!Array.isArray(options) || options.length === 0 || schema.type !== undefined)\n        return;\n    const types = [];\n    for (const option of options) {\n        if (!option || typeof option !== \"object\")\n            return;\n        // A branch that is itself a compactible union folds into this one — nested `anyOf` and a flat `type` array say the same thing. Compacting it first also makes the result independent of the order this pass walks the seen map in.\n        compactTypeUnion(option);\n        const keys = Object.keys(option);\n        if (keys.length !== 1 || keys[0] !== \"type\")\n            return;\n        const type = option.type;\n        for (const member of Array.isArray(type) ? type : [type]) {\n            if (typeof member !== \"string\")\n                return;\n            if (!types.includes(member))\n                types.push(member);\n        }\n    }\n    delete schema.anyOf;\n    // A `type` array must be non-empty and unique (metaschema); a single member is spelled as a bare string.\n    schema.type = types.length === 1 ? types[0] : types;\n}\n/** Keywords `foldIntersection` knows how to combine. Anything else — `$ref`, `patternProperties`,\n * an annotation like `description` — makes a member unfoldable, so a constraint this does not\n * understand leaves the `allOf` alone instead of being silently dropped or misattributed. */\nconst FOLDABLE_KEYS = new Set([\"type\", \"properties\", \"required\", \"additionalProperties\"]);\nconst UNION_KEYS = [\"oneOf\", \"anyOf\"];\n/** A member's constraint on a key it does not declare itself. A `catchall` states one; `false`, an absent `additionalProperties`, and the empty schema a loose object emits state nothing. */\nfunction undeclaredConstraint(member) {\n    const extra = member.additionalProperties;\n    if (extra === undefined || extra === false || typeof extra !== \"object\" || extra === null)\n        return null;\n    return Object.keys(extra).length ? extra : null;\n}\n/** Combines object members into the single object they describe together, or returns `null` if any of them carries a keyword outside {@link FOLDABLE_KEYS}. */\nfunction foldObjects(members) {\n    const objects = [];\n    for (const member of members) {\n        // A boolean subschema is legal JSON Schema and carries no keywords to fold.\n        if (typeof member !== \"object\" || member.type !== \"object\")\n            return null;\n        for (const key in member) {\n            if (!FOLDABLE_KEYS.has(key))\n                return null;\n        }\n        objects.push(member);\n    }\n    const properties = {};\n    const required = new Set();\n    for (const object of objects) {\n        for (const key in object.properties) {\n            // `in` would report a `__proto__` key as already present via the prototype chain and skip it.\n            if (Object.prototype.hasOwnProperty.call(properties, key))\n                continue;\n            // Every member constrains this key: the ones that declare it say how, and a `catchall` member constrains it too even though it does not name it. The key has to satisfy all of them, which is the same intersection one level down.\n            const parts = [];\n            for (const other of objects) {\n                const part = other.properties?.[key] ?? undeclaredConstraint(other);\n                if (part === null || part === undefined)\n                    continue;\n                if (!parts.some((seen) => JSON.stringify(seen) === JSON.stringify(part)))\n                    parts.push(part);\n            }\n            const merged = parts.length === 1\n                ? parts[0]\n                : (foldObjects(parts) ?? { allOf: parts });\n            assignProp(properties, key, merged);\n        }\n        for (const key of object.required ?? [])\n            required.add(key);\n    }\n    const folded = { type: \"object\", properties };\n    if (required.size)\n        folded.required = [...required];\n    // A key no member declares is rejected only when every member rejects it, so the fold is closed only when every member is. Otherwise it carries whatever the `catchall` members demand of such a key.\n    if (objects.every((object) => object.additionalProperties === false)) {\n        folded.additionalProperties = false;\n    }\n    else {\n        const constraints = [];\n        for (const object of objects) {\n            const constraint = undeclaredConstraint(object);\n            if (constraint && !constraints.some((seen) => JSON.stringify(seen) === JSON.stringify(constraint)))\n                constraints.push(constraint);\n        }\n        if (constraints.length === 1)\n            folded.additionalProperties = constraints[0];\n        else if (constraints.length > 1)\n            folded.additionalProperties = { allOf: constraints };\n    }\n    return folded;\n}\n/** `additionalProperties` in an `allOf` member sees only that member's own `properties`, so two\n * closed object members reject each other's keys and the schema validates nothing. Zod's parser\n * pools the key sets instead — `handleIntersectionResults` reports a key as unrecognized only when\n * *every* side rejects it — so the emitted schema has to pool them too, and folding the members\n * into one object is the encoding that says so on every target.\n *\n * This runs from `finalize`, after `extractDefs`, which is what keeps it clear of the `$ref`\n * machinery: a member extracted into `$defs` is already a `$ref` by now and declines to fold, so it\n * keeps its reference and its own closedness rather than being inlined as a stale copy. */\nfunction foldIntersection(json) {\n    const allOf = json.allOf;\n    if (!Array.isArray(allOf) || allOf.length < 2)\n        return;\n    // An `override` runs before this pass and may have written object keywords onto the intersection itself. Those are deliberate, so decline rather than overwrite them.\n    for (const key of FOLDABLE_KEYS)\n        if (key in json)\n            return;\n    // An intersection distributes over a union: `A & (X | Y)` is `(A & X) | (A & Y)`. Only the first union is distributed over; a second one stays among the members every branch folds against, where it fails the object check and declines the whole intersection rather than multiplying out.\n    const unions = allOf.filter((m) => UNION_KEYS.some((k) => Array.isArray(m[k])));\n    let folded = null;\n    if (!unions.length) {\n        folded = foldObjects(allOf);\n    }\n    else {\n        const union = unions[0];\n        const keyword = UNION_KEYS.find((k) => Array.isArray(union[k]));\n        if (Object.keys(union).length !== 1)\n            return;\n        const rest = allOf.filter((m) => m !== union);\n        const branches = union[keyword].map((branch) => foldObjects([...rest, branch]));\n        if (branches.some((b) => !b))\n            return;\n        folded = { [keyword]: branches };\n    }\n    if (!folded)\n        return;\n    delete json.allOf;\n    assignProps(json, folded);\n}\nexport function finalize(ctx, schema) {\n    const root = ctx.seen.get(schema);\n    if (!root)\n        throw new Error(\"Unprocessed schema. This is a bug in Zod.\");\n    // flatten refs - inherit properties from parent schemas\n    const flattenRef = (zodSchema) => {\n        const seen = ctx.seen.get(zodSchema);\n        // already processed\n        if (seen.ref === null)\n            return;\n        const schema = seen.def ?? seen.schema;\n        const _cached = { ...schema };\n        const ref = seen.ref;\n        seen.ref = null; // prevent infinite recursion\n        if (ref) {\n            flattenRef(ref);\n            const refSeen = ctx.seen.get(ref);\n            const refSchema = refSeen.schema;\n            // merge referenced schema into current\n            if (refSchema.$ref && (ctx.target === \"draft-07\" || ctx.target === \"draft-04\" || ctx.target === \"openapi-3.0\")) {\n                // older drafts can't combine $ref with other properties\n                schema.allOf = schema.allOf ?? [];\n                schema.allOf.push(refSchema);\n            }\n            else {\n                assignProps(schema, refSchema);\n            }\n            // restore child's own properties (child wins)\n            assignProps(schema, _cached);\n            const isParentRef = zodSchema._zod.parent === ref;\n            // For parent chain, child is a refinement - remove parent-only properties\n            if (isParentRef) {\n                for (const key in schema) {\n                    if (key === \"$ref\" || key === \"allOf\")\n                        continue;\n                    if (!(key in _cached)) {\n                        delete schema[key];\n                    }\n                }\n            }\n            // When ref was extracted to $defs, remove properties that match the definition\n            if (refSchema.$ref && refSeen.def) {\n                for (const key in schema) {\n                    if (key === \"$ref\" || key === \"allOf\")\n                        continue;\n                    if (key in refSeen.def && JSON.stringify(schema[key]) === JSON.stringify(refSeen.def[key])) {\n                        delete schema[key];\n                    }\n                }\n            }\n        }\n        // If parent was extracted (has $ref), propagate $ref to this schema. This handles cases like: readonly().meta({id}).describe() where processor sets ref to innerType but parent should be referenced\n        const parent = zodSchema._zod.parent;\n        if (parent && parent !== ref) {\n            // Ensure parent is processed first so its def has inherited properties\n            flattenRef(parent);\n            const parentSeen = ctx.seen.get(parent);\n            if (parentSeen?.schema.$ref) {\n                schema.$ref = parentSeen.schema.$ref;\n                // De-duplicate with parent's definition\n                if (parentSeen.def) {\n                    for (const key in schema) {\n                        if (key === \"$ref\" || key === \"allOf\")\n                            continue;\n                        if (key in parentSeen.def && JSON.stringify(schema[key]) === JSON.stringify(parentSeen.def[key])) {\n                            delete schema[key];\n                        }\n                    }\n                }\n            }\n        }\n        // execute overrides\n        ctx.override({\n            zodSchema: zodSchema,\n            jsonSchema: schema,\n            path: seen.path ?? [],\n        });\n    };\n    // Flattening walks the whole map and clears each `ref` as it goes, so a second call over the same map is a no-op scan. Skip it outright once it has run for a registry conversion.\n    if (!ctx.external || ctx.sharedEmitDoneFor !== ctx.external) {\n        for (const entry of [...ctx.seen.entries()].reverse()) {\n            flattenRef(entry[0]);\n        }\n        if (ctx.target !== \"openapi-3.0\") {\n            for (const entry of ctx.seen.entries()) {\n                compactTypeUnion(entry[1].def ?? entry[1].schema);\n            }\n        }\n        for (const rewrite of ctx.deferred)\n            rewrite();\n        // After flattening, every member that was extracted is a `$ref`, so the fold sees the final shape. A schema that inherits an intersection — through `z.lazy`, or any `ref` chain — holds the same `allOf` array, so fold by array identity to catch every copy.\n        if (ctx.intersections.length) {\n            const carriers = new Map();\n            for (const seen of ctx.seen.values()) {\n                for (const json of [seen.schema, seen.def]) {\n                    const allOf = json?.allOf;\n                    if (!Array.isArray(allOf))\n                        continue;\n                    const existing = carriers.get(allOf);\n                    if (existing)\n                        existing.push(json);\n                    else\n                        carriers.set(allOf, [json]);\n                }\n            }\n            for (const allOf of ctx.intersections) {\n                for (const json of carriers.get(allOf) ?? [])\n                    foldIntersection(json);\n            }\n        }\n    }\n    const result = {};\n    if (ctx.target === \"draft-2020-12\") {\n        result.$schema = \"https://json-schema.org/draft/2020-12/schema\";\n    }\n    else if (ctx.target === \"draft-07\") {\n        result.$schema = \"http://json-schema.org/draft-07/schema#\";\n    }\n    else if (ctx.target === \"draft-04\") {\n        result.$schema = \"http://json-schema.org/draft-04/schema#\";\n    }\n    else if (ctx.target === \"openapi-3.0\") {\n        // OpenAPI 3.0 schema objects should not include a $schema property\n    }\n    else {\n        // Arbitrary string values are allowed but won't have a $schema property set\n    }\n    if (ctx.external?.uri) {\n        const id = ctx.external.registry.get(schema)?.id;\n        if (!id)\n            throw new Error(\"Schema is missing an `id` property\");\n        result.$id = ctx.external.uri(id);\n    }\n    // when the root was extracted into $defs, `root.schema` is the `$ref` wrapper and `root.def` is the body that now lives under $defs\n    assignProps(result, root.defId ? root.schema : (root.def ?? root.schema));\n    // The `id` in `.meta()` is a Zod-specific registration tag used to extract schemas into $defs — it is not user-facing JSON Schema metadata. Strip it from the output body where it would otherwise leak. The id is preserved implicitly via the $defs key (and via $ref paths).\n    const rootMetaId = ctx.metadataRegistry.get(schema)?.id;\n    if (rootMetaId !== undefined && result.id === rootMetaId)\n        delete result.id;\n    // build defs object. With `external`, `defs` is the shared object every schema writes into, so the same entries are reassigned on every call. Without it, `defs` is fresh per call and must be rebuilt.\n    const defs = ctx.external?.defs ?? {};\n    if (!ctx.external || ctx.sharedEmitDoneFor !== ctx.external) {\n        for (const entry of ctx.seen.entries()) {\n            const seen = entry[1];\n            if (seen.def && seen.defId) {\n                if (seen.def.id === seen.defId)\n                    delete seen.def.id;\n                assignProp(defs, seen.defId, seen.def);\n            }\n        }\n    }\n    if (ctx.external)\n        ctx.sharedEmitDoneFor = ctx.external;\n    // set definitions in result\n    if (ctx.external) {\n    }\n    else {\n        if (Object.keys(defs).length > 0) {\n            if (ctx.target === \"draft-2020-12\") {\n                result.$defs = defs;\n            }\n            else {\n                result.definitions = defs;\n            }\n        }\n    }\n    try {\n        // this \"finalizes\" this schema and ensures all cycles are removed each call to finalize() is functionally independent though the seen map is shared\n        const finalized = JSON.parse(JSON.stringify(result));\n        Object.defineProperty(finalized, \"~standard\", {\n            value: {\n                ...schema[\"~standard\"],\n                jsonSchema: {\n                    input: createStandardJSONSchemaMethod(schema, \"input\", ctx.processors),\n                    output: createStandardJSONSchemaMethod(schema, \"output\", ctx.processors),\n                },\n            },\n            enumerable: false,\n            writable: false,\n        });\n        return finalized;\n    }\n    catch (_err) {\n        throw new Error(\"Error converting schema to JSON.\");\n    }\n}\nfunction isTransforming(_schema, _ctx) {\n    const ctx = _ctx ?? { seen: new Set() };\n    if (ctx.seen.has(_schema))\n        return false;\n    ctx.seen.add(_schema);\n    const def = _schema._zod.def;\n    if (def.type === \"transform\")\n        return true;\n    if (def.type === \"array\")\n        return isTransforming(def.element, ctx);\n    if (def.type === \"set\")\n        return isTransforming(def.valueType, ctx);\n    if (def.type === \"lazy\")\n        return isTransforming(def.getter(), ctx);\n    if (def.type === \"promise\" ||\n        def.type === \"optional\" ||\n        def.type === \"nonoptional\" ||\n        def.type === \"nullable\" ||\n        def.type === \"readonly\" ||\n        def.type === \"default\" ||\n        def.type === \"prefault\" ||\n        def.type === \"catch\") {\n        return isTransforming(def.innerType, ctx);\n    }\n    if (def.type === \"intersection\") {\n        return isTransforming(def.left, ctx) || isTransforming(def.right, ctx);\n    }\n    if (def.type === \"record\" || def.type === \"map\") {\n        return isTransforming(def.keyType, ctx) || isTransforming(def.valueType, ctx);\n    }\n    if (def.type === \"pipe\") {\n        if (_schema._zod.traits.has(\"$ZodCodec\"))\n            return true;\n        return isTransforming(def.in, ctx) || isTransforming(def.out, ctx);\n    }\n    if (def.type === \"object\") {\n        for (const key in def.shape) {\n            if (isTransforming(def.shape[key], ctx))\n                return true;\n        }\n        return false;\n    }\n    if (def.type === \"union\") {\n        for (const option of def.options) {\n            if (isTransforming(option, ctx))\n                return true;\n        }\n        return false;\n    }\n    if (def.type === \"tuple\") {\n        for (const item of def.items) {\n            if (isTransforming(item, ctx))\n                return true;\n        }\n        if (def.rest && isTransforming(def.rest, ctx))\n            return true;\n        return false;\n    }\n    return false;\n}\n/**\n * Creates a toJSONSchema method for a schema instance.\n * This encapsulates the logic of initializing context, processing, extracting defs, and finalizing.\n */\nexport const createToJSONSchemaMethod = (schema, processors = {}) => (params) => {\n    const ctx = initializeContext({ ...params, processors });\n    process(schema, ctx);\n    extractDefs(ctx, schema);\n    return finalize(ctx, schema);\n};\nexport const createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params) => {\n    const { libraryOptions, target } = params ?? {};\n    const ctx = initializeContext({ ...(libraryOptions ?? {}), target, io, processors });\n    process(schema, ctx);\n    extractDefs(ctx, schema);\n    return finalize(ctx, schema);\n};\n","import * as regexes from \"./regexes.js\";\nimport { extractDefs, finalize, handleUnrepresentable, initializeContext, process, } from \"./to-json-schema.js\";\nimport { assignProp, getEnumValues } from \"./util.js\";\nconst formatMap = {\n    guid: \"uuid\",\n    url: \"uri\",\n    datetime: \"date-time\",\n    json_string: \"json-string\",\n    regex: \"\", // do not set\n};\n// ==================== SIMPLE TYPE PROCESSORS ====================\nexport const stringProcessor = (schema, ctx, _json, _params) => {\n    const json = _json;\n    json.type = \"string\";\n    const { minimum, maximum, format, patterns, contentEncoding, laxFormat } = schema._zod\n        .bag;\n    if (typeof minimum === \"number\")\n        json.minLength = minimum;\n    if (typeof maximum === \"number\")\n        json.maxLength = maximum;\n    // custom pattern overrides format\n    if (format) {\n        json.format = formatMap[format] ?? format;\n        if (json.format === \"\")\n            delete json.format; // empty format is not valid\n        // `z.iso.time()` is never full-time, and `laxFormat` carries the datetime shapes that also accept what their keyword forbids\n        if (format === \"time\" || laxFormat) {\n            delete json.format;\n        }\n    }\n    if (contentEncoding)\n        json.contentEncoding = contentEncoding;\n    if (patterns && patterns.size > 0) {\n        const patternList = [...patterns];\n        if (patternList.length === 1)\n            json.pattern = patternList[0].source;\n        else if (patternList.length > 1) {\n            json.allOf = [\n                ...patternList.map((regex) => ({\n                    ...(ctx.target === \"draft-07\" || ctx.target === \"draft-04\" || ctx.target === \"openapi-3.0\"\n                        ? { type: \"string\" }\n                        : {}),\n                    pattern: regex.source,\n                })),\n            ];\n        }\n    }\n};\nexport const numberProcessor = (schema, ctx, _json, params) => {\n    const json = _json;\n    const { minimum, maximum, format, multipleOf, exclusiveMaximum, exclusiveMinimum } = schema._zod.bag;\n    if (typeof format === \"string\" && format.includes(\"int\"))\n        json.type = \"integer\";\n    else\n        json.type = \"number\";\n    // when both minimum and exclusiveMinimum exist, pick the more restrictive one\n    const exMin = typeof exclusiveMinimum === \"number\" && exclusiveMinimum >= (minimum ?? Number.NEGATIVE_INFINITY);\n    const exMax = typeof exclusiveMaximum === \"number\" && exclusiveMaximum <= (maximum ?? Number.POSITIVE_INFINITY);\n    const legacy = ctx.target === \"draft-04\" || ctx.target === \"openapi-3.0\";\n    if (exMin) {\n        if (legacy) {\n            json.minimum = exclusiveMinimum;\n            json.exclusiveMinimum = true;\n        }\n        else {\n            json.exclusiveMinimum = exclusiveMinimum;\n        }\n    }\n    else if (typeof minimum === \"number\") {\n        json.minimum = minimum;\n    }\n    if (exMax) {\n        if (legacy) {\n            json.maximum = exclusiveMaximum;\n            json.exclusiveMaximum = true;\n        }\n        else {\n            json.exclusiveMaximum = exclusiveMaximum;\n        }\n    }\n    else if (typeof maximum === \"number\") {\n        json.maximum = maximum;\n    }\n    if (typeof multipleOf === \"number\") {\n        // JSON Schema requires a divisor strictly greater than zero, and a non-finite one does not survive JSON at all. A negative divisor accepts exactly what its absolute value accepts, so it still maps; zero, NaN and Infinity have no keyword form.\n        if (Number.isFinite(multipleOf) && multipleOf !== 0)\n            json.multipleOf = Math.abs(multipleOf);\n        else\n            handleUnrepresentable(schema, ctx, json, params, `A multipleOf divisor of ${multipleOf} cannot be represented in JSON Schema`);\n    }\n};\nexport const booleanProcessor = (_schema, _ctx, json, _params) => {\n    json.type = \"boolean\";\n};\nexport const bigintProcessor = (schema, ctx, json, params) => {\n    handleUnrepresentable(schema, ctx, json, params, \"BigInt cannot be represented in JSON Schema\");\n};\nexport const symbolProcessor = (schema, ctx, json, params) => {\n    handleUnrepresentable(schema, ctx, json, params, \"Symbols cannot be represented in JSON Schema\");\n};\nexport const nullProcessor = (_schema, ctx, json, _params) => {\n    if (ctx.target === \"openapi-3.0\") {\n        json.type = \"string\";\n        json.nullable = true;\n        json.enum = [null];\n    }\n    else {\n        json.type = \"null\";\n    }\n};\nexport const undefinedProcessor = (schema, ctx, json, params) => {\n    handleUnrepresentable(schema, ctx, json, params, \"Undefined cannot be represented in JSON Schema\");\n};\nexport const voidProcessor = (schema, ctx, json, params) => {\n    handleUnrepresentable(schema, ctx, json, params, \"Void cannot be represented in JSON Schema\");\n};\nexport const neverProcessor = (_schema, _ctx, json, _params) => {\n    json.not = {};\n};\nexport const anyProcessor = (_schema, _ctx, _json, _params) => {\n    // empty schema accepts anything\n};\nexport const unknownProcessor = (_schema, _ctx, _json, _params) => {\n    // empty schema accepts anything\n};\nexport const dateProcessor = (schema, ctx, json, params) => {\n    handleUnrepresentable(schema, ctx, json, params, \"Date cannot be represented in JSON Schema\");\n};\nexport const enumProcessor = (schema, _ctx, json, _params) => {\n    const def = schema._zod.def;\n    const values = getEnumValues(def.entries);\n    // an empty enum accepts nothing, same as z.never()\n    if (values.length === 0) {\n        json.not = {};\n        return;\n    }\n    // Number enums can have both string and number values\n    if (values.every((v) => typeof v === \"number\"))\n        json.type = \"number\";\n    if (values.every((v) => typeof v === \"string\"))\n        json.type = \"string\";\n    json.enum = values;\n};\nexport const literalProcessor = (schema, ctx, json, params) => {\n    const def = schema._zod.def;\n    // a literal with no values accepts nothing, same as z.never()\n    if (def.values.length === 0) {\n        json.not = {};\n        return;\n    }\n    const vals = [];\n    for (const val of def.values) {\n        if (val === undefined) {\n            // a custom schema replaces the whole literal, so there is nothing left to accumulate\n            if (handleUnrepresentable(schema, ctx, json, params, \"Literal `undefined` cannot be represented in JSON Schema\"))\n                return;\n            // otherwise do not add to vals\n        }\n        else if (typeof val === \"bigint\") {\n            if (handleUnrepresentable(schema, ctx, json, params, \"BigInt literals cannot be represented in JSON Schema\"))\n                return;\n            vals.push(Number(val));\n        }\n        else {\n            vals.push(val);\n        }\n    }\n    if (vals.length === 0) {\n        // do nothing (an undefined literal was stripped)\n    }\n    else if (vals.length === 1) {\n        const val = vals[0];\n        json.type = val === null ? \"null\" : typeof val;\n        if (ctx.target === \"draft-04\" || ctx.target === \"openapi-3.0\") {\n            json.enum = [val];\n        }\n        else {\n            json.const = val;\n        }\n    }\n    else {\n        if (vals.every((v) => typeof v === \"number\"))\n            json.type = \"number\";\n        if (vals.every((v) => typeof v === \"string\"))\n            json.type = \"string\";\n        if (vals.every((v) => typeof v === \"boolean\"))\n            json.type = \"boolean\";\n        if (vals.every((v) => v === null))\n            json.type = \"null\";\n        json.enum = vals;\n    }\n};\nexport const nanProcessor = (schema, ctx, json, params) => {\n    handleUnrepresentable(schema, ctx, json, params, \"NaN cannot be represented in JSON Schema\");\n};\nexport const templateLiteralProcessor = (schema, _ctx, json, _params) => {\n    const _json = json;\n    const pattern = schema._zod.pattern;\n    if (!pattern)\n        throw new Error(\"Pattern not found in template literal\");\n    _json.type = \"string\";\n    _json.pattern = pattern.source;\n};\nexport const fileProcessor = (schema, _ctx, json, _params) => {\n    const _json = json;\n    const file = {\n        type: \"string\",\n        format: \"binary\",\n        contentEncoding: \"binary\",\n    };\n    const { minimum, maximum, mime } = schema._zod.bag;\n    if (minimum !== undefined)\n        file.minLength = minimum;\n    if (maximum !== undefined)\n        file.maxLength = maximum;\n    if (mime) {\n        if (mime.length === 1) {\n            file.contentMediaType = mime[0];\n            Object.assign(_json, file);\n        }\n        else {\n            Object.assign(_json, file); // shared props at root\n            _json.anyOf = mime.map((m) => ({ contentMediaType: m })); // only contentMediaType differs\n        }\n    }\n    else {\n        Object.assign(_json, file);\n    }\n};\nexport const successProcessor = (_schema, _ctx, json, _params) => {\n    json.type = \"boolean\";\n};\nexport const customProcessor = (schema, ctx, json, params) => {\n    handleUnrepresentable(schema, ctx, json, params, \"Custom types cannot be represented in JSON Schema\");\n};\nexport const functionProcessor = (schema, ctx, json, params) => {\n    handleUnrepresentable(schema, ctx, json, params, \"Function types cannot be represented in JSON Schema\");\n};\nexport const transformProcessor = (schema, ctx, json, params) => {\n    handleUnrepresentable(schema, ctx, json, params, \"Transforms cannot be represented in JSON Schema\");\n};\nexport const mapProcessor = (schema, ctx, json, params) => {\n    handleUnrepresentable(schema, ctx, json, params, \"Map cannot be represented in JSON Schema\");\n};\nexport const setProcessor = (schema, ctx, json, params) => {\n    handleUnrepresentable(schema, ctx, json, params, \"Set cannot be represented in JSON Schema\");\n};\n// ==================== COMPOSITE TYPE PROCESSORS ====================\nexport const arrayProcessor = (schema, ctx, _json, params) => {\n    const json = _json;\n    const def = schema._zod.def;\n    const { minimum, maximum } = schema._zod.bag;\n    if (typeof minimum === \"number\")\n        json.minItems = minimum;\n    if (typeof maximum === \"number\")\n        json.maxItems = maximum;\n    json.type = \"array\";\n    json.items = process(def.element, ctx, {\n        ...params,\n        path: [...params.path, \"items\"],\n    });\n};\n// Transform and catch set `optin = \"optional\"` at runtime so the parser lets them observe an\n// absent key, but their declared input type stays required. An input JSON Schema describes the\n// declared type, so resolve past them to the schema that actually carries the optionality.\n// Used by both `objectProcessor` (for `required`) and `tupleProcessor` (for `minItems`); see\n// wiki/optionality.md, \"The JSON Schema emitter reads the *static* value\".\nfunction inputOptin(schema) {\n    const def = schema._zod.def;\n    if (def.type === \"pipe\" && def.in._zod.traits.has(\"$ZodTransform\")) {\n        return inputOptin(def.out);\n    }\n    if (def.type === \"catch\") {\n        return inputOptin(def.innerType);\n    }\n    return schema._zod.optin;\n}\nexport const objectProcessor = (schema, ctx, _json, params) => {\n    const json = _json;\n    const def = schema._zod.def;\n    const shape = def.shape;\n    // dropping it while still emitting `additionalProperties: false` would emit a schema that rejects data this one requires\n    const symbolKeys = Object.getOwnPropertySymbols(shape);\n    if (symbolKeys.length &&\n        handleUnrepresentable(schema, ctx, json, params, \"Symbol keys cannot be represented in JSON Schema\")) {\n        return;\n    }\n    json.type = \"object\";\n    json.properties = {};\n    for (const key in shape) {\n        // assignProp so a __proto__ key becomes an own property instead of hitting the inherited setter on the plain {} we build into\n        assignProp(json.properties, key, process(shape[key], ctx, {\n            ...params,\n            path: [...params.path, \"properties\", key],\n        }));\n    }\n    // required keys\n    const allKeys = new Set(Object.keys(shape));\n    const requiredKeys = new Set([...allKeys].filter((key) => {\n        const field = def.shape[key];\n        if (ctx.io === \"input\") {\n            return inputOptin(field) === undefined;\n        }\n        else {\n            return field._zod.optout === undefined;\n        }\n    }));\n    if (requiredKeys.size > 0) {\n        json.required = Array.from(requiredKeys);\n    }\n    // catchall\n    if (def.catchall?._zod.def.type === \"never\") {\n        // strict\n        json.additionalProperties = false;\n    }\n    else if (!def.catchall) {\n        // regular\n        if (ctx.io === \"output\")\n            json.additionalProperties = false;\n    }\n    else if (def.catchall) {\n        json.additionalProperties = process(def.catchall, ctx, {\n            ...params,\n            path: [...params.path, \"additionalProperties\"],\n        });\n    }\n};\nexport const unionProcessor = (schema, ctx, json, params) => {\n    const def = schema._zod.def;\n    // Exclusive unions (inclusive === false) use oneOf (exactly one match) instead of anyOf (one or more matches). This includes both z.xor() and discriminated unions\n    const isExclusive = def.inclusive === false;\n    const options = def.options.map((x, i) => process(x, ctx, {\n        ...params,\n        path: [...params.path, isExclusive ? \"oneOf\" : \"anyOf\", i],\n    }));\n    if (isExclusive) {\n        json.oneOf = options;\n    }\n    else {\n        json.anyOf = options;\n    }\n};\nexport const intersectionProcessor = (schema, ctx, json, params) => {\n    const def = schema._zod.def;\n    const a = process(def.left, ctx, {\n        ...params,\n        path: [...params.path, \"allOf\", 0],\n    });\n    const b = process(def.right, ctx, {\n        ...params,\n        path: [...params.path, \"allOf\", 1],\n    });\n    const isSimpleIntersection = (val) => \"allOf\" in val && Object.keys(val).length === 1;\n    const allOf = [\n        ...(isSimpleIntersection(a) ? a.allOf : [a]),\n        ...(isSimpleIntersection(b) ? b.allOf : [b]),\n    ];\n    json.allOf = allOf;\n    // Recorded innermost first, so a nested intersection has already folded by the time this one is considered. The array is the handle rather than the schema, because a wrapper that inherits this schema shares the same array; `finalize` folds every object holding it. See `foldIntersection`.\n    ctx.intersections.push(allOf);\n};\nexport const tupleProcessor = (schema, ctx, _json, params) => {\n    const json = _json;\n    const def = schema._zod.def;\n    json.type = \"array\";\n    const prefixPath = ctx.target === \"draft-2020-12\" ? \"prefixItems\" : \"items\";\n    const restPath = ctx.target === \"draft-2020-12\" ? \"items\" : ctx.target === \"openapi-3.0\" ? \"items\" : \"additionalItems\";\n    const prefixItems = def.items.map((x, i) => process(x, ctx, {\n        ...params,\n        path: [...params.path, prefixPath, i],\n    }));\n    const rest = def.rest\n        ? process(def.rest, ctx, {\n            ...params,\n            path: [...params.path, restPath, ...(ctx.target === \"openapi-3.0\" ? [def.items.length] : [])],\n        })\n        : null;\n    let minItems = def.items.length;\n    while (minItems > 0) {\n        const item = def.items[minItems - 1];\n        const optional = ctx.io === \"input\" ? inputOptin(item) !== undefined : item._zod.optout === \"optional\";\n        if (!optional)\n            break;\n        minItems--;\n    }\n    const maxItems = def.items.length;\n    const isClosed = !def.rest;\n    if (ctx.target === \"draft-2020-12\") {\n        json.prefixItems = prefixItems;\n        if (isClosed) {\n            json.items = false;\n        }\n        else if (rest) {\n            json.items = rest;\n        }\n        if (minItems > 0)\n            json.minItems = minItems;\n        if (isClosed)\n            json.maxItems = maxItems;\n    }\n    else if (ctx.target === \"openapi-3.0\") {\n        json.items = {\n            anyOf: prefixItems,\n        };\n        if (rest) {\n            json.items.anyOf.push(rest);\n        }\n        if (minItems > 0)\n            json.minItems = minItems;\n        if (isClosed)\n            json.maxItems = maxItems;\n    }\n    else {\n        json.items = prefixItems;\n        if (isClosed) {\n            json.additionalItems = false;\n        }\n        else if (rest) {\n            json.additionalItems = rest;\n        }\n        if (minItems > 0)\n            json.minItems = minItems;\n        if (isClosed)\n            json.maxItems = maxItems;\n    }\n    // explicit user-defined length checks take precedence\n    const { minimum, maximum } = schema._zod.bag;\n    if (typeof minimum === \"number\")\n        json.minItems = minimum;\n    if (typeof maximum === \"number\")\n        json.maxItems = maximum;\n};\n/** JSON object keys are always strings, so a numeric record key schema is re-expressed over the\n * numeric-string form the record parser matches. Deferred to `finalize`, after the flatten: a key\n * behind a wrapper only carries its own `type` before then, and a union key only has its branches.\n *\n * A numeric bound cannot apply to a property name, so `minimum` and its siblings are dropped rather\n * than carried over: keeping them beside `type: \"string\"` reproduces the match-nothing schema this\n * exists to fix. A key that carries one therefore emits wider than the record parses — `z.record(z.number().min(5), V)`\n * accepts `\"3\"` — which is the deliberate trade, since throwing on it would reject an ordinary schema\n * outright. */\nfunction stringifyKeyNames(bySchema, json, visited) {\n    // an extracted key that rewrites cannot go on sharing its definition — the string form a key position needs is not the number form every other reference wants — so it inlines. One that does not rewrite keeps the `$ref`.\n    if (json.$ref) {\n        // a recursive key holds its own reference inside its definition, so a node already on the path is left alone rather than resolved again\n        if (visited.has(json))\n            return json;\n        visited.add(json);\n        const def = bySchema.get(json)?.def;\n        if (!def)\n            return json;\n        const inlined = stringifyKeyNames(bySchema, def, visited);\n        return inlined === def ? json : inlined;\n    }\n    for (const keyword of [\"anyOf\", \"oneOf\"]) {\n        const branches = json[keyword];\n        if (!Array.isArray(branches))\n            continue;\n        const mapped = branches.map((branch) => stringifyKeyNames(bySchema, branch, visited));\n        // rebuilding regardless would detach a key that had nothing to re-express, dropping its `$ref` and leaking the internal `id`\n        if (mapped.some((branch, i) => branch !== branches[i]))\n            json = { ...json, [keyword]: mapped };\n    }\n    // a member that already admits a string leaves the key unconstrained, so the node's own type re-expresses only when every member is numeric\n    const types = Array.isArray(json.type) ? json.type : [json.type];\n    const numericType = !types.includes(\"string\") && types.some((t) => t === \"number\" || t === \"integer\");\n    // a heterogeneous key carries no type at all, so its numeric members are caught here instead\n    const values = json.enum ?? (json.const !== undefined ? [json.const] : undefined);\n    if (!numericType && !values?.some((v) => typeof v === \"number\"))\n        return json;\n    const { minimum, maximum, exclusiveMinimum, exclusiveMaximum, multipleOf, format, id, ...rest } = json;\n    if (rest.enum)\n        rest.enum = rest.enum.map((v) => (typeof v === \"number\" ? String(v) : v));\n    else if (typeof rest.const === \"number\")\n        rest.const = String(rest.const);\n    // a heterogeneous key keeps its absent type: the stringified members already say what a key may be\n    if (!numericType)\n        return rest;\n    rest.type = \"string\";\n    if (!values)\n        rest.pattern = (types.includes(\"number\") ? regexes.number : regexes.integer).source;\n    return rest;\n}\n/** Every record of one conversion, so the carriers are found in a single pass rather than once per record. */\nconst pendingRecords = new WeakMap();\nfunction rewriteKeyNames(ctx) {\n    // an extracted key is resolved by the object `extractToDef` left in its place, so the map is built once rather than searched per reference. `_zod.toJSONSchema` can hand the same object to two schemas, so the first entry carrying a body wins, as a search would have found it.\n    const bySchema = new Map();\n    for (const entry of ctx.seen.values()) {\n        if (entry.def && !bySchema.has(entry.schema))\n            bySchema.set(entry.schema, entry);\n    }\n    const rewrites = new Map();\n    for (const record of pendingRecords.get(ctx) ?? []) {\n        const seen = ctx.seen.get(record);\n        const names = (seen?.def ?? seen?.schema)?.propertyNames;\n        if (!names || names === true || rewrites.has(names))\n            continue;\n        const rewritten = stringifyKeyNames(bySchema, names, new Set());\n        if (rewritten !== names)\n            rewrites.set(names, rewritten);\n    }\n    if (!rewrites.size)\n        return;\n    // the flatten has already copied each record's own properties onto every wrapper by reference, and an extracted body is another such copy, so every carrier holding a rewritten key is updated together\n    for (const entry of ctx.seen.values()) {\n        for (const carrier of [entry.schema, entry.def]) {\n            const rewritten = carrier && rewrites.get(carrier.propertyNames);\n            if (rewritten)\n                carrier.propertyNames = rewritten;\n        }\n    }\n}\nexport const recordProcessor = (schema, ctx, _json, params) => {\n    const json = _json;\n    const def = schema._zod.def;\n    json.type = \"object\";\n    // For looseRecord with regex patterns, use patternProperties. This correctly represents \"only validate keys matching the pattern\" semantics and composes well with allOf (intersections)\n    const keyType = def.keyType;\n    const keyBag = keyType._zod.bag;\n    const patterns = keyBag?.patterns;\n    if (def.mode === \"loose\" && patterns && patterns.size > 0) {\n        // Use patternProperties for looseRecord with regex patterns\n        const valueSchema = process(def.valueType, ctx, {\n            ...params,\n            path: [...params.path, \"patternProperties\", \"*\"],\n        });\n        json.patternProperties = {};\n        for (const pattern of patterns) {\n            assignProp(json.patternProperties, pattern.source, valueSchema);\n        }\n    }\n    else {\n        // Default behavior: use propertyNames + additionalProperties\n        if (ctx.target === \"draft-07\" || ctx.target === \"draft-2020-12\") {\n            json.propertyNames = process(def.keyType, ctx, {\n                ...params,\n                path: [...params.path, \"propertyNames\"],\n            });\n            let pending = pendingRecords.get(ctx);\n            if (!pending) {\n                pending = [];\n                pendingRecords.set(ctx, pending);\n                ctx.deferred.push(() => rewriteKeyNames(ctx));\n            }\n            pending.push(schema);\n        }\n        json.additionalProperties = process(def.valueType, ctx, {\n            ...params,\n            path: [...params.path, \"additionalProperties\"],\n        });\n    }\n    // Add required for keys with discrete values (enum, literal, etc.)\n    const keyValues = keyType._zod.values;\n    // Every key shares one value schema, so an optional-in value makes the whole key set omittable on input. Output keeps them: the exhaustive branch assigns every key, even one whose value came back undefined.\n    const omittableOnInput = ctx.io === \"input\" && inputOptin(def.valueType) !== undefined;\n    if (keyValues && !def.partial && !omittableOnInput) {\n        const validKeyValues = [...keyValues].filter((v) => typeof v === \"string\" || typeof v === \"number\");\n        if (validKeyValues.length > 0) {\n            json.required = validKeyValues.map(String);\n        }\n    }\n};\nexport const nullableProcessor = (schema, ctx, json, params) => {\n    const def = schema._zod.def;\n    const inner = process(def.innerType, ctx, params);\n    const seen = ctx.seen.get(schema);\n    if (ctx.target === \"openapi-3.0\") {\n        seen.ref = def.innerType;\n        json.nullable = true;\n    }\n    else {\n        json.anyOf = [inner, { type: \"null\" }];\n    }\n};\nexport const nonoptionalProcessor = (schema, ctx, _json, params) => {\n    const def = schema._zod.def;\n    process(def.innerType, ctx, params);\n    const seen = ctx.seen.get(schema);\n    seen.ref = def.innerType;\n};\n/** Round-trips a default value through JSON so the emitted schema is guaranteed to be valid JSON.\n * A BigInt has no reliable encoding, so it goes through `unrepresentable` like any other\n * unrepresentable value. Returns a sentinel when the caller must not write a default of its own. */\nconst UNREPRESENTABLE_DEFAULT = Symbol();\nfunction serializeDefaultValue(value, schema, ctx, json, params) {\n    let unrepresentable = false;\n    const serialized = JSON.stringify(value, (_, val) => {\n        if (typeof val !== \"bigint\")\n            return val;\n        unrepresentable = true;\n        return null;\n    });\n    if (!unrepresentable)\n        return JSON.parse(serialized);\n    handleUnrepresentable(schema, ctx, json, params, \"BigInt defaults cannot be represented in JSON Schema\");\n    return UNREPRESENTABLE_DEFAULT;\n}\nexport const defaultProcessor = (schema, ctx, json, params) => {\n    const def = schema._zod.def;\n    process(def.innerType, ctx, params);\n    const seen = ctx.seen.get(schema);\n    seen.ref = def.innerType;\n    const value = serializeDefaultValue(def.defaultValue, schema, ctx, json, params);\n    if (value !== UNREPRESENTABLE_DEFAULT)\n        json.default = value;\n};\nexport const prefaultProcessor = (schema, ctx, json, params) => {\n    const def = schema._zod.def;\n    process(def.innerType, ctx, params);\n    const seen = ctx.seen.get(schema);\n    seen.ref = def.innerType;\n    if (ctx.io !== \"input\")\n        return;\n    const value = serializeDefaultValue(def.defaultValue, schema, ctx, json, params);\n    if (value !== UNREPRESENTABLE_DEFAULT)\n        json._prefault = value;\n};\nexport const catchProcessor = (schema, ctx, json, params) => {\n    const def = schema._zod.def;\n    process(def.innerType, ctx, params);\n    const seen = ctx.seen.get(schema);\n    seen.ref = def.innerType;\n    let catchValue;\n    try {\n        catchValue = def.catchValue(undefined);\n    }\n    catch {\n        handleUnrepresentable(schema, ctx, json, params, \"Dynamic catch values are not supported in JSON Schema\");\n        return;\n    }\n    json.default = catchValue;\n};\nexport const pipeProcessor = (schema, ctx, _json, params) => {\n    const def = schema._zod.def;\n    const inIsTransform = def.in._zod.traits.has(\"$ZodTransform\");\n    const innerType = ctx.io === \"input\" ? (inIsTransform ? def.out : def.in) : def.out;\n    process(innerType, ctx, params);\n    const seen = ctx.seen.get(schema);\n    seen.ref = innerType;\n};\nexport const readonlyProcessor = (schema, ctx, json, params) => {\n    const def = schema._zod.def;\n    process(def.innerType, ctx, params);\n    const seen = ctx.seen.get(schema);\n    seen.ref = def.innerType;\n    json.readOnly = true;\n};\nexport const promiseProcessor = (schema, ctx, _json, params) => {\n    const def = schema._zod.def;\n    process(def.innerType, ctx, params);\n    const seen = ctx.seen.get(schema);\n    seen.ref = def.innerType;\n};\nexport const optionalProcessor = (schema, ctx, _json, params) => {\n    const def = schema._zod.def;\n    process(def.innerType, ctx, params);\n    const seen = ctx.seen.get(schema);\n    seen.ref = def.innerType;\n};\nexport const lazyProcessor = (schema, ctx, _json, params) => {\n    const innerType = schema._zod.innerType;\n    process(innerType, ctx, params);\n    const seen = ctx.seen.get(schema);\n    seen.ref = innerType;\n};\n// ==================== ALL PROCESSORS ====================\nexport const allProcessors = {\n    string: stringProcessor,\n    number: numberProcessor,\n    boolean: booleanProcessor,\n    bigint: bigintProcessor,\n    symbol: symbolProcessor,\n    null: nullProcessor,\n    undefined: undefinedProcessor,\n    void: voidProcessor,\n    never: neverProcessor,\n    any: anyProcessor,\n    unknown: unknownProcessor,\n    date: dateProcessor,\n    enum: enumProcessor,\n    literal: literalProcessor,\n    nan: nanProcessor,\n    template_literal: templateLiteralProcessor,\n    file: fileProcessor,\n    success: successProcessor,\n    custom: customProcessor,\n    function: functionProcessor,\n    transform: transformProcessor,\n    map: mapProcessor,\n    set: setProcessor,\n    array: arrayProcessor,\n    object: objectProcessor,\n    union: unionProcessor,\n    intersection: intersectionProcessor,\n    tuple: tupleProcessor,\n    record: recordProcessor,\n    nullable: nullableProcessor,\n    nonoptional: nonoptionalProcessor,\n    default: defaultProcessor,\n    prefault: prefaultProcessor,\n    catch: catchProcessor,\n    pipe: pipeProcessor,\n    readonly: readonlyProcessor,\n    promise: promiseProcessor,\n    optional: optionalProcessor,\n    lazy: lazyProcessor,\n};\nexport function toJSONSchema(input, params) {\n    if (\"_idmap\" in input) {\n        // Registry case\n        const registry = input;\n        const ctx = initializeContext({ ...params, processors: allProcessors });\n        const defs = {};\n        // First pass: process all schemas to build the seen map\n        for (const entry of registry._idmap.entries()) {\n            const [_, schema] = entry;\n            process(schema, ctx);\n        }\n        const schemas = {};\n        const external = {\n            registry,\n            uri: params?.uri,\n            defs,\n        };\n        // Update the context with external configuration\n        ctx.external = external;\n        // Second pass: emit each schema\n        for (const entry of registry._idmap.entries()) {\n            const [key, schema] = entry;\n            extractDefs(ctx, schema);\n            assignProp(schemas, key, finalize(ctx, schema));\n        }\n        if (Object.keys(defs).length > 0) {\n            const defsSegment = ctx.target === \"draft-2020-12\" ? \"$defs\" : \"definitions\";\n            schemas.__shared = {\n                [defsSegment]: defs,\n            };\n        }\n        return { schemas };\n    }\n    // Single schema case\n    const ctx = initializeContext({ ...params, processors: allProcessors });\n    process(input, ctx);\n    extractDefs(ctx, input);\n    return finalize(ctx, input);\n}\n","import * as core from \"../core/index.js\";\nimport { $ZodError } from \"../core/index.js\";\nimport * as util from \"../core/util.js\";\n/* Prototypes that already carry the lazy helper methods. Seeded with the\n * intrinsics so that `init` on a foreign object — it accepts any object —\n * can never install an accessor onto a prototype we do not own. */\nconst _installedErrorProtos = /* @__PURE__ */ new WeakSet([Object.prototype, Error.prototype]);\n/* Helper methods live as non-enumerable lazy getters on the shared\n * prototype instead of own properties on every instance. On first\n * access the getter allocates the per-instance closure and caches it\n * as a non-enumerable own property, so detached usage still works and\n * the allocation only happens for methods actually touched. */\nfunction _lazyMethod(proto, key, make) {\n    Object.defineProperty(proto, key, {\n        configurable: true,\n        enumerable: false,\n        get() {\n            const value = make(this);\n            Object.defineProperty(this, key, { value, configurable: true, writable: true });\n            return value;\n        },\n        set(value) {\n            Object.defineProperty(this, key, { value, configurable: true, writable: true });\n        },\n    });\n}\nconst initializer = (inst, issues) => {\n    $ZodError.init(inst, issues);\n    inst.name = \"ZodError\";\n    const proto = Object.getPrototypeOf(inst);\n    if (_installedErrorProtos.has(proto))\n        return;\n    _installedErrorProtos.add(proto);\n    _lazyMethod(proto, \"format\", (self) => (mapper) => core.formatError(self, mapper));\n    _lazyMethod(proto, \"flatten\", (self) => (mapper) => core.flattenError(self, mapper));\n    _lazyMethod(proto, \"addIssue\", (self) => (issue) => {\n        self.issues.push(issue);\n        self.message = JSON.stringify(self.issues, util.jsonStringifyReplacer, 2);\n    });\n    _lazyMethod(proto, \"addIssues\", (self) => (issues) => {\n        self.issues.push(...issues);\n        self.message = JSON.stringify(self.issues, util.jsonStringifyReplacer, 2);\n    });\n    Object.defineProperty(proto, \"isEmpty\", {\n        configurable: true,\n        enumerable: false,\n        get() {\n            return this.issues.length === 0;\n        },\n    });\n};\nexport const ZodError = /*@__PURE__*/ core.$constructor(\"ZodError\", initializer);\nexport const ZodRealError = /*@__PURE__*/ core.$constructor(\"ZodError\", initializer, undefined, {\n    Parent: Error,\n});\n// /** @deprecated Use `z.core.$ZodErrorMapCtx` instead. */\n// export type ErrorMapCtx = core.$ZodErrorMapCtx;\n","import * as core from \"../core/index.js\";\nimport { ZodRealError } from \"./errors.js\";\nexport const parse = /* @__PURE__ */ core._parse(ZodRealError);\nexport const parseAsync = /* @__PURE__ */ core._parseAsync(ZodRealError);\nexport const safeParse = /* @__PURE__ */ core._safeParse(ZodRealError);\nexport const safeParseAsync = /* @__PURE__ */ core._safeParseAsync(ZodRealError);\nexport { validate, validateAsync } from \"../core/index.js\";\n// Codec functions\nexport const encode = /* @__PURE__ */ core._encode(ZodRealError);\nexport const decode = /* @__PURE__ */ core._decode(ZodRealError);\nexport const encodeAsync = /* @__PURE__ */ core._encodeAsync(ZodRealError);\nexport const decodeAsync = /* @__PURE__ */ core._decodeAsync(ZodRealError);\nexport const safeEncode = /* @__PURE__ */ core._safeEncode(ZodRealError);\nexport const safeDecode = /* @__PURE__ */ core._safeDecode(ZodRealError);\nexport const safeEncodeAsync = /* @__PURE__ */ core._safeEncodeAsync(ZodRealError);\nexport const safeDecodeAsync = /* @__PURE__ */ core._safeDecodeAsync(ZodRealError);\n","import * as core from \"../core/index.js\";\nimport { util } from \"../core/index.js\";\nimport * as processors from \"../core/json-schema-processors.js\";\nimport { createStandardJSONSchemaMethod, createToJSONSchemaMethod } from \"../core/to-json-schema.js\";\nimport en from \"../locales/en.js\";\nimport * as checks from \"./checks.js\";\nimport * as parse from \"./parse.js\";\n// Register English as the default locale on first ZodType construction. Hooked into the `ZodType` `$constructor` (rather than a top-level `config(en())` in `external.ts`) so bundlers honoring `sideEffects: false` can't tree-shake it out — see #5953, #5725. An explicit `z.config(z.locales.xx())` call wins regardless of order, since this only sets the default when none is present.\nfunction _ensureDefaultLocale() {\n    if (!core.globalConfig.localeError)\n        core.config(en());\n}\n// the default memoizer is read by the core container init, which runs before `ZodType.init`, so each container calls this first\nfunction _ensureDefaultMemoizer() {\n    if (!core.globalConfig.memoizer)\n        core.config({ memoizer: core.memoizer() });\n}\nexport const ZodType = /*@__PURE__*/ core.$constructor(\"ZodType\", (inst, def) => {\n    _ensureDefaultLocale();\n    core.$ZodType.init(inst, def);\n    inst.def = def;\n    inst.type = def.type;\n    return inst;\n}, {\n    check(...chks) {\n        const def = this.def;\n        return this.clone(util.mergeDefs(def, {\n            checks: [\n                ...(def.checks ?? []),\n                ...chks.map((ch) => typeof ch === \"function\" ? { _zod: { check: ch, def: { check: \"custom\" }, onattach: [] } } : ch),\n            ],\n        }), { parent: true });\n    },\n    with(...chks) {\n        return this.check(...chks);\n    },\n    clone(def, params) {\n        return core.clone(this, def, params);\n    },\n    brand() {\n        return this;\n    },\n    register(reg, meta) {\n        reg.add(this, meta);\n        return this;\n    },\n    refine(check, params) {\n        return this.check(refine(check, params));\n    },\n    superRefine(refinement, params) {\n        return this.check(superRefine(refinement, params));\n    },\n    overwrite(fn) {\n        return this.check(checks.overwrite(fn));\n    },\n    optional() {\n        return optional(this);\n    },\n    exactOptional() {\n        return exactOptional(this);\n    },\n    nullable() {\n        return nullable(this);\n    },\n    nullish() {\n        return optional(nullable(this));\n    },\n    nonoptional(params) {\n        return nonoptional(this, params);\n    },\n    array() {\n        return array(this);\n    },\n    or(arg) {\n        return union([this, arg]);\n    },\n    and(arg) {\n        return intersection(this, arg);\n    },\n    transform(tx) {\n        return pipe(this, transform(tx));\n    },\n    default(d) {\n        return _default(this, d);\n    },\n    prefault(d) {\n        return prefault(this, d);\n    },\n    catch(params) {\n        return _catch(this, params);\n    },\n    pipe(target) {\n        return pipe(this, target);\n    },\n    readonly() {\n        return readonly(this);\n    },\n    describe(description) {\n        const cl = this.clone();\n        core.globalRegistry.add(cl, { description });\n        return cl;\n    },\n    meta(...args) {\n        // overloaded: meta() returns the registered metadata, meta(data) returns a clone with `data` registered. The mapped type picks up the second overload, so we accept variadic any-args and return `any` to satisfy both at runtime.\n        if (args.length === 0)\n            return core.globalRegistry.get(this);\n        const cl = this.clone();\n        core.globalRegistry.add(cl, args[0]);\n        return cl;\n    },\n    isOptional() {\n        return this.safeParse(undefined).success;\n    },\n    isNullable() {\n        return this.safeParse(null).success;\n    },\n    apply(fn, ...args) {\n        return args.length === 0 ? fn(this) : fn(this, ...args);\n    },\n    // Overrides core's `~standard` to add `jsonSchema`. Must stay a prototype entry: redefining it per instance demotes instances to dictionary mode.\n    get \"~standard\"() {\n        return util.hide(this, \"~standard\", {\n            ...core.standardProps(this),\n            jsonSchema: {\n                input: createStandardJSONSchemaMethod(this, \"input\"),\n                output: createStandardJSONSchemaMethod(this, \"output\"),\n            },\n        });\n    },\n    set \"~standard\"(value) {\n        util.own(this, \"~standard\", value);\n    },\n    parse: function _parse(data, params) {\n        return parse.parse(this, data, params, { callee: _parse });\n    },\n    parseAsync: async function _parseAsync(data, params) {\n        return await parse.parseAsync(this, data, params, { callee: _parseAsync });\n    },\n    safeParse(data, params) {\n        return parse.safeParse(this, data, params);\n    },\n    async safeParseAsync(data, params) {\n        return parse.safeParseAsync(this, data, params);\n    },\n    // `spa` is an alias: same function object as `safeParseAsync`, as before.\n    get spa() {\n        return this?.safeParseAsync;\n    },\n    set spa(value) {\n        util.own(this, \"spa\", value);\n    },\n    encode: function _encode(data, params) {\n        return parse.encode(this, data, params, { callee: _encode });\n    },\n    decode: function _decode(data, params) {\n        return parse.decode(this, data, params, { callee: _decode });\n    },\n    encodeAsync: async function _encodeAsync(data, params) {\n        return await parse.encodeAsync(this, data, params, { callee: _encodeAsync });\n    },\n    decodeAsync: async function _decodeAsync(data, params) {\n        return await parse.decodeAsync(this, data, params, { callee: _decodeAsync });\n    },\n    safeEncode(data, params) {\n        return parse.safeEncode(this, data, params);\n    },\n    safeDecode(data, params) {\n        return parse.safeDecode(this, data, params);\n    },\n    async safeEncodeAsync(data, params) {\n        return parse.safeEncodeAsync(this, data, params);\n    },\n    async safeDecodeAsync(data, params) {\n        return parse.safeDecodeAsync(this, data, params);\n    },\n    toJSONSchema(params) {\n        return createToJSONSchemaMethod(this, {})(params);\n    },\n    // Reads through to the registry on every access, so it must not cache.\n    get description() {\n        return core.globalRegistry.get(this)?.description;\n    },\n    // No setter: `schema._def = x` throws, as it did when `_def` was a non-writable own property.\n    get _def() {\n        return this._zod.def;\n    },\n});\n/** @internal */\nexport const _ZodString = /*@__PURE__*/ core.$constructor(\"_ZodString\", (inst, def) => {\n    core.$ZodString.init(inst, def);\n    ZodType.init(inst, def);\n    inst._zod.processJSONSchema = (ctx, json, params) => processors.stringProcessor(inst, ctx, json, params);\n    const bag = inst._zod.bag;\n    inst.format = bag.format ?? null;\n    inst.minLength = bag.minimum ?? null;\n    inst.maxLength = bag.maximum ?? null;\n}, {\n    regex(...args) {\n        return this.check(checks.regex(...args));\n    },\n    includes(...args) {\n        return this.check(checks.includes(...args));\n    },\n    startsWith(...args) {\n        return this.check(checks.startsWith(...args));\n    },\n    endsWith(...args) {\n        return this.check(checks.endsWith(...args));\n    },\n    min(...args) {\n        return this.check(checks.minLength(...args));\n    },\n    max(...args) {\n        return this.check(checks.maxLength(...args));\n    },\n    length(...args) {\n        return this.check(checks.length(...args));\n    },\n    nonempty(...args) {\n        return this.check(checks.minLength(1, ...args));\n    },\n    lowercase(params) {\n        return this.check(checks.lowercase(params));\n    },\n    uppercase(params) {\n        return this.check(checks.uppercase(params));\n    },\n    trim() {\n        return this.check(checks.trim());\n    },\n    normalize(...args) {\n        return this.check(checks.normalize(...args));\n    },\n    toLowerCase() {\n        return this.check(checks.toLowerCase());\n    },\n    toUpperCase() {\n        return this.check(checks.toUpperCase());\n    },\n    slugify() {\n        return this.check(checks.slugify());\n    },\n});\nexport const ZodString = /*@__PURE__*/ core.$constructor(\"ZodString\", (inst, def) => {\n    core.$ZodString.init(inst, def);\n    _ZodString.init(inst, def);\n}, {\n    email(params) {\n        return this.check(core._email(ZodEmail, params));\n    },\n    url(params) {\n        return this.check(core._url(ZodURL, params));\n    },\n    jwt(params) {\n        return this.check(core._jwt(ZodJWT, params));\n    },\n    emoji(params) {\n        return this.check(core._emoji(ZodEmoji, params));\n    },\n    guid(params) {\n        return this.check(core._guid(ZodGUID, params));\n    },\n    uuid(params) {\n        return this.check(core._uuid(ZodUUID, params));\n    },\n    uuidv4(params) {\n        return this.check(core._uuidv4(ZodUUID, params));\n    },\n    uuidv6(params) {\n        return this.check(core._uuidv6(ZodUUID, params));\n    },\n    uuidv7(params) {\n        return this.check(core._uuidv7(ZodUUID, params));\n    },\n    nanoid(params) {\n        return this.check(core._nanoid(ZodNanoID, params));\n    },\n    cuid(params) {\n        return this.check(core._cuid(ZodCUID, params));\n    },\n    cuid2(params) {\n        return this.check(core._cuid2(ZodCUID2, params));\n    },\n    ulid(params) {\n        return this.check(core._ulid(ZodULID, params));\n    },\n    base64(params) {\n        return this.check(core._base64(ZodBase64, params));\n    },\n    base64url(params) {\n        return this.check(core._base64url(ZodBase64URL, params));\n    },\n    xid(params) {\n        return this.check(core._xid(ZodXID, params));\n    },\n    ksuid(params) {\n        return this.check(core._ksuid(ZodKSUID, params));\n    },\n    ipv4(params) {\n        return this.check(core._ipv4(ZodIPv4, params));\n    },\n    ipv6(params) {\n        return this.check(core._ipv6(ZodIPv6, params));\n    },\n    cidrv4(params) {\n        return this.check(core._cidrv4(ZodCIDRv4, params));\n    },\n    cidrv6(params) {\n        return this.check(core._cidrv6(ZodCIDRv6, params));\n    },\n    e164(params) {\n        return this.check(core._e164(ZodE164, params));\n    },\n    datetime(params) {\n        return this.check(core._isoDateTime(ZodISODateTime, params));\n    },\n    date(params) {\n        return this.check(core._isoDate(ZodISODate, params));\n    },\n    time(params) {\n        return this.check(core._isoTime(ZodISOTime, params));\n    },\n    duration(params) {\n        return this.check(core._isoDuration(ZodISODuration, params));\n    },\n});\nexport function string(params) {\n    return core._string(ZodString, params);\n}\nexport const ZodStringFormat = /*@__PURE__*/ core.$constructor(\"ZodStringFormat\", (inst, def) => {\n    core.$ZodStringFormat.init(inst, def);\n    _ZodString.init(inst, def);\n});\nexport const ZodISODateTime = /*@__PURE__*/ core.$constructor(\"ZodISODateTime\", (inst, def) => {\n    core.$ZodISODateTime.init(inst, def);\n    ZodStringFormat.init(inst, def);\n});\nexport const ZodISODate = /*@__PURE__*/ core.$constructor(\"ZodISODate\", (inst, def) => {\n    core.$ZodISODate.init(inst, def);\n    ZodStringFormat.init(inst, def);\n});\nexport const ZodISOTime = /*@__PURE__*/ core.$constructor(\"ZodISOTime\", (inst, def) => {\n    core.$ZodISOTime.init(inst, def);\n    ZodStringFormat.init(inst, def);\n});\nexport const ZodISODuration = /*@__PURE__*/ core.$constructor(\"ZodISODuration\", (inst, def) => {\n    core.$ZodISODuration.init(inst, def);\n    ZodStringFormat.init(inst, def);\n});\nexport const ZodEmail = /*@__PURE__*/ core.$constructor(\"ZodEmail\", (inst, def) => {\n    // ZodStringFormat.init(inst, def);\n    core.$ZodEmail.init(inst, def);\n    ZodStringFormat.init(inst, def);\n});\nexport function email(params) {\n    return core._email(ZodEmail, params);\n}\nexport const ZodGUID = /*@__PURE__*/ core.$constructor(\"ZodGUID\", (inst, def) => {\n    // ZodStringFormat.init(inst, def);\n    core.$ZodGUID.init(inst, def);\n    ZodStringFormat.init(inst, def);\n});\nexport function guid(params) {\n    return core._guid(ZodGUID, params);\n}\nexport const ZodUUID = /*@__PURE__*/ core.$constructor(\"ZodUUID\", (inst, def) => {\n    // ZodStringFormat.init(inst, def);\n    core.$ZodUUID.init(inst, def);\n    ZodStringFormat.init(inst, def);\n});\nexport function uuid(params) {\n    return core._uuid(ZodUUID, params);\n}\nexport function uuidv4(params) {\n    return core._uuidv4(ZodUUID, params);\n}\n// ZodUUIDv6\nexport function uuidv6(params) {\n    return core._uuidv6(ZodUUID, params);\n}\n// ZodUUIDv7\nexport function uuidv7(params) {\n    return core._uuidv7(ZodUUID, params);\n}\nexport const ZodURL = /*@__PURE__*/ core.$constructor(\"ZodURL\", (inst, def) => {\n    // ZodStringFormat.init(inst, def);\n    core.$ZodURL.init(inst, def);\n    ZodStringFormat.init(inst, def);\n});\nexport function url(params) {\n    return core._url(ZodURL, params);\n}\nexport function httpUrl(params) {\n    return core._url(ZodURL, {\n        protocol: core.regexes.httpProtocol,\n        hostname: core.regexes.domain,\n        ...util.normalizeParams(params),\n    });\n}\nexport const ZodEmoji = /*@__PURE__*/ core.$constructor(\"ZodEmoji\", (inst, def) => {\n    // ZodStringFormat.init(inst, def);\n    core.$ZodEmoji.init(inst, def);\n    ZodStringFormat.init(inst, def);\n});\nexport function emoji(params) {\n    return core._emoji(ZodEmoji, params);\n}\nexport const ZodNanoID = /*@__PURE__*/ core.$constructor(\"ZodNanoID\", (inst, def) => {\n    // ZodStringFormat.init(inst, def);\n    core.$ZodNanoID.init(inst, def);\n    ZodStringFormat.init(inst, def);\n});\nexport function nanoid(params) {\n    return core._nanoid(ZodNanoID, params);\n}\n/**\n * @deprecated CUID v1 is deprecated by its authors due to information leakage\n * (timestamps embedded in the id). Use {@link ZodCUID2} instead.\n * See https://github.com/paralleldrive/cuid.\n */\nexport const ZodCUID = /*@__PURE__*/ core.$constructor(\"ZodCUID\", (inst, def) => {\n    // ZodStringFormat.init(inst, def);\n    core.$ZodCUID.init(inst, def);\n    ZodStringFormat.init(inst, def);\n});\n/**\n * Validates a CUID v1 string.\n *\n * @deprecated CUID v1 is deprecated by its authors due to information leakage\n * (timestamps embedded in the id). Use {@link cuid2 | `z.cuid2()`} instead.\n * See https://github.com/paralleldrive/cuid.\n */\nexport function cuid(params) {\n    return core._cuid(ZodCUID, params);\n}\nexport const ZodCUID2 = /*@__PURE__*/ core.$constructor(\"ZodCUID2\", (inst, def) => {\n    // ZodStringFormat.init(inst, def);\n    core.$ZodCUID2.init(inst, def);\n    ZodStringFormat.init(inst, def);\n});\nexport function cuid2(params) {\n    return core._cuid2(ZodCUID2, params);\n}\nexport const ZodULID = /*@__PURE__*/ core.$constructor(\"ZodULID\", (inst, def) => {\n    // ZodStringFormat.init(inst, def);\n    core.$ZodULID.init(inst, def);\n    ZodStringFormat.init(inst, def);\n});\nexport function ulid(params) {\n    return core._ulid(ZodULID, params);\n}\nexport const ZodXID = /*@__PURE__*/ core.$constructor(\"ZodXID\", (inst, def) => {\n    // ZodStringFormat.init(inst, def);\n    core.$ZodXID.init(inst, def);\n    ZodStringFormat.init(inst, def);\n});\nexport function xid(params) {\n    return core._xid(ZodXID, params);\n}\nexport const ZodKSUID = /*@__PURE__*/ core.$constructor(\"ZodKSUID\", (inst, def) => {\n    // ZodStringFormat.init(inst, def);\n    core.$ZodKSUID.init(inst, def);\n    ZodStringFormat.init(inst, def);\n});\nexport function ksuid(params) {\n    return core._ksuid(ZodKSUID, params);\n}\nexport const ZodIPv4 = /*@__PURE__*/ core.$constructor(\"ZodIPv4\", (inst, def) => {\n    // ZodStringFormat.init(inst, def);\n    core.$ZodIPv4.init(inst, def);\n    ZodStringFormat.init(inst, def);\n});\nexport function ipv4(params) {\n    return core._ipv4(ZodIPv4, params);\n}\nexport const ZodMAC = /*@__PURE__*/ core.$constructor(\"ZodMAC\", (inst, def) => {\n    // ZodStringFormat.init(inst, def);\n    core.$ZodMAC.init(inst, def);\n    ZodStringFormat.init(inst, def);\n});\nexport function mac(params) {\n    return core._mac(ZodMAC, params);\n}\nexport const ZodIPv6 = /*@__PURE__*/ core.$constructor(\"ZodIPv6\", (inst, def) => {\n    // ZodStringFormat.init(inst, def);\n    core.$ZodIPv6.init(inst, def);\n    ZodStringFormat.init(inst, def);\n});\nexport function ipv6(params) {\n    return core._ipv6(ZodIPv6, params);\n}\nexport const ZodCIDRv4 = /*@__PURE__*/ core.$constructor(\"ZodCIDRv4\", (inst, def) => {\n    core.$ZodCIDRv4.init(inst, def);\n    ZodStringFormat.init(inst, def);\n});\nexport function cidrv4(params) {\n    return core._cidrv4(ZodCIDRv4, params);\n}\nexport const ZodCIDRv6 = /*@__PURE__*/ core.$constructor(\"ZodCIDRv6\", (inst, def) => {\n    core.$ZodCIDRv6.init(inst, def);\n    ZodStringFormat.init(inst, def);\n});\nexport function cidrv6(params) {\n    return core._cidrv6(ZodCIDRv6, params);\n}\nexport const ZodBase64 = /*@__PURE__*/ core.$constructor(\"ZodBase64\", (inst, def) => {\n    // ZodStringFormat.init(inst, def);\n    core.$ZodBase64.init(inst, def);\n    ZodStringFormat.init(inst, def);\n});\nexport function base64(params) {\n    return core._base64(ZodBase64, params);\n}\nexport const ZodBase64URL = /*@__PURE__*/ core.$constructor(\"ZodBase64URL\", (inst, def) => {\n    // ZodStringFormat.init(inst, def);\n    core.$ZodBase64URL.init(inst, def);\n    ZodStringFormat.init(inst, def);\n});\nexport function base64url(params) {\n    return core._base64url(ZodBase64URL, params);\n}\nexport const ZodE164 = /*@__PURE__*/ core.$constructor(\"ZodE164\", (inst, def) => {\n    // ZodStringFormat.init(inst, def);\n    core.$ZodE164.init(inst, def);\n    ZodStringFormat.init(inst, def);\n});\nexport function e164(params) {\n    return core._e164(ZodE164, params);\n}\nexport const ZodCreditCard = /*@__PURE__*/ core.$constructor(\"ZodCreditCard\", (inst, def) => {\n    core.$ZodCreditCard.init(inst, def);\n    ZodStringFormat.init(inst, def);\n});\nexport function creditCard(params) {\n    return core._creditCard(ZodCreditCard, params);\n}\nexport const ZodJWT = /*@__PURE__*/ core.$constructor(\"ZodJWT\", (inst, def) => {\n    // ZodStringFormat.init(inst, def);\n    core.$ZodJWT.init(inst, def);\n    ZodStringFormat.init(inst, def);\n});\nexport function jwt(params) {\n    return core._jwt(ZodJWT, params);\n}\nexport const ZodCustomStringFormat = /*@__PURE__*/ core.$constructor(\"ZodCustomStringFormat\", (inst, def) => {\n    // ZodStringFormat.init(inst, def);\n    core.$ZodCustomStringFormat.init(inst, def);\n    ZodStringFormat.init(inst, def);\n});\nexport function stringFormat(format, fnOrRegex, _params = {}) {\n    return core._stringFormat(ZodCustomStringFormat, format, fnOrRegex, _params);\n}\nexport function hostname(_params) {\n    return core._stringFormat(ZodCustomStringFormat, \"hostname\", core.regexes.hostname, _params);\n}\nexport function hex(_params) {\n    return core._stringFormat(ZodCustomStringFormat, \"hex\", core.regexes.hex, _params);\n}\nexport function hash(alg, params) {\n    const enc = params?.enc ?? \"hex\";\n    const format = `${alg}_${enc}`;\n    const regex = core.regexes[format];\n    if (!regex)\n        throw new Error(`Unrecognized hash format: ${format}`);\n    return core._stringFormat(ZodCustomStringFormat, format, regex, params);\n}\nexport const ZodNumber = /*@__PURE__*/ core.$constructor(\"ZodNumber\", (inst, def) => {\n    core.$ZodNumber.init(inst, def);\n    ZodType.init(inst, def);\n    inst._zod.processJSONSchema = (ctx, json, params) => processors.numberProcessor(inst, ctx, json, params);\n    const bag = inst._zod.bag;\n    inst.minValue =\n        Math.max(bag.minimum ?? Number.NEGATIVE_INFINITY, bag.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null;\n    inst.maxValue =\n        Math.min(bag.maximum ?? Number.POSITIVE_INFINITY, bag.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null;\n    inst.isInt = (bag.format ?? \"\").includes(\"int\") || Number.isSafeInteger(bag.multipleOf ?? 0.5);\n    inst.isFinite = true;\n    inst.format = bag.format ?? null;\n}, {\n    gt(value, params) {\n        return this.check(checks.gt(value, params));\n    },\n    gte(value, params) {\n        return this.check(checks.gte(value, params));\n    },\n    min(value, params) {\n        return this.check(checks.gte(value, params));\n    },\n    lt(value, params) {\n        return this.check(checks.lt(value, params));\n    },\n    lte(value, params) {\n        return this.check(checks.lte(value, params));\n    },\n    max(value, params) {\n        return this.check(checks.lte(value, params));\n    },\n    int(params) {\n        return this.check(int(params));\n    },\n    safe(params) {\n        return this.check(int(params));\n    },\n    positive(params) {\n        return this.check(checks.gt(0, params));\n    },\n    nonnegative(params) {\n        return this.check(checks.gte(0, params));\n    },\n    negative(params) {\n        return this.check(checks.lt(0, params));\n    },\n    nonpositive(params) {\n        return this.check(checks.lte(0, params));\n    },\n    multipleOf(value, params) {\n        return this.check(checks.multipleOf(value, params));\n    },\n    step(value, params) {\n        return this.check(checks.multipleOf(value, params));\n    },\n    finite() {\n        return this;\n    },\n});\nexport function number(params) {\n    return core._number(ZodNumber, params);\n}\nexport const ZodNumberFormat = /*@__PURE__*/ core.$constructor(\"ZodNumberFormat\", (inst, def) => {\n    core.$ZodNumberFormat.init(inst, def);\n    ZodNumber.init(inst, def);\n});\nexport function int(params) {\n    return core._int(ZodNumberFormat, params);\n}\nexport function float32(params) {\n    return core._float32(ZodNumberFormat, params);\n}\nexport function float64(params) {\n    return core._float64(ZodNumberFormat, params);\n}\nexport function int32(params) {\n    return core._int32(ZodNumberFormat, params);\n}\nexport function uint32(params) {\n    return core._uint32(ZodNumberFormat, params);\n}\nexport const ZodBoolean = /*@__PURE__*/ core.$constructor(\"ZodBoolean\", (inst, def) => {\n    core.$ZodBoolean.init(inst, def);\n    ZodType.init(inst, def);\n    inst._zod.processJSONSchema = (ctx, json, params) => processors.booleanProcessor(inst, ctx, json, params);\n});\nexport function boolean(params) {\n    return core._boolean(ZodBoolean, params);\n}\nexport const ZodBigInt = /*@__PURE__*/ core.$constructor(\"ZodBigInt\", (inst, def) => {\n    core.$ZodBigInt.init(inst, def);\n    ZodType.init(inst, def);\n    inst._zod.processJSONSchema = (ctx, json, params) => processors.bigintProcessor(inst, ctx, json, params);\n    const bag = inst._zod.bag;\n    inst.minValue = bag.minimum ?? null;\n    inst.maxValue = bag.maximum ?? null;\n    inst.format = bag.format ?? null;\n}, {\n    gte(value, params) {\n        return this.check(checks.gte(value, params));\n    },\n    min(value, params) {\n        return this.check(checks.gte(value, params));\n    },\n    gt(value, params) {\n        return this.check(checks.gt(value, params));\n    },\n    lt(value, params) {\n        return this.check(checks.lt(value, params));\n    },\n    lte(value, params) {\n        return this.check(checks.lte(value, params));\n    },\n    max(value, params) {\n        return this.check(checks.lte(value, params));\n    },\n    positive(params) {\n        return this.check(checks.gt(BigInt(0), params));\n    },\n    negative(params) {\n        return this.check(checks.lt(BigInt(0), params));\n    },\n    nonpositive(params) {\n        return this.check(checks.lte(BigInt(0), params));\n    },\n    nonnegative(params) {\n        return this.check(checks.gte(BigInt(0), params));\n    },\n    multipleOf(value, params) {\n        return this.check(checks.multipleOf(value, params));\n    },\n});\nexport function bigint(params) {\n    return core._bigint(ZodBigInt, params);\n}\nexport const ZodBigIntFormat = /*@__PURE__*/ core.$constructor(\"ZodBigIntFormat\", (inst, def) => {\n    core.$ZodBigIntFormat.init(inst, def);\n    ZodBigInt.init(inst, def);\n});\nexport function int64(params) {\n    return core._int64(ZodBigIntFormat, params);\n}\nexport function uint64(params) {\n    return core._uint64(ZodBigIntFormat, params);\n}\nexport const ZodSymbol = /*@__PURE__*/ core.$constructor(\"ZodSymbol\", (inst, def) => {\n    core.$ZodSymbol.init(inst, def);\n    ZodType.init(inst, def);\n    inst._zod.processJSONSchema = (ctx, json, params) => processors.symbolProcessor(inst, ctx, json, params);\n});\nexport function symbol(params) {\n    return core._symbol(ZodSymbol, params);\n}\nexport const ZodUndefined = /*@__PURE__*/ core.$constructor(\"ZodUndefined\", (inst, def) => {\n    core.$ZodUndefined.init(inst, def);\n    ZodType.init(inst, def);\n    inst._zod.processJSONSchema = (ctx, json, params) => processors.undefinedProcessor(inst, ctx, json, params);\n});\nfunction _undefined(params) {\n    return core._undefined(ZodUndefined, params);\n}\nexport { _undefined as undefined };\nexport const ZodNull = /*@__PURE__*/ core.$constructor(\"ZodNull\", (inst, def) => {\n    core.$ZodNull.init(inst, def);\n    ZodType.init(inst, def);\n    inst._zod.processJSONSchema = (ctx, json, params) => processors.nullProcessor(inst, ctx, json, params);\n});\nfunction _null(params) {\n    return core._null(ZodNull, params);\n}\nexport { _null as null };\nexport const ZodAny = /*@__PURE__*/ core.$constructor(\"ZodAny\", (inst, def) => {\n    core.$ZodAny.init(inst, def);\n    ZodType.init(inst, def);\n    inst._zod.processJSONSchema = (ctx, json, params) => processors.anyProcessor(inst, ctx, json, params);\n});\nexport function any() {\n    return core._any(ZodAny);\n}\nexport const ZodUnknown = /*@__PURE__*/ core.$constructor(\"ZodUnknown\", (inst, def) => {\n    core.$ZodUnknown.init(inst, def);\n    ZodType.init(inst, def);\n    inst._zod.processJSONSchema = (ctx, json, params) => processors.unknownProcessor(inst, ctx, json, params);\n});\nexport function unknown() {\n    return core._unknown(ZodUnknown);\n}\nexport const ZodNever = /*@__PURE__*/ core.$constructor(\"ZodNever\", (inst, def) => {\n    core.$ZodNever.init(inst, def);\n    ZodType.init(inst, def);\n    inst._zod.processJSONSchema = (ctx, json, params) => processors.neverProcessor(inst, ctx, json, params);\n});\nexport function never(params) {\n    return core._never(ZodNever, params);\n}\nexport const ZodVoid = /*@__PURE__*/ core.$constructor(\"ZodVoid\", (inst, def) => {\n    core.$ZodVoid.init(inst, def);\n    ZodType.init(inst, def);\n    inst._zod.processJSONSchema = (ctx, json, params) => processors.voidProcessor(inst, ctx, json, params);\n});\nfunction _void(params) {\n    return core._void(ZodVoid, params);\n}\nexport { _void as void };\nexport const ZodDate = /*@__PURE__*/ core.$constructor(\"ZodDate\", (inst, def) => {\n    core.$ZodDate.init(inst, def);\n    ZodType.init(inst, def);\n    inst._zod.processJSONSchema = (ctx, json, params) => processors.dateProcessor(inst, ctx, json, params);\n    inst.min = (value, params) => inst.check(checks.gte(value, params));\n    inst.max = (value, params) => inst.check(checks.lte(value, params));\n    const c = inst._zod.bag;\n    inst.minDate = c.minimum ? new Date(c.minimum) : null;\n    inst.maxDate = c.maximum ? new Date(c.maximum) : null;\n});\nexport function date(params) {\n    return core._date(ZodDate, params);\n}\nexport const ZodArray = /*@__PURE__*/ core.$constructor(\"ZodArray\", (inst, def) => {\n    _ensureDefaultMemoizer();\n    core.$ZodArray.init(inst, def);\n    ZodType.init(inst, def);\n    inst._zod.processJSONSchema = (ctx, json, params) => processors.arrayProcessor(inst, ctx, json, params);\n    inst.element = def.element;\n}, {\n    min(n, params) {\n        return this.check(checks.minLength(n, params));\n    },\n    nonempty(params) {\n        return this.check(checks.minLength(1, params));\n    },\n    max(n, params) {\n        return this.check(checks.maxLength(n, params));\n    },\n    length(n, params) {\n        return this.check(checks.length(n, params));\n    },\n    unwrap() {\n        return this.element;\n    },\n});\nexport function array(element, params) {\n    return core._array(ZodArray, element, params);\n}\n// .keyof\nexport function keyof(schema) {\n    const shape = schema._zod.def.shape;\n    return _enum(Object.keys(shape));\n}\nexport const ZodObject = /*@__PURE__*/ core.$constructor(\"ZodObject\", (inst, def) => {\n    _ensureDefaultMemoizer();\n    core.$ZodObjectJIT.init(inst, def);\n    ZodType.init(inst, def);\n    inst._zod.processJSONSchema = (ctx, json, params) => processors.objectProcessor(inst, ctx, json, params);\n    util.installLazyProp(inst, \"shape\", (self) => self._zod.def.shape, false);\n}, {\n    keyof() {\n        return _enum(Object.keys(this._zod.def.shape));\n    },\n    catchall(catchall) {\n        return this.clone({ ...this._zod.def, catchall: catchall });\n    },\n    passthrough() {\n        return this.clone({ ...this._zod.def, catchall: unknown() });\n    },\n    loose() {\n        return this.clone({ ...this._zod.def, catchall: unknown() });\n    },\n    strict() {\n        return this.clone({ ...this._zod.def, catchall: never() });\n    },\n    strip() {\n        return this.clone({ ...this._zod.def, catchall: undefined });\n    },\n    extend(incoming) {\n        return util.extend(this, incoming);\n    },\n    safeExtend(incoming) {\n        return util.safeExtend(this, incoming);\n    },\n    merge(other) {\n        return util.merge(this, other);\n    },\n    pick(mask) {\n        return util.pick(this, mask);\n    },\n    omit(mask) {\n        return util.omit(this, mask);\n    },\n    partial(...args) {\n        return util.partial(ZodOptional, this, args[0]);\n    },\n    exactPartial(...args) {\n        return util.partial(ZodExactOptional, this, args[0], \"exactPartial\");\n    },\n    required(...args) {\n        return util.required(ZodNonOptional, this, args[0]);\n    },\n});\nexport function object(shape, params) {\n    const def = {\n        type: \"object\",\n        shape: shape ?? {},\n        ...util.normalizeParams(params),\n    };\n    return new ZodObject(def);\n}\n// strictObject\nexport function strictObject(shape, params) {\n    return new ZodObject({\n        type: \"object\",\n        shape,\n        catchall: never(),\n        ...util.normalizeParams(params),\n    });\n}\n// looseObject\nexport function looseObject(shape, params) {\n    return new ZodObject({\n        type: \"object\",\n        shape,\n        catchall: unknown(),\n        ...util.normalizeParams(params),\n    });\n}\nexport const ZodUnion = /*@__PURE__*/ core.$constructor(\"ZodUnion\", (inst, def) => {\n    core.$ZodUnion.init(inst, def);\n    ZodType.init(inst, def);\n    inst._zod.processJSONSchema = (ctx, json, params) => processors.unionProcessor(inst, ctx, json, params);\n    inst.options = def.options;\n});\nexport function union(options, params) {\n    return new ZodUnion({\n        type: \"union\",\n        options: options,\n        ...util.normalizeParams(params),\n    });\n}\nexport const ZodXor = /*@__PURE__*/ core.$constructor(\"ZodXor\", (inst, def) => {\n    ZodUnion.init(inst, def);\n    core.$ZodXor.init(inst, def);\n    inst._zod.processJSONSchema = (ctx, json, params) => processors.unionProcessor(inst, ctx, json, params);\n    inst.options = def.options;\n});\n/** Creates an exclusive union (XOR) where exactly one option must match.\n * Unlike regular unions that succeed when any option matches, xor fails if\n * zero or more than one option matches the input. */\nexport function xor(options, params) {\n    return new ZodXor({\n        type: \"union\",\n        options: options,\n        inclusive: false,\n        ...util.normalizeParams(params),\n    });\n}\nexport const ZodDiscriminatedUnion = /*@__PURE__*/ core.$constructor(\"ZodDiscriminatedUnion\", (inst, def) => {\n    ZodUnion.init(inst, def);\n    core.$ZodDiscriminatedUnion.init(inst, def);\n});\nexport function discriminatedUnion(discriminator, options, params) {\n    // const [options, params] = args;\n    return new ZodDiscriminatedUnion({\n        type: \"union\",\n        options: options,\n        discriminator,\n        ...util.normalizeParams(params),\n    });\n}\nexport const ZodIntersection = /*@__PURE__*/ core.$constructor(\"ZodIntersection\", (inst, def) => {\n    core.$ZodIntersection.init(inst, def);\n    ZodType.init(inst, def);\n    inst._zod.processJSONSchema = (ctx, json, params) => processors.intersectionProcessor(inst, ctx, json, params);\n});\nexport function intersection(left, right) {\n    return new ZodIntersection({\n        type: \"intersection\",\n        left: left,\n        right: right,\n    });\n}\nexport const ZodTuple = /*@__PURE__*/ core.$constructor(\"ZodTuple\", (inst, def) => {\n    _ensureDefaultMemoizer();\n    core.$ZodTuple.init(inst, def);\n    ZodType.init(inst, def);\n    inst._zod.processJSONSchema = (ctx, json, params) => processors.tupleProcessor(inst, ctx, json, params);\n}, {\n    rest(rest) {\n        return this.clone({\n            ...this._zod.def,\n            rest: rest,\n        });\n    },\n    partial() {\n        const def = this._zod.def;\n        // a refinement was authored against the full arity; partialing would run it on a shorter array\n        if (def.checks?.length)\n            throw new Error(\".partial() cannot be used on tuple schemas containing refinements\");\n        return this.clone({\n            ...def,\n            items: def.items.map((item) => new ZodOptional({ type: \"optional\", innerType: item })),\n        });\n    },\n});\nexport function tuple(items, _paramsOrRest, _params) {\n    const hasRest = _paramsOrRest instanceof core.$ZodType;\n    const params = hasRest ? _params : _paramsOrRest;\n    const rest = hasRest ? _paramsOrRest : null;\n    return new ZodTuple({\n        type: \"tuple\",\n        items: items,\n        rest,\n        ...util.normalizeParams(params),\n    });\n}\nexport const ZodRecord = /*@__PURE__*/ core.$constructor(\"ZodRecord\", (inst, def) => {\n    _ensureDefaultMemoizer();\n    core.$ZodRecord.init(inst, def);\n    ZodType.init(inst, def);\n    inst._zod.processJSONSchema = (ctx, json, params) => processors.recordProcessor(inst, ctx, json, params);\n    inst.keyType = def.keyType;\n    inst.valueType = def.valueType;\n});\nexport function record(keyType, valueType, params) {\n    // v3-compat: z.record(valueType, params?) — defaults keyType to z.string()\n    if (!valueType || !valueType._zod) {\n        return new ZodRecord({\n            type: \"record\",\n            keyType: string(),\n            valueType: keyType,\n            ...util.normalizeParams(valueType),\n        });\n    }\n    return new ZodRecord({\n        type: \"record\",\n        keyType,\n        valueType: valueType,\n        ...util.normalizeParams(params),\n    });\n}\n// type alksjf = core.output<core.$ZodRecordKey>;\nexport function partialRecord(keyType, valueType, params) {\n    return new ZodRecord({\n        type: \"record\",\n        keyType,\n        valueType: valueType,\n        ...util.normalizeParams(params),\n        partial: true,\n    });\n}\nexport function looseRecord(keyType, valueType, params) {\n    return new ZodRecord({\n        type: \"record\",\n        keyType,\n        valueType: valueType,\n        mode: \"loose\",\n        ...util.normalizeParams(params),\n    });\n}\nexport const ZodMap = /*@__PURE__*/ core.$constructor(\"ZodMap\", (inst, def) => {\n    _ensureDefaultMemoizer();\n    core.$ZodMap.init(inst, def);\n    ZodType.init(inst, def);\n    inst._zod.processJSONSchema = (ctx, json, params) => processors.mapProcessor(inst, ctx, json, params);\n    inst.keyType = def.keyType;\n    inst.valueType = def.valueType;\n    inst.min = (...args) => inst.check(core._minSize(...args));\n    inst.nonempty = (params) => inst.check(core._minSize(1, params));\n    inst.max = (...args) => inst.check(core._maxSize(...args));\n    inst.size = (...args) => inst.check(core._size(...args));\n});\nexport function map(keyType, valueType, params) {\n    return new ZodMap({\n        type: \"map\",\n        keyType: keyType,\n        valueType: valueType,\n        ...util.normalizeParams(params),\n    });\n}\nexport const ZodSet = /*@__PURE__*/ core.$constructor(\"ZodSet\", (inst, def) => {\n    _ensureDefaultMemoizer();\n    core.$ZodSet.init(inst, def);\n    ZodType.init(inst, def);\n    inst._zod.processJSONSchema = (ctx, json, params) => processors.setProcessor(inst, ctx, json, params);\n    inst.min = (...args) => inst.check(core._minSize(...args));\n    inst.nonempty = (params) => inst.check(core._minSize(1, params));\n    inst.max = (...args) => inst.check(core._maxSize(...args));\n    inst.size = (...args) => inst.check(core._size(...args));\n});\nexport function set(valueType, params) {\n    return new ZodSet({\n        type: \"set\",\n        valueType: valueType,\n        ...util.normalizeParams(params),\n    });\n}\nexport const ZodEnum = /*@__PURE__*/ core.$constructor(\"ZodEnum\", (inst, def) => {\n    core.$ZodEnum.init(inst, def);\n    ZodType.init(inst, def);\n    inst._zod.processJSONSchema = (ctx, json, params) => processors.enumProcessor(inst, ctx, json, params);\n    inst.enum = def.entries;\n    inst.options = Object.values(def.entries);\n    const keys = new Set(Object.keys(def.entries));\n    inst.extract = (values, params) => {\n        const newEntries = {};\n        for (const value of values) {\n            if (keys.has(value)) {\n                newEntries[value] = def.entries[value];\n            }\n            else\n                throw new Error(`Key ${value} not found in enum`);\n        }\n        return new ZodEnum({\n            ...def,\n            checks: [],\n            ...util.normalizeParams(params),\n            entries: newEntries,\n        });\n    };\n    inst.exclude = (values, params) => {\n        const newEntries = { ...def.entries };\n        for (const value of values) {\n            if (keys.has(value)) {\n                delete newEntries[value];\n            }\n            else\n                throw new Error(`Key ${value} not found in enum`);\n        }\n        return new ZodEnum({\n            ...def,\n            checks: [],\n            ...util.normalizeParams(params),\n            entries: newEntries,\n        });\n    };\n});\nfunction _enum(values, params) {\n    const entries = Array.isArray(values) ? Object.fromEntries(values.map((v) => [v, v])) : values;\n    return new ZodEnum({\n        type: \"enum\",\n        entries,\n        ...util.normalizeParams(params),\n    });\n}\nexport { _enum as enum };\n/** @deprecated This API has been merged into `z.enum()`. Use `z.enum()` instead.\n *\n * ```ts\n * enum Colors { red, green, blue }\n * z.enum(Colors);\n * ```\n */\nexport function nativeEnum(entries, params) {\n    return new ZodEnum({\n        type: \"enum\",\n        entries,\n        ...util.normalizeParams(params),\n    });\n}\nexport const ZodLiteral = /*@__PURE__*/ core.$constructor(\"ZodLiteral\", (inst, def) => {\n    core.$ZodLiteral.init(inst, def);\n    ZodType.init(inst, def);\n    inst._zod.processJSONSchema = (ctx, json, params) => processors.literalProcessor(inst, ctx, json, params);\n    inst.values = new Set(def.values);\n    Object.defineProperty(inst, \"value\", {\n        get() {\n            if (def.values.length > 1) {\n                throw new Error(\"This schema contains multiple valid literal values. Use `.values` instead.\");\n            }\n            return def.values[0];\n        },\n    });\n});\nexport function literal(value, params) {\n    return new ZodLiteral({\n        type: \"literal\",\n        values: Array.isArray(value) ? value : [value],\n        ...util.normalizeParams(params),\n    });\n}\nexport const ZodFile = /*@__PURE__*/ core.$constructor(\"ZodFile\", (inst, def) => {\n    core.$ZodFile.init(inst, def);\n    ZodType.init(inst, def);\n    inst._zod.processJSONSchema = (ctx, json, params) => processors.fileProcessor(inst, ctx, json, params);\n    inst.min = (size, params) => inst.check(core._minSize(size, params));\n    inst.max = (size, params) => inst.check(core._maxSize(size, params));\n    inst.mime = (types, params) => inst.check(core._mime(Array.isArray(types) ? types : [types], params));\n});\nexport function file(params) {\n    return core._file(ZodFile, params);\n}\nexport const ZodTransform = /*@__PURE__*/ core.$constructor(\"ZodTransform\", (inst, def) => {\n    _ensureDefaultMemoizer();\n    core.$ZodTransform.init(inst, def);\n    ZodType.init(inst, def);\n    inst._zod.processJSONSchema = (ctx, json, params) => processors.transformProcessor(inst, ctx, json, params);\n    inst._zod.parse = (payload, _ctx) => {\n        if (_ctx.direction === \"backward\") {\n            throw new core.$ZodEncodeError(inst.constructor.name);\n        }\n        payload.addIssue = (issue) => {\n            if (typeof issue === \"string\") {\n                payload.issues.push(util.issue(issue, payload.value, def));\n            }\n            else {\n                // for Zod 3 backwards compatibility\n                const _issue = issue;\n                if (_issue.fatal)\n                    _issue.continue = false;\n                _issue.code ?? (_issue.code = \"custom\");\n                if (!(\"input\" in _issue))\n                    _issue.input = payload.value;\n                _issue.inst ?? (_issue.inst = inst);\n                // _issue.continue ??= true;\n                payload.issues.push(util.issue(_issue));\n            }\n        };\n        const output = def.transform(payload.value, payload);\n        if (output instanceof Promise) {\n            return output.then((output) => {\n                payload.value = output;\n                return payload;\n            });\n        }\n        payload.value = output;\n        return payload;\n    };\n});\nexport function transform(fn) {\n    return new ZodTransform({\n        type: \"transform\",\n        transform: fn,\n    });\n}\nexport const ZodOptional = /*@__PURE__*/ core.$constructor(\"ZodOptional\", (inst, def) => {\n    core.$ZodOptional.init(inst, def);\n    ZodType.init(inst, def);\n    inst._zod.processJSONSchema = (ctx, json, params) => processors.optionalProcessor(inst, ctx, json, params);\n    inst.unwrap = () => inst._zod.def.innerType;\n});\nexport function optional(innerType) {\n    return new ZodOptional({\n        type: \"optional\",\n        innerType: innerType,\n    });\n}\nexport const ZodExactOptional = /*@__PURE__*/ core.$constructor(\"ZodExactOptional\", (inst, def) => {\n    core.$ZodExactOptional.init(inst, def);\n    ZodType.init(inst, def);\n    inst._zod.processJSONSchema = (ctx, json, params) => processors.optionalProcessor(inst, ctx, json, params);\n    inst.unwrap = () => inst._zod.def.innerType;\n});\nexport function exactOptional(innerType) {\n    return new ZodExactOptional({\n        type: \"optional\",\n        innerType: innerType,\n    });\n}\nexport const ZodNullable = /*@__PURE__*/ core.$constructor(\"ZodNullable\", (inst, def) => {\n    core.$ZodNullable.init(inst, def);\n    ZodType.init(inst, def);\n    inst._zod.processJSONSchema = (ctx, json, params) => processors.nullableProcessor(inst, ctx, json, params);\n    inst.unwrap = () => inst._zod.def.innerType;\n});\nexport function nullable(innerType) {\n    return new ZodNullable({\n        type: \"nullable\",\n        innerType: innerType,\n    });\n}\n// nullish\nexport function nullish(innerType) {\n    return optional(nullable(innerType));\n}\nexport const ZodDefault = /*@__PURE__*/ core.$constructor(\"ZodDefault\", (inst, def) => {\n    core.$ZodDefault.init(inst, def);\n    ZodType.init(inst, def);\n    inst._zod.processJSONSchema = (ctx, json, params) => processors.defaultProcessor(inst, ctx, json, params);\n    inst.unwrap = () => inst._zod.def.innerType;\n    inst.removeDefault = inst.unwrap;\n});\nexport function _default(innerType, defaultValue) {\n    return new ZodDefault({\n        type: \"default\",\n        innerType: innerType,\n        get defaultValue() {\n            return typeof defaultValue === \"function\" ? defaultValue() : util.shallowClone(defaultValue);\n        },\n    });\n}\nexport const ZodPrefault = /*@__PURE__*/ core.$constructor(\"ZodPrefault\", (inst, def) => {\n    core.$ZodPrefault.init(inst, def);\n    ZodType.init(inst, def);\n    inst._zod.processJSONSchema = (ctx, json, params) => processors.prefaultProcessor(inst, ctx, json, params);\n    inst.unwrap = () => inst._zod.def.innerType;\n});\nexport function prefault(innerType, defaultValue) {\n    return new ZodPrefault({\n        type: \"prefault\",\n        innerType: innerType,\n        get defaultValue() {\n            return typeof defaultValue === \"function\" ? defaultValue() : util.shallowClone(defaultValue);\n        },\n    });\n}\nexport const ZodNonOptional = /*@__PURE__*/ core.$constructor(\"ZodNonOptional\", (inst, def) => {\n    core.$ZodNonOptional.init(inst, def);\n    ZodType.init(inst, def);\n    inst._zod.processJSONSchema = (ctx, json, params) => processors.nonoptionalProcessor(inst, ctx, json, params);\n    inst.unwrap = () => inst._zod.def.innerType;\n});\nexport function nonoptional(innerType, params) {\n    return new ZodNonOptional({\n        type: \"nonoptional\",\n        innerType: innerType,\n        ...util.normalizeParams(params),\n    });\n}\nexport const ZodSuccess = /*@__PURE__*/ core.$constructor(\"ZodSuccess\", (inst, def) => {\n    core.$ZodSuccess.init(inst, def);\n    ZodType.init(inst, def);\n    inst._zod.processJSONSchema = (ctx, json, params) => processors.successProcessor(inst, ctx, json, params);\n    inst.unwrap = () => inst._zod.def.innerType;\n});\nexport function success(innerType) {\n    return new ZodSuccess({\n        type: \"success\",\n        innerType: innerType,\n    });\n}\nexport const ZodCatch = /*@__PURE__*/ core.$constructor(\"ZodCatch\", (inst, def) => {\n    core.$ZodCatch.init(inst, def);\n    ZodType.init(inst, def);\n    inst._zod.processJSONSchema = (ctx, json, params) => processors.catchProcessor(inst, ctx, json, params);\n    inst.unwrap = () => inst._zod.def.innerType;\n    inst.removeCatch = inst.unwrap;\n});\nfunction _catch(innerType, catchValue) {\n    return new ZodCatch({\n        type: \"catch\",\n        innerType: innerType,\n        catchValue: (typeof catchValue === \"function\" ? catchValue : core.util.constantCatch(catchValue)),\n    });\n}\nexport { _catch as catch };\nexport const ZodNaN = /*@__PURE__*/ core.$constructor(\"ZodNaN\", (inst, def) => {\n    core.$ZodNaN.init(inst, def);\n    ZodType.init(inst, def);\n    inst._zod.processJSONSchema = (ctx, json, params) => processors.nanProcessor(inst, ctx, json, params);\n});\nexport function nan(params) {\n    return core._nan(ZodNaN, params);\n}\nexport const ZodPipe = /*@__PURE__*/ core.$constructor(\"ZodPipe\", (inst, def) => {\n    core.$ZodPipe.init(inst, def);\n    ZodType.init(inst, def);\n    inst._zod.processJSONSchema = (ctx, json, params) => processors.pipeProcessor(inst, ctx, json, params);\n    inst.in = def.in;\n    inst.out = def.out;\n});\nexport function pipe(in_, out) {\n    return new ZodPipe({\n        type: \"pipe\",\n        in: in_,\n        out: out,\n        // ...util.normalizeParams(params),\n    });\n}\nexport const ZodCodec = /*@__PURE__*/ core.$constructor(\"ZodCodec\", (inst, def) => {\n    ZodPipe.init(inst, def);\n    core.$ZodCodec.init(inst, def);\n});\nexport function codec(in_, out, params) {\n    return new ZodCodec({\n        type: \"pipe\",\n        in: in_,\n        out: out,\n        transform: params.decode,\n        reverseTransform: params.encode,\n    });\n}\nexport function invertCodec(codec) {\n    const def = codec._zod.def;\n    return new ZodCodec({\n        type: \"pipe\",\n        in: def.out,\n        out: def.in,\n        transform: def.reverseTransform,\n        reverseTransform: def.transform,\n    });\n}\nexport const ZodPreprocess = /*@__PURE__*/ core.$constructor(\"ZodPreprocess\", (inst, def) => {\n    ZodPipe.init(inst, def);\n    core.$ZodPreprocess.init(inst, def);\n});\nexport const ZodReadonly = /*@__PURE__*/ core.$constructor(\"ZodReadonly\", (inst, def) => {\n    core.$ZodReadonly.init(inst, def);\n    ZodType.init(inst, def);\n    inst._zod.processJSONSchema = (ctx, json, params) => processors.readonlyProcessor(inst, ctx, json, params);\n    inst.unwrap = () => inst._zod.def.innerType;\n});\nexport function readonly(innerType) {\n    return new ZodReadonly({\n        type: \"readonly\",\n        innerType: innerType,\n    });\n}\nexport const ZodTemplateLiteral = /*@__PURE__*/ core.$constructor(\"ZodTemplateLiteral\", (inst, def) => {\n    core.$ZodTemplateLiteral.init(inst, def);\n    ZodType.init(inst, def);\n    inst._zod.processJSONSchema = (ctx, json, params) => processors.templateLiteralProcessor(inst, ctx, json, params);\n});\nexport function templateLiteral(parts, params) {\n    return new ZodTemplateLiteral({\n        type: \"template_literal\",\n        parts,\n        ...util.normalizeParams(params),\n    });\n}\nexport const ZodLazy = /*@__PURE__*/ core.$constructor(\"ZodLazy\", (inst, def) => {\n    core.$ZodLazy.init(inst, def);\n    ZodType.init(inst, def);\n    inst._zod.processJSONSchema = (ctx, json, params) => processors.lazyProcessor(inst, ctx, json, params);\n    inst.unwrap = () => inst._zod.def.getter();\n});\nexport function lazy(getter) {\n    return new ZodLazy({\n        type: \"lazy\",\n        getter: getter,\n    });\n}\nexport const ZodPromise = /*@__PURE__*/ core.$constructor(\"ZodPromise\", (inst, def) => {\n    core.$ZodPromise.init(inst, def);\n    ZodType.init(inst, def);\n    inst._zod.processJSONSchema = (ctx, json, params) => processors.promiseProcessor(inst, ctx, json, params);\n    inst.unwrap = () => inst._zod.def.innerType;\n});\nexport function promise(innerType) {\n    return new ZodPromise({\n        type: \"promise\",\n        innerType: innerType,\n    });\n}\nexport const ZodFunction = /*@__PURE__*/ core.$constructor(\"ZodFunction\", (inst, def) => {\n    core.$ZodFunction.init(inst, def);\n    ZodType.init(inst, def);\n    inst._zod.processJSONSchema = (ctx, json, params) => processors.functionProcessor(inst, ctx, json, params);\n});\nexport function _function(params) {\n    return new ZodFunction({\n        type: \"function\",\n        input: Array.isArray(params?.input) ? tuple(params?.input) : (params?.input ?? array(unknown())),\n        output: params?.output ?? unknown(),\n    });\n}\nexport { _function as function };\nexport const ZodCustom = /*@__PURE__*/ core.$constructor(\"ZodCustom\", (inst, def) => {\n    core.$ZodCustom.init(inst, def);\n    ZodType.init(inst, def);\n    inst._zod.processJSONSchema = (ctx, json, params) => processors.customProcessor(inst, ctx, json, params);\n});\n// custom checks\nexport function check(fn) {\n    const ch = new core.$ZodCheck({\n        check: \"custom\",\n        // ...util.normalizeParams(params),\n    });\n    ch._zod.check = fn;\n    return ch;\n}\nexport function custom(fn, _params) {\n    return core._custom(ZodCustom, fn ?? (() => true), _params);\n}\nexport function refine(fn, _params = {}) {\n    return core._refine(ZodCustom, fn, _params);\n}\n// superRefine\nexport function superRefine(fn, params) {\n    return core._superRefine(fn, params);\n}\n// Re-export describe and meta from core\nexport const describe = core.describe;\nexport const meta = core.meta;\nfunction _instanceof(cls, params = {}) {\n    const inst = new ZodCustom({\n        type: \"custom\",\n        check: \"custom\",\n        fn: (data) => data instanceof cls,\n        abort: true,\n        ...util.normalizeParams(params),\n    });\n    inst._zod.bag.Class = cls;\n    // Override check to emit invalid_type instead of custom\n    inst._zod.check = (payload) => {\n        if (!(payload.value instanceof cls)) {\n            payload.issues.push({\n                code: \"invalid_type\",\n                expected: cls.name,\n                input: payload.value,\n                inst,\n                path: [...(inst._zod.def.path ?? [])],\n            });\n        }\n    };\n    return inst;\n}\nexport { _instanceof as instanceof };\n// stringbool\nexport const stringbool = (...args) => core._stringbool({\n    Codec: ZodCodec,\n    Boolean: ZodBoolean,\n    String: ZodString,\n}, ...args);\nexport function json(params) {\n    const jsonSchema = lazy(() => {\n        return union([string(params), number(), boolean(), _null(), array(jsonSchema), record(string(), jsonSchema)]);\n    });\n    return jsonSchema;\n}\n// preprocess\nexport function preprocess(fn, schema) {\n    return new ZodPreprocess({\n        type: \"pipe\",\n        in: transform(fn),\n        out: schema,\n    });\n}\n","/*\n * Copyright (c) 2022-2026.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\n<script lang=\"ts\">\nimport { VCFormGroup, VCFormInput } from '@vuecs/forms';\nimport type { ButtonSize } from '@vuecs/button';\nimport { VCButton } from '@vuecs/button';\nimport { VCIcon } from '@vuecs/icon';\nimport { createValidator } from '@validup/zod';\nimport { Container } from 'validup';\nimport { useValidup } from '@validup/vue';\nimport { z } from 'zod';\nimport type { PropType } from 'vue';\nimport { defineComponent, reactive } from 'vue';\nimport { IFieldValidation } from '@ilingo/validup-vue';\nimport { DEFAULT_BUTTON_SIZE } from '../../../core';\n\n// Per-row input validator — local because there's no\n// \"list item name\" entity in core-kit.\nclass FormInputListItemValidator extends Container<{ name: string }> {\n    protected override initialize() {\n        super.initialize();\n        this.mount('name', createValidator(z.string().min(2).max(512)));\n    }\n}\n\nexport default defineComponent({\n    components: {\n        VCFormInput,\n        VCFormGroup,\n        VCButton,\n        VCIcon,\n        IFieldValidation,\n    },\n    props: {\n        name: {\n            type: String,\n            default: undefined,\n        },\n        disabled: {\n            type: Boolean,\n            default: false,\n        },\n        size: {\n            type: String as PropType<ButtonSize>,\n            default: DEFAULT_BUTTON_SIZE,\n        },\n    },\n    emits: ['updated', 'deleted'],\n    setup(props, ctx) {\n        const form = reactive({ name: props.name ?? '' });\n\n        const v = useValidup(new FormInputListItemValidator(), form, { detached: true });\n\n        const handleUpdated = () => {\n            ctx.emit('updated', v.fields.name.$model.value);\n        };\n\n        const handleDeleted = () => {\n            ctx.emit('deleted');\n        };\n\n        return {\n            handleUpdated,\n            handleDeleted,\n            v,\n        };\n    },\n});\n</script>\n<template>\n    <IFieldValidation\n        v-slot=\"{ value }\"\n        :field=\"v.fields.name\"\n    >\n        <VCFormGroup :validation=\"value\">\n            <VCFormInput\n                v-model=\"v.fields.name.$model.value\"\n                @change=\"handleUpdated\"\n            >\n                <template #groupAppend>\n                    <VCButton\n                        :disabled=\"disabled\"\n                        type=\"button\"\n                        :size=\"size\"\n                        color=\"warning\"\n                        class=\"rounded-l-none\"\n                        @click.prevent=\"handleDeleted\"\n                    >\n                        <VCIcon name=\"fa6-solid:minus\" />\n                    </VCButton>\n                </template>\n            </VCFormInput>\n        </VCFormGroup>\n    </IFieldValidation>\n</template>\n","/*\n * Copyright (c) 2022-2026.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\n<script lang=\"ts\">\nimport { VCFormGroup, VCFormInput } from '@vuecs/forms';\nimport type { ButtonSize } from '@vuecs/button';\nimport { VCButton } from '@vuecs/button';\nimport { VCIcon } from '@vuecs/icon';\nimport { createValidator } from '@validup/zod';\nimport { Container } from 'validup';\nimport { useValidup } from '@validup/vue';\nimport { z } from 'zod';\nimport type { PropType } from 'vue';\nimport { defineComponent, reactive } from 'vue';\nimport { IFieldValidation } from '@ilingo/validup-vue';\nimport { DEFAULT_BUTTON_SIZE } from '../../../core';\n\n// Per-row input validator — local because there's no\n// \"list item name\" entity in core-kit.\nclass FormInputListItemValidator extends Container<{ name: string }> {\n    protected override initialize() {\n        super.initialize();\n        this.mount('name', createValidator(z.string().min(2).max(512)));\n    }\n}\n\nexport default defineComponent({\n    components: {\n        VCFormInput,\n        VCFormGroup,\n        VCButton,\n        VCIcon,\n        IFieldValidation,\n    },\n    props: {\n        name: {\n            type: String,\n            default: undefined,\n        },\n        disabled: {\n            type: Boolean,\n            default: false,\n        },\n        size: {\n            type: String as PropType<ButtonSize>,\n            default: DEFAULT_BUTTON_SIZE,\n        },\n    },\n    emits: ['updated', 'deleted'],\n    setup(props, ctx) {\n        const form = reactive({ name: props.name ?? '' });\n\n        const v = useValidup(new FormInputListItemValidator(), form, { detached: true });\n\n        const handleUpdated = () => {\n            ctx.emit('updated', v.fields.name.$model.value);\n        };\n\n        const handleDeleted = () => {\n            ctx.emit('deleted');\n        };\n\n        return {\n            handleUpdated,\n            handleDeleted,\n            v,\n        };\n    },\n});\n</script>\n<template>\n    <IFieldValidation\n        v-slot=\"{ value }\"\n        :field=\"v.fields.name\"\n    >\n        <VCFormGroup :validation=\"value\">\n            <VCFormInput\n                v-model=\"v.fields.name.$model.value\"\n                @change=\"handleUpdated\"\n            >\n                <template #groupAppend>\n                    <VCButton\n                        :disabled=\"disabled\"\n                        type=\"button\"\n                        :size=\"size\"\n                        color=\"warning\"\n                        class=\"rounded-l-none\"\n                        @click.prevent=\"handleDeleted\"\n                    >\n                        <VCIcon name=\"fa6-solid:minus\" />\n                    </VCButton>\n                </template>\n            </VCFormInput>\n        </VCFormGroup>\n    </IFieldValidation>\n</template>\n","<!--\n  - Copyright (c) 2025.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n\n<script lang=\"ts\">\nimport type { PropType } from 'vue';\nimport {\n    computed,\n    defineComponent,\n    ref,\n} from 'vue';\nimport AFormInputListItem from './AFormInputListItem.vue';\nimport {\n    TranslatorTranslationActionKey,\n    TranslatorTranslationCommonKey,\n    TranslatorTranslationFieldKey,\n    TranslatorTranslationNamespace,\n} from '@authup/i18n';\nimport { VCAlert } from '@vuecs/elements';\nimport type { ButtonSize } from '@vuecs/button';\nimport { VCButton } from '@vuecs/button';\nimport { VCIcon } from '@vuecs/icon';\nimport { DEFAULT_BUTTON_SIZE, useTranslations } from '../../../core';\n\nexport default defineComponent({\n    components: {\n        AFormInputListItem,\n        VCAlert,\n        VCButton,\n        VCIcon,\n    },\n    props: {\n        names: {\n            type: Array as PropType<string[]>,\n            default: () => [],\n        },\n        minItems: {\n            type: Number,\n            default: 0,\n        },\n        maxItems: {\n            type: Number,\n            default: 100,\n        },\n        size: {\n            type: String as PropType<ButtonSize>,\n            default: DEFAULT_BUTTON_SIZE,\n        },\n    },\n    emits: ['changed'],\n    setup(props, setup) {\n        const translationsAction = useTranslations([\n            {\n                namespace: TranslatorTranslationNamespace.ACTION,\n                key: TranslatorTranslationActionKey.ADD,\n            },\n        ]);\n\n        const translationsDefault = useTranslations([\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.NAMES,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.COMMON,\n                key: TranslatorTranslationCommonKey.NO_ITEMS,\n            },\n        ]);\n\n        let counter = 0;\n        const items = ref<{\n            id: number,\n            value: string \n        }[]>([]);\n\n        const add = (item?: string) => {\n            items.value.push({\n                id: counter++,\n                value: item || '',\n            });\n        };\n\n        function assign() {\n            items.value = [];\n\n            props.names.map((el) => add(el));\n\n            if (items.value.length < props.minItems) {\n                for (let i = 0; i < props.minItems - items.value.length; i++) {\n                    add();\n                }\n            }\n        }\n\n        setup.expose({ assign });\n\n        assign();\n\n        const canAdd = computed(() => items.value.length < props.maxItems);\n\n        const canDrop = computed(() => items.value.length > props.minItems);\n\n        const emitUpdated = () => {\n            setup.emit('changed', [\n                ...items.value\n                    .map((el) => el.value)\n                    .filter(Boolean),\n            ]);\n        };\n\n        const handleUpdated = (id: number, value: string) => {\n            const index = items.value.findIndex((el) => el.id === id);\n            if (index > -1 && items.value[index]) {\n                items.value[index].value = value;\n            }\n\n            emitUpdated();\n        };\n\n        const handleDeleted = (id: number) => {\n            if (items.value.length <= props.minItems) {\n                return;\n            }\n\n            const index = items.value.findIndex((el) => el.id === id);\n            if (index > -1) {\n                items.value.splice(index, 1);\n            }\n\n            emitUpdated();\n        };\n\n        return {\n            add,\n\n            canAdd,\n            canDrop,\n\n            handleDeleted,\n            handleUpdated,\n\n            items,\n\n            translationsAction,\n            translationsDefault,\n        };\n    },\n});\n</script>\n<template>\n    <div class=\"flex flex-col gap-2\">\n        <div class=\"flex flex-row\">\n            <div class=\"self-end\">\n                <slot name=\"label\">\n                    {{ translationsDefault.names }}\n                </slot>\n            </div>\n            <div class=\"ms-auto\">\n                <VCButton\n                    :size=\"size\"\n                    color=\"primary\"\n                    type=\"button\"\n                    :disabled=\"!canAdd\"\n                    @click.prevent=\"add()\"\n                >\n                    <VCIcon name=\"fa6-solid:plus\" /> {{ translationsAction.add }}\n                </VCButton>\n            </div>\n        </div>\n        <div class=\"flex flex-col gap-1\">\n            <template v-if=\"items.length === 0\">\n                <slot name=\"noItems\">\n                    <VCAlert\n                        color=\"info\"\n                        variant=\"soft\"\n                        size=\"sm\"\n                        class=\"mb-3\"\n                    >\n                        {{ translationsDefault.noItems }}\n                    </VCAlert>\n                </slot>\n            </template>\n            <template\n                v-for=\"item in items\"\n                :key=\"item.id\"\n            >\n                <slot\n                    name=\"default\"\n                    :item=\"item\"\n                    :updated=\"handleUpdated\"\n                    :deleted=\"handleDeleted\"\n                >\n                    <AFormInputListItem\n                        :key=\"item.id\"\n                        :disabled=\"!canDrop\"\n                        :name=\"item.value\"\n                        @updated=\"(input) => { handleUpdated(item.id, input) }\"\n                        @deleted=\"() => { handleDeleted(item.id) }\"\n                    />\n                </slot>\n            </template>\n        </div>\n        <slot name=\"hint\" />\n    </div>\n</template>\n","<!--\n  - Copyright (c) 2025.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n\n<script lang=\"ts\">\nimport type { PropType } from 'vue';\nimport {\n    computed,\n    defineComponent,\n    ref,\n} from 'vue';\nimport AFormInputListItem from './AFormInputListItem.vue';\nimport {\n    TranslatorTranslationActionKey,\n    TranslatorTranslationCommonKey,\n    TranslatorTranslationFieldKey,\n    TranslatorTranslationNamespace,\n} from '@authup/i18n';\nimport { VCAlert } from '@vuecs/elements';\nimport type { ButtonSize } from '@vuecs/button';\nimport { VCButton } from '@vuecs/button';\nimport { VCIcon } from '@vuecs/icon';\nimport { DEFAULT_BUTTON_SIZE, useTranslations } from '../../../core';\n\nexport default defineComponent({\n    components: {\n        AFormInputListItem,\n        VCAlert,\n        VCButton,\n        VCIcon,\n    },\n    props: {\n        names: {\n            type: Array as PropType<string[]>,\n            default: () => [],\n        },\n        minItems: {\n            type: Number,\n            default: 0,\n        },\n        maxItems: {\n            type: Number,\n            default: 100,\n        },\n        size: {\n            type: String as PropType<ButtonSize>,\n            default: DEFAULT_BUTTON_SIZE,\n        },\n    },\n    emits: ['changed'],\n    setup(props, setup) {\n        const translationsAction = useTranslations([\n            {\n                namespace: TranslatorTranslationNamespace.ACTION,\n                key: TranslatorTranslationActionKey.ADD,\n            },\n        ]);\n\n        const translationsDefault = useTranslations([\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.NAMES,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.COMMON,\n                key: TranslatorTranslationCommonKey.NO_ITEMS,\n            },\n        ]);\n\n        let counter = 0;\n        const items = ref<{\n            id: number,\n            value: string \n        }[]>([]);\n\n        const add = (item?: string) => {\n            items.value.push({\n                id: counter++,\n                value: item || '',\n            });\n        };\n\n        function assign() {\n            items.value = [];\n\n            props.names.map((el) => add(el));\n\n            if (items.value.length < props.minItems) {\n                for (let i = 0; i < props.minItems - items.value.length; i++) {\n                    add();\n                }\n            }\n        }\n\n        setup.expose({ assign });\n\n        assign();\n\n        const canAdd = computed(() => items.value.length < props.maxItems);\n\n        const canDrop = computed(() => items.value.length > props.minItems);\n\n        const emitUpdated = () => {\n            setup.emit('changed', [\n                ...items.value\n                    .map((el) => el.value)\n                    .filter(Boolean),\n            ]);\n        };\n\n        const handleUpdated = (id: number, value: string) => {\n            const index = items.value.findIndex((el) => el.id === id);\n            if (index > -1 && items.value[index]) {\n                items.value[index].value = value;\n            }\n\n            emitUpdated();\n        };\n\n        const handleDeleted = (id: number) => {\n            if (items.value.length <= props.minItems) {\n                return;\n            }\n\n            const index = items.value.findIndex((el) => el.id === id);\n            if (index > -1) {\n                items.value.splice(index, 1);\n            }\n\n            emitUpdated();\n        };\n\n        return {\n            add,\n\n            canAdd,\n            canDrop,\n\n            handleDeleted,\n            handleUpdated,\n\n            items,\n\n            translationsAction,\n            translationsDefault,\n        };\n    },\n});\n</script>\n<template>\n    <div class=\"flex flex-col gap-2\">\n        <div class=\"flex flex-row\">\n            <div class=\"self-end\">\n                <slot name=\"label\">\n                    {{ translationsDefault.names }}\n                </slot>\n            </div>\n            <div class=\"ms-auto\">\n                <VCButton\n                    :size=\"size\"\n                    color=\"primary\"\n                    type=\"button\"\n                    :disabled=\"!canAdd\"\n                    @click.prevent=\"add()\"\n                >\n                    <VCIcon name=\"fa6-solid:plus\" /> {{ translationsAction.add }}\n                </VCButton>\n            </div>\n        </div>\n        <div class=\"flex flex-col gap-1\">\n            <template v-if=\"items.length === 0\">\n                <slot name=\"noItems\">\n                    <VCAlert\n                        color=\"info\"\n                        variant=\"soft\"\n                        size=\"sm\"\n                        class=\"mb-3\"\n                    >\n                        {{ translationsDefault.noItems }}\n                    </VCAlert>\n                </slot>\n            </template>\n            <template\n                v-for=\"item in items\"\n                :key=\"item.id\"\n            >\n                <slot\n                    name=\"default\"\n                    :item=\"item\"\n                    :updated=\"handleUpdated\"\n                    :deleted=\"handleDeleted\"\n                >\n                    <AFormInputListItem\n                        :key=\"item.id\"\n                        :disabled=\"!canDrop\"\n                        :name=\"item.value\"\n                        @updated=\"(input) => { handleUpdated(item.id, input) }\"\n                        @deleted=\"() => { handleDeleted(item.id) }\"\n                    />\n                </slot>\n            </template>\n        </div>\n        <slot name=\"hint\" />\n    </div>\n</template>\n","/*\n * Copyright (c) 2023.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { VCPagination } from '@vuecs/pagination';\nimport type { PropType } from 'vue';\nimport { defineComponent, h } from 'vue';\n\ntype PaginationLoadFn = (data?: any) => Promise<void> | void;\n\n/**\n * Thin adapter mapping authup's entity-collection footer contract\n * (`{ busy, meta, load }`, where `meta` is rapiq's\n * `{ total, pagination: { limit, offset } }`) onto `<VCPagination>`.\n *\n * `<VCPagination>` is `inline-flex`, so the wrapping `flex justify-center`\n * centers it for every collection footer without each caller adding a\n * wrapper.\n */\nexport const APagination = defineComponent({\n    props: {\n        total: { type: Number },\n        meta: { type: Object as PropType<Record<string, any>> },\n        busy: { type: Boolean },\n        load: { type: Function as PropType<PaginationLoadFn> },\n    },\n    setup(props) {\n        return () => {\n            const total = props.meta?.total ?? props.total ?? 0;\n            const limit = props.meta?.pagination?.limit ?? 0;\n            const offset = props.meta?.pagination?.offset ?? 0;\n            const busy = props.meta?.busy ?? props.busy ?? false;\n\n            return h('div', { class: 'flex justify-center' }, [\n                h(VCPagination, {\n                    total,\n                    limit,\n                    offset,\n                    busy,\n                    // `hideDisabled` unrenders edge controls (First / Prev\n                    // on page 1, Next / Last on the last page) instead of\n                    // rendering them disabled.\n                    hideDisabled: true,\n                    // VCPagination emits `load` with `{ page, offset, limit }`\n                    // (NOT `update:page`). Only pagination travels — the\n                    // collection manager retains filter/sort state itself.\n                    onLoad: (payload: { offset: number }) => {\n                        void props.load?.({\n                            pagination: {\n                                limit,\n                                offset: payload.offset,\n                            },\n                        });\n                    },\n                }),\n            ]);\n        };\n    },\n});\n","/*\n * Copyright (c) 2023.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport type { EntityListQueryInput } from '../../../../../core';\nimport type { PropType } from 'vue';\nimport type {\n    EntityCollectionVEmitOptions,\n    ListBodyOptions, \n    ListFooterOptions, \n    ListHeaderOptions, \n    ListLoadingOptions, \n    ListNoMoreOptions,\n} from '../types';\n\nexport function defineEntityCollectionVEmitOptions<T>() : EntityCollectionVEmitOptions<T> {\n    return {\n\n        created: (_item: T) => true,\n\n        deleted: (_item: T) => true,\n\n        updated: (_item: T) => true,\n\n        failed: (_error: Error) => true,\n    };\n}\nexport function defineEntityCollectionVProps<T>() {\n    return {\n        query: {\n            type: Object as PropType<EntityListQueryInput<T extends Record<string, any> ? T : never>>,\n            default() {\n                return {};\n            },\n        },\n        realmId: {\n            type: String,\n            default: undefined,\n        },\n        loadOnSetup: {\n            type: Boolean,\n            default: true,\n        },\n        loading: {\n            type: [Boolean, Object] as PropType<boolean | ListLoadingOptions<T>>,\n            default: true,\n        },\n        noMore: {\n            type: [Boolean, Object] as PropType<boolean | ListNoMoreOptions<T>>,\n            default: true,\n        },\n        footer: {\n            type: [Boolean, Object] as PropType<boolean | ListFooterOptions<T>>,\n            default: true,\n        },\n        header: {\n            type: [Boolean, Object] as PropType<boolean | ListHeaderOptions<T>>,\n            default: true,\n        },\n        body: { type: Object as PropType<ListBodyOptions<T>> },\n    };\n}\n","/*\n * Copyright (c) 2022.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { merge } from 'smob';\nimport type { EntityCollectionRenderOptions, EntityCollectionVProps } from '../types';\n\nfunction mergeListOption<T extends boolean | Record<string, any> | undefined>(\n    primary: T,\n    secondary: T,\n) : T {\n    if (typeof secondary === 'undefined') {\n        return primary;\n    }\n\n    if (typeof primary === 'undefined') {\n        return secondary;\n    }\n\n    if (typeof primary === 'boolean' && !primary) {\n        return primary;\n    }\n\n    const primaryRecord = typeof primary === 'boolean' ? {} : primary;\n    const secondaryRecord = typeof secondary === 'boolean' ? {} : secondary;\n\n    return merge(primaryRecord, secondaryRecord) as T;\n}\n\nexport function mergeEntityCollectionRenderOptions<T>(\n    props: EntityCollectionVProps<T>,\n    defaults: Partial<EntityCollectionRenderOptions<T>>,\n) : EntityCollectionRenderOptions<T> {\n    const output : Partial<EntityCollectionRenderOptions<T>> = {\n        body: defaults.body,\n        item: defaults.item,\n    };\n\n    output.header = mergeListOption(props.header, defaults.header);\n    output.noMore = mergeListOption(props.noMore, defaults.noMore);\n    output.footer = mergeListOption(props.footer, defaults.footer);\n    output.loading = mergeListOption(props.loading, defaults.loading);\n\n    return output as EntityCollectionRenderOptions<T>;\n}\n","/*\n * Copyright (c) 2022-2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport type { ObjectLiteral } from '@authup/kit';\nimport type { Ref } from 'vue';\n\ntype EntityFn<T> = (entity: T) => void | Promise<void>;\n\ntype Options<T> = {\n    created?: EntityFn<T>,\n    updated?: EntityFn<T>,\n    deleted?: EntityFn<T>,\n};\n\ntype StackItem<T> = {\n    data: T,\n    operation: 'created' | 'deleted' | 'updated'\n};\n\nexport class ListHandlers<T extends ObjectLiteral> {\n    protected data: Ref<T[]>;\n\n    protected options : Options<T>;\n\n    protected stack : StackItem<T>[];\n\n    protected stackProcessing : boolean;\n\n    constructor(\n        data: Ref<T[]>,\n        options: Options<T> = {},\n    ) {\n        this.data = data;\n        this.options = options;\n        this.stack = [];\n\n        this.stackProcessing = false;\n    }\n\n    protected process() {\n        if (this.stackProcessing) {\n            return;\n        }\n\n        this.stackProcessing = true;\n\n        const item = this.stack.shift();\n        if (!item) {\n            this.stackProcessing = false;\n            return;\n        }\n\n        const index = this.data.value.findIndex(\n            (el: T) => (el as Record<string, any>).id === (item.data as Record<string, any>).id,\n        );\n\n        switch (item.operation) {\n            case 'created': {\n                if (index === -1) {\n                    this.data.value.push(item.data);\n\n                    if (this.options.created) {\n                        this.options.created(item.data);\n                    }\n                }\n                break;\n            }\n            case 'updated': {\n                const existing = index !== -1 ? this.data.value[index] : undefined;\n                if (existing) {\n                    const keys = Object.keys(item.data) as (keyof T)[];\n                    for (const key of keys) {\n                        existing[key] = item.data[key];\n                    }\n\n                    if (this.options.updated) {\n                        this.options.updated(existing);\n                    }\n                }\n                break;\n            }\n            case 'deleted': {\n                if (index !== -1) {\n                    const [output] = this.data.value.splice(index, 1);\n\n                    if (output && this.options.deleted) {\n                        this.options.deleted(output);\n                    }\n                }\n                break;\n            }\n        }\n\n        this.stackProcessing = false;\n\n        this.process();\n    }\n\n    created(item: T) {\n        this.stack.push({\n            data: item,\n            operation: 'created',\n        });\n\n        this.process();\n    }\n\n    updated(item: T) {\n        this.stack.push({\n            data: item,\n            operation: 'updated',\n        });\n\n        this.process();\n    }\n\n    deleted(item: T) {\n        this.stack.push({\n            data: item,\n            operation: 'deleted',\n        });\n\n        this.process();\n    }\n}\n","/*\n * Copyright (c) 2023.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { EntityType } from '@authup/core-kit';\nimport { SlotName } from '../../../../core';\n\n/**\n * The field every entity's free-text search matches against.\n */\nexport const ENTITY_SEARCH_FIELD_DEFAULT = 'name';\n\n/**\n * Extra fields the default free-text search matches alongside `name`, keyed\n * by entity type.\n *\n * This mirrors each entity's server-side `filters.allowed`\n * (`apps/server-core/src/core/entities/<entity>/schema.ts`). rapiq's v2\n * expression dialect resolves keys strictly and answers an unknown one with\n * `keyNotAllowed` (400) rather than pruning it, so naming a field a schema\n * does not allow turns search into a failed request instead of a narrower\n * one. Keep the two in step when a schema's allow-list changes.\n *\n * An entity absent here searches `name` alone. A page needing something\n * richer passes its own `queryFilters` hook, which wins over this map.\n */\nexport const ENTITY_SEARCH_FIELDS : Partial<Record<EntityType, string[]>> = {\n    [EntityType.CLIENT]: ['displayName'],\n    [EntityType.IDENTITY_PROVIDER]: ['displayName'],\n    [EntityType.PERMISSION]: ['displayName'],\n    [EntityType.POLICY]: ['displayName'],\n    [EntityType.REALM]: ['displayName'],\n    [EntityType.ROLE]: ['displayName'],\n    [EntityType.SCOPE]: ['displayName'],\n    [EntityType.USER]: ['displayName'],\n};\n\nexport enum EntityCollectionSlotName {\n    DEFAULT = SlotName.DEFAULT,\n    BODY = SlotName.BODY,\n    ITEM = SlotName.ITEM,\n    ITEM_ACTIONS = SlotName.ITEM_ACTIONS,\n    ITEM_ACTIONS_EXTRA = SlotName.ITEM_ACTIONS_EXTRA,\n    HEADER = SlotName.HEADER,\n    HEADER_SEARCH = 'headerSearch',\n    HEADER_SEARCH_ICON = 'headerSearchIcon',\n    HEADER_TITLE = 'headerTitle',\n    HEADER_TITLE_ICON = 'headerTitleIcon',\n    FOOTER = SlotName.FOOTER,\n    NO_MORE = SlotName.NO_MORE,\n    LOADING = SlotName.LOADING,\n}\n","/*\n * Copyright (c) 2026.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport type { EntityType } from '@authup/core-kit';\nimport type { ICondition } from '@rapiq/core';\nimport { contains, or } from '@rapiq/core';\nimport { ENTITY_SEARCH_FIELDS, ENTITY_SEARCH_FIELD_DEFAULT } from '../constants';\n\n/**\n * The condition a bare search string becomes when a collection declares no\n * `queryFilters` hook: a substring match against `name` plus every extra\n * field the entity's schema allows (`displayName` today).\n *\n * A single field stays a plain `contains` rather than a one-armed `or`,\n * which would only add a compound wrapper to the query string.\n */\nexport function buildEntitySearchCondition(type: string, value: string) : ICondition {\n    const base = contains(ENTITY_SEARCH_FIELD_DEFAULT, value);\n\n    const extra = (ENTITY_SEARCH_FIELDS[type as EntityType] || [])\n        .map((field) => contains(field, value));\n\n    if (extra.length === 0) {\n        return base;\n    }\n\n    return or(base, ...extra);\n}\n","/*\n * Copyright (c) 2023.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nexport function boolableToObject<T extends Record<string, any>>(input: T | boolean) : T {\n    if (typeof input === 'boolean') {\n        return {} as T;\n    }\n\n    return input;\n}\n","/*\n * Copyright (c) 2023-2023.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { EntityDefaultEventName, REALM_MASTER_NAME, buildEntityChannelName } from '@authup/core-kit';\nimport type {\n    EntityType,\n    EntityTypeMap,\n    EventRecord,\n} from '@authup/core-kit';\nimport type { EventFullName, STCEventContext } from '@authup/core-realtime-kit';\nimport { EventNameSuffix, buildEventFullName } from '@authup/core-realtime-kit';\nimport {\n    computed,\n    isRef,\n    onMounted,\n    onUnmounted,\n    watch,\n} from 'vue';\nimport { injectStore, storeToRefs } from '../../../../core/store';\nimport type { EntitySocketManager, EntitySocketManagerCreateContext } from './type';\nimport { injectSocketManager, isSocketManagerUsable } from '../../../../core/socket-manager';\n\nfunction create<\n    TYPE extends string,\n    RECORD extends Record<string, any>,\n>(\n    ctx: EntitySocketManagerCreateContext<TYPE, RECORD>,\n) : EntitySocketManager {\n    if (!isSocketManagerUsable()) {\n        return {\n            mount() {\n\n            },\n            unmount() {\n\n            },\n        };\n    }\n\n    const socketManager = injectSocketManager();\n    const store = injectStore();\n    const storeRefs = storeToRefs(store);\n\n    const realmId = computed(() => {\n        if (storeRefs.realmName.value === REALM_MASTER_NAME) {\n            return undefined;\n        }\n\n        if (isRef(ctx.realmId)) {\n            return ctx.realmId.value;\n        }\n\n        if (ctx.realmId) {\n            return ctx.realmId;\n        }\n\n        return storeRefs.realmId.value;\n    });\n\n    const targetId = computed(\n        () => (\n            isRef(ctx.targetId) ?\n                ctx.targetId.value :\n                ctx.targetId\n        ),\n    );\n\n    const lockId = computed(\n        () => (\n            isRef(ctx.lockId) ?\n                ctx.lockId.value :\n                ctx.lockId\n        ),\n    );\n\n    const processEvent = (\n        event: STCEventContext<EventRecord<TYPE, RECORD>>,\n    ) : boolean => {\n        if (\n            ctx.processEvent &&\n            !ctx.processEvent(event, realmId.value)\n        ) {\n            return false;\n        }\n\n        const channelName = ctx.buildChannelName ?\n            ctx.buildChannelName(targetId.value) :\n            buildEntityChannelName(ctx.type, targetId.value);\n\n        if (event.meta.roomName !== channelName) {\n            return false;\n        }\n\n        if (ctx.target && (!targetId.value || targetId.value !== event.data.id)) {\n            return false;\n        }\n\n        return event.data.id !== lockId.value;\n    };\n\n    const handleCreated = (\n        event: STCEventContext<EventRecord<TYPE, RECORD>>,\n    ) => {\n        if (!processEvent(event)) {\n            return;\n        }\n\n        if (ctx.onCreated) {\n            ctx.onCreated(event.data as RECORD);\n        }\n    };\n\n    const handleUpdated = (\n        event: STCEventContext<EventRecord<TYPE, RECORD>>,\n    ) => {\n        if (!processEvent(event)) {\n            return;\n        }\n\n        if (ctx.onUpdated) {\n            ctx.onUpdated(event.data as RECORD);\n        }\n    };\n    const handleDeleted = (\n        event: STCEventContext<EventRecord<TYPE, RECORD>>,\n    ) => {\n        if (!processEvent(event)) {\n            return;\n        }\n\n        if (ctx.onDeleted) {\n            ctx.onDeleted(event.data as RECORD);\n        }\n    };\n\n    let mounted = false;\n    const mount = async () => {\n        if (mounted || (ctx.target && !targetId.value)) {\n            return;\n        }\n\n        mounted = true;\n\n        const socket = await socketManager.connect(`/resources#${realmId.value}`);\n\n        let event : EventFullName<TYPE, `${EventNameSuffix.SUBSCRIBE}`> | undefined;\n        if (ctx.buildSubscribeEventName) {\n            event = ctx.buildSubscribeEventName();\n        } else {\n            event = buildEventFullName(\n                ctx.type as TYPE,\n                EventNameSuffix.SUBSCRIBE,\n            );\n        }\n\n        socket.emit(\n            event,\n            targetId.value,\n        );\n\n        if (ctx.onCreated) {\n            socket.on(buildEventFullName(\n                ctx.type as `${EntityType}`,\n                EntityDefaultEventName.CREATED,\n            ), handleCreated);\n        }\n\n        if (ctx.onUpdated) {\n            socket.on(buildEventFullName(\n                ctx.type as `${EntityType}`,\n                EntityDefaultEventName.UPDATED,\n            ), handleUpdated);\n        }\n\n        if (ctx.onDeleted) {\n            socket.on(buildEventFullName(\n                ctx.type as `${EntityType}`,\n                EntityDefaultEventName.DELETED,\n            ), handleDeleted);\n        }\n    };\n\n    const unmount = async () => {\n        if (!mounted || (ctx.target && !targetId.value)) {\n            return;\n        }\n\n        mounted = false;\n\n        const socket = await socketManager.connect(`/resources#${realmId.value}`);\n\n        let event : EventFullName<TYPE, `${EventNameSuffix.UNSUBSCRIBE}`>;\n        if (ctx.buildUnsubscribeEventName) {\n            event = ctx.buildUnsubscribeEventName();\n        } else {\n            event = buildEventFullName(\n                ctx.type as TYPE,\n                EventNameSuffix.UNSUBSCRIBE,\n            );\n        }\n\n        socket.emit(\n            event,\n            targetId.value,\n        );\n\n        if (ctx.onCreated) {\n            socket.off(buildEventFullName(\n                ctx.type as `${EntityType}`,\n                EntityDefaultEventName.UPDATED,\n            ), handleCreated);\n        }\n\n        if (ctx.onUpdated) {\n            socket.off(buildEventFullName(\n                ctx.type as `${EntityType}`,\n                EntityDefaultEventName.UPDATED,\n            ), handleUpdated);\n        }\n\n        if (ctx.onDeleted) {\n            socket.off(buildEventFullName(\n                ctx.type as `${EntityType}`,\n                EntityDefaultEventName.DELETED,\n            ), handleDeleted);\n        }\n    };\n\n    onMounted(() => mount());\n    onUnmounted(() => unmount());\n\n    watch(targetId, (val, oldValue) => {\n        if (val !== oldValue) {\n            Promise.resolve()\n                .then(() => unmount())\n                .then(() => mount());\n        }\n    });\n\n    return {\n        mount,\n        unmount,\n    };\n}\n\nexport function defineEntitySocketManager<\n    A extends keyof EntityTypeMap,\n>(\n    ctx: EntitySocketManagerCreateContext<A, EntityTypeMap[A]>,\n) : EntitySocketManager {\n    return create(ctx);\n}\n","/*\n * Copyright (c) 2022-2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { hasOwnProperty } from '@authup/kit';\nimport { buildQueryString, pickEntityAPI } from '@authup/core-http-kit';\nimport type { EntityTypeMap } from '@authup/core-kit';\nimport {\n    VCList,\n    VCListBody,\n    VCListEmpty,\n    VCListItem,\n    VCListLoading,\n} from '@vuecs/list';\nimport type {\n    FiltersBuildInput,\n    ICondition,\n    IFilters,\n    IQuery,\n    PaginationBuildInput,\n} from '@rapiq/core';\nimport {\n    Query,\n    defineFilters,\n    definePagination,\n    isQuery,\n    mergeQueries,\n} from '@rapiq/core';\nimport type { EntityListQueryInput } from '../../../../core';\nimport type { Ref, VNodeChild } from 'vue';\nimport {\n    Fragment,\n    computed,\n    h,\n    isRef,\n    onServerPrefetch,\n    ref,\n    unref,\n} from 'vue';\nimport { EntityCollectionSlotName } from './constants';\nimport { isObject } from 'smob';\nimport { boolableToObject } from '../../../../utils';\nimport { injectHTTPClient } from '../../../../core/http-client';\nimport { injectHydrationStore } from '../../../../core/hydration';\nimport { defineEntitySocketManager } from '../socket';\nimport type { EntitySocketManagerCreateContext } from '../socket';\nimport {\n    isCondition,\n    isQuerySortedDescByDate,\n    normalizeQueryInput,\n} from '../../../../core/query';\nimport type {\n    EntityCollectionHydrationSnapshot,\n    EntityCollectionManager,\n    EntityCollectionManagerCreateContext,\n    EntityCollectionRenderOptions,\n    ListFooterOptions,\n    ListHeaderOptions,\n    ListItemSlotProps,\n    ListLoadingOptions,\n    ListMeta,\n    ListNoMoreOptions,\n    ListSlotProps,\n} from './types';\nimport {\n    ListHandlers,\n    buildEntitySearchCondition,\n    mergeEntityCollectionRenderOptions,\n} from './utils';\nimport { isError } from '@authup/errors';\n\ntype Entity<A> = A extends Record<string, any> ? A : never;\n\ntype ComposedQuery = {\n    query: Query,\n    interactive: Query\n};\n\nfunction stripPagination(input: IQuery) : Query {\n    return new Query({\n        fields: input.fields,\n        filters: input.filters,\n        relations: input.relations,\n        sorts: input.sorts,\n    });\n}\n\nfunction create<\n    TYPE extends keyof EntityTypeMap,\n    RECORD extends EntityTypeMap[TYPE],\n>(\n    context: EntityCollectionManagerCreateContext<TYPE, RECORD>,\n) : EntityCollectionManager<RECORD> {\n    const data : Ref<RECORD[]> = ref([]);\n    const busy = ref(false);\n    const total = ref(0);\n    const meta = ref<ListMeta>({ pagination: { limit: 10 } });\n\n    const realmId = computed<string | undefined>(\n        () => {\n            if (context.realmId) {\n                return isRef(context.realmId) ? context.realmId.value : context.realmId;\n            }\n\n            if (context.props.realmId) {\n                return context.props.realmId;\n            }\n\n            return undefined;\n        },\n    );\n\n    const client = injectHTTPClient();\n    const hydration = injectHydrationStore();\n\n    const domainAPI = pickEntityAPI<TYPE, Entity<RECORD>>(client, context.type);\n    // Captured bound, so the load fn's guard survives the query\n    // composition between guard and call (property narrowing does not).\n    const getMany = domainAPI?.getMany ?\n        domainAPI.getMany.bind(domainAPI) :\n        undefined;\n\n    // Last composed query (IR) — read by the socket handler's sort check.\n    let query : IQuery | undefined;\n\n    // Whether the last `load` ran to completion. A load that failed leaves the\n    // list empty, which must NOT be handed to the client as a result.\n    let loadCompleted = false;\n\n    // Interactive query state (search filters, sort changes, ...) retained\n    // across loads, so pagination / loadAll continuations keep the current\n    // search without round-tripping query state through ListMeta.\n    // Pagination is deliberately excluded — it lives in `meta`.\n    let interactive : IQuery | undefined;\n\n    const resolveBaseQuery = () : IQuery => {\n        let contextQuery : IQuery | undefined;\n        if (context.query) {\n            contextQuery = normalizeQueryInput(\n                typeof context.query === 'function' ? context.query() : context.query,\n            );\n        }\n\n        let propsQuery : IQuery | undefined;\n        if (context.props.query) {\n            propsQuery = normalizeQueryInput(context.props.query);\n        }\n\n        if (propsQuery && contextQuery) {\n            return mergeQueries(propsQuery, contextQuery);\n        }\n\n        return propsQuery || contextQuery || new Query();\n    };\n\n    const failed = (error: Error) => {\n        if (context.setup && typeof context.setup.emit === 'function') {\n            context.setup.emit('failed', error);\n        }\n    };\n\n    // Compose the query a load will send: input parameters over retained\n    // interactive state over pagination state over the injected base scope.\n    // Pure: the caller decides what to do with the result, so the initial\n    // load's query can also be derived up front for the hydration key.\n    /**\n     * Compares two filter trees by the wire form rapiq itself emits, so\n     * structurally equal conditions compare equal without this module\n     * knowing the IR's shape.\n     */\n    function serializeFilters(source: IQuery) : string {\n        return buildQueryString(new Query({ filters: source.filters }));\n    }\n\n    function composeQuery(input: EntityListQueryInput<Entity<RECORD>>) : ComposedQuery {\n        let inputQuery : IQuery;\n        let interactiveNext : Query;\n\n        if (isQuery(input)) {\n            // An assembled query is taken literally — it replaces the\n            // whole interactive state (minus pagination).\n            inputQuery = input;\n            interactiveNext = stripPagination(input);\n        } else {\n            inputQuery = normalizeQueryInput(input);\n\n            let filtersOverride : IFilters | undefined;\n            if (\n                input.filters &&\n                !isCondition(input.filters) &&\n                hasOwnProperty(input.filters, 'name') &&\n                typeof input.filters.name === 'string' &&\n                input.filters.name.length > 0\n            ) {\n                // Search input arrives as a bare `name` string. A raw wire\n                // marker (`~text`) is NOT interpreted by the rapiq v2 IR\n                // builder (it becomes eq('name','~text')), so build the\n                // condition explicitly: the queryFilters hook when provided\n                // (anything richer), else a substring match over the entity's\n                // searchable fields.\n                const transformed = context.queryFilters ?\n                    context.queryFilters(input.filters.name) :\n                    buildEntitySearchCondition(context.type, input.filters.name);\n                filtersOverride = defineFilters(\n                    transformed as FiltersBuildInput | ICondition,\n                );\n            }\n\n            // Per-parameter replace: a parameter present on the input\n            // supersedes the retained interactive value, an absent one\n            // keeps it (a pagination-only load keeps the search).\n            //\n            // Sorts accept both spellings: rapiq 2.1.0 made `sorts` the\n            // canonical build-input key and kept `sort` as a deprecated\n            // alias, so checking only one silently drops a load carrying\n            // the other. They are matched on a DEFINED value rather than\n            // key presence (the `in` the siblings use), because rapiq\n            // documents the spread migration wrapper\n            // `{ sorts: props.sorts, sort: props.sort }` as safe: it\n            // carries both keys as `undefined`, which `in` reads as\n            // \"supplied\" and would wipe the retained sorts. Supplying\n            // both with values throws KEY_AMBIGUOUS at desugaring above.\n            const sortsSupplied = typeof input.sorts !== 'undefined' ||\n                typeof input.sort !== 'undefined';\n\n            interactiveNext = new Query({\n                fields: 'fields' in input ? inputQuery.fields : interactive?.fields,\n                filters: filtersOverride ??\n                    ('filters' in input ? inputQuery.filters : interactive?.filters),\n                relations: 'relations' in input ? inputQuery.relations : interactive?.relations,\n                sorts: sortsSupplied ? inputQuery.sorts : interactive?.sorts,\n            });\n        }\n\n        const base = resolveBaseQuery();\n\n        // A load that CHANGES the filters must not inherit the retained\n        // offset. The freshly narrowed set is shorter, so page 2+ asks for\n        // rows past its end and renders an empty list (issue #3443). Every\n        // narrowing control used to reset the offset itself, which made\n        // correctness a matter of caller discipline and left the second one\n        // to forget it; the manager owns the retained pagination, so it\n        // owns this. The very first load is exempt (nothing changed yet),\n        // and an input carrying its own pagination still wins by merge\n        // precedence below.\n        const filtersChanged = typeof interactive !== 'undefined' &&\n            serializeFilters(interactiveNext) !== serializeFilters(interactive);\n\n        const statePagination : PaginationBuildInput = {};\n        if (typeof meta.value.pagination?.limit === 'number') {\n            statePagination.limit = meta.value.pagination.limit;\n        }\n        if (typeof meta.value.pagination?.offset === 'number') {\n            statePagination.offset = filtersChanged ? 0 : meta.value.pagination.offset;\n        }\n\n        return {\n            query: mergeQueries(\n                new Query({\n                    fields: interactiveNext.fields,\n                    filters: interactiveNext.filters,\n                    relations: interactiveNext.relations,\n                    sorts: interactiveNext.sorts,\n                    pagination: inputQuery.pagination,\n                }),\n                new Query({ pagination: definePagination(statePagination) }),\n                base,\n            ),\n            interactive: interactiveNext,\n        };\n    }\n\n    // Never rejects: callers don't reliably handle rejections — most call\n    // sites are fire-and-forget (the setup-time initial load below, template\n    // refs, pagination footers) and the awaiting ones don't catch. During SSR\n    // an unhandled rejection is fatal to the server process, so a failed load\n    // emits `failed` and leaves the list empty instead of throwing.\n    async function load(input: EntityListQueryInput<Entity<RECORD>> = {}) {\n        if (!getMany || busy.value) return;\n\n        busy.value = true;\n        meta.value.busy = true;\n\n        try {\n            loadCompleted = false;\n\n            const composed = composeQuery(input);\n\n            const response = await getMany(composed.query);\n\n            interactive = composed.interactive;\n            query = composed.query;\n\n            if (context.loadAll) {\n                data.value.push(...response.data as RECORD[]);\n            } else {\n                data.value = response.data as RECORD[];\n            }\n\n            total.value = response.meta.total;\n\n            meta.value.total = response.meta.total;\n            meta.value.pagination = {\n                limit: response.meta.limit,\n                offset: response.meta.offset,\n            };\n\n            loadCompleted = true;\n        } catch (e) {\n            failed(isError(e) ? e : new Error('The entities could not be loaded.'));\n            return;\n        } finally {\n            busy.value = false;\n            meta.value.busy = false;\n        }\n\n        if (\n            context.loadAll &&\n            total.value > data.value.length\n        ) {\n            await load({ pagination: { offset: (meta.value.pagination?.offset ?? 0) + (meta.value.pagination?.limit ?? 0) } });\n        }\n    }\n\n    // Identity of the request the initial load will make (entity type plus\n    // serialized query), derived the same way on both sides so the server\n    // render and the hydrating client agree on it. A key that cannot be\n    // derived simply means no handoff, and the client loads as it always did.\n    function resolveHandoff() : { key: string, initial: ComposedQuery } | undefined {\n        if (!hydration) {\n            return undefined;\n        }\n\n        try {\n            const initial = composeQuery({});\n\n            return {\n                key: `authup:collection:${context.type}${buildQueryString(initial.query)}`,\n                initial,\n            };\n        } catch {\n            return undefined;\n        }\n    }\n\n    // Three paths for the initial load: adopt a server-rendered snapshot,\n    // load inside `onServerPrefetch` so the renderer awaits the data and can\n    // hand it over, or fetch on the next microtask in the browser. Without a\n    // hydration store the server render loads nothing at all, because the\n    // response would be discarded when the render flushes.\n    function setupInitialLoad() {\n        const store = hydration;\n        const handoff = resolveHandoff();\n\n        // A server render only ever WRITES. It is the producer, so there is\n        // nothing of its own to adopt, and reading here would mean rendering\n        // whatever the store happens to hold — which is another request's rows\n        // if a host ever backs the store with something outliving one request.\n        // Keeping the server path write-only makes that leak impossible from\n        // here, independently of how a host wires the store.\n        if (typeof window === 'undefined') {\n            if (!store || !handoff) {\n                return;\n            }\n\n            onServerPrefetch(async () => {\n                await load();\n\n                // A failed render load leaves an empty list behind. Handing\n                // that over would strand the client on it (an adopted\n                // snapshot suppresses the load), so say nothing and let the\n                // browser fetch for itself.\n                if (!loadCompleted) {\n                    return;\n                }\n\n                store.set(handoff.key, {\n                    data: data.value,\n                    total: total.value,\n                    pagination: meta.value.pagination,\n                });\n            });\n\n            return;\n        }\n\n        if (store && handoff) {\n            const snapshot = store.get<EntityCollectionHydrationSnapshot<RECORD>>(handoff.key);\n            if (snapshot) {\n                // One-shot: navigating back to this list later must fetch\n                // again instead of replaying the first render's rows.\n                store.delete(handoff.key);\n\n                data.value = snapshot.data;\n                total.value = snapshot.total;\n\n                meta.value.total = snapshot.total;\n                if (snapshot.pagination) {\n                    meta.value.pagination = snapshot.pagination;\n                }\n\n                interactive = handoff.initial.interactive;\n                query = handoff.initial.query;\n\n                return;\n            }\n        }\n\n        Promise.resolve()\n            .then(() => load());\n    }\n\n    const handlers = new ListHandlers<RECORD>(data, {\n        created: (cbEntity) => {\n            total.value++;\n\n            if (context.onCreated) {\n                context.onCreated(cbEntity, meta.value);\n            }\n\n            if (context.setup && typeof context.setup.emit === 'function') {\n                context.setup.emit('created', cbEntity);\n            }\n        },\n        deleted: (cbEntity) => {\n            total.value--;\n\n            if (context.setup && typeof context.setup.emit === 'function') {\n                context.setup.emit('deleted', cbEntity);\n            }\n        },\n        updated: (cbEntity) => {\n            if (context.setup && typeof context.setup.emit === 'function') {\n                context.setup.emit('updated', cbEntity);\n            }\n        },\n    });\n\n\n    function render(defaults?: EntityCollectionRenderOptions<RECORD>) : VNodeChild {\n        let renderOptions : EntityCollectionRenderOptions<RECORD>;\n        if (defaults) {\n            renderOptions = mergeEntityCollectionRenderOptions(context.props, defaults);\n        } else {\n            renderOptions = context.props;\n        }\n        const headerOpt: ListHeaderOptions<RECORD> | undefined = boolableToObject(renderOptions.header || {});\n        const footerOpt: ListFooterOptions<RECORD> | undefined = boolableToObject(renderOptions.footer || {});\n        const noMoreOpt: ListNoMoreOptions<RECORD> | undefined = boolableToObject(renderOptions.noMore || {});\n        const loadingOpt: ListLoadingOptions<RECORD> | undefined = boolableToObject(renderOptions.loading || {});\n\n        const itemOpt = renderOptions.item ||\n            (renderOptions.body && typeof renderOptions.body === 'object' ?\n                renderOptions.body.item :\n                undefined);\n\n        const slots = context.setup.slots || {};\n\n        // Each callback delegates to the `handlers` instance which already\n        // updates total/data and emits the corresponding parent event —\n        // adding a parallel `context.setup.emit(...)` here would fire each\n        // event twice (silent data-corruption risk on entity mutations).\n        const slotProps = (): ListSlotProps<RECORD> => ({\n            data: data.value,\n            busy: busy.value,\n            total: total.value,\n            load,\n            meta: meta.value,\n            created: (value: RECORD) => handlers.created(value),\n            updated: (value: RECORD) => handlers.updated(value),\n            deleted: (value: RECORD) => handlers.deleted(value),\n        });\n\n        const renderChrome = (\n            slotName: EntityCollectionSlotName,\n            opt: ListHeaderOptions<RECORD> | undefined,\n            cssClass: string,\n            withSlotProps = true,\n        ): VNodeChild | null => {\n            const slot = slots[slotName];\n            if (slot) {\n                return h(\n                    opt?.tag ?? 'div',\n                    { class: cssClass },\n                    withSlotProps ? slot(slotProps()) : slot(undefined),\n                );\n            }\n            if (opt?.content) {\n                return h(opt.tag ?? 'div', { class: cssClass }, opt.content);\n            }\n            return null;\n        };\n\n        // <VCList> must receive `:data` / `:busy` / `:total` (or `:state`)\n        // — without them, the list context publishes an empty data ref,\n        // and child <VCListBody> / <VCListEmpty> short-circuit\n        // (return null) regardless of what slot vnodes the renderer\n        // emits. Symptom: junction list views (client-roles,\n        // client-permissions, …) render the header + footer but the\n        // body is silently dropped. See @vuecs/list source —\n        // `useList()` reads from the parent VCList's provided state,\n        // not from the children passed to VCListBody.\n        const listProps = {\n            data: data.value,\n            busy: busy.value,\n            total: total.value,\n            meta: meta.value,\n        };\n\n        // DEFAULT slot — if provided, takes over the entire list contents\n        // (legacy buildList contract). Used as the escape hatch for\n        // consumers that want full control over the list body.\n        const defaultSlot = slots[EntityCollectionSlotName.DEFAULT];\n        if (defaultSlot) {\n            return h(VCList, listProps, () => defaultSlot(slotProps()));\n        }\n\n        return h(VCList, listProps, () => {\n            const children: VNodeChild[] = [];\n\n            const headerVNode = renderOptions.header !== false ?\n                renderChrome(EntityCollectionSlotName.HEADER, headerOpt, 'vc-list-header') :\n                null;\n            if (headerVNode) children.push(headerVNode);\n\n            // BODY slot — if provided, the consumer renders the full body\n            // (e.g. a `<VCTable>` with `:columns` driving auto-render) and\n            // per-item rendering is skipped. Otherwise fall back to\n            // <VCListBody> + per-item <VCListItem>.\n            const bodySlot = slots[EntityCollectionSlotName.BODY];\n            if (bodySlot) {\n                children.push(bodySlot(slotProps()));\n            } else {\n                children.push(h(VCListBody, {}, () => {\n                    const renderLoadingBand = (overlay: boolean) => {\n                        if (renderOptions.loading === false) return null;\n                        const slot = slots[EntityCollectionSlotName.LOADING];\n                        if (slot) return slot(undefined);\n                        if (loadingOpt?.content) {\n                            return h(loadingOpt.tag ?? 'div', { class: 'vc-list-loading' }, loadingOpt.content);\n                        }\n                        return h(VCListLoading, { overlay });\n                    };\n\n                    // First-load: data is empty AND busy → show loading in place.\n                    if (busy.value && data.value.length === 0) {\n                        return renderLoadingBand(false);\n                    }\n\n                    if (data.value.length === 0) {\n                        return h(VCListEmpty);\n                    }\n\n                    // Refresh path: data shown AND busy → overlay loading on top\n                    // of existing rows so consumers still see refresh feedback\n                    // (the old buildList rendered an overlay here; without it\n                    // there's no signal that an in-flight reload is happening).\n                    const rows = data.value.map((item, index) => {\n                    // Same single-emit contract as `slotProps()`: handlers\n                    // already emits, so we delegate and don't double-fire.\n                        const itemSlotProps: ListItemSlotProps<RECORD> = {\n                            data: item,\n                            index,\n                            busy: busy.value,\n                            updated: (next: RECORD) => handlers.updated(next),\n                            deleted: (next: RECORD) => handlers.deleted(next),\n                        };\n                        return h(VCListItem, { key: item.id ?? index }, () => {\n                            const itemSlot = slots[EntityCollectionSlotName.ITEM];\n                            const itemActionsSlot = slots[EntityCollectionSlotName.ITEM_ACTIONS];\n                            const itemActionsExtraSlot = slots[EntityCollectionSlotName.ITEM_ACTIONS_EXTRA];\n\n                            let body: VNodeChild;\n                            if (itemSlot) {\n                                body = itemSlot(itemSlotProps);\n                            } else if (itemOpt?.content) {\n                                body = typeof itemOpt.content === 'function' ?\n                                    itemOpt.content(item, itemSlotProps) :\n                                    itemOpt.content;\n                            } else {\n                                body = h('span', String((hasOwnProperty(item, 'name') ? item.name : undefined) ?? item.id ?? ''));\n                            }\n\n                            if (!itemActionsSlot && !itemActionsExtraSlot) {\n                                return body;\n                            }\n\n                            // Push actions to the right edge of the row.\n                            // The legacy `@vuecs/list-controls` 2.x buildList\n                            // styled actions via the bootstrap theme's\n                            // `vc-list-item-actions` rule (margin-left auto);\n                            // the new `@vuecs/list` 1.x doesn't ship that\n                            // CSS. Without `ms-auto`, both body and toggle\n                            // stack flush-left inside the flex VCListItem\n                            // and the toggle looks like a continuation of\n                            // the row label. Bootstrap `ms-auto` keeps the\n                            // label left-aligned and floats the actions to\n                            // the right — matches every junction picker\n                            // (client/user/policy roles) consumer.\n                            const actionsNodes: VNodeChild[] = [];\n                            if (itemActionsSlot) {\n                                actionsNodes.push(itemActionsSlot(itemSlotProps));\n                            }\n                            if (itemActionsExtraSlot) {\n                                actionsNodes.push(itemActionsExtraSlot(itemSlotProps));\n                            }\n                            return [\n                                body,\n                                h(\n                                    'div',\n                                    { class: 'vc-list-item-actions ms-auto d-flex align-items-center gap-1' },\n                                    actionsNodes,\n                                ),\n                            ];\n                        });\n                    });\n\n                    if (busy.value) {\n                        return [rows, renderLoadingBand(true)];\n                    }\n                    return rows;\n                }));\n            }\n\n            // \"No more\" — empty-list indicator. Matches legacy\n            // `@vuecs/list-controls@2.x` `buildListNoMore` semantics:\n            // rendered ONLY when the list is empty (`total === 0`) and\n            // not currently loading. Entity wrappers (AIdentityProviders,\n            // AClients, …) pass `noMore: { content: translation.value }`\n            // expecting it to fire as the \"no items available\" message;\n            // it should NOT fire when the list has items (that would\n            // produce a stray \"no more entries\" tag below a populated\n            // list — pre-PR behaviour did not do that). When a custom\n            // <template #body> renders the data, noMore is the only\n            // empty-state indicator the renderer emits; the default\n            // (no-body-slot) path additionally renders <VCListEmpty>.\n            if (\n                renderOptions.noMore !== false &&\n                !busy.value &&\n                total.value === 0\n            ) {\n                const noMoreVNode = renderChrome(EntityCollectionSlotName.NO_MORE, noMoreOpt, 'vc-list-no-more', false);\n                if (noMoreVNode) children.push(noMoreVNode);\n            }\n\n            const footerVNode = renderOptions.footer !== false ?\n                renderChrome(EntityCollectionSlotName.FOOTER, footerOpt, 'vc-list-footer') :\n                null;\n            if (footerVNode) children.push(footerVNode);\n\n            return h(Fragment, children);\n        });\n    }\n\n    context.setup.expose({\n        handleCreated: (data: RECORD) => handlers.created(data),\n        handleDeleted: (data: RECORD) => handlers.deleted(data),\n        handleUpdated: (data: RECORD) => handlers.updated(data),\n        load,\n        data,\n    });\n\n    let loadOnSetup = true;\n    const propLoadOnSetup = unref(context.props.loadOnSetup);\n    if (typeof propLoadOnSetup === 'boolean') {\n        loadOnSetup = propLoadOnSetup;\n    }\n\n    if (loadOnSetup) {\n        setupInitialLoad();\n    }\n\n    if (\n        typeof context.socket !== 'boolean' ||\n        typeof context.socket === 'undefined' ||\n        context.socket\n    ) {\n        const socketContext : EntitySocketManagerCreateContext<TYPE, RECORD> = {\n            type: context.type,\n            ...(isObject(context.socket) ? context.socket : {}),\n        };\n\n        socketContext.onCreated = (entity) => {\n            const isSorted = query &&\n                isQuerySortedDescByDate(query.sorts) &&\n                meta.value?.pagination?.offset === 0;\n\n            if (isSorted || total.value < (meta.value?.pagination?.limit ?? 0)) {\n                handlers.created(entity);\n            }\n        };\n        socketContext.onDeleted = (entity: RECORD) => {\n            handlers.deleted(entity);\n        };\n        socketContext.onUpdated = (entity: RECORD) => {\n            handlers.updated(entity);\n        };\n        socketContext.realmId = realmId;\n\n        defineEntitySocketManager(socketContext);\n    }\n\n    return {\n        data,\n        busy,\n        meta,\n        total,\n\n        handleCreated: (entity: RECORD) => {\n            handlers.updated(entity);\n        },\n        handleDeleted: (entity: RECORD) => {\n            handlers.deleted(entity);\n        },\n        handleUpdated: (entity: RECORD) => {\n            handlers.updated(entity);\n        },\n\n        render,\n        load,\n    };\n}\n\nexport function defineEntityCollectionManager<\n    A extends keyof EntityTypeMap,\n>(\n    context: EntityCollectionManagerCreateContext<A, EntityTypeMap[A]>,\n) : EntityCollectionManager<EntityTypeMap[A]> {\n    return create(context);\n}\n","/*\n * Copyright (c) 2023.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nexport class EntityRecordError extends Error {\n    static unresolvable() {\n        return new this('Entity could not be resolved.');\n    }\n}\n","/*\n * Copyright (c) 2023.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport type { ICondition } from '@rapiq/core';\nimport type { EntityListQueryInput, QueryFieldsInput, QueryFiltersInput } from '../../../../core';\nimport { unref } from 'vue';\nimport type { PropType } from 'vue';\nimport type {\n    EntityManager,\n    EntityVEmitOptions,\n    EntityVSlotProps,\n} from './types';\n\nexport function buildEntityVSlotProps<T>(\n    input: EntityManager<T>,\n) : EntityVSlotProps<T> {\n    return {\n        ...input,\n        error: unref(input.error),\n        busy: unref(input.busy),\n        data: unref(input.data),\n        lockId: unref(input.lockId),\n    };\n}\n\nexport function defineEntityVEmitOptions<T>(): EntityVEmitOptions<T> {\n    return {\n         \n        failed: (_item: Error) => true,\n         \n        created: (_item: T) => true,\n         \n        deleted: (_item: T) => true,\n         \n        updated: (_item: T) => true,\n         \n        resolved: (_item?: T) => true,\n    };\n}\n\nexport function defineEntityVProps<T>() {\n    return {\n        entity: { type: Object as PropType<T> },\n        entityId: { type: String },\n        queryFilters: { type: Object as PropType<QueryFiltersInput<T extends Record<string, any> ? T : never> | ICondition> },\n        queryFields: { type: Object as PropType<QueryFieldsInput<T extends Record<string, any> ? T : never>> },\n        query: { type: Object as PropType<T extends Record<string, any> ? EntityListQueryInput<T> : never> },\n    };\n}\n","/*\n * Copyright (c) 2023-2023.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { pickEntityAPI } from '@authup/core-http-kit';\nimport type { EntityTypeMap } from '@authup/core-kit';\nimport type { ObjectLiteral } from '@authup/kit';\nimport { extendObject, hasOwnProperty } from '@authup/kit';\nimport type {\n    FieldsBuildInput,\n    FiltersBuildInput,\n    ICondition,\n    IQuery,\n    ObjectLiteral as RapiqObjectLiteral,\n} from '@rapiq/core';\nimport {\n    Query,\n    defineFields,\n    defineFilters,\n    definePagination,\n} from '@rapiq/core';\nimport { normalizeQueryInput } from '../../../../core/query';\nimport { isObject } from 'smob';\nimport type { Ref, VNodeChild } from 'vue';\nimport {\n    computed, \n    isRef, \n    ref, \n    toRef, \n    watch,\n} from 'vue';\nimport { hasNormalizedSlot, injectHTTPClient, normalizeSlot } from '../../../../core';\nimport type { EntitySocketManager, EntitySocketManagerCreateContext } from '../socket';\nimport { defineEntitySocketManager } from '../socket';\nimport { EntityRecordError } from './error';\nimport type {\n    EntityID,\n    EntityManager,\n    EntityManagerCreateContext,\n    ResourceManagerRenderFn,\n    ResourceManagerResolveContext,\n} from './types';\nimport { buildEntityVSlotProps } from './helpers';\n\nfunction create<\n    TYPE extends keyof EntityTypeMap,\n    RECORD extends EntityTypeMap[TYPE] & ObjectLiteral,\n>(\n    ctx: EntityManagerCreateContext<TYPE, RECORD>,\n) : EntityManager<RECORD> {\n    const client = injectHTTPClient();\n    const domainAPI = pickEntityAPI<TYPE, RECORD>(client, ctx.type);\n\n    const entity : Ref<RECORD | undefined> = ref(undefined);\n    const entityId = computed<EntityID<RECORD> | undefined>(\n        () => (\n            entity.value ? entity.value.id as EntityID<RECORD> : undefined),\n    );\n\n    const realmId = computed<string | undefined>(\n        () => {\n            let realmId : string | undefined;\n\n            if (ctx.realmId) {\n                if (typeof ctx.realmId === 'function') {\n                    return ctx.realmId(entity.value);\n                }\n\n                realmId = isRef(ctx.realmId) ? ctx.realmId.value : ctx.realmId;\n            }\n\n            if (!realmId && entity.value) {\n                if (\n                    hasOwnProperty(entity.value, 'realmId') &&\n                    typeof entity.value.realmId === 'string'\n                ) {\n                    return entity.value.realmId;\n                }\n            }\n\n            return realmId;\n        },\n    );\n\n    const lockId = ref(undefined) as Ref<EntityID<RECORD> | undefined>;\n\n    if (ctx.props && ctx.props.entity) {\n        entity.value = ctx.props.entity;\n    }\n\n    const created = (value: RECORD) => {\n        // Adopt the created record as the managed entity — consistent with updated()/deleted()\n        // and with create() (which sets entity.value before notifying). Without this, an\n        // externally-performed create (e.g. APermissionPolicyBindingButton's create mode, or a\n        // socket-originated create) would notify but leave the manager's data unset, so the\n        // consumer never transitions out of the \"no record\" state.\n        entity.value = value;\n\n        if (ctx.setup && ctx.setup.emit) {\n            ctx.setup.emit('created', value);\n        }\n\n        if (ctx.onCreated) {\n            ctx.onCreated(value);\n        }\n    };\n\n    const deleted = (value: RECORD) => {\n        if (ctx.setup && ctx.setup.emit) {\n            ctx.setup.emit('deleted', (value || entity.value) as RECORD);\n        }\n\n        if (ctx.onDeleted) {\n            ctx.onDeleted((value || entity.value) as RECORD);\n        }\n    };\n\n    const updated = (value: Partial<RECORD>) => {\n        if (entity.value) {\n            extendObject(entity.value, value);\n        }\n\n        if (ctx.setup && ctx.setup.emit) {\n            ctx.setup.emit('updated', (entity.value || value) as RECORD);\n        }\n\n        if (ctx.onUpdated) {\n            ctx.onUpdated(entity.value || value);\n        }\n    };\n\n    const resolved = (value?: RECORD) => {\n        if (ctx.setup && ctx.setup.emit) {\n            ctx.setup.emit('resolved', value);\n        }\n\n        if (ctx.onResolved) {\n            ctx.onResolved(value);\n        }\n    };\n\n    const failed = (error: Error) => {\n        if (ctx.setup && ctx.setup.emit) {\n            ctx.setup.emit('failed', error);\n        }\n\n        if (ctx.onFailed) {\n            ctx.onFailed(error);\n        }\n    };\n\n    const busy = ref(false);\n\n    const update = async (data: Partial<RECORD>) => {\n        if (!domainAPI?.update || busy.value || !entityId.value) {\n            return;\n        }\n\n        busy.value = true;\n        lockId.value = entityId.value;\n\n        try {\n            const response = await domainAPI.update(\n                entityId.value,\n                data,\n            );\n\n            entity.value = response.data;\n\n            updated(response.data);\n        } catch (e) {\n            if (e instanceof Error) {\n                failed(e);\n            }\n        } finally {\n            busy.value = false;\n            lockId.value = undefined;\n        }\n    };\n\n    const remove = async () : Promise<void> => {\n        if (!domainAPI?.delete || busy.value || !entityId.value) {\n            return;\n        }\n\n        busy.value = true;\n        lockId.value = entityId.value;\n\n        try {\n            const response = await domainAPI.delete(\n                entityId.value,\n            );\n\n            entity.value = undefined;\n\n            deleted(response.data);\n        } catch (e) {\n            if (e instanceof Error) {\n                failed(e);\n            }\n        } finally {\n            busy.value = false;\n            lockId.value = undefined;\n        }\n    };\n\n    const create = async (data: Partial<RECORD>) : Promise<void> => {\n        if (!domainAPI?.create || busy.value) {\n            return;\n        }\n\n        busy.value = true;\n\n        lockId.value = undefined;\n\n        try {\n            const response = await domainAPI.create(data);\n\n            entity.value = response.data;\n\n            created(response.data);\n        } catch (e) {\n            if (e instanceof Error) {\n                failed(e);\n            }\n        } finally {\n            busy.value = false;\n            lockId.value = undefined;\n        }\n    };\n\n    const createOrUpdate = async (data: Partial<RECORD>) : Promise<void> => {\n        if (entity.value) {\n            await update(data);\n        } else {\n            await create(data);\n        }\n    };\n\n    let socket : EntitySocketManager | undefined;\n\n    if (\n        typeof ctx.socket !== 'boolean' ||\n        typeof ctx.socket === 'undefined' ||\n        typeof ctx.socket === 'function' ||\n        ctx.socket\n    ) {\n        let socketContext : EntitySocketManagerCreateContext<TYPE, RECORD> = { type: ctx.type };\n\n        if (isObject(ctx.socket)) {\n            socketContext = {\n                ...socketContext,\n                ...ctx.socket,\n            };\n        }\n\n        socketContext.onCreated = created;\n        socketContext.onUpdated = updated;\n        socketContext.lockId = lockId;\n        socketContext.realmId = realmId;\n        socketContext.target = true;\n        socketContext.targetId = entityId;\n\n        socket = defineEntitySocketManager(socketContext);\n    }\n\n    const error = ref<Error | undefined>(undefined);\n\n    const resolveByProps = () : boolean => {\n        if (!ctx.props) {\n            return false;\n        }\n\n        if (ctx.props.entity) {\n            entity.value = ctx.props.entity;\n\n            if (socket) {\n                socket.mount();\n            }\n\n            resolved(entity.value);\n\n            return true;\n        }\n\n        return false;\n    };\n\n    if (ctx.props) {\n        const propEntityRef = toRef(ctx.props, 'entity');\n        const propsEntityId = computed(() => (propEntityRef.value ? propEntityRef.value.id : undefined));\n        watch(propsEntityId, (val) => {\n            entity.value = propEntityRef.value;\n\n            if (val) {\n                if (socket) {\n                    socket.mount();\n                }\n            } else if (socket) {\n                socket.unmount();\n            }\n        });\n    }\n\n    resolveByProps();\n\n    const resolve = async (rctx: ResourceManagerResolveContext<RECORD> = {}) => {\n        if (entity.value) {\n            return;\n        }\n\n        let query : IQuery | undefined;\n        if (rctx.query) {\n            query = normalizeQueryInput(rctx.query);\n        }\n\n        let { id } = rctx;\n\n        if (ctx.props) {\n            if (resolveByProps()) {\n                return;\n            }\n\n            if (ctx.props.entity) {\n                entity.value = ctx.props.entity;\n\n                if (socket) {\n                    socket.mount();\n                }\n\n                resolved(entity.value);\n\n                return;\n            }\n\n            if (ctx.props.queryFilters) {\n                const current = query || new Query();\n                query = new Query({\n                    fields: current.fields,\n                    relations: current.relations,\n                    sorts: current.sorts,\n                    pagination: current.pagination,\n                    filters: defineFilters(\n                        ctx.props.queryFilters as FiltersBuildInput | ICondition,\n                    ),\n                });\n            }\n\n            if (ctx.props.queryFields) {\n                const current = query || new Query();\n                query = new Query({\n                    filters: current.filters,\n                    relations: current.relations,\n                    sorts: current.sorts,\n                    pagination: current.pagination,\n                    fields: defineFields(ctx.props.queryFields as FieldsBuildInput<RapiqObjectLiteral>),\n                });\n            }\n\n            if (ctx.props.entityId) {\n                id = ctx.props.entityId;\n            }\n        }\n\n        if (!domainAPI) {\n            resolved();\n\n            return;\n        }\n\n        if (id && domainAPI.getOne) {\n            try {\n                const response = await domainAPI.getOne(id, query);\n                entity.value = response.data;\n\n                if (socket) {\n                    socket.mount();\n                }\n\n                resolved(entity.value);\n\n                return;\n            } catch (e) {\n                if (e instanceof Error) {\n                    error.value = e;\n                }\n            }\n        }\n\n        if (query && domainAPI.getMany) {\n            try {\n                const response = await domainAPI.getMany(new Query({\n                    fields: query.fields,\n                    filters: query.filters,\n                    relations: query.relations,\n                    sorts: query.sorts,\n                    pagination: definePagination({ limit: 1 }),\n                }));\n\n                if (response.data.length === 1) {\n                    [entity.value] = response.data;\n\n                    if (socket) {\n                        socket.mount();\n                    }\n                }\n\n                resolved(entity.value);\n            } catch (e) {\n                if (e instanceof Error) {\n                    error.value = e;\n                }\n            }\n        }\n    };\n\n    const resolveOrFail = async (resolveContext: ResourceManagerResolveContext<RECORD> = {}) => {\n        await resolve(resolveContext);\n\n        if (typeof entity.value === 'undefined') {\n            if (!error.value) {\n                throw EntityRecordError.unresolvable();\n            }\n\n            // eslint-disable-next-line no-throw-literal\n            throw error.value as Error;\n        }\n    };\n\n    if (ctx.query) {\n        const queryFn = ctx.query;\n        let initialized = false;\n\n        watch(\n            () => JSON.stringify(queryFn()),\n            () => {\n                if (!initialized) {\n                    initialized = true;\n                    return;\n                }\n\n                entity.value = undefined;\n                resolve({ query: queryFn() });\n            },\n            { immediate: true },\n        );\n    }\n\n    const manager : EntityManager<RECORD> = {\n        resolve,\n        resolveOrFail,\n        lockId,\n        busy,\n        data: entity,\n        error,\n\n        create,\n        createOrUpdate,\n        created,\n\n        update,\n        updated,\n\n        delete: remove,\n        deleted,\n\n        failed,\n\n        render: () => undefined,\n        renderError: () => undefined,\n    };\n\n    manager.render = (content?: VNodeChild | ResourceManagerRenderFn): VNodeChild => {\n        if (!ctx.setup || !ctx.setup.slots) {\n            return typeof content === 'function' ?\n                content() :\n                content;\n        }\n\n        if (hasNormalizedSlot('default', ctx.setup.slots)) {\n            return normalizeSlot(\n                'default',\n                buildEntityVSlotProps(manager),\n                ctx.setup.slots,\n            );\n        }\n\n        return typeof content === 'function' ?\n            content() :\n            content;\n    };\n\n    manager.renderError = (error: unknown) : VNodeChild => {\n        if (!ctx.setup || !ctx.setup.slots) {\n            return undefined;\n        }\n\n        if (\n            isObject(error) &&\n            hasNormalizedSlot('error', ctx.setup.slots)\n        ) {\n            return normalizeSlot('error', error, ctx.setup.slots);\n        }\n\n        return undefined;\n    };\n\n    return manager;\n}\n\nexport function defineEntityManager<\n    TYPE extends keyof EntityTypeMap,\n>(\n    ctx: EntityManagerCreateContext<TYPE, EntityTypeMap[TYPE]>,\n) : EntityManager<EntityTypeMap[TYPE]> {\n    return create<TYPE, EntityTypeMap[TYPE]>(ctx);\n}\n","<!--\n  Copyright (c) 2022.\n  Author Peter Placzek (tada5hi)\n  For the full copyright and license information,\n  view the LICENSE file that was distributed with this source code.\n-->\n\n<script lang=\"ts\">\nimport type { PropType } from 'vue';\nimport { defineComponent } from 'vue';\nimport type { ButtonSize } from '@vuecs/button';\nimport { VCButton } from '@vuecs/button';\nimport { VCIcon } from '@vuecs/icon';\nimport { useAlertDialog } from '@vuecs/overlays';\nimport {\n    TranslatorTranslationActionKey,\n    TranslatorTranslationAppKey,\n    TranslatorTranslationCommonKey,\n    TranslatorTranslationNamespace,\n} from '@authup/i18n';\nimport { DEFAULT_BUTTON_SIZE, useTranslations } from '../../../core';\n\nexport default defineComponent({\n    components: { VCButton, VCIcon },\n    props: {\n        value: {\n            type: Boolean,\n            required: true,\n        },\n        isBusy: {\n            type: Boolean,\n            required: true,\n        },\n        size: {\n            type: String as PropType<ButtonSize>,\n            default: DEFAULT_BUTTON_SIZE,\n        },\n        // Confirm the removal transition (assigned → un-assign) via\n        // useAlertDialog(). Off by default — un-assigning is reversible, so\n        // only high-stakes grants (role / permission) opt in. Adding never prompts.\n        withPrompt: {\n            type: Boolean,\n            default: false,\n        },\n    },\n    emits: ['changed'],\n    setup(props, { emit }) {\n        const translations = useTranslations([\n            {\n                namespace: TranslatorTranslationNamespace.COMMON,\n                key: TranslatorTranslationCommonKey.PROCESSING,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.ACTION,\n                key: TranslatorTranslationActionKey.REMOVE,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.ACTION,\n                key: TranslatorTranslationActionKey.ADD,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.ACTION,\n                key: TranslatorTranslationActionKey.ABORT,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.APP,\n                key: TranslatorTranslationAppKey.REMOVE_CONFIRM_TITLE,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.APP,\n                key: TranslatorTranslationAppKey.REMOVE_CONFIRM_DESCRIPTION,\n            },\n        ]);\n\n        // Imperative confirmation dialog, resolved ONLY when `withPrompt` is set\n        // — the default (off) never injects the AlertDialogManager, so a toggle\n        // that doesn't prompt (scopes, policy-bindings, any downstream consumer)\n        // doesn't require `app.use(installOverlays)`. `useAlertDialog()` only\n        // calls inject() (no lifecycle hooks), so this one-time conditional\n        // resolution in setup is safe. Host: <VCAlertDialogProvider> in the\n        // admin console default layout.\n        const confirmDialog = props.withPrompt ? useAlertDialog() : undefined;\n\n        const handleClick = async (e: Event) => {\n            e.preventDefault();\n\n            // Only the removal transition confirms (currently assigned → this\n            // click un-assigns). Adding is low-stakes and never prompts.\n            if (confirmDialog && props.value && props.withPrompt) {\n                const confirmed = await confirmDialog({\n                    title: translations.removeConfirmTitle,\n                    description: translations.removeConfirmDescription,\n                    confirmLabel: translations.remove,\n                    cancelLabel: translations.abort,\n                    tone: 'error',\n                });\n\n                if (!confirmed) {\n                    return;\n                }\n            }\n\n            emit('changed', !props.value);\n        };\n\n        return { handleClick, translations };\n    },\n});\n</script>\n<template>\n    <VCButton\n        type=\"button\"\n        :aria-label=\"isBusy ? translations.processing : (value ? translations.remove : translations.add)\"\n        :size=\"size\"\n        :color=\"isBusy ? 'neutral' : (value ? 'error' : 'success')\"\n        :disabled=\"isBusy\"\n        @click=\"handleClick\"\n    >\n        <template #leading>\n            <VCIcon :name=\"isBusy ? 'fa6-solid:question' : (value ? 'fa6-solid:minus' : 'fa6-solid:plus')\" />\n        </template>\n    </VCButton>\n</template>\n","<!--\n  Copyright (c) 2022.\n  Author Peter Placzek (tada5hi)\n  For the full copyright and license information,\n  view the LICENSE file that was distributed with this source code.\n-->\n\n<script lang=\"ts\">\nimport type { PropType } from 'vue';\nimport { defineComponent } from 'vue';\nimport type { ButtonSize } from '@vuecs/button';\nimport { VCButton } from '@vuecs/button';\nimport { VCIcon } from '@vuecs/icon';\nimport { useAlertDialog } from '@vuecs/overlays';\nimport {\n    TranslatorTranslationActionKey,\n    TranslatorTranslationAppKey,\n    TranslatorTranslationCommonKey,\n    TranslatorTranslationNamespace,\n} from '@authup/i18n';\nimport { DEFAULT_BUTTON_SIZE, useTranslations } from '../../../core';\n\nexport default defineComponent({\n    components: { VCButton, VCIcon },\n    props: {\n        value: {\n            type: Boolean,\n            required: true,\n        },\n        isBusy: {\n            type: Boolean,\n            required: true,\n        },\n        size: {\n            type: String as PropType<ButtonSize>,\n            default: DEFAULT_BUTTON_SIZE,\n        },\n        // Confirm the removal transition (assigned → un-assign) via\n        // useAlertDialog(). Off by default — un-assigning is reversible, so\n        // only high-stakes grants (role / permission) opt in. Adding never prompts.\n        withPrompt: {\n            type: Boolean,\n            default: false,\n        },\n    },\n    emits: ['changed'],\n    setup(props, { emit }) {\n        const translations = useTranslations([\n            {\n                namespace: TranslatorTranslationNamespace.COMMON,\n                key: TranslatorTranslationCommonKey.PROCESSING,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.ACTION,\n                key: TranslatorTranslationActionKey.REMOVE,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.ACTION,\n                key: TranslatorTranslationActionKey.ADD,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.ACTION,\n                key: TranslatorTranslationActionKey.ABORT,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.APP,\n                key: TranslatorTranslationAppKey.REMOVE_CONFIRM_TITLE,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.APP,\n                key: TranslatorTranslationAppKey.REMOVE_CONFIRM_DESCRIPTION,\n            },\n        ]);\n\n        // Imperative confirmation dialog, resolved ONLY when `withPrompt` is set\n        // — the default (off) never injects the AlertDialogManager, so a toggle\n        // that doesn't prompt (scopes, policy-bindings, any downstream consumer)\n        // doesn't require `app.use(installOverlays)`. `useAlertDialog()` only\n        // calls inject() (no lifecycle hooks), so this one-time conditional\n        // resolution in setup is safe. Host: <VCAlertDialogProvider> in the\n        // admin console default layout.\n        const confirmDialog = props.withPrompt ? useAlertDialog() : undefined;\n\n        const handleClick = async (e: Event) => {\n            e.preventDefault();\n\n            // Only the removal transition confirms (currently assigned → this\n            // click un-assigns). Adding is low-stakes and never prompts.\n            if (confirmDialog && props.value && props.withPrompt) {\n                const confirmed = await confirmDialog({\n                    title: translations.removeConfirmTitle,\n                    description: translations.removeConfirmDescription,\n                    confirmLabel: translations.remove,\n                    cancelLabel: translations.abort,\n                    tone: 'error',\n                });\n\n                if (!confirmed) {\n                    return;\n                }\n            }\n\n            emit('changed', !props.value);\n        };\n\n        return { handleClick, translations };\n    },\n});\n</script>\n<template>\n    <VCButton\n        type=\"button\"\n        :aria-label=\"isBusy ? translations.processing : (value ? translations.remove : translations.add)\"\n        :size=\"size\"\n        :color=\"isBusy ? 'neutral' : (value ? 'error' : 'success')\"\n        :disabled=\"isBusy\"\n        @click=\"handleClick\"\n    >\n        <template #leading>\n            <VCIcon :name=\"isBusy ? 'fa6-solid:question' : (value ? 'fa6-solid:minus' : 'fa6-solid:plus')\" />\n        </template>\n    </VCButton>\n</template>\n","/*\n * Copyright (c) 2022.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { h } from 'vue';\nimport type { ButtonSize } from '@vuecs/button';\nimport { VCButton } from '@vuecs/button';\nimport { VCIcon } from '@vuecs/icon';\nimport { DEFAULT_BUTTON_SIZE } from '../../../core';\n\ntype ToggleButtonOptions = {\n    value: boolean,\n    isBusy: boolean,\n    changed: (value: boolean) => void,\n    size?: ButtonSize,\n};\nexport function renderToggleButton(\n    options: ToggleButtonOptions,\n) {\n    let iconName: string;\n    let color: 'neutral' | 'error' | 'success';\n    if (options.isBusy) {\n        iconName = 'fa6-solid:question';\n        color = 'neutral';\n    } else if (options.value) {\n        iconName = 'fa6-solid:minus';\n        color = 'error';\n    } else {\n        iconName = 'fa6-solid:plus';\n        color = 'success';\n    }\n\n    return h(VCButton, {\n        size: options.size ?? DEFAULT_BUTTON_SIZE,\n        color,\n        disabled: options.isBusy,\n        onClick($event: any) {\n            $event.preventDefault();\n\n            options.changed(!options.value);\n        },\n    }, { leading: () => h(VCIcon, { name: iconName }) });\n}\n","/*\n * Copyright (c) 2023-2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\nimport { hasNormalizedSlot, normalizeSlot } from '../../../core';\nimport type { VNodeChild } from 'vue';\nimport { h } from 'vue';\nimport { VCFormInput } from '@vuecs/forms';\nimport { VCIcon } from '@vuecs/icon';\nimport { ListSearchSlotName } from './constants';\nimport type { SearchOptionsInput } from './type';\n\ntype Fn = (...args: any[]) => Promise<any> | any;\nfunction debounce<T extends Fn>(func: T, timeout = 200) {\n    let timer : ReturnType<typeof setTimeout> | undefined;\n\n    return (...args: Parameters<T>) => {\n        clearTimeout(timer);\n        timer = setTimeout(() => { func(...args); }, timeout);\n    };\n}\n\nexport function buildListSearch(\n    ctx: SearchOptionsInput,\n) {\n    ctx.icon = ctx.icon ?? true;\n    ctx.iconClass = ctx.iconClass || 'fa6-solid:magnifying-glass';\n    ctx.iconPosition = ctx.iconPosition ?? 'start';\n\n    if (hasNormalizedSlot(ListSearchSlotName.DEFAULT, ctx.slots)) {\n        return normalizeSlot(ListSearchSlotName.DEFAULT, {\n            load: ctx.load,\n            busy: ctx.busy,\n            icon: ctx.icon,\n            iconClass: ctx.iconClass,\n            iconPosition: ctx.iconPosition,\n        }, ctx.slots);\n    }\n\n    let iconContent : VNodeChild | undefined;\n    if (hasNormalizedSlot(ListSearchSlotName.ICON)) {\n        iconContent = normalizeSlot(ListSearchSlotName.ICON, {}, ctx.slots);\n    }\n\n    const handle = debounce((text: string) => {\n        if (!ctx.load || ctx.meta?.busy || ctx.busy) {\n            return Promise.resolve();\n        }\n\n        return ctx.load({\n            // Pass the raw search text. The rapiq v2 IR builder does NOT\n            // interpret wire markers (a `~text` value becomes eq('name',\n            // '~text'), not a substring match) — the collection turns this\n            // bare `name` string into a condition via the `contains` helper\n            // (or a per-entity queryFilters hook).\n            //\n            // No pagination reset here: the collection manager drops the\n            // retained offset whenever a load changes the filters, which\n            // is what a new search term is.\n            filters: text.length > 0 ? { name: text } : {},\n        });\n    });\n\n    const props: Record<string, any> = {\n        type: 'text',\n        modelValue: '',\n        'onUpdate:modelValue': (text: string) => handle(text),\n        placeholder: '...',\n    };\n\n    const slots: Record<string, (slotProps?: { class?: unknown }) => VNodeChild> = {};\n\n    if (ctx.icon) {\n        const iconClass = ctx.iconClass ?? 'fa6-solid:magnifying-glass';\n        // Apply the theme's addon class handed down via the slot props so\n        // the icon renders as a joined input-group addon (bordered, muted\n        // background) instead of floating next to the squared input edge.\n        const iconNode = (slotProps: { class?: unknown } = {}) => h(\n            'div',\n            { class: slotProps.class },\n            [iconContent ?? h(VCIcon, { name: iconClass })],\n        );\n\n        if (ctx.iconPosition === 'start') {\n            props.groupPrepend = true;\n            slots.groupPrepend = iconNode;\n        } else {\n            props.groupAppend = true;\n            slots.groupAppend = iconNode;\n        }\n    }\n\n    return h(VCFormInput, props, slots);\n}\n","/*\n * Copyright (c) 2023.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport type { PropType, SlotsType } from 'vue';\nimport { defineComponent } from 'vue';\nimport type { ListLoadFn, ListMeta } from '../entity';\nimport type { SearchSlotProps } from './type';\nimport { buildListSearch } from './module';\n\nexport const ASearch = defineComponent({\n    props: {\n        // todo: add entity-key prop\n        icon: { type: Boolean },\n        iconPosition: { type: String as PropType<'start' | 'end'> },\n        iconClass: { type: String },\n        busy: { type: Boolean },\n        load: { type: Function as PropType<ListLoadFn> },\n        meta: { type: Object as PropType<ListMeta> },\n    },\n    slots: Object as SlotsType<{\n        default: SearchSlotProps\n    }>,\n    setup(\n        props,\n        { slots },\n    ) {\n        return () => buildListSearch({\n            slots,\n            icon: props.icon,\n            iconPosition: props.iconPosition,\n            busy: props.busy,\n            load: props.load,\n            meta: props.meta,\n        });\n    },\n});\n","/*\n * Copyright (c) 2025-2025.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { SlotName, hasNormalizedSlot, normalizeSlot  } from '../../../../core';\nimport type { PropType, Ref, VNodeChild } from 'vue';\nimport {\n    computed, \n    h, \n    mergeProps, \n    ref, \n    toRef, \n    watch,\n} from 'vue';\nimport { APagination } from '../../pagination';\nimport { renderToggleButton } from '../../toggle-button';\nimport type { EntityCollectionVSlots } from '../collection';\nimport { defineEntityCollectionVEmitOptions, defineEntityCollectionVProps } from '../collection';\nimport { ASearch } from '../../search';\nimport type { EntityPickerContext, EntityPickerVEmitOptions, RecordWithID } from './types';\n\nexport function defineEntityPickerVEmitOptions<T>() : EntityPickerVEmitOptions<T> {\n    return {\n         \n        change: (_values: string[]) => true,\n        ...defineEntityCollectionVEmitOptions<T>(),\n    };\n}\n\nexport function defineEntityPickerVProps<T extends RecordWithID = RecordWithID>() {\n    return {\n        value: { type: [Array, String] as PropType<string[] | string | null> },\n        multiple: { type: Boolean as PropType<boolean | undefined> },\n        ...defineEntityCollectionVProps<T>(),\n    };\n}\n\nexport function defineEntityPicker<T extends RecordWithID>({\n    props,\n    setup,\n    component,\n} : EntityPickerContext<T>) {\n    const componentRef = ref(null) as Ref<null | Record<string, any>>;\n\n    setup.expose({\n        load: (...args: any[]) => {\n            if (componentRef.value) {\n                return componentRef.value.load(...args);\n            }\n\n            return undefined;\n        },\n    });\n\n    const value = toRef(props, 'value');\n    const items = ref<string[]>([]);\n\n    const assignItems = (input?: string[] | string | null) => {\n        if (Array.isArray(input)) {\n            items.value = input;\n        } else if (input) {\n            items.value = [input];\n        } else {\n            items.value = [];\n        }\n    };\n\n    const isMultiSelection = computed(() => {\n        if (typeof props.multiple === 'boolean') {\n            return props.multiple;\n        }\n\n        return Array.isArray(value.value);\n    });\n\n    assignItems(value.value);\n\n    watch(value, (input) => assignItems(input));\n\n    const toggle = (id: string) => {\n        const index = items.value!.indexOf(id);\n\n        if (index === -1) {\n            if (isMultiSelection.value) {\n                items.value!.push(id);\n            } else {\n                items.value = [id];\n            }\n        } else if (isMultiSelection.value) {\n            if (index !== -1) {\n                items.value!.splice(index, 1);\n            }\n        } else {\n            items.value = [];\n        }\n\n        setup.emit('change', [...items.value]);\n    };\n\n    const render = () => h(\n        component,\n        mergeProps(\n            { ref: componentRef },\n            props,\n            setup.attrs,\n        ),\n        {\n            [SlotName.HEADER]: (slotProps: EntityCollectionVSlots<RecordWithID>['header']) => [\n                h(ASearch, {\n                    load: async (payload: any) => {\n                        if (slotProps.load) {\n                            await slotProps.load(payload);\n                        }\n                    },\n                    busy: slotProps.busy,\n                }),\n            ],\n            [SlotName.FOOTER]: (slotProps: EntityCollectionVSlots<RecordWithID>['footer']) => [\n                h(APagination, {\n                    load: (payload: any) => {\n                        if (slotProps.load) {\n                            return slotProps.load(payload);\n                        }\n\n                        return undefined;\n                    },\n                    busy: slotProps.busy,\n                    meta: slotProps.meta,\n                }),\n            ],\n            [SlotName.ITEM_ACTIONS]: (\n                slotProps: EntityCollectionVSlots<RecordWithID>['itemActions'],\n            ) => {\n                let content : VNodeChild | undefined;\n                if (hasNormalizedSlot(SlotName.ITEM_ACTIONS, setup.slots)) {\n                    content = normalizeSlot(SlotName.ITEM_ACTIONS, {\n                        ...slotProps,\n                        toggle,\n                    }, setup.slots);\n                }\n\n                if (content) {\n                    return content;\n                }\n\n                return renderToggleButton({\n                    value: items.value.includes(slotProps.data.id),\n                    isBusy: slotProps.busy,\n                    changed() {\n                        toggle(slotProps.data.id);\n                    },\n                });\n            },\n        },\n    );\n\n    return { render };\n}\n","/*\n * Copyright (c) 2022-2025.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport type {\n    Component,\n    PropType,\n    VNodeArrayChildren,\n} from 'vue';\nimport {\n    defineComponent,\n    getCurrentInstance,\n    h,\n    mergeProps,\n    ref,\n    resolveDynamicComponent,\n} from 'vue';\nimport type { ButtonSize } from '@vuecs/button';\nimport { VCButton } from '@vuecs/button';\nimport { VCIcon } from '@vuecs/icon';\nimport { useAlertDialog } from '@vuecs/overlays';\nimport type { EntityType, EntityTypeMap } from '@authup/core-kit';\nimport { pickEntityAPI } from '@authup/core-http-kit';\nimport {\n    TranslatorTranslationActionKey,\n    TranslatorTranslationAppKey,\n    TranslatorTranslationNamespace,\n} from '@authup/i18n';\nimport { \n    DEFAULT_BUTTON_SIZE, \n    injectHTTPClient, \n    useTranslation, \n    wrapFnWithBusyState, \n} from '../../../core';\n\nenum ElementType {\n    BUTTON = 'button',\n    LINK = 'link',\n    DROP_DOWN_ITEM = 'dropDownItem',\n}\n\nconst AEntityDelete = defineComponent({\n    props: {\n        elementIcon: {\n            type: String,\n            default: 'fa6-solid:trash',\n        },\n        withText: {\n            type: Boolean,\n            default: true,\n        },\n        elementType: {\n            type: String as PropType<`${ElementType}`>,\n            default: ElementType.BUTTON,\n        },\n\n        entityId: {\n            type: String,\n            required: true,\n        },\n        entityType: {\n            type: String as PropType<`${EntityType}`>,\n            required: true,\n        },\n\n        disabled: {\n            type: Boolean,\n            default: false,\n        },\n\n        // Gate the (irreversible) delete behind a confirmation dialog\n        // rendered by the app-level <VCAlertDialogProvider> via\n        // useAlertDialog(). On by default — opt out with :with-prompt=\"false\".\n        withPrompt: {\n            type: Boolean,\n            default: true,\n        },\n\n        hint: {\n            type: String,\n            default: undefined,\n        },\n        size: {\n            type: String as PropType<ButtonSize>,\n            default: DEFAULT_BUTTON_SIZE,\n        },\n    },\n    emits: ['deleted', 'failed'],\n    setup(props, ctx) {\n        const apiClient = injectHTTPClient();\n        const instance = getCurrentInstance();\n        const busy = ref(false);\n\n        const submit = wrapFnWithBusyState(busy, async () => {\n            const domainAPI = pickEntityAPI(\n                apiClient,\n                props.entityType as keyof EntityTypeMap,\n            );\n\n            if (!domainAPI?.delete) {\n                return;\n            }\n\n            try {\n                const response = await domainAPI.delete(props.entityId);\n                ctx.emit('deleted', { ...response.data, id: props.entityId });\n            } catch (e) {\n                ctx.emit('failed', e);\n            }\n        });\n\n        const translation = useTranslation({\n            namespace: TranslatorTranslationNamespace.ACTION,\n            key: TranslatorTranslationActionKey.DELETE,\n        });\n\n        // Imperative confirmation dialog, resolved ONLY when prompting is\n        // enabled — so `<AEntityDelete :with-prompt=\"false\">` never injects the\n        // AlertDialogManager and therefore doesn't require `app.use(installOverlays)`\n        // in consumers/tests that skip @vuecs/overlays. `useAlertDialog()` only\n        // calls inject() (no lifecycle hooks), so this one-time conditional\n        // resolution in setup is safe. When enabled it injects the app-level\n        // manager (host: <VCAlertDialogProvider> in the admin console default\n        // layout) and resolves true (Delete) / false (Abort / Escape); on the\n        // server it resolves false without enqueuing, but onClick is client-only.\n        const confirmDialog = props.withPrompt ? useAlertDialog() : undefined;\n\n        // Singular, localized entity noun (`count: 1`) interpolated into the\n        // confirmation title as an article-free, infinitive phrase (e.g.\n        // \"Benutzer wirklich löschen?\") — interpolating a gendered article\n        // around it (\"diese(s) {{entity}}\") is grammatically wrong in DE/FR/ES\n        // since the article must agree with each noun's gender/case. The nine\n        // index pages that mount <AEntityDelete> all pass a primary entity type\n        // present in the ENTITY namespace; a non-primary type falls back to the\n        // raw key.\n        const entityLabel = useTranslation({\n            namespace: TranslatorTranslationNamespace.ENTITY,\n            key: props.entityType,\n            count: 1,\n        });\n        const abortLabel = useTranslation({\n            namespace: TranslatorTranslationNamespace.ACTION,\n            key: TranslatorTranslationActionKey.ABORT,\n        });\n        const promptTitle = useTranslation({\n            namespace: TranslatorTranslationNamespace.APP,\n            key: TranslatorTranslationAppKey.DELETE_CONFIRM_TITLE,\n            data: { entity: entityLabel },\n        });\n        const promptDescription = useTranslation({\n            namespace: TranslatorTranslationNamespace.APP,\n            key: TranslatorTranslationAppKey.DELETE_CONFIRM_DESCRIPTION,\n        });\n\n        const onClick = async ($event: any) => {\n            $event.preventDefault();\n\n            // The anchor / dropdown-item render path has no native disabled\n            // semantics, so the click has to be dropped here.\n            if (busy.value || props.disabled) {\n                return undefined;\n            }\n\n            if (confirmDialog && props.withPrompt) {\n                const confirmed = await confirmDialog({\n                    title: promptTitle.value,\n                    description: promptDescription.value,\n                    confirmLabel: translation.value,\n                    cancelLabel: abortLabel.value,\n                    tone: 'error',\n                });\n\n                if (!confirmed) {\n                    return undefined;\n                }\n            }\n\n            return submit();\n        };\n\n        const render = () => {\n            const isDisabled = busy.value || props.disabled;\n\n            // Default button form: a danger-outline <VCButton>. The delete\n            // action is inherently destructive, so the styling is baked in\n            // rather than passed per call site (was `btn btn-xs btn-outline-danger`).\n            if (props.elementType === ElementType.BUTTON) {\n                return h(\n                    VCButton,\n                    {\n                        size: props.size,\n                        color: 'error',\n                        variant: 'outline',\n                        label: props.withText ? translation.value : undefined,\n                        // Icon-only form has no visible text, so surface the\n                        // localized action as the accessible name (+ tooltip).\n                        'aria-label': props.withText ? undefined : translation.value,\n                        title: props.withText ? undefined : translation.value,\n                        disabled: isDisabled,\n                        onClick,\n                    },\n                    props.elementIcon ?\n                        { leading: () => h(VCIcon, { name: props.elementIcon }) } :\n                        undefined,\n                );\n            }\n\n            let tag : Component | string = 'a';\n            if (props.elementType === ElementType.DROP_DOWN_ITEM) {\n                if (\n                    instance &&\n                    typeof instance.appContext.app.component('VCDropdownMenuItem') !== 'undefined'\n                ) {\n                    tag = resolveDynamicComponent('VCDropdownMenuItem') as Component;\n                }\n            }\n\n            let icon : VNodeArrayChildren = [];\n            if (props.elementIcon) {\n                icon = [\n                    h(resolveDynamicComponent('VCIcon') as Component, {\n                        name: props.elementIcon,\n                        class: props.withText ? 'pe-1' : undefined,\n                    }),\n                ];\n            }\n\n            let text : VNodeArrayChildren = [];\n            if (props.withText) {\n                text = [\n                    translation.value,\n                ];\n            }\n\n            return h(\n                tag as string,\n                mergeProps({\n                    disabled: isDisabled,\n                    'aria-label': props.withText ? undefined : translation.value,\n                    title: props.withText ? undefined : translation.value,\n                    onClick,\n                }),\n                [\n                    icon,\n                    text,\n                ],\n            );\n        };\n\n        return () => render();\n    },\n});\n\nexport { AEntityDelete };\n","/*\n * Copyright (c) 2023-2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\nimport type { VNodeChild } from 'vue';\nimport { h, resolveComponent } from 'vue';\nimport { hasNormalizedSlot, normalizeSlot } from '../../../core';\nimport { TitleSlotName } from './constants';\nimport type { TitleOptions } from './type';\n\nexport function buildTitle(\n    ctx: TitleOptions,\n) {\n    ctx.tag = ctx.tag || 'h6';\n    ctx.icon = ctx.icon ?? true;\n    ctx.iconClass = ctx.iconClass || 'fa6-solid:list';\n    ctx.iconPosition = ctx.iconPosition ?? 'start';\n\n    if (hasNormalizedSlot(TitleSlotName.DEFAULT, ctx.slots)) {\n        return normalizeSlot(TitleSlotName.DEFAULT, {\n            tag: ctx.tag,\n            icon: ctx.icon,\n            iconClass: ctx.iconClass,\n            iconPosition: ctx.iconPosition,\n        }, ctx.slots);\n    }\n\n    let icon: VNodeChild;\n\n    if (ctx.icon) {\n        let iconContent : VNodeChild;\n        if (hasNormalizedSlot(TitleSlotName.ICON)) {\n            iconContent = normalizeSlot(TitleSlotName.ICON, {}, ctx.slots);\n        }\n\n        if (iconContent) {\n            icon = iconContent;\n        } else {\n            icon = h(\n                resolveComponent('VCIcon'),\n                { name: ctx.iconClass, class: 'pe-1' },\n            );\n        }\n    }\n\n    let content: VNodeChild;\n    if (typeof ctx.text === 'function') {\n        content = ctx.text();\n    } else {\n        content = ctx.text || 'Overview';\n    }\n\n    if (ctx.iconPosition === 'start') {\n        return h(ctx.tag, [\n            icon,\n            content,\n        ]);\n    }\n\n    return h(ctx.tag, [\n        content,\n        icon,\n    ]);\n}\n","/*\n * Copyright (c) 2023.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport type { PropType, SlotsType } from 'vue';\nimport { defineComponent } from 'vue';\nimport { TranslatorTranslationCommonKey, TranslatorTranslationNamespace } from '@authup/i18n';\nimport { useTranslation } from '../../../core';\nimport type { TitleSlotProps } from './type';\nimport { buildTitle } from './module';\n\nexport const ATitle = defineComponent({\n    props: {\n        icon: {\n            type: Boolean,\n            default: true,\n        },\n        iconPosition: { type: String as PropType<'start' | 'end'> },\n        iconClass: { type: String },\n        text: { type: String },\n    },\n    slots: Object as SlotsType<{\n        default: TitleSlotProps\n    }>,\n    setup(props, { slots }) {\n        const translation = useTranslation({\n            namespace: TranslatorTranslationNamespace.COMMON,\n            key: TranslatorTranslationCommonKey.OVERVIEW,\n        });\n\n        return () => buildTitle({\n            slots,\n            icon: props.icon,\n            iconPosition: props.iconPosition,\n            text: props.text || translation.value,\n        });\n    },\n});\n","/*\n * Copyright (c) 2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { LOCALES } from '@authup/i18n';\nimport {\n    computed,\n    defineComponent,\n    h,\n} from 'vue';\nimport {\n    VCDropdownMenu,\n    VCDropdownMenuContent,\n    VCDropdownMenuItem,\n    VCDropdownMenuTrigger,\n} from '@vuecs/overlays';\nimport { useLocaleControl } from '../../core';\n\n// Active locale keeps the primary fill while keyboard/pointer focus moves\n// over it — the `data-[highlighted]` pair overrides the theme item's neutral\n// hover background so the selected row stays visibly selected.\nconst ACTIVE_ITEM_CLASS = 'bg-primary-600 text-on-primary data-[highlighted]:bg-primary-700 data-[highlighted]:text-on-primary';\n\nconst ALanguageSwitcherDropdown = defineComponent({\n    props: {\n        linkClassExtra: {\n            type: String,\n            default: undefined,\n        },\n    },\n    // Deliberately NOT `async`: an async setup() turns the component into\n    // a Suspense-dependent subtree. Nuxt (the admin console) provides a root\n    // Suspense, but the embedded server-core SSR app does not — there the\n    // component would server-render yet never hydrate (dropdown dead).\n    setup(props) {\n        // vuecs owns the locale (cookie-backed) when installed; the control\n        // falls back to ilingo otherwise. Writing here persists via vuecs.\n        const { code, set } = useLocaleControl();\n\n        const elements = computed(() => LOCALES.map((descriptor) => ({\n            value: descriptor.code,\n            label: descriptor.nativeName,\n            active: code.value === descriptor.code,\n        })));\n\n        const activeCode = computed(() => code.value);\n\n        return () => h(VCDropdownMenu, null, {\n            default: () => [\n                h(VCDropdownMenuTrigger, { class: ['cursor-pointer', props.linkClassExtra] }, () => activeCode.value),\n                h(VCDropdownMenuContent, { align: 'end' }, () => elements.value.map((element) => h(\n                    VCDropdownMenuItem,\n                    {\n                        key: element.value,\n                        class: element.active ? ACTIVE_ITEM_CLASS : undefined,\n                        onSelect: () => set(element.value),\n                    },\n                    () => element.label,\n                ))),\n            ],\n        });\n    },\n});\n\nexport { ALanguageSwitcherDropdown };\n\n/**\n * @deprecated Import `ALanguageSwitcherDropdown` instead.\n */\nexport const LanguageSwitcherDropdown = ALanguageSwitcherDropdown;\n","/*\n * Copyright (c) 2022-2026.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport type { PropType } from 'vue';\nimport { defineComponent, h } from 'vue';\nimport type { ButtonSize } from '@vuecs/button';\nimport { VCButton } from '@vuecs/button';\nimport { useSubmitButton } from '@vuecs/forms';\nimport { DEFAULT_BUTTON_SIZE } from '../../core';\n\n/**\n * Submit button for entity forms. Reactive label / icon / color swap\n * between create and update modes via `@vuecs/forms`'s `useSubmitButton`\n * composable, whose values resolve through the vuecs `DefaultsManager`\n * (wired once at app bootstrap — see `buildSubmitButtonDefaults()` in\n * `apps/client-admin-console/plugins/vuecs.ts` / `apps/client-auth-console/src/app.ts`)\n * so labels stay locale-reactive.\n */\nexport const AFormSubmit = defineComponent({\n    props: {\n        isBusy: {\n            type: Boolean,\n            default: false,\n        },\n        isEditing: {\n            type: Boolean,\n            default: false,\n        },\n        isInvalid: {\n            type: Boolean,\n            default: false,\n        },\n        size: {\n            type: String as PropType<ButtonSize>,\n            default: DEFAULT_BUTTON_SIZE,\n        },\n    },\n    emits: ['submit'],\n    setup(props, { emit }) {\n        const submitButton = useSubmitButton({\n            isEditing: () => props.isEditing,\n            loading: () => props.isBusy,\n            disabled: () => props.isInvalid || props.isBusy,\n        });\n\n        return () => h(VCButton, {\n            ...submitButton.value,\n            size: props.size,\n            // `mt-3` matches the inter-group `mb-3` spacing so the button\n            // sits one consistent gap below the last form field.\n            class: 'mt-3',\n            onClick: () => emit('submit'),\n        });\n    },\n});\n","<!--\n  - Copyright (c) 2026.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\nimport {\n    TranslatorTranslationActionKey,\n    TranslatorTranslationAppKey,\n    TranslatorTranslationNamespace,\n} from '@authup/i18n';\nimport { VCIcon } from '@vuecs/icon';\nimport { VCLink } from '@vuecs/link';\nimport type { PropType } from 'vue';\nimport { computed, defineComponent } from 'vue';\nimport { useTranslations } from '../../core';\nimport type { AAccountShellNavItem } from './types';\n\n// The account console's content chrome: brand + nav tabs + content card.\n// Identity/session controls (user chip, sign-out) deliberately do NOT live\n// here — they join the host's single top-right gadget cluster (AAuthApp's\n// `gadgets` slot), so the page carries ONE top bar.\nexport default defineComponent({\n    components: {\n        VCIcon,\n        VCLink,\n    },\n    props: {\n        // Nav tab entries; labels arrive pre-translated so the shell stays\n        // agnostic of which pages a host assembles around it.\n        items: {\n            type: Array as PropType<AAccountShellNavItem[]>,\n            default: () => [],\n        },\n        // Absolute URL of the application the visitor came from. The host\n        // is responsible for validating it (server-core does so against\n        // the trusted app origins); the shell only renders it.\n        backLink: { type: String },\n    },\n    setup(props) {\n        // Label the link with the target host rather than the full URL:\n        // shorter, and it is the part that identifies the application.\n        //\n        // The http(s) check is defence in depth. Validating `backLink` is\n        // the host's job (server-core matches it against the trusted app\n        // origins), but this component is a library surface, and a\n        // standalone host injecting its own value could otherwise have us\n        // render an `ftp:` or app-scheme link. Schemes with no host, such\n        // as `javascript:`, already fall out through the empty `host`.\n        const backHost = computed(() => {\n            if (!props.backLink) {\n                return undefined;\n            }\n\n            try {\n                const url = new URL(props.backLink);\n                if (url.protocol !== 'http:' && url.protocol !== 'https:') {\n                    return undefined;\n                }\n\n                return url.host;\n            } catch {\n                return undefined;\n            }\n        });\n\n        const translations = useTranslations([\n            {\n                namespace: TranslatorTranslationNamespace.APP,\n                key: TranslatorTranslationAppKey.ACCOUNT,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.ACTION,\n                key: TranslatorTranslationActionKey.BACK,\n            },\n            // Not rendered as text: this is the tooltip and the accessible\n            // name, where naming the target application earns its length.\n            {\n                namespace: TranslatorTranslationNamespace.APP,\n                key: TranslatorTranslationAppKey.BACK_TO_APP,\n                data: { host: computed(() => backHost.value ?? '') },\n            },\n        ]);\n\n        return {\n            translations,\n            backHost,\n        };\n    },\n});\n</script>\n<template>\n    <div class=\"a-account-shell\">\n        <div class=\"a-account-shell-header\">\n            <div class=\"a-account-shell-brand\">\n                <svg\n                    viewBox=\"0 0 100 100\"\n                    width=\"32\"\n                    height=\"32\"\n                    aria-hidden=\"true\"\n                >\n                    <rect\n                        x=\"8\"\n                        y=\"8\"\n                        width=\"84\"\n                        height=\"84\"\n                        rx=\"16\"\n                        fill=\"var(--authup-auth-logo-background, #34353a)\"\n                    />\n                    <circle\n                        cx=\"50\"\n                        cy=\"42\"\n                        r=\"12\"\n                        fill=\"#fff\"\n                    />\n                    <path\n                        d=\"M 41 44 L 59 44 L 55 68 L 45 68 Z\"\n                        fill=\"#fff\"\n                    />\n                </svg>\n                <span class=\"a-account-shell-title\">\n                    {{ translations.account }}\n                </span>\n            </div>\n        </div>\n        <nav\n            v-if=\"items.length > 0 || backHost\"\n            class=\"a-account-shell-nav\"\n        >\n            <!--\n                The return link to the referring application leads the tab\n                strip. A trailing rule separates it from the tabs: it leaves\n                the console rather than selecting a section, so it must not\n                read as a permanently-inactive tab.\n\n                The visible label is the bare \"Back\", so the entry stays\n                short and the tabs keep their position. The host name rides\n                the tooltip, and `aria-label` carries the same string as the\n                accessible name so a screen reader announces which\n                application the link returns to, not just \"Back\".\n            -->\n            <VCLink\n                v-if=\"backHost\"\n                :href=\"backLink\"\n                class=\"a-account-shell-nav-link a-account-shell-nav-link--back\"\n                :title=\"translations.backToApp\"\n                :aria-label=\"translations.backToApp\"\n            >\n                <VCIcon name=\"fa6-solid:chevron-left\" />\n                {{ translations.back }}\n            </VCLink>\n            <VCLink\n                v-for=\"item in items\"\n                :key=\"item.key\"\n                v-bind=\"item.link\"\n                class=\"a-account-shell-nav-link\"\n                :class=\"{ 'a-account-shell-nav-link--active': item.active }\"\n                :aria-current=\"item.active ? 'page' : undefined\"\n            >\n                <VCIcon\n                    v-if=\"item.icon\"\n                    :name=\"item.icon\"\n                />\n                {{ item.label }}\n            </VCLink>\n        </nav>\n        <div class=\"a-account-shell-body\">\n            <slot />\n        </div>\n    </div>\n</template>\n","<!--\n  - Copyright (c) 2026.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\nimport {\n    TranslatorTranslationActionKey,\n    TranslatorTranslationAppKey,\n    TranslatorTranslationNamespace,\n} from '@authup/i18n';\nimport { VCIcon } from '@vuecs/icon';\nimport { VCLink } from '@vuecs/link';\nimport type { PropType } from 'vue';\nimport { computed, defineComponent } from 'vue';\nimport { useTranslations } from '../../core';\nimport type { AAccountShellNavItem } from './types';\n\n// The account console's content chrome: brand + nav tabs + content card.\n// Identity/session controls (user chip, sign-out) deliberately do NOT live\n// here — they join the host's single top-right gadget cluster (AAuthApp's\n// `gadgets` slot), so the page carries ONE top bar.\nexport default defineComponent({\n    components: {\n        VCIcon,\n        VCLink,\n    },\n    props: {\n        // Nav tab entries; labels arrive pre-translated so the shell stays\n        // agnostic of which pages a host assembles around it.\n        items: {\n            type: Array as PropType<AAccountShellNavItem[]>,\n            default: () => [],\n        },\n        // Absolute URL of the application the visitor came from. The host\n        // is responsible for validating it (server-core does so against\n        // the trusted app origins); the shell only renders it.\n        backLink: { type: String },\n    },\n    setup(props) {\n        // Label the link with the target host rather than the full URL:\n        // shorter, and it is the part that identifies the application.\n        //\n        // The http(s) check is defence in depth. Validating `backLink` is\n        // the host's job (server-core matches it against the trusted app\n        // origins), but this component is a library surface, and a\n        // standalone host injecting its own value could otherwise have us\n        // render an `ftp:` or app-scheme link. Schemes with no host, such\n        // as `javascript:`, already fall out through the empty `host`.\n        const backHost = computed(() => {\n            if (!props.backLink) {\n                return undefined;\n            }\n\n            try {\n                const url = new URL(props.backLink);\n                if (url.protocol !== 'http:' && url.protocol !== 'https:') {\n                    return undefined;\n                }\n\n                return url.host;\n            } catch {\n                return undefined;\n            }\n        });\n\n        const translations = useTranslations([\n            {\n                namespace: TranslatorTranslationNamespace.APP,\n                key: TranslatorTranslationAppKey.ACCOUNT,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.ACTION,\n                key: TranslatorTranslationActionKey.BACK,\n            },\n            // Not rendered as text: this is the tooltip and the accessible\n            // name, where naming the target application earns its length.\n            {\n                namespace: TranslatorTranslationNamespace.APP,\n                key: TranslatorTranslationAppKey.BACK_TO_APP,\n                data: { host: computed(() => backHost.value ?? '') },\n            },\n        ]);\n\n        return {\n            translations,\n            backHost,\n        };\n    },\n});\n</script>\n<template>\n    <div class=\"a-account-shell\">\n        <div class=\"a-account-shell-header\">\n            <div class=\"a-account-shell-brand\">\n                <svg\n                    viewBox=\"0 0 100 100\"\n                    width=\"32\"\n                    height=\"32\"\n                    aria-hidden=\"true\"\n                >\n                    <rect\n                        x=\"8\"\n                        y=\"8\"\n                        width=\"84\"\n                        height=\"84\"\n                        rx=\"16\"\n                        fill=\"var(--authup-auth-logo-background, #34353a)\"\n                    />\n                    <circle\n                        cx=\"50\"\n                        cy=\"42\"\n                        r=\"12\"\n                        fill=\"#fff\"\n                    />\n                    <path\n                        d=\"M 41 44 L 59 44 L 55 68 L 45 68 Z\"\n                        fill=\"#fff\"\n                    />\n                </svg>\n                <span class=\"a-account-shell-title\">\n                    {{ translations.account }}\n                </span>\n            </div>\n        </div>\n        <nav\n            v-if=\"items.length > 0 || backHost\"\n            class=\"a-account-shell-nav\"\n        >\n            <!--\n                The return link to the referring application leads the tab\n                strip. A trailing rule separates it from the tabs: it leaves\n                the console rather than selecting a section, so it must not\n                read as a permanently-inactive tab.\n\n                The visible label is the bare \"Back\", so the entry stays\n                short and the tabs keep their position. The host name rides\n                the tooltip, and `aria-label` carries the same string as the\n                accessible name so a screen reader announces which\n                application the link returns to, not just \"Back\".\n            -->\n            <VCLink\n                v-if=\"backHost\"\n                :href=\"backLink\"\n                class=\"a-account-shell-nav-link a-account-shell-nav-link--back\"\n                :title=\"translations.backToApp\"\n                :aria-label=\"translations.backToApp\"\n            >\n                <VCIcon name=\"fa6-solid:chevron-left\" />\n                {{ translations.back }}\n            </VCLink>\n            <VCLink\n                v-for=\"item in items\"\n                :key=\"item.key\"\n                v-bind=\"item.link\"\n                class=\"a-account-shell-nav-link\"\n                :class=\"{ 'a-account-shell-nav-link--active': item.active }\"\n                :aria-current=\"item.active ? 'page' : undefined\"\n            >\n                <VCIcon\n                    v-if=\"item.icon\"\n                    :name=\"item.icon\"\n                />\n                {{ item.label }}\n            </VCLink>\n        </nav>\n        <div class=\"a-account-shell-body\">\n            <slot />\n        </div>\n    </div>\n</template>\n","<!--\n  - Copyright (c) 2026.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\nimport { defineComponent } from 'vue';\nimport { VCIcon } from '@vuecs/icon';\nimport {\n    TranslatorTranslationCommonKey,\n    TranslatorTranslationNamespace,\n} from '@authup/i18n';\nimport { useTranslations } from '../../core';\n\n// Presentational on purpose: color-mode *storage* is framework-specific\n// (the admin console uses @vuecs/nuxt's cookie-backed useColorMode()), so the\n// component only owns the icon, the localized aria-labels and the toggle\n// event — bind it with `v-model:dark=\"isDark\"`.\nexport default defineComponent({\n    components: { VCIcon },\n    props: {\n        dark: {\n            type: Boolean,\n            default: false,\n        },\n    },\n    emits: ['update:dark'],\n    setup(props, { emit }) {\n        const translations = useTranslations([\n            {\n                namespace: TranslatorTranslationNamespace.COMMON,\n                key: TranslatorTranslationCommonKey.SWITCH_TO_LIGHT_MODE,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.COMMON,\n                key: TranslatorTranslationCommonKey.SWITCH_TO_DARK_MODE,\n            },\n        ]);\n\n        const toggle = () => {\n            emit('update:dark', !props.dark);\n        };\n\n        return {\n            toggle,\n            translations,\n        };\n    },\n});\n</script>\n<template>\n    <button\n        type=\"button\"\n        :aria-label=\"dark ? translations.switchToLightMode : translations.switchToDarkMode\"\n        :aria-pressed=\"dark ? 'true' : 'false'\"\n        @click.prevent=\"toggle\"\n    >\n        <VCIcon :name=\"dark ? 'fa6-solid:sun' : 'fa6-solid:moon'\" />\n    </button>\n</template>\n","<!--\n  - Copyright (c) 2026.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\nimport { defineComponent } from 'vue';\nimport { VCIcon } from '@vuecs/icon';\nimport {\n    TranslatorTranslationCommonKey,\n    TranslatorTranslationNamespace,\n} from '@authup/i18n';\nimport { useTranslations } from '../../core';\n\n// Presentational on purpose: color-mode *storage* is framework-specific\n// (the admin console uses @vuecs/nuxt's cookie-backed useColorMode()), so the\n// component only owns the icon, the localized aria-labels and the toggle\n// event — bind it with `v-model:dark=\"isDark\"`.\nexport default defineComponent({\n    components: { VCIcon },\n    props: {\n        dark: {\n            type: Boolean,\n            default: false,\n        },\n    },\n    emits: ['update:dark'],\n    setup(props, { emit }) {\n        const translations = useTranslations([\n            {\n                namespace: TranslatorTranslationNamespace.COMMON,\n                key: TranslatorTranslationCommonKey.SWITCH_TO_LIGHT_MODE,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.COMMON,\n                key: TranslatorTranslationCommonKey.SWITCH_TO_DARK_MODE,\n            },\n        ]);\n\n        const toggle = () => {\n            emit('update:dark', !props.dark);\n        };\n\n        return {\n            toggle,\n            translations,\n        };\n    },\n});\n</script>\n<template>\n    <button\n        type=\"button\"\n        :aria-label=\"dark ? translations.switchToLightMode : translations.switchToDarkMode\"\n        :aria-pressed=\"dark ? 'true' : 'false'\"\n        @click.prevent=\"toggle\"\n    >\n        <VCIcon :name=\"dark ? 'fa6-solid:sun' : 'fa6-solid:moon'\" />\n    </button>\n</template>\n","<!--\n  - Copyright (c) 2026.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\nimport { defineComponent } from 'vue';\nimport AColorModeSwitcher from './AColorModeSwitcher.vue';\nimport { ALanguageSwitcherDropdown } from './ALanguageSwitcherDropdown';\n\n// Top-right control cluster shared by every auth surface (the admin console's\n// auth layout + the embedded SSR app + the account console): color mode\n// and language, plus a slot for host-specific gadgets (the account\n// console appends its user chip + sign-out here so the page has ONE top\n// bar). Color-mode storage is app-specific, so `dark` is a controlled\n// `v-model:dark` binding.\nexport default defineComponent({\n    components: { AColorModeSwitcher, ALanguageSwitcherDropdown },\n    props: {\n        dark: {\n            type: Boolean,\n            default: false,\n        },\n    },\n    emits: ['update:dark'],\n});\n</script>\n<template>\n    <div class=\"a-auth-gadgets\">\n        <AColorModeSwitcher\n            :dark=\"dark\"\n            class=\"a-auth-gadget\"\n            @update:dark=\"$emit('update:dark', $event)\"\n        />\n        <ALanguageSwitcherDropdown link-class-extra=\"a-auth-gadget\" />\n        <slot />\n    </div>\n</template>\n","<!--\n  - Copyright (c) 2026.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\nimport { defineComponent } from 'vue';\nimport AColorModeSwitcher from './AColorModeSwitcher.vue';\nimport { ALanguageSwitcherDropdown } from './ALanguageSwitcherDropdown';\n\n// Top-right control cluster shared by every auth surface (the admin console's\n// auth layout + the embedded SSR app + the account console): color mode\n// and language, plus a slot for host-specific gadgets (the account\n// console appends its user chip + sign-out here so the page has ONE top\n// bar). Color-mode storage is app-specific, so `dark` is a controlled\n// `v-model:dark` binding.\nexport default defineComponent({\n    components: { AColorModeSwitcher, ALanguageSwitcherDropdown },\n    props: {\n        dark: {\n            type: Boolean,\n            default: false,\n        },\n    },\n    emits: ['update:dark'],\n});\n</script>\n<template>\n    <div class=\"a-auth-gadgets\">\n        <AColorModeSwitcher\n            :dark=\"dark\"\n            class=\"a-auth-gadget\"\n            @update:dark=\"$emit('update:dark', $event)\"\n        />\n        <ALanguageSwitcherDropdown link-class-extra=\"a-auth-gadget\" />\n        <slot />\n    </div>\n</template>\n","<!--\n  - Copyright (c) 2026.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\nimport { VCToastProvider, VCToaster } from '@vuecs/overlays';\nimport { defineComponent } from 'vue';\nimport AAuthGadgets from './AAuthGadgets.vue';\n\n// Shared shell for the logged-out auth surfaces (the admin console's auth layout\n// + the embedded SSR app root):\n//\n//   - <VCToastProvider> wraps the root so any descendant <VCToaster> (or\n//     component rendering Reka toast primitives) shares one required\n//     ToastProviderContext injection.\n//   - <AAuthGadgets> — the two controls a logged-out visitor still needs\n//     (color mode + language). Color-mode storage is app-specific, so\n//     `dark` stays a controlled `v-model:dark` binding.\n//   - The full-bleed `.a-auth-app` canvas lets page backdrops reach the\n//     viewport edges.\n//   - <VCToaster> renders the queue fed by useToast() (e.g. the authorize\n//     page surfacing login failures).\nexport default defineComponent({\n    components: {\n        AAuthGadgets,\n        VCToastProvider,\n        VCToaster,\n    },\n    props: {\n        dark: {\n            type: Boolean,\n            default: false,\n        },\n    },\n    emits: ['update:dark'],\n});\n</script>\n<template>\n    <VCToastProvider>\n        <div class=\"a-auth-app\">\n            <AAuthGadgets\n                :dark=\"dark\"\n                @update:dark=\"$emit('update:dark', $event)\"\n            >\n                <!-- host-specific gadgets (e.g. the account console's user\n                     chip + sign-out) join the one top-right cluster -->\n                <slot name=\"gadgets\" />\n            </AAuthGadgets>\n\n            <slot />\n\n            <VCToaster position=\"top-center\" />\n        </div>\n    </VCToastProvider>\n</template>\n","<!--\n  - Copyright (c) 2026.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\nimport { VCToastProvider, VCToaster } from '@vuecs/overlays';\nimport { defineComponent } from 'vue';\nimport AAuthGadgets from './AAuthGadgets.vue';\n\n// Shared shell for the logged-out auth surfaces (the admin console's auth layout\n// + the embedded SSR app root):\n//\n//   - <VCToastProvider> wraps the root so any descendant <VCToaster> (or\n//     component rendering Reka toast primitives) shares one required\n//     ToastProviderContext injection.\n//   - <AAuthGadgets> — the two controls a logged-out visitor still needs\n//     (color mode + language). Color-mode storage is app-specific, so\n//     `dark` stays a controlled `v-model:dark` binding.\n//   - The full-bleed `.a-auth-app` canvas lets page backdrops reach the\n//     viewport edges.\n//   - <VCToaster> renders the queue fed by useToast() (e.g. the authorize\n//     page surfacing login failures).\nexport default defineComponent({\n    components: {\n        AAuthGadgets,\n        VCToastProvider,\n        VCToaster,\n    },\n    props: {\n        dark: {\n            type: Boolean,\n            default: false,\n        },\n    },\n    emits: ['update:dark'],\n});\n</script>\n<template>\n    <VCToastProvider>\n        <div class=\"a-auth-app\">\n            <AAuthGadgets\n                :dark=\"dark\"\n                @update:dark=\"$emit('update:dark', $event)\"\n            >\n                <!-- host-specific gadgets (e.g. the account console's user\n                     chip + sign-out) join the one top-right cluster -->\n                <slot name=\"gadgets\" />\n            </AAuthGadgets>\n\n            <slot />\n\n            <VCToaster position=\"top-center\" />\n        </div>\n    </VCToastProvider>\n</template>\n","<!--\n  - Copyright (c) 2026.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\nimport { defineComponent } from 'vue';\n\nexport default defineComponent({\n    props: {\n        // Compact authup mark in the card header. The full hero artwork\n        // stays an app concern (the admin console's login entry); the shell only\n        // carries the small brand identity for backend-served auth pages.\n        logo: {\n            type: Boolean,\n            default: true,\n        },\n    },\n});\n</script>\n<template>\n    <div class=\"a-auth-shell\">\n        <div\n            class=\"a-auth-shell-aurora\"\n            aria-hidden=\"true\"\n        />\n        <div class=\"a-auth-shell-card\">\n            <div\n                v-if=\"logo\"\n                class=\"a-auth-shell-logo\"\n            >\n                <svg\n                    viewBox=\"0 0 100 100\"\n                    width=\"40\"\n                    height=\"40\"\n                    aria-hidden=\"true\"\n                >\n                    <rect\n                        x=\"8\"\n                        y=\"8\"\n                        width=\"84\"\n                        height=\"84\"\n                        rx=\"16\"\n                        fill=\"var(--authup-auth-logo-background, #34353a)\"\n                    />\n                    <circle\n                        cx=\"50\"\n                        cy=\"42\"\n                        r=\"12\"\n                        fill=\"#fff\"\n                    />\n                    <path\n                        d=\"M 41 44 L 59 44 L 55 68 L 45 68 Z\"\n                        fill=\"#fff\"\n                    />\n                </svg>\n            </div>\n            <slot />\n        </div>\n    </div>\n</template>\n","<!--\n  - Copyright (c) 2026.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\nimport { defineComponent } from 'vue';\n\nexport default defineComponent({\n    props: {\n        // Compact authup mark in the card header. The full hero artwork\n        // stays an app concern (the admin console's login entry); the shell only\n        // carries the small brand identity for backend-served auth pages.\n        logo: {\n            type: Boolean,\n            default: true,\n        },\n    },\n});\n</script>\n<template>\n    <div class=\"a-auth-shell\">\n        <div\n            class=\"a-auth-shell-aurora\"\n            aria-hidden=\"true\"\n        />\n        <div class=\"a-auth-shell-card\">\n            <div\n                v-if=\"logo\"\n                class=\"a-auth-shell-logo\"\n            >\n                <svg\n                    viewBox=\"0 0 100 100\"\n                    width=\"40\"\n                    height=\"40\"\n                    aria-hidden=\"true\"\n                >\n                    <rect\n                        x=\"8\"\n                        y=\"8\"\n                        width=\"84\"\n                        height=\"84\"\n                        rx=\"16\"\n                        fill=\"var(--authup-auth-logo-background, #34353a)\"\n                    />\n                    <circle\n                        cx=\"50\"\n                        cy=\"42\"\n                        r=\"12\"\n                        fill=\"#fff\"\n                    />\n                    <path\n                        d=\"M 41 44 L 59 44 L 55 68 L 45 68 Z\"\n                        fill=\"#fff\"\n                    />\n                </svg>\n            </div>\n            <slot />\n        </div>\n    </div>\n</template>\n","<!--\n  - Copyright (c) 2026.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\nimport type { PropType } from 'vue';\nimport { defineComponent } from 'vue';\nimport type { LinkProps } from '@vuecs/link';\nimport { VCLink } from '@vuecs/link';\nimport { VCIcon } from '@vuecs/icon';\nimport { TranslatorTranslationClientKey, TranslatorTranslationNamespace } from '@authup/i18n';\nimport { useTranslations } from '../../core';\n\n// Shared \"‹ Back to login\" affordance for the auth workflow forms. Renders\n// nothing unless a link is supplied, so callers can pass an optional prop\n// straight through.\nexport default defineComponent({\n    components: { VCLink, VCIcon },\n    props: { link: { type: Object as PropType<LinkProps> } },\n    setup() {\n        const translations = useTranslations([\n            {\n                namespace: TranslatorTranslationNamespace.CLIENT,\n                key: TranslatorTranslationClientKey.BACK_TO_LOGIN,\n            },\n        ]);\n\n        return { translations };\n    },\n});\n</script>\n<template>\n    <div\n        v-if=\"link\"\n        class=\"text-center mt-3\"\n    >\n        <VCLink\n            v-bind=\"link\"\n            class=\"a-auth-back-link\"\n        >\n            <VCIcon name=\"fa6-solid:chevron-left\" />\n            {{ translations.backToLogin }}\n        </VCLink>\n    </div>\n</template>\n","<!--\n  - Copyright (c) 2026.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\nimport type { PropType } from 'vue';\nimport { defineComponent } from 'vue';\nimport type { LinkProps } from '@vuecs/link';\nimport { VCLink } from '@vuecs/link';\nimport { VCIcon } from '@vuecs/icon';\nimport { TranslatorTranslationClientKey, TranslatorTranslationNamespace } from '@authup/i18n';\nimport { useTranslations } from '../../core';\n\n// Shared \"‹ Back to login\" affordance for the auth workflow forms. Renders\n// nothing unless a link is supplied, so callers can pass an optional prop\n// straight through.\nexport default defineComponent({\n    components: { VCLink, VCIcon },\n    props: { link: { type: Object as PropType<LinkProps> } },\n    setup() {\n        const translations = useTranslations([\n            {\n                namespace: TranslatorTranslationNamespace.CLIENT,\n                key: TranslatorTranslationClientKey.BACK_TO_LOGIN,\n            },\n        ]);\n\n        return { translations };\n    },\n});\n</script>\n<template>\n    <div\n        v-if=\"link\"\n        class=\"text-center mt-3\"\n    >\n        <VCLink\n            v-bind=\"link\"\n            class=\"a-auth-back-link\"\n        >\n            <VCIcon name=\"fa6-solid:chevron-left\" />\n            {{ translations.backToLogin }}\n        </VCLink>\n    </div>\n</template>\n","<!--\n  - Copyright (c) 2026.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\nimport { generateName } from '@authup/kit';\nimport type { PropType } from 'vue';\nimport { computed, defineComponent } from 'vue';\nimport { VCFormInput } from '@vuecs/forms';\nimport { VCIcon } from '@vuecs/icon';\nimport { TranslatorTranslationActionKey, TranslatorTranslationNamespace } from '@authup/i18n';\nimport { useTranslations } from '../../core';\n\n/**\n * Name input with an attached \"regenerate\" button rendered inside the\n * `VCFormInput` group append slot. Clicking the button emits a freshly\n * generated, slug-safe entity name (e.g. `brave-otter-1a2b3c`) through the\n * same `update:modelValue` channel as typing, so callers can bind it with\n * `v-model` or `:model-value` + `@update:model-value` exactly like a plain\n * `<VCFormInput>`.\n *\n * When `disabled` is set (built-in / name-locked / master entities) the append\n * button is omitted and a plain disabled input is rendered.\n */\nexport default defineComponent({\n    name: 'ANameInput',\n    components: { VCFormInput, VCIcon },\n    props: {\n        modelValue: {\n            type: String as PropType<string | null | undefined>,\n            default: '',\n        },\n        disabled: {\n            type: Boolean,\n            default: false,\n        },\n        label: {\n            type: String as PropType<string | undefined>,\n            default: undefined,\n        },\n    },\n    emits: ['update:modelValue'],\n    setup(props, { emit }) {\n        const translationsDefault = useTranslations([\n            {\n                namespace: TranslatorTranslationNamespace.ACTION, \n                key: TranslatorTranslationActionKey.GENERATE, \n            },\n        ]);\n\n        const buttonLabel = computed(() => props.label ?? translationsDefault.generate);\n\n        const onUpdate = (value: string) => {\n            emit('update:modelValue', value);\n        };\n\n        const generate = () => {\n            emit('update:modelValue', generateName());\n        };\n\n        return {\n            buttonLabel,\n            onUpdate,\n            generate,\n        };\n    },\n});\n\n</script>\n\n<template>\n    <VCFormInput\n        :model-value=\"modelValue ?? ''\"\n        :disabled=\"disabled\"\n        :group=\"!disabled\"\n        @update:model-value=\"onUpdate\"\n    >\n        <template\n            v-if=\"!disabled\"\n            #groupAppend=\"{ class: appendClass }\"\n        >\n            <button\n                type=\"button\"\n                :class=\"appendClass\"\n                class=\"cursor-pointer transition-colors hover:bg-bg-elevated\"\n                :aria-label=\"buttonLabel\"\n                :title=\"buttonLabel\"\n                @click.prevent=\"generate\"\n            >\n                <VCIcon\n                    aria-hidden=\"true\"\n                    name=\"fa6-solid:arrows-rotate\"\n                />\n            </button>\n        </template>\n    </VCFormInput>\n</template>\n","<!--\n  - Copyright (c) 2026.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\nimport { generateName } from '@authup/kit';\nimport type { PropType } from 'vue';\nimport { computed, defineComponent } from 'vue';\nimport { VCFormInput } from '@vuecs/forms';\nimport { VCIcon } from '@vuecs/icon';\nimport { TranslatorTranslationActionKey, TranslatorTranslationNamespace } from '@authup/i18n';\nimport { useTranslations } from '../../core';\n\n/**\n * Name input with an attached \"regenerate\" button rendered inside the\n * `VCFormInput` group append slot. Clicking the button emits a freshly\n * generated, slug-safe entity name (e.g. `brave-otter-1a2b3c`) through the\n * same `update:modelValue` channel as typing, so callers can bind it with\n * `v-model` or `:model-value` + `@update:model-value` exactly like a plain\n * `<VCFormInput>`.\n *\n * When `disabled` is set (built-in / name-locked / master entities) the append\n * button is omitted and a plain disabled input is rendered.\n */\nexport default defineComponent({\n    name: 'ANameInput',\n    components: { VCFormInput, VCIcon },\n    props: {\n        modelValue: {\n            type: String as PropType<string | null | undefined>,\n            default: '',\n        },\n        disabled: {\n            type: Boolean,\n            default: false,\n        },\n        label: {\n            type: String as PropType<string | undefined>,\n            default: undefined,\n        },\n    },\n    emits: ['update:modelValue'],\n    setup(props, { emit }) {\n        const translationsDefault = useTranslations([\n            {\n                namespace: TranslatorTranslationNamespace.ACTION, \n                key: TranslatorTranslationActionKey.GENERATE, \n            },\n        ]);\n\n        const buttonLabel = computed(() => props.label ?? translationsDefault.generate);\n\n        const onUpdate = (value: string) => {\n            emit('update:modelValue', value);\n        };\n\n        const generate = () => {\n            emit('update:modelValue', generateName());\n        };\n\n        return {\n            buttonLabel,\n            onUpdate,\n            generate,\n        };\n    },\n});\n\n</script>\n\n<template>\n    <VCFormInput\n        :model-value=\"modelValue ?? ''\"\n        :disabled=\"disabled\"\n        :group=\"!disabled\"\n        @update:model-value=\"onUpdate\"\n    >\n        <template\n            v-if=\"!disabled\"\n            #groupAppend=\"{ class: appendClass }\"\n        >\n            <button\n                type=\"button\"\n                :class=\"appendClass\"\n                class=\"cursor-pointer transition-colors hover:bg-bg-elevated\"\n                :aria-label=\"buttonLabel\"\n                :title=\"buttonLabel\"\n                @click.prevent=\"generate\"\n            >\n                <VCIcon\n                    aria-hidden=\"true\"\n                    name=\"fa6-solid:arrows-rotate\"\n                />\n            </button>\n        </template>\n    </VCFormInput>\n</template>\n","<!--\n  - Copyright (c) 2026.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\nimport { generateSecret } from '@authup/kit';\nimport type { PropType } from 'vue';\nimport { computed, defineComponent } from 'vue';\nimport { VCFormInput } from '@vuecs/forms';\nimport { VCIcon } from '@vuecs/icon';\nimport { TranslatorTranslationActionKey, TranslatorTranslationNamespace } from '@authup/i18n';\nimport { useTranslations } from '../../core';\n\n/**\n * Secret input with an attached \"regenerate\" button rendered inside the\n * `VCFormInput` group append slot. Clicking the button emits a freshly\n * generated, cryptographically strong secret through the same\n * `update:modelValue` channel as typing, so callers can bind it with\n * `v-model` or `:model-value` + `@update:model-value` exactly like a plain\n * `<VCFormInput>`.\n *\n * Mirrors `ANameInput` so name and secret fields share the same\n * input + group-append layout. When `disabled` is set the append button is\n * omitted and a plain disabled input is rendered.\n *\n * The button generates client-side only (a user click), so it never affects\n * SSR. Callers must likewise generate the initial value client-side (e.g. in\n * `onMounted`) — a secret must not be derived from a hydration-stable seed.\n */\nexport default defineComponent({\n    name: 'ASecretInput',\n    components: { VCFormInput, VCIcon },\n    props: {\n        modelValue: {\n            type: String as PropType<string | null | undefined>,\n            default: '',\n        },\n        disabled: {\n            type: Boolean,\n            default: false,\n        },\n        label: {\n            type: String as PropType<string | undefined>,\n            default: undefined,\n        },\n    },\n    emits: ['update:modelValue'],\n    setup(props, { emit }) {\n        const translationsDefault = useTranslations([\n            {\n                namespace: TranslatorTranslationNamespace.ACTION,\n                key: TranslatorTranslationActionKey.GENERATE,\n            },\n        ]);\n\n        const buttonLabel = computed(() => props.label ?? translationsDefault.generate);\n\n        const onUpdate = (value: string) => {\n            emit('update:modelValue', value);\n        };\n\n        const generate = () => {\n            emit('update:modelValue', generateSecret());\n        };\n\n        return {\n            buttonLabel,\n            onUpdate,\n            generate,\n        };\n    },\n});\n\n</script>\n\n<template>\n    <VCFormInput\n        :model-value=\"modelValue ?? ''\"\n        :disabled=\"disabled\"\n        :group=\"!disabled\"\n        @update:model-value=\"onUpdate\"\n    >\n        <template\n            v-if=\"!disabled\"\n            #groupAppend=\"{ class: appendClass }\"\n        >\n            <button\n                type=\"button\"\n                :class=\"appendClass\"\n                class=\"cursor-pointer transition-colors hover:bg-bg-elevated\"\n                :aria-label=\"buttonLabel\"\n                :title=\"buttonLabel\"\n                @click.prevent=\"generate\"\n            >\n                <VCIcon\n                    aria-hidden=\"true\"\n                    name=\"fa6-solid:arrows-rotate\"\n                />\n            </button>\n        </template>\n    </VCFormInput>\n</template>\n","<!--\n  - Copyright (c) 2026.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\nimport { generateSecret } from '@authup/kit';\nimport type { PropType } from 'vue';\nimport { computed, defineComponent } from 'vue';\nimport { VCFormInput } from '@vuecs/forms';\nimport { VCIcon } from '@vuecs/icon';\nimport { TranslatorTranslationActionKey, TranslatorTranslationNamespace } from '@authup/i18n';\nimport { useTranslations } from '../../core';\n\n/**\n * Secret input with an attached \"regenerate\" button rendered inside the\n * `VCFormInput` group append slot. Clicking the button emits a freshly\n * generated, cryptographically strong secret through the same\n * `update:modelValue` channel as typing, so callers can bind it with\n * `v-model` or `:model-value` + `@update:model-value` exactly like a plain\n * `<VCFormInput>`.\n *\n * Mirrors `ANameInput` so name and secret fields share the same\n * input + group-append layout. When `disabled` is set the append button is\n * omitted and a plain disabled input is rendered.\n *\n * The button generates client-side only (a user click), so it never affects\n * SSR. Callers must likewise generate the initial value client-side (e.g. in\n * `onMounted`) — a secret must not be derived from a hydration-stable seed.\n */\nexport default defineComponent({\n    name: 'ASecretInput',\n    components: { VCFormInput, VCIcon },\n    props: {\n        modelValue: {\n            type: String as PropType<string | null | undefined>,\n            default: '',\n        },\n        disabled: {\n            type: Boolean,\n            default: false,\n        },\n        label: {\n            type: String as PropType<string | undefined>,\n            default: undefined,\n        },\n    },\n    emits: ['update:modelValue'],\n    setup(props, { emit }) {\n        const translationsDefault = useTranslations([\n            {\n                namespace: TranslatorTranslationNamespace.ACTION,\n                key: TranslatorTranslationActionKey.GENERATE,\n            },\n        ]);\n\n        const buttonLabel = computed(() => props.label ?? translationsDefault.generate);\n\n        const onUpdate = (value: string) => {\n            emit('update:modelValue', value);\n        };\n\n        const generate = () => {\n            emit('update:modelValue', generateSecret());\n        };\n\n        return {\n            buttonLabel,\n            onUpdate,\n            generate,\n        };\n    },\n});\n\n</script>\n\n<template>\n    <VCFormInput\n        :model-value=\"modelValue ?? ''\"\n        :disabled=\"disabled\"\n        :group=\"!disabled\"\n        @update:model-value=\"onUpdate\"\n    >\n        <template\n            v-if=\"!disabled\"\n            #groupAppend=\"{ class: appendClass }\"\n        >\n            <button\n                type=\"button\"\n                :class=\"appendClass\"\n                class=\"cursor-pointer transition-colors hover:bg-bg-elevated\"\n                :aria-label=\"buttonLabel\"\n                :title=\"buttonLabel\"\n                @click.prevent=\"generate\"\n            >\n                <VCIcon\n                    aria-hidden=\"true\"\n                    name=\"fa6-solid:arrows-rotate\"\n                />\n            </button>\n        </template>\n    </VCFormInput>\n</template>\n","/*\n * Copyright (c) 2023.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { EntityType } from '@authup/core-kit';\nimport type { Client } from '@authup/core-kit';\nimport type { SlotsType } from 'vue';\nimport { defineComponent } from 'vue';\nimport type { EntityVSlots } from '../../utility';\nimport {\n    defineEntityManager,\n    defineEntityVEmitOptions,\n    defineEntityVProps,\n} from '../../utility';\n\nexport const AClient = defineComponent({\n    props: defineEntityVProps<Client>(),\n    emits: defineEntityVEmitOptions<Client>(),\n    slots: Object as SlotsType<EntityVSlots<Client>>,\n    async setup(props, setup) {\n        const manager = defineEntityManager({\n            type: `${EntityType.CLIENT}`,\n            setup,\n            props,\n        });\n\n        try {\n            await manager.resolveOrFail();\n\n            return () => manager.render();\n        } catch (e) {\n            return () => manager.renderError(e);\n        }\n    },\n});\n","/*\n * Copyright (c) 2023.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { EntityType } from '@authup/core-kit';\nimport type { Realm } from '@authup/core-kit';\nimport type { SlotsType } from 'vue';\nimport { defineComponent } from 'vue';\nimport type { EntityVSlots } from '../../utility';\nimport {\n    defineEntityManager,\n    defineEntityVEmitOptions,\n    defineEntityVProps,\n} from '../../utility';\n\nexport const ARealm = defineComponent({\n    props: defineEntityVProps<Realm>(),\n    emits: defineEntityVEmitOptions<Realm>(),\n    slots: Object as SlotsType<EntityVSlots<Realm>>,\n    async setup(props, setup) {\n        const manager = defineEntityManager({\n            type: `${EntityType.REALM}`,\n            props,\n            setup,\n        });\n\n        try {\n            await manager.resolveOrFail();\n\n            return () => manager.render();\n        } catch (e) {\n            return () => manager.renderError(e);\n        }\n    },\n});\n","/*\n * Copyright (c) 2023.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport type { ComputedRef, MaybeRef } from 'vue';\nimport { computed, isRef } from 'vue';\n\ntype ObjectLiteral = {\n    id: any\n};\nexport function useIsEditing<T extends ObjectLiteral>(input: MaybeRef<T | undefined>) : ComputedRef<boolean> {\n    return computed(() => {\n        if (isRef(input)) {\n            return !!input.value && !!input.value.id;\n        }\n\n        return !!input && !!input.id;\n    });\n}\n","/*\n * Copyright (c) 2023.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { watch } from 'vue';\nimport type { Ref } from 'vue';\n\nexport function onChange<T>(input: Ref<T>, fn: (item: T) => any) {\n    watch(input, (val, oldValue) => {\n        if (val !== oldValue) {\n            fn(val);\n        }\n    }, { deep: true });\n}\n","/*\n * Copyright (c) 2023.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport type { ComputedRef, MaybeRefOrGetter } from 'vue';\nimport { computed, toValue } from 'vue';\n\ntype ObjectLiteral = {\n    updatedAt: string | Date | undefined\n};\n\n/**\n * Track an entity's `updatedAt`. Pass a ref or getter\n * (e.g. `() => props.entity`) — a plain value is accepted but yields a\n * static computed: reading `props.entity` at the call site captures the\n * object once, so a later prop replacement never triggers watchers.\n */\nexport function useUpdatedAt<T extends ObjectLiteral>(input?: MaybeRefOrGetter<T | null | undefined>) : ComputedRef<string | Date | undefined> {\n    return computed(() => {\n        const value = toValue(input);\n\n        return value ? value.updatedAt : undefined;\n    });\n}\n","/*\n * Copyright (c) 2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport type { PermissionEvaluationContext } from '@authup/access';\nimport type { Ref } from 'vue';\nimport { createPermissionCheckerReactiveFn } from '../core';\n\nexport function usePermissionCheck(ctx: PermissionEvaluationContext) : Ref<boolean> {\n    const checkFn = createPermissionCheckerReactiveFn();\n\n    return checkFn(ctx);\n}\n","<!--\n  - Copyright (c) 2022-2026.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\nimport { ValidatorGroup, generateName } from '@authup/kit';\nimport { useValidup } from '@validup/vue';\nimport { TranslatorTranslationEntityKey, TranslatorTranslationFieldKey, TranslatorTranslationNamespace } from '@authup/i18n';\nimport { assignFormProperties, useTranslations } from '../../../core';\nimport type { PropType } from 'vue';\nimport {\n    computed,\n    defineComponent,\n    reactive,\n    ref,\n    useId,\n    watch,\n} from 'vue';\nimport type { Realm } from '@authup/core-kit';\nimport { EntityType, REALM_MASTER_NAME, RealmValidator } from '@authup/core-kit';\nimport { VCFormGroup, VCFormInput, VCFormTextarea } from '@vuecs/forms';\nimport { useIsEditing, useUpdatedAt } from '../../../composables';\nimport { IFieldValidation } from '@ilingo/validup-vue';\nimport {\n    AFormSubmit,\n    ANameInput,\n    defineEntityManager,\n    defineEntityVEmitOptions,\n} from '../../utility';\n\nexport default defineComponent({\n    components: {\n        AFormSubmit,\n        ANameInput,\n        VCFormGroup,\n        VCFormInput,\n        VCFormTextarea,\n\n        IFieldValidation,\n    },\n    props: {\n        entity: {\n            type: Object as PropType<Realm>,\n            required: false,\n            default: undefined,\n        },\n    },\n    emits: defineEntityVEmitOptions<Realm>(),\n    setup(props, ctx) {\n        const busy = ref(false);\n        const nameSeed = useId();\n        const form = reactive({\n            name: '',\n            displayName: '',\n            description: '',\n        });\n\n        const manager = defineEntityManager({\n            type: EntityType.REALM,\n            setup: ctx,\n            props,\n        });\n\n        const isEditing = useIsEditing(manager.data);\n\n        const v = useValidup(\n            new RealmValidator(),\n            form,\n            { group: computed(() => (isEditing.value ? ValidatorGroup.UPDATE : ValidatorGroup.CREATE)) },\n        );\n\n        const updatedAt = useUpdatedAt(() => props.entity);\n        const isMaster = computed(() => manager.data.value &&\n            manager.data.value.name === REALM_MASTER_NAME);\n\n        function initForm() {\n            assignFormProperties(form, manager.data.value, { fields: v.fields });\n\n            if (form.name.length === 0) {\n                form.name = generateName(nameSeed);\n            }\n        }\n\n        watch(updatedAt, (val, oldVal) => {\n            if (!val || val === oldVal) {\n                return;\n            }\n\n            manager.data.value = props.entity;\n            initForm();\n        });\n\n        initForm();\n\n        const submit = async () => {\n            if (v.$invalid.value) {\n                return;\n            }\n\n            await manager.createOrUpdate(form);\n        };\n\n        const translationsDefault = useTranslations(\n            [\n                {\n                    namespace: TranslatorTranslationNamespace.FIELD, \n                    key: TranslatorTranslationFieldKey.NAME, \n                },\n                {\n                    namespace: TranslatorTranslationNamespace.FIELD, \n                    key: TranslatorTranslationFieldKey.DISPLAY_NAME, \n                },\n                {\n                    namespace: TranslatorTranslationNamespace.FIELD, \n                    key: TranslatorTranslationFieldKey.DESCRIPTION, \n                },\n                {\n                    namespace: TranslatorTranslationNamespace.ENTITY, \n                    key: TranslatorTranslationEntityKey.REALM, \n                    count: 1, \n                },\n            ],\n        );\n\n        return {\n            busy,\n            v,\n            isEditing,\n            isMaster,\n            translationsDefault,\n            submit,\n        };\n    },\n});\n\n</script>\n\n<template>\n    <form @submit.prevent=\"submit\">\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"v.fields.name\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translationsDefault.name }}\n                </template>\n                <ANameInput\n                    v-model=\"v.fields.name.$model.value\"\n                    :disabled=\"isMaster\"\n                />\n            </VCFormGroup>\n        </IFieldValidation>\n\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"v.fields.displayName\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translationsDefault.displayName }}\n                </template>\n                <VCFormInput\n                    :model-value=\"v.fields.displayName.$model.value ?? ''\"\n                    @update:model-value=\"(next: string) => { v.fields.displayName.$model.value = next; }\"\n                />\n            </VCFormGroup>\n        </IFieldValidation>\n\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"v.fields.description\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translationsDefault.description }}\n                </template>\n                <VCFormTextarea\n                    :model-value=\"v.fields.description.$model.value ?? ''\"\n                    :rows=\"4\"\n                    @update:model-value=\"(next: string) => { v.fields.description.$model.value = next; }\"\n                />\n            </VCFormGroup>\n        </IFieldValidation>\n\n        <AFormSubmit\n            :is-busy=\"busy\"\n            :is-editing=\"isEditing\"\n            :is-invalid=\"v.$invalid.value\"\n            @submit=\"submit\"\n        />\n    </form>\n</template>\n","<!--\n  - Copyright (c) 2022-2026.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\nimport { ValidatorGroup, generateName } from '@authup/kit';\nimport { useValidup } from '@validup/vue';\nimport { TranslatorTranslationEntityKey, TranslatorTranslationFieldKey, TranslatorTranslationNamespace } from '@authup/i18n';\nimport { assignFormProperties, useTranslations } from '../../../core';\nimport type { PropType } from 'vue';\nimport {\n    computed,\n    defineComponent,\n    reactive,\n    ref,\n    useId,\n    watch,\n} from 'vue';\nimport type { Realm } from '@authup/core-kit';\nimport { EntityType, REALM_MASTER_NAME, RealmValidator } from '@authup/core-kit';\nimport { VCFormGroup, VCFormInput, VCFormTextarea } from '@vuecs/forms';\nimport { useIsEditing, useUpdatedAt } from '../../../composables';\nimport { IFieldValidation } from '@ilingo/validup-vue';\nimport {\n    AFormSubmit,\n    ANameInput,\n    defineEntityManager,\n    defineEntityVEmitOptions,\n} from '../../utility';\n\nexport default defineComponent({\n    components: {\n        AFormSubmit,\n        ANameInput,\n        VCFormGroup,\n        VCFormInput,\n        VCFormTextarea,\n\n        IFieldValidation,\n    },\n    props: {\n        entity: {\n            type: Object as PropType<Realm>,\n            required: false,\n            default: undefined,\n        },\n    },\n    emits: defineEntityVEmitOptions<Realm>(),\n    setup(props, ctx) {\n        const busy = ref(false);\n        const nameSeed = useId();\n        const form = reactive({\n            name: '',\n            displayName: '',\n            description: '',\n        });\n\n        const manager = defineEntityManager({\n            type: EntityType.REALM,\n            setup: ctx,\n            props,\n        });\n\n        const isEditing = useIsEditing(manager.data);\n\n        const v = useValidup(\n            new RealmValidator(),\n            form,\n            { group: computed(() => (isEditing.value ? ValidatorGroup.UPDATE : ValidatorGroup.CREATE)) },\n        );\n\n        const updatedAt = useUpdatedAt(() => props.entity);\n        const isMaster = computed(() => manager.data.value &&\n            manager.data.value.name === REALM_MASTER_NAME);\n\n        function initForm() {\n            assignFormProperties(form, manager.data.value, { fields: v.fields });\n\n            if (form.name.length === 0) {\n                form.name = generateName(nameSeed);\n            }\n        }\n\n        watch(updatedAt, (val, oldVal) => {\n            if (!val || val === oldVal) {\n                return;\n            }\n\n            manager.data.value = props.entity;\n            initForm();\n        });\n\n        initForm();\n\n        const submit = async () => {\n            if (v.$invalid.value) {\n                return;\n            }\n\n            await manager.createOrUpdate(form);\n        };\n\n        const translationsDefault = useTranslations(\n            [\n                {\n                    namespace: TranslatorTranslationNamespace.FIELD, \n                    key: TranslatorTranslationFieldKey.NAME, \n                },\n                {\n                    namespace: TranslatorTranslationNamespace.FIELD, \n                    key: TranslatorTranslationFieldKey.DISPLAY_NAME, \n                },\n                {\n                    namespace: TranslatorTranslationNamespace.FIELD, \n                    key: TranslatorTranslationFieldKey.DESCRIPTION, \n                },\n                {\n                    namespace: TranslatorTranslationNamespace.ENTITY, \n                    key: TranslatorTranslationEntityKey.REALM, \n                    count: 1, \n                },\n            ],\n        );\n\n        return {\n            busy,\n            v,\n            isEditing,\n            isMaster,\n            translationsDefault,\n            submit,\n        };\n    },\n});\n\n</script>\n\n<template>\n    <form @submit.prevent=\"submit\">\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"v.fields.name\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translationsDefault.name }}\n                </template>\n                <ANameInput\n                    v-model=\"v.fields.name.$model.value\"\n                    :disabled=\"isMaster\"\n                />\n            </VCFormGroup>\n        </IFieldValidation>\n\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"v.fields.displayName\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translationsDefault.displayName }}\n                </template>\n                <VCFormInput\n                    :model-value=\"v.fields.displayName.$model.value ?? ''\"\n                    @update:model-value=\"(next: string) => { v.fields.displayName.$model.value = next; }\"\n                />\n            </VCFormGroup>\n        </IFieldValidation>\n\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"v.fields.description\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translationsDefault.description }}\n                </template>\n                <VCFormTextarea\n                    :model-value=\"v.fields.description.$model.value ?? ''\"\n                    :rows=\"4\"\n                    @update:model-value=\"(next: string) => { v.fields.description.$model.value = next; }\"\n                />\n            </VCFormGroup>\n        </IFieldValidation>\n\n        <AFormSubmit\n            :is-busy=\"busy\"\n            :is-editing=\"isEditing\"\n            :is-invalid=\"v.$invalid.value\"\n            @submit=\"submit\"\n        />\n    </form>\n</template>\n","<!--\n  - Copyright (c) 2026.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\nimport type { Realm } from '@authup/core-kit';\nimport {\n    computed,\n    defineComponent,\n    onMounted,\n    ref,\n} from 'vue';\nimport {\n    TranslatorTranslationCommonKey,\n    TranslatorTranslationNamespace,\n} from '@authup/i18n';\nimport { VCAlert } from '@vuecs/elements';\nimport { VCIcon } from '@vuecs/icon';\nimport { injectHTTPClient, useTranslations } from '../../../core';\n\nexport default defineComponent({\n    components: { VCAlert, VCIcon },\n    props: {\n        // When exactly one realm is available, emit `select` for it\n        // immediately instead of rendering a single-tile chooser. Lets the\n        // common single-realm deployment skip the picker entirely.\n        autoSelectSingle: {\n            type: Boolean,\n            default: true,\n        },\n        // Reveal the filter input only once the realm count crosses this\n        // threshold — small deployments stay clutter-free.\n        searchThreshold: {\n            type: Number,\n            default: 8,\n        },\n    },\n    emits: ['select'],\n    setup(props, { emit }) {\n        const client = injectHTTPClient();\n\n        const translations = useTranslations([\n            {\n                namespace: TranslatorTranslationNamespace.COMMON,\n                key: TranslatorTranslationCommonKey.SEARCH,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.COMMON,\n                key: TranslatorTranslationCommonKey.NO_RESULTS,\n            },\n        ]);\n\n        const items = ref<Realm[]>([]);\n        const busy = ref(false);\n        // False until the first load settles. The SSR pass and the first\n        // hydration frame run before onMounted's load(), so without this\n        // gate the grid would paint the \"no results\" empty state (with its\n        // still-unresolved translation fallback) instead of the skeleton.\n        const loaded = ref(false);\n        const error = ref<string | null>(null);\n        const search = ref('');\n\n        // Kept true from the single-realm auto-select until the browser\n        // navigates away, so the skeleton stays up instead of flashing the\n        // lone tile for a frame.\n        const redirecting = ref(false);\n\n        const load = async () => {\n            if (busy.value) {\n                return;\n            }\n\n            busy.value = true;\n            error.value = null;\n\n            try {\n                const response = await client.realm.getMany({\n                    sorts: { name: 'ASC' },\n                    pagination: { limit: 100 },\n                });\n\n                items.value = response.data;\n\n                if (props.autoSelectSingle && items.value.length === 1) {\n                    redirecting.value = true;\n                    emit('select', items.value[0]);\n                }\n            } catch (e) {\n                error.value = e instanceof Error ? e.message : 'The realms could not be loaded.';\n            } finally {\n                busy.value = false;\n                loaded.value = true;\n            }\n        };\n\n        onMounted(() => load());\n\n        const showSearch = computed(() => items.value.length > props.searchThreshold);\n\n        const filtered = computed(() => {\n            const term = search.value.trim().toLowerCase();\n            if (!term) {\n                return items.value;\n            }\n\n            return items.value.filter((realm) => {\n                const haystack = `${realm.displayName || ''} ${realm.name || ''}`.toLowerCase();\n                return haystack.includes(term);\n            });\n        });\n\n        const labelFor = (realm: Realm) => realm.displayName || realm.name;\n\n        // Show the technical name beneath the label only when a display\n        // name shadows it — otherwise the tile would repeat itself.\n        const slugFor = (realm: Realm) => (\n            realm.displayName && realm.displayName !== realm.name ?\n                realm.name :\n                null\n        );\n\n        const handleSelect = (realm: Realm) => {\n            emit('select', realm);\n        };\n\n        // Recovery hatch for the auto-select path: if the parent's redirect\n        // glue fails (e.g. PKCE crypto unavailable on an insecure origin) it\n        // can call this to drop the skeleton and re-show the tiles instead of\n        // stranding the user. Exposed via template ref.\n        const reset = () => {\n            redirecting.value = false;\n        };\n\n        return {\n            items,\n            busy,\n            loaded,\n            error,\n            search,\n            redirecting,\n            showSearch,\n            filtered,\n            translations,\n            labelFor,\n            slugFor,\n            handleSelect,\n            reset,\n        };\n    },\n});\n</script>\n<template>\n    <div class=\"a-realm-select\">\n        <VCAlert\n            v-if=\"error\"\n            color=\"error\"\n            variant=\"soft\"\n            class=\"a-realm-select-alert\"\n        >\n            {{ error }}\n        </VCAlert>\n\n        <div\n            v-if=\"!loaded || busy || redirecting\"\n            class=\"a-realm-grid\"\n            aria-hidden=\"true\"\n        >\n            <div\n                v-for=\"n in 6\"\n                :key=\"n\"\n                class=\"a-realm-grid-item a-realm-grid-item--skeleton\"\n            />\n        </div>\n\n        <template v-else>\n            <div\n                v-if=\"showSearch\"\n                class=\"a-realm-search\"\n            >\n                <VCIcon\n                    name=\"fa6-solid:magnifying-glass\"\n                    class=\"a-realm-search-icon\"\n                />\n                <input\n                    v-model=\"search\"\n                    type=\"text\"\n                    class=\"a-realm-search-input\"\n                    :placeholder=\"translations.search\"\n                >\n            </div>\n\n            <div\n                v-if=\"filtered.length === 0\"\n                class=\"a-realm-empty\"\n            >\n                <VCIcon\n                    name=\"fa6-solid:folder-open\"\n                    class=\"a-realm-empty-icon\"\n                />\n                <span>{{ translations.noResults }}</span>\n            </div>\n\n            <div\n                v-else\n                class=\"a-realm-grid\"\n            >\n                <button\n                    v-for=\"realm in filtered\"\n                    :key=\"realm.id\"\n                    type=\"button\"\n                    class=\"a-realm-grid-item\"\n                    @click.prevent=\"handleSelect(realm)\"\n                >\n                    <span class=\"a-realm-grid-item-name\">\n                        {{ labelFor(realm) }}\n                    </span>\n                    <span\n                        v-if=\"slugFor(realm)\"\n                        class=\"a-realm-grid-item-slug\"\n                    >\n                        {{ slugFor(realm) }}\n                    </span>\n                </button>\n            </div>\n        </template>\n    </div>\n</template>\n","<!--\n  - Copyright (c) 2026.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\nimport type { Realm } from '@authup/core-kit';\nimport {\n    computed,\n    defineComponent,\n    onMounted,\n    ref,\n} from 'vue';\nimport {\n    TranslatorTranslationCommonKey,\n    TranslatorTranslationNamespace,\n} from '@authup/i18n';\nimport { VCAlert } from '@vuecs/elements';\nimport { VCIcon } from '@vuecs/icon';\nimport { injectHTTPClient, useTranslations } from '../../../core';\n\nexport default defineComponent({\n    components: { VCAlert, VCIcon },\n    props: {\n        // When exactly one realm is available, emit `select` for it\n        // immediately instead of rendering a single-tile chooser. Lets the\n        // common single-realm deployment skip the picker entirely.\n        autoSelectSingle: {\n            type: Boolean,\n            default: true,\n        },\n        // Reveal the filter input only once the realm count crosses this\n        // threshold — small deployments stay clutter-free.\n        searchThreshold: {\n            type: Number,\n            default: 8,\n        },\n    },\n    emits: ['select'],\n    setup(props, { emit }) {\n        const client = injectHTTPClient();\n\n        const translations = useTranslations([\n            {\n                namespace: TranslatorTranslationNamespace.COMMON,\n                key: TranslatorTranslationCommonKey.SEARCH,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.COMMON,\n                key: TranslatorTranslationCommonKey.NO_RESULTS,\n            },\n        ]);\n\n        const items = ref<Realm[]>([]);\n        const busy = ref(false);\n        // False until the first load settles. The SSR pass and the first\n        // hydration frame run before onMounted's load(), so without this\n        // gate the grid would paint the \"no results\" empty state (with its\n        // still-unresolved translation fallback) instead of the skeleton.\n        const loaded = ref(false);\n        const error = ref<string | null>(null);\n        const search = ref('');\n\n        // Kept true from the single-realm auto-select until the browser\n        // navigates away, so the skeleton stays up instead of flashing the\n        // lone tile for a frame.\n        const redirecting = ref(false);\n\n        const load = async () => {\n            if (busy.value) {\n                return;\n            }\n\n            busy.value = true;\n            error.value = null;\n\n            try {\n                const response = await client.realm.getMany({\n                    sorts: { name: 'ASC' },\n                    pagination: { limit: 100 },\n                });\n\n                items.value = response.data;\n\n                if (props.autoSelectSingle && items.value.length === 1) {\n                    redirecting.value = true;\n                    emit('select', items.value[0]);\n                }\n            } catch (e) {\n                error.value = e instanceof Error ? e.message : 'The realms could not be loaded.';\n            } finally {\n                busy.value = false;\n                loaded.value = true;\n            }\n        };\n\n        onMounted(() => load());\n\n        const showSearch = computed(() => items.value.length > props.searchThreshold);\n\n        const filtered = computed(() => {\n            const term = search.value.trim().toLowerCase();\n            if (!term) {\n                return items.value;\n            }\n\n            return items.value.filter((realm) => {\n                const haystack = `${realm.displayName || ''} ${realm.name || ''}`.toLowerCase();\n                return haystack.includes(term);\n            });\n        });\n\n        const labelFor = (realm: Realm) => realm.displayName || realm.name;\n\n        // Show the technical name beneath the label only when a display\n        // name shadows it — otherwise the tile would repeat itself.\n        const slugFor = (realm: Realm) => (\n            realm.displayName && realm.displayName !== realm.name ?\n                realm.name :\n                null\n        );\n\n        const handleSelect = (realm: Realm) => {\n            emit('select', realm);\n        };\n\n        // Recovery hatch for the auto-select path: if the parent's redirect\n        // glue fails (e.g. PKCE crypto unavailable on an insecure origin) it\n        // can call this to drop the skeleton and re-show the tiles instead of\n        // stranding the user. Exposed via template ref.\n        const reset = () => {\n            redirecting.value = false;\n        };\n\n        return {\n            items,\n            busy,\n            loaded,\n            error,\n            search,\n            redirecting,\n            showSearch,\n            filtered,\n            translations,\n            labelFor,\n            slugFor,\n            handleSelect,\n            reset,\n        };\n    },\n});\n</script>\n<template>\n    <div class=\"a-realm-select\">\n        <VCAlert\n            v-if=\"error\"\n            color=\"error\"\n            variant=\"soft\"\n            class=\"a-realm-select-alert\"\n        >\n            {{ error }}\n        </VCAlert>\n\n        <div\n            v-if=\"!loaded || busy || redirecting\"\n            class=\"a-realm-grid\"\n            aria-hidden=\"true\"\n        >\n            <div\n                v-for=\"n in 6\"\n                :key=\"n\"\n                class=\"a-realm-grid-item a-realm-grid-item--skeleton\"\n            />\n        </div>\n\n        <template v-else>\n            <div\n                v-if=\"showSearch\"\n                class=\"a-realm-search\"\n            >\n                <VCIcon\n                    name=\"fa6-solid:magnifying-glass\"\n                    class=\"a-realm-search-icon\"\n                />\n                <input\n                    v-model=\"search\"\n                    type=\"text\"\n                    class=\"a-realm-search-input\"\n                    :placeholder=\"translations.search\"\n                >\n            </div>\n\n            <div\n                v-if=\"filtered.length === 0\"\n                class=\"a-realm-empty\"\n            >\n                <VCIcon\n                    name=\"fa6-solid:folder-open\"\n                    class=\"a-realm-empty-icon\"\n                />\n                <span>{{ translations.noResults }}</span>\n            </div>\n\n            <div\n                v-else\n                class=\"a-realm-grid\"\n            >\n                <button\n                    v-for=\"realm in filtered\"\n                    :key=\"realm.id\"\n                    type=\"button\"\n                    class=\"a-realm-grid-item\"\n                    @click.prevent=\"handleSelect(realm)\"\n                >\n                    <span class=\"a-realm-grid-item-name\">\n                        {{ labelFor(realm) }}\n                    </span>\n                    <span\n                        v-if=\"slugFor(realm)\"\n                        class=\"a-realm-grid-item-slug\"\n                    >\n                        {{ slugFor(realm) }}\n                    </span>\n                </button>\n            </div>\n        </template>\n    </div>\n</template>\n","/*\n * Copyright (c) 2022.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { EntityType } from '@authup/core-kit';\nimport type { SlotsType } from 'vue';\nimport { defineComponent } from 'vue';\nimport type { Realm } from '@authup/core-kit';\nimport type { EntityCollectionVSlots } from '../../utility';\nimport { TranslatorTranslationEntityKey, TranslatorTranslationNamespace, TranslatorTranslationVuecsKey } from '@authup/i18n';\nimport { useTranslation } from '../../../core';\nimport {\n    defineEntityCollectionManager,\n    defineEntityCollectionVEmitOptions,\n    defineEntityCollectionVProps,\n} from '../../utility';\n\nexport const ARealms = defineComponent({\n    props: defineEntityCollectionVProps<Realm>(),\n    emits: defineEntityCollectionVEmitOptions<Realm>(),\n    slots: Object as SlotsType<EntityCollectionVSlots<Realm>>,\n    setup(props, ctx) {\n        const { render } = defineEntityCollectionManager({\n            type: `${EntityType.REALM}`,\n            props,\n            setup: ctx,\n        });\n\n        const translationsName = useTranslation({\n            namespace: TranslatorTranslationNamespace.ENTITY,\n            key: TranslatorTranslationEntityKey.REALM,\n            count: 2,\n        });\n\n        const translation = useTranslation({\n            namespace: TranslatorTranslationNamespace.VUECS,\n            key: TranslatorTranslationVuecsKey.NO_MORE,\n            data: { name: translationsName },\n        });\n\n        return () => render({ noMore: { content: translation.value } });\n    },\n});\n","/*\n * Copyright (c) 2025.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport type { Realm } from '@authup/core-kit';\nimport type { SlotsType } from 'vue';\nimport { defineComponent } from 'vue';\nimport {\n    defineEntityPicker,\n    defineEntityPickerVEmitOptions,\n    defineEntityPickerVProps,\n} from '../../utility/entity/picker/module';\nimport type { EntityPickerVSlots } from '../../utility/entity/picker/types';\nimport { ARealms } from './ARealms';\n\nexport const ARealmPicker = defineComponent({\n    props: defineEntityPickerVProps<Realm>(),\n    emits: defineEntityPickerVEmitOptions<Realm>(),\n    slots: Object as SlotsType<EntityPickerVSlots<Realm>>,\n    setup(props, setup) {\n        const { render } = defineEntityPicker({\n            component: ARealms,\n            props,\n            setup,\n        });\n\n        return () => render();\n    },\n});\n","/*\n * Copyright (c) 2022.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\nimport { EntityType } from '@authup/core-kit';\nimport type { SlotsType } from 'vue';\nimport { defineComponent } from 'vue';\nimport type { Policy } from '@authup/core-kit';\nimport type { EntityCollectionVSlots } from '../../utility';\nimport { TranslatorTranslationEntityKey, TranslatorTranslationNamespace, TranslatorTranslationVuecsKey } from '@authup/i18n';\nimport { useTranslation } from '../../../core';\nimport {\n    defineEntityCollectionManager,\n    defineEntityCollectionVEmitOptions,\n    defineEntityCollectionVProps,\n} from '../../utility';\n\nexport const APolicies = defineComponent({\n    props: defineEntityCollectionVProps<Policy>(),\n    emits: defineEntityCollectionVEmitOptions<Policy>(),\n    slots: Object as SlotsType<EntityCollectionVSlots<Policy>>,\n    setup(props, setup) {\n        const { render } = defineEntityCollectionManager({\n            type: `${EntityType.POLICY}`,\n            props,\n            setup,\n        });\n\n        const translationName = useTranslation({\n            namespace: TranslatorTranslationNamespace.ENTITY,\n            key: TranslatorTranslationEntityKey.POLICY,\n            count: 2,\n        });\n\n        const translation = useTranslation({\n            namespace: TranslatorTranslationNamespace.VUECS,\n            key: TranslatorTranslationVuecsKey.NO_MORE,\n            data: { name: translationName },\n        });\n\n        return () => render({ noMore: { content: translation.value } });\n    },\n});\n","/*\n * Copyright (c) 2022.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { EntityType } from '@authup/core-kit';\nimport type { PropType } from 'vue';\nimport { defineComponent } from 'vue';\nimport type { Policy } from '@authup/core-kit';\nimport type { EntityManager } from '../../utility';\nimport {\n    defineEntityManager,\n    defineEntityVEmitOptions,\n    renderToggleButton,\n} from '../../utility';\n\nexport const APolicyParentAssignment = defineComponent({\n    props: {\n        entityId: {\n            type: String,\n            required: true,\n        },\n        entity: { type: Object as PropType<Policy> },\n        parentId: {\n            type: String,\n            required: true,\n        },\n    },\n    emits: defineEntityVEmitOptions<Policy>(),\n    async setup(props, setup) {\n        const manager : EntityManager<Policy> = defineEntityManager({\n            type: `${EntityType.POLICY}`,\n            setup,\n            socket: {\n                processEvent(event) {\n                    return event.data.id === props.entityId;\n                },\n            },\n            props: {\n                entity: props.entity,\n                entityId: props.entityId,\n            },\n        });\n\n        await manager.resolve({ query: { filters: { id: props.entityId } } });\n\n        return () => renderToggleButton({\n            changed: (value) => {\n                if (!manager.data.value) {\n                    return;\n                }\n\n                if (value) {\n                    manager.data.value.parentId = props.parentId;\n                } else {\n                    manager.data.value.parentId = null;\n                    if (manager.data.value.parent) {\n                        manager.data.value.parent = null;\n                    }\n                }\n\n                manager.update(manager.data.value);\n            },\n            value: !!manager.data.value &&\n                manager.data.value.parentId === props.parentId,\n            isBusy: manager.busy.value,\n        });\n    },\n});\n","<!--\n  Copyright (c) 2025.\n  Author Peter Placzek (tada5hi)\n  For the full copyright and license information,\n  view the LICENSE file that was distributed with this source code.\n-->\n\n<script lang=\"ts\">\nimport type { Policy } from '@authup/core-kit';\nimport { SlotName } from '../../../core';\nimport type { SlotsType } from 'vue';\nimport { defineComponent, h } from 'vue';\nimport { defineEntityPicker, defineEntityPickerVEmitOptions, defineEntityPickerVProps } from '../../utility';\nimport type { EntityPickerVSlots } from '../../utility';\nimport { APolicies } from './APolicies';\nimport { APolicyParentAssignment } from './APolicyParentAssignment';\n\nexport default defineComponent({\n    props: {\n        parentId: { type: String },\n        ...defineEntityPickerVProps<Policy>(),\n    },\n    emits: defineEntityPickerVEmitOptions<Policy>(),\n    slots: Object as SlotsType<EntityPickerVSlots<Policy>>,\n    setup(props, {\n        slots,\n        ...setup\n    }) {\n        const { render } = defineEntityPicker({\n            component: APolicies,\n            props,\n            setup: {\n                ...setup,\n                slots: {\n                    ...(\n                        props.parentId ? {\n                            [SlotName.ITEM_ACTIONS]: (\n                                slotProps: EntityPickerVSlots<Policy>['itemActions'],\n                            ) => h(APolicyParentAssignment, {\n                                entity: slotProps.data,\n                                entityId: slotProps.data.id,\n                                parentId: props.parentId as string,\n                            }),\n                        } : {}\n                    ),\n                    ...slots,\n                },\n            },\n        });\n\n        return () => render();\n    },\n});\n</script>\n","<!--\n  Copyright (c) 2025.\n  Author Peter Placzek (tada5hi)\n  For the full copyright and license information,\n  view the LICENSE file that was distributed with this source code.\n-->\n\n<script lang=\"ts\">\nimport type { Policy } from '@authup/core-kit';\nimport { SlotName } from '../../../core';\nimport type { SlotsType } from 'vue';\nimport { defineComponent, h } from 'vue';\nimport { defineEntityPicker, defineEntityPickerVEmitOptions, defineEntityPickerVProps } from '../../utility';\nimport type { EntityPickerVSlots } from '../../utility';\nimport { APolicies } from './APolicies';\nimport { APolicyParentAssignment } from './APolicyParentAssignment';\n\nexport default defineComponent({\n    props: {\n        parentId: { type: String },\n        ...defineEntityPickerVProps<Policy>(),\n    },\n    emits: defineEntityPickerVEmitOptions<Policy>(),\n    slots: Object as SlotsType<EntityPickerVSlots<Policy>>,\n    setup(props, {\n        slots,\n        ...setup\n    }) {\n        const { render } = defineEntityPicker({\n            component: APolicies,\n            props,\n            setup: {\n                ...setup,\n                slots: {\n                    ...(\n                        props.parentId ? {\n                            [SlotName.ITEM_ACTIONS]: (\n                                slotProps: EntityPickerVSlots<Policy>['itemActions'],\n                            ) => h(APolicyParentAssignment, {\n                                entity: slotProps.data,\n                                entityId: slotProps.data.id,\n                                parentId: props.parentId as string,\n                            }),\n                        } : {}\n                    ),\n                    ...slots,\n                },\n            },\n        });\n\n        return () => render();\n    },\n});\n</script>\n","<!--\n  - Copyright (c) 2026.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\nimport type { Client, ClientSecretRotatePayload } from '@authup/core-kit';\nimport {\n    ClientSecretMode,\n    ClientSecretRotateValidator,\n    getClientSecretMode,\n} from '@authup/core-kit';\nimport {\n    TranslatorTranslationActionKey,\n    TranslatorTranslationClientKey,\n    TranslatorTranslationFieldKey,\n    TranslatorTranslationNamespace,\n} from '@authup/i18n';\nimport { IFieldValidation } from '@ilingo/validup-vue';\nimport { useValidup } from '@validup/vue';\nimport { VCButton } from '@vuecs/button';\nimport { VCAlert } from '@vuecs/elements';\nimport type { FormOption } from '@vuecs/forms';\nimport { VCFormGroup, VCFormRadioGroup } from '@vuecs/forms';\nimport { VCIcon } from '@vuecs/icon';\nimport {\n    VCModal,\n    VCModalClose,\n    VCModalContent,\n    VCModalTitle,\n} from '@vuecs/overlays';\nimport type { PropType } from 'vue';\nimport {\n    computed,\n    defineComponent,\n    reactive,\n    ref,\n} from 'vue';\nimport { extractErrorContext, injectHTTPClient, useTranslations } from '../../../core';\nimport { ASecretInput } from '../../utility';\n\n/**\n * Rotates a client's secret through `POST /clients/:id/secret`, the one\n * writer of a secret on a client that is not stored plain. An empty secret\n * lets the server generate one; the mode defaults to the client's current\n * storage mode. The returned plaintext exists in that response only, so it\n * is rendered once, with a copy button, and dropped when the dialog closes.\n */\nexport default defineComponent({\n    name: 'AClientSecretRotate',\n    components: {\n        ASecretInput,\n        IFieldValidation,\n        VCAlert,\n        VCButton,\n        VCFormGroup,\n        VCFormRadioGroup,\n        VCIcon,\n        VCModal,\n        VCModalClose,\n        VCModalContent,\n        VCModalTitle,\n    },\n    props: {\n        entity: {\n            type: Object as PropType<Client>,\n            required: true,\n        },\n    },\n    emits: ['updated', 'failed'],\n    setup(props, { emit }) {\n        const apiClient = injectHTTPClient();\n\n        const translations = useTranslations([\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.SECRET_ROTATE },\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.SECRET_ROTATE_HINT },\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.SECRET_MODE },\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.SECRET_MODE_PLAIN },\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.SECRET_MODE_HASHED },\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.SECRET_MODE_ENCRYPTED },\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.SECRET_MODE_ENCRYPTED_HINT },\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.SECRET_SHOW_ONCE },\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.SECRET_COPY },\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.SECRET_COPIED },\n            { namespace: TranslatorTranslationNamespace.FIELD, key: TranslatorTranslationFieldKey.SECRET },\n            { namespace: TranslatorTranslationNamespace.ACTION, key: TranslatorTranslationActionKey.ABORT },\n            { namespace: TranslatorTranslationNamespace.ACTION, key: TranslatorTranslationActionKey.CLOSE },\n        ]);\n\n        const open = ref(false);\n        const busy = ref(false);\n        const error = ref<string | null>(null);\n        // the show-once plaintext; set only by a successful rotation\n        const secret = ref<string | null>(null);\n        const copied = ref(false);\n\n        const modeOptions = computed<FormOption[]>(() => [\n            { value: ClientSecretMode.PLAIN, label: translations.secretModePlain },\n            { value: ClientSecretMode.HASHED, label: translations.secretModeHashed },\n            { value: ClientSecretMode.ENCRYPTED, label: translations.secretModeEncrypted },\n        ]);\n\n        // The default must be an offered mode, or an untouched submit is\n        // refused; a row carrying a mode the dialog does not offer falls\n        // back to plain.\n        const defaultMode = () : `${ClientSecretMode}` => {\n            const mode = getClientSecretMode(props.entity);\n\n            return modeOptions.value.some((option) => option.value === mode) ?\n                mode :\n                ClientSecretMode.PLAIN;\n        };\n\n        const form = reactive<{ secret: string, mode: `${ClientSecretMode}` }>({\n            secret: '',\n            mode: defaultMode(),\n        });\n\n        const v = useValidup(new ClientSecretRotateValidator(), form);\n\n        const isEncryptedMode = computed(() => v.fields.mode.$model.value === ClientSecretMode.ENCRYPTED);\n\n        const setMode = (next: unknown) => {\n            v.fields.mode.$model.value = next as `${ClientSecretMode}`;\n        };\n\n        const reset = () => {\n            form.secret = '';\n            form.mode = defaultMode();\n            secret.value = null;\n            error.value = null;\n            copied.value = false;\n        };\n\n        // reset on both edges: opening re-reads the entity's current mode,\n        // closing drops the plaintext from state and DOM.\n        const setOpen = (value: boolean) => {\n            reset();\n            open.value = value;\n        };\n\n        const submit = async () => {\n            if (busy.value || v.$invalid.value) {\n                return;\n            }\n\n            busy.value = true;\n            error.value = null;\n            try {\n                const payload : ClientSecretRotatePayload = { mode: form.mode };\n                if (form.secret) {\n                    payload.secret = form.secret;\n                }\n\n                const response = await apiClient.client.rotateSecret(props.entity.id, payload);\n\n                secret.value = response.meta.secret;\n                emit('updated', response.data);\n            } catch (e) {\n                error.value = extractErrorContext(e).message ?? null;\n                emit('failed', e);\n            } finally {\n                busy.value = false;\n            }\n        };\n\n        const copy = async () => {\n            if (!secret.value) {\n                return;\n            }\n\n            if (typeof navigator === 'undefined' || !navigator.clipboard) {\n                return;\n            }\n\n            try {\n                await navigator.clipboard.writeText(secret.value);\n                copied.value = true;\n            } catch {\n                copied.value = false;\n            }\n        };\n\n        return {\n            translations,\n            v,\n            open,\n            busy,\n            error,\n            secret,\n            copied,\n            modeOptions,\n            isEncryptedMode,\n            setMode,\n            setOpen,\n            submit,\n            copy,\n        };\n    },\n});\n</script>\n<template>\n    <div>\n        <VCButton\n            color=\"primary\"\n            variant=\"outline\"\n            size=\"sm\"\n            :label=\"translations.secretRotate\"\n            @click=\"setOpen(true)\"\n        >\n            <template #leading>\n                <VCIcon name=\"fa6-solid:arrows-rotate\" />\n            </template>\n        </VCButton>\n\n        <VCModal\n            :open=\"open\"\n            @update:open=\"setOpen\"\n        >\n            <VCModalContent>\n                <div class=\"flex items-center justify-between gap-2 mb-3\">\n                    <VCModalTitle>{{ translations.secretRotate }}</VCModalTitle>\n                    <VCModalClose\n                        class=\"text-fg-muted hover:text-fg\"\n                        :aria-label=\"translations.close\"\n                    >\n                        <VCIcon name=\"fa6-solid:xmark\" />\n                    </VCModalClose>\n                </div>\n\n                <VCAlert\n                    v-if=\"error\"\n                    color=\"error\"\n                    variant=\"soft\"\n                    class=\"mb-3\"\n                >\n                    {{ error }}\n                </VCAlert>\n\n                <!-- show the returned plaintext once -->\n                <template v-if=\"secret !== null\">\n                    <VCAlert\n                        color=\"warning\"\n                        variant=\"soft\"\n                        class=\"mb-3\"\n                    >\n                        {{ translations.secretShowOnce }}\n                    </VCAlert>\n                    <code class=\"block font-mono break-all rounded-md bg-bg-muted p-3 mb-3\">{{ secret }}</code>\n                    <div class=\"flex gap-2\">\n                        <VCButton\n                            color=\"primary\"\n                            :label=\"copied ? translations.secretCopied : translations.secretCopy\"\n                            @click=\"copy\"\n                        >\n                            <template #leading>\n                                <VCIcon :name=\"copied ? 'fa6-solid:check' : 'fa6-solid:copy'\" />\n                            </template>\n                        </VCButton>\n                        <VCButton\n                            color=\"neutral\"\n                            :label=\"translations.close\"\n                            @click=\"setOpen(false)\"\n                        />\n                    </div>\n                </template>\n\n                <form\n                    v-else\n                    @submit.prevent=\"submit\"\n                >\n                    <IFieldValidation\n                        v-slot=\"{ value }\"\n                        :field=\"v.fields.secret\"\n                    >\n                        <VCFormGroup :validation=\"value\">\n                            <template #label>\n                                {{ translations.secret }}\n                            </template>\n                            <ASecretInput\n                                :model-value=\"v.fields.secret.$model.value ?? ''\"\n                                @update:model-value=\"(next: string) => { v.fields.secret.$model.value = next; }\"\n                            />\n                            <template #hint>\n                                {{ translations.secretRotateHint }}\n                            </template>\n                        </VCFormGroup>\n                    </IFieldValidation>\n                    <IFieldValidation\n                        v-slot=\"{ value }\"\n                        :field=\"v.fields.mode\"\n                    >\n                        <VCFormGroup :validation=\"value\">\n                            <template #label>\n                                {{ translations.secretMode }}\n                            </template>\n                            <VCFormRadioGroup\n                                :model-value=\"v.fields.mode.$model.value\"\n                                :options=\"modeOptions\"\n                                @update:model-value=\"setMode\"\n                            />\n                            <template\n                                v-if=\"isEncryptedMode\"\n                                #hint\n                            >\n                                {{ translations.secretModeEncryptedHint }}\n                            </template>\n                        </VCFormGroup>\n                    </IFieldValidation>\n                    <div class=\"flex gap-2\">\n                        <VCButton\n                            type=\"submit\"\n                            color=\"primary\"\n                            :disabled=\"busy || v.$invalid.value\"\n                            :busy=\"busy\"\n                            :label=\"translations.secretRotate\"\n                        />\n                        <VCButton\n                            color=\"neutral\"\n                            :disabled=\"busy\"\n                            :label=\"translations.abort\"\n                            @click=\"setOpen(false)\"\n                        />\n                    </div>\n                </form>\n            </VCModalContent>\n        </VCModal>\n    </div>\n</template>\n","<!--\n  - Copyright (c) 2026.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\nimport type { Client, ClientSecretRotatePayload } from '@authup/core-kit';\nimport {\n    ClientSecretMode,\n    ClientSecretRotateValidator,\n    getClientSecretMode,\n} from '@authup/core-kit';\nimport {\n    TranslatorTranslationActionKey,\n    TranslatorTranslationClientKey,\n    TranslatorTranslationFieldKey,\n    TranslatorTranslationNamespace,\n} from '@authup/i18n';\nimport { IFieldValidation } from '@ilingo/validup-vue';\nimport { useValidup } from '@validup/vue';\nimport { VCButton } from '@vuecs/button';\nimport { VCAlert } from '@vuecs/elements';\nimport type { FormOption } from '@vuecs/forms';\nimport { VCFormGroup, VCFormRadioGroup } from '@vuecs/forms';\nimport { VCIcon } from '@vuecs/icon';\nimport {\n    VCModal,\n    VCModalClose,\n    VCModalContent,\n    VCModalTitle,\n} from '@vuecs/overlays';\nimport type { PropType } from 'vue';\nimport {\n    computed,\n    defineComponent,\n    reactive,\n    ref,\n} from 'vue';\nimport { extractErrorContext, injectHTTPClient, useTranslations } from '../../../core';\nimport { ASecretInput } from '../../utility';\n\n/**\n * Rotates a client's secret through `POST /clients/:id/secret`, the one\n * writer of a secret on a client that is not stored plain. An empty secret\n * lets the server generate one; the mode defaults to the client's current\n * storage mode. The returned plaintext exists in that response only, so it\n * is rendered once, with a copy button, and dropped when the dialog closes.\n */\nexport default defineComponent({\n    name: 'AClientSecretRotate',\n    components: {\n        ASecretInput,\n        IFieldValidation,\n        VCAlert,\n        VCButton,\n        VCFormGroup,\n        VCFormRadioGroup,\n        VCIcon,\n        VCModal,\n        VCModalClose,\n        VCModalContent,\n        VCModalTitle,\n    },\n    props: {\n        entity: {\n            type: Object as PropType<Client>,\n            required: true,\n        },\n    },\n    emits: ['updated', 'failed'],\n    setup(props, { emit }) {\n        const apiClient = injectHTTPClient();\n\n        const translations = useTranslations([\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.SECRET_ROTATE },\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.SECRET_ROTATE_HINT },\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.SECRET_MODE },\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.SECRET_MODE_PLAIN },\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.SECRET_MODE_HASHED },\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.SECRET_MODE_ENCRYPTED },\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.SECRET_MODE_ENCRYPTED_HINT },\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.SECRET_SHOW_ONCE },\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.SECRET_COPY },\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.SECRET_COPIED },\n            { namespace: TranslatorTranslationNamespace.FIELD, key: TranslatorTranslationFieldKey.SECRET },\n            { namespace: TranslatorTranslationNamespace.ACTION, key: TranslatorTranslationActionKey.ABORT },\n            { namespace: TranslatorTranslationNamespace.ACTION, key: TranslatorTranslationActionKey.CLOSE },\n        ]);\n\n        const open = ref(false);\n        const busy = ref(false);\n        const error = ref<string | null>(null);\n        // the show-once plaintext; set only by a successful rotation\n        const secret = ref<string | null>(null);\n        const copied = ref(false);\n\n        const modeOptions = computed<FormOption[]>(() => [\n            { value: ClientSecretMode.PLAIN, label: translations.secretModePlain },\n            { value: ClientSecretMode.HASHED, label: translations.secretModeHashed },\n            { value: ClientSecretMode.ENCRYPTED, label: translations.secretModeEncrypted },\n        ]);\n\n        // The default must be an offered mode, or an untouched submit is\n        // refused; a row carrying a mode the dialog does not offer falls\n        // back to plain.\n        const defaultMode = () : `${ClientSecretMode}` => {\n            const mode = getClientSecretMode(props.entity);\n\n            return modeOptions.value.some((option) => option.value === mode) ?\n                mode :\n                ClientSecretMode.PLAIN;\n        };\n\n        const form = reactive<{ secret: string, mode: `${ClientSecretMode}` }>({\n            secret: '',\n            mode: defaultMode(),\n        });\n\n        const v = useValidup(new ClientSecretRotateValidator(), form);\n\n        const isEncryptedMode = computed(() => v.fields.mode.$model.value === ClientSecretMode.ENCRYPTED);\n\n        const setMode = (next: unknown) => {\n            v.fields.mode.$model.value = next as `${ClientSecretMode}`;\n        };\n\n        const reset = () => {\n            form.secret = '';\n            form.mode = defaultMode();\n            secret.value = null;\n            error.value = null;\n            copied.value = false;\n        };\n\n        // reset on both edges: opening re-reads the entity's current mode,\n        // closing drops the plaintext from state and DOM.\n        const setOpen = (value: boolean) => {\n            reset();\n            open.value = value;\n        };\n\n        const submit = async () => {\n            if (busy.value || v.$invalid.value) {\n                return;\n            }\n\n            busy.value = true;\n            error.value = null;\n            try {\n                const payload : ClientSecretRotatePayload = { mode: form.mode };\n                if (form.secret) {\n                    payload.secret = form.secret;\n                }\n\n                const response = await apiClient.client.rotateSecret(props.entity.id, payload);\n\n                secret.value = response.meta.secret;\n                emit('updated', response.data);\n            } catch (e) {\n                error.value = extractErrorContext(e).message ?? null;\n                emit('failed', e);\n            } finally {\n                busy.value = false;\n            }\n        };\n\n        const copy = async () => {\n            if (!secret.value) {\n                return;\n            }\n\n            if (typeof navigator === 'undefined' || !navigator.clipboard) {\n                return;\n            }\n\n            try {\n                await navigator.clipboard.writeText(secret.value);\n                copied.value = true;\n            } catch {\n                copied.value = false;\n            }\n        };\n\n        return {\n            translations,\n            v,\n            open,\n            busy,\n            error,\n            secret,\n            copied,\n            modeOptions,\n            isEncryptedMode,\n            setMode,\n            setOpen,\n            submit,\n            copy,\n        };\n    },\n});\n</script>\n<template>\n    <div>\n        <VCButton\n            color=\"primary\"\n            variant=\"outline\"\n            size=\"sm\"\n            :label=\"translations.secretRotate\"\n            @click=\"setOpen(true)\"\n        >\n            <template #leading>\n                <VCIcon name=\"fa6-solid:arrows-rotate\" />\n            </template>\n        </VCButton>\n\n        <VCModal\n            :open=\"open\"\n            @update:open=\"setOpen\"\n        >\n            <VCModalContent>\n                <div class=\"flex items-center justify-between gap-2 mb-3\">\n                    <VCModalTitle>{{ translations.secretRotate }}</VCModalTitle>\n                    <VCModalClose\n                        class=\"text-fg-muted hover:text-fg\"\n                        :aria-label=\"translations.close\"\n                    >\n                        <VCIcon name=\"fa6-solid:xmark\" />\n                    </VCModalClose>\n                </div>\n\n                <VCAlert\n                    v-if=\"error\"\n                    color=\"error\"\n                    variant=\"soft\"\n                    class=\"mb-3\"\n                >\n                    {{ error }}\n                </VCAlert>\n\n                <!-- show the returned plaintext once -->\n                <template v-if=\"secret !== null\">\n                    <VCAlert\n                        color=\"warning\"\n                        variant=\"soft\"\n                        class=\"mb-3\"\n                    >\n                        {{ translations.secretShowOnce }}\n                    </VCAlert>\n                    <code class=\"block font-mono break-all rounded-md bg-bg-muted p-3 mb-3\">{{ secret }}</code>\n                    <div class=\"flex gap-2\">\n                        <VCButton\n                            color=\"primary\"\n                            :label=\"copied ? translations.secretCopied : translations.secretCopy\"\n                            @click=\"copy\"\n                        >\n                            <template #leading>\n                                <VCIcon :name=\"copied ? 'fa6-solid:check' : 'fa6-solid:copy'\" />\n                            </template>\n                        </VCButton>\n                        <VCButton\n                            color=\"neutral\"\n                            :label=\"translations.close\"\n                            @click=\"setOpen(false)\"\n                        />\n                    </div>\n                </template>\n\n                <form\n                    v-else\n                    @submit.prevent=\"submit\"\n                >\n                    <IFieldValidation\n                        v-slot=\"{ value }\"\n                        :field=\"v.fields.secret\"\n                    >\n                        <VCFormGroup :validation=\"value\">\n                            <template #label>\n                                {{ translations.secret }}\n                            </template>\n                            <ASecretInput\n                                :model-value=\"v.fields.secret.$model.value ?? ''\"\n                                @update:model-value=\"(next: string) => { v.fields.secret.$model.value = next; }\"\n                            />\n                            <template #hint>\n                                {{ translations.secretRotateHint }}\n                            </template>\n                        </VCFormGroup>\n                    </IFieldValidation>\n                    <IFieldValidation\n                        v-slot=\"{ value }\"\n                        :field=\"v.fields.mode\"\n                    >\n                        <VCFormGroup :validation=\"value\">\n                            <template #label>\n                                {{ translations.secretMode }}\n                            </template>\n                            <VCFormRadioGroup\n                                :model-value=\"v.fields.mode.$model.value\"\n                                :options=\"modeOptions\"\n                                @update:model-value=\"setMode\"\n                            />\n                            <template\n                                v-if=\"isEncryptedMode\"\n                                #hint\n                            >\n                                {{ translations.secretModeEncryptedHint }}\n                            </template>\n                        </VCFormGroup>\n                    </IFieldValidation>\n                    <div class=\"flex gap-2\">\n                        <VCButton\n                            type=\"submit\"\n                            color=\"primary\"\n                            :disabled=\"busy || v.$invalid.value\"\n                            :busy=\"busy\"\n                            :label=\"translations.secretRotate\"\n                        />\n                        <VCButton\n                            color=\"neutral\"\n                            :disabled=\"busy\"\n                            :label=\"translations.abort\"\n                            @click=\"setOpen(false)\"\n                        />\n                    </div>\n                </form>\n            </VCModalContent>\n        </VCModal>\n    </div>\n</template>\n","<!--\n  - Copyright (c) 2026.\n  -  Author Peter Placzek (tada5hi)\n  -  For the full copyright and license information,\n  -  view the LICENSE file that was distributed with this source code.\n  -->\n\n<script lang=\"ts\">\nimport {\n    type PropType,\n    computed,\n    defineComponent,\n    onMounted,\n    reactive,\n    useId,\n    watch,\n} from 'vue';\nimport { useValidup } from '@validup/vue';\nimport { \n    TranslatorTranslationClientKey, \n    TranslatorTranslationEntityKey, \n    TranslatorTranslationFieldKey, \n    TranslatorTranslationNamespace, \n} from '@authup/i18n';\nimport { \n    assignFormProperties, \n    injectStore, \n    storeToRefs, \n    useTranslations, \n    useTranslationsForNamespace, \n} from '../../../core';\nimport {\n    type Client,\n    ClientAuthMethod,\n    ClientSecretMode,\n    ClientTokenBindingMethod,\n    ClientValidator,\n    EntityType,\n    type Policy,\n    buildClientCertificateURI,\n    getClientSecretMode,\n} from '@authup/core-kit';\nimport { defineQuery } from '@rapiq/core';\nimport { OAuth2TokenGrant } from '@authup/specs';\nimport type { FormOption } from '@vuecs/forms';\nimport { VCFormCheckbox, VCFormCheckboxGroup } from '@vuecs/forms';\nimport {\n    ValidatorGroup,\n    generateName,\n    generateSecret,\n} from '@authup/kit';\nimport { ARealmPicker } from '../realm';\nimport APolicyPicker from '../policy/APolicyPicker.vue';\nimport AClientSecretRotate from './AClientSecretRotate.vue';\nimport {\n    AFormInputList,\n    AFormSubmit,\n    ANameInput,\n    ASecretInput,\n    defineEntityManager,\n    defineEntityVEmitOptions,\n} from '../../utility';\nimport { useIsEditing, useUpdatedAt } from '../../../composables';\nimport { IFieldValidation } from '@ilingo/validup-vue';\n\nexport default defineComponent({\n    components: {\n        AClientSecretRotate,\n        AFormSubmit,\n        ANameInput,\n        APolicyPicker,\n        ASecretInput,\n        ARealmPicker,\n        AFormInputList,\n        VCFormCheckbox,\n        VCFormCheckboxGroup,\n\n        IFieldValidation,\n    },\n    props: {\n        name: {\n            type: String,\n            default: undefined,\n        },\n        entity: {\n            type: Object as PropType<Client>,\n            default: undefined,\n        },\n        realmId: {\n            type: String,\n            default: undefined,\n        },\n    },\n    emits: defineEntityVEmitOptions<Client>(),\n    setup(props, ctx) {\n        const nameSeed = useId();\n        const form = reactive({\n            active: true,\n            name: '',\n            displayName: '',\n            description: '',\n            realmId: '',\n            redirectUri: '',\n            postLogoutRedirectUri: '',\n            backchannelLogoutUri: null as string | null,\n            baseUrl: null as string | null,\n            authMethod: ClientAuthMethod.SECRET as `${ClientAuthMethod}`,\n            tokenBindingMethod: ClientTokenBindingMethod.NONE as `${ClientTokenBindingMethod}`,\n            secret: '',\n            secretHashed: false,\n            grantTypes: null as string | null,\n            accessPolicyId: null as string | null,\n        });\n\n        const manager = defineEntityManager({\n            type: EntityType.CLIENT,\n            setup: ctx,\n            props,\n        });\n\n        const isEditing = useIsEditing(manager.data);\n\n        // Shared `ClientValidator` from `@authup/core-kit`. Reactive\n        // `group` flips between CREATE / UPDATE so the validator's\n        // per-mount optional-ness matches the form's mode.\n        const v = useValidup(\n            new ClientValidator(),\n            form,\n            { group: computed(() => (isEditing.value ? ValidatorGroup.UPDATE : ValidatorGroup.CREATE)) },\n        );\n\n        const store = injectStore();\n        const storeRefs = storeToRefs(store);\n\n        const updatedAt = useUpdatedAt(() => props.entity);\n\n        const isNameFixed = computed(() => !!props.name && props.name.length > 0);\n        const realmId = computed(() => (manager.data.value ?\n            manager.data.value.realmId :\n            storeRefs.realmId.value));\n\n        // The storage mode is fixed at creation and changes only through the\n        // rotation endpoint, so an update may write the secret of a PLAIN\n        // client alone; every other secret client rotates through the dialog.\n        const isSecretEditable = computed(() => !isEditing.value || (\n            !!manager.data.value &&\n            getClientSecretMode(manager.data.value) === ClientSecretMode.PLAIN\n        ));\n        const isSecretRotatable = computed(() => isEditing.value &&\n            manager.data.value?.authMethod === ClientAuthMethod.SECRET);\n\n        function initForm() {\n            if (props.name) {\n                form.name = props.name;\n            }\n\n            assignFormProperties(form, manager.data.value, { fields: v.fields });\n\n            if (form.name.length === 0) {\n                form.name = generateName(nameSeed);\n            }\n\n            form.realmId = realmId.value ?? '';\n        }\n\n        // Secrets must stay unpredictable, so they can't be seeded from a\n        // hydration-stable value the way names are. Generate the initial secret\n        // client-side only to keep full entropy without an SSR hydration mismatch.\n        onMounted(() => {\n            if (form.authMethod === ClientAuthMethod.SECRET && form.secret.length === 0) {\n                form.secret = generateSecret();\n            }\n        });\n\n        const isSecretAuthentication = computed(() => form.authMethod === ClientAuthMethod.SECRET);\n        const isTLSAuthentication = computed(() => form.authMethod === ClientAuthMethod.TLS);\n        watch(isSecretAuthentication, (val, oldValue) => {\n            if (val === oldValue) return;\n\n            if (val) {\n                form.secret = manager.data.value?.secret || generateSecret();\n            } else {\n                form.secret = '';\n                form.secretHashed = false;\n            }\n        });\n\n        watch(\n            updatedAt,\n            (val, oldVal) => {\n                if (!val || val === oldVal) {\n                    return;\n                }\n\n                manager.data.value = props.entity;\n                initForm();\n            },\n        );\n\n        initForm();\n\n        // An update never carries the mode, and carries the secret only when\n        // the client is plain and the field changed: the server answers 400\n        // to a secret on a hashed client, and an unchanged echo of a plain\n        // one would only re-save what is already stored.\n        const buildPayload = () : Partial<Client> => {\n            const payload : Partial<Client> = { ...form };\n            if (!isEditing.value) {\n                return payload;\n            }\n\n            delete payload.secretHashed;\n\n            const changed = form.secret !== (manager.data.value?.secret ?? '');\n            if (!changed || !isSecretEditable.value) {\n                delete payload.secret;\n            }\n\n            return payload;\n        };\n\n        const submit = async () => {\n            if (v.$invalid.value) {\n                return;\n            }\n\n            await manager.createOrUpdate(buildPayload());\n\n            assignFormProperties(form, manager.data.value, { fields: v.fields });\n        };\n\n        // the dialog answers with the rotated entity: adopt it the way an\n        // update does, so the parent refreshes and the form re-hydrates.\n        const handleSecretRotated = (entity: Client) => {\n            manager.data.value = entity;\n            manager.updated(entity);\n            initForm();\n        };\n\n        const translationsClient = useTranslationsForNamespace(\n            TranslatorTranslationNamespace.CLIENT,\n            [\n                { key: TranslatorTranslationClientKey.NAME_HINT },\n                { key: TranslatorTranslationClientKey.DESCRIPTION_HINT },\n                { key: TranslatorTranslationClientKey.REDIRECT_URI_HINT },\n                { key: TranslatorTranslationClientKey.POST_LOGOUT_REDIRECT_URI_HINT },\n                { key: TranslatorTranslationClientKey.BASE_URL_HINT },\n                { key: TranslatorTranslationClientKey.BACKCHANNEL_LOGOUT_URI_HINT },\n                { key: TranslatorTranslationClientKey.AUTH_METHOD },\n                { key: TranslatorTranslationClientKey.AUTH_METHOD_NONE },\n                { key: TranslatorTranslationClientKey.AUTH_METHOD_SECRET },\n                { key: TranslatorTranslationClientKey.AUTH_METHOD_TLS },\n                { key: TranslatorTranslationClientKey.TOKEN_BINDING_METHOD },\n                { key: TranslatorTranslationClientKey.TOKEN_BINDING_METHOD_NONE },\n                { key: TranslatorTranslationClientKey.TOKEN_BINDING_METHOD_TLS },\n                { key: TranslatorTranslationClientKey.CLIENT_CERTIFICATE_URI },\n                { key: TranslatorTranslationClientKey.CLIENT_CERTIFICATE_URI_HINT },\n                { key: TranslatorTranslationClientKey.IS_ACTIVE },\n                { key: TranslatorTranslationClientKey.HASH_SECRET },\n                { key: TranslatorTranslationClientKey.SECRET_HASHED_HINT },\n                { key: TranslatorTranslationClientKey.GRANT_TYPES_HINT },\n                { key: TranslatorTranslationClientKey.CLIENT_ACCESS_POLICY_HINT },\n            ],\n        );\n\n        const translationsDefault = useTranslations(\n            [\n                {\n                    namespace: TranslatorTranslationNamespace.FIELD,\n                    key: TranslatorTranslationFieldKey.NAME,\n                },\n                {\n                    namespace: TranslatorTranslationNamespace.FIELD, \n                    key: TranslatorTranslationFieldKey.DISPLAY_NAME, \n                },\n                {\n                    namespace: TranslatorTranslationNamespace.FIELD, \n                    key: TranslatorTranslationFieldKey.DESCRIPTION, \n                },\n                {\n                    namespace: TranslatorTranslationNamespace.ENTITY, \n                    key: TranslatorTranslationEntityKey.REALM, \n                    count: 1, \n                },\n                {\n                    namespace: TranslatorTranslationNamespace.FIELD,\n                    key: TranslatorTranslationFieldKey.REDIRECT_URIS,\n                },\n                {\n                    namespace: TranslatorTranslationNamespace.FIELD,\n                    key: TranslatorTranslationFieldKey.POST_LOGOUT_REDIRECT_URIS,\n                },\n                {\n                    namespace: TranslatorTranslationNamespace.FIELD,\n                    key: TranslatorTranslationFieldKey.BASE_URL,\n                },\n                {\n                    namespace: TranslatorTranslationNamespace.FIELD,\n                    key: TranslatorTranslationFieldKey.BACKCHANNEL_LOGOUT_URI,\n                },\n                {\n                    namespace: TranslatorTranslationNamespace.FIELD,\n                    key: TranslatorTranslationFieldKey.SECRET,\n                },\n                {\n                    namespace: TranslatorTranslationNamespace.FIELD,\n                    key: TranslatorTranslationFieldKey.GRANT_TYPES,\n                },\n                {\n                    namespace: TranslatorTranslationNamespace.FIELD,\n                    key: TranslatorTranslationFieldKey.ACCESS_POLICY,\n                },\n            ],\n        );\n\n        const redirectUris = computed(() => {\n            const value = v.fields.redirectUri.$model.value as string | undefined;\n            return value ? value.split(',') : [];\n        });\n\n        const postLogoutRedirectUris = computed(() => {\n            const value = v.fields.postLogoutRedirectUri.$model.value as string | undefined;\n            return value ? value.split(',') : [];\n        });\n\n        // `grantTypes` is a space/comma-delimited allowlist column; `null` (no\n        // selection) means allow-all, so an emptied selection must clear the\n        // column rather than persist an empty string.\n        const grantTypeSelection = computed<string[]>(() => {\n            const value = v.fields.grantTypes.$model.value as string | null | undefined;\n            return value ? value.split(/[\\s,]+/).filter(Boolean) : [];\n        });\n\n        // Unknown tokens (a grant authup does not implement yet) stay rendered\n        // as checked options, so opening the form never silently strips them.\n        const grantTypeOptions = computed<string[]>(() => [\n            ...new Set<string>([\n                ...Object.values(OAuth2TokenGrant),\n                ...grantTypeSelection.value,\n            ]),\n        ]);\n\n        const setGrantTypes = (input: unknown[]) => {\n            const values = (input as string[]).filter(Boolean);\n            v.fields.grantTypes.$model.value = values.length > 0 ? values.join(' ') : null;\n        };\n\n        const policyQuery = computed(() => defineQuery<Policy>({ filters: { realmId: [...(form.realmId ? [form.realmId] : []), null] } }));\n\n        const authMethodOptions = computed<FormOption[]>(() => [\n            { value: ClientAuthMethod.NONE, label: translationsClient.authMethodNone },\n            { value: ClientAuthMethod.SECRET, label: translationsClient.authMethodSecret },\n            { value: ClientAuthMethod.TLS, label: translationsClient.authMethodTls },\n        ]);\n        const tokenBindingMethodOptions = computed<FormOption[]>(() => [\n            { value: ClientTokenBindingMethod.NONE, label: translationsClient.tokenBindingMethodNone },\n            { value: ClientTokenBindingMethod.TLS, label: translationsClient.tokenBindingMethodTls },\n        ]);\n        const clientCertificateURI = computed(() => (manager.data.value ?\n            buildClientCertificateURI(manager.data.value.id) :\n            ''));\n\n        return {\n            translationsDefault,\n            translationsClient,\n            v,\n            data: manager.data,\n            isNameFixed,\n            isBusy: manager.busy.value,\n            isEditing,\n            isSecretAuthentication,\n            isTLSAuthentication,\n            isSecretEditable,\n            isSecretRotatable,\n            handleSecretRotated,\n            authMethodOptions,\n            tokenBindingMethodOptions,\n            clientCertificateURI,\n            redirectUris,\n            postLogoutRedirectUris,\n            grantTypeSelection,\n            grantTypeOptions,\n            setGrantTypes,\n            policyQuery,\n            submit,\n        };\n    },\n});\n</script>\n<template>\n    <div class=\"flex flex-wrap -mx-2\">\n        <div class=\"flex-1 basis-0 px-2\">\n            <template v-if=\"data\">\n                <VCFormGroup>\n                    <template #label>\n                        ID\n                    </template>\n                    <VCFormInput\n                        :model-value=\"data.id\"\n                        :disabled=\"true\"\n                    />\n                </VCFormGroup>\n            </template>\n\n            <IFieldValidation\n                v-slot=\"{ value }\"\n                :field=\"v.fields.name\"\n            >\n                <VCFormGroup :validation=\"value\">\n                    <template #label>\n                        {{ translationsDefault.name }}\n                    </template>\n                    <ANameInput\n                        v-model=\"v.fields.name.$model.value\"\n                        :disabled=\"isNameFixed\"\n                    />\n                    <template #hint>\n                        {{ translationsClient.nameHint }}\n                    </template>\n                </VCFormGroup>\n            </IFieldValidation>\n            <IFieldValidation\n                v-slot=\"{ value }\"\n                :field=\"v.fields.displayName\"\n            >\n                <VCFormGroup :validation=\"value\">\n                    <template #label>\n                        {{ translationsDefault.displayName }}\n                    </template>\n                    <VCFormInput\n                        :model-value=\"v.fields.displayName.$model.value ?? ''\"\n                        :disabled=\"isNameFixed\"\n                        @update:model-value=\"(next: string) => { v.fields.displayName.$model.value = next; }\"\n                    />\n                </VCFormGroup>\n            </IFieldValidation>\n            <IFieldValidation\n                v-slot=\"{ value }\"\n                :field=\"v.fields.authMethod\"\n            >\n                <VCFormGroup :validation=\"value\">\n                    <template #label>\n                        {{ translationsClient.authMethod }}\n                    </template>\n                    <VCFormSelect\n                        v-model=\"v.fields.authMethod.$model.value\"\n                        :options=\"authMethodOptions\"\n                    />\n                </VCFormGroup>\n            </IFieldValidation>\n            <IFieldValidation\n                v-slot=\"{ value }\"\n                :field=\"v.fields.tokenBindingMethod\"\n            >\n                <VCFormGroup :validation=\"value\">\n                    <template #label>\n                        {{ translationsClient.tokenBindingMethod }}\n                    </template>\n                    <VCFormSelect\n                        v-model=\"v.fields.tokenBindingMethod.$model.value\"\n                        :options=\"tokenBindingMethodOptions\"\n                    />\n                </VCFormGroup>\n            </IFieldValidation>\n            <template v-if=\"isTLSAuthentication && clientCertificateURI\">\n                <VCFormGroup>\n                    <template #label>\n                        {{ translationsClient.clientCertificateUri }}\n                    </template>\n                    <VCFormInput\n                        :model-value=\"clientCertificateURI\"\n                        :disabled=\"true\"\n                    />\n                    <template #hint>\n                        {{ translationsClient.clientCertificateUriHint }}\n                    </template>\n                </VCFormGroup>\n            </template>\n            <IFieldValidation\n                v-if=\"isSecretAuthentication && isSecretEditable\"\n                v-slot=\"{ value }\"\n                :field=\"v.fields.secret\"\n            >\n                <VCFormGroup :validation=\"value\">\n                    <template #label>\n                        {{ translationsDefault.secret }}\n                    </template>\n                    <ASecretInput\n                        :model-value=\"v.fields.secret.$model.value ?? ''\"\n                        @update:model-value=\"(next: string) => { v.fields.secret.$model.value = next; }\"\n                    />\n                </VCFormGroup>\n            </IFieldValidation>\n            <template v-if=\"isSecretAuthentication && isSecretRotatable && data\">\n                <VCFormGroup>\n                    <template\n                        v-if=\"!isSecretEditable\"\n                        #label\n                    >\n                        {{ translationsDefault.secret }}\n                    </template>\n                    <AClientSecretRotate\n                        :entity=\"data\"\n                        @updated=\"handleSecretRotated\"\n                    />\n                    <template\n                        v-if=\"!isSecretEditable\"\n                        #hint\n                    >\n                        {{ translationsClient.secretHashedHint }}\n                    </template>\n                </VCFormGroup>\n            </template>\n            <div class=\"flex flex-wrap -mx-2\">\n                <div\n                    v-if=\"isSecretAuthentication && !isEditing\"\n                    class=\"flex-1 basis-0 px-2\"\n                >\n                    <IFieldValidation\n                        v-slot=\"{ value }\"\n                        :field=\"v.fields.secretHashed\"\n                    >\n                        <VCFormGroup :validation=\"value\">\n                            <VCFormSwitch\n                                v-model=\"v.fields.secretHashed.$model.value\"\n                                :label=\"true\"\n                                :label-content=\"translationsClient.hashSecret\"\n                            />\n                        </VCFormGroup>\n                    </IFieldValidation>\n                </div>\n                <div class=\"flex-1 basis-0 px-2\">\n                    <IFieldValidation\n                        v-slot=\"{ value }\"\n                        :field=\"v.fields.active\"\n                    >\n                        <VCFormGroup :validation=\"value\">\n                            <VCFormSwitch\n                                v-model=\"v.fields.active.$model.value\"\n                                :label=\"true\"\n                                :label-content=\"translationsClient.isActive\"\n                            />\n                        </VCFormGroup>\n                    </IFieldValidation>\n                </div>\n            </div>\n\n            <template v-if=\"!realmId && !isEditing\">\n                <IFieldValidation\n                    v-slot=\"{ value }\"\n                    :field=\"v.fields.realmId\"\n                >\n                    <VCFormGroup :validation=\"value\">\n                        <template #label>\n                            {{ translationsDefault.realm }}\n                        </template>\n                        <template #default>\n                            <ARealmPicker\n                                :value=\"v.fields.realmId.$model.value\"\n                                @change=\"(input: string[]) => {\n                                    v.fields.realmId.$model.value = input.length > 0 ? input[0] ?? '' : '';\n                                }\"\n                            />\n                        </template>\n                    </VCFormGroup>\n                </IFieldValidation>\n            </template>\n        </div>\n        <div class=\"flex-1 basis-0 px-2\">\n            <!--\n                `AFormInputList`'s root carries no bottom margin (it is also\n                nested INSIDE a VCFormGroup elsewhere, where a margin would\n                double up), so a standalone use followed by a sibling has to\n                match the `mb-3` the theme puts on stacked form groups.\n            -->\n            <AFormInputList\n                class=\"mb-3\"\n                :names=\"redirectUris\"\n                @changed=\"(value) => {\n                    if (value.length === 0) {\n                        v.fields.redirectUri.$model.value = '';\n                        return;\n                    }\n                    v.fields.redirectUri.$model.value = value.join(',');\n                }\"\n            >\n                <template #label>\n                    {{ translationsDefault.redirectUris }}\n                </template>\n                <template #hint>\n                    {{ translationsClient.redirectURIHint }}\n                </template>\n            </AFormInputList>\n            <AFormInputList\n                class=\"mb-3\"\n                :names=\"postLogoutRedirectUris\"\n                @changed=\"(value) => {\n                    if (value.length === 0) {\n                        v.fields.postLogoutRedirectUri.$model.value = null;\n                        return;\n                    }\n                    v.fields.postLogoutRedirectUri.$model.value = value.join(',');\n                }\"\n            >\n                <template #label>\n                    {{ translationsDefault.postLogoutRedirectUris }}\n                </template>\n                <template #hint>\n                    {{ translationsClient.postLogoutRedirectURIHint }}\n                </template>\n            </AFormInputList>\n            <IFieldValidation\n                v-slot=\"{ value }\"\n                :field=\"v.fields.baseUrl\"\n            >\n                <VCFormGroup :validation=\"value\">\n                    <template #label>\n                        {{ translationsDefault.baseUrl }}\n                    </template>\n                    <VCFormInput\n                        :model-value=\"v.fields.baseUrl.$model.value ?? ''\"\n                        @update:model-value=\"(next: string) => { v.fields.baseUrl.$model.value = next; }\"\n                    />\n                    <template #hint>\n                        {{ translationsClient.baseUrlHint }}\n                    </template>\n                </VCFormGroup>\n            </IFieldValidation>\n            <IFieldValidation\n                v-slot=\"{ value }\"\n                :field=\"v.fields.backchannelLogoutUri\"\n            >\n                <VCFormGroup :validation=\"value\">\n                    <template #label>\n                        {{ translationsDefault.backchannelLogoutUri }}\n                    </template>\n                    <VCFormInput\n                        :model-value=\"v.fields.backchannelLogoutUri.$model.value ?? ''\"\n                        @update:model-value=\"(next: string) => { v.fields.backchannelLogoutUri.$model.value = next; }\"\n                    />\n                    <template #hint>\n                        {{ translationsClient.backchannelLogoutURIHint }}\n                    </template>\n                </VCFormGroup>\n            </IFieldValidation>\n            <IFieldValidation\n                v-slot=\"{ value }\"\n                :field=\"v.fields.grantTypes\"\n            >\n                <VCFormGroup :validation=\"value\">\n                    <template #label>\n                        {{ translationsDefault.grantTypes }}\n                    </template>\n                    <VCFormCheckboxGroup\n                        :model-value=\"grantTypeSelection\"\n                        @update:model-value=\"setGrantTypes\"\n                    >\n                        <VCFormCheckbox\n                            v-for=\"grantType in grantTypeOptions\"\n                            :key=\"grantType\"\n                            :value=\"grantType\"\n                            :label=\"true\"\n                            :label-content=\"grantType\"\n                        />\n                    </VCFormCheckboxGroup>\n                    <template #hint>\n                        {{ translationsClient.grantTypesHint }}\n                    </template>\n                </VCFormGroup>\n            </IFieldValidation>\n            <IFieldValidation\n                v-slot=\"{ value }\"\n                :field=\"v.fields.description\"\n            >\n                <VCFormGroup :validation=\"value\">\n                    <template #label>\n                        {{ translationsDefault.description }}\n                    </template>\n                    <VCFormTextarea\n                        :model-value=\"v.fields.description.$model.value ?? ''\"\n                        rows=\"7\"\n                        @update:model-value=\"(next: string) => { v.fields.description.$model.value = next; }\"\n                    />\n                    <template #hint>\n                        {{ translationsClient.descriptionHint }}\n                    </template>\n                </VCFormGroup>\n            </IFieldValidation>\n            <IFieldValidation\n                v-slot=\"{ value }\"\n                :field=\"v.fields.accessPolicyId\"\n            >\n                <VCFormGroup :validation=\"value\">\n                    <template #label>\n                        {{ translationsDefault.accessPolicy }}\n                    </template>\n                    <template #default>\n                        <APolicyPicker\n                            :value=\"v.fields.accessPolicyId.$model.value\"\n                            :query=\"policyQuery\"\n                            @change=\"(input: string[]) => {\n                                v.fields.accessPolicyId.$model.value = input.length > 0 ? input[0] ?? null : null;\n                            }\"\n                        />\n                    </template>\n                    <template #hint>\n                        {{ translationsClient.clientAccessPolicyHint }}\n                    </template>\n                </VCFormGroup>\n            </IFieldValidation>\n            <div>\n                <AFormSubmit\n                    :is-busy=\"isBusy\"\n                    :is-editing=\"isEditing\"\n                    :is-invalid=\"v.$invalid.value\"\n                    @submit=\"submit\"\n                />\n            </div>\n        </div>\n    </div>\n</template>\n","<!--\n  - Copyright (c) 2026.\n  -  Author Peter Placzek (tada5hi)\n  -  For the full copyright and license information,\n  -  view the LICENSE file that was distributed with this source code.\n  -->\n\n<script lang=\"ts\">\nimport {\n    type PropType,\n    computed,\n    defineComponent,\n    onMounted,\n    reactive,\n    useId,\n    watch,\n} from 'vue';\nimport { useValidup } from '@validup/vue';\nimport { \n    TranslatorTranslationClientKey, \n    TranslatorTranslationEntityKey, \n    TranslatorTranslationFieldKey, \n    TranslatorTranslationNamespace, \n} from '@authup/i18n';\nimport { \n    assignFormProperties, \n    injectStore, \n    storeToRefs, \n    useTranslations, \n    useTranslationsForNamespace, \n} from '../../../core';\nimport {\n    type Client,\n    ClientAuthMethod,\n    ClientSecretMode,\n    ClientTokenBindingMethod,\n    ClientValidator,\n    EntityType,\n    type Policy,\n    buildClientCertificateURI,\n    getClientSecretMode,\n} from '@authup/core-kit';\nimport { defineQuery } from '@rapiq/core';\nimport { OAuth2TokenGrant } from '@authup/specs';\nimport type { FormOption } from '@vuecs/forms';\nimport { VCFormCheckbox, VCFormCheckboxGroup } from '@vuecs/forms';\nimport {\n    ValidatorGroup,\n    generateName,\n    generateSecret,\n} from '@authup/kit';\nimport { ARealmPicker } from '../realm';\nimport APolicyPicker from '../policy/APolicyPicker.vue';\nimport AClientSecretRotate from './AClientSecretRotate.vue';\nimport {\n    AFormInputList,\n    AFormSubmit,\n    ANameInput,\n    ASecretInput,\n    defineEntityManager,\n    defineEntityVEmitOptions,\n} from '../../utility';\nimport { useIsEditing, useUpdatedAt } from '../../../composables';\nimport { IFieldValidation } from '@ilingo/validup-vue';\n\nexport default defineComponent({\n    components: {\n        AClientSecretRotate,\n        AFormSubmit,\n        ANameInput,\n        APolicyPicker,\n        ASecretInput,\n        ARealmPicker,\n        AFormInputList,\n        VCFormCheckbox,\n        VCFormCheckboxGroup,\n\n        IFieldValidation,\n    },\n    props: {\n        name: {\n            type: String,\n            default: undefined,\n        },\n        entity: {\n            type: Object as PropType<Client>,\n            default: undefined,\n        },\n        realmId: {\n            type: String,\n            default: undefined,\n        },\n    },\n    emits: defineEntityVEmitOptions<Client>(),\n    setup(props, ctx) {\n        const nameSeed = useId();\n        const form = reactive({\n            active: true,\n            name: '',\n            displayName: '',\n            description: '',\n            realmId: '',\n            redirectUri: '',\n            postLogoutRedirectUri: '',\n            backchannelLogoutUri: null as string | null,\n            baseUrl: null as string | null,\n            authMethod: ClientAuthMethod.SECRET as `${ClientAuthMethod}`,\n            tokenBindingMethod: ClientTokenBindingMethod.NONE as `${ClientTokenBindingMethod}`,\n            secret: '',\n            secretHashed: false,\n            grantTypes: null as string | null,\n            accessPolicyId: null as string | null,\n        });\n\n        const manager = defineEntityManager({\n            type: EntityType.CLIENT,\n            setup: ctx,\n            props,\n        });\n\n        const isEditing = useIsEditing(manager.data);\n\n        // Shared `ClientValidator` from `@authup/core-kit`. Reactive\n        // `group` flips between CREATE / UPDATE so the validator's\n        // per-mount optional-ness matches the form's mode.\n        const v = useValidup(\n            new ClientValidator(),\n            form,\n            { group: computed(() => (isEditing.value ? ValidatorGroup.UPDATE : ValidatorGroup.CREATE)) },\n        );\n\n        const store = injectStore();\n        const storeRefs = storeToRefs(store);\n\n        const updatedAt = useUpdatedAt(() => props.entity);\n\n        const isNameFixed = computed(() => !!props.name && props.name.length > 0);\n        const realmId = computed(() => (manager.data.value ?\n            manager.data.value.realmId :\n            storeRefs.realmId.value));\n\n        // The storage mode is fixed at creation and changes only through the\n        // rotation endpoint, so an update may write the secret of a PLAIN\n        // client alone; every other secret client rotates through the dialog.\n        const isSecretEditable = computed(() => !isEditing.value || (\n            !!manager.data.value &&\n            getClientSecretMode(manager.data.value) === ClientSecretMode.PLAIN\n        ));\n        const isSecretRotatable = computed(() => isEditing.value &&\n            manager.data.value?.authMethod === ClientAuthMethod.SECRET);\n\n        function initForm() {\n            if (props.name) {\n                form.name = props.name;\n            }\n\n            assignFormProperties(form, manager.data.value, { fields: v.fields });\n\n            if (form.name.length === 0) {\n                form.name = generateName(nameSeed);\n            }\n\n            form.realmId = realmId.value ?? '';\n        }\n\n        // Secrets must stay unpredictable, so they can't be seeded from a\n        // hydration-stable value the way names are. Generate the initial secret\n        // client-side only to keep full entropy without an SSR hydration mismatch.\n        onMounted(() => {\n            if (form.authMethod === ClientAuthMethod.SECRET && form.secret.length === 0) {\n                form.secret = generateSecret();\n            }\n        });\n\n        const isSecretAuthentication = computed(() => form.authMethod === ClientAuthMethod.SECRET);\n        const isTLSAuthentication = computed(() => form.authMethod === ClientAuthMethod.TLS);\n        watch(isSecretAuthentication, (val, oldValue) => {\n            if (val === oldValue) return;\n\n            if (val) {\n                form.secret = manager.data.value?.secret || generateSecret();\n            } else {\n                form.secret = '';\n                form.secretHashed = false;\n            }\n        });\n\n        watch(\n            updatedAt,\n            (val, oldVal) => {\n                if (!val || val === oldVal) {\n                    return;\n                }\n\n                manager.data.value = props.entity;\n                initForm();\n            },\n        );\n\n        initForm();\n\n        // An update never carries the mode, and carries the secret only when\n        // the client is plain and the field changed: the server answers 400\n        // to a secret on a hashed client, and an unchanged echo of a plain\n        // one would only re-save what is already stored.\n        const buildPayload = () : Partial<Client> => {\n            const payload : Partial<Client> = { ...form };\n            if (!isEditing.value) {\n                return payload;\n            }\n\n            delete payload.secretHashed;\n\n            const changed = form.secret !== (manager.data.value?.secret ?? '');\n            if (!changed || !isSecretEditable.value) {\n                delete payload.secret;\n            }\n\n            return payload;\n        };\n\n        const submit = async () => {\n            if (v.$invalid.value) {\n                return;\n            }\n\n            await manager.createOrUpdate(buildPayload());\n\n            assignFormProperties(form, manager.data.value, { fields: v.fields });\n        };\n\n        // the dialog answers with the rotated entity: adopt it the way an\n        // update does, so the parent refreshes and the form re-hydrates.\n        const handleSecretRotated = (entity: Client) => {\n            manager.data.value = entity;\n            manager.updated(entity);\n            initForm();\n        };\n\n        const translationsClient = useTranslationsForNamespace(\n            TranslatorTranslationNamespace.CLIENT,\n            [\n                { key: TranslatorTranslationClientKey.NAME_HINT },\n                { key: TranslatorTranslationClientKey.DESCRIPTION_HINT },\n                { key: TranslatorTranslationClientKey.REDIRECT_URI_HINT },\n                { key: TranslatorTranslationClientKey.POST_LOGOUT_REDIRECT_URI_HINT },\n                { key: TranslatorTranslationClientKey.BASE_URL_HINT },\n                { key: TranslatorTranslationClientKey.BACKCHANNEL_LOGOUT_URI_HINT },\n                { key: TranslatorTranslationClientKey.AUTH_METHOD },\n                { key: TranslatorTranslationClientKey.AUTH_METHOD_NONE },\n                { key: TranslatorTranslationClientKey.AUTH_METHOD_SECRET },\n                { key: TranslatorTranslationClientKey.AUTH_METHOD_TLS },\n                { key: TranslatorTranslationClientKey.TOKEN_BINDING_METHOD },\n                { key: TranslatorTranslationClientKey.TOKEN_BINDING_METHOD_NONE },\n                { key: TranslatorTranslationClientKey.TOKEN_BINDING_METHOD_TLS },\n                { key: TranslatorTranslationClientKey.CLIENT_CERTIFICATE_URI },\n                { key: TranslatorTranslationClientKey.CLIENT_CERTIFICATE_URI_HINT },\n                { key: TranslatorTranslationClientKey.IS_ACTIVE },\n                { key: TranslatorTranslationClientKey.HASH_SECRET },\n                { key: TranslatorTranslationClientKey.SECRET_HASHED_HINT },\n                { key: TranslatorTranslationClientKey.GRANT_TYPES_HINT },\n                { key: TranslatorTranslationClientKey.CLIENT_ACCESS_POLICY_HINT },\n            ],\n        );\n\n        const translationsDefault = useTranslations(\n            [\n                {\n                    namespace: TranslatorTranslationNamespace.FIELD,\n                    key: TranslatorTranslationFieldKey.NAME,\n                },\n                {\n                    namespace: TranslatorTranslationNamespace.FIELD, \n                    key: TranslatorTranslationFieldKey.DISPLAY_NAME, \n                },\n                {\n                    namespace: TranslatorTranslationNamespace.FIELD, \n                    key: TranslatorTranslationFieldKey.DESCRIPTION, \n                },\n                {\n                    namespace: TranslatorTranslationNamespace.ENTITY, \n                    key: TranslatorTranslationEntityKey.REALM, \n                    count: 1, \n                },\n                {\n                    namespace: TranslatorTranslationNamespace.FIELD,\n                    key: TranslatorTranslationFieldKey.REDIRECT_URIS,\n                },\n                {\n                    namespace: TranslatorTranslationNamespace.FIELD,\n                    key: TranslatorTranslationFieldKey.POST_LOGOUT_REDIRECT_URIS,\n                },\n                {\n                    namespace: TranslatorTranslationNamespace.FIELD,\n                    key: TranslatorTranslationFieldKey.BASE_URL,\n                },\n                {\n                    namespace: TranslatorTranslationNamespace.FIELD,\n                    key: TranslatorTranslationFieldKey.BACKCHANNEL_LOGOUT_URI,\n                },\n                {\n                    namespace: TranslatorTranslationNamespace.FIELD,\n                    key: TranslatorTranslationFieldKey.SECRET,\n                },\n                {\n                    namespace: TranslatorTranslationNamespace.FIELD,\n                    key: TranslatorTranslationFieldKey.GRANT_TYPES,\n                },\n                {\n                    namespace: TranslatorTranslationNamespace.FIELD,\n                    key: TranslatorTranslationFieldKey.ACCESS_POLICY,\n                },\n            ],\n        );\n\n        const redirectUris = computed(() => {\n            const value = v.fields.redirectUri.$model.value as string | undefined;\n            return value ? value.split(',') : [];\n        });\n\n        const postLogoutRedirectUris = computed(() => {\n            const value = v.fields.postLogoutRedirectUri.$model.value as string | undefined;\n            return value ? value.split(',') : [];\n        });\n\n        // `grantTypes` is a space/comma-delimited allowlist column; `null` (no\n        // selection) means allow-all, so an emptied selection must clear the\n        // column rather than persist an empty string.\n        const grantTypeSelection = computed<string[]>(() => {\n            const value = v.fields.grantTypes.$model.value as string | null | undefined;\n            return value ? value.split(/[\\s,]+/).filter(Boolean) : [];\n        });\n\n        // Unknown tokens (a grant authup does not implement yet) stay rendered\n        // as checked options, so opening the form never silently strips them.\n        const grantTypeOptions = computed<string[]>(() => [\n            ...new Set<string>([\n                ...Object.values(OAuth2TokenGrant),\n                ...grantTypeSelection.value,\n            ]),\n        ]);\n\n        const setGrantTypes = (input: unknown[]) => {\n            const values = (input as string[]).filter(Boolean);\n            v.fields.grantTypes.$model.value = values.length > 0 ? values.join(' ') : null;\n        };\n\n        const policyQuery = computed(() => defineQuery<Policy>({ filters: { realmId: [...(form.realmId ? [form.realmId] : []), null] } }));\n\n        const authMethodOptions = computed<FormOption[]>(() => [\n            { value: ClientAuthMethod.NONE, label: translationsClient.authMethodNone },\n            { value: ClientAuthMethod.SECRET, label: translationsClient.authMethodSecret },\n            { value: ClientAuthMethod.TLS, label: translationsClient.authMethodTls },\n        ]);\n        const tokenBindingMethodOptions = computed<FormOption[]>(() => [\n            { value: ClientTokenBindingMethod.NONE, label: translationsClient.tokenBindingMethodNone },\n            { value: ClientTokenBindingMethod.TLS, label: translationsClient.tokenBindingMethodTls },\n        ]);\n        const clientCertificateURI = computed(() => (manager.data.value ?\n            buildClientCertificateURI(manager.data.value.id) :\n            ''));\n\n        return {\n            translationsDefault,\n            translationsClient,\n            v,\n            data: manager.data,\n            isNameFixed,\n            isBusy: manager.busy.value,\n            isEditing,\n            isSecretAuthentication,\n            isTLSAuthentication,\n            isSecretEditable,\n            isSecretRotatable,\n            handleSecretRotated,\n            authMethodOptions,\n            tokenBindingMethodOptions,\n            clientCertificateURI,\n            redirectUris,\n            postLogoutRedirectUris,\n            grantTypeSelection,\n            grantTypeOptions,\n            setGrantTypes,\n            policyQuery,\n            submit,\n        };\n    },\n});\n</script>\n<template>\n    <div class=\"flex flex-wrap -mx-2\">\n        <div class=\"flex-1 basis-0 px-2\">\n            <template v-if=\"data\">\n                <VCFormGroup>\n                    <template #label>\n                        ID\n                    </template>\n                    <VCFormInput\n                        :model-value=\"data.id\"\n                        :disabled=\"true\"\n                    />\n                </VCFormGroup>\n            </template>\n\n            <IFieldValidation\n                v-slot=\"{ value }\"\n                :field=\"v.fields.name\"\n            >\n                <VCFormGroup :validation=\"value\">\n                    <template #label>\n                        {{ translationsDefault.name }}\n                    </template>\n                    <ANameInput\n                        v-model=\"v.fields.name.$model.value\"\n                        :disabled=\"isNameFixed\"\n                    />\n                    <template #hint>\n                        {{ translationsClient.nameHint }}\n                    </template>\n                </VCFormGroup>\n            </IFieldValidation>\n            <IFieldValidation\n                v-slot=\"{ value }\"\n                :field=\"v.fields.displayName\"\n            >\n                <VCFormGroup :validation=\"value\">\n                    <template #label>\n                        {{ translationsDefault.displayName }}\n                    </template>\n                    <VCFormInput\n                        :model-value=\"v.fields.displayName.$model.value ?? ''\"\n                        :disabled=\"isNameFixed\"\n                        @update:model-value=\"(next: string) => { v.fields.displayName.$model.value = next; }\"\n                    />\n                </VCFormGroup>\n            </IFieldValidation>\n            <IFieldValidation\n                v-slot=\"{ value }\"\n                :field=\"v.fields.authMethod\"\n            >\n                <VCFormGroup :validation=\"value\">\n                    <template #label>\n                        {{ translationsClient.authMethod }}\n                    </template>\n                    <VCFormSelect\n                        v-model=\"v.fields.authMethod.$model.value\"\n                        :options=\"authMethodOptions\"\n                    />\n                </VCFormGroup>\n            </IFieldValidation>\n            <IFieldValidation\n                v-slot=\"{ value }\"\n                :field=\"v.fields.tokenBindingMethod\"\n            >\n                <VCFormGroup :validation=\"value\">\n                    <template #label>\n                        {{ translationsClient.tokenBindingMethod }}\n                    </template>\n                    <VCFormSelect\n                        v-model=\"v.fields.tokenBindingMethod.$model.value\"\n                        :options=\"tokenBindingMethodOptions\"\n                    />\n                </VCFormGroup>\n            </IFieldValidation>\n            <template v-if=\"isTLSAuthentication && clientCertificateURI\">\n                <VCFormGroup>\n                    <template #label>\n                        {{ translationsClient.clientCertificateUri }}\n                    </template>\n                    <VCFormInput\n                        :model-value=\"clientCertificateURI\"\n                        :disabled=\"true\"\n                    />\n                    <template #hint>\n                        {{ translationsClient.clientCertificateUriHint }}\n                    </template>\n                </VCFormGroup>\n            </template>\n            <IFieldValidation\n                v-if=\"isSecretAuthentication && isSecretEditable\"\n                v-slot=\"{ value }\"\n                :field=\"v.fields.secret\"\n            >\n                <VCFormGroup :validation=\"value\">\n                    <template #label>\n                        {{ translationsDefault.secret }}\n                    </template>\n                    <ASecretInput\n                        :model-value=\"v.fields.secret.$model.value ?? ''\"\n                        @update:model-value=\"(next: string) => { v.fields.secret.$model.value = next; }\"\n                    />\n                </VCFormGroup>\n            </IFieldValidation>\n            <template v-if=\"isSecretAuthentication && isSecretRotatable && data\">\n                <VCFormGroup>\n                    <template\n                        v-if=\"!isSecretEditable\"\n                        #label\n                    >\n                        {{ translationsDefault.secret }}\n                    </template>\n                    <AClientSecretRotate\n                        :entity=\"data\"\n                        @updated=\"handleSecretRotated\"\n                    />\n                    <template\n                        v-if=\"!isSecretEditable\"\n                        #hint\n                    >\n                        {{ translationsClient.secretHashedHint }}\n                    </template>\n                </VCFormGroup>\n            </template>\n            <div class=\"flex flex-wrap -mx-2\">\n                <div\n                    v-if=\"isSecretAuthentication && !isEditing\"\n                    class=\"flex-1 basis-0 px-2\"\n                >\n                    <IFieldValidation\n                        v-slot=\"{ value }\"\n                        :field=\"v.fields.secretHashed\"\n                    >\n                        <VCFormGroup :validation=\"value\">\n                            <VCFormSwitch\n                                v-model=\"v.fields.secretHashed.$model.value\"\n                                :label=\"true\"\n                                :label-content=\"translationsClient.hashSecret\"\n                            />\n                        </VCFormGroup>\n                    </IFieldValidation>\n                </div>\n                <div class=\"flex-1 basis-0 px-2\">\n                    <IFieldValidation\n                        v-slot=\"{ value }\"\n                        :field=\"v.fields.active\"\n                    >\n                        <VCFormGroup :validation=\"value\">\n                            <VCFormSwitch\n                                v-model=\"v.fields.active.$model.value\"\n                                :label=\"true\"\n                                :label-content=\"translationsClient.isActive\"\n                            />\n                        </VCFormGroup>\n                    </IFieldValidation>\n                </div>\n            </div>\n\n            <template v-if=\"!realmId && !isEditing\">\n                <IFieldValidation\n                    v-slot=\"{ value }\"\n                    :field=\"v.fields.realmId\"\n                >\n                    <VCFormGroup :validation=\"value\">\n                        <template #label>\n                            {{ translationsDefault.realm }}\n                        </template>\n                        <template #default>\n                            <ARealmPicker\n                                :value=\"v.fields.realmId.$model.value\"\n                                @change=\"(input: string[]) => {\n                                    v.fields.realmId.$model.value = input.length > 0 ? input[0] ?? '' : '';\n                                }\"\n                            />\n                        </template>\n                    </VCFormGroup>\n                </IFieldValidation>\n            </template>\n        </div>\n        <div class=\"flex-1 basis-0 px-2\">\n            <!--\n                `AFormInputList`'s root carries no bottom margin (it is also\n                nested INSIDE a VCFormGroup elsewhere, where a margin would\n                double up), so a standalone use followed by a sibling has to\n                match the `mb-3` the theme puts on stacked form groups.\n            -->\n            <AFormInputList\n                class=\"mb-3\"\n                :names=\"redirectUris\"\n                @changed=\"(value) => {\n                    if (value.length === 0) {\n                        v.fields.redirectUri.$model.value = '';\n                        return;\n                    }\n                    v.fields.redirectUri.$model.value = value.join(',');\n                }\"\n            >\n                <template #label>\n                    {{ translationsDefault.redirectUris }}\n                </template>\n                <template #hint>\n                    {{ translationsClient.redirectURIHint }}\n                </template>\n            </AFormInputList>\n            <AFormInputList\n                class=\"mb-3\"\n                :names=\"postLogoutRedirectUris\"\n                @changed=\"(value) => {\n                    if (value.length === 0) {\n                        v.fields.postLogoutRedirectUri.$model.value = null;\n                        return;\n                    }\n                    v.fields.postLogoutRedirectUri.$model.value = value.join(',');\n                }\"\n            >\n                <template #label>\n                    {{ translationsDefault.postLogoutRedirectUris }}\n                </template>\n                <template #hint>\n                    {{ translationsClient.postLogoutRedirectURIHint }}\n                </template>\n            </AFormInputList>\n            <IFieldValidation\n                v-slot=\"{ value }\"\n                :field=\"v.fields.baseUrl\"\n            >\n                <VCFormGroup :validation=\"value\">\n                    <template #label>\n                        {{ translationsDefault.baseUrl }}\n                    </template>\n                    <VCFormInput\n                        :model-value=\"v.fields.baseUrl.$model.value ?? ''\"\n                        @update:model-value=\"(next: string) => { v.fields.baseUrl.$model.value = next; }\"\n                    />\n                    <template #hint>\n                        {{ translationsClient.baseUrlHint }}\n                    </template>\n                </VCFormGroup>\n            </IFieldValidation>\n            <IFieldValidation\n                v-slot=\"{ value }\"\n                :field=\"v.fields.backchannelLogoutUri\"\n            >\n                <VCFormGroup :validation=\"value\">\n                    <template #label>\n                        {{ translationsDefault.backchannelLogoutUri }}\n                    </template>\n                    <VCFormInput\n                        :model-value=\"v.fields.backchannelLogoutUri.$model.value ?? ''\"\n                        @update:model-value=\"(next: string) => { v.fields.backchannelLogoutUri.$model.value = next; }\"\n                    />\n                    <template #hint>\n                        {{ translationsClient.backchannelLogoutURIHint }}\n                    </template>\n                </VCFormGroup>\n            </IFieldValidation>\n            <IFieldValidation\n                v-slot=\"{ value }\"\n                :field=\"v.fields.grantTypes\"\n            >\n                <VCFormGroup :validation=\"value\">\n                    <template #label>\n                        {{ translationsDefault.grantTypes }}\n                    </template>\n                    <VCFormCheckboxGroup\n                        :model-value=\"grantTypeSelection\"\n                        @update:model-value=\"setGrantTypes\"\n                    >\n                        <VCFormCheckbox\n                            v-for=\"grantType in grantTypeOptions\"\n                            :key=\"grantType\"\n                            :value=\"grantType\"\n                            :label=\"true\"\n                            :label-content=\"grantType\"\n                        />\n                    </VCFormCheckboxGroup>\n                    <template #hint>\n                        {{ translationsClient.grantTypesHint }}\n                    </template>\n                </VCFormGroup>\n            </IFieldValidation>\n            <IFieldValidation\n                v-slot=\"{ value }\"\n                :field=\"v.fields.description\"\n            >\n                <VCFormGroup :validation=\"value\">\n                    <template #label>\n                        {{ translationsDefault.description }}\n                    </template>\n                    <VCFormTextarea\n                        :model-value=\"v.fields.description.$model.value ?? ''\"\n                        rows=\"7\"\n                        @update:model-value=\"(next: string) => { v.fields.description.$model.value = next; }\"\n                    />\n                    <template #hint>\n                        {{ translationsClient.descriptionHint }}\n                    </template>\n                </VCFormGroup>\n            </IFieldValidation>\n            <IFieldValidation\n                v-slot=\"{ value }\"\n                :field=\"v.fields.accessPolicyId\"\n            >\n                <VCFormGroup :validation=\"value\">\n                    <template #label>\n                        {{ translationsDefault.accessPolicy }}\n                    </template>\n                    <template #default>\n                        <APolicyPicker\n                            :value=\"v.fields.accessPolicyId.$model.value\"\n                            :query=\"policyQuery\"\n                            @change=\"(input: string[]) => {\n                                v.fields.accessPolicyId.$model.value = input.length > 0 ? input[0] ?? null : null;\n                            }\"\n                        />\n                    </template>\n                    <template #hint>\n                        {{ translationsClient.clientAccessPolicyHint }}\n                    </template>\n                </VCFormGroup>\n            </IFieldValidation>\n            <div>\n                <AFormSubmit\n                    :is-busy=\"isBusy\"\n                    :is-editing=\"isEditing\"\n                    :is-invalid=\"v.$invalid.value\"\n                    @submit=\"submit\"\n                />\n            </div>\n        </div>\n    </div>\n</template>\n","/*\n * Copyright (c) 2022.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { EntityType } from '@authup/core-kit';\nimport type { SlotsType } from 'vue';\nimport { defineComponent } from 'vue';\nimport type { Client } from '@authup/core-kit';\nimport type { EntityCollectionVSlots } from '../../utility';\nimport {\n    defineEntityCollectionManager,\n    defineEntityCollectionVEmitOptions,\n    defineEntityCollectionVProps,\n} from '../../utility';\nimport { TranslatorTranslationEntityKey, TranslatorTranslationNamespace, TranslatorTranslationVuecsKey } from '@authup/i18n';\nimport { useTranslation } from '../../../core';\n\nexport const AClients = defineComponent({\n    props: defineEntityCollectionVProps<Client>(),\n    emits: defineEntityCollectionVEmitOptions<Client>(),\n    slots: Object as SlotsType<EntityCollectionVSlots<Client>>,\n    setup(props, ctx) {\n        const { render } = defineEntityCollectionManager({\n            type: `${EntityType.CLIENT}`,\n            props,\n            setup: ctx,\n        });\n\n        const translationName = useTranslation({\n            namespace: TranslatorTranslationNamespace.ENTITY,\n            key: TranslatorTranslationEntityKey.CLIENT,\n            count: 2,\n        });\n\n        const translation = useTranslation({\n            namespace: TranslatorTranslationNamespace.VUECS,\n            key: TranslatorTranslationVuecsKey.NO_MORE,\n            data: { name: translationName },\n        });\n\n        return () => render({ noMore: { content: translation.value } });\n    },\n});\n\nexport default AClients;\n","/*\n * Copyright (c) 2025.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport type { Client } from '@authup/core-kit';\nimport type { SlotsType } from 'vue';\nimport { defineComponent } from 'vue';\nimport {\n    defineEntityPicker,\n    defineEntityPickerVEmitOptions,\n    defineEntityPickerVProps,\n} from '../../utility/entity/picker/module';\nimport type { EntityPickerVSlots } from '../../utility/entity/picker/types';\nimport { AClients } from './AClients';\n\nexport const AClientPicker = defineComponent({\n    props: defineEntityPickerVProps<Client>(),\n    emits: defineEntityPickerVEmitOptions<Client>(),\n    slots: Object as SlotsType<EntityPickerVSlots<Client>>,\n    setup(props, setup) {\n        const { render } = defineEntityPicker({\n            component: AClients,\n            props,\n            setup,\n        });\n\n        return () => render();\n    },\n});\n","/*\n * Copyright (c) 2023.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { EntityType } from '@authup/core-kit';\nimport type { Permission } from '@authup/core-kit';\nimport type { SlotsType } from 'vue';\nimport { defineComponent } from 'vue';\nimport type { EntityVSlots } from '../../utility';\nimport {\n    defineEntityManager,\n    defineEntityVEmitOptions,\n    defineEntityVProps,\n} from '../../utility';\n\nexport const APermission = defineComponent({\n    props: defineEntityVProps<Permission>(),\n    emits: defineEntityVEmitOptions<Permission>(),\n    slots: Object as SlotsType<EntityVSlots<Permission>>,\n    async setup(props, setup) {\n        const manager = defineEntityManager({\n            type: `${EntityType.PERMISSION}`,\n            setup,\n            props,\n        });\n\n        try {\n            await manager.resolveOrFail();\n\n            return () => manager.render();\n        } catch (e) {\n            return () => manager.renderError(e);\n        }\n    },\n});\n","/*\n * Copyright (c) 2024.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport type { PermissionEvaluationOptions } from '@authup/access';\nimport { definePolicyData } from '@authup/access';\nimport { \n    SlotName, \n    createPermissionCheckerReactiveFn, \n    hasNormalizedSlot, \n    normalizeSlot,  \n} from '../../../core';\nimport type { PropType } from 'vue';\nimport { defineComponent } from 'vue';\n\nexport const APermissionCheck = defineComponent({\n    props: {\n        name: {\n            type: [String, Array] as PropType<string | string[]>,\n            required: true,\n        },\n        input: { type: Object as PropType<Record<string, any>> },\n        options: { type: Object as PropType<PermissionEvaluationOptions> },\n    },\n    setup(props, { slots }) {\n        const fn = createPermissionCheckerReactiveFn();\n\n        // single setup-time call (the checker registers lifecycle hooks and\n        // returns a Ref<boolean>) — wrapping it in computed() would truth-test\n        // the inner Ref object and render the slot unconditionally. The getter\n        // keeps the context reactive: a name/input/options prop change\n        // re-triggers the evaluation.\n        const isPermitted = fn(() => ({\n            name: props.name,\n            data: definePolicyData(props.input),\n            options: props.options,\n        }));\n\n        return () => {\n            if (\n                isPermitted.value &&\n                hasNormalizedSlot(SlotName.DEFAULT, slots)\n            ) {\n                return normalizeSlot(SlotName.DEFAULT, {}, slots);\n            }\n\n            return [];\n        };\n    },\n});\n","<!--\n  - Copyright (c) 2022-2026.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\nimport type { Permission } from '@authup/core-kit';\nimport { EntityType, PermissionValidator } from '@authup/core-kit';\nimport { DecisionStrategy, ValidatorGroup, generateName } from '@authup/kit';\nimport { useValidup } from '@validup/vue';\nimport {\n    TranslatorTranslationClientKey,\n    TranslatorTranslationEntityKey,\n    TranslatorTranslationFieldKey,\n    TranslatorTranslationNamespace,\n} from '@authup/i18n';\nimport {\n    assignFormProperties,\n    injectStore,\n    storeToRefs,\n    useTranslations,\n    useTranslationsForNamespace,\n} from '../../../core';\nimport type { PropType } from 'vue';\nimport {\n    computed,\n    defineComponent,\n    reactive,\n    ref,\n    useId,\n    watch,\n} from 'vue';\nimport type { FormOption } from '@vuecs/forms';\nimport {\n    VCFormGroup,\n    VCFormInput,\n    VCFormSelect,\n    VCFormTextarea,\n} from '@vuecs/forms';\nimport { useIsEditing, useUpdatedAt } from '../../../composables';\nimport {\n    AFormSubmit,\n    ANameInput,\n    defineEntityManager,\n    defineEntityVEmitOptions,\n} from '../../utility';\nimport { ARealmPicker } from '../realm';\nimport { VCAlert } from '@vuecs/elements';\nimport { IFieldValidation } from '@ilingo/validup-vue';\n\nexport default defineComponent({\n    components: {\n        ANameInput,\n        ARealmPicker,\n        AFormSubmit,\n        VCFormGroup,\n        VCFormInput,\n        VCFormSelect,\n        VCFormTextarea,\n        VCAlert,\n\n        IFieldValidation,\n    },\n    props: { entity: { type: Object as PropType<Permission> } },\n    emits: defineEntityVEmitOptions<Permission>(),\n    setup(props, ctx) {\n        const busy = ref(false);\n        const nameSeed = useId();\n\n        const form = reactive({\n            name: '',\n            displayName: '',\n            description: '',\n            decisionStrategy: '',\n            realmId: '',\n        });\n\n        const decisionStrategyOptions: FormOption[] = Object.values(DecisionStrategy)\n            .map((value) => ({ label: value, value }));\n\n        const manager = defineEntityManager({\n            type: EntityType.PERMISSION,\n            setup: ctx,\n            props,\n        });\n\n        const isEditing = useIsEditing(manager.data);\n\n        // `decisionStrategy: ''` is the form's \"no selection\" sentinel\n        // (submitted as `null`); excess-property checks reject it against the\n        // entity's DecisionStrategy union, so we narrow to Partial<Permission>.\n        const v = useValidup(\n            new PermissionValidator(),\n            form as Partial<Permission>,\n            { group: computed(() => (isEditing.value ? ValidatorGroup.UPDATE : ValidatorGroup.CREATE)) },\n        );\n\n        const store = injectStore();\n        const storeRefs = storeToRefs(store);\n\n        const realmId = computed(() => {\n            if (!storeRefs.realmIsRoot.value) {\n                return storeRefs.realmId.value;\n            }\n\n            return manager.data.value ?\n                manager.data.value.realmId :\n                null;\n        });\n\n        const updatedAt = useUpdatedAt(() => props.entity);\n        const isBuiltIn = computed(() => !!(manager.data.value && manager.data.value.builtIn));\n\n        function initForm() {\n            assignFormProperties(form, manager.data.value, { fields: v.fields });\n\n            if (form.name.length === 0) {\n                form.name = generateName(nameSeed);\n            }\n\n            if (realmId.value) {\n                form.realmId = realmId.value;\n            }\n        }\n\n        watch(updatedAt, (val, oldVal) => {\n            if (!val || val === oldVal) {\n                return;\n            }\n\n            manager.data.value = props.entity;\n            initForm();\n        });\n\n        initForm();\n\n        const submit = async () => {\n            if (busy.value || v.$invalid.value) {\n                return;\n            }\n\n            busy.value = true;\n            try {\n                const data: Record<string, unknown> = {\n                    ...form,\n                    decisionStrategy: form.decisionStrategy || null,\n                };\n\n                await manager.createOrUpdate(data);\n            } finally {\n                busy.value = false;\n            }\n        };\n\n        const translationsDefault = useTranslations(\n            [\n                {\n                    namespace: TranslatorTranslationNamespace.FIELD,\n                    key: TranslatorTranslationFieldKey.NAME,\n                },\n                {\n                    namespace: TranslatorTranslationNamespace.FIELD,\n                    key: TranslatorTranslationFieldKey.DISPLAY_NAME,\n                },\n                {\n                    namespace: TranslatorTranslationNamespace.FIELD,\n                    key: TranslatorTranslationFieldKey.DESCRIPTION,\n                },\n                {\n                    namespace: TranslatorTranslationNamespace.FIELD,\n                    key: TranslatorTranslationFieldKey.DECISION_STRATEGY,\n                },\n                {\n                    namespace: TranslatorTranslationNamespace.ENTITY,\n                    key: TranslatorTranslationEntityKey.REALM,\n                    count: 1,\n                },\n            ],\n        );\n\n        const translationsClient = useTranslationsForNamespace(\n            TranslatorTranslationNamespace.CLIENT,\n            [\n                { key: TranslatorTranslationClientKey.OPTION_NONE_UNANIMOUS },\n                { key: TranslatorTranslationClientKey.DECISION_STRATEGY_HINT_AFFIRMATIVE },\n                { key: TranslatorTranslationClientKey.DECISION_STRATEGY_HINT_CONSENSUS },\n                { key: TranslatorTranslationClientKey.DECISION_STRATEGY_HINT_UNANIMOUS },\n                { key: TranslatorTranslationClientKey.DECISION_STRATEGY_HINT_DEFAULT },\n            ],\n        );\n\n        const decisionStrategyHintComputed = computed(() => {\n            switch (form.decisionStrategy) {\n                case DecisionStrategy.AFFIRMATIVE:\n                    return translationsClient.decisionStrategyHintAffirmative;\n                case DecisionStrategy.CONSENSUS:\n                    return translationsClient.decisionStrategyHintConsensus;\n                case DecisionStrategy.UNANIMOUS:\n                    return translationsClient.decisionStrategyHintUnanimous;\n                default:\n                    return translationsClient.decisionStrategyHintDefault;\n            }\n        });\n\n        return {\n            busy,\n            v,\n            isEditing,\n            isBuiltIn,\n            realmId,\n            decisionStrategyOptions,\n            decisionStrategyHint: decisionStrategyHintComputed,\n            translationsDefault,\n            translationsClient,\n            submit,\n        };\n    },\n});\n\n</script>\n\n<template>\n    <form @submit.prevent=\"submit\">\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"v.fields.name\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translationsDefault.name }}\n                </template>\n                <ANameInput\n                    v-model=\"v.fields.name.$model.value\"\n                    :disabled=\"isBuiltIn\"\n                />\n            </VCFormGroup>\n        </IFieldValidation>\n\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"v.fields.displayName\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translationsDefault.displayName }}\n                </template>\n                <VCFormInput\n                    :model-value=\"v.fields.displayName.$model.value ?? ''\"\n                    @update:model-value=\"(next: string) => { v.fields.displayName.$model.value = next; }\"\n                />\n            </VCFormGroup>\n        </IFieldValidation>\n\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"v.fields.description\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translationsDefault.description }}\n                </template>\n                <VCFormTextarea\n                    :model-value=\"v.fields.description.$model.value ?? ''\"\n                    :rows=\"4\"\n                    @update:model-value=\"(next: string) => { v.fields.description.$model.value = next; }\"\n                />\n            </VCFormGroup>\n        </IFieldValidation>\n\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"v.fields.decisionStrategy\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translationsDefault.decisionStrategy }}\n                </template>\n                <VCFormSelect\n                    v-model=\"v.fields.decisionStrategy.$model.value\"\n                    :options=\"decisionStrategyOptions\"\n                    :placeholder=\"translationsClient.optionNoneUnanimous\"\n                />\n                <VCAlert\n                    color=\"info\"\n                    variant=\"soft\"\n                    size=\"sm\"\n                    class=\"mt-1 mb-0\"\n                >\n                    {{ decisionStrategyHint }}\n                </VCAlert>\n            </VCFormGroup>\n        </IFieldValidation>\n\n        <template v-if=\"!realmId && !isEditing\">\n            <IFieldValidation\n                v-slot=\"{ value }\"\n                :field=\"v.fields.realmId\"\n            >\n                <VCFormGroup :validation=\"value\">\n                    <template #label>\n                        {{ translationsDefault.realm }}\n                    </template>\n                    <ARealmPicker\n                        :value=\"v.fields.realmId.$model.value\"\n                        :multiple=\"false\"\n                        @change=\"(input: string[]) => {\n                            v.fields.realmId.$model.value = input.length > 0 ? input[0] ?? '' : '';\n                        }\"\n                    />\n                </VCFormGroup>\n            </IFieldValidation>\n        </template>\n\n        <AFormSubmit\n            :is-busy=\"busy\"\n            :is-editing=\"isEditing\"\n            :is-invalid=\"v.$invalid.value\"\n            @submit=\"submit\"\n        />\n    </form>\n</template>\n","<!--\n  - Copyright (c) 2022-2026.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\nimport type { Permission } from '@authup/core-kit';\nimport { EntityType, PermissionValidator } from '@authup/core-kit';\nimport { DecisionStrategy, ValidatorGroup, generateName } from '@authup/kit';\nimport { useValidup } from '@validup/vue';\nimport {\n    TranslatorTranslationClientKey,\n    TranslatorTranslationEntityKey,\n    TranslatorTranslationFieldKey,\n    TranslatorTranslationNamespace,\n} from '@authup/i18n';\nimport {\n    assignFormProperties,\n    injectStore,\n    storeToRefs,\n    useTranslations,\n    useTranslationsForNamespace,\n} from '../../../core';\nimport type { PropType } from 'vue';\nimport {\n    computed,\n    defineComponent,\n    reactive,\n    ref,\n    useId,\n    watch,\n} from 'vue';\nimport type { FormOption } from '@vuecs/forms';\nimport {\n    VCFormGroup,\n    VCFormInput,\n    VCFormSelect,\n    VCFormTextarea,\n} from '@vuecs/forms';\nimport { useIsEditing, useUpdatedAt } from '../../../composables';\nimport {\n    AFormSubmit,\n    ANameInput,\n    defineEntityManager,\n    defineEntityVEmitOptions,\n} from '../../utility';\nimport { ARealmPicker } from '../realm';\nimport { VCAlert } from '@vuecs/elements';\nimport { IFieldValidation } from '@ilingo/validup-vue';\n\nexport default defineComponent({\n    components: {\n        ANameInput,\n        ARealmPicker,\n        AFormSubmit,\n        VCFormGroup,\n        VCFormInput,\n        VCFormSelect,\n        VCFormTextarea,\n        VCAlert,\n\n        IFieldValidation,\n    },\n    props: { entity: { type: Object as PropType<Permission> } },\n    emits: defineEntityVEmitOptions<Permission>(),\n    setup(props, ctx) {\n        const busy = ref(false);\n        const nameSeed = useId();\n\n        const form = reactive({\n            name: '',\n            displayName: '',\n            description: '',\n            decisionStrategy: '',\n            realmId: '',\n        });\n\n        const decisionStrategyOptions: FormOption[] = Object.values(DecisionStrategy)\n            .map((value) => ({ label: value, value }));\n\n        const manager = defineEntityManager({\n            type: EntityType.PERMISSION,\n            setup: ctx,\n            props,\n        });\n\n        const isEditing = useIsEditing(manager.data);\n\n        // `decisionStrategy: ''` is the form's \"no selection\" sentinel\n        // (submitted as `null`); excess-property checks reject it against the\n        // entity's DecisionStrategy union, so we narrow to Partial<Permission>.\n        const v = useValidup(\n            new PermissionValidator(),\n            form as Partial<Permission>,\n            { group: computed(() => (isEditing.value ? ValidatorGroup.UPDATE : ValidatorGroup.CREATE)) },\n        );\n\n        const store = injectStore();\n        const storeRefs = storeToRefs(store);\n\n        const realmId = computed(() => {\n            if (!storeRefs.realmIsRoot.value) {\n                return storeRefs.realmId.value;\n            }\n\n            return manager.data.value ?\n                manager.data.value.realmId :\n                null;\n        });\n\n        const updatedAt = useUpdatedAt(() => props.entity);\n        const isBuiltIn = computed(() => !!(manager.data.value && manager.data.value.builtIn));\n\n        function initForm() {\n            assignFormProperties(form, manager.data.value, { fields: v.fields });\n\n            if (form.name.length === 0) {\n                form.name = generateName(nameSeed);\n            }\n\n            if (realmId.value) {\n                form.realmId = realmId.value;\n            }\n        }\n\n        watch(updatedAt, (val, oldVal) => {\n            if (!val || val === oldVal) {\n                return;\n            }\n\n            manager.data.value = props.entity;\n            initForm();\n        });\n\n        initForm();\n\n        const submit = async () => {\n            if (busy.value || v.$invalid.value) {\n                return;\n            }\n\n            busy.value = true;\n            try {\n                const data: Record<string, unknown> = {\n                    ...form,\n                    decisionStrategy: form.decisionStrategy || null,\n                };\n\n                await manager.createOrUpdate(data);\n            } finally {\n                busy.value = false;\n            }\n        };\n\n        const translationsDefault = useTranslations(\n            [\n                {\n                    namespace: TranslatorTranslationNamespace.FIELD,\n                    key: TranslatorTranslationFieldKey.NAME,\n                },\n                {\n                    namespace: TranslatorTranslationNamespace.FIELD,\n                    key: TranslatorTranslationFieldKey.DISPLAY_NAME,\n                },\n                {\n                    namespace: TranslatorTranslationNamespace.FIELD,\n                    key: TranslatorTranslationFieldKey.DESCRIPTION,\n                },\n                {\n                    namespace: TranslatorTranslationNamespace.FIELD,\n                    key: TranslatorTranslationFieldKey.DECISION_STRATEGY,\n                },\n                {\n                    namespace: TranslatorTranslationNamespace.ENTITY,\n                    key: TranslatorTranslationEntityKey.REALM,\n                    count: 1,\n                },\n            ],\n        );\n\n        const translationsClient = useTranslationsForNamespace(\n            TranslatorTranslationNamespace.CLIENT,\n            [\n                { key: TranslatorTranslationClientKey.OPTION_NONE_UNANIMOUS },\n                { key: TranslatorTranslationClientKey.DECISION_STRATEGY_HINT_AFFIRMATIVE },\n                { key: TranslatorTranslationClientKey.DECISION_STRATEGY_HINT_CONSENSUS },\n                { key: TranslatorTranslationClientKey.DECISION_STRATEGY_HINT_UNANIMOUS },\n                { key: TranslatorTranslationClientKey.DECISION_STRATEGY_HINT_DEFAULT },\n            ],\n        );\n\n        const decisionStrategyHintComputed = computed(() => {\n            switch (form.decisionStrategy) {\n                case DecisionStrategy.AFFIRMATIVE:\n                    return translationsClient.decisionStrategyHintAffirmative;\n                case DecisionStrategy.CONSENSUS:\n                    return translationsClient.decisionStrategyHintConsensus;\n                case DecisionStrategy.UNANIMOUS:\n                    return translationsClient.decisionStrategyHintUnanimous;\n                default:\n                    return translationsClient.decisionStrategyHintDefault;\n            }\n        });\n\n        return {\n            busy,\n            v,\n            isEditing,\n            isBuiltIn,\n            realmId,\n            decisionStrategyOptions,\n            decisionStrategyHint: decisionStrategyHintComputed,\n            translationsDefault,\n            translationsClient,\n            submit,\n        };\n    },\n});\n\n</script>\n\n<template>\n    <form @submit.prevent=\"submit\">\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"v.fields.name\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translationsDefault.name }}\n                </template>\n                <ANameInput\n                    v-model=\"v.fields.name.$model.value\"\n                    :disabled=\"isBuiltIn\"\n                />\n            </VCFormGroup>\n        </IFieldValidation>\n\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"v.fields.displayName\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translationsDefault.displayName }}\n                </template>\n                <VCFormInput\n                    :model-value=\"v.fields.displayName.$model.value ?? ''\"\n                    @update:model-value=\"(next: string) => { v.fields.displayName.$model.value = next; }\"\n                />\n            </VCFormGroup>\n        </IFieldValidation>\n\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"v.fields.description\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translationsDefault.description }}\n                </template>\n                <VCFormTextarea\n                    :model-value=\"v.fields.description.$model.value ?? ''\"\n                    :rows=\"4\"\n                    @update:model-value=\"(next: string) => { v.fields.description.$model.value = next; }\"\n                />\n            </VCFormGroup>\n        </IFieldValidation>\n\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"v.fields.decisionStrategy\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translationsDefault.decisionStrategy }}\n                </template>\n                <VCFormSelect\n                    v-model=\"v.fields.decisionStrategy.$model.value\"\n                    :options=\"decisionStrategyOptions\"\n                    :placeholder=\"translationsClient.optionNoneUnanimous\"\n                />\n                <VCAlert\n                    color=\"info\"\n                    variant=\"soft\"\n                    size=\"sm\"\n                    class=\"mt-1 mb-0\"\n                >\n                    {{ decisionStrategyHint }}\n                </VCAlert>\n            </VCFormGroup>\n        </IFieldValidation>\n\n        <template v-if=\"!realmId && !isEditing\">\n            <IFieldValidation\n                v-slot=\"{ value }\"\n                :field=\"v.fields.realmId\"\n            >\n                <VCFormGroup :validation=\"value\">\n                    <template #label>\n                        {{ translationsDefault.realm }}\n                    </template>\n                    <ARealmPicker\n                        :value=\"v.fields.realmId.$model.value\"\n                        :multiple=\"false\"\n                        @change=\"(input: string[]) => {\n                            v.fields.realmId.$model.value = input.length > 0 ? input[0] ?? '' : '';\n                        }\"\n                    />\n                </VCFormGroup>\n            </IFieldValidation>\n        </template>\n\n        <AFormSubmit\n            :is-busy=\"busy\"\n            :is-editing=\"isEditing\"\n            :is-invalid=\"v.$invalid.value\"\n            @submit=\"submit\"\n        />\n    </form>\n</template>\n","/*\n * Copyright (c) 2022.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\nimport { EntityType } from '@authup/core-kit';\nimport type { SlotsType } from 'vue';\nimport { defineComponent } from 'vue';\nimport type { Permission } from '@authup/core-kit';\nimport type { EntityCollectionVSlots } from '../../utility';\nimport { TranslatorTranslationEntityKey, TranslatorTranslationNamespace, TranslatorTranslationVuecsKey } from '@authup/i18n';\nimport { useTranslation } from '../../../core';\nimport {\n    defineEntityCollectionManager,\n    defineEntityCollectionVEmitOptions,\n    defineEntityCollectionVProps,\n} from '../../utility';\n\nexport const APermissions = defineComponent({\n    props: defineEntityCollectionVProps<Permission>(),\n    emits: defineEntityCollectionVEmitOptions<Permission>(),\n    slots: Object as SlotsType<EntityCollectionVSlots<Permission>>,\n    setup(props, setup) {\n        const { render } = defineEntityCollectionManager({\n            type: `${EntityType.PERMISSION}`,\n            props,\n            setup,\n        });\n\n        const translationName = useTranslation({\n            namespace: TranslatorTranslationNamespace.ENTITY,\n            key: TranslatorTranslationEntityKey.PERMISSION,\n            count: 2,\n        });\n\n        const translation = useTranslation({\n            namespace: TranslatorTranslationNamespace.VUECS,\n            key: TranslatorTranslationVuecsKey.NO_MORE,\n            data: { name: translationName },\n        });\n\n        return () => render({ noMore: { content: translation.value } });\n    },\n});\n","/*\n * Copyright (c) 2026.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { BuiltInPolicyType } from '@authup/access';\nimport { TranslatorTranslationClientKey } from '@authup/i18n';\n\nexport const POLICY_TYPE_TRANSLATION_KEYS = {\n    [BuiltInPolicyType.COMPOSITE]: TranslatorTranslationClientKey.POLICY_TYPE_COMPOSITE,\n    [BuiltInPolicyType.DATE]: TranslatorTranslationClientKey.POLICY_TYPE_DATE,\n    [BuiltInPolicyType.TIME]: TranslatorTranslationClientKey.POLICY_TYPE_TIME,\n    [BuiltInPolicyType.ATTRIBUTE_NAMES]: TranslatorTranslationClientKey.POLICY_TYPE_ATTRIBUTE_NAMES,\n    [BuiltInPolicyType.ATTRIBUTES]: TranslatorTranslationClientKey.POLICY_TYPE_ATTRIBUTES,\n    [BuiltInPolicyType.REALM_MATCH]: TranslatorTranslationClientKey.POLICY_TYPE_REALM_MATCH,\n    [BuiltInPolicyType.IDENTITY]: TranslatorTranslationClientKey.POLICY_TYPE_IDENTITY,\n    [BuiltInPolicyType.PERMISSION_BINDING]: TranslatorTranslationClientKey.POLICY_TYPE_PERMISSION_BINDING,\n} as const;\n","<!--\n  Copyright (c) 2026.\n  Author Peter Placzek (tada5hi)\n  For the full copyright and license information,\n  view the LICENSE file that was distributed with this source code.\n-->\n\n<script lang=\"ts\">\nimport { computed, defineComponent } from 'vue';\nimport { VCBadge } from '@vuecs/elements';\nimport {\n    TranslatorTranslationClientKey,\n    TranslatorTranslationNamespace,\n} from '@authup/i18n';\nimport { useTranslationsForNamespace } from '../../../core';\nimport { POLICY_TYPE_TRANSLATION_KEYS } from './policy-type';\n\nexport default defineComponent({\n    components: { VCBadge },\n    props: {\n        type: {\n            type: String,\n            required: true,\n        },\n    },\n    setup(props) {\n        const translations = useTranslationsForNamespace(\n            TranslatorTranslationNamespace.CLIENT,\n            [\n                { key: TranslatorTranslationClientKey.POLICY_TYPE_COMPOSITE },\n                { key: TranslatorTranslationClientKey.POLICY_TYPE_DATE },\n                { key: TranslatorTranslationClientKey.POLICY_TYPE_TIME },\n                { key: TranslatorTranslationClientKey.POLICY_TYPE_ATTRIBUTE_NAMES },\n                { key: TranslatorTranslationClientKey.POLICY_TYPE_ATTRIBUTES },\n                { key: TranslatorTranslationClientKey.POLICY_TYPE_REALM_MATCH },\n                { key: TranslatorTranslationClientKey.POLICY_TYPE_IDENTITY },\n                { key: TranslatorTranslationClientKey.POLICY_TYPE_PERMISSION_BINDING },\n            ],\n        );\n\n        const label = computed(() => {\n            const key = POLICY_TYPE_TRANSLATION_KEYS[props.type as keyof typeof POLICY_TYPE_TRANSLATION_KEYS];\n            if (key) {\n                return translations[key];\n            }\n\n            return props.type;\n        });\n\n        return { label };\n    },\n});\n</script>\n<template>\n    <VCBadge\n        color=\"info\"\n        variant=\"solid\"\n    >\n        {{ label }}\n    </VCBadge>\n</template>\n","<!--\n  Copyright (c) 2026.\n  Author Peter Placzek (tada5hi)\n  For the full copyright and license information,\n  view the LICENSE file that was distributed with this source code.\n-->\n\n<script lang=\"ts\">\nimport { computed, defineComponent } from 'vue';\nimport { VCBadge } from '@vuecs/elements';\nimport {\n    TranslatorTranslationClientKey,\n    TranslatorTranslationNamespace,\n} from '@authup/i18n';\nimport { useTranslationsForNamespace } from '../../../core';\nimport { POLICY_TYPE_TRANSLATION_KEYS } from './policy-type';\n\nexport default defineComponent({\n    components: { VCBadge },\n    props: {\n        type: {\n            type: String,\n            required: true,\n        },\n    },\n    setup(props) {\n        const translations = useTranslationsForNamespace(\n            TranslatorTranslationNamespace.CLIENT,\n            [\n                { key: TranslatorTranslationClientKey.POLICY_TYPE_COMPOSITE },\n                { key: TranslatorTranslationClientKey.POLICY_TYPE_DATE },\n                { key: TranslatorTranslationClientKey.POLICY_TYPE_TIME },\n                { key: TranslatorTranslationClientKey.POLICY_TYPE_ATTRIBUTE_NAMES },\n                { key: TranslatorTranslationClientKey.POLICY_TYPE_ATTRIBUTES },\n                { key: TranslatorTranslationClientKey.POLICY_TYPE_REALM_MATCH },\n                { key: TranslatorTranslationClientKey.POLICY_TYPE_IDENTITY },\n                { key: TranslatorTranslationClientKey.POLICY_TYPE_PERMISSION_BINDING },\n            ],\n        );\n\n        const label = computed(() => {\n            const key = POLICY_TYPE_TRANSLATION_KEYS[props.type as keyof typeof POLICY_TYPE_TRANSLATION_KEYS];\n            if (key) {\n                return translations[key];\n            }\n\n            return props.type;\n        });\n\n        return { label };\n    },\n});\n</script>\n<template>\n    <VCBadge\n        color=\"info\"\n        variant=\"solid\"\n    >\n        {{ label }}\n    </VCBadge>\n</template>\n","<!--\n  Copyright (c) 2026.\n  Author Peter Placzek (tada5hi)\n  For the full copyright and license information,\n  view the LICENSE file that was distributed with this source code.\n-->\n\n<script lang=\"ts\">\nimport type { PropType } from 'vue';\nimport { defineComponent } from 'vue';\nimport type { ButtonSize } from '@vuecs/button';\nimport { VCButton } from '@vuecs/button';\nimport { VCIcon } from '@vuecs/icon';\nimport { TranslatorTranslationClientKey, TranslatorTranslationNamespace } from '@authup/i18n';\nimport { DEFAULT_BUTTON_SIZE, useTranslation } from '../../../core';\n\nexport default defineComponent({\n    components: { VCButton, VCIcon },\n    props: {\n        policyId: {\n            type: String,\n            required: true,\n        },\n        size: {\n            type: String as PropType<ButtonSize>,\n            default: DEFAULT_BUTTON_SIZE,\n        },\n    },\n    emits: ['click'],\n    setup(props, { emit }) {\n        const viewPolicyDetails = useTranslation({\n            namespace: TranslatorTranslationNamespace.CLIENT,\n            key: TranslatorTranslationClientKey.VIEW_POLICY_DETAILS,\n        });\n\n        const handleClick = (e: Event) => {\n            e.preventDefault();\n            emit('click', props.policyId);\n        };\n\n        return { handleClick, viewPolicyDetails };\n    },\n});\n</script>\n<template>\n    <VCButton\n        type=\"button\"\n        :size=\"size\"\n        color=\"info\"\n        variant=\"outline\"\n        :title=\"viewPolicyDetails\"\n        :aria-label=\"viewPolicyDetails\"\n        @click=\"handleClick\"\n    >\n        <template #leading>\n            <VCIcon name=\"fa6-solid:eye\" />\n        </template>\n    </VCButton>\n</template>\n","<!--\n  Copyright (c) 2026.\n  Author Peter Placzek (tada5hi)\n  For the full copyright and license information,\n  view the LICENSE file that was distributed with this source code.\n-->\n\n<script lang=\"ts\">\nimport type { PropType } from 'vue';\nimport { defineComponent } from 'vue';\nimport type { ButtonSize } from '@vuecs/button';\nimport { VCButton } from '@vuecs/button';\nimport { VCIcon } from '@vuecs/icon';\nimport { TranslatorTranslationClientKey, TranslatorTranslationNamespace } from '@authup/i18n';\nimport { DEFAULT_BUTTON_SIZE, useTranslation } from '../../../core';\n\nexport default defineComponent({\n    components: { VCButton, VCIcon },\n    props: {\n        policyId: {\n            type: String,\n            required: true,\n        },\n        size: {\n            type: String as PropType<ButtonSize>,\n            default: DEFAULT_BUTTON_SIZE,\n        },\n    },\n    emits: ['click'],\n    setup(props, { emit }) {\n        const viewPolicyDetails = useTranslation({\n            namespace: TranslatorTranslationNamespace.CLIENT,\n            key: TranslatorTranslationClientKey.VIEW_POLICY_DETAILS,\n        });\n\n        const handleClick = (e: Event) => {\n            e.preventDefault();\n            emit('click', props.policyId);\n        };\n\n        return { handleClick, viewPolicyDetails };\n    },\n});\n</script>\n<template>\n    <VCButton\n        type=\"button\"\n        :size=\"size\"\n        color=\"info\"\n        variant=\"outline\"\n        :title=\"viewPolicyDetails\"\n        :aria-label=\"viewPolicyDetails\"\n        @click=\"handleClick\"\n    >\n        <template #leading>\n            <VCIcon name=\"fa6-solid:eye\" />\n        </template>\n    </VCButton>\n</template>\n","<!--\n  Copyright (c) 2026.\n  Author Peter Placzek (tada5hi)\n  For the full copyright and license information,\n  view the LICENSE file that was distributed with this source code.\n-->\n\n<script lang=\"ts\">\nimport type { Policy } from '@authup/core-kit';\nimport type { PropType } from 'vue';\nimport { defineComponent } from 'vue';\nimport { VCBadge } from '@vuecs/elements';\nimport {\n    TranslatorTranslationCommonKey,\n    TranslatorTranslationNamespace,\n} from '@authup/i18n';\nimport { useTranslationsForNamespace } from '../../../core';\nimport APolicyTypeBadge from './APolicyTypeBadge.vue';\nimport APolicyDetailNav from './APolicyDetailNav.vue';\n\nexport default defineComponent({\n    components: {\n        APolicyTypeBadge, \n        APolicyDetailNav, \n        VCBadge, \n    },\n    props: {\n        entity: {\n            type: Object as PropType<Policy>,\n            required: true,\n        },\n    },\n    emits: ['detail'],\n    setup(props, { emit }) {\n        const handleDetail = () => {\n            emit('detail', props.entity);\n        };\n\n        const translations = useTranslationsForNamespace(\n            TranslatorTranslationNamespace.COMMON,\n            [\n                { key: TranslatorTranslationCommonKey.INVERTED },\n            ],\n        );\n\n        return { handleDetail, translations };\n    },\n});\n</script>\n<template>\n    <APolicyTypeBadge :type=\"entity.type\" />\n    <VCBadge\n        v-if=\"entity.invert\"\n        color=\"warning\"\n        variant=\"solid\"\n    >\n        {{ translations.inverted }}\n    </VCBadge>\n    <APolicyDetailNav\n        :policy-id=\"entity.id\"\n        @click=\"handleDetail\"\n    />\n</template>\n","<!--\n  Copyright (c) 2026.\n  Author Peter Placzek (tada5hi)\n  For the full copyright and license information,\n  view the LICENSE file that was distributed with this source code.\n-->\n\n<script lang=\"ts\">\nimport type { Policy } from '@authup/core-kit';\nimport type { PropType } from 'vue';\nimport { defineComponent } from 'vue';\nimport { VCBadge } from '@vuecs/elements';\nimport {\n    TranslatorTranslationCommonKey,\n    TranslatorTranslationNamespace,\n} from '@authup/i18n';\nimport { useTranslationsForNamespace } from '../../../core';\nimport APolicyTypeBadge from './APolicyTypeBadge.vue';\nimport APolicyDetailNav from './APolicyDetailNav.vue';\n\nexport default defineComponent({\n    components: {\n        APolicyTypeBadge, \n        APolicyDetailNav, \n        VCBadge, \n    },\n    props: {\n        entity: {\n            type: Object as PropType<Policy>,\n            required: true,\n        },\n    },\n    emits: ['detail'],\n    setup(props, { emit }) {\n        const handleDetail = () => {\n            emit('detail', props.entity);\n        };\n\n        const translations = useTranslationsForNamespace(\n            TranslatorTranslationNamespace.COMMON,\n            [\n                { key: TranslatorTranslationCommonKey.INVERTED },\n            ],\n        );\n\n        return { handleDetail, translations };\n    },\n});\n</script>\n<template>\n    <APolicyTypeBadge :type=\"entity.type\" />\n    <VCBadge\n        v-if=\"entity.invert\"\n        color=\"warning\"\n        variant=\"solid\"\n    >\n        {{ translations.inverted }}\n    </VCBadge>\n    <APolicyDetailNav\n        :policy-id=\"entity.id\"\n        @click=\"handleDetail\"\n    />\n</template>\n","<!--\n  Copyright (c) 2026.\n  Author Peter Placzek (tada5hi)\n  For the full copyright and license information,\n  view the LICENSE file that was distributed with this source code.\n-->\n\n<script lang=\"ts\">\nimport type { Policy } from '@authup/core-kit';\nimport type { PropType } from 'vue';\nimport { defineComponent } from 'vue';\nimport { VCBadge } from '@vuecs/elements';\nimport {\n    TranslatorTranslationCommonKey,\n    TranslatorTranslationFieldKey,\n    TranslatorTranslationNamespace,\n} from '@authup/i18n';\nimport { useTranslations } from '../../../core';\nimport APolicyTypeBadge from './APolicyTypeBadge.vue';\n\nexport default defineComponent({\n    components: { APolicyTypeBadge, VCBadge },\n    props: {\n        entity: {\n            type: Object as PropType<Policy>,\n            required: true,\n        },\n    },\n    setup() {\n        const translations = useTranslations([\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.NAME,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.TYPE,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.DISPLAY_NAME,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.DESCRIPTION,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.INVERT,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.COMMON,\n                key: TranslatorTranslationCommonKey.BUILT_IN,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.COMMON,\n                key: TranslatorTranslationCommonKey.YES,\n            },\n        ]);\n\n        return { translations };\n    },\n});\n</script>\n<template>\n    <div>\n        <div class=\"flex flex-row gap-2 mb-2\">\n            <strong style=\"min-width: 120px\">{{ translations.name }}</strong>\n            <div>{{ entity.name }}</div>\n        </div>\n        <div class=\"flex flex-row gap-2 mb-2\">\n            <strong style=\"min-width: 120px\">{{ translations.type }}</strong>\n            <div>\n                <APolicyTypeBadge :type=\"entity.type\" />\n            </div>\n        </div>\n        <div\n            v-if=\"entity.displayName\"\n            class=\"flex flex-row gap-2 mb-2\"\n        >\n            <strong style=\"min-width: 120px\">{{ translations.displayName }}</strong>\n            <div>{{ entity.displayName }}</div>\n        </div>\n        <div\n            v-if=\"entity.description\"\n            class=\"flex flex-row gap-2 mb-2\"\n        >\n            <strong style=\"min-width: 120px\">{{ translations.description }}</strong>\n            <div>{{ entity.description }}</div>\n        </div>\n        <div\n            v-if=\"entity.invert\"\n            class=\"flex flex-row gap-2 mb-2\"\n        >\n            <strong style=\"min-width: 120px\">{{ translations.invert }}</strong>\n            <div>\n                <VCBadge\n                    color=\"warning\"\n                    variant=\"solid\"\n                >\n                    {{ translations.yes }}\n                </VCBadge>\n            </div>\n        </div>\n        <div\n            v-if=\"entity.builtIn\"\n            class=\"flex flex-row gap-2 mb-2\"\n        >\n            <strong style=\"min-width: 120px\">{{ translations.builtIn }}</strong>\n            <div>\n                <VCBadge\n                    color=\"neutral\"\n                    variant=\"soft\"\n                >\n                    {{ translations.yes }}\n                </VCBadge>\n            </div>\n        </div>\n    </div>\n</template>\n","<!--\n  Copyright (c) 2026.\n  Author Peter Placzek (tada5hi)\n  For the full copyright and license information,\n  view the LICENSE file that was distributed with this source code.\n-->\n\n<script lang=\"ts\">\nimport type { Policy } from '@authup/core-kit';\nimport type { PropType } from 'vue';\nimport { defineComponent } from 'vue';\nimport { VCBadge } from '@vuecs/elements';\nimport {\n    TranslatorTranslationCommonKey,\n    TranslatorTranslationFieldKey,\n    TranslatorTranslationNamespace,\n} from '@authup/i18n';\nimport { useTranslations } from '../../../core';\nimport APolicyTypeBadge from './APolicyTypeBadge.vue';\n\nexport default defineComponent({\n    components: { APolicyTypeBadge, VCBadge },\n    props: {\n        entity: {\n            type: Object as PropType<Policy>,\n            required: true,\n        },\n    },\n    setup() {\n        const translations = useTranslations([\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.NAME,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.TYPE,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.DISPLAY_NAME,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.DESCRIPTION,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.INVERT,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.COMMON,\n                key: TranslatorTranslationCommonKey.BUILT_IN,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.COMMON,\n                key: TranslatorTranslationCommonKey.YES,\n            },\n        ]);\n\n        return { translations };\n    },\n});\n</script>\n<template>\n    <div>\n        <div class=\"flex flex-row gap-2 mb-2\">\n            <strong style=\"min-width: 120px\">{{ translations.name }}</strong>\n            <div>{{ entity.name }}</div>\n        </div>\n        <div class=\"flex flex-row gap-2 mb-2\">\n            <strong style=\"min-width: 120px\">{{ translations.type }}</strong>\n            <div>\n                <APolicyTypeBadge :type=\"entity.type\" />\n            </div>\n        </div>\n        <div\n            v-if=\"entity.displayName\"\n            class=\"flex flex-row gap-2 mb-2\"\n        >\n            <strong style=\"min-width: 120px\">{{ translations.displayName }}</strong>\n            <div>{{ entity.displayName }}</div>\n        </div>\n        <div\n            v-if=\"entity.description\"\n            class=\"flex flex-row gap-2 mb-2\"\n        >\n            <strong style=\"min-width: 120px\">{{ translations.description }}</strong>\n            <div>{{ entity.description }}</div>\n        </div>\n        <div\n            v-if=\"entity.invert\"\n            class=\"flex flex-row gap-2 mb-2\"\n        >\n            <strong style=\"min-width: 120px\">{{ translations.invert }}</strong>\n            <div>\n                <VCBadge\n                    color=\"warning\"\n                    variant=\"solid\"\n                >\n                    {{ translations.yes }}\n                </VCBadge>\n            </div>\n        </div>\n        <div\n            v-if=\"entity.builtIn\"\n            class=\"flex flex-row gap-2 mb-2\"\n        >\n            <strong style=\"min-width: 120px\">{{ translations.builtIn }}</strong>\n            <div>\n                <VCBadge\n                    color=\"neutral\"\n                    variant=\"soft\"\n                >\n                    {{ translations.yes }}\n                </VCBadge>\n            </div>\n        </div>\n    </div>\n</template>\n","/*\n * Copyright (c) 2026.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { pickEntityAPI } from '@authup/core-http-kit';\nimport type {\n    EntityTypeMap,\n    PermissionRelation,\n    Policy,\n    RealmScopeValue,\n} from '@authup/core-kit';\nimport { REALM_SCOPE } from '@authup/core-kit';\nimport { defineQuery } from '@rapiq/core';\nimport type { PropType, Ref } from 'vue';\nimport {\n    defineComponent,\n    h,\n    ref,\n    toRef,\n    watch,\n} from 'vue';\nimport type { ButtonSize } from '@vuecs/button';\nimport { VCButton } from '@vuecs/button';\nimport { VCIcon } from '@vuecs/icon';\nimport {\n    VCModal,\n    VCModalClose,\n    VCModalContent,\n    VCModalTitle,\n} from '@vuecs/overlays';\nimport { TranslatorTranslationActionKey, TranslatorTranslationClientKey, TranslatorTranslationNamespace } from '@authup/i18n';\nimport {\n    DEFAULT_BUTTON_SIZE,\n    SlotName,\n    injectHTTPClient,\n    useTranslation,\n} from '../../../core';\nimport { hasOwnProperty } from '@authup/kit';\nimport { APolicies } from '../policy/APolicies';\nimport APolicyInlineInfo from '../policy/APolicyInlineInfo.vue';\nimport APolicySummary from '../policy/APolicySummary.vue';\n\ntype PermissionBindingEntity = PermissionRelation & { id: string };\n\nexport const APermissionPolicyBindingButton = defineComponent({\n    props: {\n        entityType: {\n            type: String as PropType<keyof EntityTypeMap>,\n            required: true,\n        },\n        // The junction this control manages. With an `id` it is an existing binding → EDIT mode\n        // (each selection patches immediately). Without an `id` it is a \"template\" carrying just\n        // the base fields the new junction is born with (owner FK + permissionId) → CREATE mode\n        // (selections are staged, then the control performs the create itself). One prop, both\n        // modes — the form-initialValue pattern.\n        entity: {\n            type: Object as PropType<Partial<PermissionBindingEntity>>,\n            required: false,\n            default: undefined,\n        },\n        size: {\n            type: String as PropType<ButtonSize>,\n            default: DEFAULT_BUTTON_SIZE,\n        },\n    },\n    emits: ['created', 'updated', 'failed'],\n    setup(props, { emit }) {\n        const client = injectHTTPClient();\n\n        const modalOpen = ref(false);\n        const busy = ref(false);\n        // Create mode = no persisted junction yet (no id). In that mode selections are STAGED\n        // locally and committed once via the create; in edit mode each selection patches\n        // immediately.\n        const isCreateMode = () => !props.entity?.id;\n        const currentPolicyId = ref<string | null>(props.entity?.policyId ?? null);\n        // Preselect the backend default (`own`) in create mode so a sensible reach is staged.\n        const currentRealmScope = ref<RealmScopeValue | null>(\n            props.entity?.realmScope ?? (props.entity?.id ? null : REALM_SCOPE.OWN),\n        );\n        // The detail view is a nested modal: Escape / outside-click close it\n        // back to the list (handled by the inner VCModalContent), and another\n        // Escape then closes the outer list modal.\n        const detailPolicy = ref<Policy | null>(null);\n\n        const entityRef = toRef(props, 'entity');\n        watch(entityRef, (val) => {\n            currentPolicyId.value = val?.policyId ?? null;\n            currentRealmScope.value = val?.realmScope ?? (val?.id ? null : REALM_SCOPE.OWN);\n        }, { deep: true });\n\n        const handlePolicySelect = async (policyId: string | null) => {\n            if (busy.value) return;\n\n            // Create mode: stage the choice; it is committed by the `create` emit.\n            if (isCreateMode()) {\n                currentPolicyId.value = policyId;\n                return;\n            }\n\n            const entityId = props.entity?.id;\n            const api = pickEntityAPI(client, props.entityType);\n\n            if (!entityId || !api?.update) return;\n\n            busy.value = true;\n            try {\n                const response = await api.update(entityId, { policyId });\n                currentPolicyId.value = policyId;\n                emit('updated', response.data);\n            } catch (e) {\n                if (e instanceof Error) {\n                    emit('failed', e);\n                }\n            } finally {\n                busy.value = false;\n            }\n        };\n\n        const handleRealmScopeSelect = async (scope: RealmScopeValue) => {\n            if (busy.value || currentRealmScope.value === scope) return;\n\n            // Create mode: stage the choice; it is committed by the `create` emit.\n            if (isCreateMode()) {\n                currentRealmScope.value = scope;\n                return;\n            }\n\n            const entityId = props.entity?.id;\n            const api = pickEntityAPI(client, props.entityType);\n\n            if (!entityId || !api?.update) return;\n\n            busy.value = true;\n            try {\n                const response = await api.update(entityId, { realmScope: scope });\n                // Reflect the server-capped value: a restricted actor's chosen scope may be\n                // narrowed server-side, so prefer the persisted scope from the response.\n                currentRealmScope.value = (\n                    response.data &&\n                    typeof response.data === 'object' &&\n                    hasOwnProperty(response.data, 'realmScope')\n                ) ?\n                    response.data.realmScope as RealmScopeValue | null :\n                    scope;\n                emit('updated', response.data);\n            } catch (e) {\n                if (e instanceof Error) {\n                    emit('failed', e);\n                }\n            } finally {\n                busy.value = false;\n            }\n        };\n\n        // Commit the staged (realmScope, policyId) as a NEW junction. Performed here via the\n        // injected client — symmetric with the update path — using the entity template (the FK\n        // base fields) as the create payload base. The created entity is emitted so the parent can\n        // sync its manager (manager.created); it flows back as `props.entity` (now with an id),\n        // switching the control to edit mode. The server caps the chosen scope.\n        const handleCreate = async () => {\n            if (busy.value || !isCreateMode() || !props.entity) return;\n\n            const api = pickEntityAPI(client, props.entityType);\n\n            if (!api?.create) return;\n\n            busy.value = true;\n            try {\n                const response = await api.create({\n                    ...props.entity,\n                    realmScope: currentRealmScope.value ?? undefined,\n                    policyId: currentPolicyId.value ?? undefined,\n                });\n                emit('created', response.data);\n                modalOpen.value = false;\n            } catch (e) {\n                if (e instanceof Error) {\n                    emit('failed', e);\n                }\n            } finally {\n                busy.value = false;\n            }\n        };\n\n        const translationJunctionPolicy = useTranslation({\n            namespace: TranslatorTranslationNamespace.CLIENT,\n            key: TranslatorTranslationClientKey.JUNCTION_POLICY,\n        });\n\n        const translationAdd = useTranslation({\n            namespace: TranslatorTranslationNamespace.ACTION,\n            key: TranslatorTranslationActionKey.ADD,\n        });\n\n        const translationJunctionRealmScope = useTranslation({\n            namespace: TranslatorTranslationNamespace.CLIENT,\n            key: TranslatorTranslationClientKey.JUNCTION_REALM_SCOPE,\n        });\n\n        // Localized label + one-line hint per reach. Keyed off the string VALUE of REALM_SCOPE\n        // (camelCase `ownOrNull`), not a member-name derivation. `none` is included so a persisted\n        // none-scoped binding can be shown read-only in edit mode (it is never user-selectable —\n        // see realmScopeOptions).\n        const realmScopeLabels: Record<string, Ref<string>> = {\n            [REALM_SCOPE.NONE]: useTranslation({\n                namespace: TranslatorTranslationNamespace.CLIENT,\n                key: TranslatorTranslationClientKey.REALM_SCOPE_NONE,\n            }),\n            [REALM_SCOPE.OWN]: useTranslation({\n                namespace: TranslatorTranslationNamespace.CLIENT,\n                key: TranslatorTranslationClientKey.REALM_SCOPE_OWN,\n            }),\n            [REALM_SCOPE.OWN_OR_NULL]: useTranslation({\n                namespace: TranslatorTranslationNamespace.CLIENT,\n                key: TranslatorTranslationClientKey.REALM_SCOPE_OWN_OR_NULL,\n            }),\n            [REALM_SCOPE.ANY]: useTranslation({\n                namespace: TranslatorTranslationNamespace.CLIENT,\n                key: TranslatorTranslationClientKey.REALM_SCOPE_ANY,\n            }),\n        };\n\n        const realmScopeHints: Record<string, Ref<string>> = {\n            [REALM_SCOPE.NONE]: useTranslation({\n                namespace: TranslatorTranslationNamespace.CLIENT,\n                key: TranslatorTranslationClientKey.REALM_SCOPE_NONE_HINT,\n            }),\n            [REALM_SCOPE.OWN]: useTranslation({\n                namespace: TranslatorTranslationNamespace.CLIENT,\n                key: TranslatorTranslationClientKey.REALM_SCOPE_OWN_HINT,\n            }),\n            [REALM_SCOPE.OWN_OR_NULL]: useTranslation({\n                namespace: TranslatorTranslationNamespace.CLIENT,\n                key: TranslatorTranslationClientKey.REALM_SCOPE_OWN_OR_NULL_HINT,\n            }),\n            [REALM_SCOPE.ANY]: useTranslation({\n                namespace: TranslatorTranslationNamespace.CLIENT,\n                key: TranslatorTranslationClientKey.REALM_SCOPE_ANY_HINT,\n            }),\n        };\n\n        // Only the reachable scopes are user-selectable; `none` stays a valid stored value but\n        // is never offered (it would create a grant that matches no realm).\n        const realmScopeOptions = Object.values(REALM_SCOPE)\n            .filter((scope) => scope !== REALM_SCOPE.NONE);\n\n        const translationBack = useTranslation({\n            namespace: TranslatorTranslationNamespace.ACTION,\n            key: TranslatorTranslationActionKey.BACK,\n        });\n\n        const translationReset = useTranslation({\n            namespace: TranslatorTranslationNamespace.ACTION,\n            key: TranslatorTranslationActionKey.RESET,\n        });\n\n        const translationClose = useTranslation({\n            namespace: TranslatorTranslationNamespace.ACTION,\n            key: TranslatorTranslationActionKey.CLOSE,\n        });\n\n        const renderCloseIcon = () => h(VCModalClose, {\n            class: 'text-fg-muted hover:text-fg',\n            'aria-label': translationClose.value,\n        }, () => h(VCIcon, { name: 'fa6-solid:xmark' }));\n\n        const renderRealmScopeSelector = () => {\n            const current = currentRealmScope.value;\n            const selectedHint = current ? realmScopeHints[current]?.value : undefined;\n            // `none` is a valid persisted reach (e.g. a fail-closed propagation) but not\n            // user-selectable. Surface it read-only so an existing none-scoped binding still\n            // renders its state instead of appearing unset.\n            const showNone = current === REALM_SCOPE.NONE;\n\n            return h('div', { class: 'flex flex-col gap-1' }, [\n                h('div', { class: 'text-sm font-medium' }, translationJunctionRealmScope.value),\n                h('div', { class: 'flex flex-wrap gap-1' }, [\n                    showNone ?\n                        h(VCButton, {\n                            key: REALM_SCOPE.NONE,\n                            size: props.size,\n                            color: 'primary',\n                            variant: 'solid',\n                            disabled: true,\n                            label: realmScopeLabels[REALM_SCOPE.NONE]?.value ?? REALM_SCOPE.NONE,\n                            title: realmScopeHints[REALM_SCOPE.NONE]?.value,\n                        }) :\n                        undefined,\n                    ...realmScopeOptions.map((scope) => {\n                        const isSelected = current === scope;\n                        return h(VCButton, {\n                            key: scope,\n                            size: props.size,\n                            color: isSelected ? 'primary' : 'neutral',\n                            variant: isSelected ? 'solid' : 'soft',\n                            disabled: busy.value,\n                            label: realmScopeLabels[scope]?.value ?? scope,\n                            title: realmScopeHints[scope]?.value,\n                            onClick(e: Event) {\n                                e.preventDefault();\n                                handleRealmScopeSelect(scope as RealmScopeValue);\n                            },\n                        });\n                    }),\n                ]),\n                selectedHint ?\n                    h('div', { class: 'text-xs text-fg-muted' }, selectedHint) :\n                    undefined,\n            ]);\n        };\n\n        const renderListContent = () => [\n            h('div', { class: 'flex items-center justify-between gap-2' }, [\n                h(VCModalTitle, () => translationJunctionPolicy.value),\n                renderCloseIcon(),\n            ]),\n            renderRealmScopeSelector(),\n            h(APolicies, { query: defineQuery<Policy>({ filters: { parentId: null } }) }, {\n                [SlotName.ITEM]: (slotProps: { data: Policy }) => {\n                    const isSelected = currentPolicyId.value === slotProps.data.id;\n\n                    let selectColor: 'neutral' | 'success' = 'neutral';\n                    let selectVariant: 'solid' | 'soft' = 'soft';\n                    if (busy.value) {\n                        selectVariant = 'solid';\n                    } else if (isSelected) {\n                        selectColor = 'success';\n                        selectVariant = 'solid';\n                    }\n\n                    return [\n                        h('div', [slotProps.data.name]),\n                        h(APolicyInlineInfo, {\n                            entity: slotProps.data,\n                            onDetail: (policy: Policy) => {\n                                detailPolicy.value = policy;\n                            },\n                        }),\n                        h('div', { class: 'ms-auto' }, [\n                            h(VCButton, {\n                                size: props.size,\n                                color: selectColor,\n                                variant: selectVariant,\n                                disabled: busy.value,\n                                onClick(e: Event) {\n                                    e.preventDefault();\n                                    if (isSelected) {\n                                        handlePolicySelect(null);\n                                    } else {\n                                        handlePolicySelect(slotProps.data.id);\n                                    }\n                                },\n                            }, { leading: () => h(VCIcon, { name: isSelected ? 'fa6-solid:check' : 'fa6-solid:plus' }) }),\n                        ]),\n                    ];\n                },\n            }),\n            h('div', { class: 'flex items-center justify-end gap-2' }, [\n                // Edit mode only: a quick \"reset policy\" shortcut (create stages, so no reset).\n                (!isCreateMode() && currentPolicyId.value) ?\n                    h(VCButton, {\n                        type: 'button',\n                        size: props.size,\n                        color: 'warning',\n                        label: translationReset.value,\n                        disabled: busy.value,\n                        onClick() {\n                            handlePolicySelect(null);\n                        },\n                    }) :\n                    undefined,\n                h(VCButton, {\n                    type: 'button',\n                    size: props.size,\n                    color: 'neutral',\n                    variant: 'soft',\n                    label: translationClose.value,\n                    onClick() {\n                        modalOpen.value = false;\n                    },\n                }),\n                // Create mode: commit the staged (scope, policy) as a new binding.\n                isCreateMode() ?\n                    h(VCButton, {\n                        type: 'button',\n                        size: props.size,\n                        color: 'primary',\n                        label: translationAdd.value,\n                        disabled: busy.value,\n                        onClick() {\n                            handleCreate();\n                        },\n                    }, { leading: () => h(VCIcon, { name: 'fa6-solid:plus' }) }) :\n                    undefined,\n            ]),\n        ];\n\n        const renderDetailContent = (policy: Policy) => [\n            h('div', { class: 'flex items-center justify-between gap-2' }, [\n                h(VCModalTitle, () => policy.name),\n                renderCloseIcon(),\n            ]),\n            h(APolicySummary, { entity: policy }),\n            h('div', { class: 'flex items-center justify-end gap-2' }, [\n                h(VCButton, {\n                    type: 'button',\n                    size: props.size,\n                    color: 'neutral',\n                    variant: 'outline',\n                    label: translationBack.value,\n                    onClick() {\n                        detailPolicy.value = null;\n                    },\n                }, { leading: () => h(VCIcon, { name: 'fa6-solid:arrow-left' }) }),\n            ]),\n        ];\n\n        return () => {\n            const createMode = isCreateMode();\n\n            let triggerColor: 'neutral' | 'primary' = 'neutral';\n            let triggerVariant: 'solid' | 'soft' = 'soft';\n            if (busy.value) {\n                triggerVariant = 'solid';\n            } else if (!createMode && currentPolicyId.value) {\n                // Edit mode with a bound policy → highlight the gear.\n                triggerColor = 'primary';\n                triggerVariant = 'solid';\n            }\n\n            // The trigger is icon-only, so give it a programmatic name that also conveys the mode\n            // (assign-with-options vs edit the binding) to assistive tech.\n            const triggerLabel = createMode ? translationAdd.value : translationJunctionPolicy.value;\n\n            return h('span', { class: 'inline-flex items-center' }, [\n                h(VCButton, {\n                    size: props.size,\n                    color: triggerColor,\n                    variant: triggerVariant,\n                    disabled: busy.value,\n                    'aria-label': triggerLabel,\n                    title: triggerLabel,\n                    onClick(e: Event) {\n                        e.preventDefault();\n                        modalOpen.value = true;\n                    },\n                    // Create mode → \"assign with options\" (sliders); edit mode → gear.\n                }, { leading: () => h(VCIcon, { name: createMode ? 'fa6-solid:sliders' : 'fa6-solid:gear' }) }),\n                h(VCModal, {\n                    open: modalOpen.value,\n                    'onUpdate:open': (value: boolean) => {\n                        modalOpen.value = value;\n                        // Closing the list also discards any open detail view —\n                        // the detail is a sibling VCModal, so clear its state on\n                        // the same close path to keep the two modals in sync.\n                        if (!value) {\n                            detailPolicy.value = null;\n                        }\n                    },\n                }, {\n                    default: () => (modalOpen.value ?\n                        h(VCModalContent, null, { default: () => renderListContent() }) :\n                        undefined),\n                }),\n                h(VCModal, {\n                    open: !!detailPolicy.value,\n                    'onUpdate:open': (value: boolean) => {\n                        if (!value) {\n                            detailPolicy.value = null;\n                        }\n                    },\n                }, {\n                    default: () => (detailPolicy.value ?\n                        h(VCModalContent, null, { default: () => renderDetailContent(detailPolicy.value as Policy) }) :\n                        undefined),\n                }),\n            ]);\n        };\n    },\n});\n","<!--\n  Copyright (c) 2022.\n  Author Peter Placzek (tada5hi)\n  For the full copyright and license information,\n  view the LICENSE file that was distributed with this source code.\n-->\n\n<script lang=\"ts\">\nimport { EntityType } from '@authup/core-kit';\nimport type { ClientPermission } from '@authup/core-kit';\nimport { computed, defineComponent } from 'vue';\nimport {\n    defineEntityManager,\n    defineEntityVEmitOptions,\n} from '../../utility';\nimport AToggleButton from '../../utility/toggle-button/AToggleButton.vue';\nimport { APermissionPolicyBindingButton } from '../permission-policy-binding';\n\nexport default defineComponent({\n    components: { AToggleButton, APermissionPolicyBindingButton },\n    props: {\n        clientId: { type: String, required: true },\n        permissionId: { type: String, required: true },\n    },\n    emits: defineEntityVEmitOptions<ClientPermission>(),\n    async setup(props, setup) {\n        const manager = defineEntityManager({\n            type: EntityType.CLIENT_PERMISSION,\n            setup,\n            query: () => ({\n                filters: {\n                    clientId: props.clientId,\n                    permissionId: props.permissionId,\n                },\n            }),\n            socket: {\n                processEvent(event) {\n                    return event.data.permissionId === props.permissionId &&\n                        event.data.clientId === props.clientId;\n                },\n            },\n        });\n\n        await manager.resolve({\n            query: {\n                filters: {\n                    clientId: props.clientId,\n                    permissionId: props.permissionId,\n                },\n            },\n        });\n\n        const handleChanged = (value: boolean) => {\n            if (value) {\n                return manager.create({\n                    clientId: props.clientId,\n                    permissionId: props.permissionId,\n                });\n            }\n\n            return manager.delete();\n        };\n\n        const handleCreated = (entity: ClientPermission) => {\n            manager.created(entity);\n        };\n\n        const handleUpdated = (entity: ClientPermission) => {\n            manager.updated(entity);\n        };\n\n        // The existing junction in edit mode, else a stable create template (FK base) carrying\n        // no id → the binding control treats it as create mode. Memoized so the template keeps a\n        // stable reference while unassigned.\n        const bindingEntity = computed<Partial<ClientPermission>>(() => manager.data.value || {\n            clientId: props.clientId,\n            permissionId: props.permissionId,\n        });\n\n        return {\n            manager,\n            handleChanged,\n            handleCreated,\n            handleUpdated,\n            bindingEntity,\n            EntityType,\n        };\n    },\n});\n</script>\n<template>\n    <span class=\"flex gap-1\">\n        <AToggleButton\n            :value=\"!!manager.data.value\"\n            :is-busy=\"manager.busy.value\"\n            :with-prompt=\"true\"\n            @changed=\"handleChanged\"\n        />\n        <APermissionPolicyBindingButton\n            :key=\"manager.data.value?.id || 'create'\"\n            :entity-type=\"EntityType.CLIENT_PERMISSION\"\n            :entity=\"bindingEntity\"\n            @created=\"handleCreated\"\n            @updated=\"handleUpdated\"\n        />\n    </span>\n</template>\n","<!--\n  Copyright (c) 2022.\n  Author Peter Placzek (tada5hi)\n  For the full copyright and license information,\n  view the LICENSE file that was distributed with this source code.\n-->\n\n<script lang=\"ts\">\nimport { EntityType } from '@authup/core-kit';\nimport type { ClientPermission } from '@authup/core-kit';\nimport { computed, defineComponent } from 'vue';\nimport {\n    defineEntityManager,\n    defineEntityVEmitOptions,\n} from '../../utility';\nimport AToggleButton from '../../utility/toggle-button/AToggleButton.vue';\nimport { APermissionPolicyBindingButton } from '../permission-policy-binding';\n\nexport default defineComponent({\n    components: { AToggleButton, APermissionPolicyBindingButton },\n    props: {\n        clientId: { type: String, required: true },\n        permissionId: { type: String, required: true },\n    },\n    emits: defineEntityVEmitOptions<ClientPermission>(),\n    async setup(props, setup) {\n        const manager = defineEntityManager({\n            type: EntityType.CLIENT_PERMISSION,\n            setup,\n            query: () => ({\n                filters: {\n                    clientId: props.clientId,\n                    permissionId: props.permissionId,\n                },\n            }),\n            socket: {\n                processEvent(event) {\n                    return event.data.permissionId === props.permissionId &&\n                        event.data.clientId === props.clientId;\n                },\n            },\n        });\n\n        await manager.resolve({\n            query: {\n                filters: {\n                    clientId: props.clientId,\n                    permissionId: props.permissionId,\n                },\n            },\n        });\n\n        const handleChanged = (value: boolean) => {\n            if (value) {\n                return manager.create({\n                    clientId: props.clientId,\n                    permissionId: props.permissionId,\n                });\n            }\n\n            return manager.delete();\n        };\n\n        const handleCreated = (entity: ClientPermission) => {\n            manager.created(entity);\n        };\n\n        const handleUpdated = (entity: ClientPermission) => {\n            manager.updated(entity);\n        };\n\n        // The existing junction in edit mode, else a stable create template (FK base) carrying\n        // no id → the binding control treats it as create mode. Memoized so the template keeps a\n        // stable reference while unassigned.\n        const bindingEntity = computed<Partial<ClientPermission>>(() => manager.data.value || {\n            clientId: props.clientId,\n            permissionId: props.permissionId,\n        });\n\n        return {\n            manager,\n            handleChanged,\n            handleCreated,\n            handleUpdated,\n            bindingEntity,\n            EntityType,\n        };\n    },\n});\n</script>\n<template>\n    <span class=\"flex gap-1\">\n        <AToggleButton\n            :value=\"!!manager.data.value\"\n            :is-busy=\"manager.busy.value\"\n            :with-prompt=\"true\"\n            @changed=\"handleChanged\"\n        />\n        <APermissionPolicyBindingButton\n            :key=\"manager.data.value?.id || 'create'\"\n            :entity-type=\"EntityType.CLIENT_PERMISSION\"\n            :entity=\"bindingEntity\"\n            @created=\"handleCreated\"\n            @updated=\"handleUpdated\"\n        />\n    </span>\n</template>\n","<!--\n  Copyright (c) 2022.\n  Author Peter Placzek (tada5hi)\n  For the full copyright and license information,\n  view the LICENSE file that was distributed with this source code.\n-->\n\n<script lang=\"ts\">\nimport { computed, defineComponent } from 'vue';\nimport { APermissions } from '../permission';\nimport AClientPermissionAssignment from './AClientPermissionAssignment.vue';\n\nexport default defineComponent({\n    components: { APermissions, AClientPermissionAssignment },\n    props: {\n        entityId: {\n            type: String,\n            required: true,\n        },\n    },\n    setup(props, { slots }) {\n        const forwardedSlots = computed(() => Object.fromEntries(Object.entries(slots).filter(([name]) => name !== 'itemActions')));\n        return { forwardedSlots };\n    },\n});\n</script>\n<template>\n    <APermissions>\n        <template #itemActions=\"{ data }\">\n            <AClientPermissionAssignment\n                :key=\"data.id\"\n                :client-id=\"entityId\"\n                :permission-id=\"data.id\"\n            />\n        </template>\n        <template\n            v-for=\"(_, name) in forwardedSlots\"\n            :key=\"name\"\n            #[name]=\"slotData\"\n        >\n            <slot\n                :name=\"name\"\n                v-bind=\"slotData ?? {}\"\n            />\n        </template>\n    </APermissions>\n</template>\n","<!--\n  Copyright (c) 2022.\n  Author Peter Placzek (tada5hi)\n  For the full copyright and license information,\n  view the LICENSE file that was distributed with this source code.\n-->\n\n<script lang=\"ts\">\nimport { computed, defineComponent } from 'vue';\nimport { APermissions } from '../permission';\nimport AClientPermissionAssignment from './AClientPermissionAssignment.vue';\n\nexport default defineComponent({\n    components: { APermissions, AClientPermissionAssignment },\n    props: {\n        entityId: {\n            type: String,\n            required: true,\n        },\n    },\n    setup(props, { slots }) {\n        const forwardedSlots = computed(() => Object.fromEntries(Object.entries(slots).filter(([name]) => name !== 'itemActions')));\n        return { forwardedSlots };\n    },\n});\n</script>\n<template>\n    <APermissions>\n        <template #itemActions=\"{ data }\">\n            <AClientPermissionAssignment\n                :key=\"data.id\"\n                :client-id=\"entityId\"\n                :permission-id=\"data.id\"\n            />\n        </template>\n        <template\n            v-for=\"(_, name) in forwardedSlots\"\n            :key=\"name\"\n            #[name]=\"slotData\"\n        >\n            <slot\n                :name=\"name\"\n                v-bind=\"slotData ?? {}\"\n            />\n        </template>\n    </APermissions>\n</template>\n","<!--\n  - Copyright (c) 2022-2026.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\nimport { EntityType, RoleValidator } from '@authup/core-kit';\nimport { ValidatorGroup, generateName } from '@authup/kit';\nimport { useValidup } from '@validup/vue';\nimport { TranslatorTranslationEntityKey, TranslatorTranslationFieldKey, TranslatorTranslationNamespace } from '@authup/i18n';\nimport { \n    assignFormProperties, \n    injectStore, \n    storeToRefs, \n    useTranslations, \n} from '../../../core';\nimport type { PropType } from 'vue';\nimport {\n    computed,\n    defineComponent,\n    reactive,\n    ref,\n    useId,\n    watch,\n} from 'vue';\nimport type { Role } from '@authup/core-kit';\nimport { VCFormGroup, VCFormInput, VCFormTextarea } from '@vuecs/forms';\nimport { useIsEditing, useUpdatedAt } from '../../../composables';\nimport {\n    AFormSubmit,\n    ANameInput,\n    defineEntityManager,\n    defineEntityVEmitOptions,\n} from '../../utility';\nimport { ARealmPicker } from '../realm';\nimport { IFieldValidation } from '@ilingo/validup-vue';\n\nexport default defineComponent({\n    components: {\n        ANameInput,\n        ARealmPicker,\n        AFormSubmit,\n        VCFormGroup,\n        VCFormInput,\n        VCFormTextarea,\n\n        IFieldValidation,\n    },\n    props: {\n        entity: {\n            type: Object as PropType<Role>,\n            default: undefined,\n        },\n        realmId: {\n            type: String,\n            default: undefined,\n        },\n    },\n    emits: defineEntityVEmitOptions<Role>(),\n    setup(props, ctx) {\n        const busy = ref(false);\n        const nameSeed = useId();\n        const form = reactive({\n            name: '',\n            displayName: '',\n            description: '',\n            realmId: '',\n        });\n\n        const manager = defineEntityManager({\n            type: EntityType.ROLE,\n            setup: ctx,\n            props,\n        });\n\n        const isEditing = useIsEditing(manager.data);\n\n        // Shared `RoleValidator` from `@authup/core-kit` — same instance\n        // the server-core provisioning service runs. `group` is reactive\n        // so the validator switches between `CREATE` (strict) and\n        // `UPDATE` (every field optional) when the form flips between\n        // create and edit modes.\n        const v = useValidup(\n            new RoleValidator(),\n            form,\n            { group: computed(() => (isEditing.value ? ValidatorGroup.UPDATE : ValidatorGroup.CREATE)) },\n        );\n\n        const store = injectStore();\n        const storeRefs = storeToRefs(store);\n\n        const realmLock = computed(() => {\n            // realm-management context passed by the page wins\n            if (props.realmId) {\n                return props.realmId;\n            }\n\n            if (!storeRefs.realmIsRoot.value) {\n                return storeRefs.realmId.value;\n            }\n\n            return manager.data.value ?\n                manager.data.value.realmId :\n                null;\n        });\n\n        const updatedAt = useUpdatedAt(() => props.entity);\n\n        function initForm() {\n            assignFormProperties(form, manager.data.value, { fields: v.fields });\n\n            // locked-realm prop wins over any realmId pulled from the entity\n            if (props.realmId) {\n                form.realmId = props.realmId;\n            }\n\n            if (form.name.length === 0) {\n                form.name = generateName(nameSeed);\n            }\n        }\n\n        watch(updatedAt, (val, oldVal) => {\n            if (!val || val === oldVal) {\n                return;\n            }\n\n            manager.data.value = props.entity;\n            initForm();\n        });\n\n        initForm();\n\n        const submit = async () => {\n            if (v.$invalid.value) {\n                return;\n            }\n\n            await manager.createOrUpdate(form);\n        };\n\n        const translationsDefault = useTranslations(\n            [\n                {\n                    namespace: TranslatorTranslationNamespace.FIELD, \n                    key: TranslatorTranslationFieldKey.NAME, \n                },\n                {\n                    namespace: TranslatorTranslationNamespace.FIELD, \n                    key: TranslatorTranslationFieldKey.DISPLAY_NAME, \n                },\n                {\n                    namespace: TranslatorTranslationNamespace.FIELD, \n                    key: TranslatorTranslationFieldKey.DESCRIPTION, \n                },\n                {\n                    namespace: TranslatorTranslationNamespace.ENTITY, \n                    key: TranslatorTranslationEntityKey.REALM, \n                    count: 1, \n                },\n            ],\n        );\n\n        return {\n            busy,\n            v,\n            isEditing,\n            realmLock,\n            translationsDefault,\n            submit,\n        };\n    },\n});\n\n</script>\n\n<template>\n    <form @submit.prevent=\"submit\">\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"v.fields.name\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translationsDefault.name }}\n                </template>\n                <ANameInput v-model=\"v.fields.name.$model.value\" />\n            </VCFormGroup>\n        </IFieldValidation>\n\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"v.fields.displayName\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translationsDefault.displayName }}\n                </template>\n                <VCFormInput\n                    :model-value=\"v.fields.displayName.$model.value ?? ''\"\n                    @update:model-value=\"(next: string) => { v.fields.displayName.$model.value = next; }\"\n                />\n            </VCFormGroup>\n        </IFieldValidation>\n\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"v.fields.description\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translationsDefault.description }}\n                </template>\n                <VCFormTextarea\n                    :model-value=\"v.fields.description.$model.value ?? ''\"\n                    :rows=\"6\"\n                    @update:model-value=\"(next: string) => { v.fields.description.$model.value = next; }\"\n                />\n            </VCFormGroup>\n        </IFieldValidation>\n\n        <template v-if=\"!realmLock && !isEditing\">\n            <IFieldValidation\n                v-slot=\"{ value }\"\n                :field=\"v.fields.realmId\"\n            >\n                <VCFormGroup :validation=\"value\">\n                    <template #label>\n                        {{ translationsDefault.realm }}\n                    </template>\n                    <ARealmPicker\n                        :value=\"v.fields.realmId.$model.value\"\n                        @change=\"(input: string[]) => {\n                            v.fields.realmId.$model.value = input.length > 0 ? input[0] ?? '' : '';\n                        }\"\n                    />\n                </VCFormGroup>\n            </IFieldValidation>\n        </template>\n\n        <AFormSubmit\n            :is-busy=\"busy\"\n            :is-editing=\"isEditing\"\n            :is-invalid=\"v.$invalid.value\"\n            @submit=\"submit\"\n        />\n    </form>\n</template>\n","<!--\n  - Copyright (c) 2022-2026.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\nimport { EntityType, RoleValidator } from '@authup/core-kit';\nimport { ValidatorGroup, generateName } from '@authup/kit';\nimport { useValidup } from '@validup/vue';\nimport { TranslatorTranslationEntityKey, TranslatorTranslationFieldKey, TranslatorTranslationNamespace } from '@authup/i18n';\nimport { \n    assignFormProperties, \n    injectStore, \n    storeToRefs, \n    useTranslations, \n} from '../../../core';\nimport type { PropType } from 'vue';\nimport {\n    computed,\n    defineComponent,\n    reactive,\n    ref,\n    useId,\n    watch,\n} from 'vue';\nimport type { Role } from '@authup/core-kit';\nimport { VCFormGroup, VCFormInput, VCFormTextarea } from '@vuecs/forms';\nimport { useIsEditing, useUpdatedAt } from '../../../composables';\nimport {\n    AFormSubmit,\n    ANameInput,\n    defineEntityManager,\n    defineEntityVEmitOptions,\n} from '../../utility';\nimport { ARealmPicker } from '../realm';\nimport { IFieldValidation } from '@ilingo/validup-vue';\n\nexport default defineComponent({\n    components: {\n        ANameInput,\n        ARealmPicker,\n        AFormSubmit,\n        VCFormGroup,\n        VCFormInput,\n        VCFormTextarea,\n\n        IFieldValidation,\n    },\n    props: {\n        entity: {\n            type: Object as PropType<Role>,\n            default: undefined,\n        },\n        realmId: {\n            type: String,\n            default: undefined,\n        },\n    },\n    emits: defineEntityVEmitOptions<Role>(),\n    setup(props, ctx) {\n        const busy = ref(false);\n        const nameSeed = useId();\n        const form = reactive({\n            name: '',\n            displayName: '',\n            description: '',\n            realmId: '',\n        });\n\n        const manager = defineEntityManager({\n            type: EntityType.ROLE,\n            setup: ctx,\n            props,\n        });\n\n        const isEditing = useIsEditing(manager.data);\n\n        // Shared `RoleValidator` from `@authup/core-kit` — same instance\n        // the server-core provisioning service runs. `group` is reactive\n        // so the validator switches between `CREATE` (strict) and\n        // `UPDATE` (every field optional) when the form flips between\n        // create and edit modes.\n        const v = useValidup(\n            new RoleValidator(),\n            form,\n            { group: computed(() => (isEditing.value ? ValidatorGroup.UPDATE : ValidatorGroup.CREATE)) },\n        );\n\n        const store = injectStore();\n        const storeRefs = storeToRefs(store);\n\n        const realmLock = computed(() => {\n            // realm-management context passed by the page wins\n            if (props.realmId) {\n                return props.realmId;\n            }\n\n            if (!storeRefs.realmIsRoot.value) {\n                return storeRefs.realmId.value;\n            }\n\n            return manager.data.value ?\n                manager.data.value.realmId :\n                null;\n        });\n\n        const updatedAt = useUpdatedAt(() => props.entity);\n\n        function initForm() {\n            assignFormProperties(form, manager.data.value, { fields: v.fields });\n\n            // locked-realm prop wins over any realmId pulled from the entity\n            if (props.realmId) {\n                form.realmId = props.realmId;\n            }\n\n            if (form.name.length === 0) {\n                form.name = generateName(nameSeed);\n            }\n        }\n\n        watch(updatedAt, (val, oldVal) => {\n            if (!val || val === oldVal) {\n                return;\n            }\n\n            manager.data.value = props.entity;\n            initForm();\n        });\n\n        initForm();\n\n        const submit = async () => {\n            if (v.$invalid.value) {\n                return;\n            }\n\n            await manager.createOrUpdate(form);\n        };\n\n        const translationsDefault = useTranslations(\n            [\n                {\n                    namespace: TranslatorTranslationNamespace.FIELD, \n                    key: TranslatorTranslationFieldKey.NAME, \n                },\n                {\n                    namespace: TranslatorTranslationNamespace.FIELD, \n                    key: TranslatorTranslationFieldKey.DISPLAY_NAME, \n                },\n                {\n                    namespace: TranslatorTranslationNamespace.FIELD, \n                    key: TranslatorTranslationFieldKey.DESCRIPTION, \n                },\n                {\n                    namespace: TranslatorTranslationNamespace.ENTITY, \n                    key: TranslatorTranslationEntityKey.REALM, \n                    count: 1, \n                },\n            ],\n        );\n\n        return {\n            busy,\n            v,\n            isEditing,\n            realmLock,\n            translationsDefault,\n            submit,\n        };\n    },\n});\n\n</script>\n\n<template>\n    <form @submit.prevent=\"submit\">\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"v.fields.name\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translationsDefault.name }}\n                </template>\n                <ANameInput v-model=\"v.fields.name.$model.value\" />\n            </VCFormGroup>\n        </IFieldValidation>\n\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"v.fields.displayName\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translationsDefault.displayName }}\n                </template>\n                <VCFormInput\n                    :model-value=\"v.fields.displayName.$model.value ?? ''\"\n                    @update:model-value=\"(next: string) => { v.fields.displayName.$model.value = next; }\"\n                />\n            </VCFormGroup>\n        </IFieldValidation>\n\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"v.fields.description\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translationsDefault.description }}\n                </template>\n                <VCFormTextarea\n                    :model-value=\"v.fields.description.$model.value ?? ''\"\n                    :rows=\"6\"\n                    @update:model-value=\"(next: string) => { v.fields.description.$model.value = next; }\"\n                />\n            </VCFormGroup>\n        </IFieldValidation>\n\n        <template v-if=\"!realmLock && !isEditing\">\n            <IFieldValidation\n                v-slot=\"{ value }\"\n                :field=\"v.fields.realmId\"\n            >\n                <VCFormGroup :validation=\"value\">\n                    <template #label>\n                        {{ translationsDefault.realm }}\n                    </template>\n                    <ARealmPicker\n                        :value=\"v.fields.realmId.$model.value\"\n                        @change=\"(input: string[]) => {\n                            v.fields.realmId.$model.value = input.length > 0 ? input[0] ?? '' : '';\n                        }\"\n                    />\n                </VCFormGroup>\n            </IFieldValidation>\n        </template>\n\n        <AFormSubmit\n            :is-busy=\"busy\"\n            :is-editing=\"isEditing\"\n            :is-invalid=\"v.$invalid.value\"\n            @submit=\"submit\"\n        />\n    </form>\n</template>\n","/*\n * Copyright (c) 2022.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { EntityType } from '@authup/core-kit';\nimport type { SlotsType } from 'vue';\nimport { defineComponent } from 'vue';\nimport type { Role } from '@authup/core-kit';\nimport type { EntityCollectionVSlots } from '../../utility';\nimport {\n    defineEntityCollectionManager,\n    defineEntityCollectionVEmitOptions,\n    defineEntityCollectionVProps,\n} from '../../utility';\nimport { TranslatorTranslationEntityKey, TranslatorTranslationNamespace, TranslatorTranslationVuecsKey } from '@authup/i18n';\nimport { useTranslation } from '../../../core';\n\nexport const ARoles = defineComponent({\n    props: defineEntityCollectionVProps<Role>(),\n    emits: defineEntityCollectionVEmitOptions<Role>(),\n    slots: Object as SlotsType<EntityCollectionVSlots<Role>>,\n    setup(props, ctx) {\n        const { render } = defineEntityCollectionManager({\n            type: `${EntityType.ROLE}`,\n            props,\n            setup: ctx,\n        });\n\n        const translationName = useTranslation({\n            namespace: TranslatorTranslationNamespace.ENTITY,\n            key: TranslatorTranslationEntityKey.ROLE,\n            count: 2,\n        });\n\n        const translation = useTranslation({\n            namespace: TranslatorTranslationNamespace.VUECS,\n            key: TranslatorTranslationVuecsKey.NO_MORE,\n            data: { name: translationName },\n        });\n\n        return () => render({ noMore: { content: translation.value } });\n    },\n});\n\nexport default ARoles;\n","/*\n * Copyright (c) 2023.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { EntityType } from '@authup/core-kit';\nimport type { Role } from '@authup/core-kit';\nimport type { SlotsType } from 'vue';\nimport { defineComponent } from 'vue';\nimport type { EntityVSlots } from '../../utility';\nimport {\n    defineEntityManager,\n    defineEntityVEmitOptions,\n    defineEntityVProps,\n} from '../../utility';\n\nexport const ARole = defineComponent({\n    props: defineEntityVProps<Role>(),\n    emits: defineEntityVEmitOptions<Role>(),\n    slots: Object as SlotsType<EntityVSlots<Role>>,\n    async setup(props, setup) {\n        const manager = defineEntityManager({\n            type: `${EntityType.ROLE}`,\n            props,\n            setup,\n        });\n\n        try {\n            await manager.resolveOrFail();\n\n            return () => manager.render();\n        } catch (e) {\n            return () => manager.renderError(e);\n        }\n    },\n});\n","<!--\n  Copyright (c) 2022.\n  Author Peter Placzek (tada5hi)\n  For the full copyright and license information,\n  view the LICENSE file that was distributed with this source code.\n-->\n\n<script lang=\"ts\">\nimport { EntityType } from '@authup/core-kit';\nimport type { ClientRole } from '@authup/core-kit';\nimport { defineComponent } from 'vue';\nimport {\n    defineEntityManager,\n    defineEntityVEmitOptions,\n} from '../../utility';\nimport AToggleButton from '../../utility/toggle-button/AToggleButton.vue';\n\nexport default defineComponent({\n    components: { AToggleButton },\n    props: {\n        roleId: { type: String, required: true },\n        clientId: { type: String, required: true },\n    },\n    emits: defineEntityVEmitOptions<ClientRole>(),\n    async setup(props, setup) {\n        const manager = defineEntityManager({\n            type: EntityType.CLIENT_ROLE,\n            setup,\n            query: () => ({\n                filters: {\n                    clientId: props.clientId,\n                    roleId: props.roleId,\n                },\n            }),\n            socket: {\n                processEvent(event) {\n                    return event.data.clientId === props.clientId &&\n                        event.data.roleId === props.roleId;\n                },\n            },\n        });\n\n        await manager.resolve({\n            query: {\n                filters: {\n                    clientId: props.clientId,\n                    roleId: props.roleId,\n                },\n            },\n        });\n\n        const handleChanged = (value: boolean) => {\n            if (value) {\n                return manager.create({\n                    clientId: props.clientId,\n                    roleId: props.roleId,\n                });\n            }\n\n            return manager.delete();\n        };\n\n        return {\n            manager,\n            handleChanged,\n        };\n    },\n});\n</script>\n<template>\n    <AToggleButton\n        :value=\"!!manager.data.value\"\n        :is-busy=\"manager.busy.value\"\n        :with-prompt=\"true\"\n        @changed=\"handleChanged\"\n    />\n</template>\n","<!--\n  Copyright (c) 2022.\n  Author Peter Placzek (tada5hi)\n  For the full copyright and license information,\n  view the LICENSE file that was distributed with this source code.\n-->\n\n<script lang=\"ts\">\nimport { EntityType } from '@authup/core-kit';\nimport type { ClientRole } from '@authup/core-kit';\nimport { defineComponent } from 'vue';\nimport {\n    defineEntityManager,\n    defineEntityVEmitOptions,\n} from '../../utility';\nimport AToggleButton from '../../utility/toggle-button/AToggleButton.vue';\n\nexport default defineComponent({\n    components: { AToggleButton },\n    props: {\n        roleId: { type: String, required: true },\n        clientId: { type: String, required: true },\n    },\n    emits: defineEntityVEmitOptions<ClientRole>(),\n    async setup(props, setup) {\n        const manager = defineEntityManager({\n            type: EntityType.CLIENT_ROLE,\n            setup,\n            query: () => ({\n                filters: {\n                    clientId: props.clientId,\n                    roleId: props.roleId,\n                },\n            }),\n            socket: {\n                processEvent(event) {\n                    return event.data.clientId === props.clientId &&\n                        event.data.roleId === props.roleId;\n                },\n            },\n        });\n\n        await manager.resolve({\n            query: {\n                filters: {\n                    clientId: props.clientId,\n                    roleId: props.roleId,\n                },\n            },\n        });\n\n        const handleChanged = (value: boolean) => {\n            if (value) {\n                return manager.create({\n                    clientId: props.clientId,\n                    roleId: props.roleId,\n                });\n            }\n\n            return manager.delete();\n        };\n\n        return {\n            manager,\n            handleChanged,\n        };\n    },\n});\n</script>\n<template>\n    <AToggleButton\n        :value=\"!!manager.data.value\"\n        :is-busy=\"manager.busy.value\"\n        :with-prompt=\"true\"\n        @changed=\"handleChanged\"\n    />\n</template>\n","<!--\n  Copyright (c) 2022.\n  Author Peter Placzek (tada5hi)\n  For the full copyright and license information,\n  view the LICENSE file that was distributed with this source code.\n-->\n\n<script lang=\"ts\">\nimport type { Role } from '@authup/core-kit';\nimport { defineQuery } from '@rapiq/core';\nimport { computed, defineComponent } from 'vue';\nimport { ARoles } from '../role';\nimport AClientRoleAssignment from './AClientRoleAssignment.vue';\n\nexport default defineComponent({\n    components: { ARoles, AClientRoleAssignment },\n    props: {\n        entityId: { type: String, required: true },\n        realmId: String,\n    },\n    setup(props, { slots }) {\n        const query = computed(() => defineQuery<Role>({ filters: { realmId: [...(props.realmId ? [props.realmId] : []), null] } }));\n        const forwardedSlots = computed(() => Object.fromEntries(Object.entries(slots).filter(([name]) => name !== 'itemActions')));\n\n        return { query, forwardedSlots };\n    },\n});\n</script>\n<template>\n    <ARoles :query=\"query\">\n        <template #itemActions=\"{ data }\">\n            <AClientRoleAssignment\n                :key=\"data.id\"\n                :client-id=\"entityId\"\n                :role-id=\"data.id\"\n            />\n        </template>\n        <template\n            v-for=\"(_, name) in forwardedSlots\"\n            :key=\"name\"\n            #[name]=\"slotData\"\n        >\n            <slot\n                :name=\"name\"\n                v-bind=\"slotData ?? {}\"\n            />\n        </template>\n    </ARoles>\n</template>\n","<!--\n  Copyright (c) 2022.\n  Author Peter Placzek (tada5hi)\n  For the full copyright and license information,\n  view the LICENSE file that was distributed with this source code.\n-->\n\n<script lang=\"ts\">\nimport type { Role } from '@authup/core-kit';\nimport { defineQuery } from '@rapiq/core';\nimport { computed, defineComponent } from 'vue';\nimport { ARoles } from '../role';\nimport AClientRoleAssignment from './AClientRoleAssignment.vue';\n\nexport default defineComponent({\n    components: { ARoles, AClientRoleAssignment },\n    props: {\n        entityId: { type: String, required: true },\n        realmId: String,\n    },\n    setup(props, { slots }) {\n        const query = computed(() => defineQuery<Role>({ filters: { realmId: [...(props.realmId ? [props.realmId] : []), null] } }));\n        const forwardedSlots = computed(() => Object.fromEntries(Object.entries(slots).filter(([name]) => name !== 'itemActions')));\n\n        return { query, forwardedSlots };\n    },\n});\n</script>\n<template>\n    <ARoles :query=\"query\">\n        <template #itemActions=\"{ data }\">\n            <AClientRoleAssignment\n                :key=\"data.id\"\n                :client-id=\"entityId\"\n                :role-id=\"data.id\"\n            />\n        </template>\n        <template\n            v-for=\"(_, name) in forwardedSlots\"\n            :key=\"name\"\n            #[name]=\"slotData\"\n        >\n            <slot\n                :name=\"name\"\n                v-bind=\"slotData ?? {}\"\n            />\n        </template>\n    </ARoles>\n</template>\n","/*\n * Copyright (c) 2023.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { EntityType } from '@authup/core-kit';\nimport type { ClientScope } from '@authup/core-kit';\nimport type { SlotsType } from 'vue';\nimport { defineComponent } from 'vue';\nimport type { EntityVSlots } from '../../utility';\nimport {\n    defineEntityManager,\n    defineEntityVEmitOptions,\n    defineEntityVProps,\n} from '../../utility';\n\nexport const AClientScope = defineComponent({\n    props: defineEntityVProps<ClientScope>(),\n    emits: defineEntityVEmitOptions<ClientScope>(),\n    slots: Object as SlotsType<EntityVSlots<ClientScope>>,\n    async setup(props, setup) {\n        const manager = defineEntityManager({\n            type: `${EntityType.CLIENT_SCOPE}`,\n            props,\n            setup,\n        });\n\n        try {\n            await manager.resolveOrFail();\n\n            return () => manager.render();\n        } catch (e) {\n            return () => manager.renderError(e);\n        }\n    },\n});\n","/*\n * Copyright (c) 2022.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { EntityType } from '@authup/core-kit';\nimport type { SlotsType } from 'vue';\nimport { defineComponent } from 'vue';\nimport type { ClientScope } from '@authup/core-kit';\nimport type { EntityCollectionVSlots } from '../../utility';\nimport { TranslatorTranslationFieldKey, TranslatorTranslationNamespace, TranslatorTranslationVuecsKey } from '@authup/i18n';\nimport { useTranslation } from '../../../core';\nimport {\n    defineEntityCollectionManager,\n    defineEntityCollectionVEmitOptions,\n    defineEntityCollectionVProps,\n} from '../../utility';\n\nexport const AClientScopes = defineComponent({\n    props: defineEntityCollectionVProps<ClientScope>(),\n    emits: defineEntityCollectionVEmitOptions<ClientScope>(),\n    slots: Object as SlotsType<EntityCollectionVSlots<ClientScope>>,\n    setup(props, ctx) {\n        const { render } = defineEntityCollectionManager({\n            type: `${EntityType.CLIENT_SCOPE}`,\n            props,\n            setup: ctx,\n        });\n\n        const translationClientScopes = useTranslation({\n            namespace: TranslatorTranslationNamespace.FIELD,\n            key: TranslatorTranslationFieldKey.CLIENT_SCOPES,\n        });\n\n        const translation = useTranslation({\n            namespace: TranslatorTranslationNamespace.VUECS,\n            key: TranslatorTranslationVuecsKey.NO_MORE,\n            data: { name: translationClientScopes },\n        });\n\n        return () => render({ noMore: { content: translation.value } });\n    },\n});\n\nexport default AClientScopes;\n","<!--\n  - Copyright (c) 2022-2026.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\nimport { EntityType, ScopeValidator } from '@authup/core-kit';\nimport { ValidatorGroup, generateName } from '@authup/kit';\nimport { useValidup } from '@validup/vue';\nimport { TranslatorTranslationEntityKey, TranslatorTranslationFieldKey, TranslatorTranslationNamespace } from '@authup/i18n';\nimport { \n    assignFormProperties, \n    injectStore, \n    storeToRefs, \n    useTranslations, \n} from '../../../core';\nimport type { PropType } from 'vue';\nimport {\n    computed,\n    defineComponent,\n    reactive,\n    ref,\n    useId,\n    watch,\n} from 'vue';\nimport type { Scope } from '@authup/core-kit';\nimport { VCFormGroup, VCFormInput, VCFormTextarea } from '@vuecs/forms';\nimport { useIsEditing, useUpdatedAt } from '../../../composables';\nimport {\n    AFormSubmit,\n    ANameInput,\n    defineEntityManager,\n    defineEntityVEmitOptions,\n} from '../../utility';\nimport { ARealmPicker } from '../realm';\nimport { IFieldValidation } from '@ilingo/validup-vue';\n\nexport default defineComponent({\n    components: {\n        ANameInput,\n        ARealmPicker,\n        AFormSubmit,\n        VCFormGroup,\n        VCFormInput,\n        VCFormTextarea,\n\n        IFieldValidation,\n    },\n    props: {\n        name: {\n            type: String,\n            default: undefined,\n        },\n        entity: { type: Object as PropType<Scope> },\n        realmId: {\n            type: String,\n            default: undefined,\n        },\n    },\n    emits: defineEntityVEmitOptions<Scope>(),\n    setup(props, ctx) {\n        const busy = ref(false);\n        const nameSeed = useId();\n        const form = reactive({\n            name: '',\n            displayName: '',\n            description: '',\n            realmId: '',\n        });\n\n        const manager = defineEntityManager({\n            type: EntityType.SCOPE,\n            setup: ctx,\n            props,\n        });\n\n        const isEditing = useIsEditing(manager.data);\n\n        const v = useValidup(\n            new ScopeValidator(),\n            form,\n            { group: computed(() => (isEditing.value ? ValidatorGroup.UPDATE : ValidatorGroup.CREATE)) },\n        );\n\n        const store = injectStore();\n        const storeRefs = storeToRefs(store);\n\n        const realmLock = computed(() => {\n            // realm-management context passed by the page wins\n            if (props.realmId) {\n                return props.realmId;\n            }\n\n            if (!storeRefs.realmIsRoot.value) {\n                return storeRefs.realmId.value;\n            }\n\n            return manager.data.value ?\n                manager.data.value.realmId :\n                null;\n        });\n\n        const updatedAt = useUpdatedAt(() => props.entity);\n\n        const isNameFixed = computed<boolean>(() => {\n            if (!!props.name && props.name.length > 0) {\n                return true;\n            }\n\n            return !!(manager.data.value && manager.data.value.builtIn);\n        });\n\n        function initForm() {\n            if (props.name) {\n                form.name = props.name;\n            }\n\n            assignFormProperties(form, manager.data.value, { fields: v.fields });\n\n            // locked-realm prop wins over any realmId pulled from the entity\n            if (props.realmId) {\n                form.realmId = props.realmId;\n            }\n\n            if (form.name.length === 0) {\n                form.name = generateName(nameSeed);\n            }\n        }\n\n        watch(updatedAt, (val, oldVal) => {\n            if (!val || val === oldVal) {\n                return;\n            }\n\n            manager.data.value = props.entity;\n            initForm();\n        });\n\n        initForm();\n\n        const submit = async () => {\n            if (v.$invalid.value) {\n                return;\n            }\n\n            await manager.createOrUpdate(form);\n        };\n\n        const translationsDefault = useTranslations(\n            [\n                {\n                    namespace: TranslatorTranslationNamespace.FIELD, \n                    key: TranslatorTranslationFieldKey.NAME, \n                },\n                {\n                    namespace: TranslatorTranslationNamespace.FIELD, \n                    key: TranslatorTranslationFieldKey.DISPLAY_NAME, \n                },\n                {\n                    namespace: TranslatorTranslationNamespace.FIELD, \n                    key: TranslatorTranslationFieldKey.DESCRIPTION, \n                },\n                {\n                    namespace: TranslatorTranslationNamespace.ENTITY, \n                    key: TranslatorTranslationEntityKey.REALM, \n                    count: 1, \n                },\n            ],\n        );\n\n        return {\n            busy,\n            v,\n            isEditing,\n            realmLock,\n            isNameFixed,\n            translationsDefault,\n            submit,\n        };\n    },\n});\n\n</script>\n\n<template>\n    <form @submit.prevent=\"submit\">\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"v.fields.name\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translationsDefault.name }}\n                </template>\n                <ANameInput\n                    v-model=\"v.fields.name.$model.value\"\n                    :disabled=\"isNameFixed\"\n                />\n            </VCFormGroup>\n        </IFieldValidation>\n\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"v.fields.displayName\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translationsDefault.displayName }}\n                </template>\n                <VCFormInput\n                    :model-value=\"v.fields.displayName.$model.value ?? ''\"\n                    @update:model-value=\"(next: string) => { v.fields.displayName.$model.value = next; }\"\n                />\n            </VCFormGroup>\n        </IFieldValidation>\n\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"v.fields.description\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translationsDefault.description }}\n                </template>\n                <VCFormTextarea\n                    :model-value=\"v.fields.description.$model.value ?? ''\"\n                    :rows=\"7\"\n                    @update:model-value=\"(next: string) => { v.fields.description.$model.value = next; }\"\n                />\n            </VCFormGroup>\n        </IFieldValidation>\n\n        <template v-if=\"!realmLock && !isNameFixed && !isEditing\">\n            <IFieldValidation\n                v-slot=\"{ value }\"\n                :field=\"v.fields.realmId\"\n            >\n                <VCFormGroup :validation=\"value\">\n                    <template #label>\n                        {{ translationsDefault.realm }}\n                    </template>\n                    <ARealmPicker\n                        :value=\"v.fields.realmId.$model.value\"\n                        @change=\"(input: string[]) => {\n                            v.fields.realmId.$model.value = input.length > 0 ? input[0] ?? '' : '';\n                        }\"\n                    />\n                </VCFormGroup>\n            </IFieldValidation>\n        </template>\n\n        <AFormSubmit\n            :is-busy=\"busy\"\n            :is-editing=\"isEditing\"\n            :is-invalid=\"v.$invalid.value\"\n            @submit=\"submit\"\n        />\n    </form>\n</template>\n","<!--\n  - Copyright (c) 2022-2026.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\nimport { EntityType, ScopeValidator } from '@authup/core-kit';\nimport { ValidatorGroup, generateName } from '@authup/kit';\nimport { useValidup } from '@validup/vue';\nimport { TranslatorTranslationEntityKey, TranslatorTranslationFieldKey, TranslatorTranslationNamespace } from '@authup/i18n';\nimport { \n    assignFormProperties, \n    injectStore, \n    storeToRefs, \n    useTranslations, \n} from '../../../core';\nimport type { PropType } from 'vue';\nimport {\n    computed,\n    defineComponent,\n    reactive,\n    ref,\n    useId,\n    watch,\n} from 'vue';\nimport type { Scope } from '@authup/core-kit';\nimport { VCFormGroup, VCFormInput, VCFormTextarea } from '@vuecs/forms';\nimport { useIsEditing, useUpdatedAt } from '../../../composables';\nimport {\n    AFormSubmit,\n    ANameInput,\n    defineEntityManager,\n    defineEntityVEmitOptions,\n} from '../../utility';\nimport { ARealmPicker } from '../realm';\nimport { IFieldValidation } from '@ilingo/validup-vue';\n\nexport default defineComponent({\n    components: {\n        ANameInput,\n        ARealmPicker,\n        AFormSubmit,\n        VCFormGroup,\n        VCFormInput,\n        VCFormTextarea,\n\n        IFieldValidation,\n    },\n    props: {\n        name: {\n            type: String,\n            default: undefined,\n        },\n        entity: { type: Object as PropType<Scope> },\n        realmId: {\n            type: String,\n            default: undefined,\n        },\n    },\n    emits: defineEntityVEmitOptions<Scope>(),\n    setup(props, ctx) {\n        const busy = ref(false);\n        const nameSeed = useId();\n        const form = reactive({\n            name: '',\n            displayName: '',\n            description: '',\n            realmId: '',\n        });\n\n        const manager = defineEntityManager({\n            type: EntityType.SCOPE,\n            setup: ctx,\n            props,\n        });\n\n        const isEditing = useIsEditing(manager.data);\n\n        const v = useValidup(\n            new ScopeValidator(),\n            form,\n            { group: computed(() => (isEditing.value ? ValidatorGroup.UPDATE : ValidatorGroup.CREATE)) },\n        );\n\n        const store = injectStore();\n        const storeRefs = storeToRefs(store);\n\n        const realmLock = computed(() => {\n            // realm-management context passed by the page wins\n            if (props.realmId) {\n                return props.realmId;\n            }\n\n            if (!storeRefs.realmIsRoot.value) {\n                return storeRefs.realmId.value;\n            }\n\n            return manager.data.value ?\n                manager.data.value.realmId :\n                null;\n        });\n\n        const updatedAt = useUpdatedAt(() => props.entity);\n\n        const isNameFixed = computed<boolean>(() => {\n            if (!!props.name && props.name.length > 0) {\n                return true;\n            }\n\n            return !!(manager.data.value && manager.data.value.builtIn);\n        });\n\n        function initForm() {\n            if (props.name) {\n                form.name = props.name;\n            }\n\n            assignFormProperties(form, manager.data.value, { fields: v.fields });\n\n            // locked-realm prop wins over any realmId pulled from the entity\n            if (props.realmId) {\n                form.realmId = props.realmId;\n            }\n\n            if (form.name.length === 0) {\n                form.name = generateName(nameSeed);\n            }\n        }\n\n        watch(updatedAt, (val, oldVal) => {\n            if (!val || val === oldVal) {\n                return;\n            }\n\n            manager.data.value = props.entity;\n            initForm();\n        });\n\n        initForm();\n\n        const submit = async () => {\n            if (v.$invalid.value) {\n                return;\n            }\n\n            await manager.createOrUpdate(form);\n        };\n\n        const translationsDefault = useTranslations(\n            [\n                {\n                    namespace: TranslatorTranslationNamespace.FIELD, \n                    key: TranslatorTranslationFieldKey.NAME, \n                },\n                {\n                    namespace: TranslatorTranslationNamespace.FIELD, \n                    key: TranslatorTranslationFieldKey.DISPLAY_NAME, \n                },\n                {\n                    namespace: TranslatorTranslationNamespace.FIELD, \n                    key: TranslatorTranslationFieldKey.DESCRIPTION, \n                },\n                {\n                    namespace: TranslatorTranslationNamespace.ENTITY, \n                    key: TranslatorTranslationEntityKey.REALM, \n                    count: 1, \n                },\n            ],\n        );\n\n        return {\n            busy,\n            v,\n            isEditing,\n            realmLock,\n            isNameFixed,\n            translationsDefault,\n            submit,\n        };\n    },\n});\n\n</script>\n\n<template>\n    <form @submit.prevent=\"submit\">\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"v.fields.name\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translationsDefault.name }}\n                </template>\n                <ANameInput\n                    v-model=\"v.fields.name.$model.value\"\n                    :disabled=\"isNameFixed\"\n                />\n            </VCFormGroup>\n        </IFieldValidation>\n\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"v.fields.displayName\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translationsDefault.displayName }}\n                </template>\n                <VCFormInput\n                    :model-value=\"v.fields.displayName.$model.value ?? ''\"\n                    @update:model-value=\"(next: string) => { v.fields.displayName.$model.value = next; }\"\n                />\n            </VCFormGroup>\n        </IFieldValidation>\n\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"v.fields.description\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translationsDefault.description }}\n                </template>\n                <VCFormTextarea\n                    :model-value=\"v.fields.description.$model.value ?? ''\"\n                    :rows=\"7\"\n                    @update:model-value=\"(next: string) => { v.fields.description.$model.value = next; }\"\n                />\n            </VCFormGroup>\n        </IFieldValidation>\n\n        <template v-if=\"!realmLock && !isNameFixed && !isEditing\">\n            <IFieldValidation\n                v-slot=\"{ value }\"\n                :field=\"v.fields.realmId\"\n            >\n                <VCFormGroup :validation=\"value\">\n                    <template #label>\n                        {{ translationsDefault.realm }}\n                    </template>\n                    <ARealmPicker\n                        :value=\"v.fields.realmId.$model.value\"\n                        @change=\"(input: string[]) => {\n                            v.fields.realmId.$model.value = input.length > 0 ? input[0] ?? '' : '';\n                        }\"\n                    />\n                </VCFormGroup>\n            </IFieldValidation>\n        </template>\n\n        <AFormSubmit\n            :is-busy=\"busy\"\n            :is-editing=\"isEditing\"\n            :is-invalid=\"v.$invalid.value\"\n            @submit=\"submit\"\n        />\n    </form>\n</template>\n","/*\n * Copyright (c) 2022.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { EntityType } from '@authup/core-kit';\nimport type { SlotsType } from 'vue';\nimport { defineComponent } from 'vue';\nimport type { Scope } from '@authup/core-kit';\nimport type { EntityCollectionVSlots } from '../../utility';\nimport {\n    defineEntityCollectionManager,\n    defineEntityCollectionVEmitOptions,\n    defineEntityCollectionVProps,\n} from '../../utility';\nimport { TranslatorTranslationEntityKey, TranslatorTranslationNamespace, TranslatorTranslationVuecsKey } from '@authup/i18n';\nimport { useTranslation } from '../../../core';\n\nexport const AScopes = defineComponent({\n    props: defineEntityCollectionVProps<Scope>(),\n    emits: defineEntityCollectionVEmitOptions<Scope>(),\n    slots: Object as SlotsType<EntityCollectionVSlots<Scope>>,\n    setup(props, ctx) {\n        const { render } = defineEntityCollectionManager({\n            type: EntityType.SCOPE,\n            props,\n            setup: ctx,\n        });\n\n        const translationName = useTranslation({\n            namespace: TranslatorTranslationNamespace.ENTITY,\n            key: TranslatorTranslationEntityKey.SCOPE,\n            count: 2,\n        });\n\n        const translation = useTranslation({\n            namespace: TranslatorTranslationNamespace.VUECS,\n            key: TranslatorTranslationVuecsKey.NO_MORE,\n            data: { name: translationName },\n        });\n\n        return () => render({ noMore: { content: translation.value } });\n    },\n});\n\nexport default AScopes;\n","/*\n * Copyright (c) 2023.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { EntityType } from '@authup/core-kit';\nimport type { Scope } from '@authup/core-kit';\nimport type { SlotsType } from 'vue';\nimport { defineComponent } from 'vue';\nimport type { EntityVSlots } from '../../utility';\nimport {\n    defineEntityManager,\n    defineEntityVEmitOptions,\n    defineEntityVProps,\n} from '../../utility';\n\nexport const AScope = defineComponent({\n    props: defineEntityVProps<Scope>(),\n    emits: defineEntityVEmitOptions<Scope>(),\n    slots: Object as SlotsType<EntityVSlots<Scope>>,\n    async setup(props, setup) {\n        const manager = defineEntityManager({\n            type: `${EntityType.SCOPE}`,\n            props,\n            setup,\n        });\n\n        try {\n            await manager.resolveOrFail();\n\n            return () => manager.render();\n        } catch (e) {\n            return () => manager.renderError(e);\n        }\n    },\n});\n","<!--\n  Copyright (c) 2022.\n  Author Peter Placzek (tada5hi)\n  For the full copyright and license information,\n  view the LICENSE file that was distributed with this source code.\n-->\n\n<script lang=\"ts\">\nimport { EntityType } from '@authup/core-kit';\nimport type { ClientScope } from '@authup/core-kit';\nimport { defineComponent } from 'vue';\nimport {\n    defineEntityManager,\n    defineEntityVEmitOptions,\n} from '../../utility';\nimport AToggleButton from '../../utility/toggle-button/AToggleButton.vue';\n\nexport default defineComponent({\n    components: { AToggleButton },\n    props: {\n        clientId: { type: String, required: true },\n        scopeId: { type: String, required: true },\n    },\n    emits: defineEntityVEmitOptions<ClientScope>(),\n    async setup(props, setup) {\n        const manager = defineEntityManager({\n            type: EntityType.CLIENT_SCOPE,\n            setup,\n            query: () => ({\n                filters: {\n                    clientId: props.clientId,\n                    scopeId: props.scopeId,\n                },\n            }),\n            socket: {\n                processEvent(event) {\n                    return event.data.clientId === props.clientId &&\n                        event.data.scopeId === props.scopeId;\n                },\n            },\n        });\n\n        await manager.resolve({\n            query: {\n                filters: {\n                    clientId: props.clientId,\n                    scopeId: props.scopeId,\n                },\n            },\n        });\n\n        const handleChanged = (value: boolean) => {\n            if (value) {\n                return manager.create({\n                    clientId: props.clientId,\n                    scopeId: props.scopeId,\n                });\n            }\n\n            return manager.delete();\n        };\n\n        return {\n            manager,\n            handleChanged,\n        };\n    },\n});\n</script>\n<template>\n    <AToggleButton\n        :value=\"!!manager.data.value\"\n        :is-busy=\"manager.busy.value\"\n        @changed=\"handleChanged\"\n    />\n</template>\n","<!--\n  Copyright (c) 2022.\n  Author Peter Placzek (tada5hi)\n  For the full copyright and license information,\n  view the LICENSE file that was distributed with this source code.\n-->\n\n<script lang=\"ts\">\nimport { EntityType } from '@authup/core-kit';\nimport type { ClientScope } from '@authup/core-kit';\nimport { defineComponent } from 'vue';\nimport {\n    defineEntityManager,\n    defineEntityVEmitOptions,\n} from '../../utility';\nimport AToggleButton from '../../utility/toggle-button/AToggleButton.vue';\n\nexport default defineComponent({\n    components: { AToggleButton },\n    props: {\n        clientId: { type: String, required: true },\n        scopeId: { type: String, required: true },\n    },\n    emits: defineEntityVEmitOptions<ClientScope>(),\n    async setup(props, setup) {\n        const manager = defineEntityManager({\n            type: EntityType.CLIENT_SCOPE,\n            setup,\n            query: () => ({\n                filters: {\n                    clientId: props.clientId,\n                    scopeId: props.scopeId,\n                },\n            }),\n            socket: {\n                processEvent(event) {\n                    return event.data.clientId === props.clientId &&\n                        event.data.scopeId === props.scopeId;\n                },\n            },\n        });\n\n        await manager.resolve({\n            query: {\n                filters: {\n                    clientId: props.clientId,\n                    scopeId: props.scopeId,\n                },\n            },\n        });\n\n        const handleChanged = (value: boolean) => {\n            if (value) {\n                return manager.create({\n                    clientId: props.clientId,\n                    scopeId: props.scopeId,\n                });\n            }\n\n            return manager.delete();\n        };\n\n        return {\n            manager,\n            handleChanged,\n        };\n    },\n});\n</script>\n<template>\n    <AToggleButton\n        :value=\"!!manager.data.value\"\n        :is-busy=\"manager.busy.value\"\n        @changed=\"handleChanged\"\n    />\n</template>\n","<!--\n  Copyright (c) 2022.\n  Author Peter Placzek (tada5hi)\n  For the full copyright and license information,\n  view the LICENSE file that was distributed with this source code.\n-->\n\n<script lang=\"ts\">\nimport { computed, defineComponent } from 'vue';\nimport { AScopes } from '../scope';\nimport AClientScopeAssignment from './AClientScopeAssignment.vue';\n\nexport default defineComponent({\n    components: { AScopes, AClientScopeAssignment },\n    props: {\n        entityId: {\n            type: String,\n            required: true,\n        },\n    },\n    setup(props, { slots }) {\n        const forwardedSlots = computed(() => Object.fromEntries(Object.entries(slots).filter(([name]) => name !== 'itemActions')));\n        return { forwardedSlots };\n    },\n});\n</script>\n<template>\n    <AScopes>\n        <template #itemActions=\"{ data }\">\n            <AClientScopeAssignment\n                :key=\"data.id\"\n                :client-id=\"entityId\"\n                :scope-id=\"data.id\"\n            />\n        </template>\n        <template\n            v-for=\"(_, name) in forwardedSlots\"\n            :key=\"name\"\n            #[name]=\"slotData\"\n        >\n            <slot\n                :name=\"name\"\n                v-bind=\"slotData ?? {}\"\n            />\n        </template>\n    </AScopes>\n</template>\n","<!--\n  Copyright (c) 2022.\n  Author Peter Placzek (tada5hi)\n  For the full copyright and license information,\n  view the LICENSE file that was distributed with this source code.\n-->\n\n<script lang=\"ts\">\nimport { computed, defineComponent } from 'vue';\nimport { AScopes } from '../scope';\nimport AClientScopeAssignment from './AClientScopeAssignment.vue';\n\nexport default defineComponent({\n    components: { AScopes, AClientScopeAssignment },\n    props: {\n        entityId: {\n            type: String,\n            required: true,\n        },\n    },\n    setup(props, { slots }) {\n        const forwardedSlots = computed(() => Object.fromEntries(Object.entries(slots).filter(([name]) => name !== 'itemActions')));\n        return { forwardedSlots };\n    },\n});\n</script>\n<template>\n    <AScopes>\n        <template #itemActions=\"{ data }\">\n            <AClientScopeAssignment\n                :key=\"data.id\"\n                :client-id=\"entityId\"\n                :scope-id=\"data.id\"\n            />\n        </template>\n        <template\n            v-for=\"(_, name) in forwardedSlots\"\n            :key=\"name\"\n            #[name]=\"slotData\"\n        >\n            <slot\n                :name=\"name\"\n                v-bind=\"slotData ?? {}\"\n            />\n        </template>\n    </AScopes>\n</template>\n","/*\n * Copyright (c) 2026.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { EntityType } from '@authup/core-kit';\nimport type { Consent } from '@authup/core-kit';\nimport { TranslatorTranslationEntityKey, TranslatorTranslationNamespace, TranslatorTranslationVuecsKey } from '@authup/i18n';\nimport type { SlotsType } from 'vue';\nimport { defineComponent } from 'vue';\nimport { useTranslation } from '../../../core';\nimport type { EntityCollectionVSlots } from '../../utility';\nimport {\n    defineEntityCollectionManager,\n    defineEntityCollectionVEmitOptions,\n    defineEntityCollectionVProps,\n} from '../../utility';\n\nexport const AConsents = defineComponent({\n    props: defineEntityCollectionVProps<Consent>(),\n    emits: defineEntityCollectionVEmitOptions<Consent>(),\n    slots: Object as SlotsType<EntityCollectionVSlots<Consent>>,\n    setup(props, ctx) {\n        const { render } = defineEntityCollectionManager({\n            type: `${EntityType.CONSENT}`,\n            props,\n            setup: ctx,\n        });\n\n        const translationName = useTranslation({\n            namespace: TranslatorTranslationNamespace.ENTITY,\n            key: TranslatorTranslationEntityKey.CONSENT,\n            count: 2,\n        });\n\n        const translation = useTranslation({\n            namespace: TranslatorTranslationNamespace.VUECS,\n            key: TranslatorTranslationVuecsKey.NO_MORE,\n            data: { name: translationName },\n        });\n\n        return () => render({ noMore: { content: translation.value } });\n    },\n});\n\nexport default AConsents;\n","/*\n * Copyright (c) 2026.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { EntityType } from '@authup/core-kit';\nimport type { Event as EventEntity } from '@authup/core-kit';\nimport { TranslatorTranslationEntityKey, TranslatorTranslationNamespace, TranslatorTranslationVuecsKey } from '@authup/i18n';\nimport type { SlotsType } from 'vue';\nimport { defineComponent } from 'vue';\nimport { useTranslation } from '../../../core';\nimport type { EntityCollectionVSlots } from '../../utility';\nimport {\n    defineEntityCollectionManager,\n    defineEntityCollectionVEmitOptions,\n    defineEntityCollectionVProps,\n} from '../../utility';\n\nexport const AEvents = defineComponent({\n    props: defineEntityCollectionVProps<EventEntity>(),\n    emits: defineEntityCollectionVEmitOptions<EventEntity>(),\n    slots: Object as SlotsType<EntityCollectionVSlots<EventEntity>>,\n    setup(props, ctx) {\n        const { render } = defineEntityCollectionManager({\n            type: `${EntityType.EVENT}`,\n            props,\n            setup: ctx,\n        });\n\n        const translationName = useTranslation({\n            namespace: TranslatorTranslationNamespace.ENTITY,\n            key: TranslatorTranslationEntityKey.EVENT,\n            count: 2,\n        });\n\n        const translation = useTranslation({\n            namespace: TranslatorTranslationNamespace.VUECS,\n            key: TranslatorTranslationVuecsKey.NO_MORE,\n            data: { name: translationName },\n        });\n\n        return () => render({ noMore: { content: translation.value } });\n    },\n});\n\nexport default AEvents;\n","/*\n * Copyright (c) 2023.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { EntityType } from '@authup/core-kit';\nimport type { IdentityProvider } from '@authup/core-kit';\nimport type { SlotsType } from 'vue';\nimport { defineComponent } from 'vue';\nimport type { EntityVSlots } from '../../utility';\nimport {\n    defineEntityManager,\n    defineEntityVEmitOptions,\n    defineEntityVProps,\n} from '../../utility';\n\nexport const AIdentityProvider = defineComponent({\n    props: defineEntityVProps<IdentityProvider>(),\n    emits: defineEntityVEmitOptions<IdentityProvider>(),\n    slots: Object as SlotsType<EntityVSlots<IdentityProvider>>,\n    async setup(props, setup) {\n        const manager = defineEntityManager({\n            type: `${EntityType.IDENTITY_PROVIDER}`,\n            props,\n            setup,\n        });\n\n        try {\n            await manager.resolveOrFail();\n\n            return () => manager.render();\n        } catch (e) {\n            return () => manager.renderError(e);\n        }\n    },\n});\n","<!--\n  - Copyright (c) 2023-2026.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\nimport type { IdentityProvider } from '@authup/core-kit';\nimport { IdentityProviderValidator } from '@authup/core-kit';\nimport { ValidatorGroup, generateName } from '@authup/kit';\nimport { TranslatorTranslationFieldKey, TranslatorTranslationNamespace } from '@authup/i18n';\nimport { assignFormProperties, useTranslations } from '../../../core';\nimport { useValidup } from '@validup/vue';\nimport type { PropType } from 'vue';\nimport {\n    computed,\n    defineComponent,\n    reactive,\n    useId,\n} from 'vue';\nimport { VCFormGroup, VCFormInput, VCFormSwitch } from '@vuecs/forms';\nimport { onChange, useIsEditing, useUpdatedAt } from '../../../composables';\nimport { IFieldValidation } from '@ilingo/validup-vue';\nimport { ANameInput } from '../../utility';\n\nexport default defineComponent({\n    components: {\n        ANameInput,\n        VCFormGroup,\n        VCFormInput,\n        VCFormSwitch,\n\n        IFieldValidation,\n    },\n    props: { entity: { type: Object as PropType<Partial<IdentityProvider>> } },\n    emits: ['updated'],\n    setup(props, setup) {\n        const nameSeed = useId();\n        const form = reactive({\n            name: '',\n            displayName: '',\n            enabled: true,\n        });\n\n        const isEditing = useIsEditing(computed(() => props.entity as IdentityProvider));\n\n        // Shared `IdentityProviderValidator` from `@authup/core-kit`, scoped\n        // via `pathsToInclude` to the keys this sub-form owns — the validator\n        // also mounts `protocol` (required in every group, owned by the\n        // parent form) and `realmId`; unscoped, those would keep the\n        // sub-form permanently invalid with the issue on an unrendered\n        // field. Registers under the parent `<AIdentityProviderOAuth2Form>` /\n        // `<AIdentityProviderLdapForm>` collectors via `name: 'basic'`.\n        const v = useValidup(\n            new IdentityProviderValidator({ pathsToInclude: ['name', 'displayName', 'enabled'] }),\n            form,\n            {\n                name: 'basic',\n                group: computed(() => (isEditing.value ? ValidatorGroup.UPDATE : ValidatorGroup.CREATE)),\n            },\n        );\n\n        const isNameEmpty = computed(() => !form.name || form.name.length === 0);\n\n        const update = () => {\n            setup.emit('updated', {\n                data: form,\n                valid: !v.$invalid.value,\n            });\n        };\n\n        function assign(data: Partial<IdentityProvider> = {}) {\n            assignFormProperties(form, data, { fields: v.fields });\n\n            if (isNameEmpty.value) {\n                form.name = generateName(nameSeed);\n            }\n        }\n\n        setup.expose({ assign });\n\n        const updatedAt = useUpdatedAt(() => props.entity as IdentityProvider);\n        onChange(updatedAt, () => assign(props.entity));\n\n        assign(props.entity);\n\n        const translationsDefault = useTranslations([\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.DISPLAY_NAME,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.NAME,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.ENABLED,\n            },\n        ]);\n\n        const onEnabledChange = (value: boolean) => {\n            v.fields.enabled.$model.value = value;\n            update();\n        };\n\n        const onNameUpdate = (value: string) => {\n            v.fields.name.$model.value = value;\n            update();\n        };\n\n        return {\n            v,\n            translationsDefault,\n            onNameUpdate,\n            onEnabledChange,\n        };\n    },\n});\n\n</script>\n\n<template>\n    <div>\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"v.fields.name\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translationsDefault.name }}\n                </template>\n                <ANameInput\n                    :model-value=\"v.fields.name.$model.value\"\n                    @update:model-value=\"onNameUpdate\"\n                />\n            </VCFormGroup>\n        </IFieldValidation>\n\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"v.fields.displayName\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translationsDefault.displayName }}\n                </template>\n                <VCFormInput\n                    :model-value=\"v.fields.displayName.$model.value ?? ''\"\n                    @update:model-value=\"(next: string) => { v.fields.displayName.$model.value = next; }\"\n                />\n            </VCFormGroup>\n        </IFieldValidation>\n\n        <div class=\"mt-3\">\n            <VCFormSwitch\n                :model-value=\"v.fields.enabled.$model.value\"\n                :label=\"true\"\n                :label-content=\"translationsDefault.enabled\"\n                @update:model-value=\"onEnabledChange\"\n            />\n        </div>\n    </div>\n</template>\n","<!--\n  - Copyright (c) 2023-2026.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\nimport type { IdentityProvider } from '@authup/core-kit';\nimport { IdentityProviderValidator } from '@authup/core-kit';\nimport { ValidatorGroup, generateName } from '@authup/kit';\nimport { TranslatorTranslationFieldKey, TranslatorTranslationNamespace } from '@authup/i18n';\nimport { assignFormProperties, useTranslations } from '../../../core';\nimport { useValidup } from '@validup/vue';\nimport type { PropType } from 'vue';\nimport {\n    computed,\n    defineComponent,\n    reactive,\n    useId,\n} from 'vue';\nimport { VCFormGroup, VCFormInput, VCFormSwitch } from '@vuecs/forms';\nimport { onChange, useIsEditing, useUpdatedAt } from '../../../composables';\nimport { IFieldValidation } from '@ilingo/validup-vue';\nimport { ANameInput } from '../../utility';\n\nexport default defineComponent({\n    components: {\n        ANameInput,\n        VCFormGroup,\n        VCFormInput,\n        VCFormSwitch,\n\n        IFieldValidation,\n    },\n    props: { entity: { type: Object as PropType<Partial<IdentityProvider>> } },\n    emits: ['updated'],\n    setup(props, setup) {\n        const nameSeed = useId();\n        const form = reactive({\n            name: '',\n            displayName: '',\n            enabled: true,\n        });\n\n        const isEditing = useIsEditing(computed(() => props.entity as IdentityProvider));\n\n        // Shared `IdentityProviderValidator` from `@authup/core-kit`, scoped\n        // via `pathsToInclude` to the keys this sub-form owns — the validator\n        // also mounts `protocol` (required in every group, owned by the\n        // parent form) and `realmId`; unscoped, those would keep the\n        // sub-form permanently invalid with the issue on an unrendered\n        // field. Registers under the parent `<AIdentityProviderOAuth2Form>` /\n        // `<AIdentityProviderLdapForm>` collectors via `name: 'basic'`.\n        const v = useValidup(\n            new IdentityProviderValidator({ pathsToInclude: ['name', 'displayName', 'enabled'] }),\n            form,\n            {\n                name: 'basic',\n                group: computed(() => (isEditing.value ? ValidatorGroup.UPDATE : ValidatorGroup.CREATE)),\n            },\n        );\n\n        const isNameEmpty = computed(() => !form.name || form.name.length === 0);\n\n        const update = () => {\n            setup.emit('updated', {\n                data: form,\n                valid: !v.$invalid.value,\n            });\n        };\n\n        function assign(data: Partial<IdentityProvider> = {}) {\n            assignFormProperties(form, data, { fields: v.fields });\n\n            if (isNameEmpty.value) {\n                form.name = generateName(nameSeed);\n            }\n        }\n\n        setup.expose({ assign });\n\n        const updatedAt = useUpdatedAt(() => props.entity as IdentityProvider);\n        onChange(updatedAt, () => assign(props.entity));\n\n        assign(props.entity);\n\n        const translationsDefault = useTranslations([\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.DISPLAY_NAME,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.NAME,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.ENABLED,\n            },\n        ]);\n\n        const onEnabledChange = (value: boolean) => {\n            v.fields.enabled.$model.value = value;\n            update();\n        };\n\n        const onNameUpdate = (value: string) => {\n            v.fields.name.$model.value = value;\n            update();\n        };\n\n        return {\n            v,\n            translationsDefault,\n            onNameUpdate,\n            onEnabledChange,\n        };\n    },\n});\n\n</script>\n\n<template>\n    <div>\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"v.fields.name\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translationsDefault.name }}\n                </template>\n                <ANameInput\n                    :model-value=\"v.fields.name.$model.value\"\n                    @update:model-value=\"onNameUpdate\"\n                />\n            </VCFormGroup>\n        </IFieldValidation>\n\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"v.fields.displayName\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translationsDefault.displayName }}\n                </template>\n                <VCFormInput\n                    :model-value=\"v.fields.displayName.$model.value ?? ''\"\n                    @update:model-value=\"(next: string) => { v.fields.displayName.$model.value = next; }\"\n                />\n            </VCFormGroup>\n        </IFieldValidation>\n\n        <div class=\"mt-3\">\n            <VCFormSwitch\n                :model-value=\"v.fields.enabled.$model.value\"\n                :label=\"true\"\n                :label-content=\"translationsDefault.enabled\"\n                @update:model-value=\"onEnabledChange\"\n            />\n        </div>\n    </div>\n</template>\n","<!--\n  - Copyright (c) 2023-2026.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\nimport type { IdentityProvider, LdapIdentityProvider } from '@authup/core-kit';\nimport {\n    TranslatorTranslationClientKey,\n    TranslatorTranslationFieldKey,\n    TranslatorTranslationNamespace,\n} from '@authup/i18n';\nimport { assignFormProperties, useTranslations } from '../../../core';\nimport { Container } from 'validup';\nimport { useValidup } from '@validup/vue';\nimport type { PropType } from 'vue';\nimport { defineComponent, reactive } from 'vue';\nimport { VCFormGroup, VCFormInput, VCFormSwitch } from '@vuecs/forms';\nimport { onChange, useUpdatedAt } from '../../../composables';\nimport { IFieldValidation } from '@ilingo/validup-vue';\n\nexport default defineComponent({\n    components: {\n        VCFormGroup, \n        VCFormInput, \n        VCFormSwitch,\n\n        IFieldValidation,\n    },\n    props: {\n        entity: { type: Object as PropType<Partial<IdentityProvider>> },\n        discovery: {\n            type: Boolean,\n            default: false,\n        },\n    },\n    emits: ['updated'],\n    setup(props) {\n        const form = reactive({\n            url: '',\n            timeout: 0,\n            startTls: true,\n            baseDn: '',\n        });\n\n        const v = useValidup(new Container<typeof form>(), form, { name: 'connection' });\n\n        function init() {\n            if (!props.entity) return;\n            assignFormProperties(form, props.entity as Partial<LdapIdentityProvider>, { fields: v.fields });\n        }\n\n        const updated = useUpdatedAt(() => props.entity as IdentityProvider);\n        onChange(updated, () => init());\n\n        init();\n\n        const onTimeoutChange = (input: string) => {\n            if (input.trim() === '') {\n                v.fields.timeout.$model.value = 0;\n                return;\n            }\n            const intValue = Number.parseInt(input, 10);\n            v.fields.timeout.$model.value = Number.isNaN(intValue) ? 0 : intValue;\n        };\n\n        const translations = useTranslations([\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.URL,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.TIMEOUT,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.START_TLS,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.CLIENT,\n                key: TranslatorTranslationClientKey.ENABLE_STARTTLS_HINT,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.BASE_DN,\n            },\n        ]);\n\n        return {\n            v,\n            translations,\n            onTimeoutChange,\n        };\n    },\n});\n\n</script>\n\n<template>\n    <div>\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"v.fields.url\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translations.url }}\n                </template>\n                <VCFormInput\n                    v-model=\"v.fields.url.$model.value\"\n                    placeholder=\"<scheme>://<address>:<port>\"\n                />\n            </VCFormGroup>\n        </IFieldValidation>\n\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"v.fields.timeout\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translations.timeout }}\n                </template>\n                <VCFormInput\n                    :model-value=\"String(v.fields.timeout.$model.value)\"\n                    type=\"number\"\n                    @update:model-value=\"onTimeoutChange\"\n                />\n            </VCFormGroup>\n        </IFieldValidation>\n\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"v.fields.startTls\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translations.startTls }}\n                </template>\n                <VCFormSwitch\n                    v-model=\"v.fields.startTls.$model.value\"\n                    :label=\"true\"\n                    :label-content=\"translations.enableStartTlsHint\"\n                />\n            </VCFormGroup>\n        </IFieldValidation>\n\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"v.fields.baseDn\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translations.baseDn }}\n                </template>\n                <VCFormInput\n                    v-model=\"v.fields.baseDn.$model.value\"\n                    placeholder=\"e.g. dc=example,dc=com\"\n                />\n            </VCFormGroup>\n        </IFieldValidation>\n    </div>\n</template>\n","<!--\n  - Copyright (c) 2023-2026.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\nimport type { IdentityProvider, LdapIdentityProvider } from '@authup/core-kit';\nimport {\n    TranslatorTranslationClientKey,\n    TranslatorTranslationFieldKey,\n    TranslatorTranslationNamespace,\n} from '@authup/i18n';\nimport { assignFormProperties, useTranslations } from '../../../core';\nimport { Container } from 'validup';\nimport { useValidup } from '@validup/vue';\nimport type { PropType } from 'vue';\nimport { defineComponent, reactive } from 'vue';\nimport { VCFormGroup, VCFormInput, VCFormSwitch } from '@vuecs/forms';\nimport { onChange, useUpdatedAt } from '../../../composables';\nimport { IFieldValidation } from '@ilingo/validup-vue';\n\nexport default defineComponent({\n    components: {\n        VCFormGroup, \n        VCFormInput, \n        VCFormSwitch,\n\n        IFieldValidation,\n    },\n    props: {\n        entity: { type: Object as PropType<Partial<IdentityProvider>> },\n        discovery: {\n            type: Boolean,\n            default: false,\n        },\n    },\n    emits: ['updated'],\n    setup(props) {\n        const form = reactive({\n            url: '',\n            timeout: 0,\n            startTls: true,\n            baseDn: '',\n        });\n\n        const v = useValidup(new Container<typeof form>(), form, { name: 'connection' });\n\n        function init() {\n            if (!props.entity) return;\n            assignFormProperties(form, props.entity as Partial<LdapIdentityProvider>, { fields: v.fields });\n        }\n\n        const updated = useUpdatedAt(() => props.entity as IdentityProvider);\n        onChange(updated, () => init());\n\n        init();\n\n        const onTimeoutChange = (input: string) => {\n            if (input.trim() === '') {\n                v.fields.timeout.$model.value = 0;\n                return;\n            }\n            const intValue = Number.parseInt(input, 10);\n            v.fields.timeout.$model.value = Number.isNaN(intValue) ? 0 : intValue;\n        };\n\n        const translations = useTranslations([\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.URL,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.TIMEOUT,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.START_TLS,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.CLIENT,\n                key: TranslatorTranslationClientKey.ENABLE_STARTTLS_HINT,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.BASE_DN,\n            },\n        ]);\n\n        return {\n            v,\n            translations,\n            onTimeoutChange,\n        };\n    },\n});\n\n</script>\n\n<template>\n    <div>\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"v.fields.url\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translations.url }}\n                </template>\n                <VCFormInput\n                    v-model=\"v.fields.url.$model.value\"\n                    placeholder=\"<scheme>://<address>:<port>\"\n                />\n            </VCFormGroup>\n        </IFieldValidation>\n\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"v.fields.timeout\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translations.timeout }}\n                </template>\n                <VCFormInput\n                    :model-value=\"String(v.fields.timeout.$model.value)\"\n                    type=\"number\"\n                    @update:model-value=\"onTimeoutChange\"\n                />\n            </VCFormGroup>\n        </IFieldValidation>\n\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"v.fields.startTls\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translations.startTls }}\n                </template>\n                <VCFormSwitch\n                    v-model=\"v.fields.startTls.$model.value\"\n                    :label=\"true\"\n                    :label-content=\"translations.enableStartTlsHint\"\n                />\n            </VCFormGroup>\n        </IFieldValidation>\n\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"v.fields.baseDn\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translations.baseDn }}\n                </template>\n                <VCFormInput\n                    v-model=\"v.fields.baseDn.$model.value\"\n                    placeholder=\"e.g. dc=example,dc=com\"\n                />\n            </VCFormGroup>\n        </IFieldValidation>\n    </div>\n</template>\n","<!--\n  - Copyright (c) 2023-2026.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\nimport type { IdentityProvider, LdapIdentityProvider } from '@authup/core-kit';\nimport {\n    TranslatorTranslationActionKey,\n    TranslatorTranslationEntityKey,\n    TranslatorTranslationFieldKey,\n    TranslatorTranslationNamespace,\n} from '@authup/i18n';\nimport { assignFormProperties, useTranslations } from '../../../core';\nimport { Container } from 'validup';\nimport { useValidup } from '@validup/vue';\nimport type { PropType } from 'vue';\nimport {\n    computed,\n    defineComponent,\n    reactive,\n    ref,\n} from 'vue';\nimport { VCFormGroup, VCFormInput } from '@vuecs/forms';\nimport { VCIcon } from '@vuecs/icon';\nimport { onChange, useUpdatedAt } from '../../../composables';\nimport { IFieldValidation } from '@ilingo/validup-vue';\n\nexport default defineComponent({\n    components: {\n        VCFormGroup,\n        VCFormInput,\n        VCIcon,\n        IFieldValidation,\n    },\n    props: {\n        entity: { type: Object as PropType<Partial<IdentityProvider>> },\n        discovery: { type: Boolean, default: false },\n    },\n    emits: ['updated'],\n    setup(props) {\n        const form = reactive({ user: '', password: '' });\n\n        const passwordShow = ref(false);\n\n        const v = useValidup(new Container<typeof form>(), form, { name: 'credentials' });\n\n        function init() {\n            if (!props.entity) return;\n            assignFormProperties(form, props.entity as Partial<LdapIdentityProvider>, { fields: v.fields });\n        }\n\n        const updated = useUpdatedAt(() => props.entity as IdentityProvider);\n        onChange(updated, () => init());\n        init();\n\n        const translations = useTranslations([\n            {\n                namespace: TranslatorTranslationNamespace.ENTITY,\n                key: TranslatorTranslationEntityKey.USER,\n                count: 1,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.PASSWORD,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.ACTION,\n                key: TranslatorTranslationActionKey.SHOW,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.ACTION,\n                key: TranslatorTranslationActionKey.HIDE,\n            },\n        ]);\n\n        const passwordToggleLabel = computed(() => (passwordShow.value ? translations.hide : translations.show));\n\n        return {\n            v,\n            passwordShow,\n            passwordToggleLabel,\n            translations,\n        };\n    },\n});\n\n</script>\n\n<template>\n    <div>\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"v.fields.user\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translations.user }}\n                </template>\n                <VCFormInput v-model=\"v.fields.user.$model.value\" />\n            </VCFormGroup>\n        </IFieldValidation>\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"v.fields.password\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translations.password }}\n                </template>\n                <VCFormInput\n                    v-model=\"v.fields.password.$model.value\"\n                    :type=\"passwordShow ? 'text' : 'password'\"\n                    autocomplete=\"current-password\"\n                >\n                    <template #groupAppend=\"{ class: appendClass }\">\n                        <button\n                            type=\"button\"\n                            :class=\"appendClass\"\n                            class=\"cursor-pointer transition-colors hover:bg-bg-elevated\"\n                            :aria-label=\"passwordToggleLabel\"\n                            :title=\"passwordToggleLabel\"\n                            @click.prevent=\"passwordShow = !passwordShow\"\n                        >\n                            <VCIcon\n                                aria-hidden=\"true\"\n                                :name=\"passwordShow ? 'fa6-solid:eye-slash' : 'fa6-solid:eye'\"\n                            />\n                        </button>\n                    </template>\n                </VCFormInput>\n            </VCFormGroup>\n        </IFieldValidation>\n    </div>\n</template>\n","<!--\n  - Copyright (c) 2023-2026.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\nimport type { IdentityProvider, LdapIdentityProvider } from '@authup/core-kit';\nimport {\n    TranslatorTranslationActionKey,\n    TranslatorTranslationEntityKey,\n    TranslatorTranslationFieldKey,\n    TranslatorTranslationNamespace,\n} from '@authup/i18n';\nimport { assignFormProperties, useTranslations } from '../../../core';\nimport { Container } from 'validup';\nimport { useValidup } from '@validup/vue';\nimport type { PropType } from 'vue';\nimport {\n    computed,\n    defineComponent,\n    reactive,\n    ref,\n} from 'vue';\nimport { VCFormGroup, VCFormInput } from '@vuecs/forms';\nimport { VCIcon } from '@vuecs/icon';\nimport { onChange, useUpdatedAt } from '../../../composables';\nimport { IFieldValidation } from '@ilingo/validup-vue';\n\nexport default defineComponent({\n    components: {\n        VCFormGroup,\n        VCFormInput,\n        VCIcon,\n        IFieldValidation,\n    },\n    props: {\n        entity: { type: Object as PropType<Partial<IdentityProvider>> },\n        discovery: { type: Boolean, default: false },\n    },\n    emits: ['updated'],\n    setup(props) {\n        const form = reactive({ user: '', password: '' });\n\n        const passwordShow = ref(false);\n\n        const v = useValidup(new Container<typeof form>(), form, { name: 'credentials' });\n\n        function init() {\n            if (!props.entity) return;\n            assignFormProperties(form, props.entity as Partial<LdapIdentityProvider>, { fields: v.fields });\n        }\n\n        const updated = useUpdatedAt(() => props.entity as IdentityProvider);\n        onChange(updated, () => init());\n        init();\n\n        const translations = useTranslations([\n            {\n                namespace: TranslatorTranslationNamespace.ENTITY,\n                key: TranslatorTranslationEntityKey.USER,\n                count: 1,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.PASSWORD,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.ACTION,\n                key: TranslatorTranslationActionKey.SHOW,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.ACTION,\n                key: TranslatorTranslationActionKey.HIDE,\n            },\n        ]);\n\n        const passwordToggleLabel = computed(() => (passwordShow.value ? translations.hide : translations.show));\n\n        return {\n            v,\n            passwordShow,\n            passwordToggleLabel,\n            translations,\n        };\n    },\n});\n\n</script>\n\n<template>\n    <div>\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"v.fields.user\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translations.user }}\n                </template>\n                <VCFormInput v-model=\"v.fields.user.$model.value\" />\n            </VCFormGroup>\n        </IFieldValidation>\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"v.fields.password\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translations.password }}\n                </template>\n                <VCFormInput\n                    v-model=\"v.fields.password.$model.value\"\n                    :type=\"passwordShow ? 'text' : 'password'\"\n                    autocomplete=\"current-password\"\n                >\n                    <template #groupAppend=\"{ class: appendClass }\">\n                        <button\n                            type=\"button\"\n                            :class=\"appendClass\"\n                            class=\"cursor-pointer transition-colors hover:bg-bg-elevated\"\n                            :aria-label=\"passwordToggleLabel\"\n                            :title=\"passwordToggleLabel\"\n                            @click.prevent=\"passwordShow = !passwordShow\"\n                        >\n                            <VCIcon\n                                aria-hidden=\"true\"\n                                :name=\"passwordShow ? 'fa6-solid:eye-slash' : 'fa6-solid:eye'\"\n                            />\n                        </button>\n                    </template>\n                </VCFormInput>\n            </VCFormGroup>\n        </IFieldValidation>\n    </div>\n</template>\n","<!--\n  - Copyright (c) 2023-2026.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\nimport type { IdentityProvider, LdapIdentityProvider } from '@authup/core-kit';\nimport { TranslatorTranslationFieldKey, TranslatorTranslationNamespace } from '@authup/i18n';\nimport { assignFormProperties, useTranslations } from '../../../core';\nimport { Container } from 'validup';\nimport { useValidup } from '@validup/vue';\nimport type { PropType } from 'vue';\nimport { defineComponent, reactive } from 'vue';\nimport { VCFormGroup, VCFormInput } from '@vuecs/forms';\nimport { onChange, useUpdatedAt } from '../../../composables';\nimport { IFieldValidation } from '@ilingo/validup-vue';\n\nexport default defineComponent({\n    components: {\n        VCFormGroup, \n        VCFormInput, \n        IFieldValidation, \n    },\n    props: {\n        entity: { type: Object as PropType<Partial<IdentityProvider>> },\n        discovery: { type: Boolean, default: false },\n    },\n    emits: ['updated'],\n    setup(props) {\n        const form = reactive({\n            groupFilter: '',\n            groupBaseDn: '',\n            groupNameAttribute: '',\n            groupClass: '',\n            groupMemberAttribute: '',\n            groupMemberUserAttribute: '',\n        });\n\n        const v = useValidup(new Container<typeof form>(), form, { name: 'group' });\n\n        function init() {\n            if (!props.entity) return;\n            assignFormProperties(form, props.entity as Partial<LdapIdentityProvider>, { fields: v.fields });\n        }\n\n        const updated = useUpdatedAt(() => props.entity as IdentityProvider);\n        onChange(updated, () => init());\n        init();\n\n        const translations = useTranslations([\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.FILTER,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.BASE_DN,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.CLASS,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.NAME_ATTRIBUTE,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.MEMBER_ATTRIBUTE,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.MEMBER_USER_ATTRIBUTE,\n            },\n        ]);\n\n        return { v, translations };\n    },\n});\n\n</script>\n\n<template>\n    <div>\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"v.fields.groupFilter\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translations.filter }}\n                </template>\n                <VCFormInput\n                    v-model=\"v.fields.groupFilter.$model.value\"\n                    placeholder=\"(member={{dn}})\"\n                />\n            </VCFormGroup>\n        </IFieldValidation>\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"v.fields.groupBaseDn\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translations.baseDn }}\n                </template>\n                <VCFormInput v-model=\"v.fields.groupBaseDn.$model.value\" />\n            </VCFormGroup>\n        </IFieldValidation>\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"v.fields.groupClass\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translations.class }}\n                </template>\n                <VCFormInput v-model=\"v.fields.groupClass.$model.value\" />\n            </VCFormGroup>\n        </IFieldValidation>\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"v.fields.groupNameAttribute\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translations.nameAttribute }}\n                </template>\n                <VCFormInput v-model=\"v.fields.groupNameAttribute.$model.value\" />\n            </VCFormGroup>\n        </IFieldValidation>\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"v.fields.groupMemberAttribute\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translations.memberAttribute }}\n                </template>\n                <VCFormInput v-model=\"v.fields.groupMemberAttribute.$model.value\" />\n            </VCFormGroup>\n        </IFieldValidation>\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"v.fields.groupMemberUserAttribute\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translations.memberUserAttribute }}\n                </template>\n                <VCFormInput v-model=\"v.fields.groupMemberUserAttribute.$model.value\" />\n            </VCFormGroup>\n        </IFieldValidation>\n    </div>\n</template>\n","<!--\n  - Copyright (c) 2023-2026.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\nimport type { IdentityProvider, LdapIdentityProvider } from '@authup/core-kit';\nimport { TranslatorTranslationFieldKey, TranslatorTranslationNamespace } from '@authup/i18n';\nimport { assignFormProperties, useTranslations } from '../../../core';\nimport { Container } from 'validup';\nimport { useValidup } from '@validup/vue';\nimport type { PropType } from 'vue';\nimport { defineComponent, reactive } from 'vue';\nimport { VCFormGroup, VCFormInput } from '@vuecs/forms';\nimport { onChange, useUpdatedAt } from '../../../composables';\nimport { IFieldValidation } from '@ilingo/validup-vue';\n\nexport default defineComponent({\n    components: {\n        VCFormGroup, \n        VCFormInput, \n        IFieldValidation, \n    },\n    props: {\n        entity: { type: Object as PropType<Partial<IdentityProvider>> },\n        discovery: { type: Boolean, default: false },\n    },\n    emits: ['updated'],\n    setup(props) {\n        const form = reactive({\n            groupFilter: '',\n            groupBaseDn: '',\n            groupNameAttribute: '',\n            groupClass: '',\n            groupMemberAttribute: '',\n            groupMemberUserAttribute: '',\n        });\n\n        const v = useValidup(new Container<typeof form>(), form, { name: 'group' });\n\n        function init() {\n            if (!props.entity) return;\n            assignFormProperties(form, props.entity as Partial<LdapIdentityProvider>, { fields: v.fields });\n        }\n\n        const updated = useUpdatedAt(() => props.entity as IdentityProvider);\n        onChange(updated, () => init());\n        init();\n\n        const translations = useTranslations([\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.FILTER,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.BASE_DN,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.CLASS,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.NAME_ATTRIBUTE,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.MEMBER_ATTRIBUTE,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.MEMBER_USER_ATTRIBUTE,\n            },\n        ]);\n\n        return { v, translations };\n    },\n});\n\n</script>\n\n<template>\n    <div>\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"v.fields.groupFilter\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translations.filter }}\n                </template>\n                <VCFormInput\n                    v-model=\"v.fields.groupFilter.$model.value\"\n                    placeholder=\"(member={{dn}})\"\n                />\n            </VCFormGroup>\n        </IFieldValidation>\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"v.fields.groupBaseDn\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translations.baseDn }}\n                </template>\n                <VCFormInput v-model=\"v.fields.groupBaseDn.$model.value\" />\n            </VCFormGroup>\n        </IFieldValidation>\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"v.fields.groupClass\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translations.class }}\n                </template>\n                <VCFormInput v-model=\"v.fields.groupClass.$model.value\" />\n            </VCFormGroup>\n        </IFieldValidation>\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"v.fields.groupNameAttribute\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translations.nameAttribute }}\n                </template>\n                <VCFormInput v-model=\"v.fields.groupNameAttribute.$model.value\" />\n            </VCFormGroup>\n        </IFieldValidation>\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"v.fields.groupMemberAttribute\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translations.memberAttribute }}\n                </template>\n                <VCFormInput v-model=\"v.fields.groupMemberAttribute.$model.value\" />\n            </VCFormGroup>\n        </IFieldValidation>\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"v.fields.groupMemberUserAttribute\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translations.memberUserAttribute }}\n                </template>\n                <VCFormInput v-model=\"v.fields.groupMemberUserAttribute.$model.value\" />\n            </VCFormGroup>\n        </IFieldValidation>\n    </div>\n</template>\n","<!--\n  - Copyright (c) 2023-2026.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\nimport type { IdentityProvider, LdapIdentityProvider } from '@authup/core-kit';\nimport { TranslatorTranslationFieldKey, TranslatorTranslationNamespace } from '@authup/i18n';\nimport { assignFormProperties, useTranslations } from '../../../core';\nimport { Container } from 'validup';\nimport { useValidup } from '@validup/vue';\nimport type { PropType } from 'vue';\nimport { defineComponent, reactive } from 'vue';\nimport { VCFormGroup, VCFormInput } from '@vuecs/forms';\nimport { onChange, useUpdatedAt } from '../../../composables';\nimport { IFieldValidation } from '@ilingo/validup-vue';\n\nexport default defineComponent({\n    components: {\n        VCFormGroup, \n        VCFormInput, \n        IFieldValidation, \n    },\n    props: {\n        entity: { type: Object as PropType<Partial<IdentityProvider>> },\n        discovery: { type: Boolean, default: false },\n    },\n    emits: ['updated'],\n    setup(props) {\n        const form = reactive({\n            userFilter: '',\n            userBaseDn: '',\n            userNameAttribute: '',\n            userMailAttribute: '',\n            userDisplayNameAttribute: '',\n        });\n\n        const v = useValidup(new Container<typeof form>(), form, { name: 'user' });\n\n        function init() {\n            if (!props.entity) return;\n            assignFormProperties(form, props.entity as Partial<LdapIdentityProvider>, { fields: v.fields });\n        }\n\n        const updated = useUpdatedAt(() => props.entity as IdentityProvider);\n        onChange(updated, () => init());\n        init();\n\n        const translations = useTranslations([\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.FILTER,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.BASE_DN,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.NAME_ATTRIBUTE,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.MAIL_ATTRIBUTE,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.DISPLAY_NAME_ATTRIBUTE,\n            },\n        ]);\n\n        return { v, translations };\n    },\n});\n\n</script>\n\n<template>\n    <div>\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"v.fields.userFilter\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translations.filter }}\n                </template>\n                <VCFormInput\n                    v-model=\"v.fields.userFilter.$model.value\"\n                    placeholder=\"(|({name_attribute}={{input}})({mail_attribute}={{input}}))\"\n                />\n            </VCFormGroup>\n        </IFieldValidation>\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"v.fields.userBaseDn\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translations.baseDn }}\n                </template>\n                <VCFormInput v-model=\"v.fields.userBaseDn.$model.value\" />\n            </VCFormGroup>\n        </IFieldValidation>\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"v.fields.userNameAttribute\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translations.nameAttribute }}\n                </template>\n                <VCFormInput v-model=\"v.fields.userNameAttribute.$model.value\" />\n            </VCFormGroup>\n        </IFieldValidation>\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"v.fields.userMailAttribute\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translations.mailAttribute }}\n                </template>\n                <VCFormInput v-model=\"v.fields.userMailAttribute.$model.value\" />\n            </VCFormGroup>\n        </IFieldValidation>\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"v.fields.userDisplayNameAttribute\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translations.displayNameAttribute }}\n                </template>\n                <VCFormInput v-model=\"v.fields.userDisplayNameAttribute.$model.value\" />\n            </VCFormGroup>\n        </IFieldValidation>\n    </div>\n</template>\n","<!--\n  - Copyright (c) 2023-2026.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\nimport type { IdentityProvider, LdapIdentityProvider } from '@authup/core-kit';\nimport { TranslatorTranslationFieldKey, TranslatorTranslationNamespace } from '@authup/i18n';\nimport { assignFormProperties, useTranslations } from '../../../core';\nimport { Container } from 'validup';\nimport { useValidup } from '@validup/vue';\nimport type { PropType } from 'vue';\nimport { defineComponent, reactive } from 'vue';\nimport { VCFormGroup, VCFormInput } from '@vuecs/forms';\nimport { onChange, useUpdatedAt } from '../../../composables';\nimport { IFieldValidation } from '@ilingo/validup-vue';\n\nexport default defineComponent({\n    components: {\n        VCFormGroup, \n        VCFormInput, \n        IFieldValidation, \n    },\n    props: {\n        entity: { type: Object as PropType<Partial<IdentityProvider>> },\n        discovery: { type: Boolean, default: false },\n    },\n    emits: ['updated'],\n    setup(props) {\n        const form = reactive({\n            userFilter: '',\n            userBaseDn: '',\n            userNameAttribute: '',\n            userMailAttribute: '',\n            userDisplayNameAttribute: '',\n        });\n\n        const v = useValidup(new Container<typeof form>(), form, { name: 'user' });\n\n        function init() {\n            if (!props.entity) return;\n            assignFormProperties(form, props.entity as Partial<LdapIdentityProvider>, { fields: v.fields });\n        }\n\n        const updated = useUpdatedAt(() => props.entity as IdentityProvider);\n        onChange(updated, () => init());\n        init();\n\n        const translations = useTranslations([\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.FILTER,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.BASE_DN,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.NAME_ATTRIBUTE,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.MAIL_ATTRIBUTE,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.DISPLAY_NAME_ATTRIBUTE,\n            },\n        ]);\n\n        return { v, translations };\n    },\n});\n\n</script>\n\n<template>\n    <div>\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"v.fields.userFilter\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translations.filter }}\n                </template>\n                <VCFormInput\n                    v-model=\"v.fields.userFilter.$model.value\"\n                    placeholder=\"(|({name_attribute}={{input}})({mail_attribute}={{input}}))\"\n                />\n            </VCFormGroup>\n        </IFieldValidation>\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"v.fields.userBaseDn\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translations.baseDn }}\n                </template>\n                <VCFormInput v-model=\"v.fields.userBaseDn.$model.value\" />\n            </VCFormGroup>\n        </IFieldValidation>\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"v.fields.userNameAttribute\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translations.nameAttribute }}\n                </template>\n                <VCFormInput v-model=\"v.fields.userNameAttribute.$model.value\" />\n            </VCFormGroup>\n        </IFieldValidation>\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"v.fields.userMailAttribute\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translations.mailAttribute }}\n                </template>\n                <VCFormInput v-model=\"v.fields.userMailAttribute.$model.value\" />\n            </VCFormGroup>\n        </IFieldValidation>\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"v.fields.userDisplayNameAttribute\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translations.displayNameAttribute }}\n                </template>\n                <VCFormInput v-model=\"v.fields.userDisplayNameAttribute.$model.value\" />\n            </VCFormGroup>\n        </IFieldValidation>\n    </div>\n</template>\n","/*\n * Copyright (c) 2023.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { IdentityProviderProtocol } from '@authup/core-kit';\nimport type { IdentityProviderProtocolElement } from './type';\n\nconst elements = {\n    [IdentityProviderProtocol.OAUTH2]: {\n        name: 'OAuth2',\n        icon: 'fa6-solid:lock',\n    },\n    [IdentityProviderProtocol.OIDC]: {\n        name: 'OpenID Connect',\n        icon: 'fa6-solid:id-card',\n    },\n    [IdentityProviderProtocol.LDAP]: {\n        name: 'LDAP',\n        icon: 'fa6-solid:sitemap',\n    },\n};\n\nexport function getIdentityProviderProtocolElement(\n    id: `${IdentityProviderProtocol}`,\n) : IdentityProviderProtocolElement | undefined {\n    return elements[id];\n}\n","/*\n * Copyright (c) 2023.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport type { IdentityProviderProtocol } from '@authup/core-kit';\nimport { defineComponent } from 'vue';\nimport { hasNormalizedSlot, normalizeSlot } from '../../../core';\nimport { getIdentityProviderProtocolElement } from './protocol';\n\nexport const AIdentityProviderProtocol = defineComponent({\n    props: {\n        id: {\n            type: String,\n            required: true,\n        },\n    },\n    setup(props, setup) {\n        const preset = getIdentityProviderProtocolElement(props.id as IdentityProviderProtocol);\n        if (preset) {\n            if (hasNormalizedSlot('default', setup.slots)) {\n                return () => normalizeSlot('default', preset, setup.slots);\n            }\n        } else if (hasNormalizedSlot('error', setup.slots)) {\n            return () => normalizeSlot('error', {}, setup.slots);\n        }\n\n        return () => [];\n    },\n});\n","<!--\n  - Copyright (c) 2024-2026.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\nimport type { IdentityProvider } from '@authup/core-kit';\nimport { EntityType, IdentityProviderProtocol } from '@authup/core-kit';\nimport {\n    TranslatorTranslationCommonKey,\n    TranslatorTranslationEntityKey,\n    TranslatorTranslationNamespace,\n} from '@authup/i18n';\nimport { Container } from 'validup';\nimport { useValidup } from '@validup/vue';\nimport { VCIcon } from '@vuecs/icon';\nimport type { PropType } from 'vue';\nimport {\n    computed,\n    defineComponent,\n    reactive,\n    ref,\n} from 'vue';\nimport { useIsEditing } from '../../../composables';\nimport { extractValidupResultsFromChild, useTranslations } from '../../../core';\nimport {\n    AFormSubmit,\n    defineEntityManager,\n    defineEntityVEmitOptions,\n} from '../../utility';\nimport AIdentityProviderBasicFields from './AIdentityProviderBasicFields.vue';\nimport AIdentityProviderLdapConnectionFields from './AIdentityProviderLdapConnectionFields.vue';\nimport AIdentityProviderLdapCredentialsFields from './AIdentityProviderLdapCredentialsFields.vue';\nimport AIdentityProviderLdapGroupFields from './AIdentityProviderLdapGroupFields.vue';\nimport AIdentityProviderLdapUserFields from './AIdentityProviderLdapUserFields.vue';\nimport { AIdentityProviderProtocol } from './AIdentityProviderProtocol';\n\nexport default defineComponent({\n    components: {\n        VCIcon,\n        AFormSubmit,\n        AIdentityProviderBasicFields,\n        AIdentityProviderLdapConnectionFields,\n        AIdentityProviderLdapCredentialsFields,\n        AIdentityProviderLdapGroupFields,\n        AIdentityProviderLdapUserFields,\n        AIdentityProviderProtocol,\n    },\n    props: {\n        entity: {\n            type: Object as PropType<IdentityProvider>,\n            required: false,\n            default: undefined,\n        },\n        realmId: {\n            type: String,\n            default: undefined,\n        },\n    },\n    emits: defineEntityVEmitOptions<IdentityProvider>(),\n    setup(props, ctx) {\n        const manager = defineEntityManager({\n            type: EntityType.IDENTITY_PROVIDER,\n            setup: ctx,\n            props,\n        });\n\n        const isEditing = useIsEditing(manager.data);\n        const busy = ref(false);\n        // Parent collector — see APolicyForm for the same pattern.\n        const v = useValidup(new Container(), reactive({}), { stopPropagation: true });\n\n        const isInvalid = computed(() => {\n            const slots = ['basic', 'connection', 'credentials', 'group', 'user'] as const;\n            return slots.some((slot) => !!v.$getResultsForChild(slot)?.$invalid.value);\n        });\n\n        const submit = async () => {\n            if (busy.value || isInvalid.value) {\n                return;\n            }\n\n            busy.value = true;\n            try {\n                const data: Partial<IdentityProvider> = {\n                    ...extractValidupResultsFromChild(v, 'basic'),\n                    ...extractValidupResultsFromChild(v, 'connection'),\n                    ...extractValidupResultsFromChild(v, 'credentials'),\n                    ...extractValidupResultsFromChild(v, 'group'),\n                    ...extractValidupResultsFromChild(v, 'user'),\n                    protocol: IdentityProviderProtocol.LDAP,\n                };\n\n                await manager.createOrUpdate(data);\n            } finally {\n                busy.value = false;\n            }\n        };\n\n        const translations = useTranslations([\n            {\n                namespace: TranslatorTranslationNamespace.COMMON,\n                key: TranslatorTranslationCommonKey.BASIC,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.COMMON,\n                key: TranslatorTranslationCommonKey.SECURITY,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.COMMON,\n                key: TranslatorTranslationCommonKey.CONNECTION,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.ENTITY,\n                key: TranslatorTranslationEntityKey.USER,\n                count: 1,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.COMMON,\n                key: TranslatorTranslationCommonKey.GROUP,\n            },\n        ]);\n\n        return {\n            data: manager.data,\n            busy,\n            isEditing,\n            isInvalid,\n            ldapProtocol: IdentityProviderProtocol.LDAP,\n            translations,\n            submit,\n        };\n    },\n});\n\n</script>\n\n<template>\n    <form @submit.prevent=\"submit\">\n        <AIdentityProviderProtocol\n            v-if=\"!data\"\n            :id=\"ldapProtocol\"\n            :key=\"ldapProtocol\"\n        >\n            <template #default=\"element\">\n                <div>\n                    <h4 class=\"mb-3\">\n                        <VCIcon\n                            :name=\"element.icon\"\n                            class=\"pe-1\"\n                        /> {{ element.name }}\n                    </h4>\n                </div>\n            </template>\n        </AIdentityProviderProtocol>\n\n        <div class=\"flex flex-wrap -mx-2\">\n            <div class=\"flex-1 basis-0 px-2\">\n                <h6>\n                    <VCIcon name=\"fa6-solid:wrench\" /> {{ translations.basic }}\n                </h6>\n                <AIdentityProviderBasicFields :entity=\"data\" />\n            </div>\n            <div class=\"flex-1 basis-0 px-2\">\n                <h6>\n                    <VCIcon name=\"fa6-solid:lock\" /> {{ translations.security }}\n                </h6>\n                <AIdentityProviderLdapCredentialsFields :entity=\"data\" />\n            </div>\n        </div>\n\n        <h6>\n            <VCIcon name=\"fa6-solid:vihara\" /> {{ translations.connection }}\n        </h6>\n        <AIdentityProviderLdapConnectionFields :entity=\"data\" />\n\n        <div class=\"flex flex-wrap -mx-2\">\n            <div class=\"flex-1 basis-0 px-2\">\n                <h6>\n                    <VCIcon name=\"fa6-solid:user\" /> {{ translations.user }}\n                </h6>\n                <AIdentityProviderLdapUserFields :entity=\"data\" />\n            </div>\n            <div class=\"flex-1 basis-0 px-2\">\n                <h6>\n                    <VCIcon name=\"fa6-solid:masks-theater\" /> {{ translations.group }}\n                </h6>\n                <AIdentityProviderLdapGroupFields :entity=\"data\" />\n            </div>\n        </div>\n\n        <AFormSubmit\n            :is-busy=\"busy\"\n            :is-editing=\"isEditing\"\n            :is-invalid=\"isInvalid\"\n            @submit=\"submit\"\n        />\n    </form>\n</template>\n","<!--\n  - Copyright (c) 2024-2026.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\nimport type { IdentityProvider } from '@authup/core-kit';\nimport { EntityType, IdentityProviderProtocol } from '@authup/core-kit';\nimport {\n    TranslatorTranslationCommonKey,\n    TranslatorTranslationEntityKey,\n    TranslatorTranslationNamespace,\n} from '@authup/i18n';\nimport { Container } from 'validup';\nimport { useValidup } from '@validup/vue';\nimport { VCIcon } from '@vuecs/icon';\nimport type { PropType } from 'vue';\nimport {\n    computed,\n    defineComponent,\n    reactive,\n    ref,\n} from 'vue';\nimport { useIsEditing } from '../../../composables';\nimport { extractValidupResultsFromChild, useTranslations } from '../../../core';\nimport {\n    AFormSubmit,\n    defineEntityManager,\n    defineEntityVEmitOptions,\n} from '../../utility';\nimport AIdentityProviderBasicFields from './AIdentityProviderBasicFields.vue';\nimport AIdentityProviderLdapConnectionFields from './AIdentityProviderLdapConnectionFields.vue';\nimport AIdentityProviderLdapCredentialsFields from './AIdentityProviderLdapCredentialsFields.vue';\nimport AIdentityProviderLdapGroupFields from './AIdentityProviderLdapGroupFields.vue';\nimport AIdentityProviderLdapUserFields from './AIdentityProviderLdapUserFields.vue';\nimport { AIdentityProviderProtocol } from './AIdentityProviderProtocol';\n\nexport default defineComponent({\n    components: {\n        VCIcon,\n        AFormSubmit,\n        AIdentityProviderBasicFields,\n        AIdentityProviderLdapConnectionFields,\n        AIdentityProviderLdapCredentialsFields,\n        AIdentityProviderLdapGroupFields,\n        AIdentityProviderLdapUserFields,\n        AIdentityProviderProtocol,\n    },\n    props: {\n        entity: {\n            type: Object as PropType<IdentityProvider>,\n            required: false,\n            default: undefined,\n        },\n        realmId: {\n            type: String,\n            default: undefined,\n        },\n    },\n    emits: defineEntityVEmitOptions<IdentityProvider>(),\n    setup(props, ctx) {\n        const manager = defineEntityManager({\n            type: EntityType.IDENTITY_PROVIDER,\n            setup: ctx,\n            props,\n        });\n\n        const isEditing = useIsEditing(manager.data);\n        const busy = ref(false);\n        // Parent collector — see APolicyForm for the same pattern.\n        const v = useValidup(new Container(), reactive({}), { stopPropagation: true });\n\n        const isInvalid = computed(() => {\n            const slots = ['basic', 'connection', 'credentials', 'group', 'user'] as const;\n            return slots.some((slot) => !!v.$getResultsForChild(slot)?.$invalid.value);\n        });\n\n        const submit = async () => {\n            if (busy.value || isInvalid.value) {\n                return;\n            }\n\n            busy.value = true;\n            try {\n                const data: Partial<IdentityProvider> = {\n                    ...extractValidupResultsFromChild(v, 'basic'),\n                    ...extractValidupResultsFromChild(v, 'connection'),\n                    ...extractValidupResultsFromChild(v, 'credentials'),\n                    ...extractValidupResultsFromChild(v, 'group'),\n                    ...extractValidupResultsFromChild(v, 'user'),\n                    protocol: IdentityProviderProtocol.LDAP,\n                };\n\n                await manager.createOrUpdate(data);\n            } finally {\n                busy.value = false;\n            }\n        };\n\n        const translations = useTranslations([\n            {\n                namespace: TranslatorTranslationNamespace.COMMON,\n                key: TranslatorTranslationCommonKey.BASIC,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.COMMON,\n                key: TranslatorTranslationCommonKey.SECURITY,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.COMMON,\n                key: TranslatorTranslationCommonKey.CONNECTION,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.ENTITY,\n                key: TranslatorTranslationEntityKey.USER,\n                count: 1,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.COMMON,\n                key: TranslatorTranslationCommonKey.GROUP,\n            },\n        ]);\n\n        return {\n            data: manager.data,\n            busy,\n            isEditing,\n            isInvalid,\n            ldapProtocol: IdentityProviderProtocol.LDAP,\n            translations,\n            submit,\n        };\n    },\n});\n\n</script>\n\n<template>\n    <form @submit.prevent=\"submit\">\n        <AIdentityProviderProtocol\n            v-if=\"!data\"\n            :id=\"ldapProtocol\"\n            :key=\"ldapProtocol\"\n        >\n            <template #default=\"element\">\n                <div>\n                    <h4 class=\"mb-3\">\n                        <VCIcon\n                            :name=\"element.icon\"\n                            class=\"pe-1\"\n                        /> {{ element.name }}\n                    </h4>\n                </div>\n            </template>\n        </AIdentityProviderProtocol>\n\n        <div class=\"flex flex-wrap -mx-2\">\n            <div class=\"flex-1 basis-0 px-2\">\n                <h6>\n                    <VCIcon name=\"fa6-solid:wrench\" /> {{ translations.basic }}\n                </h6>\n                <AIdentityProviderBasicFields :entity=\"data\" />\n            </div>\n            <div class=\"flex-1 basis-0 px-2\">\n                <h6>\n                    <VCIcon name=\"fa6-solid:lock\" /> {{ translations.security }}\n                </h6>\n                <AIdentityProviderLdapCredentialsFields :entity=\"data\" />\n            </div>\n        </div>\n\n        <h6>\n            <VCIcon name=\"fa6-solid:vihara\" /> {{ translations.connection }}\n        </h6>\n        <AIdentityProviderLdapConnectionFields :entity=\"data\" />\n\n        <div class=\"flex flex-wrap -mx-2\">\n            <div class=\"flex-1 basis-0 px-2\">\n                <h6>\n                    <VCIcon name=\"fa6-solid:user\" /> {{ translations.user }}\n                </h6>\n                <AIdentityProviderLdapUserFields :entity=\"data\" />\n            </div>\n            <div class=\"flex-1 basis-0 px-2\">\n                <h6>\n                    <VCIcon name=\"fa6-solid:masks-theater\" /> {{ translations.group }}\n                </h6>\n                <AIdentityProviderLdapGroupFields :entity=\"data\" />\n            </div>\n        </div>\n\n        <AFormSubmit\n            :is-busy=\"busy\"\n            :is-editing=\"isEditing\"\n            :is-invalid=\"isInvalid\"\n            @submit=\"submit\"\n        />\n    </form>\n</template>\n","/*\n * Copyright (c) 2023.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { IdentityProviderPreset } from '@authup/core-kit';\nimport type { IdentityProviderPresetElement } from './type';\n\nconst elements = {\n    [IdentityProviderPreset.FACEBOOK]: {\n        name: 'Facebook',\n        icon: 'fa6-brands:facebook',\n    },\n    [IdentityProviderPreset.GITHUB]: {\n        name: 'GitHub',\n        icon: 'fa6-brands:github',\n    },\n    [IdentityProviderPreset.GITLAB]: {\n        name: 'GitLab',\n        icon: 'fa6-brands:gitlab',\n    },\n    [IdentityProviderPreset.GOOGLE]: {\n        name: 'Google',\n        icon: 'fa6-brands:google',\n    },\n    [IdentityProviderPreset.PAYPAL]: {\n        name: 'Paypal',\n        icon: 'fa6-brands:paypal',\n    },\n    [IdentityProviderPreset.INSTAGRAM]: {\n        name: 'Instagram',\n        icon: 'fa6-brands:instagram',\n    },\n    [IdentityProviderPreset.STACKOVERFLOW]: {\n        name: 'StackOverflow',\n        icon: 'fa6-brands:stack-overflow',\n    },\n    [IdentityProviderPreset.TWITTER]: {\n        name: 'Twitter',\n        icon: 'fa6-brands:twitter',\n    },\n};\n\nexport function getIdentityProviderPresetElement(\n    id: `${IdentityProviderPreset}`,\n) : IdentityProviderPresetElement | undefined {\n    return elements[id];\n}\n","/*\n * Copyright (c) 2023.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport type { IdentityProviderPreset } from '@authup/core-kit';\nimport { defineComponent } from 'vue';\nimport { getIdentityProviderPresetElement } from './preset';\nimport { hasNormalizedSlot, normalizeSlot } from '../../../core';\n\nexport const AIdentityProviderPreset = defineComponent({\n    props: {\n        id: {\n            type: String,\n            required: true,\n        },\n    },\n    setup(props, setup) {\n        const preset = getIdentityProviderPresetElement(props.id as IdentityProviderPreset);\n        if (preset) {\n            if (hasNormalizedSlot('default', setup.slots)) {\n                return () => normalizeSlot('default', preset, setup.slots);\n            }\n        } else if (hasNormalizedSlot('error', setup.slots)) {\n            return () => normalizeSlot('error', {}, setup.slots);\n        }\n\n        return () => [];\n    },\n});\n","<script lang=\"ts\">\nimport { IdentityProviderPreset, IdentityProviderProtocol } from '@authup/core-kit';\nimport { TranslatorTranslationFieldKey, TranslatorTranslationNamespace } from '@authup/i18n';\nimport { defineComponent } from 'vue';\nimport { VCIcon } from '@vuecs/icon';\nimport { useTranslations } from '../../../core';\nimport { AIdentityProviderPreset } from './AIdentityProviderPreset';\nimport { AIdentityProviderProtocol } from './AIdentityProviderProtocol';\n\nexport default defineComponent({\n    components: {\n        AIdentityProviderPreset,\n        AIdentityProviderProtocol,\n        VCIcon,\n    },\n    props: {\n        protocol: { type: String },\n        preset: { type: String },\n    },\n    emits: ['pick'],\n    setup(props, setup) {\n        const protocols = Object.values(IdentityProviderProtocol);\n        const presets = Object.values(IdentityProviderPreset);\n\n        const pickProtocol = (protocol: string) => {\n            setup.emit('pick', 'protocol', protocol);\n        };\n\n        const pickPreset = (preset: string) => {\n            setup.emit('pick', 'preset', preset);\n        };\n\n        const translations = useTranslations([\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.PROTOCOLS,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.PRESETS,\n            },\n        ]);\n\n        return {\n            protocols,\n            presets,\n            translations,\n            pickProtocol,\n            pickPreset,\n        };\n    },\n});\n</script>\n<template>\n    <div class=\"flex flex-col gap-2\">\n        <div>\n            <h6>{{ translations.protocols }}</h6>\n\n            <div class=\"flex flex-row gap-2 flex-wrap\">\n                <template\n                    v-for=\"(item, key) in protocols\"\n                    :key=\"key\"\n                >\n                    <AIdentityProviderProtocol :id=\"item\">\n                        <template #default=\"props\">\n                            <div\n                                :class=\"{'active': item === protocol && !preset}\"\n                                class=\"flex flex-col gap-1 text-center a-picker-item\"\n                                @click.prevent=\"pickProtocol(item)\"\n                            >\n                                <div>\n                                    <VCIcon\n                                        class=\"text-2xl\"\n                                        :name=\"props.icon\"\n                                    />\n                                </div>\n                                <div>\n                                    {{ props.name }}\n                                </div>\n                            </div>\n                        </template>\n                    </AIdentityProviderProtocol>\n                </template>\n            </div>\n        </div>\n        <div>\n            <h6>{{ translations.presets }}</h6>\n\n            <div class=\"flex flex-row gap-2 flex-wrap\">\n                <template\n                    v-for=\"(item, key) in presets\"\n                    :key=\"key\"\n                >\n                    <AIdentityProviderPreset :id=\"item\">\n                        <template #default=\"props\">\n                            <div\n                                :class=\"{'active': item === preset}\"\n                                class=\"flex flex-col gap-1 text-center a-picker-item\"\n                                @click.prevent=\"pickPreset(item)\"\n                            >\n                                <div>\n                                    <VCIcon\n                                        class=\"text-2xl\"\n                                        :name=\"props.icon\"\n                                    />\n                                </div>\n                                <div>\n                                    {{ props.name }}\n                                </div>\n                            </div>\n                        </template>\n                    </AIdentityProviderPreset>\n                </template>\n            </div>\n        </div>\n    </div>\n</template>\n","<script lang=\"ts\">\nimport { IdentityProviderPreset, IdentityProviderProtocol } from '@authup/core-kit';\nimport { TranslatorTranslationFieldKey, TranslatorTranslationNamespace } from '@authup/i18n';\nimport { defineComponent } from 'vue';\nimport { VCIcon } from '@vuecs/icon';\nimport { useTranslations } from '../../../core';\nimport { AIdentityProviderPreset } from './AIdentityProviderPreset';\nimport { AIdentityProviderProtocol } from './AIdentityProviderProtocol';\n\nexport default defineComponent({\n    components: {\n        AIdentityProviderPreset,\n        AIdentityProviderProtocol,\n        VCIcon,\n    },\n    props: {\n        protocol: { type: String },\n        preset: { type: String },\n    },\n    emits: ['pick'],\n    setup(props, setup) {\n        const protocols = Object.values(IdentityProviderProtocol);\n        const presets = Object.values(IdentityProviderPreset);\n\n        const pickProtocol = (protocol: string) => {\n            setup.emit('pick', 'protocol', protocol);\n        };\n\n        const pickPreset = (preset: string) => {\n            setup.emit('pick', 'preset', preset);\n        };\n\n        const translations = useTranslations([\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.PROTOCOLS,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.PRESETS,\n            },\n        ]);\n\n        return {\n            protocols,\n            presets,\n            translations,\n            pickProtocol,\n            pickPreset,\n        };\n    },\n});\n</script>\n<template>\n    <div class=\"flex flex-col gap-2\">\n        <div>\n            <h6>{{ translations.protocols }}</h6>\n\n            <div class=\"flex flex-row gap-2 flex-wrap\">\n                <template\n                    v-for=\"(item, key) in protocols\"\n                    :key=\"key\"\n                >\n                    <AIdentityProviderProtocol :id=\"item\">\n                        <template #default=\"props\">\n                            <div\n                                :class=\"{'active': item === protocol && !preset}\"\n                                class=\"flex flex-col gap-1 text-center a-picker-item\"\n                                @click.prevent=\"pickProtocol(item)\"\n                            >\n                                <div>\n                                    <VCIcon\n                                        class=\"text-2xl\"\n                                        :name=\"props.icon\"\n                                    />\n                                </div>\n                                <div>\n                                    {{ props.name }}\n                                </div>\n                            </div>\n                        </template>\n                    </AIdentityProviderProtocol>\n                </template>\n            </div>\n        </div>\n        <div>\n            <h6>{{ translations.presets }}</h6>\n\n            <div class=\"flex flex-row gap-2 flex-wrap\">\n                <template\n                    v-for=\"(item, key) in presets\"\n                    :key=\"key\"\n                >\n                    <AIdentityProviderPreset :id=\"item\">\n                        <template #default=\"props\">\n                            <div\n                                :class=\"{'active': item === preset}\"\n                                class=\"flex flex-col gap-1 text-center a-picker-item\"\n                                @click.prevent=\"pickPreset(item)\"\n                            >\n                                <div>\n                                    <VCIcon\n                                        class=\"text-2xl\"\n                                        :name=\"props.icon\"\n                                    />\n                                </div>\n                                <div>\n                                    {{ props.name }}\n                                </div>\n                            </div>\n                        </template>\n                    </AIdentityProviderPreset>\n                </template>\n            </div>\n        </div>\n    </div>\n</template>\n","<!--\n  - Copyright (c) 2023-2026.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\nimport type { IdentityProvider, OAuth2IdentityProvider } from '@authup/core-kit';\nimport { IdentityProviderOAuth2AttributesValidator } from '@authup/core-kit';\nimport {\n    TranslatorTranslationActionKey,\n    TranslatorTranslationFieldKey,\n    TranslatorTranslationNamespace,\n} from '@authup/i18n';\nimport { splitOAuth2Scope } from '@authup/specs';\nimport { assignFormProperties, useTranslations } from '../../../core';\nimport { useValidup } from '@validup/vue';\nimport type { PropType } from 'vue';\nimport {\n    computed,\n    defineComponent,\n    reactive,\n    ref,\n} from 'vue';\nimport { VCFormGroup, VCFormInput } from '@vuecs/forms';\nimport { VCIcon } from '@vuecs/icon';\nimport { onChange, useUpdatedAt } from '../../../composables';\nimport { IFieldValidation } from '@ilingo/validup-vue';\nimport { AFormInputList } from '../../utility';\n\nexport default defineComponent({\n    components: {\n        AFormInputList,\n        VCFormGroup,\n        VCFormInput,\n        VCIcon,\n        IFieldValidation,\n    },\n    props: { entity: { type: Object as PropType<Partial<IdentityProvider>> } },\n    emits: ['updated'],\n    setup(props) {\n        const form = reactive({\n            clientId: '', \n            clientSecret: '',\n            scope: '',\n            requiredAmr: '',\n            requiredAcr: '',\n        });\n\n        const secretShow = ref(false);\n\n        // Shared server-side validator, scoped to the keys this sub-form\n        // owns via `pathsToInclude` — `clientId` stays required for every\n        // OAuth2/OIDC flavor, `clientSecret` optional (a secret-less\n        // public-client token exchange is a valid provider config), `scope`\n        // optional (blank = protocol/preset default), and the two assurance\n        // allow-lists optional (blank = trust the provider). The remaining\n        // mounts (`preset`, endpoint URLs) belong to sibling sub-forms and\n        // are filtered out here.\n        const v = useValidup(\n            new IdentityProviderOAuth2AttributesValidator({ pathsToInclude: ['clientId', 'clientSecret', 'scope', 'requiredAmr', 'requiredAcr'] }),\n            form,\n            { name: 'client' },\n        );\n\n        // `scope` is an optional key on `OAuth2IdentityProvider`, so the\n        // typed `fields` accessor yields `FieldState | undefined` under\n        // strict consumers — the dynamic `at()` accessor materialises the\n        // state and is never undefined. Same for the assurance allow-lists.\n        const scopeField = v.fields.at<string | null>('scope');\n        const requiredAmrField = v.fields.at<string | null>('requiredAmr');\n        const requiredAcrField = v.fields.at<string | null>('requiredAcr');\n\n        const scopes = computed(() => splitOAuth2Scope(scopeField.$model.value));\n\n        function assign() {\n            assignFormProperties(form, props.entity as Partial<OAuth2IdentityProvider>, { fields: v.fields });\n        }\n\n        const updatedAt = useUpdatedAt(() => props.entity as IdentityProvider);\n        onChange(updatedAt, () => assign());\n        assign();\n\n        const translations = useTranslations([\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.CLIENT_ID,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.CLIENT_SECRET,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.SCOPE,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.REQUIRED_AMR,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.REQUIRED_AMR_HINT,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.REQUIRED_ACR,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.REQUIRED_ACR_HINT,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.ACTION,\n                key: TranslatorTranslationActionKey.SHOW,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.ACTION,\n                key: TranslatorTranslationActionKey.HIDE,\n            },\n        ]);\n\n        const secretToggleLabel = computed(() => (secretShow.value ? translations.hide : translations.show));\n\n        return {\n            v,\n            scopeField,\n            requiredAmrField,\n            requiredAcrField,\n            scopes,\n            secretShow,\n            secretToggleLabel,\n            translations,\n        };\n    },\n});\n\n</script>\n\n<template>\n    <div>\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"v.fields.clientId\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translations.clientId }}\n                </template>\n                <VCFormInput v-model=\"v.fields.clientId.$model.value\" />\n            </VCFormGroup>\n        </IFieldValidation>\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"v.fields.clientSecret\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translations.clientSecret }}\n                </template>\n                <VCFormInput\n                    v-model=\"v.fields.clientSecret.$model.value\"\n                    :type=\"secretShow ? 'text' : 'password'\"\n                    autocomplete=\"new-password\"\n                >\n                    <template #groupAppend=\"{ class: appendClass }\">\n                        <button\n                            type=\"button\"\n                            :class=\"appendClass\"\n                            class=\"cursor-pointer transition-colors hover:bg-bg-elevated\"\n                            :aria-label=\"secretToggleLabel\"\n                            :title=\"secretToggleLabel\"\n                            @click.prevent=\"secretShow = !secretShow\"\n                        >\n                            <VCIcon\n                                aria-hidden=\"true\"\n                                :name=\"secretShow ? 'fa6-solid:eye-slash' : 'fa6-solid:eye'\"\n                            />\n                        </button>\n                    </template>\n                </VCFormInput>\n            </VCFormGroup>\n        </IFieldValidation>\n        <AFormInputList\n            :names=\"scopes\"\n            @changed=\"(value) => {\n                scopeField.$model.value = value.length === 0 ? '' : value.join(' ');\n            }\"\n        >\n            <template #label>\n                {{ translations.scope }}\n            </template>\n        </AFormInputList>\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"requiredAmrField\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translations.requiredAmr }}\n                </template>\n                <VCFormInput\n                    v-model=\"requiredAmrField.$model.value\"\n                    placeholder=\"mfa, hwk\"\n                />\n                <template #hint>\n                    {{ translations.requiredAmrHint }}\n                </template>\n            </VCFormGroup>\n        </IFieldValidation>\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"requiredAcrField\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translations.requiredAcr }}\n                </template>\n                <VCFormInput\n                    v-model=\"requiredAcrField.$model.value\"\n                    placeholder=\"urn:mace:incommon:iap:silver\"\n                />\n                <template #hint>\n                    {{ translations.requiredAcrHint }}\n                </template>\n            </VCFormGroup>\n        </IFieldValidation>\n    </div>\n</template>\n","<!--\n  - Copyright (c) 2023-2026.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\nimport type { IdentityProvider, OAuth2IdentityProvider } from '@authup/core-kit';\nimport { IdentityProviderOAuth2AttributesValidator } from '@authup/core-kit';\nimport {\n    TranslatorTranslationActionKey,\n    TranslatorTranslationFieldKey,\n    TranslatorTranslationNamespace,\n} from '@authup/i18n';\nimport { splitOAuth2Scope } from '@authup/specs';\nimport { assignFormProperties, useTranslations } from '../../../core';\nimport { useValidup } from '@validup/vue';\nimport type { PropType } from 'vue';\nimport {\n    computed,\n    defineComponent,\n    reactive,\n    ref,\n} from 'vue';\nimport { VCFormGroup, VCFormInput } from '@vuecs/forms';\nimport { VCIcon } from '@vuecs/icon';\nimport { onChange, useUpdatedAt } from '../../../composables';\nimport { IFieldValidation } from '@ilingo/validup-vue';\nimport { AFormInputList } from '../../utility';\n\nexport default defineComponent({\n    components: {\n        AFormInputList,\n        VCFormGroup,\n        VCFormInput,\n        VCIcon,\n        IFieldValidation,\n    },\n    props: { entity: { type: Object as PropType<Partial<IdentityProvider>> } },\n    emits: ['updated'],\n    setup(props) {\n        const form = reactive({\n            clientId: '', \n            clientSecret: '',\n            scope: '',\n            requiredAmr: '',\n            requiredAcr: '',\n        });\n\n        const secretShow = ref(false);\n\n        // Shared server-side validator, scoped to the keys this sub-form\n        // owns via `pathsToInclude` — `clientId` stays required for every\n        // OAuth2/OIDC flavor, `clientSecret` optional (a secret-less\n        // public-client token exchange is a valid provider config), `scope`\n        // optional (blank = protocol/preset default), and the two assurance\n        // allow-lists optional (blank = trust the provider). The remaining\n        // mounts (`preset`, endpoint URLs) belong to sibling sub-forms and\n        // are filtered out here.\n        const v = useValidup(\n            new IdentityProviderOAuth2AttributesValidator({ pathsToInclude: ['clientId', 'clientSecret', 'scope', 'requiredAmr', 'requiredAcr'] }),\n            form,\n            { name: 'client' },\n        );\n\n        // `scope` is an optional key on `OAuth2IdentityProvider`, so the\n        // typed `fields` accessor yields `FieldState | undefined` under\n        // strict consumers — the dynamic `at()` accessor materialises the\n        // state and is never undefined. Same for the assurance allow-lists.\n        const scopeField = v.fields.at<string | null>('scope');\n        const requiredAmrField = v.fields.at<string | null>('requiredAmr');\n        const requiredAcrField = v.fields.at<string | null>('requiredAcr');\n\n        const scopes = computed(() => splitOAuth2Scope(scopeField.$model.value));\n\n        function assign() {\n            assignFormProperties(form, props.entity as Partial<OAuth2IdentityProvider>, { fields: v.fields });\n        }\n\n        const updatedAt = useUpdatedAt(() => props.entity as IdentityProvider);\n        onChange(updatedAt, () => assign());\n        assign();\n\n        const translations = useTranslations([\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.CLIENT_ID,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.CLIENT_SECRET,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.SCOPE,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.REQUIRED_AMR,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.REQUIRED_AMR_HINT,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.REQUIRED_ACR,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.REQUIRED_ACR_HINT,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.ACTION,\n                key: TranslatorTranslationActionKey.SHOW,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.ACTION,\n                key: TranslatorTranslationActionKey.HIDE,\n            },\n        ]);\n\n        const secretToggleLabel = computed(() => (secretShow.value ? translations.hide : translations.show));\n\n        return {\n            v,\n            scopeField,\n            requiredAmrField,\n            requiredAcrField,\n            scopes,\n            secretShow,\n            secretToggleLabel,\n            translations,\n        };\n    },\n});\n\n</script>\n\n<template>\n    <div>\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"v.fields.clientId\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translations.clientId }}\n                </template>\n                <VCFormInput v-model=\"v.fields.clientId.$model.value\" />\n            </VCFormGroup>\n        </IFieldValidation>\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"v.fields.clientSecret\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translations.clientSecret }}\n                </template>\n                <VCFormInput\n                    v-model=\"v.fields.clientSecret.$model.value\"\n                    :type=\"secretShow ? 'text' : 'password'\"\n                    autocomplete=\"new-password\"\n                >\n                    <template #groupAppend=\"{ class: appendClass }\">\n                        <button\n                            type=\"button\"\n                            :class=\"appendClass\"\n                            class=\"cursor-pointer transition-colors hover:bg-bg-elevated\"\n                            :aria-label=\"secretToggleLabel\"\n                            :title=\"secretToggleLabel\"\n                            @click.prevent=\"secretShow = !secretShow\"\n                        >\n                            <VCIcon\n                                aria-hidden=\"true\"\n                                :name=\"secretShow ? 'fa6-solid:eye-slash' : 'fa6-solid:eye'\"\n                            />\n                        </button>\n                    </template>\n                </VCFormInput>\n            </VCFormGroup>\n        </IFieldValidation>\n        <AFormInputList\n            :names=\"scopes\"\n            @changed=\"(value) => {\n                scopeField.$model.value = value.length === 0 ? '' : value.join(' ');\n            }\"\n        >\n            <template #label>\n                {{ translations.scope }}\n            </template>\n        </AFormInputList>\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"requiredAmrField\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translations.requiredAmr }}\n                </template>\n                <VCFormInput\n                    v-model=\"requiredAmrField.$model.value\"\n                    placeholder=\"mfa, hwk\"\n                />\n                <template #hint>\n                    {{ translations.requiredAmrHint }}\n                </template>\n            </VCFormGroup>\n        </IFieldValidation>\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"requiredAcrField\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translations.requiredAcr }}\n                </template>\n                <VCFormInput\n                    v-model=\"requiredAcrField.$model.value\"\n                    placeholder=\"urn:mace:incommon:iap:silver\"\n                />\n                <template #hint>\n                    {{ translations.requiredAcrHint }}\n                </template>\n            </VCFormGroup>\n        </IFieldValidation>\n    </div>\n</template>\n","<!--\n  - Copyright (c) 2023-2026.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\nimport { Client } from '@authup/core-http-kit';\nimport {\n    TranslatorTranslationActionKey,\n    TranslatorTranslationClientKey,\n    TranslatorTranslationFieldKey,\n    TranslatorTranslationNamespace,\n} from '@authup/i18n';\nimport { isOpenIDProviderMetadata } from '@authup/specs';\nimport { createValidator } from '@validup/zod';\nimport { Container } from 'validup';\nimport { useValidup } from '@validup/vue';\nimport { z } from 'zod';\nimport type { PropType } from 'vue';\nimport {\n    computed,\n    defineComponent,\n    reactive,\n    ref,\n} from 'vue';\nimport { VCFormGroup, VCFormInput } from '@vuecs/forms';\nimport { VCAlert } from '@vuecs/elements';\nimport type { ButtonSize } from '@vuecs/button';\nimport { VCButton } from '@vuecs/button';\nimport { VCIcon } from '@vuecs/icon';\nimport { IFieldValidation } from '@ilingo/validup-vue';\nimport { DEFAULT_BUTTON_SIZE, useTranslations, useTranslator } from '../../../core';\n\n// Standalone form (not a registered child) — uses its own URL\n// validator since `@authup/core-kit` doesn't ship a \"discovery URL\"\n// validator and this is a one-off field whose validation lives in\n// the consumer.\nclass DiscoveryUrlValidator extends Container<{ url: string }> {\n    protected override initialize() {\n        super.initialize();\n        this.mount('url', { optional: true }, createValidator(z.url()));\n    }\n}\n\nexport default defineComponent({\n    components: {\n        VCFormGroup,\n        VCFormInput,\n        VCAlert,\n        VCButton,\n        VCIcon,\n        IFieldValidation,\n    },\n    props: {\n        size: {\n            type: String as PropType<ButtonSize>,\n            default: DEFAULT_BUTTON_SIZE,\n        },\n    },\n    emits: ['lookup', 'failed'],\n    setup(_, setup) {\n        const busy = ref(false);\n        const form = reactive({ url: '' });\n\n        // Detached so it doesn't register with the parent OAuth2 form\n        // collector — it's a sibling helper, not part of the submit\n        // payload.\n        const v = useValidup(new DiscoveryUrlValidator(), form, { detached: true });\n\n        const lookupValid = ref(false);\n        const message = ref<string | null>(null);\n\n        const apiClient = new Client();\n\n        const translate = useTranslator();\n        const translations = useTranslations([\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.DISCOVERY,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.ACTION,\n                key: TranslatorTranslationActionKey.LOOKUP,\n            },\n        ]);\n\n        const lookup = async () => {\n            if (busy.value || v.fields.url.$invalid.value) {\n                return;\n            }\n\n            busy.value = true;\n            message.value = null;\n            lookupValid.value = false;\n\n            try {\n                const response = await apiClient.get(form.url);\n                if (isOpenIDProviderMetadata(response.data)) {\n                    setup.emit('lookup', response.data);\n                    lookupValid.value = true;\n                }\n            } catch (e) {\n                lookupValid.value = false;\n\n                if (e instanceof Error) {\n                    message.value = await translate({\n                        namespace: TranslatorTranslationNamespace.CLIENT,\n                        key: TranslatorTranslationClientKey.LOOKUP_FAILED,\n                        data: { message: e.message },\n                    });\n                    setup.emit('failed', e);\n                }\n            } finally {\n                busy.value = false;\n            }\n        };\n\n        const isDisabled = computed(() => busy.value || !form.url || v.$invalid.value);\n\n        return {\n            v,\n            message,\n            lookupValid,\n            isDisabled,\n            translations,\n            lookup,\n        };\n    },\n});\n\n</script>\n\n<template>\n    <div>\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"v.fields.url\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translations.discovery }}\n                </template>\n                <VCFormInput\n                    v-model=\"v.fields.url.$model.value\"\n                    :class=\"{ 'border-success-600 ring-1 ring-success-500': lookupValid }\"\n                    placeholder=\"https://example.com/.well-known/openid-configuration\"\n                />\n            </VCFormGroup>\n        </IFieldValidation>\n        <VCAlert\n            v-if=\"message\"\n            color=\"warning\"\n            variant=\"soft\"\n            size=\"sm\"\n            class=\"mb-3\"\n        >\n            {{ message }}\n        </VCAlert>\n        <VCButton\n            type=\"button\"\n            :size=\"size\"\n            color=\"primary\"\n            class=\"mb-1\"\n            :disabled=\"isDisabled\"\n            @click.prevent=\"lookup\"\n        >\n            <VCIcon\n                name=\"fa6-solid:magnifying-glass\"\n                class=\"pe-1\"\n            /> {{ translations.lookup }}\n        </VCButton>\n    </div>\n</template>\n","<!--\n  - Copyright (c) 2023-2026.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\nimport { Client } from '@authup/core-http-kit';\nimport {\n    TranslatorTranslationActionKey,\n    TranslatorTranslationClientKey,\n    TranslatorTranslationFieldKey,\n    TranslatorTranslationNamespace,\n} from '@authup/i18n';\nimport { isOpenIDProviderMetadata } from '@authup/specs';\nimport { createValidator } from '@validup/zod';\nimport { Container } from 'validup';\nimport { useValidup } from '@validup/vue';\nimport { z } from 'zod';\nimport type { PropType } from 'vue';\nimport {\n    computed,\n    defineComponent,\n    reactive,\n    ref,\n} from 'vue';\nimport { VCFormGroup, VCFormInput } from '@vuecs/forms';\nimport { VCAlert } from '@vuecs/elements';\nimport type { ButtonSize } from '@vuecs/button';\nimport { VCButton } from '@vuecs/button';\nimport { VCIcon } from '@vuecs/icon';\nimport { IFieldValidation } from '@ilingo/validup-vue';\nimport { DEFAULT_BUTTON_SIZE, useTranslations, useTranslator } from '../../../core';\n\n// Standalone form (not a registered child) — uses its own URL\n// validator since `@authup/core-kit` doesn't ship a \"discovery URL\"\n// validator and this is a one-off field whose validation lives in\n// the consumer.\nclass DiscoveryUrlValidator extends Container<{ url: string }> {\n    protected override initialize() {\n        super.initialize();\n        this.mount('url', { optional: true }, createValidator(z.url()));\n    }\n}\n\nexport default defineComponent({\n    components: {\n        VCFormGroup,\n        VCFormInput,\n        VCAlert,\n        VCButton,\n        VCIcon,\n        IFieldValidation,\n    },\n    props: {\n        size: {\n            type: String as PropType<ButtonSize>,\n            default: DEFAULT_BUTTON_SIZE,\n        },\n    },\n    emits: ['lookup', 'failed'],\n    setup(_, setup) {\n        const busy = ref(false);\n        const form = reactive({ url: '' });\n\n        // Detached so it doesn't register with the parent OAuth2 form\n        // collector — it's a sibling helper, not part of the submit\n        // payload.\n        const v = useValidup(new DiscoveryUrlValidator(), form, { detached: true });\n\n        const lookupValid = ref(false);\n        const message = ref<string | null>(null);\n\n        const apiClient = new Client();\n\n        const translate = useTranslator();\n        const translations = useTranslations([\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.DISCOVERY,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.ACTION,\n                key: TranslatorTranslationActionKey.LOOKUP,\n            },\n        ]);\n\n        const lookup = async () => {\n            if (busy.value || v.fields.url.$invalid.value) {\n                return;\n            }\n\n            busy.value = true;\n            message.value = null;\n            lookupValid.value = false;\n\n            try {\n                const response = await apiClient.get(form.url);\n                if (isOpenIDProviderMetadata(response.data)) {\n                    setup.emit('lookup', response.data);\n                    lookupValid.value = true;\n                }\n            } catch (e) {\n                lookupValid.value = false;\n\n                if (e instanceof Error) {\n                    message.value = await translate({\n                        namespace: TranslatorTranslationNamespace.CLIENT,\n                        key: TranslatorTranslationClientKey.LOOKUP_FAILED,\n                        data: { message: e.message },\n                    });\n                    setup.emit('failed', e);\n                }\n            } finally {\n                busy.value = false;\n            }\n        };\n\n        const isDisabled = computed(() => busy.value || !form.url || v.$invalid.value);\n\n        return {\n            v,\n            message,\n            lookupValid,\n            isDisabled,\n            translations,\n            lookup,\n        };\n    },\n});\n\n</script>\n\n<template>\n    <div>\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"v.fields.url\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translations.discovery }}\n                </template>\n                <VCFormInput\n                    v-model=\"v.fields.url.$model.value\"\n                    :class=\"{ 'border-success-600 ring-1 ring-success-500': lookupValid }\"\n                    placeholder=\"https://example.com/.well-known/openid-configuration\"\n                />\n            </VCFormGroup>\n        </IFieldValidation>\n        <VCAlert\n            v-if=\"message\"\n            color=\"warning\"\n            variant=\"soft\"\n            size=\"sm\"\n            class=\"mb-3\"\n        >\n            {{ message }}\n        </VCAlert>\n        <VCButton\n            type=\"button\"\n            :size=\"size\"\n            color=\"primary\"\n            class=\"mb-1\"\n            :disabled=\"isDisabled\"\n            @click.prevent=\"lookup\"\n        >\n            <VCIcon\n                name=\"fa6-solid:magnifying-glass\"\n                class=\"pe-1\"\n            /> {{ translations.lookup }}\n        </VCButton>\n    </div>\n</template>\n","<!--\n  Copyright (c) 2023.\n  Author Peter Placzek (tada5hi)\n  For the full copyright and license information,\n  view the LICENSE file that was distributed with this source code.\n-->\n\n<script lang=\"ts\">\nimport type { IdentityProvider, OAuth2IdentityProvider } from '@authup/core-kit';\nimport { IdentityProviderOAuth2AttributesValidator } from '@authup/core-kit';\nimport {\n    TranslatorTranslationActionKey,\n    TranslatorTranslationFieldKey,\n    TranslatorTranslationNamespace,\n} from '@authup/i18n';\nimport type { OpenIDProviderMetadata } from '@authup/specs';\nimport { VCFormGroup, VCFormInput } from '@vuecs/forms';\nimport { useValidup } from '@validup/vue';\nimport { assignFormProperties, useTranslations } from '../../../core';\nimport type { PropType } from 'vue';\nimport { defineComponent, reactive } from 'vue';\nimport { onChange, useUpdatedAt } from '../../../composables';\nimport AIdentityProviderOAuth2Discovery from './AIdentityProviderOAuth2Discovery.vue';\nimport { IFieldValidation } from '@ilingo/validup-vue';\n\nexport default defineComponent({\n    components: {\n        VCFormGroup,\n        VCFormInput,\n        AIdentityProviderOAuth2Discovery,\n\n        IFieldValidation,\n    },\n    props: {\n        entity: { type: Object as PropType<Partial<IdentityProvider>> },\n        discovery: {\n            type: Boolean,\n            default: false,\n        },\n    },\n    emits: ['updated'],\n    setup(props) {\n        const form = reactive({\n            tokenUrl: '',\n            authorizeUrl: '',\n            userInfoUrl: '',\n        });\n\n        // Shared server-side validator, scoped to the endpoint keys via\n        // `pathsToInclude` — `tokenUrl` and `authorizeUrl` are required\n        // for non-preset OAuth2/OIDC providers (this sub-form is only\n        // rendered when no preset is selected), `userInfoUrl` optional.\n        const v = useValidup(\n            new IdentityProviderOAuth2AttributesValidator({ pathsToInclude: ['tokenUrl', 'authorizeUrl', 'userInfoUrl'] }),\n            form,\n            { name: 'endpoint' },\n        );\n\n        // `userInfoUrl` is an optional key on `OAuth2IdentityProvider`, so\n        // the typed `fields` accessor yields `FieldState | undefined` for it\n        // under strict consumers (the apps compile this source through their\n        // `@authup/* → src` aliases with `strict: true`). The dynamic `at()`\n        // accessor materialises the state and is never undefined.\n        const userInfoUrlField = v.fields.at<string | null>('userInfoUrl');\n\n        function init() {\n            // blank via the helper so an unsaved (dirty) edit survives an\n            // entity refresh instead of being wiped before the re-assign\n            assignFormProperties(form, {\n                tokenUrl: null,\n                authorizeUrl: null,\n                userInfoUrl: null,\n            }, { fields: v.fields });\n\n            if (!props.entity) return;\n\n            assignFormProperties(form, props.entity as Partial<OAuth2IdentityProvider>, { fields: v.fields });\n        }\n\n        const updated = useUpdatedAt(() => props.entity as IdentityProvider);\n        onChange(updated, () => init());\n\n        init();\n\n        const handleDiscoveryLookup = (data: OpenIDProviderMetadata) => {\n            // through $model so the discovered values count as user edits\n            // (dirty) and survive a concurrent entity refresh\n            v.fields.authorizeUrl.$model.value = data.authorization_endpoint;\n            v.fields.tokenUrl.$model.value = data.token_endpoint;\n        };\n\n        const translations = useTranslations([\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.TOKEN,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.ACTION,\n                key: TranslatorTranslationActionKey.AUTHORIZE,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.USER_INFO,\n            },\n        ]);\n\n        return {\n            v,\n            userInfoUrlField,\n            translations,\n            handleDiscoveryLookup,\n        };\n    },\n});\n</script>\n<template>\n    <AIdentityProviderOAuth2Discovery\n        v-if=\"discovery\"\n        @lookup=\"handleDiscoveryLookup\"\n    />\n    <IFieldValidation\n        v-slot=\"{ value }\"\n        :field=\"v.fields.tokenUrl\"\n    >\n        <VCFormGroup\n            :label=\"true\"\n            :validation=\"value\"\n        >\n            <template #label>\n                {{ translations.token }}\n            </template>\n            <VCFormInput\n                v-model=\"v.fields.tokenUrl.$model.value\"\n                placeholder=\"https://...\"\n            />\n        </VCFormGroup>\n    </IFieldValidation>\n    <IFieldValidation\n        v-slot=\"{ value }\"\n        :field=\"v.fields.authorizeUrl\"\n    >\n        <VCFormGroup\n            :label=\"true\"\n            :validation=\"value\"\n        >\n            <template #label>\n                {{ translations.authorize }}\n            </template>\n            <VCFormInput\n                v-model=\"v.fields.authorizeUrl.$model.value\"\n                placeholder=\"https://...\"\n            />\n        </VCFormGroup>\n    </IFieldValidation>\n    <IFieldValidation\n        v-slot=\"{ value }\"\n        :field=\"userInfoUrlField\"\n    >\n        <VCFormGroup\n            :label=\"true\"\n            :validation=\"value\"\n        >\n            <template #label>\n                {{ translations.userInfo }}\n            </template>\n            <VCFormInput\n                v-model=\"userInfoUrlField.$model.value\"\n                placeholder=\"https://...\"\n            />\n        </VCFormGroup>\n    </IFieldValidation>\n</template>\n","<!--\n  Copyright (c) 2023.\n  Author Peter Placzek (tada5hi)\n  For the full copyright and license information,\n  view the LICENSE file that was distributed with this source code.\n-->\n\n<script lang=\"ts\">\nimport type { IdentityProvider, OAuth2IdentityProvider } from '@authup/core-kit';\nimport { IdentityProviderOAuth2AttributesValidator } from '@authup/core-kit';\nimport {\n    TranslatorTranslationActionKey,\n    TranslatorTranslationFieldKey,\n    TranslatorTranslationNamespace,\n} from '@authup/i18n';\nimport type { OpenIDProviderMetadata } from '@authup/specs';\nimport { VCFormGroup, VCFormInput } from '@vuecs/forms';\nimport { useValidup } from '@validup/vue';\nimport { assignFormProperties, useTranslations } from '../../../core';\nimport type { PropType } from 'vue';\nimport { defineComponent, reactive } from 'vue';\nimport { onChange, useUpdatedAt } from '../../../composables';\nimport AIdentityProviderOAuth2Discovery from './AIdentityProviderOAuth2Discovery.vue';\nimport { IFieldValidation } from '@ilingo/validup-vue';\n\nexport default defineComponent({\n    components: {\n        VCFormGroup,\n        VCFormInput,\n        AIdentityProviderOAuth2Discovery,\n\n        IFieldValidation,\n    },\n    props: {\n        entity: { type: Object as PropType<Partial<IdentityProvider>> },\n        discovery: {\n            type: Boolean,\n            default: false,\n        },\n    },\n    emits: ['updated'],\n    setup(props) {\n        const form = reactive({\n            tokenUrl: '',\n            authorizeUrl: '',\n            userInfoUrl: '',\n        });\n\n        // Shared server-side validator, scoped to the endpoint keys via\n        // `pathsToInclude` — `tokenUrl` and `authorizeUrl` are required\n        // for non-preset OAuth2/OIDC providers (this sub-form is only\n        // rendered when no preset is selected), `userInfoUrl` optional.\n        const v = useValidup(\n            new IdentityProviderOAuth2AttributesValidator({ pathsToInclude: ['tokenUrl', 'authorizeUrl', 'userInfoUrl'] }),\n            form,\n            { name: 'endpoint' },\n        );\n\n        // `userInfoUrl` is an optional key on `OAuth2IdentityProvider`, so\n        // the typed `fields` accessor yields `FieldState | undefined` for it\n        // under strict consumers (the apps compile this source through their\n        // `@authup/* → src` aliases with `strict: true`). The dynamic `at()`\n        // accessor materialises the state and is never undefined.\n        const userInfoUrlField = v.fields.at<string | null>('userInfoUrl');\n\n        function init() {\n            // blank via the helper so an unsaved (dirty) edit survives an\n            // entity refresh instead of being wiped before the re-assign\n            assignFormProperties(form, {\n                tokenUrl: null,\n                authorizeUrl: null,\n                userInfoUrl: null,\n            }, { fields: v.fields });\n\n            if (!props.entity) return;\n\n            assignFormProperties(form, props.entity as Partial<OAuth2IdentityProvider>, { fields: v.fields });\n        }\n\n        const updated = useUpdatedAt(() => props.entity as IdentityProvider);\n        onChange(updated, () => init());\n\n        init();\n\n        const handleDiscoveryLookup = (data: OpenIDProviderMetadata) => {\n            // through $model so the discovered values count as user edits\n            // (dirty) and survive a concurrent entity refresh\n            v.fields.authorizeUrl.$model.value = data.authorization_endpoint;\n            v.fields.tokenUrl.$model.value = data.token_endpoint;\n        };\n\n        const translations = useTranslations([\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.TOKEN,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.ACTION,\n                key: TranslatorTranslationActionKey.AUTHORIZE,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.USER_INFO,\n            },\n        ]);\n\n        return {\n            v,\n            userInfoUrlField,\n            translations,\n            handleDiscoveryLookup,\n        };\n    },\n});\n</script>\n<template>\n    <AIdentityProviderOAuth2Discovery\n        v-if=\"discovery\"\n        @lookup=\"handleDiscoveryLookup\"\n    />\n    <IFieldValidation\n        v-slot=\"{ value }\"\n        :field=\"v.fields.tokenUrl\"\n    >\n        <VCFormGroup\n            :label=\"true\"\n            :validation=\"value\"\n        >\n            <template #label>\n                {{ translations.token }}\n            </template>\n            <VCFormInput\n                v-model=\"v.fields.tokenUrl.$model.value\"\n                placeholder=\"https://...\"\n            />\n        </VCFormGroup>\n    </IFieldValidation>\n    <IFieldValidation\n        v-slot=\"{ value }\"\n        :field=\"v.fields.authorizeUrl\"\n    >\n        <VCFormGroup\n            :label=\"true\"\n            :validation=\"value\"\n        >\n            <template #label>\n                {{ translations.authorize }}\n            </template>\n            <VCFormInput\n                v-model=\"v.fields.authorizeUrl.$model.value\"\n                placeholder=\"https://...\"\n            />\n        </VCFormGroup>\n    </IFieldValidation>\n    <IFieldValidation\n        v-slot=\"{ value }\"\n        :field=\"userInfoUrlField\"\n    >\n        <VCFormGroup\n            :label=\"true\"\n            :validation=\"value\"\n        >\n            <template #label>\n                {{ translations.userInfo }}\n            </template>\n            <VCFormInput\n                v-model=\"userInfoUrlField.$model.value\"\n                placeholder=\"https://...\"\n            />\n        </VCFormGroup>\n    </IFieldValidation>\n</template>\n","<!--\n  - Copyright (c) 2022-2026.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\nimport { Container } from 'validup';\nimport { useValidup } from '@validup/vue';\nimport type { PropType } from 'vue';\nimport {\n    computed,\n    defineComponent,\n    nextTick,\n    reactive,\n    ref,\n} from 'vue';\nimport type {\n    IdentityProvider,\n    IdentityProviderPreset,\n} from '@authup/core-kit';\nimport { EntityType, IdentityProviderProtocol, buildIdentityProviderAuthorizeCallbackPath } from '@authup/core-kit';\nimport {\n    TranslatorTranslationCommonKey,\n    TranslatorTranslationFieldKey,\n    TranslatorTranslationNamespace,\n} from '@authup/i18n';\nimport { VCFormGroup, VCFormInput } from '@vuecs/forms';\nimport { VCIcon } from '@vuecs/icon';\nimport {\n    extractValidupResultsFromChild,\n    injectHTTPClient,\n    useTranslations,\n} from '../../../core';\nimport { onChange, useIsEditing } from '../../../composables';\nimport {\n    AFormSubmit,\n    defineEntityManager,\n    defineEntityVEmitOptions,\n} from '../../utility';\nimport AIdentityProviderBasicFields from './AIdentityProviderBasicFields.vue';\nimport AIdentityProviderOAuth2ClientFields from './AIdentityProviderOAuth2ClientFields.vue';\nimport AIdentityProviderOAuth2EndpointFields from './AIdentityProviderOAuth2EndpointFields.vue';\nimport { AIdentityProviderPreset } from './AIdentityProviderPreset';\nimport { AIdentityProviderProtocol } from './AIdentityProviderProtocol';\n\nexport default defineComponent({\n    components: {\n        AFormSubmit,\n        AIdentityProviderBasicFields,\n        AIdentityProviderOAuth2ClientFields,\n        AIdentityProviderOAuth2EndpointFields,\n        AIdentityProviderPreset,\n        AIdentityProviderProtocol,\n        VCFormGroup,\n        VCFormInput,\n        VCIcon,\n    },\n    props: {\n        entity: {\n            type: Object as PropType<IdentityProvider>,\n            required: false,\n            default: undefined,\n        },\n        realmId: {\n            type: String,\n            default: undefined,\n        },\n        protocol: {\n            type: String as PropType<string | null>,\n            default: IdentityProviderProtocol.OAUTH2,\n        },\n        preset: { type: String as PropType<string | null> },\n    },\n    emits: defineEntityVEmitOptions<IdentityProvider>(),\n    setup(props, ctx) {\n        const apiClient = injectHTTPClient();\n        const manager = defineEntityManager({\n            type: EntityType.IDENTITY_PROVIDER,\n            setup: ctx,\n            props,\n        });\n\n        const protocolEff = computed(() => {\n            if (manager.data.value) return manager.data.value.protocol;\n            return props.protocol;\n        });\n\n        const presetEff = computed(() => {\n            if (manager.data.value) return manager.data.value.preset;\n            return props.preset;\n        });\n\n        const busy = ref(false);\n        // Parent collector — see APolicyForm for the same pattern.\n        const v = useValidup(new Container(), reactive({}), { stopPropagation: true });\n        const isEditing = useIsEditing(manager.data);\n\n        const isInvalid = computed(() => {\n            const basic = v.$getResultsForChild('basic');\n            const client = v.$getResultsForChild('client');\n            const endpoint = v.$getResultsForChild('endpoint');\n            return !!basic?.$invalid.value ||\n                !!client?.$invalid.value ||\n                !!endpoint?.$invalid.value;\n        });\n\n        // The redirect_uri authup sends to the external provider is the\n        // CALLBACK, the value the operator registers upstream; authorize-out\n        // is what starts a login and needs a code request on top.\n        const redirectUri = computed<string>(() => {\n            if (!manager.data.value) return '';\n            const path = buildIdentityProviderAuthorizeCallbackPath(manager.data.value.id);\n            const baseURL = (apiClient.getBaseURL() ?? '').replace(/\\/+$/, '');\n            return `${baseURL}/${path.replace(/^\\/+/, '')}`;\n        });\n\n        const basicFieldsRef = ref<{ assign: (data: Record<string, unknown>) => void } | null>(null);\n\n        onChange(presetEff, () => {\n            if (!basicFieldsRef.value) return;\n\n            if (presetEff.value) {\n                basicFieldsRef.value.assign({\n                    name: presetEff.value,\n                    slug: presetEff.value,\n                });\n                return;\n            }\n\n            basicFieldsRef.value.assign({ name: '', slug: '' });\n        });\n\n        function initForm() {\n            nextTick(() => {\n                if (\n                    !manager.data.value &&\n                    presetEff.value &&\n                    basicFieldsRef.value\n                ) {\n                    basicFieldsRef.value.assign({\n                        name: presetEff.value,\n                        slug: presetEff.value,\n                    });\n                }\n            });\n        }\n\n        initForm();\n\n        const submit = async () => {\n            if (isInvalid.value) return;\n\n            const data: Partial<IdentityProvider> = {\n                ...extractValidupResultsFromChild(v, 'basic'),\n                ...extractValidupResultsFromChild(v, 'client'),\n                ...extractValidupResultsFromChild(v, 'endpoint'),\n            };\n\n            if (protocolEff.value) {\n                data.protocol = protocolEff.value as IdentityProviderProtocol;\n            }\n\n            if (presetEff.value) {\n                data.preset = presetEff.value as IdentityProviderPreset;\n            }\n\n            await manager.createOrUpdate(data);\n        };\n\n        const oidcEnabled = computed(() => protocolEff.value === IdentityProviderProtocol.OIDC);\n\n        const translations = useTranslations([\n            {\n                namespace: TranslatorTranslationNamespace.COMMON,\n                key: TranslatorTranslationCommonKey.DETAILS,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.COMMON,\n                key: TranslatorTranslationCommonKey.BASIC,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.COMMON,\n                key: TranslatorTranslationCommonKey.SECURITY,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.COMMON,\n                key: TranslatorTranslationCommonKey.ENDPOINTS,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.REDIRECT_URL,\n            },\n        ]);\n\n        return {\n            translations,\n            data: manager.data,\n            busy,\n            isEditing,\n            isInvalid,\n            protocolEff,\n            presetEff,\n            redirectUri,\n            basicFieldsRef,\n            oidcEnabled,\n            submit,\n        };\n    },\n});\n\n</script>\n\n<template>\n    <form @submit.prevent=\"submit\">\n        <template v-if=\"!data\">\n            <AIdentityProviderPreset\n                v-if=\"presetEff\"\n                :id=\"presetEff\"\n                :key=\"presetEff\"\n            >\n                <template #default=\"element\">\n                    <div>\n                        <h4 class=\"mb-3\">\n                            <VCIcon\n                                :name=\"element.icon\"\n                                class=\"pe-1\"\n                            /> {{ element.name }}\n                        </h4>\n                    </div>\n                </template>\n            </AIdentityProviderPreset>\n            <AIdentityProviderProtocol\n                v-else-if=\"protocolEff\"\n                :id=\"protocolEff\"\n                :key=\"protocolEff\"\n            >\n                <template #default=\"element\">\n                    <div>\n                        <h4 class=\"mb-3\">\n                            <VCIcon\n                                :name=\"element.icon\"\n                                class=\"pe-1\"\n                            /> {{ element.name }}\n                        </h4>\n                    </div>\n                </template>\n            </AIdentityProviderProtocol>\n        </template>\n\n        <template v-if=\"isEditing\">\n            <h6>\n                <VCIcon name=\"fa6-solid:circle-info\" /> {{ translations.details }}\n            </h6>\n            <VCFormGroup>\n                <template #label>\n                    {{ translations.redirectUrl }}\n                </template>\n                <VCFormInput\n                    :model-value=\"redirectUri\"\n                    :disabled=\"true\"\n                />\n            </VCFormGroup>\n        </template>\n\n        <div class=\"flex flex-wrap -mx-2\">\n            <div class=\"flex-1 basis-0 px-2\">\n                <h6>\n                    <VCIcon name=\"fa6-solid:wrench\" /> {{ translations.basic }}\n                </h6>\n                <AIdentityProviderBasicFields\n                    ref=\"basicFieldsRef\"\n                    :entity=\"data\"\n                />\n            </div>\n            <div class=\"flex-1 basis-0 px-2\">\n                <h6>\n                    <VCIcon name=\"fa6-solid:lock\" /> {{ translations.security }}\n                </h6>\n                <AIdentityProviderOAuth2ClientFields :entity=\"data\" />\n            </div>\n        </div>\n\n        <template v-if=\"!presetEff\">\n            <h6>\n                <VCIcon name=\"fa6-solid:vihara\" /> {{ translations.endpoints }}\n            </h6>\n            <AIdentityProviderOAuth2EndpointFields\n                :entity=\"data\"\n                :discovery=\"oidcEnabled\"\n            />\n        </template>\n\n        <AFormSubmit\n            :is-busy=\"busy\"\n            :is-editing=\"isEditing\"\n            :is-invalid=\"isInvalid\"\n            @submit=\"submit\"\n        />\n    </form>\n</template>\n","<!--\n  - Copyright (c) 2022-2026.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\nimport { Container } from 'validup';\nimport { useValidup } from '@validup/vue';\nimport type { PropType } from 'vue';\nimport {\n    computed,\n    defineComponent,\n    nextTick,\n    reactive,\n    ref,\n} from 'vue';\nimport type {\n    IdentityProvider,\n    IdentityProviderPreset,\n} from '@authup/core-kit';\nimport { EntityType, IdentityProviderProtocol, buildIdentityProviderAuthorizeCallbackPath } from '@authup/core-kit';\nimport {\n    TranslatorTranslationCommonKey,\n    TranslatorTranslationFieldKey,\n    TranslatorTranslationNamespace,\n} from '@authup/i18n';\nimport { VCFormGroup, VCFormInput } from '@vuecs/forms';\nimport { VCIcon } from '@vuecs/icon';\nimport {\n    extractValidupResultsFromChild,\n    injectHTTPClient,\n    useTranslations,\n} from '../../../core';\nimport { onChange, useIsEditing } from '../../../composables';\nimport {\n    AFormSubmit,\n    defineEntityManager,\n    defineEntityVEmitOptions,\n} from '../../utility';\nimport AIdentityProviderBasicFields from './AIdentityProviderBasicFields.vue';\nimport AIdentityProviderOAuth2ClientFields from './AIdentityProviderOAuth2ClientFields.vue';\nimport AIdentityProviderOAuth2EndpointFields from './AIdentityProviderOAuth2EndpointFields.vue';\nimport { AIdentityProviderPreset } from './AIdentityProviderPreset';\nimport { AIdentityProviderProtocol } from './AIdentityProviderProtocol';\n\nexport default defineComponent({\n    components: {\n        AFormSubmit,\n        AIdentityProviderBasicFields,\n        AIdentityProviderOAuth2ClientFields,\n        AIdentityProviderOAuth2EndpointFields,\n        AIdentityProviderPreset,\n        AIdentityProviderProtocol,\n        VCFormGroup,\n        VCFormInput,\n        VCIcon,\n    },\n    props: {\n        entity: {\n            type: Object as PropType<IdentityProvider>,\n            required: false,\n            default: undefined,\n        },\n        realmId: {\n            type: String,\n            default: undefined,\n        },\n        protocol: {\n            type: String as PropType<string | null>,\n            default: IdentityProviderProtocol.OAUTH2,\n        },\n        preset: { type: String as PropType<string | null> },\n    },\n    emits: defineEntityVEmitOptions<IdentityProvider>(),\n    setup(props, ctx) {\n        const apiClient = injectHTTPClient();\n        const manager = defineEntityManager({\n            type: EntityType.IDENTITY_PROVIDER,\n            setup: ctx,\n            props,\n        });\n\n        const protocolEff = computed(() => {\n            if (manager.data.value) return manager.data.value.protocol;\n            return props.protocol;\n        });\n\n        const presetEff = computed(() => {\n            if (manager.data.value) return manager.data.value.preset;\n            return props.preset;\n        });\n\n        const busy = ref(false);\n        // Parent collector — see APolicyForm for the same pattern.\n        const v = useValidup(new Container(), reactive({}), { stopPropagation: true });\n        const isEditing = useIsEditing(manager.data);\n\n        const isInvalid = computed(() => {\n            const basic = v.$getResultsForChild('basic');\n            const client = v.$getResultsForChild('client');\n            const endpoint = v.$getResultsForChild('endpoint');\n            return !!basic?.$invalid.value ||\n                !!client?.$invalid.value ||\n                !!endpoint?.$invalid.value;\n        });\n\n        // The redirect_uri authup sends to the external provider is the\n        // CALLBACK, the value the operator registers upstream; authorize-out\n        // is what starts a login and needs a code request on top.\n        const redirectUri = computed<string>(() => {\n            if (!manager.data.value) return '';\n            const path = buildIdentityProviderAuthorizeCallbackPath(manager.data.value.id);\n            const baseURL = (apiClient.getBaseURL() ?? '').replace(/\\/+$/, '');\n            return `${baseURL}/${path.replace(/^\\/+/, '')}`;\n        });\n\n        const basicFieldsRef = ref<{ assign: (data: Record<string, unknown>) => void } | null>(null);\n\n        onChange(presetEff, () => {\n            if (!basicFieldsRef.value) return;\n\n            if (presetEff.value) {\n                basicFieldsRef.value.assign({\n                    name: presetEff.value,\n                    slug: presetEff.value,\n                });\n                return;\n            }\n\n            basicFieldsRef.value.assign({ name: '', slug: '' });\n        });\n\n        function initForm() {\n            nextTick(() => {\n                if (\n                    !manager.data.value &&\n                    presetEff.value &&\n                    basicFieldsRef.value\n                ) {\n                    basicFieldsRef.value.assign({\n                        name: presetEff.value,\n                        slug: presetEff.value,\n                    });\n                }\n            });\n        }\n\n        initForm();\n\n        const submit = async () => {\n            if (isInvalid.value) return;\n\n            const data: Partial<IdentityProvider> = {\n                ...extractValidupResultsFromChild(v, 'basic'),\n                ...extractValidupResultsFromChild(v, 'client'),\n                ...extractValidupResultsFromChild(v, 'endpoint'),\n            };\n\n            if (protocolEff.value) {\n                data.protocol = protocolEff.value as IdentityProviderProtocol;\n            }\n\n            if (presetEff.value) {\n                data.preset = presetEff.value as IdentityProviderPreset;\n            }\n\n            await manager.createOrUpdate(data);\n        };\n\n        const oidcEnabled = computed(() => protocolEff.value === IdentityProviderProtocol.OIDC);\n\n        const translations = useTranslations([\n            {\n                namespace: TranslatorTranslationNamespace.COMMON,\n                key: TranslatorTranslationCommonKey.DETAILS,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.COMMON,\n                key: TranslatorTranslationCommonKey.BASIC,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.COMMON,\n                key: TranslatorTranslationCommonKey.SECURITY,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.COMMON,\n                key: TranslatorTranslationCommonKey.ENDPOINTS,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.REDIRECT_URL,\n            },\n        ]);\n\n        return {\n            translations,\n            data: manager.data,\n            busy,\n            isEditing,\n            isInvalid,\n            protocolEff,\n            presetEff,\n            redirectUri,\n            basicFieldsRef,\n            oidcEnabled,\n            submit,\n        };\n    },\n});\n\n</script>\n\n<template>\n    <form @submit.prevent=\"submit\">\n        <template v-if=\"!data\">\n            <AIdentityProviderPreset\n                v-if=\"presetEff\"\n                :id=\"presetEff\"\n                :key=\"presetEff\"\n            >\n                <template #default=\"element\">\n                    <div>\n                        <h4 class=\"mb-3\">\n                            <VCIcon\n                                :name=\"element.icon\"\n                                class=\"pe-1\"\n                            /> {{ element.name }}\n                        </h4>\n                    </div>\n                </template>\n            </AIdentityProviderPreset>\n            <AIdentityProviderProtocol\n                v-else-if=\"protocolEff\"\n                :id=\"protocolEff\"\n                :key=\"protocolEff\"\n            >\n                <template #default=\"element\">\n                    <div>\n                        <h4 class=\"mb-3\">\n                            <VCIcon\n                                :name=\"element.icon\"\n                                class=\"pe-1\"\n                            /> {{ element.name }}\n                        </h4>\n                    </div>\n                </template>\n            </AIdentityProviderProtocol>\n        </template>\n\n        <template v-if=\"isEditing\">\n            <h6>\n                <VCIcon name=\"fa6-solid:circle-info\" /> {{ translations.details }}\n            </h6>\n            <VCFormGroup>\n                <template #label>\n                    {{ translations.redirectUrl }}\n                </template>\n                <VCFormInput\n                    :model-value=\"redirectUri\"\n                    :disabled=\"true\"\n                />\n            </VCFormGroup>\n        </template>\n\n        <div class=\"flex flex-wrap -mx-2\">\n            <div class=\"flex-1 basis-0 px-2\">\n                <h6>\n                    <VCIcon name=\"fa6-solid:wrench\" /> {{ translations.basic }}\n                </h6>\n                <AIdentityProviderBasicFields\n                    ref=\"basicFieldsRef\"\n                    :entity=\"data\"\n                />\n            </div>\n            <div class=\"flex-1 basis-0 px-2\">\n                <h6>\n                    <VCIcon name=\"fa6-solid:lock\" /> {{ translations.security }}\n                </h6>\n                <AIdentityProviderOAuth2ClientFields :entity=\"data\" />\n            </div>\n        </div>\n\n        <template v-if=\"!presetEff\">\n            <h6>\n                <VCIcon name=\"fa6-solid:vihara\" /> {{ translations.endpoints }}\n            </h6>\n            <AIdentityProviderOAuth2EndpointFields\n                :entity=\"data\"\n                :discovery=\"oidcEnabled\"\n            />\n        </template>\n\n        <AFormSubmit\n            :is-busy=\"busy\"\n            :is-editing=\"isEditing\"\n            :is-invalid=\"isInvalid\"\n            @submit=\"submit\"\n        />\n    </form>\n</template>\n","<!--\n  - Copyright (c) 2023-2026.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\nimport {\n    computed,\n    defineComponent,\n    ref,\n    toRef,\n    watch,\n} from 'vue';\nimport { IdentityProviderProtocol, getIdentityProviderProtocolForPreset } from '@authup/core-kit';\nimport type { IdentityProvider, IdentityProviderPreset } from '@authup/core-kit';\nimport { TranslatorTranslationClientKey, TranslatorTranslationNamespace } from '@authup/i18n';\nimport type { PropType } from 'vue';\nimport { VCAlert } from '@vuecs/elements';\nimport { onChange, useUpdatedAt } from '../../../composables';\nimport { useTranslations } from '../../../core';\nimport AIdentityProviderLdapForm from './AIdentityProviderLdapForm.vue';\nimport AIdentityProviderPicker from './AIdentityProviderPicker.vue';\nimport AIdentityProviderOAuth2Form from './AIdentityProviderOAuth2Form.vue';\n\nexport default defineComponent({\n    components: {\n        AIdentityProviderLdapForm,\n        AIdentityProviderOAuth2Form,\n        AIdentityProviderPicker,\n        VCAlert,\n    },\n    props: {\n        entity: { type: Object as PropType<IdentityProvider> },\n        realmId: { type: String },\n    },\n    emits: ['created', 'deleted', 'updated', 'failed'],\n    setup(props, setup) {\n        const protocol = ref<string | null>(null);\n        const preset = ref<string | null>(null);\n\n        const entity = toRef(props, 'entity');\n        const updatedAt = useUpdatedAt(entity);\n        const localEntity = ref<IdentityProvider | undefined>(props.entity);\n\n        // Sync localEntity from the prop. The original implementation used\n        // `toRef(props, 'entity')` and mutated it directly on emits; that\n        // pattern relies on prop-write side effects which Vue 3 warns about.\n        // The explicit `ref + watch` is cleaner but needs the watcher to\n        // catch parent-driven updates (e.g. entity loaded after mount).\n        watch(() => props.entity, (val) => { localEntity.value = val; });\n\n        const set = () => {\n            if (!entity.value) {\n                return;\n            }\n\n            if (entity.value.preset) preset.value = entity.value.preset;\n            if (entity.value.protocol) protocol.value = entity.value.protocol;\n        };\n\n        set();\n        onChange(updatedAt, () => set());\n\n        const onPick = (type: 'protocol' | 'preset', value: string) => {\n            if (type === 'preset') {\n                preset.value = value;\n                protocol.value = getIdentityProviderProtocolForPreset(value as IdentityProviderPreset);\n                return;\n            }\n            protocol.value = value;\n            preset.value = null;\n        };\n\n        const onChildCreated = (el: IdentityProvider) => {\n            localEntity.value = el;\n            setup.emit('created', el);\n        };\n\n        const onChildUpdated = (el: IdentityProvider) => {\n            localEntity.value = el;\n            setup.emit('updated', el);\n        };\n\n        const onChildDeleted = (el: IdentityProvider) => {\n            localEntity.value = undefined;\n            setup.emit('deleted', el);\n        };\n\n        const onChildFailed = (err: unknown) => {\n            setup.emit('failed', err);\n        };\n\n        const isOAuth = (p: string | null) => p === IdentityProviderProtocol.OAUTH2 ||\n            p === IdentityProviderProtocol.OIDC;\n        const isLdap = (p: string | null) => p === IdentityProviderProtocol.LDAP;\n\n        const translations = useTranslations([\n            {\n                namespace: TranslatorTranslationNamespace.CLIENT,\n                key: TranslatorTranslationClientKey.PROTOCOL_NOT_SUPPORTED,\n                data: { name: computed(() => preset.value ?? protocol.value ?? '') },\n            },\n        ]);\n\n        return {\n            translations,\n            protocol,\n            preset,\n            localEntity,\n            isOAuth,\n            isLdap,\n            onPick,\n            onChildCreated,\n            onChildUpdated,\n            onChildDeleted,\n            onChildFailed,\n        };\n    },\n});\n\n</script>\n\n<template>\n    <div>\n        <AIdentityProviderPicker\n            v-if=\"!localEntity\"\n            :protocol=\"protocol ?? undefined\"\n            :preset=\"preset ?? undefined\"\n            @pick=\"onPick\"\n        />\n\n        <AIdentityProviderOAuth2Form\n            v-if=\"isOAuth(protocol)\"\n            :entity=\"localEntity\"\n            :realm-id=\"realmId\"\n            :protocol=\"protocol\"\n            :preset=\"preset\"\n            @created=\"onChildCreated\"\n            @updated=\"onChildUpdated\"\n            @deleted=\"onChildDeleted\"\n            @failed=\"onChildFailed\"\n        />\n\n        <AIdentityProviderLdapForm\n            v-else-if=\"isLdap(protocol)\"\n            :entity=\"localEntity\"\n            :realm-id=\"realmId\"\n            @created=\"onChildCreated\"\n            @updated=\"onChildUpdated\"\n            @deleted=\"onChildDeleted\"\n            @failed=\"onChildFailed\"\n        />\n\n        <VCAlert\n            v-else-if=\"protocol || preset\"\n            color=\"warning\"\n            variant=\"soft\"\n            size=\"sm\"\n            class=\"mb-3\"\n        >\n            {{ translations.protocolNotSupported }}\n        </VCAlert>\n    </div>\n</template>\n","<!--\n  - Copyright (c) 2023-2026.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\nimport {\n    computed,\n    defineComponent,\n    ref,\n    toRef,\n    watch,\n} from 'vue';\nimport { IdentityProviderProtocol, getIdentityProviderProtocolForPreset } from '@authup/core-kit';\nimport type { IdentityProvider, IdentityProviderPreset } from '@authup/core-kit';\nimport { TranslatorTranslationClientKey, TranslatorTranslationNamespace } from '@authup/i18n';\nimport type { PropType } from 'vue';\nimport { VCAlert } from '@vuecs/elements';\nimport { onChange, useUpdatedAt } from '../../../composables';\nimport { useTranslations } from '../../../core';\nimport AIdentityProviderLdapForm from './AIdentityProviderLdapForm.vue';\nimport AIdentityProviderPicker from './AIdentityProviderPicker.vue';\nimport AIdentityProviderOAuth2Form from './AIdentityProviderOAuth2Form.vue';\n\nexport default defineComponent({\n    components: {\n        AIdentityProviderLdapForm,\n        AIdentityProviderOAuth2Form,\n        AIdentityProviderPicker,\n        VCAlert,\n    },\n    props: {\n        entity: { type: Object as PropType<IdentityProvider> },\n        realmId: { type: String },\n    },\n    emits: ['created', 'deleted', 'updated', 'failed'],\n    setup(props, setup) {\n        const protocol = ref<string | null>(null);\n        const preset = ref<string | null>(null);\n\n        const entity = toRef(props, 'entity');\n        const updatedAt = useUpdatedAt(entity);\n        const localEntity = ref<IdentityProvider | undefined>(props.entity);\n\n        // Sync localEntity from the prop. The original implementation used\n        // `toRef(props, 'entity')` and mutated it directly on emits; that\n        // pattern relies on prop-write side effects which Vue 3 warns about.\n        // The explicit `ref + watch` is cleaner but needs the watcher to\n        // catch parent-driven updates (e.g. entity loaded after mount).\n        watch(() => props.entity, (val) => { localEntity.value = val; });\n\n        const set = () => {\n            if (!entity.value) {\n                return;\n            }\n\n            if (entity.value.preset) preset.value = entity.value.preset;\n            if (entity.value.protocol) protocol.value = entity.value.protocol;\n        };\n\n        set();\n        onChange(updatedAt, () => set());\n\n        const onPick = (type: 'protocol' | 'preset', value: string) => {\n            if (type === 'preset') {\n                preset.value = value;\n                protocol.value = getIdentityProviderProtocolForPreset(value as IdentityProviderPreset);\n                return;\n            }\n            protocol.value = value;\n            preset.value = null;\n        };\n\n        const onChildCreated = (el: IdentityProvider) => {\n            localEntity.value = el;\n            setup.emit('created', el);\n        };\n\n        const onChildUpdated = (el: IdentityProvider) => {\n            localEntity.value = el;\n            setup.emit('updated', el);\n        };\n\n        const onChildDeleted = (el: IdentityProvider) => {\n            localEntity.value = undefined;\n            setup.emit('deleted', el);\n        };\n\n        const onChildFailed = (err: unknown) => {\n            setup.emit('failed', err);\n        };\n\n        const isOAuth = (p: string | null) => p === IdentityProviderProtocol.OAUTH2 ||\n            p === IdentityProviderProtocol.OIDC;\n        const isLdap = (p: string | null) => p === IdentityProviderProtocol.LDAP;\n\n        const translations = useTranslations([\n            {\n                namespace: TranslatorTranslationNamespace.CLIENT,\n                key: TranslatorTranslationClientKey.PROTOCOL_NOT_SUPPORTED,\n                data: { name: computed(() => preset.value ?? protocol.value ?? '') },\n            },\n        ]);\n\n        return {\n            translations,\n            protocol,\n            preset,\n            localEntity,\n            isOAuth,\n            isLdap,\n            onPick,\n            onChildCreated,\n            onChildUpdated,\n            onChildDeleted,\n            onChildFailed,\n        };\n    },\n});\n\n</script>\n\n<template>\n    <div>\n        <AIdentityProviderPicker\n            v-if=\"!localEntity\"\n            :protocol=\"protocol ?? undefined\"\n            :preset=\"preset ?? undefined\"\n            @pick=\"onPick\"\n        />\n\n        <AIdentityProviderOAuth2Form\n            v-if=\"isOAuth(protocol)\"\n            :entity=\"localEntity\"\n            :realm-id=\"realmId\"\n            :protocol=\"protocol\"\n            :preset=\"preset\"\n            @created=\"onChildCreated\"\n            @updated=\"onChildUpdated\"\n            @deleted=\"onChildDeleted\"\n            @failed=\"onChildFailed\"\n        />\n\n        <AIdentityProviderLdapForm\n            v-else-if=\"isLdap(protocol)\"\n            :entity=\"localEntity\"\n            :realm-id=\"realmId\"\n            @created=\"onChildCreated\"\n            @updated=\"onChildUpdated\"\n            @deleted=\"onChildDeleted\"\n            @failed=\"onChildFailed\"\n        />\n\n        <VCAlert\n            v-else-if=\"protocol || preset\"\n            color=\"warning\"\n            variant=\"soft\"\n            size=\"sm\"\n            class=\"mb-3\"\n        >\n            {{ translations.protocolNotSupported }}\n        </VCAlert>\n    </div>\n</template>\n","/*\n * Copyright (c) 2022.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { EntityType } from '@authup/core-kit';\nimport type { SlotsType } from 'vue';\nimport { defineComponent } from 'vue';\nimport type { IdentityProvider } from '@authup/core-kit';\nimport type { EntityCollectionVSlots } from '../../utility';\nimport { TranslatorTranslationEntityKey, TranslatorTranslationNamespace, TranslatorTranslationVuecsKey } from '@authup/i18n';\nimport { useTranslation } from '../../../core';\nimport {\n\n    defineEntityCollectionManager,\n    defineEntityCollectionVEmitOptions,\n    defineEntityCollectionVProps,\n} from '../../utility';\n\nexport const AIdentityProviders = defineComponent({\n    props: defineEntityCollectionVProps<IdentityProvider>(),\n    emits: defineEntityCollectionVEmitOptions<IdentityProvider>(),\n    slots: Object as SlotsType<EntityCollectionVSlots<IdentityProvider>>,\n    setup(props, ctx) {\n        const { render } = defineEntityCollectionManager({\n            type: `${EntityType.IDENTITY_PROVIDER}`,\n            props,\n            setup: ctx,\n        });\n\n        const translationName = useTranslation({\n            namespace: TranslatorTranslationNamespace.ENTITY,\n            key: TranslatorTranslationEntityKey.IDENTITY_PROVIDER,\n            count: 2,\n        });\n\n        const translation = useTranslation({\n            namespace: TranslatorTranslationNamespace.VUECS,\n            key: TranslatorTranslationVuecsKey.NO_MORE,\n            data: { name: translationName },\n        });\n\n        return () => render({ noMore: { content: translation.value } });\n    },\n});\n\nexport default AIdentityProviders;\n","<!--\n  Copyright (c) 2023.\n  Author Peter Placzek (tada5hi)\n  For the full copyright and license information,\n  view the LICENSE file that was distributed with this source code.\n-->\n\n<script lang=\"ts\">\nimport type { IdentityProvider } from '@authup/core-kit';\nimport type { PropType } from 'vue';\nimport { defineComponent } from 'vue';\nimport { VCIcon } from '@vuecs/icon';\nimport { AIdentityProviderPreset } from './AIdentityProviderPreset';\nimport { AIdentityProviderProtocol } from './AIdentityProviderProtocol';\n\nexport default defineComponent({\n    components: {\n        AIdentityProviderPreset, \n        AIdentityProviderProtocol, \n        VCIcon, \n    },\n    inheritAttrs: false,\n    props: {\n        entity: {\n            type: Object as PropType<IdentityProvider>,\n            required: true,\n        },\n    },\n});\n</script>\n<template>\n    <AIdentityProviderPreset\n        v-if=\"entity.preset\"\n        :id=\"entity.preset\"\n    >\n        <template #default=\"item\">\n            <VCIcon\n                :name=\"item.icon\"\n                :class=\"$attrs.class\"\n            />\n        </template>\n    </AIdentityProviderPreset>\n    <AIdentityProviderProtocol\n        v-else-if=\"entity.protocol\"\n        :id=\"entity.protocol\"\n    >\n        <template #default=\"item\">\n            <VCIcon\n                :name=\"item.icon\"\n                :class=\"$attrs.class\"\n            />\n        </template>\n    </AIdentityProviderProtocol>\n</template>\n","<!--\n  Copyright (c) 2023.\n  Author Peter Placzek (tada5hi)\n  For the full copyright and license information,\n  view the LICENSE file that was distributed with this source code.\n-->\n\n<script lang=\"ts\">\nimport type { IdentityProvider } from '@authup/core-kit';\nimport type { PropType } from 'vue';\nimport { defineComponent } from 'vue';\nimport { VCIcon } from '@vuecs/icon';\nimport { AIdentityProviderPreset } from './AIdentityProviderPreset';\nimport { AIdentityProviderProtocol } from './AIdentityProviderProtocol';\n\nexport default defineComponent({\n    components: {\n        AIdentityProviderPreset, \n        AIdentityProviderProtocol, \n        VCIcon, \n    },\n    inheritAttrs: false,\n    props: {\n        entity: {\n            type: Object as PropType<IdentityProvider>,\n            required: true,\n        },\n    },\n});\n</script>\n<template>\n    <AIdentityProviderPreset\n        v-if=\"entity.preset\"\n        :id=\"entity.preset\"\n    >\n        <template #default=\"item\">\n            <VCIcon\n                :name=\"item.icon\"\n                :class=\"$attrs.class\"\n            />\n        </template>\n    </AIdentityProviderPreset>\n    <AIdentityProviderProtocol\n        v-else-if=\"entity.protocol\"\n        :id=\"entity.protocol\"\n    >\n        <template #default=\"item\">\n            <VCIcon\n                :name=\"item.icon\"\n                :class=\"$attrs.class\"\n            />\n        </template>\n    </AIdentityProviderProtocol>\n</template>\n","/*\n * Copyright (c) 2026.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { EntityType } from '@authup/core-kit';\nimport type { IdentityProviderAccount } from '@authup/core-kit';\nimport { TranslatorTranslationEntityKey, TranslatorTranslationNamespace, TranslatorTranslationVuecsKey } from '@authup/i18n';\nimport type { SlotsType } from 'vue';\nimport { defineComponent } from 'vue';\nimport { useTranslation } from '../../../core';\nimport type { EntityCollectionVSlots } from '../../utility';\nimport {\n    defineEntityCollectionManager,\n    defineEntityCollectionVEmitOptions,\n    defineEntityCollectionVProps,\n} from '../../utility';\n\nexport const AIdentityProviderAccounts = defineComponent({\n    props: defineEntityCollectionVProps<IdentityProviderAccount>(),\n    emits: defineEntityCollectionVEmitOptions<IdentityProviderAccount>(),\n    slots: Object as SlotsType<EntityCollectionVSlots<IdentityProviderAccount>>,\n    setup(props, ctx) {\n        const { render } = defineEntityCollectionManager({\n            type: `${EntityType.IDENTITY_PROVIDER_ACCOUNT}`,\n            props,\n            setup: ctx,\n        });\n\n        const translationName = useTranslation({\n            namespace: TranslatorTranslationNamespace.ENTITY,\n            key: TranslatorTranslationEntityKey.IDENTITY_PROVIDER_ACCOUNT,\n            count: 2,\n        });\n\n        const translation = useTranslation({\n            namespace: TranslatorTranslationNamespace.VUECS,\n            key: TranslatorTranslationVuecsKey.NO_MORE,\n            data: { name: translationName },\n        });\n\n        return () => render({ noMore: { content: translation.value } });\n    },\n});\n\nexport default AIdentityProviderAccounts;\n","<!--\n  Copyright (c) 2022-2026.\n  Author Peter Placzek (tada5hi)\n  For the full copyright and license information,\n  view the LICENSE file that was distributed with this source code.\n-->\n\n<script lang=\"ts\">\nimport { EntityType } from '@authup/core-kit';\nimport { createValidator } from '@validup/zod';\nimport { Container } from 'validup';\nimport { useValidup } from '@validup/vue';\nimport {\n    TranslatorTranslationActionKey,\n    TranslatorTranslationAppKey,\n    TranslatorTranslationFieldKey,\n    TranslatorTranslationNamespace,\n} from '@authup/i18n';\nimport { DEFAULT_BUTTON_SIZE, assignFormProperties, useTranslations } from '../../../core';\nimport { z } from 'zod';\nimport type { PropType } from 'vue';\nimport { defineComponent, reactive, ref } from 'vue';\nimport type { IdentityProviderRoleMapping, Role } from '@authup/core-kit';\nimport { VCFormGroup, VCFormInput, VCFormSwitch } from '@vuecs/forms';\nimport type { ButtonSize } from '@vuecs/button';\nimport { VCButton } from '@vuecs/button';\nimport { VCIcon } from '@vuecs/icon';\nimport { useAlertDialog } from '@vuecs/overlays';\nimport { IFieldValidation } from '@ilingo/validup-vue';\nimport {\n    defineEntityManager,\n    defineEntityVEmitOptions,\n} from '../../utility';\n\n// Inline attribute-only validator. `@authup/core-kit`'s\n// `IdentityProviderRoleMappingValidator` does cover these three keys\n// but also mounts the foreign-key columns (`providerId`, `roleId`)\n// — those are supplied by the parent component at submit time, not by\n// the form, so routing through the entity validator would require an\n// always-`UPDATE` group cast that obscures intent. A follow-up split\n// in core-kit (`…AttributesValidator` vs `…EntityValidator`) would let\n// this collapse to a re-export.\nclass RoleMappingAttributesValidator extends Container<{\n    name: string;\n    value: string;\n    valueIsRegex: boolean;\n}> {\n    protected override initialize() {\n        super.initialize();\n        this.mount('name', { optional: true }, createValidator(z.string().min(3).max(32)));\n        this.mount('value', { optional: true }, createValidator(z.string().min(3).max(128)));\n        this.mount('valueIsRegex', { optional: true }, createValidator(z.boolean()));\n    }\n}\n\nexport default defineComponent({\n    components: {\n        VCFormGroup,\n        VCFormInput,\n        VCFormSwitch,\n        VCButton,\n        VCIcon,\n\n        IFieldValidation,\n    },\n    props: {\n        role: {\n            type: Object as PropType<Role>,\n            required: true,\n        },\n        entityId: {\n            type: String,\n            required: true,\n        },\n        size: {\n            type: String as PropType<ButtonSize>,\n            default: DEFAULT_BUTTON_SIZE,\n        },\n    },\n    emits: defineEntityVEmitOptions<IdentityProviderRoleMapping>(),\n    async setup(props, setup) {\n        const display = ref(false);\n        const toggleDisplay = () => {\n            display.value = !display.value;\n        };\n\n        const form = reactive({\n            name: '',\n            value: '',\n            valueIsRegex: false,\n        });\n\n        const v = useValidup(new RoleMappingAttributesValidator(), form);\n\n        const translationsDefault = useTranslations([\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.VALUE_IS_REGEX,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.ACTION,\n                key: TranslatorTranslationActionKey.REMOVE,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.ACTION,\n                key: TranslatorTranslationActionKey.ABORT,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.APP,\n                key: TranslatorTranslationAppKey.REMOVE_CONFIRM_TITLE,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.APP,\n                key: TranslatorTranslationAppKey.REMOVE_CONFIRM_DESCRIPTION,\n            },\n        ]);\n\n        // Role-mapping removal is a role grant — confirm it (mirrors the\n        // <AToggleButton withPrompt> path used by the other grant assignments).\n        const confirmDialog = useAlertDialog();\n\n        const manager = defineEntityManager({\n            type: EntityType.IDENTITY_PROVIDER_ROLE_MAPPING,\n            setup,\n            socket: {\n                processEvent(event) {\n                    return event.data.roleId === props.role.id &&\n                        event.data.providerId === props.entityId;\n                },\n            },\n        });\n\n        await manager.resolve({\n            query: {\n                filters: {\n                    roleId: props.role.id,\n                    providerId: props.entityId,\n                },\n            },\n        });\n\n        if (manager.data.value) {\n            assignFormProperties(form, manager.data.value, { fields: v.fields });\n        }\n\n        const handleSaveOrCreate = (e: Event) => {\n            e.preventDefault();\n\n            if (manager.data.value) {\n                return manager.update(form);\n            }\n\n            return manager.create({\n                ...form,\n                providerId: props.entityId,\n                roleId: props.role.id,\n            });\n        };\n\n        const handleDelete = async (e: Event) => {\n            e.preventDefault();\n\n            const confirmed = await confirmDialog({\n                title: translationsDefault.removeConfirmTitle,\n                description: translationsDefault.removeConfirmDescription,\n                confirmLabel: translationsDefault.remove,\n                cancelLabel: translationsDefault.abort,\n                tone: 'error',\n            });\n\n            if (!confirmed) {\n                return undefined;\n            }\n\n            return manager.delete();\n        };\n\n        return {\n            display,\n            toggleDisplay,\n            v,\n            translationsDefault,\n            manager,\n            handleSaveOrCreate,\n            handleDelete,\n        };\n    },\n});\n</script>\n<template>\n    <div class=\"flex flex-col\">\n        <div class=\"flex flex-row\">\n            <div class=\"me-2\">\n                <VCButton\n                    :size=\"size\"\n                    color=\"neutral\"\n                    @click.prevent=\"toggleDisplay()\"\n                >\n                    <VCIcon :name=\"display ? 'fa6-solid:chevron-up' : 'fa6-solid:chevron-down'\" />\n                </VCButton>\n            </div>\n            <div>\n                <h6\n                    class=\"mb-0\"\n                    @click.prevent=\"toggleDisplay()\"\n                >\n                    {{ role.name }}\n                </h6>\n            </div>\n            <div class=\"ms-auto\">\n                <VCButton\n                    :size=\"size\"\n                    :color=\"manager.data.value ? 'neutral' : 'primary'\"\n                    @click=\"handleSaveOrCreate\"\n                >\n                    <VCIcon :name=\"manager.data.value ? 'fa6-solid:floppy-disk' : 'fa6-solid:plus'\" />\n                </VCButton>\n                <VCButton\n                    v-if=\"manager.data.value\"\n                    :size=\"size\"\n                    color=\"error\"\n                    class=\"ms-1\"\n                    :disabled=\"manager.busy.value\"\n                    @click=\"handleDelete\"\n                >\n                    <VCIcon name=\"fa6-solid:trash\" />\n                </VCButton>\n            </div>\n        </div>\n        <div\n            v-if=\"display\"\n            class=\"mt-2\"\n        >\n            <IFieldValidation\n                v-slot=\"{ value }\"\n                :field=\"v.fields.name\"\n            >\n                <VCFormGroup\n                    :label=\"true\"\n                    :validation=\"value\"\n                >\n                    <template #label>\n                        Name\n                    </template>\n                    <VCFormInput v-model=\"v.fields.name.$model.value\" />\n                </VCFormGroup>\n            </IFieldValidation>\n            <IFieldValidation\n                v-slot=\"{ value }\"\n                :field=\"v.fields.value\"\n            >\n                <VCFormGroup\n                    :label=\"true\"\n                    :validation=\"value\"\n                >\n                    <template #label>\n                        Value\n                    </template>\n                    <VCFormInput v-model=\"v.fields.value.$model.value\" />\n                </VCFormGroup>\n            </IFieldValidation>\n            <IFieldValidation\n                v-slot=\"{ value }\"\n                :field=\"v.fields.valueIsRegex\"\n            >\n                <VCFormGroup\n                    :label=\"true\"\n                    :validation=\"value\"\n                >\n                    <template #label>\n                        Regex\n                    </template>\n                    <VCFormSwitch\n                        v-model=\"v.fields.valueIsRegex.$model.value\"\n                        :label-content=\"translationsDefault.valueIsRegex\"\n                    />\n                </VCFormGroup>\n            </IFieldValidation>\n        </div>\n    </div>\n</template>\n","<!--\n  Copyright (c) 2022-2026.\n  Author Peter Placzek (tada5hi)\n  For the full copyright and license information,\n  view the LICENSE file that was distributed with this source code.\n-->\n\n<script lang=\"ts\">\nimport { EntityType } from '@authup/core-kit';\nimport { createValidator } from '@validup/zod';\nimport { Container } from 'validup';\nimport { useValidup } from '@validup/vue';\nimport {\n    TranslatorTranslationActionKey,\n    TranslatorTranslationAppKey,\n    TranslatorTranslationFieldKey,\n    TranslatorTranslationNamespace,\n} from '@authup/i18n';\nimport { DEFAULT_BUTTON_SIZE, assignFormProperties, useTranslations } from '../../../core';\nimport { z } from 'zod';\nimport type { PropType } from 'vue';\nimport { defineComponent, reactive, ref } from 'vue';\nimport type { IdentityProviderRoleMapping, Role } from '@authup/core-kit';\nimport { VCFormGroup, VCFormInput, VCFormSwitch } from '@vuecs/forms';\nimport type { ButtonSize } from '@vuecs/button';\nimport { VCButton } from '@vuecs/button';\nimport { VCIcon } from '@vuecs/icon';\nimport { useAlertDialog } from '@vuecs/overlays';\nimport { IFieldValidation } from '@ilingo/validup-vue';\nimport {\n    defineEntityManager,\n    defineEntityVEmitOptions,\n} from '../../utility';\n\n// Inline attribute-only validator. `@authup/core-kit`'s\n// `IdentityProviderRoleMappingValidator` does cover these three keys\n// but also mounts the foreign-key columns (`providerId`, `roleId`)\n// — those are supplied by the parent component at submit time, not by\n// the form, so routing through the entity validator would require an\n// always-`UPDATE` group cast that obscures intent. A follow-up split\n// in core-kit (`…AttributesValidator` vs `…EntityValidator`) would let\n// this collapse to a re-export.\nclass RoleMappingAttributesValidator extends Container<{\n    name: string;\n    value: string;\n    valueIsRegex: boolean;\n}> {\n    protected override initialize() {\n        super.initialize();\n        this.mount('name', { optional: true }, createValidator(z.string().min(3).max(32)));\n        this.mount('value', { optional: true }, createValidator(z.string().min(3).max(128)));\n        this.mount('valueIsRegex', { optional: true }, createValidator(z.boolean()));\n    }\n}\n\nexport default defineComponent({\n    components: {\n        VCFormGroup,\n        VCFormInput,\n        VCFormSwitch,\n        VCButton,\n        VCIcon,\n\n        IFieldValidation,\n    },\n    props: {\n        role: {\n            type: Object as PropType<Role>,\n            required: true,\n        },\n        entityId: {\n            type: String,\n            required: true,\n        },\n        size: {\n            type: String as PropType<ButtonSize>,\n            default: DEFAULT_BUTTON_SIZE,\n        },\n    },\n    emits: defineEntityVEmitOptions<IdentityProviderRoleMapping>(),\n    async setup(props, setup) {\n        const display = ref(false);\n        const toggleDisplay = () => {\n            display.value = !display.value;\n        };\n\n        const form = reactive({\n            name: '',\n            value: '',\n            valueIsRegex: false,\n        });\n\n        const v = useValidup(new RoleMappingAttributesValidator(), form);\n\n        const translationsDefault = useTranslations([\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.VALUE_IS_REGEX,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.ACTION,\n                key: TranslatorTranslationActionKey.REMOVE,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.ACTION,\n                key: TranslatorTranslationActionKey.ABORT,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.APP,\n                key: TranslatorTranslationAppKey.REMOVE_CONFIRM_TITLE,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.APP,\n                key: TranslatorTranslationAppKey.REMOVE_CONFIRM_DESCRIPTION,\n            },\n        ]);\n\n        // Role-mapping removal is a role grant — confirm it (mirrors the\n        // <AToggleButton withPrompt> path used by the other grant assignments).\n        const confirmDialog = useAlertDialog();\n\n        const manager = defineEntityManager({\n            type: EntityType.IDENTITY_PROVIDER_ROLE_MAPPING,\n            setup,\n            socket: {\n                processEvent(event) {\n                    return event.data.roleId === props.role.id &&\n                        event.data.providerId === props.entityId;\n                },\n            },\n        });\n\n        await manager.resolve({\n            query: {\n                filters: {\n                    roleId: props.role.id,\n                    providerId: props.entityId,\n                },\n            },\n        });\n\n        if (manager.data.value) {\n            assignFormProperties(form, manager.data.value, { fields: v.fields });\n        }\n\n        const handleSaveOrCreate = (e: Event) => {\n            e.preventDefault();\n\n            if (manager.data.value) {\n                return manager.update(form);\n            }\n\n            return manager.create({\n                ...form,\n                providerId: props.entityId,\n                roleId: props.role.id,\n            });\n        };\n\n        const handleDelete = async (e: Event) => {\n            e.preventDefault();\n\n            const confirmed = await confirmDialog({\n                title: translationsDefault.removeConfirmTitle,\n                description: translationsDefault.removeConfirmDescription,\n                confirmLabel: translationsDefault.remove,\n                cancelLabel: translationsDefault.abort,\n                tone: 'error',\n            });\n\n            if (!confirmed) {\n                return undefined;\n            }\n\n            return manager.delete();\n        };\n\n        return {\n            display,\n            toggleDisplay,\n            v,\n            translationsDefault,\n            manager,\n            handleSaveOrCreate,\n            handleDelete,\n        };\n    },\n});\n</script>\n<template>\n    <div class=\"flex flex-col\">\n        <div class=\"flex flex-row\">\n            <div class=\"me-2\">\n                <VCButton\n                    :size=\"size\"\n                    color=\"neutral\"\n                    @click.prevent=\"toggleDisplay()\"\n                >\n                    <VCIcon :name=\"display ? 'fa6-solid:chevron-up' : 'fa6-solid:chevron-down'\" />\n                </VCButton>\n            </div>\n            <div>\n                <h6\n                    class=\"mb-0\"\n                    @click.prevent=\"toggleDisplay()\"\n                >\n                    {{ role.name }}\n                </h6>\n            </div>\n            <div class=\"ms-auto\">\n                <VCButton\n                    :size=\"size\"\n                    :color=\"manager.data.value ? 'neutral' : 'primary'\"\n                    @click=\"handleSaveOrCreate\"\n                >\n                    <VCIcon :name=\"manager.data.value ? 'fa6-solid:floppy-disk' : 'fa6-solid:plus'\" />\n                </VCButton>\n                <VCButton\n                    v-if=\"manager.data.value\"\n                    :size=\"size\"\n                    color=\"error\"\n                    class=\"ms-1\"\n                    :disabled=\"manager.busy.value\"\n                    @click=\"handleDelete\"\n                >\n                    <VCIcon name=\"fa6-solid:trash\" />\n                </VCButton>\n            </div>\n        </div>\n        <div\n            v-if=\"display\"\n            class=\"mt-2\"\n        >\n            <IFieldValidation\n                v-slot=\"{ value }\"\n                :field=\"v.fields.name\"\n            >\n                <VCFormGroup\n                    :label=\"true\"\n                    :validation=\"value\"\n                >\n                    <template #label>\n                        Name\n                    </template>\n                    <VCFormInput v-model=\"v.fields.name.$model.value\" />\n                </VCFormGroup>\n            </IFieldValidation>\n            <IFieldValidation\n                v-slot=\"{ value }\"\n                :field=\"v.fields.value\"\n            >\n                <VCFormGroup\n                    :label=\"true\"\n                    :validation=\"value\"\n                >\n                    <template #label>\n                        Value\n                    </template>\n                    <VCFormInput v-model=\"v.fields.value.$model.value\" />\n                </VCFormGroup>\n            </IFieldValidation>\n            <IFieldValidation\n                v-slot=\"{ value }\"\n                :field=\"v.fields.valueIsRegex\"\n            >\n                <VCFormGroup\n                    :label=\"true\"\n                    :validation=\"value\"\n                >\n                    <template #label>\n                        Regex\n                    </template>\n                    <VCFormSwitch\n                        v-model=\"v.fields.valueIsRegex.$model.value\"\n                        :label-content=\"translationsDefault.valueIsRegex\"\n                    />\n                </VCFormGroup>\n            </IFieldValidation>\n        </div>\n    </div>\n</template>\n","<!--\n  Copyright (c) 2022.\n  Author Peter Placzek (tada5hi)\n  For the full copyright and license information,\n  view the LICENSE file that was distributed with this source code.\n-->\n\n<script lang=\"ts\">\nimport { computed, defineComponent } from 'vue';\nimport AIdentityProviderRoleAssignment from './AIdentityProviderRoleAssignment.vue';\nimport { ARoles } from '../role';\n\nexport default defineComponent({\n    components: { ARoles, AIdentityProviderRoleAssignment },\n    props: {\n        entityId: {\n            type: String,\n            required: true,\n        },\n    },\n    setup(props, { slots }) {\n        const forwardedSlots = computed(() => Object.fromEntries(Object.entries(slots).filter(([name]) => name !== 'body')));\n        return { forwardedSlots };\n    },\n});\n</script>\n<template>\n    <ARoles :header-title=\"false\">\n        <template #body=\"slotProps\">\n            <AIdentityProviderRoleAssignment\n                v-for=\"item in slotProps.data\"\n                :key=\"item.id\"\n                :entity-id=\"entityId\"\n                :role=\"item\"\n            />\n        </template>\n        <template\n            v-for=\"(_, name) in forwardedSlots\"\n            :key=\"name\"\n            #[name]=\"slotData\"\n        >\n            <slot\n                :name=\"name\"\n                v-bind=\"slotData ?? {}\"\n            />\n        </template>\n    </ARoles>\n</template>\n","<!--\n  Copyright (c) 2022.\n  Author Peter Placzek (tada5hi)\n  For the full copyright and license information,\n  view the LICENSE file that was distributed with this source code.\n-->\n\n<script lang=\"ts\">\nimport { computed, defineComponent } from 'vue';\nimport AIdentityProviderRoleAssignment from './AIdentityProviderRoleAssignment.vue';\nimport { ARoles } from '../role';\n\nexport default defineComponent({\n    components: { ARoles, AIdentityProviderRoleAssignment },\n    props: {\n        entityId: {\n            type: String,\n            required: true,\n        },\n    },\n    setup(props, { slots }) {\n        const forwardedSlots = computed(() => Object.fromEntries(Object.entries(slots).filter(([name]) => name !== 'body')));\n        return { forwardedSlots };\n    },\n});\n</script>\n<template>\n    <ARoles :header-title=\"false\">\n        <template #body=\"slotProps\">\n            <AIdentityProviderRoleAssignment\n                v-for=\"item in slotProps.data\"\n                :key=\"item.id\"\n                :entity-id=\"entityId\"\n                :role=\"item\"\n            />\n        </template>\n        <template\n            v-for=\"(_, name) in forwardedSlots\"\n            :key=\"name\"\n            #[name]=\"slotData\"\n        >\n            <slot\n                :name=\"name\"\n                v-bind=\"slotData ?? {}\"\n            />\n        </template>\n    </ARoles>\n</template>\n","/*\n * Copyright (c) 2026.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { EntityType } from '@authup/core-kit';\nimport type { Key } from '@authup/core-kit';\nimport type { SlotsType } from 'vue';\nimport { defineComponent } from 'vue';\nimport type { EntityVSlots } from '../../utility';\nimport {\n    defineEntityManager,\n    defineEntityVEmitOptions,\n    defineEntityVProps,\n} from '../../utility';\n\nexport const AKey = defineComponent({\n    props: defineEntityVProps<Key>(),\n    emits: defineEntityVEmitOptions<Key>(),\n    slots: Object as SlotsType<EntityVSlots<Key>>,\n    async setup(props, setup) {\n        const manager = defineEntityManager({\n            type: `${EntityType.KEY}`,\n            props,\n            setup,\n        });\n\n        try {\n            await manager.resolveOrFail();\n\n            return () => manager.render();\n        } catch (e) {\n            return () => manager.renderError(e);\n        }\n    },\n});\n","/*\n * Copyright (c) 2026.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { EntityType } from '@authup/core-kit';\nimport type { Key } from '@authup/core-kit';\nimport { TranslatorTranslationEntityKey, TranslatorTranslationNamespace, TranslatorTranslationVuecsKey } from '@authup/i18n';\nimport type { SlotsType } from 'vue';\nimport { defineComponent } from 'vue';\nimport { useTranslation } from '../../../core';\nimport type { EntityCollectionVSlots } from '../../utility';\nimport {\n    defineEntityCollectionManager,\n    defineEntityCollectionVEmitOptions,\n    defineEntityCollectionVProps,\n} from '../../utility';\n\nexport const AKeys = defineComponent({\n    props: defineEntityCollectionVProps<Key>(),\n    emits: defineEntityCollectionVEmitOptions<Key>(),\n    slots: Object as SlotsType<EntityCollectionVSlots<Key>>,\n    setup(props, ctx) {\n        const { render } = defineEntityCollectionManager({\n            type: `${EntityType.KEY}`,\n            props,\n            setup: ctx,\n        });\n\n        const translationName = useTranslation({\n            namespace: TranslatorTranslationNamespace.ENTITY,\n            key: TranslatorTranslationEntityKey.KEY,\n            count: 2,\n        });\n\n        const translation = useTranslation({\n            namespace: TranslatorTranslationNamespace.VUECS,\n            key: TranslatorTranslationVuecsKey.NO_MORE,\n            data: { name: translationName },\n        });\n\n        return () => render({ noMore: { content: translation.value } });\n    },\n});\n\nexport default AKeys;\n","<!--\n  - Copyright (c) 2026.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\nimport { EntityType, KeyStatus, KeyValidator } from '@authup/core-kit';\nimport { JWKUse, JWTAlgorithm } from '@authup/specs';\nimport { ValidatorGroup, generateName } from '@authup/kit';\nimport { useValidup } from '@validup/vue';\nimport {\n    TranslatorTranslationClientKey,\n    TranslatorTranslationEntityKey,\n    TranslatorTranslationFieldKey,\n    TranslatorTranslationNamespace,\n} from '@authup/i18n';\nimport {\n    assignFormProperties,\n    injectStore,\n    storeToRefs,\n    useTranslations,\n    useTranslationsForNamespace,\n} from '../../../core';\nimport type { PropType } from 'vue';\nimport {\n    computed,\n    defineComponent,\n    reactive,\n    ref,\n    useId,\n    watch,\n} from 'vue';\nimport type { Key } from '@authup/core-kit';\nimport type { FormOption } from '@vuecs/forms';\nimport {\n    VCFormCheckbox,\n    VCFormGroup,\n    VCFormInput,\n    VCFormSelect,\n    VCFormTextarea,\n} from '@vuecs/forms';\nimport { useIsEditing, useUpdatedAt } from '../../../composables';\nimport {\n    AFormSubmit,\n    ANameInput,\n    defineEntityManager,\n    defineEntityVEmitOptions,\n} from '../../utility';\nimport { ARealmPicker } from '../realm';\nimport { IFieldValidation } from '@ilingo/validup-vue';\n\nexport default defineComponent({\n    components: {\n        ANameInput,\n        ARealmPicker,\n        AFormSubmit,\n        VCFormCheckbox,\n        VCFormGroup,\n        VCFormInput,\n        VCFormSelect,\n        VCFormTextarea,\n\n        IFieldValidation,\n    },\n    props: {\n        entity: { type: Object as PropType<Key> },\n        realmId: {\n            type: String,\n            default: undefined,\n        },\n    },\n    emits: defineEntityVEmitOptions<Key>(),\n    setup(props, ctx) {\n        const busy = ref(false);\n        const nameSeed = useId();\n        const form = reactive({\n            name: '',\n            use: String(JWKUse.SIGNATURE),\n            signatureAlgorithm: String(JWTAlgorithm.RS256),\n            priority: 0,\n            status: String(KeyStatus.ACTIVE),\n            realmId: '',\n            decryptionKey: '',\n            encryptionKey: '',\n            certificate: '',\n        });\n\n        const translationsClient = useTranslationsForNamespace(\n            TranslatorTranslationNamespace.CLIENT,\n            [\n                { key: TranslatorTranslationClientKey.KEY_USE_SIGNATURE },\n                { key: TranslatorTranslationClientKey.KEY_USE_ENCRYPTION },\n                { key: TranslatorTranslationClientKey.KEY_IMPORT_MATERIAL },\n                { key: TranslatorTranslationClientKey.KEY_MATERIAL_OCT },\n                { key: TranslatorTranslationClientKey.KEY_MATERIAL_PRIVATE },\n                { key: TranslatorTranslationClientKey.KEY_MATERIAL_PUBLIC },\n            ],\n        );\n\n        const useOptions = computed<FormOption[]>(() => [\n            { value: JWKUse.SIGNATURE, label: translationsClient.keyUseSignature },\n            { value: JWKUse.ENCRYPTION, label: translationsClient.keyUseEncryption },\n        ]);\n\n        const algorithmOptions : FormOption[] = [\n            JWTAlgorithm.RS256,\n            JWTAlgorithm.RS384,\n            JWTAlgorithm.RS512,\n            JWTAlgorithm.ES256,\n            JWTAlgorithm.ES384,\n            JWTAlgorithm.ES512,\n        ].map((value) => ({ value, label: value }));\n\n        const statusOptions : FormOption[] = Object.values(KeyStatus)\n            .map((value) => ({ value, label: value }));\n\n        const manager = defineEntityManager({\n            type: EntityType.KEY,\n            setup: ctx,\n            props,\n        });\n\n        const isEditing = useIsEditing(manager.data);\n\n        const v = useValidup(\n            new KeyValidator(),\n            form as Partial<Key>,\n            { group: computed(() => (isEditing.value ? ValidatorGroup.UPDATE : ValidatorGroup.CREATE)) },\n        );\n\n        const store = injectStore();\n        const storeRefs = storeToRefs(store);\n\n        const realmLock = computed(() => {\n            if (props.realmId) {\n                return props.realmId;\n            }\n\n            if (!storeRefs.realmIsRoot.value) {\n                return storeRefs.realmId.value;\n            }\n\n            return manager.data.value ?\n                manager.data.value.realmId :\n                null;\n        });\n\n        const updatedAt = useUpdatedAt(() => props.entity);\n\n        const isEnc = computed(() => form.use === JWKUse.ENCRYPTION);\n\n        const importEnabled = ref(false);\n\n        function initForm() {\n            assignFormProperties(form, manager.data.value, { fields: v.fields });\n\n            if (props.realmId) {\n                form.realmId = props.realmId;\n            }\n\n            if (form.name.length === 0) {\n                form.name = generateName(nameSeed);\n            }\n        }\n\n        watch(updatedAt, (val, oldVal) => {\n            if (!val || val === oldVal) {\n                return;\n            }\n\n            manager.data.value = props.entity;\n            initForm();\n        });\n\n        initForm();\n\n        const submit = async () => {\n            if (busy.value || v.$invalid.value) {\n                return;\n            }\n\n            if (!isEditing.value) {\n                if (!importEnabled.value) {\n                    form.decryptionKey = '';\n                    form.encryptionKey = '';\n                    form.certificate = '';\n                }\n\n                if (isEnc.value) {\n                    form.signatureAlgorithm = '';\n                    form.encryptionKey = '';\n                    form.certificate = '';\n                }\n            }\n\n            busy.value = true;\n            try {\n                // string-enum form sentinels ('' = unset) widen the fields beyond\n                // the entity's literal unions — narrow for the manager call.\n                await manager.createOrUpdate(form as Partial<Key>);\n            } finally {\n                busy.value = false;\n            }\n        };\n\n        const updateCertificate = (value: string) => {\n            if (v.fields.certificate) {\n                v.fields.certificate.$model.value = value;\n            }\n        };\n\n        const translationsDefault = useTranslations(\n            [\n                {\n                    namespace: TranslatorTranslationNamespace.FIELD,\n                    key: TranslatorTranslationFieldKey.NAME,\n                },\n                {\n                    namespace: TranslatorTranslationNamespace.FIELD,\n                    key: TranslatorTranslationFieldKey.USE,\n                },\n                {\n                    namespace: TranslatorTranslationNamespace.FIELD,\n                    key: TranslatorTranslationFieldKey.STATUS,\n                },\n                {\n                    namespace: TranslatorTranslationNamespace.FIELD,\n                    key: TranslatorTranslationFieldKey.PRIORITY,\n                },\n                {\n                    namespace: TranslatorTranslationNamespace.FIELD,\n                    key: TranslatorTranslationFieldKey.SIGNATURE_ALGORITHM,\n                },\n                {\n                    namespace: TranslatorTranslationNamespace.FIELD,\n                    key: TranslatorTranslationFieldKey.CERTIFICATE,\n                },\n                {\n                    namespace: TranslatorTranslationNamespace.ENTITY,\n                    key: TranslatorTranslationEntityKey.REALM,\n                    count: 1,\n                },\n            ],\n        );\n\n        return {\n            busy,\n            v,\n            isEditing,\n            isEnc,\n            importEnabled,\n            realmLock,\n            useOptions,\n            algorithmOptions,\n            statusOptions,\n            translationsDefault,\n            translationsClient,\n            submit,\n            updateCertificate,\n        };\n    },\n});\n</script>\n\n<template>\n    <form @submit.prevent=\"submit\">\n        <template v-if=\"!isEditing\">\n            <IFieldValidation\n                v-slot=\"{ value }\"\n                :field=\"v.fields.use\"\n            >\n                <VCFormGroup :validation=\"value\">\n                    <template #label>\n                        {{ translationsDefault.use }}\n                    </template>\n                    <VCFormSelect\n                        v-model=\"v.fields.use.$model.value\"\n                        :options=\"useOptions\"\n                    />\n                </VCFormGroup>\n            </IFieldValidation>\n        </template>\n\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"v.fields.name\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translationsDefault.name }}\n                </template>\n                <ANameInput\n                    v-model=\"v.fields.name.$model.value\"\n                />\n            </VCFormGroup>\n        </IFieldValidation>\n\n        <template v-if=\"!isEditing && !isEnc\">\n            <IFieldValidation\n                v-slot=\"{ value }\"\n                :field=\"v.fields.signatureAlgorithm\"\n            >\n                <VCFormGroup :validation=\"value\">\n                    <template #label>\n                        {{ translationsDefault.signatureAlgorithm }}\n                    </template>\n                    <VCFormSelect\n                        v-model=\"v.fields.signatureAlgorithm.$model.value\"\n                        :options=\"algorithmOptions\"\n                    />\n                </VCFormGroup>\n            </IFieldValidation>\n        </template>\n\n        <template v-if=\"isEditing\">\n            <IFieldValidation\n                v-slot=\"{ value }\"\n                :field=\"v.fields.status\"\n            >\n                <VCFormGroup :validation=\"value\">\n                    <template #label>\n                        {{ translationsDefault.status }}\n                    </template>\n                    <VCFormSelect\n                        v-model=\"v.fields.status.$model.value\"\n                        :options=\"statusOptions\"\n                    />\n                </VCFormGroup>\n            </IFieldValidation>\n\n            <IFieldValidation\n                v-slot=\"{ value }\"\n                :field=\"v.fields.priority\"\n            >\n                <VCFormGroup :validation=\"value\">\n                    <template #label>\n                        {{ translationsDefault.priority }}\n                    </template>\n                    <VCFormInput\n                        type=\"number\"\n                        :model-value=\"`${v.fields.priority.$model.value ?? 0}`\"\n                        @update:model-value=\"(next: string) => { v.fields.priority.$model.value = Number.parseInt(next, 10) || 0; }\"\n                    />\n                </VCFormGroup>\n            </IFieldValidation>\n        </template>\n\n        <template v-if=\"!isEditing\">\n            <VCFormGroup>\n                <VCFormCheckbox\n                    v-model=\"importEnabled\"\n                    label\n                    :label-content=\"translationsClient.keyImportMaterial\"\n                />\n            </VCFormGroup>\n\n            <template v-if=\"importEnabled\">\n                <IFieldValidation\n                    v-slot=\"{ value }\"\n                    :field=\"v.fields.decryptionKey\"\n                >\n                    <VCFormGroup :validation=\"value\">\n                        <template #label>\n                            {{ isEnc ? translationsClient.keyMaterialOct : translationsClient.keyMaterialPrivate }}\n                        </template>\n                        <VCFormTextarea\n                            :model-value=\"v.fields.decryptionKey.$model.value ?? ''\"\n                            :rows=\"5\"\n                            @update:model-value=\"(next: string) => { v.fields.decryptionKey.$model.value = next; }\"\n                        />\n                    </VCFormGroup>\n                </IFieldValidation>\n\n                <template v-if=\"!isEnc\">\n                    <IFieldValidation\n                        v-slot=\"{ value }\"\n                        :field=\"v.fields.encryptionKey\"\n                    >\n                        <VCFormGroup :validation=\"value\">\n                            <template #label>\n                                {{ translationsClient.keyMaterialPublic }}\n                            </template>\n                            <VCFormTextarea\n                                :model-value=\"v.fields.encryptionKey.$model.value ?? ''\"\n                                :rows=\"5\"\n                                @update:model-value=\"(next: string) => { v.fields.encryptionKey.$model.value = next; }\"\n                            />\n                        </VCFormGroup>\n                    </IFieldValidation>\n\n                    <IFieldValidation\n                        v-if=\"v.fields.certificate\"\n                        v-slot=\"{ value }\"\n                        :field=\"v.fields.certificate\"\n                    >\n                        <VCFormGroup :validation=\"value\">\n                            <template #label>\n                                {{ translationsDefault.certificate }}\n                            </template>\n                            <VCFormTextarea\n                                :model-value=\"v.fields.certificate.$model.value ?? ''\"\n                                :rows=\"8\"\n                                @update:model-value=\"updateCertificate\"\n                            />\n                        </VCFormGroup>\n                    </IFieldValidation>\n                </template>\n            </template>\n\n            <template v-if=\"!realmLock\">\n                <IFieldValidation\n                    v-slot=\"{ value }\"\n                    :field=\"v.fields.realmId\"\n                >\n                    <VCFormGroup :validation=\"value\">\n                        <template #label>\n                            {{ translationsDefault.realm }}\n                        </template>\n                        <ARealmPicker\n                            :value=\"v.fields.realmId.$model.value\"\n                            @change=\"(input: string[]) => {\n                                v.fields.realmId.$model.value = input.length > 0 ? input[0] ?? '' : '';\n                            }\"\n                        />\n                    </VCFormGroup>\n                </IFieldValidation>\n            </template>\n        </template>\n\n        <AFormSubmit\n            :is-busy=\"busy\"\n            :is-editing=\"isEditing\"\n            :is-invalid=\"v.$invalid.value\"\n            @submit=\"submit\"\n        />\n    </form>\n</template>\n","<!--\n  - Copyright (c) 2026.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\nimport { EntityType, KeyStatus, KeyValidator } from '@authup/core-kit';\nimport { JWKUse, JWTAlgorithm } from '@authup/specs';\nimport { ValidatorGroup, generateName } from '@authup/kit';\nimport { useValidup } from '@validup/vue';\nimport {\n    TranslatorTranslationClientKey,\n    TranslatorTranslationEntityKey,\n    TranslatorTranslationFieldKey,\n    TranslatorTranslationNamespace,\n} from '@authup/i18n';\nimport {\n    assignFormProperties,\n    injectStore,\n    storeToRefs,\n    useTranslations,\n    useTranslationsForNamespace,\n} from '../../../core';\nimport type { PropType } from 'vue';\nimport {\n    computed,\n    defineComponent,\n    reactive,\n    ref,\n    useId,\n    watch,\n} from 'vue';\nimport type { Key } from '@authup/core-kit';\nimport type { FormOption } from '@vuecs/forms';\nimport {\n    VCFormCheckbox,\n    VCFormGroup,\n    VCFormInput,\n    VCFormSelect,\n    VCFormTextarea,\n} from '@vuecs/forms';\nimport { useIsEditing, useUpdatedAt } from '../../../composables';\nimport {\n    AFormSubmit,\n    ANameInput,\n    defineEntityManager,\n    defineEntityVEmitOptions,\n} from '../../utility';\nimport { ARealmPicker } from '../realm';\nimport { IFieldValidation } from '@ilingo/validup-vue';\n\nexport default defineComponent({\n    components: {\n        ANameInput,\n        ARealmPicker,\n        AFormSubmit,\n        VCFormCheckbox,\n        VCFormGroup,\n        VCFormInput,\n        VCFormSelect,\n        VCFormTextarea,\n\n        IFieldValidation,\n    },\n    props: {\n        entity: { type: Object as PropType<Key> },\n        realmId: {\n            type: String,\n            default: undefined,\n        },\n    },\n    emits: defineEntityVEmitOptions<Key>(),\n    setup(props, ctx) {\n        const busy = ref(false);\n        const nameSeed = useId();\n        const form = reactive({\n            name: '',\n            use: String(JWKUse.SIGNATURE),\n            signatureAlgorithm: String(JWTAlgorithm.RS256),\n            priority: 0,\n            status: String(KeyStatus.ACTIVE),\n            realmId: '',\n            decryptionKey: '',\n            encryptionKey: '',\n            certificate: '',\n        });\n\n        const translationsClient = useTranslationsForNamespace(\n            TranslatorTranslationNamespace.CLIENT,\n            [\n                { key: TranslatorTranslationClientKey.KEY_USE_SIGNATURE },\n                { key: TranslatorTranslationClientKey.KEY_USE_ENCRYPTION },\n                { key: TranslatorTranslationClientKey.KEY_IMPORT_MATERIAL },\n                { key: TranslatorTranslationClientKey.KEY_MATERIAL_OCT },\n                { key: TranslatorTranslationClientKey.KEY_MATERIAL_PRIVATE },\n                { key: TranslatorTranslationClientKey.KEY_MATERIAL_PUBLIC },\n            ],\n        );\n\n        const useOptions = computed<FormOption[]>(() => [\n            { value: JWKUse.SIGNATURE, label: translationsClient.keyUseSignature },\n            { value: JWKUse.ENCRYPTION, label: translationsClient.keyUseEncryption },\n        ]);\n\n        const algorithmOptions : FormOption[] = [\n            JWTAlgorithm.RS256,\n            JWTAlgorithm.RS384,\n            JWTAlgorithm.RS512,\n            JWTAlgorithm.ES256,\n            JWTAlgorithm.ES384,\n            JWTAlgorithm.ES512,\n        ].map((value) => ({ value, label: value }));\n\n        const statusOptions : FormOption[] = Object.values(KeyStatus)\n            .map((value) => ({ value, label: value }));\n\n        const manager = defineEntityManager({\n            type: EntityType.KEY,\n            setup: ctx,\n            props,\n        });\n\n        const isEditing = useIsEditing(manager.data);\n\n        const v = useValidup(\n            new KeyValidator(),\n            form as Partial<Key>,\n            { group: computed(() => (isEditing.value ? ValidatorGroup.UPDATE : ValidatorGroup.CREATE)) },\n        );\n\n        const store = injectStore();\n        const storeRefs = storeToRefs(store);\n\n        const realmLock = computed(() => {\n            if (props.realmId) {\n                return props.realmId;\n            }\n\n            if (!storeRefs.realmIsRoot.value) {\n                return storeRefs.realmId.value;\n            }\n\n            return manager.data.value ?\n                manager.data.value.realmId :\n                null;\n        });\n\n        const updatedAt = useUpdatedAt(() => props.entity);\n\n        const isEnc = computed(() => form.use === JWKUse.ENCRYPTION);\n\n        const importEnabled = ref(false);\n\n        function initForm() {\n            assignFormProperties(form, manager.data.value, { fields: v.fields });\n\n            if (props.realmId) {\n                form.realmId = props.realmId;\n            }\n\n            if (form.name.length === 0) {\n                form.name = generateName(nameSeed);\n            }\n        }\n\n        watch(updatedAt, (val, oldVal) => {\n            if (!val || val === oldVal) {\n                return;\n            }\n\n            manager.data.value = props.entity;\n            initForm();\n        });\n\n        initForm();\n\n        const submit = async () => {\n            if (busy.value || v.$invalid.value) {\n                return;\n            }\n\n            if (!isEditing.value) {\n                if (!importEnabled.value) {\n                    form.decryptionKey = '';\n                    form.encryptionKey = '';\n                    form.certificate = '';\n                }\n\n                if (isEnc.value) {\n                    form.signatureAlgorithm = '';\n                    form.encryptionKey = '';\n                    form.certificate = '';\n                }\n            }\n\n            busy.value = true;\n            try {\n                // string-enum form sentinels ('' = unset) widen the fields beyond\n                // the entity's literal unions — narrow for the manager call.\n                await manager.createOrUpdate(form as Partial<Key>);\n            } finally {\n                busy.value = false;\n            }\n        };\n\n        const updateCertificate = (value: string) => {\n            if (v.fields.certificate) {\n                v.fields.certificate.$model.value = value;\n            }\n        };\n\n        const translationsDefault = useTranslations(\n            [\n                {\n                    namespace: TranslatorTranslationNamespace.FIELD,\n                    key: TranslatorTranslationFieldKey.NAME,\n                },\n                {\n                    namespace: TranslatorTranslationNamespace.FIELD,\n                    key: TranslatorTranslationFieldKey.USE,\n                },\n                {\n                    namespace: TranslatorTranslationNamespace.FIELD,\n                    key: TranslatorTranslationFieldKey.STATUS,\n                },\n                {\n                    namespace: TranslatorTranslationNamespace.FIELD,\n                    key: TranslatorTranslationFieldKey.PRIORITY,\n                },\n                {\n                    namespace: TranslatorTranslationNamespace.FIELD,\n                    key: TranslatorTranslationFieldKey.SIGNATURE_ALGORITHM,\n                },\n                {\n                    namespace: TranslatorTranslationNamespace.FIELD,\n                    key: TranslatorTranslationFieldKey.CERTIFICATE,\n                },\n                {\n                    namespace: TranslatorTranslationNamespace.ENTITY,\n                    key: TranslatorTranslationEntityKey.REALM,\n                    count: 1,\n                },\n            ],\n        );\n\n        return {\n            busy,\n            v,\n            isEditing,\n            isEnc,\n            importEnabled,\n            realmLock,\n            useOptions,\n            algorithmOptions,\n            statusOptions,\n            translationsDefault,\n            translationsClient,\n            submit,\n            updateCertificate,\n        };\n    },\n});\n</script>\n\n<template>\n    <form @submit.prevent=\"submit\">\n        <template v-if=\"!isEditing\">\n            <IFieldValidation\n                v-slot=\"{ value }\"\n                :field=\"v.fields.use\"\n            >\n                <VCFormGroup :validation=\"value\">\n                    <template #label>\n                        {{ translationsDefault.use }}\n                    </template>\n                    <VCFormSelect\n                        v-model=\"v.fields.use.$model.value\"\n                        :options=\"useOptions\"\n                    />\n                </VCFormGroup>\n            </IFieldValidation>\n        </template>\n\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"v.fields.name\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translationsDefault.name }}\n                </template>\n                <ANameInput\n                    v-model=\"v.fields.name.$model.value\"\n                />\n            </VCFormGroup>\n        </IFieldValidation>\n\n        <template v-if=\"!isEditing && !isEnc\">\n            <IFieldValidation\n                v-slot=\"{ value }\"\n                :field=\"v.fields.signatureAlgorithm\"\n            >\n                <VCFormGroup :validation=\"value\">\n                    <template #label>\n                        {{ translationsDefault.signatureAlgorithm }}\n                    </template>\n                    <VCFormSelect\n                        v-model=\"v.fields.signatureAlgorithm.$model.value\"\n                        :options=\"algorithmOptions\"\n                    />\n                </VCFormGroup>\n            </IFieldValidation>\n        </template>\n\n        <template v-if=\"isEditing\">\n            <IFieldValidation\n                v-slot=\"{ value }\"\n                :field=\"v.fields.status\"\n            >\n                <VCFormGroup :validation=\"value\">\n                    <template #label>\n                        {{ translationsDefault.status }}\n                    </template>\n                    <VCFormSelect\n                        v-model=\"v.fields.status.$model.value\"\n                        :options=\"statusOptions\"\n                    />\n                </VCFormGroup>\n            </IFieldValidation>\n\n            <IFieldValidation\n                v-slot=\"{ value }\"\n                :field=\"v.fields.priority\"\n            >\n                <VCFormGroup :validation=\"value\">\n                    <template #label>\n                        {{ translationsDefault.priority }}\n                    </template>\n                    <VCFormInput\n                        type=\"number\"\n                        :model-value=\"`${v.fields.priority.$model.value ?? 0}`\"\n                        @update:model-value=\"(next: string) => { v.fields.priority.$model.value = Number.parseInt(next, 10) || 0; }\"\n                    />\n                </VCFormGroup>\n            </IFieldValidation>\n        </template>\n\n        <template v-if=\"!isEditing\">\n            <VCFormGroup>\n                <VCFormCheckbox\n                    v-model=\"importEnabled\"\n                    label\n                    :label-content=\"translationsClient.keyImportMaterial\"\n                />\n            </VCFormGroup>\n\n            <template v-if=\"importEnabled\">\n                <IFieldValidation\n                    v-slot=\"{ value }\"\n                    :field=\"v.fields.decryptionKey\"\n                >\n                    <VCFormGroup :validation=\"value\">\n                        <template #label>\n                            {{ isEnc ? translationsClient.keyMaterialOct : translationsClient.keyMaterialPrivate }}\n                        </template>\n                        <VCFormTextarea\n                            :model-value=\"v.fields.decryptionKey.$model.value ?? ''\"\n                            :rows=\"5\"\n                            @update:model-value=\"(next: string) => { v.fields.decryptionKey.$model.value = next; }\"\n                        />\n                    </VCFormGroup>\n                </IFieldValidation>\n\n                <template v-if=\"!isEnc\">\n                    <IFieldValidation\n                        v-slot=\"{ value }\"\n                        :field=\"v.fields.encryptionKey\"\n                    >\n                        <VCFormGroup :validation=\"value\">\n                            <template #label>\n                                {{ translationsClient.keyMaterialPublic }}\n                            </template>\n                            <VCFormTextarea\n                                :model-value=\"v.fields.encryptionKey.$model.value ?? ''\"\n                                :rows=\"5\"\n                                @update:model-value=\"(next: string) => { v.fields.encryptionKey.$model.value = next; }\"\n                            />\n                        </VCFormGroup>\n                    </IFieldValidation>\n\n                    <IFieldValidation\n                        v-if=\"v.fields.certificate\"\n                        v-slot=\"{ value }\"\n                        :field=\"v.fields.certificate\"\n                    >\n                        <VCFormGroup :validation=\"value\">\n                            <template #label>\n                                {{ translationsDefault.certificate }}\n                            </template>\n                            <VCFormTextarea\n                                :model-value=\"v.fields.certificate.$model.value ?? ''\"\n                                :rows=\"8\"\n                                @update:model-value=\"updateCertificate\"\n                            />\n                        </VCFormGroup>\n                    </IFieldValidation>\n                </template>\n            </template>\n\n            <template v-if=\"!realmLock\">\n                <IFieldValidation\n                    v-slot=\"{ value }\"\n                    :field=\"v.fields.realmId\"\n                >\n                    <VCFormGroup :validation=\"value\">\n                        <template #label>\n                            {{ translationsDefault.realm }}\n                        </template>\n                        <ARealmPicker\n                            :value=\"v.fields.realmId.$model.value\"\n                            @change=\"(input: string[]) => {\n                                v.fields.realmId.$model.value = input.length > 0 ? input[0] ?? '' : '';\n                            }\"\n                        />\n                    </VCFormGroup>\n                </IFieldValidation>\n            </template>\n        </template>\n\n        <AFormSubmit\n            :is-busy=\"busy\"\n            :is-editing=\"isEditing\"\n            :is-invalid=\"v.$invalid.value\"\n            @submit=\"submit\"\n        />\n    </form>\n</template>\n","<script lang=\"ts\">\nimport type { AttributeNamesPolicy } from '@authup/access';\nimport type { Policy } from '@authup/core-kit';\nimport { Container } from 'validup';\nimport { useValidup } from '@validup/vue';\nimport type { PropType } from 'vue';\nimport { defineComponent, reactive } from 'vue';\nimport { onChange, useUpdatedAt } from '../../../../composables';\nimport AFormInputList from '../../../utility/form-input-list/AFormInputList.vue';\n\nexport default defineComponent({\n    components: { AFormInputList },\n    props: { entity: { type: Object as PropType<Partial<Policy>> } },\n    emits: ['updated'],\n    setup(props, setup) {\n        const form = reactive<{ names: string[] }>({ names: [] });\n\n        const v = useValidup(new Container<typeof form>(), form, { name: 'type' });\n\n        function assign(data: Partial<AttributeNamesPolicy> = {}) {\n            form.names = data.names || [];\n        }\n\n        setup.expose({ assign });\n\n        const updatedAt = useUpdatedAt(() => props.entity as Policy);\n        onChange(updatedAt, () => assign(props.entity));\n\n        assign(props.entity);\n\n        const handleUpdated = (data: string[]) => {\n            form.names = data;\n            setup.emit('updated', data);\n        };\n\n        return {\n            handleUpdated,\n            v,\n        };\n    },\n});\n</script>\n<template>\n    <AFormInputList\n        :names=\"v.fields.names.$model.value\"\n        :min-items=\"1\"\n        @changed=\"handleUpdated\"\n    />\n</template>\n","<script lang=\"ts\">\nimport type { AttributeNamesPolicy } from '@authup/access';\nimport type { Policy } from '@authup/core-kit';\nimport { Container } from 'validup';\nimport { useValidup } from '@validup/vue';\nimport type { PropType } from 'vue';\nimport { defineComponent, reactive } from 'vue';\nimport { onChange, useUpdatedAt } from '../../../../composables';\nimport AFormInputList from '../../../utility/form-input-list/AFormInputList.vue';\n\nexport default defineComponent({\n    components: { AFormInputList },\n    props: { entity: { type: Object as PropType<Partial<Policy>> } },\n    emits: ['updated'],\n    setup(props, setup) {\n        const form = reactive<{ names: string[] }>({ names: [] });\n\n        const v = useValidup(new Container<typeof form>(), form, { name: 'type' });\n\n        function assign(data: Partial<AttributeNamesPolicy> = {}) {\n            form.names = data.names || [];\n        }\n\n        setup.expose({ assign });\n\n        const updatedAt = useUpdatedAt(() => props.entity as Policy);\n        onChange(updatedAt, () => assign(props.entity));\n\n        assign(props.entity);\n\n        const handleUpdated = (data: string[]) => {\n            form.names = data;\n            setup.emit('updated', data);\n        };\n\n        return {\n            handleUpdated,\n            v,\n        };\n    },\n});\n</script>\n<template>\n    <AFormInputList\n        :names=\"v.fields.names.$model.value\"\n        :min-items=\"1\"\n        @changed=\"handleUpdated\"\n    />\n</template>\n","<script lang=\"ts\">\nimport type { QueryFiltersInput } from '../../../../core';\nimport { defineQuery } from '@rapiq/core';\nimport {\n    type PropType,\n    computed,\n    defineComponent,\n    reactive,\n} from 'vue';\nimport { Container } from 'validup';\nimport { useValidup } from '@validup/vue';\nimport type { Policy } from '@authup/core-kit';\nimport { DecisionStrategy } from '@authup/kit';\nimport type { FormOption } from '@vuecs/forms';\nimport { VCFormGroup, VCFormSelect } from '@vuecs/forms';\nimport {\n    TranslatorTranslationClientKey,\n    TranslatorTranslationFieldKey,\n    TranslatorTranslationNamespace,\n} from '@authup/i18n';\nimport { useTranslations } from '../../../../core';\nimport { onChange, useUpdatedAt } from '../../../../composables';\nimport APolicyPicker from '../APolicyPicker.vue';\nimport { VCAlert } from '@vuecs/elements';\nimport { IFieldValidation } from '@ilingo/validup-vue';\n\nexport default defineComponent({\n    components: {\n        APolicyChildrenPicker: APolicyPicker,\n        VCFormGroup,\n        VCFormSelect,\n        VCAlert,\n\n        IFieldValidation,\n    },\n    props: { entity: { type: Object as PropType<Partial<Policy>> } },\n    emits: ['updated'],\n    setup(props, setup) {\n        const form = reactive<{ items: string[], decisionStrategy: string }>({\n            items: [],\n            decisionStrategy: '',\n        });\n\n        const decisionStrategyOptions: FormOption[] = Object.values(DecisionStrategy)\n            .map((value) => ({\n                label: value,\n                value,\n            }));\n\n        const id = computed(() => {\n            if (!props.entity) {\n                return undefined;\n            }\n            return props.entity.id;\n        });\n\n        const v = useValidup(new Container<typeof form>(), form, { name: 'type' });\n\n        const query = computed(() => {\n            const filters: QueryFiltersInput<Policy & { parentId?: string | null }> = {};\n            if (props.entity) {\n                // todo: maybe respect manual realmId component prop\n                if (props.entity.realmId) {\n                    filters.realmId = props.entity.realmId;\n                }\n\n                const excluded = [props.entity.id, props.entity.parentId]\n                    .filter((value): value is string => typeof value === 'string');\n                if (excluded.length === 1) {\n                    filters.id = { $ne: excluded[0] };\n                } else if (excluded.length > 1) {\n                    filters.id = { $nin: excluded };\n                }\n\n                filters.parentId = [null, String(props.entity.id)];\n            } else {\n                filters.parentId = null;\n            }\n\n            return defineQuery<Policy & { parentId?: string | null }>({\n                filters,\n                sorts: { name: 'ASC' },\n            });\n        });\n\n        function assign(data: Partial<Policy> = {}) {\n            if (data.children) {\n                form.items = data.children\n                    .map((child) => child.id)\n                    .filter((id): id is string => !!id);\n            } else {\n                form.items = [];\n            }\n\n            const record = data as Record<string, unknown>;\n            if (typeof record.decisionStrategy === 'string') {\n                form.decisionStrategy = record.decisionStrategy;\n            } else {\n                form.decisionStrategy = '';\n            }\n        }\n\n        setup.expose({ assign });\n\n        const updatedAt = useUpdatedAt(() => props.entity as Policy);\n        onChange(updatedAt, () => assign(props.entity));\n\n        assign(props.entity);\n\n        const emitUpdated = () => {\n            setup.emit('updated', {\n                data: [...form.items],\n                decisionStrategy: form.decisionStrategy || undefined,\n                valid: !v.$invalid.value,\n            });\n        };\n\n        const handleUpdated = (children: string[]) => {\n            form.items = children;\n            emitUpdated();\n        };\n\n        const translations = useTranslations([\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.DECISION_STRATEGY,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.CHILDREN,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.CLIENT,\n                key: TranslatorTranslationClientKey.OPTION_NONE_UNANIMOUS,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.CLIENT,\n                key: TranslatorTranslationClientKey.DECISION_STRATEGY_HINT_AFFIRMATIVE,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.CLIENT,\n                key: TranslatorTranslationClientKey.DECISION_STRATEGY_HINT_CONSENSUS,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.CLIENT,\n                key: TranslatorTranslationClientKey.DECISION_STRATEGY_HINT_UNANIMOUS,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.CLIENT,\n                key: TranslatorTranslationClientKey.DECISION_STRATEGY_HINT_DEFAULT,\n            },\n        ]);\n\n        const decisionStrategyHint = computed(() => {\n            switch (form.decisionStrategy) {\n                case DecisionStrategy.AFFIRMATIVE:\n                    return translations.decisionStrategyHintAffirmative;\n                case DecisionStrategy.CONSENSUS:\n                    return translations.decisionStrategyHintConsensus;\n                case DecisionStrategy.UNANIMOUS:\n                    return translations.decisionStrategyHintUnanimous;\n                default:\n                    return translations.decisionStrategyHintDefault;\n            }\n        });\n\n        const handleDecisionStrategyUpdated = () => {\n            emitUpdated();\n        };\n\n        return {\n            id,\n            handleUpdated,\n            handleDecisionStrategyUpdated,\n            decisionStrategyHint,\n            decisionStrategyOptions,\n            translations,\n            v,\n            query,\n        };\n    },\n});\n</script>\n<template>\n    <div>\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"v.fields.decisionStrategy\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translations.decisionStrategy }}\n                </template>\n                <VCFormSelect\n                    v-model=\"v.fields.decisionStrategy.$model.value\"\n                    :options=\"decisionStrategyOptions\"\n                    :placeholder=\"translations.optionNoneUnanimous\"\n                    @update:model-value=\"handleDecisionStrategyUpdated\"\n                />\n                <VCAlert\n                    color=\"info\"\n                    variant=\"soft\"\n                    size=\"sm\"\n                    class=\"mt-1 mb-0\"\n                >\n                    {{ decisionStrategyHint }}\n                </VCAlert>\n            </VCFormGroup>\n        </IFieldValidation>\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"v.fields.items\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translations.children }}\n                </template>\n                <APolicyChildrenPicker\n                    :parent-id=\"id\"\n                    :query=\"query\"\n                    :value=\"v.fields.items.$model.value\"\n                    @change=\"handleUpdated\"\n                />\n            </VCFormGroup>\n        </IFieldValidation>\n    </div>\n</template>\n","<script lang=\"ts\">\nimport type { QueryFiltersInput } from '../../../../core';\nimport { defineQuery } from '@rapiq/core';\nimport {\n    type PropType,\n    computed,\n    defineComponent,\n    reactive,\n} from 'vue';\nimport { Container } from 'validup';\nimport { useValidup } from '@validup/vue';\nimport type { Policy } from '@authup/core-kit';\nimport { DecisionStrategy } from '@authup/kit';\nimport type { FormOption } from '@vuecs/forms';\nimport { VCFormGroup, VCFormSelect } from '@vuecs/forms';\nimport {\n    TranslatorTranslationClientKey,\n    TranslatorTranslationFieldKey,\n    TranslatorTranslationNamespace,\n} from '@authup/i18n';\nimport { useTranslations } from '../../../../core';\nimport { onChange, useUpdatedAt } from '../../../../composables';\nimport APolicyPicker from '../APolicyPicker.vue';\nimport { VCAlert } from '@vuecs/elements';\nimport { IFieldValidation } from '@ilingo/validup-vue';\n\nexport default defineComponent({\n    components: {\n        APolicyChildrenPicker: APolicyPicker,\n        VCFormGroup,\n        VCFormSelect,\n        VCAlert,\n\n        IFieldValidation,\n    },\n    props: { entity: { type: Object as PropType<Partial<Policy>> } },\n    emits: ['updated'],\n    setup(props, setup) {\n        const form = reactive<{ items: string[], decisionStrategy: string }>({\n            items: [],\n            decisionStrategy: '',\n        });\n\n        const decisionStrategyOptions: FormOption[] = Object.values(DecisionStrategy)\n            .map((value) => ({\n                label: value,\n                value,\n            }));\n\n        const id = computed(() => {\n            if (!props.entity) {\n                return undefined;\n            }\n            return props.entity.id;\n        });\n\n        const v = useValidup(new Container<typeof form>(), form, { name: 'type' });\n\n        const query = computed(() => {\n            const filters: QueryFiltersInput<Policy & { parentId?: string | null }> = {};\n            if (props.entity) {\n                // todo: maybe respect manual realmId component prop\n                if (props.entity.realmId) {\n                    filters.realmId = props.entity.realmId;\n                }\n\n                const excluded = [props.entity.id, props.entity.parentId]\n                    .filter((value): value is string => typeof value === 'string');\n                if (excluded.length === 1) {\n                    filters.id = { $ne: excluded[0] };\n                } else if (excluded.length > 1) {\n                    filters.id = { $nin: excluded };\n                }\n\n                filters.parentId = [null, String(props.entity.id)];\n            } else {\n                filters.parentId = null;\n            }\n\n            return defineQuery<Policy & { parentId?: string | null }>({\n                filters,\n                sorts: { name: 'ASC' },\n            });\n        });\n\n        function assign(data: Partial<Policy> = {}) {\n            if (data.children) {\n                form.items = data.children\n                    .map((child) => child.id)\n                    .filter((id): id is string => !!id);\n            } else {\n                form.items = [];\n            }\n\n            const record = data as Record<string, unknown>;\n            if (typeof record.decisionStrategy === 'string') {\n                form.decisionStrategy = record.decisionStrategy;\n            } else {\n                form.decisionStrategy = '';\n            }\n        }\n\n        setup.expose({ assign });\n\n        const updatedAt = useUpdatedAt(() => props.entity as Policy);\n        onChange(updatedAt, () => assign(props.entity));\n\n        assign(props.entity);\n\n        const emitUpdated = () => {\n            setup.emit('updated', {\n                data: [...form.items],\n                decisionStrategy: form.decisionStrategy || undefined,\n                valid: !v.$invalid.value,\n            });\n        };\n\n        const handleUpdated = (children: string[]) => {\n            form.items = children;\n            emitUpdated();\n        };\n\n        const translations = useTranslations([\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.DECISION_STRATEGY,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.CHILDREN,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.CLIENT,\n                key: TranslatorTranslationClientKey.OPTION_NONE_UNANIMOUS,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.CLIENT,\n                key: TranslatorTranslationClientKey.DECISION_STRATEGY_HINT_AFFIRMATIVE,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.CLIENT,\n                key: TranslatorTranslationClientKey.DECISION_STRATEGY_HINT_CONSENSUS,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.CLIENT,\n                key: TranslatorTranslationClientKey.DECISION_STRATEGY_HINT_UNANIMOUS,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.CLIENT,\n                key: TranslatorTranslationClientKey.DECISION_STRATEGY_HINT_DEFAULT,\n            },\n        ]);\n\n        const decisionStrategyHint = computed(() => {\n            switch (form.decisionStrategy) {\n                case DecisionStrategy.AFFIRMATIVE:\n                    return translations.decisionStrategyHintAffirmative;\n                case DecisionStrategy.CONSENSUS:\n                    return translations.decisionStrategyHintConsensus;\n                case DecisionStrategy.UNANIMOUS:\n                    return translations.decisionStrategyHintUnanimous;\n                default:\n                    return translations.decisionStrategyHintDefault;\n            }\n        });\n\n        const handleDecisionStrategyUpdated = () => {\n            emitUpdated();\n        };\n\n        return {\n            id,\n            handleUpdated,\n            handleDecisionStrategyUpdated,\n            decisionStrategyHint,\n            decisionStrategyOptions,\n            translations,\n            v,\n            query,\n        };\n    },\n});\n</script>\n<template>\n    <div>\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"v.fields.decisionStrategy\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translations.decisionStrategy }}\n                </template>\n                <VCFormSelect\n                    v-model=\"v.fields.decisionStrategy.$model.value\"\n                    :options=\"decisionStrategyOptions\"\n                    :placeholder=\"translations.optionNoneUnanimous\"\n                    @update:model-value=\"handleDecisionStrategyUpdated\"\n                />\n                <VCAlert\n                    color=\"info\"\n                    variant=\"soft\"\n                    size=\"sm\"\n                    class=\"mt-1 mb-0\"\n                >\n                    {{ decisionStrategyHint }}\n                </VCAlert>\n            </VCFormGroup>\n        </IFieldValidation>\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"v.fields.items\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translations.children }}\n                </template>\n                <APolicyChildrenPicker\n                    :parent-id=\"id\"\n                    :query=\"query\"\n                    :value=\"v.fields.items.$model.value\"\n                    @change=\"handleUpdated\"\n                />\n            </VCFormGroup>\n        </IFieldValidation>\n    </div>\n</template>\n","<script lang=\"ts\">\nimport { type PropType, defineComponent, reactive } from 'vue';\nimport { Container } from 'validup';\nimport { useValidup } from '@validup/vue';\nimport { TranslatorTranslationFieldKey, TranslatorTranslationNamespace } from '@authup/i18n';\nimport { assignFormProperties, useTranslations } from '../../../../core';\nimport type { Policy } from '@authup/core-kit';\nimport { VCFormGroup, VCFormInput } from '@vuecs/forms';\nimport type { DatePolicy } from '@authup/access';\nimport { onChange, useUpdatedAt } from '../../../../composables';\nimport { IFieldValidation } from '@ilingo/validup-vue';\n\nexport default defineComponent({\n    components: {\n        VCFormInput, \n        VCFormGroup, \n        IFieldValidation, \n    },\n    props: { entity: { type: Object as PropType<Partial<Policy>> } },\n    emits: ['updated'],\n    setup(props, setup) {\n        const form = reactive({\n            start: '',\n            end: '',\n        });\n\n        // No backend validator covers date-policy attributes today —\n        // an empty `Container` registers the child slot ('type') with\n        // the parent `<APolicyForm>` collector so it can extract this\n        // form's state via `extractValidupResultsFromChild('type')`.\n        const v = useValidup(new Container<typeof form>(), form, { name: 'type' });\n\n        const translationsDefault = useTranslations([\n            {\n                namespace: TranslatorTranslationNamespace.FIELD, \n                key: TranslatorTranslationFieldKey.START, \n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD, \n                key: TranslatorTranslationFieldKey.END, \n            },\n        ]);\n\n        function assign(data: Partial<DatePolicy> = {}) {\n            assignFormProperties(form, data as Record<string, unknown>, { fields: v.fields });\n        }\n\n        setup.expose({ assign });\n\n        const updatedAt = useUpdatedAt(() => props.entity as Policy);\n        onChange(updatedAt, () => assign(props.entity));\n\n        assign(props.entity);\n\n        const handleUpdated = () => {\n            setup.emit('updated', {\n                data: form,\n                valid: !v.$invalid.value,\n            });\n        };\n\n        return {\n            handleUpdated,\n            v,\n            translationsDefault,\n        };\n    },\n});\n</script>\n<template>\n    <div>\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"v.fields.start\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translationsDefault.start }}\n                </template>\n                <VCFormInput\n                    v-model=\"v.fields.start.$model.value\"\n                    placeholder=\"YYYY-MM-DD\"\n                    @change=\"handleUpdated\"\n                />\n            </VCFormGroup>\n        </IFieldValidation>\n\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"v.fields.end\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translationsDefault.end }}\n                </template>\n                <VCFormInput\n                    v-model=\"v.fields.end.$model.value\"\n                    placeholder=\"YYYY-MM-DD\"\n                    @change=\"handleUpdated\"\n                />\n            </VCFormGroup>\n        </IFieldValidation>\n    </div>\n</template>\n","<script lang=\"ts\">\nimport { type PropType, defineComponent, reactive } from 'vue';\nimport { Container } from 'validup';\nimport { useValidup } from '@validup/vue';\nimport { TranslatorTranslationFieldKey, TranslatorTranslationNamespace } from '@authup/i18n';\nimport { assignFormProperties, useTranslations } from '../../../../core';\nimport type { Policy } from '@authup/core-kit';\nimport { VCFormGroup, VCFormInput } from '@vuecs/forms';\nimport type { DatePolicy } from '@authup/access';\nimport { onChange, useUpdatedAt } from '../../../../composables';\nimport { IFieldValidation } from '@ilingo/validup-vue';\n\nexport default defineComponent({\n    components: {\n        VCFormInput, \n        VCFormGroup, \n        IFieldValidation, \n    },\n    props: { entity: { type: Object as PropType<Partial<Policy>> } },\n    emits: ['updated'],\n    setup(props, setup) {\n        const form = reactive({\n            start: '',\n            end: '',\n        });\n\n        // No backend validator covers date-policy attributes today —\n        // an empty `Container` registers the child slot ('type') with\n        // the parent `<APolicyForm>` collector so it can extract this\n        // form's state via `extractValidupResultsFromChild('type')`.\n        const v = useValidup(new Container<typeof form>(), form, { name: 'type' });\n\n        const translationsDefault = useTranslations([\n            {\n                namespace: TranslatorTranslationNamespace.FIELD, \n                key: TranslatorTranslationFieldKey.START, \n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD, \n                key: TranslatorTranslationFieldKey.END, \n            },\n        ]);\n\n        function assign(data: Partial<DatePolicy> = {}) {\n            assignFormProperties(form, data as Record<string, unknown>, { fields: v.fields });\n        }\n\n        setup.expose({ assign });\n\n        const updatedAt = useUpdatedAt(() => props.entity as Policy);\n        onChange(updatedAt, () => assign(props.entity));\n\n        assign(props.entity);\n\n        const handleUpdated = () => {\n            setup.emit('updated', {\n                data: form,\n                valid: !v.$invalid.value,\n            });\n        };\n\n        return {\n            handleUpdated,\n            v,\n            translationsDefault,\n        };\n    },\n});\n</script>\n<template>\n    <div>\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"v.fields.start\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translationsDefault.start }}\n                </template>\n                <VCFormInput\n                    v-model=\"v.fields.start.$model.value\"\n                    placeholder=\"YYYY-MM-DD\"\n                    @change=\"handleUpdated\"\n                />\n            </VCFormGroup>\n        </IFieldValidation>\n\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"v.fields.end\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translationsDefault.end }}\n                </template>\n                <VCFormInput\n                    v-model=\"v.fields.end.$model.value\"\n                    placeholder=\"YYYY-MM-DD\"\n                    @change=\"handleUpdated\"\n                />\n            </VCFormGroup>\n        </IFieldValidation>\n    </div>\n</template>\n","<script lang=\"ts\">\nimport type { IdentityPolicy } from '@authup/access';\nimport type { Policy } from '@authup/core-kit';\nimport { Container } from 'validup';\nimport { useValidup } from '@validup/vue';\nimport type { PropType } from 'vue';\nimport { defineComponent, reactive } from 'vue';\nimport {\n    TranslatorTranslationFieldKey,\n    TranslatorTranslationNamespace,\n} from '@authup/i18n';\nimport { useTranslationsForNamespace } from '../../../../core';\nimport { onChange, useUpdatedAt } from '../../../../composables';\nimport AFormInputList from '../../../utility/form-input-list/AFormInputList.vue';\n\nexport default defineComponent({\n    components: { AFormInputList },\n    props: { entity: { type: Object as PropType<Partial<Policy>> } },\n    emits: ['updated'],\n    setup(props, setup) {\n        const form = reactive<{ types: string[] }>({ types: [] });\n\n        // Empty container — registers as the 'type' child of the\n        // parent `<APolicyForm>` so it can extract `types` via\n        // `extractValidupResultsFromChild('type')`.\n        const v = useValidup(new Container<typeof form>(), form, { name: 'type' });\n\n        function assign(data: Partial<IdentityPolicy> = {}) {\n            form.types = data.types || [];\n        }\n\n        setup.expose({ assign });\n\n        const updatedAt = useUpdatedAt(() => props.entity as Policy);\n        onChange(updatedAt, () => assign(props.entity));\n\n        assign(props.entity);\n\n        const handleUpdated = (data: string[]) => {\n            form.types = data;\n            setup.emit('updated', data);\n        };\n\n        const translations = useTranslationsForNamespace(\n            TranslatorTranslationNamespace.FIELD,\n            [\n                { key: TranslatorTranslationFieldKey.TYPES },\n            ],\n        );\n\n        return {\n            handleUpdated,\n            translations,\n            v,\n        };\n    },\n});\n</script>\n<template>\n    <AFormInputList\n        :names=\"v.fields.types.$model.value\"\n        :min-items=\"1\"\n        @changed=\"handleUpdated\"\n    >\n        <template #label>\n            {{ translations.types }}\n        </template>\n    </AFormInputList>\n</template>\n","<script lang=\"ts\">\nimport type { IdentityPolicy } from '@authup/access';\nimport type { Policy } from '@authup/core-kit';\nimport { Container } from 'validup';\nimport { useValidup } from '@validup/vue';\nimport type { PropType } from 'vue';\nimport { defineComponent, reactive } from 'vue';\nimport {\n    TranslatorTranslationFieldKey,\n    TranslatorTranslationNamespace,\n} from '@authup/i18n';\nimport { useTranslationsForNamespace } from '../../../../core';\nimport { onChange, useUpdatedAt } from '../../../../composables';\nimport AFormInputList from '../../../utility/form-input-list/AFormInputList.vue';\n\nexport default defineComponent({\n    components: { AFormInputList },\n    props: { entity: { type: Object as PropType<Partial<Policy>> } },\n    emits: ['updated'],\n    setup(props, setup) {\n        const form = reactive<{ types: string[] }>({ types: [] });\n\n        // Empty container — registers as the 'type' child of the\n        // parent `<APolicyForm>` so it can extract `types` via\n        // `extractValidupResultsFromChild('type')`.\n        const v = useValidup(new Container<typeof form>(), form, { name: 'type' });\n\n        function assign(data: Partial<IdentityPolicy> = {}) {\n            form.types = data.types || [];\n        }\n\n        setup.expose({ assign });\n\n        const updatedAt = useUpdatedAt(() => props.entity as Policy);\n        onChange(updatedAt, () => assign(props.entity));\n\n        assign(props.entity);\n\n        const handleUpdated = (data: string[]) => {\n            form.types = data;\n            setup.emit('updated', data);\n        };\n\n        const translations = useTranslationsForNamespace(\n            TranslatorTranslationNamespace.FIELD,\n            [\n                { key: TranslatorTranslationFieldKey.TYPES },\n            ],\n        );\n\n        return {\n            handleUpdated,\n            translations,\n            v,\n        };\n    },\n});\n</script>\n<template>\n    <AFormInputList\n        :names=\"v.fields.types.$model.value\"\n        :min-items=\"1\"\n        @changed=\"handleUpdated\"\n    >\n        <template #label>\n            {{ translations.types }}\n        </template>\n    </AFormInputList>\n</template>\n","<script lang=\"ts\">\nimport { type PropType, defineComponent, reactive } from 'vue';\nimport { Container } from 'validup';\nimport { useValidup } from '@validup/vue';\nimport {\n    TranslatorTranslationClientKey,\n    TranslatorTranslationNamespace,\n} from '@authup/i18n';\nimport { ITranslateT } from '@ilingo/vue';\nimport { assignFormProperties, useTranslationsForNamespace } from '../../../../core';\nimport type { Policy } from '@authup/core-kit';\nimport { VCFormGroup, VCFormSwitch } from '@vuecs/forms';\nimport type { RealmMatchPolicy } from '@authup/access';\nimport { onChange, useUpdatedAt } from '../../../../composables';\nimport AFormInputList from '../../../utility/form-input-list/AFormInputList.vue';\nimport { IFieldValidation } from '@ilingo/validup-vue';\n\nexport default defineComponent({\n    components: {\n        AFormInputList,\n        VCFormGroup,\n        VCFormSwitch,\n\n        IFieldValidation,\n        ITranslateT,\n    },\n    props: { entity: { type: Object as PropType<Partial<Policy>> } },\n    emits: ['updated'],\n    setup(props, setup) {\n        const form = reactive({\n            attributeNameStrict: false,\n            attributeNullMatchAll: false,\n            attributeName: [] as string[],\n        });\n\n        const v = useValidup(new Container<typeof form>(), form, { name: 'type' });\n\n        function assign(input: Partial<RealmMatchPolicy> = {}) {\n            const { attributeName, ...data } = input;\n            let names : string[] = [];\n            if (attributeName) {\n                names = typeof attributeName === 'string' ? [attributeName] : attributeName;\n            }\n\n            assignFormProperties(form, {\n                ...data,\n                attributeName: names,\n            } as Record<string, unknown>, { fields: v.fields });\n        }\n\n        setup.expose({ assign });\n\n        const updatedAt = useUpdatedAt(() => props.entity as Policy);\n        onChange(updatedAt, () => assign(props.entity));\n\n        assign(props.entity);\n\n        const handleUpdated = () => {\n            setup.emit('updated', {\n                data: form,\n                valid: !v.$invalid.value,\n            });\n        };\n\n        const handleAttributeNameChanged = (data: string[]) => {\n            v.fields.attributeName.$model.value = data;\n            handleUpdated();\n        };\n\n        const translations = useTranslationsForNamespace(\n            TranslatorTranslationNamespace.CLIENT,\n            [\n                { key: TranslatorTranslationClientKey.REALM_MATCH_STRICT_HINT },\n            ],\n        );\n\n        return {\n            handleUpdated,\n            handleAttributeNameChanged,\n            translations,\n            v,\n        };\n    },\n});\n</script>\n<template>\n    <div class=\"flex flex-wrap -mx-2\">\n        <div class=\"w-7/12 px-2\">\n            <IFieldValidation\n                v-slot=\"{ value }\"\n                :field=\"v.fields.attributeName\"\n            >\n                <VCFormGroup :validation=\"value\">\n                    <AFormInputList\n                        :names=\"v.fields.attributeName.$model.value\"\n                        @changed=\"handleAttributeNameChanged\"\n                    />\n                </VCFormGroup>\n            </IFieldValidation>\n        </div>\n        <div class=\"w-5/12 px-2\">\n            <IFieldValidation\n                v-slot=\"{ value }\"\n                :field=\"v.fields.attributeNameStrict\"\n            >\n                <VCFormGroup :validation=\"value\">\n                    <VCFormSwitch\n                        v-model=\"v.fields.attributeNameStrict.$model.value\"\n                        :label=\"true\"\n                        @change=\"handleUpdated\"\n                    >\n                        <template #label=\"iProps\">\n                            <label :for=\"iProps.id\">\n                                {{ translations.realmMatchStrictHint }}\n                            </label>\n                        </template>\n                    </VCFormSwitch>\n                </VCFormGroup>\n            </IFieldValidation>\n            <IFieldValidation\n                v-slot=\"{ value }\"\n                :field=\"v.fields.attributeNullMatchAll\"\n            >\n                <VCFormGroup :validation=\"value\">\n                    <VCFormSwitch\n                        v-model=\"v.fields.attributeNullMatchAll.$model.value\"\n                        :label=\"true\"\n                        @change=\"handleUpdated\"\n                    >\n                        <template #label=\"iProps\">\n                            <label :for=\"iProps.id\">\n                                <ITranslateT path=\"authupClient.realmMatchNullMatchAllHint\">\n                                    <template #br>\n                                        <br>\n                                    </template>\n                                </ITranslateT>\n                            </label>\n                        </template>\n                    </VCFormSwitch>\n                </VCFormGroup>\n            </IFieldValidation>\n        </div>\n    </div>\n</template>\n","<script lang=\"ts\">\nimport { type PropType, defineComponent, reactive } from 'vue';\nimport { Container } from 'validup';\nimport { useValidup } from '@validup/vue';\nimport {\n    TranslatorTranslationClientKey,\n    TranslatorTranslationNamespace,\n} from '@authup/i18n';\nimport { ITranslateT } from '@ilingo/vue';\nimport { assignFormProperties, useTranslationsForNamespace } from '../../../../core';\nimport type { Policy } from '@authup/core-kit';\nimport { VCFormGroup, VCFormSwitch } from '@vuecs/forms';\nimport type { RealmMatchPolicy } from '@authup/access';\nimport { onChange, useUpdatedAt } from '../../../../composables';\nimport AFormInputList from '../../../utility/form-input-list/AFormInputList.vue';\nimport { IFieldValidation } from '@ilingo/validup-vue';\n\nexport default defineComponent({\n    components: {\n        AFormInputList,\n        VCFormGroup,\n        VCFormSwitch,\n\n        IFieldValidation,\n        ITranslateT,\n    },\n    props: { entity: { type: Object as PropType<Partial<Policy>> } },\n    emits: ['updated'],\n    setup(props, setup) {\n        const form = reactive({\n            attributeNameStrict: false,\n            attributeNullMatchAll: false,\n            attributeName: [] as string[],\n        });\n\n        const v = useValidup(new Container<typeof form>(), form, { name: 'type' });\n\n        function assign(input: Partial<RealmMatchPolicy> = {}) {\n            const { attributeName, ...data } = input;\n            let names : string[] = [];\n            if (attributeName) {\n                names = typeof attributeName === 'string' ? [attributeName] : attributeName;\n            }\n\n            assignFormProperties(form, {\n                ...data,\n                attributeName: names,\n            } as Record<string, unknown>, { fields: v.fields });\n        }\n\n        setup.expose({ assign });\n\n        const updatedAt = useUpdatedAt(() => props.entity as Policy);\n        onChange(updatedAt, () => assign(props.entity));\n\n        assign(props.entity);\n\n        const handleUpdated = () => {\n            setup.emit('updated', {\n                data: form,\n                valid: !v.$invalid.value,\n            });\n        };\n\n        const handleAttributeNameChanged = (data: string[]) => {\n            v.fields.attributeName.$model.value = data;\n            handleUpdated();\n        };\n\n        const translations = useTranslationsForNamespace(\n            TranslatorTranslationNamespace.CLIENT,\n            [\n                { key: TranslatorTranslationClientKey.REALM_MATCH_STRICT_HINT },\n            ],\n        );\n\n        return {\n            handleUpdated,\n            handleAttributeNameChanged,\n            translations,\n            v,\n        };\n    },\n});\n</script>\n<template>\n    <div class=\"flex flex-wrap -mx-2\">\n        <div class=\"w-7/12 px-2\">\n            <IFieldValidation\n                v-slot=\"{ value }\"\n                :field=\"v.fields.attributeName\"\n            >\n                <VCFormGroup :validation=\"value\">\n                    <AFormInputList\n                        :names=\"v.fields.attributeName.$model.value\"\n                        @changed=\"handleAttributeNameChanged\"\n                    />\n                </VCFormGroup>\n            </IFieldValidation>\n        </div>\n        <div class=\"w-5/12 px-2\">\n            <IFieldValidation\n                v-slot=\"{ value }\"\n                :field=\"v.fields.attributeNameStrict\"\n            >\n                <VCFormGroup :validation=\"value\">\n                    <VCFormSwitch\n                        v-model=\"v.fields.attributeNameStrict.$model.value\"\n                        :label=\"true\"\n                        @change=\"handleUpdated\"\n                    >\n                        <template #label=\"iProps\">\n                            <label :for=\"iProps.id\">\n                                {{ translations.realmMatchStrictHint }}\n                            </label>\n                        </template>\n                    </VCFormSwitch>\n                </VCFormGroup>\n            </IFieldValidation>\n            <IFieldValidation\n                v-slot=\"{ value }\"\n                :field=\"v.fields.attributeNullMatchAll\"\n            >\n                <VCFormGroup :validation=\"value\">\n                    <VCFormSwitch\n                        v-model=\"v.fields.attributeNullMatchAll.$model.value\"\n                        :label=\"true\"\n                        @change=\"handleUpdated\"\n                    >\n                        <template #label=\"iProps\">\n                            <label :for=\"iProps.id\">\n                                <ITranslateT path=\"authupClient.realmMatchNullMatchAllHint\">\n                                    <template #br>\n                                        <br>\n                                    </template>\n                                </ITranslateT>\n                            </label>\n                        </template>\n                    </VCFormSwitch>\n                </VCFormGroup>\n            </IFieldValidation>\n        </div>\n    </div>\n</template>\n","<script lang=\"ts\">\nimport {\n    type PropType,\n    computed,\n    defineComponent,\n    reactive,\n} from 'vue';\nimport { Container } from 'validup';\nimport { useValidup } from '@validup/vue';\nimport { TranslatorTranslationFieldKey, TranslatorTranslationNamespace } from '@authup/i18n';\nimport { assignFormProperties, useTranslations } from '../../../../core';\nimport type { Policy } from '@authup/core-kit';\nimport type { FormOption } from '@vuecs/forms';\nimport { VCFormGroup, VCFormInput, VCFormSelect } from '@vuecs/forms';\nimport {\n    TimePolicyInterval,\n    isIntervalForDayOfMonth,\n    isIntervalForDayOfWeek,\n    isIntervalForDayOfYear,\n} from '@authup/access';\nimport type { TimePolicy } from '@authup/access';\nimport { onChange, useUpdatedAt } from '../../../../composables';\nimport { IFieldValidation } from '@ilingo/validup-vue';\n\nexport default defineComponent({\n    components: {\n        VCFormInput,\n        VCFormGroup,\n        VCFormSelect,\n\n        IFieldValidation,\n    },\n    props: { entity: { type: Object as PropType<Partial<Policy>> } },\n    emits: ['updated'],\n    setup(props, setup) {\n        const form = reactive({\n            start: '',\n            end: '',\n            interval: '',\n            dayOfWeek: '',\n            dayOfMonth: '',\n            dayOfYear: '',\n        });\n\n        const intervalOptions: FormOption[] = Object.values(TimePolicyInterval)\n            .map((el) => ({\n                label: el,\n                value: el,\n            } satisfies FormOption));\n\n        const v = useValidup(new Container<typeof form>(), form, { name: 'type' });\n\n        const translationsDefault = useTranslations([\n            {\n                namespace: TranslatorTranslationNamespace.FIELD, \n                key: TranslatorTranslationFieldKey.START, \n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD, \n                key: TranslatorTranslationFieldKey.END, \n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD, \n                key: TranslatorTranslationFieldKey.INTERVAL, \n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD, \n                key: TranslatorTranslationFieldKey.DAY_OF_WEEK, \n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD, \n                key: TranslatorTranslationFieldKey.DAY_OF_MONTH, \n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD, \n                key: TranslatorTranslationFieldKey.DAY_OF_YEAR, \n            },\n        ]);\n\n        function assign(data: Partial<TimePolicy> = {}) {\n            assignFormProperties(form, data as Record<string, unknown>, { fields: v.fields });\n        }\n\n        setup.expose({ assign });\n\n        const updatedAt = useUpdatedAt(() => props.entity as Policy);\n        onChange(updatedAt, () => assign(props.entity));\n\n        assign(props.entity);\n\n        const displayIntervalForDayOfWeek = computed(\n            () => isIntervalForDayOfWeek(v.fields.interval.$model.value),\n        );\n\n        const displayIntervalForDayOfMonth = computed(\n            () => isIntervalForDayOfMonth(v.fields.interval.$model.value),\n        );\n\n        const displayIntervalForDayOfYear = computed(\n            () => isIntervalForDayOfYear(v.fields.interval.$model.value),\n        );\n\n        const handleUpdated = () => {\n            setup.emit('updated', {\n                data: form,\n                valid: !v.$invalid.value,\n            });\n        };\n\n        const handleIntervalUpdated = (value: string) => {\n            if (!isIntervalForDayOfWeek(value)) {\n                v.fields.dayOfWeek.$model.value = '';\n            }\n            if (!isIntervalForDayOfMonth(value)) {\n                v.fields.dayOfMonth.$model.value = '';\n            }\n            if (!isIntervalForDayOfYear(value)) {\n                v.fields.dayOfYear.$model.value = '';\n            }\n            handleUpdated();\n        };\n\n        return {\n            handleUpdated,\n            handleIntervalUpdated,\n            displayIntervalForDayOfWeek,\n            displayIntervalForDayOfMonth,\n            displayIntervalForDayOfYear,\n            intervalOptions,\n            v,\n            translationsDefault,\n        };\n    },\n});\n</script>\n<template>\n    <div>\n        <div class=\"flex flex-wrap -mx-2\">\n            <div class=\"flex-1 basis-0 px-2\">\n                <IFieldValidation\n                    v-slot=\"{ value }\"\n                    :field=\"v.fields.start\"\n                >\n                    <VCFormGroup :validation=\"value\">\n                        <template #label>\n                            {{ translationsDefault.start }}\n                        </template>\n                        <VCFormInput\n                            v-model=\"v.fields.start.$model.value\"\n                            placeholder=\"HH:MM\"\n                            @change=\"handleUpdated\"\n                        />\n                    </VCFormGroup>\n                </IFieldValidation>\n            </div>\n            <div class=\"flex-1 basis-0 px-2\">\n                <IFieldValidation\n                    v-slot=\"{ value }\"\n                    :field=\"v.fields.end\"\n                >\n                    <VCFormGroup :validation=\"value\">\n                        <template #label>\n                            {{ translationsDefault.end }}\n                        </template>\n                        <VCFormInput\n                            v-model=\"v.fields.end.$model.value\"\n                            placeholder=\"HH:MM\"\n                            @change=\"handleUpdated\"\n                        />\n                    </VCFormGroup>\n                </IFieldValidation>\n            </div>\n        </div>\n        <div class=\"flex flex-wrap -mx-2\">\n            <div class=\"flex-1 basis-0 px-2\">\n                <IFieldValidation\n                    v-slot=\"{ value }\"\n                    :field=\"v.fields.interval\"\n                >\n                    <VCFormGroup :validation=\"value\">\n                        <template #label>\n                            {{ translationsDefault.interval }}\n                        </template>\n                        <VCFormSelect\n                            v-model=\"v.fields.interval.$model.value\"\n                            :options=\"intervalOptions\"\n                            placeholder=\"-- None --\"\n                            @update:model-value=\"handleIntervalUpdated\"\n                        />\n                    </VCFormGroup>\n                </IFieldValidation>\n            </div>\n            <div\n                v-if=\"displayIntervalForDayOfWeek\"\n                class=\"flex-1 basis-0 px-2\"\n            >\n                <IFieldValidation\n                    v-slot=\"{ value }\"\n                    :field=\"v.fields.dayOfWeek\"\n                >\n                    <VCFormGroup :validation=\"value\">\n                        <template #label>\n                            {{ translationsDefault.dayOfWeek }}\n                        </template>\n                        <VCFormInput\n                            v-model=\"v.fields.dayOfWeek.$model.value\"\n                            placeholder=\"0-6\"\n                            type=\"number\"\n                            @change=\"handleUpdated\"\n                        />\n                    </VCFormGroup>\n                </IFieldValidation>\n            </div>\n            <div\n                v-if=\"displayIntervalForDayOfMonth\"\n                class=\"flex-1 basis-0 px-2\"\n            >\n                <IFieldValidation\n                    v-slot=\"{ value }\"\n                    :field=\"v.fields.dayOfMonth\"\n                >\n                    <VCFormGroup :validation=\"value\">\n                        <template #label>\n                            {{ translationsDefault.dayOfMonth }}\n                        </template>\n                        <VCFormInput\n                            v-model=\"v.fields.dayOfMonth.$model.value\"\n                            placeholder=\"1-31\"\n                            type=\"number\"\n                            @change=\"handleUpdated\"\n                        />\n                    </VCFormGroup>\n                </IFieldValidation>\n            </div>\n            <div\n                v-if=\"displayIntervalForDayOfYear\"\n                class=\"flex-1 basis-0 px-2\"\n            >\n                <IFieldValidation\n                    v-slot=\"{ value }\"\n                    :field=\"v.fields.dayOfYear\"\n                >\n                    <VCFormGroup :validation=\"value\">\n                        <template #label>\n                            {{ translationsDefault.dayOfYear }}\n                        </template>\n                        <VCFormInput\n                            v-model=\"v.fields.dayOfYear.$model.value\"\n                            type=\"number\"\n                            placeholder=\"1-365\"\n                            @change=\"handleUpdated\"\n                        />\n                    </VCFormGroup>\n                </IFieldValidation>\n            </div>\n        </div>\n    </div>\n</template>\n","<script lang=\"ts\">\nimport {\n    type PropType,\n    computed,\n    defineComponent,\n    reactive,\n} from 'vue';\nimport { Container } from 'validup';\nimport { useValidup } from '@validup/vue';\nimport { TranslatorTranslationFieldKey, TranslatorTranslationNamespace } from '@authup/i18n';\nimport { assignFormProperties, useTranslations } from '../../../../core';\nimport type { Policy } from '@authup/core-kit';\nimport type { FormOption } from '@vuecs/forms';\nimport { VCFormGroup, VCFormInput, VCFormSelect } from '@vuecs/forms';\nimport {\n    TimePolicyInterval,\n    isIntervalForDayOfMonth,\n    isIntervalForDayOfWeek,\n    isIntervalForDayOfYear,\n} from '@authup/access';\nimport type { TimePolicy } from '@authup/access';\nimport { onChange, useUpdatedAt } from '../../../../composables';\nimport { IFieldValidation } from '@ilingo/validup-vue';\n\nexport default defineComponent({\n    components: {\n        VCFormInput,\n        VCFormGroup,\n        VCFormSelect,\n\n        IFieldValidation,\n    },\n    props: { entity: { type: Object as PropType<Partial<Policy>> } },\n    emits: ['updated'],\n    setup(props, setup) {\n        const form = reactive({\n            start: '',\n            end: '',\n            interval: '',\n            dayOfWeek: '',\n            dayOfMonth: '',\n            dayOfYear: '',\n        });\n\n        const intervalOptions: FormOption[] = Object.values(TimePolicyInterval)\n            .map((el) => ({\n                label: el,\n                value: el,\n            } satisfies FormOption));\n\n        const v = useValidup(new Container<typeof form>(), form, { name: 'type' });\n\n        const translationsDefault = useTranslations([\n            {\n                namespace: TranslatorTranslationNamespace.FIELD, \n                key: TranslatorTranslationFieldKey.START, \n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD, \n                key: TranslatorTranslationFieldKey.END, \n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD, \n                key: TranslatorTranslationFieldKey.INTERVAL, \n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD, \n                key: TranslatorTranslationFieldKey.DAY_OF_WEEK, \n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD, \n                key: TranslatorTranslationFieldKey.DAY_OF_MONTH, \n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD, \n                key: TranslatorTranslationFieldKey.DAY_OF_YEAR, \n            },\n        ]);\n\n        function assign(data: Partial<TimePolicy> = {}) {\n            assignFormProperties(form, data as Record<string, unknown>, { fields: v.fields });\n        }\n\n        setup.expose({ assign });\n\n        const updatedAt = useUpdatedAt(() => props.entity as Policy);\n        onChange(updatedAt, () => assign(props.entity));\n\n        assign(props.entity);\n\n        const displayIntervalForDayOfWeek = computed(\n            () => isIntervalForDayOfWeek(v.fields.interval.$model.value),\n        );\n\n        const displayIntervalForDayOfMonth = computed(\n            () => isIntervalForDayOfMonth(v.fields.interval.$model.value),\n        );\n\n        const displayIntervalForDayOfYear = computed(\n            () => isIntervalForDayOfYear(v.fields.interval.$model.value),\n        );\n\n        const handleUpdated = () => {\n            setup.emit('updated', {\n                data: form,\n                valid: !v.$invalid.value,\n            });\n        };\n\n        const handleIntervalUpdated = (value: string) => {\n            if (!isIntervalForDayOfWeek(value)) {\n                v.fields.dayOfWeek.$model.value = '';\n            }\n            if (!isIntervalForDayOfMonth(value)) {\n                v.fields.dayOfMonth.$model.value = '';\n            }\n            if (!isIntervalForDayOfYear(value)) {\n                v.fields.dayOfYear.$model.value = '';\n            }\n            handleUpdated();\n        };\n\n        return {\n            handleUpdated,\n            handleIntervalUpdated,\n            displayIntervalForDayOfWeek,\n            displayIntervalForDayOfMonth,\n            displayIntervalForDayOfYear,\n            intervalOptions,\n            v,\n            translationsDefault,\n        };\n    },\n});\n</script>\n<template>\n    <div>\n        <div class=\"flex flex-wrap -mx-2\">\n            <div class=\"flex-1 basis-0 px-2\">\n                <IFieldValidation\n                    v-slot=\"{ value }\"\n                    :field=\"v.fields.start\"\n                >\n                    <VCFormGroup :validation=\"value\">\n                        <template #label>\n                            {{ translationsDefault.start }}\n                        </template>\n                        <VCFormInput\n                            v-model=\"v.fields.start.$model.value\"\n                            placeholder=\"HH:MM\"\n                            @change=\"handleUpdated\"\n                        />\n                    </VCFormGroup>\n                </IFieldValidation>\n            </div>\n            <div class=\"flex-1 basis-0 px-2\">\n                <IFieldValidation\n                    v-slot=\"{ value }\"\n                    :field=\"v.fields.end\"\n                >\n                    <VCFormGroup :validation=\"value\">\n                        <template #label>\n                            {{ translationsDefault.end }}\n                        </template>\n                        <VCFormInput\n                            v-model=\"v.fields.end.$model.value\"\n                            placeholder=\"HH:MM\"\n                            @change=\"handleUpdated\"\n                        />\n                    </VCFormGroup>\n                </IFieldValidation>\n            </div>\n        </div>\n        <div class=\"flex flex-wrap -mx-2\">\n            <div class=\"flex-1 basis-0 px-2\">\n                <IFieldValidation\n                    v-slot=\"{ value }\"\n                    :field=\"v.fields.interval\"\n                >\n                    <VCFormGroup :validation=\"value\">\n                        <template #label>\n                            {{ translationsDefault.interval }}\n                        </template>\n                        <VCFormSelect\n                            v-model=\"v.fields.interval.$model.value\"\n                            :options=\"intervalOptions\"\n                            placeholder=\"-- None --\"\n                            @update:model-value=\"handleIntervalUpdated\"\n                        />\n                    </VCFormGroup>\n                </IFieldValidation>\n            </div>\n            <div\n                v-if=\"displayIntervalForDayOfWeek\"\n                class=\"flex-1 basis-0 px-2\"\n            >\n                <IFieldValidation\n                    v-slot=\"{ value }\"\n                    :field=\"v.fields.dayOfWeek\"\n                >\n                    <VCFormGroup :validation=\"value\">\n                        <template #label>\n                            {{ translationsDefault.dayOfWeek }}\n                        </template>\n                        <VCFormInput\n                            v-model=\"v.fields.dayOfWeek.$model.value\"\n                            placeholder=\"0-6\"\n                            type=\"number\"\n                            @change=\"handleUpdated\"\n                        />\n                    </VCFormGroup>\n                </IFieldValidation>\n            </div>\n            <div\n                v-if=\"displayIntervalForDayOfMonth\"\n                class=\"flex-1 basis-0 px-2\"\n            >\n                <IFieldValidation\n                    v-slot=\"{ value }\"\n                    :field=\"v.fields.dayOfMonth\"\n                >\n                    <VCFormGroup :validation=\"value\">\n                        <template #label>\n                            {{ translationsDefault.dayOfMonth }}\n                        </template>\n                        <VCFormInput\n                            v-model=\"v.fields.dayOfMonth.$model.value\"\n                            placeholder=\"1-31\"\n                            type=\"number\"\n                            @change=\"handleUpdated\"\n                        />\n                    </VCFormGroup>\n                </IFieldValidation>\n            </div>\n            <div\n                v-if=\"displayIntervalForDayOfYear\"\n                class=\"flex-1 basis-0 px-2\"\n            >\n                <IFieldValidation\n                    v-slot=\"{ value }\"\n                    :field=\"v.fields.dayOfYear\"\n                >\n                    <VCFormGroup :validation=\"value\">\n                        <template #label>\n                            {{ translationsDefault.dayOfYear }}\n                        </template>\n                        <VCFormInput\n                            v-model=\"v.fields.dayOfYear.$model.value\"\n                            type=\"number\"\n                            placeholder=\"1-365\"\n                            @change=\"handleUpdated\"\n                        />\n                    </VCFormGroup>\n                </IFieldValidation>\n            </div>\n        </div>\n    </div>\n</template>\n","/*\n * Copyright (c) 2023.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { EntityType } from '@authup/core-kit';\nimport type { Policy } from '@authup/core-kit';\nimport type { SlotsType } from 'vue';\nimport { defineComponent } from 'vue';\nimport type { EntityVSlots } from '../../utility';\nimport {\n    defineEntityManager,\n    defineEntityVEmitOptions,\n    defineEntityVProps,\n} from '../../utility';\n\nexport const APolicy = defineComponent({\n    props: defineEntityVProps<Policy>(),\n    emits: defineEntityVEmitOptions<Policy>(),\n    slots: Object as SlotsType<EntityVSlots<Policy>>,\n    async setup(props, setup) {\n        const manager = defineEntityManager({\n            type: `${EntityType.POLICY}`,\n            setup,\n            props,\n        });\n\n        try {\n            await manager.resolveOrFail();\n\n            return () => manager.render();\n        } catch (e) {\n            return () => manager.renderError(e);\n        }\n    },\n});\n","<script lang=\"ts\">\nimport type { PropType } from 'vue';\nimport { computed, defineComponent, ref } from 'vue';\nimport type { FormOption } from '@vuecs/forms';\nimport { BuiltInPolicyType } from '@authup/access';\nimport {\n    TranslatorTranslationClientKey,\n    TranslatorTranslationFieldKey,\n    TranslatorTranslationNamespace,\n} from '@authup/i18n';\nimport { useTranslationsForNamespace } from '../../../core';\nimport { POLICY_TYPE_TRANSLATION_KEYS } from './policy-type';\n\nexport default defineComponent({\n    props: {\n        type: { type: String },\n        types: { type: Array as PropType<(FormOption | string)[]> },\n    },\n    emits: ['pick'],\n    setup(props, setup) {\n        const translationsClient = useTranslationsForNamespace(\n            TranslatorTranslationNamespace.CLIENT,\n            [\n                { key: TranslatorTranslationClientKey.POLICY_TYPE_COMPOSITE },\n                { key: TranslatorTranslationClientKey.POLICY_TYPE_DATE },\n                { key: TranslatorTranslationClientKey.POLICY_TYPE_TIME },\n                { key: TranslatorTranslationClientKey.POLICY_TYPE_ATTRIBUTE_NAMES },\n                { key: TranslatorTranslationClientKey.POLICY_TYPE_ATTRIBUTES },\n                { key: TranslatorTranslationClientKey.POLICY_TYPE_REALM_MATCH },\n                { key: TranslatorTranslationClientKey.POLICY_TYPE_IDENTITY },\n                { key: TranslatorTranslationClientKey.POLICY_TYPE_PERMISSION_BINDING },\n            ],\n        );\n\n        const buildLabel = (type: string) => {\n            const key = POLICY_TYPE_TRANSLATION_KEYS[type as keyof typeof POLICY_TYPE_TRANSLATION_KEYS];\n            if (key) {\n                return translationsClient[key];\n            }\n\n            return type;\n        };\n\n        const option = ref<string | null>(null);\n        const options = computed<FormOption[]>(() => {\n            if (props.types) {\n                return props.types.map((type) => {\n                    if (typeof type === 'string') {\n                        return {\n                            label: buildLabel(type),\n                            value: type,\n                        } satisfies FormOption;\n                    }\n\n                    return type;\n                });\n            }\n\n            return Object.values(BuiltInPolicyType)\n                .map((type: string) => ({\n                    label: buildLabel(type),\n                    value: type,\n                } satisfies FormOption));\n        });\n\n        if (props.type) {\n            option.value = props.type;\n        }\n\n        const pick = (val: string) => {\n            option.value = val;\n            setup.emit('pick', val);\n        };\n\n        const translations = useTranslationsForNamespace(\n            TranslatorTranslationNamespace.FIELD,\n            [\n                { key: TranslatorTranslationFieldKey.TYPE },\n            ],\n        );\n\n        return {\n            option,\n            options,\n            pick,\n            translations,\n        };\n    },\n});\n</script>\n<template>\n    <div class=\"flex flex-col gap-2\">\n        <div>\n            <h6>{{ translations.type }}</h6>\n\n            <div class=\"flex flex-row gap-2 flex-wrap\">\n                <template\n                    v-for=\"(item, key) in options\"\n                    :key=\"key\"\n                >\n                    <div\n                        :class=\"{'active': item.value === option}\"\n                        class=\"flex flex-col gap-1 text-center a-picker-item\"\n                        @click.prevent=\"pick(`${item.value}`)\"\n                    >\n                        <div>\n                            {{ item.label }}\n                        </div>\n                    </div>\n                </template>\n            </div>\n        </div>\n    </div>\n</template>\n","<script lang=\"ts\">\nimport type { PropType } from 'vue';\nimport { computed, defineComponent, ref } from 'vue';\nimport type { FormOption } from '@vuecs/forms';\nimport { BuiltInPolicyType } from '@authup/access';\nimport {\n    TranslatorTranslationClientKey,\n    TranslatorTranslationFieldKey,\n    TranslatorTranslationNamespace,\n} from '@authup/i18n';\nimport { useTranslationsForNamespace } from '../../../core';\nimport { POLICY_TYPE_TRANSLATION_KEYS } from './policy-type';\n\nexport default defineComponent({\n    props: {\n        type: { type: String },\n        types: { type: Array as PropType<(FormOption | string)[]> },\n    },\n    emits: ['pick'],\n    setup(props, setup) {\n        const translationsClient = useTranslationsForNamespace(\n            TranslatorTranslationNamespace.CLIENT,\n            [\n                { key: TranslatorTranslationClientKey.POLICY_TYPE_COMPOSITE },\n                { key: TranslatorTranslationClientKey.POLICY_TYPE_DATE },\n                { key: TranslatorTranslationClientKey.POLICY_TYPE_TIME },\n                { key: TranslatorTranslationClientKey.POLICY_TYPE_ATTRIBUTE_NAMES },\n                { key: TranslatorTranslationClientKey.POLICY_TYPE_ATTRIBUTES },\n                { key: TranslatorTranslationClientKey.POLICY_TYPE_REALM_MATCH },\n                { key: TranslatorTranslationClientKey.POLICY_TYPE_IDENTITY },\n                { key: TranslatorTranslationClientKey.POLICY_TYPE_PERMISSION_BINDING },\n            ],\n        );\n\n        const buildLabel = (type: string) => {\n            const key = POLICY_TYPE_TRANSLATION_KEYS[type as keyof typeof POLICY_TYPE_TRANSLATION_KEYS];\n            if (key) {\n                return translationsClient[key];\n            }\n\n            return type;\n        };\n\n        const option = ref<string | null>(null);\n        const options = computed<FormOption[]>(() => {\n            if (props.types) {\n                return props.types.map((type) => {\n                    if (typeof type === 'string') {\n                        return {\n                            label: buildLabel(type),\n                            value: type,\n                        } satisfies FormOption;\n                    }\n\n                    return type;\n                });\n            }\n\n            return Object.values(BuiltInPolicyType)\n                .map((type: string) => ({\n                    label: buildLabel(type),\n                    value: type,\n                } satisfies FormOption));\n        });\n\n        if (props.type) {\n            option.value = props.type;\n        }\n\n        const pick = (val: string) => {\n            option.value = val;\n            setup.emit('pick', val);\n        };\n\n        const translations = useTranslationsForNamespace(\n            TranslatorTranslationNamespace.FIELD,\n            [\n                { key: TranslatorTranslationFieldKey.TYPE },\n            ],\n        );\n\n        return {\n            option,\n            options,\n            pick,\n            translations,\n        };\n    },\n});\n</script>\n<template>\n    <div class=\"flex flex-col gap-2\">\n        <div>\n            <h6>{{ translations.type }}</h6>\n\n            <div class=\"flex flex-row gap-2 flex-wrap\">\n                <template\n                    v-for=\"(item, key) in options\"\n                    :key=\"key\"\n                >\n                    <div\n                        :class=\"{'active': item.value === option}\"\n                        class=\"flex flex-col gap-1 text-center a-picker-item\"\n                        @click.prevent=\"pick(`${item.value}`)\"\n                    >\n                        <div>\n                            {{ item.label }}\n                        </div>\n                    </div>\n                </template>\n            </div>\n        </div>\n    </div>\n</template>\n","<script lang=\"ts\">\nimport {\n    type PropType,\n    computed,\n    defineComponent,\n    reactive,\n    toRef,\n    useId,\n    watch,\n} from 'vue';\nimport { useValidup } from '@validup/vue';\nimport {\n    TranslatorTranslationEntityKey,\n    TranslatorTranslationFieldKey,\n    TranslatorTranslationNamespace,\n} from '@authup/i18n';\nimport {\n    assignFormProperties,\n    injectStore,\n    storeToRefs,\n    useTranslations,\n} from '../../../core';\nimport { ValidatorGroup, generateName } from '@authup/kit';\nimport type { Policy } from '@authup/core-kit';\nimport { PolicyValidator } from '@authup/core-kit';\nimport type { FormOption } from '@vuecs/forms';\nimport {\n    VCFormGroup,\n    VCFormInput,\n    VCFormSwitch,\n    VCFormTextarea,\n} from '@vuecs/forms';\nimport { BuiltInPolicyType } from '@authup/access';\nimport { onChange, useIsEditing, useUpdatedAt } from '../../../composables';\nimport { ARealmPicker } from '../realm';\nimport { IFieldValidation } from '@ilingo/validup-vue';\nimport { ANameInput } from '../../utility';\n\nexport default defineComponent({\n    components: {\n        ANameInput,\n        ARealmPicker,\n        VCFormInput,\n        VCFormSwitch,\n        VCFormGroup,\n        VCFormTextarea,\n\n        IFieldValidation,\n    },\n    props: {\n        entity: { type: Object as PropType<Policy> },\n        type: { type: String as PropType<string | null>, default: undefined },\n    },\n    emits: ['updated'],\n    setup(props, setup) {\n        const entity = toRef(props, 'entity');\n        const nameSeed = useId();\n        const form = reactive({\n            name: '',\n            invert: false,\n            displayName: '',\n            description: '',\n            realmId: '',\n            type: '',\n        });\n\n        const store = injectStore();\n        const storeRefs = storeToRefs(store);\n\n        const isEditing = useIsEditing(entity);\n        const realmId = computed(() => {\n            if (!storeRefs.realmIsRoot.value) {\n                return storeRefs.realmId.value;\n            }\n\n            return entity.value ?\n                entity.value.realmId :\n                null;\n        });\n\n        const typeOptions: FormOption[] = [\n            ...Object.values(BuiltInPolicyType).map((type) => ({\n                label: type,\n                value: type,\n            })),\n        ];\n\n        // Shared backend validator from @authup/core-kit. Registers\n        // under the parent `<APolicyForm>` collector via `name: 'basic'`\n        // so the parent extracts via `extractValidupResultsFromChild('basic')`.\n        const v = useValidup(\n            new PolicyValidator(),\n            form,\n            {\n                name: 'basic',\n                group: computed(() => (isEditing.value ? ValidatorGroup.UPDATE : ValidatorGroup.CREATE)),\n            },\n        );\n\n        function assign(data: Partial<Policy> = {}) {\n            assignFormProperties(form, data, { fields: v.fields });\n        }\n\n        setup.expose({ assign });\n\n        const updatedAt = useUpdatedAt(() => props.entity as Policy);\n        onChange(updatedAt, () => assign(props.entity));\n\n        assign(props.entity);\n\n        if (form.name.length === 0) {\n            form.name = generateName(nameSeed);\n        }\n\n        // `type` is the policy discriminator owned by the parent\n        // <APolicyForm>, not edited here. It's mounted (required on\n        // CREATE) in the shared PolicyValidator, so feed the parent's\n        // resolved value into the validated state — otherwise the basic\n        // sub-form is permanently invalid and the submit button never\n        // enables.\n        watch(\n            () => props.type,\n            (value) => {\n                form.type = value ?? '';\n            },\n            { immediate: true },\n        );\n\n        const handleUpdated = () => {\n            setup.emit('updated', {\n                data: form,\n                valid: !v.$invalid.value,\n            });\n        };\n\n        const translationsDefault = useTranslations([\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.NAME,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.DISPLAY_NAME,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.DESCRIPTION,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.INVERT,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.ENTITY,\n                key: TranslatorTranslationEntityKey.REALM,\n                count: 1,\n            },\n        ]);\n\n        return {\n            isEditing,\n            realmId,\n            handleUpdated,\n            translationsDefault,\n            typeOptions,\n            v,\n        };\n    },\n});\n</script>\n<template>\n    <div class=\"flex flex-wrap -mx-2\">\n        <div class=\"flex-1 basis-0 px-2\">\n            <IFieldValidation\n                v-slot=\"{ value }\"\n                :field=\"v.fields.name\"\n            >\n                <VCFormGroup :validation=\"value\">\n                    <template #label>\n                        {{ translationsDefault.name }}\n                    </template>\n                    <ANameInput\n                        :model-value=\"v.fields.name.$model.value\"\n                        @update:model-value=\"(next: string) => { v.fields.name.$model.value = next; handleUpdated(); }\"\n                    />\n                </VCFormGroup>\n            </IFieldValidation>\n            <IFieldValidation\n                v-slot=\"{ value }\"\n                :field=\"v.fields.displayName\"\n            >\n                <VCFormGroup :validation=\"value\">\n                    <template #label>\n                        {{ translationsDefault.displayName }}\n                    </template>\n                    <VCFormInput\n                        :model-value=\"v.fields.displayName.$model.value ?? ''\"\n                        @update:model-value=\"(next: string) => { v.fields.displayName.$model.value = next; }\"\n                        @change=\"handleUpdated\"\n                    />\n                </VCFormGroup>\n            </IFieldValidation>\n            <IFieldValidation\n                v-slot=\"{ value }\"\n                :field=\"v.fields.description\"\n            >\n                <VCFormGroup :validation=\"value\">\n                    <template #label>\n                        {{ translationsDefault.description }}\n                    </template>\n                    <VCFormTextarea\n                        :model-value=\"v.fields.description.$model.value ?? ''\"\n                        rows=\"4\"\n                        @update:model-value=\"(next: string) => { v.fields.description.$model.value = next; }\"\n                        @change=\"handleUpdated\"\n                    />\n                </VCFormGroup>\n            </IFieldValidation>\n            <IFieldValidation\n                v-slot=\"{ value }\"\n                :field=\"v.fields.invert\"\n            >\n                <VCFormGroup :validation=\"value\">\n                    <VCFormSwitch\n                        v-model=\"v.fields.invert.$model.value\"\n                        :label=\"true\"\n                        @change=\"handleUpdated\"\n                    >\n                        <template #label=\"iProps\">\n                            <label :for=\"iProps.id\">\n                                {{ translationsDefault.invert }}\n                            </label>\n                        </template>\n                    </VCFormSwitch>\n                </VCFormGroup>\n            </IFieldValidation>\n        </div>\n        <div\n            v-if=\"!realmId && !isEditing\"\n            class=\"flex-1 basis-0 px-2\"\n        >\n            <IFieldValidation\n                v-slot=\"{ value }\"\n                :field=\"v.fields.realmId\"\n            >\n                <VCFormGroup :validation=\"value\">\n                    <template #label>\n                        {{ translationsDefault.realm }}\n                    </template>\n                    <ARealmPicker\n                        :value=\"v.fields.realmId.$model.value\"\n                        @change=\"(value: string[]) => { v.fields.realmId.$model.value = value.length > 0 ? value[0] ?? '' : ''; }\"\n                    />\n                </VCFormGroup>\n            </IFieldValidation>\n        </div>\n    </div>\n</template>\n","<script lang=\"ts\">\nimport {\n    type PropType,\n    computed,\n    defineComponent,\n    reactive,\n    toRef,\n    useId,\n    watch,\n} from 'vue';\nimport { useValidup } from '@validup/vue';\nimport {\n    TranslatorTranslationEntityKey,\n    TranslatorTranslationFieldKey,\n    TranslatorTranslationNamespace,\n} from '@authup/i18n';\nimport {\n    assignFormProperties,\n    injectStore,\n    storeToRefs,\n    useTranslations,\n} from '../../../core';\nimport { ValidatorGroup, generateName } from '@authup/kit';\nimport type { Policy } from '@authup/core-kit';\nimport { PolicyValidator } from '@authup/core-kit';\nimport type { FormOption } from '@vuecs/forms';\nimport {\n    VCFormGroup,\n    VCFormInput,\n    VCFormSwitch,\n    VCFormTextarea,\n} from '@vuecs/forms';\nimport { BuiltInPolicyType } from '@authup/access';\nimport { onChange, useIsEditing, useUpdatedAt } from '../../../composables';\nimport { ARealmPicker } from '../realm';\nimport { IFieldValidation } from '@ilingo/validup-vue';\nimport { ANameInput } from '../../utility';\n\nexport default defineComponent({\n    components: {\n        ANameInput,\n        ARealmPicker,\n        VCFormInput,\n        VCFormSwitch,\n        VCFormGroup,\n        VCFormTextarea,\n\n        IFieldValidation,\n    },\n    props: {\n        entity: { type: Object as PropType<Policy> },\n        type: { type: String as PropType<string | null>, default: undefined },\n    },\n    emits: ['updated'],\n    setup(props, setup) {\n        const entity = toRef(props, 'entity');\n        const nameSeed = useId();\n        const form = reactive({\n            name: '',\n            invert: false,\n            displayName: '',\n            description: '',\n            realmId: '',\n            type: '',\n        });\n\n        const store = injectStore();\n        const storeRefs = storeToRefs(store);\n\n        const isEditing = useIsEditing(entity);\n        const realmId = computed(() => {\n            if (!storeRefs.realmIsRoot.value) {\n                return storeRefs.realmId.value;\n            }\n\n            return entity.value ?\n                entity.value.realmId :\n                null;\n        });\n\n        const typeOptions: FormOption[] = [\n            ...Object.values(BuiltInPolicyType).map((type) => ({\n                label: type,\n                value: type,\n            })),\n        ];\n\n        // Shared backend validator from @authup/core-kit. Registers\n        // under the parent `<APolicyForm>` collector via `name: 'basic'`\n        // so the parent extracts via `extractValidupResultsFromChild('basic')`.\n        const v = useValidup(\n            new PolicyValidator(),\n            form,\n            {\n                name: 'basic',\n                group: computed(() => (isEditing.value ? ValidatorGroup.UPDATE : ValidatorGroup.CREATE)),\n            },\n        );\n\n        function assign(data: Partial<Policy> = {}) {\n            assignFormProperties(form, data, { fields: v.fields });\n        }\n\n        setup.expose({ assign });\n\n        const updatedAt = useUpdatedAt(() => props.entity as Policy);\n        onChange(updatedAt, () => assign(props.entity));\n\n        assign(props.entity);\n\n        if (form.name.length === 0) {\n            form.name = generateName(nameSeed);\n        }\n\n        // `type` is the policy discriminator owned by the parent\n        // <APolicyForm>, not edited here. It's mounted (required on\n        // CREATE) in the shared PolicyValidator, so feed the parent's\n        // resolved value into the validated state — otherwise the basic\n        // sub-form is permanently invalid and the submit button never\n        // enables.\n        watch(\n            () => props.type,\n            (value) => {\n                form.type = value ?? '';\n            },\n            { immediate: true },\n        );\n\n        const handleUpdated = () => {\n            setup.emit('updated', {\n                data: form,\n                valid: !v.$invalid.value,\n            });\n        };\n\n        const translationsDefault = useTranslations([\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.NAME,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.DISPLAY_NAME,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.DESCRIPTION,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.INVERT,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.ENTITY,\n                key: TranslatorTranslationEntityKey.REALM,\n                count: 1,\n            },\n        ]);\n\n        return {\n            isEditing,\n            realmId,\n            handleUpdated,\n            translationsDefault,\n            typeOptions,\n            v,\n        };\n    },\n});\n</script>\n<template>\n    <div class=\"flex flex-wrap -mx-2\">\n        <div class=\"flex-1 basis-0 px-2\">\n            <IFieldValidation\n                v-slot=\"{ value }\"\n                :field=\"v.fields.name\"\n            >\n                <VCFormGroup :validation=\"value\">\n                    <template #label>\n                        {{ translationsDefault.name }}\n                    </template>\n                    <ANameInput\n                        :model-value=\"v.fields.name.$model.value\"\n                        @update:model-value=\"(next: string) => { v.fields.name.$model.value = next; handleUpdated(); }\"\n                    />\n                </VCFormGroup>\n            </IFieldValidation>\n            <IFieldValidation\n                v-slot=\"{ value }\"\n                :field=\"v.fields.displayName\"\n            >\n                <VCFormGroup :validation=\"value\">\n                    <template #label>\n                        {{ translationsDefault.displayName }}\n                    </template>\n                    <VCFormInput\n                        :model-value=\"v.fields.displayName.$model.value ?? ''\"\n                        @update:model-value=\"(next: string) => { v.fields.displayName.$model.value = next; }\"\n                        @change=\"handleUpdated\"\n                    />\n                </VCFormGroup>\n            </IFieldValidation>\n            <IFieldValidation\n                v-slot=\"{ value }\"\n                :field=\"v.fields.description\"\n            >\n                <VCFormGroup :validation=\"value\">\n                    <template #label>\n                        {{ translationsDefault.description }}\n                    </template>\n                    <VCFormTextarea\n                        :model-value=\"v.fields.description.$model.value ?? ''\"\n                        rows=\"4\"\n                        @update:model-value=\"(next: string) => { v.fields.description.$model.value = next; }\"\n                        @change=\"handleUpdated\"\n                    />\n                </VCFormGroup>\n            </IFieldValidation>\n            <IFieldValidation\n                v-slot=\"{ value }\"\n                :field=\"v.fields.invert\"\n            >\n                <VCFormGroup :validation=\"value\">\n                    <VCFormSwitch\n                        v-model=\"v.fields.invert.$model.value\"\n                        :label=\"true\"\n                        @change=\"handleUpdated\"\n                    >\n                        <template #label=\"iProps\">\n                            <label :for=\"iProps.id\">\n                                {{ translationsDefault.invert }}\n                            </label>\n                        </template>\n                    </VCFormSwitch>\n                </VCFormGroup>\n            </IFieldValidation>\n        </div>\n        <div\n            v-if=\"!realmId && !isEditing\"\n            class=\"flex-1 basis-0 px-2\"\n        >\n            <IFieldValidation\n                v-slot=\"{ value }\"\n                :field=\"v.fields.realmId\"\n            >\n                <VCFormGroup :validation=\"value\">\n                    <template #label>\n                        {{ translationsDefault.realm }}\n                    </template>\n                    <ARealmPicker\n                        :value=\"v.fields.realmId.$model.value\"\n                        @change=\"(value: string[]) => { v.fields.realmId.$model.value = value.length > 0 ? value[0] ?? '' : ''; }\"\n                    />\n                </VCFormGroup>\n            </IFieldValidation>\n        </div>\n    </div>\n</template>\n","<script lang=\"ts\">\nimport type { PropType } from 'vue';\nimport {\n    computed,\n    defineComponent,\n    reactive,\n} from 'vue';\nimport { Container } from 'validup';\nimport { useValidup } from '@validup/vue';\nimport type { Policy } from '@authup/core-kit';\nimport { EntityType } from '@authup/core-kit';\nimport { BuiltInPolicyType } from '@authup/access';\nimport {\n    TranslatorTranslationCommonKey,\n    TranslatorTranslationNamespace,\n} from '@authup/i18n';\nimport { useIsEditing } from '../../../composables';\nimport { extractValidupResultsFromChild, injectHTTPClient, useTranslationsForNamespace } from '../../../core';\nimport { AFormSubmit, defineEntityManager } from '../../utility';\nimport APolicyBasicForm from './APolicyBasicForm.vue';\nimport APolicyTypePicker from './APolicyTypePicker.vue';\nimport AAttributeNamesPolicyForm from './attribute-names/AAttributeNamesPolicyForm.vue';\nimport ACompositePolicyForm from './composite/ACompositePolicyForm.vue';\nimport ADatePolicyForm from './date/ADatePolicyForm.vue';\nimport ARealmMatchPolicyForm from './realm-match/ARealmMatchPolicyForm.vue';\nimport ATimePolicyForm from './time/ATimePolicyForm.vue';\nimport AIdentityPolicyForm from './identity/AIdentityPolicyForm.vue';\n\nexport default defineComponent({\n    components: {\n        AFormSubmit, \n        APolicyTypePicker, \n        APolicyBasicForm, \n    },\n    props: {\n        entity: { type: Object as PropType<Policy> },\n        type: { type: String as PropType<string> },\n    },\n    setup(props, ctx) {\n        // eslint-disable-next-line @typescript-eslint/no-explicit-any\n        const typeComponents: Record<string, any> = {\n            [BuiltInPolicyType.IDENTITY]: AIdentityPolicyForm,\n            [BuiltInPolicyType.REALM_MATCH]: ARealmMatchPolicyForm,\n            [BuiltInPolicyType.COMPOSITE]: ACompositePolicyForm,\n            [BuiltInPolicyType.DATE]: ADatePolicyForm,\n            [BuiltInPolicyType.TIME]: ATimePolicyForm,\n            [BuiltInPolicyType.ATTRIBUTE_NAMES]: AAttributeNamesPolicyForm,\n        };\n\n        const httpClient = injectHTTPClient();\n        const manager = defineEntityManager({\n            type: EntityType.POLICY,\n            setup: ctx,\n            props,\n        });\n\n        const isEditing = useIsEditing(manager.data);\n\n        const typeComputed = computed<string | null>(() => {\n            if (manager.data.value) {\n                return manager.data.value.type;\n            }\n\n            if (props.type) {\n                return props.type;\n            }\n\n            return null;\n        });\n\n        // Parent collector — the empty `Container` + empty state\n        // make this a registration-only Composable that aggregates the\n        // 'basic' + 'type' child slots via `$getResultsForChild`.\n        // `stopPropagation: true` mirrors vuelidate's `$stopPropagation`\n        // — don't register THIS form with an even-higher-level collector\n        // (no real one exists today, but it future-proofs the contract).\n        const v = useValidup(new Container(), reactive({}), { stopPropagation: true });\n\n        // The parent's `$invalid` only includes the parent's own issues\n        // (which is always empty here); aggregate the children's status\n        // for the submit gate.\n        const isInvalidComputed = computed(() => {\n            const basic = v.$getResultsForChild('basic');\n            const type = v.$getResultsForChild('type');\n            return !typeComputed.value ||\n                !!basic?.$invalid.value ||\n                !!type?.$invalid.value;\n        });\n\n        const submit = async () => {\n            if (isInvalidComputed.value) {\n                return;\n            }\n\n            const {\n                items = [],\n                ...data\n            } = {\n                ...extractValidupResultsFromChild(v, 'basic'),\n                ...extractValidupResultsFromChild(v, 'type'),\n            } as Partial<Omit<Policy, 'children'>> & { items: string[] };\n\n            if (typeComputed.value) {\n                data.type = typeComputed.value;\n            }\n\n            await manager.createOrUpdate(data);\n\n            if (manager.data.value) {\n                if (items.length > 0) {\n                    for (const item of items) {\n                        await httpClient.policy.update(item, { parentId: manager.data.value.id });\n                    }\n                }\n            }\n        };\n\n        const translations = useTranslationsForNamespace(\n            TranslatorTranslationNamespace.COMMON,\n            [\n                { key: TranslatorTranslationCommonKey.GENERAL },\n            ],\n        );\n\n        return {\n            typeComputed,\n            typeComponents,\n            data: manager.data,\n            busy: manager.busy,\n            isEditing,\n            isInvalid: isInvalidComputed,\n            submit,\n            translations,\n        };\n    },\n});\n</script>\n<template>\n    <div class=\"flex flex-col\">\n        <h6>{{ translations.general }}</h6>\n        <APolicyBasicForm\n            :entity=\"data\"\n            :type=\"typeComputed\"\n        />\n\n        <template v-if=\"typeComputed\">\n            <slot\n                name=\"default\"\n                :entity=\"entity\"\n            >\n                <template v-if=\"typeComputed in typeComponents\">\n                    <component\n                        :is=\"typeComponents[typeComputed]\"\n                        :entity=\"entity\"\n                    />\n                </template>\n            </slot>\n        </template>\n\n        <div>\n            <AFormSubmit\n                :is-invalid=\"isInvalid\"\n                :is-busy=\"busy\"\n                :is-editing=\"isEditing\"\n                @submit=\"submit\"\n            />\n        </div>\n    </div>\n</template>\n","<script lang=\"ts\">\nimport type { PropType } from 'vue';\nimport {\n    computed,\n    defineComponent,\n    reactive,\n} from 'vue';\nimport { Container } from 'validup';\nimport { useValidup } from '@validup/vue';\nimport type { Policy } from '@authup/core-kit';\nimport { EntityType } from '@authup/core-kit';\nimport { BuiltInPolicyType } from '@authup/access';\nimport {\n    TranslatorTranslationCommonKey,\n    TranslatorTranslationNamespace,\n} from '@authup/i18n';\nimport { useIsEditing } from '../../../composables';\nimport { extractValidupResultsFromChild, injectHTTPClient, useTranslationsForNamespace } from '../../../core';\nimport { AFormSubmit, defineEntityManager } from '../../utility';\nimport APolicyBasicForm from './APolicyBasicForm.vue';\nimport APolicyTypePicker from './APolicyTypePicker.vue';\nimport AAttributeNamesPolicyForm from './attribute-names/AAttributeNamesPolicyForm.vue';\nimport ACompositePolicyForm from './composite/ACompositePolicyForm.vue';\nimport ADatePolicyForm from './date/ADatePolicyForm.vue';\nimport ARealmMatchPolicyForm from './realm-match/ARealmMatchPolicyForm.vue';\nimport ATimePolicyForm from './time/ATimePolicyForm.vue';\nimport AIdentityPolicyForm from './identity/AIdentityPolicyForm.vue';\n\nexport default defineComponent({\n    components: {\n        AFormSubmit, \n        APolicyTypePicker, \n        APolicyBasicForm, \n    },\n    props: {\n        entity: { type: Object as PropType<Policy> },\n        type: { type: String as PropType<string> },\n    },\n    setup(props, ctx) {\n        // eslint-disable-next-line @typescript-eslint/no-explicit-any\n        const typeComponents: Record<string, any> = {\n            [BuiltInPolicyType.IDENTITY]: AIdentityPolicyForm,\n            [BuiltInPolicyType.REALM_MATCH]: ARealmMatchPolicyForm,\n            [BuiltInPolicyType.COMPOSITE]: ACompositePolicyForm,\n            [BuiltInPolicyType.DATE]: ADatePolicyForm,\n            [BuiltInPolicyType.TIME]: ATimePolicyForm,\n            [BuiltInPolicyType.ATTRIBUTE_NAMES]: AAttributeNamesPolicyForm,\n        };\n\n        const httpClient = injectHTTPClient();\n        const manager = defineEntityManager({\n            type: EntityType.POLICY,\n            setup: ctx,\n            props,\n        });\n\n        const isEditing = useIsEditing(manager.data);\n\n        const typeComputed = computed<string | null>(() => {\n            if (manager.data.value) {\n                return manager.data.value.type;\n            }\n\n            if (props.type) {\n                return props.type;\n            }\n\n            return null;\n        });\n\n        // Parent collector — the empty `Container` + empty state\n        // make this a registration-only Composable that aggregates the\n        // 'basic' + 'type' child slots via `$getResultsForChild`.\n        // `stopPropagation: true` mirrors vuelidate's `$stopPropagation`\n        // — don't register THIS form with an even-higher-level collector\n        // (no real one exists today, but it future-proofs the contract).\n        const v = useValidup(new Container(), reactive({}), { stopPropagation: true });\n\n        // The parent's `$invalid` only includes the parent's own issues\n        // (which is always empty here); aggregate the children's status\n        // for the submit gate.\n        const isInvalidComputed = computed(() => {\n            const basic = v.$getResultsForChild('basic');\n            const type = v.$getResultsForChild('type');\n            return !typeComputed.value ||\n                !!basic?.$invalid.value ||\n                !!type?.$invalid.value;\n        });\n\n        const submit = async () => {\n            if (isInvalidComputed.value) {\n                return;\n            }\n\n            const {\n                items = [],\n                ...data\n            } = {\n                ...extractValidupResultsFromChild(v, 'basic'),\n                ...extractValidupResultsFromChild(v, 'type'),\n            } as Partial<Omit<Policy, 'children'>> & { items: string[] };\n\n            if (typeComputed.value) {\n                data.type = typeComputed.value;\n            }\n\n            await manager.createOrUpdate(data);\n\n            if (manager.data.value) {\n                if (items.length > 0) {\n                    for (const item of items) {\n                        await httpClient.policy.update(item, { parentId: manager.data.value.id });\n                    }\n                }\n            }\n        };\n\n        const translations = useTranslationsForNamespace(\n            TranslatorTranslationNamespace.COMMON,\n            [\n                { key: TranslatorTranslationCommonKey.GENERAL },\n            ],\n        );\n\n        return {\n            typeComputed,\n            typeComponents,\n            data: manager.data,\n            busy: manager.busy,\n            isEditing,\n            isInvalid: isInvalidComputed,\n            submit,\n            translations,\n        };\n    },\n});\n</script>\n<template>\n    <div class=\"flex flex-col\">\n        <h6>{{ translations.general }}</h6>\n        <APolicyBasicForm\n            :entity=\"data\"\n            :type=\"typeComputed\"\n        />\n\n        <template v-if=\"typeComputed\">\n            <slot\n                name=\"default\"\n                :entity=\"entity\"\n            >\n                <template v-if=\"typeComputed in typeComponents\">\n                    <component\n                        :is=\"typeComponents[typeComputed]\"\n                        :entity=\"entity\"\n                    />\n                </template>\n            </slot>\n        </template>\n\n        <div>\n            <AFormSubmit\n                :is-invalid=\"isInvalid\"\n                :is-busy=\"busy\"\n                :is-editing=\"isEditing\"\n                @submit=\"submit\"\n            />\n        </div>\n    </div>\n</template>\n","<!--\n  Copyright (c) 2022.\n  Author Peter Placzek (tada5hi)\n  For the full copyright and license information,\n  view the LICENSE file that was distributed with this source code.\n-->\n\n<script lang=\"ts\">\nimport { computed, defineComponent } from 'vue';\nimport { AClients } from '../client';\nimport { AClientPermissionAssignment } from '../client-permission';\n\nexport default defineComponent({\n    components: { AClients, AClientPermissionAssignment },\n    props: {\n        entityId: {\n            type: String,\n            required: true,\n        },\n    },\n    setup(props, { slots }) {\n        const forwardedSlots = computed(() => Object.fromEntries(Object.entries(slots).filter(([name]) => name !== 'itemActions')));\n        return { forwardedSlots };\n    },\n});\n</script>\n<template>\n    <AClients>\n        <template #itemActions=\"{ data }\">\n            <AClientPermissionAssignment\n                :key=\"data.id\"\n                :permission-id=\"entityId\"\n                :client-id=\"data.id\"\n            />\n        </template>\n        <template\n            v-for=\"(_, name) in forwardedSlots\"\n            :key=\"name\"\n            #[name]=\"slotData\"\n        >\n            <slot\n                :name=\"name\"\n                v-bind=\"slotData ?? {}\"\n            />\n        </template>\n    </AClients>\n</template>\n","<!--\n  Copyright (c) 2022.\n  Author Peter Placzek (tada5hi)\n  For the full copyright and license information,\n  view the LICENSE file that was distributed with this source code.\n-->\n\n<script lang=\"ts\">\nimport { computed, defineComponent } from 'vue';\nimport { AClients } from '../client';\nimport { AClientPermissionAssignment } from '../client-permission';\n\nexport default defineComponent({\n    components: { AClients, AClientPermissionAssignment },\n    props: {\n        entityId: {\n            type: String,\n            required: true,\n        },\n    },\n    setup(props, { slots }) {\n        const forwardedSlots = computed(() => Object.fromEntries(Object.entries(slots).filter(([name]) => name !== 'itemActions')));\n        return { forwardedSlots };\n    },\n});\n</script>\n<template>\n    <AClients>\n        <template #itemActions=\"{ data }\">\n            <AClientPermissionAssignment\n                :key=\"data.id\"\n                :permission-id=\"entityId\"\n                :client-id=\"data.id\"\n            />\n        </template>\n        <template\n            v-for=\"(_, name) in forwardedSlots\"\n            :key=\"name\"\n            #[name]=\"slotData\"\n        >\n            <slot\n                :name=\"name\"\n                v-bind=\"slotData ?? {}\"\n            />\n        </template>\n    </AClients>\n</template>\n","<!--\n  Copyright (c) 2026.\n  Author Peter Placzek (tada5hi)\n  For the full copyright and license information,\n  view the LICENSE file that was distributed with this source code.\n-->\n\n<script lang=\"ts\">\nimport { EntityType } from '@authup/core-kit';\nimport type { PermissionPolicy } from '@authup/core-kit';\nimport { defineComponent } from 'vue';\nimport {\n    defineEntityManager,\n    defineEntityVEmitOptions,\n} from '../../utility';\nimport AToggleButton from '../../utility/toggle-button/AToggleButton.vue';\n\nexport default defineComponent({\n    components: { AToggleButton },\n    props: {\n        permissionId: {\n            type: String,\n            required: true,\n        },\n        policyId: {\n            type: String,\n            required: true,\n        },\n    },\n    emits: defineEntityVEmitOptions<PermissionPolicy>(),\n    async setup(props, setup) {\n        const manager = defineEntityManager({\n            type: EntityType.PERMISSION_POLICY,\n            setup,\n            query: () => ({\n                filters: {\n                    permissionId: props.permissionId,\n                    policyId: props.policyId,\n                },\n            }),\n            socket: {\n                processEvent(event) {\n                    return event.data.permissionId === props.permissionId &&\n                        event.data.policyId === props.policyId;\n                },\n            },\n        });\n\n        await manager.resolve({\n            query: {\n                filters: {\n                    permissionId: props.permissionId,\n                    policyId: props.policyId,\n                },\n            },\n        });\n\n        const handleChanged = (value: boolean) => {\n            if (value) {\n                return manager.create({\n                    permissionId: props.permissionId,\n                    policyId: props.policyId,\n                });\n            }\n\n            return manager.delete();\n        };\n\n        return {\n            manager,\n            handleChanged,\n        };\n    },\n});\n</script>\n<template>\n    <AToggleButton\n        :value=\"!!manager.data.value\"\n        :is-busy=\"manager.busy.value\"\n        @changed=\"handleChanged\"\n    />\n</template>\n","<!--\n  Copyright (c) 2026.\n  Author Peter Placzek (tada5hi)\n  For the full copyright and license information,\n  view the LICENSE file that was distributed with this source code.\n-->\n\n<script lang=\"ts\">\nimport { EntityType } from '@authup/core-kit';\nimport type { PermissionPolicy } from '@authup/core-kit';\nimport { defineComponent } from 'vue';\nimport {\n    defineEntityManager,\n    defineEntityVEmitOptions,\n} from '../../utility';\nimport AToggleButton from '../../utility/toggle-button/AToggleButton.vue';\n\nexport default defineComponent({\n    components: { AToggleButton },\n    props: {\n        permissionId: {\n            type: String,\n            required: true,\n        },\n        policyId: {\n            type: String,\n            required: true,\n        },\n    },\n    emits: defineEntityVEmitOptions<PermissionPolicy>(),\n    async setup(props, setup) {\n        const manager = defineEntityManager({\n            type: EntityType.PERMISSION_POLICY,\n            setup,\n            query: () => ({\n                filters: {\n                    permissionId: props.permissionId,\n                    policyId: props.policyId,\n                },\n            }),\n            socket: {\n                processEvent(event) {\n                    return event.data.permissionId === props.permissionId &&\n                        event.data.policyId === props.policyId;\n                },\n            },\n        });\n\n        await manager.resolve({\n            query: {\n                filters: {\n                    permissionId: props.permissionId,\n                    policyId: props.policyId,\n                },\n            },\n        });\n\n        const handleChanged = (value: boolean) => {\n            if (value) {\n                return manager.create({\n                    permissionId: props.permissionId,\n                    policyId: props.policyId,\n                });\n            }\n\n            return manager.delete();\n        };\n\n        return {\n            manager,\n            handleChanged,\n        };\n    },\n});\n</script>\n<template>\n    <AToggleButton\n        :value=\"!!manager.data.value\"\n        :is-busy=\"manager.busy.value\"\n        @changed=\"handleChanged\"\n    />\n</template>\n","<!--\n  Copyright (c) 2026.\n  Author Peter Placzek (tada5hi)\n  For the full copyright and license information,\n  view the LICENSE file that was distributed with this source code.\n-->\n\n<script lang=\"ts\">\nimport type { Policy } from '@authup/core-kit';\nimport { defineQuery } from '@rapiq/core';\nimport type { PropType } from 'vue';\nimport {\n    computed,\n    defineComponent,\n    ref,\n} from 'vue';\nimport type { ButtonSize } from '@vuecs/button';\nimport { VCButton } from '@vuecs/button';\nimport { VCIcon } from '@vuecs/icon';\nimport {\n    VCModal,\n    VCModalClose,\n    VCModalContent,\n    VCModalTitle,\n} from '@vuecs/overlays';\nimport { TranslatorTranslationActionKey, TranslatorTranslationNamespace } from '@authup/i18n';\nimport { DEFAULT_BUTTON_SIZE, useTranslations } from '../../../core';\nimport APermissionPolicyAssignment from './APermissionPolicyAssignment.vue';\nimport { APolicies } from '../policy';\nimport APolicyInlineInfo from '../policy/APolicyInlineInfo.vue';\nimport APolicySummary from '../policy/APolicySummary.vue';\n\nexport default defineComponent({\n    components: {\n        APolicies,\n        APermissionPolicyAssignment,\n        APolicyInlineInfo,\n        APolicySummary,\n        VCButton,\n        VCIcon,\n        VCModal,\n        VCModalContent,\n        VCModalTitle,\n        VCModalClose,\n    },\n    props: {\n        entityId: {\n            type: String,\n            required: true,\n        },\n        size: {\n            type: String as PropType<ButtonSize>,\n            default: DEFAULT_BUTTON_SIZE,\n        },\n    },\n    setup(props, { slots }) {\n        const translationsAction = useTranslations([\n            {\n                namespace: TranslatorTranslationNamespace.ACTION,\n                key: TranslatorTranslationActionKey.CLOSE,\n            },\n        ]);\n\n        const detailPolicy = ref<Policy | null>(null);\n\n        const forwardedSlots = computed(() => Object.fromEntries(Object.entries(slots).filter(([name]) => name !== 'item')));\n\n        const policyQuery = defineQuery<Policy>({ filters: { parentId: null } });\n\n        return {\n            detailPolicy,\n            forwardedSlots,\n            policyQuery,\n            translationsAction,\n        };\n    },\n});\n</script>\n<template>\n    <div>\n        <APolicies :query=\"policyQuery\">\n            <template #item=\"{ data }\">\n                <div>{{ data.name }}</div>\n                <APolicyInlineInfo\n                    :entity=\"data\"\n                    @detail=\"detailPolicy = $event\"\n                />\n                <div class=\"ms-auto\">\n                    <APermissionPolicyAssignment\n                        :key=\"data.id\"\n                        :permission-id=\"entityId\"\n                        :policy-id=\"data.id\"\n                    />\n                </div>\n            </template>\n            <template\n                v-for=\"(_, name) in forwardedSlots\"\n                :key=\"name\"\n                #[name]=\"slotData\"\n            >\n                <slot\n                    :name=\"name\"\n                    v-bind=\"slotData ?? {}\"\n                />\n            </template>\n        </APolicies>\n\n        <VCModal\n            :open=\"!!detailPolicy\"\n            @update:open=\"(value) => { if (!value) { detailPolicy = null; } }\"\n        >\n            <VCModalContent v-if=\"detailPolicy\">\n                <div class=\"flex items-center justify-between gap-2\">\n                    <VCModalTitle>{{ detailPolicy.name }}</VCModalTitle>\n                    <VCModalClose\n                        class=\"text-fg-muted hover:text-fg\"\n                        :aria-label=\"translationsAction.close\"\n                    >\n                        <VCIcon name=\"fa6-solid:xmark\" />\n                    </VCModalClose>\n                </div>\n                <APolicySummary :entity=\"detailPolicy\" />\n                <div class=\"flex items-center justify-end gap-2\">\n                    <VCButton\n                        type=\"button\"\n                        :size=\"size\"\n                        color=\"neutral\"\n                        variant=\"soft\"\n                        :label=\"translationsAction.close\"\n                        @click=\"detailPolicy = null\"\n                    />\n                </div>\n            </VCModalContent>\n        </VCModal>\n    </div>\n</template>\n","<!--\n  Copyright (c) 2026.\n  Author Peter Placzek (tada5hi)\n  For the full copyright and license information,\n  view the LICENSE file that was distributed with this source code.\n-->\n\n<script lang=\"ts\">\nimport type { Policy } from '@authup/core-kit';\nimport { defineQuery } from '@rapiq/core';\nimport type { PropType } from 'vue';\nimport {\n    computed,\n    defineComponent,\n    ref,\n} from 'vue';\nimport type { ButtonSize } from '@vuecs/button';\nimport { VCButton } from '@vuecs/button';\nimport { VCIcon } from '@vuecs/icon';\nimport {\n    VCModal,\n    VCModalClose,\n    VCModalContent,\n    VCModalTitle,\n} from '@vuecs/overlays';\nimport { TranslatorTranslationActionKey, TranslatorTranslationNamespace } from '@authup/i18n';\nimport { DEFAULT_BUTTON_SIZE, useTranslations } from '../../../core';\nimport APermissionPolicyAssignment from './APermissionPolicyAssignment.vue';\nimport { APolicies } from '../policy';\nimport APolicyInlineInfo from '../policy/APolicyInlineInfo.vue';\nimport APolicySummary from '../policy/APolicySummary.vue';\n\nexport default defineComponent({\n    components: {\n        APolicies,\n        APermissionPolicyAssignment,\n        APolicyInlineInfo,\n        APolicySummary,\n        VCButton,\n        VCIcon,\n        VCModal,\n        VCModalContent,\n        VCModalTitle,\n        VCModalClose,\n    },\n    props: {\n        entityId: {\n            type: String,\n            required: true,\n        },\n        size: {\n            type: String as PropType<ButtonSize>,\n            default: DEFAULT_BUTTON_SIZE,\n        },\n    },\n    setup(props, { slots }) {\n        const translationsAction = useTranslations([\n            {\n                namespace: TranslatorTranslationNamespace.ACTION,\n                key: TranslatorTranslationActionKey.CLOSE,\n            },\n        ]);\n\n        const detailPolicy = ref<Policy | null>(null);\n\n        const forwardedSlots = computed(() => Object.fromEntries(Object.entries(slots).filter(([name]) => name !== 'item')));\n\n        const policyQuery = defineQuery<Policy>({ filters: { parentId: null } });\n\n        return {\n            detailPolicy,\n            forwardedSlots,\n            policyQuery,\n            translationsAction,\n        };\n    },\n});\n</script>\n<template>\n    <div>\n        <APolicies :query=\"policyQuery\">\n            <template #item=\"{ data }\">\n                <div>{{ data.name }}</div>\n                <APolicyInlineInfo\n                    :entity=\"data\"\n                    @detail=\"detailPolicy = $event\"\n                />\n                <div class=\"ms-auto\">\n                    <APermissionPolicyAssignment\n                        :key=\"data.id\"\n                        :permission-id=\"entityId\"\n                        :policy-id=\"data.id\"\n                    />\n                </div>\n            </template>\n            <template\n                v-for=\"(_, name) in forwardedSlots\"\n                :key=\"name\"\n                #[name]=\"slotData\"\n            >\n                <slot\n                    :name=\"name\"\n                    v-bind=\"slotData ?? {}\"\n                />\n            </template>\n        </APolicies>\n\n        <VCModal\n            :open=\"!!detailPolicy\"\n            @update:open=\"(value) => { if (!value) { detailPolicy = null; } }\"\n        >\n            <VCModalContent v-if=\"detailPolicy\">\n                <div class=\"flex items-center justify-between gap-2\">\n                    <VCModalTitle>{{ detailPolicy.name }}</VCModalTitle>\n                    <VCModalClose\n                        class=\"text-fg-muted hover:text-fg\"\n                        :aria-label=\"translationsAction.close\"\n                    >\n                        <VCIcon name=\"fa6-solid:xmark\" />\n                    </VCModalClose>\n                </div>\n                <APolicySummary :entity=\"detailPolicy\" />\n                <div class=\"flex items-center justify-end gap-2\">\n                    <VCButton\n                        type=\"button\"\n                        :size=\"size\"\n                        color=\"neutral\"\n                        variant=\"soft\"\n                        :label=\"translationsAction.close\"\n                        @click=\"detailPolicy = null\"\n                    />\n                </div>\n            </VCModalContent>\n        </VCModal>\n    </div>\n</template>\n","<!--\n  Copyright (c) 2022.\n  Author Peter Placzek (tada5hi)\n  For the full copyright and license information,\n  view the LICENSE file that was distributed with this source code.\n-->\n\n<script lang=\"ts\">\nimport { EntityType } from '@authup/core-kit';\nimport type { RolePermission } from '@authup/core-kit';\nimport { computed, defineComponent } from 'vue';\nimport {\n    defineEntityManager,\n    defineEntityVEmitOptions,\n} from '../../utility';\nimport AToggleButton from '../../utility/toggle-button/AToggleButton.vue';\nimport { APermissionPolicyBindingButton } from '../permission-policy-binding';\n\nexport default defineComponent({\n    components: { AToggleButton, APermissionPolicyBindingButton },\n    props: {\n        roleId: { type: String, required: true },\n        permissionId: { type: String, required: true },\n    },\n    emits: defineEntityVEmitOptions<RolePermission>(),\n    async setup(props, setup) {\n        const manager = defineEntityManager({\n            type: EntityType.ROLE_PERMISSION,\n            setup,\n            query: () => ({\n                filters: {\n                    roleId: props.roleId,\n                    permissionId: props.permissionId,\n                },\n            }),\n            socket: {\n                processEvent(event) {\n                    return event.data.roleId === props.roleId &&\n                        event.data.permissionId === props.permissionId;\n                },\n            },\n        });\n\n        await manager.resolve({\n            query: {\n                filters: {\n                    roleId: props.roleId,\n                    permissionId: props.permissionId,\n                },\n            },\n        });\n\n        const handleChanged = (value: boolean) => {\n            if (value) {\n                return manager.create({\n                    roleId: props.roleId,\n                    permissionId: props.permissionId,\n                });\n            }\n\n            return manager.delete();\n        };\n\n        const handleCreated = (entity: RolePermission) => {\n            manager.created(entity);\n        };\n\n        const handleUpdated = (entity: RolePermission) => {\n            manager.updated(entity);\n        };\n\n        // The existing junction in edit mode, else a stable create template (FK base) carrying\n        // no id → the binding control treats it as create mode. Memoized so the template keeps a\n        // stable reference while unassigned.\n        const bindingEntity = computed<Partial<RolePermission>>(() => manager.data.value || {\n            roleId: props.roleId,\n            permissionId: props.permissionId,\n        });\n\n        return {\n            manager,\n            handleChanged,\n            handleCreated,\n            handleUpdated,\n            bindingEntity,\n            EntityType,\n        };\n    },\n});\n</script>\n<template>\n    <span class=\"flex gap-1\">\n        <AToggleButton\n            :value=\"!!manager.data.value\"\n            :is-busy=\"manager.busy.value\"\n            :with-prompt=\"true\"\n            @changed=\"handleChanged\"\n        />\n        <APermissionPolicyBindingButton\n            :key=\"manager.data.value?.id || 'create'\"\n            :entity-type=\"EntityType.ROLE_PERMISSION\"\n            :entity=\"bindingEntity\"\n            @created=\"handleCreated\"\n            @updated=\"handleUpdated\"\n        />\n    </span>\n</template>\n","<!--\n  Copyright (c) 2022.\n  Author Peter Placzek (tada5hi)\n  For the full copyright and license information,\n  view the LICENSE file that was distributed with this source code.\n-->\n\n<script lang=\"ts\">\nimport { EntityType } from '@authup/core-kit';\nimport type { RolePermission } from '@authup/core-kit';\nimport { computed, defineComponent } from 'vue';\nimport {\n    defineEntityManager,\n    defineEntityVEmitOptions,\n} from '../../utility';\nimport AToggleButton from '../../utility/toggle-button/AToggleButton.vue';\nimport { APermissionPolicyBindingButton } from '../permission-policy-binding';\n\nexport default defineComponent({\n    components: { AToggleButton, APermissionPolicyBindingButton },\n    props: {\n        roleId: { type: String, required: true },\n        permissionId: { type: String, required: true },\n    },\n    emits: defineEntityVEmitOptions<RolePermission>(),\n    async setup(props, setup) {\n        const manager = defineEntityManager({\n            type: EntityType.ROLE_PERMISSION,\n            setup,\n            query: () => ({\n                filters: {\n                    roleId: props.roleId,\n                    permissionId: props.permissionId,\n                },\n            }),\n            socket: {\n                processEvent(event) {\n                    return event.data.roleId === props.roleId &&\n                        event.data.permissionId === props.permissionId;\n                },\n            },\n        });\n\n        await manager.resolve({\n            query: {\n                filters: {\n                    roleId: props.roleId,\n                    permissionId: props.permissionId,\n                },\n            },\n        });\n\n        const handleChanged = (value: boolean) => {\n            if (value) {\n                return manager.create({\n                    roleId: props.roleId,\n                    permissionId: props.permissionId,\n                });\n            }\n\n            return manager.delete();\n        };\n\n        const handleCreated = (entity: RolePermission) => {\n            manager.created(entity);\n        };\n\n        const handleUpdated = (entity: RolePermission) => {\n            manager.updated(entity);\n        };\n\n        // The existing junction in edit mode, else a stable create template (FK base) carrying\n        // no id → the binding control treats it as create mode. Memoized so the template keeps a\n        // stable reference while unassigned.\n        const bindingEntity = computed<Partial<RolePermission>>(() => manager.data.value || {\n            roleId: props.roleId,\n            permissionId: props.permissionId,\n        });\n\n        return {\n            manager,\n            handleChanged,\n            handleCreated,\n            handleUpdated,\n            bindingEntity,\n            EntityType,\n        };\n    },\n});\n</script>\n<template>\n    <span class=\"flex gap-1\">\n        <AToggleButton\n            :value=\"!!manager.data.value\"\n            :is-busy=\"manager.busy.value\"\n            :with-prompt=\"true\"\n            @changed=\"handleChanged\"\n        />\n        <APermissionPolicyBindingButton\n            :key=\"manager.data.value?.id || 'create'\"\n            :entity-type=\"EntityType.ROLE_PERMISSION\"\n            :entity=\"bindingEntity\"\n            @created=\"handleCreated\"\n            @updated=\"handleUpdated\"\n        />\n    </span>\n</template>\n","<!--\n  Copyright (c) 2022.\n  Author Peter Placzek (tada5hi)\n  For the full copyright and license information,\n  view the LICENSE file that was distributed with this source code.\n-->\n\n<script lang=\"ts\">\nimport { computed, defineComponent } from 'vue';\nimport { APermissions } from '../permission';\nimport ARolePermissionAssignment from './ARolePermissionAssignment.vue';\n\nexport default defineComponent({\n    components: { APermissions, ARolePermissionAssignment },\n    props: {\n        entityId: {\n            type: String,\n            required: true,\n        },\n    },\n    setup(props, { slots }) {\n        const forwardedSlots = computed(() => Object.fromEntries(Object.entries(slots).filter(([name]) => name !== 'itemActions')));\n        return { forwardedSlots };\n    },\n});\n</script>\n<template>\n    <APermissions>\n        <template #itemActions=\"{ data }\">\n            <ARolePermissionAssignment\n                :key=\"data.id\"\n                :role-id=\"entityId\"\n                :permission-id=\"data.id\"\n            />\n        </template>\n        <template\n            v-for=\"(_, name) in forwardedSlots\"\n            :key=\"name\"\n            #[name]=\"slotData\"\n        >\n            <slot\n                :name=\"name\"\n                v-bind=\"slotData ?? {}\"\n            />\n        </template>\n    </APermissions>\n</template>\n","<!--\n  Copyright (c) 2022.\n  Author Peter Placzek (tada5hi)\n  For the full copyright and license information,\n  view the LICENSE file that was distributed with this source code.\n-->\n\n<script lang=\"ts\">\nimport { computed, defineComponent } from 'vue';\nimport { APermissions } from '../permission';\nimport ARolePermissionAssignment from './ARolePermissionAssignment.vue';\n\nexport default defineComponent({\n    components: { APermissions, ARolePermissionAssignment },\n    props: {\n        entityId: {\n            type: String,\n            required: true,\n        },\n    },\n    setup(props, { slots }) {\n        const forwardedSlots = computed(() => Object.fromEntries(Object.entries(slots).filter(([name]) => name !== 'itemActions')));\n        return { forwardedSlots };\n    },\n});\n</script>\n<template>\n    <APermissions>\n        <template #itemActions=\"{ data }\">\n            <ARolePermissionAssignment\n                :key=\"data.id\"\n                :role-id=\"entityId\"\n                :permission-id=\"data.id\"\n            />\n        </template>\n        <template\n            v-for=\"(_, name) in forwardedSlots\"\n            :key=\"name\"\n            #[name]=\"slotData\"\n        >\n            <slot\n                :name=\"name\"\n                v-bind=\"slotData ?? {}\"\n            />\n        </template>\n    </APermissions>\n</template>\n","<!--\n  Copyright (c) 2022.\n  Author Peter Placzek (tada5hi)\n  For the full copyright and license information,\n  view the LICENSE file that was distributed with this source code.\n-->\n\n<script lang=\"ts\">\nimport { computed, defineComponent } from 'vue';\nimport { ARolePermissionAssignment } from '../role-permission';\nimport { ARoles } from '../role';\n\nexport default defineComponent({\n    components: { ARoles, ARolePermissionAssignment },\n    props: {\n        entityId: {\n            type: String,\n            required: true,\n        },\n    },\n    setup(props, { slots }) {\n        const forwardedSlots = computed(() => Object.fromEntries(Object.entries(slots).filter(([name]) => name !== 'itemActions')));\n        return { forwardedSlots };\n    },\n});\n</script>\n<template>\n    <ARoles>\n        <template #itemActions=\"{ data }\">\n            <ARolePermissionAssignment\n                :key=\"data.id\"\n                :permission-id=\"entityId\"\n                :role-id=\"data.id\"\n            />\n        </template>\n        <template\n            v-for=\"(_, name) in forwardedSlots\"\n            :key=\"name\"\n            #[name]=\"slotData\"\n        >\n            <slot\n                :name=\"name\"\n                v-bind=\"slotData ?? {}\"\n            />\n        </template>\n    </ARoles>\n</template>\n","<!--\n  Copyright (c) 2022.\n  Author Peter Placzek (tada5hi)\n  For the full copyright and license information,\n  view the LICENSE file that was distributed with this source code.\n-->\n\n<script lang=\"ts\">\nimport { computed, defineComponent } from 'vue';\nimport { ARolePermissionAssignment } from '../role-permission';\nimport { ARoles } from '../role';\n\nexport default defineComponent({\n    components: { ARoles, ARolePermissionAssignment },\n    props: {\n        entityId: {\n            type: String,\n            required: true,\n        },\n    },\n    setup(props, { slots }) {\n        const forwardedSlots = computed(() => Object.fromEntries(Object.entries(slots).filter(([name]) => name !== 'itemActions')));\n        return { forwardedSlots };\n    },\n});\n</script>\n<template>\n    <ARoles>\n        <template #itemActions=\"{ data }\">\n            <ARolePermissionAssignment\n                :key=\"data.id\"\n                :permission-id=\"entityId\"\n                :role-id=\"data.id\"\n            />\n        </template>\n        <template\n            v-for=\"(_, name) in forwardedSlots\"\n            :key=\"name\"\n            #[name]=\"slotData\"\n        >\n            <slot\n                :name=\"name\"\n                v-bind=\"slotData ?? {}\"\n            />\n        </template>\n    </ARoles>\n</template>\n","<!--\n  Copyright (c) 2022.\n  Author Peter Placzek (tada5hi)\n  For the full copyright and license information,\n  view the LICENSE file that was distributed with this source code.\n-->\n\n<script lang=\"ts\">\nimport { EntityType } from '@authup/core-kit';\nimport type { UserPermission } from '@authup/core-kit';\nimport { computed, defineComponent } from 'vue';\nimport {\n    defineEntityManager,\n    defineEntityVEmitOptions,\n} from '../../utility';\nimport AToggleButton from '../../utility/toggle-button/AToggleButton.vue';\nimport { APermissionPolicyBindingButton } from '../permission-policy-binding';\n\nexport default defineComponent({\n    components: { AToggleButton, APermissionPolicyBindingButton },\n    props: {\n        userId: { type: String, required: true },\n        permissionId: { type: String, required: true },\n    },\n    emits: defineEntityVEmitOptions<UserPermission>(),\n    async setup(props, setup) {\n        const manager = defineEntityManager({\n            type: EntityType.USER_PERMISSION,\n            setup,\n            query: () => ({\n                filters: {\n                    userId: props.userId,\n                    permissionId: props.permissionId,\n                },\n            }),\n            socket: {\n                processEvent(event) {\n                    return event.data.permissionId === props.permissionId &&\n                        event.data.userId === props.userId;\n                },\n            },\n        });\n\n        await manager.resolve({\n            query: {\n                filters: {\n                    userId: props.userId,\n                    permissionId: props.permissionId,\n                },\n            },\n        });\n\n        const handleChanged = (value: boolean) => {\n            if (value) {\n                return manager.create({\n                    userId: props.userId,\n                    permissionId: props.permissionId,\n                });\n            }\n\n            return manager.delete();\n        };\n\n        const handleCreated = (entity: UserPermission) => {\n            manager.created(entity);\n        };\n\n        const handleUpdated = (entity: UserPermission) => {\n            manager.updated(entity);\n        };\n\n        // The existing junction in edit mode, else a stable create template (FK base) carrying\n        // no id → the binding control treats it as create mode. Memoized so the template keeps a\n        // stable reference while unassigned.\n        const bindingEntity = computed<Partial<UserPermission>>(() => manager.data.value || {\n            userId: props.userId,\n            permissionId: props.permissionId,\n        });\n\n        return {\n            manager,\n            handleChanged,\n            handleCreated,\n            handleUpdated,\n            bindingEntity,\n            EntityType,\n        };\n    },\n});\n</script>\n<template>\n    <span class=\"flex gap-1\">\n        <AToggleButton\n            :value=\"!!manager.data.value\"\n            :is-busy=\"manager.busy.value\"\n            :with-prompt=\"true\"\n            @changed=\"handleChanged\"\n        />\n        <APermissionPolicyBindingButton\n            :key=\"manager.data.value?.id || 'create'\"\n            :entity-type=\"EntityType.USER_PERMISSION\"\n            :entity=\"bindingEntity\"\n            @created=\"handleCreated\"\n            @updated=\"handleUpdated\"\n        />\n    </span>\n</template>\n","<!--\n  Copyright (c) 2022.\n  Author Peter Placzek (tada5hi)\n  For the full copyright and license information,\n  view the LICENSE file that was distributed with this source code.\n-->\n\n<script lang=\"ts\">\nimport { EntityType } from '@authup/core-kit';\nimport type { UserPermission } from '@authup/core-kit';\nimport { computed, defineComponent } from 'vue';\nimport {\n    defineEntityManager,\n    defineEntityVEmitOptions,\n} from '../../utility';\nimport AToggleButton from '../../utility/toggle-button/AToggleButton.vue';\nimport { APermissionPolicyBindingButton } from '../permission-policy-binding';\n\nexport default defineComponent({\n    components: { AToggleButton, APermissionPolicyBindingButton },\n    props: {\n        userId: { type: String, required: true },\n        permissionId: { type: String, required: true },\n    },\n    emits: defineEntityVEmitOptions<UserPermission>(),\n    async setup(props, setup) {\n        const manager = defineEntityManager({\n            type: EntityType.USER_PERMISSION,\n            setup,\n            query: () => ({\n                filters: {\n                    userId: props.userId,\n                    permissionId: props.permissionId,\n                },\n            }),\n            socket: {\n                processEvent(event) {\n                    return event.data.permissionId === props.permissionId &&\n                        event.data.userId === props.userId;\n                },\n            },\n        });\n\n        await manager.resolve({\n            query: {\n                filters: {\n                    userId: props.userId,\n                    permissionId: props.permissionId,\n                },\n            },\n        });\n\n        const handleChanged = (value: boolean) => {\n            if (value) {\n                return manager.create({\n                    userId: props.userId,\n                    permissionId: props.permissionId,\n                });\n            }\n\n            return manager.delete();\n        };\n\n        const handleCreated = (entity: UserPermission) => {\n            manager.created(entity);\n        };\n\n        const handleUpdated = (entity: UserPermission) => {\n            manager.updated(entity);\n        };\n\n        // The existing junction in edit mode, else a stable create template (FK base) carrying\n        // no id → the binding control treats it as create mode. Memoized so the template keeps a\n        // stable reference while unassigned.\n        const bindingEntity = computed<Partial<UserPermission>>(() => manager.data.value || {\n            userId: props.userId,\n            permissionId: props.permissionId,\n        });\n\n        return {\n            manager,\n            handleChanged,\n            handleCreated,\n            handleUpdated,\n            bindingEntity,\n            EntityType,\n        };\n    },\n});\n</script>\n<template>\n    <span class=\"flex gap-1\">\n        <AToggleButton\n            :value=\"!!manager.data.value\"\n            :is-busy=\"manager.busy.value\"\n            :with-prompt=\"true\"\n            @changed=\"handleChanged\"\n        />\n        <APermissionPolicyBindingButton\n            :key=\"manager.data.value?.id || 'create'\"\n            :entity-type=\"EntityType.USER_PERMISSION\"\n            :entity=\"bindingEntity\"\n            @created=\"handleCreated\"\n            @updated=\"handleUpdated\"\n        />\n    </span>\n</template>\n","<!--\n  Copyright (c) 2022.\n  Author Peter Placzek (tada5hi)\n  For the full copyright and license information,\n  view the LICENSE file that was distributed with this source code.\n-->\n\n<script lang=\"ts\">\nimport { computed, defineComponent } from 'vue';\nimport { APermissions } from '../permission';\nimport AUserPermissionAssignment from './AUserPermissionAssignment.vue';\n\nexport default defineComponent({\n    components: { APermissions, AUserPermissionAssignment },\n    props: {\n        entityId: {\n            type: String,\n            required: true,\n        },\n    },\n    setup(props, { slots }) {\n        const forwardedSlots = computed(() => Object.fromEntries(Object.entries(slots).filter(([name]) => name !== 'itemActions')));\n        return { forwardedSlots };\n    },\n});\n</script>\n<template>\n    <APermissions>\n        <template #itemActions=\"{ data }\">\n            <AUserPermissionAssignment\n                :key=\"data.id\"\n                :user-id=\"entityId\"\n                :permission-id=\"data.id\"\n            />\n        </template>\n        <template\n            v-for=\"(_, name) in forwardedSlots\"\n            :key=\"name\"\n            #[name]=\"slotData\"\n        >\n            <slot\n                :name=\"name\"\n                v-bind=\"slotData ?? {}\"\n            />\n        </template>\n    </APermissions>\n</template>\n","<!--\n  Copyright (c) 2022.\n  Author Peter Placzek (tada5hi)\n  For the full copyright and license information,\n  view the LICENSE file that was distributed with this source code.\n-->\n\n<script lang=\"ts\">\nimport { computed, defineComponent } from 'vue';\nimport { APermissions } from '../permission';\nimport AUserPermissionAssignment from './AUserPermissionAssignment.vue';\n\nexport default defineComponent({\n    components: { APermissions, AUserPermissionAssignment },\n    props: {\n        entityId: {\n            type: String,\n            required: true,\n        },\n    },\n    setup(props, { slots }) {\n        const forwardedSlots = computed(() => Object.fromEntries(Object.entries(slots).filter(([name]) => name !== 'itemActions')));\n        return { forwardedSlots };\n    },\n});\n</script>\n<template>\n    <APermissions>\n        <template #itemActions=\"{ data }\">\n            <AUserPermissionAssignment\n                :key=\"data.id\"\n                :user-id=\"entityId\"\n                :permission-id=\"data.id\"\n            />\n        </template>\n        <template\n            v-for=\"(_, name) in forwardedSlots\"\n            :key=\"name\"\n            #[name]=\"slotData\"\n        >\n            <slot\n                :name=\"name\"\n                v-bind=\"slotData ?? {}\"\n            />\n        </template>\n    </APermissions>\n</template>\n","/*\n * Copyright (c) 2023.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { EntityType } from '@authup/core-kit';\nimport type { User } from '@authup/core-kit';\nimport type { SlotsType } from 'vue';\nimport { defineComponent } from 'vue';\nimport type { EntityVSlots } from '../../utility';\nimport {\n    defineEntityManager,\n    defineEntityVEmitOptions,\n    defineEntityVProps,\n} from '../../utility';\n\nexport const AUser = defineComponent({\n    props: defineEntityVProps<User>(),\n    emits: defineEntityVEmitOptions<User>(),\n    slots: Object as SlotsType<EntityVSlots<User>>,\n    async setup(props, setup) {\n        const manager = defineEntityManager({\n            type: `${EntityType.USER}`,\n            props,\n            setup,\n        });\n\n        try {\n            await manager.resolveOrFail();\n\n            return () => manager.render();\n        } catch (e) {\n            return () => manager.renderError(e);\n        }\n    },\n});\n","<!--\n  - Copyright (c) 2022-2026.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\nimport type { User } from '@authup/core-kit';\nimport { \n    EntityType, \n    UserValidator, \n    buildUserFakeEmail, \n    isUserFakeEmail, \n} from '@authup/core-kit';\nimport { ValidatorGroup, generateName, omitRecord } from '@authup/kit';\nimport { TranslatorTranslationCommonKey, TranslatorTranslationFieldKey, TranslatorTranslationNamespace } from '@authup/i18n';\nimport { assignFormProperties, useTranslations } from '../../../core';\nimport { useValidup } from '@validup/vue';\nimport type { PropType } from 'vue';\nimport {\n    computed,\n    defineComponent,\n    reactive,\n    ref,\n    useId,\n    watch,\n} from 'vue';\nimport { VCFormGroup, VCFormInput, VCFormSwitch } from '@vuecs/forms';\nimport { useIsEditing, useUpdatedAt } from '../../../composables';\nimport {\n    AFormSubmit,\n    ANameInput,\n    AToggleButton,\n    defineEntityManager,\n    defineEntityVEmitOptions,\n} from '../../utility';\nimport { ARealms } from '../realm';\nimport { IFieldValidation } from '@ilingo/validup-vue';\n\n// `User` carries an extra-attributes index signature, and @validup/vue's\n// FieldsAccessor collapses to that signature instead of keeping the declared\n// keys, so every `v.fields.<key>` degrades to `FieldState<any> | undefined`\n// (tada5hi/validup#455). Pinning the composable to an index-signature-free\n// projection restores typed field access.\ntype UserFormState = Pick<User, 'active' | 'name' | 'nameLocked' | 'displayName' | 'email' | 'emailVerified' | 'realmId'>;\n\nexport default defineComponent({\n    components: {\n        ARealms,\n        AFormSubmit,\n        ANameInput,\n        AToggleButton,\n        VCFormGroup,\n        VCFormInput,\n        VCFormSwitch,\n\n        IFieldValidation,\n    },\n    props: {\n        entity: {\n            type: Object as PropType<User | null>,\n            default: undefined,\n        },\n        realmId: {\n            type: String as PropType<string | null>,\n            default: undefined,\n        },\n        canManage: {\n            type: Boolean,\n            default: true,\n        },\n    },\n    emits: defineEntityVEmitOptions<User>(),\n    setup(props, ctx) {\n        const busy = ref(false);\n        const nameSeed = useId();\n        const form = reactive<UserFormState>({\n            active: true,\n            name: '',\n            nameLocked: false,\n            displayName: '',\n            email: '',\n            emailVerified: false,\n            realmId: '',\n        });\n\n        const manager = defineEntityManager({\n            type: EntityType.USER,\n            setup: ctx,\n            props,\n        });\n\n        const isEditing = useIsEditing(manager.data);\n\n        const v = useValidup<UserFormState>(\n            new UserValidator(),\n            form,\n            { group: computed(() => (isEditing.value ? ValidatorGroup.UPDATE : ValidatorGroup.CREATE)) },\n        );\n\n        const updatedAt = useUpdatedAt(() => props.entity);\n\n        const isRealmLocked = computed(() => !!props.realmId);\n\n        // A user keeps the realm it was created in, so the picker is a\n        // create-time control only (see the realm-immutability rule in\n        // .agents/architecture.md). The API mounts realmId for CREATE alone,\n        // and the junction rows plus every per-user child table denormalize\n        // it, so offering the picker on an existing record would promise a\n        // move the server can not perform.\n        const showRealmPicker = computed(() => props.canManage &&\n            !isRealmLocked.value &&\n            !isEditing.value);\n\n        function initForm() {\n            if (\n                !!manager.data.value &&\n                typeof manager.data.value.nameLocked !== 'undefined'\n            ) {\n                form.nameLocked = manager.data.value.nameLocked;\n            }\n\n            assignFormProperties(form, manager.data.value, { fields: v.fields });\n\n            if (form.name.length === 0) {\n                form.name = generateName(nameSeed);\n\n                if (!form.email || isUserFakeEmail(form.email)) {\n                    form.email = buildUserFakeEmail(form.name);\n                }\n            }\n\n            // Locked-realm prop wins over any realmId pulled from the\n            // loaded entity — apply after assign.\n            if (props.realmId) {\n                form.realmId = props.realmId;\n            }\n        }\n\n        watch(updatedAt, (val, oldVal) => {\n            if (!val || val === oldVal) {\n                return;\n            }\n\n            manager.data.value = props.entity ?? undefined;\n            initForm();\n        });\n\n        initForm();\n\n        const submit = async () => {\n            if (busy.value || v.$invalid.value) {\n                return;\n            }\n\n            busy.value = true;\n            try {\n                // The admin-only keys have to be gated on the PAYLOAD, not only\n                // in the template: a self-edit is evaluated against the\n                // `system.user-names-self-manage` denylist, which denies on key\n                // presence rather than on a changed value, so posting them at\n                // their unchanged values rejects the whole save.\n                await manager.createOrUpdate(\n                    props.canManage ?\n                        form :\n                        omitRecord({ ...form }, ['active', 'nameLocked', 'emailVerified']),\n                );\n            } finally {\n                busy.value = false;\n            }\n        };\n\n        const onNameChange = (input: string) => {\n            v.fields.name.$model.value = input;\n\n            const currentEmail = v.fields.email.$model.value as string;\n            if (!currentEmail || isUserFakeEmail(currentEmail)) {\n                v.fields.email.$model.value = buildUserFakeEmail(input);\n            }\n        };\n\n        const translationsDefault = useTranslations(\n            [\n                {\n                    namespace: TranslatorTranslationNamespace.COMMON, \n                    key: TranslatorTranslationCommonKey.ACTIVE, \n                },\n                {\n                    namespace: TranslatorTranslationNamespace.COMMON, \n                    key: TranslatorTranslationCommonKey.INACTIVE, \n                },\n                {\n                    namespace: TranslatorTranslationNamespace.FIELD, \n                    key: TranslatorTranslationFieldKey.DISPLAY_NAME, \n                },\n                {\n                    namespace: TranslatorTranslationNamespace.FIELD, \n                    key: TranslatorTranslationFieldKey.EMAIL, \n                },\n                {\n                    namespace: TranslatorTranslationNamespace.COMMON, \n                    key: TranslatorTranslationCommonKey.LOCKED, \n                },\n                {\n                    namespace: TranslatorTranslationNamespace.COMMON, \n                    key: TranslatorTranslationCommonKey.NOT_LOCKED, \n                },\n                {\n                    namespace: TranslatorTranslationNamespace.COMMON,\n                    key: TranslatorTranslationCommonKey.EMAIL_VERIFIED,\n                },\n                {\n                    namespace: TranslatorTranslationNamespace.COMMON,\n                    key: TranslatorTranslationCommonKey.EMAIL_NOT_VERIFIED,\n                },\n                {\n                    namespace: TranslatorTranslationNamespace.FIELD, \n                    key: TranslatorTranslationFieldKey.NAME, \n                },\n                {\n                    namespace: TranslatorTranslationNamespace.FIELD, \n                    key: TranslatorTranslationFieldKey.DESCRIPTION, \n                },\n            ],\n        );\n\n        return {\n            busy,\n            form,\n            v,\n            isEditing,\n            showRealmPicker,\n            translationsDefault,\n            onNameChange,\n            submit,\n        };\n    },\n});\n\n</script>\n\n<template>\n    <form @submit.prevent=\"submit\">\n        <div :class=\"showRealmPicker ? 'grid grid-cols-1 md:grid-cols-2 gap-2' : ''\">\n            <div>\n                <IFieldValidation\n                    v-slot=\"{ value }\"\n                    :field=\"v.fields.name\"\n                >\n                    <VCFormGroup :validation=\"value\">\n                        <template #label>\n                            {{ translationsDefault.name }}\n                        </template>\n                        <ANameInput\n                            :model-value=\"v.fields.name.$model.value\"\n                            :disabled=\"form.nameLocked\"\n                            @update:model-value=\"onNameChange\"\n                        />\n                    </VCFormGroup>\n                </IFieldValidation>\n\n                <IFieldValidation\n                    v-slot=\"{ value }\"\n                    :field=\"v.fields.displayName\"\n                >\n                    <VCFormGroup :validation=\"value\">\n                        <template #label>\n                            {{ translationsDefault.displayName }}\n                        </template>\n                        <VCFormInput\n                            :model-value=\"v.fields.displayName.$model.value ?? ''\"\n                            @update:model-value=\"(next: string) => { v.fields.displayName.$model.value = next; }\"\n                        />\n                    </VCFormGroup>\n                </IFieldValidation>\n\n                <IFieldValidation\n                    v-slot=\"{ value }\"\n                    :field=\"v.fields.email\"\n                >\n                    <VCFormGroup :validation=\"value\">\n                        <template #label>\n                            {{ translationsDefault.email }}\n                        </template>\n                        <VCFormInput\n                            v-model=\"v.fields.email.$model.value\"\n                            type=\"email\"\n                            placeholder=\"...@...\"\n                        />\n                    </VCFormGroup>\n                </IFieldValidation>\n\n                <template v-if=\"$props.canManage\">\n                    <div class=\"flex flex-wrap -mx-2\">\n                        <div class=\"flex-1 basis-0 px-2\">\n                            <VCFormSwitch\n                                v-model=\"form.active\"\n                                :label=\"true\"\n                            >\n                                <template #label=\"{ id, class: labelClass }\">\n                                    <label\n                                        :for=\"id\"\n                                        :class=\"[labelClass, form.active ? 'text-success-600' : 'text-error-600']\"\n                                    >\n                                        {{ form.active ? translationsDefault.active : translationsDefault.inactive }}\n                                    </label>\n                                </template>\n                            </VCFormSwitch>\n                        </div>\n                        <div\n                            v-if=\"$props.entity\"\n                            class=\"flex-1 basis-0 px-2\"\n                        >\n                            <VCFormSwitch\n                                v-model=\"form.nameLocked\"\n                                :label=\"true\"\n                            >\n                                <template #label=\"{ id, class: labelClass }\">\n                                    <label\n                                        :for=\"id\"\n                                        :class=\"[labelClass, form.nameLocked ? 'text-success-600' : 'text-warning-600']\"\n                                    >\n                                        {{ form.nameLocked ? translationsDefault.locked : translationsDefault.notLocked }}\n                                    </label>\n                                </template>\n                            </VCFormSwitch>\n                        </div>\n                        <div class=\"flex-1 basis-0 px-2\">\n                            <VCFormSwitch\n                                v-model=\"form.emailVerified\"\n                                :label=\"true\"\n                            >\n                                <template #label=\"{ id, class: labelClass }\">\n                                    <label\n                                        :for=\"id\"\n                                        :class=\"[labelClass, form.emailVerified ? 'text-success-600' : 'text-warning-600']\"\n                                    >\n                                        {{ form.emailVerified ? translationsDefault.emailVerified : translationsDefault.emailNotVerified }}\n                                    </label>\n                                </template>\n                            </VCFormSwitch>\n                        </div>\n                    </div>\n                </template>\n\n                <AFormSubmit\n                    :is-busy=\"busy\"\n                    :is-editing=\"isEditing\"\n                    :is-invalid=\"v.$invalid.value\"\n                    @submit=\"submit\"\n                />\n            </div>\n\n            <div v-if=\"showRealmPicker\">\n                <ARealms>\n                    <template #itemActions=\"pickerProps\">\n                        <AToggleButton\n                            :value=\"form.realmId === pickerProps.data.id\"\n                            :is-busy=\"pickerProps.busy\"\n                            @changed=\"(value: boolean) => { v.fields.realmId.$model.value = value ? pickerProps.data.id : ''; }\"\n                        />\n                    </template>\n                </ARealms>\n            </div>\n        </div>\n    </form>\n</template>\n","<!--\n  - Copyright (c) 2022-2026.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\nimport type { User } from '@authup/core-kit';\nimport { \n    EntityType, \n    UserValidator, \n    buildUserFakeEmail, \n    isUserFakeEmail, \n} from '@authup/core-kit';\nimport { ValidatorGroup, generateName, omitRecord } from '@authup/kit';\nimport { TranslatorTranslationCommonKey, TranslatorTranslationFieldKey, TranslatorTranslationNamespace } from '@authup/i18n';\nimport { assignFormProperties, useTranslations } from '../../../core';\nimport { useValidup } from '@validup/vue';\nimport type { PropType } from 'vue';\nimport {\n    computed,\n    defineComponent,\n    reactive,\n    ref,\n    useId,\n    watch,\n} from 'vue';\nimport { VCFormGroup, VCFormInput, VCFormSwitch } from '@vuecs/forms';\nimport { useIsEditing, useUpdatedAt } from '../../../composables';\nimport {\n    AFormSubmit,\n    ANameInput,\n    AToggleButton,\n    defineEntityManager,\n    defineEntityVEmitOptions,\n} from '../../utility';\nimport { ARealms } from '../realm';\nimport { IFieldValidation } from '@ilingo/validup-vue';\n\n// `User` carries an extra-attributes index signature, and @validup/vue's\n// FieldsAccessor collapses to that signature instead of keeping the declared\n// keys, so every `v.fields.<key>` degrades to `FieldState<any> | undefined`\n// (tada5hi/validup#455). Pinning the composable to an index-signature-free\n// projection restores typed field access.\ntype UserFormState = Pick<User, 'active' | 'name' | 'nameLocked' | 'displayName' | 'email' | 'emailVerified' | 'realmId'>;\n\nexport default defineComponent({\n    components: {\n        ARealms,\n        AFormSubmit,\n        ANameInput,\n        AToggleButton,\n        VCFormGroup,\n        VCFormInput,\n        VCFormSwitch,\n\n        IFieldValidation,\n    },\n    props: {\n        entity: {\n            type: Object as PropType<User | null>,\n            default: undefined,\n        },\n        realmId: {\n            type: String as PropType<string | null>,\n            default: undefined,\n        },\n        canManage: {\n            type: Boolean,\n            default: true,\n        },\n    },\n    emits: defineEntityVEmitOptions<User>(),\n    setup(props, ctx) {\n        const busy = ref(false);\n        const nameSeed = useId();\n        const form = reactive<UserFormState>({\n            active: true,\n            name: '',\n            nameLocked: false,\n            displayName: '',\n            email: '',\n            emailVerified: false,\n            realmId: '',\n        });\n\n        const manager = defineEntityManager({\n            type: EntityType.USER,\n            setup: ctx,\n            props,\n        });\n\n        const isEditing = useIsEditing(manager.data);\n\n        const v = useValidup<UserFormState>(\n            new UserValidator(),\n            form,\n            { group: computed(() => (isEditing.value ? ValidatorGroup.UPDATE : ValidatorGroup.CREATE)) },\n        );\n\n        const updatedAt = useUpdatedAt(() => props.entity);\n\n        const isRealmLocked = computed(() => !!props.realmId);\n\n        // A user keeps the realm it was created in, so the picker is a\n        // create-time control only (see the realm-immutability rule in\n        // .agents/architecture.md). The API mounts realmId for CREATE alone,\n        // and the junction rows plus every per-user child table denormalize\n        // it, so offering the picker on an existing record would promise a\n        // move the server can not perform.\n        const showRealmPicker = computed(() => props.canManage &&\n            !isRealmLocked.value &&\n            !isEditing.value);\n\n        function initForm() {\n            if (\n                !!manager.data.value &&\n                typeof manager.data.value.nameLocked !== 'undefined'\n            ) {\n                form.nameLocked = manager.data.value.nameLocked;\n            }\n\n            assignFormProperties(form, manager.data.value, { fields: v.fields });\n\n            if (form.name.length === 0) {\n                form.name = generateName(nameSeed);\n\n                if (!form.email || isUserFakeEmail(form.email)) {\n                    form.email = buildUserFakeEmail(form.name);\n                }\n            }\n\n            // Locked-realm prop wins over any realmId pulled from the\n            // loaded entity — apply after assign.\n            if (props.realmId) {\n                form.realmId = props.realmId;\n            }\n        }\n\n        watch(updatedAt, (val, oldVal) => {\n            if (!val || val === oldVal) {\n                return;\n            }\n\n            manager.data.value = props.entity ?? undefined;\n            initForm();\n        });\n\n        initForm();\n\n        const submit = async () => {\n            if (busy.value || v.$invalid.value) {\n                return;\n            }\n\n            busy.value = true;\n            try {\n                // The admin-only keys have to be gated on the PAYLOAD, not only\n                // in the template: a self-edit is evaluated against the\n                // `system.user-names-self-manage` denylist, which denies on key\n                // presence rather than on a changed value, so posting them at\n                // their unchanged values rejects the whole save.\n                await manager.createOrUpdate(\n                    props.canManage ?\n                        form :\n                        omitRecord({ ...form }, ['active', 'nameLocked', 'emailVerified']),\n                );\n            } finally {\n                busy.value = false;\n            }\n        };\n\n        const onNameChange = (input: string) => {\n            v.fields.name.$model.value = input;\n\n            const currentEmail = v.fields.email.$model.value as string;\n            if (!currentEmail || isUserFakeEmail(currentEmail)) {\n                v.fields.email.$model.value = buildUserFakeEmail(input);\n            }\n        };\n\n        const translationsDefault = useTranslations(\n            [\n                {\n                    namespace: TranslatorTranslationNamespace.COMMON, \n                    key: TranslatorTranslationCommonKey.ACTIVE, \n                },\n                {\n                    namespace: TranslatorTranslationNamespace.COMMON, \n                    key: TranslatorTranslationCommonKey.INACTIVE, \n                },\n                {\n                    namespace: TranslatorTranslationNamespace.FIELD, \n                    key: TranslatorTranslationFieldKey.DISPLAY_NAME, \n                },\n                {\n                    namespace: TranslatorTranslationNamespace.FIELD, \n                    key: TranslatorTranslationFieldKey.EMAIL, \n                },\n                {\n                    namespace: TranslatorTranslationNamespace.COMMON, \n                    key: TranslatorTranslationCommonKey.LOCKED, \n                },\n                {\n                    namespace: TranslatorTranslationNamespace.COMMON, \n                    key: TranslatorTranslationCommonKey.NOT_LOCKED, \n                },\n                {\n                    namespace: TranslatorTranslationNamespace.COMMON,\n                    key: TranslatorTranslationCommonKey.EMAIL_VERIFIED,\n                },\n                {\n                    namespace: TranslatorTranslationNamespace.COMMON,\n                    key: TranslatorTranslationCommonKey.EMAIL_NOT_VERIFIED,\n                },\n                {\n                    namespace: TranslatorTranslationNamespace.FIELD, \n                    key: TranslatorTranslationFieldKey.NAME, \n                },\n                {\n                    namespace: TranslatorTranslationNamespace.FIELD, \n                    key: TranslatorTranslationFieldKey.DESCRIPTION, \n                },\n            ],\n        );\n\n        return {\n            busy,\n            form,\n            v,\n            isEditing,\n            showRealmPicker,\n            translationsDefault,\n            onNameChange,\n            submit,\n        };\n    },\n});\n\n</script>\n\n<template>\n    <form @submit.prevent=\"submit\">\n        <div :class=\"showRealmPicker ? 'grid grid-cols-1 md:grid-cols-2 gap-2' : ''\">\n            <div>\n                <IFieldValidation\n                    v-slot=\"{ value }\"\n                    :field=\"v.fields.name\"\n                >\n                    <VCFormGroup :validation=\"value\">\n                        <template #label>\n                            {{ translationsDefault.name }}\n                        </template>\n                        <ANameInput\n                            :model-value=\"v.fields.name.$model.value\"\n                            :disabled=\"form.nameLocked\"\n                            @update:model-value=\"onNameChange\"\n                        />\n                    </VCFormGroup>\n                </IFieldValidation>\n\n                <IFieldValidation\n                    v-slot=\"{ value }\"\n                    :field=\"v.fields.displayName\"\n                >\n                    <VCFormGroup :validation=\"value\">\n                        <template #label>\n                            {{ translationsDefault.displayName }}\n                        </template>\n                        <VCFormInput\n                            :model-value=\"v.fields.displayName.$model.value ?? ''\"\n                            @update:model-value=\"(next: string) => { v.fields.displayName.$model.value = next; }\"\n                        />\n                    </VCFormGroup>\n                </IFieldValidation>\n\n                <IFieldValidation\n                    v-slot=\"{ value }\"\n                    :field=\"v.fields.email\"\n                >\n                    <VCFormGroup :validation=\"value\">\n                        <template #label>\n                            {{ translationsDefault.email }}\n                        </template>\n                        <VCFormInput\n                            v-model=\"v.fields.email.$model.value\"\n                            type=\"email\"\n                            placeholder=\"...@...\"\n                        />\n                    </VCFormGroup>\n                </IFieldValidation>\n\n                <template v-if=\"$props.canManage\">\n                    <div class=\"flex flex-wrap -mx-2\">\n                        <div class=\"flex-1 basis-0 px-2\">\n                            <VCFormSwitch\n                                v-model=\"form.active\"\n                                :label=\"true\"\n                            >\n                                <template #label=\"{ id, class: labelClass }\">\n                                    <label\n                                        :for=\"id\"\n                                        :class=\"[labelClass, form.active ? 'text-success-600' : 'text-error-600']\"\n                                    >\n                                        {{ form.active ? translationsDefault.active : translationsDefault.inactive }}\n                                    </label>\n                                </template>\n                            </VCFormSwitch>\n                        </div>\n                        <div\n                            v-if=\"$props.entity\"\n                            class=\"flex-1 basis-0 px-2\"\n                        >\n                            <VCFormSwitch\n                                v-model=\"form.nameLocked\"\n                                :label=\"true\"\n                            >\n                                <template #label=\"{ id, class: labelClass }\">\n                                    <label\n                                        :for=\"id\"\n                                        :class=\"[labelClass, form.nameLocked ? 'text-success-600' : 'text-warning-600']\"\n                                    >\n                                        {{ form.nameLocked ? translationsDefault.locked : translationsDefault.notLocked }}\n                                    </label>\n                                </template>\n                            </VCFormSwitch>\n                        </div>\n                        <div class=\"flex-1 basis-0 px-2\">\n                            <VCFormSwitch\n                                v-model=\"form.emailVerified\"\n                                :label=\"true\"\n                            >\n                                <template #label=\"{ id, class: labelClass }\">\n                                    <label\n                                        :for=\"id\"\n                                        :class=\"[labelClass, form.emailVerified ? 'text-success-600' : 'text-warning-600']\"\n                                    >\n                                        {{ form.emailVerified ? translationsDefault.emailVerified : translationsDefault.emailNotVerified }}\n                                    </label>\n                                </template>\n                            </VCFormSwitch>\n                        </div>\n                    </div>\n                </template>\n\n                <AFormSubmit\n                    :is-busy=\"busy\"\n                    :is-editing=\"isEditing\"\n                    :is-invalid=\"v.$invalid.value\"\n                    @submit=\"submit\"\n                />\n            </div>\n\n            <div v-if=\"showRealmPicker\">\n                <ARealms>\n                    <template #itemActions=\"pickerProps\">\n                        <AToggleButton\n                            :value=\"form.realmId === pickerProps.data.id\"\n                            :is-busy=\"pickerProps.busy\"\n                            @changed=\"(value: boolean) => { v.fields.realmId.$model.value = value ? pickerProps.data.id : ''; }\"\n                        />\n                    </template>\n                </ARealms>\n            </div>\n        </div>\n    </form>\n</template>\n","/*\n * Copyright (c) 2022.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { EntityType } from '@authup/core-kit';\nimport type { SlotsType } from 'vue';\nimport { defineComponent } from 'vue';\nimport type { User } from '@authup/core-kit';\nimport type { EntityCollectionVSlots } from '../../utility';\nimport { TranslatorTranslationEntityKey, TranslatorTranslationNamespace, TranslatorTranslationVuecsKey } from '@authup/i18n';\nimport { useTranslation } from '../../../core';\nimport {\n    defineEntityCollectionManager,\n    defineEntityCollectionVEmitOptions,\n    defineEntityCollectionVProps,\n} from '../../utility';\n\nexport const AUsers = defineComponent({\n    props: defineEntityCollectionVProps<User>(),\n    emits: defineEntityCollectionVEmitOptions<User>(),\n    slots: Object as SlotsType<EntityCollectionVSlots<User>>,\n    setup(props, ctx) {\n        const { render } = defineEntityCollectionManager({\n            type: `${EntityType.USER}`,\n            props,\n            setup: ctx,\n        });\n\n        const translationName = useTranslation({\n            namespace: TranslatorTranslationNamespace.ENTITY,\n            key: TranslatorTranslationEntityKey.USER,\n            count: 2,\n        });\n\n        const translation = useTranslation({\n            namespace: TranslatorTranslationNamespace.VUECS,\n            key: TranslatorTranslationVuecsKey.NO_MORE,\n            data: { name: translationName },\n        });\n\n        return () => render({ noMore: { content: translation.value } });\n    },\n});\n\nexport default AUsers;\n","<!--\n  - Copyright (c) 2022-2026.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\nimport {\n    defineComponent,\n    reactive,\n    ref,\n} from 'vue';\nimport type { PropType } from 'vue';\nimport { VCFormGroup, VCFormInput, VCFormSwitch } from '@vuecs/forms';\nimport { useValidup } from '@validup/vue';\nimport {\n    TranslatorTranslationActionKey,\n    TranslatorTranslationClientKey,\n    TranslatorTranslationFieldKey,\n    TranslatorTranslationNamespace,\n} from '@authup/i18n';\nimport { injectHTTPClient, useTranslations, wrapFnWithBusyState } from '../../../core';\nimport { createValidator } from '@validup/zod';\nimport {\n    Container,\n    ValidupError,\n} from 'validup';\nimport type { Validator } from 'validup';\nimport { defineIssueItem } from '@ebec/core';\nimport { z } from 'zod';\nimport { AFormSubmit } from '../../utility';\nimport { IFieldValidation } from '@ilingo/validup-vue';\n\n// Cross-field equality between `password` and `passwordRepeat` — runs\n// as a second mount on `passwordRepeat` so the first mount's length\n// validator surfaces its own message independently.\nconst createSameAsPassword = (message: () => string): Validator => (ctx) => {\n    const { value } = ctx;\n    // If the value isn't a string at this point, the prior length\n    // validator already failed — defer to its issue rather than adding\n    // a confusing \"doesn't match\" alongside.\n    if (typeof value !== 'string') {\n        return value;\n    }\n    const { password } = ctx.data as { password?: unknown };\n    if (value !== password) {\n        // Bare-code path (defaults to `VALUE_INVALID`) + explicit\n        // message. Parameterized `SAME_AS` would surface the contract\n        // via `data: { other: 'password' }`, but `DefineIssueItemData`'s\n        // overload selection in validup 0.4 didn't accept the literal\n        // — bare-code + message gets the same end-user experience and\n        // sidesteps the type-juggling. validup's run loop prefixes the\n        // mount key on re-throw, so the issue lands under\n        // `passwordRepeat` in `$errors`.\n        const path: PropertyKey[] = [];\n        throw new ValidupError([defineIssueItem({\n            path,\n            message: message(),\n        })]);\n    }\n    return value;\n};\n\n// Inline validator — there's no `UserPasswordValidator` in core-kit;\n// `UserValidator` covers `password` for the entity-edit path. This\n// password-only form has its own length + match contract.\nclass UserPasswordValidator extends Container<{ password: string; passwordRepeat: string }> {\n    constructor(sameAsPassword: Validator) {\n        super();\n\n        // Two mounts on `passwordRepeat` — length first (from\n        // `initialize`), equality second. Container runs mounts in order;\n        // a failure in the first short-circuits the key, so consumers\n        // only see one issue at a time.\n        this.mount('passwordRepeat', sameAsPassword);\n    }\n\n    protected override initialize() {\n        super.initialize();\n\n        const passwordValidator = createValidator(z.string().min(5).max(100));\n        this.mount('password', passwordValidator);\n        this.mount('passwordRepeat', passwordValidator);\n    }\n}\n\nexport default defineComponent({\n    components: {\n        VCFormGroup,\n        VCFormInput,\n        VCFormSwitch,\n        AFormSubmit,\n\n        IFieldValidation,\n    },\n    props: {\n        id: {\n            type: String as PropType<string | null>,\n            default: undefined,\n        },\n    },\n    emits: ['created', 'deleted', 'updated', 'failed'],\n    setup(props, ctx) {\n        const apiClient = injectHTTPClient();\n        const busy = ref(false);\n        const form = reactive({\n            password: '',\n            passwordRepeat: '',\n        });\n\n        const passwordShow = ref(false);\n\n        const translations = useTranslations([\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.PASSWORD,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.PASSWORD_REPEAT,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.CLIENT,\n                key: TranslatorTranslationClientKey.PASSWORD_MUST_MATCH,\n            },\n        ]);\n\n        const actionTranslations = useTranslations([\n            {\n                namespace: TranslatorTranslationNamespace.ACTION,\n                key: TranslatorTranslationActionKey.SHOW,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.ACTION,\n                key: TranslatorTranslationActionKey.HIDE,\n            },\n        ]);\n\n        const v = useValidup(\n            new UserPasswordValidator(createSameAsPassword(() => translations.passwordMustMatch)),\n            form,\n        );\n\n        const submit = wrapFnWithBusyState(busy, async () => {\n            // `v.$invalid` already covers length + password-repeat match\n            // (the `sameAsPassword` validator above).\n            if (v.$invalid.value) return;\n            if (!props.id) return;\n\n            try {\n                const user = await apiClient.user.update(props.id, {\n                    password: form.password,\n                    passwordRepeat: form.passwordRepeat,\n                });\n\n                ctx.emit('updated', user.data);\n            } catch (e) {\n                if (e instanceof Error) {\n                    ctx.emit('failed', e);\n                }\n            }\n        });\n\n        return {\n            busy,\n            passwordShow,\n            translations,\n            actionTranslations,\n            v,\n            submit,\n        };\n    },\n});\n\n</script>\n\n<template>\n    <form\n        class=\"flex flex-col gap-3\"\n        @submit.prevent=\"submit\"\n    >\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"v.fields.password\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translations.password }}\n                </template>\n                <VCFormInput\n                    v-model=\"v.fields.password.$model.value\"\n                    :type=\"passwordShow ? 'text' : 'password'\"\n                    autocomplete=\"new-password\"\n                />\n            </VCFormGroup>\n        </IFieldValidation>\n\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"v.fields.passwordRepeat\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translations.passwordRepeat }}\n                </template>\n                <VCFormInput\n                    v-model=\"v.fields.passwordRepeat.$model.value\"\n                    :type=\"passwordShow ? 'text' : 'password'\"\n                    autocomplete=\"new-password\"\n                />\n            </VCFormGroup>\n        </IFieldValidation>\n\n        <div>\n            <VCFormSwitch\n                v-model=\"passwordShow\"\n                :label=\"true\"\n            >\n                <template #label=\"{ id, class: labelClass }\">\n                    <!-- Render `<label for=id>` ourselves so clicking the text\n                         toggles the switch (matches the implicit behavior of\n                         passing labelContent as a string prop, which the\n                         component wraps in <label for=id> internally). -->\n                    <label\n                        :for=\"id\"\n                        :class=\"labelClass\"\n                    >\n                        {{ translations.password }} {{ passwordShow ? actionTranslations.hide : actionTranslations.show }}\n                    </label>\n                </template>\n            </VCFormSwitch>\n        </div>\n\n        <div>\n            <AFormSubmit\n                :is-busy=\"busy\"\n                :is-editing=\"true\"\n                :is-invalid=\"v.$invalid.value\"\n                @submit=\"submit\"\n            />\n        </div>\n    </form>\n</template>\n","<!--\n  - Copyright (c) 2022-2026.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\nimport {\n    defineComponent,\n    reactive,\n    ref,\n} from 'vue';\nimport type { PropType } from 'vue';\nimport { VCFormGroup, VCFormInput, VCFormSwitch } from '@vuecs/forms';\nimport { useValidup } from '@validup/vue';\nimport {\n    TranslatorTranslationActionKey,\n    TranslatorTranslationClientKey,\n    TranslatorTranslationFieldKey,\n    TranslatorTranslationNamespace,\n} from '@authup/i18n';\nimport { injectHTTPClient, useTranslations, wrapFnWithBusyState } from '../../../core';\nimport { createValidator } from '@validup/zod';\nimport {\n    Container,\n    ValidupError,\n} from 'validup';\nimport type { Validator } from 'validup';\nimport { defineIssueItem } from '@ebec/core';\nimport { z } from 'zod';\nimport { AFormSubmit } from '../../utility';\nimport { IFieldValidation } from '@ilingo/validup-vue';\n\n// Cross-field equality between `password` and `passwordRepeat` — runs\n// as a second mount on `passwordRepeat` so the first mount's length\n// validator surfaces its own message independently.\nconst createSameAsPassword = (message: () => string): Validator => (ctx) => {\n    const { value } = ctx;\n    // If the value isn't a string at this point, the prior length\n    // validator already failed — defer to its issue rather than adding\n    // a confusing \"doesn't match\" alongside.\n    if (typeof value !== 'string') {\n        return value;\n    }\n    const { password } = ctx.data as { password?: unknown };\n    if (value !== password) {\n        // Bare-code path (defaults to `VALUE_INVALID`) + explicit\n        // message. Parameterized `SAME_AS` would surface the contract\n        // via `data: { other: 'password' }`, but `DefineIssueItemData`'s\n        // overload selection in validup 0.4 didn't accept the literal\n        // — bare-code + message gets the same end-user experience and\n        // sidesteps the type-juggling. validup's run loop prefixes the\n        // mount key on re-throw, so the issue lands under\n        // `passwordRepeat` in `$errors`.\n        const path: PropertyKey[] = [];\n        throw new ValidupError([defineIssueItem({\n            path,\n            message: message(),\n        })]);\n    }\n    return value;\n};\n\n// Inline validator — there's no `UserPasswordValidator` in core-kit;\n// `UserValidator` covers `password` for the entity-edit path. This\n// password-only form has its own length + match contract.\nclass UserPasswordValidator extends Container<{ password: string; passwordRepeat: string }> {\n    constructor(sameAsPassword: Validator) {\n        super();\n\n        // Two mounts on `passwordRepeat` — length first (from\n        // `initialize`), equality second. Container runs mounts in order;\n        // a failure in the first short-circuits the key, so consumers\n        // only see one issue at a time.\n        this.mount('passwordRepeat', sameAsPassword);\n    }\n\n    protected override initialize() {\n        super.initialize();\n\n        const passwordValidator = createValidator(z.string().min(5).max(100));\n        this.mount('password', passwordValidator);\n        this.mount('passwordRepeat', passwordValidator);\n    }\n}\n\nexport default defineComponent({\n    components: {\n        VCFormGroup,\n        VCFormInput,\n        VCFormSwitch,\n        AFormSubmit,\n\n        IFieldValidation,\n    },\n    props: {\n        id: {\n            type: String as PropType<string | null>,\n            default: undefined,\n        },\n    },\n    emits: ['created', 'deleted', 'updated', 'failed'],\n    setup(props, ctx) {\n        const apiClient = injectHTTPClient();\n        const busy = ref(false);\n        const form = reactive({\n            password: '',\n            passwordRepeat: '',\n        });\n\n        const passwordShow = ref(false);\n\n        const translations = useTranslations([\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.PASSWORD,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.PASSWORD_REPEAT,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.CLIENT,\n                key: TranslatorTranslationClientKey.PASSWORD_MUST_MATCH,\n            },\n        ]);\n\n        const actionTranslations = useTranslations([\n            {\n                namespace: TranslatorTranslationNamespace.ACTION,\n                key: TranslatorTranslationActionKey.SHOW,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.ACTION,\n                key: TranslatorTranslationActionKey.HIDE,\n            },\n        ]);\n\n        const v = useValidup(\n            new UserPasswordValidator(createSameAsPassword(() => translations.passwordMustMatch)),\n            form,\n        );\n\n        const submit = wrapFnWithBusyState(busy, async () => {\n            // `v.$invalid` already covers length + password-repeat match\n            // (the `sameAsPassword` validator above).\n            if (v.$invalid.value) return;\n            if (!props.id) return;\n\n            try {\n                const user = await apiClient.user.update(props.id, {\n                    password: form.password,\n                    passwordRepeat: form.passwordRepeat,\n                });\n\n                ctx.emit('updated', user.data);\n            } catch (e) {\n                if (e instanceof Error) {\n                    ctx.emit('failed', e);\n                }\n            }\n        });\n\n        return {\n            busy,\n            passwordShow,\n            translations,\n            actionTranslations,\n            v,\n            submit,\n        };\n    },\n});\n\n</script>\n\n<template>\n    <form\n        class=\"flex flex-col gap-3\"\n        @submit.prevent=\"submit\"\n    >\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"v.fields.password\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translations.password }}\n                </template>\n                <VCFormInput\n                    v-model=\"v.fields.password.$model.value\"\n                    :type=\"passwordShow ? 'text' : 'password'\"\n                    autocomplete=\"new-password\"\n                />\n            </VCFormGroup>\n        </IFieldValidation>\n\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"v.fields.passwordRepeat\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translations.passwordRepeat }}\n                </template>\n                <VCFormInput\n                    v-model=\"v.fields.passwordRepeat.$model.value\"\n                    :type=\"passwordShow ? 'text' : 'password'\"\n                    autocomplete=\"new-password\"\n                />\n            </VCFormGroup>\n        </IFieldValidation>\n\n        <div>\n            <VCFormSwitch\n                v-model=\"passwordShow\"\n                :label=\"true\"\n            >\n                <template #label=\"{ id, class: labelClass }\">\n                    <!-- Render `<label for=id>` ourselves so clicking the text\n                         toggles the switch (matches the implicit behavior of\n                         passing labelContent as a string prop, which the\n                         component wraps in <label for=id> internally). -->\n                    <label\n                        :for=\"id\"\n                        :class=\"labelClass\"\n                    >\n                        {{ translations.password }} {{ passwordShow ? actionTranslations.hide : actionTranslations.show }}\n                    </label>\n                </template>\n            </VCFormSwitch>\n        </div>\n\n        <div>\n            <AFormSubmit\n                :is-busy=\"busy\"\n                :is-editing=\"true\"\n                :is-invalid=\"v.$invalid.value\"\n                @submit=\"submit\"\n            />\n        </div>\n    </form>\n</template>\n","<!--\n  Copyright (c) 2022.\n  Author Peter Placzek (tada5hi)\n  For the full copyright and license information,\n  view the LICENSE file that was distributed with this source code.\n-->\n\n<script lang=\"ts\">\nimport { computed, defineComponent } from 'vue';\nimport { AUserPermissionAssignment } from '../user-permission';\nimport { AUsers } from '../user';\n\nexport default defineComponent({\n    components: { AUsers, AUserPermissionAssignment },\n    props: {\n        entityId: {\n            type: String,\n            required: true,\n        },\n    },\n    setup(props, { slots }) {\n        const forwardedSlots = computed(() => Object.fromEntries(Object.entries(slots).filter(([name]) => name !== 'itemActions')));\n        return { forwardedSlots };\n    },\n});\n</script>\n<template>\n    <AUsers>\n        <template #itemActions=\"{ data }\">\n            <AUserPermissionAssignment\n                :key=\"data.id\"\n                :permission-id=\"entityId\"\n                :user-id=\"data.id\"\n            />\n        </template>\n        <template\n            v-for=\"(_, name) in forwardedSlots\"\n            :key=\"name\"\n            #[name]=\"slotData\"\n        >\n            <slot\n                :name=\"name\"\n                v-bind=\"slotData ?? {}\"\n            />\n        </template>\n    </AUsers>\n</template>\n","<!--\n  Copyright (c) 2022.\n  Author Peter Placzek (tada5hi)\n  For the full copyright and license information,\n  view the LICENSE file that was distributed with this source code.\n-->\n\n<script lang=\"ts\">\nimport { computed, defineComponent } from 'vue';\nimport { AUserPermissionAssignment } from '../user-permission';\nimport { AUsers } from '../user';\n\nexport default defineComponent({\n    components: { AUsers, AUserPermissionAssignment },\n    props: {\n        entityId: {\n            type: String,\n            required: true,\n        },\n    },\n    setup(props, { slots }) {\n        const forwardedSlots = computed(() => Object.fromEntries(Object.entries(slots).filter(([name]) => name !== 'itemActions')));\n        return { forwardedSlots };\n    },\n});\n</script>\n<template>\n    <AUsers>\n        <template #itemActions=\"{ data }\">\n            <AUserPermissionAssignment\n                :key=\"data.id\"\n                :permission-id=\"entityId\"\n                :user-id=\"data.id\"\n            />\n        </template>\n        <template\n            v-for=\"(_, name) in forwardedSlots\"\n            :key=\"name\"\n            #[name]=\"slotData\"\n        >\n            <slot\n                :name=\"name\"\n                v-bind=\"slotData ?? {}\"\n            />\n        </template>\n    </AUsers>\n</template>\n","<!--\n  Copyright (c) 2022.\n  Author Peter Placzek (tada5hi)\n  For the full copyright and license information,\n  view the LICENSE file that was distributed with this source code.\n-->\n\n<script lang=\"ts\">\nimport { defineComponent } from 'vue';\nimport { AClients } from '../client';\nimport { AClientRoleAssignment } from '../client-role';\n\nexport default defineComponent({\n    components: { AClients, AClientRoleAssignment },\n    props: { entityId: { type: String, required: true } },\n});\n</script>\n<template>\n    <AClients>\n        <template #itemActions=\"{ data }\">\n            <AClientRoleAssignment\n                :key=\"data.id\"\n                :role-id=\"entityId\"\n                :client-id=\"data.id\"\n            />\n        </template>\n    </AClients>\n</template>\n","<!--\n  Copyright (c) 2022.\n  Author Peter Placzek (tada5hi)\n  For the full copyright and license information,\n  view the LICENSE file that was distributed with this source code.\n-->\n\n<script lang=\"ts\">\nimport { defineComponent } from 'vue';\nimport { AClients } from '../client';\nimport { AClientRoleAssignment } from '../client-role';\n\nexport default defineComponent({\n    components: { AClients, AClientRoleAssignment },\n    props: { entityId: { type: String, required: true } },\n});\n</script>\n<template>\n    <AClients>\n        <template #itemActions=\"{ data }\">\n            <AClientRoleAssignment\n                :key=\"data.id\"\n                :role-id=\"entityId\"\n                :client-id=\"data.id\"\n            />\n        </template>\n    </AClients>\n</template>\n","<!--\n  Copyright (c) 2022.\n  Author Peter Placzek (tada5hi)\n  For the full copyright and license information,\n  view the LICENSE file that was distributed with this source code.\n-->\n\n<script lang=\"ts\">\nimport { EntityType } from '@authup/core-kit';\nimport type { UserRole } from '@authup/core-kit';\nimport { defineComponent } from 'vue';\nimport {\n    defineEntityManager,\n    defineEntityVEmitOptions,\n} from '../../utility';\nimport AToggleButton from '../../utility/toggle-button/AToggleButton.vue';\n\nexport default defineComponent({\n    components: { AToggleButton },\n    props: {\n        roleId: { type: String, required: true },\n        userId: { type: String, required: true },\n    },\n    emits: defineEntityVEmitOptions<UserRole>(),\n    async setup(props, setup) {\n        const manager = defineEntityManager({\n            type: EntityType.USER_ROLE,\n            setup,\n            query: () => ({\n                filters: {\n                    userId: props.userId,\n                    roleId: props.roleId,\n                },\n            }),\n            socket: {\n                processEvent(event) {\n                    return event.data.roleId === props.roleId &&\n                        event.data.userId === props.userId;\n                },\n            },\n        });\n\n        await manager.resolve({\n            query: {\n                filters: {\n                    userId: props.userId,\n                    roleId: props.roleId,\n                },\n            },\n        });\n\n        const handleChanged = (value: boolean) => {\n            if (value) {\n                return manager.create({\n                    userId: props.userId,\n                    roleId: props.roleId,\n                });\n            }\n\n            return manager.delete();\n        };\n\n        return {\n            manager,\n            handleChanged,\n        };\n    },\n});\n</script>\n<template>\n    <AToggleButton\n        :value=\"!!manager.data.value\"\n        :is-busy=\"manager.busy.value\"\n        :with-prompt=\"true\"\n        @changed=\"handleChanged\"\n    />\n</template>\n","<!--\n  Copyright (c) 2022.\n  Author Peter Placzek (tada5hi)\n  For the full copyright and license information,\n  view the LICENSE file that was distributed with this source code.\n-->\n\n<script lang=\"ts\">\nimport { EntityType } from '@authup/core-kit';\nimport type { UserRole } from '@authup/core-kit';\nimport { defineComponent } from 'vue';\nimport {\n    defineEntityManager,\n    defineEntityVEmitOptions,\n} from '../../utility';\nimport AToggleButton from '../../utility/toggle-button/AToggleButton.vue';\n\nexport default defineComponent({\n    components: { AToggleButton },\n    props: {\n        roleId: { type: String, required: true },\n        userId: { type: String, required: true },\n    },\n    emits: defineEntityVEmitOptions<UserRole>(),\n    async setup(props, setup) {\n        const manager = defineEntityManager({\n            type: EntityType.USER_ROLE,\n            setup,\n            query: () => ({\n                filters: {\n                    userId: props.userId,\n                    roleId: props.roleId,\n                },\n            }),\n            socket: {\n                processEvent(event) {\n                    return event.data.roleId === props.roleId &&\n                        event.data.userId === props.userId;\n                },\n            },\n        });\n\n        await manager.resolve({\n            query: {\n                filters: {\n                    userId: props.userId,\n                    roleId: props.roleId,\n                },\n            },\n        });\n\n        const handleChanged = (value: boolean) => {\n            if (value) {\n                return manager.create({\n                    userId: props.userId,\n                    roleId: props.roleId,\n                });\n            }\n\n            return manager.delete();\n        };\n\n        return {\n            manager,\n            handleChanged,\n        };\n    },\n});\n</script>\n<template>\n    <AToggleButton\n        :value=\"!!manager.data.value\"\n        :is-busy=\"manager.busy.value\"\n        :with-prompt=\"true\"\n        @changed=\"handleChanged\"\n    />\n</template>\n","<!--\n  Copyright (c) 2022.\n  Author Peter Placzek (tada5hi)\n  For the full copyright and license information,\n  view the LICENSE file that was distributed with this source code.\n-->\n\n<script lang=\"ts\">\nimport { computed, defineComponent } from 'vue';\nimport { ARoles } from '../role';\nimport AUserRoleAssignment from './AUserRoleAssignment.vue';\n\nexport default defineComponent({\n    components: { ARoles, AUserRoleAssignment },\n    props: { entityId: { type: String, required: true } },\n    setup(props, { slots }) {\n        const forwardedSlots = computed(() => Object.fromEntries(Object.entries(slots).filter(([name]) => name !== 'itemActions')));\n        return { forwardedSlots };\n    },\n});\n</script>\n<template>\n    <ARoles>\n        <template #itemActions=\"{ data }\">\n            <AUserRoleAssignment\n                :key=\"data.id\"\n                :user-id=\"entityId\"\n                :role-id=\"data.id\"\n            />\n        </template>\n        <template\n            v-for=\"(_, name) in forwardedSlots\"\n            :key=\"name\"\n            #[name]=\"slotData\"\n        >\n            <slot\n                :name=\"name\"\n                v-bind=\"slotData ?? {}\"\n            />\n        </template>\n    </ARoles>\n</template>\n","<!--\n  Copyright (c) 2022.\n  Author Peter Placzek (tada5hi)\n  For the full copyright and license information,\n  view the LICENSE file that was distributed with this source code.\n-->\n\n<script lang=\"ts\">\nimport { computed, defineComponent } from 'vue';\nimport { ARoles } from '../role';\nimport AUserRoleAssignment from './AUserRoleAssignment.vue';\n\nexport default defineComponent({\n    components: { ARoles, AUserRoleAssignment },\n    props: { entityId: { type: String, required: true } },\n    setup(props, { slots }) {\n        const forwardedSlots = computed(() => Object.fromEntries(Object.entries(slots).filter(([name]) => name !== 'itemActions')));\n        return { forwardedSlots };\n    },\n});\n</script>\n<template>\n    <ARoles>\n        <template #itemActions=\"{ data }\">\n            <AUserRoleAssignment\n                :key=\"data.id\"\n                :user-id=\"entityId\"\n                :role-id=\"data.id\"\n            />\n        </template>\n        <template\n            v-for=\"(_, name) in forwardedSlots\"\n            :key=\"name\"\n            #[name]=\"slotData\"\n        >\n            <slot\n                :name=\"name\"\n                v-bind=\"slotData ?? {}\"\n            />\n        </template>\n    </ARoles>\n</template>\n","<!--\n  Copyright (c) 2022.\n  Author Peter Placzek (tada5hi)\n  For the full copyright and license information,\n  view the LICENSE file that was distributed with this source code.\n-->\n\n<script lang=\"ts\">\nimport { computed, defineComponent } from 'vue';\nimport { AUserRoleAssignment } from '../user-role';\nimport { AUsers } from '../user/AUsers';\n\nexport default defineComponent({\n    components: { AUsers, AUserRoleAssignment },\n    props: { entityId: { type: String, required: true } },\n    setup(props, { slots }) {\n        const forwardedSlots = computed(() => Object.fromEntries(Object.entries(slots).filter(([name]) => name !== 'itemActions')));\n        return { forwardedSlots };\n    },\n});\n</script>\n<template>\n    <AUsers>\n        <template #itemActions=\"{ data }\">\n            <AUserRoleAssignment\n                :key=\"data.id\"\n                :role-id=\"entityId\"\n                :user-id=\"data.id\"\n            />\n        </template>\n        <template\n            v-for=\"(_, name) in forwardedSlots\"\n            :key=\"name\"\n            #[name]=\"slotData\"\n        >\n            <slot\n                :name=\"name\"\n                v-bind=\"slotData ?? {}\"\n            />\n        </template>\n    </AUsers>\n</template>\n","<!--\n  Copyright (c) 2022.\n  Author Peter Placzek (tada5hi)\n  For the full copyright and license information,\n  view the LICENSE file that was distributed with this source code.\n-->\n\n<script lang=\"ts\">\nimport { computed, defineComponent } from 'vue';\nimport { AUserRoleAssignment } from '../user-role';\nimport { AUsers } from '../user/AUsers';\n\nexport default defineComponent({\n    components: { AUsers, AUserRoleAssignment },\n    props: { entityId: { type: String, required: true } },\n    setup(props, { slots }) {\n        const forwardedSlots = computed(() => Object.fromEntries(Object.entries(slots).filter(([name]) => name !== 'itemActions')));\n        return { forwardedSlots };\n    },\n});\n</script>\n<template>\n    <AUsers>\n        <template #itemActions=\"{ data }\">\n            <AUserRoleAssignment\n                :key=\"data.id\"\n                :role-id=\"entityId\"\n                :user-id=\"data.id\"\n            />\n        </template>\n        <template\n            v-for=\"(_, name) in forwardedSlots\"\n            :key=\"name\"\n            #[name]=\"slotData\"\n        >\n            <slot\n                :name=\"name\"\n                v-bind=\"slotData ?? {}\"\n            />\n        </template>\n    </AUsers>\n</template>\n","<!--\n  Copyright (c) 2022.\n  Author Peter Placzek (tada5hi)\n  For the full copyright and license information,\n  view the LICENSE file that was distributed with this source code.\n-->\n\n<script lang=\"ts\">\nimport { computed, defineComponent } from 'vue';\nimport { AClients } from '../client';\nimport { AClientScopeAssignment } from '../client-scope';\n\nexport default defineComponent({\n    components: { AClients, AClientScopeAssignment },\n    props: {\n        entityId: {\n            type: String,\n            required: true,\n        },\n    },\n    setup(props, { slots }) {\n        const forwardedSlots = computed(() => Object.fromEntries(Object.entries(slots).filter(([name]) => name !== 'itemActions')));\n        return { forwardedSlots };\n    },\n});\n</script>\n<template>\n    <AClients>\n        <template #itemActions=\"{ data }\">\n            <AClientScopeAssignment\n                :key=\"data.id\"\n                :scope-id=\"entityId\"\n                :client-id=\"data.id\"\n            />\n        </template>\n        <template\n            v-for=\"(_, name) in forwardedSlots\"\n            :key=\"name\"\n            #[name]=\"slotData\"\n        >\n            <slot\n                :name=\"name\"\n                v-bind=\"slotData ?? {}\"\n            />\n        </template>\n    </AClients>\n</template>\n","<!--\n  Copyright (c) 2022.\n  Author Peter Placzek (tada5hi)\n  For the full copyright and license information,\n  view the LICENSE file that was distributed with this source code.\n-->\n\n<script lang=\"ts\">\nimport { computed, defineComponent } from 'vue';\nimport { AClients } from '../client';\nimport { AClientScopeAssignment } from '../client-scope';\n\nexport default defineComponent({\n    components: { AClients, AClientScopeAssignment },\n    props: {\n        entityId: {\n            type: String,\n            required: true,\n        },\n    },\n    setup(props, { slots }) {\n        const forwardedSlots = computed(() => Object.fromEntries(Object.entries(slots).filter(([name]) => name !== 'itemActions')));\n        return { forwardedSlots };\n    },\n});\n</script>\n<template>\n    <AClients>\n        <template #itemActions=\"{ data }\">\n            <AClientScopeAssignment\n                :key=\"data.id\"\n                :scope-id=\"entityId\"\n                :client-id=\"data.id\"\n            />\n        </template>\n        <template\n            v-for=\"(_, name) in forwardedSlots\"\n            :key=\"name\"\n            #[name]=\"slotData\"\n        >\n            <slot\n                :name=\"name\"\n                v-bind=\"slotData ?? {}\"\n            />\n        </template>\n    </AClients>\n</template>\n","/*\n * Copyright (c) 2026.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { EntityType } from '@authup/core-kit';\nimport type { Session } from '@authup/core-kit';\nimport { TranslatorTranslationEntityKey, TranslatorTranslationNamespace, TranslatorTranslationVuecsKey } from '@authup/i18n';\nimport type { SlotsType } from 'vue';\nimport { defineComponent } from 'vue';\nimport { useTranslation } from '../../../core';\nimport type { EntityCollectionVSlots } from '../../utility';\nimport {\n    defineEntityCollectionManager,\n    defineEntityCollectionVEmitOptions,\n    defineEntityCollectionVProps,\n} from '../../utility';\n\nexport const ASessions = defineComponent({\n    props: defineEntityCollectionVProps<Session>(),\n    emits: defineEntityCollectionVEmitOptions<Session>(),\n    slots: Object as SlotsType<EntityCollectionVSlots<Session>>,\n    setup(props, ctx) {\n        const { render } = defineEntityCollectionManager({\n            type: `${EntityType.SESSION}`,\n            props,\n            setup: ctx,\n        });\n\n        const translationName = useTranslation({\n            namespace: TranslatorTranslationNamespace.ENTITY,\n            key: TranslatorTranslationEntityKey.SESSION,\n            count: 2,\n        });\n\n        const translation = useTranslation({\n            namespace: TranslatorTranslationNamespace.VUECS,\n            key: TranslatorTranslationVuecsKey.NO_MORE,\n            data: { name: translationName },\n        });\n\n        return () => render({ noMore: { content: translation.value } });\n    },\n});\n\nexport default ASessions;\n","/*\n * Copyright (c) 2026.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { EntityType } from '@authup/core-kit';\nimport type { SessionToken } from '@authup/core-kit';\nimport { TranslatorTranslationEntityKey, TranslatorTranslationNamespace, TranslatorTranslationVuecsKey } from '@authup/i18n';\nimport type { SlotsType } from 'vue';\nimport { defineComponent } from 'vue';\nimport { useTranslation } from '../../../core';\nimport type { EntityCollectionVSlots } from '../../utility';\nimport {\n    defineEntityCollectionManager,\n    defineEntityCollectionVEmitOptions,\n    defineEntityCollectionVProps,\n} from '../../utility';\n\nexport const ASessionTokens = defineComponent({\n    props: defineEntityCollectionVProps<SessionToken>(),\n    emits: defineEntityCollectionVEmitOptions<SessionToken>(),\n    slots: Object as SlotsType<EntityCollectionVSlots<SessionToken>>,\n    setup(props, ctx) {\n        const { render } = defineEntityCollectionManager({\n            type: `${EntityType.SESSION_TOKEN}`,\n            props,\n            setup: ctx,\n        });\n\n        const translationName = useTranslation({\n            namespace: TranslatorTranslationNamespace.ENTITY,\n            key: TranslatorTranslationEntityKey.SESSION_TOKEN,\n            count: 2,\n        });\n\n        const translation = useTranslation({\n            namespace: TranslatorTranslationNamespace.VUECS,\n            key: TranslatorTranslationVuecsKey.NO_MORE,\n            data: { name: translationName },\n        });\n\n        return () => render({ noMore: { content: translation.value } });\n    },\n});\n\nexport default ASessionTokens;\n","/*\n * Copyright (c) 2026.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport type { TrustAnchor } from '@authup/core-kit';\nimport { EntityType } from '@authup/core-kit';\nimport type { SlotsType } from 'vue';\nimport { defineComponent } from 'vue';\nimport type { EntityVSlots } from '../../utility';\nimport {\n    defineEntityManager,\n    defineEntityVEmitOptions,\n    defineEntityVProps,\n} from '../../utility';\n\nexport const ATrustAnchor = defineComponent({\n    props: defineEntityVProps<TrustAnchor>(),\n    emits: defineEntityVEmitOptions<TrustAnchor>(),\n    slots: Object as SlotsType<EntityVSlots<TrustAnchor>>,\n    async setup(props, setup) {\n        const manager = defineEntityManager({\n            type: `${EntityType.TRUST_ANCHOR}`,\n            props,\n            setup,\n        });\n\n        try {\n            await manager.resolveOrFail();\n\n            return () => manager.render();\n        } catch (e) {\n            return () => manager.renderError(e);\n        }\n    },\n});\n","/*\n * Copyright (c) 2026.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport type { TrustAnchor } from '@authup/core-kit';\nimport { EntityType } from '@authup/core-kit';\nimport {\n    TranslatorTranslationEntityKey,\n    TranslatorTranslationNamespace,\n    TranslatorTranslationVuecsKey,\n} from '@authup/i18n';\nimport type { SlotsType } from 'vue';\nimport { defineComponent } from 'vue';\nimport { useTranslation } from '../../../core';\nimport type { EntityCollectionVSlots } from '../../utility';\nimport {\n    defineEntityCollectionManager,\n    defineEntityCollectionVEmitOptions,\n    defineEntityCollectionVProps,\n} from '../../utility';\n\nexport const ATrustAnchors = defineComponent({\n    props: defineEntityCollectionVProps<TrustAnchor>(),\n    emits: defineEntityCollectionVEmitOptions<TrustAnchor>(),\n    slots: Object as SlotsType<EntityCollectionVSlots<TrustAnchor>>,\n    setup(props, ctx) {\n        const { render } = defineEntityCollectionManager({\n            type: `${EntityType.TRUST_ANCHOR}`,\n            props,\n            setup: ctx,\n        });\n\n        const translationName = useTranslation({\n            namespace: TranslatorTranslationNamespace.ENTITY,\n            key: TranslatorTranslationEntityKey.TRUST_ANCHOR,\n            count: 2,\n        });\n\n        const translation = useTranslation({\n            namespace: TranslatorTranslationNamespace.VUECS,\n            key: TranslatorTranslationVuecsKey.NO_MORE,\n            data: { name: translationName },\n        });\n\n        return () => render({ noMore: { content: translation.value } });\n    },\n});\n\nexport default ATrustAnchors;\n","<!--\n  - Copyright (c) 2026.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\nimport type { TrustAnchor } from '@authup/core-kit';\nimport { EntityType, TrustAnchorValidator } from '@authup/core-kit';\nimport {\n    TranslatorTranslationEntityKey,\n    TranslatorTranslationFieldKey,\n    TranslatorTranslationNamespace,\n} from '@authup/i18n';\nimport { ValidatorGroup, generateName } from '@authup/kit';\nimport { IFieldValidation } from '@ilingo/validup-vue';\nimport { useValidup } from '@validup/vue';\nimport {\n    VCFormGroup,\n    VCFormSwitch,\n    VCFormTextarea,\n} from '@vuecs/forms';\nimport type { PropType } from 'vue';\nimport {\n    computed,\n    defineComponent,\n    reactive,\n    ref,\n    useId,\n    watch,\n} from 'vue';\nimport {\n    assignFormProperties,\n    injectStore,\n    storeToRefs,\n    useTranslations,\n} from '../../../core';\nimport { useIsEditing, useUpdatedAt } from '../../../composables';\nimport {\n    AFormSubmit,\n    ANameInput,\n    defineEntityManager,\n    defineEntityVEmitOptions,\n} from '../../utility';\nimport { ARealmPicker } from '../realm';\n\nexport default defineComponent({\n    components: {\n        AFormSubmit,\n        ANameInput,\n        ARealmPicker,\n        IFieldValidation,\n        VCFormGroup,\n        VCFormSwitch,\n        VCFormTextarea,\n    },\n    props: {\n        entity: { type: Object as PropType<TrustAnchor> },\n        realmId: {\n            type: String,\n            default: undefined,\n        },\n    },\n    emits: defineEntityVEmitOptions<TrustAnchor>(),\n    setup(props, ctx) {\n        const busy = ref(false);\n        const nameSeed = useId();\n        const form = reactive({\n            name: '',\n            certificate: '',\n            enabled: true,\n            realmId: '',\n        });\n\n        const manager = defineEntityManager({\n            type: EntityType.TRUST_ANCHOR,\n            setup: ctx,\n            props,\n        });\n\n        const isEditing = useIsEditing(manager.data);\n        const v = useValidup(\n            new TrustAnchorValidator(),\n            form as Partial<TrustAnchor>,\n            { group: computed(() => (isEditing.value ? ValidatorGroup.UPDATE : ValidatorGroup.CREATE)) },\n        );\n\n        const store = injectStore();\n        const storeRefs = storeToRefs(store);\n        const realmLock = computed(() => {\n            if (props.realmId) {\n                return props.realmId;\n            }\n\n            if (!storeRefs.realmIsRoot.value) {\n                return storeRefs.realmId.value;\n            }\n\n            return manager.data.value ? manager.data.value.realmId : null;\n        });\n\n        const updatedAt = useUpdatedAt(() => props.entity);\n\n        function initForm() {\n            assignFormProperties(form, manager.data.value, { fields: v.fields });\n\n            if (props.realmId) {\n                form.realmId = props.realmId;\n            }\n\n            if (form.name.length === 0) {\n                form.name = generateName(nameSeed);\n            }\n        }\n\n        watch(updatedAt, (value, oldValue) => {\n            if (!value || value === oldValue) {\n                return;\n            }\n\n            manager.data.value = props.entity;\n            initForm();\n        });\n\n        initForm();\n\n        const submit = async () => {\n            if (busy.value || v.$invalid.value) {\n                return;\n            }\n\n            busy.value = true;\n            try {\n                if (isEditing.value) {\n                    await manager.createOrUpdate({\n                        name: form.name,\n                        enabled: form.enabled,\n                    });\n                    return;\n                }\n\n                await manager.createOrUpdate(form as Partial<TrustAnchor>);\n            } finally {\n                busy.value = false;\n            }\n        };\n\n        const translationsDefault = useTranslations([\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.NAME,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.CERTIFICATE,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.ENABLED,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.ENTITY,\n                key: TranslatorTranslationEntityKey.REALM,\n                count: 1,\n            },\n        ]);\n\n        return {\n            busy,\n            isEditing,\n            realmLock,\n            submit,\n            translationsDefault,\n            v,\n        };\n    },\n});\n</script>\n\n<template>\n    <form @submit.prevent=\"submit\">\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"v.fields.name\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translationsDefault.name }}\n                </template>\n                <ANameInput v-model=\"v.fields.name.$model.value\" />\n            </VCFormGroup>\n        </IFieldValidation>\n\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"v.fields.enabled\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <VCFormSwitch\n                    v-model=\"v.fields.enabled.$model.value\"\n                    :label=\"true\"\n                    :label-content=\"translationsDefault.enabled\"\n                />\n            </VCFormGroup>\n        </IFieldValidation>\n\n        <template v-if=\"!isEditing\">\n            <IFieldValidation\n                v-slot=\"{ value }\"\n                :field=\"v.fields.certificate\"\n            >\n                <VCFormGroup :validation=\"value\">\n                    <template #label>\n                        {{ translationsDefault.certificate }}\n                    </template>\n                    <VCFormTextarea\n                        :model-value=\"v.fields.certificate.$model.value\"\n                        :rows=\"12\"\n                        @update:model-value=\"(next: string) => { v.fields.certificate.$model.value = next; }\"\n                    />\n                </VCFormGroup>\n            </IFieldValidation>\n\n            <template v-if=\"!realmLock\">\n                <IFieldValidation\n                    v-slot=\"{ value }\"\n                    :field=\"v.fields.realmId\"\n                >\n                    <VCFormGroup :validation=\"value\">\n                        <template #label>\n                            {{ translationsDefault.realm }}\n                        </template>\n                        <ARealmPicker\n                            :value=\"v.fields.realmId.$model.value\"\n                            @change=\"(input: string[]) => {\n                                v.fields.realmId.$model.value = input.length > 0 ? input[0] ?? '' : '';\n                            }\"\n                        />\n                    </VCFormGroup>\n                </IFieldValidation>\n            </template>\n        </template>\n\n        <AFormSubmit\n            :is-busy=\"busy\"\n            :is-editing=\"isEditing\"\n            :is-invalid=\"v.$invalid.value\"\n            @submit=\"submit\"\n        />\n    </form>\n</template>\n","<!--\n  - Copyright (c) 2026.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\nimport type { TrustAnchor } from '@authup/core-kit';\nimport { EntityType, TrustAnchorValidator } from '@authup/core-kit';\nimport {\n    TranslatorTranslationEntityKey,\n    TranslatorTranslationFieldKey,\n    TranslatorTranslationNamespace,\n} from '@authup/i18n';\nimport { ValidatorGroup, generateName } from '@authup/kit';\nimport { IFieldValidation } from '@ilingo/validup-vue';\nimport { useValidup } from '@validup/vue';\nimport {\n    VCFormGroup,\n    VCFormSwitch,\n    VCFormTextarea,\n} from '@vuecs/forms';\nimport type { PropType } from 'vue';\nimport {\n    computed,\n    defineComponent,\n    reactive,\n    ref,\n    useId,\n    watch,\n} from 'vue';\nimport {\n    assignFormProperties,\n    injectStore,\n    storeToRefs,\n    useTranslations,\n} from '../../../core';\nimport { useIsEditing, useUpdatedAt } from '../../../composables';\nimport {\n    AFormSubmit,\n    ANameInput,\n    defineEntityManager,\n    defineEntityVEmitOptions,\n} from '../../utility';\nimport { ARealmPicker } from '../realm';\n\nexport default defineComponent({\n    components: {\n        AFormSubmit,\n        ANameInput,\n        ARealmPicker,\n        IFieldValidation,\n        VCFormGroup,\n        VCFormSwitch,\n        VCFormTextarea,\n    },\n    props: {\n        entity: { type: Object as PropType<TrustAnchor> },\n        realmId: {\n            type: String,\n            default: undefined,\n        },\n    },\n    emits: defineEntityVEmitOptions<TrustAnchor>(),\n    setup(props, ctx) {\n        const busy = ref(false);\n        const nameSeed = useId();\n        const form = reactive({\n            name: '',\n            certificate: '',\n            enabled: true,\n            realmId: '',\n        });\n\n        const manager = defineEntityManager({\n            type: EntityType.TRUST_ANCHOR,\n            setup: ctx,\n            props,\n        });\n\n        const isEditing = useIsEditing(manager.data);\n        const v = useValidup(\n            new TrustAnchorValidator(),\n            form as Partial<TrustAnchor>,\n            { group: computed(() => (isEditing.value ? ValidatorGroup.UPDATE : ValidatorGroup.CREATE)) },\n        );\n\n        const store = injectStore();\n        const storeRefs = storeToRefs(store);\n        const realmLock = computed(() => {\n            if (props.realmId) {\n                return props.realmId;\n            }\n\n            if (!storeRefs.realmIsRoot.value) {\n                return storeRefs.realmId.value;\n            }\n\n            return manager.data.value ? manager.data.value.realmId : null;\n        });\n\n        const updatedAt = useUpdatedAt(() => props.entity);\n\n        function initForm() {\n            assignFormProperties(form, manager.data.value, { fields: v.fields });\n\n            if (props.realmId) {\n                form.realmId = props.realmId;\n            }\n\n            if (form.name.length === 0) {\n                form.name = generateName(nameSeed);\n            }\n        }\n\n        watch(updatedAt, (value, oldValue) => {\n            if (!value || value === oldValue) {\n                return;\n            }\n\n            manager.data.value = props.entity;\n            initForm();\n        });\n\n        initForm();\n\n        const submit = async () => {\n            if (busy.value || v.$invalid.value) {\n                return;\n            }\n\n            busy.value = true;\n            try {\n                if (isEditing.value) {\n                    await manager.createOrUpdate({\n                        name: form.name,\n                        enabled: form.enabled,\n                    });\n                    return;\n                }\n\n                await manager.createOrUpdate(form as Partial<TrustAnchor>);\n            } finally {\n                busy.value = false;\n            }\n        };\n\n        const translationsDefault = useTranslations([\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.NAME,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.CERTIFICATE,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.ENABLED,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.ENTITY,\n                key: TranslatorTranslationEntityKey.REALM,\n                count: 1,\n            },\n        ]);\n\n        return {\n            busy,\n            isEditing,\n            realmLock,\n            submit,\n            translationsDefault,\n            v,\n        };\n    },\n});\n</script>\n\n<template>\n    <form @submit.prevent=\"submit\">\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"v.fields.name\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <template #label>\n                    {{ translationsDefault.name }}\n                </template>\n                <ANameInput v-model=\"v.fields.name.$model.value\" />\n            </VCFormGroup>\n        </IFieldValidation>\n\n        <IFieldValidation\n            v-slot=\"{ value }\"\n            :field=\"v.fields.enabled\"\n        >\n            <VCFormGroup :validation=\"value\">\n                <VCFormSwitch\n                    v-model=\"v.fields.enabled.$model.value\"\n                    :label=\"true\"\n                    :label-content=\"translationsDefault.enabled\"\n                />\n            </VCFormGroup>\n        </IFieldValidation>\n\n        <template v-if=\"!isEditing\">\n            <IFieldValidation\n                v-slot=\"{ value }\"\n                :field=\"v.fields.certificate\"\n            >\n                <VCFormGroup :validation=\"value\">\n                    <template #label>\n                        {{ translationsDefault.certificate }}\n                    </template>\n                    <VCFormTextarea\n                        :model-value=\"v.fields.certificate.$model.value\"\n                        :rows=\"12\"\n                        @update:model-value=\"(next: string) => { v.fields.certificate.$model.value = next; }\"\n                    />\n                </VCFormGroup>\n            </IFieldValidation>\n\n            <template v-if=\"!realmLock\">\n                <IFieldValidation\n                    v-slot=\"{ value }\"\n                    :field=\"v.fields.realmId\"\n                >\n                    <VCFormGroup :validation=\"value\">\n                        <template #label>\n                            {{ translationsDefault.realm }}\n                        </template>\n                        <ARealmPicker\n                            :value=\"v.fields.realmId.$model.value\"\n                            @change=\"(input: string[]) => {\n                                v.fields.realmId.$model.value = input.length > 0 ? input[0] ?? '' : '';\n                            }\"\n                        />\n                    </VCFormGroup>\n                </IFieldValidation>\n            </template>\n        </template>\n\n        <AFormSubmit\n            :is-busy=\"busy\"\n            :is-editing=\"isEditing\"\n            :is-invalid=\"v.$invalid.value\"\n            @submit=\"submit\"\n        />\n    </form>\n</template>\n","/*\n * Copyright (c) 2026.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { UserAuthenticatorKind } from '@authup/core-kit';\n\nexport const USER_AUTHENTICATOR_KIND_ICONS : Record<`${UserAuthenticatorKind}`, string> = {\n    [UserAuthenticatorKind.TOTP]: 'fa6-solid:mobile-screen',\n    [UserAuthenticatorKind.WEBAUTHN]: 'fa6-solid:fingerprint',\n    [UserAuthenticatorKind.EMAIL]: 'fa6-solid:envelope',\n    [UserAuthenticatorKind.RECOVERY]: 'fa6-solid:life-ring',\n};\n","<!--\n  - Copyright (c) 2026.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\n/* global window */\nimport type { UserAuthenticator } from '@authup/core-kit';\nimport { UserAuthenticatorKind } from '@authup/core-kit';\nimport type { UserAuthenticatorEnrollResponse } from '@authup/core-http-kit';\nimport {\n    computed,\n    defineComponent,\n    ref,\n} from 'vue';\nimport {\n    TranslatorTranslationActionKey,\n    TranslatorTranslationClientKey,\n    TranslatorTranslationNamespace,\n} from '@authup/i18n';\nimport { startRegistration } from '@simplewebauthn/browser';\nimport type { PublicKeyCredentialCreationOptionsJSON } from '@simplewebauthn/browser';\nimport { VCButton } from '@vuecs/button';\nimport { VCAlert } from '@vuecs/elements';\nimport { VCFormGroup, VCFormInput } from '@vuecs/forms';\nimport { VCIcon } from '@vuecs/icon';\nimport { extractErrorContext, injectHTTPClient, useTranslations } from '../../../core';\nimport { USER_AUTHENTICATOR_KIND_ICONS } from './constants';\n\nexport default defineComponent({\n    components: {\n        VCButton,\n        VCAlert,\n        VCFormGroup,\n        VCFormInput,\n        VCIcon,\n    },\n    props: {\n        // resolves `@me` for the calling user; an admin passes a user id.\n        userId: {\n            type: String,\n            default: '@me',\n        },\n        // constrain enrollment to a single kind (inline authorize flow\n        // forces `totp`); omit to let the user pick.\n        kind: {\n            type: String,\n            default: null,\n        },\n    },\n    emits: ['done', 'failed', 'closed'],\n    setup(props, { emit }) {\n        const apiClient = injectHTTPClient();\n\n        const translations = useTranslations([\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.MFA_ENROLL_TITLE },\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.MFA_ENROLL_TOTP },\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.MFA_ENROLL_RECOVERY },\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.MFA_ENROLL_EMAIL },\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.MFA_ENROLL_WEBAUTHN },\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.MFA_SCAN_QR },\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.MFA_MANUAL_KEY },\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.MFA_CONFIRM_INTRO },\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.MFA_CONFIRM },\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.MFA_CODE },\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.MFA_RECOVERY_INTRO },\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.MFA_RECOVERY_SAVE },\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.MFA_DOWNLOAD },\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.MFA_SETUP_REQUIRED },\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.MFA_RECOVERY_NUDGE },\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.MFA_RECOVERY_NUDGE_GENERATE },\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.MFA_RECOVERY_NUDGE_SKIP },\n            { namespace: TranslatorTranslationNamespace.ACTION, key: TranslatorTranslationActionKey.ABORT },\n            { namespace: TranslatorTranslationNamespace.ACTION, key: TranslatorTranslationActionKey.CLOSE },\n        ]);\n\n        const busy = ref(false);\n        const error = ref<string | null>(null);\n\n        // enroll response (unconfirmed TOTP → show QR + confirm; recovery → show codes)\n        const enrollment = ref<UserAuthenticatorEnrollResponse | null>(null);\n        const enrollmentKind = ref<`${UserAuthenticatorKind}` | null>(null);\n        const confirmCode = ref('');\n\n        const forcedKind = computed<`${UserAuthenticatorKind}` | null>(\n            () => (props.kind as `${UserAuthenticatorKind}` | null),\n        );\n\n        // Only email can be provisioned FOR another user — totp/recovery/webauthn\n        // are owner-controlled (self-enrollment only) and the server rejects them\n        // on a non-self target, so an admin managing a different user is offered\n        // email alone (they reset the rest by deleting the user's devices).\n        const managingOther = computed<boolean>(() => props.userId !== '@me');\n        const canOfferKind = (kind: `${UserAuthenticatorKind}`): boolean => {\n            if (forcedKind.value && forcedKind.value !== kind) {\n                return false;\n            }\n            if (managingOther.value && kind !== UserAuthenticatorKind.EMAIL) {\n                return false;\n            }\n            return true;\n        };\n\n        const methods = computed(() => [\n            {\n                kind: UserAuthenticatorKind.TOTP,\n                icon: USER_AUTHENTICATOR_KIND_ICONS[UserAuthenticatorKind.TOTP],\n                label: translations.mfaEnrollTotp,\n            },\n            {\n                kind: UserAuthenticatorKind.WEBAUTHN,\n                icon: USER_AUTHENTICATOR_KIND_ICONS[UserAuthenticatorKind.WEBAUTHN],\n                label: translations.mfaEnrollWebauthn,\n            },\n            {\n                kind: UserAuthenticatorKind.EMAIL,\n                icon: USER_AUTHENTICATOR_KIND_ICONS[UserAuthenticatorKind.EMAIL],\n                label: translations.mfaEnrollEmail,\n            },\n            {\n                kind: UserAuthenticatorKind.RECOVERY,\n                icon: USER_AUTHENTICATOR_KIND_ICONS[UserAuthenticatorKind.RECOVERY],\n                label: translations.mfaEnrollRecovery,\n            },\n        ].filter((item) => canOfferKind(item.kind)));\n\n        const reset = () => {\n            enrollment.value = null;\n            enrollmentKind.value = null;\n            confirmCode.value = '';\n            error.value = null;\n        };\n\n        // Soft recovery-code nudge (issue #3242 follow-up): a just-enrolled\n        // email/webauthn factor without backup recovery codes leaves the\n        // account one lost mailbox / authenticator away from a locked-out\n        // login — offer (never force) generating codes before finishing.\n        // While set, it holds the enrolled entity whose `done` emit is\n        // DEFERRED until the nudge resolves (skip, or codes acknowledged) —\n        // the authorize ladder re-renders on `done`, which would otherwise\n        // unmount the nudge (and the displayed codes) immediately.\n        const recoveryNudge = ref<UserAuthenticator | null>(null);\n\n        const finishEnrollment = async (entity: UserAuthenticator, kind: `${UserAuthenticatorKind}`) => {\n            if (\n                managingOther.value ||\n                (\n                    kind !== UserAuthenticatorKind.EMAIL &&\n                    kind !== UserAuthenticatorKind.WEBAUTHN\n                )\n            ) {\n                emit('done', entity);\n                return;\n            }\n\n            try {\n                const { meta } = await apiClient.userAuthenticator.getMany(props.userId, {\n                    filters: { kind: UserAuthenticatorKind.RECOVERY },\n                    pagination: { limit: 1 },\n                });\n                if (meta.total > 0) {\n                    emit('done', entity);\n                    return;\n                }\n            } catch {\n                // fail open — never block a completed enrollment on the nudge\n                emit('done', entity);\n                return;\n            }\n\n            recoveryNudge.value = entity;\n        };\n\n        const skipRecoveryNudge = () => {\n            if (!recoveryNudge.value) {\n                return;\n            }\n\n            const entity = recoveryNudge.value;\n            recoveryNudge.value = null;\n            emit('done', entity);\n        };\n\n        const generateRecoveryCodes = async () => {\n            if (busy.value) {\n                return;\n            }\n\n            busy.value = true;\n            error.value = null;\n            try {\n                // deliberately NOT enroll(): the nudge defers every `done`\n                // until the codes were acknowledged (close), so the parent\n                // cannot re-render the shown-once codes away.\n                const response = await apiClient.userAuthenticator.enroll(props.userId, { kind: UserAuthenticatorKind.RECOVERY });\n\n                enrollment.value = response;\n                enrollmentKind.value = UserAuthenticatorKind.RECOVERY;\n            } catch (e) {\n                error.value = extractErrorContext(e).message ?? null;\n            } finally {\n                busy.value = false;\n            }\n        };\n\n        // terminal dismissal of the shown-once recovery codes — resolves a\n        // deferred nudge `done` and lets a host (modal, wizard step) tear\n        // the enrollment surface down via `closed`.\n        const closeRecoveryCodes = () => {\n            reset();\n\n            if (recoveryNudge.value) {\n                const entity = recoveryNudge.value;\n                recoveryNudge.value = null;\n                emit('done', entity);\n            }\n\n            emit('closed');\n        };\n\n        const enroll = async (kind: `${UserAuthenticatorKind}`) => {\n            if (busy.value) {\n                return;\n            }\n\n            busy.value = true;\n            error.value = null;\n            try {\n                const response = await apiClient.userAuthenticator.enroll(props.userId, { kind });\n\n                // webauthn: run the registration ceremony immediately and\n                // confirm with the attestation (no display).\n                if (kind === UserAuthenticatorKind.WEBAUTHN) {\n                    if (!response.meta.webauthn) {\n                        throw new Error('The server did not return WebAuthn registration options.');\n                    }\n                    // the http-kit response type is intentionally framework-agnostic\n                    // (Record<string, unknown>); assert the browser lib's shape here.\n                    const optionsJSON = response.meta.webauthn as unknown as PublicKeyCredentialCreationOptionsJSON;\n                    const attestation = await startRegistration({ optionsJSON });\n                    const confirmed = await apiClient.userAuthenticator.confirm(\n                        props.userId,\n                        response.data.id,\n                        { code: JSON.stringify(attestation) },\n                    );\n                    await finishEnrollment(confirmed.data, kind);\n                    return;\n                }\n\n                // email is confirmed on creation and has nothing to display —\n                // just signal completion (via the recovery nudge).\n                if (kind === UserAuthenticatorKind.EMAIL) {\n                    await finishEnrollment(response.data, kind);\n                    return;\n                }\n\n                enrollment.value = response;\n                enrollmentKind.value = kind;\n\n                // recovery is confirmed on creation — the codes are shown once\n                if (kind === UserAuthenticatorKind.RECOVERY) {\n                    emit('done', response.data);\n                }\n            } catch (e) {\n                error.value = extractErrorContext(e).message ?? null;\n                emit('failed', e);\n            } finally {\n                busy.value = false;\n            }\n        };\n\n        const confirm = async () => {\n            if (busy.value || !enrollment.value || !confirmCode.value.trim()) {\n                return;\n            }\n\n            busy.value = true;\n            error.value = null;\n            try {\n                const entity = await apiClient.userAuthenticator.confirm(\n                    props.userId,\n                    enrollment.value.data.id,\n                    { code: confirmCode.value.trim() },\n                );\n                emit('done', entity.data);\n                reset();\n            } catch (e) {\n                error.value = extractErrorContext(e).message ?? null;\n                emit('failed', e);\n            } finally {\n                busy.value = false;\n            }\n        };\n\n        const downloadRecoveryCodes = () => {\n            if (typeof window === 'undefined' || !enrollment.value?.meta.codes) {\n                return;\n            }\n\n            const blob = new Blob([enrollment.value.meta.codes.join('\\n')], { type: 'text/plain' });\n            const url = window.URL.createObjectURL(blob);\n            const anchor = window.document.createElement('a');\n            anchor.href = url;\n            anchor.download = 'authup-recovery-codes.txt';\n            anchor.click();\n            window.URL.revokeObjectURL(url);\n        };\n\n        return {\n            UserAuthenticatorKind,\n            translations,\n            busy,\n            error,\n            enrollment,\n            enrollmentKind,\n            confirmCode,\n            forcedKind,\n            methods,\n            enroll,\n            confirm,\n            reset,\n            downloadRecoveryCodes,\n            recoveryNudge,\n            skipRecoveryNudge,\n            generateRecoveryCodes,\n            closeRecoveryCodes,\n        };\n    },\n});\n</script>\n<template>\n    <div>\n        <VCAlert\n            v-if=\"error\"\n            color=\"error\"\n            variant=\"soft\"\n            class=\"mb-3\"\n        >\n            {{ error }}\n        </VCAlert>\n\n        <!-- recovery-code nudge after an email/webauthn enrollment -->\n        <template v-if=\"recoveryNudge && !enrollment\">\n            <VCAlert\n                color=\"warning\"\n                variant=\"soft\"\n                class=\"mb-3\"\n            >\n                {{ translations.mfaRecoveryNudge }}\n            </VCAlert>\n            <div class=\"flex gap-2\">\n                <VCButton\n                    :disabled=\"busy\"\n                    :busy=\"busy\"\n                    color=\"primary\"\n                    :label=\"translations.mfaRecoveryNudgeGenerate\"\n                    @click=\"generateRecoveryCodes\"\n                />\n                <VCButton\n                    :disabled=\"busy\"\n                    color=\"neutral\"\n                    :label=\"translations.mfaRecoveryNudgeSkip\"\n                    @click=\"skipRecoveryNudge\"\n                />\n            </div>\n        </template>\n\n        <!-- kind picker (unless an enrollment is in progress or a kind is forced) -->\n        <template v-else-if=\"!enrollment\">\n            <p\n                v-if=\"forcedKind\"\n                class=\"text-center mb-3\"\n            >\n                {{ translations.mfaSetupRequired }}\n            </p>\n\n            <div class=\"flex flex-row gap-2 flex-wrap\">\n                <button\n                    v-for=\"method in methods\"\n                    :key=\"method.kind\"\n                    type=\"button\"\n                    class=\"flex flex-col justify-center gap-1 text-center a-picker-item disabled:opacity-60\"\n                    :disabled=\"busy\"\n                    @click=\"enroll(method.kind)\"\n                >\n                    <div>\n                        <VCIcon\n                            class=\"text-2xl\"\n                            :name=\"method.icon\"\n                        />\n                    </div>\n                    <div>\n                        {{ method.label }}\n                    </div>\n                </button>\n            </div>\n        </template>\n\n        <!-- TOTP: QR + manual key + confirm code -->\n        <template v-else-if=\"enrollmentKind === UserAuthenticatorKind.TOTP\">\n            <p class=\"text-center\">\n                {{ translations.mfaScanQr }}\n            </p>\n            <div\n                v-if=\"enrollment.meta.qr\"\n                class=\"flex justify-center my-3\"\n            >\n                <img\n                    :src=\"enrollment.meta.qr\"\n                    alt=\"QR\"\n                    class=\"max-w-[200px]\"\n                >\n            </div>\n            <p class=\"text-center text-sm\">\n                {{ translations.mfaManualKey }}\n            </p>\n            <p class=\"text-center font-mono break-all mb-3\">\n                {{ enrollment.meta.secret }}\n            </p>\n\n            <form @submit.prevent=\"confirm\">\n                <p class=\"mb-2\">\n                    {{ translations.mfaConfirmIntro }}\n                </p>\n                <VCFormGroup>\n                    <template #label>\n                        {{ translations.mfaCode }}\n                    </template>\n                    <VCFormInput\n                        v-model=\"confirmCode\"\n                        autocomplete=\"one-time-code\"\n                    />\n                </VCFormGroup>\n                <div class=\"flex gap-2\">\n                    <VCButton\n                        :disabled=\"busy || !confirmCode.trim()\"\n                        :busy=\"busy\"\n                        color=\"primary\"\n                        :label=\"translations.mfaConfirm\"\n                        @click=\"confirm\"\n                    />\n                    <VCButton\n                        :disabled=\"busy\"\n                        color=\"neutral\"\n                        :label=\"translations.abort\"\n                        @click=\"reset\"\n                    />\n                </div>\n            </form>\n        </template>\n\n        <!-- recovery: show the codes once -->\n        <template v-else>\n            <VCAlert\n                color=\"warning\"\n                variant=\"soft\"\n                class=\"mb-3\"\n            >\n                {{ translations.mfaRecoverySave }}\n            </VCAlert>\n            <p>{{ translations.mfaRecoveryIntro }}</p>\n            <ul class=\"font-mono my-3 grid grid-cols-2 gap-1\">\n                <li\n                    v-for=\"(code, index) in enrollment.meta.codes\"\n                    :key=\"index\"\n                >\n                    {{ code }}\n                </li>\n            </ul>\n            <div class=\"flex gap-2\">\n                <VCButton\n                    color=\"primary\"\n                    :label=\"translations.mfaDownload\"\n                    @click=\"downloadRecoveryCodes\"\n                />\n                <VCButton\n                    color=\"neutral\"\n                    :label=\"translations.close\"\n                    @click=\"closeRecoveryCodes\"\n                />\n            </div>\n        </template>\n    </div>\n</template>\n","<!--\n  - Copyright (c) 2026.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\n/* global window */\nimport type { UserAuthenticator } from '@authup/core-kit';\nimport { UserAuthenticatorKind } from '@authup/core-kit';\nimport type { UserAuthenticatorEnrollResponse } from '@authup/core-http-kit';\nimport {\n    computed,\n    defineComponent,\n    ref,\n} from 'vue';\nimport {\n    TranslatorTranslationActionKey,\n    TranslatorTranslationClientKey,\n    TranslatorTranslationNamespace,\n} from '@authup/i18n';\nimport { startRegistration } from '@simplewebauthn/browser';\nimport type { PublicKeyCredentialCreationOptionsJSON } from '@simplewebauthn/browser';\nimport { VCButton } from '@vuecs/button';\nimport { VCAlert } from '@vuecs/elements';\nimport { VCFormGroup, VCFormInput } from '@vuecs/forms';\nimport { VCIcon } from '@vuecs/icon';\nimport { extractErrorContext, injectHTTPClient, useTranslations } from '../../../core';\nimport { USER_AUTHENTICATOR_KIND_ICONS } from './constants';\n\nexport default defineComponent({\n    components: {\n        VCButton,\n        VCAlert,\n        VCFormGroup,\n        VCFormInput,\n        VCIcon,\n    },\n    props: {\n        // resolves `@me` for the calling user; an admin passes a user id.\n        userId: {\n            type: String,\n            default: '@me',\n        },\n        // constrain enrollment to a single kind (inline authorize flow\n        // forces `totp`); omit to let the user pick.\n        kind: {\n            type: String,\n            default: null,\n        },\n    },\n    emits: ['done', 'failed', 'closed'],\n    setup(props, { emit }) {\n        const apiClient = injectHTTPClient();\n\n        const translations = useTranslations([\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.MFA_ENROLL_TITLE },\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.MFA_ENROLL_TOTP },\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.MFA_ENROLL_RECOVERY },\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.MFA_ENROLL_EMAIL },\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.MFA_ENROLL_WEBAUTHN },\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.MFA_SCAN_QR },\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.MFA_MANUAL_KEY },\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.MFA_CONFIRM_INTRO },\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.MFA_CONFIRM },\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.MFA_CODE },\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.MFA_RECOVERY_INTRO },\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.MFA_RECOVERY_SAVE },\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.MFA_DOWNLOAD },\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.MFA_SETUP_REQUIRED },\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.MFA_RECOVERY_NUDGE },\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.MFA_RECOVERY_NUDGE_GENERATE },\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.MFA_RECOVERY_NUDGE_SKIP },\n            { namespace: TranslatorTranslationNamespace.ACTION, key: TranslatorTranslationActionKey.ABORT },\n            { namespace: TranslatorTranslationNamespace.ACTION, key: TranslatorTranslationActionKey.CLOSE },\n        ]);\n\n        const busy = ref(false);\n        const error = ref<string | null>(null);\n\n        // enroll response (unconfirmed TOTP → show QR + confirm; recovery → show codes)\n        const enrollment = ref<UserAuthenticatorEnrollResponse | null>(null);\n        const enrollmentKind = ref<`${UserAuthenticatorKind}` | null>(null);\n        const confirmCode = ref('');\n\n        const forcedKind = computed<`${UserAuthenticatorKind}` | null>(\n            () => (props.kind as `${UserAuthenticatorKind}` | null),\n        );\n\n        // Only email can be provisioned FOR another user — totp/recovery/webauthn\n        // are owner-controlled (self-enrollment only) and the server rejects them\n        // on a non-self target, so an admin managing a different user is offered\n        // email alone (they reset the rest by deleting the user's devices).\n        const managingOther = computed<boolean>(() => props.userId !== '@me');\n        const canOfferKind = (kind: `${UserAuthenticatorKind}`): boolean => {\n            if (forcedKind.value && forcedKind.value !== kind) {\n                return false;\n            }\n            if (managingOther.value && kind !== UserAuthenticatorKind.EMAIL) {\n                return false;\n            }\n            return true;\n        };\n\n        const methods = computed(() => [\n            {\n                kind: UserAuthenticatorKind.TOTP,\n                icon: USER_AUTHENTICATOR_KIND_ICONS[UserAuthenticatorKind.TOTP],\n                label: translations.mfaEnrollTotp,\n            },\n            {\n                kind: UserAuthenticatorKind.WEBAUTHN,\n                icon: USER_AUTHENTICATOR_KIND_ICONS[UserAuthenticatorKind.WEBAUTHN],\n                label: translations.mfaEnrollWebauthn,\n            },\n            {\n                kind: UserAuthenticatorKind.EMAIL,\n                icon: USER_AUTHENTICATOR_KIND_ICONS[UserAuthenticatorKind.EMAIL],\n                label: translations.mfaEnrollEmail,\n            },\n            {\n                kind: UserAuthenticatorKind.RECOVERY,\n                icon: USER_AUTHENTICATOR_KIND_ICONS[UserAuthenticatorKind.RECOVERY],\n                label: translations.mfaEnrollRecovery,\n            },\n        ].filter((item) => canOfferKind(item.kind)));\n\n        const reset = () => {\n            enrollment.value = null;\n            enrollmentKind.value = null;\n            confirmCode.value = '';\n            error.value = null;\n        };\n\n        // Soft recovery-code nudge (issue #3242 follow-up): a just-enrolled\n        // email/webauthn factor without backup recovery codes leaves the\n        // account one lost mailbox / authenticator away from a locked-out\n        // login — offer (never force) generating codes before finishing.\n        // While set, it holds the enrolled entity whose `done` emit is\n        // DEFERRED until the nudge resolves (skip, or codes acknowledged) —\n        // the authorize ladder re-renders on `done`, which would otherwise\n        // unmount the nudge (and the displayed codes) immediately.\n        const recoveryNudge = ref<UserAuthenticator | null>(null);\n\n        const finishEnrollment = async (entity: UserAuthenticator, kind: `${UserAuthenticatorKind}`) => {\n            if (\n                managingOther.value ||\n                (\n                    kind !== UserAuthenticatorKind.EMAIL &&\n                    kind !== UserAuthenticatorKind.WEBAUTHN\n                )\n            ) {\n                emit('done', entity);\n                return;\n            }\n\n            try {\n                const { meta } = await apiClient.userAuthenticator.getMany(props.userId, {\n                    filters: { kind: UserAuthenticatorKind.RECOVERY },\n                    pagination: { limit: 1 },\n                });\n                if (meta.total > 0) {\n                    emit('done', entity);\n                    return;\n                }\n            } catch {\n                // fail open — never block a completed enrollment on the nudge\n                emit('done', entity);\n                return;\n            }\n\n            recoveryNudge.value = entity;\n        };\n\n        const skipRecoveryNudge = () => {\n            if (!recoveryNudge.value) {\n                return;\n            }\n\n            const entity = recoveryNudge.value;\n            recoveryNudge.value = null;\n            emit('done', entity);\n        };\n\n        const generateRecoveryCodes = async () => {\n            if (busy.value) {\n                return;\n            }\n\n            busy.value = true;\n            error.value = null;\n            try {\n                // deliberately NOT enroll(): the nudge defers every `done`\n                // until the codes were acknowledged (close), so the parent\n                // cannot re-render the shown-once codes away.\n                const response = await apiClient.userAuthenticator.enroll(props.userId, { kind: UserAuthenticatorKind.RECOVERY });\n\n                enrollment.value = response;\n                enrollmentKind.value = UserAuthenticatorKind.RECOVERY;\n            } catch (e) {\n                error.value = extractErrorContext(e).message ?? null;\n            } finally {\n                busy.value = false;\n            }\n        };\n\n        // terminal dismissal of the shown-once recovery codes — resolves a\n        // deferred nudge `done` and lets a host (modal, wizard step) tear\n        // the enrollment surface down via `closed`.\n        const closeRecoveryCodes = () => {\n            reset();\n\n            if (recoveryNudge.value) {\n                const entity = recoveryNudge.value;\n                recoveryNudge.value = null;\n                emit('done', entity);\n            }\n\n            emit('closed');\n        };\n\n        const enroll = async (kind: `${UserAuthenticatorKind}`) => {\n            if (busy.value) {\n                return;\n            }\n\n            busy.value = true;\n            error.value = null;\n            try {\n                const response = await apiClient.userAuthenticator.enroll(props.userId, { kind });\n\n                // webauthn: run the registration ceremony immediately and\n                // confirm with the attestation (no display).\n                if (kind === UserAuthenticatorKind.WEBAUTHN) {\n                    if (!response.meta.webauthn) {\n                        throw new Error('The server did not return WebAuthn registration options.');\n                    }\n                    // the http-kit response type is intentionally framework-agnostic\n                    // (Record<string, unknown>); assert the browser lib's shape here.\n                    const optionsJSON = response.meta.webauthn as unknown as PublicKeyCredentialCreationOptionsJSON;\n                    const attestation = await startRegistration({ optionsJSON });\n                    const confirmed = await apiClient.userAuthenticator.confirm(\n                        props.userId,\n                        response.data.id,\n                        { code: JSON.stringify(attestation) },\n                    );\n                    await finishEnrollment(confirmed.data, kind);\n                    return;\n                }\n\n                // email is confirmed on creation and has nothing to display —\n                // just signal completion (via the recovery nudge).\n                if (kind === UserAuthenticatorKind.EMAIL) {\n                    await finishEnrollment(response.data, kind);\n                    return;\n                }\n\n                enrollment.value = response;\n                enrollmentKind.value = kind;\n\n                // recovery is confirmed on creation — the codes are shown once\n                if (kind === UserAuthenticatorKind.RECOVERY) {\n                    emit('done', response.data);\n                }\n            } catch (e) {\n                error.value = extractErrorContext(e).message ?? null;\n                emit('failed', e);\n            } finally {\n                busy.value = false;\n            }\n        };\n\n        const confirm = async () => {\n            if (busy.value || !enrollment.value || !confirmCode.value.trim()) {\n                return;\n            }\n\n            busy.value = true;\n            error.value = null;\n            try {\n                const entity = await apiClient.userAuthenticator.confirm(\n                    props.userId,\n                    enrollment.value.data.id,\n                    { code: confirmCode.value.trim() },\n                );\n                emit('done', entity.data);\n                reset();\n            } catch (e) {\n                error.value = extractErrorContext(e).message ?? null;\n                emit('failed', e);\n            } finally {\n                busy.value = false;\n            }\n        };\n\n        const downloadRecoveryCodes = () => {\n            if (typeof window === 'undefined' || !enrollment.value?.meta.codes) {\n                return;\n            }\n\n            const blob = new Blob([enrollment.value.meta.codes.join('\\n')], { type: 'text/plain' });\n            const url = window.URL.createObjectURL(blob);\n            const anchor = window.document.createElement('a');\n            anchor.href = url;\n            anchor.download = 'authup-recovery-codes.txt';\n            anchor.click();\n            window.URL.revokeObjectURL(url);\n        };\n\n        return {\n            UserAuthenticatorKind,\n            translations,\n            busy,\n            error,\n            enrollment,\n            enrollmentKind,\n            confirmCode,\n            forcedKind,\n            methods,\n            enroll,\n            confirm,\n            reset,\n            downloadRecoveryCodes,\n            recoveryNudge,\n            skipRecoveryNudge,\n            generateRecoveryCodes,\n            closeRecoveryCodes,\n        };\n    },\n});\n</script>\n<template>\n    <div>\n        <VCAlert\n            v-if=\"error\"\n            color=\"error\"\n            variant=\"soft\"\n            class=\"mb-3\"\n        >\n            {{ error }}\n        </VCAlert>\n\n        <!-- recovery-code nudge after an email/webauthn enrollment -->\n        <template v-if=\"recoveryNudge && !enrollment\">\n            <VCAlert\n                color=\"warning\"\n                variant=\"soft\"\n                class=\"mb-3\"\n            >\n                {{ translations.mfaRecoveryNudge }}\n            </VCAlert>\n            <div class=\"flex gap-2\">\n                <VCButton\n                    :disabled=\"busy\"\n                    :busy=\"busy\"\n                    color=\"primary\"\n                    :label=\"translations.mfaRecoveryNudgeGenerate\"\n                    @click=\"generateRecoveryCodes\"\n                />\n                <VCButton\n                    :disabled=\"busy\"\n                    color=\"neutral\"\n                    :label=\"translations.mfaRecoveryNudgeSkip\"\n                    @click=\"skipRecoveryNudge\"\n                />\n            </div>\n        </template>\n\n        <!-- kind picker (unless an enrollment is in progress or a kind is forced) -->\n        <template v-else-if=\"!enrollment\">\n            <p\n                v-if=\"forcedKind\"\n                class=\"text-center mb-3\"\n            >\n                {{ translations.mfaSetupRequired }}\n            </p>\n\n            <div class=\"flex flex-row gap-2 flex-wrap\">\n                <button\n                    v-for=\"method in methods\"\n                    :key=\"method.kind\"\n                    type=\"button\"\n                    class=\"flex flex-col justify-center gap-1 text-center a-picker-item disabled:opacity-60\"\n                    :disabled=\"busy\"\n                    @click=\"enroll(method.kind)\"\n                >\n                    <div>\n                        <VCIcon\n                            class=\"text-2xl\"\n                            :name=\"method.icon\"\n                        />\n                    </div>\n                    <div>\n                        {{ method.label }}\n                    </div>\n                </button>\n            </div>\n        </template>\n\n        <!-- TOTP: QR + manual key + confirm code -->\n        <template v-else-if=\"enrollmentKind === UserAuthenticatorKind.TOTP\">\n            <p class=\"text-center\">\n                {{ translations.mfaScanQr }}\n            </p>\n            <div\n                v-if=\"enrollment.meta.qr\"\n                class=\"flex justify-center my-3\"\n            >\n                <img\n                    :src=\"enrollment.meta.qr\"\n                    alt=\"QR\"\n                    class=\"max-w-[200px]\"\n                >\n            </div>\n            <p class=\"text-center text-sm\">\n                {{ translations.mfaManualKey }}\n            </p>\n            <p class=\"text-center font-mono break-all mb-3\">\n                {{ enrollment.meta.secret }}\n            </p>\n\n            <form @submit.prevent=\"confirm\">\n                <p class=\"mb-2\">\n                    {{ translations.mfaConfirmIntro }}\n                </p>\n                <VCFormGroup>\n                    <template #label>\n                        {{ translations.mfaCode }}\n                    </template>\n                    <VCFormInput\n                        v-model=\"confirmCode\"\n                        autocomplete=\"one-time-code\"\n                    />\n                </VCFormGroup>\n                <div class=\"flex gap-2\">\n                    <VCButton\n                        :disabled=\"busy || !confirmCode.trim()\"\n                        :busy=\"busy\"\n                        color=\"primary\"\n                        :label=\"translations.mfaConfirm\"\n                        @click=\"confirm\"\n                    />\n                    <VCButton\n                        :disabled=\"busy\"\n                        color=\"neutral\"\n                        :label=\"translations.abort\"\n                        @click=\"reset\"\n                    />\n                </div>\n            </form>\n        </template>\n\n        <!-- recovery: show the codes once -->\n        <template v-else>\n            <VCAlert\n                color=\"warning\"\n                variant=\"soft\"\n                class=\"mb-3\"\n            >\n                {{ translations.mfaRecoverySave }}\n            </VCAlert>\n            <p>{{ translations.mfaRecoveryIntro }}</p>\n            <ul class=\"font-mono my-3 grid grid-cols-2 gap-1\">\n                <li\n                    v-for=\"(code, index) in enrollment.meta.codes\"\n                    :key=\"index\"\n                >\n                    {{ code }}\n                </li>\n            </ul>\n            <div class=\"flex gap-2\">\n                <VCButton\n                    color=\"primary\"\n                    :label=\"translations.mfaDownload\"\n                    @click=\"downloadRecoveryCodes\"\n                />\n                <VCButton\n                    color=\"neutral\"\n                    :label=\"translations.close\"\n                    @click=\"closeRecoveryCodes\"\n                />\n            </div>\n        </template>\n    </div>\n</template>\n","<!--\n  - Copyright (c) 2026.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\nimport type { UserAuthenticator } from '@authup/core-kit';\nimport { UserAuthenticatorKind } from '@authup/core-kit';\nimport {\n    computed,\n    defineComponent,\n    onMounted,\n    ref,\n} from 'vue';\nimport {\n    TranslatorTranslationActionKey,\n    TranslatorTranslationAppKey,\n    TranslatorTranslationClientKey,\n    TranslatorTranslationNamespace,\n} from '@authup/i18n';\nimport { VCButton } from '@vuecs/button';\nimport { VCAlert } from '@vuecs/elements';\nimport { VCIcon } from '@vuecs/icon';\nimport {\n    VCModal,\n    VCModalClose,\n    VCModalContent,\n    VCModalTitle,\n    useAlertDialog,\n} from '@vuecs/overlays';\nimport { extractErrorContext, injectHTTPClient, useTranslations } from '../../../core';\nimport AUserAuthenticatorEnroll from './AUserAuthenticatorEnroll.vue';\nimport { USER_AUTHENTICATOR_KIND_ICONS } from './constants';\n\nexport default defineComponent({\n    components: {\n        VCButton,\n        VCAlert,\n        VCIcon,\n        VCModal,\n        VCModalContent,\n        VCModalTitle,\n        VCModalClose,\n        AUserAuthenticatorEnroll,\n    },\n    props: {\n        userId: {\n            type: String,\n            default: '@me',\n        },\n    },\n    emits: ['deleted', 'created'],\n    setup(props, { emit }) {\n        const apiClient = injectHTTPClient();\n\n        const translations = useTranslations([\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.MFA_ENROLL_TITLE },\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.MFA_ENROLL_TOTP },\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.MFA_ENROLL_RECOVERY },\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.MFA_ENROLL_EMAIL },\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.MFA_ENROLL_WEBAUTHN },\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.MFA_NO_DEVICES },\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.MFA_DEVICE_UNCONFIRMED },\n            { namespace: TranslatorTranslationNamespace.ACTION, key: TranslatorTranslationActionKey.ADD },\n            { namespace: TranslatorTranslationNamespace.ACTION, key: TranslatorTranslationActionKey.DELETE },\n            { namespace: TranslatorTranslationNamespace.ACTION, key: TranslatorTranslationActionKey.ABORT },\n            { namespace: TranslatorTranslationNamespace.ACTION, key: TranslatorTranslationActionKey.CLOSE },\n            { namespace: TranslatorTranslationNamespace.APP, key: TranslatorTranslationAppKey.REMOVE_CONFIRM_TITLE },\n            { namespace: TranslatorTranslationNamespace.APP, key: TranslatorTranslationAppKey.DELETE_CONFIRM_DESCRIPTION },\n        ]);\n\n        // Deleting an MFA device is irreversible and weakens the account's\n        // security posture — gate it behind a confirmation, like other\n        // destructive kit actions. Resolves false in SSR / without the overlay\n        // provider, so the delete is simply not performed there.\n        const confirmDialog = useAlertDialog();\n\n        const items = ref<UserAuthenticator[]>([]);\n        const busy = ref(false);\n        const error = ref<string | null>(null);\n        const adding = ref(false);\n\n        const kindIcons = USER_AUTHENTICATOR_KIND_ICONS;\n        const kindLabels = computed<Record<`${UserAuthenticatorKind}`, string>>(() => ({\n            [UserAuthenticatorKind.TOTP]: translations.mfaEnrollTotp,\n            [UserAuthenticatorKind.WEBAUTHN]: translations.mfaEnrollWebauthn,\n            [UserAuthenticatorKind.EMAIL]: translations.mfaEnrollEmail,\n            [UserAuthenticatorKind.RECOVERY]: translations.mfaEnrollRecovery,\n        }));\n\n        const load = async () => {\n            busy.value = true;\n            error.value = null;\n            try {\n                const response = await apiClient.userAuthenticator.getMany(props.userId, { sorts: { createdAt: 'DESC' } });\n                items.value = response.data;\n            } catch (e) {\n                error.value = extractErrorContext(e).message ?? null;\n            } finally {\n                busy.value = false;\n            }\n        };\n\n        const drop = async (item: UserAuthenticator) => {\n            const confirmed = await confirmDialog({\n                title: translations.removeConfirmTitle,\n                description: translations.deleteConfirmDescription,\n                confirmLabel: translations.delete,\n                cancelLabel: translations.abort,\n                tone: 'error',\n            });\n            if (!confirmed) {\n                return;\n            }\n\n            try {\n                await apiClient.userAuthenticator.delete(props.userId, item.id);\n                items.value = items.value.filter((entity) => entity.id !== item.id);\n                emit('deleted', item);\n            } catch (e) {\n                error.value = extractErrorContext(e).message ?? null;\n            }\n        };\n\n        const handleCreated = (entity: UserAuthenticator) => {\n            emit('created', entity);\n            load();\n\n            // recovery codes are displayed once, right after creation —\n            // keep the enrollment dialog open until the user closes it.\n            if (entity.kind !== UserAuthenticatorKind.RECOVERY) {\n                adding.value = false;\n            }\n        };\n\n        onMounted(() => load());\n\n        return {\n            translations,\n            items,\n            busy,\n            error,\n            adding,\n            kindIcons,\n            kindLabels,\n            drop,\n            handleCreated,\n        };\n    },\n});\n</script>\n<template>\n    <div>\n        <VCAlert\n            v-if=\"error\"\n            color=\"error\"\n            variant=\"soft\"\n            class=\"mb-3\"\n        >\n            {{ error }}\n        </VCAlert>\n\n        <div class=\"flex items-center justify-end mb-3\">\n            <VCButton\n                color=\"primary\"\n                size=\"sm\"\n                :label=\"translations.add\"\n                @click=\"adding = true\"\n            >\n                <template #leading>\n                    <VCIcon name=\"fa6-solid:plus\" />\n                </template>\n            </VCButton>\n        </div>\n\n        <VCAlert\n            v-if=\"!busy && items.length === 0\"\n            color=\"info\"\n            variant=\"soft\"\n            size=\"sm\"\n        >\n            {{ translations.mfaNoDevices }}\n        </VCAlert>\n\n        <ul\n            v-if=\"items.length > 0\"\n            class=\"flex flex-col gap-2\"\n        >\n            <li\n                v-for=\"item in items\"\n                :key=\"item.id\"\n                class=\"flex items-center gap-3 rounded-lg border border-border p-3\"\n            >\n                <span class=\"flex h-9 w-9 shrink-0 items-center justify-center rounded-md bg-bg-muted text-fg-muted\">\n                    <VCIcon :name=\"kindIcons[item.kind]\" />\n                </span>\n                <span class=\"flex min-w-0 grow flex-col\">\n                    <span class=\"font-semibold\">{{ kindLabels[item.kind] }}</span>\n                    <span\n                        v-if=\"item.name\"\n                        class=\"text-sm text-fg-muted truncate\"\n                    >{{ item.name }}</span>\n                </span>\n                <span\n                    v-if=\"!item.confirmed\"\n                    class=\"shrink-0 text-sm text-warning-600\"\n                >\n                    {{ translations.mfaDeviceUnconfirmed }}\n                </span>\n                <VCButton\n                    color=\"error\"\n                    variant=\"outline\"\n                    size=\"sm\"\n                    :label=\"translations.delete\"\n                    @click=\"drop(item)\"\n                />\n            </li>\n        </ul>\n\n        <VCModal\n            :open=\"adding\"\n            @update:open=\"(value) => { adding = value; }\"\n        >\n            <VCModalContent>\n                <div class=\"flex items-center justify-between gap-2\">\n                    <VCModalTitle>{{ translations.mfaEnrollTitle }}</VCModalTitle>\n                    <VCModalClose\n                        class=\"text-fg-muted hover:text-fg\"\n                        :aria-label=\"translations.close\"\n                    >\n                        <VCIcon name=\"fa6-solid:xmark\" />\n                    </VCModalClose>\n                </div>\n                <AUserAuthenticatorEnroll\n                    v-if=\"adding\"\n                    :user-id=\"userId\"\n                    @done=\"handleCreated\"\n                    @closed=\"adding = false\"\n                />\n            </VCModalContent>\n        </VCModal>\n    </div>\n</template>\n","<!--\n  - Copyright (c) 2026.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\nimport type { UserAuthenticator } from '@authup/core-kit';\nimport { UserAuthenticatorKind } from '@authup/core-kit';\nimport {\n    computed,\n    defineComponent,\n    onMounted,\n    ref,\n} from 'vue';\nimport {\n    TranslatorTranslationActionKey,\n    TranslatorTranslationAppKey,\n    TranslatorTranslationClientKey,\n    TranslatorTranslationNamespace,\n} from '@authup/i18n';\nimport { VCButton } from '@vuecs/button';\nimport { VCAlert } from '@vuecs/elements';\nimport { VCIcon } from '@vuecs/icon';\nimport {\n    VCModal,\n    VCModalClose,\n    VCModalContent,\n    VCModalTitle,\n    useAlertDialog,\n} from '@vuecs/overlays';\nimport { extractErrorContext, injectHTTPClient, useTranslations } from '../../../core';\nimport AUserAuthenticatorEnroll from './AUserAuthenticatorEnroll.vue';\nimport { USER_AUTHENTICATOR_KIND_ICONS } from './constants';\n\nexport default defineComponent({\n    components: {\n        VCButton,\n        VCAlert,\n        VCIcon,\n        VCModal,\n        VCModalContent,\n        VCModalTitle,\n        VCModalClose,\n        AUserAuthenticatorEnroll,\n    },\n    props: {\n        userId: {\n            type: String,\n            default: '@me',\n        },\n    },\n    emits: ['deleted', 'created'],\n    setup(props, { emit }) {\n        const apiClient = injectHTTPClient();\n\n        const translations = useTranslations([\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.MFA_ENROLL_TITLE },\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.MFA_ENROLL_TOTP },\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.MFA_ENROLL_RECOVERY },\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.MFA_ENROLL_EMAIL },\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.MFA_ENROLL_WEBAUTHN },\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.MFA_NO_DEVICES },\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.MFA_DEVICE_UNCONFIRMED },\n            { namespace: TranslatorTranslationNamespace.ACTION, key: TranslatorTranslationActionKey.ADD },\n            { namespace: TranslatorTranslationNamespace.ACTION, key: TranslatorTranslationActionKey.DELETE },\n            { namespace: TranslatorTranslationNamespace.ACTION, key: TranslatorTranslationActionKey.ABORT },\n            { namespace: TranslatorTranslationNamespace.ACTION, key: TranslatorTranslationActionKey.CLOSE },\n            { namespace: TranslatorTranslationNamespace.APP, key: TranslatorTranslationAppKey.REMOVE_CONFIRM_TITLE },\n            { namespace: TranslatorTranslationNamespace.APP, key: TranslatorTranslationAppKey.DELETE_CONFIRM_DESCRIPTION },\n        ]);\n\n        // Deleting an MFA device is irreversible and weakens the account's\n        // security posture — gate it behind a confirmation, like other\n        // destructive kit actions. Resolves false in SSR / without the overlay\n        // provider, so the delete is simply not performed there.\n        const confirmDialog = useAlertDialog();\n\n        const items = ref<UserAuthenticator[]>([]);\n        const busy = ref(false);\n        const error = ref<string | null>(null);\n        const adding = ref(false);\n\n        const kindIcons = USER_AUTHENTICATOR_KIND_ICONS;\n        const kindLabels = computed<Record<`${UserAuthenticatorKind}`, string>>(() => ({\n            [UserAuthenticatorKind.TOTP]: translations.mfaEnrollTotp,\n            [UserAuthenticatorKind.WEBAUTHN]: translations.mfaEnrollWebauthn,\n            [UserAuthenticatorKind.EMAIL]: translations.mfaEnrollEmail,\n            [UserAuthenticatorKind.RECOVERY]: translations.mfaEnrollRecovery,\n        }));\n\n        const load = async () => {\n            busy.value = true;\n            error.value = null;\n            try {\n                const response = await apiClient.userAuthenticator.getMany(props.userId, { sorts: { createdAt: 'DESC' } });\n                items.value = response.data;\n            } catch (e) {\n                error.value = extractErrorContext(e).message ?? null;\n            } finally {\n                busy.value = false;\n            }\n        };\n\n        const drop = async (item: UserAuthenticator) => {\n            const confirmed = await confirmDialog({\n                title: translations.removeConfirmTitle,\n                description: translations.deleteConfirmDescription,\n                confirmLabel: translations.delete,\n                cancelLabel: translations.abort,\n                tone: 'error',\n            });\n            if (!confirmed) {\n                return;\n            }\n\n            try {\n                await apiClient.userAuthenticator.delete(props.userId, item.id);\n                items.value = items.value.filter((entity) => entity.id !== item.id);\n                emit('deleted', item);\n            } catch (e) {\n                error.value = extractErrorContext(e).message ?? null;\n            }\n        };\n\n        const handleCreated = (entity: UserAuthenticator) => {\n            emit('created', entity);\n            load();\n\n            // recovery codes are displayed once, right after creation —\n            // keep the enrollment dialog open until the user closes it.\n            if (entity.kind !== UserAuthenticatorKind.RECOVERY) {\n                adding.value = false;\n            }\n        };\n\n        onMounted(() => load());\n\n        return {\n            translations,\n            items,\n            busy,\n            error,\n            adding,\n            kindIcons,\n            kindLabels,\n            drop,\n            handleCreated,\n        };\n    },\n});\n</script>\n<template>\n    <div>\n        <VCAlert\n            v-if=\"error\"\n            color=\"error\"\n            variant=\"soft\"\n            class=\"mb-3\"\n        >\n            {{ error }}\n        </VCAlert>\n\n        <div class=\"flex items-center justify-end mb-3\">\n            <VCButton\n                color=\"primary\"\n                size=\"sm\"\n                :label=\"translations.add\"\n                @click=\"adding = true\"\n            >\n                <template #leading>\n                    <VCIcon name=\"fa6-solid:plus\" />\n                </template>\n            </VCButton>\n        </div>\n\n        <VCAlert\n            v-if=\"!busy && items.length === 0\"\n            color=\"info\"\n            variant=\"soft\"\n            size=\"sm\"\n        >\n            {{ translations.mfaNoDevices }}\n        </VCAlert>\n\n        <ul\n            v-if=\"items.length > 0\"\n            class=\"flex flex-col gap-2\"\n        >\n            <li\n                v-for=\"item in items\"\n                :key=\"item.id\"\n                class=\"flex items-center gap-3 rounded-lg border border-border p-3\"\n            >\n                <span class=\"flex h-9 w-9 shrink-0 items-center justify-center rounded-md bg-bg-muted text-fg-muted\">\n                    <VCIcon :name=\"kindIcons[item.kind]\" />\n                </span>\n                <span class=\"flex min-w-0 grow flex-col\">\n                    <span class=\"font-semibold\">{{ kindLabels[item.kind] }}</span>\n                    <span\n                        v-if=\"item.name\"\n                        class=\"text-sm text-fg-muted truncate\"\n                    >{{ item.name }}</span>\n                </span>\n                <span\n                    v-if=\"!item.confirmed\"\n                    class=\"shrink-0 text-sm text-warning-600\"\n                >\n                    {{ translations.mfaDeviceUnconfirmed }}\n                </span>\n                <VCButton\n                    color=\"error\"\n                    variant=\"outline\"\n                    size=\"sm\"\n                    :label=\"translations.delete\"\n                    @click=\"drop(item)\"\n                />\n            </li>\n        </ul>\n\n        <VCModal\n            :open=\"adding\"\n            @update:open=\"(value) => { adding = value; }\"\n        >\n            <VCModalContent>\n                <div class=\"flex items-center justify-between gap-2\">\n                    <VCModalTitle>{{ translations.mfaEnrollTitle }}</VCModalTitle>\n                    <VCModalClose\n                        class=\"text-fg-muted hover:text-fg\"\n                        :aria-label=\"translations.close\"\n                    >\n                        <VCIcon name=\"fa6-solid:xmark\" />\n                    </VCModalClose>\n                </div>\n                <AUserAuthenticatorEnroll\n                    v-if=\"adding\"\n                    :user-id=\"userId\"\n                    @done=\"handleCreated\"\n                    @closed=\"adding = false\"\n                />\n            </VCModalContent>\n        </VCModal>\n    </div>\n</template>\n","/*\n * Copyright (c) 2022-2025.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nexport * from './client';\nexport * from './client-permission';\nexport * from './client-role';\nexport * from './client-scope';\nexport * from './consent';\nexport * from './event';\nexport * from './identity-provider';\nexport * from './identity-provider-account';\nexport * from './identity-provider-role';\nexport * from './key';\nexport * from './policy';\nexport * from './permission';\nexport * from './permission-client';\nexport * from './permission-policy-binding';\nexport * from './permission-policy';\nexport * from './permission-role';\nexport * from './permission-user';\nexport * from './realm';\nexport * from './role';\nexport * from './role-client';\nexport * from './role-permission';\nexport * from './user-permission';\nexport * from './role-user';\nexport * from './scope';\nexport * from './scope-client';\nexport * from './session';\nexport * from './session-token';\nexport * from './trust-anchor';\nexport * from './user';\nexport * from './user-authenticator';\nexport * from './user-role';\n","/*\n * Copyright (c) 2024-2026.\n * Author Peter Placzek (tada5hi)\n * For the full copyright and license information,\n * view the LICENSE file that was distributed with this source code.\n */\n\nimport { createValidup } from '@validup/vue';\nimport { OptionalValue } from 'validup';\nimport type { App, Component } from 'vue';\nimport * as components from './components/entities';\nimport {\n    installHTTPClient,\n    installHTTPClientAuthenticationHook,\n    installSocketManager,\n    installStore,\n    installTranslator,\n    provideHydrationStore,\n} from './core';\nimport type { Options } from './types';\n\nexport function installComponents(app: App, input?: boolean | string[]) {\n    if (typeof input === 'undefined' || input === false) {\n        return;\n    }\n\n    if (typeof input === 'boolean') {\n        Object.entries(components)\n            .forEach(([componentName, component]) => {\n                // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n                // @ts-ignore\n                app.component(componentName, component as Component);\n            });\n\n        return;\n    }\n\n    Object.entries(components)\n        .forEach(([componentName, component]) => {\n            if (input.includes(componentName)) {\n                // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n                // @ts-ignore\n                app.component(componentName, component as Component);\n            }\n        });\n}\n\nexport function install(app: App, options: Options): void {\n    if (options.hydrationStore) {\n        provideHydrationStore(options.hydrationStore, app);\n    }\n\n    if (options.realtime) {\n        installSocketManager(app, {\n            pinia: options.pinia,\n            baseURL: options.realtimeURL || options.baseURL,\n        });\n    }\n\n    installStore(app, {\n        pinia: options.pinia,\n        baseURL: options.baseURL,\n        httpClient: options.httpClient,\n        cookieSet: options.cookieSet,\n        cookieGet: options.cookieGet,\n        cookieUnset: options.cookieUnset,\n        cookiePath: options.cookiePath,\n        cookieSession: options.cookieSession,\n    });\n\n    installHTTPClientAuthenticationHook(app, {\n        pinia: options.pinia,\n        baseURL: options.baseURL,\n        httpClient: options.httpClient,\n        isServer: options.isServer,\n    });\n\n    installHTTPClient(app, {\n        pinia: options.pinia,\n        baseURL: options.baseURL,\n        httpClient: options.httpClient,\n        isServer: options.isServer,\n    });\n\n    installTranslator(app, { locale: options.translatorLocale });\n\n    // Register @validup/vue's `createValidup` plugin with authup's\n    // form-friendly defaults: treat `undefined`, `null`, and empty strings\n    // as \"missing\" for every mount that declares `optional: true` without\n    // its own `optionalValue` override, and emit `null` to the backend\n    // for those missing fields. Matches the entity-validator pattern\n    // across the codebase (every nullable FK / optional string column is\n    // typed as `z.X().nullable()` — a blank input should land as `null`,\n    // not `''`).\n    app.use(createValidup({\n        optionalValue: [OptionalValue.UNDEFINED, OptionalValue.NULL, OptionalValue.EMPTY_STRING],\n        optionalAs: null,\n    }));\n\n    installComponents(app, options.components);\n\n    // NOTE: `@vuecs/forms` and `@vuecs/pagination` are NOT installed here.\n    // Both `installForms` / `installPagination` internally call\n    // `installThemeManager(app, {})` which is first-install-wins (per the\n    // `inject(THEME_MANAGER_SYMBOL); if (existing) return existing;` check\n    // in `@vuecs/core`). Installing them inside the kit before the app's\n    // own `app.use(vuecs, { themes: [...] })` runs would freeze the theme\n    // manager with no themes, silently dropping every theme override.\n    // The consumer plugin (see apps/client-admin-console/plugins/vuecs.ts) installs\n    // `vuecs` first, then the per-package plugins on top.\n}\n","<!--\n  - Copyright (c) 2026.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\nimport { UserAuthenticatorKind } from '@authup/core-kit';\nimport type { PropType } from 'vue';\nimport {\n    computed,\n    defineComponent,\n    ref,\n} from 'vue';\nimport {\n    TranslatorTranslationClientKey,\n    TranslatorTranslationNamespace,\n} from '@authup/i18n';\nimport { startAuthentication } from '@simplewebauthn/browser';\nimport type { PublicKeyCredentialRequestOptionsJSON } from '@simplewebauthn/browser';\nimport { VCButton } from '@vuecs/button';\nimport { VCAlert } from '@vuecs/elements';\nimport { VCFormGroup, VCFormInput } from '@vuecs/forms';\nimport type { UserAuthenticatorChallengeRequestOptions } from '@authup/core-http-kit';\nimport { extractErrorContext, injectHTTPClient, useTranslations } from '../../../core';\n\n// preference order for the initially-selected factor (most secure first)\nconst KIND_PRIORITY : `${UserAuthenticatorKind}`[] = [\n    UserAuthenticatorKind.WEBAUTHN,\n    UserAuthenticatorKind.TOTP,\n    UserAuthenticatorKind.EMAIL,\n    UserAuthenticatorKind.RECOVERY,\n];\n\nexport default defineComponent({\n    components: {\n        VCButton,\n        VCAlert,\n        VCFormGroup,\n        VCFormInput,\n    },\n    props: {\n        kinds: {\n            type: Array as PropType<`${UserAuthenticatorKind}`[]>,\n            default: () => [UserAuthenticatorKind.TOTP],\n        },\n        // kind-specific challenge payload from GET /authenticators/challenge\n        // (WebAuthn request options under `.webauthn`).\n        challenge: {\n            type: Object as PropType<Record<string, unknown> | null>,\n            default: null,\n        },\n        // MFA-pending login ticket (issue #3242) — a fresh interactive login\n        // has no session bearer yet, so the challenge calls ride the ticket\n        // as an explicit Authorization override. On success the verify\n        // response carries the full token grant (forwarded via `done`).\n        ticket: {\n            type: String as PropType<string | null>,\n            default: null,\n        },\n    },\n    emits: ['done', 'failed'],\n    setup(props, { emit }) {\n        const apiClient = injectHTTPClient();\n\n        const requestOptions = computed<UserAuthenticatorChallengeRequestOptions | undefined>(() => (props.ticket ?\n            { authorizationHeader: { type: 'Bearer', token: props.ticket } } :\n            undefined));\n\n        const translations = useTranslations([\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.MFA_TITLE },\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.MFA_CHALLENGE_INTRO },\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.MFA_CODE },\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.MFA_VERIFY },\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.MFA_USE_RECOVERY },\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.MFA_USE_AUTHENTICATOR },\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.MFA_USE_EMAIL },\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.MFA_USE_PASSKEY },\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.MFA_PASSKEY_PROMPT },\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.MFA_RECOVERY_CODE },\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.MFA_FAILED },\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.MFA_SEND_CODE },\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.MFA_CODE_SENT },\n        ]);\n\n        const kind = ref<`${UserAuthenticatorKind}`>(\n            KIND_PRIORITY.find((candidate) => props.kinds.includes(candidate)) ?? UserAuthenticatorKind.TOTP,\n        );\n\n        // the other kinds the user can switch to\n        const alternatives = computed(\n            () => props.kinds.filter((candidate) => candidate !== kind.value),\n        );\n\n        const isEmail = computed(() => kind.value === UserAuthenticatorKind.EMAIL);\n        const isRecovery = computed(() => kind.value === UserAuthenticatorKind.RECOVERY);\n        const isWebauthn = computed(() => kind.value === UserAuthenticatorKind.WEBAUTHN);\n\n        const code = ref('');\n        const busy = ref(false);\n        const error = ref<string | null>(null);\n        const emailSent = ref(false);\n\n        const codeLabel = computed(() => (\n            isRecovery.value ? translations.mfaRecoveryCode : translations.mfaCode\n        ));\n\n        const switchLabel = (target: `${UserAuthenticatorKind}`): string => {\n            switch (target) {\n                case UserAuthenticatorKind.RECOVERY: return translations.mfaUseRecovery;\n                case UserAuthenticatorKind.EMAIL: return translations.mfaUseEmail;\n                case UserAuthenticatorKind.WEBAUTHN: return translations.mfaUsePasskey;\n                default: return translations.mfaUseAuthenticator;\n            }\n        };\n\n        const switchKind = (target: `${UserAuthenticatorKind}`) => {\n            kind.value = target;\n            code.value = '';\n            error.value = null;\n            emailSent.value = false;\n        };\n\n        const sendEmailCode = async () => {\n            if (busy.value) {\n                return;\n            }\n\n            busy.value = true;\n            error.value = null;\n            try {\n                await apiClient.userAuthenticator.sendChallenge(\n                    { kind: UserAuthenticatorKind.EMAIL },\n                    requestOptions.value,\n                );\n                emailSent.value = true;\n            } catch (e) {\n                error.value = extractErrorContext(e).message ?? translations.mfaFailed;\n                emit('failed', e);\n            } finally {\n                busy.value = false;\n            }\n        };\n\n        const submit = async () => {\n            if (busy.value || !code.value.trim()) {\n                return;\n            }\n\n            busy.value = true;\n            error.value = null;\n            try {\n                const response = await apiClient.userAuthenticator.verifyChallenge(\n                    {\n                        kind: kind.value,\n                        response: code.value.trim(),\n                    },\n                    requestOptions.value,\n                );\n                emit('done', response);\n            } catch (e) {\n                error.value = extractErrorContext(e).message ?? translations.mfaFailed;\n                emit('failed', e);\n            } finally {\n                busy.value = false;\n            }\n        };\n\n        const authenticateWithPasskey = async () => {\n            // The challenge payload is an opaque Record on the wire (the server\n            // keeps @simplewebauthn types out of the HTTP DTO); narrow it back to\n            // the browser API's option shape at this single boundary.\n            const optionsJSON = (props.challenge?.webauthn ?? null) as\n                unknown as PublicKeyCredentialRequestOptionsJSON | null;\n            if (!optionsJSON || busy.value) {\n                return;\n            }\n\n            busy.value = true;\n            error.value = null;\n            try {\n                const assertion = await startAuthentication({ optionsJSON });\n                const response = await apiClient.userAuthenticator.verifyChallenge(\n                    {\n                        kind: UserAuthenticatorKind.WEBAUTHN,\n                        response: JSON.stringify(assertion),\n                    },\n                    requestOptions.value,\n                );\n                emit('done', response);\n            } catch (e) {\n                error.value = extractErrorContext(e).message ?? translations.mfaFailed;\n                emit('failed', error.value);\n            } finally {\n                busy.value = false;\n            }\n        };\n\n        return {\n            UserAuthenticatorKind,\n            translations,\n            kind,\n            alternatives,\n            isEmail,\n            isWebauthn,\n            code,\n            codeLabel,\n            busy,\n            error,\n            emailSent,\n            switchLabel,\n            switchKind,\n            sendEmailCode,\n            submit,\n            authenticateWithPasskey,\n        };\n    },\n});\n</script>\n<template>\n    <div>\n        <div class=\"text-center\">\n            <h1 class=\"font-bold\">\n                {{ translations.mfaTitle }}\n            </h1>\n        </div>\n\n        <VCAlert\n            v-if=\"error\"\n            color=\"error\"\n            variant=\"soft\"\n            class=\"mb-3\"\n        >\n            {{ error }}\n        </VCAlert>\n\n        <!-- webauthn: a single passkey ceremony button -->\n        <div v-if=\"isWebauthn\">\n            <p class=\"text-center mb-3\">\n                {{ translations.mfaPasskeyPrompt }}\n            </p>\n            <VCButton\n                :disabled=\"busy || !challenge?.webauthn\"\n                :busy=\"busy\"\n                color=\"primary\"\n                :label=\"translations.mfaUsePasskey\"\n                class=\"w-full\"\n                @click=\"authenticateWithPasskey\"\n            />\n        </div>\n\n        <!-- email: request a code first -->\n        <div v-else-if=\"isEmail && !emailSent\">\n            <p class=\"text-center mb-3\">\n                {{ translations.mfaChallengeIntro }}\n            </p>\n            <VCButton\n                :disabled=\"busy\"\n                :busy=\"busy\"\n                color=\"primary\"\n                :label=\"translations.mfaSendCode\"\n                class=\"w-full\"\n                @click=\"sendEmailCode\"\n            />\n        </div>\n\n        <form\n            v-else\n            @submit.prevent=\"submit\"\n        >\n            <p class=\"text-center mb-3\">\n                {{ isEmail ? translations.mfaCodeSent : translations.mfaChallengeIntro }}\n            </p>\n\n            <VCFormGroup>\n                <template #label>\n                    {{ codeLabel }}\n                </template>\n                <VCFormInput\n                    v-model=\"code\"\n                    autocomplete=\"one-time-code\"\n                    autofocus\n                />\n            </VCFormGroup>\n\n            <VCButton\n                :disabled=\"busy || !code.trim()\"\n                :busy=\"busy\"\n                color=\"primary\"\n                :label=\"translations.mfaVerify\"\n                class=\"w-full\"\n                @click=\"submit\"\n            />\n\n            <!-- email: allow requesting a fresh code (a delayed/expired one\n                 otherwise dead-ends the flow); the server enforces a cooldown. -->\n            <div\n                v-if=\"isEmail\"\n                class=\"text-center mt-3\"\n            >\n                <button\n                    type=\"button\"\n                    class=\"a-auth-link\"\n                    :disabled=\"busy\"\n                    @click=\"sendEmailCode\"\n                >\n                    {{ translations.mfaSendCode }}\n                </button>\n            </div>\n        </form>\n\n        <div\n            v-if=\"alternatives.length > 0\"\n            class=\"text-center mt-3 flex flex-col gap-1\"\n        >\n            <button\n                v-for=\"alternative in alternatives\"\n                :key=\"alternative\"\n                type=\"button\"\n                class=\"a-auth-link\"\n                @click=\"switchKind(alternative)\"\n            >\n                {{ switchLabel(alternative) }}\n            </button>\n        </div>\n    </div>\n</template>\n","<!--\n  - Copyright (c) 2026.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\nimport { UserAuthenticatorKind } from '@authup/core-kit';\nimport type { PropType } from 'vue';\nimport {\n    computed,\n    defineComponent,\n    ref,\n} from 'vue';\nimport {\n    TranslatorTranslationClientKey,\n    TranslatorTranslationNamespace,\n} from '@authup/i18n';\nimport { startAuthentication } from '@simplewebauthn/browser';\nimport type { PublicKeyCredentialRequestOptionsJSON } from '@simplewebauthn/browser';\nimport { VCButton } from '@vuecs/button';\nimport { VCAlert } from '@vuecs/elements';\nimport { VCFormGroup, VCFormInput } from '@vuecs/forms';\nimport type { UserAuthenticatorChallengeRequestOptions } from '@authup/core-http-kit';\nimport { extractErrorContext, injectHTTPClient, useTranslations } from '../../../core';\n\n// preference order for the initially-selected factor (most secure first)\nconst KIND_PRIORITY : `${UserAuthenticatorKind}`[] = [\n    UserAuthenticatorKind.WEBAUTHN,\n    UserAuthenticatorKind.TOTP,\n    UserAuthenticatorKind.EMAIL,\n    UserAuthenticatorKind.RECOVERY,\n];\n\nexport default defineComponent({\n    components: {\n        VCButton,\n        VCAlert,\n        VCFormGroup,\n        VCFormInput,\n    },\n    props: {\n        kinds: {\n            type: Array as PropType<`${UserAuthenticatorKind}`[]>,\n            default: () => [UserAuthenticatorKind.TOTP],\n        },\n        // kind-specific challenge payload from GET /authenticators/challenge\n        // (WebAuthn request options under `.webauthn`).\n        challenge: {\n            type: Object as PropType<Record<string, unknown> | null>,\n            default: null,\n        },\n        // MFA-pending login ticket (issue #3242) — a fresh interactive login\n        // has no session bearer yet, so the challenge calls ride the ticket\n        // as an explicit Authorization override. On success the verify\n        // response carries the full token grant (forwarded via `done`).\n        ticket: {\n            type: String as PropType<string | null>,\n            default: null,\n        },\n    },\n    emits: ['done', 'failed'],\n    setup(props, { emit }) {\n        const apiClient = injectHTTPClient();\n\n        const requestOptions = computed<UserAuthenticatorChallengeRequestOptions | undefined>(() => (props.ticket ?\n            { authorizationHeader: { type: 'Bearer', token: props.ticket } } :\n            undefined));\n\n        const translations = useTranslations([\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.MFA_TITLE },\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.MFA_CHALLENGE_INTRO },\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.MFA_CODE },\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.MFA_VERIFY },\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.MFA_USE_RECOVERY },\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.MFA_USE_AUTHENTICATOR },\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.MFA_USE_EMAIL },\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.MFA_USE_PASSKEY },\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.MFA_PASSKEY_PROMPT },\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.MFA_RECOVERY_CODE },\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.MFA_FAILED },\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.MFA_SEND_CODE },\n            { namespace: TranslatorTranslationNamespace.CLIENT, key: TranslatorTranslationClientKey.MFA_CODE_SENT },\n        ]);\n\n        const kind = ref<`${UserAuthenticatorKind}`>(\n            KIND_PRIORITY.find((candidate) => props.kinds.includes(candidate)) ?? UserAuthenticatorKind.TOTP,\n        );\n\n        // the other kinds the user can switch to\n        const alternatives = computed(\n            () => props.kinds.filter((candidate) => candidate !== kind.value),\n        );\n\n        const isEmail = computed(() => kind.value === UserAuthenticatorKind.EMAIL);\n        const isRecovery = computed(() => kind.value === UserAuthenticatorKind.RECOVERY);\n        const isWebauthn = computed(() => kind.value === UserAuthenticatorKind.WEBAUTHN);\n\n        const code = ref('');\n        const busy = ref(false);\n        const error = ref<string | null>(null);\n        const emailSent = ref(false);\n\n        const codeLabel = computed(() => (\n            isRecovery.value ? translations.mfaRecoveryCode : translations.mfaCode\n        ));\n\n        const switchLabel = (target: `${UserAuthenticatorKind}`): string => {\n            switch (target) {\n                case UserAuthenticatorKind.RECOVERY: return translations.mfaUseRecovery;\n                case UserAuthenticatorKind.EMAIL: return translations.mfaUseEmail;\n                case UserAuthenticatorKind.WEBAUTHN: return translations.mfaUsePasskey;\n                default: return translations.mfaUseAuthenticator;\n            }\n        };\n\n        const switchKind = (target: `${UserAuthenticatorKind}`) => {\n            kind.value = target;\n            code.value = '';\n            error.value = null;\n            emailSent.value = false;\n        };\n\n        const sendEmailCode = async () => {\n            if (busy.value) {\n                return;\n            }\n\n            busy.value = true;\n            error.value = null;\n            try {\n                await apiClient.userAuthenticator.sendChallenge(\n                    { kind: UserAuthenticatorKind.EMAIL },\n                    requestOptions.value,\n                );\n                emailSent.value = true;\n            } catch (e) {\n                error.value = extractErrorContext(e).message ?? translations.mfaFailed;\n                emit('failed', e);\n            } finally {\n                busy.value = false;\n            }\n        };\n\n        const submit = async () => {\n            if (busy.value || !code.value.trim()) {\n                return;\n            }\n\n            busy.value = true;\n            error.value = null;\n            try {\n                const response = await apiClient.userAuthenticator.verifyChallenge(\n                    {\n                        kind: kind.value,\n                        response: code.value.trim(),\n                    },\n                    requestOptions.value,\n                );\n                emit('done', response);\n            } catch (e) {\n                error.value = extractErrorContext(e).message ?? translations.mfaFailed;\n                emit('failed', e);\n            } finally {\n                busy.value = false;\n            }\n        };\n\n        const authenticateWithPasskey = async () => {\n            // The challenge payload is an opaque Record on the wire (the server\n            // keeps @simplewebauthn types out of the HTTP DTO); narrow it back to\n            // the browser API's option shape at this single boundary.\n            const optionsJSON = (props.challenge?.webauthn ?? null) as\n                unknown as PublicKeyCredentialRequestOptionsJSON | null;\n            if (!optionsJSON || busy.value) {\n                return;\n            }\n\n            busy.value = true;\n            error.value = null;\n            try {\n                const assertion = await startAuthentication({ optionsJSON });\n                const response = await apiClient.userAuthenticator.verifyChallenge(\n                    {\n                        kind: UserAuthenticatorKind.WEBAUTHN,\n                        response: JSON.stringify(assertion),\n                    },\n                    requestOptions.value,\n                );\n                emit('done', response);\n            } catch (e) {\n                error.value = extractErrorContext(e).message ?? translations.mfaFailed;\n                emit('failed', error.value);\n            } finally {\n                busy.value = false;\n            }\n        };\n\n        return {\n            UserAuthenticatorKind,\n            translations,\n            kind,\n            alternatives,\n            isEmail,\n            isWebauthn,\n            code,\n            codeLabel,\n            busy,\n            error,\n            emailSent,\n            switchLabel,\n            switchKind,\n            sendEmailCode,\n            submit,\n            authenticateWithPasskey,\n        };\n    },\n});\n</script>\n<template>\n    <div>\n        <div class=\"text-center\">\n            <h1 class=\"font-bold\">\n                {{ translations.mfaTitle }}\n            </h1>\n        </div>\n\n        <VCAlert\n            v-if=\"error\"\n            color=\"error\"\n            variant=\"soft\"\n            class=\"mb-3\"\n        >\n            {{ error }}\n        </VCAlert>\n\n        <!-- webauthn: a single passkey ceremony button -->\n        <div v-if=\"isWebauthn\">\n            <p class=\"text-center mb-3\">\n                {{ translations.mfaPasskeyPrompt }}\n            </p>\n            <VCButton\n                :disabled=\"busy || !challenge?.webauthn\"\n                :busy=\"busy\"\n                color=\"primary\"\n                :label=\"translations.mfaUsePasskey\"\n                class=\"w-full\"\n                @click=\"authenticateWithPasskey\"\n            />\n        </div>\n\n        <!-- email: request a code first -->\n        <div v-else-if=\"isEmail && !emailSent\">\n            <p class=\"text-center mb-3\">\n                {{ translations.mfaChallengeIntro }}\n            </p>\n            <VCButton\n                :disabled=\"busy\"\n                :busy=\"busy\"\n                color=\"primary\"\n                :label=\"translations.mfaSendCode\"\n                class=\"w-full\"\n                @click=\"sendEmailCode\"\n            />\n        </div>\n\n        <form\n            v-else\n            @submit.prevent=\"submit\"\n        >\n            <p class=\"text-center mb-3\">\n                {{ isEmail ? translations.mfaCodeSent : translations.mfaChallengeIntro }}\n            </p>\n\n            <VCFormGroup>\n                <template #label>\n                    {{ codeLabel }}\n                </template>\n                <VCFormInput\n                    v-model=\"code\"\n                    autocomplete=\"one-time-code\"\n                    autofocus\n                />\n            </VCFormGroup>\n\n            <VCButton\n                :disabled=\"busy || !code.trim()\"\n                :busy=\"busy\"\n                color=\"primary\"\n                :label=\"translations.mfaVerify\"\n                class=\"w-full\"\n                @click=\"submit\"\n            />\n\n            <!-- email: allow requesting a fresh code (a delayed/expired one\n                 otherwise dead-ends the flow); the server enforces a cooldown. -->\n            <div\n                v-if=\"isEmail\"\n                class=\"text-center mt-3\"\n            >\n                <button\n                    type=\"button\"\n                    class=\"a-auth-link\"\n                    :disabled=\"busy\"\n                    @click=\"sendEmailCode\"\n                >\n                    {{ translations.mfaSendCode }}\n                </button>\n            </div>\n        </form>\n\n        <div\n            v-if=\"alternatives.length > 0\"\n            class=\"text-center mt-3 flex flex-col gap-1\"\n        >\n            <button\n                v-for=\"alternative in alternatives\"\n                :key=\"alternative\"\n                type=\"button\"\n                class=\"a-auth-link\"\n                @click=\"switchKind(alternative)\"\n            >\n                {{ switchLabel(alternative) }}\n            </button>\n        </div>\n    </div>\n</template>\n","<script lang=\"ts\">\nimport type { PropType, Ref } from 'vue';\nimport {\n    computed,\n    defineComponent,\n    nextTick,\n    reactive,\n    ref,\n    shallowRef,\n    watch,\n} from 'vue';\nimport type { IdentityProvider, OAuth2AuthorizationCodeRequest } from '@authup/core-kit';\nimport { IdentityProviderProtocol, UserAuthenticatorKind } from '@authup/core-kit';\nimport { ErrorCode } from '@authup/errors';\nimport { useValidup } from '@validup/vue';\nimport {\n    TranslatorTranslationActionKey,\n    TranslatorTranslationClientKey,\n    TranslatorTranslationEntityKey,\n    TranslatorTranslationFieldKey,\n    TranslatorTranslationNamespace,\n} from '@authup/i18n';\nimport {\n    extractErrorContext,\n    injectHTTPClient,\n    injectStore,\n    useTranslations,\n    useTranslator,\n} from '../../../core';\nimport { createValidator } from '@validup/zod';\nimport { Container } from 'validup';\nimport { z } from 'zod';\nimport type { IQuery } from '@rapiq/core';\nimport { defineQuery } from '@rapiq/core';\nimport { VCButton } from '@vuecs/button';\nimport { VCAlert } from '@vuecs/elements';\nimport { VCFormGroup, VCFormInput, useSubmitButton } from '@vuecs/forms';\nimport type { LinkProps } from '@vuecs/link';\nimport { VCLink } from '@vuecs/link';\nimport type { UserAuthenticatorChallengeVerifyResponse } from '@authup/core-http-kit';\nimport { AIdentityProviderIcon, AIdentityProviders, ARealmPicker } from '../../entities';\nimport { APagination, ATitle } from '../../utility';\nimport AMfaChallengeForm from '../mfa/AMfaChallengeForm.vue';\nimport { IFieldValidation } from '@ilingo/validup-vue';\n\n// Inline by design — login deliberately uses a permissive credentials\n// shape (any non-empty min/max-bounded string) rather than reusing\n// `UserValidator`'s `isUserNameValid` check, which enforces the\n// canonical *creation* rules. The server is the authoritative\n// credentials check; the form just needs basic length validation so\n// the user gets immediate feedback instead of a round-trip 401.\n// Not a candidate for promotion to `@authup/core-kit` — login is not\n// an entity edit.\nclass LoginCredentialsValidator extends Container<{\n    name: string;\n    password: string;\n    realmId: string;\n}> {\n    protected override initialize() {\n        super.initialize();\n        this.mount('name', createValidator(z.string().min(3).max(255)));\n        this.mount('password', createValidator(z.string().min(3).max(255)));\n        this.mount('realmId', { optional: true }, createValidator(z.string()));\n    }\n}\n\nexport default defineComponent({\n    components: {\n        AMfaChallengeForm,\n        ARealmPicker,\n        APagination,\n        ATitle,\n        AIdentityProviders,\n        AIdentityProviderIcon,\n        VCButton,\n        VCAlert,\n        VCFormGroup,\n        VCFormInput,\n        VCLink,\n\n        IFieldValidation,\n    },\n    props: {\n        codeRequest: { type: Object as PropType<OAuth2AuthorizationCodeRequest> },\n        // Presence of a link prop shows the corresponding link beneath the\n        // form. VCLink resolves RouterLink/NuxtLink when a router is present\n        // and `to` is used, otherwise renders a plain anchor — the consumer\n        // controls navigation policy through the props themselves.\n        registerLink: { type: Object as PropType<LinkProps> },\n        passwordForgotLink: { type: Object as PropType<LinkProps> },\n        // OIDC login_hint — pre-fills the identifier field.\n        usernameHint: { type: String },\n    },\n    emits: ['done', 'failed'],\n    setup(props, { emit }) {\n        const apiClient = injectHTTPClient();\n        const store = injectStore();\n\n        const form = reactive({\n            name: props.usernameHint ?? '',\n            password: '',\n            realmId: '',\n        });\n\n        const v = useValidup(new LoginCredentialsValidator(), form);\n\n        const translationsDefault = useTranslations([\n            {\n                namespace: TranslatorTranslationNamespace.ACTION,\n                key: TranslatorTranslationActionKey.LOGIN,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.NAME,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.PASSWORD,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.ENTITY,\n                key: TranslatorTranslationEntityKey.IDENTITY_PROVIDER,\n                count: 2,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.CLIENT,\n                key: TranslatorTranslationClientKey.CREATE_ACCOUNT,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.CLIENT,\n                key: TranslatorTranslationClientKey.FORGOT_PASSWORD,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.CLIENT,\n                key: TranslatorTranslationClientKey.MFA_TITLE,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.CLIENT,\n                key: TranslatorTranslationClientKey.MFA_CHALLENGE_INTRO,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.CLIENT,\n                key: TranslatorTranslationClientKey.MFA_CODE,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.CLIENT,\n                key: TranslatorTranslationClientKey.MFA_VERIFY,\n            },\n        ]);\n\n        const translate = useTranslator();\n\n        const busy = ref(false);\n\n        // Second-factor step (plan 049). The password grant rejects an\n        // MFA-enrolled user's credential-only login with `mfa_required`; rather\n        // than surface that as a dead-end failure, transition to a code step\n        // and resubmit the same credentials WITH the `otp`. Only the single-POST\n        // factors (TOTP / recovery code) can complete here — email/webauthn need\n        // an interactive challenge against a live session, so a user holding\n        // only those is shown the server's message instead of a code field.\n        const otp = ref('');\n        const mfaRequired = ref(false);\n        const mfaKinds = ref<`${UserAuthenticatorKind}`[]>([]);\n        const mfaMessage = ref<string | null>(null);\n\n        // MFA-pending ticket (issue #3242): for factor kinds that cannot ride\n        // the single grant POST (email / webauthn) the server returns a\n        // restricted mfa_token alongside `mfa_required`. The challenge form\n        // runs send/verify against that ticket, and a successful verify\n        // returns the full token grant — applied via store.loginWithTokenGrant.\n        const mfaTicket = ref<string | null>(null);\n        const mfaChallenge = ref<Record<string, unknown> | null>(null);\n\n        // The WebAuthn ceremony needs server-issued request options — fetch\n        // the interactive challenge status with the ticket (also refreshes\n        // the kinds authoritatively).\n        const loadMfaChallengeMaterial = async (ticket: string) => {\n            try {\n                const status = await apiClient.userAuthenticator.challenge({ authorizationHeader: { type: 'Bearer', token: ticket } });\n\n                mfaChallenge.value = status.challenge ?? null;\n                if (status.kinds.length > 0) {\n                    mfaKinds.value = status.kinds;\n                }\n            } catch (e) {\n                mfaMessage.value = extractErrorContext(e).message ?? null;\n            }\n        };\n\n        const completeMfaTicketLogin = async (response?: UserAuthenticatorChallengeVerifyResponse) => {\n            if (busy.value) {\n                return;\n            }\n\n            if (!response || !response.token) {\n                // a server without ticket completion never gets here (no\n                // mfa_token on the error) — defensive dead-end message.\n                mfaMessage.value = await translate({\n                    namespace: TranslatorTranslationNamespace.CLIENT,\n                    key: TranslatorTranslationClientKey.LOGIN_FAILED,\n                });\n                return;\n            }\n\n            busy.value = true;\n            mfaMessage.value = null;\n\n            try {\n                await store.loginWithTokenGrant(response.token);\n\n                emit('done');\n            } catch (e) {\n                mfaMessage.value = extractErrorContext(e).message ?? await translate({\n                    namespace: TranslatorTranslationNamespace.CLIENT,\n                    key: TranslatorTranslationClientKey.LOGIN_FAILED,\n                });\n            } finally {\n                busy.value = false;\n            }\n        };\n\n        const mfaHasCodeFactor = computed<boolean>(() => mfaKinds.value.length === 0 ||\n            mfaKinds.value.includes(UserAuthenticatorKind.TOTP) ||\n            mfaKinds.value.includes(UserAuthenticatorKind.RECOVERY));\n\n        const identityProviderQuery: Ref<IQuery> = shallowRef(defineQuery());\n        const resetIdentityProviderQuery = () => {\n            identityProviderQuery.value = defineQuery<IdentityProvider>({\n                filters: {\n                    realmId: form.realmId || '',\n                    protocol: { $ne: IdentityProviderProtocol.LDAP },\n                    enabled: true,\n                },\n            });\n        };\n\n        resetIdentityProviderQuery();\n\n        const identityProviderRef = ref<null | {\n            load: () => Promise<void>,\n            [key: string]: unknown\n        }>(null);\n        const updateIdentityProviderList = () => {\n            if (identityProviderRef.value) {\n                identityProviderRef.value.load();\n            }\n        };\n\n        const updateRealmId = (realmId: string | string[]) => {\n            form.realmId = Array.isArray(realmId) ? realmId[0] ?? '' : realmId;\n\n            resetIdentityProviderQuery();\n\n            nextTick(() => {\n                updateIdentityProviderList();\n            });\n        };\n\n        watch(\n            () => (props.codeRequest ? props.codeRequest.realm_id : undefined),\n            (value) => {\n                if (value && value !== form.realmId) {\n                    updateRealmId(value);\n                }\n            },\n            { immediate: true },\n        );\n\n        const submit = async () => {\n            if (busy.value) {\n                return;\n            }\n\n            // once in the second-factor step, require a code before resubmitting\n            if (mfaRequired.value && (!mfaHasCodeFactor.value || !otp.value.trim())) {\n                return;\n            }\n\n            busy.value = true;\n            mfaMessage.value = null;\n\n            try {\n                await store.login({\n                    name: form.name,\n                    password: form.password,\n                    realmId: form.realmId,\n                    ...(mfaRequired.value && otp.value.trim() ? { otp: otp.value.trim() } : {}),\n                });\n\n                emit('done');\n            } catch (e: unknown) {\n                const ctx = extractErrorContext(e);\n\n                if (ctx.code === ErrorCode.OAUTH_MFA_REQUIRED) {\n                    const kinds = Array.isArray(ctx.data?.kinds) ?\n                        ctx.data?.kinds as `${UserAuthenticatorKind}`[] :\n                        [];\n                    const hasCodeFactor = kinds.length === 0 ||\n                        kinds.includes(UserAuthenticatorKind.TOTP) ||\n                        kinds.includes(UserAuthenticatorKind.RECOVERY);\n                    const ticket = typeof ctx.data?.mfa_token === 'string' ?\n                        ctx.data.mfa_token :\n                        null;\n\n                    // Entering a challenge step (from the credentials view) is\n                    // silent — the message only surfaces on a later rejection /\n                    // throttle, or when the step can render nothing at all (no\n                    // single-POST factor AND no ticket).\n                    mfaMessage.value = mfaRequired.value || (!hasCodeFactor && !ticket) ?\n                        (ctx.message ?? null) :\n                        null;\n                    mfaKinds.value = kinds;\n                    mfaRequired.value = true;\n                    otp.value = '';\n                    mfaTicket.value = ticket;\n                    mfaChallenge.value = null;\n\n                    if (ticket && kinds.includes(UserAuthenticatorKind.WEBAUTHN)) {\n                        Promise.resolve().then(() => loadMfaChallengeMaterial(ticket));\n                    }\n                    return;\n                }\n\n                // A non-mfa error while completing the second factor (e.g. a\n                // throttle) keeps the step so the user can retry; a failure at\n                // the credentials stage is the normal login failure.\n                if (mfaRequired.value) {\n                    mfaMessage.value = ctx.message ?? await translate({\n                        namespace: TranslatorTranslationNamespace.CLIENT,\n                        key: TranslatorTranslationClientKey.LOGIN_FAILED,\n                    });\n                    return;\n                }\n\n                emit('failed', e instanceof Error ?\n                    e.message :\n                    await translate({\n                        namespace: TranslatorTranslationNamespace.CLIENT,\n                        key: TranslatorTranslationClientKey.LOGIN_FAILED,\n                    }));\n            } finally {\n                busy.value = false;\n            }\n        };\n\n        const buildIdentityProviderURL = (id: string) => apiClient.identityProvider\n            .getAuthorizeUri(id, { codeRequest: props.codeRequest });\n\n        // useSubmitButton from @vuecs/forms returns a computed binding\n        // for VCButton ({ type: 'submit', label, iconLeft, color,\n        // loading, disabled }). Defaults flow through the vuecs\n        // defaults manager so consumers can override label/icon globally;\n        // we override `label` per call below (\"Login\" instead of the\n        // default \"Create\"/\"Update\"). The submission itself is fired by\n        // <form @submit.prevent=\"submit\"> — VCButton just needs to be\n        // type=\"submit\", which the composable already sets.\n        const submitButton = useSubmitButton({\n            loading: busy,\n            disabled: computed(() => busy.value || v.$invalid.value),\n        });\n\n        return {\n            updateRealmId,\n            v,\n            form,\n            submit,\n            busy,\n            submitButton,\n            otp,\n            mfaRequired,\n            mfaMessage,\n            mfaHasCodeFactor,\n            mfaKinds,\n            mfaTicket,\n            mfaChallenge,\n            completeMfaTicketLogin,\n            identityProviderQuery,\n            identityProviderRef,\n            buildIdentityProviderURL,\n            translationsDefault,\n        };\n    },\n});\n</script>\n<template>\n    <div>\n        <!-- MFA-pending ticket step: the challenge form brings its own\n             title + <form>, so it must render OUTSIDE the credentials form\n             (nested forms break SSR hydration). -->\n        <template v-if=\"mfaRequired && mfaTicket\">\n            <VCAlert\n                v-if=\"mfaMessage\"\n                color=\"error\"\n                variant=\"soft\"\n                class=\"mb-3\"\n            >\n                {{ mfaMessage }}\n            </VCAlert>\n\n            <AMfaChallengeForm\n                :kinds=\"mfaKinds\"\n                :challenge=\"mfaChallenge\"\n                :ticket=\"mfaTicket\"\n                @done=\"completeMfaTicketLogin\"\n            />\n        </template>\n        <template v-else>\n            <div class=\"text-center\">\n                <h1 class=\"font-bold\">\n                    {{ mfaRequired ? translationsDefault.mfaTitle : translationsDefault.login }}\n                </h1>\n            </div>\n            <form @submit.prevent=\"submit\">\n                <template v-if=\"mfaRequired\">\n                    <VCAlert\n                        v-if=\"mfaMessage\"\n                        :color=\"mfaHasCodeFactor ? 'error' : 'warning'\"\n                        variant=\"soft\"\n                        class=\"mb-3\"\n                    >\n                        {{ mfaMessage }}\n                    </VCAlert>\n\n                    <template v-if=\"mfaHasCodeFactor\">\n                        <p class=\"text-center mb-3\">\n                            {{ translationsDefault.mfaChallengeIntro }}\n                        </p>\n\n                        <VCFormGroup>\n                            <template #label>\n                                {{ translationsDefault.mfaCode }}\n                            </template>\n                            <VCFormInput\n                                v-model=\"otp\"\n                                autocomplete=\"one-time-code\"\n                                autofocus\n                            />\n                        </VCFormGroup>\n\n                        <VCButton\n                            type=\"submit\"\n                            color=\"primary\"\n                            :busy=\"busy\"\n                            :disabled=\"busy || !otp.trim()\"\n                            :label=\"translationsDefault.mfaVerify\"\n                            class=\"w-full\"\n                            @click=\"submit\"\n                        />\n                    </template>\n                </template>\n\n                <template v-else>\n                    <IFieldValidation\n                        v-slot=\"{ value }\"\n                        :field=\"v.fields.name\"\n                    >\n                        <VCFormGroup :validation=\"value\">\n                            <template #label>\n                                {{ translationsDefault.name }}\n                            </template>\n                            <VCFormInput v-model=\"v.fields.name.$model.value\" />\n                        </VCFormGroup>\n                    </IFieldValidation>\n\n                    <IFieldValidation\n                        v-slot=\"{ value }\"\n                        :field=\"v.fields.password\"\n                    >\n                        <VCFormGroup :validation=\"value\">\n                            <template #label>\n                                {{ translationsDefault.password }}\n                            </template>\n                            <VCFormInput\n                                v-model=\"v.fields.password.$model.value\"\n                                type=\"password\"\n                            />\n                        </VCFormGroup>\n                    </IFieldValidation>\n\n                    <!--\n                <VCFormSubmit> from form-controls 2.x was dropped in\n                @vuecs/forms 4.x. The 4.x replacement is the\n                useSubmitButton() composable (see setup() above) which\n                returns a v-bind-ready computed binding ({ type, label,\n                iconLeft, color, loading, disabled }) for VCButton. The\n                parent <form @submit.prevent=\"submit\"> catches the\n                submission — no @click handler needed here. We override\n                `label` to \"Login\" because the composable's default\n                (sourced from the vuecs defaults manager) is \"Create\".\n            -->\n                    <VCButton\n                        v-bind=\"submitButton\"\n                        :label=\"translationsDefault.login\"\n                        class=\"w-full\"\n                    />\n\n                    <div\n                        v-if=\"registerLink || passwordForgotLink\"\n                        class=\"flex flex-row justify-between mt-2 text-sm\"\n                    >\n                        <VCLink\n                            v-if=\"registerLink\"\n                            v-bind=\"registerLink\"\n                        >\n                            {{ translationsDefault.createAccount }}\n                        </VCLink>\n                        <VCLink\n                            v-if=\"passwordForgotLink\"\n                            v-bind=\"passwordForgotLink\"\n                            class=\"ms-auto\"\n                        >\n                            {{ translationsDefault.forgotPassword }}\n                        </VCLink>\n                    </div>\n\n                    <hr>\n\n                    <template v-if=\"!codeRequest || !codeRequest.realm_id\">\n                        <ARealmPicker\n                            :value=\"form.realmId\"\n                            @change=\"updateRealmId\"\n                        />\n                    </template>\n\n                    <!--\n                      A federated login completes an authorization code request:\n                      authorize-out refuses to start one without it (#3457), so a\n                      provider button is only offered when a request is at hand.\n                    -->\n                    <AIdentityProviders\n                        v-if=\"codeRequest\"\n                        ref=\"identityProviderRef\"\n                        :query=\"identityProviderQuery\"\n                        :footer=\"false\"\n                    >\n                        <template #header>\n                            <ATitle :text=\"translationsDefault.identityProvider\" />\n                        </template>\n                        <template #footer=\"props\">\n                            <APagination\n                                :busy=\"props.busy\"\n                                :meta=\"props.meta\"\n                                :load=\"(data?: any) => props.load?.(data)\"\n                                :total=\"props.total\"\n                            />\n                        </template>\n                        <template #body=\"props\">\n                            <div class=\"flex flex-row flex-wrap gap-1\">\n                                <div\n                                    v-for=\"(item, key) in props.data\"\n                                    :key=\"key\"\n                                    class=\"a-login-provider-item\"\n                                >\n                                    <VCButton\n                                        tag=\"a\"\n                                        :href=\"buildIdentityProviderURL(item.id)\"\n                                        size=\"sm\"\n                                        color=\"neutral\"\n                                        class=\"p-2 a-login-provider-box bg-fg\"\n                                    >\n                                        <div class=\"flex flex-col\">\n                                            <div class=\"text-center mb-1\">\n                                                <AIdentityProviderIcon\n                                                    class=\"text-2xl\"\n                                                    :entity=\"item\"\n                                                />\n                                            </div>\n                                            <div>\n                                                {{ item.name }}\n                                            </div>\n                                        </div>\n                                    </VCButton>\n                                </div>\n                            </div>\n                        </template>\n                    </AIdentityProviders>\n                </template>\n            </form>\n        </template>\n    </div>\n</template>\n","<script lang=\"ts\">\nimport type { PropType, Ref } from 'vue';\nimport {\n    computed,\n    defineComponent,\n    nextTick,\n    reactive,\n    ref,\n    shallowRef,\n    watch,\n} from 'vue';\nimport type { IdentityProvider, OAuth2AuthorizationCodeRequest } from '@authup/core-kit';\nimport { IdentityProviderProtocol, UserAuthenticatorKind } from '@authup/core-kit';\nimport { ErrorCode } from '@authup/errors';\nimport { useValidup } from '@validup/vue';\nimport {\n    TranslatorTranslationActionKey,\n    TranslatorTranslationClientKey,\n    TranslatorTranslationEntityKey,\n    TranslatorTranslationFieldKey,\n    TranslatorTranslationNamespace,\n} from '@authup/i18n';\nimport {\n    extractErrorContext,\n    injectHTTPClient,\n    injectStore,\n    useTranslations,\n    useTranslator,\n} from '../../../core';\nimport { createValidator } from '@validup/zod';\nimport { Container } from 'validup';\nimport { z } from 'zod';\nimport type { IQuery } from '@rapiq/core';\nimport { defineQuery } from '@rapiq/core';\nimport { VCButton } from '@vuecs/button';\nimport { VCAlert } from '@vuecs/elements';\nimport { VCFormGroup, VCFormInput, useSubmitButton } from '@vuecs/forms';\nimport type { LinkProps } from '@vuecs/link';\nimport { VCLink } from '@vuecs/link';\nimport type { UserAuthenticatorChallengeVerifyResponse } from '@authup/core-http-kit';\nimport { AIdentityProviderIcon, AIdentityProviders, ARealmPicker } from '../../entities';\nimport { APagination, ATitle } from '../../utility';\nimport AMfaChallengeForm from '../mfa/AMfaChallengeForm.vue';\nimport { IFieldValidation } from '@ilingo/validup-vue';\n\n// Inline by design — login deliberately uses a permissive credentials\n// shape (any non-empty min/max-bounded string) rather than reusing\n// `UserValidator`'s `isUserNameValid` check, which enforces the\n// canonical *creation* rules. The server is the authoritative\n// credentials check; the form just needs basic length validation so\n// the user gets immediate feedback instead of a round-trip 401.\n// Not a candidate for promotion to `@authup/core-kit` — login is not\n// an entity edit.\nclass LoginCredentialsValidator extends Container<{\n    name: string;\n    password: string;\n    realmId: string;\n}> {\n    protected override initialize() {\n        super.initialize();\n        this.mount('name', createValidator(z.string().min(3).max(255)));\n        this.mount('password', createValidator(z.string().min(3).max(255)));\n        this.mount('realmId', { optional: true }, createValidator(z.string()));\n    }\n}\n\nexport default defineComponent({\n    components: {\n        AMfaChallengeForm,\n        ARealmPicker,\n        APagination,\n        ATitle,\n        AIdentityProviders,\n        AIdentityProviderIcon,\n        VCButton,\n        VCAlert,\n        VCFormGroup,\n        VCFormInput,\n        VCLink,\n\n        IFieldValidation,\n    },\n    props: {\n        codeRequest: { type: Object as PropType<OAuth2AuthorizationCodeRequest> },\n        // Presence of a link prop shows the corresponding link beneath the\n        // form. VCLink resolves RouterLink/NuxtLink when a router is present\n        // and `to` is used, otherwise renders a plain anchor — the consumer\n        // controls navigation policy through the props themselves.\n        registerLink: { type: Object as PropType<LinkProps> },\n        passwordForgotLink: { type: Object as PropType<LinkProps> },\n        // OIDC login_hint — pre-fills the identifier field.\n        usernameHint: { type: String },\n    },\n    emits: ['done', 'failed'],\n    setup(props, { emit }) {\n        const apiClient = injectHTTPClient();\n        const store = injectStore();\n\n        const form = reactive({\n            name: props.usernameHint ?? '',\n            password: '',\n            realmId: '',\n        });\n\n        const v = useValidup(new LoginCredentialsValidator(), form);\n\n        const translationsDefault = useTranslations([\n            {\n                namespace: TranslatorTranslationNamespace.ACTION,\n                key: TranslatorTranslationActionKey.LOGIN,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.NAME,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.PASSWORD,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.ENTITY,\n                key: TranslatorTranslationEntityKey.IDENTITY_PROVIDER,\n                count: 2,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.CLIENT,\n                key: TranslatorTranslationClientKey.CREATE_ACCOUNT,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.CLIENT,\n                key: TranslatorTranslationClientKey.FORGOT_PASSWORD,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.CLIENT,\n                key: TranslatorTranslationClientKey.MFA_TITLE,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.CLIENT,\n                key: TranslatorTranslationClientKey.MFA_CHALLENGE_INTRO,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.CLIENT,\n                key: TranslatorTranslationClientKey.MFA_CODE,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.CLIENT,\n                key: TranslatorTranslationClientKey.MFA_VERIFY,\n            },\n        ]);\n\n        const translate = useTranslator();\n\n        const busy = ref(false);\n\n        // Second-factor step (plan 049). The password grant rejects an\n        // MFA-enrolled user's credential-only login with `mfa_required`; rather\n        // than surface that as a dead-end failure, transition to a code step\n        // and resubmit the same credentials WITH the `otp`. Only the single-POST\n        // factors (TOTP / recovery code) can complete here — email/webauthn need\n        // an interactive challenge against a live session, so a user holding\n        // only those is shown the server's message instead of a code field.\n        const otp = ref('');\n        const mfaRequired = ref(false);\n        const mfaKinds = ref<`${UserAuthenticatorKind}`[]>([]);\n        const mfaMessage = ref<string | null>(null);\n\n        // MFA-pending ticket (issue #3242): for factor kinds that cannot ride\n        // the single grant POST (email / webauthn) the server returns a\n        // restricted mfa_token alongside `mfa_required`. The challenge form\n        // runs send/verify against that ticket, and a successful verify\n        // returns the full token grant — applied via store.loginWithTokenGrant.\n        const mfaTicket = ref<string | null>(null);\n        const mfaChallenge = ref<Record<string, unknown> | null>(null);\n\n        // The WebAuthn ceremony needs server-issued request options — fetch\n        // the interactive challenge status with the ticket (also refreshes\n        // the kinds authoritatively).\n        const loadMfaChallengeMaterial = async (ticket: string) => {\n            try {\n                const status = await apiClient.userAuthenticator.challenge({ authorizationHeader: { type: 'Bearer', token: ticket } });\n\n                mfaChallenge.value = status.challenge ?? null;\n                if (status.kinds.length > 0) {\n                    mfaKinds.value = status.kinds;\n                }\n            } catch (e) {\n                mfaMessage.value = extractErrorContext(e).message ?? null;\n            }\n        };\n\n        const completeMfaTicketLogin = async (response?: UserAuthenticatorChallengeVerifyResponse) => {\n            if (busy.value) {\n                return;\n            }\n\n            if (!response || !response.token) {\n                // a server without ticket completion never gets here (no\n                // mfa_token on the error) — defensive dead-end message.\n                mfaMessage.value = await translate({\n                    namespace: TranslatorTranslationNamespace.CLIENT,\n                    key: TranslatorTranslationClientKey.LOGIN_FAILED,\n                });\n                return;\n            }\n\n            busy.value = true;\n            mfaMessage.value = null;\n\n            try {\n                await store.loginWithTokenGrant(response.token);\n\n                emit('done');\n            } catch (e) {\n                mfaMessage.value = extractErrorContext(e).message ?? await translate({\n                    namespace: TranslatorTranslationNamespace.CLIENT,\n                    key: TranslatorTranslationClientKey.LOGIN_FAILED,\n                });\n            } finally {\n                busy.value = false;\n            }\n        };\n\n        const mfaHasCodeFactor = computed<boolean>(() => mfaKinds.value.length === 0 ||\n            mfaKinds.value.includes(UserAuthenticatorKind.TOTP) ||\n            mfaKinds.value.includes(UserAuthenticatorKind.RECOVERY));\n\n        const identityProviderQuery: Ref<IQuery> = shallowRef(defineQuery());\n        const resetIdentityProviderQuery = () => {\n            identityProviderQuery.value = defineQuery<IdentityProvider>({\n                filters: {\n                    realmId: form.realmId || '',\n                    protocol: { $ne: IdentityProviderProtocol.LDAP },\n                    enabled: true,\n                },\n            });\n        };\n\n        resetIdentityProviderQuery();\n\n        const identityProviderRef = ref<null | {\n            load: () => Promise<void>,\n            [key: string]: unknown\n        }>(null);\n        const updateIdentityProviderList = () => {\n            if (identityProviderRef.value) {\n                identityProviderRef.value.load();\n            }\n        };\n\n        const updateRealmId = (realmId: string | string[]) => {\n            form.realmId = Array.isArray(realmId) ? realmId[0] ?? '' : realmId;\n\n            resetIdentityProviderQuery();\n\n            nextTick(() => {\n                updateIdentityProviderList();\n            });\n        };\n\n        watch(\n            () => (props.codeRequest ? props.codeRequest.realm_id : undefined),\n            (value) => {\n                if (value && value !== form.realmId) {\n                    updateRealmId(value);\n                }\n            },\n            { immediate: true },\n        );\n\n        const submit = async () => {\n            if (busy.value) {\n                return;\n            }\n\n            // once in the second-factor step, require a code before resubmitting\n            if (mfaRequired.value && (!mfaHasCodeFactor.value || !otp.value.trim())) {\n                return;\n            }\n\n            busy.value = true;\n            mfaMessage.value = null;\n\n            try {\n                await store.login({\n                    name: form.name,\n                    password: form.password,\n                    realmId: form.realmId,\n                    ...(mfaRequired.value && otp.value.trim() ? { otp: otp.value.trim() } : {}),\n                });\n\n                emit('done');\n            } catch (e: unknown) {\n                const ctx = extractErrorContext(e);\n\n                if (ctx.code === ErrorCode.OAUTH_MFA_REQUIRED) {\n                    const kinds = Array.isArray(ctx.data?.kinds) ?\n                        ctx.data?.kinds as `${UserAuthenticatorKind}`[] :\n                        [];\n                    const hasCodeFactor = kinds.length === 0 ||\n                        kinds.includes(UserAuthenticatorKind.TOTP) ||\n                        kinds.includes(UserAuthenticatorKind.RECOVERY);\n                    const ticket = typeof ctx.data?.mfa_token === 'string' ?\n                        ctx.data.mfa_token :\n                        null;\n\n                    // Entering a challenge step (from the credentials view) is\n                    // silent — the message only surfaces on a later rejection /\n                    // throttle, or when the step can render nothing at all (no\n                    // single-POST factor AND no ticket).\n                    mfaMessage.value = mfaRequired.value || (!hasCodeFactor && !ticket) ?\n                        (ctx.message ?? null) :\n                        null;\n                    mfaKinds.value = kinds;\n                    mfaRequired.value = true;\n                    otp.value = '';\n                    mfaTicket.value = ticket;\n                    mfaChallenge.value = null;\n\n                    if (ticket && kinds.includes(UserAuthenticatorKind.WEBAUTHN)) {\n                        Promise.resolve().then(() => loadMfaChallengeMaterial(ticket));\n                    }\n                    return;\n                }\n\n                // A non-mfa error while completing the second factor (e.g. a\n                // throttle) keeps the step so the user can retry; a failure at\n                // the credentials stage is the normal login failure.\n                if (mfaRequired.value) {\n                    mfaMessage.value = ctx.message ?? await translate({\n                        namespace: TranslatorTranslationNamespace.CLIENT,\n                        key: TranslatorTranslationClientKey.LOGIN_FAILED,\n                    });\n                    return;\n                }\n\n                emit('failed', e instanceof Error ?\n                    e.message :\n                    await translate({\n                        namespace: TranslatorTranslationNamespace.CLIENT,\n                        key: TranslatorTranslationClientKey.LOGIN_FAILED,\n                    }));\n            } finally {\n                busy.value = false;\n            }\n        };\n\n        const buildIdentityProviderURL = (id: string) => apiClient.identityProvider\n            .getAuthorizeUri(id, { codeRequest: props.codeRequest });\n\n        // useSubmitButton from @vuecs/forms returns a computed binding\n        // for VCButton ({ type: 'submit', label, iconLeft, color,\n        // loading, disabled }). Defaults flow through the vuecs\n        // defaults manager so consumers can override label/icon globally;\n        // we override `label` per call below (\"Login\" instead of the\n        // default \"Create\"/\"Update\"). The submission itself is fired by\n        // <form @submit.prevent=\"submit\"> — VCButton just needs to be\n        // type=\"submit\", which the composable already sets.\n        const submitButton = useSubmitButton({\n            loading: busy,\n            disabled: computed(() => busy.value || v.$invalid.value),\n        });\n\n        return {\n            updateRealmId,\n            v,\n            form,\n            submit,\n            busy,\n            submitButton,\n            otp,\n            mfaRequired,\n            mfaMessage,\n            mfaHasCodeFactor,\n            mfaKinds,\n            mfaTicket,\n            mfaChallenge,\n            completeMfaTicketLogin,\n            identityProviderQuery,\n            identityProviderRef,\n            buildIdentityProviderURL,\n            translationsDefault,\n        };\n    },\n});\n</script>\n<template>\n    <div>\n        <!-- MFA-pending ticket step: the challenge form brings its own\n             title + <form>, so it must render OUTSIDE the credentials form\n             (nested forms break SSR hydration). -->\n        <template v-if=\"mfaRequired && mfaTicket\">\n            <VCAlert\n                v-if=\"mfaMessage\"\n                color=\"error\"\n                variant=\"soft\"\n                class=\"mb-3\"\n            >\n                {{ mfaMessage }}\n            </VCAlert>\n\n            <AMfaChallengeForm\n                :kinds=\"mfaKinds\"\n                :challenge=\"mfaChallenge\"\n                :ticket=\"mfaTicket\"\n                @done=\"completeMfaTicketLogin\"\n            />\n        </template>\n        <template v-else>\n            <div class=\"text-center\">\n                <h1 class=\"font-bold\">\n                    {{ mfaRequired ? translationsDefault.mfaTitle : translationsDefault.login }}\n                </h1>\n            </div>\n            <form @submit.prevent=\"submit\">\n                <template v-if=\"mfaRequired\">\n                    <VCAlert\n                        v-if=\"mfaMessage\"\n                        :color=\"mfaHasCodeFactor ? 'error' : 'warning'\"\n                        variant=\"soft\"\n                        class=\"mb-3\"\n                    >\n                        {{ mfaMessage }}\n                    </VCAlert>\n\n                    <template v-if=\"mfaHasCodeFactor\">\n                        <p class=\"text-center mb-3\">\n                            {{ translationsDefault.mfaChallengeIntro }}\n                        </p>\n\n                        <VCFormGroup>\n                            <template #label>\n                                {{ translationsDefault.mfaCode }}\n                            </template>\n                            <VCFormInput\n                                v-model=\"otp\"\n                                autocomplete=\"one-time-code\"\n                                autofocus\n                            />\n                        </VCFormGroup>\n\n                        <VCButton\n                            type=\"submit\"\n                            color=\"primary\"\n                            :busy=\"busy\"\n                            :disabled=\"busy || !otp.trim()\"\n                            :label=\"translationsDefault.mfaVerify\"\n                            class=\"w-full\"\n                            @click=\"submit\"\n                        />\n                    </template>\n                </template>\n\n                <template v-else>\n                    <IFieldValidation\n                        v-slot=\"{ value }\"\n                        :field=\"v.fields.name\"\n                    >\n                        <VCFormGroup :validation=\"value\">\n                            <template #label>\n                                {{ translationsDefault.name }}\n                            </template>\n                            <VCFormInput v-model=\"v.fields.name.$model.value\" />\n                        </VCFormGroup>\n                    </IFieldValidation>\n\n                    <IFieldValidation\n                        v-slot=\"{ value }\"\n                        :field=\"v.fields.password\"\n                    >\n                        <VCFormGroup :validation=\"value\">\n                            <template #label>\n                                {{ translationsDefault.password }}\n                            </template>\n                            <VCFormInput\n                                v-model=\"v.fields.password.$model.value\"\n                                type=\"password\"\n                            />\n                        </VCFormGroup>\n                    </IFieldValidation>\n\n                    <!--\n                <VCFormSubmit> from form-controls 2.x was dropped in\n                @vuecs/forms 4.x. The 4.x replacement is the\n                useSubmitButton() composable (see setup() above) which\n                returns a v-bind-ready computed binding ({ type, label,\n                iconLeft, color, loading, disabled }) for VCButton. The\n                parent <form @submit.prevent=\"submit\"> catches the\n                submission — no @click handler needed here. We override\n                `label` to \"Login\" because the composable's default\n                (sourced from the vuecs defaults manager) is \"Create\".\n            -->\n                    <VCButton\n                        v-bind=\"submitButton\"\n                        :label=\"translationsDefault.login\"\n                        class=\"w-full\"\n                    />\n\n                    <div\n                        v-if=\"registerLink || passwordForgotLink\"\n                        class=\"flex flex-row justify-between mt-2 text-sm\"\n                    >\n                        <VCLink\n                            v-if=\"registerLink\"\n                            v-bind=\"registerLink\"\n                        >\n                            {{ translationsDefault.createAccount }}\n                        </VCLink>\n                        <VCLink\n                            v-if=\"passwordForgotLink\"\n                            v-bind=\"passwordForgotLink\"\n                            class=\"ms-auto\"\n                        >\n                            {{ translationsDefault.forgotPassword }}\n                        </VCLink>\n                    </div>\n\n                    <hr>\n\n                    <template v-if=\"!codeRequest || !codeRequest.realm_id\">\n                        <ARealmPicker\n                            :value=\"form.realmId\"\n                            @change=\"updateRealmId\"\n                        />\n                    </template>\n\n                    <!--\n                      A federated login completes an authorization code request:\n                      authorize-out refuses to start one without it (#3457), so a\n                      provider button is only offered when a request is at hand.\n                    -->\n                    <AIdentityProviders\n                        v-if=\"codeRequest\"\n                        ref=\"identityProviderRef\"\n                        :query=\"identityProviderQuery\"\n                        :footer=\"false\"\n                    >\n                        <template #header>\n                            <ATitle :text=\"translationsDefault.identityProvider\" />\n                        </template>\n                        <template #footer=\"props\">\n                            <APagination\n                                :busy=\"props.busy\"\n                                :meta=\"props.meta\"\n                                :load=\"(data?: any) => props.load?.(data)\"\n                                :total=\"props.total\"\n                            />\n                        </template>\n                        <template #body=\"props\">\n                            <div class=\"flex flex-row flex-wrap gap-1\">\n                                <div\n                                    v-for=\"(item, key) in props.data\"\n                                    :key=\"key\"\n                                    class=\"a-login-provider-item\"\n                                >\n                                    <VCButton\n                                        tag=\"a\"\n                                        :href=\"buildIdentityProviderURL(item.id)\"\n                                        size=\"sm\"\n                                        color=\"neutral\"\n                                        class=\"p-2 a-login-provider-box bg-fg\"\n                                    >\n                                        <div class=\"flex flex-col\">\n                                            <div class=\"text-center mb-1\">\n                                                <AIdentityProviderIcon\n                                                    class=\"text-2xl\"\n                                                    :entity=\"item\"\n                                                />\n                                            </div>\n                                            <div>\n                                                {{ item.name }}\n                                            </div>\n                                        </div>\n                                    </VCButton>\n                                </div>\n                            </div>\n                        </template>\n                    </AIdentityProviders>\n                </template>\n            </form>\n        </template>\n    </div>\n</template>\n","<!--\n  - Copyright (c) 2026.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\nimport { TranslatorTranslationClientKey, TranslatorTranslationNamespace } from '@authup/i18n';\nimport { VCButton } from '@vuecs/button';\nimport { VCIcon } from '@vuecs/icon';\nimport { computed, defineComponent } from 'vue';\nimport { useTranslation } from '../../../core';\n\nexport default defineComponent({\n    components: { VCButton, VCIcon },\n    props: {\n        // Empty when the identity could not be resolved to a user (e.g. a\n        // non-user session) — \"Continue as\" is then hidden, leaving only the\n        // account-switch escape hatch.\n        identityName: {\n            type: String,\n            default: '',\n        },\n    },\n    emits: ['continue', 'switch'],\n    setup(props, { emit }) {\n        const title = useTranslation({\n            namespace: TranslatorTranslationNamespace.CLIENT,\n            key: TranslatorTranslationClientKey.SELECT_ACCOUNT_TITLE,\n        });\n\n        const continueLabel = useTranslation({\n            namespace: TranslatorTranslationNamespace.CLIENT,\n            key: TranslatorTranslationClientKey.CONTINUE_AS,\n            data: { name: computed(() => props.identityName) },\n        });\n\n        const switchLabel = useTranslation({\n            namespace: TranslatorTranslationNamespace.CLIENT,\n            key: TranslatorTranslationClientKey.USE_ANOTHER_ACCOUNT,\n        });\n\n        return {\n            title,\n            continueLabel,\n            switchLabel,\n            continueAccount: () => emit('continue'),\n            switchAccount: () => emit('switch'),\n        };\n    },\n});\n</script>\n<template>\n    <div class=\"flex flex-col gap-2\">\n        <div class=\"text-center\">\n            <VCIcon\n                name=\"fa6-solid:user\"\n                class=\"text-6xl text-info-600\"\n            />\n        </div>\n        <div class=\"text-center\">\n            <h1 class=\"font-bold\">\n                {{ title }}\n            </h1>\n        </div>\n\n        <div class=\"flex flex-col gap-2 mt-2\">\n            <VCButton\n                v-if=\"identityName\"\n                type=\"button\"\n                color=\"primary\"\n                class=\"w-full\"\n                @click.prevent=\"continueAccount\"\n            >\n                {{ continueLabel }}\n            </VCButton>\n            <VCButton\n                type=\"button\"\n                color=\"neutral\"\n                variant=\"soft\"\n                class=\"w-full\"\n                @click.prevent=\"switchAccount\"\n            >\n                {{ switchLabel }}\n            </VCButton>\n        </div>\n    </div>\n</template>\n","<!--\n  - Copyright (c) 2026.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\nimport { TranslatorTranslationClientKey, TranslatorTranslationNamespace } from '@authup/i18n';\nimport { VCButton } from '@vuecs/button';\nimport { VCIcon } from '@vuecs/icon';\nimport { computed, defineComponent } from 'vue';\nimport { useTranslation } from '../../../core';\n\nexport default defineComponent({\n    components: { VCButton, VCIcon },\n    props: {\n        // Empty when the identity could not be resolved to a user (e.g. a\n        // non-user session) — \"Continue as\" is then hidden, leaving only the\n        // account-switch escape hatch.\n        identityName: {\n            type: String,\n            default: '',\n        },\n    },\n    emits: ['continue', 'switch'],\n    setup(props, { emit }) {\n        const title = useTranslation({\n            namespace: TranslatorTranslationNamespace.CLIENT,\n            key: TranslatorTranslationClientKey.SELECT_ACCOUNT_TITLE,\n        });\n\n        const continueLabel = useTranslation({\n            namespace: TranslatorTranslationNamespace.CLIENT,\n            key: TranslatorTranslationClientKey.CONTINUE_AS,\n            data: { name: computed(() => props.identityName) },\n        });\n\n        const switchLabel = useTranslation({\n            namespace: TranslatorTranslationNamespace.CLIENT,\n            key: TranslatorTranslationClientKey.USE_ANOTHER_ACCOUNT,\n        });\n\n        return {\n            title,\n            continueLabel,\n            switchLabel,\n            continueAccount: () => emit('continue'),\n            switchAccount: () => emit('switch'),\n        };\n    },\n});\n</script>\n<template>\n    <div class=\"flex flex-col gap-2\">\n        <div class=\"text-center\">\n            <VCIcon\n                name=\"fa6-solid:user\"\n                class=\"text-6xl text-info-600\"\n            />\n        </div>\n        <div class=\"text-center\">\n            <h1 class=\"font-bold\">\n                {{ title }}\n            </h1>\n        </div>\n\n        <div class=\"flex flex-col gap-2 mt-2\">\n            <VCButton\n                v-if=\"identityName\"\n                type=\"button\"\n                color=\"primary\"\n                class=\"w-full\"\n                @click.prevent=\"continueAccount\"\n            >\n                {{ continueLabel }}\n            </VCButton>\n            <VCButton\n                type=\"button\"\n                color=\"neutral\"\n                variant=\"soft\"\n                class=\"w-full\"\n                @click.prevent=\"switchAccount\"\n            >\n                {{ switchLabel }}\n            </VCButton>\n        </div>\n    </div>\n</template>\n","<!--\n  - Copyright (c) 2025.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\nimport type { Scope } from '@authup/core-kit';\nimport { VCIcon } from '@vuecs/icon';\nimport type { PropType } from 'vue';\nimport { computed, defineComponent } from 'vue';\n\nexport default defineComponent({\n    components: { VCIcon },\n    props: {\n        entity: {\n            type: Object as PropType<Scope>,\n            required: true,\n        },\n        requested: {\n            type: Array as PropType<string[]>,\n            default: () => [],\n        },\n    },\n    setup(props) {\n        const isEnabled = computed(() => props.requested.includes(props.entity.name));\n\n        return { isEnabled };\n    },\n});\n</script>\n<template>\n    <div>\n        <div class=\"text-center\">\n            <VCIcon\n                :name=\"isEnabled ? 'fa6-solid:check' : 'fa6-solid:xmark'\"\n                :class=\"{\n                    'text-success-600': isEnabled,\n                    'text-error-600': !isEnabled,\n                }\"\n            />\n        </div>\n        <div>\n            <strong>{{ entity.name }}</strong>\n\n            <template v-if=\"entity.description\">\n                <p>{{ entity.description }}</p>\n            </template>\n        </div>\n    </div>\n</template>\n","<!--\n  - Copyright (c) 2025.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\nimport type { Scope } from '@authup/core-kit';\nimport { VCIcon } from '@vuecs/icon';\nimport type { PropType } from 'vue';\nimport { computed, defineComponent } from 'vue';\n\nexport default defineComponent({\n    components: { VCIcon },\n    props: {\n        entity: {\n            type: Object as PropType<Scope>,\n            required: true,\n        },\n        requested: {\n            type: Array as PropType<string[]>,\n            default: () => [],\n        },\n    },\n    setup(props) {\n        const isEnabled = computed(() => props.requested.includes(props.entity.name));\n\n        return { isEnabled };\n    },\n});\n</script>\n<template>\n    <div>\n        <div class=\"text-center\">\n            <VCIcon\n                :name=\"isEnabled ? 'fa6-solid:check' : 'fa6-solid:xmark'\"\n                :class=\"{\n                    'text-success-600': isEnabled,\n                    'text-error-600': !isEnabled,\n                }\"\n            />\n        </div>\n        <div>\n            <strong>{{ entity.name }}</strong>\n\n            <template v-if=\"entity.description\">\n                <p>{{ entity.description }}</p>\n            </template>\n        </div>\n    </div>\n</template>\n","<!--\n  - Copyright (c) 2025.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\nimport type { Client, Scope } from '@authup/core-kit';\nimport { deserializeOAuth2Scope } from '@authup/specs';\nimport type { PropType } from 'vue';\nimport { computed, defineComponent, ref } from 'vue';\nimport { ITranslateT } from '@ilingo/vue';\nimport { injectHTTPClient } from '../../../core';\nimport AuthorizeScope from './AuthorizeScope.vue';\n\nexport default defineComponent({\n    components: { AuthorizeScope, ITranslateT },\n    props: {\n        client: {\n            type: Object as PropType<Client>,\n            required: true,\n        },\n        scopesAvailable: { type: Array as PropType<Scope[]> },\n        scopesRequested: { type: [String, Array] as PropType<string[] | string> },\n    },\n    setup(props) {\n        const httpClient = injectHTTPClient();\n\n        const scopesRequestedNormalized = computed<string[]>(() => {\n            if (!props.scopesRequested) {\n                return [];\n            }\n\n            return Array.isArray(props.scopesRequested) ?\n                props.scopesRequested :\n                deserializeOAuth2Scope(props.scopesRequested);\n        });\n\n        const scopesAvailableNormalized = ref<Scope[]>([]);\n\n        const resolveScopesAvailable = async () => {\n            if (props.scopesAvailable) {\n                scopesAvailableNormalized.value = props.scopesAvailable;\n                return;\n            }\n\n            if (props.client.id) {\n                const { data: clientScopes } = await httpClient.clientScope.getMany({\n                    filters: { clientId: props.client.id },\n                    relations: ['scope'],\n                });\n\n                scopesAvailableNormalized.value = clientScopes.map((clientScope) => clientScope.scope);\n            }\n        };\n\n        Promise.resolve()\n            .then(() => resolveScopesAvailable());\n\n        return {\n            scopesRequestedNormalized,\n            scopesAvailableNormalized,\n        };\n    },\n});\n</script>\n<template>\n    <div v-if=\"scopesAvailableNormalized.length > 0\">\n        <div>\n            <ITranslateT path=\"authupClient.scopeGrantIntro\">\n                <template #client>\n                    <strong>{{ client.name }}</strong>\n                </template>\n            </ITranslateT>\n        </div>\n        <div class=\"flex-col\">\n            <template\n                v-for=\"item in scopesAvailableNormalized\"\n                :key=\"item.id\"\n            >\n                <AuthorizeScope\n                    :entity=\"item\"\n                    class=\"flex flex-row gap-1\"\n                    :requested=\"scopesRequestedNormalized\"\n                />\n            </template>\n        </div>\n    </div>\n</template>\n","<!--\n  - Copyright (c) 2025.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\nimport type { Client, Scope } from '@authup/core-kit';\nimport { deserializeOAuth2Scope } from '@authup/specs';\nimport type { PropType } from 'vue';\nimport { computed, defineComponent, ref } from 'vue';\nimport { ITranslateT } from '@ilingo/vue';\nimport { injectHTTPClient } from '../../../core';\nimport AuthorizeScope from './AuthorizeScope.vue';\n\nexport default defineComponent({\n    components: { AuthorizeScope, ITranslateT },\n    props: {\n        client: {\n            type: Object as PropType<Client>,\n            required: true,\n        },\n        scopesAvailable: { type: Array as PropType<Scope[]> },\n        scopesRequested: { type: [String, Array] as PropType<string[] | string> },\n    },\n    setup(props) {\n        const httpClient = injectHTTPClient();\n\n        const scopesRequestedNormalized = computed<string[]>(() => {\n            if (!props.scopesRequested) {\n                return [];\n            }\n\n            return Array.isArray(props.scopesRequested) ?\n                props.scopesRequested :\n                deserializeOAuth2Scope(props.scopesRequested);\n        });\n\n        const scopesAvailableNormalized = ref<Scope[]>([]);\n\n        const resolveScopesAvailable = async () => {\n            if (props.scopesAvailable) {\n                scopesAvailableNormalized.value = props.scopesAvailable;\n                return;\n            }\n\n            if (props.client.id) {\n                const { data: clientScopes } = await httpClient.clientScope.getMany({\n                    filters: { clientId: props.client.id },\n                    relations: ['scope'],\n                });\n\n                scopesAvailableNormalized.value = clientScopes.map((clientScope) => clientScope.scope);\n            }\n        };\n\n        Promise.resolve()\n            .then(() => resolveScopesAvailable());\n\n        return {\n            scopesRequestedNormalized,\n            scopesAvailableNormalized,\n        };\n    },\n});\n</script>\n<template>\n    <div v-if=\"scopesAvailableNormalized.length > 0\">\n        <div>\n            <ITranslateT path=\"authupClient.scopeGrantIntro\">\n                <template #client>\n                    <strong>{{ client.name }}</strong>\n                </template>\n            </ITranslateT>\n        </div>\n        <div class=\"flex-col\">\n            <template\n                v-for=\"item in scopesAvailableNormalized\"\n                :key=\"item.id\"\n            >\n                <AuthorizeScope\n                    :entity=\"item\"\n                    class=\"flex flex-row gap-1\"\n                    :requested=\"scopesRequestedNormalized\"\n                />\n            </template>\n        </div>\n    </div>\n</template>\n","<!--\n  - Copyright (c) 2025.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\nimport { VCIcon } from '@vuecs/icon';\nimport { defineComponent } from 'vue';\n\nexport default defineComponent({\n    components: { VCIcon },\n    props: {\n        isError: { type: Boolean },\n        message: {\n            type: String,\n            required: true,\n        },\n    },\n});\n</script>\n<template>\n    <div class=\"flex flex-col\">\n        <div class=\"text-center\">\n            <VCIcon\n                :name=\"isError ? 'fa6-solid:exclamation' : 'fa6-solid:info'\"\n                class=\"text-9xl\"\n                :class=\"{\n                    'text-error-600': isError,\n                    'text-info-600': !isError,\n                }\"\n            />\n        </div>\n        <div class=\"text-center fs-6 p-3\">\n            {{ message }}\n        </div>\n    </div>\n</template>\n","<!--\n  - Copyright (c) 2025.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\nimport { VCIcon } from '@vuecs/icon';\nimport { defineComponent } from 'vue';\n\nexport default defineComponent({\n    components: { VCIcon },\n    props: {\n        isError: { type: Boolean },\n        message: {\n            type: String,\n            required: true,\n        },\n    },\n});\n</script>\n<template>\n    <div class=\"flex flex-col\">\n        <div class=\"text-center\">\n            <VCIcon\n                :name=\"isError ? 'fa6-solid:exclamation' : 'fa6-solid:info'\"\n                class=\"text-9xl\"\n                :class=\"{\n                    'text-error-600': isError,\n                    'text-info-600': !isError,\n                }\"\n            />\n        </div>\n        <div class=\"text-center fs-6 p-3\">\n            {{ message }}\n        </div>\n    </div>\n</template>\n","<!--\n  - Copyright (c) 2025.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\n/* global window */\nimport type { Client, OAuth2AuthorizationCodeRequest, Scope } from '@authup/core-kit';\nimport { OAuth2AuthorizationPrompt, OAuth2ErrorCode } from '@authup/specs';\nimport type { PropType } from 'vue';\nimport {\n    computed,\n    defineComponent,\n    onMounted,\n    ref,\n} from 'vue';\nimport {\n    TranslatorTranslationActionKey,\n    TranslatorTranslationClientKey,\n    TranslatorTranslationCommonKey,\n    TranslatorTranslationNamespace,\n} from '@authup/i18n';\nimport { ITranslateT } from '@ilingo/vue';\nimport { VCButton } from '@vuecs/button';\nimport { VCIcon } from '@vuecs/icon';\nimport {\n    extractErrorContext,\n    injectHTTPClient,\n    useTranslation,\n    useTranslations,\n    useTranslationsForNamespace,\n} from '../../../core';\nimport AuthorizeScopes from './AuthorizeScopes.vue';\nimport AuthorizeText from './AuthorizeText.vue';\n\nexport default defineComponent({\n    components: {\n        AuthorizeScopes,\n        AuthorizeText,\n        ITranslateT,\n        VCButton,\n        VCIcon,\n    },\n    props: {\n        client: {\n            type: Object as PropType<Client>,\n            required: true,\n        },\n        scopes: { type: Array as PropType<Scope[]> },\n        codeRequest: {\n            type: Object as PropType<OAuth2AuthorizationCodeRequest>,\n            required: true,\n        },\n        // The signed-in identity's display name — renders the \"Signed in as X —\n        // Not you?\" switch affordance above the consent actions when non-empty.\n        identityName: { type: String, default: '' },\n        // Silent (prompt=none) mode: an auto-consent failure must NOT drop to the\n        // interactive manual-consent UI (that would violate the zero-UI\n        // contract). Instead emit `failed` so the parent redirects an OIDC error.\n        silent: { type: Boolean, default: false },\n        // Whether the redirect_uri matched a registered client pattern\n        // (server-verified). abort()'s access_denied redirect is gated on it —\n        // same as every other redirect in the ladder. Fail-closed default.\n        redirectUriVerified: { type: Boolean, default: false },\n        // Persisted consent rows cover every requested scope (plan 055) —\n        // allows auto-consent for non-builtIn clients. Fail-closed default.\n        consentGranted: { type: Boolean, default: false },\n    },\n    emits: ['loginRequired', 'switch', 'failed'],\n    setup(props, { emit }) {\n        const httpClient = injectHTTPClient();\n\n        const translationsDefault = useTranslations([\n            {\n                namespace: TranslatorTranslationNamespace.COMMON,\n                key: TranslatorTranslationCommonKey.APPLICATION,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.ACTION,\n                key: TranslatorTranslationActionKey.ABORT,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.ACTION,\n                key: TranslatorTranslationActionKey.AUTHORIZE,\n            },\n        ]);\n\n        const translationsClient = useTranslationsForNamespace(\n            TranslatorTranslationNamespace.CLIENT,\n            [\n                { key: TranslatorTranslationClientKey.ACTIVE_SINCE },\n                { key: TranslatorTranslationClientKey.PRIVACY_POLICY },\n                { key: TranslatorTranslationClientKey.TERMS_OF_SERVICE },\n            ],\n        );\n\n        const signedInAsLabel = useTranslation({\n            namespace: TranslatorTranslationNamespace.CLIENT,\n            key: TranslatorTranslationClientKey.SIGNED_IN_AS,\n            data: { name: computed(() => props.identityName) },\n        });\n\n        const notYouLabel = useTranslation({\n            namespace: TranslatorTranslationNamespace.CLIENT,\n            key: TranslatorTranslationClientKey.NOT_YOU,\n        });\n\n        const abortedText = useTranslation({\n            namespace: TranslatorTranslationNamespace.CLIENT,\n            key: TranslatorTranslationClientKey.AUTHORIZE_ABORTED,\n        });\n\n        const accessDeniedTitle = useTranslation({\n            namespace: TranslatorTranslationNamespace.CLIENT,\n            key: TranslatorTranslationClientKey.ACCESS_DENIED_TITLE,\n        });\n\n        const accessDeniedText = useTranslation({\n            namespace: TranslatorTranslationNamespace.CLIENT,\n            key: TranslatorTranslationClientKey.ACCESS_DENIED_TEXT,\n        });\n\n        // Terminal denial: the server's access policy rejected this identity\n        // for the client (unverified-redirect case — a verified denial comes\n        // back as 200 { url } and navigates). No retry: a re-POST re-denies.\n        const accessDenied = ref<boolean>(false);\n\n        // An abort against an unverified redirect_uri can't navigate — the\n        // template renders a terminal \"aborted\" notice instead.\n        const aborted = ref<boolean>(false);\n\n        const abort = () => {\n            // Only redirect access_denied to a redirect_uri that matched a\n            // registered client pattern — for a misconfigured pattern-less\n            // client this click would otherwise be an open redirect.\n            if (!props.redirectUriVerified) {\n                aborted.value = true;\n                return;\n            }\n\n            const url = new URL(String(props.codeRequest.redirect_uri));\n            url.searchParams.set('error', OAuth2ErrorCode.ACCESS_DENIED);\n            url.searchParams.set(\n                'error_description',\n                'The resource owner or authorization server denied the request',\n            );\n\n            if (props.codeRequest.state) {\n                url.searchParams.set('state', props.codeRequest.state);\n            }\n\n            if (typeof window !== 'undefined') {\n                window.location.href = url.href;\n            }\n        };\n\n        // Tracks an auto-consent failure so the template can fall back from the\n        // bare spinner to the full consent UI (giving the user a retry path).\n        const autoConsentFailed = ref<boolean>(false);\n\n        const authorize = async () => {\n            autoConsentFailed.value = false;\n\n            try {\n                // Forward the whole code request so the POST /authorize\n                // re-verification sees every parameter the GET did — notably\n                // code_challenge / code_challenge_method (a public client is\n                // rejected without them), plus nonce / realm_id. Only\n                // client_id is overridden with the resolved client id.\n                const response = await httpClient\n                    .authorize\n                    .confirm({\n                        ...props.codeRequest,\n                        client_id: props.client.id,\n                    });\n\n                const { url } = response;\n\n                if (typeof window !== 'undefined') {\n                    window.location.href = url;\n                }\n            } catch (e) {\n                // Fall back to re-authentication (rather than the manual consent\n                // screen, whose retry would re-POST the same dead bearer forever)\n                // when the request can never succeed as-is:\n                //  - login_required body error: the server rejected the identity\n                //    for this client (realm mismatch — e.g. a stale SSR bundle\n                //    that skipped the client-side realm gate, or a race).\n                //  - HTTP 401: the bearer is dead/expired (a mid-flow session\n                //    sweep, a sibling-tab logout, or an account switch).\n                // In silent (prompt=none) mode the parent's handleLoginRequired\n                // turns this into a login_required OIDC redirect, never UI.\n                const { status, data } = extractErrorContext(e);\n                if (\n                    status === 401 ||\n                    data?.error === OAuth2ErrorCode.LOGIN_REQUIRED\n                ) {\n                    emit('loginRequired');\n                    return;\n                }\n\n                // Silent request: never render interactive consent on failure —\n                // the parent redirects an OIDC error (interaction_required).\n                if (props.silent) {\n                    emit('failed');\n                    return;\n                }\n\n                if (data?.error === OAuth2ErrorCode.ACCESS_DENIED) {\n                    accessDenied.value = true;\n                    return;\n                }\n\n                autoConsentFailed.value = true;\n            }\n        };\n\n        // Auto-consent for built-in clients (e.g. the per-realm `web` client)\n        // and for subjects whose persisted consent already covers every\n        // requested scope (plan 055). `builtIn` is a provisioning-only trust\n        // boundary — the client validator strips it on create/update, so no\n        // API caller can self-assign it. Skipping the scope-consent step is\n        // therefore safe; user/admin-created clients are never builtIn and\n        // show consent until a prior approval covers the request.\n        // prompt=consent (OIDC §3.1.2.1) forces the consent screen regardless\n        // — union/keep happens server-side on the re-approval POST.\n        const autoConsent = computed<boolean>(() => {\n            if (!props.client.builtIn && !props.consentGranted) {\n                return false;\n            }\n\n            const prompts = props.codeRequest.prompt ?\n                props.codeRequest.prompt.split(' ') :\n                [];\n            return !prompts.includes(OAuth2AuthorizationPrompt.CONSENT);\n        });\n\n        // Show the spinner only while an auto-consent submit is in flight. If it\n        // fails, drop to the manual consent UI so the user can retry instead of\n        // staring at a frozen spinner.\n        const showSpinner = computed<boolean>(() => autoConsent.value && !autoConsentFailed.value);\n\n        onMounted(() => {\n            if (autoConsent.value) {\n                authorize();\n            }\n        });\n\n        return {\n            authorize,\n            abort,\n            aborted,\n            abortedText,\n            accessDenied,\n            accessDeniedTitle,\n            accessDeniedText,\n            autoConsent,\n            showSpinner,\n            translationsDefault,\n            translationsClient,\n            signedInAsLabel,\n            notYouLabel,\n            switchAccount: () => emit('switch'),\n        };\n    },\n});\n</script>\n<template>\n    <div\n        v-if=\"accessDenied\"\n        class=\"flex flex-col gap-2\"\n    >\n        <div class=\"text-center\">\n            <h1 class=\"font-bold\">\n                {{ accessDeniedTitle }}\n            </h1>\n        </div>\n        <AuthorizeText\n            :is-error=\"true\"\n            :message=\"accessDeniedText\"\n        />\n    </div>\n    <AuthorizeText\n        v-else-if=\"aborted\"\n        :message=\"abortedText\"\n    />\n    <div\n        v-else-if=\"showSpinner\"\n        class=\"text-center\"\n    >\n        <VCIcon name=\"fa6-solid:spinner\" />\n    </div>\n    <div\n        v-else\n        class=\"flex-col flex gap-2\"\n    >\n        <div class=\"text-center\">\n            <h5 class=\"text-fg-muted mb-1\">\n                {{ translationsDefault.application }}\n            </h5>\n            <h1 class=\"font-bold\">\n                {{ client.name }}\n            </h1>\n        </div>\n\n        <AuthorizeScopes\n            :client=\"client\"\n            :scopes-requested=\"codeRequest.scope\"\n            :scopes-available=\"scopes\"\n        />\n\n        <div class=\"mt-auto\">\n            <div class=\"flex flex-row\">\n                <div>\n                    <VCIcon name=\"fa6-solid:link\" />\n                </div>\n                <div class=\"ms-1\">\n                    <small>\n                        <ITranslateT path=\"authupClient.onceAuthorizedRedirect\">\n                            <template #target>\n                                <strong>{{ codeRequest.redirect_uri }}</strong>\n                            </template>\n                        </ITranslateT>\n                    </small>\n                </div>\n            </div>\n            <div class=\"flex flex-row\">\n                <div>\n                    <VCIcon name=\"fa6-solid:lock\" />\n                </div>\n                <div class=\"ms-1\">\n                    <small>\n                        <ITranslateT\n                            path=\"authupClient.governedBy\"\n                            :data=\"{ client: client.name }\"\n                        >\n                            <template #privacyPolicy>\n                                {{ translationsClient.privacyPolicy }}\n                            </template>\n                            <template #termsOfService>\n                                {{ translationsClient.termsOfService }}\n                            </template>\n                        </ITranslateT>\n                    </small>\n                </div>\n            </div>\n            <div class=\"flex flex-row\">\n                <div>\n                    <VCIcon name=\"fa6-solid:clock\" />\n                </div>\n                <div class=\"ms-1\">\n                    <small>\n                        {{ translationsClient.activeSince }} {{ client.createdAt }}\n                    </small>\n                </div>\n            </div>\n        </div>\n\n        <div\n            v-if=\"identityName\"\n            class=\"text-center\"\n        >\n            <small class=\"text-fg-muted\">\n                {{ signedInAsLabel }} —\n                <button\n                    type=\"button\"\n                    class=\"underline bg-transparent border-0 p-0 cursor-pointer text-inherit\"\n                    @click.prevent=\"switchAccount\"\n                >{{ notYouLabel }}</button>\n            </small>\n        </div>\n\n        <div class=\"flex flex-wrap -mx-2\">\n            <div class=\"w-6/12 px-2\">\n                <VCButton\n                    type=\"button\"\n                    color=\"neutral\"\n                    variant=\"soft\"\n                    class=\"w-full\"\n                    @click.prevent=\"abort\"\n                >\n                    {{ translationsDefault.abort }}\n                </VCButton>\n            </div>\n            <div class=\"w-6/12 px-2\">\n                <VCButton\n                    type=\"button\"\n                    color=\"primary\"\n                    class=\"w-full\"\n                    @click.prevent=\"authorize\"\n                >\n                    {{ translationsDefault.authorize }}\n                </VCButton>\n            </div>\n        </div>\n    </div>\n</template>\n","<!--\n  - Copyright (c) 2025.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\n/* global window */\nimport type { Client, OAuth2AuthorizationCodeRequest, Scope } from '@authup/core-kit';\nimport { OAuth2AuthorizationPrompt, OAuth2ErrorCode } from '@authup/specs';\nimport type { PropType } from 'vue';\nimport {\n    computed,\n    defineComponent,\n    onMounted,\n    ref,\n} from 'vue';\nimport {\n    TranslatorTranslationActionKey,\n    TranslatorTranslationClientKey,\n    TranslatorTranslationCommonKey,\n    TranslatorTranslationNamespace,\n} from '@authup/i18n';\nimport { ITranslateT } from '@ilingo/vue';\nimport { VCButton } from '@vuecs/button';\nimport { VCIcon } from '@vuecs/icon';\nimport {\n    extractErrorContext,\n    injectHTTPClient,\n    useTranslation,\n    useTranslations,\n    useTranslationsForNamespace,\n} from '../../../core';\nimport AuthorizeScopes from './AuthorizeScopes.vue';\nimport AuthorizeText from './AuthorizeText.vue';\n\nexport default defineComponent({\n    components: {\n        AuthorizeScopes,\n        AuthorizeText,\n        ITranslateT,\n        VCButton,\n        VCIcon,\n    },\n    props: {\n        client: {\n            type: Object as PropType<Client>,\n            required: true,\n        },\n        scopes: { type: Array as PropType<Scope[]> },\n        codeRequest: {\n            type: Object as PropType<OAuth2AuthorizationCodeRequest>,\n            required: true,\n        },\n        // The signed-in identity's display name — renders the \"Signed in as X —\n        // Not you?\" switch affordance above the consent actions when non-empty.\n        identityName: { type: String, default: '' },\n        // Silent (prompt=none) mode: an auto-consent failure must NOT drop to the\n        // interactive manual-consent UI (that would violate the zero-UI\n        // contract). Instead emit `failed` so the parent redirects an OIDC error.\n        silent: { type: Boolean, default: false },\n        // Whether the redirect_uri matched a registered client pattern\n        // (server-verified). abort()'s access_denied redirect is gated on it —\n        // same as every other redirect in the ladder. Fail-closed default.\n        redirectUriVerified: { type: Boolean, default: false },\n        // Persisted consent rows cover every requested scope (plan 055) —\n        // allows auto-consent for non-builtIn clients. Fail-closed default.\n        consentGranted: { type: Boolean, default: false },\n    },\n    emits: ['loginRequired', 'switch', 'failed'],\n    setup(props, { emit }) {\n        const httpClient = injectHTTPClient();\n\n        const translationsDefault = useTranslations([\n            {\n                namespace: TranslatorTranslationNamespace.COMMON,\n                key: TranslatorTranslationCommonKey.APPLICATION,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.ACTION,\n                key: TranslatorTranslationActionKey.ABORT,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.ACTION,\n                key: TranslatorTranslationActionKey.AUTHORIZE,\n            },\n        ]);\n\n        const translationsClient = useTranslationsForNamespace(\n            TranslatorTranslationNamespace.CLIENT,\n            [\n                { key: TranslatorTranslationClientKey.ACTIVE_SINCE },\n                { key: TranslatorTranslationClientKey.PRIVACY_POLICY },\n                { key: TranslatorTranslationClientKey.TERMS_OF_SERVICE },\n            ],\n        );\n\n        const signedInAsLabel = useTranslation({\n            namespace: TranslatorTranslationNamespace.CLIENT,\n            key: TranslatorTranslationClientKey.SIGNED_IN_AS,\n            data: { name: computed(() => props.identityName) },\n        });\n\n        const notYouLabel = useTranslation({\n            namespace: TranslatorTranslationNamespace.CLIENT,\n            key: TranslatorTranslationClientKey.NOT_YOU,\n        });\n\n        const abortedText = useTranslation({\n            namespace: TranslatorTranslationNamespace.CLIENT,\n            key: TranslatorTranslationClientKey.AUTHORIZE_ABORTED,\n        });\n\n        const accessDeniedTitle = useTranslation({\n            namespace: TranslatorTranslationNamespace.CLIENT,\n            key: TranslatorTranslationClientKey.ACCESS_DENIED_TITLE,\n        });\n\n        const accessDeniedText = useTranslation({\n            namespace: TranslatorTranslationNamespace.CLIENT,\n            key: TranslatorTranslationClientKey.ACCESS_DENIED_TEXT,\n        });\n\n        // Terminal denial: the server's access policy rejected this identity\n        // for the client (unverified-redirect case — a verified denial comes\n        // back as 200 { url } and navigates). No retry: a re-POST re-denies.\n        const accessDenied = ref<boolean>(false);\n\n        // An abort against an unverified redirect_uri can't navigate — the\n        // template renders a terminal \"aborted\" notice instead.\n        const aborted = ref<boolean>(false);\n\n        const abort = () => {\n            // Only redirect access_denied to a redirect_uri that matched a\n            // registered client pattern — for a misconfigured pattern-less\n            // client this click would otherwise be an open redirect.\n            if (!props.redirectUriVerified) {\n                aborted.value = true;\n                return;\n            }\n\n            const url = new URL(String(props.codeRequest.redirect_uri));\n            url.searchParams.set('error', OAuth2ErrorCode.ACCESS_DENIED);\n            url.searchParams.set(\n                'error_description',\n                'The resource owner or authorization server denied the request',\n            );\n\n            if (props.codeRequest.state) {\n                url.searchParams.set('state', props.codeRequest.state);\n            }\n\n            if (typeof window !== 'undefined') {\n                window.location.href = url.href;\n            }\n        };\n\n        // Tracks an auto-consent failure so the template can fall back from the\n        // bare spinner to the full consent UI (giving the user a retry path).\n        const autoConsentFailed = ref<boolean>(false);\n\n        const authorize = async () => {\n            autoConsentFailed.value = false;\n\n            try {\n                // Forward the whole code request so the POST /authorize\n                // re-verification sees every parameter the GET did — notably\n                // code_challenge / code_challenge_method (a public client is\n                // rejected without them), plus nonce / realm_id. Only\n                // client_id is overridden with the resolved client id.\n                const response = await httpClient\n                    .authorize\n                    .confirm({\n                        ...props.codeRequest,\n                        client_id: props.client.id,\n                    });\n\n                const { url } = response;\n\n                if (typeof window !== 'undefined') {\n                    window.location.href = url;\n                }\n            } catch (e) {\n                // Fall back to re-authentication (rather than the manual consent\n                // screen, whose retry would re-POST the same dead bearer forever)\n                // when the request can never succeed as-is:\n                //  - login_required body error: the server rejected the identity\n                //    for this client (realm mismatch — e.g. a stale SSR bundle\n                //    that skipped the client-side realm gate, or a race).\n                //  - HTTP 401: the bearer is dead/expired (a mid-flow session\n                //    sweep, a sibling-tab logout, or an account switch).\n                // In silent (prompt=none) mode the parent's handleLoginRequired\n                // turns this into a login_required OIDC redirect, never UI.\n                const { status, data } = extractErrorContext(e);\n                if (\n                    status === 401 ||\n                    data?.error === OAuth2ErrorCode.LOGIN_REQUIRED\n                ) {\n                    emit('loginRequired');\n                    return;\n                }\n\n                // Silent request: never render interactive consent on failure —\n                // the parent redirects an OIDC error (interaction_required).\n                if (props.silent) {\n                    emit('failed');\n                    return;\n                }\n\n                if (data?.error === OAuth2ErrorCode.ACCESS_DENIED) {\n                    accessDenied.value = true;\n                    return;\n                }\n\n                autoConsentFailed.value = true;\n            }\n        };\n\n        // Auto-consent for built-in clients (e.g. the per-realm `web` client)\n        // and for subjects whose persisted consent already covers every\n        // requested scope (plan 055). `builtIn` is a provisioning-only trust\n        // boundary — the client validator strips it on create/update, so no\n        // API caller can self-assign it. Skipping the scope-consent step is\n        // therefore safe; user/admin-created clients are never builtIn and\n        // show consent until a prior approval covers the request.\n        // prompt=consent (OIDC §3.1.2.1) forces the consent screen regardless\n        // — union/keep happens server-side on the re-approval POST.\n        const autoConsent = computed<boolean>(() => {\n            if (!props.client.builtIn && !props.consentGranted) {\n                return false;\n            }\n\n            const prompts = props.codeRequest.prompt ?\n                props.codeRequest.prompt.split(' ') :\n                [];\n            return !prompts.includes(OAuth2AuthorizationPrompt.CONSENT);\n        });\n\n        // Show the spinner only while an auto-consent submit is in flight. If it\n        // fails, drop to the manual consent UI so the user can retry instead of\n        // staring at a frozen spinner.\n        const showSpinner = computed<boolean>(() => autoConsent.value && !autoConsentFailed.value);\n\n        onMounted(() => {\n            if (autoConsent.value) {\n                authorize();\n            }\n        });\n\n        return {\n            authorize,\n            abort,\n            aborted,\n            abortedText,\n            accessDenied,\n            accessDeniedTitle,\n            accessDeniedText,\n            autoConsent,\n            showSpinner,\n            translationsDefault,\n            translationsClient,\n            signedInAsLabel,\n            notYouLabel,\n            switchAccount: () => emit('switch'),\n        };\n    },\n});\n</script>\n<template>\n    <div\n        v-if=\"accessDenied\"\n        class=\"flex flex-col gap-2\"\n    >\n        <div class=\"text-center\">\n            <h1 class=\"font-bold\">\n                {{ accessDeniedTitle }}\n            </h1>\n        </div>\n        <AuthorizeText\n            :is-error=\"true\"\n            :message=\"accessDeniedText\"\n        />\n    </div>\n    <AuthorizeText\n        v-else-if=\"aborted\"\n        :message=\"abortedText\"\n    />\n    <div\n        v-else-if=\"showSpinner\"\n        class=\"text-center\"\n    >\n        <VCIcon name=\"fa6-solid:spinner\" />\n    </div>\n    <div\n        v-else\n        class=\"flex-col flex gap-2\"\n    >\n        <div class=\"text-center\">\n            <h5 class=\"text-fg-muted mb-1\">\n                {{ translationsDefault.application }}\n            </h5>\n            <h1 class=\"font-bold\">\n                {{ client.name }}\n            </h1>\n        </div>\n\n        <AuthorizeScopes\n            :client=\"client\"\n            :scopes-requested=\"codeRequest.scope\"\n            :scopes-available=\"scopes\"\n        />\n\n        <div class=\"mt-auto\">\n            <div class=\"flex flex-row\">\n                <div>\n                    <VCIcon name=\"fa6-solid:link\" />\n                </div>\n                <div class=\"ms-1\">\n                    <small>\n                        <ITranslateT path=\"authupClient.onceAuthorizedRedirect\">\n                            <template #target>\n                                <strong>{{ codeRequest.redirect_uri }}</strong>\n                            </template>\n                        </ITranslateT>\n                    </small>\n                </div>\n            </div>\n            <div class=\"flex flex-row\">\n                <div>\n                    <VCIcon name=\"fa6-solid:lock\" />\n                </div>\n                <div class=\"ms-1\">\n                    <small>\n                        <ITranslateT\n                            path=\"authupClient.governedBy\"\n                            :data=\"{ client: client.name }\"\n                        >\n                            <template #privacyPolicy>\n                                {{ translationsClient.privacyPolicy }}\n                            </template>\n                            <template #termsOfService>\n                                {{ translationsClient.termsOfService }}\n                            </template>\n                        </ITranslateT>\n                    </small>\n                </div>\n            </div>\n            <div class=\"flex flex-row\">\n                <div>\n                    <VCIcon name=\"fa6-solid:clock\" />\n                </div>\n                <div class=\"ms-1\">\n                    <small>\n                        {{ translationsClient.activeSince }} {{ client.createdAt }}\n                    </small>\n                </div>\n            </div>\n        </div>\n\n        <div\n            v-if=\"identityName\"\n            class=\"text-center\"\n        >\n            <small class=\"text-fg-muted\">\n                {{ signedInAsLabel }} —\n                <button\n                    type=\"button\"\n                    class=\"underline bg-transparent border-0 p-0 cursor-pointer text-inherit\"\n                    @click.prevent=\"switchAccount\"\n                >{{ notYouLabel }}</button>\n            </small>\n        </div>\n\n        <div class=\"flex flex-wrap -mx-2\">\n            <div class=\"w-6/12 px-2\">\n                <VCButton\n                    type=\"button\"\n                    color=\"neutral\"\n                    variant=\"soft\"\n                    class=\"w-full\"\n                    @click.prevent=\"abort\"\n                >\n                    {{ translationsDefault.abort }}\n                </VCButton>\n            </div>\n            <div class=\"w-6/12 px-2\">\n                <VCButton\n                    type=\"button\"\n                    color=\"primary\"\n                    class=\"w-full\"\n                    @click.prevent=\"authorize\"\n                >\n                    {{ translationsDefault.authorize }}\n                </VCButton>\n            </div>\n        </div>\n    </div>\n</template>\n","<!--\n  - Copyright (c) 2026.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\n/* global window */\nimport { TranslatorTranslationClientKey, TranslatorTranslationNamespace } from '@authup/i18n';\nimport { VCButton } from '@vuecs/button';\nimport { VCIcon } from '@vuecs/icon';\nimport type { PropType } from 'vue';\nimport { computed, defineComponent } from 'vue';\nimport { useTranslation } from '../../../core';\n\nexport default defineComponent({\n    components: { VCButton, VCIcon },\n    props: {\n        clientName: {\n            type: String,\n            required: true,\n        },\n        targetRealmName: {\n            type: String,\n            required: true,\n        },\n        redirectUri: { type: String as PropType<string | undefined> },\n        state: { type: String as PropType<string | undefined> },\n        // Only offer the \"return to application\" redirect when the request\n        // redirect_uri was matched against a registered client pattern\n        // (open-redirect guard for pattern-less clients).\n        redirectUriVerified: {\n            type: Boolean,\n            default: false,\n        },\n    },\n    emits: ['switch'],\n    setup(props, { emit }) {\n        const title = useTranslation({\n            namespace: TranslatorTranslationNamespace.CLIENT,\n            key: TranslatorTranslationClientKey.REALM_MISMATCH_TITLE,\n        });\n\n        const text = useTranslation({\n            namespace: TranslatorTranslationNamespace.CLIENT,\n            key: TranslatorTranslationClientKey.REALM_MISMATCH_TEXT,\n            data: {\n                client: computed(() => props.clientName),\n                realm: computed(() => props.targetRealmName),\n            },\n        });\n\n        const signInLabel = useTranslation({\n            namespace: TranslatorTranslationNamespace.CLIENT,\n            key: TranslatorTranslationClientKey.SIGN_IN_TO_REALM,\n            data: { realm: computed(() => props.targetRealmName) },\n        });\n\n        const returnLabel = useTranslation({\n            namespace: TranslatorTranslationNamespace.CLIENT,\n            key: TranslatorTranslationClientKey.RETURN_TO_APP,\n        });\n\n        const canReturn = computed(() => props.redirectUriVerified && !!props.redirectUri);\n\n        const returnToApp = () => {\n            if (!canReturn.value || !props.redirectUri) {\n                return;\n            }\n\n            const url = new URL(props.redirectUri);\n            url.searchParams.set('error', 'access_denied');\n            url.searchParams.set(\n                'error_description',\n                'The resource owner or authorization server denied the request',\n            );\n            if (props.state) {\n                url.searchParams.set('state', props.state);\n            }\n\n            if (typeof window !== 'undefined') {\n                window.location.href = url.href;\n            }\n        };\n\n        return {\n            title,\n            text,\n            signInLabel,\n            returnLabel,\n            canReturn,\n            returnToApp,\n            switchAccount: () => emit('switch'),\n        };\n    },\n});\n</script>\n<template>\n    <div class=\"flex flex-col gap-2\">\n        <div class=\"text-center\">\n            <VCIcon\n                name=\"fa6-solid:right-left\"\n                class=\"text-6xl text-info-600\"\n            />\n        </div>\n        <div class=\"text-center\">\n            <h1 class=\"font-bold\">\n                {{ title }}\n            </h1>\n        </div>\n        <div class=\"text-center fs-6 px-3\">\n            {{ text }}\n        </div>\n\n        <div class=\"flex flex-col gap-2 mt-2\">\n            <VCButton\n                type=\"button\"\n                color=\"primary\"\n                class=\"w-full\"\n                @click.prevent=\"switchAccount\"\n            >\n                {{ signInLabel }}\n            </VCButton>\n            <VCButton\n                v-if=\"canReturn\"\n                type=\"button\"\n                color=\"neutral\"\n                variant=\"soft\"\n                class=\"w-full\"\n                @click.prevent=\"returnToApp\"\n            >\n                {{ returnLabel }}\n            </VCButton>\n        </div>\n    </div>\n</template>\n","<!--\n  - Copyright (c) 2026.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\n/* global window */\nimport { TranslatorTranslationClientKey, TranslatorTranslationNamespace } from '@authup/i18n';\nimport { VCButton } from '@vuecs/button';\nimport { VCIcon } from '@vuecs/icon';\nimport type { PropType } from 'vue';\nimport { computed, defineComponent } from 'vue';\nimport { useTranslation } from '../../../core';\n\nexport default defineComponent({\n    components: { VCButton, VCIcon },\n    props: {\n        clientName: {\n            type: String,\n            required: true,\n        },\n        targetRealmName: {\n            type: String,\n            required: true,\n        },\n        redirectUri: { type: String as PropType<string | undefined> },\n        state: { type: String as PropType<string | undefined> },\n        // Only offer the \"return to application\" redirect when the request\n        // redirect_uri was matched against a registered client pattern\n        // (open-redirect guard for pattern-less clients).\n        redirectUriVerified: {\n            type: Boolean,\n            default: false,\n        },\n    },\n    emits: ['switch'],\n    setup(props, { emit }) {\n        const title = useTranslation({\n            namespace: TranslatorTranslationNamespace.CLIENT,\n            key: TranslatorTranslationClientKey.REALM_MISMATCH_TITLE,\n        });\n\n        const text = useTranslation({\n            namespace: TranslatorTranslationNamespace.CLIENT,\n            key: TranslatorTranslationClientKey.REALM_MISMATCH_TEXT,\n            data: {\n                client: computed(() => props.clientName),\n                realm: computed(() => props.targetRealmName),\n            },\n        });\n\n        const signInLabel = useTranslation({\n            namespace: TranslatorTranslationNamespace.CLIENT,\n            key: TranslatorTranslationClientKey.SIGN_IN_TO_REALM,\n            data: { realm: computed(() => props.targetRealmName) },\n        });\n\n        const returnLabel = useTranslation({\n            namespace: TranslatorTranslationNamespace.CLIENT,\n            key: TranslatorTranslationClientKey.RETURN_TO_APP,\n        });\n\n        const canReturn = computed(() => props.redirectUriVerified && !!props.redirectUri);\n\n        const returnToApp = () => {\n            if (!canReturn.value || !props.redirectUri) {\n                return;\n            }\n\n            const url = new URL(props.redirectUri);\n            url.searchParams.set('error', 'access_denied');\n            url.searchParams.set(\n                'error_description',\n                'The resource owner or authorization server denied the request',\n            );\n            if (props.state) {\n                url.searchParams.set('state', props.state);\n            }\n\n            if (typeof window !== 'undefined') {\n                window.location.href = url.href;\n            }\n        };\n\n        return {\n            title,\n            text,\n            signInLabel,\n            returnLabel,\n            canReturn,\n            returnToApp,\n            switchAccount: () => emit('switch'),\n        };\n    },\n});\n</script>\n<template>\n    <div class=\"flex flex-col gap-2\">\n        <div class=\"text-center\">\n            <VCIcon\n                name=\"fa6-solid:right-left\"\n                class=\"text-6xl text-info-600\"\n            />\n        </div>\n        <div class=\"text-center\">\n            <h1 class=\"font-bold\">\n                {{ title }}\n            </h1>\n        </div>\n        <div class=\"text-center fs-6 px-3\">\n            {{ text }}\n        </div>\n\n        <div class=\"flex flex-col gap-2 mt-2\">\n            <VCButton\n                type=\"button\"\n                color=\"primary\"\n                class=\"w-full\"\n                @click.prevent=\"switchAccount\"\n            >\n                {{ signInLabel }}\n            </VCButton>\n            <VCButton\n                v-if=\"canReturn\"\n                type=\"button\"\n                color=\"neutral\"\n                variant=\"soft\"\n                class=\"w-full\"\n                @click.prevent=\"returnToApp\"\n            >\n                {{ returnLabel }}\n            </VCButton>\n        </div>\n    </div>\n</template>\n","<!--\n  - Copyright (c) 2026.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\n/* global window */\nimport { TranslatorTranslationCommonKey, TranslatorTranslationNamespace } from '@authup/i18n';\nimport { defineComponent, onMounted } from 'vue';\nimport { useTranslation } from '../../../core';\nimport AuthorizeText from './AuthorizeText.vue';\n\n/**\n * Zero-UI terminal for a `prompt=none` (silent) authorize request: builds the\n * OIDC error redirect (`redirect_uri?error=<code>&state`) and navigates to it\n * on mount. Rendered only when `redirect_uri` was verified against a\n * registered client pattern — the caller falls back to interactive UI\n * otherwise (never redirect an OIDC error to an unverified URI).\n *\n * The redirect is client-only (`window`), so SSR renders the \"redirecting\"\n * text and the browser performs the navigation after hydration.\n */\nexport default defineComponent({\n    components: { AuthorizeText },\n    props: {\n        redirectUri: { type: String, required: true },\n        error: { type: String, required: true },\n        state: { type: String },\n    },\n    setup(props) {\n        const message = useTranslation({\n            namespace: TranslatorTranslationNamespace.COMMON,\n            key: TranslatorTranslationCommonKey.LOADING,\n        });\n\n        onMounted(() => {\n            const url = new URL(props.redirectUri);\n            url.searchParams.set('error', props.error);\n            if (props.state) {\n                url.searchParams.set('state', props.state);\n            }\n\n            if (typeof window !== 'undefined') {\n                window.location.href = url.href;\n            }\n        });\n\n        return { message };\n    },\n});\n</script>\n<template>\n    <AuthorizeText :message=\"message\" />\n</template>\n","<!--\n  - Copyright (c) 2026.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\n/* global window */\nimport { TranslatorTranslationCommonKey, TranslatorTranslationNamespace } from '@authup/i18n';\nimport { defineComponent, onMounted } from 'vue';\nimport { useTranslation } from '../../../core';\nimport AuthorizeText from './AuthorizeText.vue';\n\n/**\n * Zero-UI terminal for a `prompt=none` (silent) authorize request: builds the\n * OIDC error redirect (`redirect_uri?error=<code>&state`) and navigates to it\n * on mount. Rendered only when `redirect_uri` was verified against a\n * registered client pattern — the caller falls back to interactive UI\n * otherwise (never redirect an OIDC error to an unverified URI).\n *\n * The redirect is client-only (`window`), so SSR renders the \"redirecting\"\n * text and the browser performs the navigation after hydration.\n */\nexport default defineComponent({\n    components: { AuthorizeText },\n    props: {\n        redirectUri: { type: String, required: true },\n        error: { type: String, required: true },\n        state: { type: String },\n    },\n    setup(props) {\n        const message = useTranslation({\n            namespace: TranslatorTranslationNamespace.COMMON,\n            key: TranslatorTranslationCommonKey.LOADING,\n        });\n\n        onMounted(() => {\n            const url = new URL(props.redirectUri);\n            url.searchParams.set('error', props.error);\n            if (props.state) {\n                url.searchParams.set('state', props.state);\n            }\n\n            if (typeof window !== 'undefined') {\n                window.location.href = url.href;\n            }\n        });\n\n        return { message };\n    },\n});\n</script>\n<template>\n    <AuthorizeText :message=\"message\" />\n</template>\n","<!--\n  - Copyright (c) 2025.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\nimport type {\n    Client,\n    OAuth2AuthorizationCodeRequest,\n    Realm,\n    Scope,\n} from '@authup/core-kit';\nimport type { UserAuthenticatorChallengeResponse } from '@authup/core-http-kit';\nimport { IDENTITY_PROVIDER_LOGIN_NOT_PENDING } from '@authup/core-http-kit';\nimport { storeToRefs } from 'pinia';\nimport type { PropType, VNodeChild } from 'vue';\nimport {\n    Suspense,\n    computed,\n    defineComponent,\n    h,\n    onMounted,\n    ref,\n    watch,\n} from 'vue';\nimport {\n    TranslatorTranslationClientKey,\n    TranslatorTranslationCommonKey,\n    TranslatorTranslationNamespace,\n} from '@authup/i18n';\nimport {\n    OAuth2AuthenticationContextClass,\n    OAuth2AuthorizationPrompt,\n    OAuth2ErrorCode,\n    unwrapOAuth2Scope,\n} from '@authup/specs';\nimport type { LinkProps } from '@vuecs/link';\nimport {\n    StoreAuthOrigin,\n    extractErrorContext,\n    injectHTTPClient,\n    injectStore,\n    useTranslation,\n} from '../../../core';\nimport AAuthShell from '../../utility/AAuthShell.vue';\nimport LoginForm from '../login/LoginForm.vue';\nimport AMfaChallengeForm from '../mfa/AMfaChallengeForm.vue';\nimport AUserAuthenticatorEnroll from '../../entities/user-authenticator/AUserAuthenticatorEnroll.vue';\nimport AAccountPrompt from './AAccountPrompt.vue';\nimport AuthorizeForm from './AuthorizeForm.vue';\nimport AuthorizeRealmMismatch from './AuthorizeRealmMismatch.vue';\nimport AuthorizeSilentRedirect from './AuthorizeSilentRedirect.vue';\nimport AuthorizeText from './AuthorizeText.vue';\n\nconst wrapChild = (child: VNodeChild) => h(\n    AAuthShell,\n    null,\n    { default: () => child },\n);\n\ntype RealmSummary = Pick<Realm, 'id' | 'name' | 'displayName'>;\n\nexport default defineComponent({\n    components: {\n        AAccountPrompt,\n        AuthorizeText,\n        AuthorizeForm,\n        AuthorizeRealmMismatch,\n        AuthorizeSilentRedirect,\n        AMfaChallengeForm,\n        AUserAuthenticatorEnroll,\n        LoginForm,\n    },\n    props: {\n        codeRequest: { type: Object as PropType<OAuth2AuthorizationCodeRequest> },\n        client: { type: Object as PropType<Client> },\n        clientId: { type: String },\n        scopes: { type: Array as PropType<Scope[]> },\n        error: { type: Object as PropType<Error> },\n        registerLink: { type: Object as PropType<LinkProps> },\n        passwordForgotLink: { type: Object as PropType<LinkProps> },\n        realm: { type: Object as PropType<RealmSummary> },\n        redirectUriVerified: { type: Boolean, default: false },\n        /**\n         * The one-time handle a federated callback put on this URL, for the\n         * session it established (plan 094). It is redeemed AFTER mount, so\n         * the resulting lastAuthOrigin change reaches the watch below and\n         * the login counts as fresh: select_account then skips the chooser\n         * (the account was chosen at the provider) and prompt=login does not\n         * demand a second credential entry.\n         */\n        federatedLogin: { type: Object as PropType<{ providerId: string }> },\n    },\n    emits: ['redirect', 'failed'],\n    setup(props, { emit }) {\n        const httpClient = injectHTTPClient();\n        const store = injectStore();\n        const {\n            acr,\n            loggedIn,\n            lastAuthOrigin,\n            realmId,\n            user,\n        } = storeToRefs(store);\n\n        // Held true from the first render (SSR included) so the login form\n        // never flashes while the handle is in flight.\n        const federatedLoginPending = ref<boolean>(!!props.federatedLogin);\n\n        // Local logout — the reactive loggedIn flip re-renders into the\n        // realm-pinned login form below.\n        const switchAccount = () => {\n            store.logout();\n        };\n\n        // prompt=login: force re-authentication with a banner (instead of the\n        // silent switchAccount) — set proactively for prompt=login, and when the\n        // server's max_age/freshness backstop surfaces login_required mid-flow.\n        const reauthRequired = ref<boolean>(false);\n\n        // When a silent (prompt=none) request can only be resolved by\n        // redirecting an OIDC error to the RP, this holds the error code and the\n        // render returns AuthorizeSilentRedirect.\n        const silentErrorCode = ref<`${OAuth2ErrorCode}` | null>(null);\n\n        // A login_required from AuthorizeForm's auto-consent (the server\n        // max_age/freshness backstop) — silent requests redirect the error;\n        // interactive prompt=login shows the login form with a re-auth banner.\n        const handleLoginRequired = () => {\n            const prompts = (props.codeRequest?.prompt ?? '').split(' ').filter(Boolean);\n            // Only redirect the OIDC error to a *verified* redirect_uri; an\n            // unverified one degrades to interactive re-auth (falling through to\n            // the login form) instead of dead-ending on a frozen spinner.\n            if (prompts.includes(OAuth2AuthorizationPrompt.NONE) && props.redirectUriVerified) {\n                silentErrorCode.value = OAuth2ErrorCode.LOGIN_REQUIRED;\n                return;\n            }\n\n            reauthRequired.value = true;\n            store.logout();\n        };\n\n        // prompt=select_account chooser: once the user picks \"continue as\",\n        // proceed past the chooser to consent for the rest of this render cycle.\n        const accountConfirmedLocal = ref<boolean>(false);\n\n        // A login performed *on this page* IS the account selection — don't then\n        // re-prompt \"continue as X\" for the account whose credentials were just\n        // entered. The store stamps lastAuthOrigin only at the END of a settled\n        // login()/exchange/restore, so watching it for a CHANGE to LOGIN during\n        // this mount is race-free (unlike LoginForm's `done` emit, which is lost\n        // when the token flip re-renders Authorize and unmounts the form — the\n        // bug this replaced) and mount-scoped: a *lingering* session — whether\n        // restored from cookies (origin RESTORE) or logged in before this page\n        // was opened (origin already LOGIN, no change) — still gets the chooser,\n        // while a fresh on-page login skips it.\n        // Second-factor requirement locally satisfied on THIS page (see the\n        // MFA gate below) — declared up here so the fresh-login watch can\n        // stamp it.\n        const mfaSatisfiedLocal = ref<boolean>(false);\n\n        watch(lastAuthOrigin, (value) => {\n            if (value !== StoreAuthOrigin.LOGIN) {\n                return;\n            }\n\n            accountConfirmedLocal.value = true;\n\n            // A login whose grant already verified the second factor (the\n            // inline `otp` step or the MFA-pending ticket completion,\n            // issue #3242) carries acr urn:authup:mfa — its session is\n            // mfa_at-stamped, so re-prompting the challenge here would be\n            // a redundant second ceremony. Scoped to a fresh ON-PAGE login;\n            // lingering/restored sessions keep the pre-consent challenge\n            // (it also pre-empts acr step-up freshness).\n            if (acr.value === OAuth2AuthenticationContextClass.MFA) {\n                mfaSatisfiedLocal.value = true;\n            }\n        });\n\n        const accountConfirmed = computed<boolean>(() => accountConfirmedLocal.value);\n\n        // MFA gate (plan 049). The server POST /authorize backstop is\n        // authoritative; this renders the interactive challenge / inline\n        // enrollment so the code request can succeed. The proof is\n        // session-bound (mfa_at) — the challenge endpoint stamps it — so\n        // once satisfied on THIS page we proceed to consent.\n        const mfaStatus = ref<UserAuthenticatorChallengeResponse | null>(null);\n        const mfaResolving = ref<boolean>(false);\n\n        // The endpoint answers what THIS session still owes, which depends on\n        // the authorization request being satisfied: a session an external\n        // provider established owes a local factor only when an application\n        // asked for one. It is the server's rule; the page just states the\n        // request it is running.\n        const challengeOptions = () => ({ acrValues: props.codeRequest?.acr_values });\n\n        const refreshMfaStatus = async () => {\n            mfaResolving.value = true;\n            try {\n                mfaStatus.value = await httpClient.userAuthenticator.challenge(challengeOptions());\n            } catch {\n                try {\n                    // one retry before failing open — absorbs a transient blip\n                    // without permanently disabling the client-side gate for the\n                    // rest of this render lifecycle.\n                    mfaStatus.value = await httpClient.userAuthenticator.challenge(challengeOptions());\n                } catch {\n                    // an errored challenge lookup must not brick the ladder —\n                    // the server backstop still gates the code issuance.\n                    mfaStatus.value = {\n                        required: false,\n                        enrollmentRequired: false,\n                        kinds: [],\n                    };\n                }\n            } finally {\n                mfaResolving.value = false;\n            }\n        };\n\n        /**\n         * A redemption that failed is terminal for this render. The person\n         * came back from an external provider, so continuing the ladder\n         * against whatever session the cookies already hold would consent an\n         * application into the WRONG account, silently for a builtIn client.\n         */\n        const federatedError = ref<string | null>(null);\n\n        onMounted(async () => {\n            const federated = props.federatedLogin;\n            if (!federated) {\n                return;\n            }\n\n            try {\n                const grant = await httpClient.identityProvider.completeLogin(\n                    federated.providerId,\n                );\n\n                await store.loginWithTokenGrant(grant);\n            } catch (e) {\n                const ctx = extractErrorContext(e);\n                const message = ctx.message ??\n                    (e instanceof Error ? e.message : String(e));\n\n                // The visitor's intent was the provider account, so a failed\n                // redemption must leave no session for the ladder to run\n                // against. The block below lasts only for this render, and the\n                // page has already dropped the `provider` hint from the URL, so\n                // a reload would otherwise consent the application into\n                // whatever account the cookies still hold - silently, for a\n                // builtIn client.\n                //\n                // Skipped when the server says no completion was pending: the\n                // hint is a plain query parameter anyone can put in a link, and\n                // logging out on that answer would turn every authorize URL\n                // into a one-click logout for whoever opens it.\n                if (ctx.data?.reason !== IDENTITY_PROVIDER_LOGIN_NOT_PENDING) {\n                    store.logout();\n                }\n\n                federatedError.value = message;\n                emit('failed', message);\n            } finally {\n                federatedLoginPending.value = false;\n            }\n        });\n\n        // Persisted-consent covering probe (plan 055). The subject's\n        // per-scope consent rows for this client decide whether the manual\n        // consent screen can be skipped (auto-consent) — computed client-side\n        // from the self-scoped row list, mirroring the mfaStatus pattern:\n        // null = probe pending (ladder shows a loading text), afterwards\n        // { covered } is the settled decision. built_in clients never probe\n        // (they keep zero rows and auto-consent regardless).\n        const consentStatus = ref<null | { covered: boolean }>(null);\n\n        const requestedScopeTokens = computed<string[]>(\n            // Drop empty tokens exactly like the server's record/covering path\n            // (a comma/whitespace-padded scope yields a '' element) — otherwise\n            // the '' can never match a row and a recorded grant reads as\n            // uncovered forever.\n            () => unwrapOAuth2Scope(props.codeRequest?.scope ?? []).filter((token) => token.length > 0),\n        );\n\n        const refreshConsentStatus = async () => {\n            // The probe (and auto-consent) only applies to a resolved USER\n            // subject. The server force-scopes a permissionless caller to its\n            // own rows, but an actor holding CONSENT_READ (admin / realm_admin)\n            // would otherwise receive every subject's rows — so the request is\n            // explicitly subject-filtered and the covering match re-checks\n            // sub/subKind (defense in depth: never auto-consent off another\n            // subject's grant).\n            if (!props.client || props.client.builtIn) {\n                consentStatus.value = { covered: false };\n                return;\n            }\n\n            const subjectId = user.value?.id;\n            if (!subjectId) {\n                // No resolved user yet: stay pending (loading text) until the\n                // session settles; a settled non-user session (client)\n                // then falls through to manual consent — never auto-consent.\n                if (userSettled.value) {\n                    consentStatus.value = { covered: false };\n                }\n                return;\n            }\n\n            try {\n                const { data } = await httpClient.consent.getMany({\n                    filters: {\n                        clientId: props.client.id,\n                        sub: subjectId,\n                        subKind: 'user',\n                    },\n                    pagination: { limit: 50 },\n                });\n\n                // Drop a response that is no longer current — a logout or\n                // account switch that landed while the probe was in flight\n                // must never latch a stale cross-account verdict.\n                if (!loggedIn.value || user.value?.id !== subjectId) {\n                    return;\n                }\n\n                const now = new Date().toISOString();\n                const covered = requestedScopeTokens.value.length > 0 &&\n                    requestedScopeTokens.value.every((token) => data.some(\n                        (row) => row.scope === token &&\n                            row.sub === subjectId &&\n                            row.subKind === 'user' &&\n                            (!row.expiresAt || row.expiresAt > now),\n                    ));\n\n                consentStatus.value = { covered };\n            } catch {\n                // probe failure → re-prompt (fail safe: never auto-consent on\n                // an unknown covering state).\n                if (!loggedIn.value || user.value?.id !== subjectId) {\n                    return;\n                }\n                consentStatus.value = { covered: false };\n            }\n        };\n\n        // Fetch once the identity is logged in (and refetch after a switch).\n        watch(loggedIn, (value) => {\n            if (value && !mfaStatus.value && !mfaResolving.value) {\n                Promise.resolve().then(() => refreshMfaStatus());\n            }\n            if (!value) {\n                mfaStatus.value = null;\n                mfaSatisfiedLocal.value = false;\n            }\n        }, { immediate: true });\n\n        const error = ref<Error | null>(null);\n        const client = ref<Client | null>(null);\n\n        // The chooser needs the resolved user for \"Continue as X\" — but\n        // loggedIn/realmId are truthy for ANY identity (token introspection),\n        // while the userinfo fetch fails for a non-user (client)\n        // session, or transiently for a cookie-restored one. Re-resolve and\n        // track settlement so the chooser can offer an escape hatch instead\n        // of spinning forever on the loading text.\n        const userSettled = ref<boolean>(!!user.value);\n        if (!userSettled.value) {\n            Promise.resolve()\n                .then(() => store.resolve())\n                .catch(() => {\n                    // settled — user stays null, the chooser renders the\n                    // account-switch escape hatch instead of the spinner.\n                })\n                .finally(() => {\n                    userSettled.value = true;\n                });\n        }\n\n        // The covering probe is driven by the resolved USER subject (not the\n        // access-token-derived loggedIn, which flips before userInfo resolves)\n        // and by the requested scopes — reset + refetch whenever the subject,\n        // its settlement, or the code request changes, so the decision is\n        // always computed for the current subject and never carried across an\n        // account switch or a code-request change.\n        watch(\n            [loggedIn, () => user.value?.id, userSettled, () => props.codeRequest],\n            () => {\n                consentStatus.value = null;\n                if (loggedIn.value) {\n                    Promise.resolve().then(() => refreshConsentStatus());\n                }\n            },\n            { immediate: true },\n        );\n\n        const loadingText = useTranslation({\n            namespace: TranslatorTranslationNamespace.COMMON,\n            key: TranslatorTranslationCommonKey.LOADING,\n        });\n\n        const reauthText = useTranslation({\n            namespace: TranslatorTranslationNamespace.CLIENT,\n            key: TranslatorTranslationClientKey.REAUTH_TEXT,\n        });\n\n        const consentStatusLoadingText = useTranslation({\n            namespace: TranslatorTranslationNamespace.CLIENT,\n            key: TranslatorTranslationClientKey.CONSENT_STATUS_LOADING,\n        });\n\n        // A silent (prompt=none) request that needs interaction must redirect\n        // the OIDC error to the RP — but ONLY to a redirect_uri that matched a\n        // registered client pattern. Without that, degrade to interactive UI.\n        const silentRedirect = (errorCode: `${OAuth2ErrorCode}`): VNodeChild | null => {\n            if (!props.codeRequest?.redirect_uri || !props.redirectUriVerified) {\n                return null;\n            }\n\n            return wrapChild(h(AuthorizeSilentRedirect, {\n                redirectUri: props.codeRequest.redirect_uri,\n                error: errorCode,\n                state: props.codeRequest.state,\n            }));\n        };\n\n        const resolve = async () => {\n            if (props.error) {\n                error.value = props.error;\n                return;\n            }\n\n            if (props.client) {\n                client.value = props.client;\n            }\n\n            if (props.clientId) {\n                try {\n                    client.value = (await httpClient.client.getOne(props.clientId)).data;\n                } catch (e) {\n                    if (e instanceof Error) {\n                        error.value = e;\n                    }\n                }\n            }\n        };\n\n        Promise.resolve()\n            .then(() => resolve());\n\n        return () => {\n            if (error.value) {\n                return wrapChild(h(AuthorizeText, {\n                    message: error.value.message,\n                    isError: true,\n                }));\n            }\n\n            if (!props.codeRequest) {\n                return [];\n            }\n\n            const prompts = (props.codeRequest.prompt ?? '').split(' ').filter(Boolean);\n            const isSilent = prompts.includes(OAuth2AuthorizationPrompt.NONE);\n            const isReauth = prompts.includes(OAuth2AuthorizationPrompt.LOGIN);\n\n            // A mid-flow login_required routed a silent request to an error\n            // redirect (the store's max_age backstop). Emit it once it is known.\n            if (isSilent && silentErrorCode.value) {\n                const redirect = silentRedirect(silentErrorCode.value);\n                if (redirect) {\n                    return redirect;\n                }\n            }\n\n            // A federated return holds the WHOLE ladder, not just its\n            // logged-out branch: a session already in the cookies (another\n            // tab, a lingering one) would otherwise let the ladder run against\n            // that identity while the redemption is still in flight, and a\n            // builtIn client auto-consents on mount — delivering the\n            // application a code for the wrong account.\n            if (federatedLoginPending.value) {\n                return wrapChild(h(AuthorizeText, { message: loadingText.value }));\n            }\n\n            // A failed completion must not let the ladder continue against a\n            // session the cookies already hold: that would consent an\n            // application into the wrong account, silently for a built-in\n            // client. With no such session there is nothing to protect, so\n            // the person gets the reason AND a way to carry on.\n            if (federatedError.value && loggedIn.value) {\n                return wrapChild(h(AuthorizeText, {\n                    message: federatedError.value,\n                    isError: true,\n                }));\n            }\n\n            // Force re-authentication: prompt=login (proactive) or a login_required\n            // surfaced mid-flow. Show the login form (with a banner) until a fresh\n            // login on THIS page stamps lastAuthOrigin (accountConfirmed).\n            const forceReauth = (isReauth || reauthRequired.value) && !accountConfirmed.value;\n\n            if (forceReauth || !loggedIn.value) {\n                // A silent request can never render a login form — redirect the\n                // login_required error to the RP (falls through to the form only\n                // when the redirect_uri was not verified).\n                if (isSilent) {\n                    const redirect = silentRedirect(OAuth2ErrorCode.LOGIN_REQUIRED);\n                    if (redirect) {\n                        return redirect;\n                    }\n                }\n\n                const loginNode = h(Suspense, {}, {\n                    default: () => h(LoginForm, {\n                        codeRequest: props.codeRequest,\n                        registerLink: props.registerLink,\n                        passwordForgotLink: props.passwordForgotLink,\n                        usernameHint: props.codeRequest?.login_hint,\n                        // fresh-login → skip the chooser: handled race-free by\n                        // the lastAuthOrigin watch, not LoginForm's `done`.\n                        onFailed: (message: string) => emit('failed', message),\n                    }),\n                    fallback: () => h(AuthorizeText, { message: loadingText.value }),\n                });\n\n                // A failed federated completion states its reason above the\n                // form rather than replacing the page: with no session to\n                // protect, the person can simply carry on.\n                if (federatedError.value) {\n                    return wrapChild([\n                        h(AuthorizeText, { message: federatedError.value, isError: true }),\n                        loginNode,\n                    ]);\n                }\n\n                // prompt=login / mid-flow re-auth: a banner above the form\n                // explaining why credentials are requested again.\n                return wrapChild(forceReauth ?\n                    [h(AuthorizeText, { message: reauthText.value }), loginNode] :\n                    loginNode);\n            }\n\n            // Realm binding (UX only — the server POST /authorize gate is\n            // authoritative). Wait until the store has resolved the signed-in\n            // identity's realm before deciding, so a built_in client's\n            // AuthorizeForm auto-consent (onMounted) can't fire before a\n            // mismatch is detected.\n            if (!realmId.value) {\n                return wrapChild(h(AuthorizeText, { message: loadingText.value }));\n            }\n\n            if (\n                props.codeRequest.realm_id &&\n                realmId.value !== props.codeRequest.realm_id\n            ) {\n                // Silent: can't reuse a foreign-realm session → login_required.\n                if (isSilent) {\n                    const redirect = silentRedirect(OAuth2ErrorCode.LOGIN_REQUIRED);\n                    if (redirect) {\n                        return redirect;\n                    }\n                }\n\n                return wrapChild(h(AuthorizeRealmMismatch, {\n                    clientName: props.client?.name ?? '',\n                    targetRealmName: props.realm?.displayName || props.realm?.name || '',\n                    redirectUri: props.codeRequest.redirect_uri,\n                    state: props.codeRequest.state,\n                    redirectUriVerified: props.redirectUriVerified,\n                    onSwitch: switchAccount,\n                }));\n            }\n\n            // prompt=select_account: offer \"continue as X / use another account\"\n            // instead of silently continuing the current session. Wait for the\n            // user to resolve so the chooser never flashes \"Continue as \" with an\n            // empty name.\n            if (\n                prompts.includes(OAuth2AuthorizationPrompt.SELECT_ACCOUNT) &&\n                !accountConfirmed.value\n            ) {\n                if (!user.value) {\n                    // Resolution still in flight — loading text is fine. Once\n                    // settled with no user (a non-user identity, or a userinfo\n                    // fetch that keeps failing), offer \"use another account\"\n                    // (an empty identityName hides the continue action)\n                    // instead of an indefinite spinner.\n                    if (!userSettled.value) {\n                        return wrapChild(h(AuthorizeText, { message: loadingText.value }));\n                    }\n\n                    return wrapChild(h(AAccountPrompt, {\n                        identityName: '',\n                        onSwitch: switchAccount,\n                    }));\n                }\n\n                return wrapChild(h(AAccountPrompt, {\n                    identityName: user.value.name ?? user.value.displayName ?? '',\n                    onContinue: () => { accountConfirmedLocal.value = true; },\n                    onSwitch: switchAccount,\n                }));\n            }\n\n            // MFA gate (plan 049) — interactive only. A silent (prompt=none)\n            // request can't render a challenge form; its AuthorizeForm\n            // auto-consent hits the server backstop and redirects the OIDC\n            // error (interaction_required), so skip the form here for silent.\n            if (!isSilent && !mfaSatisfiedLocal.value) {\n                // Block consent until the status is known — AuthorizeForm\n                // auto-submits for built_in clients, so it must not render\n                // before we know whether a factor is required.\n                if (!mfaStatus.value) {\n                    return wrapChild(h(AuthorizeText, { message: loadingText.value }));\n                }\n\n                if (mfaStatus.value.required) {\n                    return wrapChild(h(AMfaChallengeForm, {\n                        kinds: mfaStatus.value.kinds,\n                        challenge: mfaStatus.value.challenge ?? null,\n                        onDone: () => { mfaSatisfiedLocal.value = true; },\n                        onFailed: (message: string) => emit('failed', message),\n                    }));\n                }\n\n                // mfaRequired + no device → configure inline, then re-check\n                // (the freshly enrolled device makes the next status.required).\n                if (mfaStatus.value.enrollmentRequired) {\n                    return wrapChild(h(AUserAuthenticatorEnroll, {\n                        onDone: () => {\n                            mfaStatus.value = null;\n                            Promise.resolve().then(() => refreshMfaStatus());\n                        },\n                        onFailed: (e: unknown) => emit(\n                            'failed',\n                            e instanceof Error ? e.message : String(e),\n                        ),\n                    }));\n                }\n            }\n\n            if (!client.value) {\n                return [];\n            }\n\n            // Consent probe gate (plan 055) — block the consent decision until\n            // the covering probe settles. Applies to logged-in users on\n            // non-built_in clients only: built_in clients never depend on the\n            // probe (today's auto-consent flow preserved exactly), and the\n            // logged-out branches returned earlier. Silent requests must wait\n            // here too, or they'd race to a false consent_required redirect.\n            if (!client.value.builtIn && consentStatus.value === null) {\n                return wrapChild(h(AuthorizeText, { message: consentStatusLoadingText.value }));\n            }\n\n            // A silent request against a non-built_in client can only proceed\n            // when the persisted consent rows cover every requested scope —\n            // otherwise consent_required.\n            if (\n                isSilent &&\n                !client.value.builtIn &&\n                consentStatus.value?.covered !== true\n            ) {\n                const redirect = silentRedirect(OAuth2ErrorCode.CONSENT_REQUIRED);\n                if (redirect) {\n                    return redirect;\n                }\n            }\n\n            return wrapChild(h(Suspense, {}, {\n                default: () => h(AuthorizeForm, {\n                    codeRequest: props.codeRequest!,\n                    client: client.value!,\n                    scopes: props.scopes,\n                    // \"Signed in as X — Not you?\" switch affordance on the manual\n                    // consent screen (present even when the RP sent no\n                    // prompt=select_account).\n                    identityName: user.value?.name ?? user.value?.displayName ?? '',\n                    // abort()'s access_denied redirect is gated on the verified\n                    // redirect_uri, like every other redirect in the ladder.\n                    redirectUriVerified: props.redirectUriVerified,\n                    // Persisted consent covers every requested scope →\n                    // AuthorizeForm may auto-consent (unless prompt=consent).\n                    consentGranted: consentStatus.value?.covered === true,\n                    // Silent (built_in) request: auto-consent runs, but a failure\n                    // must redirect an OIDC error, never render manual consent —\n                    // but only when the redirect_uri is verified. Otherwise the\n                    // error can't be redirected, so drop the silent flag and let\n                    // AuthorizeForm fall back to interactive manual consent.\n                    silent: isSilent && props.redirectUriVerified,\n                    onSwitch: switchAccount,\n                    onLoginRequired: handleLoginRequired,\n                    onFailed: () => {\n                        silentErrorCode.value = OAuth2ErrorCode.INTERACTION_REQUIRED;\n                    },\n                }),\n                fallback: () => h(AuthorizeText, { message: loadingText.value }),\n            }));\n        };\n    },\n});\n</script>\n","<!--\n  - Copyright (c) 2025.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\nimport type {\n    Client,\n    OAuth2AuthorizationCodeRequest,\n    Realm,\n    Scope,\n} from '@authup/core-kit';\nimport type { UserAuthenticatorChallengeResponse } from '@authup/core-http-kit';\nimport { IDENTITY_PROVIDER_LOGIN_NOT_PENDING } from '@authup/core-http-kit';\nimport { storeToRefs } from 'pinia';\nimport type { PropType, VNodeChild } from 'vue';\nimport {\n    Suspense,\n    computed,\n    defineComponent,\n    h,\n    onMounted,\n    ref,\n    watch,\n} from 'vue';\nimport {\n    TranslatorTranslationClientKey,\n    TranslatorTranslationCommonKey,\n    TranslatorTranslationNamespace,\n} from '@authup/i18n';\nimport {\n    OAuth2AuthenticationContextClass,\n    OAuth2AuthorizationPrompt,\n    OAuth2ErrorCode,\n    unwrapOAuth2Scope,\n} from '@authup/specs';\nimport type { LinkProps } from '@vuecs/link';\nimport {\n    StoreAuthOrigin,\n    extractErrorContext,\n    injectHTTPClient,\n    injectStore,\n    useTranslation,\n} from '../../../core';\nimport AAuthShell from '../../utility/AAuthShell.vue';\nimport LoginForm from '../login/LoginForm.vue';\nimport AMfaChallengeForm from '../mfa/AMfaChallengeForm.vue';\nimport AUserAuthenticatorEnroll from '../../entities/user-authenticator/AUserAuthenticatorEnroll.vue';\nimport AAccountPrompt from './AAccountPrompt.vue';\nimport AuthorizeForm from './AuthorizeForm.vue';\nimport AuthorizeRealmMismatch from './AuthorizeRealmMismatch.vue';\nimport AuthorizeSilentRedirect from './AuthorizeSilentRedirect.vue';\nimport AuthorizeText from './AuthorizeText.vue';\n\nconst wrapChild = (child: VNodeChild) => h(\n    AAuthShell,\n    null,\n    { default: () => child },\n);\n\ntype RealmSummary = Pick<Realm, 'id' | 'name' | 'displayName'>;\n\nexport default defineComponent({\n    components: {\n        AAccountPrompt,\n        AuthorizeText,\n        AuthorizeForm,\n        AuthorizeRealmMismatch,\n        AuthorizeSilentRedirect,\n        AMfaChallengeForm,\n        AUserAuthenticatorEnroll,\n        LoginForm,\n    },\n    props: {\n        codeRequest: { type: Object as PropType<OAuth2AuthorizationCodeRequest> },\n        client: { type: Object as PropType<Client> },\n        clientId: { type: String },\n        scopes: { type: Array as PropType<Scope[]> },\n        error: { type: Object as PropType<Error> },\n        registerLink: { type: Object as PropType<LinkProps> },\n        passwordForgotLink: { type: Object as PropType<LinkProps> },\n        realm: { type: Object as PropType<RealmSummary> },\n        redirectUriVerified: { type: Boolean, default: false },\n        /**\n         * The one-time handle a federated callback put on this URL, for the\n         * session it established (plan 094). It is redeemed AFTER mount, so\n         * the resulting lastAuthOrigin change reaches the watch below and\n         * the login counts as fresh: select_account then skips the chooser\n         * (the account was chosen at the provider) and prompt=login does not\n         * demand a second credential entry.\n         */\n        federatedLogin: { type: Object as PropType<{ providerId: string }> },\n    },\n    emits: ['redirect', 'failed'],\n    setup(props, { emit }) {\n        const httpClient = injectHTTPClient();\n        const store = injectStore();\n        const {\n            acr,\n            loggedIn,\n            lastAuthOrigin,\n            realmId,\n            user,\n        } = storeToRefs(store);\n\n        // Held true from the first render (SSR included) so the login form\n        // never flashes while the handle is in flight.\n        const federatedLoginPending = ref<boolean>(!!props.federatedLogin);\n\n        // Local logout — the reactive loggedIn flip re-renders into the\n        // realm-pinned login form below.\n        const switchAccount = () => {\n            store.logout();\n        };\n\n        // prompt=login: force re-authentication with a banner (instead of the\n        // silent switchAccount) — set proactively for prompt=login, and when the\n        // server's max_age/freshness backstop surfaces login_required mid-flow.\n        const reauthRequired = ref<boolean>(false);\n\n        // When a silent (prompt=none) request can only be resolved by\n        // redirecting an OIDC error to the RP, this holds the error code and the\n        // render returns AuthorizeSilentRedirect.\n        const silentErrorCode = ref<`${OAuth2ErrorCode}` | null>(null);\n\n        // A login_required from AuthorizeForm's auto-consent (the server\n        // max_age/freshness backstop) — silent requests redirect the error;\n        // interactive prompt=login shows the login form with a re-auth banner.\n        const handleLoginRequired = () => {\n            const prompts = (props.codeRequest?.prompt ?? '').split(' ').filter(Boolean);\n            // Only redirect the OIDC error to a *verified* redirect_uri; an\n            // unverified one degrades to interactive re-auth (falling through to\n            // the login form) instead of dead-ending on a frozen spinner.\n            if (prompts.includes(OAuth2AuthorizationPrompt.NONE) && props.redirectUriVerified) {\n                silentErrorCode.value = OAuth2ErrorCode.LOGIN_REQUIRED;\n                return;\n            }\n\n            reauthRequired.value = true;\n            store.logout();\n        };\n\n        // prompt=select_account chooser: once the user picks \"continue as\",\n        // proceed past the chooser to consent for the rest of this render cycle.\n        const accountConfirmedLocal = ref<boolean>(false);\n\n        // A login performed *on this page* IS the account selection — don't then\n        // re-prompt \"continue as X\" for the account whose credentials were just\n        // entered. The store stamps lastAuthOrigin only at the END of a settled\n        // login()/exchange/restore, so watching it for a CHANGE to LOGIN during\n        // this mount is race-free (unlike LoginForm's `done` emit, which is lost\n        // when the token flip re-renders Authorize and unmounts the form — the\n        // bug this replaced) and mount-scoped: a *lingering* session — whether\n        // restored from cookies (origin RESTORE) or logged in before this page\n        // was opened (origin already LOGIN, no change) — still gets the chooser,\n        // while a fresh on-page login skips it.\n        // Second-factor requirement locally satisfied on THIS page (see the\n        // MFA gate below) — declared up here so the fresh-login watch can\n        // stamp it.\n        const mfaSatisfiedLocal = ref<boolean>(false);\n\n        watch(lastAuthOrigin, (value) => {\n            if (value !== StoreAuthOrigin.LOGIN) {\n                return;\n            }\n\n            accountConfirmedLocal.value = true;\n\n            // A login whose grant already verified the second factor (the\n            // inline `otp` step or the MFA-pending ticket completion,\n            // issue #3242) carries acr urn:authup:mfa — its session is\n            // mfa_at-stamped, so re-prompting the challenge here would be\n            // a redundant second ceremony. Scoped to a fresh ON-PAGE login;\n            // lingering/restored sessions keep the pre-consent challenge\n            // (it also pre-empts acr step-up freshness).\n            if (acr.value === OAuth2AuthenticationContextClass.MFA) {\n                mfaSatisfiedLocal.value = true;\n            }\n        });\n\n        const accountConfirmed = computed<boolean>(() => accountConfirmedLocal.value);\n\n        // MFA gate (plan 049). The server POST /authorize backstop is\n        // authoritative; this renders the interactive challenge / inline\n        // enrollment so the code request can succeed. The proof is\n        // session-bound (mfa_at) — the challenge endpoint stamps it — so\n        // once satisfied on THIS page we proceed to consent.\n        const mfaStatus = ref<UserAuthenticatorChallengeResponse | null>(null);\n        const mfaResolving = ref<boolean>(false);\n\n        // The endpoint answers what THIS session still owes, which depends on\n        // the authorization request being satisfied: a session an external\n        // provider established owes a local factor only when an application\n        // asked for one. It is the server's rule; the page just states the\n        // request it is running.\n        const challengeOptions = () => ({ acrValues: props.codeRequest?.acr_values });\n\n        const refreshMfaStatus = async () => {\n            mfaResolving.value = true;\n            try {\n                mfaStatus.value = await httpClient.userAuthenticator.challenge(challengeOptions());\n            } catch {\n                try {\n                    // one retry before failing open — absorbs a transient blip\n                    // without permanently disabling the client-side gate for the\n                    // rest of this render lifecycle.\n                    mfaStatus.value = await httpClient.userAuthenticator.challenge(challengeOptions());\n                } catch {\n                    // an errored challenge lookup must not brick the ladder —\n                    // the server backstop still gates the code issuance.\n                    mfaStatus.value = {\n                        required: false,\n                        enrollmentRequired: false,\n                        kinds: [],\n                    };\n                }\n            } finally {\n                mfaResolving.value = false;\n            }\n        };\n\n        /**\n         * A redemption that failed is terminal for this render. The person\n         * came back from an external provider, so continuing the ladder\n         * against whatever session the cookies already hold would consent an\n         * application into the WRONG account, silently for a builtIn client.\n         */\n        const federatedError = ref<string | null>(null);\n\n        onMounted(async () => {\n            const federated = props.federatedLogin;\n            if (!federated) {\n                return;\n            }\n\n            try {\n                const grant = await httpClient.identityProvider.completeLogin(\n                    federated.providerId,\n                );\n\n                await store.loginWithTokenGrant(grant);\n            } catch (e) {\n                const ctx = extractErrorContext(e);\n                const message = ctx.message ??\n                    (e instanceof Error ? e.message : String(e));\n\n                // The visitor's intent was the provider account, so a failed\n                // redemption must leave no session for the ladder to run\n                // against. The block below lasts only for this render, and the\n                // page has already dropped the `provider` hint from the URL, so\n                // a reload would otherwise consent the application into\n                // whatever account the cookies still hold - silently, for a\n                // builtIn client.\n                //\n                // Skipped when the server says no completion was pending: the\n                // hint is a plain query parameter anyone can put in a link, and\n                // logging out on that answer would turn every authorize URL\n                // into a one-click logout for whoever opens it.\n                if (ctx.data?.reason !== IDENTITY_PROVIDER_LOGIN_NOT_PENDING) {\n                    store.logout();\n                }\n\n                federatedError.value = message;\n                emit('failed', message);\n            } finally {\n                federatedLoginPending.value = false;\n            }\n        });\n\n        // Persisted-consent covering probe (plan 055). The subject's\n        // per-scope consent rows for this client decide whether the manual\n        // consent screen can be skipped (auto-consent) — computed client-side\n        // from the self-scoped row list, mirroring the mfaStatus pattern:\n        // null = probe pending (ladder shows a loading text), afterwards\n        // { covered } is the settled decision. built_in clients never probe\n        // (they keep zero rows and auto-consent regardless).\n        const consentStatus = ref<null | { covered: boolean }>(null);\n\n        const requestedScopeTokens = computed<string[]>(\n            // Drop empty tokens exactly like the server's record/covering path\n            // (a comma/whitespace-padded scope yields a '' element) — otherwise\n            // the '' can never match a row and a recorded grant reads as\n            // uncovered forever.\n            () => unwrapOAuth2Scope(props.codeRequest?.scope ?? []).filter((token) => token.length > 0),\n        );\n\n        const refreshConsentStatus = async () => {\n            // The probe (and auto-consent) only applies to a resolved USER\n            // subject. The server force-scopes a permissionless caller to its\n            // own rows, but an actor holding CONSENT_READ (admin / realm_admin)\n            // would otherwise receive every subject's rows — so the request is\n            // explicitly subject-filtered and the covering match re-checks\n            // sub/subKind (defense in depth: never auto-consent off another\n            // subject's grant).\n            if (!props.client || props.client.builtIn) {\n                consentStatus.value = { covered: false };\n                return;\n            }\n\n            const subjectId = user.value?.id;\n            if (!subjectId) {\n                // No resolved user yet: stay pending (loading text) until the\n                // session settles; a settled non-user session (client)\n                // then falls through to manual consent — never auto-consent.\n                if (userSettled.value) {\n                    consentStatus.value = { covered: false };\n                }\n                return;\n            }\n\n            try {\n                const { data } = await httpClient.consent.getMany({\n                    filters: {\n                        clientId: props.client.id,\n                        sub: subjectId,\n                        subKind: 'user',\n                    },\n                    pagination: { limit: 50 },\n                });\n\n                // Drop a response that is no longer current — a logout or\n                // account switch that landed while the probe was in flight\n                // must never latch a stale cross-account verdict.\n                if (!loggedIn.value || user.value?.id !== subjectId) {\n                    return;\n                }\n\n                const now = new Date().toISOString();\n                const covered = requestedScopeTokens.value.length > 0 &&\n                    requestedScopeTokens.value.every((token) => data.some(\n                        (row) => row.scope === token &&\n                            row.sub === subjectId &&\n                            row.subKind === 'user' &&\n                            (!row.expiresAt || row.expiresAt > now),\n                    ));\n\n                consentStatus.value = { covered };\n            } catch {\n                // probe failure → re-prompt (fail safe: never auto-consent on\n                // an unknown covering state).\n                if (!loggedIn.value || user.value?.id !== subjectId) {\n                    return;\n                }\n                consentStatus.value = { covered: false };\n            }\n        };\n\n        // Fetch once the identity is logged in (and refetch after a switch).\n        watch(loggedIn, (value) => {\n            if (value && !mfaStatus.value && !mfaResolving.value) {\n                Promise.resolve().then(() => refreshMfaStatus());\n            }\n            if (!value) {\n                mfaStatus.value = null;\n                mfaSatisfiedLocal.value = false;\n            }\n        }, { immediate: true });\n\n        const error = ref<Error | null>(null);\n        const client = ref<Client | null>(null);\n\n        // The chooser needs the resolved user for \"Continue as X\" — but\n        // loggedIn/realmId are truthy for ANY identity (token introspection),\n        // while the userinfo fetch fails for a non-user (client)\n        // session, or transiently for a cookie-restored one. Re-resolve and\n        // track settlement so the chooser can offer an escape hatch instead\n        // of spinning forever on the loading text.\n        const userSettled = ref<boolean>(!!user.value);\n        if (!userSettled.value) {\n            Promise.resolve()\n                .then(() => store.resolve())\n                .catch(() => {\n                    // settled — user stays null, the chooser renders the\n                    // account-switch escape hatch instead of the spinner.\n                })\n                .finally(() => {\n                    userSettled.value = true;\n                });\n        }\n\n        // The covering probe is driven by the resolved USER subject (not the\n        // access-token-derived loggedIn, which flips before userInfo resolves)\n        // and by the requested scopes — reset + refetch whenever the subject,\n        // its settlement, or the code request changes, so the decision is\n        // always computed for the current subject and never carried across an\n        // account switch or a code-request change.\n        watch(\n            [loggedIn, () => user.value?.id, userSettled, () => props.codeRequest],\n            () => {\n                consentStatus.value = null;\n                if (loggedIn.value) {\n                    Promise.resolve().then(() => refreshConsentStatus());\n                }\n            },\n            { immediate: true },\n        );\n\n        const loadingText = useTranslation({\n            namespace: TranslatorTranslationNamespace.COMMON,\n            key: TranslatorTranslationCommonKey.LOADING,\n        });\n\n        const reauthText = useTranslation({\n            namespace: TranslatorTranslationNamespace.CLIENT,\n            key: TranslatorTranslationClientKey.REAUTH_TEXT,\n        });\n\n        const consentStatusLoadingText = useTranslation({\n            namespace: TranslatorTranslationNamespace.CLIENT,\n            key: TranslatorTranslationClientKey.CONSENT_STATUS_LOADING,\n        });\n\n        // A silent (prompt=none) request that needs interaction must redirect\n        // the OIDC error to the RP — but ONLY to a redirect_uri that matched a\n        // registered client pattern. Without that, degrade to interactive UI.\n        const silentRedirect = (errorCode: `${OAuth2ErrorCode}`): VNodeChild | null => {\n            if (!props.codeRequest?.redirect_uri || !props.redirectUriVerified) {\n                return null;\n            }\n\n            return wrapChild(h(AuthorizeSilentRedirect, {\n                redirectUri: props.codeRequest.redirect_uri,\n                error: errorCode,\n                state: props.codeRequest.state,\n            }));\n        };\n\n        const resolve = async () => {\n            if (props.error) {\n                error.value = props.error;\n                return;\n            }\n\n            if (props.client) {\n                client.value = props.client;\n            }\n\n            if (props.clientId) {\n                try {\n                    client.value = (await httpClient.client.getOne(props.clientId)).data;\n                } catch (e) {\n                    if (e instanceof Error) {\n                        error.value = e;\n                    }\n                }\n            }\n        };\n\n        Promise.resolve()\n            .then(() => resolve());\n\n        return () => {\n            if (error.value) {\n                return wrapChild(h(AuthorizeText, {\n                    message: error.value.message,\n                    isError: true,\n                }));\n            }\n\n            if (!props.codeRequest) {\n                return [];\n            }\n\n            const prompts = (props.codeRequest.prompt ?? '').split(' ').filter(Boolean);\n            const isSilent = prompts.includes(OAuth2AuthorizationPrompt.NONE);\n            const isReauth = prompts.includes(OAuth2AuthorizationPrompt.LOGIN);\n\n            // A mid-flow login_required routed a silent request to an error\n            // redirect (the store's max_age backstop). Emit it once it is known.\n            if (isSilent && silentErrorCode.value) {\n                const redirect = silentRedirect(silentErrorCode.value);\n                if (redirect) {\n                    return redirect;\n                }\n            }\n\n            // A federated return holds the WHOLE ladder, not just its\n            // logged-out branch: a session already in the cookies (another\n            // tab, a lingering one) would otherwise let the ladder run against\n            // that identity while the redemption is still in flight, and a\n            // builtIn client auto-consents on mount — delivering the\n            // application a code for the wrong account.\n            if (federatedLoginPending.value) {\n                return wrapChild(h(AuthorizeText, { message: loadingText.value }));\n            }\n\n            // A failed completion must not let the ladder continue against a\n            // session the cookies already hold: that would consent an\n            // application into the wrong account, silently for a built-in\n            // client. With no such session there is nothing to protect, so\n            // the person gets the reason AND a way to carry on.\n            if (federatedError.value && loggedIn.value) {\n                return wrapChild(h(AuthorizeText, {\n                    message: federatedError.value,\n                    isError: true,\n                }));\n            }\n\n            // Force re-authentication: prompt=login (proactive) or a login_required\n            // surfaced mid-flow. Show the login form (with a banner) until a fresh\n            // login on THIS page stamps lastAuthOrigin (accountConfirmed).\n            const forceReauth = (isReauth || reauthRequired.value) && !accountConfirmed.value;\n\n            if (forceReauth || !loggedIn.value) {\n                // A silent request can never render a login form — redirect the\n                // login_required error to the RP (falls through to the form only\n                // when the redirect_uri was not verified).\n                if (isSilent) {\n                    const redirect = silentRedirect(OAuth2ErrorCode.LOGIN_REQUIRED);\n                    if (redirect) {\n                        return redirect;\n                    }\n                }\n\n                const loginNode = h(Suspense, {}, {\n                    default: () => h(LoginForm, {\n                        codeRequest: props.codeRequest,\n                        registerLink: props.registerLink,\n                        passwordForgotLink: props.passwordForgotLink,\n                        usernameHint: props.codeRequest?.login_hint,\n                        // fresh-login → skip the chooser: handled race-free by\n                        // the lastAuthOrigin watch, not LoginForm's `done`.\n                        onFailed: (message: string) => emit('failed', message),\n                    }),\n                    fallback: () => h(AuthorizeText, { message: loadingText.value }),\n                });\n\n                // A failed federated completion states its reason above the\n                // form rather than replacing the page: with no session to\n                // protect, the person can simply carry on.\n                if (federatedError.value) {\n                    return wrapChild([\n                        h(AuthorizeText, { message: federatedError.value, isError: true }),\n                        loginNode,\n                    ]);\n                }\n\n                // prompt=login / mid-flow re-auth: a banner above the form\n                // explaining why credentials are requested again.\n                return wrapChild(forceReauth ?\n                    [h(AuthorizeText, { message: reauthText.value }), loginNode] :\n                    loginNode);\n            }\n\n            // Realm binding (UX only — the server POST /authorize gate is\n            // authoritative). Wait until the store has resolved the signed-in\n            // identity's realm before deciding, so a built_in client's\n            // AuthorizeForm auto-consent (onMounted) can't fire before a\n            // mismatch is detected.\n            if (!realmId.value) {\n                return wrapChild(h(AuthorizeText, { message: loadingText.value }));\n            }\n\n            if (\n                props.codeRequest.realm_id &&\n                realmId.value !== props.codeRequest.realm_id\n            ) {\n                // Silent: can't reuse a foreign-realm session → login_required.\n                if (isSilent) {\n                    const redirect = silentRedirect(OAuth2ErrorCode.LOGIN_REQUIRED);\n                    if (redirect) {\n                        return redirect;\n                    }\n                }\n\n                return wrapChild(h(AuthorizeRealmMismatch, {\n                    clientName: props.client?.name ?? '',\n                    targetRealmName: props.realm?.displayName || props.realm?.name || '',\n                    redirectUri: props.codeRequest.redirect_uri,\n                    state: props.codeRequest.state,\n                    redirectUriVerified: props.redirectUriVerified,\n                    onSwitch: switchAccount,\n                }));\n            }\n\n            // prompt=select_account: offer \"continue as X / use another account\"\n            // instead of silently continuing the current session. Wait for the\n            // user to resolve so the chooser never flashes \"Continue as \" with an\n            // empty name.\n            if (\n                prompts.includes(OAuth2AuthorizationPrompt.SELECT_ACCOUNT) &&\n                !accountConfirmed.value\n            ) {\n                if (!user.value) {\n                    // Resolution still in flight — loading text is fine. Once\n                    // settled with no user (a non-user identity, or a userinfo\n                    // fetch that keeps failing), offer \"use another account\"\n                    // (an empty identityName hides the continue action)\n                    // instead of an indefinite spinner.\n                    if (!userSettled.value) {\n                        return wrapChild(h(AuthorizeText, { message: loadingText.value }));\n                    }\n\n                    return wrapChild(h(AAccountPrompt, {\n                        identityName: '',\n                        onSwitch: switchAccount,\n                    }));\n                }\n\n                return wrapChild(h(AAccountPrompt, {\n                    identityName: user.value.name ?? user.value.displayName ?? '',\n                    onContinue: () => { accountConfirmedLocal.value = true; },\n                    onSwitch: switchAccount,\n                }));\n            }\n\n            // MFA gate (plan 049) — interactive only. A silent (prompt=none)\n            // request can't render a challenge form; its AuthorizeForm\n            // auto-consent hits the server backstop and redirects the OIDC\n            // error (interaction_required), so skip the form here for silent.\n            if (!isSilent && !mfaSatisfiedLocal.value) {\n                // Block consent until the status is known — AuthorizeForm\n                // auto-submits for built_in clients, so it must not render\n                // before we know whether a factor is required.\n                if (!mfaStatus.value) {\n                    return wrapChild(h(AuthorizeText, { message: loadingText.value }));\n                }\n\n                if (mfaStatus.value.required) {\n                    return wrapChild(h(AMfaChallengeForm, {\n                        kinds: mfaStatus.value.kinds,\n                        challenge: mfaStatus.value.challenge ?? null,\n                        onDone: () => { mfaSatisfiedLocal.value = true; },\n                        onFailed: (message: string) => emit('failed', message),\n                    }));\n                }\n\n                // mfaRequired + no device → configure inline, then re-check\n                // (the freshly enrolled device makes the next status.required).\n                if (mfaStatus.value.enrollmentRequired) {\n                    return wrapChild(h(AUserAuthenticatorEnroll, {\n                        onDone: () => {\n                            mfaStatus.value = null;\n                            Promise.resolve().then(() => refreshMfaStatus());\n                        },\n                        onFailed: (e: unknown) => emit(\n                            'failed',\n                            e instanceof Error ? e.message : String(e),\n                        ),\n                    }));\n                }\n            }\n\n            if (!client.value) {\n                return [];\n            }\n\n            // Consent probe gate (plan 055) — block the consent decision until\n            // the covering probe settles. Applies to logged-in users on\n            // non-built_in clients only: built_in clients never depend on the\n            // probe (today's auto-consent flow preserved exactly), and the\n            // logged-out branches returned earlier. Silent requests must wait\n            // here too, or they'd race to a false consent_required redirect.\n            if (!client.value.builtIn && consentStatus.value === null) {\n                return wrapChild(h(AuthorizeText, { message: consentStatusLoadingText.value }));\n            }\n\n            // A silent request against a non-built_in client can only proceed\n            // when the persisted consent rows cover every requested scope —\n            // otherwise consent_required.\n            if (\n                isSilent &&\n                !client.value.builtIn &&\n                consentStatus.value?.covered !== true\n            ) {\n                const redirect = silentRedirect(OAuth2ErrorCode.CONSENT_REQUIRED);\n                if (redirect) {\n                    return redirect;\n                }\n            }\n\n            return wrapChild(h(Suspense, {}, {\n                default: () => h(AuthorizeForm, {\n                    codeRequest: props.codeRequest!,\n                    client: client.value!,\n                    scopes: props.scopes,\n                    // \"Signed in as X — Not you?\" switch affordance on the manual\n                    // consent screen (present even when the RP sent no\n                    // prompt=select_account).\n                    identityName: user.value?.name ?? user.value?.displayName ?? '',\n                    // abort()'s access_denied redirect is gated on the verified\n                    // redirect_uri, like every other redirect in the ladder.\n                    redirectUriVerified: props.redirectUriVerified,\n                    // Persisted consent covers every requested scope →\n                    // AuthorizeForm may auto-consent (unless prompt=consent).\n                    consentGranted: consentStatus.value?.covered === true,\n                    // Silent (built_in) request: auto-consent runs, but a failure\n                    // must redirect an OIDC error, never render manual consent —\n                    // but only when the redirect_uri is verified. Otherwise the\n                    // error can't be redirected, so drop the silent flag and let\n                    // AuthorizeForm fall back to interactive manual consent.\n                    silent: isSilent && props.redirectUriVerified,\n                    onSwitch: switchAccount,\n                    onLoginRequired: handleLoginRequired,\n                    onFailed: () => {\n                        silentErrorCode.value = OAuth2ErrorCode.INTERACTION_REQUIRED;\n                    },\n                }),\n                fallback: () => h(AuthorizeText, { message: loadingText.value }),\n            }));\n        };\n    },\n});\n</script>\n","<!--\n  - Copyright (c) 2026.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\n/* global window */\nimport { IdentityType } from '@authup/core-kit';\nimport { TranslatorTranslationClientKey, TranslatorTranslationNamespace } from '@authup/i18n';\nimport { VCButton } from '@vuecs/button';\nimport { VCIcon } from '@vuecs/icon';\nimport { storeToRefs } from 'pinia';\nimport {\n    defineComponent,\n    onMounted,\n    ref,\n} from 'vue';\nimport { injectStore, useTranslation } from '../../../core';\n\nexport default defineComponent({\n    components: { VCButton, VCIcon },\n    props: {\n        // A signature-verified id_token_hint already revoked the session\n        // server-side — this page just clears local state and confirms.\n        serverRevoked: {\n            type: Boolean,\n            default: false,\n        },\n        // The `sub` of the session revoked server-side (only set for a verified\n        // hint). Local auto-cleanup is gated on it matching THIS browser's user.\n        hintSub: {\n            type: String,\n            default: undefined,\n        },\n        // The `sub_kind` of the revoked session. The auto-cleanup gate below\n        // compares hintSub against the local USER id, so a non-user subject\n        // (client) must never match — and a missing kind fails closed.\n        hintSubKind: {\n            type: String,\n            default: undefined,\n        },\n        // A validated post_logout_redirect_uri (open-redirect guard already\n        // applied server-side; carries `state`). Navigated to after sign-out.\n        redirect: {\n            type: String,\n            default: undefined,\n        },\n    },\n    setup(props) {\n        const store = injectStore();\n        const { user } = storeToRefs(store);\n        const done = ref<boolean>(false);\n\n        const title = useTranslation({\n            namespace: TranslatorTranslationNamespace.CLIENT,\n            key: TranslatorTranslationClientKey.LOGOUT_CONFIRM_TITLE,\n        });\n        const text = useTranslation({\n            namespace: TranslatorTranslationNamespace.CLIENT,\n            key: TranslatorTranslationClientKey.LOGOUT_CONFIRM_TEXT,\n        });\n        const doneText = useTranslation({\n            namespace: TranslatorTranslationNamespace.CLIENT,\n            key: TranslatorTranslationClientKey.LOGOUT_DONE,\n        });\n        const signOutLabel = useTranslation({\n            namespace: TranslatorTranslationNamespace.CLIENT,\n            key: TranslatorTranslationClientKey.SIGN_OUT,\n        });\n\n        const navigateToRedirect = (): boolean => {\n            if (typeof window !== 'undefined' && props.redirect) {\n                window.location.href = props.redirect;\n                return true;\n            }\n\n            return false;\n        };\n\n        // Always transition to a terminal state — a failed local cleanup must\n        // not strand the user on the pre-logout UI (in the serverRevoked path\n        // the server already ended the session). Navigate to a validated\n        // post-logout redirect when present, else show the signed-out notice.\n        const signOut = async () => {\n            try {\n                await store.logout();\n            } finally {\n                if (!navigateToRedirect()) {\n                    done.value = true;\n                }\n            }\n        };\n\n        onMounted(async () => {\n            // The server already ended the session (verified hint) — clear the\n            // local token/cookie state, then show the terminal notice.\n            //\n            // Gate the auto-cleanup on the revoked subject being THIS browser's\n            // user: without it, a cross-site GET to\n            // /logout?id_token_hint=<attacker's own id_token> (which revokes the\n            // attacker's own session, so serverRevoked is true) would forcibly\n            // sign out an unrelated victim who merely renders this page — a\n            // forced-logout CSRF. store.logout() is local-only, so it acts on\n            // whoever's browser rendered the page, not on the hint's subject.\n            //\n            // The subject kind must be `user` too — hintSub is compared against\n            // the local USER id, so a client session's sub (a different\n            // id namespace) matching a user id would be a confusion, not an\n            // identity. A missing kind fails closed.\n            if (\n                props.serverRevoked &&\n                props.hintSub &&\n                props.hintSubKind === IdentityType.USER &&\n                user.value &&\n                props.hintSub === user.value.id\n            ) {\n                await signOut();\n            }\n        });\n\n        return {\n            done,\n            title,\n            text,\n            doneText,\n            signOutLabel,\n            signOut,\n        };\n    },\n});\n</script>\n<template>\n    <div class=\"flex flex-col gap-2\">\n        <div class=\"text-center\">\n            <VCIcon\n                :name=\"done ? 'fa6-solid:circle-check' : 'fa6-solid:right-from-bracket'\"\n                class=\"text-6xl\"\n                :class=\"done ? 'text-success-600' : 'text-info-600'\"\n            />\n        </div>\n\n        <template v-if=\"done\">\n            <div class=\"text-center fs-6 p-3\">\n                {{ doneText }}\n            </div>\n        </template>\n        <template v-else>\n            <div class=\"text-center\">\n                <h1 class=\"font-bold\">\n                    {{ title }}\n                </h1>\n            </div>\n            <div class=\"text-center fs-6 px-3\">\n                {{ text }}\n            </div>\n            <div class=\"mt-2\">\n                <VCButton\n                    type=\"button\"\n                    color=\"primary\"\n                    class=\"w-full\"\n                    @click.prevent=\"signOut\"\n                >\n                    {{ signOutLabel }}\n                </VCButton>\n            </div>\n        </template>\n    </div>\n</template>\n","<!--\n  - Copyright (c) 2026.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\n/* global window */\nimport { IdentityType } from '@authup/core-kit';\nimport { TranslatorTranslationClientKey, TranslatorTranslationNamespace } from '@authup/i18n';\nimport { VCButton } from '@vuecs/button';\nimport { VCIcon } from '@vuecs/icon';\nimport { storeToRefs } from 'pinia';\nimport {\n    defineComponent,\n    onMounted,\n    ref,\n} from 'vue';\nimport { injectStore, useTranslation } from '../../../core';\n\nexport default defineComponent({\n    components: { VCButton, VCIcon },\n    props: {\n        // A signature-verified id_token_hint already revoked the session\n        // server-side — this page just clears local state and confirms.\n        serverRevoked: {\n            type: Boolean,\n            default: false,\n        },\n        // The `sub` of the session revoked server-side (only set for a verified\n        // hint). Local auto-cleanup is gated on it matching THIS browser's user.\n        hintSub: {\n            type: String,\n            default: undefined,\n        },\n        // The `sub_kind` of the revoked session. The auto-cleanup gate below\n        // compares hintSub against the local USER id, so a non-user subject\n        // (client) must never match — and a missing kind fails closed.\n        hintSubKind: {\n            type: String,\n            default: undefined,\n        },\n        // A validated post_logout_redirect_uri (open-redirect guard already\n        // applied server-side; carries `state`). Navigated to after sign-out.\n        redirect: {\n            type: String,\n            default: undefined,\n        },\n    },\n    setup(props) {\n        const store = injectStore();\n        const { user } = storeToRefs(store);\n        const done = ref<boolean>(false);\n\n        const title = useTranslation({\n            namespace: TranslatorTranslationNamespace.CLIENT,\n            key: TranslatorTranslationClientKey.LOGOUT_CONFIRM_TITLE,\n        });\n        const text = useTranslation({\n            namespace: TranslatorTranslationNamespace.CLIENT,\n            key: TranslatorTranslationClientKey.LOGOUT_CONFIRM_TEXT,\n        });\n        const doneText = useTranslation({\n            namespace: TranslatorTranslationNamespace.CLIENT,\n            key: TranslatorTranslationClientKey.LOGOUT_DONE,\n        });\n        const signOutLabel = useTranslation({\n            namespace: TranslatorTranslationNamespace.CLIENT,\n            key: TranslatorTranslationClientKey.SIGN_OUT,\n        });\n\n        const navigateToRedirect = (): boolean => {\n            if (typeof window !== 'undefined' && props.redirect) {\n                window.location.href = props.redirect;\n                return true;\n            }\n\n            return false;\n        };\n\n        // Always transition to a terminal state — a failed local cleanup must\n        // not strand the user on the pre-logout UI (in the serverRevoked path\n        // the server already ended the session). Navigate to a validated\n        // post-logout redirect when present, else show the signed-out notice.\n        const signOut = async () => {\n            try {\n                await store.logout();\n            } finally {\n                if (!navigateToRedirect()) {\n                    done.value = true;\n                }\n            }\n        };\n\n        onMounted(async () => {\n            // The server already ended the session (verified hint) — clear the\n            // local token/cookie state, then show the terminal notice.\n            //\n            // Gate the auto-cleanup on the revoked subject being THIS browser's\n            // user: without it, a cross-site GET to\n            // /logout?id_token_hint=<attacker's own id_token> (which revokes the\n            // attacker's own session, so serverRevoked is true) would forcibly\n            // sign out an unrelated victim who merely renders this page — a\n            // forced-logout CSRF. store.logout() is local-only, so it acts on\n            // whoever's browser rendered the page, not on the hint's subject.\n            //\n            // The subject kind must be `user` too — hintSub is compared against\n            // the local USER id, so a client session's sub (a different\n            // id namespace) matching a user id would be a confusion, not an\n            // identity. A missing kind fails closed.\n            if (\n                props.serverRevoked &&\n                props.hintSub &&\n                props.hintSubKind === IdentityType.USER &&\n                user.value &&\n                props.hintSub === user.value.id\n            ) {\n                await signOut();\n            }\n        });\n\n        return {\n            done,\n            title,\n            text,\n            doneText,\n            signOutLabel,\n            signOut,\n        };\n    },\n});\n</script>\n<template>\n    <div class=\"flex flex-col gap-2\">\n        <div class=\"text-center\">\n            <VCIcon\n                :name=\"done ? 'fa6-solid:circle-check' : 'fa6-solid:right-from-bracket'\"\n                class=\"text-6xl\"\n                :class=\"done ? 'text-success-600' : 'text-info-600'\"\n            />\n        </div>\n\n        <template v-if=\"done\">\n            <div class=\"text-center fs-6 p-3\">\n                {{ doneText }}\n            </div>\n        </template>\n        <template v-else>\n            <div class=\"text-center\">\n                <h1 class=\"font-bold\">\n                    {{ title }}\n                </h1>\n            </div>\n            <div class=\"text-center fs-6 px-3\">\n                {{ text }}\n            </div>\n            <div class=\"mt-2\">\n                <VCButton\n                    type=\"button\"\n                    color=\"primary\"\n                    class=\"w-full\"\n                    @click.prevent=\"signOut\"\n                >\n                    {{ signOutLabel }}\n                </VCButton>\n            </div>\n        </template>\n    </div>\n</template>\n","<!--\n  - Copyright (c) 2026.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\nimport type { PropType } from 'vue';\nimport {\n    computed,\n    defineComponent,\n    reactive,\n    ref,\n} from 'vue';\nimport { useValidup } from '@validup/vue';\nimport {\n    TranslatorTranslationActionKey,\n    TranslatorTranslationClientKey,\n    TranslatorTranslationNamespace,\n} from '@authup/i18n';\nimport { createValidator } from '@validup/zod';\nimport { Container } from 'validup';\nimport { z } from 'zod';\nimport { VCButton } from '@vuecs/button';\nimport { VCAlert } from '@vuecs/elements';\nimport { VCFormGroup, VCFormInput, useSubmitButton } from '@vuecs/forms';\nimport type { LinkProps } from '@vuecs/link';\nimport { IFieldValidation } from '@ilingo/validup-vue';\nimport { injectHTTPClient, useTranslations, wrapFnWithBusyState } from '../../../core';\nimport { AAuthBackLink } from '../../utility';\n\nclass PasswordForgotValidator extends Container<{ identifier: string }> {\n    protected override initialize() {\n        super.initialize();\n        this.mount('identifier', createValidator(z.string().min(3).max(255)));\n    }\n}\n\nexport default defineComponent({\n    components: {\n        AAuthBackLink,\n        VCButton,\n        VCAlert,\n        VCFormGroup,\n        VCFormInput,\n        IFieldValidation,\n    },\n    props: {\n        realmId: { type: String },\n        backLink: { type: Object as PropType<LinkProps> },\n    },\n    emits: ['done', 'failed'],\n    setup(props, { emit }) {\n        const apiClient = injectHTTPClient();\n\n        const form = reactive({ identifier: '' });\n\n        const v = useValidup(new PasswordForgotValidator(), form);\n\n        const translations = useTranslations([\n            {\n                namespace: TranslatorTranslationNamespace.ACTION,\n                key: TranslatorTranslationActionKey.SEND,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.CLIENT,\n                key: TranslatorTranslationClientKey.FORGOT_PASSWORD,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.CLIENT,\n                key: TranslatorTranslationClientKey.EMAIL_OR_NAME,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.CLIENT,\n                key: TranslatorTranslationClientKey.CHECK_EMAIL_RESET,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.CLIENT,\n                key: TranslatorTranslationClientKey.BACK_TO_LOGIN,\n            },\n        ]);\n\n        const busy = ref(false);\n        const error = ref<string | null>(null);\n        const sent = ref(false);\n\n        const submit = wrapFnWithBusyState(busy, async () => {\n            error.value = null;\n\n            try {\n                const identifier = form.identifier.trim();\n                const response = await apiClient.user.passwordForgot({\n                    ...(identifier.includes('@') ? { email: identifier } : { name: identifier }),\n                    ...(props.realmId ? { realmId: props.realmId } : {}),\n                });\n\n                sent.value = true;\n                emit('done', response);\n            } catch (e) {\n                error.value = e instanceof Error ? e.message : null;\n                emit('failed', e);\n            }\n        });\n\n        const submitButton = useSubmitButton({\n            loading: busy,\n            disabled: computed(() => busy.value || v.$invalid.value),\n        });\n\n        return {\n            v,\n            form,\n            submit,\n            submitButton,\n            busy,\n            error,\n            sent,\n            translations,\n        };\n    },\n});\n</script>\n<template>\n    <div>\n        <div class=\"text-center\">\n            <h1 class=\"font-bold\">\n                {{ translations.forgotPassword }}\n            </h1>\n        </div>\n\n        <VCAlert\n            v-if=\"sent\"\n            color=\"info\"\n            variant=\"soft\"\n            class=\"mb-3\"\n        >\n            {{ translations.checkEmailReset }}\n        </VCAlert>\n        <form\n            v-else\n            @submit.prevent=\"submit\"\n        >\n            <VCAlert\n                v-if=\"error\"\n                color=\"error\"\n                variant=\"soft\"\n                class=\"mb-3\"\n            >\n                {{ error }}\n            </VCAlert>\n\n            <IFieldValidation\n                v-slot=\"{ value }\"\n                :field=\"v.fields.identifier\"\n            >\n                <VCFormGroup :validation=\"value\">\n                    <template #label>\n                        {{ translations.emailOrName }}\n                    </template>\n                    <VCFormInput v-model=\"v.fields.identifier.$model.value\" />\n                </VCFormGroup>\n            </IFieldValidation>\n\n            <VCButton\n                v-bind=\"submitButton\"\n                :label=\"translations.send\"\n                class=\"w-full\"\n            />\n        </form>\n\n        <AAuthBackLink :link=\"backLink\" />\n    </div>\n</template>\n","<!--\n  - Copyright (c) 2026.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\nimport type { PropType } from 'vue';\nimport {\n    computed,\n    defineComponent,\n    reactive,\n    ref,\n} from 'vue';\nimport { useValidup } from '@validup/vue';\nimport {\n    TranslatorTranslationActionKey,\n    TranslatorTranslationClientKey,\n    TranslatorTranslationNamespace,\n} from '@authup/i18n';\nimport { createValidator } from '@validup/zod';\nimport { Container } from 'validup';\nimport { z } from 'zod';\nimport { VCButton } from '@vuecs/button';\nimport { VCAlert } from '@vuecs/elements';\nimport { VCFormGroup, VCFormInput, useSubmitButton } from '@vuecs/forms';\nimport type { LinkProps } from '@vuecs/link';\nimport { IFieldValidation } from '@ilingo/validup-vue';\nimport { injectHTTPClient, useTranslations, wrapFnWithBusyState } from '../../../core';\nimport { AAuthBackLink } from '../../utility';\n\nclass PasswordForgotValidator extends Container<{ identifier: string }> {\n    protected override initialize() {\n        super.initialize();\n        this.mount('identifier', createValidator(z.string().min(3).max(255)));\n    }\n}\n\nexport default defineComponent({\n    components: {\n        AAuthBackLink,\n        VCButton,\n        VCAlert,\n        VCFormGroup,\n        VCFormInput,\n        IFieldValidation,\n    },\n    props: {\n        realmId: { type: String },\n        backLink: { type: Object as PropType<LinkProps> },\n    },\n    emits: ['done', 'failed'],\n    setup(props, { emit }) {\n        const apiClient = injectHTTPClient();\n\n        const form = reactive({ identifier: '' });\n\n        const v = useValidup(new PasswordForgotValidator(), form);\n\n        const translations = useTranslations([\n            {\n                namespace: TranslatorTranslationNamespace.ACTION,\n                key: TranslatorTranslationActionKey.SEND,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.CLIENT,\n                key: TranslatorTranslationClientKey.FORGOT_PASSWORD,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.CLIENT,\n                key: TranslatorTranslationClientKey.EMAIL_OR_NAME,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.CLIENT,\n                key: TranslatorTranslationClientKey.CHECK_EMAIL_RESET,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.CLIENT,\n                key: TranslatorTranslationClientKey.BACK_TO_LOGIN,\n            },\n        ]);\n\n        const busy = ref(false);\n        const error = ref<string | null>(null);\n        const sent = ref(false);\n\n        const submit = wrapFnWithBusyState(busy, async () => {\n            error.value = null;\n\n            try {\n                const identifier = form.identifier.trim();\n                const response = await apiClient.user.passwordForgot({\n                    ...(identifier.includes('@') ? { email: identifier } : { name: identifier }),\n                    ...(props.realmId ? { realmId: props.realmId } : {}),\n                });\n\n                sent.value = true;\n                emit('done', response);\n            } catch (e) {\n                error.value = e instanceof Error ? e.message : null;\n                emit('failed', e);\n            }\n        });\n\n        const submitButton = useSubmitButton({\n            loading: busy,\n            disabled: computed(() => busy.value || v.$invalid.value),\n        });\n\n        return {\n            v,\n            form,\n            submit,\n            submitButton,\n            busy,\n            error,\n            sent,\n            translations,\n        };\n    },\n});\n</script>\n<template>\n    <div>\n        <div class=\"text-center\">\n            <h1 class=\"font-bold\">\n                {{ translations.forgotPassword }}\n            </h1>\n        </div>\n\n        <VCAlert\n            v-if=\"sent\"\n            color=\"info\"\n            variant=\"soft\"\n            class=\"mb-3\"\n        >\n            {{ translations.checkEmailReset }}\n        </VCAlert>\n        <form\n            v-else\n            @submit.prevent=\"submit\"\n        >\n            <VCAlert\n                v-if=\"error\"\n                color=\"error\"\n                variant=\"soft\"\n                class=\"mb-3\"\n            >\n                {{ error }}\n            </VCAlert>\n\n            <IFieldValidation\n                v-slot=\"{ value }\"\n                :field=\"v.fields.identifier\"\n            >\n                <VCFormGroup :validation=\"value\">\n                    <template #label>\n                        {{ translations.emailOrName }}\n                    </template>\n                    <VCFormInput v-model=\"v.fields.identifier.$model.value\" />\n                </VCFormGroup>\n            </IFieldValidation>\n\n            <VCButton\n                v-bind=\"submitButton\"\n                :label=\"translations.send\"\n                class=\"w-full\"\n            />\n        </form>\n\n        <AAuthBackLink :link=\"backLink\" />\n    </div>\n</template>\n","<!--\n  - Copyright (c) 2026.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\nimport {\n    computed,\n    defineComponent,\n    reactive,\n    ref,\n    watch,\n} from 'vue';\nimport { useValidup } from '@validup/vue';\nimport {\n    TranslatorTranslationActionKey,\n    TranslatorTranslationClientKey,\n    TranslatorTranslationFieldKey,\n    TranslatorTranslationNamespace,\n} from '@authup/i18n';\nimport { createValidator } from '@validup/zod';\nimport { Container } from 'validup';\nimport { z } from 'zod';\nimport { VCButton } from '@vuecs/button';\nimport { VCAlert } from '@vuecs/elements';\nimport { VCFormGroup, VCFormInput, useSubmitButton } from '@vuecs/forms';\nimport { IFieldValidation } from '@ilingo/validup-vue';\nimport { injectHTTPClient, useTranslations, wrapFnWithBusyState } from '../../../core';\n\nclass PasswordResetValidator extends Container<{\n    identifier: string;\n    token: string;\n    password: string;\n}> {\n    protected override initialize() {\n        super.initialize();\n        this.mount('identifier', createValidator(z.string().min(3).max(255)));\n        this.mount('token', createValidator(z.string().min(3).max(256)));\n        this.mount('password', createValidator(z.string().min(3).max(255)));\n    }\n}\n\nexport default defineComponent({\n    components: {\n        VCButton,\n        VCAlert,\n        VCFormGroup,\n        VCFormInput,\n        IFieldValidation,\n    },\n    props: {\n        realmId: { type: String },\n        token: {\n            type: String,\n            default: '',\n        },\n    },\n    emits: ['done', 'failed'],\n    setup(props, { emit }) {\n        const apiClient = injectHTTPClient();\n\n        const form = reactive({\n            identifier: '',\n            token: props.token,\n            password: '',\n        });\n\n        // Keep the field in sync if the component is reused with a new token.\n        watch(() => props.token, (value) => {\n            form.token = value;\n        });\n\n        const v = useValidup(new PasswordResetValidator(), form);\n\n        const translations = useTranslations([\n            {\n                namespace: TranslatorTranslationNamespace.ACTION,\n                key: TranslatorTranslationActionKey.RESET,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.CODE,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.PASSWORD,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.CLIENT,\n                key: TranslatorTranslationClientKey.RESET_PASSWORD,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.CLIENT,\n                key: TranslatorTranslationClientKey.EMAIL_OR_NAME,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.CLIENT,\n                key: TranslatorTranslationClientKey.PASSWORD_RESET_DONE,\n            },\n        ]);\n\n        const busy = ref(false);\n        const error = ref<string | null>(null);\n        const finished = ref(false);\n\n        const submit = wrapFnWithBusyState(busy, async () => {\n            error.value = null;\n\n            try {\n                const identifier = form.identifier.trim();\n                const response = await apiClient.user.passwordReset({\n                    ...(identifier.includes('@') ? { email: identifier } : { name: identifier }),\n                    token: form.token,\n                    password: form.password,\n                    ...(props.realmId ? { realmId: props.realmId } : {}),\n                });\n\n                finished.value = true;\n                emit('done', response);\n            } catch (e) {\n                error.value = e instanceof Error ? e.message : null;\n                emit('failed', e);\n            }\n        });\n\n        const submitButton = useSubmitButton({\n            loading: busy,\n            disabled: computed(() => busy.value || v.$invalid.value),\n        });\n\n        return {\n            v,\n            form,\n            submit,\n            submitButton,\n            busy,\n            error,\n            finished,\n            translations,\n        };\n    },\n});\n</script>\n<template>\n    <div>\n        <div class=\"text-center\">\n            <h1 class=\"font-bold\">\n                {{ translations.resetPassword }}\n            </h1>\n        </div>\n\n        <VCAlert\n            v-if=\"finished\"\n            color=\"success\"\n            variant=\"soft\"\n            class=\"mb-3\"\n        >\n            {{ translations.passwordResetDone }}\n        </VCAlert>\n        <form\n            v-else\n            @submit.prevent=\"submit\"\n        >\n            <VCAlert\n                v-if=\"error\"\n                color=\"error\"\n                variant=\"soft\"\n                class=\"mb-3\"\n            >\n                {{ error }}\n            </VCAlert>\n\n            <IFieldValidation\n                v-slot=\"{ value }\"\n                :field=\"v.fields.identifier\"\n            >\n                <VCFormGroup :validation=\"value\">\n                    <template #label>\n                        {{ translations.emailOrName }}\n                    </template>\n                    <VCFormInput v-model=\"v.fields.identifier.$model.value\" />\n                </VCFormGroup>\n            </IFieldValidation>\n\n            <IFieldValidation\n                v-slot=\"{ value }\"\n                :field=\"v.fields.token\"\n            >\n                <VCFormGroup :validation=\"value\">\n                    <template #label>\n                        {{ translations.code }}\n                    </template>\n                    <VCFormInput v-model=\"v.fields.token.$model.value\" />\n                </VCFormGroup>\n            </IFieldValidation>\n\n            <IFieldValidation\n                v-slot=\"{ value }\"\n                :field=\"v.fields.password\"\n            >\n                <VCFormGroup :validation=\"value\">\n                    <template #label>\n                        {{ translations.password }}\n                    </template>\n                    <VCFormInput\n                        v-model=\"v.fields.password.$model.value\"\n                        type=\"password\"\n                    />\n                </VCFormGroup>\n            </IFieldValidation>\n\n            <VCButton\n                v-bind=\"submitButton\"\n                :label=\"translations.reset\"\n                class=\"w-full\"\n            />\n        </form>\n    </div>\n</template>\n","<!--\n  - Copyright (c) 2026.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\nimport {\n    computed,\n    defineComponent,\n    reactive,\n    ref,\n    watch,\n} from 'vue';\nimport { useValidup } from '@validup/vue';\nimport {\n    TranslatorTranslationActionKey,\n    TranslatorTranslationClientKey,\n    TranslatorTranslationFieldKey,\n    TranslatorTranslationNamespace,\n} from '@authup/i18n';\nimport { createValidator } from '@validup/zod';\nimport { Container } from 'validup';\nimport { z } from 'zod';\nimport { VCButton } from '@vuecs/button';\nimport { VCAlert } from '@vuecs/elements';\nimport { VCFormGroup, VCFormInput, useSubmitButton } from '@vuecs/forms';\nimport { IFieldValidation } from '@ilingo/validup-vue';\nimport { injectHTTPClient, useTranslations, wrapFnWithBusyState } from '../../../core';\n\nclass PasswordResetValidator extends Container<{\n    identifier: string;\n    token: string;\n    password: string;\n}> {\n    protected override initialize() {\n        super.initialize();\n        this.mount('identifier', createValidator(z.string().min(3).max(255)));\n        this.mount('token', createValidator(z.string().min(3).max(256)));\n        this.mount('password', createValidator(z.string().min(3).max(255)));\n    }\n}\n\nexport default defineComponent({\n    components: {\n        VCButton,\n        VCAlert,\n        VCFormGroup,\n        VCFormInput,\n        IFieldValidation,\n    },\n    props: {\n        realmId: { type: String },\n        token: {\n            type: String,\n            default: '',\n        },\n    },\n    emits: ['done', 'failed'],\n    setup(props, { emit }) {\n        const apiClient = injectHTTPClient();\n\n        const form = reactive({\n            identifier: '',\n            token: props.token,\n            password: '',\n        });\n\n        // Keep the field in sync if the component is reused with a new token.\n        watch(() => props.token, (value) => {\n            form.token = value;\n        });\n\n        const v = useValidup(new PasswordResetValidator(), form);\n\n        const translations = useTranslations([\n            {\n                namespace: TranslatorTranslationNamespace.ACTION,\n                key: TranslatorTranslationActionKey.RESET,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.CODE,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.PASSWORD,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.CLIENT,\n                key: TranslatorTranslationClientKey.RESET_PASSWORD,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.CLIENT,\n                key: TranslatorTranslationClientKey.EMAIL_OR_NAME,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.CLIENT,\n                key: TranslatorTranslationClientKey.PASSWORD_RESET_DONE,\n            },\n        ]);\n\n        const busy = ref(false);\n        const error = ref<string | null>(null);\n        const finished = ref(false);\n\n        const submit = wrapFnWithBusyState(busy, async () => {\n            error.value = null;\n\n            try {\n                const identifier = form.identifier.trim();\n                const response = await apiClient.user.passwordReset({\n                    ...(identifier.includes('@') ? { email: identifier } : { name: identifier }),\n                    token: form.token,\n                    password: form.password,\n                    ...(props.realmId ? { realmId: props.realmId } : {}),\n                });\n\n                finished.value = true;\n                emit('done', response);\n            } catch (e) {\n                error.value = e instanceof Error ? e.message : null;\n                emit('failed', e);\n            }\n        });\n\n        const submitButton = useSubmitButton({\n            loading: busy,\n            disabled: computed(() => busy.value || v.$invalid.value),\n        });\n\n        return {\n            v,\n            form,\n            submit,\n            submitButton,\n            busy,\n            error,\n            finished,\n            translations,\n        };\n    },\n});\n</script>\n<template>\n    <div>\n        <div class=\"text-center\">\n            <h1 class=\"font-bold\">\n                {{ translations.resetPassword }}\n            </h1>\n        </div>\n\n        <VCAlert\n            v-if=\"finished\"\n            color=\"success\"\n            variant=\"soft\"\n            class=\"mb-3\"\n        >\n            {{ translations.passwordResetDone }}\n        </VCAlert>\n        <form\n            v-else\n            @submit.prevent=\"submit\"\n        >\n            <VCAlert\n                v-if=\"error\"\n                color=\"error\"\n                variant=\"soft\"\n                class=\"mb-3\"\n            >\n                {{ error }}\n            </VCAlert>\n\n            <IFieldValidation\n                v-slot=\"{ value }\"\n                :field=\"v.fields.identifier\"\n            >\n                <VCFormGroup :validation=\"value\">\n                    <template #label>\n                        {{ translations.emailOrName }}\n                    </template>\n                    <VCFormInput v-model=\"v.fields.identifier.$model.value\" />\n                </VCFormGroup>\n            </IFieldValidation>\n\n            <IFieldValidation\n                v-slot=\"{ value }\"\n                :field=\"v.fields.token\"\n            >\n                <VCFormGroup :validation=\"value\">\n                    <template #label>\n                        {{ translations.code }}\n                    </template>\n                    <VCFormInput v-model=\"v.fields.token.$model.value\" />\n                </VCFormGroup>\n            </IFieldValidation>\n\n            <IFieldValidation\n                v-slot=\"{ value }\"\n                :field=\"v.fields.password\"\n            >\n                <VCFormGroup :validation=\"value\">\n                    <template #label>\n                        {{ translations.password }}\n                    </template>\n                    <VCFormInput\n                        v-model=\"v.fields.password.$model.value\"\n                        type=\"password\"\n                    />\n                </VCFormGroup>\n            </IFieldValidation>\n\n            <VCButton\n                v-bind=\"submitButton\"\n                :label=\"translations.reset\"\n                class=\"w-full\"\n            />\n        </form>\n    </div>\n</template>\n","<!--\n  - Copyright (c) 2026.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\nimport {\n    computed,\n    defineComponent,\n    reactive,\n    ref,\n    watch,\n} from 'vue';\nimport { useValidup } from '@validup/vue';\nimport {\n    TranslatorTranslationActionKey,\n    TranslatorTranslationClientKey,\n    TranslatorTranslationFieldKey,\n    TranslatorTranslationNamespace,\n} from '@authup/i18n';\nimport { createValidator } from '@validup/zod';\nimport { Container } from 'validup';\nimport { z } from 'zod';\nimport { VCButton } from '@vuecs/button';\nimport { VCAlert } from '@vuecs/elements';\nimport { VCFormGroup, VCFormInput, useSubmitButton } from '@vuecs/forms';\nimport { IFieldValidation } from '@ilingo/validup-vue';\nimport { injectHTTPClient, useTranslations, wrapFnWithBusyState } from '../../../core';\n\nclass ActivateValidator extends Container<{ token: string }> {\n    protected override initialize() {\n        super.initialize();\n        this.mount('token', createValidator(z.string().min(3).max(256)));\n    }\n}\n\nexport default defineComponent({\n    components: {\n        VCButton,\n        VCAlert,\n        VCFormGroup,\n        VCFormInput,\n        IFieldValidation,\n    },\n    props: {\n        token: {\n            type: String,\n            default: '',\n        },\n    },\n    emits: ['done', 'failed'],\n    setup(props, { emit }) {\n        const apiClient = injectHTTPClient();\n\n        const form = reactive({ token: props.token });\n\n        // Keep the field in sync if the component is reused with a new token.\n        watch(() => props.token, (value) => {\n            form.token = value;\n        });\n\n        const v = useValidup(new ActivateValidator(), form);\n\n        const translations = useTranslations([\n            {\n                namespace: TranslatorTranslationNamespace.ACTION,\n                key: TranslatorTranslationActionKey.ACTIVATE,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.CODE,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.CLIENT,\n                key: TranslatorTranslationClientKey.ACTIVATE_ACCOUNT,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.CLIENT,\n                key: TranslatorTranslationClientKey.ACCOUNT_ACTIVATED,\n            },\n        ]);\n\n        const busy = ref(false);\n        const error = ref<string | null>(null);\n        const finished = ref(false);\n\n        const submit = wrapFnWithBusyState(busy, async () => {\n            error.value = null;\n\n            try {\n                await apiClient.user.activate(form.token);\n\n                finished.value = true;\n                emit('done');\n            } catch (e) {\n                error.value = e instanceof Error ? e.message : null;\n                emit('failed', e);\n            }\n        });\n\n        const submitButton = useSubmitButton({\n            loading: busy,\n            disabled: computed(() => busy.value || v.$invalid.value),\n        });\n\n        return {\n            v,\n            form,\n            submit,\n            submitButton,\n            busy,\n            error,\n            finished,\n            translations,\n        };\n    },\n});\n</script>\n<template>\n    <div>\n        <div class=\"text-center\">\n            <h1 class=\"font-bold\">\n                {{ translations.activateAccount }}\n            </h1>\n        </div>\n\n        <VCAlert\n            v-if=\"finished\"\n            color=\"success\"\n            variant=\"soft\"\n            class=\"mb-3\"\n        >\n            {{ translations.accountActivated }}\n        </VCAlert>\n        <form\n            v-else\n            @submit.prevent=\"submit\"\n        >\n            <VCAlert\n                v-if=\"error\"\n                color=\"error\"\n                variant=\"soft\"\n                class=\"mb-3\"\n            >\n                {{ error }}\n            </VCAlert>\n\n            <IFieldValidation\n                v-slot=\"{ value }\"\n                :field=\"v.fields.token\"\n            >\n                <VCFormGroup :validation=\"value\">\n                    <template #label>\n                        {{ translations.code }}\n                    </template>\n                    <VCFormInput v-model=\"v.fields.token.$model.value\" />\n                </VCFormGroup>\n            </IFieldValidation>\n\n            <VCButton\n                v-bind=\"submitButton\"\n                :label=\"translations.activate\"\n                class=\"w-full\"\n            />\n        </form>\n    </div>\n</template>\n","<!--\n  - Copyright (c) 2026.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\nimport {\n    computed,\n    defineComponent,\n    reactive,\n    ref,\n    watch,\n} from 'vue';\nimport { useValidup } from '@validup/vue';\nimport {\n    TranslatorTranslationActionKey,\n    TranslatorTranslationClientKey,\n    TranslatorTranslationFieldKey,\n    TranslatorTranslationNamespace,\n} from '@authup/i18n';\nimport { createValidator } from '@validup/zod';\nimport { Container } from 'validup';\nimport { z } from 'zod';\nimport { VCButton } from '@vuecs/button';\nimport { VCAlert } from '@vuecs/elements';\nimport { VCFormGroup, VCFormInput, useSubmitButton } from '@vuecs/forms';\nimport { IFieldValidation } from '@ilingo/validup-vue';\nimport { injectHTTPClient, useTranslations, wrapFnWithBusyState } from '../../../core';\n\nclass ActivateValidator extends Container<{ token: string }> {\n    protected override initialize() {\n        super.initialize();\n        this.mount('token', createValidator(z.string().min(3).max(256)));\n    }\n}\n\nexport default defineComponent({\n    components: {\n        VCButton,\n        VCAlert,\n        VCFormGroup,\n        VCFormInput,\n        IFieldValidation,\n    },\n    props: {\n        token: {\n            type: String,\n            default: '',\n        },\n    },\n    emits: ['done', 'failed'],\n    setup(props, { emit }) {\n        const apiClient = injectHTTPClient();\n\n        const form = reactive({ token: props.token });\n\n        // Keep the field in sync if the component is reused with a new token.\n        watch(() => props.token, (value) => {\n            form.token = value;\n        });\n\n        const v = useValidup(new ActivateValidator(), form);\n\n        const translations = useTranslations([\n            {\n                namespace: TranslatorTranslationNamespace.ACTION,\n                key: TranslatorTranslationActionKey.ACTIVATE,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.CODE,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.CLIENT,\n                key: TranslatorTranslationClientKey.ACTIVATE_ACCOUNT,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.CLIENT,\n                key: TranslatorTranslationClientKey.ACCOUNT_ACTIVATED,\n            },\n        ]);\n\n        const busy = ref(false);\n        const error = ref<string | null>(null);\n        const finished = ref(false);\n\n        const submit = wrapFnWithBusyState(busy, async () => {\n            error.value = null;\n\n            try {\n                await apiClient.user.activate(form.token);\n\n                finished.value = true;\n                emit('done');\n            } catch (e) {\n                error.value = e instanceof Error ? e.message : null;\n                emit('failed', e);\n            }\n        });\n\n        const submitButton = useSubmitButton({\n            loading: busy,\n            disabled: computed(() => busy.value || v.$invalid.value),\n        });\n\n        return {\n            v,\n            form,\n            submit,\n            submitButton,\n            busy,\n            error,\n            finished,\n            translations,\n        };\n    },\n});\n</script>\n<template>\n    <div>\n        <div class=\"text-center\">\n            <h1 class=\"font-bold\">\n                {{ translations.activateAccount }}\n            </h1>\n        </div>\n\n        <VCAlert\n            v-if=\"finished\"\n            color=\"success\"\n            variant=\"soft\"\n            class=\"mb-3\"\n        >\n            {{ translations.accountActivated }}\n        </VCAlert>\n        <form\n            v-else\n            @submit.prevent=\"submit\"\n        >\n            <VCAlert\n                v-if=\"error\"\n                color=\"error\"\n                variant=\"soft\"\n                class=\"mb-3\"\n            >\n                {{ error }}\n            </VCAlert>\n\n            <IFieldValidation\n                v-slot=\"{ value }\"\n                :field=\"v.fields.token\"\n            >\n                <VCFormGroup :validation=\"value\">\n                    <template #label>\n                        {{ translations.code }}\n                    </template>\n                    <VCFormInput v-model=\"v.fields.token.$model.value\" />\n                </VCFormGroup>\n            </IFieldValidation>\n\n            <VCButton\n                v-bind=\"submitButton\"\n                :label=\"translations.activate\"\n                class=\"w-full\"\n            />\n        </form>\n    </div>\n</template>\n","<!--\n  - Copyright (c) 2026.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\nimport type { PropType } from 'vue';\nimport {\n    computed,\n    defineComponent,\n    reactive,\n    ref,\n} from 'vue';\nimport { useValidup } from '@validup/vue';\nimport {\n    TranslatorTranslationActionKey,\n    TranslatorTranslationClientKey,\n    TranslatorTranslationFieldKey,\n    TranslatorTranslationNamespace,\n} from '@authup/i18n';\nimport { createValidator } from '@validup/zod';\nimport { Container } from 'validup';\nimport { z } from 'zod';\nimport { VCButton } from '@vuecs/button';\nimport { VCAlert } from '@vuecs/elements';\nimport { VCFormGroup, VCFormInput, useSubmitButton } from '@vuecs/forms';\nimport type { LinkProps } from '@vuecs/link';\nimport { IFieldValidation } from '@ilingo/validup-vue';\nimport { injectHTTPClient, useTranslations, wrapFnWithBusyState } from '../../../core';\nimport { AAuthBackLink } from '../../utility';\nimport ActivateForm from './ActivateForm.vue';\n\n// Permissive client-side shape on purpose — the server's\n// RegistrationService runs the authoritative UserValidator (canonical\n// name/email rules); the form just gives immediate feedback.\nclass RegisterValidator extends Container<{\n    name: string;\n    email: string;\n    password: string;\n}> {\n    protected override initialize() {\n        super.initialize();\n        this.mount('name', createValidator(z.string().min(3).max(128)));\n        this.mount('email', createValidator(z.string().email().max(255)));\n        this.mount('password', createValidator(z.string().min(3).max(255)));\n    }\n}\n\nexport default defineComponent({\n    components: {\n        AAuthBackLink,\n        ActivateForm,\n        VCButton,\n        VCAlert,\n        VCFormGroup,\n        VCFormInput,\n        IFieldValidation,\n    },\n    props: {\n        realmId: { type: String },\n        backLink: { type: Object as PropType<LinkProps> },\n    },\n    emits: ['done', 'failed'],\n    setup(props, { emit }) {\n        const apiClient = injectHTTPClient();\n\n        const form = reactive({\n            name: '',\n            email: '',\n            password: '',\n        });\n\n        const v = useValidup(new RegisterValidator(), form);\n\n        const translations = useTranslations([\n            {\n                namespace: TranslatorTranslationNamespace.ACTION,\n                key: TranslatorTranslationActionKey.REGISTER,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.NAME,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.EMAIL,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.PASSWORD,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.CLIENT,\n                key: TranslatorTranslationClientKey.CREATE_ACCOUNT,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.CLIENT,\n                key: TranslatorTranslationClientKey.CHECK_EMAIL_ACTIVATE,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.CLIENT,\n                key: TranslatorTranslationClientKey.BACK_TO_LOGIN,\n            },\n        ]);\n\n        const busy = ref(false);\n        const error = ref<string | null>(null);\n\n        // Switches the view to the activation step when the server reports\n        // the freshly registered account as inactive (email verification).\n        const awaitingActivation = ref(false);\n\n        const submit = wrapFnWithBusyState(busy, async () => {\n            error.value = null;\n\n            try {\n                const response = await apiClient.user.register({\n                    name: form.name,\n                    email: form.email,\n                    password: form.password,\n                    ...(props.realmId ? { realmId: props.realmId } : {}),\n                });\n\n                if (response.active) {\n                    emit('done', response);\n                } else {\n                    awaitingActivation.value = true;\n                }\n            } catch (e) {\n                error.value = e instanceof Error ? e.message : null;\n                emit('failed', e);\n            }\n        });\n\n        const submitButton = useSubmitButton({\n            loading: busy,\n            disabled: computed(() => busy.value || v.$invalid.value),\n        });\n\n        return {\n            v,\n            form,\n            submit,\n            submitButton,\n            busy,\n            error,\n            awaitingActivation,\n            translations,\n        };\n    },\n});\n</script>\n<template>\n    <div>\n        <template v-if=\"awaitingActivation\">\n            <VCAlert\n                color=\"info\"\n                variant=\"soft\"\n                class=\"mb-3\"\n            >\n                {{ translations.checkEmailActivate }}\n            </VCAlert>\n\n            <ActivateForm\n                @done=\"$emit('done')\"\n                @failed=\"$emit('failed', $event)\"\n            />\n        </template>\n        <template v-else>\n            <div class=\"text-center\">\n                <h1 class=\"font-bold\">\n                    {{ translations.createAccount }}\n                </h1>\n            </div>\n\n            <form @submit.prevent=\"submit\">\n                <VCAlert\n                    v-if=\"error\"\n                    color=\"error\"\n                    variant=\"soft\"\n                    class=\"mb-3\"\n                >\n                    {{ error }}\n                </VCAlert>\n\n                <IFieldValidation\n                    v-slot=\"{ value }\"\n                    :field=\"v.fields.name\"\n                >\n                    <VCFormGroup :validation=\"value\">\n                        <template #label>\n                            {{ translations.name }}\n                        </template>\n                        <VCFormInput v-model=\"v.fields.name.$model.value\" />\n                    </VCFormGroup>\n                </IFieldValidation>\n\n                <IFieldValidation\n                    v-slot=\"{ value }\"\n                    :field=\"v.fields.email\"\n                >\n                    <VCFormGroup :validation=\"value\">\n                        <template #label>\n                            {{ translations.email }}\n                        </template>\n                        <VCFormInput\n                            v-model=\"v.fields.email.$model.value\"\n                            type=\"email\"\n                        />\n                    </VCFormGroup>\n                </IFieldValidation>\n\n                <IFieldValidation\n                    v-slot=\"{ value }\"\n                    :field=\"v.fields.password\"\n                >\n                    <VCFormGroup :validation=\"value\">\n                        <template #label>\n                            {{ translations.password }}\n                        </template>\n                        <VCFormInput\n                            v-model=\"v.fields.password.$model.value\"\n                            type=\"password\"\n                        />\n                    </VCFormGroup>\n                </IFieldValidation>\n\n                <VCButton\n                    v-bind=\"submitButton\"\n                    :label=\"translations.register\"\n                    class=\"w-full\"\n                />\n            </form>\n        </template>\n\n        <AAuthBackLink :link=\"backLink\" />\n    </div>\n</template>\n","<!--\n  - Copyright (c) 2026.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\nimport type { PropType } from 'vue';\nimport {\n    computed,\n    defineComponent,\n    reactive,\n    ref,\n} from 'vue';\nimport { useValidup } from '@validup/vue';\nimport {\n    TranslatorTranslationActionKey,\n    TranslatorTranslationClientKey,\n    TranslatorTranslationFieldKey,\n    TranslatorTranslationNamespace,\n} from '@authup/i18n';\nimport { createValidator } from '@validup/zod';\nimport { Container } from 'validup';\nimport { z } from 'zod';\nimport { VCButton } from '@vuecs/button';\nimport { VCAlert } from '@vuecs/elements';\nimport { VCFormGroup, VCFormInput, useSubmitButton } from '@vuecs/forms';\nimport type { LinkProps } from '@vuecs/link';\nimport { IFieldValidation } from '@ilingo/validup-vue';\nimport { injectHTTPClient, useTranslations, wrapFnWithBusyState } from '../../../core';\nimport { AAuthBackLink } from '../../utility';\nimport ActivateForm from './ActivateForm.vue';\n\n// Permissive client-side shape on purpose — the server's\n// RegistrationService runs the authoritative UserValidator (canonical\n// name/email rules); the form just gives immediate feedback.\nclass RegisterValidator extends Container<{\n    name: string;\n    email: string;\n    password: string;\n}> {\n    protected override initialize() {\n        super.initialize();\n        this.mount('name', createValidator(z.string().min(3).max(128)));\n        this.mount('email', createValidator(z.string().email().max(255)));\n        this.mount('password', createValidator(z.string().min(3).max(255)));\n    }\n}\n\nexport default defineComponent({\n    components: {\n        AAuthBackLink,\n        ActivateForm,\n        VCButton,\n        VCAlert,\n        VCFormGroup,\n        VCFormInput,\n        IFieldValidation,\n    },\n    props: {\n        realmId: { type: String },\n        backLink: { type: Object as PropType<LinkProps> },\n    },\n    emits: ['done', 'failed'],\n    setup(props, { emit }) {\n        const apiClient = injectHTTPClient();\n\n        const form = reactive({\n            name: '',\n            email: '',\n            password: '',\n        });\n\n        const v = useValidup(new RegisterValidator(), form);\n\n        const translations = useTranslations([\n            {\n                namespace: TranslatorTranslationNamespace.ACTION,\n                key: TranslatorTranslationActionKey.REGISTER,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.NAME,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.EMAIL,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.FIELD,\n                key: TranslatorTranslationFieldKey.PASSWORD,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.CLIENT,\n                key: TranslatorTranslationClientKey.CREATE_ACCOUNT,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.CLIENT,\n                key: TranslatorTranslationClientKey.CHECK_EMAIL_ACTIVATE,\n            },\n            {\n                namespace: TranslatorTranslationNamespace.CLIENT,\n                key: TranslatorTranslationClientKey.BACK_TO_LOGIN,\n            },\n        ]);\n\n        const busy = ref(false);\n        const error = ref<string | null>(null);\n\n        // Switches the view to the activation step when the server reports\n        // the freshly registered account as inactive (email verification).\n        const awaitingActivation = ref(false);\n\n        const submit = wrapFnWithBusyState(busy, async () => {\n            error.value = null;\n\n            try {\n                const response = await apiClient.user.register({\n                    name: form.name,\n                    email: form.email,\n                    password: form.password,\n                    ...(props.realmId ? { realmId: props.realmId } : {}),\n                });\n\n                if (response.active) {\n                    emit('done', response);\n                } else {\n                    awaitingActivation.value = true;\n                }\n            } catch (e) {\n                error.value = e instanceof Error ? e.message : null;\n                emit('failed', e);\n            }\n        });\n\n        const submitButton = useSubmitButton({\n            loading: busy,\n            disabled: computed(() => busy.value || v.$invalid.value),\n        });\n\n        return {\n            v,\n            form,\n            submit,\n            submitButton,\n            busy,\n            error,\n            awaitingActivation,\n            translations,\n        };\n    },\n});\n</script>\n<template>\n    <div>\n        <template v-if=\"awaitingActivation\">\n            <VCAlert\n                color=\"info\"\n                variant=\"soft\"\n                class=\"mb-3\"\n            >\n                {{ translations.checkEmailActivate }}\n            </VCAlert>\n\n            <ActivateForm\n                @done=\"$emit('done')\"\n                @failed=\"$emit('failed', $event)\"\n            />\n        </template>\n        <template v-else>\n            <div class=\"text-center\">\n                <h1 class=\"font-bold\">\n                    {{ translations.createAccount }}\n                </h1>\n            </div>\n\n            <form @submit.prevent=\"submit\">\n                <VCAlert\n                    v-if=\"error\"\n                    color=\"error\"\n                    variant=\"soft\"\n                    class=\"mb-3\"\n                >\n                    {{ error }}\n                </VCAlert>\n\n                <IFieldValidation\n                    v-slot=\"{ value }\"\n                    :field=\"v.fields.name\"\n                >\n                    <VCFormGroup :validation=\"value\">\n                        <template #label>\n                            {{ translations.name }}\n                        </template>\n                        <VCFormInput v-model=\"v.fields.name.$model.value\" />\n                    </VCFormGroup>\n                </IFieldValidation>\n\n                <IFieldValidation\n                    v-slot=\"{ value }\"\n                    :field=\"v.fields.email\"\n                >\n                    <VCFormGroup :validation=\"value\">\n                        <template #label>\n                            {{ translations.email }}\n                        </template>\n                        <VCFormInput\n                            v-model=\"v.fields.email.$model.value\"\n                            type=\"email\"\n                        />\n                    </VCFormGroup>\n                </IFieldValidation>\n\n                <IFieldValidation\n                    v-slot=\"{ value }\"\n                    :field=\"v.fields.password\"\n                >\n                    <VCFormGroup :validation=\"value\">\n                        <template #label>\n                            {{ translations.password }}\n                        </template>\n                        <VCFormInput\n                            v-model=\"v.fields.password.$model.value\"\n                            type=\"password\"\n                        />\n                    </VCFormGroup>\n                </IFieldValidation>\n\n                <VCButton\n                    v-bind=\"submitButton\"\n                    :label=\"translations.register\"\n                    class=\"w-full\"\n                />\n            </form>\n        </template>\n\n        <AAuthBackLink :link=\"backLink\" />\n    </div>\n</template>\n","<!--\n  - Copyright (c) 2026.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\nimport { TranslatorTranslationClientKey, TranslatorTranslationNamespace } from '@authup/i18n';\nimport { VCAlert } from '@vuecs/elements';\nimport { defineComponent } from 'vue';\nimport { useTranslations } from '../../core';\n\n// Shared \"this workflow is disabled\" notice rendered by the SSR auth\n// workflow pages (register, activate, password-forgot, password-reset)\n// when the corresponding feature flag is off. A localized alert instead\n// of a 404 — stale email links should not dead-end.\nexport default defineComponent({\n    components: { VCAlert },\n    setup() {\n        const translations = useTranslations([\n            {\n                namespace: TranslatorTranslationNamespace.CLIENT,\n                key: TranslatorTranslationClientKey.WORKFLOW_DISABLED,\n            },\n        ]);\n\n        return { translations };\n    },\n});\n</script>\n<template>\n    <VCAlert\n        color=\"warning\"\n        variant=\"soft\"\n        class=\"mb-3\"\n    >\n        {{ translations.workflowDisabled }}\n    </VCAlert>\n</template>\n","<!--\n  - Copyright (c) 2026.\n  - Author Peter Placzek (tada5hi)\n  - For the full copyright and license information,\n  - view the LICENSE file that was distributed with this source code.\n  -->\n<script lang=\"ts\">\nimport { TranslatorTranslationClientKey, TranslatorTranslationNamespace } from '@authup/i18n';\nimport { VCAlert } from '@vuecs/elements';\nimport { defineComponent } from 'vue';\nimport { useTranslations } from '../../core';\n\n// Shared \"this workflow is disabled\" notice rendered by the SSR auth\n// workflow pages (register, activate, password-forgot, password-reset)\n// when the corresponding feature flag is off. A localized alert instead\n// of a 404 — stale email links should not dead-end.\nexport default defineComponent({\n    components: { VCAlert },\n    setup() {\n        const translations = useTranslations([\n            {\n                namespace: TranslatorTranslationNamespace.CLIENT,\n                key: TranslatorTranslationClientKey.WORKFLOW_DISABLED,\n            },\n        ]);\n\n        return { translations };\n    },\n});\n</script>\n<template>\n    <VCAlert\n        color=\"warning\"\n        variant=\"soft\"\n        class=\"mb-3\"\n    >\n        {{ translations.workflowDisabled }}\n    </VCAlert>\n</template>\n","import type { Plugin } from 'vue';\nimport { install } from './module';\nimport type { Options } from './types';\n\nexport * from './components';\nexport * from './composables';\nexport * from './core';\nexport * from './types';\n\nexport { install };\n\nexport default { install } satisfies Plugin<Options | undefined>;\n"],"x_google_ignoreList":[40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUA,SAAS,aAAa,OAAuB;CACzC,OAAO,MAAM,QAAQ,uBAAuB,MAAM;AACtD;AAEA,SAAgB,WAAW,MAAmC;CAC1D,IAAI,OAAO,aAAa,aACpB;CAIJ,MAAM,QADQ,SAAS,OAAO,MAAM,IAAI,OAAO,cAAc,aAAa,IAAI,EAAE,SAAS,CACvE,CAAC,GAAG;CACtB,IAAI,CAAC,OACD;CAKJ,IAAI;EACA,OAAO,mBAAmB,KAAK;CACnC,QAAQ;EACJ;CACJ;AACJ;;;;;;;;AASA,SAAgB,gBAAgB,MAAc,SAAkB,WAAW,IAAkB;CACzF,MAAM,SAAS,IAAI,WAAW,WAAW,IAAI,KAAK,QAAQ;CAE1D,IAAI,OAAO,aAAa,aACpB,MAAM,SAAS,UAAU;EACrB,SAAS,SAAS,GAAG,KAAK,GAAG,mBAAmB,KAAK,EAAE;CAC3D,CAAC;CAGL,OAAO;AACX;;;ACvCA,MAAM,cAAc;;;;;;;;;;;AAYpB,SAAgB,gBAAgB,SAAkB;CAC9C,MAAM,SAAS,gBAAgB,aAAa,SAAS,QAAQ;CAC7D,MAAM,OAAO,SAAoB;EAC7B,WAAY,YAAY,OAAO,KAAK,IAAI,OAAO,QAAQ;EACvD,IAAI,OAAO;GACP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