@furcrer/fullstack-components 0.1.0 → 1.0.1

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 (193) hide show
  1. package/README.md +2 -2
  2. package/dist/index.js +2015 -1088
  3. package/dist/styles.css +1 -1
  4. package/dist/types/components/containers/Grid/Grid.d.ts +1 -0
  5. package/dist/types/components/containers/Stack/Stack.d.ts +1 -0
  6. package/dist/types/components/data/CrudExample/CrudExample.d.ts +1 -0
  7. package/dist/types/components/data/ResourceTable/ResourceTable.d.ts +3 -2
  8. package/dist/types/components/data/ResultsCount/ResultsCount.d.ts +11 -0
  9. package/dist/types/components/data/ResultsCount/ResultsCount.fixture.d.ts +2 -0
  10. package/dist/types/components/data/ResultsCount/ResultsCount.variants.d.ts +11 -0
  11. package/dist/types/components/data/ResultsCount/index.d.ts +2 -0
  12. package/dist/types/components/forms/ColorInput/ColorInput.d.ts +6 -0
  13. package/dist/types/components/forms/DateInput/DateInput.d.ts +9 -0
  14. package/dist/types/components/forms/FileInput/FileInput.d.ts +6 -0
  15. package/dist/types/components/forms/MultiSelectFilter/MultiSelectFilter.d.ts +23 -0
  16. package/dist/types/components/forms/MultiSelectFilter/MultiSelectFilter.fixture.d.ts +2 -0
  17. package/dist/types/components/forms/MultiSelectFilter/MultiSelectFilter.variants.d.ts +9 -0
  18. package/dist/types/components/forms/MultiSelectFilter/index.d.ts +2 -0
  19. package/dist/types/components/forms/NumberInput/NumberInput.d.ts +8 -0
  20. package/dist/types/components/forms/PasswordInput/PasswordInput.d.ts +6 -0
  21. package/dist/types/components/forms/RadioGroup/RadioGroup.d.ts +8 -0
  22. package/dist/types/components/forms/SearchInput/SearchInput.d.ts +4 -0
  23. package/dist/types/components/forms/SelectFilter/SelectFilter.d.ts +19 -0
  24. package/dist/types/components/forms/SelectFilter/SelectFilter.fixture.d.ts +2 -0
  25. package/dist/types/components/forms/SelectFilter/SelectFilter.variants.d.ts +9 -0
  26. package/dist/types/components/forms/SelectFilter/index.d.ts +2 -0
  27. package/dist/types/components/forms/Slider/Slider.d.ts +10 -0
  28. package/dist/types/components/ohm/ActionBar/ActionBar.d.ts +17 -0
  29. package/dist/types/components/ohm/ActionBar/ActionBar.fixture.d.ts +2 -0
  30. package/dist/types/components/ohm/ActionBar/ActionBar.variants.d.ts +13 -0
  31. package/dist/types/components/ohm/ActionBar/index.d.ts +2 -0
  32. package/dist/types/components/ohm/DataField/DataField.d.ts +27 -0
  33. package/dist/types/components/ohm/DataField/DataField.fixture.d.ts +2 -0
  34. package/dist/types/components/ohm/DataField/DataField.variants.d.ts +5 -0
  35. package/dist/types/components/ohm/DataField/index.d.ts +2 -0
  36. package/dist/types/components/ohm/DocumentList/DocumentList.d.ts +21 -0
  37. package/dist/types/components/ohm/DocumentList/DocumentList.fixture.d.ts +2 -0
  38. package/dist/types/components/ohm/DocumentList/DocumentList.variants.d.ts +5 -0
  39. package/dist/types/components/ohm/DocumentList/index.d.ts +2 -0
  40. package/dist/types/components/ohm/EntityCard/EntityCard.d.ts +14 -0
  41. package/dist/types/components/ohm/EntityCard/EntityCard.fixture.d.ts +2 -0
  42. package/dist/types/components/ohm/EntityCard/EntityCard.variants.d.ts +7 -0
  43. package/dist/types/components/ohm/EntityCard/index.d.ts +2 -0
  44. package/dist/types/components/ohm/Main/Main.d.ts +8 -0
  45. package/dist/types/components/ohm/Main/Main.fixture.d.ts +3 -0
  46. package/dist/types/components/ohm/Main/Main.variants.d.ts +5 -0
  47. package/dist/types/components/ohm/Main/index.d.ts +2 -0
  48. package/dist/types/components/ohm/Navbar/Navbar.d.ts +115 -0
  49. package/dist/types/components/ohm/Navbar/Navbar.fixture.d.ts +2 -0
  50. package/dist/types/components/ohm/Navbar/Navbar.variants.d.ts +75 -0
  51. package/dist/types/components/ohm/Navbar/index.d.ts +2 -0
  52. package/dist/types/components/ohm/PageHeader/PageHeader.d.ts +11 -0
  53. package/dist/types/components/ohm/PageHeader/PageHeader.fixture.d.ts +2 -0
  54. package/dist/types/components/ohm/PageHeader/PageHeader.variants.d.ts +15 -0
  55. package/dist/types/components/ohm/PageHeader/index.d.ts +2 -0
  56. package/dist/types/components/ohm/PhotoGrid/PhotoGrid.d.ts +19 -0
  57. package/dist/types/components/ohm/PhotoGrid/PhotoGrid.fixture.d.ts +2 -0
  58. package/dist/types/components/ohm/PhotoGrid/PhotoGrid.variants.d.ts +5 -0
  59. package/dist/types/components/ohm/PhotoGrid/index.d.ts +2 -0
  60. package/dist/types/components/ohm/SearchFilterSection/SearchFilterSection.d.ts +20 -0
  61. package/dist/types/components/ohm/SearchFilterSection/SearchFilterSection.fixture.d.ts +1 -0
  62. package/dist/types/components/ohm/SearchFilterSection/SearchFilterSection.variants.d.ts +5 -0
  63. package/dist/types/components/ohm/SearchFilterSection/index.d.ts +2 -0
  64. package/dist/types/components/ohm/Table/Table.d.ts +5 -0
  65. package/dist/types/{data → components/ohm/Table}/Table.fixture.d.ts +1 -1
  66. package/dist/types/components/ohm/Table/Table.types.d.ts +43 -0
  67. package/dist/types/components/ohm/Table/Table.variants.d.ts +23 -0
  68. package/dist/types/components/ohm/Table/TableAction/TableAction.d.ts +6 -0
  69. package/dist/types/components/ohm/Table/TableAction/TableAction.fixture.d.ts +2 -0
  70. package/dist/types/components/ohm/Table/TableAction/TableAction.variants.d.ts +22 -0
  71. package/dist/types/components/ohm/Table/TableAction/index.d.ts +2 -0
  72. package/dist/types/components/ohm/Table/TableActions/TableActions.d.ts +11 -0
  73. package/dist/types/components/ohm/Table/TableActions/TableActions.fixture.d.ts +2 -0
  74. package/dist/types/components/ohm/Table/TableActions/TableActions.variants.d.ts +28 -0
  75. package/dist/types/components/ohm/Table/TableActions/index.d.ts +2 -0
  76. package/dist/types/components/ohm/Table/TableBody/TableBody.d.ts +6 -0
  77. package/dist/types/components/ohm/Table/TableBody/TableBody.fixture.d.ts +2 -0
  78. package/dist/types/components/ohm/Table/TableBody/TableBody.variants.d.ts +7 -0
  79. package/dist/types/components/ohm/Table/TableBody/index.d.ts +2 -0
  80. package/dist/types/components/ohm/Table/TableCell/TableCell.d.ts +7 -0
  81. package/dist/types/components/ohm/Table/TableCell/TableCell.fixture.d.ts +2 -0
  82. package/dist/types/components/ohm/Table/TableCell/TableCell.variants.d.ts +7 -0
  83. package/dist/types/components/ohm/Table/TableCell/index.d.ts +2 -0
  84. package/dist/types/components/ohm/Table/TableEmpty/TableEmpty.d.ts +6 -0
  85. package/dist/types/components/ohm/Table/TableEmpty/TableEmpty.fixture.d.ts +2 -0
  86. package/dist/types/components/ohm/Table/TableEmpty/TableEmpty.variants.d.ts +8 -0
  87. package/dist/types/components/ohm/Table/TableEmpty/index.d.ts +2 -0
  88. package/dist/types/components/ohm/Table/TableError/TableError.d.ts +6 -0
  89. package/dist/types/components/ohm/Table/TableError/TableError.fixture.d.ts +2 -0
  90. package/dist/types/components/ohm/Table/TableError/TableError.variants.d.ts +8 -0
  91. package/dist/types/components/ohm/Table/TableError/index.d.ts +2 -0
  92. package/dist/types/components/ohm/Table/TableExpand/TableExpand.d.ts +7 -0
  93. package/dist/types/components/ohm/Table/TableExpand/TableExpand.fixture.d.ts +2 -0
  94. package/dist/types/components/ohm/Table/TableExpand/TableExpand.variants.d.ts +7 -0
  95. package/dist/types/components/ohm/Table/TableExpand/index.d.ts +2 -0
  96. package/dist/types/components/ohm/Table/TableFooter/TableFooter.d.ts +6 -0
  97. package/dist/types/components/ohm/Table/TableFooter/TableFooter.fixture.d.ts +2 -0
  98. package/dist/types/components/ohm/Table/TableFooter/TableFooter.variants.d.ts +7 -0
  99. package/dist/types/components/ohm/Table/TableFooter/index.d.ts +2 -0
  100. package/dist/types/components/ohm/Table/TableHeader/TableHeader.d.ts +6 -0
  101. package/dist/types/components/ohm/Table/TableHeader/TableHeader.fixture.d.ts +2 -0
  102. package/dist/types/components/ohm/Table/TableHeader/TableHeader.variants.d.ts +7 -0
  103. package/dist/types/components/ohm/Table/TableHeader/index.d.ts +2 -0
  104. package/dist/types/components/ohm/Table/TableHeaderCell/TableHeaderCell.d.ts +2 -0
  105. package/dist/types/components/ohm/Table/TableHeaderCell/TableHeaderCell.fixture.d.ts +2 -0
  106. package/dist/types/components/ohm/Table/TableHeaderCell/TableHeaderCell.variants.d.ts +15 -0
  107. package/dist/types/components/ohm/Table/TableHeaderCell/index.d.ts +2 -0
  108. package/dist/types/components/ohm/Table/TableLoading/TableLoading.d.ts +5 -0
  109. package/dist/types/components/ohm/Table/TableLoading/TableLoading.fixture.d.ts +2 -0
  110. package/dist/types/components/ohm/Table/TableLoading/TableLoading.variants.d.ts +7 -0
  111. package/dist/types/components/ohm/Table/TableLoading/index.d.ts +2 -0
  112. package/dist/types/components/ohm/Table/TablePagination/TablePagination.d.ts +6 -0
  113. package/dist/types/components/ohm/Table/TablePagination/TablePagination.fixture.d.ts +2 -0
  114. package/dist/types/components/ohm/Table/TablePagination/TablePagination.variants.d.ts +8 -0
  115. package/dist/types/components/ohm/Table/TablePagination/index.d.ts +2 -0
  116. package/dist/types/components/ohm/Table/TableRow/TableRow.d.ts +8 -0
  117. package/dist/types/components/ohm/Table/TableRow/TableRow.fixture.d.ts +2 -0
  118. package/dist/types/components/ohm/Table/TableRow/TableRow.variants.d.ts +7 -0
  119. package/dist/types/components/ohm/Table/TableRow/index.d.ts +2 -0
  120. package/dist/types/components/ohm/Table/TableRowActions/TableRowActions.d.ts +6 -0
  121. package/dist/types/components/ohm/Table/TableRowActions/TableRowActions.fixture.d.ts +2 -0
  122. package/dist/types/components/ohm/Table/TableRowActions/TableRowActions.variants.d.ts +7 -0
  123. package/dist/types/components/ohm/Table/TableRowActions/index.d.ts +2 -0
  124. package/dist/types/components/ohm/Table/TableSelection/TableSelection.d.ts +7 -0
  125. package/dist/types/components/ohm/Table/TableSelection/TableSelection.fixture.d.ts +2 -0
  126. package/dist/types/components/ohm/Table/TableSelection/TableSelection.variants.d.ts +7 -0
  127. package/dist/types/components/ohm/Table/TableSelection/index.d.ts +2 -0
  128. package/dist/types/components/ohm/Table/TableSort/TableSort.d.ts +8 -0
  129. package/dist/types/components/ohm/Table/TableSort/TableSort.fixture.d.ts +2 -0
  130. package/dist/types/components/ohm/Table/TableSort/TableSort.variants.d.ts +8 -0
  131. package/dist/types/components/ohm/Table/TableSort/index.d.ts +2 -0
  132. package/dist/types/components/ohm/Table/TableStructure/TableStructure.d.ts +11 -0
  133. package/dist/types/components/ohm/Table/TableStructure/TableStructure.fixture.d.ts +2 -0
  134. package/dist/types/components/ohm/Table/TableStructure/TableStructure.variants.d.ts +14 -0
  135. package/dist/types/components/ohm/Table/TableStructure/index.d.ts +2 -0
  136. package/dist/types/components/ohm/Table/index.d.ts +21 -0
  137. package/dist/types/components/overlays/FilterMenu/FilterMenu.d.ts +17 -0
  138. package/dist/types/components/overlays/FilterMenu/FilterMenu.fixture.d.ts +2 -0
  139. package/dist/types/components/overlays/FilterMenu/FilterMenu.variants.d.ts +9 -0
  140. package/dist/types/components/overlays/FilterMenu/index.d.ts +2 -0
  141. package/dist/types/components/primitives/Accordion/Accordion.d.ts +1 -0
  142. package/dist/types/components/primitives/Alert/Alert.d.ts +1 -0
  143. package/dist/types/components/primitives/Avatar/Avatar.d.ts +1 -0
  144. package/dist/types/components/primitives/Button/Button.types.d.ts +2 -0
  145. package/dist/types/components/primitives/Button/Button.variants.d.ts +34 -0
  146. package/dist/types/components/primitives/Carousel/Carousel.d.ts +1 -0
  147. package/dist/types/components/primitives/Combobox/Combobox.d.ts +1 -0
  148. package/dist/types/components/primitives/CommandPalette/CommandPalette.d.ts +1 -0
  149. package/dist/types/components/primitives/ContextMenu/ContextMenu.d.ts +1 -0
  150. package/dist/types/components/primitives/DatePicker/DatePicker.d.ts +1 -0
  151. package/dist/types/components/primitives/Drawer/Drawer.d.ts +5 -0
  152. package/dist/types/components/primitives/DropdownMenu/DropdownMenu.d.ts +1 -0
  153. package/dist/types/components/primitives/FileUpload/FileUpload.d.ts +1 -0
  154. package/dist/types/components/primitives/FormField/FormField.variants.d.ts +19 -0
  155. package/dist/types/components/primitives/Heading/Heading.d.ts +3 -0
  156. package/dist/types/components/primitives/Link/Link.d.ts +1 -0
  157. package/dist/types/components/primitives/Menubar/Menubar.d.ts +1 -0
  158. package/dist/types/components/primitives/MultiSelect/MultiSelect.d.ts +1 -0
  159. package/dist/types/components/primitives/NavigationMenu/NavigationMenu.d.ts +1 -0
  160. package/dist/types/components/primitives/Pagination/Pagination.d.ts +4 -0
  161. package/dist/types/components/primitives/Popover/Popover.d.ts +4 -0
  162. package/dist/types/components/primitives/Progress/Progress.d.ts +4 -0
  163. package/dist/types/components/primitives/ResizablePanel/ResizablePanel.d.ts +1 -0
  164. package/dist/types/components/primitives/SearchBar/SearchBar.d.ts +1 -0
  165. package/dist/types/components/primitives/Separator/Separator.d.ts +1 -0
  166. package/dist/types/components/primitives/Sidebar/Sidebar.d.ts +1 -0
  167. package/dist/types/components/primitives/Skeleton/Skeleton.d.ts +1 -0
  168. package/dist/types/components/primitives/Spinner/Spinner.d.ts +1 -0
  169. package/dist/types/components/primitives/Stepper/Stepper.d.ts +1 -0
  170. package/dist/types/components/primitives/Tabs/Tabs.d.ts +1 -0
  171. package/dist/types/components/primitives/Text/Text.d.ts +1 -0
  172. package/dist/types/components/primitives/Toast/Toast.d.ts +1 -0
  173. package/dist/types/components/primitives/Tooltip/Tooltip.d.ts +2 -0
  174. package/dist/types/components/primitives/TreeView/TreeView.d.ts +1 -0
  175. package/dist/types/data/index.d.ts +0 -1
  176. package/dist/types/forms/FormActions.d.ts +2 -0
  177. package/dist/types/forms/FormField.d.ts +4 -0
  178. package/dist/types/forms/react-form.d.ts +6 -0
  179. package/dist/types/forms/react.d.ts +6 -1
  180. package/dist/types/generated/component-registry.d.ts +2913 -50
  181. package/dist/types/generated/public-exports.d.ts +92 -0
  182. package/dist/types/types/metadata.d.ts +23 -3
  183. package/package.json +3 -2
  184. package/dist/types/data/Table.d.ts +0 -13
  185. package/dist/types/data/resource-controller.test.d.ts +0 -1
  186. package/dist/types/theme/theme.test.d.ts +0 -1
  187. package/dist/types/tooling/discovery/discover.d.ts +0 -9
  188. package/dist/types/tooling/discovery/discover.test.d.ts +0 -1
  189. package/dist/types/tooling/discovery/generate-exports.d.ts +0 -6
  190. package/dist/types/tooling/discovery/generate-registry.d.ts +0 -6
  191. package/dist/types/tooling/discovery/generate-registry.test.d.ts +0 -1
  192. package/dist/types/tooling/discovery/generate.d.ts +0 -1
  193. package/dist/types/tooling/discovery/vite-plugin.d.ts +0 -8
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import ye, { createContext as re, useState as T, useEffect as M, useMemo as P, useContext as ne, useRef as $, useSyncExternalStore as N, useCallback as E, useId as ae } from "react";
2
- const Se = {
1
+ import Re, { createContext as ae, useState as w, useEffect as P, useMemo as I, useContext as H, useRef as A, useSyncExternalStore as Z, useCallback as R, useId as fe } from "react";
2
+ const Pe = {
3
3
  0: "0rem",
4
4
  1: "0.25rem",
5
5
  2: "0.5rem",
@@ -11,13 +11,13 @@ const Se = {
11
11
  10: "2.5rem",
12
12
  12: "3rem",
13
13
  16: "4rem"
14
- }, we = {
14
+ }, Oe = {
15
15
  none: "0",
16
16
  small: "0.25rem",
17
17
  medium: "0.5rem",
18
18
  large: "0.75rem",
19
19
  full: "9999px"
20
- }, Ee = {
20
+ }, Ae = {
21
21
  xs: "0.75rem",
22
22
  sm: "0.875rem",
23
23
  md: "1rem",
@@ -25,24 +25,24 @@ const Se = {
25
25
  xl: "1.25rem",
26
26
  "2xl": "1.5rem",
27
27
  "3xl": "1.875rem"
28
- }, Te = {
28
+ }, ze = {
29
29
  regular: 400,
30
30
  medium: 500,
31
31
  semibold: 600,
32
32
  bold: 700
33
- }, Ce = {
33
+ }, $e = {
34
34
  none: "none",
35
35
  sm: "0 1px 2px rgb(0 0 0 / 0.08)",
36
36
  md: "0 4px 10px rgb(0 0 0 / 0.12)",
37
37
  lg: "0 12px 28px rgb(0 0 0 / 0.16)"
38
- }, ke = {
38
+ }, Le = {
39
39
  base: 0,
40
40
  dropdown: 100,
41
41
  sticky: 200,
42
42
  overlay: 300,
43
43
  modal: 400,
44
44
  toast: 500
45
- }, R = {
45
+ }, M = {
46
46
  colors: {
47
47
  surface: "#ffffff",
48
48
  surfaceMuted: "#f7f7f7",
@@ -69,26 +69,26 @@ const Se = {
69
69
  warningContrast: "#ffffff",
70
70
  warningSurface: "#fffbeb"
71
71
  },
72
- spacing: Se,
73
- radius: we,
74
- fontSize: Ee,
75
- fontWeight: Te,
76
- shadows: Ce,
77
- zIndex: ke
72
+ spacing: Pe,
73
+ radius: Oe,
74
+ fontSize: Ae,
75
+ fontWeight: ze,
76
+ shadows: $e,
77
+ zIndex: Le
78
78
  };
79
- function Re(e = {}) {
79
+ function Ie(e = {}) {
80
80
  return {
81
- colors: { ...R.colors, ...e.colors },
82
- states: { ...R.states, ...e.states },
83
- spacing: { ...R.spacing, ...e.spacing },
84
- radius: { ...R.radius, ...e.radius },
85
- fontSize: { ...R.fontSize, ...e.fontSize },
86
- fontWeight: { ...R.fontWeight, ...e.fontWeight },
87
- shadows: { ...R.shadows, ...e.shadows },
88
- zIndex: { ...R.zIndex, ...e.zIndex }
81
+ colors: { ...M.colors, ...e.colors },
82
+ states: { ...M.states, ...e.states },
83
+ spacing: { ...M.spacing, ...e.spacing },
84
+ radius: { ...M.radius, ...e.radius },
85
+ fontSize: { ...M.fontSize, ...e.fontSize },
86
+ fontWeight: { ...M.fontWeight, ...e.fontWeight },
87
+ shadows: { ...M.shadows, ...e.shadows },
88
+ zIndex: { ...M.zIndex, ...e.zIndex }
89
89
  };
90
90
  }
91
- const _e = Re({
91
+ const Fe = Ie({
92
92
  colors: {
93
93
  surface: "#171717",
94
94
  surfaceMuted: "#262626",
@@ -116,10 +116,10 @@ const _e = Re({
116
116
  warningSurface: "#422006"
117
117
  }
118
118
  });
119
- function Pe(e) {
119
+ function Me(e) {
120
120
  return e.replace(/[A-Z]/g, (r) => `-${r.toLowerCase()}`);
121
121
  }
122
- const Oe = {
122
+ const De = {
123
123
  colors: "color",
124
124
  states: "state",
125
125
  spacing: "space",
@@ -129,364 +129,364 @@ const Oe = {
129
129
  shadows: "shadow",
130
130
  zIndex: "z-index"
131
131
  };
132
- function se(e) {
132
+ function Se(e) {
133
133
  const r = {};
134
- for (const [t, n] of Object.entries(e)) {
135
- const s = Oe[t];
136
- for (const [o, i] of Object.entries(n))
137
- r[`--fsc-${s}-${Pe(o)}`] = String(i);
134
+ for (const [n, a] of Object.entries(e)) {
135
+ const s = De[n];
136
+ for (const [o, i] of Object.entries(a))
137
+ r[`--fsc-${s}-${Me(o)}`] = String(i);
138
138
  }
139
139
  return r;
140
140
  }
141
- function ut(e) {
142
- const r = se(e);
141
+ function Qt(e) {
142
+ const r = Se(e);
143
143
  return `:root {
144
- ${Object.entries(r).map(([n, s]) => ` ${n}: ${s};`).join(`
144
+ ${Object.entries(r).map(([a, s]) => ` ${a}: ${s};`).join(`
145
145
  `)}
146
146
  }`;
147
147
  }
148
- function Ae(e) {
148
+ function Be(e) {
149
149
  const r = [];
150
- for (const [t, n] of Object.entries(e)) {
151
- if (!n || typeof n != "object") {
152
- r.push(`Missing theme group: ${t}`);
150
+ for (const [n, a] of Object.entries(e)) {
151
+ if (!a || typeof a != "object") {
152
+ r.push(`Missing theme group: ${n}`);
153
153
  continue;
154
154
  }
155
- for (const [s, o] of Object.entries(n))
156
- (o == null || typeof o == "string" && o.trim() === "") && r.push(`Missing theme value: ${t}.${s}`);
155
+ for (const [s, o] of Object.entries(a))
156
+ (o == null || typeof o == "string" && o.trim() === "") && r.push(`Missing theme value: ${n}.${s}`);
157
157
  }
158
158
  return r;
159
159
  }
160
- function $e(e, r, t) {
161
- const n = Ae(r);
162
- if (n.length > 0)
163
- throw new Error(`Invalid theme: ${n.join(", ")}`);
164
- const s = se(r), o = /* @__PURE__ */ new Map(), i = e.style.colorScheme, c = e.dataset.theme;
165
- for (const [u, f] of Object.entries(s))
166
- o.set(u, e.style.getPropertyValue(u)), e.style.setProperty(u, f);
167
- return t && (e.dataset.theme = t, e.style.colorScheme = t), () => {
168
- for (const [u, f] of o)
169
- f ? e.style.setProperty(u, f) : e.style.removeProperty(u);
170
- c === void 0 ? delete e.dataset.theme : e.dataset.theme = c, e.style.colorScheme = i;
160
+ function Ve(e, r, n) {
161
+ const a = Be(r);
162
+ if (a.length > 0)
163
+ throw new Error(`Invalid theme: ${a.join(", ")}`);
164
+ const s = Se(r), o = /* @__PURE__ */ new Map(), i = e.style.colorScheme, l = e.dataset.theme;
165
+ for (const [c, d] of Object.entries(s))
166
+ o.set(c, e.style.getPropertyValue(c)), e.style.setProperty(c, d);
167
+ return n && (e.dataset.theme = n, e.style.colorScheme = n), () => {
168
+ for (const [c, d] of o)
169
+ d ? e.style.setProperty(c, d) : e.style.removeProperty(c);
170
+ l === void 0 ? delete e.dataset.theme : e.dataset.theme = l, e.style.colorScheme = i;
171
171
  };
172
172
  }
173
- var F = { exports: {} }, z = {};
174
- var H;
175
- function Ne() {
176
- if (H) return z;
177
- H = 1;
173
+ var te = { exports: {} }, J = {};
174
+ var pe;
175
+ function Ue() {
176
+ if (pe) return J;
177
+ pe = 1;
178
178
  var e = /* @__PURE__ */ Symbol.for("react.transitional.element"), r = /* @__PURE__ */ Symbol.for("react.fragment");
179
- function t(n, s, o) {
179
+ function n(a, s, o) {
180
180
  var i = null;
181
181
  if (o !== void 0 && (i = "" + o), s.key !== void 0 && (i = "" + s.key), "key" in s) {
182
182
  o = {};
183
- for (var c in s)
184
- c !== "key" && (o[c] = s[c]);
183
+ for (var l in s)
184
+ l !== "key" && (o[l] = s[l]);
185
185
  } else o = s;
186
186
  return s = o.ref, {
187
187
  $$typeof: e,
188
- type: n,
188
+ type: a,
189
189
  key: i,
190
190
  ref: s !== void 0 ? s : null,
191
191
  props: o
192
192
  };
193
193
  }
194
- return z.Fragment = r, z.jsx = t, z.jsxs = t, z;
195
- }
196
- var I = {};
197
- var X;
198
- function ze() {
199
- return X || (X = 1, process.env.NODE_ENV !== "production" && (function() {
200
- function e(l) {
201
- if (l == null) return null;
202
- if (typeof l == "function")
203
- return l.$$typeof === ve ? null : l.displayName || l.name || null;
204
- if (typeof l == "string") return l;
205
- switch (l) {
206
- case m:
194
+ return J.Fragment = r, J.jsx = n, J.jsxs = n, J;
195
+ }
196
+ var G = {};
197
+ var be;
198
+ function We() {
199
+ return be || (be = 1, process.env.NODE_ENV !== "production" && (function() {
200
+ function e(u) {
201
+ if (u == null) return null;
202
+ if (typeof u == "function")
203
+ return u.$$typeof === U ? null : u.displayName || u.name || null;
204
+ if (typeof u == "string") return u;
205
+ switch (u) {
206
+ case p:
207
207
  return "Fragment";
208
208
  case C:
209
209
  return "Profiler";
210
- case v:
210
+ case j:
211
211
  return "StrictMode";
212
- case me:
212
+ case q:
213
213
  return "Suspense";
214
- case pe:
214
+ case le:
215
215
  return "SuspenseList";
216
- case be:
216
+ case ce:
217
217
  return "Activity";
218
- case xe:
218
+ case F:
219
219
  return "ViewTransition";
220
220
  }
221
- if (typeof l == "object")
222
- switch (typeof l.tag == "number" && console.error(
221
+ if (typeof u == "object")
222
+ switch (typeof u.tag == "number" && console.error(
223
223
  "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
224
- ), l.$$typeof) {
225
- case x:
224
+ ), u.$$typeof) {
225
+ case b:
226
226
  return "Portal";
227
- case de:
228
- return l.displayName || "Context";
229
- case O:
230
- return (l._context.displayName || "Context") + ".Consumer";
231
- case fe:
232
- var p = l.render;
233
- return l = l.displayName, l || (l = p.displayName || p.name || "", l = l !== "" ? "ForwardRef(" + l + ")" : "ForwardRef"), l;
234
- case he:
235
- return p = l.displayName || null, p !== null ? p : e(l.type) || "Memo";
236
- case L:
237
- p = l._payload, l = l._init;
227
+ case oe:
228
+ return u.displayName || "Context";
229
+ case T:
230
+ return (u._context.displayName || "Context") + ".Consumer";
231
+ case ie:
232
+ var y = u.render;
233
+ return u = u.displayName, u || (u = y.displayName || y.name || "", u = u !== "" ? "ForwardRef(" + u + ")" : "ForwardRef"), u;
234
+ case K:
235
+ return y = u.displayName || null, y !== null ? y : e(u.type) || "Memo";
236
+ case V:
237
+ y = u._payload, u = u._init;
238
238
  try {
239
- return e(l(p));
239
+ return e(u(y));
240
240
  } catch {
241
241
  }
242
242
  }
243
243
  return null;
244
244
  }
245
- function r(l) {
246
- return "" + l;
245
+ function r(u) {
246
+ return "" + u;
247
247
  }
248
- function t(l) {
248
+ function n(u) {
249
249
  try {
250
- r(l);
251
- var p = !1;
250
+ r(u);
251
+ var y = !1;
252
252
  } catch {
253
- p = !0;
253
+ y = !0;
254
254
  }
255
- if (p) {
256
- p = console;
257
- var y = p.error, S = typeof Symbol == "function" && Symbol.toStringTag && l[Symbol.toStringTag] || l.constructor.name || "Object";
258
- return y.call(
259
- p,
255
+ if (y) {
256
+ y = console;
257
+ var N = y.error, E = typeof Symbol == "function" && Symbol.toStringTag && u[Symbol.toStringTag] || u.constructor.name || "Object";
258
+ return N.call(
259
+ y,
260
260
  "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
261
- S
262
- ), r(l);
261
+ E
262
+ ), r(u);
263
263
  }
264
264
  }
265
- function n(l) {
266
- if (l === m) return "<>";
267
- if (typeof l == "object" && l !== null && l.$$typeof === L)
265
+ function a(u) {
266
+ if (u === p) return "<>";
267
+ if (typeof u == "object" && u !== null && u.$$typeof === V)
268
268
  return "<...>";
269
269
  try {
270
- var p = e(l);
271
- return p ? "<" + p + ">" : "<...>";
270
+ var y = e(u);
271
+ return y ? "<" + y + ">" : "<...>";
272
272
  } catch {
273
273
  return "<...>";
274
274
  }
275
275
  }
276
276
  function s() {
277
- var l = D.A;
278
- return l === null ? null : l.getOwner();
277
+ var u = D.A;
278
+ return u === null ? null : u.getOwner();
279
279
  }
280
280
  function o() {
281
281
  return Error("react-stack-top-frame");
282
282
  }
283
- function i(l) {
284
- if (W.call(l, "key")) {
285
- var p = Object.getOwnPropertyDescriptor(l, "key").get;
286
- if (p && p.isReactWarning) return !1;
283
+ function i(u) {
284
+ if ($.call(u, "key")) {
285
+ var y = Object.getOwnPropertyDescriptor(u, "key").get;
286
+ if (y && y.isReactWarning) return !1;
287
287
  }
288
- return l.key !== void 0;
288
+ return u.key !== void 0;
289
289
  }
290
- function c(l, p) {
291
- function y() {
292
- J || (J = !0, console.error(
290
+ function l(u, y) {
291
+ function N() {
292
+ L || (L = !0, console.error(
293
293
  "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
294
- p
294
+ y
295
295
  ));
296
296
  }
297
- y.isReactWarning = !0, Object.defineProperty(l, "key", {
298
- get: y,
297
+ N.isReactWarning = !0, Object.defineProperty(u, "key", {
298
+ get: N,
299
299
  configurable: !0
300
300
  });
301
301
  }
302
- function u() {
303
- var l = e(this.type);
304
- return Q[l] || (Q[l] = !0, console.error(
302
+ function c() {
303
+ var u = e(this.type);
304
+ return B[u] || (B[u] = !0, console.error(
305
305
  "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
306
- )), l = this.props.ref, l !== void 0 ? l : null;
306
+ )), u = this.props.ref, u !== void 0 ? u : null;
307
307
  }
308
- function f(l, p, y, S, _, k) {
309
- var w = y.ref;
310
- return l = {
311
- $$typeof: j,
312
- type: l,
313
- key: p,
314
- props: y,
315
- _owner: S
316
- }, (w !== void 0 ? w : null) !== null ? Object.defineProperty(l, "ref", {
308
+ function d(u, y, N, E, g, S) {
309
+ var _ = N.ref;
310
+ return u = {
311
+ $$typeof: x,
312
+ type: u,
313
+ key: y,
314
+ props: N,
315
+ _owner: E
316
+ }, (_ !== void 0 ? _ : null) !== null ? Object.defineProperty(u, "ref", {
317
317
  enumerable: !1,
318
- get: u
319
- }) : Object.defineProperty(l, "ref", { enumerable: !1, value: null }), l._store = {}, Object.defineProperty(l._store, "validated", {
318
+ get: c
319
+ }) : Object.defineProperty(u, "ref", { enumerable: !1, value: null }), u._store = {}, Object.defineProperty(u._store, "validated", {
320
320
  configurable: !1,
321
321
  enumerable: !1,
322
322
  writable: !0,
323
323
  value: 0
324
- }), Object.defineProperty(l, "_debugInfo", {
324
+ }), Object.defineProperty(u, "_debugInfo", {
325
325
  configurable: !1,
326
326
  enumerable: !1,
327
327
  writable: !0,
328
328
  value: null
329
- }), Object.defineProperty(l, "_debugStack", {
329
+ }), Object.defineProperty(u, "_debugStack", {
330
330
  configurable: !1,
331
331
  enumerable: !1,
332
332
  writable: !0,
333
- value: _
334
- }), Object.defineProperty(l, "_debugTask", {
333
+ value: g
334
+ }), Object.defineProperty(u, "_debugTask", {
335
335
  configurable: !1,
336
336
  enumerable: !1,
337
337
  writable: !0,
338
- value: k
339
- }), Object.freeze && (Object.freeze(l.props), Object.freeze(l)), l;
338
+ value: S
339
+ }), Object.freeze && (Object.freeze(u.props), Object.freeze(u)), u;
340
340
  }
341
- function h(l, p, y, S, _, k) {
342
- var w = p.children;
343
- if (w !== void 0)
344
- if (S)
345
- if (ge(w)) {
346
- for (S = 0; S < w.length; S++)
347
- d(w[S]);
348
- Object.freeze && Object.freeze(w);
341
+ function m(u, y, N, E, g, S) {
342
+ var _ = y.children;
343
+ if (_ !== void 0)
344
+ if (E)
345
+ if (Q(_)) {
346
+ for (E = 0; E < _.length; E++)
347
+ f(_[E]);
348
+ Object.freeze && Object.freeze(_);
349
349
  } else
350
350
  console.error(
351
351
  "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
352
352
  );
353
- else d(w);
354
- if (W.call(p, "key")) {
355
- w = e(l);
356
- var A = Object.keys(p).filter(function(je) {
357
- return je !== "key";
353
+ else f(_);
354
+ if ($.call(y, "key")) {
355
+ _ = e(u);
356
+ var k = Object.keys(y).filter(function(z) {
357
+ return z !== "key";
358
358
  });
359
- S = 0 < A.length ? "{key: someKey, " + A.join(": ..., ") + ": ...}" : "{key: someKey}", Z[w + S] || (A = 0 < A.length ? "{" + A.join(": ..., ") + ": ...}" : "{}", console.error(
359
+ E = 0 < k.length ? "{key: someKey, " + k.join(": ..., ") + ": ...}" : "{key: someKey}", ee[_ + E] || (k = 0 < k.length ? "{" + k.join(": ..., ") + ": ...}" : "{}", console.error(
360
360
  `A props object containing a "key" prop is being spread into JSX:
361
361
  let props = %s;
362
362
  <%s {...props} />
363
363
  React keys must be passed directly to JSX without using spread:
364
364
  let props = %s;
365
365
  <%s key={someKey} {...props} />`,
366
- S,
367
- w,
368
- A,
369
- w
370
- ), Z[w + S] = !0);
366
+ E,
367
+ _,
368
+ k,
369
+ _
370
+ ), ee[_ + E] = !0);
371
371
  }
372
- if (w = null, y !== void 0 && (t(y), w = "" + y), i(p) && (t(p.key), w = "" + p.key), "key" in p) {
373
- y = {};
374
- for (var U in p)
375
- U !== "key" && (y[U] = p[U]);
376
- } else y = p;
377
- return w && c(
378
- y,
379
- typeof l == "function" ? l.displayName || l.name || "Unknown" : l
380
- ), f(
381
- l,
382
- w,
383
- y,
384
- s(),
372
+ if (_ = null, N !== void 0 && (n(N), _ = "" + N), i(y) && (n(y.key), _ = "" + y.key), "key" in y) {
373
+ N = {};
374
+ for (var O in y)
375
+ O !== "key" && (N[O] = y[O]);
376
+ } else N = y;
377
+ return _ && l(
378
+ N,
379
+ typeof u == "function" ? u.displayName || u.name || "Unknown" : u
380
+ ), d(
381
+ u,
385
382
  _,
386
- k
383
+ N,
384
+ s(),
385
+ g,
386
+ S
387
387
  );
388
388
  }
389
- function d(l) {
390
- g(l) ? l._store && (l._store.validated = 1) : typeof l == "object" && l !== null && l.$$typeof === L && (l._payload.status === "fulfilled" ? g(l._payload.value) && l._payload.value._store && (l._payload.value._store.validated = 1) : l._store && (l._store.validated = 1));
389
+ function f(u) {
390
+ v(u) ? u._store && (u._store.validated = 1) : typeof u == "object" && u !== null && u.$$typeof === V && (u._payload.status === "fulfilled" ? v(u._payload.value) && u._payload.value._store && (u._payload.value._store.validated = 1) : u._store && (u._store.validated = 1));
391
391
  }
392
- function g(l) {
393
- return typeof l == "object" && l !== null && l.$$typeof === j;
392
+ function v(u) {
393
+ return typeof u == "object" && u !== null && u.$$typeof === x;
394
394
  }
395
- var b = ye, j = /* @__PURE__ */ Symbol.for("react.transitional.element"), x = /* @__PURE__ */ Symbol.for("react.portal"), m = /* @__PURE__ */ Symbol.for("react.fragment"), v = /* @__PURE__ */ Symbol.for("react.strict_mode"), C = /* @__PURE__ */ Symbol.for("react.profiler"), O = /* @__PURE__ */ Symbol.for("react.consumer"), de = /* @__PURE__ */ Symbol.for("react.context"), fe = /* @__PURE__ */ Symbol.for("react.forward_ref"), me = /* @__PURE__ */ Symbol.for("react.suspense"), pe = /* @__PURE__ */ Symbol.for("react.suspense_list"), he = /* @__PURE__ */ Symbol.for("react.memo"), L = /* @__PURE__ */ Symbol.for("react.lazy"), be = /* @__PURE__ */ Symbol.for("react.activity"), xe = /* @__PURE__ */ Symbol.for("react.view_transition"), ve = /* @__PURE__ */ Symbol.for("react.client.reference"), D = b.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, W = Object.prototype.hasOwnProperty, ge = Array.isArray, V = console.createTask ? console.createTask : function() {
395
+ var h = Re, x = /* @__PURE__ */ Symbol.for("react.transitional.element"), b = /* @__PURE__ */ Symbol.for("react.portal"), p = /* @__PURE__ */ Symbol.for("react.fragment"), j = /* @__PURE__ */ Symbol.for("react.strict_mode"), C = /* @__PURE__ */ Symbol.for("react.profiler"), T = /* @__PURE__ */ Symbol.for("react.consumer"), oe = /* @__PURE__ */ Symbol.for("react.context"), ie = /* @__PURE__ */ Symbol.for("react.forward_ref"), q = /* @__PURE__ */ Symbol.for("react.suspense"), le = /* @__PURE__ */ Symbol.for("react.suspense_list"), K = /* @__PURE__ */ Symbol.for("react.memo"), V = /* @__PURE__ */ Symbol.for("react.lazy"), ce = /* @__PURE__ */ Symbol.for("react.activity"), F = /* @__PURE__ */ Symbol.for("react.view_transition"), U = /* @__PURE__ */ Symbol.for("react.client.reference"), D = h.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, $ = Object.prototype.hasOwnProperty, Q = Array.isArray, W = console.createTask ? console.createTask : function() {
396
396
  return null;
397
397
  };
398
- b = {
399
- react_stack_bottom_frame: function(l) {
400
- return l();
398
+ h = {
399
+ react_stack_bottom_frame: function(u) {
400
+ return u();
401
401
  }
402
402
  };
403
- var J, Q = {}, G = b.react_stack_bottom_frame.bind(
404
- b,
403
+ var L, B = {}, Y = h.react_stack_bottom_frame.bind(
404
+ h,
405
405
  o
406
- )(), q = V(n(o)), Z = {};
407
- I.Fragment = m, I.jsx = function(l, p, y) {
408
- var S = 1e4 > D.recentlyCreatedOwnerStacks++;
409
- if (S) {
410
- var _ = Error.stackTraceLimit;
406
+ )(), X = W(a(o)), ee = {};
407
+ G.Fragment = p, G.jsx = function(u, y, N) {
408
+ var E = 1e4 > D.recentlyCreatedOwnerStacks++;
409
+ if (E) {
410
+ var g = Error.stackTraceLimit;
411
411
  Error.stackTraceLimit = 10;
412
- var k = Error("react-stack-top-frame");
413
- Error.stackTraceLimit = _;
414
- } else k = G;
415
- return h(
416
- l,
417
- p,
412
+ var S = Error("react-stack-top-frame");
413
+ Error.stackTraceLimit = g;
414
+ } else S = Y;
415
+ return m(
416
+ u,
418
417
  y,
418
+ N,
419
419
  !1,
420
- k,
421
- S ? V(n(l)) : q
420
+ S,
421
+ E ? W(a(u)) : X
422
422
  );
423
- }, I.jsxs = function(l, p, y) {
424
- var S = 1e4 > D.recentlyCreatedOwnerStacks++;
425
- if (S) {
426
- var _ = Error.stackTraceLimit;
423
+ }, G.jsxs = function(u, y, N) {
424
+ var E = 1e4 > D.recentlyCreatedOwnerStacks++;
425
+ if (E) {
426
+ var g = Error.stackTraceLimit;
427
427
  Error.stackTraceLimit = 10;
428
- var k = Error("react-stack-top-frame");
429
- Error.stackTraceLimit = _;
430
- } else k = G;
431
- return h(
432
- l,
433
- p,
428
+ var S = Error("react-stack-top-frame");
429
+ Error.stackTraceLimit = g;
430
+ } else S = Y;
431
+ return m(
432
+ u,
434
433
  y,
434
+ N,
435
435
  !0,
436
- k,
437
- S ? V(n(l)) : q
436
+ S,
437
+ E ? W(a(u)) : X
438
438
  );
439
439
  };
440
- })()), I;
440
+ })()), G;
441
441
  }
442
- var K;
443
- function Ie() {
444
- return K || (K = 1, process.env.NODE_ENV === "production" ? F.exports = Ne() : F.exports = ze()), F.exports;
442
+ var xe;
443
+ function Ye() {
444
+ return xe || (xe = 1, process.env.NODE_ENV === "production" ? te.exports = Ue() : te.exports = We()), te.exports;
445
445
  }
446
- var a = Ie();
447
- const oe = re(null);
448
- function Fe() {
446
+ var t = Ye();
447
+ const we = ae(null);
448
+ function Ze() {
449
449
  return typeof window < "u" && typeof window.matchMedia == "function" && window.matchMedia("(prefers-color-scheme: dark)").matches;
450
450
  }
451
- function Me() {
452
- return Fe() ? "dark" : "light";
451
+ function Qe() {
452
+ return Ze() ? "dark" : "light";
453
453
  }
454
- function dt({
454
+ function Jt({
455
455
  children: e,
456
456
  mode: r,
457
- defaultMode: t = "system",
458
- lightTheme: n = R,
459
- darkTheme: s = _e,
457
+ defaultMode: n = "system",
458
+ lightTheme: a = M,
459
+ darkTheme: s = Fe,
460
460
  container: o
461
461
  }) {
462
- const [i, c] = T(t), u = r ?? i, [f, h] = T(Me);
463
- M(() => {
462
+ const [i, l] = w(n), c = r ?? i, [d, m] = w(Qe);
463
+ P(() => {
464
464
  if (typeof window > "u" || typeof window.matchMedia != "function") return;
465
- const j = window.matchMedia("(prefers-color-scheme: dark)"), x = () => h(j.matches ? "dark" : "light");
466
- return x(), j.addEventListener?.("change", x), () => j.removeEventListener?.("change", x);
465
+ const x = window.matchMedia("(prefers-color-scheme: dark)"), b = () => m(x.matches ? "dark" : "light");
466
+ return b(), x.addEventListener?.("change", b), () => x.removeEventListener?.("change", b);
467
467
  }, []);
468
- const d = u === "system" ? f : u, g = d === "dark" ? s : n, b = P(
468
+ const f = c === "system" ? d : c, v = f === "dark" ? s : a, h = I(
469
469
  () => ({
470
- mode: u,
471
- resolvedMode: d,
472
- theme: g,
473
- setMode: c
470
+ mode: c,
471
+ resolvedMode: f,
472
+ theme: v,
473
+ setMode: l
474
474
  }),
475
- [u, d, g]
475
+ [c, f, v]
476
476
  );
477
- return M(() => {
478
- const j = o ?? (typeof document < "u" ? document.documentElement : null);
479
- if (j)
480
- return $e(j, g, d);
481
- }, [o, d, g]), /* @__PURE__ */ a.jsx(oe.Provider, { value: b, children: e });
482
- }
483
- function ft() {
484
- const e = ne(oe);
477
+ return P(() => {
478
+ const x = o ?? (typeof document < "u" ? document.documentElement : null);
479
+ if (x)
480
+ return Ve(x, v, f);
481
+ }, [o, f, v]), /* @__PURE__ */ t.jsx(we.Provider, { value: h, children: e });
482
+ }
483
+ function Gt() {
484
+ const e = H(we);
485
485
  if (!e) throw new Error("useTheme must be used within a ThemeProvider.");
486
486
  return e;
487
487
  }
488
- function Y(e) {
489
- let r = { ...e.initialValues }, t = {
488
+ function me(e) {
489
+ let r = { ...e.initialValues }, n = {
490
490
  values: { ...r },
491
491
  errors: {},
492
492
  touched: {},
@@ -494,39 +494,39 @@ function Y(e) {
494
494
  submitting: !1,
495
495
  status: "idle"
496
496
  };
497
- const n = /* @__PURE__ */ new Set(), s = () => {
498
- for (const f of n) f();
499
- }, o = (f) => {
500
- t = f, s();
497
+ const a = /* @__PURE__ */ new Set(), s = () => {
498
+ for (const d of a) d();
499
+ }, o = (d) => {
500
+ n = d, s();
501
501
  }, i = async () => {
502
502
  if (!e.validate)
503
- return Object.keys(t.errors).length === 0 ? {} : (o({ ...t, errors: {} }), {});
504
- const f = await e.validate(t.values);
505
- return o({ ...t, errors: f }), f;
503
+ return Object.keys(n.errors).length === 0 ? {} : (o({ ...n, errors: {} }), {});
504
+ const d = await e.validate(n.values);
505
+ return o({ ...n, errors: d }), d;
506
506
  };
507
507
  return {
508
- getState: () => t,
509
- setValue: (f, h) => {
508
+ getState: () => n,
509
+ setValue: (d, m) => {
510
510
  o({
511
- ...t,
512
- values: { ...t.values, [f]: h },
511
+ ...n,
512
+ values: { ...n.values, [d]: m },
513
513
  dirty: !0,
514
- status: t.status === "success" || t.status === "error" ? "idle" : t.status,
514
+ status: n.status === "success" || n.status === "error" ? "idle" : n.status,
515
515
  submitError: void 0
516
516
  });
517
517
  },
518
- setTouched: (f, h = !0) => {
518
+ setTouched: (d, m = !0) => {
519
519
  o({
520
- ...t,
521
- touched: { ...t.touched, [f]: h }
520
+ ...n,
521
+ touched: { ...n.touched, [d]: m }
522
522
  });
523
523
  },
524
- setErrors: (f) => {
525
- o({ ...t, errors: f, status: "error" });
524
+ setErrors: (d) => {
525
+ o({ ...n, errors: d, status: "error" });
526
526
  },
527
- reset: (f = r) => {
528
- r = { ...f }, o({
529
- values: { ...f },
527
+ reset: (d = r) => {
528
+ r = { ...d }, o({
529
+ values: { ...d },
530
530
  errors: {},
531
531
  touched: {},
532
532
  dirty: !1,
@@ -537,352 +537,354 @@ function Y(e) {
537
537
  },
538
538
  validate: i,
539
539
  submit: async () => {
540
- if (t.submitting) return !1;
541
- const f = await i();
542
- if (Object.keys(f).length > 0)
543
- return o({ ...t, errors: f, status: "error", submitting: !1 }), !1;
544
- const h = t.values;
545
- o({ ...t, submitting: !0, status: "submitting", submitError: void 0 });
540
+ if (n.submitting) return !1;
541
+ const d = await i();
542
+ if (Object.keys(d).length > 0)
543
+ return o({ ...n, errors: d, status: "error", submitting: !1 }), !1;
544
+ const m = n.values;
545
+ o({ ...n, submitting: !0, status: "submitting", submitError: void 0 });
546
546
  try {
547
- return await e.onSubmit(h), o({ ...t, submitting: !1, status: "success", errors: {} }), !0;
548
- } catch (d) {
547
+ return await e.onSubmit(m), o({ ...n, submitting: !1, status: "success", errors: {} }), !0;
548
+ } catch (f) {
549
549
  return o({
550
- ...t,
550
+ ...n,
551
551
  submitting: !1,
552
552
  status: "error",
553
- submitError: d instanceof Error ? d.message : String(d)
553
+ submitError: f instanceof Error ? f.message : String(f)
554
554
  }), !1;
555
555
  }
556
556
  },
557
- subscribe: (f) => (n.add(f), () => n.delete(f))
557
+ subscribe: (d) => (a.add(d), () => a.delete(d))
558
558
  };
559
559
  }
560
- function Le(e, r) {
561
- let t, n;
560
+ function Je(e, r) {
561
+ let n, a;
562
562
  return {
563
563
  name: r,
564
564
  getState: () => {
565
565
  const o = e.getState();
566
- return o === t && n || (t = o, n = {
566
+ return o === n && a || (n = o, a = {
567
567
  value: o.values[r],
568
568
  error: o.errors[r],
569
569
  touched: o.touched[r] === !0,
570
570
  dirty: o.dirty,
571
571
  submitting: o.submitting
572
- }), n;
572
+ }), a;
573
573
  },
574
574
  setValue: (o) => e.setValue(r, o),
575
575
  setTouched: (o = !0) => e.setTouched(r, o)
576
576
  };
577
577
  }
578
- const ie = re(null);
579
- function le({
578
+ const Ne = ae(null);
579
+ function ke({
580
+ /** Form store exposed to descendants. */
580
581
  store: e,
582
+ /** Descendant form fields and actions. */
581
583
  children: r
582
584
  }) {
583
- return /* @__PURE__ */ a.jsx(ie.Provider, { value: e, children: r });
585
+ return /* @__PURE__ */ t.jsx(Ne.Provider, { value: e, children: r });
584
586
  }
585
- function B() {
586
- const e = ne(ie);
587
+ function he() {
588
+ const e = H(Ne);
587
589
  if (!e)
588
590
  throw new Error("useFormStore must be used inside a FormProvider.");
589
591
  return e;
590
592
  }
591
- function mt(e) {
592
- const r = $(null);
593
- r.current || (r.current = Y(e));
594
- const t = r.current, n = N(
595
- t.subscribe,
596
- t.getState,
597
- t.getState
593
+ function Ht(e) {
594
+ const r = A(null);
595
+ r.current || (r.current = me(e));
596
+ const n = r.current, a = Z(
597
+ n.subscribe,
598
+ n.getState,
599
+ n.getState
598
600
  );
599
601
  return {
600
- store: t,
601
- state: n,
602
- submit: t.submit,
603
- reset: t.reset,
604
- validate: t.validate
602
+ store: n,
603
+ state: a,
604
+ submit: n.submit,
605
+ reset: n.reset,
606
+ validate: n.validate
605
607
  };
606
608
  }
607
- function De() {
608
- const e = B();
609
- return N(
609
+ function Ge() {
610
+ const e = he();
611
+ return Z(
610
612
  e.subscribe,
611
613
  e.getState,
612
614
  e.getState
613
615
  );
614
616
  }
615
- function ce(e) {
616
- const r = B(), t = P(
617
- () => Le(r, e),
617
+ function Ee(e) {
618
+ const r = he(), n = I(
619
+ () => Je(r, e),
618
620
  [r, e]
619
621
  );
620
622
  return {
621
- ...N(
623
+ ...Z(
622
624
  r.subscribe,
623
- t.getState,
624
- t.getState
625
+ n.getState,
626
+ n.getState
625
627
  ),
626
- setValue: t.setValue,
627
- setTouched: t.setTouched
628
+ setValue: n.setValue,
629
+ setTouched: n.setTouched
628
630
  };
629
631
  }
630
- function pt({
632
+ function qt({
631
633
  store: e,
632
634
  children: r,
633
- onSubmitResult: t,
634
- onReset: n,
635
+ onSubmitResult: n,
636
+ onReset: a,
635
637
  ...s
636
638
  }) {
637
- const o = async (c) => {
638
- c.preventDefault();
639
- const u = await e.submit();
640
- await t?.(u);
641
- }, i = (c) => {
642
- c.preventDefault(), e.reset(), n?.();
639
+ const o = async (l) => {
640
+ l.preventDefault();
641
+ const c = await e.submit();
642
+ await n?.(c);
643
+ }, i = (l) => {
644
+ l.preventDefault(), e.reset(), a?.();
643
645
  };
644
- return /* @__PURE__ */ a.jsx(le, { store: e, children: /* @__PURE__ */ a.jsx("form", { ...s, onSubmit: o, onReset: i, children: r }) });
646
+ return /* @__PURE__ */ t.jsx(ke, { store: e, children: /* @__PURE__ */ t.jsx("form", { ...s, onSubmit: o, onReset: i, children: r }) });
645
647
  }
646
- function ee({ name: e, children: r, ...t }) {
647
- const n = ce(e);
648
+ function ve({ name: e, children: r, ...n }) {
649
+ const a = Ee(e);
648
650
  if (r)
649
- return r(n);
650
- const s = n.value, o = typeof s == "string" || typeof s == "number" ? s : "";
651
- return /* @__PURE__ */ a.jsx(
651
+ return r(a);
652
+ const s = a.value, o = typeof s == "string" || typeof s == "number" ? s : "";
653
+ return /* @__PURE__ */ t.jsx(
652
654
  "input",
653
655
  {
654
- ...t,
656
+ ...n,
655
657
  name: String(e),
656
658
  value: o,
657
- onChange: (i) => n.setValue(i.target.value),
658
- onBlur: () => n.setTouched(),
659
- "aria-invalid": n.error ? !0 : void 0
659
+ onChange: (i) => a.setValue(i.target.value),
660
+ onBlur: () => a.setTouched(),
661
+ "aria-invalid": a.error ? !0 : void 0
660
662
  }
661
663
  );
662
664
  }
663
- function ue(e, r) {
665
+ function Ce(e, r) {
664
666
  return e ? `${r} ${e}` : r;
665
667
  }
666
- function Ve(e) {
667
- const { children: r = "Submit", disabled: t, className: n, ...s } = e, { submitting: o } = B().getState();
668
- return /* @__PURE__ */ a.jsx(
668
+ function He(e) {
669
+ const { children: r = "Submit", disabled: n, className: a, ...s } = e, { submitting: o } = he().getState();
670
+ return /* @__PURE__ */ t.jsx(
669
671
  "button",
670
672
  {
671
673
  ...s,
672
- className: ue(n, "fsc-form-action"),
674
+ className: Ce(a, "fsc-form-action"),
673
675
  type: "submit",
674
- disabled: t || o,
676
+ disabled: n || o,
675
677
  "aria-busy": o || void 0,
676
678
  children: r
677
679
  }
678
680
  );
679
681
  }
680
- function Ue(e) {
681
- const { children: r = "Reset", className: t, ...n } = e;
682
- return /* @__PURE__ */ a.jsx(
682
+ function qe(e) {
683
+ const { children: r = "Reset", className: n, ...a } = e;
684
+ return /* @__PURE__ */ t.jsx(
683
685
  "button",
684
686
  {
685
- ...n,
686
- className: ue(t, "fsc-form-action"),
687
+ ...a,
688
+ className: Ce(n, "fsc-form-action"),
687
689
  type: "reset",
688
690
  children: r
689
691
  }
690
692
  );
691
693
  }
692
- function ht({ name: e, render: r }) {
693
- const t = ce(e);
694
+ function Kt({ name: e, render: r }) {
695
+ const n = Ee(e);
694
696
  return r({
695
- value: t.value,
696
- onChange: t.setValue,
697
- onBlur: () => t.setTouched(),
698
- error: t.error
697
+ value: n.value,
698
+ onChange: n.setValue,
699
+ onBlur: () => n.setTouched(),
700
+ error: n.error
699
701
  });
700
702
  }
701
- function bt(e) {
702
- return function(t) {
703
- const { field: n, ...s } = t;
704
- return /* @__PURE__ */ a.jsx(e, { ...s, ...n });
703
+ function Xt(e) {
704
+ return function(n) {
705
+ const { field: a, ...s } = n;
706
+ return /* @__PURE__ */ t.jsx(e, { ...s, ...a });
705
707
  };
706
708
  }
707
- function xt(e) {
708
- const { resource: r, mode: t, id: n, initialValues: s, validate: o, transform: i, onSuccess: c } = e;
709
- if (t === "edit" && n === void 0)
709
+ function er(e) {
710
+ const { resource: r, mode: n, id: a, initialValues: s, validate: o, transform: i, onSuccess: l } = e;
711
+ if (n === "edit" && a === void 0)
710
712
  throw new Error("An id is required when creating an edit resource form.");
711
- return Y({
713
+ return me({
712
714
  initialValues: s,
713
715
  validate: o,
714
- onSubmit: async (f) => {
715
- const h = i ? i(f) : f;
716
- let d;
717
- if (t === "create") {
716
+ onSubmit: async (d) => {
717
+ const m = i ? i(d) : d;
718
+ let f;
719
+ if (n === "create") {
718
720
  if (!r.create)
719
721
  throw new Error(`Resource "${r.name}" does not support create.`);
720
- d = await r.create(h);
722
+ f = await r.create(m);
721
723
  } else {
722
724
  if (!r.update)
723
725
  throw new Error(`Resource "${r.name}" does not support update.`);
724
- d = await r.update(n, h);
726
+ f = await r.update(a, m);
725
727
  }
726
- await c?.(d);
728
+ await l?.(f);
727
729
  }
728
730
  });
729
731
  }
730
- function Ye(e) {
732
+ function Ke(e) {
731
733
  const r = /* @__PURE__ */ new Set();
732
- for (const t of e)
733
- for (const n of Object.keys(t)) r.add(n);
734
- return [...r].map((t) => ({
735
- key: t,
736
- header: t
734
+ for (const n of e)
735
+ for (const a of Object.keys(n)) r.add(a);
736
+ return [...r].map((n) => ({
737
+ key: n,
738
+ header: n
737
739
  }));
738
740
  }
739
- function Be(e, r) {
741
+ function Xe(e, r) {
740
742
  return e === r ? 0 : e == null ? -1 : r == null ? 1 : String(e).localeCompare(String(r), void 0, { numeric: !0, sensitivity: "base" });
741
743
  }
742
- function We(e, r) {
743
- let t = [...r];
744
+ function et(e, r) {
745
+ let n = [...r];
744
746
  return {
745
747
  name: e,
746
- async list(n = {}) {
747
- let s = [...t];
748
- if (n.search) {
749
- const i = n.search.trim().toLowerCase();
748
+ async list(a = {}) {
749
+ let s = [...n];
750
+ if (a.search) {
751
+ const i = a.search.trim().toLowerCase();
750
752
  i && (s = s.filter(
751
- (c) => Object.values(c).some(
752
- (u) => String(u ?? "").toLowerCase().includes(i)
753
+ (l) => Object.values(l).some(
754
+ (c) => String(c ?? "").toLowerCase().includes(i)
753
755
  )
754
756
  ));
755
757
  }
756
- if (n.sort) {
757
- const { field: i, direction: c } = n.sort;
758
- s.sort((u, f) => {
759
- const h = Be(u[i], f[i]);
760
- return c === "desc" ? -h : h;
758
+ if (a.sort) {
759
+ const { field: i, direction: l } = a.sort;
760
+ s.sort((c, d) => {
761
+ const m = Xe(c[i], d[i]);
762
+ return l === "desc" ? -m : m;
761
763
  });
762
764
  }
763
765
  const o = s.length;
764
- if (n.pageSize && n.pageSize > 0) {
765
- const c = (Math.max(n.page ?? 1, 1) - 1) * n.pageSize;
766
- s = s.slice(c, c + n.pageSize);
766
+ if (a.pageSize && a.pageSize > 0) {
767
+ const l = (Math.max(a.page ?? 1, 1) - 1) * a.pageSize;
768
+ s = s.slice(l, l + a.pageSize);
767
769
  }
768
770
  return { data: s, total: o };
769
771
  },
770
- async get(n) {
771
- const s = t.find((o) => String(o.id) === n);
772
- if (!s) throw new Error(`${e} record "${n}" was not found.`);
772
+ async get(a) {
773
+ const s = n.find((o) => String(o.id) === a);
774
+ if (!s) throw new Error(`${e} record "${a}" was not found.`);
773
775
  return s;
774
776
  },
775
- async create(n) {
777
+ async create(a) {
776
778
  const s = {
777
- ...n,
779
+ ...a,
778
780
  id: globalThis.crypto.randomUUID()
779
781
  };
780
- return t.push(s), s;
782
+ return n.push(s), s;
781
783
  },
782
- async update(n, s) {
783
- const o = t.findIndex((c) => String(c.id) === n);
784
- if (o < 0) throw new Error(`${e} record "${n}" was not found.`);
785
- const i = { ...t[o], ...s };
786
- return t[o] = i, i;
784
+ async update(a, s) {
785
+ const o = n.findIndex((l) => String(l.id) === a);
786
+ if (o < 0) throw new Error(`${e} record "${a}" was not found.`);
787
+ const i = { ...n[o], ...s };
788
+ return n[o] = i, i;
787
789
  },
788
- async delete(n) {
789
- const s = t.findIndex((o) => String(o.id) === n);
790
- if (s < 0) throw new Error(`${e} record "${n}" was not found.`);
791
- t.splice(s, 1);
790
+ async delete(a) {
791
+ const s = n.findIndex((o) => String(o.id) === a);
792
+ if (s < 0) throw new Error(`${e} record "${a}" was not found.`);
793
+ n.splice(s, 1);
792
794
  }
793
795
  };
794
796
  }
795
- function Je(e, r = {}) {
796
- let t = {
797
+ function tt(e, r = {}) {
798
+ let n = {
797
799
  data: [],
798
800
  operation: "idle",
799
801
  lastQuery: r.initialQuery
800
802
  };
801
- const n = /* @__PURE__ */ new Set(), s = () => {
802
- for (const m of n) m();
803
- }, o = (m) => {
804
- t = {
805
- ...t,
806
- ...m,
803
+ const a = /* @__PURE__ */ new Set(), s = () => {
804
+ for (const p of a) p();
805
+ }, o = (p) => {
806
+ n = {
807
+ ...n,
808
+ ...p,
807
809
  lastUpdated: Date.now()
808
810
  }, s();
809
- }, i = (m) => m instanceof Error ? m : new Error(String(m)), c = async (m, v) => {
810
- o({ operation: m, error: void 0 });
811
+ }, i = (p) => p instanceof Error ? p : new Error(String(p)), l = async (p, j) => {
812
+ o({ operation: p, error: void 0 });
811
813
  try {
812
- const C = await v();
814
+ const C = await j();
813
815
  return o({ operation: "idle" }), C;
814
816
  } catch (C) {
815
- const O = i(C);
817
+ const T = i(C);
816
818
  throw o({
817
819
  operation: "idle",
818
- error: O
819
- }), O;
820
+ error: T
821
+ }), T;
820
822
  }
821
- }, u = async (m = t.lastQuery ?? {}) => {
822
- const v = await e.list(m);
823
+ }, c = async (p = n.lastQuery ?? {}) => {
824
+ const j = await e.list(p);
823
825
  return o({
824
- data: v.data,
825
- total: v.total,
826
- lastQuery: m
827
- }), v;
828
- }, f = (m = t.lastQuery ?? {}) => c("listing", () => u(m)), h = (m) => c("reading", async () => {
829
- const v = await e.get(m);
830
- return o({ selected: v }), v;
831
- }), d = (m) => {
826
+ data: j.data,
827
+ total: j.total,
828
+ lastQuery: p
829
+ }), j;
830
+ }, d = (p = n.lastQuery ?? {}) => l("listing", () => c(p)), m = (p) => l("reading", async () => {
831
+ const j = await e.get(p);
832
+ return o({ selected: j }), j;
833
+ }), f = (p) => {
832
834
  if (!e.create) {
833
- const v = new Error(
835
+ const j = new Error(
834
836
  `Resource "${e.name}" does not support create().`
835
837
  );
836
- return o({ operation: "idle", error: v }), Promise.reject(v);
838
+ return o({ operation: "idle", error: j }), Promise.reject(j);
837
839
  }
838
- return c("creating", async () => {
839
- const v = await e.create(m);
840
- return await j(), o({ selected: v }), v;
840
+ return l("creating", async () => {
841
+ const j = await e.create(p);
842
+ return await x(), o({ selected: j }), j;
841
843
  });
842
- }, g = (m, v) => {
844
+ }, v = (p, j) => {
843
845
  if (!e.update) {
844
846
  const C = new Error(
845
847
  `Resource "${e.name}" does not support update().`
846
848
  );
847
849
  return o({ operation: "idle", error: C }), Promise.reject(C);
848
850
  }
849
- return c("updating", async () => {
850
- const C = await e.update(m, v);
851
- return await j(), o({ selected: C }), C;
851
+ return l("updating", async () => {
852
+ const C = await e.update(p, j);
853
+ return await x(), o({ selected: C }), C;
852
854
  });
853
- }, b = (m) => {
855
+ }, h = (p) => {
854
856
  if (!e.delete) {
855
- const v = new Error(
857
+ const j = new Error(
856
858
  `Resource "${e.name}" does not support delete().`
857
859
  );
858
- return o({ operation: "idle", error: v }), Promise.reject(v);
860
+ return o({ operation: "idle", error: j }), Promise.reject(j);
859
861
  }
860
- return c("deleting", async () => {
861
- await e.delete(m), await j(), t.selected && String(t.selected.id) === String(m) && o({ selected: void 0 });
862
+ return l("deleting", async () => {
863
+ await e.delete(p), await x(), n.selected && String(n.selected.id) === String(p) && o({ selected: void 0 });
862
864
  });
863
- }, j = async () => {
864
- const m = t.lastQuery ?? {}, v = await e.list(m);
865
+ }, x = async () => {
866
+ const p = n.lastQuery ?? {}, j = await e.list(p);
865
867
  o({
866
- data: v.data,
867
- total: v.total,
868
- lastQuery: m
868
+ data: j.data,
869
+ total: j.total,
870
+ lastQuery: p
869
871
  });
870
872
  };
871
873
  return {
872
- getState: () => t,
873
- list: f,
874
- get: h,
875
- create: d,
876
- update: g,
877
- remove: b,
878
- refresh: () => f(t.lastQuery ?? {}),
879
- select: (m) => o({ selected: m }),
874
+ getState: () => n,
875
+ list: d,
876
+ get: m,
877
+ create: f,
878
+ update: v,
879
+ remove: h,
880
+ refresh: () => d(n.lastQuery ?? {}),
881
+ select: (p) => o({ selected: p }),
880
882
  clearSelection: () => o({ selected: void 0 }),
881
883
  clearError: () => o({ error: void 0 }),
882
- subscribe: (m) => (n.add(m), () => n.delete(m))
884
+ subscribe: (p) => (a.add(p), () => a.delete(p))
883
885
  };
884
886
  }
885
- function Qe(e) {
887
+ function rt(e) {
886
888
  let r = {
887
889
  data: [],
888
890
  columns: e.columns ?? [],
@@ -894,171 +896,155 @@ function Qe(e) {
894
896
  search: "",
895
897
  sort: void 0
896
898
  };
897
- const t = /* @__PURE__ */ new Set(), n = () => t.forEach((d) => d()), s = (d) => {
898
- r = d, n();
899
+ const n = /* @__PURE__ */ new Set(), a = () => n.forEach((f) => f()), s = (f) => {
900
+ r = f, a();
899
901
  }, o = async () => {
900
- const d = r;
901
- s({ ...d, loading: !0, error: null });
902
+ const f = r;
903
+ s({ ...f, loading: !0, error: null });
902
904
  try {
903
- const g = await e.resource.list({
904
- page: d.page,
905
- pageSize: d.pageSize,
906
- search: d.search || void 0,
907
- sort: d.sort
905
+ const v = await e.resource.list({
906
+ page: f.page,
907
+ pageSize: f.pageSize,
908
+ search: f.search || void 0,
909
+ sort: f.sort
908
910
  });
909
- if (r.page !== d.page || r.pageSize !== d.pageSize || r.search !== d.search || r.sort !== d.sort)
911
+ if (r.page !== f.page || r.pageSize !== f.pageSize || r.search !== f.search || r.sort !== f.sort)
910
912
  return;
911
913
  s({
912
914
  ...r,
913
- data: g.data,
914
- columns: e.columns ?? Ye(g.data),
915
- total: g.total,
915
+ data: v.data,
916
+ columns: e.columns ?? Ke(v.data),
917
+ total: v.total,
916
918
  loading: !1,
917
919
  error: null
918
920
  });
919
- } catch (g) {
920
- if (r.page !== d.page || r.pageSize !== d.pageSize || r.search !== d.search || r.sort !== d.sort)
921
+ } catch (v) {
922
+ if (r.page !== f.page || r.pageSize !== f.pageSize || r.search !== f.search || r.sort !== f.sort)
921
923
  return;
922
924
  s({
923
925
  ...r,
924
926
  loading: !1,
925
- error: g instanceof Error ? g : new Error(String(g))
927
+ error: v instanceof Error ? v : new Error(String(v))
926
928
  });
927
929
  }
928
930
  };
929
931
  return {
930
932
  getState: () => r,
931
933
  load: o,
932
- setSearch: async (d) => {
933
- s({ ...r, search: d, page: 1 }), await o();
934
+ setSearch: async (f) => {
935
+ s({ ...r, search: f, page: 1 }), await o();
934
936
  },
935
- setPage: async (d) => {
936
- !Number.isInteger(d) || d < 1 || (s({ ...r, page: d }), await o());
937
+ setPage: async (f) => {
938
+ !Number.isInteger(f) || f < 1 || (s({ ...r, page: f }), await o());
937
939
  },
938
- setPageSize: async (d) => {
939
- !Number.isInteger(d) || d < 1 || (s({ ...r, pageSize: d, page: 1 }), await o());
940
+ setPageSize: async (f) => {
941
+ !Number.isInteger(f) || f < 1 || (s({ ...r, pageSize: f, page: 1 }), await o());
940
942
  },
941
- setSort: async (d) => {
942
- const g = r.sort, b = g?.field === d && g.direction === "asc" ? "desc" : "asc";
943
- s({ ...r, sort: { field: d, direction: b }, page: 1 }), await o();
943
+ setSort: async (f) => {
944
+ const v = r.sort, h = v?.field === f && v.direction === "asc" ? "desc" : "asc";
945
+ s({ ...r, sort: { field: f, direction: h }, page: 1 }), await o();
944
946
  },
945
947
  reset: async () => {
946
948
  s({ ...r, data: [], page: 1, search: "", sort: void 0, error: null }), await o();
947
949
  },
948
- subscribe: (d) => (t.add(d), () => t.delete(d))
950
+ subscribe: (f) => (n.add(f), () => n.delete(f))
949
951
  };
950
952
  }
951
- function Ge(e) {
952
- const r = P(
953
- () => Qe(e),
953
+ function nt(e) {
954
+ const r = I(
955
+ () => rt(e),
954
956
  [e.resource, e.columns, e.pageSize]
955
- ), t = E(
957
+ ), n = R(
956
958
  (o) => r.subscribe(o),
957
959
  [r]
958
- ), n = E(() => r.getState(), [r]), s = N(t, n, n);
960
+ ), a = R(() => r.getState(), [r]), s = Z(n, a, a);
959
961
  return { controller: r, state: s };
960
962
  }
961
- function qe({
962
- data: e,
963
- columns: r,
964
- emptyState: t = null,
965
- caption: n,
966
- ...s
967
- }) {
968
- return /* @__PURE__ */ a.jsxs("table", { ...s, children: [
969
- n !== void 0 ? /* @__PURE__ */ a.jsx("caption", { children: n }) : null,
970
- /* @__PURE__ */ a.jsx("thead", { children: /* @__PURE__ */ a.jsx("tr", { children: r.map((o) => /* @__PURE__ */ a.jsx("th", { scope: "col", children: o.header ?? o.key }, o.key)) }) }),
971
- /* @__PURE__ */ a.jsx("tbody", { children: e.length === 0 ? /* @__PURE__ */ a.jsx("tr", { children: /* @__PURE__ */ a.jsx("td", { colSpan: Math.max(r.length, 1), children: t }) }) : e.map((o, i) => /* @__PURE__ */ a.jsx("tr", { children: r.map((c) => {
972
- const u = o[c.key];
973
- return /* @__PURE__ */ a.jsx("td", { children: c.render ? c.render(u, o) : String(u ?? "") }, c.key);
974
- }) }, String(o.id ?? i))) })
975
- ] });
976
- }
977
- class Ze extends Error {
963
+ class at extends Error {
978
964
  status;
979
965
  code;
980
966
  details;
981
- constructor(r, t) {
982
- super(t?.message ?? `API request failed with status ${r}.`), this.name = "ApiError", this.status = r, this.code = t?.code, this.details = t?.details;
967
+ constructor(r, n) {
968
+ super(n?.message ?? `API request failed with status ${r}.`), this.name = "ApiError", this.status = r, this.code = n?.code, this.details = n?.details;
983
969
  }
984
970
  }
985
- function He(e, r) {
986
- const t = new URLSearchParams();
971
+ function st(e, r) {
972
+ const n = new URLSearchParams();
987
973
  for (const [s, o] of Object.entries(r))
988
- o != null && (typeof o == "object" ? t.set(s, JSON.stringify(o)) : t.set(s, String(o)));
989
- const n = t.toString();
990
- return n ? `${e}${e.includes("?") ? "&" : "?"}${n}` : e;
974
+ o != null && (typeof o == "object" ? n.set(s, JSON.stringify(o)) : n.set(s, String(o)));
975
+ const a = n.toString();
976
+ return a ? `${e}${e.includes("?") ? "&" : "?"}${a}` : e;
991
977
  }
992
- function te(e) {
978
+ function je(e) {
993
979
  return (e.headers.get("content-type") ?? "").toLowerCase().includes("application/json");
994
980
  }
995
- function vt(e = "") {
996
- const r = async (t, n) => {
997
- const s = await fetch(`${e}${t}`, {
998
- ...n,
981
+ function tr(e = "") {
982
+ const r = async (n, a) => {
983
+ const s = await fetch(`${e}${n}`, {
984
+ ...a,
999
985
  headers: {
1000
986
  Accept: "application/json",
1001
- ...n?.body !== void 0 ? { "Content-Type": "application/json" } : {},
1002
- ...n?.headers
987
+ ...a?.body !== void 0 ? { "Content-Type": "application/json" } : {},
988
+ ...a?.headers
1003
989
  }
1004
990
  });
1005
991
  if (!s.ok) {
1006
992
  let o;
1007
- if (te(s))
993
+ if (je(s))
1008
994
  try {
1009
995
  o = await s.json();
1010
996
  } catch {
1011
997
  o = void 0;
1012
998
  }
1013
- throw new Ze(s.status, o);
999
+ throw new at(s.status, o);
1014
1000
  }
1015
- if (s.status !== 204 && te(s))
1001
+ if (s.status !== 204 && je(s))
1016
1002
  return await s.json();
1017
1003
  };
1018
1004
  return {
1019
1005
  request: r,
1020
- get: (t, n = {}) => r(He(t, n)),
1021
- post: (t, n) => r(t, { method: "POST", body: JSON.stringify(n) }),
1022
- patch: (t, n) => r(t, { method: "PATCH", body: JSON.stringify(n) }),
1023
- delete: (t) => r(t, { method: "DELETE" })
1006
+ get: (n, a = {}) => r(st(n, a)),
1007
+ post: (n, a) => r(n, { method: "POST", body: JSON.stringify(a) }),
1008
+ patch: (n, a) => r(n, { method: "PATCH", body: JSON.stringify(a) }),
1009
+ delete: (n) => r(n, { method: "DELETE" })
1024
1010
  };
1025
1011
  }
1026
- function gt(e) {
1027
- const { client: r, path: t } = e;
1012
+ function rr(e) {
1013
+ const { client: r, path: n } = e;
1028
1014
  return {
1029
- name: t.replace(/^\/+/, "").replace(/\/+$/, "") || "resource",
1030
- async list(n = {}) {
1031
- return r.get(t, n);
1015
+ name: n.replace(/^\/+/, "").replace(/\/+$/, "") || "resource",
1016
+ async list(a = {}) {
1017
+ return r.get(n, a);
1032
1018
  },
1033
- get: (n) => r.get(`${t}/${encodeURIComponent(String(n))}`),
1034
- create: (n) => r.post(t, n),
1035
- update: (n, s) => r.patch(`${t}/${encodeURIComponent(String(n))}`, s),
1036
- delete: async (n) => {
1037
- await r.delete(`${t}/${encodeURIComponent(String(n))}`);
1019
+ get: (a) => r.get(`${n}/${encodeURIComponent(String(a))}`),
1020
+ create: (a) => r.post(n, a),
1021
+ update: (a, s) => r.patch(`${n}/${encodeURIComponent(String(a))}`, s),
1022
+ delete: async (a) => {
1023
+ await r.delete(`${n}/${encodeURIComponent(String(a))}`);
1038
1024
  }
1039
1025
  };
1040
1026
  }
1041
- function Xe({ resource: e }) {
1027
+ function ot({ resource: e }) {
1042
1028
  let r = {
1043
1029
  status: "idle",
1044
1030
  error: null
1045
1031
  };
1046
- const t = /* @__PURE__ */ new Set(), n = () => t.forEach((i) => i()), s = (i) => {
1047
- r = i, n();
1032
+ const n = /* @__PURE__ */ new Set(), a = () => n.forEach((i) => i()), s = (i) => {
1033
+ r = i, a();
1048
1034
  }, o = async (i) => {
1049
1035
  s({ ...r, status: "loading", error: null });
1050
1036
  try {
1051
- const c = await i();
1037
+ const l = await i();
1052
1038
  return s({
1053
1039
  status: "success",
1054
- data: c && typeof c == "object" ? c : r.data,
1040
+ data: l && typeof l == "object" ? l : r.data,
1055
1041
  error: null
1056
- }), c;
1057
- } catch (c) {
1042
+ }), l;
1043
+ } catch (l) {
1058
1044
  s({
1059
1045
  ...r,
1060
1046
  status: "error",
1061
- error: c instanceof Error ? c : new Error(String(c))
1047
+ error: l instanceof Error ? l : new Error(String(l))
1062
1048
  });
1063
1049
  return;
1064
1050
  }
@@ -1068,247 +1054,491 @@ function Xe({ resource: e }) {
1068
1054
  get: (i) => o(() => e.get(i)),
1069
1055
  create: async (i) => {
1070
1056
  if (!e.create) {
1071
- const c = new Error(`Resource "${e.name}" does not support create.`);
1072
- s({ ...r, status: "error", error: c });
1057
+ const l = new Error(`Resource "${e.name}" does not support create.`);
1058
+ s({ ...r, status: "error", error: l });
1073
1059
  return;
1074
1060
  }
1075
1061
  return o(() => e.create(i));
1076
1062
  },
1077
- update: async (i, c) => {
1063
+ update: async (i, l) => {
1078
1064
  if (!e.update) {
1079
- const u = new Error(`Resource "${e.name}" does not support update.`);
1080
- s({ ...r, status: "error", error: u });
1065
+ const c = new Error(`Resource "${e.name}" does not support update.`);
1066
+ s({ ...r, status: "error", error: c });
1081
1067
  return;
1082
1068
  }
1083
- return o(() => e.update(i, c));
1069
+ return o(() => e.update(i, l));
1084
1070
  },
1085
1071
  remove: async (i) => {
1086
1072
  if (!e.delete) {
1087
- const u = new Error(`Resource "${e.name}" does not support delete.`);
1088
- return s({ ...r, status: "error", error: u }), !1;
1073
+ const c = new Error(`Resource "${e.name}" does not support delete.`);
1074
+ return s({ ...r, status: "error", error: c }), !1;
1089
1075
  }
1090
1076
  return await o(async () => (await e.delete(i), !0)) === !0;
1091
1077
  },
1092
1078
  reset: () => s({ status: "idle", error: null }),
1093
- subscribe: (i) => (t.add(i), () => t.delete(i))
1079
+ subscribe: (i) => (n.add(i), () => n.delete(i))
1094
1080
  };
1095
1081
  }
1096
- function jt(e) {
1097
- const r = $(null);
1082
+ function nr(e) {
1083
+ const r = A(null);
1098
1084
  (!r.current || r.current.resource !== e) && (r.current = {
1099
1085
  resource: e,
1100
- controller: Xe({ resource: e })
1086
+ controller: ot({ resource: e })
1101
1087
  });
1102
- const t = r.current.controller, n = N(
1103
- t.subscribe,
1104
- t.getState,
1105
- t.getState
1088
+ const n = r.current.controller, a = Z(
1089
+ n.subscribe,
1090
+ n.getState,
1091
+ n.getState
1106
1092
  );
1107
1093
  return {
1108
- ...t,
1109
- ...n
1094
+ ...n,
1095
+ ...a
1110
1096
  };
1111
1097
  }
1112
- function Ke(e) {
1113
- const r = $(null);
1098
+ function it(e) {
1099
+ const r = A(null);
1114
1100
  (!r.current || r.current.resource !== e) && (r.current = {
1115
1101
  resource: e,
1116
- controller: Je(e)
1102
+ controller: tt(e)
1117
1103
  });
1118
- const t = r.current.controller, n = N(
1119
- t.subscribe,
1120
- t.getState,
1121
- t.getState
1122
- ), s = E(
1123
- (b) => t.list(b),
1124
- [t]
1125
- ), o = E((b) => t.get(b), [t]), i = E((b) => t.create(b), [t]), c = E(
1126
- (b, j) => t.update(b, j),
1127
- [t]
1128
- ), u = E((b) => t.remove(b), [t]), f = E(() => t.refresh(), [t]), h = E((b) => t.select(b), [t]), d = E(() => t.clearSelection(), [t]), g = E(() => t.clearError(), [t]);
1104
+ const n = r.current.controller, a = Z(
1105
+ n.subscribe,
1106
+ n.getState,
1107
+ n.getState
1108
+ ), s = R(
1109
+ (h) => n.list(h),
1110
+ [n]
1111
+ ), o = R((h) => n.get(h), [n]), i = R((h) => n.create(h), [n]), l = R(
1112
+ (h, x) => n.update(h, x),
1113
+ [n]
1114
+ ), c = R((h) => n.remove(h), [n]), d = R(() => n.refresh(), [n]), m = R((h) => n.select(h), [n]), f = R(() => n.clearSelection(), [n]), v = R(() => n.clearError(), [n]);
1129
1115
  return {
1130
- ...t,
1131
1116
  ...n,
1117
+ ...a,
1132
1118
  list: s,
1133
1119
  get: o,
1134
1120
  create: i,
1135
- update: c,
1136
- remove: u,
1137
- refresh: f,
1138
- select: h,
1139
- clearSelection: d,
1140
- clearError: g
1121
+ update: l,
1122
+ remove: c,
1123
+ refresh: d,
1124
+ select: m,
1125
+ clearSelection: f,
1126
+ clearError: v
1141
1127
  };
1142
1128
  }
1143
- function yt({ children: e, columns: r = 1, gap: t, ...n }) {
1129
+ function ar({ children: e, columns: r = 1, gap: n, ...a }) {
1144
1130
  const s = typeof r == "number" ? "repeat(" + r + ", minmax(0, 1fr))" : r;
1145
- return /* @__PURE__ */ a.jsx("div", { ...n, style: { display: "grid", gridTemplateColumns: s, gap: t, ...n.style }, children: e });
1131
+ return /* @__PURE__ */ t.jsx("div", { ...a, style: { display: "grid", gridTemplateColumns: s, gap: n, ...a.style }, children: e });
1146
1132
  }
1147
- function St({ children: e, direction: r = "column", gap: t, ...n }) {
1148
- return /* @__PURE__ */ a.jsx("div", { ...n, "data-direction": r, style: { display: "flex", flexDirection: r, gap: t, ...n.style }, children: e });
1133
+ function sr({ children: e, direction: r = "column", gap: n, ...a }) {
1134
+ return /* @__PURE__ */ t.jsx("div", { ...a, "data-direction": r, style: { display: "flex", flexDirection: r, gap: n, ...a.style }, children: e });
1149
1135
  }
1150
- function et({
1136
+ function lt({
1151
1137
  label: e = "Loading…",
1152
1138
  "aria-label": r,
1153
- ...t
1139
+ ...n
1154
1140
  }) {
1155
- const n = r ?? (typeof e == "string" || typeof e == "number" ? String(e) : void 0);
1156
- return /* @__PURE__ */ a.jsx(
1141
+ const a = r ?? (typeof e == "string" || typeof e == "number" ? String(e) : void 0);
1142
+ return /* @__PURE__ */ t.jsx(
1157
1143
  "div",
1158
1144
  {
1159
- ...t,
1145
+ ...n,
1160
1146
  role: "status",
1161
- "aria-label": n,
1147
+ "aria-label": a,
1162
1148
  "aria-live": "polite",
1163
1149
  "aria-busy": "true",
1164
1150
  children: e
1165
1151
  }
1166
1152
  );
1167
1153
  }
1168
- function tt({
1154
+ function ct({ icon: e, label: r, className: n, type: a = "button", onClick: s, ...o }) {
1155
+ return /* @__PURE__ */ t.jsx(
1156
+ "button",
1157
+ {
1158
+ ...o,
1159
+ type: a,
1160
+ className: ["fsc-ohm-table__action", n].filter(Boolean).join(" "),
1161
+ "aria-label": o["aria-label"] ?? r,
1162
+ title: o.title ?? r,
1163
+ onClick: (i) => {
1164
+ i.stopPropagation(), s?.(i);
1165
+ },
1166
+ children: e
1167
+ }
1168
+ );
1169
+ }
1170
+ function de({ children: e }) {
1171
+ return /* @__PURE__ */ t.jsx("svg", { viewBox: "0 0 24 24", width: "16", height: "16", fill: "none", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: e });
1172
+ }
1173
+ const dt = [
1174
+ { id: "edit", label: "Upraviť", icon: /* @__PURE__ */ t.jsxs(de, { children: [
1175
+ /* @__PURE__ */ t.jsx("path", { d: "M12 20h9" }),
1176
+ /* @__PURE__ */ t.jsx("path", { d: "M16.5 3.5a2.12 2.12 0 0 1 3 3L8 18l-4 1 1-4Z" })
1177
+ ] }) },
1178
+ { id: "share", label: "Zdieľať", icon: /* @__PURE__ */ t.jsxs(de, { children: [
1179
+ /* @__PURE__ */ t.jsx("circle", { cx: "18", cy: "5", r: "2" }),
1180
+ /* @__PURE__ */ t.jsx("circle", { cx: "6", cy: "12", r: "2" }),
1181
+ /* @__PURE__ */ t.jsx("circle", { cx: "18", cy: "19", r: "2" }),
1182
+ /* @__PURE__ */ t.jsx("path", { d: "m8 11 8-5" }),
1183
+ /* @__PURE__ */ t.jsx("path", { d: "m8 13 8 5" })
1184
+ ] }) },
1185
+ { id: "delete", label: "Vymazať", icon: /* @__PURE__ */ t.jsxs(de, { children: [
1186
+ /* @__PURE__ */ t.jsx("path", { d: "M4 7h16" }),
1187
+ /* @__PURE__ */ t.jsx("path", { d: "M10 11v6" }),
1188
+ /* @__PURE__ */ t.jsx("path", { d: "M14 11v6" }),
1189
+ /* @__PURE__ */ t.jsx("path", { d: "M6 7l1 13h10l1-13" }),
1190
+ /* @__PURE__ */ t.jsx("path", { d: "M9 7V4h6v3" })
1191
+ ] }) }
1192
+ ];
1193
+ function ut({ row: e, actions: r = dt, className: n }) {
1194
+ return /* @__PURE__ */ t.jsx("div", { className: ["fsc-ohm-table__actions", n].filter(Boolean).join(" "), children: r.map(({ id: a, onClick: s, ...o }) => /* @__PURE__ */ t.jsx(ct, { ...o, onClick: () => s?.(e) }, a)) });
1195
+ }
1196
+ function ft({ children: e, className: r }) {
1197
+ return /* @__PURE__ */ t.jsx("tbody", { className: r, children: e });
1198
+ }
1199
+ function re({ children: e, className: r, colSpan: n }) {
1200
+ return /* @__PURE__ */ t.jsx("td", { className: r, colSpan: n, children: e });
1201
+ }
1202
+ function mt({ colSpan: e, children: r }) {
1203
+ return /* @__PURE__ */ t.jsx("tr", { className: "fsc-ohm-table__state-row", children: /* @__PURE__ */ t.jsx("td", { colSpan: e, children: r }) });
1204
+ }
1205
+ function ht({ colSpan: e, children: r }) {
1206
+ return /* @__PURE__ */ t.jsx("tr", { className: "fsc-ohm-table__state-row fsc-ohm-table__state-row--error", children: /* @__PURE__ */ t.jsx("td", { colSpan: e, children: r }) });
1207
+ }
1208
+ function pt({ children: e, className: r }) {
1209
+ return /* @__PURE__ */ t.jsx("thead", { className: r, children: e });
1210
+ }
1211
+ function bt({ direction: e }) {
1212
+ return /* @__PURE__ */ t.jsx("span", { className: "fsc-ohm-table__sort-icon", "aria-hidden": "true", children: /* @__PURE__ */ t.jsx("svg", { viewBox: "0 0 16 16", width: "14", height: "14", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", children: e === "asc" ? /* @__PURE__ */ t.jsx("path", { d: "m4 10 4-4 4 4" }) : e === "desc" ? /* @__PURE__ */ t.jsx("path", { d: "m4 6 4 4 4-4" }) : /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
1213
+ /* @__PURE__ */ t.jsx("path", { d: "m4 6 4-3 4 3" }),
1214
+ /* @__PURE__ */ t.jsx("path", { d: "m4 10 4 3 4-3" })
1215
+ ] }) }) });
1216
+ }
1217
+ function xt({ direction: e, onClick: r, children: n }) {
1218
+ return /* @__PURE__ */ t.jsxs("button", { type: "button", className: "fsc-ohm-table__sort", onClick: r, "aria-label": "Zoradiť", children: [
1219
+ /* @__PURE__ */ t.jsx("span", { className: "fsc-ohm-table__sort-label", children: n }),
1220
+ /* @__PURE__ */ t.jsx(bt, { direction: e })
1221
+ ] });
1222
+ }
1223
+ function ne({ children: e, sortable: r = !1, sortDirection: n, onSort: a, scope: s = "col", className: o }) {
1224
+ return /* @__PURE__ */ t.jsx("th", { scope: s, className: o, children: r ? /* @__PURE__ */ t.jsx(xt, { direction: n, onClick: a, children: e }) : e });
1225
+ }
1226
+ function vt({ colSpan: e, rows: r = 3 }) {
1227
+ return /* @__PURE__ */ t.jsx(t.Fragment, { children: Array.from({ length: r }, (n, a) => /* @__PURE__ */ t.jsx("tr", { className: "fsc-ohm-table__state-row", "aria-busy": "true", children: /* @__PURE__ */ t.jsx("td", { colSpan: e, children: /* @__PURE__ */ t.jsx("span", { className: "fsc-ohm-table__skeleton" }) }) }, a)) });
1228
+ }
1229
+ function jt({ page: e, pageCount: r, onPageChange: n }) {
1230
+ return r > 1 ? /* @__PURE__ */ t.jsxs("nav", { className: "fsc-ohm-table__pagination", "aria-label": "Stránkovanie", children: [
1231
+ /* @__PURE__ */ t.jsx("button", { type: "button", disabled: e <= 1, onClick: () => n?.(e - 1), children: "Predchádzajúca" }),
1232
+ /* @__PURE__ */ t.jsxs("span", { children: [
1233
+ "Strana ",
1234
+ e,
1235
+ " / ",
1236
+ r
1237
+ ] }),
1238
+ /* @__PURE__ */ t.jsx("button", { type: "button", disabled: e >= r, onClick: () => n?.(e + 1), children: "Ďalšia" })
1239
+ ] }) : null;
1240
+ }
1241
+ function gt({ children: e, className: r, selected: n = !1, onClick: a }) {
1242
+ const s = (o) => {
1243
+ a && (o.key !== "Enter" && o.key !== " " || (o.preventDefault(), a()));
1244
+ };
1245
+ return /* @__PURE__ */ t.jsx(
1246
+ "tr",
1247
+ {
1248
+ className: ["fsc-ohm-table__row", r].filter(Boolean).join(" "),
1249
+ "data-selected": n || void 0,
1250
+ "data-clickable": a ? !0 : void 0,
1251
+ tabIndex: a ? 0 : void 0,
1252
+ onClick: a,
1253
+ onKeyDown: s,
1254
+ children: e
1255
+ }
1256
+ );
1257
+ }
1258
+ function yt({ children: e, className: r }) {
1259
+ return /* @__PURE__ */ t.jsx("div", { className: ["fsc-ohm-table__row-actions", r].filter(Boolean).join(" "), children: e });
1260
+ }
1261
+ function ge({ checked: e = !1, onChange: r, disabled: n = !1, "aria-label": a = "Vybrať riadok" }) {
1262
+ return /* @__PURE__ */ t.jsx("input", { type: "checkbox", checked: e, disabled: n, "aria-label": a, onChange: (s) => r?.(s.target.checked) });
1263
+ }
1264
+ function _t(e, r) {
1265
+ const n = e.id;
1266
+ return n == null ? String(r) : String(n);
1267
+ }
1268
+ function St({
1269
+ data: e,
1270
+ columns: r,
1271
+ caption: n,
1272
+ sortable: a = !1,
1273
+ pagination: s = !1,
1274
+ pageSize: o = 10,
1275
+ actions: i = !1,
1276
+ actionItems: l,
1277
+ selectable: c = !1,
1278
+ selectedRowIds: d,
1279
+ getRowId: m = _t,
1280
+ onSelectionChange: f,
1281
+ onRowClick: v,
1282
+ renderRowActions: h,
1283
+ renderExpandedRow: x,
1284
+ loading: b = !1,
1285
+ emptyState: p,
1286
+ error: j,
1287
+ className: C
1288
+ }) {
1289
+ const [T, oe] = w(null), [ie, q] = w(1), [le, K] = w([]), [V, ce] = w([]), F = d ?? le, U = i || !!h, D = !!x, $ = Math.max(1, o), Q = I(() => T ? [...e].sort((g, S) => {
1290
+ const _ = g[T.key], k = S[T.key];
1291
+ if (_ == null && k == null) return 0;
1292
+ if (_ == null) return 1;
1293
+ if (k == null) return -1;
1294
+ const O = String(_).localeCompare(String(k), void 0, {
1295
+ numeric: !0,
1296
+ sensitivity: "base"
1297
+ });
1298
+ return T.direction === "asc" ? O : -O;
1299
+ }) : e, [e, T]), W = s ? Math.max(1, Math.ceil(Q.length / $)) : 1, L = Math.min(ie, W), B = s ? Q.slice((L - 1) * $, L * $) : Q, Y = r.length + Number(c) + Number(U) + Number(D), X = (g) => {
1300
+ !a || g.sortable === !1 || (oe((S) => !S || S.key !== g.key ? { key: g.key, direction: "asc" } : S.direction === "asc" ? { key: g.key, direction: "desc" } : null), q(1));
1301
+ }, ee = (g, S) => {
1302
+ const _ = S ? [...F, g] : F.filter((k) => k !== g);
1303
+ d === void 0 && K(_), f?.(_, e.filter((k, O) => _.includes(m(k, O))));
1304
+ }, u = B.map(
1305
+ (g, S) => m(g, (L - 1) * $ + S)
1306
+ ), y = u.length > 0 && u.every((g) => F.includes(g)), N = (g) => {
1307
+ const S = g ? Array.from(/* @__PURE__ */ new Set([...F, ...u])) : F.filter((_) => !u.includes(_));
1308
+ d === void 0 && K(S), f?.(S, e.filter((_, k) => S.includes(m(_, k))));
1309
+ }, E = (g) => {
1310
+ ce(
1311
+ (S) => S.includes(g) ? S.filter((_) => _ !== g) : [...S, g]
1312
+ );
1313
+ };
1314
+ return /* @__PURE__ */ t.jsxs("div", { className: ["fsc-ohm-table__container", C].filter(Boolean).join(" "), children: [
1315
+ /* @__PURE__ */ t.jsxs("table", { className: "fsc-ohm-table", children: [
1316
+ n && /* @__PURE__ */ t.jsx("caption", { className: "fsc-ohm-table__caption", children: n }),
1317
+ /* @__PURE__ */ t.jsxs("colgroup", { children: [
1318
+ U && /* @__PURE__ */ t.jsx("col", { style: { width: "8.5rem" } }),
1319
+ D && /* @__PURE__ */ t.jsx("col", { style: { width: "3rem" } }),
1320
+ c && /* @__PURE__ */ t.jsx("col", { style: { width: "3rem" } }),
1321
+ r.map((g) => /* @__PURE__ */ t.jsx("col", { style: g.width ? { width: g.width } : void 0 }, g.key))
1322
+ ] }),
1323
+ /* @__PURE__ */ t.jsx(pt, { children: /* @__PURE__ */ t.jsxs("tr", { children: [
1324
+ U && /* @__PURE__ */ t.jsx(ne, { className: "fsc-ohm-table__actions-header", scope: "col", children: "Akcie" }),
1325
+ D && /* @__PURE__ */ t.jsx(ne, { scope: "col", children: "Rozbaliť" }),
1326
+ c && /* @__PURE__ */ t.jsx(ne, { scope: "col", children: /* @__PURE__ */ t.jsx(
1327
+ ge,
1328
+ {
1329
+ checked: y,
1330
+ onChange: N,
1331
+ "aria-label": "Vybrať všetky riadky"
1332
+ }
1333
+ ) }),
1334
+ r.map((g) => /* @__PURE__ */ t.jsx(
1335
+ ne,
1336
+ {
1337
+ scope: "col",
1338
+ sortable: a && g.sortable !== !1,
1339
+ sortDirection: T?.key === g.key ? T.direction : void 0,
1340
+ onSort: () => X(g),
1341
+ children: g.header
1342
+ },
1343
+ g.key
1344
+ ))
1345
+ ] }) }),
1346
+ /* @__PURE__ */ t.jsx(ft, { children: b ? /* @__PURE__ */ t.jsx(vt, { colSpan: Y }) : j ? /* @__PURE__ */ t.jsx(ht, { colSpan: Y, children: j }) : B.length === 0 ? /* @__PURE__ */ t.jsx(mt, { colSpan: Y, children: p ?? "Žiadne záznamy." }) : B.map((g, S) => {
1347
+ const _ = s ? (L - 1) * $ + S : S, k = m(g, _), O = V.includes(k);
1348
+ return /* @__PURE__ */ t.jsxs(
1349
+ gt,
1350
+ {
1351
+ selected: F.includes(k),
1352
+ onClick: v ? () => v(g) : void 0,
1353
+ children: [
1354
+ U && /* @__PURE__ */ t.jsxs(re, { className: "fsc-ohm-table__actions-cell", children: [
1355
+ /* @__PURE__ */ t.jsx(ut, { row: g, actions: l }),
1356
+ h ? /* @__PURE__ */ t.jsx(yt, { children: h(g) }) : null
1357
+ ] }),
1358
+ D && /* @__PURE__ */ t.jsx(re, { children: /* @__PURE__ */ t.jsx(
1359
+ "button",
1360
+ {
1361
+ type: "button",
1362
+ className: "fsc-ohm-table__icon-button",
1363
+ onClick: (z) => {
1364
+ z.stopPropagation(), E(k);
1365
+ },
1366
+ "aria-expanded": O,
1367
+ "aria-label": O ? "Zbaliť riadok" : "Rozbaliť riadok",
1368
+ children: O ? "−" : "+"
1369
+ }
1370
+ ) }),
1371
+ c && /* @__PURE__ */ t.jsx(re, { children: /* @__PURE__ */ t.jsx(
1372
+ ge,
1373
+ {
1374
+ checked: F.includes(k),
1375
+ onChange: (z) => ee(k, z),
1376
+ "aria-label": `Vybrať riadok ${k}`
1377
+ }
1378
+ ) }),
1379
+ r.map((z) => /* @__PURE__ */ t.jsx(re, { children: z.render ? z.render(g[z.key], g) : String(g[z.key] ?? "—") }, z.key))
1380
+ ]
1381
+ },
1382
+ k
1383
+ );
1384
+ }) })
1385
+ ] }),
1386
+ B.some(
1387
+ (g, S) => x && V.includes(m(g, (L - 1) * $ + S))
1388
+ ) && /* @__PURE__ */ t.jsx("div", { className: "fsc-ohm-table__expanded-content", children: B.map((g, S) => {
1389
+ const _ = m(g, (L - 1) * $ + S);
1390
+ return V.includes(_) ? /* @__PURE__ */ t.jsx("div", { children: x?.(g) }, _) : null;
1391
+ }) }),
1392
+ s && !b && !j && /* @__PURE__ */ t.jsx(jt, { page: L, pageCount: W, onPageChange: q })
1393
+ ] });
1394
+ }
1395
+ function wt({
1169
1396
  resource: e,
1170
1397
  columns: r,
1171
- pageSize: t,
1172
- emptyState: n = "No records.",
1398
+ pageSize: n,
1399
+ emptyState: a = "No records.",
1173
1400
  reloadKey: s,
1174
1401
  className: o,
1175
1402
  ...i
1176
1403
  }) {
1177
- const { controller: c, state: u } = Ge({ resource: e, columns: r, pageSize: t });
1178
- return M(() => {
1179
- c.load();
1180
- }, [c, s]), /* @__PURE__ */ a.jsx(
1181
- qe,
1404
+ const { controller: l, state: c } = nt({ resource: e, columns: r, pageSize: n }), d = c.columns.map((m) => ({
1405
+ ...m,
1406
+ header: m.header ?? m.key
1407
+ }));
1408
+ return P(() => {
1409
+ l.load();
1410
+ }, [l, s]), /* @__PURE__ */ t.jsx(
1411
+ St,
1182
1412
  {
1183
1413
  ...i,
1184
1414
  className: o ? `fsc-resource-table ${o}` : "fsc-resource-table",
1185
- data: u.data,
1186
- columns: u.columns,
1187
- emptyState: u.loading ? /* @__PURE__ */ a.jsx(et, {}) : u.error?.message ?? n
1415
+ data: c.data,
1416
+ columns: d,
1417
+ emptyState: c.loading ? /* @__PURE__ */ t.jsx(lt, {}) : c.error?.message ?? a
1188
1418
  }
1189
1419
  );
1190
1420
  }
1191
- const rt = [
1421
+ const Nt = [
1192
1422
  { id: "1", name: "Phone", price: 499 },
1193
1423
  { id: "2", name: "Vacuum", price: 299 },
1194
1424
  { id: "3", name: "Tablet", price: 349 }
1195
- ], nt = { name: "", price: "" };
1196
- function at(e) {
1197
- return e ? { name: e.name, price: String(e.price) } : nt;
1425
+ ], kt = { name: "", price: "" };
1426
+ function Et(e) {
1427
+ return e ? { name: e.name, price: String(e.price) } : kt;
1198
1428
  }
1199
- function st({
1429
+ function Ct({
1200
1430
  store: e,
1201
1431
  operation: r,
1202
- controllerError: t,
1203
- editing: n,
1432
+ controllerError: n,
1433
+ editing: a,
1204
1434
  onSuccess: s,
1205
1435
  onCancel: o
1206
1436
  }) {
1207
- const i = De(), c = i.submitting || r === "creating" || r === "updating";
1208
- return /* @__PURE__ */ a.jsxs(
1437
+ const i = Ge(), l = i.submitting || r === "creating" || r === "updating";
1438
+ return /* @__PURE__ */ t.jsxs(
1209
1439
  "form",
1210
1440
  {
1211
1441
  className: "fsc-crud-example__editor",
1212
- onSubmit: async (u) => {
1213
- u.preventDefault(), await e.submit() && s();
1442
+ onSubmit: async (c) => {
1443
+ c.preventDefault(), await e.submit() && s();
1214
1444
  },
1215
- onReset: (u) => {
1216
- u.preventDefault(), e.reset();
1445
+ onReset: (c) => {
1446
+ c.preventDefault(), e.reset();
1217
1447
  },
1218
1448
  children: [
1219
- /* @__PURE__ */ a.jsx("strong", { children: n ? "Upraviť záznam" : "Nový záznam" }),
1220
- /* @__PURE__ */ a.jsx(ee, { name: "name", children: (u) => /* @__PURE__ */ a.jsxs("label", { className: "fsc-crud-example__field", children: [
1221
- /* @__PURE__ */ a.jsx("span", { children: "Názov" }),
1222
- /* @__PURE__ */ a.jsx(
1449
+ /* @__PURE__ */ t.jsx("strong", { children: a ? "Upraviť záznam" : "Nový záznam" }),
1450
+ /* @__PURE__ */ t.jsx(ve, { name: "name", children: (c) => /* @__PURE__ */ t.jsxs("label", { className: "fsc-crud-example__field", children: [
1451
+ /* @__PURE__ */ t.jsx("span", { children: "Názov" }),
1452
+ /* @__PURE__ */ t.jsx(
1223
1453
  "input",
1224
1454
  {
1225
- value: u.value,
1226
- onChange: (f) => u.setValue(f.target.value),
1227
- onBlur: () => u.setTouched(),
1228
- disabled: c,
1229
- "aria-invalid": u.error ? !0 : void 0
1455
+ value: c.value,
1456
+ onChange: (d) => c.setValue(d.target.value),
1457
+ onBlur: () => c.setTouched(),
1458
+ disabled: l,
1459
+ "aria-invalid": c.error ? !0 : void 0
1230
1460
  }
1231
1461
  ),
1232
- u.error ? /* @__PURE__ */ a.jsx("small", { role: "alert", children: u.error }) : null
1462
+ c.error ? /* @__PURE__ */ t.jsx("small", { role: "alert", children: c.error }) : null
1233
1463
  ] }) }),
1234
- /* @__PURE__ */ a.jsx(ee, { name: "price", children: (u) => /* @__PURE__ */ a.jsxs("label", { className: "fsc-crud-example__field", children: [
1235
- /* @__PURE__ */ a.jsx("span", { children: "Cena (€)" }),
1236
- /* @__PURE__ */ a.jsx(
1464
+ /* @__PURE__ */ t.jsx(ve, { name: "price", children: (c) => /* @__PURE__ */ t.jsxs("label", { className: "fsc-crud-example__field", children: [
1465
+ /* @__PURE__ */ t.jsx("span", { children: "Cena (€)" }),
1466
+ /* @__PURE__ */ t.jsx(
1237
1467
  "input",
1238
1468
  {
1239
1469
  type: "number",
1240
1470
  min: "0",
1241
1471
  step: "0.01",
1242
- value: u.value,
1243
- onChange: (f) => u.setValue(f.target.value),
1244
- onBlur: () => u.setTouched(),
1245
- disabled: c,
1246
- "aria-invalid": u.error ? !0 : void 0
1472
+ value: c.value,
1473
+ onChange: (d) => c.setValue(d.target.value),
1474
+ onBlur: () => c.setTouched(),
1475
+ disabled: l,
1476
+ "aria-invalid": c.error ? !0 : void 0
1247
1477
  }
1248
1478
  ),
1249
- u.error ? /* @__PURE__ */ a.jsx("small", { role: "alert", children: u.error }) : null
1479
+ c.error ? /* @__PURE__ */ t.jsx("small", { role: "alert", children: c.error }) : null
1250
1480
  ] }) }),
1251
- t ? /* @__PURE__ */ a.jsx("small", { role: "alert", children: t.message }) : null,
1252
- i.submitError && !t ? /* @__PURE__ */ a.jsx("small", { role: "alert", children: i.submitError }) : null,
1253
- /* @__PURE__ */ a.jsxs("div", { className: "fsc-crud-example__actions", children: [
1254
- /* @__PURE__ */ a.jsx(Ve, { disabled: c, children: r === "creating" ? "Vytváram…" : r === "updating" ? "Ukladám…" : n ? "Uložiť zmeny" : "Vytvoriť" }),
1255
- /* @__PURE__ */ a.jsx(Ue, { disabled: c, children: "Reset" }),
1256
- /* @__PURE__ */ a.jsx("button", { type: "button", onClick: o, disabled: c, children: "Zrušiť" }),
1257
- c ? /* @__PURE__ */ a.jsx("span", { "aria-live": "polite", children: "Spracovávam…" }) : null
1481
+ n ? /* @__PURE__ */ t.jsx("small", { role: "alert", children: n.message }) : null,
1482
+ i.submitError && !n ? /* @__PURE__ */ t.jsx("small", { role: "alert", children: i.submitError }) : null,
1483
+ /* @__PURE__ */ t.jsxs("div", { className: "fsc-crud-example__actions", children: [
1484
+ /* @__PURE__ */ t.jsx(He, { disabled: l, children: r === "creating" ? "Vytváram…" : r === "updating" ? "Ukladám…" : a ? "Uložiť zmeny" : "Vytvoriť" }),
1485
+ /* @__PURE__ */ t.jsx(qe, { disabled: l, children: "Reset" }),
1486
+ /* @__PURE__ */ t.jsx("button", { type: "button", onClick: o, disabled: l, children: "Zrušiť" }),
1487
+ l ? /* @__PURE__ */ t.jsx("span", { "aria-live": "polite", children: "Spracovávam…" }) : null
1258
1488
  ] })
1259
1489
  ]
1260
1490
  }
1261
1491
  );
1262
1492
  }
1263
- function ot(e) {
1264
- return /* @__PURE__ */ a.jsx(le, { store: e.store, children: /* @__PURE__ */ a.jsx(st, { ...e }) });
1493
+ function Tt(e) {
1494
+ return /* @__PURE__ */ t.jsx(ke, { store: e.store, children: /* @__PURE__ */ t.jsx(Ct, { ...e }) });
1265
1495
  }
1266
- function wt({ onEvent: e } = {}) {
1267
- const r = P(
1268
- () => We("crud-example", rt),
1496
+ function or({ onEvent: e } = {}) {
1497
+ const r = I(
1498
+ () => et("crud-example", Nt),
1269
1499
  []
1270
- ), t = Ke(r), [n, s] = T(!1), [o, i] = T(), [c, u] = T(0), f = E(() => {
1500
+ ), n = it(r), [a, s] = w(!1), [o, i] = w(), [l, c] = w(0), d = R(() => {
1271
1501
  i(void 0), s(!0);
1272
- }, []), h = E((x) => {
1273
- i(x), s(!0);
1274
- }, []), d = E(
1275
- async (x) => {
1276
- if (t.operation === "idle")
1502
+ }, []), m = R((b) => {
1503
+ i(b), s(!0);
1504
+ }, []), f = R(
1505
+ async (b) => {
1506
+ if (n.operation === "idle")
1277
1507
  try {
1278
- await t.remove(x.id), u((m) => m + 1), e?.("delete");
1508
+ await n.remove(b.id), c((p) => p + 1), e?.("delete");
1279
1509
  } catch {
1280
1510
  e?.("error");
1281
1511
  }
1282
1512
  },
1283
- [t, e]
1284
- ), g = P(
1285
- () => Y({
1286
- initialValues: at(o),
1287
- validate: async (x) => {
1288
- const m = {};
1289
- x.name.trim() || (m.name = "Názov je povinný.");
1290
- const v = Number(x.price);
1291
- return (!x.price.trim() || !Number.isFinite(v) || v < 0) && (m.price = "Zadajte platnú cenu."), m;
1513
+ [n, e]
1514
+ ), v = I(
1515
+ () => me({
1516
+ initialValues: Et(o),
1517
+ validate: async (b) => {
1518
+ const p = {};
1519
+ b.name.trim() || (p.name = "Názov je povinný.");
1520
+ const j = Number(b.price);
1521
+ return (!b.price.trim() || !Number.isFinite(j) || j < 0) && (p.price = "Zadajte platnú cenu."), p;
1292
1522
  },
1293
- onSubmit: async (x) => {
1294
- const m = { name: x.name.trim(), price: Number(x.price) };
1295
- o ? (await t.update(o.id, m), e?.("update")) : (await t.create(m), e?.("create"));
1523
+ onSubmit: async (b) => {
1524
+ const p = { name: b.name.trim(), price: Number(b.price) };
1525
+ o ? (await n.update(o.id, p), e?.("update")) : (await n.create(p), e?.("create"));
1296
1526
  }
1297
1527
  }),
1298
- [t.create, t.update, o, e]
1299
- ), b = P(
1528
+ [n.create, n.update, o, e]
1529
+ ), h = I(
1300
1530
  () => [
1301
1531
  {
1302
1532
  key: "name",
1303
1533
  header: "Produkt",
1304
- render: (x, m) => /* @__PURE__ */ a.jsxs("div", { className: "fsc-crud-example__row-action", children: [
1305
- /* @__PURE__ */ a.jsx("span", { children: String(x) }),
1306
- /* @__PURE__ */ a.jsx(
1534
+ render: (b, p) => /* @__PURE__ */ t.jsxs("div", { className: "fsc-crud-example__row-action", children: [
1535
+ /* @__PURE__ */ t.jsx("span", { children: String(b) }),
1536
+ /* @__PURE__ */ t.jsx(
1307
1537
  "button",
1308
1538
  {
1309
1539
  type: "button",
1310
- onClick: () => h(m),
1311
- disabled: t.operation !== "idle",
1540
+ onClick: () => m(p),
1541
+ disabled: n.operation !== "idle",
1312
1542
  children: "Upraviť"
1313
1543
  }
1314
1544
  )
@@ -1317,54 +1547,54 @@ function wt({ onEvent: e } = {}) {
1317
1547
  {
1318
1548
  key: "price",
1319
1549
  header: "Cena",
1320
- render: (x) => `${String(x)} €`
1550
+ render: (b) => `${String(b)} €`
1321
1551
  },
1322
1552
  {
1323
1553
  key: "id",
1324
1554
  header: "Akcie",
1325
- render: (x, m) => /* @__PURE__ */ a.jsx(
1555
+ render: (b, p) => /* @__PURE__ */ t.jsx(
1326
1556
  "button",
1327
1557
  {
1328
1558
  type: "button",
1329
1559
  onClick: () => {
1330
- d(m);
1560
+ f(p);
1331
1561
  },
1332
- disabled: t.operation !== "idle",
1562
+ disabled: n.operation !== "idle",
1333
1563
  children: "Zmazať"
1334
1564
  }
1335
1565
  )
1336
1566
  }
1337
1567
  ],
1338
- [t.operation, d, h]
1339
- ), j = E(() => {
1340
- u((x) => x + 1), s(!1), i(void 0);
1568
+ [n.operation, f, m]
1569
+ ), x = R(() => {
1570
+ c((b) => b + 1), s(!1), i(void 0);
1341
1571
  }, []);
1342
- return /* @__PURE__ */ a.jsxs("div", { className: "fsc-crud-example", children: [
1343
- /* @__PURE__ */ a.jsxs("div", { className: "fsc-crud-example__toolbar", children: [
1344
- /* @__PURE__ */ a.jsx("button", { type: "button", onClick: f, disabled: t.operation !== "idle", children: "Vytvoriť nový záznam" }),
1345
- /* @__PURE__ */ a.jsxs("span", { "aria-live": "polite", children: [
1572
+ return /* @__PURE__ */ t.jsxs("div", { className: "fsc-crud-example", children: [
1573
+ /* @__PURE__ */ t.jsxs("div", { className: "fsc-crud-example__toolbar", children: [
1574
+ /* @__PURE__ */ t.jsx("button", { type: "button", onClick: d, disabled: n.operation !== "idle", children: "Vytvoriť nový záznam" }),
1575
+ /* @__PURE__ */ t.jsxs("span", { "aria-live": "polite", children: [
1346
1576
  "Stav: ",
1347
- t.operation === "idle" ? "Pripravené" : t.operation
1577
+ n.operation === "idle" ? "Pripravené" : n.operation
1348
1578
  ] }),
1349
- t.error ? /* @__PURE__ */ a.jsx("small", { role: "alert", children: t.error.message }) : null
1579
+ n.error ? /* @__PURE__ */ t.jsx("small", { role: "alert", children: n.error.message }) : null
1350
1580
  ] }),
1351
- /* @__PURE__ */ a.jsx(
1352
- tt,
1581
+ /* @__PURE__ */ t.jsx(
1582
+ wt,
1353
1583
  {
1354
1584
  resource: r,
1355
- columns: b,
1585
+ columns: h,
1356
1586
  pageSize: 10,
1357
- reloadKey: c
1587
+ reloadKey: l
1358
1588
  }
1359
1589
  ),
1360
- n ? /* @__PURE__ */ a.jsx(
1361
- ot,
1590
+ a ? /* @__PURE__ */ t.jsx(
1591
+ Tt,
1362
1592
  {
1363
- store: g,
1364
- operation: t.operation,
1365
- controllerError: t.error,
1593
+ store: v,
1594
+ operation: n.operation,
1595
+ controllerError: n.error,
1366
1596
  editing: !!o,
1367
- onSuccess: j,
1597
+ onSuccess: x,
1368
1598
  onCancel: () => {
1369
1599
  s(!1), i(void 0);
1370
1600
  }
@@ -1372,318 +1602,970 @@ function wt({ onEvent: e } = {}) {
1372
1602
  ) : null
1373
1603
  ] });
1374
1604
  }
1375
- function Et(e) {
1376
- return /* @__PURE__ */ a.jsx("input", { ...e, type: "color" });
1605
+ function ir({
1606
+ count: e,
1607
+ singularLabel: r = "result",
1608
+ pluralLabel: n = "results",
1609
+ className: a,
1610
+ ...s
1611
+ }) {
1612
+ return /* @__PURE__ */ t.jsxs(
1613
+ "span",
1614
+ {
1615
+ ...s,
1616
+ className: a ? `fsc-results-count ${a}` : "fsc-results-count",
1617
+ "aria-live": "polite",
1618
+ children: [
1619
+ e,
1620
+ " ",
1621
+ e === 1 ? r : n
1622
+ ]
1623
+ }
1624
+ );
1377
1625
  }
1378
- function Tt(e) {
1379
- return /* @__PURE__ */ a.jsx("input", { ...e, type: "date" });
1626
+ function lr(e) {
1627
+ return /* @__PURE__ */ t.jsx("input", { ...e, type: "color" });
1380
1628
  }
1381
- function Ct(e) {
1382
- return /* @__PURE__ */ a.jsx("input", { ...e, type: "file" });
1629
+ function cr(e) {
1630
+ return /* @__PURE__ */ t.jsx("input", { ...e, type: "date" });
1383
1631
  }
1384
- function kt(e) {
1385
- return /* @__PURE__ */ a.jsx("input", { ...e, type: "number" });
1632
+ function dr(e) {
1633
+ return /* @__PURE__ */ t.jsx("input", { ...e, type: "file" });
1386
1634
  }
1387
- function Rt(e) {
1388
- return /* @__PURE__ */ a.jsx("input", { ...e, type: "password" });
1635
+ function ur({
1636
+ label: e,
1637
+ options: r,
1638
+ value: n = [],
1639
+ onValueChange: a,
1640
+ disabled: s = !1
1641
+ }) {
1642
+ const o = new Set(n), i = (l) => {
1643
+ const c = new Set(o);
1644
+ c.has(l) ? c.delete(l) : c.add(l), a?.([...c]);
1645
+ };
1646
+ return /* @__PURE__ */ t.jsxs("fieldset", { className: "fsc-multi-select-filter", disabled: s, children: [
1647
+ e ? /* @__PURE__ */ t.jsx("legend", { className: "fsc-multi-select-filter__label", children: e }) : null,
1648
+ /* @__PURE__ */ t.jsx("div", { className: "fsc-multi-select-filter__options", children: r.map((l) => /* @__PURE__ */ t.jsxs("label", { className: "fsc-multi-select-filter__option", children: [
1649
+ /* @__PURE__ */ t.jsx(
1650
+ "input",
1651
+ {
1652
+ type: "checkbox",
1653
+ checked: o.has(l.value),
1654
+ disabled: l.disabled,
1655
+ onChange: () => i(l.value)
1656
+ }
1657
+ ),
1658
+ /* @__PURE__ */ t.jsx("span", { children: l.label })
1659
+ ] }, l.value)) })
1660
+ ] });
1661
+ }
1662
+ function fr(e) {
1663
+ return /* @__PURE__ */ t.jsx("input", { ...e, type: "number" });
1664
+ }
1665
+ function mr(e) {
1666
+ return /* @__PURE__ */ t.jsx("input", { ...e, type: "password" });
1389
1667
  }
1390
- function _t({ name: e, options: r, value: t, onValueChange: n }) {
1391
- return /* @__PURE__ */ a.jsx("div", { role: "radiogroup", children: r.map((s) => /* @__PURE__ */ a.jsxs("label", { children: [
1392
- /* @__PURE__ */ a.jsx("input", { type: "radio", name: e, value: s.value, checked: t === s.value, disabled: s.disabled, onChange: () => n?.(s.value) }),
1668
+ function hr({ name: e, options: r, value: n, onValueChange: a }) {
1669
+ return /* @__PURE__ */ t.jsx("div", { role: "radiogroup", children: r.map((s) => /* @__PURE__ */ t.jsxs("label", { children: [
1670
+ /* @__PURE__ */ t.jsx("input", { type: "radio", name: e, value: s.value, checked: n === s.value, disabled: s.disabled, onChange: () => a?.(s.value) }),
1393
1671
  s.label
1394
1672
  ] }, s.value)) });
1395
1673
  }
1396
- function Pt(e) {
1397
- return /* @__PURE__ */ a.jsx("input", { ...e, type: "search" });
1674
+ function pr(e) {
1675
+ return /* @__PURE__ */ t.jsx("input", { ...e, type: "search" });
1398
1676
  }
1399
- function Ot(e) {
1400
- return /* @__PURE__ */ a.jsx("input", { ...e, type: "range" });
1677
+ function br({
1678
+ label: e,
1679
+ options: r,
1680
+ onValueChange: n,
1681
+ value: a,
1682
+ defaultValue: s,
1683
+ id: o,
1684
+ ...i
1685
+ }) {
1686
+ return /* @__PURE__ */ t.jsxs("label", { className: "fsc-select-filter", children: [
1687
+ e ? /* @__PURE__ */ t.jsx("span", { className: "fsc-select-filter__label", children: e }) : null,
1688
+ /* @__PURE__ */ t.jsx(
1689
+ "select",
1690
+ {
1691
+ ...i,
1692
+ id: o,
1693
+ value: a,
1694
+ defaultValue: s,
1695
+ onChange: (l) => n?.(l.target.value),
1696
+ "data-size": "medium",
1697
+ children: r.map((l) => /* @__PURE__ */ t.jsx("option", { value: l.value, disabled: l.disabled, children: l.label }, l.value))
1698
+ }
1699
+ )
1700
+ ] });
1701
+ }
1702
+ function xr(e) {
1703
+ return /* @__PURE__ */ t.jsx("input", { ...e, type: "range" });
1704
+ }
1705
+ function vr({
1706
+ search: e,
1707
+ filters: r,
1708
+ leading: n,
1709
+ results: a,
1710
+ actions: s,
1711
+ ariaLabel: o = "Page actions",
1712
+ className: i,
1713
+ ...l
1714
+ }) {
1715
+ const c = ["fsc-ohm-action-bar", i].filter(Boolean).join(" ");
1716
+ return /* @__PURE__ */ t.jsxs(
1717
+ "div",
1718
+ {
1719
+ ...l,
1720
+ className: c,
1721
+ role: "toolbar",
1722
+ "aria-label": o,
1723
+ children: [
1724
+ /* @__PURE__ */ t.jsxs("div", { className: "fsc-ohm-action-bar__controls", children: [
1725
+ n ? /* @__PURE__ */ t.jsx("div", { className: "fsc-ohm-action-bar__leading", children: n }) : null,
1726
+ e ? /* @__PURE__ */ t.jsx("div", { className: "fsc-ohm-action-bar__search", children: e }) : null,
1727
+ r ? /* @__PURE__ */ t.jsx("div", { className: "fsc-ohm-action-bar__filters", children: r }) : null
1728
+ ] }),
1729
+ /* @__PURE__ */ t.jsxs("div", { className: "fsc-ohm-action-bar__meta", children: [
1730
+ a ? /* @__PURE__ */ t.jsx("div", { className: "fsc-ohm-action-bar__results", children: a }) : null,
1731
+ s ? /* @__PURE__ */ t.jsx("div", { className: "fsc-ohm-action-bar__actions", children: s }) : null
1732
+ ] })
1733
+ ]
1734
+ }
1735
+ );
1736
+ }
1737
+ function Rt({
1738
+ value: e,
1739
+ options: r,
1740
+ placeholder: n,
1741
+ searchPlaceholder: a,
1742
+ add: s,
1743
+ disabled: o,
1744
+ onChange: i
1745
+ }) {
1746
+ const [l, c] = w(!1), [d, m] = w(""), f = A(null), v = A(null), h = r.find((j) => String(j.value) === String(e)), x = d.trim().toLocaleLowerCase(), b = x ? r.filter((j) => String(j.label).toLocaleLowerCase().includes(x)) : r;
1747
+ P(() => {
1748
+ if (!l) return;
1749
+ const j = (C) => {
1750
+ f.current?.contains(C.target) || (c(!1), m(""));
1751
+ };
1752
+ return document.addEventListener("mousedown", j), requestAnimationFrame(() => v.current?.focus()), () => document.removeEventListener("mousedown", j);
1753
+ }, [l]);
1754
+ const p = (j) => {
1755
+ i(j.value), c(!1), m("");
1756
+ };
1757
+ return /* @__PURE__ */ t.jsxs("div", { ref: f, className: "fsc-ohm-data-field__select-search", children: [
1758
+ /* @__PURE__ */ t.jsxs(
1759
+ "button",
1760
+ {
1761
+ type: "button",
1762
+ className: "fsc-ohm-data-field__select-search-trigger",
1763
+ "aria-expanded": l,
1764
+ disabled: o,
1765
+ onClick: () => c((j) => !j),
1766
+ children: [
1767
+ /* @__PURE__ */ t.jsx("span", { className: h ? "fsc-ohm-data-field__select-search-value" : "fsc-ohm-data-field__select-search-placeholder", children: h?.label ?? n }),
1768
+ /* @__PURE__ */ t.jsx("span", { className: "fsc-ohm-data-field__select-search-chevron", "aria-hidden": "true" })
1769
+ ]
1770
+ }
1771
+ ),
1772
+ l ? /* @__PURE__ */ t.jsxs("div", { className: "fsc-ohm-data-field__select-search-dropdown", children: [
1773
+ /* @__PURE__ */ t.jsx("div", { className: "fsc-ohm-data-field__select-search-input", children: /* @__PURE__ */ t.jsx(
1774
+ "input",
1775
+ {
1776
+ ref: v,
1777
+ value: d,
1778
+ placeholder: a,
1779
+ "aria-label": a,
1780
+ onChange: (j) => m(j.target.value)
1781
+ }
1782
+ ) }),
1783
+ /* @__PURE__ */ t.jsxs("div", { className: "fsc-ohm-data-field__select-search-options", children: [
1784
+ s ? /* @__PURE__ */ t.jsx(
1785
+ "button",
1786
+ {
1787
+ type: "button",
1788
+ className: "fsc-ohm-data-field__select-search-option fsc-ohm-data-field__select-search-option--add",
1789
+ onClick: () => s.onAdd(),
1790
+ children: s.label ?? "+ Pridať"
1791
+ }
1792
+ ) : null,
1793
+ b.map((j) => /* @__PURE__ */ t.jsx(
1794
+ "button",
1795
+ {
1796
+ type: "button",
1797
+ className: "fsc-ohm-data-field__select-search-option",
1798
+ "aria-pressed": String(j.value) === String(e),
1799
+ onClick: () => p(j),
1800
+ children: j.label
1801
+ },
1802
+ j.value
1803
+ )),
1804
+ b.length === 0 ? /* @__PURE__ */ t.jsx("div", { className: "fsc-ohm-data-field__select-search-empty", children: "Žiadne výsledky" }) : null
1805
+ ] })
1806
+ ] }) : null
1807
+ ] });
1401
1808
  }
1402
- function At({ items: e }) {
1403
- return /* @__PURE__ */ a.jsx("div", { children: e.map((r) => /* @__PURE__ */ a.jsxs("details", { children: [
1404
- /* @__PURE__ */ a.jsx("summary", { children: r.title }),
1405
- /* @__PURE__ */ a.jsx("div", { children: r.content })
1809
+ function jr({
1810
+ label: e,
1811
+ value: r = "",
1812
+ state: n = "display",
1813
+ type: a = "text",
1814
+ options: s = [],
1815
+ add: o = !1,
1816
+ placeholder: i,
1817
+ disabled: l = !1,
1818
+ required: c = !1,
1819
+ className: d,
1820
+ onChange: m
1821
+ }) {
1822
+ const f = [
1823
+ "fsc-ohm-data-field",
1824
+ "fsc-ohm-data-field--" + n,
1825
+ d
1826
+ ].filter(Boolean).join(" "), v = a === "select" || a === "select-search" ? s.find((b) => String(b.value) === String(r))?.label ?? r : r, h = (b) => {
1827
+ m?.(b);
1828
+ }, x = o === !0 ? { label: "+ Pridať", onAdd: () => {
1829
+ } } : o === !1 ? void 0 : o;
1830
+ return /* @__PURE__ */ t.jsxs("div", { className: f, children: [
1831
+ /* @__PURE__ */ t.jsx("div", { className: "fsc-ohm-data-field__label", children: e }),
1832
+ n === "display" ? /* @__PURE__ */ t.jsx("div", { className: "fsc-ohm-data-field__value", children: v === "" || v === void 0 ? /* @__PURE__ */ t.jsx("span", { className: "fsc-ohm-data-field__empty", children: "—" }) : v }) : /* @__PURE__ */ t.jsx("div", { className: "fsc-ohm-data-field__control", children: a === "textarea" ? /* @__PURE__ */ t.jsx(
1833
+ "textarea",
1834
+ {
1835
+ value: String(r),
1836
+ placeholder: i,
1837
+ disabled: l,
1838
+ required: c,
1839
+ onChange: (b) => h(b.target.value)
1840
+ }
1841
+ ) : a === "select-search" ? /* @__PURE__ */ t.jsx(
1842
+ Rt,
1843
+ {
1844
+ value: r,
1845
+ options: s,
1846
+ placeholder: i ?? "Vybrať...",
1847
+ searchPlaceholder: "Hľadať...",
1848
+ add: x,
1849
+ disabled: l,
1850
+ onChange: h
1851
+ }
1852
+ ) : a === "select" ? /* @__PURE__ */ t.jsx(
1853
+ "select",
1854
+ {
1855
+ value: String(r),
1856
+ disabled: l,
1857
+ required: c,
1858
+ onChange: (b) => h(b.target.value),
1859
+ children: s.map((b) => /* @__PURE__ */ t.jsx("option", { value: b.value, children: b.label }, b.value))
1860
+ }
1861
+ ) : /* @__PURE__ */ t.jsx(
1862
+ "input",
1863
+ {
1864
+ type: a,
1865
+ value: String(r),
1866
+ placeholder: i,
1867
+ disabled: l,
1868
+ required: c,
1869
+ onChange: (b) => h(b.target.value)
1870
+ }
1871
+ ) })
1872
+ ] });
1873
+ }
1874
+ function Pt({
1875
+ document: e,
1876
+ onPreview: r
1877
+ }) {
1878
+ return /* @__PURE__ */ t.jsx(
1879
+ "button",
1880
+ {
1881
+ type: "button",
1882
+ className: "fsc-ohm-document-list__preview",
1883
+ "aria-label": `Náhľad dokumentu ${e.name}`,
1884
+ disabled: !r,
1885
+ onClick: () => r?.(e),
1886
+ children: e.previewUrl ? /* @__PURE__ */ t.jsx("img", { src: e.previewUrl, alt: "" }) : /* @__PURE__ */ t.jsxs("span", { className: "fsc-ohm-document-list__preview-sheet", "aria-hidden": "true", children: [
1887
+ /* @__PURE__ */ t.jsx("span", {}),
1888
+ /* @__PURE__ */ t.jsx("span", {}),
1889
+ /* @__PURE__ */ t.jsx("span", {})
1890
+ ] })
1891
+ }
1892
+ );
1893
+ }
1894
+ function gr({
1895
+ documents: e = [],
1896
+ emptyState: r = "Žiadne dokumenty",
1897
+ className: n,
1898
+ onPreview: a,
1899
+ onDelete: s,
1900
+ onDownload: o,
1901
+ onShare: i
1902
+ }) {
1903
+ const l = [
1904
+ "fsc-ohm-document-list",
1905
+ n
1906
+ ].filter(Boolean).join(" ");
1907
+ return /* @__PURE__ */ t.jsx("div", { className: l, children: e.length === 0 ? /* @__PURE__ */ t.jsx("div", { className: "fsc-ohm-document-list__empty", children: r }) : /* @__PURE__ */ t.jsx("div", { className: "fsc-ohm-document-list__items", children: e.map((c) => /* @__PURE__ */ t.jsxs("article", { className: "fsc-ohm-document-list__item", children: [
1908
+ /* @__PURE__ */ t.jsx(Pt, { document: c, onPreview: a }),
1909
+ /* @__PURE__ */ t.jsxs("div", { className: "fsc-ohm-document-list__info", children: [
1910
+ /* @__PURE__ */ t.jsx("div", { className: "fsc-ohm-document-list__name", title: c.name, children: c.name }),
1911
+ /* @__PURE__ */ t.jsxs("div", { className: "fsc-ohm-document-list__meta", children: [
1912
+ c.type ? /* @__PURE__ */ t.jsx("span", { children: c.type }) : null,
1913
+ c.size ? /* @__PURE__ */ t.jsx("span", { children: c.size }) : null,
1914
+ c.date ? /* @__PURE__ */ t.jsx("span", { children: c.date }) : null
1915
+ ] })
1916
+ ] }),
1917
+ /* @__PURE__ */ t.jsxs("div", { className: "fsc-ohm-document-list__actions", "aria-label": "Akcie dokumentu", children: [
1918
+ /* @__PURE__ */ t.jsx(
1919
+ "button",
1920
+ {
1921
+ type: "button",
1922
+ className: "fsc-ohm-document-list__action",
1923
+ "aria-label": `Stiahnuť ${c.name}`,
1924
+ disabled: !o,
1925
+ onClick: () => o?.(c),
1926
+ children: "Stiahnuť"
1927
+ }
1928
+ ),
1929
+ /* @__PURE__ */ t.jsx(
1930
+ "button",
1931
+ {
1932
+ type: "button",
1933
+ className: "fsc-ohm-document-list__action",
1934
+ "aria-label": `Zdieľať ${c.name}`,
1935
+ disabled: !i,
1936
+ onClick: () => i?.(c),
1937
+ children: "Zdieľať"
1938
+ }
1939
+ ),
1940
+ /* @__PURE__ */ t.jsx(
1941
+ "button",
1942
+ {
1943
+ type: "button",
1944
+ className: "fsc-ohm-document-list__action fsc-ohm-document-list__action--danger",
1945
+ "aria-label": `Odstrániť ${c.name}`,
1946
+ disabled: !s,
1947
+ onClick: () => s?.(c),
1948
+ children: "Odstrániť"
1949
+ }
1950
+ )
1951
+ ] })
1952
+ ] }, c.id)) }) });
1953
+ }
1954
+ function yr({
1955
+ title: e,
1956
+ description: r,
1957
+ children: n,
1958
+ variant: a = "default",
1959
+ collapsible: s = !1,
1960
+ defaultCollapsed: o = !1,
1961
+ collapsed: i,
1962
+ onCollapsedChange: l,
1963
+ className: c,
1964
+ ...d
1965
+ }) {
1966
+ const [m, f] = w(o), v = fe(), h = i !== void 0, x = h ? i : m, b = (p) => {
1967
+ h || f(p), l?.(p);
1968
+ };
1969
+ return /* @__PURE__ */ t.jsxs(
1970
+ "article",
1971
+ {
1972
+ ...d,
1973
+ className: ["fsc-ohm-entity-card", `fsc-ohm-entity-card--${a}`, c].filter(Boolean).join(" "),
1974
+ "data-state": x ? "collapsed" : "expanded",
1975
+ children: [
1976
+ /* @__PURE__ */ t.jsxs("header", { className: "fsc-ohm-entity-card__header", children: [
1977
+ /* @__PURE__ */ t.jsxs("div", { className: "fsc-ohm-entity-card__heading", children: [
1978
+ /* @__PURE__ */ t.jsx("h2", { className: "fsc-ohm-entity-card__title", children: e }),
1979
+ r ? /* @__PURE__ */ t.jsx("p", { className: "fsc-ohm-entity-card__description", children: r }) : null
1980
+ ] }),
1981
+ s ? /* @__PURE__ */ t.jsx(
1982
+ "button",
1983
+ {
1984
+ type: "button",
1985
+ className: "fsc-ohm-entity-card__toggle",
1986
+ "aria-expanded": !x,
1987
+ "aria-controls": v,
1988
+ "aria-label": x ? "Rozbaliť sekciu" : "Zbaliť sekciu",
1989
+ onClick: () => b(!x),
1990
+ children: /* @__PURE__ */ t.jsx("span", { className: `fsc-ohm-entity-card__chevron ${x ? "fsc-ohm-entity-card__chevron--down" : "fsc-ohm-entity-card__chevron--up"}`, "aria-hidden": "true" })
1991
+ }
1992
+ ) : null
1993
+ ] }),
1994
+ /* @__PURE__ */ t.jsx("div", { id: v, className: "fsc-ohm-entity-card__content", hidden: x, children: n })
1995
+ ]
1996
+ }
1997
+ );
1998
+ }
1999
+ function _r({ children: e, className: r }) {
2000
+ return /* @__PURE__ */ t.jsx("main", { className: r ? `fsc-ohm-main ${r}` : "fsc-ohm-main", children: e });
2001
+ }
2002
+ const Te = ae(null), ue = ae(!1);
2003
+ function se() {
2004
+ const e = H(Te);
2005
+ if (!e) throw new Error("Navbar child components must be inside Navbar.");
2006
+ return e;
2007
+ }
2008
+ function Ot(e, r) {
2009
+ const n = e.mobile ?? 768, a = e.desktop ?? 1024;
2010
+ if (n >= a) throw new Error("Navbar responsive.mobile must be smaller than responsive.desktop.");
2011
+ const [s, o] = w(a);
2012
+ return P(() => {
2013
+ const i = r.current;
2014
+ if (!i) return;
2015
+ const l = () => {
2016
+ const c = Number.parseFloat(
2017
+ getComputedStyle(i).getPropertyValue("--fsc-preview-viewport-width")
2018
+ ), d = Number.isFinite(c) && c > 0 ? c : i.getBoundingClientRect().width || i.clientWidth;
2019
+ d > 0 && o(d);
2020
+ };
2021
+ if (l(), typeof ResizeObserver < "u") {
2022
+ const c = new ResizeObserver(l);
2023
+ return c.observe(i), () => c.disconnect();
2024
+ }
2025
+ return window.addEventListener("resize", l), () => window.removeEventListener("resize", l);
2026
+ }, [r]), { mobile: s < n, collapsedMode: s >= n && s < a };
2027
+ }
2028
+ function Sr({ children: e, responsive: r, width: n, sections: a, profile: s, brand: o }) {
2029
+ const i = A(null), l = Ot(r ?? {}, i), [c, d] = w(!1), [m, f] = w(!1), v = A(null);
2030
+ P(() => {
2031
+ try {
2032
+ const p = localStorage.getItem("fsc-navbar-collapsed");
2033
+ p && d(p === "true");
2034
+ } catch {
2035
+ }
2036
+ }, []), P(() => {
2037
+ if (!l.mobile) try {
2038
+ localStorage.setItem("fsc-navbar-collapsed", String(c));
2039
+ } catch {
2040
+ }
2041
+ }, [c, l.mobile]), P(() => {
2042
+ l.mobile && f(!1);
2043
+ }, [l.mobile]), P(() => {
2044
+ document.documentElement.style.setProperty("--fsc-navbar-current-width", l.mobile ? "0px" : l.collapsedMode || c ? n?.collapsed ?? "64px" : n?.expanded ?? "280px");
2045
+ }, [l.mobile, l.collapsedMode, c, n?.collapsed, n?.expanded]);
2046
+ const h = () => f(!1), x = I(() => ({ mobile: l.mobile, collapsed: l.collapsedMode || c, open: m, setOpen: f, setCollapsed: d, toggleRef: v, closeMobile: h }), [l.mobile, l.collapsedMode, c, m]), b = a ? /* @__PURE__ */ t.jsxs(t.Fragment, { children: [
2047
+ /* @__PURE__ */ t.jsxs(At, { children: [
2048
+ o ? /* @__PURE__ */ t.jsxs(zt, { href: o.href, children: [
2049
+ /* @__PURE__ */ t.jsx($t, { children: o.logo }),
2050
+ /* @__PURE__ */ t.jsx(Lt, { children: o.name })
2051
+ ] }) : null,
2052
+ /* @__PURE__ */ t.jsx(It, {})
2053
+ ] }),
2054
+ /* @__PURE__ */ t.jsx(Ft, { children: a.map((p, j) => /* @__PURE__ */ t.jsx(Mt, { ...p, children: p.items.map((C, T) => /* @__PURE__ */ t.jsx(Bt, { ...C }, T)) }, j)) }),
2055
+ s ? /* @__PURE__ */ t.jsx(Vt, { children: /* @__PURE__ */ t.jsx(Ut, { ...s }) }) : null
2056
+ ] }) : e;
2057
+ return /* @__PURE__ */ t.jsx(Te.Provider, { value: x, children: /* @__PURE__ */ t.jsxs("div", { ref: i, className: "fsc-ohm-navbar__anchor", children: [
2058
+ /* @__PURE__ */ t.jsx("aside", { className: "fsc-ohm-navbar", "data-mobile": l.mobile || void 0, "data-open": m || void 0, "data-collapsed": !l.mobile && x.collapsed || void 0, style: { "--fsc-navbar-mobile-width": n?.mobile ?? "100%", "--fsc-navbar-collapsed-width": n?.collapsed ?? "64px", "--fsc-navbar-expanded-width": n?.expanded ?? "280px" }, children: b }),
2059
+ l.mobile && m ? /* @__PURE__ */ t.jsx("button", { className: "fsc-ohm-navbar__backdrop", "aria-label": "Close navigation", onClick: h }) : null
2060
+ ] }) });
2061
+ }
2062
+ function At({ children: e }) {
2063
+ return /* @__PURE__ */ t.jsx("header", { className: "fsc-ohm-navbar__header", children: e });
2064
+ }
2065
+ function zt({ children: e, href: r }) {
2066
+ return /* @__PURE__ */ t.jsx("a", { className: "fsc-ohm-navbar__brand", href: r, children: e });
2067
+ }
2068
+ function $t({ children: e }) {
2069
+ return /* @__PURE__ */ t.jsx("span", { className: "fsc-ohm-navbar__brand-logo", "aria-hidden": "true", children: e });
2070
+ }
2071
+ function Lt({ children: e }) {
2072
+ return /* @__PURE__ */ t.jsx("span", { className: "fsc-ohm-navbar__brand-name", children: e });
2073
+ }
2074
+ function It({ expandedIcon: e = "‹", collapsedIcon: r = "›", mobileOpenIcon: n = "×", mobileClosedIcon: a = "☰" }) {
2075
+ const { mobile: s, collapsed: o, open: i, setOpen: l, setCollapsed: c, toggleRef: d } = se();
2076
+ return P(() => {
2077
+ if (!s || !i) return;
2078
+ const m = d.current?.closest(".fsc-ohm-navbar"), f = () => Array.from(m?.querySelectorAll('a[href],button:not([disabled]),[tabindex]:not([tabindex="-1"])') ?? []), v = (h) => {
2079
+ if (h.key === "Escape") {
2080
+ h.preventDefault(), l(!1), d.current?.focus();
2081
+ return;
2082
+ }
2083
+ if (h.key !== "Tab") return;
2084
+ const x = f();
2085
+ if (!x.length) return;
2086
+ const b = x[0], p = x[x.length - 1];
2087
+ !b || !p || (h.shiftKey && document.activeElement === b ? (h.preventDefault(), p.focus()) : !h.shiftKey && document.activeElement === p && (h.preventDefault(), b.focus()));
2088
+ };
2089
+ return document.addEventListener("keydown", v), requestAnimationFrame(() => f()[0]?.focus()), () => document.removeEventListener("keydown", v);
2090
+ }, [s, i, l, d]), /* @__PURE__ */ t.jsx("button", { ref: d, className: "fsc-ohm-navbar__toggle", type: "button", "aria-label": s ? i ? "Close navigation" : "Open navigation" : o ? "Expand navigation" : "Collapse navigation", "aria-expanded": s ? i : !o, onClick: () => s ? l(!i) : c(!o), children: s ? i ? n : a : o ? r : e });
2091
+ }
2092
+ function Ft({ children: e }) {
2093
+ const { mobile: r, open: n } = se();
2094
+ return /* @__PURE__ */ t.jsx("nav", { className: "fsc-ohm-navbar__main", "aria-label": "Primary navigation", "data-mobile-open": r && n || void 0, children: e });
2095
+ }
2096
+ function Mt({ name: e, icon: r, disabled: n = !1, hidden: a = !1, children: s }) {
2097
+ const o = H(ue);
2098
+ return a ? null : /* @__PURE__ */ t.jsxs("section", { className: "fsc-ohm-navbar__section", "data-disabled": n || void 0, children: [
2099
+ /* @__PURE__ */ t.jsx(Dt, { name: e, icon: r }),
2100
+ /* @__PURE__ */ t.jsx("div", { className: "fsc-ohm-navbar__section-items", children: /* @__PURE__ */ t.jsx(ue.Provider, { value: o || n, children: s }) })
2101
+ ] });
2102
+ }
2103
+ function Dt({ name: e, icon: r }) {
2104
+ return /* @__PURE__ */ t.jsxs("div", { className: "fsc-ohm-navbar__section-name", children: [
2105
+ /* @__PURE__ */ t.jsx("span", { "aria-hidden": "true", children: r }),
2106
+ /* @__PURE__ */ t.jsx("span", { children: e })
2107
+ ] });
2108
+ }
2109
+ function ye(e) {
2110
+ if (typeof window > "u") return !1;
2111
+ const r = window.location.pathname, n = e.split(/[?#]/), a = e === "/" ? "/" : (n[0] ?? "").replace(/\/$/, "") || "/";
2112
+ return a === "/" ? r === "/" : r === a || r.startsWith(a + "/");
2113
+ }
2114
+ function Bt({ name: e, href: r, icon: n, disabled: a = !1, hidden: s = !1, tooltip: o, ariaLabel: i }) {
2115
+ const { collapsed: l, closeMobile: c } = se(), d = H(ue), m = a || d, [f, v] = w(() => ye(r));
2116
+ if (P(() => {
2117
+ const x = () => v(ye(r));
2118
+ return addEventListener("popstate", x), addEventListener("hashchange", x), x(), () => {
2119
+ removeEventListener("popstate", x), removeEventListener("hashchange", x);
2120
+ };
2121
+ }, [r]), s) return null;
2122
+ const h = o ?? e;
2123
+ return /* @__PURE__ */ t.jsxs("a", { className: "fsc-ohm-navbar__item", href: m ? void 0 : r, "aria-label": i, "aria-current": f ? "page" : void 0, "aria-disabled": m || void 0, "data-active": f || void 0, "data-disabled": m || void 0, title: l && typeof h == "string" ? h : void 0, onClick: (x) => {
2124
+ m ? x.preventDefault() : c();
2125
+ }, children: [
2126
+ /* @__PURE__ */ t.jsx("span", { className: "fsc-ohm-navbar__item-icon", "aria-hidden": "true", children: n }),
2127
+ /* @__PURE__ */ t.jsx("span", { className: "fsc-ohm-navbar__item-name", children: e })
2128
+ ] });
2129
+ }
2130
+ function wr({ children: e }) {
2131
+ return /* @__PURE__ */ t.jsx("span", { "aria-hidden": "true", children: e });
2132
+ }
2133
+ function Nr({ children: e }) {
2134
+ return /* @__PURE__ */ t.jsx("span", { children: e });
2135
+ }
2136
+ function Vt({ children: e }) {
2137
+ return /* @__PURE__ */ t.jsx("footer", { className: "fsc-ohm-navbar__footer", children: e });
2138
+ }
2139
+ function _e({ src: e, fallback: r }) {
2140
+ const [n, a] = w(!1);
2141
+ return !e || n ? /* @__PURE__ */ t.jsx("span", { className: "fsc-ohm-navbar__profile-picture", children: r ?? "U" }) : /* @__PURE__ */ t.jsx("img", { className: "fsc-ohm-navbar__profile-picture", src: e, alt: "", onError: () => a(!0) });
2142
+ }
2143
+ function Ut({ picture: e, name: r, profileHref: n, settingsHref: a, onLogout: s, settingsIcon: o = "⚙", logoutIcon: i = "↪" }) {
2144
+ const { collapsed: l } = se(), [c, d] = w(!1), m = A(null);
2145
+ return P(() => {
2146
+ if (!c) return;
2147
+ const f = (h) => {
2148
+ (!(h.target instanceof Node) || !m.current?.parentElement?.contains(h.target)) && d(!1);
2149
+ }, v = (h) => {
2150
+ h.key === "Escape" && (d(!1), m.current?.focus());
2151
+ };
2152
+ return document.addEventListener("mousedown", f), document.addEventListener("keydown", v), () => {
2153
+ document.removeEventListener("mousedown", f), document.removeEventListener("keydown", v);
2154
+ };
2155
+ }, [c]), l ? /* @__PURE__ */ t.jsxs("div", { className: "fsc-ohm-navbar__profile fsc-ohm-navbar__profile--collapsed", children: [
2156
+ /* @__PURE__ */ t.jsx("button", { ref: m, type: "button", "aria-label": typeof r == "string" ? r : "Profile", "aria-expanded": c, onClick: () => d(!c), children: /* @__PURE__ */ t.jsx(_e, { ...e }) }),
2157
+ c ? /* @__PURE__ */ t.jsxs("div", { className: "fsc-ohm-navbar__profile-popup", role: "menu", children: [
2158
+ /* @__PURE__ */ t.jsx("a", { role: "menuitem", href: n, children: "Profile" }),
2159
+ /* @__PURE__ */ t.jsx("a", { role: "menuitem", href: a, children: "Settings" }),
2160
+ /* @__PURE__ */ t.jsx("button", { role: "menuitem", type: "button", onClick: () => {
2161
+ d(!1), s();
2162
+ }, children: "Logout" })
2163
+ ] }) : null
2164
+ ] }) : /* @__PURE__ */ t.jsxs("div", { className: "fsc-ohm-navbar__profile", children: [
2165
+ /* @__PURE__ */ t.jsxs("a", { href: n, children: [
2166
+ /* @__PURE__ */ t.jsx(_e, { ...e }),
2167
+ /* @__PURE__ */ t.jsx("span", { children: r })
2168
+ ] }),
2169
+ /* @__PURE__ */ t.jsx("a", { href: a, "aria-label": "Settings", title: "Settings", children: o }),
2170
+ /* @__PURE__ */ t.jsx("button", { type: "button", onClick: s, "aria-label": "Logout", title: "Logout", children: i })
2171
+ ] });
2172
+ }
2173
+ function kr({
2174
+ title: e,
2175
+ description: r,
2176
+ breadcrumb: n,
2177
+ backAction: a,
2178
+ actions: s,
2179
+ className: o
2180
+ }) {
2181
+ const i = ["fsc-ohm-page-header", o].filter(Boolean).join(" ");
2182
+ return /* @__PURE__ */ t.jsxs("header", { className: i, children: [
2183
+ (n || a) && /* @__PURE__ */ t.jsxs("div", { className: "fsc-ohm-page-header__navigation", children: [
2184
+ a,
2185
+ n && /* @__PURE__ */ t.jsx("div", { className: "fsc-ohm-page-header__breadcrumb", children: n })
2186
+ ] }),
2187
+ /* @__PURE__ */ t.jsxs("div", { className: "fsc-ohm-page-header__main", children: [
2188
+ /* @__PURE__ */ t.jsxs("div", { className: "fsc-ohm-page-header__content", children: [
2189
+ /* @__PURE__ */ t.jsx("h1", { className: "fsc-ohm-page-header__title", children: e }),
2190
+ r && /* @__PURE__ */ t.jsx("div", { className: "fsc-ohm-page-header__description", children: r })
2191
+ ] }),
2192
+ s && /* @__PURE__ */ t.jsx("div", { className: "fsc-ohm-page-header__actions", children: s })
2193
+ ] })
2194
+ ] });
2195
+ }
2196
+ function Er({ photos: e = [], columns: r = 4, emptyState: n = "Žiadne fotografie", className: a, onOpen: s, onShare: o, onDelete: i }) {
2197
+ const l = ["fsc-ohm-photo-grid", a].filter(Boolean).join(" "), c = { "--fsc-ohm-photo-grid-columns": Math.max(1, r) };
2198
+ return /* @__PURE__ */ t.jsx("div", { className: l, style: c, children: e.length === 0 ? /* @__PURE__ */ t.jsx("div", { className: "fsc-ohm-photo-grid__empty", children: n }) : /* @__PURE__ */ t.jsx("div", { className: "fsc-ohm-photo-grid__items", children: e.map((d) => /* @__PURE__ */ t.jsxs("article", { className: "fsc-ohm-photo-grid__item", children: [
2199
+ /* @__PURE__ */ t.jsxs("div", { className: "fsc-ohm-photo-grid__media", children: [
2200
+ /* @__PURE__ */ t.jsx("button", { type: "button", className: "fsc-ohm-photo-grid__preview", "aria-label": "Otvoriť fotografiu " + (d.alt ?? ""), onClick: () => s?.(d), children: /* @__PURE__ */ t.jsx("img", { src: d.src, alt: d.alt ?? "" }) }),
2201
+ o || i ? /* @__PURE__ */ t.jsxs("div", { className: "fsc-ohm-photo-grid__overlay", children: [
2202
+ /* @__PURE__ */ t.jsx("div", { className: "fsc-ohm-photo-grid__overlay-left", children: o ? /* @__PURE__ */ t.jsx("button", { type: "button", className: "fsc-ohm-photo-grid__overlay-action", "aria-label": "Zdieľať fotografiu " + (d.alt ?? ""), onClick: () => o(d), children: "Zdieľať" }) : null }),
2203
+ /* @__PURE__ */ t.jsx("div", { className: "fsc-ohm-photo-grid__overlay-right", children: i ? /* @__PURE__ */ t.jsx("button", { type: "button", className: "fsc-ohm-photo-grid__overlay-action", "aria-label": "Odstrániť fotografiu " + (d.alt ?? ""), onClick: () => i(d), children: "Odstrániť" }) : null })
2204
+ ] }) : null
2205
+ ] }),
2206
+ d.title ? /* @__PURE__ */ t.jsx("div", { className: "fsc-ohm-photo-grid__footer", children: /* @__PURE__ */ t.jsx("div", { className: "fsc-ohm-photo-grid__title", title: String(d.title), children: d.title }) }) : null
2207
+ ] }, d.id)) }) });
2208
+ }
2209
+ function Cr({
2210
+ search: e,
2211
+ filters: r,
2212
+ actions: n,
2213
+ className: a,
2214
+ "aria-label": s = "Vyhľadávanie a filtre",
2215
+ ...o
2216
+ }) {
2217
+ const i = ["ohm-search-filter-section", a].filter(Boolean).join(" ");
2218
+ return /* @__PURE__ */ t.jsxs(
2219
+ "section",
2220
+ {
2221
+ ...o,
2222
+ className: i,
2223
+ "aria-label": s,
2224
+ "data-has-filters": r ? "true" : "false",
2225
+ "data-has-actions": n ? "true" : "false",
2226
+ children: [
2227
+ /* @__PURE__ */ t.jsxs("div", { className: "ohm-search-filter-section__controls", children: [
2228
+ /* @__PURE__ */ t.jsx("div", { className: "ohm-search-filter-section__search", children: e }),
2229
+ r ? /* @__PURE__ */ t.jsx("div", { className: "ohm-search-filter-section__filters", children: r }) : null
2230
+ ] }),
2231
+ n ? /* @__PURE__ */ t.jsx("div", { className: "ohm-search-filter-section__actions", children: n }) : null
2232
+ ]
2233
+ }
2234
+ );
2235
+ }
2236
+ function Tr({ children: e, className: r }) {
2237
+ return /* @__PURE__ */ t.jsx("div", { className: ["fsc-ohm-table__structure", r].filter(Boolean).join(" "), children: e });
2238
+ }
2239
+ function Rr({ children: e, className: r }) {
2240
+ return /* @__PURE__ */ t.jsx("div", { className: ["fsc-ohm-table__standalone-caption", r].filter(Boolean).join(" "), children: e });
2241
+ }
2242
+ function Pr({ children: e, className: r }) {
2243
+ return /* @__PURE__ */ t.jsx("tfoot", { className: r, children: e });
2244
+ }
2245
+ function Or({ expanded: e = !1, onChange: r, disabled: n = !1, label: a = "Rozbaliť riadok" }) {
2246
+ return /* @__PURE__ */ t.jsx("button", { type: "button", className: "fsc-ohm-table__icon-button", disabled: n, "aria-expanded": e, "aria-label": a, onClick: () => r?.(!e), children: e ? "−" : "+" });
2247
+ }
2248
+ function Ar({
2249
+ trigger: e,
2250
+ children: r,
2251
+ open: n,
2252
+ defaultOpen: a = !1,
2253
+ onOpenChange: s,
2254
+ ariaLabel: o = "Filters"
2255
+ }) {
2256
+ const [i, l] = w(a), c = A(null), d = n !== void 0, m = d ? n : i, f = (v) => {
2257
+ d || l(v), s?.(v);
2258
+ };
2259
+ return P(() => {
2260
+ if (!m) return;
2261
+ const v = (x) => {
2262
+ c.current?.contains(x.target) || f(!1);
2263
+ }, h = (x) => {
2264
+ x.key === "Escape" && f(!1);
2265
+ };
2266
+ return document.addEventListener("pointerdown", v), document.addEventListener("keydown", h), () => {
2267
+ document.removeEventListener("pointerdown", v), document.removeEventListener("keydown", h);
2268
+ };
2269
+ }, [m]), /* @__PURE__ */ t.jsxs("div", { ref: c, className: "fsc-filter-menu", children: [
2270
+ /* @__PURE__ */ t.jsx(
2271
+ "button",
2272
+ {
2273
+ type: "button",
2274
+ className: "fsc-filter-menu__trigger",
2275
+ "aria-haspopup": "dialog",
2276
+ "aria-expanded": m,
2277
+ onClick: () => f(!m),
2278
+ children: e
2279
+ }
2280
+ ),
2281
+ m ? /* @__PURE__ */ t.jsx("div", { className: "fsc-filter-menu__popup", role: "dialog", "aria-label": o, children: r }) : null
2282
+ ] });
2283
+ }
2284
+ function zr({ items: e }) {
2285
+ return /* @__PURE__ */ t.jsx("div", { children: e.map((r) => /* @__PURE__ */ t.jsxs("details", { children: [
2286
+ /* @__PURE__ */ t.jsx("summary", { children: r.title }),
2287
+ /* @__PURE__ */ t.jsx("div", { children: r.content })
1406
2288
  ] }, r.id)) });
1407
2289
  }
1408
- function $t({ children: e, variant: r = "info", ...t }) {
1409
- return /* @__PURE__ */ a.jsx("div", { ...t, role: "alert", "data-variant": r, children: e });
2290
+ function $r({ children: e, variant: r = "info", ...n }) {
2291
+ return /* @__PURE__ */ t.jsx("div", { ...n, role: "alert", "data-variant": r, children: e });
1410
2292
  }
1411
- function Nt({ src: e, alt: r = "", fallback: t, ...n }) {
1412
- return e ? /* @__PURE__ */ a.jsx("img", { ...n, src: e, alt: r }) : /* @__PURE__ */ a.jsx("span", { ...n, role: "img", "aria-label": r, children: t });
2293
+ function Lr({ src: e, alt: r = "", fallback: n, ...a }) {
2294
+ return e ? /* @__PURE__ */ t.jsx("img", { ...a, src: e, alt: r }) : /* @__PURE__ */ t.jsx("span", { ...a, role: "img", "aria-label": r, children: n });
1413
2295
  }
1414
- function zt({
2296
+ function Ir({
1415
2297
  children: e,
1416
2298
  variant: r = "neutral",
1417
- size: t = "medium",
1418
- ...n
2299
+ size: n = "medium",
2300
+ ...a
1419
2301
  }) {
1420
- return /* @__PURE__ */ a.jsx(
2302
+ return /* @__PURE__ */ t.jsx(
1421
2303
  "span",
1422
2304
  {
1423
- ...n,
2305
+ ...a,
1424
2306
  "data-variant": r,
1425
- "data-size": t,
2307
+ "data-size": n,
1426
2308
  children: e
1427
2309
  }
1428
2310
  );
1429
2311
  }
1430
- function It({
2312
+ function Fr({
1431
2313
  children: e,
1432
2314
  variant: r = "primary",
1433
- size: t = "medium",
1434
- loading: n = !1,
2315
+ size: n = "medium",
2316
+ loading: a = !1,
1435
2317
  disabled: s = !1,
1436
2318
  type: o = "button",
1437
2319
  className: i,
1438
- ...c
2320
+ ...l
1439
2321
  }) {
1440
- const u = s || n;
1441
- return /* @__PURE__ */ a.jsx(
2322
+ const c = s || a;
2323
+ return /* @__PURE__ */ t.jsx(
1442
2324
  "button",
1443
2325
  {
1444
- ...c,
2326
+ ...l,
1445
2327
  className: i ? `fsc-button ${i}` : "fsc-button",
1446
2328
  type: o,
1447
2329
  "data-variant": r,
1448
- "data-size": t,
1449
- "data-loading": n || void 0,
1450
- "aria-busy": n || void 0,
1451
- "aria-disabled": u || void 0,
1452
- disabled: u,
2330
+ "data-size": n,
2331
+ "data-loading": a || void 0,
2332
+ "aria-busy": a || void 0,
2333
+ "aria-disabled": c || void 0,
2334
+ disabled: c,
1453
2335
  children: e
1454
2336
  }
1455
2337
  );
1456
2338
  }
1457
- function Ft({
2339
+ function Mr({
1458
2340
  children: e,
1459
2341
  padding: r = "medium",
1460
- variant: t = "default",
1461
- ...n
2342
+ variant: n = "default",
2343
+ ...a
1462
2344
  }) {
1463
- return /* @__PURE__ */ a.jsx(
2345
+ return /* @__PURE__ */ t.jsx(
1464
2346
  "div",
1465
2347
  {
1466
- ...n,
2348
+ ...a,
1467
2349
  "data-padding": r,
1468
- "data-variant": t,
2350
+ "data-variant": n,
1469
2351
  children: e
1470
2352
  }
1471
2353
  );
1472
2354
  }
1473
- function Mt({ items: e, initialIndex: r = 0, onIndexChange: t }) {
1474
- const [n, s] = T(r);
2355
+ function Dr({ items: e, initialIndex: r = 0, onIndexChange: n }) {
2356
+ const [a, s] = w(r);
1475
2357
  if (!e.length) return null;
1476
2358
  const o = (i) => {
1477
- const c = (i + e.length) % e.length;
1478
- s(c), t?.(c);
2359
+ const l = (i + e.length) % e.length;
2360
+ s(l), n?.(l);
1479
2361
  };
1480
- return /* @__PURE__ */ a.jsxs("section", { "aria-roledescription": "carousel", children: [
1481
- /* @__PURE__ */ a.jsx("div", { "aria-live": "polite", children: e[n] }),
1482
- /* @__PURE__ */ a.jsx("button", { type: "button", onClick: () => o(n - 1), children: "Previous" }),
1483
- /* @__PURE__ */ a.jsxs("span", { children: [
1484
- n + 1,
2362
+ return /* @__PURE__ */ t.jsxs("section", { "aria-roledescription": "carousel", children: [
2363
+ /* @__PURE__ */ t.jsx("div", { "aria-live": "polite", children: e[a] }),
2364
+ /* @__PURE__ */ t.jsx("button", { type: "button", onClick: () => o(a - 1), children: "Previous" }),
2365
+ /* @__PURE__ */ t.jsxs("span", { children: [
2366
+ a + 1,
1485
2367
  " / ",
1486
2368
  e.length
1487
2369
  ] }),
1488
- /* @__PURE__ */ a.jsx("button", { type: "button", onClick: () => o(n + 1), children: "Next" })
2370
+ /* @__PURE__ */ t.jsx("button", { type: "button", onClick: () => o(a + 1), children: "Next" })
1489
2371
  ] });
1490
2372
  }
1491
- function Lt({
2373
+ function Br({
1492
2374
  size: e = "medium",
1493
2375
  disabled: r = !1,
1494
- ...t
2376
+ ...n
1495
2377
  }) {
1496
- return /* @__PURE__ */ a.jsx(
2378
+ return /* @__PURE__ */ t.jsx(
1497
2379
  "input",
1498
2380
  {
1499
- ...t,
2381
+ ...n,
1500
2382
  type: "checkbox",
1501
2383
  "data-size": e,
1502
2384
  disabled: r
1503
2385
  }
1504
2386
  );
1505
2387
  }
1506
- function Dt({ options: e, value: r, defaultValue: t, placeholder: n = "Select...", onValueChange: s }) {
1507
- const [o, i] = T(""), [c, u] = T(t ?? ""), f = r ?? c, h = P(() => e.filter((d) => String(d.label).toLowerCase().includes(o.toLowerCase())), [e, o]);
1508
- return /* @__PURE__ */ a.jsxs("div", { children: [
1509
- /* @__PURE__ */ a.jsx("input", { role: "combobox", value: o, placeholder: f ? String(e.find((d) => d.value === f)?.label ?? f) : n, onChange: (d) => i(d.target.value), "aria-expanded": "true" }),
1510
- /* @__PURE__ */ a.jsx("ul", { role: "listbox", children: h.map((d) => /* @__PURE__ */ a.jsx("li", { children: /* @__PURE__ */ a.jsx("button", { type: "button", role: "option", "aria-selected": d.value === f, disabled: d.disabled, onClick: () => {
1511
- u(d.value), s?.(d.value), i("");
1512
- }, children: d.label }) }, d.value)) })
2388
+ function Vr({ options: e, value: r, defaultValue: n, placeholder: a = "Select...", onValueChange: s }) {
2389
+ const [o, i] = w(""), [l, c] = w(n ?? ""), d = r ?? l, m = I(() => e.filter((f) => String(f.label).toLowerCase().includes(o.toLowerCase())), [e, o]);
2390
+ return /* @__PURE__ */ t.jsxs("div", { children: [
2391
+ /* @__PURE__ */ t.jsx("input", { role: "combobox", value: o, placeholder: d ? String(e.find((f) => f.value === d)?.label ?? d) : a, onChange: (f) => i(f.target.value), "aria-expanded": "true" }),
2392
+ /* @__PURE__ */ t.jsx("ul", { role: "listbox", children: m.map((f) => /* @__PURE__ */ t.jsx("li", { children: /* @__PURE__ */ t.jsx("button", { type: "button", role: "option", "aria-selected": f.value === d, disabled: f.disabled, onClick: () => {
2393
+ c(f.value), s?.(f.value), i("");
2394
+ }, children: f.label }) }, f.value)) })
1513
2395
  ] });
1514
2396
  }
1515
- function Vt({ items: e, open: r = !0, placeholder: t = "Search commands" }) {
1516
- const [n, s] = T(""), o = P(() => e.filter((i) => (String(i.label) + " " + (i.keywords ?? []).join(" ")).toLowerCase().includes(n.toLowerCase())), [e, n]);
1517
- return r ? /* @__PURE__ */ a.jsxs("div", { role: "dialog", "aria-label": "Command palette", children: [
1518
- /* @__PURE__ */ a.jsx("input", { autoFocus: !0, value: n, placeholder: t, onChange: (i) => s(i.target.value) }),
1519
- /* @__PURE__ */ a.jsx("div", { role: "listbox", children: o.map((i) => /* @__PURE__ */ a.jsx("button", { type: "button", role: "option", disabled: i.disabled, onClick: i.onSelect, children: i.label }, i.id)) })
2397
+ function Ur({ items: e, open: r = !0, placeholder: n = "Search commands" }) {
2398
+ const [a, s] = w(""), o = I(() => e.filter((i) => (String(i.label) + " " + (i.keywords ?? []).join(" ")).toLowerCase().includes(a.toLowerCase())), [e, a]);
2399
+ return r ? /* @__PURE__ */ t.jsxs("div", { role: "dialog", "aria-label": "Command palette", children: [
2400
+ /* @__PURE__ */ t.jsx("input", { autoFocus: !0, value: a, placeholder: n, onChange: (i) => s(i.target.value) }),
2401
+ /* @__PURE__ */ t.jsx("div", { role: "listbox", children: o.map((i) => /* @__PURE__ */ t.jsx("button", { type: "button", role: "option", disabled: i.disabled, onClick: i.onSelect, children: i.label }, i.id)) })
1520
2402
  ] }) : null;
1521
2403
  }
1522
- function Ut({ children: e, items: r }) {
1523
- const [t, n] = T(!1);
1524
- return /* @__PURE__ */ a.jsxs("div", { onContextMenu: (s) => {
1525
- s.preventDefault(), n(!0);
1526
- }, onBlur: () => n(!1), tabIndex: 0, children: [
2404
+ function Wr({ children: e, items: r }) {
2405
+ const [n, a] = w(!1);
2406
+ return /* @__PURE__ */ t.jsxs("div", { onContextMenu: (s) => {
2407
+ s.preventDefault(), a(!0);
2408
+ }, onBlur: () => a(!1), tabIndex: 0, children: [
1527
2409
  e,
1528
- t && /* @__PURE__ */ a.jsx("div", { role: "menu", children: r.map((s, o) => /* @__PURE__ */ a.jsx("button", { type: "button", role: "menuitem", disabled: s.disabled, onClick: () => {
1529
- s.onSelect?.(), n(!1);
2410
+ n && /* @__PURE__ */ t.jsx("div", { role: "menu", children: r.map((s, o) => /* @__PURE__ */ t.jsx("button", { type: "button", role: "menuitem", disabled: s.disabled, onClick: () => {
2411
+ s.onSelect?.(), a(!1);
1530
2412
  }, children: s.label }, o)) })
1531
2413
  ] });
1532
2414
  }
1533
- function Yt({ value: e, defaultValue: r, min: t, max: n, onValueChange: s }) {
1534
- const [o, i] = T(r ?? ""), c = e ?? o;
1535
- return /* @__PURE__ */ a.jsx("input", { type: "date", value: c, min: t, max: n, onChange: (u) => {
1536
- i(u.target.value), s?.(u.target.value);
2415
+ function Yr({ value: e, defaultValue: r, min: n, max: a, onValueChange: s }) {
2416
+ const [o, i] = w(r ?? ""), l = e ?? o;
2417
+ return /* @__PURE__ */ t.jsx("input", { type: "date", value: l, min: n, max: a, onChange: (c) => {
2418
+ i(c.target.value), s?.(c.target.value);
1537
2419
  } });
1538
2420
  }
1539
- function Bt({ open: e, children: r, title: t, onClose: n, side: s = "right" }) {
1540
- return e ? /* @__PURE__ */ a.jsxs("aside", { "data-side": s, children: [
1541
- t && /* @__PURE__ */ a.jsx("h2", { children: t }),
1542
- /* @__PURE__ */ a.jsx("button", { type: "button", onClick: n, children: "Close" }),
2421
+ function Zr({ open: e, children: r, title: n, onClose: a, side: s = "right" }) {
2422
+ return e ? /* @__PURE__ */ t.jsxs("aside", { "data-side": s, "aria-label": typeof n == "string" ? n : void 0, children: [
2423
+ n && /* @__PURE__ */ t.jsx("h2", { children: n }),
2424
+ /* @__PURE__ */ t.jsx("button", { type: "button", onClick: a, children: "Close" }),
1543
2425
  r
1544
2426
  ] }) : null;
1545
2427
  }
1546
- function Wt({ label: e, items: r }) {
1547
- return /* @__PURE__ */ a.jsxs("details", { children: [
1548
- /* @__PURE__ */ a.jsx("summary", { children: e }),
1549
- /* @__PURE__ */ a.jsx("div", { role: "menu", children: r.map((t, n) => /* @__PURE__ */ a.jsx("button", { type: "button", role: "menuitem", disabled: t.disabled, onClick: t.onSelect, children: t.label }, n)) })
2428
+ function Qr({ label: e, items: r }) {
2429
+ return /* @__PURE__ */ t.jsxs("details", { children: [
2430
+ /* @__PURE__ */ t.jsx("summary", { children: e }),
2431
+ /* @__PURE__ */ t.jsx("div", { role: "menu", children: r.map((n, a) => /* @__PURE__ */ t.jsx("button", { type: "button", role: "menuitem", disabled: n.disabled, onClick: n.onSelect, children: n.label }, a)) })
1550
2432
  ] });
1551
2433
  }
1552
- function Jt({
2434
+ function Jr({
1553
2435
  title: e,
1554
2436
  description: r,
1555
- action: t,
1556
- ...n
2437
+ action: n,
2438
+ ...a
1557
2439
  }) {
1558
- return /* @__PURE__ */ a.jsxs("div", { ...n, role: "status", "aria-live": "polite", children: [
1559
- /* @__PURE__ */ a.jsx("h2", { children: e }),
1560
- r ? /* @__PURE__ */ a.jsx("p", { children: r }) : null,
1561
- t ? /* @__PURE__ */ a.jsx("div", { children: t }) : null
2440
+ return /* @__PURE__ */ t.jsxs("div", { ...a, role: "status", "aria-live": "polite", children: [
2441
+ /* @__PURE__ */ t.jsx("h2", { children: e }),
2442
+ r ? /* @__PURE__ */ t.jsx("p", { children: r }) : null,
2443
+ n ? /* @__PURE__ */ t.jsx("div", { children: n }) : null
1562
2444
  ] });
1563
2445
  }
1564
- function Qt({
2446
+ function Gr({
1565
2447
  title: e = "Something went wrong",
1566
2448
  description: r,
1567
- action: t,
1568
- ...n
2449
+ action: n,
2450
+ ...a
1569
2451
  }) {
1570
- return /* @__PURE__ */ a.jsxs("div", { ...n, role: "alert", "aria-live": "assertive", children: [
1571
- /* @__PURE__ */ a.jsx("h2", { children: e }),
1572
- r ? /* @__PURE__ */ a.jsx("p", { children: r }) : null,
1573
- t ? /* @__PURE__ */ a.jsx("div", { children: t }) : null
2452
+ return /* @__PURE__ */ t.jsxs("div", { ...a, role: "alert", "aria-live": "assertive", children: [
2453
+ /* @__PURE__ */ t.jsx("h2", { children: e }),
2454
+ r ? /* @__PURE__ */ t.jsx("p", { children: r }) : null,
2455
+ n ? /* @__PURE__ */ t.jsx("div", { children: n }) : null
1574
2456
  ] });
1575
2457
  }
1576
- function Gt({ accept: e, multiple: r, children: t = "Choose files", onFilesChange: n }) {
1577
- const s = (o) => n?.(Array.from(o.target.files ?? []));
1578
- return /* @__PURE__ */ a.jsxs("label", { children: [
1579
- t,
1580
- /* @__PURE__ */ a.jsx("input", { type: "file", hidden: !0, accept: e, multiple: r, onChange: s })
2458
+ function Hr({ accept: e, multiple: r, children: n = "Choose files", onFilesChange: a }) {
2459
+ const s = (o) => a?.(Array.from(o.target.files ?? []));
2460
+ return /* @__PURE__ */ t.jsxs("label", { children: [
2461
+ n,
2462
+ /* @__PURE__ */ t.jsx("input", { type: "file", hidden: !0, accept: e, multiple: r, onChange: s })
1581
2463
  ] });
1582
2464
  }
1583
- function qt({
2465
+ function qr({
1584
2466
  label: e,
1585
2467
  description: r,
1586
- error: t,
1587
- size: n = "medium",
2468
+ error: n,
2469
+ size: a = "medium",
1588
2470
  id: s,
1589
2471
  required: o = !1,
1590
2472
  className: i,
1591
- ...c
2473
+ ...l
1592
2474
  }) {
1593
- const u = ae(), f = s ?? u, h = r ? `${f}-description` : void 0, d = t ? `${f}-error` : void 0, b = [c["aria-describedby"], h, d].filter(Boolean).join(" ") || void 0, j = c["aria-invalid"];
1594
- return /* @__PURE__ */ a.jsxs(
2475
+ const c = fe(), d = s ?? c, m = r ? `${d}-description` : void 0, f = n ? `${d}-error` : void 0, h = [l["aria-describedby"], m, f].filter(Boolean).join(" ") || void 0, x = l["aria-invalid"];
2476
+ return /* @__PURE__ */ t.jsxs(
1595
2477
  "div",
1596
2478
  {
1597
2479
  className: i ? `fsc-form-field ${i}` : "fsc-form-field",
1598
- "data-size": n,
1599
- "data-invalid": t ? "true" : void 0,
2480
+ "data-size": a,
2481
+ "data-invalid": n ? "true" : void 0,
1600
2482
  children: [
1601
- /* @__PURE__ */ a.jsxs("label", { htmlFor: f, children: [
2483
+ /* @__PURE__ */ t.jsxs("label", { htmlFor: d, children: [
1602
2484
  e,
1603
- o ? /* @__PURE__ */ a.jsx("span", { "aria-hidden": "true", children: " *" }) : null
2485
+ o ? /* @__PURE__ */ t.jsx("span", { "aria-hidden": "true", children: " *" }) : null
1604
2486
  ] }),
1605
- /* @__PURE__ */ a.jsx(
2487
+ /* @__PURE__ */ t.jsx(
1606
2488
  "input",
1607
2489
  {
1608
- ...c,
1609
- id: f,
2490
+ ...l,
2491
+ id: d,
1610
2492
  required: o,
1611
- "aria-describedby": b,
1612
- "aria-invalid": t ? !0 : j
2493
+ "aria-describedby": h,
2494
+ "aria-invalid": n ? !0 : x
1613
2495
  }
1614
2496
  ),
1615
- r ? /* @__PURE__ */ a.jsx("div", { "data-role": "description", id: h, children: r }) : null,
1616
- t ? /* @__PURE__ */ a.jsx("div", { "data-role": "error", id: d, role: "alert", children: t }) : null
2497
+ r ? /* @__PURE__ */ t.jsx("div", { "data-role": "description", id: m, children: r }) : null,
2498
+ n ? /* @__PURE__ */ t.jsx("div", { "data-role": "error", id: f, role: "alert", children: n }) : null
1617
2499
  ]
1618
2500
  }
1619
2501
  );
1620
2502
  }
1621
- function Zt({ children: e, level: r = 2, ...t }) {
1622
- const n = { 1: "h1", 2: "h2", 3: "h3", 4: "h4", 5: "h5", 6: "h6" }[r];
1623
- return /* @__PURE__ */ a.jsx(n, { ...t, children: e });
2503
+ function Kr({ children: e, level: r = 2, ...n }) {
2504
+ const a = { 1: "h1", 2: "h2", 3: "h3", 4: "h4", 5: "h5", 6: "h6" }[r];
2505
+ return /* @__PURE__ */ t.jsx(a, { ...n, children: e });
1624
2506
  }
1625
- function Ht({
2507
+ function Xr({
1626
2508
  icon: e,
1627
2509
  label: r,
1628
- variant: t = "ghost",
1629
- size: n = "medium",
2510
+ variant: n = "ghost",
2511
+ size: a = "medium",
1630
2512
  loading: s = !1,
1631
2513
  disabled: o = !1,
1632
2514
  type: i = "button",
1633
- ...c
2515
+ ...l
1634
2516
  }) {
1635
- return /* @__PURE__ */ a.jsx(
2517
+ return /* @__PURE__ */ t.jsx(
1636
2518
  "button",
1637
2519
  {
1638
- ...c,
2520
+ ...l,
1639
2521
  type: i,
1640
2522
  "aria-label": r,
1641
2523
  "aria-busy": s || void 0,
1642
- "data-variant": t,
1643
- "data-size": n,
2524
+ "data-variant": n,
2525
+ "data-size": a,
1644
2526
  disabled: o || s,
1645
2527
  children: e
1646
2528
  }
1647
2529
  );
1648
2530
  }
1649
- function Xt({
2531
+ function en({
1650
2532
  size: e = "medium",
1651
2533
  disabled: r = !1,
1652
- className: t,
1653
- ...n
2534
+ className: n,
2535
+ ...a
1654
2536
  }) {
1655
- return /* @__PURE__ */ a.jsx(
2537
+ return /* @__PURE__ */ t.jsx(
1656
2538
  "input",
1657
2539
  {
1658
- ...n,
1659
- className: t ? `fsc-input ${t}` : "fsc-input",
2540
+ ...a,
2541
+ className: n ? `fsc-input ${n}` : "fsc-input",
1660
2542
  "data-size": e,
1661
2543
  disabled: r
1662
2544
  }
1663
2545
  );
1664
2546
  }
1665
- function Kt({
2547
+ function tn({
1666
2548
  children: e,
1667
2549
  required: r = !1,
1668
- "aria-label": t,
1669
- ...n
2550
+ "aria-label": n,
2551
+ ...a
1670
2552
  }) {
1671
- const s = t ?? (r && typeof e == "string" ? e : void 0);
1672
- return /* @__PURE__ */ a.jsxs("label", { ...n, "aria-label": s, children: [
2553
+ const s = n ?? (r && typeof e == "string" ? e : void 0);
2554
+ return /* @__PURE__ */ t.jsxs("label", { ...a, "aria-label": s, children: [
1673
2555
  e,
1674
- r ? /* @__PURE__ */ a.jsx("span", { "aria-hidden": "true", children: " *" }) : null
2556
+ r ? /* @__PURE__ */ t.jsx("span", { "aria-hidden": "true", children: " *" }) : null
1675
2557
  ] });
1676
2558
  }
1677
- function er({ children: e, ...r }) {
1678
- return /* @__PURE__ */ a.jsx("a", { ...r, children: e });
2559
+ function rn({ children: e, ...r }) {
2560
+ return /* @__PURE__ */ t.jsx("a", { ...r, children: e });
1679
2561
  }
1680
- function tr({ items: e }) {
1681
- return /* @__PURE__ */ a.jsx("nav", { "aria-label": "Menu", children: /* @__PURE__ */ a.jsx("ul", { role: "menubar", children: e.map((r, t) => /* @__PURE__ */ a.jsxs("li", { children: [
1682
- /* @__PURE__ */ a.jsx("button", { type: "button", role: "menuitem", children: r.label }),
1683
- r.items && /* @__PURE__ */ a.jsx("ul", { role: "menu", children: r.items.map((n, s) => /* @__PURE__ */ a.jsx("li", { children: n }, s)) })
1684
- ] }, t)) }) });
2562
+ function nn({ items: e }) {
2563
+ return /* @__PURE__ */ t.jsx("nav", { "aria-label": "Menu", children: /* @__PURE__ */ t.jsx("ul", { role: "menubar", children: e.map((r, n) => /* @__PURE__ */ t.jsxs("li", { children: [
2564
+ /* @__PURE__ */ t.jsx("button", { type: "button", role: "menuitem", children: r.label }),
2565
+ r.items && /* @__PURE__ */ t.jsx("ul", { role: "menu", children: r.items.map((a, s) => /* @__PURE__ */ t.jsx("li", { children: a }, s)) })
2566
+ ] }, n)) }) });
1685
2567
  }
1686
- const it = [
2568
+ const Wt = [
1687
2569
  "a[href]",
1688
2570
  "area[href]",
1689
2571
  "button:not([disabled])",
@@ -1693,163 +2575,163 @@ const it = [
1693
2575
  '[contenteditable="true"]',
1694
2576
  '[tabindex]:not([tabindex="-1"])'
1695
2577
  ].join(",");
1696
- function rr({
2578
+ function an({
1697
2579
  open: e,
1698
2580
  title: r,
1699
- children: t,
1700
- onClose: n,
2581
+ children: n,
2582
+ onClose: a,
1701
2583
  dismissible: s = !0,
1702
2584
  ...o
1703
2585
  }) {
1704
- const i = ae(), c = $(null), u = $(null), f = $(n);
1705
- return f.current = n, M(() => {
2586
+ const i = fe(), l = A(null), c = A(null), d = A(a);
2587
+ return d.current = a, P(() => {
1706
2588
  if (!e) return;
1707
- u.current = document.activeElement instanceof HTMLElement ? document.activeElement : null;
1708
- const h = document.body.style.overflow;
2589
+ c.current = document.activeElement instanceof HTMLElement ? document.activeElement : null;
2590
+ const m = document.body.style.overflow;
1709
2591
  document.body.style.overflow = "hidden";
1710
- const d = requestAnimationFrame(() => {
1711
- c.current?.focus();
1712
- }), g = (b) => {
1713
- if (b.key === "Escape" && s) {
1714
- b.preventDefault(), f.current?.();
2592
+ const f = requestAnimationFrame(() => {
2593
+ l.current?.focus();
2594
+ }), v = (h) => {
2595
+ if (h.key === "Escape" && s) {
2596
+ h.preventDefault(), d.current?.();
1715
2597
  return;
1716
2598
  }
1717
- if (b.key !== "Tab") return;
1718
- const j = c.current;
1719
- if (!j) return;
1720
- const x = Array.from(
1721
- j.querySelectorAll(it)
1722
- ).filter((O) => O.getAttribute("aria-hidden") !== "true");
1723
- if (x.length === 0) {
1724
- b.preventDefault(), j.focus();
2599
+ if (h.key !== "Tab") return;
2600
+ const x = l.current;
2601
+ if (!x) return;
2602
+ const b = Array.from(
2603
+ x.querySelectorAll(Wt)
2604
+ ).filter((T) => T.getAttribute("aria-hidden") !== "true");
2605
+ if (b.length === 0) {
2606
+ h.preventDefault(), x.focus();
1725
2607
  return;
1726
2608
  }
1727
- const m = document.activeElement, v = x.indexOf(m);
1728
- if (b.preventDefault(), m === j || v === -1) {
1729
- (b.shiftKey ? x[x.length - 1] : x[0]).focus();
2609
+ const p = document.activeElement, j = b.indexOf(p);
2610
+ if (h.preventDefault(), p === x || j === -1) {
2611
+ (h.shiftKey ? b[b.length - 1] : b[0]).focus();
1730
2612
  return;
1731
2613
  }
1732
- const C = b.shiftKey ? (v - 1 + x.length) % x.length : (v + 1) % x.length;
1733
- x[C].focus();
2614
+ const C = h.shiftKey ? (j - 1 + b.length) % b.length : (j + 1) % b.length;
2615
+ b[C].focus();
1734
2616
  };
1735
- return document.addEventListener("keydown", g), () => {
1736
- cancelAnimationFrame(d), document.removeEventListener("keydown", g), document.body.style.overflow = h, u.current?.focus();
2617
+ return document.addEventListener("keydown", v), () => {
2618
+ cancelAnimationFrame(f), document.removeEventListener("keydown", v), document.body.style.overflow = m, c.current?.focus();
1737
2619
  };
1738
- }, [s, e]), e ? /* @__PURE__ */ a.jsx(
2620
+ }, [s, e]), e ? /* @__PURE__ */ t.jsx(
1739
2621
  "div",
1740
2622
  {
1741
2623
  role: "presentation",
1742
2624
  "data-modal-backdrop": "true",
1743
- onMouseDown: (h) => {
1744
- s && h.target === h.currentTarget && f.current?.();
2625
+ onMouseDown: (m) => {
2626
+ s && m.target === m.currentTarget && d.current?.();
1745
2627
  },
1746
- children: /* @__PURE__ */ a.jsxs(
2628
+ children: /* @__PURE__ */ t.jsxs(
1747
2629
  "div",
1748
2630
  {
1749
2631
  ...o,
1750
- ref: c,
2632
+ ref: l,
1751
2633
  role: "dialog",
1752
2634
  "aria-modal": "true",
1753
2635
  "aria-labelledby": i,
1754
2636
  tabIndex: -1,
1755
2637
  children: [
1756
- /* @__PURE__ */ a.jsx("header", { children: /* @__PURE__ */ a.jsx("h2", { id: i, children: r }) }),
1757
- /* @__PURE__ */ a.jsx("div", { children: t })
2638
+ /* @__PURE__ */ t.jsx("header", { children: /* @__PURE__ */ t.jsx("h2", { id: i, children: r }) }),
2639
+ /* @__PURE__ */ t.jsx("div", { children: n })
1758
2640
  ]
1759
2641
  }
1760
2642
  )
1761
2643
  }
1762
2644
  ) : null;
1763
2645
  }
1764
- function nr({ options: e, value: r, defaultValue: t = [], onValueChange: n }) {
1765
- const [s, o] = T(t), i = r ?? s, c = (u) => {
1766
- const f = i.includes(u) ? i.filter((h) => h !== u) : [...i, u];
1767
- o(f), n?.(f);
2646
+ function sn({ options: e, value: r, defaultValue: n = [], onValueChange: a }) {
2647
+ const [s, o] = w(n), i = r ?? s, l = (c) => {
2648
+ const d = i.includes(c) ? i.filter((m) => m !== c) : [...i, c];
2649
+ o(d), a?.(d);
1768
2650
  };
1769
- return /* @__PURE__ */ a.jsx("div", { role: "group", children: e.map((u) => /* @__PURE__ */ a.jsxs("label", { children: [
1770
- /* @__PURE__ */ a.jsx("input", { type: "checkbox", checked: i.includes(u.value), disabled: u.disabled, onChange: () => c(u.value) }),
1771
- u.label
1772
- ] }, u.value)) });
1773
- }
1774
- function ar({ items: e }) {
1775
- const r = (t) => t.map((n, s) => /* @__PURE__ */ a.jsxs("li", { children: [
1776
- n.href ? /* @__PURE__ */ a.jsx("a", { href: n.href, children: n.label }) : /* @__PURE__ */ a.jsx("span", { children: n.label }),
1777
- n.children && /* @__PURE__ */ a.jsx("ul", { children: r(n.children) })
2651
+ return /* @__PURE__ */ t.jsx("div", { role: "group", children: e.map((c) => /* @__PURE__ */ t.jsxs("label", { children: [
2652
+ /* @__PURE__ */ t.jsx("input", { type: "checkbox", checked: i.includes(c.value), disabled: c.disabled, onChange: () => l(c.value) }),
2653
+ c.label
2654
+ ] }, c.value)) });
2655
+ }
2656
+ function on({ items: e }) {
2657
+ const r = (n) => n.map((a, s) => /* @__PURE__ */ t.jsxs("li", { children: [
2658
+ a.href ? /* @__PURE__ */ t.jsx("a", { href: a.href, children: a.label }) : /* @__PURE__ */ t.jsx("span", { children: a.label }),
2659
+ a.children && /* @__PURE__ */ t.jsx("ul", { children: r(a.children) })
1778
2660
  ] }, s));
1779
- return /* @__PURE__ */ a.jsx("nav", { "aria-label": "Navigation", children: /* @__PURE__ */ a.jsx("ul", { children: r(e) }) });
2661
+ return /* @__PURE__ */ t.jsx("nav", { "aria-label": "Navigation", children: /* @__PURE__ */ t.jsx("ul", { children: r(e) }) });
1780
2662
  }
1781
- function sr({ page: e, pageCount: r, onPageChange: t, ...n }) {
1782
- return /* @__PURE__ */ a.jsxs("nav", { ...n, "aria-label": "Pagination", children: [
1783
- /* @__PURE__ */ a.jsx("button", { type: "button", disabled: e <= 1, onClick: () => t?.(e - 1), children: "Previous" }),
1784
- /* @__PURE__ */ a.jsxs("span", { children: [
2663
+ function ln({ page: e, pageCount: r, onPageChange: n, ...a }) {
2664
+ return /* @__PURE__ */ t.jsxs("nav", { ...a, "aria-label": "Pagination", children: [
2665
+ /* @__PURE__ */ t.jsx("button", { type: "button", disabled: e <= 1, onClick: () => n?.(e - 1), children: "Previous" }),
2666
+ /* @__PURE__ */ t.jsxs("span", { children: [
1785
2667
  e,
1786
2668
  " / ",
1787
2669
  r
1788
2670
  ] }),
1789
- /* @__PURE__ */ a.jsx("button", { type: "button", disabled: e >= r, onClick: () => t?.(e + 1), children: "Next" })
2671
+ /* @__PURE__ */ t.jsx("button", { type: "button", disabled: e >= r, onClick: () => n?.(e + 1), children: "Next" })
1790
2672
  ] });
1791
2673
  }
1792
- function or({ trigger: e, children: r, open: t, onOpenChange: n }) {
1793
- const [s, o] = T(!1), i = t ?? s, c = (u) => {
1794
- o(u), n?.(u);
2674
+ function cn({ trigger: e, children: r, open: n, onOpenChange: a }) {
2675
+ const [s, o] = w(!1), i = n ?? s, l = (c) => {
2676
+ o(c), a?.(c);
1795
2677
  };
1796
- return /* @__PURE__ */ a.jsxs("div", { children: [
1797
- /* @__PURE__ */ a.jsx("button", { type: "button", onClick: () => c(!i), "aria-expanded": i, children: e }),
1798
- i && /* @__PURE__ */ a.jsxs("div", { role: "dialog", children: [
2678
+ return /* @__PURE__ */ t.jsxs("div", { children: [
2679
+ /* @__PURE__ */ t.jsx("button", { type: "button", onClick: () => l(!i), "aria-expanded": i, children: e }),
2680
+ i && /* @__PURE__ */ t.jsxs("div", { role: "dialog", children: [
1799
2681
  r,
1800
- /* @__PURE__ */ a.jsx("button", { type: "button", onClick: () => c(!1), children: "Close" })
2682
+ /* @__PURE__ */ t.jsx("button", { type: "button", onClick: () => l(!1), children: "Close" })
1801
2683
  ] })
1802
2684
  ] });
1803
2685
  }
1804
- function ir({ value: e = 0, max: r = 100, label: t, ...n }) {
1805
- return /* @__PURE__ */ a.jsx("div", { ...n, role: "progressbar", "aria-label": t, "aria-valuenow": e, "aria-valuemin": 0, "aria-valuemax": r });
2686
+ function dn({ value: e = 0, max: r = 100, label: n, ...a }) {
2687
+ return /* @__PURE__ */ t.jsx("div", { ...a, role: "progressbar", "aria-label": n, "aria-valuenow": e, "aria-valuemin": 0, "aria-valuemax": r });
1806
2688
  }
1807
- function lr({
2689
+ function un({
1808
2690
  size: e = "medium",
1809
2691
  disabled: r = !1,
1810
- ...t
2692
+ ...n
1811
2693
  }) {
1812
- return /* @__PURE__ */ a.jsx(
2694
+ return /* @__PURE__ */ t.jsx(
1813
2695
  "input",
1814
2696
  {
1815
- ...t,
2697
+ ...n,
1816
2698
  type: "radio",
1817
2699
  "data-size": e,
1818
2700
  disabled: r
1819
2701
  }
1820
2702
  );
1821
2703
  }
1822
- function cr({ children: e, initialSize: r = 300, minSize: t = 120, maxSize: n = 800 }) {
1823
- const [s, o] = T(r);
1824
- return /* @__PURE__ */ a.jsxs("div", { style: { width: s }, children: [
1825
- /* @__PURE__ */ a.jsx("div", { children: e }),
1826
- /* @__PURE__ */ a.jsx("input", { "aria-label": "Panel size", type: "range", min: t, max: n, value: s, onChange: (i) => o(Number(i.target.value)) })
2704
+ function fn({ children: e, initialSize: r = 300, minSize: n = 120, maxSize: a = 800 }) {
2705
+ const [s, o] = w(r);
2706
+ return /* @__PURE__ */ t.jsxs("div", { style: { width: s }, children: [
2707
+ /* @__PURE__ */ t.jsx("div", { children: e }),
2708
+ /* @__PURE__ */ t.jsx("input", { "aria-label": "Panel size", type: "range", min: n, max: a, value: s, onChange: (i) => o(Number(i.target.value)) })
1827
2709
  ] });
1828
2710
  }
1829
- function ur({ onClear: e, ...r }) {
1830
- return /* @__PURE__ */ a.jsxs("div", { children: [
1831
- /* @__PURE__ */ a.jsx("input", { ...r, type: "search" }),
1832
- e && /* @__PURE__ */ a.jsx("button", { type: "button", onClick: e, children: "Clear" })
2711
+ function mn({ onClear: e, ...r }) {
2712
+ return /* @__PURE__ */ t.jsxs("div", { children: [
2713
+ /* @__PURE__ */ t.jsx("input", { ...r, type: "search" }),
2714
+ e && /* @__PURE__ */ t.jsx("button", { type: "button", onClick: e, children: "Clear" })
1833
2715
  ] });
1834
2716
  }
1835
- const lt = [
2717
+ const Yt = [
1836
2718
  { value: "first", label: "First option" },
1837
2719
  { value: "second", label: "Second option" },
1838
2720
  { value: "third", label: "Third option" }
1839
2721
  ];
1840
- function dr({
2722
+ function hn({
1841
2723
  size: e = "medium",
1842
- options: r = lt,
1843
- disabled: t = !1,
1844
- ...n
2724
+ options: r = Yt,
2725
+ disabled: n = !1,
2726
+ ...a
1845
2727
  }) {
1846
- return /* @__PURE__ */ a.jsx(
2728
+ return /* @__PURE__ */ t.jsx(
1847
2729
  "select",
1848
2730
  {
1849
- ...n,
2731
+ ...a,
1850
2732
  "data-size": e,
1851
- disabled: t,
1852
- children: r.map((s) => /* @__PURE__ */ a.jsx(
2733
+ disabled: n,
2734
+ children: r.map((s) => /* @__PURE__ */ t.jsx(
1853
2735
  "option",
1854
2736
  {
1855
2737
  value: s.value,
@@ -1861,57 +2743,57 @@ function dr({
1861
2743
  }
1862
2744
  );
1863
2745
  }
1864
- function fr({ orientation: e = "horizontal", ...r }) {
1865
- return /* @__PURE__ */ a.jsx("hr", { ...r, "aria-orientation": e });
2746
+ function pn({ orientation: e = "horizontal", ...r }) {
2747
+ return /* @__PURE__ */ t.jsx("hr", { ...r, "aria-orientation": e });
1866
2748
  }
1867
- function mr({ children: e, open: r = !0, width: t = "280px" }) {
1868
- return /* @__PURE__ */ a.jsx("aside", { hidden: !r, style: { width: t }, "aria-label": "Sidebar", children: e });
2749
+ function bn({ children: e, open: r = !0, width: n = "280px" }) {
2750
+ return /* @__PURE__ */ t.jsx("aside", { hidden: !r, style: { width: n }, "aria-label": "Sidebar", children: e });
1869
2751
  }
1870
- function pr({ width: e, height: r, variant: t = "rect", style: n, ...s }) {
1871
- return /* @__PURE__ */ a.jsx("div", { ...s, "aria-hidden": "true", "data-variant": t, style: { width: e, height: r, ...n } });
2752
+ function xn({ width: e, height: r, variant: n = "rect", style: a, ...s }) {
2753
+ return /* @__PURE__ */ t.jsx("div", { ...s, "aria-hidden": "true", "data-variant": n, style: { width: e, height: r, ...a } });
1872
2754
  }
1873
- function hr({ label: e = "Loading", ...r }) {
1874
- return /* @__PURE__ */ a.jsx("span", { ...r, role: "status", "aria-label": e });
2755
+ function vn({ label: e = "Loading", ...r }) {
2756
+ return /* @__PURE__ */ t.jsx("span", { ...r, role: "status", "aria-label": e });
1875
2757
  }
1876
- function br({
2758
+ function jn({
1877
2759
  label: e,
1878
2760
  value: r,
1879
- description: t,
1880
- trend: n = "neutral",
2761
+ description: n,
2762
+ trend: a = "neutral",
1881
2763
  trendValue: s,
1882
2764
  className: o,
1883
2765
  ...i
1884
2766
  }) {
1885
- return /* @__PURE__ */ a.jsxs(
2767
+ return /* @__PURE__ */ t.jsxs(
1886
2768
  "div",
1887
2769
  {
1888
2770
  ...i,
1889
2771
  className: o ? `fsc-stat-card ${o}` : "fsc-stat-card",
1890
- "data-trend": n,
2772
+ "data-trend": a,
1891
2773
  children: [
1892
- /* @__PURE__ */ a.jsx("span", { "data-role": "label", children: e }),
1893
- /* @__PURE__ */ a.jsx("strong", { "data-role": "value", children: r }),
1894
- t ? /* @__PURE__ */ a.jsx("span", { "data-role": "description", children: t }) : null,
1895
- s ? /* @__PURE__ */ a.jsx("span", { "data-role": "trend", children: s }) : null
2774
+ /* @__PURE__ */ t.jsx("span", { "data-role": "label", children: e }),
2775
+ /* @__PURE__ */ t.jsx("strong", { "data-role": "value", children: r }),
2776
+ n ? /* @__PURE__ */ t.jsx("span", { "data-role": "description", children: n }) : null,
2777
+ s ? /* @__PURE__ */ t.jsx("span", { "data-role": "trend", children: s }) : null
1896
2778
  ]
1897
2779
  }
1898
2780
  );
1899
2781
  }
1900
- function xr({ steps: e, current: r, orientation: t = "horizontal" }) {
1901
- return /* @__PURE__ */ a.jsx("ol", { "data-orientation": t, children: e.map((n, s) => /* @__PURE__ */ a.jsxs("li", { "aria-current": s === r ? "step" : void 0, "aria-disabled": n.disabled, children: [
1902
- n.label,
1903
- n.description && /* @__PURE__ */ a.jsx("small", { children: n.description })
1904
- ] }, n.id)) });
2782
+ function gn({ steps: e, current: r, orientation: n = "horizontal" }) {
2783
+ return /* @__PURE__ */ t.jsx("ol", { "data-orientation": n, children: e.map((a, s) => /* @__PURE__ */ t.jsxs("li", { "aria-current": s === r ? "step" : void 0, "aria-disabled": a.disabled, children: [
2784
+ a.label,
2785
+ a.description && /* @__PURE__ */ t.jsx("small", { children: a.description })
2786
+ ] }, a.id)) });
1905
2787
  }
1906
- function vr({
2788
+ function yn({
1907
2789
  size: e = "medium",
1908
2790
  disabled: r = !1,
1909
- ...t
2791
+ ...n
1910
2792
  }) {
1911
- return /* @__PURE__ */ a.jsx(
2793
+ return /* @__PURE__ */ t.jsx(
1912
2794
  "input",
1913
2795
  {
1914
- ...t,
2796
+ ...n,
1915
2797
  type: "checkbox",
1916
2798
  role: "switch",
1917
2799
  "data-size": e,
@@ -1919,149 +2801,194 @@ function vr({
1919
2801
  }
1920
2802
  );
1921
2803
  }
1922
- function gr({ items: e, value: r, defaultValue: t, onValueChange: n }) {
1923
- const s = r ?? t ?? e[0]?.id;
1924
- return /* @__PURE__ */ a.jsxs("div", { children: [
1925
- /* @__PURE__ */ a.jsx("div", { role: "tablist", children: e.map((o) => /* @__PURE__ */ a.jsx("button", { type: "button", role: "tab", "aria-selected": o.id === s, disabled: o.disabled, onClick: () => n?.(o.id), children: o.label }, o.id)) }),
1926
- e.map((o) => o.id === s ? /* @__PURE__ */ a.jsx("div", { role: "tabpanel", children: o.content }, o.id) : null)
2804
+ function _n({ items: e, value: r, defaultValue: n, onValueChange: a }) {
2805
+ const s = r ?? n ?? e[0]?.id;
2806
+ return /* @__PURE__ */ t.jsxs("div", { children: [
2807
+ /* @__PURE__ */ t.jsx("div", { role: "tablist", children: e.map((o) => /* @__PURE__ */ t.jsx("button", { type: "button", role: "tab", "aria-selected": o.id === s, disabled: o.disabled, onClick: () => a?.(o.id), children: o.label }, o.id)) }),
2808
+ e.map((o) => o.id === s ? /* @__PURE__ */ t.jsx("div", { role: "tabpanel", children: o.content }, o.id) : null)
1927
2809
  ] });
1928
2810
  }
1929
- function jr({ children: e, as: r = "p", ...t }) {
1930
- const n = r;
1931
- return /* @__PURE__ */ a.jsx(n, { ...t, children: e });
2811
+ function Sn({ children: e, as: r = "p", ...n }) {
2812
+ const a = r;
2813
+ return /* @__PURE__ */ t.jsx(a, { ...n, children: e });
1932
2814
  }
1933
- function yr({
2815
+ function wn({
1934
2816
  size: e = "medium",
1935
2817
  rows: r = 4,
1936
- disabled: t = !1,
1937
- ...n
2818
+ disabled: n = !1,
2819
+ ...a
1938
2820
  }) {
1939
- return /* @__PURE__ */ a.jsx(
2821
+ return /* @__PURE__ */ t.jsx(
1940
2822
  "textarea",
1941
2823
  {
1942
- ...n,
2824
+ ...a,
1943
2825
  rows: r,
1944
2826
  "data-size": e,
1945
- disabled: t
2827
+ disabled: n
1946
2828
  }
1947
2829
  );
1948
2830
  }
1949
- function Sr({ open: e = !0, children: r, variant: t = "info", onClose: n }) {
1950
- return e ? /* @__PURE__ */ a.jsxs("div", { role: "status", "data-variant": t, children: [
2831
+ function Nn({ open: e = !0, children: r, variant: n = "info", onClose: a }) {
2832
+ return e ? /* @__PURE__ */ t.jsxs("div", { role: "status", "data-variant": n, children: [
1951
2833
  r,
1952
- /* @__PURE__ */ a.jsx("button", { type: "button", onClick: n, children: "Close" })
2834
+ /* @__PURE__ */ t.jsx("button", { type: "button", onClick: a, children: "Close" })
1953
2835
  ] }) : null;
1954
2836
  }
1955
- function wr({ content: e, children: r }) {
1956
- return /* @__PURE__ */ a.jsx("span", { title: typeof e == "string" ? e : void 0, children: r });
2837
+ function kn({ content: e, children: r }) {
2838
+ return /* @__PURE__ */ t.jsx("span", { title: typeof e == "string" ? e : void 0, children: r });
1957
2839
  }
1958
- function Er({ nodes: e, onSelect: r }) {
1959
- const t = (n) => /* @__PURE__ */ a.jsx("ul", { role: "tree", children: n.map((s) => /* @__PURE__ */ a.jsxs("li", { role: "treeitem", "aria-disabled": s.disabled, children: [
1960
- /* @__PURE__ */ a.jsx("button", { type: "button", disabled: s.disabled, onClick: () => r?.(s.id), children: s.label }),
1961
- s.children && t(s.children)
2840
+ function En({ nodes: e, onSelect: r }) {
2841
+ const n = (a) => /* @__PURE__ */ t.jsx("ul", { role: "tree", children: a.map((s) => /* @__PURE__ */ t.jsxs("li", { role: "treeitem", "aria-disabled": s.disabled, children: [
2842
+ /* @__PURE__ */ t.jsx("button", { type: "button", disabled: s.disabled, onClick: () => r?.(s.id), children: s.label }),
2843
+ s.children && n(s.children)
1962
2844
  ] }, s.id)) });
1963
- return t(e);
2845
+ return n(e);
1964
2846
  }
1965
2847
  export {
1966
- At as Accordion,
1967
- $t as Alert,
1968
- Ze as ApiError,
1969
- Nt as Avatar,
1970
- zt as Badge,
1971
- ee as BoundFormField,
1972
- It as Button,
1973
- Ft as Card,
1974
- Mt as Carousel,
1975
- Lt as Checkbox,
1976
- Et as ColorInput,
1977
- Dt as Combobox,
1978
- Vt as CommandPalette,
1979
- Ut as ContextMenu,
1980
- wt as CrudExample,
1981
- Tt as DateInput,
1982
- Yt as DatePicker,
1983
- Bt as Drawer,
1984
- Wt as DropdownMenu,
1985
- Jt as EmptyState,
1986
- Qt as ErrorState,
1987
- Ct as FileInput,
1988
- Gt as FileUpload,
1989
- pt as Form,
1990
- qt as FormField,
1991
- ht as FormFieldAdapter,
1992
- le as FormProvider,
1993
- Ue as FormReset,
1994
- Ve as FormSubmit,
1995
- yt as Grid,
1996
- Zt as Heading,
1997
- Ht as IconButton,
1998
- Xt as Input,
1999
- Kt as Label,
2000
- er as Link,
2001
- et as LoadingState,
2002
- tr as Menubar,
2003
- rr as Modal,
2004
- nr as MultiSelect,
2005
- ar as NavigationMenu,
2006
- kt as NumberInput,
2007
- sr as Pagination,
2008
- Rt as PasswordInput,
2009
- or as Popover,
2010
- ir as Progress,
2011
- lr as Radio,
2012
- _t as RadioGroup,
2013
- cr as ResizablePanel,
2014
- tt as ResourceTable,
2015
- ur as SearchBar,
2016
- Pt as SearchInput,
2017
- dr as Select,
2018
- fr as Separator,
2019
- mr as Sidebar,
2020
- pr as Skeleton,
2021
- Ot as Slider,
2022
- hr as Spinner,
2023
- St as Stack,
2024
- br as StatCard,
2025
- xr as Stepper,
2026
- vr as Switch,
2027
- qe as Table,
2028
- gr as Tabs,
2029
- jr as Text,
2030
- yr as Textarea,
2031
- dt as ThemeProvider,
2032
- Sr as Toast,
2033
- wr as Tooltip,
2034
- Er as TreeView,
2035
- $e as applyTheme,
2036
- gt as createApiResource,
2037
- We as createArrayResource,
2038
- Xe as createCrudController,
2039
- vt as createFetchApiClient,
2040
- bt as createFieldAdapter,
2041
- Le as createFieldController,
2042
- Y as createFormStore,
2043
- Je as createResourceController,
2044
- xt as createResourceForm,
2045
- Qe as createTableController,
2046
- Re as createTheme,
2047
- _e as darkTheme,
2048
- R as defaultTheme,
2049
- Ee as fontSize,
2050
- Te as fontWeight,
2051
- Ye as inferTableColumns,
2052
- we as radius,
2053
- Ce as shadows,
2054
- Se as spacing,
2055
- ut as themeToCss,
2056
- se as themeToCssVariables,
2057
- jt as useCrud,
2058
- ce as useField,
2059
- mt as useForm,
2060
- De as useFormState,
2061
- B as useFormStore,
2062
- Ke as useResourceCrud,
2063
- Ge as useTable,
2064
- ft as useTheme,
2065
- Ae as validateTheme,
2066
- ke as zIndex
2848
+ zr as Accordion,
2849
+ vr as ActionBar,
2850
+ $r as Alert,
2851
+ at as ApiError,
2852
+ Lr as Avatar,
2853
+ Ir as Badge,
2854
+ ve as BoundFormField,
2855
+ Fr as Button,
2856
+ Mr as Card,
2857
+ Dr as Carousel,
2858
+ Br as Checkbox,
2859
+ lr as ColorInput,
2860
+ Vr as Combobox,
2861
+ Ur as CommandPalette,
2862
+ Wr as ContextMenu,
2863
+ or as CrudExample,
2864
+ jr as DataField,
2865
+ cr as DateInput,
2866
+ Yr as DatePicker,
2867
+ gr as DocumentList,
2868
+ Zr as Drawer,
2869
+ Qr as DropdownMenu,
2870
+ Jr as EmptyState,
2871
+ yr as EntityCard,
2872
+ Gr as ErrorState,
2873
+ dr as FileInput,
2874
+ Hr as FileUpload,
2875
+ Ar as FilterMenu,
2876
+ qt as Form,
2877
+ qr as FormField,
2878
+ Kt as FormFieldAdapter,
2879
+ ke as FormProvider,
2880
+ qe as FormReset,
2881
+ He as FormSubmit,
2882
+ ar as Grid,
2883
+ Kr as Heading,
2884
+ Xr as IconButton,
2885
+ en as Input,
2886
+ tn as Label,
2887
+ rn as Link,
2888
+ lt as LoadingState,
2889
+ _r as Main,
2890
+ nn as Menubar,
2891
+ an as Modal,
2892
+ sn as MultiSelect,
2893
+ ur as MultiSelectFilter,
2894
+ Sr as Navbar,
2895
+ zt as NavbarBrand,
2896
+ $t as NavbarBrandLogo,
2897
+ Lt as NavbarBrandName,
2898
+ Vt as NavbarFooter,
2899
+ At as NavbarHeader,
2900
+ Bt as NavbarItem,
2901
+ wr as NavbarItemIcon,
2902
+ Nr as NavbarItemName,
2903
+ Ft as NavbarMain,
2904
+ Ut as NavbarProfile,
2905
+ _e as NavbarProfilePicture,
2906
+ Mt as NavbarSection,
2907
+ Dt as NavbarSectionName,
2908
+ It as NavbarToggle,
2909
+ on as NavigationMenu,
2910
+ fr as NumberInput,
2911
+ kr as PageHeader,
2912
+ ln as Pagination,
2913
+ mr as PasswordInput,
2914
+ Er as PhotoGrid,
2915
+ cn as Popover,
2916
+ dn as Progress,
2917
+ un as Radio,
2918
+ hr as RadioGroup,
2919
+ fn as ResizablePanel,
2920
+ wt as ResourceTable,
2921
+ ir as ResultsCount,
2922
+ mn as SearchBar,
2923
+ Cr as SearchFilterSection,
2924
+ pr as SearchInput,
2925
+ hn as Select,
2926
+ br as SelectFilter,
2927
+ pn as Separator,
2928
+ bn as Sidebar,
2929
+ xn as Skeleton,
2930
+ xr as Slider,
2931
+ vn as Spinner,
2932
+ sr as Stack,
2933
+ jn as StatCard,
2934
+ gn as Stepper,
2935
+ yn as Switch,
2936
+ St as Table,
2937
+ ct as TableAction,
2938
+ ut as TableActions,
2939
+ ft as TableBody,
2940
+ Rr as TableCaption,
2941
+ re as TableCell,
2942
+ mt as TableEmpty,
2943
+ ht as TableError,
2944
+ Or as TableExpand,
2945
+ Pr as TableFooter,
2946
+ pt as TableHeader,
2947
+ ne as TableHeaderCell,
2948
+ vt as TableLoading,
2949
+ jt as TablePagination,
2950
+ gt as TableRow,
2951
+ yt as TableRowActions,
2952
+ ge as TableSelection,
2953
+ xt as TableSort,
2954
+ Tr as TableStructure,
2955
+ _n as Tabs,
2956
+ Sn as Text,
2957
+ wn as Textarea,
2958
+ Jt as ThemeProvider,
2959
+ Nn as Toast,
2960
+ kn as Tooltip,
2961
+ En as TreeView,
2962
+ Ve as applyTheme,
2963
+ rr as createApiResource,
2964
+ et as createArrayResource,
2965
+ ot as createCrudController,
2966
+ tr as createFetchApiClient,
2967
+ Xt as createFieldAdapter,
2968
+ Je as createFieldController,
2969
+ me as createFormStore,
2970
+ tt as createResourceController,
2971
+ er as createResourceForm,
2972
+ rt as createTableController,
2973
+ Ie as createTheme,
2974
+ Fe as darkTheme,
2975
+ M as defaultTheme,
2976
+ Ae as fontSize,
2977
+ ze as fontWeight,
2978
+ Ke as inferTableColumns,
2979
+ Oe as radius,
2980
+ $e as shadows,
2981
+ Pe as spacing,
2982
+ Qt as themeToCss,
2983
+ Se as themeToCssVariables,
2984
+ nr as useCrud,
2985
+ Ee as useField,
2986
+ Ht as useForm,
2987
+ Ge as useFormState,
2988
+ he as useFormStore,
2989
+ it as useResourceCrud,
2990
+ nt as useTable,
2991
+ Gt as useTheme,
2992
+ Be as validateTheme,
2993
+ Le as zIndex
2067
2994
  };