@pnx-mixtape/mxds 0.0.23 → 0.0.26

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 (299) hide show
  1. package/.storybook/decorators.ts +7 -0
  2. package/.storybook/main.ts +29 -0
  3. package/.storybook/manager.ts +6 -0
  4. package/.storybook/preview.ts +61 -0
  5. package/.storybook/public/demo-logo.svg +4 -0
  6. package/.storybook/public/design-system.svg +1 -0
  7. package/.storybook/public/favicon.svg +7 -0
  8. package/.storybook/public/mixtape-logo.png +0 -0
  9. package/.storybook/public/mixtape.webp +0 -0
  10. package/.storybook/public/pinto.png +0 -0
  11. package/.storybook/public/pinto.svg +1 -0
  12. package/.storybook/public/xb.png +0 -0
  13. package/.storybook/public/xb.svg +1 -0
  14. package/.storybook/src/global.d.ts +16 -0
  15. package/.storybook/src/theme.ts +8 -0
  16. package/.storybook/storybook.css +35 -0
  17. package/.storybook/theme-demo.css +93 -0
  18. package/.storybook/vitest.setup.ts +17 -0
  19. package/dist/build/accordion.css +76 -86
  20. package/dist/build/accordion.entry.js +46 -72
  21. package/dist/build/base.css +1 -993
  22. package/dist/build/breadcrumb.css +1 -55
  23. package/dist/build/button.css +1 -126
  24. package/dist/build/callout.css +1 -11
  25. package/dist/build/card.css +1 -161
  26. package/dist/build/carousel.css +1 -125
  27. package/dist/build/chunks/Accordion-Dwh42fp7.js +42 -0
  28. package/dist/build/chunks/DropMenu-plGsgySm.js +43 -0
  29. package/dist/build/chunks/Popover-Bws25suh.js +27 -0
  30. package/dist/build/chunks/polyfills-Du4RTZDf.js +511 -0
  31. package/dist/build/chunks/popover-Bd5oQ1Ic.js +407 -0
  32. package/dist/build/chunks/utilities-DepaJdUg.js +242 -0
  33. package/dist/build/constants.css +91 -123
  34. package/dist/build/container-grid.css +1 -186
  35. package/dist/build/content-block.css +1 -36
  36. package/dist/build/dialog.css +1 -108
  37. package/dist/build/dialog.entry.js +45 -85
  38. package/dist/build/drop-menu.css +1 -89
  39. package/dist/build/drop-menu.entry.js +2 -2
  40. package/dist/build/drupal.css +1 -66
  41. package/dist/build/filters.css +1 -117
  42. package/dist/build/filters.entry.js +113 -142
  43. package/dist/build/footer.css +1 -141
  44. package/dist/build/form.css +1 -491
  45. package/dist/build/global-alert.css +1 -60
  46. package/dist/build/global-alert.entry.js +51 -75
  47. package/dist/build/grid.css +1 -195
  48. package/dist/build/header.css +1 -149
  49. package/dist/build/header.entry.js +598 -1180
  50. package/dist/build/hero-banner.css +1 -73
  51. package/dist/build/icon.css +1 -399
  52. package/dist/build/in-page-alert.css +1 -93
  53. package/dist/build/in-page-navigation.css +1 -17
  54. package/dist/build/in-page-navigation.entry.js +67 -103
  55. package/dist/build/link-list.css +1 -45
  56. package/dist/build/list-item.css +1 -29
  57. package/dist/build/masthead.css +1 -53
  58. package/dist/build/navigation.css +1 -356
  59. package/dist/build/navigation.entry.js +79 -222
  60. package/dist/build/page.css +1 -65
  61. package/dist/build/pagination.css +1 -111
  62. package/dist/build/popover.css +1 -119
  63. package/dist/build/popover.entry.js +1 -2
  64. package/dist/build/results-bar.css +1 -21
  65. package/dist/build/section.css +1 -147
  66. package/dist/build/side-navigation.css +1 -85
  67. package/dist/build/sidebar.css +1 -53
  68. package/dist/build/social-links.css +1 -20
  69. package/dist/build/steps.css +1 -118
  70. package/dist/build/sticky.css +1 -47
  71. package/dist/build/sticky.entry.js +48 -59
  72. package/dist/build/tabs.css +1 -108
  73. package/dist/build/tabs.entry.js +130 -209
  74. package/dist/build/tag.css +1 -70
  75. package/dist/build/utilities.css +1 -186
  76. package/dist/build/utility-list.css +1 -43
  77. package/dist/build/utility-list.entry.js +52 -80
  78. package/package.json +44 -54
  79. package/src/Atom/Atom.mdx +18 -18
  80. package/src/Atom/Background/{Backgrounds.stories.ts → Background.stories.ts} +2 -1
  81. package/src/Atom/Background/__snapshots__/Background.stories.ts.snap +81 -0
  82. package/src/Atom/Background/_background.css +10 -11
  83. package/src/Atom/Background/backgrounds.twig +6 -4
  84. package/src/Atom/Button/Button.stories.ts +0 -1
  85. package/src/Atom/Button/Button.stories.tsx +2 -0
  86. package/src/Atom/Button/__snapshots__/Button.stories.ts.snap +77 -97
  87. package/src/Atom/Button/__snapshots__/Button.stories.tsx.snap +3 -15
  88. package/src/Atom/Button/_buttons-styles.css +18 -6
  89. package/src/Atom/Button/_buttons.css +1 -1
  90. package/src/Atom/DefinitionList/DefinitionList.stories.tsx +2 -1
  91. package/src/Atom/DefinitionList/__snapshots__/DefinitionList.stories.ts.snap +13 -26
  92. package/src/Atom/DefinitionList/__snapshots__/DefinitionList.stories.tsx.snap +2 -29
  93. package/src/Atom/Heading/Heading.stories.tsx +2 -1
  94. package/src/Atom/Heading/__snapshots__/Heading.stories.ts.snap +9 -13
  95. package/src/Atom/Heading/__snapshots__/Heading.stories.tsx.snap +2 -8
  96. package/src/Atom/Icon/Icon.stories.tsx +2 -1
  97. package/src/Atom/Icon/__snapshots__/Icon.stories.ts.snap +21 -28
  98. package/src/Atom/Icon/__snapshots__/Icon.stories.tsx.snap +4 -15
  99. package/src/Atom/Icon/_extended-set.css +0 -8
  100. package/src/Atom/Icon/_icon.css +15 -6
  101. package/src/Atom/Image/__snapshots__/Image.stories.ts.snap +6 -9
  102. package/src/Atom/Link/Link.stories.tsx +2 -1
  103. package/src/Atom/Link/__snapshots__/Link.stories.ts.snap +47 -56
  104. package/src/Atom/Link/__snapshots__/Link.stories.tsx.snap +4 -22
  105. package/src/Atom/Link/_links.css +1 -0
  106. package/src/Atom/Media/Media.stories.ts +1 -1
  107. package/src/Atom/Media/Media.stories.tsx +2 -1
  108. package/src/Atom/Media/__snapshots__/Media.stories.ts.snap +27 -12
  109. package/src/Atom/Media/__snapshots__/Media.stories.tsx.snap +3 -16
  110. package/src/Atom/Spacing/__snapshots__/Spacing.stories.ts.snap +5 -8
  111. package/src/Atom/Table/Table.stories.ts +0 -1
  112. package/src/Atom/Table/TableResponsive.stories.ts +0 -1
  113. package/src/Atom/Table/__snapshots__/Table.stories.ts.snap +129 -261
  114. package/src/Atom/Table/__snapshots__/TableResponsive.stories.ts.snap +34 -67
  115. package/src/Atom/Text/Text.stories.tsx +2 -1
  116. package/src/Atom/Text/__snapshots__/Text.stories.ts.snap +32 -46
  117. package/src/Atom/Text/__snapshots__/Text.stories.tsx.snap +2 -6
  118. package/src/Atom/Video/__snapshots__/Video.stories.ts.snap +6 -11
  119. package/src/Atom/_flow.css +16 -1
  120. package/src/Component/Accordion/Accordion.stories.tsx +2 -0
  121. package/src/Component/Accordion/__snapshots__/Accordion.stories.ts.snap +106 -140
  122. package/src/Component/Accordion/__snapshots__/Accordion.stories.tsx.snap +3 -49
  123. package/src/Component/Accordion/__snapshots__/AccordionItem.stories.ts.snap +52 -81
  124. package/src/Component/Breadcrumb/Breadcrumb.stories.tsx +2 -0
  125. package/src/Component/Breadcrumb/__snapshots__/Breadcrumb.stories.ts.snap +29 -33
  126. package/src/Component/Breadcrumb/__snapshots__/Breadcrumb.stories.tsx.snap +3 -62
  127. package/src/Component/Callout/__snapshots__/Callout.stories.ts.snap +9 -11
  128. package/src/Component/Card/Card.stories.tsx +2 -0
  129. package/src/Component/Card/__snapshots__/Card.stories.ts.snap +237 -272
  130. package/src/Component/Card/__snapshots__/Card.stories.tsx.snap +4 -85
  131. package/src/Component/Carousel/Elements/Carousel.ts +10 -7
  132. package/src/Component/Carousel/__snapshots__/Carousel.stories.ts.snap +992 -1187
  133. package/src/Component/ContentBlock/ContentBlock.stories.tsx +2 -0
  134. package/src/Component/ContentBlock/__snapshots__/ContentBlock.stories.ts.snap +161 -155
  135. package/src/Component/ContentBlock/__snapshots__/ContentBlock.stories.tsx.snap +2 -25
  136. package/src/Component/Dialog/Dialog.stories.tsx +2 -0
  137. package/src/Component/Dialog/__snapshots__/Dialog.stories.ts.snap +92 -110
  138. package/src/Component/Dialog/__snapshots__/Dialog.stories.tsx.snap +2 -31
  139. package/src/Component/DropMenu/DropMenu.stories.tsx +2 -0
  140. package/src/Component/DropMenu/DropMenu.tsx +1 -3
  141. package/src/Component/DropMenu/__snapshots__/DropMenu.stories.ts.snap +25 -72
  142. package/src/Component/DropMenu/__snapshots__/DropMenu.stories.tsx.snap +2 -46
  143. package/src/Component/Filters/__snapshots__/FilterItem.stories.ts.snap +80 -121
  144. package/src/Component/Filters/__snapshots__/Filters.stories.ts.snap +323 -424
  145. package/src/Component/GlobalAlert/GlobalAlert.stories.tsx +2 -0
  146. package/src/Component/GlobalAlert/__snapshots__/GlobalAlert.stories.ts.snap +25 -37
  147. package/src/Component/GlobalAlert/__snapshots__/GlobalAlert.stories.tsx.snap +3 -46
  148. package/src/Component/HeroBanner/HeroBanner.stories.tsx +2 -0
  149. package/src/Component/HeroBanner/__snapshots__/HeroBanner.stories.ts.snap +105 -106
  150. package/src/Component/HeroBanner/__snapshots__/HeroBanner.stories.tsx.snap +3 -34
  151. package/src/Component/HeroSearch/HeroSearch.stories.ts +0 -2
  152. package/src/Component/HeroSearch/HeroSearch.stories.tsx +2 -0
  153. package/src/Component/HeroSearch/__snapshots__/HeroSearch.stories.ts.snap +122 -165
  154. package/src/Component/HeroSearch/__snapshots__/HeroSearch.stories.tsx.snap +3 -34
  155. package/src/Component/InPageAlert/InPageAlert.stories.tsx +2 -0
  156. package/src/Component/InPageAlert/__snapshots__/InPageAlert.stories.ts.snap +87 -70
  157. package/src/Component/InPageAlert/__snapshots__/InPageAlert.stories.tsx.snap +5 -65
  158. package/src/Component/InPageNavigation/InPageNavigation.stories.ts +1 -0
  159. package/src/Component/InPageNavigation/InPageNavigation.stories.tsx +2 -0
  160. package/src/Component/InPageNavigation/__snapshots__/InPageNavigation.stories.ts.snap +88 -208
  161. package/src/Component/InPageNavigation/__snapshots__/InPageNavigation.stories.tsx.snap +2 -148
  162. package/src/Component/InPageNavigation/in-page-navigation.css +5 -0
  163. package/src/Component/LinkList/LinkList.stories.tsx +2 -1
  164. package/src/Component/LinkList/__snapshots__/LinkList.stories.ts.snap +67 -66
  165. package/src/Component/LinkList/__snapshots__/LinkList.stories.tsx.snap +2 -32
  166. package/src/Component/ListItem/ListItem.stories.tsx +2 -1
  167. package/src/Component/ListItem/__snapshots__/ListItem.stories.ts.snap +153 -167
  168. package/src/Component/ListItem/__snapshots__/ListItem.stories.tsx.snap +2 -25
  169. package/src/Component/Navigation/Dropdown.stories.tsx +2 -0
  170. package/src/Component/Navigation/Elements/Navigation.ts +5 -5
  171. package/src/Component/Navigation/Navigation.stories.tsx +2 -0
  172. package/src/Component/Navigation/__snapshots__/Dropdown.stories.tsx.snap +2 -38
  173. package/src/Component/Navigation/__snapshots__/Navigation.stories.ts.snap +204 -279
  174. package/src/Component/Navigation/__snapshots__/Navigation.stories.tsx.snap +3 -59
  175. package/src/Component/Navigation/_navigation.css +2 -2
  176. package/src/Component/Pagination/Pagination.stories.tsx +2 -0
  177. package/src/Component/Pagination/__snapshots__/Pagination.stories.ts.snap +70 -60
  178. package/src/Component/Pagination/__snapshots__/Pagination.stories.tsx.snap +2 -62
  179. package/src/Component/Popover/Elements/Popover.ts +5 -1
  180. package/src/Component/Popover/Popover.stories.ts +45 -0
  181. package/src/Component/Popover/__snapshots__/Popover.stories.ts.snap +366 -470
  182. package/src/Component/Popover/popover.css +3 -4
  183. package/src/Component/ResultsBar/ResultsBar.stories.tsx +2 -0
  184. package/src/Component/ResultsBar/__snapshots__/ResultsBar.stories.ts.snap +25 -46
  185. package/src/Component/ResultsBar/__snapshots__/ResultsBar.stories.tsx.snap +4 -50
  186. package/src/Component/SideNavigation/__snapshots__/SideNavigation.stories.ts.snap +76 -81
  187. package/src/Component/SocialLinks/__snapshots__/SocialLinks.stories.ts.snap +35 -32
  188. package/src/Component/SocialShare/SocialShare.stories.tsx +2 -1
  189. package/src/Component/SocialShare/__snapshots__/SocialShare.stories.ts.snap +11 -27
  190. package/src/Component/SocialShare/__snapshots__/SocialShare.stories.tsx.snap +4 -22
  191. package/src/Component/SocialShare/social-share.twig +1 -0
  192. package/src/Component/Steps/__snapshots__/StepItem.stories.ts.snap +11 -23
  193. package/src/Component/Steps/__snapshots__/Steps.stories.ts.snap +142 -173
  194. package/src/Component/Steps/steps.css +4 -3
  195. package/src/Component/Sticky/Sticky.stories.tsx +2 -0
  196. package/src/Component/Sticky/__snapshots__/Sticky.stories.ts.snap +6 -12
  197. package/src/Component/Sticky/__snapshots__/Sticky.stories.tsx.snap +2 -10
  198. package/src/Component/Tabs/Tabs.stories.tsx +2 -0
  199. package/src/Component/Tabs/__snapshots__/TabItem.stories.ts.snap +5 -9
  200. package/src/Component/Tabs/__snapshots__/Tabs.stories.ts.snap +37 -210
  201. package/src/Component/Tabs/__snapshots__/Tabs.stories.tsx.snap +2 -116
  202. package/src/Component/Tag/Tag.stories.tsx +2 -0
  203. package/src/Component/Tag/__snapshots__/Tag.stories.ts.snap +37 -61
  204. package/src/Component/Tag/__snapshots__/Tag.stories.tsx.snap +2 -6
  205. package/src/Component/Tag/tags.twig +6 -6
  206. package/src/Component/UtilityList/__snapshots__/UtilityList.stories.ts.snap +122 -245
  207. package/src/Component/UtilityList/utility-list.css +4 -0
  208. package/src/Component/UtilityList/utility-list.twig +2 -1
  209. package/src/Form/Checkbox/FormCheckbox.stories.tsx +2 -2
  210. package/src/Form/Checkbox/__snapshots__/Checkbox.stories.ts.snap +13 -26
  211. package/src/Form/Checkbox/__snapshots__/FormCheckbox.stories.tsx.snap +5 -0
  212. package/src/Form/Description/FormDescription.stories.tsx +2 -1
  213. package/src/Form/Description/__snapshots__/Description.stories.ts.snap +5 -9
  214. package/src/Form/Description/__snapshots__/FormDescription.stories.tsx.snap +2 -9
  215. package/src/Form/Description/__snapshots__/FormStatus.stories.ts.snap +9 -17
  216. package/src/Form/Form/Form.stories.tsx +2 -1
  217. package/src/Form/Form/FormTitle.stories.tsx +2 -1
  218. package/src/Form/Form/__snapshots__/Form.stories.tsx.snap +2 -5
  219. package/src/Form/Form/__snapshots__/FormTitle.stories.tsx.snap +2 -8
  220. package/src/Form/FormItem/FormItem.stories.tsx +8 -5
  221. package/src/Form/FormItem/__snapshots__/FormItem.stories.ts.snap +88 -129
  222. package/src/Form/Label/FormLabel.stories.tsx +2 -1
  223. package/src/Form/Label/__snapshots__/FormLabel.stories.tsx.snap +3 -18
  224. package/src/Form/Label/__snapshots__/Label.stories.ts.snap +13 -25
  225. package/src/Form/Radio/FormRadio.stories.tsx +2 -14
  226. package/src/Form/Radio/__snapshots__/FormRadio.stories.tsx.snap +3 -0
  227. package/src/Form/Radio/__snapshots__/Radio.stories.ts.snap +42 -57
  228. package/src/Form/Search/__snapshots__/Search.stories.ts.snap +11 -26
  229. package/src/Form/Select/FormSelect.stories.tsx +2 -1
  230. package/src/Form/Select/__snapshots__/FormSelect.stories.tsx.snap +2 -22
  231. package/src/Form/Select/__snapshots__/Select.stories.ts.snap +8 -19
  232. package/src/Form/TextInput/FormText.stories.tsx +2 -1
  233. package/src/Form/TextInput/InputDivider.stories.ts +0 -1
  234. package/src/Form/TextInput/__snapshots__/FormText.stories.tsx.snap +2 -12
  235. package/src/Form/TextInput/__snapshots__/InputDivider.stories.ts.snap +11 -26
  236. package/src/Form/TextInput/__snapshots__/TextInput.stories.ts.snap +11 -25
  237. package/src/Form/Textarea/FormTextarea.stories.tsx +2 -1
  238. package/src/Form/Textarea/__snapshots__/FormTextarea.stories.tsx.snap +2 -11
  239. package/src/Form/Textarea/__snapshots__/Textarea.stories.ts.snap +5 -11
  240. package/src/Layout/Footer/Footer.stories.ts +18 -1
  241. package/src/Layout/Footer/Footer.stories.tsx +2 -0
  242. package/src/Layout/Footer/__snapshots__/Footer.stories.ts.snap +360 -301
  243. package/src/Layout/Footer/__snapshots__/Footer.stories.tsx.snap +3 -62
  244. package/src/Layout/Footer/footer.css +16 -35
  245. package/src/Layout/Footer/footer.twig +6 -6
  246. package/src/Layout/Grid/Grid.stories.tsx +2 -0
  247. package/src/Layout/Grid/__snapshots__/Grid.stories.ts.snap +72 -66
  248. package/src/Layout/Grid/__snapshots__/Grid.stories.tsx.snap +6 -62
  249. package/src/Layout/Grid/__snapshots__/GridItem.stories.ts.snap +9 -13
  250. package/src/Layout/Header/Header.stories.tsx +2 -1
  251. package/src/Layout/Header/__snapshots__/Header.stories.ts.snap +315 -466
  252. package/src/Layout/Header/__snapshots__/Header.stories.tsx.snap +2 -58
  253. package/src/Layout/Masthead/__snapshots__/Masthead.stories.ts.snap +86 -87
  254. package/src/Layout/Page/Page.stories.tsx +2 -0
  255. package/src/Layout/Page/__snapshots__/Page.stories.tsx.snap +2 -81
  256. package/src/Layout/Section/__snapshots__/Background.stories.ts.snap +51 -61
  257. package/src/Layout/Section/__snapshots__/Breakouts.stories.ts.snap +34 -78
  258. package/src/Layout/Section/__snapshots__/Flow.stories.ts.snap +54 -89
  259. package/src/Layout/Section/__snapshots__/Section.stories.ts.snap +89 -99
  260. package/src/Layout/Section/__snapshots__/Section.stories.tsx.snap +4 -34
  261. package/src/Layout/Section/__snapshots__/SectionGrid.stories.tsx.snap +3 -35
  262. package/src/Layout/Section/section.twig +2 -2
  263. package/src/Layout/Sidebar/Sidebar.stories.tsx +1 -1
  264. package/src/Layout/Sidebar/__snapshots__/Sidebar.stories.ts.snap +49 -40
  265. package/src/Layout/Sidebar/__snapshots__/Sidebar.stories.tsx.snap +4 -44
  266. package/src/Layout/Sidebar/sidebar.css +2 -2
  267. package/src/Layout/Sidebar/sidebar.twig +8 -5
  268. package/src/Utility/_layout-utils.css +9 -1
  269. package/src/constants.css +115 -114
  270. package/src/enums.ts +1 -0
  271. package/src/tokens.js +26 -19
  272. package/dist/build/accordion.entry.js.map +0 -1
  273. package/dist/build/chunks/Accordion-D1HQ0FDq.js +0 -63
  274. package/dist/build/chunks/Accordion-D1HQ0FDq.js.map +0 -1
  275. package/dist/build/chunks/disclosure-widget-CdjCdx7t.js +0 -129
  276. package/dist/build/chunks/disclosure-widget-CdjCdx7t.js.map +0 -1
  277. package/dist/build/chunks/drop-menu.entry-fzV-_VFl.js +0 -70
  278. package/dist/build/chunks/drop-menu.entry-fzV-_VFl.js.map +0 -1
  279. package/dist/build/chunks/polyfills-DnrsypYs.js +0 -812
  280. package/dist/build/chunks/polyfills-DnrsypYs.js.map +0 -1
  281. package/dist/build/chunks/popover-DzUcnIlX.js +0 -797
  282. package/dist/build/chunks/popover-DzUcnIlX.js.map +0 -1
  283. package/dist/build/chunks/popover.entry-BQvyR0d5.js +0 -38
  284. package/dist/build/chunks/popover.entry-BQvyR0d5.js.map +0 -1
  285. package/dist/build/chunks/utilities-Ci7wwNeg.js +0 -148
  286. package/dist/build/chunks/utilities-Ci7wwNeg.js.map +0 -1
  287. package/dist/build/dialog.entry.js.map +0 -1
  288. package/dist/build/drop-menu.entry.js.map +0 -1
  289. package/dist/build/filters.entry.js.map +0 -1
  290. package/dist/build/global-alert.entry.js.map +0 -1
  291. package/dist/build/header.entry.js.map +0 -1
  292. package/dist/build/in-page-navigation.entry.js.map +0 -1
  293. package/dist/build/navigation.entry.js.map +0 -1
  294. package/dist/build/popover.entry.js.map +0 -1
  295. package/dist/build/sticky.entry.js.map +0 -1
  296. package/dist/build/tabs.entry.js.map +0 -1
  297. package/dist/build/utility-list.entry.js.map +0 -1
  298. package/src/Atom/Background/__snapshots__/Backgrounds.stories.ts.snap +0 -176
  299. package/src/Form/FormItem/__snapshots__/FormItem.stories.tsx.snap +0 -110
@@ -0,0 +1,407 @@
1
+ var ToggleEvent = class extends Event {
2
+ oldState;
3
+ newState;
4
+ constructor(s, { oldState: j = "", newState: M = "", ...N } = {}) {
5
+ super(s, N), this.oldState = String(j || ""), this.newState = String(M || "");
6
+ }
7
+ }, popoverToggleTaskQueue = /* @__PURE__ */ new WeakMap();
8
+ function queuePopoverToggleEventTask(M, N, P) {
9
+ popoverToggleTaskQueue.set(M, setTimeout(() => {
10
+ popoverToggleTaskQueue.has(M) && M.dispatchEvent(new ToggleEvent("toggle", {
11
+ cancelable: !1,
12
+ oldState: N,
13
+ newState: P
14
+ }));
15
+ }, 0));
16
+ }
17
+ var ShadowRoot = globalThis.ShadowRoot || function() {}, HTMLDialogElement = globalThis.HTMLDialogElement || function() {}, topLayerElements = /* @__PURE__ */ new WeakMap(), autoPopoverList = /* @__PURE__ */ new WeakMap(), hintPopoverList = /* @__PURE__ */ new WeakMap(), visibilityState = /* @__PURE__ */ new WeakMap();
18
+ function getPopoverVisibilityState(s) {
19
+ return visibilityState.get(s) || "hidden";
20
+ }
21
+ var popoverInvoker = /* @__PURE__ */ new WeakMap();
22
+ function lastSetElement(s) {
23
+ return [...s].pop();
24
+ }
25
+ function popoverTargetAttributeActivationBehavior(s) {
26
+ let j = s.popoverTargetElement;
27
+ if (!(j instanceof HTMLElement)) return;
28
+ let M = getPopoverVisibilityState(j);
29
+ s.popoverTargetAction === "show" && M === "showing" || s.popoverTargetAction === "hide" && M === "hidden" || (M === "showing" ? hidePopover(j, !0, !0) : checkPopoverValidity(j, !1) && (popoverInvoker.set(j, s), showPopover(j)));
30
+ }
31
+ function checkPopoverValidity(s, j) {
32
+ return !(s.popover !== "auto" && s.popover !== "manual" && s.popover !== "hint" || !s.isConnected || j && getPopoverVisibilityState(s) !== "showing" || !j && getPopoverVisibilityState(s) !== "hidden" || s instanceof HTMLDialogElement && s.hasAttribute("open") || document.fullscreenElement === s);
33
+ }
34
+ function getStackPosition(s) {
35
+ if (!s) return 0;
36
+ let j = autoPopoverList.get(document) || /* @__PURE__ */ new Set(), M = hintPopoverList.get(document) || /* @__PURE__ */ new Set();
37
+ return M.has(s) ? [...M].indexOf(s) + j.size + 1 : j.has(s) ? [...j].indexOf(s) + 1 : 0;
38
+ }
39
+ function topMostClickedPopover(s) {
40
+ let j = nearestInclusiveOpenPopover(s), M = nearestInclusiveTargetPopoverForInvoker(s);
41
+ return getStackPosition(j) > getStackPosition(M) ? j : M;
42
+ }
43
+ function topmostAutoOrHintPopover(s) {
44
+ let j, M = hintPopoverList.get(s) || /* @__PURE__ */ new Set(), N = autoPopoverList.get(s) || /* @__PURE__ */ new Set(), P = M.size > 0 ? M : N.size > 0 ? N : null;
45
+ return P ? (j = lastSetElement(P), j.isConnected ? j : (P.delete(j), topmostAutoOrHintPopover(s))) : null;
46
+ }
47
+ function topMostPopoverInList(s) {
48
+ for (let j of s || []) if (!j.isConnected) s.delete(j);
49
+ else return j;
50
+ return null;
51
+ }
52
+ function getRootNode(s) {
53
+ return typeof s.getRootNode == "function" ? s.getRootNode() : s.parentNode ? getRootNode(s.parentNode) : s;
54
+ }
55
+ function nearestInclusiveOpenPopover(s) {
56
+ for (; s;) {
57
+ if (s instanceof HTMLElement && s.popover === "auto" && visibilityState.get(s) === "showing") return s;
58
+ if (s = s instanceof Element && s.assignedSlot || s.parentElement || getRootNode(s), s instanceof ShadowRoot && (s = s.host), s instanceof Document) return;
59
+ }
60
+ }
61
+ function nearestInclusiveTargetPopoverForInvoker(s) {
62
+ for (; s;) {
63
+ let j = s.popoverTargetElement;
64
+ if (j instanceof HTMLElement) return j;
65
+ if (s = s.parentElement || getRootNode(s), s instanceof ShadowRoot && (s = s.host), s instanceof Document) return;
66
+ }
67
+ }
68
+ function topMostPopoverAncestor(s, j) {
69
+ let M = /* @__PURE__ */ new Map(), N = 0;
70
+ for (let s of j || []) M.set(s, N), N += 1;
71
+ M.set(s, N), N += 1;
72
+ let P = null;
73
+ function F(j) {
74
+ if (!j) return;
75
+ let N = !1, F = null, I = null;
76
+ for (; !N;) {
77
+ if (F = nearestInclusiveOpenPopover(j) || null, F === null || !M.has(F)) return;
78
+ (s.popover === "hint" || F.popover === "auto") && (N = !0), N || (j = F.parentElement);
79
+ }
80
+ I = M.get(F), (P === null || M.get(P) < I) && (P = F);
81
+ }
82
+ return F(s.parentElement || getRootNode(s)), P;
83
+ }
84
+ function isFocusable(s) {
85
+ return s.hidden || s instanceof ShadowRoot || (s instanceof HTMLButtonElement || s instanceof HTMLInputElement || s instanceof HTMLSelectElement || s instanceof HTMLTextAreaElement || s instanceof HTMLOptGroupElement || s instanceof HTMLOptionElement || s instanceof HTMLFieldSetElement) && s.disabled || s instanceof HTMLInputElement && s.type === "hidden" || s instanceof HTMLAnchorElement && s.href === "" ? !1 : typeof s.tabIndex == "number" && s.tabIndex !== -1;
86
+ }
87
+ function focusDelegate(s) {
88
+ if (s.shadowRoot && s.shadowRoot.delegatesFocus !== !0) return null;
89
+ let j = s;
90
+ j.shadowRoot && (j = j.shadowRoot);
91
+ let M = j.querySelector("[autofocus]");
92
+ if (M) return M;
93
+ {
94
+ let s = j.querySelectorAll("slot");
95
+ for (let j of s) {
96
+ let s = j.assignedElements({ flatten: !0 });
97
+ for (let j of s) if (j.hasAttribute("autofocus")) return j;
98
+ else if (M = j.querySelector("[autofocus]"), M) return M;
99
+ }
100
+ }
101
+ let N = s.ownerDocument.createTreeWalker(j, NodeFilter.SHOW_ELEMENT), P = N.currentNode;
102
+ for (; P;) {
103
+ if (isFocusable(P)) return P;
104
+ P = N.nextNode();
105
+ }
106
+ }
107
+ function popoverFocusingSteps(s) {
108
+ var j;
109
+ (j = focusDelegate(s)) == null || j.focus();
110
+ }
111
+ var previouslyFocusedElements = /* @__PURE__ */ new WeakMap();
112
+ function showPopover(j) {
113
+ if (!checkPopoverValidity(j, !1)) return;
114
+ let N = j.ownerDocument;
115
+ if (!j.dispatchEvent(new ToggleEvent("beforetoggle", {
116
+ cancelable: !0,
117
+ oldState: "closed",
118
+ newState: "open"
119
+ })) || !checkPopoverValidity(j, !1)) return;
120
+ let P = !1, R = j.popover, z = null, B = topMostPopoverAncestor(j, autoPopoverList.get(N) || /* @__PURE__ */ new Set()), V = topMostPopoverAncestor(j, hintPopoverList.get(N) || /* @__PURE__ */ new Set());
121
+ if (R === "auto" && (closeAllOpenPopoversInList(hintPopoverList.get(N) || /* @__PURE__ */ new Set(), P, !0), hideAllPopoversUntil(B || N, P, !0), z = "auto"), R === "hint" && (V ? (hideAllPopoversUntil(V, P, !0), z = "hint") : (closeAllOpenPopoversInList(hintPopoverList.get(N) || /* @__PURE__ */ new Set(), P, !0), B ? (hideAllPopoversUntil(B, P, !0), z = "auto") : z = "hint")), R === "auto" || R === "hint") {
122
+ if (R !== j.popover || !checkPopoverValidity(j, !1)) return;
123
+ topmostAutoOrHintPopover(N) || (P = !0), z === "auto" ? (autoPopoverList.has(N) || autoPopoverList.set(N, /* @__PURE__ */ new Set()), autoPopoverList.get(N).add(j)) : z === "hint" && (hintPopoverList.has(N) || hintPopoverList.set(N, /* @__PURE__ */ new Set()), hintPopoverList.get(N).add(j));
124
+ }
125
+ previouslyFocusedElements.delete(j);
126
+ let H = N.activeElement;
127
+ j.classList.add(":popover-open"), visibilityState.set(j, "showing"), topLayerElements.has(N) || topLayerElements.set(N, /* @__PURE__ */ new Set()), topLayerElements.get(N).add(j), setInvokerAriaExpanded(popoverInvoker.get(j), !0), popoverFocusingSteps(j), P && H && j.popover === "auto" && previouslyFocusedElements.set(j, H), queuePopoverToggleEventTask(j, "closed", "open");
128
+ }
129
+ function hidePopover(j, N = !1, P = !1) {
130
+ var R, B;
131
+ if (!checkPopoverValidity(j, !0)) return;
132
+ let V = j.ownerDocument;
133
+ if (["auto", "hint"].includes(j.popover) && (hideAllPopoversUntil(j, N, P), !checkPopoverValidity(j, !0))) return;
134
+ let H = autoPopoverList.get(V) || /* @__PURE__ */ new Set(), U = H.has(j) && lastSetElement(H) === j;
135
+ if (setInvokerAriaExpanded(popoverInvoker.get(j), !1), popoverInvoker.delete(j), P && (j.dispatchEvent(new ToggleEvent("beforetoggle", {
136
+ oldState: "open",
137
+ newState: "closed"
138
+ })), U && lastSetElement(H) !== j && hideAllPopoversUntil(j, N, P), !checkPopoverValidity(j, !0))) return;
139
+ (R = topLayerElements.get(V)) == null || R.delete(j), H.delete(j), (B = hintPopoverList.get(V)) == null || B.delete(j), j.classList.remove(":popover-open"), visibilityState.set(j, "hidden"), P && queuePopoverToggleEventTask(j, "open", "closed");
140
+ let W = previouslyFocusedElements.get(j);
141
+ W && (previouslyFocusedElements.delete(j), N && W.focus());
142
+ }
143
+ function closeAllOpenPopovers(s, j = !1, M = !1) {
144
+ let N = topmostAutoOrHintPopover(s);
145
+ for (; N;) hidePopover(N, j, M), N = topmostAutoOrHintPopover(s);
146
+ }
147
+ function closeAllOpenPopoversInList(s, j = !1, M = !1) {
148
+ let N = topMostPopoverInList(s);
149
+ for (; N;) hidePopover(N, j, M), N = topMostPopoverInList(s);
150
+ }
151
+ function hidePopoverStackUntil(s, j, M, N) {
152
+ let P = !1, F = !1;
153
+ for (; P || !F;) {
154
+ F = !0;
155
+ let I = null, L = !1;
156
+ for (let M of j) if (M === s) L = !0;
157
+ else if (L) {
158
+ I = M;
159
+ break;
160
+ }
161
+ if (!I) return;
162
+ for (; getPopoverVisibilityState(I) === "showing" && j.size;) hidePopover(lastSetElement(j), M, N);
163
+ j.has(s) && lastSetElement(j) !== s && (P = !0), P && (N = !1);
164
+ }
165
+ }
166
+ function hideAllPopoversUntil(s, j, M) {
167
+ let N = s.ownerDocument || s;
168
+ if (s instanceof Document) return closeAllOpenPopovers(N, j, M);
169
+ if (hintPopoverList.get(N)?.has(s)) {
170
+ hidePopoverStackUntil(s, hintPopoverList.get(N), j, M);
171
+ return;
172
+ }
173
+ closeAllOpenPopoversInList(hintPopoverList.get(N) || /* @__PURE__ */ new Set(), j, M), autoPopoverList.get(N)?.has(s) && hidePopoverStackUntil(s, autoPopoverList.get(N), j, M);
174
+ }
175
+ var popoverPointerDownTargets = /* @__PURE__ */ new WeakMap();
176
+ function lightDismissOpenPopovers(s) {
177
+ if (!s.isTrusted) return;
178
+ let j = s.composedPath()[0];
179
+ if (!j) return;
180
+ let M = j.ownerDocument;
181
+ if (!topmostAutoOrHintPopover(M)) return;
182
+ let N = topMostClickedPopover(j);
183
+ if (N && s.type === "pointerdown") popoverPointerDownTargets.set(M, N);
184
+ else if (s.type === "pointerup") {
185
+ let s = popoverPointerDownTargets.get(M) === N;
186
+ popoverPointerDownTargets.delete(M), s && hideAllPopoversUntil(N || M, !1, !0);
187
+ }
188
+ }
189
+ var initialAriaExpandedValue = /* @__PURE__ */ new WeakMap();
190
+ function setInvokerAriaExpanded(s, j = !1) {
191
+ if (!s) return;
192
+ initialAriaExpandedValue.has(s) || initialAriaExpandedValue.set(s, s.getAttribute("aria-expanded"));
193
+ let M = s.popoverTargetElement;
194
+ if (M instanceof HTMLElement && M.popover === "auto") s.setAttribute("aria-expanded", String(j));
195
+ else {
196
+ let j = initialAriaExpandedValue.get(s);
197
+ j ? s.setAttribute("aria-expanded", j) : s.removeAttribute("aria-expanded");
198
+ }
199
+ }
200
+ var ShadowRoot2 = globalThis.ShadowRoot || function() {};
201
+ function isSupported() {
202
+ return typeof HTMLElement < "u" && typeof HTMLElement.prototype == "object" && "popover" in HTMLElement.prototype;
203
+ }
204
+ function patchSelectorFn(s, j, M) {
205
+ let N = s[j];
206
+ Object.defineProperty(s, j, { value(s) {
207
+ return N.call(this, M(s));
208
+ } });
209
+ }
210
+ var nonEscapedPopoverSelector = /(^|[^\\]):popover-open\b/g;
211
+ function hasLayerSupport() {
212
+ return typeof globalThis.CSSLayerBlockRule == "function";
213
+ }
214
+ function getStyles() {
215
+ let s = hasLayerSupport();
216
+ return `
217
+ ${s ? "@layer popover-polyfill {" : ""}
218
+ :where([popover]) {
219
+ position: fixed;
220
+ z-index: 2147483647;
221
+ inset: 0;
222
+ padding: 0.25em;
223
+ width: fit-content;
224
+ height: fit-content;
225
+ border-width: initial;
226
+ border-color: initial;
227
+ border-image: initial;
228
+ border-style: solid;
229
+ background-color: canvas;
230
+ color: canvastext;
231
+ overflow: auto;
232
+ margin: auto;
233
+ }
234
+
235
+ :where([popover]:not(.\\:popover-open)) {
236
+ display: none;
237
+ }
238
+
239
+ :where(dialog[popover].\\:popover-open) {
240
+ display: block;
241
+ }
242
+
243
+ :where(dialog[popover][open]) {
244
+ display: revert;
245
+ }
246
+
247
+ :where([anchor].\\:popover-open) {
248
+ inset: auto;
249
+ }
250
+
251
+ :where([anchor]:popover-open) {
252
+ inset: auto;
253
+ }
254
+
255
+ @supports not (background-color: canvas) {
256
+ :where([popover]) {
257
+ background-color: white;
258
+ color: black;
259
+ }
260
+ }
261
+
262
+ @supports (width: -moz-fit-content) {
263
+ :where([popover]) {
264
+ width: -moz-fit-content;
265
+ height: -moz-fit-content;
266
+ }
267
+ }
268
+
269
+ @supports not (inset: 0) {
270
+ :where([popover]) {
271
+ top: 0;
272
+ left: 0;
273
+ right: 0;
274
+ bottom: 0;
275
+ }
276
+ }
277
+ ${s ? "}" : ""}
278
+ `;
279
+ }
280
+ var popoverStyleSheet = null;
281
+ function injectStyles(s) {
282
+ let j = getStyles();
283
+ if (popoverStyleSheet === null) try {
284
+ popoverStyleSheet = new CSSStyleSheet(), popoverStyleSheet.replaceSync(j);
285
+ } catch {
286
+ popoverStyleSheet = !1;
287
+ }
288
+ if (popoverStyleSheet === !1) {
289
+ let M = document.createElement("style");
290
+ M.textContent = j, s instanceof Document ? s.head.prepend(M) : s.prepend(M);
291
+ } else s.adoptedStyleSheets = [popoverStyleSheet, ...s.adoptedStyleSheets];
292
+ }
293
+ function apply() {
294
+ if (typeof window > "u") return;
295
+ window.ToggleEvent = window.ToggleEvent || ToggleEvent;
296
+ function j(s) {
297
+ return s?.includes(":popover-open") && (s = s.replace(nonEscapedPopoverSelector, "$1.\\:popover-open")), s;
298
+ }
299
+ patchSelectorFn(Document.prototype, "querySelector", j), patchSelectorFn(Document.prototype, "querySelectorAll", j), patchSelectorFn(Element.prototype, "querySelector", j), patchSelectorFn(Element.prototype, "querySelectorAll", j), patchSelectorFn(Element.prototype, "matches", j), patchSelectorFn(Element.prototype, "closest", j), patchSelectorFn(DocumentFragment.prototype, "querySelectorAll", j), Object.defineProperties(HTMLElement.prototype, {
300
+ popover: {
301
+ enumerable: !0,
302
+ configurable: !0,
303
+ get() {
304
+ if (!this.hasAttribute("popover")) return null;
305
+ let s = (this.getAttribute("popover") || "").toLowerCase();
306
+ return s === "" || s == "auto" ? "auto" : s == "hint" ? "hint" : "manual";
307
+ },
308
+ set(s) {
309
+ s === null ? this.removeAttribute("popover") : this.setAttribute("popover", s);
310
+ }
311
+ },
312
+ showPopover: {
313
+ enumerable: !0,
314
+ configurable: !0,
315
+ value(s = {}) {
316
+ showPopover(this);
317
+ }
318
+ },
319
+ hidePopover: {
320
+ enumerable: !0,
321
+ configurable: !0,
322
+ value() {
323
+ hidePopover(this, !0, !0);
324
+ }
325
+ },
326
+ togglePopover: {
327
+ enumerable: !0,
328
+ configurable: !0,
329
+ value(s = {}) {
330
+ return typeof s == "boolean" && (s = { force: s }), visibilityState.get(this) === "showing" && s.force === void 0 || s.force === !1 ? hidePopover(this, !0, !0) : (s.force === void 0 || s.force === !0) && showPopover(this), visibilityState.get(this) === "showing";
331
+ }
332
+ }
333
+ });
334
+ let M = Element.prototype.attachShadow;
335
+ M && Object.defineProperties(Element.prototype, { attachShadow: {
336
+ enumerable: !0,
337
+ configurable: !0,
338
+ writable: !0,
339
+ value(s) {
340
+ let j = M.call(this, s);
341
+ return injectStyles(j), j;
342
+ }
343
+ } });
344
+ let N = HTMLElement.prototype.attachInternals;
345
+ N && Object.defineProperties(HTMLElement.prototype, { attachInternals: {
346
+ enumerable: !0,
347
+ configurable: !0,
348
+ writable: !0,
349
+ value() {
350
+ let s = N.call(this);
351
+ return s.shadowRoot && injectStyles(s.shadowRoot), s;
352
+ }
353
+ } });
354
+ let P = /* @__PURE__ */ new WeakMap();
355
+ function F(s) {
356
+ Object.defineProperties(s.prototype, {
357
+ popoverTargetElement: {
358
+ enumerable: !0,
359
+ configurable: !0,
360
+ set(s) {
361
+ if (s === null) this.removeAttribute("popovertarget"), P.delete(this);
362
+ else if (s instanceof Element) this.setAttribute("popovertarget", ""), P.set(this, s);
363
+ else throw TypeError("popoverTargetElement must be an element or null");
364
+ },
365
+ get() {
366
+ if (this.localName !== "button" && this.localName !== "input" || this.localName === "input" && this.type !== "reset" && this.type !== "image" && this.type !== "button" || this.disabled || this.form && this.type === "submit") return null;
367
+ let s = P.get(this);
368
+ if (s && s.isConnected) return s;
369
+ if (s && !s.isConnected) return P.delete(this), null;
370
+ let j = getRootNode(this), M = this.getAttribute("popovertarget");
371
+ return (j instanceof Document || j instanceof ShadowRoot2) && M && j.getElementById(M) || null;
372
+ }
373
+ },
374
+ popoverTargetAction: {
375
+ enumerable: !0,
376
+ configurable: !0,
377
+ get() {
378
+ let s = (this.getAttribute("popovertargetaction") || "").toLowerCase();
379
+ return s === "show" || s === "hide" ? s : "toggle";
380
+ },
381
+ set(s) {
382
+ this.setAttribute("popovertargetaction", s);
383
+ }
384
+ }
385
+ });
386
+ }
387
+ F(HTMLButtonElement), F(HTMLInputElement);
388
+ let I = (s) => {
389
+ if (s.defaultPrevented) return;
390
+ let j = s.composedPath(), M = j[0];
391
+ if (!(M instanceof Element) || M?.shadowRoot) return;
392
+ let N = getRootNode(M);
393
+ if (!(N instanceof ShadowRoot2 || N instanceof Document)) return;
394
+ let P = j.find((s) => s.matches?.call(s, "[popovertargetaction],[popovertarget]"));
395
+ if (P) {
396
+ popoverTargetAttributeActivationBehavior(P), s.preventDefault();
397
+ return;
398
+ }
399
+ }, L = (s) => {
400
+ let j = s.key, M = s.target;
401
+ !s.defaultPrevented && M && (j === "Escape" || j === "Esc") && hideAllPopoversUntil(M.ownerDocument, !0, !0);
402
+ };
403
+ ((s) => {
404
+ s.addEventListener("click", I), s.addEventListener("keydown", L), s.addEventListener("pointerdown", lightDismissOpenPopovers), s.addEventListener("pointerup", lightDismissOpenPopovers);
405
+ })(document), injectStyles(document);
406
+ }
407
+ isSupported() || apply();
@@ -0,0 +1,242 @@
1
+ var DisclosureWidget = class {
2
+ options;
3
+ context;
4
+ trigger;
5
+ element;
6
+ id;
7
+ isOpen;
8
+ attached;
9
+ constructor(e, t, n, r = document) {
10
+ if (!e) throw Error("toggle is required.");
11
+ if (!t) throw Error("element is required.");
12
+ this.options = {
13
+ attribute: "inert",
14
+ shouldPreventDefault: !0,
15
+ setInitialAttribute: !0,
16
+ clickEvent: "click",
17
+ ...n
18
+ }, this.context = r || document, this.trigger = e, this.element = t, this.id = this.element.id || this.generatedId();
19
+ }
20
+ init = () => {
21
+ if (Object.prototype.hasOwnProperty.call(this.trigger, "disclosureWidget")) return;
22
+ let { attribute: e, setInitialAttribute: t } = this.options;
23
+ this.trigger.disclosureWidget = this, t && this.element.setAttribute(e, ""), this.attach();
24
+ };
25
+ handleToggle = () => {
26
+ let { attribute: e, setInitialAttribute: t } = this.options;
27
+ this.element.toggleAttribute(e);
28
+ let n = this.element.hasAttribute(e);
29
+ this.isOpen = t ? !n : n, this.trigger.setAttribute("aria-expanded", String(this.isOpen));
30
+ let r = new CustomEvent("disclosure-toggle", {
31
+ bubbles: !0,
32
+ cancelable: !0,
33
+ detail: {
34
+ isOpen: this.isOpen,
35
+ id: this.id,
36
+ options: this.options,
37
+ target: this.element
38
+ }
39
+ });
40
+ this.trigger.dispatchEvent(r);
41
+ };
42
+ handleMouse = (e) => {
43
+ let { currentTarget: t, type: n, relatedTarget: r } = e;
44
+ if (n === "mouseover" || n === "mouseout") {
45
+ let e = this.trigger.parentNode;
46
+ if (e !== t || e.contains(r)) return;
47
+ } else if (this.trigger !== t) return;
48
+ let { shouldPreventDefault: i } = this.options;
49
+ this.handleToggle(), i && (e.preventDefault(), e.stopPropagation());
50
+ };
51
+ handleKeyboard = (e) => {
52
+ let { key: t, target: n } = e;
53
+ if (this.trigger !== n) return;
54
+ let { isOpen: r } = this, { shouldPreventDefault: i } = this.options;
55
+ switch (t) {
56
+ case "ArrowDown":
57
+ case "Enter":
58
+ r || this.handleToggle(), i && e.preventDefault();
59
+ break;
60
+ case "ArrowUp":
61
+ case "Escape":
62
+ r && this.handleToggle(), i && e.preventDefault();
63
+ break;
64
+ default: break;
65
+ }
66
+ };
67
+ attach = () => {
68
+ if (this.attached) return;
69
+ let { clickEvent: e } = this.options;
70
+ if (e === "mouseover") {
71
+ let e = this.trigger.parentNode;
72
+ e.addEventListener("mouseover", this.handleMouse), e.addEventListener("mouseout", this.handleMouse);
73
+ } else this.trigger.addEventListener("click", this.handleMouse);
74
+ this.trigger.addEventListener("keydown", this.handleKeyboard), this.trigger.setAttribute("aria-expanded", "false"), this.trigger.hasAttribute("aria-controls") || this.trigger.setAttribute("aria-controls", this.id), this.attached = !0;
75
+ };
76
+ detach = () => {
77
+ if (!this.attached) return;
78
+ this.isOpen && this.handleToggle();
79
+ let { clickEvent: e } = this.options;
80
+ if (e === "mouseover") {
81
+ let e = this.trigger.parentNode;
82
+ e.removeEventListener("mouseover", this.handleMouse), e.removeEventListener("mouseout", this.handleMouse);
83
+ } else this.trigger.removeEventListener("click", this.handleMouse);
84
+ this.trigger.removeEventListener("keydown", this.handleKeyboard), this.trigger.removeAttribute("aria-expanded"), this.attached = !1;
85
+ };
86
+ generatedId = () => {
87
+ let e = this.trigger?.textContent?.trim();
88
+ return e ? makeAnchor(e) : "";
89
+ };
90
+ }, Keyboard = class {
91
+ constructor() {
92
+ window.Mixtape = window.Mixtape || {}, window.Mixtape.Popups = window.Mixtape.Popups || [], window.Mixtape.Menu = window.Mixtape.Menu || {};
93
+ }
94
+ attachPopup = (e, t) => {
95
+ window.Mixtape.Popups.push({
96
+ id: e,
97
+ closefn: t
98
+ });
99
+ };
100
+ detachPopup = (e) => {
101
+ window.Mixtape.Popups = window.Mixtape.Popups.filter((t) => t.id !== e);
102
+ };
103
+ attachMenu = (e, t) => {
104
+ window.Mixtape.Menu = {
105
+ context: e,
106
+ items: t
107
+ };
108
+ };
109
+ detachMenu = () => {
110
+ window.Mixtape.Menu = null;
111
+ };
112
+ getNextFocusableMenuItem = (e, t = !1) => t ? e === 0 ? window.Mixtape.Menu.items.length - 1 : e - 1 : window.Mixtape.Menu.items.length > e + 1 ? e + 1 : 0;
113
+ moveFocus = (e, t = !1) => {
114
+ if (!window.Mixtape.Menu.items) return;
115
+ let n = 0;
116
+ window.Mixtape.Menu.items.forEach((t, r) => {
117
+ t === e && (n = r);
118
+ });
119
+ let r = this.getNextFocusableMenuItem(n, t), i = window.Mixtape.Menu.items[r].getAttribute("tabindex");
120
+ if (i !== "-1") window.Mixtape.Menu.items[r].focus();
121
+ else {
122
+ for (; i === "-1";) r = this.getNextFocusableMenuItem(r, t), i = window.Mixtape.Menu.items[r].getAttribute("tabindex");
123
+ window.Mixtape.Menu.items[r].focus();
124
+ }
125
+ window.Mixtape.Menu.active = r;
126
+ };
127
+ handleGlobalClick = ({ target: e }) => {
128
+ let t = window.Mixtape.Popups ? window.Mixtape.Popups[window.Mixtape.Popups.length - 1] : null;
129
+ if (t && t.id) {
130
+ let n = document.querySelector(`#${t.id}`).parentElement;
131
+ if (n && (e === n || n?.contains(e))) return;
132
+ t.closefn();
133
+ }
134
+ };
135
+ handleGlobalKeydown = (e) => {
136
+ let t = window.Mixtape.Popups ? window.Mixtape.Popups[window.Mixtape.Popups.length - 1] : null, n = e.target;
137
+ switch (e.key) {
138
+ case "Escape":
139
+ t && t.closefn();
140
+ break;
141
+ case "ArrowDown":
142
+ case "ArrowRight":
143
+ window.Mixtape.Menu?.items && (e.preventDefault(), this.moveFocus(n));
144
+ break;
145
+ case "ArrowUp":
146
+ case "ArrowLeft":
147
+ window.Mixtape.Menu?.items && (e.preventDefault(), this.moveFocus(n, !0));
148
+ break;
149
+ default: break;
150
+ }
151
+ };
152
+ attachEventListeners = (e) => {
153
+ window.addEventListener("click", this.handleGlobalClick, { signal: e }), window.addEventListener("keydown", this.handleGlobalKeydown, { signal: e });
154
+ };
155
+ };
156
+ function assign(e) {
157
+ for (var t = 1; t < arguments.length; t++) {
158
+ var n = arguments[t];
159
+ for (var r in n) e[r] = n[r];
160
+ }
161
+ return e;
162
+ }
163
+ var defaultConverter = {
164
+ read: function(e) {
165
+ return e[0] === "\"" && (e = e.slice(1, -1)), e.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent);
166
+ },
167
+ write: function(e) {
168
+ return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g, decodeURIComponent);
169
+ }
170
+ };
171
+ function init(e, t) {
172
+ function r(r, i, a) {
173
+ if (!(typeof document > "u")) {
174
+ a = assign({}, t, a), typeof a.expires == "number" && (a.expires = new Date(Date.now() + a.expires * 864e5)), a.expires &&= a.expires.toUTCString(), r = encodeURIComponent(r).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);
175
+ var o = "";
176
+ for (var s in a) a[s] && (o += "; " + s, a[s] !== !0 && (o += "=" + a[s].split(";")[0]));
177
+ return document.cookie = r + "=" + e.write(i, r) + o;
178
+ }
179
+ }
180
+ function a(t) {
181
+ if (!(typeof document > "u" || arguments.length && !t)) {
182
+ for (var n = document.cookie ? document.cookie.split("; ") : [], r = {}, i = 0; i < n.length; i++) {
183
+ var a = n[i].split("="), o = a.slice(1).join("=");
184
+ try {
185
+ var s = decodeURIComponent(a[0]);
186
+ if (r[s] = e.read(o, s), t === s) break;
187
+ } catch {}
188
+ }
189
+ return t ? r[t] : r;
190
+ }
191
+ }
192
+ return Object.create({
193
+ set: r,
194
+ get: a,
195
+ remove: function(e, t) {
196
+ r(e, "", assign({}, t, { expires: -1 }));
197
+ },
198
+ withAttributes: function(e) {
199
+ return init(this.converter, assign({}, this.attributes, e));
200
+ },
201
+ withConverter: function(e) {
202
+ return init(assign({}, this.converter, e), this.attributes);
203
+ }
204
+ }, {
205
+ attributes: { value: Object.freeze(t) },
206
+ converter: { value: Object.freeze(e) }
207
+ });
208
+ }
209
+ init(defaultConverter, { path: "/" });
210
+ const makeAnchor = (e, t = 20) => {
211
+ if (typeof e != "string" || !e) return "";
212
+ let n = e.toLowerCase().trim().replace(/\s+/g, "-").replace(/[^-a-z0-9]/g, "").replace(/[\n\r]+|[\s]{2,}/g, "");
213
+ return [...[
214
+ ,
215
+ ,
216
+ ,
217
+ ,
218
+ ,
219
+ ,
220
+ ].keys()].forEach(() => {
221
+ n.charAt(0).match(/[a-z]/g) || (n = n.substring(1));
222
+ }), t && (n = n.substring(0, t + 1)), n;
223
+ }, createElement = (e) => {
224
+ try {
225
+ let t = document.createElement("div");
226
+ return t.innerHTML = e, t.firstElementChild;
227
+ } catch (e) {
228
+ return console.error(e), null;
229
+ }
230
+ }, handleOutsideClick = (e, t, n, r = []) => {
231
+ let { target: i, clientY: a, clientX: o } = e, s = i instanceof HTMLOptionElement || i instanceof HTMLSelectElement;
232
+ if ((r?.filter((e) => e === i || e.contains(i))).length || s) return;
233
+ let c = new IntersectionObserver(([{ boundingClientRect: e }]) => {
234
+ let { top: t, height: r, width: i, left: s } = e;
235
+ t <= a && a <= t + r && s <= o && o <= s + i || n(), c.disconnect();
236
+ });
237
+ c.observe(t);
238
+ }, handleEscape = (e, t) => {
239
+ let { key: n } = e;
240
+ n === "Escape" && t();
241
+ };
242
+ export { Keyboard as a, makeAnchor as i, handleEscape as n, DisclosureWidget as o, handleOutsideClick as r, createElement as t };