{"version":3,"file":"index.mjs","names":[],"sources":["../../forge-moj-components/src/utils/nunjucksComponent.ts","../../forge-moj-components/src/utils/mojParamNormalisers.ts","../../forge-moj-components/src/components/alert/mojAlert.ts","../../forge-moj-components/src/components/badge/mojBadge.ts","../../forge-moj-components/src/components/banner/mojBanner.ts","../../forge-moj-components/src/components/button-menu/mojButtonMenu.ts","../../forge-moj-components/src/components/card/mojCard.ts","../../forge-moj-components/src/components/card-group/mojCardGroup.ts","../../forge-moj-components/src/components/date-picker/mojDatePicker.ts","../../forge-moj-components/src/components/filter/mojFilter.ts","../../forge-moj-components/src/components/progress-bar/mojProgressBar.ts","../../forge-moj-components/src/components/side-navigation/mojSideNavigation.ts","../../forge-moj-components/src/components/sub-navigation/mojSubNavigation.ts","../../forge-moj-components/src/components/ticket-panel/mojTicketPanel.ts","../../forge-moj-components/src/components/timeline/mojTimeline.ts","../../forge-moj-components/src/components/messages/mojMessages.ts","../../forge-moj-components/src/components/multi-select/mojMultiSelect.ts","../../forge-moj-components/src/components/sortable-table/mojSortableTable.ts","../../forge-moj-components/src/components/index.ts"],"sourcesContent":["import type nunjucks from 'nunjucks'\n\nimport { component } from '@ministryofjustice/hmpps-forge/core/components'\nimport type {\n  BlockDefinition,\n  ComponentOptions,\n  EvaluatedBlock,\n  ForgeComponent,\n} from '@ministryofjustice/hmpps-forge/core/components'\n\n/**\n * Render function for Nunjucks components.\n * Receives the evaluated block and a nunjucks environment (passed as renderer by TemplateRenderer).\n */\nexport type NunjucksComponentRenderer<T extends BlockDefinition> = (\n  block: EvaluatedBlock<T>,\n  nunjucksEnv: nunjucks.Environment,\n) => string\n\n/**\n * Defines a Nunjucks component from a single block interface - `component()` with the\n * renderer pinned, so the render callback receives a typed `nunjucks.Environment`.\n *\n * A local copy of the express-nunjucks helper: importing it from that package would\n * pull the express adapter (and express itself) into every browser bundle that uses\n * these components.\n */\nexport function nunjucksComponent<TBlock extends BlockDefinition>(\n  variant: string,\n  options: ComponentOptions<TBlock, string, nunjucks.Environment>,\n): ForgeComponent<TBlock, string> {\n  return component<TBlock, string, nunjucks.Environment>(variant, options)\n}\n","import type { RenderedBlock } from '@ministryofjustice/hmpps-forge/core/components'\n\ntype MojRenderedBlockContent = RenderedBlock | readonly RenderedBlock[] | undefined\n\ninterface MojTextHtmlContent {\n  readonly text?: string\n  readonly html?: string\n  readonly blocks?: MojRenderedBlockContent\n}\n\ninterface MojNormalisedTextHtmlContent {\n  text?: string\n  html?: string\n}\n\nfunction renderMojBlocksToHtml(blocks: MojRenderedBlockContent): string | undefined {\n  if (!blocks) {\n    return undefined\n  }\n\n  const renderedBlocks = Array.isArray(blocks) ? blocks : [blocks]\n\n  if (renderedBlocks.length === 0) {\n    return undefined\n  }\n\n  return renderedBlocks.map(block => block.html).join('')\n}\n\nexport function normaliseMojTextHtmlContent(content: MojTextHtmlContent): MojNormalisedTextHtmlContent {\n  const blocksHtml = renderMojBlocksToHtml(content.blocks)\n\n  return {\n    text: blocksHtml !== undefined ? undefined : content.text,\n    html: blocksHtml ?? content.html,\n  }\n}\n","import { BlockDefinition, ResolvableString, ResolvableBoolean } from '@ministryofjustice/hmpps-forge/core/components'\nimport { nunjucksComponent } from '../../utils/nunjucksComponent'\nimport { normaliseMojTextHtmlContent } from '../../utils/mojParamNormalisers'\n\n/**\n * Alert variant types that determine styling and icon.\n */\nexport type MOJAlertVariant = 'information' | 'success' | 'warning' | 'error'\n\n/**\n * Valid heading tag levels for the alert title.\n */\nexport type MOJAlertHeadingTag = 'h2' | 'h3' | 'h4'\n\n/**\n * MOJ Alert component.\n * Displays important messages to users as a notification banner.\n * It supports different variants for different types of messages\n * (information, success, warning, error) and can be dismissible.\n *\n * @see https://design-patterns.service.justice.gov.uk/components/alert\n * @example\n * ```typescript\n * MOJAlert({\n *   alertVariant: 'success',\n *   title: 'Application submitted',\n *   text: 'Your changes have been saved successfully.',\n *   showTitleAsHeading: true,\n * })\n * ```\n */\nexport interface MOJAlert extends BlockDefinition {\n  /**\n   * The type of alert which determines styling and icon.\n   * Options: 'information' (default), 'success', 'warning', 'error'\n   *\n   * @example 'information' // Blue info alert\n   * @example 'success' // Green success alert\n   * @example 'warning' // Yellow warning alert\n   * @example 'error' // Red error alert\n   */\n  alertVariant?: MOJAlertVariant | ResolvableString\n\n  /**\n   * The title of the alert. Used for the aria-label and optionally as a heading.\n   *\n   * @example 'Important information'\n   * @example 'Application submitted'\n   */\n  title: ResolvableString\n\n  /**\n   * Plain text content for the alert message.\n   * Use either text or html, not both.\n   *\n   * @example 'Your application has been received.'\n   */\n  text?: ResolvableString\n\n  /**\n   * HTML content for the alert message.\n   * Use either text or html, not both.\n   *\n   * @example '<p>You have <strong>unsaved changes</strong>.</p>'\n   */\n  html?: ResolvableString\n\n  /**\n   * Child blocks to render in the alert message.\n   * Takes precedence over text/html.\n   */\n  blocks?: BlockDefinition[]\n\n  /**\n   * Whether to display the title as a heading element.\n   * When true, the title appears as a heading above the content.\n   *\n   * @example true // Show title as heading\n   */\n  showTitleAsHeading?: ResolvableBoolean\n\n  /**\n   * The heading level when showTitleAsHeading is true.\n   * Options: 'h2' (default), 'h3', 'h4'\n   *\n   * @example 'h2' // Default heading level\n   * @example 'h3' // Smaller heading\n   */\n  headingTag?: MOJAlertHeadingTag | ResolvableString\n\n  /**\n   * Whether the alert can be dismissed by the user.\n   * When true, a dismiss button is shown.\n   *\n   * @example true // Show dismiss button\n   */\n  dismissible?: ResolvableBoolean\n\n  /**\n   * Text for the dismiss button.\n   * Default: 'Dismiss'\n   *\n   * @example 'Close'\n   * @example 'Hide this message'\n   */\n  dismissText?: ResolvableString\n\n  /**\n   * Whether to disable auto-focus on the alert when it appears.\n   *\n   * @example true // Disable auto-focus\n   */\n  disableAutoFocus?: ResolvableBoolean\n\n  /**\n   * CSS selector for the element to focus when the alert is dismissed.\n   *\n   * @example '#main-content'\n   */\n  focusOnDismissSelector?: ResolvableString\n\n  /**\n   * ARIA role for the alert container.\n   * Default: 'region'\n   *\n   * @example 'alert' // For urgent notifications\n   * @example 'status' // For status updates\n   */\n  role?: ResolvableString\n\n  /**\n   * Additional CSS classes for the alert container.\n   *\n   * @example 'app-alert--custom'\n   */\n  classes?: ResolvableString\n\n  /**\n   * Additional HTML attributes for the alert container.\n   *\n   * @example { 'data-module': 'custom-alert' }\n   */\n  attributes?: Record<string, ResolvableString>\n}\n\n/**\n * MOJ Alert component.\n * Displays important messages to users as a notification banner.\n * It supports different variants for different types of messages\n * (information, success, warning, error) and can be dismissible.\n *\n * @see https://design-patterns.service.justice.gov.uk/components/alert\n * @example\n * ```typescript\n * MOJAlert({\n *   alertVariant: 'success',\n *   title: 'Application submitted',\n *   text: 'Your changes have been saved successfully.',\n *   showTitleAsHeading: true,\n * })\n * ```\n */\nexport const MOJAlert = nunjucksComponent<MOJAlert>('mojAlert', {\n  render: (props, nunjucksEnv) => {\n    const content = normaliseMojTextHtmlContent({\n      text: props.text,\n      html: props.html,\n      blocks: props.blocks,\n    })\n    const params = {\n      variant: props.alertVariant,\n      title: props.title,\n      text: content.text,\n      html: content.html,\n      showTitleAsHeading: props.showTitleAsHeading,\n      headingTag: props.headingTag,\n      dismissible: props.dismissible,\n      dismissText: props.dismissText,\n      disableAutoFocus: props.disableAutoFocus,\n      focusOnDismissSelector: props.focusOnDismissSelector,\n      role: props.role,\n      classes: props.classes,\n      attributes: props.attributes,\n    }\n\n    return nunjucksEnv.render('moj/components/alert/template.njk', { params })\n  },\n})\n","import { BlockDefinition, ResolvableString } from '@ministryofjustice/hmpps-forge/core/components'\nimport { nunjucksComponent } from '../../utils/nunjucksComponent'\n\n/**\n * Available badge colour classes.\n * Use these to style the badge appearance.\n */\nexport type MOJBadgeColour =\n  | 'moj-badge--purple'\n  | 'moj-badge--light-purple'\n  | 'moj-badge--bright-purple'\n  | 'moj-badge--pink'\n  | 'moj-badge--light-pink'\n  | 'moj-badge--red'\n  | 'moj-badge--orange'\n  | 'moj-badge--brown'\n  | 'moj-badge--yellow'\n  | 'moj-badge--light-green'\n  | 'moj-badge--green'\n  | 'moj-badge--turquoise'\n  | 'moj-badge--light-blue'\n  | 'moj-badge--blue'\n  | 'moj-badge--black'\n  | 'moj-badge--dark-grey'\n  | 'moj-badge--mid-grey'\n  | 'moj-badge--light-grey'\n  | 'moj-badge--white'\n\n/**\n * MOJ Badge component.\n * Displays small status or category labels.\n * It can be styled with different colours to indicate different states.\n *\n * @see https://design-patterns.service.justice.gov.uk/components/badge\n * @example\n * ```typescript\n * MOJBadge({\n *   text: 'Urgent',\n *   classes: 'moj-badge--red',\n * })\n * ```\n *\n * @example\n * ```typescript\n * MOJBadge({\n *   text: 'Complete',\n *   classes: 'moj-badge--green',\n *   label: 'Status: Complete',\n * })\n * ```\n */\nexport interface MOJBadge extends BlockDefinition {\n  /**\n   * Plain text content for the badge.\n   * Use either text or html, not both.\n   *\n   * @example 'Complete'\n   * @example 'In progress'\n   */\n  text?: ResolvableString\n\n  /**\n   * HTML content for the badge.\n   * Use either text or html, not both.\n   *\n   * @example '<strong>Urgent</strong>'\n   */\n  html?: ResolvableString\n\n  /**\n   * CSS classes for the badge container.\n   * Use moj-badge--{colour} classes to style the badge.\n   *\n   * @example 'moj-badge--blue'\n   * @example 'moj-badge--red moj-badge--large'\n   */\n  classes?: MOJBadgeColour | ResolvableString\n\n  /**\n   * Accessible label for the badge.\n   * Sets the aria-label attribute for screen readers.\n   *\n   * @example 'Status: Complete'\n   */\n  label?: ResolvableString\n\n  /**\n   * Additional HTML attributes for the badge container.\n   *\n   * @example { 'data-status': 'complete' }\n   */\n  attributes?: Record<string, ResolvableString>\n}\n\n/**\n * MOJ Badge component.\n * Displays small status or category labels.\n * It can be styled with different colours to indicate different states.\n *\n * @see https://design-patterns.service.justice.gov.uk/components/badge\n * @example\n * ```typescript\n * MOJBadge({\n *   text: 'Urgent',\n *   classes: 'moj-badge--red',\n * })\n * ```\n *\n * @example\n * ```typescript\n * MOJBadge({\n *   text: 'Complete',\n *   classes: 'moj-badge--green',\n *   label: 'Status: Complete',\n * })\n * ```\n */\nexport const MOJBadge = nunjucksComponent<MOJBadge>('mojBadge', {\n  render: (props, nunjucksEnv) => {\n    const params = {\n      text: props.text,\n      html: props.html,\n      classes: props.classes,\n      label: props.label,\n      attributes: props.attributes,\n    }\n\n    return nunjucksEnv.render('moj/components/badge/template.njk', { params })\n  },\n})\n","import { BlockDefinition, ResolvableString } from '@ministryofjustice/hmpps-forge/core/components'\nimport { nunjucksComponent } from '../../utils/nunjucksComponent'\nimport { normaliseMojTextHtmlContent } from '../../utils/mojParamNormalisers'\n\n/**\n * Banner type that determines styling and icon.\n */\nexport type MOJBannerType = 'success' | 'warning' | 'information'\n\n/**\n * MOJ Banner component.\n * Displays important messages to users.\n * It supports different types for different kinds of messages\n * (success, warning, information) with corresponding icons.\n *\n * @see https://design-patterns.service.justice.gov.uk/components/banner\n * @example\n * ```typescript\n * MOJBanner({\n *   bannerType: 'success',\n *   text: 'Your application has been submitted.',\n * })\n * ```\n */\nexport interface MOJBanner extends BlockDefinition {\n  /**\n   * The type of banner which determines styling and icon.\n   * Options: 'success', 'warning', 'information'\n   * If not specified, renders a default banner without icon.\n   *\n   * @example 'success' // Green banner with checkmark icon\n   * @example 'warning' // Yellow banner with warning icon\n   * @example 'information' // Blue banner with info icon\n   */\n  bannerType?: MOJBannerType | ResolvableString\n\n  /**\n   * Plain text content for the banner message.\n   * Use either text or html, not both.\n   *\n   * @example 'Your application has been submitted.'\n   */\n  text?: ResolvableString\n\n  /**\n   * HTML content for the banner message.\n   * Use either text or html, not both.\n   *\n   * @example '<p>Your application has been <strong>submitted</strong>.</p>'\n   */\n  html?: ResolvableString\n\n  /**\n   * Child blocks to render in the banner message.\n   * Takes precedence over text/html.\n   */\n  blocks?: BlockDefinition[]\n\n  /**\n   * Fallback text for the icon used in the aria-label.\n   * Defaults to the bannerType value if not provided.\n   *\n   * @example 'Success'\n   * @example 'Warning'\n   */\n  iconFallbackText?: ResolvableString\n\n  /**\n   * Additional CSS classes for the banner container.\n   *\n   * @example 'app-banner--custom'\n   */\n  classes?: ResolvableString\n\n  /**\n   * Additional HTML attributes for the banner container.\n   *\n   * @example { 'data-module': 'custom-banner' }\n   */\n  attributes?: Record<string, ResolvableString>\n}\n\n/**\n * MOJ Banner component.\n * Displays important messages to users.\n * It supports different types for different kinds of messages\n * (success, warning, information) with corresponding icons.\n *\n * @see https://design-patterns.service.justice.gov.uk/components/banner\n * @example\n * ```typescript\n * MOJBanner({\n *   bannerType: 'success',\n *   text: 'Your application has been submitted.',\n * })\n * ```\n */\nexport const MOJBanner = nunjucksComponent<MOJBanner>('mojBanner', {\n  render: (props, nunjucksEnv) => {\n    const content = normaliseMojTextHtmlContent({\n      text: props.text,\n      html: props.html,\n      blocks: props.blocks,\n    })\n    const params = {\n      type: props.bannerType,\n      text: content.text,\n      html: content.html,\n      iconFallbackText: props.iconFallbackText,\n      classes: props.classes,\n      attributes: props.attributes,\n    }\n\n    return nunjucksEnv.render('moj/components/banner/template.njk', { params })\n  },\n})\n","import {\n  BlockDefinition,\n  ResolvableString,\n  ResolvableBoolean,\n  ResolvableArray,\n} from '@ministryofjustice/hmpps-forge/core/components'\nimport { nunjucksComponent } from '../../utils/nunjucksComponent'\n\n/**\n * Menu alignment options for the button menu dropdown.\n */\nexport type MOJButtonMenuAlign = 'left' | 'right'\n\n/**\n * Configuration for the toggle button that opens/closes the menu.\n */\nexport interface MOJButtonMenuButton {\n  /**\n   * Text content for the toggle button.\n   *\n   * @example 'Actions'\n   * @example 'Options'\n   */\n  text?: ResolvableString\n\n  /**\n   * Additional CSS classes for the toggle button.\n   *\n   * @example 'govuk-button--secondary'\n   */\n  classes?: ResolvableString\n}\n\n/**\n * Menu item configuration for a button in the menu.\n * Based on GOV.UK Button component parameters.\n *\n * @see https://design-system.service.gov.uk/components/button/\n */\nexport interface MOJButtonMenuItem {\n  /**\n   * Whether to use an `input`, `button` or `a` element.\n   * Automatically configured if `href` or `html` is set.\n   *\n   * @example 'button'\n   * @example 'a'\n   */\n  element?: 'input' | 'button' | 'a' | ResolvableString\n\n  /**\n   * Text content for the button or link.\n   * Required if `html` is not set.\n   *\n   * @example 'Archive'\n   * @example 'Delete'\n   */\n  text?: ResolvableString\n\n  /**\n   * HTML content for the button or link.\n   * Required if `text` is not set.\n   *\n   * @example '<span class=\"icon\">+</span> Add item'\n   */\n  html?: ResolvableString\n\n  /**\n   * Name attribute for input or button elements.\n   * Has no effect on anchor elements.\n   *\n   * @example 'action'\n   */\n  name?: ResolvableString\n\n  /**\n   * Type attribute for input or button elements.\n   * Options: 'button', 'submit', 'reset'. Default: 'submit'.\n   * Has no effect on anchor elements.\n   *\n   * @example 'button'\n   */\n  type?: 'button' | 'submit' | 'reset' | ResolvableString\n\n  /**\n   * Value attribute for button elements.\n   * Has no effect on anchor or input elements.\n   *\n   * @example 'archive'\n   */\n  value?: ResolvableString\n\n  /**\n   * Whether the button should be disabled.\n   *\n   * @example true\n   */\n  disabled?: ResolvableBoolean\n\n  /**\n   * URL that the button should link to.\n   * If set, `element` defaults to 'a'.\n   *\n   * @example '/actions/archive'\n   * @example '#archive'\n   */\n  href?: ResolvableString\n\n  /**\n   * Additional CSS classes for the button.\n   *\n   * @example 'govuk-button--warning'\n   */\n  classes?: ResolvableString\n\n  /**\n   * Additional HTML attributes for the button.\n   *\n   * @example { 'data-action': 'archive' }\n   */\n  attributes?: Record<string, ResolvableString>\n\n  /**\n   * Prevent accidental double clicks from submitting forms multiple times.\n   *\n   * @example true\n   */\n  preventDoubleClick?: ResolvableBoolean\n\n  /**\n   * Conditional visibility for this menu item.\n   * When the evaluated value is `false`, the item is omitted from rendering.\n   */\n  visibleWhen?: ResolvableBoolean\n}\n\n/**\n * MOJ Button Menu component.\n * A dropdown button that reveals a menu of actions.\n *\n * The button menu component is useful for grouping secondary actions together\n * to reduce visual clutter while keeping them easily accessible.\n *\n * @see https://design-patterns.service.justice.gov.uk/components/button-menu\n * @example\n * ```typescript\n * MOJButtonMenu({\n *   button: {\n *     text: 'Actions',\n *     classes: 'govuk-button--secondary',\n *   },\n *   alignMenu: 'right',\n *   items: [\n *     { text: 'Archive', href: '#archive' },\n *     { text: 'Reassign', href: '#reassign' },\n *     { text: 'Delete', href: '#delete', classes: 'govuk-button--warning' },\n *   ],\n * })\n * ```\n */\nexport interface MOJButtonMenu extends BlockDefinition {\n  /**\n   * Configuration for the toggle button.\n   * Sets the text and styling of the button that opens the menu.\n   *\n   * @example { text: 'Actions', classes: 'govuk-button--secondary' }\n   */\n  button?: MOJButtonMenuButton\n\n  /**\n   * Alignment of the dropdown menu relative to the toggle button.\n   * Options: 'left' (default), 'right'\n   *\n   * @example 'right'\n   */\n  alignMenu?: MOJButtonMenuAlign | ResolvableString\n\n  /**\n   * Array of menu item button configurations.\n   * Each item becomes a button/link in the dropdown menu.\n   *\n   * @example [{ text: 'Archive', href: '#archive' }]\n   */\n  items: ResolvableArray<MOJButtonMenuItem>\n\n  /**\n   * Additional CSS classes for the menu container.\n   *\n   * @example 'app-button-menu--custom'\n   */\n  classes?: ResolvableString\n\n  /**\n   * Additional HTML attributes for the menu container.\n   *\n   * @example { 'data-module': 'custom-menu' }\n   */\n  attributes?: Record<string, ResolvableString>\n}\n\n/**\n * MOJ Button Menu component.\n * A dropdown button that reveals a menu of actions.\n *\n * The button menu component is useful for grouping secondary actions together\n * to reduce visual clutter while keeping them easily accessible.\n *\n * @see https://design-patterns.service.justice.gov.uk/components/button-menu\n * @example\n * ```typescript\n * MOJButtonMenu({\n *   button: {\n *     text: 'Actions',\n *     classes: 'govuk-button--secondary',\n *   },\n *   alignMenu: 'right',\n *   items: [\n *     { text: 'Archive', href: '#archive' },\n *     { text: 'Reassign', href: '#reassign' },\n *     { text: 'Delete', href: '#delete', classes: 'govuk-button--warning' },\n *   ],\n * })\n * ```\n */\nexport const MOJButtonMenu = nunjucksComponent<MOJButtonMenu>('mojButtonMenu', {\n  render: (props, nunjucksEnv) => {\n    const params = {\n      button: props.button,\n      alignMenu: props.alignMenu,\n      items: props.items.filter(item => item.visibleWhen !== false),\n      classes: props.classes,\n      attributes: props.attributes,\n    }\n\n    return nunjucksEnv.render('moj/components/button-menu/template.njk', { params })\n  },\n})\n","import {\n  BlockDefinition,\n  ResolvableBoolean,\n  ResolvableObject,\n  ResolvableString,\n} from '@ministryofjustice/hmpps-forge/core/components'\nimport { nunjucksComponent } from '../../utils/nunjucksComponent'\n\n/**\n * Heading configuration for the MOJ Card component.\n */\nexport interface MOJCardHeading {\n  /** Heading text (required if html not set) */\n  text?: ResolvableString\n\n  /** Heading HTML content (required if text not set) */\n  html?: ResolvableString\n\n  /** Heading level 1-6 (default: 2) */\n  level?: 1 | 2 | 3 | 4 | 5 | 6\n\n  /** Additional classes for the heading element */\n  classes?: ResolvableString\n}\n\n/**\n * Description configuration for the MOJ Card component.\n */\nexport interface MOJCardDescription {\n  /** Description text (required if html not set) */\n  text?: ResolvableString\n\n  /** Description HTML content (required if text not set) */\n  html?: ResolvableString\n\n  /** Additional classes for the description element */\n  classes?: ResolvableString\n}\n\n/**\n * MOJ Card component.\n * A card component for displaying links on dashboards or home pages.\n *\n * @see https://design-patterns.service.justice.gov.uk/components/card/\n * @example\n * ```typescript\n * MOJCard({\n *   heading: 'Search cases',\n *   href: '/cases/search',\n *   description: 'Find and manage case records',\n * })\n * ```\n */\nexport interface MOJCard extends BlockDefinition {\n  /**\n   * Card heading - can be a simple string or object with additional options.\n   * @example 'Search cases'\n   * @example { text: 'Search cases', level: 3 }\n   */\n  heading: ResolvableString | ResolvableObject<MOJCardHeading>\n\n  /** Link URL for the card heading */\n  href: ResolvableString\n\n  /**\n   * Optional description - can be a simple string or object with additional options.\n   * @example 'Find and manage case records'\n   * @example { html: '<strong>Find</strong> records' }\n   */\n  description?: ResolvableString | ResolvableObject<MOJCardDescription>\n\n  /** Makes the entire card clickable via CSS (default: true) */\n  clickable?: ResolvableBoolean\n\n  /** Additional CSS classes for the card container */\n  classes?: ResolvableString\n\n  /** Additional HTML attributes */\n  attributes?: Record<string, string>\n}\n\n/**\n * MOJ Card component.\n * A card component for displaying links on dashboards or home pages.\n *\n * @see https://design-patterns.service.justice.gov.uk/components/card/\n * @example\n * ```typescript\n * MOJCard({\n *   heading: 'Search cases',\n *   href: '/cases/search',\n *   description: 'Find and manage case records',\n * })\n * ```\n */\nexport const MOJCard = nunjucksComponent<MOJCard>('mojCard', {\n  render: (props, nunjucksEnv) => {\n    const params = {\n      heading: typeof props.heading === 'object' ? props.heading : { text: props.heading },\n      href: props.href,\n      description: props.description\n        ? typeof props.description === 'object'\n          ? props.description\n          : { text: props.description }\n        : undefined,\n      clickable: props.clickable,\n      classes: props.classes,\n      attributes: props.attributes,\n    }\n\n    return nunjucksEnv.render('components/card/template.njk', { params })\n  },\n})\n","import {\n  BlockDefinition,\n  ResolvableArray,\n  ResolvableBoolean,\n  ResolvableObject,\n  ResolvableString,\n  EvaluatedBlock,\n} from '@ministryofjustice/hmpps-forge/core/components'\nimport { nunjucksComponent } from '../../utils/nunjucksComponent'\n\n/**\n * Heading configuration object for card items.\n */\nexport interface MOJCardGroupItemHeading {\n  /** Heading text (required if html not set) */\n  text?: ResolvableString\n\n  /** Heading HTML content (required if text not set) */\n  html?: ResolvableString\n\n  /** Heading level 1-6 (default: 2) */\n  level?: 1 | 2 | 3 | 4 | 5 | 6\n\n  /** Additional classes for the heading element */\n  classes?: ResolvableString\n}\n\n/**\n * Description configuration object for card items.\n */\nexport interface MOJCardGroupItemDescription {\n  /** Description text (required if html not set) */\n  text?: ResolvableString\n\n  /** Description HTML content (required if text not set) */\n  html?: ResolvableString\n\n  /** Additional classes for the description element */\n  classes?: ResolvableString\n}\n\n/**\n * Card item configuration for the MOJ Card Group component.\n * Heading and description can be simple strings or objects with additional options.\n */\nexport interface MOJCardGroupItem {\n  /**\n   * Card heading - can be a simple string or object with additional options.\n   * @example 'Search cases'\n   * @example { text: 'Search cases', level: 3 }\n   */\n  heading: ResolvableString | ResolvableObject<MOJCardGroupItemHeading>\n\n  /** Link URL for the card heading */\n  href: ResolvableString\n\n  /**\n   * Optional description - can be a simple string or object with additional options.\n   * @example 'Find and manage case records'\n   * @example { html: '<strong>Find</strong> records' }\n   */\n  description?: ResolvableString | ResolvableObject<MOJCardGroupItemDescription>\n\n  /** Makes the entire card clickable via CSS (default: true) */\n  clickable?: ResolvableBoolean\n\n  /** Additional CSS classes for the card container */\n  classes?: ResolvableString\n\n  /** Additional HTML attributes */\n  attributes?: Record<string, string>\n\n  /**\n   * Conditional visibility for this card. When the evaluated value is `false`,\n   * the card is omitted from rendering. Defaults to showing the card.\n   */\n  visibleWhen?: ResolvableBoolean\n}\n\n/**\n * MOJ Card Group component.\n * A component for displaying multiple cards in a responsive grid layout.\n *\n * @see https://design-patterns.service.justice.gov.uk/components/card/\n * @example\n * ```typescript\n * MOJCardGroup({\n *   items: [\n *     { heading: 'Search', href: '/search', description: 'Find records' },\n *     { heading: 'Reports', href: '/reports', description: 'View reports' },\n *   ],\n *   columns: 2,\n * })\n * ```\n */\nexport interface MOJCardGroup extends BlockDefinition {\n  /** Array of cards to display */\n  items: ResolvableArray<MOJCardGroupItem>\n\n  /** Number of columns: 2, 3, or 4 (default: 3) */\n  columns?: 2 | 3 | 4\n\n  /** Additional CSS classes for the card group container */\n  classes?: ResolvableString\n\n  /** Additional HTML attributes */\n  attributes?: Record<string, string>\n}\n\ntype EvaluatedMOJCardGroupItem = EvaluatedBlock<MOJCardGroup>['items'][number]\n\ntype NormalizedCardItem = {\n  heading: EvaluatedBlock<MOJCardGroupItemHeading>\n  href: string\n  description: EvaluatedBlock<MOJCardGroupItemDescription> | undefined\n  clickable: boolean | undefined\n  classes: string | undefined\n  attributes: Record<string, string> | undefined\n}\n\n/**\n * Normalizes a card item's heading and description to object form\n */\nfunction normalizeCardItem(item: EvaluatedMOJCardGroupItem): NormalizedCardItem {\n  const heading = typeof item.heading === 'object' ? normalizeHeading(item.heading) : { text: item.heading }\n\n  return {\n    heading,\n    href: item.href,\n    description: item.description\n      ? typeof item.description === 'object'\n        ? item.description\n        : { text: item.description }\n      : undefined,\n    clickable: item.clickable,\n    classes: item.classes,\n    attributes: item.attributes,\n  }\n}\n\nfunction normalizeHeading(heading: EvaluatedMOJCardGroupItem['heading']): EvaluatedBlock<MOJCardGroupItemHeading> {\n  if (typeof heading === 'string') {\n    return { text: heading }\n  }\n\n  return {\n    text: heading.text,\n    html: heading.html,\n    classes: heading.classes,\n    level: isHeadingLevel(heading.level) ? heading.level : undefined,\n  }\n}\n\nfunction isHeadingLevel(value: number | undefined): value is NonNullable<MOJCardGroupItemHeading['level']> {\n  return value === 1 || value === 2 || value === 3 || value === 4 || value === 5 || value === 6\n}\n\n/**\n * MOJ Card Group component.\n * A component for displaying multiple cards in a responsive grid layout.\n *\n * @see https://design-patterns.service.justice.gov.uk/components/card/\n * @example\n * ```typescript\n * MOJCardGroup({\n *   items: [\n *     { heading: 'Search', href: '/search', description: 'Find records' },\n *     { heading: 'Reports', href: '/reports', description: 'View reports' },\n *   ],\n *   columns: 2,\n * })\n * ```\n */\nexport const MOJCardGroup = nunjucksComponent<MOJCardGroup>('mojCardGroup', {\n  render: (props, nunjucksEnv) => {\n    const params = {\n      items: props.items.filter(item => item.visibleWhen !== false).map(normalizeCardItem),\n      columns: props.columns,\n      classes: props.classes,\n      attributes: props.attributes,\n    }\n\n    return nunjucksEnv.render('components/card-group/template.njk', { params })\n  },\n})\n","import { z } from 'zod'\nimport {\n  FieldBlockDefinition,\n  ResolvableString,\n  ResolvableBoolean,\n  ResolvableObject,\n} from '@ministryofjustice/hmpps-forge/core/components'\nimport { nunjucksComponent } from '../../utils/nunjucksComponent'\n\n/**\n * Label configuration for the MOJ Date Picker component.\n */\nexport interface MOJDatePickerLabel {\n  /** Label text (required if html not set) */\n  text?: ResolvableString\n\n  /** Label HTML content (required if text not set) */\n  html?: ResolvableString\n\n  /** Additional classes for the label element */\n  classes?: ResolvableString\n\n  /** Whether the label should be visually hidden */\n  isPageHeading?: ResolvableBoolean\n\n  /** HTML attributes for the label */\n  attributes?: Record<string, string>\n}\n\n/**\n * Hint configuration for the MOJ Date Picker component.\n */\nexport interface MOJDatePickerHint {\n  /** Hint text (required if html not set) */\n  text?: ResolvableString\n\n  /** Hint HTML content (required if text not set) */\n  html?: ResolvableString\n\n  /** Additional classes for the hint element */\n  classes?: ResolvableString\n\n  /** HTML attributes for the hint */\n  attributes?: Record<string, string>\n}\n\n/**\n * Form group configuration for the MOJ Date Picker component.\n */\nexport interface MOJDatePickerFormGroup {\n  /** Additional classes for the form group */\n  classes?: ResolvableString\n\n  /** HTML attributes for the form group */\n  attributes?: Record<string, string>\n}\n\n/**\n * MOJ Date Picker component.\n * A date input component with calendar widget following the MOJ Design Patterns.\n *\n * The date picker allows users to select a date via calendar or direct text entry.\n * It enhances a standard text input with a calendar button that opens a date picker.\n * Date format is dd/mm/yyyy.\n *\n * @see https://design-patterns.service.justice.gov.uk/components/date-picker/\n * @example\n * ```typescript\n * MOJDatePicker({\n *   code: 'appointment_date',\n *   label: 'Appointment date',\n *   hint: 'For example, 17/5/2024',\n *   minDate: '01/04/2025',\n *   maxDate: '30/04/2025',\n * })\n * ```\n */\nexport interface MOJDatePicker extends FieldBlockDefinition {\n  /**\n   * The ID of the input. Defaults to the value of `code` if not provided.\n   * @example 'appointment-date'\n   */\n  id?: ResolvableString\n\n  /**\n   * Label for the date picker - can be a simple string or object with additional options.\n   * @example 'Select a date'\n   * @example { text: 'Select a date', classes: 'govuk-label--l' }\n   */\n  label: ResolvableString | ResolvableObject<MOJDatePickerLabel>\n\n  /**\n   * Optional hint text - can be a simple string or object with additional options.\n   * @example 'For example, 17/5/2024'\n   * @example { html: 'Enter the date in <strong>dd/mm/yyyy</strong> format' }\n   */\n  hint?: ResolvableString | ResolvableObject<MOJDatePickerHint>\n\n  /**\n   * Earliest date that can be selected (format: dd/mm/yyyy).\n   * Users can still type dates before this, so server-side validation is required.\n   * @example '01/04/2025'\n   */\n  minDate?: ResolvableString\n\n  /**\n   * Latest date that can be selected (format: dd/mm/yyyy).\n   * Users can still type dates after this, so server-side validation is required.\n   * @example '30/04/2025'\n   */\n  maxDate?: ResolvableString\n\n  /**\n   * Array of dates that cannot be selected (format: dd/mm/yyyy).\n   * Users can still type these dates, so server-side validation is required.\n   * @example ['02/04/2025', '18/04/2025']\n   */\n  excludedDates?: string[]\n\n  /**\n   * Array of days of the week that cannot be selected.\n   * Users can still type these days, so server-side validation is required.\n   * @example ['saturday', 'sunday']\n   */\n  excludedDays?: ('monday' | 'tuesday' | 'wednesday' | 'thursday' | 'friday' | 'saturday' | 'sunday')[]\n\n  /**\n   * Which day the calendar week starts on.\n   * @default 'monday'\n   */\n  weekStartDay?: 'monday' | 'sunday'\n\n  /** Form group configuration */\n  formGroup?: MOJDatePickerFormGroup\n\n  /** Additional CSS classes for the date picker container */\n  classes?: ResolvableString\n\n  /** Additional HTML attributes */\n  attributes?: Record<string, string>\n}\n\n/**\n * Converts an ISO date string (YYYY-MM-DD) to UK format (DD/MM/YYYY).\n * If the value is already in UK format or not a valid date string, returns as-is.\n */\nfunction toUKDateFormat(value: unknown): string | undefined {\n  if (typeof value !== 'string' || !value) {\n    return undefined\n  }\n\n  // Check if it's ISO format (YYYY-MM-DD)\n  const isoMatch = value.match(/^(\\d{4})-(\\d{2})-(\\d{2})$/)\n\n  if (isoMatch) {\n    const [, year, month, day] = isoMatch\n    return `${day}/${month}/${year}`\n  }\n\n  // Already UK format or other string - return as-is\n  return value\n}\n\n/**\n * MOJ Date Picker component.\n * A date input component with calendar widget following the MOJ Design Patterns.\n *\n * The date picker allows users to select a date via calendar or direct text entry.\n * It enhances a standard text input with a calendar button that opens a date picker.\n * Date format is dd/mm/yyyy.\n *\n * @see https://design-patterns.service.justice.gov.uk/components/date-picker/\n * @example\n * ```typescript\n * MOJDatePicker({\n *   code: 'appointment_date',\n *   label: 'Appointment date',\n *   hint: 'For example, 17/5/2024',\n *   minDate: '01/04/2025',\n *   maxDate: '30/04/2025',\n * })\n * ```\n */\nexport const MOJDatePicker = nunjucksComponent<MOJDatePicker>('mojDatePicker', {\n  field: true,\n  inputSchema: z.string(),\n  // The rendered input's id matches the render params below, so error summary links land on it.\n  errorAnchor: props => props.id ?? props.code,\n  render: (props, nunjucksEnv) => {\n    const params = {\n      id: props.id ?? props.code,\n      name: props.code,\n      value: toUKDateFormat(props.value),\n      label: typeof props.label === 'object' ? props.label : { text: props.label },\n      hint: props.hint ? (typeof props.hint === 'object' ? props.hint : { text: props.hint }) : undefined,\n      errorMessage: props.errors?.length ? { text: props.errors[0].message } : undefined,\n      minDate: props.minDate,\n      maxDate: props.maxDate,\n      excludedDates: props.excludedDates?.join(' '),\n      excludedDays: props.excludedDays?.join(' '),\n      weekStartDay: props.weekStartDay,\n      formGroup: props.formGroup,\n      classes: props.classes,\n      attributes: props.attributes,\n    }\n\n    return nunjucksEnv.render('moj/components/date-picker/template.njk', { params })\n  },\n})\n","import {\n  BlockDefinition,\n  ResolvableString,\n  ResolvableBoolean,\n  ResolvableArray,\n} from '@ministryofjustice/hmpps-forge/core/components'\nimport { nunjucksComponent } from '../../utils/nunjucksComponent'\n\n/**\n * Heading configuration for the filter component.\n */\nexport interface MOJFilterHeading {\n  /** Heading text (required if html not set) */\n  text?: ResolvableString\n\n  /** Heading HTML content (required if text not set) */\n  html?: ResolvableString\n}\n\n/**\n * Clear link configuration for selected filters.\n */\nexport interface MOJFilterClearLink {\n  /** URL for the clear all filters link */\n  href: ResolvableString\n\n  /** Text for the clear link (e.g. \"Clear filters\") */\n  text: ResolvableString\n}\n\n/**\n * Individual selected filter tag item.\n */\nexport interface MOJFilterTagItem {\n  /** URL to remove this filter */\n  href: ResolvableString\n\n  /** Display text for the filter tag */\n  text: ResolvableString\n\n  /** Conditional visibility for this filter tag */\n  visibleWhen?: ResolvableBoolean\n}\n\n/**\n * Category of selected filters with heading and removable tags.\n */\nexport interface MOJFilterCategory {\n  /** Heading for this category of filters */\n  heading: MOJFilterHeading\n\n  /** Array of filter tag items in this category */\n  items: ResolvableArray<MOJFilterTagItem>\n\n  /** Conditional visibility for this filter category */\n  visibleWhen?: ResolvableBoolean\n}\n\n/**\n * Selected filters configuration showing active filter tags.\n */\nexport interface MOJFilterSelectedFilters {\n  /** Heading for the selected filters section */\n  heading: MOJFilterHeading\n\n  /** Link to clear all selected filters */\n  clearLink: MOJFilterClearLink\n\n  /** Categories of selected filter tags */\n  categories: ResolvableArray<MOJFilterCategory>\n}\n\n/**\n * Submit button configuration for applying filters.\n */\nexport interface MOJFilterSubmit {\n  /** Button text (default: \"Apply filters\") */\n  text?: ResolvableString\n\n  /** Additional HTML attributes for the submit button */\n  attributes?: Record<string, string>\n}\n\n/**\n * MOJ Filter component.\n *\n * The filter component displays a panel with filter controls.\n * It can show currently selected filters as removable tags and\n * provides an area for form controls to define filter criteria.\n *\n * @see https://design-patterns.service.justice.gov.uk/components/filter\n * @example\n * ```typescript\n * MOJFilter({\n *   heading: { text: 'Filter' },\n *   submit: { text: 'Apply filters' },\n *   optionsHtml: '<div class=\"govuk-form-group\">...filter controls...</div>',\n * })\n * ```\n * @example\n * ```typescript\n * MOJFilter({\n *   heading: { text: 'Filter' },\n *   submit: { text: 'Apply filters' },\n *   optionsHtml: '<div class=\"govuk-form-group\">...filter controls...</div>',\n *   selectedFilters: {\n *     heading: { text: 'Selected filters' },\n *     clearLink: { href: '/clear', text: 'Clear filters' },\n *     categories: [\n *       {\n *         heading: { text: 'Status' },\n *         items: [\n *           { text: 'Active', href: '/remove-active' },\n *           { text: 'Pending', href: '/remove-pending' },\n *         ],\n *       },\n *     ],\n *   },\n * })\n * ```\n */\nexport interface MOJFilter extends BlockDefinition {\n  /**\n   * Heading for the filter panel.\n   * @example { text: 'Filter' }\n   * @example { html: '<span>Filter</span>' }\n   */\n  heading: MOJFilterHeading\n\n  /**\n   * Configuration for displaying selected filter tags.\n   * Shows active filters that can be individually removed.\n   * @example { heading: { text: 'Selected' }, clearLink: { href: '/clear', text: 'Clear' }, categories: [] }\n   */\n  selectedFilters?: MOJFilterSelectedFilters\n\n  /**\n   * Submit button configuration for applying filters.\n   * @example { text: 'Apply filters' }\n   * @example { text: 'Search', attributes: { 'data-tracking': 'filter-submit' } }\n   */\n  submit?: MOJFilterSubmit\n\n  /**\n   * HTML content for the filter options/form controls.\n   * This should contain the form fields for filtering.\n   * @example '<div class=\"govuk-form-group\"><label>...</label><input>...</div>'\n   */\n  optionsHtml?: ResolvableString\n\n  /**\n   * Additional CSS classes for the filter container.\n   * @example 'app-filter--custom'\n   */\n  classes?: ResolvableString\n\n  /**\n   * Additional HTML attributes for the filter container.\n   * @example { 'data-module': 'app-filter' }\n   */\n  attributes?: Record<string, string>\n}\n\n/**\n * MOJ Filter component.\n *\n * The filter component displays a panel with filter controls.\n * It can show currently selected filters as removable tags and\n * provides an area for form controls to define filter criteria.\n *\n * @see https://design-patterns.service.justice.gov.uk/components/filter\n * @example\n * ```typescript\n * MOJFilter({\n *   heading: { text: 'Filter' },\n *   submit: { text: 'Apply filters' },\n *   optionsHtml: '<div class=\"govuk-form-group\">...filter controls...</div>',\n * })\n * ```\n * @example\n * ```typescript\n * MOJFilter({\n *   heading: { text: 'Filter' },\n *   submit: { text: 'Apply filters' },\n *   optionsHtml: '<div class=\"govuk-form-group\">...filter controls...</div>',\n *   selectedFilters: {\n *     heading: { text: 'Selected filters' },\n *     clearLink: { href: '/clear', text: 'Clear filters' },\n *     categories: [\n *       {\n *         heading: { text: 'Status' },\n *         items: [\n *           { text: 'Active', href: '/remove-active' },\n *           { text: 'Pending', href: '/remove-pending' },\n *         ],\n *       },\n *     ],\n *   },\n * })\n * ```\n */\nexport const MOJFilter = nunjucksComponent<MOJFilter>('mojFilter', {\n  render: (props, nunjucksEnv) => {\n    const selectedFilters = props.selectedFilters\n      ? {\n          ...props.selectedFilters,\n          categories: props.selectedFilters.categories\n            .filter(category => category.visibleWhen !== false)\n            .map(category => ({\n              ...category,\n              items: category.items.filter(item => item.visibleWhen !== false),\n            })),\n        }\n      : undefined\n\n    const params = {\n      heading: props.heading,\n      selectedFilters,\n      submit: props.submit,\n      optionsHtml: props.optionsHtml,\n      classes: props.classes,\n      attributes: props.attributes,\n    }\n\n    return nunjucksEnv.render('moj/components/filter/template.njk', { params })\n  },\n})\n","import {\n  BlockDefinition,\n  ResolvableArray,\n  ResolvableString,\n  ResolvableBoolean,\n  ResolvableObject,\n} from '@ministryofjustice/hmpps-forge/core/components'\nimport { nunjucksComponent } from '../../utils/nunjucksComponent'\n\n/**\n * Label configuration for a progress bar item.\n */\nexport interface MOJProgressBarItemLabel {\n  /** Label text (required if html not set) */\n  text?: ResolvableString\n\n  /** Label HTML content (required if text not set) */\n  html?: ResolvableString\n\n  /** Additional CSS classes for the label element */\n  classes?: ResolvableString\n}\n\n/**\n * Configuration for an individual progress bar item.\n */\nexport interface MOJProgressBarItem {\n  /**\n   * Unique identifier for the item.\n   * Defaults to \"progress-item-{index}\" if not provided.\n   *\n   * @example 'step-1'\n   */\n  id?: ResolvableString\n\n  /**\n   * Label for the progress item - can be a simple string or object with additional options.\n   *\n   * @example 'Personal details'\n   * @example { text: 'Personal details', classes: 'custom-label' }\n   */\n  label: ResolvableString | ResolvableObject<MOJProgressBarItemLabel>\n\n  /**\n   * Whether this item represents the current/active step.\n   * Sets `aria-current=\"step\"` for accessibility.\n   *\n   * @example true // Current step\n   */\n  active?: ResolvableBoolean\n\n  /**\n   * Whether this step has been completed.\n   * Displays a completed icon indicator.\n   *\n   * @example true // Step is complete\n   */\n  complete?: ResolvableBoolean\n\n  /** Additional CSS classes for the item element */\n  classes?: ResolvableString\n\n  /** Additional HTML attributes for the item element */\n  attributes?: Record<string, ResolvableString>\n\n  /** Conditional visibility for this progress item */\n  visibleWhen?: ResolvableBoolean\n}\n\n/**\n * MOJ Progress Bar component.\n *\n * The progress bar component shows users where they are in a linear process\n * with multiple steps. It displays completed steps, the current step, and\n * upcoming steps.\n *\n * @see https://design-patterns.service.justice.gov.uk/components/progress-bar\n * @example\n * ```typescript\n * MOJProgressBar({\n *   label: 'Application progress',\n *   items: [\n *     { label: 'Personal details', complete: true },\n *     { label: 'Contact information', active: true },\n *     { label: 'Review and submit' },\n *   ],\n * })\n * ```\n */\nexport interface MOJProgressBar extends BlockDefinition {\n  /**\n   * Unique identifier for the progress bar.\n   * Defaults to \"progress\" if not provided.\n   *\n   * @example 'application-progress'\n   */\n  id?: ResolvableString\n\n  /**\n   * Accessible label for the progress bar (aria-label).\n   * Describes the purpose of the progress indicator.\n   *\n   * @example 'Application progress'\n   * @example 'Registration steps'\n   */\n  label?: ResolvableString\n\n  /**\n   * Array of progress items representing each step in the journey.\n   * Items should be ordered from first to last step.\n   *\n   * @example\n   * ```typescript\n   * [\n   *   { label: 'Personal details', complete: true },\n   *   { label: 'Contact information', active: true },\n   *   { label: 'Review and submit' },\n   * ]\n   * ```\n   */\n  items: ResolvableArray<MOJProgressBarItem>\n\n  /**\n   * Additional CSS classes for the progress bar container.\n   *\n   * @example 'app-progress-bar--custom'\n   */\n  classes?: ResolvableString\n\n  /**\n   * Additional HTML attributes for the progress bar container.\n   *\n   * @example { 'data-module': 'progress-tracker' }\n   */\n  attributes?: Record<string, ResolvableString>\n}\n\n/**\n * MOJ Progress Bar component.\n *\n * The progress bar component shows users where they are in a linear process\n * with multiple steps. It displays completed steps, the current step, and\n * upcoming steps.\n *\n * @see https://design-patterns.service.justice.gov.uk/components/progress-bar\n * @example\n * ```typescript\n * MOJProgressBar({\n *   label: 'Application progress',\n *   items: [\n *     { label: 'Personal details', complete: true },\n *     { label: 'Contact information', active: true },\n *     { label: 'Review and submit' },\n *   ],\n * })\n * ```\n */\nexport const MOJProgressBar = nunjucksComponent<MOJProgressBar>('mojProgressBar', {\n  render: (props, nunjucksEnv) => {\n    const params = {\n      id: props.id,\n      label: props.label,\n      items: props.items\n        .filter(item => item.visibleWhen !== false)\n        .map(item => ({\n          id: item.id,\n          label: typeof item.label === 'object' ? item.label : { text: item.label },\n          active: item.active,\n          complete: item.complete,\n          classes: item.classes,\n          attributes: item.attributes,\n        })),\n      classes: props.classes,\n      attributes: props.attributes,\n    }\n\n    return nunjucksEnv.render('moj/components/progress-bar/template.njk', { params })\n  },\n})\n","import {\n  BlockDefinition,\n  ResolvableString,\n  ResolvableBoolean,\n  ResolvableArray,\n} from '@ministryofjustice/hmpps-forge/core/components'\nimport { nunjucksComponent } from '../../utils/nunjucksComponent'\n\n/**\n * Heading configuration for a side navigation section.\n */\nexport interface MOJSideNavigationHeading {\n  /** Heading level 1-6 (default: 4) */\n  headingLevel?: 1 | 2 | 3 | 4 | 5 | 6\n\n  /** Heading text (required if html not set) */\n  text?: ResolvableString\n\n  /** Heading HTML content (required if text not set) */\n  html?: ResolvableString\n\n  /** Additional classes for the heading element */\n  classes?: ResolvableString\n\n  /** Additional HTML attributes for the heading */\n  attributes?: Record<string, string>\n}\n\n/**\n * Navigation item configuration.\n */\nexport interface MOJSideNavigationItem {\n  /** URL of the navigation item anchor */\n  href: ResolvableString\n\n  /** Item text (required if html not set) */\n  text?: ResolvableString\n\n  /** Item HTML content (required if text not set) */\n  html?: ResolvableString\n\n  /** Flag to mark the navigation item as active */\n  active?: ResolvableBoolean\n\n  /** Conditional visibility for this navigation item */\n  visibleWhen?: ResolvableBoolean\n\n  /** Additional HTML attributes for the item */\n  attributes?: Record<string, string>\n}\n\n/**\n * Section configuration for grouped navigation items.\n */\nexport interface MOJSideNavigationSection {\n  /** Section heading configuration */\n  heading?: MOJSideNavigationHeading\n\n  /** Array of navigation items in this section */\n  items: ResolvableArray<MOJSideNavigationItem>\n\n  /** Conditional visibility for this navigation section */\n  visibleWhen?: ResolvableBoolean\n}\n\n/**\n * MOJ Side Navigation component.\n * A vertical navigation menu component following the MOJ Design Patterns.\n *\n * It can be used in simple mode with just items, or in sectioned mode\n * with grouped items under headings.\n *\n * @see https://design-patterns.service.justice.gov.uk/components/side-navigation\n * @example\n * ```typescript\n * // Simple form - flat list of items\n * MOJSideNavigation({\n *   label: 'Side navigation',\n *   items: [\n *     { text: 'Nav item 1', href: '#1', active: true },\n *     { text: 'Nav item 2', href: '#2' },\n *     { text: 'Nav item 3', href: '#3' },\n *   ],\n * })\n *\n * // Sectioned form - items grouped under headings\n * MOJSideNavigation({\n *   label: 'Side navigation',\n *   sections: [\n *     {\n *       heading: { text: 'Section 1' },\n *       items: [\n *         { text: 'Item 1.1', href: '#1-1', active: true },\n *         { text: 'Item 1.2', href: '#1-2' },\n *       ],\n *     },\n *     {\n *       heading: { text: 'Section 2', headingLevel: 3 },\n *       items: [\n *         { text: 'Item 2.1', href: '#2-1' },\n *       ],\n *     },\n *   ],\n * })\n * ```\n */\nexport interface MOJSideNavigation extends BlockDefinition {\n  /**\n   * The aria-label to add to the navigation container.\n   * @example 'Side navigation'\n   */\n  label?: ResolvableString\n\n  /**\n   * Array of navigation items (simple mode - use instead of sections).\n   * @example [{ text: 'Nav item 1', href: '#1', active: true }]\n   */\n  items?: ResolvableArray<MOJSideNavigationItem>\n\n  /**\n   * Array of navigation sections (sectioned mode - use instead of items).\n   * @example [{ heading: { text: 'Section 1' }, items: [...] }]\n   */\n  sections?: ResolvableArray<MOJSideNavigationSection>\n\n  /**\n   * Additional CSS classes for the nav container.\n   * @example 'app-side-navigation--custom'\n   */\n  classes?: ResolvableString\n\n  /**\n   * Additional HTML attributes for the navigation container.\n   * @example { 'data-module': 'app-navigation' }\n   */\n  attributes?: Record<string, string>\n}\n\n/**\n * MOJ Side Navigation component.\n * A vertical navigation menu component following the MOJ Design Patterns.\n *\n * It can be used in simple mode with just items, or in sectioned mode\n * with grouped items under headings.\n *\n * @see https://design-patterns.service.justice.gov.uk/components/side-navigation\n * @example\n * ```typescript\n * // Simple form - flat list of items\n * MOJSideNavigation({\n *   label: 'Side navigation',\n *   items: [\n *     { text: 'Nav item 1', href: '#1', active: true },\n *     { text: 'Nav item 2', href: '#2' },\n *     { text: 'Nav item 3', href: '#3' },\n *   ],\n * })\n *\n * // Sectioned form - items grouped under headings\n * MOJSideNavigation({\n *   label: 'Side navigation',\n *   sections: [\n *     {\n *       heading: { text: 'Section 1' },\n *       items: [\n *         { text: 'Item 1.1', href: '#1-1', active: true },\n *         { text: 'Item 1.2', href: '#1-2' },\n *       ],\n *     },\n *     {\n *       heading: { text: 'Section 2', headingLevel: 3 },\n *       items: [\n *         { text: 'Item 2.1', href: '#2-1' },\n *       ],\n *     },\n *   ],\n * })\n * ```\n */\nexport const MOJSideNavigation = nunjucksComponent<MOJSideNavigation>('mojSideNavigation', {\n  render: (props, nunjucksEnv) => {\n    const items = props.items?.filter(item => item.visibleWhen !== false)\n    const sections = props.sections\n      ?.filter(section => section.visibleWhen !== false)\n      .map(section => ({\n        ...section,\n        items: section.items.filter(item => item.visibleWhen !== false),\n      }))\n\n    const params = {\n      label: props.label,\n      items,\n      sections,\n      classes: props.classes,\n      attributes: props.attributes,\n    }\n\n    return nunjucksEnv.render('moj/components/side-navigation/template.njk', { params })\n  },\n})\n","import {\n  BlockDefinition,\n  ResolvableString,\n  ResolvableBoolean,\n  ResolvableArray,\n} from '@ministryofjustice/hmpps-forge/core/components'\nimport { nunjucksComponent } from '../../utils/nunjucksComponent'\n\n/**\n * Navigation item configuration.\n */\nexport interface MOJSubNavigationItem {\n  /** URL of the navigation item anchor */\n  href: ResolvableString\n\n  /** Item text (required if html not set) */\n  text?: ResolvableString\n\n  /** Item HTML content (required if text not set) */\n  html?: ResolvableString\n\n  /** Flag to mark the navigation item as active (aria-current=\"page\") */\n  active?: ResolvableBoolean\n\n  /** Conditional visibility for this navigation item */\n  visibleWhen?: ResolvableBoolean\n\n  /** Additional HTML attributes for the item */\n  attributes?: Record<string, string>\n}\n\n/**\n * MOJ Sub-Navigation component.\n * Enables users to navigate secondary sections within a system or service.\n *\n * Use this component for secondary-level navigation, not for primary or global\n * navigation elements.\n *\n * @see https://design-patterns.service.justice.gov.uk/components/sub-navigation/\n * @example\n * ```typescript\n * MOJSubNavigation({\n *   label: 'Case sections',\n *   items: [\n *     { text: 'Overview', href: '/case/123/overview', active: true },\n *     { text: 'Documents', href: '/case/123/documents' },\n *     { text: 'Timeline', href: '/case/123/timeline' },\n *   ],\n * })\n * ```\n */\nexport interface MOJSubNavigation extends BlockDefinition {\n  /** The aria-label to add to the navigation container (defaults to \"Secondary navigation region\") */\n  label?: ResolvableString\n\n  /** Array of navigation items */\n  items: ResolvableArray<MOJSubNavigationItem>\n\n  /** Additional CSS classes for the nav container */\n  classes?: ResolvableString\n\n  /** Additional HTML attributes */\n  attributes?: Record<string, string>\n}\n\n/**\n * MOJ Sub-Navigation component.\n * Enables users to navigate secondary sections within a system or service.\n *\n * Use this component for secondary-level navigation, not for primary or global\n * navigation elements.\n *\n * @see https://design-patterns.service.justice.gov.uk/components/sub-navigation/\n * @example\n * ```typescript\n * MOJSubNavigation({\n *   label: 'Case sections',\n *   items: [\n *     { text: 'Overview', href: '/case/123/overview', active: true },\n *     { text: 'Documents', href: '/case/123/documents' },\n *     { text: 'Timeline', href: '/case/123/timeline' },\n *   ],\n * })\n * ```\n */\nexport const MOJSubNavigation = nunjucksComponent<MOJSubNavigation>('mojSubNavigation', {\n  render: (props, nunjucksEnv) => {\n    const params = {\n      label: props.label,\n      items: props.items.filter(item => item.visibleWhen !== false),\n      classes: props.classes,\n      attributes: props.attributes,\n    }\n\n    return nunjucksEnv.render('moj/components/sub-navigation/template.njk', { params })\n  },\n})\n","import {\n  BlockDefinition,\n  ResolvableArray,\n  ResolvableBoolean,\n  ResolvableString,\n  EvaluatedBlock,\n} from '@ministryofjustice/hmpps-forge/core/components'\nimport { nunjucksComponent } from '../../utils/nunjucksComponent'\nimport { normaliseMojTextHtmlContent } from '../../utils/mojParamNormalisers'\n\n/**\n * Color variants available for ticket panel sections.\n */\nexport type MOJTicketPanelColor = 'blue' | 'red' | 'yellow' | 'green' | 'purple' | 'orange'\n\n/**\n * An item (section) within the ticket panel.\n */\nexport interface MOJTicketPanelItem {\n  /**\n   * Plain text content for the section.\n   * Use either text or html, not both.\n   *\n   * @example 'Reference: ABC123'\n   */\n  text?: ResolvableString\n\n  /**\n   * HTML content for the section.\n   * Use either text or html, not both.\n   *\n   * @example '<h2 class=\"govuk-heading-m\">Application details</h2><p>Reference: ABC123</p>'\n   */\n  html?: ResolvableString\n\n  /**\n   * Child blocks to render in the section.\n   * Takes precedence over text/html.\n   */\n  blocks?: BlockDefinition[]\n\n  /**\n   * Additional CSS classes for the section.\n   * Use color classes to style sections: moj-ticket-panel__content--blue, etc.\n   *\n   * @example 'moj-ticket-panel__content--blue'\n   */\n  classes?: ResolvableString\n\n  /**\n   * Additional HTML attributes for the section.\n   *\n   * @example { 'aria-label': 'Application summary' }\n   */\n  attributes?: Record<string, ResolvableString>\n\n  /** Conditional visibility for this ticket panel item */\n  visibleWhen?: ResolvableBoolean\n}\n\n/**\n * MOJ Ticket Panel component.\n * Displays summary information in a styled panel format.\n *\n * The panel is typically split into sections for different data. Each section can be\n * colored differently using modifier classes to distinguish between types of information.\n *\n * Available color classes for items:\n * - moj-ticket-panel__content--blue\n * - moj-ticket-panel__content--red\n * - moj-ticket-panel__content--yellow\n * - moj-ticket-panel__content--green\n * - moj-ticket-panel__content--purple\n * - moj-ticket-panel__content--orange\n *\n * @see https://design-patterns.service.justice.gov.uk/components/ticket-panel\n * @example\n * ```typescript\n * MOJTicketPanel({\n *   attributes: { 'aria-label': 'Application summary' },\n *   items: [\n *     {\n *       html: '<h2 class=\"govuk-heading-m govuk-!-margin-bottom-2\">Application submitted</h2>' +\n *             '<p class=\"govuk-body\">Your reference number is <strong>ABC123</strong></p>',\n *       classes: 'moj-ticket-panel__content--green',\n *     },\n *     {\n *       text: 'We will email you within 24 hours to confirm your application.',\n *     },\n *   ],\n * })\n * ```\n */\nexport interface MOJTicketPanel extends BlockDefinition {\n  /**\n   * Array of sections to display in the ticket panel.\n   * Each item represents a content section with optional styling.\n   *\n   * @example\n   * [\n   *   { html: '<h2>Details</h2><p>Content here</p>', classes: 'moj-ticket-panel__content--blue' },\n   *   { text: 'Additional information' }\n   * ]\n   */\n  items: ResolvableArray<MOJTicketPanelItem>\n\n  /**\n   * Additional CSS classes for the ticket panel container.\n   *\n   * @example 'app-ticket-panel--custom'\n   */\n  classes?: ResolvableString\n\n  /**\n   * Additional HTML attributes for the ticket panel container.\n   *\n   * @example { 'aria-label': 'Application summary' }\n   */\n  attributes?: Record<string, ResolvableString>\n}\n\ntype EvaluatedMOJTicketPanelItem = EvaluatedBlock<MOJTicketPanel>['items'][number]\n\nfunction normaliseTicketPanelItem(item: EvaluatedMOJTicketPanelItem) {\n  const { blocks, ...itemParams } = item\n  const content = normaliseMojTextHtmlContent({\n    text: item.text,\n    html: item.html,\n    blocks,\n  })\n\n  return {\n    ...itemParams,\n    ...content,\n  }\n}\n\n/**\n * MOJ Ticket Panel component.\n * Displays summary information in a styled panel format.\n *\n * The panel is typically split into sections for different data. Each section can be\n * colored differently using modifier classes to distinguish between types of information.\n *\n * Available color classes for items:\n * - moj-ticket-panel__content--blue\n * - moj-ticket-panel__content--red\n * - moj-ticket-panel__content--yellow\n * - moj-ticket-panel__content--green\n * - moj-ticket-panel__content--purple\n * - moj-ticket-panel__content--orange\n *\n * @see https://design-patterns.service.justice.gov.uk/components/ticket-panel\n * @example\n * ```typescript\n * MOJTicketPanel({\n *   attributes: { 'aria-label': 'Application summary' },\n *   items: [\n *     {\n *       html: '<h2 class=\"govuk-heading-m govuk-!-margin-bottom-2\">Application submitted</h2>' +\n *             '<p class=\"govuk-body\">Your reference number is <strong>ABC123</strong></p>',\n *       classes: 'moj-ticket-panel__content--green',\n *     },\n *     {\n *       text: 'We will email you within 24 hours to confirm your application.',\n *     },\n *   ],\n * })\n * ```\n */\nexport const MOJTicketPanel = nunjucksComponent<MOJTicketPanel>('mojTicketPanel', {\n  render: (props, nunjucksEnv) => {\n    const params = {\n      items: props.items.filter(item => item.visibleWhen !== false).map(normaliseTicketPanelItem),\n      classes: props.classes,\n      attributes: props.attributes,\n    }\n\n    return nunjucksEnv.render('moj/components/ticket-panel/template.njk', { params })\n  },\n})\n","import {\n  BlockDefinition,\n  ResolvableBoolean,\n  ResolvableString,\n  ResolvableArray,\n  EvaluatedBlock,\n} from '@ministryofjustice/hmpps-forge/core/components'\nimport { nunjucksComponent } from '../../utils/nunjucksComponent'\nimport { normaliseMojTextHtmlContent } from '../../utils/mojParamNormalisers'\n\n/**\n * Label configuration for a timeline item.\n * Displayed as the title/heading of the timeline event.\n */\nexport interface MOJTimelineItemLabel {\n  /** Label text (required if html not set) */\n  text?: ResolvableString\n\n  /** Label HTML content (required if text not set) */\n  html?: ResolvableString\n}\n\n/**\n * Datetime configuration for a timeline item.\n * Controls how the timestamp is formatted and displayed.\n */\nexport interface MOJTimelineItemDatetime {\n  /**\n   * A valid datetime string to be formatted.\n   * @example '2019-06-14T14:01:00.000Z'\n   */\n  timestamp: ResolvableString\n\n  /**\n   * Standard date format type (use instead of format).\n   * Options: 'datetime', 'shortdatetime', 'date', 'shortdate', 'time'\n   * @example 'datetime' // Full date and time\n   * @example 'date' // Date only\n   */\n  type?: 'datetime' | 'shortdatetime' | 'date' | 'shortdate' | 'time' | ResolvableString\n\n  /**\n   * Custom date format string (use instead of type).\n   * Uses Moment.js format strings.\n   * @see https://momentjs.com/docs/#/displaying/format/\n   * @example 'DD/MM/YYYY'\n   * @example 'dddd, MMMM Do YYYY, h:mm:ss a'\n   */\n  format?: ResolvableString\n}\n\n/**\n * Byline configuration for a timeline item.\n * Displays who performed or is associated with the event.\n */\nexport interface MOJTimelineItemByline {\n  /** Byline text (required if html not set) */\n  text?: ResolvableString\n\n  /** Byline HTML content (required if text not set) */\n  html?: ResolvableString\n}\n\n/**\n * Timeline item configuration.\n * Represents a single event in the timeline.\n */\nexport interface MOJTimelineItem {\n  /**\n   * The label/title of the timeline event.\n   * @example { text: 'Application submitted' }\n   */\n  label: MOJTimelineItemLabel\n\n  /**\n   * Plain text description of the event.\n   * Use either text or html, not both.\n   * @example 'Your application has been received.'\n   */\n  text?: ResolvableString\n\n  /**\n   * HTML description of the event.\n   * Use either text or html, not both.\n   * @example '<p>Your application has been <strong>approved</strong>.</p>'\n   */\n  html?: ResolvableString\n\n  /**\n   * Child blocks to render as the event description.\n   * Takes precedence over text/html.\n   */\n  blocks?: BlockDefinition[]\n\n  /**\n   * Date and time of the event.\n   * @example { timestamp: '2019-06-14T14:01:00.000Z', type: 'datetime' }\n   */\n  datetime?: MOJTimelineItemDatetime\n\n  /**\n   * Who performed or is associated with the event.\n   * @example { text: 'Joe Bloggs' }\n   */\n  byline?: MOJTimelineItemByline\n\n  /** Additional CSS classes for this timeline item */\n  classes?: ResolvableString\n\n  /** Additional HTML attributes for this timeline item */\n  attributes?: Record<string, ResolvableString>\n\n  /**\n   * Conditional visibility for this timeline item. When the evaluated value is `false`,\n   * the item is omitted from rendering. Defaults to showing the item.\n   */\n  visibleWhen?: ResolvableBoolean\n}\n\n/**\n * MOJ Timeline component.\n * Displays a chronological list of events.\n *\n * The timeline is used to show a history of events or actions,\n * typically displayed with the most recent event first. Each event includes\n * a label, optional description, timestamp, and byline (who did it).\n *\n * @see https://design-patterns.service.justice.gov.uk/components/timeline\n * @example\n * ```typescript\n * MOJTimeline({\n *   items: [\n *     {\n *       label: { text: 'Application approved' },\n *       text: 'Your application has been approved.',\n *       datetime: { timestamp: '2019-06-14T14:01:00.000Z', type: 'datetime' },\n *       byline: { text: 'Caseworker 1' },\n *     },\n *     {\n *       label: { text: 'Application submitted' },\n *       html: '<p>Documents uploaded: <strong>3 files</strong></p>',\n *       datetime: { timestamp: '2019-06-01T09:00:00.000Z', type: 'datetime' },\n *       byline: { text: 'Joe Bloggs' },\n *     },\n *   ],\n *   headingLevel: 3,\n * })\n * ```\n */\nexport interface MOJTimeline extends BlockDefinition {\n  /**\n   * Array of timeline items to display.\n   * Items are displayed in the order provided (typically most recent first).\n   */\n  items: ResolvableArray<MOJTimelineItem>\n\n  /**\n   * Heading level for timeline item labels.\n   * Default: 2\n   * @example 3 // Use h3 for item labels\n   */\n  headingLevel?: 1 | 2 | 3 | 4 | 5 | 6\n\n  /**\n   * Additional CSS classes for the timeline container.\n   * @example 'app-timeline--custom'\n   */\n  classes?: ResolvableString\n\n  /**\n   * Additional HTML attributes for the timeline container.\n   * @example { 'data-module': 'app-timeline' }\n   */\n  attributes?: Record<string, ResolvableString>\n}\n\n/** Evaluated timeline item after expression resolution */\ntype EvaluatedMOJTimelineItem = EvaluatedBlock<MOJTimelineItem, false>\n\nfunction normaliseTimelineItem(item: EvaluatedMOJTimelineItem) {\n  const { blocks, ...itemParams } = item\n  const content = normaliseMojTextHtmlContent({\n    text: item.text,\n    html: item.html,\n    blocks,\n  })\n\n  return {\n    ...itemParams,\n    ...content,\n  }\n}\n\n/**\n * MOJ Timeline component.\n * Displays a chronological list of events.\n *\n * The timeline is used to show a history of events or actions,\n * typically displayed with the most recent event first. Each event includes\n * a label, optional description, timestamp, and byline (who did it).\n *\n * @see https://design-patterns.service.justice.gov.uk/components/timeline\n * @example\n * ```typescript\n * MOJTimeline({\n *   items: [\n *     {\n *       label: { text: 'Application approved' },\n *       text: 'Your application has been approved.',\n *       datetime: { timestamp: '2019-06-14T14:01:00.000Z', type: 'datetime' },\n *       byline: { text: 'Caseworker 1' },\n *     },\n *     {\n *       label: { text: 'Application submitted' },\n *       html: '<p>Documents uploaded: <strong>3 files</strong></p>',\n *       datetime: { timestamp: '2019-06-01T09:00:00.000Z', type: 'datetime' },\n *       byline: { text: 'Joe Bloggs' },\n *     },\n *   ],\n *   headingLevel: 3,\n * })\n * ```\n */\nexport const MOJTimeline = nunjucksComponent<MOJTimeline>('mojTimeline', {\n  render: (props, nunjucksEnv) => {\n    // NOTE: items is typed as ResolvableArray<MOJTimelineItem> which resolves to EvaluatedMOJTimelineItem[] at runtime\n    const items = props.items as EvaluatedMOJTimelineItem[]\n    const params = {\n      items: items.filter(item => item.visibleWhen !== false).map(normaliseTimelineItem),\n      headingLevel: props.headingLevel,\n      classes: props.classes,\n      attributes: props.attributes,\n    }\n\n    return nunjucksEnv.render('moj/components/timeline/template.njk', { params })\n  },\n})\n","import {\n  BlockDefinition,\n  ResolvableBoolean,\n  ResolvableString,\n  ResolvableArray,\n  EvaluatedBlock,\n} from '@ministryofjustice/hmpps-forge/core/components'\nimport { nunjucksComponent } from '../../utils/nunjucksComponent'\nimport { normaliseMojTextHtmlContent } from '../../utils/mojParamNormalisers'\n\n/**\n * Message type indicating whether the message was sent or received.\n * - 'sent': Blue message aligned to the right (outgoing message)\n * - 'received': Grey message aligned to the left (incoming message)\n */\nexport type MOJMessageType = 'sent' | 'received'\n\n/**\n * Message item configuration.\n * Represents a single message in the thread.\n */\nexport interface MOJMessageItem {\n  /**\n   * Unique ID for the message.\n   * Used to generate element IDs for targeting specific messages.\n   * @example 1\n   * @example 'msg-001'\n   */\n  id?: string | number\n\n  /**\n   * Plain text content of the message.\n   * Use either text or html, not both.\n   * @example 'Hello, how can I help you today?'\n   */\n  text?: ResolvableString\n\n  /**\n   * HTML content of the message.\n   * Use either text or html, not both.\n   * @example '<p>Please see the <strong>attached document</strong>.</p>'\n   */\n  html?: ResolvableString\n\n  /**\n   * Child blocks to render as the message content.\n   * Takes precedence over text/html.\n   */\n  blocks?: BlockDefinition[]\n\n  /**\n   * Message type indicating direction.\n   * - 'sent': Outgoing message (blue, right-aligned)\n   * - 'received': Incoming message (grey, left-aligned)\n   */\n  type: MOJMessageType | ResolvableString\n\n  /**\n   * The sender of the message.\n   * Displayed in the message metadata.\n   * @example 'John Smith'\n   * @example 'Support Agent'\n   */\n  sender: ResolvableString\n\n  /**\n   * Timestamp of when the message was sent.\n   * Must be a valid datetime string. Messages are grouped by date.\n   * @example '2019-06-14T14:01:00.000Z'\n   * @example '2023-12-25T09:30:00.000Z'\n   */\n  timestamp: ResolvableString\n\n  /** Conditional visibility for this message */\n  visibleWhen?: ResolvableBoolean\n}\n\n/**\n * MOJ Messages component.\n *\n * The messages component displays a conversation thread between two or more\n * parties. Messages are visually differentiated:\n * - Sent messages (type: 'sent'): Blue background, aligned right\n * - Received messages (type: 'received'): Grey background, aligned left\n *\n * Messages are automatically grouped by date, with date headers shown\n * when the date changes between messages.\n *\n * @see https://design-patterns.service.justice.gov.uk/components/messages\n * @example\n * ```typescript\n * MOJMessages({\n *   items: [\n *     {\n *       id: 1,\n *       text: 'Lorem ipsum dolor sit amet.',\n *       type: 'sent',\n *       sender: 'Person A',\n *       timestamp: '2018-10-16T10:50:00.000Z',\n *     },\n *     {\n *       id: 2,\n *       text: 'Nullam vestibulum lorem vulputate.',\n *       type: 'received',\n *       sender: 'Person B',\n *       timestamp: '2018-10-17T10:51:00.000Z',\n *     },\n *     {\n *       id: 3,\n *       html: '<p>Message with <strong>HTML</strong> content.</p>',\n *       type: 'sent',\n *       sender: 'Person A',\n *       timestamp: '2018-10-19T10:53:00.000Z',\n *     },\n *   ],\n *   label: 'Case correspondence',\n * })\n * ```\n */\nexport interface MOJMessages extends BlockDefinition {\n  /**\n   * Array of message items to display.\n   * Messages are displayed in the order provided, grouped by date.\n   */\n  items: ResolvableArray<MOJMessageItem>\n\n  /**\n   * ID for the messages container element.\n   * Defaults to 'messages' if not specified.\n   * @example 'case-messages'\n   */\n  id?: ResolvableString\n\n  /**\n   * Accessible label for the messages container.\n   * Applied as aria-label attribute.\n   * @example 'Case correspondence'\n   */\n  label?: ResolvableString\n\n  /**\n   * Additional CSS classes for the messages container.\n   * @example 'app-messages--compact'\n   */\n  classes?: ResolvableString\n\n  /**\n   * Additional HTML attributes for the messages container.\n   * @example { 'data-module': 'app-messages' }\n   */\n  attributes?: Record<string, ResolvableString>\n}\n\ntype EvaluatedMOJMessageItem = EvaluatedBlock<MOJMessages>['items'][number]\n\nfunction normaliseMessageItem(item: EvaluatedMOJMessageItem) {\n  const { blocks, ...itemParams } = item\n  const content = normaliseMojTextHtmlContent({\n    text: item.text,\n    html: item.html,\n    blocks,\n  })\n\n  return {\n    ...itemParams,\n    ...content,\n  }\n}\n\n/**\n * MOJ Messages component.\n *\n * The messages component displays a conversation thread between two or more\n * parties. Messages are visually differentiated:\n * - Sent messages (type: 'sent'): Blue background, aligned right\n * - Received messages (type: 'received'): Grey background, aligned left\n *\n * Messages are automatically grouped by date, with date headers shown\n * when the date changes between messages.\n *\n * @see https://design-patterns.service.justice.gov.uk/components/messages\n * @example\n * ```typescript\n * MOJMessages({\n *   items: [\n *     {\n *       id: 1,\n *       text: 'Lorem ipsum dolor sit amet.',\n *       type: 'sent',\n *       sender: 'Person A',\n *       timestamp: '2018-10-16T10:50:00.000Z',\n *     },\n *     {\n *       id: 2,\n *       text: 'Nullam vestibulum lorem vulputate.',\n *       type: 'received',\n *       sender: 'Person B',\n *       timestamp: '2018-10-17T10:51:00.000Z',\n *     },\n *     {\n *       id: 3,\n *       html: '<p>Message with <strong>HTML</strong> content.</p>',\n *       type: 'sent',\n *       sender: 'Person A',\n *       timestamp: '2018-10-19T10:53:00.000Z',\n *     },\n *   ],\n *   label: 'Case correspondence',\n * })\n * ```\n */\nexport const MOJMessages = nunjucksComponent<MOJMessages>('mojMessages', {\n  render: (props, nunjucksEnv) => {\n    const params = {\n      items: props.items.filter(item => item.visibleWhen !== false).map(normaliseMessageItem),\n      id: props.id,\n      label: props.label,\n      classes: props.classes,\n      attributes: props.attributes,\n    }\n\n    return nunjucksEnv.render('moj/components/messages/template.njk', { params })\n  },\n})\n","import {\n  BlockDefinition,\n  ResolvableArray,\n  ResolvableBoolean,\n  ResolvableNumber,\n  ResolvableString,\n} from '@ministryofjustice/hmpps-forge/core/components'\nimport { nunjucksComponent } from '../../utils/nunjucksComponent'\n\n/**\n * Configuration for a table header cell.\n */\nexport interface MultiSelectHeadCell {\n  /** Plain text content for the header cell. */\n  text?: ResolvableString\n\n  /** HTML content for the header cell. Takes precedence over `text`. */\n  html?: ResolvableString\n\n  /** Specify format of the cell. Use \"numeric\" for right-aligned numeric data. */\n  format?: ResolvableString\n\n  /** Additional CSS classes for the header cell. */\n  classes?: ResolvableString\n\n  /** Number of columns this cell should span. */\n  colspan?: ResolvableNumber\n\n  /** Number of rows this cell should span. */\n  rowspan?: ResolvableNumber\n\n  /** Custom HTML attributes for the header cell element. */\n  attributes?: Record<string, any>\n}\n\n/**\n * Configuration for a table body cell.\n */\nexport interface MultiSelectCell {\n  /** Plain text content for the cell. */\n  text?: ResolvableString\n\n  /** HTML content for the cell. Takes precedence over `text`. */\n  html?: ResolvableString\n\n  /** Specify format of the cell. Use \"numeric\" for right-aligned numeric data. */\n  format?: ResolvableString\n\n  /** Additional CSS classes for the cell. */\n  classes?: ResolvableString\n\n  /** Number of columns this cell should span. */\n  colspan?: ResolvableNumber\n\n  /** Number of rows this cell should span. */\n  rowspan?: ResolvableNumber\n\n  /** Custom HTML attributes for the cell element. */\n  attributes?: Record<string, any>\n}\n\n/**\n * A row in the table, consisting of an array of cells.\n */\nexport type MultiSelectRow = MultiSelectCell[]\n\n/**\n * MOJ Multi Select component.\n * A table with row selection functionality.\n *\n * This is a thin wrapper around the GOV.UK Table that adds the\n * `data-module=\"moj-multi-select\"` attribute to enable the MOJ JavaScript enhancement.\n *\n * You must structure your table with checkbox inputs for the functionality to work:\n * - First column header should contain a \"select all\" checkbox\n * - First cell of each row should contain a checkbox with the row's value\n *\n * @see https://design-patterns.service.justice.gov.uk/components/multi-select/\n * @example\n * ```typescript\n * MOJMultiSelect({\n *   head: [\n *     { html: '<input type=\"checkbox\" class=\"govuk-checkboxes__input\" id=\"select-all\">' },\n *     { text: 'Name' },\n *     { text: 'Status' },\n *   ],\n *   rows: [\n *     [\n *       { html: '<input type=\"checkbox\" class=\"govuk-checkboxes__input\" name=\"selected\" value=\"1\">' },\n *       { text: 'John Smith' },\n *       { text: 'Active' },\n *     ],\n *   ],\n * })\n * ```\n */\nexport interface MOJMultiSelect extends BlockDefinition {\n  /** The rows within the table. Each row is an array of cells. Required. */\n  rows: ResolvableArray<MultiSelectRow>\n\n  /** Table header cells. Renders a `<thead>` with a single header row. */\n  head?: ResolvableArray<MultiSelectHeadCell>\n\n  /** Caption text displayed above the table. Useful for accessibility. */\n  caption?: ResolvableString\n\n  /** CSS classes for the caption. */\n  captionClasses?: ResolvableString\n\n  /** If true, the first cell in each row will be rendered as a header (`<th>`) with row scope. */\n  firstCellIsHeader?: ResolvableBoolean\n\n  /** Additional CSS classes for the table element. */\n  classes?: ResolvableString\n\n  /** Custom HTML attributes for the table element. */\n  attributes?: Record<string, any>\n}\n\n/**\n * MOJ Multi Select component.\n * A table with row selection functionality.\n *\n * This is a thin wrapper around the GOV.UK Table that adds the\n * `data-module=\"moj-multi-select\"` attribute to enable the MOJ JavaScript enhancement.\n *\n * You must structure your table with checkbox inputs for the functionality to work:\n * - First column header should contain a \"select all\" checkbox\n * - First cell of each row should contain a checkbox with the row's value\n *\n * @see https://design-patterns.service.justice.gov.uk/components/multi-select/\n * @example\n * ```typescript\n * MOJMultiSelect({\n *   head: [\n *     { html: '<input type=\"checkbox\" class=\"govuk-checkboxes__input\" id=\"select-all\">' },\n *     { text: 'Name' },\n *     { text: 'Status' },\n *   ],\n *   rows: [\n *     [\n *       { html: '<input type=\"checkbox\" class=\"govuk-checkboxes__input\" name=\"selected\" value=\"1\">' },\n *       { text: 'John Smith' },\n *       { text: 'Active' },\n *     ],\n *   ],\n * })\n * ```\n */\nexport const MOJMultiSelect = nunjucksComponent<MOJMultiSelect>('mojMultiSelect', {\n  render: (props, nunjucksEnv) => {\n    const params: Record<string, any> = {\n      rows: props.rows,\n      head: props.head,\n      caption: props.caption,\n      captionClasses: props.captionClasses,\n      firstCellIsHeader: props.firstCellIsHeader,\n      classes: props.classes,\n      attributes: {\n        ...props.attributes,\n        'data-module': 'moj-multi-select',\n      },\n    }\n\n    return nunjucksEnv.render('govuk/components/table/template.njk', { params })\n  },\n})\n","import {\n  BlockDefinition,\n  ResolvableArray,\n  ResolvableBoolean,\n  ResolvableNumber,\n  ResolvableString,\n} from '@ministryofjustice/hmpps-forge/core/components'\nimport { nunjucksComponent } from '../../utils/nunjucksComponent'\n\n/**\n * Configuration for a sortable table header cell.\n */\nexport interface SortableTableHeadCell {\n  /** Plain text content for the header cell. */\n  text?: ResolvableString\n\n  /** HTML content for the header cell. Takes precedence over `text`. */\n  html?: ResolvableString\n\n  /** Specify format of the cell. Use \"numeric\" for right-aligned numeric data. */\n  format?: ResolvableString\n\n  /** Additional CSS classes for the header cell. */\n  classes?: ResolvableString\n\n  /** Number of columns this cell should span. */\n  colspan?: ResolvableNumber\n\n  /** Number of rows this cell should span. */\n  rowspan?: ResolvableNumber\n\n  /** Custom HTML attributes for the header cell element. */\n  attributes?: Record<string, any>\n}\n\n/**\n * Configuration for a sortable table body cell.\n */\nexport interface SortableTableCell {\n  /** Plain text content for the cell. */\n  text?: ResolvableString\n\n  /** HTML content for the cell. Takes precedence over `text`. */\n  html?: ResolvableString\n\n  /** Specify format of the cell. Use \"numeric\" for right-aligned numeric data. */\n  format?: ResolvableString\n\n  /** Additional CSS classes for the cell. */\n  classes?: ResolvableString\n\n  /** Number of columns this cell should span. */\n  colspan?: ResolvableNumber\n\n  /** Number of rows this cell should span. */\n  rowspan?: ResolvableNumber\n\n  /** Custom HTML attributes for the cell element. */\n  attributes?: Record<string, any>\n}\n\n/**\n * A row in the sortable table, consisting of an array of cells.\n */\nexport type SortableTableRow = SortableTableCell[]\n\n/**\n * MOJ Sortable Table component.\n * A table with clickable column headers for sorting.\n *\n * This is a thin wrapper around the GOV.UK Table that adds the\n * `data-module=\"moj-sortable-table\"` attribute to enable the MOJ JavaScript enhancement.\n *\n * For sorting to work, header cells should contain `<button>` elements.\n * The JavaScript will handle click events and sort the table rows accordingly.\n *\n * @see https://design-patterns.service.justice.gov.uk/components/sortable-table/\n * @example\n * ```typescript\n * MOJSortableTable({\n *   head: [\n *     { html: '<button>Name</button>' },\n *     { html: '<button>Date</button>' },\n *     { html: '<button>Status</button>' },\n *   ],\n *   rows: [\n *     [{ text: 'John Smith' }, { text: '2024-01-15' }, { text: 'Active' }],\n *     [{ text: 'Jane Doe' }, { text: '2024-02-20' }, { text: 'Pending' }],\n *   ],\n * })\n * ```\n */\nexport interface MOJSortableTable extends BlockDefinition {\n  /** The rows within the table. Each row is an array of cells. Required. */\n  rows: ResolvableArray<SortableTableRow>\n\n  /** Table header cells. Renders a `<thead>` with a single header row. */\n  head?: ResolvableArray<SortableTableHeadCell>\n\n  /** Caption text displayed above the table. Useful for accessibility. */\n  caption?: ResolvableString\n\n  /** CSS classes for the caption. */\n  captionClasses?: ResolvableString\n\n  /** If true, the first cell in each row will be rendered as a header (`<th>`) with row scope. */\n  firstCellIsHeader?: ResolvableBoolean\n\n  /** Additional CSS classes for the table element. */\n  classes?: ResolvableString\n\n  /** Custom HTML attributes for the table element. */\n  attributes?: Record<string, any>\n}\n\n/**\n * MOJ Sortable Table component.\n * A table with clickable column headers for sorting.\n *\n * This is a thin wrapper around the GOV.UK Table that adds the\n * `data-module=\"moj-sortable-table\"` attribute to enable the MOJ JavaScript enhancement.\n *\n * For sorting to work, header cells should contain `<button>` elements.\n * The JavaScript will handle click events and sort the table rows accordingly.\n *\n * @see https://design-patterns.service.justice.gov.uk/components/sortable-table/\n * @example\n * ```typescript\n * MOJSortableTable({\n *   head: [\n *     { html: '<button>Name</button>' },\n *     { html: '<button>Date</button>' },\n *     { html: '<button>Status</button>' },\n *   ],\n *   rows: [\n *     [{ text: 'John Smith' }, { text: '2024-01-15' }, { text: 'Active' }],\n *     [{ text: 'Jane Doe' }, { text: '2024-02-20' }, { text: 'Pending' }],\n *   ],\n * })\n * ```\n */\nexport const MOJSortableTable = nunjucksComponent<MOJSortableTable>('mojSortableTable', {\n  render: (props, nunjucksEnv) => {\n    const params: Record<string, any> = {\n      rows: props.rows,\n      head: props.head,\n      caption: props.caption,\n      captionClasses: props.captionClasses,\n      firstCellIsHeader: props.firstCellIsHeader,\n      classes: props.classes,\n      attributes: {\n        ...props.attributes,\n        'data-module': 'moj-sortable-table',\n      },\n    }\n\n    return nunjucksEnv.render('govuk/components/table/template.njk', { params })\n  },\n})\n","import { BlockDefinition, ComponentRegistryEntry } from '@ministryofjustice/hmpps-forge/core/components'\n\nimport { MOJAlert } from './alert/mojAlert'\nimport { MOJBadge } from './badge/mojBadge'\nimport { MOJBanner } from './banner/mojBanner'\nimport { MOJButtonMenu } from './button-menu/mojButtonMenu'\nimport { MOJCard } from './card/mojCard'\nimport { MOJCardGroup } from './card-group/mojCardGroup'\nimport { MOJDatePicker } from './date-picker/mojDatePicker'\nimport { MOJFilter } from './filter/mojFilter'\nimport { MOJProgressBar } from './progress-bar/mojProgressBar'\nimport { MOJSideNavigation } from './side-navigation/mojSideNavigation'\nimport { MOJSubNavigation } from './sub-navigation/mojSubNavigation'\nimport { MOJTicketPanel } from './ticket-panel/mojTicketPanel'\nimport { MOJTimeline } from './timeline/mojTimeline'\nimport { MOJMessages } from './messages/mojMessages'\nimport { MOJMultiSelect } from './multi-select/mojMultiSelect'\nimport { MOJSortableTable } from './sortable-table/mojSortableTable'\n\n// Re-export supporting types\nexport type { MOJAlertVariant, MOJAlertHeadingTag } from './alert/mojAlert'\nexport type { MOJBadgeColour } from './badge/mojBadge'\nexport type { MOJBannerType } from './banner/mojBanner'\nexport type { MOJButtonMenuAlign, MOJButtonMenuButton, MOJButtonMenuItem } from './button-menu/mojButtonMenu'\nexport type { MOJCardHeading, MOJCardDescription } from './card/mojCard'\nexport type { MOJCardGroupItem, MOJCardGroupItemHeading, MOJCardGroupItemDescription } from './card-group/mojCardGroup'\nexport type { MOJDatePickerLabel, MOJDatePickerHint, MOJDatePickerFormGroup } from './date-picker/mojDatePicker'\nexport type {\n  MOJFilterHeading,\n  MOJFilterClearLink,\n  MOJFilterTagItem,\n  MOJFilterCategory,\n  MOJFilterSelectedFilters,\n  MOJFilterSubmit,\n} from './filter/mojFilter'\nexport type { MOJProgressBarItem, MOJProgressBarItemLabel } from './progress-bar/mojProgressBar'\nexport type {\n  MOJSideNavigationItem,\n  MOJSideNavigationSection,\n  MOJSideNavigationHeading,\n} from './side-navigation/mojSideNavigation'\nexport type { MOJSubNavigationItem } from './sub-navigation/mojSubNavigation'\nexport type { MOJTicketPanelItem, MOJTicketPanelColor } from './ticket-panel/mojTicketPanel'\nexport type {\n  MOJTimelineItem,\n  MOJTimelineItemLabel,\n  MOJTimelineItemDatetime,\n  MOJTimelineItemByline,\n} from './timeline/mojTimeline'\nexport type { MOJMessageItem, MOJMessageType } from './messages/mojMessages'\nexport type { MultiSelectHeadCell, MultiSelectCell, MultiSelectRow } from './multi-select/mojMultiSelect'\nexport type { SortableTableHeadCell, SortableTableCell, SortableTableRow } from './sortable-table/mojSortableTable'\n\n// Re-export the components (each const is both the block builder and the registry entry)\nexport { MOJAlert } from './alert/mojAlert'\nexport { MOJBadge } from './badge/mojBadge'\nexport { MOJBanner } from './banner/mojBanner'\nexport { MOJButtonMenu } from './button-menu/mojButtonMenu'\nexport { MOJCard } from './card/mojCard'\nexport { MOJCardGroup } from './card-group/mojCardGroup'\nexport { MOJDatePicker } from './date-picker/mojDatePicker'\nexport { MOJFilter } from './filter/mojFilter'\nexport { MOJProgressBar } from './progress-bar/mojProgressBar'\nexport { MOJSideNavigation } from './side-navigation/mojSideNavigation'\nexport { MOJSubNavigation } from './sub-navigation/mojSubNavigation'\nexport { MOJTicketPanel } from './ticket-panel/mojTicketPanel'\nexport { MOJTimeline } from './timeline/mojTimeline'\nexport { MOJMessages } from './messages/mojMessages'\nexport { MOJMultiSelect } from './multi-select/mojMultiSelect'\nexport { MOJSortableTable } from './sortable-table/mojSortableTable'\n\n/** All MOJ component definitions */\nexport const mojComponents: ComponentRegistryEntry<BlockDefinition, string>[] = [\n  MOJAlert,\n  MOJBadge,\n  MOJBanner,\n  MOJButtonMenu,\n  MOJCard,\n  MOJCardGroup,\n  MOJDatePicker,\n  MOJFilter,\n  MOJProgressBar,\n  MOJSideNavigation,\n  MOJSubNavigation,\n  MOJTicketPanel,\n  MOJTimeline,\n  MOJMessages,\n  MOJMultiSelect,\n  MOJSortableTable,\n]\n"],"mappings":";;;;;;;;;;;AA2BA,SAAgB,kBACd,SACA,SACgC;CAChC,OAAO,UAAgD,SAAS,OAAO;AACzE;;;ACjBA,SAAS,sBAAsB,QAAqD;CAClF,IAAI,CA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