@ctrl/dom 0.1.15 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (69) hide show
  1. package/README.md +44 -0
  2. package/dist/bridge/internal.js +1 -1
  3. package/dist/dom/_chunks/src-CaVKwScX.js +49 -0
  4. package/dist/dom/index.js +1 -1
  5. package/dist/dom/internal.js +1 -1
  6. package/dist/dom/types/css/cascade.d.ts +10 -3
  7. package/dist/dom/types/css/cssom.d.ts +9 -3
  8. package/dist/dom/types/css/parser.d.ts +27 -0
  9. package/dist/dom/types/css/style-deps.d.ts +11 -0
  10. package/dist/dom/types/events/listeners.d.ts +24 -2
  11. package/dist/dom/types/html/elements.d.ts +3 -2
  12. package/dist/dom/types/html/forms/HTMLButtonElement.d.ts +4 -3
  13. package/dist/dom/types/html/forms/HTMLFieldSetElement.d.ts +3 -2
  14. package/dist/dom/types/html/forms/HTMLInputElement.d.ts +11 -36
  15. package/dist/dom/types/html/forms/HTMLOutputElement.d.ts +6 -5
  16. package/dist/dom/types/html/forms/HTMLSelectElement.d.ts +6 -5
  17. package/dist/dom/types/html/forms/HTMLTextAreaElement.d.ts +10 -15
  18. package/dist/dom/types/html/forms/control-state.d.ts +33 -0
  19. package/dist/dom/types/html/forms/face.d.ts +3 -2
  20. package/dist/dom/types/html/forms/form-associated.d.ts +15 -3
  21. package/dist/dom/types/html/forms/user-validity.d.ts +2 -2
  22. package/dist/dom/types/html/forms/validation.d.ts +2 -2
  23. package/dist/dom/types/internal.d.ts +3 -2
  24. package/dist/dom/types/keys.d.ts +9 -16
  25. package/dist/dom/types/nodes/Document.d.ts +6 -2
  26. package/dist/dom/types/nodes/attributes.d.ts +1 -1
  27. package/dist/dom/types/nodes/cache.d.ts +1 -1
  28. package/dist/dom/types/nodes/constants.d.ts +5 -0
  29. package/dist/dom/types/selectors/compile.d.ts +8 -0
  30. package/dist/dom/types/selectors/internal.d.ts +3 -1
  31. package/dist/dom/types/window/clock.d.ts +30 -0
  32. package/dist/dom/types/window/file-reset.d.ts +22 -0
  33. package/dist/jest-dom/_chunks/{matchers-CkxM783o.cjs → matchers-CZ6Smfw9.cjs} +2 -2
  34. package/dist/jest-dom/_chunks/{matchers-Dt7W4g5X.js → matchers-CwGF61j-.js} +2 -2
  35. package/dist/jest-dom/index.cjs +1 -1
  36. package/dist/jest-dom/index.js +1 -1
  37. package/dist/jest-dom/jest-globals.cjs +1 -1
  38. package/dist/jest-dom/jest-globals.js +1 -1
  39. package/dist/jest-dom/matchers.cjs +1 -1
  40. package/dist/jest-dom/matchers.js +1 -1
  41. package/dist/jest-dom/vitest.cjs +1 -1
  42. package/dist/jest-dom/vitest.js +1 -1
  43. package/dist/react/_chunks/pure-CYb0HgYU.js +1 -0
  44. package/dist/react/_chunks/pure-DRugbA0j.cjs +1 -0
  45. package/dist/react/index.cjs +1 -1
  46. package/dist/react/index.js +1 -1
  47. package/dist/react/pure.cjs +1 -1
  48. package/dist/react/pure.js +1 -1
  49. package/dist/testing-library/index.cjs +2 -2
  50. package/dist/testing-library/index.js +7 -7
  51. package/dist/user-event/index.cjs +15 -15
  52. package/dist/user-event/index.js +15 -15
  53. package/dist/user-event/types/ctrl-dom.d.ts +8 -0
  54. package/dist/vitest-environment/_chunks/rolldown-runtime-H3fMLYWS.js +1 -0
  55. package/dist/vitest-environment/failure-snapshot.js +1 -1
  56. package/dist/vitest-environment/index.js +1 -1
  57. package/dist/vitest-environment/jsx-dev-runtime.js +1 -0
  58. package/dist/vitest-environment/jsx-runtime.js +1 -0
  59. package/dist/vitest-environment/plugin.js +1 -1
  60. package/dist/vitest-environment/shared-workers.js +1 -0
  61. package/dist/vitest-environment/types/jsx-dev-runtime.d.ts +3 -0
  62. package/dist/vitest-environment/types/jsx-runtime.d.ts +4 -0
  63. package/dist/vitest-environment/types/plugin.d.ts +19 -0
  64. package/dist/vitest-environment/types/shared-workers.d.ts +1 -0
  65. package/package.json +13 -1
  66. package/dist/dom/_chunks/src-C4oa-U7z.js +0 -49
  67. package/dist/react/_chunks/pure-D7Z4g4oF.js +0 -1
  68. package/dist/react/_chunks/pure-DOgNQrwu.cjs +0 -1
  69. package/dist/vitest-environment/_chunks/rolldown-runtime-BhWHdk3m.js +0 -1
@@ -17,7 +17,7 @@ export { windowInterfaces } from "./window/Window.js";
17
17
  export { captureInterfaceBaseline, guardInterfaceDefinitions, restoreInterfaces } from "./window/isolation.js";
18
18
  export { COMPAT, COMPAT_PROFILES, DEFAULT_COMPAT, compatExposes, deferredCompatMembers, hiddenGlobals, resolveCompat, type CompatEntry, type CompatProfile, } from "./window/compat.js";
19
19
  export { trackGlobalTimers } from "./window/timers.js";
20
- export { VirtualClock, VirtualTimeout, installClock, clockNow, clockStats, canSkipZeroDelayWait, foreignImmediatesPending, isClockTimer, skipIdleTime, skipZeroDelayWait, virtualDate, virtualPerformance, type InstalledClock, type VirtualClockOptions, } from "./window/clock.js";
20
+ export { VirtualClock, VirtualTimeout, installClock, clockNow, clockStats, loopTurn, canSkipZeroDelayWait, foreignImmediatesPending, isClockTimer, skipIdleTime, skipZeroDelayWait, virtualDate, virtualPerformance, type InstalledClock, type VirtualClockOptions, } from "./window/clock.js";
21
21
  export { FAILURE_CHANNEL, SPAN_CHANNEL, describeCall, describeNode, quote, setFailureSnapshot, setNodeDescriber, spanChannel, subscribeTestFailures, tracePromise, traceSync, tracing, type SpanContext, } from "./trace.js";
22
22
  export { dispatch, getCurrentEvent, retarget, nodeGetTheParent, setAssignedSlotLookup } from "./events/dispatch.js";
23
23
  export { fireAnEvent, dispatchTrusted, fireSyntheticPointerEvent } from "./events/fire.js";
@@ -26,7 +26,8 @@ export { reportException, setUncaughtExceptionHandler, type UncaughtExceptionHan
26
26
  export { setNotImplementedHandler, type NotImplementedError, type NotImplementedHandler, } from "./window/not-implemented.js";
27
27
  export { createEvent } from "./events/createEvent.js";
28
28
  export { installEventHandlers, getEventHandler, setEventHandler, GLOBAL_EVENT_HANDLER_EVENTS, WINDOW_EVENT_HANDLER_EVENTS, type EventHandlersKind, } from "./events/handlers.js";
29
- export { hasListeners, removeAllEventListeners } from "./events/listeners.js";
29
+ export { hasListeners, listenerCount, removeAllEventListeners, reusableElement } from "./events/listeners.js";
30
+ export { registerTestHooks, resetWindowBetweenFiles, testHooks, type TestLibraryHooks } from "./window/file-reset.js";
30
31
  export type { ActivationTarget } from "./events/activation.js";
31
32
  export { NodeList } from "./collections/NodeList.js";
32
33
  export { HTMLCollection, withNamedProperties, ensureCollectionIndexGetters, type ElementFilter, } from "./collections/HTMLCollection.js";
@@ -5,18 +5,20 @@ export declare const $assocGen: unique symbol;
5
5
  export declare const $attr: unique symbol;
6
6
  export declare const $attributes: unique symbol;
7
7
  export declare const $availableToElementInternals: unique symbol;
8
- export declare const $badInput: unique symbol;
9
8
  export declare const $baseFor: unique symbol;
10
9
  export declare const $baseOverride: unique symbol;
11
10
  export declare const $baseURL: unique symbol;
12
11
  export declare const $baseVersion: unique symbol;
12
+ /** Document: how many of its version bumps could not change a computed style (css/style-deps.ts). */
13
+ export declare const $benign: unique symbol;
13
14
  export declare const $block: unique symbol;
15
+ /** CSSStyleRule: its declaration block once parsed, and its text until then (css/cssom.ts). */
16
+ export declare const $blockParsed: unique symbol;
17
+ export declare const $blockText: unique symbol;
14
18
  export declare const $byCtor: unique symbol;
15
19
  export declare const $byName: unique symbol;
16
20
  export declare const $cache: unique symbol;
17
21
  export declare const $callback: unique symbol;
18
- export declare const $checked: unique symbol;
19
- export declare const $checkedSet: unique symbol;
20
22
  export declare const $childNodes: unique symbol;
21
23
  export declare const $childWindows: unique symbol;
22
24
  export declare const $children: unique symbol;
@@ -49,8 +51,8 @@ export declare const $defaultValueOverride: unique symbol;
49
51
  export declare const $delegatesFocus: unique symbol;
50
52
  export declare const $devicePixelRatio: unique symbol;
51
53
  export declare const $dirtiness: unique symbol;
52
- export declare const $dirtyChecked: unique symbol;
53
- export declare const $dirtyValue: unique symbol;
54
+ /** An input's or textarea's ControlState (html/forms/control-state.ts). */
55
+ export declare const $control: unique symbol;
54
56
  export declare const $disabled: unique symbol;
55
57
  export declare const $disallowModification: unique symbol;
56
58
  export declare const $derived: unique symbol;
@@ -70,6 +72,8 @@ export declare const $filter: unique symbol;
70
72
  export declare const $firingSubmissionEvents: unique symbol;
71
73
  export declare const $focused: unique symbol;
72
74
  export declare const $form: unique symbol;
75
+ /** Document: an element of it has had a `form` attribute (sticky; html/forms/form-associated.ts formOwnerScope). */
76
+ export declare const $formAttrSeen: unique symbol;
73
77
  export declare const $forLabels: unique symbol;
74
78
  export declare const $forms: unique symbol;
75
79
  export declare const $frameCallbacks: unique symbol;
@@ -91,7 +95,6 @@ export declare const $idleId: unique symbol;
91
95
  export declare const $ids: unique symbol;
92
96
  export declare const $impl: unique symbol;
93
97
  export declare const $implementation: unique symbol;
94
- export declare const $indeterminate: unique symbol;
95
98
  export declare const $index: unique symbol;
96
99
  export declare const $indexed: unique symbol;
97
100
  export declare const $inflight: unique symbol;
@@ -130,10 +133,6 @@ export declare const $parentRule: unique symbol;
130
133
  export declare const $parentWindow: unique symbol;
131
134
  export declare const $pastNames: unique symbol;
132
135
  export declare const $pointerBeforeReference: unique symbol;
133
- export declare const $preApplied: unique symbol;
134
- export declare const $preChecked: unique symbol;
135
- export declare const $preCheckedRadio: unique symbol;
136
- export declare const $preIndeterminate: unique symbol;
137
136
  export declare const $prefix: unique symbol;
138
137
  export declare const $prelude: unique symbol;
139
138
  export declare const $presentationStyle: unique symbol;
@@ -141,7 +140,6 @@ export declare const $pseudo: unique symbol;
141
140
  export declare const $queries: unique symbol;
142
141
  export declare const $radios: unique symbol;
143
142
  export declare const $ranges: unique symbol;
144
- export declare const $rawValue: unique symbol;
145
143
  export declare const $readonly: unique symbol;
146
144
  export declare const $readyState: unique symbol;
147
145
  export declare const $rebuildVersion: unique symbol;
@@ -159,10 +157,7 @@ export declare const $screen: unique symbol;
159
157
  export declare const $scrollRestoration: unique symbol;
160
158
  export declare const $scrollX: unique symbol;
161
159
  export declare const $scrollY: unique symbol;
162
- export declare const $selDir: unique symbol;
163
- export declare const $selEnd: unique symbol;
164
160
  export declare const $selSet: unique symbol;
165
- export declare const $selStart: unique symbol;
166
161
  export declare const $selectedOptions: unique symbol;
167
162
  export declare const $selectedness: unique symbol;
168
163
  export declare const $selection: unique symbol;
@@ -189,13 +184,11 @@ export declare const $title: unique symbol;
189
184
  export declare const $treeVersion: unique symbol;
190
185
  export declare const $type: unique symbol;
191
186
  export declare const $types: unique symbol;
192
- export declare const $uiValue: unique symbol;
193
187
  export declare const $updating: unique symbol;
194
188
  export declare const $updatingSelectedContent: unique symbol;
195
189
  export declare const $uri: unique symbol;
196
190
  export declare const $url: unique symbol;
197
191
  export declare const $userActivation: unique symbol;
198
- export declare const $userEdited: unique symbol;
199
192
  export declare const $userValidity: unique symbol;
200
193
  export declare const $validity: unique symbol;
201
194
  export declare const $value: unique symbol;
@@ -14,7 +14,7 @@ import type { Window } from "../window/Window.js";
14
14
  import type { NodeList } from "../collections/NodeList.js";
15
15
  import type { ElementCreationOptions } from "../webidl.js";
16
16
  import type { Event } from "../events/Event.js";
17
- import { $aboutBase, $baseFor, $baseOverride, $baseURL, $baseVersion, $contentType, $css, $derived, $doc, $focused, $forLabels, $forms, $ids, $implementation, $isHTML, $mode, $radios, $ranges, $selection, $styleVersion, $treeVersion, $url, $version, $window, $writeBuffer } from "../keys.js";
17
+ import { $aboutBase, $baseFor, $baseOverride, $baseURL, $baseVersion, $benign, $contentType, $css, $derived, $doc, $focused, $forLabels, $formAttrSeen, $forms, $ids, $implementation, $isHTML, $mode, $radios, $ranges, $selection, $styleVersion, $treeVersion, $url, $version, $window, $writeBuffer } from "../keys.js";
18
18
  export declare class Document extends Node {
19
19
  /** Browsing context's window, or null for documents created via DOMImplementation / new Document(). */
20
20
  [$window]: Window | null;
@@ -27,6 +27,8 @@ export declare class Document extends Node {
27
27
  [$treeVersion]: number;
28
28
  /** Bumped when author style sheets change (src/css). */
29
29
  [$styleVersion]: number;
30
+ /** Version bumps that left every computed style as it was (css/style-deps.ts). */
31
+ [$benign]: number;
30
32
  /** Connected elements by id. A value is an array only when several connected elements share an id. */
31
33
  [$ids]: Map<string, NodeImpl | NodeImpl[]>;
32
34
  /** Focused element (https://html.spec.whatwg.org/#focused-area-of-the-document), null = viewport/body. */
@@ -56,12 +58,14 @@ export declare class Document extends Node {
56
58
  * an ID without walking the tree.
57
59
  */
58
60
  [$forLabels]: Map<string, NodeImpl[]> | null;
61
+ /** An element of this document has had a `form` attribute (never reset): formOwnerScope. */
62
+ [$formAttrSeen]: boolean;
59
63
  /**
60
64
  * Connected radio buttons with a non-empty name, by name, each list in no particular order, or
61
65
  * null before the first (html/forms/HTMLInputElement.ts). A radio's group is looked up here
62
66
  * instead of walking the tree.
63
67
  */
64
- [$radios]: Map<string, NodeImpl[]> | null;
68
+ [$radios]: Map<string, Set<NodeImpl>> | null;
65
69
  /** document.forms (named-properties proxy), created on first read. */
66
70
  [$forms]: HTMLCollection | null;
67
71
  /** https://html.spec.whatwg.org/#concept-document-about-base-url (about:blank / about:srcdoc documents of nested browsing contexts). */
@@ -15,7 +15,7 @@ export declare function getAttribute(el: NodeImpl, qualifiedName: string): strin
15
15
  /**
16
16
  * The presence bit an attribute local name sets on its element: F_ARIA_ATTRS / F_DATA_ATTRS for
17
17
  * names starting with `aria-` / `data-`, F_TABINDEX_ATTR, F_CONTENTEDITABLE_ATTR or F_INERT_ATTR
18
- * for those names, else 0.
18
+ * for those names, F_FORM_ATTR for `form`, else 0.
19
19
  */
20
20
  export declare function prefixFlag(localName: string): number;
21
21
  /**
@@ -21,7 +21,7 @@ export declare class NodeCache {
21
21
  nameVersion: number;
22
22
  /** Accessible name. */
23
23
  name: string;
24
- /** `Document._version` at which `style` was computed. */
24
+ /** `Document._version` less its benign bumps (css/style-deps.ts) at which `style` was computed. */
25
25
  styleVersion: number;
26
26
  /** `Document._styleVersion` at which `style` was computed. */
27
27
  styleSheetVersion: number;
@@ -67,3 +67,8 @@ export declare const F_DATA_ATTRS: number;
67
67
  export declare const F_TABINDEX_ATTR: number;
68
68
  export declare const F_CONTENTEDITABLE_ATTR: number;
69
69
  export declare const F_INERT_ATTR: number;
70
+ /**
71
+ * Element has a `form` attribute, kept like F_ARIA_ATTRS. A document that never held one
72
+ * (Document[$formAttrSeen]) has no form whose controls lie outside it (html/forms/form-associated.ts).
73
+ */
74
+ export declare const F_FORM_ATTR: number;
@@ -143,6 +143,14 @@ export declare function ancestorHashes(cx: CComplex): number[];
143
143
  * Every match is then a descendant of the element with that id. "" when there is none.
144
144
  */
145
145
  export declare function idRootOf(list: CList): string;
146
+ /** Calls `visit` with the name (as written and lowercased) of every attribute selector in `cx`, nested lists included. */
147
+ export declare function attributeNamesIn(cx: CComplex, visit: (name: string) => void): void;
148
+ /**
149
+ * The type selector every match of `list` must satisfy, or null: a single complex selector whose
150
+ * subject compound names an element type in any namespace (`input[name="a"][type="radio"]`,
151
+ * `form > button.primary`).
152
+ */
153
+ export declare function subjectType(list: CList): Test | null;
146
154
  /** Fast-path shapes for querySelector(All): a single complex with one compound of one test. */
147
155
  export declare const FAST_NONE = 0;
148
156
  export declare const FAST_ALL = 1;
@@ -1,6 +1,6 @@
1
1
  import type { NodeImpl } from "../nodes/NodeImpl.js";
2
2
  import { type NamespaceContext } from "./serialize.js";
3
- import { type CComplex, CompileInfo, unpackSpecificity, packSpecificity, KEY_NONE, KEY_ID, KEY_CLASS, KEY_TAG } from "./compile.js";
3
+ import { type CComplex, CompileInfo, KEY_CLASS, KEY_ID, KEY_NONE, KEY_TAG, packSpecificity, unpackSpecificity } from "./compile.js";
4
4
  import { $cx, $info } from "../keys.js";
5
5
  export { KEY_NONE, KEY_ID, KEY_CLASS, KEY_TAG, packSpecificity, unpackSpecificity };
6
6
  export { buildAncestorFilter, mayMatchAncestors } from "./filter.js";
@@ -39,6 +39,8 @@ export declare class CompiledSelector {
39
39
  /** Specificity as an (a, b, c) tuple. */
40
40
  get specificityTuple(): [number, number, number];
41
41
  }
42
+ /** Calls `visit` with the name of every attribute selector in `selector` (as written and lowercased). */
43
+ export declare function selectorAttributeNames(selector: CompiledSelector, visit: (name: string) => void): void;
42
44
  export interface CompiledSelectorList {
43
45
  readonly text: string;
44
46
  /** CSSOM serialization (https://drafts.csswg.org/cssom/#serialize-a-group-of-selectors), for selectorText. */
@@ -113,6 +113,8 @@ export declare class VirtualClock {
113
113
  toVirtualTrack(record: TimerRecord): void;
114
114
  fireReal(record: TimerRecord): void;
115
115
  _refresh(record: TimerRecord): void;
116
+ /** Drop every pending timer; the clock goes on (a test file ended in a worker the next one shares). */
117
+ clearAll(): void;
116
118
  dispose(): void;
117
119
  /** Keep one real host timer armed for the earliest due timer (ref'd while any timer is). */
118
120
  armHost(): void;
@@ -198,8 +200,36 @@ export declare function isClockTimer(fn: unknown): boolean;
198
200
  * 5 ms slice. Without a clock every queued immediate counts.
199
201
  */
200
202
  export declare function foreignImmediatesPending(): boolean;
203
+ /**
204
+ * A macrotask boundary for a caller that yields so pending work can run, and has nothing of its
205
+ * own to wait for: user-event between two actions and at the end of a call, Testing Library's
206
+ * asyncWrapper drain. `resolve` runs where a `setImmediate(resolve)` would have run it, without
207
+ * the event-loop turn when that turn has nothing else to do.
208
+ *
209
+ * A turn costs Node ~12.6 µs here even when empty (libuv polls for I/O on every one), and
210
+ * user-event takes two to four per call: half of a `user.click()`. What a turn does for such a
211
+ * caller is finish the microtasks (and process.nextTick callbacks) queued so far, with everything
212
+ * they queue in turn, then run timers that are due, I/O that is ready and the immediates queued
213
+ * before the caller's. So:
214
+ *
215
+ * - `resolve` is called from a process.nextTick callback queued from a microtask. Node runs its
216
+ * tick queue only once V8's microtask queue is empty (processTicksAndRejections in
217
+ * lib/internal/process/task_queues.js), so every microtask queued before, and every one those
218
+ * queued, has run by then, as at the end of a macrotask.
219
+ * - There, the loop must be idle as the driver sees it (busy(): no immediate but the clock's own,
220
+ * which covers React's scheduler; no I/O resource beyond the baseline) with no timer of the
221
+ * clock's due. Otherwise the caller gets its real turn.
222
+ * - Every MAX_TURNLESS_MS of real time a real turn is taken regardless, so Node's own timers (the
223
+ * test runner's timeout for a test that loops forever on `await user.click()`), unref'd timers
224
+ * and the runner's messages are never starved.
225
+ *
226
+ * Without a clock that skips idle time: `setImmediate(resolve)`.
227
+ */
228
+ export declare function loopTurn(resolve: () => void): void;
201
229
  /** Milliseconds the active clock has skipped (0 without one): what a traced span reads at start and end. */
202
230
  export declare function clockSkipped(): number;
231
+ /** Drop the active clock's pending timers (window/file-reset.ts); nothing without one. */
232
+ export declare function clearActiveClockTimers(): void;
203
233
  /** The active clock's skipped time and pending timers (for test observability), or null without one. */
204
234
  export declare function clockStats(): {
205
235
  skippedMs: number;
@@ -0,0 +1,22 @@
1
+ import type { Window } from "./Window.js";
2
+ /**
3
+ * What a testing library does around tests, for a runner hook to call. A library registers these
4
+ * when it is loaded, under the conditions it would register the runner's own hooks; loaded once
5
+ * for a worker's files, its own registration reaches only the first.
6
+ */
7
+ export interface TestLibraryHooks {
8
+ /** A test file ended with the window going on: unmount what is still mounted. */
9
+ fileEnd?: () => void;
10
+ afterEach?: () => void;
11
+ beforeAll?: () => void;
12
+ afterAll?: () => void;
13
+ }
14
+ /**
15
+ * Testing library `name`'s hooks, added to the ones it registered before. A fresh instance of the
16
+ * library (after a module reset) replaces the previous one's.
17
+ */
18
+ export declare function registerTestHooks(name: string, hooks: TestLibraryHooks): void;
19
+ /** The hooks registered for the current window, by library. */
20
+ export declare function testHooks(): TestLibraryHooks[];
21
+ /** A test file is about to start in `window`, which other files have used or will use. */
22
+ export declare function resetWindowBetweenFiles(window: Window): void;
@@ -1,7 +1,7 @@
1
1
  var e=Object.defineProperty,__name=(t,n)=>e(t,`name`,{value:n,configurable:!0}),__exportAll=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],enumerable:!0});return n||e(r,Symbol.toStringTag,{value:`Module`}),r};let t=require("@ctrl/dom/testing-library"),n=require("node:module"),r=require("@ctrl/dom/aria"),i=require("@ctrl/dom/internal"),a=require("@ctrl/dom/testing-library/agent");var GenericTypeError=class extends Error{constructor(e,t,n,r){super(),Error.captureStackTrace&&Error.captureStackTrace(this,n);let i=``;try{i=r.utils.printWithType(`Received`,t,r.utils.printReceived)}catch{}this.message=[r.utils.matcherHint(`${r.isNot?`.not`:``}.${n.name}`,`received`,``),``,`${r.utils.RECEIVED_COLOR(`received`)} value must ${e}.`,i].join(`
2
2
  `)}},HtmlElementTypeError=class extends GenericTypeError{constructor(e,t,n){super(`be an HTMLElement or an SVGElement`,e,t,n)}},NodeTypeError=class extends GenericTypeError{constructor(e,t,n){super(`be a Node`,e,t,n)}};function checkHasWindow(e,t,n,r){if(!e||!e.ownerDocument||!e.ownerDocument.defaultView)throw new t(e,n,r)}function checkNode(e,t,n){if(checkHasWindow(e,NodeTypeError,t,n),!(e instanceof e.ownerDocument.defaultView.Node))throw new NodeTypeError(e,t,n)}function checkHtmlElement(e,t,n){checkHasWindow(e,HtmlElementTypeError,t,n);let r=e.ownerDocument.defaultView;if(!(e instanceof r.HTMLElement)&&!(e instanceof r.SVGElement))throw new HtmlElementTypeError(e,t,n)}var InvalidCSSError=class extends Error{constructor(e,t,n){super(),Error.captureStackTrace&&Error.captureStackTrace(this,t),this.message=[e.message,``,n.utils.RECEIVED_COLOR(`Failing css:`),n.utils.RECEIVED_COLOR(`${e.css}`)].join(`
3
3
  `)}};let o=null;function parseCSS(e,t,r){o??=(0,n.createRequire)(require("url").pathToFileURL(__filename).href)(`@adobe/css-tools`).parse;let i=o(`selector { ${e} }`,{silent:!0}).stylesheet;if(i.parsingErrors&&i.parsingErrors.length>0){let{reason:n,line:a}=i.parsingErrors[0];throw new InvalidCSSError({css:e,message:`Syntax error parsing expected css: ${n} on line: ${a}`},t,r)}let a={},s=i.rules[0].declarations;for(let e=0;e<s.length;e++){let t=s[e];t.type===`declaration`&&(a[t.property]=t.value)}return a}function display(e,t){return typeof t==`string`?t:e.utils.stringify(t)}function getMessage(e,t,n,r,i,a){return[`${t}\n`,`${n}:\n${e.utils.EXPECTED_COLOR(redent(display(e,r),2))}`,`${i}:\n${e.utils.RECEIVED_COLOR(redent(display(e,a),2))}`].join(`
4
- `)}function matches(e,t){return t instanceof RegExp?t.test(e):e.includes(String(t))}function deprecate(e,t){console.warn(`Warning: ${e} has been deprecated and will be removed in future updates.`,t)}function normalize(e){return e.replace(/\s+/g,` `).trim()}function getTag(e){return e.tagName&&e.tagName.toLowerCase()}function getSelectValue({multiple:e,options:t}){let n=[];for(let e=0;e<t.length;e++)t[e].selected&&n.push(t[e]);if(e)return n.map(e=>e.value);if(n.length!==0)return n[0].value}function getInputValue(e){switch(e.type){case`number`:return e.value===``?null:Number(e.value);case`checkbox`:return e.checked;default:return e.value}}const s=[`meter`,`progressbar`,`slider`,`spinbutton`];function getAccessibleValue(e){if(s.includes(e.getAttribute(`role`)))return Number(e.getAttribute(`aria-valuenow`))}function getSingleElementValue(e){if(e)switch(e.tagName.toLowerCase()){case`input`:return getInputValue(e);case`select`:return getSelectValue(e);default:return e.value??getAccessibleValue(e)}}function toSentence(e,{wordConnector:t=`, `,lastWordConnector:n=` and `}={}){return[e.slice(0,-1).join(t),e[e.length-1]].join(e.length>1?n:``)}function compareAsSet(e,t){if(Array.isArray(e)&&Array.isArray(t)){let n=new Set(t);return[...new Set(e)].every(e=>n.has(e))}return e===t}function redent(e,t){let n=e.match(/^[ \t]*(?=\S)/gm),r=0;n&&(r=n.reduce((e,t)=>Math.min(e,t.length),1/0));let i=r>0?e.replace(RegExp(`^[ \\t]{${r}}`,`gm`),``):e;return t===0?i:i.replace(/^(?!\s*$)/gm,` `.repeat(t))}function cssEscape(e){let t=String(e),n=t.length,r=-1,i=``,a=t.charCodeAt(0);for(;++r<n;){let e=t.charCodeAt(r);i+=e===0?`�`:e>=1&&e<=31||e===127||r===0&&e>=48&&e<=57||r===1&&e>=48&&e<=57&&a===45?`\\`+e.toString(16)+` `:r===0&&n===1&&e===45?`\\`+t.charAt(r):e>=128||e===45||e===95||e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122?t.charAt(r):`\\`+t.charAt(r)}return i}const c=process.env,l=process.argv,u=!(c.NO_COLOR||l.includes(`--no-color`))&&(!!c.FORCE_COLOR||l.includes(`--color`)||process.platform===`win32`||process.stdout?.isTTY&&c.TERM!==`dumb`||!!c.CI);function picoRed(e){if(!u)return String(e);let t=`\x1B[31m`,n=`\x1B[39m`,r=``+e,i=r.indexOf(n,5);if(i===-1)return t+r+n;let a=``,o=0;do a+=r.substring(o,i)+t,o=i+5,i=r.indexOf(n,o);while(i!==-1);return t+a+r.substring(o)+n}const p=[`alt text`,`display value`,`label text`,`placeholder text`,`role`,`test ID`,`text`,`title`];function toPascalCase(e){return e.split(` `).map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(``)}function createQueryMatcher(e,n){let r=toPascalCase(n),i=`toContain${e}By${r}`,a=t.queries[`queryAllBy${r}`];function queryMatcher(r,...o){checkHtmlElement(r,queryMatcher,this);let s=a(r,...o);return{message:()=>{let r=this.isNot?`not to`:`to`,a=this.utils.matcherHint(`${this.isNot?`.not`:``}.${i}`,`element`,n,{secondArgument:o[1]===void 0?void 0:this.utils.printExpected(o[1])}),c=[getMessage(this,a,`Expected element ${r} contain ${e.toLowerCase()} descendant by ${n}`,o[0],`Received`,s.length)],l=s.map(e=>(0,t.prettyDOM)(e)).filter(e=>typeof e==`string`);return l.length&&c.push(`Here are the matching elements:`,...l),c.join(`
4
+ `)}function matches(e,t){return t instanceof RegExp?t.test(e):e.includes(String(t))}function deprecate(e,t){console.warn(`Warning: ${e} has been deprecated and will be removed in future updates.`,t)}function normalize(e){return e.replace(/\s+/g,` `).trim()}function getTag(e){return e.tagName&&e.tagName.toLowerCase()}function getSelectValue({multiple:e,options:t}){let n=[];for(let e=0;e<t.length;e++)t[e].selected&&n.push(t[e]);if(e)return n.map(e=>e.value);if(n.length!==0)return n[0].value}function getInputValue(e){switch(e.type){case`number`:return e.value===``?null:Number(e.value);case`checkbox`:return e.checked;default:return e.value}}const s=[`meter`,`progressbar`,`slider`,`spinbutton`];function getAccessibleValue(e){if(s.includes(e.getAttribute(`role`)))return Number(e.getAttribute(`aria-valuenow`))}function getSingleElementValue(e){if(e)switch(e.tagName.toLowerCase()){case`input`:return getInputValue(e);case`select`:return getSelectValue(e);default:return e.value??getAccessibleValue(e)}}function toSentence(e,{wordConnector:t=`, `,lastWordConnector:n=` and `}={}){return[e.slice(0,-1).join(t),e[e.length-1]].join(e.length>1?n:``)}function compareAsSet(e,t){if(Array.isArray(e)&&Array.isArray(t)){let n=new Set(t);return[...new Set(e)].every(e=>n.has(e))}return e===t}function redent(e,t){let n=e.match(/^[ \t]*(?=\S)/gm),r=0;n&&(r=n.reduce((e,t)=>Math.min(e,t.length),1/0));let i=r>0?e.replace(RegExp(`^[ \\t]{${r}}`,`gm`),``):e;return t===0?i:i.replace(/^(?!\s*$)/gm,` `.repeat(t))}const c=process.env,l=process.argv,u=!(c.NO_COLOR||l.includes(`--no-color`))&&(!!c.FORCE_COLOR||l.includes(`--color`)||process.platform===`win32`||process.stdout?.isTTY&&c.TERM!==`dumb`||!!c.CI);function picoRed(e){if(!u)return String(e);let t=`\x1B[31m`,n=`\x1B[39m`,r=``+e,i=r.indexOf(n,5);if(i===-1)return t+r+n;let a=``,o=0;do a+=r.substring(o,i)+t,o=i+5,i=r.indexOf(n,o);while(i!==-1);return t+a+r.substring(o)+n}const p=[`alt text`,`display value`,`label text`,`placeholder text`,`role`,`test ID`,`text`,`title`];function toPascalCase(e){return e.split(` `).map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(``)}function createQueryMatcher(e,n){let r=toPascalCase(n),i=`toContain${e}By${r}`,a=t.queries[`queryAllBy${r}`];function queryMatcher(r,...o){checkHtmlElement(r,queryMatcher,this);let s=a(r,...o);return{message:()=>{let r=this.isNot?`not to`:`to`,a=this.utils.matcherHint(`${this.isNot?`.not`:``}.${i}`,`element`,n,{secondArgument:o[1]===void 0?void 0:this.utils.printExpected(o[1])}),c=[getMessage(this,a,`Expected element ${r} contain ${e.toLowerCase()} descendant by ${n}`,o[0],`Received`,s.length)],l=s.map(e=>(0,t.prettyDOM)(e)).filter(e=>typeof e==`string`);return l.length&&c.push(`Here are the matching elements:`,...l),c.join(`
5
5
 
6
6
  `)},pass:e===`One`?s.length===1:s.length>0}}return Object.defineProperty(queryMatcher,"name",{value:i}),queryMatcher}const m={};for(let e of p){let t=createQueryMatcher(`Any`,e),n=createQueryMatcher(`One`,e);m[t.name]=t,m[n.name]=n}function toBeInTheDocument(e){e===null&&this.isNot||checkHtmlElement(e,toBeInTheDocument,this);let t=e!==null&&e.ownerDocument===e.getRootNode({composed:!0}),errorFound=()=>`expected document not to contain element, found ${this.utils.stringify(e.cloneNode(!0))} instead`,errorNotFound=()=>`element could not be found in the document`;return{pass:t,message:()=>[this.utils.matcherHint(`${this.isNot?`.not`:``}.toBeInTheDocument`,`element`,``),``,this.utils.RECEIVED_COLOR(this.isNot?errorFound():errorNotFound())].join(`
7
7
  `)}}function toBeInTheDOM(e,t){return deprecate(`toBeInTheDOM`,`Please use toBeInTheDocument for searching the entire document and toContainElement for searching a specific container.`),e&&checkHtmlElement(e,toBeInTheDOM,this),t&&checkHtmlElement(t,toBeInTheDOM,this),{pass:t?t.contains(e):!!e,message:()=>[this.utils.matcherHint(`${this.isNot?`.not`:``}.toBeInTheDOM`,`element`,``),``,`Received:`,` ${this.utils.printReceived(e&&e.cloneNode(!1))}`].join(`
@@ -13,7 +13,7 @@ var e=Object.defineProperty,__name=(t,n)=>e(t,`name`,{value:n,configurable:!0}),
13
13
  `)}}function toHaveFocus(e){return checkHtmlElement(e,toHaveFocus,this),{pass:e.ownerDocument.activeElement===e,message:()=>[this.utils.matcherHint(`${this.isNot?`.not`:``}.toHaveFocus`,`element`,``),``,...this.isNot?[`Received element is focused:`,` ${this.utils.printReceived(e)}`]:[`Expected element with focus:`,` ${this.utils.printExpected(e)}`,`Received element with focus:`,` ${this.utils.printReceived(e.ownerDocument.activeElement)}`]].join(`
14
14
  `)}}const h={1:`Node.DOCUMENT_POSITION_DISCONNECTED`,2:`Node.DOCUMENT_POSITION_PRECEDING`,4:`Node.DOCUMENT_POSITION_FOLLOWING`,8:`Node.DOCUMENT_POSITION_CONTAINS`,16:`Node.DOCUMENT_POSITION_CONTAINED_BY`,32:`Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC`};function makeDocumentPositionErrorString(e){return e in h?`${h[e]} (${e})`:`Unknown document position (${e})`}function checkToAppear(e,t,n,r,i){checkHtmlElement(r,toAppearBefore,e),checkHtmlElement(i,toAppearBefore,e);let a=r.compareDocumentPosition(i);return{pass:a===n,message:()=>[e.utils.matcherHint(`${e.isNot?`.not`:``}.${t}`,`element`,`secondElement`),``,`Received: ${makeDocumentPositionErrorString(a)}`].join(`
15
15
  `)}}function toAppearBefore(e,t){return checkToAppear(this,`toAppearBefore`,4,e,t)}function toAppearAfter(e,t){return checkToAppear(this,`toAppearAfter`,2,e,t)}function toHaveTextContent(e,t,n={normalizeWhitespace:!0}){checkNode(e,toHaveTextContent,this);let r=n.normalizeWhitespace?normalize(e.textContent):e.textContent.replace(/ /g,` `),i=r!==``&&t===``;return{pass:!i&&matches(r,t),message:()=>{let e=this.isNot?`not to`:`to`;return getMessage(this,this.utils.matcherHint(`${this.isNot?`.not`:``}.toHaveTextContent`,`element`,``),i?`Checking with empty string will always match, use .toBeEmptyDOMElement() instead`:`Expected element ${e} have text content`,t,`Received`,r)}}}function printAttribute(e,t,n){return n===void 0?t:`${t}=${e(n)}`}function getAttributeComment(e,t,n){return n===void 0?`element.hasAttribute(${e(t)})`:`element.getAttribute(${e(t)}) === ${e(n)}`}function toHaveAttribute(e,t,n){checkHtmlElement(e,toHaveAttribute,this);let r=n!==void 0,i=e.hasAttribute(t),a=e.getAttribute(t);return{pass:r?i&&this.equals(a,n):i,message:()=>{let e=this.isNot?`not to`:`to`,o=i?printAttribute(this.utils.stringify,t,a):null,s=this.utils.matcherHint(`${this.isNot?`.not`:``}.toHaveAttribute`,`element`,this.utils.printExpected(t),{secondArgument:r?this.utils.printExpected(n):void 0,comment:getAttributeComment(this.utils.stringify,t,n)});return getMessage(this,s,`Expected the element ${e} have attribute`,printAttribute(this.utils.stringify,t,n),`Received`,o)}}}function getExpectedClassNamesAndOptions(e){let t=e.pop(),n,r;return typeof t==`object`&&!(t instanceof RegExp)?(n=e,r=t):(n=e.concat(t),r={exact:!1}),{expectedClassNames:n,options:r}}function splitClassNames(e){return e?e.split(/\s+/).filter(e=>e.length>0):[]}function isSubset$1(e,t){return e.every(e=>typeof e==`string`?t.includes(e):t.some(t=>e.test(t)))}__name(isSubset$1,`isSubset`);function toHaveClass(e,...t){checkHtmlElement(e,toHaveClass,this);let{expectedClassNames:n,options:r}=getExpectedClassNamesAndOptions(t),i=splitClassNames(e.getAttribute(`class`)),a=n.reduce((e,t)=>e.concat(typeof t==`string`||!t?splitClassNames(t):t),[]),o=a.some(e=>e instanceof RegExp);if(r.exact&&o)throw Error(`Exact option does not support RegExp expected class names`);return r.exact?{pass:isSubset$1(a,i)&&a.length===i.length,message:()=>{let e=this.isNot?`not to`:`to`;return getMessage(this,this.utils.matcherHint(`${this.isNot?`.not`:``}.toHaveClass`,`element`,this.utils.printExpected(a.join(` `))),`Expected the element ${e} have EXACTLY defined classes`,a.join(` `),`Received`,i.join(` `))}}:a.length>0?{pass:isSubset$1(a,i),message:()=>{let e=this.isNot?`not to`:`to`;return getMessage(this,this.utils.matcherHint(`${this.isNot?`.not`:``}.toHaveClass`,`element`,this.utils.printExpected(a.join(` `))),`Expected the element ${e} have class`,a.join(` `),`Received`,i.join(` `))}}:{pass:this.isNot?i.length>0:!1,message:()=>this.isNot?getMessage(this,this.utils.matcherHint(`.not.toHaveClass`,`element`,``),`Expected the element to have classes`,`(none)`,`Received`,i.join(` `)):[this.utils.matcherHint(`.toHaveClass`,`element`),`At least one expected class must be provided.`].join(`
16
- `)}}function toHaveValue(e,t){if(checkHtmlElement(e,toHaveValue,this),e.tagName.toLowerCase()===`input`&&[`checkbox`,`radio`].includes(e.type))throw Error(`input with type=checkbox or type=radio cannot be used with .toHaveValue(). Use .toBeChecked() for type=checkbox or .toHaveFormValues() instead`);let n=getSingleElementValue(e),r=t!==void 0,i=t,a=n;return t==n&&t!==n&&(i=`${t} (${typeof t})`,a=`${n} (${typeof n})`),{pass:r?compareAsSet(n,t):!!n,message:()=>{let e=this.isNot?`not to`:`to`,n=this.utils.matcherHint(`${this.isNot?`.not`:``}.toHaveValue`,`element`,t);return getMessage(this,n,`Expected the element ${e} have value`,r?i:`(any)`,`Received`,a)}}}function getValues(e,t){if(e!==`select`)return[t.value];let n=[],r=t.options;for(let e=0;e<r.length;e++){let t=r[e];t.selected&&n.push(t.textContent)}return n}function toHaveDisplayValue(e,t){checkHtmlElement(e,toHaveDisplayValue,this);let n=e.tagName.toLowerCase();if(![`select`,`input`,`textarea`].includes(n))throw Error(`.toHaveDisplayValue() currently supports only input, textarea or select elements, try with another matcher instead.`);if(n===`input`&&[`radio`,`checkbox`].includes(e.type))throw Error(`.toHaveDisplayValue() currently does not support input[type="${e.type}"], try with another matcher instead.`);let r=getValues(n,e),i=t instanceof Array?t:[t],a=i.filter(e=>r.some(t=>e instanceof RegExp?e.test(t):this.equals(t,String(e)))).length,o=a===r.length,s=a===i.length;return{pass:o&&s,message:()=>getMessage(this,this.utils.matcherHint(`${this.isNot?`.not`:``}.toHaveDisplayValue`,`element`,``),`Expected element ${this.isNot?`not `:``}to have display value`,t,`Received`,r)}}function getMultiElementValue(e){let t=[...new Set(e.map(e=>e.type))];if(t.length!==1)throw Error(`Multiple form elements with the same name must be of the same type`);switch(t[0]){case`radio`:{let t=e.find(e=>e.checked);return t?t.value:void 0}case`checkbox`:return e.filter(e=>e.checked).map(e=>e.value);default:return e.map(e=>e.value)}}function getFormValue(e,t){let n=[...e.querySelectorAll(`[name="${cssEscape(t)}"]`)];if(n.length!==0)switch(n.length){case 1:return getSingleElementValue(n[0]);default:return getMultiElementValue(n)}}function getPureName(e){return e.endsWith(`[]`)?e.slice(0,-2):e}function getAllFormValues(e){let t={};for(let n of Array.from(e.elements)){let r=n.name;t[getPureName(r)]=getFormValue(e,r)}return t}function toHaveFormValues(e,t){if(checkHtmlElement(e,toHaveFormValues,this),!e.elements)throw Error(`toHaveFormValues must be called on a form or a fieldset`);let n=getAllFormValues(e);return{pass:Object.entries(t).every(([e,t])=>compareAsSet(n[e],t)),message:()=>{let e=this.isNot?`not to`:`to`,r=`${this.isNot?`.not`:``}.toHaveFormValues`,i={};for(let e of Object.keys(n))Object.prototype.hasOwnProperty.call(t,e)&&(i[e]=n[e]);return[this.utils.matcherHint(r,`element`,``),`Expected the element ${e} have form values`,this.utils.diff(t,i)].join(`
16
+ `)}}function toHaveValue(e,t){if(checkHtmlElement(e,toHaveValue,this),e.tagName.toLowerCase()===`input`&&[`checkbox`,`radio`].includes(e.type))throw Error(`input with type=checkbox or type=radio cannot be used with .toHaveValue(). Use .toBeChecked() for type=checkbox or .toHaveFormValues() instead`);let n=getSingleElementValue(e),r=t!==void 0,i=t,a=n;return t==n&&t!==n&&(i=`${t} (${typeof t})`,a=`${n} (${typeof n})`),{pass:r?compareAsSet(n,t):!!n,message:()=>{let e=this.isNot?`not to`:`to`,n=this.utils.matcherHint(`${this.isNot?`.not`:``}.toHaveValue`,`element`,t);return getMessage(this,n,`Expected the element ${e} have value`,r?i:`(any)`,`Received`,a)}}}function getValues(e,t){if(e!==`select`)return[t.value];let n=[],r=t.options;for(let e=0;e<r.length;e++){let t=r[e];t.selected&&n.push(t.textContent)}return n}function toHaveDisplayValue(e,t){checkHtmlElement(e,toHaveDisplayValue,this);let n=e.tagName.toLowerCase();if(![`select`,`input`,`textarea`].includes(n))throw Error(`.toHaveDisplayValue() currently supports only input, textarea or select elements, try with another matcher instead.`);if(n===`input`&&[`radio`,`checkbox`].includes(e.type))throw Error(`.toHaveDisplayValue() currently does not support input[type="${e.type}"], try with another matcher instead.`);let r=getValues(n,e),i=t instanceof Array?t:[t],a=i.filter(e=>r.some(t=>e instanceof RegExp?e.test(t):this.equals(t,String(e)))).length,o=a===r.length,s=a===i.length;return{pass:o&&s,message:()=>getMessage(this,this.utils.matcherHint(`${this.isNot?`.not`:``}.toHaveDisplayValue`,`element`,``),`Expected element ${this.isNot?`not `:``}to have display value`,t,`Received`,r)}}function getMultiElementValue(e){let t=[...new Set(e.map(e=>e.type))];if(t.length!==1)throw Error(`Multiple form elements with the same name must be of the same type`);switch(t[0]){case`radio`:{let t=e.find(e=>e.checked);return t?t.value:void 0}case`checkbox`:return e.filter(e=>e.checked).map(e=>e.value);default:return e.map(e=>e.value)}}function getFormValue(e){if(e!==void 0)switch(e.length){case 1:return getSingleElementValue(e[0]);default:return getMultiElementValue(e)}}function getPureName(e){return e.endsWith(`[]`)?e.slice(0,-2):e}function getAllFormValues(e){let t=/* @__PURE__ */ new Map;for(let n of e.querySelectorAll(`[name]`)){let e=n.getAttribute(`name`),r=t.get(e);r===void 0?t.set(e,[n]):r.push(n)}let n={};for(let r of Array.from(e.elements)){let e=r.name;n[getPureName(e)]=getFormValue(t.get(e))}return n}function toHaveFormValues(e,t){if(checkHtmlElement(e,toHaveFormValues,this),!e.elements)throw Error(`toHaveFormValues must be called on a form or a fieldset`);let n=getAllFormValues(e);return{pass:Object.entries(t).every(([e,t])=>compareAsSet(n[e],t)),message:()=>{let e=this.isNot?`not to`:`to`,r=`${this.isNot?`.not`:``}.toHaveFormValues`,i={};for(let e of Object.keys(n))Object.prototype.hasOwnProperty.call(t,e)&&(i[e]=n[e]);return[this.utils.matcherHint(r,`element`,``),`Expected the element ${e} have form values`,this.utils.diff(t,i)].join(`
17
17
 
18
18
  `)}}}function getSelection(e){let t=e.ownerDocument.getSelection();if([`input`,`textarea`].includes(e.tagName.toLowerCase()))return[`radio`,`checkbox`].includes(e.type)?``:e.value.toString().substring(e.selectionStart,e.selectionEnd);if(t.anchorNode===null||t.focusNode===null)return``;let n=t.getRangeAt(0),r=e.ownerDocument.createRange();if(t.containsNode(e,!1))r.selectNodeContents(e),t.removeAllRanges(),t.addRange(r);else if(!(e.contains(t.anchorNode)&&e.contains(t.focusNode))){let i=e===n.startContainer||e.contains(n.startContainer),a=e===n.endContainer||e.contains(n.endContainer);t.removeAllRanges(),(i||a)&&(r.selectNodeContents(e),i&&r.setStart(n.startContainer,n.startOffset),a&&r.setEnd(n.endContainer,n.endOffset),t.addRange(r))}let i=t.toString();return t.removeAllRanges(),t.addRange(n),i}function toHaveSelection(e,t){checkHtmlElement(e,toHaveSelection,this);let n=t!==void 0;if(n&&typeof t!=`string`)throw Error(`expected selection must be a string or undefined`);let r=getSelection(e);return{pass:n?compareAsSet(r,t):!!r,message:()=>{let e=this.isNot?`not to`:`to`,i=this.utils.matcherHint(`${this.isNot?`.not`:``}.toHaveSelection`,`element`,t);return getMessage(this,i,`Expected the element ${e} have selection`,n?t:`(any)`,`Received`,r)}}}let g=null;function foreign(){return g??=(0,n.createRequire)(require("url").pathToFileURL(__filename).href)(`dom-accessibility-api`)}function computeAccessibleName(e){return e[i.$impl]===void 0?foreign().computeAccessibleName(e):r.daa06.computeAccessibleName(e)}function computeAccessibleDescription(e){return e[i.$impl]===void 0?foreign().computeAccessibleDescription(e):r.daa06.computeAccessibleDescription(e)}const _=[[`input`,[[`list`,`+`],[`type`,`=email`]],!1,[`combobox`]],[`input`,[[`list`,`+`],[`type`,`=search`]],!1,[`combobox`]],[`input`,[[`list`,`+`],[`type`,`=tel`]],!1,[`combobox`]],[`input`,[[`list`,`+`]],!0,[`combobox`]],[`input`,[[`list`,`+`],[`type`,`=url`]],!1,[`combobox`]],[`select`,[[`multiple`,`-`],[`size`,`-`]],!1,[`combobox`]],[`input`,[[`list`,`-`],[`type`,`=search`]],!1,[`searchbox`]],[`input`,[[`type`,`-`],[`list`,`-`]],!1,[`textbox`]],[`input`,[[`list`,`-`],[`type`,`=email`]],!1,[`textbox`]],[`input`,[[`list`,`-`],[`type`,`=tel`]],!1,[`textbox`]],[`input`,[[`list`,`-`]],!0,[`textbox`]],[`input`,[[`list`,`-`],[`type`,`=url`]],!1,[`textbox`]],[`input`,[[`type`,`=button`]],!1,[`button`]],[`input`,[[`type`,`=image`]],!1,[`button`]],[`input`,[[`type`,`=reset`]],!1,[`button`]],[`input`,[[`type`,`=submit`]],!1,[`button`]],[`input`,[[`type`,`=checkbox`]],!1,[`checkbox`]],[`th`,[[`scope`,`=col`]],!1,[`columnheader`]],[`th`,[[`scope`,`=colgroup`]],!1,[`columnheader`]],[`aside`,[[`aria-label`,`+`]],!1,[`complementary`]],[`aside`,[[`aria-labelledby`,`+`]],!1,[`complementary`]],[`form`,[[`aria-label`,`+`]],!1,[`form`]],[`form`,[[`aria-labelledby`,`+`]],!1,[`form`]],[`form`,[[`name`,`+`]],!1,[`form`]],[`img`,[[`alt`,`+`]],!1,[`img`]],[`img`,[[`alt`,`-`]],!1,[`img`]],[`a`,[[`href`,`+`]],!1,[`link`]],[`area`,[[`href`,`+`]],!1,[`link`]],[`select`,[[`size`,`+`]],!1,[`listbox`]],[`select`,[[`multiple`,`+`]],!1,[`listbox`]],[`img`,[[`alt`,`+`]],!1,[`presentation`]],[`input`,[[`type`,`=radio`]],!1,[`radio`]],[`section`,[[`aria-label`,`+`]],!1,[`region`]],[`section`,[[`aria-labelledby`,`+`]],!1,[`region`]],[`th`,[[`scope`,`=row`]],!1,[`rowheader`]],[`th`,[[`scope`,`=rowgroup`]],!1,[`rowheader`]],[`input`,[[`type`,`=range`]],!1,[`slider`]],[`input`,[[`type`,`=number`]],!1,[`spinbutton`]],[`article`,[],!1,[`article`]],[`header`,[],!1,[`banner`]],[`blockquote`,[],!1,[`blockquote`]],[`button`,[],!1,[`button`]],[`caption`,[],!1,[`caption`]],[`td`,[],!1,[`cell`]],[`code`,[],!1,[`code`]],[`th`,[],!1,[`columnheader`]],[`aside`,[],!1,[`complementary`]],[`footer`,[],!1,[`contentinfo`]],[`dd`,[],!1,[`definition`]],[`del`,[],!1,[`deletion`]],[`dialog`,[],!1,[`dialog`]],[`html`,[],!1,[`document`]],[`em`,[],!1,[`emphasis`]],[`figure`,[],!1,[`figure`]],[`a`,[],!1,[`generic`]],[`area`,[],!1,[`generic`]],[`aside`,[],!1,[`generic`]],[`b`,[],!1,[`generic`]],[`bdo`,[],!1,[`generic`]],[`body`,[],!1,[`generic`]],[`data`,[],!1,[`generic`]],[`div`,[],!1,[`generic`]],[`footer`,[],!1,[`generic`]],[`header`,[],!1,[`generic`]],[`hgroup`,[],!1,[`generic`]],[`i`,[],!1,[`generic`]],[`pre`,[],!1,[`generic`]],[`q`,[],!1,[`generic`]],[`samp`,[],!1,[`generic`]],[`section`,[],!1,[`generic`]],[`small`,[],!1,[`generic`]],[`span`,[],!1,[`generic`]],[`u`,[],!1,[`generic`]],[`td`,[],!1,[`gridcell`]],[`details`,[],!1,[`group`]],[`fieldset`,[],!1,[`group`]],[`optgroup`,[],!1,[`group`]],[`address`,[],!1,[`group`]],[`h1`,[],!1,[`heading`]],[`h2`,[],!1,[`heading`]],[`h3`,[],!1,[`heading`]],[`h4`,[],!1,[`heading`]],[`h5`,[],!1,[`heading`]],[`h6`,[],!1,[`heading`]],[`ins`,[],!1,[`insertion`]],[`menu`,[],!1,[`list`]],[`ol`,[],!1,[`list`]],[`ul`,[],!1,[`list`]],[`datalist`,[],!1,[`listbox`]],[`li`,[],!1,[`listitem`]],[`main`,[],!1,[`main`]],[`mark`,[],!1,[`mark`]],[`math`,[],!1,[`math`]],[`meter`,[],!1,[`meter`]],[`nav`,[],!1,[`navigation`]],[`option`,[],!1,[`option`]],[`p`,[],!1,[`paragraph`]],[`progress`,[],!1,[`progressbar`]],[`tr`,[],!1,[`row`]],[`tbody`,[],!1,[`rowgroup`]],[`tfoot`,[],!1,[`rowgroup`]],[`thead`,[],!1,[`rowgroup`]],[`hr`,[],!1,[`separator`]],[`output`,[],!1,[`status`]],[`strong`,[],!1,[`strong`]],[`sub`,[],!1,[`subscript`]],[`sup`,[],!1,[`superscript`]],[`table`,[],!1,[`table`]],[`dfn`,[],!1,[`term`]],[`dt`,[],!1,[`term`]],[`textarea`,[],!1,[`textbox`]],[`time`,[],!1,[`time`]]];function valueEquals(e,t,n,r){return n===r||(t===`type`||t===`scope`)&&e.namespaceURI===`http://www.w3.org/1999/xhtml`&&n.toLowerCase()===r}function getImplicitAriaRoles(e){let t=e.localName;for(let n=0;n<_.length;n++){let[r,i,a,o]=_[n];if(r!==t||a&&e.type!==`text`)continue;let s=!0;for(let t=0;t<i.length&&s;t++){let[n,r]=i[t],a=e.getAttribute(n);s=r===`-`?a===null:r===`+`?a!==null:a!==null&&valueEquals(e,n,a,r.slice(1))}if(s)return[...o]}return[]}function getExplicitOrImplicitRoles(e){let t=e.getAttribute(`role`);return t===null?e[i.$impl]===void 0?getImplicitAriaRoles(e):(0,r.getImplicitAriaRolesJestDom)(e):t.split(` `).filter(Boolean)}function toHaveRole(e,t){checkHtmlElement(e,toHaveRole,this);let n=getExplicitOrImplicitRoles(e);return{pass:n.some(e=>e===t),message:()=>{let e=this.isNot?`not to`:`to`;return getMessage(this,this.utils.matcherHint(`${this.isNot?`.not`:``}.${toHaveRole.name}`,`element`,``),`Expected element ${e} have role`,t,`Received`,n.join(`, `))}}}function toHaveAccessibleName(e,t){checkHtmlElement(e,toHaveAccessibleName,this);let n=computeAccessibleName(e),r=arguments.length===1,i=!1;return i=r?n!==``:t instanceof RegExp?t.test(n):this.equals(n,t),{pass:i,message:()=>{let e=this.isNot?`not to`:`to`;return getMessage(this,this.utils.matcherHint(`${this.isNot?`.not`:``}.${toHaveAccessibleName.name}`,`element`,``),`Expected element ${e} have accessible name`,t,`Received`,n)}}}function toHaveAccessibleDescription(e,t){checkHtmlElement(e,toHaveAccessibleDescription,this);let n=computeAccessibleDescription(e),r=arguments.length===1,i=!1;return i=r?n!==``:t instanceof RegExp?t.test(n):this.equals(n,t),{pass:i,message:()=>{let e=this.isNot?`not to`:`to`;return getMessage(this,this.utils.matcherHint(`${this.isNot?`.not`:``}.${toHaveAccessibleDescription.name}`,`element`,``),`Expected element ${e} have accessible description`,t,`Received`,n)}}}const v=`aria-invalid`,y=[`false`];function toHaveAccessibleErrorMessage(e,t){checkHtmlElement(e,toHaveAccessibleErrorMessage,this);let n=this.isNot?`not to`:`to`,r=this.isNot?`.not.toHaveAccessibleErrorMessage`:`.toHaveAccessibleErrorMessage`,i=e.getAttribute(`aria-errormessage`);if(i&&/\s+/.test(i))return{pass:!1,message:()=>getMessage(this,this.utils.matcherHint(r,`element`),"Expected element's `aria-errormessage` attribute to be empty or a single, valid ID",``,`Received`,`aria-errormessage="${i}"`)};let a=e.getAttribute(v);if(!e.hasAttribute(v)||y.includes(a))return{pass:!1,message:()=>getMessage(this,this.utils.matcherHint(r,`element`),`Expected element to be marked as invalid with attribute`,`${v}="true"`,`Received`,e.hasAttribute(`aria-invalid`)?`${v}="${e.getAttribute(v)}`:null)};let o=normalize(e.ownerDocument.getElementById(i)?.textContent??``);return{pass:t===void 0?!!o:t instanceof RegExp?t.test(o):this.equals(o,t),message:()=>getMessage(this,this.utils.matcherHint(r,`element`),`Expected element ${n} have accessible error message`,t??``,`Received`,o)}}function textOfIdRefs(e,t){let n=(e.getAttribute(t)||``).split(/\s+/).filter(Boolean);if(n.length===0)return``;let r=e.ownerDocument;return normalize(n.map(e=>r.getElementById(e)).filter(Boolean).map(e=>e.textContent).join(` `))}function toHaveDescription(e,t){deprecate(`toHaveDescription`,`Please use toHaveAccessibleDescription.`),checkHtmlElement(e,toHaveDescription,this);let n=t!==void 0,r=textOfIdRefs(e,`aria-describedby`);return{pass:n?t instanceof RegExp?t.test(r):this.equals(r,t):!!r,message:()=>{let e=this.isNot?`not to`:`to`;return getMessage(this,this.utils.matcherHint(`${this.isNot?`.not`:``}.toHaveDescription`,`element`,``),`Expected the element ${e} have description`,this.utils.printExpected(t),`Received`,this.utils.printReceived(r))}}}function toHaveErrorMessage(e,t){if(deprecate(`toHaveErrorMessage`,`Please use toHaveAccessibleErrorMessage.`),checkHtmlElement(e,toHaveErrorMessage,this),!e.hasAttribute(`aria-invalid`)||e.getAttribute(`aria-invalid`)===`false`){let t=this.isNot?`.not`:``;return{pass:!1,message:()=>getMessage(this,this.utils.matcherHint(`${t}.toHaveErrorMessage`,`element`,``),`Expected the element to have invalid state indicated by`,`aria-invalid="true"`,`Received`,e.hasAttribute(`aria-invalid`)?`aria-invalid="${e.getAttribute(`aria-invalid`)}"`:this.utils.printReceived(``))}}let n=t!==void 0,r=textOfIdRefs(e,`aria-errormessage`);return{pass:n?t instanceof RegExp?t.test(r):this.equals(r,t):!!r,message:()=>{let e=this.isNot?`not to`:`to`;return getMessage(this,this.utils.matcherHint(`${this.isNot?`.not`:``}.toHaveErrorMessage`,`element`,``),`Expected the element ${e} have error message`,this.utils.printExpected(t),`Received`,this.utils.printReceived(r))}}}const b={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},x=/^([+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?)(%|deg|grad|rad|turn)?$/i;function channel(e,t){if(e.toLowerCase()===`none`)return 0;let n=x.exec(e);if(n===null)return null;let r=Number(n[1]);return n[2]===void 0?r:n[2]===`%`?r/100*t:null}function hue(e){let t=x.exec(e);if(t===null)return e.toLowerCase()===`none`?0:null;let n=Number(t[1]);switch(t[2]?.toLowerCase()){case void 0:case`deg`:return n;case`grad`:return n*360/400;case`rad`:return n*180/Math.PI;case`turn`:return n*360;default:return null}}function args(e){let t=e.trim();if(t.includes(`,`)){let e=t.split(`,`).map(e=>e.trim());return e.some(e=>e===``||/\s/.test(e))?null:e}let n=t.indexOf(`/`),r=(n===-1?t:t.slice(0,n)).trim().split(/\s+/);return n!==-1&&r.push(t.slice(n+1).trim()),r}const clamp=(e,t,n)=>Math.min(n,Math.max(t,e));function hslToRgb(e,t,n){e=(e%360+360)%360,t=clamp(t,0,1),n=clamp(n,0,1);let f=r=>{let i=(r+e/30)%12,a=t*Math.min(n,1-n);return(n-a*Math.max(-1,Math.min(i-3,9-i,1)))*255};return[f(0),f(8),f(4)]}function key(e,t,n,r){return`${Math.round(clamp(e,0,255))},${Math.round(clamp(t,0,255))},${Math.round(clamp(n,0,255))},${Math.round(clamp(r,0,1)*1e3)}`}function canonicalColor(e){if(typeof e!=`string`)return null;let t=e.trim().toLowerCase();if(t===``)return null;if(t===`transparent`)return key(0,0,0,0);if(t.charCodeAt(0)===35){let e=t.slice(1);if(!/^[0-9a-f]+$/.test(e))return null;let n=e.length,d=(t,n)=>parseInt(e.slice(t,t+n),16)*(n===1?17:1);return n===3||n===4?key(d(0,1),d(1,1),d(2,1),n===4?d(3,1)/255:1):n===6||n===8?key(d(0,2),d(2,2),d(4,2),n===8?d(6,2)/255:1):null}let n=t.indexOf(`(`);if(n===-1){let e=b[t];return e===void 0?null:key(e>>16,e>>8&255,e&255,1)}if(!t.endsWith(`)`))return null;let r=t.slice(0,n),i=args(t.slice(n+1,-1));if(i===null||i.length!==3&&i.length!==4)return null;let a=i.length===4?channel(i[3],1):1;if(a===null)return null;if(r===`rgb`||r===`rgba`){let e=channel(i[0],255),t=channel(i[1],255),n=channel(i[2],255);return e===null||t===null||n===null?null:key(e,t,n,a)}if(r===`hsl`||r===`hsla`){let e=hue(i[0]),t=channel(i[1],1),n=channel(i[2],1);if(e===null||t===null||n===null)return null;let[r,o,s]=hslToRgb(e,i[1].endsWith(`%`)?t:t/100,i[2].endsWith(`%`)?n:n/100);return key(r,o,s,a)}return null}function sameColor(e,t){let n=canonicalColor(e);return n!==null&&n===canonicalColor(t)}function isStyleVisible(e){let{getComputedStyle:t}=e.ownerDocument.defaultView,{display:n,visibility:r,opacity:i}=t(e);return n!==`none`&&r!==`hidden`&&r!==`collapse`&&i!==`0`&&i!==0}function isAttributeVisible(e,t){let n;return n=t?e.nodeName===`DETAILS`&&t.nodeName!==`SUMMARY`?e.hasAttribute(`open`):!0:e.nodeName!==`DETAILS`||e.hasAttribute(`open`),!e.hasAttribute(`hidden`)&&n}function isElementVisible(e,t){return isStyleVisible(e)&&isAttributeVisible(e,t)&&(!e.parentElement||isElementVisible(e.parentElement,e))}function toBeVisible(e){checkHtmlElement(e,toBeVisible,this);let t=e.ownerDocument===e.getRootNode({composed:!0}),n=t&&isElementVisible(e);return{pass:n,message:()=>{let r=n?`is`:`is not`;return[this.utils.matcherHint(`${this.isNot?`.not`:``}.toBeVisible`,`element`,``),``,`Received element ${r} visible${t?``:` (element is not in the document)`}:`,` ${this.utils.printReceived(e.cloneNode(!1))}`].join(`
19
19
  `)}}}function getStyleDeclaration(e,t){let n={},r=e.createElement(`div`);for(let e of Object.keys(t))r.style[e]=t[e],n[e]=r.style[e];return n}function valueMatches(e,t){return e===t||sameColor(t,e)}function isSubset(e,t){let n=Object.entries(e);if(n.length===0)return!1;for(let[e,r]of n){let n=e.startsWith(`--`);if(!(valueMatches(t[e],r)||valueMatches(t.getPropertyValue(e),r))){if(!n){let n=e.toLowerCase();if(valueMatches(t[n],r)||valueMatches(t.getPropertyValue(n),r))continue}return!1}}return!0}function printoutStyles(e){return Object.keys(e).sort().map(t=>`${t}: ${e[t]};`).join(`
@@ -1,7 +1,7 @@
1
1
  import{createRequire as e}from"node:module";import{prettyDOM as t,queries as n}from"@ctrl/dom/testing-library";import{daa06 as r,getImplicitAriaRolesJestDom as i,roles as a}from"@ctrl/dom/aria";import{$impl as o}from"@ctrl/dom/internal";import{AriaTemplateError as s,matchAriaSnapshot as c}from"@ctrl/dom/testing-library/agent";var l=Object.defineProperty,__name=(e,t)=>l(e,`name`,{value:t,configurable:!0}),__exportAll=(e,t)=>{let n={};for(var r in e)l(n,r,{get:e[r],enumerable:!0});return t||l(n,Symbol.toStringTag,{value:`Module`}),n},GenericTypeError=class extends Error{constructor(e,t,n,r){super(),Error.captureStackTrace&&Error.captureStackTrace(this,n);let i=``;try{i=r.utils.printWithType(`Received`,t,r.utils.printReceived)}catch{}this.message=[r.utils.matcherHint(`${r.isNot?`.not`:``}.${n.name}`,`received`,``),``,`${r.utils.RECEIVED_COLOR(`received`)} value must ${e}.`,i].join(`
2
2
  `)}},HtmlElementTypeError=class extends GenericTypeError{constructor(e,t,n){super(`be an HTMLElement or an SVGElement`,e,t,n)}},NodeTypeError=class extends GenericTypeError{constructor(e,t,n){super(`be a Node`,e,t,n)}};function checkHasWindow(e,t,n,r){if(!e||!e.ownerDocument||!e.ownerDocument.defaultView)throw new t(e,n,r)}function checkNode(e,t,n){if(checkHasWindow(e,NodeTypeError,t,n),!(e instanceof e.ownerDocument.defaultView.Node))throw new NodeTypeError(e,t,n)}function checkHtmlElement(e,t,n){checkHasWindow(e,HtmlElementTypeError,t,n);let r=e.ownerDocument.defaultView;if(!(e instanceof r.HTMLElement)&&!(e instanceof r.SVGElement))throw new HtmlElementTypeError(e,t,n)}var InvalidCSSError=class extends Error{constructor(e,t,n){super(),Error.captureStackTrace&&Error.captureStackTrace(this,t),this.message=[e.message,``,n.utils.RECEIVED_COLOR(`Failing css:`),n.utils.RECEIVED_COLOR(`${e.css}`)].join(`
3
3
  `)}};let u=null;function parseCSS(t,n,r){u??=e(import.meta.url)(`@adobe/css-tools`).parse;let i=u(`selector { ${t} }`,{silent:!0}).stylesheet;if(i.parsingErrors&&i.parsingErrors.length>0){let{reason:e,line:a}=i.parsingErrors[0];throw new InvalidCSSError({css:t,message:`Syntax error parsing expected css: ${e} on line: ${a}`},n,r)}let a={},o=i.rules[0].declarations;for(let e=0;e<o.length;e++){let t=o[e];t.type===`declaration`&&(a[t.property]=t.value)}return a}function display(e,t){return typeof t==`string`?t:e.utils.stringify(t)}function getMessage(e,t,n,r,i,a){return[`${t}\n`,`${n}:\n${e.utils.EXPECTED_COLOR(redent(display(e,r),2))}`,`${i}:\n${e.utils.RECEIVED_COLOR(redent(display(e,a),2))}`].join(`
4
- `)}function matches(e,t){return t instanceof RegExp?t.test(e):e.includes(String(t))}function deprecate(e,t){console.warn(`Warning: ${e} has been deprecated and will be removed in future updates.`,t)}function normalize(e){return e.replace(/\s+/g,` `).trim()}function getTag(e){return e.tagName&&e.tagName.toLowerCase()}function getSelectValue({multiple:e,options:t}){let n=[];for(let e=0;e<t.length;e++)t[e].selected&&n.push(t[e]);if(e)return n.map(e=>e.value);if(n.length!==0)return n[0].value}function getInputValue(e){switch(e.type){case`number`:return e.value===``?null:Number(e.value);case`checkbox`:return e.checked;default:return e.value}}const p=[`meter`,`progressbar`,`slider`,`spinbutton`];function getAccessibleValue(e){if(p.includes(e.getAttribute(`role`)))return Number(e.getAttribute(`aria-valuenow`))}function getSingleElementValue(e){if(e)switch(e.tagName.toLowerCase()){case`input`:return getInputValue(e);case`select`:return getSelectValue(e);default:return e.value??getAccessibleValue(e)}}function toSentence(e,{wordConnector:t=`, `,lastWordConnector:n=` and `}={}){return[e.slice(0,-1).join(t),e[e.length-1]].join(e.length>1?n:``)}function compareAsSet(e,t){if(Array.isArray(e)&&Array.isArray(t)){let n=new Set(t);return[...new Set(e)].every(e=>n.has(e))}return e===t}function redent(e,t){let n=e.match(/^[ \t]*(?=\S)/gm),r=0;n&&(r=n.reduce((e,t)=>Math.min(e,t.length),1/0));let i=r>0?e.replace(RegExp(`^[ \\t]{${r}}`,`gm`),``):e;return t===0?i:i.replace(/^(?!\s*$)/gm,` `.repeat(t))}function cssEscape(e){let t=String(e),n=t.length,r=-1,i=``,a=t.charCodeAt(0);for(;++r<n;){let e=t.charCodeAt(r);i+=e===0?`�`:e>=1&&e<=31||e===127||r===0&&e>=48&&e<=57||r===1&&e>=48&&e<=57&&a===45?`\\`+e.toString(16)+` `:r===0&&n===1&&e===45?`\\`+t.charAt(r):e>=128||e===45||e===95||e>=48&&e<=57||e>=65&&e<=90||e>=97&&e<=122?t.charAt(r):`\\`+t.charAt(r)}return i}const m=process.env,h=process.argv,g=!(m.NO_COLOR||h.includes(`--no-color`))&&(!!m.FORCE_COLOR||h.includes(`--color`)||process.platform===`win32`||process.stdout?.isTTY&&m.TERM!==`dumb`||!!m.CI);function picoRed(e){if(!g)return String(e);let t=`\x1B[31m`,n=`\x1B[39m`,r=``+e,i=r.indexOf(n,5);if(i===-1)return t+r+n;let a=``,o=0;do a+=r.substring(o,i)+t,o=i+5,i=r.indexOf(n,o);while(i!==-1);return t+a+r.substring(o)+n}const _=[`alt text`,`display value`,`label text`,`placeholder text`,`role`,`test ID`,`text`,`title`];function toPascalCase(e){return e.split(` `).map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(``)}function createQueryMatcher(e,r){let i=toPascalCase(r),a=`toContain${e}By${i}`,o=n[`queryAllBy${i}`];function queryMatcher(n,...i){checkHtmlElement(n,queryMatcher,this);let s=o(n,...i);return{message:()=>{let n=this.isNot?`not to`:`to`,o=this.utils.matcherHint(`${this.isNot?`.not`:``}.${a}`,`element`,r,{secondArgument:i[1]===void 0?void 0:this.utils.printExpected(i[1])}),c=[getMessage(this,o,`Expected element ${n} contain ${e.toLowerCase()} descendant by ${r}`,i[0],`Received`,s.length)],l=s.map(e=>t(e)).filter(e=>typeof e==`string`);return l.length&&c.push(`Here are the matching elements:`,...l),c.join(`
4
+ `)}function matches(e,t){return t instanceof RegExp?t.test(e):e.includes(String(t))}function deprecate(e,t){console.warn(`Warning: ${e} has been deprecated and will be removed in future updates.`,t)}function normalize(e){return e.replace(/\s+/g,` `).trim()}function getTag(e){return e.tagName&&e.tagName.toLowerCase()}function getSelectValue({multiple:e,options:t}){let n=[];for(let e=0;e<t.length;e++)t[e].selected&&n.push(t[e]);if(e)return n.map(e=>e.value);if(n.length!==0)return n[0].value}function getInputValue(e){switch(e.type){case`number`:return e.value===``?null:Number(e.value);case`checkbox`:return e.checked;default:return e.value}}const p=[`meter`,`progressbar`,`slider`,`spinbutton`];function getAccessibleValue(e){if(p.includes(e.getAttribute(`role`)))return Number(e.getAttribute(`aria-valuenow`))}function getSingleElementValue(e){if(e)switch(e.tagName.toLowerCase()){case`input`:return getInputValue(e);case`select`:return getSelectValue(e);default:return e.value??getAccessibleValue(e)}}function toSentence(e,{wordConnector:t=`, `,lastWordConnector:n=` and `}={}){return[e.slice(0,-1).join(t),e[e.length-1]].join(e.length>1?n:``)}function compareAsSet(e,t){if(Array.isArray(e)&&Array.isArray(t)){let n=new Set(t);return[...new Set(e)].every(e=>n.has(e))}return e===t}function redent(e,t){let n=e.match(/^[ \t]*(?=\S)/gm),r=0;n&&(r=n.reduce((e,t)=>Math.min(e,t.length),1/0));let i=r>0?e.replace(RegExp(`^[ \\t]{${r}}`,`gm`),``):e;return t===0?i:i.replace(/^(?!\s*$)/gm,` `.repeat(t))}const m=process.env,h=process.argv,g=!(m.NO_COLOR||h.includes(`--no-color`))&&(!!m.FORCE_COLOR||h.includes(`--color`)||process.platform===`win32`||process.stdout?.isTTY&&m.TERM!==`dumb`||!!m.CI);function picoRed(e){if(!g)return String(e);let t=`\x1B[31m`,n=`\x1B[39m`,r=``+e,i=r.indexOf(n,5);if(i===-1)return t+r+n;let a=``,o=0;do a+=r.substring(o,i)+t,o=i+5,i=r.indexOf(n,o);while(i!==-1);return t+a+r.substring(o)+n}const _=[`alt text`,`display value`,`label text`,`placeholder text`,`role`,`test ID`,`text`,`title`];function toPascalCase(e){return e.split(` `).map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(``)}function createQueryMatcher(e,r){let i=toPascalCase(r),a=`toContain${e}By${i}`,o=n[`queryAllBy${i}`];function queryMatcher(n,...i){checkHtmlElement(n,queryMatcher,this);let s=o(n,...i);return{message:()=>{let n=this.isNot?`not to`:`to`,o=this.utils.matcherHint(`${this.isNot?`.not`:``}.${a}`,`element`,r,{secondArgument:i[1]===void 0?void 0:this.utils.printExpected(i[1])}),c=[getMessage(this,o,`Expected element ${n} contain ${e.toLowerCase()} descendant by ${r}`,i[0],`Received`,s.length)],l=s.map(e=>t(e)).filter(e=>typeof e==`string`);return l.length&&c.push(`Here are the matching elements:`,...l),c.join(`
5
5
 
6
6
  `)},pass:e===`One`?s.length===1:s.length>0}}return Object.defineProperty(queryMatcher,"name",{value:a}),queryMatcher}const v={};for(let e of _){let t=createQueryMatcher(`Any`,e),n=createQueryMatcher(`One`,e);v[t.name]=t,v[n.name]=n}function toBeInTheDocument(e){e===null&&this.isNot||checkHtmlElement(e,toBeInTheDocument,this);let t=e!==null&&e.ownerDocument===e.getRootNode({composed:!0}),errorFound=()=>`expected document not to contain element, found ${this.utils.stringify(e.cloneNode(!0))} instead`,errorNotFound=()=>`element could not be found in the document`;return{pass:t,message:()=>[this.utils.matcherHint(`${this.isNot?`.not`:``}.toBeInTheDocument`,`element`,``),``,this.utils.RECEIVED_COLOR(this.isNot?errorFound():errorNotFound())].join(`
7
7
  `)}}function toBeInTheDOM(e,t){return deprecate(`toBeInTheDOM`,`Please use toBeInTheDocument for searching the entire document and toContainElement for searching a specific container.`),e&&checkHtmlElement(e,toBeInTheDOM,this),t&&checkHtmlElement(t,toBeInTheDOM,this),{pass:t?t.contains(e):!!e,message:()=>[this.utils.matcherHint(`${this.isNot?`.not`:``}.toBeInTheDOM`,`element`,``),``,`Received:`,` ${this.utils.printReceived(e&&e.cloneNode(!1))}`].join(`
@@ -13,7 +13,7 @@ import{createRequire as e}from"node:module";import{prettyDOM as t,queries as n}f
13
13
  `)}}function toHaveFocus(e){return checkHtmlElement(e,toHaveFocus,this),{pass:e.ownerDocument.activeElement===e,message:()=>[this.utils.matcherHint(`${this.isNot?`.not`:``}.toHaveFocus`,`element`,``),``,...this.isNot?[`Received element is focused:`,` ${this.utils.printReceived(e)}`]:[`Expected element with focus:`,` ${this.utils.printExpected(e)}`,`Received element with focus:`,` ${this.utils.printReceived(e.ownerDocument.activeElement)}`]].join(`
14
14
  `)}}const y={1:`Node.DOCUMENT_POSITION_DISCONNECTED`,2:`Node.DOCUMENT_POSITION_PRECEDING`,4:`Node.DOCUMENT_POSITION_FOLLOWING`,8:`Node.DOCUMENT_POSITION_CONTAINS`,16:`Node.DOCUMENT_POSITION_CONTAINED_BY`,32:`Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC`};function makeDocumentPositionErrorString(e){return e in y?`${y[e]} (${e})`:`Unknown document position (${e})`}function checkToAppear(e,t,n,r,i){checkHtmlElement(r,toAppearBefore,e),checkHtmlElement(i,toAppearBefore,e);let a=r.compareDocumentPosition(i);return{pass:a===n,message:()=>[e.utils.matcherHint(`${e.isNot?`.not`:``}.${t}`,`element`,`secondElement`),``,`Received: ${makeDocumentPositionErrorString(a)}`].join(`
15
15
  `)}}function toAppearBefore(e,t){return checkToAppear(this,`toAppearBefore`,4,e,t)}function toAppearAfter(e,t){return checkToAppear(this,`toAppearAfter`,2,e,t)}function toHaveTextContent(e,t,n={normalizeWhitespace:!0}){checkNode(e,toHaveTextContent,this);let r=n.normalizeWhitespace?normalize(e.textContent):e.textContent.replace(/ /g,` `),i=r!==``&&t===``;return{pass:!i&&matches(r,t),message:()=>{let e=this.isNot?`not to`:`to`;return getMessage(this,this.utils.matcherHint(`${this.isNot?`.not`:``}.toHaveTextContent`,`element`,``),i?`Checking with empty string will always match, use .toBeEmptyDOMElement() instead`:`Expected element ${e} have text content`,t,`Received`,r)}}}function printAttribute(e,t,n){return n===void 0?t:`${t}=${e(n)}`}function getAttributeComment(e,t,n){return n===void 0?`element.hasAttribute(${e(t)})`:`element.getAttribute(${e(t)}) === ${e(n)}`}function toHaveAttribute(e,t,n){checkHtmlElement(e,toHaveAttribute,this);let r=n!==void 0,i=e.hasAttribute(t),a=e.getAttribute(t);return{pass:r?i&&this.equals(a,n):i,message:()=>{let e=this.isNot?`not to`:`to`,o=i?printAttribute(this.utils.stringify,t,a):null,s=this.utils.matcherHint(`${this.isNot?`.not`:``}.toHaveAttribute`,`element`,this.utils.printExpected(t),{secondArgument:r?this.utils.printExpected(n):void 0,comment:getAttributeComment(this.utils.stringify,t,n)});return getMessage(this,s,`Expected the element ${e} have attribute`,printAttribute(this.utils.stringify,t,n),`Received`,o)}}}function getExpectedClassNamesAndOptions(e){let t=e.pop(),n,r;return typeof t==`object`&&!(t instanceof RegExp)?(n=e,r=t):(n=e.concat(t),r={exact:!1}),{expectedClassNames:n,options:r}}function splitClassNames(e){return e?e.split(/\s+/).filter(e=>e.length>0):[]}function isSubset$1(e,t){return e.every(e=>typeof e==`string`?t.includes(e):t.some(t=>e.test(t)))}__name(isSubset$1,`isSubset`);function toHaveClass(e,...t){checkHtmlElement(e,toHaveClass,this);let{expectedClassNames:n,options:r}=getExpectedClassNamesAndOptions(t),i=splitClassNames(e.getAttribute(`class`)),a=n.reduce((e,t)=>e.concat(typeof t==`string`||!t?splitClassNames(t):t),[]),o=a.some(e=>e instanceof RegExp);if(r.exact&&o)throw Error(`Exact option does not support RegExp expected class names`);return r.exact?{pass:isSubset$1(a,i)&&a.length===i.length,message:()=>{let e=this.isNot?`not to`:`to`;return getMessage(this,this.utils.matcherHint(`${this.isNot?`.not`:``}.toHaveClass`,`element`,this.utils.printExpected(a.join(` `))),`Expected the element ${e} have EXACTLY defined classes`,a.join(` `),`Received`,i.join(` `))}}:a.length>0?{pass:isSubset$1(a,i),message:()=>{let e=this.isNot?`not to`:`to`;return getMessage(this,this.utils.matcherHint(`${this.isNot?`.not`:``}.toHaveClass`,`element`,this.utils.printExpected(a.join(` `))),`Expected the element ${e} have class`,a.join(` `),`Received`,i.join(` `))}}:{pass:this.isNot?i.length>0:!1,message:()=>this.isNot?getMessage(this,this.utils.matcherHint(`.not.toHaveClass`,`element`,``),`Expected the element to have classes`,`(none)`,`Received`,i.join(` `)):[this.utils.matcherHint(`.toHaveClass`,`element`),`At least one expected class must be provided.`].join(`
16
- `)}}function toHaveValue(e,t){if(checkHtmlElement(e,toHaveValue,this),e.tagName.toLowerCase()===`input`&&[`checkbox`,`radio`].includes(e.type))throw Error(`input with type=checkbox or type=radio cannot be used with .toHaveValue(). Use .toBeChecked() for type=checkbox or .toHaveFormValues() instead`);let n=getSingleElementValue(e),r=t!==void 0,i=t,a=n;return t==n&&t!==n&&(i=`${t} (${typeof t})`,a=`${n} (${typeof n})`),{pass:r?compareAsSet(n,t):!!n,message:()=>{let e=this.isNot?`not to`:`to`,n=this.utils.matcherHint(`${this.isNot?`.not`:``}.toHaveValue`,`element`,t);return getMessage(this,n,`Expected the element ${e} have value`,r?i:`(any)`,`Received`,a)}}}function getValues(e,t){if(e!==`select`)return[t.value];let n=[],r=t.options;for(let e=0;e<r.length;e++){let t=r[e];t.selected&&n.push(t.textContent)}return n}function toHaveDisplayValue(e,t){checkHtmlElement(e,toHaveDisplayValue,this);let n=e.tagName.toLowerCase();if(![`select`,`input`,`textarea`].includes(n))throw Error(`.toHaveDisplayValue() currently supports only input, textarea or select elements, try with another matcher instead.`);if(n===`input`&&[`radio`,`checkbox`].includes(e.type))throw Error(`.toHaveDisplayValue() currently does not support input[type="${e.type}"], try with another matcher instead.`);let r=getValues(n,e),i=t instanceof Array?t:[t],a=i.filter(e=>r.some(t=>e instanceof RegExp?e.test(t):this.equals(t,String(e)))).length,o=a===r.length,s=a===i.length;return{pass:o&&s,message:()=>getMessage(this,this.utils.matcherHint(`${this.isNot?`.not`:``}.toHaveDisplayValue`,`element`,``),`Expected element ${this.isNot?`not `:``}to have display value`,t,`Received`,r)}}function getMultiElementValue(e){let t=[...new Set(e.map(e=>e.type))];if(t.length!==1)throw Error(`Multiple form elements with the same name must be of the same type`);switch(t[0]){case`radio`:{let t=e.find(e=>e.checked);return t?t.value:void 0}case`checkbox`:return e.filter(e=>e.checked).map(e=>e.value);default:return e.map(e=>e.value)}}function getFormValue(e,t){let n=[...e.querySelectorAll(`[name="${cssEscape(t)}"]`)];if(n.length!==0)switch(n.length){case 1:return getSingleElementValue(n[0]);default:return getMultiElementValue(n)}}function getPureName(e){return e.endsWith(`[]`)?e.slice(0,-2):e}function getAllFormValues(e){let t={};for(let n of Array.from(e.elements)){let r=n.name;t[getPureName(r)]=getFormValue(e,r)}return t}function toHaveFormValues(e,t){if(checkHtmlElement(e,toHaveFormValues,this),!e.elements)throw Error(`toHaveFormValues must be called on a form or a fieldset`);let n=getAllFormValues(e);return{pass:Object.entries(t).every(([e,t])=>compareAsSet(n[e],t)),message:()=>{let e=this.isNot?`not to`:`to`,r=`${this.isNot?`.not`:``}.toHaveFormValues`,i={};for(let e of Object.keys(n))Object.prototype.hasOwnProperty.call(t,e)&&(i[e]=n[e]);return[this.utils.matcherHint(r,`element`,``),`Expected the element ${e} have form values`,this.utils.diff(t,i)].join(`
16
+ `)}}function toHaveValue(e,t){if(checkHtmlElement(e,toHaveValue,this),e.tagName.toLowerCase()===`input`&&[`checkbox`,`radio`].includes(e.type))throw Error(`input with type=checkbox or type=radio cannot be used with .toHaveValue(). Use .toBeChecked() for type=checkbox or .toHaveFormValues() instead`);let n=getSingleElementValue(e),r=t!==void 0,i=t,a=n;return t==n&&t!==n&&(i=`${t} (${typeof t})`,a=`${n} (${typeof n})`),{pass:r?compareAsSet(n,t):!!n,message:()=>{let e=this.isNot?`not to`:`to`,n=this.utils.matcherHint(`${this.isNot?`.not`:``}.toHaveValue`,`element`,t);return getMessage(this,n,`Expected the element ${e} have value`,r?i:`(any)`,`Received`,a)}}}function getValues(e,t){if(e!==`select`)return[t.value];let n=[],r=t.options;for(let e=0;e<r.length;e++){let t=r[e];t.selected&&n.push(t.textContent)}return n}function toHaveDisplayValue(e,t){checkHtmlElement(e,toHaveDisplayValue,this);let n=e.tagName.toLowerCase();if(![`select`,`input`,`textarea`].includes(n))throw Error(`.toHaveDisplayValue() currently supports only input, textarea or select elements, try with another matcher instead.`);if(n===`input`&&[`radio`,`checkbox`].includes(e.type))throw Error(`.toHaveDisplayValue() currently does not support input[type="${e.type}"], try with another matcher instead.`);let r=getValues(n,e),i=t instanceof Array?t:[t],a=i.filter(e=>r.some(t=>e instanceof RegExp?e.test(t):this.equals(t,String(e)))).length,o=a===r.length,s=a===i.length;return{pass:o&&s,message:()=>getMessage(this,this.utils.matcherHint(`${this.isNot?`.not`:``}.toHaveDisplayValue`,`element`,``),`Expected element ${this.isNot?`not `:``}to have display value`,t,`Received`,r)}}function getMultiElementValue(e){let t=[...new Set(e.map(e=>e.type))];if(t.length!==1)throw Error(`Multiple form elements with the same name must be of the same type`);switch(t[0]){case`radio`:{let t=e.find(e=>e.checked);return t?t.value:void 0}case`checkbox`:return e.filter(e=>e.checked).map(e=>e.value);default:return e.map(e=>e.value)}}function getFormValue(e){if(e!==void 0)switch(e.length){case 1:return getSingleElementValue(e[0]);default:return getMultiElementValue(e)}}function getPureName(e){return e.endsWith(`[]`)?e.slice(0,-2):e}function getAllFormValues(e){let t=/* @__PURE__ */ new Map;for(let n of e.querySelectorAll(`[name]`)){let e=n.getAttribute(`name`),r=t.get(e);r===void 0?t.set(e,[n]):r.push(n)}let n={};for(let r of Array.from(e.elements)){let e=r.name;n[getPureName(e)]=getFormValue(t.get(e))}return n}function toHaveFormValues(e,t){if(checkHtmlElement(e,toHaveFormValues,this),!e.elements)throw Error(`toHaveFormValues must be called on a form or a fieldset`);let n=getAllFormValues(e);return{pass:Object.entries(t).every(([e,t])=>compareAsSet(n[e],t)),message:()=>{let e=this.isNot?`not to`:`to`,r=`${this.isNot?`.not`:``}.toHaveFormValues`,i={};for(let e of Object.keys(n))Object.prototype.hasOwnProperty.call(t,e)&&(i[e]=n[e]);return[this.utils.matcherHint(r,`element`,``),`Expected the element ${e} have form values`,this.utils.diff(t,i)].join(`
17
17
 
18
18
  `)}}}function getSelection(e){let t=e.ownerDocument.getSelection();if([`input`,`textarea`].includes(e.tagName.toLowerCase()))return[`radio`,`checkbox`].includes(e.type)?``:e.value.toString().substring(e.selectionStart,e.selectionEnd);if(t.anchorNode===null||t.focusNode===null)return``;let n=t.getRangeAt(0),r=e.ownerDocument.createRange();if(t.containsNode(e,!1))r.selectNodeContents(e),t.removeAllRanges(),t.addRange(r);else if(!(e.contains(t.anchorNode)&&e.contains(t.focusNode))){let i=e===n.startContainer||e.contains(n.startContainer),a=e===n.endContainer||e.contains(n.endContainer);t.removeAllRanges(),(i||a)&&(r.selectNodeContents(e),i&&r.setStart(n.startContainer,n.startOffset),a&&r.setEnd(n.endContainer,n.endOffset),t.addRange(r))}let i=t.toString();return t.removeAllRanges(),t.addRange(n),i}function toHaveSelection(e,t){checkHtmlElement(e,toHaveSelection,this);let n=t!==void 0;if(n&&typeof t!=`string`)throw Error(`expected selection must be a string or undefined`);let r=getSelection(e);return{pass:n?compareAsSet(r,t):!!r,message:()=>{let e=this.isNot?`not to`:`to`,i=this.utils.matcherHint(`${this.isNot?`.not`:``}.toHaveSelection`,`element`,t);return getMessage(this,i,`Expected the element ${e} have selection`,n?t:`(any)`,`Received`,r)}}}let b=null;function foreign(){return b??=e(import.meta.url)(`dom-accessibility-api`)}function computeAccessibleName(e){return e[o]===void 0?foreign().computeAccessibleName(e):r.computeAccessibleName(e)}function computeAccessibleDescription(e){return e[o]===void 0?foreign().computeAccessibleDescription(e):r.computeAccessibleDescription(e)}const x=[[`input`,[[`list`,`+`],[`type`,`=email`]],!1,[`combobox`]],[`input`,[[`list`,`+`],[`type`,`=search`]],!1,[`combobox`]],[`input`,[[`list`,`+`],[`type`,`=tel`]],!1,[`combobox`]],[`input`,[[`list`,`+`]],!0,[`combobox`]],[`input`,[[`list`,`+`],[`type`,`=url`]],!1,[`combobox`]],[`select`,[[`multiple`,`-`],[`size`,`-`]],!1,[`combobox`]],[`input`,[[`list`,`-`],[`type`,`=search`]],!1,[`searchbox`]],[`input`,[[`type`,`-`],[`list`,`-`]],!1,[`textbox`]],[`input`,[[`list`,`-`],[`type`,`=email`]],!1,[`textbox`]],[`input`,[[`list`,`-`],[`type`,`=tel`]],!1,[`textbox`]],[`input`,[[`list`,`-`]],!0,[`textbox`]],[`input`,[[`list`,`-`],[`type`,`=url`]],!1,[`textbox`]],[`input`,[[`type`,`=button`]],!1,[`button`]],[`input`,[[`type`,`=image`]],!1,[`button`]],[`input`,[[`type`,`=reset`]],!1,[`button`]],[`input`,[[`type`,`=submit`]],!1,[`button`]],[`input`,[[`type`,`=checkbox`]],!1,[`checkbox`]],[`th`,[[`scope`,`=col`]],!1,[`columnheader`]],[`th`,[[`scope`,`=colgroup`]],!1,[`columnheader`]],[`aside`,[[`aria-label`,`+`]],!1,[`complementary`]],[`aside`,[[`aria-labelledby`,`+`]],!1,[`complementary`]],[`form`,[[`aria-label`,`+`]],!1,[`form`]],[`form`,[[`aria-labelledby`,`+`]],!1,[`form`]],[`form`,[[`name`,`+`]],!1,[`form`]],[`img`,[[`alt`,`+`]],!1,[`img`]],[`img`,[[`alt`,`-`]],!1,[`img`]],[`a`,[[`href`,`+`]],!1,[`link`]],[`area`,[[`href`,`+`]],!1,[`link`]],[`select`,[[`size`,`+`]],!1,[`listbox`]],[`select`,[[`multiple`,`+`]],!1,[`listbox`]],[`img`,[[`alt`,`+`]],!1,[`presentation`]],[`input`,[[`type`,`=radio`]],!1,[`radio`]],[`section`,[[`aria-label`,`+`]],!1,[`region`]],[`section`,[[`aria-labelledby`,`+`]],!1,[`region`]],[`th`,[[`scope`,`=row`]],!1,[`rowheader`]],[`th`,[[`scope`,`=rowgroup`]],!1,[`rowheader`]],[`input`,[[`type`,`=range`]],!1,[`slider`]],[`input`,[[`type`,`=number`]],!1,[`spinbutton`]],[`article`,[],!1,[`article`]],[`header`,[],!1,[`banner`]],[`blockquote`,[],!1,[`blockquote`]],[`button`,[],!1,[`button`]],[`caption`,[],!1,[`caption`]],[`td`,[],!1,[`cell`]],[`code`,[],!1,[`code`]],[`th`,[],!1,[`columnheader`]],[`aside`,[],!1,[`complementary`]],[`footer`,[],!1,[`contentinfo`]],[`dd`,[],!1,[`definition`]],[`del`,[],!1,[`deletion`]],[`dialog`,[],!1,[`dialog`]],[`html`,[],!1,[`document`]],[`em`,[],!1,[`emphasis`]],[`figure`,[],!1,[`figure`]],[`a`,[],!1,[`generic`]],[`area`,[],!1,[`generic`]],[`aside`,[],!1,[`generic`]],[`b`,[],!1,[`generic`]],[`bdo`,[],!1,[`generic`]],[`body`,[],!1,[`generic`]],[`data`,[],!1,[`generic`]],[`div`,[],!1,[`generic`]],[`footer`,[],!1,[`generic`]],[`header`,[],!1,[`generic`]],[`hgroup`,[],!1,[`generic`]],[`i`,[],!1,[`generic`]],[`pre`,[],!1,[`generic`]],[`q`,[],!1,[`generic`]],[`samp`,[],!1,[`generic`]],[`section`,[],!1,[`generic`]],[`small`,[],!1,[`generic`]],[`span`,[],!1,[`generic`]],[`u`,[],!1,[`generic`]],[`td`,[],!1,[`gridcell`]],[`details`,[],!1,[`group`]],[`fieldset`,[],!1,[`group`]],[`optgroup`,[],!1,[`group`]],[`address`,[],!1,[`group`]],[`h1`,[],!1,[`heading`]],[`h2`,[],!1,[`heading`]],[`h3`,[],!1,[`heading`]],[`h4`,[],!1,[`heading`]],[`h5`,[],!1,[`heading`]],[`h6`,[],!1,[`heading`]],[`ins`,[],!1,[`insertion`]],[`menu`,[],!1,[`list`]],[`ol`,[],!1,[`list`]],[`ul`,[],!1,[`list`]],[`datalist`,[],!1,[`listbox`]],[`li`,[],!1,[`listitem`]],[`main`,[],!1,[`main`]],[`mark`,[],!1,[`mark`]],[`math`,[],!1,[`math`]],[`meter`,[],!1,[`meter`]],[`nav`,[],!1,[`navigation`]],[`option`,[],!1,[`option`]],[`p`,[],!1,[`paragraph`]],[`progress`,[],!1,[`progressbar`]],[`tr`,[],!1,[`row`]],[`tbody`,[],!1,[`rowgroup`]],[`tfoot`,[],!1,[`rowgroup`]],[`thead`,[],!1,[`rowgroup`]],[`hr`,[],!1,[`separator`]],[`output`,[],!1,[`status`]],[`strong`,[],!1,[`strong`]],[`sub`,[],!1,[`subscript`]],[`sup`,[],!1,[`superscript`]],[`table`,[],!1,[`table`]],[`dfn`,[],!1,[`term`]],[`dt`,[],!1,[`term`]],[`textarea`,[],!1,[`textbox`]],[`time`,[],!1,[`time`]]];function valueEquals(e,t,n,r){return n===r||(t===`type`||t===`scope`)&&e.namespaceURI===`http://www.w3.org/1999/xhtml`&&n.toLowerCase()===r}function getImplicitAriaRoles(e){let t=e.localName;for(let n=0;n<x.length;n++){let[r,i,a,o]=x[n];if(r!==t||a&&e.type!==`text`)continue;let s=!0;for(let t=0;t<i.length&&s;t++){let[n,r]=i[t],a=e.getAttribute(n);s=r===`-`?a===null:r===`+`?a!==null:a!==null&&valueEquals(e,n,a,r.slice(1))}if(s)return[...o]}return[]}function getExplicitOrImplicitRoles(e){let t=e.getAttribute(`role`);return t===null?e[o]===void 0?getImplicitAriaRoles(e):i(e):t.split(` `).filter(Boolean)}function toHaveRole(e,t){checkHtmlElement(e,toHaveRole,this);let n=getExplicitOrImplicitRoles(e);return{pass:n.some(e=>e===t),message:()=>{let e=this.isNot?`not to`:`to`;return getMessage(this,this.utils.matcherHint(`${this.isNot?`.not`:``}.${toHaveRole.name}`,`element`,``),`Expected element ${e} have role`,t,`Received`,n.join(`, `))}}}function toHaveAccessibleName(e,t){checkHtmlElement(e,toHaveAccessibleName,this);let n=computeAccessibleName(e),r=arguments.length===1,i=!1;return i=r?n!==``:t instanceof RegExp?t.test(n):this.equals(n,t),{pass:i,message:()=>{let e=this.isNot?`not to`:`to`;return getMessage(this,this.utils.matcherHint(`${this.isNot?`.not`:``}.${toHaveAccessibleName.name}`,`element`,``),`Expected element ${e} have accessible name`,t,`Received`,n)}}}function toHaveAccessibleDescription(e,t){checkHtmlElement(e,toHaveAccessibleDescription,this);let n=computeAccessibleDescription(e),r=arguments.length===1,i=!1;return i=r?n!==``:t instanceof RegExp?t.test(n):this.equals(n,t),{pass:i,message:()=>{let e=this.isNot?`not to`:`to`;return getMessage(this,this.utils.matcherHint(`${this.isNot?`.not`:``}.${toHaveAccessibleDescription.name}`,`element`,``),`Expected element ${e} have accessible description`,t,`Received`,n)}}}const S=`aria-invalid`,C=[`false`];function toHaveAccessibleErrorMessage(e,t){checkHtmlElement(e,toHaveAccessibleErrorMessage,this);let n=this.isNot?`not to`:`to`,r=this.isNot?`.not.toHaveAccessibleErrorMessage`:`.toHaveAccessibleErrorMessage`,i=e.getAttribute(`aria-errormessage`);if(i&&/\s+/.test(i))return{pass:!1,message:()=>getMessage(this,this.utils.matcherHint(r,`element`),"Expected element's `aria-errormessage` attribute to be empty or a single, valid ID",``,`Received`,`aria-errormessage="${i}"`)};let a=e.getAttribute(S);if(!e.hasAttribute(S)||C.includes(a))return{pass:!1,message:()=>getMessage(this,this.utils.matcherHint(r,`element`),`Expected element to be marked as invalid with attribute`,`${S}="true"`,`Received`,e.hasAttribute(`aria-invalid`)?`${S}="${e.getAttribute(S)}`:null)};let o=normalize(e.ownerDocument.getElementById(i)?.textContent??``);return{pass:t===void 0?!!o:t instanceof RegExp?t.test(o):this.equals(o,t),message:()=>getMessage(this,this.utils.matcherHint(r,`element`),`Expected element ${n} have accessible error message`,t??``,`Received`,o)}}function textOfIdRefs(e,t){let n=(e.getAttribute(t)||``).split(/\s+/).filter(Boolean);if(n.length===0)return``;let r=e.ownerDocument;return normalize(n.map(e=>r.getElementById(e)).filter(Boolean).map(e=>e.textContent).join(` `))}function toHaveDescription(e,t){deprecate(`toHaveDescription`,`Please use toHaveAccessibleDescription.`),checkHtmlElement(e,toHaveDescription,this);let n=t!==void 0,r=textOfIdRefs(e,`aria-describedby`);return{pass:n?t instanceof RegExp?t.test(r):this.equals(r,t):!!r,message:()=>{let e=this.isNot?`not to`:`to`;return getMessage(this,this.utils.matcherHint(`${this.isNot?`.not`:``}.toHaveDescription`,`element`,``),`Expected the element ${e} have description`,this.utils.printExpected(t),`Received`,this.utils.printReceived(r))}}}function toHaveErrorMessage(e,t){if(deprecate(`toHaveErrorMessage`,`Please use toHaveAccessibleErrorMessage.`),checkHtmlElement(e,toHaveErrorMessage,this),!e.hasAttribute(`aria-invalid`)||e.getAttribute(`aria-invalid`)===`false`){let t=this.isNot?`.not`:``;return{pass:!1,message:()=>getMessage(this,this.utils.matcherHint(`${t}.toHaveErrorMessage`,`element`,``),`Expected the element to have invalid state indicated by`,`aria-invalid="true"`,`Received`,e.hasAttribute(`aria-invalid`)?`aria-invalid="${e.getAttribute(`aria-invalid`)}"`:this.utils.printReceived(``))}}let n=t!==void 0,r=textOfIdRefs(e,`aria-errormessage`);return{pass:n?t instanceof RegExp?t.test(r):this.equals(r,t):!!r,message:()=>{let e=this.isNot?`not to`:`to`;return getMessage(this,this.utils.matcherHint(`${this.isNot?`.not`:``}.toHaveErrorMessage`,`element`,``),`Expected the element ${e} have error message`,this.utils.printExpected(t),`Received`,this.utils.printReceived(r))}}}const w={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},T=/^([+-]?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?)(%|deg|grad|rad|turn)?$/i;function channel(e,t){if(e.toLowerCase()===`none`)return 0;let n=T.exec(e);if(n===null)return null;let r=Number(n[1]);return n[2]===void 0?r:n[2]===`%`?r/100*t:null}function hue(e){let t=T.exec(e);if(t===null)return e.toLowerCase()===`none`?0:null;let n=Number(t[1]);switch(t[2]?.toLowerCase()){case void 0:case`deg`:return n;case`grad`:return n*360/400;case`rad`:return n*180/Math.PI;case`turn`:return n*360;default:return null}}function args(e){let t=e.trim();if(t.includes(`,`)){let e=t.split(`,`).map(e=>e.trim());return e.some(e=>e===``||/\s/.test(e))?null:e}let n=t.indexOf(`/`),r=(n===-1?t:t.slice(0,n)).trim().split(/\s+/);return n!==-1&&r.push(t.slice(n+1).trim()),r}const clamp=(e,t,n)=>Math.min(n,Math.max(t,e));function hslToRgb(e,t,n){e=(e%360+360)%360,t=clamp(t,0,1),n=clamp(n,0,1);let f=r=>{let i=(r+e/30)%12,a=t*Math.min(n,1-n);return(n-a*Math.max(-1,Math.min(i-3,9-i,1)))*255};return[f(0),f(8),f(4)]}function key(e,t,n,r){return`${Math.round(clamp(e,0,255))},${Math.round(clamp(t,0,255))},${Math.round(clamp(n,0,255))},${Math.round(clamp(r,0,1)*1e3)}`}function canonicalColor(e){if(typeof e!=`string`)return null;let t=e.trim().toLowerCase();if(t===``)return null;if(t===`transparent`)return key(0,0,0,0);if(t.charCodeAt(0)===35){let e=t.slice(1);if(!/^[0-9a-f]+$/.test(e))return null;let n=e.length,d=(t,n)=>parseInt(e.slice(t,t+n),16)*(n===1?17:1);return n===3||n===4?key(d(0,1),d(1,1),d(2,1),n===4?d(3,1)/255:1):n===6||n===8?key(d(0,2),d(2,2),d(4,2),n===8?d(6,2)/255:1):null}let n=t.indexOf(`(`);if(n===-1){let e=w[t];return e===void 0?null:key(e>>16,e>>8&255,e&255,1)}if(!t.endsWith(`)`))return null;let r=t.slice(0,n),i=args(t.slice(n+1,-1));if(i===null||i.length!==3&&i.length!==4)return null;let a=i.length===4?channel(i[3],1):1;if(a===null)return null;if(r===`rgb`||r===`rgba`){let e=channel(i[0],255),t=channel(i[1],255),n=channel(i[2],255);return e===null||t===null||n===null?null:key(e,t,n,a)}if(r===`hsl`||r===`hsla`){let e=hue(i[0]),t=channel(i[1],1),n=channel(i[2],1);if(e===null||t===null||n===null)return null;let[r,o,s]=hslToRgb(e,i[1].endsWith(`%`)?t:t/100,i[2].endsWith(`%`)?n:n/100);return key(r,o,s,a)}return null}function sameColor(e,t){let n=canonicalColor(e);return n!==null&&n===canonicalColor(t)}function isStyleVisible(e){let{getComputedStyle:t}=e.ownerDocument.defaultView,{display:n,visibility:r,opacity:i}=t(e);return n!==`none`&&r!==`hidden`&&r!==`collapse`&&i!==`0`&&i!==0}function isAttributeVisible(e,t){let n;return n=t?e.nodeName===`DETAILS`&&t.nodeName!==`SUMMARY`?e.hasAttribute(`open`):!0:e.nodeName!==`DETAILS`||e.hasAttribute(`open`),!e.hasAttribute(`hidden`)&&n}function isElementVisible(e,t){return isStyleVisible(e)&&isAttributeVisible(e,t)&&(!e.parentElement||isElementVisible(e.parentElement,e))}function toBeVisible(e){checkHtmlElement(e,toBeVisible,this);let t=e.ownerDocument===e.getRootNode({composed:!0}),n=t&&isElementVisible(e);return{pass:n,message:()=>{let r=n?`is`:`is not`;return[this.utils.matcherHint(`${this.isNot?`.not`:``}.toBeVisible`,`element`,``),``,`Received element ${r} visible${t?``:` (element is not in the document)`}:`,` ${this.utils.printReceived(e.cloneNode(!1))}`].join(`
19
19
  `)}}}function getStyleDeclaration(e,t){let n={},r=e.createElement(`div`);for(let e of Object.keys(t))r.style[e]=t[e],n[e]=r.style[e];return n}function valueMatches(e,t){return e===t||sameColor(t,e)}function isSubset(e,t){let n=Object.entries(e);if(n.length===0)return!1;for(let[e,r]of n){let n=e.startsWith(`--`);if(!(valueMatches(t[e],r)||valueMatches(t.getPropertyValue(e),r))){if(!n){let n=e.toLowerCase();if(valueMatches(t[n],r)||valueMatches(t.getPropertyValue(n),r))continue}return!1}}return!0}function printoutStyles(e){return Object.keys(e).sort().map(t=>`${t}: ${e[t]};`).join(`
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./_chunks/matchers-CkxM783o.cjs");expect.extend(e.t);
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./_chunks/matchers-CZ6Smfw9.cjs");expect.extend(e.t);
@@ -1 +1 @@
1
- import{t as e}from"./_chunks/matchers-Dt7W4g5X.js";expect.extend(e);export{};
1
+ import{t as e}from"./_chunks/matchers-CwGF61j-.js";expect.extend(e);export{};
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./_chunks/matchers-CkxM783o.cjs");require("@jest/globals").expect.extend(e.t);
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./_chunks/matchers-CZ6Smfw9.cjs");require("@jest/globals").expect.extend(e.t);
@@ -1 +1 @@
1
- import{t as e}from"./_chunks/matchers-Dt7W4g5X.js";import{expect as t}from"@jest/globals";t.extend(e);export{};
1
+ import{t as e}from"./_chunks/matchers-CwGF61j-.js";import{expect as t}from"@jest/globals";t.extend(e);export{};
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./_chunks/matchers-CkxM783o.cjs");exports.toAppearAfter=e.U,exports.toAppearBefore=e.W,exports.toBeChecked=e.y,exports.toBeDisabled=e.b,exports.toBeEmpty=e.G,exports.toBeEmptyDOMElement=e.K,exports.toBeEnabled=e.x,exports.toBeInTheDOM=e.q,exports.toBeInTheDocument=e.J,exports.toBeInvalid=e.S,exports.toBePartiallyChecked=e.C,exports.toBePartiallyPressed=e.w,exports.toBePressed=e.T,exports.toBeRequired=e.E,exports.toBeValid=e.D,exports.toBeVisible=e.O,exports.toContainAnyByAltText=e.n,exports.toContainAnyByDisplayValue=e.r,exports.toContainAnyByLabelText=e.i,exports.toContainAnyByPlaceholderText=e.a,exports.toContainAnyByRole=e.o,exports.toContainAnyByTestId=e.s,exports.toContainAnyByText=e.c,exports.toContainAnyByTitle=e.l,exports.toContainElement=e.Y,exports.toContainHTML=e.X,exports.toContainOneByAltText=e.u,exports.toContainOneByDisplayValue=e.d,exports.toContainOneByLabelText=e.f,exports.toContainOneByPlaceholderText=e.p,exports.toContainOneByRole=e.m,exports.toContainOneByTestId=e.h,exports.toContainOneByText=e.g,exports.toContainOneByTitle=e._,exports.toHaveAccessibleDescription=e.A,exports.toHaveAccessibleErrorMessage=e.j,exports.toHaveAccessibleName=e.M,exports.toHaveAttribute=e.I,exports.toHaveClass=e.L,exports.toHaveDescription=e.N,exports.toHaveDisplayValue=e.R,exports.toHaveErrorMessage=e.P,exports.toHaveFocus=e.Z,exports.toHaveFormValues=e.z,exports.toHaveRole=e.F,exports.toHaveSelection=e.B,exports.toHaveStyle=e.k,exports.toHaveTextContent=e.V,exports.toHaveValue=e.H,exports.toMatchAriaSnapshot=e.v;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./_chunks/matchers-CZ6Smfw9.cjs");exports.toAppearAfter=e.U,exports.toAppearBefore=e.W,exports.toBeChecked=e.y,exports.toBeDisabled=e.b,exports.toBeEmpty=e.G,exports.toBeEmptyDOMElement=e.K,exports.toBeEnabled=e.x,exports.toBeInTheDOM=e.q,exports.toBeInTheDocument=e.J,exports.toBeInvalid=e.S,exports.toBePartiallyChecked=e.C,exports.toBePartiallyPressed=e.w,exports.toBePressed=e.T,exports.toBeRequired=e.E,exports.toBeValid=e.D,exports.toBeVisible=e.O,exports.toContainAnyByAltText=e.n,exports.toContainAnyByDisplayValue=e.r,exports.toContainAnyByLabelText=e.i,exports.toContainAnyByPlaceholderText=e.a,exports.toContainAnyByRole=e.o,exports.toContainAnyByTestId=e.s,exports.toContainAnyByText=e.c,exports.toContainAnyByTitle=e.l,exports.toContainElement=e.Y,exports.toContainHTML=e.X,exports.toContainOneByAltText=e.u,exports.toContainOneByDisplayValue=e.d,exports.toContainOneByLabelText=e.f,exports.toContainOneByPlaceholderText=e.p,exports.toContainOneByRole=e.m,exports.toContainOneByTestId=e.h,exports.toContainOneByText=e.g,exports.toContainOneByTitle=e._,exports.toHaveAccessibleDescription=e.A,exports.toHaveAccessibleErrorMessage=e.j,exports.toHaveAccessibleName=e.M,exports.toHaveAttribute=e.I,exports.toHaveClass=e.L,exports.toHaveDescription=e.N,exports.toHaveDisplayValue=e.R,exports.toHaveErrorMessage=e.P,exports.toHaveFocus=e.Z,exports.toHaveFormValues=e.z,exports.toHaveRole=e.F,exports.toHaveSelection=e.B,exports.toHaveStyle=e.k,exports.toHaveTextContent=e.V,exports.toHaveValue=e.H,exports.toMatchAriaSnapshot=e.v;
@@ -1 +1 @@
1
- export{U as toAppearAfter,W as toAppearBefore,y as toBeChecked,b as toBeDisabled,G as toBeEmpty,K as toBeEmptyDOMElement,x as toBeEnabled,q as toBeInTheDOM,J as toBeInTheDocument,S as toBeInvalid,C as toBePartiallyChecked,w as toBePartiallyPressed,T as toBePressed,E as toBeRequired,D as toBeValid,O as toBeVisible,n as toContainAnyByAltText,r as toContainAnyByDisplayValue,i as toContainAnyByLabelText,a as toContainAnyByPlaceholderText,o as toContainAnyByRole,s as toContainAnyByTestId,c as toContainAnyByText,l as toContainAnyByTitle,Y as toContainElement,X as toContainHTML,u as toContainOneByAltText,d as toContainOneByDisplayValue,f as toContainOneByLabelText,p as toContainOneByPlaceholderText,m as toContainOneByRole,h as toContainOneByTestId,g as toContainOneByText,_ as toContainOneByTitle,A as toHaveAccessibleDescription,j as toHaveAccessibleErrorMessage,M as toHaveAccessibleName,I as toHaveAttribute,L as toHaveClass,N as toHaveDescription,R as toHaveDisplayValue,P as toHaveErrorMessage,Z as toHaveFocus,z as toHaveFormValues,F as toHaveRole,B as toHaveSelection,k as toHaveStyle,V as toHaveTextContent,H as toHaveValue,v as toMatchAriaSnapshot}from"./_chunks/matchers-Dt7W4g5X.js";
1
+ export{U as toAppearAfter,W as toAppearBefore,y as toBeChecked,b as toBeDisabled,G as toBeEmpty,K as toBeEmptyDOMElement,x as toBeEnabled,q as toBeInTheDOM,J as toBeInTheDocument,S as toBeInvalid,C as toBePartiallyChecked,w as toBePartiallyPressed,T as toBePressed,E as toBeRequired,D as toBeValid,O as toBeVisible,n as toContainAnyByAltText,r as toContainAnyByDisplayValue,i as toContainAnyByLabelText,a as toContainAnyByPlaceholderText,o as toContainAnyByRole,s as toContainAnyByTestId,c as toContainAnyByText,l as toContainAnyByTitle,Y as toContainElement,X as toContainHTML,u as toContainOneByAltText,d as toContainOneByDisplayValue,f as toContainOneByLabelText,p as toContainOneByPlaceholderText,m as toContainOneByRole,h as toContainOneByTestId,g as toContainOneByText,_ as toContainOneByTitle,A as toHaveAccessibleDescription,j as toHaveAccessibleErrorMessage,M as toHaveAccessibleName,I as toHaveAttribute,L as toHaveClass,N as toHaveDescription,R as toHaveDisplayValue,P as toHaveErrorMessage,Z as toHaveFocus,z as toHaveFormValues,F as toHaveRole,B as toHaveSelection,k as toHaveStyle,V as toHaveTextContent,H as toHaveValue,v as toMatchAriaSnapshot}from"./_chunks/matchers-CwGF61j-.js";
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./_chunks/matchers-CkxM783o.cjs");require("vitest").expect.extend(e.t);
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./_chunks/matchers-CZ6Smfw9.cjs");require("vitest").expect.extend(e.t);
@@ -1 +1 @@
1
- import{t as e}from"./_chunks/matchers-Dt7W4g5X.js";import{expect as t}from"vitest";t.extend(e);export{};
1
+ import{t as e}from"./_chunks/matchers-CwGF61j-.js";import{expect as t}from"vitest";t.extend(e);export{};
@@ -0,0 +1 @@
1
+ import*as e from"react";import{canSkipZeroDelayWait as t,listenerCount as n,loopTurn as r,registerTestHooks as i,reusableElement as a,skipZeroDelayWait as o,traceSync as s,tracing as c}from"@ctrl/dom/internal";import*as l from"react-dom/client";var u=Object.defineProperty,d=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyNames,p=Object.prototype.hasOwnProperty,__exportAll=(e,t)=>{let n={};for(var r in e)u(n,r,{get:e[r],enumerable:!0});return t||u(n,Symbol.toStringTag,{value:`Module`}),n},__copyProps=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var i=f(t),a=0,o=i.length,s;a<o;a++)s=i[a],!p.call(e,s)&&s!==n&&u(e,s,{get:(e=>t[e]).bind(null,s),enumerable:!(r=d(t,s))||r.enumerable});return e},__reExport=(e,t,n)=>(__copyProps(e,t,`default`),n&&__copyProps(n,t,`default`)),m=/* @__PURE__ */ __exportAll({});import*as h from"@ctrl/dom/testing-library";__reExport(m,h);let g={reactStrictMode:!1,releaseSuspendedWork:!0};function releaseSuspendedWorkEnabled(){return g.releaseSuspendedWork}function getConfig(){return{...(0,m.getConfig)(),...g}}function configure(e){typeof e==`function`&&(e=e(getConfig()));let{reactStrictMode:t,releaseSuspendedWork:n,...r}=e;(0,m.configure)(r),g={...g,reactStrictMode:t,releaseSuspendedWork:n??g.releaseSuspendedWork}}const _=e.act;function setReactActEnvironment(e){globalThis.IS_REACT_ACT_ENVIRONMENT=e}function getIsReactActEnvironment(){return globalThis.IS_REACT_ACT_ENVIRONMENT}const v=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,y=/* @__PURE__ */ new Set;function flushReleasingSuspendedWork(e){let t=!1,n=0;try{for(;n<e.length;n++){let r=e[n];for(;r!==null;)if(v.didUsePromise=!1,r=r(!1),r!==null&&v.didUsePromise){t=!0;break}}e.length=0}catch(t){e.splice(0,n+1),v.thrownErrors.unshift(t)}if(t)for(let e of y){let t=e._internalRoot,n=t?.callbackNode;n!=null&&n.callback===void 0&&(t.callbackNode=null,t.callbackPriority=0)}return v.thrownErrors.splice(0)}function isThenable(e){return typeof e==`object`&&!!e&&typeof e.then==`function`}function withGlobalActEnvironment(e){return t=>{let n=getIsReactActEnvironment();setReactActEnvironment(!0);try{let r=!1,i=e(()=>{let e=t();return isThenable(e)&&(r=!0),e});if(r){let e=i;return{then:(t,r)=>{e.then(e=>{setReactActEnvironment(n),t(e)},e=>{setReactActEnvironment(n),r(e)})}}}return setReactActEnvironment(n),i}catch(e){throw setReactActEnvironment(n),e}}}const b=withGlobalActEnvironment(_);function actReleasingSuspendedWork(e){if(v.actQueue!==null||!releaseSuspendedWorkEnabled()){b(e);return}let t=[];try{b(()=>{let n=v.actQueue;e(),t=flushReleasingSuspendedWork(n)})}catch(e){t.push(e)}if(t.length===1)throw t[0];if(t.length>1)throw AggregateError(t)}const fireEvent=((...e)=>(0,m.fireEvent)(...e)),x=fireEvent,S=m.fireEvent;for(let e of Object.keys(m.fireEvent))x[e]=(...t)=>S[e](...t);const C=x.mouseEnter,w=x.mouseLeave;x.mouseEnter=(...e)=>(C(...e),x.mouseOver(...e)),x.mouseLeave=(...e)=>(w(...e),x.mouseOut(...e));const T=x.pointerEnter,E=x.pointerLeave;x.pointerEnter=(...e)=>(T(...e),x.pointerOver(...e)),x.pointerLeave=(...e)=>(E(...e),x.pointerOut(...e));const D=x.select;x.select=(e,t)=>{D(e,t),e.focus(),x.keyUp(e,t)};const O=x.blur,k=x.focus;x.blur=(...e)=>(x.focusOut(...e),O(...e)),x.focus=(...e)=>(x.focusIn(...e),k(...e));var A=/* @__PURE__ */ __exportAll({act:()=>b,cleanup:()=>cleanup,configure:()=>configure,fireEvent:()=>fireEvent,getConfig:()=>getConfig,render:()=>render,renderHook:()=>renderHook});__reExport(A,m);function advanceFakeTimersIfEnabled(){if(typeof jest<`u`&&jest!==null){(setTimeout._isMockFunction===!0||Object.prototype.hasOwnProperty.call(setTimeout,`clock`))&&jest.advanceTimersByTime(0);return}let e=setTimeout.clock;typeof e?.tick==`function`&&e.tick(0)}function drainWithTimer(e){setTimeout(()=>{e()},0),advanceFakeTimersIfEnabled()}let j=!1;(0,m.configure)({unstable_advanceTimersWrapper:e=>b(e),asyncWrapper:async e=>{let n=getIsReactActEnvironment();setReactActEnvironment(!1);try{let n=await e();return await new Promise(e=>{t(globalThis)?r(()=>o(globalThis)?e():drainWithTimer(e)):drainWithTimer(e)}),n}finally{setReactActEnvironment(n)}},eventWrapper:e=>{if(j)return e();j=!0;try{let t;return actReleasingSuspendedWork(()=>{t=e()}),t}finally{j=!1}}});const M=/* @__PURE__ */ new Set,N=[],P=/* @__PURE__ */ new WeakMap,F=/* @__PURE__ */ new WeakMap;function strictModeIfNeeded(t,n){return n??getConfig().reactStrictMode?e.createElement(e.StrictMode,null,t):t}function wrapUiIfNeeded(t,n){return n?e.createElement(n,null,t):t}function createConcurrentRoot(e,{hydrate:t,onCaughtError:n,onRecoverableError:r,ui:i,wrapper:a,reactStrictMode:o}){let s;if(t)try{actReleasingSuspendedWork(()=>{s=l.hydrateRoot(e,strictModeIfNeeded(wrapUiIfNeeded(i,a),o),{onCaughtError:n,onRecoverableError:r}),y.add(s)})}catch(e){throw y.delete(s),e}else s=l.createRoot(e,{onCaughtError:n,onRecoverableError:r}),y.add(s);return{hydrate(){if(!t)throw Error("Attempted to hydrate a non-hydrateable root. This is a bug in `@testing-library/react`.")},render(e){s.render(e)},unmount(){s.unmount(),y.delete(s)}}}const I=/* @__PURE__ */ new WeakMap;function resultTemplateFor(e){let t=I.get(e);return t===void 0&&(t={container:void 0,baseElement:void 0,debug:void 0,unmount:void 0,rerender:void 0,asFragment:void 0,...(0,m.getQueriesForElement)(e)},I.set(e,t)),t}function actRender(e,t,n,r,i){actReleasingSuspendedWork(()=>{n?t.hydrate():t.render(strictModeIfNeeded(wrapUiIfNeeded(e,r),i))})}function renderRoot(e,{baseElement:t,container:n,hydrate:r,queries:i,root:a,wrapper:o,reactStrictMode:l}){actRender(e,a,r,o,l);let debug=(e=t,n,r)=>Array.isArray(e)?e.forEach(e=>console.log((0,m.prettyDOM)(e,n,r))):console.log((0,m.prettyDOM)(e,n,r)),unmount=()=>{b(()=>{a.unmount()})},rerender=e=>{let rerender=()=>actRender(e,a,!1,o,l);c()?s(`react.rerender`,`rerender(${describeElement(e)})`,rerender):rerender()},asFragment=()=>{if(typeof document.createRange==`function`)return document.createRange().createContextualFragment(n.innerHTML);let e=document.createElement(`template`);return e.innerHTML=n.innerHTML,e.content};if(i!==void 0)return{container:n,baseElement:t,debug,unmount,rerender,asFragment,...(0,m.getQueriesForElement)(t,i)};let u={...resultTemplateFor(t)};return u.container=n,u.baseElement=t,u.debug=debug,u.unmount=unmount,u.rerender=rerender,u.asFragment=asFragment,u}function legacyRootError(e){let t=/* @__PURE__ */ Error("`legacyRoot: true` is not supported in this version of React. If your app runs React 19 or later, you should remove this flag. If your app runs React 18 or earlier, visit https://react.dev/blog/2022/03/08/react-18-upgrade-guide for upgrade instructions.");return Error.captureStackTrace(t,e),t}function render(e,t){return c()?s(`react.render`,`render(${describeElement(e)})`,()=>renderUntraced(e,t)):renderUntraced(e,t)}function describeElement(t){if(!e.isValidElement(t))return typeof t==`string`?JSON.stringify(t):String(t);let n=t;for(let e=0;e<10;e++){let e=isWrapper(n)?wrappedElement(n):null;if(e===null)break;n=e}return describeTree(n,0)}function describeTree(e,t){let n=componentName(e.type)||`Component`;if(typeof e.type!=`string`)return`<${n} />`;let r=e.props.children;if(r==null||r===!1)return`<${n} />`;let i=onlyElement(r);return i!==null&&t<2?`<${n}>${describeTree(i,t+1)}</${n}>`:`<${n}>…</${n}>`}function componentName(e){if(typeof e==`string`)return e;if(typeof e==`symbol`)return e.description?.replace(/^react\./,``)??``;let t=e;return(t?.displayName??t?.name??t?.render?.name??t?.type?.name??``).replace(/\$\d+$/,``)}const L=/(?:Providers?|Context|Router|Wrapper|Fragment|StrictMode|Suspense|Profiler)$/;function isWrapper(e){if(typeof e.type==`symbol`)return!0;let t=componentName(e.type);return L.test(t)||t===``&&onlyElement(e.props.children)!==null}function wrappedElement(e){let t=e.props;return onlyElement(t.children)??firstRouteElement(t.router?.routes)}function firstRouteElement(e){for(let t of e??[]){let e=onlyElement(t.element);if(e!==null&&componentName(e.type)!==`Outlet`)return e;let n=firstRouteElement(t.children);if(n!==null)return n}return null}function onlyElement(t){if(e.isValidElement(t))return t;if(!Array.isArray(t))return null;let n=t.filter(t=>e.isValidElement(t));return n.length===1?n[0]:null}function renderUntraced(e,{container:t,baseElement:r=t,legacyRoot:i=!1,onCaughtError:a,onUncaughtError:o,onRecoverableError:s,queries:c,hydrate:l=!1,wrapper:u,reactStrictMode:d}={}){if(o!==void 0)throw Error("onUncaughtError is not supported. The `render` call will already throw on uncaught errors.");if(i)throw legacyRootError(render);r||=document.body;let f=!1;if(!t){let e=P.get(document)?.pop();f=e===void 0,t=r.appendChild(e??document.createElement(`div`))}let p;if(!M.has(t))p=createConcurrentRoot(t,{hydrate:l,onCaughtError:a,onRecoverableError:s,ui:e,wrapper:u,reactStrictMode:d}),f&&F.set(t,{listeners:n(t),keys:Object.keys(t).length}),N.push({container:t,root:p}),M.add(t);else for(let e=0;e<N.length;e++){let n=N[e];n.container===t&&(p=n.root)}return renderRoot(e,{container:t,baseElement:r,queries:c,hydrate:l,wrapper:u,root:p,reactStrictMode:d})}function cleanup(){for(let e=0;e<N.length;e++){let{root:t,container:n}=N[e];if(b(()=>{t.unmount()}),n.parentNode===document.body){document.body.removeChild(n);let e=F.get(n);if(e!==void 0&&(n.onclick=null),e!==void 0&&a(n,e.listeners)&&Object.keys(n).length===e.keys){let e=P.get(document);e===void 0&&P.set(document,e=[]),e.length<8&&e.push(n)}}}N.length=0,M.clear()}i(`react`,{fileEnd(){cleanup(),dropHoistedResources()}});function dropHoistedResources(){for(let e of Object.keys(document)){if(!e.startsWith(`__reactResources$`))continue;let t=document[e];for(let e of[t?.hoistableStyles,t?.hoistableScripts])if(e instanceof Map)for(let t of e.values()){let e=t?.instance??t;typeof e?.remove==`function`&&e.remove()}delete document[e]}}function renderHook(t,n={}){let{initialProps:r,...i}=n;if(i.legacyRoot)throw legacyRootError(renderHook);let a=e.createRef();function TestComponent({renderCallbackProps:n}){let r=t(n);return e.useEffect(()=>{a.current=r}),null}let{rerender:o,unmount:s}=render(e.createElement(TestComponent,{renderCallbackProps:r}),i);function rerender(t){return o(e.createElement(TestComponent,{renderCallbackProps:t}))}return{result:a,rerender,unmount:s}}export{fireEvent as a,setReactActEnvironment as c,__exportAll as d,__reExport as f,renderHook as i,configure as l,A as n,b as o,render as r,getIsReactActEnvironment as s,cleanup as t,getConfig as u};
@@ -0,0 +1 @@
1
+ var e=Object.defineProperty,t=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,r=Object.getPrototypeOf,i=Object.prototype.hasOwnProperty,__exportAll=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],enumerable:!0});return n||e(r,Symbol.toStringTag,{value:`Module`}),r},__copyProps=(r,a,o,s)=>{if(a&&typeof a==`object`||typeof a==`function`)for(var c=n(a),l=0,u=c.length,d;l<u;l++)d=c[l],!i.call(r,d)&&d!==o&&e(r,d,{get:(e=>a[e]).bind(null,d),enumerable:!(s=t(a,d))||s.enumerable});return r},__reExport=(e,t,n)=>(__copyProps(e,t,`default`),n&&__copyProps(n,t,`default`)),__toESM=(t,n,a)=>(a=t==null?{}:{__proto__:r(t)},__copyProps(n||!t||!t.__esModule||!i.call(t,`default`)?e(a,`default`,{value:t,enumerable:!0}):a,t));let a=require("react");a=__toESM(a,1);let o=require("@ctrl/dom/internal"),s=require("react-dom/client");s=__toESM(s,1);var c=/* @__PURE__ */ __exportAll({});__reExport(c,require("@ctrl/dom/testing-library"));let l={reactStrictMode:!1,releaseSuspendedWork:!0};function releaseSuspendedWorkEnabled(){return l.releaseSuspendedWork}function getConfig(){return{...(0,c.getConfig)(),...l}}function configure(e){typeof e==`function`&&(e=e(getConfig()));let{reactStrictMode:t,releaseSuspendedWork:n,...r}=e;(0,c.configure)(r),l={...l,reactStrictMode:t,releaseSuspendedWork:n??l.releaseSuspendedWork}}const u=a.act;function setReactActEnvironment(e){globalThis.IS_REACT_ACT_ENVIRONMENT=e}function getIsReactActEnvironment(){return globalThis.IS_REACT_ACT_ENVIRONMENT}const d=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,f=/* @__PURE__ */ new Set;function flushReleasingSuspendedWork(e){let t=!1,n=0;try{for(;n<e.length;n++){let r=e[n];for(;r!==null;)if(d.didUsePromise=!1,r=r(!1),r!==null&&d.didUsePromise){t=!0;break}}e.length=0}catch(t){e.splice(0,n+1),d.thrownErrors.unshift(t)}if(t)for(let e of f){let t=e._internalRoot,n=t?.callbackNode;n!=null&&n.callback===void 0&&(t.callbackNode=null,t.callbackPriority=0)}return d.thrownErrors.splice(0)}function isThenable(e){return typeof e==`object`&&!!e&&typeof e.then==`function`}function withGlobalActEnvironment(e){return t=>{let n=getIsReactActEnvironment();setReactActEnvironment(!0);try{let r=!1,i=e(()=>{let e=t();return isThenable(e)&&(r=!0),e});if(r){let e=i;return{then:(t,r)=>{e.then(e=>{setReactActEnvironment(n),t(e)},e=>{setReactActEnvironment(n),r(e)})}}}return setReactActEnvironment(n),i}catch(e){throw setReactActEnvironment(n),e}}}const p=withGlobalActEnvironment(u);function actReleasingSuspendedWork(e){if(d.actQueue!==null||!releaseSuspendedWorkEnabled()){p(e);return}let t=[];try{p(()=>{let n=d.actQueue;e(),t=flushReleasingSuspendedWork(n)})}catch(e){t.push(e)}if(t.length===1)throw t[0];if(t.length>1)throw AggregateError(t)}const fireEvent=((...e)=>(0,c.fireEvent)(...e)),m=fireEvent,h=c.fireEvent;for(let e of Object.keys(c.fireEvent))m[e]=(...t)=>h[e](...t);const g=m.mouseEnter,_=m.mouseLeave;m.mouseEnter=(...e)=>(g(...e),m.mouseOver(...e)),m.mouseLeave=(...e)=>(_(...e),m.mouseOut(...e));const v=m.pointerEnter,y=m.pointerLeave;m.pointerEnter=(...e)=>(v(...e),m.pointerOver(...e)),m.pointerLeave=(...e)=>(y(...e),m.pointerOut(...e));const b=m.select;m.select=(e,t)=>{b(e,t),e.focus(),m.keyUp(e,t)};const x=m.blur,S=m.focus;m.blur=(...e)=>(m.focusOut(...e),x(...e)),m.focus=(...e)=>(m.focusIn(...e),S(...e));var C=/* @__PURE__ */ __exportAll({act:()=>p,cleanup:()=>cleanup,configure:()=>configure,fireEvent:()=>fireEvent,getConfig:()=>getConfig,render:()=>render,renderHook:()=>renderHook});__reExport(C,c);function advanceFakeTimersIfEnabled(){if(typeof jest<`u`&&jest!==null){(setTimeout._isMockFunction===!0||Object.prototype.hasOwnProperty.call(setTimeout,`clock`))&&jest.advanceTimersByTime(0);return}let e=setTimeout.clock;typeof e?.tick==`function`&&e.tick(0)}function drainWithTimer(e){setTimeout(()=>{e()},0),advanceFakeTimersIfEnabled()}let w=!1;(0,c.configure)({unstable_advanceTimersWrapper:e=>p(e),asyncWrapper:async e=>{let t=getIsReactActEnvironment();setReactActEnvironment(!1);try{let t=await e();return await new Promise(e=>{(0,o.canSkipZeroDelayWait)(globalThis)?(0,o.loopTurn)(()=>(0,o.skipZeroDelayWait)(globalThis)?e():drainWithTimer(e)):drainWithTimer(e)}),t}finally{setReactActEnvironment(t)}},eventWrapper:e=>{if(w)return e();w=!0;try{let t;return actReleasingSuspendedWork(()=>{t=e()}),t}finally{w=!1}}});const T=/* @__PURE__ */ new Set,E=[],D=/* @__PURE__ */ new WeakMap,O=/* @__PURE__ */ new WeakMap;function strictModeIfNeeded(e,t){return t??getConfig().reactStrictMode?a.createElement(a.StrictMode,null,e):e}function wrapUiIfNeeded(e,t){return t?a.createElement(t,null,e):e}function createConcurrentRoot(e,{hydrate:t,onCaughtError:n,onRecoverableError:r,ui:i,wrapper:a,reactStrictMode:o}){let c;if(t)try{actReleasingSuspendedWork(()=>{c=s.hydrateRoot(e,strictModeIfNeeded(wrapUiIfNeeded(i,a),o),{onCaughtError:n,onRecoverableError:r}),f.add(c)})}catch(e){throw f.delete(c),e}else c=s.createRoot(e,{onCaughtError:n,onRecoverableError:r}),f.add(c);return{hydrate(){if(!t)throw Error("Attempted to hydrate a non-hydrateable root. This is a bug in `@testing-library/react`.")},render(e){c.render(e)},unmount(){c.unmount(),f.delete(c)}}}const k=/* @__PURE__ */ new WeakMap;function resultTemplateFor(e){let t=k.get(e);return t===void 0&&(t={container:void 0,baseElement:void 0,debug:void 0,unmount:void 0,rerender:void 0,asFragment:void 0,...(0,c.getQueriesForElement)(e)},k.set(e,t)),t}function actRender(e,t,n,r,i){actReleasingSuspendedWork(()=>{n?t.hydrate():t.render(strictModeIfNeeded(wrapUiIfNeeded(e,r),i))})}function renderRoot(e,{baseElement:t,container:n,hydrate:r,queries:i,root:a,wrapper:s,reactStrictMode:l}){actRender(e,a,r,s,l);let debug=(e=t,n,r)=>Array.isArray(e)?e.forEach(e=>console.log((0,c.prettyDOM)(e,n,r))):console.log((0,c.prettyDOM)(e,n,r)),unmount=()=>{p(()=>{a.unmount()})},rerender=e=>{let rerender=()=>actRender(e,a,!1,s,l);(0,o.tracing)()?(0,o.traceSync)(`react.rerender`,`rerender(${describeElement(e)})`,rerender):rerender()},asFragment=()=>{if(typeof document.createRange==`function`)return document.createRange().createContextualFragment(n.innerHTML);let e=document.createElement(`template`);return e.innerHTML=n.innerHTML,e.content};if(i!==void 0)return{container:n,baseElement:t,debug,unmount,rerender,asFragment,...(0,c.getQueriesForElement)(t,i)};let u={...resultTemplateFor(t)};return u.container=n,u.baseElement=t,u.debug=debug,u.unmount=unmount,u.rerender=rerender,u.asFragment=asFragment,u}function legacyRootError(e){let t=/* @__PURE__ */ Error("`legacyRoot: true` is not supported in this version of React. If your app runs React 19 or later, you should remove this flag. If your app runs React 18 or earlier, visit https://react.dev/blog/2022/03/08/react-18-upgrade-guide for upgrade instructions.");return Error.captureStackTrace(t,e),t}function render(e,t){return(0,o.tracing)()?(0,o.traceSync)(`react.render`,`render(${describeElement(e)})`,()=>renderUntraced(e,t)):renderUntraced(e,t)}function describeElement(e){if(!a.isValidElement(e))return typeof e==`string`?JSON.stringify(e):String(e);let t=e;for(let e=0;e<10;e++){let e=isWrapper(t)?wrappedElement(t):null;if(e===null)break;t=e}return describeTree(t,0)}function describeTree(e,t){let n=componentName(e.type)||`Component`;if(typeof e.type!=`string`)return`<${n} />`;let r=e.props.children;if(r==null||r===!1)return`<${n} />`;let i=onlyElement(r);return i!==null&&t<2?`<${n}>${describeTree(i,t+1)}</${n}>`:`<${n}>…</${n}>`}function componentName(e){if(typeof e==`string`)return e;if(typeof e==`symbol`)return e.description?.replace(/^react\./,``)??``;let t=e;return(t?.displayName??t?.name??t?.render?.name??t?.type?.name??``).replace(/\$\d+$/,``)}const A=/(?:Providers?|Context|Router|Wrapper|Fragment|StrictMode|Suspense|Profiler)$/;function isWrapper(e){if(typeof e.type==`symbol`)return!0;let t=componentName(e.type);return A.test(t)||t===``&&onlyElement(e.props.children)!==null}function wrappedElement(e){let t=e.props;return onlyElement(t.children)??firstRouteElement(t.router?.routes)}function firstRouteElement(e){for(let t of e??[]){let e=onlyElement(t.element);if(e!==null&&componentName(e.type)!==`Outlet`)return e;let n=firstRouteElement(t.children);if(n!==null)return n}return null}function onlyElement(e){if(a.isValidElement(e))return e;if(!Array.isArray(e))return null;let t=e.filter(e=>a.isValidElement(e));return t.length===1?t[0]:null}function renderUntraced(e,{container:t,baseElement:n=t,legacyRoot:r=!1,onCaughtError:i,onUncaughtError:a,onRecoverableError:s,queries:c,hydrate:l=!1,wrapper:u,reactStrictMode:d}={}){if(a!==void 0)throw Error("onUncaughtError is not supported. The `render` call will already throw on uncaught errors.");if(r)throw legacyRootError(render);n||=document.body;let f=!1;if(!t){let e=D.get(document)?.pop();f=e===void 0,t=n.appendChild(e??document.createElement(`div`))}let p;if(!T.has(t))p=createConcurrentRoot(t,{hydrate:l,onCaughtError:i,onRecoverableError:s,ui:e,wrapper:u,reactStrictMode:d}),f&&O.set(t,{listeners:(0,o.listenerCount)(t),keys:Object.keys(t).length}),E.push({container:t,root:p}),T.add(t);else for(let e=0;e<E.length;e++){let n=E[e];n.container===t&&(p=n.root)}return renderRoot(e,{container:t,baseElement:n,queries:c,hydrate:l,wrapper:u,root:p,reactStrictMode:d})}function cleanup(){for(let e=0;e<E.length;e++){let{root:t,container:n}=E[e];if(p(()=>{t.unmount()}),n.parentNode===document.body){document.body.removeChild(n);let e=O.get(n);if(e!==void 0&&(n.onclick=null),e!==void 0&&(0,o.reusableElement)(n,e.listeners)&&Object.keys(n).length===e.keys){let e=D.get(document);e===void 0&&D.set(document,e=[]),e.length<8&&e.push(n)}}}E.length=0,T.clear()}(0,o.registerTestHooks)(`react`,{fileEnd(){cleanup(),dropHoistedResources()}});function dropHoistedResources(){for(let e of Object.keys(document)){if(!e.startsWith(`__reactResources$`))continue;let t=document[e];for(let e of[t?.hoistableStyles,t?.hoistableScripts])if(e instanceof Map)for(let t of e.values()){let e=t?.instance??t;typeof e?.remove==`function`&&e.remove()}delete document[e]}}function renderHook(e,t={}){let{initialProps:n,...r}=t;if(r.legacyRoot)throw legacyRootError(renderHook);let i=a.createRef();function TestComponent({renderCallbackProps:t}){let n=e(t);return a.useEffect(()=>{i.current=n}),null}let{rerender:o,unmount:s}=render(a.createElement(TestComponent,{renderCallbackProps:n}),r);function rerender(e){return o(a.createElement(TestComponent,{renderCallbackProps:e}))}return{result:i,rerender,unmount:s}}Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return fireEvent}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return setReactActEnvironment}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return __exportAll}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return __reExport}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return renderHook}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return configure}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return render}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return getIsReactActEnvironment}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return cleanup}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return getConfig}});
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./_chunks/pure-DOgNQrwu.cjs");var t=/* @__PURE__ */ e.d({act:()=>e.o,cleanup:()=>e.t,configure:()=>e.l,fireEvent:()=>e.a,getConfig:()=>e.u,render:()=>e.r,renderHook:()=>e.i});if(e.f(t,e.n),(typeof process>`u`||!process.env?.RTL_SKIP_AUTO_CLEANUP)&&(typeof afterEach==`function`?afterEach(()=>{e.t()}):typeof teardown==`function`&&teardown(()=>{e.t()}),typeof beforeAll==`function`&&typeof afterAll==`function`)){let t=e.s();beforeAll(()=>{t=e.s(),e.c(!0)}),afterAll(()=>{e.c(t)})}exports.act=e.o,exports.cleanup=e.t,exports.configure=e.l,exports.fireEvent=e.a,exports.getConfig=e.u,exports.render=e.r,exports.renderHook=e.i;var n=require("@ctrl/dom/testing-library");Object.keys(n).forEach(function(e){e!=="default"&&!Object.prototype.hasOwnProperty.call(exports,e)&&Object.defineProperty(exports,e,{enumerable:!0,get:function(){return n[e]}})});
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./_chunks/pure-DRugbA0j.cjs");let t=require("@ctrl/dom/internal");var n=/* @__PURE__ */ e.d({act:()=>e.o,cleanup:()=>e.t,configure:()=>e.l,fireEvent:()=>e.a,getConfig:()=>e.u,render:()=>e.r,renderHook:()=>e.i});if(e.f(n,e.n),(typeof process>`u`||!process.env?.RTL_SKIP_AUTO_CLEANUP)&&(typeof afterEach==`function`?(afterEach(()=>{e.t()}),(0,t.registerTestHooks)(`react`,{afterEach:e.t})):typeof teardown==`function`&&teardown(()=>{e.t()}),typeof beforeAll==`function`&&typeof afterAll==`function`)){let n=e.s(),enterActEnvironment=()=>{n=e.s(),e.c(!0)},leaveActEnvironment=()=>{e.c(n)};beforeAll(enterActEnvironment),afterAll(leaveActEnvironment),(0,t.registerTestHooks)(`react`,{beforeAll:enterActEnvironment,afterAll:leaveActEnvironment})}exports.act=e.o,exports.cleanup=e.t,exports.configure=e.l,exports.fireEvent=e.a,exports.getConfig=e.u,exports.render=e.r,exports.renderHook=e.i;var r=require("@ctrl/dom/testing-library");Object.keys(r).forEach(function(e){e!=="default"&&!Object.prototype.hasOwnProperty.call(exports,e)&&Object.defineProperty(exports,e,{enumerable:!0,get:function(){return r[e]}})});