@ogcio/design-system-react 1.11.0 → 1.11.2

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 (374) hide show
  1. package/dist/accordion/accordion-item.d.ts +11 -0
  2. package/dist/accordion/accordion-item.js +76 -0
  3. package/dist/accordion/accordion.d.ts +10 -0
  4. package/dist/accordion/accordion.js +39 -0
  5. package/dist/accordion/accordion.test.d.ts +1 -0
  6. package/dist/accordion/accordion.test.js +61 -0
  7. package/dist/alert/alert.d.ts +89 -0
  8. package/dist/alert/alert.js +115 -0
  9. package/dist/alert/alert.test.d.ts +1 -0
  10. package/dist/alert/alert.test.js +45 -0
  11. package/dist/assets/logos/gov-of-ireland/harp-gold-text-green.d.ts +2 -0
  12. package/dist/assets/logos/gov-of-ireland/harp-gold-text-green.js +322 -0
  13. package/dist/assets/logos/gov-of-ireland/harp-white.d.ts +2 -0
  14. package/dist/assets/logos/gov-of-ireland/harp-white.js +322 -0
  15. package/dist/assets/logos/harp/harp-white.d.ts +2 -0
  16. package/dist/assets/logos/harp/harp-white.js +60 -0
  17. package/dist/autocomplete/autocomplete.d.ts +4 -0
  18. package/dist/autocomplete/autocomplete.js +252 -0
  19. package/dist/autocomplete/types.d.ts +61 -0
  20. package/dist/autocomplete/types.js +13 -0
  21. package/dist/blockquote/blockquote.d.ts +3 -0
  22. package/dist/blockquote/blockquote.js +7 -0
  23. package/dist/blockquote/blockquote.test.d.ts +1 -0
  24. package/dist/blockquote/blockquote.test.js +21 -0
  25. package/dist/breadcrumbs/breadcrumbs.d.ts +5 -0
  26. package/dist/breadcrumbs/breadcrumbs.js +38 -0
  27. package/dist/breadcrumbs/breadcrumbs.test.d.ts +1 -0
  28. package/dist/breadcrumbs/breadcrumbs.test.js +43 -0
  29. package/dist/breadcrumbs/types.d.ts +17 -0
  30. package/dist/breadcrumbs/types.js +1 -0
  31. package/dist/button/button.d.ts +9 -0
  32. package/dist/button/button.js +38 -0
  33. package/dist/button/button.test.d.ts +1 -0
  34. package/dist/button/button.test.js +78 -0
  35. package/dist/button/helpers.d.ts +13 -0
  36. package/dist/button/helpers.js +39 -0
  37. package/dist/button/types.d.ts +13 -0
  38. package/dist/button/types.js +4 -0
  39. package/dist/button-group/button-group.d.ts +21 -0
  40. package/dist/button-group/button-group.js +85 -0
  41. package/dist/button-group/button-group.test.d.ts +1 -0
  42. package/dist/button-group/button-group.test.js +2982 -0
  43. package/dist/card/card-legacy.d.ts +5 -0
  44. package/dist/card/card-legacy.js +68 -0
  45. package/dist/card/card-next.d.ts +13 -0
  46. package/dist/card/card-next.js +84 -0
  47. package/dist/card/card.d.ts +2 -0
  48. package/dist/card/card.js +26 -0
  49. package/dist/card/card.test.d.ts +1 -0
  50. package/dist/card/card.test.js +130 -0
  51. package/dist/card/types.d.ts +92 -0
  52. package/dist/card/types.js +1 -0
  53. package/dist/checkbox/checkbox-group.d.ts +4 -0
  54. package/dist/checkbox/checkbox-group.js +7 -0
  55. package/dist/checkbox/checkbox.d.ts +4 -0
  56. package/dist/checkbox/checkbox.js +7 -0
  57. package/dist/checkbox/types.d.ts +14 -0
  58. package/dist/checkbox/types.js +5 -0
  59. package/dist/chip/chip.d.ts +9 -0
  60. package/dist/chip/chip.js +37 -0
  61. package/dist/cn.d.ts +2 -0
  62. package/dist/cn.js +19 -0
  63. package/dist/combo-box/combo-box.content.d.ts +12 -0
  64. package/dist/combo-box/combo-box.content.js +685 -0
  65. package/dist/combo-box/combo-box.d.ts +2 -0
  66. package/dist/combo-box/combo-box.js +17 -0
  67. package/dist/combo-box/dropdown-item.d.ts +2 -0
  68. package/dist/combo-box/dropdown-item.js +154 -0
  69. package/dist/combo-box/dropdown-item.test.d.ts +1 -0
  70. package/dist/combo-box/dropdown-item.test.js +88 -0
  71. package/dist/combo-box/types.d.ts +18 -0
  72. package/dist/combo-box/types.js +1 -0
  73. package/dist/common/types.d.ts +7 -0
  74. package/dist/common/types.js +1 -0
  75. package/dist/container/container.d.ts +16 -0
  76. package/dist/container/container.js +37 -0
  77. package/dist/container/container.test.d.ts +1 -0
  78. package/dist/container/container.test.js +28 -0
  79. package/dist/cookie-banner/cookie-banner.content.d.ts +3 -0
  80. package/dist/cookie-banner/cookie-banner.content.js +21 -0
  81. package/dist/cookie-banner/cookie-banner.d.ts +12 -0
  82. package/dist/cookie-banner/cookie-banner.js +31 -0
  83. package/dist/cookie-banner/cookie-banner.test.d.ts +1 -0
  84. package/dist/cookie-banner/cookie-banner.test.js +20 -0
  85. package/dist/details/details.d.ts +4 -0
  86. package/dist/details/details.js +55 -0
  87. package/dist/details/details.test.d.ts +1 -0
  88. package/dist/details/details.test.js +50 -0
  89. package/dist/drawer/drawer.content.d.ts +3 -0
  90. package/dist/drawer/drawer.content.js +68 -0
  91. package/dist/drawer/drawer.d.ts +26 -0
  92. package/dist/drawer/drawer.js +48 -0
  93. package/dist/drawer/drawer.test.d.ts +1 -0
  94. package/dist/drawer/drawer.test.js +69 -0
  95. package/dist/error-text/error-text.d.ts +7 -0
  96. package/dist/error-text/error-text.js +40 -0
  97. package/dist/error-text/error-text.test.d.ts +1 -0
  98. package/dist/error-text/error-text.test.js +30 -0
  99. package/dist/error-text/types.d.ts +8 -0
  100. package/dist/error-text/types.js +1 -0
  101. package/dist/file-upload/file-upload.d.ts +9 -0
  102. package/dist/file-upload/file-upload.js +6 -0
  103. package/dist/footer/footer.d.ts +11 -0
  104. package/dist/footer/footer.js +108 -0
  105. package/dist/footer/footer.test.d.ts +1 -0
  106. package/dist/footer/footer.test.js +42 -0
  107. package/dist/forms/form-field-with-tag/form-field-with-tag.d.ts +24 -0
  108. package/dist/forms/form-field-with-tag/form-field-with-tag.js +50 -0
  109. package/dist/forms/form-field.d.ts +11 -0
  110. package/dist/forms/form-field.js +41 -0
  111. package/dist/forms/form.d.ts +4 -0
  112. package/dist/forms/form.js +5 -0
  113. package/dist/header/components/header-menu.d.ts +13 -0
  114. package/dist/header/components/header-menu.js +126 -0
  115. package/dist/header/components/header-search.d.ts +7 -0
  116. package/dist/header/components/header-search.js +59 -0
  117. package/dist/header/components/header-slot.d.ts +12 -0
  118. package/dist/header/components/header-slot.js +129 -0
  119. package/dist/header/header.d.ts +2 -0
  120. package/dist/header/header.js +201 -0
  121. package/dist/header/header.test.d.ts +1 -0
  122. package/dist/header/header.test.js +95 -0
  123. package/dist/header/helper.d.ts +2 -0
  124. package/dist/header/helper.js +79 -0
  125. package/dist/header/types.d.ts +76 -0
  126. package/dist/header/types.js +1 -0
  127. package/dist/heading/heading.d.ts +82 -0
  128. package/dist/heading/heading.js +50 -0
  129. package/dist/hint-text/hint-text.d.ts +7 -0
  130. package/dist/hint-text/hint-text.js +30 -0
  131. package/dist/hint-text/hint-text.test.d.ts +1 -0
  132. package/dist/hint-text/hint-text.test.js +31 -0
  133. package/dist/hint-text/types.d.ts +7 -0
  134. package/dist/hint-text/types.js +1 -0
  135. package/dist/hooks/use-breakpoint.d.ts +12 -0
  136. package/dist/hooks/use-breakpoint.js +24 -0
  137. package/dist/hooks/use-dom-id.d.ts +1 -0
  138. package/dist/hooks/use-dom-id.js +8 -0
  139. package/dist/i18n/config.d.ts +7 -0
  140. package/dist/i18n/config.js +13 -0
  141. package/dist/i18n/utility.d.ts +1 -0
  142. package/dist/i18n/utility.js +5 -0
  143. package/dist/i18next-DxWa09nx.js +1395 -0
  144. package/dist/icon/icon.d.ts +15 -0
  145. package/dist/icon/icon.js +173 -0
  146. package/dist/icon/icon.test.d.ts +1 -0
  147. package/dist/icon/icon.test.js +53 -0
  148. package/dist/icon/icons.d.ts +2 -0
  149. package/dist/icon/icons.js +144 -0
  150. package/dist/icon/svg.d.ts +7 -0
  151. package/dist/icon/svg.js +22 -0
  152. package/dist/icon/svgs/bluesky.d.ts +5 -0
  153. package/dist/icon/svgs/bluesky.js +24 -0
  154. package/dist/icon/svgs/facebook.d.ts +5 -0
  155. package/dist/icon/svgs/facebook.js +24 -0
  156. package/dist/icon/svgs/instagram.d.ts +5 -0
  157. package/dist/icon/svgs/instagram.js +24 -0
  158. package/dist/icon/svgs/linkedin.d.ts +5 -0
  159. package/dist/icon/svgs/linkedin.js +24 -0
  160. package/dist/icon/svgs/placeholder.d.ts +5 -0
  161. package/dist/icon/svgs/placeholder.js +30 -0
  162. package/dist/icon/svgs/threads.d.ts +5 -0
  163. package/dist/icon/svgs/threads.js +24 -0
  164. package/dist/icon/svgs/tiktok.d.ts +5 -0
  165. package/dist/icon/svgs/tiktok.js +24 -0
  166. package/dist/icon/svgs/x.d.ts +5 -0
  167. package/dist/icon/svgs/x.js +24 -0
  168. package/dist/icon/svgs/youtube.d.ts +5 -0
  169. package/dist/icon/svgs/youtube.js +29 -0
  170. package/dist/icon-button/icon-button.d.ts +10 -0
  171. package/dist/icon-button/icon-button.js +43 -0
  172. package/dist/icon-button/icon-button.test.d.ts +1 -0
  173. package/dist/icon-button/icon-button.test.js +56 -0
  174. package/dist/index-DNkhmzZp.js +2419 -0
  175. package/dist/index-ntYL1VRC.js +64 -0
  176. package/dist/index.d.ts +102 -0
  177. package/dist/index.js +190 -0
  178. package/dist/input-checkbox/input-checkbox.d.ts +3 -0
  179. package/dist/input-checkbox/input-checkbox.js +51 -0
  180. package/dist/input-checkbox/types.d.ts +12 -0
  181. package/dist/input-checkbox/types.js +8 -0
  182. package/dist/input-checkbox-group/input-checkbox-group.d.ts +2 -0
  183. package/dist/input-checkbox-group/input-checkbox-group.js +24 -0
  184. package/dist/input-checkbox-group/types.d.ts +7 -0
  185. package/dist/input-checkbox-group/types.js +1 -0
  186. package/dist/input-file/input-file.d.ts +2 -0
  187. package/dist/input-file/input-file.js +20 -0
  188. package/dist/input-file/types.d.ts +1 -0
  189. package/dist/input-file/types.js +1 -0
  190. package/dist/input-password/input-password.d.ts +2 -0
  191. package/dist/input-password/input-password.js +30 -0
  192. package/dist/input-password/input-password.test.d.ts +1 -0
  193. package/dist/input-password/input-password.test.js +16 -0
  194. package/dist/input-password/types.d.ts +2 -0
  195. package/dist/input-password/types.js +1 -0
  196. package/dist/input-radio/input-radio.d.ts +3 -0
  197. package/dist/input-radio/input-radio.js +68 -0
  198. package/dist/input-radio/types.d.ts +14 -0
  199. package/dist/input-radio/types.js +8 -0
  200. package/dist/input-radio-group/input-radio-group.d.ts +3 -0
  201. package/dist/input-radio-group/input-radio-group.js +28 -0
  202. package/dist/input-radio-group/types.d.ts +5 -0
  203. package/dist/input-radio-group/types.js +1 -0
  204. package/dist/input-text/input-text.d.ts +19 -0
  205. package/dist/input-text/input-text.js +140 -0
  206. package/dist/input-text/type.d.ts +27 -0
  207. package/dist/input-text/type.js +1 -0
  208. package/dist/label/label.d.ts +11 -0
  209. package/dist/label/label.js +27 -0
  210. package/dist/label/label.test.d.ts +1 -0
  211. package/dist/label/label.test.js +49 -0
  212. package/dist/label/types.d.ts +7 -0
  213. package/dist/label/types.js +1 -0
  214. package/dist/link/link.d.ts +47 -0
  215. package/dist/link/link.js +104 -0
  216. package/dist/link/link.test.d.ts +1 -0
  217. package/dist/link/link.test.js +66 -0
  218. package/dist/list/list.d.ts +13 -0
  219. package/dist/list/list.js +44 -0
  220. package/dist/list/list.test.d.ts +1 -0
  221. package/dist/list/list.test.js +67 -0
  222. package/dist/list-item/list-item.d.ts +9 -0
  223. package/dist/list-item/list-item.js +19 -0
  224. package/dist/modal/modal.content.d.ts +2 -0
  225. package/dist/modal/modal.content.js +19 -0
  226. package/dist/modal/modal.d.ts +11 -0
  227. package/dist/modal/modal.js +222 -0
  228. package/dist/modal/modal.test.d.ts +1 -0
  229. package/dist/modal/modal.test.js +81 -0
  230. package/dist/modal/types.d.ts +39 -0
  231. package/dist/modal/types.js +1 -0
  232. package/dist/pagination/pagination.d.ts +8 -0
  233. package/dist/pagination/pagination.js +104 -0
  234. package/dist/pagination/pagination.test.d.ts +1 -0
  235. package/dist/pagination/pagination.test.js +95 -0
  236. package/dist/paragraph/paragraph.d.ts +17 -0
  237. package/dist/paragraph/paragraph.js +60 -0
  238. package/dist/paragraph/paragraph.test.d.ts +1 -0
  239. package/dist/paragraph/paragraph.test.js +63 -0
  240. package/dist/phase-banner/phase-banner.d.ts +5 -0
  241. package/dist/phase-banner/phase-banner.js +10 -0
  242. package/dist/phase-banner/phase-banner.test.d.ts +1 -0
  243. package/dist/phase-banner/phase-banner.test.js +27 -0
  244. package/dist/popover/popover.d.ts +2 -0
  245. package/dist/popover/popover.js +946 -0
  246. package/dist/popover/types.d.ts +10 -0
  247. package/dist/popover/types.js +1 -0
  248. package/dist/primitives/anchor.d.ts +7 -0
  249. package/dist/primitives/anchor.js +14 -0
  250. package/dist/primitives/anchor.test.d.ts +1 -0
  251. package/dist/primitives/anchor.test.js +39 -0
  252. package/dist/primitives/input.d.ts +3 -0
  253. package/dist/primitives/input.js +9 -0
  254. package/dist/progress-bar/progress-bar.d.ts +7 -0
  255. package/dist/progress-bar/progress-bar.js +40 -0
  256. package/dist/progress-bar/progress-bar.test.d.ts +1 -0
  257. package/dist/progress-bar/progress-bar.test.js +34 -0
  258. package/dist/progress-stepper/progress-stepper.d.ts +5 -0
  259. package/dist/progress-stepper/progress-stepper.js +198 -0
  260. package/dist/progress-stepper/progress-stepper.test.d.ts +1 -0
  261. package/dist/progress-stepper/progress-stepper.test.js +117 -0
  262. package/dist/progress-stepper/types.d.ts +49 -0
  263. package/dist/progress-stepper/types.js +7 -0
  264. package/dist/radio/radio-group.d.ts +4 -0
  265. package/dist/radio/radio-group.js +7 -0
  266. package/dist/radio/radio.d.ts +4 -0
  267. package/dist/radio/radio.js +7 -0
  268. package/dist/radio/types.d.ts +14 -0
  269. package/dist/radio/types.js +5 -0
  270. package/dist/score-select/score-select.d.ts +3 -0
  271. package/dist/score-select/score-select.js +124 -0
  272. package/dist/score-select/type.d.ts +14 -0
  273. package/dist/score-select/type.js +1 -0
  274. package/dist/section-break/section-break.d.ts +7 -0
  275. package/dist/section-break/section-break.js +38 -0
  276. package/dist/section-break/section-break.test.d.ts +1 -0
  277. package/dist/section-break/section-break.test.js +36 -0
  278. package/dist/select/select-menu.d.ts +7 -0
  279. package/dist/select/select-menu.js +141 -0
  280. package/dist/select/select-native.d.ts +5 -0
  281. package/dist/select/select-native.js +27 -0
  282. package/dist/select/select-next.d.ts +5 -0
  283. package/dist/select/select-next.js +162 -0
  284. package/dist/select/select.d.ts +5 -0
  285. package/dist/select/select.js +10 -0
  286. package/dist/select/types.d.ts +62 -0
  287. package/dist/select/types.js +1 -0
  288. package/dist/side-nav/side-nav.d.ts +6 -0
  289. package/dist/side-nav/side-nav.js +171 -0
  290. package/dist/side-nav/types.d.ts +18 -0
  291. package/dist/side-nav/types.js +1 -0
  292. package/dist/spinner/spinner.d.ts +35 -0
  293. package/dist/spinner/spinner.js +84 -0
  294. package/dist/spinner/spinner.test.d.ts +1 -0
  295. package/dist/spinner/spinner.test.js +11 -0
  296. package/dist/stack/stack.d.ts +3 -0
  297. package/dist/stack/stack.js +186 -0
  298. package/dist/stack/stack.test.d.ts +1 -0
  299. package/dist/stack/stack.test.js +44 -0
  300. package/dist/stack/types.d.ts +32 -0
  301. package/dist/stack/types.js +1 -0
  302. package/dist/styles.css +3 -0
  303. package/dist/summary-list/summary-list.d.ts +14 -0
  304. package/dist/summary-list/summary-list.js +46 -0
  305. package/dist/summary-list/summary-list.test.d.ts +1 -0
  306. package/dist/summary-list/summary-list.test.js +56 -0
  307. package/dist/summary-list/types.d.ts +20 -0
  308. package/dist/summary-list/types.js +1 -0
  309. package/dist/table/caption.d.ts +5 -0
  310. package/dist/table/caption.js +15 -0
  311. package/dist/table/column-group.d.ts +2 -0
  312. package/dist/table/column-group.js +10 -0
  313. package/dist/table/column.d.ts +2 -0
  314. package/dist/table/column.js +10 -0
  315. package/dist/table/table-body.d.ts +2 -0
  316. package/dist/table/table-body.js +10 -0
  317. package/dist/table/table-content.d.ts +1 -0
  318. package/dist/table/table-content.js +26 -0
  319. package/dist/table/table-data.d.ts +8 -0
  320. package/dist/table/table-data.js +35 -0
  321. package/dist/table/table-foot.d.ts +2 -0
  322. package/dist/table/table-foot.js +10 -0
  323. package/dist/table/table-head.d.ts +2 -0
  324. package/dist/table/table-head.js +10 -0
  325. package/dist/table/table-header.d.ts +8 -0
  326. package/dist/table/table-header.js +35 -0
  327. package/dist/table/table-row.d.ts +2 -0
  328. package/dist/table/table-row.js +10 -0
  329. package/dist/table/table.d.ts +25 -0
  330. package/dist/table/table.js +33 -0
  331. package/dist/table/table.test.d.ts +1 -0
  332. package/dist/table/table.test.js +18 -0
  333. package/dist/tabs/tab-item.d.ts +17 -0
  334. package/dist/tabs/tab-item.js +42 -0
  335. package/dist/tabs/tab-list.d.ts +5 -0
  336. package/dist/tabs/tab-list.js +62 -0
  337. package/dist/tabs/tab-panel.d.ts +7 -0
  338. package/dist/tabs/tab-panel.js +22 -0
  339. package/dist/tabs/tabs-content.d.ts +1 -0
  340. package/dist/tabs/tabs-content.js +17 -0
  341. package/dist/tabs/tabs.d.ts +7 -0
  342. package/dist/tabs/tabs.js +24 -0
  343. package/dist/tabs/tabs.test.d.ts +1 -0
  344. package/dist/tabs/tabs.test.js +44 -0
  345. package/dist/tag/tag.d.ts +19 -0
  346. package/dist/tag/tag.js +27 -0
  347. package/dist/tag/tag.test.d.ts +1 -0
  348. package/dist/tag/tag.test.js +40 -0
  349. package/dist/test-utilities-BS7B3BF-.js +34112 -0
  350. package/dist/test-utilities.d.ts +8 -0
  351. package/dist/test-utilities.js +87 -0
  352. package/dist/text-input/text-input.d.ts +23 -0
  353. package/dist/text-input/text-input.js +7 -0
  354. package/dist/textarea/textarea.d.ts +13 -0
  355. package/dist/textarea/textarea.js +98 -0
  356. package/dist/toast/ds-toast.d.ts +82 -0
  357. package/dist/toast/ds-toast.js +116 -0
  358. package/dist/toast/toast.d.ts +6 -0
  359. package/dist/toast/toast.js +125 -0
  360. package/dist/toast/toast.test.d.ts +1 -0
  361. package/dist/toast/toast.test.js +44 -0
  362. package/dist/toast/types.d.ts +24 -0
  363. package/dist/toast/types.js +1 -0
  364. package/dist/tooltip/tooltip.d.ts +10 -0
  365. package/dist/tooltip/tooltip.js +67 -0
  366. package/dist/tooltip/tooltip.test.d.ts +1 -0
  367. package/dist/tooltip/tooltip.test.js +85 -0
  368. package/dist/utilities.d.ts +9 -0
  369. package/dist/utilities.js +13 -0
  370. package/dist/utils/utilities.d.ts +24 -0
  371. package/dist/utils/utilities.js +20 -0
  372. package/dist/utils/utilities.test.d.ts +1 -0
  373. package/dist/utils/utilities.test.js +79 -0
  374. package/package.json +4 -5
@@ -0,0 +1,2982 @@
1
+ import { jsxs as Ce, jsx as te } from "react/jsx-runtime";
2
+ import { g as L, c as Qt, r as Ke } from "../test-utilities-BS7B3BF-.js";
3
+ import { ButtonGroup as Re, ButtonGroupItem as ne } from "./button-group.js";
4
+ function l(e, t, n) {
5
+ return e.namespaceURI && e.namespaceURI !== "http://www.w3.org/1999/xhtml" || (t = Array.isArray(t) ? t : [
6
+ t
7
+ ], !t.includes(e.tagName.toLowerCase())) ? !1 : n ? Object.entries(n).every(([i, r]) => e[i] === r) : !0;
8
+ }
9
+ var Ae;
10
+ (function(e) {
11
+ e.button = "button", e.color = "color", e.file = "file", e.image = "image", e.reset = "reset", e.submit = "submit", e.checkbox = "checkbox", e.radio = "radio";
12
+ })(Ae || (Ae = {}));
13
+ function ft(e) {
14
+ return l(e, "button") || l(e, "input") && e.type in Ae;
15
+ }
16
+ function w(e) {
17
+ var t;
18
+ if (Zt(e) && e.defaultView)
19
+ return e.defaultView;
20
+ if (!((t = e.ownerDocument) === null || t === void 0) && t.defaultView)
21
+ return e.ownerDocument.defaultView;
22
+ throw new Error(`Could not determine window of node. Node was ${Yt(e)}`);
23
+ }
24
+ function Zt(e) {
25
+ return e.nodeType === 9;
26
+ }
27
+ function Yt(e) {
28
+ return typeof e == "function" ? `function ${e.name}` : e === null ? "null" : String(e);
29
+ }
30
+ function pt(e, t) {
31
+ return new Promise((n, i) => {
32
+ const r = new t();
33
+ r.onerror = i, r.onabort = i, r.onload = () => {
34
+ n(String(r.result));
35
+ }, r.readAsText(e);
36
+ });
37
+ }
38
+ function Ne(e, t) {
39
+ const n = {
40
+ ...t,
41
+ length: t.length,
42
+ item: (i) => n[i],
43
+ [Symbol.iterator]: function* () {
44
+ for (let r = 0; r < n.length; r++)
45
+ yield n[r];
46
+ }
47
+ };
48
+ return n.constructor = e.FileList, e.FileList && Object.setPrototypeOf(n, e.FileList.prototype), Object.freeze(n), n;
49
+ }
50
+ function P(e, t, n) {
51
+ return t in e ? Object.defineProperty(e, t, {
52
+ value: n,
53
+ enumerable: !0,
54
+ configurable: !0,
55
+ writable: !0
56
+ }) : e[t] = n, e;
57
+ }
58
+ class ht {
59
+ getAsFile() {
60
+ return this.file;
61
+ }
62
+ getAsString(t) {
63
+ typeof this.data == "string" && t(this.data);
64
+ }
65
+ /* istanbul ignore next */
66
+ webkitGetAsEntry() {
67
+ throw new Error("not implemented");
68
+ }
69
+ constructor(t, n) {
70
+ P(this, "kind", void 0), P(this, "type", void 0), P(this, "file", null), P(this, "data", void 0), typeof t == "string" ? (this.kind = "string", this.type = String(n), this.data = t) : (this.kind = "file", this.type = t.type, this.file = t);
71
+ }
72
+ }
73
+ class en extends Array {
74
+ add(...t) {
75
+ const n = new ht(t[0], t[1]);
76
+ return this.push(n), n;
77
+ }
78
+ clear() {
79
+ this.splice(0, this.length);
80
+ }
81
+ remove(t) {
82
+ this.splice(t, 1);
83
+ }
84
+ }
85
+ function ie(e, t) {
86
+ const [n, i] = e.split("/"), r = !i || i === "*";
87
+ return (o) => t ? o.type === (r ? n : e) : r ? o.type.startsWith(`${n}/`) : o.type === n;
88
+ }
89
+ function tn(e) {
90
+ return new class {
91
+ getData(n) {
92
+ var i;
93
+ const r = (i = this.items.find(ie(n, !0))) !== null && i !== void 0 ? i : this.items.find(ie(n, !1));
94
+ let o = "";
95
+ return r == null || r.getAsString((s) => {
96
+ o = s;
97
+ }), o;
98
+ }
99
+ setData(n, i) {
100
+ const r = this.items.findIndex(ie(n, !0)), o = new ht(i, n);
101
+ r >= 0 ? this.items.splice(r, 1, o) : this.items.push(o);
102
+ }
103
+ clearData(n) {
104
+ if (n) {
105
+ const i = this.items.findIndex(ie(n, !0));
106
+ i >= 0 && this.items.remove(i);
107
+ } else
108
+ this.items.clear();
109
+ }
110
+ get types() {
111
+ const n = [];
112
+ return this.files.length && n.push("Files"), this.items.forEach((i) => n.push(i.type)), Object.freeze(n), n;
113
+ }
114
+ /* istanbul ignore next */
115
+ setDragImage() {
116
+ }
117
+ constructor() {
118
+ P(this, "dropEffect", "none"), P(this, "effectAllowed", "uninitialized"), P(this, "items", new en()), P(this, "files", Ne(e, []));
119
+ }
120
+ }();
121
+ }
122
+ function Me(e, t = []) {
123
+ const n = typeof e.DataTransfer > "u" ? tn(e) : (
124
+ /* istanbul ignore next */
125
+ new e.DataTransfer()
126
+ );
127
+ return Object.defineProperty(n, "files", {
128
+ get: () => Ne(e, t)
129
+ }), n;
130
+ }
131
+ function nn(e, t) {
132
+ if (t.kind === "file")
133
+ return t.getAsFile();
134
+ let n = "";
135
+ return t.getAsString((i) => {
136
+ n = i;
137
+ }), new e.Blob([
138
+ n
139
+ ], {
140
+ type: t.type
141
+ });
142
+ }
143
+ function bt(e, t, n) {
144
+ return t in e ? Object.defineProperty(e, t, {
145
+ value: n,
146
+ enumerable: !0,
147
+ configurable: !0,
148
+ writable: !0
149
+ }) : e[t] = n, e;
150
+ }
151
+ function vt(e, ...t) {
152
+ const n = Object.fromEntries(t.map((i) => [
153
+ typeof i == "string" ? "text/plain" : i.type,
154
+ Promise.resolve(i)
155
+ ]));
156
+ return typeof e.ClipboardItem < "u" ? new e.ClipboardItem(n) : new class {
157
+ get types() {
158
+ return Array.from(Object.keys(this.data));
159
+ }
160
+ async getType(r) {
161
+ const o = await this.data[r];
162
+ if (!o)
163
+ throw new Error(`${r} is not one of the available MIME types on this item.`);
164
+ return o instanceof e.Blob ? o : new e.Blob([
165
+ o
166
+ ], {
167
+ type: r
168
+ });
169
+ }
170
+ constructor(r) {
171
+ bt(this, "data", void 0), this.data = r;
172
+ }
173
+ }(n);
174
+ }
175
+ const F = Symbol("Manage ClipboardSub");
176
+ function je(e, t) {
177
+ return Object.assign(new class extends e.EventTarget {
178
+ async read() {
179
+ return Array.from(this.items);
180
+ }
181
+ async readText() {
182
+ let i = "";
183
+ for (const r of this.items) {
184
+ const o = r.types.includes("text/plain") ? "text/plain" : r.types.find((s) => s.startsWith("text/"));
185
+ o && (i += await r.getType(o).then((s) => pt(s, e.FileReader)));
186
+ }
187
+ return i;
188
+ }
189
+ async write(i) {
190
+ this.items = i;
191
+ }
192
+ async writeText(i) {
193
+ this.items = [
194
+ vt(e, i)
195
+ ];
196
+ }
197
+ constructor(...i) {
198
+ super(...i), bt(this, "items", []);
199
+ }
200
+ }(), {
201
+ [F]: t
202
+ });
203
+ }
204
+ function Le(e) {
205
+ return !!(e != null && e[F]);
206
+ }
207
+ function rn(e) {
208
+ if (Le(e.navigator.clipboard))
209
+ return e.navigator.clipboard[F];
210
+ const t = Object.getOwnPropertyDescriptor(e.navigator, "clipboard");
211
+ let n;
212
+ const i = {
213
+ resetClipboardStub: () => {
214
+ n = je(e, i);
215
+ },
216
+ detachClipboardStub: () => {
217
+ t ? Object.defineProperty(e.navigator, "clipboard", t) : Object.defineProperty(e.navigator, "clipboard", {
218
+ value: void 0,
219
+ configurable: !0
220
+ });
221
+ }
222
+ };
223
+ return n = je(e, i), Object.defineProperty(e.navigator, "clipboard", {
224
+ get: () => n,
225
+ configurable: !0
226
+ }), n[F];
227
+ }
228
+ function on(e) {
229
+ Le(e.navigator.clipboard) && e.navigator.clipboard[F].resetClipboardStub();
230
+ }
231
+ function sn(e) {
232
+ Le(e.navigator.clipboard) && e.navigator.clipboard[F].detachClipboardStub();
233
+ }
234
+ async function un(e) {
235
+ const t = e.defaultView, n = t == null ? void 0 : t.navigator.clipboard, i = n && await n.read();
236
+ if (!i)
237
+ throw new Error("The Clipboard API is unavailable.");
238
+ const r = Me(t);
239
+ for (const o of i)
240
+ for (const s of o.types)
241
+ r.setData(s, await o.getType(s).then((u) => pt(u, t.FileReader)));
242
+ return r;
243
+ }
244
+ async function gt(e, t) {
245
+ const n = w(e), i = n.navigator.clipboard, r = [];
246
+ for (let s = 0; s < t.items.length; s++) {
247
+ const u = t.items[s], c = nn(n, u);
248
+ r.push(vt(n, c));
249
+ }
250
+ if (!(i && await i.write(r).then(
251
+ () => !0,
252
+ // Can happen with other implementations that e.g. require permissions
253
+ /* istanbul ignore next */
254
+ () => !1
255
+ )))
256
+ throw new Error("The Clipboard API is unavailable.");
257
+ }
258
+ const de = globalThis;
259
+ typeof de.afterEach == "function" && de.afterEach(() => on(globalThis.window));
260
+ typeof de.afterAll == "function" && de.afterAll(() => sn(globalThis.window));
261
+ function U(e) {
262
+ return e.hasAttribute("contenteditable") && (e.getAttribute("contenteditable") == "true" || e.getAttribute("contenteditable") == "");
263
+ }
264
+ function Q(e) {
265
+ const t = cn(e);
266
+ return t && (t.closest('[contenteditable=""]') || t.closest('[contenteditable="true"]'));
267
+ }
268
+ function cn(e) {
269
+ return e.nodeType === 1 ? e : e.parentElement;
270
+ }
271
+ function K(e) {
272
+ return mt(e) && !e.readOnly || U(e);
273
+ }
274
+ var Oe;
275
+ (function(e) {
276
+ e.text = "text", e.date = "date", e["datetime-local"] = "datetime-local", e.email = "email", e.month = "month", e.number = "number", e.password = "password", e.search = "search", e.tel = "tel", e.time = "time", e.url = "url", e.week = "week";
277
+ })(Oe || (Oe = {}));
278
+ function mt(e) {
279
+ return l(e, "textarea") || l(e, "input") && e.type in Oe;
280
+ }
281
+ var xe;
282
+ (function(e) {
283
+ e.email = "email", e.password = "password", e.search = "search", e.telephone = "telephone", e.text = "text", e.url = "url";
284
+ })(xe || (xe = {}));
285
+ function an(e) {
286
+ var t;
287
+ const n = (t = e.getAttribute("maxlength")) !== null && t !== void 0 ? t : "";
288
+ return /^\d+$/.test(n) && Number(n) >= 0 ? Number(n) : void 0;
289
+ }
290
+ function dn(e) {
291
+ return l(e, "textarea") || l(e, "input") && e.type in xe;
292
+ }
293
+ const yt = [
294
+ "input:not([type=hidden]):not([disabled])",
295
+ "button:not([disabled])",
296
+ "select:not([disabled])",
297
+ "textarea:not([disabled])",
298
+ '[contenteditable=""]',
299
+ '[contenteditable="true"]',
300
+ "a[href]",
301
+ "[tabindex]:not([disabled])"
302
+ ].join(", ");
303
+ function $e(e) {
304
+ return e.matches(yt);
305
+ }
306
+ var le;
307
+ (function(e) {
308
+ e["{"] = "}", e["["] = "]";
309
+ })(le || (le = {}));
310
+ function Et(e, t) {
311
+ let n = 0;
312
+ const i = e[n] in le ? e[n] : "";
313
+ n += i.length;
314
+ const o = new RegExp(`^\\${i}{2}`).test(e) ? "" : i;
315
+ return {
316
+ type: o,
317
+ ...o === "" ? ln(e, n, t) : fn(e, n, o, t)
318
+ };
319
+ }
320
+ function ln(e, t, n) {
321
+ const i = e[t];
322
+ return wt(i, e, t, n), t += i.length, {
323
+ consumedLength: t,
324
+ descriptor: i,
325
+ releasePrevious: !1,
326
+ releaseSelf: !0,
327
+ repeat: 1
328
+ };
329
+ }
330
+ function fn(e, t, n, i) {
331
+ var r, o;
332
+ const s = e[t] === "/" ? "/" : "";
333
+ t += s.length;
334
+ const u = n === "{" && e[t] === "\\";
335
+ t += Number(u);
336
+ const c = u ? e[t] : (r = e.slice(t).match(n === "{" ? /^\w+|^[^}>/]/ : /^\w+/)) === null || r === void 0 ? void 0 : r[0];
337
+ wt(c, e, t, i), t += c.length;
338
+ var a;
339
+ const d = (a = (o = e.slice(t).match(/^>\d+/)) === null || o === void 0 ? void 0 : o[0]) !== null && a !== void 0 ? a : "";
340
+ t += d.length;
341
+ const f = e[t] === "/" || !d && e[t] === ">" ? e[t] : "";
342
+ t += f.length;
343
+ const p = le[n], b = e[t] === p ? p : "";
344
+ if (!b)
345
+ throw new Error(Tt([
346
+ !d && "repeat modifier",
347
+ !f && "release modifier",
348
+ `"${p}"`
349
+ ].filter(Boolean).join(" or "), e[t], e, i));
350
+ return t += b.length, {
351
+ consumedLength: t,
352
+ descriptor: c,
353
+ releasePrevious: !!s,
354
+ repeat: d ? Math.max(Number(d.substr(1)), 1) : 1,
355
+ releaseSelf: pn(f, d)
356
+ };
357
+ }
358
+ function wt(e, t, n, i) {
359
+ if (!e)
360
+ throw new Error(Tt("key descriptor", t[n], t, i));
361
+ }
362
+ function pn(e, t) {
363
+ if (e)
364
+ return e === "/";
365
+ if (t)
366
+ return !1;
367
+ }
368
+ function Tt(e, t, n, i) {
369
+ return `Expected ${e} but found "${t ?? ""}" in "${n}"
370
+ See ${i === "pointer" ? "https://testing-library.com/docs/user-event/pointer#pressing-a-button-or-touching-the-screen" : "https://testing-library.com/docs/user-event/keyboard"}
371
+ for more information about how userEvent parses your input.`;
372
+ }
373
+ function hn(e) {
374
+ return new e.constructor(e.type, e);
375
+ }
376
+ var g;
377
+ (function(e) {
378
+ e[e.Trigger = 2] = "Trigger", e[e.Call = 1] = "Call";
379
+ })(g || (g = {}));
380
+ function W(e, t) {
381
+ e.levelRefs[t] = {};
382
+ }
383
+ function re(e, t) {
384
+ return e.levelRefs[t];
385
+ }
386
+ var B;
387
+ (function(e) {
388
+ e[e.EachTrigger = 4] = "EachTrigger", e[e.EachApiCall = 2] = "EachApiCall", e[e.EachTarget = 1] = "EachTarget", e[e.Never = 0] = "Never";
389
+ })(B || (B = {}));
390
+ function I(e) {
391
+ for (let n = e; n; n = n.parentElement)
392
+ if (l(n, [
393
+ "button",
394
+ "input",
395
+ "select",
396
+ "textarea",
397
+ "optgroup",
398
+ "option"
399
+ ])) {
400
+ if (n.hasAttribute("disabled"))
401
+ return !0;
402
+ } else if (l(n, "fieldset")) {
403
+ var t;
404
+ if (n.hasAttribute("disabled") && !(!((t = n.querySelector(":scope > legend")) === null || t === void 0) && t.contains(e)))
405
+ return !0;
406
+ } else if (n.tagName.includes("-") && n.constructor.formAssociated && n.hasAttribute("disabled"))
407
+ return !0;
408
+ return !1;
409
+ }
410
+ function be(e) {
411
+ const t = e.activeElement;
412
+ return t != null && t.shadowRoot ? be(t.shadowRoot) : I(t) ? e.ownerDocument ? (
413
+ /* istanbul ignore next */
414
+ e.ownerDocument.body
415
+ ) : e.body : t;
416
+ }
417
+ function Ie(e) {
418
+ var t;
419
+ return (t = be(e)) !== null && t !== void 0 ? t : (
420
+ /* istanbul ignore next */
421
+ e.body
422
+ );
423
+ }
424
+ function bn(e, t) {
425
+ let n = e;
426
+ do {
427
+ if (t(n))
428
+ return n;
429
+ n = n.parentElement;
430
+ } while (n && n !== e.ownerDocument.body);
431
+ }
432
+ function T(e) {
433
+ return kt(e) && mt(e);
434
+ }
435
+ function vn(e) {
436
+ return kt(e) && ft(e);
437
+ }
438
+ function kt(e) {
439
+ return e.nodeType === 1;
440
+ }
441
+ function gn(e) {
442
+ const t = e.ownerDocument.getSelection();
443
+ if (t != null && t.focusNode && T(e)) {
444
+ const i = Q(t.focusNode);
445
+ if (i) {
446
+ if (!t.isCollapsed) {
447
+ var n;
448
+ const r = ((n = i.firstChild) === null || n === void 0 ? void 0 : n.nodeType) === 3 ? i.firstChild : i;
449
+ t.setBaseAndExtent(r, 0, r, 0);
450
+ }
451
+ } else
452
+ t.setBaseAndExtent(e, 0, e, 0);
453
+ }
454
+ }
455
+ function R(e, t) {
456
+ return L().eventWrapper(e);
457
+ }
458
+ function A(e) {
459
+ const t = bn(e, $e), n = be(e.ownerDocument);
460
+ (t ?? e.ownerDocument.body) !== n && (R(t ? () => t.focus() : () => n == null ? void 0 : n.blur()), gn(t ?? e.ownerDocument.body));
461
+ }
462
+ function mn(e) {
463
+ !$e(e) || !(be(e.ownerDocument) === e) || R(() => e.blur());
464
+ }
465
+ const O = {};
466
+ O.click = (e, t, n) => {
467
+ const i = t.closest("button,input,label,select,textarea"), r = i && l(i, "label") && i.control;
468
+ if (r)
469
+ return () => {
470
+ $e(r) && A(r), n.dispatchEvent(r, hn(e));
471
+ };
472
+ if (l(t, "input", {
473
+ type: "file"
474
+ }))
475
+ return () => {
476
+ mn(t), t.dispatchEvent(new (w(t)).Event("fileDialog")), A(t);
477
+ };
478
+ };
479
+ const j = Symbol("Displayed value in UI"), C = Symbol("Displayed selection in UI"), fe = Symbol("Initial value to compare on blur");
480
+ function yn(e) {
481
+ return typeof e == "object" && j in e;
482
+ }
483
+ function En(e) {
484
+ return !!e && typeof e == "object" && C in e;
485
+ }
486
+ function wn(e, t) {
487
+ e[fe] === void 0 && (e[fe] = e.value), e[j] = t, e.value = Object.assign(new String(t), {
488
+ [j]: !0
489
+ });
490
+ }
491
+ function k(e) {
492
+ return e[j] === void 0 ? e.value : String(e[j]);
493
+ }
494
+ function Be(e) {
495
+ e[j] = void 0;
496
+ }
497
+ function Ct(e) {
498
+ e[fe] = void 0;
499
+ }
500
+ function Tn(e) {
501
+ return e[fe];
502
+ }
503
+ function kn(e, t) {
504
+ e[C] = t;
505
+ }
506
+ function z(e, { focusOffset: t, anchorOffset: n = t }, i = "replace") {
507
+ const r = k(e).length, o = (f) => Math.max(0, Math.min(r, f)), s = i === "replace" || e[C] === void 0 ? o(n) : e[C].anchorOffset, u = o(t), c = Math.min(s, u), a = Math.max(s, u);
508
+ if (e[C] = {
509
+ anchorOffset: s,
510
+ focusOffset: u
511
+ }, e.selectionStart === c && e.selectionEnd === a)
512
+ return;
513
+ const d = Object.assign(new Number(c), {
514
+ [C]: !0
515
+ });
516
+ try {
517
+ e.setSelectionRange(d, a);
518
+ } catch {
519
+ }
520
+ }
521
+ function Z(e) {
522
+ var t, n, i;
523
+ const r = (i = e[C]) !== null && i !== void 0 ? i : {
524
+ anchorOffset: (t = e.selectionStart) !== null && t !== void 0 ? t : 0,
525
+ focusOffset: (n = e.selectionEnd) !== null && n !== void 0 ? n : 0
526
+ };
527
+ return {
528
+ ...r,
529
+ startOffset: Math.min(r.anchorOffset, r.focusOffset),
530
+ endOffset: Math.max(r.anchorOffset, r.focusOffset)
531
+ };
532
+ }
533
+ function Cn(e) {
534
+ return !!e[C];
535
+ }
536
+ function ce(e) {
537
+ e[C] = void 0;
538
+ }
539
+ const pe = globalThis.parseInt;
540
+ function In(e) {
541
+ const t = e.replace(/\D/g, "");
542
+ if (t.length < 2)
543
+ return e;
544
+ const n = pe(t[0], 10), i = pe(t[1], 10);
545
+ if (n >= 3 || n === 2 && i >= 4) {
546
+ let r;
547
+ return n >= 3 ? r = 1 : r = 2, He(t, r);
548
+ }
549
+ return e.length === 2 ? e : He(t, 2);
550
+ }
551
+ function He(e, t) {
552
+ const n = e.slice(0, t), i = Math.min(pe(n, 10), 23), r = e.slice(t), o = pe(r, 10), s = Math.min(o, 59);
553
+ return `${i.toString().padStart(2, "0")}:${s.toString().padStart(2, "0")}`;
554
+ }
555
+ function It(e, t) {
556
+ const n = e.cloneNode();
557
+ return n.value = t, n.value === t;
558
+ }
559
+ function St(e, t, n, i) {
560
+ if (ae(e) && t + n >= 0 && t + n <= e.nodeValue.length)
561
+ return {
562
+ node: e,
563
+ offset: t + n
564
+ };
565
+ const r = Ge(e, t, n);
566
+ if (r) {
567
+ if (ae(r))
568
+ return {
569
+ node: r,
570
+ offset: n > 0 ? Math.min(1, r.nodeValue.length) : Math.max(r.nodeValue.length - 1, 0)
571
+ };
572
+ if (l(r, "br")) {
573
+ const o = Ge(r, void 0, n);
574
+ return o ? ae(o) ? {
575
+ node: o,
576
+ offset: n > 0 ? 0 : o.nodeValue.length
577
+ } : n < 0 && l(o, "br") ? {
578
+ node: r.parentNode,
579
+ offset: oe(r)
580
+ } : {
581
+ node: o.parentNode,
582
+ offset: oe(o) + (n > 0 ? 0 : 1)
583
+ } : n < 0 && i === "deleteContentBackward" ? {
584
+ node: r.parentNode,
585
+ offset: oe(r)
586
+ } : void 0;
587
+ } else
588
+ return {
589
+ node: r.parentNode,
590
+ offset: oe(r) + (n > 0 ? 1 : 0)
591
+ };
592
+ }
593
+ }
594
+ function Ge(e, t, n) {
595
+ const i = Number(t) + (n < 0 ? -1 : 0);
596
+ return t !== void 0 && Ve(e) && i >= 0 && i < e.children.length && (e = e.children[i]), _n(e, n === 1 ? "next" : "previous", Sn);
597
+ }
598
+ function Sn(e) {
599
+ if (ae(e))
600
+ return !0;
601
+ if (Ve(e)) {
602
+ if (l(e, [
603
+ "input",
604
+ "textarea"
605
+ ]))
606
+ return e.type !== "hidden";
607
+ if (l(e, "br"))
608
+ return !0;
609
+ }
610
+ return !1;
611
+ }
612
+ function oe(e) {
613
+ let t = 0;
614
+ for (; e.previousSibling; )
615
+ t++, e = e.previousSibling;
616
+ return t;
617
+ }
618
+ function Ve(e) {
619
+ return e.nodeType === 1;
620
+ }
621
+ function ae(e) {
622
+ return e.nodeType === 3;
623
+ }
624
+ function _n(e, t, n) {
625
+ for (; ; ) {
626
+ var i;
627
+ const r = e[`${t}Sibling`];
628
+ if (r) {
629
+ if (e = Pn(r, t === "next" ? "first" : "last"), n(e))
630
+ return e;
631
+ } else if (e.parentNode && (!Ve(e.parentNode) || !U(e.parentNode) && e.parentNode !== ((i = e.ownerDocument) === null || i === void 0 ? void 0 : i.body)))
632
+ e = e.parentNode;
633
+ else
634
+ break;
635
+ }
636
+ }
637
+ function Pn(e, t) {
638
+ for (; e.hasChildNodes(); )
639
+ e = e[`${t}Child`];
640
+ return e;
641
+ }
642
+ const Y = Symbol("Track programmatic changes for React workaround");
643
+ function An(e) {
644
+ return Object.getOwnPropertyNames(e).some((t) => t.startsWith("__react")) && w(e).REACT_VERSION === 17;
645
+ }
646
+ function On(e) {
647
+ An(e) && (e[Y] = {
648
+ previousValue: String(e.value),
649
+ tracked: []
650
+ });
651
+ }
652
+ function xn(e, t) {
653
+ var n, i;
654
+ (i = e[Y]) === null || i === void 0 || (n = i.tracked) === null || n === void 0 || n.push(t), e[Y] || (Be(e), z(e, {
655
+ focusOffset: t.length
656
+ }));
657
+ }
658
+ function Un(e, t) {
659
+ var n;
660
+ const i = e[Y];
661
+ if (e[Y] = void 0, !(!(i == null || (n = i.tracked) === null || n === void 0) && n.length))
662
+ return;
663
+ const r = i.tracked.length === 2 && i.tracked[0] === i.previousValue && i.tracked[1] === e.value;
664
+ r || Be(e), Cn(e) && z(e, {
665
+ focusOffset: r ? t : e.value.length
666
+ });
667
+ }
668
+ function _t(e) {
669
+ const t = Dn(e);
670
+ if (t && T(t))
671
+ return {
672
+ type: "input",
673
+ selection: Z(t)
674
+ };
675
+ const n = t == null ? void 0 : t.ownerDocument.getSelection();
676
+ return {
677
+ type: Q(e) && (n == null ? void 0 : n.anchorNode) && Q(n.anchorNode) ? "contenteditable" : "default",
678
+ selection: n
679
+ };
680
+ }
681
+ function Dn(e) {
682
+ return e.nodeType === 1 ? e : e.parentElement;
683
+ }
684
+ function Nn(e) {
685
+ const t = _t(e);
686
+ if (t.type === "input")
687
+ return t.selection;
688
+ if (t.type === "contenteditable") {
689
+ var n;
690
+ return (n = t.selection) === null || n === void 0 ? void 0 : n.getRangeAt(0);
691
+ }
692
+ }
693
+ function D({ focusNode: e, focusOffset: t, anchorNode: n = e, anchorOffset: i = t }) {
694
+ var r, o;
695
+ if (_t(e).type === "input")
696
+ return z(e, {
697
+ anchorOffset: i,
698
+ focusOffset: t
699
+ });
700
+ (o = n.ownerDocument) === null || o === void 0 || (r = o.getSelection()) === null || r === void 0 || r.setBaseAndExtent(n, i, e, t);
701
+ }
702
+ function Pt(e) {
703
+ return l(e, "input") && [
704
+ "date",
705
+ "time"
706
+ ].includes(e.type);
707
+ }
708
+ function H(e, t, n, i = "insertText") {
709
+ const r = Nn(t);
710
+ r && (!Pt(t) && !e.dispatchUIEvent(t, "beforeinput", {
711
+ inputType: i,
712
+ data: n
713
+ }) || ("startContainer" in r ? Mn(e, t, r, n, i) : Ln(e, t, r, n, i)));
714
+ }
715
+ function Mn(e, t, n, i, r) {
716
+ let o = !1;
717
+ if (!n.collapsed)
718
+ o = !0, n.deleteContents();
719
+ else if ([
720
+ "deleteContentBackward",
721
+ "deleteContentForward"
722
+ ].includes(r)) {
723
+ const s = St(n.startContainer, n.startOffset, r === "deleteContentBackward" ? -1 : 1, r);
724
+ if (s) {
725
+ o = !0;
726
+ const u = n.cloneRange();
727
+ u.comparePoint(s.node, s.offset) < 0 ? u.setStart(s.node, s.offset) : u.setEnd(s.node, s.offset), u.deleteContents();
728
+ }
729
+ }
730
+ if (i)
731
+ if (n.endContainer.nodeType === 3) {
732
+ const s = n.endOffset;
733
+ n.endContainer.insertData(s, i), n.setStart(n.endContainer, s + i.length), n.setEnd(n.endContainer, s + i.length);
734
+ } else {
735
+ const s = t.ownerDocument.createTextNode(i);
736
+ n.insertNode(s), n.setStart(s, i.length), n.setEnd(s, i.length);
737
+ }
738
+ (o || i) && e.dispatchUIEvent(t, "input", {
739
+ inputType: r
740
+ });
741
+ }
742
+ function Ln(e, t, n, i, r) {
743
+ let o = i;
744
+ if (dn(t)) {
745
+ const a = an(t);
746
+ if (a !== void 0 && i.length > 0) {
747
+ const d = a - t.value.length;
748
+ if (d > 0)
749
+ o = i.substring(0, d);
750
+ else
751
+ return;
752
+ }
753
+ }
754
+ const { newValue: s, newOffset: u, oldValue: c } = $n(o, t, n, r);
755
+ s === c && u === n.startOffset && u === n.endOffset || l(t, "input", {
756
+ type: "number"
757
+ }) && !Bn(s) || (wn(t, s), D({
758
+ focusNode: t,
759
+ anchorOffset: u,
760
+ focusOffset: u
761
+ }), Pt(t) ? It(t, s) && (ze(e, t, u, {}), e.dispatchUIEvent(t, "change"), Ct(t)) : ze(e, t, u, {
762
+ data: i,
763
+ inputType: r
764
+ }));
765
+ }
766
+ function $n(e, t, { startOffset: n, endOffset: i }, r) {
767
+ const o = k(t), s = Math.max(0, n === i && r === "deleteContentBackward" ? n - 1 : n), u = o.substring(0, s), c = Math.min(o.length, n === i && r === "deleteContentForward" ? n + 1 : i), a = o.substring(c, o.length);
768
+ let d = `${u}${e}${a}`, f = s + e.length;
769
+ if (l(t, "input", {
770
+ type: "time"
771
+ })) {
772
+ const p = In(d);
773
+ p !== "" && It(t, p) && (d = p, f = p.length);
774
+ }
775
+ return {
776
+ oldValue: o,
777
+ newValue: d,
778
+ newOffset: f
779
+ };
780
+ }
781
+ function ze(e, t, n, i) {
782
+ e.dispatchUIEvent(t, "input", i), Un(t, n);
783
+ }
784
+ function Bn(e) {
785
+ var t, n;
786
+ const i = e.split("e", 2);
787
+ return !(/[^\d.\-e]/.test(e) || Number((t = e.match(/-/g)) === null || t === void 0 ? void 0 : t.length) > 2 || Number((n = e.match(/\./g)) === null || n === void 0 ? void 0 : n.length) > 1 || i[1] && !/^-?\d*$/.test(i[1]));
788
+ }
789
+ O.cut = (e, t, n) => () => {
790
+ K(t) && H(n, t, "", "deleteByCut");
791
+ };
792
+ function Vn(e) {
793
+ return e ? U(e) ? e.textContent : k(e) : null;
794
+ }
795
+ function Fn(e) {
796
+ const t = w(e);
797
+ for (let n = e; n != null && n.ownerDocument; n = n.parentElement) {
798
+ const { display: i, visibility: r } = t.getComputedStyle(n);
799
+ if (i === "none" || r === "hidden")
800
+ return !1;
801
+ }
802
+ return !0;
803
+ }
804
+ function Kn(e, t) {
805
+ const n = e.ownerDocument, i = n.querySelectorAll(yt), r = Array.from(i).filter((c) => c === e || !(Number(c.getAttribute("tabindex")) < 0 || I(c)));
806
+ Number(e.getAttribute("tabindex")) >= 0 && r.sort((c, a) => {
807
+ const d = Number(c.getAttribute("tabindex")), f = Number(a.getAttribute("tabindex"));
808
+ return d === f ? 0 : d === 0 ? 1 : f === 0 ? -1 : d - f;
809
+ });
810
+ const o = {};
811
+ let s = [
812
+ n.body
813
+ ];
814
+ const u = l(e, "input", {
815
+ type: "radio"
816
+ }) ? e.name : void 0;
817
+ r.forEach((c) => {
818
+ const a = c;
819
+ if (l(a, "input", {
820
+ type: "radio"
821
+ }) && a.name) {
822
+ if (a === e) {
823
+ s.push(a);
824
+ return;
825
+ } else if (a.name === u)
826
+ return;
827
+ if (a.checked) {
828
+ s = s.filter((d) => !l(d, "input", {
829
+ type: "radio",
830
+ name: a.name
831
+ })), s.push(a), o[a.name] = a;
832
+ return;
833
+ }
834
+ if (typeof o[a.name] < "u")
835
+ return;
836
+ }
837
+ s.push(a);
838
+ });
839
+ for (let c = s.findIndex((a) => a === e); ; )
840
+ if (c += t ? -1 : 1, c === s.length ? c = 0 : c === -1 && (c = s.length - 1), s[c] === e || s[c] === n.body || Fn(s[c]))
841
+ return s[c];
842
+ }
843
+ function We(e, t) {
844
+ if (T(e)) {
845
+ const n = Z(e);
846
+ D({
847
+ focusNode: e,
848
+ focusOffset: n.startOffset === n.endOffset ? n.focusOffset + t : t < 0 ? n.startOffset : n.endOffset
849
+ });
850
+ } else {
851
+ const n = e.ownerDocument.getSelection();
852
+ if (!(n != null && n.focusNode))
853
+ return;
854
+ if (n.isCollapsed) {
855
+ const i = St(n.focusNode, n.focusOffset, t);
856
+ i && D({
857
+ focusNode: i.node,
858
+ focusOffset: i.offset
859
+ });
860
+ } else
861
+ n[t < 0 ? "collapseToStart" : "collapseToEnd"]();
862
+ }
863
+ }
864
+ function At(e) {
865
+ if (T(e))
866
+ return D({
867
+ focusNode: e,
868
+ anchorOffset: 0,
869
+ focusOffset: k(e).length
870
+ });
871
+ var t;
872
+ const n = (t = Q(e)) !== null && t !== void 0 ? t : e.ownerDocument.body;
873
+ D({
874
+ focusNode: n,
875
+ anchorOffset: 0,
876
+ focusOffset: n.childNodes.length
877
+ });
878
+ }
879
+ function Rn(e) {
880
+ if (T(e))
881
+ return Z(e).startOffset === 0 && Z(e).endOffset === k(e).length;
882
+ var t;
883
+ const n = (t = Q(e)) !== null && t !== void 0 ? t : e.ownerDocument.body, i = e.ownerDocument.getSelection();
884
+ return (i == null ? void 0 : i.anchorNode) === n && i.focusNode === n && i.anchorOffset === 0 && i.focusOffset === n.childNodes.length;
885
+ }
886
+ function q(e, t, n) {
887
+ var i;
888
+ if (T(e))
889
+ return D({
890
+ focusNode: e,
891
+ anchorOffset: t,
892
+ focusOffset: n
893
+ });
894
+ if (U(e) && ((i = e.firstChild) === null || i === void 0 ? void 0 : i.nodeType) === 3)
895
+ return D({
896
+ focusNode: e.firstChild,
897
+ anchorOffset: t,
898
+ focusOffset: n
899
+ });
900
+ throw new Error("Not implemented. The result of this interaction is unreliable.");
901
+ }
902
+ function se(e, t, n) {
903
+ const i = w(t), r = Array.from(t.ownerDocument.querySelectorAll(t.name ? `input[type="radio"][name="${i.CSS.escape(t.name)}"]` : 'input[type="radio"][name=""], input[type="radio"]:not([name])'));
904
+ for (let o = r.findIndex((s) => s === t) + n; ; o += n) {
905
+ if (r[o] || (o = n > 0 ? 0 : r.length - 1), r[o] === t)
906
+ return;
907
+ I(r[o]) || (A(r[o]), e.dispatchUIEvent(r[o], "click"));
908
+ }
909
+ }
910
+ O.keydown = (e, t, n) => {
911
+ var i, r;
912
+ return (r = (i = qe[e.key]) === null || i === void 0 ? void 0 : i.call(qe, e, t, n)) !== null && r !== void 0 ? r : jn(e, t, n);
913
+ };
914
+ const qe = {
915
+ ArrowDown: (e, t, n) => {
916
+ if (l(t, "input", {
917
+ type: "radio"
918
+ }))
919
+ return () => se(n, t, -1);
920
+ },
921
+ ArrowLeft: (e, t, n) => l(t, "input", {
922
+ type: "radio"
923
+ }) ? () => se(n, t, -1) : () => We(t, -1),
924
+ ArrowRight: (e, t, n) => l(t, "input", {
925
+ type: "radio"
926
+ }) ? () => se(n, t, 1) : () => We(t, 1),
927
+ ArrowUp: (e, t, n) => {
928
+ if (l(t, "input", {
929
+ type: "radio"
930
+ }))
931
+ return () => se(n, t, 1);
932
+ },
933
+ Backspace: (e, t, n) => {
934
+ if (K(t))
935
+ return () => {
936
+ H(n, t, "", "deleteContentBackward");
937
+ };
938
+ },
939
+ Delete: (e, t, n) => {
940
+ if (K(t))
941
+ return () => {
942
+ H(n, t, "", "deleteContentForward");
943
+ };
944
+ },
945
+ End: (e, t) => {
946
+ if (l(t, [
947
+ "input",
948
+ "textarea"
949
+ ]) || U(t))
950
+ return () => {
951
+ var n, i;
952
+ const r = (i = (n = Vn(t)) === null || n === void 0 ? void 0 : n.length) !== null && i !== void 0 ? i : (
953
+ /* istanbul ignore next */
954
+ 0
955
+ );
956
+ q(t, r, r);
957
+ };
958
+ },
959
+ Home: (e, t) => {
960
+ if (l(t, [
961
+ "input",
962
+ "textarea"
963
+ ]) || U(t))
964
+ return () => {
965
+ q(t, 0, 0);
966
+ };
967
+ },
968
+ PageDown: (e, t) => {
969
+ if (l(t, [
970
+ "input"
971
+ ]))
972
+ return () => {
973
+ const n = k(t).length;
974
+ q(t, n, n);
975
+ };
976
+ },
977
+ PageUp: (e, t) => {
978
+ if (l(t, [
979
+ "input"
980
+ ]))
981
+ return () => {
982
+ q(t, 0, 0);
983
+ };
984
+ },
985
+ Tab: (e, t, n) => () => {
986
+ const i = Kn(t, n.system.keyboard.modifiers.Shift);
987
+ A(i), T(i) && z(i, {
988
+ anchorOffset: 0,
989
+ focusOffset: i.value.length
990
+ });
991
+ }
992
+ }, jn = (e, t, n) => {
993
+ if (e.code === "KeyA" && n.system.keyboard.modifiers.Control)
994
+ return () => At(t);
995
+ };
996
+ O.keypress = (e, t, n) => {
997
+ if (e.key === "Enter") {
998
+ if (l(t, "button") || l(t, "input") && Hn.includes(t.type) || l(t, "a") && t.href)
999
+ return () => {
1000
+ n.dispatchUIEvent(t, "click");
1001
+ };
1002
+ if (l(t, "input")) {
1003
+ const i = t.form, r = i == null ? void 0 : i.querySelector('input[type="submit"], button:not([type]), button[type="submit"]');
1004
+ return r ? () => n.dispatchUIEvent(r, "click") : i && Gn.includes(t.type) && i.querySelectorAll("input").length === 1 ? () => n.dispatchUIEvent(i, "submit") : void 0;
1005
+ }
1006
+ }
1007
+ if (K(t)) {
1008
+ const i = e.key === "Enter" ? U(t) && !n.system.keyboard.modifiers.Shift ? "insertParagraph" : "insertLineBreak" : "insertText", r = e.key === "Enter" ? `
1009
+ ` : e.key;
1010
+ return () => H(n, t, r, i);
1011
+ }
1012
+ };
1013
+ const Hn = [
1014
+ "button",
1015
+ "color",
1016
+ "file",
1017
+ "image",
1018
+ "reset",
1019
+ "submit"
1020
+ ], Gn = [
1021
+ "email",
1022
+ "month",
1023
+ "password",
1024
+ "search",
1025
+ "tel",
1026
+ "text",
1027
+ "url",
1028
+ "week"
1029
+ ];
1030
+ O.keyup = (e, t, n) => {
1031
+ var i;
1032
+ return (i = Xe[e.key]) === null || i === void 0 ? void 0 : i.call(Xe, e, t, n);
1033
+ };
1034
+ const Xe = {
1035
+ " ": (e, t, n) => {
1036
+ if (ft(t))
1037
+ return () => n.dispatchUIEvent(t, "click");
1038
+ }
1039
+ };
1040
+ O.paste = (e, t, n) => {
1041
+ if (K(t))
1042
+ return () => {
1043
+ var i;
1044
+ const r = (i = e.clipboardData) === null || i === void 0 ? void 0 : i.getData("text");
1045
+ r && H(n, t, r, "insertFromPaste");
1046
+ };
1047
+ };
1048
+ const Ot = {
1049
+ auxclick: {
1050
+ EventType: "PointerEvent",
1051
+ defaultInit: {
1052
+ bubbles: !0,
1053
+ cancelable: !0,
1054
+ composed: !0
1055
+ }
1056
+ },
1057
+ beforeinput: {
1058
+ EventType: "InputEvent",
1059
+ defaultInit: {
1060
+ bubbles: !0,
1061
+ cancelable: !0,
1062
+ composed: !0
1063
+ }
1064
+ },
1065
+ click: {
1066
+ EventType: "PointerEvent",
1067
+ defaultInit: {
1068
+ bubbles: !0,
1069
+ cancelable: !0,
1070
+ composed: !0
1071
+ }
1072
+ },
1073
+ contextmenu: {
1074
+ EventType: "PointerEvent",
1075
+ defaultInit: {
1076
+ bubbles: !0,
1077
+ cancelable: !0,
1078
+ composed: !0
1079
+ }
1080
+ },
1081
+ copy: {
1082
+ EventType: "ClipboardEvent",
1083
+ defaultInit: {
1084
+ bubbles: !0,
1085
+ cancelable: !0,
1086
+ composed: !0
1087
+ }
1088
+ },
1089
+ change: {
1090
+ EventType: "Event",
1091
+ defaultInit: {
1092
+ bubbles: !0,
1093
+ cancelable: !1
1094
+ }
1095
+ },
1096
+ cut: {
1097
+ EventType: "ClipboardEvent",
1098
+ defaultInit: {
1099
+ bubbles: !0,
1100
+ cancelable: !0,
1101
+ composed: !0
1102
+ }
1103
+ },
1104
+ dblclick: {
1105
+ EventType: "MouseEvent",
1106
+ defaultInit: {
1107
+ bubbles: !0,
1108
+ cancelable: !0,
1109
+ composed: !0
1110
+ }
1111
+ },
1112
+ keydown: {
1113
+ EventType: "KeyboardEvent",
1114
+ defaultInit: {
1115
+ bubbles: !0,
1116
+ cancelable: !0,
1117
+ composed: !0
1118
+ }
1119
+ },
1120
+ keypress: {
1121
+ EventType: "KeyboardEvent",
1122
+ defaultInit: {
1123
+ bubbles: !0,
1124
+ cancelable: !0,
1125
+ composed: !0
1126
+ }
1127
+ },
1128
+ keyup: {
1129
+ EventType: "KeyboardEvent",
1130
+ defaultInit: {
1131
+ bubbles: !0,
1132
+ cancelable: !0,
1133
+ composed: !0
1134
+ }
1135
+ },
1136
+ paste: {
1137
+ EventType: "ClipboardEvent",
1138
+ defaultInit: {
1139
+ bubbles: !0,
1140
+ cancelable: !0,
1141
+ composed: !0
1142
+ }
1143
+ },
1144
+ input: {
1145
+ EventType: "InputEvent",
1146
+ defaultInit: {
1147
+ bubbles: !0,
1148
+ cancelable: !1,
1149
+ composed: !0
1150
+ }
1151
+ },
1152
+ mousedown: {
1153
+ EventType: "MouseEvent",
1154
+ defaultInit: {
1155
+ bubbles: !0,
1156
+ cancelable: !0,
1157
+ composed: !0
1158
+ }
1159
+ },
1160
+ mouseenter: {
1161
+ EventType: "MouseEvent",
1162
+ defaultInit: {
1163
+ bubbles: !1,
1164
+ cancelable: !1,
1165
+ composed: !0
1166
+ }
1167
+ },
1168
+ mouseleave: {
1169
+ EventType: "MouseEvent",
1170
+ defaultInit: {
1171
+ bubbles: !1,
1172
+ cancelable: !1,
1173
+ composed: !0
1174
+ }
1175
+ },
1176
+ mousemove: {
1177
+ EventType: "MouseEvent",
1178
+ defaultInit: {
1179
+ bubbles: !0,
1180
+ cancelable: !0,
1181
+ composed: !0
1182
+ }
1183
+ },
1184
+ mouseout: {
1185
+ EventType: "MouseEvent",
1186
+ defaultInit: {
1187
+ bubbles: !0,
1188
+ cancelable: !0,
1189
+ composed: !0
1190
+ }
1191
+ },
1192
+ mouseover: {
1193
+ EventType: "MouseEvent",
1194
+ defaultInit: {
1195
+ bubbles: !0,
1196
+ cancelable: !0,
1197
+ composed: !0
1198
+ }
1199
+ },
1200
+ mouseup: {
1201
+ EventType: "MouseEvent",
1202
+ defaultInit: {
1203
+ bubbles: !0,
1204
+ cancelable: !0,
1205
+ composed: !0
1206
+ }
1207
+ },
1208
+ pointerover: {
1209
+ EventType: "PointerEvent",
1210
+ defaultInit: {
1211
+ bubbles: !0,
1212
+ cancelable: !0,
1213
+ composed: !0
1214
+ }
1215
+ },
1216
+ pointerenter: {
1217
+ EventType: "PointerEvent",
1218
+ defaultInit: {
1219
+ bubbles: !1,
1220
+ cancelable: !1
1221
+ }
1222
+ },
1223
+ pointerdown: {
1224
+ EventType: "PointerEvent",
1225
+ defaultInit: {
1226
+ bubbles: !0,
1227
+ cancelable: !0,
1228
+ composed: !0
1229
+ }
1230
+ },
1231
+ pointermove: {
1232
+ EventType: "PointerEvent",
1233
+ defaultInit: {
1234
+ bubbles: !0,
1235
+ cancelable: !0,
1236
+ composed: !0
1237
+ }
1238
+ },
1239
+ pointerup: {
1240
+ EventType: "PointerEvent",
1241
+ defaultInit: {
1242
+ bubbles: !0,
1243
+ cancelable: !0,
1244
+ composed: !0
1245
+ }
1246
+ },
1247
+ pointercancel: {
1248
+ EventType: "PointerEvent",
1249
+ defaultInit: {
1250
+ bubbles: !0,
1251
+ cancelable: !1,
1252
+ composed: !0
1253
+ }
1254
+ },
1255
+ pointerout: {
1256
+ EventType: "PointerEvent",
1257
+ defaultInit: {
1258
+ bubbles: !0,
1259
+ cancelable: !0,
1260
+ composed: !0
1261
+ }
1262
+ },
1263
+ pointerleave: {
1264
+ EventType: "PointerEvent",
1265
+ defaultInit: {
1266
+ bubbles: !1,
1267
+ cancelable: !1
1268
+ }
1269
+ },
1270
+ submit: {
1271
+ EventType: "Event",
1272
+ defaultInit: {
1273
+ bubbles: !0,
1274
+ cancelable: !0
1275
+ }
1276
+ }
1277
+ };
1278
+ function xt(e) {
1279
+ return Ot[e].EventType;
1280
+ }
1281
+ const zn = [
1282
+ "MouseEvent",
1283
+ "PointerEvent"
1284
+ ];
1285
+ function Wn(e) {
1286
+ return zn.includes(xt(e));
1287
+ }
1288
+ function qn(e) {
1289
+ return xt(e) === "KeyboardEvent";
1290
+ }
1291
+ const Xn = {
1292
+ ClipboardEvent: [
1293
+ Qn
1294
+ ],
1295
+ Event: [],
1296
+ InputEvent: [
1297
+ ue,
1298
+ Zn
1299
+ ],
1300
+ MouseEvent: [
1301
+ ue,
1302
+ Se,
1303
+ Je
1304
+ ],
1305
+ PointerEvent: [
1306
+ ue,
1307
+ Se,
1308
+ Je,
1309
+ ei
1310
+ ],
1311
+ KeyboardEvent: [
1312
+ ue,
1313
+ Se,
1314
+ Yn
1315
+ ]
1316
+ };
1317
+ function Ut(e, t, n) {
1318
+ const i = w(t), { EventType: r, defaultInit: o } = Ot[e], s = new (Jn(i))[r](e, o);
1319
+ return Xn[r].forEach((u) => u(s, n ?? {})), s;
1320
+ }
1321
+ function Jn(e) {
1322
+ var t;
1323
+ const n = (t = e.Event) !== null && t !== void 0 ? t : class {
1324
+ };
1325
+ var i;
1326
+ const r = (i = e.AnimationEvent) !== null && i !== void 0 ? i : class extends n {
1327
+ };
1328
+ var o;
1329
+ const s = (o = e.ClipboardEvent) !== null && o !== void 0 ? o : class extends n {
1330
+ };
1331
+ var u;
1332
+ const c = (u = e.PopStateEvent) !== null && u !== void 0 ? u : class extends n {
1333
+ };
1334
+ var a;
1335
+ const d = (a = e.ProgressEvent) !== null && a !== void 0 ? a : class extends n {
1336
+ };
1337
+ var f;
1338
+ const p = (f = e.TransitionEvent) !== null && f !== void 0 ? f : class extends n {
1339
+ };
1340
+ var b;
1341
+ const m = (b = e.UIEvent) !== null && b !== void 0 ? b : class extends n {
1342
+ };
1343
+ var ee;
1344
+ const Ht = (ee = e.CompositionEvent) !== null && ee !== void 0 ? ee : class extends m {
1345
+ };
1346
+ var ve;
1347
+ const Gt = (ve = e.FocusEvent) !== null && ve !== void 0 ? ve : class extends m {
1348
+ };
1349
+ var ge;
1350
+ const zt = (ge = e.InputEvent) !== null && ge !== void 0 ? ge : class extends m {
1351
+ };
1352
+ var me;
1353
+ const Wt = (me = e.KeyboardEvent) !== null && me !== void 0 ? me : class extends m {
1354
+ };
1355
+ var ye;
1356
+ const Ee = (ye = e.MouseEvent) !== null && ye !== void 0 ? ye : class extends m {
1357
+ };
1358
+ var we;
1359
+ const qt = (we = e.DragEvent) !== null && we !== void 0 ? we : class extends Ee {
1360
+ };
1361
+ var Te;
1362
+ const Xt = (Te = e.PointerEvent) !== null && Te !== void 0 ? Te : class extends Ee {
1363
+ };
1364
+ var ke;
1365
+ const Jt = (ke = e.TouchEvent) !== null && ke !== void 0 ? ke : class extends m {
1366
+ };
1367
+ return {
1368
+ Event: n,
1369
+ AnimationEvent: r,
1370
+ ClipboardEvent: s,
1371
+ PopStateEvent: c,
1372
+ ProgressEvent: d,
1373
+ TransitionEvent: p,
1374
+ UIEvent: m,
1375
+ CompositionEvent: Ht,
1376
+ FocusEvent: Gt,
1377
+ InputEvent: zt,
1378
+ KeyboardEvent: Wt,
1379
+ MouseEvent: Ee,
1380
+ DragEvent: qt,
1381
+ PointerEvent: Xt,
1382
+ TouchEvent: Jt
1383
+ };
1384
+ }
1385
+ function N(e, t) {
1386
+ for (const [n, i] of Object.entries(t))
1387
+ Object.defineProperty(e, n, {
1388
+ get: () => i ?? null
1389
+ });
1390
+ }
1391
+ function h(e) {
1392
+ return Number(e ?? 0);
1393
+ }
1394
+ function Qn(e, { clipboardData: t }) {
1395
+ N(e, {
1396
+ clipboardData: t
1397
+ });
1398
+ }
1399
+ function Zn(e, { data: t, inputType: n, isComposing: i }) {
1400
+ N(e, {
1401
+ data: t,
1402
+ isComposing: !!i,
1403
+ inputType: String(n)
1404
+ });
1405
+ }
1406
+ function ue(e, { view: t, detail: n }) {
1407
+ N(e, {
1408
+ view: t,
1409
+ detail: h(n ?? 0)
1410
+ });
1411
+ }
1412
+ function Se(e, { altKey: t, ctrlKey: n, metaKey: i, shiftKey: r, modifierAltGraph: o, modifierCapsLock: s, modifierFn: u, modifierFnLock: c, modifierNumLock: a, modifierScrollLock: d, modifierSymbol: f, modifierSymbolLock: p }) {
1413
+ N(e, {
1414
+ altKey: !!t,
1415
+ ctrlKey: !!n,
1416
+ metaKey: !!i,
1417
+ shiftKey: !!r,
1418
+ getModifierState(b) {
1419
+ return !!{
1420
+ Alt: t,
1421
+ AltGraph: o,
1422
+ CapsLock: s,
1423
+ Control: n,
1424
+ Fn: u,
1425
+ FnLock: c,
1426
+ Meta: i,
1427
+ NumLock: a,
1428
+ ScrollLock: d,
1429
+ Shift: r,
1430
+ Symbol: f,
1431
+ SymbolLock: p
1432
+ }[b];
1433
+ }
1434
+ });
1435
+ }
1436
+ function Yn(e, { key: t, code: n, location: i, repeat: r, isComposing: o, charCode: s }) {
1437
+ N(e, {
1438
+ key: String(t),
1439
+ code: String(n),
1440
+ location: h(i),
1441
+ repeat: !!r,
1442
+ isComposing: !!o,
1443
+ charCode: s
1444
+ });
1445
+ }
1446
+ function Je(e, { x: t, y: n, screenX: i, screenY: r, clientX: o = t, clientY: s = n, button: u, buttons: c, relatedTarget: a }) {
1447
+ N(e, {
1448
+ screenX: h(i),
1449
+ screenY: h(r),
1450
+ clientX: h(o),
1451
+ x: h(o),
1452
+ clientY: h(s),
1453
+ y: h(s),
1454
+ button: h(u),
1455
+ buttons: h(c),
1456
+ relatedTarget: a
1457
+ });
1458
+ }
1459
+ function ei(e, { pointerId: t, width: n, height: i, pressure: r, tangentialPressure: o, tiltX: s, tiltY: u, twist: c, pointerType: a, isPrimary: d }) {
1460
+ N(e, {
1461
+ pointerId: h(t),
1462
+ width: h(n),
1463
+ height: h(i),
1464
+ pressure: h(r),
1465
+ tangentialPressure: h(o),
1466
+ tiltX: h(s),
1467
+ tiltY: h(u),
1468
+ twist: h(c),
1469
+ pointerType: String(a),
1470
+ isPrimary: !!d
1471
+ });
1472
+ }
1473
+ function ti(e, t, n, i = !1) {
1474
+ (Wn(t) || qn(t)) && (n = {
1475
+ ...n,
1476
+ ...this.system.getUIEventModifiers()
1477
+ });
1478
+ const r = Ut(t, e, n);
1479
+ return Dt.call(this, e, r, i);
1480
+ }
1481
+ function Dt(e, t, n = !1) {
1482
+ var i;
1483
+ const r = t.type, o = n ? () => {
1484
+ } : (i = O[r]) === null || i === void 0 ? void 0 : i.call(O, t, e, this);
1485
+ if (o) {
1486
+ t.preventDefault();
1487
+ let s = !1;
1488
+ return Object.defineProperty(t, "defaultPrevented", {
1489
+ get: () => s
1490
+ }), Object.defineProperty(t, "preventDefault", {
1491
+ value: () => {
1492
+ s = t.cancelable;
1493
+ }
1494
+ }), R(() => e.dispatchEvent(t)), s || o(), !s;
1495
+ }
1496
+ return R(() => e.dispatchEvent(t));
1497
+ }
1498
+ function ni(e, t, n) {
1499
+ const i = Ut(t, e, n);
1500
+ R(() => e.dispatchEvent(i));
1501
+ }
1502
+ const _e = Symbol("Interceptor for programmatical calls");
1503
+ function $(e, t, n) {
1504
+ const i = Object.getOwnPropertyDescriptor(e.constructor.prototype, t), r = Object.getOwnPropertyDescriptor(e, t), o = i != null && i.set ? "set" : "value";
1505
+ if (typeof (i == null ? void 0 : i[o]) != "function" || i[o][_e])
1506
+ throw new Error(`Element ${e.tagName} does not implement "${String(t)}".`);
1507
+ function s(...u) {
1508
+ const { applyNative: c = !1, realArgs: a, then: d } = n.call(this, ...u), f = (!c && r || i)[o];
1509
+ o === "set" ? f.call(this, a) : f.call(this, ...a), d == null || d();
1510
+ }
1511
+ s[_e] = _e, Object.defineProperty(e, t, {
1512
+ ...r ?? i,
1513
+ [o]: s
1514
+ });
1515
+ }
1516
+ function ii(e) {
1517
+ $(e, "value", function(n) {
1518
+ const i = yn(n);
1519
+ return i && On(this), {
1520
+ applyNative: !!i,
1521
+ realArgs: ri(this, n),
1522
+ then: i ? void 0 : () => xn(this, String(n))
1523
+ };
1524
+ });
1525
+ }
1526
+ function ri(e, t) {
1527
+ return l(e, "input", {
1528
+ type: "number"
1529
+ }) && String(t) !== "" && !Number.isNaN(Number(t)) ? String(Number(t)) : String(t);
1530
+ }
1531
+ function oi(e) {
1532
+ $(e, "setSelectionRange", function(n, ...i) {
1533
+ const r = En(n);
1534
+ return {
1535
+ applyNative: !!r,
1536
+ realArgs: [
1537
+ Number(n),
1538
+ ...i
1539
+ ],
1540
+ then: () => r ? void 0 : ce(e)
1541
+ };
1542
+ }), $(e, "selectionStart", function(n) {
1543
+ return {
1544
+ realArgs: n,
1545
+ then: () => ce(e)
1546
+ };
1547
+ }), $(e, "selectionEnd", function(n) {
1548
+ return {
1549
+ realArgs: n,
1550
+ then: () => ce(e)
1551
+ };
1552
+ }), $(e, "select", function() {
1553
+ return {
1554
+ realArgs: [],
1555
+ then: () => kn(e, {
1556
+ anchorOffset: 0,
1557
+ focusOffset: k(e).length
1558
+ })
1559
+ };
1560
+ });
1561
+ }
1562
+ function si(e) {
1563
+ $(e, "setRangeText", function(...n) {
1564
+ return {
1565
+ realArgs: n,
1566
+ then: () => {
1567
+ Be(e), ce(e);
1568
+ }
1569
+ };
1570
+ });
1571
+ }
1572
+ const V = Symbol("Node prepared with document state workarounds");
1573
+ function Nt(e) {
1574
+ e[V] || (e.addEventListener("focus", (t) => {
1575
+ const n = t.target;
1576
+ Qe(n);
1577
+ }, {
1578
+ capture: !0,
1579
+ passive: !0
1580
+ }), e.activeElement && Qe(e.activeElement), e.addEventListener("blur", (t) => {
1581
+ const n = t.target, i = Tn(n);
1582
+ i !== void 0 && (n.value !== i && ni(n, "change"), Ct(n));
1583
+ }, {
1584
+ capture: !0,
1585
+ passive: !0
1586
+ }), e[V] = V);
1587
+ }
1588
+ function Qe(e) {
1589
+ e[V] || (l(e, [
1590
+ "input",
1591
+ "textarea"
1592
+ ]) && (ii(e), oi(e), si(e)), e[V] = V);
1593
+ }
1594
+ function ui(e) {
1595
+ return ci(e) ? e : e.ownerDocument;
1596
+ }
1597
+ function ci(e) {
1598
+ return e.nodeType === 9;
1599
+ }
1600
+ function G(e) {
1601
+ const t = e.delay;
1602
+ if (typeof t == "number")
1603
+ return Promise.all([
1604
+ new Promise((n) => globalThis.setTimeout(() => n(), t)),
1605
+ e.advanceTimers(t)
1606
+ ]);
1607
+ }
1608
+ function M(e, t, n) {
1609
+ return t in e ? Object.defineProperty(e, t, {
1610
+ value: n,
1611
+ enumerable: !0,
1612
+ configurable: !0,
1613
+ writable: !0
1614
+ }) : e[t] = n, e;
1615
+ }
1616
+ var E;
1617
+ (function(e) {
1618
+ e[e.STANDARD = 0] = "STANDARD", e[e.LEFT = 1] = "LEFT", e[e.RIGHT = 2] = "RIGHT", e[e.NUMPAD = 3] = "NUMPAD";
1619
+ })(E || (E = {}));
1620
+ const ai = [
1621
+ "Alt",
1622
+ "AltGraph",
1623
+ "Control",
1624
+ "Fn",
1625
+ "Meta",
1626
+ "Shift",
1627
+ "Symbol"
1628
+ ];
1629
+ function Ze(e) {
1630
+ return ai.includes(e);
1631
+ }
1632
+ const di = [
1633
+ "CapsLock",
1634
+ "FnLock",
1635
+ "NumLock",
1636
+ "ScrollLock",
1637
+ "SymbolLock"
1638
+ ];
1639
+ function Ye(e) {
1640
+ return di.includes(e);
1641
+ }
1642
+ class li {
1643
+ isKeyPressed(t) {
1644
+ return !!this.pressed[String(t.code)];
1645
+ }
1646
+ getPressedKeys() {
1647
+ return Object.values(this.pressed).map((t) => t.keyDef);
1648
+ }
1649
+ /** Press a key */
1650
+ async keydown(t, n) {
1651
+ var i, r, o;
1652
+ const s = String(n.key), u = String(n.code), c = Ie(t.config.document);
1653
+ this.setKeydownTarget(c);
1654
+ var a;
1655
+ (a = (i = this.pressed)[r = u]) !== null && a !== void 0 || (i[r] = {
1656
+ keyDef: n,
1657
+ unpreventedDefault: !1
1658
+ }), Ze(s) && (this.modifiers[s] = !0);
1659
+ const d = t.dispatchUIEvent(c, "keydown", {
1660
+ key: s,
1661
+ code: u
1662
+ });
1663
+ Ye(s) && !this.modifiers[s] && (this.modifiers[s] = !0, this.modifierLockStart[s] = !0), (o = this.pressed[u]).unpreventedDefault || (o.unpreventedDefault = d), d && this.hasKeyPress(s) && t.dispatchUIEvent(Ie(t.config.document), "keypress", {
1664
+ key: s,
1665
+ code: u,
1666
+ charCode: n.key === "Enter" ? 13 : String(n.key).charCodeAt(0)
1667
+ });
1668
+ }
1669
+ /** Release a key */
1670
+ async keyup(t, n) {
1671
+ const i = String(n.key), r = String(n.code), o = this.pressed[r].unpreventedDefault;
1672
+ delete this.pressed[r], Ze(i) && !Object.values(this.pressed).find((s) => s.keyDef.key === i) && (this.modifiers[i] = !1), t.dispatchUIEvent(Ie(t.config.document), "keyup", {
1673
+ key: i,
1674
+ code: r
1675
+ }, !o), Ye(i) && this.modifiers[i] && (this.modifierLockStart[i] ? this.modifierLockStart[i] = !1 : this.modifiers[i] = !1);
1676
+ }
1677
+ setKeydownTarget(t) {
1678
+ t !== this.lastKeydownTarget && (this.carryChar = ""), this.lastKeydownTarget = t;
1679
+ }
1680
+ hasKeyPress(t) {
1681
+ return (t.length === 1 || t === "Enter") && !this.modifiers.Control && !this.modifiers.Alt;
1682
+ }
1683
+ constructor(t) {
1684
+ M(this, "system", void 0), M(this, "modifiers", {
1685
+ Alt: !1,
1686
+ AltGraph: !1,
1687
+ CapsLock: !1,
1688
+ Control: !1,
1689
+ Fn: !1,
1690
+ FnLock: !1,
1691
+ Meta: !1,
1692
+ NumLock: !1,
1693
+ ScrollLock: !1,
1694
+ Shift: !1,
1695
+ Symbol: !1,
1696
+ SymbolLock: !1
1697
+ }), M(this, "pressed", {}), M(this, "carryChar", ""), M(this, "lastKeydownTarget", void 0), M(this, "modifierLockStart", {}), this.system = t;
1698
+ }
1699
+ }
1700
+ const fi = [
1701
+ // alphanumeric keys
1702
+ ..."0123456789".split("").map((e) => ({
1703
+ code: `Digit${e}`,
1704
+ key: e
1705
+ })),
1706
+ ...")!@#$%^&*(".split("").map((e, t) => ({
1707
+ code: `Digit${t}`,
1708
+ key: e,
1709
+ shiftKey: !0
1710
+ })),
1711
+ ..."abcdefghijklmnopqrstuvwxyz".split("").map((e) => ({
1712
+ code: `Key${e.toUpperCase()}`,
1713
+ key: e
1714
+ })),
1715
+ ..."ABCDEFGHIJKLMNOPQRSTUVWXYZ".split("").map((e) => ({
1716
+ code: `Key${e}`,
1717
+ key: e,
1718
+ shiftKey: !0
1719
+ })),
1720
+ // alphanumeric block - functional
1721
+ {
1722
+ code: "Space",
1723
+ key: " "
1724
+ },
1725
+ {
1726
+ code: "AltLeft",
1727
+ key: "Alt",
1728
+ location: E.LEFT
1729
+ },
1730
+ {
1731
+ code: "AltRight",
1732
+ key: "Alt",
1733
+ location: E.RIGHT
1734
+ },
1735
+ {
1736
+ code: "ShiftLeft",
1737
+ key: "Shift",
1738
+ location: E.LEFT
1739
+ },
1740
+ {
1741
+ code: "ShiftRight",
1742
+ key: "Shift",
1743
+ location: E.RIGHT
1744
+ },
1745
+ {
1746
+ code: "ControlLeft",
1747
+ key: "Control",
1748
+ location: E.LEFT
1749
+ },
1750
+ {
1751
+ code: "ControlRight",
1752
+ key: "Control",
1753
+ location: E.RIGHT
1754
+ },
1755
+ {
1756
+ code: "MetaLeft",
1757
+ key: "Meta",
1758
+ location: E.LEFT
1759
+ },
1760
+ {
1761
+ code: "MetaRight",
1762
+ key: "Meta",
1763
+ location: E.RIGHT
1764
+ },
1765
+ {
1766
+ code: "OSLeft",
1767
+ key: "OS",
1768
+ location: E.LEFT
1769
+ },
1770
+ {
1771
+ code: "OSRight",
1772
+ key: "OS",
1773
+ location: E.RIGHT
1774
+ },
1775
+ {
1776
+ code: "Tab",
1777
+ key: "Tab"
1778
+ },
1779
+ {
1780
+ code: "CapsLock",
1781
+ key: "CapsLock"
1782
+ },
1783
+ {
1784
+ code: "Backspace",
1785
+ key: "Backspace"
1786
+ },
1787
+ {
1788
+ code: "Enter",
1789
+ key: "Enter"
1790
+ },
1791
+ // function
1792
+ {
1793
+ code: "Escape",
1794
+ key: "Escape"
1795
+ },
1796
+ // arrows
1797
+ {
1798
+ code: "ArrowUp",
1799
+ key: "ArrowUp"
1800
+ },
1801
+ {
1802
+ code: "ArrowDown",
1803
+ key: "ArrowDown"
1804
+ },
1805
+ {
1806
+ code: "ArrowLeft",
1807
+ key: "ArrowLeft"
1808
+ },
1809
+ {
1810
+ code: "ArrowRight",
1811
+ key: "ArrowRight"
1812
+ },
1813
+ // control pad
1814
+ {
1815
+ code: "Home",
1816
+ key: "Home"
1817
+ },
1818
+ {
1819
+ code: "End",
1820
+ key: "End"
1821
+ },
1822
+ {
1823
+ code: "Delete",
1824
+ key: "Delete"
1825
+ },
1826
+ {
1827
+ code: "PageUp",
1828
+ key: "PageUp"
1829
+ },
1830
+ {
1831
+ code: "PageDown",
1832
+ key: "PageDown"
1833
+ },
1834
+ // Special keys that are not part of a default US-layout but included for specific behavior
1835
+ {
1836
+ code: "Fn",
1837
+ key: "Fn"
1838
+ },
1839
+ {
1840
+ code: "Symbol",
1841
+ key: "Symbol"
1842
+ },
1843
+ {
1844
+ code: "AltRight",
1845
+ key: "AltGraph"
1846
+ }
1847
+ ], pi = [
1848
+ {
1849
+ name: "MouseLeft",
1850
+ pointerType: "mouse",
1851
+ button: "primary"
1852
+ },
1853
+ {
1854
+ name: "MouseRight",
1855
+ pointerType: "mouse",
1856
+ button: "secondary"
1857
+ },
1858
+ {
1859
+ name: "MouseMiddle",
1860
+ pointerType: "mouse",
1861
+ button: "auxiliary"
1862
+ },
1863
+ {
1864
+ name: "TouchA",
1865
+ pointerType: "touch"
1866
+ },
1867
+ {
1868
+ name: "TouchB",
1869
+ pointerType: "touch"
1870
+ },
1871
+ {
1872
+ name: "TouchC",
1873
+ pointerType: "touch"
1874
+ }
1875
+ ];
1876
+ function hi(e, t, n) {
1877
+ return t in e ? Object.defineProperty(e, t, {
1878
+ value: n,
1879
+ enumerable: !0,
1880
+ configurable: !0,
1881
+ writable: !0
1882
+ }) : e[t] = n, e;
1883
+ }
1884
+ class Mt {
1885
+ getButtons() {
1886
+ let t = 0;
1887
+ for (const n of Object.keys(this.pressed))
1888
+ t |= 2 ** Number(n);
1889
+ return t;
1890
+ }
1891
+ down(t) {
1892
+ const n = Ue(t.button);
1893
+ if (n in this.pressed) {
1894
+ this.pressed[n].push(t);
1895
+ return;
1896
+ }
1897
+ return this.pressed[n] = [
1898
+ t
1899
+ ], n;
1900
+ }
1901
+ up(t) {
1902
+ const n = Ue(t.button);
1903
+ if (n in this.pressed && (this.pressed[n] = this.pressed[n].filter((i) => i.name !== t.name), this.pressed[n].length === 0))
1904
+ return delete this.pressed[n], n;
1905
+ }
1906
+ constructor() {
1907
+ hi(this, "pressed", {});
1908
+ }
1909
+ }
1910
+ const et = {
1911
+ primary: 0,
1912
+ secondary: 1,
1913
+ auxiliary: 2,
1914
+ back: 3,
1915
+ X1: 3,
1916
+ forward: 4,
1917
+ X2: 4
1918
+ };
1919
+ function Ue(e = 0) {
1920
+ return e in et ? et[e] : Number(e);
1921
+ }
1922
+ const tt = {
1923
+ 1: 2,
1924
+ 2: 1
1925
+ };
1926
+ function nt(e) {
1927
+ return e = Ue(e), e in tt ? tt[e] : e;
1928
+ }
1929
+ function bi(e, t, n) {
1930
+ return t in e ? Object.defineProperty(e, t, {
1931
+ value: n,
1932
+ enumerable: !0,
1933
+ configurable: !0,
1934
+ writable: !0
1935
+ }) : e[t] = n, e;
1936
+ }
1937
+ class gi {
1938
+ get countPressed() {
1939
+ return this.pressedKeys.size;
1940
+ }
1941
+ isPressed(t) {
1942
+ return this.pressedKeys.has(t.name);
1943
+ }
1944
+ addPressed(t) {
1945
+ return this.pressedKeys.add(t.name);
1946
+ }
1947
+ removePressed(t) {
1948
+ return this.pressedKeys.delete(t.name);
1949
+ }
1950
+ constructor() {
1951
+ bi(this, "pressedKeys", /* @__PURE__ */ new Set());
1952
+ }
1953
+ }
1954
+ function J(e, t) {
1955
+ const n = [];
1956
+ for (let o = e; o; o = o.parentElement)
1957
+ n.push(o);
1958
+ const i = [];
1959
+ for (let o = t; o; o = o.parentElement)
1960
+ i.push(o);
1961
+ let r = 0;
1962
+ for (; !(r >= n.length || r >= i.length || n[n.length - 1 - r] !== i[i.length - 1 - r]); r++)
1963
+ ;
1964
+ return [
1965
+ n.slice(0, n.length - r),
1966
+ i.slice(0, i.length - r),
1967
+ i.slice(i.length - r)
1968
+ ];
1969
+ }
1970
+ function De({ target: e, node: t, offset: n }) {
1971
+ return T(e) ? {
1972
+ node: e,
1973
+ offset: n ?? k(e).length
1974
+ } : t ? {
1975
+ node: t,
1976
+ offset: n ?? (t.nodeType === 3 ? t.nodeValue.length : t.childNodes.length)
1977
+ } : Lt(e, n);
1978
+ }
1979
+ function Lt(e, t, n = !0) {
1980
+ let i = t === void 0 ? e.childNodes.length - 1 : 0;
1981
+ const r = t === void 0 ? -1 : 1;
1982
+ for (; t === void 0 ? i >= (n ? Math.max(e.childNodes.length - 1, 0) : 0) : i <= e.childNodes.length; ) {
1983
+ if (t && i === e.childNodes.length)
1984
+ throw new Error("The given offset is out of bounds.");
1985
+ const o = e.childNodes.item(i), s = String(o.textContent);
1986
+ if (s.length)
1987
+ if (t !== void 0 && s.length < t)
1988
+ t -= s.length;
1989
+ else {
1990
+ if (o.nodeType === 1)
1991
+ return Lt(o, t, !1);
1992
+ if (o.nodeType === 3)
1993
+ return {
1994
+ node: o,
1995
+ offset: t ?? o.nodeValue.length
1996
+ };
1997
+ }
1998
+ i += r;
1999
+ }
2000
+ return {
2001
+ node: e,
2002
+ offset: e.childNodes.length
2003
+ };
2004
+ }
2005
+ function mi({ document: e, target: t, clickCount: n, node: i, offset: r }) {
2006
+ if (vn(t))
2007
+ return;
2008
+ const o = T(t), s = String(o ? k(t) : t.textContent), [u, c] = i ? (
2009
+ // which elements might be considered in the same line of text.
2010
+ // TODO: support expanding initial range on multiple clicks if node is given
2011
+ [
2012
+ r,
2013
+ r
2014
+ ]
2015
+ ) : yi(s, r, n);
2016
+ if (o)
2017
+ return z(t, {
2018
+ anchorOffset: u ?? s.length,
2019
+ focusOffset: c ?? s.length
2020
+ }), {
2021
+ node: t,
2022
+ start: u ?? 0,
2023
+ end: c ?? s.length
2024
+ };
2025
+ {
2026
+ const { node: a, offset: d } = De({
2027
+ target: t,
2028
+ node: i,
2029
+ offset: u
2030
+ }), { node: f, offset: p } = De({
2031
+ target: t,
2032
+ node: i,
2033
+ offset: c
2034
+ }), b = t.ownerDocument.createRange();
2035
+ try {
2036
+ b.setStart(a, d), b.setEnd(f, p);
2037
+ } catch {
2038
+ throw new Error("The given offset is out of bounds.");
2039
+ }
2040
+ const m = e.getSelection();
2041
+ return m == null || m.removeAllRanges(), m == null || m.addRange(b.cloneRange()), b;
2042
+ }
2043
+ }
2044
+ function yi(e, t, n) {
2045
+ if (n % 3 === 1 || e.length === 0)
2046
+ return [
2047
+ t,
2048
+ t
2049
+ ];
2050
+ const i = t ?? e.length;
2051
+ return n % 3 === 2 ? [
2052
+ i - e.substr(0, t).match(/(\w+|\s+|\W)?$/)[0].length,
2053
+ t === void 0 ? t : t + e.substr(t).match(/^(\w+|\s+|\W)?/)[0].length
2054
+ ] : [
2055
+ i - e.substr(0, t).match(/[^\r\n]*$/)[0].length,
2056
+ t === void 0 ? t : t + e.substr(t).match(/^[^\r\n]*/)[0].length
2057
+ ];
2058
+ }
2059
+ function Ei(e, { document: t, target: n, node: i, offset: r }) {
2060
+ const o = De({
2061
+ target: n,
2062
+ node: i,
2063
+ offset: r
2064
+ });
2065
+ if ("node" in e) {
2066
+ if (o.node === e.node) {
2067
+ const s = o.offset < e.start ? e.end : e.start, u = o.offset > e.end || o.offset < e.start ? o.offset : e.end;
2068
+ z(e.node, {
2069
+ anchorOffset: s,
2070
+ focusOffset: u
2071
+ });
2072
+ }
2073
+ } else {
2074
+ const s = e.cloneRange(), u = s.comparePoint(o.node, o.offset);
2075
+ u < 0 ? s.setStart(o.node, o.offset) : u > 0 && s.setEnd(o.node, o.offset);
2076
+ const c = t.getSelection();
2077
+ c == null || c.removeAllRanges(), c == null || c.addRange(s.cloneRange());
2078
+ }
2079
+ }
2080
+ function $t(e, t) {
2081
+ var n, i, r, o, s, u, c, a;
2082
+ return e.target !== t.target || ((n = e.coords) === null || n === void 0 ? void 0 : n.x) !== ((i = t.coords) === null || i === void 0 ? void 0 : i.y) || ((r = e.coords) === null || r === void 0 ? void 0 : r.y) !== ((o = t.coords) === null || o === void 0 ? void 0 : o.y) || ((s = e.caret) === null || s === void 0 ? void 0 : s.node) !== ((u = t.caret) === null || u === void 0 ? void 0 : u.node) || ((c = e.caret) === null || c === void 0 ? void 0 : c.offset) !== ((a = t.caret) === null || a === void 0 ? void 0 : a.offset);
2083
+ }
2084
+ function x(e, t, n) {
2085
+ return t in e ? Object.defineProperty(e, t, {
2086
+ value: n,
2087
+ enumerable: !0,
2088
+ configurable: !0,
2089
+ writable: !0
2090
+ }) : e[t] = n, e;
2091
+ }
2092
+ class wi {
2093
+ move(t, n) {
2094
+ const i = this.position, r = this.getTarget(t);
2095
+ if (this.position = n, !$t(i, n))
2096
+ return;
2097
+ const o = this.getTarget(t), s = this.getEventInit("mousemove"), [u, c] = J(r, o);
2098
+ return {
2099
+ leave: () => {
2100
+ r !== o && (t.dispatchUIEvent(r, "mouseout", s), u.forEach((a) => t.dispatchUIEvent(a, "mouseleave", s)));
2101
+ },
2102
+ enter: () => {
2103
+ r !== o && (t.dispatchUIEvent(o, "mouseover", s), c.forEach((a) => t.dispatchUIEvent(a, "mouseenter", s)));
2104
+ },
2105
+ move: () => {
2106
+ t.dispatchUIEvent(o, "mousemove", s), this.modifySelecting(t);
2107
+ }
2108
+ };
2109
+ }
2110
+ down(t, n, i) {
2111
+ const r = this.buttons.down(n);
2112
+ if (r === void 0)
2113
+ return;
2114
+ const o = this.getTarget(t);
2115
+ this.buttonDownTarget[r] = o;
2116
+ const s = I(o), u = this.getEventInit("mousedown", n.button);
2117
+ (s || t.dispatchUIEvent(o, "mousedown", u)) && (this.startSelecting(t, u.detail), A(o)), !s && nt(n.button) === 2 && t.dispatchUIEvent(o, "contextmenu", this.getEventInit("contextmenu", n.button, i));
2118
+ }
2119
+ up(t, n, i) {
2120
+ const r = this.buttons.up(n);
2121
+ if (r === void 0)
2122
+ return;
2123
+ const o = this.getTarget(t);
2124
+ if (!I(o)) {
2125
+ t.dispatchUIEvent(o, "mouseup", this.getEventInit("mouseup", n.button)), this.endSelecting();
2126
+ const s = J(this.buttonDownTarget[r], o)[2][0];
2127
+ if (s) {
2128
+ const u = this.getEventInit("click", n.button, i);
2129
+ u.detail && (t.dispatchUIEvent(s, u.button === 0 ? "click" : "auxclick", u), u.button === 0 && u.detail === 2 && t.dispatchUIEvent(s, "dblclick", {
2130
+ ...this.getEventInit("dblclick", n.button),
2131
+ detail: u.detail
2132
+ }));
2133
+ }
2134
+ }
2135
+ }
2136
+ resetClickCount() {
2137
+ this.clickCount.reset();
2138
+ }
2139
+ getEventInit(t, n, i) {
2140
+ const r = {
2141
+ ...this.position.coords
2142
+ };
2143
+ return i && (r.pointerId = i.pointerId, r.pointerType = i.pointerType, r.isPrimary = i.isPrimary), r.button = nt(n), r.buttons = this.buttons.getButtons(), t === "mousedown" ? r.detail = this.clickCount.getOnDown(r.button) : t === "mouseup" ? r.detail = this.clickCount.getOnUp(r.button) : (t === "click" || t === "auxclick") && (r.detail = this.clickCount.incOnClick(r.button)), r;
2144
+ }
2145
+ getTarget(t) {
2146
+ var n;
2147
+ return (n = this.position.target) !== null && n !== void 0 ? n : t.config.document.body;
2148
+ }
2149
+ startSelecting(t, n) {
2150
+ var i, r;
2151
+ this.selecting = mi({
2152
+ document: t.config.document,
2153
+ target: this.getTarget(t),
2154
+ node: (i = this.position.caret) === null || i === void 0 ? void 0 : i.node,
2155
+ offset: (r = this.position.caret) === null || r === void 0 ? void 0 : r.offset,
2156
+ clickCount: n
2157
+ });
2158
+ }
2159
+ modifySelecting(t) {
2160
+ var n, i;
2161
+ this.selecting && Ei(this.selecting, {
2162
+ document: t.config.document,
2163
+ target: this.getTarget(t),
2164
+ node: (n = this.position.caret) === null || n === void 0 ? void 0 : n.node,
2165
+ offset: (i = this.position.caret) === null || i === void 0 ? void 0 : i.offset
2166
+ });
2167
+ }
2168
+ endSelecting() {
2169
+ this.selecting = void 0;
2170
+ }
2171
+ constructor() {
2172
+ x(this, "position", {}), x(this, "buttons", new Mt()), x(this, "selecting", void 0), x(this, "buttonDownTarget", {}), x(this, "clickCount", new class {
2173
+ incOnClick(t) {
2174
+ const n = this.down[t] === void 0 ? void 0 : Number(this.down[t]) + 1;
2175
+ return this.count = this.count[t] === void 0 ? {} : {
2176
+ [t]: Number(this.count[t]) + 1
2177
+ }, n;
2178
+ }
2179
+ getOnDown(t) {
2180
+ var n;
2181
+ this.down = {
2182
+ [t]: (n = this.count[t]) !== null && n !== void 0 ? n : 0
2183
+ };
2184
+ var i;
2185
+ return this.count = {
2186
+ [t]: (i = this.count[t]) !== null && i !== void 0 ? i : 0
2187
+ }, Number(this.count[t]) + 1;
2188
+ }
2189
+ getOnUp(t) {
2190
+ return this.down[t] === void 0 ? void 0 : Number(this.down[t]) + 1;
2191
+ }
2192
+ reset() {
2193
+ this.count = {};
2194
+ }
2195
+ constructor() {
2196
+ x(this, "down", {}), x(this, "count", {});
2197
+ }
2198
+ }());
2199
+ }
2200
+ }
2201
+ function he(e, t) {
2202
+ var n;
2203
+ return ((n = Bt(e, t)) === null || n === void 0 ? void 0 : n.pointerEvents) !== "none";
2204
+ }
2205
+ function Ti(e) {
2206
+ const t = w(e);
2207
+ for (let n = e, i = []; n != null && n.ownerDocument; n = n.parentElement) {
2208
+ i.push(n);
2209
+ const r = t.getComputedStyle(n).pointerEvents;
2210
+ if (r && ![
2211
+ "inherit",
2212
+ "unset"
2213
+ ].includes(r))
2214
+ return {
2215
+ pointerEvents: r,
2216
+ tree: i
2217
+ };
2218
+ }
2219
+ }
2220
+ const rt = Symbol("Last check for pointer-events");
2221
+ function Bt(e, t) {
2222
+ const n = t[rt];
2223
+ if (!(e.config.pointerEventsCheck !== B.Never && (!n || ot(e.config.pointerEventsCheck, B.EachApiCall) && n[g.Call] !== re(e, g.Call) || ot(e.config.pointerEventsCheck, B.EachTrigger) && n[g.Trigger] !== re(e, g.Trigger))))
2224
+ return n == null ? void 0 : n.result;
2225
+ const r = Ti(t);
2226
+ return t[rt] = {
2227
+ [g.Call]: re(e, g.Call),
2228
+ [g.Trigger]: re(e, g.Trigger),
2229
+ result: r
2230
+ }, r;
2231
+ }
2232
+ function X(e, t) {
2233
+ const n = Bt(e, t);
2234
+ if ((n == null ? void 0 : n.pointerEvents) === "none")
2235
+ throw new Error([
2236
+ `Unable to perform pointer interaction as the element ${n.tree.length > 1 ? "inherits" : "has"} \`pointer-events: none\`:`,
2237
+ "",
2238
+ ki(n.tree)
2239
+ ].join(`
2240
+ `));
2241
+ }
2242
+ function ki(e) {
2243
+ return e.reverse().map((t, n) => [
2244
+ "".padEnd(n),
2245
+ t.tagName,
2246
+ t.id && `#${t.id}`,
2247
+ t.hasAttribute("data-testid") && `(testId=${t.getAttribute("data-testid")})`,
2248
+ Ci(t),
2249
+ e.length > 1 && n === 0 && " <-- This element declared `pointer-events: none`",
2250
+ e.length > 1 && n === e.length - 1 && " <-- Asserted pointer events here"
2251
+ ].filter(Boolean).join("")).join(`
2252
+ `);
2253
+ }
2254
+ function Ci(e) {
2255
+ var t;
2256
+ let n;
2257
+ if (e.hasAttribute("aria-label"))
2258
+ n = e.getAttribute("aria-label");
2259
+ else if (e.hasAttribute("aria-labelledby")) {
2260
+ var i, r;
2261
+ n = (r = e.ownerDocument.getElementById(e.getAttribute("aria-labelledby"))) === null || r === void 0 || (i = r.textContent) === null || i === void 0 ? void 0 : i.trim();
2262
+ } else if (l(e, [
2263
+ "button",
2264
+ "input",
2265
+ "meter",
2266
+ "output",
2267
+ "progress",
2268
+ "select",
2269
+ "textarea"
2270
+ ]) && (!((t = e.labels) === null || t === void 0) && t.length))
2271
+ n = Array.from(e.labels).map((s) => {
2272
+ var u;
2273
+ return (u = s.textContent) === null || u === void 0 ? void 0 : u.trim();
2274
+ }).join("|");
2275
+ else if (l(e, "button")) {
2276
+ var o;
2277
+ n = (o = e.textContent) === null || o === void 0 ? void 0 : o.trim();
2278
+ }
2279
+ return n = n == null ? void 0 : n.replace(/\n/g, " "), Number(n == null ? void 0 : n.length) > 30 && (n = `${n == null ? void 0 : n.substring(0, 29)}…`), n ? `(label=${n})` : "";
2280
+ }
2281
+ function ot(e, t) {
2282
+ return (e & t) > 0;
2283
+ }
2284
+ function S(e, t, n) {
2285
+ return t in e ? Object.defineProperty(e, t, {
2286
+ value: n,
2287
+ enumerable: !0,
2288
+ configurable: !0,
2289
+ writable: !0
2290
+ }) : e[t] = n, e;
2291
+ }
2292
+ class st {
2293
+ init(t, n) {
2294
+ this.position = n;
2295
+ const i = this.getTarget(t), [, r] = J(null, i), o = this.getEventInit();
2296
+ return X(t, i), t.dispatchUIEvent(i, "pointerover", o), r.forEach((s) => t.dispatchUIEvent(s, "pointerenter", o)), this;
2297
+ }
2298
+ move(t, n) {
2299
+ const i = this.position, r = this.getTarget(t);
2300
+ if (this.position = n, !$t(i, n))
2301
+ return;
2302
+ const o = this.getTarget(t), s = this.getEventInit(), [u, c] = J(r, o);
2303
+ return {
2304
+ leave: () => {
2305
+ he(t, r) && r !== o && (t.dispatchUIEvent(r, "pointerout", s), u.forEach((a) => t.dispatchUIEvent(a, "pointerleave", s)));
2306
+ },
2307
+ enter: () => {
2308
+ X(t, o), r !== o && (t.dispatchUIEvent(o, "pointerover", s), c.forEach((a) => t.dispatchUIEvent(a, "pointerenter", s)));
2309
+ },
2310
+ move: () => {
2311
+ t.dispatchUIEvent(o, "pointermove", s);
2312
+ }
2313
+ };
2314
+ }
2315
+ down(t, n) {
2316
+ if (this.isDown)
2317
+ return;
2318
+ const i = this.getTarget(t);
2319
+ X(t, i), this.isDown = !0, this.isPrevented = !t.dispatchUIEvent(i, "pointerdown", this.getEventInit());
2320
+ }
2321
+ up(t, n) {
2322
+ if (!this.isDown)
2323
+ return;
2324
+ const i = this.getTarget(t);
2325
+ X(t, i), this.isDown = !1, t.dispatchUIEvent(i, "pointerup", this.getEventInit());
2326
+ }
2327
+ release(t) {
2328
+ const n = this.getTarget(t), [i] = J(n, null), r = this.getEventInit();
2329
+ he(t, n) && (t.dispatchUIEvent(n, "pointerout", r), i.forEach((o) => t.dispatchUIEvent(o, "pointerleave", r))), this.isCancelled = !0;
2330
+ }
2331
+ getTarget(t) {
2332
+ var n;
2333
+ return (n = this.position.target) !== null && n !== void 0 ? n : t.config.document.body;
2334
+ }
2335
+ getEventInit() {
2336
+ return {
2337
+ ...this.position.coords,
2338
+ pointerId: this.pointerId,
2339
+ pointerType: this.pointerType,
2340
+ isPrimary: this.isPrimary
2341
+ };
2342
+ }
2343
+ constructor({ pointerId: t, pointerType: n, isPrimary: i }) {
2344
+ S(this, "pointerId", void 0), S(this, "pointerType", void 0), S(this, "isPrimary", void 0), S(this, "isMultitouch", !1), S(this, "isCancelled", !1), S(this, "isDown", !1), S(this, "isPrevented", !1), S(this, "position", {}), this.pointerId = t, this.pointerType = n, this.isPrimary = i, this.isMultitouch = !i;
2345
+ }
2346
+ }
2347
+ function _(e, t, n) {
2348
+ return t in e ? Object.defineProperty(e, t, {
2349
+ value: n,
2350
+ enumerable: !0,
2351
+ configurable: !0,
2352
+ writable: !0
2353
+ }) : e[t] = n, e;
2354
+ }
2355
+ class Ii {
2356
+ isKeyPressed(t) {
2357
+ return this.devices.get(t.pointerType).isPressed(t);
2358
+ }
2359
+ async press(t, n, i) {
2360
+ const r = this.getPointerName(n), o = n.pointerType === "touch" ? this.pointers.new(r, n).init(t, i) : this.pointers.get(r);
2361
+ o.position = i, o.pointerType !== "touch" && (this.mouse.position = i), this.devices.get(n.pointerType).addPressed(n), this.buttons.down(n), o.down(t, n), o.pointerType !== "touch" && !o.isPrevented && this.mouse.down(t, n, o);
2362
+ }
2363
+ async move(t, n, i) {
2364
+ const r = this.pointers.get(n), o = r.move(t, i), s = r.pointerType === "touch" || r.isPrevented && r.isDown ? void 0 : this.mouse.move(t, i);
2365
+ o == null || o.leave(), s == null || s.leave(), o == null || o.enter(), s == null || s.enter(), o == null || o.move(), s == null || s.move();
2366
+ }
2367
+ async release(t, n, i) {
2368
+ const r = this.devices.get(n.pointerType);
2369
+ r.removePressed(n), this.buttons.up(n);
2370
+ const o = this.pointers.get(this.getPointerName(n));
2371
+ if (o.position = i, o.pointerType !== "touch" && (this.mouse.position = i), r.countPressed === 0 && o.up(t, n), o.pointerType === "touch" && o.release(t), !o.isPrevented) {
2372
+ if (o.pointerType === "touch" && !o.isMultitouch) {
2373
+ const s = this.mouse.move(t, o.position);
2374
+ s == null || s.leave(), s == null || s.enter(), s == null || s.move(), this.mouse.down(t, n, o);
2375
+ }
2376
+ if (!o.isMultitouch) {
2377
+ const s = this.mouse.move(t, o.position);
2378
+ s == null || s.leave(), s == null || s.enter(), s == null || s.move(), this.mouse.up(t, n, o);
2379
+ }
2380
+ }
2381
+ }
2382
+ getPointerName(t) {
2383
+ return t.pointerType === "touch" ? t.name : t.pointerType;
2384
+ }
2385
+ getPreviousPosition(t) {
2386
+ return this.pointers.has(t) ? this.pointers.get(t).position : void 0;
2387
+ }
2388
+ resetClickCount() {
2389
+ this.mouse.resetClickCount();
2390
+ }
2391
+ getMouseTarget(t) {
2392
+ var n;
2393
+ return (n = this.mouse.position.target) !== null && n !== void 0 ? n : t.config.document.body;
2394
+ }
2395
+ setMousePosition(t) {
2396
+ this.mouse.position = t, this.pointers.get("mouse").position = t;
2397
+ }
2398
+ constructor(t) {
2399
+ _(this, "system", void 0), _(this, "mouse", void 0), _(this, "buttons", void 0), _(this, "devices", new class {
2400
+ get(n) {
2401
+ var i, r, o;
2402
+ return (o = (i = this.registry)[r = n]) !== null && o !== void 0 || (i[r] = new gi()), this.registry[n];
2403
+ }
2404
+ constructor() {
2405
+ _(this, "registry", {});
2406
+ }
2407
+ }()), _(this, "pointers", new class {
2408
+ new(n, i) {
2409
+ const r = i.pointerType !== "touch" || !Object.values(this.registry).some((o) => o.pointerType === "touch" && !o.isCancelled);
2410
+ return r || Object.values(this.registry).forEach((o) => {
2411
+ o.pointerType === i.pointerType && !o.isCancelled && (o.isMultitouch = !0);
2412
+ }), this.registry[n] = new st({
2413
+ pointerId: this.nextId++,
2414
+ pointerType: i.pointerType,
2415
+ isPrimary: r
2416
+ }), this.registry[n];
2417
+ }
2418
+ get(n) {
2419
+ if (!this.has(n))
2420
+ throw new Error(`Trying to access pointer "${n}" which does not exist.`);
2421
+ return this.registry[n];
2422
+ }
2423
+ has(n) {
2424
+ return n in this.registry;
2425
+ }
2426
+ constructor() {
2427
+ _(this, "registry", {
2428
+ mouse: new st({
2429
+ pointerId: 1,
2430
+ pointerType: "mouse",
2431
+ isPrimary: !0
2432
+ })
2433
+ }), _(this, "nextId", 2);
2434
+ }
2435
+ }()), this.system = t, this.buttons = new Mt(), this.mouse = new wi();
2436
+ }
2437
+ }
2438
+ function ut(e, t, n) {
2439
+ return t in e ? Object.defineProperty(e, t, {
2440
+ value: n,
2441
+ enumerable: !0,
2442
+ configurable: !0,
2443
+ writable: !0
2444
+ }) : e[t] = n, e;
2445
+ }
2446
+ class Vt {
2447
+ getUIEventModifiers() {
2448
+ return {
2449
+ altKey: this.keyboard.modifiers.Alt,
2450
+ ctrlKey: this.keyboard.modifiers.Control,
2451
+ metaKey: this.keyboard.modifiers.Meta,
2452
+ shiftKey: this.keyboard.modifiers.Shift,
2453
+ modifierAltGraph: this.keyboard.modifiers.AltGraph,
2454
+ modifierCapsLock: this.keyboard.modifiers.CapsLock,
2455
+ modifierFn: this.keyboard.modifiers.Fn,
2456
+ modifierFnLock: this.keyboard.modifiers.FnLock,
2457
+ modifierNumLock: this.keyboard.modifiers.NumLock,
2458
+ modifierScrollLock: this.keyboard.modifiers.ScrollLock,
2459
+ modifierSymbol: this.keyboard.modifiers.Symbol,
2460
+ modifierSymbolLock: this.keyboard.modifiers.SymbolLock
2461
+ };
2462
+ }
2463
+ constructor() {
2464
+ ut(this, "keyboard", new li(this)), ut(this, "pointer", new Ii(this));
2465
+ }
2466
+ }
2467
+ async function Si(e) {
2468
+ const t = [];
2469
+ return this.config.skipHover || t.push({
2470
+ target: e
2471
+ }), t.push({
2472
+ keys: "[MouseLeft]",
2473
+ target: e
2474
+ }), this.pointer(t);
2475
+ }
2476
+ async function _i(e) {
2477
+ return this.pointer([
2478
+ {
2479
+ target: e
2480
+ },
2481
+ "[MouseLeft][MouseLeft]"
2482
+ ]);
2483
+ }
2484
+ async function Pi(e) {
2485
+ return this.pointer([
2486
+ {
2487
+ target: e
2488
+ },
2489
+ "[MouseLeft][MouseLeft][MouseLeft]"
2490
+ ]);
2491
+ }
2492
+ async function Ai(e) {
2493
+ return this.pointer({
2494
+ target: e
2495
+ });
2496
+ }
2497
+ async function Oi(e) {
2498
+ return X(this, this.system.pointer.getMouseTarget(this)), this.pointer({
2499
+ target: e.ownerDocument.body
2500
+ });
2501
+ }
2502
+ async function xi({ shift: e } = {}) {
2503
+ return this.keyboard(e === !0 ? "{Shift>}{Tab}{/Shift}" : e === !1 ? "[/ShiftLeft][/ShiftRight]{Tab}" : "{Tab}");
2504
+ }
2505
+ function Ui(e, t) {
2506
+ const n = [];
2507
+ do {
2508
+ const { type: r, descriptor: o, consumedLength: s, releasePrevious: u, releaseSelf: c = !0, repeat: a } = Et(t, "keyboard");
2509
+ var i;
2510
+ const d = (i = e.find((f) => {
2511
+ if (r === "[") {
2512
+ var p;
2513
+ return ((p = f.code) === null || p === void 0 ? void 0 : p.toLowerCase()) === o.toLowerCase();
2514
+ } else if (r === "{") {
2515
+ var b;
2516
+ return ((b = f.key) === null || b === void 0 ? void 0 : b.toLowerCase()) === o.toLowerCase();
2517
+ }
2518
+ return f.key === o;
2519
+ })) !== null && i !== void 0 ? i : {
2520
+ key: "Unknown",
2521
+ code: "Unknown",
2522
+ [r === "[" ? "code" : "key"]: o
2523
+ };
2524
+ n.push({
2525
+ keyDef: d,
2526
+ releasePrevious: u,
2527
+ releaseSelf: c,
2528
+ repeat: a
2529
+ }), t = t.slice(s);
2530
+ } while (t);
2531
+ return n;
2532
+ }
2533
+ async function Di(e) {
2534
+ const t = Ui(this.config.keyboardMap, e);
2535
+ for (let n = 0; n < t.length; n++)
2536
+ await G(this.config), await Ni(this, t[n]);
2537
+ }
2538
+ async function Ni(e, { keyDef: t, releasePrevious: n, releaseSelf: i, repeat: r }) {
2539
+ const { system: o } = e;
2540
+ if (o.keyboard.isKeyPressed(t) && await o.keyboard.keyup(e, t), !n) {
2541
+ for (let s = 1; s <= r; s++)
2542
+ await o.keyboard.keydown(e, t), s < r && await G(e.config);
2543
+ i && await o.keyboard.keyup(e, t);
2544
+ }
2545
+ }
2546
+ async function Mi(e) {
2547
+ for (const t of e.system.keyboard.getPressedKeys())
2548
+ await e.system.keyboard.keyup(e, t);
2549
+ }
2550
+ function Ft(e) {
2551
+ const t = T(e) ? {
2552
+ "text/plain": Li(e)
2553
+ } : {
2554
+ "text/plain": String(e.ownerDocument.getSelection())
2555
+ }, n = Me(w(e));
2556
+ for (const i in t)
2557
+ t[i] && n.setData(i, t[i]);
2558
+ return n;
2559
+ }
2560
+ function Li(e) {
2561
+ const t = Z(e);
2562
+ return k(e).substring(t.startOffset, t.endOffset);
2563
+ }
2564
+ async function $i() {
2565
+ const e = this.config.document;
2566
+ var t;
2567
+ const n = (t = e.activeElement) !== null && t !== void 0 ? t : (
2568
+ /* istanbul ignore next */
2569
+ e.body
2570
+ ), i = Ft(n);
2571
+ if (i.items.length !== 0)
2572
+ return this.dispatchUIEvent(n, "copy", {
2573
+ clipboardData: i
2574
+ }) && this.config.writeToClipboard && await gt(e, i), i;
2575
+ }
2576
+ async function Bi() {
2577
+ const e = this.config.document;
2578
+ var t;
2579
+ const n = (t = e.activeElement) !== null && t !== void 0 ? t : (
2580
+ /* istanbul ignore next */
2581
+ e.body
2582
+ ), i = Ft(n);
2583
+ if (i.items.length !== 0)
2584
+ return this.dispatchUIEvent(n, "cut", {
2585
+ clipboardData: i
2586
+ }) && this.config.writeToClipboard && await gt(n.ownerDocument, i), i;
2587
+ }
2588
+ async function Vi(e) {
2589
+ const t = this.config.document;
2590
+ var n;
2591
+ const i = (n = t.activeElement) !== null && n !== void 0 ? n : (
2592
+ /* istanbul ignore next */
2593
+ t.body
2594
+ );
2595
+ var r;
2596
+ const o = (r = typeof e == "string" ? Fi(t, e) : e) !== null && r !== void 0 ? r : await un(t).catch(() => {
2597
+ throw new Error("`userEvent.paste()` without `clipboardData` requires the `ClipboardAPI` to be available.");
2598
+ });
2599
+ this.dispatchUIEvent(i, "paste", {
2600
+ clipboardData: o
2601
+ });
2602
+ }
2603
+ function Fi(e, t) {
2604
+ const n = Me(w(e));
2605
+ return n.setData("text", t), n;
2606
+ }
2607
+ function ct(e, t) {
2608
+ const n = [];
2609
+ do {
2610
+ const { descriptor: i, consumedLength: r, releasePrevious: o, releaseSelf: s = !0 } = Et(t, "pointer"), u = e.find((c) => c.name === i);
2611
+ u && n.push({
2612
+ keyDef: u,
2613
+ releasePrevious: o,
2614
+ releaseSelf: s
2615
+ }), t = t.slice(r);
2616
+ } while (t);
2617
+ return n;
2618
+ }
2619
+ async function Ki(e) {
2620
+ const { pointerMap: t } = this.config, n = [];
2621
+ (Array.isArray(e) ? e : [
2622
+ e
2623
+ ]).forEach((i) => {
2624
+ typeof i == "string" ? n.push(...ct(t, i)) : "keys" in i ? n.push(...ct(t, i.keys).map((r) => ({
2625
+ ...i,
2626
+ ...r
2627
+ }))) : n.push(i);
2628
+ });
2629
+ for (let i = 0; i < n.length; i++)
2630
+ await G(this.config), await Ri(this, n[i]);
2631
+ this.system.pointer.resetClickCount();
2632
+ }
2633
+ async function Ri(e, t) {
2634
+ var n, i;
2635
+ const r = "pointerName" in t && t.pointerName ? t.pointerName : "keyDef" in t ? e.system.pointer.getPointerName(t.keyDef) : "mouse", o = e.system.pointer.getPreviousPosition(r);
2636
+ var s, u, c, a;
2637
+ const d = {
2638
+ target: (s = t.target) !== null && s !== void 0 ? s : ji(e, o),
2639
+ coords: (u = t.coords) !== null && u !== void 0 ? u : o == null ? void 0 : o.coords,
2640
+ caret: {
2641
+ node: (c = t.node) !== null && c !== void 0 ? c : at(t) || o == null || (n = o.caret) === null || n === void 0 ? void 0 : n.node,
2642
+ offset: (a = t.offset) !== null && a !== void 0 ? a : at(t) || o == null || (i = o.caret) === null || i === void 0 ? void 0 : i.offset
2643
+ }
2644
+ };
2645
+ "keyDef" in t ? (e.system.pointer.isKeyPressed(t.keyDef) && (W(e, g.Trigger), await e.system.pointer.release(e, t.keyDef, d)), t.releasePrevious || (W(e, g.Trigger), await e.system.pointer.press(e, t.keyDef, d), t.releaseSelf && (W(e, g.Trigger), await e.system.pointer.release(e, t.keyDef, d)))) : (W(e, g.Trigger), await e.system.pointer.move(e, r, d));
2646
+ }
2647
+ function at(e) {
2648
+ var t, n;
2649
+ return !!((n = (t = e.target) !== null && t !== void 0 ? t : e.node) !== null && n !== void 0 ? n : e.offset !== void 0);
2650
+ }
2651
+ function ji(e, t) {
2652
+ if (!t)
2653
+ throw new Error("This pointer has no previous position. Provide a target property!");
2654
+ var n;
2655
+ return (n = t.target) !== null && n !== void 0 ? n : e.config.document.body;
2656
+ }
2657
+ async function Hi(e) {
2658
+ if (!K(e) || I(e))
2659
+ throw new Error("clear()` is only supported on editable elements.");
2660
+ if (A(e), e.ownerDocument.activeElement !== e)
2661
+ throw new Error("The element to be cleared could not be focused.");
2662
+ if (At(e), !Rn(e))
2663
+ throw new Error("The element content to be cleared could not be selected.");
2664
+ H(this, e, "", "deleteContentBackward");
2665
+ }
2666
+ async function Gi(e, t) {
2667
+ return Kt.call(this, !0, e, t);
2668
+ }
2669
+ async function zi(e, t) {
2670
+ return Kt.call(this, !1, e, t);
2671
+ }
2672
+ async function Kt(e, t, n) {
2673
+ if (!e && !t.multiple)
2674
+ throw L().getElementError("Unable to deselect an option in a non-multiple select. Use selectOptions to change the selection instead.", t);
2675
+ const i = Array.isArray(n) ? n : [
2676
+ n
2677
+ ], r = Array.from(t.querySelectorAll('option, [role="option"]')), o = i.map((u) => {
2678
+ if (typeof u != "string" && r.includes(u))
2679
+ return u;
2680
+ {
2681
+ const c = r.find((a) => a.value === u || a.innerHTML === u);
2682
+ if (c)
2683
+ return c;
2684
+ throw L().getElementError(`Value "${String(u)}" not found in options`, t);
2685
+ }
2686
+ }).filter((u) => !I(u));
2687
+ if (I(t) || !o.length) return;
2688
+ const s = (u) => {
2689
+ u.selected = e, this.dispatchUIEvent(t, "input", {
2690
+ bubbles: !0,
2691
+ cancelable: !1,
2692
+ composed: !0
2693
+ }), this.dispatchUIEvent(t, "change");
2694
+ };
2695
+ if (l(t, "select"))
2696
+ if (t.multiple)
2697
+ for (const u of o) {
2698
+ const c = this.config.pointerEventsCheck === 0 ? !0 : he(this, u);
2699
+ c && (this.dispatchUIEvent(u, "pointerover"), this.dispatchUIEvent(t, "pointerenter"), this.dispatchUIEvent(u, "mouseover"), this.dispatchUIEvent(t, "mouseenter"), this.dispatchUIEvent(u, "pointermove"), this.dispatchUIEvent(u, "mousemove"), this.dispatchUIEvent(u, "pointerdown"), this.dispatchUIEvent(u, "mousedown")), A(t), c && (this.dispatchUIEvent(u, "pointerup"), this.dispatchUIEvent(u, "mouseup")), s(u), c && this.dispatchUIEvent(u, "click"), await G(this.config);
2700
+ }
2701
+ else if (o.length === 1) {
2702
+ const u = this.config.pointerEventsCheck === 0 ? !0 : he(this, t);
2703
+ u ? await this.click(t) : A(t), s(o[0]), u && (this.dispatchUIEvent(t, "pointerover"), this.dispatchUIEvent(t, "pointerenter"), this.dispatchUIEvent(t, "mouseover"), this.dispatchUIEvent(t, "mouseenter"), this.dispatchUIEvent(t, "pointerup"), this.dispatchUIEvent(t, "mouseup"), this.dispatchUIEvent(t, "click")), await G(this.config);
2704
+ } else
2705
+ throw L().getElementError("Cannot select multiple options on a non-multiple select", t);
2706
+ else if (t.getAttribute("role") === "listbox")
2707
+ for (const u of o)
2708
+ await this.click(u), await this.unhover(u);
2709
+ else
2710
+ throw L().getElementError("Cannot select options on elements that are neither select nor listbox elements", t);
2711
+ }
2712
+ async function Wi(e, t, { skipClick: n = this.config.skipClick, skipAutoClose: i = this.config.skipAutoClose, initialSelectionStart: r, initialSelectionEnd: o } = {}) {
2713
+ e.disabled || (n || await this.click(e), r !== void 0 && q(e, r, o ?? r), await this.keyboard(t), i || await Mi(this));
2714
+ }
2715
+ const dt = Symbol("files and value properties are mocked");
2716
+ function Pe(e, t, n) {
2717
+ n ? Object.defineProperty(e, t, n) : delete e[t];
2718
+ }
2719
+ function qi(e, t) {
2720
+ var n;
2721
+ (n = e[dt]) === null || n === void 0 || n.restore();
2722
+ const i = Object.getOwnPropertyDescriptor(e, "type"), r = Object.getOwnPropertyDescriptor(e, "value"), o = Object.getOwnPropertyDescriptor(e, "files");
2723
+ function s() {
2724
+ Pe(e, "type", i), Pe(e, "value", r), Pe(e, "files", o);
2725
+ }
2726
+ e[dt] = {
2727
+ restore: s
2728
+ }, Object.defineProperties(e, {
2729
+ files: {
2730
+ configurable: !0,
2731
+ get: () => t
2732
+ },
2733
+ value: {
2734
+ configurable: !0,
2735
+ get: () => t.length ? `C:\\fakepath\\${t[0].name}` : "",
2736
+ set(u) {
2737
+ if (u === "")
2738
+ s();
2739
+ else {
2740
+ var c;
2741
+ r == null || (c = r.set) === null || c === void 0 || c.call(e, u);
2742
+ }
2743
+ }
2744
+ },
2745
+ type: {
2746
+ configurable: !0,
2747
+ get: () => "file",
2748
+ set(u) {
2749
+ u !== "file" && (s(), e.type = u);
2750
+ }
2751
+ }
2752
+ });
2753
+ }
2754
+ async function Xi(e, t) {
2755
+ const n = l(e, "label") ? e.control : e;
2756
+ if (!n || !l(n, "input", {
2757
+ type: "file"
2758
+ }))
2759
+ throw new TypeError(`The ${n === e ? "given" : "associated"} ${n == null ? void 0 : n.tagName} element does not accept file uploads`);
2760
+ if (I(e)) return;
2761
+ const i = (Array.isArray(t) ? t : [
2762
+ t
2763
+ ]).filter((o) => !this.config.applyAccept || Ji(o, n.accept)).slice(0, n.multiple ? void 0 : 1), r = () => {
2764
+ var o;
2765
+ i.length === ((o = n.files) === null || o === void 0 ? void 0 : o.length) && i.every((s, u) => {
2766
+ var c;
2767
+ return s === ((c = n.files) === null || c === void 0 ? void 0 : c.item(u));
2768
+ }) || (qi(n, Ne(w(e), i)), this.dispatchUIEvent(n, "input"), this.dispatchUIEvent(n, "change"));
2769
+ };
2770
+ n.addEventListener("fileDialog", r), await this.click(e), n.removeEventListener("fileDialog", r);
2771
+ }
2772
+ function Ji(e, t) {
2773
+ if (!t)
2774
+ return !0;
2775
+ const n = [
2776
+ "audio/*",
2777
+ "image/*",
2778
+ "video/*"
2779
+ ];
2780
+ return t.split(",").some((i) => i.startsWith(".") ? e.name.endsWith(i) : n.includes(i) ? e.type.startsWith(i.substr(0, i.length - 1)) : e.type === i);
2781
+ }
2782
+ const lt = {
2783
+ click: Si,
2784
+ dblClick: _i,
2785
+ tripleClick: Pi,
2786
+ hover: Ai,
2787
+ unhover: Oi,
2788
+ tab: xi,
2789
+ keyboard: Di,
2790
+ copy: $i,
2791
+ cut: Bi,
2792
+ paste: Vi,
2793
+ pointer: Ki,
2794
+ clear: Hi,
2795
+ deselectOptions: zi,
2796
+ selectOptions: Gi,
2797
+ type: Wi,
2798
+ upload: Xi
2799
+ };
2800
+ function Qi(e) {
2801
+ return L().asyncWrapper(e);
2802
+ }
2803
+ const Rt = {
2804
+ applyAccept: !0,
2805
+ autoModify: !0,
2806
+ delay: 0,
2807
+ document: globalThis.document,
2808
+ keyboardMap: fi,
2809
+ pointerMap: pi,
2810
+ pointerEventsCheck: B.EachApiCall,
2811
+ skipAutoClose: !1,
2812
+ skipClick: !1,
2813
+ skipHover: !1,
2814
+ writeToClipboard: !1,
2815
+ advanceTimers: () => Promise.resolve()
2816
+ }, Zi = {
2817
+ ...Rt,
2818
+ writeToClipboard: !0
2819
+ };
2820
+ function jt(e = {}, t = Zi, n) {
2821
+ const i = nr(e, n, t);
2822
+ return {
2823
+ ...t,
2824
+ ...e,
2825
+ document: i
2826
+ };
2827
+ }
2828
+ function Yi(e = {}) {
2829
+ const t = jt(e);
2830
+ Nt(t.document);
2831
+ var n;
2832
+ const i = (n = t.document.defaultView) !== null && n !== void 0 ? n : (
2833
+ /* istanbul ignore next */
2834
+ globalThis.window
2835
+ );
2836
+ return rn(i), Fe(t).api;
2837
+ }
2838
+ function v({ keyboardState: e, pointerState: t, ...n } = {}, i) {
2839
+ const r = jt(n, Rt, i);
2840
+ Nt(r.document);
2841
+ var o;
2842
+ const s = (o = t ?? e) !== null && o !== void 0 ? o : new Vt();
2843
+ return {
2844
+ api: Fe(r, s).api,
2845
+ system: s
2846
+ };
2847
+ }
2848
+ function er(e) {
2849
+ return Fe({
2850
+ ...this.config,
2851
+ ...e
2852
+ }, this.system).api;
2853
+ }
2854
+ function tr(e, t) {
2855
+ function n(...i) {
2856
+ return W(e, g.Call), Qi(() => t.apply(e, i).then(async (r) => (await G(e.config), r)));
2857
+ }
2858
+ return Object.defineProperty(n, "name", {
2859
+ get: () => t.name
2860
+ }), n;
2861
+ }
2862
+ function Fe(e, t = new Vt()) {
2863
+ const n = {};
2864
+ return Object.assign(n, {
2865
+ config: e,
2866
+ dispatchEvent: Dt.bind(n),
2867
+ dispatchUIEvent: ti.bind(n),
2868
+ system: t,
2869
+ levelRefs: {},
2870
+ ...lt
2871
+ }), {
2872
+ instance: n,
2873
+ api: {
2874
+ ...Object.fromEntries(Object.entries(lt).map(([i, r]) => [
2875
+ i,
2876
+ tr(n, r)
2877
+ ])),
2878
+ setup: er.bind(n)
2879
+ }
2880
+ };
2881
+ }
2882
+ function nr(e, t, n) {
2883
+ var i, r;
2884
+ return (r = (i = e.document) !== null && i !== void 0 ? i : t && ui(t)) !== null && r !== void 0 ? r : n.document;
2885
+ }
2886
+ function ir(e) {
2887
+ return v().api.clear(e);
2888
+ }
2889
+ function rr(e, t = {}) {
2890
+ return v(t, e).api.click(e);
2891
+ }
2892
+ function or(e = {}) {
2893
+ return v(e).api.copy();
2894
+ }
2895
+ function sr(e = {}) {
2896
+ return v(e).api.cut();
2897
+ }
2898
+ function ur(e, t = {}) {
2899
+ return v(t).api.dblClick(e);
2900
+ }
2901
+ function cr(e, t, n = {}) {
2902
+ return v(n).api.deselectOptions(e, t);
2903
+ }
2904
+ function ar(e, t = {}) {
2905
+ return v(t).api.hover(e);
2906
+ }
2907
+ async function dr(e, t = {}) {
2908
+ const { api: n, system: i } = v(t);
2909
+ return n.keyboard(e).then(() => i);
2910
+ }
2911
+ async function lr(e, t = {}) {
2912
+ const { api: n, system: i } = v(t);
2913
+ return n.pointer(e).then(() => i);
2914
+ }
2915
+ function fr(e, t) {
2916
+ return v(t).api.paste(e);
2917
+ }
2918
+ function pr(e, t, n = {}) {
2919
+ return v(n).api.selectOptions(e, t);
2920
+ }
2921
+ function hr(e, t = {}) {
2922
+ return v(t).api.tripleClick(e);
2923
+ }
2924
+ function br(e, t, n = {}) {
2925
+ return v(n, e).api.type(e, t, n);
2926
+ }
2927
+ function vr(e, t = {}) {
2928
+ const { api: n, system: i } = v(t);
2929
+ return i.pointer.setMousePosition({
2930
+ target: e
2931
+ }), n.unhover(e);
2932
+ }
2933
+ function gr(e, t, n = {}) {
2934
+ return v(n).api.upload(e, t);
2935
+ }
2936
+ function mr(e = {}) {
2937
+ return v().api.tab(e);
2938
+ }
2939
+ const yr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2940
+ __proto__: null,
2941
+ clear: ir,
2942
+ click: rr,
2943
+ copy: or,
2944
+ cut: sr,
2945
+ dblClick: ur,
2946
+ deselectOptions: cr,
2947
+ hover: ar,
2948
+ keyboard: dr,
2949
+ paste: fr,
2950
+ pointer: lr,
2951
+ selectOptions: pr,
2952
+ tab: mr,
2953
+ tripleClick: hr,
2954
+ type: br,
2955
+ unhover: vr,
2956
+ upload: gr
2957
+ }, Symbol.toStringTag, { value: "Module" })), Er = {
2958
+ ...yr,
2959
+ setup: Yi
2960
+ };
2961
+ describe("buttonGroup", () => {
2962
+ afterEach(Qt), it("should render the button group", () => {
2963
+ const e = Ke(
2964
+ /* @__PURE__ */ Ce(Re, { name: "test", size: "medium", defaultValue: "1", children: [
2965
+ /* @__PURE__ */ te(ne, { value: "1", children: "Button 1" }),
2966
+ /* @__PURE__ */ te(ne, { value: "2", children: "Button 2" })
2967
+ ] })
2968
+ ), t = e.getByText("Button 1"), n = e.getByText("Button 2");
2969
+ expect(t).toBeDefined(), expect(t).toHaveClass("gi-btn-primary-dark"), expect(t).toHaveAttribute("aria-checked", "true"), expect(n).toBeDefined(), expect(n).not.toHaveClass("gi-btn-primary-dark"), expect(n).toHaveAttribute("aria-checked", "false");
2970
+ }), it("should not submit the form on press a button group items", async () => {
2971
+ const e = vi.fn(), t = Er.setup(), n = Ke(
2972
+ /* @__PURE__ */ Ce("form", { onSubmit: e, children: [
2973
+ /* @__PURE__ */ Ce(Re, { name: "test", size: "medium", defaultValue: "1", children: [
2974
+ /* @__PURE__ */ te(ne, { value: "1", children: "Button 1" }),
2975
+ /* @__PURE__ */ te(ne, { value: "2", children: "Button 2" })
2976
+ ] }),
2977
+ ","
2978
+ ] })
2979
+ ), i = n.getByText("Button 1"), r = n.getByText("Button 2");
2980
+ await t.click(i), await t.click(r), expect(e).toBeCalledTimes(0);
2981
+ });
2982
+ });