{"version":3,"file":"index.cjs","names":["z","z","stringSchema","z","stringArgsSchema","z","z","stringSchema","z","stringArgsSchema","numberSchema","z","numberArgsSchema","numberRangeArgsSchema","z","arraySchema","z","getByPath","objectSchema","z","stringArgsSchema","generalConditionsRegistry","stringConditionsRegistry","emailConditionsRegistry","phoneConditionsRegistry","addressConditionsRegistry","dateConditionsRegistry","numberConditionsRegistry","arrayConditionsRegistry","objectConditionsRegistry","z","formatGeneratorsRegistry","dateGeneratorsRegistry","z","z","numberArgsSchema","z","z","z","stringTransformersRegistry","numberTransformersRegistry","arrayTransformersRegistry","objectTransformersRegistry","dateTransformersRegistry"],"sources":["../../../forge-core/src/authoring/types/enums.ts","../../../forge-core/src/components/typeguards.ts","../../../forge-core/src/authoring/builders/utils/captureCallsite.ts","../../../forge-core/src/authoring/builders/utils/splitKey.ts","../../../forge-core/src/authoring/builders/IterableBuilder.ts","../../../forge-core/src/authoring/builders/ExpressionBuilder.ts","../../../forge-core/src/authoring/builders/ReferenceBuilder.ts","../../../forge-core/src/authoring/builders/ScopedReferenceBuilder.ts","../../../forge-core/src/authoring/builders/LoopReferenceBuilder.ts","../../../forge-core/src/authoring/builders/references.ts","../../../forge-core/src/shared/diagnostics/formatCallsite.ts","../../../forge-core/src/engine/errors/DiagnosticErrorFormatter.ts","../../../forge-core/src/engine/errors/ForgeBaseError.ts","../../../forge-core/src/engine/errors/ForgeAuthoringError.ts","../../../forge-core/src/shared/diagnostics/DSLPathFormatter.ts","../../../forge-core/src/shared/diagnostics/DSLSourceLocator.ts","../../../forge-core/src/authoring/builders/utils/finaliseBuilders.ts","../../../forge-core/src/authoring/builders/structures.ts","../../../forge-core/src/authoring/builders/hooks.ts","../../../forge-core/src/engine/errors/ForgeRegistryDuplicateError.ts","../../../forge-core/src/authoring/builders/GeneratorBuilder.ts","../../../forge-core/src/authoring/registries/BaseFunctionRegistry.ts","../../../forge-core/src/authoring/registries/GeneratorRegistry.ts","../../../forge-core/src/built-ins/functions/generators/formatGenerators.ts","../../../forge-core/src/authoring/builders/values.ts","../../../forge-core/src/authoring/builders/ConditionalExprBuilder.ts","../../../forge-core/src/authoring/builders/MatchExprBuilder.ts","../../../forge-core/src/authoring/builders/combinators.ts","../../../forge-core/src/authoring/builders/iterators.ts","../../../forge-core/src/authoring/registries/ConditionRegistry.ts","../../../forge-core/src/built-ins/functions/conditions/generalConditions.ts","../../../forge-core/src/built-ins/functions/conditions/stringConditions.ts","../../../forge-core/src/built-ins/functions/conditions/addressConditions.ts","../../../forge-core/src/built-ins/functions/conditions/emailConditions.ts","../../../forge-core/src/built-ins/functions/conditions/dateConditions.ts","../../../forge-core/src/built-ins/functions/conditions/numberConditions.ts","../../../forge-core/src/built-ins/functions/conditions/phoneConditions.ts","../../../forge-core/src/built-ins/functions/conditions/arrayConditions.ts","../../../forge-core/src/built-ins/functions/conditions/objectConditions.ts","../../../forge-core/src/built-ins/functions/conditions/index.ts","../../../forge-core/src/built-ins/functions/generators/dateGenerators.ts","../../../forge-core/src/built-ins/functions/generators/index.ts","../../../forge-core/src/authoring/registries/TransformerRegistry.ts","../../../forge-core/src/built-ins/functions/transformers/arrayTransformers.ts","../../../forge-core/src/built-ins/functions/transformers/dateTransformers.ts","../../../forge-core/src/built-ins/functions/transformers/numberTransformers.ts","../../../forge-core/src/built-ins/functions/transformers/objectTransformers.ts","../../../forge-core/src/built-ins/sanitize.ts","../../../forge-core/src/built-ins/functions/transformers/stringTransformers.ts","../../../forge-core/src/built-ins/functions/transformers/index.ts","../../../forge-core/src/authoring/registries/EffectRegistry.ts","../../../forge-core/src/authoring/utils/deprecated/createFunctionsRegistry.ts","../../../forge-core/src/shared/ForgeDeprecations.ts","../../../forge-core/src/authoring/utils/deprecated/defineFunction.ts","../../../forge-core/src/authoring/utils/deprecated/defineConditionFunctions.ts","../../../forge-core/src/authoring/utils/deprecated/defineEffectFunctions.ts","../../../forge-core/src/authoring/utils/deprecated/defineGeneratorFunctions.ts","../../../forge-core/src/authoring/utils/deprecated/defineTransformerFunctions.ts","../../../forge-core/src/authoring/utils/deprecated/createFunctionScope.ts","../../../forge-core/src/engine/chassis/runtime/context/EffectFunctionContext.ts"],"sourcesContent":["/**\n * Discriminates the four kinds of registered function a call expression can\n * target: conditions test values, transformers reshape them, generators\n * produce them, and effects perform side effects in hooks.\n */\nexport enum FunctionType {\n  CONDITION = 'FunctionType.Condition',\n  TRANSFORMER = 'FunctionType.Transformer',\n  GENERATOR = 'FunctionType.Generator',\n  EFFECT = 'FunctionType.Effect',\n}\n\n/**\n * Discriminates the structural nodes a form is built from: journeys contain\n * steps, steps contain blocks.\n */\nexport enum StructureType {\n  BLOCK = 'StructureType.Block',\n  JOURNEY = 'StructureType.Journey',\n  STEP = 'StructureType.Step',\n}\n\n/**\n * Distinguishes field blocks, which collect answers, from basic blocks,\n * which only display content.\n */\nexport enum BlockType {\n  FIELD = 'BlockType.field',\n  BASIC = 'BlockType.basic',\n}\n\n/**\n * Discriminates expression nodes: value expressions such as references,\n * pipelines, conditionals, and iterations, plus rule nodes such as\n * validations and tie-breakers.\n */\nexport enum ExpressionType {\n  REFERENCE = 'ExpressionType.Reference',\n  PIPELINE = 'ExpressionType.Pipeline',\n  NULLISH = 'ExpressionType.Nullish',\n  NEXT = 'ExpressionType.Next',\n  VALIDATION = 'ExpressionType.Validation',\n  ITERATE = 'ExpressionType.Iterate',\n  CONDITIONAL = 'ExpressionType.Conditional',\n  MATCH = 'ExpressionType.Match',\n  TIE_BREAKER = 'ExpressionType.TieBreaker',\n}\n\n/**\n * Discriminates the per-item operations an iterate expression can apply to\n * a collection.\n */\nexport enum IteratorType {\n  MAP = 'IteratorType.Map',\n  FILTER = 'IteratorType.Filter',\n  FIND = 'IteratorType.Find',\n  SOME = 'IteratorType.Some',\n  EVERY = 'IteratorType.Every',\n  COUNT = 'IteratorType.Count',\n}\n\n/**\n * Discriminates predicate nodes: a single condition test, or a logical\n * combination of other predicates.\n */\nexport enum PredicateType {\n  TEST = 'PredicateType.Test',\n  AND = 'PredicateType.And',\n  OR = 'PredicateType.Or',\n  XOR = 'PredicateType.Xor',\n  NOT = 'PredicateType.Not',\n}\n\n/**\n * Discriminates the logical combinations of a subject-less condition\n * combinator tree, as used by match branches. Unlike PredicateType, whose\n * TEST leaves carry their own subject, these trees combine bare conditions\n * and take their subject from the surrounding match expression.\n */\nexport enum ConditionCombinatorType {\n  AND = 'ConditionCombinatorType.And',\n  OR = 'ConditionCombinatorType.Or',\n  XOR = 'ConditionCombinatorType.Xor',\n  NOT = 'ConditionCombinatorType.Not',\n}\n\n/**\n * Discriminates lifecycle hooks: access hooks run on every request, submit\n * hooks run on form submission.\n */\nexport enum HookType {\n  ACCESS = 'HookType.Access',\n  SUBMIT = 'HookType.Submit',\n}\n\n/**\n * Discriminates the outcomes a hook can halt with: a redirect or a thrown\n * error.\n */\nexport enum OutcomeType {\n  REDIRECT = 'Outcome.Redirect',\n  THROW_ERROR = 'Outcome.ThrowError',\n}\n","import { BlockDefinition, FieldBlockDefinition, RenderedBlock } from './types/structures.type'\nimport { BlockType, StructureType } from '../authoring/types/enums'\n\nfunction isBlockDefinition(obj: any): obj is BlockDefinition {\n  return obj != null && obj.type === StructureType.BLOCK\n}\n\nexport function isFieldBlockDefinition(obj: any): obj is FieldBlockDefinition {\n  return isBlockDefinition(obj) && obj.blockType === BlockType.FIELD\n}\n\nexport function isRenderedBlock(obj: unknown): obj is RenderedBlock {\n  return obj != null &&\n    typeof obj === 'object' &&\n    'html' in obj &&\n    typeof obj.html === 'string' &&\n    'block' in obj &&\n    isBlockDefinition(obj.block)\n}\n","export interface Callsite {\n  readonly stack?: string\n}\n\n/**\n * Captures the caller's stack without formatting it: V8 defines `.stack` as a\n * lazy accessor, so the (expensive) trace formatting only happens if something\n * actually reads it. Do not read `.stack` here.\n *\n * @param skip - Frames above this function are kept; it and everything below are dropped\n */\nexport const captureCallsite = (skip: (...args: any[]) => unknown): Callsite => {\n  if (typeof Error.captureStackTrace !== 'function') {\n    return {}\n  }\n\n  const site: Callsite = {}\n  const previousLimit = Error.stackTraceLimit\n\n  // Deep enough that wrapper DSL layers (curried builders, native Array.map\n  // frames) cannot eat the whole budget before the author's own frame lands.\n  Error.stackTraceLimit = 15\n  try {\n    Error.captureStackTrace(site, skip)\n  } finally {\n    Error.stackTraceLimit = previousLimit\n  }\n\n  return site\n}\n\n/**\n * Attaches a captured callsite to an object as a non-enumerable `__callsite`.\n * configurable + writable so finalisation walks can re-stamp copies.\n */\nexport const stampCallsite = (target: unknown, callsite: Callsite): void => {\n  if (target === null || typeof target !== 'object' || !('stack' in callsite)) {\n    return\n  }\n\n  Object.defineProperty(target, '__callsite', {\n    value: callsite,\n    enumerable: false,\n    configurable: true,\n    writable: true,\n  })\n}\n","/**\n * Split a key string into path segments.\n * 'user.name' -> ['user', 'name']\n * 'simple' -> ['simple']\n */\nexport const splitKey = (key: string): string[] => (key.includes('.') ? key.split('.') : [key])\n","import {\n  ConditionFunctionExpr,\n  FilterIteratorConfig,\n  FindIteratorConfig,\n  IterateExpr,\n  IteratorConfig,\n  SomeIteratorConfig,\n  EveryIteratorConfig,\n  CountIteratorConfig,\n  CollectionPredicateExpr,\n  NullishExpr,\n  MapIteratorConfig,\n  PipelineExpr,\n  PredicateTestExpr,\n  ReferenceExpr,\n  TransformerFunctionExpr,\n  ResolvableValue,\n} from '../types/expressions.type'\nimport { ExpressionType, IteratorType, PredicateType } from '../types/enums'\nimport { ExpressionBuilder } from './ExpressionBuilder'\nimport { captureCallsite, stampCallsite } from './utils/captureCallsite'\nimport { splitKey } from './utils/splitKey'\n\n/**\n * Immutable builder for chainable iterate expressions.\n *\n * Created by .each() on ReferenceBuilder or ExpressionBuilder.\n * Supports chaining: .each().each().pipe()\n *\n * Enables fluent API patterns like:\n * - Data('items').each(Iterator.Map({ ... }))\n * - Data('items').each(Iterator.Filter(...)).each(Iterator.Map(...))\n * - Data('items').each(Iterator.Map({ ... })).pipe(Transformer.Array.Slice(0, 10))\n *\n * Key design decisions:\n * - Immutable: Each method returns a NEW instance\n * - Chainable: Multiple .each() calls compose iterators\n * - Escapable: .pipe() exits iteration mode to operate on the result array\n *\n * @internal Exposed to authors via the ChainableIterable interface.\n */\nexport class IterableBuilder {\n  readonly nodeKind = 'forge-builder' as const\n\n  private readonly expression: IterateExpr\n\n  private readonly negated: boolean\n\n  private constructor(expr: IterateExpr, negate: boolean) {\n    this.expression = expr\n    this.negated = negate\n  }\n\n  /**\n   * Create an iterable builder from a source and iterator.\n   */\n  static create(input: ResolvableValue, iterator: IteratorConfig): IterableBuilder {\n    return new IterableBuilder(\n      {\n        type: ExpressionType.ITERATE,\n        input,\n        iterator,\n      },\n      false,\n    )\n  }\n\n  /**\n   * Get the underlying expression.\n   */\n  get expr(): IterateExpr {\n    return this.expression\n  }\n\n  /**\n   * Build the final expression.\n   * Called automatically by finaliseBuilders().\n   */\n  build(): IterateExpr {\n    return this.expression\n  }\n\n  /**\n   * Chain a Find iterator.\n   * Returns an ExpressionBuilder since Find returns a single item, not an array.\n   *\n   * @example\n   * Data('items')\n   *   .each(Iterator.Filter(...))\n   *   .each(Iterator.Find(...))\n   *   .path('name')  // Navigate into the found item\n   */\n  each(iterator: FindIteratorConfig): ExpressionBuilder<ReferenceExpr>\n\n  /** Test the collection directly as a predicate. */\n  each(iterator: SomeIteratorConfig | EveryIteratorConfig): CollectionPredicateExpr\n\n  /** Count matching items and continue with the resulting number. */\n  each(iterator: CountIteratorConfig): ExpressionBuilder<IterateExpr>\n\n  /**\n   * Chain a Map or Filter iterator.\n   * Returns an IterableBuilder that can chain more .each() calls.\n   *\n   * @example\n   * Data('items')\n   *   .each(Iterator.Filter(Item().path('active').match(Condition.IsTrue())))\n   *   .each(Iterator.Map({ label: Item().path('name') }))\n   */\n  each(iterator: MapIteratorConfig | FilterIteratorConfig): IterableBuilder\n\n  /**\n   * Chain another iterator operation.\n   */\n  each(\n    iterator: IteratorConfig,\n  ): IterableBuilder | ExpressionBuilder<ReferenceExpr> | ExpressionBuilder<IterateExpr> | CollectionPredicateExpr {\n    if (iterator.type === IteratorType.COUNT) {\n      const expression: IterateExpr = { type: ExpressionType.ITERATE, input: this.expression, iterator }\n      const builder = ExpressionBuilder.from(expression)\n\n      stampCallsite(builder, captureCallsite(this.each))\n\n      return builder\n    }\n\n    if (iterator.type === IteratorType.SOME || iterator.type === IteratorType.EVERY) {\n      const predicate: CollectionPredicateExpr = { type: ExpressionType.ITERATE, input: this.expression, iterator }\n\n      stampCallsite(predicate, captureCallsite(this.each))\n\n      return predicate\n    }\n\n    if (iterator.type === IteratorType.FIND) {\n      // Find returns a single item - wrap in a reference with empty path\n      // so .path() works naturally\n      const iterateExpr: IterateExpr = {\n        type: ExpressionType.ITERATE,\n        input: this.expression,\n        iterator,\n      }\n      const referenceExpr: ReferenceExpr = {\n        type: ExpressionType.REFERENCE,\n        base: iterateExpr,\n        path: [],\n      }\n\n      return ExpressionBuilder.from(referenceExpr)\n    }\n\n    return IterableBuilder.create(this.expression, iterator)\n  }\n\n  /**\n   * Transform the output array through a pipeline.\n   * Exits iteration mode - operates on the whole result array.\n   *\n   * @example\n   * Data('items')\n   *   .each(Iterator.Map(Item().path('name')))\n   *   .pipe(Transformer.Array.Slice(0, 10))\n   */\n  pipe(...steps: TransformerFunctionExpr[]): ExpressionBuilder<PipelineExpr> {\n    return ExpressionBuilder.pipeline(this.expression, steps)\n  }\n\n  /** Uses the fallback only when the value is null or undefined, like `??`. */\n  nullish(fallback: ResolvableValue | undefined): ExpressionBuilder<NullishExpr> {\n    const expression: NullishExpr = {\n      type: ExpressionType.NULLISH,\n      input: this.expression,\n      ...(fallback !== undefined && { fallback }),\n    }\n    const builder = ExpressionBuilder.from(expression)\n\n    stampCallsite(builder, captureCallsite(this.nullish))\n\n    return builder\n  }\n\n  /**\n   * Navigate into a property of the iteration result.\n   * Useful after Iterator.Find() to extract a specific property from the found item.\n   *\n   * Creates a ReferenceExpr with the iterate expression as its base,\n   * which evaluates the iteration first and then navigates into the result.\n   *\n   * @param key - Property path to navigate into (supports dot notation)\n   * @returns ExpressionBuilder wrapping a ReferenceExpr\n   *\n   * @example\n   * // Find an item and get its 'goals' property\n   * Literal(areasOfNeed)\n   *   .each(Iterator.Find(Item().path('slug').match(Condition.Equals(Params('area')))))\n   *   .path('goals')\n   *\n   * @example\n   * // Nested path navigation\n   * Data('users')\n   *   .each(Iterator.Find(...))\n   *   .path('profile.settings')\n   */\n  path(key: string): ExpressionBuilder<ReferenceExpr> {\n    const referenceExpr: ReferenceExpr = {\n      type: ExpressionType.REFERENCE,\n      base: this.expression,\n      path: splitKey(key),\n    }\n\n    return ExpressionBuilder.from(referenceExpr)\n  }\n\n  /**\n   * Test the output array against a condition.\n   * Terminal operation - returns a plain PredicateTestExpr.\n   *\n   * @example\n   * Data('items')\n   *   .each(Iterator.Filter(...))\n   *   .match(Condition.Array.IsEmpty())\n   */\n  match(condition: ConditionFunctionExpr<any>): PredicateTestExpr {\n    const predicate: PredicateTestExpr = {\n      type: PredicateType.TEST,\n      subject: this.expression,\n      negate: this.negated,\n      condition,\n    }\n\n    stampCallsite(predicate, captureCallsite(this.match))\n\n    return predicate\n  }\n\n  /**\n   * Negate the next condition test.\n   * Returns a new builder with toggled negation.\n   *\n   * @example\n   * Data('items')\n   *   .each(Iterator.Filter(...))\n   *   .not.match(Condition.Array.IsEmpty())\n   */\n  get not(): IterableBuilder {\n    return new IterableBuilder(this.expression, !this.negated)\n  }\n}\n","import {\n  ConditionFunctionExpr,\n  FilterIteratorConfig,\n  FindIteratorConfig,\n  IteratorConfig,\n  SomeIteratorConfig,\n  EveryIteratorConfig,\n  CountIteratorConfig,\n  CollectionPredicateExpr,\n  NullishExpr,\n  IterateExpr,\n  MapIteratorConfig,\n  PipelineExpr,\n  PredicateTestExpr,\n  ReferenceExpr,\n  TransformerFunctionExpr,\n  ResolvableValue,\n} from '../types/expressions.type'\nimport { ExpressionType, IteratorType, PredicateType } from '../types/enums'\nimport { IterableBuilder } from './IterableBuilder'\nimport { captureCallsite, stampCallsite } from './utils/captureCallsite'\nimport { splitKey } from './utils/splitKey'\n\n/**\n * Immutable builder for creating chainable value expressions.\n *\n * Enables fluent API patterns like:\n * - Answer('email').pipe(Transformer.String.Trim).match(Condition.IsRequired())\n * - Self().not.match(Condition.String.IsEmpty())\n * - Answer('quantity').pipe(Transformer.Number.Parse).not.match(Condition.Number.LessThan(0))\n *\n * Key design decisions:\n * - Immutable: Each method returns a NEW instance\n * - Type-safe: Full TypeScript inference throughout chains\n * - Buildable: Implements build() for automatic finalization via finaliseBuilders()\n *\n * @internal Exposed to authors via the ChainableExpr interface.\n */\nexport class ExpressionBuilder<T extends ResolvableValue> {\n  readonly nodeKind = 'forge-builder' as const\n\n  private readonly expression: T\n\n  private readonly negate: boolean\n\n  private constructor(expr: T, negate: boolean) {\n    this.expression = expr\n    this.negate = negate\n  }\n\n  /**\n   * Create a builder from any value expression.\n   */\n  static from<E extends ResolvableValue>(expr: E): ExpressionBuilder<E> {\n    return new ExpressionBuilder(expr, false)\n  }\n\n  /**\n   * Create a builder wrapping a pipeline expression.\n   */\n  static pipeline(input: ResolvableValue, steps: TransformerFunctionExpr[]): ExpressionBuilder<PipelineExpr> {\n    return new ExpressionBuilder(\n      {\n        type: ExpressionType.PIPELINE,\n        input,\n        steps,\n      },\n      false,\n    )\n  }\n\n  /**\n   * Get the underlying expression.\n   */\n  get expr(): T {\n    return this.expression\n  }\n\n  /**\n   * Build the final expression.\n   * Called automatically by finaliseBuilders().\n   */\n  build(): T {\n    return this.expression\n  }\n\n  /**\n   * Transform the value through a pipeline of transformers.\n   * Each call creates a nested pipeline (input is the current expression).\n   *\n   * @example\n   * Answer('email').pipe(\n   *   Transformer.String.Trim,\n   *   Transformer.String.ToLowerCase,\n   * )\n   */\n  pipe(...steps: TransformerFunctionExpr[]): ExpressionBuilder<PipelineExpr> {\n    return ExpressionBuilder.pipeline(this.expression, steps)\n  }\n\n  /** Uses the fallback only when the value is null or undefined, like `??`. */\n  nullish(fallback: ResolvableValue | undefined): ExpressionBuilder<NullishExpr> {\n    const expression: NullishExpr = {\n      type: ExpressionType.NULLISH,\n      input: this.expression,\n      ...(fallback !== undefined && { fallback }),\n    }\n    const builder = ExpressionBuilder.from(expression)\n\n    stampCallsite(builder, captureCallsite(this.nullish))\n\n    return builder\n  }\n\n  /**\n   * Navigate into a property of the expression result.\n   * Creates a ReferenceExpr with this expression as its base.\n   *\n   * @param key - Property path to navigate into (supports dot notation)\n   * @returns ExpressionBuilder wrapping a ReferenceExpr\n   *\n   * @example\n   * // After a Find, navigate into the result\n   * Data('users').each(Iterator.Find(...)).path('profile.name')\n   */\n  path(key: string): ExpressionBuilder<ReferenceExpr> {\n    const referenceExpr: ReferenceExpr = {\n      type: ExpressionType.REFERENCE,\n      base: this.expression,\n      path: splitKey(key),\n    }\n\n    return ExpressionBuilder.from(referenceExpr)\n  }\n\n  /**\n   * Enter per-item iteration mode with a Find iterator.\n   * Returns an ExpressionBuilder since Find returns a single item, not an array.\n   *\n   * @example\n   * Data('users').each(Iterator.Find(Item().path('id').match(Condition.Equals(Params('userId')))))\n   *   .path('name')  // Navigate into the found item\n   */\n  each(iterator: FindIteratorConfig): ExpressionBuilder<ReferenceExpr>\n\n  /** Test the collection directly as a predicate. */\n  each(iterator: SomeIteratorConfig | EveryIteratorConfig): CollectionPredicateExpr\n\n  /** Count matching items and continue with the resulting number. */\n  each(iterator: CountIteratorConfig): ExpressionBuilder<IterateExpr>\n\n  /**\n   * Enter per-item iteration mode with a Map or Filter iterator.\n   * Returns an IterableBuilder that can chain more .each() calls or exit via .pipe().\n   *\n   * @example\n   * Literal(someArray).each(Iterator.Map(Item().path('name')))\n   */\n  each(iterator: MapIteratorConfig | FilterIteratorConfig): IterableBuilder\n\n  /**\n   * Enter per-item iteration mode with an iterator.\n   */\n  each(\n    iterator: IteratorConfig,\n  ): IterableBuilder | ExpressionBuilder<ReferenceExpr> | ExpressionBuilder<IterateExpr> | CollectionPredicateExpr {\n    if (iterator.type === IteratorType.COUNT) {\n      const expression: IterateExpr = { type: ExpressionType.ITERATE, input: this.expression, iterator }\n      const builder = ExpressionBuilder.from(expression)\n\n      stampCallsite(builder, captureCallsite(this.each))\n\n      return builder\n    }\n\n    if (iterator.type === IteratorType.SOME || iterator.type === IteratorType.EVERY) {\n      const predicate: CollectionPredicateExpr = { type: ExpressionType.ITERATE, input: this.expression, iterator }\n\n      stampCallsite(predicate, captureCallsite(this.each))\n\n      return predicate\n    }\n\n    if (iterator.type === IteratorType.FIND) {\n      // Find returns a single item - wrap in a reference with empty path\n      // so .path() works naturally\n      const iterateExpr = {\n        type: ExpressionType.ITERATE as const,\n        input: this.expression,\n        iterator,\n      }\n      const referenceExpr: ReferenceExpr = {\n        type: ExpressionType.REFERENCE,\n        base: iterateExpr,\n        path: [],\n      }\n\n      return ExpressionBuilder.from(referenceExpr)\n    }\n\n    return IterableBuilder.create(this.expression, iterator)\n  }\n\n  /**\n   * Test the value against a condition.\n   * Terminal operation - returns a plain PredicateTestExpr.\n   *\n   * @example\n   * Answer('age').match(Condition.Number.GreaterThan(18))\n   * Self().not.match(Condition.IsRequired())\n   */\n  match(condition: ConditionFunctionExpr<any>): PredicateTestExpr {\n    const predicate: PredicateTestExpr = {\n      type: PredicateType.TEST,\n      subject: this.expression,\n      negate: this.negate,\n      condition,\n    }\n\n    stampCallsite(predicate, captureCallsite(this.match))\n\n    return predicate\n  }\n\n  /**\n   * Negate the next condition test.\n   * Returns a new builder with toggled negation.\n   *\n   * @example\n   * Self().not.match(Condition.IsRequired())  // negate: true\n   * Self().not.not.match(Condition.IsRequired())  // negate: false (double negation)\n   */\n  get not(): ExpressionBuilder<T> {\n    return new ExpressionBuilder(this.expression, !this.negate)\n  }\n}\n","import {\n  ConditionFunctionExpr,\n  FilterIteratorConfig,\n  FindIteratorConfig,\n  IteratorConfig,\n  SomeIteratorConfig,\n  EveryIteratorConfig,\n  CountIteratorConfig,\n  CollectionPredicateExpr,\n  NullishExpr,\n  IterateExpr,\n  ResolvableValue,\n  MapIteratorConfig,\n  PipelineExpr,\n  PredicateTestExpr,\n  ReferenceExpr,\n  TransformerFunctionExpr,\n} from '../types/expressions.type'\nimport { ExpressionType, IteratorType, PredicateType } from '../types/enums'\nimport { ExpressionBuilder } from './ExpressionBuilder'\nimport { IterableBuilder } from './IterableBuilder'\nimport { captureCallsite, stampCallsite } from './utils/captureCallsite'\nimport { splitKey } from './utils/splitKey'\n\n/**\n * Immutable builder for ReferenceExpr with path navigation support.\n *\n * Extends the base expression builder pattern with:\n * - .path(key) for nested property access\n *\n * @example\n * Data('user').path('address.city')  // path: ['data', 'user', 'address', 'city']\n * Answer('email').pipe(Transformer.String.Trim).match(Condition.IsRequired())\n *\n * @internal Exposed to authors via the ChainableRef interface.\n */\nexport class ReferenceBuilder {\n  readonly nodeKind = 'forge-builder' as const\n\n  private readonly reference: ReferenceExpr\n\n  private readonly negated: boolean\n\n  private constructor(ref: ReferenceExpr, negate: boolean) {\n    this.reference = ref\n    this.negated = negate\n  }\n\n  /**\n   * Create a builder from path segments.\n   */\n  static create(path: string[]): ReferenceBuilder {\n    return new ReferenceBuilder(\n      {\n        type: ExpressionType.REFERENCE,\n        path,\n      },\n      false,\n    )\n  }\n\n  /**\n   * Get the underlying reference expression.\n   */\n  get expr(): ReferenceExpr {\n    return this.reference\n  }\n\n  /**\n   * Build the final reference expression.\n   * Called automatically by finaliseBuilders().\n   */\n  build(): ReferenceExpr {\n    return this.reference\n  }\n\n  /**\n   * Navigate to a nested property.\n   * Supports dot notation: .path('user.address.city')\n   *\n   * @example\n   * Data('response').path('data.items')\n   * Answer('user').path('address').path('postcode')\n   */\n  path(key: string): ReferenceBuilder {\n    const newRef: ReferenceExpr = {\n      type: ExpressionType.REFERENCE,\n      path: [...this.reference.path, ...splitKey(key)],\n    }\n\n    return new ReferenceBuilder(newRef, false)\n  }\n\n  /**\n   * Transform through a pipeline of transformers.\n   * Returns an ExpressionBuilder wrapping the PipelineExpr.\n   *\n   * @example\n   * Answer('email').pipe(Transformer.String.Trim, Transformer.String.ToLowerCase)\n   */\n  pipe(...steps: TransformerFunctionExpr[]): ExpressionBuilder<PipelineExpr> {\n    return ExpressionBuilder.pipeline(this.reference, steps)\n  }\n\n  /** Uses the fallback only when the value is null or undefined, like `??`. */\n  nullish(fallback: ResolvableValue | undefined): ExpressionBuilder<NullishExpr> {\n    const expression: NullishExpr = {\n      type: ExpressionType.NULLISH,\n      input: this.reference,\n      ...(fallback !== undefined && { fallback }),\n    }\n    const builder = ExpressionBuilder.from(expression)\n\n    stampCallsite(builder, captureCallsite(this.nullish))\n\n    return builder\n  }\n\n  /**\n   * Enter per-item iteration mode with a Find iterator.\n   * Returns an ExpressionBuilder since Find returns a single item, not an array.\n   *\n   * @example\n   * Data('users').each(Iterator.Find(Item().path('id').match(Condition.Equals(Params('userId')))))\n   *   .path('name')  // Navigate into the found item\n   */\n  each(iterator: FindIteratorConfig): ExpressionBuilder<ReferenceExpr>\n\n  /** Test the collection directly as a predicate. */\n  each(iterator: SomeIteratorConfig | EveryIteratorConfig): CollectionPredicateExpr\n\n  /** Count matching items and continue with the resulting number. */\n  each(iterator: CountIteratorConfig): ExpressionBuilder<IterateExpr>\n\n  /**\n   * Enter per-item iteration mode with a Map or Filter iterator.\n   * Returns an IterableBuilder that can chain more .each() calls or exit via .pipe().\n   *\n   * @example\n   * Data('items').each(Iterator.Map({ label: Item().path('name') }))\n   * Data('items').each(Iterator.Filter(...)).each(Iterator.Map(...))\n   */\n  each(iterator: MapIteratorConfig | FilterIteratorConfig): IterableBuilder\n\n  /**\n   * Enter per-item iteration mode with an iterator.\n   */\n  each(\n    iterator: IteratorConfig,\n  ): IterableBuilder | ExpressionBuilder<ReferenceExpr> | ExpressionBuilder<IterateExpr> | CollectionPredicateExpr {\n    if (iterator.type === IteratorType.COUNT) {\n      const expression: IterateExpr = { type: ExpressionType.ITERATE, input: this.reference, iterator }\n      const builder = ExpressionBuilder.from(expression)\n\n      stampCallsite(builder, captureCallsite(this.each))\n\n      return builder\n    }\n\n    if (iterator.type === IteratorType.SOME || iterator.type === IteratorType.EVERY) {\n      const predicate: CollectionPredicateExpr = { type: ExpressionType.ITERATE, input: this.reference, iterator }\n\n      stampCallsite(predicate, captureCallsite(this.each))\n\n      return predicate\n    }\n\n    if (iterator.type === IteratorType.FIND) {\n      // Find returns a single item - wrap in a reference with empty path\n      // so .path() works naturally\n      const iterateExpr = {\n        type: ExpressionType.ITERATE as const,\n        input: this.reference,\n        iterator,\n      }\n      const referenceExpr: ReferenceExpr = {\n        type: ExpressionType.REFERENCE,\n        base: iterateExpr,\n        path: [],\n      }\n\n      return ExpressionBuilder.from(referenceExpr)\n    }\n\n    return IterableBuilder.create(this.reference, iterator)\n  }\n\n  /**\n   * Test against a condition.\n   * Terminal operation - returns a plain PredicateTestExpr.\n   *\n   * @example\n   * Answer('email').match(Condition.Email.IsValid())\n   * Self().not.match(Condition.IsRequired())\n   */\n  match(condition: ConditionFunctionExpr<any>): PredicateTestExpr {\n    const predicate: PredicateTestExpr = {\n      type: PredicateType.TEST,\n      subject: this.reference,\n      negate: this.negated,\n      condition,\n    }\n\n    stampCallsite(predicate, captureCallsite(this.match))\n\n    return predicate\n  }\n\n  /**\n   * Negate the next condition test.\n   * Returns a new builder with toggled negation.\n   *\n   * @example\n   * Self().not.match(Condition.IsRequired())  // negate: true\n   * Answer('x').not.not.match(...)  // negate: false (double negation)\n   */\n  get not(): ReferenceBuilder {\n    return new ReferenceBuilder(this.reference, !this.negated)\n  }\n}\n","import type { ChainableExpr } from './types'\nimport type { ResolvableValue } from '../types/expressions.type'\nimport { captureCallsite, stampCallsite } from './utils/captureCallsite'\nimport { ReferenceBuilder } from './ReferenceBuilder'\nimport { splitKey } from './utils/splitKey'\n\n/**\n * Immutable builder for creating item references within iterator contexts.\n *\n * Provides methods to navigate hierarchical data structures and access\n * properties of items during iteration. This is primarily used with the\n * Item() reference to access item data in collection blocks.\n *\n * @example\n * // Access a property of the current item\n * Item().path('name')  // -> ['@scope', '0', 'name']\n *\n * // Access the full item value\n * Item().value()  // -> ['@scope', '0']\n *\n * // Navigate to the outer item in nested iterators\n * Item().parent.path('groupId')  // -> ['@scope', '1', 'groupId']\n *\n * // Chain with pipe and match\n * Item().path('price').pipe(Transformer.Number.Parse).match(Condition.Number.GreaterThan(0))\n *\n * @internal Exposed to authors via the ChainableScopedRef interface.\n */\nexport class ScopedReferenceBuilder {\n  readonly nodeKind = 'forge-builder' as const\n\n  private readonly level: number\n\n  private constructor(level: number) {\n    this.level = level\n  }\n\n  /**\n   * Create a scoped reference builder at the specified nesting level.\n   * Level 0 is the current item, level 1 is the parent, etc.\n   */\n  static create(level: number): ScopedReferenceBuilder {\n    return new ScopedReferenceBuilder(level)\n  }\n\n  /**\n   * Navigate to the outer iterator's item in nested iterators.\n   * Returns a new builder at the next item level up.\n   *\n   * @example\n   * Item().parent.path('groupId')  // Access the outer item's groupId\n   * Item().parent.parent.path('orgId')  // Access the next outer item's orgId\n   */\n  get parent(): ScopedReferenceBuilder {\n    return new ScopedReferenceBuilder(this.level + 1)\n  }\n\n  /**\n   * Get a sub-property of the collection item.\n   * Supports dot notation: .path('user.address.city')\n   *\n   * @example\n   * Item().path('name')\n   * Item().path('address.postcode')\n   */\n  path(key: string): ReferenceBuilder {\n    return ReferenceBuilder.create(['@scope', this.level.toString(), ...splitKey(key)])\n  }\n\n  /**\n   * Get the full value of the collection item.\n   *\n   * @example\n   * Item().value()  // Returns the entire item object\n   */\n  value(): ReferenceBuilder {\n    return ReferenceBuilder.create(['@scope', this.level.toString()])\n  }\n\n  /** Uses the fallback only when the whole item is null or undefined. */\n  nullish(fallback: ResolvableValue | undefined): ChainableExpr {\n    const builder = this.value().nullish(fallback)\n\n    stampCallsite(builder, captureCallsite(this.nullish))\n\n    return builder\n  }\n\n  /**\n   * Get the key when iterating over an object.\n   * Only available when iterating over object entries (not arrays).\n   *\n   * @example\n   * // Given: { accommodation: { score: 5 }, finances: { score: 3 } }\n   * Data('scores').each(Iterator.Map({\n   *   slug: Item().key(),     // 'accommodation', 'finances'\n   *   score: Item().path('score')  // 5, 3\n   * }))\n   */\n  key(): ReferenceBuilder {\n    return ReferenceBuilder.create(['@scope', this.level.toString(), '@key'])\n  }\n}\n","import { ReferenceBuilder } from './ReferenceBuilder'\n\n/**\n * Immutable builder for creating references to iterator loop metadata.\n *\n * This mirrors Nunjucks' loop object: Item() references the current item, while\n * Loop references metadata about the current iteration.\n *\n * @internal Exposed to authors via the ChainableLoopRef interface.\n */\nexport class LoopReferenceBuilder {\n  readonly nodeKind = 'forge-builder' as const\n\n  private readonly level: number\n\n  private constructor(level: number) {\n    this.level = level\n  }\n\n  /**\n   * Create a loop reference builder at the specified nesting level.\n   * Level 0 is the current loop, level 1 is the parent loop, etc.\n   */\n  static create(level: number): LoopReferenceBuilder {\n    return new LoopReferenceBuilder(level)\n  }\n\n  /**\n   * Navigate to the parent loop in nested collections.\n   *\n   * @example\n   * Loop.Parent.Index()\n   * Loop.Parent.Parent.Index0()\n   */\n  get Parent(): LoopReferenceBuilder {\n    return new LoopReferenceBuilder(this.level + 1)\n  }\n\n  /**\n   * Get the current iteration position (1-based).\n   *\n   * @example\n   * Loop.Index()  // Returns 1, 2, 3, etc.\n   */\n  Index(): ReferenceBuilder {\n    return ReferenceBuilder.create(['@loop', this.level.toString(), 'index'])\n  }\n\n  /**\n   * Get the current iteration index (0-based).\n   *\n   * @example\n   * Loop.Index0()  // Returns 0, 1, 2, etc.\n   */\n  Index0(): ReferenceBuilder {\n    return ReferenceBuilder.create(['@loop', this.level.toString(), 'index0'])\n  }\n\n  /**\n   * Get the reverse iteration position (1-based).\n   *\n   * @example\n   * Loop.RevIndex()  // Returns length, length - 1, etc.\n   */\n  RevIndex(): ReferenceBuilder {\n    return ReferenceBuilder.create(['@loop', this.level.toString(), 'revindex'])\n  }\n\n  /**\n   * Get the reverse iteration index (0-based).\n   *\n   * @example\n   * Loop.RevIndex0()  // Returns length - 1, length - 2, etc.\n   */\n  RevIndex0(): ReferenceBuilder {\n    return ReferenceBuilder.create(['@loop', this.level.toString(), 'revindex0'])\n  }\n\n  /**\n   * Check whether the current item is the first item in the iteration.\n   *\n   * @example\n   * Loop.First()  // true for the first item\n   */\n  First(): ReferenceBuilder {\n    return ReferenceBuilder.create(['@loop', this.level.toString(), 'first'])\n  }\n\n  /**\n   * Check whether the current item is the last item in the iteration.\n   *\n   * @example\n   * Loop.Last()  // true for the last item\n   */\n  Last(): ReferenceBuilder {\n    return ReferenceBuilder.create(['@loop', this.level.toString(), 'last'])\n  }\n\n  /**\n   * Get the number of items in the iteration.\n   *\n   * @example\n   * Loop.Length()  // Returns the total item count\n   */\n  Length(): ReferenceBuilder {\n    return ReferenceBuilder.create(['@loop', this.level.toString(), 'length'])\n  }\n}\n","import { isFieldBlockDefinition } from '../../components/typeguards'\nimport { ReferenceBuilder } from './ReferenceBuilder'\nimport { ScopedReferenceBuilder } from './ScopedReferenceBuilder'\nimport { LoopReferenceBuilder } from './LoopReferenceBuilder'\nimport { ChainableLoopRef, ChainableRef, ChainableScopedRef } from './types'\nimport { splitKey } from './utils/splitKey'\nimport { captureCallsite, stampCallsite } from './utils/captureCallsite'\nimport { FieldBlockDefinition, ResolvableString } from '../../components/types/structures.type'\n\n/**\n * References POST body data from form submission.\n */\nexport function Post(key: string): ChainableRef {\n  const ref = ReferenceBuilder.create(['post', ...splitKey(key)])\n  stampCallsite(ref, captureCallsite(Post))\n  return ref\n}\n\n/**\n * References URL parameters (e.g., /users/:id).\n */\nexport function Params(key: string): ChainableRef {\n  const ref = ReferenceBuilder.create(['params', ...splitKey(key)])\n  stampCallsite(ref, captureCallsite(Params))\n  return ref\n}\n\n/**\n * References query string parameters (e.g., ?search=test).\n */\nexport function Query(key: string): ChainableRef {\n  const ref = ReferenceBuilder.create(['query', ...splitKey(key)])\n  stampCallsite(ref, captureCallsite(Query))\n  return ref\n}\n\n/**\n * References request metadata from the current request context.\n */\nexport const Request = {\n  Url(): ChainableRef {\n    const ref = ReferenceBuilder.create(['request', 'url'])\n    stampCallsite(ref, captureCallsite(Request.Url))\n    return ref\n  },\n\n  Path(): ChainableRef {\n    const ref = ReferenceBuilder.create(['request', 'path'])\n    stampCallsite(ref, captureCallsite(Request.Path))\n    return ref\n  },\n\n  Method(): ChainableRef {\n    const ref = ReferenceBuilder.create(['request', 'method'])\n    stampCallsite(ref, captureCallsite(Request.Method))\n    return ref\n  },\n\n  Headers(name: string): ChainableRef {\n    const ref = ReferenceBuilder.create(['request', 'headers', name])\n    stampCallsite(ref, captureCallsite(Request.Headers))\n    return ref\n  },\n\n  Cookies(name: string): ChainableRef {\n    const ref = ReferenceBuilder.create(['request', 'cookies', name])\n    stampCallsite(ref, captureCallsite(Request.Cookies))\n    return ref\n  },\n\n  State(key: string): ChainableRef {\n    const ref = ReferenceBuilder.create(['request', 'state', ...splitKey(key)])\n    stampCallsite(ref, captureCallsite(Request.State))\n    return ref\n  },\n}\n\n/**\n * References data defined for the step.\n */\nexport function Data(key: string): ChainableRef {\n  const ref = ReferenceBuilder.create(['data', ...splitKey(key)])\n  stampCallsite(ref, captureCallsite(Data))\n  return ref\n}\n\n/**\n * References server-side session data from the current request context.\n */\nexport function Session(key: string): ChainableRef {\n  const ref = ReferenceBuilder.create(['session', ...splitKey(key)])\n  stampCallsite(ref, captureCallsite(Session))\n  return ref\n}\n\n/**\n * References an answer using its target field or a string code.\n *\n * @example\n * Answer('email')  // Reference by code string\n * Answer(emailField)  // Reference by field definition\n * Answer('user.address.postcode')  // Nested path\n */\nexport function Answer(target: FieldBlockDefinition | ResolvableString): ChainableRef {\n  const callsite = captureCallsite(Answer)\n\n  const create = (ref: ChainableRef): ChainableRef => {\n    stampCallsite(ref, callsite)\n    return ref\n  }\n\n  // If it's a field block definition, use its code property\n  if (isFieldBlockDefinition(target)) {\n    const { code } = target\n\n    // String code - split dot notation\n    if (typeof code === 'string') {\n      return create(ReferenceBuilder.create(['answers', ...splitKey(code)]))\n    }\n\n    // Dynamic code (expression) - pass through\n    return create(ReferenceBuilder.create(['answers', code as any]))\n  }\n\n  // String target - split dot notation\n  if (typeof target === 'string') {\n    return create(ReferenceBuilder.create(['answers', ...splitKey(target)]))\n  }\n\n  // Otherwise, use the target directly (expression types like Format)\n  return create(ReferenceBuilder.create(['answers', target as any]))\n}\n\n/**\n * References the current collection item when inside a collection scope.\n *\n * @example\n * Item().path('name')  // Access item.name\n * Item().value()  // Access the whole item\n * Item().parent.path('groupId')  // Access parent item's property\n */\nexport function Item(): ChainableScopedRef {\n  const ref = ScopedReferenceBuilder.create(0)\n  stampCallsite(ref, captureCallsite(Item))\n  return ref\n}\n\nconst createLoop = (): ChainableLoopRef => {\n  return LoopReferenceBuilder.create(0)\n}\n\n/**\n * References metadata for the current collection loop.\n *\n * @example\n * Loop.Index()  // 1-based iteration position\n * Loop.Index0()  // 0-based iteration index\n * Loop.Parent.Index()  // Parent loop position in nested iterations\n */\nexport const Loop: ChainableLoopRef = createLoop()\n\n/**\n * References the block/field it's in scope of.\n *\n * @example\n * Self().match(Condition.IsRequired())\n * Self().not.match(Condition.String.IsEmpty())\n * Self().pipe(Transformer.String.Trim).match(Condition.IsRequired())\n */\nexport function Self(): ChainableRef {\n  const ref = ReferenceBuilder.create(['answers', '@self'])\n  stampCallsite(ref, captureCallsite(Self))\n  return ref\n}\n","const FRAME_PATTERN = /^\\s+at /\n\nconst MAX_CHAIN_LENGTH = 3\n\nexport const isInternalFrame = (frame: string): boolean =>\n  frame.includes('node:') ||\n  frame.includes('node_modules') ||\n  frame.includes('forge-core/src') ||\n  frame.includes('forge-core/dist') ||\n  frame.includes('forge:compiled/') ||\n  frame.includes('(<anonymous>)')\n\n// Bundler module-wiring helpers (esbuild's __init/__require, webpack's require) —\n// shared by every definition in a module, so they never distinguish one.\nconst BUNDLER_HELPER_PATTERN = /^(?:__init|__require|__commonJS|__esm|__toESM|__webpack_require__) /\n\n/**\n * Formats a captured callsite into the chain of author-facing \"defined at\"\n * frames, innermost first. Frames inside forge-core, node internals, and\n * node_modules are skipped because registry handles are often invoked by\n * forge-internal callers. The chain keeps walking past frames in the capture\n * site's file (wrapper DSL utilities produce several), stops once it has the\n * first frame from a different file, and caps at three entries — enough to\n * read past a wrapper layer to the author's own file without printing the\n * whole capture. Reading `.stack` here triggers V8's lazy trace formatting,\n * so call this only at display time.\n */\nexport const formatCallsiteChain = (callsite: { readonly stack?: string } | undefined): string[] => {\n  const stack = callsite?.stack\n  if (!stack) {\n    return []\n  }\n\n  const frames = extractFrames(stack)\n\n  if (frames.length === 0) {\n    return []\n  }\n\n  const chainFrames = selectAuthorChainFrames(frames)\n\n  if (chainFrames.length === 0) {\n    return [frames[0]]\n  }\n\n  return chainFrames.map(collapseModuleNamedFrame)\n}\n\nconst extractFrames = (stack: string): string[] =>\n  stack\n    .split('\\n')\n    .filter(line => FRAME_PATTERN.test(line))\n    .map(line => line.replace(FRAME_PATTERN, ''))\n\n/**\n * The author-facing chain frames, innermost first: walks past frames in the\n * capture site's file, stops after the first frame from a different file,\n * caps at `MAX_CHAIN_LENGTH`.\n */\nconst selectAuthorChainFrames = (frames: string[]): string[] => {\n  const authorFrames = frames.filter(frame => !isInternalFrame(frame) && !BUNDLER_HELPER_PATTERN.test(frame))\n\n  if (authorFrames.length === 0) {\n    return []\n  }\n\n  const captureSiteFile = frameFile(authorFrames[0])\n  const chain: string[] = []\n\n  authorFrames.some(frame => {\n    chain.push(frame)\n\n    return chain.length >= MAX_CHAIN_LENGTH || frameFile(frame) !== captureSiteFile\n  })\n\n  return chain\n}\n\n// V8 names top-level module frames by module id — `server/forms/index.ts\n// (/app/server/forms/index.ts:40:40)` — so the name restates the path. Collapse\n// those to the bare location, matching the anonymous-frame grammar.\nconst collapseModuleNamedFrame = (frame: string): string => {\n  const match = /^(.+) \\((.+):(\\d+:\\d+)\\)$/.exec(frame)\n\n  if (match === null) {\n    return frame\n  }\n\n  const [, name, file, position] = match\n\n  return file.endsWith(name) ? `${file}:${position}` : frame\n}\n\n/**\n * Formats a captured callsite into the single innermost author-facing frame —\n * the first entry of `formatCallsiteChain`.\n */\nexport const formatCallsite = (callsite: { readonly stack?: string } | undefined): string | undefined => {\n  const chain = formatCallsiteChain(callsite)\n\n  return chain.length > 0 ? chain[0] : undefined\n}\n\nexport interface CallsitePosition {\n  readonly file: string\n  readonly line: number\n  readonly column: number\n}\n\n/**\n * Resolves a captured callsite to the structured positions (1-based line and\n * column) of the author chain frames `formatCallsiteChain` renders, innermost\n * first. Every chain frame is a legitimate breakpoint home: a node built\n * inside a shared wiring helper is \"defined at\" both the helper's line and\n * the line that called the helper. Unlike the display formatters there is no\n * fallback to an internal frame when every frame is filtered — a source-map\n * entry pointing into forge internals is worse than none. Reading `.stack`\n * triggers V8's lazy trace formatting, so call this at codegen time only.\n */\nexport const resolveCallsitePositionChain = (callsite: { readonly stack?: string } | undefined): CallsitePosition[] => {\n  const stack = callsite?.stack\n  if (!stack) {\n    return []\n  }\n\n  return selectAuthorChainFrames(extractFrames(stack))\n    .map(parseFramePosition)\n    .filter(position => position !== undefined)\n}\n\nconst parseFramePosition = (frame: string): CallsitePosition | undefined => {\n  const location = /\\((.+)\\)$/.exec(frame)?.[1] ?? frame\n  const match = /^(.+):(\\d+):(\\d+)$/.exec(location)\n\n  if (match === null) {\n    return undefined\n  }\n\n  return { file: match[1], line: Number(match[2]), column: Number(match[3]) }\n}\n\nconst frameFile = (frame: string): string => {\n  const location = /\\((.+)\\)$/.exec(frame)?.[1] ?? frame\n\n  return location.replace(/:\\d+:\\d+$/, '')\n}\n","import { isInternalFrame } from '../../shared/diagnostics/formatCallsite'\n\nexport interface RuntimeDiagnosticFields {\n  readonly phase: string\n  readonly formattedPath?: string\n  readonly functionName?: string\n  readonly functionType?: string\n}\n\nconst FRAME_PATTERN = /^\\s+at /\n\n/**\n * Renders the author-facing sections of a forge error's `stack`: the\n * diagnostics block and the folded frame list. Indentation is deliberate —\n * the block header sits at frame depth (4 spaces) with fields nested at 6, so\n * Node's `[cause]:` (fixed at 2 spaces in `util.inspect`) visibly outdents as\n * a sibling of the whole error instead of reading as another diagnostics\n * field.\n */\nexport default class DiagnosticErrorFormatter {\n  static formatRuntimeDiagnostics(diagnostics: RuntimeDiagnosticFields): string {\n    const formattedFields = [\n      { label: 'Phase', value: diagnostics.phase },\n      { label: 'Path', value: diagnostics.formattedPath },\n      { label: 'Function', value: diagnostics.functionName },\n      { label: 'Type', value: diagnostics.functionType },\n    ]\n      .filter(field => field.value !== undefined)\n      .map(field => `      ${field.label}: ${field.value}`)\n\n    return ['    Forge diagnostics:', ...formattedFields].join('\\n')\n  }\n\n  static extractStackFrames(stack: string | undefined): string[] {\n    if (stack === undefined) {\n      return []\n    }\n\n    return stack\n      .split('\\n')\n      .filter(line => FRAME_PATTERN.test(line))\n      .map(line => line.replace(FRAME_PATTERN, ''))\n  }\n\n  /**\n   * Collapses each consecutive run of forge-internal frames into one summary\n   * line naming the run's first and last frame. Author frames always render.\n   * The summary line deliberately does not match the `at ...` frame grammar so\n   * error trackers never ingest it as an execution frame.\n   */\n  static foldStackFrames(frames: string[]): string[] {\n    const folded: string[] = []\n    let internalRun: string[] = []\n\n    const flushRun = (): void => {\n      if (internalRun.length === 0) {\n        return\n      }\n\n      folded.push(DiagnosticErrorFormatter.formatFoldedRun(internalRun))\n      internalRun = []\n    }\n\n    frames.forEach(frame => {\n      if (isInternalFrame(frame)) {\n        internalRun.push(frame)\n\n        return\n      }\n\n      flushRun()\n      folded.push(`    at ${frame}`)\n    })\n    flushRun()\n\n    return folded\n  }\n\n  private static formatFoldedRun(run: string[]): string {\n    if (run.length === 1) {\n      return `    ... 1 forge frame (${frameName(run[0])}) — FORGE_FULL_STACK=1 to expand`\n    }\n\n    const summary = `${frameName(run[0])} → ${frameName(run[run.length - 1])}`\n\n    return `    ... ${run.length} forge frames (${summary}) — FORGE_FULL_STACK=1 to expand`\n  }\n}\n\nconst frameName = (frame: string): string => {\n  const parenIndex = frame.indexOf(' (')\n\n  return parenIndex === -1 ? frame : frame.slice(0, parenIndex)\n}\n","import DiagnosticErrorFormatter from './DiagnosticErrorFormatter'\n\nexport interface ForgeErrorDiagnostics {\n  /** Human-readable path through the journey DSL */\n  readonly formattedPath?: string\n  /** Author callsite captured where the offending node was defined */\n  readonly callsite?: { readonly stack?: string }\n}\n\n/**\n * Base class for every error the engine throws. Owns the diagnostic fields\n * shared across the family (`formattedPath`, `callsite`), stamps `name` from\n * the concrete class, and owns `stack` rendering: raw frames are captured once\n * at construction (with constructor frames trimmed) and the display string —\n * folded forge-internal frames, defined-at frames, diagnostics block — is\n * assembled lazily on first read, so errors that get caught and handled never\n * pay for formatting. The unfolded original stays reachable via the\n * non-enumerable `rawStack`, and `FORGE_FULL_STACK=1` renders every frame.\n */\nexport default abstract class ForgeBaseError extends Error {\n  readonly formattedPath?: string\n\n  readonly callsite?: { readonly stack?: string }\n\n  declare readonly rawStack: string | undefined\n\n  private readonly rawStackHolder: { stack?: string }\n\n  protected constructor(message: string, diagnostics?: ForgeErrorDiagnostics) {\n    super(message)\n    this.name = new.target.name\n    this.formattedPath = diagnostics?.formattedPath\n    this.callsite = diagnostics?.callsite\n    const canCapture = typeof Error.captureStackTrace === 'function'\n\n    this.rawStackHolder = canCapture ? {} : { stack: this.stack }\n\n    if (canCapture) {\n      Error.captureStackTrace(this.rawStackHolder, new.target)\n    }\n\n    Object.defineProperty(this, 'stack', {\n      get: () => this.renderStack(),\n      set: (value: string | undefined) => {\n        Object.defineProperty(this, 'stack', { value, writable: true, configurable: true, enumerable: false })\n      },\n      configurable: true,\n      enumerable: false,\n    })\n    Object.defineProperty(this, 'rawStack', {\n      get: () => this.renderRawStack(),\n      configurable: true,\n      enumerable: false,\n    })\n  }\n\n  /** ForgeInternalError opts out: when the engine itself is broken, the internals are the story. */\n  protected get foldsInternalStackFrames(): boolean {\n    return true\n  }\n\n  /** The stack string whose frames form the rendered body — subclasses may substitute a cause's stack. */\n  protected stackBodySource(): string | undefined {\n    return this.rawStackHolder.stack\n  }\n\n  /** Definition-site frames rendered after the execution frames as `at [defined] ...` lines. */\n  protected definedAtStackFrames(): string[] {\n    return []\n  }\n\n  /** The `Forge diagnostics:` block appended after the frames, if the subclass carries one. */\n  protected formatDiagnosticsBlock(): string | undefined {\n    return undefined\n  }\n\n  private renderStack(): string {\n    const frames = DiagnosticErrorFormatter.extractStackFrames(this.stackBodySource())\n    const foldDisabled = process.env.FORGE_FULL_STACK === '1' || !this.foldsInternalStackFrames\n    const frameLines = foldDisabled\n      ? frames.map(frame => `    at ${frame}`)\n      : DiagnosticErrorFormatter.foldStackFrames(frames)\n    const definedLines = this.definedAtStackFrames().map(frame => `    at [defined] ${frame}`)\n    const diagnosticsBlock = this.formatDiagnosticsBlock()\n\n    const sections = [\n      [`${this.name}: ${this.message}`, ...frameLines].join('\\n'),\n      definedLines.length > 0 ? definedLines.join('\\n') : undefined,\n      diagnosticsBlock,\n    ].filter(section => section !== undefined)\n\n    return sections.join('\\n\\n')\n  }\n\n  private renderRawStack(): string | undefined {\n    const rawFrames = DiagnosticErrorFormatter.extractStackFrames(this.rawStackHolder.stack)\n\n    return [`${this.name}: ${this.message}`, ...rawFrames.map(frame => `    at ${frame}`)].join('\\n')\n  }\n}\n","import ForgeBaseError from './ForgeBaseError'\n\ninterface ForgeAuthoringErrorOptions {\n  /** Human-readable error message */\n  message: string\n  /** Human-readable path through the journey DSL */\n  formattedPath?: string\n  /** Author callsite captured where the offending definition was written */\n  callsite?: { readonly stack?: string }\n}\n\n/**\n * The authoring API was misused in a way the schema never gets to see -\n * thrown while builders and DSL helpers are still assembling the definition.\n */\nexport default class ForgeAuthoringError extends ForgeBaseError {\n  constructor(options: ForgeAuthoringErrorOptions) {\n    super(options.message, options)\n  }\n}\n","import {\n  BlockType,\n  ExpressionType,\n  FunctionType,\n  IteratorType,\n  PredicateType,\n  StructureType,\n} from '../../authoring/types/enums'\nimport type { DSLPathSegment } from './sourceLocation.type'\n\ntype DSLRecord = Record<string, unknown>\n\nconst FUNCTION_TYPE_VALUES: ReadonlySet<string> = new Set(Object.values(FunctionType))\n\ninterface PathFormatState {\n  readonly current: unknown\n  readonly index: number\n  readonly segments: readonly string[]\n}\n\nexport default class DSLPathFormatter {\n  format(root: unknown, path: readonly DSLPathSegment[]): string {\n    const rootSegment = this.formatJourneySegment(root) ?? 'root'\n    const segments = this.formatPathSegments(path, { current: root, index: 0, segments: [rootSegment] })\n\n    return segments.join(' > ')\n  }\n\n  private formatPathSegments(path: readonly DSLPathSegment[], state: PathFormatState): readonly string[] {\n    if (state.index >= path.length) {\n      return state.segments\n    }\n\n    const pathPart = path[state.index]\n\n    if (this.isArrayIndex(pathPart)) {\n      const nextValue = Array.isArray(state.current) ? state.current[pathPart] : undefined\n      const nextSegments = [...state.segments, `[${pathPart}]`]\n\n      return this.formatPathSegments(path, { current: nextValue, index: state.index + 1, segments: nextSegments })\n    }\n\n    const nextPathPart = path[state.index + 1]\n    const propertyValue = this.getNextValue(state.current, pathPart)\n\n    if (this.isArrayIndex(nextPathPart)) {\n      const arrayValue = Array.isArray(propertyValue) ? propertyValue[nextPathPart] : undefined\n      const nextSegments = [...state.segments, this.formatArraySegment(pathPart, nextPathPart, arrayValue)]\n\n      return this.formatPathSegments(path, { current: arrayValue, index: state.index + 2, segments: nextSegments })\n    }\n\n    const propertySegments = this.formatPropertySegments(pathPart, state.current, propertyValue)\n    const nextSegments = [...state.segments, ...propertySegments]\n\n    return this.formatPathSegments(path, { current: propertyValue, index: state.index + 1, segments: nextSegments })\n  }\n\n  private formatArraySegment(key: string, index: number, value: unknown): string {\n    if (key === 'steps') {\n      return this.formatStepSegment(value) ?? `${key}[${index}]`\n    }\n\n    if (key === 'children') {\n      return this.formatJourneySegment(value) ?? `${key}[${index}]`\n    }\n\n    const base = `${key}[${index}]`\n    const context = key === 'blocks' ? this.formatBlockContext(value) : this.formatFunctionContext(value)\n\n    return context ? `${base} (${context})` : base\n  }\n\n  private formatPropertySegments(key: string, current: unknown, value: unknown): readonly string[] {\n    if (key === 'condition' && this.isPredicateTest(current) && this.formatFunctionContext(value)) {\n      return []\n    }\n\n    if (this.isRecord(current) && current.type === ExpressionType.ITERATE && key === 'input') {\n      return ['source']\n    }\n\n    if (this.isRecord(current) && current.type === ExpressionType.ITERATE && key === 'iterator') {\n      return ['source', 'iterator']\n    }\n\n    if (this.isRecord(current) && current.type === IteratorType.MAP && key === 'yield') {\n      return ['template']\n    }\n\n    return [key]\n  }\n\n  private formatJourneySegment(value: unknown): string | undefined {\n    const code = this.getStringProperty(value, 'code')\n    const path = this.getStringProperty(value, 'path')\n    const title = this.getStringProperty(value, 'title')\n\n    return code ?? (path ? this.trimPath(path) : undefined) ?? title\n  }\n\n  private formatStepSegment(value: unknown): string | undefined {\n    const code = this.getStringProperty(value, 'code')\n    const path = this.getStringProperty(value, 'path')\n    const title = this.getStringProperty(value, 'title')\n\n    return code ?? (path ? this.trimPath(path) : undefined) ?? title\n  }\n\n  private formatFunctionContext(value: unknown): string | undefined {\n    if (!this.isRecord(value)) {\n      return undefined\n    }\n\n    const type = this.getStringProperty(value, 'type')\n    const name = this.getStringProperty(value, 'name')\n\n    if (!type || !name || !FUNCTION_TYPE_VALUES.has(type)) {\n      return undefined\n    }\n\n    return `${this.formatFunctionType(type)} - ${name}`\n  }\n\n  private isPredicateTest(value: unknown): boolean {\n    return this.isRecord(value) && value.type === PredicateType.TEST\n  }\n\n  private formatBlockContext(value: unknown): string | undefined {\n    if (!this.isRecord(value) || value.type !== StructureType.BLOCK) {\n      return undefined\n    }\n\n    const variant = this.getStringProperty(value, 'variant')\n\n    if (!variant) {\n      return undefined\n    }\n\n    const code = value.blockType === BlockType.FIELD ? this.getStringProperty(value, 'code') : undefined\n\n    return code ? `${variant} - ${code}` : variant\n  }\n\n  private formatFunctionType(functionType: string): string {\n    const suffix = functionType.split('.').at(-1)\n\n    return suffix?.toLowerCase() ?? functionType\n  }\n\n  private getNextValue(current: unknown, key: string): unknown {\n    if (!this.isRecord(current)) {\n      return undefined\n    }\n\n    return current[key]\n  }\n\n  private getStringProperty(value: unknown, property: string): string | undefined {\n    if (!this.isRecord(value)) {\n      return undefined\n    }\n\n    const propertyValue = value[property]\n\n    return typeof propertyValue === 'string' && propertyValue.trim() !== '' ? propertyValue : undefined\n  }\n\n  private trimPath(path: string): string {\n    const trimmed = path.replace(/^\\/+|\\/+$/g, '')\n\n    return trimmed === '' ? path : trimmed\n  }\n\n  private isRecord(value: unknown): value is DSLRecord {\n    return typeof value === 'object' && value !== undefined && value !== null && !Array.isArray(value)\n  }\n\n  private isArrayIndex(value: unknown): value is number {\n    return typeof value === 'number'\n  }\n}\n","import DSLPathFormatter from './DSLPathFormatter'\nimport type { DSLPathSegment, DSLSourceLocation } from './sourceLocation.type'\n\nconst isValidCallsite = (value: unknown): value is { readonly stack?: string } =>\n  typeof value === 'object' &&\n  value !== null &&\n  (!('stack' in value) || typeof (value as { stack?: unknown }).stack === 'string')\n\nexport default class DSLSourceLocator {\n  constructor(\n    private readonly root: unknown,\n    private readonly pathFormatter = new DSLPathFormatter(),\n  ) {}\n\n  fromPath(path: readonly DSLPathSegment[]): DSLSourceLocation {\n    return {\n      path,\n      formattedPath: this.pathFormatter.format(this.root, path),\n    }\n  }\n\n  /**\n   * Resolves the captured author callsite for the node at the given path by\n   * reading the nearest `__callsite` stamp, walking from the node itself up\n   * through its ancestors to the root.\n   */\n  callsiteFromPath(path: readonly DSLPathSegment[]): { readonly stack?: string } | undefined {\n    const objects: object[] = []\n    let current: unknown = this.root\n\n    for (let i = 0; i < path.length && current !== null && typeof current === 'object'; i += 1) {\n      objects.push(current)\n      current = (current as Record<DSLPathSegment, unknown>)[path[i]]\n    }\n\n    if (current !== null && typeof current === 'object') {\n      objects.push(current)\n    }\n\n    for (let i = objects.length - 1; i >= 0; i -= 1) {\n      const callsite = Object.getOwnPropertyDescriptor(objects[i], '__callsite')?.value\n\n      if (isValidCallsite(callsite)) {\n        return callsite\n      }\n    }\n\n    return undefined\n  }\n}\n","import ForgeAuthoringError from '../../../engine/errors/ForgeAuthoringError'\nimport DSLSourceLocator from '../../../shared/diagnostics/DSLSourceLocator'\nimport type { DSLPathSegment } from '../../../shared/diagnostics/sourceLocation.type'\nimport { stampCallsite } from './captureCallsite'\n\nconst carryCallsite = (from: object, to: unknown): void => {\n  const callsite = Object.getOwnPropertyDescriptor(from, '__callsite')?.value\n\n  if (callsite) {\n    stampCallsite(to, callsite)\n  }\n}\n\ninterface Buildable {\n  build(): unknown\n}\n\nconst isBuildable = (value: unknown): value is Buildable => {\n  return value !== null &&\n    typeof value === 'object' &&\n    (value as any).nodeKind === 'forge-builder' &&\n    'build' in value &&\n    typeof (value as any).build === 'function'\n}\n\nconst describePath = (path: readonly DSLPathSegment[]): string => (path.length === 0 ? '<root>' : path.join('.'))\n\nconst finalise = (value: unknown, path: DSLPathSegment[], ancestors: Set<object>): unknown => {\n  if (value === null || typeof value !== 'object') {\n    return value\n  }\n\n  if (ancestors.has(value)) {\n    throw new ForgeAuthoringError({\n      message:\n        `Circular reference detected in form configuration at \"${describePath(path)}\". ` +\n        'Configuration objects must form a tree; an object cannot contain itself.',\n    })\n  }\n\n  ancestors.add(value)\n  try {\n    if (Array.isArray(value)) {\n      return value.map((item, index) => finalise(item, [...path, index], ancestors))\n    }\n\n    if (isBuildable(value)) {\n      // Recurse into the built output at the same path so shared builder\n      // instances produce a fresh copy per tree position.\n      const built = value.build()\n      carryCallsite(value, built)\n      return finalise(built, path, ancestors)\n    }\n\n    const prototype = Object.getPrototypeOf(value)\n\n    if (prototype !== Object.prototype && prototype !== null) {\n      return value\n    }\n\n    const result: Record<string, unknown> = {}\n    Object.entries(value).forEach(([key, entry]) => {\n      result[key] = finalise(entry, [...path, key], ancestors)\n    })\n    carryCallsite(value, result)\n    return result\n  } finally {\n    ancestors.delete(value)\n  }\n}\n\nconst stampSource = (node: unknown, path: DSLPathSegment[], locator: DSLSourceLocator): void => {\n  if (node === null || typeof node !== 'object') {\n    return\n  }\n\n  if (Array.isArray(node)) {\n    node.forEach((item, index) => stampSource(item, [...path, index], locator))\n    return\n  }\n\n  // configurable + writable so an outer finaliseBuilders() walk can re-stamp\n  // nodes that were already stamped by an earlier, narrower walk.\n  Object.defineProperty(node, '__source', {\n    value: locator.fromPath(path),\n    enumerable: false,\n    configurable: true,\n    writable: true,\n  })\n\n  Object.entries(node).forEach(([key, entry]) => {\n    stampSource(entry, [...path, key], locator)\n  })\n}\n\n/**\n * Convert form configuration from builders into JSON.\n * Recursively processes objects and arrays, calling build() on any Buildable instances.\n *\n * Every object node in the output is stamped with a non-enumerable `__source`\n * ({ path, formattedPath }) describing its position in the finalised tree.\n * Stamping happens in a second pass over the fully finalised tree so that\n * formatted paths resolve context (step codes, block variants) against final\n * values rather than un-built builders.\n *\n * Shared builder instances are finalised once per tree position: each position\n * gets its own built copy so per-position `__source` stamps are possible.\n * Circular references in the input throw.\n *\n * @param input - Objects, arrays that contain builders\n */\nexport const finaliseBuilders = <T>(input: T): unknown => {\n  const result = finalise(input, [], new Set())\n  stampSource(result, [], new DSLSourceLocator(result))\n  return result\n}\n","import { finaliseBuilders } from './utils/finaliseBuilders'\nimport { captureCallsite, stampCallsite } from './utils/captureCallsite'\nimport { BlockDefinition, FieldBlockDefinition } from '../../components/types/structures.type'\nimport { JourneyDefinition, StepDefinition } from '../types/structures.type'\nimport { ForgePackage, RegisteredForgePackage } from '../types/package.type'\nimport { BlockType, StructureType } from '../types/enums'\n\n/**\n * Creates a presentational (non-field) block for a step.\n * Use for headings, paragraphs, inset text, and other non-interactive content.\n */\nexport function block<D extends BlockDefinition>(definition: Omit<D, 'type' | 'blockType'>): D {\n  const result = finaliseBuilders({\n    ...definition,\n    type: StructureType.BLOCK,\n    blockType: BlockType.BASIC,\n  }) as D\n  stampCallsite(result, captureCallsite(block))\n  return result\n}\n\n/**\n * Creates a field block that captures user input.\n * Fields have a `code` for storing answers and support `validWhen`, `dependentWhen`,\n * `defaultValue`, and `formatters`.\n */\nexport function field<D extends FieldBlockDefinition>(definition: Omit<D, 'type' | 'blockType'>): D {\n  const result = finaliseBuilders({\n    ...definition,\n    type: StructureType.BLOCK,\n    blockType: BlockType.FIELD,\n  }) as D\n  stampCallsite(result, captureCallsite(field))\n  return result\n}\n\n/**\n * Creates a step (page) within a journey.\n * Steps contain blocks and define lifecycle hooks for access, submission, and actions.\n */\nexport function step<D extends StepDefinition>(definition: Omit<D, 'type'>): D {\n  const result = finaliseBuilders({\n    ...definition,\n    type: StructureType.STEP,\n  }) as D\n  stampCallsite(result, captureCallsite(step))\n  return result\n}\n\n/**\n * Creates a journey definition - a complete form flow containing steps.\n */\nexport function journey<D extends JourneyDefinition>(definition: Omit<D, 'type'>): D {\n  const result = finaliseBuilders({\n    ...definition,\n    type: StructureType.JOURNEY,\n  }) as D\n  stampCallsite(result, captureCallsite(journey))\n  return result\n}\n\n/**\n * Create a forge package that bundles a journey with its custom functions and components.\n *\n * This is the mandatory gate into Forge: it parses string journeys, finalises\n * any builders in the journey tree (stamping source locations for diagnostics),\n * and brands the result so `Forge.registerPackage()` accepts it.\n *\n * @param pkg - The forge package configuration\n * @returns The package with a finalised journey, branded for registration\n *\n * @example\n * ```typescript\n * // Package with custom functions (deps injected via registerPackage)\n * export default createForgePackage<MyDeps>({\n *   journey: myJourney,\n *   functions: {\n *     ...myEffectsImplementations,\n *     ...myTransformersImplementations,\n *   },\n * })\n *\n * // Journey only (no custom functions)\n * export default createForgePackage({\n *   journey: simpleJourney,\n * })\n * ```\n */\nexport function createForgePackage<TDeps = Record<string, never>>(\n  pkg: ForgePackage<TDeps>,\n): RegisteredForgePackage<TDeps> {\n  const parsed: unknown = typeof pkg.journey === 'string' ? JSON.parse(pkg.journey) : pkg.journey\n\n  const result: RegisteredForgePackage<TDeps> = {\n    ...pkg,\n    journey: finaliseBuilders(parsed) as JourneyDefinition,\n    forgePackage: true,\n  }\n  stampCallsite(result, captureCallsite(createForgePackage))\n  return result\n}\n","import { captureCallsite, stampCallsite } from './utils/captureCallsite'\nimport { TieBreaker, TieBreakerProps, ValidationExpr, ValidationProps } from '../types/structures.type'\nimport { AccessHook, RedirectOutcome, SubmitHook, ThrowErrorOutcome } from '../types/expressions.type'\nimport { ExpressionType, HookType, OutcomeType } from '../types/enums'\n\n/**\n * Creates a submission hook for handling form submissions.\n * Use this in the onSubmission array of steps.\n */\nexport function submit(definition: Omit<SubmitHook, 'type'>): SubmitHook {\n  const result = { ...definition, type: HookType.SUBMIT } as SubmitHook\n  stampCallsite(result, captureCallsite(submit))\n  return result\n}\n\n/**\n * Creates an access hook for access control, data loading, and analytics.\n * Use this in the onAccess array of journeys or steps.\n */\nexport function access(definition: Omit<AccessHook, 'type'>): AccessHook {\n  const result = { ...definition, type: HookType.ACCESS } as AccessHook\n  stampCallsite(result, captureCallsite(access))\n  return result\n}\n\n/**\n * Creates a validation rule for a field or step.\n * Add to the `validWhen` array - rules are checked in order.\n */\nexport function validation(definition: ValidationProps): ValidationExpr {\n  const result = {\n    ...definition,\n    type: ExpressionType.VALIDATION,\n  } as ValidationExpr\n  stampCallsite(result, captureCallsite(validation))\n  return result\n}\n\n/**\n * Creates a tie-breaker rule for a step. Add to `reachability.tieBreakers` —\n * entries are evaluated top-to-bottom and the first matching `when` (or an\n * entry with no `when`) supplies the step's priority.\n *\n * @example\n * tieBreaker({ priority: 100, when: Answer('income_started').match(true) })\n */\nexport function tieBreaker(definition: TieBreakerProps): TieBreaker {\n  const result = {\n    ...definition,\n    type: ExpressionType.TIE_BREAKER,\n  } as TieBreaker\n  stampCallsite(result, captureCallsite(tieBreaker))\n  return result\n}\n\n/**\n * Creates a redirect outcome for hooks.\n * When matched, halts hook processing and redirects to the specified path.\n *\n * @example\n * // Unconditional redirect\n * redirect({ goto: '/overview' })\n *\n * @example\n * // Conditional redirect\n * redirect({\n *   when: Data('needsSetup').match(Condition.Equals(true)),\n *   goto: '/setup',\n * })\n */\nexport function redirect(definition: Omit<RedirectOutcome, 'type'>): RedirectOutcome {\n  const result = {\n    ...definition,\n    type: OutcomeType.REDIRECT,\n  } as RedirectOutcome\n  stampCallsite(result, captureCallsite(redirect))\n  return result\n}\n\n/**\n * Creates an error outcome for hooks.\n * When matched, halts hook processing and returns an error outcome.\n *\n * @example\n * // Not found error\n * throwError({\n *   when: Data('notFound').match(Condition.Equals(true)),\n *   status: 404,\n *   message: 'Item not found',\n * })\n *\n * @example\n * // Dynamic error message\n * throwError({\n *   when: Data('saveError').match(Condition.IsRequired()),\n *   status: 500,\n *   message: Format('Failed to save: %1', Data('saveError')),\n * })\n */\nexport function throwError(definition: Omit<ThrowErrorOutcome, 'type'>): ThrowErrorOutcome {\n  const result = {\n    ...definition,\n    type: OutcomeType.THROW_ERROR,\n  } as ThrowErrorOutcome\n  stampCallsite(result, captureCallsite(throwError))\n  return result\n}\n","import ForgeBaseError from './ForgeBaseError'\n\ninterface ForgeRegistryDuplicateErrorOptions {\n  /** Type of registry (function or component) */\n  registryType: 'function' | 'component'\n  /** Name or variant of the item being registered */\n  itemName: string\n  /** Optional additional message */\n  message?: string\n}\n\nexport default class ForgeRegistryDuplicateError extends ForgeBaseError {\n  readonly registryType: 'function' | 'component'\n\n  readonly itemName: string\n\n  constructor(options: ForgeRegistryDuplicateErrorOptions) {\n    super(options.message ?? `Duplicate ${options.registryType} registration: \"${options.itemName}\"`)\n    this.registryType = options.registryType\n    this.itemName = options.itemName\n  }\n}\n","import { FunctionType, PredicateType, ExpressionType } from '../types/enums'\nimport {\n  ConditionFunctionExpr,\n  GeneratorFunctionExpr,\n  PipelineExpr,\n  NullishExpr,\n  PredicateTestExpr,\n  TransformerFunctionExpr,\n  ResolvableValue,\n} from '../types/expressions.type'\nimport { ExpressionBuilder } from './ExpressionBuilder'\nimport { captureCallsite, stampCallsite } from './utils/captureCallsite'\nimport { ChainableGenerator, ChainableNegation } from './types'\n\n/**\n * Immutable builder for creating generator function expressions.\n *\n * Generators produce values without requiring input, unlike conditions and transformers.\n * They can be used standalone, chained with transformers via pipelines, or tested with conditions.\n *\n * @example\n * // Standalone generator\n * Generator.Date.Now()\n *\n * @example\n * // Generator with pipeline\n * Generator.Date.Now().pipe(Transformer.Date.AddDays(7))\n *\n * @example\n * // Generator with condition\n * Generator.Date.Now().match(Condition.Date.IsFutureDate())\n *\n * @template A - The argument types for the generator function\n *\n * @internal Exposed to authors via the ChainableGenerator interface.\n */\nexport class GeneratorBuilder<A extends ResolvableValue[]> implements ChainableGenerator {\n  readonly nodeKind = 'forge-builder' as const\n\n  // The marker must exist on the class type so builders pass the weak-type\n  // check on Resolvable<T> argument slots; it is type-only and never set.\n  declare readonly __resolves?: any\n\n  private readonly expression: GeneratorFunctionExpr<A>\n\n  private readonly negated: boolean\n\n  private constructor(expr: GeneratorFunctionExpr<A>, negate: boolean = false) {\n    this.expression = expr\n    this.negated = negate\n  }\n\n  /**\n   * Create a new GeneratorBuilder with the given function name and arguments.\n   *\n   * @param name - The name of the generator function (must be registered)\n   * @param args - Arguments to pass to the generator function\n   */\n  static create<A extends ResolvableValue[]>(name: string, args: A): GeneratorBuilder<A> {\n    return new GeneratorBuilder(\n      {\n        type: FunctionType.GENERATOR,\n        name,\n        arguments: args,\n      },\n      false,\n    )\n  }\n\n  /**\n   * Get the underlying generator expression.\n   */\n  get expr(): GeneratorFunctionExpr<A> {\n    return this.expression\n  }\n\n  /**\n   * Build the final generator function expression.\n   * Called automatically by finaliseBuilders().\n   */\n  build(): GeneratorFunctionExpr<A> {\n    return this.expression\n  }\n\n  /**\n   * Transform the generated value through a pipeline of transformers.\n   * Creates a PipelineExpr with this generator as the input.\n   *\n   * @param steps - Transformer functions to apply sequentially\n   * @returns An ExpressionBuilder wrapping the pipeline\n   *\n   * @example\n   * Generator.Date.Now().pipe(\n   *   Transformer.Date.AddDays(7),\n   *   Transformer.Date.Format('YYYY-MM-DD')\n   * )\n   */\n  pipe(...steps: TransformerFunctionExpr[]): ExpressionBuilder<PipelineExpr> {\n    return ExpressionBuilder.pipeline(this.expression, steps)\n  }\n\n  /** Uses the fallback only when the value is null or undefined, like `??`. */\n  nullish(fallback: ResolvableValue | undefined): ExpressionBuilder<NullishExpr> {\n    const expression: NullishExpr = {\n      type: ExpressionType.NULLISH,\n      input: this.expression,\n      ...(fallback !== undefined && { fallback }),\n    }\n    const builder = ExpressionBuilder.from(expression)\n\n    stampCallsite(builder, captureCallsite(this.nullish))\n\n    return builder\n  }\n\n  /**\n   * Test the generated value against a condition.\n   * Terminal operation - returns a plain PredicateTestExpr.\n   *\n   * @example\n   * Generator.Date.Now().match(Condition.Date.IsFutureDate())\n   */\n  match(condition: ConditionFunctionExpr<any>): PredicateTestExpr {\n    const predicate: PredicateTestExpr = {\n      type: PredicateType.TEST,\n      subject: this.expression,\n      negate: this.negated,\n      condition,\n    }\n\n    stampCallsite(predicate, captureCallsite(this.match))\n\n    return predicate\n  }\n\n  /**\n   * Negate the next condition test.\n   * Returns a new builder with toggled negation.\n   *\n   * @example\n   * Generator.Date.Now().not.match(Condition.Date.IsPast())\n   */\n  get not(): ChainableNegation {\n    return new GeneratorBuilder(this.expression, !this.negated)\n  }\n}\n","import { z, type ZodType } from 'zod'\nimport { FunctionType } from '../types/enums'\nimport ForgeAuthoringError from '../../engine/errors/ForgeAuthoringError'\nimport ForgeRegistryDuplicateError from '../../engine/errors/ForgeRegistryDuplicateError'\nimport { GeneratorBuilder } from '../builders/GeneratorBuilder'\nimport { captureCallsite, stampCallsite } from '../builders/utils/captureCallsite'\nimport type { FunctionRegistryObject } from '../types/functions.type'\n\nexport interface RegistrationOptions {\n  inputSchema?: ZodType\n  argumentsSchema?: ZodType\n  outputSchema?: ZodType\n  prepare?: (...args: any[]) => any[]\n}\n\ninterface RegistrationWithFactory<TDeps = any> extends RegistrationOptions {\n  factory: (deps: TDeps) => (...args: any[]) => any\n}\n\ninterface StoredRegistration {\n  name: string\n  inputSchema?: ZodType\n  argumentsSchema?: ZodType\n  outputSchema?: ZodType\n  prepare?: (...args: any[]) => any[]\n  factory: (deps: any) => (...args: any[]) => any\n}\n\nexport const CONDITION_OUTPUT_SCHEMA = z.compile(z.boolean())\n\n// Each rolldown entry point (core, core/authoring) inlines its own copy of this class, so\n// `instanceof` fails when an instance from one bundle reaches a check in another. The\n// Symbol.for brand is process-global, so it survives the duplication.\n//\n// TODO: Probably should delete the brand/symbol machinery once the deprecated\n// implementations-map form of `functions` is removed — at that point the engine only needs\n// Array.isArray before calling .build(), and never needs to identify a registry.\nconst REGISTRY_BRAND = Symbol.for('forge:BaseFunctionRegistry')\n\nexport function isFunctionRegistry<T = any>(value: unknown): value is BaseFunctionRegistry<T> {\n  return typeof value === 'object' && value !== null && (value as Record<symbol, unknown>)[REGISTRY_BRAND] === true\n}\n\nexport abstract class BaseFunctionRegistry<TDeps = Record<string, never>> {\n  readonly [REGISTRY_BRAND] = true\n\n  private readonly registrations = new Map<string, StoredRegistration>()\n\n  private anonymousCounter = 0\n\n  constructor(\n    private readonly functionType: FunctionType,\n    private readonly defaultOutputSchema?: ZodType,\n  ) {}\n\n  protected nextAnonymousName(): string {\n    return `__anon_${this.anonymousCounter++}`\n  }\n\n  protected parseArgs(\n    first: string | RegistrationOptions | ((deps: TDeps) => (...args: any[]) => any),\n    second?: RegistrationOptions | ((deps: TDeps) => (...args: any[]) => any),\n    third?: (deps: TDeps) => (...args: any[]) => any,\n  ): { name: string; options: RegistrationOptions; factory: (deps: TDeps) => (...args: any[]) => any } {\n    if (typeof first === 'function') {\n      return { name: first.name || this.nextAnonymousName(), options: {}, factory: first }\n    }\n\n    if (typeof first !== 'string') {\n      const factory = second as (deps: TDeps) => (...args: any[]) => any\n\n      return { name: factory.name || this.nextAnonymousName(), options: first, factory }\n    }\n\n    if (typeof second === 'function') {\n      return { name: first, options: {}, factory: second }\n    }\n\n    const options = second ?? {}\n\n    return { name: first, options, factory: third ?? this.requireEmbeddedFactory(first, options) }\n  }\n\n  private requireEmbeddedFactory(name: string, options: RegistrationOptions): (deps: TDeps) => (...args: any[]) => any {\n    const { factory } = options as RegistrationWithFactory<TDeps>\n\n    if (!factory) {\n      throw new ForgeAuthoringError({\n        message: `The ${this.functionType} registration \"${name}\" has no factory - pass one positionally or as options.factory`,\n      })\n    }\n\n    return factory\n  }\n\n  protected store(name: string, options: RegistrationOptions, factory: (deps: TDeps) => (...args: any[]) => any): void {\n    if (this.registrations.has(name)) {\n      throw new ForgeRegistryDuplicateError({\n        registryType: 'function',\n        itemName: name,\n        message: `A ${this.functionType} is already registered under the name \"${name}\"`,\n      })\n    }\n\n    const inputSchema = this.compileSchema(options.inputSchema)\n    const argumentsSchema = this.compileSchema(options.argumentsSchema)\n    const outputSchema = this.compileOutputSchema(options.outputSchema)\n\n    this.registrations.set(name, {\n      name,\n      inputSchema,\n      argumentsSchema,\n      outputSchema,\n      prepare: options.prepare,\n      factory,\n    })\n  }\n\n  protected buildExpressionHandle(name: string, prepare?: (...args: any[]) => any[]): (...args: any[]) => any {\n    const type = this.functionType\n\n    if (type === FunctionType.GENERATOR) {\n      const generatorHandle = (...args: any[]) => {\n        const prepared = prepare ? prepare(...args) : args\n        const builder = GeneratorBuilder.create(name, prepared)\n\n        stampCallsite(builder, captureCallsite(generatorHandle))\n        return builder\n      }\n\n      return generatorHandle\n    }\n\n    const expressionHandle = (...args: any[]) => {\n      const prepared = prepare ? prepare(...args) : args\n      const expr = { type, name, arguments: prepared }\n\n      stampCallsite(expr, captureCallsite(expressionHandle))\n      return expr\n    }\n\n    return expressionHandle\n  }\n\n  build(deps?: TDeps): FunctionRegistryObject {\n    const resolvedDeps = (deps ?? {}) as TDeps\n    const registry = {} as FunctionRegistryObject\n\n    this.registrations.forEach((registration, name) => {\n      const evaluate = registration.factory(resolvedDeps)\n\n      registry[name] = {\n        name,\n        evaluate,\n        inputSchema: registration.inputSchema,\n        argumentsSchema: registration.argumentsSchema,\n        outputSchema: registration.outputSchema,\n        functionType: this.functionType,\n      }\n    })\n\n    return registry\n  }\n\n  private compileSchema(schema: ZodType | undefined): ZodType | undefined {\n    if (schema === undefined) {\n      return undefined\n    }\n\n    return z.compile(schema)\n  }\n\n  private compileOutputSchema(schema: ZodType | undefined): ZodType | undefined {\n    if (schema === undefined) {\n      return this.defaultOutputSchema\n    }\n\n    return z.compile(schema)\n  }\n}\n","import type { Resolvable } from '../types/expressions.type'\nimport type { ChainableGenerator } from '../builders/types'\nimport { FunctionType } from '../types/enums'\nimport { BaseFunctionRegistry, type RegistrationOptions } from './BaseFunctionRegistry'\n\nexport default class GeneratorRegistry<TDeps = Record<string, never>> extends BaseFunctionRegistry<TDeps> {\n  constructor() {\n    super(FunctionType.GENERATOR)\n  }\n\n  register<TArgs extends any[]>(\n    name: string,\n    options: RegistrationOptions & { factory: (deps: TDeps) => (...args: TArgs) => any },\n  ): (...args: { [K in keyof TArgs]: Resolvable<TArgs[K]> }) => ChainableGenerator\n\n  register<TArgs extends any[]>(\n    name: string,\n    options: RegistrationOptions,\n    factory: (deps: TDeps) => (...args: TArgs) => any,\n  ): (...args: { [K in keyof TArgs]: Resolvable<TArgs[K]> }) => ChainableGenerator\n\n  register<TArgs extends any[]>(\n    name: string,\n    factory: (deps: TDeps) => (...args: TArgs) => any,\n  ): (...args: { [K in keyof TArgs]: Resolvable<TArgs[K]> }) => ChainableGenerator\n\n  register<TArgs extends any[]>(\n    options: RegistrationOptions,\n    factory: (deps: TDeps) => (...args: TArgs) => any,\n  ): (...args: { [K in keyof TArgs]: Resolvable<TArgs[K]> }) => ChainableGenerator\n\n  register<TArgs extends any[]>(\n    factory: (deps: TDeps) => (...args: TArgs) => any,\n  ): (...args: { [K in keyof TArgs]: Resolvable<TArgs[K]> }) => ChainableGenerator\n\n  register(\n    first: string | RegistrationOptions | ((deps: TDeps) => (...args: any[]) => any),\n    second?: RegistrationOptions | ((deps: TDeps) => (...args: any[]) => any),\n    third?: (deps: TDeps) => (...args: any[]) => any,\n  ): (...args: any[]) => ChainableGenerator {\n    const { name, options, factory } = this.parseArgs(first, second, third)\n\n    this.store(name, options, factory)\n\n    return this.buildExpressionHandle(name, options.prepare) as any\n  }\n}\n","import { z } from 'zod'\nimport GeneratorRegistry from '../../../authoring/registries/GeneratorRegistry'\n\nexport const FORMAT_STRING_GENERATOR_NAME = 'FormatString'\n\nconst formatGenerators = new GeneratorRegistry()\n\nexport const FormatGenerators = {\n  /** Generates a string from a template with %1-style positional placeholders */\n  FormatString: formatGenerators.register(FORMAT_STRING_GENERATOR_NAME, {\n    argumentsSchema: z.tuple([z.string()], z.unknown()),\n    factory:\n      () =>\n      (template: string, ...replacements: unknown[]) =>\n        formatString(template, replacements),\n  }),\n}\n\nexport { formatGenerators as formatGeneratorsRegistry }\n\nfunction formatString(template: string, replacements: readonly unknown[]): string {\n  return template.replace(/%([1-9]\\d*)(?!\\d)/g, (placeholder, indexValue) =>\n    replaceFormatPlaceholder(placeholder, indexValue, replacements),\n  )\n}\n\nfunction replaceFormatPlaceholder(placeholder: string, indexValue: string, replacements: readonly unknown[]): string {\n  const index = Number(indexValue) - 1\n\n  if (!Number.isInteger(index) || index < 0 || index >= replacements.length) {\n    return placeholder\n  }\n\n  return String(replacements[index] ?? '')\n}\n","import { ExpressionBuilder } from './ExpressionBuilder'\nimport { captureCallsite, stampCallsite } from './utils/captureCallsite'\nimport { ChainableExpr, ChainableGenerator } from './types'\nimport { ResolvableValue } from '../types/expressions.type'\nimport { ResolvableString } from '../../components/types/structures.type'\nimport { FormatGenerators } from '../../built-ins/functions/generators/formatGenerators'\n\n/**\n * Creates a string formatting expression with placeholder substitution.\n * Placeholders are %1, %2, etc.\n *\n * @example\n * Format('Hello %1!', Answer('name'))\n * Format('%1 %2', Answer('firstName'), Answer('lastName'))\n */\nexport const Format = FormatGenerators.FormatString as (\n  template: ResolvableString,\n  ...args: ResolvableString[]\n) => ChainableGenerator\n\n/**\n * Wraps a static/literal value to make it chainable with .pipe() and .match().\n *\n * Use this when you have static data that you want to transform or test\n * using the fluent expression API.\n *\n * @param value - Any static value (array, object, primitive)\n * @returns A chainable expression (only exposes .pipe(), .match(), .not)\n *\n * @example\n * // Static array with transformations\n * Literal(['apple', 'banana', 'cherry']).pipe(Transformer.Array.Filter(...))\n *\n * // Static value with condition\n * Literal(42).match(Condition.Number.GreaterThan(0))\n *\n * // Use with .each() for iteration\n * Literal([1, 2, 3]).each(Iterator.Map(Item().value()))\n */\nexport function Literal(value: ResolvableValue): ChainableExpr {\n  const expr = ExpressionBuilder.from(value)\n  stampCallsite(expr, captureCallsite(Literal))\n  return expr\n}\n","import {\n  ConditionalExpr,\n  PredicateExpr,\n  PredicateTestExpr,\n  TransformerFunctionExpr,\n  ResolvableValue,\n} from '../types/expressions.type'\nimport { ExpressionBuilder } from './ExpressionBuilder'\nimport { ExpressionType } from '../types/enums'\nimport { ChainableExpr, BranchValue, ChainableConditional } from './types'\nimport { captureCallsite, stampCallsite } from './utils/captureCallsite'\n\n/**\n * Immutable fluent builder for creating conditional expressions.\n * Allows chaining of then/else branches after a predicate condition.\n * Each method returns a NEW instance, so partially-built conditionals\n * can be safely reused and forked.\n *\n * @internal Exposed to authors via the ChainableConditional interface.\n */\nexport class ConditionalExprBuilder implements ChainableConditional {\n  readonly nodeKind = 'forge-builder' as const\n\n  private readonly predicate: PredicateExpr\n\n  private readonly thenValue: BranchValue\n\n  private readonly elseValue: BranchValue\n\n  constructor(predicate: PredicateExpr, thenValue: BranchValue = true, elseValue: BranchValue = false) {\n    this.predicate = predicate\n    this.thenValue = thenValue\n    this.elseValue = elseValue\n  }\n\n  /**\n   * Sets the value to return when the predicate evaluates to true.\n   * @param value - The value or expression to return\n   * @returns A new builder with the then branch set\n   */\n  then(value: BranchValue): ConditionalExprBuilder {\n    return new ConditionalExprBuilder(this.predicate, value, this.elseValue)\n  }\n\n  /**\n   * Sets the value to return when the predicate evaluates to false.\n   * @param value - The value or expression to return\n   * @returns A new builder with the else branch set\n   */\n  else(value: BranchValue): ConditionalExprBuilder {\n    return new ConditionalExprBuilder(this.predicate, this.thenValue, value)\n  }\n\n  /** Transforms the selected branch value without evaluating unselected branches. */\n  pipe(...steps: TransformerFunctionExpr[]): ChainableExpr {\n    const callsite = captureCallsite(this.pipe)\n    const expression = this.build()\n    const builder = ExpressionBuilder.from(expression).pipe(...steps)\n\n    stampCallsite(expression, callsite)\n    stampCallsite(builder, callsite)\n\n    return builder\n  }\n\n  /** Uses the fallback only when the selected branch resolves to null or undefined. */\n  nullish(fallback: ResolvableValue | undefined): ChainableExpr {\n    const callsite = captureCallsite(this.nullish)\n    const expression = this.build()\n    const builder = ExpressionBuilder.from(expression).nullish(fallback)\n\n    stampCallsite(expression, callsite)\n    stampCallsite(builder, callsite)\n\n    return builder\n  }\n\n  /**\n   * Builds the final conditional expression.\n   * Note: This is private to hide its interface from the user, finaliseBuilders calls this\n   */\n\n  private build(): ConditionalExpr {\n    return {\n      type: ExpressionType.CONDITIONAL,\n      predicate: this.predicate,\n      thenValue: this.thenValue,\n      elseValue: this.elseValue,\n    }\n  }\n}\n\n/**\n * Creates a conditional expression builder with the given predicate.\n * Use this for fluent chained conditional building.\n *\n * @param predicate - The condition to evaluate\n * @returns A chainable conditional for fluent then/else building\n *\n * @example\n * when(Answer('age').match(Condition.GreaterThan(18)))\n *   .then('adult')\n *   .else('child')\n */\nexport const when = (predicate: PredicateExpr | PredicateTestExpr): ChainableConditional => {\n  const builder = new ConditionalExprBuilder(predicate)\n  stampCallsite(builder, captureCallsite(when))\n  return builder\n}\n\n/**\n * Options for creating a conditional expression using object syntax.\n */\ninterface ConditionalOptions {\n  /** The predicate condition to evaluate */\n  when: PredicateExpr | PredicateTestExpr\n  /** Value to return when predicate is true */\n  then: BranchValue\n  /** Value to return when predicate is false (optional, defaults to false) */\n  else?: BranchValue\n}\n\n/**\n * Creates a conditional expression using object syntax.\n * Alternative to the fluent `when().then().else()` builder.\n *\n * @param options - Object with when, then, and optional else properties\n * @returns A chainable conditional that will be finalised during form processing\n *\n * @example\n * // Basic usage\n * Conditional({\n *   when: Answer('country').match(Condition.Equals('UK')),\n *   then: 'Postcode',\n *   else: 'ZIP Code',\n * })\n *\n * // Without else (returns false when the predicate is false)\n * Conditional({\n *   when: Answer('isPremium').match(Condition.Equals(true)),\n *   then: 'Premium Support',\n * })\n *\n * // Nested conditionals\n * Conditional({\n *   when: Answer('tier').match(Condition.Equals('premium')),\n *   then: 'Premium',\n *   else: Conditional({\n *     when: Answer('tier').match(Condition.Equals('standard')),\n *     then: 'Standard',\n *     else: 'Basic',\n *   }),\n * })\n */\nexport const Conditional = (options: ConditionalOptions): ChainableConditional => {\n  const builder = new ConditionalExprBuilder(options.when).then(options.then)\n  const result = options.else !== undefined ? builder.else(options.else) : builder\n  stampCallsite(result, captureCallsite(Conditional))\n  return result\n}\n","import {\n  ConditionBranchExpr,\n  MatchExpr,\n  MatchBranch,\n  ResolvableValue,\n  TransformerFunctionExpr,\n} from '../types/expressions.type'\nimport { ExpressionBuilder } from './ExpressionBuilder'\nimport { ExpressionType } from '../types/enums'\nimport { ChainableExpr, BranchValue, ChainableMatch } from './types'\nimport { captureCallsite, stampCallsite } from './utils/captureCallsite'\n\n/**\n * Immutable fluent builder for creating match expressions.\n * Provides a flat alternative to deeply nested when().then().else() chains.\n * Branch conditions may be a single condition or a combinator tree of them,\n * with the subject applied to every condition leaf.\n * Each method returns a NEW instance, so partially-built matches\n * can be safely reused and forked.\n *\n * @internal Exposed to authors via the ChainableMatch interface.\n */\nexport class MatchExprBuilder implements ChainableMatch {\n  readonly nodeKind = 'forge-builder' as const\n\n  private readonly subject: ResolvableValue\n\n  private readonly branches: ReadonlyArray<MatchBranch>\n\n  private readonly otherwiseValue?: BranchValue\n\n  constructor(subject: ResolvableValue, branches: ReadonlyArray<MatchBranch> = [], otherwiseValue?: BranchValue) {\n    this.subject = subject\n    this.branches = branches\n    this.otherwiseValue = otherwiseValue\n  }\n\n  /**\n   * Adds a branch to the match expression.\n   * @param condition - The condition, or combinator tree of conditions, to test against the subject\n   * @param value - The value to return when this condition matches\n   * @returns A new builder with the branch appended\n   */\n  branch(condition: ConditionBranchExpr, value: BranchValue): MatchExprBuilder {\n    return new MatchExprBuilder(this.subject, [...this.branches, { condition, value }], this.otherwiseValue)\n  }\n\n  /** Adds an ordered case using native JavaScript strict equality. */\n  case(expected: ResolvableValue, value: BranchValue): MatchExprBuilder {\n    return new MatchExprBuilder(this.subject, [...this.branches, { expected, value }], this.otherwiseValue)\n  }\n\n  /**\n   * Sets the fallback value when no branch matches.\n   * @param value - The value to return when no branch condition matches\n   * @returns A new builder with the fallback set\n   */\n  otherwise(value: BranchValue): MatchExprBuilder {\n    return new MatchExprBuilder(this.subject, this.branches, value)\n  }\n\n  /** Transforms the selected branch value without evaluating unselected branches. */\n  pipe(...steps: TransformerFunctionExpr[]): ChainableExpr {\n    const callsite = captureCallsite(this.pipe)\n    const expression = this.build()\n    const builder = ExpressionBuilder.from(expression).pipe(...steps)\n\n    stampCallsite(expression, callsite)\n    stampCallsite(builder, callsite)\n\n    return builder\n  }\n\n  /** Uses the fallback only when the selected branch resolves to null or undefined. */\n  nullish(fallback: ResolvableValue | undefined): ChainableExpr {\n    const callsite = captureCallsite(this.nullish)\n    const expression = this.build()\n    const builder = ExpressionBuilder.from(expression).nullish(fallback)\n\n    stampCallsite(expression, callsite)\n    stampCallsite(builder, callsite)\n\n    return builder\n  }\n\n  /**\n   * Builds the final match expression.\n   * Note: This is private to hide its interface from the user, finaliseBuilders calls this\n   */\n\n  private build(): MatchExpr {\n    return {\n      type: ExpressionType.MATCH,\n      subject: this.subject,\n      branches: [...this.branches],\n      ...(this.otherwiseValue !== undefined && { otherwise: this.otherwiseValue }),\n    }\n  }\n}\n\n/**\n * Creates a match expression builder for the given subject.\n * Use this to create switch-like conditional logic with multiple branches.\n * Each branch takes a single condition or a combinator tree built with\n * and()/or()/xor()/not(); the subject is applied to every condition leaf.\n *\n * @param subject - The value to match against\n * @returns A chainable match for fluent branch building\n *\n * @example\n * match(Item().path('status'))\n *   .branch(Condition.Equals('NOT_STARTED'), 'Not started')\n *   .branch(Condition.Equals('IN_PROGRESS'), 'In progress')\n *   .branch(or(Condition.Equals('COMPLETED'), Condition.Equals('APPROVED')), 'Completed')\n *   .otherwise('Unknown')\n */\nexport const match = (subject: BranchValue): ChainableMatch => {\n  const builder = new MatchExprBuilder(subject)\n  stampCallsite(builder, captureCallsite(match))\n  return builder\n}\n","import {\n  ConditionBranchExpr,\n  ConditionAndExpr,\n  ConditionOrExpr,\n  ConditionXorExpr,\n  ConditionNotExpr,\n  PredicateExpr,\n  PredicateAndExpr,\n  PredicateOrExpr,\n  PredicateXorExpr,\n  PredicateNotExpr,\n} from '../types/expressions.type'\nimport { ConditionCombinatorType, FunctionType, PredicateType } from '../types/enums'\nimport { captureCallsite, stampCallsite } from './utils/captureCallsite'\nimport ForgeAuthoringError from '../../engine/errors/ForgeAuthoringError'\n\n/** A single operand of a combinator: a bare condition branch, or a predicate. */\ntype CombinatorOperand = ConditionBranchExpr | PredicateExpr\n\n/** Both call forms the AND, OR and XOR combinators accept: one array, or two or more operands. */\ntype CombinatorArgs = [CombinatorOperand[]] | [CombinatorOperand, CombinatorOperand, ...CombinatorOperand[]]\n\n/** The kind of operand a combinator was called with, which decides the node it builds. */\nenum OperandKind {\n  CONDITION = 'OperandKind.Condition',\n  PREDICATE = 'OperandKind.Predicate',\n}\n\ntype ClassifiedOperands =\n  | { kind: OperandKind.CONDITION; operands: ConditionBranchExpr[] }\n  | { kind: OperandKind.PREDICATE; operands: PredicateExpr[] }\n\nconst conditionCombinatorTypes = new Set<string>(Object.values(ConditionCombinatorType))\n\n/**\n * Identifies a bare condition branch - a condition function call, or a nested\n * condition combinator over them - as opposed to a predicate, which carries its own subject.\n */\nfunction isConditionBranch(operand: CombinatorOperand): operand is ConditionBranchExpr {\n  return operand.type === FunctionType.CONDITION || conditionCombinatorTypes.has(operand.type)\n}\n\n/**\n * Flattens the array and variadic call forms into a single operand list, and\n * classifies that list as bare conditions or as predicates.\n * @param fnName - The combinator's name, used in the mixed operand error\n * @param args - The arguments the combinator was called with, in either form\n * @returns The flattened operands, tagged with the kind they all share\n * @throws When conditions and predicates are mixed in one call, which the overloads\n * already rule out for TypeScript callers\n */\nfunction classifyOperands(fnName: string, args: CombinatorArgs): ClassifiedOperands {\n  const operands = Array.isArray(args[0]) && args.length === 1 ? args[0] : (args as CombinatorOperand[])\n  const conditions = operands.filter(isConditionBranch)\n  const predicates = operands.filter((operand): operand is PredicateExpr => !isConditionBranch(operand))\n\n  if (conditions.length === 0) {\n    return { kind: OperandKind.PREDICATE, operands: predicates }\n  }\n\n  if (predicates.length > 0) {\n    throw new ForgeAuthoringError({\n      message: `${fnName}() cannot mix bare conditions with predicates — conditions take their subject from the surrounding match`,\n    })\n  }\n\n  return { kind: OperandKind.CONDITION, operands: conditions }\n}\n\n/**\n * Creates an AND combination where all operands must be true.\n * Given predicates, returns an AND logic predicate.\n * Given bare conditions, or combinators over them, returns a subject-less AND\n * condition combinator, whose conditions take their subject from the surrounding match.\n * @param p - Two or more operands to combine, as one array or as separate arguments\n * @returns A logic predicate, or a condition combinator, that is true if all operands are true\n */\nexport function and(p: PredicateExpr[]): PredicateAndExpr\nexport function and(...p: [PredicateExpr, PredicateExpr, ...PredicateExpr[]]): PredicateAndExpr\nexport function and(c: ConditionBranchExpr[]): ConditionAndExpr\nexport function and(...c: [ConditionBranchExpr, ConditionBranchExpr, ...ConditionBranchExpr[]]): ConditionAndExpr\nexport function and(...args: CombinatorArgs): PredicateAndExpr | ConditionAndExpr {\n  const classified = classifyOperands('and', args)\n\n  const expr: PredicateAndExpr | ConditionAndExpr =\n    classified.kind === OperandKind.CONDITION\n      ? {\n          type: ConditionCombinatorType.AND,\n          operands: classified.operands as [ConditionBranchExpr, ConditionBranchExpr, ...ConditionBranchExpr[]],\n        }\n      : {\n          type: PredicateType.AND,\n          operands: classified.operands as [PredicateExpr, PredicateExpr, ...PredicateExpr[]],\n        }\n  stampCallsite(expr, captureCallsite(and))\n  return expr\n}\n\n/**\n * Creates an OR combination where at least one operand must be true.\n * Given predicates, returns an OR logic predicate.\n * Given bare conditions, or combinators over them, returns a subject-less OR\n * condition combinator, whose conditions take their subject from the surrounding match.\n * @param p - Two or more operands to combine, as one array or as separate arguments\n * @returns A logic predicate, or a condition combinator, that is true if any operand is true\n */\nexport function or(p: PredicateExpr[]): PredicateOrExpr\nexport function or(...p: [PredicateExpr, PredicateExpr, ...PredicateExpr[]]): PredicateOrExpr\nexport function or(c: ConditionBranchExpr[]): ConditionOrExpr\nexport function or(...c: [ConditionBranchExpr, ConditionBranchExpr, ...ConditionBranchExpr[]]): ConditionOrExpr\nexport function or(...args: CombinatorArgs): PredicateOrExpr | ConditionOrExpr {\n  const classified = classifyOperands('or', args)\n\n  const expr: PredicateOrExpr | ConditionOrExpr =\n    classified.kind === OperandKind.CONDITION\n      ? {\n          type: ConditionCombinatorType.OR,\n          operands: classified.operands as [ConditionBranchExpr, ConditionBranchExpr, ...ConditionBranchExpr[]],\n        }\n      : {\n          type: PredicateType.OR,\n          operands: classified.operands as [PredicateExpr, PredicateExpr, ...PredicateExpr[]],\n        }\n  stampCallsite(expr, captureCallsite(or))\n  return expr\n}\n\n/**\n * Creates an XOR combination where exactly one operand must be true.\n * Given predicates, returns an XOR logic predicate.\n * Given bare conditions, or combinators over them, returns a subject-less XOR\n * condition combinator, whose conditions take their subject from the surrounding match.\n * @param p - Two or more operands to combine, as one array or as separate arguments\n * @returns A logic predicate, or a condition combinator, that is true if exactly one operand is true\n */\nexport function xor(p: PredicateExpr[]): PredicateXorExpr\nexport function xor(...p: [PredicateExpr, PredicateExpr, ...PredicateExpr[]]): PredicateXorExpr\nexport function xor(c: ConditionBranchExpr[]): ConditionXorExpr\nexport function xor(...c: [ConditionBranchExpr, ConditionBranchExpr, ...ConditionBranchExpr[]]): ConditionXorExpr\nexport function xor(...args: CombinatorArgs): PredicateXorExpr | ConditionXorExpr {\n  const classified = classifyOperands('xor', args)\n\n  const expr: PredicateXorExpr | ConditionXorExpr =\n    classified.kind === OperandKind.CONDITION\n      ? {\n          type: ConditionCombinatorType.XOR,\n          operands: classified.operands as [ConditionBranchExpr, ConditionBranchExpr, ...ConditionBranchExpr[]],\n        }\n      : {\n          type: PredicateType.XOR,\n          operands: classified.operands as [PredicateExpr, PredicateExpr, ...PredicateExpr[]],\n        }\n  stampCallsite(expr, captureCallsite(xor))\n  return expr\n}\n\n/**\n * Creates a NOT combination that inverts the operand's result.\n * Given a predicate, returns a NOT logic predicate.\n * Given a bare condition, or a combinator over them, returns a subject-less NOT\n * condition combinator, whose conditions take their subject from the surrounding match.\n * @param p - The operand to negate\n * @returns A logic predicate, or a condition combinator, that is the opposite of the operand\n */\nexport function not(p: PredicateExpr): PredicateNotExpr\nexport function not(c: ConditionBranchExpr): ConditionNotExpr\nexport function not(operand: CombinatorOperand): PredicateNotExpr | ConditionNotExpr {\n  const expr: PredicateNotExpr | ConditionNotExpr = isConditionBranch(operand)\n    ? {\n        type: ConditionCombinatorType.NOT,\n        operand,\n      }\n    : {\n        type: PredicateType.NOT,\n        operand,\n      }\n  stampCallsite(expr, captureCallsite(not))\n  return expr\n}\n","import {\n  MapIteratorConfig,\n  FilterIteratorConfig,\n  FindIteratorConfig,\n  SomeIteratorConfig,\n  EveryIteratorConfig,\n  CountIteratorConfig,\n  PredicateExpr,\n} from '../types/expressions.type'\nimport { IteratorType } from '../types/enums'\nimport { captureCallsite, stampCallsite } from './utils/captureCallsite'\n\n/**\n * Iterator namespace containing factory functions for iterator configurations.\n *\n * Iterators are used with the .each() method to perform per-item operations on collections.\n * Unlike transformers which operate on the whole array, iterators enter per-item iteration\n * mode where Item() references are available.\n *\n * @example\n * // Map: Transform each item\n * Data('items').each(Iterator.Map(\n *   { label: Item().path('name'), value: Item().path('id') }\n * ))\n *\n * @example\n * // Filter: Keep matching items\n * Data('items').each(Iterator.Filter(\n *   Item().path('active').match(Condition.Equals(true))\n * ))\n *\n * @example\n * // Chain filter and map\n * Data('items')\n *   .each(Iterator.Filter(Item().path('active').match(Condition.Equals(true))))\n *   .each(Iterator.Map({ label: Item().path('name') }))\n */\nexport const Iterator = {\n  /**\n   * Create a Map iterator that transforms each item to a new shape.\n   *\n   * @param yieldValue - The template for each transformed item\n   * @returns MapIteratorConfig to use with .each()\n   *\n   * @example\n   * // Transform items to label/value pairs\n   * Iterator.Map({ label: Item().path('name'), value: Item().path('id') })\n   *\n   * @example\n   * // Extract a single property from each item\n   * Iterator.Map(Item().path('name'))\n   */\n  Map(yieldValue: unknown): MapIteratorConfig {\n    const config: MapIteratorConfig = {\n      type: IteratorType.MAP,\n      yield: yieldValue,\n    }\n    stampCallsite(config, captureCallsite(Iterator.Map))\n    return config\n  },\n\n  /**\n   * Create a Filter iterator that keeps items matching a predicate.\n   *\n   * @param predicate - Predicate expression using Item() references\n   * @returns FilterIteratorConfig to use with .each()\n   *\n   * @example\n   * // Keep only active items\n   * Iterator.Filter(Item().path('active').match(Condition.Equals(true)))\n   *\n   * @example\n   * // Exclude items matching a value\n   * Iterator.Filter(Item().path('slug').not.match(Condition.Equals(Params('currentSlug'))))\n   */\n  Filter(predicate: PredicateExpr): FilterIteratorConfig {\n    const config: FilterIteratorConfig = {\n      type: IteratorType.FILTER,\n      predicate,\n    }\n    stampCallsite(config, captureCallsite(Iterator.Filter))\n    return config\n  },\n\n  /**\n   * Create a Find iterator that returns the first item matching a predicate.\n   * Returns undefined if no match is found.\n   *\n   * @param predicate - Predicate expression using Item() references\n   * @returns FindIteratorConfig to use with .each()\n   *\n   * @example\n   * // Find user by ID\n   * Data('users').each(Iterator.Find(\n   *   Item().path('id').match(Condition.Equals(Params('userId')))\n   * ))\n   *\n   * @example\n   * // Find first active item\n   * Data('items').each(Iterator.Find(\n   *   Item().path('active').match(Condition.Equals(true))\n   * ))\n   */\n  Find(predicate: PredicateExpr): FindIteratorConfig {\n    const config: FindIteratorConfig = {\n      type: IteratorType.FIND,\n      predicate,\n    }\n    stampCallsite(config, captureCallsite(Iterator.Find))\n    return config\n  },\n  /** Returns whether any item matches; empty collections return false. */\n  Some(predicate: PredicateExpr): SomeIteratorConfig {\n    const config: SomeIteratorConfig = {\n      type: IteratorType.SOME,\n      predicate,\n    }\n\n    stampCallsite(config, captureCallsite(Iterator.Some))\n\n    return config\n  },\n\n  /** Returns whether every item matches; empty collections return true. */\n  Every(predicate: PredicateExpr): EveryIteratorConfig {\n    const config: EveryIteratorConfig = {\n      type: IteratorType.EVERY,\n      predicate,\n    }\n\n    stampCallsite(config, captureCallsite(Iterator.Every))\n\n    return config\n  },\n\n  /** Counts matching items; empty collections return zero. */\n  Count(predicate: PredicateExpr): CountIteratorConfig {\n    const config: CountIteratorConfig = {\n      type: IteratorType.COUNT,\n      predicate,\n    }\n\n    stampCallsite(config, captureCallsite(Iterator.Count))\n\n    return config\n  },\n\n}\n","import type { ConditionFunctionExpr, Resolvable } from '../types/expressions.type'\nimport { FunctionType } from '../types/enums'\nimport { BaseFunctionRegistry, CONDITION_OUTPUT_SCHEMA, type RegistrationOptions } from './BaseFunctionRegistry'\n\nexport default class ConditionRegistry<TDeps = Record<string, never>> extends BaseFunctionRegistry<TDeps> {\n  constructor() {\n    super(FunctionType.CONDITION, CONDITION_OUTPUT_SCHEMA)\n  }\n\n  register<TArgs extends any[]>(\n    name: string,\n    options: RegistrationOptions & {\n      factory: (deps: TDeps) => (value: any, ...args: TArgs) => boolean | PromiseLike<boolean>\n    },\n  ): (...args: { [K in keyof TArgs]: Resolvable<TArgs[K]> }) => ConditionFunctionExpr\n\n  register<TArgs extends any[]>(\n    name: string,\n    options: RegistrationOptions,\n    factory: (deps: TDeps) => (value: any, ...args: TArgs) => boolean | PromiseLike<boolean>,\n  ): (...args: { [K in keyof TArgs]: Resolvable<TArgs[K]> }) => ConditionFunctionExpr\n\n  register<TArgs extends any[]>(\n    name: string,\n    factory: (deps: TDeps) => (value: any, ...args: TArgs) => boolean | PromiseLike<boolean>,\n  ): (...args: { [K in keyof TArgs]: Resolvable<TArgs[K]> }) => ConditionFunctionExpr\n\n  register<TArgs extends any[]>(\n    options: RegistrationOptions,\n    factory: (deps: TDeps) => (value: any, ...args: TArgs) => boolean | PromiseLike<boolean>,\n  ): (...args: { [K in keyof TArgs]: Resolvable<TArgs[K]> }) => ConditionFunctionExpr\n\n  register<TArgs extends any[]>(\n    factory: (deps: TDeps) => (value: any, ...args: TArgs) => boolean | PromiseLike<boolean>,\n  ): (...args: { [K in keyof TArgs]: Resolvable<TArgs[K]> }) => ConditionFunctionExpr\n\n  register(\n    first: string | RegistrationOptions | ((deps: TDeps) => (...args: any[]) => any),\n    second?: RegistrationOptions | ((deps: TDeps) => (...args: any[]) => any),\n    third?: (deps: TDeps) => (...args: any[]) => any,\n  ): (...args: any[]) => ConditionFunctionExpr {\n    const { name, options, factory } = this.parseArgs(first, second, third)\n\n    this.store(name, options, factory)\n\n    return this.buildExpressionHandle(name, options.prepare) as any\n  }\n}\n","import ConditionRegistry from '../../../authoring/registries/ConditionRegistry'\n\nconst generalConditions = new ConditionRegistry()\n\nexport const GeneralConditions = {\n  /** Checks if a value is not empty/null/undefined */\n  IsRequired: generalConditions.register('IsRequired', {\n    factory: () => (value: unknown) =>\n      !(\n        value === null ||\n        value === undefined ||\n        (typeof value === 'string' && value.trim() === '') ||\n        (Array.isArray(value) && value.length === 0)\n      ),\n  }),\n\n  /** Checks if a value is strictly equal to an expected value */\n  Equals: generalConditions.register('Equals', {\n    factory: () => (value: unknown, expected: unknown) => value === expected,\n  }),\n}\n\nexport { generalConditions as generalConditionsRegistry }\n","import { z } from 'zod'\nimport ConditionRegistry from '../../../authoring/registries/ConditionRegistry'\n\nconst stringSchema = z.string()\nconst stringArgsSchema = z.tuple([z.string()])\nconst nonNegativeNumberArgsSchema = z.tuple([z.number().nonnegative()])\n\nconst stringConditions = new ConditionRegistry()\n\nexport const StringConditions = {\n  /** Checks if a string matches a regular expression pattern */\n  MatchesRegex: stringConditions.register('String.MatchesRegex', {\n    inputSchema: stringSchema,\n    argumentsSchema: stringArgsSchema,\n    factory: () => (value: string, pattern: string) => {\n      try {\n        return new RegExp(pattern).test(value)\n      } catch {\n        throw new Error(`Condition.String.MatchesRegex: Invalid regex pattern \"${pattern}\"`)\n      }\n    },\n  }),\n\n  /** Checks if a string has at least the minimum specified length */\n  HasMinLength: stringConditions.register('String.HasMinLength', {\n    inputSchema: stringSchema,\n    argumentsSchema: nonNegativeNumberArgsSchema,\n    factory: () => (value: string, min: number) => value.length >= min,\n  }),\n\n  /** Checks if a string does not exceed the maximum specified length */\n  HasMaxLength: stringConditions.register('String.HasMaxLength', {\n    inputSchema: stringSchema,\n    argumentsSchema: nonNegativeNumberArgsSchema,\n    factory: () => (value: string, max: number) => value.length <= max,\n  }),\n\n  /** Checks if a string has exactly the specified length */\n  HasExactLength: stringConditions.register('String.HasExactLength', {\n    inputSchema: stringSchema,\n    argumentsSchema: nonNegativeNumberArgsSchema,\n    factory: () => (value: string, len: number) => value.length === len,\n  }),\n\n  /** Checks if a string contains at most the specified number of words */\n  HasMaxWords: stringConditions.register('String.HasMaxWords', {\n    inputSchema: stringSchema,\n    argumentsSchema: nonNegativeNumberArgsSchema,\n    factory: () => (value: string, maxWords: number) => {\n      const trimmed = value.trim()\n\n      if (trimmed === '') {\n        return maxWords >= 0\n      }\n\n      return trimmed.split(/\\s+/).length <= maxWords\n    },\n  }),\n\n  /** Contains only letters (A-Z, a-z) */\n  LettersOnly: stringConditions.register('String.LettersOnly', {\n    inputSchema: stringSchema,\n    factory: () => (value: string) => /^[A-Za-z]+$/.test(value),\n  }),\n\n  /** Contains only digits (0-9) */\n  DigitsOnly: stringConditions.register('String.DigitsOnly', {\n    inputSchema: stringSchema,\n    factory: () => (value: string) => /^[0-9]+$/.test(value),\n  }),\n\n  /** Contains only letters and common punctuation */\n  LettersWithCommonPunctuation: stringConditions.register('String.LettersWithCommonPunctuation', {\n    inputSchema: stringSchema,\n    factory: () => (value: string) => /^[A-Za-z.,'\"()\\-!? ]+$/.test(value),\n  }),\n\n  /** Contains only letters, spaces, dashes, and apostrophes */\n  LettersWithSpaceDashApostrophe: stringConditions.register('String.LettersWithSpaceDashApostrophe', {\n    inputSchema: stringSchema,\n    factory: () => (value: string) => /^[A-Za-z\\s\\-']+$/.test(value),\n  }),\n\n  /** Contains only letters and digits (alphanumeric) */\n  LettersAndDigitsOnly: stringConditions.register('String.LettersAndDigitsOnly', {\n    inputSchema: stringSchema,\n    factory: () => (value: string) => /^[A-Za-z0-9]+$/.test(value),\n  }),\n\n  /** Contains only alphanumeric characters and common punctuation */\n  AlphanumericWithCommonPunctuation: stringConditions.register('String.AlphanumericWithCommonPunctuation', {\n    inputSchema: stringSchema,\n    factory: () => (value: string) => /^[A-Za-z0-9.,'\"()\\-!? ]+$/.test(value),\n  }),\n\n  /** Contains only alphanumeric characters and safe symbols */\n  AlphanumericWithAllSafeSymbols: stringConditions.register('String.AlphanumericWithAllSafeSymbols', {\n    inputSchema: stringSchema,\n    factory: () => (value: string) => /^[A-Za-z0-9 .,;:'\"()\\-!?@#$%^&*]+$/.test(value),\n  }),\n\n  /** Checks if a string starts with the specified prefix */\n  StartsWith: stringConditions.register('String.StartsWith', {\n    inputSchema: stringSchema,\n    argumentsSchema: stringArgsSchema,\n    factory: () => (value: string, prefix: string) => value.startsWith(prefix),\n  }),\n\n  /** Checks if a string ends with the specified suffix */\n  EndsWith: stringConditions.register('String.EndsWith', {\n    inputSchema: stringSchema,\n    argumentsSchema: stringArgsSchema,\n    factory: () => (value: string, suffix: string) => value.endsWith(suffix),\n  }),\n\n  /** Checks if a string contains the specified substring */\n  Contains: stringConditions.register('String.Contains', {\n    inputSchema: stringSchema,\n    argumentsSchema: stringArgsSchema,\n    factory: () => (value: string, substring: string) => value.includes(substring),\n  }),\n}\n\nexport { stringConditions as stringConditionsRegistry }\n","import { z } from 'zod'\nimport ConditionRegistry from '../../../authoring/registries/ConditionRegistry'\n\nconst addressConditions = new ConditionRegistry()\n\nexport const AddressConditions = {\n  /** Validates if a string is a valid UK postcode format */\n  IsValidPostcode: addressConditions.register('Address.IsValidPostcode', {\n    inputSchema: z.string(),\n    factory: () => (value: string) => /^([A-Z]{1,2}\\d[A-Z\\d]? ?\\d[A-Z]{2}| ?0A{2})$/i.test(value),\n  }),\n}\n\nexport { addressConditions as addressConditionsRegistry }\n","import { z } from 'zod'\nimport ConditionRegistry from '../../../authoring/registries/ConditionRegistry'\n\nconst emailConditions = new ConditionRegistry()\n\n// Domain labels use the unambiguous form `[a-z0-9](?:[a-z0-9-]*[a-z0-9])?` so any span\n// matches exactly one way - no nested overlapping quantifiers, so no catastrophic\n// backtracking. TLD is widened to the DNS label max (63) so real TLDs like `.engineering`\n// pass. Kept strict: the lookahead still rejects consecutive dots.\nconst emailRegex =\n  /^(?!.*\\.\\.)[a-z0-9_%+-](?:[a-z0-9._%+-]*[a-z0-9_%+-])?@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z]{2,63}$/i\n\n// RFC 5321 caps a full address at 254 characters. Rejecting anything longer before the\n// regex runs bounds the input the pattern ever sees.\nconst MAX_EMAIL_LENGTH = 254\n\nexport const EmailConditions = {\n  /** Validates if a string is a properly formatted email address */\n  IsValidEmail: emailConditions.register('Email.IsValidEmail', {\n    inputSchema: z.string(),\n    factory: () => (value: string) => {\n      if (value.length > MAX_EMAIL_LENGTH) {\n        return false\n      }\n\n      return emailRegex.test(value)\n    },\n  }),\n}\n\nexport { emailConditions as emailConditionsRegistry }\n","import { z } from 'zod'\nimport ConditionRegistry from '../../../authoring/registries/ConditionRegistry'\n\nfunction parseISODate(value: unknown): { year: number; month: number; day: number } | null {\n  if (typeof value !== 'string') {\n    return null\n  }\n\n  const dateMatch = value.match(/^(\\d{4})-(\\d{2})-(\\d{2})$/)\n  if (!dateMatch) {\n    return null\n  }\n\n  const year = parseInt(dateMatch[1], 10)\n  const month = parseInt(dateMatch[2], 10)\n  const day = parseInt(dateMatch[3], 10)\n\n  if (month < 1 || month > 12 || day < 1 || day > 31) {\n    return null\n  }\n\n  return { year, month, day }\n}\n\nconst stringSchema = z.string()\nconst stringArgsSchema = z.tuple([z.string()])\n\nconst dateConditions = new ConditionRegistry()\n\nexport const DateConditions = {\n  /** Checks if a value is a valid ISO-8601 date string (YYYY-MM-DD) */\n  IsValid: dateConditions.register('Date.IsValid', {\n    inputSchema: stringSchema,\n    factory: () => (value: string) => {\n      const parsed = parseISODate(value)\n      if (!parsed) {\n        return false\n      }\n\n      const date = new Date(parsed.year, parsed.month - 1, parsed.day)\n\n      return !Number.isNaN(date.getTime()) &&\n        date.getFullYear() === parsed.year &&\n        date.getMonth() === parsed.month - 1 &&\n        date.getDate() === parsed.day\n    },\n  }),\n\n  /** Validates if an ISO date string has a valid year component (1000-9999) */\n  IsValidYear: dateConditions.register('Date.IsValidYear', {\n    inputSchema: stringSchema,\n    factory: () => (value: string) => {\n      const parsed = parseISODate(value)\n      if (!parsed) {\n        return false\n      }\n\n      return parsed.year >= 1000 && parsed.year <= 9999\n    },\n  }),\n\n  /** Validates if an ISO date string has a valid month component (1-12) */\n  IsValidMonth: dateConditions.register('Date.IsValidMonth', {\n    inputSchema: stringSchema,\n    factory: () => (value: string) => {\n      const parsed = parseISODate(value)\n      if (!parsed) {\n        return false\n      }\n\n      return parsed.month >= 1 && parsed.month <= 12\n    },\n  }),\n\n  /** Validates if a date string has a valid day component for its specific month/year */\n  IsValidDay: dateConditions.register('Date.IsValidDay', {\n    inputSchema: stringSchema,\n    factory: () => (value: string) => {\n      const dateMatch = value.match(/^(\\d{4})-(\\d{2})-(\\d{2})$/)\n      if (!dateMatch) {\n        return false\n      }\n\n      const year = parseInt(dateMatch[1], 10)\n      const month = parseInt(dateMatch[2], 10)\n      const day = parseInt(dateMatch[3], 10)\n\n      if (month < 1 || month > 12) {\n        return false\n      }\n\n      const daysInMonth = new Date(year, month, 0).getDate()\n\n      return day >= 1 && day <= daysInMonth\n    },\n  }),\n\n  /** Checks if an ISO date string is before another ISO date string */\n  IsBefore: dateConditions.register('Date.IsBefore', {\n    inputSchema: stringSchema,\n    argumentsSchema: stringArgsSchema,\n    factory: () => (value: string, dateStr: string) => {\n      const valueParsed = parseISODate(value)\n      const compareParsed = parseISODate(dateStr)\n\n      if (!valueParsed) {\n        throw new Error(`Condition.Date.IsBefore: Invalid date string \"${value}\"`)\n      }\n      if (!compareParsed) {\n        throw new Error(`Condition.Date.IsBefore: Invalid comparison date string \"${dateStr}\"`)\n      }\n\n      const valueDate = new Date(valueParsed.year, valueParsed.month - 1, valueParsed.day)\n      const compareDate = new Date(compareParsed.year, compareParsed.month - 1, compareParsed.day)\n\n      return valueDate < compareDate\n    },\n  }),\n\n  /** Checks if an ISO date string is after another ISO date string */\n  IsAfter: dateConditions.register('Date.IsAfter', {\n    inputSchema: stringSchema,\n    argumentsSchema: stringArgsSchema,\n    factory: () => (value: string, dateStr: string) => {\n      const valueParsed = parseISODate(value)\n      if (!valueParsed) {\n        throw new Error(`Condition.Date.IsAfter: Invalid date string \"${value}\"`)\n      }\n\n      const compareParsed = parseISODate(dateStr)\n      if (!compareParsed) {\n        throw new Error(`Condition.Date.IsAfter: Invalid comparison date string \"${dateStr}\"`)\n      }\n\n      const valueDate = new Date(valueParsed.year, valueParsed.month - 1, valueParsed.day)\n      const compareDate = new Date(compareParsed.year, compareParsed.month - 1, compareParsed.day)\n\n      return valueDate > compareDate\n    },\n  }),\n\n  /** Checks if an ISO date string is in the future (after today) */\n  IsFutureDate: dateConditions.register('Date.IsFutureDate', {\n    inputSchema: stringSchema,\n    factory: () => (value: string) => {\n      const parsed = parseISODate(value)\n      if (!parsed) {\n        throw new Error(`Condition.Date.IsFutureDate: Invalid date string \"${value}\"`)\n      }\n\n      const valueDate = new Date(Date.UTC(parsed.year, parsed.month - 1, parsed.day))\n      const today = new Date()\n      const todayUTC = new Date(Date.UTC(today.getUTCFullYear(), today.getUTCMonth(), today.getUTCDate()))\n\n      return valueDate > todayUTC\n    },\n  }),\n\n  /** Checks if an ISO date string is in the past (before today) */\n  IsPastDate: dateConditions.register('Date.IsPastDate', {\n    inputSchema: stringSchema,\n    factory: () => (value: string) => {\n      const parsed = parseISODate(value)\n      if (!parsed) {\n        throw new Error(`Condition.Date.IsPastDate: Invalid date string \"${value}\"`)\n      }\n\n      const valueDate = new Date(Date.UTC(parsed.year, parsed.month - 1, parsed.day))\n      const today = new Date()\n      const todayUTC = new Date(Date.UTC(today.getUTCFullYear(), today.getUTCMonth(), today.getUTCDate()))\n\n      return valueDate < todayUTC\n    },\n  }),\n\n  /** Checks if an ISO date string is today */\n  IsToday: dateConditions.register('Date.IsToday', {\n    inputSchema: stringSchema,\n    factory: () => (value: string) => {\n      const parsed = parseISODate(value)\n      if (!parsed) {\n        throw new Error(`Condition.Date.IsToday: Invalid date string \"${value}\"`)\n      }\n\n      const valueDate = new Date(Date.UTC(parsed.year, parsed.month - 1, parsed.day))\n      const today = new Date()\n      const todayUTC = new Date(Date.UTC(today.getUTCFullYear(), today.getUTCMonth(), today.getUTCDate()))\n\n      return valueDate.getTime() === todayUTC.getTime()\n    },\n  }),\n}\n\nexport { dateConditions as dateConditionsRegistry }\n","import { z } from 'zod'\nimport ConditionRegistry from '../../../authoring/registries/ConditionRegistry'\n\nconst numberSchema = z.number()\nconst numberArgsSchema = z.tuple([z.number()])\nconst numberRangeArgsSchema = z.tuple([z.number(), z.number()])\n\nconst numberConditions = new ConditionRegistry()\n\nexport const NumberConditions = {\n  /** Checks if a value is a number (not NaN, not a string, not undefined) */\n  IsNumber: numberConditions.register('Number.IsNumber', {\n    factory: () => (value: unknown) => typeof value === 'number' && !Number.isNaN(value),\n  }),\n\n  /** Checks if a value is an integer (whole number) */\n  IsInteger: numberConditions.register('Number.IsInteger', {\n    factory: () => (value: unknown) => typeof value === 'number' && !Number.isNaN(value) && Number.isInteger(value),\n  }),\n\n  /** Checks if a number is greater than a threshold value */\n  GreaterThan: numberConditions.register('Number.GreaterThan', {\n    inputSchema: numberSchema,\n    argumentsSchema: numberArgsSchema,\n    factory: () => (value: number, threshold: number) => value > threshold,\n  }),\n\n  /** Checks if a number is greater than or equal to a threshold value */\n  GreaterThanOrEqual: numberConditions.register('Number.GreaterThanOrEqual', {\n    inputSchema: numberSchema,\n    argumentsSchema: numberArgsSchema,\n    factory: () => (value: number, threshold: number) => value >= threshold,\n  }),\n\n  /** Checks if a number is less than a threshold value */\n  LessThan: numberConditions.register('Number.LessThan', {\n    inputSchema: numberSchema,\n    argumentsSchema: numberArgsSchema,\n    factory: () => (value: number, threshold: number) => value < threshold,\n  }),\n\n  /** Checks if a number is less than or equal to a threshold value */\n  LessThanOrEqual: numberConditions.register('Number.LessThanOrEqual', {\n    inputSchema: numberSchema,\n    argumentsSchema: numberArgsSchema,\n    factory: () => (value: number, threshold: number) => value <= threshold,\n  }),\n\n  /** Checks if a number is between two values (inclusive) */\n  Between: numberConditions.register('Number.Between', {\n    inputSchema: numberSchema,\n    argumentsSchema: numberRangeArgsSchema,\n    factory: () => (value: number, min: number, max: number) => value >= min && value <= max,\n  }),\n}\n\nexport { numberConditions as numberConditionsRegistry }\n","import { z } from 'zod'\nimport ConditionRegistry from '../../../authoring/registries/ConditionRegistry'\n\nconst phoneConditions = new ConditionRegistry()\n\nexport const PhoneConditions = {\n  /** Validates if a string is a valid phone number format (7-20 digits) */\n  IsValidPhoneNumber: phoneConditions.register('Phone.IsValidPhoneNumber', {\n    inputSchema: z.string(),\n    factory: () => (value: string) => /^\\+?[0-9\\s().-]{7,20}$/.test(value),\n  }),\n\n  /** Validates if a string is a valid UK mobile phone number */\n  IsValidUKMobile: phoneConditions.register('Phone.IsValidUKMobile', {\n    inputSchema: z.string(),\n    factory: () => (value: string) => /^(\\+44\\s?7\\d{3}|\\(?07\\d{3}\\)?)\\s?\\d{3}\\s?\\d{3}$/.test(value),\n  }),\n}\n\nexport { phoneConditions as phoneConditionsRegistry }\n","import { z } from 'zod'\nimport ConditionRegistry from '../../../authoring/registries/ConditionRegistry'\n\nconst arraySchema = z.array(z.unknown())\nconst arrayArgsSchema = z.tuple([z.array(z.unknown())])\n\nconst arrayConditions = new ConditionRegistry()\n\nexport const ArrayConditions = {\n  /** Checks if a value is an array */\n  IsArray: arrayConditions.register('Array.IsArray', { factory: () => (value: unknown) => Array.isArray(value) }),\n\n  /** Checks if a value exists within an array of options */\n  IsIn: arrayConditions.register('Array.IsIn', {\n    argumentsSchema: arrayArgsSchema,\n    factory: () => (value: unknown, expected: unknown[]) => expected.some(item => item === value),\n  }),\n\n  /** Checks if an array contains a specific value */\n  Contains: arrayConditions.register('Array.Contains', {\n    inputSchema: arraySchema,\n    factory: () => (value: unknown[], expected: unknown) => value.includes(expected),\n  }),\n\n  /** Checks if an array contains any of the items from another array */\n  ContainsAny: arrayConditions.register('Array.ContainsAny', {\n    inputSchema: arraySchema,\n    argumentsSchema: arrayArgsSchema,\n    factory: () => (value: unknown[], expected: unknown[]) => {\n      if (value.length === 0 && expected.length === 0) {\n        return true\n      }\n\n      return expected.some(item => value.includes(item))\n    },\n  }),\n\n  /** Checks if all items in the value array exist in the expected array */\n  ContainsAll: arrayConditions.register('Array.ContainsAll', {\n    inputSchema: arraySchema,\n    argumentsSchema: arrayArgsSchema,\n    factory: () => (value: unknown[], expected: unknown[]) => {\n      if (value.length === 0 && expected.length === 0) {\n        return true\n      }\n\n      return value.every(item => expected.includes(item))\n    },\n  }),\n}\n\nexport { arrayConditions as arrayConditionsRegistry }\n","import { z } from 'zod'\nimport ConditionRegistry from '../../../authoring/registries/ConditionRegistry'\n\n/** Gets a value from an object using a dot-notation path (e.g. 'user.profile.name') */\nfunction getByPath(obj: unknown, path: string): unknown {\n  if (obj == null) {\n    return undefined\n  }\n\n  if (path === '') {\n    return obj\n  }\n\n  return path.split('.').reduce<unknown>((current, key) => {\n    if (current == null || typeof current !== 'object') {\n      return undefined\n    }\n\n    return (current as Record<string, unknown>)[key]\n  }, obj)\n}\n\nconst isEmpty = (value: unknown): boolean =>\n  value === null || value === undefined || (typeof value === 'string' && value.trim() === '')\n\nconst objectSchema = z.custom<Record<string, unknown>>(v => v !== null && typeof v === 'object' && !Array.isArray(v))\nconst stringArgsSchema = z.tuple([z.string()])\n\nconst objectConditions = new ConditionRegistry()\n\nexport const ObjectConditions = {\n  /** Checks if a value is a plain object (not null, not array) */\n  IsObject: objectConditions.register('Object.IsObject', {\n    factory: () => (value: unknown) => value !== null && typeof value === 'object' && !Array.isArray(value),\n  }),\n\n  /** Checks if an object has a property at the given path */\n  HasProperty: objectConditions.register('Object.HasProperty', {\n    inputSchema: objectSchema,\n    argumentsSchema: stringArgsSchema,\n    factory: () => (value: unknown, path: string) => getByPath(value, path) !== undefined,\n  }),\n\n  /** Checks if an object property at the given path is empty */\n  PropertyIsEmpty: objectConditions.register('Object.PropertyIsEmpty', {\n    inputSchema: objectSchema,\n    argumentsSchema: stringArgsSchema,\n    factory: () => (value: unknown, path: string) => isEmpty(getByPath(value, path)),\n  }),\n\n  /** Checks if an object property at the given path has a value (not empty) */\n  PropertyHasValue: objectConditions.register('Object.PropertyHasValue', {\n    inputSchema: objectSchema,\n    argumentsSchema: stringArgsSchema,\n    factory: () => (value: unknown, path: string) => !isEmpty(getByPath(value, path)),\n  }),\n}\n\nexport { objectConditions as objectConditionsRegistry }\n","import { GeneralConditions, generalConditionsRegistry } from './generalConditions'\nimport { StringConditions, stringConditionsRegistry } from './stringConditions'\nimport { AddressConditions, addressConditionsRegistry } from './addressConditions'\nimport { EmailConditions, emailConditionsRegistry } from './emailConditions'\nimport { DateConditions, dateConditionsRegistry } from './dateConditions'\nimport { NumberConditions, numberConditionsRegistry } from './numberConditions'\nimport { PhoneConditions, phoneConditionsRegistry } from './phoneConditions'\nimport { ArrayConditions, arrayConditionsRegistry } from './arrayConditions'\nimport { ObjectConditions, objectConditionsRegistry } from './objectConditions'\n\n// TypeScript declaration emit drops JSDoc when it structurally expands a type\n// imported from another file, so the built .d.ts would lose every per-function\n// doc comment. Annotating with `typeof` references makes the emitter print a\n// reference instead of expanding, keeping the docs on each group's own declaration.\ninterface ConditionGroups {\n  /** Conditions for handling strings */\n  String: typeof StringConditions\n\n  /** Conditions for handling emails */\n  Email: typeof EmailConditions\n\n  /** Conditions for handling phone/mobile numbers */\n  Phone: typeof PhoneConditions\n\n  /** Conditions for handling addresses */\n  Address: typeof AddressConditions\n\n  /** Conditions for handling dates */\n  Date: typeof DateConditions\n\n  /** Conditions for handling numbers */\n  Number: typeof NumberConditions\n\n  /** Conditions for handling arrays */\n  Array: typeof ArrayConditions\n\n  /** Conditions for handling objects */\n  Object: typeof ObjectConditions\n}\n\nexport const Condition: typeof GeneralConditions & ConditionGroups = {\n  ...GeneralConditions,\n\n  /** Conditions for handling strings */\n  String: StringConditions,\n\n  /** Conditions for handling emails */\n  Email: EmailConditions,\n\n  /** Conditions for handling phone/mobile numbers */\n  Phone: PhoneConditions,\n\n  /** Conditions for handling addresses */\n  Address: AddressConditions,\n\n  /** Conditions for handling dates */\n  Date: DateConditions,\n\n  /** Conditions for handling numbers */\n  Number: NumberConditions,\n\n  /** Conditions for handling arrays */\n  Array: ArrayConditions,\n\n  /** Conditions for handling objects */\n  Object: ObjectConditions,\n}\n\nexport const ConditionsRegistry = {\n  ...generalConditionsRegistry.build(),\n  ...stringConditionsRegistry.build(),\n  ...emailConditionsRegistry.build(),\n  ...phoneConditionsRegistry.build(),\n  ...addressConditionsRegistry.build(),\n  ...dateConditionsRegistry.build(),\n  ...numberConditionsRegistry.build(),\n  ...arrayConditionsRegistry.build(),\n  ...objectConditionsRegistry.build(),\n}\n","import { z } from 'zod'\nimport GeneratorRegistry from '../../../authoring/registries/GeneratorRegistry'\n\nconst noArgsSchema = z.tuple([])\n\nconst dateGenerators = new GeneratorRegistry()\n\nexport const DateGenerators = {\n  /** Generates the current date and time */\n  Now: dateGenerators.register('Date.Now', {\n    argumentsSchema: noArgsSchema,\n    factory: () => () => new Date(),\n  }),\n\n  /** Generates today's date at midnight */\n  Today: dateGenerators.register('Date.Today', {\n    argumentsSchema: noArgsSchema,\n    factory: () => () => {\n      const now = new Date()\n\n      return new Date(now.getFullYear(), now.getMonth(), now.getDate())\n    },\n  }),\n}\n\nexport { dateGenerators as dateGeneratorsRegistry }\n","import { DateGenerators, dateGeneratorsRegistry } from './dateGenerators'\nimport { FormatGenerators, formatGeneratorsRegistry } from './formatGenerators'\n\n// TypeScript declaration emit drops JSDoc when it structurally expands a type\n// imported from another file, so the built .d.ts would lose every per-function\n// doc comment. Annotating with `typeof` references makes the emitter print a\n// reference instead of expanding, keeping the docs on each group's own declaration.\ninterface GeneratorGroups {\n  /** Generators for producing formatted string values */\n  FormatString: typeof FormatGenerators.FormatString\n\n  /** Generators for producing date values */\n  Date: typeof DateGenerators\n}\n\nexport const Generator: GeneratorGroups = {\n  /** Generators for producing formatted string values */\n  FormatString: FormatGenerators.FormatString,\n\n  /** Generators for producing date values */\n  Date: DateGenerators,\n}\n\nexport const GeneratorsRegistry = {\n  ...formatGeneratorsRegistry.build(),\n  ...dateGeneratorsRegistry.build(),\n}\n","import type { Resolvable, TransformerFunctionExpr } from '../types/expressions.type'\nimport { FunctionType } from '../types/enums'\nimport { BaseFunctionRegistry, type RegistrationOptions } from './BaseFunctionRegistry'\n\nexport default class TransformerRegistry<TDeps = Record<string, never>> extends BaseFunctionRegistry<TDeps> {\n  constructor() {\n    super(FunctionType.TRANSFORMER)\n  }\n\n  register<TArgs extends any[]>(\n    name: string,\n    options: RegistrationOptions & { factory: (deps: TDeps) => (value: any, ...args: TArgs) => any },\n  ): (...args: { [K in keyof TArgs]: Resolvable<TArgs[K]> }) => TransformerFunctionExpr\n\n  register<TArgs extends any[]>(\n    name: string,\n    options: RegistrationOptions,\n    factory: (deps: TDeps) => (value: any, ...args: TArgs) => any,\n  ): (...args: { [K in keyof TArgs]: Resolvable<TArgs[K]> }) => TransformerFunctionExpr\n\n  register<TArgs extends any[]>(\n    name: string,\n    factory: (deps: TDeps) => (value: any, ...args: TArgs) => any,\n  ): (...args: { [K in keyof TArgs]: Resolvable<TArgs[K]> }) => TransformerFunctionExpr\n\n  register<TArgs extends any[]>(\n    options: RegistrationOptions,\n    factory: (deps: TDeps) => (value: any, ...args: TArgs) => any,\n  ): (...args: { [K in keyof TArgs]: Resolvable<TArgs[K]> }) => TransformerFunctionExpr\n\n  register<TArgs extends any[]>(\n    factory: (deps: TDeps) => (value: any, ...args: TArgs) => any,\n  ): (...args: { [K in keyof TArgs]: Resolvable<TArgs[K]> }) => TransformerFunctionExpr\n\n  register(\n    first: string | RegistrationOptions | ((deps: TDeps) => (...args: any[]) => any),\n    second?: RegistrationOptions | ((deps: TDeps) => (...args: any[]) => any),\n    third?: (deps: TDeps) => (...args: any[]) => any,\n  ): (...args: any[]) => TransformerFunctionExpr {\n    const { name, options, factory } = this.parseArgs(first, second, third)\n\n    this.store(name, options, factory)\n\n    return this.buildExpressionHandle(name, options.prepare) as any\n  }\n}\n","import { z } from 'zod'\nimport TransformerRegistry from '../../../authoring/registries/TransformerRegistry'\n\nconst arraySchema = z.array(z.unknown())\n\nconst arrayTransformers = new TransformerRegistry()\n\nexport const ArrayTransformers = {\n  /**\n   * Returns the length of the array\n   * @example\n   * // Length() applied to [1, 2, 3, 4] returns 4\n   */\n  Length: arrayTransformers.register('Array.Length', {\n    inputSchema: arraySchema,\n    factory: () => (value: unknown[]) => value.length,\n  }),\n\n  /**\n   * Returns the first element of the array\n   * @example\n   * // First() applied to [1, 2, 3] returns 1\n   */\n  First: arrayTransformers.register('Array.First', {\n    inputSchema: arraySchema,\n    factory: () => (value: unknown[]) => (value.length > 0 ? value[0] : undefined),\n  }),\n\n  /**\n   * Returns the last element of the array\n   * @example\n   * // Last() applied to [1, 2, 3] returns 3\n   */\n  Last: arrayTransformers.register('Array.Last', {\n    inputSchema: arraySchema,\n    factory: () => (value: unknown[]) => (value.length > 0 ? value[value.length - 1] : undefined),\n  }),\n\n  /**\n   * Reverses the array (returns a new array)\n   * @example\n   * // Reverse() applied to [1, 2, 3] returns [3, 2, 1]\n   */\n  Reverse: arrayTransformers.register('Array.Reverse', {\n    inputSchema: arraySchema,\n    factory: () => (value: unknown[]) => [...value].reverse(),\n  }),\n\n  /**\n   * Joins array elements into a string with specified separator\n   * @param separator - Separator to place between elements (defaults to ',')\n   * @example\n   * // Join(\", \") applied to [1, 2, 3] returns \"1, 2, 3\"\n   */\n  Join: arrayTransformers.register('Array.Join', {\n    inputSchema: arraySchema,\n    argumentsSchema: z.tuple([z.string().optional()]),\n    factory:\n      () =>\n      (value: unknown[], separator: string = ',') =>\n        value.join(separator),\n  }),\n\n  /**\n   * Returns a slice of the array from start to end index\n   * @param start - The zero-based index at which to begin extraction\n   * @param end - The zero-based index before which to end extraction (optional)\n   * @example\n   * // Slice(1, 4) applied to [1, 2, 3, 4, 5] returns [2, 3, 4]\n   */\n  Slice: arrayTransformers.register('Array.Slice', {\n    inputSchema: arraySchema,\n    argumentsSchema: z.tuple([z.number(), z.number().optional()]),\n    factory: () => (value: unknown[], start: number, end?: number) => value.slice(start, end),\n  }),\n\n  /**\n   * Concatenates arrays together\n   * @param arrays - Additional arrays to concatenate to the input\n   * @example\n   * // Concat([3, 4]) applied to [1, 2] returns [1, 2, 3, 4]\n   */\n  Concat: arrayTransformers.register('Array.Concat', {\n    inputSchema: arraySchema,\n    argumentsSchema: z.tuple([z.array(z.unknown())], z.array(z.unknown())),\n    factory:\n      () =>\n      (value: unknown[], ...arrays: unknown[][]) =>\n        value.concat(...arrays),\n  }),\n\n  /**\n   * Returns unique elements from the array (removes duplicates)\n   * @example\n   * // Unique() applied to [1, 2, 2, 3, 1] returns [1, 2, 3]\n   */\n  Unique: arrayTransformers.register('Array.Unique', {\n    inputSchema: arraySchema,\n    factory: () => (value: unknown[]) => [...new Set(value)],\n  }),\n\n  /**\n   * Sorts the array in ascending order (returns a new array)\n   * @example\n   * // Sort() applied to [3, 1, 4, 2] returns [1, 2, 3, 4]\n   */\n  Sort: arrayTransformers.register('Array.Sort', {\n    inputSchema: arraySchema,\n    factory: () => (value: unknown[]) =>\n      [...value].sort((a, b) => {\n        if (typeof a === 'number' && typeof b === 'number') {\n          return a - b\n        }\n\n        return String(a).localeCompare(String(b))\n      }),\n  }),\n\n  /**\n   * Filters the array to only include elements that match the specified value\n   * @param filterValue - The value each element is compared against\n   * @example\n   * // Filter(2) applied to [1, 2, 2, 3] returns [2, 2]\n   */\n  Filter: arrayTransformers.register('Array.Filter', {\n    inputSchema: arraySchema,\n    argumentsSchema: z.tuple([z.unknown()]),\n    factory: () => (value: unknown[], filterValue: unknown) => value.filter(item => item === filterValue),\n  }),\n\n  /**\n   * Maps each array element by extracting a property (for objects) or applying an index (for arrays)\n   * @param property - The property name (for objects) or index (for nested arrays) to extract\n   * @example\n   * // Map('name') applied to [{name: 'John'}, {name: 'Jane'}] returns ['John', 'Jane']\n   * // Map(0) applied to [[1, 2], [3, 4]] returns [1, 3]\n   */\n  Map: arrayTransformers.register('Array.Map', {\n    inputSchema: arraySchema,\n    argumentsSchema: z.tuple([z.union([z.string(), z.number()])]),\n    factory: () => (value: unknown[], property: string | number) =>\n      value.map(item => {\n        if (typeof property === 'number' && Array.isArray(item)) {\n          return item[property]\n        }\n\n        if (typeof property === 'string' && typeof item === 'object' && item !== null) {\n          return (item as Record<string, unknown>)[property]\n        }\n\n        return undefined\n      }),\n  }),\n\n  /**\n   * Flattens a nested array by one level\n   * @example\n   * // Flatten() applied to [[1, 2], [3, 4]] returns [1, 2, 3, 4]\n   */\n  Flatten: arrayTransformers.register('Array.Flatten', {\n    inputSchema: arraySchema,\n    factory: () => (value: unknown[]) => value.flat(),\n  }),\n}\n\nexport { arrayTransformers as arrayTransformersRegistry }\n","import { z } from 'zod'\nimport TransformerRegistry from '../../../authoring/registries/TransformerRegistry'\n\nconst formatDate = (date: Date, format: string): string => {\n  const monthNames = [\n    'January',\n    'February',\n    'March',\n    'April',\n    'May',\n    'June',\n    'July',\n    'August',\n    'September',\n    'October',\n    'November',\n    'December',\n  ]\n\n  const getOrdinal = (n: number): string => {\n    const remainder10 = n % 10\n    const remainder100 = n % 100\n\n    if (remainder100 >= 11 && remainder100 <= 13) return `${n}th`\n    if (remainder10 === 1) return `${n}st`\n    if (remainder10 === 2) return `${n}nd`\n    if (remainder10 === 3) return `${n}rd`\n    return `${n}th`\n  }\n\n  const tokens: Record<string, () => string> = {\n    YYYY: () => String(date.getFullYear()),\n    YY: () => String(date.getFullYear()).slice(-2),\n    MMMM: () => monthNames[date.getMonth()],\n    MM: () => String(date.getMonth() + 1).padStart(2, '0'),\n    M: () => String(date.getMonth() + 1),\n    DD: () => String(date.getDate()).padStart(2, '0'),\n    Do: () => getOrdinal(date.getDate()),\n    D: () => String(date.getDate()),\n    HH: () => String(date.getHours()).padStart(2, '0'),\n    H: () => String(date.getHours()),\n    mm: () => String(date.getMinutes()).padStart(2, '0'),\n    m: () => String(date.getMinutes()),\n    ss: () => String(date.getSeconds()).padStart(2, '0'),\n    s: () => String(date.getSeconds()),\n  }\n\n  // Sort by length descending so longer tokens match first (YYYY before YY)\n  const tokenPattern = Object.keys(tokens)\n    .sort((a, b) => b.length - a.length)\n    .join('|')\n\n  return format.replace(new RegExp(tokenPattern, 'g'), match => tokens[match]())\n}\n\nconst dateSchema = z.date()\nconst stringArgsSchema = z.tuple([z.string()])\nconst numberArgsSchema = z.tuple([z.number()])\nconst optionalStringArgsSchema = z.tuple([z.string().optional()])\n\nconst dateTransformers = new TransformerRegistry()\n\nexport const DateTransformers = {\n  /**\n   * Formats a Date object into a string using the specified format\n   *\n   * Supported tokens:\n   * - YYYY: 4-digit year (2024)\n   * - YY: 2-digit year (24)\n   * - MMMM: Full month name (January, February, March, etc.)\n   * - MM: 2-digit month (01-12)\n   * - M: Month (1-12)\n   * - DD: 2-digit day (01-31)\n   * - Do: Day of month (1st, 2nd, 3rd, etc.)\n   * - D: Day (1-31)\n   * - HH: 2-digit hours (00-23)\n   * - H: Hours (0-23)\n   * - mm: 2-digit minutes (00-59)\n   * - m: Minutes (0-59)\n   * - ss: 2-digit seconds (00-59)\n   * - s: Seconds (0-59)\n   *\n   * @param format - Format string using the supported tokens\n   * @example\n   * // Format(\"DD/MM/YYYY\") returns \"15/03/2024\"\n   * // Format(\"YYYY-MM-DD\") returns \"2024-03-15\"\n   * // Format(\"D M YYYY\") returns \"15 3 2024\"\n   * // Format(\"HH:mm:ss\") returns \"14:30:45\"\n   */\n  Format: dateTransformers.register('Date.Format', {\n    inputSchema: dateSchema,\n    argumentsSchema: stringArgsSchema,\n    factory: () => (value: Date, format: string) => formatDate(value, format),\n  }),\n\n  /**\n   * Adds a number of days to a Date\n   * @param days - Number of days to add (negative values subtract)\n   * @example\n   * // AddDays(7) adds one week\n   * // AddDays(-1) subtracts one day\n   */\n  AddDays: dateTransformers.register('Date.AddDays', {\n    inputSchema: dateSchema,\n    argumentsSchema: numberArgsSchema,\n    factory: () => (value: Date, days: number) => {\n      const result = new Date(value)\n      result.setDate(result.getDate() + days)\n\n      return result\n    },\n  }),\n\n  /**\n   * Subtracts a number of days from a Date\n   * @param days - Number of days to subtract\n   * @example\n   * // SubtractDays(7) subtracts one week\n   */\n  SubtractDays: dateTransformers.register('Date.SubtractDays', {\n    inputSchema: dateSchema,\n    argumentsSchema: numberArgsSchema,\n    factory: () => (value: Date, days: number) => {\n      const result = new Date(value)\n      result.setDate(result.getDate() - days)\n\n      return result\n    },\n  }),\n\n  /**\n   * Adds a number of months to a Date\n   * @param months - Number of months to add (negative values subtract)\n   * @example\n   * // AddMonths(1) adds one month\n   * // AddMonths(-6) subtracts 6 months\n   */\n  AddMonths: dateTransformers.register('Date.AddMonths', {\n    inputSchema: dateSchema,\n    argumentsSchema: numberArgsSchema,\n    factory: () => (value: Date, months: number) => {\n      const result = new Date(value)\n      result.setMonth(result.getMonth() + months)\n\n      return result\n    },\n  }),\n\n  /**\n   * Adds a number of years to a Date\n   * @param years - Number of years to add (negative values subtract)\n   * @example\n   * // AddYears(1) adds one year\n   * // AddYears(-18) subtracts 18 years\n   */\n  AddYears: dateTransformers.register('Date.AddYears', {\n    inputSchema: dateSchema,\n    argumentsSchema: numberArgsSchema,\n    factory: () => (value: Date, years: number) => {\n      const result = new Date(value)\n      result.setFullYear(result.getFullYear() + years)\n\n      return result\n    },\n  }),\n\n  /**\n   * Returns the start of the day (midnight) for a Date\n   * @example\n   * // StartOfDay() returns 2024-03-15T00:00:00.000\n   */\n  StartOfDay: dateTransformers.register('Date.StartOfDay', {\n    inputSchema: dateSchema,\n    factory: () => (value: Date) => {\n      const result = new Date(value)\n      result.setHours(0, 0, 0, 0)\n\n      return result\n    },\n  }),\n\n  /**\n   * Returns the end of the day (23:59:59.999) for a Date\n   * @example\n   * // EndOfDay() returns 2024-03-15T23:59:59.999\n   */\n  EndOfDay: dateTransformers.register('Date.EndOfDay', {\n    inputSchema: dateSchema,\n    factory: () => (value: Date) => {\n      const result = new Date(value)\n      result.setHours(23, 59, 59, 999)\n\n      return result\n    },\n  }),\n\n  /**\n   * Converts a Date to ISO-8601 string format\n   * @example\n   * // ToISOString() returns \"2024-03-15T14:30:45.123Z\"\n   */\n  ToISOString: dateTransformers.register('Date.ToISOString', {\n    inputSchema: dateSchema,\n    factory: () => (value: Date) => value.toISOString(),\n  }),\n\n  /**\n   * Converts a Date to a locale-specific string\n   * @param locale - Optional locale identifier (e.g. 'en-GB', 'en-US')\n   * @example\n   * // ToLocaleString() returns \"15/03/2024, 14:30:45\" (UK locale)\n   * // ToLocaleString('en-US') returns \"3/15/2024, 2:30:45 PM\"\n   */\n  ToLocaleString: dateTransformers.register('Date.ToLocaleString', {\n    inputSchema: dateSchema,\n    argumentsSchema: optionalStringArgsSchema,\n    factory: () => (value: Date, locale?: string) => value.toLocaleString(locale),\n  }),\n\n  /**\n   * Converts a Date to UK long date format (e.g. \"18 March 2026\")\n   * @example\n   * // ToUKLongDate() returns \"18 March 2026\"\n   */\n  ToUKLongDate: dateTransformers.register('Date.ToUKLongDate', {\n    inputSchema: dateSchema,\n    factory: () => (value: Date) =>\n      value.toLocaleDateString('en-GB', {\n        day: 'numeric',\n        month: 'long',\n        year: 'numeric',\n      }),\n  }),\n}\n\nexport { dateTransformers as dateTransformersRegistry }\n","import { z } from 'zod'\nimport TransformerRegistry from '../../../authoring/registries/TransformerRegistry'\n\nconst numberSchema = z.number()\nconst numberArgsSchema = z.tuple([z.number()])\nconst numberRangeArgsSchema = z.tuple([z.number(), z.number()])\n\nconst numberTransformers = new TransformerRegistry()\n\nexport const NumberTransformers = {\n  /**\n   * Adds a number to the input value\n   * @param addend - The number to add\n   * @example\n   * // Add(3) applied to 5 returns 8\n   * // Add(Answer('tax')) applied to Answer('price') - dynamic addition\n   */\n  Add: numberTransformers.register('Number.Add', {\n    inputSchema: numberSchema,\n    argumentsSchema: numberArgsSchema,\n    factory: () => (value: number, addend: number) => value + addend,\n  }),\n\n  /**\n   * Subtracts a number from the input value\n   * @param subtrahend - The number to subtract\n   * @example\n   * // Subtract(3) applied to 10 returns 7\n   */\n  Subtract: numberTransformers.register('Number.Subtract', {\n    inputSchema: numberSchema,\n    argumentsSchema: numberArgsSchema,\n    factory: () => (value: number, subtrahend: number) => value - subtrahend,\n  }),\n\n  /**\n   * Multiplies the input value by a number\n   * @param multiplier - The number to multiply by\n   * @example\n   * // Multiply(3) applied to 4 returns 12\n   * // Multiply(Answer('quantity')) applied to Answer('price') - dynamic multiplication\n   */\n  Multiply: numberTransformers.register('Number.Multiply', {\n    inputSchema: numberSchema,\n    argumentsSchema: numberArgsSchema,\n    factory: () => (value: number, multiplier: number) => value * multiplier,\n  }),\n\n  /**\n   * Divides the input value by a number\n   * @param divisor - The number to divide by\n   * @example\n   * // Divide(3) applied to 15 returns 5\n   */\n  Divide: numberTransformers.register('Number.Divide', {\n    inputSchema: numberSchema,\n    argumentsSchema: numberArgsSchema,\n    factory: () => (value: number, divisor: number) => {\n      if (divisor === 0) {\n        throw new Error('Division by zero is not allowed in Transformer.Number.Divide')\n      }\n\n      return value / divisor\n    },\n  }),\n\n  /**\n   * Returns the absolute value of the input\n   * @example\n   * // Abs() applied to -5 returns 5\n   */\n  Abs: numberTransformers.register('Number.Abs', {\n    inputSchema: numberSchema,\n    factory: () => (value: number) => Math.abs(value),\n  }),\n\n  /**\n   * Rounds the number to the nearest integer\n   * @example\n   * // Round() applied to 4.7 returns 5\n   */\n  Round: numberTransformers.register('Number.Round', {\n    inputSchema: numberSchema,\n    factory: () => (value: number) => Math.round(value),\n  }),\n\n  /**\n   * Rounds the number down to the nearest integer\n   * @example\n   * // Floor() applied to 4.7 returns 4\n   */\n  Floor: numberTransformers.register('Number.Floor', {\n    inputSchema: numberSchema,\n    factory: () => (value: number) => Math.floor(value),\n  }),\n\n  /**\n   * Rounds the number up to the nearest integer\n   * @example\n   * // Ceil() applied to 4.2 returns 5\n   */\n  Ceil: numberTransformers.register('Number.Ceil', {\n    inputSchema: numberSchema,\n    factory: () => (value: number) => Math.ceil(value),\n  }),\n\n  /**\n   * Rounds the number to a specified number of decimal places\n   * @param decimals - The number of decimal places to round to\n   * @example\n   * // ToFixed(2) applied to 3.14159 returns 3.14\n   */\n  ToFixed: numberTransformers.register('Number.ToFixed', {\n    inputSchema: numberSchema,\n    argumentsSchema: numberArgsSchema,\n    factory: () => (value: number, decimals: number) => parseFloat(value.toFixed(decimals)),\n  }),\n\n  /**\n   * Returns the maximum of the input value and a comparison value\n   * @param comparison - The value to compare against\n   * @example\n   * // Max(10) applied to 5 returns 10\n   */\n  Max: numberTransformers.register('Number.Max', {\n    inputSchema: numberSchema,\n    argumentsSchema: numberArgsSchema,\n    factory: () => (value: number, comparison: number) => Math.max(value, comparison),\n  }),\n\n  /**\n   * Returns the minimum of the input value and a comparison value\n   * @param comparison - The value to compare against\n   * @example\n   * // Min(10) applied to 5 returns 5\n   */\n  Min: numberTransformers.register('Number.Min', {\n    inputSchema: numberSchema,\n    argumentsSchema: numberArgsSchema,\n    factory: () => (value: number, comparison: number) => Math.min(value, comparison),\n  }),\n\n  /**\n   * Raises the input value to the power of the exponent\n   * @param exponent - The exponent to raise the value to\n   * @example\n   * // Power(3) applied to 2 returns 8\n   */\n  Power: numberTransformers.register('Number.Power', {\n    inputSchema: numberSchema,\n    argumentsSchema: numberArgsSchema,\n    factory: () => (value: number, exponent: number) => value ** exponent,\n  }),\n\n  /**\n   * Returns the square root of the input value\n   * @example\n   * // Sqrt() applied to 16 returns 4\n   */\n  Sqrt: numberTransformers.register('Number.Sqrt', {\n    inputSchema: numberSchema,\n    factory: () => (value: number) => {\n      if (value < 0) {\n        throw new Error('Cannot calculate square root of negative number in Transformer.Number.Sqrt')\n      }\n\n      return Math.sqrt(value)\n    },\n  }),\n\n  /**\n   * Clamps the input value between a minimum and maximum range\n   * @param min - The minimum value (inclusive)\n   * @param max - The maximum value (inclusive)\n   * @example\n   * // Clamp(5, 10) applied to 15 returns 10\n   * // Clamp(5, 10) applied to 3 returns 5\n   * // Clamp(5, 10) applied to 7 returns 7\n   */\n  Clamp: numberTransformers.register('Number.Clamp', {\n    inputSchema: numberSchema,\n    argumentsSchema: numberRangeArgsSchema,\n    factory: () => (value: number, min: number, max: number) => Math.min(Math.max(value, min), max),\n  }),\n}\n\nexport { numberTransformers as numberTransformersRegistry }\n","import { z } from 'zod'\nimport TransformerRegistry from '../../../authoring/registries/TransformerRegistry'\n\n/** Gets a value from an object using a dot-notation path (e.g. 'user.profile.name') */\nfunction getByPath<T = unknown>(obj: unknown, path: string): T | undefined {\n  if (obj == null) {\n    return undefined\n  }\n\n  if (path === '') {\n    return obj as T\n  }\n\n  return path.split('.').reduce<unknown>((current, key) => {\n    if (current == null || typeof current !== 'object') {\n      return undefined\n    }\n\n    return (current as Record<string, unknown>)[key]\n  }, obj) as T | undefined\n}\n\nexport interface DateParts {\n  year?: string\n  month?: string\n  day?: string\n}\n\nconst objectSchema = z.looseObject({})\nconst datePartsArgsSchema = z.tuple([\n  z.object({\n    year: z.string().optional(),\n    month: z.string().optional(),\n    day: z.string().optional(),\n  }),\n])\n\nconst objectTransformers = new TransformerRegistry()\n\nexport const ObjectTransformers = {\n  /**\n   * Converts an object with date parts to an ISO 8601 date string\n   * Supports full dates (YYYY-MM-DD), partial dates (YYYY-MM, MM-DD), or single components\n   *\n   * @param paths - Object mapping date components to property paths\n   * @example\n   * // Full date: {day: \"15\", month: \"3\", year: \"2024\"} becomes \"2024-03-15\"\n   * ToISO({year: 'year', month: 'month', day: 'day'})\n   *\n   * @example\n   * // Partial date: {month: \"3\", year: \"2024\"} becomes \"2024-03\"\n   * ToISO({year: 'year', month: 'month'})\n   *\n   * @example\n   * // Nested paths: {date: {y: \"2024\", m: \"3\", d: \"15\"}} becomes \"2024-03-15\"\n   * ToISO({year: 'date.y', month: 'date.m', day: 'date.d'})\n   */\n  ToISO: objectTransformers.register('Object.ToISO', {\n    inputSchema: objectSchema,\n    argumentsSchema: datePartsArgsSchema,\n    factory: () => (value: Record<string, unknown>, paths: DateParts) => {\n      const year = paths.year ? getByPath<string>(value, paths.year) : undefined\n      const month = paths.month ? getByPath<string>(value, paths.month) : undefined\n      const day = paths.day ? getByPath<string>(value, paths.day) : undefined\n\n      // If all three paths are specified (full date expected), require all three values\n      // so field-specific validation can run when any field is empty.\n      if (paths.year && paths.month && paths.day) {\n        if (!year || !month || !day) {\n          throw new TypeError('Transformer.Object.ToISO: Full date requested but not all fields provided')\n        }\n      }\n\n      if (year && !/^\\d{1,4}$/.test(year)) {\n        throw new TypeError(`Transformer.Object.ToISO: Invalid year value \"${year}\"`)\n      }\n\n      if (month && !/^\\d{1,2}$/.test(month)) {\n        throw new TypeError(`Transformer.Object.ToISO: Invalid month value \"${month}\"`)\n      }\n\n      if (day && !/^\\d{1,2}$/.test(day)) {\n        throw new TypeError(`Transformer.Object.ToISO: Invalid day value \"${day}\"`)\n      }\n\n      if (month) {\n        const monthNum = parseInt(month, 10)\n        if (monthNum < 1 || monthNum > 12) {\n          throw new TypeError(`Transformer.Object.ToISO: Month must be between 1 and 12, got \"${month}\"`)\n        }\n      }\n\n      if (day) {\n        const dayNum = parseInt(day, 10)\n        if (dayNum < 1 || dayNum > 31) {\n          throw new TypeError(`Transformer.Object.ToISO: Day must be between 1 and 31, got \"${day}\"`)\n        }\n      }\n\n      if (year && month && day) {\n        const paddedYear = year.padStart(4, '0')\n        const paddedMonth = month.padStart(2, '0')\n        const paddedDay = day.padStart(2, '0')\n        return `${paddedYear}-${paddedMonth}-${paddedDay}`\n      }\n\n      if (year && month) {\n        const paddedYear = year.padStart(4, '0')\n        const paddedMonth = month.padStart(2, '0')\n        return `${paddedYear}-${paddedMonth}`\n      }\n\n      if (month && day) {\n        const paddedMonth = month.padStart(2, '0')\n        const paddedDay = day.padStart(2, '0')\n        return `--${paddedMonth}-${paddedDay}`\n      }\n\n      if (year) {\n        return year.padStart(4, '0')\n      }\n\n      throw new TypeError('Transformer.Object.ToISO: No valid date components found in object')\n    },\n  }),\n\n  /**\n   * Converts an ISO 8601 date string back to an object with date parts.\n   * The inverse of ToISO. Objects are passed through unchanged.\n   *\n   * @param paths - Object mapping date components to output property names\n   * @example\n   * // Full date: \"2024-03-15\" becomes {year: \"2024\", month: \"03\", day: \"15\"}\n   * FromISO({year: 'year', month: 'month', day: 'day'})\n   *\n   * @example\n   * // Year-month: \"2024-03\" becomes {year: \"2024\", month: \"03\"}\n   * FromISO({year: 'year', month: 'month'})\n   */\n  FromISO: objectTransformers.register('Object.FromISO', {\n    argumentsSchema: datePartsArgsSchema,\n    factory: () => (value: unknown, paths: DateParts) => {\n      if (typeof value === 'object' && value !== null) {\n        return value\n      }\n\n      if (typeof value !== 'string' || !value) {\n        return {}\n      }\n\n      const result: Record<string, string> = {}\n      const hasYear = Boolean(paths.year)\n      const hasMonth = Boolean(paths.month)\n      const hasDay = Boolean(paths.day)\n\n      if (hasYear && hasMonth && hasDay) {\n        const match = value.match(/^(\\d{4})-(\\d{2})-(\\d{2})$/)\n\n        if (match) {\n          result[paths.year!] = match[1]\n          result[paths.month!] = match[2]\n          result[paths.day!] = match[3]\n\n          return result\n        }\n      }\n\n      if (hasYear && hasMonth && !hasDay) {\n        const match = value.match(/^(\\d{4})-(\\d{2})$/)\n\n        if (match) {\n          result[paths.year!] = match[1]\n          result[paths.month!] = match[2]\n\n          return result\n        }\n      }\n\n      if (hasMonth && hasDay && !hasYear) {\n        const match = value.match(/^(?:--)?(\\d{2})-(\\d{2})$/)\n\n        if (match) {\n          result[paths.month!] = match[1]\n          result[paths.day!] = match[2]\n\n          return result\n        }\n      }\n\n      if (hasYear && !hasMonth && !hasDay) {\n        const match = value.match(/^(\\d{4})$/)\n\n        if (match) {\n          result[paths.year!] = match[1]\n\n          return result\n        }\n      }\n\n      return {}\n    },\n  }),\n}\n\nexport { objectTransformers as objectTransformersRegistry }\n","/**\n * HTML entity encoding map for XSS prevention\n */\nconst HTML_ENTITY_MAP: Record<string, string> = {\n  '<': '&lt;',\n  '>': '&gt;',\n  '&': '&amp;',\n  '\"': '&quot;',\n  \"'\": '&#39;',\n}\n\n/**\n * Escape HTML entities in a string value to prevent XSS attacks.\n *\n * Converts dangerous characters to their HTML entity equivalents:\n * - < becomes &lt;\n * - > becomes &gt;\n * - & becomes &amp;\n * - \" becomes &quot;\n * - ' becomes &#39;\n *\n * @param value - The string value to sanitize\n * @returns The sanitized string with HTML entities escaped\n */\nexport function escapeHtmlEntities(value: string): string {\n  return value.replace(/[<>&\"']/g, char => HTML_ENTITY_MAP[char])\n}\n","import { z } from 'zod'\nimport TransformerRegistry from '../../../authoring/registries/TransformerRegistry'\nimport { escapeHtmlEntities } from '../../sanitize'\n\nconst DEFAULT_FORMAT_DATE_LOCALE = 'en-GB'\nconst DEFAULT_FORMAT_DATE_TIME_ZONE = 'Europe/London'\nconst DEFAULT_FORMAT_DATE_OPTIONS: StringDateFormatOptions = {\n  dateStyle: 'long',\n}\n\ntype StringDateFormatOptions = Readonly<\n  Intl.DateTimeFormatOptions & {\n    locale?: string\n  }\n>\n\nconst parseDateString = (value: string, functionName: string): Date => {\n  const UK_DATE_RE = /^(\\d{1,2})[/-](\\d{1,2})[/-](\\d{4})$/\n  const ISO_DATE_RE = /^(\\d{4})-(\\d{2})-(\\d{2})(?:$|T)/\n  const trimmed = value.trim()\n\n  if (!trimmed) {\n    throw new TypeError(`${functionName}: \"${value}\" is not a valid date`)\n  }\n\n  const ukMatch = UK_DATE_RE.exec(trimmed)\n\n  if (ukMatch) {\n    const day = Number(ukMatch[1])\n    const month = Number(ukMatch[2])\n    const year = Number(ukMatch[3])\n\n    const date = new Date(year, month - 1, day)\n\n    if (date.getFullYear() !== year || date.getMonth() !== month - 1 || date.getDate() !== day) {\n      throw new TypeError(`${functionName}: \"${value}\" is not a valid date`)\n    }\n\n    return date\n  }\n\n  const isoMatch = ISO_DATE_RE.exec(trimmed)\n\n  if (isoMatch) {\n    const year = Number(isoMatch[1])\n    const month = Number(isoMatch[2])\n    const day = Number(isoMatch[3])\n    const dateOnly = new Date(Date.UTC(year, month - 1, day))\n\n    if (dateOnly.getUTCFullYear() !== year || dateOnly.getUTCMonth() !== month - 1 || dateOnly.getUTCDate() !== day) {\n      throw new TypeError(`${functionName}: \"${value}\" is not a valid date`)\n    }\n\n    if (!trimmed.includes('T')) {\n      return dateOnly\n    }\n\n    const dateTime = new Date(trimmed)\n\n    if (Number.isNaN(dateTime.getTime())) {\n      throw new TypeError(`${functionName}: \"${value}\" is not a valid ISO date`)\n    }\n\n    return dateTime\n  }\n\n  throw new TypeError(`${functionName}: \"${value}\" is not a valid date (expected DD/MM/YYYY or YYYY-MM-DD)`)\n}\n\nconst stringSchema = z.string()\nconst formatDateOptionsSchema = z.looseObject({\n  locale: z.string().optional(),\n  timeZone: z.string().optional(),\n})\n\nconst stringTransformers = new TransformerRegistry()\n\nexport const StringTransformers = {\n  /**\n   * Removes whitespace from both ends of a string\n   * @example\n   * // Transforms \"  hello world  \" to \"hello world\"\n   */\n  Trim: stringTransformers.register('String.Trim', {\n    inputSchema: stringSchema,\n    factory: () => (value: string) => value.trim(),\n  }),\n\n  /**\n   * Converts string to uppercase\n   * @example\n   * // Transforms \"Hello World\" to \"HELLO WORLD\"\n   */\n  ToUpperCase: stringTransformers.register('String.ToUpperCase', {\n    inputSchema: stringSchema,\n    factory: () => (value: string) => value.toUpperCase(),\n  }),\n\n  /**\n   * Converts string to lowercase\n   * @example\n   * // Transforms \"Hello World\" to \"hello world\"\n   */\n  ToLowerCase: stringTransformers.register('String.ToLowerCase', {\n    inputSchema: stringSchema,\n    factory: () => (value: string) => value.toLowerCase(),\n  }),\n\n  /**\n   * Capitalizes the first letter of each word\n   * @example\n   * // Transforms \"hello world\" to \"Hello World\"\n   */\n  ToTitleCase: stringTransformers.register('String.ToTitleCase', {\n    inputSchema: stringSchema,\n    factory: () => (value: string) =>\n      value.replace(/\\w\\S*/g, (text: string) => text.charAt(0).toUpperCase() + text.slice(1).toLowerCase()),\n  }),\n\n  /**\n   * Capitalizes the first letter of the string\n   * @example\n   * // Transforms \"hello world\" to \"Hello world\"\n   */\n  Capitalize: stringTransformers.register('String.Capitalize', {\n    inputSchema: stringSchema,\n    factory: () => (value: string) => {\n      if (value.length === 0) return value\n      return value.charAt(0).toUpperCase() + value.slice(1)\n    },\n  }),\n\n  /**\n   * Converts a name to its possessive form\n   * Names ending in 's' get just an apostrophe, others get 's\n   * @example\n   * // Possessive(\"John\") returns \"John's\"\n   * // Possessive(\"James\") returns \"James'\"\n   * // Possessive(\"Chris\") returns \"Chris'\"\n   */\n  Possessive: stringTransformers.register('String.Possessive', {\n    inputSchema: stringSchema,\n    factory: () => (value: string) => {\n      if (value.length === 0) return value\n      if (value.toLowerCase().endsWith('s')) {\n        return `${value}'`\n      }\n      return `${value}'s`\n    },\n  }),\n\n  /**\n   * Extracts a substring from start to end position\n   * @param start - The zero-based index at which to begin extraction\n   * @param end - The zero-based index before which to end extraction (optional)\n   * @example\n   * // Substring(1, 4) applied to \"hello\" returns \"ell\"\n   */\n  Substring: stringTransformers.register('String.Substring', {\n    inputSchema: stringSchema,\n    argumentsSchema: z.tuple([z.number(), z.number().optional()]),\n    factory: () => (value: string, start: number, end?: number) => value.substring(start, end),\n  }),\n\n  /**\n   * Replaces all occurrences of a search string with a replacement string\n   * @param searchValue - The string to search for\n   * @param replaceValue - The string to replace matches with\n   * @example\n   * // Replace(\"world\", \"universe\") applied to \"hello world\" returns \"hello universe\"\n   */\n  Replace: stringTransformers.register('String.Replace', {\n    inputSchema: stringSchema,\n    argumentsSchema: z.tuple([z.string(), z.string()]),\n    factory: () => (value: string, searchValue: string, replaceValue: string) =>\n      value.replaceAll(searchValue, replaceValue),\n  }),\n\n  /**\n   * Pads the string to a specified length with a given string on the left\n   * @param targetLength - The length the string should be padded to\n   * @param padString - The string to pad with (defaults to a single space)\n   * @example\n   * // PadStart(3) applied to \"5\" returns \"  5\"\n   */\n  PadStart: stringTransformers.register('String.PadStart', {\n    inputSchema: stringSchema,\n    argumentsSchema: z.tuple([z.number(), z.string().optional()]),\n    factory:\n      () =>\n      (value: string, targetLength: number, padString: string = ' ') =>\n        value.padStart(targetLength, padString),\n  }),\n\n  /**\n   * Pads the string to a specified length with a given string on the right\n   * @param targetLength - The length the string should be padded to\n   * @param padString - The string to pad with (defaults to a single space)\n   * @example\n   * // PadEnd(3) applied to \"5\" returns \"5  \"\n   */\n  PadEnd: stringTransformers.register('String.PadEnd', {\n    inputSchema: stringSchema,\n    argumentsSchema: z.tuple([z.number(), z.string().optional()]),\n    factory:\n      () =>\n      (value: string, targetLength: number, padString: string = ' ') =>\n        value.padEnd(targetLength, padString),\n  }),\n\n  // TODO: I wonder if the below transformers should instead be broken off into a `Type` transformer group, like\n  //  `Transformers.Type.ToInt()` - it might be a bit more clear.\n  /**\n   * Converts a string to an integer\n   * Throws on invalid input so the pipeline errors and the original value is preserved.\n   * @example\n   * // ToInt() on \"123\" returns 123\n   * // ToInt() on \"123.45\" returns 123 (truncated)\n   * // ToInt() on \"  123  \" returns 123\n   * // ToInt() on \"\" throws Error\n   * // ToInt() on \"abc\" throws Error\n   * // ToInt() on \"123abc\" throws Error (partial parse rejected)\n   */\n  ToInt: stringTransformers.register('String.ToInt', {\n    inputSchema: stringSchema,\n    factory: () => (value: string) => {\n      const trimmed = value.trim()\n      const parsed = Number(trimmed)\n\n      if (trimmed === '' || Number.isNaN(parsed) || !Number.isFinite(parsed)) {\n        throw new TypeError(`Transformer.String.ToInt: \"${value}\" is not a valid number`)\n      }\n\n      return Math.trunc(parsed)\n    },\n  }),\n\n  /**\n   * Converts a string to a floating-point number\n   * Throws on invalid input so the pipeline errors and the original value is preserved.\n   * @example\n   * // ToFloat() on \"123.45\" returns 123.45\n   * // ToFloat() on \"3.14159\" returns 3.14159\n   * // ToFloat() on \"  123.45  \" returns 123.45\n   * // ToFloat() on \"\" throws Error\n   * // ToFloat() on \"abc\" throws Error\n   * // ToFloat() on \"123abc\" throws Error (partial parse rejected)\n   */\n  ToFloat: stringTransformers.register('String.ToFloat', {\n    inputSchema: stringSchema,\n    factory: () => (value: string) => {\n      const trimmed = value.trim()\n      const parsed = Number(trimmed)\n\n      if (trimmed === '' || Number.isNaN(parsed) || !Number.isFinite(parsed)) {\n        throw new TypeError(`Transformer.String.ToFloat: \"${value}\" is not a valid number`)\n      }\n\n      return parsed\n    },\n  }),\n\n  /**\n   * Splits a string into an array of characters or by a separator\n   * @param separator - Optional separator string; if omitted, splits into individual characters\n   * @example\n   * // ToArray() on \"hello\" returns [\"h\", \"e\", \"l\", \"l\", \"o\"]\n   * // ToArray(\",\") on \"hello,world\" returns [\"hello\", \"world\"]\n   * // ToArray(\"-\") on \"a-b-c\" returns [\"a\", \"b\", \"c\"]\n   */\n  ToArray: stringTransformers.register('String.ToArray', {\n    inputSchema: stringSchema,\n    argumentsSchema: z.tuple([z.string().optional()]),\n    factory: () => (value: string, separator?: string) => {\n      if (separator === undefined) {\n        return value.split('')\n      }\n\n      return value.split(separator)\n    },\n  }),\n\n  // TODO: This probably needs to support supplying/choosing a format.\n  /**\n   * Converts a date string to a Date object (local time).\n   * Supports both UK format (DD/MM/YYYY) and ISO-8601 format (YYYY-MM-DD or full ISO with time/timezone).\n   * Throws on invalid input so the pipeline errors and the original value is preserved.\n   *\n   * @example\n   * // ToDate() on \"15/03/2024\" returns 2024-03-15T00:00:00 local\n   * // ToDate() on \"15-03-2024\" returns 2024-03-15T00:00:00 local\n   * // ToDate() on \"2024-03-15\" returns 2024-03-15T00:00:00 local\n   * // ToDate() on \"2024-03-15T14:30:00Z\" returns a Date object with time\n   * // ToDate() on \"\" throws Error\n   */\n  ToDate: stringTransformers.register('String.ToDate', {\n    inputSchema: stringSchema,\n    factory: () => (value: string) => parseDateString(value, 'Transformer.String.ToDate'),\n  }),\n\n  /**\n   * Formats a date string using Intl.DateTimeFormat options.\n   * Defaults to UK long date formatting when no options are supplied.\n   *\n   * @param options - Intl.DateTimeFormat options plus optional locale, which defaults to en-GB\n   * @example\n   * // FormatDate() on \"2024-03-15\" returns \"15 March 2024\"\n   * // FormatDate({ dateStyle: 'short' }) on \"2024-03-15\" returns \"15/03/2024\"\n   * // FormatDate({ locale: 'en-US', dateStyle: 'long' }) on \"2024-03-15\" returns \"March 15, 2024\"\n   */\n  FormatDate: stringTransformers.register('String.FormatDate', {\n    inputSchema: stringSchema,\n    argumentsSchema: z.tuple([formatDateOptionsSchema.optional()]),\n    factory: () => (value: string, options?: StringDateFormatOptions) => {\n      const {\n        locale = DEFAULT_FORMAT_DATE_LOCALE,\n        timeZone = DEFAULT_FORMAT_DATE_TIME_ZONE,\n        ...dateTimeFormatOptions\n      } = options ?? DEFAULT_FORMAT_DATE_OPTIONS\n\n      const date = parseDateString(value, 'Transformer.String.FormatDate')\n\n      return new Intl.DateTimeFormat(locale, { ...dateTimeFormatOptions, timeZone }).format(date)\n    },\n  }),\n\n  /**\n   * Converts a UK-formatted date string (DD/MM/YYYY) to ISO-8601 format (YYYY-MM-DD).\n   * Throws on invalid input so the pipeline errors and the original value is preserved.\n   *\n   * Use this with MOJ Date Picker which outputs UK format dates.\n   * @example\n   * // ToISODate() on \"15/03/2024\" returns \"2024-03-15\"\n   * // ToISODate() on \"5/3/2024\" returns \"2024-03-05\"\n   * // ToISODate() on \"15-03-2024\" returns \"2024-03-15\"\n   * // ToISODate() on \"\" throws Error\n   * // ToISODate() on \"31/02/2024\" throws Error (invalid date)\n   */\n  ToISODate: stringTransformers.register('String.ToISODate', {\n    inputSchema: stringSchema,\n    factory: () => (value: string) => {\n      const UK_DATE_RE = /^(\\d{1,2})[/-](\\d{1,2})[/-](\\d{4})$/\n      const trimmed = value.trim()\n\n      if (!trimmed) {\n        throw new TypeError(`Transformer.String.ToISODate: \"${value}\" is not a valid date`)\n      }\n\n      const match = UK_DATE_RE.exec(trimmed)\n\n      if (!match) {\n        throw new TypeError(`Transformer.String.ToISODate: \"${value}\" is not a valid UK date (expected DD/MM/YYYY)`)\n      }\n\n      const day = Number(match[1])\n      const month = Number(match[2])\n      const year = Number(match[3])\n\n      const date = new Date(year, month - 1, day)\n\n      if (date.getFullYear() !== year || date.getMonth() !== month - 1 || date.getDate() !== day) {\n        throw new TypeError(`Transformer.String.ToISODate: \"${value}\" is not a valid date`)\n      }\n\n      const paddedYear = String(year).padStart(4, '0')\n      const paddedMonth = String(month).padStart(2, '0')\n      const paddedDay = String(day).padStart(2, '0')\n\n      return `${paddedYear}-${paddedMonth}-${paddedDay}`\n    },\n  }),\n\n  /**\n   * Converts an epoch millisecond date string to a Date (local time).\n   * Throws on invalid input so the pipeline errors and the original value is preserved.\n   *\n   * @example\n   * // ToTimestampDate() on \"1771429146000\" returns 2026-02-18T15:39:06 local\n   * // ToTimestampDate() on \"\" throws Error\n   */\n  ToTimestampDate: stringTransformers.register('String.ToTimestampDate', {\n    inputSchema: stringSchema,\n    factory: () => (value: string) => {\n      if (!/^\\d+$/.test(value)) {\n        throw new TypeError(`Transformer.String.ToTimestampDate: \"${value}\" is not a timestamp`)\n      }\n\n      const epoch = Number(value)\n\n      if (!Number.isSafeInteger(epoch)) {\n        throw new TypeError(`Transformer.String.ToTimestampDate: \"${value}\" is not a valid timestamp`)\n      }\n\n      const date = new Date(epoch)\n\n      if (Number.isNaN(date.getTime())) {\n        throw new TypeError(`Transformer.String.ToTimestampDate: \"${value}\" is not a valid epoch timestamp`)\n      }\n\n      return date\n    },\n  }),\n\n  /**\n   * Escapes HTML entities in a string to prevent XSS attacks.\n   * Use this when piping untrusted data (user input, external API data) into HTML contexts.\n   *\n   * Converts: < > & \" ' to their HTML entity equivalents.\n   *\n   * @example\n   * // EscapeHtml() on '\"><img src=x onerror=alert(1)>' returns '&quot;&gt;&lt;img src=x onerror=alert(1)&gt;'\n   * // Usage: Data('goalTitle').pipe(Transformer.String.EscapeHtml())\n   */\n  EscapeHtml: stringTransformers.register('String.EscapeHtml', {\n    inputSchema: stringSchema,\n    factory: () => (value: string) => escapeHtmlEntities(value),\n  }),\n}\n\nexport { stringTransformers as stringTransformersRegistry }\n","import { ArrayTransformers, arrayTransformersRegistry } from './arrayTransformers'\nimport { DateTransformers, dateTransformersRegistry } from './dateTransformers'\nimport { NumberTransformers, numberTransformersRegistry } from './numberTransformers'\nimport { ObjectTransformers, objectTransformersRegistry } from './objectTransformers'\nimport { StringTransformers, stringTransformersRegistry } from './stringTransformers'\n\n// TypeScript declaration emit drops JSDoc when it structurally expands a type\n// imported from another file, so the built .d.ts would lose every per-function\n// doc comment. Annotating with `typeof` references makes the emitter print a\n// reference instead of expanding, keeping the docs on each group's own declaration.\ninterface TransformerGroups {\n  /** Transformers for handling strings */\n  String: typeof StringTransformers\n\n  /** Transformers for handling numbers */\n  Number: typeof NumberTransformers\n\n  /** Transformers for handling arrays */\n  Array: typeof ArrayTransformers\n\n  /** Transformers for handling objects */\n  Object: typeof ObjectTransformers\n\n  /** Transformers for handling dates */\n  Date: typeof DateTransformers\n}\n\nexport const Transformer: TransformerGroups = {\n  /** Transformers for handling strings */\n  String: StringTransformers,\n\n  /** Transformers for handling numbers */\n  Number: NumberTransformers,\n\n  /** Transformers for handling arrays */\n  Array: ArrayTransformers,\n\n  /** Transformers for handling objects */\n  Object: ObjectTransformers,\n\n  /** Transformers for handling dates */\n  Date: DateTransformers,\n}\n\nexport const TransformersRegistry = {\n  ...stringTransformersRegistry.build(),\n  ...numberTransformersRegistry.build(),\n  ...arrayTransformersRegistry.build(),\n  ...objectTransformersRegistry.build(),\n  ...dateTransformersRegistry.build(),\n}\n","import type { EffectFunctionExpr, Resolvable } from '../types/expressions.type'\nimport { FunctionType } from '../types/enums'\nimport { BaseFunctionRegistry, type RegistrationOptions } from './BaseFunctionRegistry'\n\nexport default class EffectRegistry<TDeps = Record<string, never>> extends BaseFunctionRegistry<TDeps> {\n  constructor() {\n    super(FunctionType.EFFECT)\n  }\n\n  register<TArgs extends any[]>(\n    name: string,\n    options: RegistrationOptions & { factory: (deps: TDeps) => (context: any, ...args: TArgs) => any },\n  ): (...args: { [K in keyof TArgs]: Resolvable<TArgs[K]> }) => EffectFunctionExpr\n\n  register<TArgs extends any[]>(\n    name: string,\n    options: RegistrationOptions,\n    factory: (deps: TDeps) => (context: any, ...args: TArgs) => any,\n  ): (...args: { [K in keyof TArgs]: Resolvable<TArgs[K]> }) => EffectFunctionExpr\n\n  register<TArgs extends any[]>(\n    name: string,\n    factory: (deps: TDeps) => (context: any, ...args: TArgs) => any,\n  ): (...args: { [K in keyof TArgs]: Resolvable<TArgs[K]> }) => EffectFunctionExpr\n\n  register<TArgs extends any[]>(\n    options: RegistrationOptions,\n    factory: (deps: TDeps) => (context: any, ...args: TArgs) => any,\n  ): (...args: { [K in keyof TArgs]: Resolvable<TArgs[K]> }) => EffectFunctionExpr\n\n  register<TArgs extends any[]>(\n    factory: (deps: TDeps) => (context: any, ...args: TArgs) => any,\n  ): (...args: { [K in keyof TArgs]: Resolvable<TArgs[K]> }) => EffectFunctionExpr\n\n  register(\n    first: string | RegistrationOptions | ((deps: TDeps) => (...args: any[]) => any),\n    second?: RegistrationOptions | ((deps: TDeps) => (...args: any[]) => any),\n    third?: (deps: TDeps) => (...args: any[]) => any,\n  ): (...args: any[]) => EffectFunctionExpr {\n    const { name, options, factory } = this.parseArgs(first, second, third)\n\n    this.store(name, options, factory)\n\n    return this.buildExpressionHandle(name, options.prepare) as any\n  }\n}\n","import { FunctionRegistryObject } from '../../types/functions.type'\nimport type { FunctionType } from '../../types/enums'\nimport type { FunctionImplementations, FunctionShapeMap, NoDeps } from './defineFunction.type'\n\nfunction extractFactory(entry: unknown): (deps: unknown) => unknown {\n  if (typeof entry === 'function') {\n    return entry as (deps: unknown) => unknown\n  }\n\n  return (entry as { factory: (deps: unknown) => unknown }).factory\n}\n\nfunction extractFunctionType(entry: unknown): FunctionType | undefined {\n  return (entry as { functionType?: FunctionType }).functionType\n}\n\n/**\n * Resolves function factory entries into a registry of ready-to-call evaluators.\n *\n * Each entry can be a plain factory function (back-compat) or an object with\n * `{ factory, functionType?, prepare? }`. The registry decomposes each entry,\n * calls the factory with `deps` to produce an evaluator, and preserves its\n * `functionType` metadata for the engine to use at runtime.\n *\n * @deprecated Use BaseFunctionRegistry.build() instead.\n *\n * @param implementations - Object mapping function names to factory entries\n * @param deps - Dependencies to inject into each factory (omit if none needed)\n *\n * @returns A registry object mapping function names to `{ name, evaluate, functionType? }`\n */\nexport function createFunctionsRegistry<TShapes extends FunctionShapeMap>(\n  implementations: FunctionImplementations<TShapes, NoDeps>,\n): FunctionRegistryObject\nexport function createFunctionsRegistry<TShapes extends FunctionShapeMap, TDeps>(\n  implementations: FunctionImplementations<TShapes, TDeps>,\n  deps: TDeps,\n): FunctionRegistryObject\nexport function createFunctionsRegistry<TShapes extends FunctionShapeMap, TDeps>(\n  implementations: FunctionImplementations<TShapes, TDeps>,\n  deps?: TDeps,\n): FunctionRegistryObject {\n  const resolvedDeps = (deps ?? {}) as TDeps\n  const registry = {} as FunctionRegistryObject\n\n  Object.keys(implementations).forEach(name => {\n    const entry = (implementations as Record<string, unknown>)[name]\n    const factory = extractFactory(entry)\n    const evaluate = factory(resolvedDeps) as FunctionRegistryObject[string]['evaluate']\n    const functionType = extractFunctionType(entry)\n\n    registry[name] = {\n      name,\n      evaluate,\n      functionType,\n    }\n  })\n\n  return registry\n}\n","// Each rolldown entry point (core, core/authoring) inlines its own copy of this class, so a\n// module-level Set would warn once per bundle rather than once per process. The Symbol.for key\n// is process-global, so the seen-codes set survives the duplication and dedupes across bundles.\nconst SEEN_CODES = Symbol.for('forge:deprecations')\n\ninterface DeprecationsGlobal {\n  [SEEN_CODES]?: Set<string>\n}\n\nexport class ForgeDeprecations {\n  /**\n   * Emit a runtime deprecation warning exactly once per process for the given `code`.\n   *\n   * Warnings go through `process.emitWarning` with `type: 'DeprecationWarning'`, so Node's\n   * `--trace-deprecation`, `--throw-deprecation`, and `--no-deprecation` flags apply. Node does\n   * not dedupe `emitWarning` itself, so repeated calls for the same `code` are suppressed here.\n   */\n  static warn(code: string, message: string): void {\n    const seen = ForgeDeprecations.seenCodes()\n\n    if (seen.has(code)) {\n      return\n    }\n\n    seen.add(code)\n    process.emitWarning(message, { type: 'DeprecationWarning', code })\n  }\n\n  private static seenCodes(): Set<string> {\n    const store = globalThis as DeprecationsGlobal\n    const existing = store[SEEN_CODES]\n\n    if (existing) {\n      return existing\n    }\n\n    const seen = new Set<string>()\n    store[SEEN_CODES] = seen\n\n    return seen\n  }\n}\n","import { FunctionType } from '../../types/enums'\nimport { captureCallsite, stampCallsite } from '../../builders/utils/captureCallsite'\nimport type { FunctionImplementations, FunctionShapeMap } from './defineFunction.type'\n\n/**\n * Extract the optional `prepare` hook from a factory entry. Returns\n * `undefined` for plain-function factories (back-compat).\n *\n * @deprecated Internal utility — no longer needed with registry pattern.\n */\nexport function extractPrepare(entry: unknown): ((...args: unknown[]) => unknown[]) | undefined {\n  if (typeof entry === 'function') {\n    return undefined\n  }\n\n  return (entry as { prepare?: (...args: unknown[]) => unknown[] }).prepare\n}\n\n/**\n * Normalises every factory entry to the object form, stamped with the function\n * kind. Authors never set `functionType` themselves — `defineConditionFunctions`,\n * `defineTransformerFunctions`, `defineEffectFunctions`, and `defineGeneratorFunctions`\n * each stamp their own kind here before handing `implementations` off to\n * `createFunctionsRegistry`, so the registry entry can tell the engine how to\n * enforce `inputSchema`/`argumentsSchema` without depending on call-site diagnostics.\n *\n * @deprecated Internal utility — no longer needed with registry pattern.\n */\nexport function tagFunctionType(\n  factories: Record<string, unknown>,\n  functionType: FunctionType,\n): Record<string, unknown> {\n  const tagged: Record<string, unknown> = {}\n\n  Object.keys(factories).forEach(name => {\n    const entry = factories[name]\n\n    if (typeof entry === 'function') {\n      const fn = entry as ((...args: unknown[]) => unknown) & { functionType?: FunctionType }\n      fn.functionType = functionType\n      tagged[name] = fn\n\n      return\n    }\n\n    tagged[name] = { ...(entry as Record<string, unknown>), functionType }\n  })\n\n  return tagged\n}\n\n/**\n * Builds expression-creating functions from a set of factory implementations.\n *\n * Each returned function creates a serialisable expression object `{ type, name, arguments }`\n * that the engine evaluates at runtime. The factories themselves are not called here - only\n * their keys are used to generate the corresponding builder functions.\n *\n * If a factory entry provides a `prepare` hook, it runs synchronously when the\n * builder is invoked. The hook can sanitise or reshape arguments before they\n * enter the expression, and/or throw to reject invalid arguments.\n *\n * This is the shared implementation behind `defineConditionFunctions`,\n * `defineTransformerFunctions`, and `defineEffectFunctions`.\n *\n * @deprecated Internal utility — no longer needed with registry pattern.\n */\nexport function buildExpressionFunctions<TShapes extends FunctionShapeMap, TDeps>(\n  factories: FunctionImplementations<TShapes, TDeps> | Record<string, unknown>,\n  functionType: FunctionType,\n) {\n  const functions = {} as Record<string, (...args: unknown[]) => unknown>\n\n  Object.keys(factories).forEach(name => {\n    const prepare = extractPrepare((factories as Record<string, unknown>)[name])\n    const expressionHandle = (...args: unknown[]) => {\n      const prepared = prepare ? prepare(...args) : args\n      const expr = { type: functionType, name, arguments: prepared }\n\n      stampCallsite(expr, captureCallsite(expressionHandle))\n\n      return expr\n    }\n\n    functions[name] = expressionHandle\n  })\n\n  return functions\n}\n","import { FunctionType } from '../../types/enums'\nimport { ForgeDeprecations } from '../../../shared/ForgeDeprecations'\nimport { buildExpressionFunctions, tagFunctionType } from './defineFunction'\nimport type {\n  ConditionFunctionGroup,\n  ConditionFunctions,\n  ConditionImplementations,\n  FunctionImplementations,\n  FunctionShapeMap,\n  ImplementationShapes,\n  NoDeps,\n} from './defineFunction.type'\n\n/**\n * Creates condition functions with dependency injection from factory functions.\n *\n * This separates builder creation from registry creation:\n * - `conditions`: Available immediately for use in form definitions (no deps needed)\n * - `implementations`: Passed to `createFunctionsRegistry` at runtime with real dependencies\n *\n * Each condition factory receives dependencies and returns an evaluator function.\n * The evaluator's first parameter (`value`) is injected by the engine at runtime -\n * the returned `conditions` builders only expose the remaining configuration arguments.\n *\n * @deprecated Use ConditionRegistry instead.\n *\n * @param factories - Condition factories keyed by function name\n *\n * @returns Object containing condition builders and implementations\n *\n * @example\n * const { conditions, implementations } = defineConditionFunctions({\n *   IsPositive: () => (value: unknown) => Number(value) > 0,\n *   GreaterThan: () => (value: unknown, threshold: number) => Number(value) > threshold,\n * })\n *\n * // Use in form definitions (no deps needed)\n * conditions.GreaterThan(10)  // { type: 'condition', name: 'GreaterThan', arguments: [10] }\n *\n * // Create registry at runtime\n * const registry = createFunctionsRegistry(implementations)\n */\nexport function defineConditionFunctions<TShapes extends FunctionShapeMap, TDeps = NoDeps>(\n  factories: FunctionImplementations<TShapes, TDeps>,\n): {\n  conditions: ConditionFunctions<TShapes>\n  implementations: FunctionImplementations<TShapes, TDeps>\n}\nexport function defineConditionFunctions<TConditions extends ConditionFunctionGroup<TConditions>, TDeps = NoDeps>(\n  factories: ConditionImplementations<TConditions, TDeps>,\n): {\n  conditions: TConditions\n  implementations: FunctionImplementations<ImplementationShapes<'condition', TConditions>, TDeps>\n}\nexport function defineConditionFunctions<TShapes extends FunctionShapeMap, TDeps = NoDeps>(\n  factories: Record<string, unknown>,\n): {\n  conditions: ConditionFunctions<TShapes>\n  implementations: FunctionImplementations<TShapes, TDeps>\n} {\n  ForgeDeprecations.warn(\n    'FORGE_DEP_defineConditionFunctions',\n    'defineConditionFunctions is deprecated - use ConditionRegistry instead.',\n  )\n\n  return {\n    conditions: buildExpressionFunctions(factories, FunctionType.CONDITION) as ConditionFunctions<TShapes>,\n    implementations: tagFunctionType(factories, FunctionType.CONDITION) as unknown as FunctionImplementations<\n      TShapes,\n      TDeps\n    >,\n  }\n}\n","import { FunctionType } from '../../types/enums'\nimport { ForgeDeprecations } from '../../../shared/ForgeDeprecations'\nimport { buildExpressionFunctions, tagFunctionType } from './defineFunction'\nimport type {\n  EffectFunctionGroup,\n  EffectFunctions,\n  EffectImplementations,\n  FunctionImplementations,\n  FunctionShapeMap,\n  ImplementationShapes,\n  NoDeps,\n} from './defineFunction.type'\n\n/**\n * Creates effect functions with dependency injection from factory functions.\n *\n * This separates builder creation from registry creation:\n * - `effects`: Available immediately for use in form definitions (no deps needed)\n * - `implementations`: Passed to `createFunctionsRegistry` at runtime with real dependencies\n *\n * Each effect factory receives dependencies and returns an evaluator function.\n * The evaluator's first parameter (`context: EffectFunctionContext`) is injected\n * by the engine at runtime - the returned `effects` builders only expose the\n * remaining configuration arguments.\n *\n * @deprecated Use EffectRegistry instead.\n *\n * @param factories - Effect factories keyed by function name\n *\n * @returns Object containing effect builders and implementations\n *\n * @example\n * const { effects, implementations } = defineEffectFunctions<\n *   { LogAction: (context: EffectFunctionContext, action: string) => void },\n *   { logger: Logger }\n * >({\n *   LogAction: (deps) => (context, action) => deps.logger.info(action),\n * })\n *\n * // Use in form definitions\n * effects.LogAction('SUBMIT')  // { type: 'effect', name: 'LogAction', arguments: ['SUBMIT'] }\n *\n * // Create registry at runtime\n * const registry = createFunctionsRegistry(implementations, { logger })\n */\nexport function defineEffectFunctions<TShapes extends FunctionShapeMap, TDeps = NoDeps>(\n  factories: FunctionImplementations<TShapes, TDeps>,\n): {\n  effects: EffectFunctions<TShapes>\n  implementations: FunctionImplementations<TShapes, TDeps>\n}\nexport function defineEffectFunctions<TEffects extends EffectFunctionGroup<TEffects>, TDeps = NoDeps>(\n  factories: EffectImplementations<TEffects, TDeps>,\n): {\n  effects: TEffects\n  implementations: FunctionImplementations<ImplementationShapes<'effect', TEffects>, TDeps>\n}\nexport function defineEffectFunctions<TShapes extends FunctionShapeMap, TDeps = NoDeps>(\n  factories: Record<string, unknown>,\n): {\n  effects: EffectFunctions<TShapes>\n  implementations: FunctionImplementations<TShapes, TDeps>\n} {\n  ForgeDeprecations.warn(\n    'FORGE_DEP_defineEffectFunctions',\n    'defineEffectFunctions is deprecated - use EffectRegistry instead.',\n  )\n\n  return {\n    effects: buildExpressionFunctions(factories, FunctionType.EFFECT) as EffectFunctions<TShapes>,\n    implementations: tagFunctionType(factories, FunctionType.EFFECT) as unknown as FunctionImplementations<\n      TShapes,\n      TDeps\n    >,\n  }\n}\n","import { FunctionEvaluator } from '../../types/functions.type'\nimport { ResolvableValue } from '../../types/expressions.type'\nimport { FunctionType } from '../../types/enums'\nimport { GeneratorBuilder } from '../../builders/GeneratorBuilder'\nimport { ForgeDeprecations } from '../../../shared/ForgeDeprecations'\nimport { extractPrepare, tagFunctionType } from './defineFunction'\nimport type {\n  FunctionImplementations,\n  FunctionShapeMap,\n  GeneratorFunctionGroup,\n  GeneratorFunctions,\n  GeneratorImplementations,\n  ImplementationShapes,\n  NoDeps,\n} from './defineFunction.type'\n\ntype GeneratorArguments<TFunction extends FunctionEvaluator<unknown>> =\n  Parameters<TFunction> extends ResolvableValue[] ? Parameters<TFunction> : never\n\n/**\n * Creates generator functions with dependency injection from factory functions.\n *\n * This separates builder creation from registry creation:\n * - `generators`: Available immediately for use in form definitions (no deps needed)\n * - `implementations`: Passed to `createFunctionsRegistry` at runtime with real dependencies\n *\n * Unlike conditions, transformers, and effects, generators do not receive a runtime\n * `value` or `context` parameter - their evaluators are called directly with just\n * the configuration arguments. The returned builders create `GeneratorBuilder` instances\n * that support chaining via `.pipe()`.\n *\n * Each factory entry can be a plain factory function or `{ prepare?, factory }`. When\n * `prepare` is provided, it runs synchronously when the author calls the builder —\n * sanitising/reshaping arguments before they enter the expression tree, and/or\n * throwing to reject invalid arguments at module-load time rather than at render time.\n *\n * @deprecated Use GeneratorRegistry instead.\n *\n * @param factories - Generator factories keyed by function name\n *\n * @returns Object containing generator builders and implementations\n *\n * @example\n * const { generators, implementations } = defineGeneratorFunctions({\n *   Today: () => () => new Date().toISOString().split('T')[0],\n *   PrefixedId: () => (prefix: string) => `${prefix}${crypto.randomUUID()}`,\n * })\n *\n * // With author-time preparation:\n * const { generators } = defineGeneratorFunctions<{ Slug: (input: string) => string }>({\n *   Slug: {\n *     prepare: (input) => {\n *       if (!input) throw new Error('input required')\n *       return [input]\n *     },\n *     factory: () => (input) => input.toLowerCase().replace(/\\s+/g, '-'),\n *   },\n * })\n *\n * // Use in form definitions (returns GeneratorBuilder for chaining)\n * generators.PrefixedId('user-').pipe(transformers.ToUpperCase())\n *\n * // Create registry at runtime\n * const registry = createFunctionsRegistry(implementations)\n */\nexport function defineGeneratorFunctions<TShapes extends FunctionShapeMap, TDeps = NoDeps>(\n  factories: FunctionImplementations<TShapes, TDeps>,\n): {\n  generators: GeneratorFunctions<TShapes>\n  implementations: FunctionImplementations<TShapes, TDeps>\n}\nexport function defineGeneratorFunctions<TGenerators extends GeneratorFunctionGroup<TGenerators>, TDeps = NoDeps>(\n  factories: GeneratorImplementations<TGenerators, TDeps>,\n): {\n  generators: TGenerators\n  implementations: FunctionImplementations<ImplementationShapes<'generator', TGenerators>, TDeps>\n}\nexport function defineGeneratorFunctions<TShapes extends FunctionShapeMap, TDeps = NoDeps>(\n  factories: Record<string, unknown>,\n): {\n  generators: GeneratorFunctions<TShapes>\n  implementations: FunctionImplementations<TShapes, TDeps>\n} {\n  ForgeDeprecations.warn(\n    'FORGE_DEP_defineGeneratorFunctions',\n    'defineGeneratorFunctions is deprecated - use GeneratorRegistry instead.',\n  )\n\n  const generators = {} as GeneratorFunctions<TShapes>\n\n  Object.keys(factories).forEach(name => {\n    const key = name as keyof TShapes & string\n    const prepare = extractPrepare(factories[key])\n    generators[key] = ((...args: GeneratorArguments<TShapes[typeof key]>) => {\n      const prepared = prepare ? prepare(...args) : args\n\n      return GeneratorBuilder.create(name, prepared as GeneratorArguments<TShapes[typeof key]>)\n    }) as GeneratorFunctions<TShapes>[typeof key]\n  })\n\n  return {\n    generators,\n    implementations: tagFunctionType(factories, FunctionType.GENERATOR) as unknown as FunctionImplementations<\n      TShapes,\n      TDeps\n    >,\n  }\n}\n","import { FunctionType } from '../../types/enums'\nimport { ForgeDeprecations } from '../../../shared/ForgeDeprecations'\nimport { buildExpressionFunctions, tagFunctionType } from './defineFunction'\nimport type {\n  FunctionImplementations,\n  FunctionShapeMap,\n  ImplementationShapes,\n  NoDeps,\n  TransformerFunctionGroup,\n  TransformerFunctions,\n  TransformerImplementations,\n} from './defineFunction.type'\n\n/**\n * Creates transformer functions with dependency injection from factory functions.\n *\n * This separates builder creation from registry creation:\n * - `transformers`: Available immediately for use in form definitions (no deps needed)\n * - `implementations`: Passed to `createFunctionsRegistry` at runtime with real dependencies\n *\n * Each transformer factory receives dependencies and returns an evaluator function.\n * The evaluator's first parameter (`value`) is injected by the engine at runtime -\n * the returned `transformers` builders only expose the remaining configuration arguments.\n *\n * @deprecated Use TransformerRegistry instead.\n *\n * @param factories - Transformer factories keyed by function name\n *\n * @returns Object containing transformer builders and implementations\n *\n * @example\n * const { transformers, implementations } = defineTransformerFunctions({\n *   AddPrefix: () => (value: unknown, prefix: string) => `${prefix}${String(value)}`,\n * })\n *\n * // Use in form definitions\n * transformers.AddPrefix('Mr ')  // { type: 'transformer', name: 'AddPrefix', arguments: ['Mr '] }\n *\n * // Create registry at runtime\n * const registry = createFunctionsRegistry(implementations)\n */\nexport function defineTransformerFunctions<TShapes extends FunctionShapeMap, TDeps = NoDeps>(\n  factories: FunctionImplementations<TShapes, TDeps>,\n): {\n  transformers: TransformerFunctions<TShapes>\n  implementations: FunctionImplementations<TShapes, TDeps>\n}\nexport function defineTransformerFunctions<\n  TTransformers extends TransformerFunctionGroup<TTransformers>,\n  TDeps = NoDeps,\n>(\n  factories: TransformerImplementations<TTransformers, TDeps>,\n): {\n  transformers: TTransformers\n  implementations: FunctionImplementations<ImplementationShapes<'transformer', TTransformers>, TDeps>\n}\nexport function defineTransformerFunctions<TShapes extends FunctionShapeMap, TDeps = NoDeps>(\n  factories: Record<string, unknown>,\n): {\n  transformers: TransformerFunctions<TShapes>\n  implementations: FunctionImplementations<TShapes, TDeps>\n} {\n  ForgeDeprecations.warn(\n    'FORGE_DEP_defineTransformerFunctions',\n    'defineTransformerFunctions is deprecated - use TransformerRegistry instead.',\n  )\n\n  return {\n    transformers: buildExpressionFunctions(factories, FunctionType.TRANSFORMER) as TransformerFunctions<TShapes>,\n    implementations: tagFunctionType(factories, FunctionType.TRANSFORMER) as unknown as FunctionImplementations<\n      TShapes,\n      TDeps\n    >,\n  }\n}\n","import { GeneratorBuilder } from '../../builders/GeneratorBuilder'\nimport type { ChainableGenerator } from '../../builders/types'\nimport { ForgeDeprecations } from '../../../shared/ForgeDeprecations'\nimport { FunctionType } from '../../types/enums'\nimport type {\n  ConditionFunctionExpr,\n  EffectFunctionExpr,\n  TransformerFunctionExpr,\n  ResolvableValue,\n} from '../../types/expressions.type'\nimport type { FunctionImplementations, FunctionShapeMap, NoDeps } from './defineFunction.type'\n\ntype ScopedFunctionFactory<TDeps> = (deps: TDeps) => (...args: never[]) => unknown\ntype ScopedConditionFactory<TDeps, TValue, TArgs extends ResolvableValue[]> = (\n  deps: TDeps,\n) => (value: TValue, ...args: TArgs) => boolean | Promise<boolean>\ntype ScopedTransformerFactory<TDeps, TValue, TArgs extends ResolvableValue[]> = (\n  deps: TDeps,\n) => (value: TValue, ...args: TArgs) => unknown\ntype ScopedEffectFactory<TDeps, TContext, TArgs extends ResolvableValue[]> = (\n  deps: TDeps,\n) => (context: TContext, ...args: TArgs) => void | Promise<void>\ntype ScopedGeneratorFactory<TDeps, TArgs extends ResolvableValue[]> = (deps: TDeps) => (...args: TArgs) => unknown\n\n/**\n * Package-local collector for inline function definitions.\n *\n * Each method stores the dependency-injected factory in `implementations` and\n * returns the normal Forge expression used by journeys, steps, blocks, and hooks.\n *\n * @deprecated Use ConditionRegistry/TransformerRegistry/EffectRegistry/GeneratorRegistry inline instead.\n */\nexport interface FunctionScope<TDeps = NoDeps> {\n  readonly implementations: FunctionImplementations<FunctionShapeMap, TDeps>\n\n  condition<TValue, TArgs extends ResolvableValue[]>(\n    name: string,\n    factory: ScopedConditionFactory<TDeps, TValue, TArgs>,\n    ...args: TArgs\n  ): ConditionFunctionExpr<TArgs>\n\n  transformer<TValue, TArgs extends ResolvableValue[]>(\n    name: string,\n    factory: ScopedTransformerFactory<TDeps, TValue, TArgs>,\n    ...args: TArgs\n  ): TransformerFunctionExpr<TArgs>\n\n  effect<TContext, TArgs extends ResolvableValue[]>(\n    name: string,\n    factory: ScopedEffectFactory<TDeps, TContext, TArgs>,\n    ...args: TArgs\n  ): EffectFunctionExpr<TArgs>\n\n  generator<TArgs extends ResolvableValue[]>(\n    name: string,\n    factory: ScopedGeneratorFactory<TDeps, TArgs>,\n    ...args: TArgs\n  ): ChainableGenerator\n}\n\nconst ensureNameIsValid = (name: string): void => {\n  if (name.length === 0) {\n    throw new Error('Function scope names must not be empty')\n  }\n}\n\nconst isSameFactory = <TDeps>(\n  existingFactory: ScopedFunctionFactory<TDeps>,\n  nextFactory: ScopedFunctionFactory<TDeps>,\n): boolean => {\n  if (existingFactory === nextFactory) {\n    return true\n  }\n\n  return existingFactory.toString() === nextFactory.toString()\n}\n\n/**\n * Create a package-local function scope for one-off authoring functions.\n *\n * Pass `scope.implementations` into `createForgePackage({ functions })` so the\n * collected factories receive the same runtime dependencies as regular\n * `defineEffectFunctions` and `defineTransformerFunctions` implementations.\n *\n * @deprecated Use ConditionRegistry/TransformerRegistry/EffectRegistry/GeneratorRegistry inline instead.\n */\nexport function createFunctionScope<TDeps = NoDeps>(): FunctionScope<TDeps> {\n  ForgeDeprecations.warn(\n    'FORGE_DEP_createFunctionScope',\n    'createFunctionScope is deprecated - use ConditionRegistry/TransformerRegistry/EffectRegistry/GeneratorRegistry inline instead.',\n  )\n\n  const implementations: FunctionImplementations<FunctionShapeMap, TDeps> = {}\n\n  const register = (name: string, factory: ScopedFunctionFactory<TDeps>): void => {\n    ensureNameIsValid(name)\n\n    if (Object.prototype.hasOwnProperty.call(implementations, name)) {\n      if (!isSameFactory(implementations[name] as ScopedFunctionFactory<TDeps>, factory)) {\n        throw new Error(\n          `Function scope already contains a different implementation named \"${name}\". ` +\n            'Reuse a name only for the same inline function, or choose a unique name.',\n        )\n      }\n\n      return\n    }\n\n    implementations[name] = factory\n  }\n\n  return {\n    implementations,\n\n    condition: <TValue, TArgs extends ResolvableValue[]>(\n      name: string,\n      factory: ScopedConditionFactory<TDeps, TValue, TArgs>,\n      ...args: TArgs\n    ): ConditionFunctionExpr<TArgs> => {\n      register(name, factory)\n\n      return {\n        type: FunctionType.CONDITION,\n        name,\n        arguments: args,\n      }\n    },\n\n    transformer: <TValue, TArgs extends ResolvableValue[]>(\n      name: string,\n      factory: ScopedTransformerFactory<TDeps, TValue, TArgs>,\n      ...args: TArgs\n    ): TransformerFunctionExpr<TArgs> => {\n      register(name, factory)\n\n      return {\n        type: FunctionType.TRANSFORMER,\n        name,\n        arguments: args,\n      }\n    },\n\n    effect: <TContext, TArgs extends ResolvableValue[]>(\n      name: string,\n      factory: ScopedEffectFactory<TDeps, TContext, TArgs>,\n      ...args: TArgs\n    ): EffectFunctionExpr<TArgs> => {\n      register(name, factory)\n\n      return {\n        type: FunctionType.EFFECT,\n        name,\n        arguments: args,\n      }\n    },\n\n    generator: <TArgs extends ResolvableValue[]>(\n      name: string,\n      factory: ScopedGeneratorFactory<TDeps, TArgs>,\n      ...args: TArgs\n    ): ChainableGenerator => {\n      register(name, factory)\n\n      return GeneratorBuilder.create(name, args)\n    },\n  }\n}\n","import { AnswerHistory, HookType } from '../../contracts/runtime/answerHistory.type'\nimport type { CookieOptions } from '../../../../framework/types/response.type'\nimport type { ResponseBindings } from '../../../../framework/types/responseBindings.type'\nimport type { RuntimeContext } from '../../contracts/runtime/evaluationState.type'\n\nfunction assertStringParam(value: unknown, method: string, param: string): void {\n  if (typeof value !== 'string') {\n    throw new TypeError(`${method}: ${param} must be a string, got ${typeof value}`)\n  }\n}\n\n/**\n * Asserts that a value is JSON-serializable (no functions, Symbols, BigInts, Dates, or class instances).\n * Recursively checks nested objects and arrays.\n */\nfunction assertSerializable(value: unknown, method: string, path: string[] = []): void {\n  if (typeof value === 'function') {\n    throw new TypeError(`${method}: Cannot set a function as a value (at ${formatAssertPath(path)})`)\n  }\n\n  if (typeof value === 'symbol') {\n    throw new TypeError(`${method}: Cannot set a Symbol as a value (at ${formatAssertPath(path)})`)\n  }\n\n  if (typeof value === 'bigint') {\n    throw new TypeError(`${method}: Cannot set a BigInt as a value (at ${formatAssertPath(path)})`)\n  }\n\n  if (value instanceof Date) {\n    throw new TypeError(\n      `${method}: Cannot set a Date object as a value — use an ISO string instead (at ${formatAssertPath(path)})`,\n    )\n  }\n\n  if (value !== null && typeof value === 'object') {\n    if (!Array.isArray(value) && value.constructor !== Object) {\n      throw new TypeError(\n        `${method}: Cannot set a ${value.constructor.name} instance as a value — use a plain object instead (at ${formatAssertPath(path)})`,\n      )\n    }\n\n    if (Array.isArray(value)) {\n      value.forEach((item, i) => assertSerializable(item, method, [...path, String(i)]))\n    } else {\n      Object.entries(value).forEach(([key, v]) => assertSerializable(v, method, [...path, key]))\n    }\n  }\n}\n\nfunction formatAssertPath(path: string[]): string {\n  return path.length > 0 ? path.join('.') : 'root'\n}\n\n/**\n * User-friendly context object provided to effect functions.\n * Wraps the request/evaluation state with a cleaner API.\n *\n * Provides access to:\n * - Answers (get, set, check, clear) with mutation history tracking\n * - Data (get, set)\n * - Request data (params, query, post, session, state)\n * - Response mutations (headers, cookies)\n *\n * The hookType parameter determines the source recorded when setting answers.\n *\n * @typeParam TData - Type for stored data (accessed via getData/setData)\n * @typeParam TAnswers - Type for form answers (accessed via getAnswer/setAnswer)\n * @typeParam TSession - Type for session object (accessed via getSession)\n * @typeParam TState - Type for request state (accessed via getState)\n *\n * @example\n * // Define your project/journey schemas\n * interface MyData {\n *   assessmentUuid: string\n *   goals: Goal[]\n * }\n *\n * interface MyAnswers {\n *   goalDescription: string\n *   targetDate: string\n * }\n *\n * interface MySession {\n *   user: User\n *   stepsCompleted: string[]\n * }\n *\n * // Create a typed context alias\n * type MyContext = EffectFunctionContext<MyData, MyAnswers, MySession>\n *\n * // Use in effects\n * const myEffect = (context: MyContext) => {\n *   context.getData('assessmentUuid')  // typed as string\n *   context.getData('nonExistent')     // compile error\n * }\n */\nclass EffectFunctionContext<\n  TData extends Record<string, unknown> = Record<string, unknown>,\n  TAnswers extends Record<string, unknown> = Record<string, unknown>,\n  TSession = unknown,\n  TState extends Record<string, unknown> = Record<string, unknown>,\n> {\n  /** @internal */\n  constructor(\n    private readonly context: RuntimeContext,\n    private readonly response: ResponseBindings,\n    private readonly hookType: HookType,\n  ) {}\n\n  /**\n   * Get a specific answer value by key\n   */\n  getAnswer<K extends string & keyof TAnswers>(key: K): TAnswers[K]\n\n  getAnswer<TValue = unknown>(key: string): TValue\n\n  getAnswer<TValue = unknown>(key: string): TValue {\n    return this.context.domain.answers[key]?.current as TValue\n  }\n\n  /**\n   * Set a specific answer value\n   *\n   * Pushes a mutation to the answer's history with the current hookType as source.\n   * This enables precedence logic and delta tracking via mutation history.\n   */\n  setAnswer<K extends string & keyof TAnswers>(key: K, value: TAnswers[K]): void {\n    assertSerializable(value, 'setAnswer', [key])\n\n    const history = this.context.domain.answers[key] ?? { current: undefined, mutations: [] }\n\n    history.mutations.push({ value, source: this.hookType })\n    history.current = value\n    this.context.domain.answers[key] = history\n  }\n\n  /**\n   * Get all answers (current values only, without history)\n   */\n  getAllAnswers(): TAnswers {\n    const result: Record<string, unknown> = {}\n\n    Object.entries(this.context.domain.answers).forEach(([key, history]) => {\n      result[key] = history.current\n    })\n\n    return result as TAnswers\n  }\n\n  /**\n   * Get the full history for an answer\n   *\n   * Returns the complete mutation history including all sources that have set this answer.\n   */\n  getAnswerHistory<K extends string & keyof TAnswers>(key: K): AnswerHistory | undefined {\n    return this.context.domain.answers[key]\n  }\n\n  /**\n   * Get all answer histories\n   *\n   * Returns all answers with their full mutation history.\n   * Useful for calculating custom deltas based on mutation sources.\n   */\n  getAllAnswerHistories(): Record<string, AnswerHistory> {\n    return this.context.domain.answers\n  }\n\n  /**\n   * Check if an answer exists\n   */\n  hasAnswer<K extends string & keyof TAnswers>(key: K): boolean {\n    return key in this.context.domain.answers\n  }\n\n  /**\n   * Remove a specific answer\n   */\n  clearAnswer<K extends string & keyof TAnswers>(key: K): void {\n    delete this.context.domain.answers[key]\n  }\n\n  /**\n   * Get stored data by key\n   */\n  getData<K extends string & keyof TData>(key: K): TData[K]\n\n  getData<TValue = unknown>(key: string): TValue\n\n  getData<TValue = unknown>(key: string): TValue {\n    return this.context.domain.data[key] as TValue\n  }\n\n  /**\n   * Store data in the context\n   */\n  setData<K extends string & keyof TData>(key: K, value: TData[K]): void {\n    assertSerializable(value, 'setData', [key])\n\n    this.context.domain.data[key] = value\n  }\n\n  /**\n   * Get all stored data\n   */\n  getAllData(): TData {\n    return { ...this.context.domain.data } as TData\n  }\n\n  /**\n   * Get the full request URL\n   *\n   * @example\n   * const url = new URL(ctx.getRequestUrl())\n   *\n   * url.origin      // 'https://example.com:3000'\n   * url.pathname    // '/forms/journey/step-one'\n   * url.search      // '?page=1&filter=active'\n   * url.searchParams.get('page')  // '1'\n   * url.hash        // '#section'\n   */\n  getRequestUrl(): string {\n    return this.context.request.url\n  }\n\n  /**\n   * Get a specific route parameter\n   */\n  getRequestParam(key: string): string | undefined {\n    return this.context.request.params[key]\n  }\n\n  /**\n   * Get all route parameters\n   */\n  getAllRequestParams(): Record<string, string> {\n    return { ...this.context.request.params }\n  }\n\n  /**\n   * Get a specific query parameter\n   */\n  getQueryParam(key: string): string | string[] | undefined {\n    return this.context.request.query[key]\n  }\n\n  /**\n   * Get all query parameters\n   */\n  getAllQueryParams(): Record<string, string | string[]> {\n    return { ...this.context.request.query }\n  }\n\n  /**\n   * Get raw POST data (before formatting)\n   */\n  getPostData<TValue = unknown>(key: string): TValue | undefined {\n    return this.context.request.post[key] as TValue | undefined\n  }\n\n  /**\n   * Get all raw POST data (before formatting)\n   */\n  getAllPostData<TValue = Record<string, unknown>>(): TValue {\n    return { ...this.context.request.post } as TValue\n  }\n\n  /**\n   * Get the session object\n   */\n  getSession(): TSession | undefined {\n    return this.context.request.session as TSession | undefined\n  }\n\n  /**\n   * Get a custom request state value by key\n   */\n  getState<K extends string & keyof TState>(key: K): TState[K] | undefined {\n    return this.context.request.state[key] as TState[K] | undefined\n  }\n\n  /**\n   * Get all custom request state data\n   */\n  getAllState(): TState {\n    return { ...this.context.request.state } as TState\n  }\n\n  /**\n   * Get a request header value\n   */\n  getRequestHeader(name: string): string | string[] | undefined {\n    return this.context.request.headers[name]\n  }\n\n  /**\n   * Get all request headers\n   */\n  getAllRequestHeaders(): Record<string, string | string[] | undefined> {\n    return { ...this.context.request.headers }\n  }\n\n  /**\n   * Get a request cookie value\n   */\n  getRequestCookie(name: string): string | undefined {\n    return this.context.request.cookies[name]\n  }\n\n  /**\n   * Get all request cookies\n   */\n  getAllRequestCookies(): Record<string, string | undefined> {\n    return { ...this.context.request.cookies }\n  }\n\n  /**\n   * Set a response header via the adapter-provided response bindings.\n   * Setting the same header multiple times will overwrite the previous value.\n   */\n  setResponseHeader(name: string, value: string): void {\n    assertStringParam(name, 'setResponseHeader', 'name')\n    assertStringParam(value, 'setResponseHeader', 'value')\n\n    this.response.setHeader(name, value)\n  }\n\n  /**\n   * Set a cookie via the adapter-provided response bindings.\n   * To clear a cookie, use maxAge: 0.\n   *\n   * @example\n   * // Set a cookie with options\n   * context.setResponseCookie('preference', 'dark', {\n   *   maxAge: 30 * 24 * 60 * 60 * 1000, // 30 days\n   *   httpOnly: true,\n   *   secure: true,\n   *   sameSite: 'lax',\n   * })\n   *\n   * // Clear a cookie\n   * context.setResponseCookie('preference', '', { maxAge: 0 })\n   */\n  setResponseCookie(name: string, value: string, options?: CookieOptions): void {\n    assertStringParam(name, 'setResponseCookie', 'name')\n    assertStringParam(value, 'setResponseCookie', 'value')\n\n    this.response.setCookie(name, value, options)\n  }\n\n  /**\n   * Get the field codes the answer-cleardown phase resolved as stale: field codes on\n   * unreachable steps plus answer keys matching their `cleardownFieldCodes` patterns.\n   * The engine has already pushed a clearing `cleardown` mutation onto each of these\n   * answers; use this list to drop them from your own store when persisting. Empty for\n   * hooks that run before the cleardown phase (access hooks).\n   */\n  getFieldsToClear(): string[] {\n    return [...(this.context.evaluation.fieldsToClear ?? [])]\n  }\n}\n\nexport default EffectFunctionContext\nexport { EffectFunctionContext }\n"],"mappings":";;;;;;;;AAKA,IAAY,eAAL,yBAAA,cAAA;CACL,aAAA,eAAA;CACA,aAAA,iBAAA;CACA,aAAA,eAAA;CACA,aAAA,YAAA;;AACF,EAAA,CAAA,CAAA;;;;;AAMA,IAAY,gBAAL,yBAAA,eAAA;CACL,cAAA,WAAA;CACA,cAAA,aAAA;CACA,cAAA,UAAA;;AACF,EAAA,CAAA,CAAA;;;;;AAMA,IAAY,YAAL,yBAAA,WAAA;CACL,UAAA,WAAA;CACA,UAAA,WAAA;;AACF,EAAA,CAAA,CAAA;;;;;;AAOA,IAAY,iBAAL,yBAAA,gBAAA;CACL,eAAA,eAAA;CACA,eAAA,cAAA;CACA,eAAA,aAAA;CACA,eAAA,UAAA;CACA,eAAA,gBAAA;CACA,eAAA,aAAA;CACA,eAAA,iBAAA;CACA,eAAA,WAAA;CACA,eAAA,iBAAA;;AACF,EAAA,CAAA,CAAA;;;;;;;AAiCA,IAAY,0BAAL,yBAAA,yBAAA;CACL,wBAAA,SAAA;CACA,wBAAA,QAAA;CACA,wBAAA,SAAA;CACA,wBAAA,SAAA;;AACF,EAAA,CAAA,CAAA;;;ACjFA,SAAS,kBAAkB,KAAkC;CAC3D,OAAO,OAAO,QAAQ,IAAI,SAAA;AAC5B;AAEA,SAAgB,uBAAuB,KAAuC;CAC5E,OAAO,kBAAkB,GAAG,KAAK,IAAI,cAAA;AACvC;;;;;;;;;;ACEA,MAAa,mBAAmB,SAAgD;CAC9E,IAAI,OAAO,MAAM,sBAAsB,YACrC,OAAO,CAAC;CAGV,MAAM,OAAiB,CAAC;CACxB,MAAM,gBAAgB,MAAM;CAI5B,MAAM,kBAAkB;CACxB,IAAI;EACF,MAAM,kB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