@aiquants/console-ui 0.6.4 → 0.6.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -19,7 +19,7 @@ pnpm add @aiquants/console-ui
19
19
  | --- | --- |
20
20
  | `@aiquants/console-ui` | Components and hooks; re-exports everything from `@aiquants/console-ui/core`. |
21
21
  | `@aiquants/console-ui/core` | React-free: the tokens with the geometry of their formulas and the contrast computation, the tone table and the CSS text of a colour of both schemes, the layout arithmetic and the figure formulas, number, zoned-time and instant formatting, the reading of a number field's text, the rule of a text with nothing to read, the label catalogs, the read contract with its keep-last-good machine, and the keyset paging machine (listed below). Server-side loaders and hosts import from here without loading React. |
22
- | `@aiquants/console-ui/testing` | DOM-only: `scanColourRoles(root)`, the colour-role scan a console runs on its own rendered DOM, text (the markers of a `List` included) and SVG graphics alike (see Tokens and colours), and the model of the modal dialog methods a test DOM lacks, `installDialogModel()` with `openModals()` and `pressEscape(dialog)` (see Testing in jsdom). It takes elements and loads no React. |
22
+ | `@aiquants/console-ui/testing` | DOM-only: `scanColourRoles(root, { exclude })`, the colour-role scan a console runs on its own rendered DOM, text (the markers of a `List` included) and SVG graphics alike (see Tokens and colours), and the model of the modal dialog methods a test DOM lacks, `installDialogModel()` with `openModals()` and `pressEscape(dialog)` (see Testing in jsdom). It takes elements and loads no React. |
23
23
  | `@aiquants/console-ui/styles/console-ui.css` | The stylesheet: the token variables on `[data-cui-root]` and the component rules, all inside `@layer cui`. |
24
24
 
25
25
  The `/core` exports:
@@ -147,10 +147,12 @@ Draw any other overlay as a non-modal `<dialog>` (opened with `show()`) or a pop
147
147
  and the pressed segment and the current step's marker (`Highlight` with `HighlightText`); a figure's surfaces are redrawn in `Canvas` and its lines and arrowheads in `CanvasText`, with a selected plate, a focus ring and a strong edge and its arrowhead in `Highlight` (their widths and dashes stay), while its text keeps the forced `CanvasText`.
148
148
  The band is the row's own inline-start border, taken out of its inline-start padding (the row's box and text stay where an unselected row has them, and the band stays at the start in a right-to-left root). The focus ring sets only `outline`, so a selected row that has focus keeps its band.
149
149
  Every rule is a border (the cell's own bottom border, taken out of the cell's bottom padding; no rule is drawn as a shadow, which forced colours remove), so it stays in the forced `CanvasText` with no rule of its own, and nothing is positioned for forced colours, so the focus rings of rows and of controls in cells stay whole.
150
- - A console scans its own rendered DOM with `scanColourRoles(root)` from `@aiquants/console-ui/testing`, the same oracle the package runs on its components: for each text node it reads the nearest `data-cui-fg` and `data-cui-surface` and looks the pair up in `CONTRAST_PAIRS` (both schemes list the same pairs), and it fails a text with no role, a pair not in the table, and any inline paint declaration from the text up to its farther role element
150
+ - A console scans its own rendered DOM with `scanColourRoles(root, { exclude })` from `@aiquants/console-ui/testing`, the same oracle the package runs on its components: for each text node it reads the nearest `data-cui-fg` and `data-cui-surface` and looks the pair up in `CONTRAST_PAIRS` (both schemes list the same pairs), and it fails a text with no role, a pair not in the table, and any inline paint declaration from the text up to its farther role element
151
151
  — every declared inline property whose name contains `color`, `background`, `fill`, `stroke` or `shadow` (so every longhand such as `border-top-color` or `outline-color`), the `border`, `outline`, `text-decoration`, `column-rule` and `text-emphasis` shorthands, `border-image`, `opacity`, filters and blend modes — and any paint attribute there (`fill`, `stroke`, `color`, `bgcolor`, `opacity` and every `*-opacity`, `stop-color`, `flood-color`, `lighting-color`, `filter`, `mask`). The text of an SVG `title`, `desc` or `metadata` is never drawn and is not read.
152
152
  A list that draws markers (`data-cui-marker`, a `List` with `marker="bullet"` or `"number"`) paints one text per item that the DOM does not hold, so each item of such a list is read as one text measured from the item (its nearest `data-cui-fg` and `data-cui-surface`, no inline paint up to the farther role element) and named `印 <the item's data-testid>` in the failures.
153
153
  It reads every SVG shape (`path`, `rect`, `circle`, `ellipse`, `line`, `polyline`, `polygon`) as a graphic: it fails a shape with no `data-cui-stroke` or `data-cui-fill` or no `data-cui-surface` above it, a fill that is not its nearest surface, a line that is not a non-text role paired in the table with that surface (and, for a filled shape, with the surface around it, the other side of its edge), and any inline paint or paint attribute up to its farther surface element.
154
+ A screen that holds DOM another package paints by its own rules (a drop-down list, a header the host slots in) names those subtrees in the optional `exclude`, each by one `data-*` attribute selector (`[data-select-box]`, `[data-testid="host-heading"]`, or another value comparison such as `^=`); nothing inside them is read, the markers of excluded items included.
155
+ An entry that is not one such selector, that matches the scanned root itself, or that matches no element under it throws `RangeError`, so a stale or overbroad entry cannot empty the scan unnoticed; assert a lower bound on `texts` for each screen as well.
154
156
  It returns `{failures, measured, texts, measuredGraphics, graphics}` (`measuredGraphics` holds the `line/surface` pairs, `graphics` counts the shapes); assert `failures` empty and `measured` non-empty, and `measuredGraphics` non-empty on a screen that draws a figure. `contrastRatio` (sRGB channels in [0, 1], with `hexToSrgb` for `#rrggbb`) is the one contrast computation.
155
157
 
156
158
  ### Layout
@@ -266,8 +268,11 @@ Draw any other overlay as a non-modal `<dialog>` (opened with `show()`) or a pop
266
268
  In the first commit after a press, `LoadMore` throws when `rows.ref` is not attached or holds a number of marked elements other than `rows.count`.
267
269
  - The focus ring (2 px `focus`, 2 px outset) is drawn only on the elements the package lets take focus; host controls placed inside the root keep their own focus style.
268
270
  - `Toolbar` is one stop in the Tab order (a roving tabindex over its buttons, `aria-disabled` ones included): Tab enters it at the control that last had focus (the first until then), the arrow keys move to the next and previous control and wrap around (swapped in a right-to-left toolbar), and Home and End move to the first and the last. `Tabs` and `Breadcrumb` are real links, each in the Tab order.
269
- - `Dialog` opens with `showModal()`, so the browser traps focus in it, makes the rest of the document inert and closes it on Escape; focus starts on its close button and returns, when it closes or unmounts open, to the element that had it when it opened. `onClose` is called when the operator closes it (the close button or Escape), not when the caller sets `open` to `false`.
270
- A `close` event that arrives while it is open again (it closed and reopened in one task, as `StrictMode` does to a dialog mounted open) is not the operator's, so it moves no focus and calls no `onClose`. Escape does not close it while focus is in a text field holding a value, as `useEscapeToClose`.
271
+ - `Dialog` opens with `showModal()`, so the browser traps focus in it, makes the rest of the document inert and closes it on Escape; focus starts on its close button, or on the element the caller names in `initialFocus` (a ref, such as to the first field of a form), and returns, when it closes or unmounts open, to the element that had it when it opened.
272
+ An `initialFocus` that holds no element or one outside the dialog throws `RangeError` before the dialog opens; one that does not take focus (a `disabled` field, a `div` without `tabindex`) closes the dialog again and throws `RangeError`. `onClose` is called when the operator closes it (the close button or Escape), not when the caller sets `open` to `false`.
273
+ A `close` event that arrives while it is open again (it closed and reopened in one task, as `StrictMode` does to a dialog mounted open) is not the operator's, so it moves no focus and calls no `onClose`.
274
+ Escape does not close it while an IME composes (a keydown with `isComposing` or the keyCode 229, read in the capture phase so a control inside that stops the keydown cannot hide it; the Escape cancels the composition), nor while focus is in a text field holding a value, as `useEscapeToClose`.
275
+ - A pressed `Button` (busy and unavailable ones included) or `RowButton` takes focus before its `onClick` or `onSelect` runs, without scrolling, when it does not have it: WebKit (Safari on iOS and macOS) and Firefox on macOS do not focus a button on a pointer press, so the element that had focus before the press would keep it, and a `Dialog` the press opens would return focus there when it closes. A keyboard press, which comes from the focused button, moves no focus. After a pointer press the browser draws no `:focus-visible` ring.
271
276
  - The root owns the one announcer: `useAnnounce()` returns `announce(text)`. It writes to the root's polite live region or, while a `Dialog` (of this console or of another console on the page) is the topmost open modal, to that dialog's own polite region (which the modal leaves reachable while it hides every root's).
272
277
  Calls are coalesced over a quiet window: every call restarts a timer of `ANNOUNCE_SETTLE_MS` (150 ms), and when it passes without a call (or 1 s after the first pending call, so a stream of calls cannot hold the write back) the pending sentences are written to the region once, as one string in call order.
273
278
  A browser exposes the accessibility tree per rendering update, not per task, while one operator action spreads its calls over several tasks (an async handler continues after `await`, and React runs a default-lane commit's passive effects in a later task), so a write per task would let a later sentence replace an earlier one before it is read.
@@ -353,7 +358,7 @@ Draw any other overlay as a non-modal `<dialog>` (opened with `show()`) or a pop
353
358
  | `Card`, `CardSection` | `h2` card (a named region that draws its content in the body type and the sans face) and flat `h3` section (a landmark only with `region`, for a non-modal region such as an inspector; `level={4}` draws an `h4` in the same step and weight for a section inside a section, so the outline does not skip a level); `headingRef` makes the heading a programmatic focus target (`tabIndex={-1}`). `onEscape` closes a card or a region section on Escape (only a region takes it; see Focus and announcements). A card or section that another control expands takes that control's `aria-controls` target as its `id` (the detail of a `SelectableList` is `<CardSection id={detailId} …>`), so the reference resolves. |
354
359
  | `Stack`, `Cluster` | Vertical and wrapping horizontal layout with a spacing token; `Cluster as="span"` is the phrasing form a control's content may hold (an inline-flex `span`, same gap tokens). |
355
360
  | `List`, `ListItem` | A list of items stacked with a spacing token (`gap`): a `ul` or an `ol` with an explicit `role="list"` (WebKit with VoiceOver does not expose a list without markers as a list), its items `li` that take the caller's `testId` (one for the items of a list, or one per item) and `dataAttributes` for their identity; the list derives no test id. `marker="bullet"` (a `ul`) or `"number"` (an `ol`) draws the foundation's markers in the items' `type` (`body` or `prose`) for items whose content carries no marker of its own (lines of text); `marker="none"` keeps the semantics and draws nothing for items that carry their own name, number or box (a disclosure, a row with a control, a link, a line that starts with its own number), and `ordered` picks the `ol` when the order means something. A marked list has a marker column at least 16 px (`space-4`) wide and as wide as its widest marker, shared by every item (a subgrid), and the text 8 px (`space-2`) after it: 24 px for a bullet and the numbers 1 to 9, further out together for longer numbers or wider text spacing. A list without markers carries its `gap` as `data-cui-gap`; a marked list, whose two axes differ, carries it as `data-cui-row-gap` (between the items) and the 8 px as `data-cui-column-gap="space-2"` (see Layout for what each attribute promises). The marker is one line of the list's type at the top of its item, in the text colour the item inherits: it never changes the item's height, it is text measured at 7:1 like any text (`scanColourRoles` reads one text per item) and forced colours repaint it as text; a bullet is hidden from assistive technology, a number is read. Items have no padding or border, so n items of k lines of a line L apart by g are nkL + (n − 1)g px high, on the lattice. An item may hold block content (a disclosure, a paragraph, a row of labels); a marked list's item text carries the reading measure. `label` names the list (`aria-label`; a blank one throws `RangeError` naming `testId`); `id` and `hidden` make it the `aria-controls` target of the control that shows it. `ListItem` throws outside a `List` and inside another item's content without a `List` of its own. |
356
- | `Button`, `Link`, `FragmentLink` | Buttons that keep focus when they cannot act; an in-document move drawn as a link (no `href`); a real link to a place in the same document (`href="#<targetId>"`, drawn like `Link`, with an optional `onFollow` called with the click event; the browser moves unless it calls `event.preventDefault()`, as a caller that moves the focus itself must, since the browser's move drops the focus when the target cannot take it), for a jump list whose entries assistive technology should list with the links. |
361
+ | `Button`, `Link`, `FragmentLink` | Buttons that keep focus when they cannot act (a pressed `Button` takes focus; see Focus and announcements); an in-document move drawn as a link (no `href`); a real link to a place in the same document (`href="#<targetId>"`, drawn like `Link`, with an optional `onFollow` called with the click event; the browser moves unless it calls `event.preventDefault()`, as a caller that moves the focus itself must, since the browser's move drops the focus when the target cannot take it), for a jump list whose entries assistive technology should list with the links. |
357
362
  | `Pill` | A text status label, 28 px high (a body line it sits on stays 20 px), text width + 16 px wide, `vertical-align: top`; as a line of a `RowButton` it keeps that width. A line mixing a `Pill` and text is one `Text` span containing the `Pill`. |
358
363
  | `Notice`, `AlertMessage` | Quiet note; failure message read once per occurrence. Both are paragraphs with the reading measure. |
359
364
  | `Measured` | A measured value in tabular figures, or the `unmeasured` label for `null` (never `0` or an empty slot), marked `data-measured`: a count (`value`, in the root's format locale, with an optional `unit` after a space) or a text the caller formatted (`text`, such as a byte size, an instant, a version or a rate), never both. A text says how it breaks (`keep`, `data-cui-keep` in both states): `"whole"` for a figure read as one unit (`1.0 MiB`, `2026/09/24 01:00:00`), an inline-block like `Pill` that moves to the next line whole and breaks inside only when it is longer than its column (no `nowrap`, so it never overflows), or `"wrap"` for a text that wraps with its container (an identifier, a version). A `text` or `unit` with nothing to read (`isReadableText`) throws `RangeError` naming `testId`; pass `null` for a value that was not measured. |
@@ -361,9 +366,9 @@ Draw any other overlay as a non-modal `<dialog>` (opened with `show()`) or a pop
361
366
  | `MetricTile`, `TileGrid` | Metric tiles (100 px high) and the divisor grid. A tile's value is a `Measured` count (`value`, optionally with `unit`) or text (`text`), `null` while not measured, when it must be `neutral`; its label, sublabel and value are paragraphs with the reading measure. `count` is checked against the element children: a Fragment's children count one by one, a condition that renders no tile (`false`, `null`) does not count, a text child throws, and a component child counts as one tile whatever it renders (a wrapper returning `null` or two tiles is still one), so render `MetricTile` elements directly. |
362
367
  | `DataTable`, `LoadMore` | Fixed-layout table in a focusable named scroll frame; load-more that moves focus to the first row the page appended or the end-of-records text. A column header may carry a second line under its name (`ColumnDef.note`, a block in the regular weight inside the `th`, so it is part of the header every cell is read with; k caption lines make the header row 44 + 20k). One column may be the row header (`ColumnDef.rowHeader`: its cells are `th scope="row"`, centred like the other cells in a `row-control` table; two throw `RangeError`). The row header column may carry secondary lines per row under its cell's content (`ColumnDef.rowHeaderNote: (row) => ReactNode`, `null` for a row without one): a block in the regular weight inside the bold `th`, drawn like a column header's note, so the lines are part of the row header every cell of the row is read with, and a `row` row with k body lines of note is 24 + 20(k + 1), on the lattice. Only the row header column takes one: the type refuses it on another column, and a column that has one without being the row header throws `RangeError` naming `testId`. `rowDetail` (`open`, `id`, `render`) follows every record row with its detail row, one cell across every column whose `id` is the `aria-controls` of the row's opening button (`Button` with `expanded` and `controls`): open, it shows `render(row)` right after its row in the reading and focus order, any number at once; closed, it is `hidden` and empty, so a collapsed button's reference resolves too. A detail row carries `data-cui-row-detail` (`open` or `closed`) and no row-focus hook, and adds no rule: its cell keeps the table's cell padding, so it stays on the lattice. `rowSize` is `row` (44 px rows), `row-control` (52 px, for rows that hold a control) or `row-compact` (28 = 4 + 20 + 3 + 1: one `body` line with 4 px above and below, k lines 8 + 20k) for a read-only line table such as a text diff, where 500 lines are 14,000 px high instead of 22,000. A compact row holds no control or focus target, as a control's 44 px target does not fit it: a cell holding a link, a button, a field, a disclosure, a label, an element with `tabindex` or `contenteditable` or a nested table throws `RangeError` naming `testId` after the render, and a compact table takes no `rowDetail` (the type refuses it). |
363
368
  | `CodeBlock` | Preformatted text (a JSON document, an excerpt of a log) drawn exactly as given in the mono face and the `body` type, without wrapping, in a scroll frame on `sunken` with 8 px padding: a region named by `label` that takes keyboard focus, so a long line can be scrolled into view from the keyboard. As a focusable frame it is never lower than the 44 px target (one line draws 44 px; k lines draw 2 × 8 + 20k px from two lines on). |
364
- | `SelectableList`, `RowButton` | Master list of selectable rows (`data-selected`, `aria-expanded`, `aria-controls`); the list carries an explicit `role="list"`, which WebKit needs to expose an unstyled list as a list. |
369
+ | `SelectableList`, `RowButton` | Master list of selectable rows (`data-selected`, `aria-expanded`, `aria-controls`); the list carries an explicit `role="list"`, which WebKit needs to expose an unstyled list as a list. A pressed row takes focus before `onSelect` runs, as a pressed `Button` does (see Focus and announcements). |
365
370
  | `ComparisonGrid` | Side-by-side comparison: a table named by its (visually hidden) `caption`, or one group per column named by its heading. Both layouts are in the DOM; each cell is a function called once per layout with `"table"` or `"stack"`, so every cell is rendered and mounted twice (the hidden copy included) and the caller gives each copy its own ids, test ids and refs. Cells must be presentational: no data read (`useResource`), announcement (`useAnnounce`) or focus management (`useFocusRescue`); keep state and effects above the grid and pass values into the cells. |
366
- | `Field`, `TextInput`, `PasswordInput`, `TextArea`, `Select`, `RadioGroup`, `CheckboxGroup` | Fields tied to their label, description and error with `useId`. `PasswordInput` masks what is typed, tells the browser's password manager what the password is (`autoComplete`: `new-password` for one the operator sets, `current-password` for a sign-in) and turns spell checking and capitalization off. `TextInput` takes the keyboard a touch device shows (`inputMode`: `numeric` or `decimal`; its value stays the typed text, which the caller parses) and fixed text drawn in front of the input in the same frame (`prefix`, such as a URI scheme; not part of the value, and the first text describing the input; a blank prefix throws). `TextInput`, `PasswordInput` and `Select` in a table cell or a repeated row whose headers show the name may hide their label (`labelHidden`; it stays tied by `for`). `CheckboxGroup` is a `fieldset` of native check boxes, each inside its 44 px label; it returns the chosen values in the options' order and refuses no option, repeated values and chosen values that are not options. Every field takes `errorId`, the id its error line takes (one token; generated when omitted), so another control can name the error as the reason it cannot act, such as the save button of a table row whose typed value cannot be read (`unavailable={{ reasonId: errorId }}`). Read a number field's text with `readDecimalText` or `readIntegerText`. |
371
+ | `Field`, `TextInput`, `PasswordInput`, `TextArea`, `Select`, `RadioGroup`, `CheckboxGroup` | Fields tied to their label, description and error with `useId`. `PasswordInput` masks what is typed, tells the browser's password manager what the password is (`autoComplete`: `new-password` for one the operator sets, `current-password` for a sign-in) and turns spell checking and capitalization off. `TextInput` takes the keyboard a touch device shows (`inputMode`: `numeric` or `decimal`; its value stays the typed text, which the caller parses) and fixed text drawn in front of the input in the same frame (`prefix`, such as a URI scheme; not part of the value, and the first text describing the input; a blank prefix throws). `TextInput`, `PasswordInput` and `Select` in a table cell or a repeated row whose headers show the name may hide their label (`labelHidden`; it stays tied by `for`). `TextInput` is `text`, `search`, `email` (the touch keyboard for an address, and the browser checks the address before a native form submits) or `datetime-local`. `TextInput`, `TextArea` and `Select` take `name`, under which a native form submits the value (one token without whitespace; an empty name, one holding whitespace or one that is not a string throws `RangeError`); a field without `name` renders none and submits nothing. `TextInput` of the `text`, `search` and `email` types and `TextArea` take `maxLength`, the most characters the field takes, counted in UTF-16 code units as the browser counts them (a positive integer: `0`, a negative number, a fraction, `NaN` or an infinity throws `RangeError`, and so does a `maxLength` on a `datetime-local` input, which the browser would ignore). `PasswordInput` takes neither. On a coarse pointer (a touch screen) the text of every field and of an input's prefix is the larger of the `body` step and 16 px, so iOS does not zoom the page each time a field takes focus; the line stays the step's, so a one-line field stays 44 px high. `CheckboxGroup` is a `fieldset` of native check boxes, each inside its 44 px label; it returns the chosen values in the options' order and refuses no option, repeated values and chosen values that are not options. Every field takes `errorId`, the id its error line takes (one token; generated when omitted), so another control can name the error as the reason it cannot act, such as the save button of a table row whose typed value cannot be read (`unavailable={{ reasonId: errorId }}`). Read a number field's text with `readDecimalText` or `readIntegerText`. |
367
372
  | `ProgressBar` | Determinate with a maximum (clamped at 100 %); indeterminate without, drawn as a quarter-length segment that sweeps the track when motion is allowed and rests in its middle otherwise. The visible label names the bar; the visible value text is hidden from assistive technology, which reads it once as the bar's `aria-valuetext`. |
368
373
  | `Meter` | A value at its place in a fixed range (a score in [0, 1], a share of a quota), not progress: `role="meter"` named by `label` (no visible label; the row or field around it says what it measures), its fill in `info-accent` on a `sunken` track as long as the value's place in the range, beside the value text in `fg` (hidden from assistive technology, which reads it once as the meter's `aria-valuetext`). It is phrasing content that fits one `body` line, so it can be a line of a `RowButton`: it takes its parent's whole width even where the parent aligns its lines to the start (a `RowButton`), and the 8 px track is centred on the value text's 20 px line and takes the width left after the text, never less than 48 px. Refuses a range that is not finite or whose `min` is not below `max`, and a value outside the range. |
369
374
  | `MasterDetail` | Master–detail layout by container width; side by side, neither pane goes below its minimum. |
@@ -371,7 +376,7 @@ Draw any other overlay as a non-modal `<dialog>` (opened with `show()`) or a pop
371
376
  | `Tabs` | The tab row of a console whose tabs are routes: a named `nav` of real links (not an ARIA `tablist`), the current one `aria-current="page"` with an `info-accent` marker and the medium weight. A plain click hands the tab's `href` to `onNavigate` (the host's router); a click with a modifier key or another button keeps the link's own behaviour. With `collapsible`, a container narrower than 48rem (an inline-size container query on the tab row's own width) folds the links into a full-width 44 px button naming the current tab and a popup of every tab below it (opened on press, closed on choosing a tab, Escape or a press outside); a wider container is the ordinary wrapping row, so a caller that does not set it is unchanged. |
372
377
  | `Breadcrumb` | The trail to the current page: a `nav` named by the UI language's `breadcrumb` label around an ordered list of the ancestors' links (drawn like `Link`) and the current page's name as `aria-current="page"` text; separators are hidden from assistive technology. Clicks as `Tabs`. |
373
378
  | `Toolbar` | `role="toolbar"` with a roving tabindex over its buttons (see Focus and announcements), laid out like a `Cluster` with an 8 px gap. |
374
- | `Dialog` | A modal `<dialog>` named by its title, with its close button and its own live region (see Focus and announcements); at most 40 ideographs plus its padding wide (WCAG 1.4.8), never wider than the viewport less 24 px on each side. `description` (a confirmation's sentence) is drawn under the header as a paragraph with the reading measure and is the dialog's `aria-describedby`, so it is read with the dialog's name when the dialog opens; without it the dialog has no description. |
379
+ | `Dialog` | A modal `<dialog>` named by its title, with its close button and its own live region (see Focus and announcements); at most 40 ideographs plus its padding wide (WCAG 1.4.8), never wider than the viewport less 24 px on each side. `description` (a confirmation's sentence) is drawn under the header as a paragraph with the reading measure and is the dialog's `aria-describedby`, so it is read with the dialog's name when the dialog opens; without it the dialog has no description. `initialFocus` names the element focus moves to when it opens (the first field of a form; see Focus and announcements). |
375
380
  | `Figure`, `FigureNode`, `FigureEdge` | A drawing of nodes and edges (see Figures): `kind="group"` (a named `role="group"` at its natural size in a scroll frame, every node a 44 px toggle button with the foundation's focus ring, `onEscape`) or `kind="decorative"` (`aria-hidden`, cut down to the lattice as its container shrinks; `viewBox`, `pointer` and `svgRef` for a pannable one). `FigureNode` draws a box (`x`, `y` its top-left corner; a name, caption `notes` and a height from `figureBoxPlan`) or a disc (`x`, `y` its centre; its name under it, or none for `name: null`) in a `tone`, `selected` or not, with a `solid` or `dashed` outline, an optional tooltip (`title`) and, in a group figure, `press` (`label`, `description`, `expanded`, `controls`, `onPress`). `FigureEdge` draws a path (`d`) in an `emphasis` (`normal` or `high`) and a `weight` (1 to 4), with an optional arrowhead and tooltip. The parts paint only through role attributes and take no paint, class or style; `FigureNode` and `FigureEdge` throw outside a `Figure`, and every refusal (`RangeError`) names the part's `testId`: a size off the lattice, a blank name (or a box's `null` one), a box narrower than its plan, a note role not in the table on a face the node takes, a group node without `press` or a decorative one with it, a pressable node below 44 px or closer than 4 px to the edge, and a weight outside 1–4. |
376
381
  | `Switch` | An on/off setting that takes effect at once: `role="switch"` with `aria-checked`, named by its label; the thumb sits at the track's start when off and at its end when on, moving over `motion-1`. In a table cell whose headers show the name it may hide its label (`labelHidden`; the target is the 44 px box across the 52 px track). A cell holding more than one switch shows which is which instead: each label is a short visible name after a `VisuallyHidden` subject (the row and the column), so the name stays whole and contains the visible name. Takes `unavailable`, a `ref` and caller `dataAttributes`. |
377
382
  | `PanelTabs` | Tabs that switch one panel within the page: a `tablist` of `tab` buttons (the selected one `aria-selected`, drawn like a `Tabs` tab) and the `tabpanel` they control, named by the selected tab; a press on the selected tab asks for nothing. The panel may be described by visible text inside it (`panelDescribedBy`, such as a hint on scrolling a wide figure). A list of one tab is allowed. Refuses no tab, repeated keys and a selected key that is not a tab. |
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkK7BETTSLcjs = require('./chunk-K7BETTSL.cjs');var _chunk7M4I26BScjs = require('./chunk-7M4I26BS.cjs');var _react = require('react');var _jsxruntime = require('react/jsx-runtime');var Ie=_react.createContext.call(void 0, null),vt=" ",ht='[inert], [aria-hidden="true" i]',Et="dialog:modal",$e="data-cui-dialog-announcer",br=`:scope > [${$e}]`,hr=e=>{if(e.closest(ht)!==null)return{hidden:'an ancestor is inert or aria-hidden="true"'};let t=e.ownerDocument,r=[...t.querySelectorAll(Et)],n=t.activeElement,a=r.filter(s=>s.contains(n)),o=a.length>0?a:r;if(o.every(s=>s.contains(e)))return{region:e};let i=o.find(s=>o.every(l=>l.contains(s)));if(i===void 0)return{hidden:"focus is in no open modal dialog and they do not nest, so which one is topmost cannot be told"};let d=i.querySelector(br);return d===null?{hidden:"the topmost open modal dialog neither contains the console nor is a Dialog"}:d.closest(ht)!==null?{hidden:'the topmost open modal dialog is a Dialog whose live region has an inert or aria-hidden="true" ancestor'}:{region:d}},Rr=e=>{try{e.querySelectorAll(Et)}catch(t){throw typeof t=="object"&&t!==null&&"name"in t&&t.name==="SyntaxError"?new Error("ConsoleUiRoot requires the :modal selector (Chrome 105, Firefox 103, Safari 15.6, jsdom 27 or later): announcements check whether a modal dialog hides the live region",{cause:t}):t}},ce= exports.ANNOUNCE_SETTLE_MS =150,Tr=1e3,Rt=new WeakMap,xr=(e,t)=>{let r=_nullishCoalesce(Rt.get(e), () => (new Set)),n={text:t};Rt.set(e,r.add(n)),setTimeout(()=>r.delete(n),ce);let a=e.ownerDocument.createElement("span");a.textContent=[...r].map(o=>o.text).join(vt),e.replaceChildren(a)},vr= exports.ConsoleUiRoot =({locale:e,formatLocale:t,timeZone:r,testId:n,children:a})=>{if(_react.useContext.call(void 0, Ie)!==null)throw new Error("ConsoleUiRoot must not be rendered inside another ConsoleUiRoot (a console has exactly one root)");let i=_chunkK7BETTSLcjs.u.call(void 0, e),[d]=Intl.getCanonicalLocales(t),s=_react.useMemo.call(void 0, ()=>new Intl.DateTimeFormat(d,{timeZone:r}).resolvedOptions().timeZone,[d,r]),l=_react.useRef.call(void 0, null),p=_react.useRef.call(void 0, null);_react.useLayoutEffect.call(void 0, ()=>{Rr(l.current.ownerDocument)},[]);let u=_react.useCallback.call(void 0, y=>{if(y.trim()==="")throw new RangeError("announce: text must be a non-empty sentence");let f=()=>{let{texts:h,settle:T,deadline:x}=p.current;p.current=null,clearTimeout(T),clearTimeout(x);let b=l.current;if(b===null)return;let R=h.join(vt),v=hr(b);if("hidden"in v)throw new Error(`announce: the live region is hidden from assistive technology (${v.hidden}), so this announcement would be lost: ${R}`);xr(v.region,R)},m=p.current;if(m===null){p.current={texts:[y],settle:setTimeout(f,ce),deadline:setTimeout(f,Tr)};return}m.texts.push(y),clearTimeout(m.settle),m.settle=setTimeout(f,ce)},[]),c=_react.useMemo.call(void 0, ()=>({locale:e,formatLocale:d,timeZone:s,labels:i,announce:u}),[e,d,s,i,u]);return _jsxruntime.jsx.call(void 0, Ie.Provider,{value:c,children:_jsxruntime.jsxs.call(void 0, "div",{"data-cui-root":"","data-cui-surface":"surface","data-cui-fg":"fg","data-testid":n,children:[a,_jsxruntime.jsx.call(void 0, "div",{className:"cui-visually-hidden",role:"status","aria-live":"polite","aria-atomic":"true","data-testid":`${n}-announcer`,ref:l})]})})},k= exports.useConsoleUi =()=>{let e=_react.useContext.call(void 0, Ie);if(e===null)throw new Error("useConsoleUi must be called inside ConsoleUiRoot");return e},g=()=>{k()},Er= exports.useAnnounce =()=>k().announce;var pe=(e,t,r)=>{e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||(e.preventDefault(),r(t))};var Pr=({items:e,current:t,onNavigate:r,testId:n})=>{let{labels:a}=k();if(new Set(e.map(o=>o.id)).size!==e.length)throw new RangeError(`Breadcrumb keys must be unique: ${e.map(o=>o.id).join(", ")}`);return _jsxruntime.jsx.call(void 0, "nav",{className:"cui-breadcrumb","aria-label":a.breadcrumb,"data-testid":n,children:_jsxruntime.jsxs.call(void 0, "ol",{className:"cui-breadcrumb-list",role:"list","data-cui-type":"body",children:[e.map(o=>_jsxruntime.jsxs.call(void 0, "li",{className:"cui-breadcrumb-item",children:[_jsxruntime.jsx.call(void 0, "a",{className:"cui-link",href:o.href,"data-cui-fg":"info-fg","data-cui-type":"body","data-testid":`${n}-${o.id}`,onClick:i=>pe(i,o.href,r),children:o.label}),_jsxruntime.jsx.call(void 0, "span",{className:"cui-breadcrumb-separator","aria-hidden":"true","data-cui-fg":"fg-muted",children:"\u203A"})]},o.id)),_jsxruntime.jsx.call(void 0, "li",{className:"cui-breadcrumb-item",children:_jsxruntime.jsx.call(void 0, "span",{"aria-current":"page","data-cui-fg":"fg","data-testid":`${n}-current`,children:t})})]})})};var w=e=>{if(e===void 0)return{};for(let t of Object.keys(e))if(!t.startsWith("data-")||t.startsWith("data-cui-")||t==="data-testid")throw new RangeError(`Caller attributes must be data-* and must not override data-cui-* or data-testid: ${t}`);return e};var Nr=new Set(["abbr","b","bdi","bdo","br","cite","code","data","del","dfn","em","i","ins","kbd","mark","q","s","samp","small","span","strong","sub","sup","time","u","var","wbr"]),kr=e=>{for(let t of e.querySelectorAll("*")){let r=t.localName;if(!Nr.has(r)||t.hasAttribute("tabindex")||t.hasAttribute("contenteditable"))return r}return null},H=(e,{testId:t,part:r,host:n})=>{_react.useLayoutEffect.call(void 0, ()=>{let a=kr(e.current);if(a!==null)throw new RangeError(`${t}: the ${r} is the content of a ${n} and holds only non-interactive phrasing content, not <${a}>`)})};var P=({fg:e,type:t,face:r,as:n="span",space:a,testId:o,id:i,tabIndex:d,ref:s,children:l})=>(g(),_jsxruntime.jsx.call(void 0, n,{className:"cui-text","data-cui-fg":e,"data-cui-type":t,"data-cui-face":r,"data-cui-space":a,"data-cui-measure":n==="p"?"reading":void 0,"data-testid":o,id:i,tabIndex:d,ref:s,children:l}));var Sr=/\s/,Fe=(e,t)=>{if(e===""||Sr.test(e))throw new RangeError(`The id of ${t} must be one token without whitespace: "${e}"`);return e},z=(e,t)=>{if(e!==void 0){if(e.reason!==void 0){if(e.reason.trim()==="")throw new RangeError("An unavailable control needs a reason that is not blank");return t}return Fe(e.reasonId,"an unavailable control's reason")}},K=(...e)=>{let t=e.filter(r=>r!==void 0);return t.length===0?void 0:t.join(" ")};var $r={primary:{fg:"on-solid",surface:"info-solid",type:"body"},secondary:{fg:"fg",surface:void 0,type:"body"},danger:{fg:"on-solid",surface:"danger-solid",type:"body"},link:{fg:"info-fg",surface:void 0,type:"body"}},Ae=({subject:e,children:t})=>{let r=_react.useRef.call(void 0, null);return H(r,e),_jsxruntime.jsx.call(void 0, "span",{ref:r,children:t})},F= exports.Button =({variant:e,children:t,testId:r,type:n="button",onClick:a,unavailable:o,describedBy:i,expanded:d,controls:s,ref:l,dataAttributes:p,busy:u,busyLabel:c})=>{g();let y=_react.useId.call(void 0, ),f=z(o,y),m=u===!0||o!==void 0,h=$r[e],T=x=>{if(m){x.preventDefault();return}_optionalChain([a, 'optionalCall', _2 => _2(x)])};return _jsxruntime.jsxs.call(void 0, "span",{className:"cui-button-group",children:[_jsxruntime.jsx.call(void 0, "button",{className:"cui-button",type:n==="submit"?"submit":"button","data-cui-variant":e,"data-cui-fg":h.fg,"data-cui-surface":h.surface,"data-cui-type":h.type,"data-testid":r,"aria-disabled":m?!0:void 0,"aria-busy":u===!0?!0:void 0,"aria-describedby":K(i,f),"aria-expanded":d,"aria-controls":s,onClick:T,ref:l,...w(p),children:_jsxruntime.jsx.call(void 0, Ae,{subject:{testId:r,part:"label",host:"button"},children:u===!0?c:t})}),_optionalChain([o, 'optionalAccess', _3 => _3.reason])===void 0?null:_jsxruntime.jsx.call(void 0, P,{fg:"fg-muted",type:"body",id:y,testId:`${r}-reason`,children:o.reason})]})},Fr= exports.Link =({onNavigate:e,children:t,testId:r,ref:n})=>(g(),_jsxruntime.jsx.call(void 0, "button",{className:"cui-link",type:"button","data-cui-fg":"info-fg","data-cui-type":"body","data-testid":r,onClick:e,ref:n,children:_jsxruntime.jsx.call(void 0, Ae,{subject:{testId:r,part:"label",host:"button"},children:t})})),Ar=/^[^\s#]+$/,Dr= exports.FragmentLink =({targetId:e,children:t,testId:r,onFollow:n,dataAttributes:a})=>{if(g(),!Ar.test(e))throw new RangeError(`A fragment link needs the target's id without "#" or white space: "${e}"`);return _jsxruntime.jsx.call(void 0, "a",{className:"cui-link",href:`#${e}`,"data-cui-fg":"info-fg","data-cui-type":"body","data-testid":r,onClick:n,...w(a),children:_jsxruntime.jsx.call(void 0, Ae,{subject:{testId:r,part:"label",host:"link"},children:t})})};var Ur=229,Kr=new Set(["text","search","email","url","tel","password","number","date","datetime-local","month","time","week"]),De=e=>e instanceof HTMLTextAreaElement?e.value!=="":e instanceof HTMLInputElement&&Kr.has(e.type)&&(e.value!==""||e.validity.badInput),B=(e,t)=>{e.key!=="Escape"||e.nativeEvent.isComposing||e.keyCode===Ur||De(e.target)||(e.stopPropagation(),t())},Br= exports.useEscapeToClose =e=>_react.useCallback.call(void 0, t=>B(t,e),[e]);var Ct=e=>e===void 0?void 0:t=>B(t,e),He= exports.Card =({id:e,title:t,description:r,actions:n,onEscape:a,testId:o,headingRef:i,ref:d,dataAttributes:s,children:l})=>{g();let p=_react.useId.call(void 0, ),u=Ct(a);return _jsxruntime.jsxs.call(void 0, "section",{className:"cui-card",id:e,"aria-labelledby":p,"data-cui-surface":"surface","data-cui-fg":"fg","data-cui-type":"body","data-cui-face":"sans","data-testid":o,ref:d,onKeyDown:u,...w(s),children:[_jsxruntime.jsxs.call(void 0, "div",{className:"cui-card-header",children:[_jsxruntime.jsxs.call(void 0, "div",{className:"cui-card-heading",children:[_jsxruntime.jsx.call(void 0, "h2",{className:"cui-card-title",id:p,"data-cui-type":"title","data-testid":`${o}-heading`,ref:i,tabIndex:i===void 0?void 0:-1,children:t}),r===void 0?null:_jsxruntime.jsx.call(void 0, "div",{className:"cui-card-description","data-cui-fg":"fg-muted","data-cui-type":"body","data-cui-measure":"reading",children:r})]}),n===void 0?null:_jsxruntime.jsx.call(void 0, "div",{className:"cui-card-actions",children:n})]}),l]})},_r={3:"h3",4:"h4"},qr= exports.CardSection =({id:e,title:t,subtitle:r,level:n=3,region:a=!1,onEscape:o,testId:i,headingRef:d,ref:s,dataAttributes:l,children:p})=>{g();let u=_react.useId.call(void 0, ),c=Ct(o),y=_r[n],f=_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsxs.call(void 0, "div",{className:"cui-card-section-heading",children:[_jsxruntime.jsx.call(void 0, y,{className:"cui-card-section-title",id:u,"data-cui-type":"body","data-testid":`${i}-heading`,ref:d,tabIndex:d===void 0?void 0:-1,children:t}),r===void 0?null:_jsxruntime.jsx.call(void 0, "div",{className:"cui-card-section-subtitle","data-cui-fg":"fg-muted","data-cui-type":"body","data-cui-measure":"reading",children:r})]}),p]});return a?_jsxruntime.jsx.call(void 0, "section",{className:"cui-card-section",id:e,"aria-labelledby":u,"data-testid":i,ref:s,onKeyDown:c,...w(l),children:f}):_jsxruntime.jsx.call(void 0, "div",{className:"cui-card-section",id:e,"data-testid":i,ref:s,...w(l),children:f})};var Vr=({label:e,code:t,testId:r})=>(g(),_jsxruntime.jsx.call(void 0, "section",{className:"cui-code-frame",tabIndex:0,"aria-label":e,"data-cui-surface":"sunken","data-testid":r,children:_jsxruntime.jsx.call(void 0, "pre",{className:"cui-code","data-cui-fg":"fg","data-cui-type":"body","data-cui-face":"mono","data-testid":`${r}-code`,children:t})}));var J=({ruleKey:e,css:t})=>_jsxruntime.jsx.call(void 0, "style",{href:e,precedence:"cui",children:t});var Jr=({caption:e,attributes:t,columns:r,attributePx:n,columnMinPx:a,testId:o})=>{g();let i=_react.useId.call(void 0, );for(let u of[n,a])if(!(Number.isFinite(u)&&u>0))throw new RangeError(`ComparisonGrid widths must be positive px values: ${u}`);if(r.length===0)throw new RangeError("ComparisonGrid needs at least one column");for(let u of r)for(let c of t)if(!Object.hasOwn(u.cells,c.key))throw new RangeError(`Column "${u.key}" has no value for attribute "${c.key}"`);let d=n+r.length*a,s=`cui-comparison-a${n}-c${a}-n${r.length}`,l=u=>`[data-cui-comparison="${s}"][data-cui-comparison-layout="${u}"]`,p=`${l("table")}{display:none}@container (min-width:${_chunkK7BETTSLcjs.T.call(void 0, d)}){${l("table")}{display:block}${l("stack")}{display:none}}`;return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-container","data-cui-stack-below-px":d,"data-testid":o,children:[_jsxruntime.jsx.call(void 0, J,{ruleKey:s,css:p}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-comparison-frame","data-cui-comparison":s,"data-cui-comparison-layout":"table",children:_jsxruntime.jsxs.call(void 0, "table",{className:"cui-comparison-table","data-cui-type":"body",children:[_jsxruntime.jsx.call(void 0, "caption",{className:"cui-visually-hidden",children:e}),_jsxruntime.jsxs.call(void 0, "colgroup",{children:[_jsxruntime.jsx.call(void 0, "col",{style:{width:_chunkK7BETTSLcjs.T.call(void 0, n)}}),r.map(u=>_jsxruntime.jsx.call(void 0, "col",{},u.key))]}),_jsxruntime.jsx.call(void 0, "thead",{children:_jsxruntime.jsxs.call(void 0, "tr",{children:[_jsxruntime.jsx.call(void 0, "td",{}),r.map(u=>_jsxruntime.jsx.call(void 0, "th",{scope:"col",children:u.heading},u.key))]})}),_jsxruntime.jsx.call(void 0, "tbody",{children:t.map(u=>_jsxruntime.jsxs.call(void 0, "tr",{children:[_jsxruntime.jsx.call(void 0, "th",{scope:"row",children:u.label}),r.map(c=>_jsxruntime.jsx.call(void 0, "td",{children:c.cells[u.key]("table")},c.key))]},u.key))})]})}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-comparison-stack","data-cui-comparison":s,"data-cui-comparison-layout":"stack",children:r.map((u,c)=>{let y=`${i}-column-${c}`;return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-comparison-column",role:"group","aria-labelledby":y,"data-cui-type":"body",children:[_jsxruntime.jsx.call(void 0, "div",{className:"cui-comparison-heading",id:y,children:u.heading}),_jsxruntime.jsx.call(void 0, "dl",{className:"cui-comparison-list",children:t.map(f=>_jsxruntime.jsxs.call(void 0, "div",{children:[_jsxruntime.jsx.call(void 0, "dt",{children:f.label}),_jsxruntime.jsx.call(void 0, "dd",{children:u.cells[f.key]("stack")})]},f.key))})]},u.key)})})]})};var ne="[data-cui-row-focus]",Oe="[data-cui-row-detail]",Xr=e=>e===null?[]:[...e.querySelectorAll(`:scope > ${ne}`)],kt=(e,t)=>{let r=new Map;t!==null&&r.set(t,0);let n=-1;for(let a of e===null?[]:e.children)a.matches(ne)?(n+=1,r.set(a,n)):n>=0&&a.matches(Oe)&&r.set(a,n);return r},Lt=(e,t,r,n)=>{let a=Xr(t);if(a.length===0)return r;let o=n.get(e);if(o===void 0)throw new RangeError(`rowFocusTarget: <${e.localName}> left holding focus with no position in the table (only its rows, row details and empty text hold one)`);return a[Math.min(o,a.length-1)]};var Zr=e=>e+1,oe= exports.useFocusRescue =e=>{let t=_react.useRef.call(void 0, e),r=_react.useRef.call(void 0, null),n=_react.useRef.call(void 0, !1),[,a]=_react.useReducer.call(void 0, Zr,0),o=_react.useCallback.call(void 0, (i=>()=>{n.current&&i.contains(document.activeElement)&&(r.current=i,a())}),[]);return _react.useLayoutEffect.call(void 0, ()=>(n.current=!0,()=>{n.current=!1,r.current=null}),[]),_react.useLayoutEffect.call(void 0, ()=>{t.current=e}),_react.useLayoutEffect.call(void 0, ()=>{let i=r.current;if(i===null)return;r.current=null;let d=[null,document.body].includes(document.activeElement);i.isConnected||!d||_optionalChain([t, 'access', _4 => _4.current, 'call', _5 => _5(i), 'optionalAccess', _6 => _6.focus, 'call', _7 => _7()])}),o};var rn=new Map,nn='a[href], audio[controls], button, details, embed, iframe, img[usemap], input:not([type="hidden"]), label, select, textarea, video[controls], [tabindex], [contenteditable]',on=(e,t,r)=>{_react.useLayoutEffect.call(void 0, ()=>{let n=e.current;if(t!=="row-compact"||n===null)return;let a=[...n.querySelectorAll(nn)].find(o=>o.parentElement!==n);if(a!==void 0)throw new RangeError(`${r}: a compact row holds no control or focus target (a ${_chunkK7BETTSLcjs.x} px target does not fit its ${_chunkK7BETTSLcjs.z} px; use row-control), not <${a.localName}>`)})},an=(e,t)=>{let r=e.filter(a=>a.rowHeader===!0).map(a=>a.key);if(r.length>1)throw new RangeError(`${t}: a table has at most one row header column, not ${r.length} (${r.join(", ")})`);let n=e.find(a=>a.rowHeader!==!0&&a.rowHeaderNote!==void 0);if(n!==void 0)throw new RangeError(`${t}: a row header note belongs to the row header column, not to ${n.key}`)},sn=e=>e==null?null:_jsxruntime.jsx.call(void 0, "div",{className:"cui-table-header-note",children:e}),dn=(e,t,r,n,a)=>{let o=e.open(t);return _jsxruntime.jsx.call(void 0, "tr",{ref:a,hidden:!o,"data-cui-row-detail":o?"open":"closed","data-testid":`${n}-detail`,children:_jsxruntime.jsx.call(void 0, "td",{colSpan:r,id:e.id(t),children:o?e.render(t):null})})},ln= exports.DataTable =({caption:e,captionHidden:t,columns:r,rows:n,rowKey:a,rowTestId:o,rowData:i,rowSize:d,rowDetail:s,empty:l,testId:p,ref:u})=>{g();let c=_react.useId.call(void 0, ),y=_react.useRef.call(void 0, null);on(y,d,p);let f=_react.useRef.call(void 0, null),m=_react.useRef.call(void 0, rn),h=oe(b=>Lt(b,y.current,f.current,m.current));_react.useLayoutEffect.call(void 0, ()=>{m.current=kt(y.current,f.current)});let T=_react.useCallback.call(void 0, b=>{f.current=b;let R=h(b);return()=>{f.current=null,R()}},[h]),x=_chunkK7BETTSLcjs.W.call(void 0, r);return an(r,p),_jsxruntime.jsx.call(void 0, "div",{className:"cui-container","data-testid":p,ref:u,children:n.length===0?_jsxruntime.jsx.call(void 0, P,{as:"p",fg:"fg-muted",type:"prose",tabIndex:-1,ref:T,testId:`${p}-empty`,children:l}):_jsxruntime.jsx.call(void 0, "section",{ref:h,className:"cui-table-frame",tabIndex:0,"aria-labelledby":c,"data-testid":`${p}-frame`,children:_jsxruntime.jsxs.call(void 0, "table",{className:"cui-table","data-cui-type":"body","data-cui-row-size":d,style:{"--cui-table-min":_chunkK7BETTSLcjs.T.call(void 0, x)},children:[_jsxruntime.jsx.call(void 0, "caption",{className:t?"cui-visually-hidden":"cui-table-caption",id:c,children:e}),_jsxruntime.jsx.call(void 0, "colgroup",{children:r.map(b=>_jsxruntime.jsx.call(void 0, "col",{style:b.width.fixedPx===void 0?void 0:{width:_chunkK7BETTSLcjs.T.call(void 0, b.width.fixedPx)}},b.key))}),_jsxruntime.jsx.call(void 0, "thead",{children:_jsxruntime.jsx.call(void 0, "tr",{children:r.map(b=>_jsxruntime.jsxs.call(void 0, "th",{scope:"col","data-cui-align":b.align,"data-cui-surface":"subtle","data-cui-type":"caption",children:[b.header,b.note===void 0?null:_jsxruntime.jsx.call(void 0, "div",{className:"cui-table-header-note",children:b.note})]},b.key))})}),_jsxruntime.jsx.call(void 0, "tbody",{ref:y,children:n.map(b=>_jsxruntime.jsxs.call(void 0, _react.Fragment,{children:[_jsxruntime.jsx.call(void 0, "tr",{ref:h,tabIndex:-1,"data-cui-row-focus":"","data-testid":o,...w(_optionalChain([i, 'optionalCall', _8 => _8(b)])),children:r.map(R=>R.rowHeader===!0?_jsxruntime.jsxs.call(void 0, "th",{scope:"row","data-cui-align":R.align,children:[R.cell(b),R.rowHeaderNote===void 0?null:sn(R.rowHeaderNote(b))]},R.key):_jsxruntime.jsx.call(void 0, "td",{"data-cui-align":R.align,children:R.cell(b)},R.key))}),s===void 0?null:dn(s,b,r.length,o,h)]},a(b)))})]})})})};var un=({items:e,testId:t})=>{if(g(),new Set(e.map(r=>r.key)).size!==e.length)throw new RangeError(`Description keys must be unique: ${e.map(r=>r.key).join(", ")}`);return _jsxruntime.jsx.call(void 0, "dl",{className:"cui-description-list","data-cui-type":"body","data-testid":t,children:e.map(r=>_jsxruntime.jsxs.call(void 0, "div",{className:"cui-description-row","data-testid":`${t}-${r.key}`,children:[_jsxruntime.jsx.call(void 0, "dt",{"data-cui-fg":"fg-secondary",children:r.term}),_jsxruntime.jsx.call(void 0, "dd",{"data-cui-fg":"fg",children:r.description})]},r.key))})};var Ft=e=>{e instanceof HTMLElement&&e.isConnected&&e.focus()},pn= exports.Dialog =({title:e,description:t,open:r,onClose:n,testId:a,children:o})=>{let{labels:i}=k(),d=_react.useId.call(void 0, ),s=_react.useId.call(void 0, ),l=_react.useRef.call(void 0, null),p=_react.useRef.call(void 0, null);return _react.useLayoutEffect.call(void 0, ()=>{let y=l.current;r&&!y.open?(p.current=y.ownerDocument.activeElement,y.showModal()):!r&&y.open&&y.close()},[r]),_react.useLayoutEffect.call(void 0, ()=>{let y=l.current;return()=>{y.open&&(y.close(),Ft(p.current),p.current=null)}},[]),_jsxruntime.jsxs.call(void 0, "dialog",{className:"cui-dialog","aria-labelledby":d,"aria-describedby":t===void 0?void 0:s,"data-cui-surface":"surface","data-cui-fg":"fg","data-cui-type":"body","data-cui-face":"sans","data-testid":a,ref:l,onClose:y=>{y.currentTarget.open||(Ft(p.current),p.current=null,r&&n())},onCancel:y=>{De(y.currentTarget.ownerDocument.activeElement)&&y.preventDefault()},children:[_jsxruntime.jsxs.call(void 0, "div",{className:"cui-dialog-header",children:[_jsxruntime.jsx.call(void 0, "h2",{className:"cui-dialog-title",id:d,"data-cui-type":"title",children:e}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-dialog-actions",children:_jsxruntime.jsx.call(void 0, F,{variant:"secondary",testId:`${a}-close`,onClick:()=>_optionalChain([l, 'access', _9 => _9.current, 'optionalAccess', _10 => _10.close, 'call', _11 => _11()]),children:i.close})})]}),t===void 0?null:_jsxruntime.jsx.call(void 0, "div",{id:s,"data-cui-measure":"reading","data-testid":`${a}-description`,children:t}),o,_jsxruntime.jsx.call(void 0, "div",{className:"cui-visually-hidden",role:"status","aria-live":"polite","aria-atomic":"true",[$e]:"","data-testid":`${a}-announcer`})]})};var mn=({summary:e,open:t,onOpenChange:r,testId:n,children:a})=>{g();let o=_react.useId.call(void 0, ),i=_react.useRef.call(void 0, null);return H(i,{testId:n,part:"summary",host:"button"}),_jsxruntime.jsxs.call(void 0, "div",{className:"cui-disclosure","data-testid":n,children:[_jsxruntime.jsxs.call(void 0, "button",{className:"cui-disclosure-button",type:"button","aria-expanded":t,"aria-controls":o,"data-cui-fg":"fg","data-cui-type":"body","data-testid":`${n}-button`,onClick:()=>r(!t),children:[_jsxruntime.jsx.call(void 0, "span",{className:"cui-disclosure-marker","aria-hidden":"true",children:t?"\u25BE":"\u25B8"}),_jsxruntime.jsx.call(void 0, "span",{ref:i,children:e})]}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-disclosure-panel",id:o,hidden:!t,"data-testid":`${n}-panel`,children:a})]})};var j=({description:e,error:t,errorId:r})=>{g();let n=_react.useId.call(void 0, ),a=_react.useId.call(void 0, ),o=_react.useId.call(void 0, ),i=r===void 0?o:Fe(r,"a field's error"),d=[e===void 0?null:a,t===void 0?null:i].filter(l=>l!==null).join(" ");return{control:{id:n,"aria-describedby":d===""?void 0:d,"aria-invalid":t===void 0?void 0:!0},descriptionId:a,errorId:i}},Y=({description:e,error:t,descriptionId:r,errorId:n,testId:a})=>_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[e===void 0?null:_jsxruntime.jsx.call(void 0, P,{as:"p",fg:"fg-muted",type:"body",id:r,testId:`${a}-description`,children:e}),t===void 0?null:_jsxruntime.jsx.call(void 0, P,{as:"p",fg:"danger-fg",type:"body",id:n,testId:`${a}-error`,children:t})]}),fe=({htmlFor:e,hidden:t,children:r})=>_jsxruntime.jsx.call(void 0, "label",{className:t===!0?"cui-visually-hidden":"cui-field-label",htmlFor:e,"data-cui-type":"body",children:r}),gn= exports.Field =({label:e,description:t,error:r,errorId:n,testId:a,children:o})=>{let{control:i,descriptionId:d,errorId:s}=j({label:e,description:t,error:r,errorId:n});return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-field","data-invalid":r!==void 0,"data-testid":a,children:[_jsxruntime.jsx.call(void 0, fe,{htmlFor:i.id,hidden:void 0,children:e}),o(i),_jsxruntime.jsx.call(void 0, Y,{description:t,error:r,descriptionId:d,errorId:s,testId:a})]})},Ht=({label:e,description:t,error:r,errorId:n,value:a,onValueChange:o,type:i,list:d,autoComplete:s,inputMode:l,prefix:p,labelHidden:u,required:c,testId:y,ref:f})=>{let{control:m,descriptionId:h,errorId:T}=j({label:e,description:t,error:r,errorId:n}),x=_react.useId.call(void 0, );if(p!==void 0&&p.trim()==="")throw new RangeError("An input's prefix must not be blank");let b=i==="password",R=_jsxruntime.jsx.call(void 0, "input",{className:"cui-input",type:i,value:a,list:d,autoComplete:s,inputMode:l,spellCheck:b?!1:void 0,autoCapitalize:b?"none":void 0,required:c,onChange:v=>o(v.target.value),"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"body","data-testid":y,ref:f,...m,"aria-describedby":K(p===void 0?void 0:x,m["aria-describedby"])});return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-field","data-invalid":r!==void 0,"data-testid":`${y}-field`,children:[_jsxruntime.jsx.call(void 0, fe,{htmlFor:m.id,hidden:u,children:e}),p===void 0?R:_jsxruntime.jsxs.call(void 0, "div",{className:"cui-input-group",children:[_jsxruntime.jsx.call(void 0, "span",{className:"cui-input-prefix",id:x,"data-cui-fg":"fg-secondary","data-cui-surface":"sunken","data-cui-type":"body","data-testid":`${y}-prefix`,children:p}),R]}),_jsxruntime.jsx.call(void 0, Y,{description:t,error:r,descriptionId:h,errorId:T,testId:y})]})},bn= exports.TextInput =e=>_jsxruntime.jsx.call(void 0, Ht,{...e}),hn= exports.PasswordInput =e=>_jsxruntime.jsx.call(void 0, Ht,{...e,type:"password"}),Rn= exports.TextArea =({label:e,description:t,error:r,errorId:n,value:a,onValueChange:o,required:i,testId:d,ref:s})=>{let{control:l,descriptionId:p,errorId:u}=j({label:e,description:t,error:r,errorId:n});return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-field","data-invalid":r!==void 0,"data-testid":`${d}-field`,children:[_jsxruntime.jsx.call(void 0, fe,{htmlFor:l.id,hidden:void 0,children:e}),_jsxruntime.jsx.call(void 0, "textarea",{className:"cui-input cui-textarea",value:a,required:i,onChange:c=>o(c.target.value),"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"prose","data-testid":d,ref:s,...l}),_jsxruntime.jsx.call(void 0, Y,{description:t,error:r,descriptionId:p,errorId:u,testId:d})]})},Tn= exports.Select =({label:e,description:t,error:r,errorId:n,value:a,options:o,onValueChange:i,labelHidden:d,unavailable:s,testId:l,ref:p})=>{let{control:u,descriptionId:c,errorId:y}=j({label:e,description:t,error:r,errorId:n}),f=_react.useId.call(void 0, ),m=z(s,f);return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-field","data-invalid":r!==void 0,"data-testid":`${l}-field`,children:[_jsxruntime.jsx.call(void 0, fe,{htmlFor:u.id,hidden:d,children:e}),_jsxruntime.jsx.call(void 0, "select",{className:"cui-input",value:a,onChange:h=>{s===void 0&&i(h.target.value)},"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"body","data-testid":l,ref:p,...u,"aria-disabled":s===void 0?void 0:!0,"aria-describedby":K(u["aria-describedby"],m),children:o.map(h=>_jsxruntime.jsx.call(void 0, "option",{value:h.value,children:h.label},h.value))}),_jsxruntime.jsx.call(void 0, Y,{description:t,error:r,descriptionId:c,errorId:y,testId:l}),_optionalChain([s, 'optionalAccess', _12 => _12.reason])===void 0?null:_jsxruntime.jsx.call(void 0, P,{as:"p",fg:"fg-muted",type:"body",id:f,testId:`${l}-reason`,children:s.reason})]})},xn= exports.RadioGroup =({legend:e,description:t,error:r,errorId:n,value:a,options:o,onValueChange:i,testId:d,ref:s})=>{let l=_react.useId.call(void 0, ),{control:p,descriptionId:u,errorId:c}=j({label:e,description:t,error:r,errorId:n});return _jsxruntime.jsxs.call(void 0, "fieldset",{className:"cui-radio-group","aria-describedby":p["aria-describedby"],"data-invalid":r!==void 0,"data-testid":d,children:[_jsxruntime.jsx.call(void 0, "legend",{className:"cui-radio-group-legend","data-cui-type":"body",children:e}),o.map((y,f)=>_jsxruntime.jsxs.call(void 0, "label",{className:"cui-radio","data-cui-type":"body",children:[_jsxruntime.jsx.call(void 0, "input",{type:"radio",name:l,value:y.value,checked:y.value===a,onChange:()=>i(y.value),"aria-invalid":p["aria-invalid"],"data-testid":`${d}-option-${y.value}`,ref:f===0?s:void 0}),_jsxruntime.jsx.call(void 0, "span",{children:y.label})]},y.value)),_jsxruntime.jsx.call(void 0, Y,{description:t,error:r,descriptionId:u,errorId:c,testId:d})]})},vn= exports.CheckboxGroup =({legend:e,description:t,error:r,errorId:n,values:a,options:o,onValuesChange:i,testId:d,ref:s})=>{let{control:l,descriptionId:p,errorId:u}=j({label:e,description:t,error:r,errorId:n}),c=o.map(m=>m.value);if(c.length===0||new Set(c).size!==c.length)throw new RangeError(`A check box group needs at least one option with unique values: ${c.join(", ")}`);let y=a.filter(m=>!c.includes(m));if(y.length>0)throw new RangeError(`The chosen values are not options: ${y.join(", ")}`);let f=new Set(a);return _jsxruntime.jsxs.call(void 0, "fieldset",{className:"cui-checkbox-group","aria-describedby":l["aria-describedby"],"data-invalid":r!==void 0,"data-testid":d,children:[_jsxruntime.jsx.call(void 0, "legend",{className:"cui-checkbox-group-legend","data-cui-type":"body",children:e}),o.map((m,h)=>_jsxruntime.jsxs.call(void 0, "label",{className:"cui-checkbox","data-cui-type":"body",children:[_jsxruntime.jsx.call(void 0, "input",{type:"checkbox",value:m.value,checked:f.has(m.value),onChange:()=>i(c.filter(T=>T===m.value?!f.has(T):f.has(T))),"aria-invalid":l["aria-invalid"],"data-testid":`${d}-option-${m.value}`,ref:h===0?s:void 0}),_jsxruntime.jsx.call(void 0, "span",{children:m.label})]},m.value)),_jsxruntime.jsx.call(void 0, Y,{description:t,error:r,descriptionId:p,errorId:u,testId:d})]})};var qt=_react.createContext.call(void 0, null),Ot="surface",Ut={neutral:{face:"surface",line:"border-control"},info:{face:"info-tint",line:"info-accent"},success:{face:"success-tint",line:"success-accent"},warning:{face:"warning-tint",line:"warning-accent"},danger:{face:"danger-tint",line:"danger-accent"}},Kt={face:"info-tint",line:"info-accent"},Gt={normal:"border-control",high:"info-accent"},Nn=["normal","high"],kn=[1,2,3,4],A=_chunkK7BETTSLcjs.A.space["space-2"],Ln="fg",Sn="fg-secondary",Vt=e=>{let t=_react.useContext.call(void 0, qt);if(t===null)throw new Error(`${e} must be rendered inside Figure`);return t},Ge=(e,t,r)=>{if(!(Number.isFinite(r)&&r>0&&r%4===0))throw new RangeError(`${e}: ${t} must be a positive multiple of the ${4} px lattice: ${r}`)},Mn= exports.Figure =e=>{g();let t=_react.useId.call(void 0, ),{kind:r,widthPx:n,heightPx:a,testId:o,dataAttributes:i,children:d}=e;Ge(o,"widthPx",n),Ge(o,"heightPx",a);let s=_react.useMemo.call(void 0, ()=>({kind:r,widthPx:n,heightPx:a,arrowIds:{normal:`${t}-arrow-normal`,high:`${t}-arrow-high`}}),[r,n,a,t]),l=_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, "defs",{children:Nn.map(y=>_jsxruntime.jsx.call(void 0, "marker",{id:s.arrowIds[y],viewBox:`0 0 ${A} ${A}`,refX:A,refY:A/2,markerWidth:A,markerHeight:A,markerUnits:"userSpaceOnUse",orient:"auto","data-cui-emphasis":y,children:_jsxruntime.jsx.call(void 0, "path",{d:`M 0 0 L ${A} ${A/2} L 0 ${A} z`,"data-cui-stroke":Gt[y],"data-testid":`${o}-arrow-${y}`})},y))}),_jsxruntime.jsx.call(void 0, qt.Provider,{value:s,children:d})]});if(e.kind==="group"){let{label:y,onEscape:f}=e;if(!_chunkK7BETTSLcjs.f.call(void 0, y))throw new RangeError(`${o}: a group figure's label must hold a readable character: ${JSON.stringify(y)}`);return _jsxruntime.jsx.call(void 0, "div",{className:"cui-figure-frame","data-testid":`${o}-frame`,children:_jsxruntime.jsx.call(void 0, "svg",{className:"cui-figure",role:"group","aria-label":y,viewBox:`0 0 ${n} ${a}`,"data-cui-figure":"group","data-cui-surface":Ot,"data-cui-face":"sans",style:{"--cui-figure-inline":_chunkK7BETTSLcjs.T.call(void 0, n),"--cui-figure-block":_chunkK7BETTSLcjs.T.call(void 0, a)},onKeyDown:f===void 0?void 0:m=>B(m,f),"data-testid":o,...w(i),children:l})})}let{viewBox:p,pointer:u,svgRef:c}=e;return _jsxruntime.jsx.call(void 0, "div",{className:"cui-container","data-testid":`${o}-frame`,children:_jsxruntime.jsx.call(void 0, "svg",{ref:c,className:"cui-figure","aria-hidden":"true",viewBox:p===void 0?`0 0 ${n} ${a}`:p,"data-cui-figure":"decorative","data-cui-surface":Ot,"data-cui-face":"sans","data-cui-pan":u===void 0?void 0:"true","data-cui-cursor":_optionalChain([u, 'optionalAccess', _13 => _13.cursor]),style:{"--cui-figure-inline":_chunkK7BETTSLcjs.T.call(void 0, n),"--cui-figure-ratio":String(a/n)},"data-testid":o,...w(i),..._optionalChain([u, 'optionalAccess', _14 => _14.handlers]),children:l})})},Bt=(e,t)=>{try{return t()}catch(r){throw new RangeError(`${e}: ${r.message}`,{cause:r})}},In=(e,t,r)=>{for(let n of t){let a=_chunk7M4I26BScjs.d.light[n.fg],o=r.find(i=>a[i]===void 0);if(o!==void 0)throw new RangeError(`${e}: the note ${JSON.stringify(n.text)} in ${n.fg} is not in the contrast table on ${o}, a face the node takes`)}},$n= exports.FigureNode =e=>{g();let t=Vt("FigureNode"),r=_react.useId.call(void 0, ),{x:n,y:a,shape:o,tone:i,outline:d,selected:s,name:l,title:p,press:u,testId:c,dataAttributes:y}=e,f=e.notes===void 0?[]:e.notes;if(!(Number.isFinite(n)&&Number.isFinite(a)))throw new RangeError(`${c}: a node's position must be finite: ${n}, ${a}`);if(t.kind==="group"&&u===void 0)throw new RangeError(`${c}: every node of a group figure must be pressable (pass press)`);if(t.kind==="decorative"&&u!==void 0)throw new RangeError(`${c}: a node of a decorative figure cannot be pressed (it is hidden from assistive technology)`);if(u!==void 0&&!_chunkK7BETTSLcjs.f.call(void 0, u.label))throw new RangeError(`${c}: a pressable node's label must hold a readable character: ${JSON.stringify(u.label)}`);let m=s?Kt:Ut[i];In(c,f,[Ut[i].face,Kt.face]);let h,T,x;if(o.kind==="box"){if(l===null)throw new RangeError(`${c}: a box's name is drawn inside the box and sizes it, so it cannot be null (only a disc may be drawn without a name)`);let R=Bt(c,()=>_chunkK7BETTSLcjs.N.call(void 0, {name:l,notes:f.map(M=>M.text)}));if(Ge(c,"a box's widthPx",o.widthPx),o.widthPx<R.minWidthPx)throw new RangeError(`${c}: a box ${o.widthPx} px wide is narrower than its lines under the widest 1.4.12 spacing (${R.minWidthPx} px)`);h={width:o.widthPx,height:R.heightPx,left:n,top:a};let v=_chunkK7BETTSLcjs.O.call(void 0, f.length);T=_jsxruntime.jsxs.call(void 0, "g",{"data-cui-surface":m.face,children:[_jsxruntime.jsx.call(void 0, "rect",{className:"cui-figure-plate",width:o.widthPx,height:R.heightPx,rx:_chunkK7BETTSLcjs.A.radius["radius-item"],"data-cui-fill":m.face,"data-cui-stroke":m.line,"data-testid":`${c}-plate`}),_jsxruntime.jsx.call(void 0, "text",{className:"cui-figure-name",x:v.insetPx,y:v.namePx,fontSize:_chunkK7BETTSLcjs.A.type.body.size,"data-cui-fg":Ln,"data-cui-figure-type":"body","data-testid":`${c}-name`,children:l}),f.map((M,ee)=>_jsxruntime.jsx.call(void 0, "text",{x:v.insetPx,y:v.notesPx[ee],fontSize:_chunkK7BETTSLcjs.A.type.caption.size,"data-cui-fg":M.fg,"data-cui-figure-type":"caption","data-testid":`${c}-note-${ee}`,children:M.text},ee))]}),x=_jsxruntime.jsx.call(void 0, "rect",{className:"cui-figure-ring",x:-_chunkK7BETTSLcjs.R,y:-_chunkK7BETTSLcjs.R,width:o.widthPx+2*_chunkK7BETTSLcjs.R,height:R.heightPx+2*_chunkK7BETTSLcjs.R,rx:_chunkK7BETTSLcjs.A.radius["radius-item"]+_chunkK7BETTSLcjs.R,"data-cui-stroke":"focus","data-testid":`${c}-ring`})}else{let R=Bt(c,()=>_chunkK7BETTSLcjs.P.call(void 0, l,o.radiusPx));h={width:2*o.radiusPx,height:2*o.radiusPx,left:n-o.radiusPx,top:a-o.radiusPx},T=_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, "g",{"data-cui-surface":m.face,children:_jsxruntime.jsx.call(void 0, "circle",{className:"cui-figure-plate",r:o.radiusPx,"data-cui-fill":m.face,"data-cui-stroke":m.line,"data-testid":`${c}-plate`})}),l===null?null:_jsxruntime.jsx.call(void 0, "text",{className:"cui-figure-label",x:0,y:R.extentBelowPx-_chunkK7BETTSLcjs.A.type.caption.lineHeight/2,fontSize:_chunkK7BETTSLcjs.A.type.caption.size,"data-cui-fg":Sn,"data-cui-figure-type":"caption","data-testid":`${c}-name`,children:l})]}),x=_jsxruntime.jsx.call(void 0, "circle",{className:"cui-figure-ring",r:o.radiusPx+_chunkK7BETTSLcjs.R,"data-cui-stroke":"focus","data-testid":`${c}-ring`})}if(u!==void 0){if(h.width<_chunkK7BETTSLcjs.x||h.height<_chunkK7BETTSLcjs.x)throw new RangeError(`${c}: a pressable node must be at least the ${_chunkK7BETTSLcjs.x} px target: ${h.width} \xD7 ${h.height}`);if(h.left<_chunkK7BETTSLcjs.Q||h.top<_chunkK7BETTSLcjs.Q||h.left+h.width+_chunkK7BETTSLcjs.Q>t.widthPx||h.top+h.height+_chunkK7BETTSLcjs.Q>t.heightPx)throw new RangeError(`${c}: a pressable node must keep ${_chunkK7BETTSLcjs.Q} px to the figure's edge for its focus ring`)}let b=u===void 0?{}:{role:"button",tabIndex:0,"aria-label":u.label,"aria-describedby":u.description===void 0?void 0:r,"aria-expanded":u.expanded,"aria-controls":u.expanded?u.controls:void 0,onClick:R=>{R.currentTarget.focus(),u.onPress()},onKeyDown:R=>{R.key!=="Enter"&&R.key!==" "||(R.preventDefault(),R.repeat||u.onPress())}};return _jsxruntime.jsxs.call(void 0, "g",{className:"cui-figure-node",transform:`translate(${n} ${a})`,"data-cui-tone":i,"data-cui-outline":d,"data-selected":String(s),...b,"data-testid":c,...w(y),children:[p===void 0?null:_jsxruntime.jsx.call(void 0, "title",{children:p}),_optionalChain([u, 'optionalAccess', _15 => _15.description])===void 0?null:_jsxruntime.jsx.call(void 0, "desc",{id:r,"data-testid":`${c}-description`,children:u.description}),u===void 0?null:x,T]})},Fn= exports.FigureEdge =({d:e,emphasis:t,weight:r,arrow:n,title:a,testId:o,dataAttributes:i})=>{g();let d=Vt("FigureEdge");if(!kn.includes(r))throw new RangeError(`${o}: an edge's weight must be 1, 2, 3 or 4: ${r}`);return _jsxruntime.jsx.call(void 0, "path",{className:"cui-figure-edge",d:e,markerEnd:n?`url(#${d.arrowIds[t]})`:void 0,"data-cui-stroke":Gt[t],"data-cui-weight":r,"data-cui-emphasis":t,"data-testid":o,...w(i),children:a===void 0?null:_jsxruntime.jsx.call(void 0, "title",{children:a})})};var An={1:"h1",2:"h2",3:"h3"},Dn= exports.Heading =({level:e,type:t,testId:r,headingRef:n,children:a})=>{g();let o=An[e];return _jsxruntime.jsx.call(void 0, o,{className:"cui-heading","data-cui-type":t,"data-cui-fg":"fg","data-testid":r,ref:n,tabIndex:n===void 0?void 0:-1,children:a})};var On={removed:"danger-tint",added:"success-tint"},Un= exports.InlineChange =({kind:e,testId:t,children:r})=>{if(g(),r==="")throw new RangeError(`${t}: a changed fragment must hold at least one character`);return _jsxruntime.jsx.call(void 0, e==="removed"?"del":"ins",{className:"cui-change","data-cui-change":e,"data-cui-surface":On[e],"data-cui-fg":"fg","data-testid":t,children:r})};var Bn={neutral:{fg:"fg-secondary",surface:"sunken"},info:{fg:"info-fg",surface:"info-tint"},success:{fg:"success-fg",surface:"success-tint"},warning:{fg:"warning-fg",surface:"warning-tint"},danger:{fg:"danger-fg",surface:"danger-tint"}},_n={neutral:"neutral-solid",info:"info-solid",success:"success-solid",warning:"warning-solid",danger:"danger-solid"},Ve= exports.Pill =({tone:e,variant:t,testId:r,dataAttributes:n,children:a})=>{g();let o=t==="tint"?Bn[e]:{fg:"on-solid",surface:_n[e]};return _jsxruntime.jsx.call(void 0, "span",{className:"cui-pill","data-cui-tone":e,"data-cui-variant":t,"data-cui-fg":o.fg,"data-cui-surface":o.surface,"data-cui-type":"caption","data-testid":r,...w(n),children:a})};var We=({label:e,valueText:t,value:r,max:n,testId:a})=>{g();let o=_react.useId.call(void 0, );if(n!==null){if(!(Number.isFinite(n)&&n>0))throw new RangeError(`Progress maximum must be positive: ${n}`);if(r===null||!(Number.isFinite(r)&&r>=0))throw new RangeError(`A determinate progress value must be a number >= 0: ${r}`)}let i=n===null?null:{max:n,now:Math.min(r,n)};return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-progress","data-testid":a,children:[_jsxruntime.jsx.call(void 0, P,{as:"p",fg:"fg",type:"body",id:o,children:e}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-progress-track",role:"progressbar","aria-labelledby":o,"aria-valuetext":t,"aria-valuemin":i===null?void 0:0,"aria-valuemax":_optionalChain([i, 'optionalAccess', _16 => _16.max]),"aria-valuenow":_optionalChain([i, 'optionalAccess', _17 => _17.now]),"data-cui-surface":"sunken","data-cui-indeterminate":i===null,"data-testid":`${a}-bar`,children:_jsxruntime.jsx.call(void 0, "div",{className:"cui-progress-fill","data-cui-accent":"info-accent",style:i===null?void 0:{inlineSize:`${i.now/i.max*100}%`},"data-testid":`${a}-fill`})}),_jsxruntime.jsx.call(void 0, "div",{"aria-hidden":"true",children:_jsxruntime.jsx.call(void 0, P,{as:"p",fg:"fg-secondary",type:"body",testId:`${a}-value`,children:t})})]})};var Wn=({title:e,status:t,progress:r,cancel:n,testId:a,children:o})=>_jsxruntime.jsxs.call(void 0, He,{title:e,actions:n===void 0?void 0:_jsxruntime.jsx.call(void 0, F,{variant:"secondary",busy:n.busy,busyLabel:n.busyLabel,onClick:n.onCancel,testId:`${a}-cancel`,children:n.label}),testId:a,children:[_jsxruntime.jsxs.call(void 0, "div",{className:"cui-job-status",role:"status","aria-live":"polite","aria-atomic":"true","data-testid":`${a}-status`,children:[_jsxruntime.jsx.call(void 0, "span",{className:"cui-visually-hidden",children:`${e} `}),_jsxruntime.jsx.call(void 0, Ve,{tone:t.tone,variant:"tint",testId:`${a}-status-pill`,children:t.label})]}),r===void 0?null:_jsxruntime.jsx.call(void 0, We,{...r,testId:`${a}-progress`}),o]});var ze=_react.createContext.call(void 0, null),Xn="space-2",jn= exports.List =e=>{g();let{gap:t,label:r,id:n,hidden:a,testId:o,children:i}=e;if(r!==void 0&&!_chunkK7BETTSLcjs.f.call(void 0, r))throw new RangeError(`${o}: a list's label must hold a readable character: ${JSON.stringify(r)}`);let d=e.marker==="none"?void 0:e.type,s=d!==void 0,l=e.marker==="number"||e.marker==="none"&&e.ordered?"ol":"ul";return _jsxruntime.jsx.call(void 0, ze.Provider,{value:e.marker,children:_jsxruntime.jsx.call(void 0, l,{className:"cui-list",role:"list","aria-label":r,id:n,hidden:a,"data-cui-gap":s?void 0:t,"data-cui-row-gap":s?t:void 0,"data-cui-column-gap":s?Xn:void 0,"data-cui-marker":s?e.marker:void 0,"data-cui-type":d,"data-testid":o,children:i})})},Yn= exports.ListItem =({testId:e,dataAttributes:t,children:r})=>{g();let n=_react.useContext.call(void 0, ze);if(n===null)throw new Error("ListItem must be rendered inside List, not inside another ListItem");return _jsxruntime.jsx.call(void 0, "li",{className:"cui-list-item","data-testid":e,...w(t),children:_jsxruntime.jsx.call(void 0, "div",{className:"cui-list-body","data-cui-measure":n==="none"?void 0:"reading",children:_jsxruntime.jsx.call(void 0, ze.Provider,{value:null,children:r})})})};var Zn=({tone:e,testId:t,children:r})=>(g(),_jsxruntime.jsx.call(void 0, "div",{className:"cui-notice","data-cui-tone":e,"data-cui-surface":e==="info"?"info-tint":"warning-tint","data-cui-fg":"fg","data-cui-type":"prose","data-cui-measure":"reading","data-testid":t,children:r})),de= exports.AlertMessage =({occurrence:e,testId:t,children:r})=>(g(),_jsxruntime.jsx.call(void 0, "div",{className:"cui-alert",role:"alert","data-cui-surface":"danger-tint","data-cui-fg":"danger-fg","data-cui-type":"prose","data-cui-measure":"reading","data-cui-occurrence":e,"data-testid":t,children:r},e));var jt=e=>[...e.querySelectorAll(ne)].filter(t=>{let r=t.closest(Oe);return r===null||!e.contains(r)}),eo=e=>{let t=e.ref.current;if(t===null)throw new Error("LoadMore: rows.ref is not attached to the element holding the rows");let r=jt(t);if(r.length!==e.count)throw new Error(`LoadMore: rows.ref holds ${r.length} ${ne} elements for ${e.count} rows`);return r},to=(e,t)=>{let r=-1;return e.forEach((n,a)=>{t.has(n)&&(r=a)}),e[r+1]},ro= exports.LoadMore =({onLoad:e,busy:t,done:r,failure:n,limit:a,rows:o,testId:i})=>{let{formatLocale:d,labels:s}=k(),l=_react.useRef.call(void 0, null),p=_react.useRef.call(void 0, null),u=_react.useRef.call(void 0, null),c=_react.useRef.call(void 0, !1),y=()=>{let T=o.ref.current;l.current={shown:new Set(T===null?[]:jt(T)),failureOccurrence:n===null?null:n.occurrence,busySeen:!1},e()};_react.useLayoutEffect.call(void 0, ()=>{let T=c.current;c.current=!1;let x=l.current;if(x===null)return;let b=eo(o);if(t){x.busySeen=!0,x.shown=new Set(b);return}let R=to(b,x.shown),v=n!==null&&n.occurrence!==x.failureOccurrence;if(!(x.busySeen||R!==void 0||v||r)||(l.current=null,v||R===void 0))return;let M=[null,document.body].includes(document.activeElement);(u.current!==null&&document.activeElement===u.current||T&&M)&&R.focus()});let f=oe(()=>r?p.current:u.current),m=_react.useCallback.call(void 0, (T=>{u.current=T;let x=f(T);return()=>{u.current=null,c.current=T===document.activeElement,x()}}),[f]),h=_react.useCallback.call(void 0, (T=>{p.current=T;let x=f(T);return()=>{p.current=null,x()}}),[f]);return r?_jsxruntime.jsx.call(void 0, "div",{className:"cui-load-more","data-testid":i,children:_jsxruntime.jsx.call(void 0, P,{as:"p",fg:"fg-muted",type:"body",tabIndex:-1,ref:h,testId:`${i}-end`,children:s.endOfRecords})}):_jsxruntime.jsxs.call(void 0, "div",{className:"cui-load-more","data-testid":i,children:[_jsxruntime.jsx.call(void 0, F,{variant:"secondary",busy:t,busyLabel:s.loading,onClick:y,ref:m,testId:`${i}-button`,children:s.loadMore(_chunkK7BETTSLcjs.a.call(void 0, a,d))}),n===null?null:_jsxruntime.jsx.call(void 0, de,{occurrence:n.occurrence,testId:`${i}-failure`,children:s.loadFailed(n.reason)})]})};var oo=({master:e,detail:t,masterMinPx:r,detailMinPx:n,testId:a})=>{g();let o=_chunkK7BETTSLcjs.V.call(void 0, {masterMinPx:r,detailMinPx:n,gapPx:_chunkK7BETTSLcjs.A.space["space-6"]});return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-container","data-testid":a,children:[_jsxruntime.jsx.call(void 0, J,{ruleKey:o.key,css:o.css}),_jsxruntime.jsxs.call(void 0, "div",{className:"cui-master-detail","data-cui-master-detail":o.key,children:[_jsxruntime.jsx.call(void 0, "div",{className:"cui-master-detail-pane","data-testid":`${a}-master`,children:e}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-master-detail-pane","data-testid":`${a}-detail`,children:t})]})]})};var Te=e=>{let{formatLocale:t,labels:r}=k(),{testId:n}=e;if(e.keep===void 0){let{value:i,unit:d}=e;if(d!==void 0&&!_chunkK7BETTSLcjs.f.call(void 0, d))throw new RangeError(`${n}: a unit must hold a readable character: ${JSON.stringify(d)}`);if(i===null)return _jsxruntime.jsx.call(void 0, "span",{className:"cui-measured","data-measured":"false","data-testid":n,children:r.unmeasured});let s=_chunkK7BETTSLcjs.a.call(void 0, i,t);return _jsxruntime.jsx.call(void 0, "span",{className:"cui-measured","data-measured":"true","data-testid":n,children:_chunkK7BETTSLcjs.c.call(void 0, s,d)})}let{text:a,keep:o}=e;if(a===null)return _jsxruntime.jsx.call(void 0, "span",{className:"cui-measured","data-measured":"false","data-cui-keep":o,"data-testid":n,children:r.unmeasured});if(!_chunkK7BETTSLcjs.f.call(void 0, a))throw new RangeError(`${n}: a measured text must hold a readable character (pass null when the value was not measured): ${JSON.stringify(a)}`);return _jsxruntime.jsx.call(void 0, "span",{className:"cui-measured","data-measured":"true","data-cui-keep":o,"data-testid":n,children:a})};var ao=({label:e,value:t,min:r,max:n,valueText:a,testId:o})=>{if(g(),!(Number.isFinite(r)&&Number.isFinite(n)&&r<n))throw new RangeError(`Meter needs a finite range with min below max: min ${r}, max ${n}`);if(!(Number.isFinite(t)&&t>=r&&t<=n))throw new RangeError(`Meter value must be a finite number in its range: value ${t}, min ${r}, max ${n}`);return _jsxruntime.jsxs.call(void 0, "span",{className:"cui-meter","data-testid":o,children:[_jsxruntime.jsx.call(void 0, "span",{className:"cui-meter-track",role:"meter","aria-label":e,"aria-valuemin":r,"aria-valuemax":n,"aria-valuenow":t,"aria-valuetext":a,"data-cui-surface":"sunken","data-testid":`${o}-bar`,children:_jsxruntime.jsx.call(void 0, "span",{className:"cui-meter-fill","data-cui-accent":"info-accent",style:{inlineSize:`${(t-r)/(n-r)*100}%`},"data-testid":`${o}-fill`})}),_jsxruntime.jsx.call(void 0, "span",{"aria-hidden":"true",children:_jsxruntime.jsx.call(void 0, P,{fg:"fg",type:"body",testId:`${o}-value`,children:a})})]})};var uo={ArrowLeft:-1,ArrowRight:1},co= exports.PanelTabs =({label:e,items:t,value:r,onValueChange:n,testId:a,panelDescribedBy:o,children:i})=>{g();let d=_react.useId.call(void 0, ),s=_react.useRef.call(void 0, new Map);if(t.length===0)throw new RangeError("PanelTabs needs at least one tab");let l=t.map(m=>m.id);if(new Set(l).size!==l.length)throw new RangeError(`Tab keys must be unique: ${l.join(", ")}`);let p=l.indexOf(r);if(p<0)throw new RangeError(`The selected tab "${r}" is not one of the tabs: ${l.join(", ")}`);let u=m=>`${d}-tab-${m}`,c=`${d}-panel`,y=m=>{let h=t[m];h.id!==r&&n(h.id),_optionalChain([s, 'access', _18 => _18.current, 'access', _19 => _19.get, 'call', _20 => _20(h.id), 'optionalAccess', _21 => _21.focus, 'call', _22 => _22()])};return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-panel-tabs","data-testid":a,children:[_jsxruntime.jsx.call(void 0, "div",{className:"cui-tabs-list",role:"tablist","aria-label":e,onKeyDown:m=>{let h=t.findIndex(R=>s.current.get(R.id)===m.target),T=h<0?p:h,x=uo[m.key],b;if(x!==void 0){let R=getComputedStyle(m.currentTarget).direction==="rtl"?-x:x;b=(T+R+t.length)%t.length}else if(m.key==="Home")b=0;else if(m.key==="End")b=t.length-1;else return;m.preventDefault(),y(b)},children:t.map((m,h)=>{let T=h===p;return _jsxruntime.jsx.call(void 0, "button",{className:"cui-tab cui-panel-tab",type:"button",role:"tab",id:u(h),"aria-selected":T,"aria-controls":c,tabIndex:T?0:-1,"data-cui-fg":T?"fg":"fg-secondary","data-cui-type":"body","data-testid":`${a}-${m.id}`,ref:x=>{x===null?s.current.delete(m.id):s.current.set(m.id,x)},onClick:()=>y(h),children:m.label},m.id)})}),_jsxruntime.jsx.call(void 0, "div",{role:"tabpanel",id:c,"aria-labelledby":u(p),"aria-describedby":o,"data-testid":`${a}-panel`,children:i})]})};var yo=({failure:e,onReload:t,forbiddenMessage:r,failureMessage:n,rescueRef:a,testId:o})=>{let{labels:i}=k();return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-resource-failed","data-testid":o,children:[_jsxruntime.jsx.call(void 0, de,{occurrence:e.occurrence,testId:`${o}-alert`,children:i.failureSentence(e,r,n===void 0?i.loadFailed:n)}),e.status===403?null:_jsxruntime.jsx.call(void 0, F,{variant:"secondary",busy:e.retrying,busyLabel:i.loading,onClick:t,ref:a,testId:`${o}-reload`,children:i.reload})]})};var mo=({label:e,options:t,value:r,onValueChange:n,testId:a})=>{g();let o=new Set(t.map(i=>i.value));if(t.length<2||o.size!==t.length)throw new RangeError(`A segmented control needs at least two options with unique values: ${t.map(i=>i.value).join(", ")}`);if(!o.has(r))throw new RangeError(`The pressed value "${r}" is not one of the options: ${[...o].join(", ")}`);return _jsxruntime.jsxs.call(void 0, "fieldset",{className:"cui-segmented-group","data-testid":a,children:[_jsxruntime.jsx.call(void 0, "legend",{className:"cui-segmented-legend","data-cui-type":"body",children:e}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-segmented",children:t.map(i=>{let d=i.value===r;return _jsxruntime.jsx.call(void 0, "button",{className:"cui-segment",type:"button","aria-pressed":d,"data-cui-fg":d?"on-solid":"fg","data-cui-surface":d?"info-solid":void 0,"data-cui-type":"body","data-testid":`${a}-${i.value}`,onClick:()=>{d||n(i.value)},children:i.label},i.value)})})]})};var Qt=({selected:e,controls:t,onSelect:r,testId:n,dataAttributes:a,ref:o,children:i})=>{g();let d=_react.useRef.call(void 0, null);H(d,{testId:n,part:"row",host:"button"});let s=_react.useCallback.call(void 0, l=>{if(d.current=l,typeof o=="function")return o(l);o!=null&&(o.current=l)},[o]);return _jsxruntime.jsx.call(void 0, "button",{className:"cui-row-button",type:"button","data-selected":e,"aria-expanded":e,"aria-controls":t,"data-cui-row-focus":"","data-cui-surface":e?"info-tint":"surface","data-cui-fg":"fg","data-cui-type":"body","data-testid":n,onClick:r,ref:s,...w(a),children:i})},Ro= exports.SelectableList =({label:e,items:t,itemKey:r,selectedKey:n,onSelect:a,detailId:o,renderRow:i,rowTestId:d,rowData:s,empty:l,testId:p,ref:u})=>(g(),_jsxruntime.jsx.call(void 0, "div",{className:"cui-selectable","data-testid":p,ref:u,children:t.length===0?_jsxruntime.jsx.call(void 0, P,{as:"p",fg:"fg-muted",type:"prose",testId:`${p}-empty`,children:l}):_jsxruntime.jsx.call(void 0, "ul",{className:"cui-selectable-list",role:"list","aria-label":e,children:t.map(c=>{let y=r(c);return _jsxruntime.jsx.call(void 0, "li",{children:_jsxruntime.jsx.call(void 0, Qt,{selected:y===n,controls:o,onSelect:()=>a(c),testId:d,dataAttributes:_optionalChain([s, 'optionalCall', _23 => _23(c)]),children:i(c)})},y)})})}));var xo=({label:e,value:t,min:r,max:n,step:a,valueText:o,onValueChange:i,testId:d})=>{g();let s=_react.useId.call(void 0, );if(!([t,r,n,a].every(Number.isFinite)&&r<n&&a>0&&r<=t&&t<=n))throw new RangeError(`Slider needs finite min < max, a positive step and min <= value <= max: value ${t}, min ${r}, max ${n}, step ${a}`);let l=o(t);return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-field","data-testid":`${d}-field`,children:[_jsxruntime.jsx.call(void 0, "label",{className:"cui-field-label",htmlFor:s,"data-cui-type":"body",children:e}),_jsxruntime.jsxs.call(void 0, "div",{className:"cui-slider",children:[_jsxruntime.jsx.call(void 0, "input",{className:"cui-slider-input",id:s,type:"range",min:r,max:n,step:a,value:t,"aria-valuetext":l,"data-testid":d,onChange:p=>i(p.currentTarget.valueAsNumber)}),_jsxruntime.jsx.call(void 0, "span",{className:"cui-slider-value","aria-hidden":"true",children:_jsxruntime.jsx.call(void 0, P,{fg:"fg",type:"body",testId:`${d}-value`,children:l})})]})]})};var vo=({gap:e,testId:t,children:r})=>(g(),_jsxruntime.jsx.call(void 0, "div",{className:"cui-stack","data-cui-gap":e,"data-testid":t,children:r})),Eo= exports.Cluster =({gap:e,as:t="div",testId:r,children:n})=>(g(),_jsxruntime.jsx.call(void 0, t,{className:"cui-cluster","data-cui-gap":e,"data-testid":r,children:n}));var rr={done:0,current:1,pending:2},wo={done:{fg:"on-solid",surface:"success-solid"},current:{fg:"on-solid",surface:"info-solid"},pending:{fg:"fg-secondary",surface:void 0}},Po= exports.Stepper =({label:e,steps:t,testId:r})=>{let{labels:n}=k();if(t.length===0||new Set(t.map(o=>o.id)).size!==t.length)throw new RangeError(`A stepper needs at least one step with unique keys: ${t.map(o=>o.id).join(", ")}`);if(t.filter(o=>o.state==="current").length>1||t.some((o,i)=>i>0&&rr[o.state]<rr[t[i-1].state]))throw new RangeError(`Step states must run done, at most one current, then pending: ${t.map(o=>o.state).join(", ")}`);let a={done:n.stepDone,current:null,pending:n.stepPending};return _jsxruntime.jsx.call(void 0, "ol",{className:"cui-stepper",role:"list","aria-label":e,"data-cui-type":"body","data-testid":r,children:t.map((o,i)=>{let d=wo[o.state],s=a[o.state];return _jsxruntime.jsxs.call(void 0, "li",{className:"cui-step","aria-current":o.state==="current"?"step":void 0,"data-cui-step":o.state,"data-testid":`${r}-${o.id}`,children:[_jsxruntime.jsx.call(void 0, "span",{className:"cui-step-marker","aria-hidden":"true","data-cui-fg":d.fg,"data-cui-surface":d.surface,"data-cui-type":"caption",children:o.state==="done"?"\u2713":i+1}),_jsxruntime.jsxs.call(void 0, "span",{className:"cui-step-label","data-cui-fg":"fg",children:[o.label,s===null?null:_jsxruntime.jsx.call(void 0, "span",{className:"cui-visually-hidden",children:` (${s})`})]})]},o.id)})})};var ko=({label:e,labelHidden:t,checked:r,onCheckedChange:n,unavailable:a,testId:o,ref:i,dataAttributes:d})=>{g();let s=_react.useId.call(void 0, ),l=_react.useRef.call(void 0, null);H(l,{testId:o,part:"label",host:"button"});let p=z(a,s),u=a!==void 0,c=_jsxruntime.jsxs.call(void 0, "button",{className:"cui-switch",type:"button",role:"switch","aria-checked":r,"aria-disabled":u?!0:void 0,"aria-describedby":K(p),"data-cui-fg":"fg","data-cui-type":"body","data-testid":o,ref:i,onClick:()=>{u||n(!r)},...w(d),children:[_jsxruntime.jsx.call(void 0, "span",{className:"cui-switch-track","aria-hidden":"true","data-cui-surface":r?"info-solid":"sunken","data-testid":`${o}-track`,children:_jsxruntime.jsx.call(void 0, "span",{className:"cui-switch-thumb","data-cui-surface":r?"surface":"neutral-solid","data-testid":`${o}-thumb`})}),_jsxruntime.jsx.call(void 0, "span",{className:t===!0?"cui-visually-hidden":void 0,ref:l,children:e})]});return _optionalChain([a, 'optionalAccess', _24 => _24.reason])===void 0?c:_jsxruntime.jsxs.call(void 0, "span",{className:"cui-button-group",children:[c,_jsxruntime.jsx.call(void 0, P,{fg:"fg-muted",type:"body",id:s,testId:`${o}-reason`,children:a.reason})]})};var $o=({label:e,items:t,currentId:r,onNavigate:n,testId:a,collapsible:o=!1})=>{if(g(),t.length===0)throw new RangeError("Tabs needs at least one tab");let i=new Set(t.map(f=>f.id));if(i.size!==t.length)throw new RangeError(`Tab keys must be unique: ${t.map(f=>f.id).join(", ")}`);let d=t.find(f=>f.id===r);if(d===void 0)throw new RangeError(`The current tab "${r}" is not one of the tabs: ${[...i].join(", ")}`);let[s,l]=_react.useState.call(void 0, !1),p=_react.useRef.call(void 0, null),u=_react.useRef.call(void 0, null),c=_react.useId.call(void 0, ),y=_react.useCallback.call(void 0, f=>{l(!1),f&&_optionalChain([p, 'access', _25 => _25.current, 'optionalAccess', _26 => _26.contains, 'call', _27 => _27(document.activeElement)])&&_optionalChain([u, 'access', _28 => _28.current, 'optionalAccess', _29 => _29.focus, 'call', _30 => _30()])},[]);return _react.useEffect.call(void 0, ()=>{if(!(o&&s))return;let f=m=>{p.current!==null&&!p.current.contains(m.target)&&y(!0)};return document.addEventListener("pointerdown",f,!0),()=>document.removeEventListener("pointerdown",f,!0)},[o,s,y]),_jsxruntime.jsxs.call(void 0, "nav",{ref:p,className:"cui-tabs","aria-label":e,"data-testid":a,"data-cui-collapsible":o?"":void 0,"data-cui-open":o&&s?"":void 0,onKeyDown:o&&s?f=>B(f,()=>y(!0)):void 0,children:[o?_jsxruntime.jsxs.call(void 0, "button",{ref:u,type:"button",className:"cui-tabs-summary","aria-expanded":s,"aria-controls":c,"data-cui-fg":"fg","data-cui-type":"body","data-testid":`${a}-summary`,onClick:()=>l(f=>!f),children:[_jsxruntime.jsx.call(void 0, "span",{className:"cui-tabs-summary-label",children:d.label}),_jsxruntime.jsx.call(void 0, "span",{className:"cui-tabs-summary-marker","aria-hidden":"true",children:s?"\u25B4":"\u25BE"})]}):null,_jsxruntime.jsx.call(void 0, "ul",{className:"cui-tabs-list",id:c,role:"list","data-cui-surface":o?"surface":void 0,children:t.map(f=>{let m=f.id===r;return _jsxruntime.jsx.call(void 0, "li",{className:"cui-tabs-item",children:_jsxruntime.jsx.call(void 0, "a",{className:"cui-tab",href:f.href,"aria-current":m?"page":void 0,"data-cui-fg":m?"fg":"fg-secondary","data-cui-type":"body","data-testid":`${a}-${f.id}`,onClick:h=>{pe(h,f.href,n),h.defaultPrevented&&y(!1)},children:f.label})},f.id)})})]})};var Ho={neutral:"fg",danger:"danger-fg",warning:"warning-fg",success:"success-fg"},Oo= exports.MetricTile =e=>{g();let{label:t,sublabel:r,tone:n,testId:a,dataAttributes:o}=e;if((e.text===void 0?e.value===null:e.text===null)&&n!=="neutral")throw new RangeError(`An unmeasured tile value carries no tone: ${n}`);let d=`${a}-value`;return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-tile","data-cui-surface":"subtle","data-cui-fg":"fg","data-cui-tone":n,"data-testid":a,...w(o),children:[_jsxruntime.jsx.call(void 0, "p",{className:"cui-tile-label","data-cui-type":"caption","data-cui-measure":"reading",children:t}),_jsxruntime.jsx.call(void 0, "p",{className:"cui-tile-sublabel","data-cui-fg":"fg-muted","data-cui-type":"caption","data-cui-measure":"reading",children:r}),_jsxruntime.jsx.call(void 0, "p",{className:"cui-tile-value","data-cui-fg":Ho[n],"data-cui-type":"heading","data-cui-measure":"reading",children:e.text===void 0?_jsxruntime.jsx.call(void 0, Te,{value:e.value,unit:e.unit,testId:d}):_jsxruntime.jsx.call(void 0, Te,{text:e.text,keep:"wrap",testId:d})})]})},sr=e=>_react.Children.toArray(e).flatMap(t=>{if(!_react.isValidElement.call(void 0, t))throw new RangeError(`TileGrid children must be tile elements, not text: ${String(t)}`);return t.type===_react.Fragment?sr(t.props.children):[t]}),Uo= exports.TileGrid =({count:e,minInlinePx:t,testId:r,children:n})=>{g();let a=_chunkK7BETTSLcjs.Y.call(void 0, e,t,_chunkK7BETTSLcjs.A.space["space-2"]),o=sr(n).length;if(o!==e)throw new RangeError(`TileGrid has ${o} tiles but count is ${e}`);return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-container","data-testid":r,children:[_jsxruntime.jsx.call(void 0, J,{ruleKey:a.key,css:a.css}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-tile-grid","data-cui-tile-grid":a.key,"data-cui-gap":"space-2",children:n})]})};var we=e=>[...e.querySelectorAll("button")],Bo= exports.Toolbar =({label:e,testId:t,children:r})=>{g();let n=_react.useRef.call(void 0, null),a=_react.useRef.call(void 0, null);_react.useLayoutEffect.call(void 0, ()=>{let s=we(n.current),l=a.current!==null&&s.includes(a.current)?a.current:_nullishCoalesce(s[0], () => (null));a.current=l;for(let p of s)p.tabIndex=p===l?0:-1});let o=s=>{for(let l of we(n.current))l.tabIndex=l===s?0:-1;a.current=s};return _jsxruntime.jsx.call(void 0, "div",{className:"cui-toolbar",role:"toolbar","aria-label":e,"aria-orientation":"horizontal","data-testid":t,ref:n,onFocus:s=>{let l=we(s.currentTarget).find(p=>p.contains(s.target));l!==void 0&&o(l)},onKeyDown:s=>{let l=we(s.currentTarget),p=l.indexOf(s.target);if(p===-1)return;let u=getComputedStyle(s.currentTarget).direction==="rtl"?"ArrowLeft":"ArrowRight",c=u==="ArrowRight"?"ArrowLeft":"ArrowRight",f={[u]:(p+1)%l.length,[c]:(p-1+l.length)%l.length,Home:0,End:l.length-1}[s.key];if(f===void 0)return;s.preventDefault();let m=l[f];o(m),m.focus()},children:r})};var ur=e=>e===null?_chunkK7BETTSLcjs.o:_chunkK7BETTSLcjs.p,Ce=(e,t,r,n,a)=>{let[o,i]=_react.useState.call(void 0, ()=>({key:e,state:ur(e)})),[d,s]=_react.useState.call(void 0, 0),[l,p]=_react.useState.call(void 0, 0),u=_react.useRef.call(void 0, t),c=_react.useRef.call(void 0, null),y=_react.useRef.call(void 0, d);_react.useLayoutEffect.call(void 0, ()=>{u.current=t}),_react.useEffect.call(void 0, ()=>{if(e===null){i({key:null,state:_chunkK7BETTSLcjs.o});return}let b=new AbortController;c.current=e;let R=d===y.current?"revision":"reload";return y.current=d,i(v=>Object.is(v.key,e)?{key:e,state:n(v.state,R)}:{key:e,state:_chunkK7BETTSLcjs.p}),u.current(b.signal).then(v=>{b.signal.aborted||(c.current=null,i(M=>({key:e,state:a(M.state,v)})))},v=>{b.signal.aborted||i(()=>{throw v})}),()=>{b.abort(),c.current=null}},[e,r,d,l]);let f=_react.useCallback.call(void 0, ()=>s(b=>b+1),[]),m=_react.useCallback.call(void 0, ()=>p(b=>b+1),[]),h=_react.useCallback.call(void 0, (b,R)=>{i(v=>Object.is(v.key,b)?{key:b,state:R(v.state)}:v)},[]),T=_react.useCallback.call(void 0, (b,R)=>{h(b,R),Object.is(c.current,b)&&m()},[h,m]);return{state:Object.is(o.key,e)?o.state:ur(e),reload:f,refresh:m,update:h,write:T}};var Wo=(e,t,r)=>{let n=_react.useRef.call(void 0, t);_react.useLayoutEffect.call(void 0, ()=>{n.current=t});let a=_react.useCallback.call(void 0, T=>n.current.first(T),[]),{state:o,reload:i,refresh:d,update:s,write:l}=Ce(e,a,r,_chunkK7BETTSLcjs.Z,_chunkK7BETTSLcjs._),p=_react.useRef.call(void 0, {key:e,state:o});_react.useLayoutEffect.call(void 0, ()=>{p.current={key:e,state:o}});let u=_react.useRef.call(void 0, null),c=_react.useCallback.call(void 0, ()=>{_optionalChain([u, 'access', _31 => _31.current, 'optionalAccess', _32 => _32.controller, 'access', _33 => _33.abort, 'call', _34 => _34()]),u.current=null},[]);_react.useEffect.call(void 0, ()=>c,[e,r,c]);let y=_react.useCallback.call(void 0, ()=>{c(),i()},[c,i]),f=_react.useCallback.call(void 0, ()=>{c(),d()},[c,d]),m=_react.useCallback.call(void 0, ()=>{let{key:T,state:x}=p.current;if(T===null||x.kind!=="ready"||x.refreshing||x.value.next===null||x.value.loadingMore)throw new Error("usePagedResource: loadMore needs a shown list with a next cursor, no page in flight and no re-read in flight");let b=x.value.next,R={key:T,controller:new AbortController,maps:[]};u.current=R,s(T,_chunkK7BETTSLcjs.$),n.current.next(b,R.controller.signal).then(v=>{u.current===R&&(u.current=null,s(T,M=>R.maps.reduce((ee,pr)=>_chunkK7BETTSLcjs.ba.call(void 0, ee,pr),_chunkK7BETTSLcjs.aa.call(void 0, M,b,v))))},v=>{u.current===R&&s(T,()=>{throw v})})},[s]),h=_react.useCallback.call(void 0, (T,x)=>{let b=u.current;b!==null&&Object.is(b.key,T)&&b.maps.push(x),l(T,R=>_chunkK7BETTSLcjs.ba.call(void 0, R,x))},[l]);return{state:o,reload:y,refresh:f,loadMore:m,updateList:h}};var jo=e=>typeof e=="object"&&e!==null&&typeof e.then=="function",Yo= exports.usePendingPress =()=>{let[e,t]=_react.useState.call(void 0, null),r=_react.useRef.call(void 0, null),n=_react.useCallback.call(void 0, (a,o)=>{let i=o();if(!jo(i))return;let d=Symbol(a);r.current=d,t(a);let s=()=>{r.current===d&&(r.current=null,t(null))};i.then(s,s)},[]);return{pendingKey:e,press:n}};var Qo=(e,t,r)=>{let{state:n,reload:a,refresh:o,write:i}=Ce(e,t,r,_chunkK7BETTSLcjs.q,_chunkK7BETTSLcjs.r),d=_react.useCallback.call(void 0, (s,l)=>i(s,p=>_chunkK7BETTSLcjs.r.call(void 0, p,{ok:!0,value:l})),[i]);return{state:n,reload:a,refresh:o,put:d}};var ea=({testId:e,children:t})=>(g(),_jsxruntime.jsx.call(void 0, "span",{className:"cui-visually-hidden","data-testid":e,children:t}));exports.ANNOUNCE_SETTLE_MS = ce; exports.AlertMessage = de; exports.Breadcrumb = Pr; exports.Button = F; exports.COMPACT_ROW_PX = _chunkK7BETTSLcjs.z; exports.CONSOLE_UI_LABEL_CATALOGS = _chunkK7BETTSLcjs.t; exports.CONTRAST_MINIMUM = _chunk7M4I26BScjs.c; exports.CONTRAST_PAIRS = _chunk7M4I26BScjs.d; exports.Card = He; exports.CardSection = qr; exports.CheckboxGroup = vn; exports.Cluster = Eo; exports.CodeBlock = Vr; exports.ComparisonGrid = Jr; exports.ConsoleUiRoot = vr; exports.DataTable = ln; exports.DescriptionList = un; exports.Dialog = pn; exports.Disclosure = mn; exports.FIGURE_RING_REACH_PX = _chunkK7BETTSLcjs.Q; exports.FLEXIBLE_COLUMN_MIN_PX = _chunkK7BETTSLcjs.H; exports.Field = gn; exports.Figure = Mn; exports.FigureEdge = Fn; exports.FigureNode = $n; exports.FragmentLink = Dr; exports.HTTP_FORBIDDEN = _chunkK7BETTSLcjs.l; exports.Heading = Dn; exports.InlineChange = Un; exports.JobCard = Wn; exports.LATTICE_PX = _chunkK7BETTSLcjs.v; exports.Link = Fr; exports.List = jn; exports.ListItem = Yn; exports.LoadMore = ro; exports.MasterDetail = oo; exports.Measured = Te; exports.Meter = ao; exports.MetricTile = Oo; exports.Notice = Zn; exports.PanelTabs = co; exports.PasswordInput = hn; exports.Pill = Ve; exports.ProgressBar = We; exports.ROW_WITH_CONTROL_PX = _chunkK7BETTSLcjs.y; exports.RadioGroup = xn; exports.ResourceFailed = yo; exports.RowButton = Qt; exports.SegmentedControl = mo; exports.Select = Tn; exports.SelectableList = Ro; exports.Slider = xo; exports.Stack = vo; exports.Stepper = Po; exports.Switch = ko; exports.TARGET_PX = _chunkK7BETTSLcjs.x; exports.TOKENS = _chunkK7BETTSLcjs.A; exports.TONES = _chunkK7BETTSLcjs.ga; exports.TONE_HUES = _chunkK7BETTSLcjs.ea; exports.TONE_ROLES = _chunkK7BETTSLcjs.fa; exports.Tabs = $o; exports.Text = P; exports.TextArea = Rn; exports.TextInput = bn; exports.TileGrid = Uo; exports.Toolbar = Bo; exports.VisuallyHidden = ea; exports.ZonedTimeError = _chunkK7BETTSLcjs.g; exports.beginPage = _chunkK7BETTSLcjs.$; exports.beginPagedReload = _chunkK7BETTSLcjs.Z; exports.beginReload = _chunkK7BETTSLcjs.q; exports.ceil8 = _chunkK7BETTSLcjs.E; exports.ceilToLattice = _chunkK7BETTSLcjs.w; exports.cellContentInlinePx = _chunkK7BETTSLcjs.F; exports.comparisonAttributePx = _chunkK7BETTSLcjs.I; exports.contrastRatio = _chunk7M4I26BScjs.b; exports.countSampleText = _chunkK7BETTSLcjs.K; exports.cssVar = _chunkK7BETTSLcjs.B; exports.figureBoxPlan = _chunkK7BETTSLcjs.N; exports.figureDiscLabelPlan = _chunkK7BETTSLcjs.P; exports.fillLabel = _chunkK7BETTSLcjs.k; exports.fixedColumnPx = _chunkK7BETTSLcjs.G; exports.flatMapOutcome = _chunkK7BETTSLcjs.n; exports.formatByteSize = _chunkK7BETTSLcjs.b; exports.formatCount = _chunkK7BETTSLcjs.a; exports.formatInstant = _chunkK7BETTSLcjs.j; exports.goldenSectionPx = _chunkK7BETTSLcjs.S; exports.hexToSrgb = _chunk7M4I26BScjs.a; exports.instantSampleText = _chunkK7BETTSLcjs.J; exports.isReadableText = _chunkK7BETTSLcjs.f; exports.keepLastGood = _chunkK7BETTSLcjs.r; exports.lightDark = _chunkK7BETTSLcjs.ca; exports.mapOutcome = _chunkK7BETTSLcjs.m; exports.mapPagedList = _chunkK7BETTSLcjs.ba; exports.masterDetailPlan = _chunkK7BETTSLcjs.U; exports.monoTextWidthEm = _chunkK7BETTSLcjs.D; exports.placeholderRule = _chunkK7BETTSLcjs.da; exports.pxToRem = _chunkK7BETTSLcjs.T; exports.readDecimalText = _chunkK7BETTSLcjs.d; exports.readIntegerText = _chunkK7BETTSLcjs.e; exports.reasonAside = _chunkK7BETTSLcjs.s; exports.resolveConsoleUiLabels = _chunkK7BETTSLcjs.u; exports.settleFirstPage = _chunkK7BETTSLcjs._; exports.settlePage = _chunkK7BETTSLcjs.aa; exports.spacedTextWidthEm = _chunkK7BETTSLcjs.M; exports.tableFrameMinInlinePx = _chunkK7BETTSLcjs.X; exports.tableMinInlinePx = _chunkK7BETTSLcjs.W; exports.textWidthEm = _chunkK7BETTSLcjs.C; exports.tileGridPlan = _chunkK7BETTSLcjs.Y; exports.tileMinInlinePx = _chunkK7BETTSLcjs.L; exports.toOffsetIso = _chunkK7BETTSLcjs.h; exports.toWallTime = _chunkK7BETTSLcjs.i; exports.useAnnounce = Er; exports.useConsoleUi = k; exports.useEscapeToClose = Br; exports.useFocusRescue = oe; exports.usePagedResource = Wo; exports.usePendingPress = Yo; exports.useResource = Qo;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunkK7BETTSLcjs = require('./chunk-K7BETTSL.cjs');var _chunk7M4I26BScjs = require('./chunk-7M4I26BS.cjs');var _react = require('react');var _jsxruntime = require('react/jsx-runtime');var $e=_react.createContext.call(void 0, null),Ct=" ",xt='[inert], [aria-hidden="true" i]',Nt="dialog:modal",Ae="data-cui-dialog-announcer",xn=`:scope > [${Ae}]`,vn=e=>{if(e.closest(xt)!==null)return{hidden:'an ancestor is inert or aria-hidden="true"'};let t=e.ownerDocument,n=[...t.querySelectorAll(Nt)],r=t.activeElement,a=n.filter(s=>s.contains(r)),o=a.length>0?a:n;if(o.every(s=>s.contains(e)))return{region:e};let i=o.find(s=>o.every(u=>u.contains(s)));if(i===void 0)return{hidden:"focus is in no open modal dialog and they do not nest, so which one is topmost cannot be told"};let l=i.querySelector(xn);return l===null?{hidden:"the topmost open modal dialog neither contains the console nor is a Dialog"}:l.closest(xt)!==null?{hidden:'the topmost open modal dialog is a Dialog whose live region has an inert or aria-hidden="true" ancestor'}:{region:l}},wn=e=>{try{e.querySelectorAll(Nt)}catch(t){throw typeof t=="object"&&t!==null&&"name"in t&&t.name==="SyntaxError"?new Error("ConsoleUiRoot requires the :modal selector (Chrome 105, Firefox 103, Safari 15.6, jsdom 27 or later): announcements check whether a modal dialog hides the live region",{cause:t}):t}},ce= exports.ANNOUNCE_SETTLE_MS =150,Pn=1e3,vt=new WeakMap,Cn=(e,t)=>{let n=_nullishCoalesce(vt.get(e), () => (new Set)),r={text:t};vt.set(e,n.add(r)),setTimeout(()=>n.delete(r),ce);let a=e.ownerDocument.createElement("span");a.textContent=[...n].map(o=>o.text).join(Ct),e.replaceChildren(a)},Nn= exports.ConsoleUiRoot =({locale:e,formatLocale:t,timeZone:n,testId:r,children:a})=>{if(_react.useContext.call(void 0, $e)!==null)throw new Error("ConsoleUiRoot must not be rendered inside another ConsoleUiRoot (a console has exactly one root)");let i=_chunkK7BETTSLcjs.u.call(void 0, e),[l]=Intl.getCanonicalLocales(t),s=_react.useMemo.call(void 0, ()=>new Intl.DateTimeFormat(l,{timeZone:n}).resolvedOptions().timeZone,[l,n]),u=_react.useRef.call(void 0, null),p=_react.useRef.call(void 0, null);_react.useLayoutEffect.call(void 0, ()=>{wn(u.current.ownerDocument)},[]);let d=_react.useCallback.call(void 0, b=>{if(b.trim()==="")throw new RangeError("announce: text must be a non-empty sentence");let f=()=>{let{texts:T,settle:m,deadline:E}=p.current;p.current=null,clearTimeout(m),clearTimeout(E);let h=u.current;if(h===null)return;let R=T.join(Ct),x=vn(h);if("hidden"in x)throw new Error(`announce: the live region is hidden from assistive technology (${x.hidden}), so this announcement would be lost: ${R}`);Cn(x.region,R)},y=p.current;if(y===null){p.current={texts:[b],settle:setTimeout(f,ce),deadline:setTimeout(f,Pn)};return}y.texts.push(b),clearTimeout(y.settle),y.settle=setTimeout(f,ce)},[]),c=_react.useMemo.call(void 0, ()=>({locale:e,formatLocale:l,timeZone:s,labels:i,announce:d}),[e,l,s,i,d]);return _jsxruntime.jsx.call(void 0, $e.Provider,{value:c,children:_jsxruntime.jsxs.call(void 0, "div",{"data-cui-root":"","data-cui-surface":"surface","data-cui-fg":"fg","data-testid":r,children:[a,_jsxruntime.jsx.call(void 0, "div",{className:"cui-visually-hidden",role:"status","aria-live":"polite","aria-atomic":"true","data-testid":`${r}-announcer`,ref:u})]})})},k= exports.useConsoleUi =()=>{let e=_react.useContext.call(void 0, $e);if(e===null)throw new Error("useConsoleUi must be called inside ConsoleUiRoot");return e},g=()=>{k()},kn= exports.useAnnounce =()=>k().announce;var pe=(e,t,n)=>{e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||(e.preventDefault(),n(t))};var Mn=({items:e,current:t,onNavigate:n,testId:r})=>{let{labels:a}=k();if(new Set(e.map(o=>o.id)).size!==e.length)throw new RangeError(`Breadcrumb keys must be unique: ${e.map(o=>o.id).join(", ")}`);return _jsxruntime.jsx.call(void 0, "nav",{className:"cui-breadcrumb","aria-label":a.breadcrumb,"data-testid":r,children:_jsxruntime.jsxs.call(void 0, "ol",{className:"cui-breadcrumb-list",role:"list","data-cui-type":"body",children:[e.map(o=>_jsxruntime.jsxs.call(void 0, "li",{className:"cui-breadcrumb-item",children:[_jsxruntime.jsx.call(void 0, "a",{className:"cui-link",href:o.href,"data-cui-fg":"info-fg","data-cui-type":"body","data-testid":`${r}-${o.id}`,onClick:i=>pe(i,o.href,n),children:o.label}),_jsxruntime.jsx.call(void 0, "span",{className:"cui-breadcrumb-separator","aria-hidden":"true","data-cui-fg":"fg-muted",children:"\u203A"})]},o.id)),_jsxruntime.jsx.call(void 0, "li",{className:"cui-breadcrumb-item",children:_jsxruntime.jsx.call(void 0, "span",{"aria-current":"page","data-cui-fg":"fg","data-testid":`${r}-current`,children:t})})]})})};var w=e=>{if(e===void 0)return{};for(let t of Object.keys(e))if(!t.startsWith("data-")||t.startsWith("data-cui-")||t==="data-testid")throw new RangeError(`Caller attributes must be data-* and must not override data-cui-* or data-testid: ${t}`);return e};var ye=e=>{let t=e.currentTarget;t.ownerDocument.activeElement!==t&&t.focus({preventScroll:!0})};var In=new Set(["abbr","b","bdi","bdo","br","cite","code","data","del","dfn","em","i","ins","kbd","mark","q","s","samp","small","span","strong","sub","sup","time","u","var","wbr"]),$n=e=>{for(let t of e.querySelectorAll("*")){let n=t.localName;if(!In.has(n)||t.hasAttribute("tabindex")||t.hasAttribute("contenteditable"))return n}return null},H=(e,{testId:t,part:n,host:r})=>{_react.useLayoutEffect.call(void 0, ()=>{let a=$n(e.current);if(a!==null)throw new RangeError(`${t}: the ${n} is the content of a ${r} and holds only non-interactive phrasing content, not <${a}>`)})};var P=({fg:e,type:t,face:n,as:r="span",space:a,testId:o,id:i,tabIndex:l,ref:s,children:u})=>(g(),_jsxruntime.jsx.call(void 0, r,{className:"cui-text","data-cui-fg":e,"data-cui-type":t,"data-cui-face":n,"data-cui-space":a,"data-cui-measure":r==="p"?"reading":void 0,"data-testid":o,id:i,tabIndex:l,ref:s,children:u}));var Fn=/\s/,Fe=(e,t)=>{if(e===""||Fn.test(e))throw new RangeError(`The id of ${t} must be one token without whitespace: "${e}"`);return e},J=(e,t)=>{if(e!==void 0){if(e.reason!==void 0){if(e.reason.trim()==="")throw new RangeError("An unavailable control needs a reason that is not blank");return t}return Fe(e.reasonId,"an unavailable control's reason")}},B=(...e)=>{let t=e.filter(n=>n!==void 0);return t.length===0?void 0:t.join(" ")};var On={primary:{fg:"on-solid",surface:"info-solid",type:"body"},secondary:{fg:"fg",surface:void 0,type:"body"},danger:{fg:"on-solid",surface:"danger-solid",type:"body"},link:{fg:"info-fg",surface:void 0,type:"body"}},De=({subject:e,children:t})=>{let n=_react.useRef.call(void 0, null);return H(n,e),_jsxruntime.jsx.call(void 0, "span",{ref:n,children:t})},A= exports.Button =({variant:e,children:t,testId:n,type:r="button",onClick:a,unavailable:o,describedBy:i,expanded:l,controls:s,ref:u,dataAttributes:p,busy:d,busyLabel:c})=>{g();let b=_react.useId.call(void 0, ),f=J(o,b),y=d===!0||o!==void 0,T=On[e],m=E=>{if(ye(E),y){E.preventDefault();return}_optionalChain([a, 'optionalCall', _2 => _2(E)])};return _jsxruntime.jsxs.call(void 0, "span",{className:"cui-button-group",children:[_jsxruntime.jsx.call(void 0, "button",{className:"cui-button",type:r==="submit"?"submit":"button","data-cui-variant":e,"data-cui-fg":T.fg,"data-cui-surface":T.surface,"data-cui-type":T.type,"data-testid":n,"aria-disabled":y?!0:void 0,"aria-busy":d===!0?!0:void 0,"aria-describedby":B(i,f),"aria-expanded":l,"aria-controls":s,onClick:m,ref:u,...w(p),children:_jsxruntime.jsx.call(void 0, De,{subject:{testId:n,part:"label",host:"button"},children:d===!0?c:t})}),_optionalChain([o, 'optionalAccess', _3 => _3.reason])===void 0?null:_jsxruntime.jsx.call(void 0, P,{fg:"fg-muted",type:"body",id:b,testId:`${n}-reason`,children:o.reason})]})},Kn= exports.Link =({onNavigate:e,children:t,testId:n,ref:r})=>(g(),_jsxruntime.jsx.call(void 0, "button",{className:"cui-link",type:"button","data-cui-fg":"info-fg","data-cui-type":"body","data-testid":n,onClick:e,ref:r,children:_jsxruntime.jsx.call(void 0, De,{subject:{testId:n,part:"label",host:"button"},children:t})})),Un=/^[^\s#]+$/,Bn= exports.FragmentLink =({targetId:e,children:t,testId:n,onFollow:r,dataAttributes:a})=>{if(g(),!Un.test(e))throw new RangeError(`A fragment link needs the target's id without "#" or white space: "${e}"`);return _jsxruntime.jsx.call(void 0, "a",{className:"cui-link",href:`#${e}`,"data-cui-fg":"info-fg","data-cui-type":"body","data-testid":n,onClick:r,...w(a),children:_jsxruntime.jsx.call(void 0, De,{subject:{testId:n,part:"label",host:"link"},children:t})})};var Gn=229,Vn=new Set(["text","search","email","url","tel","password","number","date","datetime-local","month","time","week"]),He=e=>e instanceof HTMLTextAreaElement?e.value!=="":e instanceof HTMLInputElement&&Vn.has(e.type)&&(e.value!==""||e.validity.badInput),Oe=e=>e.nativeEvent.isComposing||e.keyCode===Gn,_=(e,t)=>{e.key!=="Escape"||Oe(e)||He(e.target)||(e.stopPropagation(),t())},Wn= exports.useEscapeToClose =e=>_react.useCallback.call(void 0, t=>_(t,e),[e]);var Mt=e=>e===void 0?void 0:t=>_(t,e),Ke= exports.Card =({id:e,title:t,description:n,actions:r,onEscape:a,testId:o,headingRef:i,ref:l,dataAttributes:s,children:u})=>{g();let p=_react.useId.call(void 0, ),d=Mt(a);return _jsxruntime.jsxs.call(void 0, "section",{className:"cui-card",id:e,"aria-labelledby":p,"data-cui-surface":"surface","data-cui-fg":"fg","data-cui-type":"body","data-cui-face":"sans","data-testid":o,ref:l,onKeyDown:d,...w(s),children:[_jsxruntime.jsxs.call(void 0, "div",{className:"cui-card-header",children:[_jsxruntime.jsxs.call(void 0, "div",{className:"cui-card-heading",children:[_jsxruntime.jsx.call(void 0, "h2",{className:"cui-card-title",id:p,"data-cui-type":"title","data-testid":`${o}-heading`,ref:i,tabIndex:i===void 0?void 0:-1,children:t}),n===void 0?null:_jsxruntime.jsx.call(void 0, "div",{className:"cui-card-description","data-cui-fg":"fg-muted","data-cui-type":"body","data-cui-measure":"reading",children:n})]}),r===void 0?null:_jsxruntime.jsx.call(void 0, "div",{className:"cui-card-actions",children:r})]}),u]})},zn={3:"h3",4:"h4"},Jn= exports.CardSection =({id:e,title:t,subtitle:n,level:r=3,region:a=!1,onEscape:o,testId:i,headingRef:l,ref:s,dataAttributes:u,children:p})=>{g();let d=_react.useId.call(void 0, ),c=Mt(o),b=zn[r],f=_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsxs.call(void 0, "div",{className:"cui-card-section-heading",children:[_jsxruntime.jsx.call(void 0, b,{className:"cui-card-section-title",id:d,"data-cui-type":"body","data-testid":`${i}-heading`,ref:l,tabIndex:l===void 0?void 0:-1,children:t}),n===void 0?null:_jsxruntime.jsx.call(void 0, "div",{className:"cui-card-section-subtitle","data-cui-fg":"fg-muted","data-cui-type":"body","data-cui-measure":"reading",children:n})]}),p]});return a?_jsxruntime.jsx.call(void 0, "section",{className:"cui-card-section",id:e,"aria-labelledby":d,"data-testid":i,ref:s,onKeyDown:c,...w(u),children:f}):_jsxruntime.jsx.call(void 0, "div",{className:"cui-card-section",id:e,"data-testid":i,ref:s,...w(u),children:f})};var jn=({label:e,code:t,testId:n})=>(g(),_jsxruntime.jsx.call(void 0, "section",{className:"cui-code-frame",tabIndex:0,"aria-label":e,"data-cui-surface":"sunken","data-testid":n,children:_jsxruntime.jsx.call(void 0, "pre",{className:"cui-code","data-cui-fg":"fg","data-cui-type":"body","data-cui-face":"mono","data-testid":`${n}-code`,children:t})}));var X=({ruleKey:e,css:t})=>_jsxruntime.jsx.call(void 0, "style",{href:e,precedence:"cui",children:t});var Qn=({caption:e,attributes:t,columns:n,attributePx:r,columnMinPx:a,testId:o})=>{g();let i=_react.useId.call(void 0, );for(let d of[r,a])if(!(Number.isFinite(d)&&d>0))throw new RangeError(`ComparisonGrid widths must be positive px values: ${d}`);if(n.length===0)throw new RangeError("ComparisonGrid needs at least one column");for(let d of n)for(let c of t)if(!Object.hasOwn(d.cells,c.key))throw new RangeError(`Column "${d.key}" has no value for attribute "${c.key}"`);let l=r+n.length*a,s=`cui-comparison-a${r}-c${a}-n${n.length}`,u=d=>`[data-cui-comparison="${s}"][data-cui-comparison-layout="${d}"]`,p=`${u("table")}{display:none}@container (min-width:${_chunkK7BETTSLcjs.T.call(void 0, l)}){${u("table")}{display:block}${u("stack")}{display:none}}`;return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-container","data-cui-stack-below-px":l,"data-testid":o,children:[_jsxruntime.jsx.call(void 0, X,{ruleKey:s,css:p}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-comparison-frame","data-cui-comparison":s,"data-cui-comparison-layout":"table",children:_jsxruntime.jsxs.call(void 0, "table",{className:"cui-comparison-table","data-cui-type":"body",children:[_jsxruntime.jsx.call(void 0, "caption",{className:"cui-visually-hidden",children:e}),_jsxruntime.jsxs.call(void 0, "colgroup",{children:[_jsxruntime.jsx.call(void 0, "col",{style:{width:_chunkK7BETTSLcjs.T.call(void 0, r)}}),n.map(d=>_jsxruntime.jsx.call(void 0, "col",{},d.key))]}),_jsxruntime.jsx.call(void 0, "thead",{children:_jsxruntime.jsxs.call(void 0, "tr",{children:[_jsxruntime.jsx.call(void 0, "td",{}),n.map(d=>_jsxruntime.jsx.call(void 0, "th",{scope:"col",children:d.heading},d.key))]})}),_jsxruntime.jsx.call(void 0, "tbody",{children:t.map(d=>_jsxruntime.jsxs.call(void 0, "tr",{children:[_jsxruntime.jsx.call(void 0, "th",{scope:"row",children:d.label}),n.map(c=>_jsxruntime.jsx.call(void 0, "td",{children:c.cells[d.key]("table")},c.key))]},d.key))})]})}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-comparison-stack","data-cui-comparison":s,"data-cui-comparison-layout":"stack",children:n.map((d,c)=>{let b=`${i}-column-${c}`;return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-comparison-column",role:"group","aria-labelledby":b,"data-cui-type":"body",children:[_jsxruntime.jsx.call(void 0, "div",{className:"cui-comparison-heading",id:b,children:d.heading}),_jsxruntime.jsx.call(void 0, "dl",{className:"cui-comparison-list",children:t.map(f=>_jsxruntime.jsxs.call(void 0, "div",{children:[_jsxruntime.jsx.call(void 0, "dt",{children:f.label}),_jsxruntime.jsx.call(void 0, "dd",{children:d.cells[f.key]("stack")})]},f.key))})]},d.key)})})]})};var re="[data-cui-row-focus]",Ue="[data-cui-row-detail]",er=e=>e===null?[]:[...e.querySelectorAll(`:scope > ${re}`)],It=(e,t)=>{let n=new Map;t!==null&&n.set(t,0);let r=-1;for(let a of e===null?[]:e.children)a.matches(re)?(r+=1,n.set(a,r)):r>=0&&a.matches(Ue)&&n.set(a,r);return n},$t=(e,t,n,r)=>{let a=er(t);if(a.length===0)return n;let o=r.get(e);if(o===void 0)throw new RangeError(`rowFocusTarget: <${e.localName}> left holding focus with no position in the table (only its rows, row details and empty text hold one)`);return a[Math.min(o,a.length-1)]};var rr=e=>e+1,oe= exports.useFocusRescue =e=>{let t=_react.useRef.call(void 0, e),n=_react.useRef.call(void 0, null),r=_react.useRef.call(void 0, !1),[,a]=_react.useReducer.call(void 0, rr,0),o=_react.useCallback.call(void 0, (i=>()=>{r.current&&i.contains(document.activeElement)&&(n.current=i,a())}),[]);return _react.useLayoutEffect.call(void 0, ()=>(r.current=!0,()=>{r.current=!1,n.current=null}),[]),_react.useLayoutEffect.call(void 0, ()=>{t.current=e}),_react.useLayoutEffect.call(void 0, ()=>{let i=n.current;if(i===null)return;n.current=null;let l=[null,document.body].includes(document.activeElement);i.isConnected||!l||_optionalChain([t, 'access', _4 => _4.current, 'call', _5 => _5(i), 'optionalAccess', _6 => _6.focus, 'call', _7 => _7()])}),o};var sr=new Map,dr='a[href], audio[controls], button, details, embed, iframe, img[usemap], input:not([type="hidden"]), label, select, textarea, video[controls], [tabindex], [contenteditable]',lr=(e,t,n)=>{_react.useLayoutEffect.call(void 0, ()=>{let r=e.current;if(t!=="row-compact"||r===null)return;let a=[...r.querySelectorAll(dr)].find(o=>o.parentElement!==r);if(a!==void 0)throw new RangeError(`${n}: a compact row holds no control or focus target (a ${_chunkK7BETTSLcjs.x} px target does not fit its ${_chunkK7BETTSLcjs.z} px; use row-control), not <${a.localName}>`)})},ur=(e,t)=>{let n=e.filter(a=>a.rowHeader===!0).map(a=>a.key);if(n.length>1)throw new RangeError(`${t}: a table has at most one row header column, not ${n.length} (${n.join(", ")})`);let r=e.find(a=>a.rowHeader!==!0&&a.rowHeaderNote!==void 0);if(r!==void 0)throw new RangeError(`${t}: a row header note belongs to the row header column, not to ${r.key}`)},cr=e=>e==null?null:_jsxruntime.jsx.call(void 0, "div",{className:"cui-table-header-note",children:e}),pr=(e,t,n,r,a)=>{let o=e.open(t);return _jsxruntime.jsx.call(void 0, "tr",{ref:a,hidden:!o,"data-cui-row-detail":o?"open":"closed","data-testid":`${r}-detail`,children:_jsxruntime.jsx.call(void 0, "td",{colSpan:n,id:e.id(t),children:o?e.render(t):null})})},yr= exports.DataTable =({caption:e,captionHidden:t,columns:n,rows:r,rowKey:a,rowTestId:o,rowData:i,rowSize:l,rowDetail:s,empty:u,testId:p,ref:d})=>{g();let c=_react.useId.call(void 0, ),b=_react.useRef.call(void 0, null);lr(b,l,p);let f=_react.useRef.call(void 0, null),y=_react.useRef.call(void 0, sr),T=oe(h=>$t(h,b.current,f.current,y.current));_react.useLayoutEffect.call(void 0, ()=>{y.current=It(b.current,f.current)});let m=_react.useCallback.call(void 0, h=>{f.current=h;let R=T(h);return()=>{f.current=null,R()}},[T]),E=_chunkK7BETTSLcjs.W.call(void 0, n);return ur(n,p),_jsxruntime.jsx.call(void 0, "div",{className:"cui-container","data-testid":p,ref:d,children:r.length===0?_jsxruntime.jsx.call(void 0, P,{as:"p",fg:"fg-muted",type:"prose",tabIndex:-1,ref:m,testId:`${p}-empty`,children:u}):_jsxruntime.jsx.call(void 0, "section",{ref:T,className:"cui-table-frame",tabIndex:0,"aria-labelledby":c,"data-testid":`${p}-frame`,children:_jsxruntime.jsxs.call(void 0, "table",{className:"cui-table","data-cui-type":"body","data-cui-row-size":l,style:{"--cui-table-min":_chunkK7BETTSLcjs.T.call(void 0, E)},children:[_jsxruntime.jsx.call(void 0, "caption",{className:t?"cui-visually-hidden":"cui-table-caption",id:c,children:e}),_jsxruntime.jsx.call(void 0, "colgroup",{children:n.map(h=>_jsxruntime.jsx.call(void 0, "col",{style:h.width.fixedPx===void 0?void 0:{width:_chunkK7BETTSLcjs.T.call(void 0, h.width.fixedPx)}},h.key))}),_jsxruntime.jsx.call(void 0, "thead",{children:_jsxruntime.jsx.call(void 0, "tr",{children:n.map(h=>_jsxruntime.jsxs.call(void 0, "th",{scope:"col","data-cui-align":h.align,"data-cui-surface":"subtle","data-cui-type":"caption",children:[h.header,h.note===void 0?null:_jsxruntime.jsx.call(void 0, "div",{className:"cui-table-header-note",children:h.note})]},h.key))})}),_jsxruntime.jsx.call(void 0, "tbody",{ref:b,children:r.map(h=>_jsxruntime.jsxs.call(void 0, _react.Fragment,{children:[_jsxruntime.jsx.call(void 0, "tr",{ref:T,tabIndex:-1,"data-cui-row-focus":"","data-testid":o,...w(_optionalChain([i, 'optionalCall', _8 => _8(h)])),children:n.map(R=>R.rowHeader===!0?_jsxruntime.jsxs.call(void 0, "th",{scope:"row","data-cui-align":R.align,children:[R.cell(h),R.rowHeaderNote===void 0?null:cr(R.rowHeaderNote(h))]},R.key):_jsxruntime.jsx.call(void 0, "td",{"data-cui-align":R.align,children:R.cell(h)},R.key))}),s===void 0?null:pr(s,h,n.length,o,T)]},a(h)))})]})})})};var fr=({items:e,testId:t})=>{if(g(),new Set(e.map(n=>n.key)).size!==e.length)throw new RangeError(`Description keys must be unique: ${e.map(n=>n.key).join(", ")}`);return _jsxruntime.jsx.call(void 0, "dl",{className:"cui-description-list","data-cui-type":"body","data-testid":t,children:e.map(n=>_jsxruntime.jsxs.call(void 0, "div",{className:"cui-description-row","data-testid":`${t}-${n.key}`,children:[_jsxruntime.jsx.call(void 0, "dt",{"data-cui-fg":"fg-secondary",children:n.term}),_jsxruntime.jsx.call(void 0, "dd",{"data-cui-fg":"fg",children:n.description})]},n.key))})};var Ht=e=>{e instanceof HTMLElement&&e.isConnected&&e.focus()},gr=(e,t)=>{if(t===null||!e.contains(t))throw new RangeError("A dialog's initial focus must be an element inside the dialog");return t},br=(e,t)=>{if(t.focus(),e.ownerDocument.activeElement!==t)throw e.close(),new RangeError("A dialog's initial focus must be an element that takes focus")},hr= exports.Dialog =({title:e,description:t,open:n,onClose:r,initialFocus:a,testId:o,children:i})=>{let{labels:l}=k(),s=_react.useId.call(void 0, ),u=_react.useId.call(void 0, ),p=_react.useRef.call(void 0, null),d=_react.useRef.call(void 0, null),c=_react.useRef.call(void 0, !1);return _react.useLayoutEffect.call(void 0, ()=>{let m=p.current;if(n&&!m.open){let E=a===void 0?null:gr(m,a.current);d.current=m.ownerDocument.activeElement,m.showModal(),E!==null&&br(m,E)}else!n&&m.open&&m.close()},[n,a]),_react.useLayoutEffect.call(void 0, ()=>{let m=p.current;return()=>{m.open&&(m.close(),Ht(d.current),d.current=null)}},[]),_jsxruntime.jsxs.call(void 0, "dialog",{className:"cui-dialog","aria-labelledby":s,"aria-describedby":t===void 0?void 0:u,"data-cui-surface":"surface","data-cui-fg":"fg","data-cui-type":"body","data-cui-face":"sans","data-testid":o,ref:p,onClose:m=>{m.currentTarget.open||(Ht(d.current),d.current=null,n&&r())},onCancel:m=>{let E=c.current;c.current=!1,(E||He(m.currentTarget.ownerDocument.activeElement))&&m.preventDefault()},onKeyDownCapture:m=>{c.current=Oe(m)},onKeyUpCapture:()=>{c.current=!1},children:[_jsxruntime.jsxs.call(void 0, "div",{className:"cui-dialog-header",children:[_jsxruntime.jsx.call(void 0, "h2",{className:"cui-dialog-title",id:s,"data-cui-type":"title",children:e}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-dialog-actions",children:_jsxruntime.jsx.call(void 0, A,{variant:"secondary",testId:`${o}-close`,onClick:()=>_optionalChain([p, 'access', _9 => _9.current, 'optionalAccess', _10 => _10.close, 'call', _11 => _11()]),children:l.close})})]}),t===void 0?null:_jsxruntime.jsx.call(void 0, "div",{id:u,"data-cui-measure":"reading","data-testid":`${o}-description`,children:t}),i,_jsxruntime.jsx.call(void 0, "div",{className:"cui-visually-hidden",role:"status","aria-live":"polite","aria-atomic":"true",[Ae]:"","data-testid":`${o}-announcer`})]})};var Er=({summary:e,open:t,onOpenChange:n,testId:r,children:a})=>{g();let o=_react.useId.call(void 0, ),i=_react.useRef.call(void 0, null);return H(i,{testId:r,part:"summary",host:"button"}),_jsxruntime.jsxs.call(void 0, "div",{className:"cui-disclosure","data-testid":r,children:[_jsxruntime.jsxs.call(void 0, "button",{className:"cui-disclosure-button",type:"button","aria-expanded":t,"aria-controls":o,"data-cui-fg":"fg","data-cui-type":"body","data-testid":`${r}-button`,onClick:()=>n(!t),children:[_jsxruntime.jsx.call(void 0, "span",{className:"cui-disclosure-marker","aria-hidden":"true",children:t?"\u25BE":"\u25B8"}),_jsxruntime.jsx.call(void 0, "span",{ref:i,children:e})]}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-disclosure-panel",id:o,hidden:!t,"data-testid":`${r}-panel`,children:a})]})};var xr=/\s/,ze=e=>{if(e!==void 0&&(typeof e!="string"||e===""||xr.test(e)))throw new RangeError(`A control's name must be one token without whitespace: "${e}"`);return e},Ut=e=>{if(e!==void 0&&!(Number.isInteger(e)&&e>0))throw new RangeError(`A field's maxLength must be a positive integer: ${e}`);return e},Y=({description:e,error:t,errorId:n})=>{g();let r=_react.useId.call(void 0, ),a=_react.useId.call(void 0, ),o=_react.useId.call(void 0, ),i=n===void 0?o:Fe(n,"a field's error"),l=[e===void 0?null:a,t===void 0?null:i].filter(u=>u!==null).join(" ");return{control:{id:r,"aria-describedby":l===""?void 0:l,"aria-invalid":t===void 0?void 0:!0},descriptionId:a,errorId:i}},Z=({description:e,error:t,descriptionId:n,errorId:r,testId:a})=>_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[e===void 0?null:_jsxruntime.jsx.call(void 0, P,{as:"p",fg:"fg-muted",type:"body",id:n,testId:`${a}-description`,children:e}),t===void 0?null:_jsxruntime.jsx.call(void 0, P,{as:"p",fg:"danger-fg",type:"body",id:r,testId:`${a}-error`,children:t})]}),me=({htmlFor:e,hidden:t,children:n})=>_jsxruntime.jsx.call(void 0, "label",{className:t===!0?"cui-visually-hidden":"cui-field-label",htmlFor:e,"data-cui-type":"body",children:n}),vr= exports.Field =({label:e,description:t,error:n,errorId:r,testId:a,children:o})=>{let{control:i,descriptionId:l,errorId:s}=Y({label:e,description:t,error:n,errorId:r});return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-field","data-invalid":n!==void 0,"data-testid":a,children:[_jsxruntime.jsx.call(void 0, me,{htmlFor:i.id,hidden:void 0,children:e}),o(i),_jsxruntime.jsx.call(void 0, Z,{description:t,error:n,descriptionId:l,errorId:s,testId:a})]})},Bt=({label:e,description:t,error:n,errorId:r,value:a,onValueChange:o,type:i,name:l,maxLength:s,list:u,autoComplete:p,inputMode:d,prefix:c,labelHidden:b,required:f,testId:y,ref:T})=>{let{control:m,descriptionId:E,errorId:h}=Y({label:e,description:t,error:n,errorId:r}),R=_react.useId.call(void 0, );if(c!==void 0&&c.trim()==="")throw new RangeError("An input's prefix must not be blank");if(s!==void 0&&i==="datetime-local")throw new RangeError(`A ${i} input takes no maxLength: ${s}`);let x=i==="password",M=_jsxruntime.jsx.call(void 0, "input",{className:"cui-input",type:i,name:ze(l),maxLength:Ut(s),value:a,list:u,autoComplete:p,inputMode:d,spellCheck:x?!1:void 0,autoCapitalize:x?"none":void 0,required:f,onChange:K=>o(K.target.value),"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"body","data-testid":y,ref:T,...m,"aria-describedby":B(c===void 0?void 0:R,m["aria-describedby"])});return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-field","data-invalid":n!==void 0,"data-testid":`${y}-field`,children:[_jsxruntime.jsx.call(void 0, me,{htmlFor:m.id,hidden:b,children:e}),c===void 0?M:_jsxruntime.jsxs.call(void 0, "div",{className:"cui-input-group",children:[_jsxruntime.jsx.call(void 0, "span",{className:"cui-input-prefix",id:R,"data-cui-fg":"fg-secondary","data-cui-surface":"sunken","data-cui-type":"body","data-testid":`${y}-prefix`,children:c}),M]}),_jsxruntime.jsx.call(void 0, Z,{description:t,error:n,descriptionId:E,errorId:h,testId:y})]})},wr= exports.TextInput =e=>_jsxruntime.jsx.call(void 0, Bt,{...e}),Pr= exports.PasswordInput =e=>_jsxruntime.jsx.call(void 0, Bt,{...e,type:"password"}),Cr= exports.TextArea =({label:e,description:t,error:n,errorId:r,value:a,onValueChange:o,name:i,maxLength:l,required:s,testId:u,ref:p})=>{let{control:d,descriptionId:c,errorId:b}=Y({label:e,description:t,error:n,errorId:r});return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-field","data-invalid":n!==void 0,"data-testid":`${u}-field`,children:[_jsxruntime.jsx.call(void 0, me,{htmlFor:d.id,hidden:void 0,children:e}),_jsxruntime.jsx.call(void 0, "textarea",{className:"cui-input cui-textarea",name:ze(i),maxLength:Ut(l),value:a,required:s,onChange:f=>o(f.target.value),"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"prose","data-testid":u,ref:p,...d}),_jsxruntime.jsx.call(void 0, Z,{description:t,error:n,descriptionId:c,errorId:b,testId:u})]})},Nr= exports.Select =({label:e,description:t,error:n,errorId:r,value:a,options:o,onValueChange:i,name:l,labelHidden:s,unavailable:u,testId:p,ref:d})=>{let{control:c,descriptionId:b,errorId:f}=Y({label:e,description:t,error:n,errorId:r}),y=_react.useId.call(void 0, ),T=J(u,y);return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-field","data-invalid":n!==void 0,"data-testid":`${p}-field`,children:[_jsxruntime.jsx.call(void 0, me,{htmlFor:c.id,hidden:s,children:e}),_jsxruntime.jsx.call(void 0, "select",{className:"cui-input",name:ze(l),value:a,onChange:m=>{u===void 0&&i(m.target.value)},"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"body","data-testid":p,ref:d,...c,"aria-disabled":u===void 0?void 0:!0,"aria-describedby":B(c["aria-describedby"],T),children:o.map(m=>_jsxruntime.jsx.call(void 0, "option",{value:m.value,children:m.label},m.value))}),_jsxruntime.jsx.call(void 0, Z,{description:t,error:n,descriptionId:b,errorId:f,testId:p}),_optionalChain([u, 'optionalAccess', _12 => _12.reason])===void 0?null:_jsxruntime.jsx.call(void 0, P,{as:"p",fg:"fg-muted",type:"body",id:y,testId:`${p}-reason`,children:u.reason})]})},kr= exports.RadioGroup =({legend:e,description:t,error:n,errorId:r,value:a,options:o,onValueChange:i,testId:l,ref:s})=>{let u=_react.useId.call(void 0, ),{control:p,descriptionId:d,errorId:c}=Y({label:e,description:t,error:n,errorId:r});return _jsxruntime.jsxs.call(void 0, "fieldset",{className:"cui-radio-group","aria-describedby":p["aria-describedby"],"data-invalid":n!==void 0,"data-testid":l,children:[_jsxruntime.jsx.call(void 0, "legend",{className:"cui-radio-group-legend","data-cui-type":"body",children:e}),o.map((b,f)=>_jsxruntime.jsxs.call(void 0, "label",{className:"cui-radio","data-cui-type":"body",children:[_jsxruntime.jsx.call(void 0, "input",{type:"radio",name:u,value:b.value,checked:b.value===a,onChange:()=>i(b.value),"aria-invalid":p["aria-invalid"],"data-testid":`${l}-option-${b.value}`,ref:f===0?s:void 0}),_jsxruntime.jsx.call(void 0, "span",{children:b.label})]},b.value)),_jsxruntime.jsx.call(void 0, Z,{description:t,error:n,descriptionId:d,errorId:c,testId:l})]})},Lr= exports.CheckboxGroup =({legend:e,description:t,error:n,errorId:r,values:a,options:o,onValuesChange:i,testId:l,ref:s})=>{let{control:u,descriptionId:p,errorId:d}=Y({label:e,description:t,error:n,errorId:r}),c=o.map(y=>y.value);if(c.length===0||new Set(c).size!==c.length)throw new RangeError(`A check box group needs at least one option with unique values: ${c.join(", ")}`);let b=a.filter(y=>!c.includes(y));if(b.length>0)throw new RangeError(`The chosen values are not options: ${b.join(", ")}`);let f=new Set(a);return _jsxruntime.jsxs.call(void 0, "fieldset",{className:"cui-checkbox-group","aria-describedby":u["aria-describedby"],"data-invalid":n!==void 0,"data-testid":l,children:[_jsxruntime.jsx.call(void 0, "legend",{className:"cui-checkbox-group-legend","data-cui-type":"body",children:e}),o.map((y,T)=>_jsxruntime.jsxs.call(void 0, "label",{className:"cui-checkbox","data-cui-type":"body",children:[_jsxruntime.jsx.call(void 0, "input",{type:"checkbox",value:y.value,checked:f.has(y.value),onChange:()=>i(c.filter(m=>m===y.value?!f.has(m):f.has(m))),"aria-invalid":u["aria-invalid"],"data-testid":`${l}-option-${y.value}`,ref:T===0?s:void 0}),_jsxruntime.jsx.call(void 0, "span",{children:y.label})]},y.value)),_jsxruntime.jsx.call(void 0, Z,{description:t,error:n,descriptionId:p,errorId:d,testId:l})]})};var zt=_react.createContext.call(void 0, null),_t="surface",qt={neutral:{face:"surface",line:"border-control"},info:{face:"info-tint",line:"info-accent"},success:{face:"success-tint",line:"success-accent"},warning:{face:"warning-tint",line:"warning-accent"},danger:{face:"danger-tint",line:"danger-accent"}},Gt={face:"info-tint",line:"info-accent"},Jt={normal:"border-control",high:"info-accent"},Ar=["normal","high"],Fr=[1,2,3,4],F=_chunkK7BETTSLcjs.A.space["space-2"],Dr="fg",Hr="fg-secondary",Xt=e=>{let t=_react.useContext.call(void 0, zt);if(t===null)throw new Error(`${e} must be rendered inside Figure`);return t},Je=(e,t,n)=>{if(!(Number.isFinite(n)&&n>0&&n%4===0))throw new RangeError(`${e}: ${t} must be a positive multiple of the ${4} px lattice: ${n}`)},Or= exports.Figure =e=>{g();let t=_react.useId.call(void 0, ),{kind:n,widthPx:r,heightPx:a,testId:o,dataAttributes:i,children:l}=e;Je(o,"widthPx",r),Je(o,"heightPx",a);let s=_react.useMemo.call(void 0, ()=>({kind:n,widthPx:r,heightPx:a,arrowIds:{normal:`${t}-arrow-normal`,high:`${t}-arrow-high`}}),[n,r,a,t]),u=_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, "defs",{children:Ar.map(b=>_jsxruntime.jsx.call(void 0, "marker",{id:s.arrowIds[b],viewBox:`0 0 ${F} ${F}`,refX:F,refY:F/2,markerWidth:F,markerHeight:F,markerUnits:"userSpaceOnUse",orient:"auto","data-cui-emphasis":b,children:_jsxruntime.jsx.call(void 0, "path",{d:`M 0 0 L ${F} ${F/2} L 0 ${F} z`,"data-cui-stroke":Jt[b],"data-testid":`${o}-arrow-${b}`})},b))}),_jsxruntime.jsx.call(void 0, zt.Provider,{value:s,children:l})]});if(e.kind==="group"){let{label:b,onEscape:f}=e;if(!_chunkK7BETTSLcjs.f.call(void 0, b))throw new RangeError(`${o}: a group figure's label must hold a readable character: ${JSON.stringify(b)}`);return _jsxruntime.jsx.call(void 0, "div",{className:"cui-figure-frame","data-testid":`${o}-frame`,children:_jsxruntime.jsx.call(void 0, "svg",{className:"cui-figure",role:"group","aria-label":b,viewBox:`0 0 ${r} ${a}`,"data-cui-figure":"group","data-cui-surface":_t,"data-cui-face":"sans",style:{"--cui-figure-inline":_chunkK7BETTSLcjs.T.call(void 0, r),"--cui-figure-block":_chunkK7BETTSLcjs.T.call(void 0, a)},onKeyDown:f===void 0?void 0:y=>_(y,f),"data-testid":o,...w(i),children:u})})}let{viewBox:p,pointer:d,svgRef:c}=e;return _jsxruntime.jsx.call(void 0, "div",{className:"cui-container","data-testid":`${o}-frame`,children:_jsxruntime.jsx.call(void 0, "svg",{ref:c,className:"cui-figure","aria-hidden":"true",viewBox:p===void 0?`0 0 ${r} ${a}`:p,"data-cui-figure":"decorative","data-cui-surface":_t,"data-cui-face":"sans","data-cui-pan":d===void 0?void 0:"true","data-cui-cursor":_optionalChain([d, 'optionalAccess', _13 => _13.cursor]),style:{"--cui-figure-inline":_chunkK7BETTSLcjs.T.call(void 0, r),"--cui-figure-ratio":String(a/r)},"data-testid":o,...w(i),..._optionalChain([d, 'optionalAccess', _14 => _14.handlers]),children:u})})},Vt=(e,t)=>{try{return t()}catch(n){throw new RangeError(`${e}: ${n.message}`,{cause:n})}},Kr=(e,t,n)=>{for(let r of t){let a=_chunk7M4I26BScjs.d.light[r.fg],o=n.find(i=>a[i]===void 0);if(o!==void 0)throw new RangeError(`${e}: the note ${JSON.stringify(r.text)} in ${r.fg} is not in the contrast table on ${o}, a face the node takes`)}},Ur= exports.FigureNode =e=>{g();let t=Xt("FigureNode"),n=_react.useId.call(void 0, ),{x:r,y:a,shape:o,tone:i,outline:l,selected:s,name:u,title:p,press:d,testId:c,dataAttributes:b}=e,f=e.notes===void 0?[]:e.notes;if(!(Number.isFinite(r)&&Number.isFinite(a)))throw new RangeError(`${c}: a node's position must be finite: ${r}, ${a}`);if(t.kind==="group"&&d===void 0)throw new RangeError(`${c}: every node of a group figure must be pressable (pass press)`);if(t.kind==="decorative"&&d!==void 0)throw new RangeError(`${c}: a node of a decorative figure cannot be pressed (it is hidden from assistive technology)`);if(d!==void 0&&!_chunkK7BETTSLcjs.f.call(void 0, d.label))throw new RangeError(`${c}: a pressable node's label must hold a readable character: ${JSON.stringify(d.label)}`);let y=s?Gt:qt[i];Kr(c,f,[qt[i].face,Gt.face]);let T,m,E;if(o.kind==="box"){if(u===null)throw new RangeError(`${c}: a box's name is drawn inside the box and sizes it, so it cannot be null (only a disc may be drawn without a name)`);let R=Vt(c,()=>_chunkK7BETTSLcjs.N.call(void 0, {name:u,notes:f.map(M=>M.text)}));if(Je(c,"a box's widthPx",o.widthPx),o.widthPx<R.minWidthPx)throw new RangeError(`${c}: a box ${o.widthPx} px wide is narrower than its lines under the widest 1.4.12 spacing (${R.minWidthPx} px)`);T={width:o.widthPx,height:R.heightPx,left:r,top:a};let x=_chunkK7BETTSLcjs.O.call(void 0, f.length);m=_jsxruntime.jsxs.call(void 0, "g",{"data-cui-surface":y.face,children:[_jsxruntime.jsx.call(void 0, "rect",{className:"cui-figure-plate",width:o.widthPx,height:R.heightPx,rx:_chunkK7BETTSLcjs.A.radius["radius-item"],"data-cui-fill":y.face,"data-cui-stroke":y.line,"data-testid":`${c}-plate`}),_jsxruntime.jsx.call(void 0, "text",{className:"cui-figure-name",x:x.insetPx,y:x.namePx,fontSize:_chunkK7BETTSLcjs.A.type.body.size,"data-cui-fg":Dr,"data-cui-figure-type":"body","data-testid":`${c}-name`,children:u}),f.map((M,K)=>_jsxruntime.jsx.call(void 0, "text",{x:x.insetPx,y:x.notesPx[K],fontSize:_chunkK7BETTSLcjs.A.type.caption.size,"data-cui-fg":M.fg,"data-cui-figure-type":"caption","data-testid":`${c}-note-${K}`,children:M.text},K))]}),E=_jsxruntime.jsx.call(void 0, "rect",{className:"cui-figure-ring",x:-_chunkK7BETTSLcjs.R,y:-_chunkK7BETTSLcjs.R,width:o.widthPx+2*_chunkK7BETTSLcjs.R,height:R.heightPx+2*_chunkK7BETTSLcjs.R,rx:_chunkK7BETTSLcjs.A.radius["radius-item"]+_chunkK7BETTSLcjs.R,"data-cui-stroke":"focus","data-testid":`${c}-ring`})}else{let R=Vt(c,()=>_chunkK7BETTSLcjs.P.call(void 0, u,o.radiusPx));T={width:2*o.radiusPx,height:2*o.radiusPx,left:r-o.radiusPx,top:a-o.radiusPx},m=_jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment,{children:[_jsxruntime.jsx.call(void 0, "g",{"data-cui-surface":y.face,children:_jsxruntime.jsx.call(void 0, "circle",{className:"cui-figure-plate",r:o.radiusPx,"data-cui-fill":y.face,"data-cui-stroke":y.line,"data-testid":`${c}-plate`})}),u===null?null:_jsxruntime.jsx.call(void 0, "text",{className:"cui-figure-label",x:0,y:R.extentBelowPx-_chunkK7BETTSLcjs.A.type.caption.lineHeight/2,fontSize:_chunkK7BETTSLcjs.A.type.caption.size,"data-cui-fg":Hr,"data-cui-figure-type":"caption","data-testid":`${c}-name`,children:u})]}),E=_jsxruntime.jsx.call(void 0, "circle",{className:"cui-figure-ring",r:o.radiusPx+_chunkK7BETTSLcjs.R,"data-cui-stroke":"focus","data-testid":`${c}-ring`})}if(d!==void 0){if(T.width<_chunkK7BETTSLcjs.x||T.height<_chunkK7BETTSLcjs.x)throw new RangeError(`${c}: a pressable node must be at least the ${_chunkK7BETTSLcjs.x} px target: ${T.width} \xD7 ${T.height}`);if(T.left<_chunkK7BETTSLcjs.Q||T.top<_chunkK7BETTSLcjs.Q||T.left+T.width+_chunkK7BETTSLcjs.Q>t.widthPx||T.top+T.height+_chunkK7BETTSLcjs.Q>t.heightPx)throw new RangeError(`${c}: a pressable node must keep ${_chunkK7BETTSLcjs.Q} px to the figure's edge for its focus ring`)}let h=d===void 0?{}:{role:"button",tabIndex:0,"aria-label":d.label,"aria-describedby":d.description===void 0?void 0:n,"aria-expanded":d.expanded,"aria-controls":d.expanded?d.controls:void 0,onClick:R=>{R.currentTarget.focus(),d.onPress()},onKeyDown:R=>{R.key!=="Enter"&&R.key!==" "||(R.preventDefault(),R.repeat||d.onPress())}};return _jsxruntime.jsxs.call(void 0, "g",{className:"cui-figure-node",transform:`translate(${r} ${a})`,"data-cui-tone":i,"data-cui-outline":l,"data-selected":String(s),...h,"data-testid":c,...w(b),children:[p===void 0?null:_jsxruntime.jsx.call(void 0, "title",{children:p}),_optionalChain([d, 'optionalAccess', _15 => _15.description])===void 0?null:_jsxruntime.jsx.call(void 0, "desc",{id:n,"data-testid":`${c}-description`,children:d.description}),d===void 0?null:E,m]})},Br= exports.FigureEdge =({d:e,emphasis:t,weight:n,arrow:r,title:a,testId:o,dataAttributes:i})=>{g();let l=Xt("FigureEdge");if(!Fr.includes(n))throw new RangeError(`${o}: an edge's weight must be 1, 2, 3 or 4: ${n}`);return _jsxruntime.jsx.call(void 0, "path",{className:"cui-figure-edge",d:e,markerEnd:r?`url(#${l.arrowIds[t]})`:void 0,"data-cui-stroke":Jt[t],"data-cui-weight":n,"data-cui-emphasis":t,"data-testid":o,...w(i),children:a===void 0?null:_jsxruntime.jsx.call(void 0, "title",{children:a})})};var _r={1:"h1",2:"h2",3:"h3"},qr= exports.Heading =({level:e,type:t,testId:n,headingRef:r,children:a})=>{g();let o=_r[e];return _jsxruntime.jsx.call(void 0, o,{className:"cui-heading","data-cui-type":t,"data-cui-fg":"fg","data-testid":n,ref:r,tabIndex:r===void 0?void 0:-1,children:a})};var Vr={removed:"danger-tint",added:"success-tint"},Wr= exports.InlineChange =({kind:e,testId:t,children:n})=>{if(g(),n==="")throw new RangeError(`${t}: a changed fragment must hold at least one character`);return _jsxruntime.jsx.call(void 0, e==="removed"?"del":"ins",{className:"cui-change","data-cui-change":e,"data-cui-surface":Vr[e],"data-cui-fg":"fg","data-testid":t,children:n})};var Jr={neutral:{fg:"fg-secondary",surface:"sunken"},info:{fg:"info-fg",surface:"info-tint"},success:{fg:"success-fg",surface:"success-tint"},warning:{fg:"warning-fg",surface:"warning-tint"},danger:{fg:"danger-fg",surface:"danger-tint"}},Xr={neutral:"neutral-solid",info:"info-solid",success:"success-solid",warning:"warning-solid",danger:"danger-solid"},Xe= exports.Pill =({tone:e,variant:t,testId:n,dataAttributes:r,children:a})=>{g();let o=t==="tint"?Jr[e]:{fg:"on-solid",surface:Xr[e]};return _jsxruntime.jsx.call(void 0, "span",{className:"cui-pill","data-cui-tone":e,"data-cui-variant":t,"data-cui-fg":o.fg,"data-cui-surface":o.surface,"data-cui-type":"caption","data-testid":n,...w(r),children:a})};var je=({label:e,valueText:t,value:n,max:r,testId:a})=>{g();let o=_react.useId.call(void 0, );if(r!==null){if(!(Number.isFinite(r)&&r>0))throw new RangeError(`Progress maximum must be positive: ${r}`);if(n===null||!(Number.isFinite(n)&&n>=0))throw new RangeError(`A determinate progress value must be a number >= 0: ${n}`)}let i=r===null?null:{max:r,now:Math.min(n,r)};return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-progress","data-testid":a,children:[_jsxruntime.jsx.call(void 0, P,{as:"p",fg:"fg",type:"body",id:o,children:e}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-progress-track",role:"progressbar","aria-labelledby":o,"aria-valuetext":t,"aria-valuemin":i===null?void 0:0,"aria-valuemax":_optionalChain([i, 'optionalAccess', _16 => _16.max]),"aria-valuenow":_optionalChain([i, 'optionalAccess', _17 => _17.now]),"data-cui-surface":"sunken","data-cui-indeterminate":i===null,"data-testid":`${a}-bar`,children:_jsxruntime.jsx.call(void 0, "div",{className:"cui-progress-fill","data-cui-accent":"info-accent",style:i===null?void 0:{inlineSize:`${i.now/i.max*100}%`},"data-testid":`${a}-fill`})}),_jsxruntime.jsx.call(void 0, "div",{"aria-hidden":"true",children:_jsxruntime.jsx.call(void 0, P,{as:"p",fg:"fg-secondary",type:"body",testId:`${a}-value`,children:t})})]})};var Qr=({title:e,status:t,progress:n,cancel:r,testId:a,children:o})=>_jsxruntime.jsxs.call(void 0, Ke,{title:e,actions:r===void 0?void 0:_jsxruntime.jsx.call(void 0, A,{variant:"secondary",busy:r.busy,busyLabel:r.busyLabel,onClick:r.onCancel,testId:`${a}-cancel`,children:r.label}),testId:a,children:[_jsxruntime.jsxs.call(void 0, "div",{className:"cui-job-status",role:"status","aria-live":"polite","aria-atomic":"true","data-testid":`${a}-status`,children:[_jsxruntime.jsx.call(void 0, "span",{className:"cui-visually-hidden",children:`${e} `}),_jsxruntime.jsx.call(void 0, Xe,{tone:t.tone,variant:"tint",testId:`${a}-status-pill`,children:t.label})]}),n===void 0?null:_jsxruntime.jsx.call(void 0, je,{...n,testId:`${a}-progress`}),o]});var Ye=_react.createContext.call(void 0, null),no="space-2",ro= exports.List =e=>{g();let{gap:t,label:n,id:r,hidden:a,testId:o,children:i}=e;if(n!==void 0&&!_chunkK7BETTSLcjs.f.call(void 0, n))throw new RangeError(`${o}: a list's label must hold a readable character: ${JSON.stringify(n)}`);let l=e.marker==="none"?void 0:e.type,s=l!==void 0,u=e.marker==="number"||e.marker==="none"&&e.ordered?"ol":"ul";return _jsxruntime.jsx.call(void 0, Ye.Provider,{value:e.marker,children:_jsxruntime.jsx.call(void 0, u,{className:"cui-list",role:"list","aria-label":n,id:r,hidden:a,"data-cui-gap":s?void 0:t,"data-cui-row-gap":s?t:void 0,"data-cui-column-gap":s?no:void 0,"data-cui-marker":s?e.marker:void 0,"data-cui-type":l,"data-testid":o,children:i})})},oo= exports.ListItem =({testId:e,dataAttributes:t,children:n})=>{g();let r=_react.useContext.call(void 0, Ye);if(r===null)throw new Error("ListItem must be rendered inside List, not inside another ListItem");return _jsxruntime.jsx.call(void 0, "li",{className:"cui-list-item","data-testid":e,...w(t),children:_jsxruntime.jsx.call(void 0, "div",{className:"cui-list-body","data-cui-measure":r==="none"?void 0:"reading",children:_jsxruntime.jsx.call(void 0, Ye.Provider,{value:null,children:n})})})};var ao=({tone:e,testId:t,children:n})=>(g(),_jsxruntime.jsx.call(void 0, "div",{className:"cui-notice","data-cui-tone":e,"data-cui-surface":e==="info"?"info-tint":"warning-tint","data-cui-fg":"fg","data-cui-type":"prose","data-cui-measure":"reading","data-testid":t,children:n})),de= exports.AlertMessage =({occurrence:e,testId:t,children:n})=>(g(),_jsxruntime.jsx.call(void 0, "div",{className:"cui-alert",role:"alert","data-cui-surface":"danger-tint","data-cui-fg":"danger-fg","data-cui-type":"prose","data-cui-measure":"reading","data-cui-occurrence":e,"data-testid":t,children:n},e));var en=e=>[...e.querySelectorAll(re)].filter(t=>{let n=t.closest(Ue);return n===null||!e.contains(n)}),so=e=>{let t=e.ref.current;if(t===null)throw new Error("LoadMore: rows.ref is not attached to the element holding the rows");let n=en(t);if(n.length!==e.count)throw new Error(`LoadMore: rows.ref holds ${n.length} ${re} elements for ${e.count} rows`);return n},lo=(e,t)=>{let n=-1;return e.forEach((r,a)=>{t.has(r)&&(n=a)}),e[n+1]},uo= exports.LoadMore =({onLoad:e,busy:t,done:n,failure:r,limit:a,rows:o,testId:i})=>{let{formatLocale:l,labels:s}=k(),u=_react.useRef.call(void 0, null),p=_react.useRef.call(void 0, null),d=_react.useRef.call(void 0, null),c=_react.useRef.call(void 0, !1),b=()=>{let m=o.ref.current;u.current={shown:new Set(m===null?[]:en(m)),failureOccurrence:r===null?null:r.occurrence,busySeen:!1},e()};_react.useLayoutEffect.call(void 0, ()=>{let m=c.current;c.current=!1;let E=u.current;if(E===null)return;let h=so(o);if(t){E.busySeen=!0,E.shown=new Set(h);return}let R=lo(h,E.shown),x=r!==null&&r.occurrence!==E.failureOccurrence;if(!(E.busySeen||R!==void 0||x||n)||(u.current=null,x||R===void 0))return;let M=[null,document.body].includes(document.activeElement);(d.current!==null&&document.activeElement===d.current||m&&M)&&R.focus()});let f=oe(()=>n?p.current:d.current),y=_react.useCallback.call(void 0, (m=>{d.current=m;let E=f(m);return()=>{d.current=null,c.current=m===document.activeElement,E()}}),[f]),T=_react.useCallback.call(void 0, (m=>{p.current=m;let E=f(m);return()=>{p.current=null,E()}}),[f]);return n?_jsxruntime.jsx.call(void 0, "div",{className:"cui-load-more","data-testid":i,children:_jsxruntime.jsx.call(void 0, P,{as:"p",fg:"fg-muted",type:"body",tabIndex:-1,ref:T,testId:`${i}-end`,children:s.endOfRecords})}):_jsxruntime.jsxs.call(void 0, "div",{className:"cui-load-more","data-testid":i,children:[_jsxruntime.jsx.call(void 0, A,{variant:"secondary",busy:t,busyLabel:s.loading,onClick:b,ref:y,testId:`${i}-button`,children:s.loadMore(_chunkK7BETTSLcjs.a.call(void 0, a,l))}),r===null?null:_jsxruntime.jsx.call(void 0, de,{occurrence:r.occurrence,testId:`${i}-failure`,children:s.loadFailed(r.reason)})]})};var po=({master:e,detail:t,masterMinPx:n,detailMinPx:r,testId:a})=>{g();let o=_chunkK7BETTSLcjs.V.call(void 0, {masterMinPx:n,detailMinPx:r,gapPx:_chunkK7BETTSLcjs.A.space["space-6"]});return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-container","data-testid":a,children:[_jsxruntime.jsx.call(void 0, X,{ruleKey:o.key,css:o.css}),_jsxruntime.jsxs.call(void 0, "div",{className:"cui-master-detail","data-cui-master-detail":o.key,children:[_jsxruntime.jsx.call(void 0, "div",{className:"cui-master-detail-pane","data-testid":`${a}-master`,children:e}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-master-detail-pane","data-testid":`${a}-detail`,children:t})]})]})};var Ee=e=>{let{formatLocale:t,labels:n}=k(),{testId:r}=e;if(e.keep===void 0){let{value:i,unit:l}=e;if(l!==void 0&&!_chunkK7BETTSLcjs.f.call(void 0, l))throw new RangeError(`${r}: a unit must hold a readable character: ${JSON.stringify(l)}`);if(i===null)return _jsxruntime.jsx.call(void 0, "span",{className:"cui-measured","data-measured":"false","data-testid":r,children:n.unmeasured});let s=_chunkK7BETTSLcjs.a.call(void 0, i,t);return _jsxruntime.jsx.call(void 0, "span",{className:"cui-measured","data-measured":"true","data-testid":r,children:_chunkK7BETTSLcjs.c.call(void 0, s,l)})}let{text:a,keep:o}=e;if(a===null)return _jsxruntime.jsx.call(void 0, "span",{className:"cui-measured","data-measured":"false","data-cui-keep":o,"data-testid":r,children:n.unmeasured});if(!_chunkK7BETTSLcjs.f.call(void 0, a))throw new RangeError(`${r}: a measured text must hold a readable character (pass null when the value was not measured): ${JSON.stringify(a)}`);return _jsxruntime.jsx.call(void 0, "span",{className:"cui-measured","data-measured":"true","data-cui-keep":o,"data-testid":r,children:a})};var yo=({label:e,value:t,min:n,max:r,valueText:a,testId:o})=>{if(g(),!(Number.isFinite(n)&&Number.isFinite(r)&&n<r))throw new RangeError(`Meter needs a finite range with min below max: min ${n}, max ${r}`);if(!(Number.isFinite(t)&&t>=n&&t<=r))throw new RangeError(`Meter value must be a finite number in its range: value ${t}, min ${n}, max ${r}`);return _jsxruntime.jsxs.call(void 0, "span",{className:"cui-meter","data-testid":o,children:[_jsxruntime.jsx.call(void 0, "span",{className:"cui-meter-track",role:"meter","aria-label":e,"aria-valuemin":n,"aria-valuemax":r,"aria-valuenow":t,"aria-valuetext":a,"data-cui-surface":"sunken","data-testid":`${o}-bar`,children:_jsxruntime.jsx.call(void 0, "span",{className:"cui-meter-fill","data-cui-accent":"info-accent",style:{inlineSize:`${(t-n)/(r-n)*100}%`},"data-testid":`${o}-fill`})}),_jsxruntime.jsx.call(void 0, "span",{"aria-hidden":"true",children:_jsxruntime.jsx.call(void 0, P,{fg:"fg",type:"body",testId:`${o}-value`,children:a})})]})};var bo={ArrowLeft:-1,ArrowRight:1},ho= exports.PanelTabs =({label:e,items:t,value:n,onValueChange:r,testId:a,panelDescribedBy:o,children:i})=>{g();let l=_react.useId.call(void 0, ),s=_react.useRef.call(void 0, new Map);if(t.length===0)throw new RangeError("PanelTabs needs at least one tab");let u=t.map(y=>y.id);if(new Set(u).size!==u.length)throw new RangeError(`Tab keys must be unique: ${u.join(", ")}`);let p=u.indexOf(n);if(p<0)throw new RangeError(`The selected tab "${n}" is not one of the tabs: ${u.join(", ")}`);let d=y=>`${l}-tab-${y}`,c=`${l}-panel`,b=y=>{let T=t[y];T.id!==n&&r(T.id),_optionalChain([s, 'access', _18 => _18.current, 'access', _19 => _19.get, 'call', _20 => _20(T.id), 'optionalAccess', _21 => _21.focus, 'call', _22 => _22()])};return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-panel-tabs","data-testid":a,children:[_jsxruntime.jsx.call(void 0, "div",{className:"cui-tabs-list",role:"tablist","aria-label":e,onKeyDown:y=>{let T=t.findIndex(R=>s.current.get(R.id)===y.target),m=T<0?p:T,E=bo[y.key],h;if(E!==void 0){let R=getComputedStyle(y.currentTarget).direction==="rtl"?-E:E;h=(m+R+t.length)%t.length}else if(y.key==="Home")h=0;else if(y.key==="End")h=t.length-1;else return;y.preventDefault(),b(h)},children:t.map((y,T)=>{let m=T===p;return _jsxruntime.jsx.call(void 0, "button",{className:"cui-tab cui-panel-tab",type:"button",role:"tab",id:d(T),"aria-selected":m,"aria-controls":c,tabIndex:m?0:-1,"data-cui-fg":m?"fg":"fg-secondary","data-cui-type":"body","data-testid":`${a}-${y.id}`,ref:E=>{E===null?s.current.delete(y.id):s.current.set(y.id,E)},onClick:()=>b(T),children:y.label},y.id)})}),_jsxruntime.jsx.call(void 0, "div",{role:"tabpanel",id:c,"aria-labelledby":d(p),"aria-describedby":o,"data-testid":`${a}-panel`,children:i})]})};var To=({failure:e,onReload:t,forbiddenMessage:n,failureMessage:r,rescueRef:a,testId:o})=>{let{labels:i}=k();return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-resource-failed","data-testid":o,children:[_jsxruntime.jsx.call(void 0, de,{occurrence:e.occurrence,testId:`${o}-alert`,children:i.failureSentence(e,n,r===void 0?i.loadFailed:r)}),e.status===403?null:_jsxruntime.jsx.call(void 0, A,{variant:"secondary",busy:e.retrying,busyLabel:i.loading,onClick:t,ref:a,testId:`${o}-reload`,children:i.reload})]})};var xo=({label:e,options:t,value:n,onValueChange:r,testId:a})=>{g();let o=new Set(t.map(i=>i.value));if(t.length<2||o.size!==t.length)throw new RangeError(`A segmented control needs at least two options with unique values: ${t.map(i=>i.value).join(", ")}`);if(!o.has(n))throw new RangeError(`The pressed value "${n}" is not one of the options: ${[...o].join(", ")}`);return _jsxruntime.jsxs.call(void 0, "fieldset",{className:"cui-segmented-group","data-testid":a,children:[_jsxruntime.jsx.call(void 0, "legend",{className:"cui-segmented-legend","data-cui-type":"body",children:e}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-segmented",children:t.map(i=>{let l=i.value===n;return _jsxruntime.jsx.call(void 0, "button",{className:"cui-segment",type:"button","aria-pressed":l,"data-cui-fg":l?"on-solid":"fg","data-cui-surface":l?"info-solid":void 0,"data-cui-type":"body","data-testid":`${a}-${i.value}`,onClick:()=>{l||r(i.value)},children:i.label},i.value)})})]})};var rn=({selected:e,controls:t,onSelect:n,testId:r,dataAttributes:a,ref:o,children:i})=>{g();let l=_react.useRef.call(void 0, null);H(l,{testId:r,part:"row",host:"button"});let s=_react.useCallback.call(void 0, p=>{if(l.current=p,typeof o=="function")return o(p);o!=null&&(o.current=p)},[o]);return _jsxruntime.jsx.call(void 0, "button",{className:"cui-row-button",type:"button","data-selected":e,"aria-expanded":e,"aria-controls":t,"data-cui-row-focus":"","data-cui-surface":e?"info-tint":"surface","data-cui-fg":"fg","data-cui-type":"body","data-testid":r,onClick:p=>{ye(p),n()},ref:s,...w(a),children:i})},Co= exports.SelectableList =({label:e,items:t,itemKey:n,selectedKey:r,onSelect:a,detailId:o,renderRow:i,rowTestId:l,rowData:s,empty:u,testId:p,ref:d})=>(g(),_jsxruntime.jsx.call(void 0, "div",{className:"cui-selectable","data-testid":p,ref:d,children:t.length===0?_jsxruntime.jsx.call(void 0, P,{as:"p",fg:"fg-muted",type:"prose",testId:`${p}-empty`,children:u}):_jsxruntime.jsx.call(void 0, "ul",{className:"cui-selectable-list",role:"list","aria-label":e,children:t.map(c=>{let b=n(c);return _jsxruntime.jsx.call(void 0, "li",{children:_jsxruntime.jsx.call(void 0, rn,{selected:b===r,controls:o,onSelect:()=>a(c),testId:l,dataAttributes:_optionalChain([s, 'optionalCall', _23 => _23(c)]),children:i(c)})},b)})})}));var ko=({label:e,value:t,min:n,max:r,step:a,valueText:o,onValueChange:i,testId:l})=>{g();let s=_react.useId.call(void 0, );if(!([t,n,r,a].every(Number.isFinite)&&n<r&&a>0&&n<=t&&t<=r))throw new RangeError(`Slider needs finite min < max, a positive step and min <= value <= max: value ${t}, min ${n}, max ${r}, step ${a}`);let u=o(t);return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-field","data-testid":`${l}-field`,children:[_jsxruntime.jsx.call(void 0, "label",{className:"cui-field-label",htmlFor:s,"data-cui-type":"body",children:e}),_jsxruntime.jsxs.call(void 0, "div",{className:"cui-slider",children:[_jsxruntime.jsx.call(void 0, "input",{className:"cui-slider-input",id:s,type:"range",min:n,max:r,step:a,value:t,"aria-valuetext":u,"data-testid":l,onChange:p=>i(p.currentTarget.valueAsNumber)}),_jsxruntime.jsx.call(void 0, "span",{className:"cui-slider-value","aria-hidden":"true",children:_jsxruntime.jsx.call(void 0, P,{fg:"fg",type:"body",testId:`${l}-value`,children:u})})]})]})};var Lo=({gap:e,testId:t,children:n})=>(g(),_jsxruntime.jsx.call(void 0, "div",{className:"cui-stack","data-cui-gap":e,"data-testid":t,children:n})),Mo= exports.Cluster =({gap:e,as:t="div",testId:n,children:r})=>(g(),_jsxruntime.jsx.call(void 0, t,{className:"cui-cluster","data-cui-gap":e,"data-testid":n,children:r}));var sn={done:0,current:1,pending:2},So={done:{fg:"on-solid",surface:"success-solid"},current:{fg:"on-solid",surface:"info-solid"},pending:{fg:"fg-secondary",surface:void 0}},Io= exports.Stepper =({label:e,steps:t,testId:n})=>{let{labels:r}=k();if(t.length===0||new Set(t.map(o=>o.id)).size!==t.length)throw new RangeError(`A stepper needs at least one step with unique keys: ${t.map(o=>o.id).join(", ")}`);if(t.filter(o=>o.state==="current").length>1||t.some((o,i)=>i>0&&sn[o.state]<sn[t[i-1].state]))throw new RangeError(`Step states must run done, at most one current, then pending: ${t.map(o=>o.state).join(", ")}`);let a={done:r.stepDone,current:null,pending:r.stepPending};return _jsxruntime.jsx.call(void 0, "ol",{className:"cui-stepper",role:"list","aria-label":e,"data-cui-type":"body","data-testid":n,children:t.map((o,i)=>{let l=So[o.state],s=a[o.state];return _jsxruntime.jsxs.call(void 0, "li",{className:"cui-step","aria-current":o.state==="current"?"step":void 0,"data-cui-step":o.state,"data-testid":`${n}-${o.id}`,children:[_jsxruntime.jsx.call(void 0, "span",{className:"cui-step-marker","aria-hidden":"true","data-cui-fg":l.fg,"data-cui-surface":l.surface,"data-cui-type":"caption",children:o.state==="done"?"\u2713":i+1}),_jsxruntime.jsxs.call(void 0, "span",{className:"cui-step-label","data-cui-fg":"fg",children:[o.label,s===null?null:_jsxruntime.jsx.call(void 0, "span",{className:"cui-visually-hidden",children:` (${s})`})]})]},o.id)})})};var Fo=({label:e,labelHidden:t,checked:n,onCheckedChange:r,unavailable:a,testId:o,ref:i,dataAttributes:l})=>{g();let s=_react.useId.call(void 0, ),u=_react.useRef.call(void 0, null);H(u,{testId:o,part:"label",host:"button"});let p=J(a,s),d=a!==void 0,c=_jsxruntime.jsxs.call(void 0, "button",{className:"cui-switch",type:"button",role:"switch","aria-checked":n,"aria-disabled":d?!0:void 0,"aria-describedby":B(p),"data-cui-fg":"fg","data-cui-type":"body","data-testid":o,ref:i,onClick:()=>{d||r(!n)},...w(l),children:[_jsxruntime.jsx.call(void 0, "span",{className:"cui-switch-track","aria-hidden":"true","data-cui-surface":n?"info-solid":"sunken","data-testid":`${o}-track`,children:_jsxruntime.jsx.call(void 0, "span",{className:"cui-switch-thumb","data-cui-surface":n?"surface":"neutral-solid","data-testid":`${o}-thumb`})}),_jsxruntime.jsx.call(void 0, "span",{className:t===!0?"cui-visually-hidden":void 0,ref:u,children:e})]});return _optionalChain([a, 'optionalAccess', _24 => _24.reason])===void 0?c:_jsxruntime.jsxs.call(void 0, "span",{className:"cui-button-group",children:[c,_jsxruntime.jsx.call(void 0, P,{fg:"fg-muted",type:"body",id:s,testId:`${o}-reason`,children:a.reason})]})};var Uo=({label:e,items:t,currentId:n,onNavigate:r,testId:a,collapsible:o=!1})=>{if(g(),t.length===0)throw new RangeError("Tabs needs at least one tab");let i=new Set(t.map(f=>f.id));if(i.size!==t.length)throw new RangeError(`Tab keys must be unique: ${t.map(f=>f.id).join(", ")}`);let l=t.find(f=>f.id===n);if(l===void 0)throw new RangeError(`The current tab "${n}" is not one of the tabs: ${[...i].join(", ")}`);let[s,u]=_react.useState.call(void 0, !1),p=_react.useRef.call(void 0, null),d=_react.useRef.call(void 0, null),c=_react.useId.call(void 0, ),b=_react.useCallback.call(void 0, f=>{u(!1),f&&_optionalChain([p, 'access', _25 => _25.current, 'optionalAccess', _26 => _26.contains, 'call', _27 => _27(document.activeElement)])&&_optionalChain([d, 'access', _28 => _28.current, 'optionalAccess', _29 => _29.focus, 'call', _30 => _30()])},[]);return _react.useEffect.call(void 0, ()=>{if(!(o&&s))return;let f=y=>{p.current!==null&&!p.current.contains(y.target)&&b(!0)};return document.addEventListener("pointerdown",f,!0),()=>document.removeEventListener("pointerdown",f,!0)},[o,s,b]),_jsxruntime.jsxs.call(void 0, "nav",{ref:p,className:"cui-tabs","aria-label":e,"data-testid":a,"data-cui-collapsible":o?"":void 0,"data-cui-open":o&&s?"":void 0,onKeyDown:o&&s?f=>_(f,()=>b(!0)):void 0,children:[o?_jsxruntime.jsxs.call(void 0, "button",{ref:d,type:"button",className:"cui-tabs-summary","aria-expanded":s,"aria-controls":c,"data-cui-fg":"fg","data-cui-type":"body","data-testid":`${a}-summary`,onClick:()=>u(f=>!f),children:[_jsxruntime.jsx.call(void 0, "span",{className:"cui-tabs-summary-label",children:l.label}),_jsxruntime.jsx.call(void 0, "span",{className:"cui-tabs-summary-marker","aria-hidden":"true",children:s?"\u25B4":"\u25BE"})]}):null,_jsxruntime.jsx.call(void 0, "ul",{className:"cui-tabs-list",id:c,role:"list","data-cui-surface":o?"surface":void 0,children:t.map(f=>{let y=f.id===n;return _jsxruntime.jsx.call(void 0, "li",{className:"cui-tabs-item",children:_jsxruntime.jsx.call(void 0, "a",{className:"cui-tab",href:f.href,"aria-current":y?"page":void 0,"data-cui-fg":y?"fg":"fg-secondary","data-cui-type":"body","data-testid":`${a}-${f.id}`,onClick:T=>{pe(T,f.href,r),T.defaultPrevented&&b(!1)},children:f.label})},f.id)})})]})};var Go={neutral:"fg",danger:"danger-fg",warning:"warning-fg",success:"success-fg"},Vo= exports.MetricTile =e=>{g();let{label:t,sublabel:n,tone:r,testId:a,dataAttributes:o}=e;if((e.text===void 0?e.value===null:e.text===null)&&r!=="neutral")throw new RangeError(`An unmeasured tile value carries no tone: ${r}`);let l=`${a}-value`;return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-tile","data-cui-surface":"subtle","data-cui-fg":"fg","data-cui-tone":r,"data-testid":a,...w(o),children:[_jsxruntime.jsx.call(void 0, "p",{className:"cui-tile-label","data-cui-type":"caption","data-cui-measure":"reading",children:t}),_jsxruntime.jsx.call(void 0, "p",{className:"cui-tile-sublabel","data-cui-fg":"fg-muted","data-cui-type":"caption","data-cui-measure":"reading",children:n}),_jsxruntime.jsx.call(void 0, "p",{className:"cui-tile-value","data-cui-fg":Go[r],"data-cui-type":"heading","data-cui-measure":"reading",children:e.text===void 0?_jsxruntime.jsx.call(void 0, Ee,{value:e.value,unit:e.unit,testId:l}):_jsxruntime.jsx.call(void 0, Ee,{text:e.text,keep:"wrap",testId:l})})]})},pn=e=>_react.Children.toArray(e).flatMap(t=>{if(!_react.isValidElement.call(void 0, t))throw new RangeError(`TileGrid children must be tile elements, not text: ${String(t)}`);return t.type===_react.Fragment?pn(t.props.children):[t]}),Wo= exports.TileGrid =({count:e,minInlinePx:t,testId:n,children:r})=>{g();let a=_chunkK7BETTSLcjs.Y.call(void 0, e,t,_chunkK7BETTSLcjs.A.space["space-2"]),o=pn(r).length;if(o!==e)throw new RangeError(`TileGrid has ${o} tiles but count is ${e}`);return _jsxruntime.jsxs.call(void 0, "div",{className:"cui-container","data-testid":n,children:[_jsxruntime.jsx.call(void 0, X,{ruleKey:a.key,css:a.css}),_jsxruntime.jsx.call(void 0, "div",{className:"cui-tile-grid","data-cui-tile-grid":a.key,"data-cui-gap":"space-2",children:r})]})};var Pe=e=>[...e.querySelectorAll("button")],Jo= exports.Toolbar =({label:e,testId:t,children:n})=>{g();let r=_react.useRef.call(void 0, null),a=_react.useRef.call(void 0, null);_react.useLayoutEffect.call(void 0, ()=>{let s=Pe(r.current),u=a.current!==null&&s.includes(a.current)?a.current:_nullishCoalesce(s[0], () => (null));a.current=u;for(let p of s)p.tabIndex=p===u?0:-1});let o=s=>{for(let u of Pe(r.current))u.tabIndex=u===s?0:-1;a.current=s};return _jsxruntime.jsx.call(void 0, "div",{className:"cui-toolbar",role:"toolbar","aria-label":e,"aria-orientation":"horizontal","data-testid":t,ref:r,onFocus:s=>{let u=Pe(s.currentTarget).find(p=>p.contains(s.target));u!==void 0&&o(u)},onKeyDown:s=>{let u=Pe(s.currentTarget),p=u.indexOf(s.target);if(p===-1)return;let d=getComputedStyle(s.currentTarget).direction==="rtl"?"ArrowLeft":"ArrowRight",c=d==="ArrowRight"?"ArrowLeft":"ArrowRight",f={[d]:(p+1)%u.length,[c]:(p-1+u.length)%u.length,Home:0,End:u.length-1}[s.key];if(f===void 0)return;s.preventDefault();let y=u[f];o(y),y.focus()},children:n})};var mn=e=>e===null?_chunkK7BETTSLcjs.o:_chunkK7BETTSLcjs.p,Ne=(e,t,n,r,a)=>{let[o,i]=_react.useState.call(void 0, ()=>({key:e,state:mn(e)})),[l,s]=_react.useState.call(void 0, 0),[u,p]=_react.useState.call(void 0, 0),d=_react.useRef.call(void 0, t),c=_react.useRef.call(void 0, null),b=_react.useRef.call(void 0, l);_react.useLayoutEffect.call(void 0, ()=>{d.current=t}),_react.useEffect.call(void 0, ()=>{if(e===null){i({key:null,state:_chunkK7BETTSLcjs.o});return}let h=new AbortController;c.current=e;let R=l===b.current?"revision":"reload";return b.current=l,i(x=>Object.is(x.key,e)?{key:e,state:r(x.state,R)}:{key:e,state:_chunkK7BETTSLcjs.p}),d.current(h.signal).then(x=>{h.signal.aborted||(c.current=null,i(M=>({key:e,state:a(M.state,x)})))},x=>{h.signal.aborted||i(()=>{throw x})}),()=>{h.abort(),c.current=null}},[e,n,l,u]);let f=_react.useCallback.call(void 0, ()=>s(h=>h+1),[]),y=_react.useCallback.call(void 0, ()=>p(h=>h+1),[]),T=_react.useCallback.call(void 0, (h,R)=>{i(x=>Object.is(x.key,h)?{key:h,state:R(x.state)}:x)},[]),m=_react.useCallback.call(void 0, (h,R)=>{T(h,R),Object.is(c.current,h)&&y()},[T,y]);return{state:Object.is(o.key,e)?o.state:mn(e),reload:f,refresh:y,update:T,write:m}};var Qo=(e,t,n)=>{let r=_react.useRef.call(void 0, t);_react.useLayoutEffect.call(void 0, ()=>{r.current=t});let a=_react.useCallback.call(void 0, m=>r.current.first(m),[]),{state:o,reload:i,refresh:l,update:s,write:u}=Ne(e,a,n,_chunkK7BETTSLcjs.Z,_chunkK7BETTSLcjs._),p=_react.useRef.call(void 0, {key:e,state:o});_react.useLayoutEffect.call(void 0, ()=>{p.current={key:e,state:o}});let d=_react.useRef.call(void 0, null),c=_react.useCallback.call(void 0, ()=>{_optionalChain([d, 'access', _31 => _31.current, 'optionalAccess', _32 => _32.controller, 'access', _33 => _33.abort, 'call', _34 => _34()]),d.current=null},[]);_react.useEffect.call(void 0, ()=>c,[e,n,c]);let b=_react.useCallback.call(void 0, ()=>{c(),i()},[c,i]),f=_react.useCallback.call(void 0, ()=>{c(),l()},[c,l]),y=_react.useCallback.call(void 0, ()=>{let{key:m,state:E}=p.current;if(m===null||E.kind!=="ready"||E.refreshing||E.value.next===null||E.value.loadingMore)throw new Error("usePagedResource: loadMore needs a shown list with a next cursor, no page in flight and no re-read in flight");let h=E.value.next,R={key:m,controller:new AbortController,maps:[]};d.current=R,s(m,_chunkK7BETTSLcjs.$),r.current.next(h,R.controller.signal).then(x=>{d.current===R&&(d.current=null,s(m,M=>R.maps.reduce((K,bn)=>_chunkK7BETTSLcjs.ba.call(void 0, K,bn),_chunkK7BETTSLcjs.aa.call(void 0, M,h,x))))},x=>{d.current===R&&s(m,()=>{throw x})})},[s]),T=_react.useCallback.call(void 0, (m,E)=>{let h=d.current;h!==null&&Object.is(h.key,m)&&h.maps.push(E),u(m,R=>_chunkK7BETTSLcjs.ba.call(void 0, R,E))},[u]);return{state:o,reload:b,refresh:f,loadMore:y,updateList:T}};var ra=e=>typeof e=="object"&&e!==null&&typeof e.then=="function",oa= exports.usePendingPress =()=>{let[e,t]=_react.useState.call(void 0, null),n=_react.useRef.call(void 0, null),r=_react.useCallback.call(void 0, (a,o)=>{let i=o();if(!ra(i))return;let l=Symbol(a);n.current=l,t(a);let s=()=>{n.current===l&&(n.current=null,t(null))};i.then(s,s)},[]);return{pendingKey:e,press:r}};var ia=(e,t,n)=>{let{state:r,reload:a,refresh:o,write:i}=Ne(e,t,n,_chunkK7BETTSLcjs.q,_chunkK7BETTSLcjs.r),l=_react.useCallback.call(void 0, (s,u)=>i(s,p=>_chunkK7BETTSLcjs.r.call(void 0, p,{ok:!0,value:u})),[i]);return{state:r,reload:a,refresh:o,put:l}};var sa=({testId:e,children:t})=>(g(),_jsxruntime.jsx.call(void 0, "span",{className:"cui-visually-hidden","data-testid":e,children:t}));exports.ANNOUNCE_SETTLE_MS = ce; exports.AlertMessage = de; exports.Breadcrumb = Mn; exports.Button = A; exports.COMPACT_ROW_PX = _chunkK7BETTSLcjs.z; exports.CONSOLE_UI_LABEL_CATALOGS = _chunkK7BETTSLcjs.t; exports.CONTRAST_MINIMUM = _chunk7M4I26BScjs.c; exports.CONTRAST_PAIRS = _chunk7M4I26BScjs.d; exports.Card = Ke; exports.CardSection = Jn; exports.CheckboxGroup = Lr; exports.Cluster = Mo; exports.CodeBlock = jn; exports.ComparisonGrid = Qn; exports.ConsoleUiRoot = Nn; exports.DataTable = yr; exports.DescriptionList = fr; exports.Dialog = hr; exports.Disclosure = Er; exports.FIGURE_RING_REACH_PX = _chunkK7BETTSLcjs.Q; exports.FLEXIBLE_COLUMN_MIN_PX = _chunkK7BETTSLcjs.H; exports.Field = vr; exports.Figure = Or; exports.FigureEdge = Br; exports.FigureNode = Ur; exports.FragmentLink = Bn; exports.HTTP_FORBIDDEN = _chunkK7BETTSLcjs.l; exports.Heading = qr; exports.InlineChange = Wr; exports.JobCard = Qr; exports.LATTICE_PX = _chunkK7BETTSLcjs.v; exports.Link = Kn; exports.List = ro; exports.ListItem = oo; exports.LoadMore = uo; exports.MasterDetail = po; exports.Measured = Ee; exports.Meter = yo; exports.MetricTile = Vo; exports.Notice = ao; exports.PanelTabs = ho; exports.PasswordInput = Pr; exports.Pill = Xe; exports.ProgressBar = je; exports.ROW_WITH_CONTROL_PX = _chunkK7BETTSLcjs.y; exports.RadioGroup = kr; exports.ResourceFailed = To; exports.RowButton = rn; exports.SegmentedControl = xo; exports.Select = Nr; exports.SelectableList = Co; exports.Slider = ko; exports.Stack = Lo; exports.Stepper = Io; exports.Switch = Fo; exports.TARGET_PX = _chunkK7BETTSLcjs.x; exports.TOKENS = _chunkK7BETTSLcjs.A; exports.TONES = _chunkK7BETTSLcjs.ga; exports.TONE_HUES = _chunkK7BETTSLcjs.ea; exports.TONE_ROLES = _chunkK7BETTSLcjs.fa; exports.Tabs = Uo; exports.Text = P; exports.TextArea = Cr; exports.TextInput = wr; exports.TileGrid = Wo; exports.Toolbar = Jo; exports.VisuallyHidden = sa; exports.ZonedTimeError = _chunkK7BETTSLcjs.g; exports.beginPage = _chunkK7BETTSLcjs.$; exports.beginPagedReload = _chunkK7BETTSLcjs.Z; exports.beginReload = _chunkK7BETTSLcjs.q; exports.ceil8 = _chunkK7BETTSLcjs.E; exports.ceilToLattice = _chunkK7BETTSLcjs.w; exports.cellContentInlinePx = _chunkK7BETTSLcjs.F; exports.comparisonAttributePx = _chunkK7BETTSLcjs.I; exports.contrastRatio = _chunk7M4I26BScjs.b; exports.countSampleText = _chunkK7BETTSLcjs.K; exports.cssVar = _chunkK7BETTSLcjs.B; exports.figureBoxPlan = _chunkK7BETTSLcjs.N; exports.figureDiscLabelPlan = _chunkK7BETTSLcjs.P; exports.fillLabel = _chunkK7BETTSLcjs.k; exports.fixedColumnPx = _chunkK7BETTSLcjs.G; exports.flatMapOutcome = _chunkK7BETTSLcjs.n; exports.formatByteSize = _chunkK7BETTSLcjs.b; exports.formatCount = _chunkK7BETTSLcjs.a; exports.formatInstant = _chunkK7BETTSLcjs.j; exports.goldenSectionPx = _chunkK7BETTSLcjs.S; exports.hexToSrgb = _chunk7M4I26BScjs.a; exports.instantSampleText = _chunkK7BETTSLcjs.J; exports.isReadableText = _chunkK7BETTSLcjs.f; exports.keepLastGood = _chunkK7BETTSLcjs.r; exports.lightDark = _chunkK7BETTSLcjs.ca; exports.mapOutcome = _chunkK7BETTSLcjs.m; exports.mapPagedList = _chunkK7BETTSLcjs.ba; exports.masterDetailPlan = _chunkK7BETTSLcjs.U; exports.monoTextWidthEm = _chunkK7BETTSLcjs.D; exports.placeholderRule = _chunkK7BETTSLcjs.da; exports.pxToRem = _chunkK7BETTSLcjs.T; exports.readDecimalText = _chunkK7BETTSLcjs.d; exports.readIntegerText = _chunkK7BETTSLcjs.e; exports.reasonAside = _chunkK7BETTSLcjs.s; exports.resolveConsoleUiLabels = _chunkK7BETTSLcjs.u; exports.settleFirstPage = _chunkK7BETTSLcjs._; exports.settlePage = _chunkK7BETTSLcjs.aa; exports.spacedTextWidthEm = _chunkK7BETTSLcjs.M; exports.tableFrameMinInlinePx = _chunkK7BETTSLcjs.X; exports.tableMinInlinePx = _chunkK7BETTSLcjs.W; exports.textWidthEm = _chunkK7BETTSLcjs.C; exports.tileGridPlan = _chunkK7BETTSLcjs.Y; exports.tileMinInlinePx = _chunkK7BETTSLcjs.L; exports.toOffsetIso = _chunkK7BETTSLcjs.h; exports.toWallTime = _chunkK7BETTSLcjs.i; exports.useAnnounce = kn; exports.useConsoleUi = k; exports.useEscapeToClose = Wn; exports.useFocusRescue = oe; exports.usePagedResource = Qo; exports.usePendingPress = oa; exports.useResource = ia;
package/dist/index.d.cts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { ConsoleUiLocale, ConsoleUiLabels, ColumnWidth, FgRole, TypeToken, SpaceToken, ResourceFailure, TextFace, ResourceOutcome, KeysetPage, NextPage, PagedState, PagedContent, ResourceState } from "./core.cjs";
2
2
  export { AccentRole, COMPACT_ROW_PX, CONSOLE_UI_LABEL_CATALOGS, CONTRAST_MINIMUM, CONTRAST_PAIRS, CellContent, ColorScheme, ColorToken, ColumnHeaderText, ColumnWidthSource, CommandOutcome, ConsoleUiTokens, ContrastRole, FIGURE_RING_REACH_PX, FLEXIBLE_COLUMN_MIN_PX, FigureBoxLines, FigureBoxPlan, FigureDiscLabelPlan, HTTP_FORBIDDEN, LATTICE_PX, MasterDetailOptions, MasterDetailPlan, MotionToken, PageFailure, PagedValue, ROW_WITH_CONTROL_PX, RadiusToken, ReloadCause, SchemeColor, SizeToken, Srgb, StrokeToken, SurfaceRole, TARGET_PX, TOKENS, TONES, TONE_HUES, TONE_ROLES, TileGridPlan, TileGridStep, TokenName, Tone, ToneHue, ToneRole, WeightToken, ZonedTimeError, ZonedTimeErrorReason, beginPage, beginPagedReload, beginReload, ceil8, ceilToLattice, cellContentInlinePx, comparisonAttributePx, contrastRatio, countSampleText, cssVar, figureBoxPlan, figureDiscLabelPlan, fillLabel, fixedColumnPx, flatMapOutcome, formatByteSize, formatCount, formatInstant, goldenSectionPx, hexToSrgb, instantSampleText, isReadableText, keepLastGood, lightDark, mapOutcome, mapPagedList, masterDetailPlan, monoTextWidthEm, placeholderRule, pxToRem, readDecimalText, readIntegerText, reasonAside, resolveConsoleUiLabels, settleFirstPage, settlePage, spacedTextWidthEm, tableFrameMinInlinePx, tableMinInlinePx, textWidthEm, tileGridPlan, tileMinInlinePx, toOffsetIso, toWallTime } from "./core.cjs";
3
3
  import * as react from "react";
4
- import { ReactNode, MouseEvent, Ref, DOMAttributes, RefObject, RefCallback, KeyboardEvent } from "react";
4
+ import { ReactNode, MouseEvent, Ref, RefObject, DOMAttributes, RefCallback, KeyboardEvent } from "react";
5
5
  type BreadcrumbItem = {
6
6
  readonly id: string;
7
7
  readonly label: string;
@@ -185,10 +185,11 @@ type DialogProps = {
185
185
  readonly description?: ReactNode;
186
186
  readonly open: boolean;
187
187
  readonly onClose: () => void;
188
+ readonly initialFocus?: RefObject<HTMLElement | null>;
188
189
  readonly testId: string;
189
190
  readonly children: ReactNode;
190
191
  };
191
- declare const Dialog: ({ title, description, open, onClose, testId, children }: DialogProps) => react.JSX.Element;
192
+ declare const Dialog: ({ title, description, open, onClose, initialFocus, testId, children }: DialogProps) => react.JSX.Element;
192
193
  type DisclosureProps = {
193
194
  readonly summary: ReactNode;
194
195
  readonly open: boolean;
@@ -218,7 +219,9 @@ declare const Field: ({ label, description, error, errorId: namedErrorId, testId
218
219
  type TextInputProps = FieldTexts & {
219
220
  readonly value: string;
220
221
  readonly onValueChange: (value: string) => void;
221
- readonly type: "text" | "search" | "datetime-local";
222
+ readonly type: "text" | "search" | "email" | "datetime-local";
223
+ readonly name?: string;
224
+ readonly maxLength?: number;
222
225
  readonly inputMode?: "numeric" | "decimal";
223
226
  readonly prefix?: string;
224
227
  readonly labelHidden?: boolean;
@@ -241,11 +244,13 @@ declare const PasswordInput: (props: PasswordInputProps) => react.JSX.Element;
241
244
  type TextAreaProps = FieldTexts & {
242
245
  readonly value: string;
243
246
  readonly onValueChange: (value: string) => void;
247
+ readonly name?: string;
248
+ readonly maxLength?: number;
244
249
  readonly required?: boolean;
245
250
  readonly testId: string;
246
251
  readonly ref?: Ref<HTMLTextAreaElement>;
247
252
  };
248
- declare const TextArea: ({ label, description, error, errorId: namedErrorId, value, onValueChange, required, testId, ref }: TextAreaProps) => react.JSX.Element;
253
+ declare const TextArea: ({ label, description, error, errorId: namedErrorId, value, onValueChange, name, maxLength, required, testId, ref }: TextAreaProps) => react.JSX.Element;
249
254
  type FieldOption = {
250
255
  readonly value: string;
251
256
  readonly label: string;
@@ -254,12 +259,13 @@ type SelectProps = FieldTexts & {
254
259
  readonly value: string;
255
260
  readonly options: readonly FieldOption[];
256
261
  readonly onValueChange: (value: string) => void;
262
+ readonly name?: string;
257
263
  readonly labelHidden?: boolean;
258
264
  readonly unavailable?: Unavailable;
259
265
  readonly testId: string;
260
266
  readonly ref?: Ref<HTMLSelectElement>;
261
267
  };
262
- declare const Select: ({ label, description, error, errorId: namedErrorId, value, options, onValueChange, labelHidden, unavailable, testId, ref }: SelectProps) => react.JSX.Element;
268
+ declare const Select: ({ label, description, error, errorId: namedErrorId, value, options, onValueChange, name, labelHidden, unavailable, testId, ref }: SelectProps) => react.JSX.Element;
263
269
  type RadioGroupProps = FieldErrorId & {
264
270
  readonly legend: string;
265
271
  readonly description?: string;
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { ConsoleUiLocale, ConsoleUiLabels, ColumnWidth, FgRole, TypeToken, SpaceToken, ResourceFailure, TextFace, ResourceOutcome, KeysetPage, NextPage, PagedState, PagedContent, ResourceState } from "./core.js";
2
2
  export { AccentRole, COMPACT_ROW_PX, CONSOLE_UI_LABEL_CATALOGS, CONTRAST_MINIMUM, CONTRAST_PAIRS, CellContent, ColorScheme, ColorToken, ColumnHeaderText, ColumnWidthSource, CommandOutcome, ConsoleUiTokens, ContrastRole, FIGURE_RING_REACH_PX, FLEXIBLE_COLUMN_MIN_PX, FigureBoxLines, FigureBoxPlan, FigureDiscLabelPlan, HTTP_FORBIDDEN, LATTICE_PX, MasterDetailOptions, MasterDetailPlan, MotionToken, PageFailure, PagedValue, ROW_WITH_CONTROL_PX, RadiusToken, ReloadCause, SchemeColor, SizeToken, Srgb, StrokeToken, SurfaceRole, TARGET_PX, TOKENS, TONES, TONE_HUES, TONE_ROLES, TileGridPlan, TileGridStep, TokenName, Tone, ToneHue, ToneRole, WeightToken, ZonedTimeError, ZonedTimeErrorReason, beginPage, beginPagedReload, beginReload, ceil8, ceilToLattice, cellContentInlinePx, comparisonAttributePx, contrastRatio, countSampleText, cssVar, figureBoxPlan, figureDiscLabelPlan, fillLabel, fixedColumnPx, flatMapOutcome, formatByteSize, formatCount, formatInstant, goldenSectionPx, hexToSrgb, instantSampleText, isReadableText, keepLastGood, lightDark, mapOutcome, mapPagedList, masterDetailPlan, monoTextWidthEm, placeholderRule, pxToRem, readDecimalText, readIntegerText, reasonAside, resolveConsoleUiLabels, settleFirstPage, settlePage, spacedTextWidthEm, tableFrameMinInlinePx, tableMinInlinePx, textWidthEm, tileGridPlan, tileMinInlinePx, toOffsetIso, toWallTime } from "./core.js";
3
3
  import * as react from "react";
4
- import { ReactNode, MouseEvent, Ref, DOMAttributes, RefObject, RefCallback, KeyboardEvent } from "react";
4
+ import { ReactNode, MouseEvent, Ref, RefObject, DOMAttributes, RefCallback, KeyboardEvent } from "react";
5
5
  type BreadcrumbItem = {
6
6
  readonly id: string;
7
7
  readonly label: string;
@@ -185,10 +185,11 @@ type DialogProps = {
185
185
  readonly description?: ReactNode;
186
186
  readonly open: boolean;
187
187
  readonly onClose: () => void;
188
+ readonly initialFocus?: RefObject<HTMLElement | null>;
188
189
  readonly testId: string;
189
190
  readonly children: ReactNode;
190
191
  };
191
- declare const Dialog: ({ title, description, open, onClose, testId, children }: DialogProps) => react.JSX.Element;
192
+ declare const Dialog: ({ title, description, open, onClose, initialFocus, testId, children }: DialogProps) => react.JSX.Element;
192
193
  type DisclosureProps = {
193
194
  readonly summary: ReactNode;
194
195
  readonly open: boolean;
@@ -218,7 +219,9 @@ declare const Field: ({ label, description, error, errorId: namedErrorId, testId
218
219
  type TextInputProps = FieldTexts & {
219
220
  readonly value: string;
220
221
  readonly onValueChange: (value: string) => void;
221
- readonly type: "text" | "search" | "datetime-local";
222
+ readonly type: "text" | "search" | "email" | "datetime-local";
223
+ readonly name?: string;
224
+ readonly maxLength?: number;
222
225
  readonly inputMode?: "numeric" | "decimal";
223
226
  readonly prefix?: string;
224
227
  readonly labelHidden?: boolean;
@@ -241,11 +244,13 @@ declare const PasswordInput: (props: PasswordInputProps) => react.JSX.Element;
241
244
  type TextAreaProps = FieldTexts & {
242
245
  readonly value: string;
243
246
  readonly onValueChange: (value: string) => void;
247
+ readonly name?: string;
248
+ readonly maxLength?: number;
244
249
  readonly required?: boolean;
245
250
  readonly testId: string;
246
251
  readonly ref?: Ref<HTMLTextAreaElement>;
247
252
  };
248
- declare const TextArea: ({ label, description, error, errorId: namedErrorId, value, onValueChange, required, testId, ref }: TextAreaProps) => react.JSX.Element;
253
+ declare const TextArea: ({ label, description, error, errorId: namedErrorId, value, onValueChange, name, maxLength, required, testId, ref }: TextAreaProps) => react.JSX.Element;
249
254
  type FieldOption = {
250
255
  readonly value: string;
251
256
  readonly label: string;
@@ -254,12 +259,13 @@ type SelectProps = FieldTexts & {
254
259
  readonly value: string;
255
260
  readonly options: readonly FieldOption[];
256
261
  readonly onValueChange: (value: string) => void;
262
+ readonly name?: string;
257
263
  readonly labelHidden?: boolean;
258
264
  readonly unavailable?: Unavailable;
259
265
  readonly testId: string;
260
266
  readonly ref?: Ref<HTMLSelectElement>;
261
267
  };
262
- declare const Select: ({ label, description, error, errorId: namedErrorId, value, options, onValueChange, labelHidden, unavailable, testId, ref }: SelectProps) => react.JSX.Element;
268
+ declare const Select: ({ label, description, error, errorId: namedErrorId, value, options, onValueChange, name, labelHidden, unavailable, testId, ref }: SelectProps) => react.JSX.Element;
263
269
  type RadioGroupProps = FieldErrorId & {
264
270
  readonly legend: string;
265
271
  readonly description?: string;
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- import{$ as yt,A as S,B as ga,C as ba,D as ha,E as Ra,F as Ta,G as xa,H as va,I as Ea,J as wa,K as Pa,L as Ca,M as Na,N as at,O as it,P as st,Q as W,R as U,S as ka,T as I,U as La,V as dt,W as lt,X as Sa,Y as ut,Z as ct,_ as pt,a as ue,aa as ft,b as ra,ba as Me,c as tt,ca as Fa,d as na,da as Aa,e as oa,ea as Da,f as D,fa as Ha,g as aa,ga as Oa,h as ia,i as sa,j as da,k as la,l as yr,m as ua,n as ca,o as Ne,p as ke,q as rt,r as Le,s as pa,t as ya,u as nt,v as Se,w as fa,x as V,y as ma,z as ot}from"./chunk-5TR7VUZM.js";import{a as Ma,b as Ia,c as $a,d as mt}from"./chunk-FXEGLGL7.js";import{createContext as fr,useCallback as mr,useContext as xt,useLayoutEffect as gr,useMemo as gt,useRef as bt}from"react";import{jsx as Tt,jsxs as wr}from"react/jsx-runtime";var Ie=fr(null),vt=" ",ht='[inert], [aria-hidden="true" i]',Et="dialog:modal",$e="data-cui-dialog-announcer",br=`:scope > [${$e}]`,hr=e=>{if(e.closest(ht)!==null)return{hidden:'an ancestor is inert or aria-hidden="true"'};let t=e.ownerDocument,r=[...t.querySelectorAll(Et)],n=t.activeElement,a=r.filter(s=>s.contains(n)),o=a.length>0?a:r;if(o.every(s=>s.contains(e)))return{region:e};let i=o.find(s=>o.every(l=>l.contains(s)));if(i===void 0)return{hidden:"focus is in no open modal dialog and they do not nest, so which one is topmost cannot be told"};let d=i.querySelector(br);return d===null?{hidden:"the topmost open modal dialog neither contains the console nor is a Dialog"}:d.closest(ht)!==null?{hidden:'the topmost open modal dialog is a Dialog whose live region has an inert or aria-hidden="true" ancestor'}:{region:d}},Rr=e=>{try{e.querySelectorAll(Et)}catch(t){throw typeof t=="object"&&t!==null&&"name"in t&&t.name==="SyntaxError"?new Error("ConsoleUiRoot requires the :modal selector (Chrome 105, Firefox 103, Safari 15.6, jsdom 27 or later): announcements check whether a modal dialog hides the live region",{cause:t}):t}},ce=150,Tr=1e3,Rt=new WeakMap,xr=(e,t)=>{let r=Rt.get(e)??new Set,n={text:t};Rt.set(e,r.add(n)),setTimeout(()=>r.delete(n),ce);let a=e.ownerDocument.createElement("span");a.textContent=[...r].map(o=>o.text).join(vt),e.replaceChildren(a)},vr=({locale:e,formatLocale:t,timeZone:r,testId:n,children:a})=>{if(xt(Ie)!==null)throw new Error("ConsoleUiRoot must not be rendered inside another ConsoleUiRoot (a console has exactly one root)");let i=nt(e),[d]=Intl.getCanonicalLocales(t),s=gt(()=>new Intl.DateTimeFormat(d,{timeZone:r}).resolvedOptions().timeZone,[d,r]),l=bt(null),p=bt(null);gr(()=>{Rr(l.current.ownerDocument)},[]);let u=mr(y=>{if(y.trim()==="")throw new RangeError("announce: text must be a non-empty sentence");let f=()=>{let{texts:h,settle:T,deadline:x}=p.current;p.current=null,clearTimeout(T),clearTimeout(x);let b=l.current;if(b===null)return;let R=h.join(vt),v=hr(b);if("hidden"in v)throw new Error(`announce: the live region is hidden from assistive technology (${v.hidden}), so this announcement would be lost: ${R}`);xr(v.region,R)},m=p.current;if(m===null){p.current={texts:[y],settle:setTimeout(f,ce),deadline:setTimeout(f,Tr)};return}m.texts.push(y),clearTimeout(m.settle),m.settle=setTimeout(f,ce)},[]),c=gt(()=>({locale:e,formatLocale:d,timeZone:s,labels:i,announce:u}),[e,d,s,i,u]);return Tt(Ie.Provider,{value:c,children:wr("div",{"data-cui-root":"","data-cui-surface":"surface","data-cui-fg":"fg","data-testid":n,children:[a,Tt("div",{className:"cui-visually-hidden",role:"status","aria-live":"polite","aria-atomic":"true","data-testid":`${n}-announcer`,ref:l})]})})},k=()=>{let e=xt(Ie);if(e===null)throw new Error("useConsoleUi must be called inside ConsoleUiRoot");return e},g=()=>{k()},Er=()=>k().announce;var pe=(e,t,r)=>{e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||(e.preventDefault(),r(t))};import{jsx as te,jsxs as wt}from"react/jsx-runtime";var Pr=({items:e,current:t,onNavigate:r,testId:n})=>{let{labels:a}=k();if(new Set(e.map(o=>o.id)).size!==e.length)throw new RangeError(`Breadcrumb keys must be unique: ${e.map(o=>o.id).join(", ")}`);return te("nav",{className:"cui-breadcrumb","aria-label":a.breadcrumb,"data-testid":n,children:wt("ol",{className:"cui-breadcrumb-list",role:"list","data-cui-type":"body",children:[e.map(o=>wt("li",{className:"cui-breadcrumb-item",children:[te("a",{className:"cui-link",href:o.href,"data-cui-fg":"info-fg","data-cui-type":"body","data-testid":`${n}-${o.id}`,onClick:i=>pe(i,o.href,r),children:o.label}),te("span",{className:"cui-breadcrumb-separator","aria-hidden":"true","data-cui-fg":"fg-muted",children:"\u203A"})]},o.id)),te("li",{className:"cui-breadcrumb-item",children:te("span",{"aria-current":"page","data-cui-fg":"fg","data-testid":`${n}-current`,children:t})})]})})};import{useId as Mr,useRef as Ir}from"react";var w=e=>{if(e===void 0)return{};for(let t of Object.keys(e))if(!t.startsWith("data-")||t.startsWith("data-cui-")||t==="data-testid")throw new RangeError(`Caller attributes must be data-* and must not override data-cui-* or data-testid: ${t}`);return e};import{useLayoutEffect as Cr}from"react";var Nr=new Set(["abbr","b","bdi","bdo","br","cite","code","data","del","dfn","em","i","ins","kbd","mark","q","s","samp","small","span","strong","sub","sup","time","u","var","wbr"]),kr=e=>{for(let t of e.querySelectorAll("*")){let r=t.localName;if(!Nr.has(r)||t.hasAttribute("tabindex")||t.hasAttribute("contenteditable"))return r}return null},H=(e,{testId:t,part:r,host:n})=>{Cr(()=>{let a=kr(e.current);if(a!==null)throw new RangeError(`${t}: the ${r} is the content of a ${n} and holds only non-interactive phrasing content, not <${a}>`)})};import{jsx as Lr}from"react/jsx-runtime";var P=({fg:e,type:t,face:r,as:n="span",space:a,testId:o,id:i,tabIndex:d,ref:s,children:l})=>(g(),Lr(n,{className:"cui-text","data-cui-fg":e,"data-cui-type":t,"data-cui-face":r,"data-cui-space":a,"data-cui-measure":n==="p"?"reading":void 0,"data-testid":o,id:i,tabIndex:d,ref:s,children:l}));var Sr=/\s/,Fe=(e,t)=>{if(e===""||Sr.test(e))throw new RangeError(`The id of ${t} must be one token without whitespace: "${e}"`);return e},z=(e,t)=>{if(e!==void 0){if(e.reason!==void 0){if(e.reason.trim()==="")throw new RangeError("An unavailable control needs a reason that is not blank");return t}return Fe(e.reasonId,"an unavailable control's reason")}},K=(...e)=>{let t=e.filter(r=>r!==void 0);return t.length===0?void 0:t.join(" ")};import{jsx as O,jsxs as Hr}from"react/jsx-runtime";var $r={primary:{fg:"on-solid",surface:"info-solid",type:"body"},secondary:{fg:"fg",surface:void 0,type:"body"},danger:{fg:"on-solid",surface:"danger-solid",type:"body"},link:{fg:"info-fg",surface:void 0,type:"body"}},Ae=({subject:e,children:t})=>{let r=Ir(null);return H(r,e),O("span",{ref:r,children:t})},F=({variant:e,children:t,testId:r,type:n="button",onClick:a,unavailable:o,describedBy:i,expanded:d,controls:s,ref:l,dataAttributes:p,busy:u,busyLabel:c})=>{g();let y=Mr(),f=z(o,y),m=u===!0||o!==void 0,h=$r[e],T=x=>{if(m){x.preventDefault();return}a?.(x)};return Hr("span",{className:"cui-button-group",children:[O("button",{className:"cui-button",type:n==="submit"?"submit":"button","data-cui-variant":e,"data-cui-fg":h.fg,"data-cui-surface":h.surface,"data-cui-type":h.type,"data-testid":r,"aria-disabled":m?!0:void 0,"aria-busy":u===!0?!0:void 0,"aria-describedby":K(i,f),"aria-expanded":d,"aria-controls":s,onClick:T,ref:l,...w(p),children:O(Ae,{subject:{testId:r,part:"label",host:"button"},children:u===!0?c:t})}),o?.reason===void 0?null:O(P,{fg:"fg-muted",type:"body",id:y,testId:`${r}-reason`,children:o.reason})]})},Fr=({onNavigate:e,children:t,testId:r,ref:n})=>(g(),O("button",{className:"cui-link",type:"button","data-cui-fg":"info-fg","data-cui-type":"body","data-testid":r,onClick:e,ref:n,children:O(Ae,{subject:{testId:r,part:"label",host:"button"},children:t})})),Ar=/^[^\s#]+$/,Dr=({targetId:e,children:t,testId:r,onFollow:n,dataAttributes:a})=>{if(g(),!Ar.test(e))throw new RangeError(`A fragment link needs the target's id without "#" or white space: "${e}"`);return O("a",{className:"cui-link",href:`#${e}`,"data-cui-fg":"info-fg","data-cui-type":"body","data-testid":r,onClick:n,...w(a),children:O(Ae,{subject:{testId:r,part:"label",host:"link"},children:t})})};import{useId as Pt}from"react";import{useCallback as Or}from"react";var Ur=229,Kr=new Set(["text","search","email","url","tel","password","number","date","datetime-local","month","time","week"]),De=e=>e instanceof HTMLTextAreaElement?e.value!=="":e instanceof HTMLInputElement&&Kr.has(e.type)&&(e.value!==""||e.validity.badInput),B=(e,t)=>{e.key!=="Escape"||e.nativeEvent.isComposing||e.keyCode===Ur||De(e.target)||(e.stopPropagation(),t())},Br=e=>Or(t=>B(t,e),[e]);import{Fragment as Gr,jsx as _,jsxs as re}from"react/jsx-runtime";var Ct=e=>e===void 0?void 0:t=>B(t,e),He=({id:e,title:t,description:r,actions:n,onEscape:a,testId:o,headingRef:i,ref:d,dataAttributes:s,children:l})=>{g();let p=Pt(),u=Ct(a);return re("section",{className:"cui-card",id:e,"aria-labelledby":p,"data-cui-surface":"surface","data-cui-fg":"fg","data-cui-type":"body","data-cui-face":"sans","data-testid":o,ref:d,onKeyDown:u,...w(s),children:[re("div",{className:"cui-card-header",children:[re("div",{className:"cui-card-heading",children:[_("h2",{className:"cui-card-title",id:p,"data-cui-type":"title","data-testid":`${o}-heading`,ref:i,tabIndex:i===void 0?void 0:-1,children:t}),r===void 0?null:_("div",{className:"cui-card-description","data-cui-fg":"fg-muted","data-cui-type":"body","data-cui-measure":"reading",children:r})]}),n===void 0?null:_("div",{className:"cui-card-actions",children:n})]}),l]})},_r={3:"h3",4:"h4"},qr=({id:e,title:t,subtitle:r,level:n=3,region:a=!1,onEscape:o,testId:i,headingRef:d,ref:s,dataAttributes:l,children:p})=>{g();let u=Pt(),c=Ct(o),y=_r[n],f=re(Gr,{children:[re("div",{className:"cui-card-section-heading",children:[_(y,{className:"cui-card-section-title",id:u,"data-cui-type":"body","data-testid":`${i}-heading`,ref:d,tabIndex:d===void 0?void 0:-1,children:t}),r===void 0?null:_("div",{className:"cui-card-section-subtitle","data-cui-fg":"fg-muted","data-cui-type":"body","data-cui-measure":"reading",children:r})]}),p]});return a?_("section",{className:"cui-card-section",id:e,"aria-labelledby":u,"data-testid":i,ref:s,onKeyDown:c,...w(l),children:f}):_("div",{className:"cui-card-section",id:e,"data-testid":i,ref:s,...w(l),children:f})};import{jsx as Nt}from"react/jsx-runtime";var Vr=({label:e,code:t,testId:r})=>(g(),Nt("section",{className:"cui-code-frame",tabIndex:0,"aria-label":e,"data-cui-surface":"sunken","data-testid":r,children:Nt("pre",{className:"cui-code","data-cui-fg":"fg","data-cui-type":"body","data-cui-face":"mono","data-testid":`${r}-code`,children:t})}));import{useId as zr}from"react";import{jsx as Wr}from"react/jsx-runtime";var J=({ruleKey:e,css:t})=>Wr("style",{href:e,precedence:"cui",children:t});import{jsx as N,jsxs as q}from"react/jsx-runtime";var Jr=({caption:e,attributes:t,columns:r,attributePx:n,columnMinPx:a,testId:o})=>{g();let i=zr();for(let u of[n,a])if(!(Number.isFinite(u)&&u>0))throw new RangeError(`ComparisonGrid widths must be positive px values: ${u}`);if(r.length===0)throw new RangeError("ComparisonGrid needs at least one column");for(let u of r)for(let c of t)if(!Object.hasOwn(u.cells,c.key))throw new RangeError(`Column "${u.key}" has no value for attribute "${c.key}"`);let d=n+r.length*a,s=`cui-comparison-a${n}-c${a}-n${r.length}`,l=u=>`[data-cui-comparison="${s}"][data-cui-comparison-layout="${u}"]`,p=`${l("table")}{display:none}@container (min-width:${I(d)}){${l("table")}{display:block}${l("stack")}{display:none}}`;return q("div",{className:"cui-container","data-cui-stack-below-px":d,"data-testid":o,children:[N(J,{ruleKey:s,css:p}),N("div",{className:"cui-comparison-frame","data-cui-comparison":s,"data-cui-comparison-layout":"table",children:q("table",{className:"cui-comparison-table","data-cui-type":"body",children:[N("caption",{className:"cui-visually-hidden",children:e}),q("colgroup",{children:[N("col",{style:{width:I(n)}}),r.map(u=>N("col",{},u.key))]}),N("thead",{children:q("tr",{children:[N("td",{}),r.map(u=>N("th",{scope:"col",children:u.heading},u.key))]})}),N("tbody",{children:t.map(u=>q("tr",{children:[N("th",{scope:"row",children:u.label}),r.map(c=>N("td",{children:c.cells[u.key]("table")},c.key))]},u.key))})]})}),N("div",{className:"cui-comparison-stack","data-cui-comparison":s,"data-cui-comparison-layout":"stack",children:r.map((u,c)=>{let y=`${i}-column-${c}`;return q("div",{className:"cui-comparison-column",role:"group","aria-labelledby":y,"data-cui-type":"body",children:[N("div",{className:"cui-comparison-heading",id:y,children:u.heading}),N("dl",{className:"cui-comparison-list",children:t.map(f=>q("div",{children:[N("dt",{children:f.label}),N("dd",{children:u.cells[f.key]("stack")})]},f.key))})]},u.key)})})]})};import{Fragment as Qr,useCallback as en,useId as tn,useLayoutEffect as St,useRef as Be}from"react";var ne="[data-cui-row-focus]",Oe="[data-cui-row-detail]",Xr=e=>e===null?[]:[...e.querySelectorAll(`:scope > ${ne}`)],kt=(e,t)=>{let r=new Map;t!==null&&r.set(t,0);let n=-1;for(let a of e===null?[]:e.children)a.matches(ne)?(n+=1,r.set(a,n)):n>=0&&a.matches(Oe)&&r.set(a,n);return r},Lt=(e,t,r,n)=>{let a=Xr(t);if(a.length===0)return r;let o=n.get(e);if(o===void 0)throw new RangeError(`rowFocusTarget: <${e.localName}> left holding focus with no position in the table (only its rows, row details and empty text hold one)`);return a[Math.min(o,a.length-1)]};import{useCallback as jr,useLayoutEffect as Ue,useReducer as Yr,useRef as Ke}from"react";var Zr=e=>e+1,oe=e=>{let t=Ke(e),r=Ke(null),n=Ke(!1),[,a]=Yr(Zr,0),o=jr((i=>()=>{n.current&&i.contains(document.activeElement)&&(r.current=i,a())}),[]);return Ue(()=>(n.current=!0,()=>{n.current=!1,r.current=null}),[]),Ue(()=>{t.current=e}),Ue(()=>{let i=r.current;if(i===null)return;r.current=null;let d=[null,document.body].includes(document.activeElement);i.isConnected||!d||t.current(i)?.focus()}),o};import{jsx as L,jsxs as ye}from"react/jsx-runtime";var rn=new Map,nn='a[href], audio[controls], button, details, embed, iframe, img[usemap], input:not([type="hidden"]), label, select, textarea, video[controls], [tabindex], [contenteditable]',on=(e,t,r)=>{St(()=>{let n=e.current;if(t!=="row-compact"||n===null)return;let a=[...n.querySelectorAll(nn)].find(o=>o.parentElement!==n);if(a!==void 0)throw new RangeError(`${r}: a compact row holds no control or focus target (a ${V} px target does not fit its ${ot} px; use row-control), not <${a.localName}>`)})},an=(e,t)=>{let r=e.filter(a=>a.rowHeader===!0).map(a=>a.key);if(r.length>1)throw new RangeError(`${t}: a table has at most one row header column, not ${r.length} (${r.join(", ")})`);let n=e.find(a=>a.rowHeader!==!0&&a.rowHeaderNote!==void 0);if(n!==void 0)throw new RangeError(`${t}: a row header note belongs to the row header column, not to ${n.key}`)},sn=e=>e==null?null:L("div",{className:"cui-table-header-note",children:e}),dn=(e,t,r,n,a)=>{let o=e.open(t);return L("tr",{ref:a,hidden:!o,"data-cui-row-detail":o?"open":"closed","data-testid":`${n}-detail`,children:L("td",{colSpan:r,id:e.id(t),children:o?e.render(t):null})})},ln=({caption:e,captionHidden:t,columns:r,rows:n,rowKey:a,rowTestId:o,rowData:i,rowSize:d,rowDetail:s,empty:l,testId:p,ref:u})=>{g();let c=tn(),y=Be(null);on(y,d,p);let f=Be(null),m=Be(rn),h=oe(b=>Lt(b,y.current,f.current,m.current));St(()=>{m.current=kt(y.current,f.current)});let T=en(b=>{f.current=b;let R=h(b);return()=>{f.current=null,R()}},[h]),x=lt(r);return an(r,p),L("div",{className:"cui-container","data-testid":p,ref:u,children:n.length===0?L(P,{as:"p",fg:"fg-muted",type:"prose",tabIndex:-1,ref:T,testId:`${p}-empty`,children:l}):L("section",{ref:h,className:"cui-table-frame",tabIndex:0,"aria-labelledby":c,"data-testid":`${p}-frame`,children:ye("table",{className:"cui-table","data-cui-type":"body","data-cui-row-size":d,style:{"--cui-table-min":I(x)},children:[L("caption",{className:t?"cui-visually-hidden":"cui-table-caption",id:c,children:e}),L("colgroup",{children:r.map(b=>L("col",{style:b.width.fixedPx===void 0?void 0:{width:I(b.width.fixedPx)}},b.key))}),L("thead",{children:L("tr",{children:r.map(b=>ye("th",{scope:"col","data-cui-align":b.align,"data-cui-surface":"subtle","data-cui-type":"caption",children:[b.header,b.note===void 0?null:L("div",{className:"cui-table-header-note",children:b.note})]},b.key))})}),L("tbody",{ref:y,children:n.map(b=>ye(Qr,{children:[L("tr",{ref:h,tabIndex:-1,"data-cui-row-focus":"","data-testid":o,...w(i?.(b)),children:r.map(R=>R.rowHeader===!0?ye("th",{scope:"row","data-cui-align":R.align,children:[R.cell(b),R.rowHeaderNote===void 0?null:sn(R.rowHeaderNote(b))]},R.key):L("td",{"data-cui-align":R.align,children:R.cell(b)},R.key))}),s===void 0?null:dn(s,b,r.length,o,h)]},a(b)))})]})})})};import{jsx as _e,jsxs as cn}from"react/jsx-runtime";var un=({items:e,testId:t})=>{if(g(),new Set(e.map(r=>r.key)).size!==e.length)throw new RangeError(`Description keys must be unique: ${e.map(r=>r.key).join(", ")}`);return _e("dl",{className:"cui-description-list","data-cui-type":"body","data-testid":t,children:e.map(r=>cn("div",{className:"cui-description-row","data-testid":`${t}-${r.key}`,children:[_e("dt",{"data-cui-fg":"fg-secondary",children:r.term}),_e("dd",{"data-cui-fg":"fg",children:r.description})]},r.key))})};import{useId as Mt,useLayoutEffect as It,useRef as $t}from"react";import{jsx as ae,jsxs as At}from"react/jsx-runtime";var Ft=e=>{e instanceof HTMLElement&&e.isConnected&&e.focus()},pn=({title:e,description:t,open:r,onClose:n,testId:a,children:o})=>{let{labels:i}=k(),d=Mt(),s=Mt(),l=$t(null),p=$t(null);return It(()=>{let y=l.current;r&&!y.open?(p.current=y.ownerDocument.activeElement,y.showModal()):!r&&y.open&&y.close()},[r]),It(()=>{let y=l.current;return()=>{y.open&&(y.close(),Ft(p.current),p.current=null)}},[]),At("dialog",{className:"cui-dialog","aria-labelledby":d,"aria-describedby":t===void 0?void 0:s,"data-cui-surface":"surface","data-cui-fg":"fg","data-cui-type":"body","data-cui-face":"sans","data-testid":a,ref:l,onClose:y=>{y.currentTarget.open||(Ft(p.current),p.current=null,r&&n())},onCancel:y=>{De(y.currentTarget.ownerDocument.activeElement)&&y.preventDefault()},children:[At("div",{className:"cui-dialog-header",children:[ae("h2",{className:"cui-dialog-title",id:d,"data-cui-type":"title",children:e}),ae("div",{className:"cui-dialog-actions",children:ae(F,{variant:"secondary",testId:`${a}-close`,onClick:()=>l.current?.close(),children:i.close})})]}),t===void 0?null:ae("div",{id:s,"data-cui-measure":"reading","data-testid":`${a}-description`,children:t}),o,ae("div",{className:"cui-visually-hidden",role:"status","aria-live":"polite","aria-atomic":"true",[$e]:"","data-testid":`${a}-announcer`})]})};import{useId as yn,useRef as fn}from"react";import{jsx as qe,jsxs as Dt}from"react/jsx-runtime";var mn=({summary:e,open:t,onOpenChange:r,testId:n,children:a})=>{g();let o=yn(),i=fn(null);return H(i,{testId:n,part:"summary",host:"button"}),Dt("div",{className:"cui-disclosure","data-testid":n,children:[Dt("button",{className:"cui-disclosure-button",type:"button","aria-expanded":t,"aria-controls":o,"data-cui-fg":"fg","data-cui-type":"body","data-testid":`${n}-button`,onClick:()=>r(!t),children:[qe("span",{className:"cui-disclosure-marker","aria-hidden":"true",children:t?"\u25BE":"\u25B8"}),qe("span",{ref:i,children:e})]}),qe("div",{className:"cui-disclosure-panel",id:o,hidden:!t,"data-testid":`${n}-panel`,children:a})]})};import{useId as X}from"react";import{Fragment as En,jsx as E,jsxs as $}from"react/jsx-runtime";var j=({description:e,error:t,errorId:r})=>{g();let n=X(),a=X(),o=X(),i=r===void 0?o:Fe(r,"a field's error"),d=[e===void 0?null:a,t===void 0?null:i].filter(l=>l!==null).join(" ");return{control:{id:n,"aria-describedby":d===""?void 0:d,"aria-invalid":t===void 0?void 0:!0},descriptionId:a,errorId:i}},Y=({description:e,error:t,descriptionId:r,errorId:n,testId:a})=>$(En,{children:[e===void 0?null:E(P,{as:"p",fg:"fg-muted",type:"body",id:r,testId:`${a}-description`,children:e}),t===void 0?null:E(P,{as:"p",fg:"danger-fg",type:"body",id:n,testId:`${a}-error`,children:t})]}),fe=({htmlFor:e,hidden:t,children:r})=>E("label",{className:t===!0?"cui-visually-hidden":"cui-field-label",htmlFor:e,"data-cui-type":"body",children:r}),gn=({label:e,description:t,error:r,errorId:n,testId:a,children:o})=>{let{control:i,descriptionId:d,errorId:s}=j({label:e,description:t,error:r,errorId:n});return $("div",{className:"cui-field","data-invalid":r!==void 0,"data-testid":a,children:[E(fe,{htmlFor:i.id,hidden:void 0,children:e}),o(i),E(Y,{description:t,error:r,descriptionId:d,errorId:s,testId:a})]})},Ht=({label:e,description:t,error:r,errorId:n,value:a,onValueChange:o,type:i,list:d,autoComplete:s,inputMode:l,prefix:p,labelHidden:u,required:c,testId:y,ref:f})=>{let{control:m,descriptionId:h,errorId:T}=j({label:e,description:t,error:r,errorId:n}),x=X();if(p!==void 0&&p.trim()==="")throw new RangeError("An input's prefix must not be blank");let b=i==="password",R=E("input",{className:"cui-input",type:i,value:a,list:d,autoComplete:s,inputMode:l,spellCheck:b?!1:void 0,autoCapitalize:b?"none":void 0,required:c,onChange:v=>o(v.target.value),"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"body","data-testid":y,ref:f,...m,"aria-describedby":K(p===void 0?void 0:x,m["aria-describedby"])});return $("div",{className:"cui-field","data-invalid":r!==void 0,"data-testid":`${y}-field`,children:[E(fe,{htmlFor:m.id,hidden:u,children:e}),p===void 0?R:$("div",{className:"cui-input-group",children:[E("span",{className:"cui-input-prefix",id:x,"data-cui-fg":"fg-secondary","data-cui-surface":"sunken","data-cui-type":"body","data-testid":`${y}-prefix`,children:p}),R]}),E(Y,{description:t,error:r,descriptionId:h,errorId:T,testId:y})]})},bn=e=>E(Ht,{...e}),hn=e=>E(Ht,{...e,type:"password"}),Rn=({label:e,description:t,error:r,errorId:n,value:a,onValueChange:o,required:i,testId:d,ref:s})=>{let{control:l,descriptionId:p,errorId:u}=j({label:e,description:t,error:r,errorId:n});return $("div",{className:"cui-field","data-invalid":r!==void 0,"data-testid":`${d}-field`,children:[E(fe,{htmlFor:l.id,hidden:void 0,children:e}),E("textarea",{className:"cui-input cui-textarea",value:a,required:i,onChange:c=>o(c.target.value),"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"prose","data-testid":d,ref:s,...l}),E(Y,{description:t,error:r,descriptionId:p,errorId:u,testId:d})]})},Tn=({label:e,description:t,error:r,errorId:n,value:a,options:o,onValueChange:i,labelHidden:d,unavailable:s,testId:l,ref:p})=>{let{control:u,descriptionId:c,errorId:y}=j({label:e,description:t,error:r,errorId:n}),f=X(),m=z(s,f);return $("div",{className:"cui-field","data-invalid":r!==void 0,"data-testid":`${l}-field`,children:[E(fe,{htmlFor:u.id,hidden:d,children:e}),E("select",{className:"cui-input",value:a,onChange:h=>{s===void 0&&i(h.target.value)},"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"body","data-testid":l,ref:p,...u,"aria-disabled":s===void 0?void 0:!0,"aria-describedby":K(u["aria-describedby"],m),children:o.map(h=>E("option",{value:h.value,children:h.label},h.value))}),E(Y,{description:t,error:r,descriptionId:c,errorId:y,testId:l}),s?.reason===void 0?null:E(P,{as:"p",fg:"fg-muted",type:"body",id:f,testId:`${l}-reason`,children:s.reason})]})},xn=({legend:e,description:t,error:r,errorId:n,value:a,options:o,onValueChange:i,testId:d,ref:s})=>{let l=X(),{control:p,descriptionId:u,errorId:c}=j({label:e,description:t,error:r,errorId:n});return $("fieldset",{className:"cui-radio-group","aria-describedby":p["aria-describedby"],"data-invalid":r!==void 0,"data-testid":d,children:[E("legend",{className:"cui-radio-group-legend","data-cui-type":"body",children:e}),o.map((y,f)=>$("label",{className:"cui-radio","data-cui-type":"body",children:[E("input",{type:"radio",name:l,value:y.value,checked:y.value===a,onChange:()=>i(y.value),"aria-invalid":p["aria-invalid"],"data-testid":`${d}-option-${y.value}`,ref:f===0?s:void 0}),E("span",{children:y.label})]},y.value)),E(Y,{description:t,error:r,descriptionId:u,errorId:c,testId:d})]})},vn=({legend:e,description:t,error:r,errorId:n,values:a,options:o,onValuesChange:i,testId:d,ref:s})=>{let{control:l,descriptionId:p,errorId:u}=j({label:e,description:t,error:r,errorId:n}),c=o.map(m=>m.value);if(c.length===0||new Set(c).size!==c.length)throw new RangeError(`A check box group needs at least one option with unique values: ${c.join(", ")}`);let y=a.filter(m=>!c.includes(m));if(y.length>0)throw new RangeError(`The chosen values are not options: ${y.join(", ")}`);let f=new Set(a);return $("fieldset",{className:"cui-checkbox-group","aria-describedby":l["aria-describedby"],"data-invalid":r!==void 0,"data-testid":d,children:[E("legend",{className:"cui-checkbox-group-legend","data-cui-type":"body",children:e}),o.map((m,h)=>$("label",{className:"cui-checkbox","data-cui-type":"body",children:[E("input",{type:"checkbox",value:m.value,checked:f.has(m.value),onChange:()=>i(c.filter(T=>T===m.value?!f.has(T):f.has(T))),"aria-invalid":l["aria-invalid"],"data-testid":`${d}-option-${m.value}`,ref:h===0?s:void 0}),E("span",{children:m.label})]},m.value)),E(Y,{description:t,error:r,descriptionId:p,errorId:u,testId:d})]})};import{createContext as wn,useContext as Pn,useId as _t,useMemo as Cn}from"react";import{Fragment as Wt,jsx as C,jsxs as me}from"react/jsx-runtime";var qt=wn(null),Ot="surface",Ut={neutral:{face:"surface",line:"border-control"},info:{face:"info-tint",line:"info-accent"},success:{face:"success-tint",line:"success-accent"},warning:{face:"warning-tint",line:"warning-accent"},danger:{face:"danger-tint",line:"danger-accent"}},Kt={face:"info-tint",line:"info-accent"},Gt={normal:"border-control",high:"info-accent"},Nn=["normal","high"],kn=[1,2,3,4],A=S.space["space-2"],Ln="fg",Sn="fg-secondary",Vt=e=>{let t=Pn(qt);if(t===null)throw new Error(`${e} must be rendered inside Figure`);return t},Ge=(e,t,r)=>{if(!(Number.isFinite(r)&&r>0&&r%4===0))throw new RangeError(`${e}: ${t} must be a positive multiple of the ${4} px lattice: ${r}`)},Mn=e=>{g();let t=_t(),{kind:r,widthPx:n,heightPx:a,testId:o,dataAttributes:i,children:d}=e;Ge(o,"widthPx",n),Ge(o,"heightPx",a);let s=Cn(()=>({kind:r,widthPx:n,heightPx:a,arrowIds:{normal:`${t}-arrow-normal`,high:`${t}-arrow-high`}}),[r,n,a,t]),l=me(Wt,{children:[C("defs",{children:Nn.map(y=>C("marker",{id:s.arrowIds[y],viewBox:`0 0 ${A} ${A}`,refX:A,refY:A/2,markerWidth:A,markerHeight:A,markerUnits:"userSpaceOnUse",orient:"auto","data-cui-emphasis":y,children:C("path",{d:`M 0 0 L ${A} ${A/2} L 0 ${A} z`,"data-cui-stroke":Gt[y],"data-testid":`${o}-arrow-${y}`})},y))}),C(qt.Provider,{value:s,children:d})]});if(e.kind==="group"){let{label:y,onEscape:f}=e;if(!D(y))throw new RangeError(`${o}: a group figure's label must hold a readable character: ${JSON.stringify(y)}`);return C("div",{className:"cui-figure-frame","data-testid":`${o}-frame`,children:C("svg",{className:"cui-figure",role:"group","aria-label":y,viewBox:`0 0 ${n} ${a}`,"data-cui-figure":"group","data-cui-surface":Ot,"data-cui-face":"sans",style:{"--cui-figure-inline":I(n),"--cui-figure-block":I(a)},onKeyDown:f===void 0?void 0:m=>B(m,f),"data-testid":o,...w(i),children:l})})}let{viewBox:p,pointer:u,svgRef:c}=e;return C("div",{className:"cui-container","data-testid":`${o}-frame`,children:C("svg",{ref:c,className:"cui-figure","aria-hidden":"true",viewBox:p===void 0?`0 0 ${n} ${a}`:p,"data-cui-figure":"decorative","data-cui-surface":Ot,"data-cui-face":"sans","data-cui-pan":u===void 0?void 0:"true","data-cui-cursor":u?.cursor,style:{"--cui-figure-inline":I(n),"--cui-figure-ratio":String(a/n)},"data-testid":o,...w(i),...u?.handlers,children:l})})},Bt=(e,t)=>{try{return t()}catch(r){throw new RangeError(`${e}: ${r.message}`,{cause:r})}},In=(e,t,r)=>{for(let n of t){let a=mt.light[n.fg],o=r.find(i=>a[i]===void 0);if(o!==void 0)throw new RangeError(`${e}: the note ${JSON.stringify(n.text)} in ${n.fg} is not in the contrast table on ${o}, a face the node takes`)}},$n=e=>{g();let t=Vt("FigureNode"),r=_t(),{x:n,y:a,shape:o,tone:i,outline:d,selected:s,name:l,title:p,press:u,testId:c,dataAttributes:y}=e,f=e.notes===void 0?[]:e.notes;if(!(Number.isFinite(n)&&Number.isFinite(a)))throw new RangeError(`${c}: a node's position must be finite: ${n}, ${a}`);if(t.kind==="group"&&u===void 0)throw new RangeError(`${c}: every node of a group figure must be pressable (pass press)`);if(t.kind==="decorative"&&u!==void 0)throw new RangeError(`${c}: a node of a decorative figure cannot be pressed (it is hidden from assistive technology)`);if(u!==void 0&&!D(u.label))throw new RangeError(`${c}: a pressable node's label must hold a readable character: ${JSON.stringify(u.label)}`);let m=s?Kt:Ut[i];In(c,f,[Ut[i].face,Kt.face]);let h,T,x;if(o.kind==="box"){if(l===null)throw new RangeError(`${c}: a box's name is drawn inside the box and sizes it, so it cannot be null (only a disc may be drawn without a name)`);let R=Bt(c,()=>at({name:l,notes:f.map(M=>M.text)}));if(Ge(c,"a box's widthPx",o.widthPx),o.widthPx<R.minWidthPx)throw new RangeError(`${c}: a box ${o.widthPx} px wide is narrower than its lines under the widest 1.4.12 spacing (${R.minWidthPx} px)`);h={width:o.widthPx,height:R.heightPx,left:n,top:a};let v=it(f.length);T=me("g",{"data-cui-surface":m.face,children:[C("rect",{className:"cui-figure-plate",width:o.widthPx,height:R.heightPx,rx:S.radius["radius-item"],"data-cui-fill":m.face,"data-cui-stroke":m.line,"data-testid":`${c}-plate`}),C("text",{className:"cui-figure-name",x:v.insetPx,y:v.namePx,fontSize:S.type.body.size,"data-cui-fg":Ln,"data-cui-figure-type":"body","data-testid":`${c}-name`,children:l}),f.map((M,ee)=>C("text",{x:v.insetPx,y:v.notesPx[ee],fontSize:S.type.caption.size,"data-cui-fg":M.fg,"data-cui-figure-type":"caption","data-testid":`${c}-note-${ee}`,children:M.text},ee))]}),x=C("rect",{className:"cui-figure-ring",x:-U,y:-U,width:o.widthPx+2*U,height:R.heightPx+2*U,rx:S.radius["radius-item"]+U,"data-cui-stroke":"focus","data-testid":`${c}-ring`})}else{let R=Bt(c,()=>st(l,o.radiusPx));h={width:2*o.radiusPx,height:2*o.radiusPx,left:n-o.radiusPx,top:a-o.radiusPx},T=me(Wt,{children:[C("g",{"data-cui-surface":m.face,children:C("circle",{className:"cui-figure-plate",r:o.radiusPx,"data-cui-fill":m.face,"data-cui-stroke":m.line,"data-testid":`${c}-plate`})}),l===null?null:C("text",{className:"cui-figure-label",x:0,y:R.extentBelowPx-S.type.caption.lineHeight/2,fontSize:S.type.caption.size,"data-cui-fg":Sn,"data-cui-figure-type":"caption","data-testid":`${c}-name`,children:l})]}),x=C("circle",{className:"cui-figure-ring",r:o.radiusPx+U,"data-cui-stroke":"focus","data-testid":`${c}-ring`})}if(u!==void 0){if(h.width<V||h.height<V)throw new RangeError(`${c}: a pressable node must be at least the ${V} px target: ${h.width} \xD7 ${h.height}`);if(h.left<W||h.top<W||h.left+h.width+W>t.widthPx||h.top+h.height+W>t.heightPx)throw new RangeError(`${c}: a pressable node must keep ${W} px to the figure's edge for its focus ring`)}let b=u===void 0?{}:{role:"button",tabIndex:0,"aria-label":u.label,"aria-describedby":u.description===void 0?void 0:r,"aria-expanded":u.expanded,"aria-controls":u.expanded?u.controls:void 0,onClick:R=>{R.currentTarget.focus(),u.onPress()},onKeyDown:R=>{R.key!=="Enter"&&R.key!==" "||(R.preventDefault(),R.repeat||u.onPress())}};return me("g",{className:"cui-figure-node",transform:`translate(${n} ${a})`,"data-cui-tone":i,"data-cui-outline":d,"data-selected":String(s),...b,"data-testid":c,...w(y),children:[p===void 0?null:C("title",{children:p}),u?.description===void 0?null:C("desc",{id:r,"data-testid":`${c}-description`,children:u.description}),u===void 0?null:x,T]})},Fn=({d:e,emphasis:t,weight:r,arrow:n,title:a,testId:o,dataAttributes:i})=>{g();let d=Vt("FigureEdge");if(!kn.includes(r))throw new RangeError(`${o}: an edge's weight must be 1, 2, 3 or 4: ${r}`);return C("path",{className:"cui-figure-edge",d:e,markerEnd:n?`url(#${d.arrowIds[t]})`:void 0,"data-cui-stroke":Gt[t],"data-cui-weight":r,"data-cui-emphasis":t,"data-testid":o,...w(i),children:a===void 0?null:C("title",{children:a})})};import{jsx as Hn}from"react/jsx-runtime";var An={1:"h1",2:"h2",3:"h3"},Dn=({level:e,type:t,testId:r,headingRef:n,children:a})=>{g();let o=An[e];return Hn(o,{className:"cui-heading","data-cui-type":t,"data-cui-fg":"fg","data-testid":r,ref:n,tabIndex:n===void 0?void 0:-1,children:a})};import{jsx as Kn}from"react/jsx-runtime";var On={removed:"danger-tint",added:"success-tint"},Un=({kind:e,testId:t,children:r})=>{if(g(),r==="")throw new RangeError(`${t}: a changed fragment must hold at least one character`);return Kn(e==="removed"?"del":"ins",{className:"cui-change","data-cui-change":e,"data-cui-surface":On[e],"data-cui-fg":"fg","data-testid":t,children:r})};import{jsx as qn}from"react/jsx-runtime";var Bn={neutral:{fg:"fg-secondary",surface:"sunken"},info:{fg:"info-fg",surface:"info-tint"},success:{fg:"success-fg",surface:"success-tint"},warning:{fg:"warning-fg",surface:"warning-tint"},danger:{fg:"danger-fg",surface:"danger-tint"}},_n={neutral:"neutral-solid",info:"info-solid",success:"success-solid",warning:"warning-solid",danger:"danger-solid"},Ve=({tone:e,variant:t,testId:r,dataAttributes:n,children:a})=>{g();let o=t==="tint"?Bn[e]:{fg:"on-solid",surface:_n[e]};return qn("span",{className:"cui-pill","data-cui-tone":e,"data-cui-variant":t,"data-cui-fg":o.fg,"data-cui-surface":o.surface,"data-cui-type":"caption","data-testid":r,...w(n),children:a})};import{useId as Gn}from"react";import{jsx as ie,jsxs as Vn}from"react/jsx-runtime";var We=({label:e,valueText:t,value:r,max:n,testId:a})=>{g();let o=Gn();if(n!==null){if(!(Number.isFinite(n)&&n>0))throw new RangeError(`Progress maximum must be positive: ${n}`);if(r===null||!(Number.isFinite(r)&&r>=0))throw new RangeError(`A determinate progress value must be a number >= 0: ${r}`)}let i=n===null?null:{max:n,now:Math.min(r,n)};return Vn("div",{className:"cui-progress","data-testid":a,children:[ie(P,{as:"p",fg:"fg",type:"body",id:o,children:e}),ie("div",{className:"cui-progress-track",role:"progressbar","aria-labelledby":o,"aria-valuetext":t,"aria-valuemin":i===null?void 0:0,"aria-valuemax":i?.max,"aria-valuenow":i?.now,"data-cui-surface":"sunken","data-cui-indeterminate":i===null,"data-testid":`${a}-bar`,children:ie("div",{className:"cui-progress-fill","data-cui-accent":"info-accent",style:i===null?void 0:{inlineSize:`${i.now/i.max*100}%`},"data-testid":`${a}-fill`})}),ie("div",{"aria-hidden":"true",children:ie(P,{as:"p",fg:"fg-secondary",type:"body",testId:`${a}-value`,children:t})})]})};import{jsx as ge,jsxs as zt}from"react/jsx-runtime";var Wn=({title:e,status:t,progress:r,cancel:n,testId:a,children:o})=>zt(He,{title:e,actions:n===void 0?void 0:ge(F,{variant:"secondary",busy:n.busy,busyLabel:n.busyLabel,onClick:n.onCancel,testId:`${a}-cancel`,children:n.label}),testId:a,children:[zt("div",{className:"cui-job-status",role:"status","aria-live":"polite","aria-atomic":"true","data-testid":`${a}-status`,children:[ge("span",{className:"cui-visually-hidden",children:`${e} `}),ge(Ve,{tone:t.tone,variant:"tint",testId:`${a}-status-pill`,children:t.label})]}),r===void 0?null:ge(We,{...r,testId:`${a}-progress`}),o]});import{createContext as zn,useContext as Jn}from"react";import{jsx as se}from"react/jsx-runtime";var ze=zn(null),Xn="space-2",jn=e=>{g();let{gap:t,label:r,id:n,hidden:a,testId:o,children:i}=e;if(r!==void 0&&!D(r))throw new RangeError(`${o}: a list's label must hold a readable character: ${JSON.stringify(r)}`);let d=e.marker==="none"?void 0:e.type,s=d!==void 0,l=e.marker==="number"||e.marker==="none"&&e.ordered?"ol":"ul";return se(ze.Provider,{value:e.marker,children:se(l,{className:"cui-list",role:"list","aria-label":r,id:n,hidden:a,"data-cui-gap":s?void 0:t,"data-cui-row-gap":s?t:void 0,"data-cui-column-gap":s?Xn:void 0,"data-cui-marker":s?e.marker:void 0,"data-cui-type":d,"data-testid":o,children:i})})},Yn=({testId:e,dataAttributes:t,children:r})=>{g();let n=Jn(ze);if(n===null)throw new Error("ListItem must be rendered inside List, not inside another ListItem");return se("li",{className:"cui-list-item","data-testid":e,...w(t),children:se("div",{className:"cui-list-body","data-cui-measure":n==="none"?void 0:"reading",children:se(ze.Provider,{value:null,children:r})})})};import{useCallback as Xt,useLayoutEffect as Qn,useRef as be}from"react";import{jsx as Jt}from"react/jsx-runtime";var Zn=({tone:e,testId:t,children:r})=>(g(),Jt("div",{className:"cui-notice","data-cui-tone":e,"data-cui-surface":e==="info"?"info-tint":"warning-tint","data-cui-fg":"fg","data-cui-type":"prose","data-cui-measure":"reading","data-testid":t,children:r})),de=({occurrence:e,testId:t,children:r})=>(g(),Jt("div",{className:"cui-alert",role:"alert","data-cui-surface":"danger-tint","data-cui-fg":"danger-fg","data-cui-type":"prose","data-cui-measure":"reading","data-cui-occurrence":e,"data-testid":t,children:r},e));import{jsx as he,jsxs as no}from"react/jsx-runtime";var jt=e=>[...e.querySelectorAll(ne)].filter(t=>{let r=t.closest(Oe);return r===null||!e.contains(r)}),eo=e=>{let t=e.ref.current;if(t===null)throw new Error("LoadMore: rows.ref is not attached to the element holding the rows");let r=jt(t);if(r.length!==e.count)throw new Error(`LoadMore: rows.ref holds ${r.length} ${ne} elements for ${e.count} rows`);return r},to=(e,t)=>{let r=-1;return e.forEach((n,a)=>{t.has(n)&&(r=a)}),e[r+1]},ro=({onLoad:e,busy:t,done:r,failure:n,limit:a,rows:o,testId:i})=>{let{formatLocale:d,labels:s}=k(),l=be(null),p=be(null),u=be(null),c=be(!1),y=()=>{let T=o.ref.current;l.current={shown:new Set(T===null?[]:jt(T)),failureOccurrence:n===null?null:n.occurrence,busySeen:!1},e()};Qn(()=>{let T=c.current;c.current=!1;let x=l.current;if(x===null)return;let b=eo(o);if(t){x.busySeen=!0,x.shown=new Set(b);return}let R=to(b,x.shown),v=n!==null&&n.occurrence!==x.failureOccurrence;if(!(x.busySeen||R!==void 0||v||r)||(l.current=null,v||R===void 0))return;let M=[null,document.body].includes(document.activeElement);(u.current!==null&&document.activeElement===u.current||T&&M)&&R.focus()});let f=oe(()=>r?p.current:u.current),m=Xt((T=>{u.current=T;let x=f(T);return()=>{u.current=null,c.current=T===document.activeElement,x()}}),[f]),h=Xt((T=>{p.current=T;let x=f(T);return()=>{p.current=null,x()}}),[f]);return r?he("div",{className:"cui-load-more","data-testid":i,children:he(P,{as:"p",fg:"fg-muted",type:"body",tabIndex:-1,ref:h,testId:`${i}-end`,children:s.endOfRecords})}):no("div",{className:"cui-load-more","data-testid":i,children:[he(F,{variant:"secondary",busy:t,busyLabel:s.loading,onClick:y,ref:m,testId:`${i}-button`,children:s.loadMore(ue(a,d))}),n===null?null:he(de,{occurrence:n.occurrence,testId:`${i}-failure`,children:s.loadFailed(n.reason)})]})};import{jsx as Je,jsxs as Yt}from"react/jsx-runtime";var oo=({master:e,detail:t,masterMinPx:r,detailMinPx:n,testId:a})=>{g();let o=dt({masterMinPx:r,detailMinPx:n,gapPx:S.space["space-6"]});return Yt("div",{className:"cui-container","data-testid":a,children:[Je(J,{ruleKey:o.key,css:o.css}),Yt("div",{className:"cui-master-detail","data-cui-master-detail":o.key,children:[Je("div",{className:"cui-master-detail-pane","data-testid":`${a}-master`,children:e}),Je("div",{className:"cui-master-detail-pane","data-testid":`${a}-detail`,children:t})]})]})};import{jsx as Re}from"react/jsx-runtime";var Te=e=>{let{formatLocale:t,labels:r}=k(),{testId:n}=e;if(e.keep===void 0){let{value:i,unit:d}=e;if(d!==void 0&&!D(d))throw new RangeError(`${n}: a unit must hold a readable character: ${JSON.stringify(d)}`);if(i===null)return Re("span",{className:"cui-measured","data-measured":"false","data-testid":n,children:r.unmeasured});let s=ue(i,t);return Re("span",{className:"cui-measured","data-measured":"true","data-testid":n,children:tt(s,d)})}let{text:a,keep:o}=e;if(a===null)return Re("span",{className:"cui-measured","data-measured":"false","data-cui-keep":o,"data-testid":n,children:r.unmeasured});if(!D(a))throw new RangeError(`${n}: a measured text must hold a readable character (pass null when the value was not measured): ${JSON.stringify(a)}`);return Re("span",{className:"cui-measured","data-measured":"true","data-cui-keep":o,"data-testid":n,children:a})};import{jsx as xe,jsxs as io}from"react/jsx-runtime";var ao=({label:e,value:t,min:r,max:n,valueText:a,testId:o})=>{if(g(),!(Number.isFinite(r)&&Number.isFinite(n)&&r<n))throw new RangeError(`Meter needs a finite range with min below max: min ${r}, max ${n}`);if(!(Number.isFinite(t)&&t>=r&&t<=n))throw new RangeError(`Meter value must be a finite number in its range: value ${t}, min ${r}, max ${n}`);return io("span",{className:"cui-meter","data-testid":o,children:[xe("span",{className:"cui-meter-track",role:"meter","aria-label":e,"aria-valuemin":r,"aria-valuemax":n,"aria-valuenow":t,"aria-valuetext":a,"data-cui-surface":"sunken","data-testid":`${o}-bar`,children:xe("span",{className:"cui-meter-fill","data-cui-accent":"info-accent",style:{inlineSize:`${(t-r)/(n-r)*100}%`},"data-testid":`${o}-fill`})}),xe("span",{"aria-hidden":"true",children:xe(P,{fg:"fg",type:"body",testId:`${o}-value`,children:a})})]})};import{useId as so,useRef as lo}from"react";import{jsx as Xe,jsxs as po}from"react/jsx-runtime";var uo={ArrowLeft:-1,ArrowRight:1},co=({label:e,items:t,value:r,onValueChange:n,testId:a,panelDescribedBy:o,children:i})=>{g();let d=so(),s=lo(new Map);if(t.length===0)throw new RangeError("PanelTabs needs at least one tab");let l=t.map(m=>m.id);if(new Set(l).size!==l.length)throw new RangeError(`Tab keys must be unique: ${l.join(", ")}`);let p=l.indexOf(r);if(p<0)throw new RangeError(`The selected tab "${r}" is not one of the tabs: ${l.join(", ")}`);let u=m=>`${d}-tab-${m}`,c=`${d}-panel`,y=m=>{let h=t[m];h.id!==r&&n(h.id),s.current.get(h.id)?.focus()};return po("div",{className:"cui-panel-tabs","data-testid":a,children:[Xe("div",{className:"cui-tabs-list",role:"tablist","aria-label":e,onKeyDown:m=>{let h=t.findIndex(R=>s.current.get(R.id)===m.target),T=h<0?p:h,x=uo[m.key],b;if(x!==void 0){let R=getComputedStyle(m.currentTarget).direction==="rtl"?-x:x;b=(T+R+t.length)%t.length}else if(m.key==="Home")b=0;else if(m.key==="End")b=t.length-1;else return;m.preventDefault(),y(b)},children:t.map((m,h)=>{let T=h===p;return Xe("button",{className:"cui-tab cui-panel-tab",type:"button",role:"tab",id:u(h),"aria-selected":T,"aria-controls":c,tabIndex:T?0:-1,"data-cui-fg":T?"fg":"fg-secondary","data-cui-type":"body","data-testid":`${a}-${m.id}`,ref:x=>{x===null?s.current.delete(m.id):s.current.set(m.id,x)},onClick:()=>y(h),children:m.label},m.id)})}),Xe("div",{role:"tabpanel",id:c,"aria-labelledby":u(p),"aria-describedby":o,"data-testid":`${a}-panel`,children:i})]})};import{jsx as Zt,jsxs as fo}from"react/jsx-runtime";var yo=({failure:e,onReload:t,forbiddenMessage:r,failureMessage:n,rescueRef:a,testId:o})=>{let{labels:i}=k();return fo("div",{className:"cui-resource-failed","data-testid":o,children:[Zt(de,{occurrence:e.occurrence,testId:`${o}-alert`,children:i.failureSentence(e,r,n===void 0?i.loadFailed:n)}),e.status===403?null:Zt(F,{variant:"secondary",busy:e.retrying,busyLabel:i.loading,onClick:t,ref:a,testId:`${o}-reload`,children:i.reload})]})};import{jsx as je,jsxs as go}from"react/jsx-runtime";var mo=({label:e,options:t,value:r,onValueChange:n,testId:a})=>{g();let o=new Set(t.map(i=>i.value));if(t.length<2||o.size!==t.length)throw new RangeError(`A segmented control needs at least two options with unique values: ${t.map(i=>i.value).join(", ")}`);if(!o.has(r))throw new RangeError(`The pressed value "${r}" is not one of the options: ${[...o].join(", ")}`);return go("fieldset",{className:"cui-segmented-group","data-testid":a,children:[je("legend",{className:"cui-segmented-legend","data-cui-type":"body",children:e}),je("div",{className:"cui-segmented",children:t.map(i=>{let d=i.value===r;return je("button",{className:"cui-segment",type:"button","aria-pressed":d,"data-cui-fg":d?"on-solid":"fg","data-cui-surface":d?"info-solid":void 0,"data-cui-type":"body","data-testid":`${a}-${i.value}`,onClick:()=>{d||n(i.value)},children:i.label},i.value)})})]})};import{useCallback as bo,useRef as ho}from"react";import{jsx as Z}from"react/jsx-runtime";var Qt=({selected:e,controls:t,onSelect:r,testId:n,dataAttributes:a,ref:o,children:i})=>{g();let d=ho(null);H(d,{testId:n,part:"row",host:"button"});let s=bo(l=>{if(d.current=l,typeof o=="function")return o(l);o!=null&&(o.current=l)},[o]);return Z("button",{className:"cui-row-button",type:"button","data-selected":e,"aria-expanded":e,"aria-controls":t,"data-cui-row-focus":"","data-cui-surface":e?"info-tint":"surface","data-cui-fg":"fg","data-cui-type":"body","data-testid":n,onClick:r,ref:s,...w(a),children:i})},Ro=({label:e,items:t,itemKey:r,selectedKey:n,onSelect:a,detailId:o,renderRow:i,rowTestId:d,rowData:s,empty:l,testId:p,ref:u})=>(g(),Z("div",{className:"cui-selectable","data-testid":p,ref:u,children:t.length===0?Z(P,{as:"p",fg:"fg-muted",type:"prose",testId:`${p}-empty`,children:l}):Z("ul",{className:"cui-selectable-list",role:"list","aria-label":e,children:t.map(c=>{let y=r(c);return Z("li",{children:Z(Qt,{selected:y===n,controls:o,onSelect:()=>a(c),testId:d,dataAttributes:s?.(c),children:i(c)})},y)})})}));import{useId as To}from"react";import{jsx as ve,jsxs as er}from"react/jsx-runtime";var xo=({label:e,value:t,min:r,max:n,step:a,valueText:o,onValueChange:i,testId:d})=>{g();let s=To();if(!([t,r,n,a].every(Number.isFinite)&&r<n&&a>0&&r<=t&&t<=n))throw new RangeError(`Slider needs finite min < max, a positive step and min <= value <= max: value ${t}, min ${r}, max ${n}, step ${a}`);let l=o(t);return er("div",{className:"cui-field","data-testid":`${d}-field`,children:[ve("label",{className:"cui-field-label",htmlFor:s,"data-cui-type":"body",children:e}),er("div",{className:"cui-slider",children:[ve("input",{className:"cui-slider-input",id:s,type:"range",min:r,max:n,step:a,value:t,"aria-valuetext":l,"data-testid":d,onChange:p=>i(p.currentTarget.valueAsNumber)}),ve("span",{className:"cui-slider-value","aria-hidden":"true",children:ve(P,{fg:"fg",type:"body",testId:`${d}-value`,children:l})})]})]})};import{jsx as tr}from"react/jsx-runtime";var vo=({gap:e,testId:t,children:r})=>(g(),tr("div",{className:"cui-stack","data-cui-gap":e,"data-testid":t,children:r})),Eo=({gap:e,as:t="div",testId:r,children:n})=>(g(),tr(t,{className:"cui-cluster","data-cui-gap":e,"data-testid":r,children:n}));import{jsx as Ye,jsxs as nr}from"react/jsx-runtime";var rr={done:0,current:1,pending:2},wo={done:{fg:"on-solid",surface:"success-solid"},current:{fg:"on-solid",surface:"info-solid"},pending:{fg:"fg-secondary",surface:void 0}},Po=({label:e,steps:t,testId:r})=>{let{labels:n}=k();if(t.length===0||new Set(t.map(o=>o.id)).size!==t.length)throw new RangeError(`A stepper needs at least one step with unique keys: ${t.map(o=>o.id).join(", ")}`);if(t.filter(o=>o.state==="current").length>1||t.some((o,i)=>i>0&&rr[o.state]<rr[t[i-1].state]))throw new RangeError(`Step states must run done, at most one current, then pending: ${t.map(o=>o.state).join(", ")}`);let a={done:n.stepDone,current:null,pending:n.stepPending};return Ye("ol",{className:"cui-stepper",role:"list","aria-label":e,"data-cui-type":"body","data-testid":r,children:t.map((o,i)=>{let d=wo[o.state],s=a[o.state];return nr("li",{className:"cui-step","aria-current":o.state==="current"?"step":void 0,"data-cui-step":o.state,"data-testid":`${r}-${o.id}`,children:[Ye("span",{className:"cui-step-marker","aria-hidden":"true","data-cui-fg":d.fg,"data-cui-surface":d.surface,"data-cui-type":"caption",children:o.state==="done"?"\u2713":i+1}),nr("span",{className:"cui-step-label","data-cui-fg":"fg",children:[o.label,s===null?null:Ye("span",{className:"cui-visually-hidden",children:` (${s})`})]})]},o.id)})})};import{useId as Co,useRef as No}from"react";import{jsx as Ee,jsxs as or}from"react/jsx-runtime";var ko=({label:e,labelHidden:t,checked:r,onCheckedChange:n,unavailable:a,testId:o,ref:i,dataAttributes:d})=>{g();let s=Co(),l=No(null);H(l,{testId:o,part:"label",host:"button"});let p=z(a,s),u=a!==void 0,c=or("button",{className:"cui-switch",type:"button",role:"switch","aria-checked":r,"aria-disabled":u?!0:void 0,"aria-describedby":K(p),"data-cui-fg":"fg","data-cui-type":"body","data-testid":o,ref:i,onClick:()=>{u||n(!r)},...w(d),children:[Ee("span",{className:"cui-switch-track","aria-hidden":"true","data-cui-surface":r?"info-solid":"sunken","data-testid":`${o}-track`,children:Ee("span",{className:"cui-switch-thumb","data-cui-surface":r?"surface":"neutral-solid","data-testid":`${o}-thumb`})}),Ee("span",{className:t===!0?"cui-visually-hidden":void 0,ref:l,children:e})]});return a?.reason===void 0?c:or("span",{className:"cui-button-group",children:[c,Ee(P,{fg:"fg-muted",type:"body",id:s,testId:`${o}-reason`,children:a.reason})]})};import{useCallback as Lo,useEffect as So,useId as Mo,useRef as ar,useState as Io}from"react";import{jsx as le,jsxs as ir}from"react/jsx-runtime";var $o=({label:e,items:t,currentId:r,onNavigate:n,testId:a,collapsible:o=!1})=>{if(g(),t.length===0)throw new RangeError("Tabs needs at least one tab");let i=new Set(t.map(f=>f.id));if(i.size!==t.length)throw new RangeError(`Tab keys must be unique: ${t.map(f=>f.id).join(", ")}`);let d=t.find(f=>f.id===r);if(d===void 0)throw new RangeError(`The current tab "${r}" is not one of the tabs: ${[...i].join(", ")}`);let[s,l]=Io(!1),p=ar(null),u=ar(null),c=Mo(),y=Lo(f=>{l(!1),f&&p.current?.contains(document.activeElement)&&u.current?.focus()},[]);return So(()=>{if(!(o&&s))return;let f=m=>{p.current!==null&&!p.current.contains(m.target)&&y(!0)};return document.addEventListener("pointerdown",f,!0),()=>document.removeEventListener("pointerdown",f,!0)},[o,s,y]),ir("nav",{ref:p,className:"cui-tabs","aria-label":e,"data-testid":a,"data-cui-collapsible":o?"":void 0,"data-cui-open":o&&s?"":void 0,onKeyDown:o&&s?f=>B(f,()=>y(!0)):void 0,children:[o?ir("button",{ref:u,type:"button",className:"cui-tabs-summary","aria-expanded":s,"aria-controls":c,"data-cui-fg":"fg","data-cui-type":"body","data-testid":`${a}-summary`,onClick:()=>l(f=>!f),children:[le("span",{className:"cui-tabs-summary-label",children:d.label}),le("span",{className:"cui-tabs-summary-marker","aria-hidden":"true",children:s?"\u25B4":"\u25BE"})]}):null,le("ul",{className:"cui-tabs-list",id:c,role:"list","data-cui-surface":o?"surface":void 0,children:t.map(f=>{let m=f.id===r;return le("li",{className:"cui-tabs-item",children:le("a",{className:"cui-tab",href:f.href,"aria-current":m?"page":void 0,"data-cui-fg":m?"fg":"fg-secondary","data-cui-type":"body","data-testid":`${a}-${f.id}`,onClick:h=>{pe(h,f.href,n),h.defaultPrevented&&y(!1)},children:f.label})},f.id)})})]})};import{Children as Fo,Fragment as Ao,isValidElement as Do}from"react";import{jsx as G,jsxs as dr}from"react/jsx-runtime";var Ho={neutral:"fg",danger:"danger-fg",warning:"warning-fg",success:"success-fg"},Oo=e=>{g();let{label:t,sublabel:r,tone:n,testId:a,dataAttributes:o}=e;if((e.text===void 0?e.value===null:e.text===null)&&n!=="neutral")throw new RangeError(`An unmeasured tile value carries no tone: ${n}`);let d=`${a}-value`;return dr("div",{className:"cui-tile","data-cui-surface":"subtle","data-cui-fg":"fg","data-cui-tone":n,"data-testid":a,...w(o),children:[G("p",{className:"cui-tile-label","data-cui-type":"caption","data-cui-measure":"reading",children:t}),G("p",{className:"cui-tile-sublabel","data-cui-fg":"fg-muted","data-cui-type":"caption","data-cui-measure":"reading",children:r}),G("p",{className:"cui-tile-value","data-cui-fg":Ho[n],"data-cui-type":"heading","data-cui-measure":"reading",children:e.text===void 0?G(Te,{value:e.value,unit:e.unit,testId:d}):G(Te,{text:e.text,keep:"wrap",testId:d})})]})},sr=e=>Fo.toArray(e).flatMap(t=>{if(!Do(t))throw new RangeError(`TileGrid children must be tile elements, not text: ${String(t)}`);return t.type===Ao?sr(t.props.children):[t]}),Uo=({count:e,minInlinePx:t,testId:r,children:n})=>{g();let a=ut(e,t,S.space["space-2"]),o=sr(n).length;if(o!==e)throw new RangeError(`TileGrid has ${o} tiles but count is ${e}`);return dr("div",{className:"cui-container","data-testid":r,children:[G(J,{ruleKey:a.key,css:a.css}),G("div",{className:"cui-tile-grid","data-cui-tile-grid":a.key,"data-cui-gap":"space-2",children:n})]})};import{useLayoutEffect as Ko,useRef as lr}from"react";import{jsx as _o}from"react/jsx-runtime";var we=e=>[...e.querySelectorAll("button")],Bo=({label:e,testId:t,children:r})=>{g();let n=lr(null),a=lr(null);Ko(()=>{let s=we(n.current),l=a.current!==null&&s.includes(a.current)?a.current:s[0]??null;a.current=l;for(let p of s)p.tabIndex=p===l?0:-1});let o=s=>{for(let l of we(n.current))l.tabIndex=l===s?0:-1;a.current=s};return _o("div",{className:"cui-toolbar",role:"toolbar","aria-label":e,"aria-orientation":"horizontal","data-testid":t,ref:n,onFocus:s=>{let l=we(s.currentTarget).find(p=>p.contains(s.target));l!==void 0&&o(l)},onKeyDown:s=>{let l=we(s.currentTarget),p=l.indexOf(s.target);if(p===-1)return;let u=getComputedStyle(s.currentTarget).direction==="rtl"?"ArrowLeft":"ArrowRight",c=u==="ArrowRight"?"ArrowLeft":"ArrowRight",f={[u]:(p+1)%l.length,[c]:(p-1+l.length)%l.length,Home:0,End:l.length-1}[s.key];if(f===void 0)return;s.preventDefault();let m=l[f];o(m),m.focus()},children:r})};import{useCallback as Q,useEffect as Vo,useLayoutEffect as cr,useRef as et}from"react";import{useCallback as Pe,useEffect as qo,useLayoutEffect as Go,useRef as Ze,useState as Qe}from"react";var ur=e=>e===null?Ne:ke,Ce=(e,t,r,n,a)=>{let[o,i]=Qe(()=>({key:e,state:ur(e)})),[d,s]=Qe(0),[l,p]=Qe(0),u=Ze(t),c=Ze(null),y=Ze(d);Go(()=>{u.current=t}),qo(()=>{if(e===null){i({key:null,state:Ne});return}let b=new AbortController;c.current=e;let R=d===y.current?"revision":"reload";return y.current=d,i(v=>Object.is(v.key,e)?{key:e,state:n(v.state,R)}:{key:e,state:ke}),u.current(b.signal).then(v=>{b.signal.aborted||(c.current=null,i(M=>({key:e,state:a(M.state,v)})))},v=>{b.signal.aborted||i(()=>{throw v})}),()=>{b.abort(),c.current=null}},[e,r,d,l]);let f=Pe(()=>s(b=>b+1),[]),m=Pe(()=>p(b=>b+1),[]),h=Pe((b,R)=>{i(v=>Object.is(v.key,b)?{key:b,state:R(v.state)}:v)},[]),T=Pe((b,R)=>{h(b,R),Object.is(c.current,b)&&m()},[h,m]);return{state:Object.is(o.key,e)?o.state:ur(e),reload:f,refresh:m,update:h,write:T}};var Wo=(e,t,r)=>{let n=et(t);cr(()=>{n.current=t});let a=Q(T=>n.current.first(T),[]),{state:o,reload:i,refresh:d,update:s,write:l}=Ce(e,a,r,ct,pt),p=et({key:e,state:o});cr(()=>{p.current={key:e,state:o}});let u=et(null),c=Q(()=>{u.current?.controller.abort(),u.current=null},[]);Vo(()=>c,[e,r,c]);let y=Q(()=>{c(),i()},[c,i]),f=Q(()=>{c(),d()},[c,d]),m=Q(()=>{let{key:T,state:x}=p.current;if(T===null||x.kind!=="ready"||x.refreshing||x.value.next===null||x.value.loadingMore)throw new Error("usePagedResource: loadMore needs a shown list with a next cursor, no page in flight and no re-read in flight");let b=x.value.next,R={key:T,controller:new AbortController,maps:[]};u.current=R,s(T,yt),n.current.next(b,R.controller.signal).then(v=>{u.current===R&&(u.current=null,s(T,M=>R.maps.reduce((ee,pr)=>Me(ee,pr),ft(M,b,v))))},v=>{u.current===R&&s(T,()=>{throw v})})},[s]),h=Q((T,x)=>{let b=u.current;b!==null&&Object.is(b.key,T)&&b.maps.push(x),l(T,R=>Me(R,x))},[l]);return{state:o,reload:y,refresh:f,loadMore:m,updateList:h}};import{useCallback as zo,useRef as Jo,useState as Xo}from"react";var jo=e=>typeof e=="object"&&e!==null&&typeof e.then=="function",Yo=()=>{let[e,t]=Xo(null),r=Jo(null),n=zo((a,o)=>{let i=o();if(!jo(i))return;let d=Symbol(a);r.current=d,t(a);let s=()=>{r.current===d&&(r.current=null,t(null))};i.then(s,s)},[]);return{pendingKey:e,press:n}};import{useCallback as Zo}from"react";var Qo=(e,t,r)=>{let{state:n,reload:a,refresh:o,write:i}=Ce(e,t,r,rt,Le),d=Zo((s,l)=>i(s,p=>Le(p,{ok:!0,value:l})),[i]);return{state:n,reload:a,refresh:o,put:d}};import{jsx as ta}from"react/jsx-runtime";var ea=({testId:e,children:t})=>(g(),ta("span",{className:"cui-visually-hidden","data-testid":e,children:t}));export{ce as ANNOUNCE_SETTLE_MS,de as AlertMessage,Pr as Breadcrumb,F as Button,ot as COMPACT_ROW_PX,ya as CONSOLE_UI_LABEL_CATALOGS,$a as CONTRAST_MINIMUM,mt as CONTRAST_PAIRS,He as Card,qr as CardSection,vn as CheckboxGroup,Eo as Cluster,Vr as CodeBlock,Jr as ComparisonGrid,vr as ConsoleUiRoot,ln as DataTable,un as DescriptionList,pn as Dialog,mn as Disclosure,W as FIGURE_RING_REACH_PX,va as FLEXIBLE_COLUMN_MIN_PX,gn as Field,Mn as Figure,Fn as FigureEdge,$n as FigureNode,Dr as FragmentLink,yr as HTTP_FORBIDDEN,Dn as Heading,Un as InlineChange,Wn as JobCard,Se as LATTICE_PX,Fr as Link,jn as List,Yn as ListItem,ro as LoadMore,oo as MasterDetail,Te as Measured,ao as Meter,Oo as MetricTile,Zn as Notice,co as PanelTabs,hn as PasswordInput,Ve as Pill,We as ProgressBar,ma as ROW_WITH_CONTROL_PX,xn as RadioGroup,yo as ResourceFailed,Qt as RowButton,mo as SegmentedControl,Tn as Select,Ro as SelectableList,xo as Slider,vo as Stack,Po as Stepper,ko as Switch,V as TARGET_PX,S as TOKENS,Oa as TONES,Da as TONE_HUES,Ha as TONE_ROLES,$o as Tabs,P as Text,Rn as TextArea,bn as TextInput,Uo as TileGrid,Bo as Toolbar,ea as VisuallyHidden,aa as ZonedTimeError,yt as beginPage,ct as beginPagedReload,rt as beginReload,Ra as ceil8,fa as ceilToLattice,Ta as cellContentInlinePx,Ea as comparisonAttributePx,Ia as contrastRatio,Pa as countSampleText,ga as cssVar,at as figureBoxPlan,st as figureDiscLabelPlan,la as fillLabel,xa as fixedColumnPx,ca as flatMapOutcome,ra as formatByteSize,ue as formatCount,da as formatInstant,ka as goldenSectionPx,Ma as hexToSrgb,wa as instantSampleText,D as isReadableText,Le as keepLastGood,Fa as lightDark,ua as mapOutcome,Me as mapPagedList,La as masterDetailPlan,ha as monoTextWidthEm,Aa as placeholderRule,I as pxToRem,na as readDecimalText,oa as readIntegerText,pa as reasonAside,nt as resolveConsoleUiLabels,pt as settleFirstPage,ft as settlePage,Na as spacedTextWidthEm,Sa as tableFrameMinInlinePx,lt as tableMinInlinePx,ba as textWidthEm,ut as tileGridPlan,Ca as tileMinInlinePx,ia as toOffsetIso,sa as toWallTime,Er as useAnnounce,k as useConsoleUi,Br as useEscapeToClose,oe as useFocusRescue,Wo as usePagedResource,Yo as usePendingPress,Qo as useResource};
1
+ import{$ as bt,A as S,B as va,C as wa,D as Pa,E as Ca,F as Na,G as ka,H as La,I as Ma,J as Sa,K as Ia,L as $a,M as Aa,N as lt,O as ut,P as ct,Q as z,R as U,S as Fa,T as I,U as Da,V as pt,W as yt,X as Ha,Y as ft,Z as mt,_ as gt,a as ue,aa as ht,b as la,ba as Ie,c as at,ca as Ba,d as ua,da as _a,e as ca,ea as qa,f as D,fa as Ga,g as pa,ga as Va,h as ya,i as fa,j as ma,k as ga,l as hn,m as ba,n as ha,o as ke,p as Le,q as it,r as Me,s as Ra,t as Ta,u as st,v as Se,w as Ea,x as W,y as xa,z as dt}from"./chunk-5TR7VUZM.js";import{a as Oa,b as Ka,c as Ua,d as Rt}from"./chunk-FXEGLGL7.js";import{createContext as Rn,useCallback as Tn,useContext as Pt,useLayoutEffect as En,useMemo as Tt,useRef as Et}from"react";import{jsx as wt,jsxs as Ln}from"react/jsx-runtime";var $e=Rn(null),Ct=" ",xt='[inert], [aria-hidden="true" i]',Nt="dialog:modal",Ae="data-cui-dialog-announcer",xn=`:scope > [${Ae}]`,vn=e=>{if(e.closest(xt)!==null)return{hidden:'an ancestor is inert or aria-hidden="true"'};let t=e.ownerDocument,n=[...t.querySelectorAll(Nt)],r=t.activeElement,a=n.filter(s=>s.contains(r)),o=a.length>0?a:n;if(o.every(s=>s.contains(e)))return{region:e};let i=o.find(s=>o.every(u=>u.contains(s)));if(i===void 0)return{hidden:"focus is in no open modal dialog and they do not nest, so which one is topmost cannot be told"};let l=i.querySelector(xn);return l===null?{hidden:"the topmost open modal dialog neither contains the console nor is a Dialog"}:l.closest(xt)!==null?{hidden:'the topmost open modal dialog is a Dialog whose live region has an inert or aria-hidden="true" ancestor'}:{region:l}},wn=e=>{try{e.querySelectorAll(Nt)}catch(t){throw typeof t=="object"&&t!==null&&"name"in t&&t.name==="SyntaxError"?new Error("ConsoleUiRoot requires the :modal selector (Chrome 105, Firefox 103, Safari 15.6, jsdom 27 or later): announcements check whether a modal dialog hides the live region",{cause:t}):t}},ce=150,Pn=1e3,vt=new WeakMap,Cn=(e,t)=>{let n=vt.get(e)??new Set,r={text:t};vt.set(e,n.add(r)),setTimeout(()=>n.delete(r),ce);let a=e.ownerDocument.createElement("span");a.textContent=[...n].map(o=>o.text).join(Ct),e.replaceChildren(a)},Nn=({locale:e,formatLocale:t,timeZone:n,testId:r,children:a})=>{if(Pt($e)!==null)throw new Error("ConsoleUiRoot must not be rendered inside another ConsoleUiRoot (a console has exactly one root)");let i=st(e),[l]=Intl.getCanonicalLocales(t),s=Tt(()=>new Intl.DateTimeFormat(l,{timeZone:n}).resolvedOptions().timeZone,[l,n]),u=Et(null),p=Et(null);En(()=>{wn(u.current.ownerDocument)},[]);let d=Tn(b=>{if(b.trim()==="")throw new RangeError("announce: text must be a non-empty sentence");let f=()=>{let{texts:T,settle:m,deadline:E}=p.current;p.current=null,clearTimeout(m),clearTimeout(E);let h=u.current;if(h===null)return;let R=T.join(Ct),x=vn(h);if("hidden"in x)throw new Error(`announce: the live region is hidden from assistive technology (${x.hidden}), so this announcement would be lost: ${R}`);Cn(x.region,R)},y=p.current;if(y===null){p.current={texts:[b],settle:setTimeout(f,ce),deadline:setTimeout(f,Pn)};return}y.texts.push(b),clearTimeout(y.settle),y.settle=setTimeout(f,ce)},[]),c=Tt(()=>({locale:e,formatLocale:l,timeZone:s,labels:i,announce:d}),[e,l,s,i,d]);return wt($e.Provider,{value:c,children:Ln("div",{"data-cui-root":"","data-cui-surface":"surface","data-cui-fg":"fg","data-testid":r,children:[a,wt("div",{className:"cui-visually-hidden",role:"status","aria-live":"polite","aria-atomic":"true","data-testid":`${r}-announcer`,ref:u})]})})},k=()=>{let e=Pt($e);if(e===null)throw new Error("useConsoleUi must be called inside ConsoleUiRoot");return e},g=()=>{k()},kn=()=>k().announce;var pe=(e,t,n)=>{e.defaultPrevented||e.button!==0||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||(e.preventDefault(),n(t))};import{jsx as te,jsxs as kt}from"react/jsx-runtime";var Mn=({items:e,current:t,onNavigate:n,testId:r})=>{let{labels:a}=k();if(new Set(e.map(o=>o.id)).size!==e.length)throw new RangeError(`Breadcrumb keys must be unique: ${e.map(o=>o.id).join(", ")}`);return te("nav",{className:"cui-breadcrumb","aria-label":a.breadcrumb,"data-testid":r,children:kt("ol",{className:"cui-breadcrumb-list",role:"list","data-cui-type":"body",children:[e.map(o=>kt("li",{className:"cui-breadcrumb-item",children:[te("a",{className:"cui-link",href:o.href,"data-cui-fg":"info-fg","data-cui-type":"body","data-testid":`${r}-${o.id}`,onClick:i=>pe(i,o.href,n),children:o.label}),te("span",{className:"cui-breadcrumb-separator","aria-hidden":"true","data-cui-fg":"fg-muted",children:"\u203A"})]},o.id)),te("li",{className:"cui-breadcrumb-item",children:te("span",{"aria-current":"page","data-cui-fg":"fg","data-testid":`${r}-current`,children:t})})]})})};import{useId as Dn,useRef as Hn}from"react";var w=e=>{if(e===void 0)return{};for(let t of Object.keys(e))if(!t.startsWith("data-")||t.startsWith("data-cui-")||t==="data-testid")throw new RangeError(`Caller attributes must be data-* and must not override data-cui-* or data-testid: ${t}`);return e};var ye=e=>{let t=e.currentTarget;t.ownerDocument.activeElement!==t&&t.focus({preventScroll:!0})};import{useLayoutEffect as Sn}from"react";var In=new Set(["abbr","b","bdi","bdo","br","cite","code","data","del","dfn","em","i","ins","kbd","mark","q","s","samp","small","span","strong","sub","sup","time","u","var","wbr"]),$n=e=>{for(let t of e.querySelectorAll("*")){let n=t.localName;if(!In.has(n)||t.hasAttribute("tabindex")||t.hasAttribute("contenteditable"))return n}return null},H=(e,{testId:t,part:n,host:r})=>{Sn(()=>{let a=$n(e.current);if(a!==null)throw new RangeError(`${t}: the ${n} is the content of a ${r} and holds only non-interactive phrasing content, not <${a}>`)})};import{jsx as An}from"react/jsx-runtime";var P=({fg:e,type:t,face:n,as:r="span",space:a,testId:o,id:i,tabIndex:l,ref:s,children:u})=>(g(),An(r,{className:"cui-text","data-cui-fg":e,"data-cui-type":t,"data-cui-face":n,"data-cui-space":a,"data-cui-measure":r==="p"?"reading":void 0,"data-testid":o,id:i,tabIndex:l,ref:s,children:u}));var Fn=/\s/,Fe=(e,t)=>{if(e===""||Fn.test(e))throw new RangeError(`The id of ${t} must be one token without whitespace: "${e}"`);return e},J=(e,t)=>{if(e!==void 0){if(e.reason!==void 0){if(e.reason.trim()==="")throw new RangeError("An unavailable control needs a reason that is not blank");return t}return Fe(e.reasonId,"an unavailable control's reason")}},B=(...e)=>{let t=e.filter(n=>n!==void 0);return t.length===0?void 0:t.join(" ")};import{jsx as O,jsxs as _n}from"react/jsx-runtime";var On={primary:{fg:"on-solid",surface:"info-solid",type:"body"},secondary:{fg:"fg",surface:void 0,type:"body"},danger:{fg:"on-solid",surface:"danger-solid",type:"body"},link:{fg:"info-fg",surface:void 0,type:"body"}},De=({subject:e,children:t})=>{let n=Hn(null);return H(n,e),O("span",{ref:n,children:t})},A=({variant:e,children:t,testId:n,type:r="button",onClick:a,unavailable:o,describedBy:i,expanded:l,controls:s,ref:u,dataAttributes:p,busy:d,busyLabel:c})=>{g();let b=Dn(),f=J(o,b),y=d===!0||o!==void 0,T=On[e],m=E=>{if(ye(E),y){E.preventDefault();return}a?.(E)};return _n("span",{className:"cui-button-group",children:[O("button",{className:"cui-button",type:r==="submit"?"submit":"button","data-cui-variant":e,"data-cui-fg":T.fg,"data-cui-surface":T.surface,"data-cui-type":T.type,"data-testid":n,"aria-disabled":y?!0:void 0,"aria-busy":d===!0?!0:void 0,"aria-describedby":B(i,f),"aria-expanded":l,"aria-controls":s,onClick:m,ref:u,...w(p),children:O(De,{subject:{testId:n,part:"label",host:"button"},children:d===!0?c:t})}),o?.reason===void 0?null:O(P,{fg:"fg-muted",type:"body",id:b,testId:`${n}-reason`,children:o.reason})]})},Kn=({onNavigate:e,children:t,testId:n,ref:r})=>(g(),O("button",{className:"cui-link",type:"button","data-cui-fg":"info-fg","data-cui-type":"body","data-testid":n,onClick:e,ref:r,children:O(De,{subject:{testId:n,part:"label",host:"button"},children:t})})),Un=/^[^\s#]+$/,Bn=({targetId:e,children:t,testId:n,onFollow:r,dataAttributes:a})=>{if(g(),!Un.test(e))throw new RangeError(`A fragment link needs the target's id without "#" or white space: "${e}"`);return O("a",{className:"cui-link",href:`#${e}`,"data-cui-fg":"info-fg","data-cui-type":"body","data-testid":n,onClick:r,...w(a),children:O(De,{subject:{testId:n,part:"label",host:"link"},children:t})})};import{useId as Lt}from"react";import{useCallback as qn}from"react";var Gn=229,Vn=new Set(["text","search","email","url","tel","password","number","date","datetime-local","month","time","week"]),He=e=>e instanceof HTMLTextAreaElement?e.value!=="":e instanceof HTMLInputElement&&Vn.has(e.type)&&(e.value!==""||e.validity.badInput),Oe=e=>e.nativeEvent.isComposing||e.keyCode===Gn,_=(e,t)=>{e.key!=="Escape"||Oe(e)||He(e.target)||(e.stopPropagation(),t())},Wn=e=>qn(t=>_(t,e),[e]);import{Fragment as Xn,jsx as q,jsxs as ne}from"react/jsx-runtime";var Mt=e=>e===void 0?void 0:t=>_(t,e),Ke=({id:e,title:t,description:n,actions:r,onEscape:a,testId:o,headingRef:i,ref:l,dataAttributes:s,children:u})=>{g();let p=Lt(),d=Mt(a);return ne("section",{className:"cui-card",id:e,"aria-labelledby":p,"data-cui-surface":"surface","data-cui-fg":"fg","data-cui-type":"body","data-cui-face":"sans","data-testid":o,ref:l,onKeyDown:d,...w(s),children:[ne("div",{className:"cui-card-header",children:[ne("div",{className:"cui-card-heading",children:[q("h2",{className:"cui-card-title",id:p,"data-cui-type":"title","data-testid":`${o}-heading`,ref:i,tabIndex:i===void 0?void 0:-1,children:t}),n===void 0?null:q("div",{className:"cui-card-description","data-cui-fg":"fg-muted","data-cui-type":"body","data-cui-measure":"reading",children:n})]}),r===void 0?null:q("div",{className:"cui-card-actions",children:r})]}),u]})},zn={3:"h3",4:"h4"},Jn=({id:e,title:t,subtitle:n,level:r=3,region:a=!1,onEscape:o,testId:i,headingRef:l,ref:s,dataAttributes:u,children:p})=>{g();let d=Lt(),c=Mt(o),b=zn[r],f=ne(Xn,{children:[ne("div",{className:"cui-card-section-heading",children:[q(b,{className:"cui-card-section-title",id:d,"data-cui-type":"body","data-testid":`${i}-heading`,ref:l,tabIndex:l===void 0?void 0:-1,children:t}),n===void 0?null:q("div",{className:"cui-card-section-subtitle","data-cui-fg":"fg-muted","data-cui-type":"body","data-cui-measure":"reading",children:n})]}),p]});return a?q("section",{className:"cui-card-section",id:e,"aria-labelledby":d,"data-testid":i,ref:s,onKeyDown:c,...w(u),children:f}):q("div",{className:"cui-card-section",id:e,"data-testid":i,ref:s,...w(u),children:f})};import{jsx as St}from"react/jsx-runtime";var jn=({label:e,code:t,testId:n})=>(g(),St("section",{className:"cui-code-frame",tabIndex:0,"aria-label":e,"data-cui-surface":"sunken","data-testid":n,children:St("pre",{className:"cui-code","data-cui-fg":"fg","data-cui-type":"body","data-cui-face":"mono","data-testid":`${n}-code`,children:t})}));import{useId as Zn}from"react";import{jsx as Yn}from"react/jsx-runtime";var X=({ruleKey:e,css:t})=>Yn("style",{href:e,precedence:"cui",children:t});import{jsx as N,jsxs as G}from"react/jsx-runtime";var Qn=({caption:e,attributes:t,columns:n,attributePx:r,columnMinPx:a,testId:o})=>{g();let i=Zn();for(let d of[r,a])if(!(Number.isFinite(d)&&d>0))throw new RangeError(`ComparisonGrid widths must be positive px values: ${d}`);if(n.length===0)throw new RangeError("ComparisonGrid needs at least one column");for(let d of n)for(let c of t)if(!Object.hasOwn(d.cells,c.key))throw new RangeError(`Column "${d.key}" has no value for attribute "${c.key}"`);let l=r+n.length*a,s=`cui-comparison-a${r}-c${a}-n${n.length}`,u=d=>`[data-cui-comparison="${s}"][data-cui-comparison-layout="${d}"]`,p=`${u("table")}{display:none}@container (min-width:${I(l)}){${u("table")}{display:block}${u("stack")}{display:none}}`;return G("div",{className:"cui-container","data-cui-stack-below-px":l,"data-testid":o,children:[N(X,{ruleKey:s,css:p}),N("div",{className:"cui-comparison-frame","data-cui-comparison":s,"data-cui-comparison-layout":"table",children:G("table",{className:"cui-comparison-table","data-cui-type":"body",children:[N("caption",{className:"cui-visually-hidden",children:e}),G("colgroup",{children:[N("col",{style:{width:I(r)}}),n.map(d=>N("col",{},d.key))]}),N("thead",{children:G("tr",{children:[N("td",{}),n.map(d=>N("th",{scope:"col",children:d.heading},d.key))]})}),N("tbody",{children:t.map(d=>G("tr",{children:[N("th",{scope:"row",children:d.label}),n.map(c=>N("td",{children:c.cells[d.key]("table")},c.key))]},d.key))})]})}),N("div",{className:"cui-comparison-stack","data-cui-comparison":s,"data-cui-comparison-layout":"stack",children:n.map((d,c)=>{let b=`${i}-column-${c}`;return G("div",{className:"cui-comparison-column",role:"group","aria-labelledby":b,"data-cui-type":"body",children:[N("div",{className:"cui-comparison-heading",id:b,children:d.heading}),N("dl",{className:"cui-comparison-list",children:t.map(f=>G("div",{children:[N("dt",{children:f.label}),N("dd",{children:d.cells[f.key]("stack")})]},f.key))})]},d.key)})})]})};import{Fragment as or,useCallback as ar,useId as ir,useLayoutEffect as At,useRef as qe}from"react";var re="[data-cui-row-focus]",Ue="[data-cui-row-detail]",er=e=>e===null?[]:[...e.querySelectorAll(`:scope > ${re}`)],It=(e,t)=>{let n=new Map;t!==null&&n.set(t,0);let r=-1;for(let a of e===null?[]:e.children)a.matches(re)?(r+=1,n.set(a,r)):r>=0&&a.matches(Ue)&&n.set(a,r);return n},$t=(e,t,n,r)=>{let a=er(t);if(a.length===0)return n;let o=r.get(e);if(o===void 0)throw new RangeError(`rowFocusTarget: <${e.localName}> left holding focus with no position in the table (only its rows, row details and empty text hold one)`);return a[Math.min(o,a.length-1)]};import{useCallback as tr,useLayoutEffect as Be,useReducer as nr,useRef as _e}from"react";var rr=e=>e+1,oe=e=>{let t=_e(e),n=_e(null),r=_e(!1),[,a]=nr(rr,0),o=tr((i=>()=>{r.current&&i.contains(document.activeElement)&&(n.current=i,a())}),[]);return Be(()=>(r.current=!0,()=>{r.current=!1,n.current=null}),[]),Be(()=>{t.current=e}),Be(()=>{let i=n.current;if(i===null)return;n.current=null;let l=[null,document.body].includes(document.activeElement);i.isConnected||!l||t.current(i)?.focus()}),o};import{jsx as L,jsxs as fe}from"react/jsx-runtime";var sr=new Map,dr='a[href], audio[controls], button, details, embed, iframe, img[usemap], input:not([type="hidden"]), label, select, textarea, video[controls], [tabindex], [contenteditable]',lr=(e,t,n)=>{At(()=>{let r=e.current;if(t!=="row-compact"||r===null)return;let a=[...r.querySelectorAll(dr)].find(o=>o.parentElement!==r);if(a!==void 0)throw new RangeError(`${n}: a compact row holds no control or focus target (a ${W} px target does not fit its ${dt} px; use row-control), not <${a.localName}>`)})},ur=(e,t)=>{let n=e.filter(a=>a.rowHeader===!0).map(a=>a.key);if(n.length>1)throw new RangeError(`${t}: a table has at most one row header column, not ${n.length} (${n.join(", ")})`);let r=e.find(a=>a.rowHeader!==!0&&a.rowHeaderNote!==void 0);if(r!==void 0)throw new RangeError(`${t}: a row header note belongs to the row header column, not to ${r.key}`)},cr=e=>e==null?null:L("div",{className:"cui-table-header-note",children:e}),pr=(e,t,n,r,a)=>{let o=e.open(t);return L("tr",{ref:a,hidden:!o,"data-cui-row-detail":o?"open":"closed","data-testid":`${r}-detail`,children:L("td",{colSpan:n,id:e.id(t),children:o?e.render(t):null})})},yr=({caption:e,captionHidden:t,columns:n,rows:r,rowKey:a,rowTestId:o,rowData:i,rowSize:l,rowDetail:s,empty:u,testId:p,ref:d})=>{g();let c=ir(),b=qe(null);lr(b,l,p);let f=qe(null),y=qe(sr),T=oe(h=>$t(h,b.current,f.current,y.current));At(()=>{y.current=It(b.current,f.current)});let m=ar(h=>{f.current=h;let R=T(h);return()=>{f.current=null,R()}},[T]),E=yt(n);return ur(n,p),L("div",{className:"cui-container","data-testid":p,ref:d,children:r.length===0?L(P,{as:"p",fg:"fg-muted",type:"prose",tabIndex:-1,ref:m,testId:`${p}-empty`,children:u}):L("section",{ref:T,className:"cui-table-frame",tabIndex:0,"aria-labelledby":c,"data-testid":`${p}-frame`,children:fe("table",{className:"cui-table","data-cui-type":"body","data-cui-row-size":l,style:{"--cui-table-min":I(E)},children:[L("caption",{className:t?"cui-visually-hidden":"cui-table-caption",id:c,children:e}),L("colgroup",{children:n.map(h=>L("col",{style:h.width.fixedPx===void 0?void 0:{width:I(h.width.fixedPx)}},h.key))}),L("thead",{children:L("tr",{children:n.map(h=>fe("th",{scope:"col","data-cui-align":h.align,"data-cui-surface":"subtle","data-cui-type":"caption",children:[h.header,h.note===void 0?null:L("div",{className:"cui-table-header-note",children:h.note})]},h.key))})}),L("tbody",{ref:b,children:r.map(h=>fe(or,{children:[L("tr",{ref:T,tabIndex:-1,"data-cui-row-focus":"","data-testid":o,...w(i?.(h)),children:n.map(R=>R.rowHeader===!0?fe("th",{scope:"row","data-cui-align":R.align,children:[R.cell(h),R.rowHeaderNote===void 0?null:cr(R.rowHeaderNote(h))]},R.key):L("td",{"data-cui-align":R.align,children:R.cell(h)},R.key))}),s===void 0?null:pr(s,h,n.length,o,T)]},a(h)))})]})})})};import{jsx as Ge,jsxs as mr}from"react/jsx-runtime";var fr=({items:e,testId:t})=>{if(g(),new Set(e.map(n=>n.key)).size!==e.length)throw new RangeError(`Description keys must be unique: ${e.map(n=>n.key).join(", ")}`);return Ge("dl",{className:"cui-description-list","data-cui-type":"body","data-testid":t,children:e.map(n=>mr("div",{className:"cui-description-row","data-testid":`${t}-${n.key}`,children:[Ge("dt",{"data-cui-fg":"fg-secondary",children:n.term}),Ge("dd",{"data-cui-fg":"fg",children:n.description})]},n.key))})};import{useId as Ft,useLayoutEffect as Dt,useRef as Ve}from"react";import{jsx as ae,jsxs as Ot}from"react/jsx-runtime";var Ht=e=>{e instanceof HTMLElement&&e.isConnected&&e.focus()},gr=(e,t)=>{if(t===null||!e.contains(t))throw new RangeError("A dialog's initial focus must be an element inside the dialog");return t},br=(e,t)=>{if(t.focus(),e.ownerDocument.activeElement!==t)throw e.close(),new RangeError("A dialog's initial focus must be an element that takes focus")},hr=({title:e,description:t,open:n,onClose:r,initialFocus:a,testId:o,children:i})=>{let{labels:l}=k(),s=Ft(),u=Ft(),p=Ve(null),d=Ve(null),c=Ve(!1);return Dt(()=>{let m=p.current;if(n&&!m.open){let E=a===void 0?null:gr(m,a.current);d.current=m.ownerDocument.activeElement,m.showModal(),E!==null&&br(m,E)}else!n&&m.open&&m.close()},[n,a]),Dt(()=>{let m=p.current;return()=>{m.open&&(m.close(),Ht(d.current),d.current=null)}},[]),Ot("dialog",{className:"cui-dialog","aria-labelledby":s,"aria-describedby":t===void 0?void 0:u,"data-cui-surface":"surface","data-cui-fg":"fg","data-cui-type":"body","data-cui-face":"sans","data-testid":o,ref:p,onClose:m=>{m.currentTarget.open||(Ht(d.current),d.current=null,n&&r())},onCancel:m=>{let E=c.current;c.current=!1,(E||He(m.currentTarget.ownerDocument.activeElement))&&m.preventDefault()},onKeyDownCapture:m=>{c.current=Oe(m)},onKeyUpCapture:()=>{c.current=!1},children:[Ot("div",{className:"cui-dialog-header",children:[ae("h2",{className:"cui-dialog-title",id:s,"data-cui-type":"title",children:e}),ae("div",{className:"cui-dialog-actions",children:ae(A,{variant:"secondary",testId:`${o}-close`,onClick:()=>p.current?.close(),children:l.close})})]}),t===void 0?null:ae("div",{id:u,"data-cui-measure":"reading","data-testid":`${o}-description`,children:t}),i,ae("div",{className:"cui-visually-hidden",role:"status","aria-live":"polite","aria-atomic":"true",[Ae]:"","data-testid":`${o}-announcer`})]})};import{useId as Rr,useRef as Tr}from"react";import{jsx as We,jsxs as Kt}from"react/jsx-runtime";var Er=({summary:e,open:t,onOpenChange:n,testId:r,children:a})=>{g();let o=Rr(),i=Tr(null);return H(i,{testId:r,part:"summary",host:"button"}),Kt("div",{className:"cui-disclosure","data-testid":r,children:[Kt("button",{className:"cui-disclosure-button",type:"button","aria-expanded":t,"aria-controls":o,"data-cui-fg":"fg","data-cui-type":"body","data-testid":`${r}-button`,onClick:()=>n(!t),children:[We("span",{className:"cui-disclosure-marker","aria-hidden":"true",children:t?"\u25BE":"\u25B8"}),We("span",{ref:i,children:e})]}),We("div",{className:"cui-disclosure-panel",id:o,hidden:!t,"data-testid":`${r}-panel`,children:a})]})};import{useId as j}from"react";import{Fragment as Mr,jsx as v,jsxs as $}from"react/jsx-runtime";var xr=/\s/,ze=e=>{if(e!==void 0&&(typeof e!="string"||e===""||xr.test(e)))throw new RangeError(`A control's name must be one token without whitespace: "${e}"`);return e},Ut=e=>{if(e!==void 0&&!(Number.isInteger(e)&&e>0))throw new RangeError(`A field's maxLength must be a positive integer: ${e}`);return e},Y=({description:e,error:t,errorId:n})=>{g();let r=j(),a=j(),o=j(),i=n===void 0?o:Fe(n,"a field's error"),l=[e===void 0?null:a,t===void 0?null:i].filter(u=>u!==null).join(" ");return{control:{id:r,"aria-describedby":l===""?void 0:l,"aria-invalid":t===void 0?void 0:!0},descriptionId:a,errorId:i}},Z=({description:e,error:t,descriptionId:n,errorId:r,testId:a})=>$(Mr,{children:[e===void 0?null:v(P,{as:"p",fg:"fg-muted",type:"body",id:n,testId:`${a}-description`,children:e}),t===void 0?null:v(P,{as:"p",fg:"danger-fg",type:"body",id:r,testId:`${a}-error`,children:t})]}),me=({htmlFor:e,hidden:t,children:n})=>v("label",{className:t===!0?"cui-visually-hidden":"cui-field-label",htmlFor:e,"data-cui-type":"body",children:n}),vr=({label:e,description:t,error:n,errorId:r,testId:a,children:o})=>{let{control:i,descriptionId:l,errorId:s}=Y({label:e,description:t,error:n,errorId:r});return $("div",{className:"cui-field","data-invalid":n!==void 0,"data-testid":a,children:[v(me,{htmlFor:i.id,hidden:void 0,children:e}),o(i),v(Z,{description:t,error:n,descriptionId:l,errorId:s,testId:a})]})},Bt=({label:e,description:t,error:n,errorId:r,value:a,onValueChange:o,type:i,name:l,maxLength:s,list:u,autoComplete:p,inputMode:d,prefix:c,labelHidden:b,required:f,testId:y,ref:T})=>{let{control:m,descriptionId:E,errorId:h}=Y({label:e,description:t,error:n,errorId:r}),R=j();if(c!==void 0&&c.trim()==="")throw new RangeError("An input's prefix must not be blank");if(s!==void 0&&i==="datetime-local")throw new RangeError(`A ${i} input takes no maxLength: ${s}`);let x=i==="password",M=v("input",{className:"cui-input",type:i,name:ze(l),maxLength:Ut(s),value:a,list:u,autoComplete:p,inputMode:d,spellCheck:x?!1:void 0,autoCapitalize:x?"none":void 0,required:f,onChange:K=>o(K.target.value),"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"body","data-testid":y,ref:T,...m,"aria-describedby":B(c===void 0?void 0:R,m["aria-describedby"])});return $("div",{className:"cui-field","data-invalid":n!==void 0,"data-testid":`${y}-field`,children:[v(me,{htmlFor:m.id,hidden:b,children:e}),c===void 0?M:$("div",{className:"cui-input-group",children:[v("span",{className:"cui-input-prefix",id:R,"data-cui-fg":"fg-secondary","data-cui-surface":"sunken","data-cui-type":"body","data-testid":`${y}-prefix`,children:c}),M]}),v(Z,{description:t,error:n,descriptionId:E,errorId:h,testId:y})]})},wr=e=>v(Bt,{...e}),Pr=e=>v(Bt,{...e,type:"password"}),Cr=({label:e,description:t,error:n,errorId:r,value:a,onValueChange:o,name:i,maxLength:l,required:s,testId:u,ref:p})=>{let{control:d,descriptionId:c,errorId:b}=Y({label:e,description:t,error:n,errorId:r});return $("div",{className:"cui-field","data-invalid":n!==void 0,"data-testid":`${u}-field`,children:[v(me,{htmlFor:d.id,hidden:void 0,children:e}),v("textarea",{className:"cui-input cui-textarea",name:ze(i),maxLength:Ut(l),value:a,required:s,onChange:f=>o(f.target.value),"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"prose","data-testid":u,ref:p,...d}),v(Z,{description:t,error:n,descriptionId:c,errorId:b,testId:u})]})},Nr=({label:e,description:t,error:n,errorId:r,value:a,options:o,onValueChange:i,name:l,labelHidden:s,unavailable:u,testId:p,ref:d})=>{let{control:c,descriptionId:b,errorId:f}=Y({label:e,description:t,error:n,errorId:r}),y=j(),T=J(u,y);return $("div",{className:"cui-field","data-invalid":n!==void 0,"data-testid":`${p}-field`,children:[v(me,{htmlFor:c.id,hidden:s,children:e}),v("select",{className:"cui-input",name:ze(l),value:a,onChange:m=>{u===void 0&&i(m.target.value)},"data-cui-fg":"fg","data-cui-surface":"surface","data-cui-type":"body","data-testid":p,ref:d,...c,"aria-disabled":u===void 0?void 0:!0,"aria-describedby":B(c["aria-describedby"],T),children:o.map(m=>v("option",{value:m.value,children:m.label},m.value))}),v(Z,{description:t,error:n,descriptionId:b,errorId:f,testId:p}),u?.reason===void 0?null:v(P,{as:"p",fg:"fg-muted",type:"body",id:y,testId:`${p}-reason`,children:u.reason})]})},kr=({legend:e,description:t,error:n,errorId:r,value:a,options:o,onValueChange:i,testId:l,ref:s})=>{let u=j(),{control:p,descriptionId:d,errorId:c}=Y({label:e,description:t,error:n,errorId:r});return $("fieldset",{className:"cui-radio-group","aria-describedby":p["aria-describedby"],"data-invalid":n!==void 0,"data-testid":l,children:[v("legend",{className:"cui-radio-group-legend","data-cui-type":"body",children:e}),o.map((b,f)=>$("label",{className:"cui-radio","data-cui-type":"body",children:[v("input",{type:"radio",name:u,value:b.value,checked:b.value===a,onChange:()=>i(b.value),"aria-invalid":p["aria-invalid"],"data-testid":`${l}-option-${b.value}`,ref:f===0?s:void 0}),v("span",{children:b.label})]},b.value)),v(Z,{description:t,error:n,descriptionId:d,errorId:c,testId:l})]})},Lr=({legend:e,description:t,error:n,errorId:r,values:a,options:o,onValuesChange:i,testId:l,ref:s})=>{let{control:u,descriptionId:p,errorId:d}=Y({label:e,description:t,error:n,errorId:r}),c=o.map(y=>y.value);if(c.length===0||new Set(c).size!==c.length)throw new RangeError(`A check box group needs at least one option with unique values: ${c.join(", ")}`);let b=a.filter(y=>!c.includes(y));if(b.length>0)throw new RangeError(`The chosen values are not options: ${b.join(", ")}`);let f=new Set(a);return $("fieldset",{className:"cui-checkbox-group","aria-describedby":u["aria-describedby"],"data-invalid":n!==void 0,"data-testid":l,children:[v("legend",{className:"cui-checkbox-group-legend","data-cui-type":"body",children:e}),o.map((y,T)=>$("label",{className:"cui-checkbox","data-cui-type":"body",children:[v("input",{type:"checkbox",value:y.value,checked:f.has(y.value),onChange:()=>i(c.filter(m=>m===y.value?!f.has(m):f.has(m))),"aria-invalid":u["aria-invalid"],"data-testid":`${l}-option-${y.value}`,ref:T===0?s:void 0}),v("span",{children:y.label})]},y.value)),v(Z,{description:t,error:n,descriptionId:p,errorId:d,testId:l})]})};import{createContext as Sr,useContext as Ir,useId as Wt,useMemo as $r}from"react";import{Fragment as jt,jsx as C,jsxs as ge}from"react/jsx-runtime";var zt=Sr(null),_t="surface",qt={neutral:{face:"surface",line:"border-control"},info:{face:"info-tint",line:"info-accent"},success:{face:"success-tint",line:"success-accent"},warning:{face:"warning-tint",line:"warning-accent"},danger:{face:"danger-tint",line:"danger-accent"}},Gt={face:"info-tint",line:"info-accent"},Jt={normal:"border-control",high:"info-accent"},Ar=["normal","high"],Fr=[1,2,3,4],F=S.space["space-2"],Dr="fg",Hr="fg-secondary",Xt=e=>{let t=Ir(zt);if(t===null)throw new Error(`${e} must be rendered inside Figure`);return t},Je=(e,t,n)=>{if(!(Number.isFinite(n)&&n>0&&n%4===0))throw new RangeError(`${e}: ${t} must be a positive multiple of the ${4} px lattice: ${n}`)},Or=e=>{g();let t=Wt(),{kind:n,widthPx:r,heightPx:a,testId:o,dataAttributes:i,children:l}=e;Je(o,"widthPx",r),Je(o,"heightPx",a);let s=$r(()=>({kind:n,widthPx:r,heightPx:a,arrowIds:{normal:`${t}-arrow-normal`,high:`${t}-arrow-high`}}),[n,r,a,t]),u=ge(jt,{children:[C("defs",{children:Ar.map(b=>C("marker",{id:s.arrowIds[b],viewBox:`0 0 ${F} ${F}`,refX:F,refY:F/2,markerWidth:F,markerHeight:F,markerUnits:"userSpaceOnUse",orient:"auto","data-cui-emphasis":b,children:C("path",{d:`M 0 0 L ${F} ${F/2} L 0 ${F} z`,"data-cui-stroke":Jt[b],"data-testid":`${o}-arrow-${b}`})},b))}),C(zt.Provider,{value:s,children:l})]});if(e.kind==="group"){let{label:b,onEscape:f}=e;if(!D(b))throw new RangeError(`${o}: a group figure's label must hold a readable character: ${JSON.stringify(b)}`);return C("div",{className:"cui-figure-frame","data-testid":`${o}-frame`,children:C("svg",{className:"cui-figure",role:"group","aria-label":b,viewBox:`0 0 ${r} ${a}`,"data-cui-figure":"group","data-cui-surface":_t,"data-cui-face":"sans",style:{"--cui-figure-inline":I(r),"--cui-figure-block":I(a)},onKeyDown:f===void 0?void 0:y=>_(y,f),"data-testid":o,...w(i),children:u})})}let{viewBox:p,pointer:d,svgRef:c}=e;return C("div",{className:"cui-container","data-testid":`${o}-frame`,children:C("svg",{ref:c,className:"cui-figure","aria-hidden":"true",viewBox:p===void 0?`0 0 ${r} ${a}`:p,"data-cui-figure":"decorative","data-cui-surface":_t,"data-cui-face":"sans","data-cui-pan":d===void 0?void 0:"true","data-cui-cursor":d?.cursor,style:{"--cui-figure-inline":I(r),"--cui-figure-ratio":String(a/r)},"data-testid":o,...w(i),...d?.handlers,children:u})})},Vt=(e,t)=>{try{return t()}catch(n){throw new RangeError(`${e}: ${n.message}`,{cause:n})}},Kr=(e,t,n)=>{for(let r of t){let a=Rt.light[r.fg],o=n.find(i=>a[i]===void 0);if(o!==void 0)throw new RangeError(`${e}: the note ${JSON.stringify(r.text)} in ${r.fg} is not in the contrast table on ${o}, a face the node takes`)}},Ur=e=>{g();let t=Xt("FigureNode"),n=Wt(),{x:r,y:a,shape:o,tone:i,outline:l,selected:s,name:u,title:p,press:d,testId:c,dataAttributes:b}=e,f=e.notes===void 0?[]:e.notes;if(!(Number.isFinite(r)&&Number.isFinite(a)))throw new RangeError(`${c}: a node's position must be finite: ${r}, ${a}`);if(t.kind==="group"&&d===void 0)throw new RangeError(`${c}: every node of a group figure must be pressable (pass press)`);if(t.kind==="decorative"&&d!==void 0)throw new RangeError(`${c}: a node of a decorative figure cannot be pressed (it is hidden from assistive technology)`);if(d!==void 0&&!D(d.label))throw new RangeError(`${c}: a pressable node's label must hold a readable character: ${JSON.stringify(d.label)}`);let y=s?Gt:qt[i];Kr(c,f,[qt[i].face,Gt.face]);let T,m,E;if(o.kind==="box"){if(u===null)throw new RangeError(`${c}: a box's name is drawn inside the box and sizes it, so it cannot be null (only a disc may be drawn without a name)`);let R=Vt(c,()=>lt({name:u,notes:f.map(M=>M.text)}));if(Je(c,"a box's widthPx",o.widthPx),o.widthPx<R.minWidthPx)throw new RangeError(`${c}: a box ${o.widthPx} px wide is narrower than its lines under the widest 1.4.12 spacing (${R.minWidthPx} px)`);T={width:o.widthPx,height:R.heightPx,left:r,top:a};let x=ut(f.length);m=ge("g",{"data-cui-surface":y.face,children:[C("rect",{className:"cui-figure-plate",width:o.widthPx,height:R.heightPx,rx:S.radius["radius-item"],"data-cui-fill":y.face,"data-cui-stroke":y.line,"data-testid":`${c}-plate`}),C("text",{className:"cui-figure-name",x:x.insetPx,y:x.namePx,fontSize:S.type.body.size,"data-cui-fg":Dr,"data-cui-figure-type":"body","data-testid":`${c}-name`,children:u}),f.map((M,K)=>C("text",{x:x.insetPx,y:x.notesPx[K],fontSize:S.type.caption.size,"data-cui-fg":M.fg,"data-cui-figure-type":"caption","data-testid":`${c}-note-${K}`,children:M.text},K))]}),E=C("rect",{className:"cui-figure-ring",x:-U,y:-U,width:o.widthPx+2*U,height:R.heightPx+2*U,rx:S.radius["radius-item"]+U,"data-cui-stroke":"focus","data-testid":`${c}-ring`})}else{let R=Vt(c,()=>ct(u,o.radiusPx));T={width:2*o.radiusPx,height:2*o.radiusPx,left:r-o.radiusPx,top:a-o.radiusPx},m=ge(jt,{children:[C("g",{"data-cui-surface":y.face,children:C("circle",{className:"cui-figure-plate",r:o.radiusPx,"data-cui-fill":y.face,"data-cui-stroke":y.line,"data-testid":`${c}-plate`})}),u===null?null:C("text",{className:"cui-figure-label",x:0,y:R.extentBelowPx-S.type.caption.lineHeight/2,fontSize:S.type.caption.size,"data-cui-fg":Hr,"data-cui-figure-type":"caption","data-testid":`${c}-name`,children:u})]}),E=C("circle",{className:"cui-figure-ring",r:o.radiusPx+U,"data-cui-stroke":"focus","data-testid":`${c}-ring`})}if(d!==void 0){if(T.width<W||T.height<W)throw new RangeError(`${c}: a pressable node must be at least the ${W} px target: ${T.width} \xD7 ${T.height}`);if(T.left<z||T.top<z||T.left+T.width+z>t.widthPx||T.top+T.height+z>t.heightPx)throw new RangeError(`${c}: a pressable node must keep ${z} px to the figure's edge for its focus ring`)}let h=d===void 0?{}:{role:"button",tabIndex:0,"aria-label":d.label,"aria-describedby":d.description===void 0?void 0:n,"aria-expanded":d.expanded,"aria-controls":d.expanded?d.controls:void 0,onClick:R=>{R.currentTarget.focus(),d.onPress()},onKeyDown:R=>{R.key!=="Enter"&&R.key!==" "||(R.preventDefault(),R.repeat||d.onPress())}};return ge("g",{className:"cui-figure-node",transform:`translate(${r} ${a})`,"data-cui-tone":i,"data-cui-outline":l,"data-selected":String(s),...h,"data-testid":c,...w(b),children:[p===void 0?null:C("title",{children:p}),d?.description===void 0?null:C("desc",{id:n,"data-testid":`${c}-description`,children:d.description}),d===void 0?null:E,m]})},Br=({d:e,emphasis:t,weight:n,arrow:r,title:a,testId:o,dataAttributes:i})=>{g();let l=Xt("FigureEdge");if(!Fr.includes(n))throw new RangeError(`${o}: an edge's weight must be 1, 2, 3 or 4: ${n}`);return C("path",{className:"cui-figure-edge",d:e,markerEnd:r?`url(#${l.arrowIds[t]})`:void 0,"data-cui-stroke":Jt[t],"data-cui-weight":n,"data-cui-emphasis":t,"data-testid":o,...w(i),children:a===void 0?null:C("title",{children:a})})};import{jsx as Gr}from"react/jsx-runtime";var _r={1:"h1",2:"h2",3:"h3"},qr=({level:e,type:t,testId:n,headingRef:r,children:a})=>{g();let o=_r[e];return Gr(o,{className:"cui-heading","data-cui-type":t,"data-cui-fg":"fg","data-testid":n,ref:r,tabIndex:r===void 0?void 0:-1,children:a})};import{jsx as zr}from"react/jsx-runtime";var Vr={removed:"danger-tint",added:"success-tint"},Wr=({kind:e,testId:t,children:n})=>{if(g(),n==="")throw new RangeError(`${t}: a changed fragment must hold at least one character`);return zr(e==="removed"?"del":"ins",{className:"cui-change","data-cui-change":e,"data-cui-surface":Vr[e],"data-cui-fg":"fg","data-testid":t,children:n})};import{jsx as jr}from"react/jsx-runtime";var Jr={neutral:{fg:"fg-secondary",surface:"sunken"},info:{fg:"info-fg",surface:"info-tint"},success:{fg:"success-fg",surface:"success-tint"},warning:{fg:"warning-fg",surface:"warning-tint"},danger:{fg:"danger-fg",surface:"danger-tint"}},Xr={neutral:"neutral-solid",info:"info-solid",success:"success-solid",warning:"warning-solid",danger:"danger-solid"},Xe=({tone:e,variant:t,testId:n,dataAttributes:r,children:a})=>{g();let o=t==="tint"?Jr[e]:{fg:"on-solid",surface:Xr[e]};return jr("span",{className:"cui-pill","data-cui-tone":e,"data-cui-variant":t,"data-cui-fg":o.fg,"data-cui-surface":o.surface,"data-cui-type":"caption","data-testid":n,...w(r),children:a})};import{useId as Yr}from"react";import{jsx as ie,jsxs as Zr}from"react/jsx-runtime";var je=({label:e,valueText:t,value:n,max:r,testId:a})=>{g();let o=Yr();if(r!==null){if(!(Number.isFinite(r)&&r>0))throw new RangeError(`Progress maximum must be positive: ${r}`);if(n===null||!(Number.isFinite(n)&&n>=0))throw new RangeError(`A determinate progress value must be a number >= 0: ${n}`)}let i=r===null?null:{max:r,now:Math.min(n,r)};return Zr("div",{className:"cui-progress","data-testid":a,children:[ie(P,{as:"p",fg:"fg",type:"body",id:o,children:e}),ie("div",{className:"cui-progress-track",role:"progressbar","aria-labelledby":o,"aria-valuetext":t,"aria-valuemin":i===null?void 0:0,"aria-valuemax":i?.max,"aria-valuenow":i?.now,"data-cui-surface":"sunken","data-cui-indeterminate":i===null,"data-testid":`${a}-bar`,children:ie("div",{className:"cui-progress-fill","data-cui-accent":"info-accent",style:i===null?void 0:{inlineSize:`${i.now/i.max*100}%`},"data-testid":`${a}-fill`})}),ie("div",{"aria-hidden":"true",children:ie(P,{as:"p",fg:"fg-secondary",type:"body",testId:`${a}-value`,children:t})})]})};import{jsx as be,jsxs as Yt}from"react/jsx-runtime";var Qr=({title:e,status:t,progress:n,cancel:r,testId:a,children:o})=>Yt(Ke,{title:e,actions:r===void 0?void 0:be(A,{variant:"secondary",busy:r.busy,busyLabel:r.busyLabel,onClick:r.onCancel,testId:`${a}-cancel`,children:r.label}),testId:a,children:[Yt("div",{className:"cui-job-status",role:"status","aria-live":"polite","aria-atomic":"true","data-testid":`${a}-status`,children:[be("span",{className:"cui-visually-hidden",children:`${e} `}),be(Xe,{tone:t.tone,variant:"tint",testId:`${a}-status-pill`,children:t.label})]}),n===void 0?null:be(je,{...n,testId:`${a}-progress`}),o]});import{createContext as eo,useContext as to}from"react";import{jsx as se}from"react/jsx-runtime";var Ye=eo(null),no="space-2",ro=e=>{g();let{gap:t,label:n,id:r,hidden:a,testId:o,children:i}=e;if(n!==void 0&&!D(n))throw new RangeError(`${o}: a list's label must hold a readable character: ${JSON.stringify(n)}`);let l=e.marker==="none"?void 0:e.type,s=l!==void 0,u=e.marker==="number"||e.marker==="none"&&e.ordered?"ol":"ul";return se(Ye.Provider,{value:e.marker,children:se(u,{className:"cui-list",role:"list","aria-label":n,id:r,hidden:a,"data-cui-gap":s?void 0:t,"data-cui-row-gap":s?t:void 0,"data-cui-column-gap":s?no:void 0,"data-cui-marker":s?e.marker:void 0,"data-cui-type":l,"data-testid":o,children:i})})},oo=({testId:e,dataAttributes:t,children:n})=>{g();let r=to(Ye);if(r===null)throw new Error("ListItem must be rendered inside List, not inside another ListItem");return se("li",{className:"cui-list-item","data-testid":e,...w(t),children:se("div",{className:"cui-list-body","data-cui-measure":r==="none"?void 0:"reading",children:se(Ye.Provider,{value:null,children:n})})})};import{useCallback as Qt,useLayoutEffect as io,useRef as he}from"react";import{jsx as Zt}from"react/jsx-runtime";var ao=({tone:e,testId:t,children:n})=>(g(),Zt("div",{className:"cui-notice","data-cui-tone":e,"data-cui-surface":e==="info"?"info-tint":"warning-tint","data-cui-fg":"fg","data-cui-type":"prose","data-cui-measure":"reading","data-testid":t,children:n})),de=({occurrence:e,testId:t,children:n})=>(g(),Zt("div",{className:"cui-alert",role:"alert","data-cui-surface":"danger-tint","data-cui-fg":"danger-fg","data-cui-type":"prose","data-cui-measure":"reading","data-cui-occurrence":e,"data-testid":t,children:n},e));import{jsx as Re,jsxs as co}from"react/jsx-runtime";var en=e=>[...e.querySelectorAll(re)].filter(t=>{let n=t.closest(Ue);return n===null||!e.contains(n)}),so=e=>{let t=e.ref.current;if(t===null)throw new Error("LoadMore: rows.ref is not attached to the element holding the rows");let n=en(t);if(n.length!==e.count)throw new Error(`LoadMore: rows.ref holds ${n.length} ${re} elements for ${e.count} rows`);return n},lo=(e,t)=>{let n=-1;return e.forEach((r,a)=>{t.has(r)&&(n=a)}),e[n+1]},uo=({onLoad:e,busy:t,done:n,failure:r,limit:a,rows:o,testId:i})=>{let{formatLocale:l,labels:s}=k(),u=he(null),p=he(null),d=he(null),c=he(!1),b=()=>{let m=o.ref.current;u.current={shown:new Set(m===null?[]:en(m)),failureOccurrence:r===null?null:r.occurrence,busySeen:!1},e()};io(()=>{let m=c.current;c.current=!1;let E=u.current;if(E===null)return;let h=so(o);if(t){E.busySeen=!0,E.shown=new Set(h);return}let R=lo(h,E.shown),x=r!==null&&r.occurrence!==E.failureOccurrence;if(!(E.busySeen||R!==void 0||x||n)||(u.current=null,x||R===void 0))return;let M=[null,document.body].includes(document.activeElement);(d.current!==null&&document.activeElement===d.current||m&&M)&&R.focus()});let f=oe(()=>n?p.current:d.current),y=Qt((m=>{d.current=m;let E=f(m);return()=>{d.current=null,c.current=m===document.activeElement,E()}}),[f]),T=Qt((m=>{p.current=m;let E=f(m);return()=>{p.current=null,E()}}),[f]);return n?Re("div",{className:"cui-load-more","data-testid":i,children:Re(P,{as:"p",fg:"fg-muted",type:"body",tabIndex:-1,ref:T,testId:`${i}-end`,children:s.endOfRecords})}):co("div",{className:"cui-load-more","data-testid":i,children:[Re(A,{variant:"secondary",busy:t,busyLabel:s.loading,onClick:b,ref:y,testId:`${i}-button`,children:s.loadMore(ue(a,l))}),r===null?null:Re(de,{occurrence:r.occurrence,testId:`${i}-failure`,children:s.loadFailed(r.reason)})]})};import{jsx as Ze,jsxs as tn}from"react/jsx-runtime";var po=({master:e,detail:t,masterMinPx:n,detailMinPx:r,testId:a})=>{g();let o=pt({masterMinPx:n,detailMinPx:r,gapPx:S.space["space-6"]});return tn("div",{className:"cui-container","data-testid":a,children:[Ze(X,{ruleKey:o.key,css:o.css}),tn("div",{className:"cui-master-detail","data-cui-master-detail":o.key,children:[Ze("div",{className:"cui-master-detail-pane","data-testid":`${a}-master`,children:e}),Ze("div",{className:"cui-master-detail-pane","data-testid":`${a}-detail`,children:t})]})]})};import{jsx as Te}from"react/jsx-runtime";var Ee=e=>{let{formatLocale:t,labels:n}=k(),{testId:r}=e;if(e.keep===void 0){let{value:i,unit:l}=e;if(l!==void 0&&!D(l))throw new RangeError(`${r}: a unit must hold a readable character: ${JSON.stringify(l)}`);if(i===null)return Te("span",{className:"cui-measured","data-measured":"false","data-testid":r,children:n.unmeasured});let s=ue(i,t);return Te("span",{className:"cui-measured","data-measured":"true","data-testid":r,children:at(s,l)})}let{text:a,keep:o}=e;if(a===null)return Te("span",{className:"cui-measured","data-measured":"false","data-cui-keep":o,"data-testid":r,children:n.unmeasured});if(!D(a))throw new RangeError(`${r}: a measured text must hold a readable character (pass null when the value was not measured): ${JSON.stringify(a)}`);return Te("span",{className:"cui-measured","data-measured":"true","data-cui-keep":o,"data-testid":r,children:a})};import{jsx as xe,jsxs as fo}from"react/jsx-runtime";var yo=({label:e,value:t,min:n,max:r,valueText:a,testId:o})=>{if(g(),!(Number.isFinite(n)&&Number.isFinite(r)&&n<r))throw new RangeError(`Meter needs a finite range with min below max: min ${n}, max ${r}`);if(!(Number.isFinite(t)&&t>=n&&t<=r))throw new RangeError(`Meter value must be a finite number in its range: value ${t}, min ${n}, max ${r}`);return fo("span",{className:"cui-meter","data-testid":o,children:[xe("span",{className:"cui-meter-track",role:"meter","aria-label":e,"aria-valuemin":n,"aria-valuemax":r,"aria-valuenow":t,"aria-valuetext":a,"data-cui-surface":"sunken","data-testid":`${o}-bar`,children:xe("span",{className:"cui-meter-fill","data-cui-accent":"info-accent",style:{inlineSize:`${(t-n)/(r-n)*100}%`},"data-testid":`${o}-fill`})}),xe("span",{"aria-hidden":"true",children:xe(P,{fg:"fg",type:"body",testId:`${o}-value`,children:a})})]})};import{useId as mo,useRef as go}from"react";import{jsx as Qe,jsxs as Ro}from"react/jsx-runtime";var bo={ArrowLeft:-1,ArrowRight:1},ho=({label:e,items:t,value:n,onValueChange:r,testId:a,panelDescribedBy:o,children:i})=>{g();let l=mo(),s=go(new Map);if(t.length===0)throw new RangeError("PanelTabs needs at least one tab");let u=t.map(y=>y.id);if(new Set(u).size!==u.length)throw new RangeError(`Tab keys must be unique: ${u.join(", ")}`);let p=u.indexOf(n);if(p<0)throw new RangeError(`The selected tab "${n}" is not one of the tabs: ${u.join(", ")}`);let d=y=>`${l}-tab-${y}`,c=`${l}-panel`,b=y=>{let T=t[y];T.id!==n&&r(T.id),s.current.get(T.id)?.focus()};return Ro("div",{className:"cui-panel-tabs","data-testid":a,children:[Qe("div",{className:"cui-tabs-list",role:"tablist","aria-label":e,onKeyDown:y=>{let T=t.findIndex(R=>s.current.get(R.id)===y.target),m=T<0?p:T,E=bo[y.key],h;if(E!==void 0){let R=getComputedStyle(y.currentTarget).direction==="rtl"?-E:E;h=(m+R+t.length)%t.length}else if(y.key==="Home")h=0;else if(y.key==="End")h=t.length-1;else return;y.preventDefault(),b(h)},children:t.map((y,T)=>{let m=T===p;return Qe("button",{className:"cui-tab cui-panel-tab",type:"button",role:"tab",id:d(T),"aria-selected":m,"aria-controls":c,tabIndex:m?0:-1,"data-cui-fg":m?"fg":"fg-secondary","data-cui-type":"body","data-testid":`${a}-${y.id}`,ref:E=>{E===null?s.current.delete(y.id):s.current.set(y.id,E)},onClick:()=>b(T),children:y.label},y.id)})}),Qe("div",{role:"tabpanel",id:c,"aria-labelledby":d(p),"aria-describedby":o,"data-testid":`${a}-panel`,children:i})]})};import{jsx as nn,jsxs as Eo}from"react/jsx-runtime";var To=({failure:e,onReload:t,forbiddenMessage:n,failureMessage:r,rescueRef:a,testId:o})=>{let{labels:i}=k();return Eo("div",{className:"cui-resource-failed","data-testid":o,children:[nn(de,{occurrence:e.occurrence,testId:`${o}-alert`,children:i.failureSentence(e,n,r===void 0?i.loadFailed:r)}),e.status===403?null:nn(A,{variant:"secondary",busy:e.retrying,busyLabel:i.loading,onClick:t,ref:a,testId:`${o}-reload`,children:i.reload})]})};import{jsx as et,jsxs as vo}from"react/jsx-runtime";var xo=({label:e,options:t,value:n,onValueChange:r,testId:a})=>{g();let o=new Set(t.map(i=>i.value));if(t.length<2||o.size!==t.length)throw new RangeError(`A segmented control needs at least two options with unique values: ${t.map(i=>i.value).join(", ")}`);if(!o.has(n))throw new RangeError(`The pressed value "${n}" is not one of the options: ${[...o].join(", ")}`);return vo("fieldset",{className:"cui-segmented-group","data-testid":a,children:[et("legend",{className:"cui-segmented-legend","data-cui-type":"body",children:e}),et("div",{className:"cui-segmented",children:t.map(i=>{let l=i.value===n;return et("button",{className:"cui-segment",type:"button","aria-pressed":l,"data-cui-fg":l?"on-solid":"fg","data-cui-surface":l?"info-solid":void 0,"data-cui-type":"body","data-testid":`${a}-${i.value}`,onClick:()=>{l||r(i.value)},children:i.label},i.value)})})]})};import{useCallback as wo,useRef as Po}from"react";import{jsx as Q}from"react/jsx-runtime";var rn=({selected:e,controls:t,onSelect:n,testId:r,dataAttributes:a,ref:o,children:i})=>{g();let l=Po(null);H(l,{testId:r,part:"row",host:"button"});let s=wo(p=>{if(l.current=p,typeof o=="function")return o(p);o!=null&&(o.current=p)},[o]);return Q("button",{className:"cui-row-button",type:"button","data-selected":e,"aria-expanded":e,"aria-controls":t,"data-cui-row-focus":"","data-cui-surface":e?"info-tint":"surface","data-cui-fg":"fg","data-cui-type":"body","data-testid":r,onClick:p=>{ye(p),n()},ref:s,...w(a),children:i})},Co=({label:e,items:t,itemKey:n,selectedKey:r,onSelect:a,detailId:o,renderRow:i,rowTestId:l,rowData:s,empty:u,testId:p,ref:d})=>(g(),Q("div",{className:"cui-selectable","data-testid":p,ref:d,children:t.length===0?Q(P,{as:"p",fg:"fg-muted",type:"prose",testId:`${p}-empty`,children:u}):Q("ul",{className:"cui-selectable-list",role:"list","aria-label":e,children:t.map(c=>{let b=n(c);return Q("li",{children:Q(rn,{selected:b===r,controls:o,onSelect:()=>a(c),testId:l,dataAttributes:s?.(c),children:i(c)})},b)})})}));import{useId as No}from"react";import{jsx as ve,jsxs as on}from"react/jsx-runtime";var ko=({label:e,value:t,min:n,max:r,step:a,valueText:o,onValueChange:i,testId:l})=>{g();let s=No();if(!([t,n,r,a].every(Number.isFinite)&&n<r&&a>0&&n<=t&&t<=r))throw new RangeError(`Slider needs finite min < max, a positive step and min <= value <= max: value ${t}, min ${n}, max ${r}, step ${a}`);let u=o(t);return on("div",{className:"cui-field","data-testid":`${l}-field`,children:[ve("label",{className:"cui-field-label",htmlFor:s,"data-cui-type":"body",children:e}),on("div",{className:"cui-slider",children:[ve("input",{className:"cui-slider-input",id:s,type:"range",min:n,max:r,step:a,value:t,"aria-valuetext":u,"data-testid":l,onChange:p=>i(p.currentTarget.valueAsNumber)}),ve("span",{className:"cui-slider-value","aria-hidden":"true",children:ve(P,{fg:"fg",type:"body",testId:`${l}-value`,children:u})})]})]})};import{jsx as an}from"react/jsx-runtime";var Lo=({gap:e,testId:t,children:n})=>(g(),an("div",{className:"cui-stack","data-cui-gap":e,"data-testid":t,children:n})),Mo=({gap:e,as:t="div",testId:n,children:r})=>(g(),an(t,{className:"cui-cluster","data-cui-gap":e,"data-testid":n,children:r}));import{jsx as tt,jsxs as dn}from"react/jsx-runtime";var sn={done:0,current:1,pending:2},So={done:{fg:"on-solid",surface:"success-solid"},current:{fg:"on-solid",surface:"info-solid"},pending:{fg:"fg-secondary",surface:void 0}},Io=({label:e,steps:t,testId:n})=>{let{labels:r}=k();if(t.length===0||new Set(t.map(o=>o.id)).size!==t.length)throw new RangeError(`A stepper needs at least one step with unique keys: ${t.map(o=>o.id).join(", ")}`);if(t.filter(o=>o.state==="current").length>1||t.some((o,i)=>i>0&&sn[o.state]<sn[t[i-1].state]))throw new RangeError(`Step states must run done, at most one current, then pending: ${t.map(o=>o.state).join(", ")}`);let a={done:r.stepDone,current:null,pending:r.stepPending};return tt("ol",{className:"cui-stepper",role:"list","aria-label":e,"data-cui-type":"body","data-testid":n,children:t.map((o,i)=>{let l=So[o.state],s=a[o.state];return dn("li",{className:"cui-step","aria-current":o.state==="current"?"step":void 0,"data-cui-step":o.state,"data-testid":`${n}-${o.id}`,children:[tt("span",{className:"cui-step-marker","aria-hidden":"true","data-cui-fg":l.fg,"data-cui-surface":l.surface,"data-cui-type":"caption",children:o.state==="done"?"\u2713":i+1}),dn("span",{className:"cui-step-label","data-cui-fg":"fg",children:[o.label,s===null?null:tt("span",{className:"cui-visually-hidden",children:` (${s})`})]})]},o.id)})})};import{useId as $o,useRef as Ao}from"react";import{jsx as we,jsxs as ln}from"react/jsx-runtime";var Fo=({label:e,labelHidden:t,checked:n,onCheckedChange:r,unavailable:a,testId:o,ref:i,dataAttributes:l})=>{g();let s=$o(),u=Ao(null);H(u,{testId:o,part:"label",host:"button"});let p=J(a,s),d=a!==void 0,c=ln("button",{className:"cui-switch",type:"button",role:"switch","aria-checked":n,"aria-disabled":d?!0:void 0,"aria-describedby":B(p),"data-cui-fg":"fg","data-cui-type":"body","data-testid":o,ref:i,onClick:()=>{d||r(!n)},...w(l),children:[we("span",{className:"cui-switch-track","aria-hidden":"true","data-cui-surface":n?"info-solid":"sunken","data-testid":`${o}-track`,children:we("span",{className:"cui-switch-thumb","data-cui-surface":n?"surface":"neutral-solid","data-testid":`${o}-thumb`})}),we("span",{className:t===!0?"cui-visually-hidden":void 0,ref:u,children:e})]});return a?.reason===void 0?c:ln("span",{className:"cui-button-group",children:[c,we(P,{fg:"fg-muted",type:"body",id:s,testId:`${o}-reason`,children:a.reason})]})};import{useCallback as Do,useEffect as Ho,useId as Oo,useRef as un,useState as Ko}from"react";import{jsx as le,jsxs as cn}from"react/jsx-runtime";var Uo=({label:e,items:t,currentId:n,onNavigate:r,testId:a,collapsible:o=!1})=>{if(g(),t.length===0)throw new RangeError("Tabs needs at least one tab");let i=new Set(t.map(f=>f.id));if(i.size!==t.length)throw new RangeError(`Tab keys must be unique: ${t.map(f=>f.id).join(", ")}`);let l=t.find(f=>f.id===n);if(l===void 0)throw new RangeError(`The current tab "${n}" is not one of the tabs: ${[...i].join(", ")}`);let[s,u]=Ko(!1),p=un(null),d=un(null),c=Oo(),b=Do(f=>{u(!1),f&&p.current?.contains(document.activeElement)&&d.current?.focus()},[]);return Ho(()=>{if(!(o&&s))return;let f=y=>{p.current!==null&&!p.current.contains(y.target)&&b(!0)};return document.addEventListener("pointerdown",f,!0),()=>document.removeEventListener("pointerdown",f,!0)},[o,s,b]),cn("nav",{ref:p,className:"cui-tabs","aria-label":e,"data-testid":a,"data-cui-collapsible":o?"":void 0,"data-cui-open":o&&s?"":void 0,onKeyDown:o&&s?f=>_(f,()=>b(!0)):void 0,children:[o?cn("button",{ref:d,type:"button",className:"cui-tabs-summary","aria-expanded":s,"aria-controls":c,"data-cui-fg":"fg","data-cui-type":"body","data-testid":`${a}-summary`,onClick:()=>u(f=>!f),children:[le("span",{className:"cui-tabs-summary-label",children:l.label}),le("span",{className:"cui-tabs-summary-marker","aria-hidden":"true",children:s?"\u25B4":"\u25BE"})]}):null,le("ul",{className:"cui-tabs-list",id:c,role:"list","data-cui-surface":o?"surface":void 0,children:t.map(f=>{let y=f.id===n;return le("li",{className:"cui-tabs-item",children:le("a",{className:"cui-tab",href:f.href,"aria-current":y?"page":void 0,"data-cui-fg":y?"fg":"fg-secondary","data-cui-type":"body","data-testid":`${a}-${f.id}`,onClick:T=>{pe(T,f.href,r),T.defaultPrevented&&b(!1)},children:f.label})},f.id)})})]})};import{Children as Bo,Fragment as _o,isValidElement as qo}from"react";import{jsx as V,jsxs as yn}from"react/jsx-runtime";var Go={neutral:"fg",danger:"danger-fg",warning:"warning-fg",success:"success-fg"},Vo=e=>{g();let{label:t,sublabel:n,tone:r,testId:a,dataAttributes:o}=e;if((e.text===void 0?e.value===null:e.text===null)&&r!=="neutral")throw new RangeError(`An unmeasured tile value carries no tone: ${r}`);let l=`${a}-value`;return yn("div",{className:"cui-tile","data-cui-surface":"subtle","data-cui-fg":"fg","data-cui-tone":r,"data-testid":a,...w(o),children:[V("p",{className:"cui-tile-label","data-cui-type":"caption","data-cui-measure":"reading",children:t}),V("p",{className:"cui-tile-sublabel","data-cui-fg":"fg-muted","data-cui-type":"caption","data-cui-measure":"reading",children:n}),V("p",{className:"cui-tile-value","data-cui-fg":Go[r],"data-cui-type":"heading","data-cui-measure":"reading",children:e.text===void 0?V(Ee,{value:e.value,unit:e.unit,testId:l}):V(Ee,{text:e.text,keep:"wrap",testId:l})})]})},pn=e=>Bo.toArray(e).flatMap(t=>{if(!qo(t))throw new RangeError(`TileGrid children must be tile elements, not text: ${String(t)}`);return t.type===_o?pn(t.props.children):[t]}),Wo=({count:e,minInlinePx:t,testId:n,children:r})=>{g();let a=ft(e,t,S.space["space-2"]),o=pn(r).length;if(o!==e)throw new RangeError(`TileGrid has ${o} tiles but count is ${e}`);return yn("div",{className:"cui-container","data-testid":n,children:[V(X,{ruleKey:a.key,css:a.css}),V("div",{className:"cui-tile-grid","data-cui-tile-grid":a.key,"data-cui-gap":"space-2",children:r})]})};import{useLayoutEffect as zo,useRef as fn}from"react";import{jsx as Xo}from"react/jsx-runtime";var Pe=e=>[...e.querySelectorAll("button")],Jo=({label:e,testId:t,children:n})=>{g();let r=fn(null),a=fn(null);zo(()=>{let s=Pe(r.current),u=a.current!==null&&s.includes(a.current)?a.current:s[0]??null;a.current=u;for(let p of s)p.tabIndex=p===u?0:-1});let o=s=>{for(let u of Pe(r.current))u.tabIndex=u===s?0:-1;a.current=s};return Xo("div",{className:"cui-toolbar",role:"toolbar","aria-label":e,"aria-orientation":"horizontal","data-testid":t,ref:r,onFocus:s=>{let u=Pe(s.currentTarget).find(p=>p.contains(s.target));u!==void 0&&o(u)},onKeyDown:s=>{let u=Pe(s.currentTarget),p=u.indexOf(s.target);if(p===-1)return;let d=getComputedStyle(s.currentTarget).direction==="rtl"?"ArrowLeft":"ArrowRight",c=d==="ArrowRight"?"ArrowLeft":"ArrowRight",f={[d]:(p+1)%u.length,[c]:(p-1+u.length)%u.length,Home:0,End:u.length-1}[s.key];if(f===void 0)return;s.preventDefault();let y=u[f];o(y),y.focus()},children:n})};import{useCallback as ee,useEffect as Zo,useLayoutEffect as gn,useRef as ot}from"react";import{useCallback as Ce,useEffect as jo,useLayoutEffect as Yo,useRef as nt,useState as rt}from"react";var mn=e=>e===null?ke:Le,Ne=(e,t,n,r,a)=>{let[o,i]=rt(()=>({key:e,state:mn(e)})),[l,s]=rt(0),[u,p]=rt(0),d=nt(t),c=nt(null),b=nt(l);Yo(()=>{d.current=t}),jo(()=>{if(e===null){i({key:null,state:ke});return}let h=new AbortController;c.current=e;let R=l===b.current?"revision":"reload";return b.current=l,i(x=>Object.is(x.key,e)?{key:e,state:r(x.state,R)}:{key:e,state:Le}),d.current(h.signal).then(x=>{h.signal.aborted||(c.current=null,i(M=>({key:e,state:a(M.state,x)})))},x=>{h.signal.aborted||i(()=>{throw x})}),()=>{h.abort(),c.current=null}},[e,n,l,u]);let f=Ce(()=>s(h=>h+1),[]),y=Ce(()=>p(h=>h+1),[]),T=Ce((h,R)=>{i(x=>Object.is(x.key,h)?{key:h,state:R(x.state)}:x)},[]),m=Ce((h,R)=>{T(h,R),Object.is(c.current,h)&&y()},[T,y]);return{state:Object.is(o.key,e)?o.state:mn(e),reload:f,refresh:y,update:T,write:m}};var Qo=(e,t,n)=>{let r=ot(t);gn(()=>{r.current=t});let a=ee(m=>r.current.first(m),[]),{state:o,reload:i,refresh:l,update:s,write:u}=Ne(e,a,n,mt,gt),p=ot({key:e,state:o});gn(()=>{p.current={key:e,state:o}});let d=ot(null),c=ee(()=>{d.current?.controller.abort(),d.current=null},[]);Zo(()=>c,[e,n,c]);let b=ee(()=>{c(),i()},[c,i]),f=ee(()=>{c(),l()},[c,l]),y=ee(()=>{let{key:m,state:E}=p.current;if(m===null||E.kind!=="ready"||E.refreshing||E.value.next===null||E.value.loadingMore)throw new Error("usePagedResource: loadMore needs a shown list with a next cursor, no page in flight and no re-read in flight");let h=E.value.next,R={key:m,controller:new AbortController,maps:[]};d.current=R,s(m,bt),r.current.next(h,R.controller.signal).then(x=>{d.current===R&&(d.current=null,s(m,M=>R.maps.reduce((K,bn)=>Ie(K,bn),ht(M,h,x))))},x=>{d.current===R&&s(m,()=>{throw x})})},[s]),T=ee((m,E)=>{let h=d.current;h!==null&&Object.is(h.key,m)&&h.maps.push(E),u(m,R=>Ie(R,E))},[u]);return{state:o,reload:b,refresh:f,loadMore:y,updateList:T}};import{useCallback as ea,useRef as ta,useState as na}from"react";var ra=e=>typeof e=="object"&&e!==null&&typeof e.then=="function",oa=()=>{let[e,t]=na(null),n=ta(null),r=ea((a,o)=>{let i=o();if(!ra(i))return;let l=Symbol(a);n.current=l,t(a);let s=()=>{n.current===l&&(n.current=null,t(null))};i.then(s,s)},[]);return{pendingKey:e,press:r}};import{useCallback as aa}from"react";var ia=(e,t,n)=>{let{state:r,reload:a,refresh:o,write:i}=Ne(e,t,n,it,Me),l=aa((s,u)=>i(s,p=>Me(p,{ok:!0,value:u})),[i]);return{state:r,reload:a,refresh:o,put:l}};import{jsx as da}from"react/jsx-runtime";var sa=({testId:e,children:t})=>(g(),da("span",{className:"cui-visually-hidden","data-testid":e,children:t}));export{ce as ANNOUNCE_SETTLE_MS,de as AlertMessage,Mn as Breadcrumb,A as Button,dt as COMPACT_ROW_PX,Ta as CONSOLE_UI_LABEL_CATALOGS,Ua as CONTRAST_MINIMUM,Rt as CONTRAST_PAIRS,Ke as Card,Jn as CardSection,Lr as CheckboxGroup,Mo as Cluster,jn as CodeBlock,Qn as ComparisonGrid,Nn as ConsoleUiRoot,yr as DataTable,fr as DescriptionList,hr as Dialog,Er as Disclosure,z as FIGURE_RING_REACH_PX,La as FLEXIBLE_COLUMN_MIN_PX,vr as Field,Or as Figure,Br as FigureEdge,Ur as FigureNode,Bn as FragmentLink,hn as HTTP_FORBIDDEN,qr as Heading,Wr as InlineChange,Qr as JobCard,Se as LATTICE_PX,Kn as Link,ro as List,oo as ListItem,uo as LoadMore,po as MasterDetail,Ee as Measured,yo as Meter,Vo as MetricTile,ao as Notice,ho as PanelTabs,Pr as PasswordInput,Xe as Pill,je as ProgressBar,xa as ROW_WITH_CONTROL_PX,kr as RadioGroup,To as ResourceFailed,rn as RowButton,xo as SegmentedControl,Nr as Select,Co as SelectableList,ko as Slider,Lo as Stack,Io as Stepper,Fo as Switch,W as TARGET_PX,S as TOKENS,Va as TONES,qa as TONE_HUES,Ga as TONE_ROLES,Uo as Tabs,P as Text,Cr as TextArea,wr as TextInput,Wo as TileGrid,Jo as Toolbar,sa as VisuallyHidden,pa as ZonedTimeError,bt as beginPage,mt as beginPagedReload,it as beginReload,Ca as ceil8,Ea as ceilToLattice,Na as cellContentInlinePx,Ma as comparisonAttributePx,Ka as contrastRatio,Ia as countSampleText,va as cssVar,lt as figureBoxPlan,ct as figureDiscLabelPlan,ga as fillLabel,ka as fixedColumnPx,ha as flatMapOutcome,la as formatByteSize,ue as formatCount,ma as formatInstant,Fa as goldenSectionPx,Oa as hexToSrgb,Sa as instantSampleText,D as isReadableText,Me as keepLastGood,Ba as lightDark,ba as mapOutcome,Ie as mapPagedList,Da as masterDetailPlan,Pa as monoTextWidthEm,_a as placeholderRule,I as pxToRem,ua as readDecimalText,ca as readIntegerText,Ra as reasonAside,st as resolveConsoleUiLabels,gt as settleFirstPage,ht as settlePage,Aa as spacedTextWidthEm,Ha as tableFrameMinInlinePx,yt as tableMinInlinePx,wa as textWidthEm,ft as tileGridPlan,$a as tileMinInlinePx,ya as toOffsetIso,fa as toWallTime,kn as useAnnounce,k as useConsoleUi,Wn as useEscapeToClose,oe as useFocusRescue,Qo as usePagedResource,oa as usePendingPress,ia as useResource};
@@ -1129,6 +1129,15 @@
1129
1129
  resize: vertical;
1130
1130
  }
1131
1131
 
1132
+ /* iOS は字が 16px 未満の欄に焦点が来るたびに頁を拡大する。粗い指し示し (タッチの画面) では、欄と、欄と 1 つの枠に並ぶ前置きの字を
1133
+ 本文の段と 16px の大きい方にする。16px は iOS の閾で、根の字の大きさに依らないので rem で書かない。行の高さは段のままなので、1 行の
1134
+ 欄は 44 のまま */
1135
+ @media (pointer: coarse) {
1136
+ [data-cui-root] :is(.cui-input, .cui-input-prefix) {
1137
+ font-size: max(16px, var(--cui-font-size-body));
1138
+ }
1139
+ }
1140
+
1132
1141
  .cui-radio-group,
1133
1142
  .cui-checkbox-group,
1134
1143
  .cui-segmented-group {
package/dist/testing.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunk7M4I26BScjs = require('./chunk-7M4I26BS.cjs');var g=new Set,y=new WeakMap,O="[autofocus], a[href], button, input, select, textarea, [tabindex]:not([tabindex='-1'])",L= exports.openModals =()=>[...g].filter(e=>e.isConnected&&e.open),D= exports.pressEscape =e=>{let t=e.dispatchEvent(new Event("cancel",{cancelable:!0}));return t&&e.close(),t},k= exports.installDialogModel =()=>{typeof HTMLDialogElement>"u"||"showModal"in HTMLDialogElement.prototype||Object.defineProperties(HTMLDialogElement.prototype,{showModal:{configurable:!0,writable:!0,value(){if(!this.isConnected)throw new DOMException("The dialog is not connected","InvalidStateError");if(this.open){if(g.has(this))return;throw new DOMException("The dialog is already open as a non-modal dialog","InvalidStateError")}y.set(this,this.ownerDocument.activeElement),this.setAttribute("open",""),g.add(this),_optionalChain([this, 'access', _2 => _2.querySelector, 'call', _3 => _3(O), 'optionalAccess', _4 => _4.focus, 'call', _5 => _5()])}},close:{configurable:!0,writable:!0,value(){if(!this.open)return;this.removeAttribute("open"),g.delete(this);let e=_nullishCoalesce(y.get(this), () => (null));y.delete(this),e instanceof HTMLElement&&e.isConnected&&e.focus(),setTimeout(()=>{this.dispatchEvent(new Event("close"))},0)}}})};var v=/color|background|fill|stroke|shadow|^border(?:-(?:top|right|bottom|left|block|inline)(?:-(?:start|end))?)?$|^border-image|^(?:outline|text-decoration|column-rule|text-emphasis|opacity)$|filter$|blend-mode$/,I=/^(?:fill|stroke|color|bgcolor|opacity|[a-z]+(?:-[a-z]+)*-opacity|stop-color|flood-color|lighting-color|filter|mask)$/,A="http://www.w3.org/2000/svg",S="path, rect, circle, ellipse, line, polyline, polygon",_="title, desc, metadata",$="[data-cui-marker]",C=e=>{let t=e.style,a=[];for(let s=0;s<t.length;s+=1){let n=t.item(s);v.test(n)&&a.push(n)}return a},R=(e,t,a)=>{let s=[];for(let n=t;n!==null;n=n.parentElement){let i=C(n);i.length>0&&s.push(`\u30A4\u30F3\u30E9\u30A4\u30F3\u306E\u8272: ${e} \u306E ${n.tagName} \u306E ${i.join(", ")}`);let c=n.getAttributeNames().filter(d=>I.test(d));if(c.length>0&&s.push(`\u5857\u308A\u306E\u5C5E\u6027: ${e} \u306E ${n.tagName} \u306E ${c.join(", ")}`),n===a)break}return s},H=e=>{let t=e.closest("[data-testid]");return t===null?e.tagName:`${e.tagName} ${t.getAttribute("data-testid")}`},P=e=>{for(let t=e.parentElement;t!==null;t=t.parentElement)if(t.hasAttribute("data-cui-surface"))return t;return null},U=e=>Object.hasOwn(_chunk7M4I26BScjs.e,e)&&_chunk7M4I26BScjs.e[e]==="nonText",j=(e,t)=>{let a=_chunk7M4I26BScjs.d.light,s=t.closest("[data-cui-fg]"),n=t.closest("[data-cui-surface]");if(s===null||n===null)return{failures:[`\u5F79\u5272\u306E\u7121\u3044\u6587\u5B57: ${e}`],pair:null};let i=s.getAttribute("data-cui-fg"),c=n.getAttribute("data-cui-surface");return Object.hasOwn(a,i)&&Object.hasOwn(a[i],c)?{failures:R(e,t,s.contains(n)?s:n),pair:`${i}/${c}`}:{failures:[`\u8868\u306B\u7121\u3044\u7D44: ${e}: ${i} on ${c}`],pair:null}},q= exports.scanColourRoles =e=>{let t=[],a=new Set,s=new Set,n=0,i=0,c=_chunk7M4I26BScjs.d.light,d=(o,l)=>{n+=1;let r=j(o,l);t.push(...r.failures),r.pair!==null&&a.add(r.pair)},b=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(let o=b.nextNode();o!==null;o=b.nextNode()){let l=o.data.trim(),r=o.parentElement;l===""||_optionalChain([r, 'access', _6 => _6.closest, 'call', _7 => _7(_), 'optionalAccess', _8 => _8.namespaceURI])===A||d(l,r)}let w=[e,...e.querySelectorAll($)].filter(o=>o.matches($));for(let o of w)for(let l of o.children)d(`\u5370 ${_nullishCoalesce(l.getAttribute("data-testid"), () => (l.tagName))}`,l);let x=[e,...e.querySelectorAll(S)].filter(o=>o.namespaceURI===A&&o.matches(S));for(let o of x){i+=1;let l=H(o),r=o.getAttribute("data-cui-stroke"),u=o.getAttribute("data-cui-fill"),p=o.closest("[data-cui-surface]");if(r===null&&u===null||p===null){t.push(`\u5F79\u5272\u306E\u7121\u3044\u56F3\u5F62: ${l}`);continue}let f=p.getAttribute("data-cui-surface");u!==null&&u!==f&&t.push(`\u9762\u3068\u9055\u3046\u5857\u308A: ${l}: ${u} on ${f}`);let m=u===null?null:P(p),N=m===null?p:m;if(r!==null){let M=m===null?[f]:[f,m.getAttribute("data-cui-surface")];for(let E of M)U(r)&&Object.hasOwn(c[r],E)?s.add(`${r}/${E}`):t.push(`\u8868\u306B\u7121\u3044\u7DDA\u306E\u7D44: ${l}: ${r} on ${E}`)}t.push(...R(l,o,N))}return{failures:t,measured:a,texts:n,measuredGraphics:s,graphics:i}};exports.installDialogModel = k; exports.openModals = L; exports.pressEscape = D; exports.scanColourRoles = q;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var _chunk7M4I26BScjs = require('./chunk-7M4I26BS.cjs');var g=new Set,y=new WeakMap,_="[autofocus], a[href], button, input, select, textarea, [tabindex]:not([tabindex='-1'])",k= exports.openModals =()=>[...g].filter(e=>e.isConnected&&e.open),I= exports.pressEscape =e=>{let t=e.dispatchEvent(new Event("cancel",{cancelable:!0}));return t&&e.close(),t},v= exports.installDialogModel =()=>{typeof HTMLDialogElement>"u"||"showModal"in HTMLDialogElement.prototype||Object.defineProperties(HTMLDialogElement.prototype,{showModal:{configurable:!0,writable:!0,value(){if(!this.isConnected)throw new DOMException("The dialog is not connected","InvalidStateError");if(this.open){if(g.has(this))return;throw new DOMException("The dialog is already open as a non-modal dialog","InvalidStateError")}y.set(this,this.ownerDocument.activeElement),this.setAttribute("open",""),g.add(this),_optionalChain([this, 'access', _2 => _2.querySelector, 'call', _3 => _3(_), 'optionalAccess', _4 => _4.focus, 'call', _5 => _5()])}},close:{configurable:!0,writable:!0,value(){if(!this.open)return;this.removeAttribute("open"),g.delete(this);let e=_nullishCoalesce(y.get(this), () => (null));y.delete(this),e instanceof HTMLElement&&e.isConnected&&e.focus(),setTimeout(()=>{this.dispatchEvent(new Event("close"))},0)}}})};var C=/color|background|fill|stroke|shadow|^border(?:-(?:top|right|bottom|left|block|inline)(?:-(?:start|end))?)?$|^border-image|^(?:outline|text-decoration|column-rule|text-emphasis|opacity)$|filter$|blend-mode$/,H=/^(?:fill|stroke|color|bgcolor|opacity|[a-z]+(?:-[a-z]+)*-opacity|stop-color|flood-color|lighting-color|filter|mask)$/,S="http://www.w3.org/2000/svg",$="path, rect, circle, ellipse, line, polyline, polygon",P="title, desc, metadata",w="[data-cui-marker]",U=/^\[data-[a-z0-9_-]+(?:[~|^$*]?="[^"\\]*")?\]$/,j=e=>{let t=e.style,l=[];for(let s=0;s<t.length;s+=1){let n=t.item(s);C.test(n)&&l.push(n)}return l},x=(e,t,l)=>{let s=[];for(let n=t;n!==null;n=n.parentElement){let i=j(n);i.length>0&&s.push(`\u30A4\u30F3\u30E9\u30A4\u30F3\u306E\u8272: ${e} \u306E ${n.tagName} \u306E ${i.join(", ")}`);let c=n.getAttributeNames().filter(d=>H.test(d));if(c.length>0&&s.push(`\u5857\u308A\u306E\u5C5E\u6027: ${e} \u306E ${n.tagName} \u306E ${c.join(", ")}`),n===l)break}return s},q=e=>{let t=e.closest("[data-testid]");return t===null?e.tagName:`${e.tagName} ${t.getAttribute("data-testid")}`},z=e=>{for(let t=e.parentElement;t!==null;t=t.parentElement)if(t.hasAttribute("data-cui-surface"))return t;return null},B=e=>Object.hasOwn(_chunk7M4I26BScjs.e,e)&&_chunk7M4I26BScjs.e[e]==="nonText",F=(e,t)=>{let l=_chunk7M4I26BScjs.d.light,s=t.closest("[data-cui-fg]"),n=t.closest("[data-cui-surface]");if(s===null||n===null)return{failures:[`\u5F79\u5272\u306E\u7121\u3044\u6587\u5B57: ${e}`],pair:null};let i=s.getAttribute("data-cui-fg"),c=n.getAttribute("data-cui-surface");return Object.hasOwn(l,i)&&Object.hasOwn(l[i],c)?{failures:x(e,t,s.contains(n)?s:n),pair:`${i}/${c}`}:{failures:[`\u8868\u306B\u7121\u3044\u7D44: ${e}: ${i} on ${c}`],pair:null}},G=(e,t)=>t.flatMap(l=>{if(!U.test(l))throw new RangeError(`A role scan excludes only by one data-* attribute selector: ${l}`);if(e.matches(l))throw new RangeError(`A role scan exclusion must not match the root it scans: ${l}`);let s=[...e.querySelectorAll(l)];if(s.length===0)throw new RangeError(`A role scan exclusion matches no element under the root: ${l}`);return s}),K= exports.scanColourRoles =(e,t)=>{let l=G(e,t===void 0?[]:t.exclude),s=o=>l.some(r=>r.contains(o)),n=[],i=new Set,c=new Set,d=0,b=0,O=_chunk7M4I26BScjs.d.light,A=(o,r)=>{d+=1;let a=F(o,r);n.push(...a.failures),a.pair!==null&&i.add(a.pair)},R=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(let o=R.nextNode();o!==null;o=R.nextNode()){let r=o.data.trim(),a=o.parentElement;r===""||_optionalChain([a, 'access', _6 => _6.closest, 'call', _7 => _7(P), 'optionalAccess', _8 => _8.namespaceURI])===S||s(a)||A(r,a)}let M=[e,...e.querySelectorAll(w)].filter(o=>o.matches(w)&&!s(o));for(let o of M)for(let r of o.children)s(r)||A(`\u5370 ${_nullishCoalesce(r.getAttribute("data-testid"), () => (r.tagName))}`,r);let N=[e,...e.querySelectorAll($)].filter(o=>o.namespaceURI===S&&o.matches($)&&!s(o));for(let o of N){b+=1;let r=q(o),a=o.getAttribute("data-cui-stroke"),u=o.getAttribute("data-cui-fill"),p=o.closest("[data-cui-surface]");if(a===null&&u===null||p===null){n.push(`\u5F79\u5272\u306E\u7121\u3044\u56F3\u5F62: ${r}`);continue}let f=p.getAttribute("data-cui-surface");u!==null&&u!==f&&n.push(`\u9762\u3068\u9055\u3046\u5857\u308A: ${r}: ${u} on ${f}`);let m=u===null?null:z(p),L=m===null?p:m;if(a!==null){let D=m===null?[f]:[f,m.getAttribute("data-cui-surface")];for(let E of D)B(a)&&Object.hasOwn(O[a],E)?c.add(`${a}/${E}`):n.push(`\u8868\u306B\u7121\u3044\u7DDA\u306E\u7D44: ${r}: ${a} on ${E}`)}n.push(...x(r,o,L))}return{failures:n,measured:i,texts:d,measuredGraphics:c,graphics:b}};exports.installDialogModel = v; exports.openModals = k; exports.pressEscape = I; exports.scanColourRoles = K;
@@ -1,6 +1,9 @@
1
1
  declare const openModals: () => readonly HTMLDialogElement[];
2
2
  declare const pressEscape: (dialog: HTMLDialogElement) => boolean;
3
3
  declare const installDialogModel: () => void;
4
+ type RoleScanOptions = {
5
+ readonly exclude: readonly string[];
6
+ };
4
7
  type RoleScanResult = {
5
8
  readonly failures: readonly string[];
6
9
  readonly measured: ReadonlySet<string>;
@@ -8,5 +11,5 @@ type RoleScanResult = {
8
11
  readonly measuredGraphics: ReadonlySet<string>;
9
12
  readonly graphics: number;
10
13
  };
11
- declare const scanColourRoles: (root: Element) => RoleScanResult;
12
- export { type RoleScanResult, installDialogModel, openModals, pressEscape, scanColourRoles };
14
+ declare const scanColourRoles: (root: Element, options?: RoleScanOptions) => RoleScanResult;
15
+ export { type RoleScanOptions, type RoleScanResult, installDialogModel, openModals, pressEscape, scanColourRoles };
package/dist/testing.d.ts CHANGED
@@ -1,6 +1,9 @@
1
1
  declare const openModals: () => readonly HTMLDialogElement[];
2
2
  declare const pressEscape: (dialog: HTMLDialogElement) => boolean;
3
3
  declare const installDialogModel: () => void;
4
+ type RoleScanOptions = {
5
+ readonly exclude: readonly string[];
6
+ };
4
7
  type RoleScanResult = {
5
8
  readonly failures: readonly string[];
6
9
  readonly measured: ReadonlySet<string>;
@@ -8,5 +11,5 @@ type RoleScanResult = {
8
11
  readonly measuredGraphics: ReadonlySet<string>;
9
12
  readonly graphics: number;
10
13
  };
11
- declare const scanColourRoles: (root: Element) => RoleScanResult;
12
- export { type RoleScanResult, installDialogModel, openModals, pressEscape, scanColourRoles };
14
+ declare const scanColourRoles: (root: Element, options?: RoleScanOptions) => RoleScanResult;
15
+ export { type RoleScanOptions, type RoleScanResult, installDialogModel, openModals, pressEscape, scanColourRoles };
package/dist/testing.js CHANGED
@@ -1 +1 @@
1
- import{d as h,e as T}from"./chunk-FXEGLGL7.js";var g=new Set,y=new WeakMap,O="[autofocus], a[href], button, input, select, textarea, [tabindex]:not([tabindex='-1'])",L=()=>[...g].filter(e=>e.isConnected&&e.open),D=e=>{let t=e.dispatchEvent(new Event("cancel",{cancelable:!0}));return t&&e.close(),t},k=()=>{typeof HTMLDialogElement>"u"||"showModal"in HTMLDialogElement.prototype||Object.defineProperties(HTMLDialogElement.prototype,{showModal:{configurable:!0,writable:!0,value(){if(!this.isConnected)throw new DOMException("The dialog is not connected","InvalidStateError");if(this.open){if(g.has(this))return;throw new DOMException("The dialog is already open as a non-modal dialog","InvalidStateError")}y.set(this,this.ownerDocument.activeElement),this.setAttribute("open",""),g.add(this),this.querySelector(O)?.focus()}},close:{configurable:!0,writable:!0,value(){if(!this.open)return;this.removeAttribute("open"),g.delete(this);let e=y.get(this)??null;y.delete(this),e instanceof HTMLElement&&e.isConnected&&e.focus(),setTimeout(()=>{this.dispatchEvent(new Event("close"))},0)}}})};var v=/color|background|fill|stroke|shadow|^border(?:-(?:top|right|bottom|left|block|inline)(?:-(?:start|end))?)?$|^border-image|^(?:outline|text-decoration|column-rule|text-emphasis|opacity)$|filter$|blend-mode$/,I=/^(?:fill|stroke|color|bgcolor|opacity|[a-z]+(?:-[a-z]+)*-opacity|stop-color|flood-color|lighting-color|filter|mask)$/,A="http://www.w3.org/2000/svg",S="path, rect, circle, ellipse, line, polyline, polygon",_="title, desc, metadata",$="[data-cui-marker]",C=e=>{let t=e.style,a=[];for(let s=0;s<t.length;s+=1){let n=t.item(s);v.test(n)&&a.push(n)}return a},R=(e,t,a)=>{let s=[];for(let n=t;n!==null;n=n.parentElement){let i=C(n);i.length>0&&s.push(`\u30A4\u30F3\u30E9\u30A4\u30F3\u306E\u8272: ${e} \u306E ${n.tagName} \u306E ${i.join(", ")}`);let c=n.getAttributeNames().filter(d=>I.test(d));if(c.length>0&&s.push(`\u5857\u308A\u306E\u5C5E\u6027: ${e} \u306E ${n.tagName} \u306E ${c.join(", ")}`),n===a)break}return s},H=e=>{let t=e.closest("[data-testid]");return t===null?e.tagName:`${e.tagName} ${t.getAttribute("data-testid")}`},P=e=>{for(let t=e.parentElement;t!==null;t=t.parentElement)if(t.hasAttribute("data-cui-surface"))return t;return null},U=e=>Object.hasOwn(T,e)&&T[e]==="nonText",j=(e,t)=>{let a=h.light,s=t.closest("[data-cui-fg]"),n=t.closest("[data-cui-surface]");if(s===null||n===null)return{failures:[`\u5F79\u5272\u306E\u7121\u3044\u6587\u5B57: ${e}`],pair:null};let i=s.getAttribute("data-cui-fg"),c=n.getAttribute("data-cui-surface");return Object.hasOwn(a,i)&&Object.hasOwn(a[i],c)?{failures:R(e,t,s.contains(n)?s:n),pair:`${i}/${c}`}:{failures:[`\u8868\u306B\u7121\u3044\u7D44: ${e}: ${i} on ${c}`],pair:null}},q=e=>{let t=[],a=new Set,s=new Set,n=0,i=0,c=h.light,d=(o,l)=>{n+=1;let r=j(o,l);t.push(...r.failures),r.pair!==null&&a.add(r.pair)},b=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(let o=b.nextNode();o!==null;o=b.nextNode()){let l=o.data.trim(),r=o.parentElement;l===""||r.closest(_)?.namespaceURI===A||d(l,r)}let w=[e,...e.querySelectorAll($)].filter(o=>o.matches($));for(let o of w)for(let l of o.children)d(`\u5370 ${l.getAttribute("data-testid")??l.tagName}`,l);let x=[e,...e.querySelectorAll(S)].filter(o=>o.namespaceURI===A&&o.matches(S));for(let o of x){i+=1;let l=H(o),r=o.getAttribute("data-cui-stroke"),u=o.getAttribute("data-cui-fill"),p=o.closest("[data-cui-surface]");if(r===null&&u===null||p===null){t.push(`\u5F79\u5272\u306E\u7121\u3044\u56F3\u5F62: ${l}`);continue}let f=p.getAttribute("data-cui-surface");u!==null&&u!==f&&t.push(`\u9762\u3068\u9055\u3046\u5857\u308A: ${l}: ${u} on ${f}`);let m=u===null?null:P(p),N=m===null?p:m;if(r!==null){let M=m===null?[f]:[f,m.getAttribute("data-cui-surface")];for(let E of M)U(r)&&Object.hasOwn(c[r],E)?s.add(`${r}/${E}`):t.push(`\u8868\u306B\u7121\u3044\u7DDA\u306E\u7D44: ${l}: ${r} on ${E}`)}t.push(...R(l,o,N))}return{failures:t,measured:a,texts:n,measuredGraphics:s,graphics:i}};export{k as installDialogModel,L as openModals,D as pressEscape,q as scanColourRoles};
1
+ import{d as h,e as T}from"./chunk-FXEGLGL7.js";var g=new Set,y=new WeakMap,_="[autofocus], a[href], button, input, select, textarea, [tabindex]:not([tabindex='-1'])",k=()=>[...g].filter(e=>e.isConnected&&e.open),I=e=>{let t=e.dispatchEvent(new Event("cancel",{cancelable:!0}));return t&&e.close(),t},v=()=>{typeof HTMLDialogElement>"u"||"showModal"in HTMLDialogElement.prototype||Object.defineProperties(HTMLDialogElement.prototype,{showModal:{configurable:!0,writable:!0,value(){if(!this.isConnected)throw new DOMException("The dialog is not connected","InvalidStateError");if(this.open){if(g.has(this))return;throw new DOMException("The dialog is already open as a non-modal dialog","InvalidStateError")}y.set(this,this.ownerDocument.activeElement),this.setAttribute("open",""),g.add(this),this.querySelector(_)?.focus()}},close:{configurable:!0,writable:!0,value(){if(!this.open)return;this.removeAttribute("open"),g.delete(this);let e=y.get(this)??null;y.delete(this),e instanceof HTMLElement&&e.isConnected&&e.focus(),setTimeout(()=>{this.dispatchEvent(new Event("close"))},0)}}})};var C=/color|background|fill|stroke|shadow|^border(?:-(?:top|right|bottom|left|block|inline)(?:-(?:start|end))?)?$|^border-image|^(?:outline|text-decoration|column-rule|text-emphasis|opacity)$|filter$|blend-mode$/,H=/^(?:fill|stroke|color|bgcolor|opacity|[a-z]+(?:-[a-z]+)*-opacity|stop-color|flood-color|lighting-color|filter|mask)$/,S="http://www.w3.org/2000/svg",$="path, rect, circle, ellipse, line, polyline, polygon",P="title, desc, metadata",w="[data-cui-marker]",U=/^\[data-[a-z0-9_-]+(?:[~|^$*]?="[^"\\]*")?\]$/,j=e=>{let t=e.style,l=[];for(let s=0;s<t.length;s+=1){let n=t.item(s);C.test(n)&&l.push(n)}return l},x=(e,t,l)=>{let s=[];for(let n=t;n!==null;n=n.parentElement){let i=j(n);i.length>0&&s.push(`\u30A4\u30F3\u30E9\u30A4\u30F3\u306E\u8272: ${e} \u306E ${n.tagName} \u306E ${i.join(", ")}`);let c=n.getAttributeNames().filter(d=>H.test(d));if(c.length>0&&s.push(`\u5857\u308A\u306E\u5C5E\u6027: ${e} \u306E ${n.tagName} \u306E ${c.join(", ")}`),n===l)break}return s},q=e=>{let t=e.closest("[data-testid]");return t===null?e.tagName:`${e.tagName} ${t.getAttribute("data-testid")}`},z=e=>{for(let t=e.parentElement;t!==null;t=t.parentElement)if(t.hasAttribute("data-cui-surface"))return t;return null},B=e=>Object.hasOwn(T,e)&&T[e]==="nonText",F=(e,t)=>{let l=h.light,s=t.closest("[data-cui-fg]"),n=t.closest("[data-cui-surface]");if(s===null||n===null)return{failures:[`\u5F79\u5272\u306E\u7121\u3044\u6587\u5B57: ${e}`],pair:null};let i=s.getAttribute("data-cui-fg"),c=n.getAttribute("data-cui-surface");return Object.hasOwn(l,i)&&Object.hasOwn(l[i],c)?{failures:x(e,t,s.contains(n)?s:n),pair:`${i}/${c}`}:{failures:[`\u8868\u306B\u7121\u3044\u7D44: ${e}: ${i} on ${c}`],pair:null}},G=(e,t)=>t.flatMap(l=>{if(!U.test(l))throw new RangeError(`A role scan excludes only by one data-* attribute selector: ${l}`);if(e.matches(l))throw new RangeError(`A role scan exclusion must not match the root it scans: ${l}`);let s=[...e.querySelectorAll(l)];if(s.length===0)throw new RangeError(`A role scan exclusion matches no element under the root: ${l}`);return s}),K=(e,t)=>{let l=G(e,t===void 0?[]:t.exclude),s=o=>l.some(r=>r.contains(o)),n=[],i=new Set,c=new Set,d=0,b=0,O=h.light,A=(o,r)=>{d+=1;let a=F(o,r);n.push(...a.failures),a.pair!==null&&i.add(a.pair)},R=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(let o=R.nextNode();o!==null;o=R.nextNode()){let r=o.data.trim(),a=o.parentElement;r===""||a.closest(P)?.namespaceURI===S||s(a)||A(r,a)}let M=[e,...e.querySelectorAll(w)].filter(o=>o.matches(w)&&!s(o));for(let o of M)for(let r of o.children)s(r)||A(`\u5370 ${r.getAttribute("data-testid")??r.tagName}`,r);let N=[e,...e.querySelectorAll($)].filter(o=>o.namespaceURI===S&&o.matches($)&&!s(o));for(let o of N){b+=1;let r=q(o),a=o.getAttribute("data-cui-stroke"),u=o.getAttribute("data-cui-fill"),p=o.closest("[data-cui-surface]");if(a===null&&u===null||p===null){n.push(`\u5F79\u5272\u306E\u7121\u3044\u56F3\u5F62: ${r}`);continue}let f=p.getAttribute("data-cui-surface");u!==null&&u!==f&&n.push(`\u9762\u3068\u9055\u3046\u5857\u308A: ${r}: ${u} on ${f}`);let m=u===null?null:z(p),L=m===null?p:m;if(a!==null){let D=m===null?[f]:[f,m.getAttribute("data-cui-surface")];for(let E of D)B(a)&&Object.hasOwn(O[a],E)?c.add(`${a}/${E}`):n.push(`\u8868\u306B\u7121\u3044\u7DDA\u306E\u7D44: ${r}: ${a} on ${E}`)}n.push(...x(r,o,L))}return{failures:n,measured:i,texts:d,measuredGraphics:c,graphics:b}};export{v as installDialogModel,k as openModals,I as pressEscape,K as scanColourRoles};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aiquants/console-ui",
3
- "version": "0.6.4",
3
+ "version": "0.6.5",
4
4
  "description": "Host-agnostic UI foundation for React admin consoles, with a React entry, a React-free core entry, a DOM testing entry and a stylesheet.",
5
5
  "sideEffects": [
6
6
  "**/*.css"