@sanity/ui 2.3.6-canary.1 → 2.3.6-canary.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,9 @@
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 { createContext, useContext, useMemo, forwardRef, useId, useState, useEffect, useCallback, Children, isValidElement, cloneElement, useRef, useSyncExternalStore, useImperativeHandle, Component, memo, useReducer, Fragment as Fragment$1, startTransition } from "react";
3
+ import { c } from "react/compiler-runtime";
4
+ import { createContext, useContext, forwardRef, useId, useState, useEffect, Children, isValidElement, cloneElement, useRef, useSyncExternalStore, useImperativeHandle, Component, memo, useMemo, useCallback, useReducer, Fragment as Fragment$1, startTransition } from "react";
4
5
  import { isValidElementType } from "react-is";
5
6
  import { ThemeProvider as ThemeProvider$1, useTheme as useTheme$1, css, styled, keyframes } from "styled-components";
6
- import { c } from "react/compiler-runtime";
7
7
  import { SpinnerIcon, CheckmarkIcon, RemoveIcon, ChevronDownIcon, CloseIcon, ChevronRightIcon, ToggleArrowRightIcon } from "@sanity/icons";
8
8
  import Refractor from "react-refractor";
9
9
  import { detectOverflow, flip, offset, shift, arrow, hide, useFloating, autoUpdate } from "@floating-ui/react-dom";
@@ -165,18 +165,42 @@ function createGlobalScopedContext(key2, defaultValue) {
165
165
  const key$8 = Symbol.for("@sanity/ui/context/theme"), ThemeContext = createGlobalScopedContext(key$8, null);
166
166
  function ThemeProvider(props) {
167
167
  var _a;
168
- const parentTheme = useContext(ThemeContext), {
169
- children,
170
- // scheme = parentTheme?.scheme || 'light',
171
- theme: rootTheme = (parentTheme == null ? void 0 : parentTheme.theme) || null,
172
- tone = (parentTheme == null ? void 0 : parentTheme.tone) || "default"
173
- } = props, scheme = (_a = props.scheme) != null ? _a : (parentTheme == null ? void 0 : parentTheme.scheme) || "light", themeContext = useMemo(() => rootTheme ? {
174
- version: 0,
175
- theme: rootTheme,
176
- scheme,
177
- tone
178
- } : null, [rootTheme, scheme, tone]), theme = useMemo(() => rootTheme ? getScopedTheme(rootTheme, scheme, tone) : null, [scheme, rootTheme, tone]);
179
- return theme ? /* @__PURE__ */ jsx(ThemeContext.Provider, { value: themeContext, children: /* @__PURE__ */ jsx(ThemeProvider$1, { theme, children }) }) : /* @__PURE__ */ jsx("pre", { children: 'ThemeProvider: no "theme" property provided' });
168
+ const $ = c(15), {
169
+ children
170
+ } = props, parentTheme = useContext(ThemeContext), scheme = (_a = props.scheme) != null ? _a : (parentTheme == null ? void 0 : parentTheme.scheme) || "light", rootTheme = (parentTheme == null ? void 0 : parentTheme.theme) || null, tone = (parentTheme == null ? void 0 : parentTheme.tone) || "default";
171
+ let t0;
172
+ bb0: {
173
+ if (!rootTheme) {
174
+ t0 = null;
175
+ break bb0;
176
+ }
177
+ let t12;
178
+ $[0] !== rootTheme || $[1] !== scheme || $[2] !== tone ? (t12 = {
179
+ version: 0,
180
+ theme: rootTheme,
181
+ scheme,
182
+ tone
183
+ }, $[0] = rootTheme, $[1] = scheme, $[2] = tone, $[3] = t12) : t12 = $[3], t0 = t12;
184
+ }
185
+ const themeContext = t0;
186
+ let t1;
187
+ bb1: {
188
+ if (!rootTheme) {
189
+ t1 = null;
190
+ break bb1;
191
+ }
192
+ let t22;
193
+ $[4] !== rootTheme || $[5] !== scheme || $[6] !== tone ? (t22 = getScopedTheme(rootTheme, scheme, tone), $[4] = rootTheme, $[5] = scheme, $[6] = tone, $[7] = t22) : t22 = $[7], t1 = t22;
194
+ }
195
+ const theme = t1;
196
+ if (!theme) {
197
+ let t22;
198
+ return $[8] === Symbol.for("react.memo_cache_sentinel") ? (t22 = /* @__PURE__ */ jsx("pre", { children: 'ThemeProvider: no "theme" property provided' }), $[8] = t22) : t22 = $[8], t22;
199
+ }
200
+ let t2;
201
+ $[9] !== theme || $[10] !== children ? (t2 = /* @__PURE__ */ jsx(ThemeProvider$1, { theme, children }), $[9] = theme, $[10] = children, $[11] = t2) : t2 = $[11];
202
+ let t3;
203
+ return $[12] !== themeContext || $[13] !== t2 ? (t3 = /* @__PURE__ */ jsx(ThemeContext.Provider, { value: themeContext, children: t2 }), $[12] = themeContext, $[13] = t2, $[14] = t3) : t3 = $[14], t3;
180
204
  }
181
205
  function useRootTheme() {
182
206
  const value = useContext(ThemeContext);
@@ -1093,50 +1117,61 @@ function avatarStrokeStyle() {
1093
1117
  const Root$B = styled.div(responsiveAvatarSizeStyle, avatarStyle.root), Arrow$1 = styled.div(avatarStyle.arrow), BgStroke = styled.ellipse(avatarStyle.bgStroke), Stroke = styled.ellipse(avatarStyle.stroke), Initials = styled.div(avatarStyle.initials), InitialsLabel = styled(Label)({
1094
1118
  color: "inherit"
1095
1119
  }), Image = styled.svg(avatarStyle.image), Avatar = forwardRef(function(props, ref) {
1096
- const {
1120
+ const $ = c(51);
1121
+ let t0, t1, t2, asProp, animateArrowFrom, arrowPositionProp, src, onImageLoadError, __unstable_hideInnerStroke, initials, restProps, title;
1122
+ $[0] !== props ? ({
1097
1123
  __unstable_hideInnerStroke,
1098
1124
  as: asProp,
1099
- color = "gray",
1125
+ color: t0,
1100
1126
  src,
1101
1127
  title,
1102
1128
  initials,
1103
1129
  onImageLoadError,
1104
1130
  arrowPosition: arrowPositionProp,
1105
1131
  animateArrowFrom,
1106
- status = "online",
1107
- size: sizeProp = 1,
1132
+ status: t1,
1133
+ size: t2,
1108
1134
  ...restProps
1109
- } = props, {
1135
+ } = props, $[0] = props, $[1] = t0, $[2] = t1, $[3] = t2, $[4] = asProp, $[5] = animateArrowFrom, $[6] = arrowPositionProp, $[7] = src, $[8] = onImageLoadError, $[9] = __unstable_hideInnerStroke, $[10] = initials, $[11] = restProps, $[12] = title) : (t0 = $[1], t1 = $[2], t2 = $[3], asProp = $[4], animateArrowFrom = $[5], arrowPositionProp = $[6], src = $[7], onImageLoadError = $[8], __unstable_hideInnerStroke = $[9], initials = $[10], restProps = $[11], title = $[12]);
1136
+ const color = t0 === void 0 ? "gray" : t0, status = t1 === void 0 ? "online" : t1, sizeProp = t2 === void 0 ? 1 : t2, {
1110
1137
  avatar
1111
- } = useTheme_v2(), as = isValidElementType(asProp) ? asProp : "div", size2 = useMemo(() => _getArrayProp(sizeProp), [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}`;
1112
- useEffect(() => {
1113
- if (arrowPosition === arrowPositionProp) return;
1138
+ } = useTheme_v2(), as = 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}`;
1139
+ let t3, t4;
1140
+ $[13] !== arrowPosition || $[14] !== arrowPositionProp ? (t3 = () => {
1141
+ if (arrowPosition === arrowPositionProp)
1142
+ return;
1114
1143
  const raf = requestAnimationFrame(() => setArrowPosition(arrowPositionProp));
1115
1144
  return () => cancelAnimationFrame(raf);
1116
- }, [arrowPosition, arrowPositionProp]), useEffect(() => {
1145
+ }, t4 = [arrowPosition, arrowPositionProp], $[13] = arrowPosition, $[14] = arrowPositionProp, $[15] = t3, $[16] = t4) : (t3 = $[15], t4 = $[16]), useEffect(t3, t4);
1146
+ let t5, t6;
1147
+ $[17] !== src ? (t5 = () => {
1117
1148
  src && setImageFailed(!1);
1118
- }, [src]);
1119
- const handleImageError = useCallback(() => {
1149
+ }, t6 = [src], $[17] = src, $[18] = t5, $[19] = t6) : (t5 = $[18], t6 = $[19]), useEffect(t5, t6);
1150
+ let t7;
1151
+ $[20] !== onImageLoadError ? (t7 = () => {
1120
1152
  setImageFailed(!0), onImageLoadError && onImageLoadError(new Error("Avatar: the image failed to load"));
1121
- }, [onImageLoadError]), initialsSize = useMemo(() => size2.map((s) => s === 1 ? 1 : s === 2 ? 3 : s === 3 ? 5 : 0), [size2]);
1122
- return /* @__PURE__ */ jsxs(Root$B, { 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: [
1123
- /* @__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 }) }) }),
1124
- !imageFailed && src && /* @__PURE__ */ jsxs(Image, { viewBox: `0 0 ${_sizeRem} ${_sizeRem}`, fill: "none", children: [
1125
- /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx("pattern", { id: imageId, patternContentUnits: "objectBoundingBox", width: "1", height: "1", children: /* @__PURE__ */ jsx(
1126
- "image",
1127
- {
1128
- href: src,
1129
- width: "1",
1130
- height: "1",
1131
- onError: handleImageError
1132
- }
1133
- ) }) }),
1134
- /* @__PURE__ */ jsx("circle", { cx: _radius, cy: _radius, r: _radius, fill: `url(#${imageId})` }),
1135
- !__unstable_hideInnerStroke && /* @__PURE__ */ jsx(BgStroke, { cx: _radius, cy: _radius, rx: _radius, ry: _radius, vectorEffect: "non-scaling-stroke" }),
1136
- /* @__PURE__ */ jsx(Stroke, { cx: _radius, cy: _radius, rx: _radius, ry: _radius, vectorEffect: "non-scaling-stroke" })
1137
- ] }),
1138
- (imageFailed || !src) && initials && /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(Initials, { children: /* @__PURE__ */ jsx(InitialsLabel, { forwardedAs: "span", size: initialsSize, weight: "medium", children: initials }) }) })
1139
- ] });
1153
+ }, $[20] = onImageLoadError, $[21] = t7) : t7 = $[21];
1154
+ const handleImageError = t7;
1155
+ let t8;
1156
+ $[22] === Symbol.for("react.memo_cache_sentinel") ? (t8 = (s) => s === 1 ? 1 : s === 2 ? 3 : s === 3 ? 5 : 0, $[22] = t8) : t8 = $[22];
1157
+ const initialsSize = size2.map(t8), t9 = typeof as == "string" ? as : void 0;
1158
+ let t10;
1159
+ $[23] !== 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 }) }) }), $[23] = color, $[24] = t10) : t10 = $[24];
1160
+ let t11;
1161
+ $[25] !== imageFailed || $[26] !== src || $[27] !== _sizeRem || $[28] !== handleImageError || $[29] !== imageId || $[30] !== _radius || $[31] !== __unstable_hideInnerStroke ? (t11 = !imageFailed && src && /* @__PURE__ */ jsxs(Image, { viewBox: `0 0 ${_sizeRem} ${_sizeRem}`, fill: "none", children: [
1162
+ /* @__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 }) }) }),
1163
+ /* @__PURE__ */ jsx("circle", { cx: _radius, cy: _radius, r: _radius, fill: `url(#${imageId})` }),
1164
+ !__unstable_hideInnerStroke && /* @__PURE__ */ jsx(BgStroke, { cx: _radius, cy: _radius, rx: _radius, ry: _radius, vectorEffect: "non-scaling-stroke" }),
1165
+ /* @__PURE__ */ jsx(Stroke, { cx: _radius, cy: _radius, rx: _radius, ry: _radius, vectorEffect: "non-scaling-stroke" })
1166
+ ] }), $[25] = imageFailed, $[26] = src, $[27] = _sizeRem, $[28] = handleImageError, $[29] = imageId, $[30] = _radius, $[31] = __unstable_hideInnerStroke, $[32] = t11) : t11 = $[32];
1167
+ let t12;
1168
+ $[33] !== imageFailed || $[34] !== src || $[35] !== initials || $[36] !== initialsSize ? (t12 = (imageFailed || !src) && initials && /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(Initials, { children: /* @__PURE__ */ jsx(InitialsLabel, { forwardedAs: "span", size: initialsSize, weight: "medium", children: initials }) }) }), $[33] = imageFailed, $[34] = src, $[35] = initials, $[36] = initialsSize, $[37] = t12) : t12 = $[37];
1169
+ let t13;
1170
+ return $[38] !== as || $[39] !== t9 || $[40] !== restProps || $[41] !== color || $[42] !== size2 || $[43] !== title || $[44] !== arrowPosition || $[45] !== status || $[46] !== ref || $[47] !== t10 || $[48] !== t11 || $[49] !== t12 ? (t13 = /* @__PURE__ */ jsxs(Root$B, { 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: [
1171
+ t10,
1172
+ t11,
1173
+ t12
1174
+ ] }), $[38] = as, $[39] = t9, $[40] = restProps, $[41] = color, $[42] = size2, $[43] = title, $[44] = arrowPosition, $[45] = status, $[46] = ref, $[47] = t10, $[48] = t11, $[49] = t12, $[50] = t13) : t13 = $[50], t13;
1140
1175
  });
1141
1176
  function _responsiveAvatarCounterSizeStyle(props) {
1142
1177
  const {
@@ -1175,11 +1210,22 @@ function _avatarCounterBaseStyle(props) {
1175
1210
  `;
1176
1211
  }
1177
1212
  const Root$A = styled.div(_responsiveAvatarCounterSizeStyle, _avatarCounterBaseStyle), AvatarCounter = forwardRef(function(props, ref) {
1178
- const {
1213
+ const $ = c(11), {
1179
1214
  count,
1180
- size: sizeProp = 1
1181
- } = props, size2 = useMemo(() => _getArrayProp(sizeProp), [sizeProp]), fontSize2 = useMemo(() => size2.map((s) => s === 1 ? 1 : s === 2 ? 3 : s === 3 ? 5 : 0), [size2]);
1182
- return /* @__PURE__ */ jsx(Root$A, { $size: size2, "data-ui": "AvatarCounter", ref, children: /* @__PURE__ */ jsx(Label, { as: "span", size: fontSize2, weight: "medium", children: count }) });
1215
+ size: size2
1216
+ } = props, t0 = size2 != null ? size2 : 1;
1217
+ let t1, $size;
1218
+ if ($[0] !== t0) {
1219
+ $size = _getArrayProp(t0);
1220
+ let t22;
1221
+ $[3] === Symbol.for("react.memo_cache_sentinel") ? (t22 = (s) => s === 1 ? 1 : s === 2 ? 3 : s === 3 ? 5 : 0, $[3] = t22) : t22 = $[3], t1 = $size.map(t22), $[0] = t0, $[1] = t1, $[2] = $size;
1222
+ } else
1223
+ t1 = $[1], $size = $[2];
1224
+ const fontSize2 = t1;
1225
+ let t2;
1226
+ $[4] !== fontSize2 || $[5] !== count ? (t2 = /* @__PURE__ */ jsx(Label, { as: "span", size: fontSize2, weight: "medium", children: count }), $[4] = fontSize2, $[5] = count, $[6] = t2) : t2 = $[6];
1227
+ let t3;
1228
+ return $[7] !== $size || $[8] !== ref || $[9] !== t2 ? (t3 = /* @__PURE__ */ jsx(Root$A, { $size, "data-ui": "AvatarCounter", ref, children: t2 }), $[7] = $size, $[8] = ref, $[9] = t2, $[10] = t3) : t3 = $[10], t3;
1183
1229
  }), BASE_STYLES = css`
1184
1230
  white-space: nowrap;
1185
1231
 
@@ -1209,19 +1255,34 @@ function responsiveAvatarStackSizeStyle(props) {
1209
1255
  });
1210
1256
  }
1211
1257
  const Root$z = styled.div(responsiveAvatarStackSizeStyle, avatarStackStyle), AvatarStack = forwardRef(function(props, ref) {
1212
- const {
1258
+ const $ = c(31);
1259
+ let t0, t1, childrenProp, restProps;
1260
+ $[0] !== props ? ({
1213
1261
  children: childrenProp,
1214
- maxLength: maxLengthProp = 4,
1215
- size: sizeProp = 1,
1262
+ maxLength: t0,
1263
+ size: t1,
1216
1264
  ...restProps
1217
- } = props, children = useMemo(() => Children.toArray(childrenProp).filter(isValidElement), [childrenProp]), maxLength = Math.max(maxLengthProp, 0), size2 = useMemo(() => _getArrayProp(sizeProp), [sizeProp]), len = children.length, visibleCount = maxLength - 1, extraCount = len - visibleCount, visibleChildren = extraCount > 1 ? children.slice(extraCount, len) : children;
1218
- return /* @__PURE__ */ jsxs(Root$z, { "data-ui": "AvatarStack", ...restProps, ref, $size: size2, children: [
1219
- len === 0 && /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(AvatarCounter, { count: len, size: size2 }) }),
1220
- len !== 0 && extraCount > 1 && /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(AvatarCounter, { count: extraCount, size: size2 }) }),
1221
- visibleChildren.map((child, childIndex) => /* @__PURE__ */ jsx("div", { children: cloneElement(child, {
1265
+ } = props, $[0] = props, $[1] = t0, $[2] = t1, $[3] = childrenProp, $[4] = restProps) : (t0 = $[1], t1 = $[2], childrenProp = $[3], restProps = $[4]);
1266
+ const maxLengthProp = t0 === void 0 ? 4 : t0, sizeProp = t1 === void 0 ? 1 : t1;
1267
+ let T0, t2, t3, t4, t5, t6, t7, t8;
1268
+ if ($[5] !== childrenProp || $[6] !== maxLengthProp || $[7] !== sizeProp || $[8] !== restProps || $[9] !== ref) {
1269
+ const children = Children.toArray(childrenProp).filter(isValidElement), maxLength = Math.max(maxLengthProp, 0);
1270
+ let t92, t10;
1271
+ $[18] !== sizeProp ? (t10 = _getArrayProp(sizeProp), $[18] = sizeProp, $[19] = t10) : t10 = $[19], t92 = t10;
1272
+ const size2 = t92, len = children.length, visibleCount = maxLength - 1, extraCount = len - visibleCount, visibleChildren = extraCount > 1 ? children.slice(extraCount, len) : children;
1273
+ T0 = Root$z, t2 = "AvatarStack", t3 = restProps, t4 = ref, t5 = size2, t6 = len === 0 && /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(AvatarCounter, { count: len, size: size2 }) }), t7 = len !== 0 && extraCount > 1 && /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(AvatarCounter, { count: extraCount, size: size2 }) });
1274
+ let t11;
1275
+ $[20] !== size2 ? (t11 = (child, childIndex) => /* @__PURE__ */ jsx("div", { children: cloneElement(child, {
1222
1276
  size: size2
1223
- }) }, String(childIndex)))
1224
- ] });
1277
+ }) }, String(childIndex)), $[20] = size2, $[21] = t11) : t11 = $[21], t8 = visibleChildren.map(t11), $[5] = childrenProp, $[6] = maxLengthProp, $[7] = sizeProp, $[8] = restProps, $[9] = ref, $[10] = T0, $[11] = t2, $[12] = t3, $[13] = t4, $[14] = t5, $[15] = t6, $[16] = t7, $[17] = t8;
1278
+ } else
1279
+ T0 = $[10], t2 = $[11], t3 = $[12], t4 = $[13], t5 = $[14], t6 = $[15], t7 = $[16], t8 = $[17];
1280
+ let t9;
1281
+ return $[22] !== T0 || $[23] !== t2 || $[24] !== t3 || $[25] !== t4 || $[26] !== t5 || $[27] !== t6 || $[28] !== t7 || $[29] !== t8 ? (t9 = /* @__PURE__ */ jsxs(T0, { "data-ui": t2, ...t3, ref: t4, $size: t5, children: [
1282
+ t6,
1283
+ t7,
1284
+ t8
1285
+ ] }), $[22] = T0, $[23] = t2, $[24] = t3, $[25] = t4, $[26] = t5, $[27] = t6, $[28] = t7, $[29] = t8, $[30] = t9) : t9 = $[30], t9;
1225
1286
  }), Root$y = styled.div(boxStyle, flexItemStyle, responsiveBoxStyle, responsiveGridItemStyle, responsiveMarginStyle, responsivePaddingStyle), Box = forwardRef(function(props, ref) {
1226
1287
  const $ = c(109);
1227
1288
  let t0, t1, t2, t3, column, columnStart, columnEnd, flex, height, marginX, marginY, marginTop, marginRight, marginBottom, marginLeft, overflow, paddingX, paddingY, paddingTop, paddingRight, paddingBottom, paddingLeft, row, rowStart, rowEnd, sizing, restProps;
@@ -3311,19 +3372,27 @@ function findMinBreakpoints(media, width) {
3311
3372
  return ret;
3312
3373
  }
3313
3374
  const ElementQuery = forwardRef(function(props, forwardedRef) {
3314
- const theme = useTheme_v2(), {
3375
+ var _a;
3376
+ const $ = c(12), theme = useTheme_v2();
3377
+ let _media, restProps, children;
3378
+ $[0] !== props ? ({
3315
3379
  children,
3316
- media = theme.media,
3380
+ media: _media,
3317
3381
  ...restProps
3318
- } = props, ref = useRef(null), [element, setElement] = useState(null), elementSize = useElementSize(element), width = useMemo(() => {
3319
- var _a;
3320
- return (_a = elementSize == null ? void 0 : elementSize.border.width) != null ? _a : window.innerWidth;
3321
- }, [elementSize]), max = useMemo(() => findMaxBreakpoints(media, width), [media, width]), min = useMemo(() => findMinBreakpoints(media, width), [media, width]);
3322
- useImperativeHandle(forwardedRef, () => ref.current);
3323
- const setRef = useCallback((el) => {
3382
+ } = props, $[0] = props, $[1] = _media, $[2] = restProps, $[3] = children) : (_media = $[1], restProps = $[2], children = $[3]);
3383
+ const media = _media != null ? _media : theme.media, ref = useRef(null), [element, setElement] = useState(null), elementSize = useElementSize(element);
3384
+ let t0;
3385
+ t0 = (_a = elementSize == null ? void 0 : elementSize.border.width) != null ? _a : window.innerWidth;
3386
+ const width = t0, max = findMaxBreakpoints(media, width), min = findMinBreakpoints(media, width);
3387
+ let t1;
3388
+ $[4] === Symbol.for("react.memo_cache_sentinel") ? (t1 = () => ref.current, $[4] = t1) : t1 = $[4], useImperativeHandle(forwardedRef, t1);
3389
+ let t2;
3390
+ $[5] === Symbol.for("react.memo_cache_sentinel") ? (t2 = (el) => {
3324
3391
  ref.current = el, setElement(el);
3325
- }, []);
3326
- return /* @__PURE__ */ jsx("div", { "data-ui": "ElementQuery", ...restProps, "data-eq-max": max.length ? max.join(" ") : void 0, "data-eq-min": min.length ? min.join(" ") : void 0, ref: setRef, children });
3392
+ }, $[5] = t2) : t2 = $[5];
3393
+ const setRef = t2, t3 = max.length ? max.join(" ") : void 0, t4 = min.length ? min.join(" ") : void 0;
3394
+ let t5;
3395
+ return $[6] !== restProps || $[7] !== t3 || $[8] !== t4 || $[9] !== setRef || $[10] !== children ? (t5 = /* @__PURE__ */ jsx("div", { "data-ui": "ElementQuery", ...restProps, "data-eq-max": t3, "data-eq-min": t4, ref: setRef, children }), $[6] = restProps, $[7] = t3, $[8] = t4, $[9] = setRef, $[10] = children, $[11] = t5) : t5 = $[11], t5;
3327
3396
  });
3328
3397
  var __defProp = Object.defineProperty, __defNormalProp = (obj, key2, value) => key2 in obj ? __defProp(obj, key2, { enumerable: !0, configurable: !0, writable: !0, value }) : obj[key2] = value, __publicField = (obj, key2, value) => __defNormalProp(obj, key2 + "", value);
3329
3398
  class ErrorBoundary extends Component {
@@ -3453,39 +3522,56 @@ function _isScrollable(el) {
3453
3522
  }
3454
3523
  function LayerProvider(props) {
3455
3524
  var _a;
3456
- const {
3525
+ const $ = c(22), {
3457
3526
  children,
3458
- zOffset: zOffsetProp = 0
3459
- } = props, parentContextValue = useContext(LayerContext), parent = parentContextValue && getLayerContext(parentContextValue), parentRegisterChild = parent == null ? void 0 : parent.registerChild, level = ((_a = parent == null ? void 0 : parent.level) != null ? _a : 0) + 1, zOffset = useMemo(() => _getArrayProp(zOffsetProp), [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) => {
3527
+ zOffset: t0
3528
+ } = props, zOffsetProp = t0 === void 0 ? 0 : t0, parentContextValue = useContext(LayerContext), parentRegisterChild = useContext(LayerContextRegisterChild), parent = parentContextValue && getLayerContext(parentContextValue), level = ((_a = parent == null ? void 0 : parent.level) != null ? _a : 0) + 1;
3529
+ let t1, t2;
3530
+ $[0] !== zOffsetProp ? (t2 = _getArrayProp(zOffsetProp), $[0] = zOffsetProp, $[1] = t2) : t2 = $[1], t1 = t2;
3531
+ const zOffset = t1, maxMediaIndex = zOffset.length - 1, mediaIndex = Math.min(useMediaIndex(), maxMediaIndex), zIndex = parent ? parent.zIndex + zOffset[mediaIndex] : zOffset[mediaIndex];
3532
+ let t3;
3533
+ $[2] === Symbol.for("react.memo_cache_sentinel") ? (t3 = {}, $[2] = t3) : t3 = $[2];
3534
+ const [childLayers, setChildLayers] = useState(t3);
3535
+ let t4, t5;
3536
+ $[3] !== childLayers ? (t5 = Object.keys(childLayers), $[3] = childLayers, $[4] = t5) : t5 = $[4], t4 = t5.length;
3537
+ const size2 = t4, isTopLayer = size2 === 0;
3538
+ let t6;
3539
+ $[5] !== parentRegisterChild ? (t6 = (childLevel) => {
3460
3540
  const parentDispose = parentRegisterChild == null ? void 0 : parentRegisterChild(childLevel);
3461
- return childLevel !== void 0 ? setChildLayers((state) => {
3541
+ return setChildLayers((state) => {
3462
3542
  var _a2;
3463
- const prevLen = (_a2 = state[childLevel]) != null ? _a2 : 0, nextState = {
3543
+ const prevLen = (_a2 = state[childLevel]) != null ? _a2 : 0;
3544
+ return {
3464
3545
  ...state,
3465
3546
  [childLevel]: prevLen + 1
3466
3547
  };
3467
- return setSize(Object.keys(nextState).length), nextState;
3468
- }) : setSize((v) => v + 1), () => {
3469
- childLevel !== void 0 ? setChildLayers((state_0) => {
3548
+ }), () => {
3549
+ setChildLayers((state_0) => {
3470
3550
  const nextState_0 = {
3471
3551
  ...state_0
3472
3552
  };
3473
- return nextState_0[childLevel] === 1 ? (delete nextState_0[childLevel], setSize(Object.keys(nextState_0).length)) : nextState_0[childLevel] -= 1, nextState_0;
3474
- }) : setSize((v_0) => v_0 - 1), parentDispose == null || parentDispose();
3553
+ return nextState_0[childLevel] === 1 ? delete nextState_0[childLevel] : nextState_0[childLevel] = nextState_0[childLevel] - 1, nextState_0;
3554
+ }), parentDispose == null || parentDispose();
3475
3555
  };
3476
- }, [parentRegisterChild]);
3477
- useEffect(() => parentRegisterChild == null ? void 0 : parentRegisterChild(level), [level, parentRegisterChild]);
3478
- const value = useMemo(() => ({
3556
+ }, $[5] = parentRegisterChild, $[6] = t6) : t6 = $[6];
3557
+ const registerChild = t6;
3558
+ let t7, t8;
3559
+ $[7] !== parentRegisterChild || $[8] !== level ? (t7 = () => parentRegisterChild == null ? void 0 : parentRegisterChild(level), t8 = [level, parentRegisterChild], $[7] = parentRegisterChild, $[8] = level, $[9] = t7, $[10] = t8) : (t7 = $[9], t8 = $[10]), useEffect(t7, t8);
3560
+ let t9, t10;
3561
+ $[11] !== isTopLayer || $[12] !== level || $[13] !== size2 || $[14] !== zIndex ? (t10 = {
3479
3562
  version: 0,
3480
3563
  isTopLayer,
3481
3564
  level,
3482
- registerChild,
3483
3565
  size: size2,
3484
3566
  zIndex
3485
- }), [isTopLayer, level, registerChild, size2, zIndex]);
3486
- return /* @__PURE__ */ jsx(LayerContext.Provider, { value, children });
3567
+ }, $[11] = isTopLayer, $[12] = level, $[13] = size2, $[14] = zIndex, $[15] = t10) : t10 = $[15], t9 = t10;
3568
+ const value = t9;
3569
+ let t11;
3570
+ $[16] !== registerChild || $[17] !== children ? (t11 = /* @__PURE__ */ jsx(LayerContextRegisterChild.Provider, { value: registerChild, children }), $[16] = registerChild, $[17] = children, $[18] = t11) : t11 = $[18];
3571
+ let t12;
3572
+ return $[19] !== value || $[20] !== t11 ? (t12 = /* @__PURE__ */ jsx(LayerContext.Provider, { value, children: t11 }), $[19] = value, $[20] = t11, $[21] = t12) : t12 = $[21], t12;
3487
3573
  }
3488
- const Root$j = styled.div({
3574
+ const LayerContextRegisterChild = createContext(null), Root$j = styled.div({
3489
3575
  position: "relative"
3490
3576
  }), LayerChildren = forwardRef(function(props, forwardedRef) {
3491
3577
  const $ = c(23);
@@ -3887,42 +3973,61 @@ const MotionCard$1 = styled(motion(Card))`
3887
3973
  }));
3888
3974
  PopoverCard.displayName = "PopoverCard";
3889
3975
  const Popover = memo(forwardRef(function(props, forwardedRef) {
3890
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
3891
- const {
3976
+ var _a, _b, _c2, _d, _e, _f, _g, _h, _i;
3977
+ const $ = c(99), {
3892
3978
  container,
3893
3979
  layer
3894
- } = useTheme_v2(), boundaryElementContext = useBoundaryElement(), {
3895
- __unstable_margins: margins = DEFAULT_POPOVER_MARGINS,
3896
- animate: _animate = !1,
3897
- arrow: arrowProp = !1,
3898
- boundaryElement = boundaryElementContext.element,
3899
- children: childProp,
3900
- constrainSize = !1,
3901
- content,
3902
- disabled,
3903
- fallbackPlacements = (_b = props.fallbackPlacements) != null ? _b : DEFAULT_FALLBACK_PLACEMENTS$1[(_a = props.placement) != null ? _a : "bottom"],
3904
- matchReferenceWidth,
3905
- floatingBoundary = (_c = props.boundaryElement) != null ? _c : boundaryElementContext.element,
3906
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
3907
- onActivate,
3908
- open,
3909
- overflow = "hidden",
3910
- padding: paddingProp,
3911
- placement: placementProp = "bottom",
3912
- portal,
3913
- preventOverflow = !0,
3914
- radius: radiusProp = 3,
3915
- referenceBoundary = (_d = props.boundaryElement) != null ? _d : boundaryElementContext.element,
3916
- referenceElement,
3917
- scheme,
3918
- shadow: shadowProp = 3,
3919
- tone = "inherit",
3920
- width: widthProp = "auto",
3921
- zOffset: zOffsetProp = layer.popover.zOffset,
3922
- updateRef,
3923
- ...restProps
3924
- } = props, animate = usePrefersReducedMotion() ? !1 : _animate, boundarySize = (_e = useElementSize(boundaryElement)) == null ? void 0 : _e.border, padding = useMemo(() => _getArrayProp(paddingProp), [paddingProp]), radius = useMemo(() => _getArrayProp(radiusProp), [radiusProp]), shadow = useMemo(() => _getArrayProp(shadowProp), [shadowProp]), widthArrayProp = useMemo(() => _getArrayProp(widthProp), [widthProp]), zOffset = useMemo(() => _getArrayProp(zOffsetProp), [zOffsetProp]), ref = useRef(null), arrowRef = useRef(null), rootBoundary = "viewport";
3925
- useImperativeHandle(forwardedRef, () => ref.current);
3980
+ } = useTheme_v2(), boundaryElementContext = useBoundaryElement();
3981
+ let t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, _boundaryElement, _referenceBoundary, _floatingBoundary, _fallbackPlacements, _zOffset, paddingProp, open, matchReferenceWidth, updateRef, children, referenceElement, disabled, restProps, scheme, content, portal;
3982
+ if ($[0] !== props) {
3983
+ const {
3984
+ __unstable_margins: t112,
3985
+ animate: t122,
3986
+ arrow: t132,
3987
+ boundaryElement: t142,
3988
+ children: t152,
3989
+ constrainSize: t162,
3990
+ content: t172,
3991
+ disabled: t182,
3992
+ fallbackPlacements: t192,
3993
+ matchReferenceWidth: t202,
3994
+ floatingBoundary: t212,
3995
+ onActivate,
3996
+ open: t222,
3997
+ overflow: t232,
3998
+ padding: t242,
3999
+ placement: t252,
4000
+ portal: t262,
4001
+ preventOverflow: t272,
4002
+ radius: t282,
4003
+ referenceBoundary: t292,
4004
+ referenceElement: t302,
4005
+ scheme: t312,
4006
+ shadow: t322,
4007
+ tone: t332,
4008
+ width: t342,
4009
+ zOffset: t352,
4010
+ updateRef: t362,
4011
+ ...t37
4012
+ } = props;
4013
+ t0 = t112, t1 = t122, t2 = t132, _boundaryElement = t142, children = t152, t3 = t162, content = t172, disabled = t182, _fallbackPlacements = t192, matchReferenceWidth = t202, _floatingBoundary = t212, open = t222, t4 = t232, paddingProp = t242, t5 = t252, portal = t262, t6 = t272, t7 = t282, _referenceBoundary = t292, referenceElement = t302, scheme = t312, t8 = t322, t9 = t332, t10 = t342, _zOffset = t352, updateRef = t362, restProps = t37, $[0] = props, $[1] = t0, $[2] = t1, $[3] = t2, $[4] = t3, $[5] = t4, $[6] = t5, $[7] = t6, $[8] = t7, $[9] = t8, $[10] = t9, $[11] = t10, $[12] = _boundaryElement, $[13] = _referenceBoundary, $[14] = _floatingBoundary, $[15] = _fallbackPlacements, $[16] = _zOffset, $[17] = paddingProp, $[18] = open, $[19] = matchReferenceWidth, $[20] = updateRef, $[21] = children, $[22] = referenceElement, $[23] = disabled, $[24] = restProps, $[25] = scheme, $[26] = content, $[27] = portal;
4014
+ } else
4015
+ t0 = $[1], t1 = $[2], t2 = $[3], t3 = $[4], t4 = $[5], t5 = $[6], t6 = $[7], t7 = $[8], t8 = $[9], t9 = $[10], t10 = $[11], _boundaryElement = $[12], _referenceBoundary = $[13], _floatingBoundary = $[14], _fallbackPlacements = $[15], _zOffset = $[16], paddingProp = $[17], open = $[18], matchReferenceWidth = $[19], updateRef = $[20], children = $[21], referenceElement = $[22], disabled = $[23], restProps = $[24], scheme = $[25], content = $[26], portal = $[27];
4016
+ 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, preventOverflow = t6 === void 0 ? !0 : t6, radiusProp = t7 === void 0 ? 3 : t7, shadowProp = t8 === void 0 ? 3 : t8, tone = t9 === void 0 ? "inherit" : t9, widthProp = t10 === void 0 ? "auto" : t10, boundaryElement = _boundaryElement != null ? _boundaryElement : boundaryElementContext.element, referenceBoundary = (_a = _referenceBoundary != null ? _referenceBoundary : props.boundaryElement) != null ? _a : boundaryElementContext.element, floatingBoundary = (_b = _floatingBoundary != null ? _floatingBoundary : props.boundaryElement) != null ? _b : boundaryElementContext.element, fallbackPlacements = _fallbackPlacements != null ? _fallbackPlacements : DEFAULT_FALLBACK_PLACEMENTS$1[(_c2 = props.placement) != null ? _c2 : "bottom"], zOffsetProp = _zOffset != null ? _zOffset : layer.popover.zOffset, animate = usePrefersReducedMotion() ? !1 : _animate, boundarySize = (_d = useElementSize(boundaryElement)) == null ? void 0 : _d.border;
4017
+ let t11, t12;
4018
+ $[28] !== paddingProp ? (t12 = _getArrayProp(paddingProp), $[28] = paddingProp, $[29] = t12) : t12 = $[29], t11 = t12;
4019
+ const padding = t11;
4020
+ let t13, t14;
4021
+ $[30] !== radiusProp ? (t14 = _getArrayProp(radiusProp), $[30] = radiusProp, $[31] = t14) : t14 = $[31], t13 = t14;
4022
+ const radius = t13;
4023
+ let t15, t16;
4024
+ $[32] !== shadowProp ? (t16 = _getArrayProp(shadowProp), $[32] = shadowProp, $[33] = t16) : t16 = $[33], t15 = t16;
4025
+ const shadow = t15, widthArrayProp = _getArrayProp(widthProp);
4026
+ let t17, t18;
4027
+ $[34] !== zOffsetProp ? (t18 = _getArrayProp(zOffsetProp), $[34] = zOffsetProp, $[35] = t18) : t18 = $[35], t17 = t18;
4028
+ const zOffset = t17, ref = useRef(null), arrowRef = useRef(null);
4029
+ let t19;
4030
+ $[36] === Symbol.for("react.memo_cache_sentinel") ? (t19 = () => ref.current, $[36] = t19) : t19 = $[36], useImperativeHandle(forwardedRef, t19);
3926
4031
  const mediaIndex = useMediaIndex(), boundaryWidth = constrainSize || preventOverflow ? boundarySize == null ? void 0 : boundarySize.width : void 0, width = calcCurrentWidth({
3927
4032
  container,
3928
4033
  mediaIndex,
@@ -3941,48 +4046,64 @@ const Popover = memo(forwardRef(function(props, forwardedRef) {
3941
4046
  const referenceWidthRef = useRef();
3942
4047
  useEffect(() => {
3943
4048
  const floatingElement = ref.current;
3944
- if (!open || !floatingElement) return;
4049
+ if (!open || !floatingElement)
4050
+ return;
3945
4051
  const referenceWidth = referenceWidthRef.current;
3946
4052
  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`);
3947
4053
  }, [width, matchReferenceWidth, maxWidth, open]);
3948
- const middleware = useMemo(() => {
3949
- const ret = [];
3950
- return (constrainSize || preventOverflow) && ret.push(flip({
3951
- boundary: floatingBoundary || void 0,
4054
+ let t20;
4055
+ const ret = [];
4056
+ if (constrainSize || preventOverflow) {
4057
+ const t212 = floatingBoundary || void 0;
4058
+ let t222;
4059
+ $[37] !== t212 || $[38] !== fallbackPlacements ? (t222 = flip({
4060
+ boundary: t212,
3952
4061
  fallbackPlacements,
3953
4062
  padding: DEFAULT_POPOVER_PADDING,
3954
- rootBoundary
3955
- })), ret.push(offset({
3956
- mainAxis: DEFAULT_POPOVER_DISTANCE
3957
- })), (constrainSize || matchReferenceWidth) && ret.push(size({
3958
- apply({
4063
+ rootBoundary: "viewport"
4064
+ }), $[37] = t212, $[38] = fallbackPlacements, $[39] = t222) : t222 = $[39], ret.push(t222);
4065
+ }
4066
+ let t21;
4067
+ if ($[40] === Symbol.for("react.memo_cache_sentinel") ? (t21 = offset({
4068
+ mainAxis: DEFAULT_POPOVER_DISTANCE
4069
+ }), $[40] = t21) : t21 = $[40], ret.push(t21), (constrainSize || matchReferenceWidth) && ret.push(size({
4070
+ apply(t222) {
4071
+ const {
3959
4072
  availableWidth,
3960
4073
  availableHeight,
3961
4074
  elements,
3962
4075
  referenceWidth: referenceWidth_0
3963
- }) {
3964
- referenceWidthRef.current = referenceWidth_0;
3965
- const _currentWidth = widthRef.current, _maxWidth = maxWidthRef.current;
3966
- matchReferenceWidth ? elements.floating.style.width = `${referenceWidth_0}px` : _currentWidth !== void 0 && (elements.floating.style.width = `${_currentWidth}px`), constrainSize && (elements.floating.style.maxWidth = `${Math.min(availableWidth, _maxWidth != null ? _maxWidth : 1 / 0)}px`, elements.floating.style.maxHeight = `${availableHeight}px`);
3967
- },
3968
- boundaryElement: floatingBoundary || void 0,
3969
- constrainSize,
3970
- margins,
3971
- matchReferenceWidth,
3972
- padding: DEFAULT_POPOVER_PADDING
3973
- })), preventOverflow && ret.push(shift({
3974
- boundary: floatingBoundary || void 0,
3975
- rootBoundary,
3976
- padding: DEFAULT_POPOVER_PADDING
3977
- })), arrowProp && ret.push(arrow({
3978
- element: arrowRef,
4076
+ } = t222;
4077
+ referenceWidthRef.current = referenceWidth_0;
4078
+ const _currentWidth = widthRef.current, _maxWidth = maxWidthRef.current;
4079
+ matchReferenceWidth ? elements.floating.style.width = `${referenceWidth_0}px` : _currentWidth !== void 0 && (elements.floating.style.width = `${_currentWidth}px`), constrainSize && (elements.floating.style.maxWidth = `${Math.min(availableWidth, _maxWidth != null ? _maxWidth : 1 / 0)}px`, elements.floating.style.maxHeight = `${availableHeight}px`);
4080
+ },
4081
+ boundaryElement: floatingBoundary || void 0,
4082
+ constrainSize,
4083
+ margins,
4084
+ matchReferenceWidth,
4085
+ padding: DEFAULT_POPOVER_PADDING
4086
+ })), preventOverflow) {
4087
+ const t222 = floatingBoundary || void 0;
4088
+ let t232;
4089
+ $[41] !== t222 ? (t232 = shift({
4090
+ boundary: t222,
4091
+ rootBoundary: "viewport",
3979
4092
  padding: DEFAULT_POPOVER_PADDING
3980
- })), animate && ret.push(origin), ret.push(hide({
3981
- boundary: referenceBoundary || void 0,
3982
- padding: DEFAULT_POPOVER_PADDING,
3983
- strategy: "referenceHidden"
3984
- })), ret;
3985
- }, [animate, arrowProp, constrainSize, fallbackPlacements, floatingBoundary, margins, matchReferenceWidth, preventOverflow, referenceBoundary]), {
4093
+ }), $[41] = t222, $[42] = t232) : t232 = $[42], ret.push(t232);
4094
+ }
4095
+ arrowProp && ret.push(arrow({
4096
+ element: arrowRef,
4097
+ padding: DEFAULT_POPOVER_PADDING
4098
+ })), animate && ret.push(origin);
4099
+ const t22 = referenceBoundary || void 0;
4100
+ let t23;
4101
+ $[43] !== t22 ? (t23 = hide({
4102
+ boundary: t22,
4103
+ padding: DEFAULT_POPOVER_PADDING,
4104
+ strategy: "referenceHidden"
4105
+ }), $[43] = t22, $[44] = t23) : t23 = $[44], ret.push(t23), t20 = ret;
4106
+ const middleware = t20, {
3986
4107
  x,
3987
4108
  y,
3988
4109
  middlewareData,
@@ -3994,30 +4115,54 @@ const Popover = memo(forwardRef(function(props, forwardedRef) {
3994
4115
  middleware,
3995
4116
  placement: placementProp,
3996
4117
  whileElementsMounted: autoUpdate
3997
- }), referenceHidden = (_f = middlewareData.hide) == null ? void 0 : _f.referenceHidden, arrowX = (_g = middlewareData.arrow) == null ? void 0 : _g.x, arrowY = (_h = middlewareData.arrow) == null ? void 0 : _h.y, originX = (_i = middlewareData["@sanity/ui/origin"]) == null ? void 0 : _i.originX, originY = (_j = middlewareData["@sanity/ui/origin"]) == null ? void 0 : _j.originY, setArrow = useCallback((arrowEl) => {
4118
+ }), referenceHidden = (_e = middlewareData.hide) == null ? void 0 : _e.referenceHidden, arrowX = (_f = middlewareData.arrow) == null ? void 0 : _f.x, arrowY = (_g = middlewareData.arrow) == null ? void 0 : _g.y, originX = (_h = middlewareData["@sanity/ui/origin"]) == null ? void 0 : _h.originX, originY = (_i = middlewareData["@sanity/ui/origin"]) == null ? void 0 : _i.originY;
4119
+ let t24;
4120
+ $[45] === Symbol.for("react.memo_cache_sentinel") ? (t24 = (arrowEl) => {
3998
4121
  arrowRef.current = arrowEl;
3999
- }, []), setFloating = useCallback((node) => {
4122
+ }, $[45] = t24) : t24 = $[45];
4123
+ const setArrow = t24;
4124
+ let t25;
4125
+ $[46] !== refs ? (t25 = (node) => {
4000
4126
  ref.current = node, refs.setFloating(node);
4001
- }, [refs]), setReference = useCallback((node_0) => {
4002
- refs.setReference(node_0);
4003
- const childRef = childProp == null ? void 0 : childProp.ref;
4004
- typeof childRef == "function" ? childRef(node_0) : childRef && (childRef.current = node_0);
4005
- }, [childProp, refs]), child = useMemo(() => !childProp || referenceElement ? null : cloneElement(childProp, {
4006
- ref: setReference
4007
- }), [childProp, referenceElement, setReference]);
4008
- if (useEffect(() => {
4009
- updateRef && (typeof updateRef == "function" ? updateRef(update) : updateRef && (updateRef.current = update));
4010
- }, [update, updateRef]), useEffect(() => {
4011
- child || refs.setReference(referenceElement || null);
4012
- }, [referenceElement, refs, child]), disabled)
4013
- return childProp || /* @__PURE__ */ jsx(Fragment, {});
4014
- const popover = /* @__PURE__ */ jsx(LayerProvider, { zOffset, children: /* @__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 ? referenceWidthRef.current : width, x, y, children: content }) });
4015
- return /* @__PURE__ */ jsxs(Fragment, { children: [
4016
- /* @__PURE__ */ jsx(ConditionalWrapper, { condition: animate, wrapper: (children) => /* @__PURE__ */ jsx(AnimatePresence, { children }), children: open && /* @__PURE__ */ jsx(ConditionalWrapper, { condition: !!portal, wrapper: (children_0) => /* @__PURE__ */ jsx(Portal, { __unstable_name: typeof portal == "string" ? portal : void 0, children: children_0 }), children: popover }) }),
4017
- child
4018
- ] });
4127
+ }, $[46] = refs, $[47] = t25) : t25 = $[47];
4128
+ const setFloating = t25;
4129
+ let t26, t27;
4130
+ $[48] !== update ? (t26 = () => update, t27 = [update], $[48] = update, $[49] = t26, $[50] = t27) : (t26 = $[49], t27 = $[50]), useImperativeHandle(updateRef, t26, t27);
4131
+ let t28, t29;
4132
+ if ($[51] !== children || $[52] !== refs || $[53] !== referenceElement ? (t28 = () => {
4133
+ children || refs.setReference(referenceElement || null);
4134
+ }, t29 = [children, referenceElement, refs], $[51] = children, $[52] = refs, $[53] = referenceElement, $[54] = t28, $[55] = t29) : (t28 = $[54], t29 = $[55]), useEffect(t28, t29), disabled) {
4135
+ let t302;
4136
+ return $[56] !== children ? (t302 = children || /* @__PURE__ */ jsx(Fragment, {}), $[56] = children, $[57] = t302) : t302 = $[57], t302;
4137
+ }
4138
+ let t30;
4139
+ $[58] !== restProps || $[59] !== margins || $[60] !== animate || $[61] !== arrowProp || $[62] !== setArrow || $[63] !== arrowX || $[64] !== arrowY || $[65] !== referenceHidden || $[66] !== overflow || $[67] !== padding || $[68] !== placement || $[69] !== radius || $[70] !== setFloating || $[71] !== scheme || $[72] !== shadow || $[73] !== originX || $[74] !== originY || $[75] !== strategy || $[76] !== tone || $[77] !== x || $[78] !== y || $[79] !== content ? (t30 = /* @__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 ? referenceWidthRef.current : width, x, y, children: content }), $[58] = restProps, $[59] = margins, $[60] = animate, $[61] = arrowProp, $[62] = setArrow, $[63] = arrowX, $[64] = arrowY, $[65] = referenceHidden, $[66] = overflow, $[67] = padding, $[68] = placement, $[69] = radius, $[70] = setFloating, $[71] = scheme, $[72] = shadow, $[73] = originX, $[74] = originY, $[75] = strategy, $[76] = tone, $[77] = x, $[78] = y, $[79] = content, $[80] = t30) : t30 = $[80];
4140
+ let t31;
4141
+ $[81] !== zOffset || $[82] !== t30 ? (t31 = /* @__PURE__ */ jsx(LayerProvider, { zOffset, children: t30 }), $[81] = zOffset, $[82] = t30, $[83] = t31) : t31 = $[83];
4142
+ const popover = t31;
4143
+ let t32;
4144
+ $[84] === Symbol.for("react.memo_cache_sentinel") ? (t32 = (children_0) => /* @__PURE__ */ jsx(AnimatePresence, { children: children_0 }), $[84] = t32) : t32 = $[84];
4145
+ let t33;
4146
+ $[85] !== open || $[86] !== portal || $[87] !== popover ? (t33 = open && /* @__PURE__ */ jsx(ConditionalWrapper, { condition: !!portal, wrapper: (children_1) => /* @__PURE__ */ jsx(Portal, { __unstable_name: typeof portal == "string" ? portal : void 0, children: children_1 }), children: popover }), $[85] = open, $[86] = portal, $[87] = popover, $[88] = t33) : t33 = $[88];
4147
+ let t34;
4148
+ $[89] !== animate || $[90] !== t33 ? (t34 = /* @__PURE__ */ jsx(ConditionalWrapper, { condition: animate, wrapper: t32, children: t33 }), $[89] = animate, $[90] = t33, $[91] = t34) : t34 = $[91];
4149
+ let t35;
4150
+ $[92] !== children || $[93] !== referenceElement || $[94] !== refs ? (t35 = children && !referenceElement && /* @__PURE__ */ jsx("div", { ref: (node_0) => {
4151
+ logDeprecatedWarning(), refs.setReference(node_0);
4152
+ }, style: {
4153
+ display: "contents"
4154
+ }, children }), $[92] = children, $[93] = referenceElement, $[94] = refs, $[95] = t35) : t35 = $[95];
4155
+ let t36;
4156
+ return $[96] !== t34 || $[97] !== t35 ? (t36 = /* @__PURE__ */ jsxs(Fragment, { children: [
4157
+ t34,
4158
+ t35
4159
+ ] }), $[96] = t34, $[97] = t35, $[98] = t36) : t36 = $[98], t36;
4019
4160
  }));
4020
4161
  Popover.displayName = "Popover";
4162
+ let didWarn = !1;
4163
+ function logDeprecatedWarning() {
4164
+ didWarn || (console.warn("Popover: Please use the `referenceElement` prop instead of passing a children."), didWarn = !0);
4165
+ }
4021
4166
  function radioBaseStyle() {
4022
4167
  return css`
4023
4168
  position: relative;
@@ -4877,29 +5022,29 @@ const Root$a = styled(Layer)`
4877
5022
  $maxWidth
4878
5023
  }) => $maxWidth}px;
4879
5024
  `, Tooltip = forwardRef(function(props, forwardedRef) {
4880
- var _a, _b, _c, _d, _e, _f, _g;
5025
+ var _a, _b, _c, _d, _e, _f;
4881
5026
  const boundaryElementContext = useBoundaryElement(), {
4882
5027
  layer
4883
5028
  } = useTheme_v2(), {
4884
5029
  animate: _animate = !1,
4885
5030
  arrow: arrowProp = !1,
4886
- boundaryElement = boundaryElementContext == null ? void 0 : boundaryElementContext.element,
5031
+ boundaryElement: _boundaryElement,
4887
5032
  children: childProp,
4888
5033
  content,
4889
5034
  disabled,
4890
- fallbackPlacements: fallbackPlacementsProp = (_b = props.fallbackPlacements) != null ? _b : DEFAULT_FALLBACK_PLACEMENTS[(_a = props.placement) != null ? _a : "bottom"],
5035
+ fallbackPlacements: _fallbackPlacements,
4891
5036
  padding = 2,
4892
5037
  placement: placementProp = "bottom",
4893
5038
  portal: portalProp,
4894
5039
  radius = 2,
4895
5040
  scheme,
4896
5041
  shadow = 2,
4897
- zOffset = layer.tooltip.zOffset,
5042
+ zOffset: _zOffset,
4898
5043
  delay,
4899
5044
  ...restProps
4900
- } = props, animate = usePrefersReducedMotion() ? !1 : _animate, fallbackPlacements = useMemo(() => _getArrayProp(fallbackPlacementsProp), [fallbackPlacementsProp]), ref = useRef(null), [referenceElement, setReferenceElement] = useState(null), arrowRef = useRef(null), rootBoundary = "viewport";
5045
+ } = props, zOffset = _zOffset != null ? _zOffset : layer.tooltip.zOffset, fallbackPlacementsProp = _fallbackPlacements != null ? _fallbackPlacements : DEFAULT_FALLBACK_PLACEMENTS[(_a = props.placement) != null ? _a : "bottom"], boundaryElement = _boundaryElement != null ? _boundaryElement : boundaryElementContext == null ? void 0 : boundaryElementContext.element, animate = usePrefersReducedMotion() ? !1 : _animate, fallbackPlacements = useMemo(() => _getArrayProp(fallbackPlacementsProp), [fallbackPlacementsProp]), ref = useRef(null), [referenceElement, setReferenceElement] = useState(null), arrowRef = useRef(null), rootBoundary = "viewport";
4901
5046
  useImperativeHandle(forwardedRef, () => ref.current);
4902
- const portal = usePortal(), portalElement = typeof portalProp == "string" ? ((_c = portal.elements) == null ? void 0 : _c[portalProp]) || null : portal.element, documentBodyOffsetWidth = useSyncExternalStore(
5047
+ const portal = usePortal(), portalElement = typeof portalProp == "string" ? ((_b = portal.elements) == null ? void 0 : _b[portalProp]) || null : portal.element, documentBodyOffsetWidth = useSyncExternalStore(
4903
5048
  emptySubscribe,
4904
5049
  () => document.body.offsetWidth,
4905
5050
  // We don't actually know what the width of the body is during SSR, so we'll just assume it's 800px or larger
@@ -4934,7 +5079,7 @@ const Root$a = styled(Layer)`
4934
5079
  middleware,
4935
5080
  placement: placementProp,
4936
5081
  whileElementsMounted: autoUpdate
4937
- }), arrowX = (_d = middlewareData.arrow) == null ? void 0 : _d.x, arrowY = (_e = middlewareData.arrow) == null ? void 0 : _e.y, originX = (_f = middlewareData["@sanity/ui/origin"]) == null ? void 0 : _f.originX, originY = (_g = middlewareData["@sanity/ui/origin"]) == null ? void 0 : _g.originY, tooltipId = useId(), [isOpen, setIsOpen] = useDelayedState(!1), delayGroupContext = useTooltipDelayGroup(), showTooltip = isOpen || (delayGroupContext == null ? void 0 : delayGroupContext.openTooltipId) === tooltipId, isInsideGroup = delayGroupContext !== null, openDelayProp = typeof delay == "number" ? delay : (delay == null ? void 0 : delay.open) || 0, closeDelayProp = typeof delay == "number" ? delay : (delay == null ? void 0 : delay.close) || 0, openDelay = isInsideGroup ? delayGroupContext.openDelay : openDelayProp, closeDelay = isInsideGroup ? delayGroupContext.closeDelay : closeDelayProp, handleIsOpenChange = useCallback((open, immediate) => {
5082
+ }), arrowX = (_c = middlewareData.arrow) == null ? void 0 : _c.x, arrowY = (_d = middlewareData.arrow) == null ? void 0 : _d.y, originX = (_e = middlewareData["@sanity/ui/origin"]) == null ? void 0 : _e.originX, originY = (_f = middlewareData["@sanity/ui/origin"]) == null ? void 0 : _f.originY, tooltipId = useId(), [isOpen, setIsOpen] = useDelayedState(!1), delayGroupContext = useTooltipDelayGroup(), showTooltip = isOpen || (delayGroupContext == null ? void 0 : delayGroupContext.openTooltipId) === tooltipId, isInsideGroup = delayGroupContext !== null, openDelayProp = typeof delay == "number" ? delay : (delay == null ? void 0 : delay.open) || 0, closeDelayProp = typeof delay == "number" ? delay : (delay == null ? void 0 : delay.close) || 0, openDelay = isInsideGroup ? delayGroupContext.openDelay : openDelayProp, closeDelay = isInsideGroup ? delayGroupContext.closeDelay : closeDelayProp, handleIsOpenChange = useCallback((open, immediate) => {
4938
5083
  if (isInsideGroup)
4939
5084
  if (open) {
4940
5085
  const groupedOpenDelay = immediate ? 0 : openDelay;
@@ -4966,9 +5111,9 @@ const Root$a = styled(Layer)`
4966
5111
  }, [childProp == null ? void 0 : childProp.props, handleIsOpenChange]);
4967
5112
  useEffect(() => {
4968
5113
  if (!showTooltip) return;
4969
- function handleWindowMouseMove(event) {
5114
+ const handleWindowMouseMove = (event) => {
4970
5115
  referenceElement && (referenceElement === event.target || event.target instanceof Node && referenceElement.contains(event.target) || (handleIsOpenChange(!1), window.removeEventListener("mousemove", handleWindowMouseMove)));
4971
- }
5116
+ };
4972
5117
  return window.addEventListener("mousemove", handleWindowMouseMove), () => {
4973
5118
  window.removeEventListener("mousemove", handleWindowMouseMove);
4974
5119
  };
@@ -5136,7 +5281,7 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "H
5136
5281
  value: value_0
5137
5282
  }) => /* @__PURE__ */ jsx(Card, { "data-as": "button", padding: paddingProp, radius: 2, tone: "inherit", children: /* @__PURE__ */ jsx(Text, { size: fontSize2, textOverflow: "ellipsis", children: value_0 }) }), [fontSize2, paddingProp]), renderOption = typeof renderOptionProp == "function" ? renderOptionProp : defaultRenderOption, filterOption = typeof filterOptionProp == "function" ? filterOptionProp : DEFAULT_FILTER_OPTION, rootElementRef = useRef(null), resultsPopoverElementRef = useRef(null), inputElementRef = useRef(null), listBoxElementRef = useRef(null), listFocusedRef = useRef(!1), valueRef = useRef(value), valuePropRef = useRef(valueProp), popoverMouseWithinRef = useRef(!1);
5138
5283
  useImperativeHandle(forwardedRef, () => inputElementRef.current);
5139
- const listBoxId = `${id}-listbox`, options = Array.isArray(optionsProp) ? optionsProp : EMPTY_ARRAY, padding = useMemo(() => _getArrayProp(paddingProp), [paddingProp]), currentOption = useMemo(() => value !== null ? options.find((o) => o.value === value) : void 0, [options, value]), filteredOptions = useMemo(() => options.filter((option) => query ? filterOption(query, option) : !0), [filterOption, options, query]), filteredOptionsLen = filteredOptions.length, activeItemId = activeValue ? `${id}-option-${activeValue}` : void 0, expanded = query !== null && loading || focused && query !== null, handleRootBlur = useCallback((event) => {
5284
+ const listBoxId = `${id}-listbox`, options = Array.isArray(optionsProp) ? optionsProp : EMPTY_ARRAY, padding = _getArrayProp(paddingProp), currentOption = useMemo(() => value !== null ? options.find((o) => o.value === value) : void 0, [options, value]), filteredOptions = useMemo(() => options.filter((option) => query ? filterOption(query, option) : !0), [filterOption, options, query]), filteredOptionsLen = filteredOptions.length, activeItemId = activeValue ? `${id}-option-${activeValue}` : void 0, expanded = query !== null && loading || focused && query !== null, handleRootBlur = (event) => {
5140
5285
  setTimeout(() => {
5141
5286
  if (popoverMouseWithinRef.current)
5142
5287
  return;
@@ -5153,13 +5298,13 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "H
5153
5298
  type: "root/blur"
5154
5299
  }), popoverMouseWithinRef.current = !1, onQueryChange && onQueryChange(null), onBlur && onBlur(event));
5155
5300
  }, 0);
5156
- }, [onBlur, onQueryChange, relatedElements]), handleRootFocus = useCallback((event_0) => {
5301
+ }, handleRootFocus = (event_0) => {
5157
5302
  const listBoxElement = listBoxElementRef.current, focusedElement = event_0.target instanceof HTMLElement ? event_0.target : null, listFocused_0 = (listBoxElement == null ? void 0 : listBoxElement.contains(focusedElement)) || !1;
5158
5303
  listFocused_0 !== listFocusedRef.current && (listFocusedRef.current = listFocused_0, dispatch({
5159
5304
  type: "root/setListFocused",
5160
5305
  listFocused: listFocused_0
5161
5306
  }));
5162
- }, []), handleOptionSelect = useCallback((v) => {
5307
+ }, handleOptionSelect = useCallback((v) => {
5163
5308
  var _a;
5164
5309
  dispatch({
5165
5310
  type: "value/change",
@@ -5501,13 +5646,15 @@ const Root$7 = styled(Layer)(responsivePaddingStyle, dialogStyle, responsiveDial
5501
5646
  return $[47] !== width || $[48] !== t18 ? (t19 = /* @__PURE__ */ jsx(DialogContainer, { "data-ui": "DialogCard", width, children: t18 }), $[47] = width, $[48] = t18, $[49] = t19) : t19 = $[49], t19;
5502
5647
  }), Dialog = forwardRef(function(props, ref) {
5503
5648
  var _a;
5504
- const dialog = useDialog(), {
5649
+ const $ = c(75), dialog = useDialog(), {
5505
5650
  layer
5506
- } = useTheme_v2(), {
5507
- __unstable_autoFocus: autoFocus = !0,
5508
- __unstable_hideCloseButton: hideCloseButton = !1,
5509
- cardRadius: cardRadiusProp = 4,
5510
- cardShadow = 3,
5651
+ } = useTheme_v2();
5652
+ let t0, t1, t2, t3, t4, t5, t6, _position, _zOffset, portalProp, onFocus, id, contentRef, footer, header, onClickOutside, onClose, scheme, children, restProps, onActivate;
5653
+ $[0] !== props ? ({
5654
+ __unstable_autoFocus: t0,
5655
+ __unstable_hideCloseButton: t1,
5656
+ cardRadius: t2,
5657
+ cardShadow: t3,
5511
5658
  children,
5512
5659
  contentRef,
5513
5660
  footer,
@@ -5517,15 +5664,33 @@ const Root$7 = styled(Layer)(responsivePaddingStyle, dialogStyle, responsiveDial
5517
5664
  onClickOutside,
5518
5665
  onClose,
5519
5666
  onFocus,
5520
- padding: paddingProp = 3,
5667
+ padding: t4,
5521
5668
  portal: portalProp,
5522
- position: positionProp = dialog.position || "fixed",
5669
+ position: _position,
5523
5670
  scheme,
5524
- width: widthProp = 0,
5525
- zOffset: zOffsetProp = dialog.zOffset || layer.dialog.zOffset,
5526
- animate: _animate = !1,
5671
+ width: t5,
5672
+ zOffset: _zOffset,
5673
+ animate: t6,
5527
5674
  ...restProps
5528
- } = props, animate = usePrefersReducedMotion() ? !1 : _animate, portal = usePortal(), portalElement = portalProp ? ((_a = portal.elements) == null ? void 0 : _a[portalProp]) || null : portal.element, boundaryElement = useBoundaryElement().element, cardRadius = useMemo(() => _getArrayProp(cardRadiusProp), [cardRadiusProp]), padding = useMemo(() => _getArrayProp(paddingProp), [paddingProp]), position = useMemo(() => _getArrayProp(positionProp), [positionProp]), width = useMemo(() => _getArrayProp(widthProp), [widthProp]), zOffset = useMemo(() => _getArrayProp(zOffsetProp), [zOffsetProp]), preDivRef = useRef(null), postDivRef = useRef(null), cardRef = useRef(null), focusedElementRef = useRef(null), handleFocus = useCallback((event) => {
5675
+ } = props, $[0] = props, $[1] = t0, $[2] = t1, $[3] = t2, $[4] = t3, $[5] = t4, $[6] = t5, $[7] = t6, $[8] = _position, $[9] = _zOffset, $[10] = portalProp, $[11] = onFocus, $[12] = id, $[13] = contentRef, $[14] = footer, $[15] = header, $[16] = onClickOutside, $[17] = onClose, $[18] = scheme, $[19] = children, $[20] = restProps, $[21] = onActivate) : (t0 = $[1], t1 = $[2], t2 = $[3], t3 = $[4], t4 = $[5], t5 = $[6], t6 = $[7], _position = $[8], _zOffset = $[9], portalProp = $[10], onFocus = $[11], id = $[12], contentRef = $[13], footer = $[14], header = $[15], onClickOutside = $[16], onClose = $[17], scheme = $[18], children = $[19], restProps = $[20], onActivate = $[21]);
5676
+ const autoFocus = t0 === void 0 ? !0 : t0, hideCloseButton = t1 === void 0 ? !1 : t1, cardRadiusProp = t2 === void 0 ? 4 : t2, cardShadow = t3 === void 0 ? 3 : t3, paddingProp = t4 === void 0 ? 3 : t4, widthProp = t5 === void 0 ? 0 : t5, _animate = t6 === void 0 ? !1 : t6, positionProp = _position != null ? _position : dialog.position || "fixed", zOffsetProp = _zOffset != null ? _zOffset : dialog.zOffset || layer.dialog.zOffset, animate = usePrefersReducedMotion() ? !1 : _animate, portal = usePortal(), portalElement = portalProp ? ((_a = portal.elements) == null ? void 0 : _a[portalProp]) || null : portal.element, boundaryElement = useBoundaryElement().element;
5677
+ let t7, t8;
5678
+ $[22] !== cardRadiusProp ? (t8 = _getArrayProp(cardRadiusProp), $[22] = cardRadiusProp, $[23] = t8) : t8 = $[23], t7 = t8;
5679
+ const cardRadius = t7;
5680
+ let t9, t10;
5681
+ $[24] !== paddingProp ? (t10 = _getArrayProp(paddingProp), $[24] = paddingProp, $[25] = t10) : t10 = $[25], t9 = t10;
5682
+ const padding = t9;
5683
+ let t11, t12;
5684
+ $[26] !== positionProp ? (t12 = _getArrayProp(positionProp), $[26] = positionProp, $[27] = t12) : t12 = $[27], t11 = t12;
5685
+ const position = t11;
5686
+ let t13, t14;
5687
+ $[28] !== widthProp ? (t14 = _getArrayProp(widthProp), $[28] = widthProp, $[29] = t14) : t14 = $[29], t13 = t14;
5688
+ const width = t13;
5689
+ let t15, t16;
5690
+ $[30] !== zOffsetProp ? (t16 = _getArrayProp(zOffsetProp), $[30] = zOffsetProp, $[31] = t16) : t16 = $[31], t15 = t16;
5691
+ const zOffset = t15, preDivRef = useRef(null), postDivRef = useRef(null), cardRef = useRef(null), focusedElementRef = useRef(null);
5692
+ let t17;
5693
+ $[32] !== onFocus ? (t17 = (event) => {
5529
5694
  onFocus == null || onFocus(event);
5530
5695
  const target = event.target, cardElement = cardRef.current;
5531
5696
  if (cardElement && target === preDivRef.current) {
@@ -5537,7 +5702,10 @@ const Root$7 = styled(Layer)(responsivePaddingStyle, dialogStyle, responsiveDial
5537
5702
  return;
5538
5703
  }
5539
5704
  isHTMLElement(event.target) && (focusedElementRef.current = event.target);
5540
- }, [onFocus]), labelId = `${id}_label`, rootClickTimeoutRef = useRef(), handleRootClick = useCallback(() => {
5705
+ }, $[32] = onFocus, $[33] = t17) : t17 = $[33];
5706
+ const handleFocus = t17, labelId = `${id}_label`, rootClickTimeoutRef = useRef();
5707
+ let t18;
5708
+ $[34] !== boundaryElement || $[35] !== portalElement ? (t18 = () => {
5541
5709
  rootClickTimeoutRef.current && clearTimeout(rootClickTimeoutRef.current), rootClickTimeoutRef.current = setTimeout(() => {
5542
5710
  const activeElement = document.activeElement;
5543
5711
  if (activeElement && !isTargetWithinScope(boundaryElement, portalElement, activeElement)) {
@@ -5550,12 +5718,22 @@ const Root$7 = styled(Layer)(responsivePaddingStyle, dialogStyle, responsiveDial
5550
5718
  target_0.focus();
5551
5719
  }
5552
5720
  }, 0);
5553
- }, [boundaryElement, portalElement]);
5554
- return /* @__PURE__ */ jsx(Portal, { __unstable_name: portalProp, children: /* @__PURE__ */ jsxs(Root$7, { ...restProps, $animate: animate, $padding: padding, $position: position, "aria-labelledby": labelId, "aria-modal": !0, "data-ui": "Dialog", id, onActivate, onClick: handleRootClick, onFocus: handleFocus, ref, role: "dialog", zOffset, children: [
5555
- /* @__PURE__ */ jsx("div", { ref: preDivRef, tabIndex: 0 }),
5556
- /* @__PURE__ */ jsx(DialogCard, { __unstable_autoFocus: autoFocus, __unstable_hideCloseButton: hideCloseButton, contentRef, footer, header, id, onClickOutside, onClose, portal: portalProp, radius: cardRadius, ref: cardRef, scheme, shadow: cardShadow, width, children }),
5557
- /* @__PURE__ */ jsx("div", { ref: postDivRef, tabIndex: 0 })
5558
- ] }) });
5721
+ }, $[34] = boundaryElement, $[35] = portalElement, $[36] = t18) : t18 = $[36];
5722
+ const handleRootClick = t18;
5723
+ let t19;
5724
+ $[37] !== preDivRef ? (t19 = /* @__PURE__ */ jsx("div", { ref: preDivRef, tabIndex: 0 }), $[37] = preDivRef, $[38] = t19) : t19 = $[38];
5725
+ let t20;
5726
+ $[39] !== autoFocus || $[40] !== hideCloseButton || $[41] !== contentRef || $[42] !== footer || $[43] !== header || $[44] !== id || $[45] !== onClickOutside || $[46] !== onClose || $[47] !== portalProp || $[48] !== cardRadius || $[49] !== cardRef || $[50] !== scheme || $[51] !== cardShadow || $[52] !== width || $[53] !== children ? (t20 = /* @__PURE__ */ jsx(DialogCard, { __unstable_autoFocus: autoFocus, __unstable_hideCloseButton: hideCloseButton, contentRef, footer, header, id, onClickOutside, onClose, portal: portalProp, radius: cardRadius, ref: cardRef, scheme, shadow: cardShadow, width, children }), $[39] = autoFocus, $[40] = hideCloseButton, $[41] = contentRef, $[42] = footer, $[43] = header, $[44] = id, $[45] = onClickOutside, $[46] = onClose, $[47] = portalProp, $[48] = cardRadius, $[49] = cardRef, $[50] = scheme, $[51] = cardShadow, $[52] = width, $[53] = children, $[54] = t20) : t20 = $[54];
5727
+ let t21;
5728
+ $[55] !== postDivRef ? (t21 = /* @__PURE__ */ jsx("div", { ref: postDivRef, tabIndex: 0 }), $[55] = postDivRef, $[56] = t21) : t21 = $[56];
5729
+ let t22;
5730
+ $[57] !== restProps || $[58] !== animate || $[59] !== padding || $[60] !== position || $[61] !== labelId || $[62] !== id || $[63] !== onActivate || $[64] !== handleRootClick || $[65] !== handleFocus || $[66] !== ref || $[67] !== zOffset || $[68] !== t19 || $[69] !== t20 || $[70] !== t21 ? (t22 = /* @__PURE__ */ jsxs(Root$7, { ...restProps, $animate: animate, $padding: padding, $position: position, "aria-labelledby": labelId, "aria-modal": !0, "data-ui": "Dialog", id, onActivate, onClick: handleRootClick, onFocus: handleFocus, ref, role: "dialog", zOffset, children: [
5731
+ t19,
5732
+ t20,
5733
+ t21
5734
+ ] }), $[57] = restProps, $[58] = animate, $[59] = padding, $[60] = position, $[61] = labelId, $[62] = id, $[63] = onActivate, $[64] = handleRootClick, $[65] = handleFocus, $[66] = ref, $[67] = zOffset, $[68] = t19, $[69] = t20, $[70] = t21, $[71] = t22) : t22 = $[71];
5735
+ let t23;
5736
+ return $[72] !== portalProp || $[73] !== t22 ? (t23 = /* @__PURE__ */ jsx(Portal, { __unstable_name: portalProp, children: t22 }), $[72] = portalProp, $[73] = t22, $[74] = t23) : t23 = $[74], t23;
5559
5737
  });
5560
5738
  function DialogProvider(props) {
5561
5739
  const $ = c(6), {
@@ -5789,28 +5967,41 @@ const Root$5 = styled(Box)`
5789
5967
  outline: none;
5790
5968
  overflow: auto;
5791
5969
  `, Menu = forwardRef(function(props, forwardedRef) {
5970
+ const $ = c(58);
5971
+ let t0, t1, _shouldFocus, onKeyDown, originElement, onItemSelect, onClickOutside, onEscape, registerElement, onItemClick, children, restProps;
5972
+ if ($[0] !== props) {
5973
+ const {
5974
+ children: t22,
5975
+ focusFirst,
5976
+ focusLast,
5977
+ onClickOutside: t32,
5978
+ onEscape: t42,
5979
+ onItemClick: t52,
5980
+ onItemSelect: t62,
5981
+ onKeyDown: t72,
5982
+ originElement: t82,
5983
+ padding: t92,
5984
+ registerElement: t102,
5985
+ shouldFocus: t112,
5986
+ space: t122,
5987
+ ...t132
5988
+ } = props;
5989
+ children = t22, onClickOutside = t32, onEscape = t42, onItemClick = t52, onItemSelect = t62, onKeyDown = t72, originElement = t82, t0 = t92, registerElement = t102, _shouldFocus = t112, t1 = t122, restProps = t132, $[0] = props, $[1] = t0, $[2] = t1, $[3] = _shouldFocus, $[4] = onKeyDown, $[5] = originElement, $[6] = onItemSelect, $[7] = onClickOutside, $[8] = onEscape, $[9] = registerElement, $[10] = onItemClick, $[11] = children, $[12] = restProps;
5990
+ } else
5991
+ t0 = $[1], t1 = $[2], _shouldFocus = $[3], onKeyDown = $[4], originElement = $[5], onItemSelect = $[6], onClickOutside = $[7], onEscape = $[8], registerElement = $[9], onItemClick = $[10], children = $[11], restProps = $[12];
5992
+ const padding = t0 === void 0 ? 1 : t0, space = t1 === void 0 ? 1 : t1, shouldFocus = _shouldFocus != null ? _shouldFocus : props.focusFirst && "first" || props.focusLast && "last" || null, ref = useRef(null);
5993
+ let t2;
5994
+ $[13] === Symbol.for("react.memo_cache_sentinel") ? (t2 = () => ref.current, $[13] = t2) : t2 = $[13], useImperativeHandle(forwardedRef, t2);
5792
5995
  const {
5793
- children,
5794
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
5795
- focusFirst,
5796
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
5797
- focusLast,
5798
- onClickOutside,
5799
- onEscape,
5800
- onItemClick,
5801
- onItemSelect,
5996
+ isTopLayer
5997
+ } = useLayer();
5998
+ let t3;
5999
+ $[14] !== onKeyDown || $[15] !== originElement || $[16] !== shouldFocus ? (t3 = {
5802
6000
  onKeyDown,
5803
6001
  originElement,
5804
- padding = 1,
5805
- registerElement,
5806
- shouldFocus = props.focusFirst && "first" || props.focusLast && "last" || null,
5807
- space = 1,
5808
- ...restProps
5809
- } = props, ref = useRef(null);
5810
- useImperativeHandle(forwardedRef, () => ref.current);
6002
+ shouldFocus
6003
+ }, $[14] = onKeyDown, $[15] = originElement, $[16] = shouldFocus, $[17] = t3) : t3 = $[17];
5811
6004
  const {
5812
- isTopLayer
5813
- } = useLayer(), {
5814
6005
  activeElement,
5815
6006
  activeIndex,
5816
6007
  handleItemMouseEnter,
@@ -5819,22 +6010,31 @@ const Root$5 = styled(Box)`
5819
6010
  mount,
5820
6011
  rootElement,
5821
6012
  setRootElement
5822
- } = useMenuController({
5823
- onKeyDown,
5824
- originElement,
5825
- shouldFocus
5826
- }), handleRefChange = useCallback((el) => {
6013
+ } = useMenuController(t3);
6014
+ let t4;
6015
+ $[18] !== setRootElement ? (t4 = (el) => {
5827
6016
  setRootElement(el), ref.current = el;
5828
- }, [setRootElement]);
5829
- useEffect(() => {
6017
+ }, $[18] = setRootElement, $[19] = t4) : t4 = $[19];
6018
+ const handleRefChange = t4;
6019
+ let t5, t6;
6020
+ $[20] !== onItemSelect || $[21] !== activeIndex ? (t5 = () => {
5830
6021
  onItemSelect && onItemSelect(activeIndex);
5831
- }, [activeIndex, onItemSelect]), useClickOutside(useCallback((event) => isTopLayer && onClickOutside && onClickOutside(event), [isTopLayer, onClickOutside]), [rootElement]), useGlobalKeyDown(useCallback((event_0) => {
6022
+ }, t6 = [activeIndex, onItemSelect], $[20] = onItemSelect, $[21] = activeIndex, $[22] = t5, $[23] = t6) : (t5 = $[22], t6 = $[23]), useEffect(t5, t6);
6023
+ let t7;
6024
+ $[24] !== isTopLayer || $[25] !== onClickOutside ? (t7 = (event) => isTopLayer && onClickOutside && onClickOutside(event), $[24] = isTopLayer, $[25] = onClickOutside, $[26] = t7) : t7 = $[26];
6025
+ let t8;
6026
+ $[27] !== rootElement ? (t8 = [rootElement], $[27] = rootElement, $[28] = t8) : t8 = $[28], useClickOutside(t7, t8);
6027
+ let t9;
6028
+ $[29] !== isTopLayer || $[30] !== onEscape ? (t9 = (event_0) => {
5832
6029
  isTopLayer && event_0.key === "Escape" && (event_0.stopPropagation(), onEscape && onEscape());
5833
- }, [isTopLayer, onEscape])), useEffect(() => {
6030
+ }, $[29] = isTopLayer, $[30] = onEscape, $[31] = t9) : t9 = $[31], useGlobalKeyDown(t9);
6031
+ let t10, t11;
6032
+ $[32] !== rootElement || $[33] !== registerElement ? (t10 = () => {
5834
6033
  if (!(!rootElement || !registerElement))
5835
6034
  return registerElement(rootElement);
5836
- }, [registerElement, rootElement]);
5837
- const value = useMemo(() => ({
6035
+ }, t11 = [registerElement, rootElement], $[32] = rootElement, $[33] = registerElement, $[34] = t10, $[35] = t11) : (t10 = $[34], t11 = $[35]), useEffect(t10, t11);
6036
+ let t12, t13;
6037
+ $[36] !== activeElement || $[37] !== activeIndex || $[38] !== mount || $[39] !== onClickOutside || $[40] !== onEscape || $[41] !== onItemClick || $[42] !== handleItemMouseEnter || $[43] !== handleItemMouseLeave || $[44] !== registerElement ? (t13 = {
5838
6038
  version: 0,
5839
6039
  activeElement,
5840
6040
  activeIndex,
@@ -5845,11 +6045,16 @@ const Root$5 = styled(Box)`
5845
6045
  onItemMouseEnter: handleItemMouseEnter,
5846
6046
  onItemMouseLeave: handleItemMouseLeave,
5847
6047
  registerElement,
5848
- // deprecated
5849
6048
  onMouseEnter: handleItemMouseEnter,
5850
6049
  onMouseLeave: handleItemMouseLeave
5851
- }), [activeElement, activeIndex, mount, handleItemMouseEnter, handleItemMouseLeave, onClickOutside, onEscape, onItemClick, registerElement]);
5852
- return /* @__PURE__ */ jsx(MenuContext.Provider, { value, children: /* @__PURE__ */ jsx(Root$5, { "data-ui": "Menu", ...restProps, onKeyDown: handleKeyDown, padding, ref: handleRefChange, role: "menu", tabIndex: -1, children: /* @__PURE__ */ jsx(Stack, { space, children }) }) });
6050
+ }, $[36] = activeElement, $[37] = activeIndex, $[38] = mount, $[39] = onClickOutside, $[40] = onEscape, $[41] = onItemClick, $[42] = handleItemMouseEnter, $[43] = handleItemMouseLeave, $[44] = registerElement, $[45] = t13) : t13 = $[45], t12 = t13;
6051
+ const value = t12;
6052
+ let t14;
6053
+ $[46] !== space || $[47] !== children ? (t14 = /* @__PURE__ */ jsx(Stack, { space, children }), $[46] = space, $[47] = children, $[48] = t14) : t14 = $[48];
6054
+ let t15;
6055
+ $[49] !== restProps || $[50] !== handleKeyDown || $[51] !== padding || $[52] !== handleRefChange || $[53] !== t14 ? (t15 = /* @__PURE__ */ jsx(Root$5, { "data-ui": "Menu", ...restProps, onKeyDown: handleKeyDown, padding, ref: handleRefChange, role: "menu", tabIndex: -1, children: t14 }), $[49] = restProps, $[50] = handleKeyDown, $[51] = padding, $[52] = handleRefChange, $[53] = t14, $[54] = t15) : t15 = $[54];
6056
+ let t16;
6057
+ return $[55] !== value || $[56] !== t15 ? (t16 = /* @__PURE__ */ jsx(MenuContext.Provider, { value, children: t15 }), $[55] = value, $[56] = t15, $[57] = t16) : t16 = $[57], t16;
5853
6058
  }), MenuButton = forwardRef(function(props, forwardedRef) {
5854
6059
  const {
5855
6060
  __unstable_disableRestoreFocusOnClose: disableRestoreFocusOnClose = !1,
@@ -6063,20 +6268,23 @@ function useMenu() {
6063
6268
  return value;
6064
6269
  }
6065
6270
  function MenuGroup(props) {
6066
- const {
6067
- as = "button",
6271
+ const $ = c(76);
6272
+ let t0, t1, t2, t3, t4, t5, onClick, children, IconComponent, text, restProps, popover;
6273
+ $[0] !== props ? ({
6274
+ as: t0,
6068
6275
  children,
6069
- fontSize: fontSize2 = 1,
6276
+ fontSize: t1,
6070
6277
  icon: IconComponent,
6071
6278
  onClick,
6072
- padding = 3,
6279
+ padding: t2,
6073
6280
  popover,
6074
- radius: radiusProp = 2,
6075
- space = 3,
6281
+ radius: t3,
6282
+ space: t4,
6076
6283
  text,
6077
- tone = "default",
6284
+ tone: t5,
6078
6285
  ...restProps
6079
- } = props, menu = useMenu(), {
6286
+ } = props, $[0] = props, $[1] = t0, $[2] = t1, $[3] = t2, $[4] = t3, $[5] = t4, $[6] = t5, $[7] = onClick, $[8] = children, $[9] = IconComponent, $[10] = text, $[11] = restProps, $[12] = popover) : (t0 = $[1], t1 = $[2], t2 = $[3], t3 = $[4], t4 = $[5], t5 = $[6], onClick = $[7], children = $[8], IconComponent = $[9], text = $[10], restProps = $[11], popover = $[12]);
6287
+ const as = t0 === void 0 ? "button" : t0, fontSize2 = t1 === void 0 ? 1 : t1, padding = t2 === void 0 ? 3 : t2, radiusProp = t3 === void 0 ? 2 : t3, space = t4 === void 0 ? 3 : t4, tone = t5 === void 0 ? "default" : t5, menu = useMenu(), {
6080
6288
  scheme
6081
6289
  } = useRootTheme(), {
6082
6290
  activeElement,
@@ -6084,27 +6292,54 @@ function MenuGroup(props) {
6084
6292
  onClickOutside,
6085
6293
  onEscape,
6086
6294
  onItemClick,
6087
- onItemMouseEnter = menu.onMouseEnter,
6295
+ onItemMouseEnter: _onItemMouseEnter,
6088
6296
  registerElement
6089
- } = menu, [rootElement, setRootElement] = useState(null), [open, setOpen] = useState(!1), shouldFocusRef = useRef(null), active = !!activeElement && activeElement === rootElement, [withinMenu, setWithinMenu] = useState(!1), radius = useMemo(() => _getArrayProp(radiusProp), [radiusProp]), handleMouseEnter = useCallback((event) => {
6297
+ } = menu, onItemMouseEnter = _onItemMouseEnter != null ? _onItemMouseEnter : menu.onMouseEnter, [rootElement, setRootElement] = useState(null), [open, setOpen] = useState(!1), shouldFocusRef = useRef(null), active = !!activeElement && activeElement === rootElement, [withinMenu, setWithinMenu] = useState(!1);
6298
+ let t6, t7;
6299
+ $[13] !== radiusProp ? (t7 = _getArrayProp(radiusProp), $[13] = radiusProp, $[14] = t7) : t7 = $[14], t6 = t7;
6300
+ const radius = t6;
6301
+ let t8;
6302
+ $[15] !== onItemMouseEnter ? (t8 = (event) => {
6090
6303
  setWithinMenu(!1), onItemMouseEnter(event), setOpen(!0);
6091
- }, [onItemMouseEnter]), handleMenuKeyDown = useCallback((event_0) => {
6304
+ }, $[15] = onItemMouseEnter, $[16] = t8) : t8 = $[16];
6305
+ const handleMouseEnter = t8;
6306
+ let t9;
6307
+ $[17] !== rootElement ? (t9 = (event_0) => {
6092
6308
  event_0.key === "ArrowLeft" && (event_0.stopPropagation(), setOpen(!1), requestAnimationFrame(() => {
6093
6309
  rootElement == null || rootElement.focus();
6094
6310
  }));
6095
- }, [rootElement]), handleClick = useCallback((event_1) => {
6311
+ }, $[17] = rootElement, $[18] = t9) : t9 = $[18];
6312
+ const handleMenuKeyDown = t9;
6313
+ let t10;
6314
+ $[19] !== onClick ? (t10 = (event_1) => {
6096
6315
  onClick && onClick(event_1), shouldFocusRef.current = "first", setOpen(!0), requestAnimationFrame(() => {
6097
6316
  shouldFocusRef.current = null;
6098
6317
  });
6099
- }, [onClick]), handleChildItemClick = useCallback(() => {
6318
+ }, $[19] = onClick, $[20] = t10) : t10 = $[20];
6319
+ const handleClick = t10;
6320
+ let t11;
6321
+ $[21] !== onItemClick ? (t11 = () => {
6100
6322
  setOpen(!1), onItemClick && onItemClick();
6101
- }, [onItemClick]), handleMenuMouseEnter = useCallback(() => setWithinMenu(!0), []);
6102
- useEffect(() => mount(rootElement), [mount, rootElement]), useEffect(() => {
6323
+ }, $[21] = onItemClick, $[22] = t11) : t11 = $[22];
6324
+ const handleChildItemClick = t11;
6325
+ let t12;
6326
+ $[23] === Symbol.for("react.memo_cache_sentinel") ? (t12 = () => setWithinMenu(!0), $[23] = t12) : t12 = $[23];
6327
+ const handleMenuMouseEnter = t12;
6328
+ let t13, t14;
6329
+ $[24] !== mount || $[25] !== rootElement ? (t13 = () => mount(rootElement), t14 = [mount, rootElement], $[24] = mount, $[25] = rootElement, $[26] = t13, $[27] = t14) : (t13 = $[26], t14 = $[27]), useEffect(t13, t14);
6330
+ let t15, t16;
6331
+ $[28] !== active ? (t15 = () => {
6103
6332
  active || setOpen(!1);
6104
- }, [active]), useEffect(() => {
6333
+ }, t16 = [active], $[28] = active, $[29] = t15, $[30] = t16) : (t15 = $[29], t16 = $[30]), useEffect(t15, t16);
6334
+ let t17, t18;
6335
+ $[31] !== open ? (t17 = () => {
6105
6336
  open || setWithinMenu(!1);
6106
- }, [open]);
6107
- const childMenu = /* @__PURE__ */ jsx(Menu, { onClickOutside, onEscape, onItemClick: handleChildItemClick, onKeyDown: handleMenuKeyDown, onMouseEnter: handleMenuMouseEnter, registerElement, shouldFocus: shouldFocusRef.current, children }), handleKeyDown = useCallback((event_2) => {
6337
+ }, t18 = [open], $[31] = open, $[32] = t17, $[33] = t18) : (t17 = $[32], t18 = $[33]), useEffect(t17, t18);
6338
+ let t19;
6339
+ $[34] !== onClickOutside || $[35] !== onEscape || $[36] !== handleChildItemClick || $[37] !== handleMenuKeyDown || $[38] !== registerElement || $[39] !== children ? (t19 = /* @__PURE__ */ jsx(Menu, { onClickOutside, onEscape, onItemClick: handleChildItemClick, onKeyDown: handleMenuKeyDown, onMouseEnter: handleMenuMouseEnter, registerElement, shouldFocus: shouldFocusRef.current, children }), $[34] = onClickOutside, $[35] = onEscape, $[36] = handleChildItemClick, $[37] = handleMenuKeyDown, $[38] = registerElement, $[39] = children, $[40] = t19) : t19 = $[40];
6340
+ const childMenu = t19;
6341
+ let t20;
6342
+ $[41] === Symbol.for("react.memo_cache_sentinel") ? (t20 = (event_2) => {
6108
6343
  const target = event_2.currentTarget;
6109
6344
  if (document.activeElement === target && event_2.key === "ArrowRight") {
6110
6345
  shouldFocusRef.current = "first", setOpen(!0), setWithinMenu(!0), requestAnimationFrame(() => {
@@ -6112,27 +6347,43 @@ function MenuGroup(props) {
6112
6347
  });
6113
6348
  return;
6114
6349
  }
6115
- }, []);
6116
- 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: 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: [
6117
- IconComponent && /* @__PURE__ */ jsxs(Text, { size: fontSize2, children: [
6118
- isValidElement(IconComponent) && IconComponent,
6119
- isValidElementType(IconComponent) && /* @__PURE__ */ jsx(IconComponent, {})
6120
- ] }),
6121
- /* @__PURE__ */ jsx(Box, { flex: 1, children: /* @__PURE__ */ jsx(Text, { size: fontSize2, textOverflow: "ellipsis", weight: "medium", children: text }) }),
6122
- /* @__PURE__ */ jsx(Text, { size: fontSize2, children: /* @__PURE__ */ jsx(ChevronRightIcon, {}) })
6123
- ] }) }) });
6350
+ }, $[41] = t20) : t20 = $[41];
6351
+ const handleKeyDown = t20, t21 = as === "button" ? withinMenu : void 0, t22 = as !== "button" ? withinMenu : void 0, t23 = !withinMenu && active ? "" : void 0, t24 = as === "button" ? "button" : void 0;
6352
+ let t25;
6353
+ $[42] !== IconComponent || $[43] !== fontSize2 ? (t25 = IconComponent && /* @__PURE__ */ jsxs(Text, { size: fontSize2, children: [
6354
+ isValidElement(IconComponent) && IconComponent,
6355
+ isValidElementType(IconComponent) && /* @__PURE__ */ jsx(IconComponent, {})
6356
+ ] }), $[42] = IconComponent, $[43] = fontSize2, $[44] = t25) : t25 = $[44];
6357
+ let t26;
6358
+ $[45] !== fontSize2 || $[46] !== text ? (t26 = /* @__PURE__ */ jsx(Box, { flex: 1, children: /* @__PURE__ */ jsx(Text, { size: fontSize2, textOverflow: "ellipsis", weight: "medium", children: text }) }), $[45] = fontSize2, $[46] = text, $[47] = t26) : t26 = $[47];
6359
+ let t27;
6360
+ $[48] === Symbol.for("react.memo_cache_sentinel") ? (t27 = /* @__PURE__ */ jsx(ChevronRightIcon, {}), $[48] = t27) : t27 = $[48];
6361
+ let t28;
6362
+ $[49] !== fontSize2 ? (t28 = /* @__PURE__ */ jsx(Text, { size: fontSize2, children: t27 }), $[49] = fontSize2, $[50] = t28) : t28 = $[50];
6363
+ let t29;
6364
+ $[51] !== space || $[52] !== padding || $[53] !== t25 || $[54] !== t26 || $[55] !== t28 ? (t29 = /* @__PURE__ */ jsxs(Flex, { gap: space, padding, children: [
6365
+ t25,
6366
+ t26,
6367
+ t28
6368
+ ] }), $[51] = space, $[52] = padding, $[53] = t25, $[54] = t26, $[55] = t28, $[56] = t29) : t29 = $[56];
6369
+ let t30;
6370
+ $[57] !== as || $[58] !== restProps || $[59] !== t21 || $[60] !== t22 || $[61] !== t23 || $[62] !== radius || $[63] !== tone || $[64] !== scheme || $[65] !== handleClick || $[66] !== handleKeyDown || $[67] !== handleMouseEnter || $[68] !== t24 || $[69] !== t29 ? (t30 = /* @__PURE__ */ jsx(Selectable, { "data-as": as, "data-ui": "MenuGroup", forwardedAs: as, ...restProps, "aria-pressed": t21, "data-pressed": t22, "data-selected": t23, $radius: radius, $tone: tone, $scheme: scheme, onClick: handleClick, onKeyDown: handleKeyDown, onMouseEnter: handleMouseEnter, ref: setRootElement, tabIndex: -1, type: t24, children: t29 }), $[57] = as, $[58] = restProps, $[59] = t21, $[60] = t22, $[61] = t23, $[62] = radius, $[63] = tone, $[64] = scheme, $[65] = handleClick, $[66] = handleKeyDown, $[67] = handleMouseEnter, $[68] = t24, $[69] = t29, $[70] = t30) : t30 = $[70];
6371
+ let t31;
6372
+ return $[71] !== popover || $[72] !== childMenu || $[73] !== open || $[74] !== t30 ? (t31 = /* @__PURE__ */ jsx(Popover, { ...popover, content: childMenu, "data-ui": "MenuGroup__popover", open, children: t30 }), $[71] = popover, $[72] = childMenu, $[73] = open, $[74] = t30, $[75] = t31) : t31 = $[75], t31;
6124
6373
  }
6125
6374
  const MenuItem = forwardRef(function(props, forwardedRef) {
6126
- const {
6127
- as = "button",
6375
+ const $ = c(78);
6376
+ let t0, t1, t2, t3, t4, t5, selectedProp, disabled, onClick, paddingX, paddingY, paddingTop, paddingRight, paddingBottom, paddingLeft, pressed, IconComponent, text, IconRightComponent, hotkeys, children, restProps;
6377
+ $[0] !== props ? ({
6378
+ as: t0,
6128
6379
  children,
6129
6380
  disabled,
6130
- fontSize: fontSize2 = 1,
6381
+ fontSize: t1,
6131
6382
  hotkeys,
6132
6383
  icon: IconComponent,
6133
6384
  iconRight: IconRightComponent,
6134
6385
  onClick,
6135
- padding = 3,
6386
+ padding: t2,
6136
6387
  paddingX,
6137
6388
  paddingY,
6138
6389
  paddingTop,
@@ -6140,25 +6391,33 @@ const MenuItem = forwardRef(function(props, forwardedRef) {
6140
6391
  paddingBottom,
6141
6392
  paddingLeft,
6142
6393
  pressed,
6143
- radius = 2,
6394
+ radius: t3,
6144
6395
  selected: selectedProp,
6145
- space = 3,
6396
+ space: t4,
6146
6397
  text,
6147
- tone = "default",
6398
+ tone: t5,
6148
6399
  ...restProps
6149
- } = props, {
6400
+ } = props, $[0] = props, $[1] = t0, $[2] = t1, $[3] = t2, $[4] = t3, $[5] = t4, $[6] = t5, $[7] = selectedProp, $[8] = disabled, $[9] = onClick, $[10] = paddingX, $[11] = paddingY, $[12] = paddingTop, $[13] = paddingRight, $[14] = paddingBottom, $[15] = paddingLeft, $[16] = pressed, $[17] = IconComponent, $[18] = text, $[19] = IconRightComponent, $[20] = hotkeys, $[21] = children, $[22] = restProps) : (t0 = $[1], t1 = $[2], t2 = $[3], t3 = $[4], t4 = $[5], t5 = $[6], selectedProp = $[7], disabled = $[8], onClick = $[9], paddingX = $[10], paddingY = $[11], paddingTop = $[12], paddingRight = $[13], paddingBottom = $[14], paddingLeft = $[15], pressed = $[16], IconComponent = $[17], text = $[18], IconRightComponent = $[19], hotkeys = $[20], children = $[21], restProps = $[22]);
6401
+ 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, {
6150
6402
  scheme
6151
6403
  } = useRootTheme(), menu = useMenu(), {
6152
6404
  activeElement,
6153
6405
  mount,
6154
6406
  onItemClick,
6155
- onItemMouseEnter = menu.onMouseEnter,
6156
- onItemMouseLeave = menu.onMouseLeave
6157
- } = menu, [rootElement, setRootElement] = useState(null), active = !!activeElement && activeElement === rootElement, ref = useRef(null);
6158
- useImperativeHandle(forwardedRef, () => ref.current), useEffect(() => mount(rootElement, selectedProp), [mount, rootElement, selectedProp]);
6159
- const handleClick = useCallback((event) => {
6407
+ onItemMouseEnter: _onItemMouseEnter,
6408
+ onItemMouseLeave: _onItemMouseLeave
6409
+ } = menu, onItemMouseEnter = _onItemMouseEnter != null ? _onItemMouseEnter : menu.onMouseEnter, onItemMouseLeave = _onItemMouseLeave != null ? _onItemMouseLeave : menu.onMouseLeave, [rootElement, setRootElement] = useState(null), active = !!activeElement && activeElement === rootElement, ref = useRef(null);
6410
+ let t6;
6411
+ $[23] === Symbol.for("react.memo_cache_sentinel") ? (t6 = () => ref.current, $[23] = t6) : t6 = $[23], useImperativeHandle(forwardedRef, t6);
6412
+ let t7, t8;
6413
+ $[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);
6414
+ let t9;
6415
+ $[29] !== disabled || $[30] !== onClick || $[31] !== onItemClick ? (t9 = (event) => {
6160
6416
  disabled || (onClick && onClick(event), onItemClick && onItemClick());
6161
- }, [disabled, onClick, onItemClick]), paddingProps = useMemo(() => ({
6417
+ }, $[29] = disabled, $[30] = onClick, $[31] = onItemClick, $[32] = t9) : t9 = $[32];
6418
+ const handleClick = t9;
6419
+ let t10, t11;
6420
+ $[33] !== padding || $[34] !== paddingX || $[35] !== paddingY || $[36] !== paddingTop || $[37] !== paddingRight || $[38] !== paddingBottom || $[39] !== paddingLeft ? (t11 = {
6162
6421
  padding,
6163
6422
  paddingX,
6164
6423
  paddingY,
@@ -6166,27 +6425,50 @@ const MenuItem = forwardRef(function(props, forwardedRef) {
6166
6425
  paddingRight,
6167
6426
  paddingBottom,
6168
6427
  paddingLeft
6169
- }), [padding, paddingX, paddingY, paddingTop, paddingRight, paddingBottom, paddingLeft]), hotkeysFontSize = useMemo(() => _getArrayProp(fontSize2).map((s) => s - 1), [fontSize2]), $radius = useMemo(() => _getArrayProp(radius), [radius]), $padding = useMemo(() => _getArrayProp(0), []), setRef = useCallback((el) => {
6428
+ }, $[33] = padding, $[34] = paddingX, $[35] = paddingY, $[36] = paddingTop, $[37] = paddingRight, $[38] = paddingBottom, $[39] = paddingLeft, $[40] = t11) : t11 = $[40], t10 = t11;
6429
+ const paddingProps = t10;
6430
+ let t12, t13;
6431
+ if ($[41] !== fontSize2) {
6432
+ let t142;
6433
+ $[43] === Symbol.for("react.memo_cache_sentinel") ? (t142 = (s) => s - 1, $[43] = t142) : t142 = $[43], t13 = _getArrayProp(fontSize2).map(t142), $[41] = fontSize2, $[42] = t13;
6434
+ } else
6435
+ t13 = $[42];
6436
+ t12 = t13;
6437
+ const hotkeysFontSize = t12;
6438
+ let t14, t15;
6439
+ $[44] !== radius ? (t15 = _getArrayProp(radius), $[44] = radius, $[45] = t15) : t15 = $[45], t14 = t15;
6440
+ const $radius = t14;
6441
+ let t16, t17;
6442
+ $[46] === Symbol.for("react.memo_cache_sentinel") ? (t17 = _getArrayProp(0), $[46] = t17) : t17 = $[46], t16 = t17;
6443
+ const $padding = t16;
6444
+ let t18;
6445
+ $[47] === Symbol.for("react.memo_cache_sentinel") ? (t18 = (el) => {
6170
6446
  ref.current = el, setRootElement(el);
6171
- }, []);
6172
- return /* @__PURE__ */ jsxs(Selectable, { "data-ui": "MenuItem", ...restProps, "aria-pressed": as === "button" && pressed, "data-pressed": as !== "button" && pressed ? "" : void 0, "data-selected": active ? "" : void 0, "data-disabled": disabled ? "" : void 0, forwardedAs: as, $radius, $padding, $tone: disabled ? "default" : tone, $scheme: scheme, disabled, onClick: handleClick, onMouseEnter: onItemMouseEnter, onMouseLeave: onItemMouseLeave, ref: setRef, role: "menuitem", tabIndex: -1, type: as === "button" ? "button" : void 0, children: [
6173
- (IconComponent || text || IconRightComponent) && /* @__PURE__ */ jsxs(Flex, { as: "span", gap: space, align: "center", ...paddingProps, children: [
6174
- IconComponent && /* @__PURE__ */ jsxs(Text, { size: fontSize2, children: [
6175
- isValidElement(IconComponent) && IconComponent,
6176
- isValidElementType(IconComponent) && /* @__PURE__ */ jsx(IconComponent, {})
6177
- ] }),
6178
- text && /* @__PURE__ */ jsx(Box, { flex: 1, children: /* @__PURE__ */ jsx(Text, { size: fontSize2, textOverflow: "ellipsis", weight: "medium", children: text }) }),
6179
- hotkeys && /* @__PURE__ */ jsx(Hotkeys, { fontSize: hotkeysFontSize, keys: hotkeys, style: {
6180
- marginTop: -4,
6181
- marginBottom: -4
6182
- } }),
6183
- IconRightComponent && /* @__PURE__ */ jsxs(Text, { size: fontSize2, children: [
6184
- isValidElement(IconRightComponent) && IconRightComponent,
6185
- isValidElementType(IconRightComponent) && /* @__PURE__ */ jsx(IconRightComponent, {})
6186
- ] })
6447
+ }, $[47] = t18) : t18 = $[47];
6448
+ const setRef = t18, t19 = as === "button" && pressed, t20 = as !== "button" && pressed ? "" : void 0, t21 = active ? "" : void 0, t22 = disabled ? "" : void 0, t23 = disabled ? "default" : tone, t24 = as === "button" ? "button" : void 0;
6449
+ let t25;
6450
+ $[48] !== IconComponent || $[49] !== text || $[50] !== IconRightComponent || $[51] !== fontSize2 || $[52] !== hotkeys || $[53] !== hotkeysFontSize || $[54] !== space || $[55] !== paddingProps ? (t25 = (IconComponent || text || IconRightComponent) && /* @__PURE__ */ jsxs(Flex, { as: "span", gap: space, align: "center", ...paddingProps, children: [
6451
+ IconComponent && /* @__PURE__ */ jsxs(Text, { size: fontSize2, children: [
6452
+ isValidElement(IconComponent) && IconComponent,
6453
+ isValidElementType(IconComponent) && /* @__PURE__ */ jsx(IconComponent, {})
6187
6454
  ] }),
6188
- children && /* @__PURE__ */ jsx(Box, { as: "span", ...paddingProps, children })
6189
- ] });
6455
+ text && /* @__PURE__ */ jsx(Box, { flex: 1, children: /* @__PURE__ */ jsx(Text, { size: fontSize2, textOverflow: "ellipsis", weight: "medium", children: text }) }),
6456
+ hotkeys && /* @__PURE__ */ jsx(Hotkeys, { fontSize: hotkeysFontSize, keys: hotkeys, style: {
6457
+ marginTop: -4,
6458
+ marginBottom: -4
6459
+ } }),
6460
+ IconRightComponent && /* @__PURE__ */ jsxs(Text, { size: fontSize2, children: [
6461
+ isValidElement(IconRightComponent) && IconRightComponent,
6462
+ isValidElementType(IconRightComponent) && /* @__PURE__ */ jsx(IconRightComponent, {})
6463
+ ] })
6464
+ ] }), $[48] = IconComponent, $[49] = text, $[50] = IconRightComponent, $[51] = fontSize2, $[52] = hotkeys, $[53] = hotkeysFontSize, $[54] = space, $[55] = paddingProps, $[56] = t25) : t25 = $[56];
6465
+ let t26;
6466
+ $[57] !== children || $[58] !== paddingProps ? (t26 = children && /* @__PURE__ */ jsx(Box, { as: "span", ...paddingProps, children }), $[57] = children, $[58] = paddingProps, $[59] = t26) : t26 = $[59];
6467
+ let t27;
6468
+ return $[60] !== restProps || $[61] !== t19 || $[62] !== t20 || $[63] !== t21 || $[64] !== t22 || $[65] !== as || $[66] !== $radius || $[67] !== t23 || $[68] !== scheme || $[69] !== disabled || $[70] !== handleClick || $[71] !== onItemMouseEnter || $[72] !== onItemMouseLeave || $[73] !== setRef || $[74] !== t24 || $[75] !== t25 || $[76] !== t26 ? (t27 = /* @__PURE__ */ jsxs(Selectable, { "data-ui": "MenuItem", ...restProps, "aria-pressed": t19, "data-pressed": t20, "data-selected": t21, "data-disabled": t22, forwardedAs: as, $radius, $padding, $tone: t23, $scheme: scheme, disabled, onClick: handleClick, onMouseEnter: onItemMouseEnter, onMouseLeave: onItemMouseLeave, ref: setRef, role: "menuitem", tabIndex: -1, type: t24, children: [
6469
+ t25,
6470
+ t26
6471
+ ] }), $[60] = restProps, $[61] = t19, $[62] = t20, $[63] = t21, $[64] = t22, $[65] = as, $[66] = $radius, $[67] = t23, $[68] = scheme, $[69] = disabled, $[70] = handleClick, $[71] = onItemMouseEnter, $[72] = onItemMouseLeave, $[73] = setRef, $[74] = t24, $[75] = t25, $[76] = t26, $[77] = t27) : t27 = $[77], t27;
6190
6472
  }), keyframe = keyframes`
6191
6473
  0% {
6192
6474
  background-position: 100%;
@@ -6470,15 +6752,86 @@ const subscribe = () => () => {
6470
6752
  max-width: 420px;
6471
6753
  width: 100%;
6472
6754
  `;
6473
- let toastId = 0;
6474
6755
  function ToastProvider(props) {
6475
- const {
6756
+ const $ = c(22), {
6476
6757
  children,
6477
- padding = 4,
6758
+ padding: t0,
6478
6759
  paddingX,
6479
6760
  paddingY,
6480
6761
  zOffset
6481
- } = props, [state, _setState] = useState([]), toastsRef = useRef({}), mounted = useMounted(), prefersReducedMotion = usePrefersReducedMotion(), variants = useMemo(() => ({
6762
+ } = props, padding = t0 === void 0 ? 4 : t0;
6763
+ let t1;
6764
+ $[0] === Symbol.for("react.memo_cache_sentinel") ? (t1 = [], $[0] = t1) : t1 = $[0];
6765
+ const [state, _setState] = useState(t1);
6766
+ let t2;
6767
+ $[1] === Symbol.for("react.memo_cache_sentinel") ? (t2 = {}, $[1] = t2) : t2 = $[1];
6768
+ const toastsRef = useRef(t2), mounted = useMounted(), prefersReducedMotion = usePrefersReducedMotion();
6769
+ let t3, t4;
6770
+ $[2] !== prefersReducedMotion ? (t4 = getVariants(prefersReducedMotion), $[2] = prefersReducedMotion, $[3] = t4) : t4 = $[3], t3 = t4;
6771
+ const variants = t3;
6772
+ let t5, t6;
6773
+ $[4] === Symbol.for("react.memo_cache_sentinel") ? (t6 = (params) => {
6774
+ const setState = (state_0) => startTransition(() => _setState(state_0)), id = params.id || crypto.randomUUID(), duration = params.duration || 5e3, dismiss = () => {
6775
+ var _a;
6776
+ const timeoutId = (_a = toastsRef.current[id]) == null ? void 0 : _a.timeoutId;
6777
+ setState((prevState) => {
6778
+ const idx = prevState.findIndex((t) => t.id === id);
6779
+ if (idx > -1) {
6780
+ const toasts = prevState.slice(0);
6781
+ return toasts.splice(idx, 1), toasts;
6782
+ }
6783
+ return prevState;
6784
+ }), timeoutId !== void 0 && (clearTimeout(timeoutId), delete toastsRef.current[id]);
6785
+ };
6786
+ return setState((prevState_0) => prevState_0.filter((t_0) => t_0.id !== id).concat([{
6787
+ dismiss,
6788
+ id,
6789
+ params: {
6790
+ ...params,
6791
+ duration
6792
+ }
6793
+ }])), toastsRef.current[id] && (clearTimeout(toastsRef.current[id].timeoutId), delete toastsRef.current[id]), toastsRef.current[id] = {
6794
+ timeoutId: setTimeout(dismiss, duration)
6795
+ }, id;
6796
+ }, $[4] = t6) : t6 = $[4];
6797
+ const push = t6;
6798
+ let t7;
6799
+ $[5] !== push ? (t7 = {
6800
+ version: 0,
6801
+ push
6802
+ }, $[5] = push, $[6] = t7) : t7 = $[6], t5 = t7;
6803
+ const value = t5;
6804
+ let t8, t9;
6805
+ $[7] === Symbol.for("react.memo_cache_sentinel") ? (t8 = () => () => {
6806
+ for (const {
6807
+ timeoutId: timeoutId_0
6808
+ } of Object.values(toastsRef.current))
6809
+ clearTimeout(timeoutId_0);
6810
+ toastsRef.current = {};
6811
+ }, t9 = [], $[7] = t8, $[8] = t9) : (t8 = $[7], t9 = $[8]), useEffect(t8, t9);
6812
+ let t10;
6813
+ $[9] !== mounted || $[10] !== variants || $[11] !== prefersReducedMotion || $[12] !== state || $[13] !== padding || $[14] !== paddingX || $[15] !== paddingY || $[16] !== zOffset ? (t10 = mounted && /* @__PURE__ */ jsx(Root$1, { "data-ui": "ToastProvider", zOffset, children: /* @__PURE__ */ jsx(ToastContainer, { children: /* @__PURE__ */ jsx(Box, { padding, paddingX, paddingY, children: /* @__PURE__ */ jsx(AnimatePresence, { initial: !1, children: state.map((t112) => {
6814
+ const {
6815
+ dismiss: dismiss_0,
6816
+ id: id_0,
6817
+ params: params_0
6818
+ } = t112;
6819
+ return /* @__PURE__ */ jsx(motion.div, { layout: "position", initial: "initial", animate: "animate", exit: "exit", variants, transition: prefersReducedMotion ? {
6820
+ duration: 0
6821
+ } : {
6822
+ type: "spring",
6823
+ damping: 30,
6824
+ stiffness: 400
6825
+ }, children: /* @__PURE__ */ jsx(Toast, { closable: params_0.closable, description: params_0.description, onClose: dismiss_0, status: params_0.status, title: params_0.title }) }, id_0);
6826
+ }) }) }) }) }), $[9] = mounted, $[10] = variants, $[11] = prefersReducedMotion, $[12] = state, $[13] = padding, $[14] = paddingX, $[15] = paddingY, $[16] = zOffset, $[17] = t10) : t10 = $[17];
6827
+ let t11;
6828
+ return $[18] !== value || $[19] !== children || $[20] !== t10 ? (t11 = /* @__PURE__ */ jsxs(ToastContext.Provider, { value, children: [
6829
+ children,
6830
+ t10
6831
+ ] }), $[18] = value, $[19] = children, $[20] = t10, $[21] = t11) : t11 = $[21], t11;
6832
+ }
6833
+ function getVariants(prefersReducedMotion) {
6834
+ return {
6482
6835
  initial: {
6483
6836
  opacity: 0,
6484
6837
  [POPOVER_MOTION_CONTENT_OPACITY_PROPERTY]: 0,
@@ -6496,59 +6849,11 @@ function ToastProvider(props) {
6496
6849
  opacity: [1, 1, 0],
6497
6850
  [POPOVER_MOTION_CONTENT_OPACITY_PROPERTY]: [1, 0, 0],
6498
6851
  scale: 0.5,
6499
- transition: prefersReducedMotion ? {
6500
- duration: 0
6501
- } : {
6502
- duration: 0.2
6852
+ transition: {
6853
+ duration: prefersReducedMotion ? 0 : 0.2
6503
6854
  }
6504
6855
  }
6505
- }), [prefersReducedMotion]), value = useMemo(() => ({
6506
- version: 0,
6507
- push: (params) => {
6508
- const setState = (state_0) => startTransition(() => _setState(state_0)), id = params.id || String(toastId++), duration = params.duration || 5e3, dismiss = () => {
6509
- var _a;
6510
- const timeoutId = (_a = toastsRef.current[id]) == null ? void 0 : _a.timeoutId;
6511
- setState((prevState) => {
6512
- const idx = prevState.findIndex((t) => t.id === id);
6513
- if (idx > -1) {
6514
- const toasts = prevState.slice(0);
6515
- return toasts.splice(idx, 1), toasts;
6516
- }
6517
- return prevState;
6518
- }), timeoutId !== void 0 && (clearTimeout(timeoutId), delete toastsRef.current[id]);
6519
- };
6520
- return setState((prevState_0) => prevState_0.filter((t_0) => t_0.id !== id).concat([{
6521
- dismiss,
6522
- id,
6523
- params: {
6524
- ...params,
6525
- duration
6526
- }
6527
- }])), toastsRef.current[id] && (clearTimeout(toastsRef.current[id].timeoutId), delete toastsRef.current[id]), toastsRef.current[id] = {
6528
- timeoutId: setTimeout(dismiss, duration)
6529
- }, id;
6530
- }
6531
- }), []);
6532
- return useEffect(() => () => {
6533
- for (const {
6534
- timeoutId: timeoutId_0
6535
- } of Object.values(toastsRef.current))
6536
- clearTimeout(timeoutId_0);
6537
- toastsRef.current = {};
6538
- }, []), /* @__PURE__ */ jsxs(ToastContext.Provider, { value, children: [
6539
- children,
6540
- mounted && /* @__PURE__ */ jsx(Root$1, { "data-ui": "ToastProvider", zOffset, children: /* @__PURE__ */ jsx(ToastContainer, { children: /* @__PURE__ */ jsx(Box, { padding, paddingX, paddingY, children: /* @__PURE__ */ jsx(AnimatePresence, { initial: !1, children: state.map(({
6541
- dismiss: dismiss_0,
6542
- id: id_0,
6543
- params: params_0
6544
- }) => /* @__PURE__ */ jsx(motion.div, { layout: "position", initial: "initial", animate: "animate", exit: "exit", variants, transition: prefersReducedMotion ? {
6545
- duration: 0
6546
- } : {
6547
- type: "spring",
6548
- damping: 30,
6549
- stiffness: 400
6550
- }, children: /* @__PURE__ */ jsx(Toast, { closable: params_0.closable, description: params_0.description, onClose: dismiss_0, status: params_0.status, title: params_0.title }) }, id_0)) }) }) }) })
6551
- ] });
6856
+ };
6552
6857
  }
6553
6858
  function useToast() {
6554
6859
  const value = useContext(ToastContext);
@@ -6771,6 +7076,24 @@ const key = Symbol.for("@sanity/ui/context/tree"), TreeContext = createGlobalSco
6771
7076
  return $[35] !== contextValue || $[36] !== t19 ? (t20 = /* @__PURE__ */ jsx(TreeContext.Provider, { value: contextValue, children: t19 }), $[35] = contextValue, $[36] = t19, $[37] = t20) : t20 = $[37], t20;
6772
7077
  }));
6773
7078
  Tree.displayName = "Tree";
7079
+ function useTree() {
7080
+ const tree = useContext(TreeContext);
7081
+ if (!tree)
7082
+ throw new Error("Tree: missing context value");
7083
+ return tree;
7084
+ }
7085
+ const TreeGroup = memo(function(props) {
7086
+ const $ = c(9);
7087
+ let t0, restProps, children;
7088
+ $[0] !== props ? ({
7089
+ children,
7090
+ expanded: t0,
7091
+ ...restProps
7092
+ } = props, $[0] = props, $[1] = t0, $[2] = restProps, $[3] = children) : (t0 = $[1], restProps = $[2], children = $[3]);
7093
+ const expanded = t0 === void 0 ? !1 : t0, tree = useTree(), t1 = !expanded;
7094
+ let t2;
7095
+ return $[4] !== restProps || $[5] !== t1 || $[6] !== tree.space || $[7] !== children ? (t2 = /* @__PURE__ */ jsx(Stack, { as: "ul", "data-ui": "TreeGroup", ...restProps, hidden: t1, marginTop: tree.space, role: "group", space: tree.space, children }), $[4] = restProps, $[5] = t1, $[6] = tree.space, $[7] = children, $[8] = t2) : t2 = $[8], t2;
7096
+ });
6774
7097
  function treeItemRootStyle() {
6775
7098
  return css`
6776
7099
  &[role='none'] > [role='treeitem'] {
@@ -6863,88 +7186,124 @@ function treeItemBoxStyle(props) {
6863
7186
  }
6864
7187
  `;
6865
7188
  }
6866
- function useTree() {
6867
- const tree = useContext(TreeContext);
6868
- if (!tree)
6869
- throw new Error("Tree: missing context value");
6870
- return tree;
6871
- }
6872
- const TreeGroup = memo(function(props) {
6873
- const $ = c(9);
6874
- let t0, restProps, children;
6875
- $[0] !== props ? ({
6876
- children,
6877
- expanded: t0,
6878
- ...restProps
6879
- } = props, $[0] = props, $[1] = t0, $[2] = restProps, $[3] = children) : (t0 = $[1], restProps = $[2], children = $[3]);
6880
- const expanded = t0 === void 0 ? !1 : t0, tree = useTree(), t1 = !expanded;
6881
- let t2;
6882
- return $[4] !== restProps || $[5] !== t1 || $[6] !== tree.space || $[7] !== children ? (t2 = /* @__PURE__ */ jsx(Stack, { as: "ul", "data-ui": "TreeGroup", ...restProps, hidden: t1, marginTop: tree.space, role: "group", space: tree.space, children }), $[4] = restProps, $[5] = t1, $[6] = tree.space, $[7] = children, $[8] = t2) : t2 = $[8], t2;
6883
- }), Root = memo(styled.li(treeItemRootStyle, treeItemRootColorStyle)), TreeItemBox = styled(Box).attrs({
7189
+ const Root = memo(styled.li(treeItemRootStyle, treeItemRootColorStyle)), TreeItemBox = styled(Box).attrs({
6884
7190
  forwardedAs: "a"
6885
7191
  })(treeItemBoxStyle), ToggleArrowText = styled(Text)`
6886
7192
  & > svg {
6887
7193
  transition: transform 100ms;
6888
7194
  }
6889
7195
  `, TreeItem = memo(function(props) {
6890
- const {
7196
+ const $ = c(108);
7197
+ let t0, t1, t2, t3, t4, idProp, onClick, IconComponent, children, muted, text, weight, href, linkAs, restProps;
7198
+ $[0] !== props ? ({
6891
7199
  children,
6892
- expanded: expandedProp = !1,
6893
- fontSize: fontSize2 = 1,
7200
+ expanded: t0,
7201
+ fontSize: t1,
6894
7202
  href,
6895
7203
  icon: IconComponent,
6896
7204
  id: idProp,
6897
7205
  linkAs,
6898
7206
  muted,
6899
7207
  onClick,
6900
- padding = 2,
6901
- selected = !1,
6902
- space = 2,
7208
+ padding: t2,
7209
+ selected: t3,
7210
+ space: t4,
6903
7211
  text,
6904
7212
  weight,
6905
7213
  ...restProps
6906
- } = props, rootRef = useRef(null), treeitemRef = useRef(null), tree = useTree(), {
7214
+ } = props, $[0] = props, $[1] = t0, $[2] = t1, $[3] = t2, $[4] = t3, $[5] = t4, $[6] = idProp, $[7] = onClick, $[8] = IconComponent, $[9] = children, $[10] = muted, $[11] = text, $[12] = weight, $[13] = href, $[14] = linkAs, $[15] = restProps) : (t0 = $[1], t1 = $[2], t2 = $[3], t3 = $[4], t4 = $[5], idProp = $[6], onClick = $[7], IconComponent = $[8], children = $[9], muted = $[10], text = $[11], weight = $[12], href = $[13], linkAs = $[14], restProps = $[15]);
7215
+ const expandedProp = t0 === void 0 ? !1 : t0, fontSize2 = t1 === void 0 ? 1 : t1, padding = t2 === void 0 ? 2 : t2, selected = t3 === void 0 ? !1 : t3, space = t4 === void 0 ? 2 : t4, rootRef = useRef(null), treeitemRef = useRef(null), tree = useTree(), {
6907
7216
  path,
6908
7217
  registerItem,
6909
7218
  setExpanded,
6910
7219
  setFocusedElement
6911
- } = tree, _id = useId(), id = idProp || _id, itemPath = useMemo(() => path.concat([id || ""]), [id, path]), itemKey = itemPath.join("/"), itemState = tree.state[itemKey], focused = tree.focusedElement === rootRef.current, expanded = (itemState == null ? void 0 : itemState.expanded) === void 0 ? expandedProp : (itemState == null ? void 0 : itemState.expanded) || !1, tabIndex = tree.focusedElement && tree.focusedElement === rootRef.current ? 0 : -1, contextValue = useMemo(() => ({
7220
+ } = tree, _id = useId(), id = idProp || _id;
7221
+ let t5;
7222
+ const t6 = id || "";
7223
+ let t7;
7224
+ $[16] !== path || $[17] !== t6 ? (t7 = [...path, t6], $[16] = path, $[17] = t6, $[18] = t7) : t7 = $[18], t5 = t7;
7225
+ const itemPath = t5, itemKey = itemPath.join("/"), itemState = tree.state[itemKey], focused = tree.focusedElement === rootRef.current, expanded = (itemState == null ? void 0 : itemState.expanded) === void 0 ? expandedProp : (itemState == null ? void 0 : itemState.expanded) || !1, tabIndex = tree.focusedElement && tree.focusedElement === rootRef.current ? 0 : -1;
7226
+ let t8;
7227
+ const t9 = tree.level + 1;
7228
+ let t10;
7229
+ $[19] !== tree || $[20] !== t9 || $[21] !== itemPath ? (t10 = {
6912
7230
  ...tree,
6913
- level: tree.level + 1,
7231
+ level: t9,
6914
7232
  path: itemPath
6915
- }), [itemPath, tree]), handleClick = useCallback((event) => {
6916
- onClick && onClick(event);
7233
+ }, $[19] = tree, $[20] = t9, $[21] = itemPath, $[22] = t10) : t10 = $[22], t8 = t10;
7234
+ const contextValue = t8;
7235
+ let t11;
7236
+ $[23] !== onClick || $[24] !== setExpanded || $[25] !== itemKey || $[26] !== expanded || $[27] !== setFocusedElement ? (t11 = (event) => {
7237
+ onClick == null || onClick(event);
6917
7238
  const target = event.target;
6918
7239
  target instanceof HTMLElement && (target.getAttribute("data-ui") === "TreeItem" || target.closest('[data-ui="TreeItem__box"]')) && (event.stopPropagation(), setExpanded(itemKey, !expanded), setFocusedElement(rootRef.current));
6919
- }, [expanded, itemKey, onClick, setExpanded, setFocusedElement]), handleKeyDown = useCallback((event_0) => {
7240
+ }, $[23] = onClick, $[24] = setExpanded, $[25] = itemKey, $[26] = expanded, $[27] = setFocusedElement, $[28] = t11) : t11 = $[28];
7241
+ const handleClick = t11;
7242
+ let t12;
7243
+ $[29] !== focused ? (t12 = (event_0) => {
6920
7244
  if (focused && event_0.key === "Enter") {
6921
7245
  const el = treeitemRef.current || rootRef.current;
6922
7246
  el == null || el.click();
6923
7247
  }
6924
- }, [focused]);
6925
- useEffect(() => {
7248
+ }, $[29] = focused, $[30] = t12) : t12 = $[30];
7249
+ const handleKeyDown = t12;
7250
+ let t13, t14;
7251
+ $[31] !== registerItem || $[32] !== itemPath || $[33] !== expanded || $[34] !== selected ? (t13 = () => {
6926
7252
  if (rootRef.current)
6927
7253
  return registerItem(rootRef.current, itemPath.join("/"), expanded, selected);
6928
- }, [expanded, itemPath, registerItem, selected]);
6929
- const content = /* @__PURE__ */ jsxs(Flex, { padding, children: [
6930
- /* @__PURE__ */ jsxs(Box, { marginRight: space, style: {
6931
- visibility: IconComponent || children ? "visible" : "hidden",
6932
- pointerEvents: "none"
6933
- }, children: [
6934
- IconComponent && /* @__PURE__ */ jsx(Text, { muted, size: fontSize2, weight, children: /* @__PURE__ */ jsx(IconComponent, {}) }),
6935
- !IconComponent && /* @__PURE__ */ jsx(ToggleArrowText, { muted, size: fontSize2, weight, children: /* @__PURE__ */ jsx(ToggleArrowRightIcon, { style: {
6936
- transform: expanded ? "rotate(90deg)" : void 0
6937
- } }) })
6938
- ] }),
6939
- /* @__PURE__ */ jsx(Box, { flex: 1, children: /* @__PURE__ */ jsx(Text, { muted, size: fontSize2, textOverflow: "ellipsis", weight, children: text }) })
6940
- ] });
6941
- return href ? /* @__PURE__ */ jsxs(Root, { "data-selected": selected ? "" : void 0, "data-tree-id": id, "data-tree-key": itemKey, "data-ui": "TreeItem", ...restProps, onClick: handleClick, ref: rootRef, role: "none", children: [
6942
- /* @__PURE__ */ jsx(TreeItemBox, { $level: tree.level, "aria-expanded": expanded, as: linkAs, "data-ui": "TreeItem__box", href, ref: treeitemRef, role: "treeitem", tabIndex, children: content }),
6943
- /* @__PURE__ */ jsx(TreeContext.Provider, { value: contextValue, children: children && /* @__PURE__ */ jsx(TreeGroup, { hidden: !expanded, children }) })
6944
- ] }) : /* @__PURE__ */ jsxs(Root, { "data-selected": selected ? "" : void 0, "data-ui": "TreeItem", "data-tree-id": id, "data-tree-key": itemKey, ...restProps, "aria-expanded": expanded, onClick: handleClick, onKeyDown: handleKeyDown, ref: rootRef, role: "treeitem", tabIndex, children: [
6945
- /* @__PURE__ */ jsx(TreeItemBox, { $level: tree.level, as: "div", "data-ui": "TreeItem__box", children: content }),
6946
- /* @__PURE__ */ jsx(TreeContext.Provider, { value: contextValue, children: children && /* @__PURE__ */ jsx(TreeGroup, { expanded, children }) })
6947
- ] });
7254
+ }, t14 = [expanded, itemPath, registerItem, selected], $[31] = registerItem, $[32] = itemPath, $[33] = expanded, $[34] = selected, $[35] = t13, $[36] = t14) : (t13 = $[35], t14 = $[36]), useEffect(t13, t14);
7255
+ let t15;
7256
+ const t16 = IconComponent || children ? "visible" : "hidden";
7257
+ let t17;
7258
+ $[37] !== t16 ? (t17 = {
7259
+ visibility: t16,
7260
+ pointerEvents: "none"
7261
+ }, $[37] = t16, $[38] = t17) : t17 = $[38];
7262
+ let t18;
7263
+ $[39] !== IconComponent || $[40] !== muted || $[41] !== fontSize2 || $[42] !== weight ? (t18 = IconComponent && /* @__PURE__ */ jsx(Text, { muted, size: fontSize2, weight, children: /* @__PURE__ */ jsx(IconComponent, {}) }), $[39] = IconComponent, $[40] = muted, $[41] = fontSize2, $[42] = weight, $[43] = t18) : t18 = $[43];
7264
+ let t19;
7265
+ $[44] !== IconComponent || $[45] !== expanded || $[46] !== muted || $[47] !== fontSize2 || $[48] !== weight ? (t19 = !IconComponent && /* @__PURE__ */ jsx(ToggleArrowText, { muted, size: fontSize2, weight, children: /* @__PURE__ */ jsx(ToggleArrowRightIcon, { style: {
7266
+ transform: expanded ? "rotate(90deg)" : void 0
7267
+ } }) }), $[44] = IconComponent, $[45] = expanded, $[46] = muted, $[47] = fontSize2, $[48] = weight, $[49] = t19) : t19 = $[49];
7268
+ let t20;
7269
+ $[50] !== space || $[51] !== t17 || $[52] !== t18 || $[53] !== t19 ? (t20 = /* @__PURE__ */ jsxs(Box, { marginRight: space, style: t17, children: [
7270
+ t18,
7271
+ t19
7272
+ ] }), $[50] = space, $[51] = t17, $[52] = t18, $[53] = t19, $[54] = t20) : t20 = $[54];
7273
+ let t21;
7274
+ $[55] !== muted || $[56] !== fontSize2 || $[57] !== weight || $[58] !== text ? (t21 = /* @__PURE__ */ jsx(Box, { flex: 1, children: /* @__PURE__ */ jsx(Text, { muted, size: fontSize2, textOverflow: "ellipsis", weight, children: text }) }), $[55] = muted, $[56] = fontSize2, $[57] = weight, $[58] = text, $[59] = t21) : t21 = $[59];
7275
+ let t22;
7276
+ $[60] !== padding || $[61] !== t20 || $[62] !== t21 ? (t22 = /* @__PURE__ */ jsxs(Flex, { padding, children: [
7277
+ t20,
7278
+ t21
7279
+ ] }), $[60] = padding, $[61] = t20, $[62] = t21, $[63] = t22) : t22 = $[63], t15 = t22;
7280
+ const content = t15;
7281
+ if (href) {
7282
+ const t232 = selected ? "" : void 0;
7283
+ let t242;
7284
+ $[64] !== tree.level || $[65] !== expanded || $[66] !== linkAs || $[67] !== href || $[68] !== treeitemRef || $[69] !== tabIndex || $[70] !== content ? (t242 = /* @__PURE__ */ jsx(TreeItemBox, { $level: tree.level, "aria-expanded": expanded, as: linkAs, "data-ui": "TreeItem__box", href, ref: treeitemRef, role: "treeitem", tabIndex, children: content }), $[64] = tree.level, $[65] = expanded, $[66] = linkAs, $[67] = href, $[68] = treeitemRef, $[69] = tabIndex, $[70] = content, $[71] = t242) : t242 = $[71];
7285
+ let t252;
7286
+ $[72] !== children || $[73] !== expanded ? (t252 = children && /* @__PURE__ */ jsx(TreeGroup, { hidden: !expanded, children }), $[72] = children, $[73] = expanded, $[74] = t252) : t252 = $[74];
7287
+ let t262;
7288
+ $[75] !== contextValue || $[76] !== t252 ? (t262 = /* @__PURE__ */ jsx(TreeContext.Provider, { value: contextValue, children: t252 }), $[75] = contextValue, $[76] = t252, $[77] = t262) : t262 = $[77];
7289
+ let t272;
7290
+ return $[78] !== t232 || $[79] !== id || $[80] !== itemKey || $[81] !== restProps || $[82] !== handleClick || $[83] !== rootRef || $[84] !== t242 || $[85] !== t262 ? (t272 = /* @__PURE__ */ jsxs(Root, { "data-selected": t232, "data-tree-id": id, "data-tree-key": itemKey, "data-ui": "TreeItem", ...restProps, onClick: handleClick, ref: rootRef, role: "none", children: [
7291
+ t242,
7292
+ t262
7293
+ ] }), $[78] = t232, $[79] = id, $[80] = itemKey, $[81] = restProps, $[82] = handleClick, $[83] = rootRef, $[84] = t242, $[85] = t262, $[86] = t272) : t272 = $[86], t272;
7294
+ }
7295
+ const t23 = selected ? "" : void 0;
7296
+ let t24;
7297
+ $[87] !== tree.level || $[88] !== content ? (t24 = /* @__PURE__ */ jsx(TreeItemBox, { $level: tree.level, as: "div", "data-ui": "TreeItem__box", children: content }), $[87] = tree.level, $[88] = content, $[89] = t24) : t24 = $[89];
7298
+ let t25;
7299
+ $[90] !== children || $[91] !== expanded ? (t25 = children && /* @__PURE__ */ jsx(TreeGroup, { expanded, children }), $[90] = children, $[91] = expanded, $[92] = t25) : t25 = $[92];
7300
+ let t26;
7301
+ $[93] !== contextValue || $[94] !== t25 ? (t26 = /* @__PURE__ */ jsx(TreeContext.Provider, { value: contextValue, children: t25 }), $[93] = contextValue, $[94] = t25, $[95] = t26) : t26 = $[95];
7302
+ let t27;
7303
+ return $[96] !== t23 || $[97] !== id || $[98] !== itemKey || $[99] !== restProps || $[100] !== expanded || $[101] !== handleClick || $[102] !== handleKeyDown || $[103] !== rootRef || $[104] !== tabIndex || $[105] !== t24 || $[106] !== t26 ? (t27 = /* @__PURE__ */ jsxs(Root, { "data-selected": t23, "data-ui": "TreeItem", "data-tree-id": id, "data-tree-key": itemKey, ...restProps, "aria-expanded": expanded, onClick: handleClick, onKeyDown: handleKeyDown, ref: rootRef, role: "treeitem", tabIndex, children: [
7304
+ t24,
7305
+ t26
7306
+ ] }), $[96] = t23, $[97] = id, $[98] = itemKey, $[99] = restProps, $[100] = expanded, $[101] = handleClick, $[102] = handleKeyDown, $[103] = rootRef, $[104] = tabIndex, $[105] = t24, $[106] = t26, $[107] = t27) : t27 = $[107], t27;
6948
7307
  });
6949
7308
  export {
6950
7309
  Arrow,