@vectoriox/iox-ui 5.82.1 → 5.83.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/design-core/index.d.ts +200 -0
  2. package/fesm2022/vectoriox-iox-ui-design-core.mjs +215 -1
  3. package/fesm2022/vectoriox-iox-ui-design-core.mjs.map +1 -1
  4. package/fesm2022/vectoriox-iox-ui-forms-core.mjs +733 -56
  5. package/fesm2022/vectoriox-iox-ui-forms-core.mjs.map +1 -1
  6. package/fesm2022/vectoriox-iox-ui-generation-core.mjs +40 -4
  7. package/fesm2022/vectoriox-iox-ui-generation-core.mjs.map +1 -1
  8. package/fesm2022/vectoriox-iox-ui.mjs +1547 -135
  9. package/fesm2022/vectoriox-iox-ui.mjs.map +1 -1
  10. package/forms-core/index.d.ts +366 -18
  11. package/generation-core/index.d.ts +3 -0
  12. package/index.d.ts +303 -25
  13. package/package.json +1 -1
  14. package/src/design-core/contrast-audit.ts +4 -0
  15. package/src/design-core/flavor-spec.generated.ts +209 -1
  16. package/src/forms-core/channel.ts +85 -0
  17. package/src/forms-core/collect.ts +63 -30
  18. package/src/forms-core/dates.ts +299 -0
  19. package/src/forms-core/field-markup.ts +159 -0
  20. package/src/forms-core/form-presets.ts +51 -2
  21. package/src/forms-core/form.model.ts +34 -2
  22. package/src/forms-core/messages.ts +31 -0
  23. package/src/forms-core/public-api.ts +3 -0
  24. package/src/forms-core/rule-catalog.ts +3 -2
  25. package/src/forms-core/submit-lifecycle.ts +42 -12
  26. package/src/forms-core/validate.ts +90 -4
  27. package/src/generation-core/audit-site.ts +9 -1
  28. package/src/generation-core/compose-site.ts +22 -3
  29. package/src/generation-core/node-baselines.generated.ts +10 -0
  30. package/src/generation-core/plan-wire.ts +2 -2
  31. package/styles/iox-design.css +14 -2
  32. package/styles/iox-forms.css +349 -10
@@ -1 +1 @@
1
- {"version":3,"file":"vectoriox-iox-ui-forms-core.mjs","sources":["../../../projects/iox-ui/src/forms-core/form.model.ts","../../../projects/iox-ui/src/forms-core/messages.ts","../../../projects/iox-ui/src/forms-core/validate.ts","../../../projects/iox-ui/src/forms-core/options.ts","../../../projects/iox-ui/src/forms-core/collect.ts","../../../projects/iox-ui/src/forms-core/runtime.ts","../../../projects/iox-ui/src/forms-core/rule-catalog.ts","../../../projects/iox-ui/src/forms-core/transport.ts","../../../projects/iox-ui/src/forms-core/submit-lifecycle.ts","../../../projects/iox-ui/src/forms-core/form-presets.ts","../../../projects/iox-ui/src/forms-core/nesting.ts","../../../projects/iox-ui/src/forms-core/public-api.ts","../../../projects/iox-ui/src/forms-core/vectoriox-iox-ui-forms-core.ts"],"sourcesContent":["// The persisted shape of a form. Pure types + the one derived constant each renderer needs.\n//\n// A FormSpec is DERIVED from the node tree (see `collect.ts`), never hand-maintained beside it —\n// there is one source of truth for \"what fields does this form have\", and it is the tree the author\n// edited. The builder writes the derived spec into the saved page so the SERVER can re-validate\n// against it without re-implementing the builder's tree walk.\n\n/** What the visitor actually types into. Chosen by a trait; it also implies a validation rule. */\nexport enum ControlType {\n Text = 'text',\n Email = 'email',\n Tel = 'tel',\n Url = 'url',\n Number = 'number',\n Password = 'password',\n Textarea = 'textarea',\n Select = 'select',\n Checkbox = 'checkbox',\n /** A checkbox in switch clothing (role=\"switch\") — consent toggles, settings-style forms. */\n Switch = 'switch',\n /** A slider over a numeric range — min/max/step ride the field. */\n Range = 'range',\n Radio = 'radio',\n Date = 'date',\n Time = 'time',\n File = 'file',\n /** Not shown; carries a constant or a bound value (campaign, source page, …). */\n Hidden = 'hidden',\n}\n\n/** The v1 rule grammar. Phase 3's conditional logic reuses these same names for its conditions. */\nexport enum RuleName {\n Required = 'required',\n MinLength = 'minLength',\n MaxLength = 'maxLength',\n Min = 'min',\n Max = 'max',\n Pattern = 'pattern',\n /** Cross-field: this value must equal another field's (confirm email / password). */\n Matches = 'matches',\n /** A checkbox that must be ticked — terms, consent. */\n Accepted = 'accepted',\n FileType = 'fileType',\n FileSize = 'fileSize',\n}\n\n/** Named regexes so an author picks \"Email\" rather than writing one. */\nexport enum PatternPreset {\n Email = 'email',\n Phone = 'phone',\n Url = 'url',\n Digits = 'digits',\n Letters = 'letters',\n Slug = 'slug',\n}\n\n/**\n * Deliberately permissive. A validator that rejects `user+tag@sub.domain.co.uk` or a real-world\n * phone number is worse than one that lets a typo through: the address gets verified by sending to\n * it, and a false rejection is a lost lead with no recourse.\n */\nexport const PATTERN_PRESETS: Readonly<Record<PatternPreset, RegExp>> = Object.freeze({\n [PatternPreset.Email]: /^[^\\s@]+@[^\\s@.]+(\\.[^\\s@.]+)+$/,\n [PatternPreset.Phone]: /^\\+?[\\d\\s().-]{6,20}$/,\n [PatternPreset.Url]: /^(https?:\\/\\/)?[^\\s.]+\\.[^\\s]{2,}$/i,\n [PatternPreset.Digits]: /^\\d+$/,\n [PatternPreset.Letters]: /^[\\p{L}\\s'-]+$/u,\n [PatternPreset.Slug]: /^[a-z0-9]+(-[a-z0-9]+)*$/,\n});\n\nexport interface ValidationRule {\n name: RuleName;\n /** `{ n }` for lengths/bounds · `{ preset } | { regex }` for pattern · `{ field }` for matches. */\n params?: Record<string, any>;\n /** Author's override. Absent → the shared message catalog supplies a translated key. */\n message?: string;\n}\n\nexport interface FieldOption {\n label: string;\n value: string;\n}\n\n/** Options pulled from a data source instead of typed by hand (a Select of CMS categories). */\nexport interface FieldOptionSource {\n source: string;\n sourcePath?: string;\n valuePath: string;\n labelPath: string;\n}\n\nexport interface FieldSpec {\n /** The submitted key. Derived from the label, unique within the form, editable. */\n name: string;\n control: ControlType;\n label: string;\n /** Surfaced as its own switch in the panel rather than buried in the rule list. */\n required?: boolean;\n rules?: ValidationRule[];\n options?: FieldOption[];\n optionsSource?: FieldOptionSource;\n defaultValue?: any;\n}\n\n/** When a field is validated, once the author has stopped deciding it per field. */\nexport enum FeedbackTiming {\n /** Validate on submit, then live per-field once that field has been touched or has failed. */\n Smart = 'smart',\n Submit = 'submit',\n Live = 'live',\n}\n\n/** What happens to a submission, in order. Card #1 (`store`) is always present. */\nexport interface SubmitAction {\n type: string;\n config?: Record<string, any>;\n /** `retry` (default) · `fail` · `ignore`. */\n onFailure?: 'retry' | 'fail' | 'ignore';\n}\n\nexport interface FormSpec {\n formId: string;\n /** Author-facing name — the submissions inbox groups by it. */\n name: string;\n feedback: FeedbackTiming;\n fields: FieldSpec[];\n actions: SubmitAction[];\n antiSpam: { honeypot: boolean; minFillMs: number; turnstile?: boolean };\n retention?: { days: number };\n}\n\n/**\n * The rule a control type implies with no configuration. Choosing \"Email\" IS choosing email\n * validation — the single biggest reason the panel can stay empty and still validate well.\n */\nexport const IMPLIED_PATTERN: Readonly<Partial<Record<ControlType, PatternPreset>>> = Object.freeze({\n [ControlType.Email]: PatternPreset.Email,\n [ControlType.Tel]: PatternPreset.Phone,\n [ControlType.Url]: PatternPreset.Url,\n});\n\n/** Controls whose value is a list rather than a scalar. */\nexport const MULTI_VALUE_CONTROLS: ReadonlySet<ControlType> = new Set([ControlType.File]);\n","// The default message for every rule, as an i18n KEY — never a rendered string.\n//\n// This is what lets the Validation panel stay empty and still produce good errors: an author who\n// configures nothing gets \"Enter a valid email address\", not \"Invalid\". The author's own `message`\n// on a rule always wins; this is the fallback, and it is the only place a default lives.\n//\n// Consumers translate the key with their own i18n (the CMS client via ngx-translate, the engine via\n// the page's locale bundle). The backend returns the key too, so a server-side rejection renders in\n// the visitor's language rather than in the server's.\n\nimport { RuleName } from './form.model';\n\n/** Namespace for every forms validation key. Keep in sync with `en.json` / `he.json`. */\nexport const MESSAGE_NAMESPACE = 'forms.validation';\n\n/**\n * Rule → i18n key. Params travel beside the key (`{ n: 8 }`, `{ field: 'Email' }`) so a translation\n * can place the number wherever its grammar needs it, rather than having it baked into the string.\n */\nexport const RULE_MESSAGE_KEYS: Readonly<Record<RuleName, string>> = Object.freeze({\n [RuleName.Required]: `${MESSAGE_NAMESPACE}.required`,\n [RuleName.MinLength]: `${MESSAGE_NAMESPACE}.minLength`,\n [RuleName.MaxLength]: `${MESSAGE_NAMESPACE}.maxLength`,\n [RuleName.Min]: `${MESSAGE_NAMESPACE}.min`,\n [RuleName.Max]: `${MESSAGE_NAMESPACE}.max`,\n // ⚠️ `.pattern.generic`, not `.pattern`: the preset keys below live UNDER `pattern`, and a JSON\n // translation bundle cannot have the same key be both a string and an object — ngx-translate\n // would hand back the object (or the raw key) for the generic case.\n [RuleName.Pattern]: `${MESSAGE_NAMESPACE}.pattern.generic`,\n [RuleName.Matches]: `${MESSAGE_NAMESPACE}.matches`,\n [RuleName.Accepted]: `${MESSAGE_NAMESPACE}.accepted`,\n [RuleName.FileType]: `${MESSAGE_NAMESPACE}.fileType`,\n [RuleName.FileSize]: `${MESSAGE_NAMESPACE}.fileSize`,\n});\n\n/**\n * A pattern failure deserves better than \"Invalid format\". Each preset gets its own key so the\n * message can say what a valid value looks like, which is the difference between a visitor fixing\n * a typo and a visitor giving up.\n */\nexport const PATTERN_MESSAGE_KEYS: Readonly<Record<string, string>> = Object.freeze({\n email: `${MESSAGE_NAMESPACE}.pattern.email`,\n phone: `${MESSAGE_NAMESPACE}.pattern.phone`,\n url: `${MESSAGE_NAMESPACE}.pattern.url`,\n digits: `${MESSAGE_NAMESPACE}.pattern.digits`,\n letters: `${MESSAGE_NAMESPACE}.pattern.letters`,\n slug: `${MESSAGE_NAMESPACE}.pattern.slug`,\n});\n\n/** Form-level outcomes the visitor sees in the Error state. One designed block, five reasons. */\nexport const FORM_ERROR_KEYS = Object.freeze({\n Network: `${MESSAGE_NAMESPACE}.form.network`,\n Rejected: `${MESSAGE_NAMESPACE}.form.rejected`,\n Spam: `${MESSAGE_NAMESPACE}.form.spam`,\n RateLimited: `${MESSAGE_NAMESPACE}.form.rateLimited`,\n Server: `${MESSAGE_NAMESPACE}.form.server`,\n});\n\n/** The English defaults, so a consumer that has not added the keys yet still shows real text. */\nexport const DEFAULT_EN_MESSAGES: Readonly<Record<string, string>> = Object.freeze({\n [RULE_MESSAGE_KEYS[RuleName.Required]]: 'This field is required',\n [RULE_MESSAGE_KEYS[RuleName.MinLength]]: 'Use at least {{n}} characters',\n [RULE_MESSAGE_KEYS[RuleName.MaxLength]]: 'Use no more than {{n}} characters',\n [RULE_MESSAGE_KEYS[RuleName.Min]]: 'Enter {{n}} or more',\n [RULE_MESSAGE_KEYS[RuleName.Max]]: 'Enter {{n}} or less',\n [RULE_MESSAGE_KEYS[RuleName.Pattern]]: 'Check the format of this value',\n [RULE_MESSAGE_KEYS[RuleName.Matches]]: 'This must match {{field}}',\n [RULE_MESSAGE_KEYS[RuleName.Accepted]]: 'Please tick this to continue',\n [RULE_MESSAGE_KEYS[RuleName.FileType]]: 'That file type isn’t accepted',\n [RULE_MESSAGE_KEYS[RuleName.FileSize]]: 'That file is larger than {{n}}MB',\n [PATTERN_MESSAGE_KEYS['email']]: 'Enter a valid email address',\n [PATTERN_MESSAGE_KEYS['phone']]: 'Enter a valid phone number',\n [PATTERN_MESSAGE_KEYS['url']]: 'Enter a valid web address',\n [PATTERN_MESSAGE_KEYS['digits']]: 'Use digits only',\n [PATTERN_MESSAGE_KEYS['letters']]: 'Use letters only',\n [PATTERN_MESSAGE_KEYS['slug']]: 'Use lowercase letters, numbers and hyphens',\n [FORM_ERROR_KEYS.Network]: 'We couldn’t reach the server — check your connection and try again',\n [FORM_ERROR_KEYS.Rejected]: 'Some answers need fixing',\n [FORM_ERROR_KEYS.Spam]: 'We couldn’t accept this submission',\n [FORM_ERROR_KEYS.RateLimited]: 'Too many attempts — please wait a moment and try again',\n [FORM_ERROR_KEYS.Server]: 'Something went wrong on our side — your answers are still here',\n});\n","// The validator. ONE implementation, run by the builder canvas, the SSR engine and `iox-cms`.\n//\n// Client-side validation is UX; server-side validation is truth. Because both call this function,\n// a visitor can never be told a value is fine and then have the server reject it, and a hand-crafted\n// POST can never bypass a rule the author configured.\n\nimport {\n ControlType,\n FieldSpec,\n FormSpec,\n IMPLIED_PATTERN,\n PATTERN_PRESETS,\n PatternPreset,\n RuleName,\n ValidationRule,\n} from './form.model';\nimport { PATTERN_MESSAGE_KEYS, RULE_MESSAGE_KEYS } from './messages';\n\nexport interface FieldError {\n /** i18n key, or the author's own override string when they set one. */\n messageKey: string;\n /** Interpolation values (`{ n: 8 }`, `{ field: 'Email' }`). */\n params?: Record<string, any>;\n}\n\nexport interface FieldResult extends Partial<FieldError> {\n valid: boolean;\n}\n\nexport interface FormResult {\n valid: boolean;\n /** Keyed by field name. Empty when valid. */\n errors: Record<string, FieldError>;\n}\n\n/** A file, as either runtime hands it over. Kept structural so this file imports no DOM types. */\ninterface FileLike {\n name?: string;\n size?: number;\n type?: string;\n}\n\n/**\n * Validate one field's value.\n *\n * Order is deliberate and is part of the contract:\n * 1. `required` (or `accepted` for a checkbox) — the only rules an EMPTY value can fail.\n * 2. Everything else, in the order the author arranged them, but ONLY for a non-empty value.\n *\n * That second point is what stops an optional \"Phone\" field from shouting \"enter a valid phone\n * number\" at someone who simply left it blank — the single most common validation-UX bug.\n * The FIRST failure wins: a visitor fixes one thing at a time.\n */\nexport function validateField(\n value: unknown,\n spec: FieldSpec,\n form: Record<string, unknown> = {},\n): FieldResult {\n const rules = effectiveRules(spec);\n const empty = isEmpty(value, spec.control);\n\n for (const rule of rules) {\n const appliesToEmpty = rule.name === RuleName.Required || rule.name === RuleName.Accepted;\n if (empty && !appliesToEmpty) continue;\n\n const failure = check(rule, value, spec, form);\n if (failure) {\n return {\n valid: false,\n messageKey: rule.message ?? failure.messageKey,\n params: failure.params,\n };\n }\n }\n return { valid: true };\n}\n\n/**\n * Validate a whole submission. Every field is checked (not short-circuited at the first bad one) so\n * the visitor sees every problem at once instead of fixing them one reload at a time.\n */\nexport function validateForm(\n values: Record<string, unknown>,\n spec: FormSpec,\n): FormResult {\n const errors: Record<string, FieldError> = {};\n for (const field of spec.fields ?? []) {\n const result = validateField(values?.[field.name], field, values ?? {});\n if (!result.valid) {\n errors[field.name] = { messageKey: result.messageKey!, params: result.params };\n }\n }\n return { valid: Object.keys(errors).length === 0, errors };\n}\n\n/** The name of the first field with an error, in spec order — what the browser should focus. */\nexport function firstInvalidField(spec: FormSpec, errors: Record<string, FieldError>): string | null {\n for (const field of spec.fields ?? []) if (errors[field.name]) return field.name;\n return null;\n}\n\n// ─── internals ───────────────────────────────────────────────────────────────\n\n/**\n * The author's rules, plus the ones the field's own configuration implies: `required` from the\n * switch (rather than making the author add a rule for the commonest case) and the pattern implied\n * by an Email/Tel/Url control. An explicitly declared rule of the same name always wins, so an\n * author who sets their own `pattern` on an Email field is not fighting an invisible second one.\n */\nfunction effectiveRules(spec: FieldSpec): ValidationRule[] {\n const declared = spec.rules ?? [];\n const has = (name: RuleName) => declared.some(r => r.name === name);\n const implied: ValidationRule[] = [];\n\n if (spec.required && !has(RuleName.Required)) {\n // A checkbox's \"required\" means TICKED, which is a different message and a different check.\n implied.push(spec.control === ControlType.Checkbox\n ? { name: RuleName.Accepted }\n : { name: RuleName.Required });\n }\n\n const preset = IMPLIED_PATTERN[spec.control];\n if (preset && !has(RuleName.Pattern)) {\n implied.push({ name: RuleName.Pattern, params: { preset } });\n }\n\n return [...implied, ...declared];\n}\n\n/** Empty means \"the visitor gave us nothing\" — per control type, not a blanket falsy check. */\nfunction isEmpty(value: unknown, control: ControlType): boolean {\n if (value === null || value === undefined) return true;\n if (control === ControlType.Checkbox) return value === false;\n if (Array.isArray(value)) return value.length === 0;\n if (typeof value === 'string') return value.trim() === '';\n return false;\n}\n\nfunction check(\n rule: ValidationRule,\n value: unknown,\n spec: FieldSpec,\n form: Record<string, unknown>,\n): FieldError | null {\n const fail = (messageKey: string, params?: Record<string, any>): FieldError => ({ messageKey, params });\n const defaultKey = RULE_MESSAGE_KEYS[rule.name];\n const n = Number(rule.params?.['n']);\n\n switch (rule.name) {\n case RuleName.Required:\n return isEmpty(value, spec.control) ? fail(defaultKey) : null;\n\n case RuleName.Accepted:\n return value === true ? null : fail(defaultKey);\n\n case RuleName.MinLength:\n return text(value).length < n ? fail(defaultKey, { n }) : null;\n\n case RuleName.MaxLength:\n return text(value).length > n ? fail(defaultKey, { n }) : null;\n\n case RuleName.Min: {\n const num = numeric(value);\n return num === null || num < n ? fail(defaultKey, { n }) : null;\n }\n\n case RuleName.Max: {\n const num = numeric(value);\n return num === null || num > n ? fail(defaultKey, { n }) : null;\n }\n\n case RuleName.Pattern: {\n const regex = patternFor(rule);\n if (!regex) return null; // an unparsable custom regex must not block a submission\n if (regex.test(text(value))) return null;\n const preset = rule.params?.['preset'] as string | undefined;\n return fail((preset && PATTERN_MESSAGE_KEYS[preset]) || defaultKey);\n }\n\n case RuleName.Matches: {\n const other = String(rule.params?.['field'] ?? '');\n return text(value) === text(form?.[other]) ? null : fail(defaultKey, { field: other });\n }\n\n case RuleName.FileType: {\n const accepted = list(rule.params?.['types']).map(t => t.toLowerCase().replace(/^\\./, ''));\n if (!accepted.length) return null;\n const bad = files(value).some(f => {\n const ext = (f.name ?? '').split('.').pop()?.toLowerCase() ?? '';\n const mime = (f.type ?? '').toLowerCase();\n return !accepted.some(t => t === ext || mime === t || mime.startsWith(t + '/'));\n });\n return bad ? fail(defaultKey, { types: accepted.join(', ') }) : null;\n }\n\n case RuleName.FileSize: {\n const maxBytes = n * 1024 * 1024;\n return files(value).some(f => (f.size ?? 0) > maxBytes) ? fail(defaultKey, { n }) : null;\n }\n\n default:\n return null;\n }\n}\n\nfunction patternFor(rule: ValidationRule): RegExp | null {\n const preset = rule.params?.['preset'] as PatternPreset | undefined;\n if (preset && PATTERN_PRESETS[preset]) return PATTERN_PRESETS[preset];\n const custom = rule.params?.['regex'];\n if (typeof custom !== 'string' || !custom) return null;\n // A malformed regex is the AUTHOR's mistake; failing open is the only safe reading, because\n // failing closed would make a live form permanently unsubmittable for every visitor.\n try { return new RegExp(custom); } catch { return null; }\n}\n\nconst text = (value: unknown): string =>\n value === null || value === undefined ? '' : String(value).trim();\n\nfunction numeric(value: unknown): number | null {\n const parsed = typeof value === 'number' ? value : parseFloat(text(value));\n return Number.isFinite(parsed) ? parsed : null;\n}\n\nconst list = (value: unknown): string[] =>\n Array.isArray(value) ? value.map(String)\n : typeof value === 'string' ? value.split(',').map(s => s.trim()).filter(Boolean)\n : [];\n\nconst files = (value: unknown): FileLike[] =>\n Array.isArray(value) ? value as FileLike[]\n : value && typeof value === 'object' ? [value as FileLike]\n : [];\n","import { FieldOption } from './form.model';\n\n/** `value|Label` separates a submitted value from what the visitor reads; a bare line is both. */\nconst OPTION_SEPARATOR = '|';\n\n/**\n * A Field's `optionsText` trait — the author's choices, one per line — as options. ONE parser for the\n * builder canvas, both engine paths and iox-cms: until 2026-10-19 nothing parsed the trait, so a Radio\n * group or a Dropdown from the tray rendered no choices at all on the canvas and on the live site.\n */\nexport function parseFieldOptions(text: unknown): FieldOption[] {\n if (typeof text !== 'string') return [];\n const out: FieldOption[] = [];\n for (const line of text.split(/\\r?\\n/)) {\n const raw = line.trim();\n if (!raw) continue;\n const at = raw.indexOf(OPTION_SEPARATOR);\n const value = (at === -1 ? raw : raw.slice(0, at)).trim();\n const label = (at === -1 ? raw : raw.slice(at + 1)).trim() || value;\n if (value) out.push({ value, label });\n }\n return out;\n}\n\n/** The choices a saved Field offers: an explicit `options` list wins, else its `optionsText` parsed. */\nexport function fieldOptionsOf(props: { options?: unknown; optionsText?: unknown } | null | undefined): FieldOption[] {\n if (Array.isArray(props?.options) && props!.options.length) return props!.options as FieldOption[];\n return parseFieldOptions(props?.optionsText);\n}\n","// Derive a FormSpec from a node tree.\n//\n// The tree the author edited is the SINGLE source of truth for \"what fields does this form have\".\n// The spec is derived from it — never maintained beside it — so a field cannot exist in one and not\n// the other. The builder runs this on save and stores the result in the page document; the backend\n// reads THAT stored spec to re-validate a submission (it must never trust a spec sent by the\n// browser). See iox-ai-guidance `architecture/builder/forms-and-inputs-plan.md` §5.1 and D11.\n\nimport {\n ControlType,\n FeedbackTiming,\n FieldSpec,\n FormSpec,\n RuleName,\n SubmitAction,\n ValidationRule,\n} from './form.model';\nimport { fieldOptionsOf } from './options';\n\n/** The minimum a node must look like. Structural on purpose: this file knows no renderer. */\nexport interface FormNodeLike {\n type: string;\n props?: Record<string, any>;\n children?: FormNodeLike[];\n}\n\nexport const FORM_NODE_TYPE = 'Form';\nexport const FIELD_NODE_TYPE = 'Field';\n\n/** Always present, never removable — the safety net that makes \"store first, deliver after\" true. */\nexport const STORE_ACTION: SubmitAction = Object.freeze({ type: 'store' });\n\n/**\n * Turn a label into the key that arrives in the submitted data — `Full name` → `fullName`.\n * Authors never have to invent keys (decision: auto-derive, with an editable override).\n *\n * Diacritics are stripped rather than dropped, so a Hebrew or accented label still yields a usable\n * ASCII key instead of an empty one; a label with no usable characters falls back to `field`.\n */\nexport function deriveFieldName(label: string): string {\n const words = (label ?? '')\n .normalize('NFD').replace(/[̀-ͯ]/g, '')\n .replace(/[^a-zA-Z0-9]+/g, ' ')\n .trim()\n .split(/\\s+/)\n .filter(Boolean);\n if (!words.length) return 'field';\n const [first, ...rest] = words;\n const name = first.toLowerCase() + rest.map(w => w[0].toUpperCase() + w.slice(1).toLowerCase()).join('');\n // A key must not start with a digit — it ends up as an object key and a form control id.\n return /^\\d/.test(name) ? `field${name}` : name;\n}\n\n/** Make `name` unique within `taken`, appending 2, 3, … — two \"Email\" fields must not collide. */\nexport function uniqueFieldName(name: string, taken: ReadonlySet<string>): string {\n if (!taken.has(name)) return name;\n let n = 2;\n while (taken.has(`${name}${n}`)) n++;\n return `${name}${n}`;\n}\n\n/**\n * Walk a Form subtree and produce its spec.\n *\n * Nested forms are not collected: a Field belongs to its NEAREST ancestor Form (decision D1), so the\n * walk stops at any inner Form node rather than stealing its fields.\n */\nexport function collectFormSpec(node: FormNodeLike | null | undefined): FormSpec | null {\n if (!node || node.type !== FORM_NODE_TYPE) return null;\n const props = node.props ?? {};\n\n const fields: FieldSpec[] = [];\n const taken = new Set<string>();\n for (const fieldNode of collectFieldNodes(node.children ?? [])) {\n const spec = toFieldSpec(fieldNode, taken);\n taken.add(spec.name);\n fields.push(spec);\n }\n\n return {\n formId: props['formId'] ?? '',\n name: props['name'] ?? 'Form',\n feedback: (props['feedback'] as FeedbackTiming) ?? FeedbackTiming.Smart,\n fields,\n actions: normaliseActions(props['actions']),\n antiSpam: {\n honeypot: props['honeypot'] !== false,\n minFillMs: Number(props['minFillMs'] ?? 1200),\n ...(props['turnstile'] ? { turnstile: true } : {}),\n },\n ...(props['retentionDays'] ? { retention: { days: Number(props['retentionDays']) } } : {}),\n };\n}\n\n/** Every Field in this subtree, in document order, not descending into a nested Form. */\nexport function collectFieldNodes(nodes: readonly FormNodeLike[]): FormNodeLike[] {\n const out: FormNodeLike[] = [];\n for (const node of nodes ?? []) {\n if (!node?.type) continue;\n if (node.type === FORM_NODE_TYPE) continue; // a nested form owns its own fields\n if (node.type === FIELD_NODE_TYPE) { out.push(node); continue; }\n out.push(...collectFieldNodes(node.children ?? []));\n }\n return out;\n}\n\nfunction toFieldSpec(node: FormNodeLike, taken: ReadonlySet<string>): FieldSpec {\n const props = node.props ?? {};\n const label = props['label'] ?? '';\n // The author's explicit override wins; otherwise derive from the label.\n const name = uniqueFieldName(props['name'] || deriveFieldName(label), taken);\n\n const spec: FieldSpec = {\n name,\n control: (props['control'] as ControlType) ?? ControlType.Text,\n label,\n };\n if (props['required']) spec.required = true;\n const rules = normaliseRules(props['rules']);\n if (rules.length) spec.rules = rules;\n const options = fieldOptionsOf(props);\n if (options.length) spec.options = options;\n if (props['optionsSource']) spec.optionsSource = props['optionsSource'];\n if (props['defaultValue'] !== undefined && props['defaultValue'] !== '') {\n spec.defaultValue = props['defaultValue'];\n }\n return spec;\n}\n\n/** Drop anything that isn't a rule we know — a hand-edited page must not break validation. */\nfunction normaliseRules(raw: unknown): ValidationRule[] {\n if (!Array.isArray(raw)) return [];\n const known = new Set<string>(Object.values(RuleName));\n return raw\n .filter(r => r && known.has(r.name))\n .map(r => ({\n name: r.name as RuleName,\n ...(r.params ? { params: r.params } : {}),\n ...(r.message ? { message: r.message } : {}),\n }));\n}\n\n/** `store` is always first and always present, however the page was edited. */\nfunction normaliseActions(raw: unknown): SubmitAction[] {\n const declared: SubmitAction[] = Array.isArray(raw)\n ? raw.filter(a => a && typeof a.type === 'string')\n : [];\n return [STORE_ACTION, ...declared.filter(a => a.type !== STORE_ACTION.type)];\n}\n","// When a field's error is allowed to be VISIBLE — the pure half of the form runtime.\n//\n// Validity and visibility are different questions. A field can be invalid from the moment the page\n// loads (an empty required field always is), but showing that immediately means greeting a visitor\n// with a wall of red before they have typed anything. This module owns the second question, and it\n// owns it in one place so the builder canvas, the SSR engine and any future runtime agree.\n//\n// Framework-free, like the rest of forms-core.\n\nimport { FeedbackTiming, FormSpec } from './form.model';\nimport { FieldError, validateField, validateForm } from './validate';\n\n/** Everything the runtime needs to remember. Immutable — each transition returns a new state. */\nexport interface FormRuntimeState {\n /** Field names the visitor has left (blurred) at least once. */\n touched: ReadonlySet<string>;\n /** True once a submit has been attempted — after that, every error is fair game. */\n submitted: boolean;\n /** The current errors, whether or not they are being shown. */\n errors: Readonly<Record<string, FieldError>>;\n /** In flight — the submit button shows its loading label and the form is aria-busy. */\n submitting: boolean;\n}\n\nexport const INITIAL_FORM_STATE: FormRuntimeState = Object.freeze({\n touched: new Set<string>(),\n submitted: false,\n errors: {},\n submitting: false,\n});\n\n/**\n * Should this field's error be on screen right now?\n *\n * - `Submit` — only after a submit attempt. Quietest; nothing moves while typing.\n * - `Live` — as soon as it is invalid. Loudest; shouts at a half-typed email address.\n * - `Smart` — the default, and the reason the author gets one dropdown instead of a decision per\n * field: stay quiet until the visitor has either left the field or tried to submit.\n * After that, correct live, so fixing an error clears it as they type.\n */\nexport function shouldShowError(\n fieldName: string,\n state: FormRuntimeState,\n timing: FeedbackTiming | string = FeedbackTiming.Smart,\n): boolean {\n if (!state.errors[fieldName]) return false;\n switch (timing) {\n case FeedbackTiming.Live: return true;\n case FeedbackTiming.Submit: return state.submitted;\n default: return state.submitted || state.touched.has(fieldName);\n }\n}\n\n/**\n * Re-validate one field after a change. Only that field is re-checked, EXCEPT that a `matches` rule\n * makes another field's validity depend on this one — so a confirm-email field stops being wrong\n * the moment you fix the address it points at, rather than waiting for its own blur.\n */\nexport function onFieldChange(\n state: FormRuntimeState,\n fieldName: string,\n values: Record<string, unknown>,\n spec: FormSpec,\n): FormRuntimeState {\n const errors = { ...state.errors };\n const affected = [fieldName, ...dependentsOf(fieldName, spec)];\n\n for (const name of affected) {\n const field = (spec.fields ?? []).find(f => f.name === name);\n if (!field) continue;\n const result = validateField(values?.[name], field, values ?? {});\n if (result.valid) delete errors[name];\n else errors[name] = { messageKey: result.messageKey!, params: result.params };\n }\n return { ...state, errors };\n}\n\n/** Mark a field touched (on blur) and re-check it, so Smart timing can start showing its error. */\nexport function onFieldBlur(\n state: FormRuntimeState,\n fieldName: string,\n values: Record<string, unknown>,\n spec: FormSpec,\n): FormRuntimeState {\n const touched = new Set(state.touched);\n touched.add(fieldName);\n return { ...onFieldChange(state, fieldName, values, spec), touched };\n}\n\n/**\n * A submit attempt. Validates everything and flips `submitted`, so from here on every error shows\n * whatever the timing setting is — a visitor who pressed the button is owed the full picture.\n */\nexport function onSubmitAttempt(\n state: FormRuntimeState,\n values: Record<string, unknown>,\n spec: FormSpec,\n): FormRuntimeState {\n const { errors } = validateForm(values ?? {}, spec);\n return { ...state, submitted: true, errors };\n}\n\n/** Server-side rejection: adopt the server's errors verbatim. It is the authority, not the client. */\nexport function applyServerErrors(\n state: FormRuntimeState,\n errors: Record<string, FieldError>,\n): FormRuntimeState {\n return { ...state, submitted: true, submitting: false, errors: { ...errors } };\n}\n\n/** A clean slate after a successful submit, for a form configured to clear itself. */\nexport function resetFormState(): FormRuntimeState {\n return { touched: new Set<string>(), submitted: false, errors: {}, submitting: false };\n}\n\n/** Field names whose validity depends on `fieldName` through a `matches` rule. */\nfunction dependentsOf(fieldName: string, spec: FormSpec): string[] {\n return (spec.fields ?? [])\n .filter(f => (f.rules ?? []).some(r => r.params?.['field'] === fieldName))\n .map(f => f.name);\n}\n","/**\n * Which rules exist, and which controls they make sense on.\n *\n * The panel must not offer \"must be ticked\" on a text field, or a character limit on a date. That\n * knowledge belongs with the validator, not duplicated into the editor — otherwise the two drift and\n * an author configures a rule that silently never runs.\n *\n * Pure data, in forms-core, so the builder panel, the engine and the backend all read one catalog.\n */\n\nimport { ControlType, PatternPreset, RuleName } from './form.model';\n\n/** How a rule's parameter is edited. The panel maps these to its own controls. */\nexport enum RuleParamKind {\n /** No parameter — the rule is its own statement (`required`, `accepted`). */\n None = 'none',\n /** A single number (`{ n }`) — lengths and bounds. */\n Number = 'number',\n /** A preset regex, or a custom one (`{ preset }` / `{ regex }`). */\n Pattern = 'pattern',\n /** Another field in the same form (`{ field }`). */\n Field = 'field',\n}\n\nexport interface RuleDescriptor {\n name: RuleName;\n /** i18n key for the rule's name in the Add-rule menu. */\n labelKey: string;\n param: RuleParamKind;\n /** Controls this rule can apply to. Empty means every control. */\n controls: readonly ControlType[];\n /** Suggested starting value for the parameter, so a freshly added rule is already valid. */\n defaultParams?: Record<string, any>;\n}\n\n/** Text-ish controls: the ones whose value is a string a person typed. */\nconst TEXTUAL: readonly ControlType[] = [\n ControlType.Text, ControlType.Email, ControlType.Tel, ControlType.Url,\n ControlType.Password, ControlType.Textarea,\n];\n\n/** Controls with a comparable magnitude. */\nconst NUMERIC: readonly ControlType[] = [ControlType.Number, ControlType.Date, ControlType.Time, ControlType.Range];\n\nexport const RULE_DESCRIPTORS: readonly RuleDescriptor[] = Object.freeze([\n {\n name: RuleName.MinLength, labelKey: 'forms.rules.minLength',\n param: RuleParamKind.Number, controls: TEXTUAL, defaultParams: { n: 2 },\n },\n {\n name: RuleName.MaxLength, labelKey: 'forms.rules.maxLength',\n param: RuleParamKind.Number, controls: TEXTUAL, defaultParams: { n: 200 },\n },\n {\n name: RuleName.Min, labelKey: 'forms.rules.min',\n param: RuleParamKind.Number, controls: NUMERIC, defaultParams: { n: 0 },\n },\n {\n name: RuleName.Max, labelKey: 'forms.rules.max',\n param: RuleParamKind.Number, controls: NUMERIC, defaultParams: { n: 100 },\n },\n {\n name: RuleName.Pattern, labelKey: 'forms.rules.pattern',\n param: RuleParamKind.Pattern, controls: TEXTUAL,\n defaultParams: { preset: PatternPreset.Email },\n },\n {\n // Cross-field: confirm-email, confirm-password.\n name: RuleName.Matches, labelKey: 'forms.rules.matches',\n param: RuleParamKind.Field, controls: [],\n },\n {\n // A checkbox's `required` already becomes `accepted`, so offering it again would be a\n // duplicate — it is here for a checkbox the author wants ticked WITHOUT marking it required.\n name: RuleName.Accepted, labelKey: 'forms.rules.accepted',\n param: RuleParamKind.None, controls: [ControlType.Checkbox, ControlType.Switch],\n },\n]);\n\n/** The rules that can be added to a field of this control type. */\nexport function rulesFor(control: ControlType | string): RuleDescriptor[] {\n return RULE_DESCRIPTORS.filter(rule =>\n rule.controls.length === 0 || rule.controls.includes(control as ControlType));\n}\n\n/**\n * The rules an author may still ADD — the catalog minus what is already on the field.\n *\n * Each rule appears once: two `maxLength` rules on one field is not a configuration anyone means,\n * and the validator would apply whichever came first. `pattern` is the exception a caller might\n * expect to repeat, and it deliberately does not: a second pattern can only contradict the first.\n */\nexport function addableRules(\n control: ControlType | string,\n existing: readonly { name: RuleName }[] = [],\n): RuleDescriptor[] {\n const used = new Set(existing.map(rule => rule.name));\n return rulesFor(control).filter(rule => !used.has(rule.name));\n}\n\n/** The preset options a Pattern rule offers, in the order the panel should list them. */\nexport const PATTERN_PRESET_OPTIONS: readonly { value: PatternPreset; labelKey: string }[] = Object.freeze([\n { value: PatternPreset.Email, labelKey: 'forms.rules.preset.email' },\n { value: PatternPreset.Phone, labelKey: 'forms.rules.preset.phone' },\n { value: PatternPreset.Url, labelKey: 'forms.rules.preset.url' },\n { value: PatternPreset.Digits, labelKey: 'forms.rules.preset.digits' },\n { value: PatternPreset.Letters, labelKey: 'forms.rules.preset.letters' },\n { value: PatternPreset.Slug, labelKey: 'forms.rules.preset.slug' },\n]);\n\n// ── MOVED to @vectoriox/iox-ui/actions-core (A0) ─────────────────────────────\n// The descriptor shape and the after-submit catalog are the ONE action vocabulary the whole\n// product shares; element actions (A1) consume the same shape. Re-exported here under the\n// original names so no forms consumer changes a line.\nexport type { ActionDescriptor } from '@vectoriox/iox-ui/actions-core';\nexport { FORM_SUBMIT_ACTION_DESCRIPTORS as ACTION_DESCRIPTORS, addableActions } from '@vectoriox/iox-ui/actions-core';\n","/**\n * The submit transport CONTRACT — what a host must provide to make a form actually send.\n *\n * The Form component deliberately owns no HTTP: the builder canvas must never post (an author\n * clicking Submit while designing would file a real submission), and the SSR engine posts through\n * Angular's HttpClient. What IS shared is everything around the call — the endpoint's shape, the\n * anti-spam fields, and how the server's answer maps onto the form's state. Those live here so the\n * two hosts cannot drift, and so a third host (a hand-built integration) has one thing to read.\n *\n * ⚠️ Framework-free, like the rest of forms-core. No Angular, no RxJS, no fetch.\n */\n\nimport { FieldError } from './validate';\n\n/** The field a honeypot input uses. Must match `iox-cms` `anti-spam.ts` — hence the comment there. */\nexport const HONEYPOT_FIELD = '_iox_hp';\n/** When the form was rendered, so the server can measure fill time. */\nexport const RENDERED_AT_FIELD = '_iox_t';\n\n/**\n * What the form hands its host. There is deliberately no `orgId`: the tenant is the HOST's\n * knowledge, not the form's, and a form that had to be told its org would be one more trait an\n * author could get wrong.\n */\nexport interface SubmitRequest {\n formId: string;\n values: Record<string, any>;\n}\n\n/**\n * The server's answer, normalised. Mirrors `SubmitResult` in `iox-cms`\n * `form-submissions.service.ts` — the two are one contract, so change them together.\n */\nexport interface SubmitResponse {\n ok: boolean;\n /** Per-field verdicts from the server's own validation pass, keyed by field name. */\n errors?: Record<string, FieldError>;\n /** Where to send the visitor after a successful submit, when the form has a redirect action. */\n redirect?: string;\n}\n\n/**\n * The one function a host implements. Rejecting (or throwing) means the call never reached the\n * server — the form shows its Error state, which is the honest thing to show for a dropped network.\n */\nexport type FormTransport = (request: SubmitRequest) => Promise<SubmitResponse>;\n\n/**\n * The public submit path. Built here rather than interpolated at each call site, so the engine and\n * any future host cannot disagree about it — and so changing it is one edit.\n *\n * ⚠️ ROOT-relative (leading slash), never base-relative. A live site is served under a per-org\n * `<base href=\"/<label>/\">`, so a relative `api/…` resolved to `/<label>/api/…` — a path the reverse\n * proxy (`/api` → iox-cms, everything else → the engine) hands to the ENGINE, which answers a POST with\n * 404: no visitor submission ever reached iox-cms from an org path (found 2026-10-19 by\n * e2e:forminsert:real). The org is already in the path segment after `site/`.\n */\nexport function submitEndpointPath(orgId: string, formId: string): string {\n return `/api/site/${encodeURIComponent(orgId)}/forms/${encodeURIComponent(formId)}/submit`;\n}\n\n/**\n * Add the anti-spam fields to the collected values.\n *\n * Both are invisible to a real visitor and cost them nothing (decision D12). `renderedAt` is the\n * time the form was rendered, NOT the time of submit — the server measures the difference to catch\n * a script that fills and posts instantly.\n */\nexport function withAntiSpamFields(\n values: Record<string, any>,\n renderedAt: number,\n honeypotValue = '',\n): Record<string, any> {\n return { ...values, [HONEYPOT_FIELD]: honeypotValue, [RENDERED_AT_FIELD]: renderedAt };\n}\n\n/**\n * Normalise whatever came back into a `SubmitResponse`.\n *\n * Fails CLOSED: anything that is not a recognisable success is treated as a failure. A malformed\n * body must never show the visitor a Success state for a submission that was not stored — that is\n * the one lie this feature must not tell.\n */\nexport function interpretSubmitResponse(body: any): SubmitResponse {\n if (!body || typeof body !== 'object' || body.ok !== true) {\n return {\n ok: false,\n errors: normaliseErrors(body?.errors),\n };\n }\n const redirect = typeof body.redirect === 'string' && body.redirect.trim()\n ? body.redirect.trim()\n : undefined;\n return { ok: true, redirect };\n}\n\n/** Keep only entries that actually carry a message, so a junk key cannot blank a field's error. */\nfunction normaliseErrors(raw: any): Record<string, FieldError> | undefined {\n if (!raw || typeof raw !== 'object') return undefined;\n const errors: Record<string, FieldError> = {};\n for (const [name, value] of Object.entries(raw as Record<string, any>)) {\n const messageKey = typeof value?.messageKey === 'string' ? value.messageKey : '';\n if (!messageKey) continue;\n errors[name] = value?.params ? { messageKey, params: value.params } : { messageKey };\n }\n return Object.keys(errors).length ? errors : undefined;\n}\n","/**\n * The submit LIFECYCLE's decisions — what a form shows after the server answers, what it says when a\n * submit fails, what a client needs to validate a form, and how its submit button follows its state.\n *\n * Two runtimes act on these and must agree: `IoxFormComponent` (the engine's component path) and the\n * string-form runtime (every header / footer global and every string-rendered page —\n * vectoriox/iox-client-engine#13). The builder canvas reads `submitButtonView` too, for its Sending state.\n *\n * ⚠️ Framework-free, like the rest of forms-core: no Angular, no DOM.\n */\n\nimport { FeedbackTiming, FieldSpec, FormSpec } from './form.model';\nimport { SubmitResponse } from './transport';\nimport { FieldError } from './validate';\n\n/** Which of the form's four states is showing — written on the form as `data-iox-state`. */\nexport enum FormRenderState {\n Idle = 'idle',\n Submitting = 'submitting',\n Success = 'success',\n Error = 'error',\n}\n\n/** The attribute every renderer writes a form's state on (the canvas switcher, both live paths). */\nexport const FORM_STATE_ATTRIBUTE = 'data-iox-state';\n\n/** What the form does once the server has answered. */\nexport interface SubmitOutcome {\n state: FormRenderState;\n /** Per-field verdicts to put back on the fields (the form stays Idle so the visitor can fix them). */\n errors?: Record<string, FieldError>;\n /** A success clears the answers, so they cannot be sent twice. */\n reset: boolean;\n redirect?: string;\n}\n\n/**\n * The server's answer → what the visitor sees. Only a confirmed success is Success; per-field verdicts\n * land on the fields; anything else (a dropped network included) is the designed Error block.\n */\nexport function submitOutcome(response: SubmitResponse | null | undefined): SubmitOutcome {\n if (response?.ok) return { state: FormRenderState.Success, reset: true, ...(response.redirect ? { redirect: response.redirect } : {}) };\n if (response?.errors && Object.keys(response.errors).length) return { state: FormRenderState.Idle, errors: response.errors, reset: false };\n return { state: FormRenderState.Error, reset: false };\n}\n\n/** What the live region says after a refused submit: how many fields need attention, or that it did not send. */\nexport function failureAnnouncement(errors: Readonly<Record<string, unknown>> | null | undefined): string {\n const count = errors ? Object.keys(errors).length : 0;\n if (!count) return 'That did not send.';\n return `${count} ${count === 1 ? 'field needs' : 'fields need'} attention.`;\n}\n\n/**\n * The fields a CLIENT needs to validate a form: never its actions (where submissions go — an email\n * address, a webhook) and never its anti-spam settings. A string-rendered form carries this on\n * `FORM_FIELDS_ATTRIBUTE`, the way a string slider carries its inputs.\n */\nexport interface ClientFormSpec {\n feedback: FeedbackTiming | string;\n fields: FieldSpec[];\n}\n\nexport const FORM_FIELDS_ATTRIBUTE = 'data-iox-form-fields';\n\nexport function clientFormSpec(spec: Pick<FormSpec, 'feedback' | 'fields'>): ClientFormSpec {\n return { feedback: spec.feedback ?? FeedbackTiming.Smart, fields: [...(spec.fields ?? [])] };\n}\n\n/** The attribute's value back into a spec, or null when it is missing or not one. */\nexport function parseClientFormSpec(raw: string | null | undefined): ClientFormSpec | null {\n if (!raw) return null;\n try {\n const parsed = JSON.parse(raw);\n if (!parsed || !Array.isArray(parsed.fields)) return null;\n return { feedback: typeof parsed.feedback === 'string' ? parsed.feedback : FeedbackTiming.Smart, fields: parsed.fields };\n } catch {\n return null;\n }\n}\n\n/** How a submit button wears its form's state (vectoriox/iox-ui#42). */\nexport interface SubmitButtonView {\n busy: boolean;\n disabled: boolean;\n}\n\n/** While its form sends, a submit button is busy, and disabled unless its author turned that off — ONE rule for the\n * canvas's Sending state, the component path and the string path. Its \"Sending…\" label is the shared CSS's, keyed on\n * the same `data-iox-state`. */\nexport function submitButtonView(state: FormRenderState | string | null | undefined, disableWhileSubmitting = true): SubmitButtonView {\n const busy = state === FormRenderState.Submitting;\n return { busy, disabled: busy && disableWhileSubmitting !== false };\n}\n\n/** On a submit button whose author turned \"Disable while sending\" off. */\nexport const SUBMIT_KEEP_ENABLED_ATTRIBUTE = 'data-iox-keep-enabled';\n\nexport enum SubmitLabelClass {\n Labels = 'iox-submit__labels',\n Idle = 'iox-submit__idle',\n Busy = 'iox-submit__busy',\n}\n\n/**\n * A submit button's words, as markup: its label, or — when it has a \"While sending\" label — both, stacked in one\n * cell (the button keeps the longer one's width and never jumps). The string renderer's copy of\n * `IoxSubmitButtonComponent`'s template; `escape` is the renderer's.\n */\nexport function submitButtonLabelsHtml(label: string, loadingLabel: string | null | undefined, escape: (v: string) => string): string {\n if (!loadingLabel) return escape(label);\n return `<span class=\"${SubmitLabelClass.Labels}\"><span class=\"${SubmitLabelClass.Idle}\">${escape(label)}</span>` +\n `<span class=\"${SubmitLabelClass.Busy}\">${escape(loadingLabel)}</span></span>`;\n}\n\nexport const FORM_HONEYPOT_CLASS = 'iox-form__hp';\nexport const FORM_ANNOUNCER_ATTRIBUTE = 'data-iox-form-announcer';\n\n/**\n * The honeypot and the failure announcer every form holds, as markup — what `IoxFormComponent`'s template\n * renders, for the string renderer. The honeypot is off-screen (some bots skip hidden inputs), out of the\n * Tab order and the accessibility tree; the announcer is present from the start (a live region added at\n * the moment it gains text is not reliably announced).\n */\nexport function formChromeHtml(honeypotField: string): string {\n return `<div class=\"${FORM_HONEYPOT_CLASS}\" aria-hidden=\"true\"><input type=\"text\" name=\"${honeypotField}\" tabindex=\"-1\" autocomplete=\"off\"></div>` +\n `<div class=\"${FORM_HONEYPOT_CLASS}\" ${FORM_ANNOUNCER_ATTRIBUTE} role=\"status\" aria-live=\"assertive\" aria-atomic=\"true\"></div>`;\n}\n","/**\n * FORM PRESETS — a complete, working form as one insert: its fields, its submit label and the words of\n * its Success and Error blocks. ONE definition (W1.1): the builder's Forms tray builds a preset from\n * here (`buildFormPreset`, iox-builder), and the site composer (`generation-core`) stamps the SAME preset\n * into a composed page, so a generated contact form is the real one — never a second, drifting copy.\n * Data only: framework-free, like the rest of forms-core.\n */\n\nexport enum FormPresetId {\n Contact = 'contact',\n Newsletter = 'newsletter',\n Application = 'application',\n Booking = 'booking',\n}\n\nexport interface FormPresetField {\n label: string;\n control: string;\n required?: boolean;\n help?: string;\n placeholder?: string;\n /** Choices for select/radio, `value|Label` per line — the Field's `optionsText` trait. */\n optionsText?: string;\n rows?: number;\n}\n\nexport interface FormPresetDef {\n id: `${FormPresetId}`;\n name: string;\n icon: string;\n /** One line in the panel: what it collects and where it goes. */\n description: string;\n /** The form's author-facing name, which the submissions inbox groups by. */\n formName: string;\n fields: FormPresetField[];\n submitLabel: string;\n successText: string;\n errorText: string;\n}\n\n// forms-core is imported by both renderers (the field runtime), and a renderer that never reads the presets\n// must drop them: the call is `@__PURE__`, and the ids are written as the enum's VALUES (typed by it, pinned\n// to it by form-presets.spec) — a read of `FormPresetId.X` counts as a side effect to a bundler and kept the\n// whole list in the engine's bundle.\nexport const FORM_PRESETS: readonly FormPresetDef[] = /* @__PURE__ */ Object.freeze([\n {\n id: 'contact', name: 'Contact', icon: 'ph-thin ph-envelope-simple',\n description: 'Name, email and a message. Stored, and emailed to you.',\n formName: 'Contact form',\n fields: [\n { label: 'Full name', control: 'text', required: true },\n { label: 'Email', control: 'email', required: true },\n { label: 'Message', control: 'textarea', required: true, rows: 5 },\n ],\n submitLabel: 'Send message',\n successText: 'Thanks — we’ll be in touch shortly.',\n errorText: 'We couldn’t send your message. Please try again — your answers are still here.',\n },\n {\n id: 'newsletter', name: 'Newsletter', icon: 'ph-thin ph-paper-plane-tilt',\n description: 'One email field plus consent. Stored.',\n formName: 'Newsletter signup',\n fields: [\n { label: 'Email', control: 'email', required: true, placeholder: 'you@company.com' },\n // Consent is a checkbox that must be TICKED — `required` on a checkbox becomes the\n // `accepted` rule, with its own message, rather than a generic \"this is required\".\n { label: 'Email me occasional updates', control: 'checkbox', required: true },\n ],\n submitLabel: 'Subscribe',\n successText: 'You’re on the list.',\n errorText: 'We couldn’t sign you up. Please try again.',\n },\n {\n id: 'application', name: 'Application', icon: 'ph-thin ph-read-cv-logo',\n description: 'Details plus a CV upload. Stored, with an auto-reply.',\n formName: 'Application',\n fields: [\n { label: 'Full name', control: 'text', required: true },\n { label: 'Email', control: 'email', required: true },\n { label: 'Phone', control: 'tel' },\n { label: 'Role', control: 'select', required: true, optionsText: 'Design\\nEngineering\\nOther' },\n { label: 'CV', control: 'file', required: true, help: 'PDF or Word, up to 5MB' },\n { label: 'Anything else', control: 'textarea', rows: 4 },\n ],\n submitLabel: 'Apply',\n successText: 'Application received — we’ll read it properly and reply.',\n errorText: 'We couldn’t submit your application. Please try again.',\n },\n {\n id: 'booking', name: 'Booking request', icon: 'ph-thin ph-calendar-check',\n description: 'Date and party size. Stored, and it notifies you.',\n formName: 'Booking request',\n fields: [\n { label: 'Name', control: 'text', required: true },\n { label: 'Email', control: 'email', required: true },\n { label: 'Date', control: 'date', required: true },\n { label: 'People', control: 'number', required: true },\n { label: 'Notes', control: 'textarea', rows: 3, help: 'Allergies, access needs, anything useful' },\n ],\n submitLabel: 'Request a booking',\n successText: 'Request received — we’ll confirm by email.',\n errorText: 'We couldn’t send your request. Please try again.',\n },\n]);\n\n/** The preset with this id, or undefined. */\nexport function formPresetById(id: string | null | undefined): FormPresetDef | undefined {\n return FORM_PRESETS.find(p => p.id === id);\n}\n","// Where form content may NOT render (Doron, 2026-10-20): inside a link or a button.\n//\n// HTML forbids interactive content inside `<a>` and `<button>`, and a click in a field may follow the\n// link. ONE table and ONE walk, shared by the builder's insert rule (refuse it), the builder's audit\n// (find it in a page saved before the rule) and the engine (warn about it, never rewrite it).\n\nimport { FIELD_NODE_TYPE, FORM_NODE_TYPE } from './collect';\n\nexport enum InteractiveTag {\n Anchor = 'a',\n Button = 'button',\n}\n\n/**\n * Every node type that renders as an interactive element, and the element(s) it can render. A ButtonBlock\n * renders `<a>` or `<button>` by its `tag` trait — both interactive, so switching the tag never lifts the\n * rule. Pinned to the engine components' selectors by `interactive-hosts.spec.ts`.\n */\nexport const INTERACTIVE_HOST_TAGS: Readonly<Record<string, readonly InteractiveTag[]>> = Object.freeze({\n // A LinkedContainer is an <a>, or — as an Accordion's header (CC2) — a <button>.\n LinkedContainer: [InteractiveTag.Anchor, InteractiveTag.Button],\n Link: [InteractiveTag.Anchor],\n Button: [InteractiveTag.Anchor],\n ButtonBlock: [InteractiveTag.Anchor, InteractiveTag.Button],\n SubmitButton: [InteractiveTag.Button],\n});\n\nexport const FIELD_GROUP_NODE_TYPE = 'FieldGroup';\nexport const SUBMIT_BUTTON_NODE_TYPE = 'SubmitButton';\n\n/**\n * Form content — what a link or a button must never hold: a Form (its controls), a Field (an input, select\n * or textarea), a SubmitButton (a `<button>`) and a FieldGroup (it exists only to hold fields, so it moves as\n * one). A Success / Error block is text and lives only inside its form, so it is not on the list.\n */\nexport const FORM_CONTENT_TYPES: ReadonlySet<string> = new Set([\n FORM_NODE_TYPE, FIELD_NODE_TYPE, FIELD_GROUP_NODE_TYPE, SUBMIT_BUTTON_NODE_TYPE,\n]);\n\n/** The minimum a node must look like — a builder ComponentNode and a saved layout node both do. */\nexport interface NestingNode {\n id?: string;\n type?: string;\n label?: string;\n children?: NestingNode[] | null;\n}\n\nexport function isInteractiveHost(node: NestingNode | null | undefined): boolean {\n return !!node?.type && Object.prototype.hasOwnProperty.call(INTERACTIVE_HOST_TAGS, node.type);\n}\n\nexport function isFormContent(node: NestingNode | null | undefined): boolean {\n return !!node?.type && FORM_CONTENT_TYPES.has(node.type);\n}\n\n/**\n * The first form-content node in `node`'s subtree that sits inside an interactive host, or null. `insideHost`\n * is true when `node` is placed under a host already — so a Form dropped into a link and a link that holds a\n * Form are the same finding.\n */\nexport function formContentInHost(node: NestingNode | null | undefined, insideHost = false): NestingNode | null {\n if (!node) return null;\n if (insideHost && isFormContent(node)) return node;\n const nowInside = insideHost || isInteractiveHost(node);\n for (const child of node.children ?? []) {\n const found = formContentInHost(child, nowInside);\n if (found) return found;\n }\n return null;\n}\n\n/** One place a tree holds form content inside a link or a button. */\nexport interface MisplacedFormContent<N extends NestingNode = NestingNode> {\n /** The OUTERMOST interactive host holding it. */\n host: N;\n /** A MAXIMAL form-content subtree inside it — the Form, never each of its fields. */\n content: N;\n}\n\n/** Every form-content subtree a tree holds inside an interactive host, in document order. */\nexport function findFormContentInHosts<N extends NestingNode>(roots: readonly N[] | null | undefined): MisplacedFormContent<N>[] {\n const out: MisplacedFormContent<N>[] = [];\n const visit = (node: N, host: N | null): void => {\n if (host && isFormContent(node)) {\n out.push({ host, content: node });\n return;\n }\n const nextHost = host ?? (isInteractiveHost(node) ? node : null);\n for (const child of (node.children ?? []) as N[]) visit(child, nextHost);\n };\n for (const root of roots ?? []) visit(root, null);\n return out;\n}\n","/*\n * @vectoriox/iox-ui/forms-core — the shared, FRAMEWORK-FREE core of the forms feature.\n *\n * ⚠️ Nothing in this entry point may import Angular, RxJS, the DOM, or Node. It is consumed by\n * THREE runtimes: the builder canvas (Angular), the SSR engine (Angular), and `iox-cms` (NestJS,\n * plain Node). The main `@vectoriox/iox-ui` entry pulls in `@angular/core`, which Nest must never\n * load — that is the entire reason this secondary entry point exists.\n *\n * Client-side validation is UX; server-side validation is truth. Both run THIS code, so they cannot\n * disagree. See iox-ai-guidance `architecture/builder/forms-and-inputs-plan.md` §5.\n */\n\nexport * from './form.model';\nexport * from './messages';\nexport * from './validate';\nexport * from './collect';\nexport * from './options';\nexport * from './runtime';\nexport * from './rule-catalog';\nexport * from './transport';\nexport * from './submit-lifecycle';\nexport * from './form-presets';\nexport * from './nesting';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AAEA;IACY;AAAZ,CAAA,UAAY,WAAW,EAAA;AACnB,IAAA,WAAA,CAAA,MAAA,CAAA,GAAA,MAAa;AACb,IAAA,WAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,WAAA,CAAA,KAAA,CAAA,GAAA,KAAW;AACX,IAAA,WAAA,CAAA,KAAA,CAAA,GAAA,KAAW;AACX,IAAA,WAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;AACjB,IAAA,WAAA,CAAA,UAAA,CAAA,GAAA,UAAqB;AACrB,IAAA,WAAA,CAAA,UAAA,CAAA,GAAA,UAAqB;AACrB,IAAA,WAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;AACjB,IAAA,WAAA,CAAA,UAAA,CAAA,GAAA,UAAqB;;AAErB,IAAA,WAAA,CAAA,QAAA,CAAA,GAAA,QA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;AACtB,IAAA,IAAI,UAAU,IAAI,aAAa,CAAC,IAAI,CAAC;AAAE,QAAA,OAAO,IAAI;IAClD,MAAM,SAAS,GAAG,UAAU,IAAI,iBAAiB,CAAC,IAAI,CAAC;IACvD,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,QAAQ,IAAI,EAAE,EAAE;QACrC,MAAM,KAAK,GAAG,iBAAiB,CAAC,KAAK,EAAE,SAAS,CAAC;AACjD,QAAA,IAAI,KAAK;AAAE,YAAA,OAAO,KAAK;IAC3B;AACA,IAAA,OAAO,IAAI;AACf;AAUA;AACM,SAAU,sBAAsB,CAAwB,KAAsC,EAAA;IAChG,MAAM,GAAG,GAA8B,EAAE;AACzC,IAAA,MAAM,KAAK,GAAG,CAAC,IAAO,EAAE,IAAc,KAAU;AAC5C,QAAA,IAAI,IAAI,IAAI,aAAa,CAAC,IAAI,CAAC,EAAE;YAC7B,GAAG,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;YACjC;QACJ;AACA,QAAA,MAAM,QAAQ,GAAG,IAAI,KAAK,iBAAiB,CAAC,IAAI,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC;QAChE,KAAK,MAAM,KAAK,KAAK,IAAI,CAAC,QAAQ,IAAI,EAAE;AAAU,YAAA,KAAK,CAAC,KAAK,EAAE,QAAQ,CAAC;AAC5E,IAAA,CAAC;AACD,IAAA,KAAK,MAAM,IAAI,IAAI,KAAK,IAAI,EAAE;AAAE,QAAA,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC;AACjD,IAAA,OAAO,GAAG;AACd;;AC5FA;;;;;;;;;;AAUG;;ACVH;;AAEG;;;;"}
1
+ {"version":3,"file":"vectoriox-iox-ui-forms-core.mjs","sources":["../../../projects/iox-ui/src/forms-core/form.model.ts","../../../projects/iox-ui/src/forms-core/messages.ts","../../../projects/iox-ui/src/forms-core/dates.ts","../../../projects/iox-ui/src/forms-core/validate.ts","../../../projects/iox-ui/src/forms-core/options.ts","../../../projects/iox-ui/src/forms-core/collect.ts","../../../projects/iox-ui/src/forms-core/runtime.ts","../../../projects/iox-ui/src/forms-core/rule-catalog.ts","../../../projects/iox-ui/src/forms-core/transport.ts","../../../projects/iox-ui/src/forms-core/submit-lifecycle.ts","../../../projects/iox-ui/src/forms-core/form-presets.ts","../../../projects/iox-ui/src/forms-core/nesting.ts","../../../projects/iox-ui/src/forms-core/channel.ts","../../../projects/iox-ui/src/forms-core/field-markup.ts","../../../projects/iox-ui/src/forms-core/public-api.ts","../../../projects/iox-ui/src/forms-core/vectoriox-iox-ui-forms-core.ts"],"sourcesContent":["// The persisted shape of a form. Pure types + the one derived constant each renderer needs.\n//\n// A FormSpec is DERIVED from the node tree (see `collect.ts`), never hand-maintained beside it —\n// there is one source of truth for \"what fields does this form have\", and it is the tree the author\n// edited. The builder writes the derived spec into the saved page so the SERVER can re-validate\n// against it without re-implementing the builder's tree walk.\n\n/** What the visitor actually types into. Chosen by a trait; it also implies a validation rule. */\nexport enum ControlType {\n Text = 'text',\n Email = 'email',\n Tel = 'tel',\n Url = 'url',\n Number = 'number',\n Password = 'password',\n Textarea = 'textarea',\n Select = 'select',\n Checkbox = 'checkbox',\n /** A checkbox in switch clothing (role=\"switch\") — consent toggles, settings-style forms. */\n Switch = 'switch',\n /** A slider over a numeric range — min/max/step ride the field. */\n Range = 'range',\n Radio = 'radio',\n /** One or several of a few visible choices — chips (the default) or a list of radios / checkboxes (premium N1).\n * Its `multiple` trait picks the value's shape: a string, or a list of strings. */\n Choices = 'choices',\n /** A date the visitor picks from the look's calendar (premium N8) — a button that reads the date in words and a\n * hidden input carrying the ISO `YYYY-MM-DD` value. Never the browser's own date box. */\n Date = 'date',\n Time = 'time',\n File = 'file',\n /** Not shown; carries a constant or a bound value (campaign, source page, …). */\n Hidden = 'hidden',\n}\n\n/** The v1 rule grammar. Phase 3's conditional logic reuses these same names for its conditions. */\nexport enum RuleName {\n Required = 'required',\n MinLength = 'minLength',\n MaxLength = 'maxLength',\n Min = 'min',\n Max = 'max',\n Pattern = 'pattern',\n /** Cross-field: this value must equal another field's (confirm email / password). */\n Matches = 'matches',\n /** A checkbox that must be ticked — terms, consent. */\n Accepted = 'accepted',\n FileType = 'fileType',\n FileSize = 'fileSize',\n /** IMPLIED, never authored: an answer of a Choices / Radio / Dropdown must be one of the field's own options\n * (premium N1) — a hand-crafted POST cannot file a value the form never offered. */\n OneOf = 'oneOf',\n /** IMPLIED, never authored: a Date's answer is a real `YYYY-MM-DD` day (premium N8). */\n ValidDate = 'validDate',\n}\n\n/** How a Choices field draws its options (premium N1). */\nexport enum ChoiceAppearance {\n /** Each option a chip — the label is the chip; the native input inside it is visually hidden. */\n Chips = 'chips',\n /** The options as rows of the look's own radio / checkbox (DS9.1). */\n List = 'list',\n}\n\n/** Named regexes so an author picks \"Email\" rather than writing one. */\nexport enum PatternPreset {\n Email = 'email',\n Phone = 'phone',\n Url = 'url',\n Digits = 'digits',\n Letters = 'letters',\n Slug = 'slug',\n}\n\n/**\n * Deliberately permissive. A validator that rejects `user+tag@sub.domain.co.uk` or a real-world\n * phone number is worse than one that lets a typo through: the address gets verified by sending to\n * it, and a false rejection is a lost lead with no recourse.\n */\nexport const PATTERN_PRESETS: Readonly<Record<PatternPreset, RegExp>> = Object.freeze({\n [PatternPreset.Email]: /^[^\\s@]+@[^\\s@.]+(\\.[^\\s@.]+)+$/,\n [PatternPreset.Phone]: /^\\+?[\\d\\s().-]{6,20}$/,\n [PatternPreset.Url]: /^(https?:\\/\\/)?[^\\s.]+\\.[^\\s]{2,}$/i,\n [PatternPreset.Digits]: /^\\d+$/,\n [PatternPreset.Letters]: /^[\\p{L}\\s'-]+$/u,\n [PatternPreset.Slug]: /^[a-z0-9]+(-[a-z0-9]+)*$/,\n});\n\nexport interface ValidationRule {\n name: RuleName;\n /** `{ n }` for lengths/bounds · `{ preset } | { regex }` for pattern · `{ field }` for matches. */\n params?: Record<string, any>;\n /** Author's override. Absent → the shared message catalog supplies a translated key. */\n message?: string;\n}\n\nexport interface FieldOption {\n label: string;\n value: string;\n}\n\n/** Options pulled from a data source instead of typed by hand (a Select of CMS categories). */\nexport interface FieldOptionSource {\n source: string;\n sourcePath?: string;\n valuePath: string;\n labelPath: string;\n}\n\nexport interface FieldSpec {\n /** The submitted key. Derived from the label, unique within the form, editable. */\n name: string;\n control: ControlType;\n label: string;\n /** Surfaced as its own switch in the panel rather than buried in the rule list. */\n required?: boolean;\n rules?: ValidationRule[];\n options?: FieldOption[];\n optionsSource?: FieldOptionSource;\n defaultValue?: any;\n /** A Choices field that takes several answers: its value is a list (premium N1). */\n multiple?: boolean;\n}\n\n/** When a field is validated, once the author has stopped deciding it per field. */\nexport enum FeedbackTiming {\n /** Validate on submit, then live per-field once that field has been touched or has failed. */\n Smart = 'smart',\n Submit = 'submit',\n Live = 'live',\n}\n\n/** What happens to a submission, in order. Card #1 (`store`) is always present. */\nexport interface SubmitAction {\n type: string;\n config?: Record<string, any>;\n /** `retry` (default) · `fail` · `ignore`. */\n onFailure?: 'retry' | 'fail' | 'ignore';\n}\n\nexport interface FormSpec {\n formId: string;\n /** Author-facing name — the submissions inbox groups by it. */\n name: string;\n feedback: FeedbackTiming;\n fields: FieldSpec[];\n actions: SubmitAction[];\n antiSpam: { honeypot: boolean; minFillMs: number; turnstile?: boolean };\n retention?: { days: number };\n}\n\n/**\n * The rule a control type implies with no configuration. Choosing \"Email\" IS choosing email\n * validation — the single biggest reason the panel can stay empty and still validate well.\n */\nexport const IMPLIED_PATTERN: Readonly<Partial<Record<ControlType, PatternPreset>>> = Object.freeze({\n [ControlType.Email]: PatternPreset.Email,\n [ControlType.Tel]: PatternPreset.Phone,\n [ControlType.Url]: PatternPreset.Url,\n});\n\n/**\n * Whether this field's answer is a LIST rather than one value — a file list, or a Choices field that takes several\n * (premium N1). Per FIELD, not per control: the same Choices control is single or multiple by its `multiple` trait.\n * ONE reading for collect, validate, the runtimes' transport and the server (replaced the control-only\n * `MULTI_VALUE_CONTROLS`, which nothing read).\n */\nexport function isMultiValueField(field: Pick<FieldSpec, 'control' | 'multiple'> | null | undefined): boolean {\n if (!field) return false;\n if (field.control === ControlType.File) return true;\n return field.control === ControlType.Choices && field.multiple === true;\n}\n\n/** The controls whose answers must be one of the field's own options (the implied `oneOf` rule). */\nexport const OPTION_CONTROLS: ReadonlySet<ControlType> = new Set([ControlType.Choices, ControlType.Radio, ControlType.Select]);\n","// The default message for every rule, as an i18n KEY — never a rendered string.\n//\n// This is what lets the Validation panel stay empty and still produce good errors: an author who\n// configures nothing gets \"Enter a valid email address\", not \"Invalid\". The author's own `message`\n// on a rule always wins; this is the fallback, and it is the only place a default lives.\n//\n// Consumers translate the key with their own i18n (the CMS client via ngx-translate, the engine via\n// the page's locale bundle). The backend returns the key too, so a server-side rejection renders in\n// the visitor's language rather than in the server's.\n\nimport { RuleName } from './form.model';\n\n/** Namespace for every forms validation key. Keep in sync with `en.json` / `he.json`. */\nexport const MESSAGE_NAMESPACE = 'forms.validation';\n\n/**\n * Rule → i18n key. Params travel beside the key (`{ n: 8 }`, `{ field: 'Email' }`) so a translation\n * can place the number wherever its grammar needs it, rather than having it baked into the string.\n */\nexport const RULE_MESSAGE_KEYS: Readonly<Record<RuleName, string>> = Object.freeze({\n [RuleName.Required]: `${MESSAGE_NAMESPACE}.required`,\n [RuleName.MinLength]: `${MESSAGE_NAMESPACE}.minLength`,\n [RuleName.MaxLength]: `${MESSAGE_NAMESPACE}.maxLength`,\n [RuleName.Min]: `${MESSAGE_NAMESPACE}.min`,\n [RuleName.Max]: `${MESSAGE_NAMESPACE}.max`,\n // ⚠️ `.pattern.generic`, not `.pattern`: the preset keys below live UNDER `pattern`, and a JSON\n // translation bundle cannot have the same key be both a string and an object — ngx-translate\n // would hand back the object (or the raw key) for the generic case.\n [RuleName.Pattern]: `${MESSAGE_NAMESPACE}.pattern.generic`,\n [RuleName.Matches]: `${MESSAGE_NAMESPACE}.matches`,\n [RuleName.Accepted]: `${MESSAGE_NAMESPACE}.accepted`,\n [RuleName.FileType]: `${MESSAGE_NAMESPACE}.fileType`,\n [RuleName.FileSize]: `${MESSAGE_NAMESPACE}.fileSize`,\n [RuleName.OneOf]: `${MESSAGE_NAMESPACE}.oneOf`,\n [RuleName.ValidDate]: `${MESSAGE_NAMESPACE}.validDate`,\n});\n\n/**\n * What \"required\" says on a field you CHOOSE rather than type into (premium N1 / N8): \"Choose an option\", \"Choose at\n * least one\", \"Choose a date\" — never \"This field is required\" beside a row of chips.\n */\nexport const CHOICE_MESSAGE_KEYS = Object.freeze({\n One: `${MESSAGE_NAMESPACE}.choose`,\n Some: `${MESSAGE_NAMESPACE}.chooseSome`,\n Date: `${MESSAGE_NAMESPACE}.chooseDate`,\n});\n\n/** A Date outside its Earliest / Latest. The calendar refuses those days, so this is a stale page or a hand POST. */\nexport const DATE_MESSAGE_KEYS = Object.freeze({\n Min: `${MESSAGE_NAMESPACE}.dateMin`,\n Max: `${MESSAGE_NAMESPACE}.dateMax`,\n});\n\n/** The submit button's own words (premium N2): what it says once its form has sent, when the author wrote none. */\nexport const SUBMIT_MESSAGE_KEYS = Object.freeze({\n Sent: 'forms.submit.sent',\n});\n\n/**\n * A pattern failure deserves better than \"Invalid format\". Each preset gets its own key so the\n * message can say what a valid value looks like, which is the difference between a visitor fixing\n * a typo and a visitor giving up.\n */\nexport const PATTERN_MESSAGE_KEYS: Readonly<Record<string, string>> = Object.freeze({\n email: `${MESSAGE_NAMESPACE}.pattern.email`,\n phone: `${MESSAGE_NAMESPACE}.pattern.phone`,\n url: `${MESSAGE_NAMESPACE}.pattern.url`,\n digits: `${MESSAGE_NAMESPACE}.pattern.digits`,\n letters: `${MESSAGE_NAMESPACE}.pattern.letters`,\n slug: `${MESSAGE_NAMESPACE}.pattern.slug`,\n});\n\n/** Form-level outcomes the visitor sees in the Error state. One designed block, five reasons. */\nexport const FORM_ERROR_KEYS = Object.freeze({\n Network: `${MESSAGE_NAMESPACE}.form.network`,\n Rejected: `${MESSAGE_NAMESPACE}.form.rejected`,\n Spam: `${MESSAGE_NAMESPACE}.form.spam`,\n RateLimited: `${MESSAGE_NAMESPACE}.form.rateLimited`,\n Server: `${MESSAGE_NAMESPACE}.form.server`,\n});\n\n/** The English defaults, so a consumer that has not added the keys yet still shows real text. */\nexport const DEFAULT_EN_MESSAGES: Readonly<Record<string, string>> = Object.freeze({\n [RULE_MESSAGE_KEYS[RuleName.Required]]: 'This field is required',\n [RULE_MESSAGE_KEYS[RuleName.MinLength]]: 'Use at least {{n}} characters',\n [RULE_MESSAGE_KEYS[RuleName.MaxLength]]: 'Use no more than {{n}} characters',\n [RULE_MESSAGE_KEYS[RuleName.Min]]: 'Enter {{n}} or more',\n [RULE_MESSAGE_KEYS[RuleName.Max]]: 'Enter {{n}} or less',\n [RULE_MESSAGE_KEYS[RuleName.Pattern]]: 'Check the format of this value',\n [RULE_MESSAGE_KEYS[RuleName.Matches]]: 'This must match {{field}}',\n [RULE_MESSAGE_KEYS[RuleName.Accepted]]: 'Please tick this to continue',\n [RULE_MESSAGE_KEYS[RuleName.FileType]]: 'That file type isn’t accepted',\n [RULE_MESSAGE_KEYS[RuleName.FileSize]]: 'That file is larger than {{n}}MB',\n [PATTERN_MESSAGE_KEYS['email']]: 'Enter a valid email address',\n [PATTERN_MESSAGE_KEYS['phone']]: 'Enter a valid phone number',\n [PATTERN_MESSAGE_KEYS['url']]: 'Enter a valid web address',\n [PATTERN_MESSAGE_KEYS['digits']]: 'Use digits only',\n [PATTERN_MESSAGE_KEYS['letters']]: 'Use letters only',\n [PATTERN_MESSAGE_KEYS['slug']]: 'Use lowercase letters, numbers and hyphens',\n [FORM_ERROR_KEYS.Network]: 'We couldn’t reach the server — check your connection and try again',\n [FORM_ERROR_KEYS.Rejected]: 'Some answers need fixing',\n [FORM_ERROR_KEYS.Spam]: 'We couldn’t accept this submission',\n [FORM_ERROR_KEYS.RateLimited]: 'Too many attempts — please wait a moment and try again',\n [FORM_ERROR_KEYS.Server]: 'Something went wrong on our side — your answers are still here',\n [RULE_MESSAGE_KEYS[RuleName.OneOf]]: 'Choose one of the options',\n [RULE_MESSAGE_KEYS[RuleName.ValidDate]]: 'Choose a date from the calendar',\n [CHOICE_MESSAGE_KEYS.One]: 'Choose an option',\n [CHOICE_MESSAGE_KEYS.Some]: 'Choose at least one',\n [CHOICE_MESSAGE_KEYS.Date]: 'Choose a date',\n [DATE_MESSAGE_KEYS.Min]: 'Choose a later date',\n [DATE_MESSAGE_KEYS.Max]: 'Choose an earlier date',\n [SUBMIT_MESSAGE_KEYS.Sent]: 'Sent',\n});\n","/**\n * DATES — the date picker's pure half (premium components N8) and the date rules' one reading.\n *\n * A Date field's value is an ISO day, `YYYY-MM-DD`, compared as a string (the format sorts as the calendar does).\n * Its `min` / `max` rules take an ISO day OR an offset in days from today (`{ offsetDays: 0 }` = today), so \"from\n * today on\" stays true tomorrow without a re-save. ONE reading for the validator (client AND iox-cms), the calendar\n * (which days it refuses) and the builder's Earliest / Latest controls.\n *\n * The calendar model (six rows of seven, roving focus, the APG keys) lives here too, so the DOM runtime only draws\n * what this decides — the canvas, the engine's component path and its string path draw the SAME month.\n *\n * ⚠️ Framework-free, like the rest of forms-core. Local-time `Date` objects are used only to walk the calendar; a\n * day leaves this file as an ISO string.\n */\n\nimport { ControlType, FieldSpec, RuleName, ValidationRule } from './form.model';\n\nconst ISO_DAY = /^(\\d{4})-(\\d{2})-(\\d{2})$/;\nconst OFFSET = /^[+-]?\\d+$/;\nconst DAYS_IN_WEEK = 7;\n/** Always six rows, so the panel never changes size between months (APG; Emil 74 — one object, one size). */\nexport const CALENDAR_ROWS = 6;\n\nconst pad = (n: number, width = 2) => String(n).padStart(width, '0');\n\n/** The ISO day of a local `Date`. */\nexport function isoOfDate(d: Date): string {\n return `${pad(d.getFullYear(), 4)}-${pad(d.getMonth() + 1)}-${pad(d.getDate())}`;\n}\n\n/** A local `Date` at midnight for an ISO day, or null when it is not one (2026-02-30 is not). */\nexport function dateOfIso(iso: unknown): Date | null {\n const m = typeof iso === 'string' ? ISO_DAY.exec(iso.trim()) : null;\n if (!m) return null;\n const [y, mo, d] = [Number(m[1]), Number(m[2]), Number(m[3])];\n const date = new Date(y, mo - 1, d);\n date.setFullYear(y);\n return date.getFullYear() === y && date.getMonth() === mo - 1 && date.getDate() === d ? date : null;\n}\n\n/** True for a real calendar day written `YYYY-MM-DD`. */\nexport function isIsoDate(value: unknown): boolean {\n return dateOfIso(value) !== null;\n}\n\n/** Today, as the device that runs this sees it (the visitor's local day in a browser; the server's on iox-cms). */\nexport function todayIso(now: Date = new Date()): string {\n return isoOfDate(now);\n}\n\n/** `iso` moved by `days` (negative goes back). */\nexport function addDaysIso(iso: string, days: number): string {\n const d = dateOfIso(iso);\n if (!d) return iso;\n return isoOfDate(new Date(d.getFullYear(), d.getMonth(), d.getDate() + days));\n}\n\n/** `iso` moved by `months`, its day clamped to the target month's last (31 Jan + 1 month = 28/29 Feb). */\nexport function addMonthsIso(iso: string, months: number): string {\n const d = dateOfIso(iso);\n if (!d) return iso;\n const first = new Date(d.getFullYear(), d.getMonth() + months, 1);\n const last = new Date(first.getFullYear(), first.getMonth() + 1, 0).getDate();\n return isoOfDate(new Date(first.getFullYear(), first.getMonth(), Math.min(d.getDate(), last)));\n}\n\n/** `iso` held inside [min, max] (either may be absent). */\nexport function clampIso(iso: string, min?: string | null, max?: string | null): string {\n if (min && iso < min) return min;\n if (max && iso > max) return max;\n return iso;\n}\n\n// ─── bounds: Earliest / Latest ───────────────────────────────────────────────\n\n/** A date rule's parameter: an ISO day, or a number of days from today. */\nexport interface DateBoundParams {\n date?: string;\n offsetDays?: number;\n}\n\n/**\n * A Field's `earliest` / `latest` trait → the rule parameter. The trait is one string so the panel and a saved page\n * stay simple: `''` = any day · an integer = that many days from today (`'0'` = today, `'30'` = a month ahead) · an\n * ISO day. Anything else reads as no bound.\n */\nexport function parseDateBound(raw: unknown): DateBoundParams | null {\n if (typeof raw === 'number' && Number.isInteger(raw)) return { offsetDays: raw };\n if (typeof raw !== 'string') return null;\n const text = raw.trim();\n if (!text) return null;\n if (OFFSET.test(text)) return { offsetDays: Number(text) };\n return isIsoDate(text) ? { date: text } : null;\n}\n\n/** The `min` / `max` rules a Date field's Earliest / Latest traits give it (none for \"any\"). */\nexport function dateBoundRules(earliest: unknown, latest: unknown): ValidationRule[] {\n const rules: ValidationRule[] = [];\n const min = parseDateBound(earliest);\n const max = parseDateBound(latest);\n if (min) rules.push({ name: RuleName.Min, params: { ...min } });\n if (max) rules.push({ name: RuleName.Max, params: { ...max } });\n return rules;\n}\n\n/** True when a rule's params are a DATE bound (an ISO day or an offset), never a number bound. */\nexport function isDateBoundParams(params: Record<string, any> | null | undefined): boolean {\n return !!params && (typeof params['date'] === 'string' || Number.isInteger(params['offsetDays']));\n}\n\n/** The ISO day a bound names today, or null when it names none. */\nexport function resolveDateBound(params: Record<string, any> | null | undefined, today: string): string | null {\n if (!params) return null;\n if (typeof params['date'] === 'string' && isIsoDate(params['date'])) return params['date'];\n if (Number.isInteger(params['offsetDays'])) return addDaysIso(today, params['offsetDays']);\n return null;\n}\n\n/** The first and last day a Date field accepts today — the calendar's refused days and the validator's range. */\nexport function fieldDateRange(field: Pick<FieldSpec, 'rules'> | null | undefined, today: string): { min: string | null; max: string | null } {\n let min: string | null = null;\n let max: string | null = null;\n for (const rule of field?.rules ?? []) {\n if (rule.name === RuleName.Min) min = resolveDateBound(rule.params, today) ?? min;\n if (rule.name === RuleName.Max) max = resolveDateBound(rule.params, today) ?? max;\n }\n return { min, max };\n}\n\n/** True when the field is a date picker (the control that reads these rules as days). */\nexport function isDateField(field: Pick<FieldSpec, 'control'> | null | undefined): boolean {\n return field?.control === ControlType.Date;\n}\n\n// ─── the week, the month, the keys ───────────────────────────────────────────\n\n/** Regions whose week starts on Sunday when the runtime cannot say (Intl.Locale#getWeekInfo is not everywhere). */\nconst SUNDAY_REGIONS: ReadonlySet<string> = new Set(['US', 'CA', 'IL', 'JP', 'BR', 'MX', 'PH', 'IN', 'KR', 'TW', 'ZA', 'AU']);\nconst SUNDAY_LANGUAGES: ReadonlySet<string> = new Set(['he', 'iw', 'ja', 'ko']);\n\n/**\n * The first day of the week for a locale, 0 = Sunday … 6 = Saturday. `Intl.Locale(…).getWeekInfo()` (or the older\n * `weekInfo` getter) when the runtime has it, else a small region table; a bare `en` reads as the US.\n */\nexport function weekStartFor(locale: string | null | undefined): number {\n const tag = locale || 'en';\n try {\n const Ctor = (Intl as any).Locale;\n if (Ctor) {\n const loc = new Ctor(tag);\n const info = typeof loc.getWeekInfo === 'function' ? loc.getWeekInfo() : loc.weekInfo;\n const first = Number(info?.firstDay);\n if (first >= 1 && first <= 7) return first % DAYS_IN_WEEK;\n }\n } catch { /* an unknown tag falls through to the table */ }\n const [language, region] = tag.split(/[-_]/);\n if (region && SUNDAY_REGIONS.has(region.toUpperCase())) return 0;\n if (!region && (language === 'en' || SUNDAY_LANGUAGES.has(language))) return 0;\n return 1;\n}\n\n/** One cell of the month grid. */\nexport interface CalendarDay {\n iso: string;\n day: number;\n today: boolean;\n selected: boolean;\n /** Outside Earliest / Latest: shown, announced as unavailable, never picked. */\n disabled: boolean;\n /** The roving tab stop — exactly one day of the month has it. */\n focus: boolean;\n}\n\nexport interface CalendarMonth {\n year: number;\n /** 0-based, as `Date` counts. */\n month: number;\n /** `CALENDAR_ROWS` × 7; null where the month has no day. */\n weeks: Array<Array<CalendarDay | null>>;\n /** The weekday of each column, 0 = Sunday — the header row reads these. */\n weekdays: number[];\n canPrev: boolean;\n canNext: boolean;\n}\n\nexport interface CalendarOptions {\n weekStart: number;\n today: string;\n min?: string | null;\n max?: string | null;\n selected?: string | null;\n}\n\n/** The month `focus` sits in, as six rows of seven — the ONE grid every renderer draws. */\nexport function calendarMonth(focus: string, options: CalendarOptions): CalendarMonth {\n const at = dateOfIso(focus) ?? dateOfIso(options.today) ?? new Date();\n const year = at.getFullYear();\n const month = at.getMonth();\n const lead = (new Date(year, month, 1).getDay() - options.weekStart + DAYS_IN_WEEK) % DAYS_IN_WEEK;\n const days = new Date(year, month + 1, 0).getDate();\n const weeks: Array<Array<CalendarDay | null>> = [];\n for (let r = 0; r < CALENDAR_ROWS; r++) {\n const row: Array<CalendarDay | null> = [];\n for (let c = 0; c < DAYS_IN_WEEK; c++) {\n const n = r * DAYS_IN_WEEK + c - lead + 1;\n if (n < 1 || n > days) { row.push(null); continue; }\n const iso = isoOfDate(new Date(year, month, n));\n row.push({\n iso, day: n,\n today: iso === options.today,\n selected: iso === options.selected,\n disabled: (!!options.min && iso < options.min) || (!!options.max && iso > options.max),\n focus: iso === focus,\n });\n }\n weeks.push(row);\n }\n const monthKey = (iso: string | null | undefined) => (iso ? iso.slice(0, 7) : null);\n const here = monthKey(isoOfDate(new Date(year, month, 1)))!;\n const minMonth = monthKey(options.min);\n const maxMonth = monthKey(options.max);\n return {\n year, month, weeks,\n weekdays: Array.from({ length: DAYS_IN_WEEK }, (_, i) => (options.weekStart + i) % DAYS_IN_WEEK),\n canPrev: !minMonth || here > minMonth,\n canNext: !maxMonth || here < maxMonth,\n };\n}\n\n/** The keys the grid answers (APG date picker dialog). */\nexport enum CalendarKey {\n Left = 'ArrowLeft',\n Right = 'ArrowRight',\n Up = 'ArrowUp',\n Down = 'ArrowDown',\n Home = 'Home',\n End = 'End',\n PageUp = 'PageUp',\n PageDown = 'PageDown',\n}\n\nconst KEY_MOVES: Readonly<Record<CalendarKey, (iso: string, ctx: { ahead: number; dow: number; shift: boolean }) => string>> = {\n // The arrows follow the READING direction: in RTL \"→\" is a day back (APG; mirrored).\n [CalendarKey.Right]: (iso, c) => addDaysIso(iso, c.ahead),\n [CalendarKey.Left]: (iso, c) => addDaysIso(iso, -c.ahead),\n [CalendarKey.Down]: iso => addDaysIso(iso, DAYS_IN_WEEK),\n [CalendarKey.Up]: iso => addDaysIso(iso, -DAYS_IN_WEEK),\n [CalendarKey.Home]: (iso, c) => addDaysIso(iso, -c.dow),\n [CalendarKey.End]: (iso, c) => addDaysIso(iso, DAYS_IN_WEEK - 1 - c.dow),\n // A month; with Shift, a year.\n [CalendarKey.PageUp]: (iso, c) => addMonthsIso(iso, c.shift ? -12 : -1),\n [CalendarKey.PageDown]: (iso, c) => addMonthsIso(iso, c.shift ? 12 : 1),\n};\n\n/**\n * Where a key moves the focused day, held inside [min, max] — or null for a key the grid does not answer (Enter,\n * Space and Escape are the runtime's: they pick or close, they never move).\n */\nexport function calendarKeyTarget(key: string, focus: string, options: { weekStart: number; rtl?: boolean; shift?: boolean; min?: string | null; max?: string | null }): string | null {\n const move = KEY_MOVES[key as CalendarKey];\n const at = dateOfIso(focus);\n if (!move || !at) return null;\n const dow = (at.getDay() - options.weekStart + DAYS_IN_WEEK) % DAYS_IN_WEEK;\n return clampIso(move(focus, { ahead: options.rtl ? -1 : 1, dow, shift: !!options.shift }), options.min, options.max);\n}\n\n// ─── words ───────────────────────────────────────────────────────────────────\n\n/** The date in words, in the site's language: \"Thu, 20 November\" — the year only when it is not this year's. */\nexport function formatDateInWords(iso: string, locale: string | null | undefined, today: string): string {\n const d = dateOfIso(iso);\n if (!d) return '';\n const sameYear = iso.slice(0, 4) === today.slice(0, 4);\n try {\n return new Intl.DateTimeFormat(locale || undefined, { weekday: 'short', day: 'numeric', month: 'long', ...(sameYear ? {} : { year: 'numeric' }) }).format(d);\n } catch {\n return iso;\n }\n}\n\n/** The calendar's own words, by the site's language — the media-core `videoWords` precedent (a string-rendered\n * site has no translation service; the document's `lang` picks). */\nexport interface DatePickerWords {\n choose: string;\n previousMonth: string;\n nextMonth: string;\n close: string;\n}\n\nexport const DATE_PICKER_WORDS: Readonly<Record<'en' | 'he', DatePickerWords>> = Object.freeze({\n en: { choose: 'Choose a date', previousMonth: 'Previous month', nextMonth: 'Next month', close: 'Close' },\n he: { choose: 'בחרו תאריך', previousMonth: 'החודש הקודם', nextMonth: 'החודש הבא', close: 'סגירה' },\n});\n\n/** The words for a language tag (`he-IL` → Hebrew); English for anything else. */\nexport function datePickerWords(lang: string | null | undefined): DatePickerWords {\n const language = String(lang ?? '').toLowerCase().split(/[-_]/)[0];\n return language === 'he' || language === 'iw' ? DATE_PICKER_WORDS.he : DATE_PICKER_WORDS.en;\n}\n","// The validator. ONE implementation, run by the builder canvas, the SSR engine and `iox-cms`.\n//\n// Client-side validation is UX; server-side validation is truth. Because both call this function,\n// a visitor can never be told a value is fine and then have the server reject it, and a hand-crafted\n// POST can never bypass a rule the author configured.\n\nimport {\n ControlType,\n FieldSpec,\n FormSpec,\n IMPLIED_PATTERN,\n isMultiValueField,\n OPTION_CONTROLS,\n PATTERN_PRESETS,\n PatternPreset,\n RuleName,\n ValidationRule,\n} from './form.model';\nimport { addDaysIso, isDateBoundParams, isIsoDate, resolveDateBound, todayIso } from './dates';\nimport { CHOICE_MESSAGE_KEYS, DATE_MESSAGE_KEYS, PATTERN_MESSAGE_KEYS, RULE_MESSAGE_KEYS } from './messages';\n\nexport interface FieldError {\n /** i18n key, or the author's own override string when they set one. */\n messageKey: string;\n /** Interpolation values (`{ n: 8 }`, `{ field: 'Email' }`). */\n params?: Record<string, any>;\n}\n\nexport interface FieldResult extends Partial<FieldError> {\n valid: boolean;\n}\n\nexport interface FormResult {\n valid: boolean;\n /** Keyed by field name. Empty when valid. */\n errors: Record<string, FieldError>;\n}\n\n/**\n * When \"today\" is, for a Date's relative bounds (premium N8). A browser leaves it out: its own local day is the\n * visitor's. The SERVER passes `dateSlackDays: 1` — it cannot know the visitor's time zone, so a day either side of\n * its own today is still accepted.\n */\nexport interface ValidateOptions {\n today?: string;\n dateSlackDays?: number;\n}\n\n/** A file, as either runtime hands it over. Kept structural so this file imports no DOM types. */\ninterface FileLike {\n name?: string;\n size?: number;\n type?: string;\n}\n\n/**\n * Validate one field's value.\n *\n * Order is deliberate and is part of the contract:\n * 1. `required` (or `accepted` for a checkbox) — the only rules an EMPTY value can fail.\n * 2. Everything else, in the order the author arranged them, but ONLY for a non-empty value.\n *\n * That second point is what stops an optional \"Phone\" field from shouting \"enter a valid phone\n * number\" at someone who simply left it blank — the single most common validation-UX bug.\n * The FIRST failure wins: a visitor fixes one thing at a time.\n */\nexport function validateField(\n value: unknown,\n spec: FieldSpec,\n form: Record<string, unknown> = {},\n options: ValidateOptions = {},\n): FieldResult {\n const rules = effectiveRules(spec);\n const empty = isEmpty(value, spec.control);\n\n for (const rule of rules) {\n const appliesToEmpty = rule.name === RuleName.Required || rule.name === RuleName.Accepted;\n if (empty && !appliesToEmpty) continue;\n\n const failure = check(rule, value, spec, form, options);\n if (failure) {\n return {\n valid: false,\n messageKey: rule.message ?? failure.messageKey,\n params: failure.params,\n };\n }\n }\n return { valid: true };\n}\n\n/**\n * Validate a whole submission. Every field is checked (not short-circuited at the first bad one) so\n * the visitor sees every problem at once instead of fixing them one reload at a time.\n */\nexport function validateForm(\n values: Record<string, unknown>,\n spec: FormSpec,\n options: ValidateOptions = {},\n): FormResult {\n const errors: Record<string, FieldError> = {};\n for (const field of spec.fields ?? []) {\n const result = validateField(values?.[field.name], field, values ?? {}, options);\n if (!result.valid) {\n errors[field.name] = { messageKey: result.messageKey!, params: result.params };\n }\n }\n return { valid: Object.keys(errors).length === 0, errors };\n}\n\n/**\n * The answers in the shape each field takes (premium N1): a field that takes several answers gets a LIST (one answer\n * posted on its own is a list of one; nothing is an empty list). ONE reading for a host's transport and the server,\n * before validation — `isMultiValueField` decides. A single-answer field is left as posted: two answers to it is the\n * validator's to refuse, never quietly cut to one.\n */\nexport function normaliseAnswers(values: Record<string, unknown> | null | undefined, spec: Pick<FormSpec, 'fields'>): Record<string, unknown> {\n const out: Record<string, unknown> = { ...(values ?? {}) };\n for (const field of spec.fields ?? []) {\n if (!isMultiValueField(field) || field.control === ControlType.File) continue;\n if (!(field.name in out)) continue;\n out[field.name] = chosen(out[field.name]);\n }\n return out;\n}\n\n/** The name of the first field with an error, in spec order — what the browser should focus. */\nexport function firstInvalidField(spec: FormSpec, errors: Record<string, FieldError>): string | null {\n for (const field of spec.fields ?? []) if (errors[field.name]) return field.name;\n return null;\n}\n\n// ─── internals ───────────────────────────────────────────────────────────────\n\n/**\n * The author's rules, plus the ones the field's own configuration implies: `required` from the\n * switch (rather than making the author add a rule for the commonest case) and the pattern implied\n * by an Email/Tel/Url control. An explicitly declared rule of the same name always wins, so an\n * author who sets their own `pattern` on an Email field is not fighting an invisible second one.\n */\nfunction effectiveRules(spec: FieldSpec): ValidationRule[] {\n const declared = spec.rules ?? [];\n const has = (name: RuleName) => declared.some(r => r.name === name);\n const implied: ValidationRule[] = [];\n\n if (spec.required && !has(RuleName.Required)) {\n // A checkbox's \"required\" means TICKED, which is a different message and a different check.\n implied.push(spec.control === ControlType.Checkbox\n ? { name: RuleName.Accepted }\n : { name: RuleName.Required });\n }\n\n const preset = IMPLIED_PATTERN[spec.control];\n if (preset && !has(RuleName.Pattern)) {\n implied.push({ name: RuleName.Pattern, params: { preset } });\n }\n\n // An answer to a field of CHOICES must be one the form offered (premium N1) — only when the options are the\n // field's own: options from a data source are not known here, so they are not judged.\n if (OPTION_CONTROLS.has(spec.control) && !spec.optionsSource && (spec.options ?? []).length) {\n implied.push({ name: RuleName.OneOf });\n }\n // A Date's answer is a real day before any bound is asked about it (premium N8).\n if (spec.control === ControlType.Date) implied.push({ name: RuleName.ValidDate });\n\n return [...implied, ...declared];\n}\n\n/** \"Required\" in the words of the control: choose, not fill in. */\nfunction requiredMessageKey(spec: FieldSpec): string {\n if (spec.control === ControlType.Date) return CHOICE_MESSAGE_KEYS.Date;\n if (isMultiValueField(spec) && spec.control === ControlType.Choices) return CHOICE_MESSAGE_KEYS.Some;\n if (OPTION_CONTROLS.has(spec.control)) return CHOICE_MESSAGE_KEYS.One;\n return RULE_MESSAGE_KEYS[RuleName.Required];\n}\n\n/** The answers a field of choices gave, as a list — a single answer is a list of one, nothing is an empty list. */\nfunction chosen(value: unknown): unknown[] {\n if (Array.isArray(value)) return value;\n return value === null || value === undefined || value === '' ? [] : [value];\n}\n\n/** The `oneOf` verdict: every answer is one of the options, and a single-answer field got at most one. */\nfunction isOneOf(value: unknown, spec: FieldSpec): boolean {\n const offered = new Set((spec.options ?? []).map(o => String(o.value)));\n const answers = chosen(value);\n if (!isMultiValueField(spec) && answers.length > 1) return false;\n return answers.every(a => (typeof a === 'string' || typeof a === 'number') && offered.has(String(a)));\n}\n\n/** A Date bound, as a failure or null — the bound resolved against today, widened by the server's slack. */\nfunction dateBoundFailure(rule: ValidationRule, value: unknown, options: ValidateOptions): FieldError | null {\n const today = options.today ?? todayIso();\n const slack = Math.max(0, Math.trunc(options.dateSlackDays ?? 0));\n const bound = resolveDateBound(rule.params, today);\n if (!bound || !isIsoDate(value)) return null;\n const day = String(value);\n if (rule.name === RuleName.Min && day < addDaysIso(bound, -slack)) return { messageKey: DATE_MESSAGE_KEYS.Min };\n if (rule.name === RuleName.Max && day > addDaysIso(bound, slack)) return { messageKey: DATE_MESSAGE_KEYS.Max };\n return null;\n}\n\n/** Empty means \"the visitor gave us nothing\" — per control type, not a blanket falsy check. */\nfunction isEmpty(value: unknown, control: ControlType): boolean {\n if (value === null || value === undefined) return true;\n if (control === ControlType.Checkbox) return value === false;\n if (Array.isArray(value)) return value.length === 0;\n if (typeof value === 'string') return value.trim() === '';\n return false;\n}\n\nfunction check(\n rule: ValidationRule,\n value: unknown,\n spec: FieldSpec,\n form: Record<string, unknown>,\n options: ValidateOptions,\n): FieldError | null {\n const fail = (messageKey: string, params?: Record<string, any>): FieldError => ({ messageKey, params });\n const defaultKey = RULE_MESSAGE_KEYS[rule.name];\n const n = Number(rule.params?.['n']);\n\n // A Date's min / max are DAYS (an ISO day or an offset from today), never a number to parseFloat — `2026-11-06`\n // read as 2026 is what the numeric reading did.\n if ((rule.name === RuleName.Min || rule.name === RuleName.Max) && spec.control === ControlType.Date && isDateBoundParams(rule.params)) {\n return dateBoundFailure(rule, value, options);\n }\n\n switch (rule.name) {\n case RuleName.Required:\n return isEmpty(value, spec.control) ? fail(requiredMessageKey(spec)) : null;\n\n case RuleName.Accepted:\n return value === true ? null : fail(defaultKey);\n\n case RuleName.OneOf:\n return isOneOf(value, spec) ? null : fail(defaultKey);\n\n case RuleName.ValidDate:\n return isIsoDate(value) ? null : fail(defaultKey);\n\n case RuleName.MinLength:\n return text(value).length < n ? fail(defaultKey, { n }) : null;\n\n case RuleName.MaxLength:\n return text(value).length > n ? fail(defaultKey, { n }) : null;\n\n case RuleName.Min: {\n const num = numeric(value);\n return num === null || num < n ? fail(defaultKey, { n }) : null;\n }\n\n case RuleName.Max: {\n const num = numeric(value);\n return num === null || num > n ? fail(defaultKey, { n }) : null;\n }\n\n case RuleName.Pattern: {\n const regex = patternFor(rule);\n if (!regex) return null; // an unparsable custom regex must not block a submission\n if (regex.test(text(value))) return null;\n const preset = rule.params?.['preset'] as string | undefined;\n return fail((preset && PATTERN_MESSAGE_KEYS[preset]) || defaultKey);\n }\n\n case RuleName.Matches: {\n const other = String(rule.params?.['field'] ?? '');\n return text(value) === text(form?.[other]) ? null : fail(defaultKey, { field: other });\n }\n\n case RuleName.FileType: {\n const accepted = list(rule.params?.['types']).map(t => t.toLowerCase().replace(/^\\./, ''));\n if (!accepted.length) return null;\n const bad = files(value).some(f => {\n const ext = (f.name ?? '').split('.').pop()?.toLowerCase() ?? '';\n const mime = (f.type ?? '').toLowerCase();\n return !accepted.some(t => t === ext || mime === t || mime.startsWith(t + '/'));\n });\n return bad ? fail(defaultKey, { types: accepted.join(', ') }) : null;\n }\n\n case RuleName.FileSize: {\n const maxBytes = n * 1024 * 1024;\n return files(value).some(f => (f.size ?? 0) > maxBytes) ? fail(defaultKey, { n }) : null;\n }\n\n default:\n return null;\n }\n}\n\nfunction patternFor(rule: ValidationRule): RegExp | null {\n const preset = rule.params?.['preset'] as PatternPreset | undefined;\n if (preset && PATTERN_PRESETS[preset]) return PATTERN_PRESETS[preset];\n const custom = rule.params?.['regex'];\n if (typeof custom !== 'string' || !custom) return null;\n // A malformed regex is the AUTHOR's mistake; failing open is the only safe reading, because\n // failing closed would make a live form permanently unsubmittable for every visitor.\n try { return new RegExp(custom); } catch { return null; }\n}\n\nconst text = (value: unknown): string =>\n value === null || value === undefined ? '' : String(value).trim();\n\nfunction numeric(value: unknown): number | null {\n const parsed = typeof value === 'number' ? value : parseFloat(text(value));\n return Number.isFinite(parsed) ? parsed : null;\n}\n\nconst list = (value: unknown): string[] =>\n Array.isArray(value) ? value.map(String)\n : typeof value === 'string' ? value.split(',').map(s => s.trim()).filter(Boolean)\n : [];\n\nconst files = (value: unknown): FileLike[] =>\n Array.isArray(value) ? value as FileLike[]\n : value && typeof value === 'object' ? [value as FileLike]\n : [];\n","import { FieldOption } from './form.model';\n\n/** `value|Label` separates a submitted value from what the visitor reads; a bare line is both. */\nconst OPTION_SEPARATOR = '|';\n\n/**\n * A Field's `optionsText` trait — the author's choices, one per line — as options. ONE parser for the\n * builder canvas, both engine paths and iox-cms: until 2026-10-19 nothing parsed the trait, so a Radio\n * group or a Dropdown from the tray rendered no choices at all on the canvas and on the live site.\n */\nexport function parseFieldOptions(text: unknown): FieldOption[] {\n if (typeof text !== 'string') return [];\n const out: FieldOption[] = [];\n for (const line of text.split(/\\r?\\n/)) {\n const raw = line.trim();\n if (!raw) continue;\n const at = raw.indexOf(OPTION_SEPARATOR);\n const value = (at === -1 ? raw : raw.slice(0, at)).trim();\n const label = (at === -1 ? raw : raw.slice(at + 1)).trim() || value;\n if (value) out.push({ value, label });\n }\n return out;\n}\n\n/** The choices a saved Field offers: an explicit `options` list wins, else its `optionsText` parsed. */\nexport function fieldOptionsOf(props: { options?: unknown; optionsText?: unknown } | null | undefined): FieldOption[] {\n if (Array.isArray(props?.options) && props!.options.length) return props!.options as FieldOption[];\n return parseFieldOptions(props?.optionsText);\n}\n","// Derive a FormSpec from a node tree.\n//\n// The tree the author edited is the SINGLE source of truth for \"what fields does this form have\".\n// The spec is derived from it — never maintained beside it — so a field cannot exist in one and not\n// the other. The builder runs this on save and stores the result in the page document; the backend\n// reads THAT stored spec to re-validate a submission (it must never trust a spec sent by the\n// browser). See iox-ai-guidance `architecture/builder/forms-and-inputs-plan.md` §5.1 and D11.\n\nimport {\n ControlType,\n FeedbackTiming,\n FieldSpec,\n FormSpec,\n RuleName,\n SubmitAction,\n ValidationRule,\n} from './form.model';\nimport { dateBoundRules } from './dates';\nimport { fieldOptionsOf } from './options';\n\n/** The minimum a node must look like. Structural on purpose: this file knows no renderer. */\nexport interface FormNodeLike {\n type: string;\n props?: Record<string, any>;\n children?: FormNodeLike[];\n}\n\nexport const FORM_NODE_TYPE = 'Form';\nexport const FIELD_NODE_TYPE = 'Field';\n\n/** Always present, never removable — the safety net that makes \"store first, deliver after\" true. */\nexport const STORE_ACTION: SubmitAction = Object.freeze({ type: 'store' });\n\n/**\n * Turn a label into the key that arrives in the submitted data — `Full name` → `fullName`.\n * Authors never have to invent keys (decision: auto-derive, with an editable override).\n *\n * Diacritics are stripped rather than dropped, so a Hebrew or accented label still yields a usable\n * ASCII key instead of an empty one; a label with no usable characters falls back to `field`.\n */\nexport function deriveFieldName(label: string): string {\n const words = (label ?? '')\n .normalize('NFD').replace(/[̀-ͯ]/g, '')\n .replace(/[^a-zA-Z0-9]+/g, ' ')\n .trim()\n .split(/\\s+/)\n .filter(Boolean);\n if (!words.length) return 'field';\n const [first, ...rest] = words;\n const name = first.toLowerCase() + rest.map(w => w[0].toUpperCase() + w.slice(1).toLowerCase()).join('');\n // A key must not start with a digit — it ends up as an object key and a form control id.\n return /^\\d/.test(name) ? `field${name}` : name;\n}\n\n/** Make `name` unique within `taken`, appending 2, 3, … — two \"Email\" fields must not collide. */\nexport function uniqueFieldName(name: string, taken: ReadonlySet<string>): string {\n if (!taken.has(name)) return name;\n let n = 2;\n while (taken.has(`${name}${n}`)) n++;\n return `${name}${n}`;\n}\n\n/** A Field's own key, before the form makes it unique: the author's override, else derived from the label. */\nexport function baseFieldName(props: { name?: unknown; label?: unknown } | null | undefined): string {\n const own = typeof props?.name === 'string' ? props.name : '';\n return own || deriveFieldName(String(props?.label ?? ''));\n}\n\n/**\n * THE naming rule (vectoriox/iox-ui#43): a form's fields, in document order, each its base name made unique against\n * the names before it — `email`, `email2`. The spec (`collectFormSpec`), the component path's runtime and the engine's\n * string renderer all name a field from here, so the input's `name` and the saved spec's key can never differ.\n */\nexport function uniqueFieldNames(baseNames: ReadonlyArray<string>): string[] {\n const taken = new Set<string>();\n return baseNames.map(base => {\n const name = uniqueFieldName(base, taken);\n taken.add(name);\n return name;\n });\n}\n\n/** The submitted name of every Field of a Form, in document order — `uniqueFieldNames` over its fields. */\nexport function formFieldNames(node: FormNodeLike | null | undefined): string[] {\n if (!node || node.type !== FORM_NODE_TYPE) return [];\n return uniqueFieldNames(collectFieldNodes(node.children ?? []).map(f => baseFieldName(f.props)));\n}\n\n/** Each Field node of a Form → the name it submits under (`formFieldNames`, by node). */\nexport function formFieldNameMap<N extends FormNodeLike>(node: N | null | undefined): Map<FormNodeLike, string> {\n const out = new Map<FormNodeLike, string>();\n if (!node || node.type !== FORM_NODE_TYPE) return out;\n const fields = collectFieldNodes(node.children ?? []);\n uniqueFieldNames(fields.map(f => baseFieldName(f.props))).forEach((name, i) => out.set(fields[i], name));\n return out;\n}\n\n/**\n * A Field's spec from its props and the name its form gave it — ONE reading for the saved spec and the component\n * path's runtime (it was written twice: `IoxFieldComponent.toSpec` never carried the options source, the default or a\n * Date's bounds). A Date's Earliest / Latest (`earliest` / `latest`) become its `min` / `max` rules (premium N8).\n */\nexport function fieldSpecOf(props: Record<string, any> | null | undefined, name: string): FieldSpec {\n const p = props ?? {};\n const control = (p['control'] as ControlType) || ControlType.Text;\n const spec: FieldSpec = { name, control, label: p['label'] ?? '' };\n if (p['required']) spec.required = true;\n const declared = normaliseRules(p['rules']);\n const bounds = control === ControlType.Date\n ? dateBoundRules(p['earliest'], p['latest']).filter(b => !declared.some(r => r.name === b.name))\n : [];\n const rules = [...declared, ...bounds];\n if (rules.length) spec.rules = rules;\n const options = fieldOptionsOf(p);\n if (options.length) spec.options = options;\n if (p['optionsSource']) spec.optionsSource = p['optionsSource'];\n if (p['defaultValue'] !== undefined && p['defaultValue'] !== '') spec.defaultValue = p['defaultValue'];\n if (control === ControlType.Choices && p['multiple'] === true) spec.multiple = true;\n return spec;\n}\n\n/**\n * Walk a Form subtree and produce its spec.\n *\n * Nested forms are not collected: a Field belongs to its NEAREST ancestor Form (decision D1), so the\n * walk stops at any inner Form node rather than stealing its fields.\n */\nexport function collectFormSpec(node: FormNodeLike | null | undefined): FormSpec | null {\n if (!node || node.type !== FORM_NODE_TYPE) return null;\n const props = node.props ?? {};\n\n const fieldNodes = collectFieldNodes(node.children ?? []);\n const names = uniqueFieldNames(fieldNodes.map(f => baseFieldName(f.props)));\n const fields: FieldSpec[] = fieldNodes.map((f, i) => fieldSpecOf(f.props, names[i]));\n\n return {\n formId: props['formId'] ?? '',\n name: props['name'] ?? 'Form',\n feedback: (props['feedback'] as FeedbackTiming) ?? FeedbackTiming.Smart,\n fields,\n actions: normaliseActions(props['actions']),\n antiSpam: {\n honeypot: props['honeypot'] !== false,\n minFillMs: Number(props['minFillMs'] ?? 1200),\n ...(props['turnstile'] ? { turnstile: true } : {}),\n },\n ...(props['retentionDays'] ? { retention: { days: Number(props['retentionDays']) } } : {}),\n };\n}\n\n/** Every Field in this subtree, in document order, not descending into a nested Form. */\nexport function collectFieldNodes(nodes: readonly FormNodeLike[]): FormNodeLike[] {\n const out: FormNodeLike[] = [];\n for (const node of nodes ?? []) {\n if (!node?.type) continue;\n if (node.type === FORM_NODE_TYPE) continue; // a nested form owns its own fields\n if (node.type === FIELD_NODE_TYPE) { out.push(node); continue; }\n out.push(...collectFieldNodes(node.children ?? []));\n }\n return out;\n}\n\n/** Drop anything that isn't a rule we know — a hand-edited page must not break validation. */\nfunction normaliseRules(raw: unknown): ValidationRule[] {\n if (!Array.isArray(raw)) return [];\n const known = new Set<string>(Object.values(RuleName));\n return raw\n .filter(r => r && known.has(r.name))\n .map(r => ({\n name: r.name as RuleName,\n ...(r.params ? { params: r.params } : {}),\n ...(r.message ? { message: r.message } : {}),\n }));\n}\n\n/** `store` is always first and always present, however the page was edited. */\nfunction normaliseActions(raw: unknown): SubmitAction[] {\n const declared: SubmitAction[] = Array.isArray(raw)\n ? raw.filter(a => a && typeof a.type === 'string')\n : [];\n return [STORE_ACTION, ...declared.filter(a => a.type !== STORE_ACTION.type)];\n}\n","// When a field's error is allowed to be VISIBLE — the pure half of the form runtime.\n//\n// Validity and visibility are different questions. A field can be invalid from the moment the page\n// loads (an empty required field always is), but showing that immediately means greeting a visitor\n// with a wall of red before they have typed anything. This module owns the second question, and it\n// owns it in one place so the builder canvas, the SSR engine and any future runtime agree.\n//\n// Framework-free, like the rest of forms-core.\n\nimport { FeedbackTiming, FormSpec } from './form.model';\nimport { FieldError, validateField, validateForm } from './validate';\n\n/** Everything the runtime needs to remember. Immutable — each transition returns a new state. */\nexport interface FormRuntimeState {\n /** Field names the visitor has left (blurred) at least once. */\n touched: ReadonlySet<string>;\n /** True once a submit has been attempted — after that, every error is fair game. */\n submitted: boolean;\n /** The current errors, whether or not they are being shown. */\n errors: Readonly<Record<string, FieldError>>;\n /** In flight — the submit button shows its loading label and the form is aria-busy. */\n submitting: boolean;\n}\n\nexport const INITIAL_FORM_STATE: FormRuntimeState = Object.freeze({\n touched: new Set<string>(),\n submitted: false,\n errors: {},\n submitting: false,\n});\n\n/**\n * Should this field's error be on screen right now?\n *\n * - `Submit` — only after a submit attempt. Quietest; nothing moves while typing.\n * - `Live` — as soon as it is invalid. Loudest; shouts at a half-typed email address.\n * - `Smart` — the default, and the reason the author gets one dropdown instead of a decision per\n * field: stay quiet until the visitor has either left the field or tried to submit.\n * After that, correct live, so fixing an error clears it as they type.\n */\nexport function shouldShowError(\n fieldName: string,\n state: FormRuntimeState,\n timing: FeedbackTiming | string = FeedbackTiming.Smart,\n): boolean {\n if (!state.errors[fieldName]) return false;\n switch (timing) {\n case FeedbackTiming.Live: return true;\n case FeedbackTiming.Submit: return state.submitted;\n default: return state.submitted || state.touched.has(fieldName);\n }\n}\n\n/**\n * Re-validate one field after a change. Only that field is re-checked, EXCEPT that a `matches` rule\n * makes another field's validity depend on this one — so a confirm-email field stops being wrong\n * the moment you fix the address it points at, rather than waiting for its own blur.\n */\nexport function onFieldChange(\n state: FormRuntimeState,\n fieldName: string,\n values: Record<string, unknown>,\n spec: FormSpec,\n): FormRuntimeState {\n const errors = { ...state.errors };\n const affected = [fieldName, ...dependentsOf(fieldName, spec)];\n\n for (const name of affected) {\n const field = (spec.fields ?? []).find(f => f.name === name);\n if (!field) continue;\n const result = validateField(values?.[name], field, values ?? {});\n if (result.valid) delete errors[name];\n else errors[name] = { messageKey: result.messageKey!, params: result.params };\n }\n return { ...state, errors };\n}\n\n/** Mark a field touched (on blur) and re-check it, so Smart timing can start showing its error. */\nexport function onFieldBlur(\n state: FormRuntimeState,\n fieldName: string,\n values: Record<string, unknown>,\n spec: FormSpec,\n): FormRuntimeState {\n const touched = new Set(state.touched);\n touched.add(fieldName);\n return { ...onFieldChange(state, fieldName, values, spec), touched };\n}\n\n/**\n * A submit attempt. Validates everything and flips `submitted`, so from here on every error shows\n * whatever the timing setting is — a visitor who pressed the button is owed the full picture.\n */\nexport function onSubmitAttempt(\n state: FormRuntimeState,\n values: Record<string, unknown>,\n spec: FormSpec,\n): FormRuntimeState {\n const { errors } = validateForm(values ?? {}, spec);\n return { ...state, submitted: true, errors };\n}\n\n/** Server-side rejection: adopt the server's errors verbatim. It is the authority, not the client. */\nexport function applyServerErrors(\n state: FormRuntimeState,\n errors: Record<string, FieldError>,\n): FormRuntimeState {\n return { ...state, submitted: true, submitting: false, errors: { ...errors } };\n}\n\n/** A clean slate after a successful submit, for a form configured to clear itself. */\nexport function resetFormState(): FormRuntimeState {\n return { touched: new Set<string>(), submitted: false, errors: {}, submitting: false };\n}\n\n/** Field names whose validity depends on `fieldName` through a `matches` rule. */\nfunction dependentsOf(fieldName: string, spec: FormSpec): string[] {\n return (spec.fields ?? [])\n .filter(f => (f.rules ?? []).some(r => r.params?.['field'] === fieldName))\n .map(f => f.name);\n}\n","/**\n * Which rules exist, and which controls they make sense on.\n *\n * The panel must not offer \"must be ticked\" on a text field, or a character limit on a date. That\n * knowledge belongs with the validator, not duplicated into the editor — otherwise the two drift and\n * an author configures a rule that silently never runs.\n *\n * Pure data, in forms-core, so the builder panel, the engine and the backend all read one catalog.\n */\n\nimport { ControlType, PatternPreset, RuleName } from './form.model';\n\n/** How a rule's parameter is edited. The panel maps these to its own controls. */\nexport enum RuleParamKind {\n /** No parameter — the rule is its own statement (`required`, `accepted`). */\n None = 'none',\n /** A single number (`{ n }`) — lengths and bounds. */\n Number = 'number',\n /** A preset regex, or a custom one (`{ preset }` / `{ regex }`). */\n Pattern = 'pattern',\n /** Another field in the same form (`{ field }`). */\n Field = 'field',\n}\n\nexport interface RuleDescriptor {\n name: RuleName;\n /** i18n key for the rule's name in the Add-rule menu. */\n labelKey: string;\n param: RuleParamKind;\n /** Controls this rule can apply to. Empty means every control. */\n controls: readonly ControlType[];\n /** Suggested starting value for the parameter, so a freshly added rule is already valid. */\n defaultParams?: Record<string, any>;\n}\n\n/** Text-ish controls: the ones whose value is a string a person typed. */\nconst TEXTUAL: readonly ControlType[] = [\n ControlType.Text, ControlType.Email, ControlType.Tel, ControlType.Url,\n ControlType.Password, ControlType.Textarea,\n];\n\n/** Controls with a comparable magnitude. A Date is not one of them: its bounds are DAYS (an ISO day or \"N days from\n * today\", `dates.ts`), set by the Field's own Earliest / Latest — a number box here read `2026-11-06` as 2026. */\nconst NUMERIC: readonly ControlType[] = [ControlType.Number, ControlType.Time, ControlType.Range];\n\nexport const RULE_DESCRIPTORS: readonly RuleDescriptor[] = Object.freeze([\n {\n name: RuleName.MinLength, labelKey: 'forms.rules.minLength',\n param: RuleParamKind.Number, controls: TEXTUAL, defaultParams: { n: 2 },\n },\n {\n name: RuleName.MaxLength, labelKey: 'forms.rules.maxLength',\n param: RuleParamKind.Number, controls: TEXTUAL, defaultParams: { n: 200 },\n },\n {\n name: RuleName.Min, labelKey: 'forms.rules.min',\n param: RuleParamKind.Number, controls: NUMERIC, defaultParams: { n: 0 },\n },\n {\n name: RuleName.Max, labelKey: 'forms.rules.max',\n param: RuleParamKind.Number, controls: NUMERIC, defaultParams: { n: 100 },\n },\n {\n name: RuleName.Pattern, labelKey: 'forms.rules.pattern',\n param: RuleParamKind.Pattern, controls: TEXTUAL,\n defaultParams: { preset: PatternPreset.Email },\n },\n {\n // Cross-field: confirm-email, confirm-password.\n name: RuleName.Matches, labelKey: 'forms.rules.matches',\n param: RuleParamKind.Field, controls: [],\n },\n {\n // A checkbox's `required` already becomes `accepted`, so offering it again would be a\n // duplicate — it is here for a checkbox the author wants ticked WITHOUT marking it required.\n name: RuleName.Accepted, labelKey: 'forms.rules.accepted',\n param: RuleParamKind.None, controls: [ControlType.Checkbox, ControlType.Switch],\n },\n]);\n\n/** The rules that can be added to a field of this control type. */\nexport function rulesFor(control: ControlType | string): RuleDescriptor[] {\n return RULE_DESCRIPTORS.filter(rule =>\n rule.controls.length === 0 || rule.controls.includes(control as ControlType));\n}\n\n/**\n * The rules an author may still ADD — the catalog minus what is already on the field.\n *\n * Each rule appears once: two `maxLength` rules on one field is not a configuration anyone means,\n * and the validator would apply whichever came first. `pattern` is the exception a caller might\n * expect to repeat, and it deliberately does not: a second pattern can only contradict the first.\n */\nexport function addableRules(\n control: ControlType | string,\n existing: readonly { name: RuleName }[] = [],\n): RuleDescriptor[] {\n const used = new Set(existing.map(rule => rule.name));\n return rulesFor(control).filter(rule => !used.has(rule.name));\n}\n\n/** The preset options a Pattern rule offers, in the order the panel should list them. */\nexport const PATTERN_PRESET_OPTIONS: readonly { value: PatternPreset; labelKey: string }[] = Object.freeze([\n { value: PatternPreset.Email, labelKey: 'forms.rules.preset.email' },\n { value: PatternPreset.Phone, labelKey: 'forms.rules.preset.phone' },\n { value: PatternPreset.Url, labelKey: 'forms.rules.preset.url' },\n { value: PatternPreset.Digits, labelKey: 'forms.rules.preset.digits' },\n { value: PatternPreset.Letters, labelKey: 'forms.rules.preset.letters' },\n { value: PatternPreset.Slug, labelKey: 'forms.rules.preset.slug' },\n]);\n\n// ── MOVED to @vectoriox/iox-ui/actions-core (A0) ─────────────────────────────\n// The descriptor shape and the after-submit catalog are the ONE action vocabulary the whole\n// product shares; element actions (A1) consume the same shape. Re-exported here under the\n// original names so no forms consumer changes a line.\nexport type { ActionDescriptor } from '@vectoriox/iox-ui/actions-core';\nexport { FORM_SUBMIT_ACTION_DESCRIPTORS as ACTION_DESCRIPTORS, addableActions } from '@vectoriox/iox-ui/actions-core';\n","/**\n * The submit transport CONTRACT — what a host must provide to make a form actually send.\n *\n * The Form component deliberately owns no HTTP: the builder canvas must never post (an author\n * clicking Submit while designing would file a real submission), and the SSR engine posts through\n * Angular's HttpClient. What IS shared is everything around the call — the endpoint's shape, the\n * anti-spam fields, and how the server's answer maps onto the form's state. Those live here so the\n * two hosts cannot drift, and so a third host (a hand-built integration) has one thing to read.\n *\n * ⚠️ Framework-free, like the rest of forms-core. No Angular, no RxJS, no fetch.\n */\n\nimport { FieldError } from './validate';\n\n/** The field a honeypot input uses. Must match `iox-cms` `anti-spam.ts` — hence the comment there. */\nexport const HONEYPOT_FIELD = '_iox_hp';\n/** When the form was rendered, so the server can measure fill time. */\nexport const RENDERED_AT_FIELD = '_iox_t';\n\n/**\n * What the form hands its host. There is deliberately no `orgId`: the tenant is the HOST's\n * knowledge, not the form's, and a form that had to be told its org would be one more trait an\n * author could get wrong.\n */\nexport interface SubmitRequest {\n formId: string;\n values: Record<string, any>;\n}\n\n/**\n * The server's answer, normalised. Mirrors `SubmitResult` in `iox-cms`\n * `form-submissions.service.ts` — the two are one contract, so change them together.\n */\nexport interface SubmitResponse {\n ok: boolean;\n /** Per-field verdicts from the server's own validation pass, keyed by field name. */\n errors?: Record<string, FieldError>;\n /** Where to send the visitor after a successful submit, when the form has a redirect action. */\n redirect?: string;\n}\n\n/**\n * The one function a host implements. Rejecting (or throwing) means the call never reached the\n * server — the form shows its Error state, which is the honest thing to show for a dropped network.\n */\nexport type FormTransport = (request: SubmitRequest) => Promise<SubmitResponse>;\n\n/**\n * The public submit path. Built here rather than interpolated at each call site, so the engine and\n * any future host cannot disagree about it — and so changing it is one edit.\n *\n * ⚠️ ROOT-relative (leading slash), never base-relative. A live site is served under a per-org\n * `<base href=\"/<label>/\">`, so a relative `api/…` resolved to `/<label>/api/…` — a path the reverse\n * proxy (`/api` → iox-cms, everything else → the engine) hands to the ENGINE, which answers a POST with\n * 404: no visitor submission ever reached iox-cms from an org path (found 2026-10-19 by\n * e2e:forminsert:real). The org is already in the path segment after `site/`.\n */\nexport function submitEndpointPath(orgId: string, formId: string): string {\n return `/api/site/${encodeURIComponent(orgId)}/forms/${encodeURIComponent(formId)}/submit`;\n}\n\n/**\n * Add the anti-spam fields to the collected values.\n *\n * Both are invisible to a real visitor and cost them nothing (decision D12). `renderedAt` is the\n * time the form was rendered, NOT the time of submit — the server measures the difference to catch\n * a script that fills and posts instantly.\n */\nexport function withAntiSpamFields(\n values: Record<string, any>,\n renderedAt: number,\n honeypotValue = '',\n): Record<string, any> {\n return { ...values, [HONEYPOT_FIELD]: honeypotValue, [RENDERED_AT_FIELD]: renderedAt };\n}\n\n/**\n * Normalise whatever came back into a `SubmitResponse`.\n *\n * Fails CLOSED: anything that is not a recognisable success is treated as a failure. A malformed\n * body must never show the visitor a Success state for a submission that was not stored — that is\n * the one lie this feature must not tell.\n */\nexport function interpretSubmitResponse(body: any): SubmitResponse {\n if (!body || typeof body !== 'object' || body.ok !== true) {\n return {\n ok: false,\n errors: normaliseErrors(body?.errors),\n };\n }\n const redirect = typeof body.redirect === 'string' && body.redirect.trim()\n ? body.redirect.trim()\n : undefined;\n return { ok: true, redirect };\n}\n\n/** Keep only entries that actually carry a message, so a junk key cannot blank a field's error. */\nfunction normaliseErrors(raw: any): Record<string, FieldError> | undefined {\n if (!raw || typeof raw !== 'object') return undefined;\n const errors: Record<string, FieldError> = {};\n for (const [name, value] of Object.entries(raw as Record<string, any>)) {\n const messageKey = typeof value?.messageKey === 'string' ? value.messageKey : '';\n if (!messageKey) continue;\n errors[name] = value?.params ? { messageKey, params: value.params } : { messageKey };\n }\n return Object.keys(errors).length ? errors : undefined;\n}\n","/**\n * The submit LIFECYCLE's decisions — what a form shows after the server answers, what it says when a\n * submit fails, what a client needs to validate a form, and how its submit button follows its state.\n *\n * Two runtimes act on these and must agree: `IoxFormComponent` (the engine's component path) and the\n * string-form runtime (every header / footer global and every string-rendered page —\n * vectoriox/iox-client-engine#13). The builder canvas reads `submitButtonView` too, for its Sending state.\n *\n * ⚠️ Framework-free, like the rest of forms-core: no Angular, no DOM.\n */\n\nimport { FeedbackTiming, FieldSpec, FormSpec } from './form.model';\nimport { SubmitResponse } from './transport';\nimport { FieldError } from './validate';\n\n/** Which of the form's four states is showing — written on the form as `data-iox-state`. */\nexport enum FormRenderState {\n Idle = 'idle',\n Submitting = 'submitting',\n Success = 'success',\n Error = 'error',\n}\n\n/** The attribute every renderer writes a form's state on (the canvas switcher, both live paths). */\nexport const FORM_STATE_ATTRIBUTE = 'data-iox-state';\n\n/** What the form does once the server has answered. */\nexport interface SubmitOutcome {\n state: FormRenderState;\n /** Per-field verdicts to put back on the fields (the form stays Idle so the visitor can fix them). */\n errors?: Record<string, FieldError>;\n /** A success clears the answers, so they cannot be sent twice. */\n reset: boolean;\n redirect?: string;\n}\n\n/**\n * The server's answer → what the visitor sees. Only a confirmed success is Success; per-field verdicts\n * land on the fields; anything else (a dropped network included) is the designed Error block.\n */\nexport function submitOutcome(response: SubmitResponse | null | undefined): SubmitOutcome {\n if (response?.ok) return { state: FormRenderState.Success, reset: true, ...(response.redirect ? { redirect: response.redirect } : {}) };\n if (response?.errors && Object.keys(response.errors).length) return { state: FormRenderState.Idle, errors: response.errors, reset: false };\n return { state: FormRenderState.Error, reset: false };\n}\n\n/** What the live region says after a refused submit: how many fields need attention, or that it did not send. */\nexport function failureAnnouncement(errors: Readonly<Record<string, unknown>> | null | undefined): string {\n const count = errors ? Object.keys(errors).length : 0;\n if (!count) return 'That did not send.';\n return `${count} ${count === 1 ? 'field needs' : 'fields need'} attention.`;\n}\n\n/**\n * The fields a CLIENT needs to validate a form: never its actions (where submissions go — an email\n * address, a webhook) and never its anti-spam settings. A string-rendered form carries this on\n * `FORM_FIELDS_ATTRIBUTE`, the way a string slider carries its inputs.\n */\nexport interface ClientFormSpec {\n feedback: FeedbackTiming | string;\n fields: FieldSpec[];\n}\n\nexport const FORM_FIELDS_ATTRIBUTE = 'data-iox-form-fields';\n\nexport function clientFormSpec(spec: Pick<FormSpec, 'feedback' | 'fields'>): ClientFormSpec {\n return { feedback: spec.feedback ?? FeedbackTiming.Smart, fields: [...(spec.fields ?? [])] };\n}\n\n/** The attribute's value back into a spec, or null when it is missing or not one. */\nexport function parseClientFormSpec(raw: string | null | undefined): ClientFormSpec | null {\n if (!raw) return null;\n try {\n const parsed = JSON.parse(raw);\n if (!parsed || !Array.isArray(parsed.fields)) return null;\n return { feedback: typeof parsed.feedback === 'string' ? parsed.feedback : FeedbackTiming.Smart, fields: parsed.fields };\n } catch {\n return null;\n }\n}\n\n/** How a submit button wears its form's state (vectoriox/iox-ui#42, premium N2). */\nexport interface SubmitButtonView {\n busy: boolean;\n disabled: boolean;\n}\n\n/**\n * While its form sends, a submit button is busy, and disabled unless its author turned that off; once the form has\n * SENT it stays disabled, reading \"Sent\" with its check — nothing sends a lead twice (premium N2, the success in place).\n * ONE rule for the canvas's Sending / Success states, the component path and the string path. Its labels are the shared\n * CSS's, keyed on the same `data-iox-state`.\n */\nexport function submitButtonView(state: FormRenderState | string | null | undefined, disableWhileSubmitting = true): SubmitButtonView {\n const busy = state === FormRenderState.Submitting;\n const sent = state === FormRenderState.Success;\n return { busy, disabled: sent || (busy && disableWhileSubmitting !== false) };\n}\n\n/** On a submit button whose author turned \"Disable while sending\" off. */\nexport const SUBMIT_KEEP_ENABLED_ATTRIBUTE = 'data-iox-keep-enabled';\n\nexport enum SubmitLabelClass {\n Labels = 'iox-submit__labels',\n Idle = 'iox-submit__idle',\n Busy = 'iox-submit__busy',\n Sent = 'iox-submit__sent',\n Check = 'iox-submit__check',\n}\n\n/** The check the Sent label draws once (premium N2 — the rare-tier beat, Emil 135/136): one stroke, `pathLength` 100 so\n * the shared CSS draws it by `stroke-dashoffset` whatever its real length. */\nexport const SUBMIT_CHECK_SVG = `<svg class=\"${SubmitLabelClass.Check}\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" aria-hidden=\"true\" focusable=\"false\">` +\n '<path d=\"M5 12.5l4.5 4.5L19 7.5\" pathLength=\"100\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.4\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/></svg>';\n\n/** \"Sent\" in the site's language, for a button whose author wrote no Sent words (a string-rendered site has no\n * translation service — the document's `lang` picks, like the date picker's words). */\nconst SENT_WORDS: Readonly<Record<string, string>> = Object.freeze({ en: 'Sent', he: 'נשלח' });\n\nexport function sentWord(lang: string | null | undefined): string {\n const language = String(lang ?? '').toLowerCase().split(/[-_]/)[0];\n return SENT_WORDS[language === 'iw' ? 'he' : language] ?? SENT_WORDS['en'];\n}\n\n/** A submit button's three labels: what it says at rest, while its form sends, and once it has sent. */\nexport interface SubmitLabels {\n idle: string;\n /** \"While sending\" — none: the button keeps its idle words while sending. */\n busy?: string | null;\n /** \"Sent\" — none: the catalog's word, translated by the host (`SUBMIT_MESSAGE_KEYS.Sent`). */\n sent: string;\n}\n\n/**\n * A submit button's words, as markup: its three labels stacked in one grid cell (the button keeps the longest one's\n * width and never jumps), each shown by the form's state through the shared CSS — swapped in place behind a 2px blur\n * (Emil 87/139). The string renderer's copy of `IoxSubmitButtonComponent`'s template; `escape` is the renderer's.\n */\nexport function submitButtonLabelsHtml(labels: SubmitLabels, escape: (v: string) => string): string {\n const busy = labels.busy || labels.idle;\n return `<span class=\"${SubmitLabelClass.Labels}\"><span class=\"${SubmitLabelClass.Idle}\">${escape(labels.idle)}</span>` +\n `<span class=\"${SubmitLabelClass.Busy}\">${escape(busy)}</span>` +\n `<span class=\"${SubmitLabelClass.Sent}\">${SUBMIT_CHECK_SVG}<span>${escape(labels.sent)}</span></span></span>`;\n}\n\nexport const FORM_HONEYPOT_CLASS = 'iox-form__hp';\nexport const FORM_ANNOUNCER_ATTRIBUTE = 'data-iox-form-announcer';\n\n/**\n * The honeypot and the failure announcer every form holds, as markup — what `IoxFormComponent`'s template\n * renders, for the string renderer. The honeypot is off-screen (some bots skip hidden inputs), out of the\n * Tab order and the accessibility tree; the announcer is present from the start (a live region added at\n * the moment it gains text is not reliably announced).\n */\nexport function formChromeHtml(honeypotField: string): string {\n return `<div class=\"${FORM_HONEYPOT_CLASS}\" aria-hidden=\"true\"><input type=\"text\" name=\"${honeypotField}\" tabindex=\"-1\" autocomplete=\"off\"></div>` +\n `<div class=\"${FORM_HONEYPOT_CLASS}\" ${FORM_ANNOUNCER_ATTRIBUTE} role=\"status\" aria-live=\"assertive\" aria-atomic=\"true\"></div>`;\n}\n","/**\n * FORM PRESETS — a complete, working form as one insert: its fields, its submit label and the words of\n * its Success and Error blocks. ONE definition (W1.1): the builder's Forms tray builds a preset from\n * here (`buildFormPreset`, iox-builder), and the site composer (`generation-core`) stamps the SAME preset\n * into a composed page, so a generated contact form is the real one — never a second, drifting copy.\n * Data only: framework-free, like the rest of forms-core.\n */\n\nimport type { ChannelKind } from './channel';\n\nexport enum FormPresetId {\n Contact = 'contact',\n Newsletter = 'newsletter',\n Application = 'application',\n Booking = 'booking',\n /** Premium N2: modelled on Doron's iox.studio brief — name, a phone that is also WhatsApp, the business, what they\n * need and a budget as chips, Send with WhatsApp beside it. */\n Lead = 'lead',\n}\n\nexport interface FormPresetField {\n label: string;\n control: string;\n required?: boolean;\n help?: string;\n placeholder?: string;\n /** Choices for select/radio/choices, `value|Label` per line — the Field's `optionsText` trait. */\n optionsText?: string;\n rows?: number;\n /** A Choices field that takes several answers (N1). */\n multiple?: boolean;\n /** A Choices field's appearance — `chips` (the default) or `list` (N1). */\n appearance?: string;\n /** A Date's first and last day — '' any · an integer: days from today · an ISO day (N8, `dates.ts`). */\n earliest?: string;\n latest?: string;\n}\n\n/** The second way to reach the studio, beside Send (N2). Its address is the studio's own and starts EMPTY. */\nexport interface FormPresetChannel {\n kind: `${ChannelKind}`;\n label: string;\n}\n\nexport interface FormPresetDef {\n id: `${FormPresetId}`;\n name: string;\n icon: string;\n /** One line in the panel: what it collects and where it goes. */\n description: string;\n /** The form's author-facing name, which the submissions inbox groups by. */\n formName: string;\n fields: FormPresetField[];\n submitLabel: string;\n successText: string;\n errorText: string;\n channel?: FormPresetChannel;\n /** `false`: the AI plan wire does not offer it yet (the lead preset ships in the builder in M3; generation takes it\n * up in premium M8 — the wire's enum is model-facing and does not change before then). */\n inPlan?: false;\n}\n\n/** The presets a generated plan may name (the plan wire's `form` enum) — every preset not held back by `inPlan`. */\nexport function planFormPresetIds(): string[] {\n return FORM_PRESETS.filter(p => p.inPlan !== false).map(p => p.id);\n}\n\n// forms-core is imported by both renderers (the field runtime), and a renderer that never reads the presets\n// must drop them: the call is `@__PURE__`, and the ids are written as the enum's VALUES (typed by it, pinned\n// to it by form-presets.spec) — a read of `FormPresetId.X` counts as a side effect to a bundler and kept the\n// whole list in the engine's bundle.\nexport const FORM_PRESETS: readonly FormPresetDef[] = /* @__PURE__ */ Object.freeze([\n {\n id: 'contact', name: 'Contact', icon: 'ph-thin ph-envelope-simple',\n description: 'Name, email and a message. Stored, and emailed to you.',\n formName: 'Contact form',\n fields: [\n { label: 'Full name', control: 'text', required: true },\n { label: 'Email', control: 'email', required: true },\n { label: 'Message', control: 'textarea', required: true, rows: 5 },\n ],\n submitLabel: 'Send message',\n successText: 'Thanks — we’ll be in touch shortly.',\n errorText: 'We couldn’t send your message. Please try again — your answers are still here.',\n },\n {\n id: 'newsletter', name: 'Newsletter', icon: 'ph-thin ph-paper-plane-tilt',\n description: 'One email field plus consent. Stored.',\n formName: 'Newsletter signup',\n fields: [\n { label: 'Email', control: 'email', required: true, placeholder: 'you@company.com' },\n // Consent is a checkbox that must be TICKED — `required` on a checkbox becomes the\n // `accepted` rule, with its own message, rather than a generic \"this is required\".\n { label: 'Email me occasional updates', control: 'checkbox', required: true },\n ],\n submitLabel: 'Subscribe',\n successText: 'You’re on the list.',\n errorText: 'We couldn’t sign you up. Please try again.',\n },\n {\n id: 'application', name: 'Application', icon: 'ph-thin ph-read-cv-logo',\n description: 'Details plus a CV upload. Stored, with an auto-reply.',\n formName: 'Application',\n fields: [\n { label: 'Full name', control: 'text', required: true },\n { label: 'Email', control: 'email', required: true },\n { label: 'Phone', control: 'tel' },\n { label: 'Role', control: 'select', required: true, optionsText: 'Design\\nEngineering\\nOther' },\n { label: 'CV', control: 'file', required: true, help: 'PDF or Word, up to 5MB' },\n { label: 'Anything else', control: 'textarea', rows: 4 },\n ],\n submitLabel: 'Apply',\n successText: 'Application received — we’ll read it properly and reply.',\n errorText: 'We couldn’t submit your application. Please try again.',\n },\n {\n id: 'booking', name: 'Booking request', icon: 'ph-thin ph-calendar-check',\n description: 'Date and party size. Stored, and it notifies you.',\n formName: 'Booking request',\n fields: [\n { label: 'Name', control: 'text', required: true },\n { label: 'Email', control: 'email', required: true },\n // The first day a booking may ask for is today (N8): the calendar refuses the past.\n { label: 'Date', control: 'date', required: true, earliest: '0' },\n { label: 'People', control: 'number', required: true },\n { label: 'Notes', control: 'textarea', rows: 3, help: 'Allergies, access needs, anything useful' },\n ],\n submitLabel: 'Request a booking',\n successText: 'Request received — we’ll confirm by email.',\n errorText: 'We couldn’t send your request. Please try again.',\n },\n {\n id: 'lead', name: 'Lead', icon: 'ph-thin ph-handshake',\n description: 'Name, phone, the business and what they need, as chips. Stored, with WhatsApp beside Send.',\n formName: 'Lead form',\n fields: [\n { label: 'Name', control: 'text', required: true },\n { label: 'Phone / WhatsApp', control: 'tel', required: true },\n { label: 'What is your business?', control: 'text' },\n // The words ARE the values: what arrives in the inbox and the email reads as the visitor chose it.\n { label: 'What do you need?', control: 'choices', multiple: true,\n optionsText: 'Website\\nBranding\\nPhotos & video\\nNot sure yet' },\n // Neutral sizes the author renames — never a price or a currency a studio could be held to.\n { label: 'Estimated budget', control: 'choices',\n optionsText: 'Small project\\nMedium\\nLarge\\nNot sure yet' },\n ],\n submitLabel: 'Send',\n successText: 'Thanks — we’ll get back to you soon.',\n errorText: 'We couldn’t send your details. Please try again — your answers are still here.',\n channel: { kind: 'whatsapp', label: 'Message us on WhatsApp' },\n inPlan: false,\n },\n]);\n\n/** The preset with this id, or undefined. */\nexport function formPresetById(id: string | null | undefined): FormPresetDef | undefined {\n return FORM_PRESETS.find(p => p.id === id);\n}\n","// Where form content may NOT render (Doron, 2026-10-20): inside a link or a button.\n//\n// HTML forbids interactive content inside `<a>` and `<button>`, and a click in a field may follow the\n// link. ONE table and ONE walk, shared by the builder's insert rule (refuse it), the builder's audit\n// (find it in a page saved before the rule) and the engine (warn about it, never rewrite it).\n\nimport { FIELD_NODE_TYPE, FORM_NODE_TYPE } from './collect';\n\nexport enum InteractiveTag {\n Anchor = 'a',\n Button = 'button',\n}\n\n/**\n * Every node type that renders as an interactive element, and the element(s) it can render. A ButtonBlock\n * renders `<a>` or `<button>` by its `tag` trait — both interactive, so switching the tag never lifts the\n * rule. Pinned to the engine components' selectors by `interactive-hosts.spec.ts`.\n */\nexport const INTERACTIVE_HOST_TAGS: Readonly<Record<string, readonly InteractiveTag[]>> = Object.freeze({\n // A LinkedContainer is an <a>, or — as an Accordion's header (CC2) — a <button>.\n LinkedContainer: [InteractiveTag.Anchor, InteractiveTag.Button],\n Link: [InteractiveTag.Anchor],\n Button: [InteractiveTag.Anchor],\n ButtonBlock: [InteractiveTag.Anchor, InteractiveTag.Button],\n SubmitButton: [InteractiveTag.Button],\n});\n\nexport const FIELD_GROUP_NODE_TYPE = 'FieldGroup';\nexport const SUBMIT_BUTTON_NODE_TYPE = 'SubmitButton';\n\n/**\n * Form content — what a link or a button must never hold: a Form (its controls), a Field (an input, select\n * or textarea), a SubmitButton (a `<button>`) and a FieldGroup (it exists only to hold fields, so it moves as\n * one). A Success / Error block is text and lives only inside its form, so it is not on the list.\n */\nexport const FORM_CONTENT_TYPES: ReadonlySet<string> = new Set([\n FORM_NODE_TYPE, FIELD_NODE_TYPE, FIELD_GROUP_NODE_TYPE, SUBMIT_BUTTON_NODE_TYPE,\n]);\n\n/** The minimum a node must look like — a builder ComponentNode and a saved layout node both do. */\nexport interface NestingNode {\n id?: string;\n type?: string;\n label?: string;\n children?: NestingNode[] | null;\n}\n\nexport function isInteractiveHost(node: NestingNode | null | undefined): boolean {\n return !!node?.type && Object.prototype.hasOwnProperty.call(INTERACTIVE_HOST_TAGS, node.type);\n}\n\nexport function isFormContent(node: NestingNode | null | undefined): boolean {\n return !!node?.type && FORM_CONTENT_TYPES.has(node.type);\n}\n\n/**\n * The first form-content node in `node`'s subtree that sits inside an interactive host, or null. `insideHost`\n * is true when `node` is placed under a host already — so a Form dropped into a link and a link that holds a\n * Form are the same finding.\n */\nexport function formContentInHost(node: NestingNode | null | undefined, insideHost = false): NestingNode | null {\n if (!node) return null;\n if (insideHost && isFormContent(node)) return node;\n const nowInside = insideHost || isInteractiveHost(node);\n for (const child of node.children ?? []) {\n const found = formContentInHost(child, nowInside);\n if (found) return found;\n }\n return null;\n}\n\n/** One place a tree holds form content inside a link or a button. */\nexport interface MisplacedFormContent<N extends NestingNode = NestingNode> {\n /** The OUTERMOST interactive host holding it. */\n host: N;\n /** A MAXIMAL form-content subtree inside it — the Form, never each of its fields. */\n content: N;\n}\n\n/** Every form-content subtree a tree holds inside an interactive host, in document order. */\nexport function findFormContentInHosts<N extends NestingNode>(roots: readonly N[] | null | undefined): MisplacedFormContent<N>[] {\n const out: MisplacedFormContent<N>[] = [];\n const visit = (node: N, host: N | null): void => {\n if (host && isFormContent(node)) {\n out.push({ host, content: node });\n return;\n }\n const nextHost = host ?? (isInteractiveHost(node) ? node : null);\n for (const child of (node.children ?? []) as N[]) visit(child, nextHost);\n };\n for (const root of roots ?? []) visit(root, null);\n return out;\n}\n","/**\n * THE SECOND CHANNEL (premium components N2) — \"or message us on WhatsApp\", the button a form keeps beside its submit,\n * before AND after it sends.\n *\n * It is an ordinary node in the form's actions row (a ButtonBlock that links) carrying the ROLE `form.channel`, so the\n * shared CSS keeps it on screen when the form succeeds and the Publishable gate can find it. Its address is the\n * OWNER's fact: the builder builds it from what the author types (a number, an address, a link) and never invents one —\n * inserted empty, it blocks publishing until it is filled (generation-core `auditSite`, `empty-channel`).\n *\n * Framework-free, like the rest of forms-core.\n */\n\n/** The role the channel's node carries (`iox-role-form-channel`). */\nexport const FORM_CHANNEL_ROLE = 'form.channel';\n/** The role of the row that holds the submit button and the channel (`iox-role-form-actions`). */\nexport const FORM_ACTIONS_ROLE = 'form.actions';\n\nexport enum ChannelKind {\n WhatsApp = 'whatsapp',\n Phone = 'phone',\n Email = 'email',\n Link = 'link',\n}\n\nexport const CHANNEL_KINDS: ReadonlyArray<ChannelKind> = [ChannelKind.WhatsApp, ChannelKind.Phone, ChannelKind.Email, ChannelKind.Link];\n\nconst WHATSAPP_PREFIX = 'https://wa.me/';\nconst TEL_PREFIX = 'tel:';\nconst MAILTO_PREFIX = 'mailto:';\nconst HTTP = /^https?:\\/\\//i;\nconst EMAIL = /^[^\\s@]+@[^\\s@.]+(\\.[^\\s@.]+)+$/;\n/** A phone number's own characters; anything else is typing noise (spaces, dashes, brackets). */\nconst DIGITS = /\\d/g;\n/** WhatsApp's click-to-chat wants the full international number: digits only, no `+`, no leading `00`. */\nconst INTERNATIONAL_00 = /^00/;\n/** A number shorter than this is not a number anyone can be reached on. */\nconst MIN_DIGITS = 6;\n\n/**\n * The address a channel links to, built from what the author typed — or `''` when it gives nothing a visitor could\n * use (no digits, not an email). Never a guess: a WhatsApp number keeps exactly the digits typed (the panel asks for\n * the country code), a link without a scheme gets `https://`.\n */\nexport function channelHref(kind: ChannelKind | string, input: unknown): string {\n const raw = typeof input === 'string' ? input.trim() : '';\n if (!raw) return '';\n switch (kind) {\n case ChannelKind.WhatsApp: {\n const digits = (raw.match(DIGITS) ?? []).join('').replace(INTERNATIONAL_00, '');\n return digits.length >= MIN_DIGITS ? `${WHATSAPP_PREFIX}${digits}` : '';\n }\n case ChannelKind.Phone: {\n const digits = (raw.match(DIGITS) ?? []).join('');\n if (digits.length < MIN_DIGITS) return '';\n return `${TEL_PREFIX}${raw.startsWith('+') ? '+' : ''}${digits}`;\n }\n case ChannelKind.Email:\n return EMAIL.test(raw) ? `${MAILTO_PREFIX}${raw}` : '';\n case ChannelKind.Link:\n return HTTP.test(raw) ? raw : `https://${raw.replace(/^\\/+/, '')}`;\n default:\n return '';\n }\n}\n\n/** A channel's address back into what the panel shows: its kind and the value the author typed. */\nexport function parseChannelHref(href: unknown): { kind: ChannelKind; value: string } {\n const text = typeof href === 'string' ? href.trim() : '';\n if (text.toLowerCase().startsWith(WHATSAPP_PREFIX)) return { kind: ChannelKind.WhatsApp, value: text.slice(WHATSAPP_PREFIX.length).split(/[?#]/)[0] };\n if (text.toLowerCase().startsWith(TEL_PREFIX)) return { kind: ChannelKind.Phone, value: text.slice(TEL_PREFIX.length) };\n if (text.toLowerCase().startsWith(MAILTO_PREFIX)) return { kind: ChannelKind.Email, value: text.slice(MAILTO_PREFIX.length).split('?')[0] };\n if (!text) return { kind: ChannelKind.WhatsApp, value: '' };\n return { kind: ChannelKind.Link, value: text };\n}\n\n/** True when the channel goes somewhere a visitor can use — the gate's \"filled\". */\nexport function isChannelFilled(href: unknown): boolean {\n const { kind, value } = parseChannelHref(href);\n return !!value && channelHref(kind, value) !== '';\n}\n\n/** A WhatsApp or web channel opens in a new tab; a call or an email hands over to the device. */\nexport function channelOpensNewTab(kind: ChannelKind | string): boolean {\n return kind === ChannelKind.WhatsApp || kind === ChannelKind.Link;\n}\n","/**\n * A Field as MARKUP — the string renderer's copy of `IoxFieldComponent`'s template, in ONE place (it lived in the\n * engine's `layout-renderer.service.ts`, a second copy beside the component). The engine's string path writes it; the\n * component mirrors it element for element, so hydration replaces like with like and the shared CSS (iox-forms.css,\n * the contract's field baseline) reaches both.\n *\n * Choices (premium N1): a `<fieldset>` whose `<legend>` is the label, its options native radios (one answer — the\n * arrow keys move and pick, with no script) or checkboxes (several), each inside a `<label>` that IS the chip; the\n * input is visually hidden, never removed. Date (N8): a `<button>` that says the date in words and opens the look's\n * calendar, with a hidden input carrying the ISO day — the raw SSR is the final markup (nothing shifts on hydrate).\n *\n * Framework-free, like the rest of forms-core: `escape` is the caller's.\n */\n\nimport { ChoiceAppearance, ControlType } from './form.model';\nimport { datePickerWords } from './dates';\nimport { fieldOptionsOf } from './options';\n\n/** The classes the markup carries — the runtimes and the shared CSS key on these, never on a literal. */\nexport enum FieldClass {\n Root = 'iox-field',\n Label = 'iox-field__label',\n LabelHidden = 'iox-field__label--hidden',\n Required = 'iox-field__required',\n Control = 'iox-field__control',\n Help = 'iox-field__help',\n Error = 'iox-field__error',\n Group = 'iox-field__group',\n Option = 'iox-field__option',\n Choices = 'iox-field__choices',\n ChoicesChips = 'iox-field__choices--chips',\n ChoicesList = 'iox-field__choices--list',\n Chips = 'iox-field__chips',\n Chip = 'iox-field__chip',\n ChipInput = 'iox-field__control--chip',\n DateButton = 'iox-field__control--date',\n DateValue = 'iox-field__date-value',\n DateIcon = 'iox-field__date-icon',\n DateInput = 'iox-field__date-input',\n}\n\n/** On the date button: the raw Earliest / Latest (`'0'`, an ISO day), resolved by the visitor's own today. */\nexport const DATE_MIN_ATTRIBUTE = 'data-iox-date-min';\nexport const DATE_MAX_ATTRIBUTE = 'data-iox-date-max';\n/** On the date's words while no day is chosen (the placeholder's colour keys on it). */\nexport const DATE_EMPTY_ATTRIBUTE = 'data-iox-empty';\n\n/** The calendar glyph inside the date button: one path set, drawn in currentColor, never announced. */\nexport const DATE_ICON_SVG = '<svg class=\"iox-field__date-icon\" width=\"20\" height=\"20\" viewBox=\"0 0 24 24\" aria-hidden=\"true\" focusable=\"false\">' +\n '<rect x=\"3.5\" y=\"5\" width=\"17\" height=\"15.5\" rx=\"2.5\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.6\"/>' +\n '<path d=\"M3.5 10h17M8 3v4M16 3v4\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.6\" stroke-linecap=\"round\"/></svg>';\n\n/** The controls that are a plain `<input type=…>`; anything else unknown is a text input. */\nconst INPUT_TYPES: ReadonlySet<string> = new Set(['email', 'tel', 'url', 'number', 'password', 'time', 'file', 'hidden']);\n\n/** The `<input type>` of a control that renders as a plain input. */\nexport function inputTypeOf(control: string): string {\n return INPUT_TYPES.has(control) ? control : 'text';\n}\n\n/** A Choices field's appearance; anything unknown reads as chips (the default). */\nexport function choiceAppearanceOf(props: Record<string, any> | null | undefined): ChoiceAppearance {\n return props?.['appearance'] === ChoiceAppearance.List ? ChoiceAppearance.List : ChoiceAppearance.Chips;\n}\n\nexport interface FieldMarkupOptions {\n /** The name the field submits under — its FORM's unique name for it (`formFieldNames`, vectoriox/iox-ui#43). */\n name: string;\n /** The control's id; the label, help and error ids derive from it. */\n id: string;\n /** The node's classes (`iox-node-…`, the element-style marker…). */\n cls: string;\n /** Anything else the host element carries, written verbatim (an entrance's style). */\n attrs?: string;\n /** The site's language (the date's words). */\n lang?: string | null;\n escape: (value: string) => string;\n}\n\n/** A Field's whole element, as the string renderer writes it. */\nexport function fieldHtml(props: Record<string, any> | null | undefined, options: FieldMarkupOptions): string {\n const p = props ?? {};\n const { name, id, escape: esc } = options;\n const control = String(p['control'] ?? ControlType.Text);\n const required = !!p['required'];\n const help = p['help'] ? `<p class=\"${FieldClass.Help}\" id=\"${id}-help\">${esc(String(p['help']))}</p>` : '';\n const describedBy = p['help'] ? ` aria-describedby=\"${id}-help\"` : '';\n const labelClass = p['labelHidden'] ? `${FieldClass.Label} ${FieldClass.LabelHidden}` : FieldClass.Label;\n const mark = required ? `<span class=\"${FieldClass.Required}\" aria-hidden=\"true\">*</span>` : '';\n const text = esc(String(p['label'] ?? ''));\n const label = `<label class=\"${labelClass}\" id=\"${id}-label\" for=\"${id}\">${text}${mark}</label>`;\n const hidden = control === ControlType.Hidden ? ' hidden' : '';\n const open = `<div class=\"${FieldClass.Root} ${options.cls}\" data-iox-field=\"${esc(name)}\"${hidden}${options.attrs ?? ''}>`;\n\n if (control === ControlType.Choices) {\n return `${open}${choicesHtml(p, options, `<legend class=\"${labelClass}\" id=\"${id}-label\">${text}${mark}</legend>`, describedBy)}${help}</div>`;\n }\n return `${open}${label}${controlHtml(p, control, options, describedBy)}${help}</div>`;\n}\n\nfunction controlHtml(p: Record<string, any>, control: string, options: FieldMarkupOptions, describedBy: string): string {\n const { id, escape: esc } = options;\n const name = esc(options.name);\n const required = p['required'] ? ' required' : '';\n const placeholder = p['placeholder'] ? ` placeholder=\"${esc(String(p['placeholder']))}\"` : '';\n const choices = fieldOptionsOf(p);\n const option = (o: { value: string; label: string }) => `<option value=\"${esc(o.value)}\">${esc(o.label)}</option>`;\n const num = (v: unknown, d: number) => (Number.isFinite(Number(v)) && v !== '' && v !== null ? Number(v) : d);\n\n switch (control) {\n case ControlType.Textarea:\n return `<textarea class=\"${FieldClass.Control}\" id=\"${id}\" name=\"${name}\" rows=\"${num(p['rows'], 4)}\"${placeholder}${required}${describedBy}></textarea>`;\n case ControlType.Select:\n return `<select class=\"${FieldClass.Control}\" id=\"${id}\" name=\"${name}\"${required}${describedBy}>` +\n `<option value=\"\">${esc(String(p['placeholder'] ?? ''))}</option>${choices.map(option).join('')}</select>`;\n case ControlType.Switch:\n return `<input class=\"${FieldClass.Control} iox-field__control--switch\" type=\"checkbox\" role=\"switch\" id=\"${id}\" name=\"${name}\"${describedBy}>`;\n case ControlType.Range:\n return `<input class=\"${FieldClass.Control} iox-field__control--range\" type=\"range\" id=\"${id}\" name=\"${name}\" ` +\n `min=\"${num(p['rangeMin'], 0)}\" max=\"${num(p['rangeMax'], 100)}\" step=\"${num(p['rangeStep'], 1)}\"${describedBy}>`;\n case ControlType.Radio:\n return `<div class=\"${FieldClass.Group}\" role=\"radiogroup\" aria-labelledby=\"${id}-label\">` +\n choices.map(o => `<label class=\"${FieldClass.Option}\"><input class=\"${FieldClass.Control} iox-field__control--radio\" type=\"radio\" name=\"${name}\" ` +\n `value=\"${esc(o.value)}\"><span>${esc(o.label)}</span></label>`).join('') + `</div>`;\n case ControlType.Checkbox:\n return `<input class=\"${FieldClass.Control} iox-field__control--checkbox\" type=\"checkbox\" id=\"${id}\" name=\"${name}\"${required}${describedBy}>`;\n case ControlType.Date:\n return dateHtml(p, options, describedBy);\n default:\n return `<input class=\"${FieldClass.Control}\" id=\"${id}\" name=\"${name}\" type=\"${inputTypeOf(control)}\"${placeholder}${required}${describedBy}>`;\n }\n}\n\n/** A Choices field's fieldset: the legend, then the options as chips or as a list. */\nfunction choicesHtml(p: Record<string, any>, options: FieldMarkupOptions, legend: string, describedBy: string): string {\n const { escape: esc } = options;\n const name = esc(options.name);\n const multiple = p['multiple'] === true;\n const type = multiple ? 'checkbox' : 'radio';\n const chips = choiceAppearanceOf(p) === ChoiceAppearance.Chips;\n const items = fieldOptionsOf(p).map(o => chips\n ? `<label class=\"${FieldClass.Chip}\"><input class=\"${FieldClass.Control} ${FieldClass.ChipInput}\" type=\"${type}\" name=\"${name}\" value=\"${esc(o.value)}\"><span>${esc(o.label)}</span></label>`\n : `<label class=\"${FieldClass.Option}\"><input class=\"${FieldClass.Control}\" type=\"${type}\" name=\"${name}\" value=\"${esc(o.value)}\"><span>${esc(o.label)}</span></label>`).join('');\n const look = chips ? FieldClass.ChoicesChips : FieldClass.ChoicesList;\n const row = chips ? FieldClass.Chips : FieldClass.Group;\n return `<fieldset class=\"${FieldClass.Choices} ${look}\"${describedBy}>${legend}<div class=\"${row}\">${items}</div></fieldset>`;\n}\n\n/** The date picker's button + hidden input. The calendar itself is the runtime's, opened on press. */\nfunction dateHtml(p: Record<string, any>, options: FieldMarkupOptions, describedBy: string): string {\n const { id, escape: esc } = options;\n const words = datePickerWords(options.lang);\n const empty = esc(String(p['placeholder'] || words.choose));\n const bound = (attr: string, raw: unknown) => (typeof raw === 'string' && raw.trim() !== '') || typeof raw === 'number' ? ` ${attr}=\"${esc(String(raw).trim())}\"` : '';\n return `<button type=\"button\" class=\"${FieldClass.Control} ${FieldClass.DateButton}\" id=\"${id}\" aria-haspopup=\"dialog\" aria-expanded=\"false\" ` +\n `aria-labelledby=\"${id}-label ${id}-value\"${describedBy}${bound(DATE_MIN_ATTRIBUTE, p['earliest'])}${bound(DATE_MAX_ATTRIBUTE, p['latest'])}>` +\n `<span class=\"${FieldClass.DateValue}\" id=\"${id}-value\" ${DATE_EMPTY_ATTRIBUTE}>${empty}</span>${DATE_ICON_SVG}</button>` +\n `<input type=\"hidden\" class=\"${FieldClass.DateInput}\" name=\"${esc(options.name)}\" value=\"\">`;\n}\n","/*\n * @vectoriox/iox-ui/forms-core — the shared, FRAMEWORK-FREE core of the forms feature.\n *\n * ⚠️ Nothing in this entry point may import Angular, RxJS, the DOM, or Node. It is consumed by\n * THREE runtimes: the builder canvas (Angular), the SSR engine (Angular), and `iox-cms` (NestJS,\n * plain Node). The main `@vectoriox/iox-ui` entry pulls in `@angular/core`, which Nest must never\n * load — that is the entire reason this secondary entry point exists.\n *\n * Client-side validation is UX; server-side validation is truth. Both run THIS code, so they cannot\n * disagree. See iox-ai-guidance `architecture/builder/forms-and-inputs-plan.md` §5.\n */\n\nexport * from './form.model';\nexport * from './messages';\nexport * from './validate';\nexport * from './collect';\nexport * from './options';\nexport * from './runtime';\nexport * from './rule-catalog';\nexport * from './transport';\nexport * from './submit-lifecycle';\nexport * from './form-presets';\nexport * from './nesting';\nexport * from './dates';\nexport * from './channel';\nexport * from './field-markup';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AAEA;IACY;AAAZ,CAAA,UAAY,WAAW,EAAA;AACnB,IAAA,WAAA,CAAA,MAAA,CAAA,GAAA,MAAa;AACb,IAAA,WAAA,CA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