@sanity/ui 2.8.19 → 2.8.21

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.
package/dist/index.js CHANGED
@@ -148,13 +148,11 @@ function responsiveTextFont(props) {
148
148
  return responsiveFont("text", props);
149
149
  }
150
150
  function useArrayProp(val, defaultVal) {
151
- const __perf_hash__ = react.useMemo(() => JSON.stringify(val ?? defaultVal), [defaultVal, val]);
152
- return react.useMemo(
153
- () => _getArrayProp(val, defaultVal),
154
- // Improve performance: Keep object identify for a given hash of the value
155
- // eslint-disable-next-line react-hooks/exhaustive-deps
156
- [__perf_hash__]
157
- );
151
+ const $ = reactCompilerRuntime.c(3);
152
+ let t0;
153
+ $[0] !== val || $[1] !== defaultVal ? (t0 = () => [_getArrayProp(val, defaultVal), JSON.stringify(val ?? defaultVal)], $[0] = val, $[1] = defaultVal, $[2] = t0) : t0 = $[2];
154
+ const [t1, setCache] = react.useState(t0), [cachedVal, cachedHash] = t1, hash = JSON.stringify(val ?? defaultVal);
155
+ return hash !== cachedHash && setCache([_getArrayProp(val, defaultVal), hash]), cachedVal;
158
156
  }
159
157
  function _getElements(element, elementsArg) {
160
158
  const ret = [element];
@@ -1780,19 +1778,26 @@ function responsiveAvatarStackSizeStyle(props) {
1780
1778
  });
1781
1779
  }
1782
1780
  const Root$z = styledComponents.styled.div(responsiveAvatarStackSizeStyle, avatarStackStyle), AvatarStack = react.forwardRef(function(props, ref) {
1783
- const {
1781
+ const $ = reactCompilerRuntime.c(15);
1782
+ let t0, t1, childrenProp, restProps;
1783
+ $[0] !== props ? ({
1784
1784
  children: childrenProp,
1785
- maxLength: maxLengthProp = 4,
1786
- size: sizeProp = 1,
1785
+ maxLength: t0,
1786
+ size: t1,
1787
1787
  ...restProps
1788
- } = props, children = react.useMemo(() => react.Children.toArray(childrenProp).filter(react.isValidElement), [childrenProp]), maxLength = Math.max(maxLengthProp, 0), size2 = useArrayProp(sizeProp), len = children.length, visibleCount = maxLength - 1, extraCount = len - visibleCount, visibleChildren = extraCount > 1 ? children.slice(extraCount, len) : children;
1789
- return /* @__PURE__ */ jsxRuntime.jsxs(Root$z, { "data-ui": "AvatarStack", ...restProps, ref, $size: size2, children: [
1790
- len === 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx(AvatarCounter, { count: len, size: size2 }) }),
1791
- len !== 0 && extraCount > 1 && /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx(AvatarCounter, { count: extraCount, size: size2 }) }),
1792
- visibleChildren.map((child, childIndex) => /* @__PURE__ */ jsxRuntime.jsx("div", { children: react.cloneElement(child, {
1793
- size: size2
1794
- }) }, String(childIndex)))
1795
- ] });
1788
+ } = props, $[0] = props, $[1] = t0, $[2] = t1, $[3] = childrenProp, $[4] = restProps) : (t0 = $[1], t1 = $[2], childrenProp = $[3], restProps = $[4]);
1789
+ const maxLengthProp = t0 === void 0 ? 4 : t0, sizeProp = t1 === void 0 ? 1 : t1, children = react.Children.toArray(childrenProp).filter(react.isValidElement), maxLength = Math.max(maxLengthProp, 0), size2 = useArrayProp(sizeProp), len = children.length, visibleCount = maxLength - 1, extraCount = len - visibleCount, visibleChildren = extraCount > 1 ? children.slice(extraCount, len) : children, T0 = Root$z, t2 = "AvatarStack", t3 = len === 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx(AvatarCounter, { count: len, size: size2 }) }), t4 = len !== 0 && extraCount > 1 && /* @__PURE__ */ jsxRuntime.jsx("div", { children: /* @__PURE__ */ jsxRuntime.jsx(AvatarCounter, { count: extraCount, size: size2 }) });
1790
+ let t5;
1791
+ $[5] !== size2 ? (t5 = (child, childIndex) => /* @__PURE__ */ jsxRuntime.jsx("div", { children: react.cloneElement(child, {
1792
+ size: size2
1793
+ }) }, String(childIndex)), $[5] = size2, $[6] = t5) : t5 = $[6];
1794
+ const t6 = visibleChildren.map(t5);
1795
+ let t7;
1796
+ return $[7] !== T0 || $[8] !== restProps || $[9] !== ref || $[10] !== size2 || $[11] !== t3 || $[12] !== t4 || $[13] !== t6 ? (t7 = /* @__PURE__ */ jsxRuntime.jsxs(T0, { "data-ui": t2, ...restProps, ref, $size: size2, children: [
1797
+ t3,
1798
+ t4,
1799
+ t6
1800
+ ] }), $[7] = T0, $[8] = restProps, $[9] = ref, $[10] = size2, $[11] = t3, $[12] = t4, $[13] = t6, $[14] = t7) : t7 = $[14], t7;
1796
1801
  });
1797
1802
  AvatarStack.displayName = "ForwardRef(AvatarStack)";
1798
1803
  const Root$y = styledComponents.styled.div(boxStyle, flexItemStyle, responsiveBoxStyle, responsiveGridItemStyle, responsiveMarginStyle, responsivePaddingStyle), Box = react.forwardRef(function(props, ref) {
@@ -3211,16 +3216,37 @@ function findMinBreakpoints(media, width) {
3211
3216
  return ret;
3212
3217
  }
3213
3218
  const ElementQuery = react.forwardRef(function(props, forwardedRef) {
3214
- const theme2 = useTheme_v2(), {
3219
+ const $ = reactCompilerRuntime.c(18), theme2 = useTheme_v2();
3220
+ let _media, restProps, children;
3221
+ $[0] !== props ? ({
3215
3222
  children,
3216
- media = theme2.media,
3223
+ media: _media,
3217
3224
  ...restProps
3218
- } = props, ref = react.useRef(null), [element, setElement] = react.useState(null), elementSize = useElementSize(element), width = react.useMemo(() => elementSize?.border.width ?? window.innerWidth, [elementSize]), max = react.useMemo(() => findMaxBreakpoints(media, width), [media, width]), min = react.useMemo(() => findMinBreakpoints(media, width), [media, width]);
3219
- react.useImperativeHandle(forwardedRef, () => ref.current);
3220
- const setRef = react.useCallback((el) => {
3221
- ref.current = el, setElement(el);
3222
- }, []);
3223
- return /* @__PURE__ */ jsxRuntime.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 });
3225
+ } = props, $[0] = props, $[1] = _media, $[2] = restProps, $[3] = children) : (_media = $[1], restProps = $[2], children = $[3]);
3226
+ const media = _media ?? theme2.media, [element, setElement] = react.useState(null), elementSize = useElementSize(element);
3227
+ let t0;
3228
+ t0 = elementSize?.border.width ?? window.innerWidth;
3229
+ const width = t0;
3230
+ let t1, t2;
3231
+ if ($[4] !== media || $[5] !== width) {
3232
+ const eq = findMaxBreakpoints(media, width);
3233
+ t2 = eq.length ? eq.join(" ") : void 0, $[4] = media, $[5] = width, $[6] = t2;
3234
+ } else
3235
+ t2 = $[6];
3236
+ t1 = t2;
3237
+ const max = t1;
3238
+ let t3, t4;
3239
+ if ($[7] !== media || $[8] !== width) {
3240
+ const eq_0 = findMinBreakpoints(media, width);
3241
+ t4 = eq_0.length ? eq_0.join(" ") : void 0, $[7] = media, $[8] = width, $[9] = t4;
3242
+ } else
3243
+ t4 = $[9];
3244
+ t3 = t4;
3245
+ const min = t3;
3246
+ let t5, t6;
3247
+ $[10] !== element ? (t5 = () => element, t6 = [element], $[10] = element, $[11] = t5, $[12] = t6) : (t5 = $[11], t6 = $[12]), react.useImperativeHandle(forwardedRef, t5, t6);
3248
+ let t7;
3249
+ return $[13] !== restProps || $[14] !== max || $[15] !== min || $[16] !== children ? (t7 = /* @__PURE__ */ jsxRuntime.jsx("div", { "data-ui": "ElementQuery", ...restProps, "data-eq-max": max, "data-eq-min": min, ref: setElement, children }), $[13] = restProps, $[14] = max, $[15] = min, $[16] = children, $[17] = t7) : t7 = $[17], t7;
3224
3250
  });
3225
3251
  ElementQuery.displayName = "ForwardRef(ElementQuery)";
3226
3252
  class ErrorBoundary extends react.Component {
@@ -3347,10 +3373,18 @@ function _isScrollable(el) {
3347
3373
  return style.overflowX.includes("auto") || style.overflowX.includes("scroll") || style.overflowY.includes("auto") || style.overflowY.includes("scroll");
3348
3374
  }
3349
3375
  function LayerProvider(props) {
3350
- const {
3376
+ const $ = reactCompilerRuntime.c(19), {
3351
3377
  children,
3352
- zOffset: zOffsetProp = 0
3353
- } = props, parentContextValue = react.useContext(LayerContext), parent = parentContextValue && getLayerContext(parentContextValue), parentRegisterChild = parent?.registerChild, level = (parent?.level ?? 0) + 1, zOffset = useArrayProp(zOffsetProp), maxMediaIndex = zOffset.length - 1, mediaIndex = Math.min(useMediaIndex(), maxMediaIndex), zIndex = parent ? parent.zIndex + zOffset[mediaIndex] : zOffset[mediaIndex], [, setChildLayers] = react.useState({}), [size2, setSize] = react.useState(0), isTopLayer = size2 === 0, registerChild = react.useCallback((childLevel) => {
3378
+ zOffset: t0
3379
+ } = props, zOffsetProp = t0 === void 0 ? 0 : t0, parentContextValue = react.useContext(LayerContext);
3380
+ let t1;
3381
+ $[0] !== parentContextValue ? (t1 = parentContextValue && getLayerContext(parentContextValue), $[0] = parentContextValue, $[1] = t1) : t1 = $[1];
3382
+ const parent = t1, parentRegisterChild = parent?.registerChild, level = (parent?.level ?? 0) + 1, zOffset = useArrayProp(zOffsetProp), maxMediaIndex = zOffset.length - 1, mediaIndex = Math.min(useMediaIndex(), maxMediaIndex), zIndex = parent ? parent.zIndex + zOffset[mediaIndex] : zOffset[mediaIndex];
3383
+ let t2;
3384
+ $[2] === Symbol.for("react.memo_cache_sentinel") ? (t2 = {}, $[2] = t2) : t2 = $[2];
3385
+ const [, setChildLayers] = react.useState(t2), [size2, setSize] = react.useState(0), isTopLayer = size2 === 0;
3386
+ let t3;
3387
+ $[3] !== parentRegisterChild || $[4] !== setChildLayers ? (t3 = (childLevel) => {
3354
3388
  const parentDispose = parentRegisterChild?.(childLevel);
3355
3389
  return childLevel !== void 0 ? setChildLayers((state) => {
3356
3390
  const prevLen = state[childLevel] ?? 0, nextState = {
@@ -3363,20 +3397,25 @@ function LayerProvider(props) {
3363
3397
  const nextState_0 = {
3364
3398
  ...state_0
3365
3399
  };
3366
- return nextState_0[childLevel] === 1 ? (delete nextState_0[childLevel], setSize(Object.keys(nextState_0).length)) : nextState_0[childLevel] -= 1, nextState_0;
3400
+ return nextState_0[childLevel] === 1 ? (delete nextState_0[childLevel], setSize(Object.keys(nextState_0).length)) : nextState_0[childLevel] = nextState_0[childLevel] - 1, nextState_0;
3367
3401
  }) : setSize((v_0) => v_0 - 1), parentDispose?.();
3368
3402
  };
3369
- }, [parentRegisterChild]);
3370
- react.useEffect(() => parentRegisterChild?.(level), [level, parentRegisterChild]);
3371
- const value = react.useMemo(() => ({
3403
+ }, $[3] = parentRegisterChild, $[4] = setChildLayers, $[5] = t3) : t3 = $[5];
3404
+ const registerChild = t3;
3405
+ let t4, t5;
3406
+ $[6] !== parentRegisterChild || $[7] !== level ? (t4 = () => parentRegisterChild?.(level), t5 = [level, parentRegisterChild], $[6] = parentRegisterChild, $[7] = level, $[8] = t4, $[9] = t5) : (t4 = $[8], t5 = $[9]), react.useEffect(t4, t5);
3407
+ let t6, t7;
3408
+ $[10] !== isTopLayer || $[11] !== level || $[12] !== registerChild || $[13] !== size2 || $[14] !== zIndex ? (t7 = {
3372
3409
  version: 0,
3373
3410
  isTopLayer,
3374
3411
  level,
3375
3412
  registerChild,
3376
3413
  size: size2,
3377
3414
  zIndex
3378
- }), [isTopLayer, level, registerChild, size2, zIndex]);
3379
- return /* @__PURE__ */ jsxRuntime.jsx(LayerContext.Provider, { value, children });
3415
+ }, $[10] = isTopLayer, $[11] = level, $[12] = registerChild, $[13] = size2, $[14] = zIndex, $[15] = t7) : t7 = $[15], t6 = t7;
3416
+ const value = t6;
3417
+ let t8;
3418
+ return $[16] !== value || $[17] !== children ? (t8 = /* @__PURE__ */ jsxRuntime.jsx(LayerContext.Provider, { value, children }), $[16] = value, $[17] = children, $[18] = t8) : t8 = $[18], t8;
3380
3419
  }
3381
3420
  LayerProvider.displayName = "LayerProvider";
3382
3421
  const Root$j = styledComponents.styled.div({
@@ -4980,15 +5019,17 @@ function autocompleteReducer(state, msg2) {
4980
5019
  } : state;
4981
5020
  }
4982
5021
  const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "Home", "End", "PageUp", "PageDown", "Meta", "Tab", "CapsLock"], AUTOCOMPLETE_POPOVER_PLACEMENT = "bottom-start", AUTOCOMPLETE_POPOVER_FALLBACK_PLACEMENTS = ["bottom-start", "top-start"], DEFAULT_RENDER_VALUE = (value, option) => option ? option.value : value, DEFAULT_FILTER_OPTION = (query, option) => option.value.toLowerCase().indexOf(query.toLowerCase()) > -1, InnerAutocomplete = react.forwardRef(function(props, forwardedRef) {
4983
- const {
4984
- border: border2 = !0,
5022
+ const $ = reactCompilerRuntime.c(187);
5023
+ let t0, t1, t2, t3, t4, t5, t6, valueProp, renderOptionProp, filterOptionProp, id, optionsProp, loading, onBlur, onQueryChange, relatedElements, onSelect, onChange, onFocus, openOnFocus, disabled, openButton, readOnly, suffix, restProps, customValidity, icon, prefix, renderPopover;
5024
+ $[0] !== props ? ({
5025
+ border: t0,
4985
5026
  customValidity,
4986
5027
  disabled,
4987
5028
  filterOption: filterOptionProp,
4988
- fontSize: fontSize2 = 2,
5029
+ fontSize: t1,
4989
5030
  icon,
4990
5031
  id,
4991
- listBox = EMPTY_RECORD,
5032
+ listBox: t2,
4992
5033
  loading,
4993
5034
  onBlur,
4994
5035
  onChange,
@@ -4998,39 +5039,63 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "H
4998
5039
  openButton,
4999
5040
  openOnFocus,
5000
5041
  options: optionsProp,
5001
- padding: paddingProp = 3,
5002
- popover = EMPTY_RECORD,
5042
+ padding: t3,
5043
+ popover: t4,
5003
5044
  prefix,
5004
- radius = 2,
5045
+ radius: t5,
5005
5046
  readOnly,
5006
5047
  relatedElements,
5007
5048
  renderOption: renderOptionProp,
5008
5049
  renderPopover,
5009
- renderValue = DEFAULT_RENDER_VALUE,
5050
+ renderValue: t6,
5010
5051
  suffix,
5011
5052
  value: valueProp,
5012
5053
  ...restProps
5013
- } = props, [state, dispatch] = react.useReducer(autocompleteReducer, {
5014
- activeValue: valueProp || null,
5054
+ } = props, $[0] = props, $[1] = t0, $[2] = t1, $[3] = t2, $[4] = t3, $[5] = t4, $[6] = t5, $[7] = t6, $[8] = valueProp, $[9] = renderOptionProp, $[10] = filterOptionProp, $[11] = id, $[12] = optionsProp, $[13] = loading, $[14] = onBlur, $[15] = onQueryChange, $[16] = relatedElements, $[17] = onSelect, $[18] = onChange, $[19] = onFocus, $[20] = openOnFocus, $[21] = disabled, $[22] = openButton, $[23] = readOnly, $[24] = suffix, $[25] = restProps, $[26] = customValidity, $[27] = icon, $[28] = prefix, $[29] = renderPopover) : (t0 = $[1], t1 = $[2], t2 = $[3], t3 = $[4], t4 = $[5], t5 = $[6], t6 = $[7], valueProp = $[8], renderOptionProp = $[9], filterOptionProp = $[10], id = $[11], optionsProp = $[12], loading = $[13], onBlur = $[14], onQueryChange = $[15], relatedElements = $[16], onSelect = $[17], onChange = $[18], onFocus = $[19], openOnFocus = $[20], disabled = $[21], openButton = $[22], readOnly = $[23], suffix = $[24], restProps = $[25], customValidity = $[26], icon = $[27], prefix = $[28], renderPopover = $[29]);
5055
+ const border2 = t0 === void 0 ? !0 : t0, fontSize2 = t1 === void 0 ? 2 : t1, listBox = t2 === void 0 ? EMPTY_RECORD : t2, paddingProp = t3 === void 0 ? 3 : t3, popover = t4 === void 0 ? EMPTY_RECORD : t4, radius = t5 === void 0 ? 2 : t5, renderValue = t6 === void 0 ? DEFAULT_RENDER_VALUE : t6, t7 = valueProp || null, t8 = valueProp || null;
5056
+ let t9;
5057
+ $[30] !== t7 || $[31] !== t8 ? (t9 = {
5058
+ activeValue: t7,
5015
5059
  focused: !1,
5016
5060
  listFocused: !1,
5017
5061
  query: null,
5018
- value: valueProp || null
5019
- }), {
5062
+ value: t8
5063
+ }, $[30] = t7, $[31] = t8, $[32] = t9) : t9 = $[32];
5064
+ const [state, dispatch] = react.useReducer(autocompleteReducer, t9), {
5020
5065
  activeValue,
5021
5066
  focused,
5022
5067
  listFocused,
5023
5068
  query,
5024
5069
  value
5025
- } = state, defaultRenderOption = react.useCallback(({
5026
- value: value_0
5027
- }) => /* @__PURE__ */ jsxRuntime.jsx(Card, { "data-as": "button", padding: paddingProp, radius: 2, tone: "inherit", children: /* @__PURE__ */ jsxRuntime.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 = react.useRef(null), resultsPopoverElementRef = react.useRef(null), inputElementRef = react.useRef(null), listBoxElementRef = react.useRef(null), listFocusedRef = react.useRef(!1), valueRef = react.useRef(value), valuePropRef = react.useRef(valueProp), popoverMouseWithinRef = react.useRef(!1);
5028
- react.useImperativeHandle(forwardedRef, () => inputElementRef.current);
5029
- const listBoxId = `${id}-listbox`, options = Array.isArray(optionsProp) ? optionsProp : EMPTY_ARRAY, padding = useArrayProp(paddingProp), currentOption = react.useMemo(() => value !== null ? options.find((o) => o.value === value) : void 0, [options, value]), filteredOptions = react.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 = react.useCallback((event) => {
5070
+ } = state;
5071
+ let t10;
5072
+ $[33] !== paddingProp || $[34] !== fontSize2 ? (t10 = (t112) => {
5073
+ const {
5074
+ value: value_0
5075
+ } = t112;
5076
+ return /* @__PURE__ */ jsxRuntime.jsx(Card, { "data-as": "button", padding: paddingProp, radius: 2, tone: "inherit", children: /* @__PURE__ */ jsxRuntime.jsx(Text, { size: fontSize2, textOverflow: "ellipsis", children: value_0 }) });
5077
+ }, $[33] = paddingProp, $[34] = fontSize2, $[35] = t10) : t10 = $[35];
5078
+ const renderOption = typeof renderOptionProp == "function" ? renderOptionProp : t10, filterOption = typeof filterOptionProp == "function" ? filterOptionProp : DEFAULT_FILTER_OPTION, [rootElement, setRootElement] = react.useState(null), [resultsPopoverElement, setResultsPopoverElement] = react.useState(null), [inputElement, setInputElement] = react.useState(null), listBoxElementRef = react.useRef(null), listFocusedRef = react.useRef(!1), valueRef = react.useRef(value), valuePropRef = react.useRef(valueProp), [popoverMouseWithin, setPopoverMouseWithin] = react.useState(!1);
5079
+ let t11, t12;
5080
+ $[36] !== inputElement ? (t11 = () => inputElement, t12 = [inputElement], $[36] = inputElement, $[37] = t11, $[38] = t12) : (t11 = $[37], t12 = $[38]), react.useImperativeHandle(forwardedRef, t11, t12);
5081
+ const listBoxId = `${id}-listbox`, options = Array.isArray(optionsProp) ? optionsProp : EMPTY_ARRAY, padding = useArrayProp(paddingProp);
5082
+ let t13, t14;
5083
+ $[39] !== value || $[40] !== options ? (t14 = value !== null ? options.find((o) => o.value === value) : void 0, $[39] = value, $[40] = options, $[41] = t14) : t14 = $[41], t13 = t14;
5084
+ const currentOption = t13;
5085
+ let t15, t16;
5086
+ if ($[42] !== query || $[43] !== filterOption || $[44] !== options) {
5087
+ let t172;
5088
+ $[46] !== query || $[47] !== filterOption ? (t172 = (option) => query ? filterOption(query, option) : !0, $[46] = query, $[47] = filterOption, $[48] = t172) : t172 = $[48], t16 = options.filter(t172), $[42] = query, $[43] = filterOption, $[44] = options, $[45] = t16;
5089
+ } else
5090
+ t16 = $[45];
5091
+ t15 = t16;
5092
+ const filteredOptions = t15, filteredOptionsLen = filteredOptions.length, activeItemId = activeValue ? `${id}-option-${activeValue}` : void 0, expanded = query !== null && loading || focused && query !== null;
5093
+ let t17;
5094
+ $[49] !== popoverMouseWithin || $[50] !== relatedElements || $[51] !== rootElement || $[52] !== resultsPopoverElement || $[53] !== onQueryChange || $[54] !== onBlur ? (t17 = (event) => {
5030
5095
  setTimeout(() => {
5031
- if (popoverMouseWithinRef.current)
5096
+ if (popoverMouseWithin)
5032
5097
  return;
5033
- const elements = (relatedElements || []).concat(rootElementRef.current ? [rootElementRef.current] : [], resultsPopoverElementRef.current ? [resultsPopoverElementRef.current] : []);
5098
+ const elements = (relatedElements || []).concat(rootElement ? [rootElement] : [], resultsPopoverElement ? [resultsPopoverElement] : []);
5034
5099
  let focusInside = !1;
5035
5100
  if (document.activeElement) {
5036
5101
  for (const e of elements)
@@ -5041,22 +5106,32 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "H
5041
5106
  }
5042
5107
  focusInside === !1 && (dispatch({
5043
5108
  type: "root/blur"
5044
- }), popoverMouseWithinRef.current = !1, onQueryChange && onQueryChange(null), onBlur && onBlur(event));
5109
+ }), setPopoverMouseWithin(!1), onQueryChange && onQueryChange(null), onBlur && onBlur(event));
5045
5110
  }, 0);
5046
- }, [onBlur, onQueryChange, relatedElements]), handleRootFocus = react.useCallback((event_0) => {
5111
+ }, $[49] = popoverMouseWithin, $[50] = relatedElements, $[51] = rootElement, $[52] = resultsPopoverElement, $[53] = onQueryChange, $[54] = onBlur, $[55] = t17) : t17 = $[55];
5112
+ const handleRootBlur = t17;
5113
+ let t18;
5114
+ $[56] === Symbol.for("react.memo_cache_sentinel") ? (t18 = (event_0) => {
5047
5115
  const listBoxElement = listBoxElementRef.current, focusedElement = event_0.target instanceof HTMLElement ? event_0.target : null, listFocused_0 = listBoxElement?.contains(focusedElement) || !1;
5048
5116
  listFocused_0 !== listFocusedRef.current && (listFocusedRef.current = listFocused_0, dispatch({
5049
5117
  type: "root/setListFocused",
5050
5118
  listFocused: listFocused_0
5051
5119
  }));
5052
- }, []), handleOptionSelect = react.useCallback((v) => {
5120
+ }, $[56] = t18) : t18 = $[56];
5121
+ const handleRootFocus = t18;
5122
+ let t19;
5123
+ $[57] !== onSelect || $[58] !== onChange || $[59] !== onQueryChange || $[60] !== inputElement ? (t19 = (v) => {
5053
5124
  dispatch({
5054
5125
  type: "value/change",
5055
5126
  value: v
5056
- }), popoverMouseWithinRef.current = !1, onSelect && onSelect(v), valueRef.current = v, onChange && onChange(v), onQueryChange && onQueryChange(null), inputElementRef.current?.focus();
5057
- }, [onChange, onSelect, onQueryChange]), handleRootKeyDown = react.useCallback((event_1) => {
5127
+ }), setPopoverMouseWithin(!1), onSelect && onSelect(v), valueRef.current = v, onChange && onChange(v), onQueryChange && onQueryChange(null), inputElement?.focus();
5128
+ }, $[57] = onSelect, $[58] = onChange, $[59] = onQueryChange, $[60] = inputElement, $[61] = t19) : t19 = $[61];
5129
+ const handleOptionSelect = t19;
5130
+ let t20;
5131
+ $[62] !== filteredOptionsLen || $[63] !== filteredOptions || $[64] !== activeValue || $[65] !== onQueryChange || $[66] !== inputElement ? (t20 = (event_1) => {
5058
5132
  if (event_1.key === "ArrowDown") {
5059
- if (event_1.preventDefault(), !filteredOptionsLen) return;
5133
+ if (event_1.preventDefault(), !filteredOptionsLen)
5134
+ return;
5060
5135
  const activeOption = filteredOptions.find((o_0) => o_0.value === activeValue), activeIndex = activeOption ? filteredOptions.indexOf(activeOption) : -1, nextActiveOption = filteredOptions[(activeIndex + 1) % filteredOptionsLen];
5061
5136
  nextActiveOption && dispatch({
5062
5137
  type: "root/setActiveValue",
@@ -5066,7 +5141,8 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "H
5066
5141
  return;
5067
5142
  }
5068
5143
  if (event_1.key === "ArrowUp") {
5069
- if (event_1.preventDefault(), !filteredOptionsLen) return;
5144
+ if (event_1.preventDefault(), !filteredOptionsLen)
5145
+ return;
5070
5146
  const activeOption_0 = filteredOptions.find((o_1) => o_1.value === activeValue), activeIndex_0 = activeOption_0 ? filteredOptions.indexOf(activeOption_0) : -1, nextActiveOption_0 = filteredOptions[activeIndex_0 === -1 ? filteredOptionsLen - 1 : (filteredOptionsLen + activeIndex_0 - 1) % filteredOptionsLen];
5071
5147
  nextActiveOption_0 && dispatch({
5072
5148
  type: "root/setActiveValue",
@@ -5078,43 +5154,66 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "H
5078
5154
  if (event_1.key === "Escape") {
5079
5155
  dispatch({
5080
5156
  type: "root/escape"
5081
- }), popoverMouseWithinRef.current = !1, onQueryChange && onQueryChange(null), inputElementRef.current?.focus();
5157
+ }), setPopoverMouseWithin(!1), onQueryChange && onQueryChange(null), inputElement?.focus();
5082
5158
  return;
5083
5159
  }
5084
5160
  const target = event_1.target, listEl = listBoxElementRef.current;
5085
5161
  if ((listEl === target || listEl?.contains(target)) && !AUTOCOMPLETE_LISTBOX_IGNORE_KEYS.includes(event_1.key)) {
5086
- inputElementRef.current?.focus();
5162
+ inputElement?.focus();
5087
5163
  return;
5088
5164
  }
5089
- }, [activeValue, filteredOptions, filteredOptionsLen, onQueryChange]), handleInputChange = react.useCallback((event_2) => {
5165
+ }, $[62] = filteredOptionsLen, $[63] = filteredOptions, $[64] = activeValue, $[65] = onQueryChange, $[66] = inputElement, $[67] = t20) : t20 = $[67];
5166
+ const handleRootKeyDown = t20;
5167
+ let t21;
5168
+ $[68] !== onQueryChange ? (t21 = (event_2) => {
5090
5169
  const nextQuery = event_2.currentTarget.value;
5091
5170
  dispatch({
5092
5171
  type: "input/change",
5093
5172
  query: nextQuery
5094
5173
  }), onQueryChange && onQueryChange(nextQuery);
5095
- }, [onQueryChange]), dispatchOpen = react.useCallback(() => {
5174
+ }, $[68] = onQueryChange, $[69] = t21) : t21 = $[69];
5175
+ const handleInputChange = t21;
5176
+ let t22;
5177
+ $[70] !== value || $[71] !== renderValue || $[72] !== currentOption ? (t22 = () => {
5096
5178
  dispatch({
5097
5179
  type: "root/open",
5098
5180
  query: value ? renderValue(value, currentOption) : ""
5099
5181
  });
5100
- }, [currentOption, renderValue, value]), handleInputFocus = react.useCallback((event_3) => {
5182
+ }, $[70] = value, $[71] = renderValue, $[72] = currentOption, $[73] = t22) : t22 = $[73];
5183
+ const dispatchOpen = t22;
5184
+ let t23;
5185
+ $[74] !== focused || $[75] !== onFocus || $[76] !== openOnFocus || $[77] !== dispatchOpen ? (t23 = (event_3) => {
5101
5186
  focused || (dispatch({
5102
5187
  type: "input/focus"
5103
5188
  }), onFocus && onFocus(event_3), openOnFocus && dispatchOpen());
5104
- }, [focused, onFocus, openOnFocus, dispatchOpen]), handlePopoverMouseEnter = react.useCallback(() => {
5105
- popoverMouseWithinRef.current = !0;
5106
- }, []), handlePopoverMouseLeave = react.useCallback(() => {
5107
- popoverMouseWithinRef.current = !1;
5108
- }, []), handleClearButtonClick = react.useCallback(() => {
5189
+ }, $[74] = focused, $[75] = onFocus, $[76] = openOnFocus, $[77] = dispatchOpen, $[78] = t23) : t23 = $[78];
5190
+ const handleInputFocus = t23;
5191
+ let t24;
5192
+ $[79] === Symbol.for("react.memo_cache_sentinel") ? (t24 = () => {
5193
+ setPopoverMouseWithin(!0);
5194
+ }, $[79] = t24) : t24 = $[79];
5195
+ const handlePopoverMouseEnter = t24;
5196
+ let t25;
5197
+ $[80] === Symbol.for("react.memo_cache_sentinel") ? (t25 = () => {
5198
+ setPopoverMouseWithin(!1);
5199
+ }, $[80] = t25) : t25 = $[80];
5200
+ const handlePopoverMouseLeave = t25;
5201
+ let t26;
5202
+ $[81] !== onChange || $[82] !== onQueryChange || $[83] !== inputElement ? (t26 = () => {
5109
5203
  dispatch({
5110
5204
  type: "root/clear"
5111
- }), valueRef.current = "", onChange && onChange(""), onQueryChange && onQueryChange(null), inputElementRef.current?.focus();
5112
- }, [onChange, onQueryChange]), handleClearButtonFocus = react.useCallback(() => {
5205
+ }), valueRef.current = "", onChange && onChange(""), onQueryChange && onQueryChange(null), inputElement?.focus();
5206
+ }, $[81] = onChange, $[82] = onQueryChange, $[83] = inputElement, $[84] = t26) : t26 = $[84];
5207
+ const handleClearButtonClick = t26;
5208
+ let t27;
5209
+ $[85] === Symbol.for("react.memo_cache_sentinel") ? (t27 = () => {
5113
5210
  dispatch({
5114
5211
  type: "input/focus"
5115
5212
  });
5116
- }, []);
5117
- react.useEffect(() => {
5213
+ }, $[85] = t27) : t27 = $[85];
5214
+ const handleClearButtonFocus = t27;
5215
+ let t28, t29;
5216
+ $[86] !== valueProp ? (t28 = () => {
5118
5217
  if (valueProp !== valuePropRef.current) {
5119
5218
  valuePropRef.current = valueProp, valueProp !== void 0 && (dispatch({
5120
5219
  type: "value/change",
@@ -5126,14 +5225,19 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "H
5126
5225
  type: "value/change",
5127
5226
  value: valueProp || null
5128
5227
  }));
5129
- }, [valueProp]), react.useEffect(() => {
5228
+ }, t29 = [valueProp], $[86] = valueProp, $[87] = t28, $[88] = t29) : (t28 = $[87], t29 = $[88]), react.useEffect(t28, t29);
5229
+ let t30, t31;
5230
+ $[89] !== focused ? (t30 = () => {
5130
5231
  !focused && valueRef.current && dispatch({
5131
5232
  type: "root/setActiveValue",
5132
5233
  value: valueRef.current
5133
5234
  });
5134
- }, [focused]), react.useEffect(() => {
5235
+ }, t31 = [focused], $[89] = focused, $[90] = t30, $[91] = t31) : (t30 = $[90], t31 = $[91]), react.useEffect(t30, t31);
5236
+ let t32, t33;
5237
+ $[92] !== filteredOptions || $[93] !== activeValue ? (t32 = () => {
5135
5238
  const listElement = listBoxElementRef.current;
5136
- if (!listElement) return;
5239
+ if (!listElement)
5240
+ return;
5137
5241
  const activeOption_1 = filteredOptions.find((o_2) => o_2.value === activeValue);
5138
5242
  if (activeOption_1) {
5139
5243
  const activeIndex_1 = filteredOptions.indexOf(activeOption_1), activeItemElement = listElement.childNodes[activeIndex_1];
@@ -5143,35 +5247,123 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "H
5143
5247
  focusFirstDescendant(activeItemElement);
5144
5248
  }
5145
5249
  }
5146
- }, [activeValue, filteredOptions]);
5147
- const clearButton = react.useMemo(() => {
5148
- if (!loading && !disabled && value)
5149
- return {
5250
+ }, t33 = [activeValue, filteredOptions], $[92] = filteredOptions, $[93] = activeValue, $[94] = t32, $[95] = t33) : (t32 = $[94], t33 = $[95]), react.useEffect(t32, t33);
5251
+ let t34;
5252
+ bb0: {
5253
+ if (!loading && !disabled && value) {
5254
+ let t352;
5255
+ $[96] === Symbol.for("react.memo_cache_sentinel") ? (t352 = {
5150
5256
  "aria-label": "Clear",
5151
5257
  onFocus: handleClearButtonFocus
5152
- };
5153
- }, [disabled, handleClearButtonFocus, loading, value]), openButtonBoxPadding = react.useMemo(() => padding.map((v_0) => v_0 === 0 ? 0 : v_0 === 1 || v_0 === 2 ? 1 : v_0 - 2), [padding]), openButtonPadding = react.useMemo(() => padding.map((v_1) => Math.max(v_1 - 1, 0)), [padding]), openButtonProps = react.useMemo(() => typeof openButton == "object" ? openButton : EMPTY_RECORD, [openButton]), handleOpenClick = react.useCallback((event_4) => {
5154
- dispatchOpen(), openButtonProps.onClick && openButtonProps.onClick(event_4), _raf(() => inputElementRef.current?.focus());
5155
- }, [openButtonProps, dispatchOpen]), openButtonNode = react.useMemo(() => !disabled && !readOnly && openButton ? /* @__PURE__ */ jsxRuntime.jsx(Box, { "aria-hidden": expanded, padding: openButtonBoxPadding, children: /* @__PURE__ */ jsxRuntime.jsx(Button, { "aria-label": "Open", disabled: expanded, fontSize: fontSize2, icon: icons.ChevronDownIcon, mode: "bleed", padding: openButtonPadding, ...openButtonProps, onClick: handleOpenClick }) }) : void 0, [disabled, expanded, fontSize2, handleOpenClick, openButton, openButtonBoxPadding, openButtonPadding, openButtonProps, readOnly]), inputValue = react.useMemo(() => query === null ? value !== null ? renderValue(value, currentOption) : "" : query, [currentOption, query, renderValue, value]), input = /* @__PURE__ */ jsxRuntime.jsx(TextInput, { ...restProps, "aria-activedescendant": activeItemId, "aria-autocomplete": "list", "aria-expanded": expanded, "aria-owns": listBoxId, autoCapitalize: "off", autoComplete: "off", autoCorrect: "off", border: border2, clearButton, customValidity, disabled, fontSize: fontSize2, icon, iconRight: loading && AnimatedSpinnerIcon, id, inputMode: "search", onChange: handleInputChange, onClear: handleClearButtonClick, onFocus: handleInputFocus, padding, prefix, radius, readOnly, ref: inputElementRef, role: "combobox", spellCheck: !1, suffix: suffix || openButtonNode, value: inputValue }), handleListBoxKeyDown = react.useCallback((event_5) => {
5156
- event_5.key === "Tab" && listFocused && inputElementRef.current?.focus();
5157
- }, [listFocused]), content = react.useMemo(() => filteredOptions.length === 0 ? null : /* @__PURE__ */ jsxRuntime.jsx(ListBox, { "data-ui": "AutoComplete__results", onKeyDown: handleListBoxKeyDown, padding: 1, ...listBox, tabIndex: -1, children: /* @__PURE__ */ jsxRuntime.jsx(Stack, { as: "ul", "aria-multiselectable": !1, "data-ui": "AutoComplete__resultsList", id: listBoxId, ref: listBoxElementRef, role: "listbox", space: 1, children: filteredOptions.map((option_0) => {
5158
- const active = activeValue !== null ? option_0.value === activeValue : currentOption === option_0;
5159
- return /* @__PURE__ */ jsxRuntime.jsx(AutocompleteOption, { id: `${id}-option-${option_0.value}`, onSelect: handleOptionSelect, selected: active, value: option_0.value, children: react.cloneElement(renderOption(option_0), {
5160
- disabled: loading,
5161
- selected: active,
5162
- tabIndex: listFocused && active ? 0 : -1
5163
- }) }, option_0.value);
5164
- }) }) }), [activeValue, currentOption, filteredOptions, handleOptionSelect, handleListBoxKeyDown, id, listBox, listBoxId, listFocused, loading, renderOption]), results = react.useMemo(() => renderPopover ? renderPopover({
5165
- content,
5166
- hidden: !expanded,
5167
- inputElement: inputElementRef.current,
5168
- onMouseEnter: handlePopoverMouseEnter,
5169
- onMouseLeave: handlePopoverMouseLeave
5170
- }, resultsPopoverElementRef) : filteredOptionsLen === 0 ? null : /* @__PURE__ */ jsxRuntime.jsx(Popover, { arrow: !1, constrainSize: !0, content, fallbackPlacements: AUTOCOMPLETE_POPOVER_FALLBACK_PLACEMENTS, matchReferenceWidth: !0, onMouseEnter: handlePopoverMouseEnter, onMouseLeave: handlePopoverMouseLeave, open: expanded, overflow: "auto", placement: AUTOCOMPLETE_POPOVER_PLACEMENT, portal: !0, radius, ref: resultsPopoverElementRef, referenceElement: inputElementRef.current, ...popover }), [content, expanded, filteredOptionsLen, handlePopoverMouseEnter, handlePopoverMouseLeave, popover, radius, renderPopover]);
5171
- return /* @__PURE__ */ jsxRuntime.jsxs(Root$9, { "data-ui": "Autocomplete", onBlur: handleRootBlur, onFocus: handleRootFocus, onKeyDown: handleRootKeyDown, ref: rootElementRef, children: [
5258
+ }, $[96] = t352) : t352 = $[96], t34 = t352;
5259
+ break bb0;
5260
+ }
5261
+ t34 = void 0;
5262
+ }
5263
+ const clearButton = t34;
5264
+ let t35, t36;
5265
+ if ($[97] !== padding) {
5266
+ let t372;
5267
+ $[99] === Symbol.for("react.memo_cache_sentinel") ? (t372 = (v_0) => v_0 === 0 ? 0 : v_0 === 1 || v_0 === 2 ? 1 : v_0 - 2, $[99] = t372) : t372 = $[99], t36 = padding.map(t372), $[97] = padding, $[98] = t36;
5268
+ } else
5269
+ t36 = $[98];
5270
+ t35 = t36;
5271
+ const openButtonBoxPadding = t35;
5272
+ let t37, t38;
5273
+ if ($[100] !== padding) {
5274
+ let t392;
5275
+ $[102] === Symbol.for("react.memo_cache_sentinel") ? (t392 = (v_1) => Math.max(v_1 - 1, 0), $[102] = t392) : t392 = $[102], t38 = padding.map(t392), $[100] = padding, $[101] = t38;
5276
+ } else
5277
+ t38 = $[101];
5278
+ t37 = t38;
5279
+ const openButtonPadding = t37;
5280
+ let t39;
5281
+ t39 = typeof openButton == "object" ? openButton : EMPTY_RECORD;
5282
+ const openButtonProps = t39;
5283
+ let t40;
5284
+ $[103] !== dispatchOpen || $[104] !== openButtonProps || $[105] !== inputElement ? (t40 = (event_4) => {
5285
+ dispatchOpen(), openButtonProps.onClick && openButtonProps.onClick(event_4), _raf(() => inputElement?.focus());
5286
+ }, $[103] = dispatchOpen, $[104] = openButtonProps, $[105] = inputElement, $[106] = t40) : t40 = $[106];
5287
+ const handleOpenClick = t40;
5288
+ let t41, t42;
5289
+ $[107] !== disabled || $[108] !== readOnly || $[109] !== openButton || $[110] !== expanded || $[111] !== fontSize2 || $[112] !== openButtonPadding || $[113] !== openButtonProps || $[114] !== handleOpenClick || $[115] !== openButtonBoxPadding ? (t42 = !disabled && !readOnly && openButton ? /* @__PURE__ */ jsxRuntime.jsx(Box, { "aria-hidden": expanded, padding: openButtonBoxPadding, children: /* @__PURE__ */ jsxRuntime.jsx(Button, { "aria-label": "Open", disabled: expanded, fontSize: fontSize2, icon: icons.ChevronDownIcon, mode: "bleed", padding: openButtonPadding, ...openButtonProps, onClick: handleOpenClick }) }) : void 0, $[107] = disabled, $[108] = readOnly, $[109] = openButton, $[110] = expanded, $[111] = fontSize2, $[112] = openButtonPadding, $[113] = openButtonProps, $[114] = handleOpenClick, $[115] = openButtonBoxPadding, $[116] = t42) : t42 = $[116], t41 = t42;
5290
+ const openButtonNode = t41;
5291
+ let t43;
5292
+ bb1: {
5293
+ if (query === null) {
5294
+ if (value !== null) {
5295
+ let t442;
5296
+ $[117] !== renderValue || $[118] !== value || $[119] !== currentOption ? (t442 = renderValue(value, currentOption), $[117] = renderValue, $[118] = value, $[119] = currentOption, $[120] = t442) : t442 = $[120], t43 = t442;
5297
+ break bb1;
5298
+ }
5299
+ t43 = "";
5300
+ break bb1;
5301
+ }
5302
+ t43 = query;
5303
+ }
5304
+ const inputValue = t43, t44 = loading && AnimatedSpinnerIcon, t45 = suffix || openButtonNode;
5305
+ let t46;
5306
+ $[121] !== restProps || $[122] !== activeItemId || $[123] !== expanded || $[124] !== listBoxId || $[125] !== border2 || $[126] !== clearButton || $[127] !== customValidity || $[128] !== disabled || $[129] !== fontSize2 || $[130] !== icon || $[131] !== t44 || $[132] !== id || $[133] !== handleInputChange || $[134] !== handleClearButtonClick || $[135] !== handleInputFocus || $[136] !== padding || $[137] !== prefix || $[138] !== radius || $[139] !== readOnly || $[140] !== t45 || $[141] !== inputValue ? (t46 = /* @__PURE__ */ jsxRuntime.jsx(TextInput, { ...restProps, "aria-activedescendant": activeItemId, "aria-autocomplete": "list", "aria-expanded": expanded, "aria-owns": listBoxId, autoCapitalize: "off", autoComplete: "off", autoCorrect: "off", border: border2, clearButton, customValidity, disabled, fontSize: fontSize2, icon, iconRight: t44, id, inputMode: "search", onChange: handleInputChange, onClear: handleClearButtonClick, onFocus: handleInputFocus, padding, prefix, radius, readOnly, ref: setInputElement, role: "combobox", spellCheck: !1, suffix: t45, value: inputValue }), $[121] = restProps, $[122] = activeItemId, $[123] = expanded, $[124] = listBoxId, $[125] = border2, $[126] = clearButton, $[127] = customValidity, $[128] = disabled, $[129] = fontSize2, $[130] = icon, $[131] = t44, $[132] = id, $[133] = handleInputChange, $[134] = handleClearButtonClick, $[135] = handleInputFocus, $[136] = padding, $[137] = prefix, $[138] = radius, $[139] = readOnly, $[140] = t45, $[141] = inputValue, $[142] = t46) : t46 = $[142];
5307
+ const input = t46;
5308
+ let t47;
5309
+ $[143] !== listFocused || $[144] !== inputElement ? (t47 = (event_5) => {
5310
+ event_5.key === "Tab" && listFocused && inputElement?.focus();
5311
+ }, $[143] = listFocused, $[144] = inputElement, $[145] = t47) : t47 = $[145];
5312
+ const handleListBoxKeyDown = t47;
5313
+ let t48;
5314
+ bb2: {
5315
+ if (filteredOptions.length === 0) {
5316
+ t48 = null;
5317
+ break bb2;
5318
+ }
5319
+ let t492;
5320
+ if ($[146] !== activeValue || $[147] !== currentOption || $[148] !== id || $[149] !== handleOptionSelect || $[150] !== renderOption || $[151] !== loading || $[152] !== listFocused || $[153] !== filteredOptions) {
5321
+ let t503;
5322
+ $[155] !== activeValue || $[156] !== currentOption || $[157] !== id || $[158] !== handleOptionSelect || $[159] !== renderOption || $[160] !== loading || $[161] !== listFocused ? (t503 = (option_0) => {
5323
+ const active = activeValue !== null ? option_0.value === activeValue : currentOption === option_0;
5324
+ return /* @__PURE__ */ jsxRuntime.jsx(AutocompleteOption, { id: `${id}-option-${option_0.value}`, onSelect: handleOptionSelect, selected: active, value: option_0.value, children: react.cloneElement(renderOption(option_0), {
5325
+ disabled: loading,
5326
+ selected: active,
5327
+ tabIndex: listFocused && active ? 0 : -1
5328
+ }) }, option_0.value);
5329
+ }, $[155] = activeValue, $[156] = currentOption, $[157] = id, $[158] = handleOptionSelect, $[159] = renderOption, $[160] = loading, $[161] = listFocused, $[162] = t503) : t503 = $[162], t492 = filteredOptions.map(t503), $[146] = activeValue, $[147] = currentOption, $[148] = id, $[149] = handleOptionSelect, $[150] = renderOption, $[151] = loading, $[152] = listFocused, $[153] = filteredOptions, $[154] = t492;
5330
+ } else
5331
+ t492 = $[154];
5332
+ let t502;
5333
+ $[163] !== listBoxId || $[164] !== t492 ? (t502 = /* @__PURE__ */ jsxRuntime.jsx(Stack, { as: "ul", "aria-multiselectable": !1, "data-ui": "AutoComplete__resultsList", id: listBoxId, ref: listBoxElementRef, role: "listbox", space: 1, children: t492 }), $[163] = listBoxId, $[164] = t492, $[165] = t502) : t502 = $[165];
5334
+ let t51;
5335
+ $[166] !== handleListBoxKeyDown || $[167] !== listBox || $[168] !== t502 ? (t51 = /* @__PURE__ */ jsxRuntime.jsx(ListBox, { "data-ui": "AutoComplete__results", onKeyDown: handleListBoxKeyDown, padding: 1, ...listBox, tabIndex: -1, children: t502 }), $[166] = handleListBoxKeyDown, $[167] = listBox, $[168] = t502, $[169] = t51) : t51 = $[169], t48 = t51;
5336
+ }
5337
+ const content = t48;
5338
+ let t49;
5339
+ bb3: {
5340
+ if (renderPopover) {
5341
+ const t503 = !expanded;
5342
+ let t51;
5343
+ $[170] !== content || $[171] !== t503 || $[172] !== inputElement || $[173] !== resultsPopoverElement || $[174] !== renderPopover ? (t51 = renderPopover({
5344
+ content,
5345
+ hidden: t503,
5346
+ inputElement,
5347
+ onMouseEnter: handlePopoverMouseEnter,
5348
+ onMouseLeave: handlePopoverMouseLeave
5349
+ }, {
5350
+ current: resultsPopoverElement
5351
+ }), $[170] = content, $[171] = t503, $[172] = inputElement, $[173] = resultsPopoverElement, $[174] = renderPopover, $[175] = t51) : t51 = $[175], t49 = t51;
5352
+ break bb3;
5353
+ }
5354
+ if (filteredOptionsLen === 0) {
5355
+ t49 = null;
5356
+ break bb3;
5357
+ }
5358
+ let t502;
5359
+ $[176] !== content || $[177] !== expanded || $[178] !== radius || $[179] !== inputElement || $[180] !== popover ? (t502 = /* @__PURE__ */ jsxRuntime.jsx(Popover, { arrow: !1, constrainSize: !0, content, fallbackPlacements: AUTOCOMPLETE_POPOVER_FALLBACK_PLACEMENTS, matchReferenceWidth: !0, onMouseEnter: handlePopoverMouseEnter, onMouseLeave: handlePopoverMouseLeave, open: expanded, overflow: "auto", placement: AUTOCOMPLETE_POPOVER_PLACEMENT, portal: !0, radius, ref: setResultsPopoverElement, referenceElement: inputElement, ...popover }), $[176] = content, $[177] = expanded, $[178] = radius, $[179] = inputElement, $[180] = popover, $[181] = t502) : t502 = $[181], t49 = t502;
5360
+ }
5361
+ const results = t49;
5362
+ let t50;
5363
+ return $[182] !== handleRootBlur || $[183] !== handleRootKeyDown || $[184] !== input || $[185] !== results ? (t50 = /* @__PURE__ */ jsxRuntime.jsxs(Root$9, { "data-ui": "Autocomplete", onBlur: handleRootBlur, onFocus: handleRootFocus, onKeyDown: handleRootKeyDown, ref: setRootElement, children: [
5172
5364
  input,
5173
5365
  results
5174
- ] });
5366
+ ] }), $[182] = handleRootBlur, $[183] = handleRootKeyDown, $[184] = input, $[185] = results, $[186] = t50) : t50 = $[186], t50;
5175
5367
  });
5176
5368
  InnerAutocomplete.displayName = "ForwardRef(Autocomplete)";
5177
5369
  const Autocomplete = InnerAutocomplete, Root$8 = styledComponents.styled.ol`
@@ -5727,8 +5919,8 @@ const Root$5 = styledComponents.styled(Box)`
5727
5919
  });
5728
5920
  Menu.displayName = "ForwardRef(Menu)";
5729
5921
  const MenuButton = react.forwardRef(function(props, forwardedRef) {
5730
- const {
5731
- __unstable_disableRestoreFocusOnClose: disableRestoreFocusOnClose = !1,
5922
+ const $ = reactCompilerRuntime.c(62), {
5923
+ __unstable_disableRestoreFocusOnClose: t0,
5732
5924
  boundaryElement: deprecated_boundaryElement,
5733
5925
  button: buttonProp,
5734
5926
  id,
@@ -5737,23 +5929,38 @@ const MenuButton = react.forwardRef(function(props, forwardedRef) {
5737
5929
  onOpen,
5738
5930
  placement: deprecated_placement,
5739
5931
  popoverScheme: deprecated_popoverScheme,
5740
- portal: deprecated_portal = !0,
5932
+ portal: t1,
5741
5933
  popover,
5742
5934
  popoverRadius: deprecated_popoverRadius,
5743
5935
  preventOverflow: deprecated_preventOverflow
5744
- } = props, [open, setOpen] = react.useState(!1), [shouldFocus, setShouldFocus] = react.useState(null), [buttonElement, setButtonElement] = react.useState(null), [menuElements, setChildMenuElements] = react.useState([]), openRef = react.useRef(open);
5745
- react.useEffect(() => {
5936
+ } = props, disableRestoreFocusOnClose = t0 === void 0 ? !1 : t0, deprecated_portal = t1 === void 0 ? !0 : t1, [open, setOpen] = react.useState(!1), [shouldFocus, setShouldFocus] = react.useState(null), [buttonElement, setButtonElement] = react.useState(null);
5937
+ let t2;
5938
+ $[0] === Symbol.for("react.memo_cache_sentinel") ? (t2 = [], $[0] = t2) : t2 = $[0];
5939
+ const [menuElements, setChildMenuElements] = react.useState(t2), openRef = react.useRef(open);
5940
+ let t3, t4;
5941
+ $[1] !== onOpen || $[2] !== open ? (t3 = () => {
5746
5942
  onOpen && open && !openRef.current && onOpen();
5747
- }, [onOpen, open]), react.useEffect(() => {
5943
+ }, t4 = [onOpen, open], $[1] = onOpen, $[2] = open, $[3] = t3, $[4] = t4) : (t3 = $[3], t4 = $[4]), react.useEffect(t3, t4);
5944
+ let t5, t6;
5945
+ $[5] !== onClose || $[6] !== open ? (t5 = () => {
5748
5946
  onClose && !open && openRef.current && onClose();
5749
- }, [onClose, open]), react.useEffect(() => {
5947
+ }, t6 = [onClose, open], $[5] = onClose, $[6] = open, $[7] = t5, $[8] = t6) : (t5 = $[7], t6 = $[8]), react.useEffect(t5, t6);
5948
+ let t7, t8;
5949
+ $[9] !== open ? (t7 = () => {
5750
5950
  openRef.current = open;
5751
- }, [open]);
5752
- const handleButtonClick = react.useCallback(() => {
5951
+ }, t8 = [open], $[9] = open, $[10] = t7, $[11] = t8) : (t7 = $[10], t8 = $[11]), react.useEffect(t7, t8);
5952
+ let t9;
5953
+ $[12] === Symbol.for("react.memo_cache_sentinel") ? (t9 = () => {
5753
5954
  setOpen((v) => !v), setShouldFocus(null);
5754
- }, []), handleMouseDown = react.useCallback((event) => {
5955
+ }, $[12] = t9) : t9 = $[12];
5956
+ const handleButtonClick = t9;
5957
+ let t10;
5958
+ $[13] !== open ? (t10 = (event) => {
5755
5959
  open && event.preventDefault();
5756
- }, [open]), handleButtonKeyDown = react.useCallback((event_0) => {
5960
+ }, $[13] = open, $[14] = t10) : t10 = $[14];
5961
+ const handleMouseDown = t10;
5962
+ let t11;
5963
+ $[15] === Symbol.for("react.memo_cache_sentinel") ? (t11 = (event_0) => {
5757
5964
  if (event_0.key === "ArrowDown" || event_0.key === "Enter" || event_0.key === " ") {
5758
5965
  event_0.preventDefault(), setOpen(!0), setShouldFocus("first");
5759
5966
  return;
@@ -5762,7 +5969,10 @@ const MenuButton = react.forwardRef(function(props, forwardedRef) {
5762
5969
  event_0.preventDefault(), setOpen(!0), setShouldFocus("last");
5763
5970
  return;
5764
5971
  }
5765
- }, []), handleMenuClickOutside = react.useCallback((event_1) => {
5972
+ }, $[15] = t11) : t11 = $[15];
5973
+ const handleButtonKeyDown = t11;
5974
+ let t12;
5975
+ $[16] !== buttonElement || $[17] !== menuElements ? (t12 = (event_1) => {
5766
5976
  const target = event_1.target;
5767
5977
  if (target instanceof Node && !(buttonElement && (target === buttonElement || buttonElement.contains(target)))) {
5768
5978
  for (const el of menuElements)
@@ -5770,9 +5980,15 @@ const MenuButton = react.forwardRef(function(props, forwardedRef) {
5770
5980
  return;
5771
5981
  setOpen(!1);
5772
5982
  }
5773
- }, [buttonElement, menuElements]), handleMenuEscape = react.useCallback(() => {
5983
+ }, $[16] = buttonElement, $[17] = menuElements, $[18] = t12) : t12 = $[18];
5984
+ const handleMenuClickOutside = t12;
5985
+ let t13;
5986
+ $[19] !== disableRestoreFocusOnClose || $[20] !== buttonElement ? (t13 = () => {
5774
5987
  setOpen(!1), !disableRestoreFocusOnClose && buttonElement && buttonElement.focus();
5775
- }, [buttonElement, disableRestoreFocusOnClose]), handleBlur = react.useCallback((event_2) => {
5988
+ }, $[19] = disableRestoreFocusOnClose, $[20] = buttonElement, $[21] = t13) : t13 = $[21];
5989
+ const handleMenuEscape = t13;
5990
+ let t14;
5991
+ $[22] !== menuElements ? (t14 = (event_2) => {
5776
5992
  const target_0 = event_2.relatedTarget;
5777
5993
  if (target_0 instanceof Node) {
5778
5994
  for (const el_0 of menuElements)
@@ -5780,9 +5996,18 @@ const MenuButton = react.forwardRef(function(props, forwardedRef) {
5780
5996
  return;
5781
5997
  setOpen(!1);
5782
5998
  }
5783
- }, [menuElements]), handleItemClick = react.useCallback(() => {
5999
+ }, $[22] = menuElements, $[23] = t14) : t14 = $[23];
6000
+ const handleBlur = t14;
6001
+ let t15;
6002
+ $[24] !== disableRestoreFocusOnClose || $[25] !== buttonElement ? (t15 = () => {
5784
6003
  setOpen(!1), !disableRestoreFocusOnClose && buttonElement && buttonElement.focus();
5785
- }, [buttonElement, disableRestoreFocusOnClose]), registerElement = react.useCallback((el_1) => (setChildMenuElements((els) => els.concat([el_1])), () => setChildMenuElements((els_0) => els_0.filter((_el) => _el !== el_1))), []), menuProps = react.useMemo(() => ({
6004
+ }, $[24] = disableRestoreFocusOnClose, $[25] = buttonElement, $[26] = t15) : t15 = $[26];
6005
+ const handleItemClick = t15;
6006
+ let t16;
6007
+ $[27] === Symbol.for("react.memo_cache_sentinel") ? (t16 = (el_1) => (setChildMenuElements((els) => els.concat([el_1])), () => setChildMenuElements((els_0) => els_0.filter((_el) => _el !== el_1))), $[27] = t16) : t16 = $[27];
6008
+ const registerElement = t16;
6009
+ let t17;
6010
+ $[28] !== id || $[29] !== handleBlur || $[30] !== handleMenuClickOutside || $[31] !== handleMenuEscape || $[32] !== handleItemClick || $[33] !== buttonElement || $[34] !== shouldFocus || $[35] !== menuProp ? (t17 = menuProp && react.cloneElement(menuProp, {
5786
6011
  "aria-labelledby": id,
5787
6012
  onBlurCapture: handleBlur,
5788
6013
  onClickOutside: handleMenuClickOutside,
@@ -5791,7 +6016,10 @@ const MenuButton = react.forwardRef(function(props, forwardedRef) {
5791
6016
  originElement: buttonElement,
5792
6017
  registerElement,
5793
6018
  shouldFocus
5794
- }), [buttonElement, handleMenuClickOutside, handleMenuEscape, handleItemClick, id, handleBlur, registerElement, shouldFocus]), menu = menuProp && react.cloneElement(menuProp, menuProps), ref = react.useRef(null), button = react.useMemo(() => buttonProp && react.cloneElement(buttonProp, {
6019
+ }), $[28] = id, $[29] = handleBlur, $[30] = handleMenuClickOutside, $[31] = handleMenuEscape, $[32] = handleItemClick, $[33] = buttonElement, $[34] = shouldFocus, $[35] = menuProp, $[36] = t17) : t17 = $[36];
6020
+ const menu = t17;
6021
+ let t18, t19;
6022
+ $[37] !== buttonProp || $[38] !== open || $[39] !== id || $[40] !== handleMouseDown ? (t19 = buttonProp && react.cloneElement(buttonProp, {
5795
6023
  "data-ui": "MenuButton",
5796
6024
  id,
5797
6025
  onClick: handleButtonClick,
@@ -5799,14 +6027,16 @@ const MenuButton = react.forwardRef(function(props, forwardedRef) {
5799
6027
  onMouseDown: handleMouseDown,
5800
6028
  "aria-haspopup": !0,
5801
6029
  "aria-expanded": open,
5802
- ref,
6030
+ ref: setButtonElement,
5803
6031
  selected: buttonProp.props.selected ?? open
5804
- }), [buttonProp, handleButtonClick, handleButtonKeyDown, handleMouseDown, id, open]);
5805
- react.useImperativeHandle(forwardedRef, () => ref.current), react.useEffect(() => {
5806
- if (button)
5807
- return setButtonElement(ref.current), () => setButtonElement(null);
5808
- }, [button]);
5809
- const popoverProps = react.useMemo(() => ({
6032
+ }), $[37] = buttonProp, $[38] = open, $[39] = id, $[40] = handleMouseDown, $[41] = t19) : t19 = $[41], t18 = t19;
6033
+ const button = t18;
6034
+ let t20, t21;
6035
+ $[42] !== buttonElement ? (t20 = () => buttonElement, t21 = [buttonElement], $[42] = buttonElement, $[43] = t20, $[44] = t21) : (t20 = $[43], t21 = $[44]), react.useImperativeHandle(forwardedRef, t20, t21);
6036
+ let t22, t23;
6037
+ $[45] !== popover ? (t23 = popover || {}, $[45] = popover, $[46] = t23) : t23 = $[46];
6038
+ let t24;
6039
+ $[47] !== deprecated_boundaryElement || $[48] !== deprecated_placement || $[49] !== deprecated_portal || $[50] !== deprecated_preventOverflow || $[51] !== deprecated_popoverRadius || $[52] !== deprecated_popoverScheme || $[53] !== t23 ? (t24 = {
5810
6040
  boundaryElement: deprecated_boundaryElement,
5811
6041
  overflow: "auto",
5812
6042
  placement: deprecated_placement,
@@ -5814,9 +6044,13 @@ const MenuButton = react.forwardRef(function(props, forwardedRef) {
5814
6044
  preventOverflow: deprecated_preventOverflow,
5815
6045
  radius: deprecated_popoverRadius,
5816
6046
  scheme: deprecated_popoverScheme,
5817
- ...popover || {}
5818
- }), [deprecated_boundaryElement, deprecated_placement, deprecated_popoverRadius, deprecated_popoverScheme, deprecated_portal, deprecated_preventOverflow, popover]);
5819
- return /* @__PURE__ */ jsxRuntime.jsx(Popover, { "data-ui": "MenuButton__popover", ...popoverProps, content: menu, open, children: button || /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {}) });
6047
+ ...t23
6048
+ }, $[47] = deprecated_boundaryElement, $[48] = deprecated_placement, $[49] = deprecated_portal, $[50] = deprecated_preventOverflow, $[51] = deprecated_popoverRadius, $[52] = deprecated_popoverScheme, $[53] = t23, $[54] = t24) : t24 = $[54], t22 = t24;
6049
+ const popoverProps = t22;
6050
+ let t25;
6051
+ $[55] !== button ? (t25 = button || /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {}), $[55] = button, $[56] = t25) : t25 = $[56];
6052
+ let t26;
6053
+ return $[57] !== popoverProps || $[58] !== menu || $[59] !== open || $[60] !== t25 ? (t26 = /* @__PURE__ */ jsxRuntime.jsx(Popover, { "data-ui": "MenuButton__popover", ...popoverProps, content: menu, open, children: t25 }), $[57] = popoverProps, $[58] = menu, $[59] = open, $[60] = t25, $[61] = t26) : t26 = $[61], t26;
5820
6054
  });
5821
6055
  MenuButton.displayName = "ForwardRef(MenuButton)";
5822
6056
  const MenuDivider = styledComponents.styled.hr`
@@ -6454,7 +6688,12 @@ function _temp() {
6454
6688
  return !0;
6455
6689
  }
6456
6690
  const subscribe = () => () => {
6457
- }, ToastContext = createGlobalScopedContext("@sanity/ui/context/toast", null), Root$1 = styledComponents.styled(Layer)`
6691
+ }, ToastContext = createGlobalScopedContext("@sanity/ui/context/toast", null);
6692
+ let toastId = 0;
6693
+ function generateToastId() {
6694
+ return String(toastId++);
6695
+ }
6696
+ const Root$1 = styledComponents.styled(Layer)`
6458
6697
  position: fixed;
6459
6698
  top: 0;
6460
6699
  left: 0;
@@ -6469,31 +6708,44 @@ const subscribe = () => () => {
6469
6708
  max-width: 420px;
6470
6709
  width: 100%;
6471
6710
  `;
6472
- let toastId = 0;
6473
6711
  function ToastProvider(props) {
6474
- const {
6712
+ const $ = reactCompilerRuntime.c(24), {
6475
6713
  children,
6476
- padding = 4,
6714
+ padding: t0,
6477
6715
  paddingX,
6478
6716
  paddingY,
6479
6717
  zOffset
6480
- } = props, [state, _setState] = react.useState([]), toastsRef = react.useRef({}), mounted = useMounted(), prefersReducedMotion = usePrefersReducedMotion(), variants = react.useMemo(() => ({
6481
- initial: {
6482
- opacity: 0,
6483
- [POPOVER_MOTION_CONTENT_OPACITY_PROPERTY]: 0,
6484
- y: 32,
6485
- scale: 0.25,
6486
- willChange: "transform"
6487
- },
6488
- animate: {
6489
- opacity: [0, 1, 1],
6490
- [POPOVER_MOTION_CONTENT_OPACITY_PROPERTY]: [0, 0, 1],
6491
- y: 0,
6492
- scale: 1
6493
- },
6718
+ } = props, padding = t0 === void 0 ? 4 : t0;
6719
+ let t1;
6720
+ $[0] === Symbol.for("react.memo_cache_sentinel") ? (t1 = [], $[0] = t1) : t1 = $[0];
6721
+ const [state, _setState] = react.useState(t1);
6722
+ let t2;
6723
+ $[1] === Symbol.for("react.memo_cache_sentinel") ? (t2 = {}, $[1] = t2) : t2 = $[1];
6724
+ const toastsRef = react.useRef(t2), mounted = useMounted(), prefersReducedMotion = usePrefersReducedMotion();
6725
+ let t3, t4, t5;
6726
+ $[2] === Symbol.for("react.memo_cache_sentinel") ? (t4 = {
6727
+ opacity: 0,
6728
+ [POPOVER_MOTION_CONTENT_OPACITY_PROPERTY]: 0,
6729
+ y: 32,
6730
+ scale: 0.25,
6731
+ willChange: "transform"
6732
+ }, t5 = [0, 1, 1], $[2] = t4, $[3] = t5) : (t4 = $[2], t5 = $[3]);
6733
+ let t6, t7;
6734
+ $[4] === Symbol.for("react.memo_cache_sentinel") ? (t6 = {
6735
+ opacity: t5,
6736
+ [POPOVER_MOTION_CONTENT_OPACITY_PROPERTY]: [0, 0, 1],
6737
+ y: 0,
6738
+ scale: 1
6739
+ }, t7 = [1, 1, 0], $[4] = t6, $[5] = t7) : (t6 = $[4], t7 = $[5]);
6740
+ let t8;
6741
+ $[6] === Symbol.for("react.memo_cache_sentinel") ? (t8 = [1, 0, 0], $[6] = t8) : t8 = $[6];
6742
+ let t9;
6743
+ $[7] !== prefersReducedMotion ? (t9 = {
6744
+ initial: t4,
6745
+ animate: t6,
6494
6746
  exit: {
6495
- opacity: [1, 1, 0],
6496
- [POPOVER_MOTION_CONTENT_OPACITY_PROPERTY]: [1, 0, 0],
6747
+ opacity: t7,
6748
+ [POPOVER_MOTION_CONTENT_OPACITY_PROPERTY]: t8,
6497
6749
  scale: 0.5,
6498
6750
  transition: prefersReducedMotion ? {
6499
6751
  duration: 0
@@ -6501,10 +6753,13 @@ function ToastProvider(props) {
6501
6753
  duration: 0.2
6502
6754
  }
6503
6755
  }
6504
- }), [prefersReducedMotion]), value = react.useMemo(() => ({
6756
+ }, $[7] = prefersReducedMotion, $[8] = t9) : t9 = $[8], t3 = t9;
6757
+ const variants = t3;
6758
+ let t10, t11;
6759
+ $[9] === Symbol.for("react.memo_cache_sentinel") ? (t11 = {
6505
6760
  version: 0,
6506
6761
  push: (params) => {
6507
- const setState = (state_0) => react.startTransition(() => _setState(state_0)), id = params.id || String(toastId++), duration = params.duration || 5e3, dismiss = () => {
6762
+ const setState = (state_0) => react.startTransition(() => _setState(state_0)), id = params.id || generateToastId(), duration = params.duration || 5e3, dismiss = () => {
6508
6763
  const timeoutId = toastsRef.current[id]?.timeoutId;
6509
6764
  setState((prevState) => {
6510
6765
  const idx = prevState.findIndex((t) => t.id === id);
@@ -6526,27 +6781,36 @@ function ToastProvider(props) {
6526
6781
  timeoutId: setTimeout(dismiss, duration)
6527
6782
  }, id;
6528
6783
  }
6529
- }), []);
6530
- return react.useEffect(() => () => {
6784
+ }, $[9] = t11) : t11 = $[9], t10 = t11;
6785
+ const value = t10;
6786
+ let t12, t13;
6787
+ $[10] === Symbol.for("react.memo_cache_sentinel") ? (t12 = () => () => {
6531
6788
  for (const {
6532
6789
  timeoutId: timeoutId_0
6533
6790
  } of Object.values(toastsRef.current))
6534
6791
  clearTimeout(timeoutId_0);
6535
6792
  toastsRef.current = {};
6536
- }, []), /* @__PURE__ */ jsxRuntime.jsxs(ToastContext.Provider, { value, children: [
6537
- children,
6538
- mounted && /* @__PURE__ */ jsxRuntime.jsx(Root$1, { "data-ui": "ToastProvider", zOffset, children: /* @__PURE__ */ jsxRuntime.jsx(ToastContainer, { children: /* @__PURE__ */ jsxRuntime.jsx(Box, { padding, paddingX, paddingY, children: /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { initial: !1, children: state.map(({
6793
+ }, t13 = [], $[10] = t12, $[11] = t13) : (t12 = $[10], t13 = $[11]), react.useEffect(t12, t13);
6794
+ let t14;
6795
+ $[12] !== mounted || $[13] !== variants || $[14] !== prefersReducedMotion || $[15] !== state || $[16] !== padding || $[17] !== paddingX || $[18] !== paddingY || $[19] !== zOffset ? (t14 = mounted && /* @__PURE__ */ jsxRuntime.jsx(Root$1, { "data-ui": "ToastProvider", zOffset, children: /* @__PURE__ */ jsxRuntime.jsx(ToastContainer, { children: /* @__PURE__ */ jsxRuntime.jsx(Box, { padding, paddingX, paddingY, children: /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { initial: !1, children: state.map((t152) => {
6796
+ const {
6539
6797
  dismiss: dismiss_0,
6540
6798
  id: id_0,
6541
6799
  params: params_0
6542
- }) => /* @__PURE__ */ jsxRuntime.jsx(framerMotion.motion.div, { layout: "position", initial: "initial", animate: "animate", exit: "exit", variants, transition: prefersReducedMotion ? {
6800
+ } = t152;
6801
+ return /* @__PURE__ */ jsxRuntime.jsx(framerMotion.motion.div, { layout: "position", initial: "initial", animate: "animate", exit: "exit", variants, transition: prefersReducedMotion ? {
6543
6802
  duration: 0
6544
6803
  } : {
6545
6804
  type: "spring",
6546
6805
  damping: 30,
6547
6806
  stiffness: 400
6548
- }, children: /* @__PURE__ */ jsxRuntime.jsx(Toast, { closable: params_0.closable, description: params_0.description, onClose: dismiss_0, status: params_0.status, title: params_0.title, duration: params_0.duration }) }, id_0)) }) }) }) })
6549
- ] });
6807
+ }, children: /* @__PURE__ */ jsxRuntime.jsx(Toast, { closable: params_0.closable, description: params_0.description, onClose: dismiss_0, status: params_0.status, title: params_0.title, duration: params_0.duration }) }, id_0);
6808
+ }) }) }) }) }), $[12] = mounted, $[13] = variants, $[14] = prefersReducedMotion, $[15] = state, $[16] = padding, $[17] = paddingX, $[18] = paddingY, $[19] = zOffset, $[20] = t14) : t14 = $[20];
6809
+ let t15;
6810
+ return $[21] !== children || $[22] !== t14 ? (t15 = /* @__PURE__ */ jsxRuntime.jsxs(ToastContext.Provider, { value, children: [
6811
+ children,
6812
+ t14
6813
+ ] }), $[21] = children, $[22] = t14, $[23] = t15) : t15 = $[23], t15;
6550
6814
  }
6551
6815
  ToastProvider.displayName = "ToastProvider";
6552
6816
  function useToast() {