@abyss-project/commons-front-core 13.3.0 → 15.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (201) hide show
  1. package/README.md +1 -1
  2. package/catalog/captures-plan.ts +4 -1
  3. package/catalog/catalog-entries.ts +6 -1
  4. package/catalog/expected-error.ts +6 -0
  5. package/catalog/pages/CookieConsent.tsx +38 -0
  6. package/catalog/pages/ErrorBoundary.tsx +22 -0
  7. package/catalog/pages/PasswordField.tsx +62 -0
  8. package/catalog/pages/Toast.tsx +17 -6
  9. package/catalog/pages/index.ts +6 -0
  10. package/catalog/specs/captures.spec.ts +10 -0
  11. package/catalog/specs/catalog-page.ts +6 -1
  12. package/catalog/specs/write-capture-index.ts +1 -0
  13. package/dist/CookieConsentSettings-B7NfjgaI.js +505 -0
  14. package/dist/{use-rich-intl.hook-BETUyCkW.js → Surface-BEhoEhyC.js} +844 -161
  15. package/dist/Tabs-DJ9_ZFjM.js +1946 -0
  16. package/dist/auth/components/AuthFlow/auth-flow.types.d.ts +2 -0
  17. package/dist/auth/components/AuthFlow/steps/MfaEnrollmentStep.component.d.ts +2 -0
  18. package/dist/auth/components/AuthFlow/steps/MfaStep.component.d.ts +10 -4
  19. package/dist/auth/components/AuthFlow/steps/PasskeyNudgeStep.component.d.ts +3 -1
  20. package/dist/auth/components/AuthHeroLayout/auth-hero-gradient.d.ts +18 -0
  21. package/dist/auth/components/MfaRequirementBanner/MfaRequirementBanner.component.d.ts +3 -1
  22. package/dist/auth/components/SecuritySettings/SecuritySettings.component.d.ts +1 -1
  23. package/dist/auth/components/SecuritySettings/sections/PasskeysSection.component.d.ts +6 -1
  24. package/dist/auth/components/SecuritySettings/sections/RecoveryCodesSection.component.d.ts +3 -1
  25. package/dist/auth/components/SecuritySettings/sections/TrustedDevicesSection.component.d.ts +6 -0
  26. package/dist/auth/components/index.d.ts +1 -0
  27. package/dist/auth/components/shared/AuthLoadingScreen.component.d.ts +5 -0
  28. package/dist/auth/components/shared/SingleDevicePasskeyAdvice.component.d.ts +13 -0
  29. package/dist/auth/components/shared/passkey-ceremonies.d.ts +6 -1
  30. package/dist/auth/components/shared/support-contact.d.ts +2 -0
  31. package/dist/auth/components/shared/use-async-resource.hook.d.ts +4 -1
  32. package/dist/auth/components/test-support/auth-sdk.mock.d.ts +5 -0
  33. package/dist/auth/components/test-support/auth-test-harness.d.ts +3 -0
  34. package/dist/clsx-OuTLNxxd.js +16 -0
  35. package/dist/{legacy/components/CookieConsent/CookieConsentBanner.component.d.ts → components/business/CookieConsent/CookieConsentBanner.d.ts} +1 -2
  36. package/dist/components/business/CookieConsent/CookieConsentSettings.d.ts +1 -0
  37. package/dist/{legacy/components → components/business}/CookieConsent/index.d.ts +2 -2
  38. package/dist/components/business/Support/AbyssServiceSelect.component.d.ts +26 -0
  39. package/dist/components/business/Support/SupportActionButtons.component.d.ts +7 -0
  40. package/dist/components/business/Support/SupportActivityLog.component.d.ts +7 -0
  41. package/dist/components/business/Support/SupportAttachmentsPanel.component.d.ts +7 -0
  42. package/dist/components/business/Support/SupportCategoryChip.component.d.ts +12 -0
  43. package/dist/components/business/Support/SupportCategoryGroupCards.component.d.ts +2 -0
  44. package/dist/components/business/Support/SupportCategorySelect.component.d.ts +21 -0
  45. package/dist/components/business/Support/SupportCreateTextField.d.ts +17 -0
  46. package/dist/components/business/Support/SupportMessageAttachment.component.d.ts +9 -0
  47. package/dist/components/business/Support/SupportMessageInput.component.d.ts +7 -0
  48. package/dist/components/business/Support/SupportMessageLink.component.d.ts +8 -0
  49. package/dist/components/business/Support/SupportMessageLink.component.spec.d.ts +1 -0
  50. package/dist/components/business/Support/SupportMessageThread.component.d.ts +8 -0
  51. package/dist/components/business/Support/SupportMessageThread.component.spec.d.ts +1 -0
  52. package/dist/components/business/Support/SupportPill.d.ts +18 -0
  53. package/dist/components/business/Support/SupportPriorityChip.component.d.ts +3 -0
  54. package/dist/components/business/Support/SupportSidebar.component.d.ts +7 -0
  55. package/dist/components/business/Support/SupportSidebar.component.spec.d.ts +1 -0
  56. package/dist/components/business/Support/SupportStatusBadge.component.d.ts +3 -0
  57. package/dist/components/business/Support/SupportStatusTimeline.component.d.ts +15 -0
  58. package/dist/components/business/Support/SupportSystemMessage.component.d.ts +11 -0
  59. package/dist/components/business/Support/SupportSystemMessage.component.spec.d.ts +1 -0
  60. package/dist/components/business/Support/SupportTagEditor.d.ts +15 -0
  61. package/dist/components/business/Support/SupportTicketCreateForm.component.d.ts +2 -0
  62. package/dist/components/business/Support/SupportTicketCreateForm.component.spec.d.ts +1 -0
  63. package/dist/components/business/Support/SupportTicketCreateStepper.component.d.ts +2 -0
  64. package/dist/components/business/Support/SupportTicketCreateStepper.component.spec.d.ts +1 -0
  65. package/dist/components/business/Support/SupportTicketDetail.component.d.ts +8 -0
  66. package/dist/components/business/Support/SupportTicketDetail.component.spec.d.ts +1 -0
  67. package/dist/components/business/Support/SupportTicketDetail.mobile-layout.spec.d.ts +1 -0
  68. package/dist/components/business/Support/SupportTicketList.component.spec.d.ts +1 -0
  69. package/dist/components/business/Support/SupportTicketList.week-preset.spec.d.ts +1 -0
  70. package/dist/components/business/Support/SupportTicketListFilterBar.d.ts +15 -0
  71. package/dist/components/business/Support/SupportTopBar.component.d.ts +7 -0
  72. package/dist/components/business/Support/support-action.d.ts +17 -0
  73. package/dist/components/business/Support/support-action.logic.d.ts +12 -0
  74. package/dist/components/business/Support/support-action.logic.spec.d.ts +1 -0
  75. package/dist/components/business/Support/support-attachment.logic.spec.d.ts +1 -0
  76. package/dist/components/business/Support/support-author.logic.spec.d.ts +1 -0
  77. package/dist/components/business/Support/support-create-stepper.logic.spec.d.ts +1 -0
  78. package/dist/components/business/Support/support-create.logic.d.ts +28 -0
  79. package/dist/components/business/Support/support-create.logic.spec.d.ts +1 -0
  80. package/dist/components/business/Support/support-message-anchor.d.ts +4 -0
  81. package/dist/components/business/Support/support-message-input.logic.spec.d.ts +1 -0
  82. package/dist/components/business/Support/support-service.logic.spec.d.ts +1 -0
  83. package/dist/components/business/Support/support-status-timeline.logic.spec.d.ts +1 -0
  84. package/dist/components/business/Support/support-tone.d.ts +11 -0
  85. package/dist/components/business/Support/test-support/support-detail.fixtures.d.ts +7 -0
  86. package/dist/components/business/Support/test-support/support-thread.fixtures.d.ts +9 -0
  87. package/dist/{legacy/components → components/business}/Support/types.d.ts +13 -4
  88. package/dist/components/business/Support/use-support-create-error-message.hook.d.ts +4 -0
  89. package/dist/components/business/index.d.ts +23 -0
  90. package/dist/components/inputs/ExpressionSearch/ExpressionSearch.d.ts +6 -1
  91. package/dist/components/inputs/FormField/FormField.d.ts +5 -1
  92. package/dist/components/inputs/PasswordField/PasswordField.d.ts +40 -0
  93. package/dist/components/inputs/PasswordField/PasswordField.spec.d.ts +1 -0
  94. package/dist/components/inputs/SegmentedControl/SegmentedControl.d.ts +9 -1
  95. package/dist/components/inputs/index.d.ts +1 -0
  96. package/dist/components/layers/Toast/Toast.d.ts +3 -18
  97. package/dist/components/layers/Toast/toast-clearance.d.ts +6 -0
  98. package/dist/components/layers/Toast/toast-store.d.ts +76 -0
  99. package/dist/components/states/ErrorBoundary/ErrorBoundary.d.ts +17 -0
  100. package/dist/components/states/ErrorBoundary/ErrorBoundary.spec.d.ts +1 -0
  101. package/dist/components/states/PageState/PageState.d.ts +3 -1
  102. package/dist/components/states/index.d.ts +1 -0
  103. package/dist/cookie-consent.d.ts +1 -1
  104. package/dist/cookie-consent.js +14 -15
  105. package/dist/demo/DemoBanner/DemoBanner.d.ts +16 -0
  106. package/dist/demo/DemoBanner/DemoBanner.spec.d.ts +1 -0
  107. package/dist/demo/DemoBanner/index.d.ts +1 -0
  108. package/dist/demo/demo-blocked.interceptor.d.ts +7 -0
  109. package/dist/demo/demo.en.d.ts +17 -0
  110. package/dist/demo/demo.fr.d.ts +17 -0
  111. package/dist/demo/index.d.ts +3 -0
  112. package/dist/demo/tests/demo-blocked.interceptor.spec.d.ts +1 -0
  113. package/dist/demo/use-demo-account.hook.d.ts +19 -0
  114. package/dist/design-theme-N9jJSXdK.js +27605 -0
  115. package/dist/{editors-CUsZNFfw.js → editors-QM76tqZI.js} +84 -84
  116. package/dist/editors.js +1 -1
  117. package/dist/hooks/use-rich-intl.hook.d.ts +210 -0
  118. package/dist/{index-CiDg4J7c.js → index-3-SmpH5N.js} +4 -4
  119. package/dist/{index-DErJ9c2q.js → index-4b2f7sdW.js} +2 -2
  120. package/dist/{index-DEBTvCWD.js → index-5OVR3WNo.js} +3 -3
  121. package/dist/{index-Lyt4_W7a.js → index-BKAfoA1a.js} +2 -2
  122. package/dist/{AbyssCloud-D_AbU9k7.js → index-C27b790L.js} +1438 -1083
  123. package/dist/{index-CYUixRIB.js → index-C6jhogFt.js} +2 -2
  124. package/dist/{index-D1ro2oTw.js → index-CM5COMvb.js} +2 -2
  125. package/dist/{index-BQ4GXlMJ.js → index-COUUAr5G.js} +1 -1
  126. package/dist/{index-C7a2XXcz.js → index-CQU0eEXk.js} +4 -4
  127. package/dist/{index-YzYX-H93.js → index-Ce0rv5wr.js} +3 -3
  128. package/dist/{index-CM0x-TnE.js → index-D1M_muSg.js} +2 -2
  129. package/dist/{index-CDpC4_po.js → index-D8ncJrf1.js} +2 -2
  130. package/dist/{index-DuMzZrqc.js → index-DA-HUFp6.js} +2 -2
  131. package/dist/{index-BzoBMWdL.js → index-DCk0q3d7.js} +3 -3
  132. package/dist/{index-Bn4gTAno.js → index-DW3SBSsW.js} +2 -2
  133. package/dist/{index-BhFOCfCj.js → index-DYXAfA_s.js} +2 -2
  134. package/dist/{index-pnfk6VZ7.js → index-DmAoL9-1.js} +4 -4
  135. package/dist/{index-CjV5ui_B.js → index-Taee9VIc.js} +2 -2
  136. package/dist/{index-GTkZik4b.js → index-jZGexiyT.js} +3 -3
  137. package/dist/{index-Ba41aBBN.js → index-mmrA4ErC.js} +2 -2
  138. package/dist/{index-TB7ekLl-.js → index-nKbvjf2P.js} +2 -2
  139. package/dist/{index-DobX4g2g.js → index-pX3CTxFd.js} +2 -2
  140. package/dist/index.d.ts +1 -0
  141. package/dist/index.js +14545 -9182
  142. package/dist/legacy/components/Spotlight/ProjectLinkSelector/index.d.ts +1 -4
  143. package/dist/legacy/components/index.d.ts +1 -2
  144. package/dist/legacy/legacy-support-removed.spec.d.ts +1 -0
  145. package/dist/legacy.js +13350 -17922
  146. package/dist/theme/index.d.ts +1 -1
  147. package/dist/translations/en.d.ts +104 -0
  148. package/dist/translations/fr.d.ts +104 -0
  149. package/dist/utils/index.d.ts +2 -0
  150. package/dist/utils/project-link-mode.d.ts +4 -0
  151. package/dist/utils/project-link-wording.utils.d.ts +1 -1
  152. package/dist/utils/service-config.d.ts +8 -0
  153. package/dist/utils/service-config.spec.d.ts +1 -0
  154. package/package.json +3 -3
  155. package/vite.config.ts +1 -1
  156. package/dist/AbyssCookieConsentProvider-Ds99df0E.js +0 -4562
  157. package/dist/CookieConsentSettings.component-DoWLHqw5.js +0 -78
  158. package/dist/Tabs-C1qcQ2i5.js +0 -2335
  159. package/dist/clsx-D8ItxkrZ.js +0 -446
  160. package/dist/design-theme-CYGZ6mAh.js +0 -23975
  161. package/dist/legacy/components/CookieConsent/CookieConsentSettings.component.d.ts +0 -2
  162. package/dist/legacy/components/Support/AbyssServiceSelect.component.d.ts +0 -37
  163. package/dist/legacy/components/Support/SupportActionButtons.component.d.ts +0 -3
  164. package/dist/legacy/components/Support/SupportActivityLog.component.d.ts +0 -3
  165. package/dist/legacy/components/Support/SupportAttachmentsPanel.component.d.ts +0 -3
  166. package/dist/legacy/components/Support/SupportCategoryChip.component.d.ts +0 -9
  167. package/dist/legacy/components/Support/SupportCategoryGroupCards.component.d.ts +0 -3
  168. package/dist/legacy/components/Support/SupportCategorySelect.component.d.ts +0 -22
  169. package/dist/legacy/components/Support/SupportMessageInput.component.d.ts +0 -3
  170. package/dist/legacy/components/Support/SupportMessageThread.component.d.ts +0 -3
  171. package/dist/legacy/components/Support/SupportPriorityChip.component.d.ts +0 -3
  172. package/dist/legacy/components/Support/SupportSidebar.component.d.ts +0 -3
  173. package/dist/legacy/components/Support/SupportStatusBadge.component.d.ts +0 -3
  174. package/dist/legacy/components/Support/SupportStatusTimeline.component.d.ts +0 -10
  175. package/dist/legacy/components/Support/SupportTicketCreateForm.component.d.ts +0 -3
  176. package/dist/legacy/components/Support/SupportTicketCreateStepper.component.d.ts +0 -3
  177. package/dist/legacy/components/Support/SupportTicketDetail.component.d.ts +0 -3
  178. package/dist/legacy/components/Support/SupportTopBar.component.d.ts +0 -3
  179. package/dist/legacy/components/Support/index.d.ts +0 -18
  180. /package/dist/{legacy/components/CookieConsent/AbyssCookieConsentProvider.spec.d.ts → auth/components/AuthFlow/steps/MfaStep.component.spec.d.ts} +0 -0
  181. /package/dist/{legacy/components/Support/SupportCategoryPick.component.spec.d.ts → auth/components/SecuritySettings/sections/SessionsSection.component.spec.d.ts} +0 -0
  182. /package/dist/{legacy/components/Support/SupportMessageLink.component.spec.d.ts → auth/components/shared/use-async-resource.hook.spec.d.ts} +0 -0
  183. /package/dist/{legacy/components → components/business}/CookieConsent/AbyssCookieConsentProvider.d.ts +0 -0
  184. /package/dist/{legacy/components/Support/SupportSystemMessage.component.spec.d.ts → components/business/CookieConsent/AbyssCookieConsentProvider.spec.d.ts} +0 -0
  185. /package/dist/{legacy/components/Support/SupportTicketDetail.mobile-layout.spec.d.ts → components/business/CookieConsent/CookieConsent.spec.d.ts} +0 -0
  186. /package/dist/{legacy/components/Support/SupportTicketList.week-preset.spec.d.ts → components/business/Support/AbyssServiceSelect.component.spec.d.ts} +0 -0
  187. /package/dist/{legacy/components/Support/support-attachment.logic.spec.d.ts → components/business/Support/SupportActivityLog.component.spec.d.ts} +0 -0
  188. /package/dist/{legacy/components/Support/support-author.logic.spec.d.ts → components/business/Support/SupportAttachmentsPanel.component.spec.d.ts} +0 -0
  189. /package/dist/{legacy/components/Support/support-create-stepper.logic.spec.d.ts → components/business/Support/SupportBadges.spec.d.ts} +0 -0
  190. /package/dist/{legacy/components/Support/support-message-input.logic.spec.d.ts → components/business/Support/SupportCategoryGroupCards.component.spec.d.ts} +0 -0
  191. /package/dist/{legacy/components/Support/support-service.logic.spec.d.ts → components/business/Support/SupportCategorySelect.component.spec.d.ts} +0 -0
  192. /package/dist/{legacy/components/Support/support-status-timeline.logic.spec.d.ts → components/business/Support/SupportMessageInput.component.spec.d.ts} +0 -0
  193. /package/dist/{legacy/components → components/business}/Support/SupportTicketList.component.d.ts +0 -0
  194. /package/dist/{legacy/components → components/business}/Support/support-attachment.logic.d.ts +0 -0
  195. /package/dist/{legacy/components → components/business}/Support/support-author.logic.d.ts +0 -0
  196. /package/dist/{legacy/components → components/business}/Support/support-category.logic.d.ts +0 -0
  197. /package/dist/{legacy/components → components/business}/Support/support-create-stepper.logic.d.ts +0 -0
  198. /package/dist/{legacy/components → components/business}/Support/support-message-input.logic.d.ts +0 -0
  199. /package/dist/{legacy/components → components/business}/Support/support-service.logic.d.ts +0 -0
  200. /package/dist/{legacy/components → components/business}/Support/support-status-timeline.logic.d.ts +0 -0
  201. /package/dist/{legacy/components → components/business}/Support/support-system-message.logic.d.ts +0 -0
@@ -0,0 +1,1946 @@
1
+ import { jsxs as x, jsx as i, Fragment as J } from "react/jsx-runtime";
2
+ import { useId as D, cloneElement as fn, useState as I, useMemo as ge, useRef as Y, useCallback as Q, useEffect as B, createContext as Ee, useContext as ze, useLayoutEffect as Ae } from "react";
3
+ import le from "@mui/material/FormControl";
4
+ import se from "@mui/material/FormHelperText";
5
+ import Le from "@mui/material/InputLabel";
6
+ import xe from "@mui/material/MenuItem";
7
+ import mn from "@mui/material/Select";
8
+ import { styled as d, useTheme as hn, getContrastRatio as Ce } from "@mui/material/styles";
9
+ import { visuallyHidden as bn } from "@mui/utils";
10
+ import { useIntl as L } from "react-intl";
11
+ import { a as R, p as o, h as A, d as Z, D as K, c as yn, t as $e, s as de, e as oe, g as te, M as De, b as Pe, i as vn, B as wn } from "./Surface-BEhoEhyC.js";
12
+ import { i as xn, b as Cn, r as kn, u as Sn, A as In, E as Fn } from "./index-C27b790L.js";
13
+ import X from "@mui/material/Button";
14
+ import { byteSizeIEC as Mn } from "@abyss-project/main";
15
+ import Wn from "@mui/icons-material/FileUploadOutlined";
16
+ import On, { autocompleteClasses as ke } from "@mui/material/Autocomplete";
17
+ import Se from "@mui/material/CircularProgress";
18
+ import ae from "@mui/material/IconButton";
19
+ import fe from "@mui/material/OutlinedInput";
20
+ import Ie from "@mui/material/Tooltip";
21
+ import Fe from "@mui/icons-material/CloudOutlined";
22
+ import Tn from "@mui/icons-material/CloudOffOutlined";
23
+ import Rn from "@mui/icons-material/FileDownloadOutlined";
24
+ import He from "@mui/icons-material/FolderOpenOutlined";
25
+ import En from "@mui/icons-material/OpenInNewRounded";
26
+ import zn from "@mui/icons-material/RefreshRounded";
27
+ import An from "@mui/icons-material/CheckCircleOutline";
28
+ import Ne from "@mui/icons-material/Close";
29
+ import Ln from "@mui/icons-material/ErrorOutline";
30
+ import $n from "@mui/icons-material/InfoOutlined";
31
+ import Dn from "@mui/icons-material/WarningAmber";
32
+ import Pn from "@mui/material/Checkbox";
33
+ import Hn from "@mui/icons-material/DescriptionOutlined";
34
+ import Nn from "@mui/icons-material/FolderOutlined";
35
+ import _n from "@mui/icons-material/ChevronRightRounded";
36
+ import Bn from "@mui/material/Alert";
37
+ import Vn from "@mui/material/TextField";
38
+ import jn from "@mui/material/Popover";
39
+ import _e from "@mui/material/ButtonBase";
40
+ import Gn from "@mui/material/InputAdornment";
41
+ import qn from "@mui/material/FormLabel";
42
+ import { isMuiElement as Un } from "@mui/material/utils";
43
+ import { Link as Kn } from "react-router-dom";
44
+ const Yn = d(qn)(({ theme: e }) => ({
45
+ display: "block",
46
+ maxWidth: "100%",
47
+ marginBottom: o(e.design.space[2]),
48
+ fontSize: o(e.design.typeScale.small),
49
+ fontWeight: R.medium,
50
+ lineHeight: e.typography.caption.lineHeight,
51
+ color: e.design.tokens["text.secondary"],
52
+ "&.Mui-focused": { color: e.design.tokens["text.secondary"] },
53
+ "&.Mui-error": { color: e.design.tokens["status.danger"] },
54
+ "&.Mui-disabled": { color: e.design.tokens["text.muted"] }
55
+ }));
56
+ function Be({
57
+ label: e,
58
+ help: n,
59
+ error: t,
60
+ required: r = !1,
61
+ children: s
62
+ }) {
63
+ const c = D(), a = s.props.id ?? c, l = `${a}-label`, f = n !== void 0 ? `${a}-help` : void 0, v = t != null && t !== !1 && t !== "", b = v && t !== !0, g = b ? `${a}-error` : void 0, h = [s.props["aria-describedby"], f, g].filter((p) => p !== void 0 && p !== "").join(" ") || void 0, m = fn(s, {
64
+ id: a,
65
+ "aria-describedby": h,
66
+ ...Un(s, ["Select"]) && { labelId: l }
67
+ });
68
+ return /* @__PURE__ */ x(le, { fullWidth: !0, error: v, required: r, children: [
69
+ /* @__PURE__ */ i(Yn, { id: l, htmlFor: a, children: e }),
70
+ m,
71
+ n !== void 0 && /* @__PURE__ */ i(se, { id: f, error: !1, children: n }),
72
+ b && /* @__PURE__ */ i(se, { id: g, children: t })
73
+ ] });
74
+ }
75
+ var Ve = /* @__PURE__ */ ((e) => (e.Info = "info", e.Success = "success", e.Warning = "warning", e.Danger = "danger", e))(Ve || {});
76
+ const je = {
77
+ info: { solid: "status.info", soft: "status.info.soft" },
78
+ success: {
79
+ solid: "status.success",
80
+ soft: "status.success.soft"
81
+ },
82
+ warning: {
83
+ solid: "status.warning",
84
+ soft: "status.warning.soft"
85
+ },
86
+ danger: {
87
+ solid: "status.danger",
88
+ soft: "status.danger.soft"
89
+ }
90
+ }, Xn = {
91
+ info: $n,
92
+ success: An,
93
+ warning: Dn,
94
+ danger: Ln
95
+ }, Qn = d("div", {
96
+ shouldForwardProp: (e) => e !== "severity"
97
+ })(({ theme: e, severity: n }) => {
98
+ const { tokens: t, space: r, radii: s, fonts: c, typeScale: a } = e.design, { solid: l, soft: f } = je[n];
99
+ return {
100
+ display: "flex",
101
+ alignItems: "flex-start",
102
+ gap: o(r[3]),
103
+ minWidth: 0,
104
+ boxSizing: "border-box",
105
+ padding: `${o(r[3])} ${o(r[3])} ${o(r[3])} ${o(r[4])}`,
106
+ backgroundColor: t[f],
107
+ border: A(t[l]),
108
+ borderRadius: o(s.md),
109
+ color: t["text.primary"],
110
+ fontFamily: c.sans,
111
+ fontSize: o(a.body)
112
+ };
113
+ }), Zn = d("span", {
114
+ shouldForwardProp: (e) => e !== "severity"
115
+ })(({ theme: e, severity: n }) => {
116
+ const { tokens: t, space: r } = e.design;
117
+ return {
118
+ display: "inline-flex",
119
+ flex: "none",
120
+ // Centered on the first line of text.
121
+ paddingTop: o(r[1] / 2),
122
+ color: t[je[n].solid],
123
+ "& svg": {
124
+ width: o(r[4] + r[1]),
125
+ height: o(r[4] + r[1])
126
+ }
127
+ };
128
+ }), Jn = d("div")(({ theme: e }) => ({
129
+ display: "flex",
130
+ flex: "1 1 auto",
131
+ flexWrap: "wrap",
132
+ alignItems: "center",
133
+ columnGap: o(e.design.space[4]),
134
+ rowGap: o(e.design.space[2]),
135
+ minWidth: 0,
136
+ [Z.down(K.Tablet)]: {
137
+ flexDirection: "column",
138
+ alignItems: "flex-start"
139
+ }
140
+ })), et = d("div")(({ theme: e }) => ({
141
+ display: "flex",
142
+ flexDirection: "column",
143
+ gap: o(e.design.space[1]),
144
+ flex: "1 1 auto",
145
+ minWidth: 0,
146
+ paddingTop: o(e.design.space[1] / 2),
147
+ lineHeight: e.typography.body2.lineHeight,
148
+ overflowWrap: "anywhere"
149
+ })), nt = d("strong")({
150
+ display: "block",
151
+ fontWeight: R.semibold
152
+ }), tt = d("div")({
153
+ display: "flex",
154
+ flex: "none",
155
+ alignItems: "center"
156
+ }), ot = d(ae)(({ theme: e }) => yn(e));
157
+ function rt({
158
+ severity: e,
159
+ title: n,
160
+ children: t,
161
+ action: r,
162
+ onClose: s,
163
+ icon: c
164
+ }) {
165
+ const a = L(), l = D(), f = Xn[e];
166
+ return /* @__PURE__ */ x(
167
+ Qn,
168
+ {
169
+ severity: e,
170
+ role: e === "danger" ? "alert" : "status",
171
+ "aria-labelledby": n !== void 0 ? l : void 0,
172
+ "data-severity": e,
173
+ children: [
174
+ /* @__PURE__ */ i(Zn, { severity: e, "aria-hidden": !0, children: c ?? /* @__PURE__ */ i(f, {}) }),
175
+ /* @__PURE__ */ x(Jn, { children: [
176
+ /* @__PURE__ */ x(et, { children: [
177
+ n !== void 0 && /* @__PURE__ */ i(nt, { id: l, children: n }),
178
+ /* @__PURE__ */ i("div", { children: t })
179
+ ] }),
180
+ r !== void 0 && /* @__PURE__ */ i(tt, { children: r })
181
+ ] }),
182
+ s !== void 0 && /* @__PURE__ */ i(
183
+ ot,
184
+ {
185
+ size: "small",
186
+ "aria-label": a.formatMessage({ id: "ds.states.callout.close" }),
187
+ onClick: s,
188
+ children: /* @__PURE__ */ i(Ne, { "aria-hidden": !0 })
189
+ }
190
+ )
191
+ ]
192
+ }
193
+ );
194
+ }
195
+ const U = (e) => e.id ?? e.name, Ge = (e, n, t) => (n === void 0 || e.sizeOctet <= n) && xn(e, t), qe = (e, n, t) => [
196
+ ...(e.childFile ?? []).filter(
197
+ (r) => Ge(r, n, t)
198
+ ),
199
+ ...(e.childFolder ?? []).flatMap(
200
+ (r) => qe(r, n, t)
201
+ )
202
+ ], ue = d("div", {
203
+ shouldForwardProp: (e) => e !== "selected"
204
+ })(({ theme: e, selected: n }) => {
205
+ const { tokens: t, space: r, radii: s, densityValues: c, density: a, typeScale: l } = e.design;
206
+ return {
207
+ display: "flex",
208
+ alignItems: "center",
209
+ gap: o(r[1]),
210
+ minHeight: o(c[a].control),
211
+ borderRadius: o(s.md),
212
+ backgroundColor: n ? de(t.accent) : "transparent",
213
+ fontSize: o(l.body),
214
+ color: t["text.primary"],
215
+ ...$e(e)
216
+ };
217
+ }), Ue = (e) => {
218
+ const { tokens: n, space: t, radii: r, fonts: s } = e.design;
219
+ return {
220
+ flex: "1 1 auto",
221
+ minWidth: 0,
222
+ display: "flex",
223
+ alignItems: "center",
224
+ gap: o(t[2]),
225
+ alignSelf: "stretch",
226
+ margin: 0,
227
+ padding: `0 ${o(t[2])}`,
228
+ border: "none",
229
+ borderRadius: o(r.md),
230
+ background: "none",
231
+ color: "inherit",
232
+ font: "inherit",
233
+ fontFamily: s.sans,
234
+ textAlign: "left",
235
+ cursor: "pointer",
236
+ transition: oe(e, ["background-color"]),
237
+ "&:hover": { backgroundColor: n["bg.hover"] },
238
+ "&:focus-visible": te(e)
239
+ };
240
+ }, Ke = d("button")(({ theme: e }) => Ue(e)), it = d("label")(({ theme: e }) => Ue(e)), Ye = d("span", {
241
+ shouldForwardProp: (e) => e !== "strong"
242
+ })(({ strong: e }) => ({
243
+ flex: "1 1 auto",
244
+ minWidth: 0,
245
+ overflow: "hidden",
246
+ textOverflow: "ellipsis",
247
+ whiteSpace: "nowrap",
248
+ fontWeight: e ? R.medium : R.regular
249
+ })), Xe = d("span")(({ theme: e }) => {
250
+ const { tokens: n, space: t, radii: r } = e.design;
251
+ return {
252
+ display: "inline-flex",
253
+ flex: "none",
254
+ alignItems: "center",
255
+ justifyContent: "center",
256
+ width: o(t[5]),
257
+ height: o(t[5]),
258
+ overflow: "hidden",
259
+ borderRadius: o(r.sm),
260
+ color: n["text.muted"],
261
+ "& svg": { width: o(t[5]), height: o(t[5]) },
262
+ "& img": { width: "100%", height: "100%", objectFit: "cover" }
263
+ };
264
+ }), st = d(_n, {
265
+ shouldForwardProp: (e) => e !== "open"
266
+ })(({ theme: e, open: n }) => ({
267
+ flex: "none",
268
+ width: o(e.design.space[4]),
269
+ height: o(e.design.space[4]),
270
+ color: e.design.tokens["text.muted"],
271
+ transform: n ? "rotate(90deg)" : "none",
272
+ transition: oe(e, ["transform"])
273
+ })), Qe = d(Pn)(({ theme: e }) => ({
274
+ [Z.down(K.Tablet)]: {
275
+ padding: o(
276
+ (e.design.densityValues.touchTarget - e.design.space[5]) / 2
277
+ )
278
+ }
279
+ })), at = d("ul")(({ theme: e }) => ({
280
+ margin: 0,
281
+ padding: 0,
282
+ listStyle: "none",
283
+ borderLeft: A(e.design.tokens["border.subtle"]),
284
+ marginLeft: o(e.design.space[3])
285
+ })), Me = d("li")({ listStyle: "none" });
286
+ function Ze({
287
+ folders: e,
288
+ files: n,
289
+ context: t
290
+ }) {
291
+ return /* @__PURE__ */ x(J, { children: [
292
+ e.map((r) => /* @__PURE__ */ i(Me, { children: /* @__PURE__ */ i(ct, { folder: r, context: t }) }, r.id ?? r.name)),
293
+ n.filter((r) => Ge(r, t.maxSize, t.accept)).map((r) => /* @__PURE__ */ i(Me, { children: /* @__PURE__ */ i(dt, { file: r, context: t }) }, U(r)))
294
+ ] });
295
+ }
296
+ function lt({
297
+ file: e,
298
+ getFileThumbnailUrl: n
299
+ }) {
300
+ const [t, r] = I(!1), s = e.thumbnailPublicAccessId !== null && !e.isEncrypt && !t ? n(e.thumbnailPublicAccessId) : null;
301
+ return /* @__PURE__ */ i(Xe, { "aria-hidden": !0, children: s !== null ? /* @__PURE__ */ i(
302
+ "img",
303
+ {
304
+ src: s,
305
+ alt: "",
306
+ draggable: !1,
307
+ onError: () => r(!0)
308
+ }
309
+ ) : /* @__PURE__ */ i(Hn, {}) });
310
+ }
311
+ function dt({
312
+ file: e,
313
+ context: n
314
+ }) {
315
+ const t = D(), r = n.selectedIds.has(U(e)), s = () => r ? n.unselect([e]) : n.select([e]), c = /* @__PURE__ */ x(J, { children: [
316
+ /* @__PURE__ */ i(
317
+ lt,
318
+ {
319
+ file: e,
320
+ getFileThumbnailUrl: n.getFileThumbnailUrl
321
+ }
322
+ ),
323
+ /* @__PURE__ */ i(Ye, { strong: r, title: e.name, children: e.name })
324
+ ] });
325
+ return n.multiple ? /* @__PURE__ */ x(ue, { selected: r, children: [
326
+ /* @__PURE__ */ i(
327
+ Qe,
328
+ {
329
+ id: t,
330
+ size: "small",
331
+ checked: r,
332
+ onChange: s
333
+ }
334
+ ),
335
+ /* @__PURE__ */ i(it, { htmlFor: t, children: c })
336
+ ] }) : /* @__PURE__ */ i(ue, { selected: r, children: /* @__PURE__ */ i(Ke, { type: "button", "aria-pressed": r, onClick: s, children: c }) });
337
+ }
338
+ function ct({
339
+ folder: e,
340
+ context: n
341
+ }) {
342
+ const t = L(), r = D(), [s, c] = I(!1), a = qe(e, n.maxSize, n.accept), l = a.filter(
343
+ (v) => n.selectedIds.has(U(v))
344
+ ).length, f = a.length > 0 && l === a.length;
345
+ return /* @__PURE__ */ x(J, { children: [
346
+ /* @__PURE__ */ x(ue, { selected: f, children: [
347
+ n.multiple && /* @__PURE__ */ i(
348
+ Qe,
349
+ {
350
+ size: "small",
351
+ checked: f,
352
+ indeterminate: l > 0 && !f,
353
+ disabled: a.length === 0,
354
+ onChange: () => f ? n.unselect(a) : n.select(a),
355
+ inputProps: {
356
+ "aria-label": t.formatMessage(
357
+ { id: "ds.business.cloud-import.select-folder" },
358
+ { name: e.name }
359
+ )
360
+ }
361
+ }
362
+ ),
363
+ /* @__PURE__ */ x(
364
+ Ke,
365
+ {
366
+ type: "button",
367
+ "aria-expanded": s,
368
+ "aria-controls": s ? r : void 0,
369
+ onClick: () => c(!s),
370
+ children: [
371
+ /* @__PURE__ */ i(st, { open: s, "aria-hidden": !0 }),
372
+ /* @__PURE__ */ i(Xe, { "aria-hidden": !0, children: s ? /* @__PURE__ */ i(He, {}) : /* @__PURE__ */ i(Nn, {}) }),
373
+ /* @__PURE__ */ i(Ye, { strong: f, title: e.name, children: e.name })
374
+ ]
375
+ }
376
+ )
377
+ ] }),
378
+ s && /* @__PURE__ */ i(at, { id: r, children: /* @__PURE__ */ i(
379
+ Ze,
380
+ {
381
+ folders: e.childFolder ?? [],
382
+ files: e.childFile ?? [],
383
+ context: n
384
+ }
385
+ ) })
386
+ ] });
387
+ }
388
+ const We = "shared", Oe = {
389
+ "org-common": 0,
390
+ "perso-in-org": 1,
391
+ project: 2,
392
+ personal: 3
393
+ }, ut = d("div")(({ theme: e }) => ({
394
+ display: "flex",
395
+ flexDirection: "column",
396
+ gap: o(e.design.space[3]),
397
+ minWidth: 0
398
+ })), pt = d("div")(({ theme: e }) => ({
399
+ display: "flex",
400
+ alignItems: "flex-end",
401
+ gap: o(e.design.space[2]),
402
+ minWidth: 0,
403
+ // The Space field takes the room the two icon buttons leave.
404
+ [`& > .${ke.root}`]: { flex: "1 1 auto", minWidth: 0 },
405
+ [`& > :not(.${ke.root})`]: { flex: "none" }
406
+ })), gt = d("p")(({ theme: e }) => ({
407
+ margin: 0,
408
+ fontSize: o(e.design.typeScale.small),
409
+ color: e.design.tokens["text.muted"]
410
+ })), ft = d("ul")(({ theme: e }) => {
411
+ const { tokens: n, space: t, radii: r } = e.design;
412
+ return {
413
+ margin: 0,
414
+ padding: o(t[1]),
415
+ listStyle: "none",
416
+ minHeight: o(t[10] * 3),
417
+ border: A(n["border.subtle"]),
418
+ borderRadius: o(r.md)
419
+ };
420
+ }), ne = d("div")(({ theme: e }) => {
421
+ const { tokens: n, space: t, typeScale: r } = e.design;
422
+ return {
423
+ display: "flex",
424
+ flexDirection: "column",
425
+ alignItems: "center",
426
+ justifyContent: "center",
427
+ gap: o(t[3]),
428
+ minHeight: o(t[10] * 3),
429
+ padding: o(t[5]),
430
+ textAlign: "center",
431
+ fontSize: o(r.body),
432
+ color: n["text.secondary"],
433
+ "& > svg": {
434
+ width: o(t[7]),
435
+ height: o(t[7]),
436
+ color: n["text.muted"]
437
+ }
438
+ };
439
+ }), mt = d("span")(({ theme: e }) => {
440
+ const { tokens: n, space: t, radii: r } = e.design;
441
+ return {
442
+ display: "inline-flex",
443
+ alignItems: "center",
444
+ justifyContent: "center",
445
+ width: o(t[9] + t[2]),
446
+ height: o(t[9] + t[2]),
447
+ borderRadius: o(r.lg),
448
+ backgroundColor: de(n["status.warning"]),
449
+ color: n["status.warning"],
450
+ "& svg": { width: o(t[6]), height: o(t[6]) }
451
+ };
452
+ }), ht = d("p")(({ theme: e }) => ({
453
+ margin: 0,
454
+ fontWeight: R.semibold,
455
+ color: e.design.tokens["text.primary"]
456
+ })), bt = d("p")({ margin: 0 }), yt = d("div")(({ theme: e }) => ({
457
+ display: "flex",
458
+ flexWrap: "wrap",
459
+ alignItems: "center",
460
+ justifyContent: "space-between",
461
+ gap: o(e.design.space[3])
462
+ })), vt = d("span")(({ theme: e }) => ({
463
+ fontSize: o(e.design.typeScale.body),
464
+ color: e.design.tokens["text.secondary"]
465
+ })), wt = d("li")(({ theme: e }) => ({
466
+ display: "flex",
467
+ alignItems: "center",
468
+ gap: o(e.design.space[2]),
469
+ ...$e(e)
470
+ })), xt = d("span")({
471
+ display: "flex",
472
+ flexDirection: "column",
473
+ minWidth: 0
474
+ }), Ct = d("span")({
475
+ overflow: "hidden",
476
+ textOverflow: "ellipsis",
477
+ whiteSpace: "nowrap"
478
+ }), kt = d("span")(({ theme: e }) => ({
479
+ fontSize: o(e.design.typeScale.caption),
480
+ color: e.design.tokens["text.muted"],
481
+ // A narrow screen wraps it: the scope and the organization tell same-named Spaces apart.
482
+ overflowWrap: "anywhere"
483
+ })), Je = d("span")(({ theme: e }) => {
484
+ const { tokens: n, space: t, radii: r } = e.design;
485
+ return {
486
+ display: "inline-flex",
487
+ flex: "none",
488
+ alignItems: "center",
489
+ justifyContent: "center",
490
+ minWidth: o(t[5]),
491
+ height: o(t[5]),
492
+ borderRadius: o(r.sm),
493
+ color: n["accent.text"],
494
+ "& > svg": { width: o(t[4]), height: o(t[4]) }
495
+ };
496
+ }), St = d(Je)(({ theme: e }) => ({
497
+ marginRight: o(e.design.space[2])
498
+ })), It = d("li")({ listStyle: "none" }), Ft = d("div")(({ theme: e }) => {
499
+ const { space: n, tokens: t, typeScale: r } = e.design;
500
+ return {
501
+ padding: `${o(n[2])} ${o(n[3])} ${o(n[1])}`,
502
+ fontSize: o(r.caption),
503
+ fontWeight: R.semibold,
504
+ letterSpacing: "0.05em",
505
+ textTransform: "uppercase",
506
+ color: t["text.muted"]
507
+ };
508
+ }), Mt = d("ul")({ margin: 0, padding: 0 });
509
+ function Wt({
510
+ cloudPicker: e,
511
+ onImport: n,
512
+ multiple: t = !1,
513
+ maxSize: r,
514
+ accept: s
515
+ }) {
516
+ const {
517
+ abyssCloudUrl: c,
518
+ getFileThumbnailUrl: a,
519
+ getSpaceDisplay: l,
520
+ clouds: f,
521
+ cloudShares: v,
522
+ isLoading: b,
523
+ hasError: g,
524
+ refresh: h,
525
+ onCreateCloud: m,
526
+ fetchCloudRepository: p
527
+ } = e, u = L(), [y, C] = I(null), [F, P] = I(null), [O, H] = I(
528
+ "loading"
529
+ /* Loading */
530
+ ), [V, T] = I([]), [M, ee] = I(!1), [re, N] = I(!1), j = ge(() => {
531
+ const w = [], S = /* @__PURE__ */ new Map(), k = u.formatMessage({
532
+ id: "ds.business.cloud-import.section-organization"
533
+ });
534
+ for (const W of f ?? []) {
535
+ if (!W.organizationId) {
536
+ w.push(W);
537
+ continue;
538
+ }
539
+ const z = l == null ? void 0 : l(W), _ = S.get(W.organizationId) ?? {
540
+ name: (z == null ? void 0 : z.organizationName) ?? k,
541
+ items: []
542
+ };
543
+ _.items.push(W), S.set(W.organizationId, _);
544
+ }
545
+ if (l)
546
+ for (const W of S.values())
547
+ W.items.sort((z, _) => {
548
+ const E = Oe[l(z).scope ?? "personal"], we = Oe[l(_).scope ?? "personal"];
549
+ return E !== we ? E - we : l(z).label.localeCompare(l(_).label);
550
+ });
551
+ const $ = (W, z) => (_) => {
552
+ const E = l == null ? void 0 : l(_);
553
+ return {
554
+ space: _,
555
+ sectionKey: W,
556
+ sectionLabel: z,
557
+ label: (E == null ? void 0 : E.label) ?? kn(_, u),
558
+ subtitle: E == null ? void 0 : E.subtitle,
559
+ avatar: E == null ? void 0 : E.avatar
560
+ };
561
+ };
562
+ return [
563
+ ...w.map(
564
+ $(
565
+ "personal",
566
+ u.formatMessage({
567
+ id: "ds.business.cloud-import.section-personal"
568
+ })
569
+ )
570
+ ),
571
+ ...[...S].flatMap(
572
+ ([W, z]) => z.items.map($(`org:${W}`, z.name))
573
+ ),
574
+ ...(v ?? []).map(
575
+ $(
576
+ We,
577
+ u.formatMessage({ id: "ds.business.cloud-import.section-shared" })
578
+ )
579
+ )
580
+ ];
581
+ }, [f, v, l, u]), G = j.find((w) => w.space.id === (y == null ? void 0 : y.id)) ?? null, ce = Y(0), me = Y(p);
582
+ me.current = p;
583
+ const ie = Q(async (w) => {
584
+ const S = ++ce.current;
585
+ H(
586
+ "loading"
587
+ /* Loading */
588
+ ), T([]);
589
+ try {
590
+ if (w.id === void 0)
591
+ throw new Error("A Space without an id has no tree");
592
+ const k = await me.current(w.id);
593
+ S === ce.current && (P(k), H(
594
+ "ready"
595
+ /* Ready */
596
+ ));
597
+ } catch {
598
+ S === ce.current && H(
599
+ "failed"
600
+ /* Failed */
601
+ );
602
+ }
603
+ }, []), ln = Y(h);
604
+ B(() => {
605
+ ln.current();
606
+ }, []), B(() => {
607
+ if (y && j.some((k) => k.space.id === y.id))
608
+ return;
609
+ const w = j.map((k) => k.space), S = w.find(
610
+ (k) => !!k.userId && !k.organizationId && !k.projectId
611
+ );
612
+ C(S ?? w[0] ?? null);
613
+ }, [j, y]), B(() => {
614
+ y && ie(y);
615
+ }, [y, ie]);
616
+ const dn = async () => {
617
+ if (N(!1), !await h()) {
618
+ N(!0);
619
+ return;
620
+ }
621
+ y && await ie(y);
622
+ }, cn = async () => {
623
+ ee(!0);
624
+ try {
625
+ await m();
626
+ } finally {
627
+ ee(!1);
628
+ }
629
+ }, un = {
630
+ multiple: t,
631
+ maxSize: r,
632
+ accept: s,
633
+ selectedIds: new Set(V.map(U)),
634
+ getFileThumbnailUrl: a,
635
+ select: (w) => T((S) => {
636
+ if (!t)
637
+ return w.slice(0, 1);
638
+ const k = new Set(S.map(U));
639
+ return [
640
+ ...S,
641
+ ...w.filter(($) => !k.has(U($)))
642
+ ];
643
+ }),
644
+ unselect: (w) => {
645
+ const S = new Set(w.map(U));
646
+ T(
647
+ (k) => k.filter(($) => !S.has(U($)))
648
+ );
649
+ }
650
+ }, pn = f !== null && v !== null, he = /* @__PURE__ */ i(ne, { children: /* @__PURE__ */ i(
651
+ Se,
652
+ {
653
+ size: 32,
654
+ "aria-label": u.formatMessage({
655
+ id: "ds.business.cloud-import.loading"
656
+ })
657
+ }
658
+ ) });
659
+ if (!pn && (b || !g))
660
+ return he;
661
+ if (j.length === 0)
662
+ return /* @__PURE__ */ x(ne, { children: [
663
+ /* @__PURE__ */ i(mt, { "aria-hidden": !0, children: /* @__PURE__ */ i(Tn, {}) }),
664
+ /* @__PURE__ */ i(ht, { children: u.formatMessage({
665
+ id: "ds.business.cloud-import.create-error.title"
666
+ }) }),
667
+ /* @__PURE__ */ i(bt, { children: u.formatMessage({
668
+ id: "ds.business.cloud-import.create-error.description"
669
+ }) }),
670
+ /* @__PURE__ */ i(
671
+ X,
672
+ {
673
+ variant: "contained",
674
+ startIcon: /* @__PURE__ */ i(Fe, { "aria-hidden": !0 }),
675
+ loading: M || b,
676
+ onClick: () => void cn(),
677
+ children: u.formatMessage({
678
+ id: "ds.business.cloud-import.create-error.create-button"
679
+ })
680
+ }
681
+ )
682
+ ] });
683
+ if (G === null)
684
+ return he;
685
+ const gn = Cn(
686
+ c,
687
+ G.space,
688
+ G.sectionKey === We
689
+ ), be = u.formatMessage({
690
+ id: "ds.business.cloud-import.refresh"
691
+ }), ye = u.formatMessage({
692
+ id: "ds.business.cloud-import.open-in-cloud"
693
+ }), ve = (w) => w.avatar ?? /* @__PURE__ */ i(Fe, {});
694
+ return /* @__PURE__ */ x(ut, { children: [
695
+ re && /* @__PURE__ */ i(
696
+ rt,
697
+ {
698
+ severity: Ve.Danger,
699
+ onClose: () => N(!1),
700
+ children: u.formatMessage({ id: "ds.business.cloud-import.refresh-error" })
701
+ }
702
+ ),
703
+ /* @__PURE__ */ x(pt, { children: [
704
+ /* @__PURE__ */ i(
705
+ On,
706
+ {
707
+ fullWidth: !0,
708
+ disableClearable: !0,
709
+ options: j,
710
+ value: G,
711
+ groupBy: (w) => w.sectionLabel,
712
+ getOptionLabel: (w) => w.label,
713
+ isOptionEqualToValue: (w, S) => w.space.id === S.space.id,
714
+ onChange: (w, S) => C(S.space),
715
+ filterOptions: (w, { inputValue: S }) => {
716
+ const k = S.trim().toLowerCase();
717
+ return k === "" || k === G.label.toLowerCase() ? w : w.filter(
718
+ ($) => [$.label, $.subtitle ?? ""].some(
719
+ (W) => W.toLowerCase().includes(k)
720
+ )
721
+ );
722
+ },
723
+ renderGroup: (w) => /* @__PURE__ */ x(It, { children: [
724
+ /* @__PURE__ */ i(Ft, { children: w.group }),
725
+ /* @__PURE__ */ i(Mt, { children: w.children })
726
+ ] }, w.key),
727
+ renderOption: ({ key: w, ...S }, k) => /* @__PURE__ */ x(wt, { ...S, children: [
728
+ /* @__PURE__ */ i(Je, { "aria-hidden": !0, children: ve(k) }),
729
+ /* @__PURE__ */ x(xt, { children: [
730
+ /* @__PURE__ */ i(Ct, { children: k.label }),
731
+ k.subtitle !== void 0 && /* @__PURE__ */ i(kt, { children: k.subtitle })
732
+ ] })
733
+ ] }, w),
734
+ renderInput: (w) => /* @__PURE__ */ i(
735
+ Be,
736
+ {
737
+ label: u.formatMessage({
738
+ id: "ds.business.cloud-import.space-label"
739
+ }),
740
+ children: /* @__PURE__ */ i(
741
+ fe,
742
+ {
743
+ ...w.InputProps,
744
+ id: w.id,
745
+ fullWidth: !0,
746
+ inputProps: w.inputProps,
747
+ startAdornment: /* @__PURE__ */ i(St, { "aria-hidden": !0, children: ve(G) })
748
+ }
749
+ )
750
+ }
751
+ )
752
+ }
753
+ ),
754
+ /* @__PURE__ */ i(Ie, { title: be, children: /* @__PURE__ */ i("span", { children: /* @__PURE__ */ i(
755
+ ae,
756
+ {
757
+ "aria-label": be,
758
+ disabled: O === "loading" || b,
759
+ onClick: () => void dn(),
760
+ children: /* @__PURE__ */ i(zn, { "aria-hidden": !0 })
761
+ }
762
+ ) }) }),
763
+ /* @__PURE__ */ i(Ie, { title: ye, children: /* @__PURE__ */ i(
764
+ ae,
765
+ {
766
+ component: "a",
767
+ href: gn,
768
+ target: "_blank",
769
+ rel: "noreferrer",
770
+ "aria-label": ye,
771
+ children: /* @__PURE__ */ i(En, { "aria-hidden": !0 })
772
+ }
773
+ ) })
774
+ ] }),
775
+ /* @__PURE__ */ i(gt, { children: u.formatMessage({ id: "ds.business.cloud-import.filtered-hint" }) }),
776
+ O === "loading" && /* @__PURE__ */ i(ne, { children: /* @__PURE__ */ i(
777
+ Se,
778
+ {
779
+ size: 24,
780
+ "aria-label": u.formatMessage({
781
+ id: "ds.business.cloud-import.tree-loading"
782
+ })
783
+ }
784
+ ) }),
785
+ O === "failed" && /* @__PURE__ */ x(ne, { role: "alert", children: [
786
+ u.formatMessage({ id: "ds.business.cloud-import.tree-error" }),
787
+ /* @__PURE__ */ i(
788
+ X,
789
+ {
790
+ variant: "outlined",
791
+ onClick: () => void ie(G.space),
792
+ children: u.formatMessage({ id: "ds.business.cloud-import.retry" })
793
+ }
794
+ )
795
+ ] }),
796
+ O === "ready" && F !== null && (F.folders.length === 0 && F.files.length === 0 ? /* @__PURE__ */ x(ne, { children: [
797
+ /* @__PURE__ */ i(He, { "aria-hidden": !0 }),
798
+ u.formatMessage({ id: "ds.business.cloud-import.empty-space" })
799
+ ] }) : /* @__PURE__ */ i(
800
+ ft,
801
+ {
802
+ "aria-label": u.formatMessage({
803
+ id: "ds.business.cloud-import.tree-label"
804
+ }),
805
+ children: /* @__PURE__ */ i(
806
+ Ze,
807
+ {
808
+ folders: F.folders,
809
+ files: F.files,
810
+ context: un
811
+ }
812
+ )
813
+ }
814
+ )),
815
+ /* @__PURE__ */ x(yt, { children: [
816
+ /* @__PURE__ */ i(vt, { role: "status", children: u.formatMessage(
817
+ { id: "ds.business.cloud-import.selected" },
818
+ { count: V.length }
819
+ ) }),
820
+ /* @__PURE__ */ i(
821
+ X,
822
+ {
823
+ variant: "contained",
824
+ startIcon: /* @__PURE__ */ i(Rn, { "aria-hidden": !0 }),
825
+ disabled: V.length === 0,
826
+ onClick: () => n(G.space, V),
827
+ children: u.formatMessage({ id: "ds.business.cloud-import.import" })
828
+ }
829
+ )
830
+ ] })
831
+ ] });
832
+ }
833
+ function Ot({
834
+ open: e,
835
+ onClose: n,
836
+ onImport: t,
837
+ cloudPicker: r,
838
+ multiple: s,
839
+ maxSize: c,
840
+ accept: a
841
+ }) {
842
+ const l = L();
843
+ return /* @__PURE__ */ i(
844
+ De,
845
+ {
846
+ open: e,
847
+ onClose: n,
848
+ size: Pe.Medium,
849
+ title: l.formatMessage({ id: "ds.business.cloud-import.title" }),
850
+ children: e && /* @__PURE__ */ i(
851
+ Wt,
852
+ {
853
+ cloudPicker: r,
854
+ multiple: s,
855
+ maxSize: c,
856
+ accept: a,
857
+ onImport: (f, v) => {
858
+ t(f, v), n();
859
+ }
860
+ }
861
+ )
862
+ }
863
+ );
864
+ }
865
+ var en = /* @__PURE__ */ ((e) => (e.Medium = "medium", e.Compact = "compact", e))(en || {});
866
+ const Tt = Ee(
867
+ "medium"
868
+ /* Medium */
869
+ ), Rt = d(le)(({ theme: e }) => ({
870
+ // Three times the largest spacing step: room for a label and the arrow.
871
+ minWidth: o(e.design.space[10] * 3),
872
+ maxWidth: "100%"
873
+ })), Et = d(Le)(({ theme: e }) => ({
874
+ position: "relative",
875
+ transform: "none",
876
+ maxWidth: "100%",
877
+ pointerEvents: "auto",
878
+ marginBottom: o(e.design.space[2]),
879
+ fontSize: o(e.design.typeScale.small),
880
+ fontWeight: R.medium,
881
+ lineHeight: e.typography.caption.lineHeight,
882
+ color: e.design.tokens["text.secondary"],
883
+ "&.Mui-focused": { color: e.design.tokens["text.secondary"] },
884
+ "&.Mui-error": { color: e.design.tokens["status.danger"] },
885
+ "&.Mui-disabled": { color: e.design.tokens["text.muted"] }
886
+ })), zt = d("span")(({ theme: e }) => ({
887
+ display: "flex",
888
+ alignItems: "center",
889
+ gap: o(e.design.space[2]),
890
+ minWidth: 0
891
+ })), At = d("i", {
892
+ shouldForwardProp: (e) => e !== "token"
893
+ })(({ theme: e, token: n }) => ({
894
+ flex: "none",
895
+ width: o(e.design.space[2]),
896
+ height: o(e.design.space[2]),
897
+ borderRadius: o(e.design.radii.sm / 2),
898
+ backgroundColor: e.design.tokens[n]
899
+ })), Lt = d("span")({
900
+ display: "flex",
901
+ flexDirection: "column",
902
+ minWidth: 0
903
+ }), $t = d("span")(({ theme: e }) => ({
904
+ fontSize: o(e.design.typeScale.caption),
905
+ color: e.design.tokens["text.muted"],
906
+ whiteSpace: "normal"
907
+ })), pe = d("span")({
908
+ overflow: "hidden",
909
+ textOverflow: "ellipsis",
910
+ whiteSpace: "nowrap"
911
+ }), Dt = d(pe)(({ theme: e }) => ({
912
+ color: e.design.tokens["text.muted"]
913
+ }));
914
+ function hr({
915
+ label: e,
916
+ options: n,
917
+ value: t,
918
+ onChange: r,
919
+ multiple: s = !1,
920
+ disabled: c,
921
+ error: a,
922
+ size: l
923
+ }) {
924
+ const f = L(), v = ze(Tt), b = (l ?? v) === en.Compact, g = b ? Rt : le, h = D(), m = `${h}-label`, p = `${h}-helper`, u = new Map(n.map((C) => [C.value, C]));
925
+ return /* @__PURE__ */ x(g, { fullWidth: !b, disabled: c, error: !!a, children: [
926
+ /* @__PURE__ */ i(
927
+ Et,
928
+ {
929
+ id: m,
930
+ shrink: !0,
931
+ style: b ? bn : void 0,
932
+ children: e
933
+ }
934
+ ),
935
+ /* @__PURE__ */ x(
936
+ mn,
937
+ {
938
+ labelId: m,
939
+ multiple: s,
940
+ value: t,
941
+ displayEmpty: !0,
942
+ renderValue: (C) => {
943
+ const F = Array.isArray(C) ? C : [C];
944
+ return b && F.length === 0 ? /* @__PURE__ */ i(Dt, { "aria-hidden": !0, children: e }) : /* @__PURE__ */ i(pe, { children: F.map((P) => {
945
+ var O;
946
+ return ((O = u.get(P)) == null ? void 0 : O.label) ?? P;
947
+ }).join(", ") });
948
+ },
949
+ "aria-describedby": a ? p : void 0,
950
+ onChange: (C) => r(C.target.value),
951
+ children: [
952
+ n.length === 0 && /* @__PURE__ */ i(xe, { disabled: !0, value: "", children: f.formatMessage({ id: "ds.inputs.rich-select.empty" }) }),
953
+ n.map((C) => /* @__PURE__ */ i(xe, { value: C.value, children: /* @__PURE__ */ x(zt, { children: [
954
+ C.tone && /* @__PURE__ */ i(At, { token: C.tone }),
955
+ C.icon,
956
+ /* @__PURE__ */ x(Lt, { children: [
957
+ /* @__PURE__ */ i(pe, { children: C.label }),
958
+ C.description && /* @__PURE__ */ i($t, { children: C.description })
959
+ ] })
960
+ ] }) }, C.value))
961
+ ]
962
+ }
963
+ ),
964
+ a && /* @__PURE__ */ i(se, { id: p, children: a })
965
+ ] });
966
+ }
967
+ const Pt = d("div")(({ theme: e }) => ({
968
+ display: "flex",
969
+ flexDirection: "column",
970
+ gap: o(e.design.space[2]),
971
+ minWidth: 0
972
+ })), Ht = d("span")(({ theme: e }) => ({
973
+ fontSize: o(e.design.typeScale.small),
974
+ fontWeight: R.medium,
975
+ color: e.design.tokens["text.secondary"]
976
+ })), Nt = d("div", {
977
+ shouldForwardProp: (e) => e !== "active"
978
+ })(({ theme: e, active: n }) => {
979
+ const { tokens: t, space: r, radii: s } = e.design;
980
+ return {
981
+ display: "flex",
982
+ flexDirection: "column",
983
+ alignItems: "center",
984
+ justifyContent: "center",
985
+ gap: o(r[3]),
986
+ minHeight: o(r[10] * 3),
987
+ padding: `${o(r[6])} ${o(r[4])}`,
988
+ boxSizing: "border-box",
989
+ border: `1px dashed ${n ? t.accent : t["border.control"]}`,
990
+ borderRadius: o(s.md),
991
+ backgroundColor: n ? de(t.accent) : t["bg.raised"],
992
+ color: t["text.secondary"],
993
+ textAlign: "center",
994
+ cursor: "pointer",
995
+ transition: oe(e, ["border-color", "background-color"]),
996
+ "&:hover": { borderColor: t.accent }
997
+ };
998
+ }), _t = d("span")(({ theme: e }) => {
999
+ const { tokens: n, space: t } = e.design;
1000
+ return {
1001
+ display: "inline-flex",
1002
+ alignItems: "center",
1003
+ justifyContent: "center",
1004
+ width: o(t[9]),
1005
+ height: o(t[9]),
1006
+ borderRadius: "50%",
1007
+ backgroundColor: de(n.accent),
1008
+ color: n["accent.text"],
1009
+ "& svg": { width: o(t[5]), height: o(t[5]) }
1010
+ };
1011
+ }), Bt = d("span")(({ theme: e }) => ({
1012
+ fontSize: o(e.design.typeScale.body),
1013
+ [Z.down(K.Tablet)]: { display: "none" }
1014
+ })), Vt = d("div")(({ theme: e }) => ({
1015
+ display: "flex",
1016
+ flexWrap: "wrap",
1017
+ alignItems: "center",
1018
+ justifyContent: "space-between",
1019
+ gap: o(e.design.space[2])
1020
+ })), jt = d("span")(({ theme: e }) => ({
1021
+ fontSize: o(e.design.typeScale.small),
1022
+ color: e.design.tokens["text.muted"]
1023
+ })), Gt = d("p")(({ theme: e }) => ({
1024
+ margin: 0,
1025
+ fontSize: o(e.design.typeScale.small),
1026
+ color: e.design.tokens["status.danger"]
1027
+ })), qt = d("img")(({ theme: e }) => ({
1028
+ width: o(e.design.space[4]),
1029
+ height: o(e.design.space[4])
1030
+ })), Ut = (e) => {
1031
+ const { value: n, unit: t } = Mn(e);
1032
+ return `${n} ${t}`;
1033
+ };
1034
+ function br({
1035
+ onDrop: e,
1036
+ multiple: n = !0,
1037
+ accept: t,
1038
+ maxSize: r,
1039
+ caption: s,
1040
+ title: c,
1041
+ cloudImport: a,
1042
+ children: l
1043
+ }) {
1044
+ const f = L(), v = D(), b = D(), [g, h] = I(null), [m, p] = I(!1), u = r === void 0 ? null : Ut(r), y = s ?? (u === null ? null : f.formatMessage(
1045
+ { id: "ds.inputs.drop-zone.max-size" },
1046
+ { size: u, multiple: String(n) }
1047
+ )), C = (T, M) => {
1048
+ const ee = r === void 0 ? [] : T.filter((N) => N.size > r), re = T.filter((N) => !ee.includes(N));
1049
+ M.some(
1050
+ (N) => N.errors.some((j) => j.code === Fn.TooManyFiles)
1051
+ ) ? h(
1052
+ "too-many"
1053
+ /* TooMany */
1054
+ ) : M.length > 0 ? h(
1055
+ "rejected-type"
1056
+ /* Rejected */
1057
+ ) : ee.length > 0 ? h(
1058
+ T.length === 1 ? "too-big" : "some-too-big"
1059
+ /* SomeTooBig */
1060
+ ) : h(null), re.length > 0 && e(re);
1061
+ }, { getRootProps: F, getInputProps: P, isDragActive: O, open: H } = Sn({
1062
+ onDrop: C,
1063
+ multiple: n,
1064
+ accept: t,
1065
+ // The zone itself is not a control: the button inside is, for the keyboard and screen readers.
1066
+ noClick: !0,
1067
+ noKeyboard: !0
1068
+ }), V = f.formatMessage(
1069
+ { id: "ds.inputs.drop-zone.browse" },
1070
+ { multiple: String(n) }
1071
+ );
1072
+ return /* @__PURE__ */ x(
1073
+ Pt,
1074
+ {
1075
+ role: "group",
1076
+ "aria-labelledby": c !== void 0 ? v : void 0,
1077
+ "aria-describedby": y !== null ? b : void 0,
1078
+ children: [
1079
+ c !== void 0 && /* @__PURE__ */ i(Ht, { id: v, children: c }),
1080
+ /* @__PURE__ */ x(Nt, { ...F({ onClick: H }), active: O, children: [
1081
+ /* @__PURE__ */ i("input", { ...P({ "aria-hidden": !0 }) }),
1082
+ l ?? /* @__PURE__ */ x(J, { children: [
1083
+ /* @__PURE__ */ i(_t, { "aria-hidden": !0, children: /* @__PURE__ */ i(Wn, {}) }),
1084
+ /* @__PURE__ */ i(Bt, { children: f.formatMessage(
1085
+ {
1086
+ id: O ? "ds.inputs.drop-zone.release" : "ds.inputs.drop-zone.prompt"
1087
+ },
1088
+ { multiple: String(n) }
1089
+ ) })
1090
+ ] }),
1091
+ /* @__PURE__ */ i(
1092
+ X,
1093
+ {
1094
+ variant: "outlined",
1095
+ onClick: (T) => {
1096
+ T.stopPropagation(), H();
1097
+ },
1098
+ children: V
1099
+ }
1100
+ )
1101
+ ] }),
1102
+ (a !== void 0 || y !== null) && /* @__PURE__ */ x(Vt, { children: [
1103
+ a !== void 0 && /* @__PURE__ */ i(
1104
+ X,
1105
+ {
1106
+ variant: "text",
1107
+ startIcon: /* @__PURE__ */ i(qt, { src: In, alt: "" }),
1108
+ onClick: () => p(!0),
1109
+ children: f.formatMessage({ id: "ds.inputs.drop-zone.cloud" })
1110
+ }
1111
+ ),
1112
+ y !== null && /* @__PURE__ */ i(jt, { id: b, children: y })
1113
+ ] }),
1114
+ g !== null && /* @__PURE__ */ i(Gt, { role: "alert", children: f.formatMessage(
1115
+ { id: `ds.inputs.drop-zone.${g}` },
1116
+ { size: u ?? "" }
1117
+ ) }),
1118
+ a !== void 0 && /* @__PURE__ */ i(
1119
+ Ot,
1120
+ {
1121
+ open: m,
1122
+ onClose: () => p(!1),
1123
+ onImport: a.onImport,
1124
+ cloudPicker: a,
1125
+ multiple: n,
1126
+ maxSize: r,
1127
+ accept: t === void 0 ? void 0 : Object.entries(t).flatMap(([T, M]) => [
1128
+ T,
1129
+ ...M
1130
+ ])
1131
+ }
1132
+ )
1133
+ ]
1134
+ }
1135
+ );
1136
+ }
1137
+ var Kt = /* @__PURE__ */ ((e) => (e.Default = "default", e.Danger = "danger", e.Warning = "warning", e))(Kt || {});
1138
+ const Yt = d("form")(({ theme: e }) => ({
1139
+ display: "flex",
1140
+ flexDirection: "column",
1141
+ gap: o(e.design.space[4]),
1142
+ color: e.design.tokens["text.secondary"],
1143
+ overflowWrap: "anywhere"
1144
+ })), Xt = (e, n) => {
1145
+ const { paper: t } = e.design.tokens, r = e.design.tokens["paper.on"];
1146
+ return Ce(n, t) >= Ce(n, r) ? t : r;
1147
+ }, Qt = {
1148
+ default: "primary",
1149
+ danger: "error",
1150
+ warning: "warning"
1151
+ };
1152
+ function Zt({
1153
+ open: e,
1154
+ title: n,
1155
+ body: t,
1156
+ confirmLabel: r,
1157
+ tone: s = "default",
1158
+ confirmationText: c,
1159
+ onConfirm: a,
1160
+ onCancel: l
1161
+ }) {
1162
+ const f = L(), v = hn(), b = D(), [g, h] = I(""), [m, p] = I(!1), [u, y] = I(!1), [C, F] = I(e);
1163
+ e !== C && (F(e), e && (h(""), y(!1)));
1164
+ const P = !m && (c === void 0 || g === c), O = s !== "default", H = () => {
1165
+ m || l();
1166
+ }, V = () => {
1167
+ if (!P)
1168
+ return;
1169
+ y(!1);
1170
+ let M;
1171
+ try {
1172
+ M = a();
1173
+ } catch {
1174
+ y(!0);
1175
+ return;
1176
+ }
1177
+ M instanceof Promise && (p(!0), M.then(
1178
+ () => p(!1),
1179
+ () => {
1180
+ p(!1), y(!0);
1181
+ }
1182
+ ));
1183
+ }, T = (M) => {
1184
+ M.preventDefault(), V();
1185
+ };
1186
+ return /* @__PURE__ */ i(
1187
+ De,
1188
+ {
1189
+ open: e,
1190
+ onClose: H,
1191
+ size: Pe.Small,
1192
+ title: n,
1193
+ actions: /* @__PURE__ */ x(J, { children: [
1194
+ /* @__PURE__ */ i(
1195
+ X,
1196
+ {
1197
+ variant: "outlined",
1198
+ disabled: m,
1199
+ autoFocus: c === void 0 && O,
1200
+ onClick: H,
1201
+ children: f.formatMessage({ id: "ds.layers.confirm-dialog.cancel" })
1202
+ }
1203
+ ),
1204
+ /* @__PURE__ */ i(
1205
+ X,
1206
+ {
1207
+ type: "submit",
1208
+ form: b,
1209
+ variant: "contained",
1210
+ color: Qt[s],
1211
+ disabled: !P,
1212
+ loading: m,
1213
+ autoFocus: c === void 0 && !O,
1214
+ sx: s === "warning" ? {
1215
+ "&:not(.Mui-disabled)": {
1216
+ color: Xt(
1217
+ v,
1218
+ v.design.tokens["status.warning"]
1219
+ )
1220
+ }
1221
+ } : void 0,
1222
+ children: r
1223
+ }
1224
+ )
1225
+ ] }),
1226
+ children: /* @__PURE__ */ x(Yt, { id: b, onSubmit: T, noValidate: !0, children: [
1227
+ /* @__PURE__ */ i("div", { children: t }),
1228
+ c !== void 0 && /* @__PURE__ */ i(
1229
+ Vn,
1230
+ {
1231
+ label: f.formatMessage(
1232
+ { id: "ds.layers.confirm-dialog.type-to-confirm" },
1233
+ { text: c }
1234
+ ),
1235
+ value: g,
1236
+ onChange: (M) => h(M.target.value),
1237
+ disabled: m,
1238
+ autoFocus: !0,
1239
+ autoComplete: "off",
1240
+ fullWidth: !0
1241
+ }
1242
+ ),
1243
+ u && /* @__PURE__ */ i(Bn, { severity: "error", children: f.formatMessage({ id: "ds.layers.confirm-dialog.failed" }) })
1244
+ ] })
1245
+ }
1246
+ );
1247
+ }
1248
+ const nn = Ee(null);
1249
+ function yr({ children: e }) {
1250
+ const [n, t] = I([]), [r, s] = I(null), c = Y(0), a = Y([]);
1251
+ a.current = n;
1252
+ const l = n.length > 0 ? n[0] : null;
1253
+ l !== null && l !== r && s(l), B(
1254
+ () => () => {
1255
+ a.current.forEach((g) => g.resolve(!1));
1256
+ },
1257
+ []
1258
+ );
1259
+ const f = Q(
1260
+ (g) => new Promise((h) => {
1261
+ c.current += 1;
1262
+ const m = { id: c.current, options: g, resolve: h };
1263
+ t((p) => [...p, m]);
1264
+ }),
1265
+ []
1266
+ ), v = (g) => {
1267
+ l !== null && (l.resolve(g), t((h) => h.filter((m) => m !== l)));
1268
+ }, b = ge(() => ({ confirm: f }), [f]);
1269
+ return /* @__PURE__ */ x(nn.Provider, { value: b, children: [
1270
+ e,
1271
+ r !== null && // A new key per request: each one starts from an empty confirmation field.
1272
+ /* @__PURE__ */ i(
1273
+ Zt,
1274
+ {
1275
+ open: l === r,
1276
+ ...r.options,
1277
+ onConfirm: () => v(!0),
1278
+ onCancel: () => v(!1)
1279
+ },
1280
+ r.id
1281
+ )
1282
+ ] });
1283
+ }
1284
+ function vr() {
1285
+ const e = ze(nn);
1286
+ if (e === null)
1287
+ throw new Error(
1288
+ "useConfirmDialog must be called inside a ConfirmDialogProvider"
1289
+ );
1290
+ return e;
1291
+ }
1292
+ var Jt = /* @__PURE__ */ ((e) => (e.BottomStart = "bottom-start", e.BottomEnd = "bottom-end", e))(Jt || {});
1293
+ const eo = 320, no = d("div")(({ theme: e }) => {
1294
+ const { tokens: n, space: t } = e.design;
1295
+ return {
1296
+ flex: "none",
1297
+ display: "flex",
1298
+ alignItems: "center",
1299
+ justifyContent: "space-between",
1300
+ gap: o(t[3]),
1301
+ padding: `${o(t[2])} ${o(t[2])} ${o(t[2])} ${o(t[4])}`,
1302
+ borderBottom: A(n["border.subtle"])
1303
+ };
1304
+ }), to = d("h2")(({ theme: e }) => ({
1305
+ margin: 0,
1306
+ minWidth: 0,
1307
+ color: e.design.tokens["text.primary"],
1308
+ fontSize: o(e.design.typeScale.body),
1309
+ fontWeight: R.semibold,
1310
+ overflowWrap: "anywhere"
1311
+ })), tn = d("div")(({ theme: e }) => ({
1312
+ display: "flex",
1313
+ flexDirection: "column",
1314
+ gap: o(e.design.space[3]),
1315
+ fontSize: o(e.design.typeScale.body)
1316
+ })), oo = d(tn)(({ theme: e }) => ({
1317
+ padding: o(e.design.space[4])
1318
+ }));
1319
+ function wr({
1320
+ anchorEl: e,
1321
+ open: n,
1322
+ onClose: t,
1323
+ title: r,
1324
+ placement: s = "bottom-start",
1325
+ width: c = eo,
1326
+ children: a
1327
+ }) {
1328
+ const l = L(), f = D(), v = vn() === K.Mobile, b = l.formatMessage({
1329
+ id: "ds.layers.anchored-panel.close"
1330
+ }), g = n && e !== null;
1331
+ if (v)
1332
+ return /* @__PURE__ */ i(
1333
+ wn,
1334
+ {
1335
+ open: g,
1336
+ onClose: t,
1337
+ title: r,
1338
+ closeLabel: b,
1339
+ children: /* @__PURE__ */ i(tn, { children: a })
1340
+ }
1341
+ );
1342
+ const h = s === "bottom-end" ? "right" : "left";
1343
+ return /* @__PURE__ */ x(
1344
+ jn,
1345
+ {
1346
+ anchorEl: e,
1347
+ open: g,
1348
+ onClose: () => t(),
1349
+ anchorOrigin: { vertical: "bottom", horizontal: h },
1350
+ transformOrigin: { vertical: "top", horizontal: h },
1351
+ slotProps: {
1352
+ paper: {
1353
+ role: "dialog",
1354
+ "aria-modal": !0,
1355
+ "aria-labelledby": f,
1356
+ sx: (m) => ({
1357
+ width: o(c),
1358
+ maxWidth: `calc(100vw - ${o(m.design.space[4] * 2)})`,
1359
+ marginTop: o(m.design.space[1]),
1360
+ color: m.design.tokens["text.primary"],
1361
+ fontFamily: m.design.fonts.sans
1362
+ })
1363
+ }
1364
+ },
1365
+ children: [
1366
+ /* @__PURE__ */ x(no, { children: [
1367
+ /* @__PURE__ */ i(to, { id: f, children: r }),
1368
+ /* @__PURE__ */ i(ae, { "aria-label": b, onClick: t, children: /* @__PURE__ */ i(Ne, { "aria-hidden": !0 }) })
1369
+ ] }),
1370
+ /* @__PURE__ */ i(oo, { children: a })
1371
+ ]
1372
+ }
1373
+ );
1374
+ }
1375
+ const xr = { l: 0.72, c: 0.12 }, Cr = [
1376
+ 266,
1377
+ 296,
1378
+ 326,
1379
+ 356,
1380
+ 26,
1381
+ 56,
1382
+ 86,
1383
+ 116,
1384
+ 146,
1385
+ 176,
1386
+ 206,
1387
+ 236
1388
+ ], on = [
1389
+ "#81a2f0",
1390
+ "#ab94e7",
1391
+ "#cb89cd",
1392
+ "#e084a7",
1393
+ "#e6867d",
1394
+ "#de9056",
1395
+ "#c69f41",
1396
+ "#a1ae50",
1397
+ "#70b976",
1398
+ "#37bda2",
1399
+ "#18b9c9",
1400
+ "#4eb0e5"
1401
+ ], kr = "#767676", Sr = on[6], Ir = "#111a2f", Fr = "#5674be", ro = /^#?([0-9a-f]{6})$/i, q = (e) => {
1402
+ const n = ro.exec(e.trim());
1403
+ return n ? `#${n[1].toLowerCase()}` : null;
1404
+ }, io = d("div")(({ theme: e }) => ({
1405
+ display: "flex",
1406
+ alignItems: "center",
1407
+ gap: o(e.design.space[3])
1408
+ })), so = d("span")(({ theme: e }) => ({
1409
+ flex: "none",
1410
+ width: o(e.design.densityValues[e.design.density].control),
1411
+ height: o(e.design.densityValues[e.design.density].control),
1412
+ borderRadius: o(e.design.radii.md),
1413
+ border: A(e.design.tokens["border.control"])
1414
+ })), ao = d("div")(({ theme: e }) => ({
1415
+ display: "flex",
1416
+ flexWrap: "wrap",
1417
+ gap: o(e.design.space[2]),
1418
+ marginTop: o(e.design.space[2])
1419
+ })), lo = d(_e)(({ theme: e }) => {
1420
+ const { densityValues: n, density: t, space: r } = e.design, s = n[t].control - r[2];
1421
+ return {
1422
+ width: o(s),
1423
+ height: o(s),
1424
+ borderRadius: o(e.design.radii.sm),
1425
+ border: A(e.design.tokens["border.control"]),
1426
+ // The chosen swatch carries the ring of the design system (`focus.ring` is the accent).
1427
+ '&[aria-pressed="true"]': te(e),
1428
+ "&.Mui-focusVisible": te(e),
1429
+ [Z.down(K.Tablet)]: {
1430
+ width: o(e.design.densityValues.touchTarget),
1431
+ height: o(e.design.densityValues.touchTarget)
1432
+ }
1433
+ };
1434
+ });
1435
+ function Mr({
1436
+ label: e,
1437
+ value: n,
1438
+ onChange: t,
1439
+ swatches: r = on
1440
+ }) {
1441
+ const s = L(), c = D(), [a, l] = I(n), f = a !== "" && q(a) === null;
1442
+ B(() => {
1443
+ l(
1444
+ (g) => q(g) === q(n) ? g : n
1445
+ );
1446
+ }, [n]);
1447
+ const v = (g) => {
1448
+ l(g);
1449
+ const h = q(g);
1450
+ h !== null && h !== q(n) && t(h);
1451
+ }, b = q(n);
1452
+ return /* @__PURE__ */ x(le, { fullWidth: !0, error: f, children: [
1453
+ /* @__PURE__ */ i(Le, { htmlFor: `${c}-hex`, children: e }),
1454
+ /* @__PURE__ */ x(io, { children: [
1455
+ /* @__PURE__ */ i(
1456
+ so,
1457
+ {
1458
+ "aria-hidden": "true",
1459
+ style: { backgroundColor: b ?? void 0 }
1460
+ }
1461
+ ),
1462
+ /* @__PURE__ */ i(
1463
+ fe,
1464
+ {
1465
+ id: `${c}-hex`,
1466
+ fullWidth: !0,
1467
+ value: a,
1468
+ error: f,
1469
+ inputProps: {
1470
+ "aria-describedby": f ? `${c}-error` : void 0,
1471
+ spellCheck: !1,
1472
+ autoComplete: "off"
1473
+ },
1474
+ onChange: (g) => v(g.target.value)
1475
+ }
1476
+ )
1477
+ ] }),
1478
+ f && /* @__PURE__ */ i(se, { id: `${c}-error`, children: s.formatMessage({ id: "ds.inputs.color.invalid" }) }),
1479
+ /* @__PURE__ */ i(
1480
+ ao,
1481
+ {
1482
+ role: "group",
1483
+ "aria-label": s.formatMessage({ id: "ds.inputs.color.swatches" }),
1484
+ children: r.map((g) => /* @__PURE__ */ i(
1485
+ lo,
1486
+ {
1487
+ "aria-pressed": q(g) === b,
1488
+ "aria-label": g,
1489
+ style: { backgroundColor: g },
1490
+ onClick: () => t(q(g) ?? g)
1491
+ },
1492
+ g
1493
+ ))
1494
+ }
1495
+ )
1496
+ ] });
1497
+ }
1498
+ const co = 6, uo = d("div", {
1499
+ shouldForwardProp: (e) => e !== "edges"
1500
+ })(({ theme: e, edges: n }) => {
1501
+ const { tokens: t, radii: r, space: s } = e.design, c = o(s[1] * co), a = t["text.primary"], l = n.start ? `transparent, ${a} ${c}` : a, f = n.end ? `${a} calc(100% - ${c}), transparent` : a;
1502
+ return {
1503
+ maskImage: n.start || n.end ? `linear-gradient(to right, ${l}, ${f})` : "none",
1504
+ display: "inline-flex",
1505
+ maxWidth: "100%",
1506
+ minWidth: 0,
1507
+ border: A(t["border.subtle"]),
1508
+ borderRadius: o(r.md),
1509
+ overflowX: "auto",
1510
+ overflowY: "hidden",
1511
+ backgroundColor: t["bg.surface"],
1512
+ // Below 768 px each segment keeps a 44 px target: the band wraps onto more rows rather than
1513
+ // hiding segments behind a sideways scroll. A rule between neighbours would then start the
1514
+ // second row with a stray line and leave the rows unsplit: the band loses its border and each
1515
+ // segment draws its own, apart by a gap in both directions.
1516
+ [Z.down(K.Tablet)]: {
1517
+ flexWrap: "wrap",
1518
+ rowGap: o(s[1]),
1519
+ columnGap: o(s[1]),
1520
+ overflowX: "visible",
1521
+ maskImage: "none",
1522
+ border: "none",
1523
+ backgroundColor: "transparent"
1524
+ }
1525
+ };
1526
+ }), po = d(_e)(({ theme: e }) => {
1527
+ const { tokens: n, space: t, typeScale: r, fonts: s, densityValues: c, radii: a } = e.design;
1528
+ return {
1529
+ flex: "none",
1530
+ gap: o(t[2]),
1531
+ minHeight: o(c[e.design.density].control),
1532
+ paddingLeft: o(t[3]),
1533
+ paddingRight: o(t[3]),
1534
+ fontFamily: s.sans,
1535
+ fontSize: o(r.body),
1536
+ whiteSpace: "nowrap",
1537
+ color: n["text.secondary"],
1538
+ transition: oe(e, ["background-color", "color"]),
1539
+ "& + &": { borderLeft: A(n["border.subtle"]) },
1540
+ '&[aria-checked="true"]': {
1541
+ backgroundColor: n["bg.raised"],
1542
+ color: n["text.primary"],
1543
+ fontWeight: R.medium
1544
+ },
1545
+ "&:hover": { backgroundColor: n["bg.hover"] },
1546
+ "&.Mui-focusVisible": { ...te(e), outlineOffset: "-2px" },
1547
+ // A short label (« 1 h », « 7 j ») would leave a segment narrower than a finger. Each segment
1548
+ // is its own bordered tile once the band wraps.
1549
+ [Z.down(K.Tablet)]: {
1550
+ minWidth: o(c.touchTarget),
1551
+ minHeight: o(c.touchTarget),
1552
+ border: A(n["border.subtle"]),
1553
+ borderRadius: o(a.md),
1554
+ backgroundColor: n["bg.surface"],
1555
+ '&[aria-checked="true"]': { backgroundColor: n["bg.raised"] }
1556
+ }
1557
+ };
1558
+ }), go = d("span")(({ theme: e }) => ({
1559
+ fontFamily: e.design.fonts.mono,
1560
+ fontSize: o(e.design.typeScale.caption),
1561
+ color: e.design.tokens["text.muted"]
1562
+ }));
1563
+ function Wr({
1564
+ options: e,
1565
+ value: n,
1566
+ onChange: t,
1567
+ ariaLabel: r,
1568
+ testId: s
1569
+ }) {
1570
+ const c = Y(null), [a, l] = I({ start: !1, end: !1 }), f = Q(() => {
1571
+ const g = c.current;
1572
+ if (!g)
1573
+ return;
1574
+ const h = g.scrollLeft > 0, m = g.scrollLeft + g.clientWidth < g.scrollWidth - 1;
1575
+ l(
1576
+ (p) => p.start === h && p.end === m ? p : { start: h, end: m }
1577
+ );
1578
+ }, []);
1579
+ B(() => (f(), window.addEventListener("resize", f), () => window.removeEventListener("resize", f)), [f, e]);
1580
+ const v = (g) => {
1581
+ var p, u;
1582
+ const h = e.findIndex((y) => y.value === n);
1583
+ let m;
1584
+ switch (g.key) {
1585
+ case "ArrowRight":
1586
+ case "ArrowDown":
1587
+ m = (h + 1) % e.length;
1588
+ break;
1589
+ case "ArrowLeft":
1590
+ case "ArrowUp":
1591
+ m = (h - 1 + e.length) % e.length;
1592
+ break;
1593
+ case "Home":
1594
+ m = 0;
1595
+ break;
1596
+ case "End":
1597
+ m = e.length - 1;
1598
+ break;
1599
+ default:
1600
+ return;
1601
+ }
1602
+ g.preventDefault(), t(e[m].value), (u = (p = c.current) == null ? void 0 : p.querySelectorAll('[role="radio"]')[m]) == null || u.focus();
1603
+ }, b = Math.max(
1604
+ e.findIndex((g) => g.value === n),
1605
+ 0
1606
+ );
1607
+ return /* @__PURE__ */ i(
1608
+ uo,
1609
+ {
1610
+ ref: c,
1611
+ role: "radiogroup",
1612
+ "aria-label": r,
1613
+ "data-testid": s,
1614
+ edges: a,
1615
+ onKeyDown: v,
1616
+ onScroll: f,
1617
+ children: e.map((g, h) => {
1618
+ const m = g.value === n;
1619
+ return /* @__PURE__ */ x(
1620
+ po,
1621
+ {
1622
+ role: "radio",
1623
+ "aria-checked": m,
1624
+ "aria-label": g.ariaLabel,
1625
+ lang: g.lang,
1626
+ "data-testid": g.testId,
1627
+ tabIndex: h === b ? 0 : -1,
1628
+ onClick: () => t(g.value),
1629
+ children: [
1630
+ g.label,
1631
+ g.count !== void 0 && /* @__PURE__ */ i(go, { children: g.count })
1632
+ ]
1633
+ },
1634
+ g.value
1635
+ );
1636
+ })
1637
+ }
1638
+ );
1639
+ }
1640
+ const fo = [32, 160, 8239, 8201].map(
1641
+ (e) => String.fromCharCode(e)
1642
+ ), mo = (e) => {
1643
+ var t, r;
1644
+ const n = new Intl.NumberFormat(e).formatToParts(11111.1);
1645
+ return {
1646
+ group: ((t = n.find((s) => s.type === "group")) == null ? void 0 : t.value) ?? " ",
1647
+ decimal: ((r = n.find((s) => s.type === "decimal")) == null ? void 0 : r.value) ?? "."
1648
+ };
1649
+ }, Te = (e, n) => {
1650
+ const r = [n.group, ...fo].reduce(
1651
+ (c, a) => c.split(a).join(""),
1652
+ e.trim()
1653
+ ).replace(",", ".");
1654
+ if (r === "" || !/^-?\d*\.?\d+$|^-?\d+\.$/.test(r))
1655
+ return null;
1656
+ const s = Number.parseFloat(r);
1657
+ return Number.isFinite(s) ? s : null;
1658
+ };
1659
+ function Or({
1660
+ label: e,
1661
+ value: n,
1662
+ onChange: t,
1663
+ decimals: r = 0,
1664
+ min: s = 0,
1665
+ disabled: c,
1666
+ adornment: a
1667
+ }) {
1668
+ const l = L(), f = ge(
1669
+ () => mo(l.locale),
1670
+ [l.locale]
1671
+ ), v = Q(
1672
+ (u) => u === null ? "" : l.formatNumber(u, {
1673
+ minimumFractionDigits: r,
1674
+ maximumFractionDigits: r
1675
+ }),
1676
+ [l, r]
1677
+ ), [b, g] = I(!1), [h, m] = I(() => v(n));
1678
+ return B(() => {
1679
+ b || m(v(n));
1680
+ }, [n, b, v]), /* @__PURE__ */ i(Be, { label: e, children: /* @__PURE__ */ i(
1681
+ fe,
1682
+ {
1683
+ disabled: c,
1684
+ value: h,
1685
+ inputProps: { inputMode: "decimal" },
1686
+ onFocus: () => {
1687
+ g(!0), n !== null && m(String(n).replace(".", f.decimal));
1688
+ },
1689
+ onChange: (u) => {
1690
+ m(u.target.value);
1691
+ const y = Te(u.target.value, f);
1692
+ y !== null ? t(y) : u.target.value === "" && t(null);
1693
+ },
1694
+ onBlur: () => {
1695
+ g(!1);
1696
+ let u = Te(h, f);
1697
+ u !== null && (u = Number.parseFloat(Math.max(u, s).toFixed(r))), t(u), m(v(u));
1698
+ },
1699
+ endAdornment: a ? /* @__PURE__ */ i(Gn, { position: "end", children: a }) : void 0
1700
+ }
1701
+ ) });
1702
+ }
1703
+ const ho = 1, bo = (e, n) => n === "vertical" ? e.scrollHeight - e.clientHeight - e.scrollTop : e.scrollWidth - e.clientWidth - e.scrollLeft, yo = (e, n, t) => {
1704
+ const [r, s] = I(!1), c = Q(() => {
1705
+ const a = e.current;
1706
+ a !== null && s(bo(a, n) > ho);
1707
+ }, [e, n]);
1708
+ return Ae(c, [c, t]), B(() => {
1709
+ const a = e.current;
1710
+ if (a === null)
1711
+ return;
1712
+ a.addEventListener("scroll", c, { passive: !0 });
1713
+ const l = typeof ResizeObserver > "u" ? null : new ResizeObserver(c);
1714
+ return l !== null && (l.observe(a), Array.from(a.children).forEach((f) => l.observe(f))), () => {
1715
+ a.removeEventListener("scroll", c), l == null || l.disconnect();
1716
+ };
1717
+ }, [e, c, t]), r;
1718
+ };
1719
+ var vo = /* @__PURE__ */ ((e) => (e.Primary = "primary", e.Secondary = "secondary", e))(vo || {});
1720
+ const wo = 2, xo = /* @__PURE__ */ new Set(["Enter", " "]), Co = d("div", {
1721
+ shouldForwardProp: (e) => e !== "variant"
1722
+ })(({ theme: e, variant: n }) => ({
1723
+ minWidth: 0,
1724
+ ...n === "primary" && {
1725
+ borderBottom: A(e.design.tokens["border.subtle"])
1726
+ }
1727
+ })), rn = 32, ko = d("div", {
1728
+ shouldForwardProp: (e) => e !== "variant" && e !== "fade"
1729
+ })(({ theme: e, variant: n, fade: t }) => {
1730
+ const s = `linear-gradient(to right, ${e.design.tokens["text.primary"]} calc(100% - ${o(
1731
+ rn
1732
+ )}), transparent)`;
1733
+ return {
1734
+ position: "relative",
1735
+ display: "flex",
1736
+ gap: o(e.design.space[n === "primary" ? 1 : 2]),
1737
+ overflowX: "auto",
1738
+ overflowY: "hidden",
1739
+ scrollbarWidth: "none",
1740
+ "&::-webkit-scrollbar": { display: "none" },
1741
+ ...t && { maskImage: s, WebkitMaskImage: s }
1742
+ };
1743
+ }), sn = (e, n) => {
1744
+ const { tokens: t, space: r, radii: s, typeScale: c, fonts: a, densityValues: l, density: f } = e.design, v = {
1745
+ position: "relative",
1746
+ display: "inline-flex",
1747
+ alignItems: "center",
1748
+ flex: "none",
1749
+ gap: o(r[2]),
1750
+ boxSizing: "border-box",
1751
+ margin: 0,
1752
+ border: 0,
1753
+ backgroundColor: "transparent",
1754
+ cursor: "pointer",
1755
+ fontFamily: a.sans,
1756
+ whiteSpace: "nowrap",
1757
+ textDecoration: "none",
1758
+ color: t["text.secondary"],
1759
+ transition: oe(e, ["color", "background-color"]),
1760
+ "&:hover": { color: t["text.primary"] },
1761
+ '&[aria-selected="true"]': {
1762
+ color: t["text.primary"],
1763
+ fontWeight: R.medium
1764
+ },
1765
+ // Inside the scrolling row, an outer ring would be clipped: it is drawn inside the tab.
1766
+ "&:focus-visible": { ...te(e), outlineOffset: "-2px" }
1767
+ }, b = {
1768
+ [Z.down(K.Tablet)]: {
1769
+ minHeight: o(l.touchTarget)
1770
+ }
1771
+ };
1772
+ return n === "primary" ? {
1773
+ ...v,
1774
+ minHeight: o(l[f].control + r[2]),
1775
+ padding: `0 ${o(r[3])}`,
1776
+ fontSize: o(c.body),
1777
+ '&[aria-selected="true"]::after': {
1778
+ content: '""',
1779
+ position: "absolute",
1780
+ left: 0,
1781
+ right: 0,
1782
+ bottom: 0,
1783
+ height: o(wo),
1784
+ backgroundColor: t.accent
1785
+ },
1786
+ ...b
1787
+ } : {
1788
+ ...v,
1789
+ minHeight: o(l.compact.control),
1790
+ padding: `0 ${o(r[3])}`,
1791
+ borderRadius: o(s.md),
1792
+ fontSize: o(c.small),
1793
+ "&:hover": {
1794
+ color: t["text.primary"],
1795
+ backgroundColor: t["bg.hover"]
1796
+ },
1797
+ '&[aria-selected="true"]': {
1798
+ color: t["text.primary"],
1799
+ fontWeight: R.medium,
1800
+ backgroundColor: t["bg.raised"]
1801
+ },
1802
+ ...b
1803
+ };
1804
+ }, an = (e) => e !== "variant", So = d(Kn, { shouldForwardProp: an })(({ theme: e, variant: n }) => sn(e, n)), Io = d("button", { shouldForwardProp: an })(({ theme: e, variant: n }) => sn(e, n)), Fo = d("span")(({ theme: e }) => {
1805
+ const { tokens: n, space: t, radii: r, fonts: s, typeScale: c } = e.design;
1806
+ return {
1807
+ display: "inline-flex",
1808
+ alignItems: "center",
1809
+ padding: `0 ${o(t[1])}`,
1810
+ borderRadius: o(r.sm),
1811
+ border: A(n["border.subtle"]),
1812
+ fontFamily: s.mono,
1813
+ fontSize: o(c.caption),
1814
+ fontWeight: R.regular,
1815
+ lineHeight: 1.6,
1816
+ color: n["text.muted"]
1817
+ };
1818
+ }), Re = (e, n) => {
1819
+ const t = n.offsetLeft, r = t + n.offsetWidth + rn;
1820
+ t < e.scrollLeft ? e.scrollLeft = t : r > e.scrollLeft + e.clientWidth && (e.scrollLeft = r - e.clientWidth);
1821
+ };
1822
+ function Tr({
1823
+ items: e,
1824
+ value: n,
1825
+ onChange: t,
1826
+ variant: r,
1827
+ "aria-label": s
1828
+ }) {
1829
+ const c = L(), a = Y(null), l = e.filter((p) => p.hidden !== !0), f = yo(a, "horizontal", l.length), v = Q(
1830
+ () => {
1831
+ var p;
1832
+ return Array.from(
1833
+ ((p = a.current) == null ? void 0 : p.querySelectorAll('[role="tab"]')) ?? []
1834
+ );
1835
+ },
1836
+ []
1837
+ ), b = Q(() => {
1838
+ const p = a.current, u = p == null ? void 0 : p.querySelector('[aria-selected="true"]');
1839
+ p && u && Re(p, u);
1840
+ }, []);
1841
+ Ae(b, [b, n]);
1842
+ const g = l.map((p) => p.value).join("|");
1843
+ B(() => {
1844
+ const p = a.current;
1845
+ if (p === null || typeof ResizeObserver > "u")
1846
+ return;
1847
+ const u = new ResizeObserver(b);
1848
+ return u.observe(p), Array.from(p.children).forEach((y) => u.observe(y)), () => u.disconnect();
1849
+ }, [b, g]);
1850
+ const h = (p) => {
1851
+ const u = v(), y = u.findIndex((F) => F === document.activeElement);
1852
+ if (y < 0)
1853
+ return;
1854
+ if (xo.has(p.key)) {
1855
+ p.key === " " && u[y] instanceof HTMLAnchorElement && (p.preventDefault(), u[y].click());
1856
+ return;
1857
+ }
1858
+ let C;
1859
+ switch (p.key) {
1860
+ case "ArrowRight":
1861
+ C = (y + 1) % u.length;
1862
+ break;
1863
+ case "ArrowLeft":
1864
+ C = (y - 1 + u.length) % u.length;
1865
+ break;
1866
+ case "Home":
1867
+ C = 0;
1868
+ break;
1869
+ case "End":
1870
+ C = u.length - 1;
1871
+ break;
1872
+ default:
1873
+ return;
1874
+ }
1875
+ p.preventDefault(), u[C].focus(), a.current && Re(a.current, u[C]);
1876
+ }, m = Math.max(
1877
+ l.findIndex((p) => p.value === n),
1878
+ 0
1879
+ );
1880
+ return /* @__PURE__ */ i(Co, { variant: r, children: /* @__PURE__ */ i(
1881
+ ko,
1882
+ {
1883
+ ref: a,
1884
+ role: "tablist",
1885
+ "aria-label": s,
1886
+ variant: r,
1887
+ fade: f,
1888
+ "data-overflowing": f || void 0,
1889
+ onKeyDown: h,
1890
+ children: l.map((p, u) => {
1891
+ const y = p.value === n, C = /* @__PURE__ */ x(J, { children: [
1892
+ p.label,
1893
+ p.badge !== void 0 && /* @__PURE__ */ i(Fo, { children: typeof p.badge == "number" ? c.formatNumber(p.badge) : p.badge })
1894
+ ] }), F = {
1895
+ role: "tab",
1896
+ "aria-selected": y,
1897
+ tabIndex: u === m ? 0 : -1,
1898
+ "data-testid": p.testId,
1899
+ variant: r,
1900
+ onClick: () => t == null ? void 0 : t(p.value)
1901
+ };
1902
+ return p.to !== void 0 ? /* @__PURE__ */ i(
1903
+ So,
1904
+ {
1905
+ to: p.to,
1906
+ "aria-current": y ? "page" : void 0,
1907
+ ...F,
1908
+ children: C
1909
+ },
1910
+ p.value
1911
+ ) : /* @__PURE__ */ i(Io, { type: "button", ...F, children: C }, p.value);
1912
+ })
1913
+ }
1914
+ ) });
1915
+ }
1916
+ export {
1917
+ wr as A,
1918
+ rt as C,
1919
+ br as D,
1920
+ Be as F,
1921
+ Ot as I,
1922
+ Or as N,
1923
+ hr as R,
1924
+ Wr as S,
1925
+ vo as T,
1926
+ Ve as a,
1927
+ Tt as b,
1928
+ en as c,
1929
+ Kt as d,
1930
+ yo as e,
1931
+ Zt as f,
1932
+ Wt as g,
1933
+ Mr as h,
1934
+ Jt as i,
1935
+ yr as j,
1936
+ Tr as k,
1937
+ xr as l,
1938
+ Cr as m,
1939
+ q as n,
1940
+ on as o,
1941
+ kr as p,
1942
+ Sr as q,
1943
+ Ir as r,
1944
+ Fr as s,
1945
+ vr as u
1946
+ };