@loozo/angular-router 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +442 -79
- package/builders.json +2 -2
- package/fesm2022/loozo-angular-router-_core.mjs +348 -589
- package/fesm2022/loozo-angular-router-_core.mjs.map +1 -1
- package/fesm2022/loozo-angular-router-_generated.mjs +492 -617
- package/fesm2022/loozo-angular-router-_generated.mjs.map +1 -1
- package/fesm2022/loozo-angular-router.mjs +2 -19
- package/node/_core/src/path.d.ts +17 -0
- package/node/src/builders/application.js +9 -6
- package/node/src/builders/options.js +38 -58
- package/node/src/builders/serve.js +51 -8
- package/node/src/generation/anchor.d.ts +13 -0
- package/node/src/generation/anchor.js +92 -0
- package/node/src/generation/compiler.d.ts +6 -0
- package/node/src/generation/compiler.js +68 -0
- package/node/src/generation/emit.d.ts +3 -0
- package/node/src/generation/files.d.ts +26 -0
- package/node/src/generation/files.js +14 -3
- package/node/src/generation/filesystem.d.ts +7 -0
- package/node/src/generation/generate.d.ts +16 -0
- package/node/src/generation/generate.js +5 -4
- package/node/src/generation/index.d.ts +16 -0
- package/node/src/generation/index.js +15 -0
- package/node/src/generation/overlay.d.ts +3 -0
- package/node/src/generation/selectors.d.ts +2 -0
- package/node/src/generation/sources.d.ts +50 -0
- package/node/src/generation/sources.js +50 -10
- package/node/src/generation/validate.d.ts +12 -0
- package/node/src/generation/validate.js +38 -33
- package/package.json +7 -2
- package/schemas/application.json +743 -8
- package/schemas/serve.json +11 -32
- package/types/loozo-angular-router-_core.d.ts +159 -181
- package/types/loozo-angular-router-_generated.d.ts +131 -109
- package/types/loozo-angular-router.d.ts +2 -1
- package/.npmignore +0 -3
- package/fesm2022/loozo-angular-router.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loozo-angular-router-_core.mjs","sources":["../../_core/src/codecs.ts","../../_core/src/path.ts","../../_core/src/records.ts","../../_core/src/route.ts","../../_core/src/url.ts","../../_core/src/loozo-angular-router-_core.ts"],"sourcesContent":["/**\n * Converts one decoded path or search value to and from an application value.\n *\n * @remarks\n * Parsing may be asynchronous; stringification must be synchronous. Neither\n * method performs URL encoding. Codecs have no Angular injection-context\n * guarantee, and their returned objects are not recursively frozen.\n * For a terminal `$name[]` path, this codec applies to each element separately.\n *\n * @typeParam Value - The logical value, not a promise of that value.\n *\n * @example\n * ```ts\n * const dateParam: ParamCodec<Date> = {\n * parse: (raw) => new Date(raw),\n * stringify: (value) => value.toISOString(),\n * };\n * ```\n */\nexport interface ParamCodec<Value> {\n /**\n * Parses one already percent-decoded value; do not decode it again.\n *\n * @param raw - A single logical string from Angular's URL inputs.\n * @returns The logical value or a promise for it.\n * @throws An application error for invalid input; generated input parsing\n * reports throws and rejections as invalid path/search values with a cause.\n */\n parse(raw: string): Value | Promise<Value>;\n /**\n * Serializes one logical value without percent-encoding it.\n *\n * @param value - The application value to serialize.\n * @returns An unencoded string. Path output must not be empty, `.` or `..`.\n * @throws An application error when the value cannot be serialized.\n */\n stringify(value: Value): string;\n}\n\ndeclare const searchPresence: unique symbol;\n\n/** A search-only codec whose key may be omitted or supplied as `undefined`. */\nexport type OptionalCodec<Value> = ParamCodec<Value | undefined> & {\n readonly [searchPresence]: \"optional\";\n};\n/** A search-only codec that represents explicit `null` as the text `\"null\"`. */\nexport type NullableCodec<Value> = ParamCodec<Value | null> & {\n readonly [searchPresence]: \"nullable\";\n};\nexport type PathCodec = ParamCodec<any> & { readonly [searchPresence]?: never };\nexport type CodecValue<Codec> = Codec extends ParamCodec<infer Value> ? Value : never;\nexport type IsOptional<Codec> = Codec extends { readonly [searchPresence]: \"optional\" }\n ? true\n : false;\n\nconst presence = new WeakMap<object, \"optional\" | \"nullable\">();\n\nexport function codecPresence(codec: object): \"optional\" | \"nullable\" | undefined {\n return presence.get(codec);\n}\n\nexport function validateCodec(codec: unknown): asserts codec is ParamCodec<any> {\n if (\n codec === null ||\n (typeof codec !== \"object\" && typeof codec !== \"function\") ||\n typeof (codec as ParamCodec<unknown>).parse !== \"function\" ||\n typeof (codec as ParamCodec<unknown>).stringify !== \"function\"\n ) {\n throw new TypeError(\"Codec must have callable parse and stringify methods\");\n }\n}\n\n/**\n * Preserves strings verbatim, including empty strings and literal percent text.\n *\n * @remarks\n * Empty, dot and dotdot values are valid codec values but cannot be serialized\n * into path segments by URL creation. Search values may contain them.\n */\nexport const stringParam: ParamCodec<string> = {\n parse(raw) {\n return raw;\n },\n stringify(value) {\n if (typeof value !== \"string\") {\n throw new TypeError(\"Expected a string\");\n }\n\n return value;\n },\n};\n\n/**\n * Parses nonblank text with JavaScript `Number` and requires a finite result.\n *\n * @remarks\n * Whitespace around numbers, exponent notation and hexadecimal text are accepted.\n * Blank text, NaN and infinities throw. Stringification requires a finite number\n * and uses its JavaScript string representation (including `-0` becoming `\"0\"`).\n */\nexport const numberParam: ParamCodec<number> = {\n parse(raw) {\n const value = Number(raw);\n\n if (raw.trim() === \"\" || !Number.isFinite(value)) {\n throw new Error(\"Expected a finite number\");\n }\n\n return value;\n },\n stringify(value) {\n if (typeof value !== \"number\" || !Number.isFinite(value)) {\n throw new Error(\"Expected a finite number\");\n }\n\n return String(value);\n },\n};\n\n/**\n * Parses only lowercase `\"true\"` and `\"false\"`, and emits those same strings.\n * Other representations and nonboolean values throw.\n */\nexport const booleanParam: ParamCodec<boolean> = {\n parse(raw) {\n if (raw === \"true\") {\n return true;\n }\n\n if (raw === \"false\") {\n return false;\n }\n\n throw new Error(\"Expected true or false\");\n },\n stringify(value) {\n if (value === true) {\n return \"true\";\n }\n\n if (value === false) {\n return \"false\";\n }\n\n throw new Error(\"Expected a boolean\");\n },\n};\n\n/**\n * Creates a case-sensitive string codec from a snapshotted list of members.\n *\n * @typeParam Values - The literal list from which the value union is inferred.\n * @param values - Allowed decoded strings; an empty string is valid when listed.\n * @returns A codec whose parser and stringifier reject nonmembers.\n * @throws TypeError if the list or its entries are malformed.\n *\n * @example\n * ```ts\n * const tab = enumParam([\"details\", \"reviews\"]);\n * tab.parse(\"reviews\"); // \"reviews\"\n * ```\n */\nexport function enumParam<const Values extends readonly string[]>(\n values: Values,\n): ParamCodec<Values[number]> {\n if (!Array.isArray(values)) {\n throw new TypeError(\"Enum values must be a string list\");\n }\n\n const members = new Set<string>();\n\n for (const value of values) {\n if (typeof value !== \"string\") {\n throw new TypeError(\"Enum values must be strings\");\n }\n\n members.add(value);\n }\n\n return {\n parse(raw) {\n if (!members.has(raw)) {\n throw new Error(\"Unknown enum value\");\n }\n\n return raw as Values[number];\n },\n stringify(value) {\n if (!members.has(value)) {\n throw new Error(\"Unknown enum value\");\n }\n\n return value;\n },\n };\n}\n\n/**\n * Makes a search key optional without changing the handling of present values.\n *\n * @remarks\n * Generated parsing omits absent keys; URL creation omits absent or `undefined`\n * values. The wrapper's parser delegates present strings unchanged, preserving\n * promises and failures. Its stringifier cannot serialize `undefined` directly.\n * This wrapper is not a path codec. For optional nullable values, wrap\n * {@link nullableSearchParam} with this function, not the other way around.\n *\n * @typeParam Value - The wrapped codec's logical value.\n * @param codec - The codec used for present search values.\n * @returns A search-only codec allowing omission.\n * @throws TypeError if the codec lacks callable parse/stringify methods.\n */\nexport function optionalSearchParam<Value>(codec: ParamCodec<Value>): OptionalCodec<Value> {\n validateCodec(codec);\n\n const wrapper: ParamCodec<Value | undefined> = {\n parse(raw) {\n return codec.parse(raw);\n },\n stringify(value) {\n if (value === undefined) {\n throw new TypeError(\"Omitted search has no scalar representation\");\n }\n\n return codec.stringify(value);\n },\n };\n\n presence.set(wrapper, \"optional\");\n\n return wrapper as OptionalCodec<Value>;\n}\n\n/**\n * Adds explicit null to a search codec, represented by the decoded text `\"null\"`.\n *\n * @remarks\n * The key remains required unless wrapped with {@link optionalSearchParam}.\n * Non-null values delegate unchanged, including promise/failure identity. The\n * text `\"null\"` is reserved by this wrapper even if the inner codec accepts it.\n * This wrapper is not a path codec and cannot wrap an optional search codec.\n *\n * @typeParam Value - The wrapped codec's non-null logical value.\n * @param codec - The codec used for values other than null.\n * @returns A search-only codec accepting and serializing null.\n * @throws TypeError if the codec is malformed or is an optional search wrapper.\n *\n * @example\n * ```ts\n * const score = optionalSearchParam(nullableSearchParam(numberParam));\n * // Omission, null, and a present number remain distinct.\n * ```\n */\nexport function nullableSearchParam<Value>(\n codec: ParamCodec<Value> & { readonly [searchPresence]?: \"nullable\" },\n): NullableCodec<Value> {\n validateCodec(codec);\n\n if (codecPresence(codec) === \"optional\") {\n throw new TypeError(\"Nullable cannot wrap optional\");\n }\n\n const wrapper: ParamCodec<Value | null> = {\n parse(raw) {\n if (raw === \"null\") {\n return null;\n }\n\n return codec.parse(raw);\n },\n stringify(value) {\n if (value === null) {\n return \"null\";\n }\n\n return codec.stringify(value);\n },\n };\n\n presence.set(wrapper, \"nullable\");\n\n return wrapper as NullableCodec<Value>;\n}\n","type ValidName<Name extends string> = Name extends\n | \"\"\n | \"__proto__\"\n | `...${string}`\n | `${string}?${string}`\n | `${string}*${string}`\n | `${string}[]${string}`\n ? false\n : true;\ntype SegmentValid<Segment extends string> = Segment extends `$${infer Name}`\n ? ValidName<Name>\n : Segment extends \"\" | \".\" | \"..\" | \"*\" | \"**\" | `:${string}`\n ? false\n : true;\ntype ValidateSegments<\n Path extends string,\n Scalars extends string = never,\n> = Path extends `${infer Head}/${infer Tail}`\n ? Head extends `$${string}[]`\n ? false\n : SegmentValid<Head> extends true\n ? ValidateSegments<Tail, Scalars | ScalarName<Head>>\n : false\n : Path extends `$${infer Name}[]`\n ? ValidName<Name> extends true\n ? Name extends Scalars\n ? false\n : true\n : false\n : SegmentValid<Path>;\nexport type ValidPath<Path extends string> = string extends Path\n ? never\n : Path extends \"\"\n ? Path\n : ValidateSegments<Path> extends true\n ? Path\n : never;\ntype ScalarName<Segment extends string> = Segment extends `$${infer Name}` ? Name : never;\ntype SegmentName<Segment extends string> = Segment extends `$${infer Name}[]`\n ? Name\n : ScalarName<Segment>;\nexport type PathNames<Path extends string> = Path extends `${infer Head}/${infer Tail}`\n ? SegmentName<Head> | PathNames<Tail>\n : SegmentName<Path>;\nexport type CatchallName<Path extends string> = Path extends `${string}/${infer Tail}`\n ? CatchallName<Tail>\n : Path extends `$${infer Name}[]`\n ? Name\n : never;\n\nexport type Segment =\n | { readonly kind: \"static\"; readonly text: string }\n | { readonly kind: \"scalar\" | \"catchall\"; readonly name: string };\n\nexport function parsePath(path: unknown): readonly Segment[] {\n if (typeof path !== \"string\") {\n throw new TypeError(\"Path must be a string\");\n }\n\n if (path === \"\") {\n return Object.freeze([]);\n }\n\n const segments: Segment[] = [];\n const scalarNames = new Set<string>();\n const parts = path.split(\"/\");\n\n for (let index = 0; index < parts.length; index += 1) {\n const part = parts[index];\n\n if (part.startsWith(\"$\")) {\n let name = part.slice(1);\n let kind: \"scalar\" | \"catchall\" = \"scalar\";\n\n if (name.endsWith(\"[]\")) {\n name = name.slice(0, -2);\n kind = \"catchall\";\n }\n\n if (\n name === \"\" ||\n name === \"__proto__\" ||\n name.startsWith(\"...\") ||\n name.includes(\"?\") ||\n name.includes(\"*\") ||\n name.includes(\"[]\")\n ) {\n throw new TypeError(`Invalid parameter name: ${name}`);\n }\n\n if (kind === \"catchall\" && (index !== parts.length - 1 || scalarNames.has(name))) {\n throw new TypeError(\"Catchall must be terminal and cannot repeat a scalar name\");\n }\n\n scalarNames.add(name);\n segments.push(Object.freeze({ kind, name }));\n } else {\n if (\n part === \"\" ||\n part === \".\" ||\n part === \"..\" ||\n part === \"*\" ||\n part === \"**\" ||\n part.startsWith(\":\")\n ) {\n throw new TypeError(`Invalid static segment: ${part}`);\n }\n\n if (!part.isWellFormed()) {\n throw new TypeError(\"Static path Unicode must be well formed\");\n }\n\n segments.push(Object.freeze({ kind: \"static\", text: part }));\n }\n }\n\n return Object.freeze(segments);\n}\n","export function ownRecord(\n value: unknown,\n label: string,\n allowSymbols = false,\n): Record<string, unknown> {\n if (value === null || typeof value !== \"object\" || Array.isArray(value)) {\n throw new TypeError(`${label} must be an own record`);\n }\n\n const prototype = Object.getPrototypeOf(value);\n\n if (prototype !== Object.prototype && prototype !== null) {\n throw new TypeError(`${label} cannot contain inherited entries`);\n }\n\n for (const key of Reflect.ownKeys(value)) {\n if (\n (!allowSymbols && typeof key !== \"string\") ||\n !Object.prototype.propertyIsEnumerable.call(value, key)\n ) {\n throw new TypeError(`${label} contains an unsupported key`);\n }\n }\n\n return value as Record<string, unknown>;\n}\n\nexport function checkKeys(\n record: Record<string, unknown>,\n allowed: ReadonlySet<string>,\n label: string,\n): void {\n for (const key of Object.keys(record)) {\n if (!allowed.has(key)) {\n throw new TypeError(`Unknown ${label} key: ${key}`);\n }\n }\n}\n\nexport function has(record: object, key: PropertyKey): boolean {\n return Object.hasOwn(record, key);\n}\n","import { codecPresence, validateCodec, type ParamCodec, type PathCodec } from \"./codecs.js\";\nimport { parsePath, type Segment, type ValidPath, type CatchallName } from \"./path.js\";\nimport { checkKeys, has, ownRecord } from \"./records.js\";\nimport type {\n AnyRoute,\n CodecMap,\n EffectiveParams,\n EffectiveSearch,\n Route,\n RouteConfig,\n SearchOf,\n} from \"./types.js\";\n\nexport interface RouteMetadata {\n readonly parent?: AnyRoute;\n readonly localSegments: readonly Segment[];\n readonly segments: readonly Segment[];\n readonly localParams: Readonly<Record<string, ParamCodec<any>>>;\n readonly localSearch: Readonly<Record<string, ParamCodec<any>>>;\n readonly params: Readonly<Record<string, ParamCodec<any>>>;\n readonly search: Readonly<Record<string, ParamCodec<any>>>;\n readonly fragments: readonly string[];\n readonly config: Readonly<Record<string, unknown>>;\n}\n\nconst routes = new WeakMap<object, RouteMetadata>();\nconst configKeys = new Set([\n \"parent\",\n \"params\",\n \"search\",\n \"resolve\",\n \"runGuardsAndResolvers\",\n \"redirect\",\n \"fragments\",\n \"canActivate\",\n \"canActivateChild\",\n \"canMatch\",\n \"canDeactivate\",\n \"providers\",\n \"title\",\n \"data\",\n]);\nconst policies = new Set([\n \"pathParamsChange\",\n \"pathParamsOrQueryParamsChange\",\n \"paramsChange\",\n \"paramsOrQueryParamsChange\",\n \"always\",\n]);\nconst identityKey = \"__loozoAngularRouterRouteId\";\n\nexport function routeMetadata(route: unknown): RouteMetadata {\n if (route === null || typeof route !== \"object\" || !routes.has(route)) {\n throw new TypeError(\"Expected a genuine route from this package instance\");\n }\n\n return routes.get(route)!;\n}\n\nfunction copyCodecs(value: unknown, path: boolean): Readonly<Record<string, ParamCodec<any>>> {\n const record = ownRecord(value, \"Codec map\");\n const result: Record<string, ParamCodec<any>> = Object.create(null);\n\n for (const key of Object.keys(record)) {\n const codec = record[key];\n\n validateCodec(codec);\n\n if (path && codecPresence(codec) !== undefined) {\n throw new TypeError(\"Search wrappers cannot be path codecs\");\n }\n\n result[key] = codec;\n }\n\n return Object.freeze(result);\n}\n\nfunction snapshotRedirect(\n value: unknown,\n source: RouteMetadata,\n): Readonly<Record<string, unknown>> {\n const redirect = ownRecord(value, \"Redirect\");\n\n checkKeys(redirect, new Set([\"to\", \"params\", \"search\", \"fragment\"]), \"redirect\");\n\n const target = routeMetadata(redirect.to);\n const mapping: Record<string, string> = Object.create(null);\n\n if (has(redirect, \"params\")) {\n const supplied = ownRecord(redirect.params, \"Redirect params\");\n\n checkKeys(supplied, new Set(Object.keys(target.params)), \"redirect params\");\n\n for (const key of Object.keys(target.params)) {\n const sourceKey = supplied[key];\n\n if (!has(supplied, key) || typeof sourceKey !== \"string\" || !has(source.params, sourceKey)) {\n throw new TypeError(`Missing or invalid redirect mapping: ${key}`);\n }\n\n mapping[key] = sourceKey;\n }\n } else {\n for (const key of Object.keys(target.params)) {\n if (!has(source.params, key)) {\n throw new TypeError(`Cannot forward redirect param: ${key}`);\n }\n\n mapping[key] = key;\n }\n }\n\n const search = ownRecord(redirect.search, \"Redirect search\");\n let searchSnapshot: Record<string, unknown>;\n\n if (search.mode === \"replace\") {\n checkKeys(search, new Set([\"mode\", \"values\"]), \"redirect search\");\n\n const values = ownRecord(search.values, \"Redirect replacement\");\n\n validateSearchValues(target.search, values);\n searchSnapshot = { mode: \"replace\", values: Object.freeze({ ...values }) };\n } else if (search.mode === \"preserve\" || search.mode === \"drop\") {\n checkKeys(search, new Set([\"mode\"]), \"redirect search\");\n\n for (const key of Object.keys(target.search)) {\n if (codecPresence(target.search[key]) === \"optional\") {\n continue;\n }\n\n if (\n search.mode === \"drop\" ||\n !has(source.search, key) ||\n codecPresence(source.search[key]) === \"optional\"\n ) {\n throw new TypeError(`Redirect cannot guarantee required search: ${key}`);\n }\n }\n\n searchSnapshot = { mode: search.mode };\n } else {\n throw new TypeError(\"Invalid redirect search policy\");\n }\n\n const fragment = ownRecord(redirect.fragment, \"Redirect fragment\");\n\n if (fragment.mode === \"replace\") {\n checkKeys(fragment, new Set([\"mode\", \"value\"]), \"redirect fragment\");\n\n if (typeof fragment.value !== \"string\" || !target.fragments.includes(fragment.value)) {\n throw new TypeError(\"Redirect fragment must belong to target declaration\");\n }\n } else if (fragment.mode === \"preserve\" || fragment.mode === \"drop\") {\n checkKeys(fragment, new Set([\"mode\"]), \"redirect fragment\");\n } else {\n throw new TypeError(\"Invalid redirect fragment policy\");\n }\n\n return Object.freeze({\n to: redirect.to,\n params: Object.freeze(mapping),\n search: Object.freeze(searchSnapshot),\n fragment: Object.freeze({ ...fragment }),\n });\n}\n\nexport function validateSearchValues(\n codecs: Readonly<Record<string, ParamCodec<any>>>,\n values: Record<string, unknown>,\n): void {\n checkKeys(values, new Set(Object.keys(codecs)), \"search values\");\n\n for (const key of Object.keys(codecs)) {\n if (codecPresence(codecs[key]) !== \"optional\" && !has(values, key)) {\n throw new TypeError(`Missing required search: ${key}`);\n }\n }\n}\n\n/**\n * Declares a nominal typed route without executing codecs or native callbacks.\n *\n * @remarks\n * Paths are decoded authored text, not URLs: use `\"\"` for root/pathless nodes,\n * `$name` for a scalar segment and terminal `$name[]` for a zero-or-more\n * catchall. Repeated local scalar names reuse one value. Leading/trailing or\n * repeated slashes, dot segments and Angular `:name`/wildcard notation are invalid.\n *\n * Parents compose effective params/search transitively, including through\n * pathless nodes. Children cannot redeclare ancestor-owned keys or have a\n * catchall parent. Fragment names belong only to this declaration.\n * The route and copied containers are shallow-frozen; application codecs,\n * callbacks, providers and opaque values retain identity and are not deep-frozen.\n *\n * For generation, author a direct default export of this call with a literal\n * path and inline config. Parent and redirect targets must be direct default\n * imports of admitted declarations. Angular owns activation and navigation;\n * declaration alone does not register a route with Angular.\n *\n * @param path - The literal local path, relative to the authored parent.\n * @param config - Local codecs, parent, fragments and supported native behavior.\n * Structural Angular options such as children, component and matcher are\n * generator-owned and cannot be overridden.\n * @returns A frozen route preserving inferred effective input and local data types.\n * @throws TypeError for invalid paths/configuration, missing or extra local\n * codecs, inherited key conflicts, or nongenuine parent/redirect routes.\n *\n * @example\n * ```ts\n * const product = defineRoute(\"products/$productId\", {\n * params: { productId: numberParam },\n * search: { tab: optionalSearchParam(enumParam([\"details\", \"reviews\"])) },\n * fragments: [\"summary\", \"reviews\"],\n * });\n * ```\n */\nexport function defineRoute<\n const Path extends string,\n Parent extends AnyRoute | undefined = undefined,\n Params extends Record<string, PathCodec> = {},\n Search extends CodecMap = {},\n Resolvers extends Record<string, (...args: any[]) => unknown> = {},\n const Fragments extends readonly string[] = [],\n Target extends AnyRoute | undefined = undefined,\n ReplacementKeys extends keyof SearchOf<NoInfer<Target>> = never,\n>(\n path: Path & ValidPath<Path>,\n config: RouteConfig<Path, Parent, Params, Search, Resolvers, Fragments, Target, ReplacementKeys>,\n): Route<\n Path,\n EffectiveParams<Path, Params, Parent>,\n EffectiveSearch<Search, Parent>,\n Resolvers,\n Fragments[number],\n CatchallName<Path> extends never ? false : true\n>;\n\nexport function defineRoute(path: unknown, config: unknown): AnyRoute {\n const supplied = ownRecord(config, \"Route config\");\n\n checkKeys(supplied, configKeys, \"route config\");\n\n const localSegments = parsePath(path);\n let parent: AnyRoute | undefined;\n let inherited: RouteMetadata | undefined;\n\n if (has(supplied, \"parent\")) {\n inherited = routeMetadata(supplied.parent);\n parent = supplied.parent as AnyRoute;\n\n for (const segment of inherited.segments) {\n if (segment.kind === \"catchall\") {\n throw new TypeError(\"Catchall declarations cannot have children\");\n }\n }\n }\n\n const localNames = new Set<string>();\n\n for (const segment of localSegments) {\n if (segment.kind !== \"static\") {\n localNames.add(segment.name);\n }\n }\n\n let localParams: Readonly<Record<string, ParamCodec<any>>> = Object.freeze(Object.create(null));\n\n if (localNames.size === 0) {\n if (has(supplied, \"params\")) {\n throw new TypeError(\"Static paths cannot declare params\");\n }\n } else {\n localParams = copyCodecs(supplied.params, true);\n checkKeys(localParams, localNames, \"local params\");\n\n for (const key of localNames) {\n if (!has(localParams, key)) {\n throw new TypeError(`Missing local codec: ${key}`);\n }\n\n if (inherited && has(inherited.params, key)) {\n throw new TypeError(`Inherited param already owned: ${key}`);\n }\n }\n }\n\n let localSearch: Readonly<Record<string, ParamCodec<any>>> = Object.freeze(Object.create(null));\n\n if (has(supplied, \"search\")) {\n localSearch = copyCodecs(supplied.search, false);\n }\n\n for (const key of Object.keys(localSearch)) {\n if (inherited && has(inherited.search, key)) {\n throw new TypeError(`Inherited search already owned: ${key}`);\n }\n }\n\n const retained: Record<string, unknown> = { ...supplied };\n const result: {\n path: string;\n resolve?: Readonly<Record<PropertyKey, unknown>>;\n runGuardsAndResolvers?: unknown;\n } = { path: path as string };\n\n if (has(supplied, \"resolve\")) {\n const resolve = ownRecord(supplied.resolve, \"Resolvers\", true) as Record<PropertyKey, unknown>;\n const copied: Record<PropertyKey, unknown> = Object.create(null);\n\n for (const key of Reflect.ownKeys(resolve)) {\n if (key === identityKey || typeof resolve[key] !== \"function\") {\n throw new TypeError(`Invalid resolver: ${String(key)}`);\n }\n\n copied[key] = resolve[key];\n }\n\n result.resolve = Object.freeze(copied);\n retained.resolve = result.resolve;\n }\n\n if (has(supplied, \"runGuardsAndResolvers\")) {\n const policy = supplied.runGuardsAndResolvers;\n\n if (typeof policy !== \"function\" && (typeof policy !== \"string\" || !policies.has(policy))) {\n throw new TypeError(\"Invalid native rerun policy\");\n }\n\n result.runGuardsAndResolvers = policy;\n }\n\n for (const key of [\"canActivate\", \"canActivateChild\", \"canMatch\", \"canDeactivate\", \"providers\"]) {\n if (!has(supplied, key)) {\n continue;\n }\n\n const list = supplied[key];\n\n if (!Array.isArray(list)) {\n throw new TypeError(`${key} must be an array`);\n }\n\n if (key === \"canActivate\" || key === \"canActivateChild\" || key === \"canMatch\") {\n for (const callback of list) {\n if (typeof callback !== \"function\") {\n throw new TypeError(`${key} entries must be callbacks`);\n }\n }\n } else if (key === \"canDeactivate\") {\n for (const guard of list) {\n if (\n guard === null ||\n (typeof guard !== \"function\" && typeof guard !== \"object\" && typeof guard !== \"string\")\n ) {\n throw new TypeError(\"canDeactivate entries must be native callbacks or tokens\");\n }\n }\n }\n\n retained[key] = Object.freeze([...list]);\n }\n\n if (\n has(supplied, \"title\") &&\n typeof supplied.title !== \"string\" &&\n typeof supplied.title !== \"function\"\n ) {\n throw new TypeError(\"Invalid native title\");\n }\n\n if (has(supplied, \"data\")) {\n const data = ownRecord(supplied.data, \"Static data\", true);\n\n if (has(data, identityKey)) {\n throw new TypeError(\"Static data cannot set generated identity\");\n }\n\n retained.data = Object.freeze({ ...data });\n }\n\n const fragments: string[] = [];\n\n if (has(supplied, \"fragments\")) {\n if (!Array.isArray(supplied.fragments)) {\n throw new TypeError(\"Fragments must be a string list\");\n }\n\n for (const name of supplied.fragments) {\n if (typeof name !== \"string\") {\n throw new TypeError(\"Fragment names must be strings\");\n }\n\n fragments.push(name);\n }\n }\n\n retained.fragments = Object.freeze(fragments);\n retained.params = localParams;\n retained.search = localSearch;\n\n const metadata: RouteMetadata = {\n parent,\n localSegments,\n segments: Object.freeze([...(inherited?.segments ?? []), ...localSegments]),\n localParams,\n localSearch,\n params: Object.freeze({ ...inherited?.params, ...localParams }),\n search: Object.freeze({ ...inherited?.search, ...localSearch }),\n fragments: retained.fragments as readonly string[],\n config: retained,\n };\n\n if (has(supplied, \"redirect\")) {\n if (has(supplied, \"canActivate\") || has(supplied, \"canMatch\")) {\n throw new TypeError(\"Redirect cannot declare own canActivate or canMatch\");\n }\n\n retained.redirect = snapshotRedirect(supplied.redirect, metadata);\n }\n\n Object.freeze(retained);\n routes.set(result, Object.freeze(metadata));\n\n return Object.freeze(result) as AnyRoute;\n}\n","import { codecPresence, type ParamCodec } from \"./codecs.js\";\nimport { ownRecord, checkKeys, has } from \"./records.js\";\nimport { routeMetadata, validateSearchValues } from \"./route.js\";\nimport type { AnyRoute, SearchOf, UrlValues } from \"./types.js\";\n\nfunction encode(value: string): string {\n return encodeURIComponent(value).replaceAll(\"(\", \"%28\").replaceAll(\")\", \"%29\");\n}\n\nfunction stringify(codec: ParamCodec<any>, value: unknown, path: boolean): string {\n const text = codec.stringify(value);\n\n if (typeof text !== \"string\") {\n throw new TypeError(\"Codec stringify must return a string\");\n }\n\n if (path && (text === \"\" || text === \".\" || text === \"..\")) {\n throw new TypeError(\"Path output cannot be empty, dot or dotdot\");\n }\n\n return encode(text);\n}\n\n/**\n * Synchronously serializes a route's explicit values into a root-relative URL.\n *\n * @remarks\n * Includes inherited path/search declarations, but only this route's fragment\n * names. Every effective path value and required search key must be supplied.\n * Optional-only search may be omitted; searchless/paramless routes forbid those\n * records. Catchalls require readonly arrays, including a valid empty array.\n * Values are never taken from a current navigation.\n *\n * Stringifies without calling parsers, guards, resolvers or redirects. Static\n * segments and logical values are component-encoded (also escaping parentheses),\n * so a dynamic slash becomes `%2F`. Search keys are globally sorted; optional\n * `undefined` values are omitted. An empty effective path produces `/`.\n * Redirect declarations serialize their source URL, not their redirect target.\n *\n * @param route - A genuine declaration from this physical package instance,\n * not a generated destination, spread/copy or structural lookalike.\n * @param values - Explicit destination-typed params, search and optional fragment.\n * Pass an empty object when the route needs no values.\n * @returns A root-relative URL string; this does not navigate or return a UrlTree.\n * @throws TypeError for invalid routes/records, missing or unknown keys,\n * undeclared fragments, nonarray catchalls, nonstring codec output, or empty/dot\n * path output. Application stringifier failures propagate unchanged.\n * @throws URIError for ill-formed Unicode in a serialized value.\n *\n * @example\n * ```ts\n * const product = defineRoute(\"products/$productId\", {\n * params: { productId: numberParam },\n * fragments: [\"summary\"],\n * });\n * createUrl(product, { params: { productId: 42 }, fragment: \"summary\" });\n * // /products/42#summary\n * ```\n */\nexport function createUrl<\n Target extends AnyRoute,\n SearchKeys extends keyof SearchOf<NoInfer<Target>> = never,\n>(route: Target, values: UrlValues<NoInfer<Target>, SearchKeys>): string;\n\nexport function createUrl(route: unknown, values: unknown): string {\n const metadata = routeMetadata(route);\n const options = ownRecord(values, \"URL options\");\n\n checkKeys(options, new Set([\"params\", \"search\", \"fragment\"]), \"URL options\");\n\n const paramKeys = Object.keys(metadata.params);\n let params: Record<string, unknown> = Object.create(null);\n\n if (paramKeys.length === 0) {\n if (has(options, \"params\")) {\n throw new TypeError(\"Route has no path params\");\n }\n } else {\n params = ownRecord(options.params, \"Path values\");\n checkKeys(params, new Set(paramKeys), \"path values\");\n\n for (const key of paramKeys) {\n if (!has(params, key)) {\n throw new TypeError(`Missing path value: ${key}`);\n }\n }\n }\n\n const searchKeys = Object.keys(metadata.search).sort();\n let search: Record<string, unknown> = Object.create(null);\n\n if (searchKeys.length === 0) {\n if (has(options, \"search\")) {\n throw new TypeError(\"Route has no search declarations\");\n }\n } else {\n if (has(options, \"search\")) {\n search = ownRecord(options.search, \"Search values\");\n }\n\n validateSearchValues(metadata.search, search);\n }\n\n if (has(options, \"fragment\")) {\n if (typeof options.fragment !== \"string\" || !metadata.fragments.includes(options.fragment)) {\n throw new TypeError(\"Fragment must belong to this declaration\");\n }\n }\n\n // Check all cardinalities before invoking application stringifiers.\n for (const segment of metadata.segments) {\n if (segment.kind === \"catchall\" && !Array.isArray(params[segment.name])) {\n throw new TypeError(`Catchall requires an array: ${segment.name}`);\n }\n }\n\n const parts: string[] = [];\n\n for (const segment of metadata.segments) {\n if (segment.kind === \"static\") {\n parts.push(encode(segment.text));\n } else if (segment.kind === \"scalar\") {\n parts.push(stringify(metadata.params[segment.name], params[segment.name], true));\n } else {\n for (const value of params[segment.name] as readonly unknown[]) {\n parts.push(stringify(metadata.params[segment.name], value, true));\n }\n }\n }\n\n let url = `/${parts.join(\"/\")}`;\n const query: string[] = [];\n\n for (const key of searchKeys) {\n const codec = metadata.search[key];\n const optional = codecPresence(codec) === \"optional\";\n\n if (optional && !has(search, key)) {\n continue;\n }\n\n const value = search[key];\n\n if (optional && value === undefined) {\n continue;\n }\n\n query.push(`${encode(key)}=${stringify(codec, value, false)}`);\n }\n\n if (query.length > 0) {\n url += `?${query.join(\"&\")}`;\n }\n\n if (has(options, \"fragment\")) {\n url += `#${encode(options.fragment as string)}`;\n }\n\n return url;\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"AAuDA,MAAM,QAAQ,GAAG,IAAI,OAAO,EAAmC;AAEzD,SAAU,aAAa,CAAC,KAAa,EAAA;AACzC,IAAA,OAAO,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC;AAC5B;AAEM,SAAU,aAAa,CAAC,KAAc,EAAA;IAC1C,IACE,KAAK,KAAK,IAAI;SACb,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,KAAK,KAAK,UAAU,CAAC;AAC1D,QAAA,OAAQ,KAA6B,CAAC,KAAK,KAAK,UAAU;AAC1D,QAAA,OAAQ,KAA6B,CAAC,SAAS,KAAK,UAAU,EAC9D;AACA,QAAA,MAAM,IAAI,SAAS,CAAC,sDAAsD,CAAC;IAC7E;AACF;AAEA;;;;;;AAMG;AACI,MAAM,WAAW,GAAuB;AAC7C,IAAA,KAAK,CAAC,GAAG,EAAA;AACP,QAAA,OAAO,GAAG;IACZ,CAAC;AACD,IAAA,SAAS,CAAC,KAAK,EAAA;AACb,QAAA,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;AAC7B,YAAA,MAAM,IAAI,SAAS,CAAC,mBAAmB,CAAC;QAC1C;AAEA,QAAA,OAAO,KAAK;IACd,CAAC;;AAGH;;;;;;;AA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Aa,CAAC,KAAK,CAAC,KAAK,UAAU;QAEpD,IAAI,QAAQ,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE;YACjC;QACF;AAEA,QAAA,MAAM,KAAK,GAAG,MAAM,CAAC,GAAG,CAAC;AAEzB,QAAA,IAAI,QAAQ,IAAI,KAAK,KAAK,SAAS,EAAE;YACnC;QACF;AAEA,QAAA,KAAK,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAA,CAAA,EAAI,SAAS,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAA,CAAE,CAAC;IAChE;AAEA,IAAA,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE;QACpB,GAAG,IAAI,IAAI,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA,CAAE;IAC9B;AAEA,IAAA,IAAI,GAAG,CAAC,OAAO,EAAE,UAAU,CAAC,EAAE;QAC5B,GAAG,IAAI,IAAI,MAAM,CAAC,OAAO,CAAC,QAAkB,CAAC,CAAA,CAAE;IACjD;AAEA,IAAA,OAAO,GAAG;AACZ;;AC/JA;;AAEG;;"}
|
|
1
|
+
{"version":3,"file":"loozo-angular-router-_core.mjs","names":[],"sources":["../../_core/src/codecs.ts","../../_core/src/path.ts","../../_core/src/records.ts","../../_core/src/route.ts","../../_core/src/url.ts"],"sourcesContent":["/**\n * Converts one decoded path or search value to and from an application value.\n *\n * @remarks\n * Parsing may be asynchronous; stringification must be synchronous. Neither\n * method performs URL encoding. Codecs have no Angular injection-context\n * guarantee, and their returned objects are not recursively frozen.\n * For a terminal `$name[]` path, this codec applies to each element separately.\n *\n * @typeParam Value - The logical value, not a promise of that value.\n *\n * @example\n * ```ts\n * const dateParam: ParamCodec<Date> = {\n * parse: (raw) => new Date(raw),\n * stringify: (value) => value.toISOString(),\n * };\n * ```\n */\nexport interface ParamCodec<Value> {\n /**\n * Parses one already percent-decoded value; do not decode it again.\n *\n * @param raw - A single logical string from Angular's URL inputs.\n * @returns The logical value or a promise for it.\n * @throws An application error for invalid input; generated input parsing\n * reports throws and rejections as invalid path/search values with a cause.\n */\n parse(raw: string): Value | Promise<Value>;\n /**\n * Serializes one logical value without percent-encoding it.\n *\n * @param value - The application value to serialize.\n * @returns An unencoded string. Path output must not be empty, `.` or `..`.\n * @throws An application error when the value cannot be serialized.\n */\n stringify(value: Value): string;\n}\n\ndeclare const searchPresence: unique symbol;\n\n/** A search-only codec whose key may be omitted or supplied as `undefined`. */\nexport type OptionalCodec<Value> = ParamCodec<Value | undefined> & {\n readonly [searchPresence]: \"optional\";\n};\n/** A search-only codec that represents explicit `null` as the text `\"null\"`. */\nexport type NullableCodec<Value> = ParamCodec<Value | null> & {\n readonly [searchPresence]: \"nullable\";\n};\nexport type PathCodec = ParamCodec<any> & { readonly [searchPresence]?: never };\nexport type CodecValue<Codec> = Codec extends ParamCodec<infer Value> ? Value : never;\nexport type IsOptional<Codec> = Codec extends { readonly [searchPresence]: \"optional\" }\n ? true\n : false;\n\nconst presence = new WeakMap<object, \"optional\" | \"nullable\">();\n\nexport function codecPresence(codec: object): \"optional\" | \"nullable\" | undefined {\n return presence.get(codec);\n}\n\nexport function validateCodec(codec: unknown): asserts codec is ParamCodec<any> {\n if (\n codec === null ||\n (typeof codec !== \"object\" && typeof codec !== \"function\") ||\n typeof (codec as ParamCodec<unknown>).parse !== \"function\" ||\n typeof (codec as ParamCodec<unknown>).stringify !== \"function\"\n ) {\n throw new TypeError(\"Codec must have callable parse and stringify methods\");\n }\n}\n\n/**\n * Preserves strings verbatim, including empty strings and literal percent text.\n *\n * @remarks\n * Empty, dot and dotdot values are valid codec values but cannot be serialized\n * into path segments by URL creation. Search values may contain them.\n */\nexport const stringParam: ParamCodec<string> = {\n parse(raw) {\n return raw;\n },\n stringify(value) {\n if (typeof value !== \"string\") {\n throw new TypeError(\"Expected a string\");\n }\n\n return value;\n },\n};\n\n/**\n * Parses nonblank text with JavaScript `Number` and requires a finite result.\n *\n * @remarks\n * Whitespace around numbers, exponent notation and hexadecimal text are accepted.\n * Blank text, NaN and infinities throw. Stringification requires a finite number\n * and uses its JavaScript string representation (including `-0` becoming `\"0\"`).\n */\nexport const numberParam: ParamCodec<number> = {\n parse(raw) {\n const value = Number(raw);\n\n if (raw.trim() === \"\" || !Number.isFinite(value)) {\n throw new Error(\"Expected a finite number\");\n }\n\n return value;\n },\n stringify(value) {\n if (typeof value !== \"number\" || !Number.isFinite(value)) {\n throw new Error(\"Expected a finite number\");\n }\n\n return String(value);\n },\n};\n\n/**\n * Parses only lowercase `\"true\"` and `\"false\"`, and emits those same strings.\n * Other representations and nonboolean values throw.\n */\nexport const booleanParam: ParamCodec<boolean> = {\n parse(raw) {\n if (raw === \"true\") {\n return true;\n }\n\n if (raw === \"false\") {\n return false;\n }\n\n throw new Error(\"Expected true or false\");\n },\n stringify(value) {\n if (value === true) {\n return \"true\";\n }\n\n if (value === false) {\n return \"false\";\n }\n\n throw new Error(\"Expected a boolean\");\n },\n};\n\n/**\n * Creates a case-sensitive string codec from a snapshotted list of members.\n *\n * @typeParam Values - The literal list from which the value union is inferred.\n * @param values - Allowed decoded strings; an empty string is valid when listed.\n * @returns A codec whose parser and stringifier reject nonmembers.\n * @throws TypeError if the list or its entries are malformed.\n *\n * @example\n * ```ts\n * const tab = enumParam([\"details\", \"reviews\"]);\n * tab.parse(\"reviews\"); // \"reviews\"\n * ```\n */\nexport function enumParam<const Values extends readonly string[]>(\n values: Values,\n): ParamCodec<Values[number]> {\n if (!Array.isArray(values)) {\n throw new TypeError(\"Enum values must be a string list\");\n }\n\n const members = new Set<string>();\n\n for (const value of values) {\n if (typeof value !== \"string\") {\n throw new TypeError(\"Enum values must be strings\");\n }\n\n members.add(value);\n }\n\n return {\n parse(raw) {\n if (!members.has(raw)) {\n throw new Error(\"Unknown enum value\");\n }\n\n return raw as Values[number];\n },\n stringify(value) {\n if (!members.has(value)) {\n throw new Error(\"Unknown enum value\");\n }\n\n return value;\n },\n };\n}\n\n/**\n * Makes a search key optional without changing the handling of present values.\n *\n * @remarks\n * Generated parsing omits absent keys; URL creation omits absent or `undefined`\n * values. The wrapper's parser delegates present strings unchanged, preserving\n * promises and failures. Its stringifier cannot serialize `undefined` directly.\n * This wrapper is not a path codec. For optional nullable values, wrap\n * {@link nullableSearchParam} with this function, not the other way around.\n *\n * @typeParam Value - The wrapped codec's logical value.\n * @param codec - The codec used for present search values.\n * @returns A search-only codec allowing omission.\n * @throws TypeError if the codec lacks callable parse/stringify methods.\n */\nexport function optionalSearchParam<Value>(codec: ParamCodec<Value>): OptionalCodec<Value> {\n validateCodec(codec);\n\n const wrapper: ParamCodec<Value | undefined> = {\n parse(raw) {\n return codec.parse(raw);\n },\n stringify(value) {\n if (value === undefined) {\n throw new TypeError(\"Omitted search has no scalar representation\");\n }\n\n return codec.stringify(value);\n },\n };\n\n presence.set(wrapper, \"optional\");\n\n return wrapper as OptionalCodec<Value>;\n}\n\n/**\n * Adds explicit null to a search codec, represented by the decoded text `\"null\"`.\n *\n * @remarks\n * The key remains required unless wrapped with {@link optionalSearchParam}.\n * Non-null values delegate unchanged, including promise/failure identity. The\n * text `\"null\"` is reserved by this wrapper even if the inner codec accepts it.\n * This wrapper is not a path codec and cannot wrap an optional search codec.\n *\n * @typeParam Value - The wrapped codec's non-null logical value.\n * @param codec - The codec used for values other than null.\n * @returns A search-only codec accepting and serializing null.\n * @throws TypeError if the codec is malformed or is an optional search wrapper.\n *\n * @example\n * ```ts\n * const score = optionalSearchParam(nullableSearchParam(numberParam));\n * // Omission, null, and a present number remain distinct.\n * ```\n */\nexport function nullableSearchParam<Value>(\n codec: ParamCodec<Value> & { readonly [searchPresence]?: \"nullable\" },\n): NullableCodec<Value> {\n validateCodec(codec);\n\n if (codecPresence(codec) === \"optional\") {\n throw new TypeError(\"Nullable cannot wrap optional\");\n }\n\n const wrapper: ParamCodec<Value | null> = {\n parse(raw) {\n if (raw === \"null\") {\n return null;\n }\n\n return codec.parse(raw);\n },\n stringify(value) {\n if (value === null) {\n return \"null\";\n }\n\n return codec.stringify(value);\n },\n };\n\n presence.set(wrapper, \"nullable\");\n\n return wrapper as NullableCodec<Value>;\n}\n","type ValidName<Name extends string> = Name extends\n | \"\"\n | \"__proto__\"\n | `...${string}`\n | `${string}?${string}`\n | `${string}*${string}`\n | `${string}[]${string}`\n ? false\n : true;\ntype SegmentValid<Segment extends string> = Segment extends `$${infer Name}`\n ? ValidName<Name>\n : Segment extends \"\" | \".\" | \"..\" | \"*\" | \"**\" | `:${string}`\n ? false\n : true;\ntype ValidateSegments<\n Path extends string,\n Scalars extends string = never,\n> = Path extends `${infer Head}/${infer Tail}`\n ? Head extends `$${string}[]`\n ? false\n : SegmentValid<Head> extends true\n ? ValidateSegments<Tail, Scalars | ScalarName<Head>>\n : false\n : Path extends `$${infer Name}[]`\n ? ValidName<Name> extends true\n ? Name extends Scalars\n ? false\n : true\n : false\n : SegmentValid<Path>;\nexport type ValidPath<Path extends string> = string extends Path\n ? never\n : Path extends \"\"\n ? Path\n : ValidateSegments<Path> extends true\n ? Path\n : never;\ntype ScalarName<Segment extends string> = Segment extends `$${infer Name}` ? Name : never;\ntype SegmentName<Segment extends string> = Segment extends `$${infer Name}[]`\n ? Name\n : ScalarName<Segment>;\nexport type PathNames<Path extends string> = Path extends `${infer Head}/${infer Tail}`\n ? SegmentName<Head> | PathNames<Tail>\n : SegmentName<Path>;\nexport type CatchallName<Path extends string> = Path extends `${string}/${infer Tail}`\n ? CatchallName<Tail>\n : Path extends `$${infer Name}[]`\n ? Name\n : never;\n\nexport type Segment =\n | { readonly kind: \"static\"; readonly text: string }\n | { readonly kind: \"scalar\" | \"catchall\"; readonly name: string };\n\nexport function parsePath(path: unknown): readonly Segment[] {\n if (typeof path !== \"string\") {\n throw new TypeError(\"Path must be a string\");\n }\n\n if (path === \"\") {\n return Object.freeze([]);\n }\n\n const segments: Segment[] = [];\n const scalarNames = new Set<string>();\n const parts = path.split(\"/\");\n\n for (let index = 0; index < parts.length; index += 1) {\n const part = parts[index];\n\n if (part.startsWith(\"$\")) {\n let name = part.slice(1);\n let kind: \"scalar\" | \"catchall\" = \"scalar\";\n\n if (name.endsWith(\"[]\")) {\n name = name.slice(0, -2);\n kind = \"catchall\";\n }\n\n if (\n name === \"\" ||\n name === \"__proto__\" ||\n name.startsWith(\"...\") ||\n name.includes(\"?\") ||\n name.includes(\"*\") ||\n name.includes(\"[]\")\n ) {\n throw new TypeError(`Invalid parameter name: ${name}`);\n }\n\n if (kind === \"catchall\" && (index !== parts.length - 1 || scalarNames.has(name))) {\n throw new TypeError(\"Catchall must be terminal and cannot repeat a scalar name\");\n }\n\n scalarNames.add(name);\n segments.push(Object.freeze({ kind, name }));\n } else {\n if (\n part === \"\" ||\n part === \".\" ||\n part === \"..\" ||\n part === \"*\" ||\n part === \"**\" ||\n part.startsWith(\":\")\n ) {\n throw new TypeError(`Invalid static segment: ${part}`);\n }\n\n if (!part.isWellFormed()) {\n throw new TypeError(\"Static path Unicode must be well formed\");\n }\n\n segments.push(Object.freeze({ kind: \"static\", text: part }));\n }\n }\n\n return Object.freeze(segments);\n}\n","export function ownRecord(\n value: unknown,\n label: string,\n allowSymbols = false,\n): Record<string, unknown> {\n if (value === null || typeof value !== \"object\" || Array.isArray(value)) {\n throw new TypeError(`${label} must be an own record`);\n }\n\n const prototype = Object.getPrototypeOf(value);\n\n if (prototype !== Object.prototype && prototype !== null) {\n throw new TypeError(`${label} cannot contain inherited entries`);\n }\n\n for (const key of Reflect.ownKeys(value)) {\n if (\n (!allowSymbols && typeof key !== \"string\") ||\n !Object.prototype.propertyIsEnumerable.call(value, key)\n ) {\n throw new TypeError(`${label} contains an unsupported key`);\n }\n }\n\n return value as Record<string, unknown>;\n}\n\nexport function checkKeys(\n record: Record<string, unknown>,\n allowed: ReadonlySet<string>,\n label: string,\n): void {\n for (const key of Object.keys(record)) {\n if (!allowed.has(key)) {\n throw new TypeError(`Unknown ${label} key: ${key}`);\n }\n }\n}\n\nexport function has(record: object, key: PropertyKey): boolean {\n return Object.hasOwn(record, key);\n}\n","import { codecPresence, validateCodec, type ParamCodec, type PathCodec } from \"./codecs.js\";\nimport { parsePath, type Segment, type ValidPath, type CatchallName } from \"./path.js\";\nimport { checkKeys, has, ownRecord } from \"./records.js\";\nimport type {\n AnyRoute,\n CodecMap,\n EffectiveParams,\n EffectiveSearch,\n Route,\n RouteConfig,\n SearchOf,\n} from \"./types.js\";\n\nexport interface RouteMetadata {\n readonly parent?: AnyRoute;\n readonly localSegments: readonly Segment[];\n readonly segments: readonly Segment[];\n readonly localParams: Readonly<Record<string, ParamCodec<any>>>;\n readonly localSearch: Readonly<Record<string, ParamCodec<any>>>;\n readonly params: Readonly<Record<string, ParamCodec<any>>>;\n readonly search: Readonly<Record<string, ParamCodec<any>>>;\n readonly fragments: readonly string[];\n readonly config: Readonly<Record<string, unknown>>;\n}\n\nconst routes = new WeakMap<object, RouteMetadata>();\nconst configKeys = new Set([\n \"parent\",\n \"params\",\n \"search\",\n \"resolve\",\n \"runGuardsAndResolvers\",\n \"redirect\",\n \"fragments\",\n \"canActivate\",\n \"canActivateChild\",\n \"canMatch\",\n \"canDeactivate\",\n \"providers\",\n \"title\",\n \"data\",\n]);\nconst policies = new Set([\n \"pathParamsChange\",\n \"pathParamsOrQueryParamsChange\",\n \"paramsChange\",\n \"paramsOrQueryParamsChange\",\n \"always\",\n]);\nconst identityKey = \"__loozoAngularRouterRouteId\";\n\nexport function routeMetadata(route: unknown): RouteMetadata {\n if (route === null || typeof route !== \"object\" || !routes.has(route)) {\n throw new TypeError(\"Expected a genuine route from this package instance\");\n }\n\n return routes.get(route)!;\n}\n\nfunction copyCodecs(value: unknown, path: boolean): Readonly<Record<string, ParamCodec<any>>> {\n const record = ownRecord(value, \"Codec map\");\n const result: Record<string, ParamCodec<any>> = Object.create(null);\n\n for (const key of Object.keys(record)) {\n const codec = record[key];\n\n validateCodec(codec);\n\n if (path && codecPresence(codec) !== undefined) {\n throw new TypeError(\"Search wrappers cannot be path codecs\");\n }\n\n result[key] = codec;\n }\n\n return Object.freeze(result);\n}\n\nfunction snapshotRedirect(\n value: unknown,\n source: RouteMetadata,\n): Readonly<Record<string, unknown>> {\n const redirect = ownRecord(value, \"Redirect\");\n\n checkKeys(redirect, new Set([\"to\", \"params\", \"search\", \"fragment\"]), \"redirect\");\n\n const target = routeMetadata(redirect.to);\n const mapping: Record<string, string> = Object.create(null);\n\n if (has(redirect, \"params\")) {\n const supplied = ownRecord(redirect.params, \"Redirect params\");\n\n checkKeys(supplied, new Set(Object.keys(target.params)), \"redirect params\");\n\n for (const key of Object.keys(target.params)) {\n const sourceKey = supplied[key];\n\n if (!has(supplied, key) || typeof sourceKey !== \"string\" || !has(source.params, sourceKey)) {\n throw new TypeError(`Missing or invalid redirect mapping: ${key}`);\n }\n\n mapping[key] = sourceKey;\n }\n } else {\n for (const key of Object.keys(target.params)) {\n if (!has(source.params, key)) {\n throw new TypeError(`Cannot forward redirect param: ${key}`);\n }\n\n mapping[key] = key;\n }\n }\n\n const search = ownRecord(redirect.search, \"Redirect search\");\n let searchSnapshot: Record<string, unknown>;\n\n if (search.mode === \"replace\") {\n checkKeys(search, new Set([\"mode\", \"values\"]), \"redirect search\");\n\n const values = ownRecord(search.values, \"Redirect replacement\");\n\n validateSearchValues(target.search, values);\n searchSnapshot = { mode: \"replace\", values: Object.freeze({ ...values }) };\n } else if (search.mode === \"preserve\" || search.mode === \"drop\") {\n checkKeys(search, new Set([\"mode\"]), \"redirect search\");\n\n for (const key of Object.keys(target.search)) {\n if (codecPresence(target.search[key]) === \"optional\") {\n continue;\n }\n\n if (\n search.mode === \"drop\" ||\n !has(source.search, key) ||\n codecPresence(source.search[key]) === \"optional\"\n ) {\n throw new TypeError(`Redirect cannot guarantee required search: ${key}`);\n }\n }\n\n searchSnapshot = { mode: search.mode };\n } else {\n throw new TypeError(\"Invalid redirect search policy\");\n }\n\n const fragment = ownRecord(redirect.fragment, \"Redirect fragment\");\n\n if (fragment.mode === \"replace\") {\n checkKeys(fragment, new Set([\"mode\", \"value\"]), \"redirect fragment\");\n\n if (typeof fragment.value !== \"string\" || !target.fragments.includes(fragment.value)) {\n throw new TypeError(\"Redirect fragment must belong to target declaration\");\n }\n } else if (fragment.mode === \"preserve\" || fragment.mode === \"drop\") {\n checkKeys(fragment, new Set([\"mode\"]), \"redirect fragment\");\n } else {\n throw new TypeError(\"Invalid redirect fragment policy\");\n }\n\n return Object.freeze({\n to: redirect.to,\n params: Object.freeze(mapping),\n search: Object.freeze(searchSnapshot),\n fragment: Object.freeze({ ...fragment }),\n });\n}\n\nexport function validateSearchValues(\n codecs: Readonly<Record<string, ParamCodec<any>>>,\n values: Record<string, unknown>,\n): void {\n checkKeys(values, new Set(Object.keys(codecs)), \"search values\");\n\n for (const key of Object.keys(codecs)) {\n if (codecPresence(codecs[key]) !== \"optional\" && !has(values, key)) {\n throw new TypeError(`Missing required search: ${key}`);\n }\n }\n}\n\n/**\n * Declares a nominal typed route without executing codecs or native callbacks.\n *\n * @remarks\n * Paths are decoded authored text, not URLs: use `\"\"` for root/pathless nodes,\n * `$name` for a scalar segment and terminal `$name[]` for a zero-or-more\n * catchall. Repeated local scalar names reuse one value. Leading/trailing or\n * repeated slashes, dot segments and Angular `:name`/wildcard notation are invalid.\n *\n * Parents compose effective params/search transitively, including through\n * pathless nodes. Children cannot redeclare ancestor-owned keys or have a\n * catchall parent. Fragment names belong only to this declaration.\n * The route and copied containers are shallow-frozen; application codecs,\n * callbacks, providers and opaque values retain identity and are not deep-frozen.\n *\n * For generation, author a direct default export of this call with a literal\n * path and inline config. Parent and redirect targets must be direct default\n * imports of admitted declarations. Angular owns activation and navigation;\n * declaration alone does not register a route with Angular.\n *\n * @param path - The literal local path, relative to the authored parent.\n * @param config - Local codecs, parent, fragments and supported native behavior.\n * Structural Angular options such as children, component and matcher are\n * generator-owned and cannot be overridden.\n * @returns A frozen route preserving inferred effective input and local data types.\n * @throws TypeError for invalid paths/configuration, missing or extra local\n * codecs, inherited key conflicts, or nongenuine parent/redirect routes.\n *\n * @example\n * ```ts\n * const product = defineRoute(\"products/$productId\", {\n * params: { productId: numberParam },\n * search: { tab: optionalSearchParam(enumParam([\"details\", \"reviews\"])) },\n * fragments: [\"summary\", \"reviews\"],\n * });\n * ```\n */\nexport function defineRoute<\n const Path extends string,\n Parent extends AnyRoute | undefined = undefined,\n Params extends Record<string, PathCodec> = {},\n Search extends CodecMap = {},\n Resolvers extends Record<string, (...args: any[]) => unknown> = {},\n const Fragments extends readonly string[] = [],\n Target extends AnyRoute | undefined = undefined,\n ReplacementKeys extends keyof SearchOf<NoInfer<Target>> = never,\n>(\n path: Path & ValidPath<Path>,\n config: RouteConfig<Path, Parent, Params, Search, Resolvers, Fragments, Target, ReplacementKeys>,\n): Route<\n Path,\n EffectiveParams<Path, Params, Parent>,\n EffectiveSearch<Search, Parent>,\n Resolvers,\n Fragments[number],\n CatchallName<Path> extends never ? false : true\n>;\n\nexport function defineRoute(path: unknown, config: unknown): AnyRoute {\n const supplied = ownRecord(config, \"Route config\");\n\n checkKeys(supplied, configKeys, \"route config\");\n\n const localSegments = parsePath(path);\n let parent: AnyRoute | undefined;\n let inherited: RouteMetadata | undefined;\n\n if (has(supplied, \"parent\")) {\n inherited = routeMetadata(supplied.parent);\n parent = supplied.parent as AnyRoute;\n\n for (const segment of inherited.segments) {\n if (segment.kind === \"catchall\") {\n throw new TypeError(\"Catchall declarations cannot have children\");\n }\n }\n }\n\n const localNames = new Set<string>();\n\n for (const segment of localSegments) {\n if (segment.kind !== \"static\") {\n localNames.add(segment.name);\n }\n }\n\n let localParams: Readonly<Record<string, ParamCodec<any>>> = Object.freeze(Object.create(null));\n\n if (localNames.size === 0) {\n if (has(supplied, \"params\")) {\n throw new TypeError(\"Static paths cannot declare params\");\n }\n } else {\n localParams = copyCodecs(supplied.params, true);\n checkKeys(localParams, localNames, \"local params\");\n\n for (const key of localNames) {\n if (!has(localParams, key)) {\n throw new TypeError(`Missing local codec: ${key}`);\n }\n\n if (inherited && has(inherited.params, key)) {\n throw new TypeError(`Inherited param already owned: ${key}`);\n }\n }\n }\n\n let localSearch: Readonly<Record<string, ParamCodec<any>>> = Object.freeze(Object.create(null));\n\n if (has(supplied, \"search\")) {\n localSearch = copyCodecs(supplied.search, false);\n }\n\n for (const key of Object.keys(localSearch)) {\n if (inherited && has(inherited.search, key)) {\n throw new TypeError(`Inherited search already owned: ${key}`);\n }\n }\n\n const retained: Record<string, unknown> = { ...supplied };\n const result: {\n path: string;\n resolve?: Readonly<Record<PropertyKey, unknown>>;\n runGuardsAndResolvers?: unknown;\n } = { path: path as string };\n\n if (has(supplied, \"resolve\")) {\n const resolve = ownRecord(supplied.resolve, \"Resolvers\", true) as Record<PropertyKey, unknown>;\n const copied: Record<PropertyKey, unknown> = Object.create(null);\n\n for (const key of Reflect.ownKeys(resolve)) {\n if (key === identityKey || typeof resolve[key] !== \"function\") {\n throw new TypeError(`Invalid resolver: ${String(key)}`);\n }\n\n copied[key] = resolve[key];\n }\n\n result.resolve = Object.freeze(copied);\n retained.resolve = result.resolve;\n }\n\n if (has(supplied, \"runGuardsAndResolvers\")) {\n const policy = supplied.runGuardsAndResolvers;\n\n if (typeof policy !== \"function\" && (typeof policy !== \"string\" || !policies.has(policy))) {\n throw new TypeError(\"Invalid native rerun policy\");\n }\n\n result.runGuardsAndResolvers = policy;\n }\n\n for (const key of [\"canActivate\", \"canActivateChild\", \"canMatch\", \"canDeactivate\", \"providers\"]) {\n if (!has(supplied, key)) {\n continue;\n }\n\n const list = supplied[key];\n\n if (!Array.isArray(list)) {\n throw new TypeError(`${key} must be an array`);\n }\n\n if (key === \"canActivate\" || key === \"canActivateChild\" || key === \"canMatch\") {\n for (const callback of list) {\n if (typeof callback !== \"function\") {\n throw new TypeError(`${key} entries must be callbacks`);\n }\n }\n } else if (key === \"canDeactivate\") {\n for (const guard of list) {\n if (\n guard === null ||\n (typeof guard !== \"function\" && typeof guard !== \"object\" && typeof guard !== \"string\")\n ) {\n throw new TypeError(\"canDeactivate entries must be native callbacks or tokens\");\n }\n }\n }\n\n retained[key] = Object.freeze([...list]);\n }\n\n if (\n has(supplied, \"title\") &&\n typeof supplied.title !== \"string\" &&\n typeof supplied.title !== \"function\"\n ) {\n throw new TypeError(\"Invalid native title\");\n }\n\n if (has(supplied, \"data\")) {\n const data = ownRecord(supplied.data, \"Static data\", true);\n\n if (has(data, identityKey)) {\n throw new TypeError(\"Static data cannot set generated identity\");\n }\n\n retained.data = Object.freeze({ ...data });\n }\n\n const fragments: string[] = [];\n\n if (has(supplied, \"fragments\")) {\n if (!Array.isArray(supplied.fragments)) {\n throw new TypeError(\"Fragments must be a string list\");\n }\n\n for (const name of supplied.fragments) {\n if (typeof name !== \"string\") {\n throw new TypeError(\"Fragment names must be strings\");\n }\n\n fragments.push(name);\n }\n }\n\n retained.fragments = Object.freeze(fragments);\n retained.params = localParams;\n retained.search = localSearch;\n\n const metadata: RouteMetadata = {\n parent,\n localSegments,\n segments: Object.freeze([...(inherited?.segments ?? []), ...localSegments]),\n localParams,\n localSearch,\n params: Object.freeze({ ...inherited?.params, ...localParams }),\n search: Object.freeze({ ...inherited?.search, ...localSearch }),\n fragments: retained.fragments as readonly string[],\n config: retained,\n };\n\n if (has(supplied, \"redirect\")) {\n if (has(supplied, \"canActivate\") || has(supplied, \"canMatch\")) {\n throw new TypeError(\"Redirect cannot declare own canActivate or canMatch\");\n }\n\n retained.redirect = snapshotRedirect(supplied.redirect, metadata);\n }\n\n Object.freeze(retained);\n routes.set(result, Object.freeze(metadata));\n\n return Object.freeze(result) as AnyRoute;\n}\n","import { codecPresence, type ParamCodec } from \"./codecs.js\";\nimport { ownRecord, checkKeys, has } from \"./records.js\";\nimport { routeMetadata, validateSearchValues } from \"./route.js\";\nimport type { AnyRoute, SearchOf, UrlValues } from \"./types.js\";\n\nfunction encode(value: string): string {\n return encodeURIComponent(value).replaceAll(\"(\", \"%28\").replaceAll(\")\", \"%29\");\n}\n\nfunction stringify(codec: ParamCodec<any>, value: unknown, path: boolean): string {\n const text = codec.stringify(value);\n\n if (typeof text !== \"string\") {\n throw new TypeError(\"Codec stringify must return a string\");\n }\n\n if (path && (text === \"\" || text === \".\" || text === \"..\")) {\n throw new TypeError(\"Path output cannot be empty, dot or dotdot\");\n }\n\n return encode(text);\n}\n\n/**\n * Synchronously serializes a route's explicit values into a root-relative URL.\n *\n * @remarks\n * Includes inherited path/search declarations, but only this route's fragment\n * names. Every effective path value and required search key must be supplied.\n * Optional-only search may be omitted; searchless/paramless routes forbid those\n * records. Catchalls require readonly arrays, including a valid empty array.\n * Values are never taken from a current navigation.\n *\n * Stringifies without calling parsers, guards, resolvers or redirects. Static\n * segments and logical values are component-encoded (also escaping parentheses),\n * so a dynamic slash becomes `%2F`. Search keys are globally sorted; optional\n * `undefined` values are omitted. An empty effective path produces `/`.\n * Redirect declarations serialize their source URL, not their redirect target.\n *\n * @param route - A genuine declaration from this physical package instance,\n * not a generated destination, spread/copy or structural lookalike.\n * @param values - Explicit destination-typed params, search and optional fragment.\n * Pass an empty object when the route needs no values.\n * @returns A root-relative URL string; this does not navigate or return a UrlTree.\n * @throws TypeError for invalid routes/records, missing or unknown keys,\n * undeclared fragments, nonarray catchalls, nonstring codec output, or empty/dot\n * path output. Application stringifier failures propagate unchanged.\n * @throws URIError for ill-formed Unicode in a serialized value.\n *\n * @example\n * ```ts\n * const product = defineRoute(\"products/$productId\", {\n * params: { productId: numberParam },\n * fragments: [\"summary\"],\n * });\n * createUrl(product, { params: { productId: 42 }, fragment: \"summary\" });\n * // /products/42#summary\n * ```\n */\nexport function createUrl<\n Target extends AnyRoute,\n SearchKeys extends keyof SearchOf<NoInfer<Target>> = never,\n>(route: Target, values: UrlValues<NoInfer<Target>, SearchKeys>): string;\n\nexport function createUrl(route: unknown, values: unknown): string {\n const metadata = routeMetadata(route);\n const options = ownRecord(values, \"URL options\");\n\n checkKeys(options, new Set([\"params\", \"search\", \"fragment\"]), \"URL options\");\n\n const paramKeys = Object.keys(metadata.params);\n let params: Record<string, unknown> = Object.create(null);\n\n if (paramKeys.length === 0) {\n if (has(options, \"params\")) {\n throw new TypeError(\"Route has no path params\");\n }\n } else {\n params = ownRecord(options.params, \"Path values\");\n checkKeys(params, new Set(paramKeys), \"path values\");\n\n for (const key of paramKeys) {\n if (!has(params, key)) {\n throw new TypeError(`Missing path value: ${key}`);\n }\n }\n }\n\n const searchKeys = Object.keys(metadata.search).sort();\n let search: Record<string, unknown> = Object.create(null);\n\n if (searchKeys.length === 0) {\n if (has(options, \"search\")) {\n throw new TypeError(\"Route has no search declarations\");\n }\n } else {\n if (has(options, \"search\")) {\n search = ownRecord(options.search, \"Search values\");\n }\n\n validateSearchValues(metadata.search, search);\n }\n\n if (has(options, \"fragment\")) {\n if (typeof options.fragment !== \"string\" || !metadata.fragments.includes(options.fragment)) {\n throw new TypeError(\"Fragment must belong to this declaration\");\n }\n }\n\n // Check all cardinalities before invoking application stringifiers.\n for (const segment of metadata.segments) {\n if (segment.kind === \"catchall\" && !Array.isArray(params[segment.name])) {\n throw new TypeError(`Catchall requires an array: ${segment.name}`);\n }\n }\n\n const parts: string[] = [];\n\n for (const segment of metadata.segments) {\n if (segment.kind === \"static\") {\n parts.push(encode(segment.text));\n } else if (segment.kind === \"scalar\") {\n parts.push(stringify(metadata.params[segment.name], params[segment.name], true));\n } else {\n for (const value of params[segment.name] as readonly unknown[]) {\n parts.push(stringify(metadata.params[segment.name], value, true));\n }\n }\n }\n\n let url = `/${parts.join(\"/\")}`;\n const query: string[] = [];\n\n for (const key of searchKeys) {\n const codec = metadata.search[key];\n const optional = codecPresence(codec) === \"optional\";\n\n if (optional && !has(search, key)) {\n continue;\n }\n\n const value = search[key];\n\n if (optional && value === undefined) {\n continue;\n }\n\n query.push(`${encode(key)}=${stringify(codec, value, false)}`);\n }\n\n if (query.length > 0) {\n url += `?${query.join(\"&\")}`;\n }\n\n if (has(options, \"fragment\")) {\n url += `#${encode(options.fragment as string)}`;\n }\n\n return url;\n}\n"],"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