@sanity/ui 3.0.14 → 3.0.15-canary.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.
@@ -1,11 +1,10 @@
1
1
  import { buildTheme, createColorTheme as createColorTheme$1, hexToRgb as hexToRgb$1, hslToRgb as hslToRgb$1, multiply as multiply$1, parseColor as parseColor$1, rgbToHex as rgbToHex$1, rgbToHsl as rgbToHsl$1, rgba as rgba$1, screen as screen$1, getTheme_v2, getScopedTheme } from "@sanity/ui/theme";
2
- import { jsx, Fragment, jsxs } from "react/jsx-runtime";
3
- import { c } from "react-compiler-runtime";
4
- import { createContext, useContext, forwardRef, useId, useState, useEffect, Children, isValidElement, cloneElement, useDebugValue, useSyncExternalStore, useRef, useImperativeHandle, lazy, Suspense, useLayoutEffect } from "react";
2
+ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
3
+ import { createContext, useContext, useMemo, forwardRef, useId, useState, useEffect, useCallback, Children, isValidElement, cloneElement, useDebugValue, useSyncExternalStore, useRef, useImperativeHandle, lazy, Suspense, useLayoutEffect } from "react";
5
4
  import { ThemeProvider as ThemeProvider$1, useTheme as useTheme$1, css, styled, keyframes } from "styled-components";
6
5
  import ReactIs, { isValidElementType } from "react-is";
7
6
  import { SpinnerIcon, CheckmarkIcon, RemoveIcon, ChevronDownIcon, CloseIcon, ChevronRightIcon } from "@sanity/icons";
8
- import { detectOverflow, useFloating, autoPlacement, flip, offset, shift, arrow, hide, autoUpdate } from "@floating-ui/react-dom";
7
+ import { detectOverflow, useFloating, autoUpdate, autoPlacement, flip, offset, shift, arrow, hide } from "@floating-ui/react-dom";
9
8
  import { motion, AnimatePresence } from "framer-motion";
10
9
  import { ResizeObserver } from "@juggle/resize-observer";
11
10
  import { createPortal } from "react-dom";
@@ -213,42 +212,15 @@ function createGlobalScopedContext(key2, defaultValue) {
213
212
  }
214
213
  const ThemeContext = createGlobalScopedContext("@sanity/ui/context/theme", null);
215
214
  function ThemeProvider(props) {
216
- const $ = c(15), parentTheme = useContext(ThemeContext), {
215
+ const parentTheme = useContext(ThemeContext), {
217
216
  children
218
- } = props, scheme = props.scheme ?? (parentTheme?.scheme || "light"), rootTheme = props.theme ?? (parentTheme?.theme || null), tone = props.tone ?? (parentTheme?.tone || "default");
219
- let t0;
220
- bb0: {
221
- if (!rootTheme) {
222
- t0 = null;
223
- break bb0;
224
- }
225
- let t12;
226
- $[0] !== rootTheme || $[1] !== scheme || $[2] !== tone ? (t12 = {
227
- version: 0,
228
- theme: rootTheme,
229
- scheme,
230
- tone
231
- }, $[0] = rootTheme, $[1] = scheme, $[2] = tone, $[3] = t12) : t12 = $[3], t0 = t12;
232
- }
233
- const themeContext = t0;
234
- let t1;
235
- bb1: {
236
- if (!rootTheme) {
237
- t1 = null;
238
- break bb1;
239
- }
240
- let t22;
241
- $[4] !== rootTheme || $[5] !== scheme || $[6] !== tone ? (t22 = getScopedTheme(rootTheme, scheme, tone), $[4] = rootTheme, $[5] = scheme, $[6] = tone, $[7] = t22) : t22 = $[7], t1 = t22;
242
- }
243
- const theme = t1;
244
- if (!theme) {
245
- let t22;
246
- return $[8] === Symbol.for("react.memo_cache_sentinel") ? (t22 = /* @__PURE__ */ jsx("pre", { children: 'ThemeProvider: no "theme" property provided' }), $[8] = t22) : t22 = $[8], t22;
247
- }
248
- let t2;
249
- $[9] !== children || $[10] !== theme ? (t2 = /* @__PURE__ */ jsx(ThemeProvider$1, { theme, children }), $[9] = children, $[10] = theme, $[11] = t2) : t2 = $[11];
250
- let t3;
251
- return $[12] !== t2 || $[13] !== themeContext ? (t3 = /* @__PURE__ */ jsx(ThemeContext.Provider, { value: themeContext, children: t2 }), $[12] = t2, $[13] = themeContext, $[14] = t3) : t3 = $[14], t3;
217
+ } = props, scheme = props.scheme ?? (parentTheme?.scheme || "light"), rootTheme = props.theme ?? (parentTheme?.theme || null), tone = props.tone ?? (parentTheme?.tone || "default"), themeContext = useMemo(() => rootTheme ? {
218
+ version: 0,
219
+ theme: rootTheme,
220
+ scheme,
221
+ tone
222
+ } : null, [rootTheme, scheme, tone]), theme = useMemo(() => rootTheme ? getScopedTheme(rootTheme, scheme, tone) : null, [scheme, rootTheme, tone]);
223
+ return theme ? /* @__PURE__ */ jsx(ThemeContext.Provider, { value: themeContext, children: /* @__PURE__ */ jsx(ThemeProvider$1, { theme, children }) }) : /* @__PURE__ */ jsx("pre", { children: 'ThemeProvider: no "theme" property provided' });
252
224
  }
253
225
  ThemeProvider.displayName = "ThemeProvider";
254
226
  function useRootTheme() {
@@ -258,22 +230,19 @@ function useRootTheme() {
258
230
  return value;
259
231
  }
260
232
  function ThemeColorProvider(props) {
261
- const $ = c(5), {
233
+ const {
262
234
  children,
263
235
  scheme,
264
236
  tone
265
- } = props, root = useRootTheme(), t0 = scheme || root.scheme;
266
- let t1;
267
- return $[0] !== children || $[1] !== root.theme || $[2] !== t0 || $[3] !== tone ? (t1 = /* @__PURE__ */ jsx(ThemeProvider, { scheme: t0, theme: root.theme, tone, children }), $[0] = children, $[1] = root.theme, $[2] = t0, $[3] = tone, $[4] = t1) : t1 = $[4], t1;
237
+ } = props, root = useRootTheme();
238
+ return /* @__PURE__ */ jsx(ThemeProvider, { scheme: scheme || root.scheme, theme: root.theme, tone, children });
268
239
  }
269
240
  ThemeColorProvider.displayName = "ThemeColorProvider";
270
241
  function useTheme() {
271
242
  return useTheme$1();
272
243
  }
273
244
  function useTheme_v2() {
274
- const $ = c(2), t0 = useTheme$1();
275
- let t1;
276
- return $[0] !== t0 ? (t1 = getTheme_v2(t0), $[0] = t0, $[1] = t1) : t1 = $[1], t1;
245
+ return getTheme_v2(useTheme$1());
277
246
  }
278
247
  function responsiveBorderStyle() {
279
248
  return [border, borderTop, borderRight, borderBottom, borderLeft];
@@ -988,33 +957,18 @@ const StyledLabel = /* @__PURE__ */ styled.div.withConfig({
988
957
  displayName: "StyledLabel",
989
958
  componentId: "sc-1luap7z-0"
990
959
  })(responsiveLabelFont, responsiveTextAlignStyle, labelBaseStyle), Label = forwardRef(function(props, ref) {
991
- const $ = c(26);
992
- let accent, align, childrenProp, restProps, t0, t1, textOverflow, weight;
993
- $[0] !== props ? ({
960
+ const {
994
961
  accent,
995
962
  align,
996
963
  children: childrenProp,
997
- muted: t0,
998
- size: t1,
964
+ muted = !1,
965
+ size: size2 = 2,
999
966
  textOverflow,
1000
967
  weight,
1001
968
  ...restProps
1002
- } = props, $[0] = props, $[1] = accent, $[2] = align, $[3] = childrenProp, $[4] = restProps, $[5] = t0, $[6] = t1, $[7] = textOverflow, $[8] = weight) : (accent = $[1], align = $[2], childrenProp = $[3], restProps = $[4], t0 = $[5], t1 = $[6], textOverflow = $[7], weight = $[8]);
1003
- const muted = t0 === void 0 ? !1 : t0, size2 = t1 === void 0 ? 2 : t1;
969
+ } = props;
1004
970
  let children = childrenProp;
1005
- if (textOverflow === "ellipsis") {
1006
- let t22;
1007
- $[9] !== children ? (t22 = /* @__PURE__ */ jsx(SpanWithTextOverflow, { children }), $[9] = children, $[10] = t22) : t22 = $[10], children = t22;
1008
- } else {
1009
- let t22;
1010
- $[11] !== children ? (t22 = /* @__PURE__ */ jsx("span", { children }), $[11] = children, $[12] = t22) : t22 = $[12], children = t22;
1011
- }
1012
- let t2;
1013
- $[13] !== align ? (t2 = _getArrayProp(align), $[13] = align, $[14] = t2) : t2 = $[14];
1014
- let t3;
1015
- $[15] !== size2 ? (t3 = _getArrayProp(size2), $[15] = size2, $[16] = t3) : t3 = $[16];
1016
- let t4;
1017
- return $[17] !== accent || $[18] !== children || $[19] !== muted || $[20] !== ref || $[21] !== restProps || $[22] !== t2 || $[23] !== t3 || $[24] !== weight ? (t4 = /* @__PURE__ */ jsx(StyledLabel, { "data-ui": "Label", ...restProps, $accent: accent, $align: t2, $muted: muted, $size: t3, $weight: weight, ref, children }), $[17] = accent, $[18] = children, $[19] = muted, $[20] = ref, $[21] = restProps, $[22] = t2, $[23] = t3, $[24] = weight, $[25] = t4) : t4 = $[25], t4;
971
+ return textOverflow === "ellipsis" ? children = /* @__PURE__ */ jsx(SpanWithTextOverflow, { children }) : children = /* @__PURE__ */ jsx("span", { children }), /* @__PURE__ */ jsx(StyledLabel, { "data-ui": "Label", ...restProps, $accent: accent, $align: _getArrayProp(align), $muted: muted, $size: _getArrayProp(size2), $weight: weight, ref, children });
1018
972
  });
1019
973
  Label.displayName = "ForwardRef(Label)";
1020
974
  const avatarStyle = {
@@ -1184,62 +1138,44 @@ const StyledAvatar = /* @__PURE__ */ styled.div.withConfig({
1184
1138
  displayName: "AvatarImage",
1185
1139
  componentId: "sc-1rj7kl0-6"
1186
1140
  })(avatarStyle.image), Avatar = forwardRef(function(props, ref) {
1187
- const $ = c(46);
1188
- let __unstable_hideInnerStroke, animateArrowFrom, arrowPositionProp, asProp, initials, onImageLoadError, restProps, src, t0, t1, t2, title;
1189
- $[0] !== props ? ({
1141
+ const {
1190
1142
  __unstable_hideInnerStroke,
1191
1143
  as: asProp,
1192
- color: t0,
1144
+ color = "gray",
1193
1145
  src,
1194
1146
  title,
1195
1147
  initials,
1196
1148
  onImageLoadError,
1197
1149
  arrowPosition: arrowPositionProp,
1198
1150
  animateArrowFrom,
1199
- status: t1,
1200
- size: t2,
1151
+ status = "online",
1152
+ size: sizeProp = 1,
1201
1153
  ...restProps
1202
- } = props, $[0] = props, $[1] = __unstable_hideInnerStroke, $[2] = animateArrowFrom, $[3] = arrowPositionProp, $[4] = asProp, $[5] = initials, $[6] = onImageLoadError, $[7] = restProps, $[8] = src, $[9] = t0, $[10] = t1, $[11] = t2, $[12] = title) : (__unstable_hideInnerStroke = $[1], animateArrowFrom = $[2], arrowPositionProp = $[3], asProp = $[4], initials = $[5], onImageLoadError = $[6], restProps = $[7], src = $[8], t0 = $[9], t1 = $[10], t2 = $[11], title = $[12]);
1203
- const color = t0 === void 0 ? "gray" : t0, status = t1 === void 0 ? "online" : t1, sizeProp = t2 === void 0 ? 1 : t2, {
1154
+ } = props, {
1204
1155
  avatar
1205
1156
  } = useTheme_v2(), as = ReactIs.isValidElementType(asProp) ? asProp : "div", size2 = _getArrayProp(sizeProp), _sizeRem = (avatar.sizes[size2[0]] || avatar.sizes[0]).size, _radius = _sizeRem / 2, elementId = useId(), [arrowPosition, setArrowPosition] = useState(animateArrowFrom || arrowPositionProp || "inside"), [imageFailed, setImageFailed] = useState(!1), imageId = `avatar-image-${elementId}`;
1206
- let t3, t4;
1207
- $[13] !== arrowPosition || $[14] !== arrowPositionProp ? (t3 = () => {
1208
- if (arrowPosition === arrowPositionProp)
1209
- return;
1157
+ useEffect(() => {
1158
+ if (arrowPosition === arrowPositionProp) return;
1210
1159
  const raf = requestAnimationFrame(() => setArrowPosition(arrowPositionProp));
1211
1160
  return () => cancelAnimationFrame(raf);
1212
- }, t4 = [arrowPosition, arrowPositionProp], $[13] = arrowPosition, $[14] = arrowPositionProp, $[15] = t3, $[16] = t4) : (t3 = $[15], t4 = $[16]), useEffect(t3, t4);
1213
- let t5, t6;
1214
- $[17] !== src ? (t5 = () => {
1161
+ }, [arrowPosition, arrowPositionProp]), useEffect(() => {
1215
1162
  src && setImageFailed(!1);
1216
- }, t6 = [src], $[17] = src, $[18] = t5, $[19] = t6) : (t5 = $[18], t6 = $[19]), useEffect(t5, t6);
1217
- let t7;
1218
- $[20] !== onImageLoadError ? (t7 = () => {
1163
+ }, [src]);
1164
+ const handleImageError = useCallback(() => {
1219
1165
  setImageFailed(!0), onImageLoadError && onImageLoadError(new Error("Avatar: the image failed to load"));
1220
- }, $[20] = onImageLoadError, $[21] = t7) : t7 = $[21];
1221
- const handleImageError = t7, T0 = StyledAvatar, t8 = typeof as == "string" ? as : void 0, t9 = "Avatar";
1222
- let t10;
1223
- $[22] !== color ? (t10 = /* @__PURE__ */ jsx(Arrow$1, { children: /* @__PURE__ */ jsx("svg", { width: "11", height: "7", viewBox: "0 0 11 7", fill: "none", children: /* @__PURE__ */ jsx("path", { d: "M6.67948 1.50115L11 7L0 7L4.32052 1.50115C4.92109 0.736796 6.07891 0.736795 6.67948 1.50115Z", fill: color }) }) }), $[22] = color, $[23] = t10) : t10 = $[23];
1224
- let t11;
1225
- $[24] !== __unstable_hideInnerStroke || $[25] !== _radius || $[26] !== _sizeRem || $[27] !== handleImageError || $[28] !== imageFailed || $[29] !== imageId || $[30] !== src ? (t11 = !imageFailed && src && /* @__PURE__ */ jsxs(AvatarImage, { viewBox: `0 0 ${_sizeRem} ${_sizeRem}`, fill: "none", children: [
1226
- /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx("pattern", { id: imageId, patternContentUnits: "objectBoundingBox", width: "1", height: "1", children: /* @__PURE__ */ jsx("image", { href: src, width: "1", height: "1", onError: handleImageError }) }) }),
1227
- /* @__PURE__ */ jsx("circle", { cx: _radius, cy: _radius, r: _radius, fill: `url(#${imageId})` }),
1228
- !__unstable_hideInnerStroke && /* @__PURE__ */ jsx(BgStroke, { cx: _radius, cy: _radius, rx: _radius, ry: _radius, vectorEffect: "non-scaling-stroke" }),
1229
- /* @__PURE__ */ jsx(Stroke, { cx: _radius, cy: _radius, rx: _radius, ry: _radius, vectorEffect: "non-scaling-stroke" })
1230
- ] }), $[24] = __unstable_hideInnerStroke, $[25] = _radius, $[26] = _sizeRem, $[27] = handleImageError, $[28] = imageFailed, $[29] = imageId, $[30] = src, $[31] = t11) : t11 = $[31];
1231
- const t12 = (imageFailed || !src) && initials && /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(Initials, { children: /* @__PURE__ */ jsx(InitialsLabel, { forwardedAs: "span", size: size2.map(_temp$a), weight: "medium", children: initials }) }) });
1232
- let t13;
1233
- return $[32] !== T0 || $[33] !== arrowPosition || $[34] !== as || $[35] !== color || $[36] !== ref || $[37] !== restProps || $[38] !== size2 || $[39] !== status || $[40] !== t10 || $[41] !== t11 || $[42] !== t12 || $[43] !== t8 || $[44] !== title ? (t13 = /* @__PURE__ */ jsxs(T0, { as, "data-as": t8, "data-ui": t9, ...restProps, $color: color, $size: size2, "aria-label": title, "data-arrow-position": arrowPosition, "data-status": status, ref, title, children: [
1234
- t10,
1235
- t11,
1236
- t12
1237
- ] }), $[32] = T0, $[33] = arrowPosition, $[34] = as, $[35] = color, $[36] = ref, $[37] = restProps, $[38] = size2, $[39] = status, $[40] = t10, $[41] = t11, $[42] = t12, $[43] = t8, $[44] = title, $[45] = t13) : t13 = $[45], t13;
1166
+ }, [onImageLoadError]);
1167
+ return /* @__PURE__ */ jsxs(StyledAvatar, { as, "data-as": typeof as == "string" ? as : void 0, "data-ui": "Avatar", ...restProps, $color: color, $size: size2, "aria-label": title, "data-arrow-position": arrowPosition, "data-status": status, ref, title, children: [
1168
+ /* @__PURE__ */ jsx(Arrow$1, { children: /* @__PURE__ */ jsx("svg", { width: "11", height: "7", viewBox: "0 0 11 7", fill: "none", children: /* @__PURE__ */ jsx("path", { d: "M6.67948 1.50115L11 7L0 7L4.32052 1.50115C4.92109 0.736796 6.07891 0.736795 6.67948 1.50115Z", fill: color }) }) }),
1169
+ !imageFailed && src && /* @__PURE__ */ jsxs(AvatarImage, { viewBox: `0 0 ${_sizeRem} ${_sizeRem}`, fill: "none", children: [
1170
+ /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx("pattern", { id: imageId, patternContentUnits: "objectBoundingBox", width: "1", height: "1", children: /* @__PURE__ */ jsx("image", { href: src, width: "1", height: "1", onError: handleImageError }) }) }),
1171
+ /* @__PURE__ */ jsx("circle", { cx: _radius, cy: _radius, r: _radius, fill: `url(#${imageId})` }),
1172
+ !__unstable_hideInnerStroke && /* @__PURE__ */ jsx(BgStroke, { cx: _radius, cy: _radius, rx: _radius, ry: _radius, vectorEffect: "non-scaling-stroke" }),
1173
+ /* @__PURE__ */ jsx(Stroke, { cx: _radius, cy: _radius, rx: _radius, ry: _radius, vectorEffect: "non-scaling-stroke" })
1174
+ ] }),
1175
+ (imageFailed || !src) && initials && /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(Initials, { children: /* @__PURE__ */ jsx(InitialsLabel, { forwardedAs: "span", size: size2.map((s) => s === 1 ? 1 : s === 2 ? 3 : s === 3 ? 5 : 0), weight: "medium", children: initials }) }) })
1176
+ ] });
1238
1177
  });
1239
1178
  Avatar.displayName = "ForwardRef(Avatar)";
1240
- function _temp$a(s) {
1241
- return s === 1 ? 1 : s === 2 ? 3 : s === 3 ? 5 : 0;
1242
- }
1243
1179
  function _responsiveAvatarCounterSizeStyle(props) {
1244
1180
  const {
1245
1181
  avatar,
@@ -1280,25 +1216,13 @@ const StyledAvatarCounter = /* @__PURE__ */ styled.div.withConfig({
1280
1216
  displayName: "StyledAvatarCounter",
1281
1217
  componentId: "sc-1ydx86y-0"
1282
1218
  })(_responsiveAvatarCounterSizeStyle, _avatarCounterBaseStyle), AvatarCounter = forwardRef(function(props, ref) {
1283
- const $ = c(20), {
1219
+ const {
1284
1220
  count,
1285
- size: t0
1286
- } = props, sizeProp = t0 === void 0 ? 1 : t0;
1287
- let T0, T1, t1, t2, t3, t4, t5;
1288
- if ($[0] !== ref || $[1] !== sizeProp) {
1289
- const size2 = _getArrayProp(sizeProp);
1290
- T1 = StyledAvatarCounter, t3 = size2, t4 = "AvatarCounter", t5 = ref, T0 = Label, t1 = "span", t2 = size2.map(_temp$9), $[0] = ref, $[1] = sizeProp, $[2] = T0, $[3] = T1, $[4] = t1, $[5] = t2, $[6] = t3, $[7] = t4, $[8] = t5;
1291
- } else
1292
- T0 = $[2], T1 = $[3], t1 = $[4], t2 = $[5], t3 = $[6], t4 = $[7], t5 = $[8];
1293
- let t6;
1294
- $[9] !== T0 || $[10] !== count || $[11] !== t1 || $[12] !== t2 ? (t6 = /* @__PURE__ */ jsx(T0, { as: t1, size: t2, weight: "medium", children: count }), $[9] = T0, $[10] = count, $[11] = t1, $[12] = t2, $[13] = t6) : t6 = $[13];
1295
- let t7;
1296
- return $[14] !== T1 || $[15] !== t3 || $[16] !== t4 || $[17] !== t5 || $[18] !== t6 ? (t7 = /* @__PURE__ */ jsx(T1, { $size: t3, "data-ui": t4, ref: t5, children: t6 }), $[14] = T1, $[15] = t3, $[16] = t4, $[17] = t5, $[18] = t6, $[19] = t7) : t7 = $[19], t7;
1221
+ size: sizeProp = 1
1222
+ } = props, size2 = _getArrayProp(sizeProp);
1223
+ return /* @__PURE__ */ jsx(StyledAvatarCounter, { $size: size2, "data-ui": "AvatarCounter", ref, children: /* @__PURE__ */ jsx(Label, { as: "span", size: size2.map((s) => s === 1 ? 1 : s === 2 ? 3 : s === 3 ? 5 : 0), weight: "medium", children: count }) });
1297
1224
  });
1298
1225
  AvatarCounter.displayName = "ForwardRef(AvatarCounter)";
1299
- function _temp$9(s) {
1300
- return s === 1 ? 1 : s === 2 ? 3 : s === 3 ? 5 : 0;
1301
- }
1302
1226
  const BASE_STYLES = css`
1303
1227
  white-space: nowrap;
1304
1228
 
@@ -1331,51 +1255,34 @@ const StyledAvatarStack = /* @__PURE__ */ styled.div.withConfig({
1331
1255
  displayName: "StyledAvatarStack",
1332
1256
  componentId: "sc-cysmbb-0"
1333
1257
  })(responsiveAvatarStackSizeStyle, avatarStackStyle), AvatarStack = forwardRef(function(props, ref) {
1334
- const $ = c(38);
1335
- let childrenProp, restProps, t0, t1;
1336
- $[0] !== props ? ({
1258
+ const {
1337
1259
  children: childrenProp,
1338
- maxLength: t0,
1339
- size: t1,
1260
+ maxLength: maxLengthProp = 4,
1261
+ size: sizeProp = 1,
1340
1262
  ...restProps
1341
- } = props, $[0] = props, $[1] = childrenProp, $[2] = restProps, $[3] = t0, $[4] = t1) : (childrenProp = $[1], restProps = $[2], t0 = $[3], t1 = $[4]);
1342
- const maxLengthProp = t0 === void 0 ? 4 : t0, sizeProp = t1 === void 0 ? 1 : t1;
1343
- let T0, t2, t3, t4, t5, t6, t7, t8;
1344
- if ($[5] !== childrenProp || $[6] !== maxLengthProp || $[7] !== ref || $[8] !== restProps || $[9] !== sizeProp) {
1345
- const children = Children.toArray(childrenProp).filter(isValidElement), maxLength = Math.max(maxLengthProp, 0);
1346
- let t92;
1347
- $[18] !== sizeProp ? (t92 = _getArrayProp(sizeProp), $[18] = sizeProp, $[19] = t92) : t92 = $[19];
1348
- const size2 = t92, len = children.length, visibleCount = maxLength - 1, extraCount = len - visibleCount, visibleChildren = extraCount > 1 ? children.slice(extraCount, len) : children;
1349
- T0 = StyledAvatarStack, t2 = "AvatarStack", t3 = restProps, t4 = ref, t5 = size2, $[20] !== len || $[21] !== size2 ? (t6 = len === 0 && /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(AvatarCounter, { count: len, size: size2 }) }), $[20] = len, $[21] = size2, $[22] = t6) : t6 = $[22], $[23] !== extraCount || $[24] !== len || $[25] !== size2 ? (t7 = len !== 0 && extraCount > 1 && /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(AvatarCounter, { count: extraCount, size: size2 }) }), $[23] = extraCount, $[24] = len, $[25] = size2, $[26] = t7) : t7 = $[26];
1350
- let t10;
1351
- $[27] !== size2 ? (t10 = (child, childIndex) => /* @__PURE__ */ jsx("div", { children: cloneElement(child, {
1263
+ } = props, children = Children.toArray(childrenProp).filter(isValidElement), maxLength = Math.max(maxLengthProp, 0), size2 = _getArrayProp(sizeProp), len = children.length, visibleCount = maxLength - 1, extraCount = len - visibleCount, visibleChildren = extraCount > 1 ? children.slice(extraCount, len) : children;
1264
+ return /* @__PURE__ */ jsxs(StyledAvatarStack, { "data-ui": "AvatarStack", ...restProps, ref, $size: size2, children: [
1265
+ len === 0 && /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(AvatarCounter, { count: len, size: size2 }) }),
1266
+ len !== 0 && extraCount > 1 && /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(AvatarCounter, { count: extraCount, size: size2 }) }),
1267
+ visibleChildren.map((child, childIndex) => /* @__PURE__ */ jsx("div", { children: cloneElement(child, {
1352
1268
  size: size2
1353
- }) }, String(childIndex)), $[27] = size2, $[28] = t10) : t10 = $[28], t8 = visibleChildren.map(t10), $[5] = childrenProp, $[6] = maxLengthProp, $[7] = ref, $[8] = restProps, $[9] = sizeProp, $[10] = T0, $[11] = t2, $[12] = t3, $[13] = t4, $[14] = t5, $[15] = t6, $[16] = t7, $[17] = t8;
1354
- } else
1355
- T0 = $[10], t2 = $[11], t3 = $[12], t4 = $[13], t5 = $[14], t6 = $[15], t7 = $[16], t8 = $[17];
1356
- let t9;
1357
- return $[29] !== T0 || $[30] !== t2 || $[31] !== t3 || $[32] !== t4 || $[33] !== t5 || $[34] !== t6 || $[35] !== t7 || $[36] !== t8 ? (t9 = /* @__PURE__ */ jsxs(T0, { "data-ui": t2, ...t3, ref: t4, $size: t5, children: [
1358
- t6,
1359
- t7,
1360
- t8
1361
- ] }), $[29] = T0, $[30] = t2, $[31] = t3, $[32] = t4, $[33] = t5, $[34] = t6, $[35] = t7, $[36] = t8, $[37] = t9) : t9 = $[37], t9;
1269
+ }) }, String(childIndex)))
1270
+ ] });
1362
1271
  });
1363
1272
  AvatarStack.displayName = "ForwardRef(AvatarStack)";
1364
1273
  const StyledBox = /* @__PURE__ */ styled.div.withConfig({
1365
1274
  displayName: "StyledBox",
1366
1275
  componentId: "sc-1hhky9f-0"
1367
1276
  })(boxStyle, flexItemStyle, responsiveBoxStyle, responsiveGridItemStyle, responsiveMarginStyle, responsivePaddingStyle), Box = forwardRef(function(props, ref) {
1368
- const $ = c(109);
1369
- let column, columnEnd, columnStart, flex, height, marginBottom, marginLeft, marginRight, marginTop, marginX, marginY, overflow, paddingBottom, paddingLeft, paddingRight, paddingTop, paddingX, paddingY, restProps, row, rowEnd, rowStart, sizing, t0, t1, t2, t3;
1370
- $[0] !== props ? ({
1371
- as: t0,
1277
+ const {
1278
+ as: asProp = "div",
1372
1279
  column,
1373
1280
  columnStart,
1374
1281
  columnEnd,
1375
- display: t1,
1282
+ display = "block",
1376
1283
  flex,
1377
1284
  height,
1378
- margin: t2,
1285
+ margin = 0,
1379
1286
  marginX,
1380
1287
  marginY,
1381
1288
  marginTop,
@@ -1383,7 +1290,7 @@ const StyledBox = /* @__PURE__ */ styled.div.withConfig({
1383
1290
  marginBottom,
1384
1291
  marginLeft,
1385
1292
  overflow,
1386
- padding: t3,
1293
+ padding = 0,
1387
1294
  paddingX,
1388
1295
  paddingY,
1389
1296
  paddingTop,
@@ -1395,60 +1302,8 @@ const StyledBox = /* @__PURE__ */ styled.div.withConfig({
1395
1302
  rowEnd,
1396
1303
  sizing,
1397
1304
  ...restProps
1398
- } = props, $[0] = props, $[1] = column, $[2] = columnEnd, $[3] = columnStart, $[4] = flex, $[5] = height, $[6] = marginBottom, $[7] = marginLeft, $[8] = marginRight, $[9] = marginTop, $[10] = marginX, $[11] = marginY, $[12] = overflow, $[13] = paddingBottom, $[14] = paddingLeft, $[15] = paddingRight, $[16] = paddingTop, $[17] = paddingX, $[18] = paddingY, $[19] = restProps, $[20] = row, $[21] = rowEnd, $[22] = rowStart, $[23] = sizing, $[24] = t0, $[25] = t1, $[26] = t2, $[27] = t3) : (column = $[1], columnEnd = $[2], columnStart = $[3], flex = $[4], height = $[5], marginBottom = $[6], marginLeft = $[7], marginRight = $[8], marginTop = $[9], marginX = $[10], marginY = $[11], overflow = $[12], paddingBottom = $[13], paddingLeft = $[14], paddingRight = $[15], paddingTop = $[16], paddingX = $[17], paddingY = $[18], restProps = $[19], row = $[20], rowEnd = $[21], rowStart = $[22], sizing = $[23], t0 = $[24], t1 = $[25], t2 = $[26], t3 = $[27]);
1399
- const asProp = t0 === void 0 ? "div" : t0, display = t1 === void 0 ? "block" : t1, margin = t2 === void 0 ? 0 : t2, padding = t3 === void 0 ? 0 : t3, t4 = typeof asProp == "string" ? asProp : void 0;
1400
- let t5;
1401
- $[28] !== column ? (t5 = _getArrayProp(column), $[28] = column, $[29] = t5) : t5 = $[29];
1402
- let t6;
1403
- $[30] !== columnStart ? (t6 = _getArrayProp(columnStart), $[30] = columnStart, $[31] = t6) : t6 = $[31];
1404
- let t7;
1405
- $[32] !== columnEnd ? (t7 = _getArrayProp(columnEnd), $[32] = columnEnd, $[33] = t7) : t7 = $[33];
1406
- let t8;
1407
- $[34] !== display ? (t8 = _getArrayProp(display), $[34] = display, $[35] = t8) : t8 = $[35];
1408
- let t9;
1409
- $[36] !== flex ? (t9 = _getArrayProp(flex), $[36] = flex, $[37] = t9) : t9 = $[37];
1410
- let t10;
1411
- $[38] !== height ? (t10 = _getArrayProp(height), $[38] = height, $[39] = t10) : t10 = $[39];
1412
- let t11;
1413
- $[40] !== margin ? (t11 = _getArrayProp(margin), $[40] = margin, $[41] = t11) : t11 = $[41];
1414
- let t12;
1415
- $[42] !== marginX ? (t12 = _getArrayProp(marginX), $[42] = marginX, $[43] = t12) : t12 = $[43];
1416
- let t13;
1417
- $[44] !== marginY ? (t13 = _getArrayProp(marginY), $[44] = marginY, $[45] = t13) : t13 = $[45];
1418
- let t14;
1419
- $[46] !== marginTop ? (t14 = _getArrayProp(marginTop), $[46] = marginTop, $[47] = t14) : t14 = $[47];
1420
- let t15;
1421
- $[48] !== marginRight ? (t15 = _getArrayProp(marginRight), $[48] = marginRight, $[49] = t15) : t15 = $[49];
1422
- let t16;
1423
- $[50] !== marginBottom ? (t16 = _getArrayProp(marginBottom), $[50] = marginBottom, $[51] = t16) : t16 = $[51];
1424
- let t17;
1425
- $[52] !== marginLeft ? (t17 = _getArrayProp(marginLeft), $[52] = marginLeft, $[53] = t17) : t17 = $[53];
1426
- let t18;
1427
- $[54] !== overflow ? (t18 = _getArrayProp(overflow), $[54] = overflow, $[55] = t18) : t18 = $[55];
1428
- let t19;
1429
- $[56] !== padding ? (t19 = _getArrayProp(padding), $[56] = padding, $[57] = t19) : t19 = $[57];
1430
- let t20;
1431
- $[58] !== paddingX ? (t20 = _getArrayProp(paddingX), $[58] = paddingX, $[59] = t20) : t20 = $[59];
1432
- let t21;
1433
- $[60] !== paddingY ? (t21 = _getArrayProp(paddingY), $[60] = paddingY, $[61] = t21) : t21 = $[61];
1434
- let t22;
1435
- $[62] !== paddingTop ? (t22 = _getArrayProp(paddingTop), $[62] = paddingTop, $[63] = t22) : t22 = $[63];
1436
- let t23;
1437
- $[64] !== paddingRight ? (t23 = _getArrayProp(paddingRight), $[64] = paddingRight, $[65] = t23) : t23 = $[65];
1438
- let t24;
1439
- $[66] !== paddingBottom ? (t24 = _getArrayProp(paddingBottom), $[66] = paddingBottom, $[67] = t24) : t24 = $[67];
1440
- let t25;
1441
- $[68] !== paddingLeft ? (t25 = _getArrayProp(paddingLeft), $[68] = paddingLeft, $[69] = t25) : t25 = $[69];
1442
- let t26;
1443
- $[70] !== row ? (t26 = _getArrayProp(row), $[70] = row, $[71] = t26) : t26 = $[71];
1444
- let t27;
1445
- $[72] !== rowStart ? (t27 = _getArrayProp(rowStart), $[72] = rowStart, $[73] = t27) : t27 = $[73];
1446
- let t28;
1447
- $[74] !== rowEnd ? (t28 = _getArrayProp(rowEnd), $[74] = rowEnd, $[75] = t28) : t28 = $[75];
1448
- let t29;
1449
- $[76] !== sizing ? (t29 = _getArrayProp(sizing), $[76] = sizing, $[77] = t29) : t29 = $[77];
1450
- let t30;
1451
- return $[78] !== asProp || $[79] !== props.children || $[80] !== ref || $[81] !== restProps || $[82] !== t10 || $[83] !== t11 || $[84] !== t12 || $[85] !== t13 || $[86] !== t14 || $[87] !== t15 || $[88] !== t16 || $[89] !== t17 || $[90] !== t18 || $[91] !== t19 || $[92] !== t20 || $[93] !== t21 || $[94] !== t22 || $[95] !== t23 || $[96] !== t24 || $[97] !== t25 || $[98] !== t26 || $[99] !== t27 || $[100] !== t28 || $[101] !== t29 || $[102] !== t4 || $[103] !== t5 || $[104] !== t6 || $[105] !== t7 || $[106] !== t8 || $[107] !== t9 ? (t30 = /* @__PURE__ */ jsx(StyledBox, { "data-as": t4, "data-ui": "Box", ...restProps, $column: t5, $columnStart: t6, $columnEnd: t7, $display: t8, $flex: t9, $height: t10, $margin: t11, $marginX: t12, $marginY: t13, $marginTop: t14, $marginRight: t15, $marginBottom: t16, $marginLeft: t17, $overflow: t18, $padding: t19, $paddingX: t20, $paddingY: t21, $paddingTop: t22, $paddingRight: t23, $paddingBottom: t24, $paddingLeft: t25, $row: t26, $rowStart: t27, $rowEnd: t28, $sizing: t29, as: asProp, ref, children: props.children }), $[78] = asProp, $[79] = props.children, $[80] = ref, $[81] = restProps, $[82] = t10, $[83] = t11, $[84] = t12, $[85] = t13, $[86] = t14, $[87] = t15, $[88] = t16, $[89] = t17, $[90] = t18, $[91] = t19, $[92] = t20, $[93] = t21, $[94] = t22, $[95] = t23, $[96] = t24, $[97] = t25, $[98] = t26, $[99] = t27, $[100] = t28, $[101] = t29, $[102] = t4, $[103] = t5, $[104] = t6, $[105] = t7, $[106] = t8, $[107] = t9, $[108] = t30) : t30 = $[108], t30;
1305
+ } = props;
1306
+ return /* @__PURE__ */ jsx(StyledBox, { "data-as": typeof asProp == "string" ? asProp : void 0, "data-ui": "Box", ...restProps, $column: _getArrayProp(column), $columnStart: _getArrayProp(columnStart), $columnEnd: _getArrayProp(columnEnd), $display: _getArrayProp(display), $flex: _getArrayProp(flex), $height: _getArrayProp(height), $margin: _getArrayProp(margin), $marginX: _getArrayProp(marginX), $marginY: _getArrayProp(marginY), $marginTop: _getArrayProp(marginTop), $marginRight: _getArrayProp(marginRight), $marginBottom: _getArrayProp(marginBottom), $marginLeft: _getArrayProp(marginLeft), $overflow: _getArrayProp(overflow), $padding: _getArrayProp(padding), $paddingX: _getArrayProp(paddingX), $paddingY: _getArrayProp(paddingY), $paddingTop: _getArrayProp(paddingTop), $paddingRight: _getArrayProp(paddingRight), $paddingBottom: _getArrayProp(paddingBottom), $paddingLeft: _getArrayProp(paddingLeft), $row: _getArrayProp(row), $rowStart: _getArrayProp(rowStart), $rowEnd: _getArrayProp(rowEnd), $sizing: _getArrayProp(sizing), as: asProp, ref, children: props.children });
1452
1307
  });
1453
1308
  Box.displayName = "ForwardRef(Box)";
1454
1309
  function textBaseStyle(props) {
@@ -1523,32 +1378,18 @@ const StyledText = /* @__PURE__ */ styled.div.withConfig({
1523
1378
  displayName: "StyledText",
1524
1379
  componentId: "sc-11ov82j-0"
1525
1380
  })(responsiveTextFont, responsiveTextAlignStyle, textBaseStyle), Text = forwardRef(function(props, ref) {
1526
- const $ = c(26);
1527
- let align, childrenProp, restProps, t0, t1, t2, textOverflow, weight;
1528
- $[0] !== props ? ({
1529
- accent: t0,
1381
+ const {
1382
+ accent = !1,
1530
1383
  align,
1531
1384
  children: childrenProp,
1532
- muted: t1,
1533
- size: t2,
1385
+ muted = !1,
1386
+ size: size2 = 2,
1534
1387
  textOverflow,
1535
1388
  weight,
1536
1389
  ...restProps
1537
- } = props, $[0] = props, $[1] = align, $[2] = childrenProp, $[3] = restProps, $[4] = t0, $[5] = t1, $[6] = t2, $[7] = textOverflow, $[8] = weight) : (align = $[1], childrenProp = $[2], restProps = $[3], t0 = $[4], t1 = $[5], t2 = $[6], textOverflow = $[7], weight = $[8]);
1538
- const accent = t0 === void 0 ? !1 : t0, muted = t1 === void 0 ? !1 : t1, size2 = t2 === void 0 ? 2 : t2;
1390
+ } = props;
1539
1391
  let children = childrenProp;
1540
- if (textOverflow === "ellipsis") {
1541
- let t32;
1542
- $[9] !== children ? (t32 = /* @__PURE__ */ jsx(SpanWithTextOverflow, { children }), $[9] = children, $[10] = t32) : t32 = $[10], children = t32;
1543
- }
1544
- let t3;
1545
- $[11] !== align ? (t3 = _getArrayProp(align), $[11] = align, $[12] = t3) : t3 = $[12];
1546
- let t4;
1547
- $[13] !== size2 ? (t4 = _getArrayProp(size2), $[13] = size2, $[14] = t4) : t4 = $[14];
1548
- let t5;
1549
- $[15] !== children ? (t5 = /* @__PURE__ */ jsx("span", { children }), $[15] = children, $[16] = t5) : t5 = $[16];
1550
- let t6;
1551
- return $[17] !== accent || $[18] !== muted || $[19] !== ref || $[20] !== restProps || $[21] !== t3 || $[22] !== t4 || $[23] !== t5 || $[24] !== weight ? (t6 = /* @__PURE__ */ jsx(StyledText, { "data-ui": "Text", ...restProps, $accent: accent, $align: t3, $muted: muted, ref, $size: t4, $weight: weight, children: t5 }), $[17] = accent, $[18] = muted, $[19] = ref, $[20] = restProps, $[21] = t3, $[22] = t4, $[23] = t5, $[24] = weight, $[25] = t6) : t6 = $[25], t6;
1392
+ return textOverflow === "ellipsis" && (children = /* @__PURE__ */ jsx(SpanWithTextOverflow, { children })), /* @__PURE__ */ jsx(StyledText, { "data-ui": "Text", ...restProps, $accent: accent, $align: _getArrayProp(align), $muted: muted, ref, $size: _getArrayProp(size2), $weight: weight, children: /* @__PURE__ */ jsx("span", { children }) });
1552
1393
  });
1553
1394
  Text.displayName = "ForwardRef(Text)";
1554
1395
  function badgeStyle(props) {
@@ -1570,60 +1411,33 @@ const StyledBadge = /* @__PURE__ */ styled(Box).withConfig({
1570
1411
  displayName: "StyledBadge",
1571
1412
  componentId: "sc-5u140l-0"
1572
1413
  })(responsiveRadiusStyle, badgeStyle), Badge = forwardRef(function(props, ref) {
1573
- const $ = c(21);
1574
- let children, restProps, t0, t1, t2, t3;
1575
- if ($[0] !== props) {
1576
- const {
1577
- children: t42,
1578
- fontSize: t52,
1579
- mode: _deprecated_mode,
1580
- padding: t62,
1581
- radius: t72,
1582
- tone: t8,
1583
- ...t9
1584
- } = props;
1585
- children = t42, t0 = t52, t1 = t62, t2 = t72, t3 = t8, restProps = t9, $[0] = props, $[1] = children, $[2] = restProps, $[3] = t0, $[4] = t1, $[5] = t2, $[6] = t3;
1586
- } else
1587
- children = $[1], restProps = $[2], t0 = $[3], t1 = $[4], t2 = $[5], t3 = $[6];
1588
- const fontSize2 = t0 === void 0 ? 1 : t0, padding = t1 === void 0 ? 1 : t1, radius = t2 === void 0 ? "full" : t2, tone = t3 === void 0 ? "default" : t3;
1589
- let t4;
1590
- $[7] !== radius ? (t4 = _getArrayProp(radius), $[7] = radius, $[8] = t4) : t4 = $[8];
1591
- let t5;
1592
- $[9] !== padding ? (t5 = _getArrayProp(padding), $[9] = padding, $[10] = t5) : t5 = $[10];
1593
- let t6;
1594
- $[11] !== children || $[12] !== fontSize2 ? (t6 = /* @__PURE__ */ jsx(Text, { size: fontSize2, children }), $[11] = children, $[12] = fontSize2, $[13] = t6) : t6 = $[13];
1595
- let t7;
1596
- return $[14] !== ref || $[15] !== restProps || $[16] !== t4 || $[17] !== t5 || $[18] !== t6 || $[19] !== tone ? (t7 = /* @__PURE__ */ jsx(StyledBadge, { "data-ui": "Badge", ...restProps, $tone: tone, $radius: t4, padding: t5, ref, children: t6 }), $[14] = ref, $[15] = restProps, $[16] = t4, $[17] = t5, $[18] = t6, $[19] = tone, $[20] = t7) : t7 = $[20], t7;
1414
+ const {
1415
+ children,
1416
+ fontSize: fontSize2 = 1,
1417
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
1418
+ mode: _deprecated_mode,
1419
+ padding = 1,
1420
+ radius = "full",
1421
+ tone = "default",
1422
+ ...restProps
1423
+ } = props;
1424
+ return /* @__PURE__ */ jsx(StyledBadge, { "data-ui": "Badge", ...restProps, $tone: tone, $radius: _getArrayProp(radius), padding: _getArrayProp(padding), ref, children: /* @__PURE__ */ jsx(Text, { size: fontSize2, children }) });
1597
1425
  });
1598
1426
  Badge.displayName = "ForwardRef(Badge)";
1599
1427
  const StyledFlex = /* @__PURE__ */ styled(Box).withConfig({
1600
1428
  displayName: "StyledFlex",
1601
1429
  componentId: "sc-oxesg3-0"
1602
1430
  })(flexItemStyle, responsiveFlexStyle), Flex = forwardRef(function(props, ref) {
1603
- const $ = c(27);
1604
- let align, as, gap, justify, restProps, t0, wrap;
1605
- $[0] !== props ? ({
1431
+ const {
1606
1432
  align,
1607
1433
  as,
1608
- direction: t0,
1434
+ direction = "row",
1609
1435
  gap,
1610
1436
  justify,
1611
1437
  wrap,
1612
1438
  ...restProps
1613
- } = props, $[0] = props, $[1] = align, $[2] = as, $[3] = gap, $[4] = justify, $[5] = restProps, $[6] = t0, $[7] = wrap) : (align = $[1], as = $[2], gap = $[3], justify = $[4], restProps = $[5], t0 = $[6], wrap = $[7]);
1614
- const direction = t0 === void 0 ? "row" : t0;
1615
- let t1;
1616
- $[8] !== align ? (t1 = _getArrayProp(align), $[8] = align, $[9] = t1) : t1 = $[9];
1617
- let t2;
1618
- $[10] !== direction ? (t2 = _getArrayProp(direction), $[10] = direction, $[11] = t2) : t2 = $[11];
1619
- let t3;
1620
- $[12] !== gap ? (t3 = _getArrayProp(gap), $[12] = gap, $[13] = t3) : t3 = $[13];
1621
- let t4;
1622
- $[14] !== justify ? (t4 = _getArrayProp(justify), $[14] = justify, $[15] = t4) : t4 = $[15];
1623
- let t5;
1624
- $[16] !== wrap ? (t5 = _getArrayProp(wrap), $[16] = wrap, $[17] = t5) : t5 = $[17];
1625
- let t6;
1626
- return $[18] !== as || $[19] !== ref || $[20] !== restProps || $[21] !== t1 || $[22] !== t2 || $[23] !== t3 || $[24] !== t4 || $[25] !== t5 ? (t6 = /* @__PURE__ */ jsx(StyledFlex, { "data-ui": "Flex", ...restProps, $align: t1, $direction: t2, $gap: t3, $justify: t4, $wrap: t5, forwardedAs: as, ref }), $[18] = as, $[19] = ref, $[20] = restProps, $[21] = t1, $[22] = t2, $[23] = t3, $[24] = t4, $[25] = t5, $[26] = t6) : t6 = $[26], t6;
1439
+ } = props;
1440
+ return /* @__PURE__ */ jsx(StyledFlex, { "data-ui": "Flex", ...restProps, $align: _getArrayProp(align), $direction: _getArrayProp(direction), $gap: _getArrayProp(gap), $justify: _getArrayProp(justify), $wrap: _getArrayProp(wrap), forwardedAs: as, ref });
1627
1441
  });
1628
1442
  Flex.displayName = "ForwardRef(Flex)";
1629
1443
  const rotate = keyframes`
@@ -1638,11 +1452,7 @@ const rotate = keyframes`
1638
1452
  displayName: "StyledSpinner",
1639
1453
  componentId: "sc-124hnd0-0"
1640
1454
  })`& > span > svg{animation:${rotate} 500ms linear infinite;}`, Spinner = forwardRef(function(props, ref) {
1641
- const $ = c(4);
1642
- let t0;
1643
- $[0] === Symbol.for("react.memo_cache_sentinel") ? (t0 = /* @__PURE__ */ jsx(SpinnerIcon, {}), $[0] = t0) : t0 = $[0];
1644
- let t1;
1645
- return $[1] !== props || $[2] !== ref ? (t1 = /* @__PURE__ */ jsx(StyledSpinner, { "data-ui": "Spinner", ...props, ref, children: t0 }), $[1] = props, $[2] = ref, $[3] = t1) : t1 = $[3], t1;
1455
+ return /* @__PURE__ */ jsx(StyledSpinner, { "data-ui": "Spinner", ...props, ref, children: /* @__PURE__ */ jsx(SpinnerIcon, {}) });
1646
1456
  });
1647
1457
  Spinner.displayName = "ForwardRef(Spinner)";
1648
1458
  function _cardColorStyle(base, color, checkered = !1) {
@@ -1820,71 +1630,37 @@ const StyledButton = /* @__PURE__ */ styled.button.withConfig({
1820
1630
  displayName: "LoadingBox",
1821
1631
  componentId: "sc-aaekt4-1"
1822
1632
  })`position:absolute;top:0;left:0;right:0;bottom:0;display:flex;align-items:center;justify-content:center;background-color:var(--card-bg-color);border-radius:inherit;z-index:1;box-shadow:inherit;`, Button = forwardRef(function(props, ref) {
1823
- const $ = c(86);
1824
- let IconComponent, IconRightComponent, children, disabled, loading, paddingBottomProp, paddingLeftProp, paddingRightProp, paddingTopProp, paddingXProp, paddingYProp, restProps, selected, t0, t1, t2, t3, t4, t5, t6, t7, t8, text, textAlign, textWeight, width;
1825
- $[0] !== props ? ({
1633
+ const {
1826
1634
  children,
1827
1635
  disabled,
1828
- fontSize: t0,
1636
+ fontSize: fontSize2 = 1,
1829
1637
  icon: IconComponent,
1830
1638
  iconRight: IconRightComponent,
1831
- justify: t1,
1639
+ justify: justifyProp = "center",
1832
1640
  loading,
1833
- mode: t2,
1834
- padding: t3,
1641
+ mode = "default",
1642
+ padding: paddingProp = 3,
1835
1643
  paddingX: paddingXProp,
1836
1644
  paddingY: paddingYProp,
1837
1645
  paddingTop: paddingTopProp,
1838
1646
  paddingBottom: paddingBottomProp,
1839
1647
  paddingLeft: paddingLeftProp,
1840
1648
  paddingRight: paddingRightProp,
1841
- radius: t4,
1649
+ radius: radiusProp = 2,
1842
1650
  selected,
1843
- space: t5,
1651
+ space: spaceProp = 3,
1844
1652
  text,
1845
1653
  textAlign,
1846
1654
  textWeight,
1847
- tone: t6,
1848
- type: t7,
1849
- muted: t8,
1655
+ tone = "default",
1656
+ type = "button",
1657
+ muted = !1,
1850
1658
  width,
1851
1659
  ...restProps
1852
- } = props, $[0] = props, $[1] = IconComponent, $[2] = IconRightComponent, $[3] = children, $[4] = disabled, $[5] = loading, $[6] = paddingBottomProp, $[7] = paddingLeftProp, $[8] = paddingRightProp, $[9] = paddingTopProp, $[10] = paddingXProp, $[11] = paddingYProp, $[12] = restProps, $[13] = selected, $[14] = t0, $[15] = t1, $[16] = t2, $[17] = t3, $[18] = t4, $[19] = t5, $[20] = t6, $[21] = t7, $[22] = t8, $[23] = text, $[24] = textAlign, $[25] = textWeight, $[26] = width) : (IconComponent = $[1], IconRightComponent = $[2], children = $[3], disabled = $[4], loading = $[5], paddingBottomProp = $[6], paddingLeftProp = $[7], paddingRightProp = $[8], paddingTopProp = $[9], paddingXProp = $[10], paddingYProp = $[11], restProps = $[12], selected = $[13], t0 = $[14], t1 = $[15], t2 = $[16], t3 = $[17], t4 = $[18], t5 = $[19], t6 = $[20], t7 = $[21], t8 = $[22], text = $[23], textAlign = $[24], textWeight = $[25], width = $[26]);
1853
- const fontSize2 = t0 === void 0 ? 1 : t0, justifyProp = t1 === void 0 ? "center" : t1, mode = t2 === void 0 ? "default" : t2, paddingProp = t3 === void 0 ? 3 : t3, radiusProp = t4 === void 0 ? 2 : t4, spaceProp = t5 === void 0 ? 3 : t5, tone = t6 === void 0 ? "default" : t6, type = t7 === void 0 ? "button" : t7, muted = t8 === void 0 ? !1 : t8, {
1660
+ } = props, {
1854
1661
  button
1855
- } = useTheme_v2();
1856
- let t9;
1857
- $[27] !== justifyProp ? (t9 = _getArrayProp(justifyProp), $[27] = justifyProp, $[28] = t9) : t9 = $[28];
1858
- const justify = t9;
1859
- let t10;
1860
- $[29] !== paddingProp ? (t10 = _getArrayProp(paddingProp), $[29] = paddingProp, $[30] = t10) : t10 = $[30];
1861
- const padding = t10;
1862
- let t11;
1863
- $[31] !== paddingXProp ? (t11 = _getArrayProp(paddingXProp), $[31] = paddingXProp, $[32] = t11) : t11 = $[32];
1864
- const paddingX = t11;
1865
- let t12;
1866
- $[33] !== paddingYProp ? (t12 = _getArrayProp(paddingYProp), $[33] = paddingYProp, $[34] = t12) : t12 = $[34];
1867
- const paddingY = t12;
1868
- let t13;
1869
- $[35] !== paddingTopProp ? (t13 = _getArrayProp(paddingTopProp), $[35] = paddingTopProp, $[36] = t13) : t13 = $[36];
1870
- const paddingTop = t13;
1871
- let t14;
1872
- $[37] !== paddingBottomProp ? (t14 = _getArrayProp(paddingBottomProp), $[37] = paddingBottomProp, $[38] = t14) : t14 = $[38];
1873
- const paddingBottom = t14;
1874
- let t15;
1875
- $[39] !== paddingLeftProp ? (t15 = _getArrayProp(paddingLeftProp), $[39] = paddingLeftProp, $[40] = t15) : t15 = $[40];
1876
- const paddingLeft = t15;
1877
- let t16;
1878
- $[41] !== paddingRightProp ? (t16 = _getArrayProp(paddingRightProp), $[41] = paddingRightProp, $[42] = t16) : t16 = $[42];
1879
- const paddingRight = t16;
1880
- let t17;
1881
- $[43] !== radiusProp ? (t17 = _getArrayProp(radiusProp), $[43] = radiusProp, $[44] = t17) : t17 = $[44];
1882
- const radius = t17;
1883
- let t18;
1884
- $[45] !== spaceProp ? (t18 = _getArrayProp(spaceProp), $[45] = spaceProp, $[46] = t18) : t18 = $[46];
1885
- const space = t18;
1886
- let t19;
1887
- $[47] !== padding || $[48] !== paddingBottom || $[49] !== paddingLeft || $[50] !== paddingRight || $[51] !== paddingTop || $[52] !== paddingX || $[53] !== paddingY ? (t19 = {
1662
+ } = useTheme_v2(), justify = _getArrayProp(justifyProp), padding = _getArrayProp(paddingProp), paddingX = _getArrayProp(paddingXProp), paddingY = _getArrayProp(paddingYProp), paddingTop = _getArrayProp(paddingTopProp), paddingBottom = _getArrayProp(paddingBottomProp), paddingLeft = _getArrayProp(paddingLeftProp), paddingRight = _getArrayProp(paddingRightProp), radius = _getArrayProp(radiusProp), space = _getArrayProp(spaceProp), boxProps = useMemo(() => ({
1663
+ // flex: 1,
1888
1664
  padding,
1889
1665
  paddingX,
1890
1666
  paddingY,
@@ -1892,30 +1668,22 @@ const StyledButton = /* @__PURE__ */ styled.button.withConfig({
1892
1668
  paddingBottom,
1893
1669
  paddingLeft,
1894
1670
  paddingRight
1895
- }, $[47] = padding, $[48] = paddingBottom, $[49] = paddingLeft, $[50] = paddingRight, $[51] = paddingTop, $[52] = paddingX, $[53] = paddingY, $[54] = t19) : t19 = $[54];
1896
- const boxProps = t19, t20 = !!(loading || disabled), t21 = selected ? "" : void 0, t22 = !!(loading || disabled);
1897
- let t23;
1898
- $[55] !== loading ? (t23 = !!loading && /* @__PURE__ */ jsx(LoadingBox, { children: /* @__PURE__ */ jsx(Spinner, {}) }), $[55] = loading, $[56] = t23) : t23 = $[56];
1899
- let t24;
1900
- $[57] !== IconComponent || $[58] !== IconRightComponent || $[59] !== boxProps || $[60] !== button || $[61] !== fontSize2 || $[62] !== justify || $[63] !== muted || $[64] !== space || $[65] !== text || $[66] !== textAlign || $[67] !== textWeight ? (t24 = (IconComponent || text || IconRightComponent) && /* @__PURE__ */ jsx(Box, { as: "span", ...boxProps, children: /* @__PURE__ */ jsxs(Flex, { as: "span", justify, gap: space, children: [
1901
- IconComponent && /* @__PURE__ */ jsxs(Text, { size: fontSize2, children: [
1902
- isValidElement(IconComponent) && IconComponent,
1903
- isValidElementType(IconComponent) && /* @__PURE__ */ jsx(IconComponent, {})
1904
- ] }),
1905
- text && /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(Text, { muted, align: textAlign, size: fontSize2, textOverflow: "ellipsis", weight: textWeight ?? button.textWeight, children: text }) }),
1906
- IconRightComponent && /* @__PURE__ */ jsxs(Text, { size: fontSize2, children: [
1907
- isValidElement(IconRightComponent) && IconRightComponent,
1908
- isValidElementType(IconRightComponent) && /* @__PURE__ */ jsx(IconRightComponent, {})
1909
- ] })
1910
- ] }) }), $[57] = IconComponent, $[58] = IconRightComponent, $[59] = boxProps, $[60] = button, $[61] = fontSize2, $[62] = justify, $[63] = muted, $[64] = space, $[65] = text, $[66] = textAlign, $[67] = textWeight, $[68] = t24) : t24 = $[68];
1911
- let t25;
1912
- $[69] !== boxProps || $[70] !== children ? (t25 = children && /* @__PURE__ */ jsx(Box, { as: "span", ...boxProps, children }), $[69] = boxProps, $[70] = children, $[71] = t25) : t25 = $[71];
1913
- let t26;
1914
- return $[72] !== mode || $[73] !== radius || $[74] !== ref || $[75] !== restProps || $[76] !== t20 || $[77] !== t21 || $[78] !== t22 || $[79] !== t23 || $[80] !== t24 || $[81] !== t25 || $[82] !== tone || $[83] !== type || $[84] !== width ? (t26 = /* @__PURE__ */ jsxs(StyledButton, { "data-ui": "Button", ...restProps, $mode: mode, $radius: radius, $tone: tone, "data-disabled": t20, "data-selected": t21, disabled: t22, ref, type, $width: width, children: [
1915
- t23,
1916
- t24,
1917
- t25
1918
- ] }), $[72] = mode, $[73] = radius, $[74] = ref, $[75] = restProps, $[76] = t20, $[77] = t21, $[78] = t22, $[79] = t23, $[80] = t24, $[81] = t25, $[82] = tone, $[83] = type, $[84] = width, $[85] = t26) : t26 = $[85], t26;
1671
+ }), [padding, paddingX, paddingY, paddingTop, paddingBottom, paddingLeft, paddingRight]);
1672
+ return /* @__PURE__ */ jsxs(StyledButton, { "data-ui": "Button", ...restProps, $mode: mode, $radius: radius, $tone: tone, "data-disabled": !!(loading || disabled), "data-selected": selected ? "" : void 0, disabled: !!(loading || disabled), ref, type, $width: width, children: [
1673
+ !!loading && /* @__PURE__ */ jsx(LoadingBox, { children: /* @__PURE__ */ jsx(Spinner, {}) }),
1674
+ (IconComponent || text || IconRightComponent) && /* @__PURE__ */ jsx(Box, { as: "span", ...boxProps, children: /* @__PURE__ */ jsxs(Flex, { as: "span", justify, gap: space, children: [
1675
+ IconComponent && /* @__PURE__ */ jsxs(Text, { size: fontSize2, children: [
1676
+ isValidElement(IconComponent) && IconComponent,
1677
+ isValidElementType(IconComponent) && /* @__PURE__ */ jsx(IconComponent, {})
1678
+ ] }),
1679
+ text && /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(Text, { muted, align: textAlign, size: fontSize2, textOverflow: "ellipsis", weight: textWeight ?? button.textWeight, children: text }) }),
1680
+ IconRightComponent && /* @__PURE__ */ jsxs(Text, { size: fontSize2, children: [
1681
+ isValidElement(IconRightComponent) && IconRightComponent,
1682
+ isValidElementType(IconRightComponent) && /* @__PURE__ */ jsx(IconRightComponent, {})
1683
+ ] })
1684
+ ] }) }),
1685
+ children && /* @__PURE__ */ jsx(Box, { as: "span", ...boxProps, children })
1686
+ ] });
1919
1687
  });
1920
1688
  Button.displayName = "ForwardRef(Button)";
1921
1689
  function cardStyle(props) {
@@ -2070,11 +1838,9 @@ const StyledCard = /* @__PURE__ */ styled(Box).withConfig({
2070
1838
  displayName: "StyledCard",
2071
1839
  componentId: "sc-osnro2-0"
2072
1840
  })(responsiveBorderStyle, responsiveRadiusStyle, responsiveShadowStyle, cardStyle), Card = forwardRef(function(props, ref) {
2073
- const $ = c(56);
2074
- let asProp, border2, borderBottom2, borderLeft2, borderRight2, borderTop2, muted, pressed, restProps, scheme, selected, shadow, t0, t1, t2, t3;
2075
- $[0] !== props ? ({
2076
- __unstable_checkered: t0,
2077
- __unstable_focusRing: t1,
1841
+ const {
1842
+ __unstable_checkered: checkered = !1,
1843
+ __unstable_focusRing: focusRing = !1,
2078
1844
  as: asProp,
2079
1845
  border: border2,
2080
1846
  borderTop: borderTop2,
@@ -2083,39 +1849,18 @@ const StyledCard = /* @__PURE__ */ styled(Box).withConfig({
2083
1849
  borderLeft: borderLeft2,
2084
1850
  muted,
2085
1851
  pressed,
2086
- radius: t2,
1852
+ radius = 0,
2087
1853
  scheme,
2088
1854
  selected,
2089
1855
  shadow,
2090
- tone: t3,
1856
+ tone: toneProp = "default",
2091
1857
  ...restProps
2092
- } = props, $[0] = props, $[1] = asProp, $[2] = border2, $[3] = borderBottom2, $[4] = borderLeft2, $[5] = borderRight2, $[6] = borderTop2, $[7] = muted, $[8] = pressed, $[9] = restProps, $[10] = scheme, $[11] = selected, $[12] = shadow, $[13] = t0, $[14] = t1, $[15] = t2, $[16] = t3) : (asProp = $[1], border2 = $[2], borderBottom2 = $[3], borderLeft2 = $[4], borderRight2 = $[5], borderTop2 = $[6], muted = $[7], pressed = $[8], restProps = $[9], scheme = $[10], selected = $[11], shadow = $[12], t0 = $[13], t1 = $[14], t2 = $[15], t3 = $[16]);
2093
- const checkered = t0 === void 0 ? !1 : t0, focusRing = t1 === void 0 ? !1 : t1, radius = t2 === void 0 ? 0 : t2, toneProp = t3 === void 0 ? "default" : t3, as = isValidElementType(asProp) ? asProp : "div", rootTheme = useRootTheme(), tone = toneProp === "inherit" ? rootTheme.tone : toneProp, t4 = typeof as == "string" ? as : void 0, t5 = rootTheme.scheme;
2094
- let t6;
2095
- $[17] !== border2 ? (t6 = _getArrayProp(border2), $[17] = border2, $[18] = t6) : t6 = $[18];
2096
- let t7;
2097
- $[19] !== borderTop2 ? (t7 = _getArrayProp(borderTop2), $[19] = borderTop2, $[20] = t7) : t7 = $[20];
2098
- let t8;
2099
- $[21] !== borderRight2 ? (t8 = _getArrayProp(borderRight2), $[21] = borderRight2, $[22] = t8) : t8 = $[22];
2100
- let t9;
2101
- $[23] !== borderBottom2 ? (t9 = _getArrayProp(borderBottom2), $[23] = borderBottom2, $[24] = t9) : t9 = $[24];
2102
- let t10;
2103
- $[25] !== borderLeft2 ? (t10 = _getArrayProp(borderLeft2), $[25] = borderLeft2, $[26] = t10) : t10 = $[26];
2104
- let t11;
2105
- $[27] !== radius ? (t11 = _getArrayProp(radius), $[27] = radius, $[28] = t11) : t11 = $[28];
2106
- let t12;
2107
- $[29] !== shadow ? (t12 = _getArrayProp(shadow), $[29] = shadow, $[30] = t12) : t12 = $[30];
2108
- const t13 = checkered ? "" : void 0, t14 = pressed ? "" : void 0, t15 = selected ? "" : void 0;
2109
- let t16;
2110
- $[31] !== as || $[32] !== checkered || $[33] !== focusRing || $[34] !== muted || $[35] !== ref || $[36] !== restProps || $[37] !== rootTheme.scheme || $[38] !== selected || $[39] !== t10 || $[40] !== t11 || $[41] !== t12 || $[42] !== t13 || $[43] !== t14 || $[44] !== t15 || $[45] !== t4 || $[46] !== t6 || $[47] !== t7 || $[48] !== t8 || $[49] !== t9 || $[50] !== tone ? (t16 = /* @__PURE__ */ jsx(StyledCard, { "data-as": t4, "data-scheme": t5, "data-ui": "Card", "data-tone": tone, ...restProps, $border: t6, $borderTop: t7, $borderRight: t8, $borderBottom: t9, $borderLeft: t10, $checkered: checkered, $focusRing: focusRing, $muted: muted, $radius: t11, $shadow: t12, $tone: tone, "data-checkered": t13, "data-pressed": t14, "data-selected": t15, forwardedAs: as, ref, selected }), $[31] = as, $[32] = checkered, $[33] = focusRing, $[34] = muted, $[35] = ref, $[36] = restProps, $[37] = rootTheme.scheme, $[38] = selected, $[39] = t10, $[40] = t11, $[41] = t12, $[42] = t13, $[43] = t14, $[44] = t15, $[45] = t4, $[46] = t6, $[47] = t7, $[48] = t8, $[49] = t9, $[50] = tone, $[51] = t16) : t16 = $[51];
2111
- let t17;
2112
- return $[52] !== scheme || $[53] !== t16 || $[54] !== tone ? (t17 = /* @__PURE__ */ jsx(ThemeColorProvider, { scheme, tone, children: t16 }), $[52] = scheme, $[53] = t16, $[54] = tone, $[55] = t17) : t17 = $[55], t17;
1858
+ } = props, as = isValidElementType(asProp) ? asProp : "div", rootTheme = useRootTheme(), tone = toneProp === "inherit" ? rootTheme.tone : toneProp;
1859
+ return /* @__PURE__ */ jsx(ThemeColorProvider, { scheme, tone, children: /* @__PURE__ */ jsx(StyledCard, { "data-as": typeof as == "string" ? as : void 0, "data-scheme": rootTheme.scheme, "data-ui": "Card", "data-tone": tone, ...restProps, $border: _getArrayProp(border2), $borderTop: _getArrayProp(borderTop2), $borderRight: _getArrayProp(borderRight2), $borderBottom: _getArrayProp(borderBottom2), $borderLeft: _getArrayProp(borderLeft2), $checkered: checkered, $focusRing: focusRing, $muted: muted, $radius: _getArrayProp(radius), $shadow: _getArrayProp(shadow), $tone: tone, "data-checkered": checkered ? "" : void 0, "data-pressed": pressed ? "" : void 0, "data-selected": selected ? "" : void 0, forwardedAs: as, ref, selected }) });
2113
1860
  });
2114
1861
  Card.displayName = "ForwardRef(Card)";
2115
- function useClickOutsideEvent(listener, t0, boundaryElement) {
2116
- const $ = c(9), elementsArg = t0 === void 0 ? _temp$8 : t0;
2117
- let t1;
2118
- $[0] !== boundaryElement || $[1] !== elementsArg || $[2] !== listener ? (t1 = (evt) => {
1862
+ function useClickOutsideEvent(listener, elementsArg = () => EMPTY_ARRAY, boundaryElement) {
1863
+ const onEvent = useEffectEvent((evt) => {
2119
1864
  if (!listener)
2120
1865
  return;
2121
1866
  const target = evt.target;
@@ -2129,29 +1874,19 @@ function useClickOutsideEvent(listener, t0, boundaryElement) {
2129
1874
  if (el && (target === el || el.contains(target)))
2130
1875
  return;
2131
1876
  listener(evt);
2132
- }, $[0] = boundaryElement, $[1] = elementsArg, $[2] = listener, $[3] = t1) : t1 = $[3];
2133
- const onEvent = useEffectEvent(t1), hasListener = !!listener;
2134
- let t2;
2135
- $[4] !== hasListener || $[5] !== onEvent ? (t2 = () => {
2136
- if (!hasListener)
2137
- return;
2138
- const handleEvent = (evt_0) => onEvent(evt_0);
1877
+ }), hasListener = !!listener;
1878
+ useEffect(() => {
1879
+ if (!hasListener) return;
1880
+ const handleEvent = (evt) => onEvent(evt);
2139
1881
  return document.addEventListener("mousedown", handleEvent), () => {
2140
1882
  document.removeEventListener("mousedown", handleEvent);
2141
1883
  };
2142
- }, $[4] = hasListener, $[5] = onEvent, $[6] = t2) : t2 = $[6];
2143
- let t3;
2144
- $[7] !== hasListener ? (t3 = [hasListener], $[7] = hasListener, $[8] = t3) : t3 = $[8], useEffect(t2, t3), useDebugValue(listener ? "MouseDown On" : "MouseDown Off");
2145
- }
2146
- function _temp$8() {
2147
- return EMPTY_ARRAY;
1884
+ }, [hasListener]), useDebugValue(listener ? "MouseDown On" : "MouseDown Off");
2148
1885
  }
2149
1886
  function useCustomValidity(ref, customValidity) {
2150
- const $ = c(4);
2151
- let t0, t1;
2152
- $[0] !== customValidity || $[1] !== ref ? (t0 = () => {
1887
+ useEffect(() => {
2153
1888
  ref.current?.setCustomValidity(customValidity || "");
2154
- }, t1 = [customValidity, ref], $[0] = customValidity, $[1] = ref, $[2] = t0, $[3] = t1) : (t0 = $[2], t1 = $[3]), useEffect(t0, t1);
1889
+ }, [customValidity, ref]);
2155
1890
  }
2156
1891
  const _ResizeObserver = typeof document < "u" && typeof window < "u" && window.ResizeObserver ? window.ResizeObserver : ResizeObserver, _elementSizeObserver = _createElementSizeObserver();
2157
1892
  function _createElementRectValueListener() {
@@ -2193,36 +1928,24 @@ function _createElementSizeObserver() {
2193
1928
  };
2194
1929
  }
2195
1930
  function useElementSize(element) {
2196
- const $ = c(3), [size2, setSize] = useState(null);
2197
- let t0, t1;
2198
- return $[0] !== element ? (t0 = () => {
1931
+ const [size2, setSize] = useState(null);
1932
+ return useEffect(() => {
2199
1933
  if (element)
2200
1934
  return _elementSizeObserver.subscribe(element, setSize);
2201
- }, t1 = [element], $[0] = element, $[1] = t0, $[2] = t1) : (t0 = $[1], t1 = $[2]), useEffect(t0, t1), size2;
1935
+ }, [element]), size2;
2202
1936
  }
2203
1937
  function useGlobalKeyDown(onKeyDown) {
2204
- const $ = c(5);
2205
- let t0;
2206
- $[0] !== onKeyDown ? (t0 = (event) => onKeyDown(event), $[0] = onKeyDown, $[1] = t0) : t0 = $[1];
2207
- const handleKeyDown = useEffectEvent(t0);
2208
- let t1;
2209
- $[2] !== handleKeyDown ? (t1 = () => {
2210
- const handler = (event_0) => handleKeyDown(event_0);
1938
+ const handleKeyDown = useEffectEvent((event) => onKeyDown(event));
1939
+ useEffect(() => {
1940
+ const handler = (event) => handleKeyDown(event);
2211
1941
  return window.addEventListener("keydown", handler), () => window.removeEventListener("keydown", handler);
2212
- }, $[2] = handleKeyDown, $[3] = t1) : t1 = $[3];
2213
- let t2;
2214
- $[4] === Symbol.for("react.memo_cache_sentinel") ? (t2 = [], $[4] = t2) : t2 = $[4], useEffect(t1, t2);
1942
+ }, []);
2215
1943
  }
2216
1944
  function useMatchMedia(mediaQueryString, getServerSnapshot2) {
2217
- const $ = c(4);
2218
- useDebugValue(mediaQueryString);
2219
- let t0;
2220
- $[0] !== mediaQueryString ? (t0 = (onStoreChange) => {
1945
+ return useDebugValue(mediaQueryString), useSyncExternalStore(useCallback((onStoreChange) => {
2221
1946
  const media = window.matchMedia(mediaQueryString);
2222
1947
  return media.addEventListener("change", onStoreChange), () => media.removeEventListener("change", onStoreChange);
2223
- }, $[0] = mediaQueryString, $[1] = t0) : t0 = $[1];
2224
- let t1;
2225
- return $[2] !== mediaQueryString ? (t1 = () => window.matchMedia(mediaQueryString).matches, $[2] = mediaQueryString, $[3] = t1) : t1 = $[3], useSyncExternalStore(t0, t1, getServerSnapshot2);
1948
+ }, [mediaQueryString]), () => window.matchMedia(mediaQueryString).matches, getServerSnapshot2);
2226
1949
  }
2227
1950
  function _getMediaQuery(media, index) {
2228
1951
  return index === 0 ? `screen and (max-width: ${media[index] - 1}px)` : index === media.length ? `screen and (min-width: ${media[index - 1]}px)` : `screen and (min-width: ${media[index - 1]}px) and (max-width: ${media[index] - 1}px)`;
@@ -2273,25 +1996,16 @@ function getServerSnapshot() {
2273
1996
  return 0;
2274
1997
  }
2275
1998
  function useMediaIndex() {
2276
- const $ = c(2), {
1999
+ const {
2277
2000
  media
2278
- } = useTheme_v2();
2279
- let t0;
2280
- $[0] !== media ? (t0 = _createMediaStore(media), $[0] = media, $[1] = t0) : t0 = $[1];
2281
- const store = t0;
2001
+ } = useTheme_v2(), store = useMemo(() => _createMediaStore(media), [media]);
2282
2002
  return useSyncExternalStore(store.subscribe, store.getSnapshot, getServerSnapshot);
2283
2003
  }
2284
- function usePrefersDark(t0) {
2285
- return useMatchMedia("(prefers-color-scheme: dark)", t0 === void 0 ? _temp$7 : t0);
2004
+ function usePrefersDark(getServerSnapshot2 = () => !1) {
2005
+ return useMatchMedia("(prefers-color-scheme: dark)", getServerSnapshot2);
2286
2006
  }
2287
- function _temp$7() {
2288
- return !1;
2289
- }
2290
- function usePrefersReducedMotion(t0) {
2291
- return useMatchMedia("(prefers-reduced-motion: reduce)", t0 === void 0 ? _temp$6 : t0);
2292
- }
2293
- function _temp$6() {
2294
- return !1;
2007
+ function usePrefersReducedMotion(getServerSnapshot2 = () => !1) {
2008
+ return useMatchMedia("(prefers-reduced-motion: reduce)", getServerSnapshot2);
2295
2009
  }
2296
2010
  function checkboxBaseStyles() {
2297
2011
  return css`
@@ -2438,9 +2152,7 @@ const StyledCheckbox = /* @__PURE__ */ styled.div.withConfig({
2438
2152
  displayName: "Input",
2439
2153
  componentId: "sc-1l5mt2l-1"
2440
2154
  })(inputElementStyles), Checkbox = forwardRef(function(props, forwardedRef) {
2441
- const $ = c(25);
2442
- let checked, className, customValidity, disabled, indeterminate, readOnly, restProps, style;
2443
- $[0] !== props ? ({
2155
+ const {
2444
2156
  checked,
2445
2157
  className,
2446
2158
  disabled,
@@ -2449,27 +2161,16 @@ const StyledCheckbox = /* @__PURE__ */ styled.div.withConfig({
2449
2161
  readOnly,
2450
2162
  style,
2451
2163
  ...restProps
2452
- } = props, $[0] = props, $[1] = checked, $[2] = className, $[3] = customValidity, $[4] = disabled, $[5] = indeterminate, $[6] = readOnly, $[7] = restProps, $[8] = style) : (checked = $[1], className = $[2], customValidity = $[3], disabled = $[4], indeterminate = $[5], readOnly = $[6], restProps = $[7], style = $[8]);
2453
- const ref = useRef(null);
2454
- let t0;
2455
- $[9] === Symbol.for("react.memo_cache_sentinel") ? (t0 = () => ref.current, $[9] = t0) : t0 = $[9], useImperativeHandle(forwardedRef, t0);
2456
- let t1, t2;
2457
- $[10] !== indeterminate ? (t1 = () => {
2164
+ } = props, ref = useRef(null);
2165
+ return useImperativeHandle(forwardedRef, () => ref.current), useEffect(() => {
2458
2166
  ref.current && (ref.current.indeterminate = indeterminate || !1);
2459
- }, t2 = [indeterminate], $[10] = indeterminate, $[11] = t1, $[12] = t2) : (t1 = $[11], t2 = $[12]), useEffect(t1, t2), useCustomValidity(ref, customValidity);
2460
- const t3 = !disabled && readOnly ? "" : void 0, t4 = customValidity ? "" : void 0, t5 = disabled || readOnly;
2461
- let t6;
2462
- $[13] !== checked || $[14] !== readOnly || $[15] !== restProps || $[16] !== t3 || $[17] !== t4 || $[18] !== t5 ? (t6 = /* @__PURE__ */ jsx(Input$5, { "data-read-only": t3, "data-error": t4, ...restProps, checked, disabled: t5, type: "checkbox", readOnly, ref }), $[13] = checked, $[14] = readOnly, $[15] = restProps, $[16] = t3, $[17] = t4, $[18] = t5, $[19] = t6) : t6 = $[19];
2463
- let t7;
2464
- $[20] === Symbol.for("react.memo_cache_sentinel") ? (t7 = /* @__PURE__ */ jsxs("span", { children: [
2465
- /* @__PURE__ */ jsx(CheckmarkIcon, {}),
2466
- /* @__PURE__ */ jsx(RemoveIcon, {})
2467
- ] }), $[20] = t7) : t7 = $[20];
2468
- let t8;
2469
- return $[21] !== className || $[22] !== style || $[23] !== t6 ? (t8 = /* @__PURE__ */ jsxs(StyledCheckbox, { className, "data-ui": "Checkbox", style, children: [
2470
- t6,
2471
- t7
2472
- ] }), $[21] = className, $[22] = style, $[23] = t6, $[24] = t8) : t8 = $[24], t8;
2167
+ }, [indeterminate]), useCustomValidity(ref, customValidity), /* @__PURE__ */ jsxs(StyledCheckbox, { className, "data-ui": "Checkbox", style, children: [
2168
+ /* @__PURE__ */ jsx(Input$5, { "data-read-only": !disabled && readOnly ? "" : void 0, "data-error": customValidity ? "" : void 0, ...restProps, checked, disabled: disabled || readOnly, type: "checkbox", readOnly, ref }),
2169
+ /* @__PURE__ */ jsxs("span", { children: [
2170
+ /* @__PURE__ */ jsx(CheckmarkIcon, {}),
2171
+ /* @__PURE__ */ jsx(RemoveIcon, {})
2172
+ ] })
2173
+ ] });
2473
2174
  });
2474
2175
  Checkbox.displayName = "ForwardRef(Checkbox)";
2475
2176
  function codeSyntaxHighlightingStyle({
@@ -2624,26 +2325,14 @@ const LazyRefractor = lazy(() => import("./refractor.mjs")), StyledCode = /* @__
2624
2325
  displayName: "StyledCode",
2625
2326
  componentId: "sc-4dymyn-0"
2626
2327
  })(codeBaseStyle, responsiveCodeFontStyle), Code = forwardRef(function(props, ref) {
2627
- const $ = c(22);
2628
- let children, language, restProps, t0, weight;
2629
- $[0] !== props ? ({
2328
+ const {
2630
2329
  children,
2631
2330
  language,
2632
- size: t0,
2331
+ size: size2 = 2,
2633
2332
  weight,
2634
2333
  ...restProps
2635
- } = props, $[0] = props, $[1] = children, $[2] = language, $[3] = restProps, $[4] = t0, $[5] = weight) : (children = $[1], language = $[2], restProps = $[3], t0 = $[4], weight = $[5]);
2636
- const size2 = t0 === void 0 ? 2 : t0;
2637
- let t1;
2638
- $[6] !== size2 ? (t1 = _getArrayProp(size2), $[6] = size2, $[7] = t1) : t1 = $[7];
2639
- let t2;
2640
- $[8] !== children ? (t2 = /* @__PURE__ */ jsx("code", { children }), $[8] = children, $[9] = t2) : t2 = $[9];
2641
- let t3;
2642
- $[10] !== children || $[11] !== language ? (t3 = /* @__PURE__ */ jsx(LazyRefractor, { language, value: children }), $[10] = children, $[11] = language, $[12] = t3) : t3 = $[12];
2643
- let t4;
2644
- $[13] !== t2 || $[14] !== t3 ? (t4 = /* @__PURE__ */ jsx(Suspense, { fallback: t2, children: t3 }), $[13] = t2, $[14] = t3, $[15] = t4) : t4 = $[15];
2645
- let t5;
2646
- return $[16] !== ref || $[17] !== restProps || $[18] !== t1 || $[19] !== t4 || $[20] !== weight ? (t5 = /* @__PURE__ */ jsx(StyledCode, { "data-ui": "Code", ...restProps, $size: t1, $weight: weight, ref, children: t4 }), $[16] = ref, $[17] = restProps, $[18] = t1, $[19] = t4, $[20] = weight, $[21] = t5) : t5 = $[21], t5;
2334
+ } = props;
2335
+ return /* @__PURE__ */ jsx(StyledCode, { "data-ui": "Code", ...restProps, $size: _getArrayProp(size2), $weight: weight, ref, children: /* @__PURE__ */ jsx(Suspense, { fallback: /* @__PURE__ */ jsx("code", { children }), children: /* @__PURE__ */ jsx(LazyRefractor, { language, value: children }) }) });
2647
2336
  });
2648
2337
  Code.displayName = "ForwardRef(Code)";
2649
2338
  const BASE_STYLE$1 = {
@@ -2666,27 +2355,19 @@ const StyledContainer = /* @__PURE__ */ styled(Box).withConfig({
2666
2355
  displayName: "StyledContainer",
2667
2356
  componentId: "sc-wyroop-0"
2668
2357
  })(containerBaseStyle, responsiveContainerWidthStyle), Container = forwardRef(function(props, ref) {
2669
- const $ = c(11);
2670
- let as, restProps, t0;
2671
- $[0] !== props ? ({
2358
+ const {
2672
2359
  as,
2673
- width: t0,
2360
+ width = 2,
2674
2361
  ...restProps
2675
- } = props, $[0] = props, $[1] = as, $[2] = restProps, $[3] = t0) : (as = $[1], restProps = $[2], t0 = $[3]);
2676
- const width = t0 === void 0 ? 2 : t0;
2677
- let t1;
2678
- $[4] !== width ? (t1 = _getArrayProp(width), $[4] = width, $[5] = t1) : t1 = $[5];
2679
- let t2;
2680
- return $[6] !== as || $[7] !== ref || $[8] !== restProps || $[9] !== t1 ? (t2 = /* @__PURE__ */ jsx(StyledContainer, { "data-ui": "Container", ...restProps, $width: t1, forwardedAs: as, ref }), $[6] = as, $[7] = ref, $[8] = restProps, $[9] = t1, $[10] = t2) : t2 = $[10], t2;
2362
+ } = props;
2363
+ return /* @__PURE__ */ jsx(StyledContainer, { "data-ui": "Container", ...restProps, $width: _getArrayProp(width), forwardedAs: as, ref });
2681
2364
  });
2682
2365
  Container.displayName = "ForwardRef(Container)";
2683
2366
  const StyledGrid = /* @__PURE__ */ styled(Box).withConfig({
2684
2367
  displayName: "StyledGrid",
2685
2368
  componentId: "sc-v8t8oz-0"
2686
2369
  })(responsiveGridStyle), Grid = forwardRef(function(props, ref) {
2687
- const $ = c(42);
2688
- let as, autoCols, autoFlow, autoRows, children, columns, gap, gapX, gapY, restProps, rows;
2689
- $[0] !== props ? ({
2370
+ const {
2690
2371
  as,
2691
2372
  autoRows,
2692
2373
  autoCols,
@@ -2698,26 +2379,8 @@ const StyledGrid = /* @__PURE__ */ styled(Box).withConfig({
2698
2379
  rows,
2699
2380
  children,
2700
2381
  ...restProps
2701
- } = props, $[0] = props, $[1] = as, $[2] = autoCols, $[3] = autoFlow, $[4] = autoRows, $[5] = children, $[6] = columns, $[7] = gap, $[8] = gapX, $[9] = gapY, $[10] = restProps, $[11] = rows) : (as = $[1], autoCols = $[2], autoFlow = $[3], autoRows = $[4], children = $[5], columns = $[6], gap = $[7], gapX = $[8], gapY = $[9], restProps = $[10], rows = $[11]);
2702
- const t0 = typeof as == "string" ? as : void 0;
2703
- let t1;
2704
- $[12] !== autoRows ? (t1 = _getArrayProp(autoRows), $[12] = autoRows, $[13] = t1) : t1 = $[13];
2705
- let t2;
2706
- $[14] !== autoCols ? (t2 = _getArrayProp(autoCols), $[14] = autoCols, $[15] = t2) : t2 = $[15];
2707
- let t3;
2708
- $[16] !== autoFlow ? (t3 = _getArrayProp(autoFlow), $[16] = autoFlow, $[17] = t3) : t3 = $[17];
2709
- let t4;
2710
- $[18] !== columns ? (t4 = _getArrayProp(columns), $[18] = columns, $[19] = t4) : t4 = $[19];
2711
- let t5;
2712
- $[20] !== gap ? (t5 = _getArrayProp(gap), $[20] = gap, $[21] = t5) : t5 = $[21];
2713
- let t6;
2714
- $[22] !== gapX ? (t6 = _getArrayProp(gapX), $[22] = gapX, $[23] = t6) : t6 = $[23];
2715
- let t7;
2716
- $[24] !== gapY ? (t7 = _getArrayProp(gapY), $[24] = gapY, $[25] = t7) : t7 = $[25];
2717
- let t8;
2718
- $[26] !== rows ? (t8 = _getArrayProp(rows), $[26] = rows, $[27] = t8) : t8 = $[27];
2719
- let t9;
2720
- return $[28] !== as || $[29] !== children || $[30] !== ref || $[31] !== restProps || $[32] !== t0 || $[33] !== t1 || $[34] !== t2 || $[35] !== t3 || $[36] !== t4 || $[37] !== t5 || $[38] !== t6 || $[39] !== t7 || $[40] !== t8 ? (t9 = /* @__PURE__ */ jsx(StyledGrid, { "data-as": t0, "data-ui": "Grid", ...restProps, $autoRows: t1, $autoCols: t2, $autoFlow: t3, $columns: t4, $gap: t5, $gapX: t6, $gapY: t7, $rows: t8, forwardedAs: as, ref, children }), $[28] = as, $[29] = children, $[30] = ref, $[31] = restProps, $[32] = t0, $[33] = t1, $[34] = t2, $[35] = t3, $[36] = t4, $[37] = t5, $[38] = t6, $[39] = t7, $[40] = t8, $[41] = t9) : t9 = $[41], t9;
2382
+ } = props;
2383
+ return /* @__PURE__ */ jsx(StyledGrid, { "data-as": typeof as == "string" ? as : void 0, "data-ui": "Grid", ...restProps, $autoRows: _getArrayProp(autoRows), $autoCols: _getArrayProp(autoCols), $autoFlow: _getArrayProp(autoFlow), $columns: _getArrayProp(columns), $gap: _getArrayProp(gap), $gapX: _getArrayProp(gapX), $gapY: _getArrayProp(gapY), $rows: _getArrayProp(rows), forwardedAs: as, ref, children });
2721
2384
  });
2722
2385
  Grid.displayName = "ForwardRef(Grid)";
2723
2386
  function headingBaseStyle(props) {
@@ -2783,32 +2446,18 @@ const StyledHeading = /* @__PURE__ */ styled.div.withConfig({
2783
2446
  displayName: "StyledHeading",
2784
2447
  componentId: "sc-137lwim-0"
2785
2448
  })(headingBaseStyle, responsiveTextAlignStyle, responsiveHeadingFont), Heading = forwardRef(function(props, ref) {
2786
- const $ = c(26);
2787
- let align, childrenProp, restProps, t0, t1, t2, textOverflow, weight;
2788
- $[0] !== props ? ({
2789
- accent: t0,
2449
+ const {
2450
+ accent = !1,
2790
2451
  align,
2791
2452
  children: childrenProp,
2792
- muted: t1,
2793
- size: t2,
2453
+ muted = !1,
2454
+ size: size2 = 2,
2794
2455
  textOverflow,
2795
2456
  weight,
2796
2457
  ...restProps
2797
- } = props, $[0] = props, $[1] = align, $[2] = childrenProp, $[3] = restProps, $[4] = t0, $[5] = t1, $[6] = t2, $[7] = textOverflow, $[8] = weight) : (align = $[1], childrenProp = $[2], restProps = $[3], t0 = $[4], t1 = $[5], t2 = $[6], textOverflow = $[7], weight = $[8]);
2798
- const accent = t0 === void 0 ? !1 : t0, muted = t1 === void 0 ? !1 : t1, size2 = t2 === void 0 ? 2 : t2;
2458
+ } = props;
2799
2459
  let children = childrenProp;
2800
- if (textOverflow === "ellipsis") {
2801
- let t32;
2802
- $[9] !== children ? (t32 = /* @__PURE__ */ jsx(SpanWithTextOverflow, { children }), $[9] = children, $[10] = t32) : t32 = $[10], children = t32;
2803
- }
2804
- let t3;
2805
- $[11] !== align ? (t3 = _getArrayProp(align), $[11] = align, $[12] = t3) : t3 = $[12];
2806
- let t4;
2807
- $[13] !== size2 ? (t4 = _getArrayProp(size2), $[13] = size2, $[14] = t4) : t4 = $[14];
2808
- let t5;
2809
- $[15] !== children ? (t5 = /* @__PURE__ */ jsx("span", { children }), $[15] = children, $[16] = t5) : t5 = $[16];
2810
- let t6;
2811
- return $[17] !== accent || $[18] !== muted || $[19] !== ref || $[20] !== restProps || $[21] !== t3 || $[22] !== t4 || $[23] !== t5 || $[24] !== weight ? (t6 = /* @__PURE__ */ jsx(StyledHeading, { "data-ui": "Heading", ...restProps, $accent: accent, $align: t3, $muted: muted, $size: t4, $weight: weight, ref, children: t5 }), $[17] = accent, $[18] = muted, $[19] = ref, $[20] = restProps, $[21] = t3, $[22] = t4, $[23] = t5, $[24] = weight, $[25] = t6) : t6 = $[25], t6;
2460
+ return textOverflow === "ellipsis" && (children = /* @__PURE__ */ jsx(SpanWithTextOverflow, { children })), /* @__PURE__ */ jsx(StyledHeading, { "data-ui": "Heading", ...restProps, $accent: accent, $align: _getArrayProp(align), $muted: muted, $size: _getArrayProp(size2), $weight: weight, ref, children: /* @__PURE__ */ jsx("span", { children }) });
2812
2461
  });
2813
2462
  Heading.displayName = "ForwardRef(Heading)";
2814
2463
  function inlineBaseStyle() {
@@ -2842,27 +2491,15 @@ const StyledInline = /* @__PURE__ */ styled(Box).withConfig({
2842
2491
  displayName: "StyledInline",
2843
2492
  componentId: "sc-1pkiy6j-0"
2844
2493
  })(inlineBaseStyle, inlineSpaceStyle), Inline = forwardRef(function(props, ref) {
2845
- const $ = c(15);
2846
- let as, childrenProp, restProps, space;
2847
- $[0] !== props ? ({
2494
+ const {
2848
2495
  as,
2849
2496
  children: childrenProp,
2850
2497
  space,
2851
2498
  ...restProps
2852
- } = props, $[0] = props, $[1] = as, $[2] = childrenProp, $[3] = restProps, $[4] = space) : (as = $[1], childrenProp = $[2], restProps = $[3], space = $[4]);
2853
- let t0;
2854
- $[5] !== childrenProp ? (t0 = Children.map(childrenProp, _temp$5), $[5] = childrenProp, $[6] = t0) : t0 = $[6];
2855
- const children = t0;
2856
- let t1;
2857
- $[7] !== space ? (t1 = _getArrayProp(space), $[7] = space, $[8] = t1) : t1 = $[8];
2858
- const t2 = ref;
2859
- let t3;
2860
- return $[9] !== as || $[10] !== children || $[11] !== restProps || $[12] !== t1 || $[13] !== t2 ? (t3 = /* @__PURE__ */ jsx(StyledInline, { "data-ui": "Inline", ...restProps, $space: t1, forwardedAs: as, ref: t2, children }), $[9] = as, $[10] = children, $[11] = restProps, $[12] = t1, $[13] = t2, $[14] = t3) : t3 = $[14], t3;
2499
+ } = props, children = useMemo(() => Children.map(childrenProp, (child) => child && /* @__PURE__ */ jsx("div", { children: child })), [childrenProp]);
2500
+ return /* @__PURE__ */ jsx(StyledInline, { "data-ui": "Inline", ...restProps, $space: _getArrayProp(space), forwardedAs: as, ref, children });
2861
2501
  });
2862
2502
  Inline.displayName = "ForwardRef(Inline)";
2863
- function _temp$5(child) {
2864
- return child && /* @__PURE__ */ jsx("div", { children: child });
2865
- }
2866
2503
  function kbdStyle() {
2867
2504
  return css`
2868
2505
  --card-bg-color: var(--card-kbd-bg-color);
@@ -2884,24 +2521,14 @@ const StyledKBD = /* @__PURE__ */ styled.kbd.withConfig({
2884
2521
  displayName: "StyledKBD",
2885
2522
  componentId: "sc-1w7yd8w-0"
2886
2523
  })(responsiveRadiusStyle, kbdStyle), KBD = forwardRef(function(props, ref) {
2887
- const $ = c(19);
2888
- let children, restProps, t0, t1, t2;
2889
- $[0] !== props ? ({
2524
+ const {
2890
2525
  children,
2891
- fontSize: t0,
2892
- padding: t1,
2893
- radius: t2,
2526
+ fontSize: fontSize2 = 0,
2527
+ padding = 1,
2528
+ radius = 2,
2894
2529
  ...restProps
2895
- } = props, $[0] = props, $[1] = children, $[2] = restProps, $[3] = t0, $[4] = t1, $[5] = t2) : (children = $[1], restProps = $[2], t0 = $[3], t1 = $[4], t2 = $[5]);
2896
- const fontSize2 = t0 === void 0 ? 0 : t0, padding = t1 === void 0 ? 1 : t1, radius = t2 === void 0 ? 2 : t2;
2897
- let t3;
2898
- $[6] !== radius ? (t3 = _getArrayProp(radius), $[6] = radius, $[7] = t3) : t3 = $[7];
2899
- let t4;
2900
- $[8] !== children || $[9] !== fontSize2 ? (t4 = /* @__PURE__ */ jsx(Text, { as: "span", size: fontSize2, weight: "semibold", children }), $[8] = children, $[9] = fontSize2, $[10] = t4) : t4 = $[10];
2901
- let t5;
2902
- $[11] !== padding || $[12] !== t4 ? (t5 = /* @__PURE__ */ jsx(Box, { as: "span", padding, children: t4 }), $[11] = padding, $[12] = t4, $[13] = t5) : t5 = $[13];
2903
- let t6;
2904
- return $[14] !== ref || $[15] !== restProps || $[16] !== t3 || $[17] !== t5 ? (t6 = /* @__PURE__ */ jsx(StyledKBD, { "data-ui": "KBD", ...restProps, $radius: t3, ref, children: t5 }), $[14] = ref, $[15] = restProps, $[16] = t3, $[17] = t5, $[18] = t6) : t6 = $[18], t6;
2530
+ } = props;
2531
+ return /* @__PURE__ */ jsx(StyledKBD, { "data-ui": "KBD", ...restProps, $radius: _getArrayProp(radius), ref, children: /* @__PURE__ */ jsx(Box, { as: "span", padding, children: /* @__PURE__ */ jsx(Text, { as: "span", size: fontSize2, weight: "semibold", children }) }) });
2905
2532
  });
2906
2533
  KBD.displayName = "ForwardRef(KBD)";
2907
2534
  const origin = {
@@ -3029,15 +2656,12 @@ const StyledArrow = /* @__PURE__ */ styled.div.withConfig({
3029
2656
  displayName: "ShapePath",
3030
2657
  componentId: "sc-12vzy6c-2"
3031
2658
  })`fill:var(--card-bg-color);`, Arrow = forwardRef(function(props, ref) {
3032
- const $ = c(24);
3033
- let h, restProps, t0, w;
3034
- $[0] !== props ? ({
2659
+ const {
3035
2660
  width: w,
3036
2661
  height: h,
3037
- radius: t0,
2662
+ radius = 0,
3038
2663
  ...restProps
3039
- } = props, $[0] = props, $[1] = h, $[2] = restProps, $[3] = t0, $[4] = w) : (h = $[1], restProps = $[2], t0 = $[3], w = $[4]);
3040
- const radius = t0 === void 0 ? 0 : t0, {
2664
+ } = props, {
3041
2665
  card
3042
2666
  } = useTheme_v2(), strokeWidth = card.shadow.outline, center = w / 2, points = [{
3043
2667
  x: 0,
@@ -3057,38 +2681,24 @@ const StyledArrow = /* @__PURE__ */ styled.div.withConfig({
3057
2681
  }, {
3058
2682
  x: w,
3059
2683
  y: 0
3060
- }], cmds = getRoundedCommands(points), path = compileCommands(cmds), strokePath = `${path}`, fillPath = `${path} M ${w} -1 M 0 -1 Z`, t1 = `0 0 ${w} ${w}`;
3061
- let t2;
3062
- $[5] !== strokeWidth || $[6] !== w ? (t2 = /* @__PURE__ */ jsx("mask", { id: "stroke-mask", children: /* @__PURE__ */ jsx("rect", { x: 0, y: strokeWidth, width: w, height: w, fill: "white" }) }), $[5] = strokeWidth, $[6] = w, $[7] = t2) : t2 = $[7];
3063
- const t3 = strokeWidth * 2;
3064
- let t4;
3065
- $[8] !== strokePath || $[9] !== t3 ? (t4 = /* @__PURE__ */ jsx(StrokePath, { d: strokePath, mask: "url(#stroke-mask)", strokeWidth: t3 }), $[8] = strokePath, $[9] = t3, $[10] = t4) : t4 = $[10];
3066
- let t5;
3067
- $[11] !== fillPath ? (t5 = /* @__PURE__ */ jsx(ShapePath, { d: fillPath }), $[11] = fillPath, $[12] = t5) : t5 = $[12];
3068
- let t6;
3069
- $[13] !== t1 || $[14] !== t2 || $[15] !== t4 || $[16] !== t5 || $[17] !== w ? (t6 = /* @__PURE__ */ jsxs("svg", { width: w, height: w, viewBox: t1, children: [
3070
- t2,
3071
- t4,
3072
- t5
3073
- ] }), $[13] = t1, $[14] = t2, $[15] = t4, $[16] = t5, $[17] = w, $[18] = t6) : t6 = $[18];
3074
- let t7;
3075
- return $[19] !== ref || $[20] !== restProps || $[21] !== t6 || $[22] !== w ? (t7 = /* @__PURE__ */ jsx(StyledArrow, { ...restProps, $w: w, ref, children: t6 }), $[19] = ref, $[20] = restProps, $[21] = t6, $[22] = w, $[23] = t7) : t7 = $[23], t7;
2684
+ }], cmds = getRoundedCommands(points), path = compileCommands(cmds), strokePath = `${path}`, fillPath = `${path} M ${w} -1 M 0 -1 Z`;
2685
+ return /* @__PURE__ */ jsx(StyledArrow, { ...restProps, $w: w, ref, children: /* @__PURE__ */ jsxs("svg", { width: w, height: w, viewBox: `0 0 ${w} ${w}`, children: [
2686
+ /* @__PURE__ */ jsx("mask", { id: "stroke-mask", children: /* @__PURE__ */ jsx("rect", { x: 0, y: strokeWidth, width: w, height: w, fill: "white" }) }),
2687
+ /* @__PURE__ */ jsx(StrokePath, { d: strokePath, mask: "url(#stroke-mask)", strokeWidth: strokeWidth * 2 }),
2688
+ /* @__PURE__ */ jsx(ShapePath, { d: fillPath })
2689
+ ] }) });
3076
2690
  });
3077
2691
  Arrow.displayName = "ForwardRef(Arrow)";
3078
2692
  const BoundaryElementContext = createGlobalScopedContext("@sanity/ui/context/boundaryElement", null);
3079
2693
  function BoundaryElementProvider(props) {
3080
- const $ = c(5), {
2694
+ const {
3081
2695
  children,
3082
2696
  element
3083
- } = props;
3084
- let t0;
3085
- $[0] !== element ? (t0 = {
2697
+ } = props, value = useMemo(() => ({
3086
2698
  version: 0,
3087
2699
  element
3088
- }, $[0] = element, $[1] = t0) : t0 = $[1];
3089
- const value = t0;
3090
- let t1;
3091
- return $[2] !== children || $[3] !== value ? (t1 = /* @__PURE__ */ jsx(BoundaryElementContext.Provider, { value, children }), $[2] = children, $[3] = value, $[4] = t1) : t1 = $[4], t1;
2700
+ }), [element]);
2701
+ return /* @__PURE__ */ jsx(BoundaryElementContext.Provider, { value, children });
3092
2702
  }
3093
2703
  BoundaryElementProvider.displayName = "BoundaryElementProvider";
3094
2704
  function isRecord(value) {
@@ -3125,32 +2735,18 @@ function findMinBreakpoints(media, width) {
3125
2735
  return ret;
3126
2736
  }
3127
2737
  const ElementQuery = forwardRef(function(props, forwardedRef) {
3128
- const $ = c(18), theme = useTheme_v2();
3129
- let _media, children, restProps;
3130
- $[0] !== props ? ({
2738
+ const theme = useTheme_v2(), {
3131
2739
  children,
3132
2740
  media: _media,
3133
2741
  ...restProps
3134
- } = props, $[0] = props, $[1] = _media, $[2] = children, $[3] = restProps) : (_media = $[1], children = $[2], restProps = $[3]);
3135
- const media = _media ?? theme.media, [element, setElement] = useState(null), width = useElementSize(element)?.border.width ?? window.innerWidth;
3136
- let t0;
3137
- if ($[4] !== media || $[5] !== width) {
2742
+ } = props, media = _media ?? theme.media, [element, setElement] = useState(null), elementSize = useElementSize(element), width = useMemo(() => elementSize?.border.width ?? window.innerWidth, [elementSize]), max = useMemo(() => {
3138
2743
  const eq = findMaxBreakpoints(media, width);
3139
- t0 = eq.length ? eq.join(" ") : void 0, $[4] = media, $[5] = width, $[6] = t0;
3140
- } else
3141
- t0 = $[6];
3142
- const max = t0;
3143
- let t1;
3144
- if ($[7] !== media || $[8] !== width) {
3145
- const eq_0 = findMinBreakpoints(media, width);
3146
- t1 = eq_0.length ? eq_0.join(" ") : void 0, $[7] = media, $[8] = width, $[9] = t1;
3147
- } else
3148
- t1 = $[9];
3149
- const min = t1;
3150
- let t2, t3;
3151
- $[10] !== element ? (t2 = () => element, t3 = [element], $[10] = element, $[11] = t2, $[12] = t3) : (t2 = $[11], t3 = $[12]), useImperativeHandle(forwardedRef, t2, t3);
3152
- let t4;
3153
- return $[13] !== children || $[14] !== max || $[15] !== min || $[16] !== restProps ? (t4 = /* @__PURE__ */ jsx("div", { "data-ui": "ElementQuery", ...restProps, "data-eq-max": max, "data-eq-min": min, ref: setElement, children }), $[13] = children, $[14] = max, $[15] = min, $[16] = restProps, $[17] = t4) : t4 = $[17], t4;
2744
+ return eq.length ? eq.join(" ") : void 0;
2745
+ }, [media, width]), min = useMemo(() => {
2746
+ const eq = findMinBreakpoints(media, width);
2747
+ return eq.length ? eq.join(" ") : void 0;
2748
+ }, [media, width]);
2749
+ return useImperativeHandle(forwardedRef, () => element, [element]), /* @__PURE__ */ jsx("div", { "data-ui": "ElementQuery", ...restProps, "data-eq-max": max, "data-eq-min": min, ref: setElement, children });
3154
2750
  });
3155
2751
  ElementQuery.displayName = "ForwardRef(ElementQuery)";
3156
2752
  function getLayerContext(contextValue) {
@@ -3164,21 +2760,10 @@ function getLayerContext(contextValue) {
3164
2760
  }
3165
2761
  const LayerContext = createGlobalScopedContext("@sanity/ui/context/layer", null);
3166
2762
  function LayerProvider(props) {
3167
- const $ = c(21), {
2763
+ const {
3168
2764
  children,
3169
- zOffset: t0
3170
- } = props, zOffsetProp = t0 === void 0 ? 0 : t0, parentContextValue = useContext(LayerContext);
3171
- let t1;
3172
- $[0] !== parentContextValue ? (t1 = parentContextValue && getLayerContext(parentContextValue), $[0] = parentContextValue, $[1] = t1) : t1 = $[1];
3173
- const parent = t1, parentRegisterChild = parent?.registerChild, level = (parent?.level ?? 0) + 1;
3174
- let t2;
3175
- $[2] !== zOffsetProp ? (t2 = _getArrayProp(zOffsetProp), $[2] = zOffsetProp, $[3] = t2) : t2 = $[3];
3176
- const zOffset = t2, maxMediaIndex = zOffset.length - 1, mediaIndex = Math.min(useMediaIndex(), maxMediaIndex), zIndex = parent ? parent.zIndex + zOffset[mediaIndex] : zOffset[mediaIndex];
3177
- let t3;
3178
- $[4] === Symbol.for("react.memo_cache_sentinel") ? (t3 = {}, $[4] = t3) : t3 = $[4];
3179
- const [, setChildLayers] = useState(t3), [size2, setSize] = useState(0), isTopLayer = size2 === 0;
3180
- let t4;
3181
- $[5] !== parentRegisterChild || $[6] !== setChildLayers ? (t4 = (childLevel) => {
2765
+ zOffset: zOffsetProp = 0
2766
+ } = props, parentContextValue = useContext(LayerContext), parent = parentContextValue && getLayerContext(parentContextValue), parentRegisterChild = parent?.registerChild, level = (parent?.level ?? 0) + 1, zOffset = _getArrayProp(zOffsetProp), maxMediaIndex = zOffset.length - 1, mediaIndex = Math.min(useMediaIndex(), maxMediaIndex), zIndex = parent ? parent.zIndex + zOffset[mediaIndex] : zOffset[mediaIndex], [, setChildLayers] = useState({}), [size2, setSize] = useState(0), isTopLayer = size2 === 0, registerChild = useCallback((childLevel) => {
3182
2767
  const parentDispose = parentRegisterChild?.(childLevel);
3183
2768
  return childLevel !== void 0 ? setChildLayers((state) => {
3184
2769
  const prevLen = state[childLevel] ?? 0, nextState = {
@@ -3186,47 +2771,34 @@ function LayerProvider(props) {
3186
2771
  [childLevel]: prevLen + 1
3187
2772
  };
3188
2773
  return setSize(Object.keys(nextState).length), nextState;
3189
- }) : setSize(_temp$4), () => {
3190
- childLevel !== void 0 ? setChildLayers((state_0) => {
3191
- const nextState_0 = {
3192
- ...state_0
2774
+ }) : setSize((v) => v + 1), () => {
2775
+ childLevel !== void 0 ? setChildLayers((state) => {
2776
+ const nextState = {
2777
+ ...state
3193
2778
  };
3194
- return nextState_0[childLevel] === 1 ? (delete nextState_0[childLevel], setSize(Object.keys(nextState_0).length)) : nextState_0[childLevel] = nextState_0[childLevel] - 1, nextState_0;
3195
- }) : setSize(_temp2$2), parentDispose?.();
2779
+ return nextState[childLevel] === 1 ? (delete nextState[childLevel], setSize(Object.keys(nextState).length)) : nextState[childLevel] -= 1, nextState;
2780
+ }) : setSize((v) => v - 1), parentDispose?.();
3196
2781
  };
3197
- }, $[5] = parentRegisterChild, $[6] = setChildLayers, $[7] = t4) : t4 = $[7];
3198
- const registerChild = t4;
3199
- let t5, t6;
3200
- $[8] !== level || $[9] !== parentRegisterChild ? (t5 = () => parentRegisterChild?.(level), t6 = [level, parentRegisterChild], $[8] = level, $[9] = parentRegisterChild, $[10] = t5, $[11] = t6) : (t5 = $[10], t6 = $[11]), useEffect(t5, t6);
3201
- let t7;
3202
- $[12] !== isTopLayer || $[13] !== level || $[14] !== registerChild || $[15] !== size2 || $[16] !== zIndex ? (t7 = {
2782
+ }, [parentRegisterChild, setSize, setChildLayers]);
2783
+ useEffect(() => parentRegisterChild?.(level), [level, parentRegisterChild]);
2784
+ const value = useMemo(() => ({
3203
2785
  version: 0,
3204
2786
  isTopLayer,
3205
2787
  level,
3206
2788
  registerChild,
3207
2789
  size: size2,
3208
2790
  zIndex
3209
- }, $[12] = isTopLayer, $[13] = level, $[14] = registerChild, $[15] = size2, $[16] = zIndex, $[17] = t7) : t7 = $[17];
3210
- const value = t7;
3211
- let t8;
3212
- return $[18] !== children || $[19] !== value ? (t8 = /* @__PURE__ */ jsx(LayerContext.Provider, { value, children }), $[18] = children, $[19] = value, $[20] = t8) : t8 = $[20], t8;
3213
- }
3214
- function _temp2$2(v_0) {
3215
- return v_0 - 1;
3216
- }
3217
- function _temp$4(v) {
3218
- return v + 1;
2791
+ }), [isTopLayer, level, registerChild, size2, zIndex]);
2792
+ return /* @__PURE__ */ jsx(LayerContext.Provider, { value, children });
3219
2793
  }
3220
2794
  LayerProvider.displayName = "LayerProvider";
3221
2795
  function useLayer() {
3222
- const $ = c(2), value = useContext(LayerContext);
2796
+ const value = useContext(LayerContext);
3223
2797
  if (!value)
3224
2798
  throw new Error("useLayer(): missing context value");
3225
2799
  try {
3226
- let t1;
3227
- return $[0] !== value ? (t1 = getLayerContext(value), $[0] = value, $[1] = t1) : t1 = $[1], t1;
3228
- } catch (t0) {
3229
- const err = t0;
2800
+ return getLayerContext(value);
2801
+ } catch (err) {
3230
2802
  throw err instanceof Error ? new Error(`useLayer(): ${err.message}`) : new Error(`useLayer(): ${err}`);
3231
2803
  }
3232
2804
  }
@@ -3236,54 +2808,37 @@ const StyledLayer = /* @__PURE__ */ styled.div.withConfig({
3236
2808
  })({
3237
2809
  position: "relative"
3238
2810
  }), LayerChildren = forwardRef(function(props, forwardedRef) {
3239
- const $ = c(22);
3240
- let children, onActivate, onFocus, restProps, t0;
3241
- $[0] !== props ? ({
2811
+ const {
3242
2812
  children,
3243
2813
  onActivate,
3244
2814
  onFocus,
3245
- style: t0,
2815
+ style = EMPTY_RECORD,
3246
2816
  ...restProps
3247
- } = props, $[0] = props, $[1] = children, $[2] = onActivate, $[3] = onFocus, $[4] = restProps, $[5] = t0) : (children = $[1], onActivate = $[2], onFocus = $[3], restProps = $[4], t0 = $[5]);
3248
- const style = t0 === void 0 ? EMPTY_RECORD : t0, {
2817
+ } = props, {
3249
2818
  zIndex,
3250
2819
  isTopLayer
3251
2820
  } = useLayer(), lastFocusedRef = useRef(null), ref = useRef(null), isTopLayerRef = useRef(isTopLayer);
3252
- let t1;
3253
- $[6] === Symbol.for("react.memo_cache_sentinel") ? (t1 = () => ref.current, $[6] = t1) : t1 = $[6], useImperativeHandle(forwardedRef, t1);
3254
- let t2, t3;
3255
- $[7] !== isTopLayer || $[8] !== onActivate ? (t2 = () => {
2821
+ useImperativeHandle(forwardedRef, () => ref.current), useEffect(() => {
3256
2822
  isTopLayerRef.current !== isTopLayer && isTopLayer && onActivate?.({
3257
2823
  activeElement: lastFocusedRef.current
3258
2824
  }), isTopLayerRef.current = isTopLayer;
3259
- }, t3 = [isTopLayer, onActivate], $[7] = isTopLayer, $[8] = onActivate, $[9] = t2, $[10] = t3) : (t2 = $[9], t3 = $[10]), useEffect(t2, t3);
3260
- let t4;
3261
- $[11] !== isTopLayer || $[12] !== onFocus ? (t4 = (event) => {
2825
+ }, [isTopLayer, onActivate]);
2826
+ const handleFocus = useCallback((event) => {
3262
2827
  onFocus?.(event);
3263
2828
  const rootElement = ref.current, target = document.activeElement;
3264
2829
  !isTopLayer || !rootElement || !target || isHTMLElement(target) && containsOrEqualsElement(rootElement, target) && (lastFocusedRef.current = target);
3265
- }, $[11] = isTopLayer, $[12] = onFocus, $[13] = t4) : t4 = $[13];
3266
- const handleFocus = t4;
3267
- let t5;
3268
- $[14] !== style || $[15] !== zIndex ? (t5 = {
2830
+ }, [isTopLayer, onFocus]);
2831
+ return /* @__PURE__ */ jsx(StyledLayer, { ...restProps, "data-ui": "Layer", onFocus: handleFocus, ref, style: {
3269
2832
  ...style,
3270
2833
  zIndex
3271
- }, $[14] = style, $[15] = zIndex, $[16] = t5) : t5 = $[16];
3272
- let t6;
3273
- return $[17] !== children || $[18] !== handleFocus || $[19] !== restProps || $[20] !== t5 ? (t6 = /* @__PURE__ */ jsx(StyledLayer, { ...restProps, "data-ui": "Layer", onFocus: handleFocus, ref, style: t5, children }), $[17] = children, $[18] = handleFocus, $[19] = restProps, $[20] = t5, $[21] = t6) : t6 = $[21], t6;
2834
+ }, children });
3274
2835
  }), Layer = forwardRef(function(props, ref) {
3275
- const $ = c(11);
3276
- let children, restProps, t0;
3277
- $[0] !== props ? ({
2836
+ const {
3278
2837
  children,
3279
- zOffset: t0,
2838
+ zOffset = 1,
3280
2839
  ...restProps
3281
- } = props, $[0] = props, $[1] = children, $[2] = restProps, $[3] = t0) : (children = $[1], restProps = $[2], t0 = $[3]);
3282
- const zOffset = t0 === void 0 ? 1 : t0;
3283
- let t1;
3284
- $[4] !== children || $[5] !== ref || $[6] !== restProps ? (t1 = /* @__PURE__ */ jsx(LayerChildren, { ...restProps, ref, children }), $[4] = children, $[5] = ref, $[6] = restProps, $[7] = t1) : t1 = $[7];
3285
- let t2;
3286
- return $[8] !== t1 || $[9] !== zOffset ? (t2 = /* @__PURE__ */ jsx(LayerProvider, { zOffset, children: t1 }), $[8] = t1, $[9] = zOffset, $[10] = t2) : t2 = $[10], t2;
2840
+ } = props;
2841
+ return /* @__PURE__ */ jsx(LayerProvider, { zOffset, children: /* @__PURE__ */ jsx(LayerChildren, { ...restProps, ref, children }) });
3287
2842
  });
3288
2843
  Layer.displayName = "ForwardRef(Layer)";
3289
2844
  const key = "@sanity/ui/context/portal", elementKey = Symbol.for(`${key}/element`);
@@ -3304,39 +2859,26 @@ function usePortal() {
3304
2859
  return value;
3305
2860
  }
3306
2861
  function Portal(props) {
3307
- const $ = c(3), {
2862
+ const {
3308
2863
  children,
3309
2864
  __unstable_name: name
3310
2865
  } = props, portal = usePortal(), portalElement = (name ? portal.elements && portal.elements[name] : portal.element) || portal.elements?.default;
3311
- if (!portalElement)
3312
- return null;
3313
- let t0;
3314
- return $[0] !== children || $[1] !== portalElement ? (t0 = createPortal(children, portalElement), $[0] = children, $[1] = portalElement, $[2] = t0) : t0 = $[2], t0;
2866
+ return portalElement ? createPortal(children, portalElement) : null;
3315
2867
  }
3316
2868
  Portal.displayName = "Portal";
3317
2869
  function PortalProvider(props) {
3318
- const $ = c(7), {
2870
+ const {
3319
2871
  boundaryElement,
3320
2872
  children,
3321
2873
  element,
3322
2874
  __unstable_elements: elements
3323
- } = props, fallbackElement = useSyncExternalStore(emptySubscribe, _temp$3, _temp2$1), t0 = boundaryElement || null, t1 = element || fallbackElement;
3324
- let t2;
3325
- $[0] !== elements || $[1] !== t0 || $[2] !== t1 ? (t2 = {
2875
+ } = props, fallbackElement = useSyncExternalStore(emptySubscribe, () => document.body, () => null), value = useMemo(() => ({
3326
2876
  version: 0,
3327
- boundaryElement: t0,
3328
- element: t1,
2877
+ boundaryElement: boundaryElement || null,
2878
+ element: element || fallbackElement,
3329
2879
  elements
3330
- }, $[0] = elements, $[1] = t0, $[2] = t1, $[3] = t2) : t2 = $[3];
3331
- const value = t2;
3332
- let t3;
3333
- return $[4] !== children || $[5] !== value ? (t3 = /* @__PURE__ */ jsx(PortalContext.Provider, { value, children }), $[4] = children, $[5] = value, $[6] = t3) : t3 = $[6], t3;
3334
- }
3335
- function _temp2$1() {
3336
- return null;
3337
- }
3338
- function _temp$3() {
3339
- return document.body;
2880
+ }), [boundaryElement, element, elements, fallbackElement]);
2881
+ return /* @__PURE__ */ jsx(PortalContext.Provider, { value, children });
3340
2882
  }
3341
2883
  PortalProvider.displayName = "PortalProvider";
3342
2884
  const emptySubscribe = () => () => {
@@ -3344,12 +2886,11 @@ const emptySubscribe = () => () => {
3344
2886
  displayName: "StyledSrOnly",
3345
2887
  componentId: "sc-mubr0c-0"
3346
2888
  })`display:block;width:0;height:0;position:absolute;overflow:hidden;overflow:clip;`, SrOnly = forwardRef(function(props, ref) {
3347
- const $ = c(4), {
2889
+ const {
3348
2890
  as,
3349
2891
  children
3350
2892
  } = props;
3351
- let t0;
3352
- return $[0] !== as || $[1] !== children || $[2] !== ref ? (t0 = /* @__PURE__ */ jsx(StyledSrOnly, { "aria-hidden": !0, as, "data-ui": "SrOnly", ref, children }), $[0] = as, $[1] = children, $[2] = ref, $[3] = t0) : t0 = $[3], t0;
2893
+ return /* @__PURE__ */ jsx(StyledSrOnly, { "aria-hidden": !0, as, "data-ui": "SrOnly", ref, children });
3353
2894
  });
3354
2895
  SrOnly.displayName = "ForwardRef(SrOnly)";
3355
2896
  const StyledVirtualList = styled.div.withConfig({
@@ -3359,69 +2900,52 @@ const StyledVirtualList = styled.div.withConfig({
3359
2900
  displayName: "ItemWrapper",
3360
2901
  componentId: "sc-dlqsj4-1"
3361
2902
  })`position:absolute;left:0;right:0;`, VirtualList = forwardRef(function(props, forwardedRef) {
3362
- const $ = c(44);
3363
- let getItemKey, onChange, renderItem, restProps, t0, t1, t2;
3364
- $[0] !== props ? ({
3365
- as: t0,
3366
- gap: t1,
2903
+ const {
2904
+ as = "div",
2905
+ gap = 0,
3367
2906
  getItemKey,
3368
- items: t2,
2907
+ items = [],
3369
2908
  onChange,
3370
2909
  renderItem,
3371
2910
  ...restProps
3372
- } = props, $[0] = props, $[1] = getItemKey, $[2] = onChange, $[3] = renderItem, $[4] = restProps, $[5] = t0, $[6] = t1, $[7] = t2) : (getItemKey = $[1], onChange = $[2], renderItem = $[3], restProps = $[4], t0 = $[5], t1 = $[6], t2 = $[7]);
3373
- const as = t0 === void 0 ? "div" : t0, gap = t1 === void 0 ? 0 : t1;
3374
- let t3;
3375
- $[8] !== t2 ? (t3 = t2 === void 0 ? [] : t2, $[8] = t2, $[9] = t3) : t3 = $[9];
3376
- const items = t3, {
2911
+ } = props, {
3377
2912
  space
3378
2913
  } = useTheme_v2(), ref = useRef(null), wrapperRef = useRef(null), [scrollTop, setScrollTop] = useState(0), [scrollHeight, setScrollHeight] = useState(0), [itemHeight, setItemHeight] = useState(-1);
3379
- let t4;
3380
- $[10] === Symbol.for("react.memo_cache_sentinel") ? (t4 = () => ref.current, $[10] = t4) : t4 = $[10], useImperativeHandle(forwardedRef, t4);
3381
- let t5;
3382
- $[11] === Symbol.for("react.memo_cache_sentinel") ? (t5 = () => {
3383
- if (!wrapperRef.current)
3384
- return;
2914
+ useImperativeHandle(forwardedRef, () => ref.current), useEffect(() => {
2915
+ if (!wrapperRef.current) return;
3385
2916
  const firstElement = wrapperRef.current.firstChild;
3386
2917
  firstElement instanceof HTMLElement && setItemHeight(firstElement.offsetHeight);
3387
- }, $[11] = t5) : t5 = $[11];
3388
- let t6;
3389
- $[12] !== renderItem ? (t6 = [renderItem], $[12] = renderItem, $[13] = t6) : t6 = $[13], useEffect(t5, t6);
3390
- let t7, t8;
3391
- $[14] === Symbol.for("react.memo_cache_sentinel") ? (t7 = () => {
3392
- if (!ref.current)
3393
- return;
2918
+ }, [renderItem]), useEffect(() => {
2919
+ if (!ref.current) return;
3394
2920
  const scrollEl = findScrollable(ref.current.parentNode);
3395
2921
  if (scrollEl) {
3396
- if (!(scrollEl instanceof HTMLElement))
3397
- return;
3398
- const handleScroll = () => {
2922
+ if (!(scrollEl instanceof HTMLElement)) return;
2923
+ const handleScroll2 = () => {
3399
2924
  setScrollTop(scrollEl.scrollTop);
3400
2925
  };
3401
- scrollEl.addEventListener("scroll", handleScroll, {
2926
+ scrollEl.addEventListener("scroll", handleScroll2, {
3402
2927
  passive: !0
3403
2928
  });
3404
2929
  const ro = new _ResizeObserver((entries) => {
3405
2930
  setScrollHeight(entries[0].contentRect.height);
3406
2931
  });
3407
- return ro.observe(scrollEl), handleScroll(), () => {
3408
- scrollEl.removeEventListener("scroll", handleScroll), ro.unobserve(scrollEl), ro.disconnect();
2932
+ return ro.observe(scrollEl), handleScroll2(), () => {
2933
+ scrollEl.removeEventListener("scroll", handleScroll2), ro.unobserve(scrollEl), ro.disconnect();
3409
2934
  };
3410
2935
  }
3411
- const handleScroll_0 = () => {
2936
+ const handleScroll = () => {
3412
2937
  setScrollTop(window.scrollY);
3413
2938
  }, handleResize = () => {
3414
2939
  setScrollHeight(window.innerHeight);
3415
2940
  };
3416
- return window.addEventListener("scroll", handleScroll_0, {
2941
+ return window.addEventListener("scroll", handleScroll, {
3417
2942
  passive: !0
3418
- }), window.addEventListener("resize", handleResize), setScrollHeight(window.innerHeight), handleScroll_0(), () => {
3419
- window.removeEventListener("scroll", handleScroll_0), window.removeEventListener("resize", handleResize);
2943
+ }), window.addEventListener("resize", handleResize), setScrollHeight(window.innerHeight), handleScroll(), () => {
2944
+ window.removeEventListener("scroll", handleScroll), window.removeEventListener("resize", handleResize);
3420
2945
  };
3421
- }, t8 = [], $[14] = t7, $[15] = t8) : (t7 = $[14], t8 = $[15]), useEffect(t7, t8);
2946
+ }, []);
3422
2947
  const len = items.length, height = itemHeight ? len * (itemHeight + space[gap]) - space[gap] : 0, fromIndex = height ? Math.max(Math.floor(scrollTop / height * len) - 2, 0) : 0, toIndex = height ? Math.ceil((scrollTop + scrollHeight) / height * len) + 1 : 0;
3423
- let t10, t9;
3424
- $[16] !== fromIndex || $[17] !== gap || $[18] !== itemHeight || $[19] !== onChange || $[20] !== scrollHeight || $[21] !== scrollTop || $[22] !== space || $[23] !== toIndex ? (t9 = () => {
2948
+ useEffect(() => {
3425
2949
  onChange && onChange({
3426
2950
  fromIndex,
3427
2951
  gap: space[gap],
@@ -3430,9 +2954,8 @@ const StyledVirtualList = styled.div.withConfig({
3430
2954
  scrollTop,
3431
2955
  toIndex
3432
2956
  });
3433
- }, t10 = [fromIndex, gap, itemHeight, onChange, scrollHeight, scrollTop, space, toIndex], $[16] = fromIndex, $[17] = gap, $[18] = itemHeight, $[19] = onChange, $[20] = scrollHeight, $[21] = scrollTop, $[22] = space, $[23] = toIndex, $[24] = t10, $[25] = t9) : (t10 = $[24], t9 = $[25]), useEffect(t9, t10);
3434
- let t11;
3435
- $[26] !== fromIndex || $[27] !== gap || $[28] !== getItemKey || $[29] !== itemHeight || $[30] !== items || $[31] !== renderItem || $[32] !== space || $[33] !== toIndex ? (t11 = {
2957
+ }, [fromIndex, gap, itemHeight, onChange, scrollHeight, scrollTop, space, toIndex]);
2958
+ const children = useChildren({
3436
2959
  fromIndex,
3437
2960
  gap,
3438
2961
  itemHeight,
@@ -3441,49 +2964,28 @@ const StyledVirtualList = styled.div.withConfig({
3441
2964
  getItemKey,
3442
2965
  items,
3443
2966
  renderItem
3444
- }, $[26] = fromIndex, $[27] = gap, $[28] = getItemKey, $[29] = itemHeight, $[30] = items, $[31] = renderItem, $[32] = space, $[33] = toIndex, $[34] = t11) : t11 = $[34];
3445
- const children = useChildren(t11);
3446
- let t12;
3447
- $[35] !== height ? (t12 = {
2967
+ });
2968
+ return /* @__PURE__ */ jsx(StyledVirtualList, { as, "data-ui": "VirtualList", ...restProps, ref, children: /* @__PURE__ */ jsx("div", { ref: wrapperRef, style: {
3448
2969
  height
3449
- }, $[35] = height, $[36] = t12) : t12 = $[36];
3450
- let t13;
3451
- $[37] !== children || $[38] !== t12 ? (t13 = /* @__PURE__ */ jsx("div", { ref: wrapperRef, style: t12, children }), $[37] = children, $[38] = t12, $[39] = t13) : t13 = $[39];
3452
- let t14;
3453
- return $[40] !== as || $[41] !== restProps || $[42] !== t13 ? (t14 = /* @__PURE__ */ jsx(StyledVirtualList, { as, "data-ui": "VirtualList", ...restProps, ref, children: t13 }), $[40] = as, $[41] = restProps, $[42] = t13, $[43] = t14) : t14 = $[43], t14;
2970
+ }, children }) });
3454
2971
  });
3455
2972
  VirtualList.displayName = "ForwardRef(VirtualList)";
3456
- function useChildren(t0) {
3457
- const $ = c(21), {
3458
- fromIndex,
3459
- gap,
3460
- getItemKey,
3461
- itemHeight,
3462
- items,
3463
- renderItem,
3464
- space,
3465
- toIndex
3466
- } = t0;
3467
- if (!renderItem || items.length === 0)
3468
- return null;
3469
- if (itemHeight === -1) {
3470
- let t12;
3471
- $[0] !== items[0] || $[1] !== renderItem ? (t12 = renderItem(items[0]), $[0] = items[0], $[1] = renderItem, $[2] = t12) : t12 = $[2];
3472
- let t2;
3473
- return $[3] !== t12 ? (t2 = [/* @__PURE__ */ jsx(ItemWrapper, { children: t12 }, 0)], $[3] = t12, $[4] = t2) : t2 = $[4], t2;
3474
- }
3475
- let t1;
3476
- if ($[5] !== fromIndex || $[6] !== gap || $[7] !== getItemKey || $[8] !== itemHeight || $[9] !== items || $[10] !== renderItem || $[11] !== space || $[12] !== toIndex) {
3477
- let t2;
3478
- $[14] !== fromIndex || $[15] !== gap || $[16] !== getItemKey || $[17] !== itemHeight || $[18] !== renderItem || $[19] !== space ? (t2 = (item, _itemIndex) => {
3479
- const itemIndex = fromIndex + _itemIndex, node = renderItem(item), key2 = getItemKey ? getItemKey(item, itemIndex) : itemIndex;
3480
- return /* @__PURE__ */ jsx(ItemWrapper, { style: {
3481
- top: itemIndex * (itemHeight + space[gap])
3482
- }, children: node }, key2);
3483
- }, $[14] = fromIndex, $[15] = gap, $[16] = getItemKey, $[17] = itemHeight, $[18] = renderItem, $[19] = space, $[20] = t2) : t2 = $[20], t1 = items.slice(fromIndex, toIndex).map(t2), $[5] = fromIndex, $[6] = gap, $[7] = getItemKey, $[8] = itemHeight, $[9] = items, $[10] = renderItem, $[11] = space, $[12] = toIndex, $[13] = t1;
3484
- } else
3485
- t1 = $[13];
3486
- return t1;
2973
+ function useChildren({
2974
+ fromIndex,
2975
+ gap,
2976
+ getItemKey,
2977
+ itemHeight,
2978
+ items,
2979
+ renderItem,
2980
+ space,
2981
+ toIndex
2982
+ }) {
2983
+ return !renderItem || items.length === 0 ? null : itemHeight === -1 ? [/* @__PURE__ */ jsx(ItemWrapper, { children: renderItem(items[0]) }, 0)] : items.slice(fromIndex, toIndex).map((item, _itemIndex) => {
2984
+ const itemIndex = fromIndex + _itemIndex, node = renderItem(item), key2 = getItemKey ? getItemKey(item, itemIndex) : itemIndex;
2985
+ return /* @__PURE__ */ jsx(ItemWrapper, { style: {
2986
+ top: itemIndex * (itemHeight + space[gap])
2987
+ }, children: node }, key2);
2988
+ });
3487
2989
  }
3488
2990
  function findScrollable(parentNode) {
3489
2991
  let _scrollEl = parentNode;
@@ -3575,9 +3077,7 @@ const MotionCard$1 = styled(motion.create(Card)).withConfig({
3575
3077
  displayName: "MotionFlex",
3576
3078
  componentId: "sc-ihg31s-1"
3577
3079
  })`will-change:opacity;`, PopoverCard = forwardRef(function(props, ref) {
3578
- const $ = c(66);
3579
- let animate, arrow2, arrowRef, arrowX, arrowY, children, marginsProp, originX, originY, overflow, padding, placement, radius, restProps, scheme, shadow, strategy, style, tone, width, xProp, yProp;
3580
- $[0] !== props ? ({
3080
+ const {
3581
3081
  __unstable_margins: marginsProp,
3582
3082
  animate,
3583
3083
  arrow: arrow2,
@@ -3600,12 +3100,9 @@ const MotionCard$1 = styled(motion.create(Card)).withConfig({
3600
3100
  x: xProp,
3601
3101
  y: yProp,
3602
3102
  ...restProps
3603
- } = props, $[0] = props, $[1] = animate, $[2] = arrow2, $[3] = arrowRef, $[4] = arrowX, $[5] = arrowY, $[6] = children, $[7] = marginsProp, $[8] = originX, $[9] = originY, $[10] = overflow, $[11] = padding, $[12] = placement, $[13] = radius, $[14] = restProps, $[15] = scheme, $[16] = shadow, $[17] = strategy, $[18] = style, $[19] = tone, $[20] = width, $[21] = xProp, $[22] = yProp) : (animate = $[1], arrow2 = $[2], arrowRef = $[3], arrowX = $[4], arrowY = $[5], children = $[6], marginsProp = $[7], originX = $[8], originY = $[9], overflow = $[10], padding = $[11], placement = $[12], radius = $[13], restProps = $[14], scheme = $[15], shadow = $[16], strategy = $[17], style = $[18], tone = $[19], width = $[20], xProp = $[21], yProp = $[22]);
3604
- const {
3103
+ } = props, {
3605
3104
  zIndex
3606
- } = useLayer(), margins = marginsProp || DEFAULT_POPOVER_MARGINS, x = (xProp ?? 0) + margins[3], y = (yProp ?? 0) + margins[0], t0 = animate ? "transform" : void 0;
3607
- let t1;
3608
- $[23] !== originX || $[24] !== originY || $[25] !== strategy || $[26] !== style || $[27] !== t0 || $[28] !== width || $[29] !== x || $[30] !== y || $[31] !== zIndex ? (t1 = {
3105
+ } = useLayer(), margins = useMemo(() => marginsProp || DEFAULT_POPOVER_MARGINS, [marginsProp]), x = (xProp ?? 0) + margins[3], y = (yProp ?? 0) + margins[0], rootStyle2 = useMemo(() => ({
3609
3106
  left: x,
3610
3107
  originX,
3611
3108
  originY,
@@ -3613,137 +3110,92 @@ const MotionCard$1 = styled(motion.create(Card)).withConfig({
3613
3110
  top: y,
3614
3111
  width,
3615
3112
  zIndex,
3616
- willChange: t0,
3113
+ willChange: animate ? "transform" : void 0,
3617
3114
  ...style
3618
- }, $[23] = originX, $[24] = originY, $[25] = strategy, $[26] = style, $[27] = t0, $[28] = width, $[29] = x, $[30] = y, $[31] = zIndex, $[32] = t1) : t1 = $[32];
3619
- const rootStyle2 = t1, t2 = arrowX !== null ? arrowX : void 0, t3 = arrowY !== null ? arrowY : void 0;
3620
- let t4;
3621
- $[33] !== t2 || $[34] !== t3 ? (t4 = {
3622
- left: t2,
3623
- top: t3,
3115
+ }), [animate, originX, originY, strategy, style, width, x, y, zIndex]), arrowStyle = useMemo(() => ({
3116
+ left: arrowX !== null ? arrowX : void 0,
3117
+ top: arrowY !== null ? arrowY : void 0,
3624
3118
  right: void 0,
3625
3119
  bottom: void 0
3626
- }, $[33] = t2, $[34] = t3, $[35] = t4) : t4 = $[35];
3627
- const arrowStyle = t4, t5 = restProps;
3628
- let t6;
3629
- $[36] !== animate ? (t6 = animate ? ["hidden", "initial"] : void 0, $[36] = animate, $[37] = t6) : t6 = $[37];
3630
- let t7;
3631
- $[38] !== animate ? (t7 = animate ? ["visible", "scaleIn"] : void 0, $[38] = animate, $[39] = t7) : t7 = $[39];
3632
- let t8;
3633
- $[40] !== animate ? (t8 = animate ? ["hidden", "scaleOut"] : void 0, $[40] = animate, $[41] = t8) : t8 = $[41];
3634
- let t9;
3635
- $[42] !== children || $[43] !== padding ? (t9 = /* @__PURE__ */ jsx(Flex, { direction: "column", flex: 1, padding, children }), $[42] = children, $[43] = padding, $[44] = t9) : t9 = $[44];
3636
- let t10;
3637
- $[45] !== overflow || $[46] !== t9 ? (t10 = /* @__PURE__ */ jsx(MotionFlex, { "data-ui": "Popover__wrapper", direction: "column", flex: 1, overflow, variants: POPOVER_MOTION_PROPS.children, transition: POPOVER_MOTION_PROPS.transition, children: t9 }), $[45] = overflow, $[46] = t9, $[47] = t10) : t10 = $[47];
3638
- let t11;
3639
- $[48] !== arrow2 || $[49] !== arrowRef || $[50] !== arrowStyle ? (t11 = arrow2 && /* @__PURE__ */ jsx(Arrow, { ref: arrowRef, style: arrowStyle, width: DEFAULT_POPOVER_ARROW_WIDTH, height: DEFAULT_POPOVER_ARROW_HEIGHT, radius: DEFAULT_POPOVER_ARROW_RADIUS }), $[48] = arrow2, $[49] = arrowRef, $[50] = arrowStyle, $[51] = t11) : t11 = $[51];
3640
- let t12;
3641
- return $[52] !== placement || $[53] !== radius || $[54] !== ref || $[55] !== rootStyle2 || $[56] !== scheme || $[57] !== shadow || $[58] !== t10 || $[59] !== t11 || $[60] !== t5 || $[61] !== t6 || $[62] !== t7 || $[63] !== t8 || $[64] !== tone ? (t12 = /* @__PURE__ */ jsxs(MotionCard$1, { "data-ui": "Popover", ...t5, "data-placement": placement, radius, ref, scheme, shadow, sizing: "border", style: rootStyle2, tone, variants: POPOVER_MOTION_PROPS.card, transition: POPOVER_MOTION_PROPS.transition, initial: t6, animate: t7, exit: t8, children: [
3642
- t10,
3643
- t11
3644
- ] }), $[52] = placement, $[53] = radius, $[54] = ref, $[55] = rootStyle2, $[56] = scheme, $[57] = shadow, $[58] = t10, $[59] = t11, $[60] = t5, $[61] = t6, $[62] = t7, $[63] = t8, $[64] = tone, $[65] = t12) : t12 = $[65], t12;
3120
+ }), [arrowX, arrowY]);
3121
+ return /* @__PURE__ */ jsxs(MotionCard$1, { "data-ui": "Popover", ...restProps, "data-placement": placement, radius, ref, scheme, shadow, sizing: "border", style: rootStyle2, tone, variants: POPOVER_MOTION_PROPS.card, transition: POPOVER_MOTION_PROPS.transition, initial: animate ? ["hidden", "initial"] : void 0, animate: animate ? ["visible", "scaleIn"] : void 0, exit: animate ? ["hidden", "scaleOut"] : void 0, children: [
3122
+ /* @__PURE__ */ jsx(MotionFlex, { "data-ui": "Popover__wrapper", direction: "column", flex: 1, overflow, variants: POPOVER_MOTION_PROPS.children, transition: POPOVER_MOTION_PROPS.transition, children: /* @__PURE__ */ jsx(Flex, { direction: "column", flex: 1, padding, children }) }),
3123
+ arrow2 && /* @__PURE__ */ jsx(Arrow, { ref: arrowRef, style: arrowStyle, width: DEFAULT_POPOVER_ARROW_WIDTH, height: DEFAULT_POPOVER_ARROW_HEIGHT, radius: DEFAULT_POPOVER_ARROW_RADIUS })
3124
+ ] });
3645
3125
  });
3646
3126
  PopoverCard.displayName = "ForwardRef(PopoverCard)";
3647
3127
  const ViewportOverlay = () => {
3648
- const $ = c(2), {
3128
+ const {
3649
3129
  zIndex
3650
3130
  } = useLayer();
3651
- let t0;
3652
- return $[0] !== zIndex ? (t0 = /* @__PURE__ */ jsx("div", { style: {
3131
+ return /* @__PURE__ */ jsx("div", { style: {
3653
3132
  height: "100vh",
3654
3133
  inset: 0,
3655
3134
  position: "fixed",
3656
3135
  width: "100vw",
3657
3136
  zIndex
3658
- } }), $[0] = zIndex, $[1] = t0) : t0 = $[1], t0;
3137
+ } });
3659
3138
  }, Popover = forwardRef(function(props, forwardedRef) {
3660
- const $ = c(126), {
3139
+ const {
3661
3140
  container,
3662
3141
  layer
3663
- } = useTheme_v2(), boundaryElementContext = useBoundaryElement();
3664
- let _boundaryElement, _fallbackPlacements, _floatingBoundary, _referenceBoundary, _zOffsetProp, childProp, content, disabled, matchReferenceWidth, modal, open, paddingProp, portal, referenceElement, restProps, scheme, t0, t1, t10, t11, t2, t3, t4, t5, t6, t7, t8, t9, updateRef;
3665
- if ($[0] !== props) {
3666
- const {
3667
- __unstable_margins: t122,
3668
- animate: t132,
3669
- arrow: t142,
3670
- boundaryElement: t152,
3671
- children: t162,
3672
- constrainSize: t172,
3673
- content: t182,
3674
- disabled: t192,
3675
- fallbackPlacements: t202,
3676
- matchReferenceWidth: t212,
3677
- floatingBoundary: t222,
3678
- modal: t232,
3679
- onActivate,
3680
- open: t242,
3681
- overflow: t252,
3682
- padding: t262,
3683
- placement: t272,
3684
- placementStrategy: t282,
3685
- portal: t292,
3686
- preventOverflow: t302,
3687
- radius: t312,
3688
- referenceBoundary: t322,
3689
- referenceElement: t332,
3690
- scheme: t342,
3691
- shadow: t352,
3692
- tone: t362,
3693
- width: t372,
3694
- zOffset: t382,
3695
- updateRef: t392,
3696
- ...t402
3697
- } = props;
3698
- t0 = t122, t1 = t132, t2 = t142, _boundaryElement = t152, childProp = t162, t3 = t172, content = t182, disabled = t192, _fallbackPlacements = t202, matchReferenceWidth = t212, _floatingBoundary = t222, modal = t232, open = t242, t4 = t252, paddingProp = t262, t5 = t272, t6 = t282, portal = t292, t7 = t302, t8 = t312, _referenceBoundary = t322, referenceElement = t332, scheme = t342, t9 = t352, t10 = t362, t11 = t372, _zOffsetProp = t382, updateRef = t392, restProps = t402, $[0] = props, $[1] = _boundaryElement, $[2] = _fallbackPlacements, $[3] = _floatingBoundary, $[4] = _referenceBoundary, $[5] = _zOffsetProp, $[6] = childProp, $[7] = content, $[8] = disabled, $[9] = matchReferenceWidth, $[10] = modal, $[11] = open, $[12] = paddingProp, $[13] = portal, $[14] = referenceElement, $[15] = restProps, $[16] = scheme, $[17] = t0, $[18] = t1, $[19] = t10, $[20] = t11, $[21] = t2, $[22] = t3, $[23] = t4, $[24] = t5, $[25] = t6, $[26] = t7, $[27] = t8, $[28] = t9, $[29] = updateRef;
3699
- } else
3700
- _boundaryElement = $[1], _fallbackPlacements = $[2], _floatingBoundary = $[3], _referenceBoundary = $[4], _zOffsetProp = $[5], childProp = $[6], content = $[7], disabled = $[8], matchReferenceWidth = $[9], modal = $[10], open = $[11], paddingProp = $[12], portal = $[13], referenceElement = $[14], restProps = $[15], scheme = $[16], t0 = $[17], t1 = $[18], t10 = $[19], t11 = $[20], t2 = $[21], t3 = $[22], t4 = $[23], t5 = $[24], t6 = $[25], t7 = $[26], t8 = $[27], t9 = $[28], updateRef = $[29];
3701
- const margins = t0 === void 0 ? DEFAULT_POPOVER_MARGINS : t0, _animate = t1 === void 0 ? !1 : t1, arrowProp = t2 === void 0 ? !1 : t2, constrainSize = t3 === void 0 ? !1 : t3, overflow = t4 === void 0 ? "hidden" : t4, placementProp = t5 === void 0 ? "bottom" : t5, placementStrategy = t6 === void 0 ? "flip" : t6, preventOverflow = t7 === void 0 ? !0 : t7, radiusProp = t8 === void 0 ? 3 : t8, shadowProp = t9 === void 0 ? 3 : t9, tone = t10 === void 0 ? "inherit" : t10, widthProp = t11 === void 0 ? "auto" : t11, boundaryElement = _boundaryElement ?? boundaryElementContext?.element, fallbackPlacements = _fallbackPlacements ?? DEFAULT_FALLBACK_PLACEMENTS$1[props.placement ?? "bottom"], floatingBoundary = _floatingBoundary ?? props.boundaryElement ?? boundaryElementContext.element, referenceBoundary = _referenceBoundary ?? props.boundaryElement ?? boundaryElementContext.element, zOffsetProp = _zOffsetProp ?? layer.popover.zOffset, animate = usePrefersReducedMotion() ? !1 : _animate, boundarySize = useElementSize(boundaryElement)?.border;
3702
- let t12;
3703
- $[30] !== paddingProp ? (t12 = _getArrayProp(paddingProp), $[30] = paddingProp, $[31] = t12) : t12 = $[31];
3704
- const padding = t12;
3705
- let t13;
3706
- $[32] !== radiusProp ? (t13 = _getArrayProp(radiusProp), $[32] = radiusProp, $[33] = t13) : t13 = $[33];
3707
- const radius = t13;
3708
- let t14;
3709
- $[34] !== shadowProp ? (t14 = _getArrayProp(shadowProp), $[34] = shadowProp, $[35] = t14) : t14 = $[35];
3710
- const shadow = t14, widthArrayProp = _getArrayProp(widthProp);
3711
- let t15;
3712
- $[36] !== zOffsetProp ? (t15 = _getArrayProp(zOffsetProp), $[36] = zOffsetProp, $[37] = t15) : t15 = $[37];
3713
- const zOffset = t15, ref = useRef(null), arrowRef = useRef(null);
3714
- let t16;
3715
- $[38] === Symbol.for("react.memo_cache_sentinel") ? (t16 = () => ref.current, $[38] = t16) : t16 = $[38], useImperativeHandle(forwardedRef, t16);
3142
+ } = useTheme_v2(), boundaryElementContext = useBoundaryElement(), {
3143
+ __unstable_margins: margins = DEFAULT_POPOVER_MARGINS,
3144
+ animate: _animate = !1,
3145
+ arrow: arrowProp = !1,
3146
+ boundaryElement: _boundaryElement,
3147
+ children: childProp,
3148
+ constrainSize = !1,
3149
+ content,
3150
+ disabled,
3151
+ fallbackPlacements: _fallbackPlacements,
3152
+ matchReferenceWidth,
3153
+ floatingBoundary: _floatingBoundary,
3154
+ modal,
3155
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
3156
+ onActivate,
3157
+ open,
3158
+ overflow = "hidden",
3159
+ padding: paddingProp,
3160
+ placement: placementProp = "bottom",
3161
+ placementStrategy = "flip",
3162
+ portal,
3163
+ preventOverflow = !0,
3164
+ radius: radiusProp = 3,
3165
+ referenceBoundary: _referenceBoundary,
3166
+ referenceElement,
3167
+ scheme,
3168
+ shadow: shadowProp = 3,
3169
+ tone = "inherit",
3170
+ width: widthProp = "auto",
3171
+ zOffset: _zOffsetProp,
3172
+ updateRef,
3173
+ ...restProps
3174
+ } = props, boundaryElement = _boundaryElement ?? boundaryElementContext?.element, fallbackPlacements = _fallbackPlacements ?? DEFAULT_FALLBACK_PLACEMENTS$1[props.placement ?? "bottom"], floatingBoundary = _floatingBoundary ?? props.boundaryElement ?? boundaryElementContext.element, referenceBoundary = _referenceBoundary ?? props.boundaryElement ?? boundaryElementContext.element, zOffsetProp = _zOffsetProp ?? layer.popover.zOffset, animate = usePrefersReducedMotion() ? !1 : _animate, boundarySize = useElementSize(boundaryElement)?.border, padding = _getArrayProp(paddingProp), radius = _getArrayProp(radiusProp), shadow = _getArrayProp(shadowProp), widthArrayProp = _getArrayProp(widthProp), zOffset = _getArrayProp(zOffsetProp), ref = useRef(null), arrowRef = useRef(null), rootBoundary = "viewport";
3175
+ useImperativeHandle(forwardedRef, () => ref.current);
3716
3176
  const mediaIndex = useMediaIndex(), boundaryWidth = constrainSize || preventOverflow ? boundarySize?.width : void 0, width = calcCurrentWidth({
3717
3177
  container,
3718
3178
  mediaIndex,
3719
3179
  width: widthArrayProp
3720
3180
  }), widthRef = useRef(width);
3721
- let t17, t18;
3722
- $[39] !== width ? (t17 = () => {
3181
+ useEffect(() => {
3723
3182
  widthRef.current = width;
3724
- }, t18 = [width], $[39] = width, $[40] = t17, $[41] = t18) : (t17 = $[40], t18 = $[41]), useEffect(t17, t18);
3725
- let t19;
3726
- $[42] !== boundaryWidth || $[43] !== width ? (t19 = calcMaxWidth({
3183
+ }, [width]);
3184
+ const maxWidth = calcMaxWidth({
3727
3185
  boundaryWidth,
3728
3186
  currentWidth: width
3729
- }), $[42] = boundaryWidth, $[43] = width, $[44] = t19) : t19 = $[44];
3730
- const maxWidth = t19, maxWidthRef = useRef(maxWidth);
3731
- let t20, t21;
3732
- $[45] !== maxWidth ? (t20 = () => {
3187
+ }), maxWidthRef = useRef(maxWidth);
3188
+ useEffect(() => {
3733
3189
  maxWidthRef.current = maxWidth;
3734
- }, t21 = [maxWidth], $[45] = maxWidth, $[46] = t20, $[47] = t21) : (t20 = $[46], t21 = $[47]), useEffect(t20, t21);
3190
+ }, [maxWidth]);
3735
3191
  const referenceWidthRef = useRef(void 0);
3736
- let t22, t23;
3737
- $[48] !== matchReferenceWidth || $[49] !== maxWidth || $[50] !== open || $[51] !== width ? (t22 = () => {
3192
+ useEffect(() => {
3738
3193
  const floatingElement = ref.current;
3739
- if (!open || !floatingElement)
3740
- return;
3741
- const referenceWidth = referenceWidthRef.current;
3742
- matchReferenceWidth ? referenceWidth !== void 0 && (floatingElement.style.width = `${referenceWidth}px`) : width !== void 0 && (floatingElement.style.width = `${width}px`), typeof maxWidth == "number" && (floatingElement.style.maxWidth = `${maxWidth}px`);
3743
- }, t23 = [width, matchReferenceWidth, maxWidth, open], $[48] = matchReferenceWidth, $[49] = maxWidth, $[50] = open, $[51] = width, $[52] = t22, $[53] = t23) : (t22 = $[52], t23 = $[53]), useEffect(t22, t23);
3744
- const [referenceWidth_0, setReferenceWidth] = useState(void 0);
3745
- let t24;
3746
- $[54] !== animate || $[55] !== arrowProp || $[56] !== constrainSize || $[57] !== fallbackPlacements || $[58] !== floatingBoundary || $[59] !== margins || $[60] !== matchReferenceWidth || $[61] !== placementProp || $[62] !== placementStrategy || $[63] !== preventOverflow || $[64] !== referenceBoundary ? (t24 = {
3194
+ if (!open || !floatingElement) return;
3195
+ const referenceWidth2 = referenceWidthRef.current;
3196
+ matchReferenceWidth ? referenceWidth2 !== void 0 && (floatingElement.style.width = `${referenceWidth2}px`) : width !== void 0 && (floatingElement.style.width = `${width}px`), typeof maxWidth == "number" && (floatingElement.style.maxWidth = `${maxWidth}px`);
3197
+ }, [width, matchReferenceWidth, maxWidth, open]);
3198
+ const [referenceWidth, setReferenceWidth] = useState(void 0), middleware = useMiddleware$1({
3747
3199
  animate,
3748
3200
  arrowProp,
3749
3201
  arrowRef,
@@ -3758,23 +3210,10 @@ const ViewportOverlay = () => {
3758
3210
  preventOverflow,
3759
3211
  referenceBoundary,
3760
3212
  referenceWidthRef,
3761
- rootBoundary: "viewport",
3213
+ rootBoundary,
3762
3214
  setReferenceWidth,
3763
3215
  widthRef
3764
- }, $[54] = animate, $[55] = arrowProp, $[56] = constrainSize, $[57] = fallbackPlacements, $[58] = floatingBoundary, $[59] = margins, $[60] = matchReferenceWidth, $[61] = placementProp, $[62] = placementStrategy, $[63] = preventOverflow, $[64] = referenceBoundary, $[65] = t24) : t24 = $[65];
3765
- const middleware = useMiddleware$1(t24);
3766
- let t25;
3767
- $[66] !== referenceElement ? (t25 = referenceElement ? {
3768
- reference: referenceElement
3769
- } : void 0, $[66] = referenceElement, $[67] = t25) : t25 = $[67];
3770
- let t26;
3771
- $[68] !== middleware || $[69] !== placementProp || $[70] !== t25 ? (t26 = {
3772
- middleware,
3773
- placement: placementProp,
3774
- whileElementsMounted: autoUpdate,
3775
- elements: t25
3776
- }, $[68] = middleware, $[69] = placementProp, $[70] = t25, $[71] = t26) : t26 = $[71];
3777
- const {
3216
+ }), {
3778
3217
  x,
3779
3218
  y,
3780
3219
  middlewareData,
@@ -3782,148 +3221,87 @@ const ViewportOverlay = () => {
3782
3221
  refs,
3783
3222
  strategy,
3784
3223
  update
3785
- } = useFloating(t26), referenceHidden = middlewareData.hide?.referenceHidden, arrowX = middlewareData.arrow?.x, arrowY = middlewareData.arrow?.y, originX = middlewareData["@sanity/ui/origin"]?.originX, originY = middlewareData["@sanity/ui/origin"]?.originY;
3786
- let t27;
3787
- $[72] === Symbol.for("react.memo_cache_sentinel") ? (t27 = (arrowEl) => {
3224
+ } = useFloating({
3225
+ middleware,
3226
+ placement: placementProp,
3227
+ whileElementsMounted: autoUpdate,
3228
+ elements: referenceElement ? {
3229
+ reference: referenceElement
3230
+ } : void 0
3231
+ }), referenceHidden = middlewareData.hide?.referenceHidden, arrowX = middlewareData.arrow?.x, arrowY = middlewareData.arrow?.y, originX = middlewareData["@sanity/ui/origin"]?.originX, originY = middlewareData["@sanity/ui/origin"]?.originY, setArrow = useCallback((arrowEl) => {
3788
3232
  arrowRef.current = arrowEl;
3789
- }, $[72] = t27) : t27 = $[72];
3790
- const setArrow = t27;
3791
- let t28;
3792
- $[73] !== refs ? (t28 = (node) => {
3233
+ }, []), setFloating = useCallback((node) => {
3793
3234
  ref.current = node, refs.setFloating(node);
3794
- }, $[73] = refs, $[74] = t28) : t28 = $[74];
3795
- const setFloating = t28;
3796
- let t29;
3797
- $[75] !== childProp ? (t29 = childProp ? getElementRef(childProp) : null, $[75] = childProp, $[76] = t29) : t29 = $[76];
3798
- let t30;
3799
- $[77] !== refs.reference.current ? (t30 = () => refs.reference.current, $[77] = refs.reference.current, $[78] = t30) : t30 = $[78], useImperativeHandle(t29, t30);
3800
- let t31;
3801
- bb0: {
3802
- if (referenceElement) {
3803
- t31 = childProp;
3804
- break bb0;
3805
- }
3806
- if (!childProp) {
3807
- t31 = null;
3808
- break bb0;
3809
- }
3810
- let t322;
3811
- $[79] !== childProp || $[80] !== refs.setReference ? (t322 = cloneElement(childProp, {
3812
- ref: refs.setReference
3813
- }), $[79] = childProp, $[80] = refs.setReference, $[81] = t322) : t322 = $[81], t31 = t322;
3814
- }
3815
- const child = t31;
3816
- let t32, t33;
3817
- if ($[82] !== update ? (t32 = () => update, t33 = [update], $[82] = update, $[83] = t32, $[84] = t33) : (t32 = $[83], t33 = $[84]), useImperativeHandle(updateRef, t32, t33), disabled) {
3818
- let t342;
3819
- return $[85] !== childProp ? (t342 = childProp || /* @__PURE__ */ jsx(Fragment, {}), $[85] = childProp, $[86] = t342) : t342 = $[86], t342;
3820
- }
3821
- let t34;
3822
- $[87] !== modal ? (t34 = modal && /* @__PURE__ */ jsx(ViewportOverlay, {}), $[87] = modal, $[88] = t34) : t34 = $[88];
3823
- const t35 = matchReferenceWidth ? referenceWidth_0 : width;
3824
- let t36;
3825
- $[89] !== animate || $[90] !== arrowProp || $[91] !== arrowX || $[92] !== arrowY || $[93] !== content || $[94] !== margins || $[95] !== originX || $[96] !== originY || $[97] !== overflow || $[98] !== padding || $[99] !== placement || $[100] !== radius || $[101] !== referenceHidden || $[102] !== restProps || $[103] !== scheme || $[104] !== setFloating || $[105] !== shadow || $[106] !== strategy || $[107] !== t35 || $[108] !== tone || $[109] !== x || $[110] !== y ? (t36 = /* @__PURE__ */ jsx(PopoverCard, { ...restProps, __unstable_margins: margins, animate, arrow: arrowProp, arrowRef: setArrow, arrowX, arrowY, hidden: referenceHidden, overflow, padding, placement, radius, ref: setFloating, scheme, shadow, originX, originY, strategy, tone, width: t35, x, y, children: content }), $[89] = animate, $[90] = arrowProp, $[91] = arrowX, $[92] = arrowY, $[93] = content, $[94] = margins, $[95] = originX, $[96] = originY, $[97] = overflow, $[98] = padding, $[99] = placement, $[100] = radius, $[101] = referenceHidden, $[102] = restProps, $[103] = scheme, $[104] = setFloating, $[105] = shadow, $[106] = strategy, $[107] = t35, $[108] = tone, $[109] = x, $[110] = y, $[111] = t36) : t36 = $[111];
3826
- let t37;
3827
- $[112] !== t34 || $[113] !== t36 || $[114] !== zOffset ? (t37 = /* @__PURE__ */ jsxs(LayerProvider, { zOffset, children: [
3828
- t34,
3829
- t36
3830
- ] }), $[112] = t34, $[113] = t36, $[114] = zOffset, $[115] = t37) : t37 = $[115];
3831
- const popover = t37;
3832
- let t38;
3833
- $[116] !== open || $[117] !== popover || $[118] !== portal ? (t38 = open && (portal ? /* @__PURE__ */ jsx(Portal, { __unstable_name: typeof portal == "string" ? portal : void 0, children: popover }) : popover), $[116] = open, $[117] = popover, $[118] = portal, $[119] = t38) : t38 = $[119];
3834
- const children = t38;
3835
- let t39;
3836
- $[120] !== animate || $[121] !== children ? (t39 = animate ? /* @__PURE__ */ jsx(AnimatePresence, { children }) : children, $[120] = animate, $[121] = children, $[122] = t39) : t39 = $[122];
3837
- let t40;
3838
- return $[123] !== child || $[124] !== t39 ? (t40 = /* @__PURE__ */ jsxs(Fragment, { children: [
3839
- t39,
3235
+ }, [refs]);
3236
+ useImperativeHandle(childProp ? getElementRef(childProp) : null, () => refs.reference.current);
3237
+ const child = useMemo(() => referenceElement ? childProp : childProp ? cloneElement(childProp, {
3238
+ ref: refs.setReference
3239
+ }) : null, [childProp, referenceElement, refs.setReference]);
3240
+ if (useImperativeHandle(updateRef, () => update, [update]), disabled)
3241
+ return childProp || /* @__PURE__ */ jsx(Fragment, {});
3242
+ const popover = /* @__PURE__ */ jsxs(LayerProvider, { zOffset, children: [
3243
+ modal && /* @__PURE__ */ jsx(ViewportOverlay, {}),
3244
+ /* @__PURE__ */ jsx(PopoverCard, { ...restProps, __unstable_margins: margins, animate, arrow: arrowProp, arrowRef: setArrow, arrowX, arrowY, hidden: referenceHidden, overflow, padding, placement, radius, ref: setFloating, scheme, shadow, originX, originY, strategy, tone, width: matchReferenceWidth ? referenceWidth : width, x, y, children: content })
3245
+ ] }), children = open && (portal ? /* @__PURE__ */ jsx(Portal, { __unstable_name: typeof portal == "string" ? portal : void 0, children: popover }) : popover);
3246
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
3247
+ animate ? /* @__PURE__ */ jsx(AnimatePresence, { children }) : children,
3840
3248
  child
3841
- ] }), $[123] = child, $[124] = t39, $[125] = t40) : t40 = $[125], t40;
3249
+ ] });
3842
3250
  });
3843
3251
  Popover.displayName = "ForwardRef(Popover)";
3844
- function useMiddleware$1(t0) {
3845
- const $ = c(42), {
3846
- animate,
3847
- arrowProp,
3848
- arrowRef,
3849
- constrainSize,
3850
- fallbackPlacements,
3851
- floatingBoundary,
3852
- margins,
3853
- matchReferenceWidth,
3854
- maxWidthRef,
3855
- placementProp,
3856
- placementStrategy,
3857
- preventOverflow,
3858
- referenceBoundary,
3859
- referenceWidthRef,
3860
- rootBoundary,
3861
- setReferenceWidth,
3862
- widthRef
3863
- } = t0;
3864
- let ret;
3865
- if ($[0] !== animate || $[1] !== arrowProp || $[2] !== arrowRef || $[3] !== constrainSize || $[4] !== fallbackPlacements || $[5] !== floatingBoundary || $[6] !== margins || $[7] !== matchReferenceWidth || $[8] !== maxWidthRef || $[9] !== placementProp || $[10] !== placementStrategy || $[11] !== preventOverflow || $[12] !== referenceBoundary || $[13] !== referenceWidthRef || $[14] !== rootBoundary || $[15] !== setReferenceWidth || $[16] !== widthRef) {
3866
- if (ret = [], constrainSize || preventOverflow)
3867
- if (placementStrategy === "autoPlacement") {
3868
- let t12;
3869
- $[18] !== fallbackPlacements || $[19] !== placementProp ? (t12 = autoPlacement({
3870
- allowedPlacements: [placementProp].concat(fallbackPlacements)
3871
- }), $[18] = fallbackPlacements, $[19] = placementProp, $[20] = t12) : t12 = $[20], ret.push(t12);
3872
- } else {
3873
- const t12 = floatingBoundary || void 0;
3874
- let t22;
3875
- $[21] !== fallbackPlacements || $[22] !== rootBoundary || $[23] !== t12 ? (t22 = flip({
3876
- boundary: t12,
3877
- fallbackPlacements,
3878
- padding: DEFAULT_POPOVER_PADDING,
3879
- rootBoundary
3880
- }), $[21] = fallbackPlacements, $[22] = rootBoundary, $[23] = t12, $[24] = t22) : t22 = $[24], ret.push(t22);
3881
- }
3882
- let t1;
3883
- if ($[25] === Symbol.for("react.memo_cache_sentinel") ? (t1 = offset({
3252
+ function useMiddleware$1({
3253
+ animate,
3254
+ arrowProp,
3255
+ arrowRef,
3256
+ constrainSize,
3257
+ fallbackPlacements,
3258
+ floatingBoundary,
3259
+ margins,
3260
+ matchReferenceWidth,
3261
+ maxWidthRef,
3262
+ placementProp,
3263
+ placementStrategy,
3264
+ preventOverflow,
3265
+ referenceBoundary,
3266
+ referenceWidthRef,
3267
+ rootBoundary,
3268
+ setReferenceWidth,
3269
+ widthRef
3270
+ }) {
3271
+ return useMemo(() => {
3272
+ const ret = [];
3273
+ return (constrainSize || preventOverflow) && (placementStrategy === "autoPlacement" ? ret.push(autoPlacement({
3274
+ allowedPlacements: [placementProp].concat(fallbackPlacements)
3275
+ })) : ret.push(flip({
3276
+ boundary: floatingBoundary || void 0,
3277
+ fallbackPlacements,
3278
+ padding: DEFAULT_POPOVER_PADDING,
3279
+ rootBoundary
3280
+ }))), ret.push(offset({
3884
3281
  mainAxis: DEFAULT_POPOVER_DISTANCE
3885
- }), $[25] = t1) : t1 = $[25], ret.push(t1), constrainSize || matchReferenceWidth) {
3886
- const t22 = floatingBoundary || void 0;
3887
- let t32;
3888
- $[26] !== constrainSize || $[27] !== margins || $[28] !== matchReferenceWidth || $[29] !== maxWidthRef || $[30] !== referenceWidthRef || $[31] !== setReferenceWidth || $[32] !== t22 || $[33] !== widthRef ? (t32 = size({
3889
- boundaryElement: t22,
3890
- constrainSize,
3891
- margins,
3892
- matchReferenceWidth,
3893
- maxWidthRef,
3894
- padding: DEFAULT_POPOVER_PADDING,
3895
- referenceWidthRef,
3896
- setReferenceWidth,
3897
- widthRef
3898
- }), $[26] = constrainSize, $[27] = margins, $[28] = matchReferenceWidth, $[29] = maxWidthRef, $[30] = referenceWidthRef, $[31] = setReferenceWidth, $[32] = t22, $[33] = widthRef, $[34] = t32) : t32 = $[34], ret.push(t32);
3899
- }
3900
- if (preventOverflow) {
3901
- const t22 = floatingBoundary || void 0;
3902
- let t32;
3903
- $[35] !== rootBoundary || $[36] !== t22 ? (t32 = shift({
3904
- boundary: t22,
3905
- rootBoundary,
3906
- padding: DEFAULT_POPOVER_PADDING
3907
- }), $[35] = rootBoundary, $[36] = t22, $[37] = t32) : t32 = $[37], ret.push(t32);
3908
- }
3909
- if (arrowProp) {
3910
- let t22;
3911
- $[38] !== arrowRef ? (t22 = arrow({
3912
- element: arrowRef,
3913
- padding: DEFAULT_POPOVER_PADDING
3914
- }), $[38] = arrowRef, $[39] = t22) : t22 = $[39], ret.push(t22);
3915
- }
3916
- animate && ret.push(origin);
3917
- const t2 = referenceBoundary || void 0;
3918
- let t3;
3919
- $[40] !== t2 ? (t3 = hide({
3920
- boundary: t2,
3282
+ })), (constrainSize || matchReferenceWidth) && ret.push(size({
3283
+ boundaryElement: floatingBoundary || void 0,
3284
+ constrainSize,
3285
+ margins,
3286
+ matchReferenceWidth,
3287
+ maxWidthRef,
3288
+ padding: DEFAULT_POPOVER_PADDING,
3289
+ referenceWidthRef,
3290
+ setReferenceWidth,
3291
+ widthRef
3292
+ })), preventOverflow && ret.push(shift({
3293
+ boundary: floatingBoundary || void 0,
3294
+ rootBoundary,
3295
+ padding: DEFAULT_POPOVER_PADDING
3296
+ })), arrowProp && ret.push(arrow({
3297
+ element: arrowRef,
3298
+ padding: DEFAULT_POPOVER_PADDING
3299
+ })), animate && ret.push(origin), ret.push(hide({
3300
+ boundary: referenceBoundary || void 0,
3921
3301
  padding: DEFAULT_POPOVER_PADDING,
3922
3302
  strategy: "referenceHidden"
3923
- }), $[40] = t2, $[41] = t3) : t3 = $[41], ret.push(t3), $[0] = animate, $[1] = arrowProp, $[2] = arrowRef, $[3] = constrainSize, $[4] = fallbackPlacements, $[5] = floatingBoundary, $[6] = margins, $[7] = matchReferenceWidth, $[8] = maxWidthRef, $[9] = placementProp, $[10] = placementStrategy, $[11] = preventOverflow, $[12] = referenceBoundary, $[13] = referenceWidthRef, $[14] = rootBoundary, $[15] = setReferenceWidth, $[16] = widthRef, $[17] = ret;
3924
- } else
3925
- ret = $[17];
3926
- return ret;
3303
+ })), ret;
3304
+ }, [animate, arrowProp, arrowRef, constrainSize, fallbackPlacements, floatingBoundary, margins, matchReferenceWidth, maxWidthRef, placementProp, placementStrategy, preventOverflow, referenceBoundary, referenceWidthRef, rootBoundary, setReferenceWidth, widthRef]);
3927
3305
  }
3928
3306
  function radioBaseStyle() {
3929
3307
  return css`
@@ -4046,29 +3424,18 @@ const StyledRadio = /* @__PURE__ */ styled.div.withConfig({
4046
3424
  displayName: "Input",
4047
3425
  componentId: "sc-ccrwkf-1"
4048
3426
  })(inputElementStyle), Radio = forwardRef(function(props, forwardedRef) {
4049
- const $ = c(19);
4050
- let className, customValidity, disabled, readOnly, restProps, style;
4051
- $[0] !== props ? ({
3427
+ const {
4052
3428
  className,
4053
3429
  disabled,
4054
3430
  style,
4055
3431
  customValidity,
4056
3432
  readOnly,
4057
3433
  ...restProps
4058
- } = props, $[0] = props, $[1] = className, $[2] = customValidity, $[3] = disabled, $[4] = readOnly, $[5] = restProps, $[6] = style) : (className = $[1], customValidity = $[2], disabled = $[3], readOnly = $[4], restProps = $[5], style = $[6]);
4059
- const ref = useRef(null);
4060
- let t0;
4061
- $[7] === Symbol.for("react.memo_cache_sentinel") ? (t0 = () => ref.current, $[7] = t0) : t0 = $[7], useImperativeHandle(forwardedRef, t0), useCustomValidity(ref, customValidity);
4062
- const t1 = !disabled && readOnly ? "" : void 0, t2 = customValidity ? "" : void 0, t3 = disabled || readOnly;
4063
- let t4;
4064
- $[8] !== readOnly || $[9] !== restProps || $[10] !== t1 || $[11] !== t2 || $[12] !== t3 ? (t4 = /* @__PURE__ */ jsx(Input$4, { "data-read-only": t1, "data-error": t2, ...restProps, disabled: t3, readOnly, ref, type: "radio" }), $[8] = readOnly, $[9] = restProps, $[10] = t1, $[11] = t2, $[12] = t3, $[13] = t4) : t4 = $[13];
4065
- let t5;
4066
- $[14] === Symbol.for("react.memo_cache_sentinel") ? (t5 = /* @__PURE__ */ jsx("span", {}), $[14] = t5) : t5 = $[14];
4067
- let t6;
4068
- return $[15] !== className || $[16] !== style || $[17] !== t4 ? (t6 = /* @__PURE__ */ jsxs(StyledRadio, { className, "data-ui": "Radio", style, children: [
4069
- t4,
4070
- t5
4071
- ] }), $[15] = className, $[16] = style, $[17] = t4, $[18] = t6) : t6 = $[18], t6;
3434
+ } = props, ref = useRef(null);
3435
+ return useImperativeHandle(forwardedRef, () => ref.current), useCustomValidity(ref, customValidity), /* @__PURE__ */ jsxs(StyledRadio, { className, "data-ui": "Radio", style, children: [
3436
+ /* @__PURE__ */ jsx(Input$4, { "data-read-only": !disabled && readOnly ? "" : void 0, "data-error": customValidity ? "" : void 0, ...restProps, disabled: disabled || readOnly, readOnly, ref, type: "radio" }),
3437
+ /* @__PURE__ */ jsx("span", {})
3438
+ ] });
4072
3439
  });
4073
3440
  Radio.displayName = "ForwardRef(Radio)";
4074
3441
  function rootStyle() {
@@ -4223,45 +3590,21 @@ const selectStyle = {
4223
3590
  displayName: "IconBox",
4224
3591
  componentId: "sc-5mxno7-2"
4225
3592
  })(selectStyle.iconBox), Select = forwardRef(function(props, forwardedRef) {
4226
- const $ = c(37);
4227
- let children, customValidity, disabled, readOnly, restProps, t0, t1, t2, t3;
4228
- $[0] !== props ? ({
3593
+ const {
4229
3594
  children,
4230
3595
  customValidity,
4231
3596
  disabled,
4232
- fontSize: t0,
4233
- padding: t1,
4234
- radius: t2,
3597
+ fontSize: fontSize2 = 2,
3598
+ padding = 3,
3599
+ radius = 2,
4235
3600
  readOnly,
4236
- space: t3,
3601
+ space = 3,
4237
3602
  ...restProps
4238
- } = props, $[0] = props, $[1] = children, $[2] = customValidity, $[3] = disabled, $[4] = readOnly, $[5] = restProps, $[6] = t0, $[7] = t1, $[8] = t2, $[9] = t3) : (children = $[1], customValidity = $[2], disabled = $[3], readOnly = $[4], restProps = $[5], t0 = $[6], t1 = $[7], t2 = $[8], t3 = $[9]);
4239
- const fontSize2 = t0 === void 0 ? 2 : t0, padding = t1 === void 0 ? 3 : t1, radius = t2 === void 0 ? 2 : t2, space = t3 === void 0 ? 3 : t3, ref = useRef(null);
4240
- let t4;
4241
- $[10] === Symbol.for("react.memo_cache_sentinel") ? (t4 = () => ref.current, $[10] = t4) : t4 = $[10], useImperativeHandle(forwardedRef, t4), useCustomValidity(ref, customValidity);
4242
- const t5 = !disabled && readOnly ? "" : void 0;
4243
- let t6;
4244
- $[11] !== fontSize2 ? (t6 = _getArrayProp(fontSize2), $[11] = fontSize2, $[12] = t6) : t6 = $[12];
4245
- let t7;
4246
- $[13] !== padding ? (t7 = _getArrayProp(padding), $[13] = padding, $[14] = t7) : t7 = $[14];
4247
- let t8;
4248
- $[15] !== radius ? (t8 = _getArrayProp(radius), $[15] = radius, $[16] = t8) : t8 = $[16];
4249
- let t9;
4250
- $[17] !== space ? (t9 = _getArrayProp(space), $[17] = space, $[18] = t9) : t9 = $[18];
4251
- const t10 = disabled || readOnly;
4252
- let t11;
4253
- $[19] !== children || $[20] !== restProps || $[21] !== t10 || $[22] !== t5 || $[23] !== t6 || $[24] !== t7 || $[25] !== t8 || $[26] !== t9 ? (t11 = /* @__PURE__ */ jsx(Input$3, { "data-read-only": t5, "data-ui": "Select", ...restProps, $fontSize: t6, $padding: t7, $radius: t8, $space: t9, disabled: t10, ref, children }), $[19] = children, $[20] = restProps, $[21] = t10, $[22] = t5, $[23] = t6, $[24] = t7, $[25] = t8, $[26] = t9, $[27] = t11) : t11 = $[27];
4254
- let t12;
4255
- $[28] === Symbol.for("react.memo_cache_sentinel") ? (t12 = /* @__PURE__ */ jsx(ChevronDownIcon, {}), $[28] = t12) : t12 = $[28];
4256
- let t13;
4257
- $[29] !== fontSize2 ? (t13 = /* @__PURE__ */ jsx(Text, { size: fontSize2, children: t12 }), $[29] = fontSize2, $[30] = t13) : t13 = $[30];
4258
- let t14;
4259
- $[31] !== padding || $[32] !== t13 ? (t14 = /* @__PURE__ */ jsx(IconBox, { padding, children: t13 }), $[31] = padding, $[32] = t13, $[33] = t14) : t14 = $[33];
4260
- let t15;
4261
- return $[34] !== t11 || $[35] !== t14 ? (t15 = /* @__PURE__ */ jsxs(StyledSelect, { "data-ui": "Select", children: [
4262
- t11,
4263
- t14
4264
- ] }), $[34] = t11, $[35] = t14, $[36] = t15) : t15 = $[36], t15;
3603
+ } = props, ref = useRef(null);
3604
+ return useImperativeHandle(forwardedRef, () => ref.current), useCustomValidity(ref, customValidity), /* @__PURE__ */ jsxs(StyledSelect, { "data-ui": "Select", children: [
3605
+ /* @__PURE__ */ jsx(Input$3, { "data-read-only": !disabled && readOnly ? "" : void 0, "data-ui": "Select", ...restProps, $fontSize: _getArrayProp(fontSize2), $padding: _getArrayProp(padding), $radius: _getArrayProp(radius), $space: _getArrayProp(space), disabled: disabled || readOnly, ref, children }),
3606
+ /* @__PURE__ */ jsx(IconBox, { padding, children: /* @__PURE__ */ jsx(Text, { size: fontSize2, children: /* @__PURE__ */ jsx(ChevronDownIcon, {}) }) })
3607
+ ] });
4265
3608
  });
4266
3609
  Select.displayName = "ForwardRef(Select)";
4267
3610
  const BASE_STYLE = {
@@ -4290,18 +3633,12 @@ const StyledStack = /* @__PURE__ */ styled(Box).withConfig({
4290
3633
  displayName: "StyledStack",
4291
3634
  componentId: "sc-8dpfq2-0"
4292
3635
  })(stackBaseStyle, responsiveStackSpaceStyle), Stack = forwardRef(function(props, ref) {
4293
- const $ = c(12);
4294
- let as, restProps, space;
4295
- $[0] !== props ? ({
3636
+ const {
4296
3637
  as,
4297
3638
  space,
4298
3639
  ...restProps
4299
- } = props, $[0] = props, $[1] = as, $[2] = restProps, $[3] = space) : (as = $[1], restProps = $[2], space = $[3]);
4300
- const t0 = typeof as == "string" ? as : void 0;
4301
- let t1;
4302
- $[4] !== space ? (t1 = _getArrayProp(space), $[4] = space, $[5] = t1) : t1 = $[5];
4303
- let t2;
4304
- return $[6] !== as || $[7] !== ref || $[8] !== restProps || $[9] !== t0 || $[10] !== t1 ? (t2 = /* @__PURE__ */ jsx(StyledStack, { "data-as": t0, "data-ui": "Stack", ...restProps, $space: t1, forwardedAs: as, ref }), $[6] = as, $[7] = ref, $[8] = restProps, $[9] = t0, $[10] = t1, $[11] = t2) : t2 = $[11], t2;
3640
+ } = props;
3641
+ return /* @__PURE__ */ jsx(StyledStack, { "data-as": typeof as == "string" ? as : void 0, "data-ui": "Stack", ...restProps, $space: _getArrayProp(space), forwardedAs: as, ref });
4305
3642
  });
4306
3643
  Stack.displayName = "ForwardRef(Stack)";
4307
3644
  function switchBaseStyles() {
@@ -4473,9 +3810,7 @@ const StyledSwitch = /* @__PURE__ */ styled.span.withConfig({
4473
3810
  displayName: "Thumb",
4474
3811
  componentId: "sc-dw1foe-4"
4475
3812
  })(switchThumbStyles), Switch = forwardRef(function(props, forwardedRef) {
4476
- const $ = c(26);
4477
- let checked, className, disabled, indeterminate, readOnly, restProps, style;
4478
- $[0] !== props ? ({
3813
+ const {
4479
3814
  checked,
4480
3815
  className,
4481
3816
  disabled,
@@ -4483,29 +3818,16 @@ const StyledSwitch = /* @__PURE__ */ styled.span.withConfig({
4483
3818
  readOnly,
4484
3819
  style,
4485
3820
  ...restProps
4486
- } = props, $[0] = props, $[1] = checked, $[2] = className, $[3] = disabled, $[4] = indeterminate, $[5] = readOnly, $[6] = restProps, $[7] = style) : (checked = $[1], className = $[2], disabled = $[3], indeterminate = $[4], readOnly = $[5], restProps = $[6], style = $[7]);
4487
- const ref = useRef(null);
4488
- let t0;
4489
- $[8] === Symbol.for("react.memo_cache_sentinel") ? (t0 = () => ref.current, $[8] = t0) : t0 = $[8], useImperativeHandle(forwardedRef, t0);
4490
- let t1, t2;
4491
- $[9] !== indeterminate ? (t1 = () => {
3821
+ } = props, ref = useRef(null);
3822
+ return useImperativeHandle(forwardedRef, () => ref.current), useEffect(() => {
4492
3823
  ref.current && (ref.current.indeterminate = indeterminate || !1);
4493
- }, t2 = [indeterminate], $[9] = indeterminate, $[10] = t1, $[11] = t2) : (t1 = $[10], t2 = $[11]), useEffect(t1, t2);
4494
- const t3 = !disabled && readOnly ? "" : void 0, t4 = indeterminate !== !0 && checked, t5 = disabled || readOnly;
4495
- let t6;
4496
- $[12] !== restProps || $[13] !== t3 || $[14] !== t4 || $[15] !== t5 ? (t6 = /* @__PURE__ */ jsx(Input$2, { "data-read-only": t3, ...restProps, checked: t4, disabled: t5, type: "checkbox", ref }), $[12] = restProps, $[13] = t3, $[14] = t4, $[15] = t5, $[16] = t6) : t6 = $[16];
4497
- let t7;
4498
- $[17] === Symbol.for("react.memo_cache_sentinel") ? (t7 = /* @__PURE__ */ jsx(Track, {}), $[17] = t7) : t7 = $[17];
4499
- let t8;
4500
- $[18] !== checked || $[19] !== indeterminate ? (t8 = /* @__PURE__ */ jsxs(Representation, { "aria-hidden": !0, "data-name": "representation", children: [
4501
- t7,
4502
- /* @__PURE__ */ jsx(Thumb, { $checked: checked, $indeterminate: indeterminate })
4503
- ] }), $[18] = checked, $[19] = indeterminate, $[20] = t8) : t8 = $[20];
4504
- let t9;
4505
- return $[21] !== className || $[22] !== style || $[23] !== t6 || $[24] !== t8 ? (t9 = /* @__PURE__ */ jsxs(StyledSwitch, { className, "data-ui": "Switch", style, children: [
4506
- t6,
4507
- t8
4508
- ] }), $[21] = className, $[22] = style, $[23] = t6, $[24] = t8, $[25] = t9) : t9 = $[25], t9;
3824
+ }, [indeterminate]), /* @__PURE__ */ jsxs(StyledSwitch, { className, "data-ui": "Switch", style, children: [
3825
+ /* @__PURE__ */ jsx(Input$2, { "data-read-only": !disabled && readOnly ? "" : void 0, ...restProps, checked: indeterminate !== !0 && checked, disabled: disabled || readOnly, type: "checkbox", ref }),
3826
+ /* @__PURE__ */ jsxs(Representation, { "aria-hidden": !0, "data-name": "representation", children: [
3827
+ /* @__PURE__ */ jsx(Track, {}),
3828
+ /* @__PURE__ */ jsx(Thumb, { $checked: checked, $indeterminate: indeterminate })
3829
+ ] })
3830
+ ] });
4509
3831
  });
4510
3832
  Switch.displayName = "ForwardRef(Switch)";
4511
3833
  const StyledTextArea = /* @__PURE__ */ styled.span.withConfig({
@@ -4521,42 +3843,21 @@ const StyledTextArea = /* @__PURE__ */ styled.span.withConfig({
4521
3843
  displayName: "Presentation",
4522
3844
  componentId: "sc-1d6h1o8-3"
4523
3845
  })(responsiveRadiusStyle, textInputRepresentationStyle), TextArea = forwardRef(function(props, forwardedRef) {
4524
- const $ = c(35);
4525
- let __unstable_disableFocusRing, customValidity, restProps, t0, t1, t2, t3, t4, weight;
4526
- $[0] !== props ? ({
4527
- border: t0,
3846
+ const {
3847
+ border: border2 = !0,
4528
3848
  customValidity,
4529
- disabled: t1,
4530
- fontSize: t2,
4531
- padding: t3,
4532
- radius: t4,
3849
+ disabled = !1,
3850
+ fontSize: fontSize2 = 2,
3851
+ padding = 3,
3852
+ radius = 2,
4533
3853
  weight,
4534
3854
  __unstable_disableFocusRing,
4535
3855
  ...restProps
4536
- } = props, $[0] = props, $[1] = __unstable_disableFocusRing, $[2] = customValidity, $[3] = restProps, $[4] = t0, $[5] = t1, $[6] = t2, $[7] = t3, $[8] = t4, $[9] = weight) : (__unstable_disableFocusRing = $[1], customValidity = $[2], restProps = $[3], t0 = $[4], t1 = $[5], t2 = $[6], t3 = $[7], t4 = $[8], weight = $[9]);
4537
- const border2 = t0 === void 0 ? !0 : t0, disabled = t1 === void 0 ? !1 : t1, fontSize2 = t2 === void 0 ? 2 : t2, padding = t3 === void 0 ? 3 : t3, radius = t4 === void 0 ? 2 : t4, ref = useRef(null), rootTheme = useRootTheme();
4538
- let t5;
4539
- $[10] === Symbol.for("react.memo_cache_sentinel") ? (t5 = () => ref.current, $[10] = t5) : t5 = $[10], useImperativeHandle(forwardedRef, t5), useCustomValidity(ref, customValidity);
4540
- const t6 = rootTheme.scheme, t7 = rootTheme.tone;
4541
- let t8;
4542
- $[11] !== fontSize2 ? (t8 = _getArrayProp(fontSize2), $[11] = fontSize2, $[12] = t8) : t8 = $[12];
4543
- let t9;
4544
- $[13] !== padding ? (t9 = _getArrayProp(padding), $[13] = padding, $[14] = t9) : t9 = $[14];
4545
- const t10 = rootTheme.scheme;
4546
- let t11;
4547
- $[15] === Symbol.for("react.memo_cache_sentinel") ? (t11 = _getArrayProp(0), $[15] = t11) : t11 = $[15];
4548
- let t12;
4549
- $[16] !== disabled || $[17] !== restProps || $[18] !== rootTheme.scheme || $[19] !== rootTheme.tone || $[20] !== t8 || $[21] !== t9 || $[22] !== weight ? (t12 = /* @__PURE__ */ jsx(Input$1, { "data-as": "textarea", "data-scheme": t6, "data-tone": t7, ...restProps, $fontSize: t8, $padding: t9, $scheme: t10, $space: t11, $tone: rootTheme.tone, $weight: weight, disabled, ref }), $[16] = disabled, $[17] = restProps, $[18] = rootTheme.scheme, $[19] = rootTheme.tone, $[20] = t8, $[21] = t9, $[22] = weight, $[23] = t12) : t12 = $[23];
4550
- let t13;
4551
- $[24] !== radius ? (t13 = _getArrayProp(radius), $[24] = radius, $[25] = t13) : t13 = $[25];
4552
- const t14 = border2 ? "" : void 0;
4553
- let t15;
4554
- $[26] !== __unstable_disableFocusRing || $[27] !== rootTheme.scheme || $[28] !== rootTheme.tone || $[29] !== t13 || $[30] !== t14 ? (t15 = /* @__PURE__ */ jsx(Presentation$1, { $radius: t13, $unstableDisableFocusRing: __unstable_disableFocusRing, $scheme: rootTheme.scheme, $tone: rootTheme.tone, "data-border": t14, "data-scheme": rootTheme.scheme, "data-tone": rootTheme.tone }), $[26] = __unstable_disableFocusRing, $[27] = rootTheme.scheme, $[28] = rootTheme.tone, $[29] = t13, $[30] = t14, $[31] = t15) : t15 = $[31];
4555
- let t16;
4556
- return $[32] !== t12 || $[33] !== t15 ? (t16 = /* @__PURE__ */ jsx(StyledTextArea, { "data-ui": "TextArea", children: /* @__PURE__ */ jsxs(InputRoot$1, { children: [
4557
- t12,
4558
- t15
4559
- ] }) }), $[32] = t12, $[33] = t15, $[34] = t16) : t16 = $[34], t16;
3856
+ } = props, ref = useRef(null), rootTheme = useRootTheme();
3857
+ return useImperativeHandle(forwardedRef, () => ref.current), useCustomValidity(ref, customValidity), /* @__PURE__ */ jsx(StyledTextArea, { "data-ui": "TextArea", children: /* @__PURE__ */ jsxs(InputRoot$1, { children: [
3858
+ /* @__PURE__ */ jsx(Input$1, { "data-as": "textarea", "data-scheme": rootTheme.scheme, "data-tone": rootTheme.tone, ...restProps, $fontSize: _getArrayProp(fontSize2), $padding: _getArrayProp(padding), $scheme: rootTheme.scheme, $space: _getArrayProp(0), $tone: rootTheme.tone, $weight: weight, disabled, ref }),
3859
+ /* @__PURE__ */ jsx(Presentation$1, { $radius: _getArrayProp(radius), $unstableDisableFocusRing: __unstable_disableFocusRing, $scheme: rootTheme.scheme, $tone: rootTheme.tone, "data-border": border2 ? "" : void 0, "data-scheme": rootTheme.scheme, "data-tone": rootTheme.tone })
3860
+ ] }) });
4560
3861
  });
4561
3862
  TextArea.displayName = "ForwardRef(TextArea)";
4562
3863
  const CLEAR_BUTTON_BOX_STYLE = {
@@ -4602,119 +3903,61 @@ const CLEAR_BUTTON_BOX_STYLE = {
4602
3903
  display: "block"
4603
3904
  }
4604
3905
  }), TextInput = forwardRef(function(props, forwardedRef) {
4605
- const $ = c(92);
4606
- let IconComponent, IconRightComponent, __unstable_disableFocusRing, clearButton, customValidity, onClear, prefix, readOnly, restProps, suffix, t0, t1, t2, t3, t4, t5, t6, weight;
4607
- $[0] !== props ? ({
3906
+ const {
4608
3907
  __unstable_disableFocusRing,
4609
- border: t0,
3908
+ border: border2 = !0,
4610
3909
  clearButton,
4611
- disabled: t1,
4612
- fontSize: t2,
3910
+ disabled = !1,
3911
+ fontSize: fontSizeProp = 2,
4613
3912
  icon: IconComponent,
4614
3913
  iconRight: IconRightComponent,
4615
3914
  onClear,
4616
- padding: t3,
3915
+ padding: paddingProp = 3,
4617
3916
  prefix,
4618
- radius: t4,
3917
+ radius: radiusProp = 2,
4619
3918
  readOnly,
4620
- space: t5,
3919
+ space: spaceProp = 3,
4621
3920
  suffix,
4622
3921
  customValidity,
4623
- type: t6,
3922
+ type = "text",
4624
3923
  weight,
4625
3924
  ...restProps
4626
- } = props, $[0] = props, $[1] = IconComponent, $[2] = IconRightComponent, $[3] = __unstable_disableFocusRing, $[4] = clearButton, $[5] = customValidity, $[6] = onClear, $[7] = prefix, $[8] = readOnly, $[9] = restProps, $[10] = suffix, $[11] = t0, $[12] = t1, $[13] = t2, $[14] = t3, $[15] = t4, $[16] = t5, $[17] = t6, $[18] = weight) : (IconComponent = $[1], IconRightComponent = $[2], __unstable_disableFocusRing = $[3], clearButton = $[4], customValidity = $[5], onClear = $[6], prefix = $[7], readOnly = $[8], restProps = $[9], suffix = $[10], t0 = $[11], t1 = $[12], t2 = $[13], t3 = $[14], t4 = $[15], t5 = $[16], t6 = $[17], weight = $[18]);
4627
- const border2 = t0 === void 0 ? !0 : t0, disabled = t1 === void 0 ? !1 : t1, fontSizeProp = t2 === void 0 ? 2 : t2, paddingProp = t3 === void 0 ? 3 : t3, radiusProp = t4 === void 0 ? 2 : t4, spaceProp = t5 === void 0 ? 3 : t5, type = t6 === void 0 ? "text" : t6, ref = useRef(null), rootTheme = useRootTheme();
4628
- let t7;
4629
- $[19] !== fontSizeProp ? (t7 = _getArrayProp(fontSizeProp), $[19] = fontSizeProp, $[20] = t7) : t7 = $[20];
4630
- const fontSize2 = t7;
4631
- let t8;
4632
- $[21] !== paddingProp ? (t8 = _getArrayProp(paddingProp), $[21] = paddingProp, $[22] = t8) : t8 = $[22];
4633
- const padding = t8;
4634
- let t9;
4635
- $[23] !== radiusProp ? (t9 = _getArrayProp(radiusProp), $[23] = radiusProp, $[24] = t9) : t9 = $[24];
4636
- const radius = t9;
4637
- let t10;
4638
- $[25] !== spaceProp ? (t10 = _getArrayProp(spaceProp), $[25] = spaceProp, $[26] = t10) : t10 = $[26];
4639
- const space = t10, $hasClearButton = !!clearButton, $hasIcon = !!IconComponent, $hasIconRight = !!IconRightComponent, $hasSuffix = !!suffix, $hasPrefix = !!prefix;
4640
- let t11;
4641
- $[27] === Symbol.for("react.memo_cache_sentinel") ? (t11 = () => ref.current, $[27] = t11) : t11 = $[27], useImperativeHandle(forwardedRef, t11), useCustomValidity(ref, customValidity);
4642
- const handleClearMouseDown = _temp$2;
4643
- let t12;
4644
- $[28] !== onClear ? (t12 = (event_0) => {
4645
- event_0.preventDefault(), event_0.stopPropagation(), onClear && onClear(), ref.current?.focus();
4646
- }, $[28] = onClear, $[29] = t12) : t12 = $[29];
4647
- const handleClearClick = t12;
4648
- let t13;
4649
- $[30] !== prefix || $[31] !== radius ? (t13 = prefix && /* @__PURE__ */ jsx(Prefix, { borderTop: !0, borderLeft: !0, borderBottom: !0, radius, sizing: "border", tone: "inherit", children: /* @__PURE__ */ jsx("span", { children: prefix }) }), $[30] = prefix, $[31] = radius, $[32] = t13) : t13 = $[32];
4650
- const prefixNode = t13, t14 = border2 ? "" : void 0;
4651
- let t15;
4652
- $[33] !== IconComponent || $[34] !== fontSize2 || $[35] !== padding ? (t15 = IconComponent && /* @__PURE__ */ jsx(LeftBox, { padding, children: /* @__PURE__ */ jsxs(Text, { size: fontSize2, children: [
4653
- isValidElement(IconComponent) && IconComponent,
4654
- isValidElementType(IconComponent) && /* @__PURE__ */ jsx(IconComponent, {})
4655
- ] }) }), $[33] = IconComponent, $[34] = fontSize2, $[35] = padding, $[36] = t15) : t15 = $[36];
4656
- let t16;
4657
- $[37] !== $hasClearButton || $[38] !== IconRightComponent || $[39] !== fontSize2 || $[40] !== padding ? (t16 = !$hasClearButton && IconRightComponent && /* @__PURE__ */ jsx(RightBox, { padding, children: /* @__PURE__ */ jsxs(Text, { size: fontSize2, children: [
4658
- isValidElement(IconRightComponent) && IconRightComponent,
4659
- isValidElementType(IconRightComponent) && /* @__PURE__ */ jsx(IconRightComponent, {})
4660
- ] }) }), $[37] = $hasClearButton, $[38] = IconRightComponent, $[39] = fontSize2, $[40] = padding, $[41] = t16) : t16 = $[41];
4661
- let t17;
4662
- $[42] !== $hasPrefix || $[43] !== $hasSuffix || $[44] !== __unstable_disableFocusRing || $[45] !== radius || $[46] !== rootTheme.scheme || $[47] !== rootTheme.tone || $[48] !== t14 || $[49] !== t15 || $[50] !== t16 ? (t17 = /* @__PURE__ */ jsxs(Presentation, { $hasPrefix, $unstableDisableFocusRing: __unstable_disableFocusRing, $hasSuffix, $radius: radius, $scheme: rootTheme.scheme, $tone: rootTheme.tone, "data-border": t14, "data-scheme": rootTheme.scheme, "data-tone": rootTheme.tone, children: [
4663
- t15,
4664
- t16
4665
- ] }), $[42] = $hasPrefix, $[43] = $hasSuffix, $[44] = __unstable_disableFocusRing, $[45] = radius, $[46] = rootTheme.scheme, $[47] = rootTheme.tone, $[48] = t14, $[49] = t15, $[50] = t16, $[51] = t17) : t17 = $[51];
4666
- const presentationNode = t17;
4667
- let t18;
4668
- $[52] !== padding ? (t18 = padding.map(_temp2), $[52] = padding, $[53] = t18) : t18 = $[53];
4669
- const clearButtonBoxPadding = t18;
4670
- let t19;
4671
- $[54] !== padding ? (t19 = padding.map(_temp3), $[54] = padding, $[55] = t19) : t19 = $[55];
4672
- const clearButtonPadding = t19, clearButtonProps = typeof clearButton == "object" ? clearButton : EMPTY_RECORD;
4673
- let t20;
4674
- $[56] !== clearButton || $[57] !== clearButtonBoxPadding || $[58] !== clearButtonPadding || $[59] !== clearButtonProps || $[60] !== customValidity || $[61] !== disabled || $[62] !== fontSize2 || $[63] !== handleClearClick || $[64] !== radius || $[65] !== readOnly ? (t20 = !disabled && !readOnly && clearButton && /* @__PURE__ */ jsx(RightCard, { forwardedAs: "span", padding: clearButtonBoxPadding, style: CLEAR_BUTTON_BOX_STYLE, tone: customValidity ? "critical" : "inherit", children: /* @__PURE__ */ jsx(TextInputClearButton, { "aria-label": "Clear", "data-qa": "clear-button", fontSize: fontSize2, icon: CloseIcon, mode: "bleed", padding: clearButtonPadding, radius, ...clearButtonProps, onClick: handleClearClick, onMouseDown: handleClearMouseDown }) }), $[56] = clearButton, $[57] = clearButtonBoxPadding, $[58] = clearButtonPadding, $[59] = clearButtonProps, $[60] = customValidity, $[61] = disabled, $[62] = fontSize2, $[63] = handleClearClick, $[64] = radius, $[65] = readOnly, $[66] = t20) : t20 = $[66];
4675
- const clearButtonNode = t20;
4676
- let t21;
4677
- $[67] !== radius || $[68] !== suffix ? (t21 = suffix && /* @__PURE__ */ jsx(Suffix, { borderTop: !0, borderRight: !0, borderBottom: !0, radius, sizing: "border", tone: "inherit", children: /* @__PURE__ */ jsx("span", { children: suffix }) }), $[67] = radius, $[68] = suffix, $[69] = t21) : t21 = $[69];
4678
- const suffixNode = t21, t22 = $hasIconRight || $hasClearButton;
4679
- let t23;
4680
- $[70] !== $hasIcon || $[71] !== disabled || $[72] !== fontSize2 || $[73] !== padding || $[74] !== readOnly || $[75] !== restProps || $[76] !== rootTheme.scheme || $[77] !== rootTheme.tone || $[78] !== space || $[79] !== t22 || $[80] !== type || $[81] !== weight ? (t23 = /* @__PURE__ */ jsx(Input, { "data-as": "input", "data-scheme": rootTheme.scheme, "data-tone": rootTheme.tone, ...restProps, $fontSize: fontSize2, $iconLeft: $hasIcon, $iconRight: t22, $padding: padding, $scheme: rootTheme.scheme, $space: space, $tone: rootTheme.tone, $weight: weight, disabled, readOnly, ref, type }), $[70] = $hasIcon, $[71] = disabled, $[72] = fontSize2, $[73] = padding, $[74] = readOnly, $[75] = restProps, $[76] = rootTheme.scheme, $[77] = rootTheme.tone, $[78] = space, $[79] = t22, $[80] = type, $[81] = weight, $[82] = t23) : t23 = $[82];
4681
- let t24;
4682
- $[83] !== clearButtonNode || $[84] !== presentationNode || $[85] !== t23 ? (t24 = /* @__PURE__ */ jsxs(InputRoot, { children: [
4683
- t23,
4684
- presentationNode,
4685
- clearButtonNode
4686
- ] }), $[83] = clearButtonNode, $[84] = presentationNode, $[85] = t23, $[86] = t24) : t24 = $[86];
4687
- let t25;
4688
- return $[87] !== prefixNode || $[88] !== rootTheme.tone || $[89] !== suffixNode || $[90] !== t24 ? (t25 = /* @__PURE__ */ jsxs(StyledTextInput, { "data-ui": "TextInput", tone: rootTheme.tone, children: [
3925
+ } = props, ref = useRef(null), rootTheme = useRootTheme(), fontSize2 = _getArrayProp(fontSizeProp), padding = _getArrayProp(paddingProp), radius = _getArrayProp(radiusProp), space = _getArrayProp(spaceProp), $hasClearButton = !!clearButton, $hasIcon = !!IconComponent, $hasIconRight = !!IconRightComponent, $hasSuffix = !!suffix, $hasPrefix = !!prefix;
3926
+ useImperativeHandle(forwardedRef, () => ref.current), useCustomValidity(ref, customValidity);
3927
+ const handleClearMouseDown = useCallback((event) => {
3928
+ event.preventDefault(), event.stopPropagation();
3929
+ }, []), handleClearClick = useCallback((event) => {
3930
+ event.preventDefault(), event.stopPropagation(), onClear && onClear(), ref.current?.focus();
3931
+ }, [onClear, ref]), prefixNode = useMemo(() => prefix && /* @__PURE__ */ jsx(Prefix, { borderTop: !0, borderLeft: !0, borderBottom: !0, radius, sizing: "border", tone: "inherit", children: /* @__PURE__ */ jsx("span", { children: prefix }) }), [prefix, radius]), presentationNode = useMemo(() => /* @__PURE__ */ jsxs(Presentation, { $hasPrefix, $unstableDisableFocusRing: __unstable_disableFocusRing, $hasSuffix, $radius: radius, $scheme: rootTheme.scheme, $tone: rootTheme.tone, "data-border": border2 ? "" : void 0, "data-scheme": rootTheme.scheme, "data-tone": rootTheme.tone, children: [
3932
+ IconComponent && /* @__PURE__ */ jsx(LeftBox, { padding, children: /* @__PURE__ */ jsxs(Text, { size: fontSize2, children: [
3933
+ isValidElement(IconComponent) && IconComponent,
3934
+ isValidElementType(IconComponent) && /* @__PURE__ */ jsx(IconComponent, {})
3935
+ ] }) }),
3936
+ !$hasClearButton && IconRightComponent && /* @__PURE__ */ jsx(RightBox, { padding, children: /* @__PURE__ */ jsxs(Text, { size: fontSize2, children: [
3937
+ isValidElement(IconRightComponent) && IconRightComponent,
3938
+ isValidElementType(IconRightComponent) && /* @__PURE__ */ jsx(IconRightComponent, {})
3939
+ ] }) })
3940
+ ] }), [__unstable_disableFocusRing, border2, fontSize2, IconComponent, IconRightComponent, padding, radius, rootTheme, $hasClearButton, $hasPrefix, $hasSuffix]), clearButtonBoxPadding = useMemo(() => padding.map((v) => v === 0 ? 0 : v === 1 || v === 2 ? 1 : v - 2), [padding]), clearButtonPadding = useMemo(() => padding.map((v) => v === 0 || v === 1 ? 0 : v === 2 ? 1 : v - 1), [padding]), clearButtonProps = useMemo(() => typeof clearButton == "object" ? clearButton : EMPTY_RECORD, [clearButton]), clearButtonNode = useMemo(() => !disabled && !readOnly && clearButton && /* @__PURE__ */ jsx(RightCard, { forwardedAs: "span", padding: clearButtonBoxPadding, style: CLEAR_BUTTON_BOX_STYLE, tone: customValidity ? "critical" : "inherit", children: /* @__PURE__ */ jsx(TextInputClearButton, { "aria-label": "Clear", "data-qa": "clear-button", fontSize: fontSize2, icon: CloseIcon, mode: "bleed", padding: clearButtonPadding, radius, ...clearButtonProps, onClick: handleClearClick, onMouseDown: handleClearMouseDown }) }), [clearButton, clearButtonBoxPadding, clearButtonPadding, clearButtonProps, customValidity, disabled, fontSize2, handleClearClick, handleClearMouseDown, radius, readOnly]), suffixNode = useMemo(() => suffix && /* @__PURE__ */ jsx(Suffix, { borderTop: !0, borderRight: !0, borderBottom: !0, radius, sizing: "border", tone: "inherit", children: /* @__PURE__ */ jsx("span", { children: suffix }) }), [radius, suffix]);
3941
+ return /* @__PURE__ */ jsxs(StyledTextInput, { "data-ui": "TextInput", tone: rootTheme.tone, children: [
4689
3942
  prefixNode,
4690
- t24,
3943
+ /* @__PURE__ */ jsxs(InputRoot, { children: [
3944
+ /* @__PURE__ */ jsx(Input, { "data-as": "input", "data-scheme": rootTheme.scheme, "data-tone": rootTheme.tone, ...restProps, $fontSize: fontSize2, $iconLeft: $hasIcon, $iconRight: $hasIconRight || $hasClearButton, $padding: padding, $scheme: rootTheme.scheme, $space: space, $tone: rootTheme.tone, $weight: weight, disabled, readOnly, ref, type }),
3945
+ presentationNode,
3946
+ clearButtonNode
3947
+ ] }),
4691
3948
  suffixNode
4692
- ] }), $[87] = prefixNode, $[88] = rootTheme.tone, $[89] = suffixNode, $[90] = t24, $[91] = t25) : t25 = $[91], t25;
3949
+ ] });
4693
3950
  });
4694
3951
  TextInput.displayName = "ForwardRef(TextInput)";
4695
- function _temp$2(event) {
4696
- event.preventDefault(), event.stopPropagation();
4697
- }
4698
- function _temp2(v) {
4699
- return v === 0 ? 0 : v === 1 || v === 2 ? 1 : v - 2;
4700
- }
4701
- function _temp3(v_0) {
4702
- return v_0 === 0 || v_0 === 1 ? 0 : v_0 === 2 ? 1 : v_0 - 1;
4703
- }
4704
3952
  function useDelayedState(initialState) {
4705
- const $ = c(3), [state, setState] = useState(initialState), delayedAction = useRef(void 0);
4706
- let t0;
4707
- $[0] === Symbol.for("react.memo_cache_sentinel") ? (t0 = (nextState, delay) => {
3953
+ const [state, setState] = useState(initialState), delayedAction = useRef(void 0), onStateChange = useCallback((nextState, delay) => {
4708
3954
  const action = () => {
4709
3955
  setState(nextState);
4710
3956
  };
4711
- if (delayedAction.current && (clearTimeout(delayedAction.current), delayedAction.current = void 0), !delay)
4712
- return action();
3957
+ if (delayedAction.current && (clearTimeout(delayedAction.current), delayedAction.current = void 0), !delay) return action();
4713
3958
  delayedAction.current = setTimeout(action, delay);
4714
- }, $[0] = t0) : t0 = $[0];
4715
- const onStateChange = t0;
4716
- let t1;
4717
- return $[1] !== state ? (t1 = [state, onStateChange], $[1] = state, $[2] = t1) : t1 = $[2], t1;
3959
+ }, []);
3960
+ return [state, onStateChange];
4718
3961
  }
4719
3962
  const DEFAULT_TOOLTIP_ARROW_WIDTH = 15, DEFAULT_TOOLTIP_ARROW_HEIGHT = 6, DEFAULT_TOOLTIP_ARROW_RADIUS = 2, DEFAULT_TOOLTIP_DISTANCE = 4, DEFAULT_TOOLTIP_PADDING = 4, DEFAULT_FALLBACK_PLACEMENTS = {
4720
3963
  top: ["top-end", "top-start", "bottom", "left", "right"],
@@ -4733,9 +3976,7 @@ const DEFAULT_TOOLTIP_ARROW_WIDTH = 15, DEFAULT_TOOLTIP_ARROW_HEIGHT = 6, DEFAUL
4733
3976
  displayName: "MotionCard",
4734
3977
  componentId: "sc-1xn138w-0"
4735
3978
  })`will-change:transform;`, TooltipCard = forwardRef(function(props, ref) {
4736
- const $ = c(48);
4737
- let animate, arrow2, arrowRef, arrowX, arrowY, children, originX, originY, padding, placement, radius, restProps, scheme, shadow, style;
4738
- $[0] !== props ? ({
3979
+ const {
4739
3980
  animate,
4740
3981
  arrow: arrow2,
4741
3982
  arrowRef,
@@ -4751,56 +3992,37 @@ const DEFAULT_TOOLTIP_ARROW_WIDTH = 15, DEFAULT_TOOLTIP_ARROW_HEIGHT = 6, DEFAUL
4751
3992
  shadow,
4752
3993
  style,
4753
3994
  ...restProps
4754
- } = props, $[0] = props, $[1] = animate, $[2] = arrow2, $[3] = arrowRef, $[4] = arrowX, $[5] = arrowY, $[6] = children, $[7] = originX, $[8] = originY, $[9] = padding, $[10] = placement, $[11] = radius, $[12] = restProps, $[13] = scheme, $[14] = shadow, $[15] = style) : (animate = $[1], arrow2 = $[2], arrowRef = $[3], arrowX = $[4], arrowY = $[5], children = $[6], originX = $[7], originY = $[8], padding = $[9], placement = $[10], radius = $[11], restProps = $[12], scheme = $[13], shadow = $[14], style = $[15]);
4755
- const t0 = animate ? "transform" : void 0;
4756
- let t1;
4757
- $[16] !== originX || $[17] !== originY || $[18] !== style || $[19] !== t0 ? (t1 = {
3995
+ } = props, rootStyle2 = useMemo(() => ({
4758
3996
  originX,
4759
3997
  originY,
4760
- willChange: t0,
3998
+ willChange: animate ? "transform" : void 0,
4761
3999
  ...style
4762
- }, $[16] = originX, $[17] = originY, $[18] = style, $[19] = t0, $[20] = t1) : t1 = $[20];
4763
- const rootStyle2 = t1, t2 = arrowX !== null ? arrowX : void 0, t3 = arrowY !== null ? arrowY : void 0;
4764
- let t4;
4765
- $[21] !== t2 || $[22] !== t3 ? (t4 = {
4766
- left: t2,
4767
- top: t3,
4000
+ }), [animate, originX, originY, style]), arrowStyle = useMemo(() => ({
4001
+ left: arrowX !== null ? arrowX : void 0,
4002
+ top: arrowY !== null ? arrowY : void 0,
4768
4003
  right: void 0,
4769
4004
  bottom: void 0
4770
- }, $[21] = t2, $[22] = t3, $[23] = t4) : t4 = $[23];
4771
- const arrowStyle = t4, t5 = restProps;
4772
- let t6;
4773
- $[24] !== animate ? (t6 = animate ? ["hidden", "initial"] : void 0, $[24] = animate, $[25] = t6) : t6 = $[25];
4774
- let t7;
4775
- $[26] !== animate ? (t7 = animate ? ["visible", "scaleIn"] : void 0, $[26] = animate, $[27] = t7) : t7 = $[27];
4776
- let t8;
4777
- $[28] !== animate ? (t8 = animate ? ["hidden", "scaleOut"] : void 0, $[28] = animate, $[29] = t8) : t8 = $[29];
4778
- let t9;
4779
- $[30] !== arrow2 || $[31] !== arrowRef || $[32] !== arrowStyle ? (t9 = arrow2 && /* @__PURE__ */ jsx(Arrow, { ref: arrowRef, style: arrowStyle, width: DEFAULT_TOOLTIP_ARROW_WIDTH, height: DEFAULT_TOOLTIP_ARROW_HEIGHT, radius: DEFAULT_TOOLTIP_ARROW_RADIUS }), $[30] = arrow2, $[31] = arrowRef, $[32] = arrowStyle, $[33] = t9) : t9 = $[33];
4780
- let t10;
4781
- return $[34] !== children || $[35] !== padding || $[36] !== placement || $[37] !== radius || $[38] !== ref || $[39] !== rootStyle2 || $[40] !== scheme || $[41] !== shadow || $[42] !== t5 || $[43] !== t6 || $[44] !== t7 || $[45] !== t8 || $[46] !== t9 ? (t10 = /* @__PURE__ */ jsxs(MotionCard, { "data-ui": "Tooltip__card", ...t5, "data-placement": placement, padding, radius, ref, scheme, shadow, style: rootStyle2, variants: POPOVER_MOTION_PROPS.card, transition: POPOVER_MOTION_PROPS.transition, initial: t6, animate: t7, exit: t8, children: [
4005
+ }), [arrowX, arrowY]);
4006
+ return /* @__PURE__ */ jsxs(MotionCard, { "data-ui": "Tooltip__card", ...restProps, "data-placement": placement, padding, radius, ref, scheme, shadow, style: rootStyle2, variants: POPOVER_MOTION_PROPS.card, transition: POPOVER_MOTION_PROPS.transition, initial: animate ? ["hidden", "initial"] : void 0, animate: animate ? ["visible", "scaleIn"] : void 0, exit: animate ? ["hidden", "scaleOut"] : void 0, children: [
4782
4007
  children,
4783
- t9
4784
- ] }), $[34] = children, $[35] = padding, $[36] = placement, $[37] = radius, $[38] = ref, $[39] = rootStyle2, $[40] = scheme, $[41] = shadow, $[42] = t5, $[43] = t6, $[44] = t7, $[45] = t8, $[46] = t9, $[47] = t10) : t10 = $[47], t10;
4008
+ arrow2 && /* @__PURE__ */ jsx(Arrow, { ref: arrowRef, style: arrowStyle, width: DEFAULT_TOOLTIP_ARROW_WIDTH, height: DEFAULT_TOOLTIP_ARROW_HEIGHT, radius: DEFAULT_TOOLTIP_ARROW_RADIUS })
4009
+ ] });
4785
4010
  });
4786
4011
  TooltipCard.displayName = "ForwardRef(TooltipCard)";
4787
4012
  const TooltipDelayGroupContext = createGlobalScopedContext("@sanity/ui/context/tooltipDelayGroup", null);
4788
4013
  function TooltipDelayGroupProvider(props) {
4789
- const $ = c(9), {
4014
+ const {
4790
4015
  children,
4791
4016
  delay
4792
- } = props, [isGroupActive, setIsGroupActive] = useDelayedState(!1), [openTooltipId, setOpenTooltipId] = useDelayedState(null), openDelay = typeof delay == "number" ? delay : delay?.open || 0, closeDelay = typeof delay == "number" ? delay : delay?.close || 0, t0 = isGroupActive ? 1 : openDelay;
4793
- let t1;
4794
- $[0] !== closeDelay || $[1] !== openTooltipId || $[2] !== setIsGroupActive || $[3] !== setOpenTooltipId || $[4] !== t0 ? (t1 = {
4017
+ } = props, [isGroupActive, setIsGroupActive] = useDelayedState(!1), [openTooltipId, setOpenTooltipId] = useDelayedState(null), openDelay = typeof delay == "number" ? delay : delay?.open || 0, closeDelay = typeof delay == "number" ? delay : delay?.close || 0, value = useMemo(() => ({
4795
4018
  setIsGroupActive,
4796
4019
  openTooltipId,
4797
4020
  setOpenTooltipId,
4798
- openDelay: t0,
4021
+ // When the group is active, we want the next tooltip to open immediately.
4022
+ openDelay: isGroupActive ? 1 : openDelay,
4799
4023
  closeDelay
4800
- }, $[0] = closeDelay, $[1] = openTooltipId, $[2] = setIsGroupActive, $[3] = setOpenTooltipId, $[4] = t0, $[5] = t1) : t1 = $[5];
4801
- const value = t1;
4802
- let t2;
4803
- return $[6] !== children || $[7] !== value ? (t2 = /* @__PURE__ */ jsx(TooltipDelayGroupContext.Provider, { value, children }), $[6] = children, $[7] = value, $[8] = t2) : t2 = $[8], t2;
4024
+ }), [closeDelay, isGroupActive, openDelay, openTooltipId, setIsGroupActive, setOpenTooltipId]);
4025
+ return /* @__PURE__ */ jsx(TooltipDelayGroupContext.Provider, { value, children });
4804
4026
  }
4805
4027
  TooltipDelayGroupProvider.displayName = "TooltipDelayGroupProvider";
4806
4028
  function useTooltipDelayGroup() {
@@ -4810,71 +4032,51 @@ const StyledTooltip = styled(Layer).withConfig({
4810
4032
  displayName: "StyledTooltip",
4811
4033
  componentId: "sc-13f2zvh-0"
4812
4034
  })`pointer-events:none;`, Tooltip = forwardRef(function(props, forwardedRef) {
4813
- const $ = c(137), boundaryElementContext = useBoundaryElement(), {
4035
+ const boundaryElementContext = useBoundaryElement(), {
4814
4036
  layer
4815
- } = useTheme_v2();
4816
- let _boundaryElement, _fallbackPlacementsProp, _zOffset, childProp, content, delay, disabled, portalProp, restProps, scheme, t0, t1, t2, t3, t4, t5;
4817
- $[0] !== props ? ({
4818
- animate: t0,
4819
- arrow: t1,
4037
+ } = useTheme_v2(), {
4038
+ animate: _animate = !1,
4039
+ arrow: arrowProp = !1,
4820
4040
  boundaryElement: _boundaryElement,
4821
4041
  children: childProp,
4822
4042
  content,
4823
4043
  disabled,
4824
4044
  fallbackPlacements: _fallbackPlacementsProp,
4825
- padding: t2,
4826
- placement: t3,
4045
+ padding = 2,
4046
+ placement: placementProp = "bottom",
4827
4047
  portal: portalProp,
4828
- radius: t4,
4048
+ radius = 2,
4829
4049
  scheme,
4830
- shadow: t5,
4050
+ shadow = 2,
4831
4051
  zOffset: _zOffset,
4832
4052
  delay,
4833
4053
  ...restProps
4834
- } = props, $[0] = props, $[1] = _boundaryElement, $[2] = _fallbackPlacementsProp, $[3] = _zOffset, $[4] = childProp, $[5] = content, $[6] = delay, $[7] = disabled, $[8] = portalProp, $[9] = restProps, $[10] = scheme, $[11] = t0, $[12] = t1, $[13] = t2, $[14] = t3, $[15] = t4, $[16] = t5) : (_boundaryElement = $[1], _fallbackPlacementsProp = $[2], _zOffset = $[3], childProp = $[4], content = $[5], delay = $[6], disabled = $[7], portalProp = $[8], restProps = $[9], scheme = $[10], t0 = $[11], t1 = $[12], t2 = $[13], t3 = $[14], t4 = $[15], t5 = $[16]);
4835
- const _animate = t0 === void 0 ? !1 : t0, arrowProp = t1 === void 0 ? !1 : t1, padding = t2 === void 0 ? 2 : t2, placementProp = t3 === void 0 ? "bottom" : t3, radius = t4 === void 0 ? 2 : t4, shadow = t5 === void 0 ? 2 : t5, boundaryElement = _boundaryElement ?? boundaryElementContext?.element, fallbackPlacementsProp = _fallbackPlacementsProp ?? DEFAULT_FALLBACK_PLACEMENTS[props.placement ?? "bottom"], zOffset = _zOffset ?? layer.tooltip.zOffset, animate = usePrefersReducedMotion() ? !1 : _animate;
4836
- let t6;
4837
- $[17] !== fallbackPlacementsProp ? (t6 = _getArrayProp(fallbackPlacementsProp), $[17] = fallbackPlacementsProp, $[18] = t6) : t6 = $[18];
4838
- const fallbackPlacements = t6, ref = useRef(null), [referenceElement, setReferenceElement] = useState(null), arrowRef = useRef(null), [tooltipMaxWidth, setTooltipMaxWidth] = useState(0);
4839
- let t7;
4840
- $[19] === Symbol.for("react.memo_cache_sentinel") ? (t7 = () => ref.current, $[19] = t7) : t7 = $[19], useImperativeHandle(forwardedRef, t7);
4841
- const portal = usePortal(), portalElement = typeof portalProp == "string" ? portal.elements?.[portalProp] || null : portal.element;
4842
- let t8;
4843
- $[20] !== animate || $[21] !== arrowProp || $[22] !== boundaryElement || $[23] !== fallbackPlacements ? (t8 = {
4054
+ } = props, boundaryElement = _boundaryElement ?? boundaryElementContext?.element, fallbackPlacementsProp = _fallbackPlacementsProp ?? DEFAULT_FALLBACK_PLACEMENTS[props.placement ?? "bottom"], zOffset = _zOffset ?? layer.tooltip.zOffset, animate = usePrefersReducedMotion() ? !1 : _animate, fallbackPlacements = _getArrayProp(fallbackPlacementsProp), ref = useRef(null), [referenceElement, setReferenceElement] = useState(null), arrowRef = useRef(null), rootBoundary = "viewport", [tooltipMaxWidth, setTooltipMaxWidth] = useState(0);
4055
+ useImperativeHandle(forwardedRef, () => ref.current);
4056
+ const portal = usePortal(), portalElement = typeof portalProp == "string" ? portal.elements?.[portalProp] || null : portal.element, middleware = useMiddleware({
4844
4057
  animate,
4845
4058
  arrowProp,
4846
4059
  arrowRef,
4847
4060
  boundaryElement,
4848
4061
  fallbackPlacements,
4849
- rootBoundary: "viewport"
4850
- }, $[20] = animate, $[21] = arrowProp, $[22] = boundaryElement, $[23] = fallbackPlacements, $[24] = t8) : t8 = $[24];
4851
- const middleware = useMiddleware(t8);
4852
- let t9;
4853
- $[25] !== referenceElement ? (t9 = {
4854
- reference: referenceElement
4855
- }, $[25] = referenceElement, $[26] = t9) : t9 = $[26];
4856
- let t10;
4857
- $[27] !== middleware || $[28] !== placementProp || $[29] !== t9 ? (t10 = {
4858
- middleware,
4859
- placement: placementProp,
4860
- whileElementsMounted: autoUpdate,
4861
- elements: t9
4862
- }, $[27] = middleware, $[28] = placementProp, $[29] = t9, $[30] = t10) : t10 = $[30];
4863
- const {
4062
+ rootBoundary
4063
+ }), {
4864
4064
  floatingStyles,
4865
4065
  placement,
4866
4066
  middlewareData,
4867
4067
  refs,
4868
4068
  update
4869
- } = useFloating(t10), arrowX = middlewareData.arrow?.x, arrowY = middlewareData.arrow?.y, originX = middlewareData["@sanity/ui/origin"]?.originX, originY = middlewareData["@sanity/ui/origin"]?.originY, tooltipId = useId(), [isOpen, setIsOpen] = useDelayedState(!1), delayGroupContext = useTooltipDelayGroup();
4870
- let t11;
4871
- $[31] !== delayGroupContext ? (t11 = delayGroupContext || {}, $[31] = delayGroupContext, $[32] = t11) : t11 = $[32];
4872
- const {
4069
+ } = useFloating({
4070
+ middleware,
4071
+ placement: placementProp,
4072
+ whileElementsMounted: autoUpdate,
4073
+ elements: {
4074
+ reference: referenceElement
4075
+ }
4076
+ }), arrowX = middlewareData.arrow?.x, arrowY = middlewareData.arrow?.y, originX = middlewareData["@sanity/ui/origin"]?.originX, originY = middlewareData["@sanity/ui/origin"]?.originY, tooltipId = useId(), [isOpen, setIsOpen] = useDelayedState(!1), delayGroupContext = useTooltipDelayGroup(), {
4873
4077
  setIsGroupActive,
4874
4078
  setOpenTooltipId
4875
- } = t11, showTooltip = isOpen || delayGroupContext?.openTooltipId === tooltipId, isInsideGroup = delayGroupContext !== null, openDelayProp = typeof delay == "number" ? delay : delay?.open || 0, closeDelayProp = typeof delay == "number" ? delay : delay?.close || 0, openDelay = isInsideGroup ? delayGroupContext.openDelay : openDelayProp, closeDelay = isInsideGroup ? delayGroupContext.closeDelay : closeDelayProp;
4876
- let t12;
4877
- $[33] !== closeDelay || $[34] !== isInsideGroup || $[35] !== openDelay || $[36] !== setIsGroupActive || $[37] !== setIsOpen || $[38] !== setOpenTooltipId || $[39] !== tooltipId ? (t12 = (open, immediate) => {
4079
+ } = delayGroupContext || {}, showTooltip = isOpen || delayGroupContext?.openTooltipId === tooltipId, isInsideGroup = delayGroupContext !== null, openDelayProp = typeof delay == "number" ? delay : delay?.open || 0, closeDelayProp = typeof delay == "number" ? delay : delay?.close || 0, openDelay = isInsideGroup ? delayGroupContext.openDelay : openDelayProp, closeDelay = isInsideGroup ? delayGroupContext.closeDelay : closeDelayProp, handleIsOpenChange = useCallback((open, immediate) => {
4878
4080
  if (isInsideGroup)
4879
4081
  if (open) {
4880
4082
  const groupedOpenDelay = immediate ? 0 : openDelay;
@@ -4885,196 +4087,108 @@ const StyledTooltip = styled(Layer).withConfig({
4885
4087
  }
4886
4088
  else
4887
4089
  setIsOpen(open, immediate ? 0 : open ? openDelay : closeDelay);
4888
- }, $[33] = closeDelay, $[34] = isInsideGroup, $[35] = openDelay, $[36] = setIsGroupActive, $[37] = setIsOpen, $[38] = setOpenTooltipId, $[39] = tooltipId, $[40] = t12) : t12 = $[40];
4889
- const handleIsOpenChange = t12;
4890
- let t13;
4891
- $[41] !== childProp?.props || $[42] !== handleIsOpenChange ? (t13 = (e) => {
4090
+ }, [isInsideGroup, openDelay, setIsGroupActive, setOpenTooltipId, tooltipId, closeDelay, setIsOpen]), handleBlur = useCallback((e) => {
4892
4091
  handleIsOpenChange(!1), childProp?.props?.onBlur?.(e);
4893
- }, $[41] = childProp?.props, $[42] = handleIsOpenChange, $[43] = t13) : t13 = $[43];
4894
- const handleBlur = t13;
4895
- let t14;
4896
- $[44] !== childProp?.props || $[45] !== handleIsOpenChange ? (t14 = (e_0) => {
4897
- handleIsOpenChange(!1, !0), childProp?.props.onClick?.(e_0);
4898
- }, $[44] = childProp?.props, $[45] = handleIsOpenChange, $[46] = t14) : t14 = $[46];
4899
- const handleClick = t14;
4900
- let t15;
4901
- $[47] !== childProp?.props || $[48] !== handleIsOpenChange ? (t15 = (e_1) => {
4902
- handleIsOpenChange(!1, !0), childProp?.props.onContextMenu?.(e_1);
4903
- }, $[47] = childProp?.props, $[48] = handleIsOpenChange, $[49] = t15) : t15 = $[49];
4904
- const handleContextMenu = t15;
4905
- let t16;
4906
- $[50] !== childProp?.props || $[51] !== handleIsOpenChange ? (t16 = (e_2) => {
4907
- handleIsOpenChange(!0), childProp?.props?.onFocus?.(e_2);
4908
- }, $[50] = childProp?.props, $[51] = handleIsOpenChange, $[52] = t16) : t16 = $[52];
4909
- const handleFocus = t16;
4910
- let t17;
4911
- $[53] !== childProp?.props || $[54] !== handleIsOpenChange ? (t17 = (e_3) => {
4912
- handleIsOpenChange(!0), childProp?.props?.onMouseEnter?.(e_3);
4913
- }, $[53] = childProp?.props, $[54] = handleIsOpenChange, $[55] = t17) : t17 = $[55];
4914
- const handleMouseEnter = t17;
4915
- let t18;
4916
- $[56] !== childProp?.props || $[57] !== handleIsOpenChange ? (t18 = (e_4) => {
4917
- handleIsOpenChange(!1), childProp?.props?.onMouseLeave?.(e_4);
4918
- }, $[56] = childProp?.props, $[57] = handleIsOpenChange, $[58] = t18) : t18 = $[58];
4919
- const handleMouseLeave = t18;
4920
- let t19;
4921
- $[59] !== handleIsOpenChange || $[60] !== isInsideGroup || $[61] !== referenceElement || $[62] !== showTooltip ? (t19 = {
4092
+ }, [childProp?.props, handleIsOpenChange]), handleClick = useCallback((e) => {
4093
+ handleIsOpenChange(!1, !0), childProp?.props.onClick?.(e);
4094
+ }, [childProp?.props, handleIsOpenChange]), handleContextMenu = useCallback((e) => {
4095
+ handleIsOpenChange(!1, !0), childProp?.props.onContextMenu?.(e);
4096
+ }, [childProp?.props, handleIsOpenChange]), handleFocus = useCallback((e) => {
4097
+ handleIsOpenChange(!0), childProp?.props?.onFocus?.(e);
4098
+ }, [childProp?.props, handleIsOpenChange]), handleMouseEnter = useCallback((e) => {
4099
+ handleIsOpenChange(!0), childProp?.props?.onMouseEnter?.(e);
4100
+ }, [childProp?.props, handleIsOpenChange]), handleMouseLeave = useCallback((e) => {
4101
+ handleIsOpenChange(!1), childProp?.props?.onMouseLeave?.(e);
4102
+ }, [childProp?.props, handleIsOpenChange]);
4103
+ useCloseOnMouseLeave({
4922
4104
  handleIsOpenChange,
4923
4105
  referenceElement,
4924
4106
  showTooltip,
4925
4107
  isInsideGroup
4926
- }, $[59] = handleIsOpenChange, $[60] = isInsideGroup, $[61] = referenceElement, $[62] = showTooltip, $[63] = t19) : t19 = $[63], useCloseOnMouseLeave(t19);
4927
- let t20, t21;
4928
- $[64] !== disabled || $[65] !== handleIsOpenChange || $[66] !== showTooltip ? (t20 = () => {
4108
+ }), useEffect(() => {
4929
4109
  disabled && showTooltip && handleIsOpenChange(!1);
4930
- }, t21 = [disabled, handleIsOpenChange, showTooltip], $[64] = disabled, $[65] = handleIsOpenChange, $[66] = showTooltip, $[67] = t20, $[68] = t21) : (t20 = $[67], t21 = $[68]), useEffect(t20, t21);
4931
- let t22, t23;
4932
- $[69] !== content || $[70] !== handleIsOpenChange || $[71] !== showTooltip ? (t22 = () => {
4110
+ }, [disabled, handleIsOpenChange, showTooltip]), useEffect(() => {
4933
4111
  !content && showTooltip && handleIsOpenChange(!1);
4934
- }, t23 = [content, handleIsOpenChange, showTooltip], $[69] = content, $[70] = handleIsOpenChange, $[71] = showTooltip, $[72] = t22, $[73] = t23) : (t22 = $[72], t23 = $[73]), useEffect(t22, t23);
4935
- let t24, t25;
4936
- $[74] !== handleIsOpenChange || $[75] !== showTooltip ? (t24 = () => {
4937
- if (!showTooltip)
4938
- return;
4939
- const handleWindowKeyDown = function(event) {
4112
+ }, [content, handleIsOpenChange, showTooltip]), useEffect(() => {
4113
+ if (!showTooltip) return;
4114
+ function handleWindowKeyDown(event) {
4940
4115
  event.key === "Escape" && handleIsOpenChange(!1, !0);
4941
- };
4116
+ }
4942
4117
  return window.addEventListener("keydown", handleWindowKeyDown), () => {
4943
4118
  window.removeEventListener("keydown", handleWindowKeyDown);
4944
4119
  };
4945
- }, t25 = [handleIsOpenChange, showTooltip], $[74] = handleIsOpenChange, $[75] = showTooltip, $[76] = t24, $[77] = t25) : (t24 = $[76], t25 = $[77]), useEffect(t24, t25);
4946
- let t26;
4947
- $[78] !== boundaryElement || $[79] !== portalElement?.offsetWidth ? (t26 = () => {
4120
+ }, [handleIsOpenChange, showTooltip]), useLayoutEffect(() => {
4948
4121
  const availableWidths = [...boundaryElement ? [boundaryElement.offsetWidth] : [], portalElement?.offsetWidth || document.body.offsetWidth];
4949
4122
  setTooltipMaxWidth(Math.min(...availableWidths) - DEFAULT_TOOLTIP_PADDING * 2);
4950
- }, $[78] = boundaryElement, $[79] = portalElement?.offsetWidth, $[80] = t26) : t26 = $[80];
4951
- let t27;
4952
- $[81] !== boundaryElement || $[82] !== portalElement ? (t27 = [boundaryElement, portalElement], $[81] = boundaryElement, $[82] = portalElement, $[83] = t27) : t27 = $[83], useLayoutEffect(t26, t27);
4953
- let t28;
4954
- $[84] !== update ? (t28 = (arrowEl) => {
4123
+ }, [boundaryElement, portalElement]);
4124
+ const setArrow = useCallback((arrowEl) => {
4955
4125
  arrowRef.current = arrowEl, update();
4956
- }, $[84] = update, $[85] = t28) : t28 = $[85];
4957
- const setArrow = t28;
4958
- let t29;
4959
- $[86] !== refs ? (t29 = (node) => {
4126
+ }, [update]), setFloating = useCallback((node) => {
4960
4127
  ref.current = node, refs.setFloating(node);
4961
- }, $[86] = refs, $[87] = t29) : t29 = $[87];
4962
- const setFloating = t29;
4963
- let t30;
4964
- bb0: {
4965
- if (!childProp) {
4966
- t30 = null;
4967
- break bb0;
4968
- }
4969
- let t312;
4970
- $[88] !== childProp || $[89] !== handleBlur || $[90] !== handleClick || $[91] !== handleContextMenu || $[92] !== handleFocus || $[93] !== handleMouseEnter || $[94] !== handleMouseLeave ? (t312 = cloneElement(childProp, {
4971
- onBlur: handleBlur,
4972
- onFocus: handleFocus,
4973
- onMouseEnter: handleMouseEnter,
4974
- onMouseLeave: handleMouseLeave,
4975
- onClick: handleClick,
4976
- onContextMenu: handleContextMenu,
4977
- ref: setReferenceElement
4978
- }), $[88] = childProp, $[89] = handleBlur, $[90] = handleClick, $[91] = handleContextMenu, $[92] = handleFocus, $[93] = handleMouseEnter, $[94] = handleMouseLeave, $[95] = t312) : t312 = $[95], t30 = t312;
4979
- }
4980
- const child = t30;
4981
- let t31;
4982
- $[96] !== childProp ? (t31 = childProp ? getElementRef(childProp) : null, $[96] = childProp, $[97] = t31) : t31 = $[97];
4983
- let t32, t33;
4984
- if ($[98] !== referenceElement ? (t32 = () => referenceElement, t33 = [referenceElement], $[98] = referenceElement, $[99] = t32, $[100] = t33) : (t32 = $[99], t33 = $[100]), useImperativeHandle(t31, t32, t33), !child) {
4985
- let t342;
4986
- return $[101] === Symbol.for("react.memo_cache_sentinel") ? (t342 = /* @__PURE__ */ jsx(Fragment, {}), $[101] = t342) : t342 = $[101], t342;
4987
- }
4988
- if (disabled)
4989
- return child;
4990
- const t34 = tooltipMaxWidth > 0 ? `${tooltipMaxWidth}px` : void 0;
4991
- let t35;
4992
- $[102] !== floatingStyles || $[103] !== t34 ? (t35 = {
4128
+ }, [refs]), child = useMemo(() => childProp ? cloneElement(childProp, {
4129
+ onBlur: handleBlur,
4130
+ onFocus: handleFocus,
4131
+ onMouseEnter: handleMouseEnter,
4132
+ onMouseLeave: handleMouseLeave,
4133
+ onClick: handleClick,
4134
+ onContextMenu: handleContextMenu,
4135
+ ref: setReferenceElement
4136
+ }) : null, [childProp, handleBlur, handleClick, handleContextMenu, handleFocus, handleMouseEnter, handleMouseLeave]);
4137
+ if (useImperativeHandle(childProp ? getElementRef(childProp) : null, () => referenceElement, [referenceElement]), !child) return /* @__PURE__ */ jsx(Fragment, {});
4138
+ if (disabled) return child;
4139
+ const tooltip = /* @__PURE__ */ jsx(StyledTooltip, { "data-ui": "Tooltip", ...restProps, ref: setFloating, style: {
4993
4140
  ...floatingStyles,
4994
- maxWidth: t34
4995
- }, $[102] = floatingStyles, $[103] = t34, $[104] = t35) : t35 = $[104];
4996
- let t36;
4997
- $[105] !== animate || $[106] !== arrowProp || $[107] !== arrowX || $[108] !== arrowY || $[109] !== content || $[110] !== originX || $[111] !== originY || $[112] !== padding || $[113] !== placement || $[114] !== radius || $[115] !== restProps || $[116] !== scheme || $[117] !== setArrow || $[118] !== setFloating || $[119] !== shadow ? (t36 = /* @__PURE__ */ jsx(TooltipCard, { ...restProps, animate, arrow: arrowProp, arrowRef: setArrow, arrowX, arrowY, originX, originY, padding, placement, radius, ref: setFloating, scheme, shadow, children: content }), $[105] = animate, $[106] = arrowProp, $[107] = arrowX, $[108] = arrowY, $[109] = content, $[110] = originX, $[111] = originY, $[112] = padding, $[113] = placement, $[114] = radius, $[115] = restProps, $[116] = scheme, $[117] = setArrow, $[118] = setFloating, $[119] = shadow, $[120] = t36) : t36 = $[120];
4998
- let t37;
4999
- $[121] !== restProps || $[122] !== setFloating || $[123] !== t35 || $[124] !== t36 || $[125] !== zOffset ? (t37 = /* @__PURE__ */ jsx(StyledTooltip, { "data-ui": "Tooltip", ...restProps, ref: setFloating, style: t35, zOffset, children: t36 }), $[121] = restProps, $[122] = setFloating, $[123] = t35, $[124] = t36, $[125] = zOffset, $[126] = t37) : t37 = $[126];
5000
- const tooltip = t37;
5001
- let t38;
5002
- $[127] !== portalProp || $[128] !== showTooltip || $[129] !== tooltip ? (t38 = showTooltip && (portalProp ? /* @__PURE__ */ jsx(Portal, { __unstable_name: typeof portalProp == "string" ? portalProp : void 0, children: tooltip }) : tooltip), $[127] = portalProp, $[128] = showTooltip, $[129] = tooltip, $[130] = t38) : t38 = $[130];
5003
- const children = t38;
5004
- let t39;
5005
- $[131] !== animate || $[132] !== children ? (t39 = animate ? /* @__PURE__ */ jsx(AnimatePresence, { children }) : children, $[131] = animate, $[132] = children, $[133] = t39) : t39 = $[133];
5006
- let t40;
5007
- return $[134] !== child || $[135] !== t39 ? (t40 = /* @__PURE__ */ jsxs(Fragment, { children: [
5008
- t39,
4141
+ maxWidth: tooltipMaxWidth > 0 ? `${tooltipMaxWidth}px` : void 0
4142
+ }, zOffset, children: /* @__PURE__ */ jsx(TooltipCard, { ...restProps, animate, arrow: arrowProp, arrowRef: setArrow, arrowX, arrowY, originX, originY, padding, placement, radius, ref: setFloating, scheme, shadow, children: content }) }), children = showTooltip && (portalProp ? /* @__PURE__ */ jsx(Portal, { __unstable_name: typeof portalProp == "string" ? portalProp : void 0, children: tooltip }) : tooltip);
4143
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
4144
+ animate ? /* @__PURE__ */ jsx(AnimatePresence, { children }) : children,
5009
4145
  child
5010
- ] }), $[134] = child, $[135] = t39, $[136] = t40) : t40 = $[136], t40;
4146
+ ] });
5011
4147
  });
5012
4148
  Tooltip.displayName = "ForwardRef(Tooltip)";
5013
- function useMiddleware(t0) {
5014
- const $ = c(17), {
5015
- animate,
5016
- arrowProp,
5017
- arrowRef,
5018
- boundaryElement,
5019
- fallbackPlacements,
5020
- rootBoundary
5021
- } = t0;
5022
- let ret;
5023
- if ($[0] !== animate || $[1] !== arrowProp || $[2] !== arrowRef || $[3] !== boundaryElement || $[4] !== fallbackPlacements || $[5] !== rootBoundary) {
5024
- ret = [];
5025
- const t1 = boundaryElement || void 0;
5026
- let t2;
5027
- $[7] !== fallbackPlacements || $[8] !== rootBoundary || $[9] !== t1 ? (t2 = flip({
5028
- boundary: t1,
4149
+ function useMiddleware({
4150
+ animate,
4151
+ arrowProp,
4152
+ arrowRef,
4153
+ boundaryElement,
4154
+ fallbackPlacements,
4155
+ rootBoundary
4156
+ }) {
4157
+ return useMemo(() => {
4158
+ const ret = [];
4159
+ return ret.push(flip({
4160
+ boundary: boundaryElement || void 0,
5029
4161
  fallbackPlacements,
5030
4162
  padding: DEFAULT_TOOLTIP_PADDING,
5031
4163
  rootBoundary
5032
- }), $[7] = fallbackPlacements, $[8] = rootBoundary, $[9] = t1, $[10] = t2) : t2 = $[10], ret.push(t2);
5033
- let t3;
5034
- $[11] === Symbol.for("react.memo_cache_sentinel") ? (t3 = offset({
4164
+ })), ret.push(offset({
5035
4165
  mainAxis: DEFAULT_TOOLTIP_DISTANCE
5036
- }), $[11] = t3) : t3 = $[11], ret.push(t3);
5037
- const t4 = boundaryElement || void 0;
5038
- let t5;
5039
- if ($[12] !== rootBoundary || $[13] !== t4 ? (t5 = shift({
5040
- boundary: t4,
4166
+ })), ret.push(shift({
4167
+ boundary: boundaryElement || void 0,
5041
4168
  rootBoundary,
5042
4169
  padding: DEFAULT_TOOLTIP_PADDING
5043
- }), $[12] = rootBoundary, $[13] = t4, $[14] = t5) : t5 = $[14], ret.push(t5), arrowProp) {
5044
- let t6;
5045
- $[15] !== arrowRef ? (t6 = arrow({
5046
- element: arrowRef,
5047
- padding: DEFAULT_TOOLTIP_PADDING
5048
- }), $[15] = arrowRef, $[16] = t6) : t6 = $[16], ret.push(t6);
5049
- }
5050
- animate && ret.push(origin), $[0] = animate, $[1] = arrowProp, $[2] = arrowRef, $[3] = boundaryElement, $[4] = fallbackPlacements, $[5] = rootBoundary, $[6] = ret;
5051
- } else
5052
- ret = $[6];
5053
- return ret;
5054
- }
5055
- function useCloseOnMouseLeave(t0) {
5056
- const $ = c(10), {
5057
- handleIsOpenChange,
5058
- referenceElement,
5059
- showTooltip,
5060
- isInsideGroup
5061
- } = t0;
5062
- let t1;
5063
- $[0] !== handleIsOpenChange || $[1] !== referenceElement ? (t1 = (target, teardown) => {
4170
+ })), arrowProp && ret.push(arrow({
4171
+ element: arrowRef,
4172
+ padding: DEFAULT_TOOLTIP_PADDING
4173
+ })), animate && ret.push(origin), ret;
4174
+ }, [animate, arrowProp, arrowRef, boundaryElement, fallbackPlacements, rootBoundary]);
4175
+ }
4176
+ function useCloseOnMouseLeave({
4177
+ handleIsOpenChange,
4178
+ referenceElement,
4179
+ showTooltip,
4180
+ isInsideGroup
4181
+ }) {
4182
+ const onMouseMove = useEffectEvent((target, teardown) => {
5064
4183
  referenceElement && (referenceElement === target || target instanceof Node && referenceElement.contains(target) || (handleIsOpenChange(!1), teardown()));
5065
- }, $[0] = handleIsOpenChange, $[1] = referenceElement, $[2] = t1) : t1 = $[2];
5066
- const onMouseMove = useEffectEvent(t1);
5067
- let t2;
5068
- $[3] !== isInsideGroup || $[4] !== onMouseMove || $[5] !== showTooltip ? (t2 = () => {
5069
- if (!showTooltip || isInsideGroup)
5070
- return;
4184
+ });
4185
+ useEffect(() => {
4186
+ if (!showTooltip || isInsideGroup) return;
5071
4187
  const handleMouseMove = (event) => {
5072
4188
  onMouseMove(event.target, () => window.removeEventListener("mousemove", handleMouseMove));
5073
4189
  };
5074
4190
  return window.addEventListener("mousemove", handleMouseMove), () => window.removeEventListener("mousemove", handleMouseMove);
5075
- }, $[3] = isInsideGroup, $[4] = onMouseMove, $[5] = showTooltip, $[6] = t2) : t2 = $[6];
5076
- let t3;
5077
- $[7] !== isInsideGroup || $[8] !== showTooltip ? (t3 = [isInsideGroup, showTooltip], $[7] = isInsideGroup, $[8] = showTooltip, $[9] = t3) : t3 = $[9], useEffect(t2, t3);
4191
+ }, [isInsideGroup, showTooltip]);
5078
4192
  }
5079
4193
  const StyledHotkeys = styled.kbd.withConfig({
5080
4194
  displayName: "StyledHotkeys",
@@ -5083,34 +4197,15 @@ const StyledHotkeys = styled.kbd.withConfig({
5083
4197
  displayName: "Key",
5084
4198
  componentId: "sc-b37mge-1"
5085
4199
  })`&:not([hidden]){display:block;}`, Hotkeys = forwardRef(function(props, ref) {
5086
- const $ = c(26);
5087
- let fontSize2, keys, padding, radius, restProps, t0;
5088
- $[0] !== props ? ({
4200
+ const {
5089
4201
  fontSize: fontSize2,
5090
4202
  keys,
5091
4203
  padding,
5092
4204
  radius,
5093
- space: t0,
4205
+ space: spaceProp = 0.5,
5094
4206
  ...restProps
5095
- } = props, $[0] = props, $[1] = fontSize2, $[2] = keys, $[3] = padding, $[4] = radius, $[5] = restProps, $[6] = t0) : (fontSize2 = $[1], keys = $[2], padding = $[3], radius = $[4], restProps = $[5], t0 = $[6]);
5096
- const spaceProp = t0 === void 0 ? 0.5 : t0;
5097
- let t1;
5098
- $[7] !== spaceProp ? (t1 = _getArrayProp(spaceProp), $[7] = spaceProp, $[8] = t1) : t1 = $[8];
5099
- const space = t1;
5100
- if (!keys || keys.length === 0) {
5101
- let t22;
5102
- return $[9] === Symbol.for("react.memo_cache_sentinel") ? (t22 = /* @__PURE__ */ jsx(Fragment, {}), $[9] = t22) : t22 = $[9], t22;
5103
- }
5104
- let t2;
5105
- if ($[10] !== fontSize2 || $[11] !== keys || $[12] !== padding || $[13] !== radius) {
5106
- let t32;
5107
- $[15] !== fontSize2 || $[16] !== padding || $[17] !== radius ? (t32 = (key2, i) => /* @__PURE__ */ jsx(Key, { fontSize: fontSize2, padding, radius, children: key2 }, i), $[15] = fontSize2, $[16] = padding, $[17] = radius, $[18] = t32) : t32 = $[18], t2 = keys.map(t32), $[10] = fontSize2, $[11] = keys, $[12] = padding, $[13] = radius, $[14] = t2;
5108
- } else
5109
- t2 = $[14];
5110
- let t3;
5111
- $[19] !== space || $[20] !== t2 ? (t3 = /* @__PURE__ */ jsx(Inline, { as: "span", space, children: t2 }), $[19] = space, $[20] = t2, $[21] = t3) : t3 = $[21];
5112
- let t4;
5113
- return $[22] !== ref || $[23] !== restProps || $[24] !== t3 ? (t4 = /* @__PURE__ */ jsx(StyledHotkeys, { "data-ui": "Hotkeys", ...restProps, ref, children: t3 }), $[22] = ref, $[23] = restProps, $[24] = t3, $[25] = t4) : t4 = $[25], t4;
4207
+ } = props, space = _getArrayProp(spaceProp);
4208
+ return !keys || keys.length === 0 ? /* @__PURE__ */ jsx(Fragment, {}) : /* @__PURE__ */ jsx(StyledHotkeys, { "data-ui": "Hotkeys", ...restProps, ref, children: /* @__PURE__ */ jsx(Inline, { as: "span", space, children: keys.map((key2, i) => /* @__PURE__ */ jsx(Key, { fontSize: fontSize2, padding, radius, children: key2 }, i)) }) });
5114
4209
  });
5115
4210
  Hotkeys.displayName = "ForwardRef(Hotkeys)";
5116
4211
  const MenuContext = createGlobalScopedContext("@sanity/ui/context/menu", null);
@@ -5151,24 +4246,16 @@ function _sortElements(rootElement, elements) {
5151
4246
  elements.sort(_sort);
5152
4247
  }
5153
4248
  function useMenuController(props) {
5154
- const $ = c(21), {
4249
+ const {
5155
4250
  onKeyDown,
5156
4251
  originElement,
5157
4252
  shouldFocus,
5158
4253
  rootElementRef
5159
- } = props;
5160
- let t0;
5161
- $[0] === Symbol.for("react.memo_cache_sentinel") ? (t0 = [], $[0] = t0) : t0 = $[0];
5162
- const elementsRef = useRef(t0), [activeIndex, _setActiveIndex] = useState(-1), activeIndexRef = useRef(activeIndex), [activeElement, setActiveElement] = useState(null);
5163
- let t1;
5164
- $[1] === Symbol.for("react.memo_cache_sentinel") ? (t1 = (nextActiveIndex) => {
4254
+ } = props, elementsRef = useRef([]), [activeIndex, _setActiveIndex] = useState(-1), activeIndexRef = useRef(activeIndex), [activeElement, setActiveElement] = useState(null), setActiveIndex = useCallback((nextActiveIndex) => {
5165
4255
  _setActiveIndex(nextActiveIndex), activeIndexRef.current = nextActiveIndex, setActiveElement(elementsRef.current[nextActiveIndex] || null);
5166
- }, $[1] = t1) : t1 = $[1];
5167
- const setActiveIndex = t1;
5168
- let t2;
5169
- $[2] !== rootElementRef ? (t2 = (element, selected) => {
5170
- if (!element)
5171
- return _temp$1;
4256
+ }, []), mount = useCallback((element, selected) => {
4257
+ if (!element) return () => {
4258
+ };
5172
4259
  if (elementsRef.current.indexOf(element) === -1 && (elementsRef.current.push(element), _sortElements(rootElementRef.current, elementsRef.current)), selected) {
5173
4260
  const selectedIndex = elementsRef.current.indexOf(element);
5174
4261
  setActiveIndex(selectedIndex);
@@ -5177,10 +4264,7 @@ function useMenuController(props) {
5177
4264
  const idx = elementsRef.current.indexOf(element);
5178
4265
  idx > -1 && elementsRef.current.splice(idx, 1);
5179
4266
  };
5180
- }, $[2] = rootElementRef, $[3] = t2) : t2 = $[3];
5181
- const mount = t2;
5182
- let t3;
5183
- $[4] !== onKeyDown || $[5] !== originElement ? (t3 = (event) => {
4267
+ }, [rootElementRef, setActiveIndex]), handleKeyDown = useCallback((event) => {
5184
4268
  if (event.key === "Tab") {
5185
4269
  originElement && originElement.focus();
5186
4270
  return;
@@ -5188,77 +4272,64 @@ function useMenuController(props) {
5188
4272
  if (event.key === "Home") {
5189
4273
  event.preventDefault(), event.stopPropagation();
5190
4274
  const el = _getFocusableElements(elementsRef.current)[0];
5191
- if (!el)
5192
- return;
4275
+ if (!el) return;
5193
4276
  const currentIndex = elementsRef.current.indexOf(el);
5194
4277
  setActiveIndex(currentIndex);
5195
4278
  return;
5196
4279
  }
5197
4280
  if (event.key === "End") {
5198
4281
  event.preventDefault(), event.stopPropagation();
5199
- const focusableElements_0 = _getFocusableElements(elementsRef.current), el_0 = focusableElements_0[focusableElements_0.length - 1];
5200
- if (!el_0)
5201
- return;
5202
- const currentIndex_0 = elementsRef.current.indexOf(el_0);
5203
- setActiveIndex(currentIndex_0);
4282
+ const focusableElements = _getFocusableElements(elementsRef.current), el = focusableElements[focusableElements.length - 1];
4283
+ if (!el) return;
4284
+ const currentIndex = elementsRef.current.indexOf(el);
4285
+ setActiveIndex(currentIndex);
5204
4286
  return;
5205
4287
  }
5206
4288
  if (event.key === "ArrowUp") {
5207
4289
  event.preventDefault(), event.stopPropagation();
5208
- const focusableElements_1 = _getFocusableElements(elementsRef.current), focusableLen = focusableElements_1.length;
5209
- if (focusableLen === 0)
5210
- return;
4290
+ const focusableElements = _getFocusableElements(elementsRef.current), focusableLen = focusableElements.length;
4291
+ if (focusableLen === 0) return;
5211
4292
  const focusedElement = elementsRef.current[activeIndexRef.current];
5212
- let focusedIndex = focusableElements_1.indexOf(focusedElement);
4293
+ let focusedIndex = focusableElements.indexOf(focusedElement);
5213
4294
  focusedIndex = (focusedIndex - 1 + focusableLen) % focusableLen;
5214
- const el_1 = focusableElements_1[focusedIndex], currentIndex_1 = elementsRef.current.indexOf(el_1);
5215
- setActiveIndex(currentIndex_1);
4295
+ const el = focusableElements[focusedIndex], currentIndex = elementsRef.current.indexOf(el);
4296
+ setActiveIndex(currentIndex);
5216
4297
  return;
5217
4298
  }
5218
4299
  if (event.key === "ArrowDown") {
5219
4300
  event.preventDefault(), event.stopPropagation();
5220
- const focusableElements_2 = _getFocusableElements(elementsRef.current), focusableLen_0 = focusableElements_2.length;
5221
- if (focusableLen_0 === 0)
5222
- return;
5223
- const focusedElement_0 = elementsRef.current[activeIndexRef.current];
5224
- let focusedIndex_0 = focusableElements_2.indexOf(focusedElement_0);
5225
- focusedIndex_0 = (focusedIndex_0 + 1) % focusableLen_0;
5226
- const el_2 = focusableElements_2[focusedIndex_0], currentIndex_2 = elementsRef.current.indexOf(el_2);
5227
- setActiveIndex(currentIndex_2);
4301
+ const focusableElements = _getFocusableElements(elementsRef.current), focusableLen = focusableElements.length;
4302
+ if (focusableLen === 0) return;
4303
+ const focusedElement = elementsRef.current[activeIndexRef.current];
4304
+ let focusedIndex = focusableElements.indexOf(focusedElement);
4305
+ focusedIndex = (focusedIndex + 1) % focusableLen;
4306
+ const el = focusableElements[focusedIndex], currentIndex = elementsRef.current.indexOf(el);
4307
+ setActiveIndex(currentIndex);
5228
4308
  return;
5229
4309
  }
5230
4310
  onKeyDown && onKeyDown(event);
5231
- }, $[4] = onKeyDown, $[5] = originElement, $[6] = t3) : t3 = $[6];
5232
- const handleKeyDown = t3;
5233
- let t4;
5234
- $[7] === Symbol.for("react.memo_cache_sentinel") ? (t4 = (event_0) => {
5235
- const element_0 = event_0.currentTarget, currentIndex_3 = elementsRef.current.indexOf(element_0);
5236
- setActiveIndex(currentIndex_3);
5237
- }, $[7] = t4) : t4 = $[7];
5238
- const handleItemMouseEnter = t4;
5239
- let t5;
5240
- $[8] !== rootElementRef ? (t5 = () => {
4311
+ }, [onKeyDown, originElement, setActiveIndex]), handleItemMouseEnter = useCallback((event) => {
4312
+ const element = event.currentTarget, currentIndex = elementsRef.current.indexOf(element);
4313
+ setActiveIndex(currentIndex);
4314
+ }, [setActiveIndex]), handleItemMouseLeave = useCallback(() => {
5241
4315
  setActiveIndex(-2), rootElementRef.current?.focus();
5242
- }, $[8] = rootElementRef, $[9] = t5) : t5 = $[9];
5243
- const handleItemMouseLeave = t5;
5244
- let t6, t7;
5245
- $[10] !== activeIndex || $[11] !== rootElementRef || $[12] !== shouldFocus ? (t6 = () => {
5246
- if (!rootElementRef.current)
5247
- return;
4316
+ }, [rootElementRef, setActiveIndex]);
4317
+ return useEffect(() => {
4318
+ if (!rootElementRef.current) return;
5248
4319
  const rafId = requestAnimationFrame(() => {
5249
4320
  if (activeIndex === -1) {
5250
4321
  if (shouldFocus === "first") {
5251
- const el_3 = _getFocusableElements(elementsRef.current)[0];
5252
- if (el_3) {
5253
- const currentIndex_4 = elementsRef.current.indexOf(el_3);
5254
- setActiveIndex(currentIndex_4);
4322
+ const el = _getFocusableElements(elementsRef.current)[0];
4323
+ if (el) {
4324
+ const currentIndex = elementsRef.current.indexOf(el);
4325
+ setActiveIndex(currentIndex);
5255
4326
  }
5256
4327
  }
5257
4328
  if (shouldFocus === "last") {
5258
- const focusableElements_4 = _getFocusableElements(elementsRef.current), el_4 = focusableElements_4[focusableElements_4.length - 1];
5259
- if (el_4) {
5260
- const currentIndex_5 = elementsRef.current.indexOf(el_4);
5261
- setActiveIndex(currentIndex_5);
4329
+ const focusableElements = _getFocusableElements(elementsRef.current), el = focusableElements[focusableElements.length - 1];
4330
+ if (el) {
4331
+ const currentIndex = elementsRef.current.indexOf(el);
4332
+ setActiveIndex(currentIndex);
5262
4333
  }
5263
4334
  }
5264
4335
  return;
@@ -5266,83 +4337,61 @@ function useMenuController(props) {
5266
4337
  (elementsRef.current[activeIndex] || null)?.focus();
5267
4338
  });
5268
4339
  return () => cancelAnimationFrame(rafId);
5269
- }, t7 = [activeIndex, rootElementRef, setActiveIndex, shouldFocus], $[10] = activeIndex, $[11] = rootElementRef, $[12] = shouldFocus, $[13] = t6, $[14] = t7) : (t6 = $[13], t7 = $[14]), useEffect(t6, t7);
5270
- let t8;
5271
- return $[15] !== activeElement || $[16] !== activeIndex || $[17] !== handleItemMouseLeave || $[18] !== handleKeyDown || $[19] !== mount ? (t8 = {
4340
+ }, [activeIndex, rootElementRef, setActiveIndex, shouldFocus]), {
5272
4341
  activeElement,
5273
4342
  activeIndex,
5274
4343
  handleItemMouseEnter,
5275
4344
  handleItemMouseLeave,
5276
4345
  handleKeyDown,
5277
4346
  mount
5278
- }, $[15] = activeElement, $[16] = activeIndex, $[17] = handleItemMouseLeave, $[18] = handleKeyDown, $[19] = mount, $[20] = t8) : t8 = $[20], t8;
5279
- }
5280
- function _temp$1() {
4347
+ };
5281
4348
  }
5282
4349
  const StyledMenu = styled(Box).withConfig({
5283
4350
  displayName: "StyledMenu",
5284
4351
  componentId: "sc-xt0tnv-0"
5285
4352
  })`outline:none;overflow:auto;`, Menu = forwardRef(function(props, forwardedRef) {
5286
- const $ = c(49);
5287
- let _shouldFocus, children, onClickOutside, onEscape, onItemClick, onItemSelect, onKeyDown, originElement, registerElement, restProps, t0, t1;
5288
- if ($[0] !== props) {
5289
- const {
5290
- children: t22,
5291
- focusFirst,
5292
- focusLast,
5293
- onClickOutside: t32,
5294
- onEscape: t42,
5295
- onItemClick: t52,
5296
- onItemSelect: t62,
5297
- onKeyDown: t72,
5298
- originElement: t82,
5299
- padding: t92,
5300
- registerElement: t102,
5301
- shouldFocus: t112,
5302
- space: t122,
5303
- ...t13
5304
- } = props;
5305
- children = t22, onClickOutside = t32, onEscape = t42, onItemClick = t52, onItemSelect = t62, onKeyDown = t72, originElement = t82, t0 = t92, registerElement = t102, _shouldFocus = t112, t1 = t122, restProps = t13, $[0] = props, $[1] = _shouldFocus, $[2] = children, $[3] = onClickOutside, $[4] = onEscape, $[5] = onItemClick, $[6] = onItemSelect, $[7] = onKeyDown, $[8] = originElement, $[9] = registerElement, $[10] = restProps, $[11] = t0, $[12] = t1;
5306
- } else
5307
- _shouldFocus = $[1], children = $[2], onClickOutside = $[3], onEscape = $[4], onItemClick = $[5], onItemSelect = $[6], onKeyDown = $[7], originElement = $[8], registerElement = $[9], restProps = $[10], t0 = $[11], t1 = $[12];
5308
- const padding = t0 === void 0 ? 1 : t0, space = t1 === void 0 ? 1 : t1, shouldFocus = _shouldFocus ?? (props.focusFirst && "first" || props.focusLast && "last" || null), ref = useRef(null);
5309
- let t2;
5310
- $[13] === Symbol.for("react.memo_cache_sentinel") ? (t2 = () => ref.current, $[13] = t2) : t2 = $[13], useImperativeHandle(forwardedRef, t2);
5311
4353
  const {
5312
- isTopLayer
5313
- } = useLayer();
5314
- let t3;
5315
- $[14] !== onKeyDown || $[15] !== originElement || $[16] !== shouldFocus ? (t3 = {
4354
+ children,
4355
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
4356
+ focusFirst,
4357
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
4358
+ focusLast,
4359
+ onClickOutside,
4360
+ onEscape,
4361
+ onItemClick,
4362
+ onItemSelect,
5316
4363
  onKeyDown,
5317
4364
  originElement,
5318
- shouldFocus,
5319
- rootElementRef: ref
5320
- }, $[14] = onKeyDown, $[15] = originElement, $[16] = shouldFocus, $[17] = t3) : t3 = $[17];
4365
+ padding = 1,
4366
+ registerElement,
4367
+ shouldFocus: _shouldFocus,
4368
+ space = 1,
4369
+ ...restProps
4370
+ } = props, shouldFocus = _shouldFocus ?? (props.focusFirst && "first" || props.focusLast && "last" || null), ref = useRef(null);
4371
+ useImperativeHandle(forwardedRef, () => ref.current);
5321
4372
  const {
4373
+ isTopLayer
4374
+ } = useLayer(), {
5322
4375
  activeElement,
5323
4376
  activeIndex,
5324
4377
  handleItemMouseEnter,
5325
4378
  handleItemMouseLeave,
5326
4379
  handleKeyDown,
5327
4380
  mount
5328
- } = useMenuController(t3), unregisterElementRef = useRef(null);
5329
- let t4;
5330
- $[18] !== registerElement ? (t4 = (el) => {
4381
+ } = useMenuController({
4382
+ onKeyDown,
4383
+ originElement,
4384
+ shouldFocus,
4385
+ rootElementRef: ref
4386
+ }), unregisterElementRef = useRef(null), handleRefChange = useCallback((el) => {
5331
4387
  unregisterElementRef.current && (unregisterElementRef.current(), unregisterElementRef.current = null), ref.current = el, ref.current && registerElement && (unregisterElementRef.current = registerElement(ref.current));
5332
- }, $[18] = registerElement, $[19] = t4) : t4 = $[19];
5333
- const handleRefChange = t4;
5334
- let t5, t6;
5335
- $[20] !== activeIndex || $[21] !== onItemSelect ? (t5 = () => {
4388
+ }, [registerElement]);
4389
+ useEffect(() => {
5336
4390
  onItemSelect && onItemSelect(activeIndex);
5337
- }, t6 = [activeIndex, onItemSelect], $[20] = activeIndex, $[21] = onItemSelect, $[22] = t5, $[23] = t6) : (t5 = $[22], t6 = $[23]), useEffect(t5, t6);
5338
- let t7;
5339
- $[24] === Symbol.for("react.memo_cache_sentinel") ? (t7 = () => [ref.current], $[24] = t7) : t7 = $[24], useClickOutsideEvent(isTopLayer && onClickOutside, t7);
5340
- let t8;
5341
- $[25] !== isTopLayer || $[26] !== onEscape ? (t8 = (event) => {
4391
+ }, [activeIndex, onItemSelect]), useClickOutsideEvent(isTopLayer && onClickOutside, () => [ref.current]), useGlobalKeyDown(useCallback((event) => {
5342
4392
  isTopLayer && event.key === "Escape" && (event.stopPropagation(), onEscape && onEscape());
5343
- }, $[25] = isTopLayer, $[26] = onEscape, $[27] = t8) : t8 = $[27], useGlobalKeyDown(t8);
5344
- let t9;
5345
- $[28] !== activeElement || $[29] !== handleItemMouseEnter || $[30] !== handleItemMouseLeave || $[31] !== mount || $[32] !== onClickOutside || $[33] !== onEscape || $[34] !== onItemClick || $[35] !== registerElement ? (t9 = {
4393
+ }, [isTopLayer, onEscape]));
4394
+ const value = useMemo(() => ({
5346
4395
  version: 2,
5347
4396
  activeElement,
5348
4397
  mount,
@@ -5352,14 +4401,8 @@ const StyledMenu = styled(Box).withConfig({
5352
4401
  onItemMouseEnter: handleItemMouseEnter,
5353
4402
  onItemMouseLeave: handleItemMouseLeave,
5354
4403
  registerElement
5355
- }, $[28] = activeElement, $[29] = handleItemMouseEnter, $[30] = handleItemMouseLeave, $[31] = mount, $[32] = onClickOutside, $[33] = onEscape, $[34] = onItemClick, $[35] = registerElement, $[36] = t9) : t9 = $[36];
5356
- const value = t9;
5357
- let t10;
5358
- $[37] !== children || $[38] !== space ? (t10 = /* @__PURE__ */ jsx(Stack, { space, children }), $[37] = children, $[38] = space, $[39] = t10) : t10 = $[39];
5359
- let t11;
5360
- $[40] !== handleKeyDown || $[41] !== handleRefChange || $[42] !== padding || $[43] !== restProps || $[44] !== t10 ? (t11 = /* @__PURE__ */ jsx(StyledMenu, { "data-ui": "Menu", ...restProps, onKeyDown: handleKeyDown, padding, ref: handleRefChange, role: "menu", tabIndex: -1, children: t10 }), $[40] = handleKeyDown, $[41] = handleRefChange, $[42] = padding, $[43] = restProps, $[44] = t10, $[45] = t11) : t11 = $[45];
5361
- let t12;
5362
- return $[46] !== t11 || $[47] !== value ? (t12 = /* @__PURE__ */ jsx(MenuContext.Provider, { value, children: t11 }), $[46] = t11, $[47] = value, $[48] = t12) : t12 = $[48], t12;
4404
+ }), [activeElement, mount, handleItemMouseEnter, handleItemMouseLeave, onClickOutside, onEscape, onItemClick, registerElement]);
4405
+ return /* @__PURE__ */ jsx(MenuContext.Provider, { value, children: /* @__PURE__ */ jsx(StyledMenu, { "data-ui": "Menu", ...restProps, onKeyDown: handleKeyDown, padding, ref: handleRefChange, role: "menu", tabIndex: -1, children: /* @__PURE__ */ jsx(Stack, { space, children }) }) });
5363
4406
  });
5364
4407
  Menu.displayName = "ForwardRef(Menu)";
5365
4408
  const MenuDivider = styled.hr.withConfig({
@@ -5481,24 +4524,21 @@ function useMenu() {
5481
4524
  return value;
5482
4525
  }
5483
4526
  function MenuGroup(props) {
5484
- const $ = c(81);
5485
- let IconComponent, children, menuProps, onClick, popover, restProps, t0, t1, t2, t3, t4, t5, text;
5486
- $[0] !== props ? ({
5487
- as: t0,
4527
+ const {
4528
+ as = "button",
5488
4529
  children,
5489
- fontSize: t1,
4530
+ fontSize: fontSize2 = 1,
5490
4531
  icon: IconComponent,
5491
4532
  menu: menuProps,
5492
4533
  onClick,
5493
- padding: t2,
4534
+ padding = 3,
5494
4535
  popover,
5495
- radius: t3,
5496
- space: t4,
4536
+ radius = 2,
4537
+ space = 3,
5497
4538
  text,
5498
- tone: t5,
4539
+ tone = "default",
5499
4540
  ...restProps
5500
- } = props, $[0] = props, $[1] = IconComponent, $[2] = children, $[3] = menuProps, $[4] = onClick, $[5] = popover, $[6] = restProps, $[7] = t0, $[8] = t1, $[9] = t2, $[10] = t3, $[11] = t4, $[12] = t5, $[13] = text) : (IconComponent = $[1], children = $[2], menuProps = $[3], onClick = $[4], popover = $[5], restProps = $[6], t0 = $[7], t1 = $[8], t2 = $[9], t3 = $[10], t4 = $[11], t5 = $[12], text = $[13]);
5501
- const as = t0 === void 0 ? "button" : t0, fontSize2 = t1 === void 0 ? 1 : t1, padding = t2 === void 0 ? 3 : t2, radius = t3 === void 0 ? 2 : t3, space = t4 === void 0 ? 3 : t4, tone = t5 === void 0 ? "default" : t5, menu = useMenu(), {
4541
+ } = props, menu = useMenu(), {
5502
4542
  scheme
5503
4543
  } = useRootTheme(), {
5504
4544
  activeElement,
@@ -5508,100 +4548,54 @@ function MenuGroup(props) {
5508
4548
  onItemClick,
5509
4549
  onItemMouseEnter: _onItemMouseEnter,
5510
4550
  registerElement
5511
- } = menu, onItemMouseEnter = _onItemMouseEnter ?? menu.onItemMouseEnter, [rootElement, setRootElement] = useState(null), [open, setOpen] = useState(!1), [shouldFocus, setShouldFocus] = useState(null), active = !!activeElement && activeElement === rootElement, [withinMenu, setWithinMenu] = useState(!1);
5512
- let t6;
5513
- $[14] !== onItemMouseEnter ? (t6 = (event) => {
4551
+ } = menu, onItemMouseEnter = _onItemMouseEnter ?? menu.onItemMouseEnter, [rootElement, setRootElement] = useState(null), [open, setOpen] = useState(!1), [shouldFocus, setShouldFocus] = useState(null), active = !!activeElement && activeElement === rootElement, [withinMenu, setWithinMenu] = useState(!1), handleMouseEnter = useCallback((event) => {
5514
4552
  setWithinMenu(!1), onItemMouseEnter(event), setOpen(!0);
5515
- }, $[14] = onItemMouseEnter, $[15] = t6) : t6 = $[15];
5516
- const handleMouseEnter = t6;
5517
- let t7;
5518
- $[16] !== rootElement ? (t7 = (event_0) => {
5519
- event_0.key === "ArrowLeft" && (event_0.stopPropagation(), setOpen(!1), requestAnimationFrame(() => {
4553
+ }, [onItemMouseEnter]), handleMenuKeyDown = useCallback((event) => {
4554
+ event.key === "ArrowLeft" && (event.stopPropagation(), setOpen(!1), requestAnimationFrame(() => {
5520
4555
  rootElement?.focus();
5521
4556
  }));
5522
- }, $[16] = rootElement, $[17] = t7) : t7 = $[17];
5523
- const handleMenuKeyDown = t7;
5524
- let t8;
5525
- $[18] !== onClick ? (t8 = (event_1) => {
5526
- onClick?.(event_1), setShouldFocus("first"), setOpen(!0);
5527
- }, $[18] = onClick, $[19] = t8) : t8 = $[19];
5528
- const handleClick = t8;
5529
- let t9;
5530
- $[20] !== onItemClick ? (t9 = () => {
4557
+ }, [rootElement]), handleClick = useCallback((event) => {
4558
+ onClick?.(event), setShouldFocus("first"), setOpen(!0);
4559
+ }, [onClick]), handleChildItemClick = useCallback(() => {
5531
4560
  setOpen(!1), onItemClick?.();
5532
- }, $[20] = onItemClick, $[21] = t9) : t9 = $[21];
5533
- const handleChildItemClick = t9;
5534
- let t10;
5535
- $[22] === Symbol.for("react.memo_cache_sentinel") ? (t10 = () => setWithinMenu(!0), $[22] = t10) : t10 = $[22];
5536
- const handleMenuMouseEnter = t10;
5537
- let t11, t12;
5538
- $[23] !== mount || $[24] !== rootElement ? (t11 = () => mount(rootElement), t12 = [mount, rootElement], $[23] = mount, $[24] = rootElement, $[25] = t11, $[26] = t12) : (t11 = $[25], t12 = $[26]), useEffect(t11, t12);
5539
- let t13, t14;
5540
- $[27] !== active ? (t13 = () => {
4561
+ }, [onItemClick]), handleMenuMouseEnter = useCallback(() => setWithinMenu(!0), []);
4562
+ useEffect(() => mount(rootElement), [mount, rootElement]), useEffect(() => {
5541
4563
  active || setOpen(!1);
5542
- }, t14 = [active], $[27] = active, $[28] = t13, $[29] = t14) : (t13 = $[28], t14 = $[29]), useEffect(t13, t14);
5543
- let t15, t16;
5544
- $[30] !== open ? (t15 = () => {
4564
+ }, [active]), useEffect(() => {
5545
4565
  open || setWithinMenu(!1);
5546
- }, t16 = [open], $[30] = open, $[31] = t15, $[32] = t16) : (t15 = $[31], t16 = $[32]), useEffect(t15, t16);
5547
- let t17, t18;
5548
- $[33] !== shouldFocus ? (t17 = () => {
5549
- if (!shouldFocus)
5550
- return;
4566
+ }, [open]), useEffect(() => {
4567
+ if (!shouldFocus) return;
5551
4568
  const rafId = requestAnimationFrame(() => setShouldFocus(null));
5552
4569
  return () => cancelAnimationFrame(rafId);
5553
- }, t18 = [shouldFocus], $[33] = shouldFocus, $[34] = t17, $[35] = t18) : (t17 = $[34], t18 = $[35]), useEffect(t17, t18);
5554
- let t19;
5555
- $[36] !== children || $[37] !== handleChildItemClick || $[38] !== handleMenuKeyDown || $[39] !== menuProps || $[40] !== onClickOutside || $[41] !== onEscape || $[42] !== registerElement || $[43] !== shouldFocus ? (t19 = /* @__PURE__ */ jsx(Menu, { ...menuProps, onClickOutside, onEscape, onItemClick: handleChildItemClick, onKeyDown: handleMenuKeyDown, onMouseEnter: handleMenuMouseEnter, registerElement, shouldFocus, children }), $[36] = children, $[37] = handleChildItemClick, $[38] = handleMenuKeyDown, $[39] = menuProps, $[40] = onClickOutside, $[41] = onEscape, $[42] = registerElement, $[43] = shouldFocus, $[44] = t19) : t19 = $[44];
5556
- const childMenu = t19;
5557
- let t20;
5558
- $[45] === Symbol.for("react.memo_cache_sentinel") ? (t20 = (event_2) => {
5559
- const target = event_2.currentTarget;
5560
- if (document.activeElement === target && event_2.key === "ArrowRight") {
4570
+ }, [shouldFocus]);
4571
+ const childMenu = /* @__PURE__ */ jsx(Menu, { ...menuProps, onClickOutside, onEscape, onItemClick: handleChildItemClick, onKeyDown: handleMenuKeyDown, onMouseEnter: handleMenuMouseEnter, registerElement, shouldFocus, children }), handleKeyDown = useCallback((event) => {
4572
+ const target = event.currentTarget;
4573
+ if (document.activeElement === target && event.key === "ArrowRight") {
5561
4574
  setShouldFocus("first"), setOpen(!0), setWithinMenu(!0);
5562
4575
  return;
5563
4576
  }
5564
- }, $[45] = t20) : t20 = $[45];
5565
- const handleKeyDown = t20, t21 = as === "button" ? withinMenu : void 0, t22 = as !== "button" ? withinMenu : void 0, t23 = !withinMenu && active ? "" : void 0;
5566
- let t24;
5567
- $[46] !== radius ? (t24 = _getArrayProp(radius), $[46] = radius, $[47] = t24) : t24 = $[47];
5568
- const t25 = as === "button" ? "button" : void 0;
5569
- let t26;
5570
- $[48] !== IconComponent || $[49] !== fontSize2 ? (t26 = IconComponent && /* @__PURE__ */ jsxs(Text, { size: fontSize2, children: [
5571
- isValidElement(IconComponent) && IconComponent,
5572
- isValidElementType(IconComponent) && /* @__PURE__ */ jsx(IconComponent, {})
5573
- ] }), $[48] = IconComponent, $[49] = fontSize2, $[50] = t26) : t26 = $[50];
5574
- let t27;
5575
- $[51] !== fontSize2 || $[52] !== text ? (t27 = /* @__PURE__ */ jsx(Box, { flex: 1, children: /* @__PURE__ */ jsx(Text, { size: fontSize2, textOverflow: "ellipsis", weight: "medium", children: text }) }), $[51] = fontSize2, $[52] = text, $[53] = t27) : t27 = $[53];
5576
- let t28;
5577
- $[54] === Symbol.for("react.memo_cache_sentinel") ? (t28 = /* @__PURE__ */ jsx(ChevronRightIcon, {}), $[54] = t28) : t28 = $[54];
5578
- let t29;
5579
- $[55] !== fontSize2 ? (t29 = /* @__PURE__ */ jsx(Text, { size: fontSize2, children: t28 }), $[55] = fontSize2, $[56] = t29) : t29 = $[56];
5580
- let t30;
5581
- $[57] !== padding || $[58] !== space || $[59] !== t26 || $[60] !== t27 || $[61] !== t29 ? (t30 = /* @__PURE__ */ jsxs(Flex, { gap: space, padding, children: [
5582
- t26,
5583
- t27,
5584
- t29
5585
- ] }), $[57] = padding, $[58] = space, $[59] = t26, $[60] = t27, $[61] = t29, $[62] = t30) : t30 = $[62];
5586
- let t31;
5587
- $[63] !== as || $[64] !== handleClick || $[65] !== handleMouseEnter || $[66] !== restProps || $[67] !== scheme || $[68] !== t21 || $[69] !== t22 || $[70] !== t23 || $[71] !== t24 || $[72] !== t25 || $[73] !== t30 || $[74] !== tone ? (t31 = /* @__PURE__ */ jsx(Selectable, { "data-as": as, "data-ui": "MenuGroup", forwardedAs: as, ...restProps, "aria-pressed": t21, "data-pressed": t22, "data-selected": t23, $radius: t24, $tone: tone, $scheme: scheme, onClick: handleClick, onKeyDown: handleKeyDown, onMouseEnter: handleMouseEnter, ref: setRootElement, tabIndex: -1, type: t25, children: t30 }), $[63] = as, $[64] = handleClick, $[65] = handleMouseEnter, $[66] = restProps, $[67] = scheme, $[68] = t21, $[69] = t22, $[70] = t23, $[71] = t24, $[72] = t25, $[73] = t30, $[74] = tone, $[75] = t31) : t31 = $[75];
5588
- let t32;
5589
- return $[76] !== childMenu || $[77] !== open || $[78] !== popover || $[79] !== t31 ? (t32 = /* @__PURE__ */ jsx(Popover, { ...popover, content: childMenu, "data-ui": "MenuGroup__popover", open, children: t31 }), $[76] = childMenu, $[77] = open, $[78] = popover, $[79] = t31, $[80] = t32) : t32 = $[80], t32;
4577
+ }, []);
4578
+ return /* @__PURE__ */ jsx(Popover, { ...popover, content: childMenu, "data-ui": "MenuGroup__popover", open, children: /* @__PURE__ */ jsx(Selectable, { "data-as": as, "data-ui": "MenuGroup", forwardedAs: as, ...restProps, "aria-pressed": as === "button" ? withinMenu : void 0, "data-pressed": as !== "button" ? withinMenu : void 0, "data-selected": !withinMenu && active ? "" : void 0, $radius: _getArrayProp(radius), $tone: tone, $scheme: scheme, onClick: handleClick, onKeyDown: handleKeyDown, onMouseEnter: handleMouseEnter, ref: setRootElement, tabIndex: -1, type: as === "button" ? "button" : void 0, children: /* @__PURE__ */ jsxs(Flex, { gap: space, padding, children: [
4579
+ IconComponent && /* @__PURE__ */ jsxs(Text, { size: fontSize2, children: [
4580
+ isValidElement(IconComponent) && IconComponent,
4581
+ isValidElementType(IconComponent) && /* @__PURE__ */ jsx(IconComponent, {})
4582
+ ] }),
4583
+ /* @__PURE__ */ jsx(Box, { flex: 1, children: /* @__PURE__ */ jsx(Text, { size: fontSize2, textOverflow: "ellipsis", weight: "medium", children: text }) }),
4584
+ /* @__PURE__ */ jsx(Text, { size: fontSize2, children: /* @__PURE__ */ jsx(ChevronRightIcon, {}) })
4585
+ ] }) }) });
5590
4586
  }
5591
4587
  MenuGroup.displayName = "MenuGroup";
5592
4588
  const MenuItem = forwardRef(function(props, forwardedRef) {
5593
- const $ = c(75);
5594
- let IconComponent, IconRightComponent, children, disabled, hotkeys, onClick, paddingBottom, paddingLeft, paddingRight, paddingTop, paddingX, paddingY, pressed, restProps, selectedProp, t0, t1, t2, t3, t4, t5, text;
5595
- $[0] !== props ? ({
5596
- as: t0,
4589
+ const {
4590
+ as = "button",
5597
4591
  children,
5598
4592
  disabled,
5599
- fontSize: t1,
4593
+ fontSize: fontSize2 = 1,
5600
4594
  hotkeys,
5601
4595
  icon: IconComponent,
5602
4596
  iconRight: IconRightComponent,
5603
4597
  onClick,
5604
- padding: t2,
4598
+ padding = 3,
5605
4599
  paddingX,
5606
4600
  paddingY,
5607
4601
  paddingTop,
@@ -5609,14 +4603,13 @@ const MenuItem = forwardRef(function(props, forwardedRef) {
5609
4603
  paddingBottom,
5610
4604
  paddingLeft,
5611
4605
  pressed,
5612
- radius: t3,
4606
+ radius = 2,
5613
4607
  selected: selectedProp,
5614
- space: t4,
4608
+ space = 3,
5615
4609
  text,
5616
- tone: t5,
4610
+ tone = "default",
5617
4611
  ...restProps
5618
- } = props, $[0] = props, $[1] = IconComponent, $[2] = IconRightComponent, $[3] = children, $[4] = disabled, $[5] = hotkeys, $[6] = onClick, $[7] = paddingBottom, $[8] = paddingLeft, $[9] = paddingRight, $[10] = paddingTop, $[11] = paddingX, $[12] = paddingY, $[13] = pressed, $[14] = restProps, $[15] = selectedProp, $[16] = t0, $[17] = t1, $[18] = t2, $[19] = t3, $[20] = t4, $[21] = t5, $[22] = text) : (IconComponent = $[1], IconRightComponent = $[2], children = $[3], disabled = $[4], hotkeys = $[5], onClick = $[6], paddingBottom = $[7], paddingLeft = $[8], paddingRight = $[9], paddingTop = $[10], paddingX = $[11], paddingY = $[12], pressed = $[13], restProps = $[14], selectedProp = $[15], t0 = $[16], t1 = $[17], t2 = $[18], t3 = $[19], t4 = $[20], t5 = $[21], text = $[22]);
5619
- const as = t0 === void 0 ? "button" : t0, fontSize2 = t1 === void 0 ? 1 : t1, padding = t2 === void 0 ? 3 : t2, radius = t3 === void 0 ? 2 : t3, space = t4 === void 0 ? 3 : t4, tone = t5 === void 0 ? "default" : t5, {
4612
+ } = props, {
5620
4613
  scheme
5621
4614
  } = useRootTheme(), menu = useMenu(), {
5622
4615
  activeElement,
@@ -5625,17 +4618,10 @@ const MenuItem = forwardRef(function(props, forwardedRef) {
5625
4618
  onItemMouseEnter: _onItemMouseEnter,
5626
4619
  onItemMouseLeave: _onItemMouseLeave
5627
4620
  } = menu, onItemMouseEnter = _onItemMouseEnter ?? menu.onItemMouseEnter, onItemMouseLeave = _onItemMouseLeave ?? menu.onItemMouseLeave, [rootElement, setRootElement] = useState(null), active = !!activeElement && activeElement === rootElement, ref = useRef(null);
5628
- let t6;
5629
- $[23] === Symbol.for("react.memo_cache_sentinel") ? (t6 = () => ref.current, $[23] = t6) : t6 = $[23], useImperativeHandle(forwardedRef, t6);
5630
- let t7, t8;
5631
- $[24] !== mount || $[25] !== rootElement || $[26] !== selectedProp ? (t7 = () => mount(rootElement, selectedProp), t8 = [mount, rootElement, selectedProp], $[24] = mount, $[25] = rootElement, $[26] = selectedProp, $[27] = t7, $[28] = t8) : (t7 = $[27], t8 = $[28]), useEffect(t7, t8);
5632
- let t9;
5633
- $[29] !== disabled || $[30] !== onClick || $[31] !== onItemClick ? (t9 = (event) => {
4621
+ useImperativeHandle(forwardedRef, () => ref.current), useEffect(() => mount(rootElement, selectedProp), [mount, rootElement, selectedProp]);
4622
+ const handleClick = useCallback((event) => {
5634
4623
  disabled || (onClick && onClick(event), onItemClick && onItemClick());
5635
- }, $[29] = disabled, $[30] = onClick, $[31] = onItemClick, $[32] = t9) : t9 = $[32];
5636
- const handleClick = t9;
5637
- let t10;
5638
- $[33] !== padding || $[34] !== paddingBottom || $[35] !== paddingLeft || $[36] !== paddingRight || $[37] !== paddingTop || $[38] !== paddingX || $[39] !== paddingY ? (t10 = {
4624
+ }, [disabled, onClick, onItemClick]), paddingProps = useMemo(() => ({
5639
4625
  padding,
5640
4626
  paddingX,
5641
4627
  paddingY,
@@ -5643,119 +4629,71 @@ const MenuItem = forwardRef(function(props, forwardedRef) {
5643
4629
  paddingRight,
5644
4630
  paddingBottom,
5645
4631
  paddingLeft
5646
- }, $[33] = padding, $[34] = paddingBottom, $[35] = paddingLeft, $[36] = paddingRight, $[37] = paddingTop, $[38] = paddingX, $[39] = paddingY, $[40] = t10) : t10 = $[40];
5647
- const paddingProps = t10;
5648
- let t11;
5649
- $[41] !== fontSize2 ? (t11 = _getArrayProp(fontSize2).map(_temp), $[41] = fontSize2, $[42] = t11) : t11 = $[42];
5650
- const hotkeysFontSize = t11;
5651
- let t12;
5652
- $[43] === Symbol.for("react.memo_cache_sentinel") ? (t12 = (el) => {
4632
+ }), [padding, paddingX, paddingY, paddingTop, paddingRight, paddingBottom, paddingLeft]), hotkeysFontSize = _getArrayProp(fontSize2).map((s) => s - 1), setRef = useCallback((el) => {
5653
4633
  ref.current = el, setRootElement(el);
5654
- }, $[43] = t12) : t12 = $[43];
5655
- const setRef = t12, t13 = as !== "button" && pressed ? "" : void 0, t14 = active ? "" : void 0, t15 = disabled ? "" : void 0;
5656
- let t16;
5657
- $[44] !== radius ? (t16 = _getArrayProp(radius), $[44] = radius, $[45] = t16) : t16 = $[45];
5658
- let t17;
5659
- $[46] === Symbol.for("react.memo_cache_sentinel") ? (t17 = _getArrayProp(0), $[46] = t17) : t17 = $[46];
5660
- const t18 = disabled ? "default" : tone, t19 = as === "button" ? "button" : void 0;
5661
- let t20;
5662
- $[47] !== IconComponent || $[48] !== IconRightComponent || $[49] !== fontSize2 || $[50] !== hotkeys || $[51] !== hotkeysFontSize || $[52] !== paddingProps || $[53] !== space || $[54] !== text ? (t20 = (IconComponent || text || IconRightComponent) && /* @__PURE__ */ jsxs(Flex, { as: "span", gap: space, align: "center", ...paddingProps, children: [
5663
- IconComponent && /* @__PURE__ */ jsxs(Text, { size: fontSize2, children: [
5664
- isValidElement(IconComponent) && IconComponent,
5665
- isValidElementType(IconComponent) && /* @__PURE__ */ jsx(IconComponent, {})
4634
+ }, []);
4635
+ return /* @__PURE__ */ jsxs(Selectable, { "data-ui": "MenuItem", role: "menuitem", ...restProps, "data-pressed": as !== "button" && pressed ? "" : void 0, "data-selected": active ? "" : void 0, "data-disabled": disabled ? "" : void 0, forwardedAs: as, $radius: _getArrayProp(radius), $padding: _getArrayProp(0), $tone: disabled ? "default" : tone, $scheme: scheme, disabled, onClick: handleClick, onMouseEnter: onItemMouseEnter, onMouseLeave: onItemMouseLeave, ref: setRef, tabIndex: -1, type: as === "button" ? "button" : void 0, children: [
4636
+ (IconComponent || text || IconRightComponent) && /* @__PURE__ */ jsxs(Flex, { as: "span", gap: space, align: "center", ...paddingProps, children: [
4637
+ IconComponent && /* @__PURE__ */ jsxs(Text, { size: fontSize2, children: [
4638
+ isValidElement(IconComponent) && IconComponent,
4639
+ isValidElementType(IconComponent) && /* @__PURE__ */ jsx(IconComponent, {})
4640
+ ] }),
4641
+ text && /* @__PURE__ */ jsx(Box, { flex: 1, children: /* @__PURE__ */ jsx(Text, { size: fontSize2, textOverflow: "ellipsis", weight: "medium", children: text }) }),
4642
+ hotkeys && /* @__PURE__ */ jsx(Hotkeys, { fontSize: hotkeysFontSize, keys: hotkeys, style: {
4643
+ marginTop: -4,
4644
+ marginBottom: -4
4645
+ } }),
4646
+ IconRightComponent && /* @__PURE__ */ jsxs(Text, { size: fontSize2, children: [
4647
+ isValidElement(IconRightComponent) && IconRightComponent,
4648
+ isValidElementType(IconRightComponent) && /* @__PURE__ */ jsx(IconRightComponent, {})
4649
+ ] })
5666
4650
  ] }),
5667
- text && /* @__PURE__ */ jsx(Box, { flex: 1, children: /* @__PURE__ */ jsx(Text, { size: fontSize2, textOverflow: "ellipsis", weight: "medium", children: text }) }),
5668
- hotkeys && /* @__PURE__ */ jsx(Hotkeys, { fontSize: hotkeysFontSize, keys: hotkeys, style: {
5669
- marginTop: -4,
5670
- marginBottom: -4
5671
- } }),
5672
- IconRightComponent && /* @__PURE__ */ jsxs(Text, { size: fontSize2, children: [
5673
- isValidElement(IconRightComponent) && IconRightComponent,
5674
- isValidElementType(IconRightComponent) && /* @__PURE__ */ jsx(IconRightComponent, {})
5675
- ] })
5676
- ] }), $[47] = IconComponent, $[48] = IconRightComponent, $[49] = fontSize2, $[50] = hotkeys, $[51] = hotkeysFontSize, $[52] = paddingProps, $[53] = space, $[54] = text, $[55] = t20) : t20 = $[55];
5677
- let t21;
5678
- $[56] !== children || $[57] !== paddingProps ? (t21 = children && /* @__PURE__ */ jsx(Box, { as: "span", ...paddingProps, children }), $[56] = children, $[57] = paddingProps, $[58] = t21) : t21 = $[58];
5679
- let t22;
5680
- return $[59] !== as || $[60] !== disabled || $[61] !== handleClick || $[62] !== onItemMouseEnter || $[63] !== onItemMouseLeave || $[64] !== restProps || $[65] !== scheme || $[66] !== t13 || $[67] !== t14 || $[68] !== t15 || $[69] !== t16 || $[70] !== t18 || $[71] !== t19 || $[72] !== t20 || $[73] !== t21 ? (t22 = /* @__PURE__ */ jsxs(Selectable, { "data-ui": "MenuItem", role: "menuitem", ...restProps, "data-pressed": t13, "data-selected": t14, "data-disabled": t15, forwardedAs: as, $radius: t16, $padding: t17, $tone: t18, $scheme: scheme, disabled, onClick: handleClick, onMouseEnter: onItemMouseEnter, onMouseLeave: onItemMouseLeave, ref: setRef, tabIndex: -1, type: t19, children: [
5681
- t20,
5682
- t21
5683
- ] }), $[59] = as, $[60] = disabled, $[61] = handleClick, $[62] = onItemMouseEnter, $[63] = onItemMouseLeave, $[64] = restProps, $[65] = scheme, $[66] = t13, $[67] = t14, $[68] = t15, $[69] = t16, $[70] = t18, $[71] = t19, $[72] = t20, $[73] = t21, $[74] = t22) : t22 = $[74], t22;
4651
+ children && /* @__PURE__ */ jsx(Box, { as: "span", ...paddingProps, children })
4652
+ ] });
5684
4653
  });
5685
4654
  MenuItem.displayName = "ForwardRef(MenuItem)";
5686
- function _temp(s) {
5687
- return s - 1;
5688
- }
5689
4655
  const CustomButton = styled(Button).withConfig({
5690
4656
  displayName: "CustomButton",
5691
4657
  componentId: "sc-1kns779-0"
5692
4658
  })`max-width:100%;`, Tab = forwardRef(function(props, forwardedRef) {
5693
- const $ = c(30);
5694
- let focused, icon, id, label, onClick, onFocus, restProps, selected, t0, t1;
5695
- $[0] !== props ? ({
4659
+ const {
5696
4660
  icon,
5697
4661
  id,
5698
4662
  focused,
5699
- fontSize: t0,
4663
+ fontSize: fontSize2 = 1,
5700
4664
  label,
5701
4665
  onClick,
5702
4666
  onFocus,
5703
- padding: t1,
4667
+ padding = 2,
5704
4668
  selected,
5705
4669
  ...restProps
5706
- } = props, $[0] = props, $[1] = focused, $[2] = icon, $[3] = id, $[4] = label, $[5] = onClick, $[6] = onFocus, $[7] = restProps, $[8] = selected, $[9] = t0, $[10] = t1) : (focused = $[1], icon = $[2], id = $[3], label = $[4], onClick = $[5], onFocus = $[6], restProps = $[7], selected = $[8], t0 = $[9], t1 = $[10]);
5707
- const fontSize2 = t0 === void 0 ? 1 : t0, padding = t1 === void 0 ? 2 : t1, ref = useRef(null), focusedRef = useRef(!1);
5708
- let t2;
5709
- $[11] === Symbol.for("react.memo_cache_sentinel") ? (t2 = () => ref.current, $[11] = t2) : t2 = $[11], useImperativeHandle(forwardedRef, t2);
5710
- let t3;
5711
- $[12] === Symbol.for("react.memo_cache_sentinel") ? (t3 = () => {
4670
+ } = props, ref = useRef(null), focusedRef = useRef(!1);
4671
+ useImperativeHandle(forwardedRef, () => ref.current);
4672
+ const handleBlur = useCallback(() => {
5712
4673
  focusedRef.current = !1;
5713
- }, $[12] = t3) : t3 = $[12];
5714
- const handleBlur = t3;
5715
- let t4;
5716
- $[13] !== onFocus ? (t4 = (event) => {
4674
+ }, []), handleFocus = useCallback((event) => {
5717
4675
  focusedRef.current = !0, onFocus && onFocus(event);
5718
- }, $[13] = onFocus, $[14] = t4) : t4 = $[14];
5719
- const handleFocus = t4;
5720
- let t5, t6;
5721
- $[15] !== focused ? (t5 = () => {
4676
+ }, [onFocus]);
4677
+ return useEffect(() => {
5722
4678
  focused && !focusedRef.current && (ref.current && ref.current.focus(), focusedRef.current = !0);
5723
- }, t6 = [focused], $[15] = focused, $[16] = t5, $[17] = t6) : (t5 = $[16], t6 = $[17]), useEffect(t5, t6);
5724
- const t7 = selected ? "true" : "false", t8 = selected ? 0 : -1;
5725
- let t9;
5726
- return $[18] !== fontSize2 || $[19] !== handleFocus || $[20] !== icon || $[21] !== id || $[22] !== label || $[23] !== onClick || $[24] !== padding || $[25] !== restProps || $[26] !== selected || $[27] !== t7 || $[28] !== t8 ? (t9 = /* @__PURE__ */ jsx(CustomButton, { "data-ui": "Tab", ...restProps, "aria-selected": t7, fontSize: fontSize2, icon, id, mode: "bleed", onClick, onBlur: handleBlur, onFocus: handleFocus, padding, ref, role: "tab", selected, tabIndex: t8, text: label, type: "button" }), $[18] = fontSize2, $[19] = handleFocus, $[20] = icon, $[21] = id, $[22] = label, $[23] = onClick, $[24] = padding, $[25] = restProps, $[26] = selected, $[27] = t7, $[28] = t8, $[29] = t9) : t9 = $[29], t9;
4679
+ }, [focused]), /* @__PURE__ */ jsx(CustomButton, { "data-ui": "Tab", ...restProps, "aria-selected": selected ? "true" : "false", fontSize: fontSize2, icon, id, mode: "bleed", onClick, onBlur: handleBlur, onFocus: handleFocus, padding, ref, role: "tab", selected, tabIndex: selected ? 0 : -1, text: label, type: "button" });
5727
4680
  });
5728
4681
  Tab.displayName = "ForwardRef(Tab)";
5729
4682
  const CustomInline = styled(Inline).withConfig({
5730
4683
  displayName: "CustomInline",
5731
4684
  componentId: "sc-5cm04m-0"
5732
4685
  })`& > div{display:inline-block;vertical-align:middle;max-width:100%;box-sizing:border-box;}`, TabList = forwardRef(function(props, ref) {
5733
- const $ = c(15);
5734
- let childrenProp, restProps;
5735
- $[0] !== props ? ({
4686
+ const {
5736
4687
  children: childrenProp,
5737
4688
  ...restProps
5738
- } = props, $[0] = props, $[1] = childrenProp, $[2] = restProps) : (childrenProp = $[1], restProps = $[2]);
5739
- const [focusedIndex, setFocusedIndex] = useState(-1);
5740
- let t0;
5741
- if ($[3] !== childrenProp || $[4] !== focusedIndex) {
5742
- const children = Children.toArray(childrenProp).filter(isValidElement);
5743
- let t12;
5744
- $[6] !== focusedIndex ? (t12 = (child, childIndex) => cloneElement(child, {
5745
- focused: focusedIndex === childIndex,
5746
- key: childIndex,
5747
- onFocus: () => setFocusedIndex(childIndex)
5748
- }), $[6] = focusedIndex, $[7] = t12) : t12 = $[7], t0 = children.map(t12), $[3] = childrenProp, $[4] = focusedIndex, $[5] = t0;
5749
- } else
5750
- t0 = $[5];
5751
- const tabs = t0, numTabs = tabs.length;
5752
- let t1;
5753
- $[8] !== numTabs ? (t1 = (event) => {
5754
- event.key === "ArrowLeft" && setFocusedIndex((prevIndex) => (prevIndex + numTabs - 1) % numTabs), event.key === "ArrowRight" && setFocusedIndex((prevIndex_0) => (prevIndex_0 + 1) % numTabs);
5755
- }, $[8] = numTabs, $[9] = t1) : t1 = $[9];
5756
- const handleKeyDown = t1;
5757
- let t2;
5758
- return $[10] !== handleKeyDown || $[11] !== ref || $[12] !== restProps || $[13] !== tabs ? (t2 = /* @__PURE__ */ jsx(CustomInline, { "data-ui": "TabList", ...restProps, onKeyDown: handleKeyDown, ref, role: "tablist", children: tabs }), $[10] = handleKeyDown, $[11] = ref, $[12] = restProps, $[13] = tabs, $[14] = t2) : t2 = $[14], t2;
4689
+ } = props, [focusedIndex, setFocusedIndex] = useState(-1), tabs = Children.toArray(childrenProp).filter(isValidElement).map((child, childIndex) => cloneElement(child, {
4690
+ focused: focusedIndex === childIndex,
4691
+ key: childIndex,
4692
+ onFocus: () => setFocusedIndex(childIndex)
4693
+ })), numTabs = tabs.length, handleKeyDown = useCallback((event) => {
4694
+ event.key === "ArrowLeft" && setFocusedIndex((prevIndex) => (prevIndex + numTabs - 1) % numTabs), event.key === "ArrowRight" && setFocusedIndex((prevIndex) => (prevIndex + 1) % numTabs);
4695
+ }, [numTabs]);
4696
+ return /* @__PURE__ */ jsx(CustomInline, { "data-ui": "TabList", ...restProps, onKeyDown: handleKeyDown, ref, role: "tablist", children: tabs });
5759
4697
  });
5760
4698
  TabList.displayName = "ForwardRef(TabList)";
5761
4699
  export {