@sanity/ui 3.0.13 → 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.
Files changed (48) hide show
  1. package/dist/_chunks-cjs/_visual-editing.js +886 -1751
  2. package/dist/_chunks-cjs/_visual-editing.js.map +1 -1
  3. package/dist/_chunks-cjs/refractor.js +7 -15
  4. package/dist/_chunks-cjs/refractor.js.map +1 -1
  5. package/dist/_chunks-es/_visual-editing.mjs +887 -1753
  6. package/dist/_chunks-es/_visual-editing.mjs.map +1 -1
  7. package/dist/_chunks-es/refractor.mjs +6 -15
  8. package/dist/_chunks-es/refractor.mjs.map +1 -1
  9. package/dist/index.d.mts +1 -1
  10. package/dist/index.d.ts +1 -1
  11. package/dist/index.js +349 -810
  12. package/dist/index.js.map +1 -1
  13. package/dist/index.mjs +350 -812
  14. package/dist/index.mjs.map +1 -1
  15. package/package.json +27 -41
  16. package/src/core/components/autocomplete/autocomplete.tsx +10 -14
  17. package/src/core/components/breadcrumbs/breadcrumbs.tsx +3 -2
  18. package/src/core/components/dialog/dialog.tsx +10 -14
  19. package/src/core/components/hotkeys/hotkeys.tsx +2 -2
  20. package/src/core/components/menu/menuGroup.tsx +2 -2
  21. package/src/core/components/menu/menuItem.tsx +4 -4
  22. package/src/core/components/skeleton/skeleton.tsx +2 -2
  23. package/src/core/components/skeleton/textSkeleton.tsx +5 -6
  24. package/src/core/hooks/index.ts +1 -1
  25. package/src/core/hooks/useArrayProp.ts +3 -17
  26. package/src/core/primitives/avatar/avatar.tsx +14 -16
  27. package/src/core/primitives/avatar/avatarCounter.tsx +14 -17
  28. package/src/core/primitives/avatar/avatarStack.tsx +2 -3
  29. package/src/core/primitives/badge/badge.tsx +3 -3
  30. package/src/core/primitives/box/box.tsx +26 -26
  31. package/src/core/primitives/button/button.tsx +11 -12
  32. package/src/core/primitives/card/card.tsx +8 -8
  33. package/src/core/primitives/code/code.tsx +8 -2
  34. package/src/core/primitives/container/container.tsx +2 -2
  35. package/src/core/primitives/flex/flex.tsx +6 -6
  36. package/src/core/primitives/grid/grid.tsx +9 -9
  37. package/src/core/primitives/heading/heading.tsx +3 -3
  38. package/src/core/primitives/inline/inline.tsx +2 -2
  39. package/src/core/primitives/kbd/kbd.tsx +2 -2
  40. package/src/core/primitives/label/label.tsx +3 -3
  41. package/src/core/primitives/popover/popover.tsx +7 -6
  42. package/src/core/primitives/select/select.tsx +6 -5
  43. package/src/core/primitives/stack/stack.tsx +2 -2
  44. package/src/core/primitives/text/text.tsx +3 -3
  45. package/src/core/primitives/textArea/textArea.tsx +6 -5
  46. package/src/core/primitives/textInput/textInput.tsx +6 -5
  47. package/src/core/primitives/tooltip/tooltip.tsx +3 -2
  48. package/src/core/utils/layer/layerProvider.tsx +3 -2
@@ -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
2
  import { jsx, jsxs, Fragment } from "react/jsx-runtime";
3
- import { c } from "react-compiler-runtime";
4
- import { useState, useEffect, useDebugValue, useSyncExternalStore, createContext, useContext, forwardRef, useId, Children, isValidElement, cloneElement, useRef, useImperativeHandle, lazy, Suspense, useLayoutEffect } from "react";
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";
@@ -195,125 +194,6 @@ function responsiveTextAlignStyle(props) {
195
194
  function responsiveTextFont(props) {
196
195
  return responsiveFont("text", props);
197
196
  }
198
- function useArrayProp(val, defaultVal) {
199
- const $ = c(3);
200
- let t0;
201
- $[0] !== defaultVal || $[1] !== val ? (t0 = () => [_getArrayProp(val, defaultVal), JSON.stringify(val ?? defaultVal)], $[0] = defaultVal, $[1] = val, $[2] = t0) : t0 = $[2];
202
- const [t1, setCache] = useState(t0), [cachedVal, cachedHash] = t1, hash = JSON.stringify(val ?? defaultVal);
203
- return hash !== cachedHash && setCache([_getArrayProp(val, defaultVal), hash]), cachedVal;
204
- }
205
- function useClickOutsideEvent(listener, t0, boundaryElement) {
206
- const $ = c(9), elementsArg = t0 === void 0 ? _temp$a : t0;
207
- let t1;
208
- $[0] !== boundaryElement || $[1] !== elementsArg || $[2] !== listener ? (t1 = (evt) => {
209
- if (!listener)
210
- return;
211
- const target = evt.target;
212
- if (!(target instanceof Node))
213
- return;
214
- const resolvedBoundaryElement = boundaryElement?.();
215
- if (resolvedBoundaryElement && !resolvedBoundaryElement.contains(target))
216
- return;
217
- const elements = elementsArg().flat();
218
- for (const el of elements)
219
- if (el && (target === el || el.contains(target)))
220
- return;
221
- listener(evt);
222
- }, $[0] = boundaryElement, $[1] = elementsArg, $[2] = listener, $[3] = t1) : t1 = $[3];
223
- const onEvent = useEffectEvent(t1), hasListener = !!listener;
224
- let t2;
225
- $[4] !== hasListener || $[5] !== onEvent ? (t2 = () => {
226
- if (!hasListener)
227
- return;
228
- const handleEvent = (evt_0) => onEvent(evt_0);
229
- return document.addEventListener("mousedown", handleEvent), () => {
230
- document.removeEventListener("mousedown", handleEvent);
231
- };
232
- }, $[4] = hasListener, $[5] = onEvent, $[6] = t2) : t2 = $[6];
233
- let t3;
234
- $[7] !== hasListener ? (t3 = [hasListener], $[7] = hasListener, $[8] = t3) : t3 = $[8], useEffect(t2, t3), useDebugValue(listener ? "MouseDown On" : "MouseDown Off");
235
- }
236
- function _temp$a() {
237
- return EMPTY_ARRAY;
238
- }
239
- function useCustomValidity(ref, customValidity) {
240
- const $ = c(4);
241
- let t0, t1;
242
- $[0] !== customValidity || $[1] !== ref ? (t0 = () => {
243
- ref.current?.setCustomValidity(customValidity || "");
244
- }, t1 = [customValidity, ref], $[0] = customValidity, $[1] = ref, $[2] = t0, $[3] = t1) : (t0 = $[2], t1 = $[3]), useEffect(t0, t1);
245
- }
246
- const _ResizeObserver = typeof document < "u" && typeof window < "u" && window.ResizeObserver ? window.ResizeObserver : ResizeObserver, _elementSizeObserver = _createElementSizeObserver();
247
- function _createElementRectValueListener() {
248
- return {
249
- subscribe(element, subscriber) {
250
- const resizeObserver = new _ResizeObserver(([entry]) => {
251
- subscriber({
252
- _contentRect: entry.contentRect,
253
- border: {
254
- width: entry.borderBoxSize[0].inlineSize,
255
- height: entry.borderBoxSize[0].blockSize
256
- },
257
- content: {
258
- width: entry.contentRect.width,
259
- height: entry.contentRect.height
260
- }
261
- });
262
- });
263
- return resizeObserver.observe(element), () => {
264
- resizeObserver.unobserve(element), resizeObserver.disconnect();
265
- };
266
- }
267
- };
268
- }
269
- function _createElementSizeObserver() {
270
- const disposeCache = /* @__PURE__ */ new WeakMap(), subscribersCache = /* @__PURE__ */ new WeakMap();
271
- return {
272
- subscribe(element, subscriber) {
273
- const subscribers = subscribersCache.get(element) || [];
274
- let dispose = disposeCache.get(element);
275
- return subscribersCache.has(element) || (subscribersCache.set(element, subscribers), dispose = _createElementRectValueListener().subscribe(element, (elementRect) => {
276
- for (const sub of subscribers)
277
- sub(elementRect);
278
- })), subscribers.push(subscriber), () => {
279
- const idx = subscribers.indexOf(subscriber);
280
- idx > -1 && subscribers.splice(idx, 1), subscribers.length === 0 && dispose && dispose();
281
- };
282
- }
283
- };
284
- }
285
- function useElementSize(element) {
286
- const $ = c(3), [size2, setSize] = useState(null);
287
- let t0, t1;
288
- return $[0] !== element ? (t0 = () => {
289
- if (element)
290
- return _elementSizeObserver.subscribe(element, setSize);
291
- }, t1 = [element], $[0] = element, $[1] = t0, $[2] = t1) : (t0 = $[1], t1 = $[2]), useEffect(t0, t1), size2;
292
- }
293
- function useGlobalKeyDown(onKeyDown) {
294
- const $ = c(5);
295
- let t0;
296
- $[0] !== onKeyDown ? (t0 = (event) => onKeyDown(event), $[0] = onKeyDown, $[1] = t0) : t0 = $[1];
297
- const handleKeyDown = useEffectEvent(t0);
298
- let t1;
299
- $[2] !== handleKeyDown ? (t1 = () => {
300
- const handler = (event_0) => handleKeyDown(event_0);
301
- return window.addEventListener("keydown", handler), () => window.removeEventListener("keydown", handler);
302
- }, $[2] = handleKeyDown, $[3] = t1) : t1 = $[3];
303
- let t2;
304
- $[4] === Symbol.for("react.memo_cache_sentinel") ? (t2 = [], $[4] = t2) : t2 = $[4], useEffect(t1, t2);
305
- }
306
- function useMatchMedia(mediaQueryString, getServerSnapshot2) {
307
- const $ = c(4);
308
- useDebugValue(mediaQueryString);
309
- let t0;
310
- $[0] !== mediaQueryString ? (t0 = (onStoreChange) => {
311
- const media = window.matchMedia(mediaQueryString);
312
- return media.addEventListener("change", onStoreChange), () => media.removeEventListener("change", onStoreChange);
313
- }, $[0] = mediaQueryString, $[1] = t0) : t0 = $[1];
314
- let t1;
315
- return $[2] !== mediaQueryString ? (t1 = () => window.matchMedia(mediaQueryString).matches, $[2] = mediaQueryString, $[3] = t1) : t1 = $[3], useSyncExternalStore(t0, t1, getServerSnapshot2);
316
- }
317
197
  function getGlobalScope() {
318
198
  if (typeof globalThis < "u") return globalThis;
319
199
  if (typeof window < "u") return window;
@@ -332,42 +212,15 @@ function createGlobalScopedContext(key2, defaultValue) {
332
212
  }
333
213
  const ThemeContext = createGlobalScopedContext("@sanity/ui/context/theme", null);
334
214
  function ThemeProvider(props) {
335
- const $ = c(15), parentTheme = useContext(ThemeContext), {
215
+ const parentTheme = useContext(ThemeContext), {
336
216
  children
337
- } = props, scheme = props.scheme ?? (parentTheme?.scheme || "light"), rootTheme = props.theme ?? (parentTheme?.theme || null), tone = props.tone ?? (parentTheme?.tone || "default");
338
- let t0;
339
- bb0: {
340
- if (!rootTheme) {
341
- t0 = null;
342
- break bb0;
343
- }
344
- let t12;
345
- $[0] !== rootTheme || $[1] !== scheme || $[2] !== tone ? (t12 = {
346
- version: 0,
347
- theme: rootTheme,
348
- scheme,
349
- tone
350
- }, $[0] = rootTheme, $[1] = scheme, $[2] = tone, $[3] = t12) : t12 = $[3], t0 = t12;
351
- }
352
- const themeContext = t0;
353
- let t1;
354
- bb1: {
355
- if (!rootTheme) {
356
- t1 = null;
357
- break bb1;
358
- }
359
- let t22;
360
- $[4] !== rootTheme || $[5] !== scheme || $[6] !== tone ? (t22 = getScopedTheme(rootTheme, scheme, tone), $[4] = rootTheme, $[5] = scheme, $[6] = tone, $[7] = t22) : t22 = $[7], t1 = t22;
361
- }
362
- const theme = t1;
363
- if (!theme) {
364
- let t22;
365
- return $[8] === Symbol.for("react.memo_cache_sentinel") ? (t22 = /* @__PURE__ */ jsx("pre", { children: 'ThemeProvider: no "theme" property provided' }), $[8] = t22) : t22 = $[8], t22;
366
- }
367
- let t2;
368
- $[9] !== children || $[10] !== theme ? (t2 = /* @__PURE__ */ jsx(ThemeProvider$1, { theme, children }), $[9] = children, $[10] = theme, $[11] = t2) : t2 = $[11];
369
- let t3;
370
- 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' });
371
224
  }
372
225
  ThemeProvider.displayName = "ThemeProvider";
373
226
  function useRootTheme() {
@@ -377,91 +230,19 @@ function useRootTheme() {
377
230
  return value;
378
231
  }
379
232
  function ThemeColorProvider(props) {
380
- const $ = c(5), {
233
+ const {
381
234
  children,
382
235
  scheme,
383
236
  tone
384
- } = props, root = useRootTheme(), t0 = scheme || root.scheme;
385
- let t1;
386
- 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 });
387
239
  }
388
240
  ThemeColorProvider.displayName = "ThemeColorProvider";
389
241
  function useTheme() {
390
242
  return useTheme$1();
391
243
  }
392
244
  function useTheme_v2() {
393
- const $ = c(2), t0 = useTheme$1();
394
- let t1;
395
- return $[0] !== t0 ? (t1 = getTheme_v2(t0), $[0] = t0, $[1] = t1) : t1 = $[1], t1;
396
- }
397
- function _getMediaQuery(media, index) {
398
- 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)`;
399
- }
400
- function _createMediaStore(media) {
401
- const mediaLen = media.length;
402
- let sizes;
403
- const getSizes = () => {
404
- if (!sizes) {
405
- sizes = [];
406
- for (let index = mediaLen; index > -1; index -= 1) {
407
- const mediaQuery = _getMediaQuery(media, index);
408
- sizes.push({
409
- index,
410
- mq: window.matchMedia(mediaQuery)
411
- });
412
- }
413
- }
414
- return sizes;
415
- };
416
- return {
417
- getSnapshot: () => {
418
- for (const {
419
- index,
420
- mq
421
- } of getSizes())
422
- if (mq.matches) return index;
423
- return 0;
424
- },
425
- subscribe: (onStoreChange) => {
426
- const disposeFns = [];
427
- for (const {
428
- mq
429
- } of getSizes()) {
430
- const handleChange = () => {
431
- mq.matches && onStoreChange();
432
- };
433
- mq.addEventListener("change", handleChange), disposeFns.push(() => mq.removeEventListener("change", handleChange));
434
- }
435
- return () => {
436
- for (const disposeFn of disposeFns)
437
- disposeFn();
438
- };
439
- }
440
- };
441
- }
442
- function getServerSnapshot() {
443
- return 0;
444
- }
445
- function useMediaIndex() {
446
- const $ = c(2), {
447
- media
448
- } = useTheme_v2();
449
- let t0;
450
- $[0] !== media ? (t0 = _createMediaStore(media), $[0] = media, $[1] = t0) : t0 = $[1];
451
- const store = t0;
452
- return useSyncExternalStore(store.subscribe, store.getSnapshot, getServerSnapshot);
453
- }
454
- function usePrefersDark(t0) {
455
- return useMatchMedia("(prefers-color-scheme: dark)", t0 === void 0 ? _temp$9 : t0);
456
- }
457
- function _temp$9() {
458
- return !1;
459
- }
460
- function usePrefersReducedMotion(t0) {
461
- return useMatchMedia("(prefers-reduced-motion: reduce)", t0 === void 0 ? _temp$8 : t0);
462
- }
463
- function _temp$8() {
464
- return !1;
245
+ return getTheme_v2(useTheme$1());
465
246
  }
466
247
  function responsiveBorderStyle() {
467
248
  return [border, borderTop, borderRight, borderBottom, borderLeft];
@@ -1176,30 +957,18 @@ const StyledLabel = /* @__PURE__ */ styled.div.withConfig({
1176
957
  displayName: "StyledLabel",
1177
958
  componentId: "sc-1luap7z-0"
1178
959
  })(responsiveLabelFont, responsiveTextAlignStyle, labelBaseStyle), Label = forwardRef(function(props, ref) {
1179
- const $ = c(22);
1180
- let accent, align, childrenProp, restProps, t0, t1, textOverflow, weight;
1181
- $[0] !== props ? ({
960
+ const {
1182
961
  accent,
1183
962
  align,
1184
963
  children: childrenProp,
1185
- muted: t0,
1186
- size: t1,
964
+ muted = !1,
965
+ size: size2 = 2,
1187
966
  textOverflow,
1188
967
  weight,
1189
968
  ...restProps
1190
- } = 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]);
1191
- const muted = t0 === void 0 ? !1 : t0, size2 = t1 === void 0 ? 2 : t1;
969
+ } = props;
1192
970
  let children = childrenProp;
1193
- if (textOverflow === "ellipsis") {
1194
- let t22;
1195
- $[9] !== children ? (t22 = /* @__PURE__ */ jsx(SpanWithTextOverflow, { children }), $[9] = children, $[10] = t22) : t22 = $[10], children = t22;
1196
- } else {
1197
- let t22;
1198
- $[11] !== children ? (t22 = /* @__PURE__ */ jsx("span", { children }), $[11] = children, $[12] = t22) : t22 = $[12], children = t22;
1199
- }
1200
- const t2 = useArrayProp(align), t3 = useArrayProp(size2);
1201
- let t4;
1202
- return $[13] !== accent || $[14] !== children || $[15] !== muted || $[16] !== ref || $[17] !== restProps || $[18] !== t2 || $[19] !== t3 || $[20] !== weight ? (t4 = /* @__PURE__ */ jsx(StyledLabel, { "data-ui": "Label", ...restProps, $accent: accent, $align: t2, $muted: muted, $size: t3, $weight: weight, ref, children }), $[13] = accent, $[14] = children, $[15] = muted, $[16] = ref, $[17] = restProps, $[18] = t2, $[19] = t3, $[20] = weight, $[21] = t4) : t4 = $[21], 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 });
1203
972
  });
1204
973
  Label.displayName = "ForwardRef(Label)";
1205
974
  const avatarStyle = {
@@ -1369,66 +1138,44 @@ const StyledAvatar = /* @__PURE__ */ styled.div.withConfig({
1369
1138
  displayName: "AvatarImage",
1370
1139
  componentId: "sc-1rj7kl0-6"
1371
1140
  })(avatarStyle.image), Avatar = forwardRef(function(props, ref) {
1372
- const $ = c(52);
1373
- let __unstable_hideInnerStroke, animateArrowFrom, arrowPositionProp, asProp, initials, onImageLoadError, restProps, src, t0, t1, t2, title;
1374
- $[0] !== props ? ({
1141
+ const {
1375
1142
  __unstable_hideInnerStroke,
1376
1143
  as: asProp,
1377
- color: t0,
1144
+ color = "gray",
1378
1145
  src,
1379
1146
  title,
1380
1147
  initials,
1381
1148
  onImageLoadError,
1382
1149
  arrowPosition: arrowPositionProp,
1383
1150
  animateArrowFrom,
1384
- status: t1,
1385
- size: t2,
1151
+ status = "online",
1152
+ size: sizeProp = 1,
1386
1153
  ...restProps
1387
- } = 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]);
1388
- const color = t0 === void 0 ? "gray" : t0, status = t1 === void 0 ? "online" : t1, sizeProp = t2 === void 0 ? 1 : t2, {
1154
+ } = props, {
1389
1155
  avatar
1390
- } = useTheme_v2(), as = ReactIs.isValidElementType(asProp) ? asProp : "div", size2 = useArrayProp(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}`;
1391
- let t3, t4;
1392
- $[13] !== arrowPosition || $[14] !== arrowPositionProp ? (t3 = () => {
1393
- if (arrowPosition === arrowPositionProp)
1394
- return;
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}`;
1157
+ useEffect(() => {
1158
+ if (arrowPosition === arrowPositionProp) return;
1395
1159
  const raf = requestAnimationFrame(() => setArrowPosition(arrowPositionProp));
1396
1160
  return () => cancelAnimationFrame(raf);
1397
- }, t4 = [arrowPosition, arrowPositionProp], $[13] = arrowPosition, $[14] = arrowPositionProp, $[15] = t3, $[16] = t4) : (t3 = $[15], t4 = $[16]), useEffect(t3, t4);
1398
- let t5, t6;
1399
- $[17] !== src ? (t5 = () => {
1161
+ }, [arrowPosition, arrowPositionProp]), useEffect(() => {
1400
1162
  src && setImageFailed(!1);
1401
- }, t6 = [src], $[17] = src, $[18] = t5, $[19] = t6) : (t5 = $[18], t6 = $[19]), useEffect(t5, t6);
1402
- let t7;
1403
- $[20] !== onImageLoadError ? (t7 = () => {
1163
+ }, [src]);
1164
+ const handleImageError = useCallback(() => {
1404
1165
  setImageFailed(!0), onImageLoadError && onImageLoadError(new Error("Avatar: the image failed to load"));
1405
- }, $[20] = onImageLoadError, $[21] = t7) : t7 = $[21];
1406
- const handleImageError = t7;
1407
- let t8;
1408
- $[22] !== size2 ? (t8 = size2.map(_temp$7), $[22] = size2, $[23] = t8) : t8 = $[23];
1409
- const initialsSize = t8, t9 = typeof as == "string" ? as : void 0;
1410
- let t10;
1411
- $[24] !== 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 }) }) }), $[24] = color, $[25] = t10) : t10 = $[25];
1412
- let t11;
1413
- $[26] !== __unstable_hideInnerStroke || $[27] !== _radius || $[28] !== _sizeRem || $[29] !== handleImageError || $[30] !== imageFailed || $[31] !== imageId || $[32] !== src ? (t11 = !imageFailed && src && /* @__PURE__ */ jsxs(AvatarImage, { viewBox: `0 0 ${_sizeRem} ${_sizeRem}`, fill: "none", children: [
1414
- /* @__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 }) }) }),
1415
- /* @__PURE__ */ jsx("circle", { cx: _radius, cy: _radius, r: _radius, fill: `url(#${imageId})` }),
1416
- !__unstable_hideInnerStroke && /* @__PURE__ */ jsx(BgStroke, { cx: _radius, cy: _radius, rx: _radius, ry: _radius, vectorEffect: "non-scaling-stroke" }),
1417
- /* @__PURE__ */ jsx(Stroke, { cx: _radius, cy: _radius, rx: _radius, ry: _radius, vectorEffect: "non-scaling-stroke" })
1418
- ] }), $[26] = __unstable_hideInnerStroke, $[27] = _radius, $[28] = _sizeRem, $[29] = handleImageError, $[30] = imageFailed, $[31] = imageId, $[32] = src, $[33] = t11) : t11 = $[33];
1419
- let t12;
1420
- $[34] !== imageFailed || $[35] !== initials || $[36] !== initialsSize || $[37] !== src ? (t12 = (imageFailed || !src) && initials && /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(Initials, { children: /* @__PURE__ */ jsx(InitialsLabel, { forwardedAs: "span", size: initialsSize, weight: "medium", children: initials }) }) }), $[34] = imageFailed, $[35] = initials, $[36] = initialsSize, $[37] = src, $[38] = t12) : t12 = $[38];
1421
- let t13;
1422
- return $[39] !== arrowPosition || $[40] !== as || $[41] !== color || $[42] !== ref || $[43] !== restProps || $[44] !== size2 || $[45] !== status || $[46] !== t10 || $[47] !== t11 || $[48] !== t12 || $[49] !== t9 || $[50] !== title ? (t13 = /* @__PURE__ */ jsxs(StyledAvatar, { as, "data-as": t9, "data-ui": "Avatar", ...restProps, $color: color, $size: size2, "aria-label": title, "data-arrow-position": arrowPosition, "data-status": status, ref, title, children: [
1423
- t10,
1424
- t11,
1425
- t12
1426
- ] }), $[39] = arrowPosition, $[40] = as, $[41] = color, $[42] = ref, $[43] = restProps, $[44] = size2, $[45] = status, $[46] = t10, $[47] = t11, $[48] = t12, $[49] = t9, $[50] = title, $[51] = t13) : t13 = $[51], 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
+ ] });
1427
1177
  });
1428
1178
  Avatar.displayName = "ForwardRef(Avatar)";
1429
- function _temp$7(s) {
1430
- return s === 1 ? 1 : s === 2 ? 3 : s === 3 ? 5 : 0;
1431
- }
1432
1179
  function _responsiveAvatarCounterSizeStyle(props) {
1433
1180
  const {
1434
1181
  avatar,
@@ -1469,22 +1216,13 @@ const StyledAvatarCounter = /* @__PURE__ */ styled.div.withConfig({
1469
1216
  displayName: "StyledAvatarCounter",
1470
1217
  componentId: "sc-1ydx86y-0"
1471
1218
  })(_responsiveAvatarCounterSizeStyle, _avatarCounterBaseStyle), AvatarCounter = forwardRef(function(props, ref) {
1472
- const $ = c(9), {
1219
+ const {
1473
1220
  count,
1474
- size: t0
1475
- } = props, size2 = useArrayProp(t0 === void 0 ? 1 : t0);
1476
- let t1;
1477
- $[0] !== size2 ? (t1 = size2.map(_temp$6), $[0] = size2, $[1] = t1) : t1 = $[1];
1478
- const fontSize2 = t1;
1479
- let t2;
1480
- $[2] !== count || $[3] !== fontSize2 ? (t2 = /* @__PURE__ */ jsx(Label, { as: "span", size: fontSize2, weight: "medium", children: count }), $[2] = count, $[3] = fontSize2, $[4] = t2) : t2 = $[4];
1481
- let t3;
1482
- return $[5] !== ref || $[6] !== size2 || $[7] !== t2 ? (t3 = /* @__PURE__ */ jsx(StyledAvatarCounter, { $size: size2, "data-ui": "AvatarCounter", ref, children: t2 }), $[5] = ref, $[6] = size2, $[7] = t2, $[8] = t3) : t3 = $[8], t3;
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 }) });
1483
1224
  });
1484
1225
  AvatarCounter.displayName = "ForwardRef(AvatarCounter)";
1485
- function _temp$6(s) {
1486
- return s === 1 ? 1 : s === 2 ? 3 : s === 3 ? 5 : 0;
1487
- }
1488
1226
  const BASE_STYLES = css`
1489
1227
  white-space: nowrap;
1490
1228
 
@@ -1517,47 +1255,34 @@ const StyledAvatarStack = /* @__PURE__ */ styled.div.withConfig({
1517
1255
  displayName: "StyledAvatarStack",
1518
1256
  componentId: "sc-cysmbb-0"
1519
1257
  })(responsiveAvatarStackSizeStyle, avatarStackStyle), AvatarStack = forwardRef(function(props, ref) {
1520
- const $ = c(22);
1521
- let childrenProp, restProps, t0, t1;
1522
- $[0] !== props ? ({
1258
+ const {
1523
1259
  children: childrenProp,
1524
- maxLength: t0,
1525
- size: t1,
1260
+ maxLength: maxLengthProp = 4,
1261
+ size: sizeProp = 1,
1526
1262
  ...restProps
1527
- } = props, $[0] = props, $[1] = childrenProp, $[2] = restProps, $[3] = t0, $[4] = t1) : (childrenProp = $[1], restProps = $[2], t0 = $[3], t1 = $[4]);
1528
- const maxLengthProp = t0 === void 0 ? 4 : t0, sizeProp = t1 === void 0 ? 1 : t1, children = Children.toArray(childrenProp).filter(isValidElement), maxLength = Math.max(maxLengthProp, 0), size2 = useArrayProp(sizeProp), len = children.length, visibleCount = maxLength - 1, extraCount = len - visibleCount, visibleChildren = extraCount > 1 ? children.slice(extraCount, len) : children, T0 = StyledAvatarStack, t2 = "AvatarStack";
1529
- let t3;
1530
- $[5] !== len || $[6] !== size2 ? (t3 = len === 0 && /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(AvatarCounter, { count: len, size: size2 }) }), $[5] = len, $[6] = size2, $[7] = t3) : t3 = $[7];
1531
- let t4;
1532
- $[8] !== extraCount || $[9] !== len || $[10] !== size2 ? (t4 = len !== 0 && extraCount > 1 && /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(AvatarCounter, { count: extraCount, size: size2 }) }), $[8] = extraCount, $[9] = len, $[10] = size2, $[11] = t4) : t4 = $[11];
1533
- let t5;
1534
- $[12] !== size2 ? (t5 = (child, childIndex) => /* @__PURE__ */ jsx("div", { children: cloneElement(child, {
1535
- size: size2
1536
- }) }, String(childIndex)), $[12] = size2, $[13] = t5) : t5 = $[13];
1537
- const t6 = visibleChildren.map(t5);
1538
- let t7;
1539
- return $[14] !== T0 || $[15] !== ref || $[16] !== restProps || $[17] !== size2 || $[18] !== t3 || $[19] !== t4 || $[20] !== t6 ? (t7 = /* @__PURE__ */ jsxs(T0, { "data-ui": t2, ...restProps, ref, $size: size2, children: [
1540
- t3,
1541
- t4,
1542
- t6
1543
- ] }), $[14] = T0, $[15] = ref, $[16] = restProps, $[17] = size2, $[18] = t3, $[19] = t4, $[20] = t6, $[21] = t7) : t7 = $[21], t7;
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, {
1268
+ size: size2
1269
+ }) }, String(childIndex)))
1270
+ ] });
1544
1271
  });
1545
1272
  AvatarStack.displayName = "ForwardRef(AvatarStack)";
1546
1273
  const StyledBox = /* @__PURE__ */ styled.div.withConfig({
1547
1274
  displayName: "StyledBox",
1548
1275
  componentId: "sc-1hhky9f-0"
1549
1276
  })(boxStyle, flexItemStyle, responsiveBoxStyle, responsiveGridItemStyle, responsiveMarginStyle, responsivePaddingStyle), Box = forwardRef(function(props, ref) {
1550
- const $ = c(59);
1551
- 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;
1552
- $[0] !== props ? ({
1553
- as: t0,
1277
+ const {
1278
+ as: asProp = "div",
1554
1279
  column,
1555
1280
  columnStart,
1556
1281
  columnEnd,
1557
- display: t1,
1282
+ display = "block",
1558
1283
  flex,
1559
1284
  height,
1560
- margin: t2,
1285
+ margin = 0,
1561
1286
  marginX,
1562
1287
  marginY,
1563
1288
  marginTop,
@@ -1565,7 +1290,7 @@ const StyledBox = /* @__PURE__ */ styled.div.withConfig({
1565
1290
  marginBottom,
1566
1291
  marginLeft,
1567
1292
  overflow,
1568
- padding: t3,
1293
+ padding = 0,
1569
1294
  paddingX,
1570
1295
  paddingY,
1571
1296
  paddingTop,
@@ -1577,10 +1302,8 @@ const StyledBox = /* @__PURE__ */ styled.div.withConfig({
1577
1302
  rowEnd,
1578
1303
  sizing,
1579
1304
  ...restProps
1580
- } = 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]);
1581
- 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, t5 = useArrayProp(column), t6 = useArrayProp(columnStart), t7 = useArrayProp(columnEnd), t8 = useArrayProp(display), t9 = useArrayProp(flex), t10 = useArrayProp(height), t11 = useArrayProp(margin), t12 = useArrayProp(marginX), t13 = useArrayProp(marginY), t14 = useArrayProp(marginTop), t15 = useArrayProp(marginRight), t16 = useArrayProp(marginBottom), t17 = useArrayProp(marginLeft), t18 = useArrayProp(overflow), t19 = useArrayProp(padding), t20 = useArrayProp(paddingX), t21 = useArrayProp(paddingY), t22 = useArrayProp(paddingTop), t23 = useArrayProp(paddingRight), t24 = useArrayProp(paddingBottom), t25 = useArrayProp(paddingLeft), t26 = useArrayProp(row), t27 = useArrayProp(rowStart), t28 = useArrayProp(rowEnd), t29 = useArrayProp(sizing);
1582
- let t30;
1583
- return $[28] !== asProp || $[29] !== props.children || $[30] !== ref || $[31] !== restProps || $[32] !== t10 || $[33] !== t11 || $[34] !== t12 || $[35] !== t13 || $[36] !== t14 || $[37] !== t15 || $[38] !== t16 || $[39] !== t17 || $[40] !== t18 || $[41] !== t19 || $[42] !== t20 || $[43] !== t21 || $[44] !== t22 || $[45] !== t23 || $[46] !== t24 || $[47] !== t25 || $[48] !== t26 || $[49] !== t27 || $[50] !== t28 || $[51] !== t29 || $[52] !== t4 || $[53] !== t5 || $[54] !== t6 || $[55] !== t7 || $[56] !== t8 || $[57] !== 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 }), $[28] = asProp, $[29] = props.children, $[30] = ref, $[31] = restProps, $[32] = t10, $[33] = t11, $[34] = t12, $[35] = t13, $[36] = t14, $[37] = t15, $[38] = t16, $[39] = t17, $[40] = t18, $[41] = t19, $[42] = t20, $[43] = t21, $[44] = t22, $[45] = t23, $[46] = t24, $[47] = t25, $[48] = t26, $[49] = t27, $[50] = t28, $[51] = t29, $[52] = t4, $[53] = t5, $[54] = t6, $[55] = t7, $[56] = t8, $[57] = t9, $[58] = t30) : t30 = $[58], 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 });
1584
1307
  });
1585
1308
  Box.displayName = "ForwardRef(Box)";
1586
1309
  function textBaseStyle(props) {
@@ -1655,29 +1378,18 @@ const StyledText = /* @__PURE__ */ styled.div.withConfig({
1655
1378
  displayName: "StyledText",
1656
1379
  componentId: "sc-11ov82j-0"
1657
1380
  })(responsiveTextFont, responsiveTextAlignStyle, textBaseStyle), Text = forwardRef(function(props, ref) {
1658
- const $ = c(22);
1659
- let align, childrenProp, restProps, t0, t1, t2, textOverflow, weight;
1660
- $[0] !== props ? ({
1661
- accent: t0,
1381
+ const {
1382
+ accent = !1,
1662
1383
  align,
1663
1384
  children: childrenProp,
1664
- muted: t1,
1665
- size: t2,
1385
+ muted = !1,
1386
+ size: size2 = 2,
1666
1387
  textOverflow,
1667
1388
  weight,
1668
1389
  ...restProps
1669
- } = 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]);
1670
- const accent = t0 === void 0 ? !1 : t0, muted = t1 === void 0 ? !1 : t1, size2 = t2 === void 0 ? 2 : t2;
1390
+ } = props;
1671
1391
  let children = childrenProp;
1672
- if (textOverflow === "ellipsis") {
1673
- let t32;
1674
- $[9] !== children ? (t32 = /* @__PURE__ */ jsx(SpanWithTextOverflow, { children }), $[9] = children, $[10] = t32) : t32 = $[10], children = t32;
1675
- }
1676
- const t3 = useArrayProp(align), t4 = useArrayProp(size2);
1677
- let t5;
1678
- $[11] !== children ? (t5 = /* @__PURE__ */ jsx("span", { children }), $[11] = children, $[12] = t5) : t5 = $[12];
1679
- let t6;
1680
- return $[13] !== accent || $[14] !== muted || $[15] !== ref || $[16] !== restProps || $[17] !== t3 || $[18] !== t4 || $[19] !== t5 || $[20] !== weight ? (t6 = /* @__PURE__ */ jsx(StyledText, { "data-ui": "Text", ...restProps, $accent: accent, $align: t3, $muted: muted, ref, $size: t4, $weight: weight, children: t5 }), $[13] = accent, $[14] = muted, $[15] = ref, $[16] = restProps, $[17] = t3, $[18] = t4, $[19] = t5, $[20] = weight, $[21] = t6) : t6 = $[21], 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 }) });
1681
1393
  });
1682
1394
  Text.displayName = "ForwardRef(Text)";
1683
1395
  function badgeStyle(props) {
@@ -1699,46 +1411,33 @@ const StyledBadge = /* @__PURE__ */ styled(Box).withConfig({
1699
1411
  displayName: "StyledBadge",
1700
1412
  componentId: "sc-5u140l-0"
1701
1413
  })(responsiveRadiusStyle, badgeStyle), Badge = forwardRef(function(props, ref) {
1702
- const $ = c(17);
1703
- let children, restProps, t0, t1, t2, t3;
1704
- if ($[0] !== props) {
1705
- const {
1706
- children: t42,
1707
- fontSize: t52,
1708
- mode: _deprecated_mode,
1709
- padding: t62,
1710
- radius: t72,
1711
- tone: t8,
1712
- ...t9
1713
- } = props;
1714
- 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;
1715
- } else
1716
- children = $[1], restProps = $[2], t0 = $[3], t1 = $[4], t2 = $[5], t3 = $[6];
1717
- 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, t4 = useArrayProp(radius), t5 = useArrayProp(padding);
1718
- let t6;
1719
- $[7] !== children || $[8] !== fontSize2 ? (t6 = /* @__PURE__ */ jsx(Text, { size: fontSize2, children }), $[7] = children, $[8] = fontSize2, $[9] = t6) : t6 = $[9];
1720
- let t7;
1721
- return $[10] !== ref || $[11] !== restProps || $[12] !== t4 || $[13] !== t5 || $[14] !== t6 || $[15] !== tone ? (t7 = /* @__PURE__ */ jsx(StyledBadge, { "data-ui": "Badge", ...restProps, $tone: tone, $radius: t4, padding: t5, ref, children: t6 }), $[10] = ref, $[11] = restProps, $[12] = t4, $[13] = t5, $[14] = t6, $[15] = tone, $[16] = t7) : t7 = $[16], 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 }) });
1722
1425
  });
1723
1426
  Badge.displayName = "ForwardRef(Badge)";
1724
1427
  const StyledFlex = /* @__PURE__ */ styled(Box).withConfig({
1725
1428
  displayName: "StyledFlex",
1726
1429
  componentId: "sc-oxesg3-0"
1727
1430
  })(flexItemStyle, responsiveFlexStyle), Flex = forwardRef(function(props, ref) {
1728
- const $ = c(17);
1729
- let align, as, gap, justify, restProps, t0, wrap;
1730
- $[0] !== props ? ({
1431
+ const {
1731
1432
  align,
1732
1433
  as,
1733
- direction: t0,
1434
+ direction = "row",
1734
1435
  gap,
1735
1436
  justify,
1736
1437
  wrap,
1737
1438
  ...restProps
1738
- } = 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]);
1739
- const direction = t0 === void 0 ? "row" : t0, t1 = useArrayProp(align), t2 = useArrayProp(direction), t3 = useArrayProp(gap), t4 = useArrayProp(justify), t5 = useArrayProp(wrap);
1740
- let t6;
1741
- return $[8] !== as || $[9] !== ref || $[10] !== restProps || $[11] !== t1 || $[12] !== t2 || $[13] !== t3 || $[14] !== t4 || $[15] !== t5 ? (t6 = /* @__PURE__ */ jsx(StyledFlex, { "data-ui": "Flex", ...restProps, $align: t1, $direction: t2, $gap: t3, $justify: t4, $wrap: t5, forwardedAs: as, ref }), $[8] = as, $[9] = ref, $[10] = restProps, $[11] = t1, $[12] = t2, $[13] = t3, $[14] = t4, $[15] = t5, $[16] = t6) : t6 = $[16], 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 });
1742
1441
  });
1743
1442
  Flex.displayName = "ForwardRef(Flex)";
1744
1443
  const rotate = keyframes`
@@ -1753,11 +1452,7 @@ const rotate = keyframes`
1753
1452
  displayName: "StyledSpinner",
1754
1453
  componentId: "sc-124hnd0-0"
1755
1454
  })`& > span > svg{animation:${rotate} 500ms linear infinite;}`, Spinner = forwardRef(function(props, ref) {
1756
- const $ = c(4);
1757
- let t0;
1758
- $[0] === Symbol.for("react.memo_cache_sentinel") ? (t0 = /* @__PURE__ */ jsx(SpinnerIcon, {}), $[0] = t0) : t0 = $[0];
1759
- let t1;
1760
- 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, {}) });
1761
1456
  });
1762
1457
  Spinner.displayName = "ForwardRef(Spinner)";
1763
1458
  function _cardColorStyle(base, color, checkered = !1) {
@@ -1935,41 +1630,37 @@ const StyledButton = /* @__PURE__ */ styled.button.withConfig({
1935
1630
  displayName: "LoadingBox",
1936
1631
  componentId: "sc-aaekt4-1"
1937
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) {
1938
- const $ = c(66);
1939
- 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;
1940
- $[0] !== props ? ({
1633
+ const {
1941
1634
  children,
1942
1635
  disabled,
1943
- fontSize: t0,
1636
+ fontSize: fontSize2 = 1,
1944
1637
  icon: IconComponent,
1945
1638
  iconRight: IconRightComponent,
1946
- justify: t1,
1639
+ justify: justifyProp = "center",
1947
1640
  loading,
1948
- mode: t2,
1949
- padding: t3,
1641
+ mode = "default",
1642
+ padding: paddingProp = 3,
1950
1643
  paddingX: paddingXProp,
1951
1644
  paddingY: paddingYProp,
1952
1645
  paddingTop: paddingTopProp,
1953
1646
  paddingBottom: paddingBottomProp,
1954
1647
  paddingLeft: paddingLeftProp,
1955
1648
  paddingRight: paddingRightProp,
1956
- radius: t4,
1649
+ radius: radiusProp = 2,
1957
1650
  selected,
1958
- space: t5,
1651
+ space: spaceProp = 3,
1959
1652
  text,
1960
1653
  textAlign,
1961
1654
  textWeight,
1962
- tone: t6,
1963
- type: t7,
1964
- muted: t8,
1655
+ tone = "default",
1656
+ type = "button",
1657
+ muted = !1,
1965
1658
  width,
1966
1659
  ...restProps
1967
- } = 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]);
1968
- 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, {
1969
1661
  button
1970
- } = useTheme_v2(), justify = useArrayProp(justifyProp), padding = useArrayProp(paddingProp), paddingX = useArrayProp(paddingXProp), paddingY = useArrayProp(paddingYProp), paddingTop = useArrayProp(paddingTopProp), paddingBottom = useArrayProp(paddingBottomProp), paddingLeft = useArrayProp(paddingLeftProp), paddingRight = useArrayProp(paddingRightProp), radius = useArrayProp(radiusProp), space = useArrayProp(spaceProp);
1971
- let t9;
1972
- $[27] !== padding || $[28] !== paddingBottom || $[29] !== paddingLeft || $[30] !== paddingRight || $[31] !== paddingTop || $[32] !== paddingX || $[33] !== paddingY ? (t9 = {
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,
1973
1664
  padding,
1974
1665
  paddingX,
1975
1666
  paddingY,
@@ -1977,30 +1668,22 @@ const StyledButton = /* @__PURE__ */ styled.button.withConfig({
1977
1668
  paddingBottom,
1978
1669
  paddingLeft,
1979
1670
  paddingRight
1980
- }, $[27] = padding, $[28] = paddingBottom, $[29] = paddingLeft, $[30] = paddingRight, $[31] = paddingTop, $[32] = paddingX, $[33] = paddingY, $[34] = t9) : t9 = $[34];
1981
- const boxProps = t9, t10 = !!(loading || disabled), t11 = selected ? "" : void 0, t12 = !!(loading || disabled);
1982
- let t13;
1983
- $[35] !== loading ? (t13 = !!loading && /* @__PURE__ */ jsx(LoadingBox, { children: /* @__PURE__ */ jsx(Spinner, {}) }), $[35] = loading, $[36] = t13) : t13 = $[36];
1984
- let t14;
1985
- $[37] !== IconComponent || $[38] !== IconRightComponent || $[39] !== boxProps || $[40] !== button || $[41] !== fontSize2 || $[42] !== justify || $[43] !== muted || $[44] !== space || $[45] !== text || $[46] !== textAlign || $[47] !== textWeight ? (t14 = (IconComponent || text || IconRightComponent) && /* @__PURE__ */ jsx(Box, { as: "span", ...boxProps, children: /* @__PURE__ */ jsxs(Flex, { as: "span", justify, gap: space, children: [
1986
- IconComponent && /* @__PURE__ */ jsxs(Text, { size: fontSize2, children: [
1987
- isValidElement(IconComponent) && IconComponent,
1988
- isValidElementType(IconComponent) && /* @__PURE__ */ jsx(IconComponent, {})
1989
- ] }),
1990
- text && /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(Text, { muted, align: textAlign, size: fontSize2, textOverflow: "ellipsis", weight: textWeight ?? button.textWeight, children: text }) }),
1991
- IconRightComponent && /* @__PURE__ */ jsxs(Text, { size: fontSize2, children: [
1992
- isValidElement(IconRightComponent) && IconRightComponent,
1993
- isValidElementType(IconRightComponent) && /* @__PURE__ */ jsx(IconRightComponent, {})
1994
- ] })
1995
- ] }) }), $[37] = IconComponent, $[38] = IconRightComponent, $[39] = boxProps, $[40] = button, $[41] = fontSize2, $[42] = justify, $[43] = muted, $[44] = space, $[45] = text, $[46] = textAlign, $[47] = textWeight, $[48] = t14) : t14 = $[48];
1996
- let t15;
1997
- $[49] !== boxProps || $[50] !== children ? (t15 = children && /* @__PURE__ */ jsx(Box, { as: "span", ...boxProps, children }), $[49] = boxProps, $[50] = children, $[51] = t15) : t15 = $[51];
1998
- let t16;
1999
- return $[52] !== mode || $[53] !== radius || $[54] !== ref || $[55] !== restProps || $[56] !== t10 || $[57] !== t11 || $[58] !== t12 || $[59] !== t13 || $[60] !== t14 || $[61] !== t15 || $[62] !== tone || $[63] !== type || $[64] !== width ? (t16 = /* @__PURE__ */ jsxs(StyledButton, { "data-ui": "Button", ...restProps, $mode: mode, $radius: radius, $tone: tone, "data-disabled": t10, "data-selected": t11, disabled: t12, ref, type, $width: width, children: [
2000
- t13,
2001
- t14,
2002
- t15
2003
- ] }), $[52] = mode, $[53] = radius, $[54] = ref, $[55] = restProps, $[56] = t10, $[57] = t11, $[58] = t12, $[59] = t13, $[60] = t14, $[61] = t15, $[62] = tone, $[63] = type, $[64] = width, $[65] = t16) : t16 = $[65], t16;
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
+ ] });
2004
1687
  });
2005
1688
  Button.displayName = "ForwardRef(Button)";
2006
1689
  function cardStyle(props) {
@@ -2155,11 +1838,9 @@ const StyledCard = /* @__PURE__ */ styled(Box).withConfig({
2155
1838
  displayName: "StyledCard",
2156
1839
  componentId: "sc-osnro2-0"
2157
1840
  })(responsiveBorderStyle, responsiveRadiusStyle, responsiveShadowStyle, cardStyle), Card = forwardRef(function(props, ref) {
2158
- const $ = c(42);
2159
- let asProp, border2, borderBottom2, borderLeft2, borderRight2, borderTop2, muted, pressed, restProps, scheme, selected, shadow, t0, t1, t2, t3;
2160
- $[0] !== props ? ({
2161
- __unstable_checkered: t0,
2162
- __unstable_focusRing: t1,
1841
+ const {
1842
+ __unstable_checkered: checkered = !1,
1843
+ __unstable_focusRing: focusRing = !1,
2163
1844
  as: asProp,
2164
1845
  border: border2,
2165
1846
  borderTop: borderTop2,
@@ -2168,20 +1849,164 @@ const StyledCard = /* @__PURE__ */ styled(Box).withConfig({
2168
1849
  borderLeft: borderLeft2,
2169
1850
  muted,
2170
1851
  pressed,
2171
- radius: t2,
1852
+ radius = 0,
2172
1853
  scheme,
2173
1854
  selected,
2174
1855
  shadow,
2175
- tone: t3,
1856
+ tone: toneProp = "default",
2176
1857
  ...restProps
2177
- } = 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]);
2178
- 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, t6 = useArrayProp(border2), t7 = useArrayProp(borderTop2), t8 = useArrayProp(borderRight2), t9 = useArrayProp(borderBottom2), t10 = useArrayProp(borderLeft2), t11 = useArrayProp(radius), t12 = useArrayProp(shadow), t13 = checkered ? "" : void 0, t14 = pressed ? "" : void 0, t15 = selected ? "" : void 0;
2179
- let t16;
2180
- $[17] !== as || $[18] !== checkered || $[19] !== focusRing || $[20] !== muted || $[21] !== ref || $[22] !== restProps || $[23] !== rootTheme.scheme || $[24] !== selected || $[25] !== t10 || $[26] !== t11 || $[27] !== t12 || $[28] !== t13 || $[29] !== t14 || $[30] !== t15 || $[31] !== t4 || $[32] !== t6 || $[33] !== t7 || $[34] !== t8 || $[35] !== t9 || $[36] !== 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 }), $[17] = as, $[18] = checkered, $[19] = focusRing, $[20] = muted, $[21] = ref, $[22] = restProps, $[23] = rootTheme.scheme, $[24] = selected, $[25] = t10, $[26] = t11, $[27] = t12, $[28] = t13, $[29] = t14, $[30] = t15, $[31] = t4, $[32] = t6, $[33] = t7, $[34] = t8, $[35] = t9, $[36] = tone, $[37] = t16) : t16 = $[37];
2181
- let t17;
2182
- return $[38] !== scheme || $[39] !== t16 || $[40] !== tone ? (t17 = /* @__PURE__ */ jsx(ThemeColorProvider, { scheme, tone, children: t16 }), $[38] = scheme, $[39] = t16, $[40] = tone, $[41] = t17) : t17 = $[41], 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 }) });
2183
1860
  });
2184
1861
  Card.displayName = "ForwardRef(Card)";
1862
+ function useClickOutsideEvent(listener, elementsArg = () => EMPTY_ARRAY, boundaryElement) {
1863
+ const onEvent = useEffectEvent((evt) => {
1864
+ if (!listener)
1865
+ return;
1866
+ const target = evt.target;
1867
+ if (!(target instanceof Node))
1868
+ return;
1869
+ const resolvedBoundaryElement = boundaryElement?.();
1870
+ if (resolvedBoundaryElement && !resolvedBoundaryElement.contains(target))
1871
+ return;
1872
+ const elements = elementsArg().flat();
1873
+ for (const el of elements)
1874
+ if (el && (target === el || el.contains(target)))
1875
+ return;
1876
+ listener(evt);
1877
+ }), hasListener = !!listener;
1878
+ useEffect(() => {
1879
+ if (!hasListener) return;
1880
+ const handleEvent = (evt) => onEvent(evt);
1881
+ return document.addEventListener("mousedown", handleEvent), () => {
1882
+ document.removeEventListener("mousedown", handleEvent);
1883
+ };
1884
+ }, [hasListener]), useDebugValue(listener ? "MouseDown On" : "MouseDown Off");
1885
+ }
1886
+ function useCustomValidity(ref, customValidity) {
1887
+ useEffect(() => {
1888
+ ref.current?.setCustomValidity(customValidity || "");
1889
+ }, [customValidity, ref]);
1890
+ }
1891
+ const _ResizeObserver = typeof document < "u" && typeof window < "u" && window.ResizeObserver ? window.ResizeObserver : ResizeObserver, _elementSizeObserver = _createElementSizeObserver();
1892
+ function _createElementRectValueListener() {
1893
+ return {
1894
+ subscribe(element, subscriber) {
1895
+ const resizeObserver = new _ResizeObserver(([entry]) => {
1896
+ subscriber({
1897
+ _contentRect: entry.contentRect,
1898
+ border: {
1899
+ width: entry.borderBoxSize[0].inlineSize,
1900
+ height: entry.borderBoxSize[0].blockSize
1901
+ },
1902
+ content: {
1903
+ width: entry.contentRect.width,
1904
+ height: entry.contentRect.height
1905
+ }
1906
+ });
1907
+ });
1908
+ return resizeObserver.observe(element), () => {
1909
+ resizeObserver.unobserve(element), resizeObserver.disconnect();
1910
+ };
1911
+ }
1912
+ };
1913
+ }
1914
+ function _createElementSizeObserver() {
1915
+ const disposeCache = /* @__PURE__ */ new WeakMap(), subscribersCache = /* @__PURE__ */ new WeakMap();
1916
+ return {
1917
+ subscribe(element, subscriber) {
1918
+ const subscribers = subscribersCache.get(element) || [];
1919
+ let dispose = disposeCache.get(element);
1920
+ return subscribersCache.has(element) || (subscribersCache.set(element, subscribers), dispose = _createElementRectValueListener().subscribe(element, (elementRect) => {
1921
+ for (const sub of subscribers)
1922
+ sub(elementRect);
1923
+ })), subscribers.push(subscriber), () => {
1924
+ const idx = subscribers.indexOf(subscriber);
1925
+ idx > -1 && subscribers.splice(idx, 1), subscribers.length === 0 && dispose && dispose();
1926
+ };
1927
+ }
1928
+ };
1929
+ }
1930
+ function useElementSize(element) {
1931
+ const [size2, setSize] = useState(null);
1932
+ return useEffect(() => {
1933
+ if (element)
1934
+ return _elementSizeObserver.subscribe(element, setSize);
1935
+ }, [element]), size2;
1936
+ }
1937
+ function useGlobalKeyDown(onKeyDown) {
1938
+ const handleKeyDown = useEffectEvent((event) => onKeyDown(event));
1939
+ useEffect(() => {
1940
+ const handler = (event) => handleKeyDown(event);
1941
+ return window.addEventListener("keydown", handler), () => window.removeEventListener("keydown", handler);
1942
+ }, []);
1943
+ }
1944
+ function useMatchMedia(mediaQueryString, getServerSnapshot2) {
1945
+ return useDebugValue(mediaQueryString), useSyncExternalStore(useCallback((onStoreChange) => {
1946
+ const media = window.matchMedia(mediaQueryString);
1947
+ return media.addEventListener("change", onStoreChange), () => media.removeEventListener("change", onStoreChange);
1948
+ }, [mediaQueryString]), () => window.matchMedia(mediaQueryString).matches, getServerSnapshot2);
1949
+ }
1950
+ function _getMediaQuery(media, index) {
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)`;
1952
+ }
1953
+ function _createMediaStore(media) {
1954
+ const mediaLen = media.length;
1955
+ let sizes;
1956
+ const getSizes = () => {
1957
+ if (!sizes) {
1958
+ sizes = [];
1959
+ for (let index = mediaLen; index > -1; index -= 1) {
1960
+ const mediaQuery = _getMediaQuery(media, index);
1961
+ sizes.push({
1962
+ index,
1963
+ mq: window.matchMedia(mediaQuery)
1964
+ });
1965
+ }
1966
+ }
1967
+ return sizes;
1968
+ };
1969
+ return {
1970
+ getSnapshot: () => {
1971
+ for (const {
1972
+ index,
1973
+ mq
1974
+ } of getSizes())
1975
+ if (mq.matches) return index;
1976
+ return 0;
1977
+ },
1978
+ subscribe: (onStoreChange) => {
1979
+ const disposeFns = [];
1980
+ for (const {
1981
+ mq
1982
+ } of getSizes()) {
1983
+ const handleChange = () => {
1984
+ mq.matches && onStoreChange();
1985
+ };
1986
+ mq.addEventListener("change", handleChange), disposeFns.push(() => mq.removeEventListener("change", handleChange));
1987
+ }
1988
+ return () => {
1989
+ for (const disposeFn of disposeFns)
1990
+ disposeFn();
1991
+ };
1992
+ }
1993
+ };
1994
+ }
1995
+ function getServerSnapshot() {
1996
+ return 0;
1997
+ }
1998
+ function useMediaIndex() {
1999
+ const {
2000
+ media
2001
+ } = useTheme_v2(), store = useMemo(() => _createMediaStore(media), [media]);
2002
+ return useSyncExternalStore(store.subscribe, store.getSnapshot, getServerSnapshot);
2003
+ }
2004
+ function usePrefersDark(getServerSnapshot2 = () => !1) {
2005
+ return useMatchMedia("(prefers-color-scheme: dark)", getServerSnapshot2);
2006
+ }
2007
+ function usePrefersReducedMotion(getServerSnapshot2 = () => !1) {
2008
+ return useMatchMedia("(prefers-reduced-motion: reduce)", getServerSnapshot2);
2009
+ }
2185
2010
  function checkboxBaseStyles() {
2186
2011
  return css`
2187
2012
  position: relative;
@@ -2327,9 +2152,7 @@ const StyledCheckbox = /* @__PURE__ */ styled.div.withConfig({
2327
2152
  displayName: "Input",
2328
2153
  componentId: "sc-1l5mt2l-1"
2329
2154
  })(inputElementStyles), Checkbox = forwardRef(function(props, forwardedRef) {
2330
- const $ = c(25);
2331
- let checked, className, customValidity, disabled, indeterminate, readOnly, restProps, style;
2332
- $[0] !== props ? ({
2155
+ const {
2333
2156
  checked,
2334
2157
  className,
2335
2158
  disabled,
@@ -2338,27 +2161,16 @@ const StyledCheckbox = /* @__PURE__ */ styled.div.withConfig({
2338
2161
  readOnly,
2339
2162
  style,
2340
2163
  ...restProps
2341
- } = 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]);
2342
- const ref = useRef(null);
2343
- let t0;
2344
- $[9] === Symbol.for("react.memo_cache_sentinel") ? (t0 = () => ref.current, $[9] = t0) : t0 = $[9], useImperativeHandle(forwardedRef, t0);
2345
- let t1, t2;
2346
- $[10] !== indeterminate ? (t1 = () => {
2164
+ } = props, ref = useRef(null);
2165
+ return useImperativeHandle(forwardedRef, () => ref.current), useEffect(() => {
2347
2166
  ref.current && (ref.current.indeterminate = indeterminate || !1);
2348
- }, t2 = [indeterminate], $[10] = indeterminate, $[11] = t1, $[12] = t2) : (t1 = $[11], t2 = $[12]), useEffect(t1, t2), useCustomValidity(ref, customValidity);
2349
- const t3 = !disabled && readOnly ? "" : void 0, t4 = customValidity ? "" : void 0, t5 = disabled || readOnly;
2350
- let t6;
2351
- $[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];
2352
- let t7;
2353
- $[20] === Symbol.for("react.memo_cache_sentinel") ? (t7 = /* @__PURE__ */ jsxs("span", { children: [
2354
- /* @__PURE__ */ jsx(CheckmarkIcon, {}),
2355
- /* @__PURE__ */ jsx(RemoveIcon, {})
2356
- ] }), $[20] = t7) : t7 = $[20];
2357
- let t8;
2358
- return $[21] !== className || $[22] !== style || $[23] !== t6 ? (t8 = /* @__PURE__ */ jsxs(StyledCheckbox, { className, "data-ui": "Checkbox", style, children: [
2359
- t6,
2360
- t7
2361
- ] }), $[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
+ ] });
2362
2174
  });
2363
2175
  Checkbox.displayName = "ForwardRef(Checkbox)";
2364
2176
  function codeSyntaxHighlightingStyle({
@@ -2513,24 +2325,14 @@ const LazyRefractor = lazy(() => import("./refractor.mjs")), StyledCode = /* @__
2513
2325
  displayName: "StyledCode",
2514
2326
  componentId: "sc-4dymyn-0"
2515
2327
  })(codeBaseStyle, responsiveCodeFontStyle), Code = forwardRef(function(props, ref) {
2516
- const $ = c(20);
2517
- let children, language, restProps, t0, weight;
2518
- $[0] !== props ? ({
2328
+ const {
2519
2329
  children,
2520
2330
  language,
2521
- size: t0,
2331
+ size: size2 = 2,
2522
2332
  weight,
2523
2333
  ...restProps
2524
- } = props, $[0] = props, $[1] = children, $[2] = language, $[3] = restProps, $[4] = t0, $[5] = weight) : (children = $[1], language = $[2], restProps = $[3], t0 = $[4], weight = $[5]);
2525
- const t1 = useArrayProp(t0 === void 0 ? 2 : t0);
2526
- let t2;
2527
- $[6] !== children ? (t2 = /* @__PURE__ */ jsx("code", { children }), $[6] = children, $[7] = t2) : t2 = $[7];
2528
- let t3;
2529
- $[8] !== children || $[9] !== language ? (t3 = /* @__PURE__ */ jsx(LazyRefractor, { language, value: children }), $[8] = children, $[9] = language, $[10] = t3) : t3 = $[10];
2530
- let t4;
2531
- $[11] !== t2 || $[12] !== t3 ? (t4 = /* @__PURE__ */ jsx(Suspense, { fallback: t2, children: t3 }), $[11] = t2, $[12] = t3, $[13] = t4) : t4 = $[13];
2532
- let t5;
2533
- return $[14] !== ref || $[15] !== restProps || $[16] !== t1 || $[17] !== t4 || $[18] !== weight ? (t5 = /* @__PURE__ */ jsx(StyledCode, { "data-ui": "Code", ...restProps, $size: t1, $weight: weight, ref, children: t4 }), $[14] = ref, $[15] = restProps, $[16] = t1, $[17] = t4, $[18] = weight, $[19] = t5) : t5 = $[19], 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 }) }) });
2534
2336
  });
2535
2337
  Code.displayName = "ForwardRef(Code)";
2536
2338
  const BASE_STYLE$1 = {
@@ -2553,25 +2355,19 @@ const StyledContainer = /* @__PURE__ */ styled(Box).withConfig({
2553
2355
  displayName: "StyledContainer",
2554
2356
  componentId: "sc-wyroop-0"
2555
2357
  })(containerBaseStyle, responsiveContainerWidthStyle), Container = forwardRef(function(props, ref) {
2556
- const $ = c(9);
2557
- let as, restProps, t0;
2558
- $[0] !== props ? ({
2358
+ const {
2559
2359
  as,
2560
- width: t0,
2360
+ width = 2,
2561
2361
  ...restProps
2562
- } = props, $[0] = props, $[1] = as, $[2] = restProps, $[3] = t0) : (as = $[1], restProps = $[2], t0 = $[3]);
2563
- const t1 = useArrayProp(t0 === void 0 ? 2 : t0);
2564
- let t2;
2565
- return $[4] !== as || $[5] !== ref || $[6] !== restProps || $[7] !== t1 ? (t2 = /* @__PURE__ */ jsx(StyledContainer, { "data-ui": "Container", ...restProps, $width: t1, forwardedAs: as, ref }), $[4] = as, $[5] = ref, $[6] = restProps, $[7] = t1, $[8] = t2) : t2 = $[8], t2;
2362
+ } = props;
2363
+ return /* @__PURE__ */ jsx(StyledContainer, { "data-ui": "Container", ...restProps, $width: _getArrayProp(width), forwardedAs: as, ref });
2566
2364
  });
2567
2365
  Container.displayName = "ForwardRef(Container)";
2568
2366
  const StyledGrid = /* @__PURE__ */ styled(Box).withConfig({
2569
2367
  displayName: "StyledGrid",
2570
2368
  componentId: "sc-v8t8oz-0"
2571
2369
  })(responsiveGridStyle), Grid = forwardRef(function(props, ref) {
2572
- const $ = c(26);
2573
- let as, autoCols, autoFlow, autoRows, children, columns, gap, gapX, gapY, restProps, rows;
2574
- $[0] !== props ? ({
2370
+ const {
2575
2371
  as,
2576
2372
  autoRows,
2577
2373
  autoCols,
@@ -2583,10 +2379,8 @@ const StyledGrid = /* @__PURE__ */ styled(Box).withConfig({
2583
2379
  rows,
2584
2380
  children,
2585
2381
  ...restProps
2586
- } = 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]);
2587
- const t0 = typeof as == "string" ? as : void 0, t1 = useArrayProp(autoRows), t2 = useArrayProp(autoCols), t3 = useArrayProp(autoFlow), t4 = useArrayProp(columns), t5 = useArrayProp(gap), t6 = useArrayProp(gapX), t7 = useArrayProp(gapY), t8 = useArrayProp(rows);
2588
- let t9;
2589
- return $[12] !== as || $[13] !== children || $[14] !== ref || $[15] !== restProps || $[16] !== t0 || $[17] !== t1 || $[18] !== t2 || $[19] !== t3 || $[20] !== t4 || $[21] !== t5 || $[22] !== t6 || $[23] !== t7 || $[24] !== 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 }), $[12] = as, $[13] = children, $[14] = ref, $[15] = restProps, $[16] = t0, $[17] = t1, $[18] = t2, $[19] = t3, $[20] = t4, $[21] = t5, $[22] = t6, $[23] = t7, $[24] = t8, $[25] = t9) : t9 = $[25], 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 });
2590
2384
  });
2591
2385
  Grid.displayName = "ForwardRef(Grid)";
2592
2386
  function headingBaseStyle(props) {
@@ -2652,29 +2446,18 @@ const StyledHeading = /* @__PURE__ */ styled.div.withConfig({
2652
2446
  displayName: "StyledHeading",
2653
2447
  componentId: "sc-137lwim-0"
2654
2448
  })(headingBaseStyle, responsiveTextAlignStyle, responsiveHeadingFont), Heading = forwardRef(function(props, ref) {
2655
- const $ = c(22);
2656
- let align, childrenProp, restProps, t0, t1, t2, textOverflow, weight;
2657
- $[0] !== props ? ({
2658
- accent: t0,
2449
+ const {
2450
+ accent = !1,
2659
2451
  align,
2660
2452
  children: childrenProp,
2661
- muted: t1,
2662
- size: t2,
2453
+ muted = !1,
2454
+ size: size2 = 2,
2663
2455
  textOverflow,
2664
2456
  weight,
2665
2457
  ...restProps
2666
- } = 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]);
2667
- const accent = t0 === void 0 ? !1 : t0, muted = t1 === void 0 ? !1 : t1, size2 = t2 === void 0 ? 2 : t2;
2458
+ } = props;
2668
2459
  let children = childrenProp;
2669
- if (textOverflow === "ellipsis") {
2670
- let t32;
2671
- $[9] !== children ? (t32 = /* @__PURE__ */ jsx(SpanWithTextOverflow, { children }), $[9] = children, $[10] = t32) : t32 = $[10], children = t32;
2672
- }
2673
- const t3 = useArrayProp(align), t4 = useArrayProp(size2);
2674
- let t5;
2675
- $[11] !== children ? (t5 = /* @__PURE__ */ jsx("span", { children }), $[11] = children, $[12] = t5) : t5 = $[12];
2676
- let t6;
2677
- return $[13] !== accent || $[14] !== muted || $[15] !== ref || $[16] !== restProps || $[17] !== t3 || $[18] !== t4 || $[19] !== t5 || $[20] !== weight ? (t6 = /* @__PURE__ */ jsx(StyledHeading, { "data-ui": "Heading", ...restProps, $accent: accent, $align: t3, $muted: muted, $size: t4, $weight: weight, ref, children: t5 }), $[13] = accent, $[14] = muted, $[15] = ref, $[16] = restProps, $[17] = t3, $[18] = t4, $[19] = t5, $[20] = weight, $[21] = t6) : t6 = $[21], 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 }) });
2678
2461
  });
2679
2462
  Heading.displayName = "ForwardRef(Heading)";
2680
2463
  function inlineBaseStyle() {
@@ -2708,24 +2491,15 @@ const StyledInline = /* @__PURE__ */ styled(Box).withConfig({
2708
2491
  displayName: "StyledInline",
2709
2492
  componentId: "sc-1pkiy6j-0"
2710
2493
  })(inlineBaseStyle, inlineSpaceStyle), Inline = forwardRef(function(props, ref) {
2711
- const $ = c(13);
2712
- let as, childrenProp, restProps, space;
2713
- $[0] !== props ? ({
2494
+ const {
2714
2495
  as,
2715
2496
  children: childrenProp,
2716
2497
  space,
2717
2498
  ...restProps
2718
- } = props, $[0] = props, $[1] = as, $[2] = childrenProp, $[3] = restProps, $[4] = space) : (as = $[1], childrenProp = $[2], restProps = $[3], space = $[4]);
2719
- let t0;
2720
- $[5] !== childrenProp ? (t0 = Children.map(childrenProp, _temp$5), $[5] = childrenProp, $[6] = t0) : t0 = $[6];
2721
- const children = t0, t1 = useArrayProp(space), t2 = ref;
2722
- let t3;
2723
- return $[7] !== as || $[8] !== children || $[9] !== restProps || $[10] !== t1 || $[11] !== t2 ? (t3 = /* @__PURE__ */ jsx(StyledInline, { "data-ui": "Inline", ...restProps, $space: t1, forwardedAs: as, ref: t2, children }), $[7] = as, $[8] = children, $[9] = restProps, $[10] = t1, $[11] = t2, $[12] = t3) : t3 = $[12], 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 });
2724
2501
  });
2725
2502
  Inline.displayName = "ForwardRef(Inline)";
2726
- function _temp$5(child) {
2727
- return child && /* @__PURE__ */ jsx("div", { children: child });
2728
- }
2729
2503
  function kbdStyle() {
2730
2504
  return css`
2731
2505
  --card-bg-color: var(--card-kbd-bg-color);
@@ -2747,22 +2521,14 @@ const StyledKBD = /* @__PURE__ */ styled.kbd.withConfig({
2747
2521
  displayName: "StyledKBD",
2748
2522
  componentId: "sc-1w7yd8w-0"
2749
2523
  })(responsiveRadiusStyle, kbdStyle), KBD = forwardRef(function(props, ref) {
2750
- const $ = c(17);
2751
- let children, restProps, t0, t1, t2;
2752
- $[0] !== props ? ({
2524
+ const {
2753
2525
  children,
2754
- fontSize: t0,
2755
- padding: t1,
2756
- radius: t2,
2526
+ fontSize: fontSize2 = 0,
2527
+ padding = 1,
2528
+ radius = 2,
2757
2529
  ...restProps
2758
- } = props, $[0] = props, $[1] = children, $[2] = restProps, $[3] = t0, $[4] = t1, $[5] = t2) : (children = $[1], restProps = $[2], t0 = $[3], t1 = $[4], t2 = $[5]);
2759
- const fontSize2 = t0 === void 0 ? 0 : t0, padding = t1 === void 0 ? 1 : t1, t3 = useArrayProp(t2 === void 0 ? 2 : t2);
2760
- let t4;
2761
- $[6] !== children || $[7] !== fontSize2 ? (t4 = /* @__PURE__ */ jsx(Text, { as: "span", size: fontSize2, weight: "semibold", children }), $[6] = children, $[7] = fontSize2, $[8] = t4) : t4 = $[8];
2762
- let t5;
2763
- $[9] !== padding || $[10] !== t4 ? (t5 = /* @__PURE__ */ jsx(Box, { as: "span", padding, children: t4 }), $[9] = padding, $[10] = t4, $[11] = t5) : t5 = $[11];
2764
- let t6;
2765
- return $[12] !== ref || $[13] !== restProps || $[14] !== t3 || $[15] !== t5 ? (t6 = /* @__PURE__ */ jsx(StyledKBD, { "data-ui": "KBD", ...restProps, $radius: t3, ref, children: t5 }), $[12] = ref, $[13] = restProps, $[14] = t3, $[15] = t5, $[16] = t6) : t6 = $[16], 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 }) }) });
2766
2532
  });
2767
2533
  KBD.displayName = "ForwardRef(KBD)";
2768
2534
  const origin = {
@@ -2890,15 +2656,12 @@ const StyledArrow = /* @__PURE__ */ styled.div.withConfig({
2890
2656
  displayName: "ShapePath",
2891
2657
  componentId: "sc-12vzy6c-2"
2892
2658
  })`fill:var(--card-bg-color);`, Arrow = forwardRef(function(props, ref) {
2893
- const $ = c(24);
2894
- let h, restProps, t0, w;
2895
- $[0] !== props ? ({
2659
+ const {
2896
2660
  width: w,
2897
2661
  height: h,
2898
- radius: t0,
2662
+ radius = 0,
2899
2663
  ...restProps
2900
- } = props, $[0] = props, $[1] = h, $[2] = restProps, $[3] = t0, $[4] = w) : (h = $[1], restProps = $[2], t0 = $[3], w = $[4]);
2901
- const radius = t0 === void 0 ? 0 : t0, {
2664
+ } = props, {
2902
2665
  card
2903
2666
  } = useTheme_v2(), strokeWidth = card.shadow.outline, center = w / 2, points = [{
2904
2667
  x: 0,
@@ -2918,38 +2681,24 @@ const StyledArrow = /* @__PURE__ */ styled.div.withConfig({
2918
2681
  }, {
2919
2682
  x: w,
2920
2683
  y: 0
2921
- }], cmds = getRoundedCommands(points), path = compileCommands(cmds), strokePath = `${path}`, fillPath = `${path} M ${w} -1 M 0 -1 Z`, t1 = `0 0 ${w} ${w}`;
2922
- let t2;
2923
- $[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];
2924
- const t3 = strokeWidth * 2;
2925
- let t4;
2926
- $[8] !== strokePath || $[9] !== t3 ? (t4 = /* @__PURE__ */ jsx(StrokePath, { d: strokePath, mask: "url(#stroke-mask)", strokeWidth: t3 }), $[8] = strokePath, $[9] = t3, $[10] = t4) : t4 = $[10];
2927
- let t5;
2928
- $[11] !== fillPath ? (t5 = /* @__PURE__ */ jsx(ShapePath, { d: fillPath }), $[11] = fillPath, $[12] = t5) : t5 = $[12];
2929
- let t6;
2930
- $[13] !== t1 || $[14] !== t2 || $[15] !== t4 || $[16] !== t5 || $[17] !== w ? (t6 = /* @__PURE__ */ jsxs("svg", { width: w, height: w, viewBox: t1, children: [
2931
- t2,
2932
- t4,
2933
- t5
2934
- ] }), $[13] = t1, $[14] = t2, $[15] = t4, $[16] = t5, $[17] = w, $[18] = t6) : t6 = $[18];
2935
- let t7;
2936
- 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
+ ] }) });
2937
2690
  });
2938
2691
  Arrow.displayName = "ForwardRef(Arrow)";
2939
2692
  const BoundaryElementContext = createGlobalScopedContext("@sanity/ui/context/boundaryElement", null);
2940
2693
  function BoundaryElementProvider(props) {
2941
- const $ = c(5), {
2694
+ const {
2942
2695
  children,
2943
2696
  element
2944
- } = props;
2945
- let t0;
2946
- $[0] !== element ? (t0 = {
2697
+ } = props, value = useMemo(() => ({
2947
2698
  version: 0,
2948
2699
  element
2949
- }, $[0] = element, $[1] = t0) : t0 = $[1];
2950
- const value = t0;
2951
- let t1;
2952
- 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 });
2953
2702
  }
2954
2703
  BoundaryElementProvider.displayName = "BoundaryElementProvider";
2955
2704
  function isRecord(value) {
@@ -2986,32 +2735,18 @@ function findMinBreakpoints(media, width) {
2986
2735
  return ret;
2987
2736
  }
2988
2737
  const ElementQuery = forwardRef(function(props, forwardedRef) {
2989
- const $ = c(18), theme = useTheme_v2();
2990
- let _media, children, restProps;
2991
- $[0] !== props ? ({
2738
+ const theme = useTheme_v2(), {
2992
2739
  children,
2993
2740
  media: _media,
2994
2741
  ...restProps
2995
- } = props, $[0] = props, $[1] = _media, $[2] = children, $[3] = restProps) : (_media = $[1], children = $[2], restProps = $[3]);
2996
- const media = _media ?? theme.media, [element, setElement] = useState(null), width = useElementSize(element)?.border.width ?? window.innerWidth;
2997
- let t0;
2998
- 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(() => {
2999
2743
  const eq = findMaxBreakpoints(media, width);
3000
- t0 = eq.length ? eq.join(" ") : void 0, $[4] = media, $[5] = width, $[6] = t0;
3001
- } else
3002
- t0 = $[6];
3003
- const max = t0;
3004
- let t1;
3005
- if ($[7] !== media || $[8] !== width) {
3006
- const eq_0 = findMinBreakpoints(media, width);
3007
- t1 = eq_0.length ? eq_0.join(" ") : void 0, $[7] = media, $[8] = width, $[9] = t1;
3008
- } else
3009
- t1 = $[9];
3010
- const min = t1;
3011
- let t2, t3;
3012
- $[10] !== element ? (t2 = () => element, t3 = [element], $[10] = element, $[11] = t2, $[12] = t3) : (t2 = $[11], t3 = $[12]), useImperativeHandle(forwardedRef, t2, t3);
3013
- let t4;
3014
- 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 });
3015
2750
  });
3016
2751
  ElementQuery.displayName = "ForwardRef(ElementQuery)";
3017
2752
  function getLayerContext(contextValue) {
@@ -3025,18 +2760,10 @@ function getLayerContext(contextValue) {
3025
2760
  }
3026
2761
  const LayerContext = createGlobalScopedContext("@sanity/ui/context/layer", null);
3027
2762
  function LayerProvider(props) {
3028
- const $ = c(19), {
2763
+ const {
3029
2764
  children,
3030
- zOffset: t0
3031
- } = props, zOffsetProp = t0 === void 0 ? 0 : t0, parentContextValue = useContext(LayerContext);
3032
- let t1;
3033
- $[0] !== parentContextValue ? (t1 = parentContextValue && getLayerContext(parentContextValue), $[0] = parentContextValue, $[1] = t1) : t1 = $[1];
3034
- const parent = t1, parentRegisterChild = parent?.registerChild, level = (parent?.level ?? 0) + 1, zOffset = useArrayProp(zOffsetProp), maxMediaIndex = zOffset.length - 1, mediaIndex = Math.min(useMediaIndex(), maxMediaIndex), zIndex = parent ? parent.zIndex + zOffset[mediaIndex] : zOffset[mediaIndex];
3035
- let t2;
3036
- $[2] === Symbol.for("react.memo_cache_sentinel") ? (t2 = {}, $[2] = t2) : t2 = $[2];
3037
- const [, setChildLayers] = useState(t2), [size2, setSize] = useState(0), isTopLayer = size2 === 0;
3038
- let t3;
3039
- $[3] !== parentRegisterChild || $[4] !== setChildLayers ? (t3 = (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) => {
3040
2767
  const parentDispose = parentRegisterChild?.(childLevel);
3041
2768
  return childLevel !== void 0 ? setChildLayers((state) => {
3042
2769
  const prevLen = state[childLevel] ?? 0, nextState = {
@@ -3044,47 +2771,34 @@ function LayerProvider(props) {
3044
2771
  [childLevel]: prevLen + 1
3045
2772
  };
3046
2773
  return setSize(Object.keys(nextState).length), nextState;
3047
- }) : setSize(_temp$4), () => {
3048
- childLevel !== void 0 ? setChildLayers((state_0) => {
3049
- const nextState_0 = {
3050
- ...state_0
2774
+ }) : setSize((v) => v + 1), () => {
2775
+ childLevel !== void 0 ? setChildLayers((state) => {
2776
+ const nextState = {
2777
+ ...state
3051
2778
  };
3052
- return nextState_0[childLevel] === 1 ? (delete nextState_0[childLevel], setSize(Object.keys(nextState_0).length)) : nextState_0[childLevel] = nextState_0[childLevel] - 1, nextState_0;
3053
- }) : 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?.();
3054
2781
  };
3055
- }, $[3] = parentRegisterChild, $[4] = setChildLayers, $[5] = t3) : t3 = $[5];
3056
- const registerChild = t3;
3057
- let t4, t5;
3058
- $[6] !== level || $[7] !== parentRegisterChild ? (t4 = () => parentRegisterChild?.(level), t5 = [level, parentRegisterChild], $[6] = level, $[7] = parentRegisterChild, $[8] = t4, $[9] = t5) : (t4 = $[8], t5 = $[9]), useEffect(t4, t5);
3059
- let t6;
3060
- $[10] !== isTopLayer || $[11] !== level || $[12] !== registerChild || $[13] !== size2 || $[14] !== zIndex ? (t6 = {
2782
+ }, [parentRegisterChild, setSize, setChildLayers]);
2783
+ useEffect(() => parentRegisterChild?.(level), [level, parentRegisterChild]);
2784
+ const value = useMemo(() => ({
3061
2785
  version: 0,
3062
2786
  isTopLayer,
3063
2787
  level,
3064
2788
  registerChild,
3065
2789
  size: size2,
3066
2790
  zIndex
3067
- }, $[10] = isTopLayer, $[11] = level, $[12] = registerChild, $[13] = size2, $[14] = zIndex, $[15] = t6) : t6 = $[15];
3068
- const value = t6;
3069
- let t7;
3070
- return $[16] !== children || $[17] !== value ? (t7 = /* @__PURE__ */ jsx(LayerContext.Provider, { value, children }), $[16] = children, $[17] = value, $[18] = t7) : t7 = $[18], t7;
3071
- }
3072
- function _temp2$2(v_0) {
3073
- return v_0 - 1;
3074
- }
3075
- function _temp$4(v) {
3076
- return v + 1;
2791
+ }), [isTopLayer, level, registerChild, size2, zIndex]);
2792
+ return /* @__PURE__ */ jsx(LayerContext.Provider, { value, children });
3077
2793
  }
3078
2794
  LayerProvider.displayName = "LayerProvider";
3079
2795
  function useLayer() {
3080
- const $ = c(2), value = useContext(LayerContext);
2796
+ const value = useContext(LayerContext);
3081
2797
  if (!value)
3082
2798
  throw new Error("useLayer(): missing context value");
3083
2799
  try {
3084
- let t1;
3085
- return $[0] !== value ? (t1 = getLayerContext(value), $[0] = value, $[1] = t1) : t1 = $[1], t1;
3086
- } catch (t0) {
3087
- const err = t0;
2800
+ return getLayerContext(value);
2801
+ } catch (err) {
3088
2802
  throw err instanceof Error ? new Error(`useLayer(): ${err.message}`) : new Error(`useLayer(): ${err}`);
3089
2803
  }
3090
2804
  }
@@ -3094,54 +2808,37 @@ const StyledLayer = /* @__PURE__ */ styled.div.withConfig({
3094
2808
  })({
3095
2809
  position: "relative"
3096
2810
  }), LayerChildren = forwardRef(function(props, forwardedRef) {
3097
- const $ = c(22);
3098
- let children, onActivate, onFocus, restProps, t0;
3099
- $[0] !== props ? ({
2811
+ const {
3100
2812
  children,
3101
2813
  onActivate,
3102
2814
  onFocus,
3103
- style: t0,
2815
+ style = EMPTY_RECORD,
3104
2816
  ...restProps
3105
- } = props, $[0] = props, $[1] = children, $[2] = onActivate, $[3] = onFocus, $[4] = restProps, $[5] = t0) : (children = $[1], onActivate = $[2], onFocus = $[3], restProps = $[4], t0 = $[5]);
3106
- const style = t0 === void 0 ? EMPTY_RECORD : t0, {
2817
+ } = props, {
3107
2818
  zIndex,
3108
2819
  isTopLayer
3109
2820
  } = useLayer(), lastFocusedRef = useRef(null), ref = useRef(null), isTopLayerRef = useRef(isTopLayer);
3110
- let t1;
3111
- $[6] === Symbol.for("react.memo_cache_sentinel") ? (t1 = () => ref.current, $[6] = t1) : t1 = $[6], useImperativeHandle(forwardedRef, t1);
3112
- let t2, t3;
3113
- $[7] !== isTopLayer || $[8] !== onActivate ? (t2 = () => {
2821
+ useImperativeHandle(forwardedRef, () => ref.current), useEffect(() => {
3114
2822
  isTopLayerRef.current !== isTopLayer && isTopLayer && onActivate?.({
3115
2823
  activeElement: lastFocusedRef.current
3116
2824
  }), isTopLayerRef.current = isTopLayer;
3117
- }, t3 = [isTopLayer, onActivate], $[7] = isTopLayer, $[8] = onActivate, $[9] = t2, $[10] = t3) : (t2 = $[9], t3 = $[10]), useEffect(t2, t3);
3118
- let t4;
3119
- $[11] !== isTopLayer || $[12] !== onFocus ? (t4 = (event) => {
2825
+ }, [isTopLayer, onActivate]);
2826
+ const handleFocus = useCallback((event) => {
3120
2827
  onFocus?.(event);
3121
2828
  const rootElement = ref.current, target = document.activeElement;
3122
2829
  !isTopLayer || !rootElement || !target || isHTMLElement(target) && containsOrEqualsElement(rootElement, target) && (lastFocusedRef.current = target);
3123
- }, $[11] = isTopLayer, $[12] = onFocus, $[13] = t4) : t4 = $[13];
3124
- const handleFocus = t4;
3125
- let t5;
3126
- $[14] !== style || $[15] !== zIndex ? (t5 = {
2830
+ }, [isTopLayer, onFocus]);
2831
+ return /* @__PURE__ */ jsx(StyledLayer, { ...restProps, "data-ui": "Layer", onFocus: handleFocus, ref, style: {
3127
2832
  ...style,
3128
2833
  zIndex
3129
- }, $[14] = style, $[15] = zIndex, $[16] = t5) : t5 = $[16];
3130
- let t6;
3131
- 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 });
3132
2835
  }), Layer = forwardRef(function(props, ref) {
3133
- const $ = c(11);
3134
- let children, restProps, t0;
3135
- $[0] !== props ? ({
2836
+ const {
3136
2837
  children,
3137
- zOffset: t0,
2838
+ zOffset = 1,
3138
2839
  ...restProps
3139
- } = props, $[0] = props, $[1] = children, $[2] = restProps, $[3] = t0) : (children = $[1], restProps = $[2], t0 = $[3]);
3140
- const zOffset = t0 === void 0 ? 1 : t0;
3141
- let t1;
3142
- $[4] !== children || $[5] !== ref || $[6] !== restProps ? (t1 = /* @__PURE__ */ jsx(LayerChildren, { ...restProps, ref, children }), $[4] = children, $[5] = ref, $[6] = restProps, $[7] = t1) : t1 = $[7];
3143
- let t2;
3144
- 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 }) });
3145
2842
  });
3146
2843
  Layer.displayName = "ForwardRef(Layer)";
3147
2844
  const key = "@sanity/ui/context/portal", elementKey = Symbol.for(`${key}/element`);
@@ -3162,39 +2859,26 @@ function usePortal() {
3162
2859
  return value;
3163
2860
  }
3164
2861
  function Portal(props) {
3165
- const $ = c(3), {
2862
+ const {
3166
2863
  children,
3167
2864
  __unstable_name: name
3168
2865
  } = props, portal = usePortal(), portalElement = (name ? portal.elements && portal.elements[name] : portal.element) || portal.elements?.default;
3169
- if (!portalElement)
3170
- return null;
3171
- let t0;
3172
- 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;
3173
2867
  }
3174
2868
  Portal.displayName = "Portal";
3175
2869
  function PortalProvider(props) {
3176
- const $ = c(7), {
2870
+ const {
3177
2871
  boundaryElement,
3178
2872
  children,
3179
2873
  element,
3180
2874
  __unstable_elements: elements
3181
- } = props, fallbackElement = useSyncExternalStore(emptySubscribe, _temp$3, _temp2$1), t0 = boundaryElement || null, t1 = element || fallbackElement;
3182
- let t2;
3183
- $[0] !== elements || $[1] !== t0 || $[2] !== t1 ? (t2 = {
2875
+ } = props, fallbackElement = useSyncExternalStore(emptySubscribe, () => document.body, () => null), value = useMemo(() => ({
3184
2876
  version: 0,
3185
- boundaryElement: t0,
3186
- element: t1,
2877
+ boundaryElement: boundaryElement || null,
2878
+ element: element || fallbackElement,
3187
2879
  elements
3188
- }, $[0] = elements, $[1] = t0, $[2] = t1, $[3] = t2) : t2 = $[3];
3189
- const value = t2;
3190
- let t3;
3191
- return $[4] !== children || $[5] !== value ? (t3 = /* @__PURE__ */ jsx(PortalContext.Provider, { value, children }), $[4] = children, $[5] = value, $[6] = t3) : t3 = $[6], t3;
3192
- }
3193
- function _temp2$1() {
3194
- return null;
3195
- }
3196
- function _temp$3() {
3197
- return document.body;
2880
+ }), [boundaryElement, element, elements, fallbackElement]);
2881
+ return /* @__PURE__ */ jsx(PortalContext.Provider, { value, children });
3198
2882
  }
3199
2883
  PortalProvider.displayName = "PortalProvider";
3200
2884
  const emptySubscribe = () => () => {
@@ -3202,12 +2886,11 @@ const emptySubscribe = () => () => {
3202
2886
  displayName: "StyledSrOnly",
3203
2887
  componentId: "sc-mubr0c-0"
3204
2888
  })`display:block;width:0;height:0;position:absolute;overflow:hidden;overflow:clip;`, SrOnly = forwardRef(function(props, ref) {
3205
- const $ = c(4), {
2889
+ const {
3206
2890
  as,
3207
2891
  children
3208
2892
  } = props;
3209
- let t0;
3210
- 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 });
3211
2894
  });
3212
2895
  SrOnly.displayName = "ForwardRef(SrOnly)";
3213
2896
  const StyledVirtualList = styled.div.withConfig({
@@ -3217,69 +2900,52 @@ const StyledVirtualList = styled.div.withConfig({
3217
2900
  displayName: "ItemWrapper",
3218
2901
  componentId: "sc-dlqsj4-1"
3219
2902
  })`position:absolute;left:0;right:0;`, VirtualList = forwardRef(function(props, forwardedRef) {
3220
- const $ = c(44);
3221
- let getItemKey, onChange, renderItem, restProps, t0, t1, t2;
3222
- $[0] !== props ? ({
3223
- as: t0,
3224
- gap: t1,
2903
+ const {
2904
+ as = "div",
2905
+ gap = 0,
3225
2906
  getItemKey,
3226
- items: t2,
2907
+ items = [],
3227
2908
  onChange,
3228
2909
  renderItem,
3229
2910
  ...restProps
3230
- } = 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]);
3231
- const as = t0 === void 0 ? "div" : t0, gap = t1 === void 0 ? 0 : t1;
3232
- let t3;
3233
- $[8] !== t2 ? (t3 = t2 === void 0 ? [] : t2, $[8] = t2, $[9] = t3) : t3 = $[9];
3234
- const items = t3, {
2911
+ } = props, {
3235
2912
  space
3236
2913
  } = useTheme_v2(), ref = useRef(null), wrapperRef = useRef(null), [scrollTop, setScrollTop] = useState(0), [scrollHeight, setScrollHeight] = useState(0), [itemHeight, setItemHeight] = useState(-1);
3237
- let t4;
3238
- $[10] === Symbol.for("react.memo_cache_sentinel") ? (t4 = () => ref.current, $[10] = t4) : t4 = $[10], useImperativeHandle(forwardedRef, t4);
3239
- let t5;
3240
- $[11] === Symbol.for("react.memo_cache_sentinel") ? (t5 = () => {
3241
- if (!wrapperRef.current)
3242
- return;
2914
+ useImperativeHandle(forwardedRef, () => ref.current), useEffect(() => {
2915
+ if (!wrapperRef.current) return;
3243
2916
  const firstElement = wrapperRef.current.firstChild;
3244
2917
  firstElement instanceof HTMLElement && setItemHeight(firstElement.offsetHeight);
3245
- }, $[11] = t5) : t5 = $[11];
3246
- let t6;
3247
- $[12] !== renderItem ? (t6 = [renderItem], $[12] = renderItem, $[13] = t6) : t6 = $[13], useEffect(t5, t6);
3248
- let t7, t8;
3249
- $[14] === Symbol.for("react.memo_cache_sentinel") ? (t7 = () => {
3250
- if (!ref.current)
3251
- return;
2918
+ }, [renderItem]), useEffect(() => {
2919
+ if (!ref.current) return;
3252
2920
  const scrollEl = findScrollable(ref.current.parentNode);
3253
2921
  if (scrollEl) {
3254
- if (!(scrollEl instanceof HTMLElement))
3255
- return;
3256
- const handleScroll = () => {
2922
+ if (!(scrollEl instanceof HTMLElement)) return;
2923
+ const handleScroll2 = () => {
3257
2924
  setScrollTop(scrollEl.scrollTop);
3258
2925
  };
3259
- scrollEl.addEventListener("scroll", handleScroll, {
2926
+ scrollEl.addEventListener("scroll", handleScroll2, {
3260
2927
  passive: !0
3261
2928
  });
3262
2929
  const ro = new _ResizeObserver((entries) => {
3263
2930
  setScrollHeight(entries[0].contentRect.height);
3264
2931
  });
3265
- return ro.observe(scrollEl), handleScroll(), () => {
3266
- 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();
3267
2934
  };
3268
2935
  }
3269
- const handleScroll_0 = () => {
2936
+ const handleScroll = () => {
3270
2937
  setScrollTop(window.scrollY);
3271
2938
  }, handleResize = () => {
3272
2939
  setScrollHeight(window.innerHeight);
3273
2940
  };
3274
- return window.addEventListener("scroll", handleScroll_0, {
2941
+ return window.addEventListener("scroll", handleScroll, {
3275
2942
  passive: !0
3276
- }), window.addEventListener("resize", handleResize), setScrollHeight(window.innerHeight), handleScroll_0(), () => {
3277
- 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);
3278
2945
  };
3279
- }, t8 = [], $[14] = t7, $[15] = t8) : (t7 = $[14], t8 = $[15]), useEffect(t7, t8);
2946
+ }, []);
3280
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;
3281
- let t10, t9;
3282
- $[16] !== fromIndex || $[17] !== gap || $[18] !== itemHeight || $[19] !== onChange || $[20] !== scrollHeight || $[21] !== scrollTop || $[22] !== space || $[23] !== toIndex ? (t9 = () => {
2948
+ useEffect(() => {
3283
2949
  onChange && onChange({
3284
2950
  fromIndex,
3285
2951
  gap: space[gap],
@@ -3288,9 +2954,8 @@ const StyledVirtualList = styled.div.withConfig({
3288
2954
  scrollTop,
3289
2955
  toIndex
3290
2956
  });
3291
- }, 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);
3292
- let t11;
3293
- $[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({
3294
2959
  fromIndex,
3295
2960
  gap,
3296
2961
  itemHeight,
@@ -3299,49 +2964,28 @@ const StyledVirtualList = styled.div.withConfig({
3299
2964
  getItemKey,
3300
2965
  items,
3301
2966
  renderItem
3302
- }, $[26] = fromIndex, $[27] = gap, $[28] = getItemKey, $[29] = itemHeight, $[30] = items, $[31] = renderItem, $[32] = space, $[33] = toIndex, $[34] = t11) : t11 = $[34];
3303
- const children = useChildren(t11);
3304
- let t12;
3305
- $[35] !== height ? (t12 = {
2967
+ });
2968
+ return /* @__PURE__ */ jsx(StyledVirtualList, { as, "data-ui": "VirtualList", ...restProps, ref, children: /* @__PURE__ */ jsx("div", { ref: wrapperRef, style: {
3306
2969
  height
3307
- }, $[35] = height, $[36] = t12) : t12 = $[36];
3308
- let t13;
3309
- $[37] !== children || $[38] !== t12 ? (t13 = /* @__PURE__ */ jsx("div", { ref: wrapperRef, style: t12, children }), $[37] = children, $[38] = t12, $[39] = t13) : t13 = $[39];
3310
- let t14;
3311
- 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 }) });
3312
2971
  });
3313
2972
  VirtualList.displayName = "ForwardRef(VirtualList)";
3314
- function useChildren(t0) {
3315
- const $ = c(21), {
3316
- fromIndex,
3317
- gap,
3318
- getItemKey,
3319
- itemHeight,
3320
- items,
3321
- renderItem,
3322
- space,
3323
- toIndex
3324
- } = t0;
3325
- if (!renderItem || items.length === 0)
3326
- return null;
3327
- if (itemHeight === -1) {
3328
- let t12;
3329
- $[0] !== items[0] || $[1] !== renderItem ? (t12 = renderItem(items[0]), $[0] = items[0], $[1] = renderItem, $[2] = t12) : t12 = $[2];
3330
- let t2;
3331
- return $[3] !== t12 ? (t2 = [/* @__PURE__ */ jsx(ItemWrapper, { children: t12 }, 0)], $[3] = t12, $[4] = t2) : t2 = $[4], t2;
3332
- }
3333
- let t1;
3334
- if ($[5] !== fromIndex || $[6] !== gap || $[7] !== getItemKey || $[8] !== itemHeight || $[9] !== items || $[10] !== renderItem || $[11] !== space || $[12] !== toIndex) {
3335
- let t2;
3336
- $[14] !== fromIndex || $[15] !== gap || $[16] !== getItemKey || $[17] !== itemHeight || $[18] !== renderItem || $[19] !== space ? (t2 = (item, _itemIndex) => {
3337
- const itemIndex = fromIndex + _itemIndex, node = renderItem(item), key2 = getItemKey ? getItemKey(item, itemIndex) : itemIndex;
3338
- return /* @__PURE__ */ jsx(ItemWrapper, { style: {
3339
- top: itemIndex * (itemHeight + space[gap])
3340
- }, children: node }, key2);
3341
- }, $[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;
3342
- } else
3343
- t1 = $[13];
3344
- 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
+ });
3345
2989
  }
3346
2990
  function findScrollable(parentNode) {
3347
2991
  let _scrollEl = parentNode;
@@ -3433,9 +3077,7 @@ const MotionCard$1 = styled(motion.create(Card)).withConfig({
3433
3077
  displayName: "MotionFlex",
3434
3078
  componentId: "sc-ihg31s-1"
3435
3079
  })`will-change:opacity;`, PopoverCard = forwardRef(function(props, ref) {
3436
- const $ = c(66);
3437
- let animate, arrow2, arrowRef, arrowX, arrowY, children, marginsProp, originX, originY, overflow, padding, placement, radius, restProps, scheme, shadow, strategy, style, tone, width, xProp, yProp;
3438
- $[0] !== props ? ({
3080
+ const {
3439
3081
  __unstable_margins: marginsProp,
3440
3082
  animate,
3441
3083
  arrow: arrow2,
@@ -3458,12 +3100,9 @@ const MotionCard$1 = styled(motion.create(Card)).withConfig({
3458
3100
  x: xProp,
3459
3101
  y: yProp,
3460
3102
  ...restProps
3461
- } = 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]);
3462
- const {
3103
+ } = props, {
3463
3104
  zIndex
3464
- } = useLayer(), margins = marginsProp || DEFAULT_POPOVER_MARGINS, x = (xProp ?? 0) + margins[3], y = (yProp ?? 0) + margins[0], t0 = animate ? "transform" : void 0;
3465
- let t1;
3466
- $[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(() => ({
3467
3106
  left: x,
3468
3107
  originX,
3469
3108
  originY,
@@ -3471,128 +3110,92 @@ const MotionCard$1 = styled(motion.create(Card)).withConfig({
3471
3110
  top: y,
3472
3111
  width,
3473
3112
  zIndex,
3474
- willChange: t0,
3113
+ willChange: animate ? "transform" : void 0,
3475
3114
  ...style
3476
- }, $[23] = originX, $[24] = originY, $[25] = strategy, $[26] = style, $[27] = t0, $[28] = width, $[29] = x, $[30] = y, $[31] = zIndex, $[32] = t1) : t1 = $[32];
3477
- const rootStyle2 = t1, t2 = arrowX !== null ? arrowX : void 0, t3 = arrowY !== null ? arrowY : void 0;
3478
- let t4;
3479
- $[33] !== t2 || $[34] !== t3 ? (t4 = {
3480
- left: t2,
3481
- 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,
3482
3118
  right: void 0,
3483
3119
  bottom: void 0
3484
- }, $[33] = t2, $[34] = t3, $[35] = t4) : t4 = $[35];
3485
- const arrowStyle = t4, t5 = restProps;
3486
- let t6;
3487
- $[36] !== animate ? (t6 = animate ? ["hidden", "initial"] : void 0, $[36] = animate, $[37] = t6) : t6 = $[37];
3488
- let t7;
3489
- $[38] !== animate ? (t7 = animate ? ["visible", "scaleIn"] : void 0, $[38] = animate, $[39] = t7) : t7 = $[39];
3490
- let t8;
3491
- $[40] !== animate ? (t8 = animate ? ["hidden", "scaleOut"] : void 0, $[40] = animate, $[41] = t8) : t8 = $[41];
3492
- let t9;
3493
- $[42] !== children || $[43] !== padding ? (t9 = /* @__PURE__ */ jsx(Flex, { direction: "column", flex: 1, padding, children }), $[42] = children, $[43] = padding, $[44] = t9) : t9 = $[44];
3494
- let t10;
3495
- $[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];
3496
- let t11;
3497
- $[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];
3498
- let t12;
3499
- 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: [
3500
- t10,
3501
- t11
3502
- ] }), $[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
+ ] });
3503
3125
  });
3504
3126
  PopoverCard.displayName = "ForwardRef(PopoverCard)";
3505
3127
  const ViewportOverlay = () => {
3506
- const $ = c(2), {
3128
+ const {
3507
3129
  zIndex
3508
3130
  } = useLayer();
3509
- let t0;
3510
- return $[0] !== zIndex ? (t0 = /* @__PURE__ */ jsx("div", { style: {
3131
+ return /* @__PURE__ */ jsx("div", { style: {
3511
3132
  height: "100vh",
3512
3133
  inset: 0,
3513
3134
  position: "fixed",
3514
3135
  width: "100vw",
3515
3136
  zIndex
3516
- } }), $[0] = zIndex, $[1] = t0) : t0 = $[1], t0;
3137
+ } });
3517
3138
  }, Popover = forwardRef(function(props, forwardedRef) {
3518
- const $ = c(122), {
3139
+ const {
3519
3140
  container,
3520
3141
  layer
3521
- } = useTheme_v2(), boundaryElementContext = useBoundaryElement();
3522
- 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;
3523
- if ($[0] !== props) {
3524
- const {
3525
- __unstable_margins: t122,
3526
- animate: t132,
3527
- arrow: t142,
3528
- boundaryElement: t152,
3529
- children: t162,
3530
- constrainSize: t172,
3531
- content: t182,
3532
- disabled: t192,
3533
- fallbackPlacements: t202,
3534
- matchReferenceWidth: t212,
3535
- floatingBoundary: t222,
3536
- modal: t232,
3537
- onActivate,
3538
- open: t242,
3539
- overflow: t252,
3540
- padding: t262,
3541
- placement: t272,
3542
- placementStrategy: t282,
3543
- portal: t292,
3544
- preventOverflow: t302,
3545
- radius: t312,
3546
- referenceBoundary: t322,
3547
- referenceElement: t332,
3548
- scheme: t342,
3549
- shadow: t352,
3550
- tone: t362,
3551
- width: t372,
3552
- zOffset: t38,
3553
- updateRef: t39,
3554
- ...t40
3555
- } = props;
3556
- 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 = t38, updateRef = t39, restProps = t40, $[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;
3557
- } else
3558
- _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];
3559
- 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, padding = useArrayProp(paddingProp), radius = useArrayProp(radiusProp), shadow = useArrayProp(shadowProp), widthArrayProp = useArrayProp(widthProp), zOffset = useArrayProp(zOffsetProp), ref = useRef(null), arrowRef = useRef(null);
3560
- let t12;
3561
- $[30] === Symbol.for("react.memo_cache_sentinel") ? (t12 = () => ref.current, $[30] = t12) : t12 = $[30], useImperativeHandle(forwardedRef, t12);
3562
- const mediaIndex = useMediaIndex(), boundaryWidth = constrainSize || preventOverflow ? boundarySize?.width : void 0;
3563
- let t13;
3564
- $[31] !== container || $[32] !== mediaIndex || $[33] !== widthArrayProp ? (t13 = calcCurrentWidth({
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);
3176
+ const mediaIndex = useMediaIndex(), boundaryWidth = constrainSize || preventOverflow ? boundarySize?.width : void 0, width = calcCurrentWidth({
3565
3177
  container,
3566
3178
  mediaIndex,
3567
3179
  width: widthArrayProp
3568
- }), $[31] = container, $[32] = mediaIndex, $[33] = widthArrayProp, $[34] = t13) : t13 = $[34];
3569
- const width = t13, widthRef = useRef(width);
3570
- let t14, t15;
3571
- $[35] !== width ? (t14 = () => {
3180
+ }), widthRef = useRef(width);
3181
+ useEffect(() => {
3572
3182
  widthRef.current = width;
3573
- }, t15 = [width], $[35] = width, $[36] = t14, $[37] = t15) : (t14 = $[36], t15 = $[37]), useEffect(t14, t15);
3574
- let t16;
3575
- $[38] !== boundaryWidth || $[39] !== width ? (t16 = calcMaxWidth({
3183
+ }, [width]);
3184
+ const maxWidth = calcMaxWidth({
3576
3185
  boundaryWidth,
3577
3186
  currentWidth: width
3578
- }), $[38] = boundaryWidth, $[39] = width, $[40] = t16) : t16 = $[40];
3579
- const maxWidth = t16, maxWidthRef = useRef(maxWidth);
3580
- let t17, t18;
3581
- $[41] !== maxWidth ? (t17 = () => {
3187
+ }), maxWidthRef = useRef(maxWidth);
3188
+ useEffect(() => {
3582
3189
  maxWidthRef.current = maxWidth;
3583
- }, t18 = [maxWidth], $[41] = maxWidth, $[42] = t17, $[43] = t18) : (t17 = $[42], t18 = $[43]), useEffect(t17, t18);
3190
+ }, [maxWidth]);
3584
3191
  const referenceWidthRef = useRef(void 0);
3585
- let t19, t20;
3586
- $[44] !== matchReferenceWidth || $[45] !== maxWidth || $[46] !== open || $[47] !== width ? (t19 = () => {
3192
+ useEffect(() => {
3587
3193
  const floatingElement = ref.current;
3588
- if (!open || !floatingElement)
3589
- return;
3590
- const referenceWidth = referenceWidthRef.current;
3591
- 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`);
3592
- }, t20 = [width, matchReferenceWidth, maxWidth, open], $[44] = matchReferenceWidth, $[45] = maxWidth, $[46] = open, $[47] = width, $[48] = t19, $[49] = t20) : (t19 = $[48], t20 = $[49]), useEffect(t19, t20);
3593
- const [referenceWidth_0, setReferenceWidth] = useState(void 0);
3594
- let t21;
3595
- $[50] !== animate || $[51] !== arrowProp || $[52] !== constrainSize || $[53] !== fallbackPlacements || $[54] !== floatingBoundary || $[55] !== margins || $[56] !== matchReferenceWidth || $[57] !== placementProp || $[58] !== placementStrategy || $[59] !== preventOverflow || $[60] !== referenceBoundary ? (t21 = {
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({
3596
3199
  animate,
3597
3200
  arrowProp,
3598
3201
  arrowRef,
@@ -3607,23 +3210,10 @@ const ViewportOverlay = () => {
3607
3210
  preventOverflow,
3608
3211
  referenceBoundary,
3609
3212
  referenceWidthRef,
3610
- rootBoundary: "viewport",
3213
+ rootBoundary,
3611
3214
  setReferenceWidth,
3612
3215
  widthRef
3613
- }, $[50] = animate, $[51] = arrowProp, $[52] = constrainSize, $[53] = fallbackPlacements, $[54] = floatingBoundary, $[55] = margins, $[56] = matchReferenceWidth, $[57] = placementProp, $[58] = placementStrategy, $[59] = preventOverflow, $[60] = referenceBoundary, $[61] = t21) : t21 = $[61];
3614
- const middleware = useMiddleware$1(t21);
3615
- let t22;
3616
- $[62] !== referenceElement ? (t22 = referenceElement ? {
3617
- reference: referenceElement
3618
- } : void 0, $[62] = referenceElement, $[63] = t22) : t22 = $[63];
3619
- let t23;
3620
- $[64] !== middleware || $[65] !== placementProp || $[66] !== t22 ? (t23 = {
3621
- middleware,
3622
- placement: placementProp,
3623
- whileElementsMounted: autoUpdate,
3624
- elements: t22
3625
- }, $[64] = middleware, $[65] = placementProp, $[66] = t22, $[67] = t23) : t23 = $[67];
3626
- const {
3216
+ }), {
3627
3217
  x,
3628
3218
  y,
3629
3219
  middlewareData,
@@ -3631,148 +3221,87 @@ const ViewportOverlay = () => {
3631
3221
  refs,
3632
3222
  strategy,
3633
3223
  update
3634
- } = useFloating(t23), referenceHidden = middlewareData.hide?.referenceHidden, arrowX = middlewareData.arrow?.x, arrowY = middlewareData.arrow?.y, originX = middlewareData["@sanity/ui/origin"]?.originX, originY = middlewareData["@sanity/ui/origin"]?.originY;
3635
- let t24;
3636
- $[68] === Symbol.for("react.memo_cache_sentinel") ? (t24 = (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) => {
3637
3232
  arrowRef.current = arrowEl;
3638
- }, $[68] = t24) : t24 = $[68];
3639
- const setArrow = t24;
3640
- let t25;
3641
- $[69] !== refs ? (t25 = (node) => {
3233
+ }, []), setFloating = useCallback((node) => {
3642
3234
  ref.current = node, refs.setFloating(node);
3643
- }, $[69] = refs, $[70] = t25) : t25 = $[70];
3644
- const setFloating = t25;
3645
- let t26;
3646
- $[71] !== childProp ? (t26 = childProp ? getElementRef(childProp) : null, $[71] = childProp, $[72] = t26) : t26 = $[72];
3647
- let t27;
3648
- $[73] !== refs.reference.current ? (t27 = () => refs.reference.current, $[73] = refs.reference.current, $[74] = t27) : t27 = $[74], useImperativeHandle(t26, t27);
3649
- let t28;
3650
- bb0: {
3651
- if (referenceElement) {
3652
- t28 = childProp;
3653
- break bb0;
3654
- }
3655
- if (!childProp) {
3656
- t28 = null;
3657
- break bb0;
3658
- }
3659
- let t292;
3660
- $[75] !== childProp || $[76] !== refs.setReference ? (t292 = cloneElement(childProp, {
3661
- ref: refs.setReference
3662
- }), $[75] = childProp, $[76] = refs.setReference, $[77] = t292) : t292 = $[77], t28 = t292;
3663
- }
3664
- const child = t28;
3665
- let t29, t30;
3666
- if ($[78] !== update ? (t29 = () => update, t30 = [update], $[78] = update, $[79] = t29, $[80] = t30) : (t29 = $[79], t30 = $[80]), useImperativeHandle(updateRef, t29, t30), disabled) {
3667
- let t312;
3668
- return $[81] !== childProp ? (t312 = childProp || /* @__PURE__ */ jsx(Fragment, {}), $[81] = childProp, $[82] = t312) : t312 = $[82], t312;
3669
- }
3670
- let t31;
3671
- $[83] !== modal ? (t31 = modal && /* @__PURE__ */ jsx(ViewportOverlay, {}), $[83] = modal, $[84] = t31) : t31 = $[84];
3672
- const t32 = matchReferenceWidth ? referenceWidth_0 : width;
3673
- let t33;
3674
- $[85] !== animate || $[86] !== arrowProp || $[87] !== arrowX || $[88] !== arrowY || $[89] !== content || $[90] !== margins || $[91] !== originX || $[92] !== originY || $[93] !== overflow || $[94] !== padding || $[95] !== placement || $[96] !== radius || $[97] !== referenceHidden || $[98] !== restProps || $[99] !== scheme || $[100] !== setFloating || $[101] !== shadow || $[102] !== strategy || $[103] !== t32 || $[104] !== tone || $[105] !== x || $[106] !== y ? (t33 = /* @__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: t32, x, y, children: content }), $[85] = animate, $[86] = arrowProp, $[87] = arrowX, $[88] = arrowY, $[89] = content, $[90] = margins, $[91] = originX, $[92] = originY, $[93] = overflow, $[94] = padding, $[95] = placement, $[96] = radius, $[97] = referenceHidden, $[98] = restProps, $[99] = scheme, $[100] = setFloating, $[101] = shadow, $[102] = strategy, $[103] = t32, $[104] = tone, $[105] = x, $[106] = y, $[107] = t33) : t33 = $[107];
3675
- let t34;
3676
- $[108] !== t31 || $[109] !== t33 || $[110] !== zOffset ? (t34 = /* @__PURE__ */ jsxs(LayerProvider, { zOffset, children: [
3677
- t31,
3678
- t33
3679
- ] }), $[108] = t31, $[109] = t33, $[110] = zOffset, $[111] = t34) : t34 = $[111];
3680
- const popover = t34;
3681
- let t35;
3682
- $[112] !== open || $[113] !== popover || $[114] !== portal ? (t35 = open && (portal ? /* @__PURE__ */ jsx(Portal, { __unstable_name: typeof portal == "string" ? portal : void 0, children: popover }) : popover), $[112] = open, $[113] = popover, $[114] = portal, $[115] = t35) : t35 = $[115];
3683
- const children = t35;
3684
- let t36;
3685
- $[116] !== animate || $[117] !== children ? (t36 = animate ? /* @__PURE__ */ jsx(AnimatePresence, { children }) : children, $[116] = animate, $[117] = children, $[118] = t36) : t36 = $[118];
3686
- let t37;
3687
- return $[119] !== child || $[120] !== t36 ? (t37 = /* @__PURE__ */ jsxs(Fragment, { children: [
3688
- t36,
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,
3689
3248
  child
3690
- ] }), $[119] = child, $[120] = t36, $[121] = t37) : t37 = $[121], t37;
3249
+ ] });
3691
3250
  });
3692
3251
  Popover.displayName = "ForwardRef(Popover)";
3693
- function useMiddleware$1(t0) {
3694
- const $ = c(42), {
3695
- animate,
3696
- arrowProp,
3697
- arrowRef,
3698
- constrainSize,
3699
- fallbackPlacements,
3700
- floatingBoundary,
3701
- margins,
3702
- matchReferenceWidth,
3703
- maxWidthRef,
3704
- placementProp,
3705
- placementStrategy,
3706
- preventOverflow,
3707
- referenceBoundary,
3708
- referenceWidthRef,
3709
- rootBoundary,
3710
- setReferenceWidth,
3711
- widthRef
3712
- } = t0;
3713
- let ret;
3714
- 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) {
3715
- if (ret = [], constrainSize || preventOverflow)
3716
- if (placementStrategy === "autoPlacement") {
3717
- let t12;
3718
- $[18] !== fallbackPlacements || $[19] !== placementProp ? (t12 = autoPlacement({
3719
- allowedPlacements: [placementProp].concat(fallbackPlacements)
3720
- }), $[18] = fallbackPlacements, $[19] = placementProp, $[20] = t12) : t12 = $[20], ret.push(t12);
3721
- } else {
3722
- const t12 = floatingBoundary || void 0;
3723
- let t22;
3724
- $[21] !== fallbackPlacements || $[22] !== rootBoundary || $[23] !== t12 ? (t22 = flip({
3725
- boundary: t12,
3726
- fallbackPlacements,
3727
- padding: DEFAULT_POPOVER_PADDING,
3728
- rootBoundary
3729
- }), $[21] = fallbackPlacements, $[22] = rootBoundary, $[23] = t12, $[24] = t22) : t22 = $[24], ret.push(t22);
3730
- }
3731
- let t1;
3732
- 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({
3733
3281
  mainAxis: DEFAULT_POPOVER_DISTANCE
3734
- }), $[25] = t1) : t1 = $[25], ret.push(t1), constrainSize || matchReferenceWidth) {
3735
- const t22 = floatingBoundary || void 0;
3736
- let t32;
3737
- $[26] !== constrainSize || $[27] !== margins || $[28] !== matchReferenceWidth || $[29] !== maxWidthRef || $[30] !== referenceWidthRef || $[31] !== setReferenceWidth || $[32] !== t22 || $[33] !== widthRef ? (t32 = size({
3738
- boundaryElement: t22,
3739
- constrainSize,
3740
- margins,
3741
- matchReferenceWidth,
3742
- maxWidthRef,
3743
- padding: DEFAULT_POPOVER_PADDING,
3744
- referenceWidthRef,
3745
- setReferenceWidth,
3746
- widthRef
3747
- }), $[26] = constrainSize, $[27] = margins, $[28] = matchReferenceWidth, $[29] = maxWidthRef, $[30] = referenceWidthRef, $[31] = setReferenceWidth, $[32] = t22, $[33] = widthRef, $[34] = t32) : t32 = $[34], ret.push(t32);
3748
- }
3749
- if (preventOverflow) {
3750
- const t22 = floatingBoundary || void 0;
3751
- let t32;
3752
- $[35] !== rootBoundary || $[36] !== t22 ? (t32 = shift({
3753
- boundary: t22,
3754
- rootBoundary,
3755
- padding: DEFAULT_POPOVER_PADDING
3756
- }), $[35] = rootBoundary, $[36] = t22, $[37] = t32) : t32 = $[37], ret.push(t32);
3757
- }
3758
- if (arrowProp) {
3759
- let t22;
3760
- $[38] !== arrowRef ? (t22 = arrow({
3761
- element: arrowRef,
3762
- padding: DEFAULT_POPOVER_PADDING
3763
- }), $[38] = arrowRef, $[39] = t22) : t22 = $[39], ret.push(t22);
3764
- }
3765
- animate && ret.push(origin);
3766
- const t2 = referenceBoundary || void 0;
3767
- let t3;
3768
- $[40] !== t2 ? (t3 = hide({
3769
- 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,
3770
3301
  padding: DEFAULT_POPOVER_PADDING,
3771
3302
  strategy: "referenceHidden"
3772
- }), $[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;
3773
- } else
3774
- ret = $[17];
3775
- return ret;
3303
+ })), ret;
3304
+ }, [animate, arrowProp, arrowRef, constrainSize, fallbackPlacements, floatingBoundary, margins, matchReferenceWidth, maxWidthRef, placementProp, placementStrategy, preventOverflow, referenceBoundary, referenceWidthRef, rootBoundary, setReferenceWidth, widthRef]);
3776
3305
  }
3777
3306
  function radioBaseStyle() {
3778
3307
  return css`
@@ -3895,29 +3424,18 @@ const StyledRadio = /* @__PURE__ */ styled.div.withConfig({
3895
3424
  displayName: "Input",
3896
3425
  componentId: "sc-ccrwkf-1"
3897
3426
  })(inputElementStyle), Radio = forwardRef(function(props, forwardedRef) {
3898
- const $ = c(19);
3899
- let className, customValidity, disabled, readOnly, restProps, style;
3900
- $[0] !== props ? ({
3427
+ const {
3901
3428
  className,
3902
3429
  disabled,
3903
3430
  style,
3904
3431
  customValidity,
3905
3432
  readOnly,
3906
3433
  ...restProps
3907
- } = 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]);
3908
- const ref = useRef(null);
3909
- let t0;
3910
- $[7] === Symbol.for("react.memo_cache_sentinel") ? (t0 = () => ref.current, $[7] = t0) : t0 = $[7], useImperativeHandle(forwardedRef, t0), useCustomValidity(ref, customValidity);
3911
- const t1 = !disabled && readOnly ? "" : void 0, t2 = customValidity ? "" : void 0, t3 = disabled || readOnly;
3912
- let t4;
3913
- $[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];
3914
- let t5;
3915
- $[14] === Symbol.for("react.memo_cache_sentinel") ? (t5 = /* @__PURE__ */ jsx("span", {}), $[14] = t5) : t5 = $[14];
3916
- let t6;
3917
- return $[15] !== className || $[16] !== style || $[17] !== t4 ? (t6 = /* @__PURE__ */ jsxs(StyledRadio, { className, "data-ui": "Radio", style, children: [
3918
- t4,
3919
- t5
3920
- ] }), $[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
+ ] });
3921
3439
  });
3922
3440
  Radio.displayName = "ForwardRef(Radio)";
3923
3441
  function rootStyle() {
@@ -4072,36 +3590,21 @@ const selectStyle = {
4072
3590
  displayName: "IconBox",
4073
3591
  componentId: "sc-5mxno7-2"
4074
3592
  })(selectStyle.iconBox), Select = forwardRef(function(props, forwardedRef) {
4075
- const $ = c(29);
4076
- let children, customValidity, disabled, readOnly, restProps, t0, t1, t2, t3;
4077
- $[0] !== props ? ({
3593
+ const {
4078
3594
  children,
4079
3595
  customValidity,
4080
3596
  disabled,
4081
- fontSize: t0,
4082
- padding: t1,
4083
- radius: t2,
3597
+ fontSize: fontSize2 = 2,
3598
+ padding = 3,
3599
+ radius = 2,
4084
3600
  readOnly,
4085
- space: t3,
3601
+ space = 3,
4086
3602
  ...restProps
4087
- } = 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]);
4088
- 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);
4089
- let t4;
4090
- $[10] === Symbol.for("react.memo_cache_sentinel") ? (t4 = () => ref.current, $[10] = t4) : t4 = $[10], useImperativeHandle(forwardedRef, t4), useCustomValidity(ref, customValidity);
4091
- const t5 = !disabled && readOnly ? "" : void 0, t6 = useArrayProp(fontSize2), t7 = useArrayProp(padding), t8 = useArrayProp(radius), t9 = useArrayProp(space), t10 = disabled || readOnly;
4092
- let t11;
4093
- $[11] !== children || $[12] !== restProps || $[13] !== t10 || $[14] !== t5 || $[15] !== t6 || $[16] !== t7 || $[17] !== t8 || $[18] !== 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 }), $[11] = children, $[12] = restProps, $[13] = t10, $[14] = t5, $[15] = t6, $[16] = t7, $[17] = t8, $[18] = t9, $[19] = t11) : t11 = $[19];
4094
- let t12;
4095
- $[20] === Symbol.for("react.memo_cache_sentinel") ? (t12 = /* @__PURE__ */ jsx(ChevronDownIcon, {}), $[20] = t12) : t12 = $[20];
4096
- let t13;
4097
- $[21] !== fontSize2 ? (t13 = /* @__PURE__ */ jsx(Text, { size: fontSize2, children: t12 }), $[21] = fontSize2, $[22] = t13) : t13 = $[22];
4098
- let t14;
4099
- $[23] !== padding || $[24] !== t13 ? (t14 = /* @__PURE__ */ jsx(IconBox, { padding, children: t13 }), $[23] = padding, $[24] = t13, $[25] = t14) : t14 = $[25];
4100
- let t15;
4101
- return $[26] !== t11 || $[27] !== t14 ? (t15 = /* @__PURE__ */ jsxs(StyledSelect, { "data-ui": "Select", children: [
4102
- t11,
4103
- t14
4104
- ] }), $[26] = t11, $[27] = t14, $[28] = t15) : t15 = $[28], 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
+ ] });
4105
3608
  });
4106
3609
  Select.displayName = "ForwardRef(Select)";
4107
3610
  const BASE_STYLE = {
@@ -4130,16 +3633,12 @@ const StyledStack = /* @__PURE__ */ styled(Box).withConfig({
4130
3633
  displayName: "StyledStack",
4131
3634
  componentId: "sc-8dpfq2-0"
4132
3635
  })(stackBaseStyle, responsiveStackSpaceStyle), Stack = forwardRef(function(props, ref) {
4133
- const $ = c(10);
4134
- let as, restProps, space;
4135
- $[0] !== props ? ({
3636
+ const {
4136
3637
  as,
4137
3638
  space,
4138
3639
  ...restProps
4139
- } = props, $[0] = props, $[1] = as, $[2] = restProps, $[3] = space) : (as = $[1], restProps = $[2], space = $[3]);
4140
- const t0 = typeof as == "string" ? as : void 0, t1 = useArrayProp(space);
4141
- let t2;
4142
- return $[4] !== as || $[5] !== ref || $[6] !== restProps || $[7] !== t0 || $[8] !== t1 ? (t2 = /* @__PURE__ */ jsx(StyledStack, { "data-as": t0, "data-ui": "Stack", ...restProps, $space: t1, forwardedAs: as, ref }), $[4] = as, $[5] = ref, $[6] = restProps, $[7] = t0, $[8] = t1, $[9] = t2) : t2 = $[9], 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 });
4143
3642
  });
4144
3643
  Stack.displayName = "ForwardRef(Stack)";
4145
3644
  function switchBaseStyles() {
@@ -4311,9 +3810,7 @@ const StyledSwitch = /* @__PURE__ */ styled.span.withConfig({
4311
3810
  displayName: "Thumb",
4312
3811
  componentId: "sc-dw1foe-4"
4313
3812
  })(switchThumbStyles), Switch = forwardRef(function(props, forwardedRef) {
4314
- const $ = c(26);
4315
- let checked, className, disabled, indeterminate, readOnly, restProps, style;
4316
- $[0] !== props ? ({
3813
+ const {
4317
3814
  checked,
4318
3815
  className,
4319
3816
  disabled,
@@ -4321,29 +3818,16 @@ const StyledSwitch = /* @__PURE__ */ styled.span.withConfig({
4321
3818
  readOnly,
4322
3819
  style,
4323
3820
  ...restProps
4324
- } = 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]);
4325
- const ref = useRef(null);
4326
- let t0;
4327
- $[8] === Symbol.for("react.memo_cache_sentinel") ? (t0 = () => ref.current, $[8] = t0) : t0 = $[8], useImperativeHandle(forwardedRef, t0);
4328
- let t1, t2;
4329
- $[9] !== indeterminate ? (t1 = () => {
3821
+ } = props, ref = useRef(null);
3822
+ return useImperativeHandle(forwardedRef, () => ref.current), useEffect(() => {
4330
3823
  ref.current && (ref.current.indeterminate = indeterminate || !1);
4331
- }, t2 = [indeterminate], $[9] = indeterminate, $[10] = t1, $[11] = t2) : (t1 = $[10], t2 = $[11]), useEffect(t1, t2);
4332
- const t3 = !disabled && readOnly ? "" : void 0, t4 = indeterminate !== !0 && checked, t5 = disabled || readOnly;
4333
- let t6;
4334
- $[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];
4335
- let t7;
4336
- $[17] === Symbol.for("react.memo_cache_sentinel") ? (t7 = /* @__PURE__ */ jsx(Track, {}), $[17] = t7) : t7 = $[17];
4337
- let t8;
4338
- $[18] !== checked || $[19] !== indeterminate ? (t8 = /* @__PURE__ */ jsxs(Representation, { "aria-hidden": !0, "data-name": "representation", children: [
4339
- t7,
4340
- /* @__PURE__ */ jsx(Thumb, { $checked: checked, $indeterminate: indeterminate })
4341
- ] }), $[18] = checked, $[19] = indeterminate, $[20] = t8) : t8 = $[20];
4342
- let t9;
4343
- return $[21] !== className || $[22] !== style || $[23] !== t6 || $[24] !== t8 ? (t9 = /* @__PURE__ */ jsxs(StyledSwitch, { className, "data-ui": "Switch", style, children: [
4344
- t6,
4345
- t8
4346
- ] }), $[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
+ ] });
4347
3831
  });
4348
3832
  Switch.displayName = "ForwardRef(Switch)";
4349
3833
  const StyledTextArea = /* @__PURE__ */ styled.span.withConfig({
@@ -4359,33 +3843,21 @@ const StyledTextArea = /* @__PURE__ */ styled.span.withConfig({
4359
3843
  displayName: "Presentation",
4360
3844
  componentId: "sc-1d6h1o8-3"
4361
3845
  })(responsiveRadiusStyle, textInputRepresentationStyle), TextArea = forwardRef(function(props, forwardedRef) {
4362
- const $ = c(29);
4363
- let __unstable_disableFocusRing, customValidity, restProps, t0, t1, t2, t3, t4, weight;
4364
- $[0] !== props ? ({
4365
- border: t0,
3846
+ const {
3847
+ border: border2 = !0,
4366
3848
  customValidity,
4367
- disabled: t1,
4368
- fontSize: t2,
4369
- padding: t3,
4370
- radius: t4,
3849
+ disabled = !1,
3850
+ fontSize: fontSize2 = 2,
3851
+ padding = 3,
3852
+ radius = 2,
4371
3853
  weight,
4372
3854
  __unstable_disableFocusRing,
4373
3855
  ...restProps
4374
- } = 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]);
4375
- 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();
4376
- let t5;
4377
- $[10] === Symbol.for("react.memo_cache_sentinel") ? (t5 = () => ref.current, $[10] = t5) : t5 = $[10], useImperativeHandle(forwardedRef, t5), useCustomValidity(ref, customValidity);
4378
- const t6 = rootTheme.scheme, t7 = rootTheme.tone, t8 = useArrayProp(fontSize2), t9 = useArrayProp(padding), t10 = rootTheme.scheme, t11 = useArrayProp(0);
4379
- let t12;
4380
- $[11] !== disabled || $[12] !== restProps || $[13] !== rootTheme.scheme || $[14] !== rootTheme.tone || $[15] !== t11 || $[16] !== t8 || $[17] !== t9 || $[18] !== 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 }), $[11] = disabled, $[12] = restProps, $[13] = rootTheme.scheme, $[14] = rootTheme.tone, $[15] = t11, $[16] = t8, $[17] = t9, $[18] = weight, $[19] = t12) : t12 = $[19];
4381
- const t13 = useArrayProp(radius), t14 = border2 ? "" : void 0;
4382
- let t15;
4383
- $[20] !== __unstable_disableFocusRing || $[21] !== rootTheme.scheme || $[22] !== rootTheme.tone || $[23] !== t13 || $[24] !== 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 }), $[20] = __unstable_disableFocusRing, $[21] = rootTheme.scheme, $[22] = rootTheme.tone, $[23] = t13, $[24] = t14, $[25] = t15) : t15 = $[25];
4384
- let t16;
4385
- return $[26] !== t12 || $[27] !== t15 ? (t16 = /* @__PURE__ */ jsx(StyledTextArea, { "data-ui": "TextArea", children: /* @__PURE__ */ jsxs(InputRoot$1, { children: [
4386
- t12,
4387
- t15
4388
- ] }) }), $[26] = t12, $[27] = t15, $[28] = t16) : t16 = $[28], 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
+ ] }) });
4389
3861
  });
4390
3862
  TextArea.displayName = "ForwardRef(TextArea)";
4391
3863
  const CLEAR_BUTTON_BOX_STYLE = {
@@ -4431,107 +3903,61 @@ const CLEAR_BUTTON_BOX_STYLE = {
4431
3903
  display: "block"
4432
3904
  }
4433
3905
  }), TextInput = forwardRef(function(props, forwardedRef) {
4434
- const $ = c(84);
4435
- let IconComponent, IconRightComponent, __unstable_disableFocusRing, clearButton, customValidity, onClear, prefix, readOnly, restProps, suffix, t0, t1, t2, t3, t4, t5, t6, weight;
4436
- $[0] !== props ? ({
3906
+ const {
4437
3907
  __unstable_disableFocusRing,
4438
- border: t0,
3908
+ border: border2 = !0,
4439
3909
  clearButton,
4440
- disabled: t1,
4441
- fontSize: t2,
3910
+ disabled = !1,
3911
+ fontSize: fontSizeProp = 2,
4442
3912
  icon: IconComponent,
4443
3913
  iconRight: IconRightComponent,
4444
3914
  onClear,
4445
- padding: t3,
3915
+ padding: paddingProp = 3,
4446
3916
  prefix,
4447
- radius: t4,
3917
+ radius: radiusProp = 2,
4448
3918
  readOnly,
4449
- space: t5,
3919
+ space: spaceProp = 3,
4450
3920
  suffix,
4451
3921
  customValidity,
4452
- type: t6,
3922
+ type = "text",
4453
3923
  weight,
4454
3924
  ...restProps
4455
- } = 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]);
4456
- 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(), fontSize2 = useArrayProp(fontSizeProp), padding = useArrayProp(paddingProp), radius = useArrayProp(radiusProp), space = useArrayProp(spaceProp), $hasClearButton = !!clearButton, $hasIcon = !!IconComponent, $hasIconRight = !!IconRightComponent, $hasSuffix = !!suffix, $hasPrefix = !!prefix;
4457
- let t7;
4458
- $[19] === Symbol.for("react.memo_cache_sentinel") ? (t7 = () => ref.current, $[19] = t7) : t7 = $[19], useImperativeHandle(forwardedRef, t7), useCustomValidity(ref, customValidity);
4459
- const handleClearMouseDown = _temp$2;
4460
- let t8;
4461
- $[20] !== onClear ? (t8 = (event_0) => {
4462
- event_0.preventDefault(), event_0.stopPropagation(), onClear && onClear(), ref.current?.focus();
4463
- }, $[20] = onClear, $[21] = t8) : t8 = $[21];
4464
- const handleClearClick = t8;
4465
- let t9;
4466
- $[22] !== prefix || $[23] !== radius ? (t9 = prefix && /* @__PURE__ */ jsx(Prefix, { borderTop: !0, borderLeft: !0, borderBottom: !0, radius, sizing: "border", tone: "inherit", children: /* @__PURE__ */ jsx("span", { children: prefix }) }), $[22] = prefix, $[23] = radius, $[24] = t9) : t9 = $[24];
4467
- const prefixNode = t9, t10 = border2 ? "" : void 0;
4468
- let t11;
4469
- $[25] !== IconComponent || $[26] !== fontSize2 || $[27] !== padding ? (t11 = IconComponent && /* @__PURE__ */ jsx(LeftBox, { padding, children: /* @__PURE__ */ jsxs(Text, { size: fontSize2, children: [
4470
- isValidElement(IconComponent) && IconComponent,
4471
- isValidElementType(IconComponent) && /* @__PURE__ */ jsx(IconComponent, {})
4472
- ] }) }), $[25] = IconComponent, $[26] = fontSize2, $[27] = padding, $[28] = t11) : t11 = $[28];
4473
- let t12;
4474
- $[29] !== $hasClearButton || $[30] !== IconRightComponent || $[31] !== fontSize2 || $[32] !== padding ? (t12 = !$hasClearButton && IconRightComponent && /* @__PURE__ */ jsx(RightBox, { padding, children: /* @__PURE__ */ jsxs(Text, { size: fontSize2, children: [
4475
- isValidElement(IconRightComponent) && IconRightComponent,
4476
- isValidElementType(IconRightComponent) && /* @__PURE__ */ jsx(IconRightComponent, {})
4477
- ] }) }), $[29] = $hasClearButton, $[30] = IconRightComponent, $[31] = fontSize2, $[32] = padding, $[33] = t12) : t12 = $[33];
4478
- let t13;
4479
- $[34] !== $hasPrefix || $[35] !== $hasSuffix || $[36] !== __unstable_disableFocusRing || $[37] !== radius || $[38] !== rootTheme.scheme || $[39] !== rootTheme.tone || $[40] !== t10 || $[41] !== t11 || $[42] !== t12 ? (t13 = /* @__PURE__ */ jsxs(Presentation, { $hasPrefix, $unstableDisableFocusRing: __unstable_disableFocusRing, $hasSuffix, $radius: radius, $scheme: rootTheme.scheme, $tone: rootTheme.tone, "data-border": t10, "data-scheme": rootTheme.scheme, "data-tone": rootTheme.tone, children: [
4480
- t11,
4481
- t12
4482
- ] }), $[34] = $hasPrefix, $[35] = $hasSuffix, $[36] = __unstable_disableFocusRing, $[37] = radius, $[38] = rootTheme.scheme, $[39] = rootTheme.tone, $[40] = t10, $[41] = t11, $[42] = t12, $[43] = t13) : t13 = $[43];
4483
- const presentationNode = t13;
4484
- let t14;
4485
- $[44] !== padding ? (t14 = padding.map(_temp2), $[44] = padding, $[45] = t14) : t14 = $[45];
4486
- const clearButtonBoxPadding = t14;
4487
- let t15;
4488
- $[46] !== padding ? (t15 = padding.map(_temp3), $[46] = padding, $[47] = t15) : t15 = $[47];
4489
- const clearButtonPadding = t15, clearButtonProps = typeof clearButton == "object" ? clearButton : EMPTY_RECORD;
4490
- let t16;
4491
- $[48] !== clearButton || $[49] !== clearButtonBoxPadding || $[50] !== clearButtonPadding || $[51] !== clearButtonProps || $[52] !== customValidity || $[53] !== disabled || $[54] !== fontSize2 || $[55] !== handleClearClick || $[56] !== radius || $[57] !== readOnly ? (t16 = !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 }) }), $[48] = clearButton, $[49] = clearButtonBoxPadding, $[50] = clearButtonPadding, $[51] = clearButtonProps, $[52] = customValidity, $[53] = disabled, $[54] = fontSize2, $[55] = handleClearClick, $[56] = radius, $[57] = readOnly, $[58] = t16) : t16 = $[58];
4492
- const clearButtonNode = t16;
4493
- let t17;
4494
- $[59] !== radius || $[60] !== suffix ? (t17 = suffix && /* @__PURE__ */ jsx(Suffix, { borderTop: !0, borderRight: !0, borderBottom: !0, radius, sizing: "border", tone: "inherit", children: /* @__PURE__ */ jsx("span", { children: suffix }) }), $[59] = radius, $[60] = suffix, $[61] = t17) : t17 = $[61];
4495
- const suffixNode = t17, t18 = $hasIconRight || $hasClearButton;
4496
- let t19;
4497
- $[62] !== $hasIcon || $[63] !== disabled || $[64] !== fontSize2 || $[65] !== padding || $[66] !== readOnly || $[67] !== restProps || $[68] !== rootTheme.scheme || $[69] !== rootTheme.tone || $[70] !== space || $[71] !== t18 || $[72] !== type || $[73] !== weight ? (t19 = /* @__PURE__ */ jsx(Input, { "data-as": "input", "data-scheme": rootTheme.scheme, "data-tone": rootTheme.tone, ...restProps, $fontSize: fontSize2, $iconLeft: $hasIcon, $iconRight: t18, $padding: padding, $scheme: rootTheme.scheme, $space: space, $tone: rootTheme.tone, $weight: weight, disabled, readOnly, ref, type }), $[62] = $hasIcon, $[63] = disabled, $[64] = fontSize2, $[65] = padding, $[66] = readOnly, $[67] = restProps, $[68] = rootTheme.scheme, $[69] = rootTheme.tone, $[70] = space, $[71] = t18, $[72] = type, $[73] = weight, $[74] = t19) : t19 = $[74];
4498
- let t20;
4499
- $[75] !== clearButtonNode || $[76] !== presentationNode || $[77] !== t19 ? (t20 = /* @__PURE__ */ jsxs(InputRoot, { children: [
4500
- t19,
4501
- presentationNode,
4502
- clearButtonNode
4503
- ] }), $[75] = clearButtonNode, $[76] = presentationNode, $[77] = t19, $[78] = t20) : t20 = $[78];
4504
- let t21;
4505
- return $[79] !== prefixNode || $[80] !== rootTheme.tone || $[81] !== suffixNode || $[82] !== t20 ? (t21 = /* @__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: [
4506
3942
  prefixNode,
4507
- t20,
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
+ ] }),
4508
3948
  suffixNode
4509
- ] }), $[79] = prefixNode, $[80] = rootTheme.tone, $[81] = suffixNode, $[82] = t20, $[83] = t21) : t21 = $[83], t21;
3949
+ ] });
4510
3950
  });
4511
3951
  TextInput.displayName = "ForwardRef(TextInput)";
4512
- function _temp$2(event) {
4513
- event.preventDefault(), event.stopPropagation();
4514
- }
4515
- function _temp2(v) {
4516
- return v === 0 ? 0 : v === 1 || v === 2 ? 1 : v - 2;
4517
- }
4518
- function _temp3(v_0) {
4519
- return v_0 === 0 || v_0 === 1 ? 0 : v_0 === 2 ? 1 : v_0 - 1;
4520
- }
4521
3952
  function useDelayedState(initialState) {
4522
- const $ = c(3), [state, setState] = useState(initialState), delayedAction = useRef(void 0);
4523
- let t0;
4524
- $[0] === Symbol.for("react.memo_cache_sentinel") ? (t0 = (nextState, delay) => {
3953
+ const [state, setState] = useState(initialState), delayedAction = useRef(void 0), onStateChange = useCallback((nextState, delay) => {
4525
3954
  const action = () => {
4526
3955
  setState(nextState);
4527
3956
  };
4528
- if (delayedAction.current && (clearTimeout(delayedAction.current), delayedAction.current = void 0), !delay)
4529
- return action();
3957
+ if (delayedAction.current && (clearTimeout(delayedAction.current), delayedAction.current = void 0), !delay) return action();
4530
3958
  delayedAction.current = setTimeout(action, delay);
4531
- }, $[0] = t0) : t0 = $[0];
4532
- const onStateChange = t0;
4533
- let t1;
4534
- return $[1] !== state ? (t1 = [state, onStateChange], $[1] = state, $[2] = t1) : t1 = $[2], t1;
3959
+ }, []);
3960
+ return [state, onStateChange];
4535
3961
  }
4536
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 = {
4537
3963
  top: ["top-end", "top-start", "bottom", "left", "right"],
@@ -4550,9 +3976,7 @@ const DEFAULT_TOOLTIP_ARROW_WIDTH = 15, DEFAULT_TOOLTIP_ARROW_HEIGHT = 6, DEFAUL
4550
3976
  displayName: "MotionCard",
4551
3977
  componentId: "sc-1xn138w-0"
4552
3978
  })`will-change:transform;`, TooltipCard = forwardRef(function(props, ref) {
4553
- const $ = c(48);
4554
- let animate, arrow2, arrowRef, arrowX, arrowY, children, originX, originY, padding, placement, radius, restProps, scheme, shadow, style;
4555
- $[0] !== props ? ({
3979
+ const {
4556
3980
  animate,
4557
3981
  arrow: arrow2,
4558
3982
  arrowRef,
@@ -4568,56 +3992,37 @@ const DEFAULT_TOOLTIP_ARROW_WIDTH = 15, DEFAULT_TOOLTIP_ARROW_HEIGHT = 6, DEFAUL
4568
3992
  shadow,
4569
3993
  style,
4570
3994
  ...restProps
4571
- } = 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]);
4572
- const t0 = animate ? "transform" : void 0;
4573
- let t1;
4574
- $[16] !== originX || $[17] !== originY || $[18] !== style || $[19] !== t0 ? (t1 = {
3995
+ } = props, rootStyle2 = useMemo(() => ({
4575
3996
  originX,
4576
3997
  originY,
4577
- willChange: t0,
3998
+ willChange: animate ? "transform" : void 0,
4578
3999
  ...style
4579
- }, $[16] = originX, $[17] = originY, $[18] = style, $[19] = t0, $[20] = t1) : t1 = $[20];
4580
- const rootStyle2 = t1, t2 = arrowX !== null ? arrowX : void 0, t3 = arrowY !== null ? arrowY : void 0;
4581
- let t4;
4582
- $[21] !== t2 || $[22] !== t3 ? (t4 = {
4583
- left: t2,
4584
- top: t3,
4000
+ }), [animate, originX, originY, style]), arrowStyle = useMemo(() => ({
4001
+ left: arrowX !== null ? arrowX : void 0,
4002
+ top: arrowY !== null ? arrowY : void 0,
4585
4003
  right: void 0,
4586
4004
  bottom: void 0
4587
- }, $[21] = t2, $[22] = t3, $[23] = t4) : t4 = $[23];
4588
- const arrowStyle = t4, t5 = restProps;
4589
- let t6;
4590
- $[24] !== animate ? (t6 = animate ? ["hidden", "initial"] : void 0, $[24] = animate, $[25] = t6) : t6 = $[25];
4591
- let t7;
4592
- $[26] !== animate ? (t7 = animate ? ["visible", "scaleIn"] : void 0, $[26] = animate, $[27] = t7) : t7 = $[27];
4593
- let t8;
4594
- $[28] !== animate ? (t8 = animate ? ["hidden", "scaleOut"] : void 0, $[28] = animate, $[29] = t8) : t8 = $[29];
4595
- let t9;
4596
- $[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];
4597
- let t10;
4598
- 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: [
4599
4007
  children,
4600
- t9
4601
- ] }), $[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
+ ] });
4602
4010
  });
4603
4011
  TooltipCard.displayName = "ForwardRef(TooltipCard)";
4604
4012
  const TooltipDelayGroupContext = createGlobalScopedContext("@sanity/ui/context/tooltipDelayGroup", null);
4605
4013
  function TooltipDelayGroupProvider(props) {
4606
- const $ = c(9), {
4014
+ const {
4607
4015
  children,
4608
4016
  delay
4609
- } = 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;
4610
- let t1;
4611
- $[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(() => ({
4612
4018
  setIsGroupActive,
4613
4019
  openTooltipId,
4614
4020
  setOpenTooltipId,
4615
- openDelay: t0,
4021
+ // When the group is active, we want the next tooltip to open immediately.
4022
+ openDelay: isGroupActive ? 1 : openDelay,
4616
4023
  closeDelay
4617
- }, $[0] = closeDelay, $[1] = openTooltipId, $[2] = setIsGroupActive, $[3] = setOpenTooltipId, $[4] = t0, $[5] = t1) : t1 = $[5];
4618
- const value = t1;
4619
- let t2;
4620
- 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 });
4621
4026
  }
4622
4027
  TooltipDelayGroupProvider.displayName = "TooltipDelayGroupProvider";
4623
4028
  function useTooltipDelayGroup() {
@@ -4627,68 +4032,51 @@ const StyledTooltip = styled(Layer).withConfig({
4627
4032
  displayName: "StyledTooltip",
4628
4033
  componentId: "sc-13f2zvh-0"
4629
4034
  })`pointer-events:none;`, Tooltip = forwardRef(function(props, forwardedRef) {
4630
- const $ = c(135), boundaryElementContext = useBoundaryElement(), {
4035
+ const boundaryElementContext = useBoundaryElement(), {
4631
4036
  layer
4632
- } = useTheme_v2();
4633
- let _boundaryElement, _fallbackPlacementsProp, _zOffset, childProp, content, delay, disabled, portalProp, restProps, scheme, t0, t1, t2, t3, t4, t5;
4634
- $[0] !== props ? ({
4635
- animate: t0,
4636
- arrow: t1,
4037
+ } = useTheme_v2(), {
4038
+ animate: _animate = !1,
4039
+ arrow: arrowProp = !1,
4637
4040
  boundaryElement: _boundaryElement,
4638
4041
  children: childProp,
4639
4042
  content,
4640
4043
  disabled,
4641
4044
  fallbackPlacements: _fallbackPlacementsProp,
4642
- padding: t2,
4643
- placement: t3,
4045
+ padding = 2,
4046
+ placement: placementProp = "bottom",
4644
4047
  portal: portalProp,
4645
- radius: t4,
4048
+ radius = 2,
4646
4049
  scheme,
4647
- shadow: t5,
4050
+ shadow = 2,
4648
4051
  zOffset: _zOffset,
4649
4052
  delay,
4650
4053
  ...restProps
4651
- } = 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]);
4652
- 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, fallbackPlacements = useArrayProp(fallbackPlacementsProp), ref = useRef(null), [referenceElement, setReferenceElement] = useState(null), arrowRef = useRef(null), [tooltipMaxWidth, setTooltipMaxWidth] = useState(0);
4653
- let t6;
4654
- $[17] === Symbol.for("react.memo_cache_sentinel") ? (t6 = () => ref.current, $[17] = t6) : t6 = $[17], useImperativeHandle(forwardedRef, t6);
4655
- const portal = usePortal(), portalElement = typeof portalProp == "string" ? portal.elements?.[portalProp] || null : portal.element;
4656
- let t7;
4657
- $[18] !== animate || $[19] !== arrowProp || $[20] !== boundaryElement || $[21] !== fallbackPlacements ? (t7 = {
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({
4658
4057
  animate,
4659
4058
  arrowProp,
4660
4059
  arrowRef,
4661
4060
  boundaryElement,
4662
4061
  fallbackPlacements,
4663
- rootBoundary: "viewport"
4664
- }, $[18] = animate, $[19] = arrowProp, $[20] = boundaryElement, $[21] = fallbackPlacements, $[22] = t7) : t7 = $[22];
4665
- const middleware = useMiddleware(t7);
4666
- let t8;
4667
- $[23] !== referenceElement ? (t8 = {
4668
- reference: referenceElement
4669
- }, $[23] = referenceElement, $[24] = t8) : t8 = $[24];
4670
- let t9;
4671
- $[25] !== middleware || $[26] !== placementProp || $[27] !== t8 ? (t9 = {
4672
- middleware,
4673
- placement: placementProp,
4674
- whileElementsMounted: autoUpdate,
4675
- elements: t8
4676
- }, $[25] = middleware, $[26] = placementProp, $[27] = t8, $[28] = t9) : t9 = $[28];
4677
- const {
4062
+ rootBoundary
4063
+ }), {
4678
4064
  floatingStyles,
4679
4065
  placement,
4680
4066
  middlewareData,
4681
4067
  refs,
4682
4068
  update
4683
- } = useFloating(t9), 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();
4684
- let t10;
4685
- $[29] !== delayGroupContext ? (t10 = delayGroupContext || {}, $[29] = delayGroupContext, $[30] = t10) : t10 = $[30];
4686
- 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(), {
4687
4077
  setIsGroupActive,
4688
4078
  setOpenTooltipId
4689
- } = t10, 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;
4690
- let t11;
4691
- $[31] !== closeDelay || $[32] !== isInsideGroup || $[33] !== openDelay || $[34] !== setIsGroupActive || $[35] !== setIsOpen || $[36] !== setOpenTooltipId || $[37] !== tooltipId ? (t11 = (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) => {
4692
4080
  if (isInsideGroup)
4693
4081
  if (open) {
4694
4082
  const groupedOpenDelay = immediate ? 0 : openDelay;
@@ -4699,196 +4087,108 @@ const StyledTooltip = styled(Layer).withConfig({
4699
4087
  }
4700
4088
  else
4701
4089
  setIsOpen(open, immediate ? 0 : open ? openDelay : closeDelay);
4702
- }, $[31] = closeDelay, $[32] = isInsideGroup, $[33] = openDelay, $[34] = setIsGroupActive, $[35] = setIsOpen, $[36] = setOpenTooltipId, $[37] = tooltipId, $[38] = t11) : t11 = $[38];
4703
- const handleIsOpenChange = t11;
4704
- let t12;
4705
- $[39] !== childProp?.props || $[40] !== handleIsOpenChange ? (t12 = (e) => {
4090
+ }, [isInsideGroup, openDelay, setIsGroupActive, setOpenTooltipId, tooltipId, closeDelay, setIsOpen]), handleBlur = useCallback((e) => {
4706
4091
  handleIsOpenChange(!1), childProp?.props?.onBlur?.(e);
4707
- }, $[39] = childProp?.props, $[40] = handleIsOpenChange, $[41] = t12) : t12 = $[41];
4708
- const handleBlur = t12;
4709
- let t13;
4710
- $[42] !== childProp?.props || $[43] !== handleIsOpenChange ? (t13 = (e_0) => {
4711
- handleIsOpenChange(!1, !0), childProp?.props.onClick?.(e_0);
4712
- }, $[42] = childProp?.props, $[43] = handleIsOpenChange, $[44] = t13) : t13 = $[44];
4713
- const handleClick = t13;
4714
- let t14;
4715
- $[45] !== childProp?.props || $[46] !== handleIsOpenChange ? (t14 = (e_1) => {
4716
- handleIsOpenChange(!1, !0), childProp?.props.onContextMenu?.(e_1);
4717
- }, $[45] = childProp?.props, $[46] = handleIsOpenChange, $[47] = t14) : t14 = $[47];
4718
- const handleContextMenu = t14;
4719
- let t15;
4720
- $[48] !== childProp?.props || $[49] !== handleIsOpenChange ? (t15 = (e_2) => {
4721
- handleIsOpenChange(!0), childProp?.props?.onFocus?.(e_2);
4722
- }, $[48] = childProp?.props, $[49] = handleIsOpenChange, $[50] = t15) : t15 = $[50];
4723
- const handleFocus = t15;
4724
- let t16;
4725
- $[51] !== childProp?.props || $[52] !== handleIsOpenChange ? (t16 = (e_3) => {
4726
- handleIsOpenChange(!0), childProp?.props?.onMouseEnter?.(e_3);
4727
- }, $[51] = childProp?.props, $[52] = handleIsOpenChange, $[53] = t16) : t16 = $[53];
4728
- const handleMouseEnter = t16;
4729
- let t17;
4730
- $[54] !== childProp?.props || $[55] !== handleIsOpenChange ? (t17 = (e_4) => {
4731
- handleIsOpenChange(!1), childProp?.props?.onMouseLeave?.(e_4);
4732
- }, $[54] = childProp?.props, $[55] = handleIsOpenChange, $[56] = t17) : t17 = $[56];
4733
- const handleMouseLeave = t17;
4734
- let t18;
4735
- $[57] !== handleIsOpenChange || $[58] !== isInsideGroup || $[59] !== referenceElement || $[60] !== showTooltip ? (t18 = {
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({
4736
4104
  handleIsOpenChange,
4737
4105
  referenceElement,
4738
4106
  showTooltip,
4739
4107
  isInsideGroup
4740
- }, $[57] = handleIsOpenChange, $[58] = isInsideGroup, $[59] = referenceElement, $[60] = showTooltip, $[61] = t18) : t18 = $[61], useCloseOnMouseLeave(t18);
4741
- let t19, t20;
4742
- $[62] !== disabled || $[63] !== handleIsOpenChange || $[64] !== showTooltip ? (t19 = () => {
4108
+ }), useEffect(() => {
4743
4109
  disabled && showTooltip && handleIsOpenChange(!1);
4744
- }, t20 = [disabled, handleIsOpenChange, showTooltip], $[62] = disabled, $[63] = handleIsOpenChange, $[64] = showTooltip, $[65] = t19, $[66] = t20) : (t19 = $[65], t20 = $[66]), useEffect(t19, t20);
4745
- let t21, t22;
4746
- $[67] !== content || $[68] !== handleIsOpenChange || $[69] !== showTooltip ? (t21 = () => {
4110
+ }, [disabled, handleIsOpenChange, showTooltip]), useEffect(() => {
4747
4111
  !content && showTooltip && handleIsOpenChange(!1);
4748
- }, t22 = [content, handleIsOpenChange, showTooltip], $[67] = content, $[68] = handleIsOpenChange, $[69] = showTooltip, $[70] = t21, $[71] = t22) : (t21 = $[70], t22 = $[71]), useEffect(t21, t22);
4749
- let t23, t24;
4750
- $[72] !== handleIsOpenChange || $[73] !== showTooltip ? (t23 = () => {
4751
- if (!showTooltip)
4752
- return;
4753
- const handleWindowKeyDown = function(event) {
4112
+ }, [content, handleIsOpenChange, showTooltip]), useEffect(() => {
4113
+ if (!showTooltip) return;
4114
+ function handleWindowKeyDown(event) {
4754
4115
  event.key === "Escape" && handleIsOpenChange(!1, !0);
4755
- };
4116
+ }
4756
4117
  return window.addEventListener("keydown", handleWindowKeyDown), () => {
4757
4118
  window.removeEventListener("keydown", handleWindowKeyDown);
4758
4119
  };
4759
- }, t24 = [handleIsOpenChange, showTooltip], $[72] = handleIsOpenChange, $[73] = showTooltip, $[74] = t23, $[75] = t24) : (t23 = $[74], t24 = $[75]), useEffect(t23, t24);
4760
- let t25;
4761
- $[76] !== boundaryElement || $[77] !== portalElement?.offsetWidth ? (t25 = () => {
4120
+ }, [handleIsOpenChange, showTooltip]), useLayoutEffect(() => {
4762
4121
  const availableWidths = [...boundaryElement ? [boundaryElement.offsetWidth] : [], portalElement?.offsetWidth || document.body.offsetWidth];
4763
4122
  setTooltipMaxWidth(Math.min(...availableWidths) - DEFAULT_TOOLTIP_PADDING * 2);
4764
- }, $[76] = boundaryElement, $[77] = portalElement?.offsetWidth, $[78] = t25) : t25 = $[78];
4765
- let t26;
4766
- $[79] !== boundaryElement || $[80] !== portalElement ? (t26 = [boundaryElement, portalElement], $[79] = boundaryElement, $[80] = portalElement, $[81] = t26) : t26 = $[81], useLayoutEffect(t25, t26);
4767
- let t27;
4768
- $[82] !== update ? (t27 = (arrowEl) => {
4123
+ }, [boundaryElement, portalElement]);
4124
+ const setArrow = useCallback((arrowEl) => {
4769
4125
  arrowRef.current = arrowEl, update();
4770
- }, $[82] = update, $[83] = t27) : t27 = $[83];
4771
- const setArrow = t27;
4772
- let t28;
4773
- $[84] !== refs ? (t28 = (node) => {
4126
+ }, [update]), setFloating = useCallback((node) => {
4774
4127
  ref.current = node, refs.setFloating(node);
4775
- }, $[84] = refs, $[85] = t28) : t28 = $[85];
4776
- const setFloating = t28;
4777
- let t29;
4778
- bb0: {
4779
- if (!childProp) {
4780
- t29 = null;
4781
- break bb0;
4782
- }
4783
- let t302;
4784
- $[86] !== childProp || $[87] !== handleBlur || $[88] !== handleClick || $[89] !== handleContextMenu || $[90] !== handleFocus || $[91] !== handleMouseEnter || $[92] !== handleMouseLeave ? (t302 = cloneElement(childProp, {
4785
- onBlur: handleBlur,
4786
- onFocus: handleFocus,
4787
- onMouseEnter: handleMouseEnter,
4788
- onMouseLeave: handleMouseLeave,
4789
- onClick: handleClick,
4790
- onContextMenu: handleContextMenu,
4791
- ref: setReferenceElement
4792
- }), $[86] = childProp, $[87] = handleBlur, $[88] = handleClick, $[89] = handleContextMenu, $[90] = handleFocus, $[91] = handleMouseEnter, $[92] = handleMouseLeave, $[93] = t302) : t302 = $[93], t29 = t302;
4793
- }
4794
- const child = t29;
4795
- let t30;
4796
- $[94] !== childProp ? (t30 = childProp ? getElementRef(childProp) : null, $[94] = childProp, $[95] = t30) : t30 = $[95];
4797
- let t31, t32;
4798
- if ($[96] !== referenceElement ? (t31 = () => referenceElement, t32 = [referenceElement], $[96] = referenceElement, $[97] = t31, $[98] = t32) : (t31 = $[97], t32 = $[98]), useImperativeHandle(t30, t31, t32), !child) {
4799
- let t332;
4800
- return $[99] === Symbol.for("react.memo_cache_sentinel") ? (t332 = /* @__PURE__ */ jsx(Fragment, {}), $[99] = t332) : t332 = $[99], t332;
4801
- }
4802
- if (disabled)
4803
- return child;
4804
- const t33 = tooltipMaxWidth > 0 ? `${tooltipMaxWidth}px` : void 0;
4805
- let t34;
4806
- $[100] !== floatingStyles || $[101] !== t33 ? (t34 = {
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: {
4807
4140
  ...floatingStyles,
4808
- maxWidth: t33
4809
- }, $[100] = floatingStyles, $[101] = t33, $[102] = t34) : t34 = $[102];
4810
- let t35;
4811
- $[103] !== animate || $[104] !== arrowProp || $[105] !== arrowX || $[106] !== arrowY || $[107] !== content || $[108] !== originX || $[109] !== originY || $[110] !== padding || $[111] !== placement || $[112] !== radius || $[113] !== restProps || $[114] !== scheme || $[115] !== setArrow || $[116] !== setFloating || $[117] !== shadow ? (t35 = /* @__PURE__ */ jsx(TooltipCard, { ...restProps, animate, arrow: arrowProp, arrowRef: setArrow, arrowX, arrowY, originX, originY, padding, placement, radius, ref: setFloating, scheme, shadow, children: content }), $[103] = animate, $[104] = arrowProp, $[105] = arrowX, $[106] = arrowY, $[107] = content, $[108] = originX, $[109] = originY, $[110] = padding, $[111] = placement, $[112] = radius, $[113] = restProps, $[114] = scheme, $[115] = setArrow, $[116] = setFloating, $[117] = shadow, $[118] = t35) : t35 = $[118];
4812
- let t36;
4813
- $[119] !== restProps || $[120] !== setFloating || $[121] !== t34 || $[122] !== t35 || $[123] !== zOffset ? (t36 = /* @__PURE__ */ jsx(StyledTooltip, { "data-ui": "Tooltip", ...restProps, ref: setFloating, style: t34, zOffset, children: t35 }), $[119] = restProps, $[120] = setFloating, $[121] = t34, $[122] = t35, $[123] = zOffset, $[124] = t36) : t36 = $[124];
4814
- const tooltip = t36;
4815
- let t37;
4816
- $[125] !== portalProp || $[126] !== showTooltip || $[127] !== tooltip ? (t37 = showTooltip && (portalProp ? /* @__PURE__ */ jsx(Portal, { __unstable_name: typeof portalProp == "string" ? portalProp : void 0, children: tooltip }) : tooltip), $[125] = portalProp, $[126] = showTooltip, $[127] = tooltip, $[128] = t37) : t37 = $[128];
4817
- const children = t37;
4818
- let t38;
4819
- $[129] !== animate || $[130] !== children ? (t38 = animate ? /* @__PURE__ */ jsx(AnimatePresence, { children }) : children, $[129] = animate, $[130] = children, $[131] = t38) : t38 = $[131];
4820
- let t39;
4821
- return $[132] !== child || $[133] !== t38 ? (t39 = /* @__PURE__ */ jsxs(Fragment, { children: [
4822
- t38,
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,
4823
4145
  child
4824
- ] }), $[132] = child, $[133] = t38, $[134] = t39) : t39 = $[134], t39;
4146
+ ] });
4825
4147
  });
4826
4148
  Tooltip.displayName = "ForwardRef(Tooltip)";
4827
- function useMiddleware(t0) {
4828
- const $ = c(17), {
4829
- animate,
4830
- arrowProp,
4831
- arrowRef,
4832
- boundaryElement,
4833
- fallbackPlacements,
4834
- rootBoundary
4835
- } = t0;
4836
- let ret;
4837
- if ($[0] !== animate || $[1] !== arrowProp || $[2] !== arrowRef || $[3] !== boundaryElement || $[4] !== fallbackPlacements || $[5] !== rootBoundary) {
4838
- ret = [];
4839
- const t1 = boundaryElement || void 0;
4840
- let t2;
4841
- $[7] !== fallbackPlacements || $[8] !== rootBoundary || $[9] !== t1 ? (t2 = flip({
4842
- 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,
4843
4161
  fallbackPlacements,
4844
4162
  padding: DEFAULT_TOOLTIP_PADDING,
4845
4163
  rootBoundary
4846
- }), $[7] = fallbackPlacements, $[8] = rootBoundary, $[9] = t1, $[10] = t2) : t2 = $[10], ret.push(t2);
4847
- let t3;
4848
- $[11] === Symbol.for("react.memo_cache_sentinel") ? (t3 = offset({
4164
+ })), ret.push(offset({
4849
4165
  mainAxis: DEFAULT_TOOLTIP_DISTANCE
4850
- }), $[11] = t3) : t3 = $[11], ret.push(t3);
4851
- const t4 = boundaryElement || void 0;
4852
- let t5;
4853
- if ($[12] !== rootBoundary || $[13] !== t4 ? (t5 = shift({
4854
- boundary: t4,
4166
+ })), ret.push(shift({
4167
+ boundary: boundaryElement || void 0,
4855
4168
  rootBoundary,
4856
4169
  padding: DEFAULT_TOOLTIP_PADDING
4857
- }), $[12] = rootBoundary, $[13] = t4, $[14] = t5) : t5 = $[14], ret.push(t5), arrowProp) {
4858
- let t6;
4859
- $[15] !== arrowRef ? (t6 = arrow({
4860
- element: arrowRef,
4861
- padding: DEFAULT_TOOLTIP_PADDING
4862
- }), $[15] = arrowRef, $[16] = t6) : t6 = $[16], ret.push(t6);
4863
- }
4864
- animate && ret.push(origin), $[0] = animate, $[1] = arrowProp, $[2] = arrowRef, $[3] = boundaryElement, $[4] = fallbackPlacements, $[5] = rootBoundary, $[6] = ret;
4865
- } else
4866
- ret = $[6];
4867
- return ret;
4868
- }
4869
- function useCloseOnMouseLeave(t0) {
4870
- const $ = c(10), {
4871
- handleIsOpenChange,
4872
- referenceElement,
4873
- showTooltip,
4874
- isInsideGroup
4875
- } = t0;
4876
- let t1;
4877
- $[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) => {
4878
4183
  referenceElement && (referenceElement === target || target instanceof Node && referenceElement.contains(target) || (handleIsOpenChange(!1), teardown()));
4879
- }, $[0] = handleIsOpenChange, $[1] = referenceElement, $[2] = t1) : t1 = $[2];
4880
- const onMouseMove = useEffectEvent(t1);
4881
- let t2;
4882
- $[3] !== isInsideGroup || $[4] !== onMouseMove || $[5] !== showTooltip ? (t2 = () => {
4883
- if (!showTooltip || isInsideGroup)
4884
- return;
4184
+ });
4185
+ useEffect(() => {
4186
+ if (!showTooltip || isInsideGroup) return;
4885
4187
  const handleMouseMove = (event) => {
4886
4188
  onMouseMove(event.target, () => window.removeEventListener("mousemove", handleMouseMove));
4887
4189
  };
4888
4190
  return window.addEventListener("mousemove", handleMouseMove), () => window.removeEventListener("mousemove", handleMouseMove);
4889
- }, $[3] = isInsideGroup, $[4] = onMouseMove, $[5] = showTooltip, $[6] = t2) : t2 = $[6];
4890
- let t3;
4891
- $[7] !== isInsideGroup || $[8] !== showTooltip ? (t3 = [isInsideGroup, showTooltip], $[7] = isInsideGroup, $[8] = showTooltip, $[9] = t3) : t3 = $[9], useEffect(t2, t3);
4191
+ }, [isInsideGroup, showTooltip]);
4892
4192
  }
4893
4193
  const StyledHotkeys = styled.kbd.withConfig({
4894
4194
  displayName: "StyledHotkeys",
@@ -4897,31 +4197,15 @@ const StyledHotkeys = styled.kbd.withConfig({
4897
4197
  displayName: "Key",
4898
4198
  componentId: "sc-b37mge-1"
4899
4199
  })`&:not([hidden]){display:block;}`, Hotkeys = forwardRef(function(props, ref) {
4900
- const $ = c(24);
4901
- let fontSize2, keys, padding, radius, restProps, t0;
4902
- $[0] !== props ? ({
4200
+ const {
4903
4201
  fontSize: fontSize2,
4904
4202
  keys,
4905
4203
  padding,
4906
4204
  radius,
4907
- space: t0,
4205
+ space: spaceProp = 0.5,
4908
4206
  ...restProps
4909
- } = 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]);
4910
- const space = useArrayProp(t0 === void 0 ? 0.5 : t0);
4911
- if (!keys || keys.length === 0) {
4912
- let t12;
4913
- return $[7] === Symbol.for("react.memo_cache_sentinel") ? (t12 = /* @__PURE__ */ jsx(Fragment, {}), $[7] = t12) : t12 = $[7], t12;
4914
- }
4915
- let t1;
4916
- if ($[8] !== fontSize2 || $[9] !== keys || $[10] !== padding || $[11] !== radius) {
4917
- let t22;
4918
- $[13] !== fontSize2 || $[14] !== padding || $[15] !== radius ? (t22 = (key2, i) => /* @__PURE__ */ jsx(Key, { fontSize: fontSize2, padding, radius, children: key2 }, i), $[13] = fontSize2, $[14] = padding, $[15] = radius, $[16] = t22) : t22 = $[16], t1 = keys.map(t22), $[8] = fontSize2, $[9] = keys, $[10] = padding, $[11] = radius, $[12] = t1;
4919
- } else
4920
- t1 = $[12];
4921
- let t2;
4922
- $[17] !== space || $[18] !== t1 ? (t2 = /* @__PURE__ */ jsx(Inline, { as: "span", space, children: t1 }), $[17] = space, $[18] = t1, $[19] = t2) : t2 = $[19];
4923
- let t3;
4924
- return $[20] !== ref || $[21] !== restProps || $[22] !== t2 ? (t3 = /* @__PURE__ */ jsx(StyledHotkeys, { "data-ui": "Hotkeys", ...restProps, ref, children: t2 }), $[20] = ref, $[21] = restProps, $[22] = t2, $[23] = t3) : t3 = $[23], t3;
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)) }) });
4925
4209
  });
4926
4210
  Hotkeys.displayName = "ForwardRef(Hotkeys)";
4927
4211
  const MenuContext = createGlobalScopedContext("@sanity/ui/context/menu", null);
@@ -4962,24 +4246,16 @@ function _sortElements(rootElement, elements) {
4962
4246
  elements.sort(_sort);
4963
4247
  }
4964
4248
  function useMenuController(props) {
4965
- const $ = c(21), {
4249
+ const {
4966
4250
  onKeyDown,
4967
4251
  originElement,
4968
4252
  shouldFocus,
4969
4253
  rootElementRef
4970
- } = props;
4971
- let t0;
4972
- $[0] === Symbol.for("react.memo_cache_sentinel") ? (t0 = [], $[0] = t0) : t0 = $[0];
4973
- const elementsRef = useRef(t0), [activeIndex, _setActiveIndex] = useState(-1), activeIndexRef = useRef(activeIndex), [activeElement, setActiveElement] = useState(null);
4974
- let t1;
4975
- $[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) => {
4976
4255
  _setActiveIndex(nextActiveIndex), activeIndexRef.current = nextActiveIndex, setActiveElement(elementsRef.current[nextActiveIndex] || null);
4977
- }, $[1] = t1) : t1 = $[1];
4978
- const setActiveIndex = t1;
4979
- let t2;
4980
- $[2] !== rootElementRef ? (t2 = (element, selected) => {
4981
- if (!element)
4982
- return _temp$1;
4256
+ }, []), mount = useCallback((element, selected) => {
4257
+ if (!element) return () => {
4258
+ };
4983
4259
  if (elementsRef.current.indexOf(element) === -1 && (elementsRef.current.push(element), _sortElements(rootElementRef.current, elementsRef.current)), selected) {
4984
4260
  const selectedIndex = elementsRef.current.indexOf(element);
4985
4261
  setActiveIndex(selectedIndex);
@@ -4988,10 +4264,7 @@ function useMenuController(props) {
4988
4264
  const idx = elementsRef.current.indexOf(element);
4989
4265
  idx > -1 && elementsRef.current.splice(idx, 1);
4990
4266
  };
4991
- }, $[2] = rootElementRef, $[3] = t2) : t2 = $[3];
4992
- const mount = t2;
4993
- let t3;
4994
- $[4] !== onKeyDown || $[5] !== originElement ? (t3 = (event) => {
4267
+ }, [rootElementRef, setActiveIndex]), handleKeyDown = useCallback((event) => {
4995
4268
  if (event.key === "Tab") {
4996
4269
  originElement && originElement.focus();
4997
4270
  return;
@@ -4999,77 +4272,64 @@ function useMenuController(props) {
4999
4272
  if (event.key === "Home") {
5000
4273
  event.preventDefault(), event.stopPropagation();
5001
4274
  const el = _getFocusableElements(elementsRef.current)[0];
5002
- if (!el)
5003
- return;
4275
+ if (!el) return;
5004
4276
  const currentIndex = elementsRef.current.indexOf(el);
5005
4277
  setActiveIndex(currentIndex);
5006
4278
  return;
5007
4279
  }
5008
4280
  if (event.key === "End") {
5009
4281
  event.preventDefault(), event.stopPropagation();
5010
- const focusableElements_0 = _getFocusableElements(elementsRef.current), el_0 = focusableElements_0[focusableElements_0.length - 1];
5011
- if (!el_0)
5012
- return;
5013
- const currentIndex_0 = elementsRef.current.indexOf(el_0);
5014
- 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);
5015
4286
  return;
5016
4287
  }
5017
4288
  if (event.key === "ArrowUp") {
5018
4289
  event.preventDefault(), event.stopPropagation();
5019
- const focusableElements_1 = _getFocusableElements(elementsRef.current), focusableLen = focusableElements_1.length;
5020
- if (focusableLen === 0)
5021
- return;
4290
+ const focusableElements = _getFocusableElements(elementsRef.current), focusableLen = focusableElements.length;
4291
+ if (focusableLen === 0) return;
5022
4292
  const focusedElement = elementsRef.current[activeIndexRef.current];
5023
- let focusedIndex = focusableElements_1.indexOf(focusedElement);
4293
+ let focusedIndex = focusableElements.indexOf(focusedElement);
5024
4294
  focusedIndex = (focusedIndex - 1 + focusableLen) % focusableLen;
5025
- const el_1 = focusableElements_1[focusedIndex], currentIndex_1 = elementsRef.current.indexOf(el_1);
5026
- setActiveIndex(currentIndex_1);
4295
+ const el = focusableElements[focusedIndex], currentIndex = elementsRef.current.indexOf(el);
4296
+ setActiveIndex(currentIndex);
5027
4297
  return;
5028
4298
  }
5029
4299
  if (event.key === "ArrowDown") {
5030
4300
  event.preventDefault(), event.stopPropagation();
5031
- const focusableElements_2 = _getFocusableElements(elementsRef.current), focusableLen_0 = focusableElements_2.length;
5032
- if (focusableLen_0 === 0)
5033
- return;
5034
- const focusedElement_0 = elementsRef.current[activeIndexRef.current];
5035
- let focusedIndex_0 = focusableElements_2.indexOf(focusedElement_0);
5036
- focusedIndex_0 = (focusedIndex_0 + 1) % focusableLen_0;
5037
- const el_2 = focusableElements_2[focusedIndex_0], currentIndex_2 = elementsRef.current.indexOf(el_2);
5038
- 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);
5039
4308
  return;
5040
4309
  }
5041
4310
  onKeyDown && onKeyDown(event);
5042
- }, $[4] = onKeyDown, $[5] = originElement, $[6] = t3) : t3 = $[6];
5043
- const handleKeyDown = t3;
5044
- let t4;
5045
- $[7] === Symbol.for("react.memo_cache_sentinel") ? (t4 = (event_0) => {
5046
- const element_0 = event_0.currentTarget, currentIndex_3 = elementsRef.current.indexOf(element_0);
5047
- setActiveIndex(currentIndex_3);
5048
- }, $[7] = t4) : t4 = $[7];
5049
- const handleItemMouseEnter = t4;
5050
- let t5;
5051
- $[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(() => {
5052
4315
  setActiveIndex(-2), rootElementRef.current?.focus();
5053
- }, $[8] = rootElementRef, $[9] = t5) : t5 = $[9];
5054
- const handleItemMouseLeave = t5;
5055
- let t6, t7;
5056
- $[10] !== activeIndex || $[11] !== rootElementRef || $[12] !== shouldFocus ? (t6 = () => {
5057
- if (!rootElementRef.current)
5058
- return;
4316
+ }, [rootElementRef, setActiveIndex]);
4317
+ return useEffect(() => {
4318
+ if (!rootElementRef.current) return;
5059
4319
  const rafId = requestAnimationFrame(() => {
5060
4320
  if (activeIndex === -1) {
5061
4321
  if (shouldFocus === "first") {
5062
- const el_3 = _getFocusableElements(elementsRef.current)[0];
5063
- if (el_3) {
5064
- const currentIndex_4 = elementsRef.current.indexOf(el_3);
5065
- setActiveIndex(currentIndex_4);
4322
+ const el = _getFocusableElements(elementsRef.current)[0];
4323
+ if (el) {
4324
+ const currentIndex = elementsRef.current.indexOf(el);
4325
+ setActiveIndex(currentIndex);
5066
4326
  }
5067
4327
  }
5068
4328
  if (shouldFocus === "last") {
5069
- const focusableElements_4 = _getFocusableElements(elementsRef.current), el_4 = focusableElements_4[focusableElements_4.length - 1];
5070
- if (el_4) {
5071
- const currentIndex_5 = elementsRef.current.indexOf(el_4);
5072
- 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);
5073
4333
  }
5074
4334
  }
5075
4335
  return;
@@ -5077,83 +4337,61 @@ function useMenuController(props) {
5077
4337
  (elementsRef.current[activeIndex] || null)?.focus();
5078
4338
  });
5079
4339
  return () => cancelAnimationFrame(rafId);
5080
- }, t7 = [activeIndex, rootElementRef, setActiveIndex, shouldFocus], $[10] = activeIndex, $[11] = rootElementRef, $[12] = shouldFocus, $[13] = t6, $[14] = t7) : (t6 = $[13], t7 = $[14]), useEffect(t6, t7);
5081
- let t8;
5082
- return $[15] !== activeElement || $[16] !== activeIndex || $[17] !== handleItemMouseLeave || $[18] !== handleKeyDown || $[19] !== mount ? (t8 = {
4340
+ }, [activeIndex, rootElementRef, setActiveIndex, shouldFocus]), {
5083
4341
  activeElement,
5084
4342
  activeIndex,
5085
4343
  handleItemMouseEnter,
5086
4344
  handleItemMouseLeave,
5087
4345
  handleKeyDown,
5088
4346
  mount
5089
- }, $[15] = activeElement, $[16] = activeIndex, $[17] = handleItemMouseLeave, $[18] = handleKeyDown, $[19] = mount, $[20] = t8) : t8 = $[20], t8;
5090
- }
5091
- function _temp$1() {
4347
+ };
5092
4348
  }
5093
4349
  const StyledMenu = styled(Box).withConfig({
5094
4350
  displayName: "StyledMenu",
5095
4351
  componentId: "sc-xt0tnv-0"
5096
4352
  })`outline:none;overflow:auto;`, Menu = forwardRef(function(props, forwardedRef) {
5097
- const $ = c(49);
5098
- let _shouldFocus, children, onClickOutside, onEscape, onItemClick, onItemSelect, onKeyDown, originElement, registerElement, restProps, t0, t1;
5099
- if ($[0] !== props) {
5100
- const {
5101
- children: t22,
5102
- focusFirst,
5103
- focusLast,
5104
- onClickOutside: t32,
5105
- onEscape: t42,
5106
- onItemClick: t52,
5107
- onItemSelect: t62,
5108
- onKeyDown: t72,
5109
- originElement: t82,
5110
- padding: t92,
5111
- registerElement: t102,
5112
- shouldFocus: t112,
5113
- space: t122,
5114
- ...t13
5115
- } = props;
5116
- 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;
5117
- } else
5118
- _shouldFocus = $[1], children = $[2], onClickOutside = $[3], onEscape = $[4], onItemClick = $[5], onItemSelect = $[6], onKeyDown = $[7], originElement = $[8], registerElement = $[9], restProps = $[10], t0 = $[11], t1 = $[12];
5119
- 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);
5120
- let t2;
5121
- $[13] === Symbol.for("react.memo_cache_sentinel") ? (t2 = () => ref.current, $[13] = t2) : t2 = $[13], useImperativeHandle(forwardedRef, t2);
5122
4353
  const {
5123
- isTopLayer
5124
- } = useLayer();
5125
- let t3;
5126
- $[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,
5127
4363
  onKeyDown,
5128
4364
  originElement,
5129
- shouldFocus,
5130
- rootElementRef: ref
5131
- }, $[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);
5132
4372
  const {
4373
+ isTopLayer
4374
+ } = useLayer(), {
5133
4375
  activeElement,
5134
4376
  activeIndex,
5135
4377
  handleItemMouseEnter,
5136
4378
  handleItemMouseLeave,
5137
4379
  handleKeyDown,
5138
4380
  mount
5139
- } = useMenuController(t3), unregisterElementRef = useRef(null);
5140
- let t4;
5141
- $[18] !== registerElement ? (t4 = (el) => {
4381
+ } = useMenuController({
4382
+ onKeyDown,
4383
+ originElement,
4384
+ shouldFocus,
4385
+ rootElementRef: ref
4386
+ }), unregisterElementRef = useRef(null), handleRefChange = useCallback((el) => {
5142
4387
  unregisterElementRef.current && (unregisterElementRef.current(), unregisterElementRef.current = null), ref.current = el, ref.current && registerElement && (unregisterElementRef.current = registerElement(ref.current));
5143
- }, $[18] = registerElement, $[19] = t4) : t4 = $[19];
5144
- const handleRefChange = t4;
5145
- let t5, t6;
5146
- $[20] !== activeIndex || $[21] !== onItemSelect ? (t5 = () => {
4388
+ }, [registerElement]);
4389
+ useEffect(() => {
5147
4390
  onItemSelect && onItemSelect(activeIndex);
5148
- }, t6 = [activeIndex, onItemSelect], $[20] = activeIndex, $[21] = onItemSelect, $[22] = t5, $[23] = t6) : (t5 = $[22], t6 = $[23]), useEffect(t5, t6);
5149
- let t7;
5150
- $[24] === Symbol.for("react.memo_cache_sentinel") ? (t7 = () => [ref.current], $[24] = t7) : t7 = $[24], useClickOutsideEvent(isTopLayer && onClickOutside, t7);
5151
- let t8;
5152
- $[25] !== isTopLayer || $[26] !== onEscape ? (t8 = (event) => {
4391
+ }, [activeIndex, onItemSelect]), useClickOutsideEvent(isTopLayer && onClickOutside, () => [ref.current]), useGlobalKeyDown(useCallback((event) => {
5153
4392
  isTopLayer && event.key === "Escape" && (event.stopPropagation(), onEscape && onEscape());
5154
- }, $[25] = isTopLayer, $[26] = onEscape, $[27] = t8) : t8 = $[27], useGlobalKeyDown(t8);
5155
- let t9;
5156
- $[28] !== activeElement || $[29] !== handleItemMouseEnter || $[30] !== handleItemMouseLeave || $[31] !== mount || $[32] !== onClickOutside || $[33] !== onEscape || $[34] !== onItemClick || $[35] !== registerElement ? (t9 = {
4393
+ }, [isTopLayer, onEscape]));
4394
+ const value = useMemo(() => ({
5157
4395
  version: 2,
5158
4396
  activeElement,
5159
4397
  mount,
@@ -5163,14 +4401,8 @@ const StyledMenu = styled(Box).withConfig({
5163
4401
  onItemMouseEnter: handleItemMouseEnter,
5164
4402
  onItemMouseLeave: handleItemMouseLeave,
5165
4403
  registerElement
5166
- }, $[28] = activeElement, $[29] = handleItemMouseEnter, $[30] = handleItemMouseLeave, $[31] = mount, $[32] = onClickOutside, $[33] = onEscape, $[34] = onItemClick, $[35] = registerElement, $[36] = t9) : t9 = $[36];
5167
- const value = t9;
5168
- let t10;
5169
- $[37] !== children || $[38] !== space ? (t10 = /* @__PURE__ */ jsx(Stack, { space, children }), $[37] = children, $[38] = space, $[39] = t10) : t10 = $[39];
5170
- let t11;
5171
- $[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];
5172
- let t12;
5173
- 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 }) }) });
5174
4406
  });
5175
4407
  Menu.displayName = "ForwardRef(Menu)";
5176
4408
  const MenuDivider = styled.hr.withConfig({
@@ -5292,24 +4524,21 @@ function useMenu() {
5292
4524
  return value;
5293
4525
  }
5294
4526
  function MenuGroup(props) {
5295
- const $ = c(79);
5296
- let IconComponent, children, menuProps, onClick, popover, restProps, t0, t1, t2, t3, t4, t5, text;
5297
- $[0] !== props ? ({
5298
- as: t0,
4527
+ const {
4528
+ as = "button",
5299
4529
  children,
5300
- fontSize: t1,
4530
+ fontSize: fontSize2 = 1,
5301
4531
  icon: IconComponent,
5302
4532
  menu: menuProps,
5303
4533
  onClick,
5304
- padding: t2,
4534
+ padding = 3,
5305
4535
  popover,
5306
- radius: t3,
5307
- space: t4,
4536
+ radius = 2,
4537
+ space = 3,
5308
4538
  text,
5309
- tone: t5,
4539
+ tone = "default",
5310
4540
  ...restProps
5311
- } = 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]);
5312
- 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(), {
5313
4542
  scheme
5314
4543
  } = useRootTheme(), {
5315
4544
  activeElement,
@@ -5319,97 +4548,54 @@ function MenuGroup(props) {
5319
4548
  onItemClick,
5320
4549
  onItemMouseEnter: _onItemMouseEnter,
5321
4550
  registerElement
5322
- } = 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);
5323
- let t6;
5324
- $[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) => {
5325
4552
  setWithinMenu(!1), onItemMouseEnter(event), setOpen(!0);
5326
- }, $[14] = onItemMouseEnter, $[15] = t6) : t6 = $[15];
5327
- const handleMouseEnter = t6;
5328
- let t7;
5329
- $[16] !== rootElement ? (t7 = (event_0) => {
5330
- event_0.key === "ArrowLeft" && (event_0.stopPropagation(), setOpen(!1), requestAnimationFrame(() => {
4553
+ }, [onItemMouseEnter]), handleMenuKeyDown = useCallback((event) => {
4554
+ event.key === "ArrowLeft" && (event.stopPropagation(), setOpen(!1), requestAnimationFrame(() => {
5331
4555
  rootElement?.focus();
5332
4556
  }));
5333
- }, $[16] = rootElement, $[17] = t7) : t7 = $[17];
5334
- const handleMenuKeyDown = t7;
5335
- let t8;
5336
- $[18] !== onClick ? (t8 = (event_1) => {
5337
- onClick?.(event_1), setShouldFocus("first"), setOpen(!0);
5338
- }, $[18] = onClick, $[19] = t8) : t8 = $[19];
5339
- const handleClick = t8;
5340
- let t9;
5341
- $[20] !== onItemClick ? (t9 = () => {
4557
+ }, [rootElement]), handleClick = useCallback((event) => {
4558
+ onClick?.(event), setShouldFocus("first"), setOpen(!0);
4559
+ }, [onClick]), handleChildItemClick = useCallback(() => {
5342
4560
  setOpen(!1), onItemClick?.();
5343
- }, $[20] = onItemClick, $[21] = t9) : t9 = $[21];
5344
- const handleChildItemClick = t9;
5345
- let t10;
5346
- $[22] === Symbol.for("react.memo_cache_sentinel") ? (t10 = () => setWithinMenu(!0), $[22] = t10) : t10 = $[22];
5347
- const handleMenuMouseEnter = t10;
5348
- let t11, t12;
5349
- $[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);
5350
- let t13, t14;
5351
- $[27] !== active ? (t13 = () => {
4561
+ }, [onItemClick]), handleMenuMouseEnter = useCallback(() => setWithinMenu(!0), []);
4562
+ useEffect(() => mount(rootElement), [mount, rootElement]), useEffect(() => {
5352
4563
  active || setOpen(!1);
5353
- }, t14 = [active], $[27] = active, $[28] = t13, $[29] = t14) : (t13 = $[28], t14 = $[29]), useEffect(t13, t14);
5354
- let t15, t16;
5355
- $[30] !== open ? (t15 = () => {
4564
+ }, [active]), useEffect(() => {
5356
4565
  open || setWithinMenu(!1);
5357
- }, t16 = [open], $[30] = open, $[31] = t15, $[32] = t16) : (t15 = $[31], t16 = $[32]), useEffect(t15, t16);
5358
- let t17, t18;
5359
- $[33] !== shouldFocus ? (t17 = () => {
5360
- if (!shouldFocus)
5361
- return;
4566
+ }, [open]), useEffect(() => {
4567
+ if (!shouldFocus) return;
5362
4568
  const rafId = requestAnimationFrame(() => setShouldFocus(null));
5363
4569
  return () => cancelAnimationFrame(rafId);
5364
- }, t18 = [shouldFocus], $[33] = shouldFocus, $[34] = t17, $[35] = t18) : (t17 = $[34], t18 = $[35]), useEffect(t17, t18);
5365
- let t19;
5366
- $[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];
5367
- const childMenu = t19;
5368
- let t20;
5369
- $[45] === Symbol.for("react.memo_cache_sentinel") ? (t20 = (event_2) => {
5370
- const target = event_2.currentTarget;
5371
- 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") {
5372
4574
  setShouldFocus("first"), setOpen(!0), setWithinMenu(!0);
5373
4575
  return;
5374
4576
  }
5375
- }, $[45] = t20) : t20 = $[45];
5376
- const handleKeyDown = t20, t21 = as === "button" ? withinMenu : void 0, t22 = as !== "button" ? withinMenu : void 0, t23 = !withinMenu && active ? "" : void 0, t24 = useArrayProp(radius), t25 = as === "button" ? "button" : void 0;
5377
- let t26;
5378
- $[46] !== IconComponent || $[47] !== fontSize2 ? (t26 = IconComponent && /* @__PURE__ */ jsxs(Text, { size: fontSize2, children: [
5379
- isValidElement(IconComponent) && IconComponent,
5380
- isValidElementType(IconComponent) && /* @__PURE__ */ jsx(IconComponent, {})
5381
- ] }), $[46] = IconComponent, $[47] = fontSize2, $[48] = t26) : t26 = $[48];
5382
- let t27;
5383
- $[49] !== fontSize2 || $[50] !== text ? (t27 = /* @__PURE__ */ jsx(Box, { flex: 1, children: /* @__PURE__ */ jsx(Text, { size: fontSize2, textOverflow: "ellipsis", weight: "medium", children: text }) }), $[49] = fontSize2, $[50] = text, $[51] = t27) : t27 = $[51];
5384
- let t28;
5385
- $[52] === Symbol.for("react.memo_cache_sentinel") ? (t28 = /* @__PURE__ */ jsx(ChevronRightIcon, {}), $[52] = t28) : t28 = $[52];
5386
- let t29;
5387
- $[53] !== fontSize2 ? (t29 = /* @__PURE__ */ jsx(Text, { size: fontSize2, children: t28 }), $[53] = fontSize2, $[54] = t29) : t29 = $[54];
5388
- let t30;
5389
- $[55] !== padding || $[56] !== space || $[57] !== t26 || $[58] !== t27 || $[59] !== t29 ? (t30 = /* @__PURE__ */ jsxs(Flex, { gap: space, padding, children: [
5390
- t26,
5391
- t27,
5392
- t29
5393
- ] }), $[55] = padding, $[56] = space, $[57] = t26, $[58] = t27, $[59] = t29, $[60] = t30) : t30 = $[60];
5394
- let t31;
5395
- $[61] !== as || $[62] !== handleClick || $[63] !== handleMouseEnter || $[64] !== restProps || $[65] !== scheme || $[66] !== t21 || $[67] !== t22 || $[68] !== t23 || $[69] !== t24 || $[70] !== t25 || $[71] !== t30 || $[72] !== 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 }), $[61] = as, $[62] = handleClick, $[63] = handleMouseEnter, $[64] = restProps, $[65] = scheme, $[66] = t21, $[67] = t22, $[68] = t23, $[69] = t24, $[70] = t25, $[71] = t30, $[72] = tone, $[73] = t31) : t31 = $[73];
5396
- let t32;
5397
- return $[74] !== childMenu || $[75] !== open || $[76] !== popover || $[77] !== t31 ? (t32 = /* @__PURE__ */ jsx(Popover, { ...popover, content: childMenu, "data-ui": "MenuGroup__popover", open, children: t31 }), $[74] = childMenu, $[75] = open, $[76] = popover, $[77] = t31, $[78] = t32) : t32 = $[78], 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
+ ] }) }) });
5398
4586
  }
5399
4587
  MenuGroup.displayName = "MenuGroup";
5400
4588
  const MenuItem = forwardRef(function(props, forwardedRef) {
5401
- const $ = c(73);
5402
- let IconComponent, IconRightComponent, children, disabled, hotkeys, onClick, paddingBottom, paddingLeft, paddingRight, paddingTop, paddingX, paddingY, pressed, restProps, selectedProp, t0, t1, t2, t3, t4, t5, text;
5403
- $[0] !== props ? ({
5404
- as: t0,
4589
+ const {
4590
+ as = "button",
5405
4591
  children,
5406
4592
  disabled,
5407
- fontSize: t1,
4593
+ fontSize: fontSize2 = 1,
5408
4594
  hotkeys,
5409
4595
  icon: IconComponent,
5410
4596
  iconRight: IconRightComponent,
5411
4597
  onClick,
5412
- padding: t2,
4598
+ padding = 3,
5413
4599
  paddingX,
5414
4600
  paddingY,
5415
4601
  paddingTop,
@@ -5417,14 +4603,13 @@ const MenuItem = forwardRef(function(props, forwardedRef) {
5417
4603
  paddingBottom,
5418
4604
  paddingLeft,
5419
4605
  pressed,
5420
- radius: t3,
4606
+ radius = 2,
5421
4607
  selected: selectedProp,
5422
- space: t4,
4608
+ space = 3,
5423
4609
  text,
5424
- tone: t5,
4610
+ tone = "default",
5425
4611
  ...restProps
5426
- } = 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]);
5427
- 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, {
5428
4613
  scheme
5429
4614
  } = useRootTheme(), menu = useMenu(), {
5430
4615
  activeElement,
@@ -5433,17 +4618,10 @@ const MenuItem = forwardRef(function(props, forwardedRef) {
5433
4618
  onItemMouseEnter: _onItemMouseEnter,
5434
4619
  onItemMouseLeave: _onItemMouseLeave
5435
4620
  } = menu, onItemMouseEnter = _onItemMouseEnter ?? menu.onItemMouseEnter, onItemMouseLeave = _onItemMouseLeave ?? menu.onItemMouseLeave, [rootElement, setRootElement] = useState(null), active = !!activeElement && activeElement === rootElement, ref = useRef(null);
5436
- let t6;
5437
- $[23] === Symbol.for("react.memo_cache_sentinel") ? (t6 = () => ref.current, $[23] = t6) : t6 = $[23], useImperativeHandle(forwardedRef, t6);
5438
- let t7, t8;
5439
- $[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);
5440
- let t9;
5441
- $[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) => {
5442
4623
  disabled || (onClick && onClick(event), onItemClick && onItemClick());
5443
- }, $[29] = disabled, $[30] = onClick, $[31] = onItemClick, $[32] = t9) : t9 = $[32];
5444
- const handleClick = t9;
5445
- let t10;
5446
- $[33] !== padding || $[34] !== paddingBottom || $[35] !== paddingLeft || $[36] !== paddingRight || $[37] !== paddingTop || $[38] !== paddingX || $[39] !== paddingY ? (t10 = {
4624
+ }, [disabled, onClick, onItemClick]), paddingProps = useMemo(() => ({
5447
4625
  padding,
5448
4626
  paddingX,
5449
4627
  paddingY,
@@ -5451,114 +4629,71 @@ const MenuItem = forwardRef(function(props, forwardedRef) {
5451
4629
  paddingRight,
5452
4630
  paddingBottom,
5453
4631
  paddingLeft
5454
- }, $[33] = padding, $[34] = paddingBottom, $[35] = paddingLeft, $[36] = paddingRight, $[37] = paddingTop, $[38] = paddingX, $[39] = paddingY, $[40] = t10) : t10 = $[40];
5455
- const paddingProps = t10, t11 = useArrayProp(fontSize2);
5456
- let t12;
5457
- $[41] !== t11 ? (t12 = t11.map(_temp), $[41] = t11, $[42] = t12) : t12 = $[42];
5458
- const hotkeysFontSize = t12;
5459
- let t13;
5460
- $[43] === Symbol.for("react.memo_cache_sentinel") ? (t13 = (el) => {
4632
+ }), [padding, paddingX, paddingY, paddingTop, paddingRight, paddingBottom, paddingLeft]), hotkeysFontSize = _getArrayProp(fontSize2).map((s) => s - 1), setRef = useCallback((el) => {
5461
4633
  ref.current = el, setRootElement(el);
5462
- }, $[43] = t13) : t13 = $[43];
5463
- const setRef = t13, t14 = as !== "button" && pressed ? "" : void 0, t15 = active ? "" : void 0, t16 = disabled ? "" : void 0, t17 = useArrayProp(radius), t18 = useArrayProp(0), t19 = disabled ? "default" : tone, t20 = as === "button" ? "button" : void 0;
5464
- let t21;
5465
- $[44] !== IconComponent || $[45] !== IconRightComponent || $[46] !== fontSize2 || $[47] !== hotkeys || $[48] !== hotkeysFontSize || $[49] !== paddingProps || $[50] !== space || $[51] !== text ? (t21 = (IconComponent || text || IconRightComponent) && /* @__PURE__ */ jsxs(Flex, { as: "span", gap: space, align: "center", ...paddingProps, children: [
5466
- IconComponent && /* @__PURE__ */ jsxs(Text, { size: fontSize2, children: [
5467
- isValidElement(IconComponent) && IconComponent,
5468
- 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
+ ] })
5469
4650
  ] }),
5470
- text && /* @__PURE__ */ jsx(Box, { flex: 1, children: /* @__PURE__ */ jsx(Text, { size: fontSize2, textOverflow: "ellipsis", weight: "medium", children: text }) }),
5471
- hotkeys && /* @__PURE__ */ jsx(Hotkeys, { fontSize: hotkeysFontSize, keys: hotkeys, style: {
5472
- marginTop: -4,
5473
- marginBottom: -4
5474
- } }),
5475
- IconRightComponent && /* @__PURE__ */ jsxs(Text, { size: fontSize2, children: [
5476
- isValidElement(IconRightComponent) && IconRightComponent,
5477
- isValidElementType(IconRightComponent) && /* @__PURE__ */ jsx(IconRightComponent, {})
5478
- ] })
5479
- ] }), $[44] = IconComponent, $[45] = IconRightComponent, $[46] = fontSize2, $[47] = hotkeys, $[48] = hotkeysFontSize, $[49] = paddingProps, $[50] = space, $[51] = text, $[52] = t21) : t21 = $[52];
5480
- let t22;
5481
- $[53] !== children || $[54] !== paddingProps ? (t22 = children && /* @__PURE__ */ jsx(Box, { as: "span", ...paddingProps, children }), $[53] = children, $[54] = paddingProps, $[55] = t22) : t22 = $[55];
5482
- let t23;
5483
- return $[56] !== as || $[57] !== disabled || $[58] !== handleClick || $[59] !== onItemMouseEnter || $[60] !== onItemMouseLeave || $[61] !== restProps || $[62] !== scheme || $[63] !== t14 || $[64] !== t15 || $[65] !== t16 || $[66] !== t17 || $[67] !== t18 || $[68] !== t19 || $[69] !== t20 || $[70] !== t21 || $[71] !== t22 ? (t23 = /* @__PURE__ */ jsxs(Selectable, { "data-ui": "MenuItem", role: "menuitem", ...restProps, "data-pressed": t14, "data-selected": t15, "data-disabled": t16, forwardedAs: as, $radius: t17, $padding: t18, $tone: t19, $scheme: scheme, disabled, onClick: handleClick, onMouseEnter: onItemMouseEnter, onMouseLeave: onItemMouseLeave, ref: setRef, tabIndex: -1, type: t20, children: [
5484
- t21,
5485
- t22
5486
- ] }), $[56] = as, $[57] = disabled, $[58] = handleClick, $[59] = onItemMouseEnter, $[60] = onItemMouseLeave, $[61] = restProps, $[62] = scheme, $[63] = t14, $[64] = t15, $[65] = t16, $[66] = t17, $[67] = t18, $[68] = t19, $[69] = t20, $[70] = t21, $[71] = t22, $[72] = t23) : t23 = $[72], t23;
4651
+ children && /* @__PURE__ */ jsx(Box, { as: "span", ...paddingProps, children })
4652
+ ] });
5487
4653
  });
5488
4654
  MenuItem.displayName = "ForwardRef(MenuItem)";
5489
- function _temp(s) {
5490
- return s - 1;
5491
- }
5492
4655
  const CustomButton = styled(Button).withConfig({
5493
4656
  displayName: "CustomButton",
5494
4657
  componentId: "sc-1kns779-0"
5495
4658
  })`max-width:100%;`, Tab = forwardRef(function(props, forwardedRef) {
5496
- const $ = c(30);
5497
- let focused, icon, id, label, onClick, onFocus, restProps, selected, t0, t1;
5498
- $[0] !== props ? ({
4659
+ const {
5499
4660
  icon,
5500
4661
  id,
5501
4662
  focused,
5502
- fontSize: t0,
4663
+ fontSize: fontSize2 = 1,
5503
4664
  label,
5504
4665
  onClick,
5505
4666
  onFocus,
5506
- padding: t1,
4667
+ padding = 2,
5507
4668
  selected,
5508
4669
  ...restProps
5509
- } = 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]);
5510
- const fontSize2 = t0 === void 0 ? 1 : t0, padding = t1 === void 0 ? 2 : t1, ref = useRef(null), focusedRef = useRef(!1);
5511
- let t2;
5512
- $[11] === Symbol.for("react.memo_cache_sentinel") ? (t2 = () => ref.current, $[11] = t2) : t2 = $[11], useImperativeHandle(forwardedRef, t2);
5513
- let t3;
5514
- $[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(() => {
5515
4673
  focusedRef.current = !1;
5516
- }, $[12] = t3) : t3 = $[12];
5517
- const handleBlur = t3;
5518
- let t4;
5519
- $[13] !== onFocus ? (t4 = (event) => {
4674
+ }, []), handleFocus = useCallback((event) => {
5520
4675
  focusedRef.current = !0, onFocus && onFocus(event);
5521
- }, $[13] = onFocus, $[14] = t4) : t4 = $[14];
5522
- const handleFocus = t4;
5523
- let t5, t6;
5524
- $[15] !== focused ? (t5 = () => {
4676
+ }, [onFocus]);
4677
+ return useEffect(() => {
5525
4678
  focused && !focusedRef.current && (ref.current && ref.current.focus(), focusedRef.current = !0);
5526
- }, t6 = [focused], $[15] = focused, $[16] = t5, $[17] = t6) : (t5 = $[16], t6 = $[17]), useEffect(t5, t6);
5527
- const t7 = selected ? "true" : "false", t8 = selected ? 0 : -1;
5528
- let t9;
5529
- 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" });
5530
4680
  });
5531
4681
  Tab.displayName = "ForwardRef(Tab)";
5532
4682
  const CustomInline = styled(Inline).withConfig({
5533
4683
  displayName: "CustomInline",
5534
4684
  componentId: "sc-5cm04m-0"
5535
4685
  })`& > div{display:inline-block;vertical-align:middle;max-width:100%;box-sizing:border-box;}`, TabList = forwardRef(function(props, ref) {
5536
- const $ = c(15);
5537
- let childrenProp, restProps;
5538
- $[0] !== props ? ({
4686
+ const {
5539
4687
  children: childrenProp,
5540
4688
  ...restProps
5541
- } = props, $[0] = props, $[1] = childrenProp, $[2] = restProps) : (childrenProp = $[1], restProps = $[2]);
5542
- const [focusedIndex, setFocusedIndex] = useState(-1);
5543
- let t0;
5544
- if ($[3] !== childrenProp || $[4] !== focusedIndex) {
5545
- const children = Children.toArray(childrenProp).filter(isValidElement);
5546
- let t12;
5547
- $[6] !== focusedIndex ? (t12 = (child, childIndex) => cloneElement(child, {
5548
- focused: focusedIndex === childIndex,
5549
- key: childIndex,
5550
- onFocus: () => setFocusedIndex(childIndex)
5551
- }), $[6] = focusedIndex, $[7] = t12) : t12 = $[7], t0 = children.map(t12), $[3] = childrenProp, $[4] = focusedIndex, $[5] = t0;
5552
- } else
5553
- t0 = $[5];
5554
- const tabs = t0, numTabs = tabs.length;
5555
- let t1;
5556
- $[8] !== numTabs ? (t1 = (event) => {
5557
- event.key === "ArrowLeft" && setFocusedIndex((prevIndex) => (prevIndex + numTabs - 1) % numTabs), event.key === "ArrowRight" && setFocusedIndex((prevIndex_0) => (prevIndex_0 + 1) % numTabs);
5558
- }, $[8] = numTabs, $[9] = t1) : t1 = $[9];
5559
- const handleKeyDown = t1;
5560
- let t2;
5561
- 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 });
5562
4697
  });
5563
4698
  TabList.displayName = "ForwardRef(TabList)";
5564
4699
  export {
@@ -5647,7 +4782,6 @@ export {
5647
4782
  rgba,
5648
4783
  screen,
5649
4784
  studioTheme,
5650
- useArrayProp,
5651
4785
  useBoundaryElement,
5652
4786
  useClickOutsideEvent,
5653
4787
  useCustomValidity,